diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b0f8f79 Binary files /dev/null and b/.DS_Store differ diff --git a/SaraAttended/.DS_Store b/SaraAttended/.DS_Store new file mode 100644 index 0000000..3e38beb Binary files /dev/null and b/SaraAttended/.DS_Store differ diff --git a/SaraAttended/Podfile b/SaraAttended/Podfile new file mode 100644 index 0000000..4d73421 --- /dev/null +++ b/SaraAttended/Podfile @@ -0,0 +1,10 @@ +# Uncomment the next line to define a global platform for your project +platform :ios, '14.0' + +target 'SaraAttended' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + # Pods for SaraAttended + pod 'Firebase/Firestore' +end diff --git a/SaraAttended/Podfile.lock b/SaraAttended/Podfile.lock new file mode 100644 index 0000000..ac54b6a --- /dev/null +++ b/SaraAttended/Podfile.lock @@ -0,0 +1,450 @@ +PODS: + - 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/common (0.20200225.0): + - abseil/meta/type_traits + - abseil/types/optional + - abseil/container/compressed_tuple (0.20200225.0): + - abseil/utility/utility + - abseil/container/container_memory (0.20200225.0): + - abseil/memory/memory + - abseil/utility/utility + - abseil/container/fixed_array (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/container/flat_hash_map (0.20200225.0): + - abseil/algorithm/container + - abseil/container/container_memory + - abseil/container/hash_function_defaults + - abseil/container/raw_hash_map + - abseil/memory/memory + - abseil/container/hash_function_defaults (0.20200225.0): + - abseil/base/config + - abseil/hash/hash + - abseil/strings/strings + - abseil/container/hash_policy_traits (0.20200225.0): + - abseil/meta/type_traits + - abseil/container/hashtable_debug_hooks (0.20200225.0): + - abseil/base/config + - abseil/container/hashtablez_sampler (0.20200225.0): + - abseil/base/base + - abseil/base/core_headers + - abseil/base/exponential_biased + - abseil/container/have_sse + - abseil/debugging/stacktrace + - abseil/memory/memory + - abseil/synchronization/synchronization + - abseil/utility/utility + - abseil/container/have_sse (0.20200225.0) + - 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/container/layout (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/utility/utility + - abseil/container/raw_hash_map (0.20200225.0): + - abseil/base/throw_delegate + - abseil/container/container_memory + - abseil/container/raw_hash_set + - abseil/container/raw_hash_set (0.20200225.0): + - abseil/base/bits + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/common + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/hash_policy_traits + - abseil/container/hashtable_debug_hooks + - abseil/container/hashtablez_sampler + - abseil/container/have_sse + - abseil/container/layout + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/debugging/debugging_internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/errno_saver + - abseil/base/raw_logging_internal + - abseil/debugging/demangle_internal (0.20200225.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/stacktrace (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/debugging_internal + - abseil/debugging/symbolize (0.20200225.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/debugging/demangle_internal + - abseil/hash/city (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/hash/hash (0.20200225.0): + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/fixed_array + - abseil/hash/city + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/optional + - abseil/types/variant + - abseil/utility/utility + - 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/synchronization/graphcycles_internal (0.20200225.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/synchronization/kernel_timeout_internal (0.20200225.0): + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/time/time + - abseil/synchronization/synchronization (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/synchronization/graphcycles_internal + - abseil/synchronization/kernel_timeout_internal + - abseil/time/time + - 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/CoreOnly (8.9.1): + - FirebaseCore (= 8.9.1) + - Firebase/Firestore (8.9.1): + - Firebase/CoreOnly + - FirebaseFirestore (~> 8.9.1) + - FirebaseCore (8.9.1): + - FirebaseCoreDiagnostics (~> 8.0) + - GoogleUtilities/Environment (~> 7.6) + - GoogleUtilities/Logger (~> 7.6) + - FirebaseCoreDiagnostics (8.9.0): + - GoogleDataTransport (~> 9.1) + - GoogleUtilities/Environment (~> 7.6) + - GoogleUtilities/Logger (~> 7.6) + - nanopb (~> 2.30908.0) + - FirebaseFirestore (8.9.1): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/container/flat_hash_map (= 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 (~> 8.0) + - "gRPC-C++ (~> 1.28.0)" + - leveldb-library (~> 1.22) + - nanopb (~> 2.30908.0) + - GoogleDataTransport (9.1.2): + - GoogleUtilities/Environment (~> 7.2) + - nanopb (~> 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Environment (7.6.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.6.0): + - GoogleUtilities/Environment + - "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.1) + - nanopb (2.30908.0): + - nanopb/decode (= 2.30908.0) + - nanopb/encode (= 2.30908.0) + - nanopb/decode (2.30908.0) + - nanopb/encode (2.30908.0) + - PromisesObjC (2.0.0) + +DEPENDENCIES: + - Firebase/Firestore + +SPEC REPOS: + trunk: + - abseil + - BoringSSL-GRPC + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseFirestore + - GoogleDataTransport + - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - leveldb-library + - nanopb + - PromisesObjC + +SPEC CHECKSUMS: + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + Firebase: fb5114cd2bf96e2ff7bcb01d0d9a156cf5fd2f07 + FirebaseCore: c5aab092d9c4b8efea894946166b04c9d9ef0e68 + FirebaseCoreDiagnostics: 5daa63f1c1409d981a2d5007daa100b36eac6a34 + FirebaseFirestore: 15ae9648476436efed698a909e44c4737498f9b4 + GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 + GoogleUtilities: 684ee790a24f73ebb2d1d966e9711c203f2a4237 + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 + leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729 + nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 + PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 + +PODFILE CHECKSUM: 27e61aba74382c2ee0474a235d3bafc82c664173 + +COCOAPODS: 1.11.2 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/LICENSE b/SaraAttended/Pods/BoringSSL-GRPC/LICENSE new file mode 100644 index 0000000..49c41fa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/LICENSE @@ -0,0 +1,251 @@ +BoringSSL is a fork of OpenSSL. As such, large parts of it fall under OpenSSL +licensing. Files that are completely new have a Google copyright and an ISC +license. This license is reproduced at the bottom of this file. + +Contributors to BoringSSL are required to follow the CLA rules for Chromium: +https://cla.developers.google.com/clas + +Files in third_party/ have their own licenses, as described therein. The MIT +license, for third_party/fiat, which, unlike other third_party directories, is +compiled into non-test libraries, is included below. + +The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the +OpenSSL License and the original SSLeay license apply to the toolkit. See below +for the actual license texts. Actually both licenses are BSD-style Open Source +licenses. In case of any license issues related to OpenSSL please contact +openssl-core@openssl.org. + +The following are Google-internal bug numbers where explicit permission from +some authors is recorded for use of their work. (This is purely for our own +record keeping.) + 27287199 + 27287880 + 27287883 + + OpenSSL License + --------------- + +/* ==================================================================== + * 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). + * + */ + + Original SSLeay License + ----------------------- + +/* 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.] + */ + + +ISC license used for completely new code in BoringSSL: + +/* 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. */ + + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +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. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. diff --git a/SaraAttended/Pods/BoringSSL-GRPC/err_data.c b/SaraAttended/Pods/BoringSSL-GRPC/err_data.c new file mode 100644 index 0000000..dce06be --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/err_data.c @@ -0,0 +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. */ + + /* This file was generated by err_data_generate.go. */ + +#include +#include +#include + + +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[] = { + 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 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" + ""; + diff --git a/SaraAttended/Pods/BoringSSL-GRPC/err_data.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/err_data.c.grpc_back new file mode 100644 index 0000000..7830d6f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/err_data.c.grpc_back @@ -0,0 +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. */ + + /* This file was generated by err_data_generate.go. */ + +#include +#include +#include + + +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[] = { + 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 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" + ""; + diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c new file mode 100644 index 0000000..b650f49 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c @@ -0,0 +1,271 @@ +/* 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 "../internal.h" + + +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) +{ + return M_ASN1_BIT_STRING_set(x, d, len); +} + +int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) +{ + int ret, j, bits, len; + unsigned char *p, *d; + + if (a == NULL) + return (0); + + len = a->length; + + if (len > 0) { + if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) { + bits = (int)a->flags & 0x07; + } else { + for (; len > 0; len--) { + if (a->data[len - 1]) + break; + } + j = a->data[len - 1]; + if (j & 0x01) + bits = 0; + else if (j & 0x02) + bits = 1; + else if (j & 0x04) + bits = 2; + else if (j & 0x08) + bits = 3; + else if (j & 0x10) + bits = 4; + else if (j & 0x20) + bits = 5; + else if (j & 0x40) + bits = 6; + else if (j & 0x80) + bits = 7; + else + bits = 0; /* should not happen */ + } + } else + bits = 0; + + ret = 1 + len; + if (pp == NULL) + return (ret); + + p = *pp; + + *(p++) = (unsigned char)bits; + d = a->data; + OPENSSL_memcpy(p, d, len); + p += len; + if (len > 0) + p[-1] &= (0xff << bits); + *pp = p; + return (ret); +} + +ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, + const unsigned char **pp, long len) +{ + ASN1_BIT_STRING *ret = NULL; + const unsigned char *p; + unsigned char *s; + int padding; + + if (len < 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); + goto err; + } + + if (len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); + goto err; + } + + if ((a == NULL) || ((*a) == NULL)) { + if ((ret = M_ASN1_BIT_STRING_new()) == NULL) + return (NULL); + } else + ret = (*a); + + p = *pp; + padding = *(p++); + if (padding > 7) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT); + goto err; + } + + /* + * We do this to preserve the settings. If we modify the settings, via + * the _set_bit function, we will recalculate on output + */ + ret->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear */ + ret->flags |= (ASN1_STRING_FLAG_BITS_LEFT | padding); /* set */ + + if (len-- > 1) { /* using one because of the bits left byte */ + s = (unsigned char *)OPENSSL_malloc((int)len); + if (s == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(s, p, (int)len); + s[len - 1] &= (0xff << padding); + p += len; + } else + s = NULL; + + ret->length = (int)len; + if (ret->data != NULL) + OPENSSL_free(ret->data); + ret->data = s; + ret->type = V_ASN1_BIT_STRING; + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + if ((ret != NULL) && ((a == NULL) || (*a != ret))) + M_ASN1_BIT_STRING_free(ret); + return (NULL); +} + +/* + * These next 2 functions from Goetz Babin-Ebell + */ +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) +{ + int w, v, iv; + unsigned char *c; + + w = n / 8; + v = 1 << (7 - (n & 0x07)); + iv = ~v; + if (!value) + v = 0; + + if (a == NULL) + return 0; + + a->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear, set on write */ + + if ((a->length < (w + 1)) || (a->data == NULL)) { + if (!value) + return (1); /* Don't need to set */ + if (a->data == NULL) + c = (unsigned char *)OPENSSL_malloc(w + 1); + else + c = (unsigned char *)OPENSSL_realloc(a->data, w + 1); + if (c == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + if (w + 1 - a->length > 0) + OPENSSL_memset(c + a->length, 0, w + 1 - a->length); + a->data = c; + a->length = w + 1; + } + a->data[w] = ((a->data[w]) & iv) | v; + while ((a->length > 0) && (a->data[a->length - 1] == 0)) + a->length--; + return (1); +} + +int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) +{ + int w, v; + + w = n / 8; + v = 1 << (7 - (n & 0x07)); + if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL)) + return (0); + return ((a->data[w] & v) != 0); +} + +/* + * Checks if the given bit string contains only bits specified by + * the flags vector. Returns 0 if there is at least one bit set in 'a' + * which is not specified in 'flags', 1 otherwise. + * 'len' is the length of 'flags'. + */ +int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, + unsigned char *flags, int flags_len) +{ + int i, ok; + /* Check if there is one bit set at all. */ + if (!a || !a->data) + return 1; + + /* + * Check each byte of the internal representation of the bit string. + */ + ok = 1; + for (i = 0; i < a->length && ok; ++i) { + unsigned char mask = i < flags_len ? ~flags[i] : 0xff; + /* We are done if there is an unneeded bit set. */ + ok = (a->data[i] & mask) == 0; + } + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c.grpc_back new file mode 100644 index 0000000..3942638 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c.grpc_back @@ -0,0 +1,271 @@ +/* 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 "../internal.h" + + +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) +{ + return M_ASN1_BIT_STRING_set(x, d, len); +} + +int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) +{ + int ret, j, bits, len; + unsigned char *p, *d; + + if (a == NULL) + return (0); + + len = a->length; + + if (len > 0) { + if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) { + bits = (int)a->flags & 0x07; + } else { + for (; len > 0; len--) { + if (a->data[len - 1]) + break; + } + j = a->data[len - 1]; + if (j & 0x01) + bits = 0; + else if (j & 0x02) + bits = 1; + else if (j & 0x04) + bits = 2; + else if (j & 0x08) + bits = 3; + else if (j & 0x10) + bits = 4; + else if (j & 0x20) + bits = 5; + else if (j & 0x40) + bits = 6; + else if (j & 0x80) + bits = 7; + else + bits = 0; /* should not happen */ + } + } else + bits = 0; + + ret = 1 + len; + if (pp == NULL) + return (ret); + + p = *pp; + + *(p++) = (unsigned char)bits; + d = a->data; + OPENSSL_memcpy(p, d, len); + p += len; + if (len > 0) + p[-1] &= (0xff << bits); + *pp = p; + return (ret); +} + +ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, + const unsigned char **pp, long len) +{ + ASN1_BIT_STRING *ret = NULL; + const unsigned char *p; + unsigned char *s; + int padding; + + if (len < 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); + goto err; + } + + if (len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); + goto err; + } + + if ((a == NULL) || ((*a) == NULL)) { + if ((ret = M_ASN1_BIT_STRING_new()) == NULL) + return (NULL); + } else + ret = (*a); + + p = *pp; + padding = *(p++); + if (padding > 7) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT); + goto err; + } + + /* + * We do this to preserve the settings. If we modify the settings, via + * the _set_bit function, we will recalculate on output + */ + ret->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear */ + ret->flags |= (ASN1_STRING_FLAG_BITS_LEFT | padding); /* set */ + + if (len-- > 1) { /* using one because of the bits left byte */ + s = (unsigned char *)OPENSSL_malloc((int)len); + if (s == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(s, p, (int)len); + s[len - 1] &= (0xff << padding); + p += len; + } else + s = NULL; + + ret->length = (int)len; + if (ret->data != NULL) + OPENSSL_free(ret->data); + ret->data = s; + ret->type = V_ASN1_BIT_STRING; + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + if ((ret != NULL) && ((a == NULL) || (*a != ret))) + M_ASN1_BIT_STRING_free(ret); + return (NULL); +} + +/* + * These next 2 functions from Goetz Babin-Ebell + */ +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) +{ + int w, v, iv; + unsigned char *c; + + w = n / 8; + v = 1 << (7 - (n & 0x07)); + iv = ~v; + if (!value) + v = 0; + + if (a == NULL) + return 0; + + a->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear, set on write */ + + if ((a->length < (w + 1)) || (a->data == NULL)) { + if (!value) + return (1); /* Don't need to set */ + if (a->data == NULL) + c = (unsigned char *)OPENSSL_malloc(w + 1); + else + c = (unsigned char *)OPENSSL_realloc(a->data, w + 1); + if (c == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + if (w + 1 - a->length > 0) + OPENSSL_memset(c + a->length, 0, w + 1 - a->length); + a->data = c; + a->length = w + 1; + } + a->data[w] = ((a->data[w]) & iv) | v; + while ((a->length > 0) && (a->data[a->length - 1] == 0)) + a->length--; + return (1); +} + +int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) +{ + int w, v; + + w = n / 8; + v = 1 << (7 - (n & 0x07)); + if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL)) + return (0); + return ((a->data[w] & v) != 0); +} + +/* + * Checks if the given bit string contains only bits specified by + * the flags vector. Returns 0 if there is at least one bit set in 'a' + * which is not specified in 'flags', 1 otherwise. + * 'len' is the length of 'flags'. + */ +int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, + unsigned char *flags, int flags_len) +{ + int i, ok; + /* Check if there is one bit set at all. */ + if (!a || !a->data) + return 1; + + /* + * Check each byte of the internal representation of the bit string. + */ + ok = 1; + for (i = 0; i < a->length && ok; ++i) { + unsigned char mask = i < flags_len ? ~flags[i] : 0xff; + /* We are done if there is an unneeded bit set. */ + ok = (a->data[i] & mask) == 0; + } + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c new file mode 100644 index 0000000..0786c1a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c @@ -0,0 +1,123 @@ +/* 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 i2d_ASN1_BOOLEAN(int a, unsigned char **pp) +{ + int r; + unsigned char *p, *allocated = NULL; + + r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); + if (pp == NULL) + return (r); + + 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; + + /* + * 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) +{ + int ret = -1; + const unsigned char *p; + long len; + int inf, tag, xclass; + int i = 0; + + 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_BOOLEAN) { + i = ASN1_R_EXPECTING_A_BOOLEAN; + goto err; + } + + if (len != 1) { + i = ASN1_R_BOOLEAN_IS_WRONG_LENGTH; + goto err; + } + ret = (int)*(p++); + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + OPENSSL_PUT_ERROR(ASN1, i); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back new file mode 100644 index 0000000..34bbd15 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back @@ -0,0 +1,123 @@ +/* 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 i2d_ASN1_BOOLEAN(int a, unsigned char **pp) +{ + int r; + unsigned char *p, *allocated = NULL; + + r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); + if (pp == NULL) + return (r); + + 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; + + /* + * 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) +{ + int ret = -1; + const unsigned char *p; + long len; + int inf, tag, xclass; + int i = 0; + + 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_BOOLEAN) { + i = ASN1_R_EXPECTING_A_BOOLEAN; + goto err; + } + + if (len != 1) { + i = ASN1_R_BOOLEAN_IS_WRONG_LENGTH; + goto err; + } + ret = (int)*(p++); + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + OPENSSL_PUT_ERROR(ASN1, i); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c new file mode 100644 index 0000000..6a78bb5 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c.grpc_back new file mode 100644 index 0000000..fd423e2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c new file mode 100644 index 0000000..838ee9e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c @@ -0,0 +1,87 @@ +/* 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 + +/* + * 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 + * directly dup the underlying structure instead of doing and encode and + * decode. + */ +void *ASN1_item_dup(const ASN1_ITEM *it, void *x) +{ + unsigned char *b = NULL; + const unsigned char *p; + long i; + void *ret; + + if (x == NULL) + return (NULL); + + i = ASN1_item_i2d(x, &b, it); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + p = b; + ret = ASN1_item_d2i(NULL, &p, i, it); + OPENSSL_free(b); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back new file mode 100644 index 0000000..9ede851 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back @@ -0,0 +1,87 @@ +/* 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 + +/* + * 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 + * directly dup the underlying structure instead of doing and encode and + * decode. + */ +void *ASN1_item_dup(const ASN1_ITEM *it, void *x) +{ + unsigned char *b = NULL; + const unsigned char *p; + long i; + void *ret; + + if (x == NULL) + return (NULL); + + i = ASN1_item_i2d(x, &b, it); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + p = b; + ret = ASN1_item_d2i(NULL, &p, i, it); + OPENSSL_free(b); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c new file mode 100644 index 0000000..97fdf0f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c @@ -0,0 +1,195 @@ +/* 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 "../internal.h" + + +/* + * Code for ENUMERATED type: identical to INTEGER apart from a different tag. + * for comments on encoding see a_int.c + */ + +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) +{ + int j, k; + unsigned int i; + unsigned char buf[sizeof(long) + 1]; + long d; + + a->type = V_ASN1_ENUMERATED; + if (a->length < (int)(sizeof(long) + 1)) { + if (a->data != NULL) + OPENSSL_free(a->data); + if ((a->data = + (unsigned char *)OPENSSL_malloc(sizeof(long) + 1)) != NULL) + OPENSSL_memset((char *)a->data, 0, sizeof(long) + 1); + } + if (a->data == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (0); + } + d = v; + if (d < 0) { + d = -d; + a->type = V_ASN1_NEG_ENUMERATED; + } + + for (i = 0; i < sizeof(long); i++) { + if (d == 0) + break; + buf[i] = (int)d & 0xff; + d >>= 8; + } + j = 0; + for (k = i - 1; k >= 0; k--) + a->data[j++] = buf[k]; + a->length = j; + return (1); +} + +long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) +{ + int neg = 0, i; + + if (a == NULL) + return (0L); + i = a->type; + if (i == V_ASN1_NEG_ENUMERATED) + neg = 1; + else if (i != V_ASN1_ENUMERATED) + return -1; + + 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 -1; + } + + uint64_t r64 = 0; + if (a->data != NULL) { + for (i = 0; i < a->length; i++) { + r64 <<= 8; + r64 |= (unsigned char)a->data[i]; + } + + if (r64 > LONG_MAX) { + return -1; + } + } + + long r = (long) r64; + if (neg) + r = -r; + + return r; +} + +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) +{ + ASN1_ENUMERATED *ret; + int len, j; + + if (ai == NULL) + ret = M_ASN1_ENUMERATED_new(); + else + ret = ai; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (BN_is_negative(bn)) + ret->type = V_ASN1_NEG_ENUMERATED; + else + ret->type = V_ASN1_ENUMERATED; + j = BN_num_bits(bn); + len = ((j == 0) ? 0 : ((j / 8) + 1)); + if (ret->length < len + 4) { + unsigned char *new_data = OPENSSL_realloc(ret->data, len + 4); + if (!new_data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + ret->data = new_data; + } + + ret->length = BN_bn2bin(bn, ret->data); + return (ret); + err: + if (ret != ai) + M_ASN1_ENUMERATED_free(ret); + return (NULL); +} + +BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) +{ + BIGNUM *ret; + + if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BN_LIB); + else if (ai->type == V_ASN1_NEG_ENUMERATED) + BN_set_negative(ret, 1); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back new file mode 100644 index 0000000..11e60ac --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back @@ -0,0 +1,195 @@ +/* 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 "../internal.h" + + +/* + * Code for ENUMERATED type: identical to INTEGER apart from a different tag. + * for comments on encoding see a_int.c + */ + +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) +{ + int j, k; + unsigned int i; + unsigned char buf[sizeof(long) + 1]; + long d; + + a->type = V_ASN1_ENUMERATED; + if (a->length < (int)(sizeof(long) + 1)) { + if (a->data != NULL) + OPENSSL_free(a->data); + if ((a->data = + (unsigned char *)OPENSSL_malloc(sizeof(long) + 1)) != NULL) + OPENSSL_memset((char *)a->data, 0, sizeof(long) + 1); + } + if (a->data == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (0); + } + d = v; + if (d < 0) { + d = -d; + a->type = V_ASN1_NEG_ENUMERATED; + } + + for (i = 0; i < sizeof(long); i++) { + if (d == 0) + break; + buf[i] = (int)d & 0xff; + d >>= 8; + } + j = 0; + for (k = i - 1; k >= 0; k--) + a->data[j++] = buf[k]; + a->length = j; + return (1); +} + +long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) +{ + int neg = 0, i; + + if (a == NULL) + return (0L); + i = a->type; + if (i == V_ASN1_NEG_ENUMERATED) + neg = 1; + else if (i != V_ASN1_ENUMERATED) + return -1; + + 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 -1; + } + + uint64_t r64 = 0; + if (a->data != NULL) { + for (i = 0; i < a->length; i++) { + r64 <<= 8; + r64 |= (unsigned char)a->data[i]; + } + + if (r64 > LONG_MAX) { + return -1; + } + } + + long r = (long) r64; + if (neg) + r = -r; + + return r; +} + +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) +{ + ASN1_ENUMERATED *ret; + int len, j; + + if (ai == NULL) + ret = M_ASN1_ENUMERATED_new(); + else + ret = ai; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (BN_is_negative(bn)) + ret->type = V_ASN1_NEG_ENUMERATED; + else + ret->type = V_ASN1_ENUMERATED; + j = BN_num_bits(bn); + len = ((j == 0) ? 0 : ((j / 8) + 1)); + if (ret->length < len + 4) { + unsigned char *new_data = OPENSSL_realloc(ret->data, len + 4); + if (!new_data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + ret->data = new_data; + } + + ret->length = BN_bn2bin(bn, ret->data); + return (ret); + err: + if (ret != ai) + M_ASN1_ENUMERATED_free(ret); + return (NULL); +} + +BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) +{ + BIGNUM *ret; + + if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BN_LIB); + else if (ai->type == V_ASN1_NEG_ENUMERATED) + BN_set_negative(ret, 1); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c new file mode 100644 index 0000000..326e4eb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c @@ -0,0 +1,261 @@ +/* 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 "asn1_locl.h" + +int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d) +{ + static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 }; + static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 }; + char *a; + int n, i, l, o; + + if (d->type != V_ASN1_GENERALIZEDTIME) + return (0); + l = d->length; + a = (char *)d->data; + o = 0; + /* + * GENERALIZEDTIME is similar to UTCTIME except the year is represented + * as YYYY. This stuff treats everything as a two digit field so make + * first two fields 00 to 99 + */ + if (l < 13) + goto err; + for (i = 0; i < 7; i++) { + if ((i == 6) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + i++; + if (tm) + tm->tm_sec = 0; + break; + } + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + if (++o > l) + goto err; + + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if (++o > l) + goto err; + + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + switch (i) { + case 0: + tm->tm_year = n * 100 - 1900; + break; + case 1: + tm->tm_year += n; + break; + case 2: + tm->tm_mon = n - 1; + break; + case 3: + tm->tm_mday = n; + break; + case 4: + tm->tm_hour = n; + break; + case 5: + tm->tm_min = n; + break; + case 6: + tm->tm_sec = n; + break; + } + } + } + /* + * Optional fractional seconds: decimal point followed by one or more + * digits. + */ + if (a[o] == '.') { + if (++o > l) + goto err; + i = o; + while ((a[o] >= '0') && (a[o] <= '9') && (o <= l)) + o++; + /* Must have at least one digit after decimal point */ + if (i == o) + goto err; + } + + if (a[o] == 'Z') + o++; + else if ((a[o] == '+') || (a[o] == '-')) { + int offsign = a[o] == '-' ? 1 : -1, offset = 0; + o++; + if (o + 4 > l) + goto err; + for (i = 7; i < 9; i++) { + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + o++; + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + if (i == 7) + offset = n * 3600; + else if (i == 8) + offset += n * 60; + } + o++; + } + if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign)) + return 0; + } else if (a[o]) { + /* Missing time zone information. */ + goto err; + } + return (o == l); + err: + return (0); +} + +int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d) +{ + return asn1_generalizedtime_to_tm(NULL, d); +} + +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) +{ + ASN1_GENERALIZEDTIME t; + + t.type = V_ASN1_GENERALIZEDTIME; + t.length = strlen(str); + t.data = (unsigned char *)str; + if (ASN1_GENERALIZEDTIME_check(&t)) { + if (s != NULL) { + if (!ASN1_STRING_set((ASN1_STRING *)s, + (unsigned char *)str, t.length)) + return 0; + s->type = V_ASN1_GENERALIZEDTIME; + } + return (1); + } else + return (0); +} + +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, + time_t t) +{ + return ASN1_GENERALIZEDTIME_adj(s, t, 0, 0); +} + +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, + time_t t, int offset_day, + long offset_sec) +{ + char *p; + struct tm *ts; + struct tm data; + size_t len = 20; + ASN1_GENERALIZEDTIME *tmps = NULL; + + if (s == NULL) + tmps = ASN1_GENERALIZEDTIME_new(); + else + tmps = s; + if (tmps == NULL) + return NULL; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) + goto err; + + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + goto err; + } + + p = (char *)tmps->data; + if ((p == NULL) || ((size_t)tmps->length < len)) { + p = OPENSSL_malloc(len); + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_free(tmps->data); + tmps->data = (unsigned char *)p; + } + + BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, + ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, + ts->tm_sec); + tmps->length = strlen(p); + tmps->type = V_ASN1_GENERALIZEDTIME; + return tmps; + err: + if (s == NULL) + ASN1_GENERALIZEDTIME_free(tmps); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c.grpc_back new file mode 100644 index 0000000..5fcb65b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c.grpc_back @@ -0,0 +1,261 @@ +/* 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 "asn1_locl.h" + +int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d) +{ + static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 }; + static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 }; + char *a; + int n, i, l, o; + + if (d->type != V_ASN1_GENERALIZEDTIME) + return (0); + l = d->length; + a = (char *)d->data; + o = 0; + /* + * GENERALIZEDTIME is similar to UTCTIME except the year is represented + * as YYYY. This stuff treats everything as a two digit field so make + * first two fields 00 to 99 + */ + if (l < 13) + goto err; + for (i = 0; i < 7; i++) { + if ((i == 6) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + i++; + if (tm) + tm->tm_sec = 0; + break; + } + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + if (++o > l) + goto err; + + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if (++o > l) + goto err; + + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + switch (i) { + case 0: + tm->tm_year = n * 100 - 1900; + break; + case 1: + tm->tm_year += n; + break; + case 2: + tm->tm_mon = n - 1; + break; + case 3: + tm->tm_mday = n; + break; + case 4: + tm->tm_hour = n; + break; + case 5: + tm->tm_min = n; + break; + case 6: + tm->tm_sec = n; + break; + } + } + } + /* + * Optional fractional seconds: decimal point followed by one or more + * digits. + */ + if (a[o] == '.') { + if (++o > l) + goto err; + i = o; + while ((a[o] >= '0') && (a[o] <= '9') && (o <= l)) + o++; + /* Must have at least one digit after decimal point */ + if (i == o) + goto err; + } + + if (a[o] == 'Z') + o++; + else if ((a[o] == '+') || (a[o] == '-')) { + int offsign = a[o] == '-' ? 1 : -1, offset = 0; + o++; + if (o + 4 > l) + goto err; + for (i = 7; i < 9; i++) { + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + o++; + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + if (i == 7) + offset = n * 3600; + else if (i == 8) + offset += n * 60; + } + o++; + } + if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign)) + return 0; + } else if (a[o]) { + /* Missing time zone information. */ + goto err; + } + return (o == l); + err: + return (0); +} + +int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d) +{ + return asn1_generalizedtime_to_tm(NULL, d); +} + +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) +{ + ASN1_GENERALIZEDTIME t; + + t.type = V_ASN1_GENERALIZEDTIME; + t.length = strlen(str); + t.data = (unsigned char *)str; + if (ASN1_GENERALIZEDTIME_check(&t)) { + if (s != NULL) { + if (!ASN1_STRING_set((ASN1_STRING *)s, + (unsigned char *)str, t.length)) + return 0; + s->type = V_ASN1_GENERALIZEDTIME; + } + return (1); + } else + return (0); +} + +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, + time_t t) +{ + return ASN1_GENERALIZEDTIME_adj(s, t, 0, 0); +} + +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, + time_t t, int offset_day, + long offset_sec) +{ + char *p; + struct tm *ts; + struct tm data; + size_t len = 20; + ASN1_GENERALIZEDTIME *tmps = NULL; + + if (s == NULL) + tmps = ASN1_GENERALIZEDTIME_new(); + else + tmps = s; + if (tmps == NULL) + return NULL; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) + goto err; + + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + goto err; + } + + p = (char *)tmps->data; + if ((p == NULL) || ((size_t)tmps->length < len)) { + p = OPENSSL_malloc(len); + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_free(tmps->data); + tmps->data = (unsigned char *)p; + } + + BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, + ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, + ts->tm_sec); + tmps->length = strlen(p); + tmps->type = V_ASN1_GENERALIZEDTIME; + return tmps; + err: + if (s == NULL) + ASN1_GENERALIZEDTIME_free(tmps); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c new file mode 100644 index 0000000..8af01a3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c.grpc_back new file mode 100644 index 0000000..db0d812 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c new file mode 100644 index 0000000..f652250 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c @@ -0,0 +1,420 @@ +/* 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 "../internal.h" + + +ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x) +{ + return M_ASN1_INTEGER_dup(x); +} + +int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y) +{ + int neg, ret; + /* Compare signs */ + neg = x->type & V_ASN1_NEG; + if (neg != (y->type & V_ASN1_NEG)) { + if (neg) + return -1; + else + return 1; + } + + ret = ASN1_STRING_cmp(x, y); + + if (neg) + return -ret; + else + return ret; +} + +/* + * This converts an ASN1 INTEGER into its content encoding. + * The internal representation is an ASN1_STRING whose data is a big endian + * representation of the value, ignoring the sign. The sign is determined by + * the type: V_ASN1_INTEGER for positive and V_ASN1_NEG_INTEGER for negative. + * + * Positive integers are no problem: they are almost the same as the DER + * encoding, except if the first byte is >= 0x80 we need to add a zero pad. + * + * Negative integers are a bit trickier... + * The DER representation of negative integers is in 2s complement form. + * The internal form is converted by complementing each octet and finally + * adding one to the result. This can be done less messily with a little trick. + * If the internal form has trailing zeroes then they will become FF by the + * complement and 0 by the add one (due to carry) so just copy as many trailing + * zeros to the destination as there are in the source. The carry will add one + * to the last none zero octet: so complement this octet and add one and finally + * complement any left over until you get to the start of the string. + * + * Padding is a little trickier too. If the first bytes is > 0x80 then we pad + * with 0xff. However if the first byte is 0x80 and one of the following bytes + * is non-zero we pad with 0xff. The reason for this distinction is that 0x80 + * followed by optional zeros isn't padded. + */ + +int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) +{ + int pad = 0, ret, i, neg; + unsigned char *p, *n, pb = 0; + + if (a == NULL) + return (0); + neg = a->type & V_ASN1_NEG; + if (a->length == 0) + ret = 1; + else { + ret = a->length; + i = a->data[0]; + if (ret == 1 && i == 0) + neg = 0; + if (!neg && (i > 127)) { + pad = 1; + pb = 0; + } else if (neg) { + if (i > 128) { + pad = 1; + pb = 0xFF; + } else if (i == 128) { + /* + * Special case: if any other bytes non zero we pad: + * otherwise we don't. + */ + for (i = 1; i < a->length; i++) + if (a->data[i]) { + pad = 1; + pb = 0xFF; + break; + } + } + } + ret += pad; + } + if (pp == NULL) + return (ret); + p = *pp; + + if (pad) + *(p++) = pb; + if (a->length == 0) + *(p++) = 0; + else if (!neg) + OPENSSL_memcpy(p, a->data, (unsigned int)a->length); + else { + /* Begin at the end of the encoding */ + n = a->data + a->length - 1; + p += a->length - 1; + i = a->length; + /* Copy zeros to destination as long as source is zero */ + while (!*n && i > 1) { + *(p--) = 0; + n--; + i--; + } + /* Complement and increment next octet */ + *(p--) = ((*(n--)) ^ 0xff) + 1; + i--; + /* Complement any octets left */ + for (; i > 0; i--) + *(p--) = *(n--) ^ 0xff; + } + + *pp += ret; + return (ret); +} + +/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ + +ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long len) +{ + ASN1_INTEGER *ret = NULL; + const unsigned char *p, *pend; + 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); + ret->type = V_ASN1_INTEGER; + } else + ret = (*a); + + p = *pp; + pend = p + len; + + /* + * 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; + } + to = s; + if (!len) { + /* + * Strictly speaking this is an illegal INTEGER but we tolerate it. + */ + ret->type = V_ASN1_INTEGER; + } else if (*p & 0x80) { /* a negative number */ + ret->type = V_ASN1_NEG_INTEGER; + if ((*p == 0xff) && (len != 1)) { + p++; + len--; + } + i = len; + p += i - 1; + to += i - 1; + while ((!*p) && i) { + *(to--) = 0; + i--; + p--; + } + /* + * Special case: if all zeros then the number will be of the form FF + * followed by n zero bytes: this corresponds to 1 followed by n zero + * bytes. We've already written n zeros so we just append an extra + * one and set the first byte to a 1. This is treated separately + * because it is the only case where the number of bytes is larger + * than len. + */ + if (!i) { + *s = 1; + s[len] = 0; + len++; + } else { + *(to--) = (*(p--) ^ 0xff) + 1; + i--; + for (; i > 0; i--) + *(to--) = *(p--) ^ 0xff; + } + } else { + ret->type = V_ASN1_INTEGER; + if ((*p == 0) && (len != 1)) { + p++; + len--; + } + OPENSSL_memcpy(s, p, (int)len); + } + + if (ret->data != NULL) + OPENSSL_free(ret->data); + ret->data = s; + ret->length = (int)len; + if (a != NULL) + (*a) = ret; + *pp = pend; + 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) { + return ASN1_INTEGER_set_uint64(a, (uint64_t) v); + } + + if (!ASN1_INTEGER_set_uint64(a, 0 - (uint64_t) v)) { + return 0; + } + + a->type = V_ASN1_NEG_INTEGER; + return 1; +} + +int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v) +{ + uint8_t *const newdata = OPENSSL_malloc(sizeof(uint64_t)); + if (newdata == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_free(out->data); + out->data = newdata; + v = CRYPTO_bswap8(v); + memcpy(out->data, &v, sizeof(v)); + + out->type = V_ASN1_INTEGER; + + size_t leading_zeros; + for (leading_zeros = 0; leading_zeros < sizeof(uint64_t) - 1; + leading_zeros++) { + if (out->data[leading_zeros] != 0) { + break; + } + } + + out->length = sizeof(uint64_t) - leading_zeros; + OPENSSL_memmove(out->data, out->data + leading_zeros, out->length); + + return 1; +} + +long ASN1_INTEGER_get(const ASN1_INTEGER *a) +{ + int neg = 0, i; + + if (a == NULL) + return (0L); + i = a->type; + if (i == V_ASN1_NEG_INTEGER) + neg = 1; + else if (i != V_ASN1_INTEGER) + return -1; + + 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 */ + return -1; + } + + uint64_t r64 = 0; + if (a->data != NULL) { + for (i = 0; i < a->length; i++) { + r64 <<= 8; + r64 |= (unsigned char)a->data[i]; + } + + if (r64 > LONG_MAX) { + return -1; + } + } + + long r = (long) r64; + if (neg) + r = -r; + + return r; +} + +ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) +{ + ASN1_INTEGER *ret; + int len, j; + + if (ai == NULL) + ret = M_ASN1_INTEGER_new(); + else + ret = ai; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (BN_is_negative(bn) && !BN_is_zero(bn)) + ret->type = V_ASN1_NEG_INTEGER; + else + ret->type = V_ASN1_INTEGER; + j = BN_num_bits(bn); + len = ((j == 0) ? 0 : ((j / 8) + 1)); + if (ret->length < len + 4) { + unsigned char *new_data = OPENSSL_realloc(ret->data, len + 4); + if (!new_data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + ret->data = new_data; + } + ret->length = BN_bn2bin(bn, ret->data); + /* Correct zero case */ + if (!ret->length) { + ret->data[0] = 0; + ret->length = 1; + } + return (ret); + err: + if (ret != ai) + M_ASN1_INTEGER_free(ret); + return (NULL); +} + +BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) +{ + BIGNUM *ret; + + if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BN_LIB); + else if (ai->type == V_ASN1_NEG_INTEGER) + BN_set_negative(ret, 1); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back new file mode 100644 index 0000000..7b483f2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back @@ -0,0 +1,420 @@ +/* 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 "../internal.h" + + +ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x) +{ + return M_ASN1_INTEGER_dup(x); +} + +int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y) +{ + int neg, ret; + /* Compare signs */ + neg = x->type & V_ASN1_NEG; + if (neg != (y->type & V_ASN1_NEG)) { + if (neg) + return -1; + else + return 1; + } + + ret = ASN1_STRING_cmp(x, y); + + if (neg) + return -ret; + else + return ret; +} + +/* + * This converts an ASN1 INTEGER into its content encoding. + * The internal representation is an ASN1_STRING whose data is a big endian + * representation of the value, ignoring the sign. The sign is determined by + * the type: V_ASN1_INTEGER for positive and V_ASN1_NEG_INTEGER for negative. + * + * Positive integers are no problem: they are almost the same as the DER + * encoding, except if the first byte is >= 0x80 we need to add a zero pad. + * + * Negative integers are a bit trickier... + * The DER representation of negative integers is in 2s complement form. + * The internal form is converted by complementing each octet and finally + * adding one to the result. This can be done less messily with a little trick. + * If the internal form has trailing zeroes then they will become FF by the + * complement and 0 by the add one (due to carry) so just copy as many trailing + * zeros to the destination as there are in the source. The carry will add one + * to the last none zero octet: so complement this octet and add one and finally + * complement any left over until you get to the start of the string. + * + * Padding is a little trickier too. If the first bytes is > 0x80 then we pad + * with 0xff. However if the first byte is 0x80 and one of the following bytes + * is non-zero we pad with 0xff. The reason for this distinction is that 0x80 + * followed by optional zeros isn't padded. + */ + +int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) +{ + int pad = 0, ret, i, neg; + unsigned char *p, *n, pb = 0; + + if (a == NULL) + return (0); + neg = a->type & V_ASN1_NEG; + if (a->length == 0) + ret = 1; + else { + ret = a->length; + i = a->data[0]; + if (ret == 1 && i == 0) + neg = 0; + if (!neg && (i > 127)) { + pad = 1; + pb = 0; + } else if (neg) { + if (i > 128) { + pad = 1; + pb = 0xFF; + } else if (i == 128) { + /* + * Special case: if any other bytes non zero we pad: + * otherwise we don't. + */ + for (i = 1; i < a->length; i++) + if (a->data[i]) { + pad = 1; + pb = 0xFF; + break; + } + } + } + ret += pad; + } + if (pp == NULL) + return (ret); + p = *pp; + + if (pad) + *(p++) = pb; + if (a->length == 0) + *(p++) = 0; + else if (!neg) + OPENSSL_memcpy(p, a->data, (unsigned int)a->length); + else { + /* Begin at the end of the encoding */ + n = a->data + a->length - 1; + p += a->length - 1; + i = a->length; + /* Copy zeros to destination as long as source is zero */ + while (!*n && i > 1) { + *(p--) = 0; + n--; + i--; + } + /* Complement and increment next octet */ + *(p--) = ((*(n--)) ^ 0xff) + 1; + i--; + /* Complement any octets left */ + for (; i > 0; i--) + *(p--) = *(n--) ^ 0xff; + } + + *pp += ret; + return (ret); +} + +/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ + +ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long len) +{ + ASN1_INTEGER *ret = NULL; + const unsigned char *p, *pend; + 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); + ret->type = V_ASN1_INTEGER; + } else + ret = (*a); + + p = *pp; + pend = p + len; + + /* + * 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; + } + to = s; + if (!len) { + /* + * Strictly speaking this is an illegal INTEGER but we tolerate it. + */ + ret->type = V_ASN1_INTEGER; + } else if (*p & 0x80) { /* a negative number */ + ret->type = V_ASN1_NEG_INTEGER; + if ((*p == 0xff) && (len != 1)) { + p++; + len--; + } + i = len; + p += i - 1; + to += i - 1; + while ((!*p) && i) { + *(to--) = 0; + i--; + p--; + } + /* + * Special case: if all zeros then the number will be of the form FF + * followed by n zero bytes: this corresponds to 1 followed by n zero + * bytes. We've already written n zeros so we just append an extra + * one and set the first byte to a 1. This is treated separately + * because it is the only case where the number of bytes is larger + * than len. + */ + if (!i) { + *s = 1; + s[len] = 0; + len++; + } else { + *(to--) = (*(p--) ^ 0xff) + 1; + i--; + for (; i > 0; i--) + *(to--) = *(p--) ^ 0xff; + } + } else { + ret->type = V_ASN1_INTEGER; + if ((*p == 0) && (len != 1)) { + p++; + len--; + } + OPENSSL_memcpy(s, p, (int)len); + } + + if (ret->data != NULL) + OPENSSL_free(ret->data); + ret->data = s; + ret->length = (int)len; + if (a != NULL) + (*a) = ret; + *pp = pend; + 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) { + return ASN1_INTEGER_set_uint64(a, (uint64_t) v); + } + + if (!ASN1_INTEGER_set_uint64(a, 0 - (uint64_t) v)) { + return 0; + } + + a->type = V_ASN1_NEG_INTEGER; + return 1; +} + +int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v) +{ + uint8_t *const newdata = OPENSSL_malloc(sizeof(uint64_t)); + if (newdata == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_free(out->data); + out->data = newdata; + v = CRYPTO_bswap8(v); + memcpy(out->data, &v, sizeof(v)); + + out->type = V_ASN1_INTEGER; + + size_t leading_zeros; + for (leading_zeros = 0; leading_zeros < sizeof(uint64_t) - 1; + leading_zeros++) { + if (out->data[leading_zeros] != 0) { + break; + } + } + + out->length = sizeof(uint64_t) - leading_zeros; + OPENSSL_memmove(out->data, out->data + leading_zeros, out->length); + + return 1; +} + +long ASN1_INTEGER_get(const ASN1_INTEGER *a) +{ + int neg = 0, i; + + if (a == NULL) + return (0L); + i = a->type; + if (i == V_ASN1_NEG_INTEGER) + neg = 1; + else if (i != V_ASN1_INTEGER) + return -1; + + 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 */ + return -1; + } + + uint64_t r64 = 0; + if (a->data != NULL) { + for (i = 0; i < a->length; i++) { + r64 <<= 8; + r64 |= (unsigned char)a->data[i]; + } + + if (r64 > LONG_MAX) { + return -1; + } + } + + long r = (long) r64; + if (neg) + r = -r; + + return r; +} + +ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) +{ + ASN1_INTEGER *ret; + int len, j; + + if (ai == NULL) + ret = M_ASN1_INTEGER_new(); + else + ret = ai; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (BN_is_negative(bn) && !BN_is_zero(bn)) + ret->type = V_ASN1_NEG_INTEGER; + else + ret->type = V_ASN1_INTEGER; + j = BN_num_bits(bn); + len = ((j == 0) ? 0 : ((j / 8) + 1)); + if (ret->length < len + 4) { + unsigned char *new_data = OPENSSL_realloc(ret->data, len + 4); + if (!new_data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + ret->data = new_data; + } + ret->length = BN_bn2bin(bn, ret->data); + /* Correct zero case */ + if (!ret->length) { + ret->data[0] = 0; + ret->length = 1; + } + return (ret); + err: + if (ret != ai) + M_ASN1_INTEGER_free(ret); + return (NULL); +} + +BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) +{ + BIGNUM *ret; + + if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BN_LIB); + else if (ai->type == V_ASN1_NEG_INTEGER) + BN_set_negative(ret, 1); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c new file mode 100644 index 0000000..3eef437 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c.grpc_back new file mode 100644 index 0000000..1bbcd1b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c new file mode 100644 index 0000000..3a21f91 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c @@ -0,0 +1,286 @@ +/* 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 "../internal.h" + + +int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) +{ + unsigned char *p, *allocated = NULL; + int objsize; + + if ((a == NULL) || (a->data == NULL)) + return (0); + + objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT); + if (pp == NULL || objsize == -1) + return objsize; + + 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); + + /* + * 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) +{ + return OBJ_obj2txt(buf, buf_len, a, 0); +} + +int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) +{ + char buf[80], *p = buf; + int i; + + if ((a == NULL) || (a->data == NULL)) + return (BIO_write(bp, "NULL", 4)); + i = i2t_ASN1_OBJECT(buf, sizeof buf, a); + if (i > (int)(sizeof(buf) - 1)) { + p = OPENSSL_malloc(i + 1); + if (!p) + return -1; + i2t_ASN1_OBJECT(p, i + 1, a); + } + if (i <= 0) + return BIO_write(bp, "", 9); + BIO_write(bp, p, i); + if (p != buf) + OPENSSL_free(p); + return (i); +} + +ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long length) +{ + const unsigned char *p; + long len; + int tag, xclass; + int inf, i; + ASN1_OBJECT *ret = NULL; + 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_OBJECT) { + i = ASN1_R_EXPECTING_AN_OBJECT; + goto err; + } + ret = c2i_ASN1_OBJECT(a, &p, len); + if (ret) + *pp = p; + return ret; + err: + OPENSSL_PUT_ERROR(ASN1, i); + return (NULL); +} + +ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long len) +{ + ASN1_OBJECT *ret = NULL; + const unsigned char *p; + unsigned char *data; + int i, length; + + /* + * Sanity check OID encoding. Need at least one content octet. MSB must + * be clear in the last octet. can't have leading 0x80 in subidentifiers, + * see: X.690 8.19.2 + */ + if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || + p[len - 1] & 0x80) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + /* Now 0 < len <= INT_MAX, so the cast is safe. */ + length = (int)len; + for (i = 0; i < length; i++, p++) { + if (*p == 0x80 && (!i || !(p[-1] & 0x80))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + } + + /* + * only the ASN1_OBJECTs from the 'table' will have values for ->sn or + * ->ln + */ + if ((a == NULL) || ((*a) == NULL) || + !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) { + if ((ret = ASN1_OBJECT_new()) == NULL) + return (NULL); + } else + ret = (*a); + + p = *pp; + /* detach data from object */ + data = (unsigned char *)ret->data; + ret->data = NULL; + /* once detached we can change it */ + if ((data == NULL) || (ret->length < length)) { + ret->length = 0; + if (data != NULL) + OPENSSL_free(data); + data = (unsigned char *)OPENSSL_malloc(length); + if (data == NULL) { + i = ERR_R_MALLOC_FAILURE; + goto err; + } + ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA; + } + OPENSSL_memcpy(data, p, length); + /* reattach data to object, after which it remains const */ + ret->data = data; + ret->length = length; + ret->sn = NULL; + ret->ln = NULL; + /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ + p += length; + + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + OPENSSL_PUT_ERROR(ASN1, i); + if ((ret != NULL) && ((a == NULL) || (*a != ret))) + ASN1_OBJECT_free(ret); + return (NULL); +} + +ASN1_OBJECT *ASN1_OBJECT_new(void) +{ + ASN1_OBJECT *ret; + + ret = (ASN1_OBJECT *)OPENSSL_malloc(sizeof(ASN1_OBJECT)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + ret->length = 0; + ret->data = NULL; + ret->nid = 0; + ret->sn = NULL; + ret->ln = NULL; + ret->flags = ASN1_OBJECT_FLAG_DYNAMIC; + return (ret); +} + +void ASN1_OBJECT_free(ASN1_OBJECT *a) +{ + if (a == NULL) + return; + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) { +#ifndef CONST_STRICT /* disable purely for compile-time strict + * const checking. Doing this on a "real" + * compile will cause memory leaks */ + if (a->sn != NULL) + OPENSSL_free((void *)a->sn); + if (a->ln != NULL) + OPENSSL_free((void *)a->ln); +#endif + a->sn = a->ln = NULL; + } + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) { + if (a->data != NULL) + OPENSSL_free((void *)a->data); + a->data = NULL; + a->length = 0; + } + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) + OPENSSL_free(a); +} + +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, + const char *sn, const char *ln) +{ + ASN1_OBJECT o; + + o.sn = sn; + o.ln = ln; + o.data = data; + o.nid = nid; + o.length = len; + o.flags = ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA; + return (OBJ_dup(&o)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back new file mode 100644 index 0000000..97335bf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back @@ -0,0 +1,286 @@ +/* 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 "../internal.h" + + +int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) +{ + unsigned char *p, *allocated = NULL; + int objsize; + + if ((a == NULL) || (a->data == NULL)) + return (0); + + objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT); + if (pp == NULL || objsize == -1) + return objsize; + + 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); + + /* + * 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) +{ + return OBJ_obj2txt(buf, buf_len, a, 0); +} + +int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) +{ + char buf[80], *p = buf; + int i; + + if ((a == NULL) || (a->data == NULL)) + return (BIO_write(bp, "NULL", 4)); + i = i2t_ASN1_OBJECT(buf, sizeof buf, a); + if (i > (int)(sizeof(buf) - 1)) { + p = OPENSSL_malloc(i + 1); + if (!p) + return -1; + i2t_ASN1_OBJECT(p, i + 1, a); + } + if (i <= 0) + return BIO_write(bp, "", 9); + BIO_write(bp, p, i); + if (p != buf) + OPENSSL_free(p); + return (i); +} + +ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long length) +{ + const unsigned char *p; + long len; + int tag, xclass; + int inf, i; + ASN1_OBJECT *ret = NULL; + 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_OBJECT) { + i = ASN1_R_EXPECTING_AN_OBJECT; + goto err; + } + ret = c2i_ASN1_OBJECT(a, &p, len); + if (ret) + *pp = p; + return ret; + err: + OPENSSL_PUT_ERROR(ASN1, i); + return (NULL); +} + +ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long len) +{ + ASN1_OBJECT *ret = NULL; + const unsigned char *p; + unsigned char *data; + int i, length; + + /* + * Sanity check OID encoding. Need at least one content octet. MSB must + * be clear in the last octet. can't have leading 0x80 in subidentifiers, + * see: X.690 8.19.2 + */ + if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || + p[len - 1] & 0x80) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + /* Now 0 < len <= INT_MAX, so the cast is safe. */ + length = (int)len; + for (i = 0; i < length; i++, p++) { + if (*p == 0x80 && (!i || !(p[-1] & 0x80))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + } + + /* + * only the ASN1_OBJECTs from the 'table' will have values for ->sn or + * ->ln + */ + if ((a == NULL) || ((*a) == NULL) || + !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) { + if ((ret = ASN1_OBJECT_new()) == NULL) + return (NULL); + } else + ret = (*a); + + p = *pp; + /* detach data from object */ + data = (unsigned char *)ret->data; + ret->data = NULL; + /* once detached we can change it */ + if ((data == NULL) || (ret->length < length)) { + ret->length = 0; + if (data != NULL) + OPENSSL_free(data); + data = (unsigned char *)OPENSSL_malloc(length); + if (data == NULL) { + i = ERR_R_MALLOC_FAILURE; + goto err; + } + ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA; + } + OPENSSL_memcpy(data, p, length); + /* reattach data to object, after which it remains const */ + ret->data = data; + ret->length = length; + ret->sn = NULL; + ret->ln = NULL; + /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ + p += length; + + if (a != NULL) + (*a) = ret; + *pp = p; + return (ret); + err: + OPENSSL_PUT_ERROR(ASN1, i); + if ((ret != NULL) && ((a == NULL) || (*a != ret))) + ASN1_OBJECT_free(ret); + return (NULL); +} + +ASN1_OBJECT *ASN1_OBJECT_new(void) +{ + ASN1_OBJECT *ret; + + ret = (ASN1_OBJECT *)OPENSSL_malloc(sizeof(ASN1_OBJECT)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + ret->length = 0; + ret->data = NULL; + ret->nid = 0; + ret->sn = NULL; + ret->ln = NULL; + ret->flags = ASN1_OBJECT_FLAG_DYNAMIC; + return (ret); +} + +void ASN1_OBJECT_free(ASN1_OBJECT *a) +{ + if (a == NULL) + return; + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) { +#ifndef CONST_STRICT /* disable purely for compile-time strict + * const checking. Doing this on a "real" + * compile will cause memory leaks */ + if (a->sn != NULL) + OPENSSL_free((void *)a->sn); + if (a->ln != NULL) + OPENSSL_free((void *)a->ln); +#endif + a->sn = a->ln = NULL; + } + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) { + if (a->data != NULL) + OPENSSL_free((void *)a->data); + a->data = NULL; + a->length = 0; + } + if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) + OPENSSL_free(a); +} + +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, + const char *sn, const char *ln) +{ + ASN1_OBJECT o; + + o.sn = sn; + o.ln = ln; + o.data = data; + o.nid = nid; + o.length = len; + o.flags = ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA; + return (OBJ_dup(&o)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c new file mode 100644 index 0000000..c3f9212 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c @@ -0,0 +1,77 @@ +/* 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 + +ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x) +{ + return M_ASN1_OCTET_STRING_dup(x); +} + +int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, + const ASN1_OCTET_STRING *b) +{ + return M_ASN1_OCTET_STRING_cmp(a, b); +} + +int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, + int len) +{ + return M_ASN1_OCTET_STRING_set(x, d, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c.grpc_back new file mode 100644 index 0000000..2e74d6b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c.grpc_back @@ -0,0 +1,77 @@ +/* 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 + +ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x) +{ + return M_ASN1_OCTET_STRING_dup(x); +} + +int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, + const ASN1_OCTET_STRING *b) +{ + return M_ASN1_OCTET_STRING_cmp(a, b); +} + +int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, + int len) +{ + return M_ASN1_OCTET_STRING_set(x, d, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c new file mode 100644 index 0000000..d2532f6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.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 + +int ASN1_PRINTABLE_type(const unsigned char *s, int len) +{ + int c; + int ia5 = 0; + int t61 = 0; + + if (len <= 0) + len = -1; + if (s == NULL) + return (V_ASN1_PRINTABLESTRING); + + while ((*s) && (len-- != 0)) { + c = *(s++); + if (!(((c >= 'a') && (c <= 'z')) || + ((c >= 'A') && (c <= 'Z')) || + (c == ' ') || + ((c >= '0') && (c <= '9')) || + (c == ' ') || (c == '\'') || + (c == '(') || (c == ')') || + (c == '+') || (c == ',') || + (c == '-') || (c == '.') || + (c == '/') || (c == ':') || (c == '=') || (c == '?'))) + ia5 = 1; + if (c & 0x80) + t61 = 1; + } + if (t61) + return (V_ASN1_T61STRING); + if (ia5) + return (V_ASN1_IA5STRING); + return (V_ASN1_PRINTABLESTRING); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c.grpc_back new file mode 100644 index 0000000..2104521 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.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 + +int ASN1_PRINTABLE_type(const unsigned char *s, int len) +{ + int c; + int ia5 = 0; + int t61 = 0; + + if (len <= 0) + len = -1; + if (s == NULL) + return (V_ASN1_PRINTABLESTRING); + + while ((*s) && (len-- != 0)) { + c = *(s++); + if (!(((c >= 'a') && (c <= 'z')) || + ((c >= 'A') && (c <= 'Z')) || + (c == ' ') || + ((c >= '0') && (c <= '9')) || + (c == ' ') || (c == '\'') || + (c == '(') || (c == ')') || + (c == '+') || (c == ',') || + (c == '-') || (c == '.') || + (c == '/') || (c == ':') || (c == '=') || (c == '?'))) + ia5 = 1; + if (c & 0x80) + t61 = 1; + } + if (t61) + return (V_ASN1_T61STRING); + if (ia5) + return (V_ASN1_IA5STRING); + return (V_ASN1_PRINTABLESTRING); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c new file mode 100644 index 0000000..f294311 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c @@ -0,0 +1,313 @@ +/* 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 /* For bsearch */ +#include + +#include +#include +#include +#include + +DEFINE_STACK_OF(ASN1_STRING_TABLE) + +static STACK_OF(ASN1_STRING_TABLE) *stable = NULL; +static void st_free(ASN1_STRING_TABLE *tbl); + +/* + * This is the global mask for the mbstring functions: this is use to mask + * out certain types (such as BMPString and UTF8String) because certain + * software (e.g. Netscape) has problems with them. + */ + +static unsigned long global_mask = B_ASN1_UTF8STRING; + +void ASN1_STRING_set_default_mask(unsigned long mask) +{ + global_mask = mask; +} + +unsigned long ASN1_STRING_get_default_mask(void) +{ + return global_mask; +} + +/* + * This function sets the default to various "flavours" of configuration. + * based on an ASCII string. Currently this is: MASK:XXXX : a numerical mask + * value. nobmp : Don't use BMPStrings (just Printable, T61). pkix : PKIX + * recommendation in RFC2459. utf8only : only use UTF8Strings (RFC2459 + * recommendation for 2004). default: the default value, Printable, T61, BMP. + */ + +int ASN1_STRING_set_default_mask_asc(const char *p) +{ + unsigned long mask; + char *end; + if (!strncmp(p, "MASK:", 5)) { + if (!p[5]) + return 0; + mask = strtoul(p + 5, &end, 0); + if (*end) + return 0; + } else if (!strcmp(p, "nombstr")) + mask = ~((unsigned long)(B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)); + else if (!strcmp(p, "pkix")) + mask = ~((unsigned long)B_ASN1_T61STRING); + else if (!strcmp(p, "utf8only")) + mask = B_ASN1_UTF8STRING; + else if (!strcmp(p, "default")) + mask = 0xFFFFFFFFL; + else + return 0; + ASN1_STRING_set_default_mask(mask); + return 1; +} + +/* + * The following function generates an ASN1_STRING based on limits in a + * table. Frequently the types and length of an ASN1_STRING are restricted by + * a corresponding OID. For example certificates and certificate requests. + */ + +ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, + const unsigned char *in, int inlen, + int inform, int nid) +{ + ASN1_STRING_TABLE *tbl; + ASN1_STRING *str = NULL; + unsigned long mask; + int ret; + if (!out) + out = &str; + tbl = ASN1_STRING_TABLE_get(nid); + if (tbl) { + mask = tbl->mask; + if (!(tbl->flags & STABLE_NO_MASK)) + mask &= global_mask; + ret = ASN1_mbstring_ncopy(out, in, inlen, inform, mask, + tbl->minsize, tbl->maxsize); + } else + ret = + ASN1_mbstring_copy(out, in, inlen, inform, + DIRSTRING_TYPE & global_mask); + if (ret <= 0) + return NULL; + return *out; +} + +/* + * Now the tables and helper functions for the string table: + */ + +/* size limits: this stuff is taken straight from RFC3280 */ + +#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 +#define ub_serial_number 64 + +/* This table must be kept in NID order */ + +static const ASN1_STRING_TABLE tbl_standard[] = { + {NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0}, + {NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, + {NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0}, + {NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0}, + {NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0}, + {NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, + 0}, + {NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, + STABLE_NO_MASK}, + {NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0}, + {NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0}, + {NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0}, + {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, + STABLE_NO_MASK}, + {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, + {NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, + {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK}, + {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK} +}; + +static int sk_table_cmp(const ASN1_STRING_TABLE **a, + const ASN1_STRING_TABLE **b) +{ + return (*a)->nid - (*b)->nid; +} + +static int table_cmp(const void *in_a, const void *in_b) +{ + const ASN1_STRING_TABLE *a = in_a; + const ASN1_STRING_TABLE *b = in_b; + return a->nid - b->nid; +} + +ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid) +{ + int found; + size_t idx; + ASN1_STRING_TABLE *ttmp; + ASN1_STRING_TABLE fnd; + fnd.nid = nid; + + ttmp = + bsearch(&fnd, tbl_standard, + sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE), + sizeof(ASN1_STRING_TABLE), table_cmp); + if (ttmp) + 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; + return sk_ASN1_STRING_TABLE_value(stable, idx); +} + +int ASN1_STRING_TABLE_add(int nid, + long minsize, long maxsize, unsigned long mask, + unsigned long flags) +{ + ASN1_STRING_TABLE *tmp; + char new_nid = 0; + flags &= ~STABLE_FLAGS_MALLOC; + if (!stable) + stable = sk_ASN1_STRING_TABLE_new(sk_table_cmp); + if (!stable) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + if (!(tmp = ASN1_STRING_TABLE_get(nid))) { + tmp = OPENSSL_malloc(sizeof(ASN1_STRING_TABLE)); + if (!tmp) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + tmp->flags = flags | STABLE_FLAGS_MALLOC; + tmp->nid = nid; + tmp->minsize = tmp->maxsize = -1; + new_nid = 1; + } else + tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags; + if (minsize != -1) + tmp->minsize = minsize; + if (maxsize != -1) + tmp->maxsize = maxsize; + tmp->mask = mask; + if (new_nid) + sk_ASN1_STRING_TABLE_push(stable, tmp); + return 1; +} + +void ASN1_STRING_TABLE_cleanup(void) +{ + STACK_OF(ASN1_STRING_TABLE) *tmp; + tmp = stable; + if (!tmp) + return; + stable = NULL; + sk_ASN1_STRING_TABLE_pop_free(tmp, st_free); +} + +static void st_free(ASN1_STRING_TABLE *tbl) +{ + if (tbl->flags & STABLE_FLAGS_MALLOC) + OPENSSL_free(tbl); +} + +#ifdef STRING_TABLE_TEST + +int main(void) +{ + ASN1_STRING_TABLE *tmp; + int i, last_nid = -1; + + for (tmp = tbl_standard, i = 0; + i < sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE); i++, tmp++) { + if (tmp->nid < last_nid) { + last_nid = 0; + break; + } + last_nid = tmp->nid; + } + + if (last_nid != 0) { + printf("Table order OK\n"); + exit(0); + } + + for (tmp = tbl_standard, i = 0; + i < sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE); i++, tmp++) + printf("Index %d, NID %d, Name=%s\n", i, tmp->nid, + OBJ_nid2ln(tmp->nid)); + + return 0; +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back new file mode 100644 index 0000000..efbf0fa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back @@ -0,0 +1,313 @@ +/* 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 /* For bsearch */ +#include + +#include +#include +#include +#include + +DEFINE_STACK_OF(ASN1_STRING_TABLE) + +static STACK_OF(ASN1_STRING_TABLE) *stable = NULL; +static void st_free(ASN1_STRING_TABLE *tbl); + +/* + * This is the global mask for the mbstring functions: this is use to mask + * out certain types (such as BMPString and UTF8String) because certain + * software (e.g. Netscape) has problems with them. + */ + +static unsigned long global_mask = B_ASN1_UTF8STRING; + +void ASN1_STRING_set_default_mask(unsigned long mask) +{ + global_mask = mask; +} + +unsigned long ASN1_STRING_get_default_mask(void) +{ + return global_mask; +} + +/* + * This function sets the default to various "flavours" of configuration. + * based on an ASCII string. Currently this is: MASK:XXXX : a numerical mask + * value. nobmp : Don't use BMPStrings (just Printable, T61). pkix : PKIX + * recommendation in RFC2459. utf8only : only use UTF8Strings (RFC2459 + * recommendation for 2004). default: the default value, Printable, T61, BMP. + */ + +int ASN1_STRING_set_default_mask_asc(const char *p) +{ + unsigned long mask; + char *end; + if (!strncmp(p, "MASK:", 5)) { + if (!p[5]) + return 0; + mask = strtoul(p + 5, &end, 0); + if (*end) + return 0; + } else if (!strcmp(p, "nombstr")) + mask = ~((unsigned long)(B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)); + else if (!strcmp(p, "pkix")) + mask = ~((unsigned long)B_ASN1_T61STRING); + else if (!strcmp(p, "utf8only")) + mask = B_ASN1_UTF8STRING; + else if (!strcmp(p, "default")) + mask = 0xFFFFFFFFL; + else + return 0; + ASN1_STRING_set_default_mask(mask); + return 1; +} + +/* + * The following function generates an ASN1_STRING based on limits in a + * table. Frequently the types and length of an ASN1_STRING are restricted by + * a corresponding OID. For example certificates and certificate requests. + */ + +ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, + const unsigned char *in, int inlen, + int inform, int nid) +{ + ASN1_STRING_TABLE *tbl; + ASN1_STRING *str = NULL; + unsigned long mask; + int ret; + if (!out) + out = &str; + tbl = ASN1_STRING_TABLE_get(nid); + if (tbl) { + mask = tbl->mask; + if (!(tbl->flags & STABLE_NO_MASK)) + mask &= global_mask; + ret = ASN1_mbstring_ncopy(out, in, inlen, inform, mask, + tbl->minsize, tbl->maxsize); + } else + ret = + ASN1_mbstring_copy(out, in, inlen, inform, + DIRSTRING_TYPE & global_mask); + if (ret <= 0) + return NULL; + return *out; +} + +/* + * Now the tables and helper functions for the string table: + */ + +/* size limits: this stuff is taken straight from RFC3280 */ + +#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 +#define ub_serial_number 64 + +/* This table must be kept in NID order */ + +static const ASN1_STRING_TABLE tbl_standard[] = { + {NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0}, + {NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, + {NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0}, + {NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0}, + {NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0}, + {NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, + 0}, + {NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, + STABLE_NO_MASK}, + {NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0}, + {NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0}, + {NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0}, + {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, + STABLE_NO_MASK}, + {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, + {NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, + {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, + {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK}, + {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK} +}; + +static int sk_table_cmp(const ASN1_STRING_TABLE **a, + const ASN1_STRING_TABLE **b) +{ + return (*a)->nid - (*b)->nid; +} + +static int table_cmp(const void *in_a, const void *in_b) +{ + const ASN1_STRING_TABLE *a = in_a; + const ASN1_STRING_TABLE *b = in_b; + return a->nid - b->nid; +} + +ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid) +{ + int found; + size_t idx; + ASN1_STRING_TABLE *ttmp; + ASN1_STRING_TABLE fnd; + fnd.nid = nid; + + ttmp = + bsearch(&fnd, tbl_standard, + sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE), + sizeof(ASN1_STRING_TABLE), table_cmp); + if (ttmp) + 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; + return sk_ASN1_STRING_TABLE_value(stable, idx); +} + +int ASN1_STRING_TABLE_add(int nid, + long minsize, long maxsize, unsigned long mask, + unsigned long flags) +{ + ASN1_STRING_TABLE *tmp; + char new_nid = 0; + flags &= ~STABLE_FLAGS_MALLOC; + if (!stable) + stable = sk_ASN1_STRING_TABLE_new(sk_table_cmp); + if (!stable) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + if (!(tmp = ASN1_STRING_TABLE_get(nid))) { + tmp = OPENSSL_malloc(sizeof(ASN1_STRING_TABLE)); + if (!tmp) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + tmp->flags = flags | STABLE_FLAGS_MALLOC; + tmp->nid = nid; + tmp->minsize = tmp->maxsize = -1; + new_nid = 1; + } else + tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags; + if (minsize != -1) + tmp->minsize = minsize; + if (maxsize != -1) + tmp->maxsize = maxsize; + tmp->mask = mask; + if (new_nid) + sk_ASN1_STRING_TABLE_push(stable, tmp); + return 1; +} + +void ASN1_STRING_TABLE_cleanup(void) +{ + STACK_OF(ASN1_STRING_TABLE) *tmp; + tmp = stable; + if (!tmp) + return; + stable = NULL; + sk_ASN1_STRING_TABLE_pop_free(tmp, st_free); +} + +static void st_free(ASN1_STRING_TABLE *tbl) +{ + if (tbl->flags & STABLE_FLAGS_MALLOC) + OPENSSL_free(tbl); +} + +#ifdef STRING_TABLE_TEST + +int main(void) +{ + ASN1_STRING_TABLE *tmp; + int i, last_nid = -1; + + for (tmp = tbl_standard, i = 0; + i < sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE); i++, tmp++) { + if (tmp->nid < last_nid) { + last_nid = 0; + break; + } + last_nid = tmp->nid; + } + + if (last_nid != 0) { + printf("Table order OK\n"); + exit(0); + } + + for (tmp = tbl_standard, i = 0; + i < sizeof(tbl_standard) / sizeof(ASN1_STRING_TABLE); i++, tmp++) + printf("Index %d, NID %d, Name=%s\n", i, tmp->nid, + OBJ_nid2ln(tmp->nid)); + + return 0; +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c new file mode 100644 index 0000000..e74c2fe --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c @@ -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.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "asn1_locl.h" + +/* + * This is an implementation of the ASN1 Time structure which is: Time ::= + * CHOICE { utcTime UTCTime, generalTime GeneralizedTime } written by Steve + * Henson. + */ + +IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) + +IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME) + +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) +{ + return ASN1_TIME_adj(s, t, 0, 0); +} + +ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, + int offset_day, long offset_sec) +{ + struct tm *ts; + struct tm data; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ERROR_GETTING_TIME); + return NULL; + } + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + return NULL; + } + if ((ts->tm_year >= 50) && (ts->tm_year < 150)) + return ASN1_UTCTIME_adj(s, t, offset_day, offset_sec); + return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec); +} + +int ASN1_TIME_check(ASN1_TIME *t) +{ + if (t->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_check(t); + else if (t->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_check(t); + return 0; +} + +/* Convert an ASN1_TIME structure to GeneralizedTime */ +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out) +{ + ASN1_GENERALIZEDTIME *ret = NULL; + char *str; + int newlen; + + if (!ASN1_TIME_check(t)) + return NULL; + + if (!out || !*out) { + if (!(ret = ASN1_GENERALIZEDTIME_new())) + goto err; + } else { + ret = *out; + } + + /* If already GeneralizedTime just copy across */ + if (t->type == V_ASN1_GENERALIZEDTIME) { + if (!ASN1_STRING_set(ret, t->data, t->length)) + goto err; + goto done; + } + + /* grow the string */ + if (!ASN1_STRING_set(ret, NULL, t->length + 2)) + goto err; + /* ASN1_STRING_set() allocated 'len + 1' bytes. */ + newlen = t->length + 2 + 1; + str = (char *)ret->data; + /* Work out the century and prepend */ + if (t->data[0] >= '5') + OPENSSL_strlcpy(str, "19", newlen); + else + OPENSSL_strlcpy(str, "20", newlen); + + OPENSSL_strlcat(str, (char *)t->data, newlen); + + done: + if (out != NULL && *out == NULL) + *out = ret; + return ret; + + err: + if (out == NULL || *out != ret) + ASN1_GENERALIZEDTIME_free(ret); + return NULL; +} + + +int ASN1_TIME_set_string(ASN1_TIME *s, const char *str) +{ + ASN1_TIME t; + + t.length = strlen(str); + t.data = (unsigned char *)str; + t.flags = 0; + + t.type = V_ASN1_UTCTIME; + + if (!ASN1_TIME_check(&t)) { + t.type = V_ASN1_GENERALIZEDTIME; + if (!ASN1_TIME_check(&t)) + return 0; + } + + if (s && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) + return 0; + + return 1; +} + +static int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *t) +{ + if (t == NULL) { + time_t now_t; + time(&now_t); + if (OPENSSL_gmtime(&now_t, tm)) + return 1; + return 0; + } + + if (t->type == V_ASN1_UTCTIME) + return asn1_utctime_to_tm(tm, t); + else if (t->type == V_ASN1_GENERALIZEDTIME) + return asn1_generalizedtime_to_tm(tm, t); + + return 0; +} + +int ASN1_TIME_diff(int *pday, int *psec, + const ASN1_TIME *from, const ASN1_TIME *to) +{ + struct tm tm_from, tm_to; + if (!asn1_time_to_tm(&tm_from, from)) + return 0; + if (!asn1_time_to_tm(&tm_to, to)) + return 0; + return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_back new file mode 100644 index 0000000..51aae5d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_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.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "asn1_locl.h" + +/* + * This is an implementation of the ASN1 Time structure which is: Time ::= + * CHOICE { utcTime UTCTime, generalTime GeneralizedTime } written by Steve + * Henson. + */ + +IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) + +IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME) + +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) +{ + return ASN1_TIME_adj(s, t, 0, 0); +} + +ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, + int offset_day, long offset_sec) +{ + struct tm *ts; + struct tm data; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ERROR_GETTING_TIME); + return NULL; + } + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + return NULL; + } + if ((ts->tm_year >= 50) && (ts->tm_year < 150)) + return ASN1_UTCTIME_adj(s, t, offset_day, offset_sec); + return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec); +} + +int ASN1_TIME_check(ASN1_TIME *t) +{ + if (t->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_check(t); + else if (t->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_check(t); + return 0; +} + +/* Convert an ASN1_TIME structure to GeneralizedTime */ +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out) +{ + ASN1_GENERALIZEDTIME *ret = NULL; + char *str; + int newlen; + + if (!ASN1_TIME_check(t)) + return NULL; + + if (!out || !*out) { + if (!(ret = ASN1_GENERALIZEDTIME_new())) + goto err; + } else { + ret = *out; + } + + /* If already GeneralizedTime just copy across */ + if (t->type == V_ASN1_GENERALIZEDTIME) { + if (!ASN1_STRING_set(ret, t->data, t->length)) + goto err; + goto done; + } + + /* grow the string */ + if (!ASN1_STRING_set(ret, NULL, t->length + 2)) + goto err; + /* ASN1_STRING_set() allocated 'len + 1' bytes. */ + newlen = t->length + 2 + 1; + str = (char *)ret->data; + /* Work out the century and prepend */ + if (t->data[0] >= '5') + OPENSSL_strlcpy(str, "19", newlen); + else + OPENSSL_strlcpy(str, "20", newlen); + + OPENSSL_strlcat(str, (char *)t->data, newlen); + + done: + if (out != NULL && *out == NULL) + *out = ret; + return ret; + + err: + if (out == NULL || *out != ret) + ASN1_GENERALIZEDTIME_free(ret); + return NULL; +} + + +int ASN1_TIME_set_string(ASN1_TIME *s, const char *str) +{ + ASN1_TIME t; + + t.length = strlen(str); + t.data = (unsigned char *)str; + t.flags = 0; + + t.type = V_ASN1_UTCTIME; + + if (!ASN1_TIME_check(&t)) { + t.type = V_ASN1_GENERALIZEDTIME; + if (!ASN1_TIME_check(&t)) + return 0; + } + + if (s && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) + return 0; + + return 1; +} + +static int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *t) +{ + if (t == NULL) { + time_t now_t; + time(&now_t); + if (OPENSSL_gmtime(&now_t, tm)) + return 1; + return 0; + } + + if (t->type == V_ASN1_UTCTIME) + return asn1_utctime_to_tm(tm, t); + else if (t->type == V_ASN1_GENERALIZEDTIME) + return asn1_generalizedtime_to_tm(tm, t); + + return 0; +} + +int ASN1_TIME_diff(int *pday, int *psec, + const ASN1_TIME *from, const ASN1_TIME *to) +{ + struct tm tm_from, tm_to; + if (!asn1_time_to_tm(&tm_from, from)) + return 0; + if (!asn1_time_to_tm(&tm_to, to)) + return 0; + return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c new file mode 100644 index 0000000..9e4461d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c @@ -0,0 +1,151 @@ +/* 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 + +int ASN1_TYPE_get(ASN1_TYPE *a) +{ + if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) + return (a->type); + else + return (0); +} + +void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) +{ + if (a->value.ptr != NULL) { + ASN1_TYPE **tmp_a = &a; + ASN1_primitive_free((ASN1_VALUE **)tmp_a, NULL); + } + a->type = type; + if (type == V_ASN1_BOOLEAN) + a->value.boolean = value ? 0xff : 0; + else + a->value.ptr = value; +} + +int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value) +{ + if (!value || (type == V_ASN1_BOOLEAN)) { + void *p = (void *)value; + ASN1_TYPE_set(a, type, p); + } else if (type == V_ASN1_OBJECT) { + ASN1_OBJECT *odup; + odup = OBJ_dup(value); + if (!odup) + return 0; + ASN1_TYPE_set(a, type, odup); + } else { + ASN1_STRING *sdup; + sdup = ASN1_STRING_dup(value); + if (!sdup) + return 0; + ASN1_TYPE_set(a, type, sdup); + } + return 1; +} + +/* Returns 0 if they are equal, != 0 otherwise. */ +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) +{ + int result = -1; + + if (!a || !b || a->type != b->type) + return -1; + + switch (a->type) { + case V_ASN1_OBJECT: + result = OBJ_cmp(a->value.object, b->value.object); + break; + case V_ASN1_NULL: + result = 0; /* They do not have content. */ + break; + case V_ASN1_BOOLEAN: + result = a->value.boolean - b->value.boolean; + break; + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + case V_ASN1_BIT_STRING: + case V_ASN1_OCTET_STRING: + case V_ASN1_SEQUENCE: + case V_ASN1_SET: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_OTHER: + default: + result = ASN1_STRING_cmp((ASN1_STRING *)a->value.ptr, + (ASN1_STRING *)b->value.ptr); + break; + } + + return result; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c.grpc_back new file mode 100644 index 0000000..734ff8b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c.grpc_back @@ -0,0 +1,151 @@ +/* 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 + +int ASN1_TYPE_get(ASN1_TYPE *a) +{ + if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) + return (a->type); + else + return (0); +} + +void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) +{ + if (a->value.ptr != NULL) { + ASN1_TYPE **tmp_a = &a; + ASN1_primitive_free((ASN1_VALUE **)tmp_a, NULL); + } + a->type = type; + if (type == V_ASN1_BOOLEAN) + a->value.boolean = value ? 0xff : 0; + else + a->value.ptr = value; +} + +int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value) +{ + if (!value || (type == V_ASN1_BOOLEAN)) { + void *p = (void *)value; + ASN1_TYPE_set(a, type, p); + } else if (type == V_ASN1_OBJECT) { + ASN1_OBJECT *odup; + odup = OBJ_dup(value); + if (!odup) + return 0; + ASN1_TYPE_set(a, type, odup); + } else { + ASN1_STRING *sdup; + sdup = ASN1_STRING_dup(value); + if (!sdup) + return 0; + ASN1_TYPE_set(a, type, sdup); + } + return 1; +} + +/* Returns 0 if they are equal, != 0 otherwise. */ +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) +{ + int result = -1; + + if (!a || !b || a->type != b->type) + return -1; + + switch (a->type) { + case V_ASN1_OBJECT: + result = OBJ_cmp(a->value.object, b->value.object); + break; + case V_ASN1_NULL: + result = 0; /* They do not have content. */ + break; + case V_ASN1_BOOLEAN: + result = a->value.boolean - b->value.boolean; + break; + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + case V_ASN1_BIT_STRING: + case V_ASN1_OCTET_STRING: + case V_ASN1_SEQUENCE: + case V_ASN1_SET: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_OTHER: + default: + result = ASN1_STRING_cmp((ASN1_STRING *)a->value.ptr, + (ASN1_STRING *)b->value.ptr); + break; + } + + return result; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c new file mode 100644 index 0000000..c005f81 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c @@ -0,0 +1,303 @@ +/* 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 "asn1_locl.h" + + +int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d) +{ + static const int min[8] = { 0, 1, 1, 0, 0, 0, 0, 0 }; + static const int max[8] = { 99, 12, 31, 23, 59, 59, 12, 59 }; + char *a; + int n, i, l, o; + + if (d->type != V_ASN1_UTCTIME) + return (0); + l = d->length; + a = (char *)d->data; + o = 0; + + if (l < 11) + goto err; + for (i = 0; i < 6; i++) { + if ((i == 5) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + i++; + if (tm) + tm->tm_sec = 0; + break; + } + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + if (++o > l) + goto err; + + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if (++o > l) + goto err; + + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + switch (i) { + case 0: + tm->tm_year = n < 50 ? n + 100 : n; + break; + case 1: + tm->tm_mon = n - 1; + break; + case 2: + tm->tm_mday = n; + break; + case 3: + tm->tm_hour = n; + break; + case 4: + tm->tm_min = n; + break; + case 5: + tm->tm_sec = n; + break; + } + } + } + if (a[o] == 'Z') + o++; + else if ((a[o] == '+') || (a[o] == '-')) { + int offsign = a[o] == '-' ? 1 : -1, offset = 0; + o++; + if (o + 4 > l) + goto err; + for (i = 6; i < 8; i++) { + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + o++; + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + if (i == 6) + offset = n * 3600; + else if (i == 7) + offset += n * 60; + } + o++; + } + if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign)) + return 0; + } + return o == l; + err: + return 0; +} + +int ASN1_UTCTIME_check(const ASN1_UTCTIME *d) +{ + return asn1_utctime_to_tm(NULL, d); +} + +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) +{ + ASN1_UTCTIME t; + + t.type = V_ASN1_UTCTIME; + t.length = strlen(str); + t.data = (unsigned char *)str; + if (ASN1_UTCTIME_check(&t)) { + if (s != NULL) { + if (!ASN1_STRING_set((ASN1_STRING *)s, + (unsigned char *)str, t.length)) + return 0; + s->type = V_ASN1_UTCTIME; + } + return (1); + } else + return (0); +} + +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) +{ + return ASN1_UTCTIME_adj(s, t, 0, 0); +} + +ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, + int offset_day, long offset_sec) +{ + char *p; + struct tm *ts; + struct tm data; + size_t len = 20; + int free_s = 0; + + if (s == NULL) { + free_s = 1; + s = M_ASN1_UTCTIME_new(); + } + if (s == NULL) + goto err; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) + goto err; + + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + goto err; + } + + if ((ts->tm_year < 50) || (ts->tm_year >= 150)) + goto err; + + p = (char *)s->data; + if ((p == NULL) || ((size_t)s->length < len)) { + p = OPENSSL_malloc(len); + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + if (s->data != NULL) + OPENSSL_free(s->data); + s->data = (unsigned char *)p; + } + + BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, + ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, + ts->tm_sec); + s->length = strlen(p); + s->type = V_ASN1_UTCTIME; + return (s); + err: + if (free_s && s) + M_ASN1_UTCTIME_free(s); + return NULL; +} + +int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) +{ + struct tm stm, ttm; + int day, sec; + + if (!asn1_utctime_to_tm(&stm, s)) + return -2; + + if (!OPENSSL_gmtime(&t, &ttm)) + return -2; + + if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm)) + return -2; + + if (day > 0) + return 1; + if (day < 0) + return -1; + if (sec > 0) + return 1; + if (sec < 0) + return -1; + return 0; +} + +#if 0 +time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s) +{ + struct tm tm; + int offset; + + OPENSSL_memset(&tm, '\0', sizeof tm); + +# define g2(p) (((p)[0]-'0')*10+(p)[1]-'0') + tm.tm_year = g2(s->data); + if (tm.tm_year < 50) + tm.tm_year += 100; + tm.tm_mon = g2(s->data + 2) - 1; + tm.tm_mday = g2(s->data + 4); + tm.tm_hour = g2(s->data + 6); + tm.tm_min = g2(s->data + 8); + tm.tm_sec = g2(s->data + 10); + if (s->data[12] == 'Z') + offset = 0; + else { + offset = g2(s->data + 13) * 60 + g2(s->data + 15); + if (s->data[12] == '-') + offset = -offset; + } +# undef g2 + + return mktime(&tm) - offset * 60; /* FIXME: mktime assumes the current + * timezone instead of UTC, and unless + * we rewrite OpenSSL in Lisp we cannot + * locally change the timezone without + * possibly interfering with other + * parts of the program. timegm, which + * uses UTC, is non-standard. Also + * time_t is inappropriate for general + * UTC times because it may a 32 bit + * type. */ +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c.grpc_back new file mode 100644 index 0000000..f7519df --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c.grpc_back @@ -0,0 +1,303 @@ +/* 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 "asn1_locl.h" + + +int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d) +{ + static const int min[8] = { 0, 1, 1, 0, 0, 0, 0, 0 }; + static const int max[8] = { 99, 12, 31, 23, 59, 59, 12, 59 }; + char *a; + int n, i, l, o; + + if (d->type != V_ASN1_UTCTIME) + return (0); + l = d->length; + a = (char *)d->data; + o = 0; + + if (l < 11) + goto err; + for (i = 0; i < 6; i++) { + if ((i == 5) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) { + i++; + if (tm) + tm->tm_sec = 0; + break; + } + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + if (++o > l) + goto err; + + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if (++o > l) + goto err; + + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + switch (i) { + case 0: + tm->tm_year = n < 50 ? n + 100 : n; + break; + case 1: + tm->tm_mon = n - 1; + break; + case 2: + tm->tm_mday = n; + break; + case 3: + tm->tm_hour = n; + break; + case 4: + tm->tm_min = n; + break; + case 5: + tm->tm_sec = n; + break; + } + } + } + if (a[o] == 'Z') + o++; + else if ((a[o] == '+') || (a[o] == '-')) { + int offsign = a[o] == '-' ? 1 : -1, offset = 0; + o++; + if (o + 4 > l) + goto err; + for (i = 6; i < 8; i++) { + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = a[o] - '0'; + o++; + if ((a[o] < '0') || (a[o] > '9')) + goto err; + n = (n * 10) + a[o] - '0'; + if ((n < min[i]) || (n > max[i])) + goto err; + if (tm) { + if (i == 6) + offset = n * 3600; + else if (i == 7) + offset += n * 60; + } + o++; + } + if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign)) + return 0; + } + return o == l; + err: + return 0; +} + +int ASN1_UTCTIME_check(const ASN1_UTCTIME *d) +{ + return asn1_utctime_to_tm(NULL, d); +} + +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) +{ + ASN1_UTCTIME t; + + t.type = V_ASN1_UTCTIME; + t.length = strlen(str); + t.data = (unsigned char *)str; + if (ASN1_UTCTIME_check(&t)) { + if (s != NULL) { + if (!ASN1_STRING_set((ASN1_STRING *)s, + (unsigned char *)str, t.length)) + return 0; + s->type = V_ASN1_UTCTIME; + } + return (1); + } else + return (0); +} + +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) +{ + return ASN1_UTCTIME_adj(s, t, 0, 0); +} + +ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, + int offset_day, long offset_sec) +{ + char *p; + struct tm *ts; + struct tm data; + size_t len = 20; + int free_s = 0; + + if (s == NULL) { + free_s = 1; + s = M_ASN1_UTCTIME_new(); + } + if (s == NULL) + goto err; + + ts = OPENSSL_gmtime(&t, &data); + if (ts == NULL) + goto err; + + if (offset_day || offset_sec) { + if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) + goto err; + } + + if ((ts->tm_year < 50) || (ts->tm_year >= 150)) + goto err; + + p = (char *)s->data; + if ((p == NULL) || ((size_t)s->length < len)) { + p = OPENSSL_malloc(len); + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + if (s->data != NULL) + OPENSSL_free(s->data); + s->data = (unsigned char *)p; + } + + BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, + ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, + ts->tm_sec); + s->length = strlen(p); + s->type = V_ASN1_UTCTIME; + return (s); + err: + if (free_s && s) + M_ASN1_UTCTIME_free(s); + return NULL; +} + +int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) +{ + struct tm stm, ttm; + int day, sec; + + if (!asn1_utctime_to_tm(&stm, s)) + return -2; + + if (!OPENSSL_gmtime(&t, &ttm)) + return -2; + + if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm)) + return -2; + + if (day > 0) + return 1; + if (day < 0) + return -1; + if (sec > 0) + return 1; + if (sec < 0) + return -1; + return 0; +} + +#if 0 +time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s) +{ + struct tm tm; + int offset; + + OPENSSL_memset(&tm, '\0', sizeof tm); + +# define g2(p) (((p)[0]-'0')*10+(p)[1]-'0') + tm.tm_year = g2(s->data); + if (tm.tm_year < 50) + tm.tm_year += 100; + tm.tm_mon = g2(s->data + 2) - 1; + tm.tm_mday = g2(s->data + 4); + tm.tm_hour = g2(s->data + 6); + tm.tm_min = g2(s->data + 8); + tm.tm_sec = g2(s->data + 10); + if (s->data[12] == 'Z') + offset = 0; + else { + offset = g2(s->data + 13) * 60 + g2(s->data + 15); + if (s->data[12] == '-') + offset = -offset; + } +# undef g2 + + return mktime(&tm) - offset * 60; /* FIXME: mktime assumes the current + * timezone instead of UTC, and unless + * we rewrite OpenSSL in Lisp we cannot + * locally change the timezone without + * possibly interfering with other + * parts of the program. timegm, which + * uses UTC, is non-standard. Also + * time_t is inappropriate for general + * UTC times because it may a 32 bit + * type. */ +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c new file mode 100644 index 0000000..59328d8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c @@ -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.] */ + +#include + +#include +#include + +#include "asn1_locl.h" + +/* UTF8 utilities */ + +/* + * This parses a UTF8 string one character at a time. It is passed a pointer + * to the string and the length of the string. It sets 'value' to the value + * of the current character. It returns the number of characters read or a + * negative error code: -1 = string too short -2 = illegal character -3 = + * subsequent characters not of the form 10xxxxxx -4 = character encoded + * incorrectly (not minimal length). + */ + +int UTF8_getc(const unsigned char *str, int len, uint32_t *val) +{ + const unsigned char *p; + uint32_t value; + int ret; + if (len <= 0) + return 0; + p = str; + + /* Check syntax and work out the encoded value (if correct) */ + if ((*p & 0x80) == 0) { + value = *p++ & 0x7f; + ret = 1; + } else if ((*p & 0xe0) == 0xc0) { + if (len < 2) + return -1; + if ((p[1] & 0xc0) != 0x80) + return -3; + value = (*p++ & 0x1f) << 6; + value |= *p++ & 0x3f; + if (value < 0x80) + return -4; + ret = 2; + } else if ((*p & 0xf0) == 0xe0) { + if (len < 3) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80)) + return -3; + value = (*p++ & 0xf) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x800) + return -4; + ret = 3; + } else if ((*p & 0xf8) == 0xf0) { + if (len < 4) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x7)) << 18; + value |= (*p++ & 0x3f) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x10000) + return -4; + ret = 4; + } else if ((*p & 0xfc) == 0xf8) { + if (len < 5) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80) + || ((p[4] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x3)) << 24; + value |= ((uint32_t)(*p++ & 0x3f)) << 18; + value |= ((uint32_t)(*p++ & 0x3f)) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x200000) + return -4; + ret = 5; + } else if ((*p & 0xfe) == 0xfc) { + if (len < 6) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80) + || ((p[4] & 0xc0) != 0x80) + || ((p[5] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x1)) << 30; + value |= ((uint32_t)(*p++ & 0x3f)) << 24; + value |= ((uint32_t)(*p++ & 0x3f)) << 18; + value |= ((uint32_t)(*p++ & 0x3f)) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x4000000) + return -4; + ret = 6; + } else + return -2; + *val = value; + return ret; +} + +/* + * This takes a character 'value' and writes the UTF8 encoded value in 'str' + * where 'str' is a buffer containing 'len' characters. Returns the number of + * characters written or -1 if 'len' is too small. 'str' can be set to NULL + * in which case it just returns the number of characters. It will need at + * most 6 characters. + */ + +int UTF8_putc(unsigned char *str, int len, uint32_t value) +{ + if (!str) + len = 6; /* Maximum we will need */ + else if (len <= 0) + return -1; + if (value < 0x80) { + if (str) + *str = (unsigned char)value; + return 1; + } + if (value < 0x800) { + if (len < 2) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 2; + } + if (value < 0x10000) { + if (len < 3) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 3; + } + if (value < 0x200000) { + if (len < 4) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 4; + } + if (value < 0x4000000) { + if (len < 5) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 24) & 0x3) | 0xf8); + *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 5; + } + if (len < 6) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 30) & 0x1) | 0xfc); + *str++ = (unsigned char)(((value >> 24) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 6; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c.grpc_back new file mode 100644 index 0000000..119ccf9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c.grpc_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.] */ + +#include + +#include +#include + +#include "asn1_locl.h" + +/* UTF8 utilities */ + +/* + * This parses a UTF8 string one character at a time. It is passed a pointer + * to the string and the length of the string. It sets 'value' to the value + * of the current character. It returns the number of characters read or a + * negative error code: -1 = string too short -2 = illegal character -3 = + * subsequent characters not of the form 10xxxxxx -4 = character encoded + * incorrectly (not minimal length). + */ + +int UTF8_getc(const unsigned char *str, int len, uint32_t *val) +{ + const unsigned char *p; + uint32_t value; + int ret; + if (len <= 0) + return 0; + p = str; + + /* Check syntax and work out the encoded value (if correct) */ + if ((*p & 0x80) == 0) { + value = *p++ & 0x7f; + ret = 1; + } else if ((*p & 0xe0) == 0xc0) { + if (len < 2) + return -1; + if ((p[1] & 0xc0) != 0x80) + return -3; + value = (*p++ & 0x1f) << 6; + value |= *p++ & 0x3f; + if (value < 0x80) + return -4; + ret = 2; + } else if ((*p & 0xf0) == 0xe0) { + if (len < 3) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80)) + return -3; + value = (*p++ & 0xf) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x800) + return -4; + ret = 3; + } else if ((*p & 0xf8) == 0xf0) { + if (len < 4) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x7)) << 18; + value |= (*p++ & 0x3f) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x10000) + return -4; + ret = 4; + } else if ((*p & 0xfc) == 0xf8) { + if (len < 5) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80) + || ((p[4] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x3)) << 24; + value |= ((uint32_t)(*p++ & 0x3f)) << 18; + value |= ((uint32_t)(*p++ & 0x3f)) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x200000) + return -4; + ret = 5; + } else if ((*p & 0xfe) == 0xfc) { + if (len < 6) + return -1; + if (((p[1] & 0xc0) != 0x80) + || ((p[2] & 0xc0) != 0x80) + || ((p[3] & 0xc0) != 0x80) + || ((p[4] & 0xc0) != 0x80) + || ((p[5] & 0xc0) != 0x80)) + return -3; + value = ((uint32_t)(*p++ & 0x1)) << 30; + value |= ((uint32_t)(*p++ & 0x3f)) << 24; + value |= ((uint32_t)(*p++ & 0x3f)) << 18; + value |= ((uint32_t)(*p++ & 0x3f)) << 12; + value |= (*p++ & 0x3f) << 6; + value |= *p++ & 0x3f; + if (value < 0x4000000) + return -4; + ret = 6; + } else + return -2; + *val = value; + return ret; +} + +/* + * This takes a character 'value' and writes the UTF8 encoded value in 'str' + * where 'str' is a buffer containing 'len' characters. Returns the number of + * characters written or -1 if 'len' is too small. 'str' can be set to NULL + * in which case it just returns the number of characters. It will need at + * most 6 characters. + */ + +int UTF8_putc(unsigned char *str, int len, uint32_t value) +{ + if (!str) + len = 6; /* Maximum we will need */ + else if (len <= 0) + return -1; + if (value < 0x80) { + if (str) + *str = (unsigned char)value; + return 1; + } + if (value < 0x800) { + if (len < 2) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 2; + } + if (value < 0x10000) { + if (len < 3) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 3; + } + if (value < 0x200000) { + if (len < 4) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 4; + } + if (value < 0x4000000) { + if (len < 5) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 24) & 0x3) | 0xf8); + *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 5; + } + if (len < 6) + return -1; + if (str) { + *str++ = (unsigned char)(((value >> 30) & 0x1) | 0xfc); + *str++ = (unsigned char)(((value >> 24) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); + *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); + *str = (unsigned char)((value & 0x3f) | 0x80); + } + return 6; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c new file mode 100644 index 0000000..7694e4e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c @@ -0,0 +1,446 @@ +/* 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 "../internal.h" + + +/* Cross-module errors from crypto/x509/i2d_pr.c. */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNSUPPORTED_PUBLIC_KEY_TYPE) + +/* Cross-module errors from crypto/x509/algorithm.c. */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, CONTEXT_NOT_INITIALISED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, DIGEST_AND_KEY_TYPE_NOT_SUPPORTED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_MESSAGE_DIGEST_ALGORITHM) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_SIGNATURE_ALGORITHM) +OPENSSL_DECLARE_ERROR_REASON(ASN1, WRONG_PUBLIC_KEY_TYPE) +/* + * Cross-module errors from crypto/x509/asn1_gen.c. TODO(davidben): Remove + * these once asn1_gen.c is gone. + */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, DEPTH_EXCEEDED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_BITSTRING_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_BOOLEAN) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_HEX) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_IMPLICIT_TAG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_INTEGER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_NESTED_TAGGING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_NULL_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_OBJECT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_TIME_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INTEGER_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_MODIFIER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_NUMBER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, LIST_ERROR) +OPENSSL_DECLARE_ERROR_REASON(ASN1, MISSING_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, OBJECT_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, SEQUENCE_OR_SET_NEEDS_CONFIG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, TIME_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_TAG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNSUPPORTED_TYPE) + +static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, + long max); +static void asn1_put_length(unsigned char **pp, int length); + +int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, + int *pclass, long omax) +{ + int i, ret; + long l; + const unsigned char *p = *pp; + int tag, xclass, inf; + long max = omax; + + if (!max) + goto err; + ret = (*p & V_ASN1_CONSTRUCTED); + xclass = (*p & V_ASN1_PRIVATE); + i = *p & V_ASN1_PRIMITIVE_TAG; + if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */ + p++; + if (--max == 0) + goto err; + l = 0; + while (*p & 0x80) { + l <<= 7L; + l |= *(p++) & 0x7f; + if (--max == 0) + goto err; + if (l > (INT_MAX >> 7L)) + goto err; + } + l <<= 7L; + l |= *(p++) & 0x7f; + tag = (int)l; + if (--max == 0) + goto err; + } else { + tag = i; + p++; + if (--max == 0) + goto err; + } + + /* To avoid ambiguity with V_ASN1_NEG, impose a limit on universal tags. */ + if (xclass == V_ASN1_UNIVERSAL && tag > V_ASN1_MAX_UNIVERSAL) + goto err; + + *ptag = tag; + *pclass = xclass; + if (!asn1_get_length(&p, &inf, plength, max)) + goto err; + + if (inf && !(ret & V_ASN1_CONSTRUCTED)) + goto err; + +#if 0 + fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", + (int)p, *plength, omax, (int)*pp, (int)(p + *plength), + (int)(omax + *pp)); + +#endif + if (*plength > (omax - (p - *pp))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + /* + * Set this so that even if things are not long enough the values are + * set correctly + */ + ret |= 0x80; + } + *pp = p; + return (ret | inf); + err: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); + return (0x80); +} + +static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, + long max) +{ + const unsigned char *p = *pp; + unsigned long ret = 0; + unsigned long i; + + if (max-- < 1) + return 0; + if (*p == 0x80) { + *inf = 1; + ret = 0; + p++; + } else { + *inf = 0; + i = *p & 0x7f; + if (*(p++) & 0x80) { + if (i > sizeof(ret) || max < (long)i) + return 0; + while (i-- > 0) { + ret <<= 8L; + ret |= *(p++); + } + } else + ret = i; + } + /* + * 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; + return 1; +} + +/* + * class 0 is constructed constructed == 2 for indefinite length constructed + */ +void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, + int xclass) +{ + unsigned char *p = *pp; + int i, ttag; + + i = (constructed) ? V_ASN1_CONSTRUCTED : 0; + i |= (xclass & V_ASN1_PRIVATE); + if (tag < 31) + *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG); + else { + *(p++) = i | V_ASN1_PRIMITIVE_TAG; + for (i = 0, ttag = tag; ttag > 0; i++) + ttag >>= 7; + ttag = i; + while (i-- > 0) { + p[i] = tag & 0x7f; + if (i != (ttag - 1)) + p[i] |= 0x80; + tag >>= 7; + } + p += ttag; + } + if (constructed == 2) + *(p++) = 0x80; + else + asn1_put_length(&p, length); + *pp = p; +} + +int ASN1_put_eoc(unsigned char **pp) +{ + unsigned char *p = *pp; + *p++ = 0; + *p++ = 0; + *pp = p; + return 2; +} + +static void asn1_put_length(unsigned char **pp, int length) +{ + unsigned char *p = *pp; + int i, l; + if (length <= 127) + *(p++) = (unsigned char)length; + else { + l = length; + for (i = 0; l > 0; i++) + l >>= 8; + *(p++) = i | 0x80; + l = i; + while (i-- > 0) { + p[i] = length & 0xff; + length >>= 8; + } + p += l; + } + *pp = p; +} + +int ASN1_object_size(int constructed, int length, int tag) +{ + int ret = 1; + if (length < 0) + return -1; + if (tag >= 31) { + while (tag > 0) { + tag >>= 7; + ret++; + } + } + if (constructed == 2) { + ret += 3; + } else { + ret++; + if (length > 127) { + int tmplen = length; + while (tmplen > 0) { + tmplen >>= 8; + ret++; + } + } + } + if (ret >= INT_MAX - length) + return -1; + return ret + length; +} + +int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str) +{ + if (str == NULL) + return 0; + dst->type = str->type; + if (!ASN1_STRING_set(dst, str->data, str->length)) + return 0; + dst->flags = str->flags; + return 1; +} + +ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) +{ + ASN1_STRING *ret; + if (!str) + return NULL; + ret = ASN1_STRING_new(); + if (!ret) + return NULL; + if (!ASN1_STRING_copy(ret, str)) { + ASN1_STRING_free(ret); + return NULL; + } + return ret; +} + +int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) +{ + unsigned char *c; + const char *data = _data; + + if (len < 0) { + if (data == NULL) + return (0); + else + len = strlen(data); + } + if ((str->length <= len) || (str->data == NULL)) { + c = str->data; + if (c == NULL) + str->data = OPENSSL_malloc(len + 1); + else + str->data = OPENSSL_realloc(c, len + 1); + + if (str->data == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + str->data = c; + return (0); + } + } + str->length = len; + if (data != NULL) { + OPENSSL_memcpy(str->data, data, len); + /* an allowance for strings :-) */ + str->data[len] = '\0'; + } + return (1); +} + +void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) +{ + if (str->data) + OPENSSL_free(str->data); + str->data = data; + str->length = len; +} + +ASN1_STRING *ASN1_STRING_new(void) +{ + return (ASN1_STRING_type_new(V_ASN1_OCTET_STRING)); +} + +ASN1_STRING *ASN1_STRING_type_new(int type) +{ + ASN1_STRING *ret; + + ret = (ASN1_STRING *)OPENSSL_malloc(sizeof(ASN1_STRING)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + ret->length = 0; + ret->type = type; + ret->data = NULL; + ret->flags = 0; + return (ret); +} + +void ASN1_STRING_free(ASN1_STRING *a) +{ + if (a == NULL) + return; + if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF)) + OPENSSL_free(a->data); + OPENSSL_free(a); +} + +int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) +{ + int i; + + i = (a->length - b->length); + if (i == 0) { + i = OPENSSL_memcmp(a->data, b->data, a->length); + if (i == 0) + return (a->type - b->type); + else + return (i); + } else + return (i); +} + +int ASN1_STRING_length(const ASN1_STRING *x) +{ + return M_ASN1_STRING_length(x); +} + +void ASN1_STRING_length_set(ASN1_STRING *x, int len) +{ + M_ASN1_STRING_length_set(x, len); + return; +} + +int ASN1_STRING_type(ASN1_STRING *x) +{ + return M_ASN1_STRING_type(x); +} + +unsigned char *ASN1_STRING_data(ASN1_STRING *x) +{ + return M_ASN1_STRING_data(x); +} + +const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) +{ + return x->data; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back new file mode 100644 index 0000000..8526aba --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back @@ -0,0 +1,446 @@ +/* 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 "../internal.h" + + +/* Cross-module errors from crypto/x509/i2d_pr.c. */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNSUPPORTED_PUBLIC_KEY_TYPE) + +/* Cross-module errors from crypto/x509/algorithm.c. */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, CONTEXT_NOT_INITIALISED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, DIGEST_AND_KEY_TYPE_NOT_SUPPORTED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_MESSAGE_DIGEST_ALGORITHM) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_SIGNATURE_ALGORITHM) +OPENSSL_DECLARE_ERROR_REASON(ASN1, WRONG_PUBLIC_KEY_TYPE) +/* + * Cross-module errors from crypto/x509/asn1_gen.c. TODO(davidben): Remove + * these once asn1_gen.c is gone. + */ +OPENSSL_DECLARE_ERROR_REASON(ASN1, DEPTH_EXCEEDED) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_BITSTRING_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_BOOLEAN) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_HEX) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_IMPLICIT_TAG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_INTEGER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_NESTED_TAGGING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_NULL_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_OBJECT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ILLEGAL_TIME_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INTEGER_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_MODIFIER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_NUMBER) +OPENSSL_DECLARE_ERROR_REASON(ASN1, LIST_ERROR) +OPENSSL_DECLARE_ERROR_REASON(ASN1, MISSING_VALUE) +OPENSSL_DECLARE_ERROR_REASON(ASN1, NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, OBJECT_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, SEQUENCE_OR_SET_NEEDS_CONFIG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, TIME_NOT_ASCII_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_FORMAT) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNKNOWN_TAG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, UNSUPPORTED_TYPE) + +static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, + long max); +static void asn1_put_length(unsigned char **pp, int length); + +int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, + int *pclass, long omax) +{ + int i, ret; + long l; + const unsigned char *p = *pp; + int tag, xclass, inf; + long max = omax; + + if (!max) + goto err; + ret = (*p & V_ASN1_CONSTRUCTED); + xclass = (*p & V_ASN1_PRIVATE); + i = *p & V_ASN1_PRIMITIVE_TAG; + if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */ + p++; + if (--max == 0) + goto err; + l = 0; + while (*p & 0x80) { + l <<= 7L; + l |= *(p++) & 0x7f; + if (--max == 0) + goto err; + if (l > (INT_MAX >> 7L)) + goto err; + } + l <<= 7L; + l |= *(p++) & 0x7f; + tag = (int)l; + if (--max == 0) + goto err; + } else { + tag = i; + p++; + if (--max == 0) + goto err; + } + + /* To avoid ambiguity with V_ASN1_NEG, impose a limit on universal tags. */ + if (xclass == V_ASN1_UNIVERSAL && tag > V_ASN1_MAX_UNIVERSAL) + goto err; + + *ptag = tag; + *pclass = xclass; + if (!asn1_get_length(&p, &inf, plength, max)) + goto err; + + if (inf && !(ret & V_ASN1_CONSTRUCTED)) + goto err; + +#if 0 + fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", + (int)p, *plength, omax, (int)*pp, (int)(p + *plength), + (int)(omax + *pp)); + +#endif + if (*plength > (omax - (p - *pp))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + /* + * Set this so that even if things are not long enough the values are + * set correctly + */ + ret |= 0x80; + } + *pp = p; + return (ret | inf); + err: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); + return (0x80); +} + +static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, + long max) +{ + const unsigned char *p = *pp; + unsigned long ret = 0; + unsigned long i; + + if (max-- < 1) + return 0; + if (*p == 0x80) { + *inf = 1; + ret = 0; + p++; + } else { + *inf = 0; + i = *p & 0x7f; + if (*(p++) & 0x80) { + if (i > sizeof(ret) || max < (long)i) + return 0; + while (i-- > 0) { + ret <<= 8L; + ret |= *(p++); + } + } else + ret = i; + } + /* + * 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; + return 1; +} + +/* + * class 0 is constructed constructed == 2 for indefinite length constructed + */ +void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, + int xclass) +{ + unsigned char *p = *pp; + int i, ttag; + + i = (constructed) ? V_ASN1_CONSTRUCTED : 0; + i |= (xclass & V_ASN1_PRIVATE); + if (tag < 31) + *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG); + else { + *(p++) = i | V_ASN1_PRIMITIVE_TAG; + for (i = 0, ttag = tag; ttag > 0; i++) + ttag >>= 7; + ttag = i; + while (i-- > 0) { + p[i] = tag & 0x7f; + if (i != (ttag - 1)) + p[i] |= 0x80; + tag >>= 7; + } + p += ttag; + } + if (constructed == 2) + *(p++) = 0x80; + else + asn1_put_length(&p, length); + *pp = p; +} + +int ASN1_put_eoc(unsigned char **pp) +{ + unsigned char *p = *pp; + *p++ = 0; + *p++ = 0; + *pp = p; + return 2; +} + +static void asn1_put_length(unsigned char **pp, int length) +{ + unsigned char *p = *pp; + int i, l; + if (length <= 127) + *(p++) = (unsigned char)length; + else { + l = length; + for (i = 0; l > 0; i++) + l >>= 8; + *(p++) = i | 0x80; + l = i; + while (i-- > 0) { + p[i] = length & 0xff; + length >>= 8; + } + p += l; + } + *pp = p; +} + +int ASN1_object_size(int constructed, int length, int tag) +{ + int ret = 1; + if (length < 0) + return -1; + if (tag >= 31) { + while (tag > 0) { + tag >>= 7; + ret++; + } + } + if (constructed == 2) { + ret += 3; + } else { + ret++; + if (length > 127) { + int tmplen = length; + while (tmplen > 0) { + tmplen >>= 8; + ret++; + } + } + } + if (ret >= INT_MAX - length) + return -1; + return ret + length; +} + +int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str) +{ + if (str == NULL) + return 0; + dst->type = str->type; + if (!ASN1_STRING_set(dst, str->data, str->length)) + return 0; + dst->flags = str->flags; + return 1; +} + +ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) +{ + ASN1_STRING *ret; + if (!str) + return NULL; + ret = ASN1_STRING_new(); + if (!ret) + return NULL; + if (!ASN1_STRING_copy(ret, str)) { + ASN1_STRING_free(ret); + return NULL; + } + return ret; +} + +int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) +{ + unsigned char *c; + const char *data = _data; + + if (len < 0) { + if (data == NULL) + return (0); + else + len = strlen(data); + } + if ((str->length <= len) || (str->data == NULL)) { + c = str->data; + if (c == NULL) + str->data = OPENSSL_malloc(len + 1); + else + str->data = OPENSSL_realloc(c, len + 1); + + if (str->data == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + str->data = c; + return (0); + } + } + str->length = len; + if (data != NULL) { + OPENSSL_memcpy(str->data, data, len); + /* an allowance for strings :-) */ + str->data[len] = '\0'; + } + return (1); +} + +void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) +{ + if (str->data) + OPENSSL_free(str->data); + str->data = data; + str->length = len; +} + +ASN1_STRING *ASN1_STRING_new(void) +{ + return (ASN1_STRING_type_new(V_ASN1_OCTET_STRING)); +} + +ASN1_STRING *ASN1_STRING_type_new(int type) +{ + ASN1_STRING *ret; + + ret = (ASN1_STRING *)OPENSSL_malloc(sizeof(ASN1_STRING)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return (NULL); + } + ret->length = 0; + ret->type = type; + ret->data = NULL; + ret->flags = 0; + return (ret); +} + +void ASN1_STRING_free(ASN1_STRING *a) +{ + if (a == NULL) + return; + if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF)) + OPENSSL_free(a->data); + OPENSSL_free(a); +} + +int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) +{ + int i; + + i = (a->length - b->length); + if (i == 0) { + i = OPENSSL_memcmp(a->data, b->data, a->length); + if (i == 0) + return (a->type - b->type); + else + return (i); + } else + return (i); +} + +int ASN1_STRING_length(const ASN1_STRING *x) +{ + return M_ASN1_STRING_length(x); +} + +void ASN1_STRING_length_set(ASN1_STRING *x, int len) +{ + M_ASN1_STRING_length_set(x, len); + return; +} + +int ASN1_STRING_type(ASN1_STRING *x) +{ + return M_ASN1_STRING_type(x); +} + +unsigned char *ASN1_STRING_data(ASN1_STRING *x) +{ + return M_ASN1_STRING_data(x); +} + +const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) +{ + return x->data; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h new file mode 100644 index 0000000..45405d2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h @@ -0,0 +1,104 @@ +/* asn1t.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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_ASN1_ASN1_LOCL_H +#define OPENSSL_HEADER_ASN1_ASN1_LOCL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* Wrapper functions for time functions. */ + +/* OPENSSL_gmtime wraps |gmtime_r|. See the manual page for that function. */ +struct tm *OPENSSL_gmtime(const time_t *time, struct tm *result); + +/* OPENSSL_gmtime_adj updates |tm| by adding |offset_day| days and |offset_sec| + * seconds. */ +int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); + +/* OPENSSL_gmtime_diff calculates the difference between |from| and |to| and + * outputs the difference as a number of days and seconds in |*out_days| and + * |*out_secs|. */ +int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, + const struct tm *to); + + +/* Internal ASN1 structures and functions: not for application use */ + +int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); +int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); + +void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine); + +int UTF8_getc(const unsigned char *str, int len, uint32_t *val); +int UTF8_putc(unsigned char *str, int len, uint32_t value); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_ASN1_ASN1_LOCL_H */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h.grpc_back new file mode 100644 index 0000000..8cef246 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h.grpc_back @@ -0,0 +1,104 @@ +/* asn1t.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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_ASN1_ASN1_LOCL_H +#define OPENSSL_HEADER_ASN1_ASN1_LOCL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* Wrapper functions for time functions. */ + +/* OPENSSL_gmtime wraps |gmtime_r|. See the manual page for that function. */ +struct tm *OPENSSL_gmtime(const time_t *time, struct tm *result); + +/* OPENSSL_gmtime_adj updates |tm| by adding |offset_day| days and |offset_sec| + * seconds. */ +int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); + +/* OPENSSL_gmtime_diff calculates the difference between |from| and |to| and + * outputs the difference as a number of days and seconds in |*out_days| and + * |*out_secs|. */ +int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, + const struct tm *to); + + +/* Internal ASN1 structures and functions: not for application use */ + +int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); +int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); + +void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine); + +int UTF8_getc(const unsigned char *str, int len, uint32_t *val); +int UTF8_putc(unsigned char *str, int len, uint32_t value); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_ASN1_ASN1_LOCL_H */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c new file mode 100644 index 0000000..55812d4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c @@ -0,0 +1,80 @@ +/* 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 + + +const char *ASN1_tag2str(int tag) +{ + static const char *const tag2str[] = { + "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */ + "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */ + "ENUMERATED", "", "UTF8STRING", "", /* 10-13 */ + "", "", "SEQUENCE", "SET", /* 15-17 */ + "NUMERICSTRING", "PRINTABLESTRING", "T61STRING", /* 18-20 */ + "VIDEOTEXSTRING", "IA5STRING", "UTCTIME", "GENERALIZEDTIME", /* 21-24 + */ + "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING", /* 25-27 */ + "UNIVERSALSTRING", "", "BMPSTRING" /* 28-30 */ + }; + + if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED)) + tag &= ~0x100; + + if (tag < 0 || tag > 30) + return "(unknown)"; + return tag2str[tag]; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c.grpc_back new file mode 100644 index 0000000..b1a01ed --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c.grpc_back @@ -0,0 +1,80 @@ +/* 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 + + +const char *ASN1_tag2str(int tag) +{ + static const char *const tag2str[] = { + "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */ + "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */ + "ENUMERATED", "", "UTF8STRING", "", /* 10-13 */ + "", "", "SEQUENCE", "SET", /* 15-17 */ + "NUMERICSTRING", "PRINTABLESTRING", "T61STRING", /* 18-20 */ + "VIDEOTEXSTRING", "IA5STRING", "UTCTIME", "GENERALIZEDTIME", /* 21-24 + */ + "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING", /* 25-27 */ + "UNIVERSALSTRING", "", "BMPSTRING" /* 28-30 */ + }; + + if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED)) + tag &= ~0x100; + + if (tag < 0 || tag > 30) + return "(unknown)"; + return tag2str[tag]; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c new file mode 100644 index 0000000..6b2a1e7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c @@ -0,0 +1,105 @@ +/* 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 + +/* ASN1_ITEM versions of the above */ + +ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) +{ + ASN1_STRING *octmp; + + if (!oct || !*oct) { + if (!(octmp = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (oct) + *oct = octmp; + } else + octmp = *oct; + + if (octmp->data) { + OPENSSL_free(octmp->data); + octmp->data = NULL; + } + + if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ENCODE_ERROR); + return NULL; + } + if (!octmp->data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + return octmp; +} + +/* Extract an ASN1 object from an ASN1_STRING */ + +void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) +{ + const unsigned char *p; + void *ret; + + p = oct->data; + if (!(ret = ASN1_item_d2i(NULL, &p, oct->length, it))) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c.grpc_back new file mode 100644 index 0000000..eff54e5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c.grpc_back @@ -0,0 +1,105 @@ +/* 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 + +/* ASN1_ITEM versions of the above */ + +ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) +{ + ASN1_STRING *octmp; + + if (!oct || !*oct) { + if (!(octmp = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (oct) + *oct = octmp; + } else + octmp = *oct; + + if (octmp->data) { + OPENSSL_free(octmp->data); + octmp->data = NULL; + } + + if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ENCODE_ERROR); + return NULL; + } + if (!octmp->data) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + return octmp; +} + +/* Extract an ASN1 object from an ASN1_STRING */ + +void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) +{ + const unsigned char *p; + void *ret; + + p = oct->data; + if (!(ret = ASN1_item_d2i(NULL, &p, oct->length, it))) + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c new file mode 100644 index 0000000..84e32b5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.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 + +/* Based on a_int.c: equivalent ENUMERATED functions */ + +int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->length == 0) { + if (BIO_write(bp, "00", 2) != 2) + goto err; + n = 2; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c.grpc_back new file mode 100644 index 0000000..7ce479d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.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 + +/* Based on a_int.c: equivalent ENUMERATED functions */ + +int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->length == 0) { + if (BIO_write(bp, "00", 2) != 2) + goto err; + n = 2; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c new file mode 100644 index 0000000..a7bd709 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c @@ -0,0 +1,97 @@ +/* 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 + +int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->type & V_ASN1_NEG) { + if (BIO_write(bp, "-", 1) != 1) + goto err; + n = 1; + } + + if (a->length == 0) { + if (BIO_write(bp, "00", 2) != 2) + goto err; + n += 2; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c.grpc_back new file mode 100644 index 0000000..79ea152 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c.grpc_back @@ -0,0 +1,97 @@ +/* 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 + +int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->type & V_ASN1_NEG) { + if (BIO_write(bp, "-", 1) != 1) + goto err; + n = 1; + } + + if (a->length == 0) { + if (BIO_write(bp, "00", 2) != 2) + goto err; + n += 2; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c new file mode 100644 index 0000000..a6af1a0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c @@ -0,0 +1,91 @@ +/* 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 + +int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->length == 0) { + if (BIO_write(bp, "0", 1) != 1) + goto err; + n = 1; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c.grpc_back new file mode 100644 index 0000000..97c6ae7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c.grpc_back @@ -0,0 +1,91 @@ +/* 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 + +int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) +{ + int i, n = 0; + static const char *h = "0123456789ABCDEF"; + char buf[2]; + + if (a == NULL) + return (0); + + if (a->length == 0) { + if (BIO_write(bp, "0", 1) != 1) + goto err; + n = 1; + } else { + for (i = 0; i < a->length; i++) { + if ((i != 0) && (i % 35 == 0)) { + if (BIO_write(bp, "\\\n", 2) != 2) + goto err; + n += 2; + } + buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f]; + buf[1] = h[((unsigned char)a->data[i]) & 0x0f]; + if (BIO_write(bp, buf, 2) != 2) + goto err; + n += 2; + } + } + return (n); + err: + return (-1); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c new file mode 100644 index 0000000..e205454 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c @@ -0,0 +1,1244 @@ +/* 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 "../internal.h" + +/* + * Constructed types with a recursive definition (such as can be found in PKCS7) + * could eventually exceed the stack given malicious input with excessive + * recursion. Therefore we limit the stack depth. This is the maximum number of + * recursive invocations of asn1_item_embed_d2i(). + */ +#define ASN1_MAX_CONSTRUCTED_NEST 30 + +static int asn1_check_eoc(const unsigned char **in, long len); +static int asn1_find_end(const unsigned char **in, long len, char inf); + +static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len, + char inf, int tag, int aclass, int depth); + +static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen); + +static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, + char *inf, char *cst, + const unsigned char **in, long len, + int exptag, int expclass, char opt, ASN1_TLC *ctx); + +static int asn1_template_ex_d2i(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth); +static int asn1_template_noexp_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth); +static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_ITEM *it, + int tag, int aclass, char opt, + ASN1_TLC *ctx); + +/* Table to convert tags to bit values, used for MSTRING type */ +static const unsigned long tag2bit[32] = { + 0, 0, 0, B_ASN1_BIT_STRING, /* tags 0 - 3 */ + B_ASN1_OCTET_STRING, 0, 0, B_ASN1_UNKNOWN, /* tags 4- 7 */ + B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, /* tags + * 8-11 */ + B_ASN1_UTF8STRING, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, /* tags + * 12-15 + */ + B_ASN1_SEQUENCE, 0, B_ASN1_NUMERICSTRING, B_ASN1_PRINTABLESTRING, /* tags + * 16-19 + */ + B_ASN1_T61STRING, B_ASN1_VIDEOTEXSTRING, B_ASN1_IA5STRING, /* tags 20-22 */ + B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME, /* tags 23-24 */ + B_ASN1_GRAPHICSTRING, B_ASN1_ISO64STRING, B_ASN1_GENERALSTRING, /* tags + * 25-27 */ + B_ASN1_UNIVERSALSTRING, B_ASN1_UNKNOWN, B_ASN1_BMPSTRING, B_ASN1_UNKNOWN, /* tags + * 28-31 + */ +}; + +unsigned long ASN1_tag2bit(int tag) +{ + if ((tag < 0) || (tag > 30)) + return 0; + return tag2bit[tag]; +} + +/* Macro to initialize and invalidate the cache */ + +#define asn1_tlc_clear(c) if (c) (c)->valid = 0 +/* Version to avoid compiler warning about 'c' always non-NULL */ +#define asn1_tlc_clear_nc(c) (c)->valid = 0 + +/* + * Decode an ASN1 item, this currently behaves just like a standard 'd2i' + * function. 'in' points to a buffer to read the data from, in future we + * will have more advanced versions that can input data a piece at a time and + * this will simply be a special case. + */ + +ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_ITEM *it) +{ + ASN1_TLC c; + ASN1_VALUE *ptmpval = NULL; + if (!pval) + pval = &ptmpval; + asn1_tlc_clear_nc(&c); + if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) + return *pval; + return NULL; +} + +/* + * Decode an item, taking care of IMPLICIT tagging, if any. If 'opt' set and + * tag mismatch return -1 to handle OPTIONAL + */ + +static 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 depth) +{ + const ASN1_TEMPLATE *tt, *errtt = NULL; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + const unsigned char *p = NULL, *q; + unsigned char *wp = NULL; /* BIG FAT WARNING! BREAKS CONST WHERE USED */ + unsigned char imphack = 0, oclass; + char seq_eoc, seq_nolen, cst, isopt; + long tmplen; + int i; + int otag; + int ret = 0; + ASN1_VALUE **pchptr, *ptmpval; + int combine = aclass & ASN1_TFLG_COMBINE; + aclass &= ~ASN1_TFLG_COMBINE; + if (!pval) + return 0; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + + /* + * Bound |len| to comfortably fit in an int. Lengths in this module often + * switch between int and long without overflow checks. + */ + if (len > INT_MAX/2) { + len = INT_MAX/2; + } + + if (++depth > ASN1_MAX_CONSTRUCTED_NEST) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_TOO_DEEP); + goto err; + } + + switch (it->itype) { + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) { + /* + * tagging or OPTIONAL is currently illegal on an item template + * because the flags can't get passed down. In practice this + * isn't a problem: we include the relevant flags from the item + * template in the template itself. + */ + if ((tag != -1) || opt) { + OPENSSL_PUT_ERROR(ASN1, + ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE); + goto err; + } + return asn1_template_ex_d2i(pval, in, len, + it->templates, opt, ctx, depth); + } + return asn1_d2i_ex_primitive(pval, in, len, it, + tag, aclass, opt, ctx); + break; + + case ASN1_ITYPE_MSTRING: + p = *in; + /* Just read in tag and class */ + ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, + &p, len, -1, 0, 1, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + /* Must be UNIVERSAL class */ + if (oclass != V_ASN1_UNIVERSAL) { + /* If OPTIONAL, assume this is OK */ + if (opt) + return -1; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL); + goto err; + } + /* Check tag matches bit map */ + if (!(ASN1_tag2bit(otag) & it->utype)) { + /* If OPTIONAL, assume this is OK */ + if (opt) + return -1; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MSTRING_WRONG_TAG); + goto err; + } + return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx); + + case ASN1_ITYPE_EXTERN: + /* Use new style d2i */ + ef = it->funcs; + return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx); + + case ASN1_ITYPE_COMPAT: + /* we must resort to old style evil hackery */ + cf = it->funcs; + + /* If OPTIONAL see if it is there */ + if (opt) { + int exptag; + p = *in; + if (tag == -1) + exptag = it->utype; + else + exptag = tag; + /* + * Don't care about anything other than presence of expected tag + */ + + ret = asn1_check_tlen(NULL, NULL, NULL, NULL, NULL, + &p, len, exptag, aclass, 1, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (ret == -1) + return -1; + } + + /* + * This is the old style evil hack IMPLICIT handling: since the + * underlying code is expecting a tag and class other than the one + * present we change the buffer temporarily then change it back + * afterwards. This doesn't and never did work for tags > 30. Yes + * this is *horrible* but it is only needed for old style d2i which + * will hopefully not be around for much longer. FIXME: should copy + * the buffer then modify it so the input buffer can be const: we + * should *always* copy because the old style d2i might modify the + * buffer. + */ + + if (tag != -1) { + wp = *(unsigned char **)in; + imphack = *wp; + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + *wp = (unsigned char)((*p & V_ASN1_CONSTRUCTED) + | it->utype); + } + + ptmpval = cf->asn1_d2i(pval, in, len); + + if (tag != -1) + *wp = imphack; + + if (ptmpval) + return 1; + + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) + goto auxerr; + + if (*pval) { + /* Free up and zero CHOICE value if initialised */ + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + tt = it->templates + i; + pchptr = asn1_get_field_ptr(pval, tt); + ASN1_template_free(pchptr, tt); + asn1_set_choice_selector(pval, -1, it); + } + } else if (!ASN1_item_ex_new(pval, it)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + /* CHOICE type, try each possibility in turn */ + p = *in; + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + pchptr = asn1_get_field_ptr(pval, tt); + /* + * We mark field as OPTIONAL so its absence can be recognised. + */ + ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth); + /* If field not present, try the next one */ + if (ret == -1) + continue; + /* If positive return, read OK, break loop */ + if (ret > 0) + break; + /* Otherwise must be an ASN1 parsing error */ + errtt = tt; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + /* Did we fall off the end without reading anything? */ + if (i == it->tcount) { + /* If OPTIONAL, this is OK */ + if (opt) { + /* Free and zero it */ + ASN1_item_ex_free(pval, it); + return -1; + } + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE); + goto err; + } + + asn1_set_choice_selector(pval, i, it); + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) + goto auxerr; + *in = p; + return 1; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + p = *in; + tmplen = len; + + /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ + if (tag == -1) { + tag = V_ASN1_SEQUENCE; + aclass = V_ASN1_UNIVERSAL; + } + /* Get SEQUENCE length and update len, p */ + ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst, + &p, len, tag, aclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + if (aux && (aux->flags & ASN1_AFLG_BROKEN)) { + len = tmplen - (p - *in); + seq_nolen = 1; + } + /* If indefinite we don't do a length check */ + else + seq_nolen = seq_eoc; + if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED); + goto err; + } + + if (!*pval && !ASN1_item_ex_new(pval, it)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) + goto auxerr; + + /* Free up and zero any ADB found */ + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + if (tt->flags & ASN1_TFLG_ADB_MASK) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 0); + if (seqtt == NULL) + continue; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } + } + + /* Get each field entry */ + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 1); + if (seqtt == NULL) + goto err; + pseqval = asn1_get_field_ptr(pval, seqtt); + /* Have we ran out of data? */ + if (!len) + break; + q = p; + if (asn1_check_eoc(&p, len)) { + if (!seq_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + goto err; + } + len -= p - q; + seq_eoc = 0; + q = p; + break; + } + /* + * This determines the OPTIONAL flag value. The field cannot be + * omitted if it is the last of a SEQUENCE and there is still + * data to be read. This isn't strictly necessary but it + * increases efficiency in some cases. + */ + if (i == (it->tcount - 1)) + isopt = 0; + else + isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL); + /* + * attempt to read in field, allowing each to be OPTIONAL + */ + + ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx, + depth); + if (!ret) { + errtt = seqtt; + goto err; + } else if (ret == -1) { + /* + * OPTIONAL component absent. Free and zero the field. + */ + ASN1_template_free(pseqval, seqtt); + continue; + } + /* Update length */ + len -= p - q; + } + + /* Check for EOC if expecting one */ + if (seq_eoc && !asn1_check_eoc(&p, len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + /* Check all data read */ + if (!seq_nolen && len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH); + goto err; + } + + /* + * If we get here we've got no more data in the SEQUENCE, however we + * may not have read all fields so check all remaining are OPTIONAL + * and clear any that are. + */ + for (; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + seqtt = asn1_do_adb(pval, tt, 1); + if (seqtt == NULL) + goto err; + if (seqtt->flags & ASN1_TFLG_OPTIONAL) { + ASN1_VALUE **pseqval; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } else { + errtt = seqtt; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_FIELD_MISSING); + goto err; + } + } + /* Save encoding */ + if (!asn1_enc_save(pval, *in, p - *in, it)) + goto auxerr; + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) + goto auxerr; + *in = p; + return 1; + + default: + return 0; + } + auxerr: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_AUX_ERROR); + err: + if (combine == 0) + ASN1_item_ex_free(pval, it); + if (errtt) + ERR_add_error_data(4, "Field=", errtt->field_name, + ", Type=", it->sname); + else + ERR_add_error_data(2, "Type=", it->sname); + return 0; +} + +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) +{ + return asn1_item_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0); +} + +/* + * Templates are handled with two separate functions. One handles any + * EXPLICIT tag and the other handles the rest. + */ + +static int asn1_template_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long inlen, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth) +{ + int flags, aclass; + int ret; + long len; + const unsigned char *p, *q; + char exp_eoc; + if (!val) + return 0; + flags = tt->flags; + aclass = flags & ASN1_TFLG_TAG_CLASS; + + p = *in; + + /* Check if EXPLICIT tag expected */ + if (flags & ASN1_TFLG_EXPTAG) { + char cst; + /* + * Need to work out amount of data available to the inner content and + * where it starts: so read in EXPLICIT header to get the info. + */ + ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst, + &p, inlen, tt->tag, aclass, opt, ctx); + q = p; + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED); + return 0; + } + /* We've found the field so it can't be OPTIONAL now */ + ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + /* We read the field in OK so update length */ + len -= p - q; + if (exp_eoc) { + /* If NDEF we must have an EOC here */ + if (!asn1_check_eoc(&p, len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + } else { + /* + * Otherwise we must hit the EXPLICIT tag end or its an error + */ + if (len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH); + goto err; + } + } + } else + return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth); + + *in = p; + return 1; + + err: + ASN1_template_free(val, tt); + return 0; +} + +static int asn1_template_noexp_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth) +{ + int flags, aclass; + int ret; + const unsigned char *p; + if (!val) + return 0; + flags = tt->flags; + aclass = flags & ASN1_TFLG_TAG_CLASS; + + p = *in; + + if (flags & ASN1_TFLG_SK_MASK) { + /* SET OF, SEQUENCE OF */ + int sktag, skaclass; + char sk_eoc; + /* First work out expected inner tag value */ + if (flags & ASN1_TFLG_IMPTAG) { + sktag = tt->tag; + skaclass = aclass; + } else { + skaclass = V_ASN1_UNIVERSAL; + if (flags & ASN1_TFLG_SET_OF) + sktag = V_ASN1_SET; + else + sktag = V_ASN1_SEQUENCE; + } + /* Get the tag */ + ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL, + &p, len, sktag, skaclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + if (!*val) + *val = (ASN1_VALUE *)sk_new_null(); + else { + /* + * We've got a valid STACK: free up any items present + */ + STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val; + ASN1_VALUE *vtmp; + while (sk_ASN1_VALUE_num(sktmp) > 0) { + vtmp = sk_ASN1_VALUE_pop(sktmp); + ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item)); + } + } + + if (!*val) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + + /* Read as many items as we can */ + while (len > 0) { + ASN1_VALUE *skfield; + const unsigned char *q = p; + /* See if EOC found */ + if (asn1_check_eoc(&p, len)) { + if (!sk_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + goto err; + } + len -= p - q; + sk_eoc = 0; + break; + } + skfield = NULL; + if (!asn1_item_ex_d2i(&skfield, &p, len, ASN1_ITEM_ptr(tt->item), + -1, 0, 0, ctx, depth)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + len -= p - q; + if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) { + ASN1_item_ex_free(&skfield, ASN1_ITEM_ptr(tt->item)); + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + } + if (sk_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + } else if (flags & ASN1_TFLG_IMPTAG) { + /* IMPLICIT tagging */ + ret = asn1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), tt->tag, + aclass, opt, ctx, depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + } else { + /* Nothing special */ + ret = asn1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), + -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx, + depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + } + + *in = p; + return 1; + + err: + ASN1_template_free(val, tt); + return 0; +} + +static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, + const unsigned char **in, long inlen, + const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx) +{ + int ret = 0, utype; + long plen; + char cst, inf, free_cont = 0; + const unsigned char *p; + BUF_MEM buf = {0, NULL, 0 }; + const unsigned char *cont = NULL; + long len; + if (!pval) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NULL); + return 0; /* Should never happen */ + } + + if (it->itype == ASN1_ITYPE_MSTRING) { + utype = tag; + tag = -1; + } else + utype = it->utype; + + if (utype == V_ASN1_ANY) { + /* If type is ANY need to figure out type from tag */ + unsigned char oclass; + if (tag >= 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_TAGGED_ANY); + return 0; + } + if (opt) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY); + return 0; + } + p = *in; + ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, + &p, inlen, -1, 0, 0, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + if (oclass != V_ASN1_UNIVERSAL) + utype = V_ASN1_OTHER; + } + if (tag == -1) { + tag = utype; + aclass = V_ASN1_UNIVERSAL; + } + p = *in; + /* Check header */ + ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, + &p, inlen, tag, aclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + ret = 0; + /* SEQUENCE, SET and "OTHER" are left in encoded form */ + if ((utype == V_ASN1_SEQUENCE) + || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) { + /* + * Clear context cache for type OTHER because the auto clear when we + * have a exact match wont work + */ + if (utype == V_ASN1_OTHER) { + asn1_tlc_clear(ctx); + } + /* SEQUENCE and SET must be constructed */ + else if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED); + return 0; + } + + cont = *in; + /* If indefinite length constructed find the real end */ + if (inf) { + if (!asn1_find_end(&p, plen, inf)) + goto err; + len = p - cont; + } else { + len = p - cont + plen; + p += plen; + } + } else if (cst) { + if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN + || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER + || utype == V_ASN1_ENUMERATED) { + /* These types only have primitive encodings. */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TYPE_NOT_PRIMITIVE); + return 0; + } + + /* Free any returned 'buf' content */ + free_cont = 1; + /* + * Should really check the internal tags are correct but some things + * may get this wrong. The relevant specs say that constructed string + * types should be OCTET STRINGs internally irrespective of the type. + * So instead just check for UNIVERSAL class and ignore the tag. + */ + if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) { + goto err; + } + len = buf.length; + /* Append a final null to string */ + if (!BUF_MEM_grow_clean(&buf, len + 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + buf.data[len] = 0; + cont = (const unsigned char *)buf.data; + } else { + cont = p; + len = plen; + p += plen; + } + + /* We now have content length and type: translate into a structure */ + /* asn1_ex_c2i may reuse allocated buffer, and so sets free_cont to 0 */ + if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) + goto err; + + *in = p; + ret = 1; + err: + if (free_cont && buf.data) + OPENSSL_free(buf.data); + return ret; +} + +/* Translate ASN1 content octets into a structure */ + +int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, + int utype, char *free_cont, const ASN1_ITEM *it) +{ + ASN1_VALUE **opval = NULL; + ASN1_STRING *stmp; + ASN1_TYPE *typ = NULL; + int ret = 0; + const ASN1_PRIMITIVE_FUNCS *pf; + ASN1_INTEGER **tint; + pf = it->funcs; + + if (pf && pf->prim_c2i) + return pf->prim_c2i(pval, cont, len, utype, free_cont, it); + /* If ANY type clear type and set pointer to internal value */ + if (it->utype == V_ASN1_ANY) { + if (!*pval) { + typ = ASN1_TYPE_new(); + if (typ == NULL) + goto err; + *pval = (ASN1_VALUE *)typ; + } else + typ = (ASN1_TYPE *)*pval; + + if (utype != typ->type) + ASN1_TYPE_set(typ, utype, NULL); + opval = pval; + pval = &typ->value.asn1_value; + } + switch (utype) { + case V_ASN1_OBJECT: + if (!c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len)) + goto err; + break; + + case V_ASN1_NULL: + if (len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NULL_IS_WRONG_LENGTH); + goto err; + } + *pval = (ASN1_VALUE *)1; + break; + + case V_ASN1_BOOLEAN: + if (len != 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH); + goto err; + } else { + ASN1_BOOLEAN *tbool; + tbool = (ASN1_BOOLEAN *)pval; + *tbool = *cont; + } + break; + + case V_ASN1_BIT_STRING: + if (!c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len)) + goto err; + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + tint = (ASN1_INTEGER **)pval; + if (!c2i_ASN1_INTEGER(tint, &cont, len)) + goto err; + /* Fixup type to match the expected form */ + (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG); + break; + + case V_ASN1_OCTET_STRING: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_OTHER: + case V_ASN1_SET: + case V_ASN1_SEQUENCE: + default: + if (utype == V_ASN1_BMPSTRING && (len & 1)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH); + goto err; + } + if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH); + goto err; + } + /* All based on ASN1_STRING and handled the same */ + if (!*pval) { + stmp = ASN1_STRING_type_new(utype); + if (!stmp) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + *pval = (ASN1_VALUE *)stmp; + } else { + stmp = (ASN1_STRING *)*pval; + stmp->type = utype; + } + /* If we've already allocated a buffer use it */ + if (*free_cont) { + if (stmp->data) + OPENSSL_free(stmp->data); + stmp->data = (unsigned char *)cont; /* UGLY CAST! RL */ + stmp->length = len; + *free_cont = 0; + } else { + if (!ASN1_STRING_set(stmp, cont, len)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + ASN1_STRING_free(stmp); + *pval = NULL; + goto err; + } + } + break; + } + /* If ASN1_ANY and NULL type fix up value */ + if (typ && (utype == V_ASN1_NULL)) + typ->value.ptr = NULL; + + ret = 1; + err: + if (!ret) { + ASN1_TYPE_free(typ); + if (opval) + *opval = NULL; + } + return ret; +} + +/* + * This function finds the end of an ASN1 structure when passed its maximum + * length, whether it is indefinite length and a pointer to the content. This + * is more efficient than calling asn1_collect because it does not recurse on + * each indefinite length header. + */ + +static int asn1_find_end(const unsigned char **in, long len, char inf) +{ + int expected_eoc; + long plen; + const unsigned char *p = *in, *q; + /* If not indefinite length constructed just add length */ + if (inf == 0) { + *in += len; + return 1; + } + expected_eoc = 1; + /* + * Indefinite length constructed form. Find the end when enough EOCs are + * found. If more indefinite length constructed headers are encountered + * increment the expected eoc count otherwise just skip to the end of the + * data. + */ + while (len > 0) { + if (asn1_check_eoc(&p, len)) { + expected_eoc--; + if (expected_eoc == 0) + break; + len -= 2; + continue; + } + q = p; + /* Just read in a header: only care about the length */ + if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, + -1, 0, 0, NULL)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + if (inf) + expected_eoc++; + else + p += plen; + len -= p - q; + } + if (expected_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + return 0; + } + *in = p; + return 1; +} + +/* + * This function collects the asn1 data from a constructred string type into + * a buffer. The values of 'in' and 'len' should refer to the contents of the + * constructed type and 'inf' should be set if it is indefinite length. + */ + +#ifndef ASN1_MAX_STRING_NEST +/* + * This determines how many levels of recursion are permitted in ASN1 string + * types. If it is not limited stack overflows can occur. If set to zero no + * recursion is allowed at all. Although zero should be adequate examples + * exist that require a value of 1. So 5 should be more than enough. + */ +# define ASN1_MAX_STRING_NEST 5 +#endif + +static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len, + char inf, int tag, int aclass, int depth) +{ + const unsigned char *p, *q; + long plen; + char cst, ininf; + p = *in; + inf &= 1; + /* + * If no buffer and not indefinite length constructed just pass over the + * encoded data + */ + if (!buf && !inf) { + *in += len; + return 1; + } + while (len > 0) { + q = p; + /* Check for EOC */ + if (asn1_check_eoc(&p, len)) { + /* + * EOC is illegal outside indefinite length constructed form + */ + if (!inf) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + return 0; + } + inf = 0; + break; + } + + if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p, + len, tag, aclass, 0, NULL)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + + /* If indefinite length constructed update max length */ + if (cst) { + if (depth >= ASN1_MAX_STRING_NEST) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_STRING); + return 0; + } + if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1)) + return 0; + } else if (plen && !collect_data(buf, &p, plen)) + return 0; + len -= p - q; + } + if (inf) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + return 0; + } + *in = p; + return 1; +} + +static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen) +{ + int len; + if (buf) { + len = buf->length; + if (!BUF_MEM_grow_clean(buf, len + plen)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + OPENSSL_memcpy(buf->data + len, *p, plen); + } + *p += plen; + return 1; +} + +/* Check for ASN1 EOC and swallow it if found */ + +static int asn1_check_eoc(const unsigned char **in, long len) +{ + const unsigned char *p; + if (len < 2) + return 0; + p = *in; + if (!p[0] && !p[1]) { + *in += 2; + return 1; + } + return 0; +} + +/* + * Check an ASN1 tag and length: a bit like ASN1_get_object but it sets the + * length for indefinite length constructed form, we don't know the exact + * length but we can set an upper bound to the amount of data available minus + * the header length just read. + */ + +static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, + char *inf, char *cst, + const unsigned char **in, long len, + int exptag, int expclass, char opt, ASN1_TLC *ctx) +{ + int i; + int ptag, pclass; + long plen; + const unsigned char *p, *q; + p = *in; + q = p; + + if (ctx && ctx->valid) { + i = ctx->ret; + plen = ctx->plen; + pclass = ctx->pclass; + ptag = ctx->ptag; + p += ctx->hdrlen; + } else { + i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); + if (ctx) { + ctx->ret = i; + ctx->plen = plen; + ctx->pclass = pclass; + ctx->ptag = ptag; + ctx->hdrlen = p - q; + ctx->valid = 1; + /* + * If definite length, and no error, length + header can't exceed + * total amount of data available. + */ + if (!(i & 0x81) && ((plen + ctx->hdrlen) > len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + asn1_tlc_clear(ctx); + return 0; + } + } + } + + if (i & 0x80) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BAD_OBJECT_HEADER); + asn1_tlc_clear(ctx); + return 0; + } + if (exptag >= 0) { + if ((exptag != ptag) || (expclass != pclass)) { + /* + * If type is OPTIONAL, not an error: indicate missing type. + */ + if (opt) + return -1; + asn1_tlc_clear(ctx); + OPENSSL_PUT_ERROR(ASN1, ASN1_R_WRONG_TAG); + return 0; + } + /* + * We have a tag and class match: assume we are going to do something + * with it + */ + asn1_tlc_clear(ctx); + } + + if (i & 1) + plen = len - (p - q); + + if (inf) + *inf = i & 1; + + if (cst) + *cst = i & V_ASN1_CONSTRUCTED; + + if (olen) + *olen = plen; + + if (oclass) + *oclass = pclass; + + if (otag) + *otag = ptag; + + *in = p; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c.grpc_back new file mode 100644 index 0000000..32aba0b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c.grpc_back @@ -0,0 +1,1244 @@ +/* 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 "../internal.h" + +/* + * Constructed types with a recursive definition (such as can be found in PKCS7) + * could eventually exceed the stack given malicious input with excessive + * recursion. Therefore we limit the stack depth. This is the maximum number of + * recursive invocations of asn1_item_embed_d2i(). + */ +#define ASN1_MAX_CONSTRUCTED_NEST 30 + +static int asn1_check_eoc(const unsigned char **in, long len); +static int asn1_find_end(const unsigned char **in, long len, char inf); + +static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len, + char inf, int tag, int aclass, int depth); + +static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen); + +static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, + char *inf, char *cst, + const unsigned char **in, long len, + int exptag, int expclass, char opt, ASN1_TLC *ctx); + +static int asn1_template_ex_d2i(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth); +static int asn1_template_noexp_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth); +static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_ITEM *it, + int tag, int aclass, char opt, + ASN1_TLC *ctx); + +/* Table to convert tags to bit values, used for MSTRING type */ +static const unsigned long tag2bit[32] = { + 0, 0, 0, B_ASN1_BIT_STRING, /* tags 0 - 3 */ + B_ASN1_OCTET_STRING, 0, 0, B_ASN1_UNKNOWN, /* tags 4- 7 */ + B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, /* tags + * 8-11 */ + B_ASN1_UTF8STRING, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, /* tags + * 12-15 + */ + B_ASN1_SEQUENCE, 0, B_ASN1_NUMERICSTRING, B_ASN1_PRINTABLESTRING, /* tags + * 16-19 + */ + B_ASN1_T61STRING, B_ASN1_VIDEOTEXSTRING, B_ASN1_IA5STRING, /* tags 20-22 */ + B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME, /* tags 23-24 */ + B_ASN1_GRAPHICSTRING, B_ASN1_ISO64STRING, B_ASN1_GENERALSTRING, /* tags + * 25-27 */ + B_ASN1_UNIVERSALSTRING, B_ASN1_UNKNOWN, B_ASN1_BMPSTRING, B_ASN1_UNKNOWN, /* tags + * 28-31 + */ +}; + +unsigned long ASN1_tag2bit(int tag) +{ + if ((tag < 0) || (tag > 30)) + return 0; + return tag2bit[tag]; +} + +/* Macro to initialize and invalidate the cache */ + +#define asn1_tlc_clear(c) if (c) (c)->valid = 0 +/* Version to avoid compiler warning about 'c' always non-NULL */ +#define asn1_tlc_clear_nc(c) (c)->valid = 0 + +/* + * Decode an ASN1 item, this currently behaves just like a standard 'd2i' + * function. 'in' points to a buffer to read the data from, in future we + * will have more advanced versions that can input data a piece at a time and + * this will simply be a special case. + */ + +ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, + const unsigned char **in, long len, + const ASN1_ITEM *it) +{ + ASN1_TLC c; + ASN1_VALUE *ptmpval = NULL; + if (!pval) + pval = &ptmpval; + asn1_tlc_clear_nc(&c); + if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) + return *pval; + return NULL; +} + +/* + * Decode an item, taking care of IMPLICIT tagging, if any. If 'opt' set and + * tag mismatch return -1 to handle OPTIONAL + */ + +static 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 depth) +{ + const ASN1_TEMPLATE *tt, *errtt = NULL; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + const unsigned char *p = NULL, *q; + unsigned char *wp = NULL; /* BIG FAT WARNING! BREAKS CONST WHERE USED */ + unsigned char imphack = 0, oclass; + char seq_eoc, seq_nolen, cst, isopt; + long tmplen; + int i; + int otag; + int ret = 0; + ASN1_VALUE **pchptr, *ptmpval; + int combine = aclass & ASN1_TFLG_COMBINE; + aclass &= ~ASN1_TFLG_COMBINE; + if (!pval) + return 0; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + + /* + * Bound |len| to comfortably fit in an int. Lengths in this module often + * switch between int and long without overflow checks. + */ + if (len > INT_MAX/2) { + len = INT_MAX/2; + } + + if (++depth > ASN1_MAX_CONSTRUCTED_NEST) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_TOO_DEEP); + goto err; + } + + switch (it->itype) { + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) { + /* + * tagging or OPTIONAL is currently illegal on an item template + * because the flags can't get passed down. In practice this + * isn't a problem: we include the relevant flags from the item + * template in the template itself. + */ + if ((tag != -1) || opt) { + OPENSSL_PUT_ERROR(ASN1, + ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE); + goto err; + } + return asn1_template_ex_d2i(pval, in, len, + it->templates, opt, ctx, depth); + } + return asn1_d2i_ex_primitive(pval, in, len, it, + tag, aclass, opt, ctx); + break; + + case ASN1_ITYPE_MSTRING: + p = *in; + /* Just read in tag and class */ + ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, + &p, len, -1, 0, 1, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + /* Must be UNIVERSAL class */ + if (oclass != V_ASN1_UNIVERSAL) { + /* If OPTIONAL, assume this is OK */ + if (opt) + return -1; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL); + goto err; + } + /* Check tag matches bit map */ + if (!(ASN1_tag2bit(otag) & it->utype)) { + /* If OPTIONAL, assume this is OK */ + if (opt) + return -1; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MSTRING_WRONG_TAG); + goto err; + } + return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx); + + case ASN1_ITYPE_EXTERN: + /* Use new style d2i */ + ef = it->funcs; + return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx); + + case ASN1_ITYPE_COMPAT: + /* we must resort to old style evil hackery */ + cf = it->funcs; + + /* If OPTIONAL see if it is there */ + if (opt) { + int exptag; + p = *in; + if (tag == -1) + exptag = it->utype; + else + exptag = tag; + /* + * Don't care about anything other than presence of expected tag + */ + + ret = asn1_check_tlen(NULL, NULL, NULL, NULL, NULL, + &p, len, exptag, aclass, 1, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + if (ret == -1) + return -1; + } + + /* + * This is the old style evil hack IMPLICIT handling: since the + * underlying code is expecting a tag and class other than the one + * present we change the buffer temporarily then change it back + * afterwards. This doesn't and never did work for tags > 30. Yes + * this is *horrible* but it is only needed for old style d2i which + * will hopefully not be around for much longer. FIXME: should copy + * the buffer then modify it so the input buffer can be const: we + * should *always* copy because the old style d2i might modify the + * buffer. + */ + + if (tag != -1) { + wp = *(unsigned char **)in; + imphack = *wp; + if (p == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + *wp = (unsigned char)((*p & V_ASN1_CONSTRUCTED) + | it->utype); + } + + ptmpval = cf->asn1_d2i(pval, in, len); + + if (tag != -1) + *wp = imphack; + + if (ptmpval) + return 1; + + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) + goto auxerr; + + if (*pval) { + /* Free up and zero CHOICE value if initialised */ + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + tt = it->templates + i; + pchptr = asn1_get_field_ptr(pval, tt); + ASN1_template_free(pchptr, tt); + asn1_set_choice_selector(pval, -1, it); + } + } else if (!ASN1_item_ex_new(pval, it)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + /* CHOICE type, try each possibility in turn */ + p = *in; + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + pchptr = asn1_get_field_ptr(pval, tt); + /* + * We mark field as OPTIONAL so its absence can be recognised. + */ + ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth); + /* If field not present, try the next one */ + if (ret == -1) + continue; + /* If positive return, read OK, break loop */ + if (ret > 0) + break; + /* Otherwise must be an ASN1 parsing error */ + errtt = tt; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + /* Did we fall off the end without reading anything? */ + if (i == it->tcount) { + /* If OPTIONAL, this is OK */ + if (opt) { + /* Free and zero it */ + ASN1_item_ex_free(pval, it); + return -1; + } + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE); + goto err; + } + + asn1_set_choice_selector(pval, i, it); + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) + goto auxerr; + *in = p; + return 1; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + p = *in; + tmplen = len; + + /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ + if (tag == -1) { + tag = V_ASN1_SEQUENCE; + aclass = V_ASN1_UNIVERSAL; + } + /* Get SEQUENCE length and update len, p */ + ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst, + &p, len, tag, aclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + if (aux && (aux->flags & ASN1_AFLG_BROKEN)) { + len = tmplen - (p - *in); + seq_nolen = 1; + } + /* If indefinite we don't do a length check */ + else + seq_nolen = seq_eoc; + if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED); + goto err; + } + + if (!*pval && !ASN1_item_ex_new(pval, it)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) + goto auxerr; + + /* Free up and zero any ADB found */ + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + if (tt->flags & ASN1_TFLG_ADB_MASK) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 0); + if (seqtt == NULL) + continue; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } + } + + /* Get each field entry */ + for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 1); + if (seqtt == NULL) + goto err; + pseqval = asn1_get_field_ptr(pval, seqtt); + /* Have we ran out of data? */ + if (!len) + break; + q = p; + if (asn1_check_eoc(&p, len)) { + if (!seq_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + goto err; + } + len -= p - q; + seq_eoc = 0; + q = p; + break; + } + /* + * This determines the OPTIONAL flag value. The field cannot be + * omitted if it is the last of a SEQUENCE and there is still + * data to be read. This isn't strictly necessary but it + * increases efficiency in some cases. + */ + if (i == (it->tcount - 1)) + isopt = 0; + else + isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL); + /* + * attempt to read in field, allowing each to be OPTIONAL + */ + + ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx, + depth); + if (!ret) { + errtt = seqtt; + goto err; + } else if (ret == -1) { + /* + * OPTIONAL component absent. Free and zero the field. + */ + ASN1_template_free(pseqval, seqtt); + continue; + } + /* Update length */ + len -= p - q; + } + + /* Check for EOC if expecting one */ + if (seq_eoc && !asn1_check_eoc(&p, len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + /* Check all data read */ + if (!seq_nolen && len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH); + goto err; + } + + /* + * If we get here we've got no more data in the SEQUENCE, however we + * may not have read all fields so check all remaining are OPTIONAL + * and clear any that are. + */ + for (; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + seqtt = asn1_do_adb(pval, tt, 1); + if (seqtt == NULL) + goto err; + if (seqtt->flags & ASN1_TFLG_OPTIONAL) { + ASN1_VALUE **pseqval; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } else { + errtt = seqtt; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_FIELD_MISSING); + goto err; + } + } + /* Save encoding */ + if (!asn1_enc_save(pval, *in, p - *in, it)) + goto auxerr; + if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) + goto auxerr; + *in = p; + return 1; + + default: + return 0; + } + auxerr: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_AUX_ERROR); + err: + if (combine == 0) + ASN1_item_ex_free(pval, it); + if (errtt) + ERR_add_error_data(4, "Field=", errtt->field_name, + ", Type=", it->sname); + else + ERR_add_error_data(2, "Type=", it->sname); + return 0; +} + +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) +{ + return asn1_item_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0); +} + +/* + * Templates are handled with two separate functions. One handles any + * EXPLICIT tag and the other handles the rest. + */ + +static int asn1_template_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long inlen, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth) +{ + int flags, aclass; + int ret; + long len; + const unsigned char *p, *q; + char exp_eoc; + if (!val) + return 0; + flags = tt->flags; + aclass = flags & ASN1_TFLG_TAG_CLASS; + + p = *in; + + /* Check if EXPLICIT tag expected */ + if (flags & ASN1_TFLG_EXPTAG) { + char cst; + /* + * Need to work out amount of data available to the inner content and + * where it starts: so read in EXPLICIT header to get the info. + */ + ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst, + &p, inlen, tt->tag, aclass, opt, ctx); + q = p; + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED); + return 0; + } + /* We've found the field so it can't be OPTIONAL now */ + ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + /* We read the field in OK so update length */ + len -= p - q; + if (exp_eoc) { + /* If NDEF we must have an EOC here */ + if (!asn1_check_eoc(&p, len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + } else { + /* + * Otherwise we must hit the EXPLICIT tag end or its an error + */ + if (len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH); + goto err; + } + } + } else + return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth); + + *in = p; + return 1; + + err: + ASN1_template_free(val, tt); + return 0; +} + +static int asn1_template_noexp_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_TEMPLATE *tt, char opt, + ASN1_TLC *ctx, int depth) +{ + int flags, aclass; + int ret; + const unsigned char *p; + if (!val) + return 0; + flags = tt->flags; + aclass = flags & ASN1_TFLG_TAG_CLASS; + + p = *in; + + if (flags & ASN1_TFLG_SK_MASK) { + /* SET OF, SEQUENCE OF */ + int sktag, skaclass; + char sk_eoc; + /* First work out expected inner tag value */ + if (flags & ASN1_TFLG_IMPTAG) { + sktag = tt->tag; + skaclass = aclass; + } else { + skaclass = V_ASN1_UNIVERSAL; + if (flags & ASN1_TFLG_SET_OF) + sktag = V_ASN1_SET; + else + sktag = V_ASN1_SEQUENCE; + } + /* Get the tag */ + ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL, + &p, len, sktag, skaclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + if (!*val) + *val = (ASN1_VALUE *)sk_new_null(); + else { + /* + * We've got a valid STACK: free up any items present + */ + STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val; + ASN1_VALUE *vtmp; + while (sk_ASN1_VALUE_num(sktmp) > 0) { + vtmp = sk_ASN1_VALUE_pop(sktmp); + ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item)); + } + } + + if (!*val) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + + /* Read as many items as we can */ + while (len > 0) { + ASN1_VALUE *skfield; + const unsigned char *q = p; + /* See if EOC found */ + if (asn1_check_eoc(&p, len)) { + if (!sk_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + goto err; + } + len -= p - q; + sk_eoc = 0; + break; + } + skfield = NULL; + if (!asn1_item_ex_d2i(&skfield, &p, len, ASN1_ITEM_ptr(tt->item), + -1, 0, 0, ctx, depth)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } + len -= p - q; + if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) { + ASN1_item_ex_free(&skfield, ASN1_ITEM_ptr(tt->item)); + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + } + if (sk_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + goto err; + } + } else if (flags & ASN1_TFLG_IMPTAG) { + /* IMPLICIT tagging */ + ret = asn1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), tt->tag, + aclass, opt, ctx, depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + } else { + /* Nothing special */ + ret = asn1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), + -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx, + depth); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + goto err; + } else if (ret == -1) + return -1; + } + + *in = p; + return 1; + + err: + ASN1_template_free(val, tt); + return 0; +} + +static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, + const unsigned char **in, long inlen, + const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx) +{ + int ret = 0, utype; + long plen; + char cst, inf, free_cont = 0; + const unsigned char *p; + BUF_MEM buf = {0, NULL, 0 }; + const unsigned char *cont = NULL; + long len; + if (!pval) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NULL); + return 0; /* Should never happen */ + } + + if (it->itype == ASN1_ITYPE_MSTRING) { + utype = tag; + tag = -1; + } else + utype = it->utype; + + if (utype == V_ASN1_ANY) { + /* If type is ANY need to figure out type from tag */ + unsigned char oclass; + if (tag >= 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_TAGGED_ANY); + return 0; + } + if (opt) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY); + return 0; + } + p = *in; + ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, + &p, inlen, -1, 0, 0, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + if (oclass != V_ASN1_UNIVERSAL) + utype = V_ASN1_OTHER; + } + if (tag == -1) { + tag = utype; + aclass = V_ASN1_UNIVERSAL; + } + p = *in; + /* Check header */ + ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, + &p, inlen, tag, aclass, opt, ctx); + if (!ret) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } else if (ret == -1) + return -1; + ret = 0; + /* SEQUENCE, SET and "OTHER" are left in encoded form */ + if ((utype == V_ASN1_SEQUENCE) + || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) { + /* + * Clear context cache for type OTHER because the auto clear when we + * have a exact match wont work + */ + if (utype == V_ASN1_OTHER) { + asn1_tlc_clear(ctx); + } + /* SEQUENCE and SET must be constructed */ + else if (!cst) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED); + return 0; + } + + cont = *in; + /* If indefinite length constructed find the real end */ + if (inf) { + if (!asn1_find_end(&p, plen, inf)) + goto err; + len = p - cont; + } else { + len = p - cont + plen; + p += plen; + } + } else if (cst) { + if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN + || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER + || utype == V_ASN1_ENUMERATED) { + /* These types only have primitive encodings. */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TYPE_NOT_PRIMITIVE); + return 0; + } + + /* Free any returned 'buf' content */ + free_cont = 1; + /* + * Should really check the internal tags are correct but some things + * may get this wrong. The relevant specs say that constructed string + * types should be OCTET STRINGs internally irrespective of the type. + * So instead just check for UNIVERSAL class and ignore the tag. + */ + if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) { + goto err; + } + len = buf.length; + /* Append a final null to string */ + if (!BUF_MEM_grow_clean(&buf, len + 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + buf.data[len] = 0; + cont = (const unsigned char *)buf.data; + } else { + cont = p; + len = plen; + p += plen; + } + + /* We now have content length and type: translate into a structure */ + /* asn1_ex_c2i may reuse allocated buffer, and so sets free_cont to 0 */ + if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) + goto err; + + *in = p; + ret = 1; + err: + if (free_cont && buf.data) + OPENSSL_free(buf.data); + return ret; +} + +/* Translate ASN1 content octets into a structure */ + +int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, + int utype, char *free_cont, const ASN1_ITEM *it) +{ + ASN1_VALUE **opval = NULL; + ASN1_STRING *stmp; + ASN1_TYPE *typ = NULL; + int ret = 0; + const ASN1_PRIMITIVE_FUNCS *pf; + ASN1_INTEGER **tint; + pf = it->funcs; + + if (pf && pf->prim_c2i) + return pf->prim_c2i(pval, cont, len, utype, free_cont, it); + /* If ANY type clear type and set pointer to internal value */ + if (it->utype == V_ASN1_ANY) { + if (!*pval) { + typ = ASN1_TYPE_new(); + if (typ == NULL) + goto err; + *pval = (ASN1_VALUE *)typ; + } else + typ = (ASN1_TYPE *)*pval; + + if (utype != typ->type) + ASN1_TYPE_set(typ, utype, NULL); + opval = pval; + pval = &typ->value.asn1_value; + } + switch (utype) { + case V_ASN1_OBJECT: + if (!c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len)) + goto err; + break; + + case V_ASN1_NULL: + if (len) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NULL_IS_WRONG_LENGTH); + goto err; + } + *pval = (ASN1_VALUE *)1; + break; + + case V_ASN1_BOOLEAN: + if (len != 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH); + goto err; + } else { + ASN1_BOOLEAN *tbool; + tbool = (ASN1_BOOLEAN *)pval; + *tbool = *cont; + } + break; + + case V_ASN1_BIT_STRING: + if (!c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len)) + goto err; + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + tint = (ASN1_INTEGER **)pval; + if (!c2i_ASN1_INTEGER(tint, &cont, len)) + goto err; + /* Fixup type to match the expected form */ + (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG); + break; + + case V_ASN1_OCTET_STRING: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_OTHER: + case V_ASN1_SET: + case V_ASN1_SEQUENCE: + default: + if (utype == V_ASN1_BMPSTRING && (len & 1)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH); + goto err; + } + if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH); + goto err; + } + /* All based on ASN1_STRING and handled the same */ + if (!*pval) { + stmp = ASN1_STRING_type_new(utype); + if (!stmp) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + *pval = (ASN1_VALUE *)stmp; + } else { + stmp = (ASN1_STRING *)*pval; + stmp->type = utype; + } + /* If we've already allocated a buffer use it */ + if (*free_cont) { + if (stmp->data) + OPENSSL_free(stmp->data); + stmp->data = (unsigned char *)cont; /* UGLY CAST! RL */ + stmp->length = len; + *free_cont = 0; + } else { + if (!ASN1_STRING_set(stmp, cont, len)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + ASN1_STRING_free(stmp); + *pval = NULL; + goto err; + } + } + break; + } + /* If ASN1_ANY and NULL type fix up value */ + if (typ && (utype == V_ASN1_NULL)) + typ->value.ptr = NULL; + + ret = 1; + err: + if (!ret) { + ASN1_TYPE_free(typ); + if (opval) + *opval = NULL; + } + return ret; +} + +/* + * This function finds the end of an ASN1 structure when passed its maximum + * length, whether it is indefinite length and a pointer to the content. This + * is more efficient than calling asn1_collect because it does not recurse on + * each indefinite length header. + */ + +static int asn1_find_end(const unsigned char **in, long len, char inf) +{ + int expected_eoc; + long plen; + const unsigned char *p = *in, *q; + /* If not indefinite length constructed just add length */ + if (inf == 0) { + *in += len; + return 1; + } + expected_eoc = 1; + /* + * Indefinite length constructed form. Find the end when enough EOCs are + * found. If more indefinite length constructed headers are encountered + * increment the expected eoc count otherwise just skip to the end of the + * data. + */ + while (len > 0) { + if (asn1_check_eoc(&p, len)) { + expected_eoc--; + if (expected_eoc == 0) + break; + len -= 2; + continue; + } + q = p; + /* Just read in a header: only care about the length */ + if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, + -1, 0, 0, NULL)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + if (inf) + expected_eoc++; + else + p += plen; + len -= p - q; + } + if (expected_eoc) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + return 0; + } + *in = p; + return 1; +} + +/* + * This function collects the asn1 data from a constructred string type into + * a buffer. The values of 'in' and 'len' should refer to the contents of the + * constructed type and 'inf' should be set if it is indefinite length. + */ + +#ifndef ASN1_MAX_STRING_NEST +/* + * This determines how many levels of recursion are permitted in ASN1 string + * types. If it is not limited stack overflows can occur. If set to zero no + * recursion is allowed at all. Although zero should be adequate examples + * exist that require a value of 1. So 5 should be more than enough. + */ +# define ASN1_MAX_STRING_NEST 5 +#endif + +static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len, + char inf, int tag, int aclass, int depth) +{ + const unsigned char *p, *q; + long plen; + char cst, ininf; + p = *in; + inf &= 1; + /* + * If no buffer and not indefinite length constructed just pass over the + * encoded data + */ + if (!buf && !inf) { + *in += len; + return 1; + } + while (len > 0) { + q = p; + /* Check for EOC */ + if (asn1_check_eoc(&p, len)) { + /* + * EOC is illegal outside indefinite length constructed form + */ + if (!inf) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNEXPECTED_EOC); + return 0; + } + inf = 0; + break; + } + + if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p, + len, tag, aclass, 0, NULL)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_ERROR); + return 0; + } + + /* If indefinite length constructed update max length */ + if (cst) { + if (depth >= ASN1_MAX_STRING_NEST) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NESTED_ASN1_STRING); + return 0; + } + if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1)) + return 0; + } else if (plen && !collect_data(buf, &p, plen)) + return 0; + len -= p - q; + } + if (inf) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_EOC); + return 0; + } + *in = p; + return 1; +} + +static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen) +{ + int len; + if (buf) { + len = buf->length; + if (!BUF_MEM_grow_clean(buf, len + plen)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + OPENSSL_memcpy(buf->data + len, *p, plen); + } + *p += plen; + return 1; +} + +/* Check for ASN1 EOC and swallow it if found */ + +static int asn1_check_eoc(const unsigned char **in, long len) +{ + const unsigned char *p; + if (len < 2) + return 0; + p = *in; + if (!p[0] && !p[1]) { + *in += 2; + return 1; + } + return 0; +} + +/* + * Check an ASN1 tag and length: a bit like ASN1_get_object but it sets the + * length for indefinite length constructed form, we don't know the exact + * length but we can set an upper bound to the amount of data available minus + * the header length just read. + */ + +static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, + char *inf, char *cst, + const unsigned char **in, long len, + int exptag, int expclass, char opt, ASN1_TLC *ctx) +{ + int i; + int ptag, pclass; + long plen; + const unsigned char *p, *q; + p = *in; + q = p; + + if (ctx && ctx->valid) { + i = ctx->ret; + plen = ctx->plen; + pclass = ctx->pclass; + ptag = ctx->ptag; + p += ctx->hdrlen; + } else { + i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); + if (ctx) { + ctx->ret = i; + ctx->plen = plen; + ctx->pclass = pclass; + ctx->ptag = ptag; + ctx->hdrlen = p - q; + ctx->valid = 1; + /* + * If definite length, and no error, length + header can't exceed + * total amount of data available. + */ + if (!(i & 0x81) && ((plen + ctx->hdrlen) > len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + asn1_tlc_clear(ctx); + return 0; + } + } + } + + if (i & 0x80) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_BAD_OBJECT_HEADER); + asn1_tlc_clear(ctx); + return 0; + } + if (exptag >= 0) { + if ((exptag != ptag) || (expclass != pclass)) { + /* + * If type is OPTIONAL, not an error: indicate missing type. + */ + if (opt) + return -1; + asn1_tlc_clear(ctx); + OPENSSL_PUT_ERROR(ASN1, ASN1_R_WRONG_TAG); + return 0; + } + /* + * We have a tag and class match: assume we are going to do something + * with it + */ + asn1_tlc_clear(ctx); + } + + if (i & 1) + plen = len - (p - q); + + if (inf) + *inf = i & 1; + + if (cst) + *cst = i & V_ASN1_CONSTRUCTED; + + if (olen) + *olen = plen; + + if (oclass) + *oclass = pclass; + + if (otag) + *otag = ptag; + + *in = p; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c new file mode 100644 index 0000000..5242ace --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c @@ -0,0 +1,664 @@ +/* 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 "../internal.h" + + +static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); +static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, + int skcontlen, const ASN1_ITEM *item, + int do_sort, int iclass); +static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_TEMPLATE *tt, int tag, int aclass); +static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it, int flags); + +/* + * Top level i2d equivalents: the 'ndef' variant instructs the encoder to use + * indefinite length constructed encoding, where appropriate + */ + +int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it) +{ + return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF); +} + +int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) +{ + return asn1_item_flags_i2d(val, out, it, 0); +} + +/* + * Encode an ASN1 item, this is use by the standard 'i2d' function. 'out' + * points to a buffer to output the data to. The new i2d has one additional + * feature. If the output buffer is NULL (i.e. *out == NULL) then a buffer is + * allocated and populated with the encoding. + */ + +static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it, int flags) +{ + if (out && !*out) { + unsigned char *p, *buf; + int len; + len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags); + if (len <= 0) + return len; + buf = OPENSSL_malloc(len); + if (!buf) + return -1; + p = buf; + ASN1_item_ex_i2d(&val, &p, it, -1, flags); + *out = buf; + return len; + } + + return ASN1_item_ex_i2d(&val, out, it, -1, flags); +} + +/* + * Encode an item, taking care of IMPLICIT tagging (if any). This function + * performs the normal item handling: it can be used in external types. + */ + +int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + const ASN1_TEMPLATE *tt = NULL; + unsigned char *p = NULL; + int i, seqcontlen, seqlen, ndef = 1; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb = 0; + + if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) + return 0; + + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + + switch (it->itype) { + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + return asn1_template_ex_i2d(pval, out, it->templates, + tag, aclass); + return asn1_i2d_ex_primitive(pval, out, it, tag, aclass); + break; + + case ASN1_ITYPE_MSTRING: + return asn1_i2d_ex_primitive(pval, out, it, -1, aclass); + + case ASN1_ITYPE_CHOICE: + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL)) + return 0; + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + ASN1_VALUE **pchval; + const ASN1_TEMPLATE *chtt; + chtt = it->templates + i; + pchval = asn1_get_field_ptr(pval, chtt); + return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass); + } + /* Fixme: error condition if selector out of range */ + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL)) + return 0; + break; + + case ASN1_ITYPE_EXTERN: + /* If new style i2d it does all the work */ + ef = it->funcs; + return ef->asn1_ex_i2d(pval, out, it, tag, aclass); + + case ASN1_ITYPE_COMPAT: + /* old style hackery... */ + cf = it->funcs; + if (out) + p = *out; + i = cf->asn1_i2d(*pval, out); + /* + * Fixup for IMPLICIT tag: note this messes up for tags > 30, but so + * did the old code. Tags > 30 are very rare anyway. + */ + if (out && (tag != -1)) + *p = aclass | tag | (*p & V_ASN1_CONSTRUCTED); + return i; + + case ASN1_ITYPE_NDEF_SEQUENCE: + /* Use indefinite length constructed if requested */ + if (aclass & ASN1_TFLG_NDEF) + ndef = 2; + OPENSSL_FALLTHROUGH; + + case ASN1_ITYPE_SEQUENCE: + i = asn1_enc_restore(&seqcontlen, out, pval, it); + /* An error occurred */ + if (i < 0) + return 0; + /* We have a valid cached encoding... */ + if (i > 0) + return seqcontlen; + /* Otherwise carry on */ + seqcontlen = 0; + /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ + if (tag == -1) { + tag = V_ASN1_SEQUENCE; + /* Retain any other flags in aclass */ + aclass = (aclass & ~ASN1_TFLG_TAG_CLASS) + | V_ASN1_UNIVERSAL; + } + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL)) + return 0; + /* First work out sequence content length */ + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + int tmplen; + seqtt = asn1_do_adb(pval, tt, 1); + if (!seqtt) + return 0; + pseqval = asn1_get_field_ptr(pval, seqtt); + tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass); + if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen)) + return -1; + seqcontlen += tmplen; + } + + seqlen = ASN1_object_size(ndef, seqcontlen, tag); + if (!out || seqlen == -1) + return seqlen; + /* Output SEQUENCE header */ + ASN1_put_object(out, ndef, seqcontlen, tag, aclass); + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 1); + if (!seqtt) + return 0; + pseqval = asn1_get_field_ptr(pval, seqtt); + /* FIXME: check for errors in enhanced version */ + asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass); + } + if (ndef == 2) + ASN1_put_eoc(out); + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL)) + return 0; + return seqlen; + + default: + return 0; + + } + return 0; +} + +static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_TEMPLATE *tt, int tag, int iclass) +{ + int i, ret, flags, ttag, tclass, ndef; + size_t j; + flags = tt->flags; + /* + * Work out tag and class to use: tagging may come either from the + * template or the arguments, not both because this would create + * ambiguity. Additionally the iclass argument may contain some + * additional flags which should be noted and passed down to other + * levels. + */ + if (flags & ASN1_TFLG_TAG_MASK) { + /* Error if argument and template tagging */ + if (tag != -1) + /* FIXME: error code here */ + return -1; + /* Get tagging from template */ + ttag = tt->tag; + tclass = flags & ASN1_TFLG_TAG_CLASS; + } else if (tag != -1) { + /* No template tagging, get from arguments */ + ttag = tag; + tclass = iclass & ASN1_TFLG_TAG_CLASS; + } else { + ttag = -1; + tclass = 0; + } + /* + * Remove any class mask from iflag. + */ + iclass &= ~ASN1_TFLG_TAG_CLASS; + + /* + * At this point 'ttag' contains the outer tag to use, 'tclass' is the + * class and iclass is any flags passed to this function. + */ + + /* if template and arguments require ndef, use it */ + if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF)) + ndef = 2; + else + ndef = 1; + + if (flags & ASN1_TFLG_SK_MASK) { + /* SET OF, SEQUENCE OF */ + STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; + int isset, sktag, skaclass; + int skcontlen, sklen; + ASN1_VALUE *skitem; + + if (!*pval) + return 0; + + if (flags & ASN1_TFLG_SET_OF) { + isset = 1; + /* 2 means we reorder */ + if (flags & ASN1_TFLG_SEQUENCE_OF) + isset = 2; + } else + isset = 0; + + /* + * Work out inner tag value: if EXPLICIT or no tagging use underlying + * type. + */ + if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) { + sktag = ttag; + skaclass = tclass; + } else { + skaclass = V_ASN1_UNIVERSAL; + if (isset) + sktag = V_ASN1_SET; + else + sktag = V_ASN1_SEQUENCE; + } + + /* Determine total length of items */ + skcontlen = 0; + for (j = 0; j < sk_ASN1_VALUE_num(sk); j++) { + int tmplen; + skitem = sk_ASN1_VALUE_value(sk, j); + tmplen = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), + -1, iclass); + if (tmplen == -1 || (skcontlen > INT_MAX - tmplen)) + return -1; + skcontlen += tmplen; + } + sklen = ASN1_object_size(ndef, skcontlen, sktag); + if (sklen == -1) + return -1; + /* If EXPLICIT need length of surrounding tag */ + if (flags & ASN1_TFLG_EXPTAG) + ret = ASN1_object_size(ndef, sklen, ttag); + else + ret = sklen; + + if (!out || ret == -1) + return ret; + + /* Now encode this lot... */ + /* EXPLICIT tag */ + if (flags & ASN1_TFLG_EXPTAG) + ASN1_put_object(out, ndef, sklen, ttag, tclass); + /* SET or SEQUENCE and IMPLICIT tag */ + ASN1_put_object(out, ndef, skcontlen, sktag, skaclass); + /* And the stuff itself */ + asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), + isset, iclass); + if (ndef == 2) { + ASN1_put_eoc(out); + if (flags & ASN1_TFLG_EXPTAG) + ASN1_put_eoc(out); + } + + return ret; + } + + if (flags & ASN1_TFLG_EXPTAG) { + /* EXPLICIT tagging */ + /* Find length of tagged item */ + i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass); + if (!i) + return 0; + /* Find length of EXPLICIT tag */ + ret = ASN1_object_size(ndef, i, ttag); + if (out && ret != -1) { + /* Output tag and item */ + ASN1_put_object(out, ndef, i, ttag, tclass); + ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass); + if (ndef == 2) + ASN1_put_eoc(out); + } + return ret; + } + + /* Either normal or IMPLICIT tagging: combine class and flags */ + return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), + ttag, tclass | iclass); + +} + +/* Temporary structure used to hold DER encoding of items for SET OF */ + +typedef struct { + unsigned char *data; + int length; + ASN1_VALUE *field; +} DER_ENC; + +static int der_cmp(const void *a, const void *b) +{ + const DER_ENC *d1 = a, *d2 = b; + int cmplen, i; + cmplen = (d1->length < d2->length) ? d1->length : d2->length; + i = OPENSSL_memcmp(d1->data, d2->data, cmplen); + if (i) + return i; + return d1->length - d2->length; +} + +/* Output the content octets of SET OF or SEQUENCE OF */ + +static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, + int skcontlen, const ASN1_ITEM *item, + int do_sort, int iclass) +{ + size_t i; + ASN1_VALUE *skitem; + unsigned char *tmpdat = NULL, *p = NULL; + DER_ENC *derlst = NULL, *tder; + if (do_sort) { + /* Don't need to sort less than 2 items */ + if (sk_ASN1_VALUE_num(sk) < 2) + do_sort = 0; + else { + derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) + * sizeof(*derlst)); + if (!derlst) + return 0; + tmpdat = OPENSSL_malloc(skcontlen); + if (!tmpdat) { + OPENSSL_free(derlst); + return 0; + } + } + } + /* If not sorting just output each item */ + if (!do_sort) { + for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + skitem = sk_ASN1_VALUE_value(sk, i); + ASN1_item_ex_i2d(&skitem, out, item, -1, iclass); + } + return 1; + } + p = tmpdat; + + /* Doing sort: build up a list of each member's DER encoding */ + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { + skitem = sk_ASN1_VALUE_value(sk, i); + tder->data = p; + tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass); + tder->field = skitem; + } + + /* Now sort them */ + qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp); + /* Output sorted DER encoding */ + p = *out; + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { + OPENSSL_memcpy(p, tder->data, tder->length); + p += tder->length; + } + *out = p; + /* If do_sort is 2 then reorder the STACK */ + if (do_sort == 2) { + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) + (void)sk_ASN1_VALUE_set(sk, i, tder->field); + } + OPENSSL_free(derlst); + OPENSSL_free(tmpdat); + return 1; +} + +static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + int len; + int utype; + int usetag; + int ndef = 0; + + utype = it->utype; + + /* + * Get length of content octets and maybe find out the underlying type. + */ + + len = asn1_ex_i2c(pval, NULL, &utype, it); + + /* + * If SEQUENCE, SET or OTHER then header is included in pseudo content + * octets so don't include tag+length. We need to check here because the + * call to asn1_ex_i2c() could change utype. + */ + if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || + (utype == V_ASN1_OTHER)) + usetag = 0; + else + usetag = 1; + + /* -1 means omit type */ + + if (len == -1) + return 0; + + /* -2 return is special meaning use ndef */ + if (len == -2) { + ndef = 2; + len = 0; + } + + /* If not implicitly tagged get tag from underlying type */ + if (tag == -1) + tag = utype; + + /* Output tag+length followed by content octets */ + if (out) { + if (usetag) + ASN1_put_object(out, ndef, len, tag, aclass); + asn1_ex_i2c(pval, *out, &utype, it); + if (ndef) + ASN1_put_eoc(out); + else + *out += len; + } + + if (usetag) + return ASN1_object_size(ndef, len, tag); + return len; +} + +/* Produce content octets from a structure */ + +int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, + const ASN1_ITEM *it) +{ + ASN1_BOOLEAN *tbool = NULL; + ASN1_STRING *strtmp; + ASN1_OBJECT *otmp; + int utype; + const unsigned char *cont; + unsigned char c; + int len; + const ASN1_PRIMITIVE_FUNCS *pf; + pf = it->funcs; + if (pf && pf->prim_i2c) + return pf->prim_i2c(pval, cout, putype, it); + + /* Should type be omitted? */ + if ((it->itype != ASN1_ITYPE_PRIMITIVE) + || (it->utype != V_ASN1_BOOLEAN)) { + if (!*pval) + return -1; + } + + if (it->itype == ASN1_ITYPE_MSTRING) { + /* If MSTRING type set the underlying type */ + strtmp = (ASN1_STRING *)*pval; + utype = strtmp->type; + *putype = utype; + } else if (it->utype == V_ASN1_ANY) { + /* If ANY set type and pointer to value */ + ASN1_TYPE *typ; + typ = (ASN1_TYPE *)*pval; + utype = typ->type; + *putype = utype; + pval = &typ->value.asn1_value; + } else + utype = *putype; + + switch (utype) { + case V_ASN1_OBJECT: + otmp = (ASN1_OBJECT *)*pval; + cont = otmp->data; + len = otmp->length; + if (cont == NULL || len == 0) + return -1; + break; + + case V_ASN1_NULL: + cont = NULL; + len = 0; + break; + + case V_ASN1_BOOLEAN: + tbool = (ASN1_BOOLEAN *)pval; + if (*tbool == -1) + return -1; + if (it->utype != V_ASN1_ANY) { + /* + * Default handling if value == size field then omit + */ + if (*tbool && (it->size > 0)) + return -1; + if (!*tbool && !it->size) + return -1; + } + c = (unsigned char)*tbool; + cont = &c; + len = 1; + break; + + case V_ASN1_BIT_STRING: + return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, + cout ? &cout : NULL); + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + /* + * These are all have the same content format as ASN1_INTEGER + */ + return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL); + break; + + case V_ASN1_OCTET_STRING: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_SEQUENCE: + case V_ASN1_SET: + default: + /* All based on ASN1_STRING and handled the same */ + strtmp = (ASN1_STRING *)*pval; + /* Special handling for NDEF */ + if ((it->size == ASN1_TFLG_NDEF) + && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) { + if (cout) { + strtmp->data = cout; + strtmp->length = 0; + } + /* Special return code */ + return -2; + } + cont = strtmp->data; + len = strtmp->length; + + break; + + } + if (cout && len) + OPENSSL_memcpy(cout, cont, len); + return len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back new file mode 100644 index 0000000..3722a51 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back @@ -0,0 +1,664 @@ +/* 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 "../internal.h" + + +static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); +static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, + int skcontlen, const ASN1_ITEM *item, + int do_sort, int iclass); +static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_TEMPLATE *tt, int tag, int aclass); +static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it, int flags); + +/* + * Top level i2d equivalents: the 'ndef' variant instructs the encoder to use + * indefinite length constructed encoding, where appropriate + */ + +int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it) +{ + return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF); +} + +int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) +{ + return asn1_item_flags_i2d(val, out, it, 0); +} + +/* + * Encode an ASN1 item, this is use by the standard 'i2d' function. 'out' + * points to a buffer to output the data to. The new i2d has one additional + * feature. If the output buffer is NULL (i.e. *out == NULL) then a buffer is + * allocated and populated with the encoding. + */ + +static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it, int flags) +{ + if (out && !*out) { + unsigned char *p, *buf; + int len; + len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags); + if (len <= 0) + return len; + buf = OPENSSL_malloc(len); + if (!buf) + return -1; + p = buf; + ASN1_item_ex_i2d(&val, &p, it, -1, flags); + *out = buf; + return len; + } + + return ASN1_item_ex_i2d(&val, out, it, -1, flags); +} + +/* + * Encode an item, taking care of IMPLICIT tagging (if any). This function + * performs the normal item handling: it can be used in external types. + */ + +int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + const ASN1_TEMPLATE *tt = NULL; + unsigned char *p = NULL; + int i, seqcontlen, seqlen, ndef = 1; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb = 0; + + if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) + return 0; + + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + + switch (it->itype) { + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + return asn1_template_ex_i2d(pval, out, it->templates, + tag, aclass); + return asn1_i2d_ex_primitive(pval, out, it, tag, aclass); + break; + + case ASN1_ITYPE_MSTRING: + return asn1_i2d_ex_primitive(pval, out, it, -1, aclass); + + case ASN1_ITYPE_CHOICE: + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL)) + return 0; + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + ASN1_VALUE **pchval; + const ASN1_TEMPLATE *chtt; + chtt = it->templates + i; + pchval = asn1_get_field_ptr(pval, chtt); + return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass); + } + /* Fixme: error condition if selector out of range */ + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL)) + return 0; + break; + + case ASN1_ITYPE_EXTERN: + /* If new style i2d it does all the work */ + ef = it->funcs; + return ef->asn1_ex_i2d(pval, out, it, tag, aclass); + + case ASN1_ITYPE_COMPAT: + /* old style hackery... */ + cf = it->funcs; + if (out) + p = *out; + i = cf->asn1_i2d(*pval, out); + /* + * Fixup for IMPLICIT tag: note this messes up for tags > 30, but so + * did the old code. Tags > 30 are very rare anyway. + */ + if (out && (tag != -1)) + *p = aclass | tag | (*p & V_ASN1_CONSTRUCTED); + return i; + + case ASN1_ITYPE_NDEF_SEQUENCE: + /* Use indefinite length constructed if requested */ + if (aclass & ASN1_TFLG_NDEF) + ndef = 2; + OPENSSL_FALLTHROUGH; + + case ASN1_ITYPE_SEQUENCE: + i = asn1_enc_restore(&seqcontlen, out, pval, it); + /* An error occurred */ + if (i < 0) + return 0; + /* We have a valid cached encoding... */ + if (i > 0) + return seqcontlen; + /* Otherwise carry on */ + seqcontlen = 0; + /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ + if (tag == -1) { + tag = V_ASN1_SEQUENCE; + /* Retain any other flags in aclass */ + aclass = (aclass & ~ASN1_TFLG_TAG_CLASS) + | V_ASN1_UNIVERSAL; + } + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL)) + return 0; + /* First work out sequence content length */ + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + int tmplen; + seqtt = asn1_do_adb(pval, tt, 1); + if (!seqtt) + return 0; + pseqval = asn1_get_field_ptr(pval, seqtt); + tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass); + if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen)) + return -1; + seqcontlen += tmplen; + } + + seqlen = ASN1_object_size(ndef, seqcontlen, tag); + if (!out || seqlen == -1) + return seqlen; + /* Output SEQUENCE header */ + ASN1_put_object(out, ndef, seqcontlen, tag, aclass); + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + const ASN1_TEMPLATE *seqtt; + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 1); + if (!seqtt) + return 0; + pseqval = asn1_get_field_ptr(pval, seqtt); + /* FIXME: check for errors in enhanced version */ + asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass); + } + if (ndef == 2) + ASN1_put_eoc(out); + if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL)) + return 0; + return seqlen; + + default: + return 0; + + } + return 0; +} + +static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, + const ASN1_TEMPLATE *tt, int tag, int iclass) +{ + int i, ret, flags, ttag, tclass, ndef; + size_t j; + flags = tt->flags; + /* + * Work out tag and class to use: tagging may come either from the + * template or the arguments, not both because this would create + * ambiguity. Additionally the iclass argument may contain some + * additional flags which should be noted and passed down to other + * levels. + */ + if (flags & ASN1_TFLG_TAG_MASK) { + /* Error if argument and template tagging */ + if (tag != -1) + /* FIXME: error code here */ + return -1; + /* Get tagging from template */ + ttag = tt->tag; + tclass = flags & ASN1_TFLG_TAG_CLASS; + } else if (tag != -1) { + /* No template tagging, get from arguments */ + ttag = tag; + tclass = iclass & ASN1_TFLG_TAG_CLASS; + } else { + ttag = -1; + tclass = 0; + } + /* + * Remove any class mask from iflag. + */ + iclass &= ~ASN1_TFLG_TAG_CLASS; + + /* + * At this point 'ttag' contains the outer tag to use, 'tclass' is the + * class and iclass is any flags passed to this function. + */ + + /* if template and arguments require ndef, use it */ + if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF)) + ndef = 2; + else + ndef = 1; + + if (flags & ASN1_TFLG_SK_MASK) { + /* SET OF, SEQUENCE OF */ + STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; + int isset, sktag, skaclass; + int skcontlen, sklen; + ASN1_VALUE *skitem; + + if (!*pval) + return 0; + + if (flags & ASN1_TFLG_SET_OF) { + isset = 1; + /* 2 means we reorder */ + if (flags & ASN1_TFLG_SEQUENCE_OF) + isset = 2; + } else + isset = 0; + + /* + * Work out inner tag value: if EXPLICIT or no tagging use underlying + * type. + */ + if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) { + sktag = ttag; + skaclass = tclass; + } else { + skaclass = V_ASN1_UNIVERSAL; + if (isset) + sktag = V_ASN1_SET; + else + sktag = V_ASN1_SEQUENCE; + } + + /* Determine total length of items */ + skcontlen = 0; + for (j = 0; j < sk_ASN1_VALUE_num(sk); j++) { + int tmplen; + skitem = sk_ASN1_VALUE_value(sk, j); + tmplen = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), + -1, iclass); + if (tmplen == -1 || (skcontlen > INT_MAX - tmplen)) + return -1; + skcontlen += tmplen; + } + sklen = ASN1_object_size(ndef, skcontlen, sktag); + if (sklen == -1) + return -1; + /* If EXPLICIT need length of surrounding tag */ + if (flags & ASN1_TFLG_EXPTAG) + ret = ASN1_object_size(ndef, sklen, ttag); + else + ret = sklen; + + if (!out || ret == -1) + return ret; + + /* Now encode this lot... */ + /* EXPLICIT tag */ + if (flags & ASN1_TFLG_EXPTAG) + ASN1_put_object(out, ndef, sklen, ttag, tclass); + /* SET or SEQUENCE and IMPLICIT tag */ + ASN1_put_object(out, ndef, skcontlen, sktag, skaclass); + /* And the stuff itself */ + asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), + isset, iclass); + if (ndef == 2) { + ASN1_put_eoc(out); + if (flags & ASN1_TFLG_EXPTAG) + ASN1_put_eoc(out); + } + + return ret; + } + + if (flags & ASN1_TFLG_EXPTAG) { + /* EXPLICIT tagging */ + /* Find length of tagged item */ + i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass); + if (!i) + return 0; + /* Find length of EXPLICIT tag */ + ret = ASN1_object_size(ndef, i, ttag); + if (out && ret != -1) { + /* Output tag and item */ + ASN1_put_object(out, ndef, i, ttag, tclass); + ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass); + if (ndef == 2) + ASN1_put_eoc(out); + } + return ret; + } + + /* Either normal or IMPLICIT tagging: combine class and flags */ + return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), + ttag, tclass | iclass); + +} + +/* Temporary structure used to hold DER encoding of items for SET OF */ + +typedef struct { + unsigned char *data; + int length; + ASN1_VALUE *field; +} DER_ENC; + +static int der_cmp(const void *a, const void *b) +{ + const DER_ENC *d1 = a, *d2 = b; + int cmplen, i; + cmplen = (d1->length < d2->length) ? d1->length : d2->length; + i = OPENSSL_memcmp(d1->data, d2->data, cmplen); + if (i) + return i; + return d1->length - d2->length; +} + +/* Output the content octets of SET OF or SEQUENCE OF */ + +static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, + int skcontlen, const ASN1_ITEM *item, + int do_sort, int iclass) +{ + size_t i; + ASN1_VALUE *skitem; + unsigned char *tmpdat = NULL, *p = NULL; + DER_ENC *derlst = NULL, *tder; + if (do_sort) { + /* Don't need to sort less than 2 items */ + if (sk_ASN1_VALUE_num(sk) < 2) + do_sort = 0; + else { + derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) + * sizeof(*derlst)); + if (!derlst) + return 0; + tmpdat = OPENSSL_malloc(skcontlen); + if (!tmpdat) { + OPENSSL_free(derlst); + return 0; + } + } + } + /* If not sorting just output each item */ + if (!do_sort) { + for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + skitem = sk_ASN1_VALUE_value(sk, i); + ASN1_item_ex_i2d(&skitem, out, item, -1, iclass); + } + return 1; + } + p = tmpdat; + + /* Doing sort: build up a list of each member's DER encoding */ + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { + skitem = sk_ASN1_VALUE_value(sk, i); + tder->data = p; + tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass); + tder->field = skitem; + } + + /* Now sort them */ + qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp); + /* Output sorted DER encoding */ + p = *out; + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { + OPENSSL_memcpy(p, tder->data, tder->length); + p += tder->length; + } + *out = p; + /* If do_sort is 2 then reorder the STACK */ + if (do_sort == 2) { + for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) + (void)sk_ASN1_VALUE_set(sk, i, tder->field); + } + OPENSSL_free(derlst); + OPENSSL_free(tmpdat); + return 1; +} + +static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + int len; + int utype; + int usetag; + int ndef = 0; + + utype = it->utype; + + /* + * Get length of content octets and maybe find out the underlying type. + */ + + len = asn1_ex_i2c(pval, NULL, &utype, it); + + /* + * If SEQUENCE, SET or OTHER then header is included in pseudo content + * octets so don't include tag+length. We need to check here because the + * call to asn1_ex_i2c() could change utype. + */ + if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || + (utype == V_ASN1_OTHER)) + usetag = 0; + else + usetag = 1; + + /* -1 means omit type */ + + if (len == -1) + return 0; + + /* -2 return is special meaning use ndef */ + if (len == -2) { + ndef = 2; + len = 0; + } + + /* If not implicitly tagged get tag from underlying type */ + if (tag == -1) + tag = utype; + + /* Output tag+length followed by content octets */ + if (out) { + if (usetag) + ASN1_put_object(out, ndef, len, tag, aclass); + asn1_ex_i2c(pval, *out, &utype, it); + if (ndef) + ASN1_put_eoc(out); + else + *out += len; + } + + if (usetag) + return ASN1_object_size(ndef, len, tag); + return len; +} + +/* Produce content octets from a structure */ + +int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, + const ASN1_ITEM *it) +{ + ASN1_BOOLEAN *tbool = NULL; + ASN1_STRING *strtmp; + ASN1_OBJECT *otmp; + int utype; + const unsigned char *cont; + unsigned char c; + int len; + const ASN1_PRIMITIVE_FUNCS *pf; + pf = it->funcs; + if (pf && pf->prim_i2c) + return pf->prim_i2c(pval, cout, putype, it); + + /* Should type be omitted? */ + if ((it->itype != ASN1_ITYPE_PRIMITIVE) + || (it->utype != V_ASN1_BOOLEAN)) { + if (!*pval) + return -1; + } + + if (it->itype == ASN1_ITYPE_MSTRING) { + /* If MSTRING type set the underlying type */ + strtmp = (ASN1_STRING *)*pval; + utype = strtmp->type; + *putype = utype; + } else if (it->utype == V_ASN1_ANY) { + /* If ANY set type and pointer to value */ + ASN1_TYPE *typ; + typ = (ASN1_TYPE *)*pval; + utype = typ->type; + *putype = utype; + pval = &typ->value.asn1_value; + } else + utype = *putype; + + switch (utype) { + case V_ASN1_OBJECT: + otmp = (ASN1_OBJECT *)*pval; + cont = otmp->data; + len = otmp->length; + if (cont == NULL || len == 0) + return -1; + break; + + case V_ASN1_NULL: + cont = NULL; + len = 0; + break; + + case V_ASN1_BOOLEAN: + tbool = (ASN1_BOOLEAN *)pval; + if (*tbool == -1) + return -1; + if (it->utype != V_ASN1_ANY) { + /* + * Default handling if value == size field then omit + */ + if (*tbool && (it->size > 0)) + return -1; + if (!*tbool && !it->size) + return -1; + } + c = (unsigned char)*tbool; + cont = &c; + len = 1; + break; + + case V_ASN1_BIT_STRING: + return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, + cout ? &cout : NULL); + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + /* + * These are all have the same content format as ASN1_INTEGER + */ + return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL); + break; + + case V_ASN1_OCTET_STRING: + case V_ASN1_NUMERICSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_T61STRING: + case V_ASN1_VIDEOTEXSTRING: + case V_ASN1_IA5STRING: + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + case V_ASN1_GRAPHICSTRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_BMPSTRING: + case V_ASN1_UTF8STRING: + case V_ASN1_SEQUENCE: + case V_ASN1_SET: + default: + /* All based on ASN1_STRING and handled the same */ + strtmp = (ASN1_STRING *)*pval; + /* Special handling for NDEF */ + if ((it->size == ASN1_TFLG_NDEF) + && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) { + if (cout) { + strtmp->data = cout; + strtmp->length = 0; + } + /* Special return code */ + return -2; + } + cont = strtmp->data; + len = strtmp->length; + + break; + + } + if (cout && len) + OPENSSL_memcpy(cout, cont, len); + return len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c new file mode 100644 index 0000000..65bea9a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c @@ -0,0 +1,244 @@ +/* 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 "asn1_locl.h" + +/* Free up an ASN1 structure */ + +void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it) +{ + asn1_item_combine_free(&val, it, 0); +} + +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + asn1_item_combine_free(pval, it, 0); +} + +void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) +{ + const ASN1_TEMPLATE *tt = NULL, *seqtt; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + int i; + if (!pval) + return; + if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) + return; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + + switch (it->itype) { + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + ASN1_template_free(pval, it->templates); + else + ASN1_primitive_free(pval, it); + break; + + case ASN1_ITYPE_MSTRING: + ASN1_primitive_free(pval, it); + break; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL); + if (i == 2) + return; + } + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + ASN1_VALUE **pchval; + tt = it->templates + i; + pchval = asn1_get_field_ptr(pval, tt); + ASN1_template_free(pchval, tt); + } + if (asn1_cb) + asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL); + if (!combine) { + OPENSSL_free(*pval); + *pval = NULL; + } + break; + + case ASN1_ITYPE_COMPAT: + cf = it->funcs; + if (cf && cf->asn1_free) + cf->asn1_free(*pval); + break; + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_free) + ef->asn1_ex_free(pval, it); + break; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + if (!asn1_refcount_dec_and_test_zero(pval, it)) + return; + if (asn1_cb) { + i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL); + if (i == 2) + return; + } + asn1_enc_free(pval, it); + /* + * If we free up as normal we will invalidate any ANY DEFINED BY + * field and we wont be able to determine the type of the field it + * defines. So free up in reverse order. + */ + tt = it->templates + it->tcount - 1; + for (i = 0; i < it->tcount; tt--, i++) { + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 0); + if (!seqtt) + continue; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } + if (asn1_cb) + asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL); + if (!combine) { + OPENSSL_free(*pval); + *pval = NULL; + } + break; + } +} + +void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + size_t i; + if (tt->flags & ASN1_TFLG_SK_MASK) { + STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; + for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + ASN1_VALUE *vtmp; + vtmp = sk_ASN1_VALUE_value(sk, i); + asn1_item_combine_free(&vtmp, ASN1_ITEM_ptr(tt->item), 0); + } + sk_ASN1_VALUE_free(sk); + *pval = NULL; + } else + asn1_item_combine_free(pval, ASN1_ITEM_ptr(tt->item), + tt->flags & ASN1_TFLG_COMBINE); +} + +void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + int utype; + if (it) { + const ASN1_PRIMITIVE_FUNCS *pf; + pf = it->funcs; + if (pf && pf->prim_free) { + pf->prim_free(pval, it); + return; + } + } + /* Special case: if 'it' is NULL free contents of ASN1_TYPE */ + if (!it) { + ASN1_TYPE *typ = (ASN1_TYPE *)*pval; + utype = typ->type; + pval = &typ->value.asn1_value; + if (!*pval) + return; + } else if (it->itype == ASN1_ITYPE_MSTRING) { + utype = -1; + if (!*pval) + return; + } else { + utype = it->utype; + if ((utype != V_ASN1_BOOLEAN) && !*pval) + return; + } + + switch (utype) { + case V_ASN1_OBJECT: + ASN1_OBJECT_free((ASN1_OBJECT *)*pval); + break; + + case V_ASN1_BOOLEAN: + if (it) + *(ASN1_BOOLEAN *)pval = it->size; + else + *(ASN1_BOOLEAN *)pval = -1; + return; + + case V_ASN1_NULL: + break; + + case V_ASN1_ANY: + ASN1_primitive_free(pval, NULL); + OPENSSL_free(*pval); + break; + + default: + ASN1_STRING_free((ASN1_STRING *)*pval); + *pval = NULL; + break; + } + *pval = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c.grpc_back new file mode 100644 index 0000000..eabc0fb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c.grpc_back @@ -0,0 +1,244 @@ +/* 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 "asn1_locl.h" + +/* Free up an ASN1 structure */ + +void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it) +{ + asn1_item_combine_free(&val, it, 0); +} + +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + asn1_item_combine_free(pval, it, 0); +} + +void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) +{ + const ASN1_TEMPLATE *tt = NULL, *seqtt; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + int i; + if (!pval) + return; + if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) + return; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + + switch (it->itype) { + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + ASN1_template_free(pval, it->templates); + else + ASN1_primitive_free(pval, it); + break; + + case ASN1_ITYPE_MSTRING: + ASN1_primitive_free(pval, it); + break; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL); + if (i == 2) + return; + } + i = asn1_get_choice_selector(pval, it); + if ((i >= 0) && (i < it->tcount)) { + ASN1_VALUE **pchval; + tt = it->templates + i; + pchval = asn1_get_field_ptr(pval, tt); + ASN1_template_free(pchval, tt); + } + if (asn1_cb) + asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL); + if (!combine) { + OPENSSL_free(*pval); + *pval = NULL; + } + break; + + case ASN1_ITYPE_COMPAT: + cf = it->funcs; + if (cf && cf->asn1_free) + cf->asn1_free(*pval); + break; + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_free) + ef->asn1_ex_free(pval, it); + break; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + if (!asn1_refcount_dec_and_test_zero(pval, it)) + return; + if (asn1_cb) { + i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL); + if (i == 2) + return; + } + asn1_enc_free(pval, it); + /* + * If we free up as normal we will invalidate any ANY DEFINED BY + * field and we wont be able to determine the type of the field it + * defines. So free up in reverse order. + */ + tt = it->templates + it->tcount - 1; + for (i = 0; i < it->tcount; tt--, i++) { + ASN1_VALUE **pseqval; + seqtt = asn1_do_adb(pval, tt, 0); + if (!seqtt) + continue; + pseqval = asn1_get_field_ptr(pval, seqtt); + ASN1_template_free(pseqval, seqtt); + } + if (asn1_cb) + asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL); + if (!combine) { + OPENSSL_free(*pval); + *pval = NULL; + } + break; + } +} + +void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + size_t i; + if (tt->flags & ASN1_TFLG_SK_MASK) { + STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; + for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + ASN1_VALUE *vtmp; + vtmp = sk_ASN1_VALUE_value(sk, i); + asn1_item_combine_free(&vtmp, ASN1_ITEM_ptr(tt->item), 0); + } + sk_ASN1_VALUE_free(sk); + *pval = NULL; + } else + asn1_item_combine_free(pval, ASN1_ITEM_ptr(tt->item), + tt->flags & ASN1_TFLG_COMBINE); +} + +void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + int utype; + if (it) { + const ASN1_PRIMITIVE_FUNCS *pf; + pf = it->funcs; + if (pf && pf->prim_free) { + pf->prim_free(pval, it); + return; + } + } + /* Special case: if 'it' is NULL free contents of ASN1_TYPE */ + if (!it) { + ASN1_TYPE *typ = (ASN1_TYPE *)*pval; + utype = typ->type; + pval = &typ->value.asn1_value; + if (!*pval) + return; + } else if (it->itype == ASN1_ITYPE_MSTRING) { + utype = -1; + if (!*pval) + return; + } else { + utype = it->utype; + if ((utype != V_ASN1_BOOLEAN) && !*pval) + return; + } + + switch (utype) { + case V_ASN1_OBJECT: + ASN1_OBJECT_free((ASN1_OBJECT *)*pval); + break; + + case V_ASN1_BOOLEAN: + if (it) + *(ASN1_BOOLEAN *)pval = it->size; + else + *(ASN1_BOOLEAN *)pval = -1; + return; + + case V_ASN1_NULL: + break; + + case V_ASN1_ANY: + ASN1_primitive_free(pval, NULL); + OPENSSL_free(*pval); + break; + + default: + ASN1_STRING_free((ASN1_STRING *)*pval); + *pval = NULL; + break; + } + *pval = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c new file mode 100644 index 0000000..c1a4e63 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c @@ -0,0 +1,387 @@ +/* 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 "../internal.h" + + +static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine); +static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); +static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); + +ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it) +{ + ASN1_VALUE *ret = NULL; + if (ASN1_item_ex_new(&ret, it) > 0) + return ret; + return NULL; +} + +/* Allocate an ASN1 structure */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + return asn1_item_ex_combine_new(pval, it, 0); +} + +static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine) +{ + const ASN1_TEMPLATE *tt = NULL; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + ASN1_VALUE **pseqval; + int i; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_push_info(it->sname); +#endif + + switch (it->itype) { + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_new) { + if (!ef->asn1_ex_new(pval, it)) + goto memerr; + } + break; + + case ASN1_ITYPE_COMPAT: + cf = it->funcs; + if (cf && cf->asn1_new) { + *pval = cf->asn1_new(); + if (!*pval) + goto memerr; + } + break; + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) { + if (!ASN1_template_new(pval, it->templates)) + goto memerr; + } else if (!ASN1_primitive_new(pval, it)) + goto memerr; + break; + + case ASN1_ITYPE_MSTRING: + if (!ASN1_primitive_new(pval, it)) + goto memerr; + break; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); + if (!i) + goto auxerr; + if (i == 2) { +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + } + } + if (!combine) { + *pval = OPENSSL_malloc(it->size); + if (!*pval) + goto memerr; + OPENSSL_memset(*pval, 0, it->size); + } + asn1_set_choice_selector(pval, -1, it); + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) + goto auxerr2; + break; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); + if (!i) + goto auxerr; + if (i == 2) { +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + } + } + if (!combine) { + *pval = OPENSSL_malloc(it->size); + if (!*pval) + goto memerr; + OPENSSL_memset(*pval, 0, it->size); + asn1_refcount_set_one(pval, it); + asn1_enc_init(pval, it); + } + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + pseqval = asn1_get_field_ptr(pval, tt); + if (!ASN1_template_new(pseqval, tt)) + goto memerr2; + } + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) + goto auxerr2; + break; + } +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + + memerr2: + asn1_item_combine_free(pval, it, combine); + memerr: + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 0; + + auxerr2: + asn1_item_combine_free(pval, it, combine); + auxerr: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_AUX_ERROR); +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 0; + +} + +static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + const ASN1_EXTERN_FUNCS *ef; + + switch (it->itype) { + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_clear) + ef->asn1_ex_clear(pval, it); + else + *pval = NULL; + break; + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + asn1_template_clear(pval, it->templates); + else + asn1_primitive_clear(pval, it); + break; + + case ASN1_ITYPE_MSTRING: + asn1_primitive_clear(pval, it); + break; + + case ASN1_ITYPE_COMPAT: + case ASN1_ITYPE_CHOICE: + case ASN1_ITYPE_SEQUENCE: + case ASN1_ITYPE_NDEF_SEQUENCE: + *pval = NULL; + break; + } +} + +int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); + int ret; + if (tt->flags & ASN1_TFLG_OPTIONAL) { + asn1_template_clear(pval, tt); + return 1; + } + /* If ANY DEFINED BY nothing to do */ + + if (tt->flags & ASN1_TFLG_ADB_MASK) { + *pval = NULL; + return 1; + } +#ifdef CRYPTO_MDEBUG + if (tt->field_name) + CRYPTO_push_info(tt->field_name); +#endif + /* If SET OF or SEQUENCE OF, its a STACK */ + if (tt->flags & ASN1_TFLG_SK_MASK) { + STACK_OF(ASN1_VALUE) *skval; + skval = sk_ASN1_VALUE_new_null(); + if (!skval) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + ret = 0; + goto done; + } + *pval = (ASN1_VALUE *)skval; + ret = 1; + goto done; + } + /* Otherwise pass it back to the item routine */ + ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE); + done: +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return ret; +} + +static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + /* If ADB or STACK just NULL the field */ + if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK)) + *pval = NULL; + else + asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item)); +} + +/* + * NB: could probably combine most of the real XXX_new() behaviour and junk + * all the old functions. + */ + +int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + ASN1_TYPE *typ; + ASN1_STRING *str; + int utype; + + if (!it) + return 0; + + if (it->funcs) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_new) + return pf->prim_new(pval, it); + } + + if (it->itype == ASN1_ITYPE_MSTRING) + utype = -1; + else + utype = it->utype; + switch (utype) { + case V_ASN1_OBJECT: + *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef); + return 1; + + case V_ASN1_BOOLEAN: + *(ASN1_BOOLEAN *)pval = it->size; + return 1; + + case V_ASN1_NULL: + *pval = (ASN1_VALUE *)1; + return 1; + + case V_ASN1_ANY: + typ = OPENSSL_malloc(sizeof(ASN1_TYPE)); + if (!typ) + return 0; + typ->value.ptr = NULL; + typ->type = -1; + *pval = (ASN1_VALUE *)typ; + break; + + default: + str = ASN1_STRING_type_new(utype); + if (it->itype == ASN1_ITYPE_MSTRING && str) + str->flags |= ASN1_STRING_FLAG_MSTRING; + *pval = (ASN1_VALUE *)str; + break; + } + if (*pval) + return 1; + return 0; +} + +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + int utype; + if (it && it->funcs) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_clear) + pf->prim_clear(pval, it); + else + *pval = NULL; + return; + } + if (!it || (it->itype == ASN1_ITYPE_MSTRING)) + utype = -1; + else + utype = it->utype; + if (utype == V_ASN1_BOOLEAN) + *(ASN1_BOOLEAN *)pval = it->size; + else + *pval = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c.grpc_back new file mode 100644 index 0000000..5db38be --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c.grpc_back @@ -0,0 +1,387 @@ +/* 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 "../internal.h" + + +static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine); +static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); +static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); + +ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it) +{ + ASN1_VALUE *ret = NULL; + if (ASN1_item_ex_new(&ret, it) > 0) + return ret; + return NULL; +} + +/* Allocate an ASN1 structure */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + return asn1_item_ex_combine_new(pval, it, 0); +} + +static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, + int combine) +{ + const ASN1_TEMPLATE *tt = NULL; + const ASN1_COMPAT_FUNCS *cf; + const ASN1_EXTERN_FUNCS *ef; + const ASN1_AUX *aux = it->funcs; + ASN1_aux_cb *asn1_cb; + ASN1_VALUE **pseqval; + int i; + if (aux && aux->asn1_cb) + asn1_cb = aux->asn1_cb; + else + asn1_cb = 0; + +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_push_info(it->sname); +#endif + + switch (it->itype) { + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_new) { + if (!ef->asn1_ex_new(pval, it)) + goto memerr; + } + break; + + case ASN1_ITYPE_COMPAT: + cf = it->funcs; + if (cf && cf->asn1_new) { + *pval = cf->asn1_new(); + if (!*pval) + goto memerr; + } + break; + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) { + if (!ASN1_template_new(pval, it->templates)) + goto memerr; + } else if (!ASN1_primitive_new(pval, it)) + goto memerr; + break; + + case ASN1_ITYPE_MSTRING: + if (!ASN1_primitive_new(pval, it)) + goto memerr; + break; + + case ASN1_ITYPE_CHOICE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); + if (!i) + goto auxerr; + if (i == 2) { +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + } + } + if (!combine) { + *pval = OPENSSL_malloc(it->size); + if (!*pval) + goto memerr; + OPENSSL_memset(*pval, 0, it->size); + } + asn1_set_choice_selector(pval, -1, it); + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) + goto auxerr2; + break; + + case ASN1_ITYPE_NDEF_SEQUENCE: + case ASN1_ITYPE_SEQUENCE: + if (asn1_cb) { + i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); + if (!i) + goto auxerr; + if (i == 2) { +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + } + } + if (!combine) { + *pval = OPENSSL_malloc(it->size); + if (!*pval) + goto memerr; + OPENSSL_memset(*pval, 0, it->size); + asn1_refcount_set_one(pval, it); + asn1_enc_init(pval, it); + } + for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { + pseqval = asn1_get_field_ptr(pval, tt); + if (!ASN1_template_new(pseqval, tt)) + goto memerr2; + } + if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) + goto auxerr2; + break; + } +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 1; + + memerr2: + asn1_item_combine_free(pval, it, combine); + memerr: + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 0; + + auxerr2: + asn1_item_combine_free(pval, it, combine); + auxerr: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_AUX_ERROR); +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return 0; + +} + +static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + const ASN1_EXTERN_FUNCS *ef; + + switch (it->itype) { + + case ASN1_ITYPE_EXTERN: + ef = it->funcs; + if (ef && ef->asn1_ex_clear) + ef->asn1_ex_clear(pval, it); + else + *pval = NULL; + break; + + case ASN1_ITYPE_PRIMITIVE: + if (it->templates) + asn1_template_clear(pval, it->templates); + else + asn1_primitive_clear(pval, it); + break; + + case ASN1_ITYPE_MSTRING: + asn1_primitive_clear(pval, it); + break; + + case ASN1_ITYPE_COMPAT: + case ASN1_ITYPE_CHOICE: + case ASN1_ITYPE_SEQUENCE: + case ASN1_ITYPE_NDEF_SEQUENCE: + *pval = NULL; + break; + } +} + +int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); + int ret; + if (tt->flags & ASN1_TFLG_OPTIONAL) { + asn1_template_clear(pval, tt); + return 1; + } + /* If ANY DEFINED BY nothing to do */ + + if (tt->flags & ASN1_TFLG_ADB_MASK) { + *pval = NULL; + return 1; + } +#ifdef CRYPTO_MDEBUG + if (tt->field_name) + CRYPTO_push_info(tt->field_name); +#endif + /* If SET OF or SEQUENCE OF, its a STACK */ + if (tt->flags & ASN1_TFLG_SK_MASK) { + STACK_OF(ASN1_VALUE) *skval; + skval = sk_ASN1_VALUE_new_null(); + if (!skval) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + ret = 0; + goto done; + } + *pval = (ASN1_VALUE *)skval; + ret = 1; + goto done; + } + /* Otherwise pass it back to the item routine */ + ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE); + done: +#ifdef CRYPTO_MDEBUG + if (it->sname) + CRYPTO_pop_info(); +#endif + return ret; +} + +static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) +{ + /* If ADB or STACK just NULL the field */ + if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK)) + *pval = NULL; + else + asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item)); +} + +/* + * NB: could probably combine most of the real XXX_new() behaviour and junk + * all the old functions. + */ + +int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + ASN1_TYPE *typ; + ASN1_STRING *str; + int utype; + + if (!it) + return 0; + + if (it->funcs) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_new) + return pf->prim_new(pval, it); + } + + if (it->itype == ASN1_ITYPE_MSTRING) + utype = -1; + else + utype = it->utype; + switch (utype) { + case V_ASN1_OBJECT: + *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef); + return 1; + + case V_ASN1_BOOLEAN: + *(ASN1_BOOLEAN *)pval = it->size; + return 1; + + case V_ASN1_NULL: + *pval = (ASN1_VALUE *)1; + return 1; + + case V_ASN1_ANY: + typ = OPENSSL_malloc(sizeof(ASN1_TYPE)); + if (!typ) + return 0; + typ->value.ptr = NULL; + typ->type = -1; + *pval = (ASN1_VALUE *)typ; + break; + + default: + str = ASN1_STRING_type_new(utype); + if (it->itype == ASN1_ITYPE_MSTRING && str) + str->flags |= ASN1_STRING_FLAG_MSTRING; + *pval = (ASN1_VALUE *)str; + break; + } + if (*pval) + return 1; + return 0; +} + +static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + int utype; + if (it && it->funcs) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_clear) + pf->prim_clear(pval, it); + else + *pval = NULL; + return; + } + if (!it || (it->itype == ASN1_ITYPE_MSTRING)) + utype = -1; + else + utype = it->utype; + if (utype == V_ASN1_BOOLEAN) + *(ASN1_BOOLEAN *)pval = it->size; + else + *pval = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c new file mode 100644 index 0000000..6817240 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c @@ -0,0 +1,131 @@ +/* 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 + +/* Declarations for string types */ + +#define IMPLEMENT_ASN1_STRING_FUNCTIONS(sname) \ + IMPLEMENT_ASN1_TYPE(sname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(sname, sname, sname) \ + sname *sname##_new(void) \ + { \ + return ASN1_STRING_type_new(V_##sname); \ + } \ + void sname##_free(sname *x) \ + { \ + ASN1_STRING_free(x); \ + } + +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_PRINTABLESTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_T61STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_IA5STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BMPSTRING) + +IMPLEMENT_ASN1_TYPE(ASN1_NULL) +IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL) + +IMPLEMENT_ASN1_TYPE(ASN1_OBJECT) + +IMPLEMENT_ASN1_TYPE(ASN1_ANY) + +/* Just swallow an ASN1_SEQUENCE in an ASN1_STRING */ +IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE) + +IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + +/* Multistring types */ + +IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + +IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + +IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + +/* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ +IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1) +IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1) +IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0) + +/* Special, OCTET STRING with indefinite length constructed support */ + +IMPLEMENT_ASN1_TYPE_ex(ASN1_OCTET_STRING_NDEF, ASN1_OCTET_STRING, ASN1_TFLG_NDEF) + +ASN1_ITEM_TEMPLATE(ASN1_SEQUENCE_ANY) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, ASN1_SEQUENCE_ANY, ASN1_ANY) +ASN1_ITEM_TEMPLATE_END(ASN1_SEQUENCE_ANY) + +ASN1_ITEM_TEMPLATE(ASN1_SET_ANY) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, ASN1_SET_ANY, ASN1_ANY) +ASN1_ITEM_TEMPLATE_END(ASN1_SET_ANY) + +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ASN1_SEQUENCE_ANY, ASN1_SET_ANY, ASN1_SET_ANY) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c.grpc_back new file mode 100644 index 0000000..7c5bfd5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c.grpc_back @@ -0,0 +1,131 @@ +/* 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 + +/* Declarations for string types */ + +#define IMPLEMENT_ASN1_STRING_FUNCTIONS(sname) \ + IMPLEMENT_ASN1_TYPE(sname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(sname, sname, sname) \ + sname *sname##_new(void) \ + { \ + return ASN1_STRING_type_new(V_##sname); \ + } \ + void sname##_free(sname *x) \ + { \ + ASN1_STRING_free(x); \ + } + +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_PRINTABLESTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_T61STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_IA5STRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING) +IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BMPSTRING) + +IMPLEMENT_ASN1_TYPE(ASN1_NULL) +IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL) + +IMPLEMENT_ASN1_TYPE(ASN1_OBJECT) + +IMPLEMENT_ASN1_TYPE(ASN1_ANY) + +/* Just swallow an ASN1_SEQUENCE in an ASN1_STRING */ +IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE) + +IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + +/* Multistring types */ + +IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + +IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + +IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING) +IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + +/* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ +IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1) +IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1) +IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0) + +/* Special, OCTET STRING with indefinite length constructed support */ + +IMPLEMENT_ASN1_TYPE_ex(ASN1_OCTET_STRING_NDEF, ASN1_OCTET_STRING, ASN1_TFLG_NDEF) + +ASN1_ITEM_TEMPLATE(ASN1_SEQUENCE_ANY) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, ASN1_SEQUENCE_ANY, ASN1_ANY) +ASN1_ITEM_TEMPLATE_END(ASN1_SEQUENCE_ANY) + +ASN1_ITEM_TEMPLATE(ASN1_SET_ANY) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, ASN1_SET_ANY, ASN1_ANY) +ASN1_ITEM_TEMPLATE_END(ASN1_SET_ANY) + +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ASN1_SEQUENCE_ANY, ASN1_SET_ANY, ASN1_SET_ANY) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c new file mode 100644 index 0000000..341ed5e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c @@ -0,0 +1,280 @@ +/* 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" + + +/* Utility functions for manipulating fields and offsets */ + +/* Add 'offset' to 'addr' */ +#define offset2ptr(addr, offset) (void *)(((char *)(addr)) + (offset)) + +/* Given an ASN1_ITEM CHOICE type return the selector value */ +int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it) { + int *sel = offset2ptr(*pval, it->utype); + return *sel; +} + +/* Given an ASN1_ITEM CHOICE type set the selector value, return old value. */ +int asn1_set_choice_selector(ASN1_VALUE **pval, int value, + const ASN1_ITEM *it) { + int *sel, ret; + sel = offset2ptr(*pval, it->utype); + ret = *sel; + *sel = value; + return ret; +} + +static CRYPTO_refcount_t *asn1_get_references(ASN1_VALUE **pval, + const ASN1_ITEM *it) { + if (it->itype != ASN1_ITYPE_SEQUENCE && + it->itype != ASN1_ITYPE_NDEF_SEQUENCE) { + return NULL; + } + const ASN1_AUX *aux = it->funcs; + if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) { + return NULL; + } + return offset2ptr(*pval, aux->ref_offset); +} + +void asn1_refcount_set_one(ASN1_VALUE **pval, const ASN1_ITEM *it) { + CRYPTO_refcount_t *references = asn1_get_references(pval, it); + if (references != NULL) { + *references = 1; + } +} + +int asn1_refcount_dec_and_test_zero(ASN1_VALUE **pval, const ASN1_ITEM *it) { + CRYPTO_refcount_t *references = asn1_get_references(pval, it); + if (references != NULL) { + return CRYPTO_refcount_dec_and_test_zero(references); + } + return 1; +} + +static ASN1_ENCODING *asn1_get_enc_ptr(ASN1_VALUE **pval, const ASN1_ITEM *it) { + const ASN1_AUX *aux; + if (!pval || !*pval) { + return NULL; + } + aux = it->funcs; + if (!aux || !(aux->flags & ASN1_AFLG_ENCODING)) { + return NULL; + } + return offset2ptr(*pval, aux->enc_offset); +} + +void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (enc) { + enc->enc = NULL; + enc->len = 0; + enc->alias_only = 0; + enc->alias_only_on_next_parse = 0; + enc->modified = 1; + } +} + +void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (enc) { + if (enc->enc && !enc->alias_only) { + OPENSSL_free(enc->enc); + } + enc->enc = NULL; + enc->len = 0; + enc->alias_only = 0; + enc->alias_only_on_next_parse = 0; + enc->modified = 1; + } +} + +int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, + const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (!enc) { + return 1; + } + + if (!enc->alias_only) { + OPENSSL_free(enc->enc); + } + + enc->alias_only = enc->alias_only_on_next_parse; + enc->alias_only_on_next_parse = 0; + + if (enc->alias_only) { + enc->enc = (uint8_t *) in; + } else { + enc->enc = OPENSSL_malloc(inlen); + if (!enc->enc) { + return 0; + } + OPENSSL_memcpy(enc->enc, in, inlen); + } + + enc->len = inlen; + enc->modified = 0; + + return 1; +} + +int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, + const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (!enc || enc->modified) { + return 0; + } + if (out) { + OPENSSL_memcpy(*out, enc->enc, enc->len); + *out += enc->len; + } + if (len) { + *len = enc->len; + } + return 1; +} + +/* Given an ASN1_TEMPLATE get a pointer to a field */ +ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) { + ASN1_VALUE **pvaltmp; + if (tt->flags & ASN1_TFLG_COMBINE) { + return pval; + } + pvaltmp = offset2ptr(*pval, tt->offset); + /* NOTE for BOOLEAN types the field is just a plain int so we can't return + * int **, so settle for (int *). */ + return pvaltmp; +} + +/* Handle ANY DEFINED BY template, find the selector, look up the relevant + * ASN1_TEMPLATE in the table and return it. */ +const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, + int nullerr) { + const ASN1_ADB *adb; + const ASN1_ADB_TABLE *atbl; + long selector; + ASN1_VALUE **sfld; + int i; + if (!(tt->flags & ASN1_TFLG_ADB_MASK)) { + return tt; + } + + /* Else ANY DEFINED BY ... get the table */ + adb = ASN1_ADB_ptr(tt->item); + + /* Get the selector field */ + sfld = offset2ptr(*pval, adb->offset); + + /* Check if NULL */ + if (*sfld == NULL) { + if (!adb->null_tt) { + goto err; + } + return adb->null_tt; + } + + /* Convert type to a long: + * NB: don't check for NID_undef here because it + * might be a legitimate value in the table */ + if (tt->flags & ASN1_TFLG_ADB_OID) { + selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld); + } else { + selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld); + } + + /* Try to find matching entry in table Maybe should check application types + * first to allow application override? Might also be useful to have a flag + * which indicates table is sorted and we can do a binary search. For now + * stick to a linear search. */ + + for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++) { + if (atbl->value == selector) { + return &atbl->tt; + } + } + + /* FIXME: need to search application table too */ + + /* No match, return default type */ + if (!adb->default_tt) { + goto err; + } + return adb->default_tt; + +err: + /* FIXME: should log the value or OID of unsupported type */ + if (nullerr) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE); + } + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c.grpc_back new file mode 100644 index 0000000..a7516f6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c.grpc_back @@ -0,0 +1,280 @@ +/* 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" + + +/* Utility functions for manipulating fields and offsets */ + +/* Add 'offset' to 'addr' */ +#define offset2ptr(addr, offset) (void *)(((char *)(addr)) + (offset)) + +/* Given an ASN1_ITEM CHOICE type return the selector value */ +int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it) { + int *sel = offset2ptr(*pval, it->utype); + return *sel; +} + +/* Given an ASN1_ITEM CHOICE type set the selector value, return old value. */ +int asn1_set_choice_selector(ASN1_VALUE **pval, int value, + const ASN1_ITEM *it) { + int *sel, ret; + sel = offset2ptr(*pval, it->utype); + ret = *sel; + *sel = value; + return ret; +} + +static CRYPTO_refcount_t *asn1_get_references(ASN1_VALUE **pval, + const ASN1_ITEM *it) { + if (it->itype != ASN1_ITYPE_SEQUENCE && + it->itype != ASN1_ITYPE_NDEF_SEQUENCE) { + return NULL; + } + const ASN1_AUX *aux = it->funcs; + if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) { + return NULL; + } + return offset2ptr(*pval, aux->ref_offset); +} + +void asn1_refcount_set_one(ASN1_VALUE **pval, const ASN1_ITEM *it) { + CRYPTO_refcount_t *references = asn1_get_references(pval, it); + if (references != NULL) { + *references = 1; + } +} + +int asn1_refcount_dec_and_test_zero(ASN1_VALUE **pval, const ASN1_ITEM *it) { + CRYPTO_refcount_t *references = asn1_get_references(pval, it); + if (references != NULL) { + return CRYPTO_refcount_dec_and_test_zero(references); + } + return 1; +} + +static ASN1_ENCODING *asn1_get_enc_ptr(ASN1_VALUE **pval, const ASN1_ITEM *it) { + const ASN1_AUX *aux; + if (!pval || !*pval) { + return NULL; + } + aux = it->funcs; + if (!aux || !(aux->flags & ASN1_AFLG_ENCODING)) { + return NULL; + } + return offset2ptr(*pval, aux->enc_offset); +} + +void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (enc) { + enc->enc = NULL; + enc->len = 0; + enc->alias_only = 0; + enc->alias_only_on_next_parse = 0; + enc->modified = 1; + } +} + +void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (enc) { + if (enc->enc && !enc->alias_only) { + OPENSSL_free(enc->enc); + } + enc->enc = NULL; + enc->len = 0; + enc->alias_only = 0; + enc->alias_only_on_next_parse = 0; + enc->modified = 1; + } +} + +int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, + const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (!enc) { + return 1; + } + + if (!enc->alias_only) { + OPENSSL_free(enc->enc); + } + + enc->alias_only = enc->alias_only_on_next_parse; + enc->alias_only_on_next_parse = 0; + + if (enc->alias_only) { + enc->enc = (uint8_t *) in; + } else { + enc->enc = OPENSSL_malloc(inlen); + if (!enc->enc) { + return 0; + } + OPENSSL_memcpy(enc->enc, in, inlen); + } + + enc->len = inlen; + enc->modified = 0; + + return 1; +} + +int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, + const ASN1_ITEM *it) { + ASN1_ENCODING *enc; + enc = asn1_get_enc_ptr(pval, it); + if (!enc || enc->modified) { + return 0; + } + if (out) { + OPENSSL_memcpy(*out, enc->enc, enc->len); + *out += enc->len; + } + if (len) { + *len = enc->len; + } + return 1; +} + +/* Given an ASN1_TEMPLATE get a pointer to a field */ +ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) { + ASN1_VALUE **pvaltmp; + if (tt->flags & ASN1_TFLG_COMBINE) { + return pval; + } + pvaltmp = offset2ptr(*pval, tt->offset); + /* NOTE for BOOLEAN types the field is just a plain int so we can't return + * int **, so settle for (int *). */ + return pvaltmp; +} + +/* Handle ANY DEFINED BY template, find the selector, look up the relevant + * ASN1_TEMPLATE in the table and return it. */ +const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, + int nullerr) { + const ASN1_ADB *adb; + const ASN1_ADB_TABLE *atbl; + long selector; + ASN1_VALUE **sfld; + int i; + if (!(tt->flags & ASN1_TFLG_ADB_MASK)) { + return tt; + } + + /* Else ANY DEFINED BY ... get the table */ + adb = ASN1_ADB_ptr(tt->item); + + /* Get the selector field */ + sfld = offset2ptr(*pval, adb->offset); + + /* Check if NULL */ + if (*sfld == NULL) { + if (!adb->null_tt) { + goto err; + } + return adb->null_tt; + } + + /* Convert type to a long: + * NB: don't check for NID_undef here because it + * might be a legitimate value in the table */ + if (tt->flags & ASN1_TFLG_ADB_OID) { + selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld); + } else { + selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld); + } + + /* Try to find matching entry in table Maybe should check application types + * first to allow application override? Might also be useful to have a flag + * which indicates table is sorted and we can do a binary search. For now + * stick to a linear search. */ + + for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++) { + if (atbl->value == selector) { + return &atbl->tt; + } + } + + /* FIXME: need to search application table too */ + + /* No match, return default type */ + if (!adb->default_tt) { + goto err; + } + return adb->default_tt; + +err: + /* FIXME: should log the value or OID of unsupported type */ + if (nullerr) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE); + } + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c new file mode 100644 index 0000000..3efd43e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c @@ -0,0 +1,206 @@ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2008. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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). */ + +#if !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 201410L /* for gmtime_r */ +#endif + +#include "asn1_locl.h" + +#include + + +#define SECS_PER_DAY (24 * 60 * 60) + +struct tm *OPENSSL_gmtime(const time_t *time, struct tm *result) { +#if defined(OPENSSL_WINDOWS) + if (gmtime_s(result, time)) { + return NULL; + } + return result; +#else + return gmtime_r(time, result); +#endif +} + +/* Convert date to and from julian day Uses Fliegel & Van Flandern algorithm */ +static long date_to_julian(int y, int m, int d) { + return (1461 * (y + 4800 + (m - 14) / 12)) / 4 + + (367 * (m - 2 - 12 * ((m - 14) / 12))) / 12 - + (3 * ((y + 4900 + (m - 14) / 12) / 100)) / 4 + d - 32075; +} + +static void julian_to_date(long jd, int *y, int *m, int *d) { + long L = jd + 68569; + long n = (4 * L) / 146097; + long i, j; + + L = L - (146097 * n + 3) / 4; + i = (4000 * (L + 1)) / 1461001; + L = L - (1461 * i) / 4 + 31; + j = (80 * L) / 2447; + *d = L - (2447 * j) / 80; + L = j / 11; + *m = j + 2 - (12 * L); + *y = 100 * (n - 49) + i + L; +} + +/* Convert tm structure and offset into julian day and seconds */ +static int julian_adj(const struct tm *tm, int off_day, long offset_sec, + long *pday, int *psec) { + int offset_hms, offset_day; + long time_jd; + int time_year, time_month, time_day; + /* split offset into days and day seconds */ + offset_day = offset_sec / SECS_PER_DAY; + /* Avoid sign issues with % operator */ + offset_hms = offset_sec - (offset_day * SECS_PER_DAY); + offset_day += off_day; + /* Add current time seconds to offset */ + offset_hms += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec; + /* Adjust day seconds if overflow */ + if (offset_hms >= SECS_PER_DAY) { + offset_day++; + offset_hms -= SECS_PER_DAY; + } else if (offset_hms < 0) { + offset_day--; + offset_hms += SECS_PER_DAY; + } + + /* Convert date of time structure into a Julian day number. */ + + time_year = tm->tm_year + 1900; + time_month = tm->tm_mon + 1; + time_day = tm->tm_mday; + + time_jd = date_to_julian(time_year, time_month, time_day); + + /* Work out Julian day of new date */ + time_jd += offset_day; + + if (time_jd < 0) { + return 0; + } + + *pday = time_jd; + *psec = offset_hms; + return 1; +} + +int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec) { + int time_sec, time_year, time_month, time_day; + long time_jd; + + /* Convert time and offset into julian day and seconds */ + if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec)) { + return 0; + } + + /* Convert Julian day back to date */ + + julian_to_date(time_jd, &time_year, &time_month, &time_day); + + if (time_year < 1900 || time_year > 9999) { + return 0; + } + + /* Update tm structure */ + + tm->tm_year = time_year - 1900; + tm->tm_mon = time_month - 1; + tm->tm_mday = time_day; + + tm->tm_hour = time_sec / 3600; + tm->tm_min = (time_sec / 60) % 60; + tm->tm_sec = time_sec % 60; + + return 1; +} + +int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, + const struct tm *to) { + int from_sec, to_sec, diff_sec; + long from_jd, to_jd, diff_day; + + if (!julian_adj(from, 0, 0, &from_jd, &from_sec)) { + return 0; + } + if (!julian_adj(to, 0, 0, &to_jd, &to_sec)) { + return 0; + } + + diff_day = to_jd - from_jd; + diff_sec = to_sec - from_sec; + /* Adjust differences so both positive or both negative */ + if (diff_day > 0 && diff_sec < 0) { + diff_day--; + diff_sec += SECS_PER_DAY; + } + if (diff_day < 0 && diff_sec > 0) { + diff_day++; + diff_sec -= SECS_PER_DAY; + } + + if (out_days) { + *out_days = (int)diff_day; + } + if (out_secs) { + *out_secs = diff_sec; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c.grpc_back new file mode 100644 index 0000000..3efd43e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c.grpc_back @@ -0,0 +1,206 @@ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2008. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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). */ + +#if !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 201410L /* for gmtime_r */ +#endif + +#include "asn1_locl.h" + +#include + + +#define SECS_PER_DAY (24 * 60 * 60) + +struct tm *OPENSSL_gmtime(const time_t *time, struct tm *result) { +#if defined(OPENSSL_WINDOWS) + if (gmtime_s(result, time)) { + return NULL; + } + return result; +#else + return gmtime_r(time, result); +#endif +} + +/* Convert date to and from julian day Uses Fliegel & Van Flandern algorithm */ +static long date_to_julian(int y, int m, int d) { + return (1461 * (y + 4800 + (m - 14) / 12)) / 4 + + (367 * (m - 2 - 12 * ((m - 14) / 12))) / 12 - + (3 * ((y + 4900 + (m - 14) / 12) / 100)) / 4 + d - 32075; +} + +static void julian_to_date(long jd, int *y, int *m, int *d) { + long L = jd + 68569; + long n = (4 * L) / 146097; + long i, j; + + L = L - (146097 * n + 3) / 4; + i = (4000 * (L + 1)) / 1461001; + L = L - (1461 * i) / 4 + 31; + j = (80 * L) / 2447; + *d = L - (2447 * j) / 80; + L = j / 11; + *m = j + 2 - (12 * L); + *y = 100 * (n - 49) + i + L; +} + +/* Convert tm structure and offset into julian day and seconds */ +static int julian_adj(const struct tm *tm, int off_day, long offset_sec, + long *pday, int *psec) { + int offset_hms, offset_day; + long time_jd; + int time_year, time_month, time_day; + /* split offset into days and day seconds */ + offset_day = offset_sec / SECS_PER_DAY; + /* Avoid sign issues with % operator */ + offset_hms = offset_sec - (offset_day * SECS_PER_DAY); + offset_day += off_day; + /* Add current time seconds to offset */ + offset_hms += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec; + /* Adjust day seconds if overflow */ + if (offset_hms >= SECS_PER_DAY) { + offset_day++; + offset_hms -= SECS_PER_DAY; + } else if (offset_hms < 0) { + offset_day--; + offset_hms += SECS_PER_DAY; + } + + /* Convert date of time structure into a Julian day number. */ + + time_year = tm->tm_year + 1900; + time_month = tm->tm_mon + 1; + time_day = tm->tm_mday; + + time_jd = date_to_julian(time_year, time_month, time_day); + + /* Work out Julian day of new date */ + time_jd += offset_day; + + if (time_jd < 0) { + return 0; + } + + *pday = time_jd; + *psec = offset_hms; + return 1; +} + +int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec) { + int time_sec, time_year, time_month, time_day; + long time_jd; + + /* Convert time and offset into julian day and seconds */ + if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec)) { + return 0; + } + + /* Convert Julian day back to date */ + + julian_to_date(time_jd, &time_year, &time_month, &time_day); + + if (time_year < 1900 || time_year > 9999) { + return 0; + } + + /* Update tm structure */ + + tm->tm_year = time_year - 1900; + tm->tm_mon = time_month - 1; + tm->tm_mday = time_day; + + tm->tm_hour = time_sec / 3600; + tm->tm_min = (time_sec / 60) % 60; + tm->tm_sec = time_sec % 60; + + return 1; +} + +int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, + const struct tm *to) { + int from_sec, to_sec, diff_sec; + long from_jd, to_jd, diff_day; + + if (!julian_adj(from, 0, 0, &from_jd, &from_sec)) { + return 0; + } + if (!julian_adj(to, 0, 0, &to_jd, &to_sec)) { + return 0; + } + + diff_day = to_jd - from_jd; + diff_sec = to_sec - from_sec; + /* Adjust differences so both positive or both negative */ + if (diff_day > 0 && diff_sec < 0) { + diff_day--; + diff_sec += SECS_PER_DAY; + } + if (diff_day < 0 && diff_sec > 0) { + diff_day++; + diff_sec -= SECS_PER_DAY; + } + + if (out_days) { + *out_days = (int)diff_day; + } + if (out_secs) { + *out_secs = diff_sec; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c new file mode 100644 index 0000000..16a2382 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c @@ -0,0 +1,466 @@ +/* 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 "../internal.h" + + +// constant_time_lt_args_8 behaves like |constant_time_lt_8| but takes |uint8_t| +// arguments for a slightly simpler implementation. +static inline uint8_t constant_time_lt_args_8(uint8_t a, uint8_t b) { + crypto_word_t aw = a; + crypto_word_t bw = b; + // |crypto_word_t| is larger than |uint8_t|, so |aw| and |bw| have the same + // MSB. |aw| < |bw| iff MSB(|aw| - |bw|) is 1. + return constant_time_msb_w(aw - bw); +} + +// constant_time_in_range_8 returns |CONSTTIME_TRUE_8| if |min| <= |a| <= |max| +// and |CONSTTIME_FALSE_8| otherwise. +static inline uint8_t constant_time_in_range_8(uint8_t a, uint8_t min, + uint8_t max) { + a -= min; + return constant_time_lt_args_8(a, max - min + 1); +} + +// Encoding. + +static uint8_t conv_bin2ascii(uint8_t a) { + // Since PEM is sometimes used to carry private keys, we encode base64 data + // itself in constant-time. + a &= 0x3f; + uint8_t ret = constant_time_select_8(constant_time_eq_8(a, 62), '+', '/'); + ret = + constant_time_select_8(constant_time_lt_args_8(a, 62), a - 52 + '0', ret); + ret = + constant_time_select_8(constant_time_lt_args_8(a, 52), a - 26 + 'a', ret); + ret = constant_time_select_8(constant_time_lt_args_8(a, 26), a + 'A', ret); + return ret; +} + +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) { + return 0; + } + len += 2; + len /= 3; + + if (((len << 2) >> 2) != len) { + return 0; + } + len <<= 2; + + if (len + 1 < len) { + return 0; + } + len++; + + *out_len = len; + return 1; +} + +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_ENCODE_CTX)); +} + +void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, size_t in_len) { + size_t total = 0; + + *out_len = 0; + if (in_len == 0) { + return; + } + + assert(ctx->data_used < sizeof(ctx->data)); + + if (sizeof(ctx->data) - ctx->data_used > in_len) { + OPENSSL_memcpy(&ctx->data[ctx->data_used], in, in_len); + ctx->data_used += (unsigned)in_len; + return; + } + + if (ctx->data_used != 0) { + const size_t todo = sizeof(ctx->data) - ctx->data_used; + OPENSSL_memcpy(&ctx->data[ctx->data_used], in, todo); + in += todo; + in_len -= todo; + + size_t encoded = EVP_EncodeBlock(out, ctx->data, sizeof(ctx->data)); + ctx->data_used = 0; + + out += encoded; + *(out++) = '\n'; + *out = '\0'; + + total = encoded + 1; + } + + while (in_len >= sizeof(ctx->data)) { + size_t encoded = EVP_EncodeBlock(out, in, sizeof(ctx->data)); + in += sizeof(ctx->data); + in_len -= sizeof(ctx->data); + + out += encoded; + *(out++) = '\n'; + *out = '\0'; + + if (total + encoded + 1 < total) { + *out_len = 0; + return; + } + + total += encoded + 1; + } + + if (in_len != 0) { + OPENSSL_memcpy(ctx->data, in, in_len); + } + + ctx->data_used = (unsigned)in_len; + + if (total > INT_MAX) { + // We cannot signal an error, but we can at least avoid making *out_len + // negative. + total = 0; + } + *out_len = (int)total; +} + +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len) { + if (ctx->data_used == 0) { + *out_len = 0; + return; + } + + size_t encoded = EVP_EncodeBlock(out, ctx->data, ctx->data_used); + out[encoded++] = '\n'; + out[encoded] = '\0'; + ctx->data_used = 0; + + // ctx->data_used is bounded by sizeof(ctx->data), so this does not + // overflow. + assert(encoded <= INT_MAX); + *out_len = (int)encoded; +} + +size_t EVP_EncodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len) { + uint32_t l; + size_t remaining = src_len, ret = 0; + + while (remaining) { + if (remaining >= 3) { + l = (((uint32_t)src[0]) << 16L) | (((uint32_t)src[1]) << 8L) | src[2]; + *(dst++) = conv_bin2ascii(l >> 18L); + *(dst++) = conv_bin2ascii(l >> 12L); + *(dst++) = conv_bin2ascii(l >> 6L); + *(dst++) = conv_bin2ascii(l); + remaining -= 3; + } else { + l = ((uint32_t)src[0]) << 16L; + if (remaining == 2) { + l |= ((uint32_t)src[1] << 8L); + } + + *(dst++) = conv_bin2ascii(l >> 18L); + *(dst++) = conv_bin2ascii(l >> 12L); + *(dst++) = (remaining == 1) ? '=' : conv_bin2ascii(l >> 6L); + *(dst++) = '='; + remaining = 0; + } + ret += 4; + src += 3; + } + + *dst = '\0'; + return ret; +} + + +// Decoding. + +int EVP_DecodedLength(size_t *out_len, size_t len) { + if (len % 4 != 0) { + return 0; + } + + *out_len = (len / 4) * 3; + return 1; +} + +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_ENCODE_CTX)); +} + +static uint8_t base64_ascii_to_bin(uint8_t a) { + // Since PEM is sometimes used to carry private keys, we decode base64 data + // itself in constant-time. + const uint8_t is_upper = constant_time_in_range_8(a, 'A', 'Z'); + const uint8_t is_lower = constant_time_in_range_8(a, 'a', 'z'); + const uint8_t is_digit = constant_time_in_range_8(a, '0', '9'); + const uint8_t is_plus = constant_time_eq_8(a, '+'); + const uint8_t is_slash = constant_time_eq_8(a, '/'); + const uint8_t is_equals = constant_time_eq_8(a, '='); + + uint8_t ret = 0xff; // 0xff signals invalid. + ret = constant_time_select_8(is_upper, a - 'A', ret); // [0,26) + ret = constant_time_select_8(is_lower, a - 'a' + 26, ret); // [26,52) + ret = constant_time_select_8(is_digit, a - '0' + 52, ret); // [52,62) + ret = constant_time_select_8(is_plus, 62, ret); + ret = constant_time_select_8(is_slash, 63, ret); + // Padding maps to zero, to be further handled by the caller. + ret = constant_time_select_8(is_equals, 0, ret); + return ret; +} + +// base64_decode_quad decodes a single β€œquad” (i.e. four characters) of base64 +// data and writes up to three bytes to |out|. It sets |*out_num_bytes| to the +// number of bytes written, which will be less than three if the quad ended +// with padding. It returns one on success or zero on error. +static int base64_decode_quad(uint8_t *out, size_t *out_num_bytes, + const uint8_t *in) { + const uint8_t a = base64_ascii_to_bin(in[0]); + const uint8_t b = base64_ascii_to_bin(in[1]); + const uint8_t c = base64_ascii_to_bin(in[2]); + const uint8_t d = base64_ascii_to_bin(in[3]); + if (a == 0xff || b == 0xff || c == 0xff || d == 0xff) { + return 0; + } + + const uint32_t v = ((uint32_t)a) << 18 | ((uint32_t)b) << 12 | + ((uint32_t)c) << 6 | (uint32_t)d; + + const unsigned padding_pattern = (in[0] == '=') << 3 | + (in[1] == '=') << 2 | + (in[2] == '=') << 1 | + (in[3] == '='); + + switch (padding_pattern) { + case 0: + // The common case of no padding. + *out_num_bytes = 3; + out[0] = v >> 16; + out[1] = v >> 8; + out[2] = v; + break; + + case 1: // xxx= + *out_num_bytes = 2; + out[0] = v >> 16; + out[1] = v >> 8; + break; + + case 3: // xx== + *out_num_bytes = 1; + out[0] = v >> 16; + break; + + default: + return 0; + } + + return 1; +} + +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, size_t in_len) { + *out_len = 0; + + if (ctx->error_encountered) { + return -1; + } + + size_t bytes_out = 0, i; + for (i = 0; i < in_len; i++) { + const char c = in[i]; + switch (c) { + case ' ': + case '\t': + case '\r': + case '\n': + continue; + } + + if (ctx->eof_seen) { + ctx->error_encountered = 1; + return -1; + } + + ctx->data[ctx->data_used++] = c; + if (ctx->data_used == 4) { + size_t num_bytes_resulting; + if (!base64_decode_quad(out, &num_bytes_resulting, ctx->data)) { + ctx->error_encountered = 1; + return -1; + } + + ctx->data_used = 0; + bytes_out += num_bytes_resulting; + out += num_bytes_resulting; + + if (num_bytes_resulting < 3) { + ctx->eof_seen = 1; + } + } + } + + if (bytes_out > INT_MAX) { + ctx->error_encountered = 1; + *out_len = 0; + return -1; + } + *out_len = (int)bytes_out; + + if (ctx->eof_seen) { + return 0; + } + + return 1; +} + +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len) { + *out_len = 0; + if (ctx->error_encountered || ctx->data_used != 0) { + return -1; + } + + return 1; +} + +int EVP_DecodeBase64(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 % 4 != 0) { + return 0; + } + + size_t max_len; + if (!EVP_DecodedLength(&max_len, in_len) || + max_out < max_len) { + return 0; + } + + size_t i, bytes_out = 0; + for (i = 0; i < in_len; i += 4) { + size_t num_bytes_resulting; + + if (!base64_decode_quad(out, &num_bytes_resulting, &in[i])) { + return 0; + } + + bytes_out += num_bytes_resulting; + out += num_bytes_resulting; + if (num_bytes_resulting != 3 && i != in_len - 4) { + return 0; + } + } + + *out_len = bytes_out; + return 1; +} + +int EVP_DecodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len) { + // Trim spaces and tabs from the beginning of the input. + while (src_len > 0) { + if (src[0] != ' ' && src[0] != '\t') { + break; + } + + src++; + src_len--; + } + + // Trim newlines, spaces and tabs from the end of the line. + while (src_len > 0) { + switch (src[src_len-1]) { + case ' ': + case '\t': + case '\r': + case '\n': + src_len--; + continue; + } + + break; + } + + size_t dst_len; + if (!EVP_DecodedLength(&dst_len, src_len) || + dst_len > INT_MAX || + !EVP_DecodeBase64(dst, &dst_len, dst_len, src, src_len)) { + return -1; + } + + // EVP_DecodeBlock does not take padding into account, so put the + // NULs back in... so the caller can strip them back out. + while (dst_len % 3 != 0) { + dst[dst_len++] = '\0'; + } + assert(dst_len <= INT_MAX); + + return (int)dst_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back new file mode 100644 index 0000000..349452d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back @@ -0,0 +1,466 @@ +/* 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 "../internal.h" + + +// constant_time_lt_args_8 behaves like |constant_time_lt_8| but takes |uint8_t| +// arguments for a slightly simpler implementation. +static inline uint8_t constant_time_lt_args_8(uint8_t a, uint8_t b) { + crypto_word_t aw = a; + crypto_word_t bw = b; + // |crypto_word_t| is larger than |uint8_t|, so |aw| and |bw| have the same + // MSB. |aw| < |bw| iff MSB(|aw| - |bw|) is 1. + return constant_time_msb_w(aw - bw); +} + +// constant_time_in_range_8 returns |CONSTTIME_TRUE_8| if |min| <= |a| <= |max| +// and |CONSTTIME_FALSE_8| otherwise. +static inline uint8_t constant_time_in_range_8(uint8_t a, uint8_t min, + uint8_t max) { + a -= min; + return constant_time_lt_args_8(a, max - min + 1); +} + +// Encoding. + +static uint8_t conv_bin2ascii(uint8_t a) { + // Since PEM is sometimes used to carry private keys, we encode base64 data + // itself in constant-time. + a &= 0x3f; + uint8_t ret = constant_time_select_8(constant_time_eq_8(a, 62), '+', '/'); + ret = + constant_time_select_8(constant_time_lt_args_8(a, 62), a - 52 + '0', ret); + ret = + constant_time_select_8(constant_time_lt_args_8(a, 52), a - 26 + 'a', ret); + ret = constant_time_select_8(constant_time_lt_args_8(a, 26), a + 'A', ret); + return ret; +} + +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) { + return 0; + } + len += 2; + len /= 3; + + if (((len << 2) >> 2) != len) { + return 0; + } + len <<= 2; + + if (len + 1 < len) { + return 0; + } + len++; + + *out_len = len; + return 1; +} + +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_ENCODE_CTX)); +} + +void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, size_t in_len) { + size_t total = 0; + + *out_len = 0; + if (in_len == 0) { + return; + } + + assert(ctx->data_used < sizeof(ctx->data)); + + if (sizeof(ctx->data) - ctx->data_used > in_len) { + OPENSSL_memcpy(&ctx->data[ctx->data_used], in, in_len); + ctx->data_used += (unsigned)in_len; + return; + } + + if (ctx->data_used != 0) { + const size_t todo = sizeof(ctx->data) - ctx->data_used; + OPENSSL_memcpy(&ctx->data[ctx->data_used], in, todo); + in += todo; + in_len -= todo; + + size_t encoded = EVP_EncodeBlock(out, ctx->data, sizeof(ctx->data)); + ctx->data_used = 0; + + out += encoded; + *(out++) = '\n'; + *out = '\0'; + + total = encoded + 1; + } + + while (in_len >= sizeof(ctx->data)) { + size_t encoded = EVP_EncodeBlock(out, in, sizeof(ctx->data)); + in += sizeof(ctx->data); + in_len -= sizeof(ctx->data); + + out += encoded; + *(out++) = '\n'; + *out = '\0'; + + if (total + encoded + 1 < total) { + *out_len = 0; + return; + } + + total += encoded + 1; + } + + if (in_len != 0) { + OPENSSL_memcpy(ctx->data, in, in_len); + } + + ctx->data_used = (unsigned)in_len; + + if (total > INT_MAX) { + // We cannot signal an error, but we can at least avoid making *out_len + // negative. + total = 0; + } + *out_len = (int)total; +} + +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len) { + if (ctx->data_used == 0) { + *out_len = 0; + return; + } + + size_t encoded = EVP_EncodeBlock(out, ctx->data, ctx->data_used); + out[encoded++] = '\n'; + out[encoded] = '\0'; + ctx->data_used = 0; + + // ctx->data_used is bounded by sizeof(ctx->data), so this does not + // overflow. + assert(encoded <= INT_MAX); + *out_len = (int)encoded; +} + +size_t EVP_EncodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len) { + uint32_t l; + size_t remaining = src_len, ret = 0; + + while (remaining) { + if (remaining >= 3) { + l = (((uint32_t)src[0]) << 16L) | (((uint32_t)src[1]) << 8L) | src[2]; + *(dst++) = conv_bin2ascii(l >> 18L); + *(dst++) = conv_bin2ascii(l >> 12L); + *(dst++) = conv_bin2ascii(l >> 6L); + *(dst++) = conv_bin2ascii(l); + remaining -= 3; + } else { + l = ((uint32_t)src[0]) << 16L; + if (remaining == 2) { + l |= ((uint32_t)src[1] << 8L); + } + + *(dst++) = conv_bin2ascii(l >> 18L); + *(dst++) = conv_bin2ascii(l >> 12L); + *(dst++) = (remaining == 1) ? '=' : conv_bin2ascii(l >> 6L); + *(dst++) = '='; + remaining = 0; + } + ret += 4; + src += 3; + } + + *dst = '\0'; + return ret; +} + + +// Decoding. + +int EVP_DecodedLength(size_t *out_len, size_t len) { + if (len % 4 != 0) { + return 0; + } + + *out_len = (len / 4) * 3; + return 1; +} + +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_ENCODE_CTX)); +} + +static uint8_t base64_ascii_to_bin(uint8_t a) { + // Since PEM is sometimes used to carry private keys, we decode base64 data + // itself in constant-time. + const uint8_t is_upper = constant_time_in_range_8(a, 'A', 'Z'); + const uint8_t is_lower = constant_time_in_range_8(a, 'a', 'z'); + const uint8_t is_digit = constant_time_in_range_8(a, '0', '9'); + const uint8_t is_plus = constant_time_eq_8(a, '+'); + const uint8_t is_slash = constant_time_eq_8(a, '/'); + const uint8_t is_equals = constant_time_eq_8(a, '='); + + uint8_t ret = 0xff; // 0xff signals invalid. + ret = constant_time_select_8(is_upper, a - 'A', ret); // [0,26) + ret = constant_time_select_8(is_lower, a - 'a' + 26, ret); // [26,52) + ret = constant_time_select_8(is_digit, a - '0' + 52, ret); // [52,62) + ret = constant_time_select_8(is_plus, 62, ret); + ret = constant_time_select_8(is_slash, 63, ret); + // Padding maps to zero, to be further handled by the caller. + ret = constant_time_select_8(is_equals, 0, ret); + return ret; +} + +// base64_decode_quad decodes a single β€œquad” (i.e. four characters) of base64 +// data and writes up to three bytes to |out|. It sets |*out_num_bytes| to the +// number of bytes written, which will be less than three if the quad ended +// with padding. It returns one on success or zero on error. +static int base64_decode_quad(uint8_t *out, size_t *out_num_bytes, + const uint8_t *in) { + const uint8_t a = base64_ascii_to_bin(in[0]); + const uint8_t b = base64_ascii_to_bin(in[1]); + const uint8_t c = base64_ascii_to_bin(in[2]); + const uint8_t d = base64_ascii_to_bin(in[3]); + if (a == 0xff || b == 0xff || c == 0xff || d == 0xff) { + return 0; + } + + const uint32_t v = ((uint32_t)a) << 18 | ((uint32_t)b) << 12 | + ((uint32_t)c) << 6 | (uint32_t)d; + + const unsigned padding_pattern = (in[0] == '=') << 3 | + (in[1] == '=') << 2 | + (in[2] == '=') << 1 | + (in[3] == '='); + + switch (padding_pattern) { + case 0: + // The common case of no padding. + *out_num_bytes = 3; + out[0] = v >> 16; + out[1] = v >> 8; + out[2] = v; + break; + + case 1: // xxx= + *out_num_bytes = 2; + out[0] = v >> 16; + out[1] = v >> 8; + break; + + case 3: // xx== + *out_num_bytes = 1; + out[0] = v >> 16; + break; + + default: + return 0; + } + + return 1; +} + +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, size_t in_len) { + *out_len = 0; + + if (ctx->error_encountered) { + return -1; + } + + size_t bytes_out = 0, i; + for (i = 0; i < in_len; i++) { + const char c = in[i]; + switch (c) { + case ' ': + case '\t': + case '\r': + case '\n': + continue; + } + + if (ctx->eof_seen) { + ctx->error_encountered = 1; + return -1; + } + + ctx->data[ctx->data_used++] = c; + if (ctx->data_used == 4) { + size_t num_bytes_resulting; + if (!base64_decode_quad(out, &num_bytes_resulting, ctx->data)) { + ctx->error_encountered = 1; + return -1; + } + + ctx->data_used = 0; + bytes_out += num_bytes_resulting; + out += num_bytes_resulting; + + if (num_bytes_resulting < 3) { + ctx->eof_seen = 1; + } + } + } + + if (bytes_out > INT_MAX) { + ctx->error_encountered = 1; + *out_len = 0; + return -1; + } + *out_len = (int)bytes_out; + + if (ctx->eof_seen) { + return 0; + } + + return 1; +} + +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len) { + *out_len = 0; + if (ctx->error_encountered || ctx->data_used != 0) { + return -1; + } + + return 1; +} + +int EVP_DecodeBase64(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 % 4 != 0) { + return 0; + } + + size_t max_len; + if (!EVP_DecodedLength(&max_len, in_len) || + max_out < max_len) { + return 0; + } + + size_t i, bytes_out = 0; + for (i = 0; i < in_len; i += 4) { + size_t num_bytes_resulting; + + if (!base64_decode_quad(out, &num_bytes_resulting, &in[i])) { + return 0; + } + + bytes_out += num_bytes_resulting; + out += num_bytes_resulting; + if (num_bytes_resulting != 3 && i != in_len - 4) { + return 0; + } + } + + *out_len = bytes_out; + return 1; +} + +int EVP_DecodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len) { + // Trim spaces and tabs from the beginning of the input. + while (src_len > 0) { + if (src[0] != ' ' && src[0] != '\t') { + break; + } + + src++; + src_len--; + } + + // Trim newlines, spaces and tabs from the end of the line. + while (src_len > 0) { + switch (src[src_len-1]) { + case ' ': + case '\t': + case '\r': + case '\n': + src_len--; + continue; + } + + break; + } + + size_t dst_len; + if (!EVP_DecodedLength(&dst_len, src_len) || + dst_len > INT_MAX || + !EVP_DecodeBase64(dst, &dst_len, dst_len, src, src_len)) { + return -1; + } + + // EVP_DecodeBlock does not take padding into account, so put the + // NULs back in... so the caller can strip them back out. + while (dst_len % 3 != 0) { + dst[dst_len++] = '\0'; + } + assert(dst_len <= INT_MAX); + + return (int)dst_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c new file mode 100644 index 0000000..88a5604 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c @@ -0,0 +1,700 @@ +/* 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 "../internal.h" + + +BIO *BIO_new(const BIO_METHOD *method) { + BIO *ret = OPENSSL_malloc(sizeof(BIO)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BIO)); + ret->method = method; + ret->shutdown = 1; + ret->references = 1; + + if (method->create != NULL && !method->create(ret)) { + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +int BIO_free(BIO *bio) { + BIO *next_bio; + + for (; bio != NULL; bio = next_bio) { + if (!CRYPTO_refcount_dec_and_test_zero(&bio->references)) { + return 0; + } + + next_bio = BIO_pop(bio); + + if (bio->method != NULL && bio->method->destroy != NULL) { + bio->method->destroy(bio); + } + + OPENSSL_free(bio); + } + return 1; +} + +int BIO_up_ref(BIO *bio) { + CRYPTO_refcount_inc(&bio->references); + return 1; +} + +void BIO_vfree(BIO *bio) { + BIO_free(bio); +} + +void BIO_free_all(BIO *bio) { + BIO_free(bio); +} + +int BIO_read(BIO *bio, void *buf, int len) { + if (bio == NULL || bio->method == NULL || bio->method->bread == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (len <= 0) { + return 0; + } + int ret = bio->method->bread(bio, buf, len); + if (ret > 0) { + bio->num_read += ret; + } + return ret; +} + +int BIO_gets(BIO *bio, char *buf, int len) { + if (bio == NULL || bio->method == NULL || bio->method->bgets == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (len <= 0) { + return 0; + } + int ret = bio->method->bgets(bio, buf, len); + if (ret > 0) { + bio->num_read += ret; + } + return ret; +} + +int BIO_write(BIO *bio, const void *in, int inl) { + if (bio == NULL || bio->method == NULL || bio->method->bwrite == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (inl <= 0) { + return 0; + } + int ret = bio->method->bwrite(bio, in, inl); + if (ret > 0) { + bio->num_write += ret; + } + 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)); +} + +int BIO_flush(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_FLUSH, 0, NULL); +} + +long BIO_ctrl(BIO *bio, int cmd, long larg, void *parg) { + if (bio == NULL) { + return 0; + } + + if (bio->method == NULL || bio->method->ctrl == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + + return bio->method->ctrl(bio, cmd, larg, parg); +} + +char *BIO_ptr_ctrl(BIO *b, int cmd, long larg) { + char *p = NULL; + + if (BIO_ctrl(b, cmd, larg, (void *)&p) <= 0) { + return NULL; + } + + return p; +} + +long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) { + int i = iarg; + + return BIO_ctrl(b, cmd, larg, (void *)&i); +} + +int BIO_reset(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_RESET, 0, NULL); +} + +int BIO_eof(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_EOF, 0, NULL); +} + +void BIO_set_flags(BIO *bio, int flags) { + bio->flags |= flags; +} + +int BIO_test_flags(const BIO *bio, int flags) { + return bio->flags & flags; +} + +int BIO_should_read(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_READ); +} + +int BIO_should_write(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_WRITE); +} + +int BIO_should_retry(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_SHOULD_RETRY); +} + +int BIO_should_io_special(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_IO_SPECIAL); +} + +int BIO_get_retry_reason(const BIO *bio) { return bio->retry_reason; } + +void BIO_clear_flags(BIO *bio, int flags) { + bio->flags &= ~flags; +} + +void BIO_set_retry_read(BIO *bio) { + bio->flags |= BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY; +} + +void BIO_set_retry_write(BIO *bio) { + bio->flags |= BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY; +} + +static const int kRetryFlags = BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY; + +int BIO_get_retry_flags(BIO *bio) { + return bio->flags & kRetryFlags; +} + +void BIO_clear_retry_flags(BIO *bio) { + bio->flags &= ~kRetryFlags; + bio->retry_reason = 0; +} + +int BIO_method_type(const BIO *bio) { return bio->method->type; } + +void BIO_copy_next_retry(BIO *bio) { + BIO_clear_retry_flags(bio); + BIO_set_flags(bio, BIO_get_retry_flags(bio->next_bio)); + bio->retry_reason = bio->next_bio->retry_reason; +} + +long BIO_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + if (bio == NULL) { + return 0; + } + + if (bio->method == NULL || bio->method->callback_ctrl == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return 0; + } + + return bio->method->callback_ctrl(bio, cmd, fp); +} + +size_t BIO_pending(const BIO *bio) { + const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_PENDING, 0, NULL); + assert(r >= 0); + + if (r < 0) { + return 0; + } + return r; +} + +size_t BIO_ctrl_pending(const BIO *bio) { + return BIO_pending(bio); +} + +size_t BIO_wpending(const BIO *bio) { + const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_WPENDING, 0, NULL); + assert(r >= 0); + + if (r < 0) { + return 0; + } + return r; +} + +int BIO_set_close(BIO *bio, int close_flag) { + return BIO_ctrl(bio, BIO_CTRL_SET_CLOSE, close_flag, NULL); +} + +OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio) { + return bio->num_read; +} + +OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio) { + return bio->num_write; +} + +BIO *BIO_push(BIO *bio, BIO *appended_bio) { + BIO *last_bio; + + if (bio == NULL) { + return bio; + } + + last_bio = bio; + while (last_bio->next_bio != NULL) { + last_bio = last_bio->next_bio; + } + + last_bio->next_bio = appended_bio; + return bio; +} + +BIO *BIO_pop(BIO *bio) { + BIO *ret; + + if (bio == NULL) { + return NULL; + } + ret = bio->next_bio; + bio->next_bio = NULL; + return ret; +} + +BIO *BIO_next(BIO *bio) { + if (!bio) { + return NULL; + } + return bio->next_bio; +} + +BIO *BIO_find_type(BIO *bio, int type) { + int method_type, mask; + + if (!bio) { + return NULL; + } + mask = type & 0xff; + + do { + if (bio->method != NULL) { + method_type = bio->method->type; + + if (!mask) { + if (method_type & type) { + return bio; + } + } else if (method_type == type) { + return bio; + } + } + bio = bio->next_bio; + } while (bio != NULL); + + return NULL; +} + +int BIO_indent(BIO *bio, unsigned indent, unsigned max_indent) { + if (indent > max_indent) { + indent = max_indent; + } + + while (indent--) { + if (BIO_puts(bio, " ") != 1) { + return 0; + } + } + return 1; +} + +static int print_bio(const char *str, size_t len, void *bio) { + return BIO_write((BIO *)bio, str, len); +} + +void ERR_print_errors(BIO *bio) { + ERR_print_errors_cb(print_bio, bio); +} + +// bio_read_all reads everything from |bio| and prepends |prefix| to it. On +// success, |*out| is set to an allocated buffer (which should be freed with +// |OPENSSL_free|), |*out_len| is set to its length and one is returned. The +// buffer will contain |prefix| followed by the contents of |bio|. On failure, +// zero is returned. +// +// The function will fail if the size of the output would equal or exceed +// |max_len|. +static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len, + const uint8_t *prefix, size_t prefix_len, + size_t max_len) { + static const size_t kChunkSize = 4096; + + size_t len = prefix_len + kChunkSize; + if (len > max_len) { + len = max_len; + } + if (len < prefix_len) { + return 0; + } + *out = OPENSSL_malloc(len); + if (*out == NULL) { + return 0; + } + OPENSSL_memcpy(*out, prefix, prefix_len); + size_t done = prefix_len; + + for (;;) { + if (done == len) { + OPENSSL_free(*out); + return 0; + } + const size_t todo = len - done; + assert(todo < INT_MAX); + const int n = BIO_read(bio, *out + done, todo); + if (n == 0) { + *out_len = done; + return 1; + } else if (n == -1) { + OPENSSL_free(*out); + return 0; + } + + done += n; + if (len < max_len && len - done < kChunkSize / 2) { + len += kChunkSize; + if (len < kChunkSize || len > max_len) { + len = max_len; + } + uint8_t *new_buf = OPENSSL_realloc(*out, len); + if (new_buf == NULL) { + OPENSSL_free(*out); + return 0; + } + *out = new_buf; + } + } +} + +// 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; + 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; + } + + const uint8_t tag = header[0]; + const uint8_t length_byte = header[1]; + + if ((tag & 0x1f) == 0x1f) { + // Long form tags are not supported. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); + return 0; + } + + size_t len, header_len; + if ((length_byte & 0x80) == 0) { + // Short form length. + len = length_byte; + header_len = kInitialHeaderLen; + } else { + const size_t num_bytes = length_byte & 0x7f; + + if ((tag & 0x20 /* constructed */) != 0 && num_bytes == 0) { + // indefinite length. + 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_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; + 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; + } + + len = len32; + } + + 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; + *out_len = 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_full(bio, (*out) + header_len, NULL, len - header_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + OPENSSL_free(*out); + return 0; + } + + return 1; +} + +void BIO_set_retry_special(BIO *bio) { + bio->flags |= BIO_FLAGS_READ | BIO_FLAGS_IO_SPECIAL; +} + +int BIO_set_write_buffer_size(BIO *bio, int buffer_size) { return 0; } + +static struct CRYPTO_STATIC_MUTEX g_index_lock = CRYPTO_STATIC_MUTEX_INIT; +static int g_index = BIO_TYPE_START; + +int BIO_get_new_index(void) { + CRYPTO_STATIC_MUTEX_lock_write(&g_index_lock); + // If |g_index| exceeds 255, it will collide with the flags bits. + int ret = g_index > 255 ? -1 : g_index++; + CRYPTO_STATIC_MUTEX_unlock_write(&g_index_lock); + return ret; +} + +BIO_METHOD *BIO_meth_new(int type, const char *name) { + BIO_METHOD *method = OPENSSL_malloc(sizeof(BIO_METHOD)); + if (method == NULL) { + return NULL; + } + OPENSSL_memset(method, 0, sizeof(BIO_METHOD)); + method->type = type; + method->name = name; + return method; +} + +void BIO_meth_free(BIO_METHOD *method) { + OPENSSL_free(method); +} + +int BIO_meth_set_create(BIO_METHOD *method, + int (*create)(BIO *)) { + method->create = create; + return 1; +} + +int BIO_meth_set_destroy(BIO_METHOD *method, + int (*destroy)(BIO *)) { + method->destroy = destroy; + return 1; +} + +int BIO_meth_set_write(BIO_METHOD *method, + int (*write)(BIO *, const char *, int)) { + method->bwrite = write; + return 1; +} + +int BIO_meth_set_read(BIO_METHOD *method, + int (*read)(BIO *, char *, int)) { + method->bread = read; + return 1; +} + +int BIO_meth_set_gets(BIO_METHOD *method, + int (*gets)(BIO *, char *, int)) { + method->bgets = gets; + return 1; +} + +int BIO_meth_set_ctrl(BIO_METHOD *method, + long (*ctrl)(BIO *, int, long, void *)) { + method->ctrl = ctrl; + return 1; +} + +void BIO_set_data(BIO *bio, void *ptr) { bio->ptr = ptr; } + +void *BIO_get_data(BIO *bio) { return bio->ptr; } + +void BIO_set_init(BIO *bio, int init) { bio->init = init; } + +int BIO_get_init(BIO *bio) { return bio->init; } + +void BIO_set_shutdown(BIO *bio, int shutdown) { bio->shutdown = shutdown; } + +int BIO_get_shutdown(BIO *bio) { return bio->shutdown; } + +int BIO_meth_set_puts(BIO_METHOD *method, int (*puts)(BIO *, const char *)) { + // Ignore the parameter. We implement |BIO_puts| using |BIO_write|. + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back new file mode 100644 index 0000000..7d97c3e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back @@ -0,0 +1,700 @@ +/* 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 "../internal.h" + + +BIO *BIO_new(const BIO_METHOD *method) { + BIO *ret = OPENSSL_malloc(sizeof(BIO)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BIO)); + ret->method = method; + ret->shutdown = 1; + ret->references = 1; + + if (method->create != NULL && !method->create(ret)) { + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +int BIO_free(BIO *bio) { + BIO *next_bio; + + for (; bio != NULL; bio = next_bio) { + if (!CRYPTO_refcount_dec_and_test_zero(&bio->references)) { + return 0; + } + + next_bio = BIO_pop(bio); + + if (bio->method != NULL && bio->method->destroy != NULL) { + bio->method->destroy(bio); + } + + OPENSSL_free(bio); + } + return 1; +} + +int BIO_up_ref(BIO *bio) { + CRYPTO_refcount_inc(&bio->references); + return 1; +} + +void BIO_vfree(BIO *bio) { + BIO_free(bio); +} + +void BIO_free_all(BIO *bio) { + BIO_free(bio); +} + +int BIO_read(BIO *bio, void *buf, int len) { + if (bio == NULL || bio->method == NULL || bio->method->bread == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (len <= 0) { + return 0; + } + int ret = bio->method->bread(bio, buf, len); + if (ret > 0) { + bio->num_read += ret; + } + return ret; +} + +int BIO_gets(BIO *bio, char *buf, int len) { + if (bio == NULL || bio->method == NULL || bio->method->bgets == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (len <= 0) { + return 0; + } + int ret = bio->method->bgets(bio, buf, len); + if (ret > 0) { + bio->num_read += ret; + } + return ret; +} + +int BIO_write(BIO *bio, const void *in, int inl) { + if (bio == NULL || bio->method == NULL || bio->method->bwrite == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + if (!bio->init) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED); + return -2; + } + if (inl <= 0) { + return 0; + } + int ret = bio->method->bwrite(bio, in, inl); + if (ret > 0) { + bio->num_write += ret; + } + 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)); +} + +int BIO_flush(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_FLUSH, 0, NULL); +} + +long BIO_ctrl(BIO *bio, int cmd, long larg, void *parg) { + if (bio == NULL) { + return 0; + } + + if (bio->method == NULL || bio->method->ctrl == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return -2; + } + + return bio->method->ctrl(bio, cmd, larg, parg); +} + +char *BIO_ptr_ctrl(BIO *b, int cmd, long larg) { + char *p = NULL; + + if (BIO_ctrl(b, cmd, larg, (void *)&p) <= 0) { + return NULL; + } + + return p; +} + +long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) { + int i = iarg; + + return BIO_ctrl(b, cmd, larg, (void *)&i); +} + +int BIO_reset(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_RESET, 0, NULL); +} + +int BIO_eof(BIO *bio) { + return BIO_ctrl(bio, BIO_CTRL_EOF, 0, NULL); +} + +void BIO_set_flags(BIO *bio, int flags) { + bio->flags |= flags; +} + +int BIO_test_flags(const BIO *bio, int flags) { + return bio->flags & flags; +} + +int BIO_should_read(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_READ); +} + +int BIO_should_write(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_WRITE); +} + +int BIO_should_retry(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_SHOULD_RETRY); +} + +int BIO_should_io_special(const BIO *bio) { + return BIO_test_flags(bio, BIO_FLAGS_IO_SPECIAL); +} + +int BIO_get_retry_reason(const BIO *bio) { return bio->retry_reason; } + +void BIO_clear_flags(BIO *bio, int flags) { + bio->flags &= ~flags; +} + +void BIO_set_retry_read(BIO *bio) { + bio->flags |= BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY; +} + +void BIO_set_retry_write(BIO *bio) { + bio->flags |= BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY; +} + +static const int kRetryFlags = BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY; + +int BIO_get_retry_flags(BIO *bio) { + return bio->flags & kRetryFlags; +} + +void BIO_clear_retry_flags(BIO *bio) { + bio->flags &= ~kRetryFlags; + bio->retry_reason = 0; +} + +int BIO_method_type(const BIO *bio) { return bio->method->type; } + +void BIO_copy_next_retry(BIO *bio) { + BIO_clear_retry_flags(bio); + BIO_set_flags(bio, BIO_get_retry_flags(bio->next_bio)); + bio->retry_reason = bio->next_bio->retry_reason; +} + +long BIO_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + if (bio == NULL) { + return 0; + } + + if (bio->method == NULL || bio->method->callback_ctrl == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD); + return 0; + } + + return bio->method->callback_ctrl(bio, cmd, fp); +} + +size_t BIO_pending(const BIO *bio) { + const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_PENDING, 0, NULL); + assert(r >= 0); + + if (r < 0) { + return 0; + } + return r; +} + +size_t BIO_ctrl_pending(const BIO *bio) { + return BIO_pending(bio); +} + +size_t BIO_wpending(const BIO *bio) { + const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_WPENDING, 0, NULL); + assert(r >= 0); + + if (r < 0) { + return 0; + } + return r; +} + +int BIO_set_close(BIO *bio, int close_flag) { + return BIO_ctrl(bio, BIO_CTRL_SET_CLOSE, close_flag, NULL); +} + +OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio) { + return bio->num_read; +} + +OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio) { + return bio->num_write; +} + +BIO *BIO_push(BIO *bio, BIO *appended_bio) { + BIO *last_bio; + + if (bio == NULL) { + return bio; + } + + last_bio = bio; + while (last_bio->next_bio != NULL) { + last_bio = last_bio->next_bio; + } + + last_bio->next_bio = appended_bio; + return bio; +} + +BIO *BIO_pop(BIO *bio) { + BIO *ret; + + if (bio == NULL) { + return NULL; + } + ret = bio->next_bio; + bio->next_bio = NULL; + return ret; +} + +BIO *BIO_next(BIO *bio) { + if (!bio) { + return NULL; + } + return bio->next_bio; +} + +BIO *BIO_find_type(BIO *bio, int type) { + int method_type, mask; + + if (!bio) { + return NULL; + } + mask = type & 0xff; + + do { + if (bio->method != NULL) { + method_type = bio->method->type; + + if (!mask) { + if (method_type & type) { + return bio; + } + } else if (method_type == type) { + return bio; + } + } + bio = bio->next_bio; + } while (bio != NULL); + + return NULL; +} + +int BIO_indent(BIO *bio, unsigned indent, unsigned max_indent) { + if (indent > max_indent) { + indent = max_indent; + } + + while (indent--) { + if (BIO_puts(bio, " ") != 1) { + return 0; + } + } + return 1; +} + +static int print_bio(const char *str, size_t len, void *bio) { + return BIO_write((BIO *)bio, str, len); +} + +void ERR_print_errors(BIO *bio) { + ERR_print_errors_cb(print_bio, bio); +} + +// bio_read_all reads everything from |bio| and prepends |prefix| to it. On +// success, |*out| is set to an allocated buffer (which should be freed with +// |OPENSSL_free|), |*out_len| is set to its length and one is returned. The +// buffer will contain |prefix| followed by the contents of |bio|. On failure, +// zero is returned. +// +// The function will fail if the size of the output would equal or exceed +// |max_len|. +static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len, + const uint8_t *prefix, size_t prefix_len, + size_t max_len) { + static const size_t kChunkSize = 4096; + + size_t len = prefix_len + kChunkSize; + if (len > max_len) { + len = max_len; + } + if (len < prefix_len) { + return 0; + } + *out = OPENSSL_malloc(len); + if (*out == NULL) { + return 0; + } + OPENSSL_memcpy(*out, prefix, prefix_len); + size_t done = prefix_len; + + for (;;) { + if (done == len) { + OPENSSL_free(*out); + return 0; + } + const size_t todo = len - done; + assert(todo < INT_MAX); + const int n = BIO_read(bio, *out + done, todo); + if (n == 0) { + *out_len = done; + return 1; + } else if (n == -1) { + OPENSSL_free(*out); + return 0; + } + + done += n; + if (len < max_len && len - done < kChunkSize / 2) { + len += kChunkSize; + if (len < kChunkSize || len > max_len) { + len = max_len; + } + uint8_t *new_buf = OPENSSL_realloc(*out, len); + if (new_buf == NULL) { + OPENSSL_free(*out); + return 0; + } + *out = new_buf; + } + } +} + +// 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; + 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; + } + + const uint8_t tag = header[0]; + const uint8_t length_byte = header[1]; + + if ((tag & 0x1f) == 0x1f) { + // Long form tags are not supported. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); + return 0; + } + + size_t len, header_len; + if ((length_byte & 0x80) == 0) { + // Short form length. + len = length_byte; + header_len = kInitialHeaderLen; + } else { + const size_t num_bytes = length_byte & 0x7f; + + if ((tag & 0x20 /* constructed */) != 0 && num_bytes == 0) { + // indefinite length. + 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_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; + 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; + } + + len = len32; + } + + 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; + *out_len = 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_full(bio, (*out) + header_len, NULL, len - header_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + OPENSSL_free(*out); + return 0; + } + + return 1; +} + +void BIO_set_retry_special(BIO *bio) { + bio->flags |= BIO_FLAGS_READ | BIO_FLAGS_IO_SPECIAL; +} + +int BIO_set_write_buffer_size(BIO *bio, int buffer_size) { return 0; } + +static struct CRYPTO_STATIC_MUTEX g_index_lock = CRYPTO_STATIC_MUTEX_INIT; +static int g_index = BIO_TYPE_START; + +int BIO_get_new_index(void) { + CRYPTO_STATIC_MUTEX_lock_write(&g_index_lock); + // If |g_index| exceeds 255, it will collide with the flags bits. + int ret = g_index > 255 ? -1 : g_index++; + CRYPTO_STATIC_MUTEX_unlock_write(&g_index_lock); + return ret; +} + +BIO_METHOD *BIO_meth_new(int type, const char *name) { + BIO_METHOD *method = OPENSSL_malloc(sizeof(BIO_METHOD)); + if (method == NULL) { + return NULL; + } + OPENSSL_memset(method, 0, sizeof(BIO_METHOD)); + method->type = type; + method->name = name; + return method; +} + +void BIO_meth_free(BIO_METHOD *method) { + OPENSSL_free(method); +} + +int BIO_meth_set_create(BIO_METHOD *method, + int (*create)(BIO *)) { + method->create = create; + return 1; +} + +int BIO_meth_set_destroy(BIO_METHOD *method, + int (*destroy)(BIO *)) { + method->destroy = destroy; + return 1; +} + +int BIO_meth_set_write(BIO_METHOD *method, + int (*write)(BIO *, const char *, int)) { + method->bwrite = write; + return 1; +} + +int BIO_meth_set_read(BIO_METHOD *method, + int (*read)(BIO *, char *, int)) { + method->bread = read; + return 1; +} + +int BIO_meth_set_gets(BIO_METHOD *method, + int (*gets)(BIO *, char *, int)) { + method->bgets = gets; + return 1; +} + +int BIO_meth_set_ctrl(BIO_METHOD *method, + long (*ctrl)(BIO *, int, long, void *)) { + method->ctrl = ctrl; + return 1; +} + +void BIO_set_data(BIO *bio, void *ptr) { bio->ptr = ptr; } + +void *BIO_get_data(BIO *bio) { return bio->ptr; } + +void BIO_set_init(BIO *bio, int init) { bio->init = init; } + +int BIO_get_init(BIO *bio) { return bio->init; } + +void BIO_set_shutdown(BIO *bio, int shutdown) { bio->shutdown = shutdown; } + +int BIO_get_shutdown(BIO *bio) { return bio->shutdown; } + +int BIO_meth_set_puts(BIO_METHOD *method, int (*puts)(BIO *, const char *)) { + // Ignore the parameter. We implement |BIO_puts| using |BIO_write|. + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c new file mode 100644 index 0000000..f30fb47 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c @@ -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.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "../internal.h" + + +BIO *BIO_new_mem_buf(const void *buf, int len) { + BIO *ret; + BUF_MEM *b; + const size_t size = len < 0 ? strlen((char *)buf) : (size_t)len; + + if (!buf && len != 0) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NULL_PARAMETER); + return NULL; + } + + ret = BIO_new(BIO_s_mem()); + if (ret == NULL) { + return NULL; + } + + b = (BUF_MEM *)ret->ptr; + // BIO_FLAGS_MEM_RDONLY ensures |b->data| is not written to. + b->data = (void *)buf; + b->length = size; + b->max = size; + + ret->flags |= BIO_FLAGS_MEM_RDONLY; + + // |num| is used to store the value that this BIO will return when it runs + // out of data. If it's negative then the retry flags will also be set. Since + // this is static data, retrying wont help + ret->num = 0; + + return ret; +} + +static int mem_new(BIO *bio) { + BUF_MEM *b; + + b = BUF_MEM_new(); + if (b == NULL) { + return 0; + } + + // |shutdown| is used to store the close flag: whether the BIO has ownership + // of the BUF_MEM. + bio->shutdown = 1; + bio->init = 1; + bio->num = -1; + bio->ptr = (char *)b; + + return 1; +} + +static int mem_free(BIO *bio) { + BUF_MEM *b; + + if (bio == NULL) { + return 0; + } + + if (!bio->shutdown || !bio->init || bio->ptr == NULL) { + return 1; + } + + b = (BUF_MEM *)bio->ptr; + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data = NULL; + } + BUF_MEM_free(b); + bio->ptr = NULL; + return 1; +} + +static int mem_read(BIO *bio, char *out, int outl) { + int ret; + BUF_MEM *b = (BUF_MEM*) bio->ptr; + + BIO_clear_retry_flags(bio); + ret = outl; + if (b->length < INT_MAX && ret > (int)b->length) { + ret = b->length; + } + + if (ret > 0) { + OPENSSL_memcpy(out, b->data, ret); + b->length -= ret; + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data += ret; + } else { + OPENSSL_memmove(b->data, &b->data[ret], b->length); + } + } else if (b->length == 0) { + ret = bio->num; + if (ret != 0) { + BIO_set_retry_read(bio); + } + } + return ret; +} + +static int mem_write(BIO *bio, const char *in, int inl) { + int ret = -1; + int blen; + BUF_MEM *b; + + b = (BUF_MEM *)bio->ptr; + + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + OPENSSL_PUT_ERROR(BIO, BIO_R_WRITE_TO_READ_ONLY_BIO); + goto err; + } + + BIO_clear_retry_flags(bio); + blen = b->length; + if (INT_MAX - blen < inl) { + goto err; + } + if (BUF_MEM_grow_clean(b, blen + inl) != ((size_t) blen) + inl) { + goto err; + } + OPENSSL_memcpy(&b->data[blen], in, inl); + ret = inl; + +err: + return ret; +} + +static int mem_gets(BIO *bio, char *buf, int size) { + int i, j; + char *p; + BUF_MEM *b = (BUF_MEM *)bio->ptr; + + BIO_clear_retry_flags(bio); + j = b->length; + if (size - 1 < j) { + j = size - 1; + } + if (j <= 0) { + if (size > 0) { + *buf = 0; + } + return 0; + } + + p = b->data; + for (i = 0; i < j; i++) { + if (p[i] == '\n') { + i++; + break; + } + } + + // i is now the max num of bytes to copy, either j or up to and including the + // first newline + + i = mem_read(bio, buf, i); + if (i > 0) { + buf[i] = '\0'; + } + return i; +} + +static long mem_ctrl(BIO *bio, int cmd, long num, void *ptr) { + long ret = 1; + char **pptr; + + BUF_MEM *b = (BUF_MEM *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_RESET: + if (b->data != NULL) { + // For read only case reset to the start again + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data -= b->max - b->length; + b->length = b->max; + } else { + OPENSSL_memset(b->data, 0, b->max); + b->length = 0; + } + } + break; + case BIO_CTRL_EOF: + ret = (long)(b->length == 0); + break; + case BIO_C_SET_BUF_MEM_EOF_RETURN: + bio->num = (int)num; + break; + case BIO_CTRL_INFO: + ret = (long)b->length; + if (ptr != NULL) { + pptr = (char **)ptr; + *pptr = (char *)&b->data[0]; + } + break; + case BIO_C_SET_BUF_MEM: + mem_free(bio); + bio->shutdown = (int)num; + bio->ptr = ptr; + break; + case BIO_C_GET_BUF_MEM_PTR: + if (ptr != NULL) { + pptr = (char **)ptr; + *pptr = (char *)b; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = (long)bio->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + break; + + case BIO_CTRL_WPENDING: + ret = 0L; + break; + case BIO_CTRL_PENDING: + ret = (long)b->length; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + return ret; +} + +static const BIO_METHOD mem_method = { + BIO_TYPE_MEM, "memory buffer", + mem_write, mem_read, + NULL /* puts */, mem_gets, + mem_ctrl, mem_new, + mem_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_mem(void) { return &mem_method; } + +int BIO_mem_contents(const BIO *bio, const uint8_t **out_contents, + size_t *out_len) { + const BUF_MEM *b; + if (bio->method != &mem_method) { + return 0; + } + + b = (BUF_MEM *)bio->ptr; + *out_contents = (uint8_t *)b->data; + *out_len = b->length; + return 1; +} + +long BIO_get_mem_data(BIO *bio, char **contents) { + return BIO_ctrl(bio, BIO_CTRL_INFO, 0, (char *) contents); +} + +int BIO_get_mem_ptr(BIO *bio, BUF_MEM **out) { + return BIO_ctrl(bio, BIO_C_GET_BUF_MEM_PTR, 0, (char *) out); +} + +int BIO_set_mem_buf(BIO *bio, BUF_MEM *b, int take_ownership) { + return BIO_ctrl(bio, BIO_C_SET_BUF_MEM, take_ownership, (char *) b); +} + +int BIO_set_mem_eof_return(BIO *bio, int eof_value) { + return BIO_ctrl(bio, BIO_C_SET_BUF_MEM_EOF_RETURN, eof_value, NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c.grpc_back new file mode 100644 index 0000000..08dd6e9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c.grpc_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.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "../internal.h" + + +BIO *BIO_new_mem_buf(const void *buf, int len) { + BIO *ret; + BUF_MEM *b; + const size_t size = len < 0 ? strlen((char *)buf) : (size_t)len; + + if (!buf && len != 0) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NULL_PARAMETER); + return NULL; + } + + ret = BIO_new(BIO_s_mem()); + if (ret == NULL) { + return NULL; + } + + b = (BUF_MEM *)ret->ptr; + // BIO_FLAGS_MEM_RDONLY ensures |b->data| is not written to. + b->data = (void *)buf; + b->length = size; + b->max = size; + + ret->flags |= BIO_FLAGS_MEM_RDONLY; + + // |num| is used to store the value that this BIO will return when it runs + // out of data. If it's negative then the retry flags will also be set. Since + // this is static data, retrying wont help + ret->num = 0; + + return ret; +} + +static int mem_new(BIO *bio) { + BUF_MEM *b; + + b = BUF_MEM_new(); + if (b == NULL) { + return 0; + } + + // |shutdown| is used to store the close flag: whether the BIO has ownership + // of the BUF_MEM. + bio->shutdown = 1; + bio->init = 1; + bio->num = -1; + bio->ptr = (char *)b; + + return 1; +} + +static int mem_free(BIO *bio) { + BUF_MEM *b; + + if (bio == NULL) { + return 0; + } + + if (!bio->shutdown || !bio->init || bio->ptr == NULL) { + return 1; + } + + b = (BUF_MEM *)bio->ptr; + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data = NULL; + } + BUF_MEM_free(b); + bio->ptr = NULL; + return 1; +} + +static int mem_read(BIO *bio, char *out, int outl) { + int ret; + BUF_MEM *b = (BUF_MEM*) bio->ptr; + + BIO_clear_retry_flags(bio); + ret = outl; + if (b->length < INT_MAX && ret > (int)b->length) { + ret = b->length; + } + + if (ret > 0) { + OPENSSL_memcpy(out, b->data, ret); + b->length -= ret; + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data += ret; + } else { + OPENSSL_memmove(b->data, &b->data[ret], b->length); + } + } else if (b->length == 0) { + ret = bio->num; + if (ret != 0) { + BIO_set_retry_read(bio); + } + } + return ret; +} + +static int mem_write(BIO *bio, const char *in, int inl) { + int ret = -1; + int blen; + BUF_MEM *b; + + b = (BUF_MEM *)bio->ptr; + + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + OPENSSL_PUT_ERROR(BIO, BIO_R_WRITE_TO_READ_ONLY_BIO); + goto err; + } + + BIO_clear_retry_flags(bio); + blen = b->length; + if (INT_MAX - blen < inl) { + goto err; + } + if (BUF_MEM_grow_clean(b, blen + inl) != ((size_t) blen) + inl) { + goto err; + } + OPENSSL_memcpy(&b->data[blen], in, inl); + ret = inl; + +err: + return ret; +} + +static int mem_gets(BIO *bio, char *buf, int size) { + int i, j; + char *p; + BUF_MEM *b = (BUF_MEM *)bio->ptr; + + BIO_clear_retry_flags(bio); + j = b->length; + if (size - 1 < j) { + j = size - 1; + } + if (j <= 0) { + if (size > 0) { + *buf = 0; + } + return 0; + } + + p = b->data; + for (i = 0; i < j; i++) { + if (p[i] == '\n') { + i++; + break; + } + } + + // i is now the max num of bytes to copy, either j or up to and including the + // first newline + + i = mem_read(bio, buf, i); + if (i > 0) { + buf[i] = '\0'; + } + return i; +} + +static long mem_ctrl(BIO *bio, int cmd, long num, void *ptr) { + long ret = 1; + char **pptr; + + BUF_MEM *b = (BUF_MEM *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_RESET: + if (b->data != NULL) { + // For read only case reset to the start again + if (bio->flags & BIO_FLAGS_MEM_RDONLY) { + b->data -= b->max - b->length; + b->length = b->max; + } else { + OPENSSL_memset(b->data, 0, b->max); + b->length = 0; + } + } + break; + case BIO_CTRL_EOF: + ret = (long)(b->length == 0); + break; + case BIO_C_SET_BUF_MEM_EOF_RETURN: + bio->num = (int)num; + break; + case BIO_CTRL_INFO: + ret = (long)b->length; + if (ptr != NULL) { + pptr = (char **)ptr; + *pptr = (char *)&b->data[0]; + } + break; + case BIO_C_SET_BUF_MEM: + mem_free(bio); + bio->shutdown = (int)num; + bio->ptr = ptr; + break; + case BIO_C_GET_BUF_MEM_PTR: + if (ptr != NULL) { + pptr = (char **)ptr; + *pptr = (char *)b; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = (long)bio->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + break; + + case BIO_CTRL_WPENDING: + ret = 0L; + break; + case BIO_CTRL_PENDING: + ret = (long)b->length; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + return ret; +} + +static const BIO_METHOD mem_method = { + BIO_TYPE_MEM, "memory buffer", + mem_write, mem_read, + NULL /* puts */, mem_gets, + mem_ctrl, mem_new, + mem_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_mem(void) { return &mem_method; } + +int BIO_mem_contents(const BIO *bio, const uint8_t **out_contents, + size_t *out_len) { + const BUF_MEM *b; + if (bio->method != &mem_method) { + return 0; + } + + b = (BUF_MEM *)bio->ptr; + *out_contents = (uint8_t *)b->data; + *out_len = b->length; + return 1; +} + +long BIO_get_mem_data(BIO *bio, char **contents) { + return BIO_ctrl(bio, BIO_CTRL_INFO, 0, (char *) contents); +} + +int BIO_get_mem_ptr(BIO *bio, BUF_MEM **out) { + return BIO_ctrl(bio, BIO_C_GET_BUF_MEM_PTR, 0, (char *) out); +} + +int BIO_set_mem_buf(BIO *bio, BUF_MEM *b, int take_ownership) { + return BIO_ctrl(bio, BIO_C_SET_BUF_MEM, take_ownership, (char *) b); +} + +int BIO_set_mem_eof_return(BIO *bio, int eof_value) { + return BIO_ctrl(bio, BIO_C_SET_BUF_MEM_EOF_RETURN, eof_value, NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c new file mode 100644 index 0000000..409f4ac --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c @@ -0,0 +1,545 @@ +/* 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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#include +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "internal.h" +#include "../internal.h" + + +enum { + BIO_CONN_S_BEFORE, + BIO_CONN_S_BLOCKED_CONNECT, + BIO_CONN_S_OK, +}; + +typedef struct bio_connect_st { + int state; + + char *param_hostname; + char *param_port; + int nbio; + + unsigned short port; + + struct sockaddr_storage them; + socklen_t them_length; + + // the file descriptor is kept in bio->num in order to match the socket + // BIO. + + // info_callback is called when the connection is initially made + // callback(BIO,state,ret); The callback should return 'ret', state is for + // compatibility with the SSL info_callback. + int (*info_callback)(const BIO *bio, int state, int ret); +} BIO_CONNECT; + +#if !defined(OPENSSL_WINDOWS) +static int closesocket(int sock) { + return close(sock); +} +#endif + +// split_host_and_port sets |*out_host| and |*out_port| to the host and port +// parsed from |name|. It returns one on success or zero on error. Even when +// successful, |*out_port| may be NULL on return if no port was specified. +static int split_host_and_port(char **out_host, char **out_port, const char *name) { + const char *host, *port = NULL; + size_t host_len = 0; + + *out_host = NULL; + *out_port = NULL; + + if (name[0] == '[') { // bracketed IPv6 address + const char *close = strchr(name, ']'); + if (close == NULL) { + return 0; + } + host = name + 1; + host_len = close - host; + if (close[1] == ':') { // [IP]:port + port = close + 2; + } else if (close[1] != 0) { + return 0; + } + } else { + const char *colon = strchr(name, ':'); + if (colon == NULL || strchr(colon + 1, ':') != NULL) { // IPv6 address + host = name; + host_len = strlen(name); + } else { // host:port + host = name; + host_len = colon - name; + port = colon + 1; + } + } + + *out_host = OPENSSL_strndup(host, host_len); + if (*out_host == NULL) { + return 0; + } + if (port == NULL) { + *out_port = NULL; + return 1; + } + *out_port = OPENSSL_strdup(port); + if (*out_port == NULL) { + OPENSSL_free(*out_host); + *out_host = NULL; + return 0; + } + return 1; +} + +static int conn_state(BIO *bio, BIO_CONNECT *c) { + int ret = -1, i; + int (*cb)(const BIO *, int, int) = NULL; + + if (c->info_callback != NULL) { + cb = c->info_callback; + } + + for (;;) { + switch (c->state) { + case BIO_CONN_S_BEFORE: + // If there's a hostname and a port, assume that both are + // exactly what they say. If there is only a hostname, try + // (just once) to split it into a hostname and port. + + if (c->param_hostname == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_HOSTNAME_SPECIFIED); + goto exit_loop; + } + + if (c->param_port == NULL) { + char *host, *port; + if (!split_host_and_port(&host, &port, c->param_hostname) || + port == NULL) { + OPENSSL_free(host); + OPENSSL_free(port); + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_PORT_SPECIFIED); + ERR_add_error_data(2, "host=", c->param_hostname); + goto exit_loop; + } + + OPENSSL_free(c->param_port); + c->param_port = port; + OPENSSL_free(c->param_hostname); + c->param_hostname = host; + } + + if (!bio_ip_and_port_to_socket_and_addr( + &bio->num, &c->them, &c->them_length, c->param_hostname, + c->param_port)) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNABLE_TO_CREATE_SOCKET); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + goto exit_loop; + } + + if (c->nbio) { + if (!bio_socket_nbio(bio->num, 1)) { + OPENSSL_PUT_ERROR(BIO, BIO_R_ERROR_SETTING_NBIO); + ERR_add_error_data(4, "host=", c->param_hostname, ":", + c->param_port); + goto exit_loop; + } + } + + i = 1; + ret = setsockopt(bio->num, SOL_SOCKET, SO_KEEPALIVE, (char *)&i, + sizeof(i)); + if (ret < 0) { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_KEEPALIVE); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + goto exit_loop; + } + + BIO_clear_retry_flags(bio); + ret = connect(bio->num, (struct sockaddr*) &c->them, c->them_length); + if (ret < 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_flags(bio, (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY)); + c->state = BIO_CONN_S_BLOCKED_CONNECT; + bio->retry_reason = BIO_RR_CONNECT; + } else { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_CONNECT_ERROR); + ERR_add_error_data(4, "host=", c->param_hostname, ":", + c->param_port); + } + goto exit_loop; + } else { + c->state = BIO_CONN_S_OK; + } + break; + + case BIO_CONN_S_BLOCKED_CONNECT: + i = bio_sock_error(bio->num); + if (i) { + if (bio_fd_should_retry(ret)) { + BIO_set_flags(bio, (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY)); + c->state = BIO_CONN_S_BLOCKED_CONNECT; + bio->retry_reason = BIO_RR_CONNECT; + ret = -1; + } else { + BIO_clear_retry_flags(bio); + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_NBIO_CONNECT_ERROR); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + ret = 0; + } + goto exit_loop; + } else { + c->state = BIO_CONN_S_OK; + } + break; + + case BIO_CONN_S_OK: + ret = 1; + goto exit_loop; + default: + assert(0); + goto exit_loop; + } + + if (cb != NULL) { + ret = cb((BIO *)bio, c->state, ret); + if (ret == 0) { + goto end; + } + } + } + +exit_loop: + if (cb != NULL) { + ret = cb((BIO *)bio, c->state, ret); + } + +end: + return ret; +} + +static BIO_CONNECT *BIO_CONNECT_new(void) { + BIO_CONNECT *ret = OPENSSL_malloc(sizeof(BIO_CONNECT)); + + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(BIO_CONNECT)); + + ret->state = BIO_CONN_S_BEFORE; + return ret; +} + +static void BIO_CONNECT_free(BIO_CONNECT *c) { + if (c == NULL) { + return; + } + + OPENSSL_free(c->param_hostname); + OPENSSL_free(c->param_port); + OPENSSL_free(c); +} + +static int conn_new(BIO *bio) { + bio->init = 0; + bio->num = -1; + bio->flags = 0; + bio->ptr = (char *)BIO_CONNECT_new(); + return bio->ptr != NULL; +} + +static void conn_close_socket(BIO *bio) { + BIO_CONNECT *c = (BIO_CONNECT *) bio->ptr; + + if (bio->num == -1) { + return; + } + + // Only do a shutdown if things were established + if (c->state == BIO_CONN_S_OK) { + shutdown(bio->num, 2); + } + closesocket(bio->num); + bio->num = -1; +} + +static int conn_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + conn_close_socket(bio); + } + + BIO_CONNECT_free((BIO_CONNECT*) bio->ptr); + + return 1; +} + +static int conn_read(BIO *bio, char *out, int out_len) { + int ret = 0; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + if (data->state != BIO_CONN_S_OK) { + ret = conn_state(bio, data); + if (ret <= 0) { + return ret; + } + } + + bio_clear_socket_error(); + ret = recv(bio->num, out, out_len, 0); + BIO_clear_retry_flags(bio); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(bio); + } + } + + return ret; +} + +static int conn_write(BIO *bio, const char *in, int in_len) { + int ret; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + if (data->state != BIO_CONN_S_OK) { + ret = conn_state(bio, data); + if (ret <= 0) { + return ret; + } + } + + bio_clear_socket_error(); + ret = send(bio->num, in, in_len, 0); + BIO_clear_retry_flags(bio); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(bio); + } + } + + return ret; +} + +static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) { + int *ip; + long ret = 1; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_RESET: + ret = 0; + data->state = BIO_CONN_S_BEFORE; + conn_close_socket(bio); + bio->flags = 0; + break; + case BIO_C_DO_STATE_MACHINE: + // use this one to start the connection + if (data->state != BIO_CONN_S_OK) { + ret = (long)conn_state(bio, data); + } else { + ret = 1; + } + break; + case BIO_C_SET_CONNECT: + if (ptr != NULL) { + bio->init = 1; + if (num == 0) { + OPENSSL_free(data->param_hostname); + 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 = OPENSSL_strdup(ptr); + if (data->param_port == NULL) { + ret = 0; + } + } else { + ret = 0; + } + } + break; + case BIO_C_SET_NBIO: + data->nbio = (int)num; + break; + case BIO_C_GET_FD: + if (bio->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = bio->num; + } + ret = bio->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = bio->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + break; + case BIO_CTRL_PENDING: + case BIO_CTRL_WPENDING: + ret = 0; + break; + case BIO_CTRL_FLUSH: + break; + case BIO_CTRL_GET_CALLBACK: { + int (**fptr)(const BIO *bio, int state, int xret); + fptr = (int (**)(const BIO *bio, int state, int xret))ptr; + *fptr = data->info_callback; + } break; + default: + ret = 0; + break; + } + return ret; +} + +static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + long ret = 1; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_SET_CALLBACK: + data->info_callback = (int (*)(const struct bio_st *, int, int))fp; + break; + default: + ret = 0; + break; + } + return ret; +} + +BIO *BIO_new_connect(const char *hostname) { + BIO *ret; + + ret = BIO_new(BIO_s_connect()); + if (ret == NULL) { + return NULL; + } + if (!BIO_set_conn_hostname(ret, hostname)) { + BIO_free(ret); + return NULL; + } + return ret; +} + +static const BIO_METHOD methods_connectp = { + BIO_TYPE_CONNECT, "socket connect", conn_write, conn_read, + NULL /* puts */, NULL /* gets */, conn_ctrl, conn_new, + conn_free, conn_callback_ctrl, +}; + +const BIO_METHOD *BIO_s_connect(void) { return &methods_connectp; } + +int BIO_set_conn_hostname(BIO *bio, const char *name) { + return BIO_ctrl(bio, BIO_C_SET_CONNECT, 0, (void*) name); +} + +int BIO_set_conn_port(BIO *bio, const char *port_str) { + return BIO_ctrl(bio, BIO_C_SET_CONNECT, 1, (void*) port_str); +} + +int BIO_set_conn_int_port(BIO *bio, const int *port) { + char buf[DECIMAL_SIZE(int) + 1]; + BIO_snprintf(buf, sizeof(buf), "%d", *port); + return BIO_set_conn_port(bio, buf); +} + +int BIO_set_nbio(BIO *bio, int on) { + return BIO_ctrl(bio, BIO_C_SET_NBIO, on, NULL); +} + +int BIO_do_connect(BIO *bio) { + return BIO_ctrl(bio, BIO_C_DO_STATE_MACHINE, 0, NULL); +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back new file mode 100644 index 0000000..b8afa61 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back @@ -0,0 +1,545 @@ +/* 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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#include +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "internal.h" +#include "../internal.h" + + +enum { + BIO_CONN_S_BEFORE, + BIO_CONN_S_BLOCKED_CONNECT, + BIO_CONN_S_OK, +}; + +typedef struct bio_connect_st { + int state; + + char *param_hostname; + char *param_port; + int nbio; + + unsigned short port; + + struct sockaddr_storage them; + socklen_t them_length; + + // the file descriptor is kept in bio->num in order to match the socket + // BIO. + + // info_callback is called when the connection is initially made + // callback(BIO,state,ret); The callback should return 'ret', state is for + // compatibility with the SSL info_callback. + int (*info_callback)(const BIO *bio, int state, int ret); +} BIO_CONNECT; + +#if !defined(OPENSSL_WINDOWS) +static int closesocket(int sock) { + return close(sock); +} +#endif + +// split_host_and_port sets |*out_host| and |*out_port| to the host and port +// parsed from |name|. It returns one on success or zero on error. Even when +// successful, |*out_port| may be NULL on return if no port was specified. +static int split_host_and_port(char **out_host, char **out_port, const char *name) { + const char *host, *port = NULL; + size_t host_len = 0; + + *out_host = NULL; + *out_port = NULL; + + if (name[0] == '[') { // bracketed IPv6 address + const char *close = strchr(name, ']'); + if (close == NULL) { + return 0; + } + host = name + 1; + host_len = close - host; + if (close[1] == ':') { // [IP]:port + port = close + 2; + } else if (close[1] != 0) { + return 0; + } + } else { + const char *colon = strchr(name, ':'); + if (colon == NULL || strchr(colon + 1, ':') != NULL) { // IPv6 address + host = name; + host_len = strlen(name); + } else { // host:port + host = name; + host_len = colon - name; + port = colon + 1; + } + } + + *out_host = OPENSSL_strndup(host, host_len); + if (*out_host == NULL) { + return 0; + } + if (port == NULL) { + *out_port = NULL; + return 1; + } + *out_port = OPENSSL_strdup(port); + if (*out_port == NULL) { + OPENSSL_free(*out_host); + *out_host = NULL; + return 0; + } + return 1; +} + +static int conn_state(BIO *bio, BIO_CONNECT *c) { + int ret = -1, i; + int (*cb)(const BIO *, int, int) = NULL; + + if (c->info_callback != NULL) { + cb = c->info_callback; + } + + for (;;) { + switch (c->state) { + case BIO_CONN_S_BEFORE: + // If there's a hostname and a port, assume that both are + // exactly what they say. If there is only a hostname, try + // (just once) to split it into a hostname and port. + + if (c->param_hostname == NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_HOSTNAME_SPECIFIED); + goto exit_loop; + } + + if (c->param_port == NULL) { + char *host, *port; + if (!split_host_and_port(&host, &port, c->param_hostname) || + port == NULL) { + OPENSSL_free(host); + OPENSSL_free(port); + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_PORT_SPECIFIED); + ERR_add_error_data(2, "host=", c->param_hostname); + goto exit_loop; + } + + OPENSSL_free(c->param_port); + c->param_port = port; + OPENSSL_free(c->param_hostname); + c->param_hostname = host; + } + + if (!bio_ip_and_port_to_socket_and_addr( + &bio->num, &c->them, &c->them_length, c->param_hostname, + c->param_port)) { + OPENSSL_PUT_ERROR(BIO, BIO_R_UNABLE_TO_CREATE_SOCKET); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + goto exit_loop; + } + + if (c->nbio) { + if (!bio_socket_nbio(bio->num, 1)) { + OPENSSL_PUT_ERROR(BIO, BIO_R_ERROR_SETTING_NBIO); + ERR_add_error_data(4, "host=", c->param_hostname, ":", + c->param_port); + goto exit_loop; + } + } + + i = 1; + ret = setsockopt(bio->num, SOL_SOCKET, SO_KEEPALIVE, (char *)&i, + sizeof(i)); + if (ret < 0) { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_KEEPALIVE); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + goto exit_loop; + } + + BIO_clear_retry_flags(bio); + ret = connect(bio->num, (struct sockaddr*) &c->them, c->them_length); + if (ret < 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_flags(bio, (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY)); + c->state = BIO_CONN_S_BLOCKED_CONNECT; + bio->retry_reason = BIO_RR_CONNECT; + } else { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_CONNECT_ERROR); + ERR_add_error_data(4, "host=", c->param_hostname, ":", + c->param_port); + } + goto exit_loop; + } else { + c->state = BIO_CONN_S_OK; + } + break; + + case BIO_CONN_S_BLOCKED_CONNECT: + i = bio_sock_error(bio->num); + if (i) { + if (bio_fd_should_retry(ret)) { + BIO_set_flags(bio, (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY)); + c->state = BIO_CONN_S_BLOCKED_CONNECT; + bio->retry_reason = BIO_RR_CONNECT; + ret = -1; + } else { + BIO_clear_retry_flags(bio); + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, BIO_R_NBIO_CONNECT_ERROR); + ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port); + ret = 0; + } + goto exit_loop; + } else { + c->state = BIO_CONN_S_OK; + } + break; + + case BIO_CONN_S_OK: + ret = 1; + goto exit_loop; + default: + assert(0); + goto exit_loop; + } + + if (cb != NULL) { + ret = cb((BIO *)bio, c->state, ret); + if (ret == 0) { + goto end; + } + } + } + +exit_loop: + if (cb != NULL) { + ret = cb((BIO *)bio, c->state, ret); + } + +end: + return ret; +} + +static BIO_CONNECT *BIO_CONNECT_new(void) { + BIO_CONNECT *ret = OPENSSL_malloc(sizeof(BIO_CONNECT)); + + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(BIO_CONNECT)); + + ret->state = BIO_CONN_S_BEFORE; + return ret; +} + +static void BIO_CONNECT_free(BIO_CONNECT *c) { + if (c == NULL) { + return; + } + + OPENSSL_free(c->param_hostname); + OPENSSL_free(c->param_port); + OPENSSL_free(c); +} + +static int conn_new(BIO *bio) { + bio->init = 0; + bio->num = -1; + bio->flags = 0; + bio->ptr = (char *)BIO_CONNECT_new(); + return bio->ptr != NULL; +} + +static void conn_close_socket(BIO *bio) { + BIO_CONNECT *c = (BIO_CONNECT *) bio->ptr; + + if (bio->num == -1) { + return; + } + + // Only do a shutdown if things were established + if (c->state == BIO_CONN_S_OK) { + shutdown(bio->num, 2); + } + closesocket(bio->num); + bio->num = -1; +} + +static int conn_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + conn_close_socket(bio); + } + + BIO_CONNECT_free((BIO_CONNECT*) bio->ptr); + + return 1; +} + +static int conn_read(BIO *bio, char *out, int out_len) { + int ret = 0; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + if (data->state != BIO_CONN_S_OK) { + ret = conn_state(bio, data); + if (ret <= 0) { + return ret; + } + } + + bio_clear_socket_error(); + ret = recv(bio->num, out, out_len, 0); + BIO_clear_retry_flags(bio); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(bio); + } + } + + return ret; +} + +static int conn_write(BIO *bio, const char *in, int in_len) { + int ret; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + if (data->state != BIO_CONN_S_OK) { + ret = conn_state(bio, data); + if (ret <= 0) { + return ret; + } + } + + bio_clear_socket_error(); + ret = send(bio->num, in, in_len, 0); + BIO_clear_retry_flags(bio); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(bio); + } + } + + return ret; +} + +static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) { + int *ip; + long ret = 1; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_RESET: + ret = 0; + data->state = BIO_CONN_S_BEFORE; + conn_close_socket(bio); + bio->flags = 0; + break; + case BIO_C_DO_STATE_MACHINE: + // use this one to start the connection + if (data->state != BIO_CONN_S_OK) { + ret = (long)conn_state(bio, data); + } else { + ret = 1; + } + break; + case BIO_C_SET_CONNECT: + if (ptr != NULL) { + bio->init = 1; + if (num == 0) { + OPENSSL_free(data->param_hostname); + 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 = OPENSSL_strdup(ptr); + if (data->param_port == NULL) { + ret = 0; + } + } else { + ret = 0; + } + } + break; + case BIO_C_SET_NBIO: + data->nbio = (int)num; + break; + case BIO_C_GET_FD: + if (bio->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = bio->num; + } + ret = bio->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = bio->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + break; + case BIO_CTRL_PENDING: + case BIO_CTRL_WPENDING: + ret = 0; + break; + case BIO_CTRL_FLUSH: + break; + case BIO_CTRL_GET_CALLBACK: { + int (**fptr)(const BIO *bio, int state, int xret); + fptr = (int (**)(const BIO *bio, int state, int xret))ptr; + *fptr = data->info_callback; + } break; + default: + ret = 0; + break; + } + return ret; +} + +static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + long ret = 1; + BIO_CONNECT *data; + + data = (BIO_CONNECT *)bio->ptr; + + switch (cmd) { + case BIO_CTRL_SET_CALLBACK: + data->info_callback = (int (*)(const struct bio_st *, int, int))fp; + break; + default: + ret = 0; + break; + } + return ret; +} + +BIO *BIO_new_connect(const char *hostname) { + BIO *ret; + + ret = BIO_new(BIO_s_connect()); + if (ret == NULL) { + return NULL; + } + if (!BIO_set_conn_hostname(ret, hostname)) { + BIO_free(ret); + return NULL; + } + return ret; +} + +static const BIO_METHOD methods_connectp = { + BIO_TYPE_CONNECT, "socket connect", conn_write, conn_read, + NULL /* puts */, NULL /* gets */, conn_ctrl, conn_new, + conn_free, conn_callback_ctrl, +}; + +const BIO_METHOD *BIO_s_connect(void) { return &methods_connectp; } + +int BIO_set_conn_hostname(BIO *bio, const char *name) { + return BIO_ctrl(bio, BIO_C_SET_CONNECT, 0, (void*) name); +} + +int BIO_set_conn_port(BIO *bio, const char *port_str) { + return BIO_ctrl(bio, BIO_C_SET_CONNECT, 1, (void*) port_str); +} + +int BIO_set_conn_int_port(BIO *bio, const int *port) { + char buf[DECIMAL_SIZE(int) + 1]; + BIO_snprintf(buf, sizeof(buf), "%d", *port); + return BIO_set_conn_port(bio, buf); +} + +int BIO_set_nbio(BIO *bio, int on) { + return BIO_ctrl(bio, BIO_C_SET_NBIO, on, NULL); +} + +int BIO_do_connect(BIO *bio) { + return BIO_ctrl(bio, BIO_C_DO_STATE_MACHINE, 0, NULL); +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c new file mode 100644 index 0000000..bf83b16 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c @@ -0,0 +1,279 @@ +/* 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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#else +#include +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static int bio_fd_non_fatal_error(int err) { + if ( +#ifdef EWOULDBLOCK + err == EWOULDBLOCK || +#endif +#ifdef WSAEWOULDBLOCK + err == WSAEWOULDBLOCK || +#endif +#ifdef ENOTCONN + err == ENOTCONN || +#endif +#ifdef EINTR + err == EINTR || +#endif +#ifdef EAGAIN + err == EAGAIN || +#endif +#ifdef EPROTO + err == EPROTO || +#endif +#ifdef EINPROGRESS + err == EINPROGRESS || +#endif +#ifdef EALREADY + err == EALREADY || +#endif + 0) { + return 1; + } + return 0; +} + +#if defined(OPENSSL_WINDOWS) + #define BORINGSSL_ERRNO (int)GetLastError() + #define BORINGSSL_CLOSE _close + #define BORINGSSL_LSEEK _lseek + #define BORINGSSL_READ _read + #define BORINGSSL_WRITE _write +#else + #define BORINGSSL_ERRNO errno + #define BORINGSSL_CLOSE close + #define BORINGSSL_LSEEK lseek + #define BORINGSSL_READ read + #define BORINGSSL_WRITE write +#endif + +int bio_fd_should_retry(int i) { + if (i == -1) { + return bio_fd_non_fatal_error(BORINGSSL_ERRNO); + } + return 0; +} + +BIO *BIO_new_fd(int fd, int close_flag) { + BIO *ret = BIO_new(BIO_s_fd()); + if (ret == NULL) { + return NULL; + } + BIO_set_fd(ret, fd, close_flag); + return ret; +} + +static int fd_new(BIO *bio) { + // num is used to store the file descriptor. + bio->num = -1; + return 1; +} + +static int fd_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + if (bio->init) { + BORINGSSL_CLOSE(bio->num); + } + bio->init = 0; + } + return 1; +} + +static int fd_read(BIO *b, char *out, int outl) { + int ret = 0; + + ret = BORINGSSL_READ(b->num, out, outl); + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(b); + } + } + + return ret; +} + +static int fd_write(BIO *b, const char *in, int inl) { + int ret = BORINGSSL_WRITE(b->num, in, inl); + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(b); + } + } + + return ret; +} + +static long fd_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + int *ip; + + switch (cmd) { + case BIO_CTRL_RESET: + num = 0; + OPENSSL_FALLTHROUGH; + case BIO_C_FILE_SEEK: + ret = 0; + if (b->init) { + ret = (long)BORINGSSL_LSEEK(b->num, num, SEEK_SET); + } + break; + case BIO_C_FILE_TELL: + case BIO_CTRL_INFO: + ret = 0; + if (b->init) { + ret = (long)BORINGSSL_LSEEK(b->num, 0, SEEK_CUR); + } + break; + case BIO_C_SET_FD: + fd_free(b); + b->num = *((int *)ptr); + b->shutdown = (int)num; + b->init = 1; + break; + case BIO_C_GET_FD: + if (b->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = b->num; + } + return b->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_PENDING: + case BIO_CTRL_WPENDING: + ret = 0; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + + return ret; +} + +static int fd_gets(BIO *bp, char *buf, int size) { + char *ptr = buf; + char *end = buf + size - 1; + + if (size <= 0) { + return 0; + } + + while (ptr < end && fd_read(bp, ptr, 1) > 0 && ptr[0] != '\n') { + ptr++; + } + + ptr[0] = '\0'; + + return ptr - buf; +} + +static const BIO_METHOD methods_fdp = { + BIO_TYPE_FD, "file descriptor", fd_write, fd_read, NULL /* puts */, + fd_gets, fd_ctrl, fd_new, fd_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_fd(void) { return &methods_fdp; } + +int BIO_set_fd(BIO *bio, int fd, int close_flag) { + return BIO_int_ctrl(bio, BIO_C_SET_FD, close_flag, fd); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back new file mode 100644 index 0000000..d4e6918 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back @@ -0,0 +1,279 @@ +/* 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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#else +#include +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static int bio_fd_non_fatal_error(int err) { + if ( +#ifdef EWOULDBLOCK + err == EWOULDBLOCK || +#endif +#ifdef WSAEWOULDBLOCK + err == WSAEWOULDBLOCK || +#endif +#ifdef ENOTCONN + err == ENOTCONN || +#endif +#ifdef EINTR + err == EINTR || +#endif +#ifdef EAGAIN + err == EAGAIN || +#endif +#ifdef EPROTO + err == EPROTO || +#endif +#ifdef EINPROGRESS + err == EINPROGRESS || +#endif +#ifdef EALREADY + err == EALREADY || +#endif + 0) { + return 1; + } + return 0; +} + +#if defined(OPENSSL_WINDOWS) + #define BORINGSSL_ERRNO (int)GetLastError() + #define BORINGSSL_CLOSE _close + #define BORINGSSL_LSEEK _lseek + #define BORINGSSL_READ _read + #define BORINGSSL_WRITE _write +#else + #define BORINGSSL_ERRNO errno + #define BORINGSSL_CLOSE close + #define BORINGSSL_LSEEK lseek + #define BORINGSSL_READ read + #define BORINGSSL_WRITE write +#endif + +int bio_fd_should_retry(int i) { + if (i == -1) { + return bio_fd_non_fatal_error(BORINGSSL_ERRNO); + } + return 0; +} + +BIO *BIO_new_fd(int fd, int close_flag) { + BIO *ret = BIO_new(BIO_s_fd()); + if (ret == NULL) { + return NULL; + } + BIO_set_fd(ret, fd, close_flag); + return ret; +} + +static int fd_new(BIO *bio) { + // num is used to store the file descriptor. + bio->num = -1; + return 1; +} + +static int fd_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + if (bio->init) { + BORINGSSL_CLOSE(bio->num); + } + bio->init = 0; + } + return 1; +} + +static int fd_read(BIO *b, char *out, int outl) { + int ret = 0; + + ret = BORINGSSL_READ(b->num, out, outl); + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(b); + } + } + + return ret; +} + +static int fd_write(BIO *b, const char *in, int inl) { + int ret = BORINGSSL_WRITE(b->num, in, inl); + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(b); + } + } + + return ret; +} + +static long fd_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + int *ip; + + switch (cmd) { + case BIO_CTRL_RESET: + num = 0; + OPENSSL_FALLTHROUGH; + case BIO_C_FILE_SEEK: + ret = 0; + if (b->init) { + ret = (long)BORINGSSL_LSEEK(b->num, num, SEEK_SET); + } + break; + case BIO_C_FILE_TELL: + case BIO_CTRL_INFO: + ret = 0; + if (b->init) { + ret = (long)BORINGSSL_LSEEK(b->num, 0, SEEK_CUR); + } + break; + case BIO_C_SET_FD: + fd_free(b); + b->num = *((int *)ptr); + b->shutdown = (int)num; + b->init = 1; + break; + case BIO_C_GET_FD: + if (b->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = b->num; + } + return b->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_PENDING: + case BIO_CTRL_WPENDING: + ret = 0; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + + return ret; +} + +static int fd_gets(BIO *bp, char *buf, int size) { + char *ptr = buf; + char *end = buf + size - 1; + + if (size <= 0) { + return 0; + } + + while (ptr < end && fd_read(bp, ptr, 1) > 0 && ptr[0] != '\n') { + ptr++; + } + + ptr[0] = '\0'; + + return ptr - buf; +} + +static const BIO_METHOD methods_fdp = { + BIO_TYPE_FD, "file descriptor", fd_write, fd_read, NULL /* puts */, + fd_gets, fd_ctrl, fd_new, fd_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_fd(void) { return &methods_fdp; } + +int BIO_set_fd(BIO *bio, int fd, int close_flag) { + return BIO_int_ctrl(bio, BIO_C_SET_FD, close_flag, fd); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c new file mode 100644 index 0000000..6405f24 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c @@ -0,0 +1,317 @@ +/* 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.] */ + +#if defined(__linux) || defined(__sun) || defined(__hpux) +// Following definition aliases fopen to fopen64 on above mentioned +// platforms. This makes it possible to open and sequentially access +// files larger than 2GB from 32-bit application. It does not allow to +// traverse them beyond 2GB with fseek/ftell, but on the other hand *no* +// 32-bit platform permits that, not with fseek/ftell. Not to mention +// that breaking 2GB limit for seeking would require surgery to *our* +// API. But sequential access suffices for practical cases when you +// can run into large files, such as fingerprinting, so we can let API +// alone. For reference, the list of 32-bit platforms which allow for +// sequential access of large files without extra "magic" comprise *BSD, +// Darwin, IRIX... +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif +#endif + +#include + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#include +#include + +#include "../internal.h" + + +#define BIO_FP_READ 0x02 +#define BIO_FP_WRITE 0x04 +#define BIO_FP_APPEND 0x08 + +BIO *BIO_new_file(const char *filename, const char *mode) { + BIO *ret; + FILE *file; + + file = fopen(filename, mode); + if (file == NULL) { + OPENSSL_PUT_SYSTEM_ERROR(); + + ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); + if (errno == ENOENT) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_SUCH_FILE); + } else { + OPENSSL_PUT_ERROR(BIO, BIO_R_SYS_LIB); + } + return NULL; + } + + ret = BIO_new_fp(file, BIO_CLOSE); + if (ret == NULL) { + fclose(file); + return NULL; + } + + return ret; +} + +BIO *BIO_new_fp(FILE *stream, int close_flag) { + BIO *ret = BIO_new(BIO_s_file()); + + if (ret == NULL) { + return NULL; + } + + BIO_set_fp(ret, stream, close_flag); + return ret; +} + +static int file_new(BIO *bio) { return 1; } + +static int file_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (!bio->shutdown) { + return 1; + } + + if (bio->init && bio->ptr != NULL) { + fclose(bio->ptr); + bio->ptr = NULL; + } + bio->init = 0; + + return 1; +} + +static int file_read(BIO *b, char *out, int outl) { + if (!b->init) { + return 0; + } + + size_t ret = fread(out, 1, outl, (FILE *)b->ptr); + if (ret == 0 && ferror((FILE *)b->ptr)) { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, ERR_R_SYS_LIB); + return -1; + } + + // fread reads at most |outl| bytes, so |ret| fits in an int. + return (int)ret; +} + +static int file_write(BIO *b, const char *in, int inl) { + int ret = 0; + + if (!b->init) { + return 0; + } + + ret = fwrite(in, inl, 1, (FILE *)b->ptr); + if (ret > 0) { + ret = inl; + } + return ret; +} + +static long file_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + FILE *fp = (FILE *)b->ptr; + FILE **fpp; + char p[4]; + + switch (cmd) { + case BIO_CTRL_RESET: + num = 0; + OPENSSL_FALLTHROUGH; + case BIO_C_FILE_SEEK: + ret = (long)fseek(fp, num, 0); + break; + case BIO_CTRL_EOF: + ret = (long)feof(fp); + break; + case BIO_C_FILE_TELL: + case BIO_CTRL_INFO: + ret = ftell(fp); + break; + case BIO_C_SET_FILE_PTR: + file_free(b); + b->shutdown = (int)num & BIO_CLOSE; + b->ptr = ptr; + b->init = 1; + break; + case BIO_C_SET_FILENAME: + file_free(b); + b->shutdown = (int)num & BIO_CLOSE; + if (num & BIO_FP_APPEND) { + if (num & BIO_FP_READ) { + OPENSSL_strlcpy(p, "a+", sizeof(p)); + } else { + OPENSSL_strlcpy(p, "a", sizeof(p)); + } + } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) { + OPENSSL_strlcpy(p, "r+", sizeof(p)); + } else if (num & BIO_FP_WRITE) { + OPENSSL_strlcpy(p, "w", sizeof(p)); + } else if (num & BIO_FP_READ) { + OPENSSL_strlcpy(p, "r", sizeof(p)); + } else { + OPENSSL_PUT_ERROR(BIO, BIO_R_BAD_FOPEN_MODE); + ret = 0; + break; + } + fp = fopen(ptr, p); + if (fp == NULL) { + OPENSSL_PUT_SYSTEM_ERROR(); + ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); + OPENSSL_PUT_ERROR(BIO, ERR_R_SYS_LIB); + ret = 0; + break; + } + b->ptr = fp; + b->init = 1; + break; + case BIO_C_GET_FILE_PTR: + // the ptr parameter is actually a FILE ** in this case. + if (ptr != NULL) { + fpp = (FILE **)ptr; + *fpp = (FILE *)b->ptr; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = (long)b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_FLUSH: + ret = 0 == fflush((FILE *)b->ptr); + break; + case BIO_CTRL_WPENDING: + case BIO_CTRL_PENDING: + default: + ret = 0; + break; + } + return ret; +} + +static int file_gets(BIO *bp, char *buf, int size) { + int ret = 0; + + if (size == 0) { + return 0; + } + + if (!fgets(buf, size, (FILE *)bp->ptr)) { + buf[0] = 0; + goto err; + } + ret = strlen(buf); + +err: + return ret; +} + +static const BIO_METHOD methods_filep = { + BIO_TYPE_FILE, "FILE pointer", + file_write, file_read, + NULL /* puts */, file_gets, + file_ctrl, file_new, + file_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_file(void) { return &methods_filep; } + + +int BIO_get_fp(BIO *bio, FILE **out_file) { + return BIO_ctrl(bio, BIO_C_GET_FILE_PTR, 0, (char*) out_file); +} + +int BIO_set_fp(BIO *bio, FILE *file, int close_flag) { + return BIO_ctrl(bio, BIO_C_SET_FILE_PTR, close_flag, (char *) file); +} + +int BIO_read_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_READ, + (char *)filename); +} + +int BIO_write_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_WRITE, + (char *)filename); +} + +int BIO_append_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_APPEND, + (char *)filename); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back new file mode 100644 index 0000000..15feb9d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back @@ -0,0 +1,317 @@ +/* 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.] */ + +#if defined(__linux) || defined(__sun) || defined(__hpux) +// Following definition aliases fopen to fopen64 on above mentioned +// platforms. This makes it possible to open and sequentially access +// files larger than 2GB from 32-bit application. It does not allow to +// traverse them beyond 2GB with fseek/ftell, but on the other hand *no* +// 32-bit platform permits that, not with fseek/ftell. Not to mention +// that breaking 2GB limit for seeking would require surgery to *our* +// API. But sequential access suffices for practical cases when you +// can run into large files, such as fingerprinting, so we can let API +// alone. For reference, the list of 32-bit platforms which allow for +// sequential access of large files without extra "magic" comprise *BSD, +// Darwin, IRIX... +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif +#endif + +#include + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#include +#include + +#include "../internal.h" + + +#define BIO_FP_READ 0x02 +#define BIO_FP_WRITE 0x04 +#define BIO_FP_APPEND 0x08 + +BIO *BIO_new_file(const char *filename, const char *mode) { + BIO *ret; + FILE *file; + + file = fopen(filename, mode); + if (file == NULL) { + OPENSSL_PUT_SYSTEM_ERROR(); + + ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); + if (errno == ENOENT) { + OPENSSL_PUT_ERROR(BIO, BIO_R_NO_SUCH_FILE); + } else { + OPENSSL_PUT_ERROR(BIO, BIO_R_SYS_LIB); + } + return NULL; + } + + ret = BIO_new_fp(file, BIO_CLOSE); + if (ret == NULL) { + fclose(file); + return NULL; + } + + return ret; +} + +BIO *BIO_new_fp(FILE *stream, int close_flag) { + BIO *ret = BIO_new(BIO_s_file()); + + if (ret == NULL) { + return NULL; + } + + BIO_set_fp(ret, stream, close_flag); + return ret; +} + +static int file_new(BIO *bio) { return 1; } + +static int file_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (!bio->shutdown) { + return 1; + } + + if (bio->init && bio->ptr != NULL) { + fclose(bio->ptr); + bio->ptr = NULL; + } + bio->init = 0; + + return 1; +} + +static int file_read(BIO *b, char *out, int outl) { + if (!b->init) { + return 0; + } + + size_t ret = fread(out, 1, outl, (FILE *)b->ptr); + if (ret == 0 && ferror((FILE *)b->ptr)) { + OPENSSL_PUT_SYSTEM_ERROR(); + OPENSSL_PUT_ERROR(BIO, ERR_R_SYS_LIB); + return -1; + } + + // fread reads at most |outl| bytes, so |ret| fits in an int. + return (int)ret; +} + +static int file_write(BIO *b, const char *in, int inl) { + int ret = 0; + + if (!b->init) { + return 0; + } + + ret = fwrite(in, inl, 1, (FILE *)b->ptr); + if (ret > 0) { + ret = inl; + } + return ret; +} + +static long file_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + FILE *fp = (FILE *)b->ptr; + FILE **fpp; + char p[4]; + + switch (cmd) { + case BIO_CTRL_RESET: + num = 0; + OPENSSL_FALLTHROUGH; + case BIO_C_FILE_SEEK: + ret = (long)fseek(fp, num, 0); + break; + case BIO_CTRL_EOF: + ret = (long)feof(fp); + break; + case BIO_C_FILE_TELL: + case BIO_CTRL_INFO: + ret = ftell(fp); + break; + case BIO_C_SET_FILE_PTR: + file_free(b); + b->shutdown = (int)num & BIO_CLOSE; + b->ptr = ptr; + b->init = 1; + break; + case BIO_C_SET_FILENAME: + file_free(b); + b->shutdown = (int)num & BIO_CLOSE; + if (num & BIO_FP_APPEND) { + if (num & BIO_FP_READ) { + OPENSSL_strlcpy(p, "a+", sizeof(p)); + } else { + OPENSSL_strlcpy(p, "a", sizeof(p)); + } + } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) { + OPENSSL_strlcpy(p, "r+", sizeof(p)); + } else if (num & BIO_FP_WRITE) { + OPENSSL_strlcpy(p, "w", sizeof(p)); + } else if (num & BIO_FP_READ) { + OPENSSL_strlcpy(p, "r", sizeof(p)); + } else { + OPENSSL_PUT_ERROR(BIO, BIO_R_BAD_FOPEN_MODE); + ret = 0; + break; + } + fp = fopen(ptr, p); + if (fp == NULL) { + OPENSSL_PUT_SYSTEM_ERROR(); + ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); + OPENSSL_PUT_ERROR(BIO, ERR_R_SYS_LIB); + ret = 0; + break; + } + b->ptr = fp; + b->init = 1; + break; + case BIO_C_GET_FILE_PTR: + // the ptr parameter is actually a FILE ** in this case. + if (ptr != NULL) { + fpp = (FILE **)ptr; + *fpp = (FILE *)b->ptr; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = (long)b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_FLUSH: + ret = 0 == fflush((FILE *)b->ptr); + break; + case BIO_CTRL_WPENDING: + case BIO_CTRL_PENDING: + default: + ret = 0; + break; + } + return ret; +} + +static int file_gets(BIO *bp, char *buf, int size) { + int ret = 0; + + if (size == 0) { + return 0; + } + + if (!fgets(buf, size, (FILE *)bp->ptr)) { + buf[0] = 0; + goto err; + } + ret = strlen(buf); + +err: + return ret; +} + +static const BIO_METHOD methods_filep = { + BIO_TYPE_FILE, "FILE pointer", + file_write, file_read, + NULL /* puts */, file_gets, + file_ctrl, file_new, + file_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_file(void) { return &methods_filep; } + + +int BIO_get_fp(BIO *bio, FILE **out_file) { + return BIO_ctrl(bio, BIO_C_GET_FILE_PTR, 0, (char*) out_file); +} + +int BIO_set_fp(BIO *bio, FILE *file, int close_flag) { + return BIO_ctrl(bio, BIO_C_SET_FILE_PTR, close_flag, (char *) file); +} + +int BIO_read_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_READ, + (char *)filename); +} + +int BIO_write_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_WRITE, + (char *)filename); +} + +int BIO_append_filename(BIO *bio, const char *filename) { + return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_APPEND, + (char *)filename); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c new file mode 100644 index 0000000..e3c45f0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c @@ -0,0 +1,192 @@ +/* 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" + + +// hexdump_ctx contains the state of a hexdump. +struct hexdump_ctx { + BIO *bio; + char right_chars[18]; // the contents of the right-hand side, ASCII dump. + unsigned used; // number of bytes in the current line. + size_t n; // number of bytes total. + unsigned indent; +}; + +static void hexbyte(char *out, uint8_t b) { + static const char hextable[] = "0123456789abcdef"; + out[0] = hextable[b>>4]; + out[1] = hextable[b&0x0f]; +} + +static char to_char(uint8_t b) { + if (b < 32 || b > 126) { + return '.'; + } + return b; +} + +// hexdump_write adds |len| bytes of |data| to the current hex dump described by +// |ctx|. +static int hexdump_write(struct hexdump_ctx *ctx, const uint8_t *data, + size_t len) { + char buf[10]; + unsigned l; + + // Output lines look like: + // 00000010 2e 2f 30 31 32 33 34 35 36 37 38 ... 3c 3d // |./0123456789:;<=| + // ^ offset ^ extra space ^ ASCII of line + + for (size_t i = 0; i < len; i++) { + if (ctx->used == 0) { + // The beginning of a line. + BIO_indent(ctx->bio, ctx->indent, UINT_MAX); + + hexbyte(&buf[0], ctx->n >> 24); + hexbyte(&buf[2], ctx->n >> 16); + hexbyte(&buf[4], ctx->n >> 8); + hexbyte(&buf[6], ctx->n); + buf[8] = buf[9] = ' '; + if (BIO_write(ctx->bio, buf, 10) < 0) { + return 0; + } + } + + hexbyte(buf, data[i]); + buf[2] = ' '; + l = 3; + if (ctx->used == 7) { + // There's an additional space after the 8th byte. + buf[3] = ' '; + l = 4; + } else if (ctx->used == 15) { + // At the end of the line there's an extra space and the bar for the + // right column. + buf[3] = ' '; + buf[4] = '|'; + l = 5; + } + + if (BIO_write(ctx->bio, buf, l) < 0) { + return 0; + } + ctx->right_chars[ctx->used] = to_char(data[i]); + ctx->used++; + ctx->n++; + if (ctx->used == 16) { + ctx->right_chars[16] = '|'; + ctx->right_chars[17] = '\n'; + if (BIO_write(ctx->bio, ctx->right_chars, sizeof(ctx->right_chars)) < 0) { + return 0; + } + ctx->used = 0; + } + } + + return 1; +} + +// finish flushes any buffered data in |ctx|. +static int finish(struct hexdump_ctx *ctx) { + // See the comments in |hexdump| for the details of this format. + const unsigned n_bytes = ctx->used; + unsigned l; + char buf[5]; + + if (n_bytes == 0) { + return 1; + } + + OPENSSL_memset(buf, ' ', 4); + buf[4] = '|'; + + for (; ctx->used < 16; ctx->used++) { + l = 3; + if (ctx->used == 7) { + l = 4; + } else if (ctx->used == 15) { + l = 5; + } + if (BIO_write(ctx->bio, buf, l) < 0) { + return 0; + } + } + + ctx->right_chars[n_bytes] = '|'; + ctx->right_chars[n_bytes + 1] = '\n'; + if (BIO_write(ctx->bio, ctx->right_chars, n_bytes + 2) < 0) { + return 0; + } + return 1; +} + +int BIO_hexdump(BIO *bio, const uint8_t *data, size_t len, unsigned indent) { + struct hexdump_ctx ctx; + OPENSSL_memset(&ctx, 0, sizeof(ctx)); + ctx.bio = bio; + ctx.indent = indent; + + if (!hexdump_write(&ctx, data, len) || !finish(&ctx)) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c.grpc_back new file mode 100644 index 0000000..6d928bc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c.grpc_back @@ -0,0 +1,192 @@ +/* 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" + + +// hexdump_ctx contains the state of a hexdump. +struct hexdump_ctx { + BIO *bio; + char right_chars[18]; // the contents of the right-hand side, ASCII dump. + unsigned used; // number of bytes in the current line. + size_t n; // number of bytes total. + unsigned indent; +}; + +static void hexbyte(char *out, uint8_t b) { + static const char hextable[] = "0123456789abcdef"; + out[0] = hextable[b>>4]; + out[1] = hextable[b&0x0f]; +} + +static char to_char(uint8_t b) { + if (b < 32 || b > 126) { + return '.'; + } + return b; +} + +// hexdump_write adds |len| bytes of |data| to the current hex dump described by +// |ctx|. +static int hexdump_write(struct hexdump_ctx *ctx, const uint8_t *data, + size_t len) { + char buf[10]; + unsigned l; + + // Output lines look like: + // 00000010 2e 2f 30 31 32 33 34 35 36 37 38 ... 3c 3d // |./0123456789:;<=| + // ^ offset ^ extra space ^ ASCII of line + + for (size_t i = 0; i < len; i++) { + if (ctx->used == 0) { + // The beginning of a line. + BIO_indent(ctx->bio, ctx->indent, UINT_MAX); + + hexbyte(&buf[0], ctx->n >> 24); + hexbyte(&buf[2], ctx->n >> 16); + hexbyte(&buf[4], ctx->n >> 8); + hexbyte(&buf[6], ctx->n); + buf[8] = buf[9] = ' '; + if (BIO_write(ctx->bio, buf, 10) < 0) { + return 0; + } + } + + hexbyte(buf, data[i]); + buf[2] = ' '; + l = 3; + if (ctx->used == 7) { + // There's an additional space after the 8th byte. + buf[3] = ' '; + l = 4; + } else if (ctx->used == 15) { + // At the end of the line there's an extra space and the bar for the + // right column. + buf[3] = ' '; + buf[4] = '|'; + l = 5; + } + + if (BIO_write(ctx->bio, buf, l) < 0) { + return 0; + } + ctx->right_chars[ctx->used] = to_char(data[i]); + ctx->used++; + ctx->n++; + if (ctx->used == 16) { + ctx->right_chars[16] = '|'; + ctx->right_chars[17] = '\n'; + if (BIO_write(ctx->bio, ctx->right_chars, sizeof(ctx->right_chars)) < 0) { + return 0; + } + ctx->used = 0; + } + } + + return 1; +} + +// finish flushes any buffered data in |ctx|. +static int finish(struct hexdump_ctx *ctx) { + // See the comments in |hexdump| for the details of this format. + const unsigned n_bytes = ctx->used; + unsigned l; + char buf[5]; + + if (n_bytes == 0) { + return 1; + } + + OPENSSL_memset(buf, ' ', 4); + buf[4] = '|'; + + for (; ctx->used < 16; ctx->used++) { + l = 3; + if (ctx->used == 7) { + l = 4; + } else if (ctx->used == 15) { + l = 5; + } + if (BIO_write(ctx->bio, buf, l) < 0) { + return 0; + } + } + + ctx->right_chars[n_bytes] = '|'; + ctx->right_chars[n_bytes + 1] = '\n'; + if (BIO_write(ctx->bio, ctx->right_chars, n_bytes + 2) < 0) { + return 0; + } + return 1; +} + +int BIO_hexdump(BIO *bio, const uint8_t *data, size_t len, unsigned indent) { + struct hexdump_ctx ctx; + OPENSSL_memset(&ctx, 0, sizeof(ctx)); + ctx.bio = bio; + ctx.indent = indent; + + if (!hexdump_write(&ctx, data, len) || !finish(&ctx)) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h new file mode 100644 index 0000000..36cc921 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h @@ -0,0 +1,111 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_BIO_INTERNAL_H + +#include + +#if !defined(OPENSSL_WINDOWS) +#if defined(OPENSSL_PNACL) +// newlib uses u_short in socket.h without defining it. +typedef unsigned short u_short; +#endif +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +typedef int socklen_t; +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + +// BIO_ip_and_port_to_socket_and_addr creates a socket and fills in |*out_addr| +// and |*out_addr_length| with the correct values for connecting to |hostname| +// on |port_str|. It returns one on success or zero on error. +int bio_ip_and_port_to_socket_and_addr(int *out_sock, + struct sockaddr_storage *out_addr, + socklen_t *out_addr_length, + const char *hostname, + const char *port_str); + +// BIO_socket_nbio sets whether |sock| is non-blocking. It returns one on +// success and zero otherwise. +int bio_socket_nbio(int sock, int on); + +// BIO_clear_socket_error clears the last system socket error. +// +// TODO(fork): remove all callers of this. +void bio_clear_socket_error(void); + +// BIO_sock_error returns the last socket error on |sock|. +int bio_sock_error(int sock); + +// BIO_fd_should_retry returns non-zero if |return_value| indicates an error +// and |errno| indicates that it's non-fatal. +int bio_fd_should_retry(int return_value); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BIO_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h.grpc_back new file mode 100644 index 0000000..8ed27da --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h.grpc_back @@ -0,0 +1,111 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_BIO_INTERNAL_H + +#include + +#if !defined(OPENSSL_WINDOWS) +#if defined(OPENSSL_PNACL) +// newlib uses u_short in socket.h without defining it. +typedef unsigned short u_short; +#endif +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +typedef int socklen_t; +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + +// BIO_ip_and_port_to_socket_and_addr creates a socket and fills in |*out_addr| +// and |*out_addr_length| with the correct values for connecting to |hostname| +// on |port_str|. It returns one on success or zero on error. +int bio_ip_and_port_to_socket_and_addr(int *out_sock, + struct sockaddr_storage *out_addr, + socklen_t *out_addr_length, + const char *hostname, + const char *port_str); + +// BIO_socket_nbio sets whether |sock| is non-blocking. It returns one on +// success and zero otherwise. +int bio_socket_nbio(int sock, int on); + +// BIO_clear_socket_error clears the last system socket error. +// +// TODO(fork): remove all callers of this. +void bio_clear_socket_error(void); + +// BIO_sock_error returns the last socket error on |sock|. +int bio_sock_error(int sock); + +// BIO_fd_should_retry returns non-zero if |return_value| indicates an error +// and |errno| indicates that it's non-fatal. +int bio_fd_should_retry(int return_value); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BIO_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c new file mode 100644 index 0000000..aa19a31 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c @@ -0,0 +1,488 @@ +/* ==================================================================== + * Copyright (c) 1998-2003 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" + + +struct bio_bio_st { + BIO *peer; // NULL if buf == NULL. + // If peer != NULL, then peer->ptr is also a bio_bio_st, + // and its "peer" member points back to us. + // peer != NULL iff init != 0 in the BIO. + + // This is for what we write (i.e. reading uses peer's struct): + int closed; // valid iff peer != NULL + size_t len; // valid iff buf != NULL; 0 if peer == NULL + size_t offset; // valid iff buf != NULL; 0 if len == 0 + size_t size; + uint8_t *buf; // "size" elements (if != NULL) + + size_t request; // valid iff peer != NULL; 0 if len != 0, + // otherwise set by peer to number of bytes + // it (unsuccessfully) tried to read, + // never more than buffer space (size-len) warrants. +}; + +static int bio_new(BIO *bio) { + struct bio_bio_st *b; + + b = OPENSSL_malloc(sizeof *b); + if (b == NULL) { + return 0; + } + OPENSSL_memset(b, 0, sizeof(struct bio_bio_st)); + + b->size = 17 * 1024; // enough for one TLS record (just a default) + bio->ptr = b; + return 1; +} + +static void bio_destroy_pair(BIO *bio) { + struct bio_bio_st *b = bio->ptr; + BIO *peer_bio; + struct bio_bio_st *peer_b; + + if (b == NULL) { + return; + } + + peer_bio = b->peer; + if (peer_bio == NULL) { + return; + } + + peer_b = peer_bio->ptr; + + assert(peer_b != NULL); + assert(peer_b->peer == bio); + + peer_b->peer = NULL; + peer_bio->init = 0; + assert(peer_b->buf != NULL); + peer_b->len = 0; + peer_b->offset = 0; + + b->peer = NULL; + bio->init = 0; + assert(b->buf != NULL); + b->len = 0; + b->offset = 0; +} + +static int bio_free(BIO *bio) { + struct bio_bio_st *b; + + if (bio == NULL) { + return 0; + } + b = bio->ptr; + + assert(b != NULL); + + if (b->peer) { + bio_destroy_pair(bio); + } + + OPENSSL_free(b->buf); + OPENSSL_free(b); + + return 1; +} + +static int bio_read(BIO *bio, char *buf, int size_) { + size_t size = size_; + size_t rest; + struct bio_bio_st *b, *peer_b; + + BIO_clear_retry_flags(bio); + + if (!bio->init) { + return 0; + } + + b = bio->ptr; + assert(b != NULL); + assert(b->peer != NULL); + peer_b = b->peer->ptr; + assert(peer_b != NULL); + assert(peer_b->buf != NULL); + + peer_b->request = 0; // will be set in "retry_read" situation + + if (buf == NULL || size == 0) { + return 0; + } + + if (peer_b->len == 0) { + if (peer_b->closed) { + return 0; // writer has closed, and no data is left + } else { + BIO_set_retry_read(bio); // buffer is empty + if (size <= peer_b->size) { + peer_b->request = size; + } else { + // don't ask for more than the peer can + // deliver in one write + peer_b->request = peer_b->size; + } + return -1; + } + } + + // we can read + if (peer_b->len < size) { + size = peer_b->len; + } + + // now read "size" bytes + rest = size; + + assert(rest > 0); + // one or two iterations + do { + size_t chunk; + + assert(rest <= peer_b->len); + if (peer_b->offset + rest <= peer_b->size) { + chunk = rest; + } else { + // wrap around ring buffer + chunk = peer_b->size - peer_b->offset; + } + assert(peer_b->offset + chunk <= peer_b->size); + + OPENSSL_memcpy(buf, peer_b->buf + peer_b->offset, chunk); + + peer_b->len -= chunk; + if (peer_b->len) { + peer_b->offset += chunk; + assert(peer_b->offset <= peer_b->size); + if (peer_b->offset == peer_b->size) { + peer_b->offset = 0; + } + buf += chunk; + } else { + // buffer now empty, no need to advance "buf" + assert(chunk == rest); + peer_b->offset = 0; + } + rest -= chunk; + } while (rest); + + return size; +} + +static int bio_write(BIO *bio, const char *buf, int num_) { + size_t num = num_; + size_t rest; + struct bio_bio_st *b; + + BIO_clear_retry_flags(bio); + + if (!bio->init || buf == NULL || num == 0) { + return 0; + } + + b = bio->ptr; + assert(b != NULL); + assert(b->peer != NULL); + assert(b->buf != NULL); + + b->request = 0; + if (b->closed) { + // we already closed + OPENSSL_PUT_ERROR(BIO, BIO_R_BROKEN_PIPE); + return -1; + } + + assert(b->len <= b->size); + + if (b->len == b->size) { + BIO_set_retry_write(bio); // buffer is full + return -1; + } + + // we can write + if (num > b->size - b->len) { + num = b->size - b->len; + } + + // now write "num" bytes + rest = num; + + assert(rest > 0); + // one or two iterations + do { + size_t write_offset; + size_t chunk; + + assert(b->len + rest <= b->size); + + write_offset = b->offset + b->len; + if (write_offset >= b->size) { + write_offset -= b->size; + } + // b->buf[write_offset] is the first byte we can write to. + + if (write_offset + rest <= b->size) { + chunk = rest; + } else { + // wrap around ring buffer + chunk = b->size - write_offset; + } + + OPENSSL_memcpy(b->buf + write_offset, buf, chunk); + + b->len += chunk; + + assert(b->len <= b->size); + + rest -= chunk; + buf += chunk; + } while (rest); + + return num; +} + +static int bio_make_pair(BIO *bio1, BIO *bio2, size_t writebuf1_len, + size_t writebuf2_len) { + struct bio_bio_st *b1, *b2; + + assert(bio1 != NULL); + assert(bio2 != NULL); + + b1 = bio1->ptr; + b2 = bio2->ptr; + + if (b1->peer != NULL || b2->peer != NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_IN_USE); + return 0; + } + + if (b1->buf == NULL) { + if (writebuf1_len) { + b1->size = writebuf1_len; + } + b1->buf = OPENSSL_malloc(b1->size); + if (b1->buf == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return 0; + } + b1->len = 0; + b1->offset = 0; + } + + if (b2->buf == NULL) { + if (writebuf2_len) { + b2->size = writebuf2_len; + } + b2->buf = OPENSSL_malloc(b2->size); + if (b2->buf == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return 0; + } + b2->len = 0; + b2->offset = 0; + } + + b1->peer = bio2; + b1->closed = 0; + b1->request = 0; + b2->peer = bio1; + b2->closed = 0; + b2->request = 0; + + bio1->init = 1; + bio2->init = 1; + + return 1; +} + +static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) { + long ret; + struct bio_bio_st *b = bio->ptr; + + assert(b != NULL); + + switch (cmd) { + // specific CTRL codes + + case BIO_C_GET_WRITE_BUF_SIZE: + ret = (long)b->size; + break; + + case BIO_C_GET_WRITE_GUARANTEE: + // How many bytes can the caller feed to the next write + // without having to keep any? + if (b->peer == NULL || b->closed) { + ret = 0; + } else { + ret = (long)b->size - b->len; + } + break; + + case BIO_C_GET_READ_REQUEST: + // If the peer unsuccessfully tried to read, how many bytes + // were requested? (As with BIO_CTRL_PENDING, that number + // can usually be treated as boolean.) + ret = (long)b->request; + break; + + case BIO_C_RESET_READ_REQUEST: + // Reset request. (Can be useful after read attempts + // at the other side that are meant to be non-blocking, + // e.g. when probing SSL_read to see if any data is + // available.) + b->request = 0; + ret = 1; + break; + + case BIO_C_SHUTDOWN_WR: + // similar to shutdown(..., SHUT_WR) + b->closed = 1; + ret = 1; + break; + + // standard CTRL codes follow + + case BIO_CTRL_GET_CLOSE: + ret = bio->shutdown; + break; + + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + ret = 1; + break; + + case BIO_CTRL_PENDING: + if (b->peer != NULL) { + struct bio_bio_st *peer_b = b->peer->ptr; + ret = (long)peer_b->len; + } else { + ret = 0; + } + break; + + case BIO_CTRL_WPENDING: + ret = 0; + if (b->buf != NULL) { + ret = (long)b->len; + } + break; + + case BIO_CTRL_FLUSH: + ret = 1; + break; + + case BIO_CTRL_EOF: { + BIO *other_bio = ptr; + + if (other_bio) { + struct bio_bio_st *other_b = other_bio->ptr; + assert(other_b != NULL); + ret = other_b->len == 0 && other_b->closed; + } else { + ret = 1; + } + } break; + + default: + ret = 0; + } + return ret; +} + + +static const BIO_METHOD methods_biop = { + BIO_TYPE_BIO, "BIO pair", bio_write, bio_read, NULL /* puts */, + NULL /* gets */, bio_ctrl, bio_new, bio_free, NULL /* callback_ctrl */, +}; + +static const BIO_METHOD *bio_s_bio(void) { return &methods_biop; } + +int BIO_new_bio_pair(BIO** bio1_p, size_t writebuf1_len, + BIO** bio2_p, size_t writebuf2_len) { + BIO *bio1 = BIO_new(bio_s_bio()); + BIO *bio2 = BIO_new(bio_s_bio()); + if (bio1 == NULL || bio2 == NULL || + !bio_make_pair(bio1, bio2, writebuf1_len, writebuf2_len)) { + BIO_free(bio1); + BIO_free(bio2); + *bio1_p = NULL; + *bio2_p = NULL; + return 0; + } + + *bio1_p = bio1; + *bio2_p = bio2; + return 1; +} + +size_t BIO_ctrl_get_read_request(BIO *bio) { + return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL); +} + +size_t BIO_ctrl_get_write_guarantee(BIO *bio) { + return BIO_ctrl(bio, BIO_C_GET_WRITE_GUARANTEE, 0, NULL); +} + +int BIO_shutdown_wr(BIO *bio) { + return BIO_ctrl(bio, BIO_C_SHUTDOWN_WR, 0, NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back new file mode 100644 index 0000000..03f60b7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back @@ -0,0 +1,488 @@ +/* ==================================================================== + * Copyright (c) 1998-2003 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" + + +struct bio_bio_st { + BIO *peer; // NULL if buf == NULL. + // If peer != NULL, then peer->ptr is also a bio_bio_st, + // and its "peer" member points back to us. + // peer != NULL iff init != 0 in the BIO. + + // This is for what we write (i.e. reading uses peer's struct): + int closed; // valid iff peer != NULL + size_t len; // valid iff buf != NULL; 0 if peer == NULL + size_t offset; // valid iff buf != NULL; 0 if len == 0 + size_t size; + uint8_t *buf; // "size" elements (if != NULL) + + size_t request; // valid iff peer != NULL; 0 if len != 0, + // otherwise set by peer to number of bytes + // it (unsuccessfully) tried to read, + // never more than buffer space (size-len) warrants. +}; + +static int bio_new(BIO *bio) { + struct bio_bio_st *b; + + b = OPENSSL_malloc(sizeof *b); + if (b == NULL) { + return 0; + } + OPENSSL_memset(b, 0, sizeof(struct bio_bio_st)); + + b->size = 17 * 1024; // enough for one TLS record (just a default) + bio->ptr = b; + return 1; +} + +static void bio_destroy_pair(BIO *bio) { + struct bio_bio_st *b = bio->ptr; + BIO *peer_bio; + struct bio_bio_st *peer_b; + + if (b == NULL) { + return; + } + + peer_bio = b->peer; + if (peer_bio == NULL) { + return; + } + + peer_b = peer_bio->ptr; + + assert(peer_b != NULL); + assert(peer_b->peer == bio); + + peer_b->peer = NULL; + peer_bio->init = 0; + assert(peer_b->buf != NULL); + peer_b->len = 0; + peer_b->offset = 0; + + b->peer = NULL; + bio->init = 0; + assert(b->buf != NULL); + b->len = 0; + b->offset = 0; +} + +static int bio_free(BIO *bio) { + struct bio_bio_st *b; + + if (bio == NULL) { + return 0; + } + b = bio->ptr; + + assert(b != NULL); + + if (b->peer) { + bio_destroy_pair(bio); + } + + OPENSSL_free(b->buf); + OPENSSL_free(b); + + return 1; +} + +static int bio_read(BIO *bio, char *buf, int size_) { + size_t size = size_; + size_t rest; + struct bio_bio_st *b, *peer_b; + + BIO_clear_retry_flags(bio); + + if (!bio->init) { + return 0; + } + + b = bio->ptr; + assert(b != NULL); + assert(b->peer != NULL); + peer_b = b->peer->ptr; + assert(peer_b != NULL); + assert(peer_b->buf != NULL); + + peer_b->request = 0; // will be set in "retry_read" situation + + if (buf == NULL || size == 0) { + return 0; + } + + if (peer_b->len == 0) { + if (peer_b->closed) { + return 0; // writer has closed, and no data is left + } else { + BIO_set_retry_read(bio); // buffer is empty + if (size <= peer_b->size) { + peer_b->request = size; + } else { + // don't ask for more than the peer can + // deliver in one write + peer_b->request = peer_b->size; + } + return -1; + } + } + + // we can read + if (peer_b->len < size) { + size = peer_b->len; + } + + // now read "size" bytes + rest = size; + + assert(rest > 0); + // one or two iterations + do { + size_t chunk; + + assert(rest <= peer_b->len); + if (peer_b->offset + rest <= peer_b->size) { + chunk = rest; + } else { + // wrap around ring buffer + chunk = peer_b->size - peer_b->offset; + } + assert(peer_b->offset + chunk <= peer_b->size); + + OPENSSL_memcpy(buf, peer_b->buf + peer_b->offset, chunk); + + peer_b->len -= chunk; + if (peer_b->len) { + peer_b->offset += chunk; + assert(peer_b->offset <= peer_b->size); + if (peer_b->offset == peer_b->size) { + peer_b->offset = 0; + } + buf += chunk; + } else { + // buffer now empty, no need to advance "buf" + assert(chunk == rest); + peer_b->offset = 0; + } + rest -= chunk; + } while (rest); + + return size; +} + +static int bio_write(BIO *bio, const char *buf, int num_) { + size_t num = num_; + size_t rest; + struct bio_bio_st *b; + + BIO_clear_retry_flags(bio); + + if (!bio->init || buf == NULL || num == 0) { + return 0; + } + + b = bio->ptr; + assert(b != NULL); + assert(b->peer != NULL); + assert(b->buf != NULL); + + b->request = 0; + if (b->closed) { + // we already closed + OPENSSL_PUT_ERROR(BIO, BIO_R_BROKEN_PIPE); + return -1; + } + + assert(b->len <= b->size); + + if (b->len == b->size) { + BIO_set_retry_write(bio); // buffer is full + return -1; + } + + // we can write + if (num > b->size - b->len) { + num = b->size - b->len; + } + + // now write "num" bytes + rest = num; + + assert(rest > 0); + // one or two iterations + do { + size_t write_offset; + size_t chunk; + + assert(b->len + rest <= b->size); + + write_offset = b->offset + b->len; + if (write_offset >= b->size) { + write_offset -= b->size; + } + // b->buf[write_offset] is the first byte we can write to. + + if (write_offset + rest <= b->size) { + chunk = rest; + } else { + // wrap around ring buffer + chunk = b->size - write_offset; + } + + OPENSSL_memcpy(b->buf + write_offset, buf, chunk); + + b->len += chunk; + + assert(b->len <= b->size); + + rest -= chunk; + buf += chunk; + } while (rest); + + return num; +} + +static int bio_make_pair(BIO *bio1, BIO *bio2, size_t writebuf1_len, + size_t writebuf2_len) { + struct bio_bio_st *b1, *b2; + + assert(bio1 != NULL); + assert(bio2 != NULL); + + b1 = bio1->ptr; + b2 = bio2->ptr; + + if (b1->peer != NULL || b2->peer != NULL) { + OPENSSL_PUT_ERROR(BIO, BIO_R_IN_USE); + return 0; + } + + if (b1->buf == NULL) { + if (writebuf1_len) { + b1->size = writebuf1_len; + } + b1->buf = OPENSSL_malloc(b1->size); + if (b1->buf == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return 0; + } + b1->len = 0; + b1->offset = 0; + } + + if (b2->buf == NULL) { + if (writebuf2_len) { + b2->size = writebuf2_len; + } + b2->buf = OPENSSL_malloc(b2->size); + if (b2->buf == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return 0; + } + b2->len = 0; + b2->offset = 0; + } + + b1->peer = bio2; + b1->closed = 0; + b1->request = 0; + b2->peer = bio1; + b2->closed = 0; + b2->request = 0; + + bio1->init = 1; + bio2->init = 1; + + return 1; +} + +static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) { + long ret; + struct bio_bio_st *b = bio->ptr; + + assert(b != NULL); + + switch (cmd) { + // specific CTRL codes + + case BIO_C_GET_WRITE_BUF_SIZE: + ret = (long)b->size; + break; + + case BIO_C_GET_WRITE_GUARANTEE: + // How many bytes can the caller feed to the next write + // without having to keep any? + if (b->peer == NULL || b->closed) { + ret = 0; + } else { + ret = (long)b->size - b->len; + } + break; + + case BIO_C_GET_READ_REQUEST: + // If the peer unsuccessfully tried to read, how many bytes + // were requested? (As with BIO_CTRL_PENDING, that number + // can usually be treated as boolean.) + ret = (long)b->request; + break; + + case BIO_C_RESET_READ_REQUEST: + // Reset request. (Can be useful after read attempts + // at the other side that are meant to be non-blocking, + // e.g. when probing SSL_read to see if any data is + // available.) + b->request = 0; + ret = 1; + break; + + case BIO_C_SHUTDOWN_WR: + // similar to shutdown(..., SHUT_WR) + b->closed = 1; + ret = 1; + break; + + // standard CTRL codes follow + + case BIO_CTRL_GET_CLOSE: + ret = bio->shutdown; + break; + + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + ret = 1; + break; + + case BIO_CTRL_PENDING: + if (b->peer != NULL) { + struct bio_bio_st *peer_b = b->peer->ptr; + ret = (long)peer_b->len; + } else { + ret = 0; + } + break; + + case BIO_CTRL_WPENDING: + ret = 0; + if (b->buf != NULL) { + ret = (long)b->len; + } + break; + + case BIO_CTRL_FLUSH: + ret = 1; + break; + + case BIO_CTRL_EOF: { + BIO *other_bio = ptr; + + if (other_bio) { + struct bio_bio_st *other_b = other_bio->ptr; + assert(other_b != NULL); + ret = other_b->len == 0 && other_b->closed; + } else { + ret = 1; + } + } break; + + default: + ret = 0; + } + return ret; +} + + +static const BIO_METHOD methods_biop = { + BIO_TYPE_BIO, "BIO pair", bio_write, bio_read, NULL /* puts */, + NULL /* gets */, bio_ctrl, bio_new, bio_free, NULL /* callback_ctrl */, +}; + +static const BIO_METHOD *bio_s_bio(void) { return &methods_biop; } + +int BIO_new_bio_pair(BIO** bio1_p, size_t writebuf1_len, + BIO** bio2_p, size_t writebuf2_len) { + BIO *bio1 = BIO_new(bio_s_bio()); + BIO *bio2 = BIO_new(bio_s_bio()); + if (bio1 == NULL || bio2 == NULL || + !bio_make_pair(bio1, bio2, writebuf1_len, writebuf2_len)) { + BIO_free(bio1); + BIO_free(bio2); + *bio1_p = NULL; + *bio2_p = NULL; + return 0; + } + + *bio1_p = bio1; + *bio2_p = bio2; + return 1; +} + +size_t BIO_ctrl_get_read_request(BIO *bio) { + return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL); +} + +size_t BIO_ctrl_get_write_guarantee(BIO *bio) { + return BIO_ctrl(bio, BIO_C_GET_WRITE_GUARANTEE, 0, NULL); +} + +int BIO_shutdown_wr(BIO *bio) { + return BIO_ctrl(bio, BIO_C_SHUTDOWN_WR, 0, NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c new file mode 100644 index 0000000..d33814f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c @@ -0,0 +1,115 @@ +/* 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 + +int BIO_printf(BIO *bio, const char *format, ...) { + va_list args; + char buf[256], *out, out_malloced = 0; + int out_len, ret; + + va_start(args, format); + out_len = vsnprintf(buf, sizeof(buf), format, args); + va_end(args); + +#if defined(OPENSSL_WINDOWS) + // On Windows, vsnprintf returns -1 rather than the requested length on + // truncation + if (out_len < 0) { + va_start(args, format); + out_len = _vscprintf(format, args); + va_end(args); + assert(out_len >= (int)sizeof(buf)); + } +#endif + + if (out_len < 0) { + return -1; + } + + if ((size_t) out_len >= sizeof(buf)) { + const int requested_len = out_len; + // The output was truncated. Note that vsnprintf's return value + // does not include a trailing NUL, but the buffer must be sized + // for it. + out = OPENSSL_malloc(requested_len + 1); + out_malloced = 1; + if (out == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return -1; + } + va_start(args, format); + out_len = vsnprintf(out, requested_len + 1, format, args); + va_end(args); + assert(out_len == requested_len); + } else { + out = buf; + } + + ret = BIO_write(bio, out, out_len); + if (out_malloced) { + OPENSSL_free(out); + } + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c.grpc_back new file mode 100644 index 0000000..4f9d8a1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c.grpc_back @@ -0,0 +1,115 @@ +/* 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 + +int BIO_printf(BIO *bio, const char *format, ...) { + va_list args; + char buf[256], *out, out_malloced = 0; + int out_len, ret; + + va_start(args, format); + out_len = vsnprintf(buf, sizeof(buf), format, args); + va_end(args); + +#if defined(OPENSSL_WINDOWS) + // On Windows, vsnprintf returns -1 rather than the requested length on + // truncation + if (out_len < 0) { + va_start(args, format); + out_len = _vscprintf(format, args); + va_end(args); + assert(out_len >= (int)sizeof(buf)); + } +#endif + + if (out_len < 0) { + return -1; + } + + if ((size_t) out_len >= sizeof(buf)) { + const int requested_len = out_len; + // The output was truncated. Note that vsnprintf's return value + // does not include a trailing NUL, but the buffer must be sized + // for it. + out = OPENSSL_malloc(requested_len + 1); + out_malloced = 1; + if (out == NULL) { + OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE); + return -1; + } + va_start(args, format); + out_len = vsnprintf(out, requested_len + 1, format, args); + va_end(args); + assert(out_len == requested_len); + } else { + out = buf; + } + + ret = BIO_write(bio, out, out_len); + if (out_malloced) { + OPENSSL_free(out); + } + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c new file mode 100644 index 0000000..359a888 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c @@ -0,0 +1,206 @@ +/* crypto/bio/bss_sock.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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) + +OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib")) +#endif + +#include "internal.h" + + +#if !defined(OPENSSL_WINDOWS) +static int closesocket(int sock) { + return close(sock); +} +#endif + +static int sock_new(BIO *bio) { + bio->init = 0; + bio->num = 0; + bio->ptr = NULL; + bio->flags = 0; + return 1; +} + +static int sock_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + if (bio->init) { + closesocket(bio->num); + } + bio->init = 0; + bio->flags = 0; + } + return 1; +} + +static int sock_read(BIO *b, char *out, int outl) { + int ret = 0; + + if (out == NULL) { + return 0; + } + + bio_clear_socket_error(); +#if defined(OPENSSL_WINDOWS) + ret = recv(b->num, out, outl, 0); +#else + ret = read(b->num, out, outl); +#endif + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(b); + } + } + return ret; +} + +static int sock_write(BIO *b, const char *in, int inl) { + int ret; + + bio_clear_socket_error(); +#if defined(OPENSSL_WINDOWS) + ret = send(b->num, in, inl, 0); +#else + ret = write(b->num, in, inl); +#endif + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(b); + } + } + return ret; +} + +static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + int *ip; + + switch (cmd) { + case BIO_C_SET_FD: + sock_free(b); + b->num = *((int *)ptr); + b->shutdown = (int)num; + b->init = 1; + break; + case BIO_C_GET_FD: + if (b->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = b->num; + } + ret = b->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + return ret; +} + +static const BIO_METHOD methods_sockp = { + BIO_TYPE_SOCKET, "socket", + sock_write, sock_read, + NULL /* puts */, NULL /* gets, */, + sock_ctrl, sock_new, + sock_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_socket(void) { return &methods_sockp; } + +BIO *BIO_new_socket(int fd, int close_flag) { + BIO *ret; + + ret = BIO_new(BIO_s_socket()); + if (ret == NULL) { + return NULL; + } + BIO_set_fd(ret, fd, close_flag); + return ret; +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back new file mode 100644 index 0000000..081ce01 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back @@ -0,0 +1,206 @@ +/* crypto/bio/bss_sock.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 + +#if !defined(OPENSSL_TRUSTY) + +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) + +OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib")) +#endif + +#include "internal.h" + + +#if !defined(OPENSSL_WINDOWS) +static int closesocket(int sock) { + return close(sock); +} +#endif + +static int sock_new(BIO *bio) { + bio->init = 0; + bio->num = 0; + bio->ptr = NULL; + bio->flags = 0; + return 1; +} + +static int sock_free(BIO *bio) { + if (bio == NULL) { + return 0; + } + + if (bio->shutdown) { + if (bio->init) { + closesocket(bio->num); + } + bio->init = 0; + bio->flags = 0; + } + return 1; +} + +static int sock_read(BIO *b, char *out, int outl) { + int ret = 0; + + if (out == NULL) { + return 0; + } + + bio_clear_socket_error(); +#if defined(OPENSSL_WINDOWS) + ret = recv(b->num, out, outl, 0); +#else + ret = read(b->num, out, outl); +#endif + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_read(b); + } + } + return ret; +} + +static int sock_write(BIO *b, const char *in, int inl) { + int ret; + + bio_clear_socket_error(); +#if defined(OPENSSL_WINDOWS) + ret = send(b->num, in, inl, 0); +#else + ret = write(b->num, in, inl); +#endif + BIO_clear_retry_flags(b); + if (ret <= 0) { + if (bio_fd_should_retry(ret)) { + BIO_set_retry_write(b); + } + } + return ret; +} + +static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) { + long ret = 1; + int *ip; + + switch (cmd) { + case BIO_C_SET_FD: + sock_free(b); + b->num = *((int *)ptr); + b->shutdown = (int)num; + b->init = 1; + break; + case BIO_C_GET_FD: + if (b->init) { + ip = (int *)ptr; + if (ip != NULL) { + *ip = b->num; + } + ret = b->num; + } else { + ret = -1; + } + break; + case BIO_CTRL_GET_CLOSE: + ret = b->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + b->shutdown = (int)num; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + default: + ret = 0; + break; + } + return ret; +} + +static const BIO_METHOD methods_sockp = { + BIO_TYPE_SOCKET, "socket", + sock_write, sock_read, + NULL /* puts */, NULL /* gets, */, + sock_ctrl, sock_new, + sock_free, NULL /* callback_ctrl */, +}; + +const BIO_METHOD *BIO_s_socket(void) { return &methods_sockp; } + +BIO *BIO_new_socket(int fd, int close_flag) { + BIO *ret; + + ret = BIO_new(BIO_s_socket()); + if (ret == NULL) { + return NULL; + } + BIO_set_fd(ret, fd, close_flag); + return ret; +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c new file mode 100644 index 0000000..1ea87f7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c @@ -0,0 +1,118 @@ +/* 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. */ + +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112L + +#include +#include + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" +#include "../internal.h" + + +int bio_ip_and_port_to_socket_and_addr(int *out_sock, + struct sockaddr_storage *out_addr, + socklen_t *out_addr_length, + const char *hostname, + const char *port_str) { + struct addrinfo hint, *result, *cur; + int ret; + + *out_sock = -1; + + OPENSSL_memset(&hint, 0, sizeof(hint)); + hint.ai_family = AF_UNSPEC; + hint.ai_socktype = SOCK_STREAM; + + ret = getaddrinfo(hostname, port_str, &hint, &result); + if (ret != 0) { + OPENSSL_PUT_ERROR(SYS, 0); + ERR_add_error_data(1, gai_strerror(ret)); + return 0; + } + + ret = 0; + + for (cur = result; cur; cur = cur->ai_next) { + if ((size_t) cur->ai_addrlen > sizeof(struct sockaddr_storage)) { + continue; + } + OPENSSL_memset(out_addr, 0, sizeof(struct sockaddr_storage)); + OPENSSL_memcpy(out_addr, cur->ai_addr, cur->ai_addrlen); + *out_addr_length = cur->ai_addrlen; + + *out_sock = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol); + if (*out_sock < 0) { + OPENSSL_PUT_SYSTEM_ERROR(); + goto out; + } + + ret = 1; + break; + } + +out: + freeaddrinfo(result); + return ret; +} + +int bio_socket_nbio(int sock, int on) { +#if defined(OPENSSL_WINDOWS) + u_long arg = on; + + return 0 == ioctlsocket(sock, FIONBIO, &arg); +#else + int flags = fcntl(sock, F_GETFL, 0); + if (flags < 0) { + return 0; + } + if (!on) { + flags &= ~O_NONBLOCK; + } else { + flags |= O_NONBLOCK; + } + return fcntl(sock, F_SETFL, flags) == 0; +#endif +} + +void bio_clear_socket_error(void) {} + +int bio_sock_error(int sock) { + int error; + socklen_t error_size = sizeof(error); + + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&error, &error_size) < 0) { + return 1; + } + return error; +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back new file mode 100644 index 0000000..d4209d0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back @@ -0,0 +1,118 @@ +/* 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. */ + +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112L + +#include +#include + +#if !defined(OPENSSL_TRUSTY) + +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#include +#else +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" +#include "../internal.h" + + +int bio_ip_and_port_to_socket_and_addr(int *out_sock, + struct sockaddr_storage *out_addr, + socklen_t *out_addr_length, + const char *hostname, + const char *port_str) { + struct addrinfo hint, *result, *cur; + int ret; + + *out_sock = -1; + + OPENSSL_memset(&hint, 0, sizeof(hint)); + hint.ai_family = AF_UNSPEC; + hint.ai_socktype = SOCK_STREAM; + + ret = getaddrinfo(hostname, port_str, &hint, &result); + if (ret != 0) { + OPENSSL_PUT_ERROR(SYS, 0); + ERR_add_error_data(1, gai_strerror(ret)); + return 0; + } + + ret = 0; + + for (cur = result; cur; cur = cur->ai_next) { + if ((size_t) cur->ai_addrlen > sizeof(struct sockaddr_storage)) { + continue; + } + OPENSSL_memset(out_addr, 0, sizeof(struct sockaddr_storage)); + OPENSSL_memcpy(out_addr, cur->ai_addr, cur->ai_addrlen); + *out_addr_length = cur->ai_addrlen; + + *out_sock = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol); + if (*out_sock < 0) { + OPENSSL_PUT_SYSTEM_ERROR(); + goto out; + } + + ret = 1; + break; + } + +out: + freeaddrinfo(result); + return ret; +} + +int bio_socket_nbio(int sock, int on) { +#if defined(OPENSSL_WINDOWS) + u_long arg = on; + + return 0 == ioctlsocket(sock, FIONBIO, &arg); +#else + int flags = fcntl(sock, F_GETFL, 0); + if (flags < 0) { + return 0; + } + if (!on) { + flags &= ~O_NONBLOCK; + } else { + flags |= O_NONBLOCK; + } + return fcntl(sock, F_SETFL, flags) == 0; +#endif +} + +void bio_clear_socket_error(void) {} + +int bio_sock_error(int sock) { + int error; + socklen_t error_size = sizeof(error); + + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&error, &error_size) < 0) { + return 1; + } + return error; +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c new file mode 100644 index 0000000..ce08c53 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c @@ -0,0 +1,64 @@ +/* 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 + + +int BN_parse_asn1_unsigned(CBS *cbs, BIGNUM *ret) { + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_INTEGER) || + CBS_len(&child) == 0) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return 0; + } + + if (CBS_data(&child)[0] & 0x80) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + // INTEGERs must be minimal. + if (CBS_data(&child)[0] == 0x00 && + CBS_len(&child) > 1 && + !(CBS_data(&child)[1] & 0x80)) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return 0; + } + + return BN_bin2bn(CBS_data(&child), CBS_len(&child), ret) != NULL; +} + +int BN_marshal_asn1(CBB *cbb, const BIGNUM *bn) { + // Negative numbers are unsupported. + if (BN_is_negative(bn)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER) || + // The number must be padded with a leading zero if the high bit would + // otherwise be set or if |bn| is zero. + (BN_num_bits(bn) % 8 == 0 && !CBB_add_u8(&child, 0x00)) || + !BN_bn2cbb_padded(&child, BN_num_bytes(bn), bn) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(BN, BN_R_ENCODE_ERROR); + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c.grpc_back new file mode 100644 index 0000000..0d96573 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c.grpc_back @@ -0,0 +1,64 @@ +/* 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 + + +int BN_parse_asn1_unsigned(CBS *cbs, BIGNUM *ret) { + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_INTEGER) || + CBS_len(&child) == 0) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return 0; + } + + if (CBS_data(&child)[0] & 0x80) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + // INTEGERs must be minimal. + if (CBS_data(&child)[0] == 0x00 && + CBS_len(&child) > 1 && + !(CBS_data(&child)[1] & 0x80)) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return 0; + } + + return BN_bin2bn(CBS_data(&child), CBS_len(&child), ret) != NULL; +} + +int BN_marshal_asn1(CBB *cbb, const BIGNUM *bn) { + // Negative numbers are unsupported. + if (BN_is_negative(bn)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER) || + // The number must be padded with a leading zero if the high bit would + // otherwise be set or if |bn| is zero. + (BN_num_bits(bn) % 8 == 0 && !CBB_add_u8(&child, 0x00)) || + !BN_bn2cbb_padded(&child, BN_num_bytes(bn), bn) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(BN, BN_R_ENCODE_ERROR); + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c new file mode 100644 index 0000000..b1c285b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c @@ -0,0 +1,470 @@ +/* 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 "../fipsmodule/bn/internal.h" + + +int BN_bn2cbb_padded(CBB *out, size_t len, const BIGNUM *in) { + uint8_t *ptr; + return CBB_add_space(out, &ptr, len) && BN_bn2bin_padded(ptr, len, in); +} + +static const char hextable[] = "0123456789abcdef"; + +char *BN_bn2hex(const BIGNUM *bn) { + int width = bn_minimal_width(bn); + char *buf = OPENSSL_malloc(1 /* leading '-' */ + 1 /* zero is non-empty */ + + width * BN_BYTES * 2 + 1 /* trailing NUL */); + if (buf == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + char *p = buf; + if (bn->neg) { + *(p++) = '-'; + } + + if (BN_is_zero(bn)) { + *(p++) = '0'; + } + + int z = 0; + for (int i = width - 1; i >= 0; i--) { + for (int j = BN_BITS2 - 8; j >= 0; j -= 8) { + // strip leading zeros + int v = ((int)(bn->d[i] >> (long)j)) & 0xff; + if (z || v != 0) { + *(p++) = hextable[v >> 4]; + *(p++) = hextable[v & 0x0f]; + z = 1; + } + } + } + *p = '\0'; + + return buf; +} + +// decode_hex decodes |in_len| bytes of hex data from |in| and updates |bn|. +static int decode_hex(BIGNUM *bn, const char *in, int in_len) { + if (in_len > INT_MAX/4) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + // |in_len| is the number of hex digits. + if (!bn_expand(bn, in_len * 4)) { + return 0; + } + + int i = 0; + while (in_len > 0) { + // Decode one |BN_ULONG| at a time. + int todo = BN_BYTES * 2; + if (todo > in_len) { + todo = in_len; + } + + BN_ULONG word = 0; + int j; + for (j = todo; j > 0; j--) { + char c = in[in_len - j]; + + BN_ULONG hex; + if (c >= '0' && c <= '9') { + hex = c - '0'; + } else if (c >= 'a' && c <= 'f') { + hex = c - 'a' + 10; + } else if (c >= 'A' && c <= 'F') { + hex = c - 'A' + 10; + } else { + hex = 0; + // This shouldn't happen. The caller checks |isxdigit|. + assert(0); + } + word = (word << 4) | hex; + } + + bn->d[i++] = word; + in_len -= todo; + } + assert(i <= bn->dmax); + bn->width = i; + return 1; +} + +// decode_dec decodes |in_len| bytes of decimal data from |in| and updates |bn|. +static int decode_dec(BIGNUM *bn, const char *in, int in_len) { + int i, j; + BN_ULONG l = 0; + + // Decode |BN_DEC_NUM| digits at a time. + j = BN_DEC_NUM - (in_len % BN_DEC_NUM); + if (j == BN_DEC_NUM) { + j = 0; + } + l = 0; + for (i = 0; i < in_len; i++) { + l *= 10; + l += in[i] - '0'; + if (++j == BN_DEC_NUM) { + if (!BN_mul_word(bn, BN_DEC_CONV) || + !BN_add_word(bn, l)) { + return 0; + } + l = 0; + j = 0; + } + } + return 1; +} + +typedef int (*decode_func) (BIGNUM *bn, const char *in, int in_len); +typedef int (*char_test_func) (int c); + +static int bn_x2bn(BIGNUM **outp, const char *in, decode_func decode, char_test_func want_char) { + BIGNUM *ret = NULL; + int neg = 0, i; + int num; + + if (in == NULL || *in == 0) { + return 0; + } + + if (*in == '-') { + neg = 1; + in++; + } + + for (i = 0; want_char((unsigned char)in[i]) && i + neg < INT_MAX; i++) {} + + num = i + neg; + if (outp == NULL) { + return num; + } + + // in is the start of the hex digits, and it is 'i' long + if (*outp == NULL) { + ret = BN_new(); + if (ret == NULL) { + return 0; + } + } else { + ret = *outp; + BN_zero(ret); + } + + if (!decode(ret, in, i)) { + goto err; + } + + bn_set_minimal_width(ret); + if (!BN_is_zero(ret)) { + ret->neg = neg; + } + + *outp = ret; + return num; + +err: + if (*outp == NULL) { + BN_free(ret); + } + + return 0; +} + +int BN_hex2bn(BIGNUM **outp, const char *in) { + return bn_x2bn(outp, in, decode_hex, isxdigit); +} + +char *BN_bn2dec(const BIGNUM *a) { + // It is easier to print strings little-endian, so we assemble it in reverse + // and fix at the end. + BIGNUM *copy = NULL; + CBB cbb; + if (!CBB_init(&cbb, 16) || + !CBB_add_u8(&cbb, 0 /* trailing NUL */)) { + goto cbb_err; + } + + if (BN_is_zero(a)) { + if (!CBB_add_u8(&cbb, '0')) { + goto cbb_err; + } + } else { + copy = BN_dup(a); + if (copy == NULL) { + goto err; + } + + while (!BN_is_zero(copy)) { + BN_ULONG word = BN_div_word(copy, BN_DEC_CONV); + if (word == (BN_ULONG)-1) { + goto err; + } + + const int add_leading_zeros = !BN_is_zero(copy); + for (int i = 0; i < BN_DEC_NUM && (add_leading_zeros || word != 0); i++) { + if (!CBB_add_u8(&cbb, '0' + word % 10)) { + goto cbb_err; + } + word /= 10; + } + assert(word == 0); + } + } + + if (BN_is_negative(a) && + !CBB_add_u8(&cbb, '-')) { + goto cbb_err; + } + + uint8_t *data; + size_t len; + if (!CBB_finish(&cbb, &data, &len)) { + goto cbb_err; + } + + // Reverse the buffer. + for (size_t i = 0; i < len/2; i++) { + uint8_t tmp = data[i]; + data[i] = data[len - 1 - i]; + data[len - 1 - i] = tmp; + } + + BN_free(copy); + return (char *)data; + +cbb_err: + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); +err: + BN_free(copy); + CBB_cleanup(&cbb); + return NULL; +} + +int BN_dec2bn(BIGNUM **outp, const char *in) { + return bn_x2bn(outp, in, decode_dec, isdigit); +} + +int BN_asc2bn(BIGNUM **outp, const char *in) { + const char *const orig_in = in; + if (*in == '-') { + in++; + } + + if (in[0] == '0' && (in[1] == 'X' || in[1] == 'x')) { + if (!BN_hex2bn(outp, in+2)) { + return 0; + } + } else { + if (!BN_dec2bn(outp, in)) { + return 0; + } + } + + if (*orig_in == '-' && !BN_is_zero(*outp)) { + (*outp)->neg = 1; + } + + return 1; +} + +int BN_print(BIO *bp, const BIGNUM *a) { + int i, j, v, z = 0; + int ret = 0; + + if (a->neg && BIO_write(bp, "-", 1) != 1) { + goto end; + } + + if (BN_is_zero(a) && BIO_write(bp, "0", 1) != 1) { + goto end; + } + + for (i = bn_minimal_width(a) - 1; i >= 0; i--) { + for (j = BN_BITS2 - 4; j >= 0; j -= 4) { + // strip leading zeros + v = ((int)(a->d[i] >> (long)j)) & 0x0f; + if (z || v != 0) { + if (BIO_write(bp, &hextable[v], 1) != 1) { + goto end; + } + z = 1; + } + } + } + ret = 1; + +end: + return ret; +} + +int BN_print_fp(FILE *fp, const BIGNUM *a) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + return 0; + } + + int ret = BN_print(b, a); + BIO_free(b); + return ret; +} + + +size_t BN_bn2mpi(const BIGNUM *in, uint8_t *out) { + const size_t bits = BN_num_bits(in); + const size_t bytes = (bits + 7) / 8; + // If the number of bits is a multiple of 8, i.e. if the MSB is set, + // prefix with a zero byte. + int extend = 0; + if (bytes != 0 && (bits & 0x07) == 0) { + extend = 1; + } + + const size_t len = bytes + extend; + if (len < bytes || + 4 + len < len || + (len & 0xffffffff) != len) { + // If we cannot represent the number then we emit zero as the interface + // doesn't allow an error to be signalled. + if (out) { + OPENSSL_memset(out, 0, 4); + } + return 4; + } + + if (out == NULL) { + return 4 + len; + } + + out[0] = len >> 24; + out[1] = len >> 16; + out[2] = len >> 8; + out[3] = len; + if (extend) { + out[4] = 0; + } + BN_bn2bin(in, out + 4 + extend); + if (in->neg && len > 0) { + out[4] |= 0x80; + } + return len + 4; +} + +BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out) { + if (len < 4) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return NULL; + } + const size_t in_len = ((size_t)in[0] << 24) | + ((size_t)in[1] << 16) | + ((size_t)in[2] << 8) | + ((size_t)in[3]); + if (in_len != len - 4) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return NULL; + } + + int out_is_alloced = 0; + if (out == NULL) { + out = BN_new(); + if (out == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + out_is_alloced = 1; + } + + if (in_len == 0) { + BN_zero(out); + return out; + } + + in += 4; + if (BN_bin2bn(in, in_len, out) == NULL) { + if (out_is_alloced) { + BN_free(out); + } + return NULL; + } + out->neg = ((*in) & 0x80) != 0; + if (out->neg) { + BN_clear_bit(out, BN_num_bits(out) - 1); + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back new file mode 100644 index 0000000..6e930fc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back @@ -0,0 +1,470 @@ +/* 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 "../fipsmodule/bn/internal.h" + + +int BN_bn2cbb_padded(CBB *out, size_t len, const BIGNUM *in) { + uint8_t *ptr; + return CBB_add_space(out, &ptr, len) && BN_bn2bin_padded(ptr, len, in); +} + +static const char hextable[] = "0123456789abcdef"; + +char *BN_bn2hex(const BIGNUM *bn) { + int width = bn_minimal_width(bn); + char *buf = OPENSSL_malloc(1 /* leading '-' */ + 1 /* zero is non-empty */ + + width * BN_BYTES * 2 + 1 /* trailing NUL */); + if (buf == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + char *p = buf; + if (bn->neg) { + *(p++) = '-'; + } + + if (BN_is_zero(bn)) { + *(p++) = '0'; + } + + int z = 0; + for (int i = width - 1; i >= 0; i--) { + for (int j = BN_BITS2 - 8; j >= 0; j -= 8) { + // strip leading zeros + int v = ((int)(bn->d[i] >> (long)j)) & 0xff; + if (z || v != 0) { + *(p++) = hextable[v >> 4]; + *(p++) = hextable[v & 0x0f]; + z = 1; + } + } + } + *p = '\0'; + + return buf; +} + +// decode_hex decodes |in_len| bytes of hex data from |in| and updates |bn|. +static int decode_hex(BIGNUM *bn, const char *in, int in_len) { + if (in_len > INT_MAX/4) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + // |in_len| is the number of hex digits. + if (!bn_expand(bn, in_len * 4)) { + return 0; + } + + int i = 0; + while (in_len > 0) { + // Decode one |BN_ULONG| at a time. + int todo = BN_BYTES * 2; + if (todo > in_len) { + todo = in_len; + } + + BN_ULONG word = 0; + int j; + for (j = todo; j > 0; j--) { + char c = in[in_len - j]; + + BN_ULONG hex; + if (c >= '0' && c <= '9') { + hex = c - '0'; + } else if (c >= 'a' && c <= 'f') { + hex = c - 'a' + 10; + } else if (c >= 'A' && c <= 'F') { + hex = c - 'A' + 10; + } else { + hex = 0; + // This shouldn't happen. The caller checks |isxdigit|. + assert(0); + } + word = (word << 4) | hex; + } + + bn->d[i++] = word; + in_len -= todo; + } + assert(i <= bn->dmax); + bn->width = i; + return 1; +} + +// decode_dec decodes |in_len| bytes of decimal data from |in| and updates |bn|. +static int decode_dec(BIGNUM *bn, const char *in, int in_len) { + int i, j; + BN_ULONG l = 0; + + // Decode |BN_DEC_NUM| digits at a time. + j = BN_DEC_NUM - (in_len % BN_DEC_NUM); + if (j == BN_DEC_NUM) { + j = 0; + } + l = 0; + for (i = 0; i < in_len; i++) { + l *= 10; + l += in[i] - '0'; + if (++j == BN_DEC_NUM) { + if (!BN_mul_word(bn, BN_DEC_CONV) || + !BN_add_word(bn, l)) { + return 0; + } + l = 0; + j = 0; + } + } + return 1; +} + +typedef int (*decode_func) (BIGNUM *bn, const char *in, int in_len); +typedef int (*char_test_func) (int c); + +static int bn_x2bn(BIGNUM **outp, const char *in, decode_func decode, char_test_func want_char) { + BIGNUM *ret = NULL; + int neg = 0, i; + int num; + + if (in == NULL || *in == 0) { + return 0; + } + + if (*in == '-') { + neg = 1; + in++; + } + + for (i = 0; want_char((unsigned char)in[i]) && i + neg < INT_MAX; i++) {} + + num = i + neg; + if (outp == NULL) { + return num; + } + + // in is the start of the hex digits, and it is 'i' long + if (*outp == NULL) { + ret = BN_new(); + if (ret == NULL) { + return 0; + } + } else { + ret = *outp; + BN_zero(ret); + } + + if (!decode(ret, in, i)) { + goto err; + } + + bn_set_minimal_width(ret); + if (!BN_is_zero(ret)) { + ret->neg = neg; + } + + *outp = ret; + return num; + +err: + if (*outp == NULL) { + BN_free(ret); + } + + return 0; +} + +int BN_hex2bn(BIGNUM **outp, const char *in) { + return bn_x2bn(outp, in, decode_hex, isxdigit); +} + +char *BN_bn2dec(const BIGNUM *a) { + // It is easier to print strings little-endian, so we assemble it in reverse + // and fix at the end. + BIGNUM *copy = NULL; + CBB cbb; + if (!CBB_init(&cbb, 16) || + !CBB_add_u8(&cbb, 0 /* trailing NUL */)) { + goto cbb_err; + } + + if (BN_is_zero(a)) { + if (!CBB_add_u8(&cbb, '0')) { + goto cbb_err; + } + } else { + copy = BN_dup(a); + if (copy == NULL) { + goto err; + } + + while (!BN_is_zero(copy)) { + BN_ULONG word = BN_div_word(copy, BN_DEC_CONV); + if (word == (BN_ULONG)-1) { + goto err; + } + + const int add_leading_zeros = !BN_is_zero(copy); + for (int i = 0; i < BN_DEC_NUM && (add_leading_zeros || word != 0); i++) { + if (!CBB_add_u8(&cbb, '0' + word % 10)) { + goto cbb_err; + } + word /= 10; + } + assert(word == 0); + } + } + + if (BN_is_negative(a) && + !CBB_add_u8(&cbb, '-')) { + goto cbb_err; + } + + uint8_t *data; + size_t len; + if (!CBB_finish(&cbb, &data, &len)) { + goto cbb_err; + } + + // Reverse the buffer. + for (size_t i = 0; i < len/2; i++) { + uint8_t tmp = data[i]; + data[i] = data[len - 1 - i]; + data[len - 1 - i] = tmp; + } + + BN_free(copy); + return (char *)data; + +cbb_err: + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); +err: + BN_free(copy); + CBB_cleanup(&cbb); + return NULL; +} + +int BN_dec2bn(BIGNUM **outp, const char *in) { + return bn_x2bn(outp, in, decode_dec, isdigit); +} + +int BN_asc2bn(BIGNUM **outp, const char *in) { + const char *const orig_in = in; + if (*in == '-') { + in++; + } + + if (in[0] == '0' && (in[1] == 'X' || in[1] == 'x')) { + if (!BN_hex2bn(outp, in+2)) { + return 0; + } + } else { + if (!BN_dec2bn(outp, in)) { + return 0; + } + } + + if (*orig_in == '-' && !BN_is_zero(*outp)) { + (*outp)->neg = 1; + } + + return 1; +} + +int BN_print(BIO *bp, const BIGNUM *a) { + int i, j, v, z = 0; + int ret = 0; + + if (a->neg && BIO_write(bp, "-", 1) != 1) { + goto end; + } + + if (BN_is_zero(a) && BIO_write(bp, "0", 1) != 1) { + goto end; + } + + for (i = bn_minimal_width(a) - 1; i >= 0; i--) { + for (j = BN_BITS2 - 4; j >= 0; j -= 4) { + // strip leading zeros + v = ((int)(a->d[i] >> (long)j)) & 0x0f; + if (z || v != 0) { + if (BIO_write(bp, &hextable[v], 1) != 1) { + goto end; + } + z = 1; + } + } + } + ret = 1; + +end: + return ret; +} + +int BN_print_fp(FILE *fp, const BIGNUM *a) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + return 0; + } + + int ret = BN_print(b, a); + BIO_free(b); + return ret; +} + + +size_t BN_bn2mpi(const BIGNUM *in, uint8_t *out) { + const size_t bits = BN_num_bits(in); + const size_t bytes = (bits + 7) / 8; + // If the number of bits is a multiple of 8, i.e. if the MSB is set, + // prefix with a zero byte. + int extend = 0; + if (bytes != 0 && (bits & 0x07) == 0) { + extend = 1; + } + + const size_t len = bytes + extend; + if (len < bytes || + 4 + len < len || + (len & 0xffffffff) != len) { + // If we cannot represent the number then we emit zero as the interface + // doesn't allow an error to be signalled. + if (out) { + OPENSSL_memset(out, 0, 4); + } + return 4; + } + + if (out == NULL) { + return 4 + len; + } + + out[0] = len >> 24; + out[1] = len >> 16; + out[2] = len >> 8; + out[3] = len; + if (extend) { + out[4] = 0; + } + BN_bn2bin(in, out + 4 + extend); + if (in->neg && len > 0) { + out[4] |= 0x80; + } + return len + 4; +} + +BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out) { + if (len < 4) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return NULL; + } + const size_t in_len = ((size_t)in[0] << 24) | + ((size_t)in[1] << 16) | + ((size_t)in[2] << 8) | + ((size_t)in[3]); + if (in_len != len - 4) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_ENCODING); + return NULL; + } + + int out_is_alloced = 0; + if (out == NULL) { + out = BN_new(); + if (out == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + out_is_alloced = 1; + } + + if (in_len == 0) { + BN_zero(out); + return out; + } + + in += 4; + if (BN_bin2bn(in, in_len, out) == NULL) { + if (out_is_alloced) { + BN_free(out); + } + return NULL; + } + out->neg = ((*in) & 0x80) != 0; + if (out->neg) { + BN_clear_bit(out, BN_num_bits(out) - 1); + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c new file mode 100644 index 0000000..bcf591c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c @@ -0,0 +1,172 @@ +/* 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" + + +BUF_MEM *BUF_MEM_new(void) { + BUF_MEM *ret; + + ret = OPENSSL_malloc(sizeof(BUF_MEM)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BUF_MEM)); + return ret; +} + +void BUF_MEM_free(BUF_MEM *buf) { + if (buf == NULL) { + return; + } + + OPENSSL_free(buf->data); + OPENSSL_free(buf); +} + +int BUF_MEM_reserve(BUF_MEM *buf, size_t cap) { + if (buf->max >= cap) { + return 1; + } + + size_t n = cap + 3; + if (n < cap) { + // overflow + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + n = n / 3; + size_t alloc_size = n * 4; + if (alloc_size / 4 != n) { + // overflow + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + + char *new_buf = OPENSSL_realloc(buf->data, alloc_size); + if (new_buf == NULL) { + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + + buf->data = new_buf; + buf->max = alloc_size; + return 1; +} + +size_t BUF_MEM_grow(BUF_MEM *buf, size_t len) { + if (!BUF_MEM_reserve(buf, len)) { + return 0; + } + if (buf->length < len) { + OPENSSL_memset(&buf->data[buf->length], 0, len - buf->length); + } + buf->length = len; + return len; +} + +size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len) { + return BUF_MEM_grow(buf, 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); + return 0; + } + if (!BUF_MEM_reserve(buf, new_len)) { + return 0; + } + OPENSSL_memcpy(buf->data + buf->length, in, len); + buf->length = new_len; + return 1; +} + +char *BUF_strdup(const char *str) { return OPENSSL_strdup(str); } + +size_t BUF_strnlen(const char *str, size_t max_len) { + return OPENSSL_strnlen(str, max_len); +} + +char *BUF_strndup(const char *str, size_t size) { + return OPENSSL_strndup(str, size); +} + +size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size) { + return OPENSSL_strlcpy(dst, src, dst_size); +} + +size_t BUF_strlcat(char *dst, const char *src, size_t dst_size) { + return OPENSSL_strlcat(dst, src, dst_size); +} + +void *BUF_memdup(const void *data, size_t size) { + return OPENSSL_memdup(data, size); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back new file mode 100644 index 0000000..bd97dd3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back @@ -0,0 +1,172 @@ +/* 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" + + +BUF_MEM *BUF_MEM_new(void) { + BUF_MEM *ret; + + ret = OPENSSL_malloc(sizeof(BUF_MEM)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BUF_MEM)); + return ret; +} + +void BUF_MEM_free(BUF_MEM *buf) { + if (buf == NULL) { + return; + } + + OPENSSL_free(buf->data); + OPENSSL_free(buf); +} + +int BUF_MEM_reserve(BUF_MEM *buf, size_t cap) { + if (buf->max >= cap) { + return 1; + } + + size_t n = cap + 3; + if (n < cap) { + // overflow + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + n = n / 3; + size_t alloc_size = n * 4; + if (alloc_size / 4 != n) { + // overflow + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + + char *new_buf = OPENSSL_realloc(buf->data, alloc_size); + if (new_buf == NULL) { + OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); + return 0; + } + + buf->data = new_buf; + buf->max = alloc_size; + return 1; +} + +size_t BUF_MEM_grow(BUF_MEM *buf, size_t len) { + if (!BUF_MEM_reserve(buf, len)) { + return 0; + } + if (buf->length < len) { + OPENSSL_memset(&buf->data[buf->length], 0, len - buf->length); + } + buf->length = len; + return len; +} + +size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len) { + return BUF_MEM_grow(buf, 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); + return 0; + } + if (!BUF_MEM_reserve(buf, new_len)) { + return 0; + } + OPENSSL_memcpy(buf->data + buf->length, in, len); + buf->length = new_len; + return 1; +} + +char *BUF_strdup(const char *str) { return OPENSSL_strdup(str); } + +size_t BUF_strnlen(const char *str, size_t max_len) { + return OPENSSL_strnlen(str, max_len); +} + +char *BUF_strndup(const char *str, size_t size) { + return OPENSSL_strndup(str, size); +} + +size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size) { + return OPENSSL_strlcpy(dst, src, dst_size); +} + +size_t BUF_strlcat(char *dst, const char *src, size_t dst_size) { + return OPENSSL_strlcat(dst, src, dst_size); +} + +void *BUF_memdup(const void *data, size_t size) { + return OPENSSL_memdup(data, size); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c new file mode 100644 index 0000000..43696a7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c @@ -0,0 +1,52 @@ +/* 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 "internal.h" +#include "../internal.h" + + +int CBB_finish_i2d(CBB *cbb, uint8_t **outp) { + assert(cbb->base->can_resize); + + uint8_t *der; + size_t der_len; + if (!CBB_finish(cbb, &der, &der_len)) { + CBB_cleanup(cbb); + return -1; + } + if (der_len > INT_MAX) { + OPENSSL_free(der); + return -1; + } + if (outp != NULL) { + if (*outp == NULL) { + *outp = der; + der = NULL; + } else { + OPENSSL_memcpy(*outp, der, der_len); + *outp += der_len; + } + } + OPENSSL_free(der); + return (int)der_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c.grpc_back new file mode 100644 index 0000000..50df9cc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c.grpc_back @@ -0,0 +1,52 @@ +/* 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 "internal.h" +#include "../internal.h" + + +int CBB_finish_i2d(CBB *cbb, uint8_t **outp) { + assert(cbb->base->can_resize); + + uint8_t *der; + size_t der_len; + if (!CBB_finish(cbb, &der, &der_len)) { + CBB_cleanup(cbb); + return -1; + } + if (der_len > INT_MAX) { + OPENSSL_free(der); + return -1; + } + if (outp != NULL) { + if (*outp == NULL) { + *outp = der; + der = NULL; + } else { + OPENSSL_memcpy(*outp, der, der_len); + *outp += der_len; + } + } + OPENSSL_free(der); + return (int)der_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c new file mode 100644 index 0000000..e4a9283 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c @@ -0,0 +1,265 @@ +/* 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 "internal.h" +#include "../internal.h" + + +// kMaxDepth is a just a sanity limit. The code should be such that the length +// of the input being processes always decreases. None the less, a very large +// input could otherwise cause the stack to overflow. +static const unsigned kMaxDepth = 2048; + +// is_string_type returns one if |tag| is a string type and zero otherwise. It +// ignores the constructed bit. +static int is_string_type(unsigned tag) { + switch (tag & ~CBS_ASN1_CONSTRUCTED) { + case CBS_ASN1_BITSTRING: + case CBS_ASN1_OCTETSTRING: + case CBS_ASN1_UTF8STRING: + case CBS_ASN1_NUMERICSTRING: + case CBS_ASN1_PRINTABLESTRING: + case CBS_ASN1_T61STRING: + case CBS_ASN1_VIDEOTEXSTRING: + case CBS_ASN1_IA5STRING: + case CBS_ASN1_GRAPHICSTRING: + case CBS_ASN1_VISIBLESTRING: + case CBS_ASN1_GENERALSTRING: + case CBS_ASN1_UNIVERSALSTRING: + case CBS_ASN1_BMPSTRING: + return 1; + default: + return 0; + } +} + +// cbs_find_ber walks an ASN.1 structure in |orig_in| and sets |*ber_found| +// depending on whether an indefinite length element or constructed string was +// found. The value of |orig_in| is not changed. It returns one on success (i.e. +// |*ber_found| was set) and zero on error. +static int cbs_find_ber(const CBS *orig_in, char *ber_found, unsigned depth) { + CBS in; + + if (depth > kMaxDepth) { + return 0; + } + + CBS_init(&in, CBS_data(orig_in), CBS_len(orig_in)); + *ber_found = 0; + + while (CBS_len(&in) > 0) { + CBS contents; + unsigned tag; + size_t header_len; + + if (!CBS_get_any_ber_asn1_element(&in, &contents, &tag, &header_len)) { + return 0; + } + if (CBS_len(&contents) == header_len && + header_len > 0 && + CBS_data(&contents)[header_len-1] == 0x80) { + // Found an indefinite-length element. + *ber_found = 1; + return 1; + } + if (tag & CBS_ASN1_CONSTRUCTED) { + if (is_string_type(tag)) { + // Constructed strings are only legal in BER and require conversion. + *ber_found = 1; + return 1; + } + if (!CBS_skip(&contents, header_len) || + !cbs_find_ber(&contents, ber_found, depth + 1)) { + return 0; + } + } + } + + return 1; +} + +// is_eoc returns true if |header_len| and |contents|, as returned by +// |CBS_get_any_ber_asn1_element|, indicate an "end of contents" (EOC) value. +static char is_eoc(size_t header_len, CBS *contents) { + return header_len == 2 && CBS_len(contents) == 2 && + OPENSSL_memcmp(CBS_data(contents), "\x00\x00", 2) == 0; +} + +// cbs_convert_ber reads BER data from |in| and writes DER data to |out|. If +// |string_tag| is non-zero, then all elements must match |string_tag| up to the +// constructed bit and primitive element bodies are written to |out| without +// element headers. This is used when concatenating the fragments of a +// constructed string. If |looking_for_eoc| is set then any EOC elements found +// will cause the function to return after consuming it. It returns one on +// success and zero on error. +static int cbs_convert_ber(CBS *in, CBB *out, unsigned string_tag, + char looking_for_eoc, unsigned depth) { + assert(!(string_tag & CBS_ASN1_CONSTRUCTED)); + + if (depth > kMaxDepth) { + return 0; + } + + while (CBS_len(in) > 0) { + CBS contents; + unsigned tag, child_string_tag = string_tag; + size_t header_len; + CBB *out_contents, out_contents_storage; + + if (!CBS_get_any_ber_asn1_element(in, &contents, &tag, &header_len)) { + return 0; + } + + if (is_eoc(header_len, &contents)) { + return looking_for_eoc; + } + + if (string_tag != 0) { + // This is part of a constructed string. All elements must match + // |string_tag| up to the constructed bit and get appended to |out| + // without a child element. + if ((tag & ~CBS_ASN1_CONSTRUCTED) != string_tag) { + return 0; + } + out_contents = out; + } else { + unsigned out_tag = tag; + if ((tag & CBS_ASN1_CONSTRUCTED) && is_string_type(tag)) { + // If a constructed string, clear the constructed bit and inform + // children to concatenate bodies. + out_tag &= ~CBS_ASN1_CONSTRUCTED; + child_string_tag = out_tag; + } + if (!CBB_add_asn1(out, &out_contents_storage, out_tag)) { + return 0; + } + out_contents = &out_contents_storage; + } + + if (CBS_len(&contents) == header_len && header_len > 0 && + CBS_data(&contents)[header_len - 1] == 0x80) { + // This is an indefinite length element. + if (!cbs_convert_ber(in, out_contents, child_string_tag, + 1 /* looking for eoc */, depth + 1) || + !CBB_flush(out)) { + return 0; + } + continue; + } + + if (!CBS_skip(&contents, header_len)) { + return 0; + } + + if (tag & CBS_ASN1_CONSTRUCTED) { + // Recurse into children. + if (!cbs_convert_ber(&contents, out_contents, child_string_tag, + 0 /* not looking for eoc */, depth + 1)) { + return 0; + } + } else { + // Copy primitive contents as-is. + if (!CBB_add_bytes(out_contents, CBS_data(&contents), + CBS_len(&contents))) { + return 0; + } + } + + if (!CBB_flush(out)) { + return 0; + } + } + + return looking_for_eoc == 0; +} + +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 + // time we hope that there aren't any and thus we can quickly return. + char conversion_needed; + if (!cbs_find_ber(in, &conversion_needed, 0)) { + return 0; + } + + if (!conversion_needed) { + 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_storage, &len)) { + CBB_cleanup(&cbb); + return 0; + } + + CBS_init(out, *out_storage, len); + return 1; +} + +int CBS_get_asn1_implicit_string(CBS *in, CBS *out, uint8_t **out_storage, + unsigned outer_tag, unsigned inner_tag) { + assert(!(outer_tag & CBS_ASN1_CONSTRUCTED)); + assert(!(inner_tag & CBS_ASN1_CONSTRUCTED)); + assert(is_string_type(inner_tag)); + + if (CBS_peek_asn1_tag(in, outer_tag)) { + // Normal implicitly-tagged string. + *out_storage = NULL; + return CBS_get_asn1(in, out, outer_tag); + } + + // Otherwise, try to parse an implicitly-tagged constructed string. + // |CBS_asn1_ber_to_der| is assumed to have run, so only allow one level deep + // of nesting. + CBB result; + CBS child; + if (!CBB_init(&result, CBS_len(in)) || + !CBS_get_asn1(in, &child, outer_tag | CBS_ASN1_CONSTRUCTED)) { + goto err; + } + + while (CBS_len(&child) > 0) { + CBS chunk; + if (!CBS_get_asn1(&child, &chunk, inner_tag) || + !CBB_add_bytes(&result, CBS_data(&chunk), CBS_len(&chunk))) { + goto err; + } + } + + uint8_t *data; + size_t len; + if (!CBB_finish(&result, &data, &len)) { + goto err; + } + + CBS_init(out, data, len); + *out_storage = data; + return 1; + +err: + CBB_cleanup(&result); + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back new file mode 100644 index 0000000..7437239 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back @@ -0,0 +1,265 @@ +/* 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 "internal.h" +#include "../internal.h" + + +// kMaxDepth is a just a sanity limit. The code should be such that the length +// of the input being processes always decreases. None the less, a very large +// input could otherwise cause the stack to overflow. +static const unsigned kMaxDepth = 2048; + +// is_string_type returns one if |tag| is a string type and zero otherwise. It +// ignores the constructed bit. +static int is_string_type(unsigned tag) { + switch (tag & ~CBS_ASN1_CONSTRUCTED) { + case CBS_ASN1_BITSTRING: + case CBS_ASN1_OCTETSTRING: + case CBS_ASN1_UTF8STRING: + case CBS_ASN1_NUMERICSTRING: + case CBS_ASN1_PRINTABLESTRING: + case CBS_ASN1_T61STRING: + case CBS_ASN1_VIDEOTEXSTRING: + case CBS_ASN1_IA5STRING: + case CBS_ASN1_GRAPHICSTRING: + case CBS_ASN1_VISIBLESTRING: + case CBS_ASN1_GENERALSTRING: + case CBS_ASN1_UNIVERSALSTRING: + case CBS_ASN1_BMPSTRING: + return 1; + default: + return 0; + } +} + +// cbs_find_ber walks an ASN.1 structure in |orig_in| and sets |*ber_found| +// depending on whether an indefinite length element or constructed string was +// found. The value of |orig_in| is not changed. It returns one on success (i.e. +// |*ber_found| was set) and zero on error. +static int cbs_find_ber(const CBS *orig_in, char *ber_found, unsigned depth) { + CBS in; + + if (depth > kMaxDepth) { + return 0; + } + + CBS_init(&in, CBS_data(orig_in), CBS_len(orig_in)); + *ber_found = 0; + + while (CBS_len(&in) > 0) { + CBS contents; + unsigned tag; + size_t header_len; + + if (!CBS_get_any_ber_asn1_element(&in, &contents, &tag, &header_len)) { + return 0; + } + if (CBS_len(&contents) == header_len && + header_len > 0 && + CBS_data(&contents)[header_len-1] == 0x80) { + // Found an indefinite-length element. + *ber_found = 1; + return 1; + } + if (tag & CBS_ASN1_CONSTRUCTED) { + if (is_string_type(tag)) { + // Constructed strings are only legal in BER and require conversion. + *ber_found = 1; + return 1; + } + if (!CBS_skip(&contents, header_len) || + !cbs_find_ber(&contents, ber_found, depth + 1)) { + return 0; + } + } + } + + return 1; +} + +// is_eoc returns true if |header_len| and |contents|, as returned by +// |CBS_get_any_ber_asn1_element|, indicate an "end of contents" (EOC) value. +static char is_eoc(size_t header_len, CBS *contents) { + return header_len == 2 && CBS_len(contents) == 2 && + OPENSSL_memcmp(CBS_data(contents), "\x00\x00", 2) == 0; +} + +// cbs_convert_ber reads BER data from |in| and writes DER data to |out|. If +// |string_tag| is non-zero, then all elements must match |string_tag| up to the +// constructed bit and primitive element bodies are written to |out| without +// element headers. This is used when concatenating the fragments of a +// constructed string. If |looking_for_eoc| is set then any EOC elements found +// will cause the function to return after consuming it. It returns one on +// success and zero on error. +static int cbs_convert_ber(CBS *in, CBB *out, unsigned string_tag, + char looking_for_eoc, unsigned depth) { + assert(!(string_tag & CBS_ASN1_CONSTRUCTED)); + + if (depth > kMaxDepth) { + return 0; + } + + while (CBS_len(in) > 0) { + CBS contents; + unsigned tag, child_string_tag = string_tag; + size_t header_len; + CBB *out_contents, out_contents_storage; + + if (!CBS_get_any_ber_asn1_element(in, &contents, &tag, &header_len)) { + return 0; + } + + if (is_eoc(header_len, &contents)) { + return looking_for_eoc; + } + + if (string_tag != 0) { + // This is part of a constructed string. All elements must match + // |string_tag| up to the constructed bit and get appended to |out| + // without a child element. + if ((tag & ~CBS_ASN1_CONSTRUCTED) != string_tag) { + return 0; + } + out_contents = out; + } else { + unsigned out_tag = tag; + if ((tag & CBS_ASN1_CONSTRUCTED) && is_string_type(tag)) { + // If a constructed string, clear the constructed bit and inform + // children to concatenate bodies. + out_tag &= ~CBS_ASN1_CONSTRUCTED; + child_string_tag = out_tag; + } + if (!CBB_add_asn1(out, &out_contents_storage, out_tag)) { + return 0; + } + out_contents = &out_contents_storage; + } + + if (CBS_len(&contents) == header_len && header_len > 0 && + CBS_data(&contents)[header_len - 1] == 0x80) { + // This is an indefinite length element. + if (!cbs_convert_ber(in, out_contents, child_string_tag, + 1 /* looking for eoc */, depth + 1) || + !CBB_flush(out)) { + return 0; + } + continue; + } + + if (!CBS_skip(&contents, header_len)) { + return 0; + } + + if (tag & CBS_ASN1_CONSTRUCTED) { + // Recurse into children. + if (!cbs_convert_ber(&contents, out_contents, child_string_tag, + 0 /* not looking for eoc */, depth + 1)) { + return 0; + } + } else { + // Copy primitive contents as-is. + if (!CBB_add_bytes(out_contents, CBS_data(&contents), + CBS_len(&contents))) { + return 0; + } + } + + if (!CBB_flush(out)) { + return 0; + } + } + + return looking_for_eoc == 0; +} + +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 + // time we hope that there aren't any and thus we can quickly return. + char conversion_needed; + if (!cbs_find_ber(in, &conversion_needed, 0)) { + return 0; + } + + if (!conversion_needed) { + 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_storage, &len)) { + CBB_cleanup(&cbb); + return 0; + } + + CBS_init(out, *out_storage, len); + return 1; +} + +int CBS_get_asn1_implicit_string(CBS *in, CBS *out, uint8_t **out_storage, + unsigned outer_tag, unsigned inner_tag) { + assert(!(outer_tag & CBS_ASN1_CONSTRUCTED)); + assert(!(inner_tag & CBS_ASN1_CONSTRUCTED)); + assert(is_string_type(inner_tag)); + + if (CBS_peek_asn1_tag(in, outer_tag)) { + // Normal implicitly-tagged string. + *out_storage = NULL; + return CBS_get_asn1(in, out, outer_tag); + } + + // Otherwise, try to parse an implicitly-tagged constructed string. + // |CBS_asn1_ber_to_der| is assumed to have run, so only allow one level deep + // of nesting. + CBB result; + CBS child; + if (!CBB_init(&result, CBS_len(in)) || + !CBS_get_asn1(in, &child, outer_tag | CBS_ASN1_CONSTRUCTED)) { + goto err; + } + + while (CBS_len(&child) > 0) { + CBS chunk; + if (!CBS_get_asn1(&child, &chunk, inner_tag) || + !CBB_add_bytes(&result, CBS_data(&chunk), CBS_len(&chunk))) { + goto err; + } + } + + uint8_t *data; + size_t len; + if (!CBB_finish(&result, &data, &len)) { + goto err; + } + + CBS_init(out, data, len); + *out_storage = data; + return 1; + +err: + CBB_cleanup(&result); + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c new file mode 100644 index 0000000..1b7ae10 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c @@ -0,0 +1,719 @@ +/* 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 "../internal.h" + + +void CBB_zero(CBB *cbb) { + OPENSSL_memset(cbb, 0, sizeof(CBB)); +} + +static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { + // This assumes that |cbb| has already been zeroed. + struct cbb_buffer_st *base; + + base = OPENSSL_malloc(sizeof(struct cbb_buffer_st)); + if (base == NULL) { + return 0; + } + + base->buf = buf; + base->len = 0; + base->cap = cap; + base->can_resize = 1; + base->error = 0; + + cbb->base = base; + cbb->is_child = 0; + return 1; +} + +int CBB_init(CBB *cbb, size_t initial_capacity) { + CBB_zero(cbb); + + uint8_t *buf = OPENSSL_malloc(initial_capacity); + if (initial_capacity > 0 && buf == NULL) { + return 0; + } + + if (!cbb_init(cbb, buf, initial_capacity)) { + OPENSSL_free(buf); + return 0; + } + + return 1; +} + +int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { + CBB_zero(cbb); + + if (!cbb_init(cbb, buf, len)) { + return 0; + } + + cbb->base->can_resize = 0; + return 1; +} + +void CBB_cleanup(CBB *cbb) { + // 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); + } + OPENSSL_free(cbb->base); + } + cbb->base = NULL; +} + +static int cbb_buffer_reserve(struct cbb_buffer_st *base, uint8_t **out, + size_t len) { + size_t newlen; + + if (base == NULL) { + return 0; + } + + newlen = base->len + len; + if (newlen < base->len) { + // Overflow + goto err; + } + + if (newlen > base->cap) { + size_t newcap = base->cap * 2; + uint8_t *newbuf; + + if (!base->can_resize) { + goto err; + } + + if (newcap < base->cap || newcap < newlen) { + newcap = newlen; + } + newbuf = OPENSSL_realloc(base->buf, newcap); + if (newbuf == NULL) { + goto err; + } + + base->buf = newbuf; + base->cap = newcap; + } + + if (out) { + *out = base->buf + base->len; + } + + return 1; + +err: + base->error = 1; + return 0; +} + +static int cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out, + size_t len) { + if (!cbb_buffer_reserve(base, out, len)) { + return 0; + } + // This will not overflow or |cbb_buffer_reserve| would have failed. + base->len += len; + return 1; +} + +static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint64_t v, + size_t len_len) { + if (len_len == 0) { + return 1; + } + + uint8_t *buf; + if (!cbb_buffer_add(base, &buf, len_len)) { + return 0; + } + + for (size_t i = len_len - 1; i < len_len; i--) { + buf[i] = v; + v >>= 8; + } + + if (v != 0) { + base->error = 1; + return 0; + } + + return 1; +} + +int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) { + if (cbb->is_child) { + return 0; + } + + if (!CBB_flush(cbb)) { + return 0; + } + + if (cbb->base->can_resize && (out_data == NULL || out_len == NULL)) { + // |out_data| and |out_len| can only be NULL if the CBB is fixed. + return 0; + } + + if (out_data != NULL) { + *out_data = cbb->base->buf; + } + if (out_len != NULL) { + *out_len = cbb->base->len; + } + cbb->base->buf = NULL; + CBB_cleanup(cbb); + return 1; +} + +// CBB_flush recurses and then writes out any pending length prefix. The +// current length of the underlying base is taken to be the length of the +// length-prefixed data. +int CBB_flush(CBB *cbb) { + size_t child_start, i, len; + + // If |cbb->base| has hit an error, the buffer is in an undefined state, so + // fail all following calls. In particular, |cbb->child| may point to invalid + // memory. + if (cbb->base == NULL || cbb->base->error) { + return 0; + } + + if (cbb->child == NULL || cbb->child->pending_len_len == 0) { + return 1; + } + + child_start = cbb->child->offset + cbb->child->pending_len_len; + + if (!CBB_flush(cbb->child) || + child_start < cbb->child->offset || + cbb->base->len < child_start) { + goto err; + } + + len = cbb->base->len - child_start; + + if (cbb->child->pending_is_asn1) { + // For ASN.1 we assume that we'll only need a single byte for the length. + // If that turned out to be incorrect, we have to move the contents along + // in order to make space. + uint8_t len_len; + uint8_t initial_length_byte; + + assert (cbb->child->pending_len_len == 1); + + if (len > 0xfffffffe) { + // Too large. + goto err; + } else if (len > 0xffffff) { + len_len = 5; + initial_length_byte = 0x80 | 4; + } else if (len > 0xffff) { + len_len = 4; + initial_length_byte = 0x80 | 3; + } else if (len > 0xff) { + len_len = 3; + initial_length_byte = 0x80 | 2; + } else if (len > 0x7f) { + len_len = 2; + initial_length_byte = 0x80 | 1; + } else { + len_len = 1; + initial_length_byte = (uint8_t)len; + len = 0; + } + + if (len_len != 1) { + // We need to move the contents along in order to make space. + size_t extra_bytes = len_len - 1; + if (!cbb_buffer_add(cbb->base, NULL, extra_bytes)) { + goto err; + } + OPENSSL_memmove(cbb->base->buf + child_start + extra_bytes, + cbb->base->buf + child_start, len); + } + cbb->base->buf[cbb->child->offset++] = initial_length_byte; + cbb->child->pending_len_len = len_len - 1; + } + + for (i = cbb->child->pending_len_len - 1; i < cbb->child->pending_len_len; + i--) { + cbb->base->buf[cbb->child->offset + i] = (uint8_t)len; + len >>= 8; + } + if (len != 0) { + goto err; + } + + cbb->child->base = NULL; + cbb->child = NULL; + + return 1; + +err: + cbb->base->error = 1; + return 0; +} + +const uint8_t *CBB_data(const CBB *cbb) { + assert(cbb->child == NULL); + return cbb->base->buf + cbb->offset + cbb->pending_len_len; +} + +size_t CBB_len(const CBB *cbb) { + assert(cbb->child == NULL); + assert(cbb->offset + cbb->pending_len_len <= cbb->base->len); + + return cbb->base->len - cbb->offset - cbb->pending_len_len; +} + +static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, + uint8_t len_len) { + uint8_t *prefix_bytes; + + if (!CBB_flush(cbb)) { + return 0; + } + + size_t offset = cbb->base->len; + if (!cbb_buffer_add(cbb->base, &prefix_bytes, len_len)) { + return 0; + } + + 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; + cbb->child->pending_is_asn1 = 0; + + return 1; +} + +int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 1); +} + +int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 2); +} + +int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 3); +} + +// add_base128_integer encodes |v| as a big-endian base-128 integer where the +// high bit of each byte indicates where there is more data. This is the +// encoding used in DER for both high tag number form and OID components. +static int add_base128_integer(CBB *cbb, uint64_t v) { + unsigned len_len = 0; + uint64_t copy = v; + while (copy > 0) { + len_len++; + copy >>= 7; + } + if (len_len == 0) { + len_len = 1; // Zero is encoded with one byte. + } + for (unsigned i = len_len - 1; i < len_len; i--) { + uint8_t byte = (v >> (7 * i)) & 0x7f; + if (i != 0) { + // The high bit denotes whether there is more data. + byte |= 0x80; + } + if (!CBB_add_u8(cbb, byte)) { + return 0; + } + } + return 1; +} + +int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag) { + if (!CBB_flush(cbb)) { + return 0; + } + + // Split the tag into leading bits and tag number. + uint8_t tag_bits = (tag >> CBS_ASN1_TAG_SHIFT) & 0xe0; + unsigned tag_number = tag & CBS_ASN1_TAG_NUMBER_MASK; + if (tag_number >= 0x1f) { + // Set all the bits in the tag number to signal high tag number form. + if (!CBB_add_u8(cbb, tag_bits | 0x1f) || + !add_base128_integer(cbb, tag_number)) { + return 0; + } + } else if (!CBB_add_u8(cbb, tag_bits | tag_number)) { + return 0; + } + + size_t offset = cbb->base->len; + if (!CBB_add_u8(cbb, 0)) { + return 0; + } + + 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; + cbb->child->pending_is_asn1 = 1; + + return 1; +} + +int CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) { + uint8_t *dest; + + if (!CBB_flush(cbb) || + !cbb_buffer_add(cbb->base, &dest, len)) { + return 0; + } + OPENSSL_memcpy(dest, data, len); + return 1; +} + +int CBB_add_space(CBB *cbb, uint8_t **out_data, size_t len) { + if (!CBB_flush(cbb) || + !cbb_buffer_add(cbb->base, out_data, len)) { + return 0; + } + return 1; +} + +int CBB_reserve(CBB *cbb, uint8_t **out_data, size_t len) { + if (!CBB_flush(cbb) || + !cbb_buffer_reserve(cbb->base, out_data, len)) { + return 0; + } + return 1; +} + +int CBB_did_write(CBB *cbb, size_t len) { + size_t newlen = cbb->base->len + len; + if (cbb->child != NULL || + newlen < cbb->base->len || + newlen > cbb->base->cap) { + return 0; + } + cbb->base->len = newlen; + return 1; +} + +int CBB_add_u8(CBB *cbb, uint8_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + return cbb_buffer_add_u(cbb->base, value, 1); +} + +int CBB_add_u16(CBB *cbb, uint16_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + 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; + } + + return cbb_buffer_add_u(cbb->base, value, 3); +} + +int CBB_add_u32(CBB *cbb, uint32_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + 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; + } + + cbb->base->len = cbb->child->offset; + + cbb->child->base = NULL; + cbb->child = NULL; +} + +int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) { + CBB child; + int started = 0; + + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER)) { + return 0; + } + + for (size_t i = 0; i < 8; i++) { + uint8_t byte = (value >> 8*(7-i)) & 0xff; + if (!started) { + if (byte == 0) { + // Don't encode leading zeros. + continue; + } + // If the high bit is set, add a padding byte to make it + // unsigned. + if ((byte & 0x80) && !CBB_add_u8(&child, 0)) { + return 0; + } + started = 1; + } + if (!CBB_add_u8(&child, byte)) { + return 0; + } + } + + // 0 is encoded as a single 0, not the empty string. + if (!started && !CBB_add_u8(&child, 0)) { + return 0; + } + + 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) || + !CBB_add_bytes(&child, data, data_len) || + !CBB_flush(cbb)) { + return 0; + } + + return 1; +} + +int CBB_add_asn1_bool(CBB *cbb, int value) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_BOOLEAN) || + !CBB_add_u8(&child, value != 0 ? 0xff : 0) || + !CBB_flush(cbb)) { + return 0; + } + + return 1; +} + +// parse_dotted_decimal parses one decimal component from |cbs|, where |cbs| is +// an OID literal, e.g., "1.2.840.113554.4.1.72585". It consumes both the +// component and the dot, so |cbs| may be passed into the function again for the +// next value. +static int parse_dotted_decimal(CBS *cbs, uint64_t *out) { + *out = 0; + int seen_digit = 0; + for (;;) { + // Valid terminators for a component are the end of the string or a + // non-terminal dot. If the string ends with a dot, this is not a valid OID + // string. + uint8_t u; + if (!CBS_get_u8(cbs, &u) || + (u == '.' && CBS_len(cbs) > 0)) { + break; + } + if (u < '0' || u > '9' || + // Forbid stray leading zeros. + (seen_digit && *out == 0) || + // Check for overflow. + *out > UINT64_MAX / 10 || + *out * 10 > UINT64_MAX - (u - '0')) { + return 0; + } + *out = *out * 10 + (u - '0'); + seen_digit = 1; + } + // The empty string is not a legal OID component. + return seen_digit; +} + +int CBB_add_asn1_oid_from_text(CBB *cbb, const char *text, size_t len) { + if (!CBB_flush(cbb)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, (const uint8_t *)text, len); + + // OIDs must have at least two components. + uint64_t a, b; + if (!parse_dotted_decimal(&cbs, &a) || + !parse_dotted_decimal(&cbs, &b)) { + return 0; + } + + // The first component is encoded as 40 * |a| + |b|. This assumes that |a| is + // 0, 1, or 2 and that, when it is 0 or 1, |b| is at most 39. + if (a > 2 || + (a < 2 && b > 39) || + b > UINT64_MAX - 80 || + !add_base128_integer(cbb, 40u * a + b)) { + return 0; + } + + // The remaining components are encoded unmodified. + while (CBS_len(&cbs) > 0) { + if (!parse_dotted_decimal(&cbs, &a) || + !add_base128_integer(cbb, a)) { + return 0; + } + } + + return 1; +} + +static int compare_set_of_element(const void *a_ptr, const void *b_ptr) { + // See X.690, section 11.6 for the ordering. They are sorted in ascending + // order by their DER encoding. + const CBS *a = a_ptr, *b = b_ptr; + size_t a_len = CBS_len(a), b_len = CBS_len(b); + size_t min_len = a_len < b_len ? a_len : b_len; + int ret = OPENSSL_memcmp(CBS_data(a), CBS_data(b), min_len); + if (ret != 0) { + return ret; + } + if (a_len == b_len) { + return 0; + } + // If one is a prefix of the other, the shorter one sorts first. (This is not + // actually reachable. No DER encoding is a prefix of another DER encoding.) + return a_len < b_len ? -1 : 1; +} + +int CBB_flush_asn1_set_of(CBB *cbb) { + if (!CBB_flush(cbb)) { + return 0; + } + + CBS cbs; + size_t num_children = 0; + CBS_init(&cbs, CBB_data(cbb), CBB_len(cbb)); + while (CBS_len(&cbs) != 0) { + if (!CBS_get_any_asn1_element(&cbs, NULL, NULL, NULL)) { + return 0; + } + num_children++; + } + + if (num_children < 2) { + return 1; // Nothing to do. This is the common case for X.509. + } + if (num_children > ((size_t)-1) / sizeof(CBS)) { + return 0; // Overflow. + } + + // Parse out the children and sort. We alias them into a copy of so they + // remain valid as we rewrite |cbb|. + int ret = 0; + size_t buf_len = CBB_len(cbb); + 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; + } + CBS_init(&cbs, buf, buf_len); + for (size_t i = 0; i < num_children; i++) { + if (!CBS_get_any_asn1_element(&cbs, &children[i], NULL, NULL)) { + goto err; + } + } + qsort(children, num_children, sizeof(CBS), compare_set_of_element); + + // Rewind |cbb| and write the contents back in the new order. + cbb->base->len = cbb->offset + cbb->pending_len_len; + for (size_t i = 0; i < num_children; i++) { + if (!CBB_add_bytes(cbb, CBS_data(&children[i]), CBS_len(&children[i]))) { + goto err; + } + } + assert(CBB_len(cbb) == buf_len); + + ret = 1; + +err: + OPENSSL_free(buf); + OPENSSL_free(children); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back new file mode 100644 index 0000000..efb89c7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back @@ -0,0 +1,719 @@ +/* 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 "../internal.h" + + +void CBB_zero(CBB *cbb) { + OPENSSL_memset(cbb, 0, sizeof(CBB)); +} + +static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { + // This assumes that |cbb| has already been zeroed. + struct cbb_buffer_st *base; + + base = OPENSSL_malloc(sizeof(struct cbb_buffer_st)); + if (base == NULL) { + return 0; + } + + base->buf = buf; + base->len = 0; + base->cap = cap; + base->can_resize = 1; + base->error = 0; + + cbb->base = base; + cbb->is_child = 0; + return 1; +} + +int CBB_init(CBB *cbb, size_t initial_capacity) { + CBB_zero(cbb); + + uint8_t *buf = OPENSSL_malloc(initial_capacity); + if (initial_capacity > 0 && buf == NULL) { + return 0; + } + + if (!cbb_init(cbb, buf, initial_capacity)) { + OPENSSL_free(buf); + return 0; + } + + return 1; +} + +int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { + CBB_zero(cbb); + + if (!cbb_init(cbb, buf, len)) { + return 0; + } + + cbb->base->can_resize = 0; + return 1; +} + +void CBB_cleanup(CBB *cbb) { + // 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); + } + OPENSSL_free(cbb->base); + } + cbb->base = NULL; +} + +static int cbb_buffer_reserve(struct cbb_buffer_st *base, uint8_t **out, + size_t len) { + size_t newlen; + + if (base == NULL) { + return 0; + } + + newlen = base->len + len; + if (newlen < base->len) { + // Overflow + goto err; + } + + if (newlen > base->cap) { + size_t newcap = base->cap * 2; + uint8_t *newbuf; + + if (!base->can_resize) { + goto err; + } + + if (newcap < base->cap || newcap < newlen) { + newcap = newlen; + } + newbuf = OPENSSL_realloc(base->buf, newcap); + if (newbuf == NULL) { + goto err; + } + + base->buf = newbuf; + base->cap = newcap; + } + + if (out) { + *out = base->buf + base->len; + } + + return 1; + +err: + base->error = 1; + return 0; +} + +static int cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out, + size_t len) { + if (!cbb_buffer_reserve(base, out, len)) { + return 0; + } + // This will not overflow or |cbb_buffer_reserve| would have failed. + base->len += len; + return 1; +} + +static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint64_t v, + size_t len_len) { + if (len_len == 0) { + return 1; + } + + uint8_t *buf; + if (!cbb_buffer_add(base, &buf, len_len)) { + return 0; + } + + for (size_t i = len_len - 1; i < len_len; i--) { + buf[i] = v; + v >>= 8; + } + + if (v != 0) { + base->error = 1; + return 0; + } + + return 1; +} + +int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) { + if (cbb->is_child) { + return 0; + } + + if (!CBB_flush(cbb)) { + return 0; + } + + if (cbb->base->can_resize && (out_data == NULL || out_len == NULL)) { + // |out_data| and |out_len| can only be NULL if the CBB is fixed. + return 0; + } + + if (out_data != NULL) { + *out_data = cbb->base->buf; + } + if (out_len != NULL) { + *out_len = cbb->base->len; + } + cbb->base->buf = NULL; + CBB_cleanup(cbb); + return 1; +} + +// CBB_flush recurses and then writes out any pending length prefix. The +// current length of the underlying base is taken to be the length of the +// length-prefixed data. +int CBB_flush(CBB *cbb) { + size_t child_start, i, len; + + // If |cbb->base| has hit an error, the buffer is in an undefined state, so + // fail all following calls. In particular, |cbb->child| may point to invalid + // memory. + if (cbb->base == NULL || cbb->base->error) { + return 0; + } + + if (cbb->child == NULL || cbb->child->pending_len_len == 0) { + return 1; + } + + child_start = cbb->child->offset + cbb->child->pending_len_len; + + if (!CBB_flush(cbb->child) || + child_start < cbb->child->offset || + cbb->base->len < child_start) { + goto err; + } + + len = cbb->base->len - child_start; + + if (cbb->child->pending_is_asn1) { + // For ASN.1 we assume that we'll only need a single byte for the length. + // If that turned out to be incorrect, we have to move the contents along + // in order to make space. + uint8_t len_len; + uint8_t initial_length_byte; + + assert (cbb->child->pending_len_len == 1); + + if (len > 0xfffffffe) { + // Too large. + goto err; + } else if (len > 0xffffff) { + len_len = 5; + initial_length_byte = 0x80 | 4; + } else if (len > 0xffff) { + len_len = 4; + initial_length_byte = 0x80 | 3; + } else if (len > 0xff) { + len_len = 3; + initial_length_byte = 0x80 | 2; + } else if (len > 0x7f) { + len_len = 2; + initial_length_byte = 0x80 | 1; + } else { + len_len = 1; + initial_length_byte = (uint8_t)len; + len = 0; + } + + if (len_len != 1) { + // We need to move the contents along in order to make space. + size_t extra_bytes = len_len - 1; + if (!cbb_buffer_add(cbb->base, NULL, extra_bytes)) { + goto err; + } + OPENSSL_memmove(cbb->base->buf + child_start + extra_bytes, + cbb->base->buf + child_start, len); + } + cbb->base->buf[cbb->child->offset++] = initial_length_byte; + cbb->child->pending_len_len = len_len - 1; + } + + for (i = cbb->child->pending_len_len - 1; i < cbb->child->pending_len_len; + i--) { + cbb->base->buf[cbb->child->offset + i] = (uint8_t)len; + len >>= 8; + } + if (len != 0) { + goto err; + } + + cbb->child->base = NULL; + cbb->child = NULL; + + return 1; + +err: + cbb->base->error = 1; + return 0; +} + +const uint8_t *CBB_data(const CBB *cbb) { + assert(cbb->child == NULL); + return cbb->base->buf + cbb->offset + cbb->pending_len_len; +} + +size_t CBB_len(const CBB *cbb) { + assert(cbb->child == NULL); + assert(cbb->offset + cbb->pending_len_len <= cbb->base->len); + + return cbb->base->len - cbb->offset - cbb->pending_len_len; +} + +static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, + uint8_t len_len) { + uint8_t *prefix_bytes; + + if (!CBB_flush(cbb)) { + return 0; + } + + size_t offset = cbb->base->len; + if (!cbb_buffer_add(cbb->base, &prefix_bytes, len_len)) { + return 0; + } + + 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; + cbb->child->pending_is_asn1 = 0; + + return 1; +} + +int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 1); +} + +int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 2); +} + +int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents) { + return cbb_add_length_prefixed(cbb, out_contents, 3); +} + +// add_base128_integer encodes |v| as a big-endian base-128 integer where the +// high bit of each byte indicates where there is more data. This is the +// encoding used in DER for both high tag number form and OID components. +static int add_base128_integer(CBB *cbb, uint64_t v) { + unsigned len_len = 0; + uint64_t copy = v; + while (copy > 0) { + len_len++; + copy >>= 7; + } + if (len_len == 0) { + len_len = 1; // Zero is encoded with one byte. + } + for (unsigned i = len_len - 1; i < len_len; i--) { + uint8_t byte = (v >> (7 * i)) & 0x7f; + if (i != 0) { + // The high bit denotes whether there is more data. + byte |= 0x80; + } + if (!CBB_add_u8(cbb, byte)) { + return 0; + } + } + return 1; +} + +int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag) { + if (!CBB_flush(cbb)) { + return 0; + } + + // Split the tag into leading bits and tag number. + uint8_t tag_bits = (tag >> CBS_ASN1_TAG_SHIFT) & 0xe0; + unsigned tag_number = tag & CBS_ASN1_TAG_NUMBER_MASK; + if (tag_number >= 0x1f) { + // Set all the bits in the tag number to signal high tag number form. + if (!CBB_add_u8(cbb, tag_bits | 0x1f) || + !add_base128_integer(cbb, tag_number)) { + return 0; + } + } else if (!CBB_add_u8(cbb, tag_bits | tag_number)) { + return 0; + } + + size_t offset = cbb->base->len; + if (!CBB_add_u8(cbb, 0)) { + return 0; + } + + 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; + cbb->child->pending_is_asn1 = 1; + + return 1; +} + +int CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) { + uint8_t *dest; + + if (!CBB_flush(cbb) || + !cbb_buffer_add(cbb->base, &dest, len)) { + return 0; + } + OPENSSL_memcpy(dest, data, len); + return 1; +} + +int CBB_add_space(CBB *cbb, uint8_t **out_data, size_t len) { + if (!CBB_flush(cbb) || + !cbb_buffer_add(cbb->base, out_data, len)) { + return 0; + } + return 1; +} + +int CBB_reserve(CBB *cbb, uint8_t **out_data, size_t len) { + if (!CBB_flush(cbb) || + !cbb_buffer_reserve(cbb->base, out_data, len)) { + return 0; + } + return 1; +} + +int CBB_did_write(CBB *cbb, size_t len) { + size_t newlen = cbb->base->len + len; + if (cbb->child != NULL || + newlen < cbb->base->len || + newlen > cbb->base->cap) { + return 0; + } + cbb->base->len = newlen; + return 1; +} + +int CBB_add_u8(CBB *cbb, uint8_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + return cbb_buffer_add_u(cbb->base, value, 1); +} + +int CBB_add_u16(CBB *cbb, uint16_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + 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; + } + + return cbb_buffer_add_u(cbb->base, value, 3); +} + +int CBB_add_u32(CBB *cbb, uint32_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + + 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; + } + + cbb->base->len = cbb->child->offset; + + cbb->child->base = NULL; + cbb->child = NULL; +} + +int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) { + CBB child; + int started = 0; + + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER)) { + return 0; + } + + for (size_t i = 0; i < 8; i++) { + uint8_t byte = (value >> 8*(7-i)) & 0xff; + if (!started) { + if (byte == 0) { + // Don't encode leading zeros. + continue; + } + // If the high bit is set, add a padding byte to make it + // unsigned. + if ((byte & 0x80) && !CBB_add_u8(&child, 0)) { + return 0; + } + started = 1; + } + if (!CBB_add_u8(&child, byte)) { + return 0; + } + } + + // 0 is encoded as a single 0, not the empty string. + if (!started && !CBB_add_u8(&child, 0)) { + return 0; + } + + 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) || + !CBB_add_bytes(&child, data, data_len) || + !CBB_flush(cbb)) { + return 0; + } + + return 1; +} + +int CBB_add_asn1_bool(CBB *cbb, int value) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_BOOLEAN) || + !CBB_add_u8(&child, value != 0 ? 0xff : 0) || + !CBB_flush(cbb)) { + return 0; + } + + return 1; +} + +// parse_dotted_decimal parses one decimal component from |cbs|, where |cbs| is +// an OID literal, e.g., "1.2.840.113554.4.1.72585". It consumes both the +// component and the dot, so |cbs| may be passed into the function again for the +// next value. +static int parse_dotted_decimal(CBS *cbs, uint64_t *out) { + *out = 0; + int seen_digit = 0; + for (;;) { + // Valid terminators for a component are the end of the string or a + // non-terminal dot. If the string ends with a dot, this is not a valid OID + // string. + uint8_t u; + if (!CBS_get_u8(cbs, &u) || + (u == '.' && CBS_len(cbs) > 0)) { + break; + } + if (u < '0' || u > '9' || + // Forbid stray leading zeros. + (seen_digit && *out == 0) || + // Check for overflow. + *out > UINT64_MAX / 10 || + *out * 10 > UINT64_MAX - (u - '0')) { + return 0; + } + *out = *out * 10 + (u - '0'); + seen_digit = 1; + } + // The empty string is not a legal OID component. + return seen_digit; +} + +int CBB_add_asn1_oid_from_text(CBB *cbb, const char *text, size_t len) { + if (!CBB_flush(cbb)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, (const uint8_t *)text, len); + + // OIDs must have at least two components. + uint64_t a, b; + if (!parse_dotted_decimal(&cbs, &a) || + !parse_dotted_decimal(&cbs, &b)) { + return 0; + } + + // The first component is encoded as 40 * |a| + |b|. This assumes that |a| is + // 0, 1, or 2 and that, when it is 0 or 1, |b| is at most 39. + if (a > 2 || + (a < 2 && b > 39) || + b > UINT64_MAX - 80 || + !add_base128_integer(cbb, 40u * a + b)) { + return 0; + } + + // The remaining components are encoded unmodified. + while (CBS_len(&cbs) > 0) { + if (!parse_dotted_decimal(&cbs, &a) || + !add_base128_integer(cbb, a)) { + return 0; + } + } + + return 1; +} + +static int compare_set_of_element(const void *a_ptr, const void *b_ptr) { + // See X.690, section 11.6 for the ordering. They are sorted in ascending + // order by their DER encoding. + const CBS *a = a_ptr, *b = b_ptr; + size_t a_len = CBS_len(a), b_len = CBS_len(b); + size_t min_len = a_len < b_len ? a_len : b_len; + int ret = OPENSSL_memcmp(CBS_data(a), CBS_data(b), min_len); + if (ret != 0) { + return ret; + } + if (a_len == b_len) { + return 0; + } + // If one is a prefix of the other, the shorter one sorts first. (This is not + // actually reachable. No DER encoding is a prefix of another DER encoding.) + return a_len < b_len ? -1 : 1; +} + +int CBB_flush_asn1_set_of(CBB *cbb) { + if (!CBB_flush(cbb)) { + return 0; + } + + CBS cbs; + size_t num_children = 0; + CBS_init(&cbs, CBB_data(cbb), CBB_len(cbb)); + while (CBS_len(&cbs) != 0) { + if (!CBS_get_any_asn1_element(&cbs, NULL, NULL, NULL)) { + return 0; + } + num_children++; + } + + if (num_children < 2) { + return 1; // Nothing to do. This is the common case for X.509. + } + if (num_children > ((size_t)-1) / sizeof(CBS)) { + return 0; // Overflow. + } + + // Parse out the children and sort. We alias them into a copy of so they + // remain valid as we rewrite |cbb|. + int ret = 0; + size_t buf_len = CBB_len(cbb); + 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; + } + CBS_init(&cbs, buf, buf_len); + for (size_t i = 0; i < num_children; i++) { + if (!CBS_get_any_asn1_element(&cbs, &children[i], NULL, NULL)) { + goto err; + } + } + qsort(children, num_children, sizeof(CBS), compare_set_of_element); + + // Rewind |cbb| and write the contents back in the new order. + cbb->base->len = cbb->offset + cbb->pending_len_len; + for (size_t i = 0; i < num_children; i++) { + if (!CBB_add_bytes(cbb, CBS_data(&children[i]), CBS_len(&children[i]))) { + goto err; + } + } + assert(CBB_len(cbb) == buf_len); + + ret = 1; + +err: + OPENSSL_free(buf); + OPENSSL_free(children); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c new file mode 100644 index 0000000..3e238e0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c @@ -0,0 +1,688 @@ +/* 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 "internal.h" +#include "../internal.h" + + +void CBS_init(CBS *cbs, const uint8_t *data, size_t len) { + cbs->data = data; + cbs->len = len; +} + +static int cbs_get(CBS *cbs, const uint8_t **p, size_t n) { + if (cbs->len < n) { + return 0; + } + + *p = cbs->data; + cbs->data += n; + cbs->len -= n; + return 1; +} + +int CBS_skip(CBS *cbs, size_t len) { + const uint8_t *dummy; + return cbs_get(cbs, &dummy, len); +} + +const uint8_t *CBS_data(const CBS *cbs) { + return cbs->data; +} + +size_t CBS_len(const CBS *cbs) { + return cbs->len; +} + +int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) { + OPENSSL_free(*out_ptr); + *out_ptr = NULL; + *out_len = 0; + + if (cbs->len == 0) { + return 1; + } + *out_ptr = OPENSSL_memdup(cbs->data, cbs->len); + if (*out_ptr == NULL) { + return 0; + } + *out_len = cbs->len; + return 1; +} + +int CBS_strdup(const CBS *cbs, char **out_ptr) { + if (*out_ptr != NULL) { + OPENSSL_free(*out_ptr); + } + *out_ptr = OPENSSL_strndup((const char*)cbs->data, cbs->len); + return (*out_ptr != NULL); +} + +int CBS_contains_zero_byte(const CBS *cbs) { + return OPENSSL_memchr(cbs->data, 0, cbs->len) != NULL; +} + +int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) { + if (len != cbs->len) { + return 0; + } + return CRYPTO_memcmp(cbs->data, data, len) == 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)) { + return 0; + } + for (size_t i = 0; i < len; i++) { + result <<= 8; + result |= data[i]; + } + *out = result; + return 1; +} + +int CBS_get_u8(CBS *cbs, uint8_t *out) { + const uint8_t *v; + if (!cbs_get(cbs, &v, 1)) { + return 0; + } + *out = *v; + return 1; +} + +int CBS_get_u16(CBS *cbs, uint16_t *out) { + uint64_t v; + if (!cbs_get_u(cbs, &v, 2)) { + return 0; + } + *out = v; + 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) { + 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) { + 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) { + if (cbs->len == 0) { + return 0; + } + *out = cbs->data[cbs->len - 1]; + cbs->len--; + return 1; +} + +int CBS_get_bytes(CBS *cbs, CBS *out, size_t len) { + const uint8_t *v; + if (!cbs_get(cbs, &v, len)) { + return 0; + } + CBS_init(out, v, len); + return 1; +} + +int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) { + const uint8_t *v; + if (!cbs_get(cbs, &v, len)) { + return 0; + } + OPENSSL_memcpy(out, v, len); + return 1; +} + +static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_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); +} + +int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 1); +} + +int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 2); +} + +int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 3); +} + +// parse_base128_integer reads a big-endian base-128 integer from |cbs| and sets +// |*out| to the result. This is the encoding used in DER for both high tag +// number form and OID components. +static int parse_base128_integer(CBS *cbs, uint64_t *out) { + uint64_t v = 0; + uint8_t b; + do { + if (!CBS_get_u8(cbs, &b)) { + return 0; + } + if ((v >> (64 - 7)) != 0) { + // The value is too large. + return 0; + } + if (v == 0 && b == 0x80) { + // The value must be minimally encoded. + return 0; + } + v = (v << 7) | (b & 0x7f); + + // Values end at an octet with the high bit cleared. + } while (b & 0x80); + + *out = v; + return 1; +} + +static int parse_asn1_tag(CBS *cbs, unsigned *out) { + uint8_t tag_byte; + if (!CBS_get_u8(cbs, &tag_byte)) { + return 0; + } + + // ITU-T X.690 section 8.1.2.3 specifies the format for identifiers with a tag + // number no greater than 30. + // + // If the number portion is 31 (0x1f, the largest value that fits in the + // allotted bits), then the tag is more than one byte long and the + // continuation bytes contain the tag number. This parser only supports tag + // numbers less than 31 (and thus single-byte tags). + unsigned tag = ((unsigned)tag_byte & 0xe0) << CBS_ASN1_TAG_SHIFT; + unsigned tag_number = tag_byte & 0x1f; + if (tag_number == 0x1f) { + uint64_t v; + if (!parse_base128_integer(cbs, &v) || + // Check the tag number is within our supported bounds. + v > CBS_ASN1_TAG_NUMBER_MASK || + // Small tag numbers should have used low tag number form. + v < 0x1f) { + return 0; + } + tag_number = (unsigned)v; + } + + tag |= tag_number; + + *out = tag; + return 1; +} + +static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len, int ber_ok) { + CBS header = *cbs; + CBS throwaway; + + if (out == NULL) { + out = &throwaway; + } + + unsigned tag; + if (!parse_asn1_tag(&header, &tag)) { + return 0; + } + if (out_tag != NULL) { + *out_tag = tag; + } + + uint8_t length_byte; + if (!CBS_get_u8(&header, &length_byte)) { + return 0; + } + + size_t header_len = CBS_len(cbs) - CBS_len(&header); + + size_t len; + // The format for the length encoding is specified in ITU-T X.690 section + // 8.1.3. + if ((length_byte & 0x80) == 0) { + // Short form length. + len = ((size_t) length_byte) + header_len; + if (out_header_len != NULL) { + *out_header_len = header_len; + } + } else { + // The high bit indicate that this is the long form, while the next 7 bits + // 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; + uint64_t len64; + + if (ber_ok && (tag & CBS_ASN1_CONSTRUCTED) != 0 && num_bytes == 0) { + // indefinite length + if (out_header_len != NULL) { + *out_header_len = header_len; + } + return CBS_get_bytes(cbs, out, header_len); + } + + // ITU-T X.690 clause 8.1.3.5.c specifies that the value 0xff shall not be + // used as the first byte of the length. If this parser encounters that + // value, num_bytes will be parsed as 127, which will fail the check below. + if (num_bytes == 0 || num_bytes > 4) { + return 0; + } + 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 (len64 < 128) { + // Length should have used short-form encoding. + return 0; + } + if ((len64 >> ((num_bytes-1)*8)) == 0) { + // Length should have been at least one byte shorter. + return 0; + } + len = len64; + if (len + header_len + num_bytes < len) { + // Overflow. + return 0; + } + len += header_len + num_bytes; + if (out_header_len != NULL) { + *out_header_len = header_len + num_bytes; + } + } + + return CBS_get_bytes(cbs, out, len); +} + +int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag) { + size_t header_len; + if (!CBS_get_any_asn1_element(cbs, out, out_tag, &header_len)) { + return 0; + } + + if (!CBS_skip(out, header_len)) { + assert(0); + return 0; + } + + return 1; +} + +int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len) { + return cbs_get_any_asn1_element(cbs, out, out_tag, out_header_len, + 0 /* DER only */); +} + +int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len) { + return cbs_get_any_asn1_element(cbs, out, out_tag, out_header_len, + 1 /* BER allowed */); +} + +static int cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, + int skip_header) { + size_t header_len; + unsigned tag; + CBS throwaway; + + if (out == NULL) { + out = &throwaway; + } + + if (!CBS_get_any_asn1_element(cbs, out, &tag, &header_len) || + tag != tag_value) { + return 0; + } + + if (skip_header && !CBS_skip(out, header_len)) { + assert(0); + return 0; + } + + return 1; +} + +int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value) { + return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */); +} + +int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value) { + return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */); +} + +int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value) { + if (CBS_len(cbs) < 1) { + return 0; + } + + CBS copy = *cbs; + unsigned actual_tag; + return parse_asn1_tag(©, &actual_tag) && tag_value == actual_tag; +} + +int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) { + CBS bytes; + if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_INTEGER)) { + return 0; + } + + *out = 0; + const uint8_t *data = CBS_data(&bytes); + size_t len = CBS_len(&bytes); + + if (len == 0) { + // An INTEGER is encoded with at least one octet. + return 0; + } + + if ((data[0] & 0x80) != 0) { + // Negative number. + return 0; + } + + if (data[0] == 0 && len > 1 && (data[1] & 0x80) == 0) { + // Extra leading zeros. + return 0; + } + + for (size_t i = 0; i < len; i++) { + if ((*out >> 56) != 0) { + // Too large to represent as a uint64_t. + return 0; + } + *out <<= 8; + *out |= data[i]; + } + + 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) || + CBS_len(&bytes) != 1) { + return 0; + } + + const uint8_t value = *CBS_data(&bytes); + if (value != 0 && value != 0xff) { + return 0; + } + + *out = !!value; + return 1; +} + +int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag) { + int present = 0; + + if (CBS_peek_asn1_tag(cbs, tag)) { + if (!CBS_get_asn1(cbs, out, tag)) { + return 0; + } + present = 1; + } + + if (out_present != NULL) { + *out_present = present; + } + + return 1; +} + +int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, + unsigned tag) { + CBS child; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + assert(out); + if (!CBS_get_asn1(&child, out, CBS_ASN1_OCTETSTRING) || + CBS_len(&child) != 0) { + return 0; + } + } else { + CBS_init(out, NULL, 0); + } + if (out_present) { + *out_present = present; + } + return 1; +} + +int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, + uint64_t default_value) { + CBS child; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + if (!CBS_get_asn1_uint64(&child, out) || + CBS_len(&child) != 0) { + return 0; + } + } else { + *out = default_value; + } + return 1; +} + +int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, + int default_value) { + CBS child, child2; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + uint8_t boolean; + + if (!CBS_get_asn1(&child, &child2, CBS_ASN1_BOOLEAN) || + CBS_len(&child2) != 1 || + CBS_len(&child) != 0) { + return 0; + } + + boolean = CBS_data(&child2)[0]; + if (boolean == 0) { + *out = 0; + } else if (boolean == 0xff) { + *out = 1; + } else { + return 0; + } + } else { + *out = default_value; + } + return 1; +} + +int CBS_is_valid_asn1_bitstring(const CBS *cbs) { + CBS in = *cbs; + uint8_t num_unused_bits; + if (!CBS_get_u8(&in, &num_unused_bits) || + num_unused_bits > 7) { + return 0; + } + + if (num_unused_bits == 0) { + return 1; + } + + // All num_unused_bits bits must exist and be zeros. + uint8_t last; + if (!CBS_get_last_u8(&in, &last) || + (last & ((1 << num_unused_bits) - 1)) != 0) { + return 0; + } + + return 1; +} + +int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit) { + if (!CBS_is_valid_asn1_bitstring(cbs)) { + return 0; + } + + const unsigned byte_num = (bit >> 3) + 1; + const unsigned bit_num = 7 - (bit & 7); + + // Unused bits are zero, and this function does not distinguish between + // missing and unset bits. Thus it is sufficient to do a byte-level length + // check. + return byte_num < CBS_len(cbs) && + (CBS_data(cbs)[byte_num] & (1 << bit_num)) != 0; +} + +static int add_decimal(CBB *out, uint64_t v) { + char buf[DECIMAL_SIZE(uint64_t) + 1]; + BIO_snprintf(buf, sizeof(buf), "%" PRIu64, v); + return CBB_add_bytes(out, (const uint8_t *)buf, strlen(buf)); +} + +char *CBS_asn1_oid_to_text(const CBS *cbs) { + CBB cbb; + if (!CBB_init(&cbb, 32)) { + goto err; + } + + CBS copy = *cbs; + // The first component is 40 * value1 + value2, where value1 is 0, 1, or 2. + uint64_t v; + if (!parse_base128_integer(©, &v)) { + goto err; + } + + if (v >= 80) { + if (!CBB_add_bytes(&cbb, (const uint8_t *)"2.", 2) || + !add_decimal(&cbb, v - 80)) { + goto err; + } + } else if (!add_decimal(&cbb, v / 40) || + !CBB_add_u8(&cbb, '.') || + !add_decimal(&cbb, v % 40)) { + goto err; + } + + while (CBS_len(©) != 0) { + if (!parse_base128_integer(©, &v) || + !CBB_add_u8(&cbb, '.') || + !add_decimal(&cbb, v)) { + goto err; + } + } + + uint8_t *txt; + size_t txt_len; + if (!CBB_add_u8(&cbb, '\0') || + !CBB_finish(&cbb, &txt, &txt_len)) { + goto err; + } + + return (char *)txt; + +err: + CBB_cleanup(&cbb); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back new file mode 100644 index 0000000..49d7003 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back @@ -0,0 +1,688 @@ +/* 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 "internal.h" +#include "../internal.h" + + +void CBS_init(CBS *cbs, const uint8_t *data, size_t len) { + cbs->data = data; + cbs->len = len; +} + +static int cbs_get(CBS *cbs, const uint8_t **p, size_t n) { + if (cbs->len < n) { + return 0; + } + + *p = cbs->data; + cbs->data += n; + cbs->len -= n; + return 1; +} + +int CBS_skip(CBS *cbs, size_t len) { + const uint8_t *dummy; + return cbs_get(cbs, &dummy, len); +} + +const uint8_t *CBS_data(const CBS *cbs) { + return cbs->data; +} + +size_t CBS_len(const CBS *cbs) { + return cbs->len; +} + +int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) { + OPENSSL_free(*out_ptr); + *out_ptr = NULL; + *out_len = 0; + + if (cbs->len == 0) { + return 1; + } + *out_ptr = OPENSSL_memdup(cbs->data, cbs->len); + if (*out_ptr == NULL) { + return 0; + } + *out_len = cbs->len; + return 1; +} + +int CBS_strdup(const CBS *cbs, char **out_ptr) { + if (*out_ptr != NULL) { + OPENSSL_free(*out_ptr); + } + *out_ptr = OPENSSL_strndup((const char*)cbs->data, cbs->len); + return (*out_ptr != NULL); +} + +int CBS_contains_zero_byte(const CBS *cbs) { + return OPENSSL_memchr(cbs->data, 0, cbs->len) != NULL; +} + +int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) { + if (len != cbs->len) { + return 0; + } + return CRYPTO_memcmp(cbs->data, data, len) == 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)) { + return 0; + } + for (size_t i = 0; i < len; i++) { + result <<= 8; + result |= data[i]; + } + *out = result; + return 1; +} + +int CBS_get_u8(CBS *cbs, uint8_t *out) { + const uint8_t *v; + if (!cbs_get(cbs, &v, 1)) { + return 0; + } + *out = *v; + return 1; +} + +int CBS_get_u16(CBS *cbs, uint16_t *out) { + uint64_t v; + if (!cbs_get_u(cbs, &v, 2)) { + return 0; + } + *out = v; + 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) { + 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) { + 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) { + if (cbs->len == 0) { + return 0; + } + *out = cbs->data[cbs->len - 1]; + cbs->len--; + return 1; +} + +int CBS_get_bytes(CBS *cbs, CBS *out, size_t len) { + const uint8_t *v; + if (!cbs_get(cbs, &v, len)) { + return 0; + } + CBS_init(out, v, len); + return 1; +} + +int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) { + const uint8_t *v; + if (!cbs_get(cbs, &v, len)) { + return 0; + } + OPENSSL_memcpy(out, v, len); + return 1; +} + +static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_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); +} + +int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 1); +} + +int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 2); +} + +int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out) { + return cbs_get_length_prefixed(cbs, out, 3); +} + +// parse_base128_integer reads a big-endian base-128 integer from |cbs| and sets +// |*out| to the result. This is the encoding used in DER for both high tag +// number form and OID components. +static int parse_base128_integer(CBS *cbs, uint64_t *out) { + uint64_t v = 0; + uint8_t b; + do { + if (!CBS_get_u8(cbs, &b)) { + return 0; + } + if ((v >> (64 - 7)) != 0) { + // The value is too large. + return 0; + } + if (v == 0 && b == 0x80) { + // The value must be minimally encoded. + return 0; + } + v = (v << 7) | (b & 0x7f); + + // Values end at an octet with the high bit cleared. + } while (b & 0x80); + + *out = v; + return 1; +} + +static int parse_asn1_tag(CBS *cbs, unsigned *out) { + uint8_t tag_byte; + if (!CBS_get_u8(cbs, &tag_byte)) { + return 0; + } + + // ITU-T X.690 section 8.1.2.3 specifies the format for identifiers with a tag + // number no greater than 30. + // + // If the number portion is 31 (0x1f, the largest value that fits in the + // allotted bits), then the tag is more than one byte long and the + // continuation bytes contain the tag number. This parser only supports tag + // numbers less than 31 (and thus single-byte tags). + unsigned tag = ((unsigned)tag_byte & 0xe0) << CBS_ASN1_TAG_SHIFT; + unsigned tag_number = tag_byte & 0x1f; + if (tag_number == 0x1f) { + uint64_t v; + if (!parse_base128_integer(cbs, &v) || + // Check the tag number is within our supported bounds. + v > CBS_ASN1_TAG_NUMBER_MASK || + // Small tag numbers should have used low tag number form. + v < 0x1f) { + return 0; + } + tag_number = (unsigned)v; + } + + tag |= tag_number; + + *out = tag; + return 1; +} + +static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len, int ber_ok) { + CBS header = *cbs; + CBS throwaway; + + if (out == NULL) { + out = &throwaway; + } + + unsigned tag; + if (!parse_asn1_tag(&header, &tag)) { + return 0; + } + if (out_tag != NULL) { + *out_tag = tag; + } + + uint8_t length_byte; + if (!CBS_get_u8(&header, &length_byte)) { + return 0; + } + + size_t header_len = CBS_len(cbs) - CBS_len(&header); + + size_t len; + // The format for the length encoding is specified in ITU-T X.690 section + // 8.1.3. + if ((length_byte & 0x80) == 0) { + // Short form length. + len = ((size_t) length_byte) + header_len; + if (out_header_len != NULL) { + *out_header_len = header_len; + } + } else { + // The high bit indicate that this is the long form, while the next 7 bits + // 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; + uint64_t len64; + + if (ber_ok && (tag & CBS_ASN1_CONSTRUCTED) != 0 && num_bytes == 0) { + // indefinite length + if (out_header_len != NULL) { + *out_header_len = header_len; + } + return CBS_get_bytes(cbs, out, header_len); + } + + // ITU-T X.690 clause 8.1.3.5.c specifies that the value 0xff shall not be + // used as the first byte of the length. If this parser encounters that + // value, num_bytes will be parsed as 127, which will fail the check below. + if (num_bytes == 0 || num_bytes > 4) { + return 0; + } + 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 (len64 < 128) { + // Length should have used short-form encoding. + return 0; + } + if ((len64 >> ((num_bytes-1)*8)) == 0) { + // Length should have been at least one byte shorter. + return 0; + } + len = len64; + if (len + header_len + num_bytes < len) { + // Overflow. + return 0; + } + len += header_len + num_bytes; + if (out_header_len != NULL) { + *out_header_len = header_len + num_bytes; + } + } + + return CBS_get_bytes(cbs, out, len); +} + +int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag) { + size_t header_len; + if (!CBS_get_any_asn1_element(cbs, out, out_tag, &header_len)) { + return 0; + } + + if (!CBS_skip(out, header_len)) { + assert(0); + return 0; + } + + return 1; +} + +int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len) { + return cbs_get_any_asn1_element(cbs, out, out_tag, out_header_len, + 0 /* DER only */); +} + +int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, + size_t *out_header_len) { + return cbs_get_any_asn1_element(cbs, out, out_tag, out_header_len, + 1 /* BER allowed */); +} + +static int cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, + int skip_header) { + size_t header_len; + unsigned tag; + CBS throwaway; + + if (out == NULL) { + out = &throwaway; + } + + if (!CBS_get_any_asn1_element(cbs, out, &tag, &header_len) || + tag != tag_value) { + return 0; + } + + if (skip_header && !CBS_skip(out, header_len)) { + assert(0); + return 0; + } + + return 1; +} + +int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value) { + return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */); +} + +int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value) { + return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */); +} + +int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value) { + if (CBS_len(cbs) < 1) { + return 0; + } + + CBS copy = *cbs; + unsigned actual_tag; + return parse_asn1_tag(©, &actual_tag) && tag_value == actual_tag; +} + +int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) { + CBS bytes; + if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_INTEGER)) { + return 0; + } + + *out = 0; + const uint8_t *data = CBS_data(&bytes); + size_t len = CBS_len(&bytes); + + if (len == 0) { + // An INTEGER is encoded with at least one octet. + return 0; + } + + if ((data[0] & 0x80) != 0) { + // Negative number. + return 0; + } + + if (data[0] == 0 && len > 1 && (data[1] & 0x80) == 0) { + // Extra leading zeros. + return 0; + } + + for (size_t i = 0; i < len; i++) { + if ((*out >> 56) != 0) { + // Too large to represent as a uint64_t. + return 0; + } + *out <<= 8; + *out |= data[i]; + } + + 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) || + CBS_len(&bytes) != 1) { + return 0; + } + + const uint8_t value = *CBS_data(&bytes); + if (value != 0 && value != 0xff) { + return 0; + } + + *out = !!value; + return 1; +} + +int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag) { + int present = 0; + + if (CBS_peek_asn1_tag(cbs, tag)) { + if (!CBS_get_asn1(cbs, out, tag)) { + return 0; + } + present = 1; + } + + if (out_present != NULL) { + *out_present = present; + } + + return 1; +} + +int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, + unsigned tag) { + CBS child; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + assert(out); + if (!CBS_get_asn1(&child, out, CBS_ASN1_OCTETSTRING) || + CBS_len(&child) != 0) { + return 0; + } + } else { + CBS_init(out, NULL, 0); + } + if (out_present) { + *out_present = present; + } + return 1; +} + +int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, + uint64_t default_value) { + CBS child; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + if (!CBS_get_asn1_uint64(&child, out) || + CBS_len(&child) != 0) { + return 0; + } + } else { + *out = default_value; + } + return 1; +} + +int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, + int default_value) { + CBS child, child2; + int present; + if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) { + return 0; + } + if (present) { + uint8_t boolean; + + if (!CBS_get_asn1(&child, &child2, CBS_ASN1_BOOLEAN) || + CBS_len(&child2) != 1 || + CBS_len(&child) != 0) { + return 0; + } + + boolean = CBS_data(&child2)[0]; + if (boolean == 0) { + *out = 0; + } else if (boolean == 0xff) { + *out = 1; + } else { + return 0; + } + } else { + *out = default_value; + } + return 1; +} + +int CBS_is_valid_asn1_bitstring(const CBS *cbs) { + CBS in = *cbs; + uint8_t num_unused_bits; + if (!CBS_get_u8(&in, &num_unused_bits) || + num_unused_bits > 7) { + return 0; + } + + if (num_unused_bits == 0) { + return 1; + } + + // All num_unused_bits bits must exist and be zeros. + uint8_t last; + if (!CBS_get_last_u8(&in, &last) || + (last & ((1 << num_unused_bits) - 1)) != 0) { + return 0; + } + + return 1; +} + +int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit) { + if (!CBS_is_valid_asn1_bitstring(cbs)) { + return 0; + } + + const unsigned byte_num = (bit >> 3) + 1; + const unsigned bit_num = 7 - (bit & 7); + + // Unused bits are zero, and this function does not distinguish between + // missing and unset bits. Thus it is sufficient to do a byte-level length + // check. + return byte_num < CBS_len(cbs) && + (CBS_data(cbs)[byte_num] & (1 << bit_num)) != 0; +} + +static int add_decimal(CBB *out, uint64_t v) { + char buf[DECIMAL_SIZE(uint64_t) + 1]; + BIO_snprintf(buf, sizeof(buf), "%" PRIu64, v); + return CBB_add_bytes(out, (const uint8_t *)buf, strlen(buf)); +} + +char *CBS_asn1_oid_to_text(const CBS *cbs) { + CBB cbb; + if (!CBB_init(&cbb, 32)) { + goto err; + } + + CBS copy = *cbs; + // The first component is 40 * value1 + value2, where value1 is 0, 1, or 2. + uint64_t v; + if (!parse_base128_integer(©, &v)) { + goto err; + } + + if (v >= 80) { + if (!CBB_add_bytes(&cbb, (const uint8_t *)"2.", 2) || + !add_decimal(&cbb, v - 80)) { + goto err; + } + } else if (!add_decimal(&cbb, v / 40) || + !CBB_add_u8(&cbb, '.') || + !add_decimal(&cbb, v % 40)) { + goto err; + } + + while (CBS_len(©) != 0) { + if (!parse_base128_integer(©, &v) || + !CBB_add_u8(&cbb, '.') || + !add_decimal(&cbb, v)) { + goto err; + } + } + + uint8_t *txt; + size_t txt_len; + if (!CBB_add_u8(&cbb, '\0') || + !CBB_finish(&cbb, &txt, &txt_len)) { + goto err; + } + + return (char *)txt; + +err: + CBB_cleanup(&cbb); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h new file mode 100644 index 0000000..d98c8fc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h.grpc_back new file mode 100644 index 0000000..7ef0e21 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c new file mode 100644 index 0000000..0dba532 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c.grpc_back new file mode 100644 index 0000000..6f9467f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c new file mode 100644 index 0000000..0b382bf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c @@ -0,0 +1,184 @@ +/* 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. */ + +// Adapted from the public domain, estream code by D. Bernstein. + +#include + +#include +#include + +#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)) + +// 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); + +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], + uint32_t counter) { + assert(!buffers_alias(out, in_len, in, in_len) || in == out); + + uint32_t counter_nonce[4]; counter_nonce[0] = counter; + counter_nonce[1] = U8TO32_LITTLE(nonce + 0); + counter_nonce[2] = U8TO32_LITTLE(nonce + 4); + counter_nonce[3] = U8TO32_LITTLE(nonce + 8); + + const uint32_t *key_ptr = (const uint32_t *)key; +#if !defined(OPENSSL_X86) && !defined(OPENSSL_X86_64) + // The assembly expects the key to be four-byte aligned. + uint32_t key_u32[8]; + if ((((uintptr_t)key) & 3) != 0) { + key_u32[0] = U8TO32_LITTLE(key + 0); + key_u32[1] = U8TO32_LITTLE(key + 4); + key_u32[2] = U8TO32_LITTLE(key + 8); + key_u32[3] = U8TO32_LITTLE(key + 12); + key_u32[4] = U8TO32_LITTLE(key + 16); + key_u32[5] = U8TO32_LITTLE(key + 20); + key_u32[6] = U8TO32_LITTLE(key + 24); + key_u32[7] = U8TO32_LITTLE(key + 28); + + key_ptr = key_u32; + } +#endif + + ChaCha20_ctr32(out, in, in_len, key_ptr, counter_nonce); +} + +#else + +#define U32TO8_LITTLE(p, v) \ + { \ + (p)[0] = (v >> 0) & 0xff; \ + (p)[1] = (v >> 8) & 0xff; \ + (p)[2] = (v >> 16) & 0xff; \ + (p)[3] = (v >> 24) & 0xff; \ + } + +// 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]) { + uint32_t x[16]; + int i; + + OPENSSL_memcpy(x, input, sizeof(uint32_t) * 16); + for (i = 20; i > 0; 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) + } + + for (i = 0; i < 16; ++i) { + x[i] += input[i]; + } + for (i = 0; i < 16; ++i) { + U32TO8_LITTLE(output + 4 * i, x[i]); + } +} + +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) { + assert(!buffers_alias(out, in_len, in, in_len) || in == out); + + uint32_t input[16]; + uint8_t buf[64]; + size_t todo, i; + + input[0] = U8TO32_LITTLE(sigma + 0); + input[1] = U8TO32_LITTLE(sigma + 4); + input[2] = U8TO32_LITTLE(sigma + 8); + input[3] = U8TO32_LITTLE(sigma + 12); + + input[4] = U8TO32_LITTLE(key + 0); + input[5] = U8TO32_LITTLE(key + 4); + input[6] = U8TO32_LITTLE(key + 8); + input[7] = U8TO32_LITTLE(key + 12); + + input[8] = U8TO32_LITTLE(key + 16); + input[9] = U8TO32_LITTLE(key + 20); + input[10] = U8TO32_LITTLE(key + 24); + input[11] = U8TO32_LITTLE(key + 28); + + input[12] = counter; + input[13] = U8TO32_LITTLE(nonce + 0); + input[14] = U8TO32_LITTLE(nonce + 4); + input[15] = U8TO32_LITTLE(nonce + 8); + + while (in_len > 0) { + todo = sizeof(buf); + if (in_len < todo) { + todo = in_len; + } + + chacha_core(buf, input); + for (i = 0; i < todo; i++) { + out[i] = in[i] ^ buf[i]; + } + + out += todo; + in += todo; + in_len -= todo; + + input[12]++; + } +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back new file mode 100644 index 0000000..b539f99 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back @@ -0,0 +1,184 @@ +/* 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. */ + +// Adapted from the public domain, estream code by D. Bernstein. + +#include + +#include +#include + +#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)) + +// 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); + +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], + uint32_t counter) { + assert(!buffers_alias(out, in_len, in, in_len) || in == out); + + uint32_t counter_nonce[4]; counter_nonce[0] = counter; + counter_nonce[1] = U8TO32_LITTLE(nonce + 0); + counter_nonce[2] = U8TO32_LITTLE(nonce + 4); + counter_nonce[3] = U8TO32_LITTLE(nonce + 8); + + const uint32_t *key_ptr = (const uint32_t *)key; +#if !defined(OPENSSL_X86) && !defined(OPENSSL_X86_64) + // The assembly expects the key to be four-byte aligned. + uint32_t key_u32[8]; + if ((((uintptr_t)key) & 3) != 0) { + key_u32[0] = U8TO32_LITTLE(key + 0); + key_u32[1] = U8TO32_LITTLE(key + 4); + key_u32[2] = U8TO32_LITTLE(key + 8); + key_u32[3] = U8TO32_LITTLE(key + 12); + key_u32[4] = U8TO32_LITTLE(key + 16); + key_u32[5] = U8TO32_LITTLE(key + 20); + key_u32[6] = U8TO32_LITTLE(key + 24); + key_u32[7] = U8TO32_LITTLE(key + 28); + + key_ptr = key_u32; + } +#endif + + ChaCha20_ctr32(out, in, in_len, key_ptr, counter_nonce); +} + +#else + +#define U32TO8_LITTLE(p, v) \ + { \ + (p)[0] = (v >> 0) & 0xff; \ + (p)[1] = (v >> 8) & 0xff; \ + (p)[2] = (v >> 16) & 0xff; \ + (p)[3] = (v >> 24) & 0xff; \ + } + +// 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]) { + uint32_t x[16]; + int i; + + OPENSSL_memcpy(x, input, sizeof(uint32_t) * 16); + for (i = 20; i > 0; 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) + } + + for (i = 0; i < 16; ++i) { + x[i] += input[i]; + } + for (i = 0; i < 16; ++i) { + U32TO8_LITTLE(output + 4 * i, x[i]); + } +} + +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) { + assert(!buffers_alias(out, in_len, in, in_len) || in == out); + + uint32_t input[16]; + uint8_t buf[64]; + size_t todo, i; + + input[0] = U8TO32_LITTLE(sigma + 0); + input[1] = U8TO32_LITTLE(sigma + 4); + input[2] = U8TO32_LITTLE(sigma + 8); + input[3] = U8TO32_LITTLE(sigma + 12); + + input[4] = U8TO32_LITTLE(key + 0); + input[5] = U8TO32_LITTLE(key + 4); + input[6] = U8TO32_LITTLE(key + 8); + input[7] = U8TO32_LITTLE(key + 12); + + input[8] = U8TO32_LITTLE(key + 16); + input[9] = U8TO32_LITTLE(key + 20); + input[10] = U8TO32_LITTLE(key + 24); + input[11] = U8TO32_LITTLE(key + 28); + + input[12] = counter; + input[13] = U8TO32_LITTLE(nonce + 0); + input[14] = U8TO32_LITTLE(nonce + 4); + input[15] = U8TO32_LITTLE(nonce + 8); + + while (in_len > 0) { + todo = sizeof(buf); + if (in_len < todo) { + todo = in_len; + } + + chacha_core(buf, input); + for (i = 0; i < todo; i++) { + out[i] = in[i] ^ buf[i]; + } + + out += todo; + in += todo; + in_len -= todo; + + input[12]++; + } +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h new file mode 100644 index 0000000..5dbb97b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h.grpc_back new file mode 100644 index 0000000..1435e3b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c new file mode 100644 index 0000000..4bfb52a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c @@ -0,0 +1,143 @@ +/* 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 "internal.h" +#include "../internal.h" + + +const EVP_CIPHER *EVP_get_cipherbynid(int nid) { + switch (nid) { + case NID_rc2_cbc: + return EVP_rc2_cbc(); + case NID_rc2_40_cbc: + return EVP_rc2_40_cbc(); + case NID_des_ede3_cbc: + return EVP_des_ede3_cbc(); + case NID_des_ede_cbc: + return EVP_des_cbc(); + case NID_aes_128_cbc: + return EVP_aes_128_cbc(); + case NID_aes_192_cbc: + return EVP_aes_192_cbc(); + case NID_aes_256_cbc: + return EVP_aes_256_cbc(); + default: + return NULL; + } +} + +const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { + if (OPENSSL_strcasecmp(name, "rc4") == 0) { + return EVP_rc4(); + } 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back new file mode 100644 index 0000000..b132265 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back @@ -0,0 +1,143 @@ +/* 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 "internal.h" +#include "../internal.h" + + +const EVP_CIPHER *EVP_get_cipherbynid(int nid) { + switch (nid) { + case NID_rc2_cbc: + return EVP_rc2_cbc(); + case NID_rc2_40_cbc: + return EVP_rc2_40_cbc(); + case NID_des_ede3_cbc: + return EVP_des_ede3_cbc(); + case NID_des_ede_cbc: + return EVP_des_cbc(); + case NID_aes_128_cbc: + return EVP_aes_128_cbc(); + case NID_aes_192_cbc: + return EVP_aes_192_cbc(); + case NID_aes_256_cbc: + return EVP_aes_256_cbc(); + default: + return NULL; + } +} + +const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { + if (OPENSSL_strcasecmp(name, "rc4") == 0) { + return EVP_rc4(); + } 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c new file mode 100644 index 0000000..05d2435 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c @@ -0,0 +1,152 @@ +/* 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 + + +#define PKCS5_SALT_LEN 8 + +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) { + EVP_MD_CTX c; + uint8_t md_buf[EVP_MAX_MD_SIZE]; + unsigned niv, nkey, addmd = 0; + unsigned mds = 0, i; + int rv = 0; + + nkey = type->key_len; + niv = type->iv_len; + + assert(nkey <= EVP_MAX_KEY_LENGTH); + assert(niv <= EVP_MAX_IV_LENGTH); + + if (data == NULL) { + return nkey; + } + + EVP_MD_CTX_init(&c); + for (;;) { + if (!EVP_DigestInit_ex(&c, md, NULL)) { + return 0; + } + if (addmd++) { + if (!EVP_DigestUpdate(&c, md_buf, mds)) { + goto err; + } + } + if (!EVP_DigestUpdate(&c, data, data_len)) { + goto err; + } + if (salt != NULL) { + if (!EVP_DigestUpdate(&c, salt, PKCS5_SALT_LEN)) { + goto err; + } + } + if (!EVP_DigestFinal_ex(&c, md_buf, &mds)) { + goto err; + } + + for (i = 1; i < count; i++) { + if (!EVP_DigestInit_ex(&c, md, NULL) || + !EVP_DigestUpdate(&c, md_buf, mds) || + !EVP_DigestFinal_ex(&c, md_buf, &mds)) { + goto err; + } + } + + i = 0; + if (nkey) { + for (;;) { + if (nkey == 0 || i == mds) { + break; + } + if (key != NULL) { + *(key++) = md_buf[i]; + } + nkey--; + i++; + } + } + + if (niv && i != mds) { + for (;;) { + if (niv == 0 || i == mds) { + break; + } + if (iv != NULL) { + *(iv++) = md_buf[i]; + } + niv--; + i++; + } + } + if (nkey == 0 && niv == 0) { + break; + } + } + rv = type->key_len; + +err: + EVP_MD_CTX_cleanup(&c); + OPENSSL_cleanse(md_buf, EVP_MAX_MD_SIZE); + return rv; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c.grpc_back new file mode 100644 index 0000000..ff5ae06 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c.grpc_back @@ -0,0 +1,152 @@ +/* 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 + + +#define PKCS5_SALT_LEN 8 + +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) { + EVP_MD_CTX c; + uint8_t md_buf[EVP_MAX_MD_SIZE]; + unsigned niv, nkey, addmd = 0; + unsigned mds = 0, i; + int rv = 0; + + nkey = type->key_len; + niv = type->iv_len; + + assert(nkey <= EVP_MAX_KEY_LENGTH); + assert(niv <= EVP_MAX_IV_LENGTH); + + if (data == NULL) { + return nkey; + } + + EVP_MD_CTX_init(&c); + for (;;) { + if (!EVP_DigestInit_ex(&c, md, NULL)) { + return 0; + } + if (addmd++) { + if (!EVP_DigestUpdate(&c, md_buf, mds)) { + goto err; + } + } + if (!EVP_DigestUpdate(&c, data, data_len)) { + goto err; + } + if (salt != NULL) { + if (!EVP_DigestUpdate(&c, salt, PKCS5_SALT_LEN)) { + goto err; + } + } + if (!EVP_DigestFinal_ex(&c, md_buf, &mds)) { + goto err; + } + + for (i = 1; i < count; i++) { + if (!EVP_DigestInit_ex(&c, md, NULL) || + !EVP_DigestUpdate(&c, md_buf, mds) || + !EVP_DigestFinal_ex(&c, md_buf, &mds)) { + goto err; + } + } + + i = 0; + if (nkey) { + for (;;) { + if (nkey == 0 || i == mds) { + break; + } + if (key != NULL) { + *(key++) = md_buf[i]; + } + nkey--; + i++; + } + } + + if (niv && i != mds) { + for (;;) { + if (niv == 0 || i == mds) { + break; + } + if (iv != NULL) { + *(iv++) = md_buf[i]; + } + niv--; + i++; + } + } + if (nkey == 0 && niv == 0) { + break; + } + } + rv = type->key_len; + +err: + EVP_MD_CTX_cleanup(&c); + OPENSSL_cleanse(md_buf, EVP_MAX_MD_SIZE); + return rv; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c new file mode 100644 index 0000000..a13bc99 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c.grpc_back new file mode 100644 index 0000000..e9e9e16 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c new file mode 100644 index 0000000..e3daec4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c @@ -0,0 +1,283 @@ +/* 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 "../fipsmodule/cipher/internal.h" + + +#define EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN SHA256_DIGEST_LENGTH +#define EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN 12 + +struct aead_aes_ctr_hmac_sha256_ctx { + union { + double align; + AES_KEY ks; + } ks; + ctr128_f ctr; + block128_f block; + SHA256_CTX inner_init_state; + 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; + uint8_t block[SHA256_CBLOCK]; + OPENSSL_memcpy(block, hmac_key, hmac_key_len); + OPENSSL_memset(block + hmac_key_len, 0x36, sizeof(block) - hmac_key_len); + + unsigned i; + for (i = 0; i < hmac_key_len; i++) { + block[i] ^= 0x36; + } + + SHA256_Init(out_inner); + SHA256_Update(out_inner, block, sizeof(block)); + + OPENSSL_memset(block + hmac_key_len, 0x5c, sizeof(block) - hmac_key_len); + for (i = 0; i < hmac_key_len; i++) { + block[i] ^= (0x36 ^ 0x5c); + } + + SHA256_Init(out_outer); + SHA256_Update(out_outer, block, sizeof(block)); +} + +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 *)&ctx->state; + static const size_t hmac_key_len = 32; + + if (key_len < hmac_key_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + const size_t aes_key_len = key_len - hmac_key_len; + if (aes_key_len != 16 && aes_key_len != 32) { + 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_CTR_HMAC_SHA256_TAG_LEN; + } + + if (tag_len > EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + 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); + + return 1; +} + +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; + uint8_t bytes[8]; + + for (i = 0; i < sizeof(bytes); i++) { + bytes[i] = value & 0xff; + value >>= 8; + } + SHA256_Update(sha256, bytes, sizeof(bytes)); +} + +static void hmac_calculate(uint8_t out[SHA256_DIGEST_LENGTH], + const SHA256_CTX *inner_init_state, + const SHA256_CTX *outer_init_state, + const uint8_t *ad, size_t ad_len, + const uint8_t *nonce, const uint8_t *ciphertext, + size_t ciphertext_len) { + SHA256_CTX sha256; + OPENSSL_memcpy(&sha256, inner_init_state, sizeof(sha256)); + hmac_update_uint64(&sha256, ad_len); + hmac_update_uint64(&sha256, ciphertext_len); + SHA256_Update(&sha256, nonce, EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN); + SHA256_Update(&sha256, ad, ad_len); + + // Pad with zeros to the end of the SHA-256 block. + const unsigned num_padding = + (SHA256_CBLOCK - ((sizeof(uint64_t)*2 + + EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN + ad_len) % + SHA256_CBLOCK)) % + SHA256_CBLOCK; + uint8_t padding[SHA256_CBLOCK]; + OPENSSL_memset(padding, 0, num_padding); + SHA256_Update(&sha256, padding, num_padding); + + SHA256_Update(&sha256, ciphertext, ciphertext_len); + + uint8_t inner_digest[SHA256_DIGEST_LENGTH]; + SHA256_Final(inner_digest, &sha256); + + OPENSSL_memcpy(&sha256, outer_init_state, sizeof(sha256)); + SHA256_Update(&sha256, inner_digest, sizeof(inner_digest)); + SHA256_Final(out, &sha256); +} + +static void aead_aes_ctr_hmac_sha256_crypt( + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx, uint8_t *out, + const uint8_t *in, size_t len, const uint8_t *nonce) { + // Since the AEAD operation is one-shot, keeping a buffer of unused keystream + // bytes is pointless. However, |CRYPTO_ctr128_encrypt| requires it. + uint8_t partial_block_buffer[AES_BLOCK_SIZE]; + unsigned partial_block_offset = 0; + OPENSSL_memset(partial_block_buffer, 0, sizeof(partial_block_buffer)); + + uint8_t counter[AES_BLOCK_SIZE]; + OPENSSL_memcpy(counter, nonce, EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN); + OPENSSL_memset(counter + EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN, 0, 4); + + if (aes_ctx->ctr) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, &aes_ctx->ks.ks, counter, + partial_block_buffer, &partial_block_offset, + aes_ctx->ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, &aes_ctx->ks.ks, counter, + partial_block_buffer, &partial_block_offset, + aes_ctx->block); + } +} + +static int aead_aes_ctr_hmac_sha256_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_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) { + // This input is so large it would overflow the 32-bit block counter. + 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_AES_CTR_HMAC_SHA256_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + aead_aes_ctr_hmac_sha256_crypt(aes_ctx, out, in, in_len, nonce); + + uint8_t hmac_result[SHA256_DIGEST_LENGTH]; + hmac_calculate(hmac_result, &aes_ctx->inner_init_state, + &aes_ctx->outer_init_state, ad, ad_len, nonce, out, in_len); + OPENSSL_memcpy(out_tag, hmac_result, ctx->tag_len); + *out_tag_len = ctx->tag_len; + + return 1; +} + +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 = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + uint8_t hmac_result[SHA256_DIGEST_LENGTH]; + hmac_calculate(hmac_result, &aes_ctx->inner_init_state, + &aes_ctx->outer_init_state, ad, ad_len, nonce, in, + in_len); + if (CRYPTO_memcmp(hmac_result, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + aead_aes_ctr_hmac_sha256_crypt(aes_ctx, out, in, in_len, nonce); + + return 1; +} + +static const EVP_AEAD aead_aes_128_ctr_hmac_sha256 = { + 16 /* AES key */ + 32 /* HMAC key */, + 12, // nonce length + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // overhead + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ctr_hmac_sha256_init, + NULL /* init_with_direction */, + aead_aes_ctr_hmac_sha256_cleanup, + NULL /* open */, + aead_aes_ctr_hmac_sha256_seal_scatter, + aead_aes_ctr_hmac_sha256_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_ctr_hmac_sha256 = { + 32 /* AES key */ + 32 /* HMAC key */, + 12, // nonce length + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // overhead + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ctr_hmac_sha256_init, + NULL /* init_with_direction */, + aead_aes_ctr_hmac_sha256_cleanup, + NULL /* open */, + aead_aes_ctr_hmac_sha256_seal_scatter, + aead_aes_ctr_hmac_sha256_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ctr_hmac_sha256(void) { + return &aead_aes_128_ctr_hmac_sha256; +} + +const EVP_AEAD *EVP_aead_aes_256_ctr_hmac_sha256(void) { + return &aead_aes_256_ctr_hmac_sha256; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back new file mode 100644 index 0000000..8c45c81 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back @@ -0,0 +1,283 @@ +/* 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 "../fipsmodule/cipher/internal.h" + + +#define EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN SHA256_DIGEST_LENGTH +#define EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN 12 + +struct aead_aes_ctr_hmac_sha256_ctx { + union { + double align; + AES_KEY ks; + } ks; + ctr128_f ctr; + block128_f block; + SHA256_CTX inner_init_state; + 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; + uint8_t block[SHA256_CBLOCK]; + OPENSSL_memcpy(block, hmac_key, hmac_key_len); + OPENSSL_memset(block + hmac_key_len, 0x36, sizeof(block) - hmac_key_len); + + unsigned i; + for (i = 0; i < hmac_key_len; i++) { + block[i] ^= 0x36; + } + + SHA256_Init(out_inner); + SHA256_Update(out_inner, block, sizeof(block)); + + OPENSSL_memset(block + hmac_key_len, 0x5c, sizeof(block) - hmac_key_len); + for (i = 0; i < hmac_key_len; i++) { + block[i] ^= (0x36 ^ 0x5c); + } + + SHA256_Init(out_outer); + SHA256_Update(out_outer, block, sizeof(block)); +} + +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 *)&ctx->state; + static const size_t hmac_key_len = 32; + + if (key_len < hmac_key_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + const size_t aes_key_len = key_len - hmac_key_len; + if (aes_key_len != 16 && aes_key_len != 32) { + 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_CTR_HMAC_SHA256_TAG_LEN; + } + + if (tag_len > EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + 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); + + return 1; +} + +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; + uint8_t bytes[8]; + + for (i = 0; i < sizeof(bytes); i++) { + bytes[i] = value & 0xff; + value >>= 8; + } + SHA256_Update(sha256, bytes, sizeof(bytes)); +} + +static void hmac_calculate(uint8_t out[SHA256_DIGEST_LENGTH], + const SHA256_CTX *inner_init_state, + const SHA256_CTX *outer_init_state, + const uint8_t *ad, size_t ad_len, + const uint8_t *nonce, const uint8_t *ciphertext, + size_t ciphertext_len) { + SHA256_CTX sha256; + OPENSSL_memcpy(&sha256, inner_init_state, sizeof(sha256)); + hmac_update_uint64(&sha256, ad_len); + hmac_update_uint64(&sha256, ciphertext_len); + SHA256_Update(&sha256, nonce, EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN); + SHA256_Update(&sha256, ad, ad_len); + + // Pad with zeros to the end of the SHA-256 block. + const unsigned num_padding = + (SHA256_CBLOCK - ((sizeof(uint64_t)*2 + + EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN + ad_len) % + SHA256_CBLOCK)) % + SHA256_CBLOCK; + uint8_t padding[SHA256_CBLOCK]; + OPENSSL_memset(padding, 0, num_padding); + SHA256_Update(&sha256, padding, num_padding); + + SHA256_Update(&sha256, ciphertext, ciphertext_len); + + uint8_t inner_digest[SHA256_DIGEST_LENGTH]; + SHA256_Final(inner_digest, &sha256); + + OPENSSL_memcpy(&sha256, outer_init_state, sizeof(sha256)); + SHA256_Update(&sha256, inner_digest, sizeof(inner_digest)); + SHA256_Final(out, &sha256); +} + +static void aead_aes_ctr_hmac_sha256_crypt( + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx, uint8_t *out, + const uint8_t *in, size_t len, const uint8_t *nonce) { + // Since the AEAD operation is one-shot, keeping a buffer of unused keystream + // bytes is pointless. However, |CRYPTO_ctr128_encrypt| requires it. + uint8_t partial_block_buffer[AES_BLOCK_SIZE]; + unsigned partial_block_offset = 0; + OPENSSL_memset(partial_block_buffer, 0, sizeof(partial_block_buffer)); + + uint8_t counter[AES_BLOCK_SIZE]; + OPENSSL_memcpy(counter, nonce, EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN); + OPENSSL_memset(counter + EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN, 0, 4); + + if (aes_ctx->ctr) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, &aes_ctx->ks.ks, counter, + partial_block_buffer, &partial_block_offset, + aes_ctx->ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, &aes_ctx->ks.ks, counter, + partial_block_buffer, &partial_block_offset, + aes_ctx->block); + } +} + +static int aead_aes_ctr_hmac_sha256_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_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) { + // This input is so large it would overflow the 32-bit block counter. + 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_AES_CTR_HMAC_SHA256_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + aead_aes_ctr_hmac_sha256_crypt(aes_ctx, out, in, in_len, nonce); + + uint8_t hmac_result[SHA256_DIGEST_LENGTH]; + hmac_calculate(hmac_result, &aes_ctx->inner_init_state, + &aes_ctx->outer_init_state, ad, ad_len, nonce, out, in_len); + OPENSSL_memcpy(out_tag, hmac_result, ctx->tag_len); + *out_tag_len = ctx->tag_len; + + return 1; +} + +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 = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + uint8_t hmac_result[SHA256_DIGEST_LENGTH]; + hmac_calculate(hmac_result, &aes_ctx->inner_init_state, + &aes_ctx->outer_init_state, ad, ad_len, nonce, in, + in_len); + if (CRYPTO_memcmp(hmac_result, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + aead_aes_ctr_hmac_sha256_crypt(aes_ctx, out, in, in_len, nonce); + + return 1; +} + +static const EVP_AEAD aead_aes_128_ctr_hmac_sha256 = { + 16 /* AES key */ + 32 /* HMAC key */, + 12, // nonce length + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // overhead + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ctr_hmac_sha256_init, + NULL /* init_with_direction */, + aead_aes_ctr_hmac_sha256_cleanup, + NULL /* open */, + aead_aes_ctr_hmac_sha256_seal_scatter, + aead_aes_ctr_hmac_sha256_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_ctr_hmac_sha256 = { + 32 /* AES key */ + 32 /* HMAC key */, + 12, // nonce length + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // overhead + EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ctr_hmac_sha256_init, + NULL /* init_with_direction */, + aead_aes_ctr_hmac_sha256_cleanup, + NULL /* open */, + aead_aes_ctr_hmac_sha256_seal_scatter, + aead_aes_ctr_hmac_sha256_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ctr_hmac_sha256(void) { + return &aead_aes_128_ctr_hmac_sha256; +} + +const EVP_AEAD *EVP_aead_aes_256_ctr_hmac_sha256(void) { + return &aead_aes_256_ctr_hmac_sha256; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c new file mode 100644 index 0000000..9c7e471 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c @@ -0,0 +1,891 @@ +/* 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 "../fipsmodule/cipher/internal.h" + + +#define EVP_AEAD_AES_GCM_SIV_NONCE_LEN 12 +#define EVP_AEAD_AES_GCM_SIV_TAG_LEN 16 + +// 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; +}; + +// 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]); + +// aes256gcmsiv_aes_ks writes an AES-256 key schedule for |key| to +// |out_expanded_key|. +extern void aes256gcmsiv_aes_ks( + 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) { + 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_SIV_TAG_LEN; + } + + if (tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); + assert((((uintptr_t)gcm_siv_ctx) & 15) == 0); + + if (key_bits == 128) { + aes128gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); + gcm_siv_ctx->is_128_bit = 1; + } else { + aes256gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); + gcm_siv_ctx->is_128_bit = 0; + } + + ctx->tag_len = tag_len; + + return 1; +} + +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 +// the POLYVAL key in |key|. +extern void aesgcmsiv_polyval_horner(const uint8_t in_out_poly[16], + const uint8_t key[16], const uint8_t *in, + size_t in_blocks); + +// aesgcmsiv_htable_init writes powers 1..8 of |auth_key| to |out_htable|. +extern void aesgcmsiv_htable_init(uint8_t out_htable[16 * 8], + const uint8_t auth_key[16]); + +// aesgcmsiv_htable6_init writes powers 1..6 of |auth_key| to |out_htable|. +extern void aesgcmsiv_htable6_init(uint8_t out_htable[16 * 6], + const uint8_t auth_key[16]); + +// aesgcmsiv_htable_polyval updates the POLYVAL value in |in_out_poly| to +// include |in_len| bytes of data from |in|. (Where |in_len| must be a multiple +// of 16.) It uses the precomputed powers of the key given in |htable|. +extern void aesgcmsiv_htable_polyval(const uint8_t htable[16 * 8], + const uint8_t *in, size_t in_len, + uint8_t in_out_poly[16]); + +// aes128gcmsiv_dec decrypts |in_len| & ~15 bytes from |out| and writes them to +// |in|. (The full value of |in_len| is still used to find the authentication +// tag appended to the ciphertext, however, so must not be pre-masked.) +// +// |in| and |out| may be equal, but must not otherwise overlap. +// +// While decrypting, it updates the POLYVAL value found at the beginning of +// |in_out_calculated_tag_and_scratch| and writes the updated value back before +// return. During executation, it may use the whole of this space for other +// purposes. In order to decrypt and update the POLYVAL value, it uses the +// expanded key from |key| and the table of powers in |htable|. +extern void aes128gcmsiv_dec(const uint8_t *in, uint8_t *out, + uint8_t in_out_calculated_tag_and_scratch[16 * 8], + const uint8_t htable[16 * 6], + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_dec acts like |aes128gcmsiv_dec|, but for AES-256. +extern void aes256gcmsiv_dec(const uint8_t *in, uint8_t *out, + uint8_t in_out_calculated_tag_and_scratch[16 * 8], + const uint8_t htable[16 * 6], + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes128gcmsiv_kdf performs the AES-GCM-SIV KDF given the expanded key from +// |key_schedule| and the nonce in |nonce|. Note that, while only 12 bytes of +// the nonce are used, 16 bytes are read and so the value must be +// right-padded. +extern void aes128gcmsiv_kdf(const uint8_t nonce[16], + uint64_t out_key_material[8], + const uint8_t *key_schedule); + +// aes256gcmsiv_kdf acts like |aes128gcmsiv_kdf|, but for AES-256. +extern void aes256gcmsiv_kdf(const uint8_t nonce[16], + uint64_t out_key_material[12], + const uint8_t *key_schedule); + +// aes128gcmsiv_aes_ks_enc_x1 performs a key expansion of the AES-128 key in +// |key|, writes the expanded key to |out_expanded_key| and encrypts a single +// block from |in| to |out|. +extern void aes128gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16], + uint8_t out_expanded_key[16 * 15], + const uint64_t key[2]); + +// aes256gcmsiv_aes_ks_enc_x1 acts like |aes128gcmsiv_aes_ks_enc_x1|, but for +// AES-256. +extern void aes256gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16], + uint8_t out_expanded_key[16 * 15], + const uint64_t key[4]); + +// aes128gcmsiv_ecb_enc_block encrypts a single block from |in| to |out| using +// the expanded key in |expanded_key|. +extern void aes128gcmsiv_ecb_enc_block( + const uint8_t in[16], uint8_t out[16], + const struct aead_aes_gcm_siv_asm_ctx *expanded_key); + +// aes256gcmsiv_ecb_enc_block acts like |aes128gcmsiv_ecb_enc_block|, but for +// AES-256. +extern void aes256gcmsiv_ecb_enc_block( + const uint8_t in[16], uint8_t out[16], + const struct aead_aes_gcm_siv_asm_ctx *expanded_key); + +// aes128gcmsiv_enc_msg_x4 encrypts |in_len| bytes from |in| to |out| using the +// expanded key from |key|. (The value of |in_len| must be a multiple of 16.) +// The |in| and |out| buffers may be equal but must not otherwise overlap. The +// initial counter is constructed from the given |tag| as required by +// AES-GCM-SIV. +extern void aes128gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_enc_msg_x4 acts like |aes128gcmsiv_enc_msg_x4|, but for +// AES-256. +extern void aes256gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes128gcmsiv_enc_msg_x8 acts like |aes128gcmsiv_enc_msg_x4|, but is +// optimised for longer messages. +extern void aes128gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_enc_msg_x8 acts like |aes256gcmsiv_enc_msg_x4|, but is +// optimised for longer messages. +extern void aes256gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// gcm_siv_asm_polyval evaluates POLYVAL at |auth_key| on the given plaintext +// and AD. The result is written to |out_tag|. +static void gcm_siv_asm_polyval(uint8_t out_tag[16], const uint8_t *in, + size_t in_len, const uint8_t *ad, size_t ad_len, + const uint8_t auth_key[16], + const uint8_t nonce[12]) { + OPENSSL_memset(out_tag, 0, 16); + const size_t ad_blocks = ad_len / 16; + const size_t in_blocks = in_len / 16; + int htable_init = 0; + alignas(16) uint8_t htable[16*8]; + + if (ad_blocks > 8 || in_blocks > 8) { + htable_init = 1; + aesgcmsiv_htable_init(htable, auth_key); + } + + if (htable_init) { + aesgcmsiv_htable_polyval(htable, ad, ad_len & ~15, out_tag); + } else { + aesgcmsiv_polyval_horner(out_tag, auth_key, ad, ad_blocks); + } + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + aesgcmsiv_polyval_horner(out_tag, auth_key, scratch, 1); + } + + if (htable_init) { + aesgcmsiv_htable_polyval(htable, in, in_len & ~15, out_tag); + } else { + aesgcmsiv_polyval_horner(out_tag, auth_key, in, in_blocks); + } + + if (in_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15); + aesgcmsiv_polyval_horner(out_tag, auth_key, scratch, 1); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = in_len * 8; + aesgcmsiv_polyval_horner(out_tag, auth_key, length_block.c, 1); + + for (size_t i = 0; i < 12; i++) { + out_tag[i] ^= nonce[i]; + } + + out_tag[15] &= 0x7f; +} + +// aead_aes_gcm_siv_asm_crypt_last_block handles the encryption/decryption +// (same thing in CTR mode) of the final block of a plaintext/ciphertext. It +// writes |in_len| & 15 bytes to |out| + |in_len|, based on an initial counter +// derived from |tag|. +static void aead_aes_gcm_siv_asm_crypt_last_block( + int is_128_bit, uint8_t *out, const uint8_t *in, size_t in_len, + const uint8_t tag[16], + const struct aead_aes_gcm_siv_asm_ctx *enc_key_expanded) { + alignas(16) union { + uint8_t c[16]; + uint32_t u32[4]; + } counter; + OPENSSL_memcpy(&counter, tag, sizeof(counter)); + counter.c[15] |= 0x80; + counter.u32[0] += in_len / 16; + + if (is_128_bit) { + aes128gcmsiv_ecb_enc_block(&counter.c[0], &counter.c[0], enc_key_expanded); + } else { + aes256gcmsiv_ecb_enc_block(&counter.c[0], &counter.c[0], enc_key_expanded); + } + + const size_t last_bytes_offset = in_len & ~15; + const size_t last_bytes_len = in_len & 15; + uint8_t *last_bytes_out = &out[last_bytes_offset]; + const uint8_t *last_bytes_in = &in[last_bytes_offset]; + for (size_t i = 0; i < last_bytes_len; i++) { + last_bytes_out[i] = last_bytes_in[i] ^ counter.c[i]; + } +} + +// aead_aes_gcm_siv_kdf calculates the record encryption and authentication +// keys given the |nonce|. +static void aead_aes_gcm_siv_kdf( + int is_128_bit, const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx, + uint64_t out_record_auth_key[2], uint64_t out_record_enc_key[4], + const uint8_t nonce[12]) { + alignas(16) uint8_t padded_nonce[16]; + OPENSSL_memcpy(padded_nonce, nonce, 12); + + alignas(16) uint64_t key_material[12]; + if (is_128_bit) { + aes128gcmsiv_kdf(padded_nonce, key_material, &gcm_siv_ctx->key[0]); + out_record_enc_key[0] = key_material[4]; + out_record_enc_key[1] = key_material[6]; + } else { + aes256gcmsiv_kdf(padded_nonce, key_material, &gcm_siv_ctx->key[0]); + out_record_enc_key[0] = key_material[4]; + out_record_enc_key[1] = key_material[6]; + out_record_enc_key[2] = key_material[8]; + out_record_enc_key[3] = key_material[10]; + } + + out_record_auth_key[0] = key_material[0]; + out_record_auth_key[1] = key_material[2]; +} + +static int aead_aes_gcm_siv_asm_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_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; + + if (in_len_64 > (UINT64_C(1) << 36) || + ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(16) uint64_t record_auth_key[2]; + alignas(16) uint64_t record_enc_key[4]; + aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key, + record_enc_key, nonce); + + alignas(16) uint8_t tag[16] = {0}; + gcm_siv_asm_polyval(tag, in, in_len, ad, ad_len, + (const uint8_t *)record_auth_key, nonce); + + struct aead_aes_gcm_siv_asm_ctx enc_key_expanded; + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0], + record_enc_key); + + if (in_len < 128) { + aes128gcmsiv_enc_msg_x4(in, out, tag, &enc_key_expanded, in_len & ~15); + } else { + aes128gcmsiv_enc_msg_x8(in, out, tag, &enc_key_expanded, in_len & ~15); + } + } else { + aes256gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0], + record_enc_key); + + if (in_len < 128) { + aes256gcmsiv_enc_msg_x4(in, out, tag, &enc_key_expanded, in_len & ~15); + } else { + aes256gcmsiv_enc_msg_x8(in, out, tag, &enc_key_expanded, in_len & ~15); + } + } + + if (in_len & 15) { + aead_aes_gcm_siv_asm_crypt_last_block(gcm_siv_ctx->is_128_bit, out, in, + in_len, tag, &enc_key_expanded); + } + + OPENSSL_memcpy(out_tag, tag, sizeof(tag)); + *out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN; + + return 1; +} + +// TODO(martinkr): Add aead_aes_gcm_siv_asm_open_gather. N.B. aes128gcmsiv_dec +// expects ciphertext and tag in a contiguous buffer. + +static int aead_aes_gcm_siv_asm_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) { + const uint64_t ad_len_64 = ad_len; + if (ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + const uint64_t in_len_64 = in_len; + if (in_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN || + in_len_64 > (UINT64_C(1) << 36) + AES_BLOCK_SIZE) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + 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; + + if (max_out_len < plaintext_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + alignas(16) uint64_t record_auth_key[2]; + alignas(16) uint64_t record_enc_key[4]; + aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key, + record_enc_key, nonce); + + struct aead_aes_gcm_siv_asm_ctx expanded_key; + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_aes_ks((const uint8_t *) record_enc_key, &expanded_key.key[0]); + } else { + aes256gcmsiv_aes_ks((const uint8_t *) record_enc_key, &expanded_key.key[0]); + } + // calculated_tag is 16*8 bytes, rather than 16 bytes, because + // aes[128|256]gcmsiv_dec uses the extra as scratch space. + alignas(16) uint8_t calculated_tag[16 * 8] = {0}; + + OPENSSL_memset(calculated_tag, 0, EVP_AEAD_AES_GCM_SIV_TAG_LEN); + const size_t ad_blocks = ad_len / 16; + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, ad, + ad_blocks); + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + scratch, 1); + } + + alignas(16) uint8_t htable[16 * 6]; + aesgcmsiv_htable6_init(htable, (const uint8_t *)record_auth_key); + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, + plaintext_len); + } else { + aes256gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, + plaintext_len); + } + + if (plaintext_len & 15) { + aead_aes_gcm_siv_asm_crypt_last_block(gcm_siv_ctx->is_128_bit, out, in, + plaintext_len, given_tag, + &expanded_key); + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, out + (plaintext_len & ~15), plaintext_len & 15); + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + scratch, 1); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = plaintext_len * 8; + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + length_block.c, 1); + + for (size_t i = 0; i < 12; i++) { + calculated_tag[i] ^= nonce[i]; + } + + calculated_tag[15] &= 0x7f; + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_ecb_enc_block(calculated_tag, calculated_tag, &expanded_key); + } else { + aes256gcmsiv_ecb_enc_block(calculated_tag, calculated_tag, &expanded_key); + } + + if (CRYPTO_memcmp(calculated_tag, given_tag, EVP_AEAD_AES_GCM_SIV_TAG_LEN) != + 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + *out_len = in_len - EVP_AEAD_AES_GCM_SIV_TAG_LEN; + return 1; +} + +static const EVP_AEAD aead_aes_128_gcm_siv_asm = { + 16, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_asm_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_asm_cleanup, + aead_aes_gcm_siv_asm_open, + aead_aes_gcm_siv_asm_seal_scatter, + NULL /* open_gather */, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_gcm_siv_asm = { + 32, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_asm_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_asm_cleanup, + aead_aes_gcm_siv_asm_open, + aead_aes_gcm_siv_asm_seal_scatter, + NULL /* open_gather */, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +#endif // X86_64 && !NO_ASM && !WINDOWS + +struct aead_aes_gcm_siv_ctx { + union { + double align; + AES_KEY ks; + } ks; + block128_f kgk_block; + 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; + + 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_SIV_TAG_LEN; + } + if (tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (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->tag_len = tag_len; + + return 1; +} + +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 +// mode, starting at |initial_counter|. This differs from the traditional +// counter mode code in that the counter is handled little-endian, only the +// first four bytes are used and the GCM-SIV tweak to the final byte is +// applied. The |in| and |out| pointers may be equal but otherwise must not +// alias. +static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len, + const uint8_t initial_counter[AES_BLOCK_SIZE], + block128_f enc_block, const AES_KEY *key) { + union { + uint32_t w[4]; + uint8_t c[16]; + } counter; + + OPENSSL_memcpy(counter.c, initial_counter, AES_BLOCK_SIZE); + counter.c[15] |= 0x80; + + for (size_t done = 0; done < in_len;) { + uint8_t keystream[AES_BLOCK_SIZE]; + enc_block(counter.c, keystream, key); + counter.w[0]++; + + size_t todo = AES_BLOCK_SIZE; + if (in_len - done < todo) { + todo = in_len - done; + } + + for (size_t i = 0; i < todo; i++) { + out[done + i] = keystream[i] ^ in[done + i]; + } + + done += todo; + } +} + +// gcm_siv_polyval evaluates POLYVAL at |auth_key| on the given plaintext and +// AD. The result is written to |out_tag|. +static void gcm_siv_polyval( + uint8_t out_tag[16], const uint8_t *in, size_t in_len, const uint8_t *ad, + size_t ad_len, const uint8_t auth_key[16], + const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) { + struct polyval_ctx polyval_ctx; + CRYPTO_POLYVAL_init(&polyval_ctx, auth_key); + + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, ad, ad_len & ~15); + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, scratch, sizeof(scratch)); + } + + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, in, in_len & ~15); + if (in_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15); + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, scratch, sizeof(scratch)); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = in_len * 8; + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c, + sizeof(length_block)); + + CRYPTO_POLYVAL_finish(&polyval_ctx, out_tag); + for (size_t i = 0; i < EVP_AEAD_AES_GCM_SIV_NONCE_LEN; i++) { + out_tag[i] ^= nonce[i]; + } + out_tag[15] &= 0x7f; +} + +// gcm_siv_record_keys contains the keys used for a specific GCM-SIV record. +struct gcm_siv_record_keys { + uint8_t auth_key[16]; + union { + double align; + AES_KEY ks; + } enc_key; + block128_f enc_block; +}; + +// gcm_siv_keys calculates the keys for a specific GCM-SIV record with the +// given nonce and writes them to |*out_keys|. +static void gcm_siv_keys( + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx, + struct gcm_siv_record_keys *out_keys, + const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) { + const AES_KEY *const key = &gcm_siv_ctx->ks.ks; + uint8_t key_material[(128 /* POLYVAL key */ + 256 /* max AES key */) / 8]; + const size_t blocks_needed = gcm_siv_ctx->is_256 ? 6 : 4; + + uint8_t counter[AES_BLOCK_SIZE]; + OPENSSL_memset(counter, 0, AES_BLOCK_SIZE - EVP_AEAD_AES_GCM_SIV_NONCE_LEN); + OPENSSL_memcpy(counter + AES_BLOCK_SIZE - EVP_AEAD_AES_GCM_SIV_NONCE_LEN, + nonce, EVP_AEAD_AES_GCM_SIV_NONCE_LEN); + for (size_t i = 0; i < blocks_needed; i++) { + counter[0] = i; + + uint8_t ciphertext[AES_BLOCK_SIZE]; + gcm_siv_ctx->kgk_block(counter, ciphertext, key); + OPENSSL_memcpy(&key_material[i * 8], ciphertext, 8); + } + + 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); +} + +static int aead_aes_gcm_siv_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_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; + + if (in_len + EVP_AEAD_AES_GCM_SIV_TAG_LEN < in_len || + in_len_64 > (UINT64_C(1) << 36) || + ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + struct gcm_siv_record_keys keys; + gcm_siv_keys(gcm_siv_ctx, &keys, nonce); + + uint8_t tag[16]; + gcm_siv_polyval(tag, in, in_len, ad, ad_len, keys.auth_key, nonce); + keys.enc_block(tag, tag, &keys.enc_key.ks); + + gcm_siv_crypt(out, in, in_len, tag, keys.enc_block, &keys.enc_key.ks); + + OPENSSL_memcpy(out_tag, tag, EVP_AEAD_AES_GCM_SIV_TAG_LEN); + *out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN; + + return 1; +} + +static int aead_aes_gcm_siv_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 uint64_t ad_len_64 = ad_len; + if (ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + const uint64_t in_len_64 = in_len; + if (in_tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN || + in_len_64 > (UINT64_C(1) << 36) + AES_BLOCK_SIZE) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + 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_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); + + gcm_siv_crypt(out, in, in_len, in_tag, keys.enc_block, &keys.enc_key.ks); + + uint8_t expected_tag[EVP_AEAD_AES_GCM_SIV_TAG_LEN]; + gcm_siv_polyval(expected_tag, out, in_len, ad, ad_len, keys.auth_key, nonce); + keys.enc_block(expected_tag, expected_tag, &keys.enc_key.ks); + + if (CRYPTO_memcmp(expected_tag, in_tag, sizeof(expected_tag)) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static const EVP_AEAD aead_aes_128_gcm_siv = { + 16, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_cleanup, + NULL /* open */, + aead_aes_gcm_siv_seal_scatter, + aead_aes_gcm_siv_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_gcm_siv = { + 32, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_cleanup, + NULL /* open */, + aead_aes_gcm_siv_seal_scatter, + aead_aes_gcm_siv_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +#if defined(AES_GCM_SIV_ASM) + +static char avx_aesni_capable(void) { + const uint32_t ecx = OPENSSL_ia32cap_P[1]; + + return (ecx & (1 << (57 - 32))) != 0 /* AESNI */ && + (ecx & (1 << 28)) != 0 /* AVX */; +} + +const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void) { + if (avx_aesni_capable()) { + return &aead_aes_128_gcm_siv_asm; + } + return &aead_aes_128_gcm_siv; +} + +const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { + if (avx_aesni_capable()) { + return &aead_aes_256_gcm_siv_asm; + } + return &aead_aes_256_gcm_siv; +} + +#else + +const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void) { + return &aead_aes_128_gcm_siv; +} + +const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { + return &aead_aes_256_gcm_siv; +} + +#endif // AES_GCM_SIV_ASM diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back new file mode 100644 index 0000000..d717572 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back @@ -0,0 +1,891 @@ +/* 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 "../fipsmodule/cipher/internal.h" + + +#define EVP_AEAD_AES_GCM_SIV_NONCE_LEN 12 +#define EVP_AEAD_AES_GCM_SIV_TAG_LEN 16 + +// 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; +}; + +// 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]); + +// aes256gcmsiv_aes_ks writes an AES-256 key schedule for |key| to +// |out_expanded_key|. +extern void aes256gcmsiv_aes_ks( + 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) { + 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_SIV_TAG_LEN; + } + + if (tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); + assert((((uintptr_t)gcm_siv_ctx) & 15) == 0); + + if (key_bits == 128) { + aes128gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); + gcm_siv_ctx->is_128_bit = 1; + } else { + aes256gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); + gcm_siv_ctx->is_128_bit = 0; + } + + ctx->tag_len = tag_len; + + return 1; +} + +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 +// the POLYVAL key in |key|. +extern void aesgcmsiv_polyval_horner(const uint8_t in_out_poly[16], + const uint8_t key[16], const uint8_t *in, + size_t in_blocks); + +// aesgcmsiv_htable_init writes powers 1..8 of |auth_key| to |out_htable|. +extern void aesgcmsiv_htable_init(uint8_t out_htable[16 * 8], + const uint8_t auth_key[16]); + +// aesgcmsiv_htable6_init writes powers 1..6 of |auth_key| to |out_htable|. +extern void aesgcmsiv_htable6_init(uint8_t out_htable[16 * 6], + const uint8_t auth_key[16]); + +// aesgcmsiv_htable_polyval updates the POLYVAL value in |in_out_poly| to +// include |in_len| bytes of data from |in|. (Where |in_len| must be a multiple +// of 16.) It uses the precomputed powers of the key given in |htable|. +extern void aesgcmsiv_htable_polyval(const uint8_t htable[16 * 8], + const uint8_t *in, size_t in_len, + uint8_t in_out_poly[16]); + +// aes128gcmsiv_dec decrypts |in_len| & ~15 bytes from |out| and writes them to +// |in|. (The full value of |in_len| is still used to find the authentication +// tag appended to the ciphertext, however, so must not be pre-masked.) +// +// |in| and |out| may be equal, but must not otherwise overlap. +// +// While decrypting, it updates the POLYVAL value found at the beginning of +// |in_out_calculated_tag_and_scratch| and writes the updated value back before +// return. During executation, it may use the whole of this space for other +// purposes. In order to decrypt and update the POLYVAL value, it uses the +// expanded key from |key| and the table of powers in |htable|. +extern void aes128gcmsiv_dec(const uint8_t *in, uint8_t *out, + uint8_t in_out_calculated_tag_and_scratch[16 * 8], + const uint8_t htable[16 * 6], + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_dec acts like |aes128gcmsiv_dec|, but for AES-256. +extern void aes256gcmsiv_dec(const uint8_t *in, uint8_t *out, + uint8_t in_out_calculated_tag_and_scratch[16 * 8], + const uint8_t htable[16 * 6], + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes128gcmsiv_kdf performs the AES-GCM-SIV KDF given the expanded key from +// |key_schedule| and the nonce in |nonce|. Note that, while only 12 bytes of +// the nonce are used, 16 bytes are read and so the value must be +// right-padded. +extern void aes128gcmsiv_kdf(const uint8_t nonce[16], + uint64_t out_key_material[8], + const uint8_t *key_schedule); + +// aes256gcmsiv_kdf acts like |aes128gcmsiv_kdf|, but for AES-256. +extern void aes256gcmsiv_kdf(const uint8_t nonce[16], + uint64_t out_key_material[12], + const uint8_t *key_schedule); + +// aes128gcmsiv_aes_ks_enc_x1 performs a key expansion of the AES-128 key in +// |key|, writes the expanded key to |out_expanded_key| and encrypts a single +// block from |in| to |out|. +extern void aes128gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16], + uint8_t out_expanded_key[16 * 15], + const uint64_t key[2]); + +// aes256gcmsiv_aes_ks_enc_x1 acts like |aes128gcmsiv_aes_ks_enc_x1|, but for +// AES-256. +extern void aes256gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16], + uint8_t out_expanded_key[16 * 15], + const uint64_t key[4]); + +// aes128gcmsiv_ecb_enc_block encrypts a single block from |in| to |out| using +// the expanded key in |expanded_key|. +extern void aes128gcmsiv_ecb_enc_block( + const uint8_t in[16], uint8_t out[16], + const struct aead_aes_gcm_siv_asm_ctx *expanded_key); + +// aes256gcmsiv_ecb_enc_block acts like |aes128gcmsiv_ecb_enc_block|, but for +// AES-256. +extern void aes256gcmsiv_ecb_enc_block( + const uint8_t in[16], uint8_t out[16], + const struct aead_aes_gcm_siv_asm_ctx *expanded_key); + +// aes128gcmsiv_enc_msg_x4 encrypts |in_len| bytes from |in| to |out| using the +// expanded key from |key|. (The value of |in_len| must be a multiple of 16.) +// The |in| and |out| buffers may be equal but must not otherwise overlap. The +// initial counter is constructed from the given |tag| as required by +// AES-GCM-SIV. +extern void aes128gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_enc_msg_x4 acts like |aes128gcmsiv_enc_msg_x4|, but for +// AES-256. +extern void aes256gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes128gcmsiv_enc_msg_x8 acts like |aes128gcmsiv_enc_msg_x4|, but is +// optimised for longer messages. +extern void aes128gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// aes256gcmsiv_enc_msg_x8 acts like |aes256gcmsiv_enc_msg_x4|, but is +// optimised for longer messages. +extern void aes256gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out, + const uint8_t *tag, + const struct aead_aes_gcm_siv_asm_ctx *key, + size_t in_len); + +// gcm_siv_asm_polyval evaluates POLYVAL at |auth_key| on the given plaintext +// and AD. The result is written to |out_tag|. +static void gcm_siv_asm_polyval(uint8_t out_tag[16], const uint8_t *in, + size_t in_len, const uint8_t *ad, size_t ad_len, + const uint8_t auth_key[16], + const uint8_t nonce[12]) { + OPENSSL_memset(out_tag, 0, 16); + const size_t ad_blocks = ad_len / 16; + const size_t in_blocks = in_len / 16; + int htable_init = 0; + alignas(16) uint8_t htable[16*8]; + + if (ad_blocks > 8 || in_blocks > 8) { + htable_init = 1; + aesgcmsiv_htable_init(htable, auth_key); + } + + if (htable_init) { + aesgcmsiv_htable_polyval(htable, ad, ad_len & ~15, out_tag); + } else { + aesgcmsiv_polyval_horner(out_tag, auth_key, ad, ad_blocks); + } + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + aesgcmsiv_polyval_horner(out_tag, auth_key, scratch, 1); + } + + if (htable_init) { + aesgcmsiv_htable_polyval(htable, in, in_len & ~15, out_tag); + } else { + aesgcmsiv_polyval_horner(out_tag, auth_key, in, in_blocks); + } + + if (in_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15); + aesgcmsiv_polyval_horner(out_tag, auth_key, scratch, 1); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = in_len * 8; + aesgcmsiv_polyval_horner(out_tag, auth_key, length_block.c, 1); + + for (size_t i = 0; i < 12; i++) { + out_tag[i] ^= nonce[i]; + } + + out_tag[15] &= 0x7f; +} + +// aead_aes_gcm_siv_asm_crypt_last_block handles the encryption/decryption +// (same thing in CTR mode) of the final block of a plaintext/ciphertext. It +// writes |in_len| & 15 bytes to |out| + |in_len|, based on an initial counter +// derived from |tag|. +static void aead_aes_gcm_siv_asm_crypt_last_block( + int is_128_bit, uint8_t *out, const uint8_t *in, size_t in_len, + const uint8_t tag[16], + const struct aead_aes_gcm_siv_asm_ctx *enc_key_expanded) { + alignas(16) union { + uint8_t c[16]; + uint32_t u32[4]; + } counter; + OPENSSL_memcpy(&counter, tag, sizeof(counter)); + counter.c[15] |= 0x80; + counter.u32[0] += in_len / 16; + + if (is_128_bit) { + aes128gcmsiv_ecb_enc_block(&counter.c[0], &counter.c[0], enc_key_expanded); + } else { + aes256gcmsiv_ecb_enc_block(&counter.c[0], &counter.c[0], enc_key_expanded); + } + + const size_t last_bytes_offset = in_len & ~15; + const size_t last_bytes_len = in_len & 15; + uint8_t *last_bytes_out = &out[last_bytes_offset]; + const uint8_t *last_bytes_in = &in[last_bytes_offset]; + for (size_t i = 0; i < last_bytes_len; i++) { + last_bytes_out[i] = last_bytes_in[i] ^ counter.c[i]; + } +} + +// aead_aes_gcm_siv_kdf calculates the record encryption and authentication +// keys given the |nonce|. +static void aead_aes_gcm_siv_kdf( + int is_128_bit, const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx, + uint64_t out_record_auth_key[2], uint64_t out_record_enc_key[4], + const uint8_t nonce[12]) { + alignas(16) uint8_t padded_nonce[16]; + OPENSSL_memcpy(padded_nonce, nonce, 12); + + alignas(16) uint64_t key_material[12]; + if (is_128_bit) { + aes128gcmsiv_kdf(padded_nonce, key_material, &gcm_siv_ctx->key[0]); + out_record_enc_key[0] = key_material[4]; + out_record_enc_key[1] = key_material[6]; + } else { + aes256gcmsiv_kdf(padded_nonce, key_material, &gcm_siv_ctx->key[0]); + out_record_enc_key[0] = key_material[4]; + out_record_enc_key[1] = key_material[6]; + out_record_enc_key[2] = key_material[8]; + out_record_enc_key[3] = key_material[10]; + } + + out_record_auth_key[0] = key_material[0]; + out_record_auth_key[1] = key_material[2]; +} + +static int aead_aes_gcm_siv_asm_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_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; + + if (in_len_64 > (UINT64_C(1) << 36) || + ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(16) uint64_t record_auth_key[2]; + alignas(16) uint64_t record_enc_key[4]; + aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key, + record_enc_key, nonce); + + alignas(16) uint8_t tag[16] = {0}; + gcm_siv_asm_polyval(tag, in, in_len, ad, ad_len, + (const uint8_t *)record_auth_key, nonce); + + struct aead_aes_gcm_siv_asm_ctx enc_key_expanded; + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0], + record_enc_key); + + if (in_len < 128) { + aes128gcmsiv_enc_msg_x4(in, out, tag, &enc_key_expanded, in_len & ~15); + } else { + aes128gcmsiv_enc_msg_x8(in, out, tag, &enc_key_expanded, in_len & ~15); + } + } else { + aes256gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0], + record_enc_key); + + if (in_len < 128) { + aes256gcmsiv_enc_msg_x4(in, out, tag, &enc_key_expanded, in_len & ~15); + } else { + aes256gcmsiv_enc_msg_x8(in, out, tag, &enc_key_expanded, in_len & ~15); + } + } + + if (in_len & 15) { + aead_aes_gcm_siv_asm_crypt_last_block(gcm_siv_ctx->is_128_bit, out, in, + in_len, tag, &enc_key_expanded); + } + + OPENSSL_memcpy(out_tag, tag, sizeof(tag)); + *out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN; + + return 1; +} + +// TODO(martinkr): Add aead_aes_gcm_siv_asm_open_gather. N.B. aes128gcmsiv_dec +// expects ciphertext and tag in a contiguous buffer. + +static int aead_aes_gcm_siv_asm_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) { + const uint64_t ad_len_64 = ad_len; + if (ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + const uint64_t in_len_64 = in_len; + if (in_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN || + in_len_64 > (UINT64_C(1) << 36) + AES_BLOCK_SIZE) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + 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; + + if (max_out_len < plaintext_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + alignas(16) uint64_t record_auth_key[2]; + alignas(16) uint64_t record_enc_key[4]; + aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key, + record_enc_key, nonce); + + struct aead_aes_gcm_siv_asm_ctx expanded_key; + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_aes_ks((const uint8_t *) record_enc_key, &expanded_key.key[0]); + } else { + aes256gcmsiv_aes_ks((const uint8_t *) record_enc_key, &expanded_key.key[0]); + } + // calculated_tag is 16*8 bytes, rather than 16 bytes, because + // aes[128|256]gcmsiv_dec uses the extra as scratch space. + alignas(16) uint8_t calculated_tag[16 * 8] = {0}; + + OPENSSL_memset(calculated_tag, 0, EVP_AEAD_AES_GCM_SIV_TAG_LEN); + const size_t ad_blocks = ad_len / 16; + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, ad, + ad_blocks); + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + scratch, 1); + } + + alignas(16) uint8_t htable[16 * 6]; + aesgcmsiv_htable6_init(htable, (const uint8_t *)record_auth_key); + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, + plaintext_len); + } else { + aes256gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, + plaintext_len); + } + + if (plaintext_len & 15) { + aead_aes_gcm_siv_asm_crypt_last_block(gcm_siv_ctx->is_128_bit, out, in, + plaintext_len, given_tag, + &expanded_key); + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, out + (plaintext_len & ~15), plaintext_len & 15); + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + scratch, 1); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = plaintext_len * 8; + aesgcmsiv_polyval_horner(calculated_tag, (const uint8_t *)record_auth_key, + length_block.c, 1); + + for (size_t i = 0; i < 12; i++) { + calculated_tag[i] ^= nonce[i]; + } + + calculated_tag[15] &= 0x7f; + + if (gcm_siv_ctx->is_128_bit) { + aes128gcmsiv_ecb_enc_block(calculated_tag, calculated_tag, &expanded_key); + } else { + aes256gcmsiv_ecb_enc_block(calculated_tag, calculated_tag, &expanded_key); + } + + if (CRYPTO_memcmp(calculated_tag, given_tag, EVP_AEAD_AES_GCM_SIV_TAG_LEN) != + 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + *out_len = in_len - EVP_AEAD_AES_GCM_SIV_TAG_LEN; + return 1; +} + +static const EVP_AEAD aead_aes_128_gcm_siv_asm = { + 16, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_asm_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_asm_cleanup, + aead_aes_gcm_siv_asm_open, + aead_aes_gcm_siv_asm_seal_scatter, + NULL /* open_gather */, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_gcm_siv_asm = { + 32, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_asm_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_asm_cleanup, + aead_aes_gcm_siv_asm_open, + aead_aes_gcm_siv_asm_seal_scatter, + NULL /* open_gather */, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +#endif // X86_64 && !NO_ASM && !WINDOWS + +struct aead_aes_gcm_siv_ctx { + union { + double align; + AES_KEY ks; + } ks; + block128_f kgk_block; + 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; + + 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_SIV_TAG_LEN; + } + if (tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (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->tag_len = tag_len; + + return 1; +} + +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 +// mode, starting at |initial_counter|. This differs from the traditional +// counter mode code in that the counter is handled little-endian, only the +// first four bytes are used and the GCM-SIV tweak to the final byte is +// applied. The |in| and |out| pointers may be equal but otherwise must not +// alias. +static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len, + const uint8_t initial_counter[AES_BLOCK_SIZE], + block128_f enc_block, const AES_KEY *key) { + union { + uint32_t w[4]; + uint8_t c[16]; + } counter; + + OPENSSL_memcpy(counter.c, initial_counter, AES_BLOCK_SIZE); + counter.c[15] |= 0x80; + + for (size_t done = 0; done < in_len;) { + uint8_t keystream[AES_BLOCK_SIZE]; + enc_block(counter.c, keystream, key); + counter.w[0]++; + + size_t todo = AES_BLOCK_SIZE; + if (in_len - done < todo) { + todo = in_len - done; + } + + for (size_t i = 0; i < todo; i++) { + out[done + i] = keystream[i] ^ in[done + i]; + } + + done += todo; + } +} + +// gcm_siv_polyval evaluates POLYVAL at |auth_key| on the given plaintext and +// AD. The result is written to |out_tag|. +static void gcm_siv_polyval( + uint8_t out_tag[16], const uint8_t *in, size_t in_len, const uint8_t *ad, + size_t ad_len, const uint8_t auth_key[16], + const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) { + struct polyval_ctx polyval_ctx; + CRYPTO_POLYVAL_init(&polyval_ctx, auth_key); + + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, ad, ad_len & ~15); + + uint8_t scratch[16]; + if (ad_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15); + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, scratch, sizeof(scratch)); + } + + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, in, in_len & ~15); + if (in_len & 15) { + OPENSSL_memset(scratch, 0, sizeof(scratch)); + OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15); + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, scratch, sizeof(scratch)); + } + + union { + uint8_t c[16]; + struct { + uint64_t ad; + uint64_t in; + } bitlens; + } length_block; + + length_block.bitlens.ad = ad_len * 8; + length_block.bitlens.in = in_len * 8; + CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c, + sizeof(length_block)); + + CRYPTO_POLYVAL_finish(&polyval_ctx, out_tag); + for (size_t i = 0; i < EVP_AEAD_AES_GCM_SIV_NONCE_LEN; i++) { + out_tag[i] ^= nonce[i]; + } + out_tag[15] &= 0x7f; +} + +// gcm_siv_record_keys contains the keys used for a specific GCM-SIV record. +struct gcm_siv_record_keys { + uint8_t auth_key[16]; + union { + double align; + AES_KEY ks; + } enc_key; + block128_f enc_block; +}; + +// gcm_siv_keys calculates the keys for a specific GCM-SIV record with the +// given nonce and writes them to |*out_keys|. +static void gcm_siv_keys( + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx, + struct gcm_siv_record_keys *out_keys, + const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) { + const AES_KEY *const key = &gcm_siv_ctx->ks.ks; + uint8_t key_material[(128 /* POLYVAL key */ + 256 /* max AES key */) / 8]; + const size_t blocks_needed = gcm_siv_ctx->is_256 ? 6 : 4; + + uint8_t counter[AES_BLOCK_SIZE]; + OPENSSL_memset(counter, 0, AES_BLOCK_SIZE - EVP_AEAD_AES_GCM_SIV_NONCE_LEN); + OPENSSL_memcpy(counter + AES_BLOCK_SIZE - EVP_AEAD_AES_GCM_SIV_NONCE_LEN, + nonce, EVP_AEAD_AES_GCM_SIV_NONCE_LEN); + for (size_t i = 0; i < blocks_needed; i++) { + counter[0] = i; + + uint8_t ciphertext[AES_BLOCK_SIZE]; + gcm_siv_ctx->kgk_block(counter, ciphertext, key); + OPENSSL_memcpy(&key_material[i * 8], ciphertext, 8); + } + + 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); +} + +static int aead_aes_gcm_siv_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_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; + + if (in_len + EVP_AEAD_AES_GCM_SIV_TAG_LEN < in_len || + in_len_64 > (UINT64_C(1) << 36) || + ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < EVP_AEAD_AES_GCM_SIV_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + struct gcm_siv_record_keys keys; + gcm_siv_keys(gcm_siv_ctx, &keys, nonce); + + uint8_t tag[16]; + gcm_siv_polyval(tag, in, in_len, ad, ad_len, keys.auth_key, nonce); + keys.enc_block(tag, tag, &keys.enc_key.ks); + + gcm_siv_crypt(out, in, in_len, tag, keys.enc_block, &keys.enc_key.ks); + + OPENSSL_memcpy(out_tag, tag, EVP_AEAD_AES_GCM_SIV_TAG_LEN); + *out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN; + + return 1; +} + +static int aead_aes_gcm_siv_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 uint64_t ad_len_64 = ad_len; + if (ad_len_64 >= (UINT64_C(1) << 61)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + const uint64_t in_len_64 = in_len; + if (in_tag_len != EVP_AEAD_AES_GCM_SIV_TAG_LEN || + in_len_64 > (UINT64_C(1) << 36) + AES_BLOCK_SIZE) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + 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_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); + + gcm_siv_crypt(out, in, in_len, in_tag, keys.enc_block, &keys.enc_key.ks); + + uint8_t expected_tag[EVP_AEAD_AES_GCM_SIV_TAG_LEN]; + gcm_siv_polyval(expected_tag, out, in_len, ad, ad_len, keys.auth_key, nonce); + keys.enc_block(expected_tag, expected_tag, &keys.enc_key.ks); + + if (CRYPTO_memcmp(expected_tag, in_tag, sizeof(expected_tag)) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static const EVP_AEAD aead_aes_128_gcm_siv = { + 16, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_cleanup, + NULL /* open */, + aead_aes_gcm_siv_seal_scatter, + aead_aes_gcm_siv_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +static const EVP_AEAD aead_aes_256_gcm_siv = { + 32, // key length + EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead + EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_gcm_siv_init, + NULL /* init_with_direction */, + aead_aes_gcm_siv_cleanup, + NULL /* open */, + aead_aes_gcm_siv_seal_scatter, + aead_aes_gcm_siv_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +#if defined(AES_GCM_SIV_ASM) + +static char avx_aesni_capable(void) { + const uint32_t ecx = OPENSSL_ia32cap_P[1]; + + return (ecx & (1 << (57 - 32))) != 0 /* AESNI */ && + (ecx & (1 << 28)) != 0 /* AVX */; +} + +const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void) { + if (avx_aesni_capable()) { + return &aead_aes_128_gcm_siv_asm; + } + return &aead_aes_128_gcm_siv; +} + +const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { + if (avx_aesni_capable()) { + return &aead_aes_256_gcm_siv_asm; + } + return &aead_aes_256_gcm_siv; +} + +#else + +const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void) { + return &aead_aes_128_gcm_siv; +} + +const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { + return &aead_aes_256_gcm_siv; +} + +#endif // AES_GCM_SIV_ASM diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c new file mode 100644 index 0000000..cb0ee40 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back new file mode 100644 index 0000000..1c175e9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c new file mode 100644 index 0000000..3822dc3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c @@ -0,0 +1,85 @@ +/* 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" + + +static int null_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + return 1; +} + +static int null_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + if (in != out) { + OPENSSL_memcpy(out, in, in_len); + } + return 1; +} + +static const EVP_CIPHER n_cipher = { + NID_undef, 1 /* block size */, 0 /* key_len */, 0 /* iv_len */, + 0 /* ctx_size */, 0 /* flags */, NULL /* app_data */, null_init_key, + null_cipher, NULL /* cleanup */, NULL /* ctrl */, +}; + +const EVP_CIPHER *EVP_enc_null(void) { return &n_cipher; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c.grpc_back new file mode 100644 index 0000000..f5fe8fb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c.grpc_back @@ -0,0 +1,85 @@ +/* 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" + + +static int null_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + return 1; +} + +static int null_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + if (in != out) { + OPENSSL_memcpy(out, in, in_len); + } + return 1; +} + +static const EVP_CIPHER n_cipher = { + NID_undef, 1 /* block size */, 0 /* key_len */, 0 /* iv_len */, + 0 /* ctx_size */, 0 /* flags */, NULL /* app_data */, null_init_key, + null_cipher, NULL /* cleanup */, NULL /* ctrl */, +}; + +const EVP_CIPHER *EVP_enc_null(void) { return &n_cipher; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c new file mode 100644 index 0000000..c9f789a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c @@ -0,0 +1,462 @@ +/* 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 "../internal.h" + + +#define c2l(c, l) \ + do { \ + (l) = ((uint32_t)(*((c)++))); \ + (l) |= ((uint32_t)(*((c)++))) << 8L; \ + (l) |= ((uint32_t)(*((c)++))) << 16L; \ + (l) |= ((uint32_t)(*((c)++))) << 24L; \ + } while (0) + +#define c2ln(c, l1, l2, n) \ + do { \ + (c) += (n); \ + (l1) = (l2) = 0; \ + switch (n) { \ + case 8: \ + (l2) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + (l2) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + (l2) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + (l2) |= ((uint32_t)(*(--(c)))); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + (l1) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + (l1) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + (l1) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + (l1) |= ((uint32_t)(*(--(c)))); \ + } \ + } while (0) + +#define l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8L) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16L) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 24L) & 0xff); \ + } while (0) + +#define l2cn(l1, l2, c, n) \ + do { \ + (c) += (n); \ + switch (n) { \ + case 8: \ + *(--(c)) = (uint8_t)(((l2) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + *(--(c)) = (uint8_t)(((l2) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + *(--(c)) = (uint8_t)(((l2) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + *(--(c)) = (uint8_t)(((l2)) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + *(--(c)) = (uint8_t)(((l1) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + *(--(c)) = (uint8_t)(((l1) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + *(--(c)) = (uint8_t)(((l1) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + *(--(c)) = (uint8_t)(((l1)) & 0xff); \ + } \ + } while (0) + +typedef struct rc2_key_st { uint16_t data[64]; } RC2_KEY; + +static void RC2_encrypt(uint32_t *d, RC2_KEY *key) { + int i, n; + uint16_t *p0, *p1; + uint16_t x0, x1, x2, x3, t; + uint32_t l; + + l = d[0]; + x0 = (uint16_t)l & 0xffff; + x1 = (uint16_t)(l >> 16L); + l = d[1]; + x2 = (uint16_t)l & 0xffff; + x3 = (uint16_t)(l >> 16L); + + n = 3; + i = 5; + + p0 = p1 = &key->data[0]; + for (;;) { + t = (x0 + (x1 & ~x3) + (x2 & x3) + *(p0++)) & 0xffff; + x0 = (t << 1) | (t >> 15); + t = (x1 + (x2 & ~x0) + (x3 & x0) + *(p0++)) & 0xffff; + x1 = (t << 2) | (t >> 14); + t = (x2 + (x3 & ~x1) + (x0 & x1) + *(p0++)) & 0xffff; + x2 = (t << 3) | (t >> 13); + t = (x3 + (x0 & ~x2) + (x1 & x2) + *(p0++)) & 0xffff; + x3 = (t << 5) | (t >> 11); + + if (--i == 0) { + if (--n == 0) { + break; + } + i = (n == 2) ? 6 : 5; + + x0 += p1[x3 & 0x3f]; + x1 += p1[x0 & 0x3f]; + x2 += p1[x1 & 0x3f]; + x3 += p1[x2 & 0x3f]; + } + } + + d[0] = (uint32_t)(x0 & 0xffff) | ((uint32_t)(x1 & 0xffff) << 16L); + d[1] = (uint32_t)(x2 & 0xffff) | ((uint32_t)(x3 & 0xffff) << 16L); +} + +static void RC2_decrypt(uint32_t *d, RC2_KEY *key) { + int i, n; + uint16_t *p0, *p1; + uint16_t x0, x1, x2, x3, t; + uint32_t l; + + l = d[0]; + x0 = (uint16_t)l & 0xffff; + x1 = (uint16_t)(l >> 16L); + l = d[1]; + x2 = (uint16_t)l & 0xffff; + x3 = (uint16_t)(l >> 16L); + + n = 3; + i = 5; + + p0 = &key->data[63]; + p1 = &key->data[0]; + for (;;) { + t = ((x3 << 11) | (x3 >> 5)) & 0xffff; + x3 = (t - (x0 & ~x2) - (x1 & x2) - *(p0--)) & 0xffff; + t = ((x2 << 13) | (x2 >> 3)) & 0xffff; + x2 = (t - (x3 & ~x1) - (x0 & x1) - *(p0--)) & 0xffff; + t = ((x1 << 14) | (x1 >> 2)) & 0xffff; + x1 = (t - (x2 & ~x0) - (x3 & x0) - *(p0--)) & 0xffff; + t = ((x0 << 15) | (x0 >> 1)) & 0xffff; + x0 = (t - (x1 & ~x3) - (x2 & x3) - *(p0--)) & 0xffff; + + if (--i == 0) { + if (--n == 0) { + break; + } + i = (n == 2) ? 6 : 5; + + x3 = (x3 - p1[x2 & 0x3f]) & 0xffff; + x2 = (x2 - p1[x1 & 0x3f]) & 0xffff; + x1 = (x1 - p1[x0 & 0x3f]) & 0xffff; + x0 = (x0 - p1[x3 & 0x3f]) & 0xffff; + } + } + + d[0] = (uint32_t)(x0 & 0xffff) | ((uint32_t)(x1 & 0xffff) << 16L); + d[1] = (uint32_t)(x2 & 0xffff) | ((uint32_t)(x3 & 0xffff) << 16L); +} + +static void RC2_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + RC2_KEY *ks, uint8_t *iv, int encrypt) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + long l = length; + uint32_t tin[2]; + + if (encrypt) { + c2l(iv, tout0); + c2l(iv, tout1); + iv -= 8; + for (l -= 8; l >= 0; l -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin1 ^= tout1; + tin[0] = tin0; + tin[1] = tin1; + RC2_encrypt(tin, ks); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + if (l != -8) { + c2ln(in, tin0, tin1, l + 8); + tin0 ^= tout0; + tin1 ^= tout1; + tin[0] = tin0; + tin[1] = tin1; + RC2_encrypt(tin, ks); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + l2c(tout0, iv); + l2c(tout1, iv); + } else { + c2l(iv, xor0); + c2l(iv, xor1); + iv -= 8; + for (l -= 8; l >= 0; l -= 8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + RC2_decrypt(tin, ks); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = tin0; + xor1 = tin1; + } + if (l != -8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + RC2_decrypt(tin, ks); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2cn(tout0, tout1, out, l + 8); + xor0 = tin0; + xor1 = tin1; + } + l2c(xor0, iv); + l2c(xor1, iv); + } + tin[0] = tin[1] = 0; +} + +static const uint8_t key_table[256] = { + 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, + 0x4a, 0xa0, 0xd8, 0x9d, 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, + 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, 0x17, 0x9a, 0x59, 0xf5, + 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, + 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, + 0x5c, 0x6b, 0x4e, 0x82, 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, + 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, 0x12, 0x75, 0xca, 0x1f, + 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, + 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, + 0xbc, 0x94, 0x43, 0x03, 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, + 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, 0x08, 0xe8, 0xea, 0xde, + 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, + 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, + 0x04, 0x18, 0xa4, 0xec, 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, + 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, 0x99, 0x7c, 0x3a, 0x85, + 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, + 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, + 0x67, 0x6c, 0xba, 0xc9, 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, + 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, 0x0d, 0x38, 0x34, 0x1b, + 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, + 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, + 0xfe, 0x7f, 0xc1, 0xad, +}; + +static void RC2_set_key(RC2_KEY *key, int len, const uint8_t *data, int bits) { + int i, j; + uint8_t *k; + uint16_t *ki; + unsigned int c, d; + + k = (uint8_t *)&key->data[0]; + *k = 0; // for if there is a zero length key + + if (len > 128) { + len = 128; + } + if (bits <= 0) { + bits = 1024; + } + if (bits > 1024) { + bits = 1024; + } + + for (i = 0; i < len; i++) { + k[i] = data[i]; + } + + // expand table + d = k[len - 1]; + j = 0; + for (i = len; i < 128; i++, j++) { + d = key_table[(k[j] + d) & 0xff]; + k[i] = d; + } + + // hmm.... key reduction to 'bits' bits + + j = (bits + 7) >> 3; + i = 128 - j; + c = (0xff >> (-bits & 0x07)); + + d = key_table[k[i] & c]; + k[i] = d; + while (i--) { + d = key_table[k[i + j] ^ d]; + k[i] = d; + } + + // copy from bytes into uint16_t's + ki = &(key->data[63]); + for (i = 127; i >= 0; i -= 2) { + *(ki--) = ((k[i] << 8) | k[i - 1]) & 0xffff; + } +} + +typedef struct { + int key_bits; // effective key bits + RC2_KEY ks; // key schedule +} EVP_RC2_KEY; + +static int rc2_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + EVP_RC2_KEY *rc2_key = (EVP_RC2_KEY *)ctx->cipher_data; + RC2_set_key(&rc2_key->ks, EVP_CIPHER_CTX_key_length(ctx), key, + rc2_key->key_bits); + return 1; +} + +static int rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t inl) { + EVP_RC2_KEY *key = (EVP_RC2_KEY *)ctx->cipher_data; + static const size_t kChunkSize = 0x10000; + + while (inl >= kChunkSize) { + RC2_cbc_encrypt(in, out, kChunkSize, &key->ks, ctx->iv, ctx->encrypt); + inl -= kChunkSize; + in += kChunkSize; + out += kChunkSize; + } + if (inl) { + RC2_cbc_encrypt(in, out, inl, &key->ks, ctx->iv, ctx->encrypt); + } + return 1; +} + +static int rc2_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) { + EVP_RC2_KEY *key = (EVP_RC2_KEY *)ctx->cipher_data; + + switch (type) { + case EVP_CTRL_INIT: + key->key_bits = EVP_CIPHER_CTX_key_length(ctx) * 8; + return 1; + case EVP_CTRL_SET_RC2_KEY_BITS: + // Should be overridden by later call to |EVP_CTRL_INIT|, but + // people call it, so it may as well work. + key->key_bits = arg; + return 1; + + default: + return -1; + } +} + +static const EVP_CIPHER rc2_40_cbc = { + NID_rc2_40_cbc, + 8 /* block size */, + 5 /* 40 bit */, + 8 /* iv len */, + sizeof(EVP_RC2_KEY), + EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, + NULL /* app_data */, + rc2_init_key, + rc2_cbc_cipher, + NULL, + rc2_ctrl, +}; + +const EVP_CIPHER *EVP_rc2_40_cbc(void) { + return &rc2_40_cbc; +} + +static const EVP_CIPHER rc2_cbc = { + NID_rc2_cbc, + 8 /* block size */, + 16 /* 128 bit */, + 8 /* iv len */, + sizeof(EVP_RC2_KEY), + EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, + NULL /* app_data */, + rc2_init_key, + rc2_cbc_cipher, + NULL, + rc2_ctrl, +}; + +const EVP_CIPHER *EVP_rc2_cbc(void) { + return &rc2_cbc; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c.grpc_back new file mode 100644 index 0000000..221a9c9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c.grpc_back @@ -0,0 +1,462 @@ +/* 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 "../internal.h" + + +#define c2l(c, l) \ + do { \ + (l) = ((uint32_t)(*((c)++))); \ + (l) |= ((uint32_t)(*((c)++))) << 8L; \ + (l) |= ((uint32_t)(*((c)++))) << 16L; \ + (l) |= ((uint32_t)(*((c)++))) << 24L; \ + } while (0) + +#define c2ln(c, l1, l2, n) \ + do { \ + (c) += (n); \ + (l1) = (l2) = 0; \ + switch (n) { \ + case 8: \ + (l2) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + (l2) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + (l2) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + (l2) |= ((uint32_t)(*(--(c)))); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + (l1) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + (l1) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + (l1) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + (l1) |= ((uint32_t)(*(--(c)))); \ + } \ + } while (0) + +#define l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8L) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16L) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 24L) & 0xff); \ + } while (0) + +#define l2cn(l1, l2, c, n) \ + do { \ + (c) += (n); \ + switch (n) { \ + case 8: \ + *(--(c)) = (uint8_t)(((l2) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + *(--(c)) = (uint8_t)(((l2) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + *(--(c)) = (uint8_t)(((l2) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + *(--(c)) = (uint8_t)(((l2)) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + *(--(c)) = (uint8_t)(((l1) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + *(--(c)) = (uint8_t)(((l1) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + *(--(c)) = (uint8_t)(((l1) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + *(--(c)) = (uint8_t)(((l1)) & 0xff); \ + } \ + } while (0) + +typedef struct rc2_key_st { uint16_t data[64]; } RC2_KEY; + +static void RC2_encrypt(uint32_t *d, RC2_KEY *key) { + int i, n; + uint16_t *p0, *p1; + uint16_t x0, x1, x2, x3, t; + uint32_t l; + + l = d[0]; + x0 = (uint16_t)l & 0xffff; + x1 = (uint16_t)(l >> 16L); + l = d[1]; + x2 = (uint16_t)l & 0xffff; + x3 = (uint16_t)(l >> 16L); + + n = 3; + i = 5; + + p0 = p1 = &key->data[0]; + for (;;) { + t = (x0 + (x1 & ~x3) + (x2 & x3) + *(p0++)) & 0xffff; + x0 = (t << 1) | (t >> 15); + t = (x1 + (x2 & ~x0) + (x3 & x0) + *(p0++)) & 0xffff; + x1 = (t << 2) | (t >> 14); + t = (x2 + (x3 & ~x1) + (x0 & x1) + *(p0++)) & 0xffff; + x2 = (t << 3) | (t >> 13); + t = (x3 + (x0 & ~x2) + (x1 & x2) + *(p0++)) & 0xffff; + x3 = (t << 5) | (t >> 11); + + if (--i == 0) { + if (--n == 0) { + break; + } + i = (n == 2) ? 6 : 5; + + x0 += p1[x3 & 0x3f]; + x1 += p1[x0 & 0x3f]; + x2 += p1[x1 & 0x3f]; + x3 += p1[x2 & 0x3f]; + } + } + + d[0] = (uint32_t)(x0 & 0xffff) | ((uint32_t)(x1 & 0xffff) << 16L); + d[1] = (uint32_t)(x2 & 0xffff) | ((uint32_t)(x3 & 0xffff) << 16L); +} + +static void RC2_decrypt(uint32_t *d, RC2_KEY *key) { + int i, n; + uint16_t *p0, *p1; + uint16_t x0, x1, x2, x3, t; + uint32_t l; + + l = d[0]; + x0 = (uint16_t)l & 0xffff; + x1 = (uint16_t)(l >> 16L); + l = d[1]; + x2 = (uint16_t)l & 0xffff; + x3 = (uint16_t)(l >> 16L); + + n = 3; + i = 5; + + p0 = &key->data[63]; + p1 = &key->data[0]; + for (;;) { + t = ((x3 << 11) | (x3 >> 5)) & 0xffff; + x3 = (t - (x0 & ~x2) - (x1 & x2) - *(p0--)) & 0xffff; + t = ((x2 << 13) | (x2 >> 3)) & 0xffff; + x2 = (t - (x3 & ~x1) - (x0 & x1) - *(p0--)) & 0xffff; + t = ((x1 << 14) | (x1 >> 2)) & 0xffff; + x1 = (t - (x2 & ~x0) - (x3 & x0) - *(p0--)) & 0xffff; + t = ((x0 << 15) | (x0 >> 1)) & 0xffff; + x0 = (t - (x1 & ~x3) - (x2 & x3) - *(p0--)) & 0xffff; + + if (--i == 0) { + if (--n == 0) { + break; + } + i = (n == 2) ? 6 : 5; + + x3 = (x3 - p1[x2 & 0x3f]) & 0xffff; + x2 = (x2 - p1[x1 & 0x3f]) & 0xffff; + x1 = (x1 - p1[x0 & 0x3f]) & 0xffff; + x0 = (x0 - p1[x3 & 0x3f]) & 0xffff; + } + } + + d[0] = (uint32_t)(x0 & 0xffff) | ((uint32_t)(x1 & 0xffff) << 16L); + d[1] = (uint32_t)(x2 & 0xffff) | ((uint32_t)(x3 & 0xffff) << 16L); +} + +static void RC2_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + RC2_KEY *ks, uint8_t *iv, int encrypt) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + long l = length; + uint32_t tin[2]; + + if (encrypt) { + c2l(iv, tout0); + c2l(iv, tout1); + iv -= 8; + for (l -= 8; l >= 0; l -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin1 ^= tout1; + tin[0] = tin0; + tin[1] = tin1; + RC2_encrypt(tin, ks); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + if (l != -8) { + c2ln(in, tin0, tin1, l + 8); + tin0 ^= tout0; + tin1 ^= tout1; + tin[0] = tin0; + tin[1] = tin1; + RC2_encrypt(tin, ks); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + l2c(tout0, iv); + l2c(tout1, iv); + } else { + c2l(iv, xor0); + c2l(iv, xor1); + iv -= 8; + for (l -= 8; l >= 0; l -= 8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + RC2_decrypt(tin, ks); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = tin0; + xor1 = tin1; + } + if (l != -8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + RC2_decrypt(tin, ks); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2cn(tout0, tout1, out, l + 8); + xor0 = tin0; + xor1 = tin1; + } + l2c(xor0, iv); + l2c(xor1, iv); + } + tin[0] = tin[1] = 0; +} + +static const uint8_t key_table[256] = { + 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, + 0x4a, 0xa0, 0xd8, 0x9d, 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, + 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, 0x17, 0x9a, 0x59, 0xf5, + 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, + 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, + 0x5c, 0x6b, 0x4e, 0x82, 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, + 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, 0x12, 0x75, 0xca, 0x1f, + 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, + 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, + 0xbc, 0x94, 0x43, 0x03, 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, + 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, 0x08, 0xe8, 0xea, 0xde, + 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, + 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, + 0x04, 0x18, 0xa4, 0xec, 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, + 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, 0x99, 0x7c, 0x3a, 0x85, + 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, + 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, + 0x67, 0x6c, 0xba, 0xc9, 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, + 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, 0x0d, 0x38, 0x34, 0x1b, + 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, + 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, + 0xfe, 0x7f, 0xc1, 0xad, +}; + +static void RC2_set_key(RC2_KEY *key, int len, const uint8_t *data, int bits) { + int i, j; + uint8_t *k; + uint16_t *ki; + unsigned int c, d; + + k = (uint8_t *)&key->data[0]; + *k = 0; // for if there is a zero length key + + if (len > 128) { + len = 128; + } + if (bits <= 0) { + bits = 1024; + } + if (bits > 1024) { + bits = 1024; + } + + for (i = 0; i < len; i++) { + k[i] = data[i]; + } + + // expand table + d = k[len - 1]; + j = 0; + for (i = len; i < 128; i++, j++) { + d = key_table[(k[j] + d) & 0xff]; + k[i] = d; + } + + // hmm.... key reduction to 'bits' bits + + j = (bits + 7) >> 3; + i = 128 - j; + c = (0xff >> (-bits & 0x07)); + + d = key_table[k[i] & c]; + k[i] = d; + while (i--) { + d = key_table[k[i + j] ^ d]; + k[i] = d; + } + + // copy from bytes into uint16_t's + ki = &(key->data[63]); + for (i = 127; i >= 0; i -= 2) { + *(ki--) = ((k[i] << 8) | k[i - 1]) & 0xffff; + } +} + +typedef struct { + int key_bits; // effective key bits + RC2_KEY ks; // key schedule +} EVP_RC2_KEY; + +static int rc2_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + EVP_RC2_KEY *rc2_key = (EVP_RC2_KEY *)ctx->cipher_data; + RC2_set_key(&rc2_key->ks, EVP_CIPHER_CTX_key_length(ctx), key, + rc2_key->key_bits); + return 1; +} + +static int rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t inl) { + EVP_RC2_KEY *key = (EVP_RC2_KEY *)ctx->cipher_data; + static const size_t kChunkSize = 0x10000; + + while (inl >= kChunkSize) { + RC2_cbc_encrypt(in, out, kChunkSize, &key->ks, ctx->iv, ctx->encrypt); + inl -= kChunkSize; + in += kChunkSize; + out += kChunkSize; + } + if (inl) { + RC2_cbc_encrypt(in, out, inl, &key->ks, ctx->iv, ctx->encrypt); + } + return 1; +} + +static int rc2_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) { + EVP_RC2_KEY *key = (EVP_RC2_KEY *)ctx->cipher_data; + + switch (type) { + case EVP_CTRL_INIT: + key->key_bits = EVP_CIPHER_CTX_key_length(ctx) * 8; + return 1; + case EVP_CTRL_SET_RC2_KEY_BITS: + // Should be overridden by later call to |EVP_CTRL_INIT|, but + // people call it, so it may as well work. + key->key_bits = arg; + return 1; + + default: + return -1; + } +} + +static const EVP_CIPHER rc2_40_cbc = { + NID_rc2_40_cbc, + 8 /* block size */, + 5 /* 40 bit */, + 8 /* iv len */, + sizeof(EVP_RC2_KEY), + EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, + NULL /* app_data */, + rc2_init_key, + rc2_cbc_cipher, + NULL, + rc2_ctrl, +}; + +const EVP_CIPHER *EVP_rc2_40_cbc(void) { + return &rc2_40_cbc; +} + +static const EVP_CIPHER rc2_cbc = { + NID_rc2_cbc, + 8 /* block size */, + 16 /* 128 bit */, + 8 /* iv len */, + sizeof(EVP_RC2_KEY), + EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, + NULL /* app_data */, + rc2_init_key, + rc2_cbc_cipher, + NULL, + rc2_ctrl, +}; + +const EVP_CIPHER *EVP_rc2_cbc(void) { + return &rc2_cbc; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c new file mode 100644 index 0000000..47af272 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c @@ -0,0 +1,87 @@ +/* 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 rc4_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + RC4_KEY *rc4key = (RC4_KEY *)ctx->cipher_data; + + RC4_set_key(rc4key, EVP_CIPHER_CTX_key_length(ctx), key); + return 1; +} + +static int rc4_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + RC4_KEY *rc4key = (RC4_KEY *)ctx->cipher_data; + + RC4(rc4key, in_len, in, out); + return 1; +} + +static const EVP_CIPHER rc4 = { + NID_rc4, 1 /* block_size */, 16 /* key_size */, + 0 /* iv_len */, sizeof(RC4_KEY), EVP_CIPH_VARIABLE_LENGTH, + NULL /* app_data */, rc4_init_key, rc4_cipher, + NULL /* cleanup */, NULL /* ctrl */, }; + +const EVP_CIPHER *EVP_rc4(void) { return &rc4; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c.grpc_back new file mode 100644 index 0000000..e7c2cca --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c.grpc_back @@ -0,0 +1,87 @@ +/* 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 rc4_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + RC4_KEY *rc4key = (RC4_KEY *)ctx->cipher_data; + + RC4_set_key(rc4key, EVP_CIPHER_CTX_key_length(ctx), key); + return 1; +} + +static int rc4_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + RC4_KEY *rc4key = (RC4_KEY *)ctx->cipher_data; + + RC4(rc4key, in_len, in, out); + return 1; +} + +static const EVP_CIPHER rc4 = { + NID_rc4, 1 /* block_size */, 16 /* key_size */, + 0 /* iv_len */, sizeof(RC4_KEY), EVP_CIPH_VARIABLE_LENGTH, + NULL /* app_data */, rc4_init_key, rc4_cipher, + NULL /* cleanup */, NULL /* ctrl */, }; + +const EVP_CIPHER *EVP_rc4(void) { return &rc4; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c new file mode 100644 index 0000000..2b5b82f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c @@ -0,0 +1,688 @@ +/* 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 + +#include "../fipsmodule/cipher/internal.h" +#include "../internal.h" +#include "internal.h" + + +typedef struct { + EVP_CIPHER_CTX cipher_ctx; + HMAC_CTX hmac_ctx; + // mac_key is the portion of the key used for the MAC. It is retained + // separately for the constant-time CBC code. + uint8_t mac_key[EVP_MAX_MD_SIZE]; + uint8_t mac_key_len; + // implicit_iv is one iff this is a pre-TLS-1.1 CBC cipher without an explicit + // IV. + char implicit_iv; +} AEAD_TLS_CTX; + +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->state; + EVP_CIPHER_CTX_cleanup(&tls_ctx->cipher_ctx); + HMAC_CTX_cleanup(&tls_ctx->hmac_ctx); +} + +static int aead_tls_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, + char implicit_iv) { + 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 + + (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); + + 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); + OPENSSL_memcpy(tls_ctx->mac_key, key, mac_key_len); + tls_ctx->mac_key_len = (uint8_t)mac_key_len; + tls_ctx->implicit_iv = implicit_iv; + + 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); + return 0; + } + EVP_CIPHER_CTX_set_padding(&tls_ctx->cipher_ctx, 0); + + return 1; +} + +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); + 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) { + // The NULL cipher. + return hmac_len; + } + + const size_t block_size = EVP_CIPHER_CTX_block_size(&tls_ctx->cipher_ctx); + // An overflow of |in_len + hmac_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 + hmac_len) % block_size; + return hmac_len + pad_len; +} + +static int aead_tls_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_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. + 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_tls_tag_len(ctx, in_len, extra_in_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 (ad_len != 13 - 2 /* length bytes */) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); + return 0; + } + + // 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); + + // 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 (!HMAC_Init_ex(&tls_ctx->hmac_ctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad, ad_len) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad_extra, sizeof(ad_extra)) || + !HMAC_Update(&tls_ctx->hmac_ctx, in, in_len) || + !HMAC_Final(&tls_ctx->hmac_ctx, mac, &mac_len)) { + return 0; + } + + // Configure the explicit IV. + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + !tls_ctx->implicit_iv && + !EVP_EncryptInit_ex(&tls_ctx->cipher_ctx, NULL, NULL, NULL, nonce)) { + return 0; + } + + // Encrypt the input. + int len; + if (!EVP_EncryptUpdate(&tls_ctx->cipher_ctx, out, &len, in, (int)in_len)) { + return 0; + } + + unsigned block_size = EVP_CIPHER_CTX_block_size(&tls_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 feed the rest. + + const 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(&tls_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(&tls_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(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE); + + // Compute padding and feed that into the cipher. + uint8_t padding[256]; + unsigned padding_len = block_size - ((in_len + mac_len) % block_size); + OPENSSL_memset(padding, padding_len - 1, padding_len); + if (!EVP_EncryptUpdate(&tls_ctx->cipher_ctx, out_tag + tag_len, &len, + padding, (int)padding_len)) { + return 0; + } + tag_len += len; + } + + if (!EVP_EncryptFinal_ex(&tls_ctx->cipher_ctx, out_tag + tag_len, &len)) { + return 0; + } + assert(len == 0); // Padding is explicit. + assert(tag_len == aead_tls_tag_len(ctx, in_len, extra_in_len)); + + *out_tag_len = tag_len; + return 1; +} + +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->state; + + if (tls_ctx->cipher_ctx.encrypt) { + // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); + return 0; + } + + if (in_len < HMAC_size(&tls_ctx->hmac_ctx)) { + 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 != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (ad_len != 13 - 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; + } + + // Configure the explicit IV. + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + !tls_ctx->implicit_iv && + !EVP_DecryptInit_ex(&tls_ctx->cipher_ctx, NULL, NULL, NULL, nonce)) { + return 0; + } + + // Decrypt to get the plaintext + MAC + padding. + size_t total = 0; + int len; + if (!EVP_DecryptUpdate(&tls_ctx->cipher_ctx, out, &len, in, (int)in_len)) { + return 0; + } + total += len; + if (!EVP_DecryptFinal_ex(&tls_ctx->cipher_ctx, out + total, &len)) { + return 0; + } + 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; + crypto_word_t padding_ok; + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE) { + if (!EVP_tls_cbc_remove_padding( + &padding_ok, &data_plus_mac_len, out, total, + EVP_CIPHER_CTX_block_size(&tls_ctx->cipher_ctx), + HMAC_size(&tls_ctx->hmac_ctx))) { + // Publicly invalid. This can be rejected in non-constant time. + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + } else { + padding_ok = CONSTTIME_TRUE_W; + data_plus_mac_len = total; + // |data_plus_mac_len| = |total| = |in_len| at this point. |in_len| has + // already been checked against the MAC size at the top of the function. + assert(data_plus_mac_len >= HMAC_size(&tls_ctx->hmac_ctx)); + } + size_t data_len = data_plus_mac_len - HMAC_size(&tls_ctx->hmac_ctx); + + // At this point, if the padding is valid, the first |data_plus_mac_len| bytes + // after |out| are the plaintext and MAC. Otherwise, |data_plus_mac_len| is + // still large enough to extract a MAC, but it will be irrelevant. + + // To allow for CBC mode which changes cipher length, |ad| doesn't include the + // length for legacy ciphers. + uint8_t ad_fixed[13]; + OPENSSL_memcpy(ad_fixed, ad, 11); + ad_fixed[11] = (uint8_t)(data_len >> 8); + ad_fixed[12] = (uint8_t)(data_len & 0xff); + ad_len += 2; + + // Compute the MAC and extract the one in the record. + uint8_t mac[EVP_MAX_MD_SIZE]; + size_t mac_len; + uint8_t record_mac_tmp[EVP_MAX_MD_SIZE]; + uint8_t *record_mac; + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + EVP_tls_cbc_record_digest_supported(tls_ctx->hmac_ctx.md)) { + if (!EVP_tls_cbc_digest_record(tls_ctx->hmac_ctx.md, mac, &mac_len, + ad_fixed, out, data_plus_mac_len, total, + tls_ctx->mac_key, tls_ctx->mac_key_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + assert(mac_len == HMAC_size(&tls_ctx->hmac_ctx)); + + record_mac = record_mac_tmp; + EVP_tls_cbc_copy_mac(record_mac, mac_len, out, data_plus_mac_len, total); + } else { + // We should support the constant-time path for all CBC-mode ciphers + // implemented. + assert(EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE); + + unsigned mac_len_u; + if (!HMAC_Init_ex(&tls_ctx->hmac_ctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad_fixed, ad_len) || + !HMAC_Update(&tls_ctx->hmac_ctx, out, data_len) || + !HMAC_Final(&tls_ctx->hmac_ctx, mac, &mac_len_u)) { + return 0; + } + mac_len = mac_len_u; + + assert(mac_len == HMAC_size(&tls_ctx->hmac_ctx)); + record_mac = &out[data_len]; + } + + // Perform the MAC check and the padding check in constant-time. It should be + // safe to simply perform the padding check first, but it would not be under a + // different choice of MAC location on padding failure. See + // EVP_tls_cbc_remove_padding. + 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; + return 1; +} + +static int aead_aes_128_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha1(), 0); +} + +static int aead_aes_128_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha1(), 1); +} + +static int aead_aes_128_cbc_sha256_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha256(), 0); +} + +static int aead_aes_256_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha1(), 0); +} + +static int aead_aes_256_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha1(), 1); +} + +static int aead_aes_256_cbc_sha256_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha256(), 0); +} + +static int aead_aes_256_cbc_sha384_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha384(), 0); +} + +static int aead_des_ede3_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), + EVP_sha1(), 0); +} + +static int aead_des_ede3_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), + EVP_sha1(), 1); +} + +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->state; + const size_t iv_len = EVP_CIPHER_CTX_iv_length(&tls_ctx->cipher_ctx); + if (iv_len <= 1) { + return 0; + } + + *out_iv = tls_ctx->cipher_ctx.iv; + *out_iv_len = iv_len; + return 1; +} + +static int aead_null_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_enc_null(), + EVP_sha1(), 1 /* implicit iv */); +} + +static const EVP_AEAD aead_aes_128_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 16, // key len (SHA1 + AES128) + 16, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_128_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_128_cbc_sha256_tls = { + SHA256_DIGEST_LENGTH + 16, // key len (SHA256 + AES128) + 16, // nonce len (IV) + 16 + SHA256_DIGEST_LENGTH, // overhead (padding + SHA256) + SHA256_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_128_cbc_sha256_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 32, // key len (SHA1 + AES256) + 16, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha256_tls = { + SHA256_DIGEST_LENGTH + 32, // key len (SHA256 + AES256) + 16, // nonce len (IV) + 16 + SHA256_DIGEST_LENGTH, // overhead (padding + SHA256) + SHA256_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_256_cbc_sha256_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha384_tls = { + SHA384_DIGEST_LENGTH + 32, // key len (SHA384 + AES256) + 16, // nonce len (IV) + 16 + SHA384_DIGEST_LENGTH, // overhead (padding + SHA384) + SHA384_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_256_cbc_sha384_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_des_ede3_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 24, // key len (SHA1 + 3DES) + 8, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_des_ede3_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_null_sha1_tls = { + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls(void) { + return &aead_aes_128_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(void) { + return &aead_aes_128_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha256_tls(void) { + return &aead_aes_128_cbc_sha256_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls(void) { + return &aead_aes_256_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(void) { + return &aead_aes_256_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha256_tls(void) { + return &aead_aes_256_cbc_sha256_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha384_tls(void) { + return &aead_aes_256_cbc_sha384_tls; +} + +const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls(void) { + return &aead_des_ede3_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(void) { + return &aead_des_ede3_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_null_sha1_tls(void) { return &aead_null_sha1_tls; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back new file mode 100644 index 0000000..c812b6b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back @@ -0,0 +1,688 @@ +/* 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 + +#include "../fipsmodule/cipher/internal.h" +#include "../internal.h" +#include "internal.h" + + +typedef struct { + EVP_CIPHER_CTX cipher_ctx; + HMAC_CTX hmac_ctx; + // mac_key is the portion of the key used for the MAC. It is retained + // separately for the constant-time CBC code. + uint8_t mac_key[EVP_MAX_MD_SIZE]; + uint8_t mac_key_len; + // implicit_iv is one iff this is a pre-TLS-1.1 CBC cipher without an explicit + // IV. + char implicit_iv; +} AEAD_TLS_CTX; + +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->state; + EVP_CIPHER_CTX_cleanup(&tls_ctx->cipher_ctx); + HMAC_CTX_cleanup(&tls_ctx->hmac_ctx); +} + +static int aead_tls_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, + char implicit_iv) { + 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 + + (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); + + 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); + OPENSSL_memcpy(tls_ctx->mac_key, key, mac_key_len); + tls_ctx->mac_key_len = (uint8_t)mac_key_len; + tls_ctx->implicit_iv = implicit_iv; + + 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); + return 0; + } + EVP_CIPHER_CTX_set_padding(&tls_ctx->cipher_ctx, 0); + + return 1; +} + +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); + 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) { + // The NULL cipher. + return hmac_len; + } + + const size_t block_size = EVP_CIPHER_CTX_block_size(&tls_ctx->cipher_ctx); + // An overflow of |in_len + hmac_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 + hmac_len) % block_size; + return hmac_len + pad_len; +} + +static int aead_tls_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_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. + 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_tls_tag_len(ctx, in_len, extra_in_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 (ad_len != 13 - 2 /* length bytes */) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); + return 0; + } + + // 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); + + // 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 (!HMAC_Init_ex(&tls_ctx->hmac_ctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad, ad_len) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad_extra, sizeof(ad_extra)) || + !HMAC_Update(&tls_ctx->hmac_ctx, in, in_len) || + !HMAC_Final(&tls_ctx->hmac_ctx, mac, &mac_len)) { + return 0; + } + + // Configure the explicit IV. + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + !tls_ctx->implicit_iv && + !EVP_EncryptInit_ex(&tls_ctx->cipher_ctx, NULL, NULL, NULL, nonce)) { + return 0; + } + + // Encrypt the input. + int len; + if (!EVP_EncryptUpdate(&tls_ctx->cipher_ctx, out, &len, in, (int)in_len)) { + return 0; + } + + unsigned block_size = EVP_CIPHER_CTX_block_size(&tls_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 feed the rest. + + const 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(&tls_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(&tls_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(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE); + + // Compute padding and feed that into the cipher. + uint8_t padding[256]; + unsigned padding_len = block_size - ((in_len + mac_len) % block_size); + OPENSSL_memset(padding, padding_len - 1, padding_len); + if (!EVP_EncryptUpdate(&tls_ctx->cipher_ctx, out_tag + tag_len, &len, + padding, (int)padding_len)) { + return 0; + } + tag_len += len; + } + + if (!EVP_EncryptFinal_ex(&tls_ctx->cipher_ctx, out_tag + tag_len, &len)) { + return 0; + } + assert(len == 0); // Padding is explicit. + assert(tag_len == aead_tls_tag_len(ctx, in_len, extra_in_len)); + + *out_tag_len = tag_len; + return 1; +} + +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->state; + + if (tls_ctx->cipher_ctx.encrypt) { + // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); + return 0; + } + + if (in_len < HMAC_size(&tls_ctx->hmac_ctx)) { + 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 != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (ad_len != 13 - 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; + } + + // Configure the explicit IV. + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + !tls_ctx->implicit_iv && + !EVP_DecryptInit_ex(&tls_ctx->cipher_ctx, NULL, NULL, NULL, nonce)) { + return 0; + } + + // Decrypt to get the plaintext + MAC + padding. + size_t total = 0; + int len; + if (!EVP_DecryptUpdate(&tls_ctx->cipher_ctx, out, &len, in, (int)in_len)) { + return 0; + } + total += len; + if (!EVP_DecryptFinal_ex(&tls_ctx->cipher_ctx, out + total, &len)) { + return 0; + } + 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; + crypto_word_t padding_ok; + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE) { + if (!EVP_tls_cbc_remove_padding( + &padding_ok, &data_plus_mac_len, out, total, + EVP_CIPHER_CTX_block_size(&tls_ctx->cipher_ctx), + HMAC_size(&tls_ctx->hmac_ctx))) { + // Publicly invalid. This can be rejected in non-constant time. + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + } else { + padding_ok = CONSTTIME_TRUE_W; + data_plus_mac_len = total; + // |data_plus_mac_len| = |total| = |in_len| at this point. |in_len| has + // already been checked against the MAC size at the top of the function. + assert(data_plus_mac_len >= HMAC_size(&tls_ctx->hmac_ctx)); + } + size_t data_len = data_plus_mac_len - HMAC_size(&tls_ctx->hmac_ctx); + + // At this point, if the padding is valid, the first |data_plus_mac_len| bytes + // after |out| are the plaintext and MAC. Otherwise, |data_plus_mac_len| is + // still large enough to extract a MAC, but it will be irrelevant. + + // To allow for CBC mode which changes cipher length, |ad| doesn't include the + // length for legacy ciphers. + uint8_t ad_fixed[13]; + OPENSSL_memcpy(ad_fixed, ad, 11); + ad_fixed[11] = (uint8_t)(data_len >> 8); + ad_fixed[12] = (uint8_t)(data_len & 0xff); + ad_len += 2; + + // Compute the MAC and extract the one in the record. + uint8_t mac[EVP_MAX_MD_SIZE]; + size_t mac_len; + uint8_t record_mac_tmp[EVP_MAX_MD_SIZE]; + uint8_t *record_mac; + if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE && + EVP_tls_cbc_record_digest_supported(tls_ctx->hmac_ctx.md)) { + if (!EVP_tls_cbc_digest_record(tls_ctx->hmac_ctx.md, mac, &mac_len, + ad_fixed, out, data_plus_mac_len, total, + tls_ctx->mac_key, tls_ctx->mac_key_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + assert(mac_len == HMAC_size(&tls_ctx->hmac_ctx)); + + record_mac = record_mac_tmp; + EVP_tls_cbc_copy_mac(record_mac, mac_len, out, data_plus_mac_len, total); + } else { + // We should support the constant-time path for all CBC-mode ciphers + // implemented. + assert(EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE); + + unsigned mac_len_u; + if (!HMAC_Init_ex(&tls_ctx->hmac_ctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&tls_ctx->hmac_ctx, ad_fixed, ad_len) || + !HMAC_Update(&tls_ctx->hmac_ctx, out, data_len) || + !HMAC_Final(&tls_ctx->hmac_ctx, mac, &mac_len_u)) { + return 0; + } + mac_len = mac_len_u; + + assert(mac_len == HMAC_size(&tls_ctx->hmac_ctx)); + record_mac = &out[data_len]; + } + + // Perform the MAC check and the padding check in constant-time. It should be + // safe to simply perform the padding check first, but it would not be under a + // different choice of MAC location on padding failure. See + // EVP_tls_cbc_remove_padding. + 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; + return 1; +} + +static int aead_aes_128_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha1(), 0); +} + +static int aead_aes_128_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha1(), 1); +} + +static int aead_aes_128_cbc_sha256_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), + EVP_sha256(), 0); +} + +static int aead_aes_256_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha1(), 0); +} + +static int aead_aes_256_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha1(), 1); +} + +static int aead_aes_256_cbc_sha256_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha256(), 0); +} + +static int aead_aes_256_cbc_sha384_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), + EVP_sha384(), 0); +} + +static int aead_des_ede3_cbc_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), + EVP_sha1(), 0); +} + +static int aead_des_ede3_cbc_sha1_tls_implicit_iv_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), + EVP_sha1(), 1); +} + +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->state; + const size_t iv_len = EVP_CIPHER_CTX_iv_length(&tls_ctx->cipher_ctx); + if (iv_len <= 1) { + return 0; + } + + *out_iv = tls_ctx->cipher_ctx.iv; + *out_iv_len = iv_len; + return 1; +} + +static int aead_null_sha1_tls_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_tls_init(ctx, key, key_len, tag_len, dir, EVP_enc_null(), + EVP_sha1(), 1 /* implicit iv */); +} + +static const EVP_AEAD aead_aes_128_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 16, // key len (SHA1 + AES128) + 16, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_128_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_128_cbc_sha256_tls = { + SHA256_DIGEST_LENGTH + 16, // key len (SHA256 + AES128) + 16, // nonce len (IV) + 16 + SHA256_DIGEST_LENGTH, // overhead (padding + SHA256) + SHA256_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_128_cbc_sha256_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 32, // key len (SHA1 + AES256) + 16, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha256_tls = { + SHA256_DIGEST_LENGTH + 32, // key len (SHA256 + AES256) + 16, // nonce len (IV) + 16 + SHA256_DIGEST_LENGTH, // overhead (padding + SHA256) + SHA256_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_256_cbc_sha256_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_aes_256_cbc_sha384_tls = { + SHA384_DIGEST_LENGTH + 32, // key len (SHA384 + AES256) + 16, // nonce len (IV) + 16 + SHA384_DIGEST_LENGTH, // overhead (padding + SHA384) + SHA384_DIGEST_LENGTH, // max tag length + 0, // seal_scatter_supports_extra_in + + NULL, // init + aead_aes_256_cbc_sha384_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_des_ede3_cbc_sha1_tls = { + SHA_DIGEST_LENGTH + 24, // key len (SHA1 + 3DES) + 8, // nonce len (IV) + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_des_ede3_cbc_sha1_tls_implicit_iv = { + 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_tls_implicit_iv_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + aead_tls_get_iv, // get_iv + aead_tls_tag_len, +}; + +static const EVP_AEAD aead_null_sha1_tls = { + 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_tls_init, + aead_tls_cleanup, + aead_tls_open, + aead_tls_seal_scatter, + NULL, // open_gather + NULL, // get_iv + aead_tls_tag_len, +}; + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls(void) { + return &aead_aes_128_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(void) { + return &aead_aes_128_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_aes_128_cbc_sha256_tls(void) { + return &aead_aes_128_cbc_sha256_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls(void) { + return &aead_aes_256_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(void) { + return &aead_aes_256_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha256_tls(void) { + return &aead_aes_256_cbc_sha256_tls; +} + +const EVP_AEAD *EVP_aead_aes_256_cbc_sha384_tls(void) { + return &aead_aes_256_cbc_sha384_tls; +} + +const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls(void) { + return &aead_des_ede3_cbc_sha1_tls; +} + +const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(void) { + return &aead_des_ede3_cbc_sha1_tls_implicit_iv; +} + +const EVP_AEAD *EVP_aead_null_sha1_tls(void) { return &aead_null_sha1_tls; } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h new file mode 100644 index 0000000..9edbf9d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/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_EXTRA_INTERNAL_H +#define OPENSSL_HEADER_CIPHER_EXTRA_INTERNAL_H + +#include + +#include "../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// EVP_tls_cbc_get_padding determines the padding from the decrypted, TLS, CBC +// record in |in|. This decrypted record should not include any "decrypted" +// explicit IV. If the record is publicly invalid, it returns zero. Otherwise, +// it returns one and sets |*out_padding_ok| to all ones (0xfff..f) if the +// padding is valid and zero otherwise. It then sets |*out_len| to the length +// with the padding removed or |in_len| if invalid. +// +// If the function returns one, it runs in time independent of the contents of +// |in|. It is also guaranteed that |*out_len| >= |mac_size|, satisfying +// |EVP_tls_cbc_copy_mac|'s precondition. +int EVP_tls_cbc_remove_padding(crypto_word_t *out_padding_ok, size_t *out_len, + const uint8_t *in, size_t in_len, + size_t block_size, size_t mac_size); + +// EVP_tls_cbc_copy_mac copies |md_size| bytes from the end of the first +// |in_len| bytes of |in| to |out| in constant time (independent of the concrete +// value of |in_len|, which may vary within a 256-byte window). |in| must point +// to a buffer of |orig_len| bytes. +// +// On entry: +// orig_len >= in_len >= md_size +// md_size <= EVP_MAX_MD_SIZE +void EVP_tls_cbc_copy_mac(uint8_t *out, size_t md_size, const uint8_t *in, + size_t in_len, size_t orig_len); + +// EVP_tls_cbc_record_digest_supported returns 1 iff |md| is a hash function +// which EVP_tls_cbc_digest_record supports. +int EVP_tls_cbc_record_digest_supported(const EVP_MD *md); + +// EVP_tls_cbc_digest_record computes the MAC of a decrypted, padded TLS +// record. +// +// md: the hash function used in the HMAC. +// EVP_tls_cbc_record_digest_supported must return true for this hash. +// md_out: the digest output. At most EVP_MAX_MD_SIZE bytes will be written. +// md_out_size: the number of output bytes is written here. +// header: the 13-byte, TLS record header. +// data: the record data itself +// data_plus_mac_size: the secret, reported length of the data and MAC +// once the padding has been removed. +// data_plus_mac_plus_padding_size: the public length of the whole +// record, including padding. +// +// On entry: by virtue of having been through one of the remove_padding +// functions, above, we know that data_plus_mac_size is large enough to contain +// a padding byte and MAC. (If the padding was invalid, it might contain the +// padding too. ) +int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, + size_t *md_out_size, const uint8_t header[13], + const uint8_t *data, size_t data_plus_mac_size, + size_t data_plus_mac_plus_padding_size, + const uint8_t *mac_secret, + unsigned mac_secret_length); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CIPHER_EXTRA_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h.grpc_back new file mode 100644 index 0000000..1d2c4e1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/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_EXTRA_INTERNAL_H +#define OPENSSL_HEADER_CIPHER_EXTRA_INTERNAL_H + +#include + +#include "../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// EVP_tls_cbc_get_padding determines the padding from the decrypted, TLS, CBC +// record in |in|. This decrypted record should not include any "decrypted" +// explicit IV. If the record is publicly invalid, it returns zero. Otherwise, +// it returns one and sets |*out_padding_ok| to all ones (0xfff..f) if the +// padding is valid and zero otherwise. It then sets |*out_len| to the length +// with the padding removed or |in_len| if invalid. +// +// If the function returns one, it runs in time independent of the contents of +// |in|. It is also guaranteed that |*out_len| >= |mac_size|, satisfying +// |EVP_tls_cbc_copy_mac|'s precondition. +int EVP_tls_cbc_remove_padding(crypto_word_t *out_padding_ok, size_t *out_len, + const uint8_t *in, size_t in_len, + size_t block_size, size_t mac_size); + +// EVP_tls_cbc_copy_mac copies |md_size| bytes from the end of the first +// |in_len| bytes of |in| to |out| in constant time (independent of the concrete +// value of |in_len|, which may vary within a 256-byte window). |in| must point +// to a buffer of |orig_len| bytes. +// +// On entry: +// orig_len >= in_len >= md_size +// md_size <= EVP_MAX_MD_SIZE +void EVP_tls_cbc_copy_mac(uint8_t *out, size_t md_size, const uint8_t *in, + size_t in_len, size_t orig_len); + +// EVP_tls_cbc_record_digest_supported returns 1 iff |md| is a hash function +// which EVP_tls_cbc_digest_record supports. +int EVP_tls_cbc_record_digest_supported(const EVP_MD *md); + +// EVP_tls_cbc_digest_record computes the MAC of a decrypted, padded TLS +// record. +// +// md: the hash function used in the HMAC. +// EVP_tls_cbc_record_digest_supported must return true for this hash. +// md_out: the digest output. At most EVP_MAX_MD_SIZE bytes will be written. +// md_out_size: the number of output bytes is written here. +// header: the 13-byte, TLS record header. +// data: the record data itself +// data_plus_mac_size: the secret, reported length of the data and MAC +// once the padding has been removed. +// data_plus_mac_plus_padding_size: the public length of the whole +// record, including padding. +// +// On entry: by virtue of having been through one of the remove_padding +// functions, above, we know that data_plus_mac_size is large enough to contain +// a padding byte and MAC. (If the padding was invalid, it might contain the +// padding too. ) +int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, + size_t *md_out_size, const uint8_t header[13], + const uint8_t *data, size_t data_plus_mac_size, + size_t data_plus_mac_plus_padding_size, + const uint8_t *mac_secret, + unsigned mac_secret_length); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CIPHER_EXTRA_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c new file mode 100644 index 0000000..a18f521 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c @@ -0,0 +1,491 @@ +/* ==================================================================== + * Copyright (c) 2012 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" +#include "internal.h" +#include "../fipsmodule/cipher/internal.h" + + +// MAX_HASH_BIT_COUNT_BYTES is the maximum number of bytes in the hash's length +// field. (SHA-384/512 have 128-bit length.) +#define MAX_HASH_BIT_COUNT_BYTES 16 + +// MAX_HASH_BLOCK_SIZE is the maximum hash block size that we'll support. +// Currently SHA-384/512 has a 128-byte block size and that's the largest +// supported by TLS.) +#define MAX_HASH_BLOCK_SIZE 128 + +int EVP_tls_cbc_remove_padding(crypto_word_t *out_padding_ok, size_t *out_len, + const uint8_t *in, size_t in_len, + size_t block_size, size_t mac_size) { + const size_t overhead = 1 /* padding length byte */ + mac_size; + + // These lengths are all public so we can test them in non-constant time. + if (overhead > in_len) { + return 0; + } + + size_t padding_length = in[in_len - 1]; + + crypto_word_t good = constant_time_ge_w(in_len, overhead + padding_length); + // The padding consists of a length byte at the end of the record and + // then that many bytes of padding, all with the same value as the + // length byte. Thus, with the length byte included, there are i+1 + // bytes of padding. + // + // We can't check just |padding_length+1| bytes because that leaks + // decrypted information. Therefore we always have to check the maximum + // amount of padding possible. (Again, the length of the record is + // public information so we can use it.) + size_t to_check = 256; // maximum amount of padding, inc length byte. + if (to_check > in_len) { + to_check = in_len; + } + + for (size_t i = 0; i < to_check; i++) { + uint8_t mask = constant_time_ge_8(padding_length, i); + uint8_t b = in[in_len - 1 - i]; + // The final |padding_length+1| bytes should all have the value + // |padding_length|. Therefore the XOR should be zero. + good &= ~(mask & (padding_length ^ b)); + } + + // If any of the final |padding_length+1| bytes had the wrong value, + // one or more of the lower eight bits of |good| will be cleared. + good = constant_time_eq_w(0xff, good & 0xff); + + // Always treat |padding_length| as zero on error. If, assuming block size of + // 16, a padding of [<15 arbitrary bytes> 15] treated |padding_length| as 16 + // and returned -1, distinguishing good MAC and bad padding from bad MAC and + // bad padding would give POODLE's padding oracle. + padding_length = good & (padding_length + 1); + *out_len = in_len - padding_length; + *out_padding_ok = good; + return 1; +} + +void EVP_tls_cbc_copy_mac(uint8_t *out, size_t md_size, const uint8_t *in, + size_t in_len, size_t orig_len) { + uint8_t rotated_mac1[EVP_MAX_MD_SIZE], rotated_mac2[EVP_MAX_MD_SIZE]; + uint8_t *rotated_mac = rotated_mac1; + uint8_t *rotated_mac_tmp = rotated_mac2; + + // mac_end is the index of |in| just after the end of the MAC. + size_t mac_end = in_len; + size_t mac_start = mac_end - md_size; + + assert(orig_len >= in_len); + assert(in_len >= md_size); + assert(md_size <= EVP_MAX_MD_SIZE); + + // scan_start contains the number of bytes that we can ignore because + // the MAC's position can only vary by 255 bytes. + size_t scan_start = 0; + // This information is public so it's safe to branch based on it. + if (orig_len > md_size + 255 + 1) { + scan_start = orig_len - (md_size + 255 + 1); + } + + size_t rotate_offset = 0; + uint8_t mac_started = 0; + OPENSSL_memset(rotated_mac, 0, md_size); + for (size_t i = scan_start, j = 0; i < orig_len; i++, j++) { + if (j >= md_size) { + j -= md_size; + } + crypto_word_t is_mac_start = constant_time_eq_w(i, mac_start); + mac_started |= is_mac_start; + uint8_t mac_ended = constant_time_ge_8(i, mac_end); + rotated_mac[j] |= in[i] & mac_started & ~mac_ended; + // Save the offset that |mac_start| is mapped to. + rotate_offset |= j & is_mac_start; + } + + // Now rotate the MAC. We rotate in log(md_size) steps, one for each bit + // position. + for (size_t offset = 1; offset < md_size; offset <<= 1, rotate_offset >>= 1) { + // Rotate by |offset| iff the corresponding bit is set in + // |rotate_offset|, placing the result in |rotated_mac_tmp|. + const uint8_t skip_rotate = (rotate_offset & 1) - 1; + for (size_t i = 0, j = offset; i < md_size; i++, j++) { + if (j >= md_size) { + j -= md_size; + } + rotated_mac_tmp[i] = + constant_time_select_8(skip_rotate, rotated_mac[i], rotated_mac[j]); + } + + // Swap pointers so |rotated_mac| contains the (possibly) rotated value. + // Note the number of iterations and thus the identity of these pointers is + // public information. + uint8_t *tmp = rotated_mac; + rotated_mac = rotated_mac_tmp; + rotated_mac_tmp = tmp; + } + + OPENSSL_memcpy(out, rotated_mac, md_size); +} + +// u32toBE serialises an unsigned, 32-bit number (n) as four bytes at (p) in +// big-endian order. The value of p is advanced by four. +#define u32toBE(n, p) \ + do { \ + *((p)++) = (uint8_t)((n) >> 24); \ + *((p)++) = (uint8_t)((n) >> 16); \ + *((p)++) = (uint8_t)((n) >> 8); \ + *((p)++) = (uint8_t)((n)); \ + } while (0) + +// u64toBE serialises an unsigned, 64-bit number (n) as eight bytes at (p) in +// big-endian order. The value of p is advanced by eight. +#define u64toBE(n, p) \ + do { \ + *((p)++) = (uint8_t)((n) >> 56); \ + *((p)++) = (uint8_t)((n) >> 48); \ + *((p)++) = (uint8_t)((n) >> 40); \ + *((p)++) = (uint8_t)((n) >> 32); \ + *((p)++) = (uint8_t)((n) >> 24); \ + *((p)++) = (uint8_t)((n) >> 16); \ + *((p)++) = (uint8_t)((n) >> 8); \ + *((p)++) = (uint8_t)((n)); \ + } while (0) + +typedef union { + SHA_CTX sha1; + SHA256_CTX sha256; + SHA512_CTX sha512; +} HASH_CTX; + +static void tls1_sha1_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA1_Transform(&ctx->sha1, block); +} + +static void tls1_sha256_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA256_Transform(&ctx->sha256, block); +} + +static void tls1_sha512_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA512_Transform(&ctx->sha512, block); +} + +// These functions serialize the state of a hash and thus perform the standard +// "final" operation without adding the padding and length that such a function +// typically does. +static void tls1_sha1_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA_CTX *sha1 = &ctx->sha1; + u32toBE(sha1->h[0], md_out); + u32toBE(sha1->h[1], md_out); + u32toBE(sha1->h[2], md_out); + u32toBE(sha1->h[3], md_out); + u32toBE(sha1->h[4], md_out); +} + +static void tls1_sha256_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA256_CTX *sha256 = &ctx->sha256; + for (unsigned i = 0; i < 8; i++) { + u32toBE(sha256->h[i], md_out); + } +} + +static void tls1_sha512_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA512_CTX *sha512 = &ctx->sha512; + for (unsigned i = 0; i < 8; i++) { + u64toBE(sha512->h[i], md_out); + } +} + +int EVP_tls_cbc_record_digest_supported(const EVP_MD *md) { + switch (EVP_MD_type(md)) { + case NID_sha1: + case NID_sha256: + case NID_sha384: + return 1; + + default: + return 0; + } +} + +int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, + size_t *md_out_size, const uint8_t header[13], + const uint8_t *data, size_t data_plus_mac_size, + size_t data_plus_mac_plus_padding_size, + const uint8_t *mac_secret, + unsigned mac_secret_length) { + 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, 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; + + // Bound the acceptable input so we can forget about many possible overflows + // later in this function. This is redundant with the record size limits in + // TLS. + if (data_plus_mac_plus_padding_size >= 1024 * 1024) { + assert(0); + return 0; + } + + switch (EVP_MD_type(md)) { + case NID_sha1: + SHA1_Init(&md_state.sha1); + md_final_raw = tls1_sha1_final_raw; + md_transform = tls1_sha1_transform; + md_size = SHA_DIGEST_LENGTH; + break; + + case NID_sha256: + SHA256_Init(&md_state.sha256); + md_final_raw = tls1_sha256_final_raw; + md_transform = tls1_sha256_transform; + md_size = SHA256_DIGEST_LENGTH; + break; + + case NID_sha384: + SHA384_Init(&md_state.sha512); + md_final_raw = tls1_sha512_final_raw; + md_transform = tls1_sha512_transform; + md_size = SHA384_DIGEST_LENGTH; + md_block_size = 128; + md_block_shift = 7; + md_length_size = 16; + break; + + default: + // EVP_tls_cbc_record_digest_supported should have been called first to + // check that the hash function is supported. + assert(0); + *md_out_size = 0; + return 0; + } + + 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; + + // kVarianceBlocks is the number of blocks of the hash that we have to + // calculate in constant time because they could be altered by the + // 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 |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. + size_t len = data_plus_mac_plus_padding_size + kHeaderLength; + // max_mac_bytes contains the maximum bytes of bytes in the MAC, including + // |header|, assuming that there's no padding. + size_t max_mac_bytes = len - md_size - 1; + // num_blocks is the maximum number of hash blocks. + size_t num_blocks = + (max_mac_bytes + 1 + md_length_size + md_block_size - 1) / md_block_size; + // In order to calculate the MAC in constant time we have to handle + // the final blocks specially because the padding value could cause the + // end to appear somewhere in the final |kVarianceBlocks| blocks and we + // can't leak where. However, |num_starting_blocks| worth of data can + // be hashed right away because no padding value can affect whether + // they are plaintext. + size_t num_starting_blocks = 0; + // 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. + 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 - 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; + k = md_block_size * num_starting_blocks; + } + + // bits is the hash-length in bits. It includes the additional hash + // block for the masked HMAC key. + size_t bits = 8 * mac_end_offset; // at most 18 bits to represent + + // Compute the initial HMAC block. + bits += 8 * md_block_size; + // hmac_pad is the masked HMAC key. + uint8_t hmac_pad[MAX_HASH_BLOCK_SIZE]; + OPENSSL_memset(hmac_pad, 0, md_block_size); + assert(mac_secret_length <= sizeof(hmac_pad)); + OPENSSL_memcpy(hmac_pad, mac_secret, mac_secret_length); + for (size_t i = 0; i < md_block_size; i++) { + hmac_pad[i] ^= 0x36; + } + + md_transform(&md_state, hmac_pad); + + // The length check means |bits| fits in four bytes. + uint8_t length_bytes[MAX_HASH_BIT_COUNT_BYTES]; + OPENSSL_memset(length_bytes, 0, md_length_size - 4); + length_bytes[md_length_size - 4] = (uint8_t)(bits >> 24); + length_bytes[md_length_size - 3] = (uint8_t)(bits >> 16); + length_bytes[md_length_size - 2] = (uint8_t)(bits >> 8); + length_bytes[md_length_size - 1] = (uint8_t)bits; + + if (k > 0) { + // k is a multiple of md_block_size. + uint8_t first_block[MAX_HASH_BLOCK_SIZE]; + OPENSSL_memcpy(first_block, header, 13); + OPENSSL_memcpy(first_block + 13, data, md_block_size - 13); + md_transform(&md_state, first_block); + for (size_t i = 1; i < k / md_block_size; i++) { + md_transform(&md_state, data + md_block_size * i - 13); + } + } + + uint8_t mac_out[EVP_MAX_MD_SIZE]; + OPENSSL_memset(mac_out, 0, sizeof(mac_out)); + + // We now process the final hash blocks. For each block, we construct + // it in constant time. If the |i==index_a| then we'll include the 0x80 + // bytes and zero pad etc. For each block we selectively copy it, in + // constant time, to |mac_out|. + for (size_t i = num_starting_blocks; + i <= num_starting_blocks + kVarianceBlocks; i++) { + uint8_t block[MAX_HASH_BLOCK_SIZE]; + uint8_t is_block_a = constant_time_eq_8(i, index_a); + uint8_t is_block_b = constant_time_eq_8(i, index_b); + for (size_t j = 0; j < md_block_size; j++) { + uint8_t b = 0; + if (k < kHeaderLength) { + b = header[k]; + } else if (k < data_plus_mac_plus_padding_size + kHeaderLength) { + b = data[k - kHeaderLength]; + } + k++; + + uint8_t is_past_c = is_block_a & constant_time_ge_8(j, c); + uint8_t is_past_cp1 = is_block_a & constant_time_ge_8(j, c + 1); + // If this is the block containing the end of the + // application data, and we are at the offset for the + // 0x80 value, then overwrite b with 0x80. + b = constant_time_select_8(is_past_c, 0x80, b); + // If this the the block containing the end of the + // application data and we're past the 0x80 value then + // just write zero. + b = b & ~is_past_cp1; + // If this is index_b (the final block), but not + // index_a (the end of the data), then the 64-bit + // length didn't fit into index_a and we're having to + // add an extra block of zeros. + b &= ~is_block_b | is_block_a; + + // The final bytes of one of the blocks contains the + // length. + if (j >= md_block_size - md_length_size) { + // If this is index_b, write a length byte. + b = constant_time_select_8( + is_block_b, length_bytes[j - (md_block_size - md_length_size)], b); + } + block[j] = b; + } + + md_transform(&md_state, block); + md_final_raw(&md_state, block); + // If this is index_b, copy the hash value to |mac_out|. + for (size_t j = 0; j < md_size; j++) { + mac_out[j] |= block[j] & is_block_b; + } + } + + EVP_MD_CTX md_ctx; + EVP_MD_CTX_init(&md_ctx); + if (!EVP_DigestInit_ex(&md_ctx, md, NULL /* engine */)) { + EVP_MD_CTX_cleanup(&md_ctx); + return 0; + } + + // Complete the HMAC in the standard manner. + for (size_t i = 0; i < md_block_size; i++) { + hmac_pad[i] ^= 0x6a; + } + + EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size); + EVP_DigestUpdate(&md_ctx, mac_out, md_size); + unsigned md_out_size_u; + EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); + *md_out_size = md_out_size_u; + EVP_MD_CTX_cleanup(&md_ctx); + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back new file mode 100644 index 0000000..52353f2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back @@ -0,0 +1,491 @@ +/* ==================================================================== + * Copyright (c) 2012 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" +#include "internal.h" +#include "../fipsmodule/cipher/internal.h" + + +// MAX_HASH_BIT_COUNT_BYTES is the maximum number of bytes in the hash's length +// field. (SHA-384/512 have 128-bit length.) +#define MAX_HASH_BIT_COUNT_BYTES 16 + +// MAX_HASH_BLOCK_SIZE is the maximum hash block size that we'll support. +// Currently SHA-384/512 has a 128-byte block size and that's the largest +// supported by TLS.) +#define MAX_HASH_BLOCK_SIZE 128 + +int EVP_tls_cbc_remove_padding(crypto_word_t *out_padding_ok, size_t *out_len, + const uint8_t *in, size_t in_len, + size_t block_size, size_t mac_size) { + const size_t overhead = 1 /* padding length byte */ + mac_size; + + // These lengths are all public so we can test them in non-constant time. + if (overhead > in_len) { + return 0; + } + + size_t padding_length = in[in_len - 1]; + + crypto_word_t good = constant_time_ge_w(in_len, overhead + padding_length); + // The padding consists of a length byte at the end of the record and + // then that many bytes of padding, all with the same value as the + // length byte. Thus, with the length byte included, there are i+1 + // bytes of padding. + // + // We can't check just |padding_length+1| bytes because that leaks + // decrypted information. Therefore we always have to check the maximum + // amount of padding possible. (Again, the length of the record is + // public information so we can use it.) + size_t to_check = 256; // maximum amount of padding, inc length byte. + if (to_check > in_len) { + to_check = in_len; + } + + for (size_t i = 0; i < to_check; i++) { + uint8_t mask = constant_time_ge_8(padding_length, i); + uint8_t b = in[in_len - 1 - i]; + // The final |padding_length+1| bytes should all have the value + // |padding_length|. Therefore the XOR should be zero. + good &= ~(mask & (padding_length ^ b)); + } + + // If any of the final |padding_length+1| bytes had the wrong value, + // one or more of the lower eight bits of |good| will be cleared. + good = constant_time_eq_w(0xff, good & 0xff); + + // Always treat |padding_length| as zero on error. If, assuming block size of + // 16, a padding of [<15 arbitrary bytes> 15] treated |padding_length| as 16 + // and returned -1, distinguishing good MAC and bad padding from bad MAC and + // bad padding would give POODLE's padding oracle. + padding_length = good & (padding_length + 1); + *out_len = in_len - padding_length; + *out_padding_ok = good; + return 1; +} + +void EVP_tls_cbc_copy_mac(uint8_t *out, size_t md_size, const uint8_t *in, + size_t in_len, size_t orig_len) { + uint8_t rotated_mac1[EVP_MAX_MD_SIZE], rotated_mac2[EVP_MAX_MD_SIZE]; + uint8_t *rotated_mac = rotated_mac1; + uint8_t *rotated_mac_tmp = rotated_mac2; + + // mac_end is the index of |in| just after the end of the MAC. + size_t mac_end = in_len; + size_t mac_start = mac_end - md_size; + + assert(orig_len >= in_len); + assert(in_len >= md_size); + assert(md_size <= EVP_MAX_MD_SIZE); + + // scan_start contains the number of bytes that we can ignore because + // the MAC's position can only vary by 255 bytes. + size_t scan_start = 0; + // This information is public so it's safe to branch based on it. + if (orig_len > md_size + 255 + 1) { + scan_start = orig_len - (md_size + 255 + 1); + } + + size_t rotate_offset = 0; + uint8_t mac_started = 0; + OPENSSL_memset(rotated_mac, 0, md_size); + for (size_t i = scan_start, j = 0; i < orig_len; i++, j++) { + if (j >= md_size) { + j -= md_size; + } + crypto_word_t is_mac_start = constant_time_eq_w(i, mac_start); + mac_started |= is_mac_start; + uint8_t mac_ended = constant_time_ge_8(i, mac_end); + rotated_mac[j] |= in[i] & mac_started & ~mac_ended; + // Save the offset that |mac_start| is mapped to. + rotate_offset |= j & is_mac_start; + } + + // Now rotate the MAC. We rotate in log(md_size) steps, one for each bit + // position. + for (size_t offset = 1; offset < md_size; offset <<= 1, rotate_offset >>= 1) { + // Rotate by |offset| iff the corresponding bit is set in + // |rotate_offset|, placing the result in |rotated_mac_tmp|. + const uint8_t skip_rotate = (rotate_offset & 1) - 1; + for (size_t i = 0, j = offset; i < md_size; i++, j++) { + if (j >= md_size) { + j -= md_size; + } + rotated_mac_tmp[i] = + constant_time_select_8(skip_rotate, rotated_mac[i], rotated_mac[j]); + } + + // Swap pointers so |rotated_mac| contains the (possibly) rotated value. + // Note the number of iterations and thus the identity of these pointers is + // public information. + uint8_t *tmp = rotated_mac; + rotated_mac = rotated_mac_tmp; + rotated_mac_tmp = tmp; + } + + OPENSSL_memcpy(out, rotated_mac, md_size); +} + +// u32toBE serialises an unsigned, 32-bit number (n) as four bytes at (p) in +// big-endian order. The value of p is advanced by four. +#define u32toBE(n, p) \ + do { \ + *((p)++) = (uint8_t)((n) >> 24); \ + *((p)++) = (uint8_t)((n) >> 16); \ + *((p)++) = (uint8_t)((n) >> 8); \ + *((p)++) = (uint8_t)((n)); \ + } while (0) + +// u64toBE serialises an unsigned, 64-bit number (n) as eight bytes at (p) in +// big-endian order. The value of p is advanced by eight. +#define u64toBE(n, p) \ + do { \ + *((p)++) = (uint8_t)((n) >> 56); \ + *((p)++) = (uint8_t)((n) >> 48); \ + *((p)++) = (uint8_t)((n) >> 40); \ + *((p)++) = (uint8_t)((n) >> 32); \ + *((p)++) = (uint8_t)((n) >> 24); \ + *((p)++) = (uint8_t)((n) >> 16); \ + *((p)++) = (uint8_t)((n) >> 8); \ + *((p)++) = (uint8_t)((n)); \ + } while (0) + +typedef union { + SHA_CTX sha1; + SHA256_CTX sha256; + SHA512_CTX sha512; +} HASH_CTX; + +static void tls1_sha1_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA1_Transform(&ctx->sha1, block); +} + +static void tls1_sha256_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA256_Transform(&ctx->sha256, block); +} + +static void tls1_sha512_transform(HASH_CTX *ctx, const uint8_t *block) { + SHA512_Transform(&ctx->sha512, block); +} + +// These functions serialize the state of a hash and thus perform the standard +// "final" operation without adding the padding and length that such a function +// typically does. +static void tls1_sha1_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA_CTX *sha1 = &ctx->sha1; + u32toBE(sha1->h[0], md_out); + u32toBE(sha1->h[1], md_out); + u32toBE(sha1->h[2], md_out); + u32toBE(sha1->h[3], md_out); + u32toBE(sha1->h[4], md_out); +} + +static void tls1_sha256_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA256_CTX *sha256 = &ctx->sha256; + for (unsigned i = 0; i < 8; i++) { + u32toBE(sha256->h[i], md_out); + } +} + +static void tls1_sha512_final_raw(HASH_CTX *ctx, uint8_t *md_out) { + SHA512_CTX *sha512 = &ctx->sha512; + for (unsigned i = 0; i < 8; i++) { + u64toBE(sha512->h[i], md_out); + } +} + +int EVP_tls_cbc_record_digest_supported(const EVP_MD *md) { + switch (EVP_MD_type(md)) { + case NID_sha1: + case NID_sha256: + case NID_sha384: + return 1; + + default: + return 0; + } +} + +int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, + size_t *md_out_size, const uint8_t header[13], + const uint8_t *data, size_t data_plus_mac_size, + size_t data_plus_mac_plus_padding_size, + const uint8_t *mac_secret, + unsigned mac_secret_length) { + 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, 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; + + // Bound the acceptable input so we can forget about many possible overflows + // later in this function. This is redundant with the record size limits in + // TLS. + if (data_plus_mac_plus_padding_size >= 1024 * 1024) { + assert(0); + return 0; + } + + switch (EVP_MD_type(md)) { + case NID_sha1: + SHA1_Init(&md_state.sha1); + md_final_raw = tls1_sha1_final_raw; + md_transform = tls1_sha1_transform; + md_size = SHA_DIGEST_LENGTH; + break; + + case NID_sha256: + SHA256_Init(&md_state.sha256); + md_final_raw = tls1_sha256_final_raw; + md_transform = tls1_sha256_transform; + md_size = SHA256_DIGEST_LENGTH; + break; + + case NID_sha384: + SHA384_Init(&md_state.sha512); + md_final_raw = tls1_sha512_final_raw; + md_transform = tls1_sha512_transform; + md_size = SHA384_DIGEST_LENGTH; + md_block_size = 128; + md_block_shift = 7; + md_length_size = 16; + break; + + default: + // EVP_tls_cbc_record_digest_supported should have been called first to + // check that the hash function is supported. + assert(0); + *md_out_size = 0; + return 0; + } + + 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; + + // kVarianceBlocks is the number of blocks of the hash that we have to + // calculate in constant time because they could be altered by the + // 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 |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. + size_t len = data_plus_mac_plus_padding_size + kHeaderLength; + // max_mac_bytes contains the maximum bytes of bytes in the MAC, including + // |header|, assuming that there's no padding. + size_t max_mac_bytes = len - md_size - 1; + // num_blocks is the maximum number of hash blocks. + size_t num_blocks = + (max_mac_bytes + 1 + md_length_size + md_block_size - 1) / md_block_size; + // In order to calculate the MAC in constant time we have to handle + // the final blocks specially because the padding value could cause the + // end to appear somewhere in the final |kVarianceBlocks| blocks and we + // can't leak where. However, |num_starting_blocks| worth of data can + // be hashed right away because no padding value can affect whether + // they are plaintext. + size_t num_starting_blocks = 0; + // 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. + 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 - 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; + k = md_block_size * num_starting_blocks; + } + + // bits is the hash-length in bits. It includes the additional hash + // block for the masked HMAC key. + size_t bits = 8 * mac_end_offset; // at most 18 bits to represent + + // Compute the initial HMAC block. + bits += 8 * md_block_size; + // hmac_pad is the masked HMAC key. + uint8_t hmac_pad[MAX_HASH_BLOCK_SIZE]; + OPENSSL_memset(hmac_pad, 0, md_block_size); + assert(mac_secret_length <= sizeof(hmac_pad)); + OPENSSL_memcpy(hmac_pad, mac_secret, mac_secret_length); + for (size_t i = 0; i < md_block_size; i++) { + hmac_pad[i] ^= 0x36; + } + + md_transform(&md_state, hmac_pad); + + // The length check means |bits| fits in four bytes. + uint8_t length_bytes[MAX_HASH_BIT_COUNT_BYTES]; + OPENSSL_memset(length_bytes, 0, md_length_size - 4); + length_bytes[md_length_size - 4] = (uint8_t)(bits >> 24); + length_bytes[md_length_size - 3] = (uint8_t)(bits >> 16); + length_bytes[md_length_size - 2] = (uint8_t)(bits >> 8); + length_bytes[md_length_size - 1] = (uint8_t)bits; + + if (k > 0) { + // k is a multiple of md_block_size. + uint8_t first_block[MAX_HASH_BLOCK_SIZE]; + OPENSSL_memcpy(first_block, header, 13); + OPENSSL_memcpy(first_block + 13, data, md_block_size - 13); + md_transform(&md_state, first_block); + for (size_t i = 1; i < k / md_block_size; i++) { + md_transform(&md_state, data + md_block_size * i - 13); + } + } + + uint8_t mac_out[EVP_MAX_MD_SIZE]; + OPENSSL_memset(mac_out, 0, sizeof(mac_out)); + + // We now process the final hash blocks. For each block, we construct + // it in constant time. If the |i==index_a| then we'll include the 0x80 + // bytes and zero pad etc. For each block we selectively copy it, in + // constant time, to |mac_out|. + for (size_t i = num_starting_blocks; + i <= num_starting_blocks + kVarianceBlocks; i++) { + uint8_t block[MAX_HASH_BLOCK_SIZE]; + uint8_t is_block_a = constant_time_eq_8(i, index_a); + uint8_t is_block_b = constant_time_eq_8(i, index_b); + for (size_t j = 0; j < md_block_size; j++) { + uint8_t b = 0; + if (k < kHeaderLength) { + b = header[k]; + } else if (k < data_plus_mac_plus_padding_size + kHeaderLength) { + b = data[k - kHeaderLength]; + } + k++; + + uint8_t is_past_c = is_block_a & constant_time_ge_8(j, c); + uint8_t is_past_cp1 = is_block_a & constant_time_ge_8(j, c + 1); + // If this is the block containing the end of the + // application data, and we are at the offset for the + // 0x80 value, then overwrite b with 0x80. + b = constant_time_select_8(is_past_c, 0x80, b); + // If this the the block containing the end of the + // application data and we're past the 0x80 value then + // just write zero. + b = b & ~is_past_cp1; + // If this is index_b (the final block), but not + // index_a (the end of the data), then the 64-bit + // length didn't fit into index_a and we're having to + // add an extra block of zeros. + b &= ~is_block_b | is_block_a; + + // The final bytes of one of the blocks contains the + // length. + if (j >= md_block_size - md_length_size) { + // If this is index_b, write a length byte. + b = constant_time_select_8( + is_block_b, length_bytes[j - (md_block_size - md_length_size)], b); + } + block[j] = b; + } + + md_transform(&md_state, block); + md_final_raw(&md_state, block); + // If this is index_b, copy the hash value to |mac_out|. + for (size_t j = 0; j < md_size; j++) { + mac_out[j] |= block[j] & is_block_b; + } + } + + EVP_MD_CTX md_ctx; + EVP_MD_CTX_init(&md_ctx); + if (!EVP_DigestInit_ex(&md_ctx, md, NULL /* engine */)) { + EVP_MD_CTX_cleanup(&md_ctx); + return 0; + } + + // Complete the HMAC in the standard manner. + for (size_t i = 0; i < md_block_size; i++) { + hmac_pad[i] ^= 0x6a; + } + + EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size); + EVP_DigestUpdate(&md_ctx, mac_out, md_size); + unsigned md_out_size_u; + EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); + *md_out_size = md_out_size_u; + EVP_MD_CTX_cleanup(&md_ctx); + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c new file mode 100644 index 0000000..b191312 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c.grpc_back new file mode 100644 index 0000000..b6a10f7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c new file mode 100644 index 0000000..5ae7f11 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c @@ -0,0 +1,810 @@ +/* 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 "conf_def.h" +#include "internal.h" +#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 + +static uint32_t conf_value_hash(const CONF_VALUE *v) { + return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name); +} + +static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { + int i; + + if (a->section != b->section) { + i = strcmp(a->section, b->section); + if (i) { + return i; + } + } + + if (a->name != NULL && b->name != NULL) { + return strcmp(a->name, b->name); + } else if (a->name == b->name) { + return 0; + } else { + return (a->name == NULL) ? -1 : 1; + } +} + +CONF *NCONF_new(void *method) { + CONF *conf; + + if (method != NULL) { + return NULL; + } + + conf = OPENSSL_malloc(sizeof(CONF)); + if (conf == NULL) { + return NULL; + } + + conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp); + if (conf->data == NULL) { + OPENSSL_free(conf); + return NULL; + } + + return conf; +} + +CONF_VALUE *CONF_VALUE_new(void) { + CONF_VALUE *v = OPENSSL_malloc(sizeof(CONF_VALUE)); + if (!v) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(v, 0, sizeof(CONF_VALUE)); + return v; +} + +static void value_free_contents(CONF_VALUE *value) { + if (value->section) { + OPENSSL_free(value->section); + } + if (value->name) { + OPENSSL_free(value->name); + if (value->value) { + OPENSSL_free(value->value); + } + } else { + if (value->value) { + sk_CONF_VALUE_free((STACK_OF(CONF_VALUE)*)value->value); + } + } +} + +static void value_free(CONF_VALUE *value) { + value_free_contents(value); + OPENSSL_free(value); +} + +void NCONF_free(CONF *conf) { + if (conf == NULL || conf->data == NULL) { + return; + } + + lh_CONF_VALUE_doall(conf->data, value_free); + lh_CONF_VALUE_free(conf->data); + OPENSSL_free(conf); +} + +static CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) { + STACK_OF(CONF_VALUE) *sk = NULL; + int ok = 0; + CONF_VALUE *v = NULL, *old_value; + + sk = sk_CONF_VALUE_new_null(); + v = CONF_VALUE_new(); + if (sk == NULL || v == NULL) { + goto err; + } + v->section = OPENSSL_strdup(section); + if (v->section == NULL) { + goto err; + } + + v->name = NULL; + v->value = (char *)sk; + + if (!lh_CONF_VALUE_insert(conf->data, &old_value, v)) { + goto err; + } + if (old_value) { + value_free(old_value); + } + ok = 1; + +err: + if (!ok) { + if (sk != NULL) { + sk_CONF_VALUE_free(sk); + } + if (v != NULL) { + OPENSSL_free(v); + } + v = NULL; + } + return v; +} + +static int str_copy(CONF *conf, char *section, char **pto, char *from) { + int q, r, rr = 0, to = 0, len = 0; + char *s, *e, *rp, *rrp, *np, *cp, v; + const char *p; + BUF_MEM *buf; + + buf = BUF_MEM_new(); + if (buf == NULL) { + return 0; + } + + len = strlen(from) + 1; + if (!BUF_MEM_grow(buf, len)) { + goto err; + } + + for (;;) { + if (IS_QUOTE(conf, *from)) { + q = *from; + from++; + while (!IS_EOF(conf, *from) && (*from != q)) { + if (IS_ESC(conf, *from)) { + from++; + if (IS_EOF(conf, *from)) { + break; + } + } + buf->data[to++] = *(from++); + } + if (*from == q) { + from++; + } + } else if (IS_DQUOTE(conf, *from)) { + q = *from; + from++; + while (!IS_EOF(conf, *from)) { + if (*from == q) { + if (*(from + 1) == q) { + from++; + } else { + break; + } + } + buf->data[to++] = *(from++); + } + if (*from == q) { + from++; + } + } else if (IS_ESC(conf, *from)) { + from++; + v = *(from++); + if (IS_EOF(conf, v)) { + break; + } else if (v == 'r') { + v = '\r'; + } else if (v == 'n') { + v = '\n'; + } else if (v == 'b') { + v = '\b'; + } else if (v == 't') { + v = '\t'; + } + buf->data[to++] = v; + } else if (IS_EOF(conf, *from)) { + break; + } else if (*from == '$') { + // try to expand it + rrp = NULL; + s = &(from[1]); + if (*s == '{') { + q = '}'; + } else if (*s == '(') { + q = ')'; + } else { + q = 0; + } + + if (q) { + s++; + } + cp = section; + e = np = s; + while (IS_ALPHA_NUMERIC(conf, *e)) { + e++; + } + if (e[0] == ':' && e[1] == ':') { + cp = np; + rrp = e; + rr = *e; + *rrp = '\0'; + e += 2; + np = e; + while (IS_ALPHA_NUMERIC(conf, *e)) { + e++; + } + } + r = *e; + *e = '\0'; + rp = e; + if (q) { + if (r != q) { + OPENSSL_PUT_ERROR(CONF, CONF_R_NO_CLOSE_BRACE); + goto err; + } + e++; + } + // So at this point we have + // np which is the start of the name string which is + // '\0' terminated. + // cp which is the start of the section string which is + // '\0' terminated. + // e is the 'next point after'. + // r and rr are the chars replaced by the '\0' + // rp and rrp is where 'r' and 'rr' came from. + p = NCONF_get_string(conf, cp, np); + if (rrp != NULL) { + *rrp = rr; + } + *rp = r; + if (p == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_VARIABLE_HAS_NO_VALUE); + goto err; + } + size_t newsize = strlen(p) + buf->length - (e - from); + if (newsize > MAX_CONF_VALUE_LENGTH) { + OPENSSL_PUT_ERROR(CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG); + goto err; + } + if (!BUF_MEM_grow_clean(buf, newsize)) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + while (*p) { + buf->data[to++] = *(p++); + } + + /* Since we change the pointer 'from', we also have + to change the perceived length of the string it + points at. /RL */ + len -= e - from; + from = e; + + /* In case there were no braces or parenthesis around + the variable reference, we have to put back the + character that was replaced with a '\0'. /RL */ + *rp = r; + } else { + buf->data[to++] = *(from++); + } + } + + buf->data[to] = '\0'; + if (*pto != NULL) { + OPENSSL_free(*pto); + } + *pto = buf->data; + OPENSSL_free(buf); + return 1; + +err: + if (buf != NULL) { + BUF_MEM_free(buf); + } + return 0; +} + +static CONF_VALUE *get_section(const CONF *conf, const char *section) { + CONF_VALUE template; + + OPENSSL_memset(&template, 0, sizeof(template)); + template.section = (char *) section; + return lh_CONF_VALUE_retrieve(conf->data, &template); +} + +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section) { + CONF_VALUE *section_value = get_section(conf, section); + if (section_value == NULL) { + return NULL; + } + return (STACK_OF(CONF_VALUE)*) section_value->value; +} + +const char *NCONF_get_string(const CONF *conf, const char *section, + const char *name) { + CONF_VALUE template, *value; + + OPENSSL_memset(&template, 0, sizeof(template)); + template.section = (char *) section; + template.name = (char *) name; + value = lh_CONF_VALUE_retrieve(conf->data, &template); + if (value == NULL) { + return NULL; + } + return value->value; +} + +static int add_string(const CONF *conf, CONF_VALUE *section, + CONF_VALUE *value) { + STACK_OF(CONF_VALUE) *section_stack = (STACK_OF(CONF_VALUE)*) section->value; + CONF_VALUE *old_value; + + value->section = OPENSSL_strdup(section->section); + if (!sk_CONF_VALUE_push(section_stack, value)) { + return 0; + } + + if (!lh_CONF_VALUE_insert(conf->data, &old_value, value)) { + return 0; + } + if (old_value != NULL) { + (void)sk_CONF_VALUE_delete_ptr(section_stack, old_value); + value_free(old_value); + } + + return 1; +} + +static char *eat_ws(CONF *conf, char *p) { + while (IS_WS(conf, *p) && !IS_EOF(conf, *p)) { + p++; + } + return p; +} + +#define scan_esc(conf, p) (((IS_EOF((conf), (p)[1])) ? ((p) + 1) : ((p) + 2))) + +static char *eat_alpha_numeric(CONF *conf, char *p) { + for (;;) { + if (IS_ESC(conf, *p)) { + p = scan_esc(conf, p); + continue; + } + if (!IS_ALPHA_NUMERIC_PUNCT(conf, *p)) { + return p; + } + p++; + } +} + +static char *scan_quote(CONF *conf, char *p) { + int q = *p; + + p++; + while (!IS_EOF(conf, *p) && *p != q) { + if (IS_ESC(conf, *p)) { + p++; + if (IS_EOF(conf, *p)) { + return p; + } + } + p++; + } + if (*p == q) { + p++; + } + return p; +} + + +static char *scan_dquote(CONF *conf, char *p) { + int q = *p; + + p++; + while (!(IS_EOF(conf, *p))) { + if (*p == q) { + if (*(p + 1) == q) { + p++; + } else { + break; + } + } + p++; + } + if (*p == q) { + p++; + } + return p; +} + +static void clear_comments(CONF *conf, char *p) { + for (;;) { + if (IS_FCOMMENT(conf, *p)) { + *p = '\0'; + return; + } + if (!IS_WS(conf, *p)) { + break; + } + p++; + } + + for (;;) { + if (IS_COMMENT(conf, *p)) { + *p = '\0'; + return; + } + if (IS_DQUOTE(conf, *p)) { + p = scan_dquote(conf, p); + continue; + } + if (IS_QUOTE(conf, *p)) { + p = scan_quote(conf, p); + continue; + } + if (IS_ESC(conf, *p)) { + p = scan_esc(conf, p); + continue; + } + if (IS_EOF(conf, *p)) { + return; + } else { + p++; + } + } +} + +static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { + static const size_t CONFBUFSIZE = 512; + int bufnum = 0, i, ii; + BUF_MEM *buff = NULL; + char *s, *p, *end; + int again; + long eline = 0; + char btmp[DECIMAL_SIZE(eline) + 1]; + CONF_VALUE *v = NULL, *tv; + CONF_VALUE *sv = NULL; + char *section = NULL, *buf; + char *start, *psection, *pname; + + if ((buff = BUF_MEM_new()) == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB); + goto err; + } + + section = OPENSSL_strdup("default"); + if (section == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + + sv = NCONF_new_section(conf, section); + if (sv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + + bufnum = 0; + again = 0; + for (;;) { + if (!BUF_MEM_grow(buff, bufnum + CONFBUFSIZE)) { + OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB); + goto err; + } + p = &(buff->data[bufnum]); + *p = '\0'; + BIO_gets(in, p, CONFBUFSIZE - 1); + p[CONFBUFSIZE - 1] = '\0'; + ii = i = strlen(p); + if (i == 0 && !again) { + break; + } + again = 0; + while (i > 0) { + if ((p[i - 1] != '\r') && (p[i - 1] != '\n')) { + break; + } else { + i--; + } + } + // we removed some trailing stuff so there is a new + // line on the end. + if (ii && i == ii) { + again = 1; // long line + } else { + p[i] = '\0'; + eline++; // another input line + } + + // we now have a line with trailing \r\n removed + + // i is the number of bytes + bufnum += i; + + v = NULL; + // check for line continuation + if (bufnum >= 1) { + // If we have bytes and the last char '\\' and + // second last char is not '\\' + p = &(buff->data[bufnum - 1]); + if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) { + bufnum--; + again = 1; + } + } + if (again) { + continue; + } + bufnum = 0; + buf = buff->data; + + clear_comments(conf, buf); + s = eat_ws(conf, buf); + if (IS_EOF(conf, *s)) { + continue; // blank line + } + if (*s == '[') { + char *ss; + + s++; + start = eat_ws(conf, s); + ss = start; + again: + end = eat_alpha_numeric(conf, ss); + p = eat_ws(conf, end); + if (*p != ']') { + if (*p != '\0' && ss != p) { + ss = p; + goto again; + } + OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET); + goto err; + } + *end = '\0'; + if (!str_copy(conf, NULL, §ion, start)) { + goto err; + } + if ((sv = get_section(conf, section)) == NULL) { + sv = NCONF_new_section(conf, section); + } + if (sv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + continue; + } else { + pname = s; + psection = NULL; + end = eat_alpha_numeric(conf, s); + if ((end[0] == ':') && (end[1] == ':')) { + *end = '\0'; + end += 2; + psection = pname; + pname = end; + end = eat_alpha_numeric(conf, end); + } + p = eat_ws(conf, end); + if (*p != '=') { + OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_EQUAL_SIGN); + goto err; + } + *end = '\0'; + p++; + start = eat_ws(conf, p); + while (!IS_EOF(conf, *p)) { + p++; + } + p--; + while ((p != start) && (IS_WS(conf, *p))) { + p--; + } + p++; + *p = '\0'; + + if (!(v = CONF_VALUE_new())) { + goto err; + } + if (psection == NULL) { + psection = section; + } + v->name = OPENSSL_strdup(pname); + if (v->name == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!str_copy(conf, psection, &(v->value), start)) { + goto err; + } + + if (strcmp(psection, section) != 0) { + if ((tv = get_section(conf, psection)) == NULL) { + tv = NCONF_new_section(conf, psection); + } + if (tv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + } else { + tv = sv; + } + if (add_string(conf, tv, v) == 0) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + v = NULL; + } + } + if (buff != NULL) { + BUF_MEM_free(buff); + } + if (section != NULL) { + OPENSSL_free(section); + } + return 1; + +err: + if (buff != NULL) { + BUF_MEM_free(buff); + } + if (section != NULL) { + OPENSSL_free(section); + } + if (out_error_line != NULL) { + *out_error_line = eline; + } + BIO_snprintf(btmp, sizeof btmp, "%ld", eline); + ERR_add_error_data(2, "line ", btmp); + + if (v != NULL) { + if (v->name != NULL) { + OPENSSL_free(v->name); + } + if (v->value != NULL) { + OPENSSL_free(v->value); + } + if (v != NULL) { + OPENSSL_free(v); + } + } + return 0; +} + +int NCONF_load(CONF *conf, const char *filename, long *out_error_line) { + BIO *in = BIO_new_file(filename, "rb"); + int ret; + + if (in == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_SYS_LIB); + return 0; + } + + ret = def_load_bio(conf, in, out_error_line); + BIO_free(in); + + return ret; +} + +int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line) { + return def_load_bio(conf, bio, out_error_line); +} + +int CONF_parse_list(const char *list, char sep, int remove_whitespace, + int (*list_cb)(const char *elem, int len, void *usr), + void *arg) { + int ret; + const char *lstart, *tmpend, *p; + + if (list == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_LIST_CANNOT_BE_NULL); + return 0; + } + + lstart = list; + for (;;) { + if (remove_whitespace) { + while (*lstart && isspace((unsigned char)*lstart)) { + lstart++; + } + } + p = strchr(lstart, sep); + if (p == lstart || !*lstart) { + ret = list_cb(NULL, 0, arg); + } else { + if (p) { + tmpend = p - 1; + } else { + tmpend = lstart + strlen(lstart) - 1; + } + if (remove_whitespace) { + while (isspace((unsigned char)*tmpend)) { + tmpend--; + } + } + ret = list_cb(lstart, tmpend - lstart + 1, arg); + } + if (ret <= 0) { + return ret; + } + if (p == NULL) { + return 1; + } + lstart = p + 1; + } +} + +int CONF_modules_load_file(const char *filename, const char *appname, + unsigned long flags) { + return 1; +} + +void CONF_modules_free(void) {} + +void OPENSSL_config(const char *config_name) {} + +void OPENSSL_no_config(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back new file mode 100644 index 0000000..7070ca8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back @@ -0,0 +1,810 @@ +/* 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 "conf_def.h" +#include "internal.h" +#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 + +static uint32_t conf_value_hash(const CONF_VALUE *v) { + return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name); +} + +static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { + int i; + + if (a->section != b->section) { + i = strcmp(a->section, b->section); + if (i) { + return i; + } + } + + if (a->name != NULL && b->name != NULL) { + return strcmp(a->name, b->name); + } else if (a->name == b->name) { + return 0; + } else { + return (a->name == NULL) ? -1 : 1; + } +} + +CONF *NCONF_new(void *method) { + CONF *conf; + + if (method != NULL) { + return NULL; + } + + conf = OPENSSL_malloc(sizeof(CONF)); + if (conf == NULL) { + return NULL; + } + + conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp); + if (conf->data == NULL) { + OPENSSL_free(conf); + return NULL; + } + + return conf; +} + +CONF_VALUE *CONF_VALUE_new(void) { + CONF_VALUE *v = OPENSSL_malloc(sizeof(CONF_VALUE)); + if (!v) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(v, 0, sizeof(CONF_VALUE)); + return v; +} + +static void value_free_contents(CONF_VALUE *value) { + if (value->section) { + OPENSSL_free(value->section); + } + if (value->name) { + OPENSSL_free(value->name); + if (value->value) { + OPENSSL_free(value->value); + } + } else { + if (value->value) { + sk_CONF_VALUE_free((STACK_OF(CONF_VALUE)*)value->value); + } + } +} + +static void value_free(CONF_VALUE *value) { + value_free_contents(value); + OPENSSL_free(value); +} + +void NCONF_free(CONF *conf) { + if (conf == NULL || conf->data == NULL) { + return; + } + + lh_CONF_VALUE_doall(conf->data, value_free); + lh_CONF_VALUE_free(conf->data); + OPENSSL_free(conf); +} + +static CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) { + STACK_OF(CONF_VALUE) *sk = NULL; + int ok = 0; + CONF_VALUE *v = NULL, *old_value; + + sk = sk_CONF_VALUE_new_null(); + v = CONF_VALUE_new(); + if (sk == NULL || v == NULL) { + goto err; + } + v->section = OPENSSL_strdup(section); + if (v->section == NULL) { + goto err; + } + + v->name = NULL; + v->value = (char *)sk; + + if (!lh_CONF_VALUE_insert(conf->data, &old_value, v)) { + goto err; + } + if (old_value) { + value_free(old_value); + } + ok = 1; + +err: + if (!ok) { + if (sk != NULL) { + sk_CONF_VALUE_free(sk); + } + if (v != NULL) { + OPENSSL_free(v); + } + v = NULL; + } + return v; +} + +static int str_copy(CONF *conf, char *section, char **pto, char *from) { + int q, r, rr = 0, to = 0, len = 0; + char *s, *e, *rp, *rrp, *np, *cp, v; + const char *p; + BUF_MEM *buf; + + buf = BUF_MEM_new(); + if (buf == NULL) { + return 0; + } + + len = strlen(from) + 1; + if (!BUF_MEM_grow(buf, len)) { + goto err; + } + + for (;;) { + if (IS_QUOTE(conf, *from)) { + q = *from; + from++; + while (!IS_EOF(conf, *from) && (*from != q)) { + if (IS_ESC(conf, *from)) { + from++; + if (IS_EOF(conf, *from)) { + break; + } + } + buf->data[to++] = *(from++); + } + if (*from == q) { + from++; + } + } else if (IS_DQUOTE(conf, *from)) { + q = *from; + from++; + while (!IS_EOF(conf, *from)) { + if (*from == q) { + if (*(from + 1) == q) { + from++; + } else { + break; + } + } + buf->data[to++] = *(from++); + } + if (*from == q) { + from++; + } + } else if (IS_ESC(conf, *from)) { + from++; + v = *(from++); + if (IS_EOF(conf, v)) { + break; + } else if (v == 'r') { + v = '\r'; + } else if (v == 'n') { + v = '\n'; + } else if (v == 'b') { + v = '\b'; + } else if (v == 't') { + v = '\t'; + } + buf->data[to++] = v; + } else if (IS_EOF(conf, *from)) { + break; + } else if (*from == '$') { + // try to expand it + rrp = NULL; + s = &(from[1]); + if (*s == '{') { + q = '}'; + } else if (*s == '(') { + q = ')'; + } else { + q = 0; + } + + if (q) { + s++; + } + cp = section; + e = np = s; + while (IS_ALPHA_NUMERIC(conf, *e)) { + e++; + } + if (e[0] == ':' && e[1] == ':') { + cp = np; + rrp = e; + rr = *e; + *rrp = '\0'; + e += 2; + np = e; + while (IS_ALPHA_NUMERIC(conf, *e)) { + e++; + } + } + r = *e; + *e = '\0'; + rp = e; + if (q) { + if (r != q) { + OPENSSL_PUT_ERROR(CONF, CONF_R_NO_CLOSE_BRACE); + goto err; + } + e++; + } + // So at this point we have + // np which is the start of the name string which is + // '\0' terminated. + // cp which is the start of the section string which is + // '\0' terminated. + // e is the 'next point after'. + // r and rr are the chars replaced by the '\0' + // rp and rrp is where 'r' and 'rr' came from. + p = NCONF_get_string(conf, cp, np); + if (rrp != NULL) { + *rrp = rr; + } + *rp = r; + if (p == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_VARIABLE_HAS_NO_VALUE); + goto err; + } + size_t newsize = strlen(p) + buf->length - (e - from); + if (newsize > MAX_CONF_VALUE_LENGTH) { + OPENSSL_PUT_ERROR(CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG); + goto err; + } + if (!BUF_MEM_grow_clean(buf, newsize)) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + while (*p) { + buf->data[to++] = *(p++); + } + + /* Since we change the pointer 'from', we also have + to change the perceived length of the string it + points at. /RL */ + len -= e - from; + from = e; + + /* In case there were no braces or parenthesis around + the variable reference, we have to put back the + character that was replaced with a '\0'. /RL */ + *rp = r; + } else { + buf->data[to++] = *(from++); + } + } + + buf->data[to] = '\0'; + if (*pto != NULL) { + OPENSSL_free(*pto); + } + *pto = buf->data; + OPENSSL_free(buf); + return 1; + +err: + if (buf != NULL) { + BUF_MEM_free(buf); + } + return 0; +} + +static CONF_VALUE *get_section(const CONF *conf, const char *section) { + CONF_VALUE template; + + OPENSSL_memset(&template, 0, sizeof(template)); + template.section = (char *) section; + return lh_CONF_VALUE_retrieve(conf->data, &template); +} + +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section) { + CONF_VALUE *section_value = get_section(conf, section); + if (section_value == NULL) { + return NULL; + } + return (STACK_OF(CONF_VALUE)*) section_value->value; +} + +const char *NCONF_get_string(const CONF *conf, const char *section, + const char *name) { + CONF_VALUE template, *value; + + OPENSSL_memset(&template, 0, sizeof(template)); + template.section = (char *) section; + template.name = (char *) name; + value = lh_CONF_VALUE_retrieve(conf->data, &template); + if (value == NULL) { + return NULL; + } + return value->value; +} + +static int add_string(const CONF *conf, CONF_VALUE *section, + CONF_VALUE *value) { + STACK_OF(CONF_VALUE) *section_stack = (STACK_OF(CONF_VALUE)*) section->value; + CONF_VALUE *old_value; + + value->section = OPENSSL_strdup(section->section); + if (!sk_CONF_VALUE_push(section_stack, value)) { + return 0; + } + + if (!lh_CONF_VALUE_insert(conf->data, &old_value, value)) { + return 0; + } + if (old_value != NULL) { + (void)sk_CONF_VALUE_delete_ptr(section_stack, old_value); + value_free(old_value); + } + + return 1; +} + +static char *eat_ws(CONF *conf, char *p) { + while (IS_WS(conf, *p) && !IS_EOF(conf, *p)) { + p++; + } + return p; +} + +#define scan_esc(conf, p) (((IS_EOF((conf), (p)[1])) ? ((p) + 1) : ((p) + 2))) + +static char *eat_alpha_numeric(CONF *conf, char *p) { + for (;;) { + if (IS_ESC(conf, *p)) { + p = scan_esc(conf, p); + continue; + } + if (!IS_ALPHA_NUMERIC_PUNCT(conf, *p)) { + return p; + } + p++; + } +} + +static char *scan_quote(CONF *conf, char *p) { + int q = *p; + + p++; + while (!IS_EOF(conf, *p) && *p != q) { + if (IS_ESC(conf, *p)) { + p++; + if (IS_EOF(conf, *p)) { + return p; + } + } + p++; + } + if (*p == q) { + p++; + } + return p; +} + + +static char *scan_dquote(CONF *conf, char *p) { + int q = *p; + + p++; + while (!(IS_EOF(conf, *p))) { + if (*p == q) { + if (*(p + 1) == q) { + p++; + } else { + break; + } + } + p++; + } + if (*p == q) { + p++; + } + return p; +} + +static void clear_comments(CONF *conf, char *p) { + for (;;) { + if (IS_FCOMMENT(conf, *p)) { + *p = '\0'; + return; + } + if (!IS_WS(conf, *p)) { + break; + } + p++; + } + + for (;;) { + if (IS_COMMENT(conf, *p)) { + *p = '\0'; + return; + } + if (IS_DQUOTE(conf, *p)) { + p = scan_dquote(conf, p); + continue; + } + if (IS_QUOTE(conf, *p)) { + p = scan_quote(conf, p); + continue; + } + if (IS_ESC(conf, *p)) { + p = scan_esc(conf, p); + continue; + } + if (IS_EOF(conf, *p)) { + return; + } else { + p++; + } + } +} + +static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { + static const size_t CONFBUFSIZE = 512; + int bufnum = 0, i, ii; + BUF_MEM *buff = NULL; + char *s, *p, *end; + int again; + long eline = 0; + char btmp[DECIMAL_SIZE(eline) + 1]; + CONF_VALUE *v = NULL, *tv; + CONF_VALUE *sv = NULL; + char *section = NULL, *buf; + char *start, *psection, *pname; + + if ((buff = BUF_MEM_new()) == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB); + goto err; + } + + section = OPENSSL_strdup("default"); + if (section == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + + sv = NCONF_new_section(conf, section); + if (sv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + + bufnum = 0; + again = 0; + for (;;) { + if (!BUF_MEM_grow(buff, bufnum + CONFBUFSIZE)) { + OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB); + goto err; + } + p = &(buff->data[bufnum]); + *p = '\0'; + BIO_gets(in, p, CONFBUFSIZE - 1); + p[CONFBUFSIZE - 1] = '\0'; + ii = i = strlen(p); + if (i == 0 && !again) { + break; + } + again = 0; + while (i > 0) { + if ((p[i - 1] != '\r') && (p[i - 1] != '\n')) { + break; + } else { + i--; + } + } + // we removed some trailing stuff so there is a new + // line on the end. + if (ii && i == ii) { + again = 1; // long line + } else { + p[i] = '\0'; + eline++; // another input line + } + + // we now have a line with trailing \r\n removed + + // i is the number of bytes + bufnum += i; + + v = NULL; + // check for line continuation + if (bufnum >= 1) { + // If we have bytes and the last char '\\' and + // second last char is not '\\' + p = &(buff->data[bufnum - 1]); + if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) { + bufnum--; + again = 1; + } + } + if (again) { + continue; + } + bufnum = 0; + buf = buff->data; + + clear_comments(conf, buf); + s = eat_ws(conf, buf); + if (IS_EOF(conf, *s)) { + continue; // blank line + } + if (*s == '[') { + char *ss; + + s++; + start = eat_ws(conf, s); + ss = start; + again: + end = eat_alpha_numeric(conf, ss); + p = eat_ws(conf, end); + if (*p != ']') { + if (*p != '\0' && ss != p) { + ss = p; + goto again; + } + OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET); + goto err; + } + *end = '\0'; + if (!str_copy(conf, NULL, §ion, start)) { + goto err; + } + if ((sv = get_section(conf, section)) == NULL) { + sv = NCONF_new_section(conf, section); + } + if (sv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + continue; + } else { + pname = s; + psection = NULL; + end = eat_alpha_numeric(conf, s); + if ((end[0] == ':') && (end[1] == ':')) { + *end = '\0'; + end += 2; + psection = pname; + pname = end; + end = eat_alpha_numeric(conf, end); + } + p = eat_ws(conf, end); + if (*p != '=') { + OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_EQUAL_SIGN); + goto err; + } + *end = '\0'; + p++; + start = eat_ws(conf, p); + while (!IS_EOF(conf, *p)) { + p++; + } + p--; + while ((p != start) && (IS_WS(conf, *p))) { + p--; + } + p++; + *p = '\0'; + + if (!(v = CONF_VALUE_new())) { + goto err; + } + if (psection == NULL) { + psection = section; + } + v->name = OPENSSL_strdup(pname); + if (v->name == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!str_copy(conf, psection, &(v->value), start)) { + goto err; + } + + if (strcmp(psection, section) != 0) { + if ((tv = get_section(conf, psection)) == NULL) { + tv = NCONF_new_section(conf, psection); + } + if (tv == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + goto err; + } + } else { + tv = sv; + } + if (add_string(conf, tv, v) == 0) { + OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE); + goto err; + } + v = NULL; + } + } + if (buff != NULL) { + BUF_MEM_free(buff); + } + if (section != NULL) { + OPENSSL_free(section); + } + return 1; + +err: + if (buff != NULL) { + BUF_MEM_free(buff); + } + if (section != NULL) { + OPENSSL_free(section); + } + if (out_error_line != NULL) { + *out_error_line = eline; + } + BIO_snprintf(btmp, sizeof btmp, "%ld", eline); + ERR_add_error_data(2, "line ", btmp); + + if (v != NULL) { + if (v->name != NULL) { + OPENSSL_free(v->name); + } + if (v->value != NULL) { + OPENSSL_free(v->value); + } + if (v != NULL) { + OPENSSL_free(v); + } + } + return 0; +} + +int NCONF_load(CONF *conf, const char *filename, long *out_error_line) { + BIO *in = BIO_new_file(filename, "rb"); + int ret; + + if (in == NULL) { + OPENSSL_PUT_ERROR(CONF, ERR_R_SYS_LIB); + return 0; + } + + ret = def_load_bio(conf, in, out_error_line); + BIO_free(in); + + return ret; +} + +int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line) { + return def_load_bio(conf, bio, out_error_line); +} + +int CONF_parse_list(const char *list, char sep, int remove_whitespace, + int (*list_cb)(const char *elem, int len, void *usr), + void *arg) { + int ret; + const char *lstart, *tmpend, *p; + + if (list == NULL) { + OPENSSL_PUT_ERROR(CONF, CONF_R_LIST_CANNOT_BE_NULL); + return 0; + } + + lstart = list; + for (;;) { + if (remove_whitespace) { + while (*lstart && isspace((unsigned char)*lstart)) { + lstart++; + } + } + p = strchr(lstart, sep); + if (p == lstart || !*lstart) { + ret = list_cb(NULL, 0, arg); + } else { + if (p) { + tmpend = p - 1; + } else { + tmpend = lstart + strlen(lstart) - 1; + } + if (remove_whitespace) { + while (isspace((unsigned char)*tmpend)) { + tmpend--; + } + } + ret = list_cb(lstart, tmpend - lstart + 1, arg); + } + if (ret <= 0) { + return ret; + } + if (p == NULL) { + return 1; + } + lstart = p + 1; + } +} + +int CONF_modules_load_file(const char *filename, const char *appname, + unsigned long flags) { + return 1; +} + +void CONF_modules_free(void) {} + +void OPENSSL_config(const char *config_name) {} + +void OPENSSL_no_config(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h new file mode 100644 index 0000000..b1e6ba6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h @@ -0,0 +1,127 @@ +/* crypto/conf/conf_def.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.] + */ + +/* THIS FILE WAS AUTOMAGICALLY GENERATED! + Please modify and use keysets.pl to regenerate it. */ + +#define CONF_NUMBER 1 +#define CONF_UPPER 2 +#define CONF_LOWER 4 +#define CONF_UNDER 256 +#define CONF_PUNCTUATION 512 +#define CONF_WS 16 +#define CONF_ESC 32 +#define CONF_QUOTE 64 +#define CONF_DQUOTE 1024 +#define CONF_COMMENT 128 +#define CONF_FCOMMENT 2048 +#define CONF_EOF 8 +#define CONF_HIGHBIT 4096 +#define CONF_ALPHA (CONF_UPPER|CONF_LOWER) +#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) +#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \ + CONF_PUNCTUATION) + +#define KEYTYPES(c) CONF_type_default +#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) +#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) +#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) +#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) +#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) +#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) +#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) +#define IS_ALPHA_NUMERIC_PUNCT(c,a) \ + (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT) +#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) +#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) +#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) + +static const unsigned short CONF_type_default[256]={ + 0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0010,0x0200,0x0040,0x0080,0x0000,0x0200,0x0200,0x0040, + 0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200, + 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001, + 0x0001,0x0001,0x0000,0x0200,0x0000,0x0000,0x0000,0x0200, + 0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0000,0x0020,0x0000,0x0200,0x0100, + 0x0040,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + }; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h.grpc_back new file mode 100644 index 0000000..b1e6ba6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h.grpc_back @@ -0,0 +1,127 @@ +/* crypto/conf/conf_def.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.] + */ + +/* THIS FILE WAS AUTOMAGICALLY GENERATED! + Please modify and use keysets.pl to regenerate it. */ + +#define CONF_NUMBER 1 +#define CONF_UPPER 2 +#define CONF_LOWER 4 +#define CONF_UNDER 256 +#define CONF_PUNCTUATION 512 +#define CONF_WS 16 +#define CONF_ESC 32 +#define CONF_QUOTE 64 +#define CONF_DQUOTE 1024 +#define CONF_COMMENT 128 +#define CONF_FCOMMENT 2048 +#define CONF_EOF 8 +#define CONF_HIGHBIT 4096 +#define CONF_ALPHA (CONF_UPPER|CONF_LOWER) +#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) +#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \ + CONF_PUNCTUATION) + +#define KEYTYPES(c) CONF_type_default +#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) +#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) +#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) +#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) +#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) +#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) +#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) +#define IS_ALPHA_NUMERIC_PUNCT(c,a) \ + (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT) +#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) +#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) +#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) + +static const unsigned short CONF_type_default[256]={ + 0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0010,0x0200,0x0040,0x0080,0x0000,0x0200,0x0200,0x0040, + 0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200, + 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001, + 0x0001,0x0001,0x0000,0x0200,0x0000,0x0000,0x0000,0x0200, + 0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, + 0x0002,0x0002,0x0002,0x0000,0x0020,0x0000,0x0200,0x0100, + 0x0040,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004, + 0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000, + }; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h new file mode 100644 index 0000000..3e0e57d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h @@ -0,0 +1,31 @@ +/* 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_CONF_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CONF_VALUE_new returns a freshly allocated and zeroed |CONF_VALUE|. +CONF_VALUE *CONF_VALUE_new(void); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h.grpc_back new file mode 100644 index 0000000..3e0e57d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h.grpc_back @@ -0,0 +1,31 @@ +/* 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_CONF_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CONF_VALUE_new returns a freshly allocated and zeroed |CONF_VALUE|. +CONF_VALUE *CONF_VALUE_new(void); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c new file mode 100644 index 0000000..26d2008 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c @@ -0,0 +1,55 @@ +/* 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 + +#if defined(OPENSSL_AARCH64) && defined(OPENSSL_FUCHSIA) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include +#include +#include + +#include + +#include "internal.h" + +extern uint32_t OPENSSL_armcap_P; + +void OPENSSL_cpuid_setup(void) { + uint32_t hwcap; + zx_status_t rc = zx_system_get_features(ZX_FEATURE_KIND_CPU, &hwcap); + if (rc != ZX_OK || (hwcap & ZX_ARM64_FEATURE_ISA_ASIMD) == 0) { + // Matching OpenSSL, if NEON/ASIMD is missing, don't report other features + // either. + return; + } + + OPENSSL_armcap_P |= ARMV7_NEON; + + if (hwcap & ZX_ARM64_FEATURE_ISA_AES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_PMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_SHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_SHA2) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } +} + +#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c.grpc_back new file mode 100644 index 0000000..98303a0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c.grpc_back @@ -0,0 +1,55 @@ +/* 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 + +#if defined(OPENSSL_AARCH64) && defined(OPENSSL_FUCHSIA) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include +#include +#include + +#include + +#include "internal.h" + +extern uint32_t OPENSSL_armcap_P; + +void OPENSSL_cpuid_setup(void) { + uint32_t hwcap; + zx_status_t rc = zx_system_get_features(ZX_FEATURE_KIND_CPU, &hwcap); + if (rc != ZX_OK || (hwcap & ZX_ARM64_FEATURE_ISA_ASIMD) == 0) { + // Matching OpenSSL, if NEON/ASIMD is missing, don't report other features + // either. + return; + } + + OPENSSL_armcap_P |= ARMV7_NEON; + + if (hwcap & ZX_ARM64_FEATURE_ISA_AES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_PMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_SHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap & ZX_ARM64_FEATURE_ISA_SHA2) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } +} + +#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c new file mode 100644 index 0000000..d6aa0db --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c @@ -0,0 +1,62 @@ +/* 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_AARCH64) && defined(OPENSSL_LINUX) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include + +#include + +#include "internal.h" + + +extern uint32_t OPENSSL_armcap_P; + +void OPENSSL_cpuid_setup(void) { + unsigned long hwcap = getauxval(AT_HWCAP); + + // See /usr/include/asm/hwcap.h on an aarch64 installation for the source of + // these values. + static const unsigned long kNEON = 1 << 1; + static const unsigned long kAES = 1 << 3; + static const unsigned long kPMULL = 1 << 4; + static const unsigned long kSHA1 = 1 << 5; + static const unsigned long kSHA256 = 1 << 6; + + if ((hwcap & kNEON) == 0) { + // Matching OpenSSL, if NEON is missing, don't report other features + // either. + return; + } + + OPENSSL_armcap_P |= ARMV7_NEON; + + if (hwcap & kAES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap & kPMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap & kSHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap & kSHA256) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } +} + +#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c.grpc_back new file mode 100644 index 0000000..0184dd4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c.grpc_back @@ -0,0 +1,62 @@ +/* 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_AARCH64) && defined(OPENSSL_LINUX) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include + +#include + +#include "internal.h" + + +extern uint32_t OPENSSL_armcap_P; + +void OPENSSL_cpuid_setup(void) { + unsigned long hwcap = getauxval(AT_HWCAP); + + // See /usr/include/asm/hwcap.h on an aarch64 installation for the source of + // these values. + static const unsigned long kNEON = 1 << 1; + static const unsigned long kAES = 1 << 3; + static const unsigned long kPMULL = 1 << 4; + static const unsigned long kSHA1 = 1 << 5; + static const unsigned long kSHA256 = 1 << 6; + + if ((hwcap & kNEON) == 0) { + // Matching OpenSSL, if NEON is missing, don't report other features + // either. + return; + } + + OPENSSL_armcap_P |= ARMV7_NEON; + + if (hwcap & kAES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap & kPMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap & kSHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap & kSHA256) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } +} + +#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c new file mode 100644 index 0000000..1cde16f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c.grpc_back new file mode 100644 index 0000000..ed30715 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h new file mode 100644 index 0000000..0fd8c69 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h.grpc_back new file mode 100644 index 0000000..e326285 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c new file mode 100644 index 0000000..256f757 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c @@ -0,0 +1,38 @@ +/* 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 + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include + + +extern uint32_t OPENSSL_armcap_P; + +char CRYPTO_is_NEON_capable_at_runtime(void) { + return (OPENSSL_armcap_P & ARMV7_NEON) != 0; +} + +int CRYPTO_is_ARMv8_AES_capable(void) { + return (OPENSSL_armcap_P & ARMV8_AES) != 0; +} + +int CRYPTO_is_ARMv8_PMULL_capable(void) { + return (OPENSSL_armcap_P & ARMV8_PMULL) != 0; +} + +#endif /* (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && + !defined(OPENSSL_STATIC_ARMCAP) */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c.grpc_back new file mode 100644 index 0000000..ef395ea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c.grpc_back @@ -0,0 +1,38 @@ +/* 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 + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + !defined(OPENSSL_STATIC_ARMCAP) + +#include + + +extern uint32_t OPENSSL_armcap_P; + +char CRYPTO_is_NEON_capable_at_runtime(void) { + return (OPENSSL_armcap_P & ARMV7_NEON) != 0; +} + +int CRYPTO_is_ARMv8_AES_capable(void) { + return (OPENSSL_armcap_P & ARMV8_AES) != 0; +} + +int CRYPTO_is_ARMv8_PMULL_capable(void) { + return (OPENSSL_armcap_P & ARMV8_PMULL) != 0; +} + +#endif /* (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && + !defined(OPENSSL_STATIC_ARMCAP) */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c new file mode 100644 index 0000000..6de8f19 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c @@ -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.] */ + +#include + + +#if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) + +#include +#include +#include +#include + +#if defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" + + +// OPENSSL_cpuid runs the cpuid instruction. |leaf| is passed in as EAX and ECX +// is set to zero. It writes EAX, EBX, ECX, and EDX to |*out_eax| through +// |*out_edx|. +static void OPENSSL_cpuid(uint32_t *out_eax, uint32_t *out_ebx, + uint32_t *out_ecx, uint32_t *out_edx, uint32_t leaf) { +#if defined(_MSC_VER) + int tmp[4]; + __cpuid(tmp, (int)leaf); + *out_eax = (uint32_t)tmp[0]; + *out_ebx = (uint32_t)tmp[1]; + *out_ecx = (uint32_t)tmp[2]; + *out_edx = (uint32_t)tmp[3]; +#elif defined(__pic__) && defined(OPENSSL_32_BIT) + // Inline assembly may not clobber the PIC register. For 32-bit, this is EBX. + // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602. + __asm__ volatile ( + "xor %%ecx, %%ecx\n" + "mov %%ebx, %%edi\n" + "cpuid\n" + "xchg %%edi, %%ebx\n" + : "=a"(*out_eax), "=D"(*out_ebx), "=c"(*out_ecx), "=d"(*out_edx) + : "a"(leaf) + ); +#else + __asm__ volatile ( + "xor %%ecx, %%ecx\n" + "cpuid\n" + : "=a"(*out_eax), "=b"(*out_ebx), "=c"(*out_ecx), "=d"(*out_edx) + : "a"(leaf) + ); +#endif +} + +// OPENSSL_xgetbv returns the value of an Intel Extended Control Register (XCR). +// Currently only XCR0 is defined by Intel so |xcr| should always be zero. +static uint64_t OPENSSL_xgetbv(uint32_t xcr) { +#if defined(_MSC_VER) + return (uint64_t)_xgetbv(xcr); +#else + uint32_t eax, edx; + __asm__ volatile ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr)); + return (((uint64_t)edx) << 32) | eax; +#endif +} + +// handle_cpu_env applies the value from |in| to the CPUID values in |out[0]| +// 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_result) { + return; + } + + if (invert) { + out[0] &= ~v; + out[1] &= ~(v >> 32); + } else { + out[0] = v; + out[1] = v >> 32; + } +} + +void OPENSSL_cpuid_setup(void) { + // Determine the vendor and maximum input value. + uint32_t eax, ebx, ecx, edx; + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0); + + uint32_t num_ids = eax; + + int is_intel = ebx == 0x756e6547 /* Genu */ && + edx == 0x49656e69 /* ineI */ && + ecx == 0x6c65746e /* ntel */; + int is_amd = ebx == 0x68747541 /* Auth */ && + edx == 0x69746e65 /* enti */ && + ecx == 0x444d4163 /* cAMD */; + + uint32_t extended_features[2] = {0}; + if (num_ids >= 7) { + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 7); + extended_features[0] = ebx; + extended_features[1] = ecx; + } + + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 1); + + 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); + + // Reserved bit #30 is repurposed to signal an Intel CPU. + if (is_intel) { + edx |= (1u << 30); + + // Clear the XSAVE bit on Knights Landing to mimic Silvermont. This enables + // some Silvermont-specific codepaths which perform better. See OpenSSL + // commit 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. + if ((eax & 0x0fff0ff0) == 0x00050670 /* Knights Landing */ || + (eax & 0x0fff0ff0) == 0x00080650 /* Knights Mill (per SDE) */) { + ecx &= ~(1u << 26); + } + } else { + edx &= ~(1u << 30); + } + + // 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)) { + // XCR0 may only be queried if the OSXSAVE bit is set. + xcr0 = OPENSSL_xgetbv(0); + } + // See Intel manual, volume 1, section 14.3. + if ((xcr0 & 6) != 6) { + // YMM registers cannot be used. + ecx &= ~(1u << 28); // AVX + ecx &= ~(1u << 12); // FMA + ecx &= ~(1u << 11); // AMD XOP + // Clear AVX2 and AVX512* bits. + // + // TODO(davidben): Should bits 17 and 26-28 also be cleared? Upstream + // doesn't clear those. + 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[0] &= ~(1u << 16); + } + + // Disable ADX instructions on Knights Landing. See OpenSSL commit + // 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. + if ((ecx & (1u << 26)) == 0) { + extended_features[0] &= ~(1u << 19); + } + + OPENSSL_ia32cap_P[0] = edx; + OPENSSL_ia32cap_P[1] = ecx; + OPENSSL_ia32cap_P[2] = extended_features[0]; + OPENSSL_ia32cap_P[3] = extended_features[1]; + + const char *env1, *env2; + env1 = getenv("OPENSSL_ia32cap"); + if (env1 == NULL) { + return; + } + + // OPENSSL_ia32cap can contain zero, one or two values, separated with a ':'. + // Each value is a 64-bit, unsigned value which may start with "0x" to + // indicate a hex value. Prior to the 64-bit value, a '~' may be given. + // + // If '~' isn't present, then the value is taken as the result of the CPUID. + // Otherwise the value is inverted and ANDed with the probed CPUID result. + // + // The first value determines OPENSSL_ia32cap_P[0] and [1]. The second [2] + // and [3]. + + handle_cpu_env(&OPENSSL_ia32cap_P[0], env1); + env2 = strchr(env1, ':'); + if (env2 != NULL) { + handle_cpu_env(&OPENSSL_ia32cap_P[2], env2 + 1); + } +} + +#endif // !OPENSSL_NO_ASM && (OPENSSL_X86 || OPENSSL_X86_64) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.grpc_back new file mode 100644 index 0000000..cc41fc4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.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.] */ + +#include + + +#if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) + +#include +#include +#include +#include + +#if defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" + + +// OPENSSL_cpuid runs the cpuid instruction. |leaf| is passed in as EAX and ECX +// is set to zero. It writes EAX, EBX, ECX, and EDX to |*out_eax| through +// |*out_edx|. +static void OPENSSL_cpuid(uint32_t *out_eax, uint32_t *out_ebx, + uint32_t *out_ecx, uint32_t *out_edx, uint32_t leaf) { +#if defined(_MSC_VER) + int tmp[4]; + __cpuid(tmp, (int)leaf); + *out_eax = (uint32_t)tmp[0]; + *out_ebx = (uint32_t)tmp[1]; + *out_ecx = (uint32_t)tmp[2]; + *out_edx = (uint32_t)tmp[3]; +#elif defined(__pic__) && defined(OPENSSL_32_BIT) + // Inline assembly may not clobber the PIC register. For 32-bit, this is EBX. + // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602. + __asm__ volatile ( + "xor %%ecx, %%ecx\n" + "mov %%ebx, %%edi\n" + "cpuid\n" + "xchg %%edi, %%ebx\n" + : "=a"(*out_eax), "=D"(*out_ebx), "=c"(*out_ecx), "=d"(*out_edx) + : "a"(leaf) + ); +#else + __asm__ volatile ( + "xor %%ecx, %%ecx\n" + "cpuid\n" + : "=a"(*out_eax), "=b"(*out_ebx), "=c"(*out_ecx), "=d"(*out_edx) + : "a"(leaf) + ); +#endif +} + +// OPENSSL_xgetbv returns the value of an Intel Extended Control Register (XCR). +// Currently only XCR0 is defined by Intel so |xcr| should always be zero. +static uint64_t OPENSSL_xgetbv(uint32_t xcr) { +#if defined(_MSC_VER) + return (uint64_t)_xgetbv(xcr); +#else + uint32_t eax, edx; + __asm__ volatile ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr)); + return (((uint64_t)edx) << 32) | eax; +#endif +} + +// handle_cpu_env applies the value from |in| to the CPUID values in |out[0]| +// 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_result) { + return; + } + + if (invert) { + out[0] &= ~v; + out[1] &= ~(v >> 32); + } else { + out[0] = v; + out[1] = v >> 32; + } +} + +void OPENSSL_cpuid_setup(void) { + // Determine the vendor and maximum input value. + uint32_t eax, ebx, ecx, edx; + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0); + + uint32_t num_ids = eax; + + int is_intel = ebx == 0x756e6547 /* Genu */ && + edx == 0x49656e69 /* ineI */ && + ecx == 0x6c65746e /* ntel */; + int is_amd = ebx == 0x68747541 /* Auth */ && + edx == 0x69746e65 /* enti */ && + ecx == 0x444d4163 /* cAMD */; + + uint32_t extended_features[2] = {0}; + if (num_ids >= 7) { + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 7); + extended_features[0] = ebx; + extended_features[1] = ecx; + } + + OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 1); + + 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); + + // Reserved bit #30 is repurposed to signal an Intel CPU. + if (is_intel) { + edx |= (1u << 30); + + // Clear the XSAVE bit on Knights Landing to mimic Silvermont. This enables + // some Silvermont-specific codepaths which perform better. See OpenSSL + // commit 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. + if ((eax & 0x0fff0ff0) == 0x00050670 /* Knights Landing */ || + (eax & 0x0fff0ff0) == 0x00080650 /* Knights Mill (per SDE) */) { + ecx &= ~(1u << 26); + } + } else { + edx &= ~(1u << 30); + } + + // 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)) { + // XCR0 may only be queried if the OSXSAVE bit is set. + xcr0 = OPENSSL_xgetbv(0); + } + // See Intel manual, volume 1, section 14.3. + if ((xcr0 & 6) != 6) { + // YMM registers cannot be used. + ecx &= ~(1u << 28); // AVX + ecx &= ~(1u << 12); // FMA + ecx &= ~(1u << 11); // AMD XOP + // Clear AVX2 and AVX512* bits. + // + // TODO(davidben): Should bits 17 and 26-28 also be cleared? Upstream + // doesn't clear those. + 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[0] &= ~(1u << 16); + } + + // Disable ADX instructions on Knights Landing. See OpenSSL commit + // 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. + if ((ecx & (1u << 26)) == 0) { + extended_features[0] &= ~(1u << 19); + } + + OPENSSL_ia32cap_P[0] = edx; + OPENSSL_ia32cap_P[1] = ecx; + OPENSSL_ia32cap_P[2] = extended_features[0]; + OPENSSL_ia32cap_P[3] = extended_features[1]; + + const char *env1, *env2; + env1 = getenv("OPENSSL_ia32cap"); + if (env1 == NULL) { + return; + } + + // OPENSSL_ia32cap can contain zero, one or two values, separated with a ':'. + // Each value is a 64-bit, unsigned value which may start with "0x" to + // indicate a hex value. Prior to the 64-bit value, a '~' may be given. + // + // If '~' isn't present, then the value is taken as the result of the CPUID. + // Otherwise the value is inverted and ANDed with the probed CPUID result. + // + // The first value determines OPENSSL_ia32cap_P[0] and [1]. The second [2] + // and [3]. + + handle_cpu_env(&OPENSSL_ia32cap_P[0], env1); + env2 = strchr(env1, ':'); + if (env2 != NULL) { + handle_cpu_env(&OPENSSL_ia32cap_P[2], env2 + 1); + } +} + +#endif // !OPENSSL_NO_ASM && (OPENSSL_X86 || OPENSSL_X86_64) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c new file mode 100644 index 0000000..eee8ff8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c @@ -0,0 +1,38 @@ +/* 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_PPC64LE) + +#include + +#include "internal.h" + + +#if !defined(PPC_FEATURE2_HAS_VCRYPTO) +// PPC_FEATURE2_HAS_VCRYPTO was taken from section 4.1.2.3 of the β€œOpenPOWER +// ABI for Linux Supplement”. +#define PPC_FEATURE2_HAS_VCRYPTO 0x02000000 +#endif + +void OPENSSL_cpuid_setup(void) { + OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2); +} + +int CRYPTO_is_PPC64LE_vcrypto_capable(void) { + return (OPENSSL_ppc64le_hwcap2 & PPC_FEATURE2_HAS_VCRYPTO) != 0; +} + +#endif // OPENSSL_PPC64LE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c.grpc_back new file mode 100644 index 0000000..6cc8aee --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c.grpc_back @@ -0,0 +1,38 @@ +/* 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_PPC64LE) + +#include + +#include "internal.h" + + +#if !defined(PPC_FEATURE2_HAS_VCRYPTO) +// PPC_FEATURE2_HAS_VCRYPTO was taken from section 4.1.2.3 of the β€œOpenPOWER +// ABI for Linux Supplement”. +#define PPC_FEATURE2_HAS_VCRYPTO 0x02000000 +#endif + +void OPENSSL_cpuid_setup(void) { + OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2); +} + +int CRYPTO_is_PPC64LE_vcrypto_capable(void) { + return (OPENSSL_ppc64le_hwcap2 & PPC_FEATURE2_HAS_VCRYPTO) != 0; +} + +#endif // OPENSSL_PPC64LE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c new file mode 100644 index 0000000..f289881 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c @@ -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. */ + +#include + +#include + +#include "internal.h" + + +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_STATIC_ARMCAP) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) || \ + defined(OPENSSL_PPC64LE)) +// x86, x86_64, the ARMs and ppc64le need to record the result of a +// cpuid/getauxval call for the asm to work correctly, unless compiled without +// asm code. +#define NEED_CPUID + +#else + +// Otherwise, don't emit a static initialiser. + +#if !defined(BORINGSSL_NO_STATIC_INITIALIZER) +#define BORINGSSL_NO_STATIC_INITIALIZER +#endif + +#endif // !NO_ASM && !STATIC_ARMCAP && + // (X86 || X86_64 || ARM || AARCH64 || PPC64LE) + + +// Our assembly does not use the GOT to reference symbols, which means +// references to visible symbols will often require a TEXTREL. This is +// undesirable, so all assembly-referenced symbols should be hidden. CPU +// capabilities are the only such symbols defined in C. Explicitly hide them, +// rather than rely on being built with -fvisibility=hidden. +#if defined(OPENSSL_WINDOWS) +#define HIDDEN +#else +#define HIDDEN __attribute__((visibility("hidden"))) +#endif + + +// The capability variables are defined in this file in order to work around a +// linker bug. When linking with a .a, if no symbols in a .o are referenced +// then the .o is discarded, even if it has constructor functions. +// +// This still means that any binaries that don't include some functionality +// that tests the capability values will still skip the constructor but, so +// far, the init constructor function only sets the capability variables. + +#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. +// +// If not initialised then it becomes a "common symbol". When put into an +// 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) + +HIDDEN unsigned long OPENSSL_ppc64le_hwcap2 = 0; + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + +#include + +#if defined(OPENSSL_STATIC_ARMCAP) + +HIDDEN uint32_t OPENSSL_armcap_P = +#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) + ARMV8_AES | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_SHA1) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_SHA1 | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_SHA256) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_SHA256 | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_PMULL | +#endif + 0; + +#else +HIDDEN uint32_t OPENSSL_armcap_P = 0; + +uint32_t *OPENSSL_get_armcap_pointer_for_test(void) { + return &OPENSSL_armcap_P; +} +#endif + +#endif + +#if defined(BORINGSSL_FIPS) +// In FIPS mode, the power-on self-test function calls |CRYPTO_library_init| +// because we have to ensure that CPUID detection occurs first. +#define BORINGSSL_NO_STATIC_INITIALIZER +#endif + +#if defined(OPENSSL_WINDOWS) && !defined(BORINGSSL_NO_STATIC_INITIALIZER) +#define OPENSSL_CDECL __cdecl +#else +#define OPENSSL_CDECL +#endif + +#if defined(BORINGSSL_NO_STATIC_INITIALIZER) +static CRYPTO_once_t once = CRYPTO_ONCE_INIT; +#elif defined(_MSC_VER) +#pragma section(".CRT$XCU", read) +static void __cdecl do_library_init(void); +__declspec(allocate(".CRT$XCU")) void(*library_init_constructor)(void) = + do_library_init; +#else +static void do_library_init(void) __attribute__ ((constructor)); +#endif + +// do_library_init is the actual initialization function. If +// BORINGSSL_NO_STATIC_INITIALIZER isn't defined, this is set as a static +// initializer. Otherwise, it is called by CRYPTO_library_init. +static void OPENSSL_CDECL do_library_init(void) { + // WARNING: this function may only configure the capability variables. See the + // note above about the linker bug. +#if defined(NEED_CPUID) + OPENSSL_cpuid_setup(); +#endif +} + +void CRYPTO_library_init(void) { + // TODO(davidben): It would be tidier if this build knob could be replaced + // with an internal lazy-init mechanism that would handle things correctly + // in-library. https://crbug.com/542879 +#if defined(BORINGSSL_NO_STATIC_INITIALIZER) + CRYPTO_once(&once, do_library_init); +#endif +} + +int CRYPTO_is_confidential_build(void) { +#if defined(BORINGSSL_CONFIDENTIAL) + return 1; +#else + return 0; +#endif +} + +int CRYPTO_has_asm(void) { +#if defined(OPENSSL_NO_ASM) + return 0; +#else + return 1; +#endif +} + +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"; + } +} + +unsigned long SSLeay(void) { return OPENSSL_VERSION_NUMBER; } + +unsigned long OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } + +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; } + +void OPENSSL_load_builtin_modules(void) {} + +int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { + CRYPTO_library_init(); + return 1; +} + +void OPENSSL_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c.grpc_back new file mode 100644 index 0000000..297240e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/crypto.c.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. */ + +#include + +#include + +#include "internal.h" + + +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_STATIC_ARMCAP) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) || \ + defined(OPENSSL_PPC64LE)) +// x86, x86_64, the ARMs and ppc64le need to record the result of a +// cpuid/getauxval call for the asm to work correctly, unless compiled without +// asm code. +#define NEED_CPUID + +#else + +// Otherwise, don't emit a static initialiser. + +#if !defined(BORINGSSL_NO_STATIC_INITIALIZER) +#define BORINGSSL_NO_STATIC_INITIALIZER +#endif + +#endif // !NO_ASM && !STATIC_ARMCAP && + // (X86 || X86_64 || ARM || AARCH64 || PPC64LE) + + +// Our assembly does not use the GOT to reference symbols, which means +// references to visible symbols will often require a TEXTREL. This is +// undesirable, so all assembly-referenced symbols should be hidden. CPU +// capabilities are the only such symbols defined in C. Explicitly hide them, +// rather than rely on being built with -fvisibility=hidden. +#if defined(OPENSSL_WINDOWS) +#define HIDDEN +#else +#define HIDDEN __attribute__((visibility("hidden"))) +#endif + + +// The capability variables are defined in this file in order to work around a +// linker bug. When linking with a .a, if no symbols in a .o are referenced +// then the .o is discarded, even if it has constructor functions. +// +// This still means that any binaries that don't include some functionality +// that tests the capability values will still skip the constructor but, so +// far, the init constructor function only sets the capability variables. + +#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. +// +// If not initialised then it becomes a "common symbol". When put into an +// 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) + +HIDDEN unsigned long OPENSSL_ppc64le_hwcap2 = 0; + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + +#include + +#if defined(OPENSSL_STATIC_ARMCAP) + +HIDDEN uint32_t OPENSSL_armcap_P = +#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) + ARMV8_AES | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_SHA1) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_SHA1 | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_SHA256) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_SHA256 | +#endif +#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) + ARMV8_PMULL | +#endif + 0; + +#else +HIDDEN uint32_t OPENSSL_armcap_P = 0; + +uint32_t *OPENSSL_get_armcap_pointer_for_test(void) { + return &OPENSSL_armcap_P; +} +#endif + +#endif + +#if defined(BORINGSSL_FIPS) +// In FIPS mode, the power-on self-test function calls |CRYPTO_library_init| +// because we have to ensure that CPUID detection occurs first. +#define BORINGSSL_NO_STATIC_INITIALIZER +#endif + +#if defined(OPENSSL_WINDOWS) && !defined(BORINGSSL_NO_STATIC_INITIALIZER) +#define OPENSSL_CDECL __cdecl +#else +#define OPENSSL_CDECL +#endif + +#if defined(BORINGSSL_NO_STATIC_INITIALIZER) +static CRYPTO_once_t once = CRYPTO_ONCE_INIT; +#elif defined(_MSC_VER) +#pragma section(".CRT$XCU", read) +static void __cdecl do_library_init(void); +__declspec(allocate(".CRT$XCU")) void(*library_init_constructor)(void) = + do_library_init; +#else +static void do_library_init(void) __attribute__ ((constructor)); +#endif + +// do_library_init is the actual initialization function. If +// BORINGSSL_NO_STATIC_INITIALIZER isn't defined, this is set as a static +// initializer. Otherwise, it is called by CRYPTO_library_init. +static void OPENSSL_CDECL do_library_init(void) { + // WARNING: this function may only configure the capability variables. See the + // note above about the linker bug. +#if defined(NEED_CPUID) + OPENSSL_cpuid_setup(); +#endif +} + +void CRYPTO_library_init(void) { + // TODO(davidben): It would be tidier if this build knob could be replaced + // with an internal lazy-init mechanism that would handle things correctly + // in-library. https://crbug.com/542879 +#if defined(BORINGSSL_NO_STATIC_INITIALIZER) + CRYPTO_once(&once, do_library_init); +#endif +} + +int CRYPTO_is_confidential_build(void) { +#if defined(BORINGSSL_CONFIDENTIAL) + return 1; +#else + return 0; +#endif +} + +int CRYPTO_has_asm(void) { +#if defined(OPENSSL_NO_ASM) + return 0; +#else + return 1; +#endif +} + +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"; + } +} + +unsigned long SSLeay(void) { return OPENSSL_VERSION_NUMBER; } + +unsigned long OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } + +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; } + +void OPENSSL_load_builtin_modules(void) {} + +int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { + CRYPTO_library_init(); + return 1; +} + +void OPENSSL_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c new file mode 100644 index 0000000..dc71519 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c @@ -0,0 +1,539 @@ +/* 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 "../internal.h" +#include "../../third_party/fiat/internal.h" + + +// The following precomputation tables are for the following +// points used in the SPAKE2 protocol. +// +// N: +// x: 49918732221787544735331783592030787422991506689877079631459872391322455579424 +// y: 54629554431565467720832445949441049581317094546788069926228343916274969994000 +// encoded: 10e3df0ae37d8e7a99b5fe74b44672103dbddcbd06af680d71329a11693bc778 +// +// M: +// x: 31406539342727633121250288103050113562375374900226415211311216773867585644232 +// y: 21177308356423958466833845032658859666296341766942662650232962324899758529114 +// encoded: 5ada7e4bf6ddd9adb6626d32131c6b5c51a1e347a3478f53cfcf441b88eed12e +// +// These points and their precomputation tables are generated with the +// following Python code. For a description of the precomputation table, +// see curve25519.c in this directory. +// +// Exact copies of the source code are kept in bug 27296743. + +/* +import hashlib +import ed25519 as E # http://ed25519.cr.yp.to/python/ed25519.py + +SEED_N = 'edwards25519 point generation seed (N)' +SEED_M = 'edwards25519 point generation seed (M)' + +def genpoint(seed): + v = hashlib.sha256(seed).digest() + it = 1 + while True: + try: + x,y = E.decodepoint(v) + except Exception, e: + print e + it += 1 + v = hashlib.sha256(v).digest() + continue + print "Found in %d iterations:" % it + print " x = %d" % x + print " y = %d" % y + print " Encoded (hex)" + print E.encodepoint((x,y)).encode('hex') + return (x,y) + +def gentable(P): + t = [] + for i in range(1,16): + k = ((i >> 3 & 1) * (1 << 192) + + (i >> 2 & 1) * (1 << 128) + + (i >> 1 & 1) * (1 << 64) + + (i & 1)) + t.append(E.scalarmult(P, k)) + return ''.join(E.encodeint(x) + E.encodeint(y) for (x,y) in t) + +def printtable(table, name): + print "static const uint8_t %s[15 * 2 * 32] = {" % name, + for i in range(15 * 2 * 32): + if i % 12 == 0: + print "\n ", + print " 0x%02x," % ord(table[i]), + print "\n};" + +if __name__ == "__main__": + print "Searching for N" + N = genpoint(SEED_N) + print "Generating precomputation table for N" + Ntable = gentable(N) + printtable(Ntable, "kSpakeNSmallPrecomp") + + print "Searching for M" + M = genpoint(SEED_M) + print "Generating precomputation table for M" + Mtable = gentable(M) + printtable(Mtable, "kSpakeMSmallPrecomp") +*/ + +static const uint8_t kSpakeNSmallPrecomp[15 * 2 * 32] = { + 0x20, 0x1b, 0xc5, 0xb3, 0x43, 0x17, 0x71, 0x10, 0x44, 0x1e, 0x73, 0xb3, + 0xae, 0x3f, 0xbf, 0x9f, 0xf5, 0x44, 0xc8, 0x13, 0x8f, 0xd1, 0x01, 0xc2, + 0x8a, 0x1a, 0x6d, 0xea, 0x4d, 0x00, 0x5d, 0x6e, 0x10, 0xe3, 0xdf, 0x0a, + 0xe3, 0x7d, 0x8e, 0x7a, 0x99, 0xb5, 0xfe, 0x74, 0xb4, 0x46, 0x72, 0x10, + 0x3d, 0xbd, 0xdc, 0xbd, 0x06, 0xaf, 0x68, 0x0d, 0x71, 0x32, 0x9a, 0x11, + 0x69, 0x3b, 0xc7, 0x78, 0x93, 0xf1, 0x57, 0x97, 0x6e, 0xf0, 0x6e, 0x45, + 0x37, 0x4a, 0xf4, 0x0b, 0x18, 0x51, 0xf5, 0x4f, 0x67, 0x3c, 0xdc, 0xec, + 0x84, 0xed, 0xd0, 0xeb, 0xca, 0xfb, 0xdb, 0xff, 0x7f, 0xeb, 0xa8, 0x23, + 0x68, 0x87, 0x13, 0x64, 0x6a, 0x10, 0xf7, 0x45, 0xe0, 0x0f, 0x32, 0x21, + 0x59, 0x7c, 0x0e, 0x50, 0xad, 0x56, 0xd7, 0x12, 0x69, 0x7b, 0x58, 0xf8, + 0xb9, 0x3b, 0xa5, 0xbb, 0x4d, 0x1b, 0x87, 0x1c, 0x46, 0xa7, 0x17, 0x9d, + 0x6d, 0x84, 0x45, 0xbe, 0x7f, 0x95, 0xd2, 0x34, 0xcd, 0x89, 0x95, 0xc0, + 0xf0, 0xd3, 0xdf, 0x6e, 0x10, 0x4a, 0xe3, 0x7b, 0xce, 0x7f, 0x40, 0x27, + 0xc7, 0x2b, 0xab, 0x66, 0x03, 0x59, 0xb4, 0x7b, 0xc7, 0xc7, 0xf0, 0x39, + 0x9a, 0x33, 0x35, 0xbf, 0xcc, 0x2f, 0xf3, 0x2e, 0x68, 0x9d, 0x53, 0x5c, + 0x88, 0x52, 0xe3, 0x77, 0x90, 0xa1, 0x27, 0x85, 0xc5, 0x74, 0x7f, 0x23, + 0x0e, 0x93, 0x01, 0x3e, 0xe7, 0x2e, 0x2e, 0x95, 0xf3, 0x0d, 0xc2, 0x25, + 0x25, 0x39, 0x39, 0x3d, 0x6e, 0x8e, 0x89, 0xbd, 0xe8, 0xbb, 0x67, 0x5e, + 0x8c, 0x66, 0x8b, 0x63, 0x28, 0x1e, 0x4e, 0x74, 0x85, 0xa8, 0xaf, 0x0f, + 0x12, 0x5d, 0xb6, 0x8a, 0x83, 0x1a, 0x77, 0x76, 0x5e, 0x62, 0x8a, 0xa7, + 0x3c, 0xb8, 0x05, 0x57, 0x2b, 0xaf, 0x36, 0x2e, 0x10, 0x90, 0xb2, 0x39, + 0xb4, 0x3e, 0x75, 0x6d, 0x3a, 0xa8, 0x31, 0x35, 0xc2, 0x1e, 0x8f, 0xc2, + 0x79, 0x89, 0x35, 0x16, 0x26, 0xd1, 0xc7, 0x0b, 0x04, 0x1f, 0x1d, 0xf9, + 0x9c, 0x05, 0xa6, 0x6b, 0xb5, 0x19, 0x5a, 0x24, 0x6d, 0x91, 0xc5, 0x31, + 0xfd, 0xc5, 0xfa, 0xe7, 0xa6, 0xcb, 0x0e, 0x4b, 0x18, 0x0d, 0x94, 0xc7, + 0xee, 0x1d, 0x46, 0x1f, 0x92, 0xb1, 0xb2, 0x4a, 0x2b, 0x43, 0x37, 0xfe, + 0xc2, 0x15, 0x11, 0x89, 0xef, 0x59, 0x73, 0x3c, 0x06, 0x76, 0x78, 0xcb, + 0xa6, 0x0d, 0x79, 0x5f, 0x28, 0x0b, 0x5b, 0x8c, 0x9e, 0xe4, 0xaa, 0x51, + 0x9a, 0x42, 0x6f, 0x11, 0x50, 0x3d, 0x01, 0xd6, 0x21, 0xc0, 0x99, 0x5e, + 0x1a, 0xe8, 0x81, 0x25, 0x80, 0xeb, 0xed, 0x5d, 0x37, 0x47, 0x30, 0x70, + 0xa0, 0x4e, 0x0b, 0x43, 0x17, 0xbe, 0xb6, 0x47, 0xe7, 0x2a, 0x62, 0x9d, + 0x5d, 0xa6, 0xc5, 0x33, 0x62, 0x9d, 0x56, 0x24, 0x9d, 0x1d, 0xb2, 0x13, + 0xbc, 0x17, 0x66, 0x43, 0xd1, 0x68, 0xd5, 0x3b, 0x17, 0x69, 0x17, 0xa6, + 0x06, 0x9e, 0x12, 0xb8, 0x7c, 0xd5, 0xaf, 0x3e, 0x21, 0x1b, 0x31, 0xeb, + 0x0b, 0xa4, 0x98, 0x1c, 0xf2, 0x6a, 0x5e, 0x7c, 0x9b, 0x45, 0x8f, 0xb2, + 0x12, 0x06, 0xd5, 0x8c, 0x1d, 0xb2, 0xa7, 0x57, 0x5f, 0x2f, 0x4f, 0xdb, + 0x52, 0x99, 0x7c, 0x58, 0x01, 0x5f, 0xf2, 0xa5, 0xf6, 0x51, 0x86, 0x21, + 0x2f, 0x5b, 0x8d, 0x6a, 0xae, 0x83, 0x34, 0x6d, 0x58, 0x4b, 0xef, 0xfe, + 0xbf, 0x73, 0x5d, 0xdb, 0xc4, 0x97, 0x2a, 0x85, 0xf3, 0x6c, 0x46, 0x42, + 0xb3, 0x90, 0xc1, 0x57, 0x97, 0x50, 0x35, 0xb1, 0x9d, 0xb7, 0xc7, 0x3c, + 0x85, 0x6d, 0x6c, 0xfd, 0xce, 0xb0, 0xc9, 0xa2, 0x77, 0xee, 0xc3, 0x6b, + 0x0c, 0x37, 0xfa, 0x30, 0x91, 0xd1, 0x2c, 0xb8, 0x5e, 0x7f, 0x81, 0x5f, + 0x87, 0xfd, 0x18, 0x02, 0x5a, 0x30, 0x4e, 0x62, 0xbc, 0x65, 0xc6, 0xce, + 0x1a, 0xcf, 0x2b, 0xaa, 0x56, 0x3e, 0x4d, 0xcf, 0xba, 0x62, 0x5f, 0x9a, + 0xd0, 0x72, 0xff, 0xef, 0x28, 0xbd, 0xbe, 0xd8, 0x57, 0x3d, 0xf5, 0x57, + 0x7d, 0xe9, 0x71, 0x31, 0xec, 0x98, 0x90, 0x94, 0xd9, 0x54, 0xbf, 0x84, + 0x0b, 0xe3, 0x06, 0x47, 0x19, 0x9a, 0x13, 0x1d, 0xef, 0x9d, 0x13, 0xf3, + 0xdb, 0xc3, 0x5c, 0x72, 0x9e, 0xed, 0x24, 0xaa, 0x64, 0xed, 0xe7, 0x0d, + 0xa0, 0x7c, 0x73, 0xba, 0x9b, 0x86, 0xa7, 0x3b, 0x55, 0xab, 0x58, 0x30, + 0xf1, 0x15, 0x81, 0x83, 0x2f, 0xf9, 0x62, 0x84, 0x98, 0x66, 0xf6, 0x55, + 0x21, 0xd8, 0xf2, 0x25, 0x64, 0x71, 0x4b, 0x12, 0x76, 0x59, 0xc5, 0xaa, + 0x93, 0x67, 0xc3, 0x86, 0x25, 0xab, 0x4e, 0x4b, 0xf6, 0xd8, 0x3f, 0x44, + 0x2e, 0x11, 0xe0, 0xbd, 0x6a, 0xf2, 0x5d, 0xf5, 0xf9, 0x53, 0xea, 0xa4, + 0xc8, 0xd9, 0x50, 0x33, 0x81, 0xd9, 0xa8, 0x2d, 0x91, 0x7d, 0x13, 0x2a, + 0x11, 0xcf, 0xde, 0x3f, 0x0a, 0xd2, 0xbc, 0x33, 0xb2, 0x62, 0x53, 0xea, + 0x77, 0x88, 0x43, 0x66, 0x27, 0x43, 0x85, 0xe9, 0x5f, 0x55, 0xf5, 0x2a, + 0x8a, 0xac, 0xdf, 0xff, 0x9b, 0x4c, 0x96, 0x9c, 0xa5, 0x7a, 0xce, 0xd5, + 0x79, 0x18, 0xf1, 0x0b, 0x58, 0x95, 0x7a, 0xe7, 0xd3, 0x74, 0x65, 0x0b, + 0xa4, 0x64, 0x30, 0xe8, 0x5c, 0xfc, 0x55, 0x56, 0xee, 0x14, 0x14, 0xd3, + 0x45, 0x3b, 0xf8, 0xde, 0x05, 0x3e, 0xb9, 0x3c, 0xd7, 0x6a, 0x52, 0x72, + 0x5b, 0x39, 0x09, 0xbe, 0x82, 0x23, 0x10, 0x4a, 0xb7, 0xc3, 0xdc, 0x4c, + 0x5d, 0xc9, 0xf1, 0x14, 0x83, 0xf9, 0x0b, 0x9b, 0xe9, 0x23, 0x84, 0x6a, + 0xc4, 0x08, 0x3d, 0xda, 0x3d, 0x12, 0x95, 0x87, 0x18, 0xa4, 0x7d, 0x3f, + 0x23, 0xde, 0xd4, 0x1e, 0xa8, 0x47, 0xc3, 0x71, 0xdb, 0xf5, 0x03, 0x6c, + 0x57, 0xe7, 0xa4, 0x43, 0x82, 0x33, 0x7b, 0x62, 0x46, 0x7d, 0xf7, 0x10, + 0x69, 0x18, 0x38, 0x27, 0x9a, 0x6f, 0x38, 0xac, 0xfa, 0x92, 0xc5, 0xae, + 0x66, 0xa6, 0x73, 0x95, 0x15, 0x0e, 0x4c, 0x04, 0xb6, 0xfc, 0xf5, 0xc7, + 0x21, 0x3a, 0x99, 0xdb, 0x0e, 0x36, 0xf0, 0x56, 0xbc, 0x75, 0xf9, 0x87, + 0x9b, 0x11, 0x18, 0x92, 0x64, 0x1a, 0xe7, 0xc7, 0xab, 0x5a, 0xc7, 0x26, + 0x7f, 0x13, 0x98, 0x42, 0x52, 0x43, 0xdb, 0xc8, 0x6d, 0x0b, 0xb7, 0x31, + 0x93, 0x24, 0xd6, 0xe8, 0x24, 0x1f, 0x6f, 0x21, 0xa7, 0x8c, 0xeb, 0xdb, + 0x83, 0xb8, 0x89, 0xe3, 0xc1, 0xd7, 0x69, 0x3b, 0x02, 0x6b, 0x54, 0x0f, + 0x84, 0x2f, 0xb5, 0x5c, 0x17, 0x77, 0xbe, 0xe5, 0x61, 0x0d, 0xc5, 0xdf, + 0x3b, 0xcf, 0x3e, 0x93, 0x4f, 0xf5, 0x89, 0xb9, 0x5a, 0xc5, 0x29, 0x31, + 0xc0, 0xc2, 0xff, 0xe5, 0x3f, 0xa6, 0xac, 0x03, 0xca, 0xf5, 0xff, 0xe0, + 0x36, 0xce, 0xf3, 0xe2, 0xb7, 0x9c, 0x02, 0xe9, 0x9e, 0xd2, 0xbc, 0x87, + 0x2f, 0x3d, 0x9a, 0x1d, 0x8f, 0xc5, 0x72, 0xb8, 0xa2, 0x01, 0xd4, 0x68, + 0xb1, 0x84, 0x16, 0x10, 0xf6, 0xf3, 0x52, 0x25, 0xd9, 0xdc, 0x4c, 0xdd, + 0x0f, 0xd6, 0x4a, 0xcf, 0x60, 0x96, 0x7e, 0xcc, 0x42, 0x0f, 0x64, 0x9d, + 0x72, 0x46, 0x04, 0x07, 0xf2, 0x5b, 0xf4, 0x07, 0xd1, 0xf4, 0x59, 0x71, +}; + +static const uint8_t kSpakeMSmallPrecomp[15 * 2 * 32] = { + 0xc8, 0xa6, 0x63, 0xc5, 0x97, 0xf1, 0xee, 0x40, 0xab, 0x62, 0x42, 0xee, + 0x25, 0x6f, 0x32, 0x6c, 0x75, 0x2c, 0xa7, 0xd3, 0xbd, 0x32, 0x3b, 0x1e, + 0x11, 0x9c, 0xbd, 0x04, 0xa9, 0x78, 0x6f, 0x45, 0x5a, 0xda, 0x7e, 0x4b, + 0xf6, 0xdd, 0xd9, 0xad, 0xb6, 0x62, 0x6d, 0x32, 0x13, 0x1c, 0x6b, 0x5c, + 0x51, 0xa1, 0xe3, 0x47, 0xa3, 0x47, 0x8f, 0x53, 0xcf, 0xcf, 0x44, 0x1b, + 0x88, 0xee, 0xd1, 0x2e, 0x03, 0x89, 0xaf, 0xc0, 0x61, 0x2d, 0x9e, 0x35, + 0xeb, 0x0e, 0x03, 0xe0, 0xb7, 0xfb, 0xa5, 0xbc, 0x44, 0xbe, 0x0c, 0x89, + 0x0a, 0x0f, 0xd6, 0x59, 0x47, 0x9e, 0xe6, 0x3d, 0x36, 0x9d, 0xff, 0x44, + 0x5e, 0xac, 0xab, 0xe5, 0x3a, 0xd5, 0xb0, 0x35, 0x9f, 0x6d, 0x7f, 0xba, + 0xc0, 0x85, 0x0e, 0xf4, 0x70, 0x3f, 0x13, 0x90, 0x4c, 0x50, 0x1a, 0xee, + 0xc5, 0xeb, 0x69, 0xfe, 0x98, 0x42, 0x87, 0x1d, 0xce, 0x6c, 0x29, 0xaa, + 0x2b, 0x31, 0xc2, 0x38, 0x7b, 0x6b, 0xee, 0x88, 0x0b, 0xba, 0xce, 0xa8, + 0xca, 0x19, 0x60, 0x1b, 0x16, 0xf1, 0x25, 0x1e, 0xcf, 0x63, 0x66, 0x1e, + 0xbb, 0x63, 0xeb, 0x7d, 0xca, 0xd2, 0xb4, 0x23, 0x5a, 0x01, 0x6f, 0x05, + 0xd1, 0xdc, 0x41, 0x73, 0x75, 0xc0, 0xfd, 0x30, 0x91, 0x52, 0x68, 0x96, + 0x45, 0xb3, 0x66, 0x01, 0x3b, 0x53, 0x89, 0x3c, 0x69, 0xbc, 0x6c, 0x69, + 0xe3, 0x51, 0x8f, 0xe3, 0xd2, 0x84, 0xd5, 0x28, 0x66, 0xb5, 0xe6, 0x06, + 0x09, 0xfe, 0x6d, 0xb0, 0x72, 0x16, 0xe0, 0x8a, 0xce, 0x61, 0x65, 0xa9, + 0x21, 0x32, 0x48, 0xdc, 0x7a, 0x1d, 0xe1, 0x38, 0x7f, 0x8c, 0x75, 0x88, + 0x3d, 0x08, 0xa9, 0x4a, 0x6f, 0x3d, 0x9f, 0x7f, 0x3f, 0xbd, 0x57, 0x6b, + 0x19, 0xce, 0x3f, 0x4a, 0xc9, 0xd3, 0xf9, 0x6e, 0x72, 0x7b, 0x5b, 0x74, + 0xea, 0xbe, 0x9c, 0x7a, 0x6d, 0x9c, 0x40, 0x49, 0xe6, 0xfb, 0x2a, 0x1a, + 0x75, 0x70, 0xe5, 0x4e, 0xed, 0x74, 0xe0, 0x75, 0xac, 0xc0, 0xb1, 0x11, + 0x3e, 0xf2, 0xaf, 0x88, 0x4d, 0x66, 0xb6, 0xf6, 0x15, 0x4f, 0x3c, 0x6c, + 0x77, 0xae, 0x47, 0x51, 0x63, 0x9a, 0xfe, 0xe1, 0xb4, 0x1a, 0x12, 0xdf, + 0xe9, 0x54, 0x8d, 0x3b, 0x30, 0x2a, 0x75, 0xe3, 0xe5, 0x29, 0xb1, 0x4c, + 0xb0, 0x7c, 0x6d, 0xb5, 0xae, 0x85, 0xdb, 0x1e, 0x38, 0x55, 0x96, 0xa5, + 0x5b, 0x9f, 0x15, 0x23, 0x28, 0x36, 0xb8, 0xa2, 0x41, 0xb4, 0xd7, 0x19, + 0x91, 0x8d, 0x26, 0x3e, 0xca, 0x9c, 0x05, 0x7a, 0x2b, 0x60, 0x45, 0x86, + 0x8b, 0xee, 0x64, 0x6f, 0x5c, 0x09, 0x4d, 0x4b, 0x5a, 0x7f, 0xb0, 0xc3, + 0x26, 0x9d, 0x8b, 0xb8, 0x83, 0x69, 0xcf, 0x16, 0x72, 0x62, 0x3e, 0x5e, + 0x53, 0x4f, 0x9c, 0x73, 0x76, 0xfc, 0x19, 0xef, 0xa0, 0x74, 0x3a, 0x11, + 0x1e, 0xd0, 0x4d, 0xb7, 0x87, 0xa1, 0xd6, 0x87, 0x6c, 0x0e, 0x6c, 0x8c, + 0xe9, 0xa0, 0x44, 0xc4, 0x72, 0x3e, 0x73, 0x17, 0x13, 0xd1, 0x4e, 0x3d, + 0x8e, 0x1d, 0x5a, 0x8b, 0x75, 0xcb, 0x59, 0x2c, 0x47, 0x87, 0x15, 0x41, + 0xfe, 0x08, 0xe9, 0xa6, 0x97, 0x17, 0x08, 0x26, 0x6a, 0xb5, 0xbb, 0x73, + 0xaa, 0xb8, 0x5b, 0x65, 0x65, 0x5b, 0x30, 0x9e, 0x62, 0x59, 0x02, 0xf8, + 0xb8, 0x0f, 0x32, 0x10, 0xc1, 0x36, 0x08, 0x52, 0x98, 0x4a, 0x1e, 0xf0, + 0xab, 0x21, 0x5e, 0xde, 0x16, 0x0c, 0xda, 0x09, 0x99, 0x6b, 0x9e, 0xc0, + 0x90, 0xa5, 0x5a, 0xcc, 0xb0, 0xb7, 0xbb, 0xd2, 0x8b, 0x5f, 0xd3, 0x3b, + 0x3e, 0x8c, 0xa5, 0x71, 0x66, 0x06, 0xe3, 0x28, 0xd4, 0xf8, 0x3f, 0xe5, + 0x27, 0xdf, 0xfe, 0x0f, 0x09, 0xb2, 0x8a, 0x09, 0x5a, 0x23, 0x61, 0x0d, + 0x2d, 0xf5, 0x44, 0xf1, 0x5c, 0xf8, 0x82, 0x4e, 0xdc, 0x78, 0x7a, 0xab, + 0xc3, 0x57, 0x91, 0xaf, 0x65, 0x6e, 0x71, 0xf1, 0x44, 0xbf, 0xed, 0x43, + 0x50, 0xb4, 0x67, 0x48, 0xef, 0x5a, 0x10, 0x46, 0x81, 0xb4, 0x0c, 0xc8, + 0x48, 0xed, 0x99, 0x7a, 0x45, 0xa5, 0x92, 0xc3, 0x69, 0xd6, 0xd7, 0x8a, + 0x20, 0x1b, 0xeb, 0x8f, 0xb2, 0xff, 0xec, 0x6d, 0x76, 0x04, 0xf8, 0xc2, + 0x58, 0x9b, 0xf2, 0x20, 0x53, 0xc4, 0x74, 0x91, 0x19, 0xdd, 0x2d, 0x12, + 0x53, 0xc7, 0x6e, 0xd0, 0x02, 0x51, 0x3c, 0xa6, 0x7d, 0x80, 0x75, 0x6b, + 0x1d, 0xdf, 0xf8, 0x6a, 0x52, 0xbb, 0x81, 0xf8, 0x30, 0x45, 0xef, 0x51, + 0x85, 0x36, 0xbe, 0x8e, 0xcf, 0x0b, 0x9a, 0x46, 0xe8, 0x3f, 0x99, 0xfd, + 0xf7, 0xd9, 0x3e, 0x84, 0xe5, 0xe3, 0x37, 0xcf, 0x98, 0x7f, 0xeb, 0x5e, + 0x5a, 0x53, 0x77, 0x1c, 0x20, 0xdc, 0xf1, 0x20, 0x99, 0xec, 0x60, 0x40, + 0x93, 0xef, 0x5c, 0x1c, 0x81, 0xe2, 0xa5, 0xad, 0x2a, 0xc2, 0xdb, 0x6b, + 0xc1, 0x7e, 0x8f, 0xa9, 0x23, 0x5b, 0xd9, 0x0d, 0xfe, 0xa0, 0xac, 0x11, + 0x28, 0xba, 0x8e, 0x92, 0x07, 0x2d, 0x07, 0x40, 0x83, 0x14, 0x4c, 0x35, + 0x8d, 0xd0, 0x11, 0xff, 0x98, 0xdb, 0x00, 0x30, 0x6f, 0x65, 0xb6, 0xa0, + 0x7f, 0x9c, 0x08, 0xb8, 0xce, 0xb3, 0xa8, 0x42, 0xd3, 0x84, 0x45, 0xe1, + 0xe3, 0x8f, 0xa6, 0x89, 0x21, 0xd7, 0x74, 0x02, 0x4d, 0x64, 0xdf, 0x54, + 0x15, 0x9e, 0xba, 0x12, 0x49, 0x09, 0x41, 0xf6, 0x10, 0x24, 0xa1, 0x84, + 0x15, 0xfd, 0x68, 0x6a, 0x57, 0x66, 0xb3, 0x6d, 0x4c, 0xea, 0xbf, 0xbc, + 0x60, 0x3f, 0x52, 0x1c, 0x44, 0x1b, 0xc0, 0x4a, 0x25, 0xe3, 0xd9, 0x4c, + 0x9a, 0x74, 0xad, 0xfc, 0x9e, 0x8d, 0x0b, 0x18, 0x66, 0x24, 0xd1, 0x06, + 0xac, 0x68, 0xc1, 0xae, 0x14, 0xce, 0xb1, 0xf3, 0x86, 0x9f, 0x87, 0x11, + 0xd7, 0x9f, 0x30, 0x92, 0xdb, 0xec, 0x0b, 0x4a, 0xe8, 0xf6, 0x53, 0x36, + 0x68, 0x12, 0x11, 0x5e, 0xe0, 0x34, 0xa4, 0xff, 0x00, 0x0a, 0x26, 0xb8, + 0x62, 0x79, 0x9c, 0x0c, 0xd5, 0xe5, 0xf5, 0x1c, 0x1a, 0x16, 0x84, 0x4d, + 0x8e, 0x5d, 0x31, 0x7e, 0xf7, 0xe2, 0xd3, 0xa1, 0x41, 0x90, 0x61, 0x5d, + 0x04, 0xb2, 0x9a, 0x18, 0x9e, 0x54, 0xfb, 0xd1, 0x61, 0x95, 0x1b, 0x08, + 0xca, 0x7c, 0x49, 0x44, 0x74, 0x1d, 0x2f, 0xca, 0xc4, 0x7a, 0xe1, 0x8b, + 0x2f, 0xbb, 0x96, 0xee, 0x19, 0x8a, 0x5d, 0xfb, 0x3e, 0x82, 0xe7, 0x15, + 0xdb, 0x29, 0x14, 0xee, 0xc9, 0x4d, 0x9a, 0xfb, 0x9f, 0x8a, 0xbb, 0x17, + 0x37, 0x1b, 0x6e, 0x28, 0x6c, 0xf9, 0xff, 0xb5, 0xb5, 0x8b, 0x9d, 0x88, + 0x20, 0x08, 0x10, 0xd7, 0xca, 0x58, 0xf6, 0xe1, 0x32, 0x91, 0x6f, 0x36, + 0xc0, 0xad, 0xc1, 0x57, 0x5d, 0x76, 0x31, 0x43, 0xf3, 0xdd, 0xec, 0xf1, + 0xa9, 0x79, 0xe9, 0xe9, 0x85, 0xd7, 0x91, 0xc7, 0x31, 0x62, 0x3c, 0xd2, + 0x90, 0x2c, 0x9c, 0xa4, 0x56, 0x37, 0x7b, 0xbe, 0x40, 0x58, 0xc0, 0x81, + 0x83, 0x22, 0xe8, 0x13, 0x79, 0x18, 0xdb, 0x3a, 0x1b, 0x31, 0x0d, 0x00, + 0x6c, 0x22, 0x62, 0x75, 0x70, 0xd8, 0x96, 0x59, 0x99, 0x44, 0x79, 0x71, + 0xa6, 0x76, 0x81, 0x28, 0xb2, 0x65, 0xe8, 0x47, 0x14, 0xc6, 0x39, 0x06, +}; + +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 *ctx = OPENSSL_malloc(sizeof(SPAKE2_CTX)); + if (ctx == NULL) { + return NULL; + } + + OPENSSL_memset(ctx, 0, sizeof(SPAKE2_CTX)); + ctx->my_role = my_role; + + CBS my_name_cbs, their_name_cbs; + CBS_init(&my_name_cbs, my_name, my_name_len); + CBS_init(&their_name_cbs, their_name, their_name_len); + if (!CBS_stow(&my_name_cbs, &ctx->my_name, &ctx->my_name_len) || + !CBS_stow(&their_name_cbs, &ctx->their_name, &ctx->their_name_len)) { + SPAKE2_CTX_free(ctx); + return NULL; + } + + return ctx; +} + +void SPAKE2_CTX_free(SPAKE2_CTX *ctx) { + if (ctx == NULL) { + return; + } + + OPENSSL_free(ctx->my_name); + OPENSSL_free(ctx->their_name); + OPENSSL_free(ctx); +} + +// left_shift_3 sets |n| to |n|*8, where |n| is represented in little-endian +// order. +static void left_shift_3(uint8_t n[32]) { + uint8_t carry = 0; + unsigned i; + + for (i = 0; i < 32; i++) { + const uint8_t next_carry = n[i] >> 5; + n[i] = (n[i] << 3) | carry; + carry = next_carry; + } +} + +typedef union { + uint8_t bytes[32]; + uint32_t words[8]; +} scalar; + +// kOrder is the order of the prime-order subgroup of curve25519 in +// little-endian order. +static const scalar kOrder = {{0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, + 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}}; + +// scalar_cmov copies |src| to |dest| if |mask| is all ones. +static void scalar_cmov(scalar *dest, const scalar *src, crypto_word_t mask) { + for (size_t i = 0; i < 8; i++) { + dest->words[i] = + constant_time_select_w(mask, src->words[i], dest->words[i]); + } +} + +// scalar_double sets |s| to |2Γ—s|. +static void scalar_double(scalar *s) { + uint32_t carry = 0; + + for (size_t i = 0; i < 8; i++) { + const uint32_t carry_out = s->words[i] >> 31; + s->words[i] = (s->words[i] << 1) | carry; + carry = carry_out; + } +} + +// scalar_add sets |dest| to |dest| plus |src|. +static void scalar_add(scalar *dest, const scalar *src) { + uint32_t carry = 0; + + for (size_t i = 0; i < 8; i++) { + uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry; + dest->words[i] = (uint32_t)tmp; + carry = (uint32_t)(tmp >> 32); + } +} + +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) { + if (ctx->state != spake2_state_init) { + return 0; + } + + if (max_out_len < sizeof(ctx->my_msg)) { + return 0; + } + + uint8_t private_tmp[64]; + RAND_bytes(private_tmp, sizeof(private_tmp)); + x25519_sc_reduce(private_tmp); + // Multiply by the cofactor (eight) so that we'll clear it when operating on + // the peer's point later in the protocol. + left_shift_3(private_tmp); + OPENSSL_memcpy(ctx->private_key, private_tmp, sizeof(ctx->private_key)); + + ge_p3 P; + x25519_ge_scalarmult_base(&P, ctx->private_key); + + // mask = h(password) * . + uint8_t password_tmp[SHA512_DIGEST_LENGTH]; + SHA512(password, password_len, password_tmp); + OPENSSL_memcpy(ctx->password_hash, password_tmp, sizeof(ctx->password_hash)); + x25519_sc_reduce(password_tmp); + + // Due to a copy-paste error, the call to |left_shift_3| was omitted after + // the |x25519_sc_reduce|, just above. This meant that |ctx->password_scalar| + // was not a multiple of eight to clear the cofactor and thus three bits of + // the password hash would leak. In order to fix this in a unilateral way, + // points of small order are added to the mask point such that it is in the + // prime-order subgroup. Since the ephemeral scalar is a multiple of eight, + // these points will cancel out when calculating the shared secret. + // + // Adding points of small order is the same as adding multiples of the prime + // order to the password scalar. Since that's faster, that is what is done + // below. The prime order (kOrder) is a large prime, thus odd, thus the LSB + // is one. So adding it will flip the LSB. Adding twice it will flip the next + // bit and so one for all the bottom three bits. + + scalar password_scalar; + OPENSSL_memcpy(&password_scalar, password_tmp, sizeof(password_scalar)); + + // |password_scalar| is the result of |x25519_sc_reduce| and thus is, at + // most, $l-1$ (where $l$ is |kOrder|, the order of the prime-order subgroup + // of Ed25519). In the following, we may add $l + 2Γ—l + 4Γ—l$ for a max value + // of $8Γ—l-1$. That is < 2**256, as required. + + if (!ctx->disable_password_scalar_hack) { + scalar order = kOrder; + scalar tmp; + + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 1, 1)); + scalar_add(&password_scalar, &tmp); + + scalar_double(&order); + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 2, 2)); + scalar_add(&password_scalar, &tmp); + + scalar_double(&order); + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 4, 4)); + scalar_add(&password_scalar, &tmp); + + assert((password_scalar.bytes[0] & 7) == 0); + } + + OPENSSL_memcpy(ctx->password_scalar, password_scalar.bytes, + sizeof(ctx->password_scalar)); + + ge_p3 mask; + x25519_ge_scalarmult_small_precomp(&mask, ctx->password_scalar, + ctx->my_role == spake2_role_alice + ? kSpakeMSmallPrecomp + : kSpakeNSmallPrecomp); + + // P* = P + mask. + ge_cached mask_cached; + x25519_ge_p3_to_cached(&mask_cached, &mask); + ge_p1p1 Pstar; + x25519_ge_add(&Pstar, &P, &mask_cached); + + // Encode P* + ge_p2 Pstar_proj; + x25519_ge_p1p1_to_p2(&Pstar_proj, &Pstar); + x25519_ge_tobytes(ctx->my_msg, &Pstar_proj); + + OPENSSL_memcpy(out, ctx->my_msg, sizeof(ctx->my_msg)); + *out_len = sizeof(ctx->my_msg); + ctx->state = spake2_state_msg_generated; + + return 1; +} + +static void update_with_length_prefix(SHA512_CTX *sha, const uint8_t *data, + const size_t len) { + uint8_t len_le[8]; + size_t l = len; + unsigned i; + + for (i = 0; i < 8; i++) { + len_le[i] = l & 0xff; + l >>= 8; + } + + SHA512_Update(sha, len_le, sizeof(len_le)); + SHA512_Update(sha, data, len); +} + +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 (ctx->state != spake2_state_msg_generated || + their_msg_len != 32) { + return 0; + } + + ge_p3 Qstar; + if (!x25519_ge_frombytes_vartime(&Qstar, their_msg)) { + // Point received from peer was not on the curve. + return 0; + } + + // Unmask peer's value. + ge_p3 peers_mask; + x25519_ge_scalarmult_small_precomp(&peers_mask, ctx->password_scalar, + ctx->my_role == spake2_role_alice + ? kSpakeNSmallPrecomp + : kSpakeMSmallPrecomp); + + ge_cached peers_mask_cached; + x25519_ge_p3_to_cached(&peers_mask_cached, &peers_mask); + + ge_p1p1 Q_compl; + ge_p3 Q_ext; + x25519_ge_sub(&Q_compl, &Qstar, &peers_mask_cached); + x25519_ge_p1p1_to_p3(&Q_ext, &Q_compl); + + ge_p2 dh_shared; + x25519_ge_scalarmult(&dh_shared, ctx->private_key, &Q_ext); + + uint8_t dh_shared_encoded[32]; + x25519_ge_tobytes(dh_shared_encoded, &dh_shared); + + SHA512_CTX sha; + SHA512_Init(&sha); + if (ctx->my_role == spake2_role_alice) { + update_with_length_prefix(&sha, ctx->my_name, ctx->my_name_len); + update_with_length_prefix(&sha, ctx->their_name, ctx->their_name_len); + update_with_length_prefix(&sha, ctx->my_msg, sizeof(ctx->my_msg)); + update_with_length_prefix(&sha, their_msg, 32); + } else { + update_with_length_prefix(&sha, ctx->their_name, ctx->their_name_len); + update_with_length_prefix(&sha, ctx->my_name, ctx->my_name_len); + update_with_length_prefix(&sha, their_msg, 32); + update_with_length_prefix(&sha, ctx->my_msg, sizeof(ctx->my_msg)); + } + update_with_length_prefix(&sha, dh_shared_encoded, sizeof(dh_shared_encoded)); + update_with_length_prefix(&sha, ctx->password_hash, + sizeof(ctx->password_hash)); + + uint8_t key[SHA512_DIGEST_LENGTH]; + SHA512_Final(key, &sha); + + size_t to_copy = max_out_key_len; + if (to_copy > sizeof(key)) { + to_copy = sizeof(key); + } + OPENSSL_memcpy(out_key, key, to_copy); + *out_key_len = to_copy; + ctx->state = spake2_state_key_generated; + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back new file mode 100644 index 0000000..650178c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back @@ -0,0 +1,539 @@ +/* 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 "../internal.h" +#include "../../third_party/fiat/internal.h" + + +// The following precomputation tables are for the following +// points used in the SPAKE2 protocol. +// +// N: +// x: 49918732221787544735331783592030787422991506689877079631459872391322455579424 +// y: 54629554431565467720832445949441049581317094546788069926228343916274969994000 +// encoded: 10e3df0ae37d8e7a99b5fe74b44672103dbddcbd06af680d71329a11693bc778 +// +// M: +// x: 31406539342727633121250288103050113562375374900226415211311216773867585644232 +// y: 21177308356423958466833845032658859666296341766942662650232962324899758529114 +// encoded: 5ada7e4bf6ddd9adb6626d32131c6b5c51a1e347a3478f53cfcf441b88eed12e +// +// These points and their precomputation tables are generated with the +// following Python code. For a description of the precomputation table, +// see curve25519.c in this directory. +// +// Exact copies of the source code are kept in bug 27296743. + +/* +import hashlib +import ed25519 as E # http://ed25519.cr.yp.to/python/ed25519.py + +SEED_N = 'edwards25519 point generation seed (N)' +SEED_M = 'edwards25519 point generation seed (M)' + +def genpoint(seed): + v = hashlib.sha256(seed).digest() + it = 1 + while True: + try: + x,y = E.decodepoint(v) + except Exception, e: + print e + it += 1 + v = hashlib.sha256(v).digest() + continue + print "Found in %d iterations:" % it + print " x = %d" % x + print " y = %d" % y + print " Encoded (hex)" + print E.encodepoint((x,y)).encode('hex') + return (x,y) + +def gentable(P): + t = [] + for i in range(1,16): + k = ((i >> 3 & 1) * (1 << 192) + + (i >> 2 & 1) * (1 << 128) + + (i >> 1 & 1) * (1 << 64) + + (i & 1)) + t.append(E.scalarmult(P, k)) + return ''.join(E.encodeint(x) + E.encodeint(y) for (x,y) in t) + +def printtable(table, name): + print "static const uint8_t %s[15 * 2 * 32] = {" % name, + for i in range(15 * 2 * 32): + if i % 12 == 0: + print "\n ", + print " 0x%02x," % ord(table[i]), + print "\n};" + +if __name__ == "__main__": + print "Searching for N" + N = genpoint(SEED_N) + print "Generating precomputation table for N" + Ntable = gentable(N) + printtable(Ntable, "kSpakeNSmallPrecomp") + + print "Searching for M" + M = genpoint(SEED_M) + print "Generating precomputation table for M" + Mtable = gentable(M) + printtable(Mtable, "kSpakeMSmallPrecomp") +*/ + +static const uint8_t kSpakeNSmallPrecomp[15 * 2 * 32] = { + 0x20, 0x1b, 0xc5, 0xb3, 0x43, 0x17, 0x71, 0x10, 0x44, 0x1e, 0x73, 0xb3, + 0xae, 0x3f, 0xbf, 0x9f, 0xf5, 0x44, 0xc8, 0x13, 0x8f, 0xd1, 0x01, 0xc2, + 0x8a, 0x1a, 0x6d, 0xea, 0x4d, 0x00, 0x5d, 0x6e, 0x10, 0xe3, 0xdf, 0x0a, + 0xe3, 0x7d, 0x8e, 0x7a, 0x99, 0xb5, 0xfe, 0x74, 0xb4, 0x46, 0x72, 0x10, + 0x3d, 0xbd, 0xdc, 0xbd, 0x06, 0xaf, 0x68, 0x0d, 0x71, 0x32, 0x9a, 0x11, + 0x69, 0x3b, 0xc7, 0x78, 0x93, 0xf1, 0x57, 0x97, 0x6e, 0xf0, 0x6e, 0x45, + 0x37, 0x4a, 0xf4, 0x0b, 0x18, 0x51, 0xf5, 0x4f, 0x67, 0x3c, 0xdc, 0xec, + 0x84, 0xed, 0xd0, 0xeb, 0xca, 0xfb, 0xdb, 0xff, 0x7f, 0xeb, 0xa8, 0x23, + 0x68, 0x87, 0x13, 0x64, 0x6a, 0x10, 0xf7, 0x45, 0xe0, 0x0f, 0x32, 0x21, + 0x59, 0x7c, 0x0e, 0x50, 0xad, 0x56, 0xd7, 0x12, 0x69, 0x7b, 0x58, 0xf8, + 0xb9, 0x3b, 0xa5, 0xbb, 0x4d, 0x1b, 0x87, 0x1c, 0x46, 0xa7, 0x17, 0x9d, + 0x6d, 0x84, 0x45, 0xbe, 0x7f, 0x95, 0xd2, 0x34, 0xcd, 0x89, 0x95, 0xc0, + 0xf0, 0xd3, 0xdf, 0x6e, 0x10, 0x4a, 0xe3, 0x7b, 0xce, 0x7f, 0x40, 0x27, + 0xc7, 0x2b, 0xab, 0x66, 0x03, 0x59, 0xb4, 0x7b, 0xc7, 0xc7, 0xf0, 0x39, + 0x9a, 0x33, 0x35, 0xbf, 0xcc, 0x2f, 0xf3, 0x2e, 0x68, 0x9d, 0x53, 0x5c, + 0x88, 0x52, 0xe3, 0x77, 0x90, 0xa1, 0x27, 0x85, 0xc5, 0x74, 0x7f, 0x23, + 0x0e, 0x93, 0x01, 0x3e, 0xe7, 0x2e, 0x2e, 0x95, 0xf3, 0x0d, 0xc2, 0x25, + 0x25, 0x39, 0x39, 0x3d, 0x6e, 0x8e, 0x89, 0xbd, 0xe8, 0xbb, 0x67, 0x5e, + 0x8c, 0x66, 0x8b, 0x63, 0x28, 0x1e, 0x4e, 0x74, 0x85, 0xa8, 0xaf, 0x0f, + 0x12, 0x5d, 0xb6, 0x8a, 0x83, 0x1a, 0x77, 0x76, 0x5e, 0x62, 0x8a, 0xa7, + 0x3c, 0xb8, 0x05, 0x57, 0x2b, 0xaf, 0x36, 0x2e, 0x10, 0x90, 0xb2, 0x39, + 0xb4, 0x3e, 0x75, 0x6d, 0x3a, 0xa8, 0x31, 0x35, 0xc2, 0x1e, 0x8f, 0xc2, + 0x79, 0x89, 0x35, 0x16, 0x26, 0xd1, 0xc7, 0x0b, 0x04, 0x1f, 0x1d, 0xf9, + 0x9c, 0x05, 0xa6, 0x6b, 0xb5, 0x19, 0x5a, 0x24, 0x6d, 0x91, 0xc5, 0x31, + 0xfd, 0xc5, 0xfa, 0xe7, 0xa6, 0xcb, 0x0e, 0x4b, 0x18, 0x0d, 0x94, 0xc7, + 0xee, 0x1d, 0x46, 0x1f, 0x92, 0xb1, 0xb2, 0x4a, 0x2b, 0x43, 0x37, 0xfe, + 0xc2, 0x15, 0x11, 0x89, 0xef, 0x59, 0x73, 0x3c, 0x06, 0x76, 0x78, 0xcb, + 0xa6, 0x0d, 0x79, 0x5f, 0x28, 0x0b, 0x5b, 0x8c, 0x9e, 0xe4, 0xaa, 0x51, + 0x9a, 0x42, 0x6f, 0x11, 0x50, 0x3d, 0x01, 0xd6, 0x21, 0xc0, 0x99, 0x5e, + 0x1a, 0xe8, 0x81, 0x25, 0x80, 0xeb, 0xed, 0x5d, 0x37, 0x47, 0x30, 0x70, + 0xa0, 0x4e, 0x0b, 0x43, 0x17, 0xbe, 0xb6, 0x47, 0xe7, 0x2a, 0x62, 0x9d, + 0x5d, 0xa6, 0xc5, 0x33, 0x62, 0x9d, 0x56, 0x24, 0x9d, 0x1d, 0xb2, 0x13, + 0xbc, 0x17, 0x66, 0x43, 0xd1, 0x68, 0xd5, 0x3b, 0x17, 0x69, 0x17, 0xa6, + 0x06, 0x9e, 0x12, 0xb8, 0x7c, 0xd5, 0xaf, 0x3e, 0x21, 0x1b, 0x31, 0xeb, + 0x0b, 0xa4, 0x98, 0x1c, 0xf2, 0x6a, 0x5e, 0x7c, 0x9b, 0x45, 0x8f, 0xb2, + 0x12, 0x06, 0xd5, 0x8c, 0x1d, 0xb2, 0xa7, 0x57, 0x5f, 0x2f, 0x4f, 0xdb, + 0x52, 0x99, 0x7c, 0x58, 0x01, 0x5f, 0xf2, 0xa5, 0xf6, 0x51, 0x86, 0x21, + 0x2f, 0x5b, 0x8d, 0x6a, 0xae, 0x83, 0x34, 0x6d, 0x58, 0x4b, 0xef, 0xfe, + 0xbf, 0x73, 0x5d, 0xdb, 0xc4, 0x97, 0x2a, 0x85, 0xf3, 0x6c, 0x46, 0x42, + 0xb3, 0x90, 0xc1, 0x57, 0x97, 0x50, 0x35, 0xb1, 0x9d, 0xb7, 0xc7, 0x3c, + 0x85, 0x6d, 0x6c, 0xfd, 0xce, 0xb0, 0xc9, 0xa2, 0x77, 0xee, 0xc3, 0x6b, + 0x0c, 0x37, 0xfa, 0x30, 0x91, 0xd1, 0x2c, 0xb8, 0x5e, 0x7f, 0x81, 0x5f, + 0x87, 0xfd, 0x18, 0x02, 0x5a, 0x30, 0x4e, 0x62, 0xbc, 0x65, 0xc6, 0xce, + 0x1a, 0xcf, 0x2b, 0xaa, 0x56, 0x3e, 0x4d, 0xcf, 0xba, 0x62, 0x5f, 0x9a, + 0xd0, 0x72, 0xff, 0xef, 0x28, 0xbd, 0xbe, 0xd8, 0x57, 0x3d, 0xf5, 0x57, + 0x7d, 0xe9, 0x71, 0x31, 0xec, 0x98, 0x90, 0x94, 0xd9, 0x54, 0xbf, 0x84, + 0x0b, 0xe3, 0x06, 0x47, 0x19, 0x9a, 0x13, 0x1d, 0xef, 0x9d, 0x13, 0xf3, + 0xdb, 0xc3, 0x5c, 0x72, 0x9e, 0xed, 0x24, 0xaa, 0x64, 0xed, 0xe7, 0x0d, + 0xa0, 0x7c, 0x73, 0xba, 0x9b, 0x86, 0xa7, 0x3b, 0x55, 0xab, 0x58, 0x30, + 0xf1, 0x15, 0x81, 0x83, 0x2f, 0xf9, 0x62, 0x84, 0x98, 0x66, 0xf6, 0x55, + 0x21, 0xd8, 0xf2, 0x25, 0x64, 0x71, 0x4b, 0x12, 0x76, 0x59, 0xc5, 0xaa, + 0x93, 0x67, 0xc3, 0x86, 0x25, 0xab, 0x4e, 0x4b, 0xf6, 0xd8, 0x3f, 0x44, + 0x2e, 0x11, 0xe0, 0xbd, 0x6a, 0xf2, 0x5d, 0xf5, 0xf9, 0x53, 0xea, 0xa4, + 0xc8, 0xd9, 0x50, 0x33, 0x81, 0xd9, 0xa8, 0x2d, 0x91, 0x7d, 0x13, 0x2a, + 0x11, 0xcf, 0xde, 0x3f, 0x0a, 0xd2, 0xbc, 0x33, 0xb2, 0x62, 0x53, 0xea, + 0x77, 0x88, 0x43, 0x66, 0x27, 0x43, 0x85, 0xe9, 0x5f, 0x55, 0xf5, 0x2a, + 0x8a, 0xac, 0xdf, 0xff, 0x9b, 0x4c, 0x96, 0x9c, 0xa5, 0x7a, 0xce, 0xd5, + 0x79, 0x18, 0xf1, 0x0b, 0x58, 0x95, 0x7a, 0xe7, 0xd3, 0x74, 0x65, 0x0b, + 0xa4, 0x64, 0x30, 0xe8, 0x5c, 0xfc, 0x55, 0x56, 0xee, 0x14, 0x14, 0xd3, + 0x45, 0x3b, 0xf8, 0xde, 0x05, 0x3e, 0xb9, 0x3c, 0xd7, 0x6a, 0x52, 0x72, + 0x5b, 0x39, 0x09, 0xbe, 0x82, 0x23, 0x10, 0x4a, 0xb7, 0xc3, 0xdc, 0x4c, + 0x5d, 0xc9, 0xf1, 0x14, 0x83, 0xf9, 0x0b, 0x9b, 0xe9, 0x23, 0x84, 0x6a, + 0xc4, 0x08, 0x3d, 0xda, 0x3d, 0x12, 0x95, 0x87, 0x18, 0xa4, 0x7d, 0x3f, + 0x23, 0xde, 0xd4, 0x1e, 0xa8, 0x47, 0xc3, 0x71, 0xdb, 0xf5, 0x03, 0x6c, + 0x57, 0xe7, 0xa4, 0x43, 0x82, 0x33, 0x7b, 0x62, 0x46, 0x7d, 0xf7, 0x10, + 0x69, 0x18, 0x38, 0x27, 0x9a, 0x6f, 0x38, 0xac, 0xfa, 0x92, 0xc5, 0xae, + 0x66, 0xa6, 0x73, 0x95, 0x15, 0x0e, 0x4c, 0x04, 0xb6, 0xfc, 0xf5, 0xc7, + 0x21, 0x3a, 0x99, 0xdb, 0x0e, 0x36, 0xf0, 0x56, 0xbc, 0x75, 0xf9, 0x87, + 0x9b, 0x11, 0x18, 0x92, 0x64, 0x1a, 0xe7, 0xc7, 0xab, 0x5a, 0xc7, 0x26, + 0x7f, 0x13, 0x98, 0x42, 0x52, 0x43, 0xdb, 0xc8, 0x6d, 0x0b, 0xb7, 0x31, + 0x93, 0x24, 0xd6, 0xe8, 0x24, 0x1f, 0x6f, 0x21, 0xa7, 0x8c, 0xeb, 0xdb, + 0x83, 0xb8, 0x89, 0xe3, 0xc1, 0xd7, 0x69, 0x3b, 0x02, 0x6b, 0x54, 0x0f, + 0x84, 0x2f, 0xb5, 0x5c, 0x17, 0x77, 0xbe, 0xe5, 0x61, 0x0d, 0xc5, 0xdf, + 0x3b, 0xcf, 0x3e, 0x93, 0x4f, 0xf5, 0x89, 0xb9, 0x5a, 0xc5, 0x29, 0x31, + 0xc0, 0xc2, 0xff, 0xe5, 0x3f, 0xa6, 0xac, 0x03, 0xca, 0xf5, 0xff, 0xe0, + 0x36, 0xce, 0xf3, 0xe2, 0xb7, 0x9c, 0x02, 0xe9, 0x9e, 0xd2, 0xbc, 0x87, + 0x2f, 0x3d, 0x9a, 0x1d, 0x8f, 0xc5, 0x72, 0xb8, 0xa2, 0x01, 0xd4, 0x68, + 0xb1, 0x84, 0x16, 0x10, 0xf6, 0xf3, 0x52, 0x25, 0xd9, 0xdc, 0x4c, 0xdd, + 0x0f, 0xd6, 0x4a, 0xcf, 0x60, 0x96, 0x7e, 0xcc, 0x42, 0x0f, 0x64, 0x9d, + 0x72, 0x46, 0x04, 0x07, 0xf2, 0x5b, 0xf4, 0x07, 0xd1, 0xf4, 0x59, 0x71, +}; + +static const uint8_t kSpakeMSmallPrecomp[15 * 2 * 32] = { + 0xc8, 0xa6, 0x63, 0xc5, 0x97, 0xf1, 0xee, 0x40, 0xab, 0x62, 0x42, 0xee, + 0x25, 0x6f, 0x32, 0x6c, 0x75, 0x2c, 0xa7, 0xd3, 0xbd, 0x32, 0x3b, 0x1e, + 0x11, 0x9c, 0xbd, 0x04, 0xa9, 0x78, 0x6f, 0x45, 0x5a, 0xda, 0x7e, 0x4b, + 0xf6, 0xdd, 0xd9, 0xad, 0xb6, 0x62, 0x6d, 0x32, 0x13, 0x1c, 0x6b, 0x5c, + 0x51, 0xa1, 0xe3, 0x47, 0xa3, 0x47, 0x8f, 0x53, 0xcf, 0xcf, 0x44, 0x1b, + 0x88, 0xee, 0xd1, 0x2e, 0x03, 0x89, 0xaf, 0xc0, 0x61, 0x2d, 0x9e, 0x35, + 0xeb, 0x0e, 0x03, 0xe0, 0xb7, 0xfb, 0xa5, 0xbc, 0x44, 0xbe, 0x0c, 0x89, + 0x0a, 0x0f, 0xd6, 0x59, 0x47, 0x9e, 0xe6, 0x3d, 0x36, 0x9d, 0xff, 0x44, + 0x5e, 0xac, 0xab, 0xe5, 0x3a, 0xd5, 0xb0, 0x35, 0x9f, 0x6d, 0x7f, 0xba, + 0xc0, 0x85, 0x0e, 0xf4, 0x70, 0x3f, 0x13, 0x90, 0x4c, 0x50, 0x1a, 0xee, + 0xc5, 0xeb, 0x69, 0xfe, 0x98, 0x42, 0x87, 0x1d, 0xce, 0x6c, 0x29, 0xaa, + 0x2b, 0x31, 0xc2, 0x38, 0x7b, 0x6b, 0xee, 0x88, 0x0b, 0xba, 0xce, 0xa8, + 0xca, 0x19, 0x60, 0x1b, 0x16, 0xf1, 0x25, 0x1e, 0xcf, 0x63, 0x66, 0x1e, + 0xbb, 0x63, 0xeb, 0x7d, 0xca, 0xd2, 0xb4, 0x23, 0x5a, 0x01, 0x6f, 0x05, + 0xd1, 0xdc, 0x41, 0x73, 0x75, 0xc0, 0xfd, 0x30, 0x91, 0x52, 0x68, 0x96, + 0x45, 0xb3, 0x66, 0x01, 0x3b, 0x53, 0x89, 0x3c, 0x69, 0xbc, 0x6c, 0x69, + 0xe3, 0x51, 0x8f, 0xe3, 0xd2, 0x84, 0xd5, 0x28, 0x66, 0xb5, 0xe6, 0x06, + 0x09, 0xfe, 0x6d, 0xb0, 0x72, 0x16, 0xe0, 0x8a, 0xce, 0x61, 0x65, 0xa9, + 0x21, 0x32, 0x48, 0xdc, 0x7a, 0x1d, 0xe1, 0x38, 0x7f, 0x8c, 0x75, 0x88, + 0x3d, 0x08, 0xa9, 0x4a, 0x6f, 0x3d, 0x9f, 0x7f, 0x3f, 0xbd, 0x57, 0x6b, + 0x19, 0xce, 0x3f, 0x4a, 0xc9, 0xd3, 0xf9, 0x6e, 0x72, 0x7b, 0x5b, 0x74, + 0xea, 0xbe, 0x9c, 0x7a, 0x6d, 0x9c, 0x40, 0x49, 0xe6, 0xfb, 0x2a, 0x1a, + 0x75, 0x70, 0xe5, 0x4e, 0xed, 0x74, 0xe0, 0x75, 0xac, 0xc0, 0xb1, 0x11, + 0x3e, 0xf2, 0xaf, 0x88, 0x4d, 0x66, 0xb6, 0xf6, 0x15, 0x4f, 0x3c, 0x6c, + 0x77, 0xae, 0x47, 0x51, 0x63, 0x9a, 0xfe, 0xe1, 0xb4, 0x1a, 0x12, 0xdf, + 0xe9, 0x54, 0x8d, 0x3b, 0x30, 0x2a, 0x75, 0xe3, 0xe5, 0x29, 0xb1, 0x4c, + 0xb0, 0x7c, 0x6d, 0xb5, 0xae, 0x85, 0xdb, 0x1e, 0x38, 0x55, 0x96, 0xa5, + 0x5b, 0x9f, 0x15, 0x23, 0x28, 0x36, 0xb8, 0xa2, 0x41, 0xb4, 0xd7, 0x19, + 0x91, 0x8d, 0x26, 0x3e, 0xca, 0x9c, 0x05, 0x7a, 0x2b, 0x60, 0x45, 0x86, + 0x8b, 0xee, 0x64, 0x6f, 0x5c, 0x09, 0x4d, 0x4b, 0x5a, 0x7f, 0xb0, 0xc3, + 0x26, 0x9d, 0x8b, 0xb8, 0x83, 0x69, 0xcf, 0x16, 0x72, 0x62, 0x3e, 0x5e, + 0x53, 0x4f, 0x9c, 0x73, 0x76, 0xfc, 0x19, 0xef, 0xa0, 0x74, 0x3a, 0x11, + 0x1e, 0xd0, 0x4d, 0xb7, 0x87, 0xa1, 0xd6, 0x87, 0x6c, 0x0e, 0x6c, 0x8c, + 0xe9, 0xa0, 0x44, 0xc4, 0x72, 0x3e, 0x73, 0x17, 0x13, 0xd1, 0x4e, 0x3d, + 0x8e, 0x1d, 0x5a, 0x8b, 0x75, 0xcb, 0x59, 0x2c, 0x47, 0x87, 0x15, 0x41, + 0xfe, 0x08, 0xe9, 0xa6, 0x97, 0x17, 0x08, 0x26, 0x6a, 0xb5, 0xbb, 0x73, + 0xaa, 0xb8, 0x5b, 0x65, 0x65, 0x5b, 0x30, 0x9e, 0x62, 0x59, 0x02, 0xf8, + 0xb8, 0x0f, 0x32, 0x10, 0xc1, 0x36, 0x08, 0x52, 0x98, 0x4a, 0x1e, 0xf0, + 0xab, 0x21, 0x5e, 0xde, 0x16, 0x0c, 0xda, 0x09, 0x99, 0x6b, 0x9e, 0xc0, + 0x90, 0xa5, 0x5a, 0xcc, 0xb0, 0xb7, 0xbb, 0xd2, 0x8b, 0x5f, 0xd3, 0x3b, + 0x3e, 0x8c, 0xa5, 0x71, 0x66, 0x06, 0xe3, 0x28, 0xd4, 0xf8, 0x3f, 0xe5, + 0x27, 0xdf, 0xfe, 0x0f, 0x09, 0xb2, 0x8a, 0x09, 0x5a, 0x23, 0x61, 0x0d, + 0x2d, 0xf5, 0x44, 0xf1, 0x5c, 0xf8, 0x82, 0x4e, 0xdc, 0x78, 0x7a, 0xab, + 0xc3, 0x57, 0x91, 0xaf, 0x65, 0x6e, 0x71, 0xf1, 0x44, 0xbf, 0xed, 0x43, + 0x50, 0xb4, 0x67, 0x48, 0xef, 0x5a, 0x10, 0x46, 0x81, 0xb4, 0x0c, 0xc8, + 0x48, 0xed, 0x99, 0x7a, 0x45, 0xa5, 0x92, 0xc3, 0x69, 0xd6, 0xd7, 0x8a, + 0x20, 0x1b, 0xeb, 0x8f, 0xb2, 0xff, 0xec, 0x6d, 0x76, 0x04, 0xf8, 0xc2, + 0x58, 0x9b, 0xf2, 0x20, 0x53, 0xc4, 0x74, 0x91, 0x19, 0xdd, 0x2d, 0x12, + 0x53, 0xc7, 0x6e, 0xd0, 0x02, 0x51, 0x3c, 0xa6, 0x7d, 0x80, 0x75, 0x6b, + 0x1d, 0xdf, 0xf8, 0x6a, 0x52, 0xbb, 0x81, 0xf8, 0x30, 0x45, 0xef, 0x51, + 0x85, 0x36, 0xbe, 0x8e, 0xcf, 0x0b, 0x9a, 0x46, 0xe8, 0x3f, 0x99, 0xfd, + 0xf7, 0xd9, 0x3e, 0x84, 0xe5, 0xe3, 0x37, 0xcf, 0x98, 0x7f, 0xeb, 0x5e, + 0x5a, 0x53, 0x77, 0x1c, 0x20, 0xdc, 0xf1, 0x20, 0x99, 0xec, 0x60, 0x40, + 0x93, 0xef, 0x5c, 0x1c, 0x81, 0xe2, 0xa5, 0xad, 0x2a, 0xc2, 0xdb, 0x6b, + 0xc1, 0x7e, 0x8f, 0xa9, 0x23, 0x5b, 0xd9, 0x0d, 0xfe, 0xa0, 0xac, 0x11, + 0x28, 0xba, 0x8e, 0x92, 0x07, 0x2d, 0x07, 0x40, 0x83, 0x14, 0x4c, 0x35, + 0x8d, 0xd0, 0x11, 0xff, 0x98, 0xdb, 0x00, 0x30, 0x6f, 0x65, 0xb6, 0xa0, + 0x7f, 0x9c, 0x08, 0xb8, 0xce, 0xb3, 0xa8, 0x42, 0xd3, 0x84, 0x45, 0xe1, + 0xe3, 0x8f, 0xa6, 0x89, 0x21, 0xd7, 0x74, 0x02, 0x4d, 0x64, 0xdf, 0x54, + 0x15, 0x9e, 0xba, 0x12, 0x49, 0x09, 0x41, 0xf6, 0x10, 0x24, 0xa1, 0x84, + 0x15, 0xfd, 0x68, 0x6a, 0x57, 0x66, 0xb3, 0x6d, 0x4c, 0xea, 0xbf, 0xbc, + 0x60, 0x3f, 0x52, 0x1c, 0x44, 0x1b, 0xc0, 0x4a, 0x25, 0xe3, 0xd9, 0x4c, + 0x9a, 0x74, 0xad, 0xfc, 0x9e, 0x8d, 0x0b, 0x18, 0x66, 0x24, 0xd1, 0x06, + 0xac, 0x68, 0xc1, 0xae, 0x14, 0xce, 0xb1, 0xf3, 0x86, 0x9f, 0x87, 0x11, + 0xd7, 0x9f, 0x30, 0x92, 0xdb, 0xec, 0x0b, 0x4a, 0xe8, 0xf6, 0x53, 0x36, + 0x68, 0x12, 0x11, 0x5e, 0xe0, 0x34, 0xa4, 0xff, 0x00, 0x0a, 0x26, 0xb8, + 0x62, 0x79, 0x9c, 0x0c, 0xd5, 0xe5, 0xf5, 0x1c, 0x1a, 0x16, 0x84, 0x4d, + 0x8e, 0x5d, 0x31, 0x7e, 0xf7, 0xe2, 0xd3, 0xa1, 0x41, 0x90, 0x61, 0x5d, + 0x04, 0xb2, 0x9a, 0x18, 0x9e, 0x54, 0xfb, 0xd1, 0x61, 0x95, 0x1b, 0x08, + 0xca, 0x7c, 0x49, 0x44, 0x74, 0x1d, 0x2f, 0xca, 0xc4, 0x7a, 0xe1, 0x8b, + 0x2f, 0xbb, 0x96, 0xee, 0x19, 0x8a, 0x5d, 0xfb, 0x3e, 0x82, 0xe7, 0x15, + 0xdb, 0x29, 0x14, 0xee, 0xc9, 0x4d, 0x9a, 0xfb, 0x9f, 0x8a, 0xbb, 0x17, + 0x37, 0x1b, 0x6e, 0x28, 0x6c, 0xf9, 0xff, 0xb5, 0xb5, 0x8b, 0x9d, 0x88, + 0x20, 0x08, 0x10, 0xd7, 0xca, 0x58, 0xf6, 0xe1, 0x32, 0x91, 0x6f, 0x36, + 0xc0, 0xad, 0xc1, 0x57, 0x5d, 0x76, 0x31, 0x43, 0xf3, 0xdd, 0xec, 0xf1, + 0xa9, 0x79, 0xe9, 0xe9, 0x85, 0xd7, 0x91, 0xc7, 0x31, 0x62, 0x3c, 0xd2, + 0x90, 0x2c, 0x9c, 0xa4, 0x56, 0x37, 0x7b, 0xbe, 0x40, 0x58, 0xc0, 0x81, + 0x83, 0x22, 0xe8, 0x13, 0x79, 0x18, 0xdb, 0x3a, 0x1b, 0x31, 0x0d, 0x00, + 0x6c, 0x22, 0x62, 0x75, 0x70, 0xd8, 0x96, 0x59, 0x99, 0x44, 0x79, 0x71, + 0xa6, 0x76, 0x81, 0x28, 0xb2, 0x65, 0xe8, 0x47, 0x14, 0xc6, 0x39, 0x06, +}; + +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 *ctx = OPENSSL_malloc(sizeof(SPAKE2_CTX)); + if (ctx == NULL) { + return NULL; + } + + OPENSSL_memset(ctx, 0, sizeof(SPAKE2_CTX)); + ctx->my_role = my_role; + + CBS my_name_cbs, their_name_cbs; + CBS_init(&my_name_cbs, my_name, my_name_len); + CBS_init(&their_name_cbs, their_name, their_name_len); + if (!CBS_stow(&my_name_cbs, &ctx->my_name, &ctx->my_name_len) || + !CBS_stow(&their_name_cbs, &ctx->their_name, &ctx->their_name_len)) { + SPAKE2_CTX_free(ctx); + return NULL; + } + + return ctx; +} + +void SPAKE2_CTX_free(SPAKE2_CTX *ctx) { + if (ctx == NULL) { + return; + } + + OPENSSL_free(ctx->my_name); + OPENSSL_free(ctx->their_name); + OPENSSL_free(ctx); +} + +// left_shift_3 sets |n| to |n|*8, where |n| is represented in little-endian +// order. +static void left_shift_3(uint8_t n[32]) { + uint8_t carry = 0; + unsigned i; + + for (i = 0; i < 32; i++) { + const uint8_t next_carry = n[i] >> 5; + n[i] = (n[i] << 3) | carry; + carry = next_carry; + } +} + +typedef union { + uint8_t bytes[32]; + uint32_t words[8]; +} scalar; + +// kOrder is the order of the prime-order subgroup of curve25519 in +// little-endian order. +static const scalar kOrder = {{0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, + 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}}; + +// scalar_cmov copies |src| to |dest| if |mask| is all ones. +static void scalar_cmov(scalar *dest, const scalar *src, crypto_word_t mask) { + for (size_t i = 0; i < 8; i++) { + dest->words[i] = + constant_time_select_w(mask, src->words[i], dest->words[i]); + } +} + +// scalar_double sets |s| to |2Γ—s|. +static void scalar_double(scalar *s) { + uint32_t carry = 0; + + for (size_t i = 0; i < 8; i++) { + const uint32_t carry_out = s->words[i] >> 31; + s->words[i] = (s->words[i] << 1) | carry; + carry = carry_out; + } +} + +// scalar_add sets |dest| to |dest| plus |src|. +static void scalar_add(scalar *dest, const scalar *src) { + uint32_t carry = 0; + + for (size_t i = 0; i < 8; i++) { + uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry; + dest->words[i] = (uint32_t)tmp; + carry = (uint32_t)(tmp >> 32); + } +} + +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) { + if (ctx->state != spake2_state_init) { + return 0; + } + + if (max_out_len < sizeof(ctx->my_msg)) { + return 0; + } + + uint8_t private_tmp[64]; + RAND_bytes(private_tmp, sizeof(private_tmp)); + x25519_sc_reduce(private_tmp); + // Multiply by the cofactor (eight) so that we'll clear it when operating on + // the peer's point later in the protocol. + left_shift_3(private_tmp); + OPENSSL_memcpy(ctx->private_key, private_tmp, sizeof(ctx->private_key)); + + ge_p3 P; + x25519_ge_scalarmult_base(&P, ctx->private_key); + + // mask = h(password) * . + uint8_t password_tmp[SHA512_DIGEST_LENGTH]; + SHA512(password, password_len, password_tmp); + OPENSSL_memcpy(ctx->password_hash, password_tmp, sizeof(ctx->password_hash)); + x25519_sc_reduce(password_tmp); + + // Due to a copy-paste error, the call to |left_shift_3| was omitted after + // the |x25519_sc_reduce|, just above. This meant that |ctx->password_scalar| + // was not a multiple of eight to clear the cofactor and thus three bits of + // the password hash would leak. In order to fix this in a unilateral way, + // points of small order are added to the mask point such that it is in the + // prime-order subgroup. Since the ephemeral scalar is a multiple of eight, + // these points will cancel out when calculating the shared secret. + // + // Adding points of small order is the same as adding multiples of the prime + // order to the password scalar. Since that's faster, that is what is done + // below. The prime order (kOrder) is a large prime, thus odd, thus the LSB + // is one. So adding it will flip the LSB. Adding twice it will flip the next + // bit and so one for all the bottom three bits. + + scalar password_scalar; + OPENSSL_memcpy(&password_scalar, password_tmp, sizeof(password_scalar)); + + // |password_scalar| is the result of |x25519_sc_reduce| and thus is, at + // most, $l-1$ (where $l$ is |kOrder|, the order of the prime-order subgroup + // of Ed25519). In the following, we may add $l + 2Γ—l + 4Γ—l$ for a max value + // of $8Γ—l-1$. That is < 2**256, as required. + + if (!ctx->disable_password_scalar_hack) { + scalar order = kOrder; + scalar tmp; + + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 1, 1)); + scalar_add(&password_scalar, &tmp); + + scalar_double(&order); + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 2, 2)); + scalar_add(&password_scalar, &tmp); + + scalar_double(&order); + OPENSSL_memset(&tmp, 0, sizeof(tmp)); + scalar_cmov(&tmp, &order, + constant_time_eq_w(password_scalar.bytes[0] & 4, 4)); + scalar_add(&password_scalar, &tmp); + + assert((password_scalar.bytes[0] & 7) == 0); + } + + OPENSSL_memcpy(ctx->password_scalar, password_scalar.bytes, + sizeof(ctx->password_scalar)); + + ge_p3 mask; + x25519_ge_scalarmult_small_precomp(&mask, ctx->password_scalar, + ctx->my_role == spake2_role_alice + ? kSpakeMSmallPrecomp + : kSpakeNSmallPrecomp); + + // P* = P + mask. + ge_cached mask_cached; + x25519_ge_p3_to_cached(&mask_cached, &mask); + ge_p1p1 Pstar; + x25519_ge_add(&Pstar, &P, &mask_cached); + + // Encode P* + ge_p2 Pstar_proj; + x25519_ge_p1p1_to_p2(&Pstar_proj, &Pstar); + x25519_ge_tobytes(ctx->my_msg, &Pstar_proj); + + OPENSSL_memcpy(out, ctx->my_msg, sizeof(ctx->my_msg)); + *out_len = sizeof(ctx->my_msg); + ctx->state = spake2_state_msg_generated; + + return 1; +} + +static void update_with_length_prefix(SHA512_CTX *sha, const uint8_t *data, + const size_t len) { + uint8_t len_le[8]; + size_t l = len; + unsigned i; + + for (i = 0; i < 8; i++) { + len_le[i] = l & 0xff; + l >>= 8; + } + + SHA512_Update(sha, len_le, sizeof(len_le)); + SHA512_Update(sha, data, len); +} + +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 (ctx->state != spake2_state_msg_generated || + their_msg_len != 32) { + return 0; + } + + ge_p3 Qstar; + if (!x25519_ge_frombytes_vartime(&Qstar, their_msg)) { + // Point received from peer was not on the curve. + return 0; + } + + // Unmask peer's value. + ge_p3 peers_mask; + x25519_ge_scalarmult_small_precomp(&peers_mask, ctx->password_scalar, + ctx->my_role == spake2_role_alice + ? kSpakeNSmallPrecomp + : kSpakeMSmallPrecomp); + + ge_cached peers_mask_cached; + x25519_ge_p3_to_cached(&peers_mask_cached, &peers_mask); + + ge_p1p1 Q_compl; + ge_p3 Q_ext; + x25519_ge_sub(&Q_compl, &Qstar, &peers_mask_cached); + x25519_ge_p1p1_to_p3(&Q_ext, &Q_compl); + + ge_p2 dh_shared; + x25519_ge_scalarmult(&dh_shared, ctx->private_key, &Q_ext); + + uint8_t dh_shared_encoded[32]; + x25519_ge_tobytes(dh_shared_encoded, &dh_shared); + + SHA512_CTX sha; + SHA512_Init(&sha); + if (ctx->my_role == spake2_role_alice) { + update_with_length_prefix(&sha, ctx->my_name, ctx->my_name_len); + update_with_length_prefix(&sha, ctx->their_name, ctx->their_name_len); + update_with_length_prefix(&sha, ctx->my_msg, sizeof(ctx->my_msg)); + update_with_length_prefix(&sha, their_msg, 32); + } else { + update_with_length_prefix(&sha, ctx->their_name, ctx->their_name_len); + update_with_length_prefix(&sha, ctx->my_name, ctx->my_name_len); + update_with_length_prefix(&sha, their_msg, 32); + update_with_length_prefix(&sha, ctx->my_msg, sizeof(ctx->my_msg)); + } + update_with_length_prefix(&sha, dh_shared_encoded, sizeof(dh_shared_encoded)); + update_with_length_prefix(&sha, ctx->password_hash, + sizeof(ctx->password_hash)); + + uint8_t key[SHA512_DIGEST_LENGTH]; + SHA512_Final(key, &sha); + + size_t to_copy = max_out_key_len; + if (to_copy > sizeof(key)) { + to_copy = sizeof(key); + } + OPENSSL_memcpy(out_key, key, to_copy); + *out_key_len = to_copy; + ctx->state = spake2_state_key_generated; + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c new file mode 100644 index 0000000..0b85183 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c @@ -0,0 +1,217 @@ +/* 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 + + +int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *out_flags) { + *out_flags = 0; + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + BN_CTX_start(ctx); + + int ok = 0; + + // Check |pub_key| is greater than 1. + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL || + !BN_set_word(tmp, 1)) { + goto err; + } + if (BN_cmp(pub_key, tmp) <= 0) { + *out_flags |= DH_CHECK_PUBKEY_TOO_SMALL; + } + + // Check |pub_key| is less than |dh->p| - 1. + if (!BN_copy(tmp, dh->p) || + !BN_sub_word(tmp, 1)) { + goto err; + } + if (BN_cmp(pub_key, tmp) >= 0) { + *out_flags |= DH_CHECK_PUBKEY_TOO_LARGE; + } + + if (dh->q != NULL) { + // Check |pub_key|^|dh->q| is 1 mod |dh->p|. This is necessary for RFC 5114 + // groups which are not safe primes but pick a generator on a prime-order + // subgroup of size |dh->q|. + if (!BN_mod_exp_mont(tmp, pub_key, dh->q, dh->p, ctx, NULL)) { + goto err; + } + if (!BN_is_one(tmp)) { + *out_flags |= DH_CHECK_PUBKEY_INVALID; + } + } + + ok = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ok; +} + + +int DH_check(const DH *dh, int *out_flags) { + // Check that p is a safe prime and if g is 2, 3 or 5, check that it is a + // suitable generator where: + // for 2, p mod 24 == 11 + // for 3, p mod 12 == 5 + // for 5, p mod 10 == 3 or 7 + // should hold. + int ok = 0, r; + BN_CTX *ctx = NULL; + BN_ULONG l; + BIGNUM *t1 = NULL, *t2 = NULL; + + *out_flags = 0; + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + if (t1 == NULL) { + goto err; + } + t2 = BN_CTX_get(ctx); + if (t2 == NULL) { + goto err; + } + + if (dh->q) { + if (BN_cmp(dh->g, BN_value_one()) <= 0) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } else if (BN_cmp(dh->g, dh->p) >= 0) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } else { + // Check g^q == 1 mod p + if (!BN_mod_exp_mont(t1, dh->g, dh->q, dh->p, ctx, NULL)) { + goto err; + } + if (!BN_is_one(t1)) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } + r = BN_is_prime_ex(dh->q, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_Q_NOT_PRIME; + } + // Check p == 1 mod q i.e. q divides p - 1 + if (!BN_div(t1, t2, dh->p, dh->q, ctx)) { + goto err; + } + if (!BN_is_one(t2)) { + *out_flags |= DH_CHECK_INVALID_Q_VALUE; + } + if (dh->j && BN_cmp(dh->j, t1)) { + *out_flags |= DH_CHECK_INVALID_J_VALUE; + } + } else if (BN_is_word(dh->g, DH_GENERATOR_2)) { + l = BN_mod_word(dh->p, 24); + if (l == (BN_ULONG)-1) { + goto err; + } + if (l != 11) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } else if (BN_is_word(dh->g, DH_GENERATOR_5)) { + l = BN_mod_word(dh->p, 10); + if (l == (BN_ULONG)-1) { + goto err; + } + if (l != 3 && l != 7) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } else { + *out_flags |= DH_CHECK_UNABLE_TO_CHECK_GENERATOR; + } + + r = BN_is_prime_ex(dh->p, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_P_NOT_PRIME; + } else if (!dh->q) { + if (!BN_rshift1(t1, dh->p)) { + goto err; + } + r = BN_is_prime_ex(t1, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_P_NOT_SAFE_PRIME; + } + } + ok = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back new file mode 100644 index 0000000..5b6e03a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back @@ -0,0 +1,217 @@ +/* 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 + + +int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *out_flags) { + *out_flags = 0; + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + BN_CTX_start(ctx); + + int ok = 0; + + // Check |pub_key| is greater than 1. + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL || + !BN_set_word(tmp, 1)) { + goto err; + } + if (BN_cmp(pub_key, tmp) <= 0) { + *out_flags |= DH_CHECK_PUBKEY_TOO_SMALL; + } + + // Check |pub_key| is less than |dh->p| - 1. + if (!BN_copy(tmp, dh->p) || + !BN_sub_word(tmp, 1)) { + goto err; + } + if (BN_cmp(pub_key, tmp) >= 0) { + *out_flags |= DH_CHECK_PUBKEY_TOO_LARGE; + } + + if (dh->q != NULL) { + // Check |pub_key|^|dh->q| is 1 mod |dh->p|. This is necessary for RFC 5114 + // groups which are not safe primes but pick a generator on a prime-order + // subgroup of size |dh->q|. + if (!BN_mod_exp_mont(tmp, pub_key, dh->q, dh->p, ctx, NULL)) { + goto err; + } + if (!BN_is_one(tmp)) { + *out_flags |= DH_CHECK_PUBKEY_INVALID; + } + } + + ok = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ok; +} + + +int DH_check(const DH *dh, int *out_flags) { + // Check that p is a safe prime and if g is 2, 3 or 5, check that it is a + // suitable generator where: + // for 2, p mod 24 == 11 + // for 3, p mod 12 == 5 + // for 5, p mod 10 == 3 or 7 + // should hold. + int ok = 0, r; + BN_CTX *ctx = NULL; + BN_ULONG l; + BIGNUM *t1 = NULL, *t2 = NULL; + + *out_flags = 0; + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + if (t1 == NULL) { + goto err; + } + t2 = BN_CTX_get(ctx); + if (t2 == NULL) { + goto err; + } + + if (dh->q) { + if (BN_cmp(dh->g, BN_value_one()) <= 0) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } else if (BN_cmp(dh->g, dh->p) >= 0) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } else { + // Check g^q == 1 mod p + if (!BN_mod_exp_mont(t1, dh->g, dh->q, dh->p, ctx, NULL)) { + goto err; + } + if (!BN_is_one(t1)) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } + r = BN_is_prime_ex(dh->q, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_Q_NOT_PRIME; + } + // Check p == 1 mod q i.e. q divides p - 1 + if (!BN_div(t1, t2, dh->p, dh->q, ctx)) { + goto err; + } + if (!BN_is_one(t2)) { + *out_flags |= DH_CHECK_INVALID_Q_VALUE; + } + if (dh->j && BN_cmp(dh->j, t1)) { + *out_flags |= DH_CHECK_INVALID_J_VALUE; + } + } else if (BN_is_word(dh->g, DH_GENERATOR_2)) { + l = BN_mod_word(dh->p, 24); + if (l == (BN_ULONG)-1) { + goto err; + } + if (l != 11) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } else if (BN_is_word(dh->g, DH_GENERATOR_5)) { + l = BN_mod_word(dh->p, 10); + if (l == (BN_ULONG)-1) { + goto err; + } + if (l != 3 && l != 7) { + *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; + } + } else { + *out_flags |= DH_CHECK_UNABLE_TO_CHECK_GENERATOR; + } + + r = BN_is_prime_ex(dh->p, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_P_NOT_PRIME; + } else if (!dh->q) { + if (!BN_rshift1(t1, dh->p)) { + goto err; + } + r = BN_is_prime_ex(t1, BN_prime_checks_for_validation, ctx, NULL); + if (r < 0) { + goto err; + } + if (!r) { + *out_flags |= DH_CHECK_P_NOT_SAFE_PRIME; + } + } + ok = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c new file mode 100644 index 0000000..65457ff --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c @@ -0,0 +1,518 @@ +/* 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 "../internal.h" + + +#define OPENSSL_DH_MAX_MODULUS_BITS 10000 + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +DH *DH_new(void) { + DH *dh = OPENSSL_malloc(sizeof(DH)); + if (dh == NULL) { + OPENSSL_PUT_ERROR(DH, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(dh, 0, sizeof(DH)); + + CRYPTO_MUTEX_init(&dh->method_mont_p_lock); + + dh->references = 1; + CRYPTO_new_ex_data(&dh->ex_data); + + return dh; +} + +void DH_free(DH *dh) { + if (dh == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&dh->references)) { + return; + } + + CRYPTO_free_ex_data(&g_ex_data_class, dh, &dh->ex_data); + + BN_MONT_CTX_free(dh->method_mont_p); + BN_clear_free(dh->p); + BN_clear_free(dh->g); + BN_clear_free(dh->q); + BN_clear_free(dh->j); + OPENSSL_free(dh->seed); + BN_clear_free(dh->counter); + BN_clear_free(dh->pub_key); + BN_clear_free(dh->priv_key); + CRYPTO_MUTEX_cleanup(&dh->method_mont_p_lock); + + OPENSSL_free(dh); +} + +void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key) { + if (out_pub_key != NULL) { + *out_pub_key = dh->pub_key; + } + if (out_priv_key != NULL) { + *out_priv_key = dh->priv_key; + } +} + +int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { + if (pub_key != NULL) { + BN_free(dh->pub_key); + dh->pub_key = pub_key; + } + + if (priv_key != NULL) { + BN_free(dh->priv_key); + dh->priv_key = priv_key; + } + + return 1; +} + +void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, const BIGNUM **out_q, + const BIGNUM **out_g) { + if (out_p != NULL) { + *out_p = dh->p; + } + if (out_q != NULL) { + *out_q = dh->q; + } + if (out_g != NULL) { + *out_g = dh->g; + } +} + +int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { + if ((dh->p == NULL && p == NULL) || + (dh->g == NULL && g == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(dh->p); + dh->p = p; + } + + if (q != NULL) { + BN_free(dh->q); + dh->q = q; + } + + if (g != NULL) { + BN_free(dh->g); + dh->g = g; + } + + return 1; +} + +int DH_generate_parameters_ex(DH *dh, int prime_bits, int generator, BN_GENCB *cb) { + // We generate DH parameters as follows + // find a prime q which is prime_bits/2 bits long. + // p=(2*q)+1 or (p-1)/2 = q + // For this case, g is a generator if + // g^((p-1)/q) mod p != 1 for values of q which are the factors of p-1. + // Since the factors of p-1 are q and 2, we just need to check + // g^2 mod p != 1 and g^q mod p != 1. + // + // Having said all that, + // there is another special case method for the generators 2, 3 and 5. + // for 2, p mod 24 == 11 + // for 3, p mod 12 == 5 <<<<< does not work for safe primes. + // for 5, p mod 10 == 3 or 7 + // + // Thanks to Phil Karn for the pointers about the + // special generators and for answering some of my questions. + // + // I've implemented the second simple method :-). + // Since DH should be using a safe prime (both p and q are prime), + // this generator function can take a very very long time to run. + + // Actually there is no reason to insist that 'generator' be a generator. + // It's just as OK (and in some sense better) to use a generator of the + // order-q subgroup. + + BIGNUM *t1, *t2; + int g, ok = 0; + BN_CTX *ctx = NULL; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + t2 = BN_CTX_get(ctx); + if (t1 == NULL || t2 == NULL) { + goto err; + } + + // Make sure |dh| has the necessary elements + if (dh->p == NULL) { + dh->p = BN_new(); + if (dh->p == NULL) { + goto err; + } + } + if (dh->g == NULL) { + dh->g = BN_new(); + if (dh->g == NULL) { + goto err; + } + } + + if (generator <= 1) { + OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + goto err; + } + if (generator == DH_GENERATOR_2) { + if (!BN_set_word(t1, 24)) { + goto err; + } + if (!BN_set_word(t2, 11)) { + goto err; + } + g = 2; + } else if (generator == DH_GENERATOR_5) { + if (!BN_set_word(t1, 10)) { + goto err; + } + if (!BN_set_word(t2, 3)) { + goto err; + } + // BN_set_word(t3,7); just have to miss + // out on these ones :-( + g = 5; + } else { + // in the general case, don't worry if 'generator' is a + // generator or not: since we are using safe primes, + // it will generate either an order-q or an order-2q group, + // which both is OK + if (!BN_set_word(t1, 2)) { + goto err; + } + if (!BN_set_word(t2, 1)) { + goto err; + } + g = generator; + } + + if (!BN_generate_prime_ex(dh->p, prime_bits, 1, t1, t2, cb)) { + goto err; + } + if (!BN_GENCB_call(cb, 3, 0)) { + goto err; + } + if (!BN_set_word(dh->g, g)) { + goto err; + } + ok = 1; + +err: + if (!ok) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + } + + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + return ok; +} + +int DH_generate_key(DH *dh) { + int ok = 0; + int generate_new_key = 0; + BN_CTX *ctx = NULL; + BIGNUM *pub_key = NULL, *priv_key = NULL; + + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DH, DH_R_MODULUS_TOO_LARGE); + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + if (dh->priv_key == NULL) { + priv_key = BN_new(); + if (priv_key == NULL) { + goto err; + } + generate_new_key = 1; + } else { + priv_key = dh->priv_key; + } + + if (dh->pub_key == NULL) { + pub_key = BN_new(); + if (pub_key == NULL) { + goto err; + } + } else { + pub_key = dh->pub_key; + } + + if (!BN_MONT_CTX_set_locked(&dh->method_mont_p, &dh->method_mont_p_lock, + dh->p, ctx)) { + goto err; + } + + if (generate_new_key) { + if (dh->q) { + if (!BN_rand_range_ex(priv_key, 2, dh->q)) { + goto err; + } + } else { + // secret exponent length + unsigned priv_bits = dh->priv_length; + if (priv_bits == 0) { + const unsigned p_bits = BN_num_bits(dh->p); + if (p_bits == 0) { + goto err; + } + + priv_bits = p_bits - 1; + } + + if (!BN_rand(priv_key, priv_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) { + goto err; + } + } + } + + if (!BN_mod_exp_mont_consttime(pub_key, dh->g, priv_key, dh->p, ctx, + dh->method_mont_p)) { + goto err; + } + + dh->pub_key = pub_key; + dh->priv_key = priv_key; + ok = 1; + +err: + if (ok != 1) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + } + + if (dh->pub_key == NULL) { + BN_free(pub_key); + } + if (dh->priv_key == NULL) { + BN_free(priv_key); + } + BN_CTX_free(ctx); + return ok; +} + +int DH_compute_key(unsigned char *out, const BIGNUM *peers_key, DH *dh) { + BN_CTX *ctx = NULL; + BIGNUM *shared_key; + int ret = -1; + int check_result; + + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DH, DH_R_MODULUS_TOO_LARGE); + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + shared_key = BN_CTX_get(ctx); + if (shared_key == NULL) { + goto err; + } + + if (dh->priv_key == NULL) { + OPENSSL_PUT_ERROR(DH, DH_R_NO_PRIVATE_VALUE); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&dh->method_mont_p, &dh->method_mont_p_lock, + dh->p, ctx)) { + goto err; + } + + if (!DH_check_pub_key(dh, peers_key, &check_result) || check_result) { + OPENSSL_PUT_ERROR(DH, DH_R_INVALID_PUBKEY); + goto err; + } + + if (!BN_mod_exp_mont_consttime(shared_key, peers_key, dh->priv_key, dh->p, + ctx, dh->method_mont_p)) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + goto err; + } + + ret = BN_bn2bin(shared_key, out); + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + return ret; +} + +int DH_size(const DH *dh) { return BN_num_bytes(dh->p); } + +unsigned DH_num_bits(const DH *dh) { return BN_num_bits(dh->p); } + +int DH_up_ref(DH *dh) { + CRYPTO_refcount_inc(&dh->references); + return 1; +} + +static int int_dh_bn_cpy(BIGNUM **dst, const BIGNUM *src) { + BIGNUM *a = NULL; + + if (src) { + a = BN_dup(src); + if (!a) { + return 0; + } + } + + BN_free(*dst); + *dst = a; + return 1; +} + +static int int_dh_param_copy(DH *to, const DH *from, int is_x942) { + if (is_x942 == -1) { + is_x942 = !!from->q; + } + if (!int_dh_bn_cpy(&to->p, from->p) || + !int_dh_bn_cpy(&to->g, from->g)) { + return 0; + } + + if (!is_x942) { + return 1; + } + + if (!int_dh_bn_cpy(&to->q, from->q) || + !int_dh_bn_cpy(&to->j, from->j)) { + return 0; + } + + OPENSSL_free(to->seed); + to->seed = NULL; + to->seedlen = 0; + + if (from->seed) { + to->seed = OPENSSL_memdup(from->seed, from->seedlen); + if (!to->seed) { + return 0; + } + to->seedlen = from->seedlen; + } + + return 1; +} + +DH *DHparams_dup(const DH *dh) { + DH *ret = DH_new(); + if (!ret) { + return NULL; + } + + if (!int_dh_param_copy(ret, dh, -1)) { + DH_free(ret); + return NULL; + } + + return ret; +} + +int DH_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int DH_set_ex_data(DH *d, int idx, void *arg) { + return CRYPTO_set_ex_data(&d->ex_data, idx, arg); +} + +void *DH_get_ex_data(DH *d, int idx) { + return CRYPTO_get_ex_data(&d->ex_data, idx); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back new file mode 100644 index 0000000..68d710d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back @@ -0,0 +1,518 @@ +/* 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 "../internal.h" + + +#define OPENSSL_DH_MAX_MODULUS_BITS 10000 + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +DH *DH_new(void) { + DH *dh = OPENSSL_malloc(sizeof(DH)); + if (dh == NULL) { + OPENSSL_PUT_ERROR(DH, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(dh, 0, sizeof(DH)); + + CRYPTO_MUTEX_init(&dh->method_mont_p_lock); + + dh->references = 1; + CRYPTO_new_ex_data(&dh->ex_data); + + return dh; +} + +void DH_free(DH *dh) { + if (dh == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&dh->references)) { + return; + } + + CRYPTO_free_ex_data(&g_ex_data_class, dh, &dh->ex_data); + + BN_MONT_CTX_free(dh->method_mont_p); + BN_clear_free(dh->p); + BN_clear_free(dh->g); + BN_clear_free(dh->q); + BN_clear_free(dh->j); + OPENSSL_free(dh->seed); + BN_clear_free(dh->counter); + BN_clear_free(dh->pub_key); + BN_clear_free(dh->priv_key); + CRYPTO_MUTEX_cleanup(&dh->method_mont_p_lock); + + OPENSSL_free(dh); +} + +void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key) { + if (out_pub_key != NULL) { + *out_pub_key = dh->pub_key; + } + if (out_priv_key != NULL) { + *out_priv_key = dh->priv_key; + } +} + +int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { + if (pub_key != NULL) { + BN_free(dh->pub_key); + dh->pub_key = pub_key; + } + + if (priv_key != NULL) { + BN_free(dh->priv_key); + dh->priv_key = priv_key; + } + + return 1; +} + +void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, const BIGNUM **out_q, + const BIGNUM **out_g) { + if (out_p != NULL) { + *out_p = dh->p; + } + if (out_q != NULL) { + *out_q = dh->q; + } + if (out_g != NULL) { + *out_g = dh->g; + } +} + +int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { + if ((dh->p == NULL && p == NULL) || + (dh->g == NULL && g == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(dh->p); + dh->p = p; + } + + if (q != NULL) { + BN_free(dh->q); + dh->q = q; + } + + if (g != NULL) { + BN_free(dh->g); + dh->g = g; + } + + return 1; +} + +int DH_generate_parameters_ex(DH *dh, int prime_bits, int generator, BN_GENCB *cb) { + // We generate DH parameters as follows + // find a prime q which is prime_bits/2 bits long. + // p=(2*q)+1 or (p-1)/2 = q + // For this case, g is a generator if + // g^((p-1)/q) mod p != 1 for values of q which are the factors of p-1. + // Since the factors of p-1 are q and 2, we just need to check + // g^2 mod p != 1 and g^q mod p != 1. + // + // Having said all that, + // there is another special case method for the generators 2, 3 and 5. + // for 2, p mod 24 == 11 + // for 3, p mod 12 == 5 <<<<< does not work for safe primes. + // for 5, p mod 10 == 3 or 7 + // + // Thanks to Phil Karn for the pointers about the + // special generators and for answering some of my questions. + // + // I've implemented the second simple method :-). + // Since DH should be using a safe prime (both p and q are prime), + // this generator function can take a very very long time to run. + + // Actually there is no reason to insist that 'generator' be a generator. + // It's just as OK (and in some sense better) to use a generator of the + // order-q subgroup. + + BIGNUM *t1, *t2; + int g, ok = 0; + BN_CTX *ctx = NULL; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + t2 = BN_CTX_get(ctx); + if (t1 == NULL || t2 == NULL) { + goto err; + } + + // Make sure |dh| has the necessary elements + if (dh->p == NULL) { + dh->p = BN_new(); + if (dh->p == NULL) { + goto err; + } + } + if (dh->g == NULL) { + dh->g = BN_new(); + if (dh->g == NULL) { + goto err; + } + } + + if (generator <= 1) { + OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + goto err; + } + if (generator == DH_GENERATOR_2) { + if (!BN_set_word(t1, 24)) { + goto err; + } + if (!BN_set_word(t2, 11)) { + goto err; + } + g = 2; + } else if (generator == DH_GENERATOR_5) { + if (!BN_set_word(t1, 10)) { + goto err; + } + if (!BN_set_word(t2, 3)) { + goto err; + } + // BN_set_word(t3,7); just have to miss + // out on these ones :-( + g = 5; + } else { + // in the general case, don't worry if 'generator' is a + // generator or not: since we are using safe primes, + // it will generate either an order-q or an order-2q group, + // which both is OK + if (!BN_set_word(t1, 2)) { + goto err; + } + if (!BN_set_word(t2, 1)) { + goto err; + } + g = generator; + } + + if (!BN_generate_prime_ex(dh->p, prime_bits, 1, t1, t2, cb)) { + goto err; + } + if (!BN_GENCB_call(cb, 3, 0)) { + goto err; + } + if (!BN_set_word(dh->g, g)) { + goto err; + } + ok = 1; + +err: + if (!ok) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + } + + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + return ok; +} + +int DH_generate_key(DH *dh) { + int ok = 0; + int generate_new_key = 0; + BN_CTX *ctx = NULL; + BIGNUM *pub_key = NULL, *priv_key = NULL; + + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DH, DH_R_MODULUS_TOO_LARGE); + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + if (dh->priv_key == NULL) { + priv_key = BN_new(); + if (priv_key == NULL) { + goto err; + } + generate_new_key = 1; + } else { + priv_key = dh->priv_key; + } + + if (dh->pub_key == NULL) { + pub_key = BN_new(); + if (pub_key == NULL) { + goto err; + } + } else { + pub_key = dh->pub_key; + } + + if (!BN_MONT_CTX_set_locked(&dh->method_mont_p, &dh->method_mont_p_lock, + dh->p, ctx)) { + goto err; + } + + if (generate_new_key) { + if (dh->q) { + if (!BN_rand_range_ex(priv_key, 2, dh->q)) { + goto err; + } + } else { + // secret exponent length + unsigned priv_bits = dh->priv_length; + if (priv_bits == 0) { + const unsigned p_bits = BN_num_bits(dh->p); + if (p_bits == 0) { + goto err; + } + + priv_bits = p_bits - 1; + } + + if (!BN_rand(priv_key, priv_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) { + goto err; + } + } + } + + if (!BN_mod_exp_mont_consttime(pub_key, dh->g, priv_key, dh->p, ctx, + dh->method_mont_p)) { + goto err; + } + + dh->pub_key = pub_key; + dh->priv_key = priv_key; + ok = 1; + +err: + if (ok != 1) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + } + + if (dh->pub_key == NULL) { + BN_free(pub_key); + } + if (dh->priv_key == NULL) { + BN_free(priv_key); + } + BN_CTX_free(ctx); + return ok; +} + +int DH_compute_key(unsigned char *out, const BIGNUM *peers_key, DH *dh) { + BN_CTX *ctx = NULL; + BIGNUM *shared_key; + int ret = -1; + int check_result; + + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DH, DH_R_MODULUS_TOO_LARGE); + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + shared_key = BN_CTX_get(ctx); + if (shared_key == NULL) { + goto err; + } + + if (dh->priv_key == NULL) { + OPENSSL_PUT_ERROR(DH, DH_R_NO_PRIVATE_VALUE); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&dh->method_mont_p, &dh->method_mont_p_lock, + dh->p, ctx)) { + goto err; + } + + if (!DH_check_pub_key(dh, peers_key, &check_result) || check_result) { + OPENSSL_PUT_ERROR(DH, DH_R_INVALID_PUBKEY); + goto err; + } + + if (!BN_mod_exp_mont_consttime(shared_key, peers_key, dh->priv_key, dh->p, + ctx, dh->method_mont_p)) { + OPENSSL_PUT_ERROR(DH, ERR_R_BN_LIB); + goto err; + } + + ret = BN_bn2bin(shared_key, out); + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + return ret; +} + +int DH_size(const DH *dh) { return BN_num_bytes(dh->p); } + +unsigned DH_num_bits(const DH *dh) { return BN_num_bits(dh->p); } + +int DH_up_ref(DH *dh) { + CRYPTO_refcount_inc(&dh->references); + return 1; +} + +static int int_dh_bn_cpy(BIGNUM **dst, const BIGNUM *src) { + BIGNUM *a = NULL; + + if (src) { + a = BN_dup(src); + if (!a) { + return 0; + } + } + + BN_free(*dst); + *dst = a; + return 1; +} + +static int int_dh_param_copy(DH *to, const DH *from, int is_x942) { + if (is_x942 == -1) { + is_x942 = !!from->q; + } + if (!int_dh_bn_cpy(&to->p, from->p) || + !int_dh_bn_cpy(&to->g, from->g)) { + return 0; + } + + if (!is_x942) { + return 1; + } + + if (!int_dh_bn_cpy(&to->q, from->q) || + !int_dh_bn_cpy(&to->j, from->j)) { + return 0; + } + + OPENSSL_free(to->seed); + to->seed = NULL; + to->seedlen = 0; + + if (from->seed) { + to->seed = OPENSSL_memdup(from->seed, from->seedlen); + if (!to->seed) { + return 0; + } + to->seedlen = from->seedlen; + } + + return 1; +} + +DH *DHparams_dup(const DH *dh) { + DH *ret = DH_new(); + if (!ret) { + return NULL; + } + + if (!int_dh_param_copy(ret, dh, -1)) { + DH_free(ret); + return NULL; + } + + return ret; +} + +int DH_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int DH_set_ex_data(DH *d, int idx, void *arg) { + return CRYPTO_set_ex_data(&d->ex_data, idx, arg); +} + +void *DH_get_ex_data(DH *d, int idx) { + return CRYPTO_get_ex_data(&d->ex_data, idx); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c new file mode 100644 index 0000000..2f40cd4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c @@ -0,0 +1,160 @@ +/* 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). */ + +#include + +#include +#include + +#include +#include +#include + +#include "../bytestring/internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // A DH object may be missing some components. + OPENSSL_PUT_ERROR(DH, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +DH *DH_parse_parameters(CBS *cbs) { + DH *ret = DH_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->g)) { + goto err; + } + + uint64_t priv_length; + if (CBS_len(&child) != 0) { + if (!CBS_get_asn1_uint64(&child, &priv_length) || + priv_length > UINT_MAX) { + goto err; + } + ret->priv_length = (unsigned)priv_length; + } + + if (CBS_len(&child) != 0) { + goto err; + } + + return ret; + +err: + OPENSSL_PUT_ERROR(DH, DH_R_DECODE_ERROR); + DH_free(ret); + return NULL; +} + +int DH_marshal_parameters(CBB *cbb, const DH *dh) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dh->p) || + !marshal_integer(&child, dh->g) || + (dh->priv_length != 0 && + !CBB_add_asn1_uint64(&child, dh->priv_length)) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DH, DH_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DH *d2i_DHparams(DH **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DH *ret = DH_parse_parameters(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DH_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DHparams(const DH *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DH_marshal_parameters(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c.grpc_back new file mode 100644 index 0000000..9d32180 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c.grpc_back @@ -0,0 +1,160 @@ +/* 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). */ + +#include + +#include +#include + +#include +#include +#include + +#include "../bytestring/internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // A DH object may be missing some components. + OPENSSL_PUT_ERROR(DH, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +DH *DH_parse_parameters(CBS *cbs) { + DH *ret = DH_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->g)) { + goto err; + } + + uint64_t priv_length; + if (CBS_len(&child) != 0) { + if (!CBS_get_asn1_uint64(&child, &priv_length) || + priv_length > UINT_MAX) { + goto err; + } + ret->priv_length = (unsigned)priv_length; + } + + if (CBS_len(&child) != 0) { + goto err; + } + + return ret; + +err: + OPENSSL_PUT_ERROR(DH, DH_R_DECODE_ERROR); + DH_free(ret); + return NULL; +} + +int DH_marshal_parameters(CBB *cbb, const DH *dh) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dh->p) || + !marshal_integer(&child, dh->g) || + (dh->priv_length != 0 && + !CBB_add_asn1_uint64(&child, dh->priv_length)) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DH, DH_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DH *d2i_DHparams(DH **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DH *ret = DH_parse_parameters(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DH_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DHparams(const DH *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DH_marshal_parameters(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c new file mode 100644 index 0000000..c583653 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c @@ -0,0 +1,93 @@ +/* ==================================================================== + * 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 + * 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 "../fipsmodule/bn/internal.h" + + +BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *ret) { + static const BN_ULONG kPrime1536Data[] = { + TOBN(0xffffffff, 0xffffffff), TOBN(0xf1746c08, 0xca237327), + TOBN(0x670c354e, 0x4abc9804), TOBN(0x9ed52907, 0x7096966d), + TOBN(0x1c62f356, 0x208552bb), TOBN(0x83655d23, 0xdca3ad96), + TOBN(0x69163fa8, 0xfd24cf5f), TOBN(0x98da4836, 0x1c55d39a), + TOBN(0xc2007cb8, 0xa163bf05), TOBN(0x49286651, 0xece45b3d), + TOBN(0xae9f2411, 0x7c4b1fe6), TOBN(0xee386bfb, 0x5a899fa5), + TOBN(0x0bff5cb6, 0xf406b7ed), TOBN(0xf44c42e9, 0xa637ed6b), + TOBN(0xe485b576, 0x625e7ec6), TOBN(0x4fe1356d, 0x6d51c245), + TOBN(0x302b0a6d, 0xf25f1437), TOBN(0xef9519b3, 0xcd3a431b), + TOBN(0x514a0879, 0x8e3404dd), TOBN(0x020bbea6, 0x3b139b22), + TOBN(0x29024e08, 0x8a67cc74), TOBN(0xc4c6628b, 0x80dc1cd1), + TOBN(0xc90fdaa2, 0x2168c234), TOBN(0xffffffff, 0xffffffff), + }; + + static const BIGNUM kPrime1536BN = STATIC_BIGNUM(kPrime1536Data); + + BIGNUM *alloc = NULL; + if (ret == NULL) { + alloc = BN_new(); + if (alloc == NULL) { + return NULL; + } + ret = alloc; + } + + if (!BN_copy(ret, &kPrime1536BN)) { + BN_free(alloc); + return NULL; + } + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c.grpc_back new file mode 100644 index 0000000..3336029 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dh/params.c.grpc_back @@ -0,0 +1,93 @@ +/* ==================================================================== + * 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 + * 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 "../fipsmodule/bn/internal.h" + + +BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *ret) { + static const BN_ULONG kPrime1536Data[] = { + TOBN(0xffffffff, 0xffffffff), TOBN(0xf1746c08, 0xca237327), + TOBN(0x670c354e, 0x4abc9804), TOBN(0x9ed52907, 0x7096966d), + TOBN(0x1c62f356, 0x208552bb), TOBN(0x83655d23, 0xdca3ad96), + TOBN(0x69163fa8, 0xfd24cf5f), TOBN(0x98da4836, 0x1c55d39a), + TOBN(0xc2007cb8, 0xa163bf05), TOBN(0x49286651, 0xece45b3d), + TOBN(0xae9f2411, 0x7c4b1fe6), TOBN(0xee386bfb, 0x5a899fa5), + TOBN(0x0bff5cb6, 0xf406b7ed), TOBN(0xf44c42e9, 0xa637ed6b), + TOBN(0xe485b576, 0x625e7ec6), TOBN(0x4fe1356d, 0x6d51c245), + TOBN(0x302b0a6d, 0xf25f1437), TOBN(0xef9519b3, 0xcd3a431b), + TOBN(0x514a0879, 0x8e3404dd), TOBN(0x020bbea6, 0x3b139b22), + TOBN(0x29024e08, 0x8a67cc74), TOBN(0xc4c6628b, 0x80dc1cd1), + TOBN(0xc90fdaa2, 0x2168c234), TOBN(0xffffffff, 0xffffffff), + }; + + static const BIGNUM kPrime1536BN = STATIC_BIGNUM(kPrime1536Data); + + BIGNUM *alloc = NULL; + if (ret == NULL) { + alloc = BN_new(); + if (alloc == NULL) { + return NULL; + } + ret = alloc; + } + + if (!BN_copy(ret, &kPrime1536BN)) { + BN_free(alloc); + return NULL; + } + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c new file mode 100644 index 0000000..1f49263 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c @@ -0,0 +1,240 @@ +/* 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 "../internal.h" + + +struct nid_to_digest { + int nid; + const EVP_MD* (*md_func)(void); + const char *short_name; + const char *long_name; +}; + +static const struct nid_to_digest nid_to_digest_mapping[] = { + {NID_md4, EVP_md4, SN_md4, LN_md4}, + {NID_md5, EVP_md5, SN_md5, LN_md5}, + {NID_sha1, EVP_sha1, SN_sha1, LN_sha1}, + {NID_sha224, EVP_sha224, SN_sha224, LN_sha224}, + {NID_sha256, EVP_sha256, SN_sha256, LN_sha256}, + {NID_sha384, EVP_sha384, SN_sha384, LN_sha384}, + {NID_sha512, EVP_sha512, SN_sha512, LN_sha512}, + {NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1}, + // As a remnant of signing |EVP_MD|s, OpenSSL returned the corresponding + // hash function when given a signature OID. To avoid unintended lax parsing + // of hash OIDs, this is no longer supported for lookup by OID or NID. + // Node.js, however, exposes |EVP_get_digestbyname|'s full behavior to + // consumers so we retain it there. + {NID_undef, EVP_sha1, SN_dsaWithSHA, LN_dsaWithSHA}, + {NID_undef, EVP_sha1, SN_dsaWithSHA1, LN_dsaWithSHA1}, + {NID_undef, EVP_sha1, SN_ecdsa_with_SHA1, NULL}, + {NID_undef, EVP_md5, SN_md5WithRSAEncryption, LN_md5WithRSAEncryption}, + {NID_undef, EVP_sha1, SN_sha1WithRSAEncryption, LN_sha1WithRSAEncryption}, + {NID_undef, EVP_sha224, SN_sha224WithRSAEncryption, + LN_sha224WithRSAEncryption}, + {NID_undef, EVP_sha256, SN_sha256WithRSAEncryption, + LN_sha256WithRSAEncryption}, + {NID_undef, EVP_sha384, SN_sha384WithRSAEncryption, + LN_sha384WithRSAEncryption}, + {NID_undef, EVP_sha512, SN_sha512WithRSAEncryption, + LN_sha512WithRSAEncryption}, +}; + +const EVP_MD* EVP_get_digestbynid(int nid) { + if (nid == NID_undef) { + // Skip the |NID_undef| entries in |nid_to_digest_mapping|. + return NULL; + } + + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(nid_to_digest_mapping); i++) { + if (nid_to_digest_mapping[i].nid == nid) { + return nid_to_digest_mapping[i].md_func(); + } + } + + return NULL; +} + +static const struct { + uint8_t oid[9]; + uint8_t oid_len; + int nid; +} kMDOIDs[] = { + // 1.2.840.113549.2.4 + { {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x04}, 8, NID_md4 }, + // 1.2.840.113549.2.5 + { {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05}, 8, NID_md5 }, + // 1.3.14.3.2.26 + { {0x2b, 0x0e, 0x03, 0x02, 0x1a}, 5, NID_sha1 }, + // 2.16.840.1.101.3.4.2.1 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01}, 9, NID_sha256 }, + // 2.16.840.1.101.3.4.2.2 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02}, 9, NID_sha384 }, + // 2.16.840.1.101.3.4.2.3 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03}, 9, NID_sha512 }, + // 2.16.840.1.101.3.4.2.4 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04}, 9, NID_sha224 }, +}; + +static const EVP_MD *cbs_to_md(const CBS *cbs) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMDOIDs); i++) { + if (CBS_len(cbs) == kMDOIDs[i].oid_len && + OPENSSL_memcmp(CBS_data(cbs), kMDOIDs[i].oid, kMDOIDs[i].oid_len) == + 0) { + return EVP_get_digestbynid(kMDOIDs[i].nid); + } + } + + return NULL; +} + +const EVP_MD *EVP_get_digestbyobj(const ASN1_OBJECT *obj) { + // Handle objects with no corresponding OID. + if (obj->nid != NID_undef) { + return EVP_get_digestbynid(obj->nid); + } + + CBS cbs; + CBS_init(&cbs, obj->data, obj->length); + return cbs_to_md(&cbs); +} + +const EVP_MD *EVP_parse_digest_algorithm(CBS *cbs) { + CBS algorithm, oid; + if (!CBS_get_asn1(cbs, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&algorithm, &oid, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_DECODE_ERROR); + return NULL; + } + + const EVP_MD *ret = cbs_to_md(&oid); + if (ret == NULL) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_UNKNOWN_HASH); + return NULL; + } + + // The parameters, if present, must be NULL. Historically, whether the NULL + // was included or omitted was not well-specified. When parsing an + // AlgorithmIdentifier, we allow both. (Note this code is not used when + // verifying RSASSA-PKCS1-v1_5 signatures.) + if (CBS_len(&algorithm) > 0) { + CBS param; + if (!CBS_get_asn1(&algorithm, ¶m, CBS_ASN1_NULL) || + CBS_len(¶m) != 0 || + CBS_len(&algorithm) != 0) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_DECODE_ERROR); + return NULL; + } + } + + return ret; +} + +int EVP_marshal_digest_algorithm(CBB *cbb, const EVP_MD *md) { + CBB algorithm, oid, null; + if (!CBB_add_asn1(cbb, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + int found = 0; + int nid = EVP_MD_type(md); + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMDOIDs); i++) { + if (nid == kMDOIDs[i].nid) { + if (!CBB_add_bytes(&oid, kMDOIDs[i].oid, kMDOIDs[i].oid_len)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + found = 1; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_UNKNOWN_HASH); + return 0; + } + + if (!CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + return 1; +} + +const EVP_MD *EVP_get_digestbyname(const char *name) { + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(nid_to_digest_mapping); i++) { + const char *short_name = nid_to_digest_mapping[i].short_name; + const char *long_name = nid_to_digest_mapping[i].long_name; + if ((short_name && strcmp(short_name, name) == 0) || + (long_name && strcmp(long_name, name) == 0)) { + return nid_to_digest_mapping[i].md_func(); + } + } + + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c.grpc_back new file mode 100644 index 0000000..4b4bb38 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c.grpc_back @@ -0,0 +1,240 @@ +/* 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 "../internal.h" + + +struct nid_to_digest { + int nid; + const EVP_MD* (*md_func)(void); + const char *short_name; + const char *long_name; +}; + +static const struct nid_to_digest nid_to_digest_mapping[] = { + {NID_md4, EVP_md4, SN_md4, LN_md4}, + {NID_md5, EVP_md5, SN_md5, LN_md5}, + {NID_sha1, EVP_sha1, SN_sha1, LN_sha1}, + {NID_sha224, EVP_sha224, SN_sha224, LN_sha224}, + {NID_sha256, EVP_sha256, SN_sha256, LN_sha256}, + {NID_sha384, EVP_sha384, SN_sha384, LN_sha384}, + {NID_sha512, EVP_sha512, SN_sha512, LN_sha512}, + {NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1}, + // As a remnant of signing |EVP_MD|s, OpenSSL returned the corresponding + // hash function when given a signature OID. To avoid unintended lax parsing + // of hash OIDs, this is no longer supported for lookup by OID or NID. + // Node.js, however, exposes |EVP_get_digestbyname|'s full behavior to + // consumers so we retain it there. + {NID_undef, EVP_sha1, SN_dsaWithSHA, LN_dsaWithSHA}, + {NID_undef, EVP_sha1, SN_dsaWithSHA1, LN_dsaWithSHA1}, + {NID_undef, EVP_sha1, SN_ecdsa_with_SHA1, NULL}, + {NID_undef, EVP_md5, SN_md5WithRSAEncryption, LN_md5WithRSAEncryption}, + {NID_undef, EVP_sha1, SN_sha1WithRSAEncryption, LN_sha1WithRSAEncryption}, + {NID_undef, EVP_sha224, SN_sha224WithRSAEncryption, + LN_sha224WithRSAEncryption}, + {NID_undef, EVP_sha256, SN_sha256WithRSAEncryption, + LN_sha256WithRSAEncryption}, + {NID_undef, EVP_sha384, SN_sha384WithRSAEncryption, + LN_sha384WithRSAEncryption}, + {NID_undef, EVP_sha512, SN_sha512WithRSAEncryption, + LN_sha512WithRSAEncryption}, +}; + +const EVP_MD* EVP_get_digestbynid(int nid) { + if (nid == NID_undef) { + // Skip the |NID_undef| entries in |nid_to_digest_mapping|. + return NULL; + } + + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(nid_to_digest_mapping); i++) { + if (nid_to_digest_mapping[i].nid == nid) { + return nid_to_digest_mapping[i].md_func(); + } + } + + return NULL; +} + +static const struct { + uint8_t oid[9]; + uint8_t oid_len; + int nid; +} kMDOIDs[] = { + // 1.2.840.113549.2.4 + { {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x04}, 8, NID_md4 }, + // 1.2.840.113549.2.5 + { {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05}, 8, NID_md5 }, + // 1.3.14.3.2.26 + { {0x2b, 0x0e, 0x03, 0x02, 0x1a}, 5, NID_sha1 }, + // 2.16.840.1.101.3.4.2.1 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01}, 9, NID_sha256 }, + // 2.16.840.1.101.3.4.2.2 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02}, 9, NID_sha384 }, + // 2.16.840.1.101.3.4.2.3 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03}, 9, NID_sha512 }, + // 2.16.840.1.101.3.4.2.4 + { {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04}, 9, NID_sha224 }, +}; + +static const EVP_MD *cbs_to_md(const CBS *cbs) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMDOIDs); i++) { + if (CBS_len(cbs) == kMDOIDs[i].oid_len && + OPENSSL_memcmp(CBS_data(cbs), kMDOIDs[i].oid, kMDOIDs[i].oid_len) == + 0) { + return EVP_get_digestbynid(kMDOIDs[i].nid); + } + } + + return NULL; +} + +const EVP_MD *EVP_get_digestbyobj(const ASN1_OBJECT *obj) { + // Handle objects with no corresponding OID. + if (obj->nid != NID_undef) { + return EVP_get_digestbynid(obj->nid); + } + + CBS cbs; + CBS_init(&cbs, obj->data, obj->length); + return cbs_to_md(&cbs); +} + +const EVP_MD *EVP_parse_digest_algorithm(CBS *cbs) { + CBS algorithm, oid; + if (!CBS_get_asn1(cbs, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&algorithm, &oid, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_DECODE_ERROR); + return NULL; + } + + const EVP_MD *ret = cbs_to_md(&oid); + if (ret == NULL) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_UNKNOWN_HASH); + return NULL; + } + + // The parameters, if present, must be NULL. Historically, whether the NULL + // was included or omitted was not well-specified. When parsing an + // AlgorithmIdentifier, we allow both. (Note this code is not used when + // verifying RSASSA-PKCS1-v1_5 signatures.) + if (CBS_len(&algorithm) > 0) { + CBS param; + if (!CBS_get_asn1(&algorithm, ¶m, CBS_ASN1_NULL) || + CBS_len(¶m) != 0 || + CBS_len(&algorithm) != 0) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_DECODE_ERROR); + return NULL; + } + } + + return ret; +} + +int EVP_marshal_digest_algorithm(CBB *cbb, const EVP_MD *md) { + CBB algorithm, oid, null; + if (!CBB_add_asn1(cbb, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + int found = 0; + int nid = EVP_MD_type(md); + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMDOIDs); i++) { + if (nid == kMDOIDs[i].nid) { + if (!CBB_add_bytes(&oid, kMDOIDs[i].oid, kMDOIDs[i].oid_len)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + found = 1; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_UNKNOWN_HASH); + return 0; + } + + if (!CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + return 1; +} + +const EVP_MD *EVP_get_digestbyname(const char *name) { + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(nid_to_digest_mapping); i++) { + const char *short_name = nid_to_digest_mapping[i].short_name; + const char *long_name = nid_to_digest_mapping[i].long_name; + if ((short_name && strcmp(short_name, name) == 0) || + (long_name && strcmp(long_name, name) == 0)) { + return nid_to_digest_mapping[i].md_func(); + } + } + + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c new file mode 100644 index 0000000..da0931d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c @@ -0,0 +1,970 @@ +/* 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 . */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../fipsmodule/bn/internal.h" +#include "../internal.h" + + +#define OPENSSL_DSA_MAX_MODULUS_BITS 10000 + +// Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of +// Miller-Rabin. +#define DSS_prime_checks 50 + +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, + BIGNUM **out_r); + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +DSA *DSA_new(void) { + DSA *dsa = OPENSSL_malloc(sizeof(DSA)); + if (dsa == NULL) { + OPENSSL_PUT_ERROR(DSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(dsa, 0, sizeof(DSA)); + + dsa->references = 1; + + CRYPTO_MUTEX_init(&dsa->method_mont_lock); + CRYPTO_new_ex_data(&dsa->ex_data); + + return dsa; +} + +void DSA_free(DSA *dsa) { + if (dsa == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&dsa->references)) { + return; + } + + CRYPTO_free_ex_data(&g_ex_data_class, dsa, &dsa->ex_data); + + BN_clear_free(dsa->p); + BN_clear_free(dsa->q); + BN_clear_free(dsa->g); + BN_clear_free(dsa->pub_key); + BN_clear_free(dsa->priv_key); + BN_MONT_CTX_free(dsa->method_mont_p); + BN_MONT_CTX_free(dsa->method_mont_q); + CRYPTO_MUTEX_cleanup(&dsa->method_mont_lock); + OPENSSL_free(dsa); +} + +int DSA_up_ref(DSA *dsa) { + CRYPTO_refcount_inc(&dsa->references); + return 1; +} + +void DSA_get0_key(const DSA *dsa, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key) { + if (out_pub_key != NULL) { + *out_pub_key = dsa->pub_key; + } + if (out_priv_key != NULL) { + *out_priv_key = dsa->priv_key; + } +} + +void DSA_get0_pqg(const DSA *dsa, const BIGNUM **out_p, const BIGNUM **out_q, + const BIGNUM **out_g) { + if (out_p != NULL) { + *out_p = dsa->p; + } + if (out_q != NULL) { + *out_q = dsa->q; + } + if (out_g != NULL) { + *out_g = dsa->g; + } +} + +int DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key) { + if (dsa->pub_key == NULL && pub_key == NULL) { + return 0; + } + + if (pub_key != NULL) { + BN_free(dsa->pub_key); + dsa->pub_key = pub_key; + } + if (priv_key != NULL) { + BN_free(dsa->priv_key); + dsa->priv_key = priv_key; + } + + return 1; +} + +int DSA_set0_pqg(DSA *dsa, BIGNUM *p, BIGNUM *q, BIGNUM *g) { + if ((dsa->p == NULL && p == NULL) || + (dsa->q == NULL && q == NULL) || + (dsa->g == NULL && g == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(dsa->p); + dsa->p = p; + } + if (q != NULL) { + BN_free(dsa->q); + dsa->q = q; + } + if (g != NULL) { + BN_free(dsa->g); + dsa->g = g; + } + + return 1; +} + +int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, + size_t seed_len, int *out_counter, + unsigned long *out_h, BN_GENCB *cb) { + int ok = 0; + unsigned char seed[SHA256_DIGEST_LENGTH]; + unsigned char md[SHA256_DIGEST_LENGTH]; + unsigned char buf[SHA256_DIGEST_LENGTH], buf2[SHA256_DIGEST_LENGTH]; + BIGNUM *r0, *W, *X, *c, *test; + BIGNUM *g = NULL, *q = NULL, *p = NULL; + BN_MONT_CTX *mont = NULL; + int k, n = 0, m = 0; + unsigned i; + int counter = 0; + int r = 0; + BN_CTX *ctx = NULL; + unsigned int h = 2; + unsigned qsize; + const EVP_MD *evpmd; + + evpmd = (bits >= 2048) ? EVP_sha256() : EVP_sha1(); + qsize = EVP_MD_size(evpmd); + + if (bits < 512) { + bits = 512; + } + + bits = (bits + 63) / 64 * 64; + + if (seed_in != NULL) { + if (seed_len < (size_t)qsize) { + return 0; + } + if (seed_len > (size_t)qsize) { + // Only consume as much seed as is expected. + seed_len = qsize; + } + OPENSSL_memcpy(seed, seed_in, seed_len); + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + + r0 = BN_CTX_get(ctx); + g = BN_CTX_get(ctx); + W = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + X = BN_CTX_get(ctx); + c = BN_CTX_get(ctx); + p = BN_CTX_get(ctx); + test = BN_CTX_get(ctx); + + if (test == NULL || !BN_lshift(test, BN_value_one(), bits - 1)) { + goto err; + } + + for (;;) { + // Find q. + for (;;) { + // step 1 + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, m++)) { + goto err; + } + + int use_random_seed = (seed_in == NULL); + if (use_random_seed) { + if (!RAND_bytes(seed, qsize)) { + goto err; + } + } else { + // If we come back through, use random seed next time. + seed_in = NULL; + } + OPENSSL_memcpy(buf, seed, qsize); + OPENSSL_memcpy(buf2, seed, qsize); + // precompute "SEED + 1" for step 7: + for (i = qsize - 1; i < qsize; i--) { + buf[i]++; + if (buf[i] != 0) { + break; + } + } + + // step 2 + if (!EVP_Digest(seed, qsize, md, NULL, evpmd, NULL) || + !EVP_Digest(buf, qsize, buf2, NULL, evpmd, NULL)) { + goto err; + } + for (i = 0; i < qsize; i++) { + md[i] ^= buf2[i]; + } + + // step 3 + md[0] |= 0x80; + md[qsize - 1] |= 0x01; + if (!BN_bin2bn(md, qsize, q)) { + goto err; + } + + // step 4 + r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, use_random_seed, cb); + if (r > 0) { + break; + } + if (r != 0) { + goto err; + } + + // do a callback call + // step 5 + } + + if (!BN_GENCB_call(cb, 2, 0) || !BN_GENCB_call(cb, 3, 0)) { + goto err; + } + + // step 6 + counter = 0; + // "offset = 2" + + n = (bits - 1) / 160; + + for (;;) { + if ((counter != 0) && !BN_GENCB_call(cb, BN_GENCB_GENERATED, counter)) { + goto err; + } + + // step 7 + BN_zero(W); + // now 'buf' contains "SEED + offset - 1" + for (k = 0; k <= n; k++) { + // obtain "SEED + offset + k" by incrementing: + for (i = qsize - 1; i < qsize; i--) { + buf[i]++; + if (buf[i] != 0) { + break; + } + } + + if (!EVP_Digest(buf, qsize, md, NULL, evpmd, NULL)) { + goto err; + } + + // step 8 + if (!BN_bin2bn(md, qsize, r0) || + !BN_lshift(r0, r0, (qsize << 3) * k) || + !BN_add(W, W, r0)) { + goto err; + } + } + + // more of step 8 + if (!BN_mask_bits(W, bits - 1) || + !BN_copy(X, W) || + !BN_add(X, X, test)) { + goto err; + } + + // step 9 + if (!BN_lshift1(r0, q) || + !BN_mod(c, X, r0, ctx) || + !BN_sub(r0, c, BN_value_one()) || + !BN_sub(p, X, r0)) { + goto err; + } + + // step 10 + if (BN_cmp(p, test) >= 0) { + // step 11 + r = BN_is_prime_fasttest_ex(p, DSS_prime_checks, ctx, 1, cb); + if (r > 0) { + goto end; // found it + } + if (r != 0) { + goto err; + } + } + + // step 13 + counter++; + // "offset = offset + n + 1" + + // step 14 + if (counter >= 4096) { + break; + } + } + } +end: + if (!BN_GENCB_call(cb, 2, 1)) { + goto err; + } + + // We now need to generate g + // Set r0=(p-1)/q + if (!BN_sub(test, p, BN_value_one()) || + !BN_div(r0, NULL, test, q, ctx)) { + goto err; + } + + mont = BN_MONT_CTX_new_for_modulus(p, ctx); + if (mont == NULL || + !BN_set_word(test, h)) { + goto err; + } + + for (;;) { + // g=test^r0%p + if (!BN_mod_exp_mont(g, test, r0, p, ctx, mont)) { + goto err; + } + if (!BN_is_one(g)) { + break; + } + if (!BN_add(test, test, BN_value_one())) { + goto err; + } + h++; + } + + if (!BN_GENCB_call(cb, 3, 1)) { + goto err; + } + + ok = 1; + +err: + if (ok) { + BN_free(dsa->p); + BN_free(dsa->q); + BN_free(dsa->g); + dsa->p = BN_dup(p); + dsa->q = BN_dup(q); + dsa->g = BN_dup(g); + if (dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) { + ok = 0; + goto err; + } + if (out_counter != NULL) { + *out_counter = counter; + } + if (out_h != NULL) { + *out_h = h; + } + } + + if (ctx) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + BN_MONT_CTX_free(mont); + + return ok; +} + +DSA *DSAparams_dup(const DSA *dsa) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + ret->p = BN_dup(dsa->p); + ret->q = BN_dup(dsa->q); + ret->g = BN_dup(dsa->g); + if (ret->p == NULL || ret->q == NULL || ret->g == NULL) { + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_generate_key(DSA *dsa) { + int ok = 0; + BN_CTX *ctx = NULL; + BIGNUM *pub_key = NULL, *priv_key = NULL; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + priv_key = dsa->priv_key; + if (priv_key == NULL) { + priv_key = BN_new(); + if (priv_key == NULL) { + goto err; + } + } + + if (!BN_rand_range_ex(priv_key, 1, dsa->q)) { + goto err; + } + + pub_key = dsa->pub_key; + if (pub_key == NULL) { + pub_key = BN_new(); + if (pub_key == NULL) { + goto err; + } + } + + if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, &dsa->method_mont_lock, + dsa->p, ctx) || + !BN_mod_exp_mont_consttime(pub_key, dsa->g, priv_key, dsa->p, ctx, + dsa->method_mont_p)) { + goto err; + } + + dsa->priv_key = priv_key; + dsa->pub_key = pub_key; + ok = 1; + +err: + if (dsa->pub_key == NULL) { + BN_free(pub_key); + } + if (dsa->priv_key == NULL) { + BN_free(priv_key); + } + BN_CTX_free(ctx); + + return ok; +} + +DSA_SIG *DSA_SIG_new(void) { + DSA_SIG *sig; + sig = OPENSSL_malloc(sizeof(DSA_SIG)); + if (!sig) { + return NULL; + } + sig->r = NULL; + sig->s = NULL; + return sig; +} + +void DSA_SIG_free(DSA_SIG *sig) { + if (!sig) { + return; + } + + BN_free(sig->r); + BN_free(sig->s); + 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; + DSA_SIG *ret = NULL; + + BN_init(&m); + BN_init(&xr); + s = BN_new(); + if (s == NULL) { + goto err; + } + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + +redo: + if (!dsa_sign_setup(dsa, ctx, &kinv, &r)) { + goto err; + } + + if (digest_len > BN_num_bytes(dsa->q)) { + // 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); + } + + if (BN_bin2bn(digest, digest_len, &m) == NULL) { + 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; + } + 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; + } + + // Redo if r or s is zero as required by FIPS 186-3: this is + // very unlikely. + if (BN_is_zero(r) || BN_is_zero(s)) { + goto redo; + } + ret = DSA_SIG_new(); + if (ret == NULL) { + goto err; + } + ret->r = r; + ret->s = s; + +err: + if (ret == NULL) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); + BN_free(r); + BN_free(s); + } + BN_CTX_free(ctx); + BN_clear_free(&m); + BN_clear_free(&xr); + BN_clear_free(kinv); + + return ret; +} + +int DSA_do_verify(const uint8_t *digest, size_t digest_len, DSA_SIG *sig, + const DSA *dsa) { + int valid; + if (!DSA_do_check_signature(&valid, digest, digest_len, sig, dsa)) { + return -1; + } + return valid; +} + +int DSA_do_check_signature(int *out_valid, const uint8_t *digest, + size_t digest_len, DSA_SIG *sig, const DSA *dsa) { + BN_CTX *ctx; + BIGNUM u1, u2, t1; + int ret = 0; + unsigned i; + + *out_valid = 0; + + if (!dsa->p || !dsa->q || !dsa->g) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); + return 0; + } + + i = BN_num_bits(dsa->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; + } + + if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MODULUS_TOO_LARGE); + return 0; + } + + BN_init(&u1); + BN_init(&u2); + BN_init(&t1); + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + if (BN_is_zero(sig->r) || BN_is_negative(sig->r) || + BN_ucmp(sig->r, dsa->q) >= 0) { + ret = 1; + goto err; + } + if (BN_is_zero(sig->s) || BN_is_negative(sig->s) || + BN_ucmp(sig->s, dsa->q) >= 0) { + ret = 1; + goto err; + } + + // Calculate W = inv(S) mod Q + // save W in u2 + if (BN_mod_inverse(&u2, sig->s, dsa->q, ctx) == NULL) { + goto err; + } + + // save M in u1 + if (digest_len > (i >> 3)) { + // 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 + digest_len = (i >> 3); + } + + if (BN_bin2bn(digest, digest_len, &u1) == NULL) { + goto err; + } + + // u1 = M * w mod q + if (!BN_mod_mul(&u1, &u1, &u2, dsa->q, ctx)) { + goto err; + } + + // u2 = r * w mod q + if (!BN_mod_mul(&u2, sig->r, &u2, dsa->q, ctx)) { + goto err; + } + + if (!BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->p, + ctx)) { + goto err; + } + + if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, + dsa->method_mont_p)) { + goto err; + } + + // BN_copy(&u1,&t1); + // let u1 = u1 mod q + if (!BN_mod(&u1, &t1, dsa->q, ctx)) { + goto err; + } + + // V is now in u1. If the signature is correct, it will be + // equal to R. + *out_valid = BN_ucmp(&u1, sig->r) == 0; + ret = 1; + +err: + if (ret != 1) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); + } + BN_CTX_free(ctx); + BN_free(&u1); + BN_free(&u2); + BN_free(&t1); + + return ret; +} + +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_SIG *s; + + s = DSA_do_sign(digest, digest_len, dsa); + if (s == NULL) { + *out_siglen = 0; + return 0; + } + + *out_siglen = i2d_DSA_SIG(s, &out_sig); + DSA_SIG_free(s); + return 1; +} + +int DSA_verify(int type, const uint8_t *digest, size_t digest_len, + const uint8_t *sig, size_t sig_len, const DSA *dsa) { + int valid; + if (!DSA_check_signature(&valid, digest, digest_len, sig, sig_len, dsa)) { + return -1; + } + return valid; +} + +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_SIG *s = NULL; + int ret = 0; + uint8_t *der = NULL; + + s = DSA_SIG_new(); + if (s == NULL) { + goto err; + } + + const uint8_t *sigp = sig; + if (d2i_DSA_SIG(&s, &sigp, sig_len) == NULL || sigp != sig + sig_len) { + goto err; + } + + // Ensure that the signature uses DER and doesn't have trailing garbage. + int der_len = i2d_DSA_SIG(s, &der); + if (der_len < 0 || (size_t)der_len != sig_len || + OPENSSL_memcmp(sig, der, sig_len)) { + goto err; + } + + ret = DSA_do_check_signature(out_valid, digest, digest_len, s, dsa); + +err: + OPENSSL_free(der); + DSA_SIG_free(s); + return ret; +} + +// der_len_len returns the number of bytes needed to represent a length of |len| +// in DER. +static size_t der_len_len(size_t len) { + if (len < 0x80) { + return 1; + } + size_t ret = 1; + while (len > 0) { + ret++; + len >>= 8; + } + return ret; +} + +int DSA_size(const DSA *dsa) { + size_t order_len = BN_num_bytes(dsa->q); + // Compute the maximum length of an |order_len| byte integer. Defensively + // assume that the leading 0x00 is included. + size_t integer_len = 1 /* tag */ + der_len_len(order_len + 1) + 1 + order_len; + if (integer_len < order_len) { + return 0; + } + // A DSA signature is two INTEGERs. + size_t value_len = 2 * integer_len; + if (value_len < integer_len) { + return 0; + } + // Add the header. + size_t ret = 1 /* tag */ + der_len_len(value_len) + value_len; + if (ret < value_len) { + return 0; + } + return ret; +} + +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx, BIGNUM **out_kinv, + BIGNUM **out_r) { + 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); + BIGNUM *r = BN_new(); + BIGNUM *kinv = BN_new(); + if (r == NULL || kinv == NULL || + // Get random k + !BN_rand_range_ex(&k, 1, dsa->q) || + !BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->p, + ctx) || + !BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_q, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->q, + ctx) || + // 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: + BN_clear_free(&k); + BN_clear_free(r); + BN_clear_free(kinv); + return ret; +} + +int DSA_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int DSA_set_ex_data(DSA *dsa, int idx, void *arg) { + return CRYPTO_set_ex_data(&dsa->ex_data, idx, arg); +} + +void *DSA_get_ex_data(const DSA *dsa, int idx) { + return CRYPTO_get_ex_data(&dsa->ex_data, idx); +} + +DH *DSA_dup_DH(const DSA *dsa) { + if (dsa == NULL) { + return NULL; + } + + DH *ret = DH_new(); + if (ret == NULL) { + goto err; + } + if (dsa->q != NULL) { + ret->priv_length = BN_num_bits(dsa->q); + if ((ret->q = BN_dup(dsa->q)) == NULL) { + goto err; + } + } + if ((dsa->p != NULL && (ret->p = BN_dup(dsa->p)) == NULL) || + (dsa->g != NULL && (ret->g = BN_dup(dsa->g)) == NULL) || + (dsa->pub_key != NULL && (ret->pub_key = BN_dup(dsa->pub_key)) == NULL) || + (dsa->priv_key != NULL && + (ret->priv_key = BN_dup(dsa->priv_key)) == NULL)) { + goto err; + } + + return ret; + +err: + DH_free(ret); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back new file mode 100644 index 0000000..cc98225 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back @@ -0,0 +1,970 @@ +/* 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 . */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../fipsmodule/bn/internal.h" +#include "../internal.h" + + +#define OPENSSL_DSA_MAX_MODULUS_BITS 10000 + +// Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of +// Miller-Rabin. +#define DSS_prime_checks 50 + +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, + BIGNUM **out_r); + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +DSA *DSA_new(void) { + DSA *dsa = OPENSSL_malloc(sizeof(DSA)); + if (dsa == NULL) { + OPENSSL_PUT_ERROR(DSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(dsa, 0, sizeof(DSA)); + + dsa->references = 1; + + CRYPTO_MUTEX_init(&dsa->method_mont_lock); + CRYPTO_new_ex_data(&dsa->ex_data); + + return dsa; +} + +void DSA_free(DSA *dsa) { + if (dsa == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&dsa->references)) { + return; + } + + CRYPTO_free_ex_data(&g_ex_data_class, dsa, &dsa->ex_data); + + BN_clear_free(dsa->p); + BN_clear_free(dsa->q); + BN_clear_free(dsa->g); + BN_clear_free(dsa->pub_key); + BN_clear_free(dsa->priv_key); + BN_MONT_CTX_free(dsa->method_mont_p); + BN_MONT_CTX_free(dsa->method_mont_q); + CRYPTO_MUTEX_cleanup(&dsa->method_mont_lock); + OPENSSL_free(dsa); +} + +int DSA_up_ref(DSA *dsa) { + CRYPTO_refcount_inc(&dsa->references); + return 1; +} + +void DSA_get0_key(const DSA *dsa, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key) { + if (out_pub_key != NULL) { + *out_pub_key = dsa->pub_key; + } + if (out_priv_key != NULL) { + *out_priv_key = dsa->priv_key; + } +} + +void DSA_get0_pqg(const DSA *dsa, const BIGNUM **out_p, const BIGNUM **out_q, + const BIGNUM **out_g) { + if (out_p != NULL) { + *out_p = dsa->p; + } + if (out_q != NULL) { + *out_q = dsa->q; + } + if (out_g != NULL) { + *out_g = dsa->g; + } +} + +int DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key) { + if (dsa->pub_key == NULL && pub_key == NULL) { + return 0; + } + + if (pub_key != NULL) { + BN_free(dsa->pub_key); + dsa->pub_key = pub_key; + } + if (priv_key != NULL) { + BN_free(dsa->priv_key); + dsa->priv_key = priv_key; + } + + return 1; +} + +int DSA_set0_pqg(DSA *dsa, BIGNUM *p, BIGNUM *q, BIGNUM *g) { + if ((dsa->p == NULL && p == NULL) || + (dsa->q == NULL && q == NULL) || + (dsa->g == NULL && g == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(dsa->p); + dsa->p = p; + } + if (q != NULL) { + BN_free(dsa->q); + dsa->q = q; + } + if (g != NULL) { + BN_free(dsa->g); + dsa->g = g; + } + + return 1; +} + +int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, + size_t seed_len, int *out_counter, + unsigned long *out_h, BN_GENCB *cb) { + int ok = 0; + unsigned char seed[SHA256_DIGEST_LENGTH]; + unsigned char md[SHA256_DIGEST_LENGTH]; + unsigned char buf[SHA256_DIGEST_LENGTH], buf2[SHA256_DIGEST_LENGTH]; + BIGNUM *r0, *W, *X, *c, *test; + BIGNUM *g = NULL, *q = NULL, *p = NULL; + BN_MONT_CTX *mont = NULL; + int k, n = 0, m = 0; + unsigned i; + int counter = 0; + int r = 0; + BN_CTX *ctx = NULL; + unsigned int h = 2; + unsigned qsize; + const EVP_MD *evpmd; + + evpmd = (bits >= 2048) ? EVP_sha256() : EVP_sha1(); + qsize = EVP_MD_size(evpmd); + + if (bits < 512) { + bits = 512; + } + + bits = (bits + 63) / 64 * 64; + + if (seed_in != NULL) { + if (seed_len < (size_t)qsize) { + return 0; + } + if (seed_len > (size_t)qsize) { + // Only consume as much seed as is expected. + seed_len = qsize; + } + OPENSSL_memcpy(seed, seed_in, seed_len); + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + + r0 = BN_CTX_get(ctx); + g = BN_CTX_get(ctx); + W = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + X = BN_CTX_get(ctx); + c = BN_CTX_get(ctx); + p = BN_CTX_get(ctx); + test = BN_CTX_get(ctx); + + if (test == NULL || !BN_lshift(test, BN_value_one(), bits - 1)) { + goto err; + } + + for (;;) { + // Find q. + for (;;) { + // step 1 + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, m++)) { + goto err; + } + + int use_random_seed = (seed_in == NULL); + if (use_random_seed) { + if (!RAND_bytes(seed, qsize)) { + goto err; + } + } else { + // If we come back through, use random seed next time. + seed_in = NULL; + } + OPENSSL_memcpy(buf, seed, qsize); + OPENSSL_memcpy(buf2, seed, qsize); + // precompute "SEED + 1" for step 7: + for (i = qsize - 1; i < qsize; i--) { + buf[i]++; + if (buf[i] != 0) { + break; + } + } + + // step 2 + if (!EVP_Digest(seed, qsize, md, NULL, evpmd, NULL) || + !EVP_Digest(buf, qsize, buf2, NULL, evpmd, NULL)) { + goto err; + } + for (i = 0; i < qsize; i++) { + md[i] ^= buf2[i]; + } + + // step 3 + md[0] |= 0x80; + md[qsize - 1] |= 0x01; + if (!BN_bin2bn(md, qsize, q)) { + goto err; + } + + // step 4 + r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, use_random_seed, cb); + if (r > 0) { + break; + } + if (r != 0) { + goto err; + } + + // do a callback call + // step 5 + } + + if (!BN_GENCB_call(cb, 2, 0) || !BN_GENCB_call(cb, 3, 0)) { + goto err; + } + + // step 6 + counter = 0; + // "offset = 2" + + n = (bits - 1) / 160; + + for (;;) { + if ((counter != 0) && !BN_GENCB_call(cb, BN_GENCB_GENERATED, counter)) { + goto err; + } + + // step 7 + BN_zero(W); + // now 'buf' contains "SEED + offset - 1" + for (k = 0; k <= n; k++) { + // obtain "SEED + offset + k" by incrementing: + for (i = qsize - 1; i < qsize; i--) { + buf[i]++; + if (buf[i] != 0) { + break; + } + } + + if (!EVP_Digest(buf, qsize, md, NULL, evpmd, NULL)) { + goto err; + } + + // step 8 + if (!BN_bin2bn(md, qsize, r0) || + !BN_lshift(r0, r0, (qsize << 3) * k) || + !BN_add(W, W, r0)) { + goto err; + } + } + + // more of step 8 + if (!BN_mask_bits(W, bits - 1) || + !BN_copy(X, W) || + !BN_add(X, X, test)) { + goto err; + } + + // step 9 + if (!BN_lshift1(r0, q) || + !BN_mod(c, X, r0, ctx) || + !BN_sub(r0, c, BN_value_one()) || + !BN_sub(p, X, r0)) { + goto err; + } + + // step 10 + if (BN_cmp(p, test) >= 0) { + // step 11 + r = BN_is_prime_fasttest_ex(p, DSS_prime_checks, ctx, 1, cb); + if (r > 0) { + goto end; // found it + } + if (r != 0) { + goto err; + } + } + + // step 13 + counter++; + // "offset = offset + n + 1" + + // step 14 + if (counter >= 4096) { + break; + } + } + } +end: + if (!BN_GENCB_call(cb, 2, 1)) { + goto err; + } + + // We now need to generate g + // Set r0=(p-1)/q + if (!BN_sub(test, p, BN_value_one()) || + !BN_div(r0, NULL, test, q, ctx)) { + goto err; + } + + mont = BN_MONT_CTX_new_for_modulus(p, ctx); + if (mont == NULL || + !BN_set_word(test, h)) { + goto err; + } + + for (;;) { + // g=test^r0%p + if (!BN_mod_exp_mont(g, test, r0, p, ctx, mont)) { + goto err; + } + if (!BN_is_one(g)) { + break; + } + if (!BN_add(test, test, BN_value_one())) { + goto err; + } + h++; + } + + if (!BN_GENCB_call(cb, 3, 1)) { + goto err; + } + + ok = 1; + +err: + if (ok) { + BN_free(dsa->p); + BN_free(dsa->q); + BN_free(dsa->g); + dsa->p = BN_dup(p); + dsa->q = BN_dup(q); + dsa->g = BN_dup(g); + if (dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) { + ok = 0; + goto err; + } + if (out_counter != NULL) { + *out_counter = counter; + } + if (out_h != NULL) { + *out_h = h; + } + } + + if (ctx) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + BN_MONT_CTX_free(mont); + + return ok; +} + +DSA *DSAparams_dup(const DSA *dsa) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + ret->p = BN_dup(dsa->p); + ret->q = BN_dup(dsa->q); + ret->g = BN_dup(dsa->g); + if (ret->p == NULL || ret->q == NULL || ret->g == NULL) { + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_generate_key(DSA *dsa) { + int ok = 0; + BN_CTX *ctx = NULL; + BIGNUM *pub_key = NULL, *priv_key = NULL; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + priv_key = dsa->priv_key; + if (priv_key == NULL) { + priv_key = BN_new(); + if (priv_key == NULL) { + goto err; + } + } + + if (!BN_rand_range_ex(priv_key, 1, dsa->q)) { + goto err; + } + + pub_key = dsa->pub_key; + if (pub_key == NULL) { + pub_key = BN_new(); + if (pub_key == NULL) { + goto err; + } + } + + if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, &dsa->method_mont_lock, + dsa->p, ctx) || + !BN_mod_exp_mont_consttime(pub_key, dsa->g, priv_key, dsa->p, ctx, + dsa->method_mont_p)) { + goto err; + } + + dsa->priv_key = priv_key; + dsa->pub_key = pub_key; + ok = 1; + +err: + if (dsa->pub_key == NULL) { + BN_free(pub_key); + } + if (dsa->priv_key == NULL) { + BN_free(priv_key); + } + BN_CTX_free(ctx); + + return ok; +} + +DSA_SIG *DSA_SIG_new(void) { + DSA_SIG *sig; + sig = OPENSSL_malloc(sizeof(DSA_SIG)); + if (!sig) { + return NULL; + } + sig->r = NULL; + sig->s = NULL; + return sig; +} + +void DSA_SIG_free(DSA_SIG *sig) { + if (!sig) { + return; + } + + BN_free(sig->r); + BN_free(sig->s); + 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; + DSA_SIG *ret = NULL; + + BN_init(&m); + BN_init(&xr); + s = BN_new(); + if (s == NULL) { + goto err; + } + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + +redo: + if (!dsa_sign_setup(dsa, ctx, &kinv, &r)) { + goto err; + } + + if (digest_len > BN_num_bytes(dsa->q)) { + // 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); + } + + if (BN_bin2bn(digest, digest_len, &m) == NULL) { + 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; + } + 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; + } + + // Redo if r or s is zero as required by FIPS 186-3: this is + // very unlikely. + if (BN_is_zero(r) || BN_is_zero(s)) { + goto redo; + } + ret = DSA_SIG_new(); + if (ret == NULL) { + goto err; + } + ret->r = r; + ret->s = s; + +err: + if (ret == NULL) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); + BN_free(r); + BN_free(s); + } + BN_CTX_free(ctx); + BN_clear_free(&m); + BN_clear_free(&xr); + BN_clear_free(kinv); + + return ret; +} + +int DSA_do_verify(const uint8_t *digest, size_t digest_len, DSA_SIG *sig, + const DSA *dsa) { + int valid; + if (!DSA_do_check_signature(&valid, digest, digest_len, sig, dsa)) { + return -1; + } + return valid; +} + +int DSA_do_check_signature(int *out_valid, const uint8_t *digest, + size_t digest_len, DSA_SIG *sig, const DSA *dsa) { + BN_CTX *ctx; + BIGNUM u1, u2, t1; + int ret = 0; + unsigned i; + + *out_valid = 0; + + if (!dsa->p || !dsa->q || !dsa->g) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); + return 0; + } + + i = BN_num_bits(dsa->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; + } + + if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MODULUS_TOO_LARGE); + return 0; + } + + BN_init(&u1); + BN_init(&u2); + BN_init(&t1); + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + if (BN_is_zero(sig->r) || BN_is_negative(sig->r) || + BN_ucmp(sig->r, dsa->q) >= 0) { + ret = 1; + goto err; + } + if (BN_is_zero(sig->s) || BN_is_negative(sig->s) || + BN_ucmp(sig->s, dsa->q) >= 0) { + ret = 1; + goto err; + } + + // Calculate W = inv(S) mod Q + // save W in u2 + if (BN_mod_inverse(&u2, sig->s, dsa->q, ctx) == NULL) { + goto err; + } + + // save M in u1 + if (digest_len > (i >> 3)) { + // 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 + digest_len = (i >> 3); + } + + if (BN_bin2bn(digest, digest_len, &u1) == NULL) { + goto err; + } + + // u1 = M * w mod q + if (!BN_mod_mul(&u1, &u1, &u2, dsa->q, ctx)) { + goto err; + } + + // u2 = r * w mod q + if (!BN_mod_mul(&u2, sig->r, &u2, dsa->q, ctx)) { + goto err; + } + + if (!BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->p, + ctx)) { + goto err; + } + + if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, + dsa->method_mont_p)) { + goto err; + } + + // BN_copy(&u1,&t1); + // let u1 = u1 mod q + if (!BN_mod(&u1, &t1, dsa->q, ctx)) { + goto err; + } + + // V is now in u1. If the signature is correct, it will be + // equal to R. + *out_valid = BN_ucmp(&u1, sig->r) == 0; + ret = 1; + +err: + if (ret != 1) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); + } + BN_CTX_free(ctx); + BN_free(&u1); + BN_free(&u2); + BN_free(&t1); + + return ret; +} + +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_SIG *s; + + s = DSA_do_sign(digest, digest_len, dsa); + if (s == NULL) { + *out_siglen = 0; + return 0; + } + + *out_siglen = i2d_DSA_SIG(s, &out_sig); + DSA_SIG_free(s); + return 1; +} + +int DSA_verify(int type, const uint8_t *digest, size_t digest_len, + const uint8_t *sig, size_t sig_len, const DSA *dsa) { + int valid; + if (!DSA_check_signature(&valid, digest, digest_len, sig, sig_len, dsa)) { + return -1; + } + return valid; +} + +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_SIG *s = NULL; + int ret = 0; + uint8_t *der = NULL; + + s = DSA_SIG_new(); + if (s == NULL) { + goto err; + } + + const uint8_t *sigp = sig; + if (d2i_DSA_SIG(&s, &sigp, sig_len) == NULL || sigp != sig + sig_len) { + goto err; + } + + // Ensure that the signature uses DER and doesn't have trailing garbage. + int der_len = i2d_DSA_SIG(s, &der); + if (der_len < 0 || (size_t)der_len != sig_len || + OPENSSL_memcmp(sig, der, sig_len)) { + goto err; + } + + ret = DSA_do_check_signature(out_valid, digest, digest_len, s, dsa); + +err: + OPENSSL_free(der); + DSA_SIG_free(s); + return ret; +} + +// der_len_len returns the number of bytes needed to represent a length of |len| +// in DER. +static size_t der_len_len(size_t len) { + if (len < 0x80) { + return 1; + } + size_t ret = 1; + while (len > 0) { + ret++; + len >>= 8; + } + return ret; +} + +int DSA_size(const DSA *dsa) { + size_t order_len = BN_num_bytes(dsa->q); + // Compute the maximum length of an |order_len| byte integer. Defensively + // assume that the leading 0x00 is included. + size_t integer_len = 1 /* tag */ + der_len_len(order_len + 1) + 1 + order_len; + if (integer_len < order_len) { + return 0; + } + // A DSA signature is two INTEGERs. + size_t value_len = 2 * integer_len; + if (value_len < integer_len) { + return 0; + } + // Add the header. + size_t ret = 1 /* tag */ + der_len_len(value_len) + value_len; + if (ret < value_len) { + return 0; + } + return ret; +} + +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx, BIGNUM **out_kinv, + BIGNUM **out_r) { + 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); + BIGNUM *r = BN_new(); + BIGNUM *kinv = BN_new(); + if (r == NULL || kinv == NULL || + // Get random k + !BN_rand_range_ex(&k, 1, dsa->q) || + !BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->p, + ctx) || + !BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_q, + (CRYPTO_MUTEX *)&dsa->method_mont_lock, dsa->q, + ctx) || + // 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: + BN_clear_free(&k); + BN_clear_free(r); + BN_clear_free(kinv); + return ret; +} + +int DSA_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int DSA_set_ex_data(DSA *dsa, int idx, void *arg) { + return CRYPTO_set_ex_data(&dsa->ex_data, idx, arg); +} + +void *DSA_get_ex_data(const DSA *dsa, int idx) { + return CRYPTO_get_ex_data(&dsa->ex_data, idx); +} + +DH *DSA_dup_DH(const DSA *dsa) { + if (dsa == NULL) { + return NULL; + } + + DH *ret = DH_new(); + if (ret == NULL) { + goto err; + } + if (dsa->q != NULL) { + ret->priv_length = BN_num_bits(dsa->q); + if ((ret->q = BN_dup(dsa->q)) == NULL) { + goto err; + } + } + if ((dsa->p != NULL && (ret->p = BN_dup(dsa->p)) == NULL) || + (dsa->g != NULL && (ret->g = BN_dup(dsa->g)) == NULL) || + (dsa->pub_key != NULL && (ret->pub_key = BN_dup(dsa->pub_key)) == NULL) || + (dsa->priv_key != NULL && + (ret->priv_key = BN_dup(dsa->priv_key)) == NULL)) { + goto err; + } + + return ret; + +err: + DH_free(ret); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c new file mode 100644 index 0000000..2f62503 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c @@ -0,0 +1,339 @@ +/* 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). */ + +#include + +#include + +#include +#include +#include +#include + +#include "../bytestring/internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // A DSA object may be missing some components. + OPENSSL_PUT_ERROR(DSA, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +DSA_SIG *DSA_SIG_parse(CBS *cbs) { + DSA_SIG *ret = DSA_SIG_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->r) || + !parse_integer(&child, &ret->s) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_SIG_free(ret); + return NULL; + } + return ret; +} + +int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, sig->r) || + !marshal_integer(&child, sig->s) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_public_key(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->pub_key) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dsa->pub_key) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_parameters(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_private_key(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + uint64_t version; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&child, &version)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + goto err; + } + + if (version != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_VERSION); + goto err; + } + + if (!parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + !parse_integer(&child, &ret->pub_key) || + !parse_integer(&child, &ret->priv_key) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + goto err; + } + return ret; + +err: + DSA_free(ret); + return NULL; +} + +int DSA_marshal_private_key(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&child, 0 /* version */) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !marshal_integer(&child, dsa->pub_key) || + !marshal_integer(&child, dsa->priv_key) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA_SIG *d2i_DSA_SIG(DSA_SIG **out_sig, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA_SIG *ret = DSA_SIG_parse(&cbs); + if (ret == NULL) { + return NULL; + } + if (out_sig != NULL) { + DSA_SIG_free(*out_sig); + *out_sig = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSA_SIG(const DSA_SIG *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_SIG_marshal(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAPublicKey(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_public_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAPublicKey(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_public_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAPrivateKey(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAPrivateKey(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_private_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAparams(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_parameters(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAparams(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_parameters(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c.grpc_back new file mode 100644 index 0000000..97fd07f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c.grpc_back @@ -0,0 +1,339 @@ +/* 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). */ + +#include + +#include + +#include +#include +#include +#include + +#include "../bytestring/internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // A DSA object may be missing some components. + OPENSSL_PUT_ERROR(DSA, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +DSA_SIG *DSA_SIG_parse(CBS *cbs) { + DSA_SIG *ret = DSA_SIG_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->r) || + !parse_integer(&child, &ret->s) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_SIG_free(ret); + return NULL; + } + return ret; +} + +int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, sig->r) || + !marshal_integer(&child, sig->s) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_public_key(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->pub_key) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dsa->pub_key) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_parameters(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + DSA_free(ret); + return NULL; + } + return ret; +} + +int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA *DSA_parse_private_key(CBS *cbs) { + DSA *ret = DSA_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + uint64_t version; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&child, &version)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + goto err; + } + + if (version != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_VERSION); + goto err; + } + + if (!parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->g) || + !parse_integer(&child, &ret->pub_key) || + !parse_integer(&child, &ret->priv_key) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR); + goto err; + } + return ret; + +err: + DSA_free(ret); + return NULL; +} + +int DSA_marshal_private_key(CBB *cbb, const DSA *dsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&child, 0 /* version */) || + !marshal_integer(&child, dsa->p) || + !marshal_integer(&child, dsa->q) || + !marshal_integer(&child, dsa->g) || + !marshal_integer(&child, dsa->pub_key) || + !marshal_integer(&child, dsa->priv_key) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +DSA_SIG *d2i_DSA_SIG(DSA_SIG **out_sig, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA_SIG *ret = DSA_SIG_parse(&cbs); + if (ret == NULL) { + return NULL; + } + if (out_sig != NULL) { + DSA_SIG_free(*out_sig); + *out_sig = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSA_SIG(const DSA_SIG *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_SIG_marshal(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAPublicKey(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_public_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAPublicKey(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_public_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAPrivateKey(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAPrivateKey(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_private_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +DSA *d2i_DSAparams(DSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + DSA *ret = DSA_parse_parameters(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + DSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_DSAparams(const DSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !DSA_marshal_parameters(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c new file mode 100644 index 0000000..58e46d6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c @@ -0,0 +1,574 @@ +/* Written by Nils Larsch for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 2000-2003 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 "../fipsmodule/ec/internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +static const unsigned kParametersTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0; +static const unsigned kPublicKeyTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1; + +EC_KEY *EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group) { + CBS ec_private_key, private_key; + uint64_t version; + if (!CBS_get_asn1(cbs, &ec_private_key, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&ec_private_key, &version) || + version != 1 || + !CBS_get_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + + // Parse the optional parameters field. + EC_GROUP *inner_group = NULL; + EC_KEY *ret = NULL; + BIGNUM *priv_key = NULL; + if (CBS_peek_asn1_tag(&ec_private_key, kParametersTag)) { + // Per SEC 1, as an alternative to omitting it, one is allowed to specify + // this field and put in a NULL to mean inheriting this value. This was + // omitted in a previous version of this logic without problems, so leave it + // unimplemented. + CBS child; + if (!CBS_get_asn1(&ec_private_key, &child, kParametersTag)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + inner_group = EC_KEY_parse_parameters(&child); + if (inner_group == NULL) { + goto err; + } + if (group == NULL) { + group = inner_group; + } else if (EC_GROUP_cmp(group, inner_group, NULL) != 0) { + // If a group was supplied externally, it must match. + OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); + goto err; + } + if (CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + } + + if (group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + goto err; + } + + ret = EC_KEY_new(); + if (ret == NULL || !EC_KEY_set_group(ret, group)) { + goto err; + } + + // Although RFC 5915 specifies the length of the key, OpenSSL historically + // got this wrong, so accept any length. See upstream's + // 30cd4ff294252c4b6a4b69cbef6a5b4117705d22. + priv_key = BN_bin2bn(CBS_data(&private_key), CBS_len(&private_key), NULL); + ret->pub_key = EC_POINT_new(group); + if (priv_key == NULL || ret->pub_key == NULL || + !EC_KEY_set_private_key(ret, priv_key)) { + goto err; + } + + if (CBS_peek_asn1_tag(&ec_private_key, kPublicKeyTag)) { + CBS child, public_key; + uint8_t padding; + if (!CBS_get_asn1(&ec_private_key, &child, kPublicKeyTag) || + !CBS_get_asn1(&child, &public_key, CBS_ASN1_BITSTRING) || + // As in a SubjectPublicKeyInfo, the byte-encoded public key is then + // encoded as a BIT STRING with bits ordered as in the DER encoding. + !CBS_get_u8(&public_key, &padding) || + padding != 0 || + // Explicitly check |public_key| is non-empty to save the conversion + // form later. + CBS_len(&public_key) == 0 || + !EC_POINT_oct2point(group, ret->pub_key, CBS_data(&public_key), + CBS_len(&public_key), NULL) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + + // Save the point conversion form. + // TODO(davidben): Consider removing this. + ret->conv_form = + (point_conversion_form_t)(CBS_data(&public_key)[0] & ~0x01); + } else { + // Compute the public key instead. + if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw, + &ret->priv_key->scalar)) { + goto err; + } + // Remember the original private-key-only encoding. + // TODO(davidben): Consider removing this. + ret->enc_flag |= EC_PKEY_NO_PUBKEY; + } + + if (CBS_len(&ec_private_key) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + + // Ensure the resulting key is valid. + if (!EC_KEY_check_key(ret)) { + goto err; + } + + BN_free(priv_key); + EC_GROUP_free(inner_group); + return ret; + +err: + EC_KEY_free(ret); + BN_free(priv_key); + EC_GROUP_free(inner_group); + return NULL; +} + +int EC_KEY_marshal_private_key(CBB *cbb, const EC_KEY *key, + unsigned enc_flags) { + if (key == NULL || key->group == NULL || key->priv_key == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + CBB ec_private_key, private_key; + if (!CBB_add_asn1(cbb, &ec_private_key, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&ec_private_key, 1 /* version */) || + !CBB_add_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING) || + !BN_bn2cbb_padded(&private_key, + BN_num_bytes(EC_GROUP_get0_order(key->group)), + EC_KEY_get0_private_key(key))) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + + if (!(enc_flags & EC_PKEY_NO_PARAMETERS)) { + CBB child; + if (!CBB_add_asn1(&ec_private_key, &child, kParametersTag) || + !EC_KEY_marshal_curve_name(&child, key->group) || + !CBB_flush(&ec_private_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + } + + // TODO(fork): replace this flexibility with sensible default? + if (!(enc_flags & EC_PKEY_NO_PUBKEY) && key->pub_key != NULL) { + CBB child, public_key; + if (!CBB_add_asn1(&ec_private_key, &child, kPublicKeyTag) || + !CBB_add_asn1(&child, &public_key, CBS_ASN1_BITSTRING) || + // As in a SubjectPublicKeyInfo, the byte-encoded public key is then + // encoded as a BIT STRING with bits ordered as in the DER encoding. + !CBB_add_u8(&public_key, 0 /* padding */) || + !EC_POINT_point2cbb(&public_key, key->group, key->pub_key, + key->conv_form, NULL) || + !CBB_flush(&ec_private_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + } + + if (!CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +// is_unsigned_integer returns one if |cbs| is a valid unsigned DER INTEGER and +// zero otherwise. +static int is_unsigned_integer(const CBS *cbs) { + if (CBS_len(cbs) == 0) { + return 0; + } + uint8_t byte = CBS_data(cbs)[0]; + if ((byte & 0x80) || + (byte == 0 && CBS_len(cbs) > 1 && (CBS_data(cbs)[1] & 0x80) == 0)) { + // Negative or not minimally-encoded. + return 0; + } + return 1; +} + +// kPrimeFieldOID is the encoding of 1.2.840.10045.1.1. +static const uint8_t kPrimeField[] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01}; + +static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, + CBS *out_b, CBS *out_base_x, + 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, cofactor; + int has_cofactor; + uint64_t version; + if (!CBS_get_asn1(in, ¶ms, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(¶ms, &version) || + version != 1 || + !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 || + !CBS_get_asn1(&field_id, out_prime, CBS_ASN1_INTEGER) || + !is_unsigned_integer(out_prime) || + CBS_len(&field_id) != 0 || + !CBS_get_asn1(¶ms, &curve, CBS_ASN1_SEQUENCE) || + !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) || + !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; + } + + 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; + if (!CBS_get_u8(&base, &form) || form != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); + return 0; + } + + if (CBS_len(&base) % 2 != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return 0; + } + size_t field_len = CBS_len(&base) / 2; + CBS_init(out_base_x, CBS_data(&base), field_len); + CBS_init(out_base_y, CBS_data(&base) + field_len, field_len); + + return 1; +} + +// integers_equal returns one if |a| and |b| are equal, up to leading zeros, and +// zero otherwise. +static int integers_equal(const CBS *a, const uint8_t *b, size_t b_len) { + // Remove leading zeros from |a| and |b|. + CBS a_copy = *a; + while (CBS_len(&a_copy) > 0 && CBS_data(&a_copy)[0] == 0) { + CBS_skip(&a_copy, 1); + } + while (b_len > 0 && b[0] == 0) { + b++; + b_len--; + } + return CBS_mem_equal(&a_copy, b, b_len); +} + +EC_GROUP *EC_KEY_parse_curve_name(CBS *cbs) { + CBS named_curve; + if (!CBS_get_asn1(cbs, &named_curve, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + + // Look for a matching curve. + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + if (CBS_len(&named_curve) == curve->oid_len && + OPENSSL_memcmp(CBS_data(&named_curve), curve->oid, curve->oid_len) == + 0) { + return EC_GROUP_new_by_curve_name(curve->nid); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; +} + +int EC_KEY_marshal_curve_name(CBB *cbb, const EC_GROUP *group) { + int nid = EC_GROUP_get_curve_name(group); + if (nid == NID_undef) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; + } + + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + if (curve->nid == nid) { + CBB child; + return CBB_add_asn1(cbb, &child, CBS_ASN1_OBJECT) && + CBB_add_bytes(&child, curve->oid, curve->oid_len) && + CBB_flush(cbb); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; +} + +EC_GROUP *EC_KEY_parse_parameters(CBS *cbs) { + if (!CBS_peek_asn1_tag(cbs, CBS_ASN1_SEQUENCE)) { + return EC_KEY_parse_curve_name(cbs); + } + + // OpenSSL sometimes produces ECPrivateKeys with explicitly-encoded versions + // of named curves. + // + // TODO(davidben): Remove support for this. + CBS prime, a, b, base_x, base_y, order; + if (!parse_explicit_prime_curve(cbs, &prime, &a, &b, &base_x, &base_y, + &order)) { + return NULL; + } + + // Look for a matching prime curve. + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + const unsigned param_len = curve->param_len; + // |curve->params| is ordered p, a, b, x, y, order, each component + // zero-padded up to the field length. Although SEC 1 states that the + // Field-Element-to-Octet-String conversion also pads, OpenSSL mis-encodes + // |a| and |b|, so this comparison must allow omitting leading zeros. (This + // is relevant for P-521 whose |b| has a leading 0.) + if (integers_equal(&prime, curve->params, param_len) && + integers_equal(&a, curve->params + param_len, param_len) && + integers_equal(&b, curve->params + param_len * 2, param_len) && + integers_equal(&base_x, curve->params + param_len * 3, param_len) && + integers_equal(&base_y, curve->params + param_len * 4, param_len) && + integers_equal(&order, curve->params + param_len * 5, param_len)) { + return EC_GROUP_new_by_curve_name(curve->nid); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; +} + +int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, const EC_POINT *point, + point_conversion_form_t form, BN_CTX *ctx) { + size_t len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx); + if (len == 0) { + return 0; + } + uint8_t *p; + return CBB_add_space(out, &p, len) && + EC_POINT_point2oct(group, point, form, p, len, ctx) == len; +} + +EC_KEY *d2i_ECPrivateKey(EC_KEY **out, const uint8_t **inp, long len) { + // This function treats its |out| parameter differently from other |d2i| + // functions. If supplied, take the group from |*out|. + const EC_GROUP *group = NULL; + if (out != NULL && *out != NULL) { + group = EC_KEY_get0_group(*out); + } + + if (len < 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EC_KEY *ret = EC_KEY_parse_private_key(&cbs, group); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + EC_KEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EC_KEY_marshal_private_key(&cbb, key, EC_KEY_get_enc_flags(key))) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +EC_KEY *d2i_ECParameters(EC_KEY **out_key, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EC_GROUP *group = EC_KEY_parse_parameters(&cbs); + if (group == NULL) { + return NULL; + } + + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL || !EC_KEY_set_group(ret, group)) { + EC_GROUP_free(group); + EC_KEY_free(ret); + return NULL; + } + EC_GROUP_free(group); + + if (out_key != NULL) { + EC_KEY_free(*out_key); + *out_key = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECParameters(const EC_KEY *key, uint8_t **outp) { + if (key == NULL || key->group == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return -1; + } + + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EC_KEY_marshal_curve_name(&cbb, key->group)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +EC_KEY *o2i_ECPublicKey(EC_KEY **keyp, const uint8_t **inp, long len) { + EC_KEY *ret = NULL; + + if (keyp == NULL || *keyp == NULL || (*keyp)->group == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + ret = *keyp; + if (ret->pub_key == NULL && + (ret->pub_key = EC_POINT_new(ret->group)) == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (!EC_POINT_oct2point(ret->group, ret->pub_key, *inp, len, NULL)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + return NULL; + } + // save the point conversion form + ret->conv_form = (point_conversion_form_t)(*inp[0] & ~0x01); + *inp += len; + return ret; +} + +int i2o_ECPublicKey(const EC_KEY *key, uint8_t **outp) { + size_t buf_len = 0; + int new_buffer = 0; + + if (key == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + buf_len = EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, NULL, + 0, NULL); + + if (outp == NULL || buf_len == 0) { + // out == NULL => just return the length of the octet string + return buf_len; + } + + if (*outp == NULL) { + *outp = OPENSSL_malloc(buf_len); + if (*outp == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return 0; + } + new_buffer = 1; + } + if (!EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, *outp, + buf_len, NULL)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + if (new_buffer) { + OPENSSL_free(*outp); + *outp = NULL; + } + return 0; + } + + if (!new_buffer) { + *outp += buf_len; + } + return buf_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back new file mode 100644 index 0000000..9769d01 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back @@ -0,0 +1,574 @@ +/* Written by Nils Larsch for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 2000-2003 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 "../fipsmodule/ec/internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +static const unsigned kParametersTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0; +static const unsigned kPublicKeyTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1; + +EC_KEY *EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group) { + CBS ec_private_key, private_key; + uint64_t version; + if (!CBS_get_asn1(cbs, &ec_private_key, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&ec_private_key, &version) || + version != 1 || + !CBS_get_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + + // Parse the optional parameters field. + EC_GROUP *inner_group = NULL; + EC_KEY *ret = NULL; + BIGNUM *priv_key = NULL; + if (CBS_peek_asn1_tag(&ec_private_key, kParametersTag)) { + // Per SEC 1, as an alternative to omitting it, one is allowed to specify + // this field and put in a NULL to mean inheriting this value. This was + // omitted in a previous version of this logic without problems, so leave it + // unimplemented. + CBS child; + if (!CBS_get_asn1(&ec_private_key, &child, kParametersTag)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + inner_group = EC_KEY_parse_parameters(&child); + if (inner_group == NULL) { + goto err; + } + if (group == NULL) { + group = inner_group; + } else if (EC_GROUP_cmp(group, inner_group, NULL) != 0) { + // If a group was supplied externally, it must match. + OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); + goto err; + } + if (CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + } + + if (group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + goto err; + } + + ret = EC_KEY_new(); + if (ret == NULL || !EC_KEY_set_group(ret, group)) { + goto err; + } + + // Although RFC 5915 specifies the length of the key, OpenSSL historically + // got this wrong, so accept any length. See upstream's + // 30cd4ff294252c4b6a4b69cbef6a5b4117705d22. + priv_key = BN_bin2bn(CBS_data(&private_key), CBS_len(&private_key), NULL); + ret->pub_key = EC_POINT_new(group); + if (priv_key == NULL || ret->pub_key == NULL || + !EC_KEY_set_private_key(ret, priv_key)) { + goto err; + } + + if (CBS_peek_asn1_tag(&ec_private_key, kPublicKeyTag)) { + CBS child, public_key; + uint8_t padding; + if (!CBS_get_asn1(&ec_private_key, &child, kPublicKeyTag) || + !CBS_get_asn1(&child, &public_key, CBS_ASN1_BITSTRING) || + // As in a SubjectPublicKeyInfo, the byte-encoded public key is then + // encoded as a BIT STRING with bits ordered as in the DER encoding. + !CBS_get_u8(&public_key, &padding) || + padding != 0 || + // Explicitly check |public_key| is non-empty to save the conversion + // form later. + CBS_len(&public_key) == 0 || + !EC_POINT_oct2point(group, ret->pub_key, CBS_data(&public_key), + CBS_len(&public_key), NULL) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + + // Save the point conversion form. + // TODO(davidben): Consider removing this. + ret->conv_form = + (point_conversion_form_t)(CBS_data(&public_key)[0] & ~0x01); + } else { + // Compute the public key instead. + if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw, + &ret->priv_key->scalar)) { + goto err; + } + // Remember the original private-key-only encoding. + // TODO(davidben): Consider removing this. + ret->enc_flag |= EC_PKEY_NO_PUBKEY; + } + + if (CBS_len(&ec_private_key) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + goto err; + } + + // Ensure the resulting key is valid. + if (!EC_KEY_check_key(ret)) { + goto err; + } + + BN_free(priv_key); + EC_GROUP_free(inner_group); + return ret; + +err: + EC_KEY_free(ret); + BN_free(priv_key); + EC_GROUP_free(inner_group); + return NULL; +} + +int EC_KEY_marshal_private_key(CBB *cbb, const EC_KEY *key, + unsigned enc_flags) { + if (key == NULL || key->group == NULL || key->priv_key == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + CBB ec_private_key, private_key; + if (!CBB_add_asn1(cbb, &ec_private_key, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&ec_private_key, 1 /* version */) || + !CBB_add_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING) || + !BN_bn2cbb_padded(&private_key, + BN_num_bytes(EC_GROUP_get0_order(key->group)), + EC_KEY_get0_private_key(key))) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + + if (!(enc_flags & EC_PKEY_NO_PARAMETERS)) { + CBB child; + if (!CBB_add_asn1(&ec_private_key, &child, kParametersTag) || + !EC_KEY_marshal_curve_name(&child, key->group) || + !CBB_flush(&ec_private_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + } + + // TODO(fork): replace this flexibility with sensible default? + if (!(enc_flags & EC_PKEY_NO_PUBKEY) && key->pub_key != NULL) { + CBB child, public_key; + if (!CBB_add_asn1(&ec_private_key, &child, kPublicKeyTag) || + !CBB_add_asn1(&child, &public_key, CBS_ASN1_BITSTRING) || + // As in a SubjectPublicKeyInfo, the byte-encoded public key is then + // encoded as a BIT STRING with bits ordered as in the DER encoding. + !CBB_add_u8(&public_key, 0 /* padding */) || + !EC_POINT_point2cbb(&public_key, key->group, key->pub_key, + key->conv_form, NULL) || + !CBB_flush(&ec_private_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + } + + if (!CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(EC, EC_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +// is_unsigned_integer returns one if |cbs| is a valid unsigned DER INTEGER and +// zero otherwise. +static int is_unsigned_integer(const CBS *cbs) { + if (CBS_len(cbs) == 0) { + return 0; + } + uint8_t byte = CBS_data(cbs)[0]; + if ((byte & 0x80) || + (byte == 0 && CBS_len(cbs) > 1 && (CBS_data(cbs)[1] & 0x80) == 0)) { + // Negative or not minimally-encoded. + return 0; + } + return 1; +} + +// kPrimeFieldOID is the encoding of 1.2.840.10045.1.1. +static const uint8_t kPrimeField[] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01}; + +static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, + CBS *out_b, CBS *out_base_x, + 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, cofactor; + int has_cofactor; + uint64_t version; + if (!CBS_get_asn1(in, ¶ms, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(¶ms, &version) || + version != 1 || + !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 || + !CBS_get_asn1(&field_id, out_prime, CBS_ASN1_INTEGER) || + !is_unsigned_integer(out_prime) || + CBS_len(&field_id) != 0 || + !CBS_get_asn1(¶ms, &curve, CBS_ASN1_SEQUENCE) || + !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) || + !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; + } + + 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; + if (!CBS_get_u8(&base, &form) || form != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); + return 0; + } + + if (CBS_len(&base) % 2 != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return 0; + } + size_t field_len = CBS_len(&base) / 2; + CBS_init(out_base_x, CBS_data(&base), field_len); + CBS_init(out_base_y, CBS_data(&base) + field_len, field_len); + + return 1; +} + +// integers_equal returns one if |a| and |b| are equal, up to leading zeros, and +// zero otherwise. +static int integers_equal(const CBS *a, const uint8_t *b, size_t b_len) { + // Remove leading zeros from |a| and |b|. + CBS a_copy = *a; + while (CBS_len(&a_copy) > 0 && CBS_data(&a_copy)[0] == 0) { + CBS_skip(&a_copy, 1); + } + while (b_len > 0 && b[0] == 0) { + b++; + b_len--; + } + return CBS_mem_equal(&a_copy, b, b_len); +} + +EC_GROUP *EC_KEY_parse_curve_name(CBS *cbs) { + CBS named_curve; + if (!CBS_get_asn1(cbs, &named_curve, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + + // Look for a matching curve. + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + if (CBS_len(&named_curve) == curve->oid_len && + OPENSSL_memcmp(CBS_data(&named_curve), curve->oid, curve->oid_len) == + 0) { + return EC_GROUP_new_by_curve_name(curve->nid); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; +} + +int EC_KEY_marshal_curve_name(CBB *cbb, const EC_GROUP *group) { + int nid = EC_GROUP_get_curve_name(group); + if (nid == NID_undef) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; + } + + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + if (curve->nid == nid) { + CBB child; + return CBB_add_asn1(cbb, &child, CBS_ASN1_OBJECT) && + CBB_add_bytes(&child, curve->oid, curve->oid_len) && + CBB_flush(cbb); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; +} + +EC_GROUP *EC_KEY_parse_parameters(CBS *cbs) { + if (!CBS_peek_asn1_tag(cbs, CBS_ASN1_SEQUENCE)) { + return EC_KEY_parse_curve_name(cbs); + } + + // OpenSSL sometimes produces ECPrivateKeys with explicitly-encoded versions + // of named curves. + // + // TODO(davidben): Remove support for this. + CBS prime, a, b, base_x, base_y, order; + if (!parse_explicit_prime_curve(cbs, &prime, &a, &b, &base_x, &base_y, + &order)) { + return NULL; + } + + // Look for a matching prime curve. + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + const struct built_in_curve *curve = &curves->curves[i]; + const unsigned param_len = curve->param_len; + // |curve->params| is ordered p, a, b, x, y, order, each component + // zero-padded up to the field length. Although SEC 1 states that the + // Field-Element-to-Octet-String conversion also pads, OpenSSL mis-encodes + // |a| and |b|, so this comparison must allow omitting leading zeros. (This + // is relevant for P-521 whose |b| has a leading 0.) + if (integers_equal(&prime, curve->params, param_len) && + integers_equal(&a, curve->params + param_len, param_len) && + integers_equal(&b, curve->params + param_len * 2, param_len) && + integers_equal(&base_x, curve->params + param_len * 3, param_len) && + integers_equal(&base_y, curve->params + param_len * 4, param_len) && + integers_equal(&order, curve->params + param_len * 5, param_len)) { + return EC_GROUP_new_by_curve_name(curve->nid); + } + } + + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; +} + +int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, const EC_POINT *point, + point_conversion_form_t form, BN_CTX *ctx) { + size_t len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx); + if (len == 0) { + return 0; + } + uint8_t *p; + return CBB_add_space(out, &p, len) && + EC_POINT_point2oct(group, point, form, p, len, ctx) == len; +} + +EC_KEY *d2i_ECPrivateKey(EC_KEY **out, const uint8_t **inp, long len) { + // This function treats its |out| parameter differently from other |d2i| + // functions. If supplied, take the group from |*out|. + const EC_GROUP *group = NULL; + if (out != NULL && *out != NULL) { + group = EC_KEY_get0_group(*out); + } + + if (len < 0) { + OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EC_KEY *ret = EC_KEY_parse_private_key(&cbs, group); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + EC_KEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EC_KEY_marshal_private_key(&cbb, key, EC_KEY_get_enc_flags(key))) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +EC_KEY *d2i_ECParameters(EC_KEY **out_key, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EC_GROUP *group = EC_KEY_parse_parameters(&cbs); + if (group == NULL) { + return NULL; + } + + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL || !EC_KEY_set_group(ret, group)) { + EC_GROUP_free(group); + EC_KEY_free(ret); + return NULL; + } + EC_GROUP_free(group); + + if (out_key != NULL) { + EC_KEY_free(*out_key); + *out_key = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECParameters(const EC_KEY *key, uint8_t **outp) { + if (key == NULL || key->group == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return -1; + } + + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EC_KEY_marshal_curve_name(&cbb, key->group)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +EC_KEY *o2i_ECPublicKey(EC_KEY **keyp, const uint8_t **inp, long len) { + EC_KEY *ret = NULL; + + if (keyp == NULL || *keyp == NULL || (*keyp)->group == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + ret = *keyp; + if (ret->pub_key == NULL && + (ret->pub_key = EC_POINT_new(ret->group)) == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (!EC_POINT_oct2point(ret->group, ret->pub_key, *inp, len, NULL)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + return NULL; + } + // save the point conversion form + ret->conv_form = (point_conversion_form_t)(*inp[0] & ~0x01); + *inp += len; + return ret; +} + +int i2o_ECPublicKey(const EC_KEY *key, uint8_t **outp) { + size_t buf_len = 0; + int new_buffer = 0; + + if (key == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + buf_len = EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, NULL, + 0, NULL); + + if (outp == NULL || buf_len == 0) { + // out == NULL => just return the length of the octet string + return buf_len; + } + + if (*outp == NULL) { + *outp = OPENSSL_malloc(buf_len); + if (*outp == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return 0; + } + new_buffer = 1; + } + if (!EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, *outp, + buf_len, NULL)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + if (new_buffer) { + OPENSSL_free(*outp); + *outp = NULL; + } + return 0; + } + + if (!new_buffer) { + *outp += buf_len; + } + return buf_len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c new file mode 100644 index 0000000..f906e95 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c.grpc_back new file mode 100644 index 0000000..6904d7b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c new file mode 100644 index 0000000..5626e05 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c.grpc_back new file mode 100644 index 0000000..b8a099a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c new file mode 100644 index 0000000..0bb1e23 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c @@ -0,0 +1,267 @@ +/* ==================================================================== + * 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 "../bytestring/internal.h" +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +int ECDSA_sign(int type, const uint8_t *digest, size_t digest_len, uint8_t *sig, + unsigned int *sig_len, const EC_KEY *eckey) { + if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { + return eckey->ecdsa_meth->sign(digest, digest_len, sig, sig_len, + (EC_KEY*) eckey /* cast away const */); + } + + int ret = 0; + ECDSA_SIG *s = ECDSA_do_sign(digest, digest_len, eckey); + if (s == NULL) { + *sig_len = 0; + goto err; + } + + CBB cbb; + CBB_zero(&cbb); + size_t len; + if (!CBB_init_fixed(&cbb, sig, ECDSA_size(eckey)) || + !ECDSA_SIG_marshal(&cbb, s) || + !CBB_finish(&cbb, NULL, &len)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + *sig_len = 0; + goto err; + } + *sig_len = (unsigned)len; + ret = 1; + +err: + ECDSA_SIG_free(s); + return ret; +} + +int ECDSA_verify(int type, const uint8_t *digest, size_t digest_len, + const uint8_t *sig, size_t sig_len, const EC_KEY *eckey) { + ECDSA_SIG *s; + int ret = 0; + uint8_t *der = NULL; + + // Decode the ECDSA signature. + s = ECDSA_SIG_from_bytes(sig, sig_len); + if (s == NULL) { + goto err; + } + + // Defend against potential laxness in the DER parser. + size_t der_len; + if (!ECDSA_SIG_to_bytes(&der, &der_len, s) || + der_len != sig_len || OPENSSL_memcmp(sig, der, sig_len) != 0) { + // This should never happen. crypto/bytestring is strictly DER. + OPENSSL_PUT_ERROR(ECDSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + ret = ECDSA_do_verify(digest, digest_len, s, eckey); + +err: + OPENSSL_free(der); + ECDSA_SIG_free(s); + return ret; +} + + +size_t ECDSA_size(const EC_KEY *key) { + if (key == NULL) { + return 0; + } + + size_t group_order_size; + if (key->ecdsa_meth && key->ecdsa_meth->group_order_size) { + group_order_size = key->ecdsa_meth->group_order_size(key); + } else { + const EC_GROUP *group = EC_KEY_get0_group(key); + if (group == NULL) { + return 0; + } + + group_order_size = BN_num_bytes(EC_GROUP_get0_order(group)); + } + + return ECDSA_SIG_max_len(group_order_size); +} + +ECDSA_SIG *ECDSA_SIG_parse(CBS *cbs) { + ECDSA_SIG *ret = ECDSA_SIG_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !BN_parse_asn1_unsigned(&child, ret->r) || + !BN_parse_asn1_unsigned(&child, ret->s) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + ECDSA_SIG_free(ret); + return NULL; + } + return ret; +} + +ECDSA_SIG *ECDSA_SIG_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + ECDSA_SIG_free(ret); + return NULL; + } + return ret; +} + +int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !BN_marshal_asn1(&child, sig->r) || + !BN_marshal_asn1(&child, sig->s) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int ECDSA_SIG_to_bytes(uint8_t **out_bytes, size_t *out_len, + const ECDSA_SIG *sig) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !ECDSA_SIG_marshal(&cbb, sig) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +// der_len_len returns the number of bytes needed to represent a length of |len| +// in DER. +static size_t der_len_len(size_t len) { + if (len < 0x80) { + return 1; + } + size_t ret = 1; + while (len > 0) { + ret++; + len >>= 8; + } + return ret; +} + +size_t ECDSA_SIG_max_len(size_t order_len) { + // Compute the maximum length of an |order_len| byte integer. Defensively + // assume that the leading 0x00 is included. + size_t integer_len = 1 /* tag */ + der_len_len(order_len + 1) + 1 + order_len; + if (integer_len < order_len) { + return 0; + } + // An ECDSA signature is two INTEGERs. + size_t value_len = 2 * integer_len; + if (value_len < integer_len) { + return 0; + } + // Add the header. + size_t ret = 1 /* tag */ + der_len_len(value_len) + value_len; + if (ret < value_len) { + return 0; + } + return ret; +} + +ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + ECDSA_SIG_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !ECDSA_SIG_marshal(&cbb, sig)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back new file mode 100644 index 0000000..e6212cc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back @@ -0,0 +1,267 @@ +/* ==================================================================== + * 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 "../bytestring/internal.h" +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +int ECDSA_sign(int type, const uint8_t *digest, size_t digest_len, uint8_t *sig, + unsigned int *sig_len, const EC_KEY *eckey) { + if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { + return eckey->ecdsa_meth->sign(digest, digest_len, sig, sig_len, + (EC_KEY*) eckey /* cast away const */); + } + + int ret = 0; + ECDSA_SIG *s = ECDSA_do_sign(digest, digest_len, eckey); + if (s == NULL) { + *sig_len = 0; + goto err; + } + + CBB cbb; + CBB_zero(&cbb); + size_t len; + if (!CBB_init_fixed(&cbb, sig, ECDSA_size(eckey)) || + !ECDSA_SIG_marshal(&cbb, s) || + !CBB_finish(&cbb, NULL, &len)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + *sig_len = 0; + goto err; + } + *sig_len = (unsigned)len; + ret = 1; + +err: + ECDSA_SIG_free(s); + return ret; +} + +int ECDSA_verify(int type, const uint8_t *digest, size_t digest_len, + const uint8_t *sig, size_t sig_len, const EC_KEY *eckey) { + ECDSA_SIG *s; + int ret = 0; + uint8_t *der = NULL; + + // Decode the ECDSA signature. + s = ECDSA_SIG_from_bytes(sig, sig_len); + if (s == NULL) { + goto err; + } + + // Defend against potential laxness in the DER parser. + size_t der_len; + if (!ECDSA_SIG_to_bytes(&der, &der_len, s) || + der_len != sig_len || OPENSSL_memcmp(sig, der, sig_len) != 0) { + // This should never happen. crypto/bytestring is strictly DER. + OPENSSL_PUT_ERROR(ECDSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + ret = ECDSA_do_verify(digest, digest_len, s, eckey); + +err: + OPENSSL_free(der); + ECDSA_SIG_free(s); + return ret; +} + + +size_t ECDSA_size(const EC_KEY *key) { + if (key == NULL) { + return 0; + } + + size_t group_order_size; + if (key->ecdsa_meth && key->ecdsa_meth->group_order_size) { + group_order_size = key->ecdsa_meth->group_order_size(key); + } else { + const EC_GROUP *group = EC_KEY_get0_group(key); + if (group == NULL) { + return 0; + } + + group_order_size = BN_num_bytes(EC_GROUP_get0_order(group)); + } + + return ECDSA_SIG_max_len(group_order_size); +} + +ECDSA_SIG *ECDSA_SIG_parse(CBS *cbs) { + ECDSA_SIG *ret = ECDSA_SIG_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !BN_parse_asn1_unsigned(&child, ret->r) || + !BN_parse_asn1_unsigned(&child, ret->s) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + ECDSA_SIG_free(ret); + return NULL; + } + return ret; +} + +ECDSA_SIG *ECDSA_SIG_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + ECDSA_SIG_free(ret); + return NULL; + } + return ret; +} + +int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !BN_marshal_asn1(&child, sig->r) || + !BN_marshal_asn1(&child, sig->s) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int ECDSA_SIG_to_bytes(uint8_t **out_bytes, size_t *out_len, + const ECDSA_SIG *sig) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !ECDSA_SIG_marshal(&cbb, sig) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +// der_len_len returns the number of bytes needed to represent a length of |len| +// in DER. +static size_t der_len_len(size_t len) { + if (len < 0x80) { + return 1; + } + size_t ret = 1; + while (len > 0) { + ret++; + len >>= 8; + } + return ret; +} + +size_t ECDSA_SIG_max_len(size_t order_len) { + // Compute the maximum length of an |order_len| byte integer. Defensively + // assume that the leading 0x00 is included. + size_t integer_len = 1 /* tag */ + der_len_len(order_len + 1) + 1 + order_len; + if (integer_len < order_len) { + return 0; + } + // An ECDSA signature is two INTEGERs. + size_t value_len = 2 * integer_len; + if (value_len < integer_len) { + return 0; + } + // Add the header. + size_t ret = 1 /* tag */ + der_len_len(value_len) + value_len; + if (ret < value_len) { + return 0; + } + return ret; +} + +ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + ECDSA_SIG_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !ECDSA_SIG_marshal(&cbb, sig)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c new file mode 100644 index 0000000..678d703 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c @@ -0,0 +1,99 @@ +/* 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 "../internal.h" + + +struct engine_st { + RSA_METHOD *rsa_method; + ECDSA_METHOD *ecdsa_method; +}; + +ENGINE *ENGINE_new(void) { + ENGINE *engine = OPENSSL_malloc(sizeof(ENGINE)); + if (engine == NULL) { + return NULL; + } + + OPENSSL_memset(engine, 0, sizeof(ENGINE)); + return 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 +// |*out_member| to point to it. This function might want to be extended in the +// future to support making a copy of the method so that a stable ABI for +// ENGINEs can be supported. But, for the moment, all *_METHODS must be +// static. +static int set_method(void **out_member, const void *method, size_t method_size, + size_t compiled_size) { + const struct openssl_method_common_st *common = method; + if (method_size != compiled_size || !common->is_static) { + return 0; + } + + *out_member = (void*) method; + return 1; +} + +int ENGINE_set_RSA_method(ENGINE *engine, const RSA_METHOD *method, + size_t method_size) { + return set_method((void **)&engine->rsa_method, method, method_size, + sizeof(RSA_METHOD)); +} + +RSA_METHOD *ENGINE_get_RSA_method(const ENGINE *engine) { + return engine->rsa_method; +} + +int ENGINE_set_ECDSA_method(ENGINE *engine, const ECDSA_METHOD *method, + size_t method_size) { + return set_method((void **)&engine->ecdsa_method, method, method_size, + sizeof(ECDSA_METHOD)); +} + +ECDSA_METHOD *ENGINE_get_ECDSA_method(const ENGINE *engine) { + return engine->ecdsa_method; +} + +void METHOD_ref(void *method_in) { + assert(((struct openssl_method_common_st*) method_in)->is_static); +} + +void METHOD_unref(void *method_in) { + struct openssl_method_common_st *method = method_in; + + if (method == NULL) { + return; + } + assert(method->is_static); +} + +OPENSSL_DECLARE_ERROR_REASON(ENGINE, OPERATION_NOT_SUPPORTED) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back new file mode 100644 index 0000000..973a57c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back @@ -0,0 +1,99 @@ +/* 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 "../internal.h" + + +struct engine_st { + RSA_METHOD *rsa_method; + ECDSA_METHOD *ecdsa_method; +}; + +ENGINE *ENGINE_new(void) { + ENGINE *engine = OPENSSL_malloc(sizeof(ENGINE)); + if (engine == NULL) { + return NULL; + } + + OPENSSL_memset(engine, 0, sizeof(ENGINE)); + return 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 +// |*out_member| to point to it. This function might want to be extended in the +// future to support making a copy of the method so that a stable ABI for +// ENGINEs can be supported. But, for the moment, all *_METHODS must be +// static. +static int set_method(void **out_member, const void *method, size_t method_size, + size_t compiled_size) { + const struct openssl_method_common_st *common = method; + if (method_size != compiled_size || !common->is_static) { + return 0; + } + + *out_member = (void*) method; + return 1; +} + +int ENGINE_set_RSA_method(ENGINE *engine, const RSA_METHOD *method, + size_t method_size) { + return set_method((void **)&engine->rsa_method, method, method_size, + sizeof(RSA_METHOD)); +} + +RSA_METHOD *ENGINE_get_RSA_method(const ENGINE *engine) { + return engine->rsa_method; +} + +int ENGINE_set_ECDSA_method(ENGINE *engine, const ECDSA_METHOD *method, + size_t method_size) { + return set_method((void **)&engine->ecdsa_method, method, method_size, + sizeof(ECDSA_METHOD)); +} + +ECDSA_METHOD *ENGINE_get_ECDSA_method(const ENGINE *engine) { + return engine->ecdsa_method; +} + +void METHOD_ref(void *method_in) { + assert(((struct openssl_method_common_st*) method_in)->is_static); +} + +void METHOD_unref(void *method_in) { + struct openssl_method_common_st *method = method_in; + + if (method == NULL) { + return; + } + assert(method->is_static); +} + +OPENSSL_DECLARE_ERROR_REASON(ENGINE, OPERATION_NOT_SUPPORTED) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c new file mode 100644 index 0000000..5f05f1f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c @@ -0,0 +1,849 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#if defined(OPENSSL_WINDOWS) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "../internal.h" +#include "./internal.h" + + +struct err_error_st { + // file contains the filename where the error occurred. + const char *file; + // data contains a NUL-terminated string with optional data. It must be freed + // with |OPENSSL_free|. + char *data; + // packed contains the error library and reason, as packed by ERR_PACK. + uint32_t packed; + // line contains the line number where the error occurred. + uint16_t line; + // mark indicates a reversion point in the queue. See |ERR_pop_to_mark|. + unsigned mark : 1; +}; + +// ERR_STATE contains the per-thread, error queue. +typedef struct err_state_st { + // errors contains the ERR_NUM_ERRORS most recent errors, organised as a ring + // buffer. + struct err_error_st errors[ERR_NUM_ERRORS]; + // top contains the index one past the most recent error. If |top| equals + // |bottom| then the queue is empty. + unsigned top; + // bottom contains the index of the last error in the queue. + unsigned bottom; + + // to_free, if not NULL, contains a pointer owned by this structure that was + // previously a |data| pointer of one of the elements of |errors|. + void *to_free; +} ERR_STATE; + +extern const uint32_t kOpenSSLReasonValues[]; +extern const size_t kOpenSSLReasonValuesLen; +extern const char kOpenSSLReasonStringData[]; + +// err_clear clears the given queued error. +static void err_clear(struct err_error_st *error) { + OPENSSL_free(error->data); + OPENSSL_memset(error, 0, sizeof(struct err_error_st)); +} + +static void err_copy(struct err_error_st *dst, const struct err_error_st *src) { + err_clear(dst); + dst->file = src->file; + if (src->data != NULL) { + dst->data = OPENSSL_strdup(src->data); + } + dst->packed = src->packed; + dst->line = src->line; +} + +// global_next_library contains the next custom library value to return. +static int global_next_library = ERR_NUM_LIBS; + +// global_next_library_mutex protects |global_next_library| from concurrent +// updates. +static struct CRYPTO_STATIC_MUTEX global_next_library_mutex = + CRYPTO_STATIC_MUTEX_INIT; + +static void err_state_free(void *statep) { + ERR_STATE *state = statep; + + if (state == NULL) { + return; + } + + for (unsigned i = 0; i < ERR_NUM_ERRORS; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->to_free); + OPENSSL_free(state); +} + +// err_get_state gets the ERR_STATE object for the current thread. +static ERR_STATE *err_get_state(void) { + ERR_STATE *state = CRYPTO_get_thread_local(OPENSSL_THREAD_LOCAL_ERR); + if (state == NULL) { + state = OPENSSL_malloc(sizeof(ERR_STATE)); + if (state == NULL) { + return NULL; + } + OPENSSL_memset(state, 0, sizeof(ERR_STATE)); + if (!CRYPTO_set_thread_local(OPENSSL_THREAD_LOCAL_ERR, state, + err_state_free)) { + return NULL; + } + } + + return state; +} + +static uint32_t get_error_values(int inc, int top, const char **file, int *line, + const char **data, int *flags) { + unsigned i = 0; + ERR_STATE *state; + struct err_error_st *error; + uint32_t ret; + + state = err_get_state(); + if (state == NULL || state->bottom == state->top) { + return 0; + } + + if (top) { + assert(!inc); + // last error + i = state->top; + } else { + i = (state->bottom + 1) % ERR_NUM_ERRORS; + } + + error = &state->errors[i]; + ret = error->packed; + + if (file != NULL && line != NULL) { + if (error->file == NULL) { + *file = "NA"; + *line = 0; + } else { + *file = error->file; + *line = error->line; + } + } + + if (data != NULL) { + if (error->data == NULL) { + *data = ""; + if (flags != NULL) { + *flags = 0; + } + } else { + *data = error->data; + if (flags != NULL) { + *flags = ERR_FLAG_STRING; + } + // If this error is being removed, take ownership of data from + // the error. The semantics are such that the caller doesn't + // take ownership either. Instead the error system takes + // ownership and retains it until the next call that affects the + // error queue. + if (inc) { + if (error->data != NULL) { + OPENSSL_free(state->to_free); + state->to_free = error->data; + } + error->data = NULL; + } + } + } + + if (inc) { + assert(!top); + err_clear(error); + state->bottom = i; + } + + return ret; +} + +uint32_t ERR_get_error(void) { + return get_error_values(1 /* inc */, 0 /* bottom */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_get_error_line(const char **file, int *line) { + return get_error_values(1 /* inc */, 0 /* bottom */, file, line, NULL, NULL); +} + +uint32_t ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(1 /* inc */, 0 /* bottom */, file, line, data, flags); +} + +uint32_t ERR_peek_error(void) { + return get_error_values(0 /* peek */, 0 /* bottom */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_peek_error_line(const char **file, int *line) { + return get_error_values(0 /* peek */, 0 /* bottom */, file, line, NULL, NULL); +} + +uint32_t ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(0 /* peek */, 0 /* bottom */, file, line, data, + flags); +} + +uint32_t ERR_peek_last_error(void) { + return get_error_values(0 /* peek */, 1 /* top */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_peek_last_error_line(const char **file, int *line) { + return get_error_values(0 /* peek */, 1 /* top */, file, line, NULL, NULL); +} + +uint32_t ERR_peek_last_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(0 /* peek */, 1 /* top */, file, line, data, flags); +} + +void ERR_clear_error(void) { + ERR_STATE *const state = err_get_state(); + unsigned i; + + if (state == NULL) { + return; + } + + for (i = 0; i < ERR_NUM_ERRORS; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->to_free); + state->to_free = NULL; + + state->top = state->bottom = 0; +} + +void ERR_remove_thread_state(const CRYPTO_THREADID *tid) { + if (tid != NULL) { + assert(0); + return; + } + + ERR_clear_error(); +} + +int ERR_get_next_error_library(void) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&global_next_library_mutex); + ret = global_next_library++; + CRYPTO_STATIC_MUTEX_unlock_write(&global_next_library_mutex); + + return ret; +} + +void ERR_remove_state(unsigned long pid) { + ERR_clear_error(); +} + +void ERR_clear_system_error(void) { + errno = 0; +} + +char *ERR_error_string(uint32_t packed_error, char *ret) { + static char buf[ERR_ERROR_STRING_BUF_LEN]; + + if (ret == NULL) { + // TODO(fork): remove this. + ret = buf; + } + +#if !defined(NDEBUG) + // This is aimed to help catch callers who don't provide + // |ERR_ERROR_STRING_BUF_LEN| bytes of space. + OPENSSL_memset(ret, 0, ERR_ERROR_STRING_BUF_LEN); +#endif + + return ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_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 NULL; + } + + lib = ERR_GET_LIB(packed_error); + reason = ERR_GET_REASON(packed_error); + + lib_str = ERR_lib_error_string(packed_error); + reason_str = ERR_reason_error_string(packed_error); + + if (lib_str == NULL) { + BIO_snprintf(lib_buf, sizeof(lib_buf), "lib(%u)", lib); + lib_str = lib_buf; + } + + if (reason_str == NULL) { + BIO_snprintf(reason_buf, sizeof(reason_buf), "reason(%u)", reason); + reason_str = reason_buf; + } + + BIO_snprintf(buf, len, "error:%08" PRIx32 ":%s:OPENSSL_internal:%s", + packed_error, lib_str, reason_str); + + if (strlen(buf) == len - 1) { + // output may be truncated; make sure we always have 5 colon-separated + // fields, i.e. 4 colons. + static const unsigned num_colons = 4; + unsigned i; + char *s = buf; + + 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 buf; + } + + for (i = 0; i < num_colons; i++) { + char *colon = strchr(s, ':'); + char *last_pos = &buf[len - 1] - num_colons + i; + + if (colon == NULL || colon > last_pos) { + // set colon |i| at last possible position (buf[len-1] is the + // terminating 0). If we're setting this colon, then all whole of the + // rest of the string must be colons in order to have the correct + // number. + OPENSSL_memset(last_pos, ':', num_colons - i); + break; + } + + s = colon + 1; + } + } + + return buf; +} + +// err_string_cmp is a compare function for searching error values with +// |bsearch| in |err_string_lookup|. +static int err_string_cmp(const void *a, const void *b) { + const uint32_t a_key = *((const uint32_t*) a) >> 15; + const uint32_t b_key = *((const uint32_t*) b) >> 15; + + if (a_key < b_key) { + return -1; + } else if (a_key > b_key) { + return 1; + } else { + return 0; + } +} + +// err_string_lookup looks up the string associated with |lib| and |key| in +// |values| and |string_data|. It returns the string or NULL if not found. +static const char *err_string_lookup(uint32_t lib, uint32_t key, + const uint32_t *values, + size_t num_values, + const char *string_data) { + // |values| points to data in err_data.h, which is generated by + // err_data_generate.go. It's an array of uint32_t values. Each value has the + // following structure: + // | lib | key | offset | + // |6 bits| 11 bits | 15 bits | + // + // The |lib| value is a library identifier: one of the |ERR_LIB_*| values. + // The |key| is a reason code, depending on the context. + // The |offset| is the number of bytes from the start of |string_data| where + // the (NUL terminated) string for this value can be found. + // + // Values are sorted based on treating the |lib| and |key| part as an + // unsigned integer. + if (lib >= (1 << 6) || key >= (1 << 11)) { + return NULL; + } + uint32_t search_key = lib << 26 | key << 15; + const uint32_t *result = bsearch(&search_key, values, num_values, + sizeof(uint32_t), err_string_cmp); + if (result == NULL) { + return NULL; + } + + return &string_data[(*result) & 0x7fff]; +} + +static const char *const kLibraryNames[ERR_NUM_LIBS] = { + "invalid library (0)", + "unknown library", // ERR_LIB_NONE + "system library", // ERR_LIB_SYS + "bignum routines", // ERR_LIB_BN + "RSA routines", // ERR_LIB_RSA + "Diffie-Hellman routines", // ERR_LIB_DH + "public key routines", // ERR_LIB_EVP + "memory buffer routines", // ERR_LIB_BUF + "object identifier routines", // ERR_LIB_OBJ + "PEM routines", // ERR_LIB_PEM + "DSA routines", // ERR_LIB_DSA + "X.509 certificate routines", // ERR_LIB_X509 + "ASN.1 encoding routines", // ERR_LIB_ASN1 + "configuration file routines", // ERR_LIB_CONF + "common libcrypto routines", // ERR_LIB_CRYPTO + "elliptic curve routines", // ERR_LIB_EC + "SSL routines", // ERR_LIB_SSL + "BIO routines", // ERR_LIB_BIO + "PKCS7 routines", // ERR_LIB_PKCS7 + "PKCS8 routines", // ERR_LIB_PKCS8 + "X509 V3 routines", // ERR_LIB_X509V3 + "random number generator", // ERR_LIB_RAND + "ENGINE routines", // ERR_LIB_ENGINE + "OCSP routines", // ERR_LIB_OCSP + "UI routines", // ERR_LIB_UI + "COMP routines", // ERR_LIB_COMP + "ECDSA routines", // ERR_LIB_ECDSA + "ECDH routines", // ERR_LIB_ECDH + "HMAC routines", // ERR_LIB_HMAC + "Digest functions", // ERR_LIB_DIGEST + "Cipher functions", // ERR_LIB_CIPHER + "HKDF functions", // ERR_LIB_HKDF + "User defined functions", // ERR_LIB_USER +}; + +const char *ERR_lib_error_string(uint32_t packed_error) { + const uint32_t lib = ERR_GET_LIB(packed_error); + + if (lib >= ERR_NUM_LIBS) { + return NULL; + } + return kLibraryNames[lib]; +} + +const char *ERR_func_error_string(uint32_t packed_error) { + return "OPENSSL_internal"; +} + +const char *ERR_reason_error_string(uint32_t packed_error) { + const uint32_t lib = ERR_GET_LIB(packed_error); + const uint32_t reason = ERR_GET_REASON(packed_error); + + if (lib == ERR_LIB_SYS) { + if (reason < 127) { + return strerror(reason); + } + return NULL; + } + + if (reason < ERR_NUM_LIBS) { + return kLibraryNames[reason]; + } + + if (reason < 100) { + switch (reason) { + case ERR_R_MALLOC_FAILURE: + return "malloc failure"; + case ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED: + return "function should not have been called"; + case ERR_R_PASSED_NULL_PARAMETER: + return "passed a null parameter"; + case ERR_R_INTERNAL_ERROR: + return "internal error"; + case ERR_R_OVERFLOW: + return "overflow"; + default: + return NULL; + } + } + + return err_string_lookup(lib, reason, kOpenSSLReasonValues, + kOpenSSLReasonValuesLen, kOpenSSLReasonStringData); +} + +void ERR_print_errors_cb(ERR_print_errors_callback_t callback, void *ctx) { + char buf[ERR_ERROR_STRING_BUF_LEN]; + char buf2[1024]; + const char *file, *data; + int line, flags; + uint32_t packed_error; + + // thread_hash is the least-significant bits of the |ERR_STATE| pointer value + // for this thread. + const unsigned long thread_hash = (uintptr_t) err_get_state(); + + for (;;) { + packed_error = ERR_get_error_line_data(&file, &line, &data, &flags); + if (packed_error == 0) { + break; + } + + ERR_error_string_n(packed_error, buf, sizeof(buf)); + BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", thread_hash, buf, + file, line, (flags & ERR_FLAG_STRING) ? data : ""); + if (callback(buf2, strlen(buf2), ctx) <= 0) { + break; + } + } +} + +static int print_errors_to_file(const char* msg, size_t msg_len, void* ctx) { + assert(msg[msg_len] == '\0'); + FILE* fp = ctx; + int res = fputs(msg, fp); + return res < 0 ? 0 : 1; +} + +void ERR_print_errors_fp(FILE *file) { + ERR_print_errors_cb(print_errors_to_file, file); +} + +// err_set_error_data sets the data on the most recent error. +static void err_set_error_data(char *data) { + ERR_STATE *const state = err_get_state(); + struct err_error_st *error; + + if (state == NULL || state->top == state->bottom) { + OPENSSL_free(data); + return; + } + + error = &state->errors[state->top]; + + OPENSSL_free(error->data); + error->data = data; +} + +void ERR_put_error(int library, int unused, int reason, const char *file, + unsigned line) { + ERR_STATE *const state = err_get_state(); + struct err_error_st *error; + + if (state == NULL) { + return; + } + + if (library == ERR_LIB_SYS && reason == 0) { +#if defined(OPENSSL_WINDOWS) + reason = GetLastError(); +#else + reason = errno; +#endif + } + + state->top = (state->top + 1) % ERR_NUM_ERRORS; + if (state->top == state->bottom) { + state->bottom = (state->bottom + 1) % ERR_NUM_ERRORS; + } + + error = &state->errors[state->top]; + err_clear(error); + error->file = file; + error->line = line; + error->packed = ERR_PACK(library, reason); +} + +// ERR_add_error_data_vdata takes a variable number of const char* pointers, +// concatenates them and sets the result as the data on the most recent +// error. +static void err_add_error_vdata(unsigned num, va_list args) { + size_t alloced, new_len, len = 0, substr_len; + char *buf; + const char *substr; + unsigned i; + + alloced = 80; + buf = OPENSSL_malloc(alloced + 1); + if (buf == NULL) { + return; + } + + for (i = 0; i < num; i++) { + substr = va_arg(args, const char *); + if (substr == NULL) { + continue; + } + + substr_len = strlen(substr); + new_len = len + substr_len; + if (new_len > alloced) { + char *new_buf; + + if (alloced + 20 + 1 < alloced) { + // overflow. + OPENSSL_free(buf); + return; + } + + alloced = new_len + 20; + new_buf = OPENSSL_realloc(buf, alloced + 1); + if (new_buf == NULL) { + OPENSSL_free(buf); + return; + } + buf = new_buf; + } + + OPENSSL_memcpy(buf + len, substr, substr_len); + len = new_len; + } + + buf[len] = 0; + err_set_error_data(buf); +} + +void ERR_add_error_data(unsigned count, ...) { + va_list args; + va_start(args, count); + err_add_error_vdata(count, args); + va_end(args); +} + +void ERR_add_error_dataf(const char *format, ...) { + va_list ap; + char *buf; + static const unsigned buf_len = 256; + + // A fixed-size buffer is used because va_copy (which would be needed in + // order to call vsnprintf twice and measure the buffer) wasn't defined until + // C99. + buf = OPENSSL_malloc(buf_len + 1); + if (buf == NULL) { + return; + } + + va_start(ap, format); + BIO_vsnprintf(buf, buf_len, format, ap); + buf[buf_len] = 0; + va_end(ap); + + err_set_error_data(buf); +} + +int ERR_set_mark(void) { + ERR_STATE *const state = err_get_state(); + + if (state == NULL || state->bottom == state->top) { + return 0; + } + state->errors[state->top].mark = 1; + return 1; +} + +int ERR_pop_to_mark(void) { + ERR_STATE *const state = err_get_state(); + + if (state == NULL) { + return 0; + } + + while (state->bottom != state->top) { + struct err_error_st *error = &state->errors[state->top]; + + if (error->mark) { + error->mark = 0; + return 1; + } + + err_clear(error); + if (state->top == 0) { + state->top = ERR_NUM_ERRORS - 1; + } else { + state->top--; + } + } + + return 0; +} + +void ERR_load_crypto_strings(void) {} + +void ERR_free_strings(void) {} + +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; +}; + +void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state) { + if (state == NULL) { + return; + } + for (size_t i = 0; i < state->num_errors; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->errors); + OPENSSL_free(state); +} + +ERR_SAVE_STATE *ERR_save_state(void) { + ERR_STATE *const state = err_get_state(); + if (state == NULL || state->top == state->bottom) { + return NULL; + } + + ERR_SAVE_STATE *ret = OPENSSL_malloc(sizeof(ERR_SAVE_STATE)); + if (ret == NULL) { + return NULL; + } + + // Errors are stored in the range (bottom, top]. + size_t num_errors = state->top >= state->bottom + ? state->top - state->bottom + : ERR_NUM_ERRORS + state->top - state->bottom; + assert(num_errors < ERR_NUM_ERRORS); + ret->errors = OPENSSL_malloc(num_errors * sizeof(struct err_error_st)); + if (ret->errors == NULL) { + OPENSSL_free(ret); + return NULL; + } + OPENSSL_memset(ret->errors, 0, num_errors * sizeof(struct err_error_st)); + ret->num_errors = num_errors; + + for (size_t i = 0; i < num_errors; i++) { + size_t j = (state->bottom + i + 1) % ERR_NUM_ERRORS; + err_copy(&ret->errors[i], &state->errors[j]); + } + return ret; +} + +void ERR_restore_state(const ERR_SAVE_STATE *state) { + if (state == NULL || state->num_errors == 0) { + ERR_clear_error(); + return; + } + + ERR_STATE *const dst = err_get_state(); + if (dst == NULL) { + return; + } + + for (size_t i = 0; i < state->num_errors; i++) { + err_copy(&dst->errors[i], &state->errors[i]); + } + dst->top = state->num_errors - 1; + dst->bottom = ERR_NUM_ERRORS - 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back new file mode 100644 index 0000000..a432ce3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back @@ -0,0 +1,849 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#if defined(OPENSSL_WINDOWS) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include +#include + +#include "../internal.h" +#include "./internal.h" + + +struct err_error_st { + // file contains the filename where the error occurred. + const char *file; + // data contains a NUL-terminated string with optional data. It must be freed + // with |OPENSSL_free|. + char *data; + // packed contains the error library and reason, as packed by ERR_PACK. + uint32_t packed; + // line contains the line number where the error occurred. + uint16_t line; + // mark indicates a reversion point in the queue. See |ERR_pop_to_mark|. + unsigned mark : 1; +}; + +// ERR_STATE contains the per-thread, error queue. +typedef struct err_state_st { + // errors contains the ERR_NUM_ERRORS most recent errors, organised as a ring + // buffer. + struct err_error_st errors[ERR_NUM_ERRORS]; + // top contains the index one past the most recent error. If |top| equals + // |bottom| then the queue is empty. + unsigned top; + // bottom contains the index of the last error in the queue. + unsigned bottom; + + // to_free, if not NULL, contains a pointer owned by this structure that was + // previously a |data| pointer of one of the elements of |errors|. + void *to_free; +} ERR_STATE; + +extern const uint32_t kOpenSSLReasonValues[]; +extern const size_t kOpenSSLReasonValuesLen; +extern const char kOpenSSLReasonStringData[]; + +// err_clear clears the given queued error. +static void err_clear(struct err_error_st *error) { + OPENSSL_free(error->data); + OPENSSL_memset(error, 0, sizeof(struct err_error_st)); +} + +static void err_copy(struct err_error_st *dst, const struct err_error_st *src) { + err_clear(dst); + dst->file = src->file; + if (src->data != NULL) { + dst->data = OPENSSL_strdup(src->data); + } + dst->packed = src->packed; + dst->line = src->line; +} + +// global_next_library contains the next custom library value to return. +static int global_next_library = ERR_NUM_LIBS; + +// global_next_library_mutex protects |global_next_library| from concurrent +// updates. +static struct CRYPTO_STATIC_MUTEX global_next_library_mutex = + CRYPTO_STATIC_MUTEX_INIT; + +static void err_state_free(void *statep) { + ERR_STATE *state = statep; + + if (state == NULL) { + return; + } + + for (unsigned i = 0; i < ERR_NUM_ERRORS; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->to_free); + OPENSSL_free(state); +} + +// err_get_state gets the ERR_STATE object for the current thread. +static ERR_STATE *err_get_state(void) { + ERR_STATE *state = CRYPTO_get_thread_local(OPENSSL_THREAD_LOCAL_ERR); + if (state == NULL) { + state = OPENSSL_malloc(sizeof(ERR_STATE)); + if (state == NULL) { + return NULL; + } + OPENSSL_memset(state, 0, sizeof(ERR_STATE)); + if (!CRYPTO_set_thread_local(OPENSSL_THREAD_LOCAL_ERR, state, + err_state_free)) { + return NULL; + } + } + + return state; +} + +static uint32_t get_error_values(int inc, int top, const char **file, int *line, + const char **data, int *flags) { + unsigned i = 0; + ERR_STATE *state; + struct err_error_st *error; + uint32_t ret; + + state = err_get_state(); + if (state == NULL || state->bottom == state->top) { + return 0; + } + + if (top) { + assert(!inc); + // last error + i = state->top; + } else { + i = (state->bottom + 1) % ERR_NUM_ERRORS; + } + + error = &state->errors[i]; + ret = error->packed; + + if (file != NULL && line != NULL) { + if (error->file == NULL) { + *file = "NA"; + *line = 0; + } else { + *file = error->file; + *line = error->line; + } + } + + if (data != NULL) { + if (error->data == NULL) { + *data = ""; + if (flags != NULL) { + *flags = 0; + } + } else { + *data = error->data; + if (flags != NULL) { + *flags = ERR_FLAG_STRING; + } + // If this error is being removed, take ownership of data from + // the error. The semantics are such that the caller doesn't + // take ownership either. Instead the error system takes + // ownership and retains it until the next call that affects the + // error queue. + if (inc) { + if (error->data != NULL) { + OPENSSL_free(state->to_free); + state->to_free = error->data; + } + error->data = NULL; + } + } + } + + if (inc) { + assert(!top); + err_clear(error); + state->bottom = i; + } + + return ret; +} + +uint32_t ERR_get_error(void) { + return get_error_values(1 /* inc */, 0 /* bottom */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_get_error_line(const char **file, int *line) { + return get_error_values(1 /* inc */, 0 /* bottom */, file, line, NULL, NULL); +} + +uint32_t ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(1 /* inc */, 0 /* bottom */, file, line, data, flags); +} + +uint32_t ERR_peek_error(void) { + return get_error_values(0 /* peek */, 0 /* bottom */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_peek_error_line(const char **file, int *line) { + return get_error_values(0 /* peek */, 0 /* bottom */, file, line, NULL, NULL); +} + +uint32_t ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(0 /* peek */, 0 /* bottom */, file, line, data, + flags); +} + +uint32_t ERR_peek_last_error(void) { + return get_error_values(0 /* peek */, 1 /* top */, NULL, NULL, NULL, NULL); +} + +uint32_t ERR_peek_last_error_line(const char **file, int *line) { + return get_error_values(0 /* peek */, 1 /* top */, file, line, NULL, NULL); +} + +uint32_t ERR_peek_last_error_line_data(const char **file, int *line, + const char **data, int *flags) { + return get_error_values(0 /* peek */, 1 /* top */, file, line, data, flags); +} + +void ERR_clear_error(void) { + ERR_STATE *const state = err_get_state(); + unsigned i; + + if (state == NULL) { + return; + } + + for (i = 0; i < ERR_NUM_ERRORS; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->to_free); + state->to_free = NULL; + + state->top = state->bottom = 0; +} + +void ERR_remove_thread_state(const CRYPTO_THREADID *tid) { + if (tid != NULL) { + assert(0); + return; + } + + ERR_clear_error(); +} + +int ERR_get_next_error_library(void) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&global_next_library_mutex); + ret = global_next_library++; + CRYPTO_STATIC_MUTEX_unlock_write(&global_next_library_mutex); + + return ret; +} + +void ERR_remove_state(unsigned long pid) { + ERR_clear_error(); +} + +void ERR_clear_system_error(void) { + errno = 0; +} + +char *ERR_error_string(uint32_t packed_error, char *ret) { + static char buf[ERR_ERROR_STRING_BUF_LEN]; + + if (ret == NULL) { + // TODO(fork): remove this. + ret = buf; + } + +#if !defined(NDEBUG) + // This is aimed to help catch callers who don't provide + // |ERR_ERROR_STRING_BUF_LEN| bytes of space. + OPENSSL_memset(ret, 0, ERR_ERROR_STRING_BUF_LEN); +#endif + + return ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_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 NULL; + } + + lib = ERR_GET_LIB(packed_error); + reason = ERR_GET_REASON(packed_error); + + lib_str = ERR_lib_error_string(packed_error); + reason_str = ERR_reason_error_string(packed_error); + + if (lib_str == NULL) { + BIO_snprintf(lib_buf, sizeof(lib_buf), "lib(%u)", lib); + lib_str = lib_buf; + } + + if (reason_str == NULL) { + BIO_snprintf(reason_buf, sizeof(reason_buf), "reason(%u)", reason); + reason_str = reason_buf; + } + + BIO_snprintf(buf, len, "error:%08" PRIx32 ":%s:OPENSSL_internal:%s", + packed_error, lib_str, reason_str); + + if (strlen(buf) == len - 1) { + // output may be truncated; make sure we always have 5 colon-separated + // fields, i.e. 4 colons. + static const unsigned num_colons = 4; + unsigned i; + char *s = buf; + + 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 buf; + } + + for (i = 0; i < num_colons; i++) { + char *colon = strchr(s, ':'); + char *last_pos = &buf[len - 1] - num_colons + i; + + if (colon == NULL || colon > last_pos) { + // set colon |i| at last possible position (buf[len-1] is the + // terminating 0). If we're setting this colon, then all whole of the + // rest of the string must be colons in order to have the correct + // number. + OPENSSL_memset(last_pos, ':', num_colons - i); + break; + } + + s = colon + 1; + } + } + + return buf; +} + +// err_string_cmp is a compare function for searching error values with +// |bsearch| in |err_string_lookup|. +static int err_string_cmp(const void *a, const void *b) { + const uint32_t a_key = *((const uint32_t*) a) >> 15; + const uint32_t b_key = *((const uint32_t*) b) >> 15; + + if (a_key < b_key) { + return -1; + } else if (a_key > b_key) { + return 1; + } else { + return 0; + } +} + +// err_string_lookup looks up the string associated with |lib| and |key| in +// |values| and |string_data|. It returns the string or NULL if not found. +static const char *err_string_lookup(uint32_t lib, uint32_t key, + const uint32_t *values, + size_t num_values, + const char *string_data) { + // |values| points to data in err_data.h, which is generated by + // err_data_generate.go. It's an array of uint32_t values. Each value has the + // following structure: + // | lib | key | offset | + // |6 bits| 11 bits | 15 bits | + // + // The |lib| value is a library identifier: one of the |ERR_LIB_*| values. + // The |key| is a reason code, depending on the context. + // The |offset| is the number of bytes from the start of |string_data| where + // the (NUL terminated) string for this value can be found. + // + // Values are sorted based on treating the |lib| and |key| part as an + // unsigned integer. + if (lib >= (1 << 6) || key >= (1 << 11)) { + return NULL; + } + uint32_t search_key = lib << 26 | key << 15; + const uint32_t *result = bsearch(&search_key, values, num_values, + sizeof(uint32_t), err_string_cmp); + if (result == NULL) { + return NULL; + } + + return &string_data[(*result) & 0x7fff]; +} + +static const char *const kLibraryNames[ERR_NUM_LIBS] = { + "invalid library (0)", + "unknown library", // ERR_LIB_NONE + "system library", // ERR_LIB_SYS + "bignum routines", // ERR_LIB_BN + "RSA routines", // ERR_LIB_RSA + "Diffie-Hellman routines", // ERR_LIB_DH + "public key routines", // ERR_LIB_EVP + "memory buffer routines", // ERR_LIB_BUF + "object identifier routines", // ERR_LIB_OBJ + "PEM routines", // ERR_LIB_PEM + "DSA routines", // ERR_LIB_DSA + "X.509 certificate routines", // ERR_LIB_X509 + "ASN.1 encoding routines", // ERR_LIB_ASN1 + "configuration file routines", // ERR_LIB_CONF + "common libcrypto routines", // ERR_LIB_CRYPTO + "elliptic curve routines", // ERR_LIB_EC + "SSL routines", // ERR_LIB_SSL + "BIO routines", // ERR_LIB_BIO + "PKCS7 routines", // ERR_LIB_PKCS7 + "PKCS8 routines", // ERR_LIB_PKCS8 + "X509 V3 routines", // ERR_LIB_X509V3 + "random number generator", // ERR_LIB_RAND + "ENGINE routines", // ERR_LIB_ENGINE + "OCSP routines", // ERR_LIB_OCSP + "UI routines", // ERR_LIB_UI + "COMP routines", // ERR_LIB_COMP + "ECDSA routines", // ERR_LIB_ECDSA + "ECDH routines", // ERR_LIB_ECDH + "HMAC routines", // ERR_LIB_HMAC + "Digest functions", // ERR_LIB_DIGEST + "Cipher functions", // ERR_LIB_CIPHER + "HKDF functions", // ERR_LIB_HKDF + "User defined functions", // ERR_LIB_USER +}; + +const char *ERR_lib_error_string(uint32_t packed_error) { + const uint32_t lib = ERR_GET_LIB(packed_error); + + if (lib >= ERR_NUM_LIBS) { + return NULL; + } + return kLibraryNames[lib]; +} + +const char *ERR_func_error_string(uint32_t packed_error) { + return "OPENSSL_internal"; +} + +const char *ERR_reason_error_string(uint32_t packed_error) { + const uint32_t lib = ERR_GET_LIB(packed_error); + const uint32_t reason = ERR_GET_REASON(packed_error); + + if (lib == ERR_LIB_SYS) { + if (reason < 127) { + return strerror(reason); + } + return NULL; + } + + if (reason < ERR_NUM_LIBS) { + return kLibraryNames[reason]; + } + + if (reason < 100) { + switch (reason) { + case ERR_R_MALLOC_FAILURE: + return "malloc failure"; + case ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED: + return "function should not have been called"; + case ERR_R_PASSED_NULL_PARAMETER: + return "passed a null parameter"; + case ERR_R_INTERNAL_ERROR: + return "internal error"; + case ERR_R_OVERFLOW: + return "overflow"; + default: + return NULL; + } + } + + return err_string_lookup(lib, reason, kOpenSSLReasonValues, + kOpenSSLReasonValuesLen, kOpenSSLReasonStringData); +} + +void ERR_print_errors_cb(ERR_print_errors_callback_t callback, void *ctx) { + char buf[ERR_ERROR_STRING_BUF_LEN]; + char buf2[1024]; + const char *file, *data; + int line, flags; + uint32_t packed_error; + + // thread_hash is the least-significant bits of the |ERR_STATE| pointer value + // for this thread. + const unsigned long thread_hash = (uintptr_t) err_get_state(); + + for (;;) { + packed_error = ERR_get_error_line_data(&file, &line, &data, &flags); + if (packed_error == 0) { + break; + } + + ERR_error_string_n(packed_error, buf, sizeof(buf)); + BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", thread_hash, buf, + file, line, (flags & ERR_FLAG_STRING) ? data : ""); + if (callback(buf2, strlen(buf2), ctx) <= 0) { + break; + } + } +} + +static int print_errors_to_file(const char* msg, size_t msg_len, void* ctx) { + assert(msg[msg_len] == '\0'); + FILE* fp = ctx; + int res = fputs(msg, fp); + return res < 0 ? 0 : 1; +} + +void ERR_print_errors_fp(FILE *file) { + ERR_print_errors_cb(print_errors_to_file, file); +} + +// err_set_error_data sets the data on the most recent error. +static void err_set_error_data(char *data) { + ERR_STATE *const state = err_get_state(); + struct err_error_st *error; + + if (state == NULL || state->top == state->bottom) { + OPENSSL_free(data); + return; + } + + error = &state->errors[state->top]; + + OPENSSL_free(error->data); + error->data = data; +} + +void ERR_put_error(int library, int unused, int reason, const char *file, + unsigned line) { + ERR_STATE *const state = err_get_state(); + struct err_error_st *error; + + if (state == NULL) { + return; + } + + if (library == ERR_LIB_SYS && reason == 0) { +#if defined(OPENSSL_WINDOWS) + reason = GetLastError(); +#else + reason = errno; +#endif + } + + state->top = (state->top + 1) % ERR_NUM_ERRORS; + if (state->top == state->bottom) { + state->bottom = (state->bottom + 1) % ERR_NUM_ERRORS; + } + + error = &state->errors[state->top]; + err_clear(error); + error->file = file; + error->line = line; + error->packed = ERR_PACK(library, reason); +} + +// ERR_add_error_data_vdata takes a variable number of const char* pointers, +// concatenates them and sets the result as the data on the most recent +// error. +static void err_add_error_vdata(unsigned num, va_list args) { + size_t alloced, new_len, len = 0, substr_len; + char *buf; + const char *substr; + unsigned i; + + alloced = 80; + buf = OPENSSL_malloc(alloced + 1); + if (buf == NULL) { + return; + } + + for (i = 0; i < num; i++) { + substr = va_arg(args, const char *); + if (substr == NULL) { + continue; + } + + substr_len = strlen(substr); + new_len = len + substr_len; + if (new_len > alloced) { + char *new_buf; + + if (alloced + 20 + 1 < alloced) { + // overflow. + OPENSSL_free(buf); + return; + } + + alloced = new_len + 20; + new_buf = OPENSSL_realloc(buf, alloced + 1); + if (new_buf == NULL) { + OPENSSL_free(buf); + return; + } + buf = new_buf; + } + + OPENSSL_memcpy(buf + len, substr, substr_len); + len = new_len; + } + + buf[len] = 0; + err_set_error_data(buf); +} + +void ERR_add_error_data(unsigned count, ...) { + va_list args; + va_start(args, count); + err_add_error_vdata(count, args); + va_end(args); +} + +void ERR_add_error_dataf(const char *format, ...) { + va_list ap; + char *buf; + static const unsigned buf_len = 256; + + // A fixed-size buffer is used because va_copy (which would be needed in + // order to call vsnprintf twice and measure the buffer) wasn't defined until + // C99. + buf = OPENSSL_malloc(buf_len + 1); + if (buf == NULL) { + return; + } + + va_start(ap, format); + BIO_vsnprintf(buf, buf_len, format, ap); + buf[buf_len] = 0; + va_end(ap); + + err_set_error_data(buf); +} + +int ERR_set_mark(void) { + ERR_STATE *const state = err_get_state(); + + if (state == NULL || state->bottom == state->top) { + return 0; + } + state->errors[state->top].mark = 1; + return 1; +} + +int ERR_pop_to_mark(void) { + ERR_STATE *const state = err_get_state(); + + if (state == NULL) { + return 0; + } + + while (state->bottom != state->top) { + struct err_error_st *error = &state->errors[state->top]; + + if (error->mark) { + error->mark = 0; + return 1; + } + + err_clear(error); + if (state->top == 0) { + state->top = ERR_NUM_ERRORS - 1; + } else { + state->top--; + } + } + + return 0; +} + +void ERR_load_crypto_strings(void) {} + +void ERR_free_strings(void) {} + +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; +}; + +void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state) { + if (state == NULL) { + return; + } + for (size_t i = 0; i < state->num_errors; i++) { + err_clear(&state->errors[i]); + } + OPENSSL_free(state->errors); + OPENSSL_free(state); +} + +ERR_SAVE_STATE *ERR_save_state(void) { + ERR_STATE *const state = err_get_state(); + if (state == NULL || state->top == state->bottom) { + return NULL; + } + + ERR_SAVE_STATE *ret = OPENSSL_malloc(sizeof(ERR_SAVE_STATE)); + if (ret == NULL) { + return NULL; + } + + // Errors are stored in the range (bottom, top]. + size_t num_errors = state->top >= state->bottom + ? state->top - state->bottom + : ERR_NUM_ERRORS + state->top - state->bottom; + assert(num_errors < ERR_NUM_ERRORS); + ret->errors = OPENSSL_malloc(num_errors * sizeof(struct err_error_st)); + if (ret->errors == NULL) { + OPENSSL_free(ret); + return NULL; + } + OPENSSL_memset(ret->errors, 0, num_errors * sizeof(struct err_error_st)); + ret->num_errors = num_errors; + + for (size_t i = 0; i < num_errors; i++) { + size_t j = (state->bottom + i + 1) % ERR_NUM_ERRORS; + err_copy(&ret->errors[i], &state->errors[j]); + } + return ret; +} + +void ERR_restore_state(const ERR_SAVE_STATE *state) { + if (state == NULL || state->num_errors == 0) { + ERR_clear_error(); + return; + } + + ERR_STATE *const dst = err_get_state(); + if (dst == NULL) { + return; + } + + for (size_t i = 0; i < state->num_errors; i++) { + err_copy(&dst->errors[i], &state->errors[i]); + } + dst->top = state->num_errors - 1; + dst->bottom = ERR_NUM_ERRORS - 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/internal.h new file mode 100644 index 0000000..a4c1520 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/err/internal.h.grpc_back new file mode 100644 index 0000000..179f756 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c new file mode 100644 index 0000000..614da35 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c @@ -0,0 +1,231 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 2006,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 + * 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 "internal.h" +#include "../fipsmodule/digest/internal.h" + + +enum evp_sign_verify_t { + evp_sign, + evp_verify, +}; + +static const struct evp_md_pctx_ops md_pctx_ops = { + EVP_PKEY_CTX_free, + EVP_PKEY_CTX_dup, +}; + +static int uses_prehash(EVP_MD_CTX *ctx, enum evp_sign_verify_t op) { + return (op == evp_sign) ? (ctx->pctx->pmeth->sign != NULL) + : (ctx->pctx->pmeth->verify != NULL); +} + +static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, + enum evp_sign_verify_t op) { + if (ctx->pctx == NULL) { + ctx->pctx = EVP_PKEY_CTX_new(pkey, e); + } + if (ctx->pctx == NULL) { + return 0; + } + ctx->pctx_ops = &md_pctx_ops; + + if (op == evp_verify) { + if (!EVP_PKEY_verify_init(ctx->pctx)) { + return 0; + } + } else { + if (!EVP_PKEY_sign_init(ctx->pctx)) { + return 0; + } + } + + if (type != NULL && + !EVP_PKEY_CTX_set_signature_md(ctx->pctx, type)) { + return 0; + } + + if (uses_prehash(ctx, op)) { + if (type == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_DEFAULT_DIGEST); + return 0; + } + if (!EVP_DigestInit_ex(ctx, type, e)) { + return 0; + } + } + + if (pctx) { + *pctx = ctx->pctx; + } + return 1; +} + +int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, + ENGINE *e, EVP_PKEY *pkey) { + return do_sigver_init(ctx, pctx, type, e, pkey, evp_sign); +} + +int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) { + return do_sigver_init(ctx, pctx, type, e, pkey, evp_verify); +} + +int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + if (!uses_prehash(ctx, evp_sign)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + if (!uses_prehash(ctx, evp_verify)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_DigestSignFinal(EVP_MD_CTX *ctx, uint8_t *out_sig, + size_t *out_sig_len) { + if (!uses_prehash(ctx, evp_sign)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + if (out_sig) { + EVP_MD_CTX tmp_ctx; + int ret; + uint8_t md[EVP_MAX_MD_SIZE]; + unsigned int mdlen; + + EVP_MD_CTX_init(&tmp_ctx); + ret = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) && + EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen) && + EVP_PKEY_sign(ctx->pctx, out_sig, out_sig_len, md, mdlen); + EVP_MD_CTX_cleanup(&tmp_ctx); + + return ret; + } else { + size_t s = EVP_MD_size(ctx->digest); + return EVP_PKEY_sign(ctx->pctx, out_sig, out_sig_len, NULL, s); + } +} + +int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, + size_t sig_len) { + if (!uses_prehash(ctx, evp_verify)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + EVP_MD_CTX tmp_ctx; + int ret; + uint8_t md[EVP_MAX_MD_SIZE]; + unsigned int mdlen; + + EVP_MD_CTX_init(&tmp_ctx); + ret = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) && + EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen) && + EVP_PKEY_verify(ctx->pctx, sig, sig_len, md, mdlen); + EVP_MD_CTX_cleanup(&tmp_ctx); + + return ret; +} + +int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig, size_t *out_sig_len, + const uint8_t *data, size_t data_len) { + if (uses_prehash(ctx, evp_sign)) { + // If |out_sig| is NULL, the caller is only querying the maximum output + // length. |data| should only be incorporated in the final call. + if (out_sig != NULL && + !EVP_DigestSignUpdate(ctx, data, data_len)) { + return 0; + } + + return EVP_DigestSignFinal(ctx, out_sig, out_sig_len); + } + + if (ctx->pctx->pmeth->sign_message == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return ctx->pctx->pmeth->sign_message(ctx->pctx, out_sig, out_sig_len, data, + data_len); +} + +int EVP_DigestVerify(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, + const uint8_t *data, size_t len) { + if (uses_prehash(ctx, evp_verify)) { + return EVP_DigestVerifyUpdate(ctx, data, len) && + EVP_DigestVerifyFinal(ctx, sig, sig_len); + } + + if (ctx->pctx->pmeth->verify_message == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return ctx->pctx->pmeth->verify_message(ctx->pctx, sig, sig_len, data, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c.grpc_back new file mode 100644 index 0000000..6e4d305 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c.grpc_back @@ -0,0 +1,231 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 2006,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 + * 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 "internal.h" +#include "../fipsmodule/digest/internal.h" + + +enum evp_sign_verify_t { + evp_sign, + evp_verify, +}; + +static const struct evp_md_pctx_ops md_pctx_ops = { + EVP_PKEY_CTX_free, + EVP_PKEY_CTX_dup, +}; + +static int uses_prehash(EVP_MD_CTX *ctx, enum evp_sign_verify_t op) { + return (op == evp_sign) ? (ctx->pctx->pmeth->sign != NULL) + : (ctx->pctx->pmeth->verify != NULL); +} + +static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, + enum evp_sign_verify_t op) { + if (ctx->pctx == NULL) { + ctx->pctx = EVP_PKEY_CTX_new(pkey, e); + } + if (ctx->pctx == NULL) { + return 0; + } + ctx->pctx_ops = &md_pctx_ops; + + if (op == evp_verify) { + if (!EVP_PKEY_verify_init(ctx->pctx)) { + return 0; + } + } else { + if (!EVP_PKEY_sign_init(ctx->pctx)) { + return 0; + } + } + + if (type != NULL && + !EVP_PKEY_CTX_set_signature_md(ctx->pctx, type)) { + return 0; + } + + if (uses_prehash(ctx, op)) { + if (type == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_DEFAULT_DIGEST); + return 0; + } + if (!EVP_DigestInit_ex(ctx, type, e)) { + return 0; + } + } + + if (pctx) { + *pctx = ctx->pctx; + } + return 1; +} + +int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, + ENGINE *e, EVP_PKEY *pkey) { + return do_sigver_init(ctx, pctx, type, e, pkey, evp_sign); +} + +int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) { + return do_sigver_init(ctx, pctx, type, e, pkey, evp_verify); +} + +int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + if (!uses_prehash(ctx, evp_sign)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + if (!uses_prehash(ctx, evp_verify)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_DigestSignFinal(EVP_MD_CTX *ctx, uint8_t *out_sig, + size_t *out_sig_len) { + if (!uses_prehash(ctx, evp_sign)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + if (out_sig) { + EVP_MD_CTX tmp_ctx; + int ret; + uint8_t md[EVP_MAX_MD_SIZE]; + unsigned int mdlen; + + EVP_MD_CTX_init(&tmp_ctx); + ret = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) && + EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen) && + EVP_PKEY_sign(ctx->pctx, out_sig, out_sig_len, md, mdlen); + EVP_MD_CTX_cleanup(&tmp_ctx); + + return ret; + } else { + size_t s = EVP_MD_size(ctx->digest); + return EVP_PKEY_sign(ctx->pctx, out_sig, out_sig_len, NULL, s); + } +} + +int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, + size_t sig_len) { + if (!uses_prehash(ctx, evp_verify)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + EVP_MD_CTX tmp_ctx; + int ret; + uint8_t md[EVP_MAX_MD_SIZE]; + unsigned int mdlen; + + EVP_MD_CTX_init(&tmp_ctx); + ret = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) && + EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen) && + EVP_PKEY_verify(ctx->pctx, sig, sig_len, md, mdlen); + EVP_MD_CTX_cleanup(&tmp_ctx); + + return ret; +} + +int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig, size_t *out_sig_len, + const uint8_t *data, size_t data_len) { + if (uses_prehash(ctx, evp_sign)) { + // If |out_sig| is NULL, the caller is only querying the maximum output + // length. |data| should only be incorporated in the final call. + if (out_sig != NULL && + !EVP_DigestSignUpdate(ctx, data, data_len)) { + return 0; + } + + return EVP_DigestSignFinal(ctx, out_sig, out_sig_len); + } + + if (ctx->pctx->pmeth->sign_message == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return ctx->pctx->pmeth->sign_message(ctx->pctx, out_sig, out_sig_len, data, + data_len); +} + +int EVP_DigestVerify(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, + const uint8_t *data, size_t len) { + if (uses_prehash(ctx, evp_verify)) { + return EVP_DigestVerifyUpdate(ctx, data, len) && + EVP_DigestVerifyFinal(ctx, sig, sig_len); + } + + if (ctx->pctx->pmeth->verify_message == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return ctx->pctx->pmeth->verify_message(ctx->pctx, sig, sig_len, data, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c new file mode 100644 index 0000000..b52f859 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c @@ -0,0 +1,443 @@ +/* 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 "internal.h" +#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; + + ret = OPENSSL_malloc(sizeof(EVP_PKEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY)); + ret->type = EVP_PKEY_NONE; + ret->references = 1; + + return ret; +} + +static void free_it(EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->pkey_free) { + pkey->ameth->pkey_free(pkey); + pkey->pkey.ptr = NULL; + pkey->type = EVP_PKEY_NONE; + } +} + +void EVP_PKEY_free(EVP_PKEY *pkey) { + if (pkey == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&pkey->references)) { + return; + } + + free_it(pkey); + OPENSSL_free(pkey); +} + +int EVP_PKEY_up_ref(EVP_PKEY *pkey) { + CRYPTO_refcount_inc(&pkey->references); + return 1; +} + +int EVP_PKEY_is_opaque(const EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->pkey_opaque) { + return pkey->ameth->pkey_opaque(pkey); + } + return 0; +} + +int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + if (a->type != b->type) { + return -1; + } + + if (a->ameth) { + int ret; + // Compare parameters if the algorithm has them + if (a->ameth->param_cmp) { + ret = a->ameth->param_cmp(a, b); + if (ret <= 0) { + return ret; + } + } + + if (a->ameth->pub_cmp) { + return a->ameth->pub_cmp(a, b); + } + } + + return -2; +} + +int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + if (to->type != from->type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + goto err; + } + + if (EVP_PKEY_missing_parameters(from)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MISSING_PARAMETERS); + goto err; + } + + if (from->ameth && from->ameth->param_copy) { + return from->ameth->param_copy(to, from); + } + +err: + return 0; +} + +int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->param_missing) { + return pkey->ameth->param_missing(pkey); + } + return 0; +} + +int EVP_PKEY_size(const EVP_PKEY *pkey) { + if (pkey && pkey->ameth && pkey->ameth->pkey_size) { + return pkey->ameth->pkey_size(pkey); + } + return 0; +} + +int EVP_PKEY_bits(const EVP_PKEY *pkey) { + if (pkey && pkey->ameth && pkey->ameth->pkey_bits) { + return pkey->ameth->pkey_bits(pkey); + } + return 0; +} + +int EVP_PKEY_id(const EVP_PKEY *pkey) { + return pkey->type; +} + +// evp_pkey_asn1_find returns the ASN.1 method table for the given |nid|, which +// should be one of the |EVP_PKEY_*| values. It returns NULL if |nid| is +// unknown. +static const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int nid) { + switch (nid) { + case EVP_PKEY_RSA: + return &rsa_asn1_meth; + case EVP_PKEY_EC: + return &ec_asn1_meth; + case EVP_PKEY_DSA: + return &dsa_asn1_meth; + case EVP_PKEY_ED25519: + return &ed25519_asn1_meth; + case EVP_PKEY_X25519: + return &x25519_asn1_meth; + default: + return NULL; + } +} + +int EVP_PKEY_type(int nid) { + const EVP_PKEY_ASN1_METHOD *meth = evp_pkey_asn1_find(nid); + if (meth == NULL) { + return NID_undef; + } + return meth->pkey_id; +} + +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) { + if (EVP_PKEY_assign_RSA(pkey, key)) { + RSA_up_ref(key); + return 1; + } + return 0; +} + +int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key) { + return EVP_PKEY_assign(pkey, EVP_PKEY_RSA, key); +} + +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; + } + return pkey->pkey.rsa; +} + +RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey) { + RSA *rsa = EVP_PKEY_get0_RSA(pkey); + if (rsa != NULL) { + RSA_up_ref(rsa); + } + return rsa; +} + +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) { + if (EVP_PKEY_assign_DSA(pkey, key)) { + DSA_up_ref(key); + return 1; + } + return 0; +} + +int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key) { + return EVP_PKEY_assign(pkey, EVP_PKEY_DSA, key); +} + +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; + } + return pkey->pkey.dsa; +} + +DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey) { + DSA *dsa = EVP_PKEY_get0_DSA(pkey); + if (dsa != NULL) { + DSA_up_ref(dsa); + } + return dsa; +} + +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) { + if (EVP_PKEY_assign_EC_KEY(pkey, key)) { + EC_KEY_up_ref(key); + return 1; + } + return 0; +} + +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(const EVP_PKEY *pkey) { + if (pkey->type != EVP_PKEY_EC) { + OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_EC_KEY_KEY); + return NULL; + } + return pkey->pkey.ec; +} + +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); + } + return ec_key; +} + +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)) { + return 0; + } + pkey->pkey.ptr = key; + return key != NULL; +} + +int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) { + const EVP_PKEY_ASN1_METHOD *ameth; + + if (pkey && pkey->pkey.ptr) { + free_it(pkey); + } + + ameth = evp_pkey_asn1_find(type); + if (ameth == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + ERR_add_error_dataf("algorithm %d", type); + return 0; + } + + if (pkey) { + pkey->ameth = ameth; + pkey->type = pkey->ameth->pkey_id; + } + + 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) { + return -1; + } + if (a->ameth && a->ameth->param_cmp) { + return a->ameth->param_cmp(a, b); + } + return -2; +} + +int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, EVP_PKEY_CTRL_MD, 0, + (void *)md); +} + +int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, EVP_PKEY_CTRL_GET_MD, + 0, (void *)out_md); +} + +void OpenSSL_add_all_algorithms(void) {} + +void OPENSSL_add_all_algorithms_conf(void) {} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back new file mode 100644 index 0000000..60fdf64 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back @@ -0,0 +1,443 @@ +/* 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 "internal.h" +#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; + + ret = OPENSSL_malloc(sizeof(EVP_PKEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY)); + ret->type = EVP_PKEY_NONE; + ret->references = 1; + + return ret; +} + +static void free_it(EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->pkey_free) { + pkey->ameth->pkey_free(pkey); + pkey->pkey.ptr = NULL; + pkey->type = EVP_PKEY_NONE; + } +} + +void EVP_PKEY_free(EVP_PKEY *pkey) { + if (pkey == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&pkey->references)) { + return; + } + + free_it(pkey); + OPENSSL_free(pkey); +} + +int EVP_PKEY_up_ref(EVP_PKEY *pkey) { + CRYPTO_refcount_inc(&pkey->references); + return 1; +} + +int EVP_PKEY_is_opaque(const EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->pkey_opaque) { + return pkey->ameth->pkey_opaque(pkey); + } + return 0; +} + +int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + if (a->type != b->type) { + return -1; + } + + if (a->ameth) { + int ret; + // Compare parameters if the algorithm has them + if (a->ameth->param_cmp) { + ret = a->ameth->param_cmp(a, b); + if (ret <= 0) { + return ret; + } + } + + if (a->ameth->pub_cmp) { + return a->ameth->pub_cmp(a, b); + } + } + + return -2; +} + +int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + if (to->type != from->type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + goto err; + } + + if (EVP_PKEY_missing_parameters(from)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MISSING_PARAMETERS); + goto err; + } + + if (from->ameth && from->ameth->param_copy) { + return from->ameth->param_copy(to, from); + } + +err: + return 0; +} + +int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) { + if (pkey->ameth && pkey->ameth->param_missing) { + return pkey->ameth->param_missing(pkey); + } + return 0; +} + +int EVP_PKEY_size(const EVP_PKEY *pkey) { + if (pkey && pkey->ameth && pkey->ameth->pkey_size) { + return pkey->ameth->pkey_size(pkey); + } + return 0; +} + +int EVP_PKEY_bits(const EVP_PKEY *pkey) { + if (pkey && pkey->ameth && pkey->ameth->pkey_bits) { + return pkey->ameth->pkey_bits(pkey); + } + return 0; +} + +int EVP_PKEY_id(const EVP_PKEY *pkey) { + return pkey->type; +} + +// evp_pkey_asn1_find returns the ASN.1 method table for the given |nid|, which +// should be one of the |EVP_PKEY_*| values. It returns NULL if |nid| is +// unknown. +static const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int nid) { + switch (nid) { + case EVP_PKEY_RSA: + return &rsa_asn1_meth; + case EVP_PKEY_EC: + return &ec_asn1_meth; + case EVP_PKEY_DSA: + return &dsa_asn1_meth; + case EVP_PKEY_ED25519: + return &ed25519_asn1_meth; + case EVP_PKEY_X25519: + return &x25519_asn1_meth; + default: + return NULL; + } +} + +int EVP_PKEY_type(int nid) { + const EVP_PKEY_ASN1_METHOD *meth = evp_pkey_asn1_find(nid); + if (meth == NULL) { + return NID_undef; + } + return meth->pkey_id; +} + +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) { + if (EVP_PKEY_assign_RSA(pkey, key)) { + RSA_up_ref(key); + return 1; + } + return 0; +} + +int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key) { + return EVP_PKEY_assign(pkey, EVP_PKEY_RSA, key); +} + +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; + } + return pkey->pkey.rsa; +} + +RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey) { + RSA *rsa = EVP_PKEY_get0_RSA(pkey); + if (rsa != NULL) { + RSA_up_ref(rsa); + } + return rsa; +} + +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) { + if (EVP_PKEY_assign_DSA(pkey, key)) { + DSA_up_ref(key); + return 1; + } + return 0; +} + +int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key) { + return EVP_PKEY_assign(pkey, EVP_PKEY_DSA, key); +} + +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; + } + return pkey->pkey.dsa; +} + +DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey) { + DSA *dsa = EVP_PKEY_get0_DSA(pkey); + if (dsa != NULL) { + DSA_up_ref(dsa); + } + return dsa; +} + +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) { + if (EVP_PKEY_assign_EC_KEY(pkey, key)) { + EC_KEY_up_ref(key); + return 1; + } + return 0; +} + +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(const EVP_PKEY *pkey) { + if (pkey->type != EVP_PKEY_EC) { + OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_EC_KEY_KEY); + return NULL; + } + return pkey->pkey.ec; +} + +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); + } + return ec_key; +} + +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)) { + return 0; + } + pkey->pkey.ptr = key; + return key != NULL; +} + +int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) { + const EVP_PKEY_ASN1_METHOD *ameth; + + if (pkey && pkey->pkey.ptr) { + free_it(pkey); + } + + ameth = evp_pkey_asn1_find(type); + if (ameth == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + ERR_add_error_dataf("algorithm %d", type); + return 0; + } + + if (pkey) { + pkey->ameth = ameth; + pkey->type = pkey->ameth->pkey_id; + } + + 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) { + return -1; + } + if (a->ameth && a->ameth->param_cmp) { + return a->ameth->param_cmp(a, b); + } + return -2; +} + +int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, EVP_PKEY_CTRL_MD, 0, + (void *)md); +} + +int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, EVP_PKEY_CTRL_GET_MD, + 0, (void *)out_md); +} + +void OpenSSL_add_all_algorithms(void) {} + +void OPENSSL_add_all_algorithms_conf(void) {} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c new file mode 100644 index 0000000..47b3e70 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c @@ -0,0 +1,388 @@ +/* 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 "internal.h" +#include "../internal.h" + + +static const EVP_PKEY_ASN1_METHOD *const kASN1Methods[] = { + &rsa_asn1_meth, + &ec_asn1_meth, + &dsa_asn1_meth, + &ed25519_asn1_meth, + &x25519_asn1_meth, +}; + +static int parse_key_type(CBS *cbs, int *out_type) { + CBS oid; + if (!CBS_get_asn1(cbs, &oid, CBS_ASN1_OBJECT)) { + return 0; + } + + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kASN1Methods); i++) { + const EVP_PKEY_ASN1_METHOD *method = kASN1Methods[i]; + if (CBS_len(&oid) == method->oid_len && + OPENSSL_memcmp(CBS_data(&oid), method->oid, method->oid_len) == 0) { + *out_type = method->pkey_id; + return 1; + } + } + + return 0; +} + +EVP_PKEY *EVP_parse_public_key(CBS *cbs) { + // Parse the SubjectPublicKeyInfo. + CBS spki, algorithm, key; + int type; + uint8_t padding; + if (!CBS_get_asn1(cbs, &spki, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&spki, &key, CBS_ASN1_BITSTRING) || + 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) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Set up an |EVP_PKEY| of the appropriate type. + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + // Call into the type-specific SPKI decoding function. + if (ret->ameth->pub_decode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + goto err; + } + if (!ret->ameth->pub_decode(ret, &algorithm, &key)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_marshal_public_key(CBB *cbb, const EVP_PKEY *key) { + if (key->ameth == NULL || key->ameth->pub_encode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return 0; + } + + return key->ameth->pub_encode(cbb, key); +} + +EVP_PKEY *EVP_parse_private_key(CBS *cbs) { + // Parse the PrivateKeyInfo. + CBS pkcs8, algorithm, key; + uint64_t version; + int type; + if (!CBS_get_asn1(cbs, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&pkcs8, &version) || + version != 0 || + !CBS_get_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !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. + + // Set up an |EVP_PKEY| of the appropriate type. + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + // Call into the type-specific PrivateKeyInfo decoding function. + if (ret->ameth->priv_decode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + goto err; + } + if (!ret->ameth->priv_decode(ret, &algorithm, &key)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key) { + if (key->ameth == NULL || key->ameth->priv_encode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return 0; + } + + return key->ameth->priv_encode(cbb, key); +} + +static EVP_PKEY *old_priv_decode(CBS *cbs, int type) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL) { + return NULL; + } + + switch (type) { + case EVP_PKEY_EC: { + EC_KEY *ec_key = EC_KEY_parse_private_key(cbs, NULL); + if (ec_key == NULL || !EVP_PKEY_assign_EC_KEY(ret, ec_key)) { + EC_KEY_free(ec_key); + goto err; + } + return ret; + } + case EVP_PKEY_DSA: { + DSA *dsa = DSA_parse_private_key(cbs); + if (dsa == NULL || !EVP_PKEY_assign_DSA(ret, dsa)) { + DSA_free(dsa); + goto err; + } + return ret; + } + case EVP_PKEY_RSA: { + RSA *rsa = RSA_parse_private_key(cbs); + if (rsa == NULL || !EVP_PKEY_assign_RSA(ret, rsa)) { + RSA_free(rsa); + goto err; + } + return ret; + } + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNKNOWN_PUBLIC_KEY_TYPE); + goto err; + } + +err: + EVP_PKEY_free(ret); + return NULL; +} + +EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **out, const uint8_t **inp, + long len) { + if (len < 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Parse with the legacy format. + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EVP_PKEY *ret = old_priv_decode(&cbs, type); + if (ret == NULL) { + // Try again with PKCS#8. + ERR_clear_error(); + CBS_init(&cbs, *inp, (size_t)len); + ret = EVP_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (ret->type != type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + EVP_PKEY_free(ret); + return NULL; + } + } + + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +// num_elements parses one SEQUENCE from |in| and returns the number of elements +// in it. On parse error, it returns zero. +static size_t num_elements(const uint8_t *in, size_t in_len) { + CBS cbs, sequence; + CBS_init(&cbs, in, (size_t)in_len); + + if (!CBS_get_asn1(&cbs, &sequence, CBS_ASN1_SEQUENCE)) { + return 0; + } + + size_t count = 0; + while (CBS_len(&sequence) > 0) { + if (!CBS_get_any_asn1_element(&sequence, NULL, NULL, NULL)) { + return 0; + } + + count++; + } + + return count; +} + +EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len) { + if (len < 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Parse the input as a PKCS#8 PrivateKeyInfo. + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EVP_PKEY *ret = EVP_parse_private_key(&cbs); + if (ret != NULL) { + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; + } + ERR_clear_error(); + + // Count the elements to determine the legacy key format. + switch (num_elements(*inp, (size_t)len)) { + case 4: + return d2i_PrivateKey(EVP_PKEY_EC, out, inp, len); + + case 6: + return d2i_PrivateKey(EVP_PKEY_DSA, out, inp, len); + + default: + return d2i_PrivateKey(EVP_PKEY_RSA, out, inp, len); + } +} + +int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp) { + switch (key->type) { + case EVP_PKEY_RSA: + return i2d_RSAPublicKey(key->pkey.rsa, outp); + case EVP_PKEY_DSA: + return i2d_DSAPublicKey(key->pkey.dsa, outp); + case EVP_PKEY_EC: + return i2o_ECPublicKey(key->pkey.ec, outp); + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back new file mode 100644 index 0000000..fc1dce3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back @@ -0,0 +1,388 @@ +/* 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 "internal.h" +#include "../internal.h" + + +static const EVP_PKEY_ASN1_METHOD *const kASN1Methods[] = { + &rsa_asn1_meth, + &ec_asn1_meth, + &dsa_asn1_meth, + &ed25519_asn1_meth, + &x25519_asn1_meth, +}; + +static int parse_key_type(CBS *cbs, int *out_type) { + CBS oid; + if (!CBS_get_asn1(cbs, &oid, CBS_ASN1_OBJECT)) { + return 0; + } + + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kASN1Methods); i++) { + const EVP_PKEY_ASN1_METHOD *method = kASN1Methods[i]; + if (CBS_len(&oid) == method->oid_len && + OPENSSL_memcmp(CBS_data(&oid), method->oid, method->oid_len) == 0) { + *out_type = method->pkey_id; + return 1; + } + } + + return 0; +} + +EVP_PKEY *EVP_parse_public_key(CBS *cbs) { + // Parse the SubjectPublicKeyInfo. + CBS spki, algorithm, key; + int type; + uint8_t padding; + if (!CBS_get_asn1(cbs, &spki, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&spki, &key, CBS_ASN1_BITSTRING) || + 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) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Set up an |EVP_PKEY| of the appropriate type. + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + // Call into the type-specific SPKI decoding function. + if (ret->ameth->pub_decode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + goto err; + } + if (!ret->ameth->pub_decode(ret, &algorithm, &key)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_marshal_public_key(CBB *cbb, const EVP_PKEY *key) { + if (key->ameth == NULL || key->ameth->pub_encode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return 0; + } + + return key->ameth->pub_encode(cbb, key); +} + +EVP_PKEY *EVP_parse_private_key(CBS *cbs) { + // Parse the PrivateKeyInfo. + CBS pkcs8, algorithm, key; + uint64_t version; + int type; + if (!CBS_get_asn1(cbs, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&pkcs8, &version) || + version != 0 || + !CBS_get_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !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. + + // Set up an |EVP_PKEY| of the appropriate type. + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + // Call into the type-specific PrivateKeyInfo decoding function. + if (ret->ameth->priv_decode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + goto err; + } + if (!ret->ameth->priv_decode(ret, &algorithm, &key)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key) { + if (key->ameth == NULL || key->ameth->priv_encode == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return 0; + } + + return key->ameth->priv_encode(cbb, key); +} + +static EVP_PKEY *old_priv_decode(CBS *cbs, int type) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL) { + return NULL; + } + + switch (type) { + case EVP_PKEY_EC: { + EC_KEY *ec_key = EC_KEY_parse_private_key(cbs, NULL); + if (ec_key == NULL || !EVP_PKEY_assign_EC_KEY(ret, ec_key)) { + EC_KEY_free(ec_key); + goto err; + } + return ret; + } + case EVP_PKEY_DSA: { + DSA *dsa = DSA_parse_private_key(cbs); + if (dsa == NULL || !EVP_PKEY_assign_DSA(ret, dsa)) { + DSA_free(dsa); + goto err; + } + return ret; + } + case EVP_PKEY_RSA: { + RSA *rsa = RSA_parse_private_key(cbs); + if (rsa == NULL || !EVP_PKEY_assign_RSA(ret, rsa)) { + RSA_free(rsa); + goto err; + } + return ret; + } + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNKNOWN_PUBLIC_KEY_TYPE); + goto err; + } + +err: + EVP_PKEY_free(ret); + return NULL; +} + +EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **out, const uint8_t **inp, + long len) { + if (len < 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Parse with the legacy format. + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EVP_PKEY *ret = old_priv_decode(&cbs, type); + if (ret == NULL) { + // Try again with PKCS#8. + ERR_clear_error(); + CBS_init(&cbs, *inp, (size_t)len); + ret = EVP_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (ret->type != type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + EVP_PKEY_free(ret); + return NULL; + } + } + + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +// num_elements parses one SEQUENCE from |in| and returns the number of elements +// in it. On parse error, it returns zero. +static size_t num_elements(const uint8_t *in, size_t in_len) { + CBS cbs, sequence; + CBS_init(&cbs, in, (size_t)in_len); + + if (!CBS_get_asn1(&cbs, &sequence, CBS_ASN1_SEQUENCE)) { + return 0; + } + + size_t count = 0; + while (CBS_len(&sequence) > 0) { + if (!CBS_get_any_asn1_element(&sequence, NULL, NULL, NULL)) { + return 0; + } + + count++; + } + + return count; +} + +EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len) { + if (len < 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + + // Parse the input as a PKCS#8 PrivateKeyInfo. + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + EVP_PKEY *ret = EVP_parse_private_key(&cbs); + if (ret != NULL) { + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; + } + ERR_clear_error(); + + // Count the elements to determine the legacy key format. + switch (num_elements(*inp, (size_t)len)) { + case 4: + return d2i_PrivateKey(EVP_PKEY_EC, out, inp, len); + + case 6: + return d2i_PrivateKey(EVP_PKEY_DSA, out, inp, len); + + default: + return d2i_PrivateKey(EVP_PKEY_RSA, out, inp, len); + } +} + +int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp) { + switch (key->type) { + case EVP_PKEY_RSA: + return i2d_RSAPublicKey(key->pkey.rsa, outp); + case EVP_PKEY_DSA: + return i2d_DSAPublicKey(key->pkey.dsa, outp); + case EVP_PKEY_EC: + return i2o_ECPublicKey(key->pkey.ec, outp); + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c new file mode 100644 index 0000000..dcdaf4b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c @@ -0,0 +1,484 @@ +/* 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 "../internal.h" +#include "internal.h" + + +static const EVP_PKEY_METHOD *const evp_methods[] = { + &rsa_pkey_meth, + &ec_pkey_meth, + &ed25519_pkey_meth, + &x25519_pkey_meth, +}; + +static const EVP_PKEY_METHOD *evp_pkey_meth_find(int type) { + 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]; + } + } + + return NULL; +} + +static EVP_PKEY_CTX *evp_pkey_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) { + EVP_PKEY_CTX *ret; + const EVP_PKEY_METHOD *pmeth; + + if (id == -1) { + if (!pkey || !pkey->ameth) { + return NULL; + } + id = pkey->ameth->pkey_id; + } + + pmeth = evp_pkey_meth_find(id); + + if (pmeth == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + ERR_add_error_dataf("algorithm %d", id); + return NULL; + } + + ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX)); + if (!ret) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY_CTX)); + + ret->engine = e; + ret->pmeth = pmeth; + ret->operation = EVP_PKEY_OP_UNDEFINED; + + if (pkey) { + EVP_PKEY_up_ref(pkey); + ret->pkey = pkey; + } + + if (pmeth->init) { + if (pmeth->init(ret) <= 0) { + EVP_PKEY_free(ret->pkey); + OPENSSL_free(ret); + return NULL; + } + } + + return ret; +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e) { + return evp_pkey_ctx_new(pkey, e, -1); +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e) { + return evp_pkey_ctx_new(NULL, e, id); +} + +void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) { + if (ctx == NULL) { + return; + } + if (ctx->pmeth && ctx->pmeth->cleanup) { + ctx->pmeth->cleanup(ctx); + } + EVP_PKEY_free(ctx->pkey); + EVP_PKEY_free(ctx->peerkey); + OPENSSL_free(ctx); +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx) { + if (!ctx->pmeth || !ctx->pmeth->copy) { + return NULL; + } + + EVP_PKEY_CTX *ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX)); + if (!ret) { + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY_CTX)); + + ret->pmeth = ctx->pmeth; + ret->engine = ctx->engine; + ret->operation = ctx->operation; + + if (ctx->pkey != NULL) { + EVP_PKEY_up_ref(ctx->pkey); + ret->pkey = ctx->pkey; + } + + if (ctx->peerkey != NULL) { + EVP_PKEY_up_ref(ctx->peerkey); + ret->peerkey = ctx->peerkey; + } + + if (ctx->pmeth->copy(ret, ctx) <= 0) { + ret->pmeth = NULL; + EVP_PKEY_CTX_free(ret); + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return NULL; + } + + return ret; +} + +EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) { return ctx->pkey; } + +int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, + int p1, void *p2) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl) { + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } + if (keytype != -1 && ctx->pmeth->pkey_id != keytype) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + if (ctx->operation == EVP_PKEY_OP_UNDEFINED) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_OPERATION_SET); + return 0; + } + + if (optype != -1 && !(ctx->operation & optype)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_OPERATION); + return 0; + } + + return ctx->pmeth->ctrl(ctx, cmd, p1, p2); +} + +int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) { + if (ctx == NULL || ctx->pmeth == NULL || + (ctx->pmeth->sign == NULL && ctx->pmeth->sign_message == NULL)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + ctx->operation = EVP_PKEY_OP_SIGN; + return 1; +} + +int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *sig_len, + const uint8_t *digest, size_t digest_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->sign) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_SIGN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->sign(ctx, sig, sig_len, digest, digest_len); +} + +int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) { + if (ctx == NULL || ctx->pmeth == NULL || + (ctx->pmeth->verify == NULL && ctx->pmeth->verify_message == NULL)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_VERIFY; + return 1; +} + +int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t sig_len, + const uint8_t *digest, size_t digest_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_VERIFY) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->verify(ctx, sig, sig_len, digest, digest_len); +} + +int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_ENCRYPT; + return 1; +} + +int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_ENCRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen); +} + +int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_DECRYPT; + return 1; +} + +int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DECRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen); +} + +int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_VERIFYRECOVER; + return 1; +} + +int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, + const uint8_t *sig, size_t sig_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_VERIFYRECOVER) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->verify_recover(ctx, out, out_len, sig, sig_len); +} + +int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->derive) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_DERIVE; + return 1; +} + +int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer) { + int ret; + if (!ctx || !ctx->pmeth || + !(ctx->pmeth->derive || ctx->pmeth->encrypt || ctx->pmeth->decrypt) || + !ctx->pmeth->ctrl) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DERIVE && + ctx->operation != EVP_PKEY_OP_ENCRYPT && + ctx->operation != EVP_PKEY_OP_DECRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 0, peer); + + if (ret <= 0) { + return 0; + } + + if (ret == 2) { + return 1; + } + + if (!ctx->pkey) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_KEY_SET); + return 0; + } + + if (ctx->pkey->type != peer->type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + return 0; + } + + // ran@cryptocom.ru: For clarity. The error is if parameters in peer are + // present (!missing) but don't match. EVP_PKEY_cmp_parameters may return + // 1 (match), 0 (don't match) and -2 (comparison is not defined). -1 + // (different key types) is impossible here because it is checked earlier. + // -2 is OK for us here, as well as 1, so we can check for 0 only. + if (!EVP_PKEY_missing_parameters(peer) && + !EVP_PKEY_cmp_parameters(ctx->pkey, peer)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_PARAMETERS); + return 0; + } + + EVP_PKEY_free(ctx->peerkey); + ctx->peerkey = peer; + + ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 1, peer); + + if (ret <= 0) { + ctx->peerkey = NULL; + return 0; + } + + EVP_PKEY_up_ref(peer); + return 1; +} + +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *out_key_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->derive) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DERIVE) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->derive(ctx, key, out_key_len); +} + +int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_KEYGEN; + return 1; +} + +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; + } + if (ctx->operation != EVP_PKEY_OP_KEYGEN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + 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 (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return 0; + } + } + + if (!ctx->pmeth->paramgen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back new file mode 100644 index 0000000..9ca2c55 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back @@ -0,0 +1,484 @@ +/* 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 "../internal.h" +#include "internal.h" + + +static const EVP_PKEY_METHOD *const evp_methods[] = { + &rsa_pkey_meth, + &ec_pkey_meth, + &ed25519_pkey_meth, + &x25519_pkey_meth, +}; + +static const EVP_PKEY_METHOD *evp_pkey_meth_find(int type) { + 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]; + } + } + + return NULL; +} + +static EVP_PKEY_CTX *evp_pkey_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) { + EVP_PKEY_CTX *ret; + const EVP_PKEY_METHOD *pmeth; + + if (id == -1) { + if (!pkey || !pkey->ameth) { + return NULL; + } + id = pkey->ameth->pkey_id; + } + + pmeth = evp_pkey_meth_find(id); + + if (pmeth == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + ERR_add_error_dataf("algorithm %d", id); + return NULL; + } + + ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX)); + if (!ret) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY_CTX)); + + ret->engine = e; + ret->pmeth = pmeth; + ret->operation = EVP_PKEY_OP_UNDEFINED; + + if (pkey) { + EVP_PKEY_up_ref(pkey); + ret->pkey = pkey; + } + + if (pmeth->init) { + if (pmeth->init(ret) <= 0) { + EVP_PKEY_free(ret->pkey); + OPENSSL_free(ret); + return NULL; + } + } + + return ret; +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e) { + return evp_pkey_ctx_new(pkey, e, -1); +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e) { + return evp_pkey_ctx_new(NULL, e, id); +} + +void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) { + if (ctx == NULL) { + return; + } + if (ctx->pmeth && ctx->pmeth->cleanup) { + ctx->pmeth->cleanup(ctx); + } + EVP_PKEY_free(ctx->pkey); + EVP_PKEY_free(ctx->peerkey); + OPENSSL_free(ctx); +} + +EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx) { + if (!ctx->pmeth || !ctx->pmeth->copy) { + return NULL; + } + + EVP_PKEY_CTX *ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX)); + if (!ret) { + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EVP_PKEY_CTX)); + + ret->pmeth = ctx->pmeth; + ret->engine = ctx->engine; + ret->operation = ctx->operation; + + if (ctx->pkey != NULL) { + EVP_PKEY_up_ref(ctx->pkey); + ret->pkey = ctx->pkey; + } + + if (ctx->peerkey != NULL) { + EVP_PKEY_up_ref(ctx->peerkey); + ret->peerkey = ctx->peerkey; + } + + if (ctx->pmeth->copy(ret, ctx) <= 0) { + ret->pmeth = NULL; + EVP_PKEY_CTX_free(ret); + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return NULL; + } + + return ret; +} + +EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) { return ctx->pkey; } + +int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, + int p1, void *p2) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl) { + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } + if (keytype != -1 && ctx->pmeth->pkey_id != keytype) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + if (ctx->operation == EVP_PKEY_OP_UNDEFINED) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_OPERATION_SET); + return 0; + } + + if (optype != -1 && !(ctx->operation & optype)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_OPERATION); + return 0; + } + + return ctx->pmeth->ctrl(ctx, cmd, p1, p2); +} + +int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) { + if (ctx == NULL || ctx->pmeth == NULL || + (ctx->pmeth->sign == NULL && ctx->pmeth->sign_message == NULL)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + ctx->operation = EVP_PKEY_OP_SIGN; + return 1; +} + +int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *sig_len, + const uint8_t *digest, size_t digest_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->sign) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_SIGN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->sign(ctx, sig, sig_len, digest, digest_len); +} + +int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) { + if (ctx == NULL || ctx->pmeth == NULL || + (ctx->pmeth->verify == NULL && ctx->pmeth->verify_message == NULL)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_VERIFY; + return 1; +} + +int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t sig_len, + const uint8_t *digest, size_t digest_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_VERIFY) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->verify(ctx, sig, sig_len, digest, digest_len); +} + +int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_ENCRYPT; + return 1; +} + +int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_ENCRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen); +} + +int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_DECRYPT; + return 1; +} + +int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DECRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen); +} + +int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_VERIFYRECOVER; + return 1; +} + +int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, + const uint8_t *sig, size_t sig_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_VERIFYRECOVER) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->verify_recover(ctx, out, out_len, sig, sig_len); +} + +int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->derive) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_DERIVE; + return 1; +} + +int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer) { + int ret; + if (!ctx || !ctx->pmeth || + !(ctx->pmeth->derive || ctx->pmeth->encrypt || ctx->pmeth->decrypt) || + !ctx->pmeth->ctrl) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DERIVE && + ctx->operation != EVP_PKEY_OP_ENCRYPT && + ctx->operation != EVP_PKEY_OP_DECRYPT) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 0, peer); + + if (ret <= 0) { + return 0; + } + + if (ret == 2) { + return 1; + } + + if (!ctx->pkey) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_KEY_SET); + return 0; + } + + if (ctx->pkey->type != peer->type) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_KEY_TYPES); + return 0; + } + + // ran@cryptocom.ru: For clarity. The error is if parameters in peer are + // present (!missing) but don't match. EVP_PKEY_cmp_parameters may return + // 1 (match), 0 (don't match) and -2 (comparison is not defined). -1 + // (different key types) is impossible here because it is checked earlier. + // -2 is OK for us here, as well as 1, so we can check for 0 only. + if (!EVP_PKEY_missing_parameters(peer) && + !EVP_PKEY_cmp_parameters(ctx->pkey, peer)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DIFFERENT_PARAMETERS); + return 0; + } + + EVP_PKEY_free(ctx->peerkey); + ctx->peerkey = peer; + + ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 1, peer); + + if (ret <= 0) { + ctx->peerkey = NULL; + return 0; + } + + EVP_PKEY_up_ref(peer); + return 1; +} + +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *out_key_len) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->derive) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_DERIVE) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + return ctx->pmeth->derive(ctx, key, out_key_len); +} + +int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_KEYGEN; + return 1; +} + +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; + } + if (ctx->operation != EVP_PKEY_OP_KEYGEN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + 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 (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return 0; + } + } + + if (!ctx->pmeth->paramgen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h new file mode 100644 index 0000000..1b1fb48 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h.grpc_back new file mode 100644 index 0000000..8b6a583 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c new file mode 100644 index 0000000..78587dc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c @@ -0,0 +1,273 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +static int dsa_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 3279, section 2.3.2. + + // Parameters may or may not be present. + DSA *dsa; + if (CBS_len(params) == 0) { + dsa = DSA_new(); + if (dsa == NULL) { + return 0; + } + } else { + dsa = DSA_parse_parameters(params); + if (dsa == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + } + + dsa->pub_key = BN_new(); + if (dsa->pub_key == NULL) { + goto err; + } + + if (!BN_parse_asn1_unsigned(key, dsa->pub_key) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + EVP_PKEY_assign_DSA(out, dsa); + return 1; + +err: + DSA_free(dsa); + return 0; +} + +static int dsa_pub_encode(CBB *out, const EVP_PKEY *key) { + const DSA *dsa = key->pkey.dsa; + const int has_params = dsa->p != NULL && dsa->q != NULL && dsa->g != NULL; + + // See RFC 5480, section 2. + 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, dsa_asn1_meth.oid, dsa_asn1_meth.oid_len) || + (has_params && + !DSA_marshal_parameters(&algorithm, dsa)) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !BN_marshal_asn1(&key_bitstring, dsa->pub_key) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int dsa_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See PKCS#11, v2.40, section 2.5. + + // Decode parameters. + BN_CTX *ctx = NULL; + DSA *dsa = DSA_parse_parameters(params); + if (dsa == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + dsa->priv_key = BN_new(); + dsa->pub_key = BN_new(); + if (dsa->priv_key == NULL || dsa->pub_key == NULL) { + goto err; + } + + // Decode the key. + if (!BN_parse_asn1_unsigned(key, dsa->priv_key) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + // Calculate the public key. + ctx = BN_CTX_new(); + if (ctx == NULL || + !BN_mod_exp_mont_consttime(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, + ctx, NULL)) { + goto err; + } + + BN_CTX_free(ctx); + EVP_PKEY_assign_DSA(out, dsa); + return 1; + +err: + BN_CTX_free(ctx); + DSA_free(dsa); + return 0; +} + +static int dsa_priv_encode(CBB *out, const EVP_PKEY *key) { + const DSA *dsa = key->pkey.dsa; + if (dsa == NULL || dsa->priv_key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MISSING_PARAMETERS); + return 0; + } + + // See PKCS#11, v2.40, section 2.5. + CBB pkcs8, algorithm, oid, private_key; + 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, dsa_asn1_meth.oid, dsa_asn1_meth.oid_len) || + !DSA_marshal_parameters(&algorithm, dsa) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !BN_marshal_asn1(&private_key, dsa->priv_key) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int int_dsa_size(const EVP_PKEY *pkey) { + return DSA_size(pkey->pkey.dsa); +} + +static int dsa_bits(const EVP_PKEY *pkey) { + return BN_num_bits(pkey->pkey.dsa->p); +} + +static int dsa_missing_parameters(const EVP_PKEY *pkey) { + DSA *dsa; + dsa = pkey->pkey.dsa; + if (dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) { + return 1; + } + return 0; +} + +static int dup_bn_into(BIGNUM **out, BIGNUM *src) { + BIGNUM *a; + + a = BN_dup(src); + if (a == NULL) { + return 0; + } + BN_free(*out); + *out = a; + + return 1; +} + +static int dsa_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + if (!dup_bn_into(&to->pkey.dsa->p, from->pkey.dsa->p) || + !dup_bn_into(&to->pkey.dsa->q, from->pkey.dsa->q) || + !dup_bn_into(&to->pkey.dsa->g, from->pkey.dsa->g)) { + return 0; + } + + return 1; +} + +static int dsa_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(a->pkey.dsa->p, b->pkey.dsa->p) == 0 && + BN_cmp(a->pkey.dsa->q, b->pkey.dsa->q) == 0 && + BN_cmp(a->pkey.dsa->g, b->pkey.dsa->g) == 0; +} + +static int dsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) == 0; +} + +static void int_dsa_free(EVP_PKEY *pkey) { DSA_free(pkey->pkey.dsa); } + +const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { + EVP_PKEY_DSA, + // 1.2.840.10040.4.1 + {0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x01}, 7, + + dsa_pub_decode, + dsa_pub_encode, + dsa_pub_cmp, + + 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, + dsa_bits, + + dsa_missing_parameters, + dsa_copy_parameters, + dsa_cmp_parameters, + + int_dsa_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back new file mode 100644 index 0000000..d50e0fc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back @@ -0,0 +1,273 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +static int dsa_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 3279, section 2.3.2. + + // Parameters may or may not be present. + DSA *dsa; + if (CBS_len(params) == 0) { + dsa = DSA_new(); + if (dsa == NULL) { + return 0; + } + } else { + dsa = DSA_parse_parameters(params); + if (dsa == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + } + + dsa->pub_key = BN_new(); + if (dsa->pub_key == NULL) { + goto err; + } + + if (!BN_parse_asn1_unsigned(key, dsa->pub_key) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + EVP_PKEY_assign_DSA(out, dsa); + return 1; + +err: + DSA_free(dsa); + return 0; +} + +static int dsa_pub_encode(CBB *out, const EVP_PKEY *key) { + const DSA *dsa = key->pkey.dsa; + const int has_params = dsa->p != NULL && dsa->q != NULL && dsa->g != NULL; + + // See RFC 5480, section 2. + 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, dsa_asn1_meth.oid, dsa_asn1_meth.oid_len) || + (has_params && + !DSA_marshal_parameters(&algorithm, dsa)) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !BN_marshal_asn1(&key_bitstring, dsa->pub_key) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int dsa_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See PKCS#11, v2.40, section 2.5. + + // Decode parameters. + BN_CTX *ctx = NULL; + DSA *dsa = DSA_parse_parameters(params); + if (dsa == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + dsa->priv_key = BN_new(); + dsa->pub_key = BN_new(); + if (dsa->priv_key == NULL || dsa->pub_key == NULL) { + goto err; + } + + // Decode the key. + if (!BN_parse_asn1_unsigned(key, dsa->priv_key) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + // Calculate the public key. + ctx = BN_CTX_new(); + if (ctx == NULL || + !BN_mod_exp_mont_consttime(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, + ctx, NULL)) { + goto err; + } + + BN_CTX_free(ctx); + EVP_PKEY_assign_DSA(out, dsa); + return 1; + +err: + BN_CTX_free(ctx); + DSA_free(dsa); + return 0; +} + +static int dsa_priv_encode(CBB *out, const EVP_PKEY *key) { + const DSA *dsa = key->pkey.dsa; + if (dsa == NULL || dsa->priv_key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MISSING_PARAMETERS); + return 0; + } + + // See PKCS#11, v2.40, section 2.5. + CBB pkcs8, algorithm, oid, private_key; + 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, dsa_asn1_meth.oid, dsa_asn1_meth.oid_len) || + !DSA_marshal_parameters(&algorithm, dsa) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !BN_marshal_asn1(&private_key, dsa->priv_key) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int int_dsa_size(const EVP_PKEY *pkey) { + return DSA_size(pkey->pkey.dsa); +} + +static int dsa_bits(const EVP_PKEY *pkey) { + return BN_num_bits(pkey->pkey.dsa->p); +} + +static int dsa_missing_parameters(const EVP_PKEY *pkey) { + DSA *dsa; + dsa = pkey->pkey.dsa; + if (dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) { + return 1; + } + return 0; +} + +static int dup_bn_into(BIGNUM **out, BIGNUM *src) { + BIGNUM *a; + + a = BN_dup(src); + if (a == NULL) { + return 0; + } + BN_free(*out); + *out = a; + + return 1; +} + +static int dsa_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + if (!dup_bn_into(&to->pkey.dsa->p, from->pkey.dsa->p) || + !dup_bn_into(&to->pkey.dsa->q, from->pkey.dsa->q) || + !dup_bn_into(&to->pkey.dsa->g, from->pkey.dsa->g)) { + return 0; + } + + return 1; +} + +static int dsa_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(a->pkey.dsa->p, b->pkey.dsa->p) == 0 && + BN_cmp(a->pkey.dsa->q, b->pkey.dsa->q) == 0 && + BN_cmp(a->pkey.dsa->g, b->pkey.dsa->g) == 0; +} + +static int dsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) == 0; +} + +static void int_dsa_free(EVP_PKEY *pkey) { DSA_free(pkey->pkey.dsa); } + +const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { + EVP_PKEY_DSA, + // 1.2.840.10040.4.1 + {0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x01}, 7, + + dsa_pub_decode, + dsa_pub_encode, + dsa_pub_cmp, + + 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, + dsa_bits, + + dsa_missing_parameters, + dsa_copy_parameters, + dsa_cmp_parameters, + + int_dsa_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c new file mode 100644 index 0000000..9dc36fa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c @@ -0,0 +1,286 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +typedef struct { + // message digest + const EVP_MD *md; + EC_GROUP *gen_group; +} EC_PKEY_CTX; + + +static int pkey_ec_init(EVP_PKEY_CTX *ctx) { + EC_PKEY_CTX *dctx; + dctx = OPENSSL_malloc(sizeof(EC_PKEY_CTX)); + if (!dctx) { + return 0; + } + OPENSSL_memset(dctx, 0, sizeof(EC_PKEY_CTX)); + + ctx->data = dctx; + + return 1; +} + +static int pkey_ec_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { + EC_PKEY_CTX *dctx, *sctx; + if (!pkey_ec_init(dst)) { + return 0; + } + sctx = src->data; + dctx = dst->data; + + dctx->md = sctx->md; + + return 1; +} + +static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { + EC_PKEY_CTX *dctx = ctx->data; + if (!dctx) { + return; + } + + EC_GROUP_free(dctx->gen_group); + OPENSSL_free(dctx); +} + +static int pkey_ec_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen) { + unsigned int sltmp; + EC_KEY *ec = ctx->pkey->pkey.ec; + + if (!sig) { + *siglen = ECDSA_size(ec); + return 1; + } else if (*siglen < (size_t)ECDSA_size(ec)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (!ECDSA_sign(0, tbs, tbslen, sig, &sltmp, ec)) { + return 0; + } + *siglen = (size_t)sltmp; + return 1; +} + +static int pkey_ec_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen) { + return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->pkey->pkey.ec); +} + +static int pkey_ec_derive(EVP_PKEY_CTX *ctx, uint8_t *key, + size_t *keylen) { + int ret; + size_t outlen; + const EC_POINT *pubkey = NULL; + EC_KEY *eckey; + + if (!ctx->pkey || !ctx->peerkey) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + eckey = ctx->pkey->pkey.ec; + + if (!key) { + const EC_GROUP *group; + group = EC_KEY_get0_group(eckey); + *keylen = (EC_GROUP_get_degree(group) + 7) / 8; + return 1; + } + pubkey = EC_KEY_get0_public_key(ctx->peerkey->pkey.ec); + + // NB: unlike PKCS#3 DH, if *outlen is less than maximum size this is + // not an error, the result is truncated. + + outlen = *keylen; + + ret = ECDH_compute_key(key, outlen, pubkey, eckey, 0); + if (ret < 0) { + return 0; + } + *keylen = ret; + return 1; +} + +static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + EC_PKEY_CTX *dctx = ctx->data; + + switch (type) { + case EVP_PKEY_CTRL_MD: + if (EVP_MD_type((const EVP_MD *)p2) != NID_sha1 && + EVP_MD_type((const EVP_MD *)p2) != NID_ecdsa_with_SHA1 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha224 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha256 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha384 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha512) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_DIGEST_TYPE); + return 0; + } + dctx->md = p2; + return 1; + + case EVP_PKEY_CTRL_GET_MD: + *(const EVP_MD **)p2 = dctx->md; + return 1; + + case EVP_PKEY_CTRL_PEER_KEY: + // 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; + } +} + +static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + 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, dctx->gen_group)) { + EC_KEY_free(ec); + return 0; + } + EVP_PKEY_assign_EC_KEY(pkey, ec); + return 1; +} + +const EVP_PKEY_METHOD ec_pkey_meth = { + EVP_PKEY_EC, + pkey_ec_init, + pkey_ec_copy, + pkey_ec_cleanup, + pkey_ec_keygen, + pkey_ec_sign, + NULL /* sign_message */, + pkey_ec_verify, + NULL /* verify_message */, + NULL /* verify_recover */, + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back new file mode 100644 index 0000000..9767541 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back @@ -0,0 +1,286 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +typedef struct { + // message digest + const EVP_MD *md; + EC_GROUP *gen_group; +} EC_PKEY_CTX; + + +static int pkey_ec_init(EVP_PKEY_CTX *ctx) { + EC_PKEY_CTX *dctx; + dctx = OPENSSL_malloc(sizeof(EC_PKEY_CTX)); + if (!dctx) { + return 0; + } + OPENSSL_memset(dctx, 0, sizeof(EC_PKEY_CTX)); + + ctx->data = dctx; + + return 1; +} + +static int pkey_ec_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { + EC_PKEY_CTX *dctx, *sctx; + if (!pkey_ec_init(dst)) { + return 0; + } + sctx = src->data; + dctx = dst->data; + + dctx->md = sctx->md; + + return 1; +} + +static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { + EC_PKEY_CTX *dctx = ctx->data; + if (!dctx) { + return; + } + + EC_GROUP_free(dctx->gen_group); + OPENSSL_free(dctx); +} + +static int pkey_ec_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen) { + unsigned int sltmp; + EC_KEY *ec = ctx->pkey->pkey.ec; + + if (!sig) { + *siglen = ECDSA_size(ec); + return 1; + } else if (*siglen < (size_t)ECDSA_size(ec)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (!ECDSA_sign(0, tbs, tbslen, sig, &sltmp, ec)) { + return 0; + } + *siglen = (size_t)sltmp; + return 1; +} + +static int pkey_ec_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen) { + return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->pkey->pkey.ec); +} + +static int pkey_ec_derive(EVP_PKEY_CTX *ctx, uint8_t *key, + size_t *keylen) { + int ret; + size_t outlen; + const EC_POINT *pubkey = NULL; + EC_KEY *eckey; + + if (!ctx->pkey || !ctx->peerkey) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + eckey = ctx->pkey->pkey.ec; + + if (!key) { + const EC_GROUP *group; + group = EC_KEY_get0_group(eckey); + *keylen = (EC_GROUP_get_degree(group) + 7) / 8; + return 1; + } + pubkey = EC_KEY_get0_public_key(ctx->peerkey->pkey.ec); + + // NB: unlike PKCS#3 DH, if *outlen is less than maximum size this is + // not an error, the result is truncated. + + outlen = *keylen; + + ret = ECDH_compute_key(key, outlen, pubkey, eckey, 0); + if (ret < 0) { + return 0; + } + *keylen = ret; + return 1; +} + +static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + EC_PKEY_CTX *dctx = ctx->data; + + switch (type) { + case EVP_PKEY_CTRL_MD: + if (EVP_MD_type((const EVP_MD *)p2) != NID_sha1 && + EVP_MD_type((const EVP_MD *)p2) != NID_ecdsa_with_SHA1 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha224 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha256 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha384 && + EVP_MD_type((const EVP_MD *)p2) != NID_sha512) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_DIGEST_TYPE); + return 0; + } + dctx->md = p2; + return 1; + + case EVP_PKEY_CTRL_GET_MD: + *(const EVP_MD **)p2 = dctx->md; + return 1; + + case EVP_PKEY_CTRL_PEER_KEY: + // 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; + } +} + +static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + 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, dctx->gen_group)) { + EC_KEY_free(ec); + return 0; + } + EVP_PKEY_assign_EC_KEY(pkey, ec); + return 1; +} + +const EVP_PKEY_METHOD ec_pkey_meth = { + EVP_PKEY_EC, + pkey_ec_init, + pkey_ec_copy, + pkey_ec_cleanup, + pkey_ec_keygen, + pkey_ec_sign, + NULL /* sign_message */, + pkey_ec_verify, + NULL /* verify_message */, + NULL /* verify_recover */, + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c new file mode 100644 index 0000000..5c0bec5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c @@ -0,0 +1,255 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +static int eckey_pub_encode(CBB *out, const EVP_PKEY *key) { + const EC_KEY *ec_key = key->pkey.ec; + const EC_GROUP *group = EC_KEY_get0_group(ec_key); + const EC_POINT *public_key = EC_KEY_get0_public_key(ec_key); + + // See RFC 5480, section 2. + 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, ec_asn1_meth.oid, ec_asn1_meth.oid_len) || + !EC_KEY_marshal_curve_name(&algorithm, group) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !EC_POINT_point2cbb(&key_bitstring, group, public_key, + POINT_CONVERSION_UNCOMPRESSED, NULL) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int eckey_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 5480, section 2. + + // The parameters are a named curve. + EC_POINT *point = NULL; + EC_KEY *eckey = NULL; + EC_GROUP *group = EC_KEY_parse_curve_name(params); + if (group == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + eckey = EC_KEY_new(); + if (eckey == NULL || !EC_KEY_set_group(eckey, group)) { + goto err; + } + + point = EC_POINT_new(group); + if (point == NULL || + !EC_POINT_oct2point(group, point, CBS_data(key), CBS_len(key), NULL) || + !EC_KEY_set_public_key(eckey, point)) { + goto err; + } + + EC_GROUP_free(group); + EC_POINT_free(point); + EVP_PKEY_assign_EC_KEY(out, eckey); + return 1; + +err: + EC_GROUP_free(group); + EC_POINT_free(point); + EC_KEY_free(eckey); + return 0; +} + +static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + int r; + const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec); + const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec), + *pb = EC_KEY_get0_public_key(b->pkey.ec); + r = EC_POINT_cmp(group, pa, pb, NULL); + if (r == 0) { + return 1; + } else if (r == 1) { + return 0; + } else { + return -2; + } +} + +static int eckey_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 5915. + EC_GROUP *group = EC_KEY_parse_parameters(params); + if (group == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + EC_GROUP_free(group); + return 0; + } + + EC_KEY *ec_key = EC_KEY_parse_private_key(key, group); + EC_GROUP_free(group); + if (ec_key == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + EC_KEY_free(ec_key); + return 0; + } + + EVP_PKEY_assign_EC_KEY(out, ec_key); + return 1; +} + +static int eckey_priv_encode(CBB *out, const EVP_PKEY *key) { + const EC_KEY *ec_key = key->pkey.ec; + + // Omit the redundant copy of the curve name. This contradicts RFC 5915 but + // aligns with PKCS #11. SEC 1 only says they may be omitted if known by other + // means. Both OpenSSL and NSS omit the redundant parameters, so we omit them + // as well. + unsigned enc_flags = EC_KEY_get_enc_flags(ec_key) | EC_PKEY_NO_PARAMETERS; + + // See RFC 5915. + CBB pkcs8, algorithm, oid, private_key; + 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, ec_asn1_meth.oid, ec_asn1_meth.oid_len) || + !EC_KEY_marshal_curve_name(&algorithm, EC_KEY_get0_group(ec_key)) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !EC_KEY_marshal_private_key(&private_key, ec_key, enc_flags) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int int_ec_size(const EVP_PKEY *pkey) { + return ECDSA_size(pkey->pkey.ec); +} + +static int ec_bits(const EVP_PKEY *pkey) { + const EC_GROUP *group = EC_KEY_get0_group(pkey->pkey.ec); + if (group == NULL) { + ERR_clear_error(); + return 0; + } + return BN_num_bits(EC_GROUP_get0_order(group)); +} + +static int ec_missing_parameters(const EVP_PKEY *pkey) { + return EC_KEY_get0_group(pkey->pkey.ec) == NULL; +} + +static int ec_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + 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) { + const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), + *group_b = EC_KEY_get0_group(b->pkey.ec); + if (EC_GROUP_cmp(group_a, group_b, NULL) != 0) { + // mismatch + return 0; + } + return 1; +} + +static void int_ec_free(EVP_PKEY *pkey) { EC_KEY_free(pkey->pkey.ec); } + +static int eckey_opaque(const EVP_PKEY *pkey) { + return EC_KEY_is_opaque(pkey->pkey.ec); +} + +const EVP_PKEY_ASN1_METHOD ec_asn1_meth = { + EVP_PKEY_EC, + // 1.2.840.10045.2.1 + {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01}, 7, + + eckey_pub_decode, + eckey_pub_encode, + eckey_pub_cmp, + + 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, + ec_bits, + + ec_missing_parameters, + ec_copy_parameters, + ec_cmp_parameters, + + int_ec_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back new file mode 100644 index 0000000..dedc5e0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back @@ -0,0 +1,255 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +static int eckey_pub_encode(CBB *out, const EVP_PKEY *key) { + const EC_KEY *ec_key = key->pkey.ec; + const EC_GROUP *group = EC_KEY_get0_group(ec_key); + const EC_POINT *public_key = EC_KEY_get0_public_key(ec_key); + + // See RFC 5480, section 2. + 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, ec_asn1_meth.oid, ec_asn1_meth.oid_len) || + !EC_KEY_marshal_curve_name(&algorithm, group) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !EC_POINT_point2cbb(&key_bitstring, group, public_key, + POINT_CONVERSION_UNCOMPRESSED, NULL) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int eckey_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 5480, section 2. + + // The parameters are a named curve. + EC_POINT *point = NULL; + EC_KEY *eckey = NULL; + EC_GROUP *group = EC_KEY_parse_curve_name(params); + if (group == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + goto err; + } + + eckey = EC_KEY_new(); + if (eckey == NULL || !EC_KEY_set_group(eckey, group)) { + goto err; + } + + point = EC_POINT_new(group); + if (point == NULL || + !EC_POINT_oct2point(group, point, CBS_data(key), CBS_len(key), NULL) || + !EC_KEY_set_public_key(eckey, point)) { + goto err; + } + + EC_GROUP_free(group); + EC_POINT_free(point); + EVP_PKEY_assign_EC_KEY(out, eckey); + return 1; + +err: + EC_GROUP_free(group); + EC_POINT_free(point); + EC_KEY_free(eckey); + return 0; +} + +static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + int r; + const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec); + const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec), + *pb = EC_KEY_get0_public_key(b->pkey.ec); + r = EC_POINT_cmp(group, pa, pb, NULL); + if (r == 0) { + return 1; + } else if (r == 1) { + return 0; + } else { + return -2; + } +} + +static int eckey_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 5915. + EC_GROUP *group = EC_KEY_parse_parameters(params); + if (group == NULL || CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + EC_GROUP_free(group); + return 0; + } + + EC_KEY *ec_key = EC_KEY_parse_private_key(key, group); + EC_GROUP_free(group); + if (ec_key == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + EC_KEY_free(ec_key); + return 0; + } + + EVP_PKEY_assign_EC_KEY(out, ec_key); + return 1; +} + +static int eckey_priv_encode(CBB *out, const EVP_PKEY *key) { + const EC_KEY *ec_key = key->pkey.ec; + + // Omit the redundant copy of the curve name. This contradicts RFC 5915 but + // aligns with PKCS #11. SEC 1 only says they may be omitted if known by other + // means. Both OpenSSL and NSS omit the redundant parameters, so we omit them + // as well. + unsigned enc_flags = EC_KEY_get_enc_flags(ec_key) | EC_PKEY_NO_PARAMETERS; + + // See RFC 5915. + CBB pkcs8, algorithm, oid, private_key; + 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, ec_asn1_meth.oid, ec_asn1_meth.oid_len) || + !EC_KEY_marshal_curve_name(&algorithm, EC_KEY_get0_group(ec_key)) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !EC_KEY_marshal_private_key(&private_key, ec_key, enc_flags) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int int_ec_size(const EVP_PKEY *pkey) { + return ECDSA_size(pkey->pkey.ec); +} + +static int ec_bits(const EVP_PKEY *pkey) { + const EC_GROUP *group = EC_KEY_get0_group(pkey->pkey.ec); + if (group == NULL) { + ERR_clear_error(); + return 0; + } + return BN_num_bits(EC_GROUP_get0_order(group)); +} + +static int ec_missing_parameters(const EVP_PKEY *pkey) { + return EC_KEY_get0_group(pkey->pkey.ec) == NULL; +} + +static int ec_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { + 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) { + const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), + *group_b = EC_KEY_get0_group(b->pkey.ec); + if (EC_GROUP_cmp(group_a, group_b, NULL) != 0) { + // mismatch + return 0; + } + return 1; +} + +static void int_ec_free(EVP_PKEY *pkey) { EC_KEY_free(pkey->pkey.ec); } + +static int eckey_opaque(const EVP_PKEY *pkey) { + return EC_KEY_is_opaque(pkey->pkey.ec); +} + +const EVP_PKEY_ASN1_METHOD ec_asn1_meth = { + EVP_PKEY_EC, + // 1.2.840.10045.2.1 + {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01}, 7, + + eckey_pub_decode, + eckey_pub_encode, + eckey_pub_cmp, + + 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, + ec_bits, + + ec_missing_parameters, + ec_copy_parameters, + ec_cmp_parameters, + + int_ec_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c new file mode 100644 index 0000000..d520ed2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c.grpc_back new file mode 100644 index 0000000..9149afb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c new file mode 100644 index 0000000..632ee5b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c.grpc_back new file mode 100644 index 0000000..1f996cf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c new file mode 100644 index 0000000..04a4f22 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c @@ -0,0 +1,648 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" +#include "../fipsmodule/rsa/internal.h" +#include "internal.h" + + +typedef struct { + // Key gen parameters + int nbits; + BIGNUM *pub_exp; + // RSA padding mode + int pad_mode; + // message digest + const EVP_MD *md; + // message digest for MGF1 + const EVP_MD *mgf1md; + // PSS salt length + int saltlen; + // tbuf is a buffer which is either NULL, or is the size of the RSA modulus. + // It's used to store the output of RSA operations. + uint8_t *tbuf; + // OAEP label + uint8_t *oaep_label; + size_t oaep_labellen; +} RSA_PKEY_CTX; + +typedef struct { + uint8_t *data; + size_t len; +} RSA_OAEP_LABEL_PARAMS; + +static int pkey_rsa_init(EVP_PKEY_CTX *ctx) { + RSA_PKEY_CTX *rctx; + rctx = OPENSSL_malloc(sizeof(RSA_PKEY_CTX)); + if (!rctx) { + return 0; + } + OPENSSL_memset(rctx, 0, sizeof(RSA_PKEY_CTX)); + + rctx->nbits = 2048; + rctx->pad_mode = RSA_PKCS1_PADDING; + rctx->saltlen = -2; + + ctx->data = rctx; + + return 1; +} + +static int pkey_rsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { + RSA_PKEY_CTX *dctx, *sctx; + if (!pkey_rsa_init(dst)) { + return 0; + } + sctx = src->data; + dctx = dst->data; + dctx->nbits = sctx->nbits; + if (sctx->pub_exp) { + dctx->pub_exp = BN_dup(sctx->pub_exp); + if (!dctx->pub_exp) { + return 0; + } + } + + 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 = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen); + if (!dctx->oaep_label) { + return 0; + } + dctx->oaep_labellen = sctx->oaep_labellen; + } + + return 1; +} + +static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx) { + RSA_PKEY_CTX *rctx = ctx->data; + + if (rctx == NULL) { + return; + } + + BN_free(rctx->pub_exp); + OPENSSL_free(rctx->tbuf); + OPENSSL_free(rctx->oaep_label); + OPENSSL_free(rctx); +} + +static int setup_tbuf(RSA_PKEY_CTX *ctx, EVP_PKEY_CTX *pk) { + if (ctx->tbuf) { + return 1; + } + ctx->tbuf = OPENSSL_malloc(EVP_PKEY_size(pk->pkey)); + if (!ctx->tbuf) { + return 0; + } + return 1; +} + +static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!sig) { + *siglen = key_len; + return 1; + } + + if (*siglen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->md) { + unsigned out_len; + switch (rctx->pad_mode) { + case RSA_PKCS1_PADDING: + if (!RSA_sign(EVP_MD_type(rctx->md), tbs, tbslen, sig, &out_len, rsa)) { + return 0; + } + *siglen = out_len; + return 1; + + case RSA_PKCS1_PSS_PADDING: + return RSA_sign_pss_mgf1(rsa, siglen, sig, *siglen, tbs, tbslen, + rctx->md, rctx->mgf1md, rctx->saltlen); + + default: + return 0; + } + } + + return RSA_sign_raw(rsa, siglen, sig, *siglen, tbs, tbslen, rctx->pad_mode); +} + +static int pkey_rsa_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, + size_t siglen, const uint8_t *tbs, + size_t tbslen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + + if (rctx->md) { + switch (rctx->pad_mode) { + case RSA_PKCS1_PADDING: + return RSA_verify(EVP_MD_type(rctx->md), tbs, tbslen, sig, siglen, rsa); + + case RSA_PKCS1_PSS_PADDING: + return RSA_verify_pss_mgf1(rsa, tbs, tbslen, rctx->md, rctx->mgf1md, + rctx->saltlen, sig, siglen); + + default: + return 0; + } + } + + size_t rslen; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + if (!setup_tbuf(rctx, ctx) || + !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, + rctx->pad_mode) || + rslen != tbslen || + CRYPTO_memcmp(tbs, rctx->tbuf, rslen) != 0) { + return 0; + } + + return 1; +} + +static int pkey_rsa_verify_recover(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len, const uint8_t *sig, + size_t sig_len) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (out == NULL) { + *out_len = key_len; + return 1; + } + + if (*out_len < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->md == NULL) { + return RSA_verify_raw(rsa, out_len, out, *out_len, sig, sig_len, + rctx->pad_mode); + } + + if (rctx->pad_mode != RSA_PKCS1_PADDING) { + return 0; + } + + // Assemble the encoded hash, using a placeholder hash value. + static const uint8_t kDummyHash[EVP_MAX_MD_SIZE] = {0}; + const size_t hash_len = EVP_MD_size(rctx->md); + uint8_t *asn1_prefix; + size_t asn1_prefix_len; + int asn1_prefix_allocated; + if (!setup_tbuf(rctx, ctx) || + !RSA_add_pkcs1_prefix(&asn1_prefix, &asn1_prefix_len, + &asn1_prefix_allocated, EVP_MD_type(rctx->md), + kDummyHash, hash_len)) { + return 0; + } + + size_t rslen; + int ok = 1; + if (!RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, sig_len, + RSA_PKCS1_PADDING) || + rslen != asn1_prefix_len || + // Compare all but the hash suffix. + CRYPTO_memcmp(rctx->tbuf, asn1_prefix, asn1_prefix_len - hash_len) != 0) { + ok = 0; + } + + if (asn1_prefix_allocated) { + OPENSSL_free(asn1_prefix); + } + + if (!ok) { + return 0; + } + + if (out != NULL) { + OPENSSL_memcpy(out, rctx->tbuf + rslen - hash_len, hash_len); + } + *out_len = hash_len; + + return 1; +} + +static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!out) { + *outlen = key_len; + return 1; + } + + if (*outlen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) { + if (!setup_tbuf(rctx, ctx) || + !RSA_padding_add_PKCS1_OAEP_mgf1(rctx->tbuf, key_len, in, inlen, + rctx->oaep_label, rctx->oaep_labellen, + rctx->md, rctx->mgf1md) || + !RSA_encrypt(rsa, outlen, out, *outlen, rctx->tbuf, key_len, + RSA_NO_PADDING)) { + return 0; + } + return 1; + } + + return RSA_encrypt(rsa, outlen, out, *outlen, in, inlen, rctx->pad_mode); +} + +static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *outlen, const uint8_t *in, + size_t inlen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!out) { + *outlen = key_len; + return 1; + } + + if (*outlen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) { + size_t padded_len; + if (!setup_tbuf(rctx, ctx) || + !RSA_decrypt(rsa, &padded_len, rctx->tbuf, key_len, in, inlen, + RSA_NO_PADDING) || + !RSA_padding_check_PKCS1_OAEP_mgf1( + out, outlen, key_len, rctx->tbuf, padded_len, rctx->oaep_label, + rctx->oaep_labellen, rctx->md, rctx->mgf1md)) { + return 0; + } + return 1; + } + + return RSA_decrypt(rsa, outlen, out, key_len, in, inlen, rctx->pad_mode); +} + +static int check_padding_md(const EVP_MD *md, int padding) { + if (!md) { + return 1; + } + + if (padding == RSA_NO_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + + return 1; +} + +static int is_known_padding(int padding_mode) { + switch (padding_mode) { + case RSA_PKCS1_PADDING: + case RSA_NO_PADDING: + case RSA_PKCS1_OAEP_PADDING: + case RSA_PKCS1_PSS_PADDING: + return 1; + default: + return 0; + } +} + +static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + RSA_PKEY_CTX *rctx = ctx->data; + switch (type) { + case EVP_PKEY_CTRL_RSA_PADDING: + if (!is_known_padding(p1) || !check_padding_md(rctx->md, p1) || + (p1 == RSA_PKCS1_PSS_PADDING && + 0 == (ctx->operation & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY))) || + (p1 == RSA_PKCS1_OAEP_PADDING && + 0 == (ctx->operation & EVP_PKEY_OP_TYPE_CRYPT))) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE); + return 0; + } + if ((p1 == RSA_PKCS1_PSS_PADDING || p1 == RSA_PKCS1_OAEP_PADDING) && + rctx->md == NULL) { + rctx->md = EVP_sha1(); + } + rctx->pad_mode = p1; + return 1; + + case EVP_PKEY_CTRL_GET_RSA_PADDING: + *(int *)p2 = rctx->pad_mode; + return 1; + + case EVP_PKEY_CTRL_RSA_PSS_SALTLEN: + case EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN: + if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PSS_SALTLEN); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN) { + *(int *)p2 = rctx->saltlen; + } else { + if (p1 < -2) { + return 0; + } + rctx->saltlen = p1; + } + return 1; + + case EVP_PKEY_CTRL_RSA_KEYGEN_BITS: + if (p1 < 256) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_KEYBITS); + return 0; + } + rctx->nbits = p1; + return 1; + + case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP: + if (!p2) { + return 0; + } + BN_free(rctx->pub_exp); + rctx->pub_exp = p2; + return 1; + + case EVP_PKEY_CTRL_RSA_OAEP_MD: + case EVP_PKEY_CTRL_GET_RSA_OAEP_MD: + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_OAEP_MD) { + *(const EVP_MD **)p2 = rctx->md; + } else { + rctx->md = p2; + } + return 1; + + case EVP_PKEY_CTRL_MD: + if (!check_padding_md(p2, rctx->pad_mode)) { + return 0; + } + rctx->md = p2; + return 1; + + case EVP_PKEY_CTRL_GET_MD: + *(const EVP_MD **)p2 = rctx->md; + return 1; + + case EVP_PKEY_CTRL_RSA_MGF1_MD: + case EVP_PKEY_CTRL_GET_RSA_MGF1_MD: + if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING && + rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_MGF1_MD); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_MGF1_MD) { + if (rctx->mgf1md) { + *(const EVP_MD **)p2 = rctx->mgf1md; + } else { + *(const EVP_MD **)p2 = rctx->md; + } + } else { + rctx->mgf1md = p2; + } + return 1; + + case EVP_PKEY_CTRL_RSA_OAEP_LABEL: { + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + OPENSSL_free(rctx->oaep_label); + RSA_OAEP_LABEL_PARAMS *params = p2; + rctx->oaep_label = params->data; + rctx->oaep_labellen = params->len; + return 1; + } + + case EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL: + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + CBS_init((CBS *)p2, rctx->oaep_label, rctx->oaep_labellen); + return 1; + + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } +} + +static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + RSA *rsa = NULL; + RSA_PKEY_CTX *rctx = ctx->data; + + if (!rctx->pub_exp) { + rctx->pub_exp = BN_new(); + if (!rctx->pub_exp || !BN_set_word(rctx->pub_exp, RSA_F4)) { + return 0; + } + } + rsa = RSA_new(); + if (!rsa) { + return 0; + } + + if (!RSA_generate_key_ex(rsa, rctx->nbits, rctx->pub_exp, NULL)) { + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(pkey, rsa); + return 1; +} + +const EVP_PKEY_METHOD rsa_pkey_meth = { + EVP_PKEY_RSA, + pkey_rsa_init, + pkey_rsa_copy, + pkey_rsa_cleanup, + pkey_rsa_keygen, + pkey_rsa_sign, + NULL /* sign_message */, + pkey_rsa_verify, + NULL /* verify_message */, + pkey_rsa_verify_recover, + pkey_rsa_encrypt, + pkey_rsa_decrypt, + NULL /* derive */, + NULL /* paramgen */, + pkey_rsa_ctrl, +}; + +int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int padding) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, + padding, NULL); +} + +int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *out_padding) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_GET_RSA_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), + EVP_PKEY_CTRL_RSA_PSS_SALTLEN, salt_len, NULL); +} + +int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *out_salt_len) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY), + EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, out_salt_len); +} + +int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL); +} + +int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *e) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, e); +} + +int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md); +} + +int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void*) out_md); +} + +int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void*) md); +} + +int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void*) out_md); +} + +int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, uint8_t *label, + size_t label_len) { + RSA_OAEP_LABEL_PARAMS params = {label, label_len}; + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_OAEP_LABEL, 0, ¶ms); +} + +int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, + const uint8_t **out_label) { + CBS label; + if (!EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, &label)) { + return -1; + } + if (CBS_len(&label) > INT_MAX) { + OPENSSL_PUT_ERROR(EVP, ERR_R_OVERFLOW); + return -1; + } + *out_label = CBS_data(&label); + return (int)CBS_len(&label); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back new file mode 100644 index 0000000..7872a92 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back @@ -0,0 +1,648 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" +#include "../fipsmodule/rsa/internal.h" +#include "internal.h" + + +typedef struct { + // Key gen parameters + int nbits; + BIGNUM *pub_exp; + // RSA padding mode + int pad_mode; + // message digest + const EVP_MD *md; + // message digest for MGF1 + const EVP_MD *mgf1md; + // PSS salt length + int saltlen; + // tbuf is a buffer which is either NULL, or is the size of the RSA modulus. + // It's used to store the output of RSA operations. + uint8_t *tbuf; + // OAEP label + uint8_t *oaep_label; + size_t oaep_labellen; +} RSA_PKEY_CTX; + +typedef struct { + uint8_t *data; + size_t len; +} RSA_OAEP_LABEL_PARAMS; + +static int pkey_rsa_init(EVP_PKEY_CTX *ctx) { + RSA_PKEY_CTX *rctx; + rctx = OPENSSL_malloc(sizeof(RSA_PKEY_CTX)); + if (!rctx) { + return 0; + } + OPENSSL_memset(rctx, 0, sizeof(RSA_PKEY_CTX)); + + rctx->nbits = 2048; + rctx->pad_mode = RSA_PKCS1_PADDING; + rctx->saltlen = -2; + + ctx->data = rctx; + + return 1; +} + +static int pkey_rsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { + RSA_PKEY_CTX *dctx, *sctx; + if (!pkey_rsa_init(dst)) { + return 0; + } + sctx = src->data; + dctx = dst->data; + dctx->nbits = sctx->nbits; + if (sctx->pub_exp) { + dctx->pub_exp = BN_dup(sctx->pub_exp); + if (!dctx->pub_exp) { + return 0; + } + } + + 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 = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen); + if (!dctx->oaep_label) { + return 0; + } + dctx->oaep_labellen = sctx->oaep_labellen; + } + + return 1; +} + +static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx) { + RSA_PKEY_CTX *rctx = ctx->data; + + if (rctx == NULL) { + return; + } + + BN_free(rctx->pub_exp); + OPENSSL_free(rctx->tbuf); + OPENSSL_free(rctx->oaep_label); + OPENSSL_free(rctx); +} + +static int setup_tbuf(RSA_PKEY_CTX *ctx, EVP_PKEY_CTX *pk) { + if (ctx->tbuf) { + return 1; + } + ctx->tbuf = OPENSSL_malloc(EVP_PKEY_size(pk->pkey)); + if (!ctx->tbuf) { + return 0; + } + return 1; +} + +static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!sig) { + *siglen = key_len; + return 1; + } + + if (*siglen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->md) { + unsigned out_len; + switch (rctx->pad_mode) { + case RSA_PKCS1_PADDING: + if (!RSA_sign(EVP_MD_type(rctx->md), tbs, tbslen, sig, &out_len, rsa)) { + return 0; + } + *siglen = out_len; + return 1; + + case RSA_PKCS1_PSS_PADDING: + return RSA_sign_pss_mgf1(rsa, siglen, sig, *siglen, tbs, tbslen, + rctx->md, rctx->mgf1md, rctx->saltlen); + + default: + return 0; + } + } + + return RSA_sign_raw(rsa, siglen, sig, *siglen, tbs, tbslen, rctx->pad_mode); +} + +static int pkey_rsa_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, + size_t siglen, const uint8_t *tbs, + size_t tbslen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + + if (rctx->md) { + switch (rctx->pad_mode) { + case RSA_PKCS1_PADDING: + return RSA_verify(EVP_MD_type(rctx->md), tbs, tbslen, sig, siglen, rsa); + + case RSA_PKCS1_PSS_PADDING: + return RSA_verify_pss_mgf1(rsa, tbs, tbslen, rctx->md, rctx->mgf1md, + rctx->saltlen, sig, siglen); + + default: + return 0; + } + } + + size_t rslen; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + if (!setup_tbuf(rctx, ctx) || + !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, + rctx->pad_mode) || + rslen != tbslen || + CRYPTO_memcmp(tbs, rctx->tbuf, rslen) != 0) { + return 0; + } + + return 1; +} + +static int pkey_rsa_verify_recover(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len, const uint8_t *sig, + size_t sig_len) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (out == NULL) { + *out_len = key_len; + return 1; + } + + if (*out_len < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->md == NULL) { + return RSA_verify_raw(rsa, out_len, out, *out_len, sig, sig_len, + rctx->pad_mode); + } + + if (rctx->pad_mode != RSA_PKCS1_PADDING) { + return 0; + } + + // Assemble the encoded hash, using a placeholder hash value. + static const uint8_t kDummyHash[EVP_MAX_MD_SIZE] = {0}; + const size_t hash_len = EVP_MD_size(rctx->md); + uint8_t *asn1_prefix; + size_t asn1_prefix_len; + int asn1_prefix_allocated; + if (!setup_tbuf(rctx, ctx) || + !RSA_add_pkcs1_prefix(&asn1_prefix, &asn1_prefix_len, + &asn1_prefix_allocated, EVP_MD_type(rctx->md), + kDummyHash, hash_len)) { + return 0; + } + + size_t rslen; + int ok = 1; + if (!RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, sig_len, + RSA_PKCS1_PADDING) || + rslen != asn1_prefix_len || + // Compare all but the hash suffix. + CRYPTO_memcmp(rctx->tbuf, asn1_prefix, asn1_prefix_len - hash_len) != 0) { + ok = 0; + } + + if (asn1_prefix_allocated) { + OPENSSL_free(asn1_prefix); + } + + if (!ok) { + return 0; + } + + if (out != NULL) { + OPENSSL_memcpy(out, rctx->tbuf + rslen - hash_len, hash_len); + } + *out_len = hash_len; + + return 1; +} + +static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!out) { + *outlen = key_len; + return 1; + } + + if (*outlen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) { + if (!setup_tbuf(rctx, ctx) || + !RSA_padding_add_PKCS1_OAEP_mgf1(rctx->tbuf, key_len, in, inlen, + rctx->oaep_label, rctx->oaep_labellen, + rctx->md, rctx->mgf1md) || + !RSA_encrypt(rsa, outlen, out, *outlen, rctx->tbuf, key_len, + RSA_NO_PADDING)) { + return 0; + } + return 1; + } + + return RSA_encrypt(rsa, outlen, out, *outlen, in, inlen, rctx->pad_mode); +} + +static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *outlen, const uint8_t *in, + size_t inlen) { + RSA_PKEY_CTX *rctx = ctx->data; + RSA *rsa = ctx->pkey->pkey.rsa; + const size_t key_len = EVP_PKEY_size(ctx->pkey); + + if (!out) { + *outlen = key_len; + return 1; + } + + if (*outlen < key_len) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) { + size_t padded_len; + if (!setup_tbuf(rctx, ctx) || + !RSA_decrypt(rsa, &padded_len, rctx->tbuf, key_len, in, inlen, + RSA_NO_PADDING) || + !RSA_padding_check_PKCS1_OAEP_mgf1( + out, outlen, key_len, rctx->tbuf, padded_len, rctx->oaep_label, + rctx->oaep_labellen, rctx->md, rctx->mgf1md)) { + return 0; + } + return 1; + } + + return RSA_decrypt(rsa, outlen, out, key_len, in, inlen, rctx->pad_mode); +} + +static int check_padding_md(const EVP_MD *md, int padding) { + if (!md) { + return 1; + } + + if (padding == RSA_NO_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + + return 1; +} + +static int is_known_padding(int padding_mode) { + switch (padding_mode) { + case RSA_PKCS1_PADDING: + case RSA_NO_PADDING: + case RSA_PKCS1_OAEP_PADDING: + case RSA_PKCS1_PSS_PADDING: + return 1; + default: + return 0; + } +} + +static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + RSA_PKEY_CTX *rctx = ctx->data; + switch (type) { + case EVP_PKEY_CTRL_RSA_PADDING: + if (!is_known_padding(p1) || !check_padding_md(rctx->md, p1) || + (p1 == RSA_PKCS1_PSS_PADDING && + 0 == (ctx->operation & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY))) || + (p1 == RSA_PKCS1_OAEP_PADDING && + 0 == (ctx->operation & EVP_PKEY_OP_TYPE_CRYPT))) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE); + return 0; + } + if ((p1 == RSA_PKCS1_PSS_PADDING || p1 == RSA_PKCS1_OAEP_PADDING) && + rctx->md == NULL) { + rctx->md = EVP_sha1(); + } + rctx->pad_mode = p1; + return 1; + + case EVP_PKEY_CTRL_GET_RSA_PADDING: + *(int *)p2 = rctx->pad_mode; + return 1; + + case EVP_PKEY_CTRL_RSA_PSS_SALTLEN: + case EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN: + if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PSS_SALTLEN); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN) { + *(int *)p2 = rctx->saltlen; + } else { + if (p1 < -2) { + return 0; + } + rctx->saltlen = p1; + } + return 1; + + case EVP_PKEY_CTRL_RSA_KEYGEN_BITS: + if (p1 < 256) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_KEYBITS); + return 0; + } + rctx->nbits = p1; + return 1; + + case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP: + if (!p2) { + return 0; + } + BN_free(rctx->pub_exp); + rctx->pub_exp = p2; + return 1; + + case EVP_PKEY_CTRL_RSA_OAEP_MD: + case EVP_PKEY_CTRL_GET_RSA_OAEP_MD: + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_OAEP_MD) { + *(const EVP_MD **)p2 = rctx->md; + } else { + rctx->md = p2; + } + return 1; + + case EVP_PKEY_CTRL_MD: + if (!check_padding_md(p2, rctx->pad_mode)) { + return 0; + } + rctx->md = p2; + return 1; + + case EVP_PKEY_CTRL_GET_MD: + *(const EVP_MD **)p2 = rctx->md; + return 1; + + case EVP_PKEY_CTRL_RSA_MGF1_MD: + case EVP_PKEY_CTRL_GET_RSA_MGF1_MD: + if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING && + rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_MGF1_MD); + return 0; + } + if (type == EVP_PKEY_CTRL_GET_RSA_MGF1_MD) { + if (rctx->mgf1md) { + *(const EVP_MD **)p2 = rctx->mgf1md; + } else { + *(const EVP_MD **)p2 = rctx->md; + } + } else { + rctx->mgf1md = p2; + } + return 1; + + case EVP_PKEY_CTRL_RSA_OAEP_LABEL: { + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + OPENSSL_free(rctx->oaep_label); + RSA_OAEP_LABEL_PARAMS *params = p2; + rctx->oaep_label = params->data; + rctx->oaep_labellen = params->len; + return 1; + } + + case EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL: + if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PADDING_MODE); + return 0; + } + CBS_init((CBS *)p2, rctx->oaep_label, rctx->oaep_labellen); + return 1; + + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } +} + +static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + RSA *rsa = NULL; + RSA_PKEY_CTX *rctx = ctx->data; + + if (!rctx->pub_exp) { + rctx->pub_exp = BN_new(); + if (!rctx->pub_exp || !BN_set_word(rctx->pub_exp, RSA_F4)) { + return 0; + } + } + rsa = RSA_new(); + if (!rsa) { + return 0; + } + + if (!RSA_generate_key_ex(rsa, rctx->nbits, rctx->pub_exp, NULL)) { + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(pkey, rsa); + return 1; +} + +const EVP_PKEY_METHOD rsa_pkey_meth = { + EVP_PKEY_RSA, + pkey_rsa_init, + pkey_rsa_copy, + pkey_rsa_cleanup, + pkey_rsa_keygen, + pkey_rsa_sign, + NULL /* sign_message */, + pkey_rsa_verify, + NULL /* verify_message */, + pkey_rsa_verify_recover, + pkey_rsa_encrypt, + pkey_rsa_decrypt, + NULL /* derive */, + NULL /* paramgen */, + pkey_rsa_ctrl, +}; + +int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int padding) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, + padding, NULL); +} + +int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *out_padding) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_GET_RSA_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), + EVP_PKEY_CTRL_RSA_PSS_SALTLEN, salt_len, NULL); +} + +int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *out_salt_len) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY), + EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, out_salt_len); +} + +int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL); +} + +int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *e) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, e); +} + +int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md); +} + +int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void*) out_md); +} + +int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void*) md); +} + +int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, + EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void*) out_md); +} + +int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, uint8_t *label, + size_t label_len) { + RSA_OAEP_LABEL_PARAMS params = {label, label_len}; + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_RSA_OAEP_LABEL, 0, ¶ms); +} + +int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, + const uint8_t **out_label) { + CBS label; + if (!EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, + EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, &label)) { + return -1; + } + if (CBS_len(&label) > INT_MAX) { + OPENSSL_PUT_ERROR(EVP, ERR_R_OVERFLOW); + return -1; + } + *out_label = CBS_data(&label); + return (int)CBS_len(&label); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c new file mode 100644 index 0000000..1bd2eab --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c @@ -0,0 +1,194 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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/rsa/internal.h" +#include "internal.h" + + +static int rsa_pub_encode(CBB *out, const EVP_PKEY *key) { + // See RFC 3279, section 2.3.1. + CBB spki, algorithm, oid, null, 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, rsa_asn1_meth.oid, rsa_asn1_meth.oid_len) || + !CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !RSA_marshal_public_key(&key_bitstring, key->pkey.rsa) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int rsa_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 3279, section 2.3.1. + + // The parameters must be NULL. + CBS null; + if (!CBS_get_asn1(params, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + RSA *rsa = RSA_parse_public_key(key); + if (rsa == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(out, rsa); + return 1; +} + +static int rsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) == 0 && + BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) == 0; +} + +static int rsa_priv_encode(CBB *out, const EVP_PKEY *key) { + CBB pkcs8, algorithm, oid, null, private_key; + 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, rsa_asn1_meth.oid, rsa_asn1_meth.oid_len) || + !CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !RSA_marshal_private_key(&private_key, key->pkey.rsa) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int rsa_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // Per RFC 3447, A.1, the parameters have type NULL. + CBS null; + if (!CBS_get_asn1(params, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + RSA *rsa = RSA_parse_private_key(key); + if (rsa == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(out, rsa); + return 1; +} + +static int rsa_opaque(const EVP_PKEY *pkey) { + return RSA_is_opaque(pkey->pkey.rsa); +} + +static int int_rsa_size(const EVP_PKEY *pkey) { + return RSA_size(pkey->pkey.rsa); +} + +static int rsa_bits(const EVP_PKEY *pkey) { + return RSA_bits(pkey->pkey.rsa); +} + +static void int_rsa_free(EVP_PKEY *pkey) { RSA_free(pkey->pkey.rsa); } + +const EVP_PKEY_ASN1_METHOD rsa_asn1_meth = { + EVP_PKEY_RSA, + // 1.2.840.113549.1.1.1 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01}, 9, + + rsa_pub_decode, + rsa_pub_encode, + rsa_pub_cmp, + + 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, + rsa_bits, + + 0,0,0, + + int_rsa_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back new file mode 100644 index 0000000..c097103 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back @@ -0,0 +1,194 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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/rsa/internal.h" +#include "internal.h" + + +static int rsa_pub_encode(CBB *out, const EVP_PKEY *key) { + // See RFC 3279, section 2.3.1. + CBB spki, algorithm, oid, null, 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, rsa_asn1_meth.oid, rsa_asn1_meth.oid_len) || + !CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !RSA_marshal_public_key(&key_bitstring, key->pkey.rsa) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int rsa_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 3279, section 2.3.1. + + // The parameters must be NULL. + CBS null; + if (!CBS_get_asn1(params, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + RSA *rsa = RSA_parse_public_key(key); + if (rsa == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(out, rsa); + return 1; +} + +static int rsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + return BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) == 0 && + BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) == 0; +} + +static int rsa_priv_encode(CBB *out, const EVP_PKEY *key) { + CBB pkcs8, algorithm, oid, null, private_key; + 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, rsa_asn1_meth.oid, rsa_asn1_meth.oid_len) || + !CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !RSA_marshal_private_key(&private_key, key->pkey.rsa) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int rsa_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // Per RFC 3447, A.1, the parameters have type NULL. + CBS null; + if (!CBS_get_asn1(params, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + RSA *rsa = RSA_parse_private_key(key); + if (rsa == NULL || CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + RSA_free(rsa); + return 0; + } + + EVP_PKEY_assign_RSA(out, rsa); + return 1; +} + +static int rsa_opaque(const EVP_PKEY *pkey) { + return RSA_is_opaque(pkey->pkey.rsa); +} + +static int int_rsa_size(const EVP_PKEY *pkey) { + return RSA_size(pkey->pkey.rsa); +} + +static int rsa_bits(const EVP_PKEY *pkey) { + return RSA_bits(pkey->pkey.rsa); +} + +static void int_rsa_free(EVP_PKEY *pkey) { RSA_free(pkey->pkey.rsa); } + +const EVP_PKEY_ASN1_METHOD rsa_asn1_meth = { + EVP_PKEY_RSA, + // 1.2.840.113549.1.1.1 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01}, 9, + + rsa_pub_decode, + rsa_pub_encode, + rsa_pub_cmp, + + 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, + rsa_bits, + + 0,0,0, + + int_rsa_free, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c new file mode 100644 index 0000000..b72ac6d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c.grpc_back new file mode 100644 index 0000000..ed7df39 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c new file mode 100644 index 0000000..0e96d99 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c.grpc_back new file mode 100644 index 0000000..99b4cc9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c new file mode 100644 index 0000000..19bcad4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c @@ -0,0 +1,146 @@ +/* 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 "../internal.h" + + +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) { + // See RFC 8018, section 5.2. + int ret = 0; + size_t md_len = EVP_MD_size(digest); + uint32_t i = 1; + HMAC_CTX hctx; + HMAC_CTX_init(&hctx); + + if (!HMAC_Init_ex(&hctx, password, password_len, digest, NULL)) { + goto err; + } + + while (key_len > 0) { + size_t todo = md_len; + if (todo > key_len) { + todo = key_len; + } + + uint8_t i_buf[4]; + i_buf[0] = (uint8_t)((i >> 24) & 0xff); + i_buf[1] = (uint8_t)((i >> 16) & 0xff); + i_buf[2] = (uint8_t)((i >> 8) & 0xff); + i_buf[3] = (uint8_t)(i & 0xff); + + // Compute U_1. + uint8_t digest_tmp[EVP_MAX_MD_SIZE]; + if (!HMAC_Init_ex(&hctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&hctx, salt, salt_len) || + !HMAC_Update(&hctx, i_buf, 4) || + !HMAC_Final(&hctx, digest_tmp, NULL)) { + goto err; + } + + OPENSSL_memcpy(out_key, digest_tmp, todo); + for (unsigned j = 1; j < iterations; j++) { + // Compute the remaining U_* values and XOR. + if (!HMAC_Init_ex(&hctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&hctx, digest_tmp, md_len) || + !HMAC_Final(&hctx, digest_tmp, NULL)) { + goto err; + } + for (size_t k = 0; k < todo; k++) { + out_key[k] ^= digest_tmp[k]; + } + } + + key_len -= todo; + out_key += todo; + i++; + } + + // RFC 8018 describes iterations (c) as being a "positive integer", so a + // value of 0 is an error. + // + // Unfortunately not all consumers of PKCS5_PBKDF2_HMAC() check their return + // value, expecting it to succeed and unconditionally using |out_key|. As a + // precaution for such callsites in external code, the old behavior of + // iterations < 1 being treated as iterations == 1 is preserved, but + // additionally an error result is returned. + // + // TODO(eroman): Figure out how to remove this compatibility hack, or change + // the default to something more sensible like 2048. + if (iterations == 0) { + goto err; + } + + ret = 1; + +err: + HMAC_CTX_cleanup(&hctx); + return ret; +} + +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) { + return PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, iterations, + EVP_sha1(), key_len, out_key); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c.grpc_back new file mode 100644 index 0000000..f23a74b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c.grpc_back @@ -0,0 +1,146 @@ +/* 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 "../internal.h" + + +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) { + // See RFC 8018, section 5.2. + int ret = 0; + size_t md_len = EVP_MD_size(digest); + uint32_t i = 1; + HMAC_CTX hctx; + HMAC_CTX_init(&hctx); + + if (!HMAC_Init_ex(&hctx, password, password_len, digest, NULL)) { + goto err; + } + + while (key_len > 0) { + size_t todo = md_len; + if (todo > key_len) { + todo = key_len; + } + + uint8_t i_buf[4]; + i_buf[0] = (uint8_t)((i >> 24) & 0xff); + i_buf[1] = (uint8_t)((i >> 16) & 0xff); + i_buf[2] = (uint8_t)((i >> 8) & 0xff); + i_buf[3] = (uint8_t)(i & 0xff); + + // Compute U_1. + uint8_t digest_tmp[EVP_MAX_MD_SIZE]; + if (!HMAC_Init_ex(&hctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&hctx, salt, salt_len) || + !HMAC_Update(&hctx, i_buf, 4) || + !HMAC_Final(&hctx, digest_tmp, NULL)) { + goto err; + } + + OPENSSL_memcpy(out_key, digest_tmp, todo); + for (unsigned j = 1; j < iterations; j++) { + // Compute the remaining U_* values and XOR. + if (!HMAC_Init_ex(&hctx, NULL, 0, NULL, NULL) || + !HMAC_Update(&hctx, digest_tmp, md_len) || + !HMAC_Final(&hctx, digest_tmp, NULL)) { + goto err; + } + for (size_t k = 0; k < todo; k++) { + out_key[k] ^= digest_tmp[k]; + } + } + + key_len -= todo; + out_key += todo; + i++; + } + + // RFC 8018 describes iterations (c) as being a "positive integer", so a + // value of 0 is an error. + // + // Unfortunately not all consumers of PKCS5_PBKDF2_HMAC() check their return + // value, expecting it to succeed and unconditionally using |out_key|. As a + // precaution for such callsites in external code, the old behavior of + // iterations < 1 being treated as iterations == 1 is preserved, but + // additionally an error result is returned. + // + // TODO(eroman): Figure out how to remove this compatibility hack, or change + // the default to something more sensible like 2048. + if (iterations == 0) { + goto err; + } + + ret = 1; + +err: + HMAC_CTX_cleanup(&hctx); + return ret; +} + +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) { + return PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, iterations, + EVP_sha1(), key_len, out_key); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c new file mode 100644 index 0000000..c60a020 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c @@ -0,0 +1,489 @@ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" +#include "../fipsmodule/rsa/internal.h" + + +static int bn_print(BIO *bp, const char *number, const BIGNUM *num, + uint8_t *buf, int off) { + if (num == NULL) { + return 1; + } + + if (!BIO_indent(bp, off, 128)) { + return 0; + } + if (BN_is_zero(num)) { + if (BIO_printf(bp, "%s 0\n", number) <= 0) { + return 0; + } + return 1; + } + + if (BN_num_bytes(num) <= sizeof(long)) { + const char *neg = BN_is_negative(num) ? "-" : ""; + if (BIO_printf(bp, "%s %s%lu (%s0x%lx)\n", number, neg, + (unsigned long)num->d[0], neg, + (unsigned long)num->d[0]) <= 0) { + return 0; + } + } else { + buf[0] = 0; + if (BIO_printf(bp, "%s%s", number, + (BN_is_negative(num)) ? " (Negative)" : "") <= 0) { + return 0; + } + int n = BN_bn2bin(num, &buf[1]); + + if (buf[1] & 0x80) { + n++; + } else { + buf++; + } + + int i; + for (i = 0; i < n; i++) { + if ((i % 15) == 0) { + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, off + 4, 128)) { + return 0; + } + } + if (BIO_printf(bp, "%02x%s", buf[i], ((i + 1) == n) ? "" : ":") <= 0) { + return 0; + } + } + if (BIO_write(bp, "\n", 1) <= 0) { + return 0; + } + } + return 1; +} + +static void update_buflen(const BIGNUM *b, size_t *pbuflen) { + if (!b) { + return; + } + + size_t len = BN_num_bytes(b); + if (*pbuflen < len) { + *pbuflen = len; + } +} + +// RSA keys. + +static int do_rsa_print(BIO *out, const RSA *rsa, int off, + int include_private) { + const char *s, *str; + uint8_t *m = NULL; + int ret = 0, mod_len = 0; + size_t buf_len = 0; + + update_buflen(rsa->n, &buf_len); + update_buflen(rsa->e, &buf_len); + + if (include_private) { + update_buflen(rsa->d, &buf_len); + update_buflen(rsa->p, &buf_len); + update_buflen(rsa->q, &buf_len); + update_buflen(rsa->dmp1, &buf_len); + update_buflen(rsa->dmq1, &buf_len); + update_buflen(rsa->iqmp, &buf_len); + } + + m = (uint8_t *)OPENSSL_malloc(buf_len + 10); + if (m == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (rsa->n != NULL) { + mod_len = BN_num_bits(rsa->n); + } + + if (!BIO_indent(out, off, 128)) { + goto err; + } + + if (include_private && rsa->d) { + if (BIO_printf(out, "Private-Key: (%d bit)\n", mod_len) <= 0) { + goto err; + } + str = "modulus:"; + s = "publicExponent:"; + } else { + if (BIO_printf(out, "Public-Key: (%d bit)\n", mod_len) <= 0) { + goto err; + } + str = "Modulus:"; + s = "Exponent:"; + } + if (!bn_print(out, str, rsa->n, m, off) || + !bn_print(out, s, rsa->e, m, off)) { + goto err; + } + + if (include_private) { + if (!bn_print(out, "privateExponent:", rsa->d, m, off) || + !bn_print(out, "prime1:", rsa->p, m, off) || + !bn_print(out, "prime2:", rsa->q, m, off) || + !bn_print(out, "exponent1:", rsa->dmp1, m, off) || + !bn_print(out, "exponent2:", rsa->dmq1, m, off) || + !bn_print(out, "coefficient:", rsa->iqmp, m, off)) { + goto err; + } + } + ret = 1; + +err: + OPENSSL_free(m); + return ret; +} + +static int rsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_rsa_print(bp, pkey->pkey.rsa, indent, 0); +} + +static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_rsa_print(bp, pkey->pkey.rsa, indent, 1); +} + + +// DSA keys. + +static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) { + uint8_t *m = NULL; + int ret = 0; + size_t buf_len = 0; + const char *ktype = NULL; + + const BIGNUM *priv_key, *pub_key; + + priv_key = NULL; + if (ptype == 2) { + priv_key = x->priv_key; + } + + pub_key = NULL; + if (ptype > 0) { + pub_key = x->pub_key; + } + + ktype = "DSA-Parameters"; + if (ptype == 2) { + ktype = "Private-Key"; + } else if (ptype == 1) { + ktype = "Public-Key"; + } + + update_buflen(x->p, &buf_len); + update_buflen(x->q, &buf_len); + update_buflen(x->g, &buf_len); + update_buflen(priv_key, &buf_len); + update_buflen(pub_key, &buf_len); + + m = (uint8_t *)OPENSSL_malloc(buf_len + 10); + if (m == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (priv_key) { + if (!BIO_indent(bp, off, 128) || + BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0) { + goto err; + } + } + + if (!bn_print(bp, "priv:", priv_key, m, off) || + !bn_print(bp, "pub: ", pub_key, m, off) || + !bn_print(bp, "P: ", x->p, m, off) || + !bn_print(bp, "Q: ", x->q, m, off) || + !bn_print(bp, "G: ", x->g, m, off)) { + goto err; + } + ret = 1; + +err: + OPENSSL_free(m); + return ret; +} + +static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 0); +} + +static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 1); +} + +static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 2); +} + + +// EC keys. + +static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) { + uint8_t *buffer = NULL; + const char *ecstr; + size_t buf_len = 0, i; + int ret = 0, reason = ERR_R_BIO_LIB; + BIGNUM *order = NULL; + BN_CTX *ctx = NULL; + const EC_GROUP *group; + const EC_POINT *public_key; + const BIGNUM *priv_key; + uint8_t *pub_key_bytes = NULL; + size_t pub_key_bytes_len = 0; + + if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL) { + reason = ERR_R_PASSED_NULL_PARAMETER; + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + + if (ktype > 0) { + public_key = EC_KEY_get0_public_key(x); + if (public_key != NULL) { + pub_key_bytes_len = EC_POINT_point2oct( + group, public_key, EC_KEY_get_conv_form(x), NULL, 0, ctx); + if (pub_key_bytes_len == 0) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + pub_key_bytes = OPENSSL_malloc(pub_key_bytes_len); + if (pub_key_bytes == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + pub_key_bytes_len = + EC_POINT_point2oct(group, public_key, EC_KEY_get_conv_form(x), + pub_key_bytes, pub_key_bytes_len, ctx); + if (pub_key_bytes_len == 0) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + buf_len = pub_key_bytes_len; + } + } + + if (ktype == 2) { + priv_key = EC_KEY_get0_private_key(x); + if (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len) { + buf_len = i; + } + } else { + priv_key = NULL; + } + + if (ktype > 0) { + buf_len += 10; + if ((buffer = OPENSSL_malloc(buf_len)) == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + } + if (ktype == 2) { + ecstr = "Private-Key"; + } else if (ktype == 1) { + ecstr = "Public-Key"; + } else { + ecstr = "ECDSA-Parameters"; + } + + if (!BIO_indent(bp, off, 128)) { + goto err; + } + order = BN_new(); + if (order == NULL || !EC_GROUP_get_order(group, order, NULL) || + BIO_printf(bp, "%s: (%d bit)\n", ecstr, BN_num_bits(order)) <= 0) { + goto err; + } + + if ((priv_key != NULL) && + !bn_print(bp, "priv:", priv_key, buffer, off)) { + goto err; + } + if (pub_key_bytes != NULL) { + BIO_hexdump(bp, pub_key_bytes, pub_key_bytes_len, off); + } + // TODO(fork): implement + /* + if (!ECPKParameters_print(bp, group, off)) + goto err; */ + ret = 1; + +err: + if (!ret) { + OPENSSL_PUT_ERROR(EVP, reason); + } + OPENSSL_free(pub_key_bytes); + BN_free(order); + BN_CTX_free(ctx); + OPENSSL_free(buffer); + return ret; +} + +static int eckey_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0); +} + +static int eckey_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 1); +} + + +static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2); +} + + +typedef struct { + int type; + int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); + int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); + int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); +} EVP_PKEY_PRINT_METHOD; + +static EVP_PKEY_PRINT_METHOD kPrintMethods[] = { + { + EVP_PKEY_RSA, + rsa_pub_print, + rsa_priv_print, + NULL /* param_print */, + }, + { + EVP_PKEY_DSA, + dsa_pub_print, + dsa_priv_print, + dsa_param_print, + }, + { + EVP_PKEY_EC, + eckey_pub_print, + eckey_priv_print, + eckey_param_print, + }, +}; + +static size_t kPrintMethodsLen = OPENSSL_ARRAY_SIZE(kPrintMethods); + +static EVP_PKEY_PRINT_METHOD *find_method(int type) { + for (size_t i = 0; i < kPrintMethodsLen; i++) { + if (kPrintMethods[i].type == type) { + return &kPrintMethods[i]; + } + } + return NULL; +} + +static int print_unsupported(BIO *out, const EVP_PKEY *pkey, int indent, + const char *kstr) { + BIO_indent(out, indent, 128); + BIO_printf(out, "%s algorithm unsupported\n", kstr); + return 1; +} + +int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->pub_print != NULL) { + return method->pub_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Public Key"); +} + +int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->priv_print != NULL) { + return method->priv_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Private Key"); +} + +int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->param_print != NULL) { + return method->param_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Parameters"); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c.grpc_back new file mode 100644 index 0000000..3621d5f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/print.c.grpc_back @@ -0,0 +1,489 @@ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" +#include "../fipsmodule/rsa/internal.h" + + +static int bn_print(BIO *bp, const char *number, const BIGNUM *num, + uint8_t *buf, int off) { + if (num == NULL) { + return 1; + } + + if (!BIO_indent(bp, off, 128)) { + return 0; + } + if (BN_is_zero(num)) { + if (BIO_printf(bp, "%s 0\n", number) <= 0) { + return 0; + } + return 1; + } + + if (BN_num_bytes(num) <= sizeof(long)) { + const char *neg = BN_is_negative(num) ? "-" : ""; + if (BIO_printf(bp, "%s %s%lu (%s0x%lx)\n", number, neg, + (unsigned long)num->d[0], neg, + (unsigned long)num->d[0]) <= 0) { + return 0; + } + } else { + buf[0] = 0; + if (BIO_printf(bp, "%s%s", number, + (BN_is_negative(num)) ? " (Negative)" : "") <= 0) { + return 0; + } + int n = BN_bn2bin(num, &buf[1]); + + if (buf[1] & 0x80) { + n++; + } else { + buf++; + } + + int i; + for (i = 0; i < n; i++) { + if ((i % 15) == 0) { + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, off + 4, 128)) { + return 0; + } + } + if (BIO_printf(bp, "%02x%s", buf[i], ((i + 1) == n) ? "" : ":") <= 0) { + return 0; + } + } + if (BIO_write(bp, "\n", 1) <= 0) { + return 0; + } + } + return 1; +} + +static void update_buflen(const BIGNUM *b, size_t *pbuflen) { + if (!b) { + return; + } + + size_t len = BN_num_bytes(b); + if (*pbuflen < len) { + *pbuflen = len; + } +} + +// RSA keys. + +static int do_rsa_print(BIO *out, const RSA *rsa, int off, + int include_private) { + const char *s, *str; + uint8_t *m = NULL; + int ret = 0, mod_len = 0; + size_t buf_len = 0; + + update_buflen(rsa->n, &buf_len); + update_buflen(rsa->e, &buf_len); + + if (include_private) { + update_buflen(rsa->d, &buf_len); + update_buflen(rsa->p, &buf_len); + update_buflen(rsa->q, &buf_len); + update_buflen(rsa->dmp1, &buf_len); + update_buflen(rsa->dmq1, &buf_len); + update_buflen(rsa->iqmp, &buf_len); + } + + m = (uint8_t *)OPENSSL_malloc(buf_len + 10); + if (m == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (rsa->n != NULL) { + mod_len = BN_num_bits(rsa->n); + } + + if (!BIO_indent(out, off, 128)) { + goto err; + } + + if (include_private && rsa->d) { + if (BIO_printf(out, "Private-Key: (%d bit)\n", mod_len) <= 0) { + goto err; + } + str = "modulus:"; + s = "publicExponent:"; + } else { + if (BIO_printf(out, "Public-Key: (%d bit)\n", mod_len) <= 0) { + goto err; + } + str = "Modulus:"; + s = "Exponent:"; + } + if (!bn_print(out, str, rsa->n, m, off) || + !bn_print(out, s, rsa->e, m, off)) { + goto err; + } + + if (include_private) { + if (!bn_print(out, "privateExponent:", rsa->d, m, off) || + !bn_print(out, "prime1:", rsa->p, m, off) || + !bn_print(out, "prime2:", rsa->q, m, off) || + !bn_print(out, "exponent1:", rsa->dmp1, m, off) || + !bn_print(out, "exponent2:", rsa->dmq1, m, off) || + !bn_print(out, "coefficient:", rsa->iqmp, m, off)) { + goto err; + } + } + ret = 1; + +err: + OPENSSL_free(m); + return ret; +} + +static int rsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_rsa_print(bp, pkey->pkey.rsa, indent, 0); +} + +static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_rsa_print(bp, pkey->pkey.rsa, indent, 1); +} + + +// DSA keys. + +static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) { + uint8_t *m = NULL; + int ret = 0; + size_t buf_len = 0; + const char *ktype = NULL; + + const BIGNUM *priv_key, *pub_key; + + priv_key = NULL; + if (ptype == 2) { + priv_key = x->priv_key; + } + + pub_key = NULL; + if (ptype > 0) { + pub_key = x->pub_key; + } + + ktype = "DSA-Parameters"; + if (ptype == 2) { + ktype = "Private-Key"; + } else if (ptype == 1) { + ktype = "Public-Key"; + } + + update_buflen(x->p, &buf_len); + update_buflen(x->q, &buf_len); + update_buflen(x->g, &buf_len); + update_buflen(priv_key, &buf_len); + update_buflen(pub_key, &buf_len); + + m = (uint8_t *)OPENSSL_malloc(buf_len + 10); + if (m == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (priv_key) { + if (!BIO_indent(bp, off, 128) || + BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0) { + goto err; + } + } + + if (!bn_print(bp, "priv:", priv_key, m, off) || + !bn_print(bp, "pub: ", pub_key, m, off) || + !bn_print(bp, "P: ", x->p, m, off) || + !bn_print(bp, "Q: ", x->q, m, off) || + !bn_print(bp, "G: ", x->g, m, off)) { + goto err; + } + ret = 1; + +err: + OPENSSL_free(m); + return ret; +} + +static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 0); +} + +static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 1); +} + +static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_dsa_print(bp, pkey->pkey.dsa, indent, 2); +} + + +// EC keys. + +static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) { + uint8_t *buffer = NULL; + const char *ecstr; + size_t buf_len = 0, i; + int ret = 0, reason = ERR_R_BIO_LIB; + BIGNUM *order = NULL; + BN_CTX *ctx = NULL; + const EC_GROUP *group; + const EC_POINT *public_key; + const BIGNUM *priv_key; + uint8_t *pub_key_bytes = NULL; + size_t pub_key_bytes_len = 0; + + if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL) { + reason = ERR_R_PASSED_NULL_PARAMETER; + goto err; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + + if (ktype > 0) { + public_key = EC_KEY_get0_public_key(x); + if (public_key != NULL) { + pub_key_bytes_len = EC_POINT_point2oct( + group, public_key, EC_KEY_get_conv_form(x), NULL, 0, ctx); + if (pub_key_bytes_len == 0) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + pub_key_bytes = OPENSSL_malloc(pub_key_bytes_len); + if (pub_key_bytes == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + pub_key_bytes_len = + EC_POINT_point2oct(group, public_key, EC_KEY_get_conv_form(x), + pub_key_bytes, pub_key_bytes_len, ctx); + if (pub_key_bytes_len == 0) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + buf_len = pub_key_bytes_len; + } + } + + if (ktype == 2) { + priv_key = EC_KEY_get0_private_key(x); + if (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len) { + buf_len = i; + } + } else { + priv_key = NULL; + } + + if (ktype > 0) { + buf_len += 10; + if ((buffer = OPENSSL_malloc(buf_len)) == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + } + if (ktype == 2) { + ecstr = "Private-Key"; + } else if (ktype == 1) { + ecstr = "Public-Key"; + } else { + ecstr = "ECDSA-Parameters"; + } + + if (!BIO_indent(bp, off, 128)) { + goto err; + } + order = BN_new(); + if (order == NULL || !EC_GROUP_get_order(group, order, NULL) || + BIO_printf(bp, "%s: (%d bit)\n", ecstr, BN_num_bits(order)) <= 0) { + goto err; + } + + if ((priv_key != NULL) && + !bn_print(bp, "priv:", priv_key, buffer, off)) { + goto err; + } + if (pub_key_bytes != NULL) { + BIO_hexdump(bp, pub_key_bytes, pub_key_bytes_len, off); + } + // TODO(fork): implement + /* + if (!ECPKParameters_print(bp, group, off)) + goto err; */ + ret = 1; + +err: + if (!ret) { + OPENSSL_PUT_ERROR(EVP, reason); + } + OPENSSL_free(pub_key_bytes); + BN_free(order); + BN_CTX_free(ctx); + OPENSSL_free(buffer); + return ret; +} + +static int eckey_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0); +} + +static int eckey_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 1); +} + + +static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *ctx) { + return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2); +} + + +typedef struct { + int type; + int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); + int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); + int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); +} EVP_PKEY_PRINT_METHOD; + +static EVP_PKEY_PRINT_METHOD kPrintMethods[] = { + { + EVP_PKEY_RSA, + rsa_pub_print, + rsa_priv_print, + NULL /* param_print */, + }, + { + EVP_PKEY_DSA, + dsa_pub_print, + dsa_priv_print, + dsa_param_print, + }, + { + EVP_PKEY_EC, + eckey_pub_print, + eckey_priv_print, + eckey_param_print, + }, +}; + +static size_t kPrintMethodsLen = OPENSSL_ARRAY_SIZE(kPrintMethods); + +static EVP_PKEY_PRINT_METHOD *find_method(int type) { + for (size_t i = 0; i < kPrintMethodsLen; i++) { + if (kPrintMethods[i].type == type) { + return &kPrintMethods[i]; + } + } + return NULL; +} + +static int print_unsupported(BIO *out, const EVP_PKEY *pkey, int indent, + const char *kstr) { + BIO_indent(out, indent, 128); + BIO_printf(out, "%s algorithm unsupported\n", kstr); + return 1; +} + +int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->pub_print != NULL) { + return method->pub_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Public Key"); +} + +int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->priv_print != NULL) { + return method->priv_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Private Key"); +} + +int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx) { + EVP_PKEY_PRINT_METHOD *method = find_method(pkey->type); + if (method != NULL && method->param_print != NULL) { + return method->param_print(out, pkey, indent, pctx); + } + return print_unsupported(out, pkey, indent, "Parameters"); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c new file mode 100644 index 0000000..82ed1f9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c @@ -0,0 +1,213 @@ +/* + * Copyright 2015-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 +#include + +#include "../internal.h" + + +// This file implements scrypt, described in RFC 7914. +// +// Note scrypt refers to both "blocks" and a "block size" parameter, r. These +// are two different notions of blocks. A Salsa20 block is 64 bytes long, +// represented in this implementation by 16 |uint32_t|s. |r| determines the +// number of 64-byte Salsa20 blocks in a scryptBlockMix block, which is 2 * |r| +// Salsa20 blocks. This implementation refers to them as Salsa20 blocks and +// scrypt blocks, respectively. + +// A block_t is a Salsa20 block. +typedef struct { uint32_t words[16]; } block_t; + +OPENSSL_STATIC_ASSERT(sizeof(block_t) == 64, "block_t has padding"); + +#define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) + +// salsa208_word_specification implements the Salsa20/8 core function, also +// described in RFC 7914, section 3. It modifies the block at |inout| +// in-place. +static void salsa208_word_specification(block_t *inout) { + block_t x; + OPENSSL_memcpy(&x, inout, sizeof(x)); + + for (int i = 8; i > 0; i -= 2) { + x.words[4] ^= R(x.words[0] + x.words[12], 7); + x.words[8] ^= R(x.words[4] + x.words[0], 9); + x.words[12] ^= R(x.words[8] + x.words[4], 13); + x.words[0] ^= R(x.words[12] + x.words[8], 18); + x.words[9] ^= R(x.words[5] + x.words[1], 7); + x.words[13] ^= R(x.words[9] + x.words[5], 9); + x.words[1] ^= R(x.words[13] + x.words[9], 13); + x.words[5] ^= R(x.words[1] + x.words[13], 18); + x.words[14] ^= R(x.words[10] + x.words[6], 7); + x.words[2] ^= R(x.words[14] + x.words[10], 9); + x.words[6] ^= R(x.words[2] + x.words[14], 13); + x.words[10] ^= R(x.words[6] + x.words[2], 18); + x.words[3] ^= R(x.words[15] + x.words[11], 7); + x.words[7] ^= R(x.words[3] + x.words[15], 9); + x.words[11] ^= R(x.words[7] + x.words[3], 13); + x.words[15] ^= R(x.words[11] + x.words[7], 18); + x.words[1] ^= R(x.words[0] + x.words[3], 7); + x.words[2] ^= R(x.words[1] + x.words[0], 9); + x.words[3] ^= R(x.words[2] + x.words[1], 13); + x.words[0] ^= R(x.words[3] + x.words[2], 18); + x.words[6] ^= R(x.words[5] + x.words[4], 7); + x.words[7] ^= R(x.words[6] + x.words[5], 9); + x.words[4] ^= R(x.words[7] + x.words[6], 13); + x.words[5] ^= R(x.words[4] + x.words[7], 18); + x.words[11] ^= R(x.words[10] + x.words[9], 7); + x.words[8] ^= R(x.words[11] + x.words[10], 9); + x.words[9] ^= R(x.words[8] + x.words[11], 13); + x.words[10] ^= R(x.words[9] + x.words[8], 18); + x.words[12] ^= R(x.words[15] + x.words[14], 7); + x.words[13] ^= R(x.words[12] + x.words[15], 9); + x.words[14] ^= R(x.words[13] + x.words[12], 13); + x.words[15] ^= R(x.words[14] + x.words[13], 18); + } + + for (int i = 0; i < 16; ++i) { + inout->words[i] += x.words[i]; + } +} + +// xor_block sets |*out| to be |*a| XOR |*b|. +static void xor_block(block_t *out, const block_t *a, const block_t *b) { + for (size_t i = 0; i < 16; i++) { + out->words[i] = a->words[i] ^ b->words[i]; + } +} + +// scryptBlockMix implements the function described in RFC 7914, section 4. B' +// is written to |out|. |out| and |B| may not alias and must be each one scrypt +// block (2 * |r| Salsa20 blocks) long. +static void scryptBlockMix(block_t *out, const block_t *B, uint64_t r) { + assert(out != B); + + block_t X; + OPENSSL_memcpy(&X, &B[r * 2 - 1], sizeof(X)); + for (uint64_t i = 0; i < r * 2; i++) { + xor_block(&X, &X, &B[i]); + salsa208_word_specification(&X); + + // This implements the permutation in step 3. + OPENSSL_memcpy(&out[i / 2 + (i & 1) * r], &X, sizeof(X)); + } +} + +// scryptROMix implements the function described in RFC 7914, section 5. |B| is +// an scrypt block (2 * |r| Salsa20 blocks) and is modified in-place. |T| and +// |V| are scratch space allocated by the caller. |T| must have space for one +// scrypt block (2 * |r| Salsa20 blocks). |V| must have space for |N| scrypt +// blocks (2 * |r| * |N| Salsa20 blocks). +static void scryptROMix(block_t *B, uint64_t r, uint64_t N, block_t *T, + block_t *V) { + // Steps 1 and 2. + OPENSSL_memcpy(V, B, 2 * r * sizeof(block_t)); + for (uint64_t i = 1; i < N; i++) { + scryptBlockMix(&V[2 * r * i /* scrypt block i */], + &V[2 * r * (i - 1) /* scrypt block i-1 */], r); + } + scryptBlockMix(B, &V[2 * r * (N - 1) /* scrypt block N-1 */], r); + + // Step 3. + for (uint64_t i = 0; i < N; i++) { + // Note this assumes |N| <= 2^32 and is a power of 2. + uint32_t j = B[2 * r - 1].words[0] & (N - 1); + for (size_t k = 0; k < 2 * r; k++) { + xor_block(&T[k], &B[k], &V[2 * r * j + k]); + } + scryptBlockMix(B, T, r); + } +} + +// SCRYPT_PR_MAX is the maximum value of p * r. This is equivalent to the +// bounds on p in section 6: +// +// p <= ((2^32-1) * hLen) / MFLen iff +// p <= ((2^32-1) * 32) / (128 * r) iff +// p * r <= (2^30-1) +#define SCRYPT_PR_MAX ((1 << 30) - 1) + +// SCRYPT_MAX_MEM is the default maximum memory that may be allocated by +// |EVP_PBE_scrypt|. +#define SCRYPT_MAX_MEM (1024 * 1024 * 32) + +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) { + if (r == 0 || p == 0 || p > SCRYPT_PR_MAX / r || + // |N| must be a power of two. + N < 2 || (N & (N - 1)) || + // We only support |N| <= 2^32 in |scryptROMix|. + N > UINT64_C(1) << 32 || + // Check that |N| < 2^(128Γ—r / 8). + (16 * r <= 63 && N >= UINT64_C(1) << (16 * r))) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PARAMETERS); + return 0; + } + + // Determine the amount of memory needed. B, T, and V are |p|, 1, and |N| + // scrypt blocks, respectively. Each scrypt block is 2*|r| |block_t|s. + if (max_mem == 0) { + max_mem = SCRYPT_MAX_MEM; + } + + size_t max_scrypt_blocks = max_mem / (2 * r * sizeof(block_t)); + if (max_scrypt_blocks < p + 1 || + max_scrypt_blocks - p - 1 < N) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MEMORY_LIMIT_EXCEEDED); + return 0; + } + + // 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_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; + size_t V_blocks = N * 2 * r; + block_t *B = OPENSSL_malloc((B_blocks + T_blocks + V_blocks) * sizeof(block_t)); + if (B == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + 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; + } + + for (uint64_t i = 0; i < p; i++) { + scryptROMix(B + 2 * r * i, r, N, T, V); + } + + if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1, + EVP_sha256(), key_len, out_key)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(B); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back new file mode 100644 index 0000000..2feb650 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back @@ -0,0 +1,213 @@ +/* + * Copyright 2015-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 +#include + +#include "../internal.h" + + +// This file implements scrypt, described in RFC 7914. +// +// Note scrypt refers to both "blocks" and a "block size" parameter, r. These +// are two different notions of blocks. A Salsa20 block is 64 bytes long, +// represented in this implementation by 16 |uint32_t|s. |r| determines the +// number of 64-byte Salsa20 blocks in a scryptBlockMix block, which is 2 * |r| +// Salsa20 blocks. This implementation refers to them as Salsa20 blocks and +// scrypt blocks, respectively. + +// A block_t is a Salsa20 block. +typedef struct { uint32_t words[16]; } block_t; + +OPENSSL_STATIC_ASSERT(sizeof(block_t) == 64, "block_t has padding"); + +#define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) + +// salsa208_word_specification implements the Salsa20/8 core function, also +// described in RFC 7914, section 3. It modifies the block at |inout| +// in-place. +static void salsa208_word_specification(block_t *inout) { + block_t x; + OPENSSL_memcpy(&x, inout, sizeof(x)); + + for (int i = 8; i > 0; i -= 2) { + x.words[4] ^= R(x.words[0] + x.words[12], 7); + x.words[8] ^= R(x.words[4] + x.words[0], 9); + x.words[12] ^= R(x.words[8] + x.words[4], 13); + x.words[0] ^= R(x.words[12] + x.words[8], 18); + x.words[9] ^= R(x.words[5] + x.words[1], 7); + x.words[13] ^= R(x.words[9] + x.words[5], 9); + x.words[1] ^= R(x.words[13] + x.words[9], 13); + x.words[5] ^= R(x.words[1] + x.words[13], 18); + x.words[14] ^= R(x.words[10] + x.words[6], 7); + x.words[2] ^= R(x.words[14] + x.words[10], 9); + x.words[6] ^= R(x.words[2] + x.words[14], 13); + x.words[10] ^= R(x.words[6] + x.words[2], 18); + x.words[3] ^= R(x.words[15] + x.words[11], 7); + x.words[7] ^= R(x.words[3] + x.words[15], 9); + x.words[11] ^= R(x.words[7] + x.words[3], 13); + x.words[15] ^= R(x.words[11] + x.words[7], 18); + x.words[1] ^= R(x.words[0] + x.words[3], 7); + x.words[2] ^= R(x.words[1] + x.words[0], 9); + x.words[3] ^= R(x.words[2] + x.words[1], 13); + x.words[0] ^= R(x.words[3] + x.words[2], 18); + x.words[6] ^= R(x.words[5] + x.words[4], 7); + x.words[7] ^= R(x.words[6] + x.words[5], 9); + x.words[4] ^= R(x.words[7] + x.words[6], 13); + x.words[5] ^= R(x.words[4] + x.words[7], 18); + x.words[11] ^= R(x.words[10] + x.words[9], 7); + x.words[8] ^= R(x.words[11] + x.words[10], 9); + x.words[9] ^= R(x.words[8] + x.words[11], 13); + x.words[10] ^= R(x.words[9] + x.words[8], 18); + x.words[12] ^= R(x.words[15] + x.words[14], 7); + x.words[13] ^= R(x.words[12] + x.words[15], 9); + x.words[14] ^= R(x.words[13] + x.words[12], 13); + x.words[15] ^= R(x.words[14] + x.words[13], 18); + } + + for (int i = 0; i < 16; ++i) { + inout->words[i] += x.words[i]; + } +} + +// xor_block sets |*out| to be |*a| XOR |*b|. +static void xor_block(block_t *out, const block_t *a, const block_t *b) { + for (size_t i = 0; i < 16; i++) { + out->words[i] = a->words[i] ^ b->words[i]; + } +} + +// scryptBlockMix implements the function described in RFC 7914, section 4. B' +// is written to |out|. |out| and |B| may not alias and must be each one scrypt +// block (2 * |r| Salsa20 blocks) long. +static void scryptBlockMix(block_t *out, const block_t *B, uint64_t r) { + assert(out != B); + + block_t X; + OPENSSL_memcpy(&X, &B[r * 2 - 1], sizeof(X)); + for (uint64_t i = 0; i < r * 2; i++) { + xor_block(&X, &X, &B[i]); + salsa208_word_specification(&X); + + // This implements the permutation in step 3. + OPENSSL_memcpy(&out[i / 2 + (i & 1) * r], &X, sizeof(X)); + } +} + +// scryptROMix implements the function described in RFC 7914, section 5. |B| is +// an scrypt block (2 * |r| Salsa20 blocks) and is modified in-place. |T| and +// |V| are scratch space allocated by the caller. |T| must have space for one +// scrypt block (2 * |r| Salsa20 blocks). |V| must have space for |N| scrypt +// blocks (2 * |r| * |N| Salsa20 blocks). +static void scryptROMix(block_t *B, uint64_t r, uint64_t N, block_t *T, + block_t *V) { + // Steps 1 and 2. + OPENSSL_memcpy(V, B, 2 * r * sizeof(block_t)); + for (uint64_t i = 1; i < N; i++) { + scryptBlockMix(&V[2 * r * i /* scrypt block i */], + &V[2 * r * (i - 1) /* scrypt block i-1 */], r); + } + scryptBlockMix(B, &V[2 * r * (N - 1) /* scrypt block N-1 */], r); + + // Step 3. + for (uint64_t i = 0; i < N; i++) { + // Note this assumes |N| <= 2^32 and is a power of 2. + uint32_t j = B[2 * r - 1].words[0] & (N - 1); + for (size_t k = 0; k < 2 * r; k++) { + xor_block(&T[k], &B[k], &V[2 * r * j + k]); + } + scryptBlockMix(B, T, r); + } +} + +// SCRYPT_PR_MAX is the maximum value of p * r. This is equivalent to the +// bounds on p in section 6: +// +// p <= ((2^32-1) * hLen) / MFLen iff +// p <= ((2^32-1) * 32) / (128 * r) iff +// p * r <= (2^30-1) +#define SCRYPT_PR_MAX ((1 << 30) - 1) + +// SCRYPT_MAX_MEM is the default maximum memory that may be allocated by +// |EVP_PBE_scrypt|. +#define SCRYPT_MAX_MEM (1024 * 1024 * 32) + +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) { + if (r == 0 || p == 0 || p > SCRYPT_PR_MAX / r || + // |N| must be a power of two. + N < 2 || (N & (N - 1)) || + // We only support |N| <= 2^32 in |scryptROMix|. + N > UINT64_C(1) << 32 || + // Check that |N| < 2^(128Γ—r / 8). + (16 * r <= 63 && N >= UINT64_C(1) << (16 * r))) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PARAMETERS); + return 0; + } + + // Determine the amount of memory needed. B, T, and V are |p|, 1, and |N| + // scrypt blocks, respectively. Each scrypt block is 2*|r| |block_t|s. + if (max_mem == 0) { + max_mem = SCRYPT_MAX_MEM; + } + + size_t max_scrypt_blocks = max_mem / (2 * r * sizeof(block_t)); + if (max_scrypt_blocks < p + 1 || + max_scrypt_blocks - p - 1 < N) { + OPENSSL_PUT_ERROR(EVP, EVP_R_MEMORY_LIMIT_EXCEEDED); + return 0; + } + + // 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_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; + size_t V_blocks = N * 2 * r; + block_t *B = OPENSSL_malloc((B_blocks + T_blocks + V_blocks) * sizeof(block_t)); + if (B == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + 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; + } + + for (uint64_t i = 0; i < p; i++) { + scryptROMix(B + 2 * r * i, r, N, T, V); + } + + if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1, + EVP_sha256(), key_len, out_key)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(B); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c new file mode 100644 index 0000000..046b50c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c @@ -0,0 +1,151 @@ +/* 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" + + +int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) { + return EVP_DigestInit_ex(ctx, type, impl); +} + +int EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + return EVP_DigestInit(ctx, type); +} + +int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_SignFinal(const EVP_MD_CTX *ctx, uint8_t *sig, + unsigned int *out_sig_len, EVP_PKEY *pkey) { + uint8_t m[EVP_MAX_MD_SIZE]; + unsigned int m_len; + int ret = 0; + EVP_MD_CTX tmp_ctx; + EVP_PKEY_CTX *pkctx = NULL; + size_t sig_len = EVP_PKEY_size(pkey); + + *out_sig_len = 0; + EVP_MD_CTX_init(&tmp_ctx); + if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) || + !EVP_DigestFinal_ex(&tmp_ctx, m, &m_len)) { + goto out; + } + EVP_MD_CTX_cleanup(&tmp_ctx); + + pkctx = EVP_PKEY_CTX_new(pkey, NULL); + if (!pkctx || !EVP_PKEY_sign_init(pkctx) || + !EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) || + !EVP_PKEY_sign(pkctx, sig, &sig_len, m, m_len)) { + goto out; + } + *out_sig_len = sig_len; + ret = 1; + +out: + if (pkctx) { + EVP_PKEY_CTX_free(pkctx); + } + + return ret; +} + +int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) { + return EVP_DigestInit_ex(ctx, type, impl); +} + +int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + return EVP_DigestInit(ctx, type); +} + +int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_VerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, + EVP_PKEY *pkey) { + uint8_t m[EVP_MAX_MD_SIZE]; + unsigned int m_len; + int ret = 0; + EVP_MD_CTX tmp_ctx; + EVP_PKEY_CTX *pkctx = NULL; + + EVP_MD_CTX_init(&tmp_ctx); + if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) || + !EVP_DigestFinal_ex(&tmp_ctx, m, &m_len)) { + EVP_MD_CTX_cleanup(&tmp_ctx); + goto out; + } + EVP_MD_CTX_cleanup(&tmp_ctx); + + pkctx = EVP_PKEY_CTX_new(pkey, NULL); + if (!pkctx || + !EVP_PKEY_verify_init(pkctx) || + !EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest)) { + goto out; + } + ret = EVP_PKEY_verify(pkctx, sig, sig_len, m, m_len); + +out: + EVP_PKEY_CTX_free(pkctx); + return ret; +} + diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c.grpc_back new file mode 100644 index 0000000..ced86bd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c.grpc_back @@ -0,0 +1,151 @@ +/* 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" + + +int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) { + return EVP_DigestInit_ex(ctx, type, impl); +} + +int EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + return EVP_DigestInit(ctx, type); +} + +int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_SignFinal(const EVP_MD_CTX *ctx, uint8_t *sig, + unsigned int *out_sig_len, EVP_PKEY *pkey) { + uint8_t m[EVP_MAX_MD_SIZE]; + unsigned int m_len; + int ret = 0; + EVP_MD_CTX tmp_ctx; + EVP_PKEY_CTX *pkctx = NULL; + size_t sig_len = EVP_PKEY_size(pkey); + + *out_sig_len = 0; + EVP_MD_CTX_init(&tmp_ctx); + if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) || + !EVP_DigestFinal_ex(&tmp_ctx, m, &m_len)) { + goto out; + } + EVP_MD_CTX_cleanup(&tmp_ctx); + + pkctx = EVP_PKEY_CTX_new(pkey, NULL); + if (!pkctx || !EVP_PKEY_sign_init(pkctx) || + !EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) || + !EVP_PKEY_sign(pkctx, sig, &sig_len, m, m_len)) { + goto out; + } + *out_sig_len = sig_len; + ret = 1; + +out: + if (pkctx) { + EVP_PKEY_CTX_free(pkctx); + } + + return ret; +} + +int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) { + return EVP_DigestInit_ex(ctx, type, impl); +} + +int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + return EVP_DigestInit(ctx, type); +} + +int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + return EVP_DigestUpdate(ctx, data, len); +} + +int EVP_VerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, + EVP_PKEY *pkey) { + uint8_t m[EVP_MAX_MD_SIZE]; + unsigned int m_len; + int ret = 0; + EVP_MD_CTX tmp_ctx; + EVP_PKEY_CTX *pkctx = NULL; + + EVP_MD_CTX_init(&tmp_ctx); + if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx) || + !EVP_DigestFinal_ex(&tmp_ctx, m, &m_len)) { + EVP_MD_CTX_cleanup(&tmp_ctx); + goto out; + } + EVP_MD_CTX_cleanup(&tmp_ctx); + + pkctx = EVP_PKEY_CTX_new(pkey, NULL); + if (!pkctx || + !EVP_PKEY_verify_init(pkctx) || + !EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest)) { + goto out; + } + ret = EVP_PKEY_verify(pkctx, sig, sig_len, m, m_len); + +out: + EVP_PKEY_CTX_free(pkctx); + return ret; +} + diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c new file mode 100644 index 0000000..6191a6f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c @@ -0,0 +1,261 @@ +/* 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 +#include +#include +#include +#include + +#include "internal.h" + + +DEFINE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +struct crypto_ex_data_func_st { + long argl; // Arbitary long + void *argp; // Arbitary void pointer + CRYPTO_EX_free *free_func; +}; + +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_EX_DATA_FUNCS *funcs; + int ret = 0; + + funcs = OPENSSL_malloc(sizeof(CRYPTO_EX_DATA_FUNCS)); + if (funcs == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + + funcs->argl = argl; + funcs->argp = argp; + funcs->free_func = free_func; + + CRYPTO_STATIC_MUTEX_lock_write(&ex_data_class->lock); + + if (ex_data_class->meth == NULL) { + ex_data_class->meth = sk_CRYPTO_EX_DATA_FUNCS_new_null(); + } + + if (ex_data_class->meth == NULL || + !sk_CRYPTO_EX_DATA_FUNCS_push(ex_data_class->meth, funcs)) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + OPENSSL_free(funcs); + goto err; + } + + *out_index = sk_CRYPTO_EX_DATA_FUNCS_num(ex_data_class->meth) - 1 + + ex_data_class->num_reserved; + ret = 1; + +err: + CRYPTO_STATIC_MUTEX_unlock_write(&ex_data_class->lock); + return ret; +} + +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val) { + int n, i; + + if (ad->sk == NULL) { + ad->sk = sk_void_new_null(); + if (ad->sk == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + n = sk_void_num(ad->sk); + + // Add NULL values until the stack is long enough. + for (i = n; i <= index; i++) { + if (!sk_void_push(ad->sk, NULL)) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + sk_void_set(ad->sk, index, val); + return 1; +} + +void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) { + if (ad->sk == NULL || idx < 0 || (size_t)idx >= sk_void_num(ad->sk)) { + return NULL; + } + return sk_void_value(ad->sk, idx); +} + +// get_func_pointers takes a copy of the CRYPTO_EX_DATA_FUNCS pointers, if any, +// for the given class. If there are some pointers, it sets |*out| to point to +// a fresh stack of them. Otherwise it sets |*out| to NULL. It returns one on +// success or zero on error. +static int get_func_pointers(STACK_OF(CRYPTO_EX_DATA_FUNCS) **out, + CRYPTO_EX_DATA_CLASS *ex_data_class) { + size_t n; + + *out = NULL; + + // CRYPTO_EX_DATA_FUNCS structures are static once set, so we can take a + // shallow copy of the list under lock and then use the structures without + // the lock held. + CRYPTO_STATIC_MUTEX_lock_read(&ex_data_class->lock); + n = sk_CRYPTO_EX_DATA_FUNCS_num(ex_data_class->meth); + if (n > 0) { + *out = sk_CRYPTO_EX_DATA_FUNCS_dup(ex_data_class->meth); + } + CRYPTO_STATIC_MUTEX_unlock_read(&ex_data_class->lock); + + if (n > 0 && *out == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + + return 1; +} + +void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad) { + ad->sk = NULL; +} + +void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, void *obj, + CRYPTO_EX_DATA *ad) { + if (ad->sk == NULL) { + // Nothing to do. + return; + } + + STACK_OF(CRYPTO_EX_DATA_FUNCS) *func_pointers; + if (!get_func_pointers(&func_pointers, ex_data_class)) { + // TODO(davidben): This leaks memory on malloc error. + return; + } + + for (size_t i = 0; i < sk_CRYPTO_EX_DATA_FUNCS_num(func_pointers); i++) { + CRYPTO_EX_DATA_FUNCS *func_pointer = + sk_CRYPTO_EX_DATA_FUNCS_value(func_pointers, i); + if (func_pointer->free_func) { + void *ptr = CRYPTO_get_ex_data(ad, i + ex_data_class->num_reserved); + func_pointer->free_func(obj, ptr, ad, i + ex_data_class->num_reserved, + func_pointer->argl, func_pointer->argp); + } + } + + sk_CRYPTO_EX_DATA_FUNCS_free(func_pointers); + + sk_void_free(ad->sk); + ad->sk = NULL; +} + +void CRYPTO_cleanup_all_ex_data(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c.grpc_back new file mode 100644 index 0000000..71d60a5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/ex_data.c.grpc_back @@ -0,0 +1,261 @@ +/* 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 +#include +#include +#include +#include + +#include "internal.h" + + +DEFINE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +struct crypto_ex_data_func_st { + long argl; // Arbitary long + void *argp; // Arbitary void pointer + CRYPTO_EX_free *free_func; +}; + +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_EX_DATA_FUNCS *funcs; + int ret = 0; + + funcs = OPENSSL_malloc(sizeof(CRYPTO_EX_DATA_FUNCS)); + if (funcs == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + + funcs->argl = argl; + funcs->argp = argp; + funcs->free_func = free_func; + + CRYPTO_STATIC_MUTEX_lock_write(&ex_data_class->lock); + + if (ex_data_class->meth == NULL) { + ex_data_class->meth = sk_CRYPTO_EX_DATA_FUNCS_new_null(); + } + + if (ex_data_class->meth == NULL || + !sk_CRYPTO_EX_DATA_FUNCS_push(ex_data_class->meth, funcs)) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + OPENSSL_free(funcs); + goto err; + } + + *out_index = sk_CRYPTO_EX_DATA_FUNCS_num(ex_data_class->meth) - 1 + + ex_data_class->num_reserved; + ret = 1; + +err: + CRYPTO_STATIC_MUTEX_unlock_write(&ex_data_class->lock); + return ret; +} + +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val) { + int n, i; + + if (ad->sk == NULL) { + ad->sk = sk_void_new_null(); + if (ad->sk == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + n = sk_void_num(ad->sk); + + // Add NULL values until the stack is long enough. + for (i = n; i <= index; i++) { + if (!sk_void_push(ad->sk, NULL)) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + sk_void_set(ad->sk, index, val); + return 1; +} + +void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) { + if (ad->sk == NULL || idx < 0 || (size_t)idx >= sk_void_num(ad->sk)) { + return NULL; + } + return sk_void_value(ad->sk, idx); +} + +// get_func_pointers takes a copy of the CRYPTO_EX_DATA_FUNCS pointers, if any, +// for the given class. If there are some pointers, it sets |*out| to point to +// a fresh stack of them. Otherwise it sets |*out| to NULL. It returns one on +// success or zero on error. +static int get_func_pointers(STACK_OF(CRYPTO_EX_DATA_FUNCS) **out, + CRYPTO_EX_DATA_CLASS *ex_data_class) { + size_t n; + + *out = NULL; + + // CRYPTO_EX_DATA_FUNCS structures are static once set, so we can take a + // shallow copy of the list under lock and then use the structures without + // the lock held. + CRYPTO_STATIC_MUTEX_lock_read(&ex_data_class->lock); + n = sk_CRYPTO_EX_DATA_FUNCS_num(ex_data_class->meth); + if (n > 0) { + *out = sk_CRYPTO_EX_DATA_FUNCS_dup(ex_data_class->meth); + } + CRYPTO_STATIC_MUTEX_unlock_read(&ex_data_class->lock); + + if (n > 0 && *out == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return 0; + } + + return 1; +} + +void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad) { + ad->sk = NULL; +} + +void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, void *obj, + CRYPTO_EX_DATA *ad) { + if (ad->sk == NULL) { + // Nothing to do. + return; + } + + STACK_OF(CRYPTO_EX_DATA_FUNCS) *func_pointers; + if (!get_func_pointers(&func_pointers, ex_data_class)) { + // TODO(davidben): This leaks memory on malloc error. + return; + } + + for (size_t i = 0; i < sk_CRYPTO_EX_DATA_FUNCS_num(func_pointers); i++) { + CRYPTO_EX_DATA_FUNCS *func_pointer = + sk_CRYPTO_EX_DATA_FUNCS_value(func_pointers, i); + if (func_pointer->free_func) { + void *ptr = CRYPTO_get_ex_data(ad, i + ex_data_class->num_reserved); + func_pointer->free_func(obj, ptr, ad, i + ex_data_class->num_reserved, + func_pointer->argl, func_pointer->argp); + } + } + + sk_CRYPTO_EX_DATA_FUNCS_free(func_pointers); + + sk_void_free(ad->sk); + ad->sk = NULL; +} + +void CRYPTO_cleanup_all_ex_data(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c new file mode 100644 index 0000000..ef61b94 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c.grpc_back new file mode 100644 index 0000000..f60281d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c new file mode 100644 index 0000000..18ffdc9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c.grpc_back new file mode 100644 index 0000000..ffbee89 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h new file mode 100644 index 0000000..2c20807 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h.grpc_back new file mode 100644 index 0000000..5b80695 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c new file mode 100644 index 0000000..a0947bc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c.grpc_back new file mode 100644 index 0000000..9a5b28d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c new file mode 100644 index 0000000..42497dc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c @@ -0,0 +1,106 @@ +/* ==================================================================== + * 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 "../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, AES_encrypt); +} + +void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, + const int enc) { + assert(in && out && key); + assert((AES_ENCRYPT == enc) || (AES_DECRYPT == enc)); + + if (AES_ENCRYPT == enc) { + AES_encrypt(in, out, key); + } else { + AES_decrypt(in, out, key); + } +} + +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, AES_encrypt); + } else { + CRYPTO_cbc128_decrypt(in, out, len, key, ivec, AES_decrypt); + } +} + +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, AES_encrypt); + *num = (int)num_u; +} + +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, AES_encrypt); + *num = (int)num_u; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back new file mode 100644 index 0000000..206fcfd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back @@ -0,0 +1,106 @@ +/* ==================================================================== + * 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 "../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, AES_encrypt); +} + +void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, + const int enc) { + assert(in && out && key); + assert((AES_ENCRYPT == enc) || (AES_DECRYPT == enc)); + + if (AES_ENCRYPT == enc) { + AES_encrypt(in, out, key); + } else { + AES_decrypt(in, out, key); + } +} + +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, AES_encrypt); + } else { + CRYPTO_cbc128_decrypt(in, out, len, key, ivec, AES_decrypt); + } +} + +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, AES_encrypt); + *num = (int)num_u; +} + +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, AES_encrypt); + *num = (int)num_u; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c new file mode 100644 index 0000000..8c19670 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c @@ -0,0 +1,316 @@ +/* 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" + + +int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + const BIGNUM *tmp; + int a_neg = a->neg, ret; + + // a + b a+b + // a + -b a-b + // -a + b b-a + // -a + -b -(a+b) + if (a_neg ^ b->neg) { + // only one is negative + if (a_neg) { + tmp = a; + a = b; + b = tmp; + } + + // we are now a - b + if (BN_ucmp(a, b) < 0) { + if (!BN_usub(r, b, a)) { + return 0; + } + r->neg = 1; + } else { + if (!BN_usub(r, a, b)) { + return 0; + } + r->neg = 0; + } + return 1; + } + + ret = BN_uadd(r, a, b); + r->neg = a_neg; + return ret; +} + +int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + // Widths are public, so we normalize to make |a| the larger one. + if (a->width < b->width) { + const BIGNUM *tmp = a; + a = b; + b = tmp; + } + + int max = a->width; + int min = b->width; + if (!bn_wexpand(r, max + 1)) { + return 0; + } + r->width = max + 1; + + BN_ULONG carry = bn_add_words(r->d, a->d, b->d, min); + for (int i = min; i < max; i++) { + // |r| and |a| may alias, so use a temporary. + BN_ULONG tmp = carry + a->d[i]; + carry = tmp < a->d[i]; + r->d[i] = tmp; + } + + r->d[max] = carry; + return 1; +} + +int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + if (!bn_uadd_consttime(r, a, b)) { + return 0; + } + bn_set_minimal_width(r); + return 1; +} + +int BN_add_word(BIGNUM *a, BN_ULONG w) { + BN_ULONG l; + int i; + + // degenerate case: w is zero + if (!w) { + return 1; + } + + // degenerate case: a is zero + if (BN_is_zero(a)) { + return BN_set_word(a, w); + } + + // handle 'a' when negative + if (a->neg) { + a->neg = 0; + i = BN_sub_word(a, w); + if (!BN_is_zero(a)) { + a->neg = !(a->neg); + } + return i; + } + + for (i = 0; w != 0 && i < a->width; i++) { + a->d[i] = l = a->d[i] + w; + w = (w > l) ? 1 : 0; + } + + if (w && i == a->width) { + if (!bn_wexpand(a, a->width + 1)) { + return 0; + } + a->width++; + a->d[i] = w; + } + + return 1; +} + +int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + int add = 0, neg = 0; + const BIGNUM *tmp; + + // a - b a-b + // a - -b a+b + // -a - b -(a+b) + // -a - -b b-a + if (a->neg) { + if (b->neg) { + tmp = a; + a = b; + b = tmp; + } else { + add = 1; + neg = 1; + } + } else { + if (b->neg) { + add = 1; + neg = 0; + } + } + + if (add) { + if (!BN_uadd(r, a, b)) { + return 0; + } + + r->neg = neg; + return 1; + } + + if (BN_ucmp(a, b) < 0) { + if (!BN_usub(r, b, a)) { + return 0; + } + r->neg = 1; + } else { + if (!BN_usub(r, a, b)) { + return 0; + } + r->neg = 0; + } + + return 1; +} + +int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + // |b| may have more words than |a| given non-minimal inputs, but all words + // beyond |a->width| must then be zero. + int b_width = b->width; + if (b_width > a->width) { + if (!bn_fits_in_words(b, a->width)) { + OPENSSL_PUT_ERROR(BN, BN_R_ARG2_LT_ARG3); + return 0; + } + b_width = a->width; + } + + if (!bn_wexpand(r, a->width)) { + return 0; + } + + BN_ULONG borrow = bn_sub_words(r->d, a->d, b->d, b_width); + for (int i = b_width; i < a->width; i++) { + // |r| and |a| may alias, so use a temporary. + BN_ULONG tmp = a->d[i]; + r->d[i] = a->d[i] - borrow; + borrow = tmp < r->d[i]; + } + + if (borrow) { + OPENSSL_PUT_ERROR(BN, BN_R_ARG2_LT_ARG3); + return 0; + } + + r->width = a->width; + r->neg = 0; + return 1; +} + +int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + if (!bn_usub_consttime(r, a, b)) { + return 0; + } + bn_set_minimal_width(r); + return 1; +} + +int BN_sub_word(BIGNUM *a, BN_ULONG w) { + int i; + + // degenerate case: w is zero + if (!w) { + return 1; + } + + // degenerate case: a is zero + if (BN_is_zero(a)) { + i = BN_set_word(a, w); + if (i != 0) { + BN_set_negative(a, 1); + } + return i; + } + + // handle 'a' when negative + if (a->neg) { + a->neg = 0; + i = BN_add_word(a, w); + a->neg = 1; + return i; + } + + if ((bn_minimal_width(a) == 1) && (a->d[0] < w)) { + a->d[0] = w - a->d[0]; + a->neg = 1; + return 1; + } + + i = 0; + for (;;) { + if (a->d[i] >= w) { + a->d[i] -= w; + break; + } else { + a->d[i] -= w; + i++; + w = 1; + } + } + + if ((a->d[i] == 0) && (i == (a->width - 1))) { + a->width--; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c.grpc_back new file mode 100644 index 0000000..38a8450 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c.grpc_back @@ -0,0 +1,316 @@ +/* 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" + + +int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + const BIGNUM *tmp; + int a_neg = a->neg, ret; + + // a + b a+b + // a + -b a-b + // -a + b b-a + // -a + -b -(a+b) + if (a_neg ^ b->neg) { + // only one is negative + if (a_neg) { + tmp = a; + a = b; + b = tmp; + } + + // we are now a - b + if (BN_ucmp(a, b) < 0) { + if (!BN_usub(r, b, a)) { + return 0; + } + r->neg = 1; + } else { + if (!BN_usub(r, a, b)) { + return 0; + } + r->neg = 0; + } + return 1; + } + + ret = BN_uadd(r, a, b); + r->neg = a_neg; + return ret; +} + +int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + // Widths are public, so we normalize to make |a| the larger one. + if (a->width < b->width) { + const BIGNUM *tmp = a; + a = b; + b = tmp; + } + + int max = a->width; + int min = b->width; + if (!bn_wexpand(r, max + 1)) { + return 0; + } + r->width = max + 1; + + BN_ULONG carry = bn_add_words(r->d, a->d, b->d, min); + for (int i = min; i < max; i++) { + // |r| and |a| may alias, so use a temporary. + BN_ULONG tmp = carry + a->d[i]; + carry = tmp < a->d[i]; + r->d[i] = tmp; + } + + r->d[max] = carry; + return 1; +} + +int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + if (!bn_uadd_consttime(r, a, b)) { + return 0; + } + bn_set_minimal_width(r); + return 1; +} + +int BN_add_word(BIGNUM *a, BN_ULONG w) { + BN_ULONG l; + int i; + + // degenerate case: w is zero + if (!w) { + return 1; + } + + // degenerate case: a is zero + if (BN_is_zero(a)) { + return BN_set_word(a, w); + } + + // handle 'a' when negative + if (a->neg) { + a->neg = 0; + i = BN_sub_word(a, w); + if (!BN_is_zero(a)) { + a->neg = !(a->neg); + } + return i; + } + + for (i = 0; w != 0 && i < a->width; i++) { + a->d[i] = l = a->d[i] + w; + w = (w > l) ? 1 : 0; + } + + if (w && i == a->width) { + if (!bn_wexpand(a, a->width + 1)) { + return 0; + } + a->width++; + a->d[i] = w; + } + + return 1; +} + +int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + int add = 0, neg = 0; + const BIGNUM *tmp; + + // a - b a-b + // a - -b a+b + // -a - b -(a+b) + // -a - -b b-a + if (a->neg) { + if (b->neg) { + tmp = a; + a = b; + b = tmp; + } else { + add = 1; + neg = 1; + } + } else { + if (b->neg) { + add = 1; + neg = 0; + } + } + + if (add) { + if (!BN_uadd(r, a, b)) { + return 0; + } + + r->neg = neg; + return 1; + } + + if (BN_ucmp(a, b) < 0) { + if (!BN_usub(r, b, a)) { + return 0; + } + r->neg = 1; + } else { + if (!BN_usub(r, a, b)) { + return 0; + } + r->neg = 0; + } + + return 1; +} + +int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + // |b| may have more words than |a| given non-minimal inputs, but all words + // beyond |a->width| must then be zero. + int b_width = b->width; + if (b_width > a->width) { + if (!bn_fits_in_words(b, a->width)) { + OPENSSL_PUT_ERROR(BN, BN_R_ARG2_LT_ARG3); + return 0; + } + b_width = a->width; + } + + if (!bn_wexpand(r, a->width)) { + return 0; + } + + BN_ULONG borrow = bn_sub_words(r->d, a->d, b->d, b_width); + for (int i = b_width; i < a->width; i++) { + // |r| and |a| may alias, so use a temporary. + BN_ULONG tmp = a->d[i]; + r->d[i] = a->d[i] - borrow; + borrow = tmp < r->d[i]; + } + + if (borrow) { + OPENSSL_PUT_ERROR(BN, BN_R_ARG2_LT_ARG3); + return 0; + } + + r->width = a->width; + r->neg = 0; + return 1; +} + +int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { + if (!bn_usub_consttime(r, a, b)) { + return 0; + } + bn_set_minimal_width(r); + return 1; +} + +int BN_sub_word(BIGNUM *a, BN_ULONG w) { + int i; + + // degenerate case: w is zero + if (!w) { + return 1; + } + + // degenerate case: a is zero + if (BN_is_zero(a)) { + i = BN_set_word(a, w); + if (i != 0) { + BN_set_negative(a, 1); + } + return i; + } + + // handle 'a' when negative + if (a->neg) { + a->neg = 0; + i = BN_add_word(a, w); + a->neg = 1; + return i; + } + + if ((bn_minimal_width(a) == 1) && (a->d[0] < w)) { + a->d[0] = w - a->d[0]; + a->neg = 1; + return 1; + } + + i = 0; + for (;;) { + if (a->d[i] >= w) { + a->d[i] -= w; + break; + } else { + a->d[i] -= w; + i++; + w = 1; + } + } + + if ((a->d[i] == 0) && (i == (a->width - 1))) { + a->width--; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c new file mode 100644 index 0000000..6034b61 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c @@ -0,0 +1,541 @@ +/* x86_64 BIGNUM accelerator version 0.1, December 2002. + * + * Implemented by Andy Polyakov for the OpenSSL + * project. + * + * Rights for redistribution and usage in source and binary forms are + * granted according to the OpenSSL license. Warranty of any kind is + * disclaimed. + * + * Q. Version 0.1? It doesn't sound like Andy, he used to assign real + * versions, like 1.0... + * A. Well, that's because this code is basically a quick-n-dirty + * proof-of-concept hack. As you can see it's implemented with + * inline assembler, which means that you're bound to GCC and that + * there might be enough room for further improvement. + * + * Q. Why inline assembler? + * A. x86_64 features own ABI which I'm not familiar with. This is + * why I decided to let the compiler take care of subroutine + * prologue/epilogue as well as register allocation. For reference. + * Win64 implements different ABI for AMD64, different from Linux. + * + * Q. How much faster does it get? + * A. 'apps/openssl speed rsa dsa' output with no-asm: + * + * sign verify sign/s verify/s + * rsa 512 bits 0.0006s 0.0001s 1683.8 18456.2 + * rsa 1024 bits 0.0028s 0.0002s 356.0 6407.0 + * rsa 2048 bits 0.0172s 0.0005s 58.0 1957.8 + * rsa 4096 bits 0.1155s 0.0018s 8.7 555.6 + * sign verify sign/s verify/s + * dsa 512 bits 0.0005s 0.0006s 2100.8 1768.3 + * dsa 1024 bits 0.0014s 0.0018s 692.3 559.2 + * dsa 2048 bits 0.0049s 0.0061s 204.7 165.0 + * + * 'apps/openssl speed rsa dsa' output with this module: + * + * sign verify sign/s verify/s + * rsa 512 bits 0.0004s 0.0000s 2767.1 33297.9 + * rsa 1024 bits 0.0012s 0.0001s 867.4 14674.7 + * rsa 2048 bits 0.0061s 0.0002s 164.0 5270.0 + * rsa 4096 bits 0.0384s 0.0006s 26.1 1650.8 + * sign verify sign/s verify/s + * dsa 512 bits 0.0002s 0.0003s 4442.2 3786.3 + * dsa 1024 bits 0.0005s 0.0007s 1835.1 1497.4 + * dsa 2048 bits 0.0016s 0.0020s 620.4 504.6 + * + * For the reference. IA-32 assembler implementation performs + * very much like 64-bit code compiled with no-asm on the same + * machine. + */ + +#include + +// TODO(davidben): Get this file working on MSVC x64. +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + (defined(__GNUC__) || defined(__clang__)) + +#include "../internal.h" + + +#undef mul +#undef mul_add + +// "m"(a), "+m"(r) is the way to favor DirectPath Β΅-code; +// "g"(0) let the compiler to decide where does it +// want to keep the value of zero; +#define mul_add(r, a, word, carry) \ + do { \ + register BN_ULONG high, low; \ + __asm__("mulq %3" : "=a"(low), "=d"(high) : "a"(word), "m"(a) : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+r"(carry), "+d"(high) \ + : "a"(low), "g"(0) \ + : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+m"(r), "+d"(high) \ + : "r"(carry), "g"(0) \ + : "cc"); \ + (carry) = high; \ + } while (0) + +#define mul(r, a, word, carry) \ + do { \ + register BN_ULONG high, low; \ + __asm__("mulq %3" : "=a"(low), "=d"(high) : "a"(word), "g"(a) : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+r"(carry), "+d"(high) \ + : "a"(low), "g"(0) \ + : "cc"); \ + (r) = (carry); \ + (carry) = high; \ + } while (0) +#undef sqr +#define sqr(r0, r1, a) __asm__("mulq %2" : "=a"(r0), "=d"(r1) : "a"(a) : "cc"); + +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return (c1); + } + + while (num & ~3) { + mul_add(rp[0], ap[0], w, c1); + mul_add(rp[1], ap[1], w, c1); + mul_add(rp[2], ap[2], w, c1); + mul_add(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + if (num) { + mul_add(rp[0], ap[0], w, c1); + if (--num == 0) { + return c1; + } + mul_add(rp[1], ap[1], w, c1); + if (--num == 0) { + return c1; + } + mul_add(rp[2], ap[2], w, c1); + return c1; + } + + return c1; +} + +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul(rp[0], ap[0], w, c1); + mul(rp[1], ap[1], w, c1); + mul(rp[2], ap[2], w, c1); + mul(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + if (num) { + mul(rp[0], ap[0], w, c1); + if (--num == 0) { + return c1; + } + mul(rp[1], ap[1], w, c1); + if (--num == 0) { + return c1; + } + mul(rp[2], ap[2], w, c1); + } + return c1; +} + +void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n) { + if (n == 0) { + return; + } + + while (n & ~3) { + sqr(r[0], r[1], a[0]); + sqr(r[2], r[3], a[1]); + sqr(r[4], r[5], a[2]); + sqr(r[6], r[7], a[3]); + a += 4; + r += 8; + n -= 4; + } + if (n) { + sqr(r[0], r[1], a[0]); + if (--n == 0) { + return; + } + sqr(r[2], r[3], a[1]); + if (--n == 0) { + return; + } + sqr(r[4], r[5], a[2]); + } +} + +BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t n) { + BN_ULONG ret; + size_t i = 0; + + if (n == 0) { + return 0; + } + + __asm__ volatile ( + " subq %0,%0 \n" // clear carry + " jmp 1f \n" + ".p2align 4 \n" + "1:" + " movq (%4,%2,8),%0 \n" + " adcq (%5,%2,8),%0 \n" + " movq %0,(%3,%2,8) \n" + " lea 1(%2),%2 \n" + " dec %1 \n" + " jnz 1b \n" + " sbbq %0,%0 \n" + : "=&r"(ret), "+c"(n), "+r"(i) + : "r"(rp), "r"(ap), "r"(bp) + : "cc", "memory"); + + return ret & 1; +} + +BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t n) { + BN_ULONG ret; + size_t i = 0; + + if (n == 0) { + return 0; + } + + __asm__ volatile ( + " subq %0,%0 \n" // clear borrow + " jmp 1f \n" + ".p2align 4 \n" + "1:" + " movq (%4,%2,8),%0 \n" + " sbbq (%5,%2,8),%0 \n" + " movq %0,(%3,%2,8) \n" + " lea 1(%2),%2 \n" + " dec %1 \n" + " jnz 1b \n" + " sbbq %0,%0 \n" + : "=&r"(ret), "+c"(n), "+r"(i) + : "r"(rp), "r"(ap), "r"(bp) + : "cc", "memory"); + + return ret & 1; +} + +// mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) +// mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) +// sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) +// sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) + +// Keep in mind that carrying into high part of multiplication result can not +// overflow, because it cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %3" : "=a"(t1), "=d"(t2) : "a"(a), "m"(b) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %2" : "=a"(t1), "=d"(t2) : "a"((a)[i]) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %3" : "=a"(t1), "=d"(t2) : "a"(a), "m"(b) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[4], b[0], c2, c3, c1); + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + mul_add_c(a[0], b[4], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[0], b[5], c3, c1, c2); + mul_add_c(a[1], b[4], c3, c1, c2); + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + mul_add_c(a[4], b[1], c3, c1, c2); + mul_add_c(a[5], b[0], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[6], b[0], c1, c2, c3); + mul_add_c(a[5], b[1], c1, c2, c3); + mul_add_c(a[4], b[2], c1, c2, c3); + mul_add_c(a[3], b[3], c1, c2, c3); + mul_add_c(a[2], b[4], c1, c2, c3); + mul_add_c(a[1], b[5], c1, c2, c3); + mul_add_c(a[0], b[6], c1, c2, c3); + r[6] = c1; + c1 = 0; + mul_add_c(a[0], b[7], c2, c3, c1); + mul_add_c(a[1], b[6], c2, c3, c1); + mul_add_c(a[2], b[5], c2, c3, c1); + mul_add_c(a[3], b[4], c2, c3, c1); + mul_add_c(a[4], b[3], c2, c3, c1); + mul_add_c(a[5], b[2], c2, c3, c1); + mul_add_c(a[6], b[1], c2, c3, c1); + mul_add_c(a[7], b[0], c2, c3, c1); + r[7] = c2; + c2 = 0; + mul_add_c(a[7], b[1], c3, c1, c2); + mul_add_c(a[6], b[2], c3, c1, c2); + mul_add_c(a[5], b[3], c3, c1, c2); + mul_add_c(a[4], b[4], c3, c1, c2); + mul_add_c(a[3], b[5], c3, c1, c2); + mul_add_c(a[2], b[6], c3, c1, c2); + mul_add_c(a[1], b[7], c3, c1, c2); + r[8] = c3; + c3 = 0; + mul_add_c(a[2], b[7], c1, c2, c3); + mul_add_c(a[3], b[6], c1, c2, c3); + mul_add_c(a[4], b[5], c1, c2, c3); + mul_add_c(a[5], b[4], c1, c2, c3); + mul_add_c(a[6], b[3], c1, c2, c3); + mul_add_c(a[7], b[2], c1, c2, c3); + r[9] = c1; + c1 = 0; + mul_add_c(a[7], b[3], c2, c3, c1); + mul_add_c(a[6], b[4], c2, c3, c1); + mul_add_c(a[5], b[5], c2, c3, c1); + mul_add_c(a[4], b[6], c2, c3, c1); + mul_add_c(a[3], b[7], c2, c3, c1); + r[10] = c2; + c2 = 0; + mul_add_c(a[4], b[7], c3, c1, c2); + mul_add_c(a[5], b[6], c3, c1, c2); + mul_add_c(a[6], b[5], c3, c1, c2); + mul_add_c(a[7], b[4], c3, c1, c2); + r[11] = c3; + c3 = 0; + mul_add_c(a[7], b[5], c1, c2, c3); + mul_add_c(a[6], b[6], c1, c2, c3); + mul_add_c(a[5], b[7], c1, c2, c3); + r[12] = c1; + c1 = 0; + mul_add_c(a[6], b[7], c2, c3, c1); + mul_add_c(a[7], b[6], c2, c3, c1); + r[13] = c2; + c2 = 0; + mul_add_c(a[7], b[7], c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[3], b[3], c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + sqr_add_c2(a, 4, 0, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 5, 0, c3, c1, c2); + sqr_add_c2(a, 4, 1, c3, c1, c2); + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + sqr_add_c2(a, 4, 2, c1, c2, c3); + sqr_add_c2(a, 5, 1, c1, c2, c3); + sqr_add_c2(a, 6, 0, c1, c2, c3); + r[6] = c1; + c1 = 0; + sqr_add_c2(a, 7, 0, c2, c3, c1); + sqr_add_c2(a, 6, 1, c2, c3, c1); + sqr_add_c2(a, 5, 2, c2, c3, c1); + sqr_add_c2(a, 4, 3, c2, c3, c1); + r[7] = c2; + c2 = 0; + sqr_add_c(a, 4, c3, c1, c2); + sqr_add_c2(a, 5, 3, c3, c1, c2); + sqr_add_c2(a, 6, 2, c3, c1, c2); + sqr_add_c2(a, 7, 1, c3, c1, c2); + r[8] = c3; + c3 = 0; + sqr_add_c2(a, 7, 2, c1, c2, c3); + sqr_add_c2(a, 6, 3, c1, c2, c3); + sqr_add_c2(a, 5, 4, c1, c2, c3); + r[9] = c1; + c1 = 0; + sqr_add_c(a, 5, c2, c3, c1); + sqr_add_c2(a, 6, 4, c2, c3, c1); + sqr_add_c2(a, 7, 3, c2, c3, c1); + r[10] = c2; + c2 = 0; + sqr_add_c2(a, 7, 4, c3, c1, c2); + sqr_add_c2(a, 6, 5, c3, c1, c2); + r[11] = c3; + c3 = 0; + sqr_add_c(a, 6, c1, c2, c3); + sqr_add_c2(a, 7, 5, c1, c2, c3); + r[12] = c1; + c1 = 0; + sqr_add_c2(a, 7, 6, c2, c3, c1); + r[13] = c2; + c2 = 0; + sqr_add_c(a, 7, c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +#undef mul_add +#undef mul +#undef sqr +#undef mul_add_c +#undef sqr_add_c +#undef mul_add_c2 +#undef sqr_add_c2 + +#endif // !NO_ASM && X86_64 && (__GNUC__ || __clang__) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back new file mode 100644 index 0000000..30fff21 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back @@ -0,0 +1,541 @@ +/* x86_64 BIGNUM accelerator version 0.1, December 2002. + * + * Implemented by Andy Polyakov for the OpenSSL + * project. + * + * Rights for redistribution and usage in source and binary forms are + * granted according to the OpenSSL license. Warranty of any kind is + * disclaimed. + * + * Q. Version 0.1? It doesn't sound like Andy, he used to assign real + * versions, like 1.0... + * A. Well, that's because this code is basically a quick-n-dirty + * proof-of-concept hack. As you can see it's implemented with + * inline assembler, which means that you're bound to GCC and that + * there might be enough room for further improvement. + * + * Q. Why inline assembler? + * A. x86_64 features own ABI which I'm not familiar with. This is + * why I decided to let the compiler take care of subroutine + * prologue/epilogue as well as register allocation. For reference. + * Win64 implements different ABI for AMD64, different from Linux. + * + * Q. How much faster does it get? + * A. 'apps/openssl speed rsa dsa' output with no-asm: + * + * sign verify sign/s verify/s + * rsa 512 bits 0.0006s 0.0001s 1683.8 18456.2 + * rsa 1024 bits 0.0028s 0.0002s 356.0 6407.0 + * rsa 2048 bits 0.0172s 0.0005s 58.0 1957.8 + * rsa 4096 bits 0.1155s 0.0018s 8.7 555.6 + * sign verify sign/s verify/s + * dsa 512 bits 0.0005s 0.0006s 2100.8 1768.3 + * dsa 1024 bits 0.0014s 0.0018s 692.3 559.2 + * dsa 2048 bits 0.0049s 0.0061s 204.7 165.0 + * + * 'apps/openssl speed rsa dsa' output with this module: + * + * sign verify sign/s verify/s + * rsa 512 bits 0.0004s 0.0000s 2767.1 33297.9 + * rsa 1024 bits 0.0012s 0.0001s 867.4 14674.7 + * rsa 2048 bits 0.0061s 0.0002s 164.0 5270.0 + * rsa 4096 bits 0.0384s 0.0006s 26.1 1650.8 + * sign verify sign/s verify/s + * dsa 512 bits 0.0002s 0.0003s 4442.2 3786.3 + * dsa 1024 bits 0.0005s 0.0007s 1835.1 1497.4 + * dsa 2048 bits 0.0016s 0.0020s 620.4 504.6 + * + * For the reference. IA-32 assembler implementation performs + * very much like 64-bit code compiled with no-asm on the same + * machine. + */ + +#include + +// TODO(davidben): Get this file working on MSVC x64. +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + (defined(__GNUC__) || defined(__clang__)) + +#include "../internal.h" + + +#undef mul +#undef mul_add + +// "m"(a), "+m"(r) is the way to favor DirectPath Β΅-code; +// "g"(0) let the compiler to decide where does it +// want to keep the value of zero; +#define mul_add(r, a, word, carry) \ + do { \ + register BN_ULONG high, low; \ + __asm__("mulq %3" : "=a"(low), "=d"(high) : "a"(word), "m"(a) : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+r"(carry), "+d"(high) \ + : "a"(low), "g"(0) \ + : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+m"(r), "+d"(high) \ + : "r"(carry), "g"(0) \ + : "cc"); \ + (carry) = high; \ + } while (0) + +#define mul(r, a, word, carry) \ + do { \ + register BN_ULONG high, low; \ + __asm__("mulq %3" : "=a"(low), "=d"(high) : "a"(word), "g"(a) : "cc"); \ + __asm__("addq %2,%0; adcq %3,%1" \ + : "+r"(carry), "+d"(high) \ + : "a"(low), "g"(0) \ + : "cc"); \ + (r) = (carry); \ + (carry) = high; \ + } while (0) +#undef sqr +#define sqr(r0, r1, a) __asm__("mulq %2" : "=a"(r0), "=d"(r1) : "a"(a) : "cc"); + +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return (c1); + } + + while (num & ~3) { + mul_add(rp[0], ap[0], w, c1); + mul_add(rp[1], ap[1], w, c1); + mul_add(rp[2], ap[2], w, c1); + mul_add(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + if (num) { + mul_add(rp[0], ap[0], w, c1); + if (--num == 0) { + return c1; + } + mul_add(rp[1], ap[1], w, c1); + if (--num == 0) { + return c1; + } + mul_add(rp[2], ap[2], w, c1); + return c1; + } + + return c1; +} + +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul(rp[0], ap[0], w, c1); + mul(rp[1], ap[1], w, c1); + mul(rp[2], ap[2], w, c1); + mul(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + if (num) { + mul(rp[0], ap[0], w, c1); + if (--num == 0) { + return c1; + } + mul(rp[1], ap[1], w, c1); + if (--num == 0) { + return c1; + } + mul(rp[2], ap[2], w, c1); + } + return c1; +} + +void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n) { + if (n == 0) { + return; + } + + while (n & ~3) { + sqr(r[0], r[1], a[0]); + sqr(r[2], r[3], a[1]); + sqr(r[4], r[5], a[2]); + sqr(r[6], r[7], a[3]); + a += 4; + r += 8; + n -= 4; + } + if (n) { + sqr(r[0], r[1], a[0]); + if (--n == 0) { + return; + } + sqr(r[2], r[3], a[1]); + if (--n == 0) { + return; + } + sqr(r[4], r[5], a[2]); + } +} + +BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t n) { + BN_ULONG ret; + size_t i = 0; + + if (n == 0) { + return 0; + } + + __asm__ volatile ( + " subq %0,%0 \n" // clear carry + " jmp 1f \n" + ".p2align 4 \n" + "1:" + " movq (%4,%2,8),%0 \n" + " adcq (%5,%2,8),%0 \n" + " movq %0,(%3,%2,8) \n" + " lea 1(%2),%2 \n" + " dec %1 \n" + " jnz 1b \n" + " sbbq %0,%0 \n" + : "=&r"(ret), "+c"(n), "+r"(i) + : "r"(rp), "r"(ap), "r"(bp) + : "cc", "memory"); + + return ret & 1; +} + +BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t n) { + BN_ULONG ret; + size_t i = 0; + + if (n == 0) { + return 0; + } + + __asm__ volatile ( + " subq %0,%0 \n" // clear borrow + " jmp 1f \n" + ".p2align 4 \n" + "1:" + " movq (%4,%2,8),%0 \n" + " sbbq (%5,%2,8),%0 \n" + " movq %0,(%3,%2,8) \n" + " lea 1(%2),%2 \n" + " dec %1 \n" + " jnz 1b \n" + " sbbq %0,%0 \n" + : "=&r"(ret), "+c"(n), "+r"(i) + : "r"(rp), "r"(ap), "r"(bp) + : "cc", "memory"); + + return ret & 1; +} + +// mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) +// mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) +// sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) +// sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) + +// Keep in mind that carrying into high part of multiplication result can not +// overflow, because it cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %3" : "=a"(t1), "=d"(t2) : "a"(a), "m"(b) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %2" : "=a"(t1), "=d"(t2) : "a"((a)[i]) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG t1, t2; \ + __asm__("mulq %3" : "=a"(t1), "=d"(t2) : "a"(a), "m"(b) : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + __asm__("addq %3,%0; adcq %4,%1; adcq %5,%2" \ + : "+r"(c0), "+r"(c1), "+r"(c2) \ + : "r"(t1), "r"(t2), "g"(0) \ + : "cc"); \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[4], b[0], c2, c3, c1); + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + mul_add_c(a[0], b[4], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[0], b[5], c3, c1, c2); + mul_add_c(a[1], b[4], c3, c1, c2); + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + mul_add_c(a[4], b[1], c3, c1, c2); + mul_add_c(a[5], b[0], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[6], b[0], c1, c2, c3); + mul_add_c(a[5], b[1], c1, c2, c3); + mul_add_c(a[4], b[2], c1, c2, c3); + mul_add_c(a[3], b[3], c1, c2, c3); + mul_add_c(a[2], b[4], c1, c2, c3); + mul_add_c(a[1], b[5], c1, c2, c3); + mul_add_c(a[0], b[6], c1, c2, c3); + r[6] = c1; + c1 = 0; + mul_add_c(a[0], b[7], c2, c3, c1); + mul_add_c(a[1], b[6], c2, c3, c1); + mul_add_c(a[2], b[5], c2, c3, c1); + mul_add_c(a[3], b[4], c2, c3, c1); + mul_add_c(a[4], b[3], c2, c3, c1); + mul_add_c(a[5], b[2], c2, c3, c1); + mul_add_c(a[6], b[1], c2, c3, c1); + mul_add_c(a[7], b[0], c2, c3, c1); + r[7] = c2; + c2 = 0; + mul_add_c(a[7], b[1], c3, c1, c2); + mul_add_c(a[6], b[2], c3, c1, c2); + mul_add_c(a[5], b[3], c3, c1, c2); + mul_add_c(a[4], b[4], c3, c1, c2); + mul_add_c(a[3], b[5], c3, c1, c2); + mul_add_c(a[2], b[6], c3, c1, c2); + mul_add_c(a[1], b[7], c3, c1, c2); + r[8] = c3; + c3 = 0; + mul_add_c(a[2], b[7], c1, c2, c3); + mul_add_c(a[3], b[6], c1, c2, c3); + mul_add_c(a[4], b[5], c1, c2, c3); + mul_add_c(a[5], b[4], c1, c2, c3); + mul_add_c(a[6], b[3], c1, c2, c3); + mul_add_c(a[7], b[2], c1, c2, c3); + r[9] = c1; + c1 = 0; + mul_add_c(a[7], b[3], c2, c3, c1); + mul_add_c(a[6], b[4], c2, c3, c1); + mul_add_c(a[5], b[5], c2, c3, c1); + mul_add_c(a[4], b[6], c2, c3, c1); + mul_add_c(a[3], b[7], c2, c3, c1); + r[10] = c2; + c2 = 0; + mul_add_c(a[4], b[7], c3, c1, c2); + mul_add_c(a[5], b[6], c3, c1, c2); + mul_add_c(a[6], b[5], c3, c1, c2); + mul_add_c(a[7], b[4], c3, c1, c2); + r[11] = c3; + c3 = 0; + mul_add_c(a[7], b[5], c1, c2, c3); + mul_add_c(a[6], b[6], c1, c2, c3); + mul_add_c(a[5], b[7], c1, c2, c3); + r[12] = c1; + c1 = 0; + mul_add_c(a[6], b[7], c2, c3, c1); + mul_add_c(a[7], b[6], c2, c3, c1); + r[13] = c2; + c2 = 0; + mul_add_c(a[7], b[7], c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[3], b[3], c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + sqr_add_c2(a, 4, 0, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 5, 0, c3, c1, c2); + sqr_add_c2(a, 4, 1, c3, c1, c2); + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + sqr_add_c2(a, 4, 2, c1, c2, c3); + sqr_add_c2(a, 5, 1, c1, c2, c3); + sqr_add_c2(a, 6, 0, c1, c2, c3); + r[6] = c1; + c1 = 0; + sqr_add_c2(a, 7, 0, c2, c3, c1); + sqr_add_c2(a, 6, 1, c2, c3, c1); + sqr_add_c2(a, 5, 2, c2, c3, c1); + sqr_add_c2(a, 4, 3, c2, c3, c1); + r[7] = c2; + c2 = 0; + sqr_add_c(a, 4, c3, c1, c2); + sqr_add_c2(a, 5, 3, c3, c1, c2); + sqr_add_c2(a, 6, 2, c3, c1, c2); + sqr_add_c2(a, 7, 1, c3, c1, c2); + r[8] = c3; + c3 = 0; + sqr_add_c2(a, 7, 2, c1, c2, c3); + sqr_add_c2(a, 6, 3, c1, c2, c3); + sqr_add_c2(a, 5, 4, c1, c2, c3); + r[9] = c1; + c1 = 0; + sqr_add_c(a, 5, c2, c3, c1); + sqr_add_c2(a, 6, 4, c2, c3, c1); + sqr_add_c2(a, 7, 3, c2, c3, c1); + r[10] = c2; + c2 = 0; + sqr_add_c2(a, 7, 4, c3, c1, c2); + sqr_add_c2(a, 6, 5, c3, c1, c2); + r[11] = c3; + c3 = 0; + sqr_add_c(a, 6, c1, c2, c3); + sqr_add_c2(a, 7, 5, c1, c2, c3); + r[12] = c1; + c1 = 0; + sqr_add_c2(a, 7, 6, c2, c3, c1); + r[13] = c2; + c2 = 0; + sqr_add_c(a, 7, c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +#undef mul_add +#undef mul +#undef sqr +#undef mul_add_c +#undef sqr_add_c +#undef mul_add_c2 +#undef sqr_add_c2 + +#endif // !NO_ASM && X86_64 && (__GNUC__ || __clang__) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c new file mode 100644 index 0000000..ce87862 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c @@ -0,0 +1,445 @@ +/* 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 "internal.h" +#include "../delocate.h" + + +BIGNUM *BN_new(void) { + BIGNUM *bn = OPENSSL_malloc(sizeof(BIGNUM)); + + if (bn == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(bn, 0, sizeof(BIGNUM)); + bn->flags = BN_FLG_MALLOCED; + + return bn; +} + +void BN_init(BIGNUM *bn) { + OPENSSL_memset(bn, 0, sizeof(BIGNUM)); +} + +void BN_free(BIGNUM *bn) { + if (bn == NULL) { + return; + } + + if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { + OPENSSL_free(bn->d); + } + + if (bn->flags & BN_FLG_MALLOCED) { + OPENSSL_free(bn); + } else { + bn->d = NULL; + } +} + +void BN_clear_free(BIGNUM *bn) { + char should_free; + + if (bn == NULL) { + return; + } + + if (bn->d != NULL) { + if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { + OPENSSL_free(bn->d); + } else { + OPENSSL_cleanse(bn->d, bn->dmax * sizeof(bn->d[0])); + } + } + + should_free = (bn->flags & BN_FLG_MALLOCED) != 0; + if (should_free) { + OPENSSL_free(bn); + } else { + OPENSSL_cleanse(bn, sizeof(BIGNUM)); + } +} + +BIGNUM *BN_dup(const BIGNUM *src) { + BIGNUM *copy; + + if (src == NULL) { + return NULL; + } + + copy = BN_new(); + if (copy == NULL) { + return NULL; + } + + if (!BN_copy(copy, src)) { + BN_free(copy); + return NULL; + } + + return copy; +} + +BIGNUM *BN_copy(BIGNUM *dest, const BIGNUM *src) { + if (src == dest) { + return dest; + } + + if (!bn_wexpand(dest, src->width)) { + return NULL; + } + + OPENSSL_memcpy(dest->d, src->d, sizeof(src->d[0]) * src->width); + + dest->width = src->width; + dest->neg = src->neg; + return dest; +} + +void BN_clear(BIGNUM *bn) { + if (bn->d != NULL) { + OPENSSL_memset(bn->d, 0, bn->dmax * sizeof(bn->d[0])); + } + + bn->width = 0; + bn->neg = 0; +} + +DEFINE_METHOD_FUNCTION(BIGNUM, BN_value_one) { + static const BN_ULONG kOneLimbs[1] = { 1 }; + out->d = (BN_ULONG*) kOneLimbs; + out->width = 1; + out->dmax = 1; + out->neg = 0; + out->flags = BN_FLG_STATIC_DATA; +} + +// BN_num_bits_word returns the minimum number of bits needed to represent the +// value in |l|. +unsigned BN_num_bits_word(BN_ULONG l) { + // |BN_num_bits| is often called on RSA prime factors. These have public bit + // lengths, but all bits beyond the high bit are secret, so count bits in + // constant time. + BN_ULONG x, mask; + int bits = (l != 0); + +#if BN_BITS2 > 32 + // Look at the upper half of |x|. |x| is at most 64 bits long. + x = l >> 32; + // Set |mask| to all ones if |x| (the top 32 bits of |l|) is non-zero and all + // all zeros otherwise. + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + // If |x| is non-zero, the lower half is included in the bit count in full, + // and we count the upper half. Otherwise, we count the lower half. + bits += 32 & mask; + l ^= (x ^ l) & mask; // |l| is |x| if |mask| and remains |l| otherwise. +#endif + + // The remaining blocks are analogous iterations at lower powers of two. + x = l >> 16; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 16 & mask; + l ^= (x ^ l) & mask; + + x = l >> 8; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 8 & mask; + l ^= (x ^ l) & mask; + + x = l >> 4; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 4 & mask; + l ^= (x ^ l) & mask; + + x = l >> 2; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 2 & mask; + l ^= (x ^ l) & mask; + + x = l >> 1; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 1 & mask; + + return bits; +} + +unsigned BN_num_bits(const BIGNUM *bn) { + const int width = bn_minimal_width(bn); + if (width == 0) { + return 0; + } + + return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]); +} + +unsigned BN_num_bytes(const BIGNUM *bn) { + return (BN_num_bits(bn) + 7) / 8; +} + +void BN_zero(BIGNUM *bn) { + bn->width = bn->neg = 0; +} + +int BN_one(BIGNUM *bn) { + return BN_set_word(bn, 1); +} + +int BN_set_word(BIGNUM *bn, BN_ULONG value) { + if (value == 0) { + BN_zero(bn); + return 1; + } + + if (!bn_wexpand(bn, 1)) { + return 0; + } + + bn->neg = 0; + bn->d[0] = value; + bn->width = 1; + return 1; +} + +int BN_set_u64(BIGNUM *bn, uint64_t value) { +#if BN_BITS2 == 64 + return BN_set_word(bn, value); +#elif BN_BITS2 == 32 + if (value <= BN_MASK2) { + return BN_set_word(bn, (BN_ULONG)value); + } + + if (!bn_wexpand(bn, 2)) { + return 0; + } + + bn->neg = 0; + bn->d[0] = (BN_ULONG)value; + bn->d[1] = (BN_ULONG)(value >> 32); + bn->width = 2; + return 1; +#else +#error "BN_BITS2 must be 32 or 64." +#endif +} + +int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num) { + if (!bn_wexpand(bn, num)) { + return 0; + } + OPENSSL_memmove(bn->d, words, num * sizeof(BN_ULONG)); + // |bn_wexpand| verified that |num| isn't too large. + bn->width = (int)num; + bn->neg = 0; + return 1; +} + +int bn_fits_in_words(const BIGNUM *bn, size_t num) { + // All words beyond |num| must be zero. + BN_ULONG mask = 0; + for (size_t i = num; i < (size_t)bn->width; i++) { + mask |= bn->d[i]; + } + return mask == 0; +} + +int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn) { + if (bn->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + size_t width = (size_t)bn->width; + if (width > num) { + if (!bn_fits_in_words(bn, num)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + width = num; + } + + OPENSSL_memset(out, 0, sizeof(BN_ULONG) * num); + OPENSSL_memcpy(out, bn->d, sizeof(BN_ULONG) * width); + return 1; +} + +int BN_is_negative(const BIGNUM *bn) { + return bn->neg != 0; +} + +void BN_set_negative(BIGNUM *bn, int sign) { + if (sign && !BN_is_zero(bn)) { + bn->neg = 1; + } else { + bn->neg = 0; + } +} + +int bn_wexpand(BIGNUM *bn, size_t words) { + BN_ULONG *a; + + if (words <= (size_t)bn->dmax) { + return 1; + } + + if (words > (INT_MAX / (4 * BN_BITS2))) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + + if (bn->flags & BN_FLG_STATIC_DATA) { + OPENSSL_PUT_ERROR(BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); + return 0; + } + + a = OPENSSL_malloc(sizeof(BN_ULONG) * words); + if (a == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(a, bn->d, sizeof(BN_ULONG) * bn->width); + + OPENSSL_free(bn->d); + bn->d = a; + bn->dmax = (int)words; + + return 1; +} + +int bn_expand(BIGNUM *bn, size_t bits) { + if (bits + BN_BITS2 - 1 < bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + return bn_wexpand(bn, (bits+BN_BITS2-1)/BN_BITS2); +} + +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; + } + OPENSSL_memset(bn->d + bn->width, 0, + (words - bn->width) * sizeof(BN_ULONG)); + bn->width = words; + return 1; + } + + // All words beyond the new width must be zero. + if (!bn_fits_in_words(bn, words)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + bn->width = words; + return 1; +} + +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_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]); + } +} + +int bn_minimal_width(const BIGNUM *bn) { + int ret = bn->width; + while (ret > 0 && bn->d[ret - 1] == 0) { + ret--; + } + return ret; +} + +void bn_set_minimal_width(BIGNUM *bn) { + bn->width = bn_minimal_width(bn); + if (bn->width == 0) { + bn->neg = 0; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back new file mode 100644 index 0000000..e3f1c90 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back @@ -0,0 +1,445 @@ +/* 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 "internal.h" +#include "../delocate.h" + + +BIGNUM *BN_new(void) { + BIGNUM *bn = OPENSSL_malloc(sizeof(BIGNUM)); + + if (bn == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(bn, 0, sizeof(BIGNUM)); + bn->flags = BN_FLG_MALLOCED; + + return bn; +} + +void BN_init(BIGNUM *bn) { + OPENSSL_memset(bn, 0, sizeof(BIGNUM)); +} + +void BN_free(BIGNUM *bn) { + if (bn == NULL) { + return; + } + + if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { + OPENSSL_free(bn->d); + } + + if (bn->flags & BN_FLG_MALLOCED) { + OPENSSL_free(bn); + } else { + bn->d = NULL; + } +} + +void BN_clear_free(BIGNUM *bn) { + char should_free; + + if (bn == NULL) { + return; + } + + if (bn->d != NULL) { + if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { + OPENSSL_free(bn->d); + } else { + OPENSSL_cleanse(bn->d, bn->dmax * sizeof(bn->d[0])); + } + } + + should_free = (bn->flags & BN_FLG_MALLOCED) != 0; + if (should_free) { + OPENSSL_free(bn); + } else { + OPENSSL_cleanse(bn, sizeof(BIGNUM)); + } +} + +BIGNUM *BN_dup(const BIGNUM *src) { + BIGNUM *copy; + + if (src == NULL) { + return NULL; + } + + copy = BN_new(); + if (copy == NULL) { + return NULL; + } + + if (!BN_copy(copy, src)) { + BN_free(copy); + return NULL; + } + + return copy; +} + +BIGNUM *BN_copy(BIGNUM *dest, const BIGNUM *src) { + if (src == dest) { + return dest; + } + + if (!bn_wexpand(dest, src->width)) { + return NULL; + } + + OPENSSL_memcpy(dest->d, src->d, sizeof(src->d[0]) * src->width); + + dest->width = src->width; + dest->neg = src->neg; + return dest; +} + +void BN_clear(BIGNUM *bn) { + if (bn->d != NULL) { + OPENSSL_memset(bn->d, 0, bn->dmax * sizeof(bn->d[0])); + } + + bn->width = 0; + bn->neg = 0; +} + +DEFINE_METHOD_FUNCTION(BIGNUM, BN_value_one) { + static const BN_ULONG kOneLimbs[1] = { 1 }; + out->d = (BN_ULONG*) kOneLimbs; + out->width = 1; + out->dmax = 1; + out->neg = 0; + out->flags = BN_FLG_STATIC_DATA; +} + +// BN_num_bits_word returns the minimum number of bits needed to represent the +// value in |l|. +unsigned BN_num_bits_word(BN_ULONG l) { + // |BN_num_bits| is often called on RSA prime factors. These have public bit + // lengths, but all bits beyond the high bit are secret, so count bits in + // constant time. + BN_ULONG x, mask; + int bits = (l != 0); + +#if BN_BITS2 > 32 + // Look at the upper half of |x|. |x| is at most 64 bits long. + x = l >> 32; + // Set |mask| to all ones if |x| (the top 32 bits of |l|) is non-zero and all + // all zeros otherwise. + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + // If |x| is non-zero, the lower half is included in the bit count in full, + // and we count the upper half. Otherwise, we count the lower half. + bits += 32 & mask; + l ^= (x ^ l) & mask; // |l| is |x| if |mask| and remains |l| otherwise. +#endif + + // The remaining blocks are analogous iterations at lower powers of two. + x = l >> 16; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 16 & mask; + l ^= (x ^ l) & mask; + + x = l >> 8; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 8 & mask; + l ^= (x ^ l) & mask; + + x = l >> 4; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 4 & mask; + l ^= (x ^ l) & mask; + + x = l >> 2; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 2 & mask; + l ^= (x ^ l) & mask; + + x = l >> 1; + mask = 0u - x; + mask = (0u - (mask >> (BN_BITS2 - 1))); + bits += 1 & mask; + + return bits; +} + +unsigned BN_num_bits(const BIGNUM *bn) { + const int width = bn_minimal_width(bn); + if (width == 0) { + return 0; + } + + return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]); +} + +unsigned BN_num_bytes(const BIGNUM *bn) { + return (BN_num_bits(bn) + 7) / 8; +} + +void BN_zero(BIGNUM *bn) { + bn->width = bn->neg = 0; +} + +int BN_one(BIGNUM *bn) { + return BN_set_word(bn, 1); +} + +int BN_set_word(BIGNUM *bn, BN_ULONG value) { + if (value == 0) { + BN_zero(bn); + return 1; + } + + if (!bn_wexpand(bn, 1)) { + return 0; + } + + bn->neg = 0; + bn->d[0] = value; + bn->width = 1; + return 1; +} + +int BN_set_u64(BIGNUM *bn, uint64_t value) { +#if BN_BITS2 == 64 + return BN_set_word(bn, value); +#elif BN_BITS2 == 32 + if (value <= BN_MASK2) { + return BN_set_word(bn, (BN_ULONG)value); + } + + if (!bn_wexpand(bn, 2)) { + return 0; + } + + bn->neg = 0; + bn->d[0] = (BN_ULONG)value; + bn->d[1] = (BN_ULONG)(value >> 32); + bn->width = 2; + return 1; +#else +#error "BN_BITS2 must be 32 or 64." +#endif +} + +int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num) { + if (!bn_wexpand(bn, num)) { + return 0; + } + OPENSSL_memmove(bn->d, words, num * sizeof(BN_ULONG)); + // |bn_wexpand| verified that |num| isn't too large. + bn->width = (int)num; + bn->neg = 0; + return 1; +} + +int bn_fits_in_words(const BIGNUM *bn, size_t num) { + // All words beyond |num| must be zero. + BN_ULONG mask = 0; + for (size_t i = num; i < (size_t)bn->width; i++) { + mask |= bn->d[i]; + } + return mask == 0; +} + +int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn) { + if (bn->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + size_t width = (size_t)bn->width; + if (width > num) { + if (!bn_fits_in_words(bn, num)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + width = num; + } + + OPENSSL_memset(out, 0, sizeof(BN_ULONG) * num); + OPENSSL_memcpy(out, bn->d, sizeof(BN_ULONG) * width); + return 1; +} + +int BN_is_negative(const BIGNUM *bn) { + return bn->neg != 0; +} + +void BN_set_negative(BIGNUM *bn, int sign) { + if (sign && !BN_is_zero(bn)) { + bn->neg = 1; + } else { + bn->neg = 0; + } +} + +int bn_wexpand(BIGNUM *bn, size_t words) { + BN_ULONG *a; + + if (words <= (size_t)bn->dmax) { + return 1; + } + + if (words > (INT_MAX / (4 * BN_BITS2))) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + + if (bn->flags & BN_FLG_STATIC_DATA) { + OPENSSL_PUT_ERROR(BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); + return 0; + } + + a = OPENSSL_malloc(sizeof(BN_ULONG) * words); + if (a == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(a, bn->d, sizeof(BN_ULONG) * bn->width); + + OPENSSL_free(bn->d); + bn->d = a; + bn->dmax = (int)words; + + return 1; +} + +int bn_expand(BIGNUM *bn, size_t bits) { + if (bits + BN_BITS2 - 1 < bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + return bn_wexpand(bn, (bits+BN_BITS2-1)/BN_BITS2); +} + +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; + } + OPENSSL_memset(bn->d + bn->width, 0, + (words - bn->width) * sizeof(BN_ULONG)); + bn->width = words; + return 1; + } + + // All words beyond the new width must be zero. + if (!bn_fits_in_words(bn, words)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + bn->width = words; + return 1; +} + +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_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]); + } +} + +int bn_minimal_width(const BIGNUM *bn) { + int ret = bn->width; + while (ret > 0 && bn->d[ret - 1] == 0) { + ret--; + } + return ret; +} + +void bn_set_minimal_width(BIGNUM *bn) { + bn->width = bn_minimal_width(bn); + if (bn->width == 0) { + bn->neg = 0; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c new file mode 100644 index 0000000..a2fde19 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c @@ -0,0 +1,230 @@ +/* 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" + + +BIGNUM *BN_bin2bn(const uint8_t *in, size_t len, BIGNUM *ret) { + size_t num_words; + unsigned m; + BN_ULONG word = 0; + BIGNUM *bn = NULL; + + if (ret == NULL) { + ret = bn = BN_new(); + } + + if (ret == NULL) { + return NULL; + } + + if (len == 0) { + ret->width = 0; + return ret; + } + + num_words = ((len - 1) / BN_BYTES) + 1; + m = (len - 1) % BN_BYTES; + if (!bn_wexpand(ret, num_words)) { + if (bn) { + BN_free(bn); + } + return NULL; + } + + // |bn_wexpand| must check bounds on |num_words| to write it into + // |ret->dmax|. + assert(num_words <= INT_MAX); + ret->width = (int)num_words; + ret->neg = 0; + + while (len--) { + word = (word << 8) | *(in++); + if (m-- == 0) { + ret->d[--num_words] = word; + word = 0; + m = BN_BYTES - 1; + } + } + + return ret; +} + +BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) { + BIGNUM *bn = NULL; + if (ret == NULL) { + bn = BN_new(); + ret = bn; + } + + if (ret == NULL) { + return NULL; + } + + if (len == 0) { + ret->width = 0; + ret->neg = 0; + return ret; + } + + // Reserve enough space in |ret|. + size_t num_words = ((len - 1) / BN_BYTES) + 1; + if (!bn_wexpand(ret, num_words)) { + BN_free(bn); + return NULL; + } + ret->width = num_words; + + // Make sure the top bytes will be zeroed. + ret->d[num_words - 1] = 0; + + // We only support little-endian platforms, so we can simply memcpy the + // internal representation. + OPENSSL_memcpy(ret->d, in, len); + return ret; +} + +size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) { + size_t n, i; + BN_ULONG l; + + n = i = BN_num_bytes(in); + while (i--) { + l = in->d[i / BN_BYTES]; + *(out++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff; + } + return n; +} + +static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) { + uint8_t mask = 0; + for (size_t i = len; i < num_bytes; i++) { + mask |= bytes[i]; + } + return mask == 0; +} + +int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) { + const uint8_t *bytes = (const uint8_t *)in->d; + size_t num_bytes = in->width * BN_BYTES; + if (len < num_bytes) { + if (!fits_in_bytes(bytes, num_bytes, len)) { + return 0; + } + num_bytes = len; + } + + // We only support little-endian platforms, so we can simply memcpy into the + // internal representation. + OPENSSL_memcpy(out, bytes, num_bytes); + // Pad out the rest of the buffer with zeroes. + OPENSSL_memset(out + num_bytes, 0, len - num_bytes); + return 1; +} + +int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) { + const uint8_t *bytes = (const uint8_t *)in->d; + size_t num_bytes = in->width * BN_BYTES; + if (len < num_bytes) { + if (!fits_in_bytes(bytes, num_bytes, len)) { + return 0; + } + num_bytes = len; + } + + // We only support little-endian platforms, so we can simply write the buffer + // in reverse. + for (size_t i = 0; i < num_bytes; i++) { + out[len - i - 1] = bytes[i]; + } + // Pad out the rest of the buffer with zeroes. + OPENSSL_memset(out, 0, len - num_bytes); + return 1; +} + +BN_ULONG BN_get_word(const BIGNUM *bn) { + switch (bn_minimal_width(bn)) { + case 0: + return 0; + case 1: + return bn->d[0]; + default: + return BN_MASK2; + } +} + +int BN_get_u64(const BIGNUM *bn, uint64_t *out) { + switch (bn_minimal_width(bn)) { + case 0: + *out = 0; + return 1; + case 1: + *out = bn->d[0]; + return 1; +#if defined(OPENSSL_32_BIT) + case 2: + *out = (uint64_t) bn->d[0] | (((uint64_t) bn->d[1]) << 32); + return 1; +#endif + default: + return 0; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c.grpc_back new file mode 100644 index 0000000..56241e3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c.grpc_back @@ -0,0 +1,230 @@ +/* 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" + + +BIGNUM *BN_bin2bn(const uint8_t *in, size_t len, BIGNUM *ret) { + size_t num_words; + unsigned m; + BN_ULONG word = 0; + BIGNUM *bn = NULL; + + if (ret == NULL) { + ret = bn = BN_new(); + } + + if (ret == NULL) { + return NULL; + } + + if (len == 0) { + ret->width = 0; + return ret; + } + + num_words = ((len - 1) / BN_BYTES) + 1; + m = (len - 1) % BN_BYTES; + if (!bn_wexpand(ret, num_words)) { + if (bn) { + BN_free(bn); + } + return NULL; + } + + // |bn_wexpand| must check bounds on |num_words| to write it into + // |ret->dmax|. + assert(num_words <= INT_MAX); + ret->width = (int)num_words; + ret->neg = 0; + + while (len--) { + word = (word << 8) | *(in++); + if (m-- == 0) { + ret->d[--num_words] = word; + word = 0; + m = BN_BYTES - 1; + } + } + + return ret; +} + +BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) { + BIGNUM *bn = NULL; + if (ret == NULL) { + bn = BN_new(); + ret = bn; + } + + if (ret == NULL) { + return NULL; + } + + if (len == 0) { + ret->width = 0; + ret->neg = 0; + return ret; + } + + // Reserve enough space in |ret|. + size_t num_words = ((len - 1) / BN_BYTES) + 1; + if (!bn_wexpand(ret, num_words)) { + BN_free(bn); + return NULL; + } + ret->width = num_words; + + // Make sure the top bytes will be zeroed. + ret->d[num_words - 1] = 0; + + // We only support little-endian platforms, so we can simply memcpy the + // internal representation. + OPENSSL_memcpy(ret->d, in, len); + return ret; +} + +size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) { + size_t n, i; + BN_ULONG l; + + n = i = BN_num_bytes(in); + while (i--) { + l = in->d[i / BN_BYTES]; + *(out++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff; + } + return n; +} + +static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) { + uint8_t mask = 0; + for (size_t i = len; i < num_bytes; i++) { + mask |= bytes[i]; + } + return mask == 0; +} + +int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) { + const uint8_t *bytes = (const uint8_t *)in->d; + size_t num_bytes = in->width * BN_BYTES; + if (len < num_bytes) { + if (!fits_in_bytes(bytes, num_bytes, len)) { + return 0; + } + num_bytes = len; + } + + // We only support little-endian platforms, so we can simply memcpy into the + // internal representation. + OPENSSL_memcpy(out, bytes, num_bytes); + // Pad out the rest of the buffer with zeroes. + OPENSSL_memset(out + num_bytes, 0, len - num_bytes); + return 1; +} + +int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) { + const uint8_t *bytes = (const uint8_t *)in->d; + size_t num_bytes = in->width * BN_BYTES; + if (len < num_bytes) { + if (!fits_in_bytes(bytes, num_bytes, len)) { + return 0; + } + num_bytes = len; + } + + // We only support little-endian platforms, so we can simply write the buffer + // in reverse. + for (size_t i = 0; i < num_bytes; i++) { + out[len - i - 1] = bytes[i]; + } + // Pad out the rest of the buffer with zeroes. + OPENSSL_memset(out, 0, len - num_bytes); + return 1; +} + +BN_ULONG BN_get_word(const BIGNUM *bn) { + switch (bn_minimal_width(bn)) { + case 0: + return 0; + case 1: + return bn->d[0]; + default: + return BN_MASK2; + } +} + +int BN_get_u64(const BIGNUM *bn, uint64_t *out) { + switch (bn_minimal_width(bn)) { + case 0: + *out = 0; + return 1; + case 1: + *out = bn->d[0]; + return 1; +#if defined(OPENSSL_32_BIT) + case 2: + *out = (uint64_t) bn->d[0] | (((uint64_t) bn->d[1]) << 32); + return 1; +#endif + default: + return 0; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c new file mode 100644 index 0000000..284ef07 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c @@ -0,0 +1,200 @@ +/* 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" + + +static int bn_cmp_words_consttime(const BN_ULONG *a, size_t a_len, + const BN_ULONG *b, size_t b_len) { + 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; + for (size_t i = 0; i < min; i++) { + crypto_word_t eq = constant_time_eq_w(a[i], b[i]); + crypto_word_t lt = constant_time_lt_w(a[i], b[i]); + ret = + constant_time_select_int(eq, ret, constant_time_select_int(lt, -1, 1)); + } + + // If |a| or |b| has non-zero words beyond |min|, they take precedence. + if (a_len < b_len) { + crypto_word_t mask = 0; + for (size_t i = a_len; i < b_len; i++) { + mask |= b[i]; + } + ret = constant_time_select_int(constant_time_is_zero_w(mask), ret, -1); + } else if (b_len < a_len) { + crypto_word_t mask = 0; + for (size_t i = b_len; i < a_len; i++) { + mask |= a[i]; + } + ret = constant_time_select_int(constant_time_is_zero_w(mask), ret, 1); + } + + return ret; +} + +int BN_ucmp(const BIGNUM *a, const BIGNUM *b) { + return bn_cmp_words_consttime(a->d, a->width, b->d, b->width); +} + +int BN_cmp(const BIGNUM *a, const BIGNUM *b) { + if ((a == NULL) || (b == NULL)) { + if (a != NULL) { + return -1; + } else if (b != NULL) { + return 1; + } else { + return 0; + } + } + + // We do not attempt to process the sign bit in constant time. Negative + // |BIGNUM|s should never occur in crypto, only calculators. + if (a->neg != b->neg) { + if (a->neg) { + return -1; + } + return 1; + } + + int ret = BN_ucmp(a, b); + return a->neg ? -ret : ret; +} + +int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len) { + return bn_cmp_words_consttime(a, len, b, len) < 0; +} + +int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w) { + if (bn->width == 0) { + return w == 0; + } + BN_ULONG mask = bn->d[0] ^ w; + for (int i = 1; i < bn->width; i++) { + mask |= bn->d[i]; + } + return mask == 0; +} + +int BN_cmp_word(const BIGNUM *a, BN_ULONG b) { + BIGNUM b_bn; + BN_init(&b_bn); + + b_bn.d = &b; + b_bn.width = b > 0; + b_bn.dmax = 1; + b_bn.flags = BN_FLG_STATIC_DATA; + return BN_cmp(a, &b_bn); +} + +int BN_is_zero(const BIGNUM *bn) { + return bn_fits_in_words(bn, 0); +} + +int BN_is_one(const BIGNUM *bn) { + return bn->neg == 0 && BN_abs_is_word(bn, 1); +} + +int BN_is_word(const BIGNUM *bn, BN_ULONG w) { + return BN_abs_is_word(bn, w) && (w == 0 || bn->neg == 0); +} + +int BN_is_odd(const BIGNUM *bn) { + return bn->width > 0 && (bn->d[0] & 1) == 1; +} + +int BN_is_pow2(const BIGNUM *bn) { + int width = bn_minimal_width(bn); + if (width == 0 || bn->neg) { + return 0; + } + + for (int i = 0; i < width - 1; i++) { + if (bn->d[i] != 0) { + return 0; + } + } + + return 0 == (bn->d[width-1] & (bn->d[width-1] - 1)); +} + +int BN_equal_consttime(const BIGNUM *a, const BIGNUM *b) { + BN_ULONG mask = 0; + // If |a| or |b| has more words than the other, all those words must be zero. + for (int i = a->width; i < b->width; i++) { + mask |= b->d[i]; + } + for (int i = b->width; i < a->width; i++) { + mask |= a->d[i]; + } + // Common words must match. + int min = a->width < b->width ? a->width : b->width; + for (int i = 0; i < min; i++) { + mask |= (a->d[i] ^ b->d[i]); + } + // The sign bit must match. + mask |= (a->neg ^ b->neg); + return mask == 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back new file mode 100644 index 0000000..fe478b6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back @@ -0,0 +1,200 @@ +/* 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" + + +static int bn_cmp_words_consttime(const BN_ULONG *a, size_t a_len, + const BN_ULONG *b, size_t b_len) { + 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; + for (size_t i = 0; i < min; i++) { + crypto_word_t eq = constant_time_eq_w(a[i], b[i]); + crypto_word_t lt = constant_time_lt_w(a[i], b[i]); + ret = + constant_time_select_int(eq, ret, constant_time_select_int(lt, -1, 1)); + } + + // If |a| or |b| has non-zero words beyond |min|, they take precedence. + if (a_len < b_len) { + crypto_word_t mask = 0; + for (size_t i = a_len; i < b_len; i++) { + mask |= b[i]; + } + ret = constant_time_select_int(constant_time_is_zero_w(mask), ret, -1); + } else if (b_len < a_len) { + crypto_word_t mask = 0; + for (size_t i = b_len; i < a_len; i++) { + mask |= a[i]; + } + ret = constant_time_select_int(constant_time_is_zero_w(mask), ret, 1); + } + + return ret; +} + +int BN_ucmp(const BIGNUM *a, const BIGNUM *b) { + return bn_cmp_words_consttime(a->d, a->width, b->d, b->width); +} + +int BN_cmp(const BIGNUM *a, const BIGNUM *b) { + if ((a == NULL) || (b == NULL)) { + if (a != NULL) { + return -1; + } else if (b != NULL) { + return 1; + } else { + return 0; + } + } + + // We do not attempt to process the sign bit in constant time. Negative + // |BIGNUM|s should never occur in crypto, only calculators. + if (a->neg != b->neg) { + if (a->neg) { + return -1; + } + return 1; + } + + int ret = BN_ucmp(a, b); + return a->neg ? -ret : ret; +} + +int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len) { + return bn_cmp_words_consttime(a, len, b, len) < 0; +} + +int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w) { + if (bn->width == 0) { + return w == 0; + } + BN_ULONG mask = bn->d[0] ^ w; + for (int i = 1; i < bn->width; i++) { + mask |= bn->d[i]; + } + return mask == 0; +} + +int BN_cmp_word(const BIGNUM *a, BN_ULONG b) { + BIGNUM b_bn; + BN_init(&b_bn); + + b_bn.d = &b; + b_bn.width = b > 0; + b_bn.dmax = 1; + b_bn.flags = BN_FLG_STATIC_DATA; + return BN_cmp(a, &b_bn); +} + +int BN_is_zero(const BIGNUM *bn) { + return bn_fits_in_words(bn, 0); +} + +int BN_is_one(const BIGNUM *bn) { + return bn->neg == 0 && BN_abs_is_word(bn, 1); +} + +int BN_is_word(const BIGNUM *bn, BN_ULONG w) { + return BN_abs_is_word(bn, w) && (w == 0 || bn->neg == 0); +} + +int BN_is_odd(const BIGNUM *bn) { + return bn->width > 0 && (bn->d[0] & 1) == 1; +} + +int BN_is_pow2(const BIGNUM *bn) { + int width = bn_minimal_width(bn); + if (width == 0 || bn->neg) { + return 0; + } + + for (int i = 0; i < width - 1; i++) { + if (bn->d[i] != 0) { + return 0; + } + } + + return 0 == (bn->d[width-1] & (bn->d[width-1] - 1)); +} + +int BN_equal_consttime(const BIGNUM *a, const BIGNUM *b) { + BN_ULONG mask = 0; + // If |a| or |b| has more words than the other, all those words must be zero. + for (int i = a->width; i < b->width; i++) { + mask |= b->d[i]; + } + for (int i = b->width; i < a->width; i++) { + mask |= a->d[i]; + } + // Common words must match. + int min = a->width < b->width ? a->width : b->width; + for (int i = 0; i < min; i++) { + mask |= (a->d[i] ^ b->d[i]); + } + // The sign bit must match. + mask |= (a->neg ^ b->neg); + return mask == 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c new file mode 100644 index 0000000..c9ef147 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c.grpc_back new file mode 100644 index 0000000..f8c7ebf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c new file mode 100644 index 0000000..45ae65e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c @@ -0,0 +1,886 @@ +/* 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" + + +#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) { + BN_ULONG dh, dl, q, ret = 0, th, tl, t; + int i, count = 2; + + if (d == 0) { + return BN_MASK2; + } + + i = BN_num_bits_word(d); + assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); + + i = BN_BITS2 - i; + if (h >= d) { + h -= d; + } + + if (i) { + d <<= i; + h = (h << i) | (l >> (BN_BITS2 - i)); + l <<= i; + } + dh = (d & BN_MASK2h) >> BN_BITS4; + dl = (d & BN_MASK2l); + for (;;) { + if ((h >> BN_BITS4) == dh) { + q = BN_MASK2l; + } else { + q = h / dh; + } + + th = q * dh; + tl = dl * q; + for (;;) { + t = h - th; + if ((t & BN_MASK2h) || + ((tl) <= ((t << BN_BITS4) | ((l & BN_MASK2h) >> BN_BITS4)))) { + break; + } + q--; + th -= dh; + tl -= dl; + } + t = (tl >> BN_BITS4); + tl = (tl << BN_BITS4) & BN_MASK2h; + th += t; + + if (l < tl) { + th++; + } + l -= tl; + if (h < th) { + h += d; + q--; + } + h -= th; + + if (--count == 0) { + break; + } + + ret = q << BN_BITS4; + h = (h << BN_BITS4) | (l >> BN_BITS4); + l = (l & BN_MASK2l) << BN_BITS4; + } + + ret |= q; + return ret; +} +#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) { + // GCC and Clang generate function calls to |__udivdi3| and |__umoddi3| when + // the |BN_ULLONG|-based C code is used. + // + // GCC bugs: + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14224 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54183 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58897 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65668 + // + // Clang bugs: + // * https://llvm.org/bugs/show_bug.cgi?id=6397 + // * https://llvm.org/bugs/show_bug.cgi?id=12418 + // + // These issues aren't specific to x86 and x86_64, so it might be worthwhile + // to add more assembly language implementations. +#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(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_CAN_DIVIDE_ULLONG) + BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; + *quotient_out = (BN_ULONG)(n / d0); +#else + *quotient_out = bn_div_words(n0, n1, d0); +#endif + *rem_out = n1 - (*quotient_out * d0); +#endif +} + +// BN_div computes "quotient := numerator / divisor", rounding towards zero, +// and sets up |rem| such that "quotient * divisor + rem = numerator" holds. +// +// Thus: +// +// quotient->neg == numerator->neg ^ divisor->neg +// (unless the result is zero) +// rem->neg == numerator->neg +// (unless the remainder is zero) +// +// If |quotient| or |rem| is NULL, the respective value is not returned. +// +// This was specifically designed to contain fewer branches that may leak +// sensitive information; see "New Branch Prediction Vulnerabilities in OpenSSL +// and Necessary Software Countermeasures" by Onur AcΔ±Γ§mez, Shay Gueron, and +// Jean-Pierre Seifert. +int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator, + const BIGNUM *divisor, BN_CTX *ctx) { + int norm_shift, loop; + BIGNUM wnum; + BN_ULONG *resp, *wnump; + BN_ULONG d0, d1; + int num_n, div_n; + + // This function relies on the historical minimal-width |BIGNUM| invariant. + // It is already not constant-time (constant-time reductions should use + // Montgomery logic), so we shrink all inputs and intermediate values to + // retain the previous behavior. + + // Invalid zero-padding would have particularly bad consequences. + int numerator_width = bn_minimal_width(numerator); + int divisor_width = bn_minimal_width(divisor); + if ((numerator_width > 0 && numerator->d[numerator_width - 1] == 0) || + (divisor_width > 0 && divisor->d[divisor_width - 1] == 0)) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_INITIALIZED); + return 0; + } + + if (BN_is_zero(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); + return 0; + } + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + BIGNUM *snum = BN_CTX_get(ctx); + BIGNUM *sdiv = BN_CTX_get(ctx); + BIGNUM *res = NULL; + if (quotient == NULL) { + res = BN_CTX_get(ctx); + } else { + res = quotient; + } + if (sdiv == NULL || res == NULL) { + goto err; + } + + // First we normalise the numbers + norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2); + if (!BN_lshift(sdiv, divisor, norm_shift)) { + goto err; + } + bn_set_minimal_width(sdiv); + sdiv->neg = 0; + norm_shift += BN_BITS2; + if (!BN_lshift(snum, numerator, norm_shift)) { + goto err; + } + bn_set_minimal_width(snum); + snum->neg = 0; + + // Since we don't want to have special-case logic for the case where snum is + // larger than sdiv, we pad snum with enough zeroes without changing its + // value. + if (snum->width <= sdiv->width + 1) { + if (!bn_wexpand(snum, sdiv->width + 2)) { + goto err; + } + for (int i = snum->width; i < sdiv->width + 2; i++) { + snum->d[i] = 0; + } + snum->width = sdiv->width + 2; + } else { + if (!bn_wexpand(snum, snum->width + 1)) { + goto err; + } + snum->d[snum->width] = 0; + snum->width++; + } + + div_n = sdiv->width; + num_n = snum->width; + loop = num_n - div_n; + // Lets setup a 'window' into snum + // This is the part that corresponds to the current + // 'area' being divided + wnum.neg = 0; + wnum.d = &(snum->d[loop]); + wnum.width = div_n; + // only needed when BN_ucmp messes up the values between width and max + wnum.dmax = snum->dmax - loop; // so we don't step out of bounds + + // Get the top 2 words of sdiv + // div_n=sdiv->width; + d0 = sdiv->d[div_n - 1]; + d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2]; + + // pointer to the 'top' of snum + wnump = &(snum->d[num_n - 1]); + + // Setup to 'res' + res->neg = (numerator->neg ^ divisor->neg); + if (!bn_wexpand(res, loop + 1)) { + goto err; + } + res->width = loop - 1; + resp = &(res->d[loop - 1]); + + // space for temp + if (!bn_wexpand(tmp, div_n + 1)) { + goto err; + } + + // if res->width == 0 then clear the neg value otherwise decrease + // the resp pointer + if (res->width == 0) { + res->neg = 0; + } else { + resp--; + } + + for (int i = 0; i < loop - 1; i++, wnump--, resp--) { + BN_ULONG q, l0; + // the first part of the loop uses the top two words of snum and sdiv to + // calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv + BN_ULONG n0, n1, rm = 0; + + n0 = wnump[0]; + n1 = wnump[-1]; + if (n0 == d0) { + q = BN_MASK2; + } else { + // n0 < d0 + bn_div_rem_words(&q, &rm, n0, n1, d0); + +#ifdef BN_ULLONG + BN_ULLONG t2 = (BN_ULLONG)d1 * q; + for (;;) { + if (t2 <= ((((BN_ULLONG)rm) << BN_BITS2) | wnump[-2])) { + break; + } + q--; + rm += d0; + if (rm < d0) { + break; // don't let rm overflow + } + t2 -= d1; + } +#else // !BN_ULLONG + BN_ULONG t2l, t2h; + BN_UMULT_LOHI(t2l, t2h, d1, q); + for (;;) { + if (t2h < rm || + (t2h == rm && t2l <= wnump[-2])) { + break; + } + q--; + rm += d0; + if (rm < d0) { + break; // don't let rm overflow + } + if (t2l < d1) { + t2h--; + } + t2l -= d1; + } +#endif // !BN_ULLONG + } + + l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q); + tmp->d[div_n] = l0; + wnum.d--; + // ingore top values of the bignums just sub the two + // BN_ULONG arrays with bn_sub_words + if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n + 1)) { + // Note: As we have considered only the leading + // two BN_ULONGs in the calculation of q, sdiv * q + // might be greater than wnum (but then (q-1) * sdiv + // is less or equal than wnum) + q--; + if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n)) { + // we can't have an overflow here (assuming + // that q != 0, but if q == 0 then tmp is + // zero anyway) + (*wnump)++; + } + } + // store part of the result + *resp = q; + } + + bn_set_minimal_width(snum); + + if (rem != NULL) { + // Keep a copy of the neg flag in numerator because if |rem| == |numerator| + // |BN_rshift| will overwrite it. + int neg = numerator->neg; + if (!BN_rshift(rem, snum, norm_shift)) { + goto err; + } + if (!BN_is_zero(rem)) { + rem->neg = neg; + } + } + + bn_set_minimal_width(res); + BN_CTX_end(ctx); + return 1; + +err: + BN_CTX_end(ctx); + return 0; +} + +int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) { + if (!(BN_mod(r, m, d, ctx))) { + return 0; + } + if (!r->neg) { + return 1; + } + + // now -|d| < r < 0, so we have to set r := r + |d|. + return (d->neg ? BN_sub : BN_add)(r, r, d); +} + +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 + bn_add_words(tmp, r, m, num); + bn_select_words(r, 0 - borrow, 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, + const BIGNUM *numerator, const BIGNUM *divisor, + BN_CTX *ctx) { + if (BN_is_negative(numerator) || BN_is_negative(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (BN_is_zero(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); + return 0; + } + + // This function implements long division in binary. It is not very efficient, + // but it is simple, easy to make constant-time, and performant enough for RSA + // key generation. + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *q = quotient, *r = remainder; + if (quotient == NULL || quotient == numerator || quotient == divisor) { + q = BN_CTX_get(ctx); + } + if (remainder == NULL || remainder == numerator || remainder == divisor) { + r = BN_CTX_get(ctx); + } + BIGNUM *tmp = BN_CTX_get(ctx); + if (q == NULL || r == NULL || tmp == NULL || + !bn_wexpand(q, numerator->width) || + !bn_wexpand(r, divisor->width) || + !bn_wexpand(tmp, divisor->width)) { + goto err; + } + + OPENSSL_memset(q->d, 0, numerator->width * sizeof(BN_ULONG)); + q->width = numerator->width; + q->neg = 0; + + OPENSSL_memset(r->d, 0, divisor->width * sizeof(BN_ULONG)); + r->width = divisor->width; + r->neg = 0; + + // Incorporate |numerator| into |r|, one bit at a time, reducing after each + // step. At the start of each loop iteration, |r| < |divisor| + for (int i = numerator->width - 1; i >= 0; i--) { + for (int bit = BN_BITS2 - 1; bit >= 0; bit--) { + // Incorporate the next bit of the numerator, by computing + // r = 2*r or 2*r + 1. Note the result fits in one more word. We store the + // 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; + // |r| was previously fully-reduced, so we know: + // 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] |= (~subtracted & 1) << bit; + } + } + + if ((quotient != NULL && !BN_copy(quotient, q)) || + (remainder != NULL && !BN_copy(remainder, r))) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static BIGNUM *bn_scratch_space_from_ctx(size_t width, BN_CTX *ctx) { + BIGNUM *ret = BN_CTX_get(ctx); + if (ret == NULL || + !bn_wexpand(ret, width)) { + return NULL; + } + ret->neg = 0; + ret->width = width; + return ret; +} + +// bn_resized_from_ctx returns |bn| with width at least |width| or NULL on +// error. This is so it may be used with low-level "words" functions. If +// necessary, it allocates a new |BIGNUM| with a lifetime of the current scope +// in |ctx|, so the caller does not need to explicitly free it. |bn| must fit in +// |width| words. +static const BIGNUM *bn_resized_from_ctx(const BIGNUM *bn, size_t width, + BN_CTX *ctx) { + if ((size_t)bn->width >= width) { + // Any excess words must be zero. + assert(bn_fits_in_words(bn, width)); + return bn; + } + BIGNUM *ret = bn_scratch_space_from_ctx(width, ctx); + if (ret == NULL || + !BN_copy(ret, bn) || + !bn_resize_words(ret, width)) { + return NULL; + } + return ret; +} + +int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_add(r, a, b)) { + return 0; + } + return BN_nnmod(r, r, m, ctx); +} + +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_add_consttime(r, a, b, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx) { + BN_CTX_start(ctx); + a = bn_resized_from_ctx(a, m->width, ctx); + b = bn_resized_from_ctx(b, m->width, ctx); + BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx); + int ok = a != NULL && b != NULL && tmp != NULL && + bn_wexpand(r, m->width); + 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; +} + +int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_sub(r, a, b)) { + return 0; + } + return BN_nnmod(r, r, m, ctx); +} + +int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx) { + BN_CTX_start(ctx); + a = bn_resized_from_ctx(a, m->width, ctx); + b = bn_resized_from_ctx(b, m->width, ctx); + BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx); + int ok = a != NULL && b != NULL && tmp != NULL && + bn_wexpand(r, m->width); + 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; +} + +int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_sub_consttime(r, a, b, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + BIGNUM *t; + int ret = 0; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + + if (a == b) { + if (!BN_sqr(t, a, ctx)) { + goto err; + } + } else { + if (!BN_mul(t, a, b, ctx)) { + goto err; + } + } + + if (!BN_nnmod(r, t, m, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) { + if (!BN_sqr(r, a, ctx)) { + return 0; + } + + // r->neg == 0, thus we don't need BN_nnmod + return BN_mod(r, r, m, ctx); +} + +int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx) { + BIGNUM *abs_m = NULL; + int ret; + + if (!BN_nnmod(r, a, m, ctx)) { + return 0; + } + + if (m->neg) { + abs_m = BN_dup(m); + if (abs_m == NULL) { + return 0; + } + abs_m->neg = 0; + } + + ret = bn_mod_lshift_consttime(r, r, n, (abs_m ? abs_m : m), ctx); + + BN_free(abs_m); + return ret; +} + +int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_copy(r, a)) { + return 0; + } + for (int i = 0; i < n; i++) { + if (!bn_mod_lshift1_consttime(r, r, m, ctx)) { + return 0; + } + } + return 1; +} + +int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_lshift_consttime(r, a, n, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) { + if (!BN_lshift1(r, a)) { + return 0; + } + + return BN_nnmod(r, r, m, ctx); +} + +int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx) { + return bn_mod_add_consttime(r, a, a, m, ctx); +} + +int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_lshift1_consttime(r, a, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) { + BN_ULONG ret = 0; + int i, j; + + if (!w) { + // actually this an error (division by zero) + return (BN_ULONG) - 1; + } + + if (a->width == 0) { + return 0; + } + + // normalize input for |bn_div_rem_words|. + j = BN_BITS2 - BN_num_bits_word(w); + w <<= j; + if (!BN_lshift(a, a, j)) { + return (BN_ULONG) - 1; + } + + for (i = a->width - 1; i >= 0; i--) { + BN_ULONG l = a->d[i]; + BN_ULONG d; + BN_ULONG unused_rem; + bn_div_rem_words(&d, &unused_rem, ret, l, w); + ret = l - (d * w); + a->d[i] = d; + } + + bn_set_minimal_width(a); + ret >>= j; + return ret; +} + +BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) { +#ifndef BN_CAN_DIVIDE_ULLONG + BN_ULONG ret = 0; +#else + BN_ULLONG ret = 0; +#endif + int i; + + if (w == 0) { + return (BN_ULONG) -1; + } + +#ifndef BN_CAN_DIVIDE_ULLONG + // If |w| is too long and we don't have |BN_ULLONG| division then we need to + // fall back to using |BN_div_word|. + if (w > ((BN_ULONG)1 << BN_BITS4)) { + BIGNUM *tmp = BN_dup(a); + if (tmp == NULL) { + return (BN_ULONG)-1; + } + ret = BN_div_word(tmp, w); + BN_free(tmp); + return ret; + } +#endif + + for (i = a->width - 1; i >= 0; i--) { +#ifndef BN_CAN_DIVIDE_ULLONG + ret = ((ret << BN_BITS4) | ((a->d[i] >> BN_BITS4) & BN_MASK2l)) % w; + ret = ((ret << BN_BITS4) | (a->d[i] & BN_MASK2l)) % w; +#else + ret = (BN_ULLONG)(((ret << (BN_ULLONG)BN_BITS2) | a->d[i]) % (BN_ULLONG)w); +#endif + } + return (BN_ULONG)ret; +} + +int BN_mod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) { + if (e == 0 || a->width == 0) { + BN_zero(r); + return 1; + } + + size_t num_words = 1 + ((e - 1) / BN_BITS2); + + // If |a| definitely has less than |e| bits, just BN_copy. + if ((size_t) a->width < num_words) { + return BN_copy(r, a) != NULL; + } + + // Otherwise, first make sure we have enough space in |r|. + // Note that this will fail if num_words > INT_MAX. + if (!bn_wexpand(r, num_words)) { + return 0; + } + + // Copy the content of |a| into |r|. + OPENSSL_memcpy(r->d, a->d, num_words * sizeof(BN_ULONG)); + + // If |e| isn't word-aligned, we have to mask off some of our bits. + size_t top_word_exponent = e % (sizeof(BN_ULONG) * 8); + if (top_word_exponent != 0) { + r->d[num_words - 1] &= (((BN_ULONG) 1) << top_word_exponent) - 1; + } + + // Fill in the remaining fields of |r|. + r->neg = a->neg; + r->width = (int) num_words; + bn_set_minimal_width(r); + return 1; +} + +int BN_nnmod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) { + if (!BN_mod_pow2(r, a, e)) { + return 0; + } + + // If the returned value was non-negative, we're done. + if (BN_is_zero(r) || !r->neg) { + return 1; + } + + size_t num_words = 1 + (e - 1) / BN_BITS2; + + // Expand |r| to the size of our modulus. + if (!bn_wexpand(r, num_words)) { + return 0; + } + + // Clear the upper words of |r|. + OPENSSL_memset(&r->d[r->width], 0, (num_words - r->width) * BN_BYTES); + + // Set parameters of |r|. + r->neg = 0; + r->width = (int) num_words; + + // Now, invert every word. The idea here is that we want to compute 2^e-|x|, + // which is actually equivalent to the twos-complement representation of |x| + // in |e| bits, which is -x = ~x + 1. + for (int i = 0; i < r->width; i++) { + r->d[i] = ~r->d[i]; + } + + // If our exponent doesn't span the top word, we have to mask the rest. + size_t top_word_exponent = e % BN_BITS2; + if (top_word_exponent != 0) { + r->d[r->width - 1] &= (((BN_ULONG) 1) << top_word_exponent) - 1; + } + + // Keep the minimal-width invariant for |BIGNUM|. + bn_set_minimal_width(r); + + // Finally, add one, for the reason described above. + return BN_add(r, r, BN_value_one()); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back new file mode 100644 index 0000000..27b591c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back @@ -0,0 +1,886 @@ +/* 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" + + +#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) { + BN_ULONG dh, dl, q, ret = 0, th, tl, t; + int i, count = 2; + + if (d == 0) { + return BN_MASK2; + } + + i = BN_num_bits_word(d); + assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); + + i = BN_BITS2 - i; + if (h >= d) { + h -= d; + } + + if (i) { + d <<= i; + h = (h << i) | (l >> (BN_BITS2 - i)); + l <<= i; + } + dh = (d & BN_MASK2h) >> BN_BITS4; + dl = (d & BN_MASK2l); + for (;;) { + if ((h >> BN_BITS4) == dh) { + q = BN_MASK2l; + } else { + q = h / dh; + } + + th = q * dh; + tl = dl * q; + for (;;) { + t = h - th; + if ((t & BN_MASK2h) || + ((tl) <= ((t << BN_BITS4) | ((l & BN_MASK2h) >> BN_BITS4)))) { + break; + } + q--; + th -= dh; + tl -= dl; + } + t = (tl >> BN_BITS4); + tl = (tl << BN_BITS4) & BN_MASK2h; + th += t; + + if (l < tl) { + th++; + } + l -= tl; + if (h < th) { + h += d; + q--; + } + h -= th; + + if (--count == 0) { + break; + } + + ret = q << BN_BITS4; + h = (h << BN_BITS4) | (l >> BN_BITS4); + l = (l & BN_MASK2l) << BN_BITS4; + } + + ret |= q; + return ret; +} +#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) { + // GCC and Clang generate function calls to |__udivdi3| and |__umoddi3| when + // the |BN_ULLONG|-based C code is used. + // + // GCC bugs: + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14224 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54183 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58897 + // * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65668 + // + // Clang bugs: + // * https://llvm.org/bugs/show_bug.cgi?id=6397 + // * https://llvm.org/bugs/show_bug.cgi?id=12418 + // + // These issues aren't specific to x86 and x86_64, so it might be worthwhile + // to add more assembly language implementations. +#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(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_CAN_DIVIDE_ULLONG) + BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; + *quotient_out = (BN_ULONG)(n / d0); +#else + *quotient_out = bn_div_words(n0, n1, d0); +#endif + *rem_out = n1 - (*quotient_out * d0); +#endif +} + +// BN_div computes "quotient := numerator / divisor", rounding towards zero, +// and sets up |rem| such that "quotient * divisor + rem = numerator" holds. +// +// Thus: +// +// quotient->neg == numerator->neg ^ divisor->neg +// (unless the result is zero) +// rem->neg == numerator->neg +// (unless the remainder is zero) +// +// If |quotient| or |rem| is NULL, the respective value is not returned. +// +// This was specifically designed to contain fewer branches that may leak +// sensitive information; see "New Branch Prediction Vulnerabilities in OpenSSL +// and Necessary Software Countermeasures" by Onur AcΔ±Γ§mez, Shay Gueron, and +// Jean-Pierre Seifert. +int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator, + const BIGNUM *divisor, BN_CTX *ctx) { + int norm_shift, loop; + BIGNUM wnum; + BN_ULONG *resp, *wnump; + BN_ULONG d0, d1; + int num_n, div_n; + + // This function relies on the historical minimal-width |BIGNUM| invariant. + // It is already not constant-time (constant-time reductions should use + // Montgomery logic), so we shrink all inputs and intermediate values to + // retain the previous behavior. + + // Invalid zero-padding would have particularly bad consequences. + int numerator_width = bn_minimal_width(numerator); + int divisor_width = bn_minimal_width(divisor); + if ((numerator_width > 0 && numerator->d[numerator_width - 1] == 0) || + (divisor_width > 0 && divisor->d[divisor_width - 1] == 0)) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_INITIALIZED); + return 0; + } + + if (BN_is_zero(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); + return 0; + } + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + BIGNUM *snum = BN_CTX_get(ctx); + BIGNUM *sdiv = BN_CTX_get(ctx); + BIGNUM *res = NULL; + if (quotient == NULL) { + res = BN_CTX_get(ctx); + } else { + res = quotient; + } + if (sdiv == NULL || res == NULL) { + goto err; + } + + // First we normalise the numbers + norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2); + if (!BN_lshift(sdiv, divisor, norm_shift)) { + goto err; + } + bn_set_minimal_width(sdiv); + sdiv->neg = 0; + norm_shift += BN_BITS2; + if (!BN_lshift(snum, numerator, norm_shift)) { + goto err; + } + bn_set_minimal_width(snum); + snum->neg = 0; + + // Since we don't want to have special-case logic for the case where snum is + // larger than sdiv, we pad snum with enough zeroes without changing its + // value. + if (snum->width <= sdiv->width + 1) { + if (!bn_wexpand(snum, sdiv->width + 2)) { + goto err; + } + for (int i = snum->width; i < sdiv->width + 2; i++) { + snum->d[i] = 0; + } + snum->width = sdiv->width + 2; + } else { + if (!bn_wexpand(snum, snum->width + 1)) { + goto err; + } + snum->d[snum->width] = 0; + snum->width++; + } + + div_n = sdiv->width; + num_n = snum->width; + loop = num_n - div_n; + // Lets setup a 'window' into snum + // This is the part that corresponds to the current + // 'area' being divided + wnum.neg = 0; + wnum.d = &(snum->d[loop]); + wnum.width = div_n; + // only needed when BN_ucmp messes up the values between width and max + wnum.dmax = snum->dmax - loop; // so we don't step out of bounds + + // Get the top 2 words of sdiv + // div_n=sdiv->width; + d0 = sdiv->d[div_n - 1]; + d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2]; + + // pointer to the 'top' of snum + wnump = &(snum->d[num_n - 1]); + + // Setup to 'res' + res->neg = (numerator->neg ^ divisor->neg); + if (!bn_wexpand(res, loop + 1)) { + goto err; + } + res->width = loop - 1; + resp = &(res->d[loop - 1]); + + // space for temp + if (!bn_wexpand(tmp, div_n + 1)) { + goto err; + } + + // if res->width == 0 then clear the neg value otherwise decrease + // the resp pointer + if (res->width == 0) { + res->neg = 0; + } else { + resp--; + } + + for (int i = 0; i < loop - 1; i++, wnump--, resp--) { + BN_ULONG q, l0; + // the first part of the loop uses the top two words of snum and sdiv to + // calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv + BN_ULONG n0, n1, rm = 0; + + n0 = wnump[0]; + n1 = wnump[-1]; + if (n0 == d0) { + q = BN_MASK2; + } else { + // n0 < d0 + bn_div_rem_words(&q, &rm, n0, n1, d0); + +#ifdef BN_ULLONG + BN_ULLONG t2 = (BN_ULLONG)d1 * q; + for (;;) { + if (t2 <= ((((BN_ULLONG)rm) << BN_BITS2) | wnump[-2])) { + break; + } + q--; + rm += d0; + if (rm < d0) { + break; // don't let rm overflow + } + t2 -= d1; + } +#else // !BN_ULLONG + BN_ULONG t2l, t2h; + BN_UMULT_LOHI(t2l, t2h, d1, q); + for (;;) { + if (t2h < rm || + (t2h == rm && t2l <= wnump[-2])) { + break; + } + q--; + rm += d0; + if (rm < d0) { + break; // don't let rm overflow + } + if (t2l < d1) { + t2h--; + } + t2l -= d1; + } +#endif // !BN_ULLONG + } + + l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q); + tmp->d[div_n] = l0; + wnum.d--; + // ingore top values of the bignums just sub the two + // BN_ULONG arrays with bn_sub_words + if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n + 1)) { + // Note: As we have considered only the leading + // two BN_ULONGs in the calculation of q, sdiv * q + // might be greater than wnum (but then (q-1) * sdiv + // is less or equal than wnum) + q--; + if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n)) { + // we can't have an overflow here (assuming + // that q != 0, but if q == 0 then tmp is + // zero anyway) + (*wnump)++; + } + } + // store part of the result + *resp = q; + } + + bn_set_minimal_width(snum); + + if (rem != NULL) { + // Keep a copy of the neg flag in numerator because if |rem| == |numerator| + // |BN_rshift| will overwrite it. + int neg = numerator->neg; + if (!BN_rshift(rem, snum, norm_shift)) { + goto err; + } + if (!BN_is_zero(rem)) { + rem->neg = neg; + } + } + + bn_set_minimal_width(res); + BN_CTX_end(ctx); + return 1; + +err: + BN_CTX_end(ctx); + return 0; +} + +int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) { + if (!(BN_mod(r, m, d, ctx))) { + return 0; + } + if (!r->neg) { + return 1; + } + + // now -|d| < r < 0, so we have to set r := r + |d|. + return (d->neg ? BN_sub : BN_add)(r, r, d); +} + +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 + bn_add_words(tmp, r, m, num); + bn_select_words(r, 0 - borrow, 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, + const BIGNUM *numerator, const BIGNUM *divisor, + BN_CTX *ctx) { + if (BN_is_negative(numerator) || BN_is_negative(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (BN_is_zero(divisor)) { + OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); + return 0; + } + + // This function implements long division in binary. It is not very efficient, + // but it is simple, easy to make constant-time, and performant enough for RSA + // key generation. + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *q = quotient, *r = remainder; + if (quotient == NULL || quotient == numerator || quotient == divisor) { + q = BN_CTX_get(ctx); + } + if (remainder == NULL || remainder == numerator || remainder == divisor) { + r = BN_CTX_get(ctx); + } + BIGNUM *tmp = BN_CTX_get(ctx); + if (q == NULL || r == NULL || tmp == NULL || + !bn_wexpand(q, numerator->width) || + !bn_wexpand(r, divisor->width) || + !bn_wexpand(tmp, divisor->width)) { + goto err; + } + + OPENSSL_memset(q->d, 0, numerator->width * sizeof(BN_ULONG)); + q->width = numerator->width; + q->neg = 0; + + OPENSSL_memset(r->d, 0, divisor->width * sizeof(BN_ULONG)); + r->width = divisor->width; + r->neg = 0; + + // Incorporate |numerator| into |r|, one bit at a time, reducing after each + // step. At the start of each loop iteration, |r| < |divisor| + for (int i = numerator->width - 1; i >= 0; i--) { + for (int bit = BN_BITS2 - 1; bit >= 0; bit--) { + // Incorporate the next bit of the numerator, by computing + // r = 2*r or 2*r + 1. Note the result fits in one more word. We store the + // 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; + // |r| was previously fully-reduced, so we know: + // 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] |= (~subtracted & 1) << bit; + } + } + + if ((quotient != NULL && !BN_copy(quotient, q)) || + (remainder != NULL && !BN_copy(remainder, r))) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static BIGNUM *bn_scratch_space_from_ctx(size_t width, BN_CTX *ctx) { + BIGNUM *ret = BN_CTX_get(ctx); + if (ret == NULL || + !bn_wexpand(ret, width)) { + return NULL; + } + ret->neg = 0; + ret->width = width; + return ret; +} + +// bn_resized_from_ctx returns |bn| with width at least |width| or NULL on +// error. This is so it may be used with low-level "words" functions. If +// necessary, it allocates a new |BIGNUM| with a lifetime of the current scope +// in |ctx|, so the caller does not need to explicitly free it. |bn| must fit in +// |width| words. +static const BIGNUM *bn_resized_from_ctx(const BIGNUM *bn, size_t width, + BN_CTX *ctx) { + if ((size_t)bn->width >= width) { + // Any excess words must be zero. + assert(bn_fits_in_words(bn, width)); + return bn; + } + BIGNUM *ret = bn_scratch_space_from_ctx(width, ctx); + if (ret == NULL || + !BN_copy(ret, bn) || + !bn_resize_words(ret, width)) { + return NULL; + } + return ret; +} + +int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_add(r, a, b)) { + return 0; + } + return BN_nnmod(r, r, m, ctx); +} + +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_add_consttime(r, a, b, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx) { + BN_CTX_start(ctx); + a = bn_resized_from_ctx(a, m->width, ctx); + b = bn_resized_from_ctx(b, m->width, ctx); + BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx); + int ok = a != NULL && b != NULL && tmp != NULL && + bn_wexpand(r, m->width); + 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; +} + +int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_sub(r, a, b)) { + return 0; + } + return BN_nnmod(r, r, m, ctx); +} + +int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx) { + BN_CTX_start(ctx); + a = bn_resized_from_ctx(a, m->width, ctx); + b = bn_resized_from_ctx(b, m->width, ctx); + BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx); + int ok = a != NULL && b != NULL && tmp != NULL && + bn_wexpand(r, m->width); + 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; +} + +int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_sub_consttime(r, a, b, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx) { + BIGNUM *t; + int ret = 0; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + + if (a == b) { + if (!BN_sqr(t, a, ctx)) { + goto err; + } + } else { + if (!BN_mul(t, a, b, ctx)) { + goto err; + } + } + + if (!BN_nnmod(r, t, m, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) { + if (!BN_sqr(r, a, ctx)) { + return 0; + } + + // r->neg == 0, thus we don't need BN_nnmod + return BN_mod(r, r, m, ctx); +} + +int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx) { + BIGNUM *abs_m = NULL; + int ret; + + if (!BN_nnmod(r, a, m, ctx)) { + return 0; + } + + if (m->neg) { + abs_m = BN_dup(m); + if (abs_m == NULL) { + return 0; + } + abs_m->neg = 0; + } + + ret = bn_mod_lshift_consttime(r, r, n, (abs_m ? abs_m : m), ctx); + + BN_free(abs_m); + return ret; +} + +int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx) { + if (!BN_copy(r, a)) { + return 0; + } + for (int i = 0; i < n; i++) { + if (!bn_mod_lshift1_consttime(r, r, m, ctx)) { + return 0; + } + } + return 1; +} + +int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_lshift_consttime(r, a, n, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) { + if (!BN_lshift1(r, a)) { + return 0; + } + + return BN_nnmod(r, r, m, ctx); +} + +int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx) { + return bn_mod_add_consttime(r, a, a, m, ctx); +} + +int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m) { + BN_CTX *ctx = BN_CTX_new(); + int ok = ctx != NULL && + bn_mod_lshift1_consttime(r, a, m, ctx); + BN_CTX_free(ctx); + return ok; +} + +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) { + BN_ULONG ret = 0; + int i, j; + + if (!w) { + // actually this an error (division by zero) + return (BN_ULONG) - 1; + } + + if (a->width == 0) { + return 0; + } + + // normalize input for |bn_div_rem_words|. + j = BN_BITS2 - BN_num_bits_word(w); + w <<= j; + if (!BN_lshift(a, a, j)) { + return (BN_ULONG) - 1; + } + + for (i = a->width - 1; i >= 0; i--) { + BN_ULONG l = a->d[i]; + BN_ULONG d; + BN_ULONG unused_rem; + bn_div_rem_words(&d, &unused_rem, ret, l, w); + ret = l - (d * w); + a->d[i] = d; + } + + bn_set_minimal_width(a); + ret >>= j; + return ret; +} + +BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) { +#ifndef BN_CAN_DIVIDE_ULLONG + BN_ULONG ret = 0; +#else + BN_ULLONG ret = 0; +#endif + int i; + + if (w == 0) { + return (BN_ULONG) -1; + } + +#ifndef BN_CAN_DIVIDE_ULLONG + // If |w| is too long and we don't have |BN_ULLONG| division then we need to + // fall back to using |BN_div_word|. + if (w > ((BN_ULONG)1 << BN_BITS4)) { + BIGNUM *tmp = BN_dup(a); + if (tmp == NULL) { + return (BN_ULONG)-1; + } + ret = BN_div_word(tmp, w); + BN_free(tmp); + return ret; + } +#endif + + for (i = a->width - 1; i >= 0; i--) { +#ifndef BN_CAN_DIVIDE_ULLONG + ret = ((ret << BN_BITS4) | ((a->d[i] >> BN_BITS4) & BN_MASK2l)) % w; + ret = ((ret << BN_BITS4) | (a->d[i] & BN_MASK2l)) % w; +#else + ret = (BN_ULLONG)(((ret << (BN_ULLONG)BN_BITS2) | a->d[i]) % (BN_ULLONG)w); +#endif + } + return (BN_ULONG)ret; +} + +int BN_mod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) { + if (e == 0 || a->width == 0) { + BN_zero(r); + return 1; + } + + size_t num_words = 1 + ((e - 1) / BN_BITS2); + + // If |a| definitely has less than |e| bits, just BN_copy. + if ((size_t) a->width < num_words) { + return BN_copy(r, a) != NULL; + } + + // Otherwise, first make sure we have enough space in |r|. + // Note that this will fail if num_words > INT_MAX. + if (!bn_wexpand(r, num_words)) { + return 0; + } + + // Copy the content of |a| into |r|. + OPENSSL_memcpy(r->d, a->d, num_words * sizeof(BN_ULONG)); + + // If |e| isn't word-aligned, we have to mask off some of our bits. + size_t top_word_exponent = e % (sizeof(BN_ULONG) * 8); + if (top_word_exponent != 0) { + r->d[num_words - 1] &= (((BN_ULONG) 1) << top_word_exponent) - 1; + } + + // Fill in the remaining fields of |r|. + r->neg = a->neg; + r->width = (int) num_words; + bn_set_minimal_width(r); + return 1; +} + +int BN_nnmod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) { + if (!BN_mod_pow2(r, a, e)) { + return 0; + } + + // If the returned value was non-negative, we're done. + if (BN_is_zero(r) || !r->neg) { + return 1; + } + + size_t num_words = 1 + (e - 1) / BN_BITS2; + + // Expand |r| to the size of our modulus. + if (!bn_wexpand(r, num_words)) { + return 0; + } + + // Clear the upper words of |r|. + OPENSSL_memset(&r->d[r->width], 0, (num_words - r->width) * BN_BYTES); + + // Set parameters of |r|. + r->neg = 0; + r->width = (int) num_words; + + // Now, invert every word. The idea here is that we want to compute 2^e-|x|, + // which is actually equivalent to the twos-complement representation of |x| + // in |e| bits, which is -x = ~x + 1. + for (int i = 0; i < r->width; i++) { + r->d[i] = ~r->d[i]; + } + + // If our exponent doesn't span the top word, we have to mask the rest. + size_t top_word_exponent = e % BN_BITS2; + if (top_word_exponent != 0) { + r->d[r->width - 1] &= (((BN_ULONG) 1) << top_word_exponent) - 1; + } + + // Keep the minimal-width invariant for |BIGNUM|. + bn_set_minimal_width(r); + + // Finally, add one, for the reason described above. + return BN_add(r, r, BN_value_one()); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c new file mode 100644 index 0000000..027e005 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c.grpc_back new file mode 100644 index 0000000..7f03f28 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c new file mode 100644 index 0000000..bf70c3a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c @@ -0,0 +1,1288 @@ +/* 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-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 "internal.h" +#include "rsaz_exp.h" + + +int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { + int i, bits, ret = 0; + BIGNUM *v, *rr; + + BN_CTX_start(ctx); + if (r == a || r == p) { + rr = BN_CTX_get(ctx); + } else { + rr = r; + } + + v = BN_CTX_get(ctx); + if (rr == NULL || v == NULL) { + goto err; + } + + if (BN_copy(v, a) == NULL) { + goto err; + } + bits = BN_num_bits(p); + + if (BN_is_odd(p)) { + if (BN_copy(rr, a) == NULL) { + goto err; + } + } else { + if (!BN_one(rr)) { + goto err; + } + } + + for (i = 1; i < bits; i++) { + if (!BN_sqr(v, v, ctx)) { + goto err; + } + if (BN_is_bit_set(p, i)) { + if (!BN_mul(rr, rr, v, ctx)) { + goto err; + } + } + } + + if (r != rr && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +typedef struct bn_recp_ctx_st { + BIGNUM N; // the divisor + BIGNUM Nr; // the reciprocal + int num_bits; + int shift; + int flags; +} BN_RECP_CTX; + +static void BN_RECP_CTX_init(BN_RECP_CTX *recp) { + BN_init(&recp->N); + BN_init(&recp->Nr); + recp->num_bits = 0; + recp->shift = 0; + recp->flags = 0; +} + +static void BN_RECP_CTX_free(BN_RECP_CTX *recp) { + if (recp == NULL) { + return; + } + + BN_free(&recp->N); + BN_free(&recp->Nr); +} + +static int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx) { + if (!BN_copy(&(recp->N), d)) { + return 0; + } + BN_zero(&recp->Nr); + recp->num_bits = BN_num_bits(d); + recp->shift = 0; + + return 1; +} + +// len is the expected size of the result We actually calculate with an extra +// word of precision, so we can do faster division if the remainder is not +// required. +// r := 2^len / m +static int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx) { + int ret = -1; + BIGNUM *t; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + + if (!BN_set_bit(t, len)) { + goto err; + } + + if (!BN_div(r, NULL, t, m, ctx)) { + goto err; + } + + ret = len; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx) { + int i, j, ret = 0; + BIGNUM *a, *b, *d, *r; + + BN_CTX_start(ctx); + a = BN_CTX_get(ctx); + b = BN_CTX_get(ctx); + if (dv != NULL) { + d = dv; + } else { + d = BN_CTX_get(ctx); + } + + if (rem != NULL) { + r = rem; + } else { + r = BN_CTX_get(ctx); + } + + if (a == NULL || b == NULL || d == NULL || r == NULL) { + goto err; + } + + if (BN_ucmp(m, &recp->N) < 0) { + BN_zero(d); + if (!BN_copy(r, m)) { + goto err; + } + BN_CTX_end(ctx); + return 1; + } + + // We want the remainder + // Given input of ABCDEF / ab + // we need multiply ABCDEF by 3 digests of the reciprocal of ab + + // i := max(BN_num_bits(m), 2*BN_num_bits(N)) + i = BN_num_bits(m); + j = recp->num_bits << 1; + if (j > i) { + i = j; + } + + // Nr := round(2^i / N) + if (i != recp->shift) { + recp->shift = + BN_reciprocal(&(recp->Nr), &(recp->N), i, + ctx); // BN_reciprocal returns i, or -1 for an error + } + + if (recp->shift == -1) { + goto err; + } + + // d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - + // BN_num_bits(N)))| + // = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - + // BN_num_bits(N)))| + // <= |(m / 2^BN_num_bits(N)) * (2^i / N) * (2^BN_num_bits(N) / 2^i)| + // = |m/N| + if (!BN_rshift(a, m, recp->num_bits)) { + goto err; + } + if (!BN_mul(b, a, &(recp->Nr), ctx)) { + goto err; + } + if (!BN_rshift(d, b, i - recp->num_bits)) { + goto err; + } + d->neg = 0; + + if (!BN_mul(b, &(recp->N), d, ctx)) { + goto err; + } + if (!BN_usub(r, m, b)) { + goto err; + } + r->neg = 0; + + j = 0; + while (BN_ucmp(r, &(recp->N)) >= 0) { + if (j++ > 2) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_RECIPROCAL); + goto err; + } + if (!BN_usub(r, r, &(recp->N))) { + goto err; + } + if (!BN_add_word(d, 1)) { + goto err; + } + } + + r->neg = BN_is_zero(r) ? 0 : m->neg; + d->neg = m->neg ^ recp->N.neg; + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp, BN_CTX *ctx) { + int ret = 0; + BIGNUM *a; + const BIGNUM *ca; + + BN_CTX_start(ctx); + a = BN_CTX_get(ctx); + if (a == NULL) { + goto err; + } + + if (y != NULL) { + if (x == y) { + if (!BN_sqr(a, x, ctx)) { + goto err; + } + } else { + if (!BN_mul(a, x, y, ctx)) { + goto err; + } + } + ca = a; + } else { + ca = x; // Just do the mod + } + + ret = BN_div_recp(NULL, r, ca, recp, ctx); + +err: + BN_CTX_end(ctx); + return ret; +} + +// BN_window_bits_for_exponent_size returns sliding window size for mod_exp with +// a |b| bit exponent. +// +// For window size 'w' (w >= 2) and a random 'b' bits exponent, the number of +// multiplications is a constant plus on average +// +// 2^(w-1) + (b-w)/(w+1); +// +// here 2^(w-1) is for precomputing the table (we actually need entries only +// for windows that have the lowest bit set), and (b-w)/(w+1) is an +// approximation for the expected number of w-bit windows, not counting the +// first one. +// +// Thus we should use +// +// w >= 6 if b > 671 +// w = 5 if 671 > b > 239 +// w = 4 if 239 > b > 79 +// w = 3 if 79 > b > 23 +// w <= 2 if 23 > b +// +// (with draws in between). Very small exponents are often selected +// with low Hamming weight, so we use w = 1 for b <= 23. +static int BN_window_bits_for_exponent_size(int b) { + if (b > 671) { + return 6; + } + if (b > 239) { + return 5; + } + if (b > 79) { + return 4; + } + if (b > 23) { + return 3; + } + return 1; +} + +// TABLE_SIZE is the maximum precomputation table size for *variable* sliding +// windows. This must be 2^(max_window - 1), where max_window is the largest +// value returned from |BN_window_bits_for_exponent_size|. +#define TABLE_SIZE 32 + +// TABLE_BITS_SMALL is the smallest value returned from +// |BN_window_bits_for_exponent_size| when |b| is at most |BN_BITS2| * +// |BN_SMALL_MAX_WORDS| words. +#define TABLE_BITS_SMALL 5 + +// TABLE_SIZE_SMALL is the same as |TABLE_SIZE|, but when |b| is at most +// |BN_BITS2| * |BN_SMALL_MAX_WORDS|. +#define TABLE_SIZE_SMALL (1 << (TABLE_BITS_SMALL - 1)) + +static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx) { + 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; + + // This function is only called on even moduli. + assert(!BN_is_odd(m)); + + int bits = BN_num_bits(p); + if (bits == 0) { + return BN_one(r); + } + + BN_CTX_start(ctx); + aa = BN_CTX_get(ctx); + val[0] = BN_CTX_get(ctx); + if (!aa || !val[0]) { + goto err; + } + + BN_RECP_CTX_init(&recp); + if (m->neg) { + // ignore sign of 'm' + if (!BN_copy(aa, m)) { + goto err; + } + aa->neg = 0; + if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0) { + goto err; + } + } else { + if (BN_RECP_CTX_set(&recp, m, ctx) <= 0) { + goto err; + } + } + + if (!BN_nnmod(val[0], a, m, ctx)) { + goto err; // 1 + } + if (BN_is_zero(val[0])) { + BN_zero(r); + ret = 1; + goto err; + } + + window = BN_window_bits_for_exponent_size(bits); + if (window > 1) { + if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx)) { + goto err; // 2 + } + j = 1 << (window - 1); + for (i = 1; i < j; i++) { + if (((val[i] = BN_CTX_get(ctx)) == NULL) || + !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx)) { + goto err; + } + } + } + + start = 1; // This is used to avoid multiplication etc + // when there is only the value '1' in the + // buffer. + wstart = bits - 1; // The top bit of the window + + if (!BN_one(r)) { + goto err; + } + + for (;;) { + int wvalue; // The 'value' of the window + int wend; // The bottom bit of the window + + if (!BN_is_bit_set(p, wstart)) { + if (!start) { + if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)) { + goto err; + } + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a 'set' bit, we now need to work out + // how bit a window to do. To do this we need to scan + // forward until the last set bit before the end of the + // window + wvalue = 1; + wend = 0; + for (i = 1; i < window; i++) { + if (wstart - i < 0) { + break; + } + if (BN_is_bit_set(p, wstart - i)) { + wvalue <<= (i - wend); + wvalue |= 1; + wend = i; + } + } + + // wend is the size of the current window + j = wend + 1; + // add the 'bytes above' + if (!start) { + for (i = 0; i < j; i++) { + if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)) { + goto err; + } + } + } + + // wvalue will be an odd number < 2^window + if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx)) { + goto err; + } + + // move the 'window' down further + wstart -= wend + 1; + start = 0; + if (wstart < 0) { + break; + } + } + ret = 1; + +err: + BN_CTX_end(ctx); + BN_RECP_CTX_free(&recp); + return ret; +} + +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); + } + + return mod_exp_recp(r, a, p, m, ctx); +} + +int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont) { + 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; + } + + int bits = BN_num_bits(p); + if (bits == 0) { + // x**0 mod 1 is still zero. + if (BN_abs_is_word(m, 1)) { + BN_zero(rr); + return 1; + } + return BN_one(rr); + } + + int ret = 0; + BIGNUM *val[TABLE_SIZE]; + BN_MONT_CTX *new_mont = NULL; + + BN_CTX_start(ctx); + BIGNUM *r = BN_CTX_get(ctx); + val[0] = BN_CTX_get(ctx); + 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_consttime(m, ctx); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // 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 + // 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], a, mont, ctx)) { + goto err; + } + if (window > 1) { + 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++) { + val[i] = BN_CTX_get(ctx); + if (val[i] == NULL || + !BN_mod_mul_montgomery(val[i], val[i - 1], d, 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 (;;) { + if (!BN_is_bit_set(p, wstart)) { + if (!r_is_one && !BN_mod_mul_montgomery(r, r, r, mont, ctx)) { + goto err; + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a set bit. Find the largest window we can use. + int wvalue = 1; + int wsize = 0; + for (int i = 1; i < window && i <= wstart; i++) { + if (BN_is_bit_set(p, wstart - i)) { + wvalue <<= (i - wsize); + wvalue |= 1; + wsize = i; + } + } + + // Shift |r| to the end of the window. + if (!r_is_one) { + for (int i = 0; i < wsize + 1; i++) { + if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) { + goto err; + } + } + } + + assert(wvalue & 1); + assert(wvalue < (1 << window)); + 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; + } + + r_is_one = 0; + if (wstart == wsize) { + break; + } + 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; + } + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + BN_CTX_end(ctx); + return ret; +} + +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(); + } + 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 (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 + // 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. + unsigned window = BN_window_bits_for_exponent_size(bits); + if (window > TABLE_BITS_SMALL) { + window = TABLE_BITS_SMALL; // Tolerate excessively large |p|. + } + BN_ULONG val[TABLE_SIZE_SMALL][BN_SMALL_MAX_WORDS]; + OPENSSL_memcpy(val[0], a, num * sizeof(BN_ULONG)); + if (window > 1) { + BN_ULONG d[BN_SMALL_MAX_WORDS]; + bn_mod_mul_montgomery_small(d, val[0], val[0], num, mont); + for (unsigned i = 1; i < 1u << (window - 1); i++) { + bn_mod_mul_montgomery_small(val[i], val[i - 1], d, num, mont); + } + } + + // |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, r, r, num, mont); + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a set bit. Find the largest window we can use. + unsigned wvalue = 1; + unsigned wsize = 0; + for (unsigned i = 1; i < window && i <= wstart; i++) { + if (bn_is_bit_set_words(p, num_p, wstart - i)) { + wvalue <<= (i - wsize); + wvalue |= 1; + wsize = i; + } + } + + // Shift |r| to the end of the window. + if (!r_is_one) { + for (unsigned i = 0; i < wsize + 1; i++) { + bn_mod_mul_montgomery_small(r, r, r, num, mont); + } + } + + assert(wvalue & 1); + assert(wvalue < (1u << window)); + 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; + } + wstart -= wsize + 1; + } + + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); + OPENSSL_cleanse(val, sizeof(val)); +} + +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]; + 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; i++) { + if (p_minus_two[i]-- != 0) { + break; + } + } + } + + bn_mod_exp_mont_small(r, a, num, p_minus_two, num, mont); +} + +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, const BN_ULONG *table, int idx, + int window) { + if (!bn_wexpand(b, top)) { + return 0; + } + + 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; + } + } + + b->width = top; + return 1; +} + +#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK \ + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1) + +// Window sizes optimized for fixed window size modular exponentiation +// algorithm (BN_mod_exp_mont_consttime). +// +// To achieve the security goals of BN_mode_exp_mont_consttime, the maximum +// size of the window must not exceed +// log_2(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH). +// +// Window size thresholds are defined for cache line sizes of 32 and 64, cache +// line sizes where log_2(32)=5 and log_2(64)=6 respectively. A window size of +// 7 should only be used on processors that have a 128 byte or greater cache +// line size. +#if MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 64 + +#define BN_window_bits_for_ctime_exponent_size(b) \ + ((b) > 937 ? 6 : (b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1) +#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (6) + +#elif MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 32 + +#define BN_window_bits_for_ctime_exponent_size(b) \ + ((b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1) +#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (5) + +#endif + +// Given a pointer value, compute the next address that is a cache line +// multiple. +#define MOD_EXP_CTIME_ALIGN(x_) \ + ((unsigned char *)(x_) + \ + (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 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, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont) { + int i, ret = 0, window, wvalue; + BN_MONT_CTX *new_mont = NULL; + + int numPowers; + unsigned char *powerbufFree = NULL; + int powerbufLen = 0; + BN_ULONG *powerbuf = NULL; + BIGNUM tmp, am; + + 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. + int max_bits = p->width * BN_BITS2; + int bits = max_bits; + if (bits == 0) { + // x**0 mod 1 is still zero. + if (BN_abs_is_word(m, 1)) { + BN_zero(rr); + return 1; + } + return BN_one(rr); + } + + // Allocate a montgomery context if it was not supplied by the caller. + if (mont == NULL) { + new_mont = BN_MONT_CTX_new_consttime(m, ctx); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // Use the width in |mont->N|, rather than the copy in |m|. The assembly + // implementation assumes it can use |top| to size R. + int top = mont->N.width; + +#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], + storage); + rr->width = 16; + rr->neg = 0; + ret = 1; + goto err; + } +#endif + + // Get the window size to use with size of p. + window = BN_window_bits_for_ctime_exponent_size(bits); +#if defined(OPENSSL_BN_ASM_MONT5) + if (window >= 5) { + window = 5; // ~5% improvement for RSA2048 sign, and even for RSA4096 + // reserve space for mont->N.d[] copy + powerbufLen += top * sizeof(mont->N.d[0]); + } +#endif + + // Allocate a buffer large enough to hold all of the pre-computed + // powers of am, am itself and tmp. + numPowers = 1 << window; + powerbufLen += + sizeof(m->d[0]) * + (top * numPowers + ((2 * top) > numPowers ? (2 * top) : numPowers)); + +#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 (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); + } + OPENSSL_memset(powerbuf, 0, powerbufLen); + + // lay down tmp and am right after powers table + tmp.d = powerbuf + top * numPowers; + am.d = tmp.d + top; + tmp.width = am.width = 0; + tmp.dmax = am.dmax = top; + tmp.neg = am.neg = 0; + tmp.flags = am.flags = BN_FLG_STATIC_DATA; + + if (!bn_one_to_montgomery(&tmp, mont, ctx)) { + goto err; + } + + // prepare a^1 in Montgomery domain + assert(!a->neg); + assert(BN_ucmp(a, m) < 0); + if (!BN_to_montgomery(&am, a, mont, ctx)) { + goto err; + } + +#if defined(OPENSSL_BN_ASM_MONT5) + // This optimization uses ideas from http://eprint.iacr.org/2011/239, + // specifically optimization of cache-timing attack countermeasures + // and pre-computation optimization. + + // Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as + // 512-bit RSA is hardly relevant, we omit it to spare size... + if (window == 5 && top > 1) { + const BN_ULONG *n0 = mont->n0; + BN_ULONG *np; + + // BN_to_montgomery can contaminate words above .top + // [in BN_DEBUG[_DEBUG] build]... + for (i = am.width; i < top; i++) { + am.d[i] = 0; + } + for (i = tmp.width; i < top; i++) { + tmp.d[i] = 0; + } + + // copy mont->N.d[] to improve cache locality + for (np = am.d + top, i = 0; i < top; i++) { + np[i] = mont->N.d[i]; + } + + bn_scatter5(tmp.d, top, powerbuf, 0); + bn_scatter5(am.d, am.width, powerbuf, 1); + bn_mul_mont(tmp.d, am.d, am.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, 2); + + // same as above, but uses squaring for 1/2 of operations + for (i = 4; i < 32; i *= 2) { + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, i); + } + for (i = 3; i < 8; i += 2) { + int j; + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + for (j = 2 * i; j < 32; j *= 2) { + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, j); + } + } + for (; i < 16; i += 2) { + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, 2 * i); + } + for (; i < 32; i += 2) { + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + } + + bits--; + for (wvalue = 0, i = bits % 5; i >= 0; i--, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + bn_gather5(tmp.d, top, powerbuf, wvalue); + + // At this point |bits| is 4 mod 5 and at least -1. (|bits| is the first bit + // that has not been read yet.) + assert(bits >= -1 && (bits == -1 || bits % 5 == 4)); + + // Scan the exponent one window at a time starting from the most + // significant bits. + if (top & 7) { + while (bits >= 0) { + for (wvalue = 0, i = 0; i < 5; i++, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top, wvalue); + } + } else { + const uint8_t *p_bytes = (const uint8_t *)p->d; + assert(bits < max_bits); + // |p = 0| has been handled as a special case, so |max_bits| is at least + // one word. + assert(max_bits >= 64); + + // If the first bit to be read lands in the last byte, unroll the first + // iteration to avoid reading past the bounds of |p->d|. (After the first + // iteration, we are guaranteed to be past the last byte.) Note |bits| + // here is the top bit, inclusive. + if (bits - 4 >= max_bits - 8) { + // Read five bits from |bits-4| through |bits|, inclusive. + wvalue = p_bytes[p->width * BN_BYTES - 1]; + wvalue >>= (bits - 4) & 7; + wvalue &= 0x1f; + bits -= 5; + bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top, wvalue); + } + while (bits >= 0) { + // Read five bits from |bits-4| through |bits|, inclusive. + int first_bit = bits - 4; + uint16_t val; + OPENSSL_memcpy(&val, p_bytes + (first_bit >> 3), sizeof(val)); + val >>= first_bit & 7; + val &= 0x1f; + bits -= 5; + bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top, val); + } + } + + ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np, n0, top); + tmp.width = top; + if (ret) { + if (!BN_copy(rr, &tmp)) { + ret = 0; + } + goto err; // non-zero ret means it's not error + } + } else +#endif + { + copy_to_prebuf(&tmp, top, powerbuf, 0, window); + copy_to_prebuf(&am, top, powerbuf, 1, window); + + // If the window size is greater than 1, then calculate + // val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) + // (even powers could instead be computed as (a^(i/2))^2 + // to use the slight performance advantage of sqr over mul). + if (window > 1) { + if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx)) { + goto err; + } + + copy_to_prebuf(&tmp, top, powerbuf, 2, window); + + for (i = 3; i < numPowers; i++) { + // Calculate a^i = a^(i-1) * a + if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx)) { + goto err; + } + + copy_to_prebuf(&tmp, top, powerbuf, i, window); + } + } + + bits--; + for (wvalue = 0, i = bits % window; i >= 0; i--, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + if (!copy_from_prebuf(&tmp, top, powerbuf, wvalue, window)) { + goto err; + } + + // Scan the exponent one window at a time starting from the most + // significant bits. + while (bits >= 0) { + wvalue = 0; // The 'value' of the window + + // Scan the window, squaring the result as we go + for (i = 0; i < window; i++, bits--) { + if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) { + goto err; + } + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + + // Fetch the appropriate pre-computed value from the pre-buf + if (!copy_from_prebuf(&am, top, powerbuf, wvalue, window)) { + goto err; + } + + // Multiply the result into the intermediate result + if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx)) { + goto err; + } + } + } + + // Convert the final result from montgomery to standard format + if (!BN_from_montgomery(rr, &tmp, mont, ctx)) { + goto err; + } + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + if (powerbuf != NULL && powerbufFree == NULL) { + OPENSSL_cleanse(powerbuf, powerbufLen); + } + OPENSSL_free(powerbufFree); + return (ret); +} + +int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont) { + BIGNUM a_bignum; + BN_init(&a_bignum); + + 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; + } + + ret = BN_mod_exp_mont(rr, &a_bignum, p, m, ctx, mont); + +err: + BN_free(&a_bignum); + + return ret; +} + +#define TABLE_SIZE 32 + +int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, + BN_CTX *ctx, const BN_MONT_CTX *mont) { + BIGNUM tmp; + BN_init(&tmp); + + int ret = 0; + BN_MONT_CTX *new_mont = NULL; + + // 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); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // BN_mod_mul_montgomery removes one Montgomery factor, so passing one + // Montgomery-encoded and one non-Montgomery-encoded value gives a + // non-Montgomery-encoded result. + if (!BN_mod_exp_mont(rr, a1, p1, m, ctx, mont) || + !BN_mod_exp_mont(&tmp, a2, p2, m, ctx, mont) || + !BN_to_montgomery(rr, rr, mont, ctx) || + !BN_mod_mul_montgomery(rr, rr, &tmp, mont, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + BN_free(&tmp); + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back new file mode 100644 index 0000000..8d4a5c8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back @@ -0,0 +1,1288 @@ +/* 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-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 "internal.h" +#include "rsaz_exp.h" + + +int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { + int i, bits, ret = 0; + BIGNUM *v, *rr; + + BN_CTX_start(ctx); + if (r == a || r == p) { + rr = BN_CTX_get(ctx); + } else { + rr = r; + } + + v = BN_CTX_get(ctx); + if (rr == NULL || v == NULL) { + goto err; + } + + if (BN_copy(v, a) == NULL) { + goto err; + } + bits = BN_num_bits(p); + + if (BN_is_odd(p)) { + if (BN_copy(rr, a) == NULL) { + goto err; + } + } else { + if (!BN_one(rr)) { + goto err; + } + } + + for (i = 1; i < bits; i++) { + if (!BN_sqr(v, v, ctx)) { + goto err; + } + if (BN_is_bit_set(p, i)) { + if (!BN_mul(rr, rr, v, ctx)) { + goto err; + } + } + } + + if (r != rr && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +typedef struct bn_recp_ctx_st { + BIGNUM N; // the divisor + BIGNUM Nr; // the reciprocal + int num_bits; + int shift; + int flags; +} BN_RECP_CTX; + +static void BN_RECP_CTX_init(BN_RECP_CTX *recp) { + BN_init(&recp->N); + BN_init(&recp->Nr); + recp->num_bits = 0; + recp->shift = 0; + recp->flags = 0; +} + +static void BN_RECP_CTX_free(BN_RECP_CTX *recp) { + if (recp == NULL) { + return; + } + + BN_free(&recp->N); + BN_free(&recp->Nr); +} + +static int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx) { + if (!BN_copy(&(recp->N), d)) { + return 0; + } + BN_zero(&recp->Nr); + recp->num_bits = BN_num_bits(d); + recp->shift = 0; + + return 1; +} + +// len is the expected size of the result We actually calculate with an extra +// word of precision, so we can do faster division if the remainder is not +// required. +// r := 2^len / m +static int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx) { + int ret = -1; + BIGNUM *t; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + + if (!BN_set_bit(t, len)) { + goto err; + } + + if (!BN_div(r, NULL, t, m, ctx)) { + goto err; + } + + ret = len; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx) { + int i, j, ret = 0; + BIGNUM *a, *b, *d, *r; + + BN_CTX_start(ctx); + a = BN_CTX_get(ctx); + b = BN_CTX_get(ctx); + if (dv != NULL) { + d = dv; + } else { + d = BN_CTX_get(ctx); + } + + if (rem != NULL) { + r = rem; + } else { + r = BN_CTX_get(ctx); + } + + if (a == NULL || b == NULL || d == NULL || r == NULL) { + goto err; + } + + if (BN_ucmp(m, &recp->N) < 0) { + BN_zero(d); + if (!BN_copy(r, m)) { + goto err; + } + BN_CTX_end(ctx); + return 1; + } + + // We want the remainder + // Given input of ABCDEF / ab + // we need multiply ABCDEF by 3 digests of the reciprocal of ab + + // i := max(BN_num_bits(m), 2*BN_num_bits(N)) + i = BN_num_bits(m); + j = recp->num_bits << 1; + if (j > i) { + i = j; + } + + // Nr := round(2^i / N) + if (i != recp->shift) { + recp->shift = + BN_reciprocal(&(recp->Nr), &(recp->N), i, + ctx); // BN_reciprocal returns i, or -1 for an error + } + + if (recp->shift == -1) { + goto err; + } + + // d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - + // BN_num_bits(N)))| + // = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - + // BN_num_bits(N)))| + // <= |(m / 2^BN_num_bits(N)) * (2^i / N) * (2^BN_num_bits(N) / 2^i)| + // = |m/N| + if (!BN_rshift(a, m, recp->num_bits)) { + goto err; + } + if (!BN_mul(b, a, &(recp->Nr), ctx)) { + goto err; + } + if (!BN_rshift(d, b, i - recp->num_bits)) { + goto err; + } + d->neg = 0; + + if (!BN_mul(b, &(recp->N), d, ctx)) { + goto err; + } + if (!BN_usub(r, m, b)) { + goto err; + } + r->neg = 0; + + j = 0; + while (BN_ucmp(r, &(recp->N)) >= 0) { + if (j++ > 2) { + OPENSSL_PUT_ERROR(BN, BN_R_BAD_RECIPROCAL); + goto err; + } + if (!BN_usub(r, r, &(recp->N))) { + goto err; + } + if (!BN_add_word(d, 1)) { + goto err; + } + } + + r->neg = BN_is_zero(r) ? 0 : m->neg; + d->neg = m->neg ^ recp->N.neg; + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp, BN_CTX *ctx) { + int ret = 0; + BIGNUM *a; + const BIGNUM *ca; + + BN_CTX_start(ctx); + a = BN_CTX_get(ctx); + if (a == NULL) { + goto err; + } + + if (y != NULL) { + if (x == y) { + if (!BN_sqr(a, x, ctx)) { + goto err; + } + } else { + if (!BN_mul(a, x, y, ctx)) { + goto err; + } + } + ca = a; + } else { + ca = x; // Just do the mod + } + + ret = BN_div_recp(NULL, r, ca, recp, ctx); + +err: + BN_CTX_end(ctx); + return ret; +} + +// BN_window_bits_for_exponent_size returns sliding window size for mod_exp with +// a |b| bit exponent. +// +// For window size 'w' (w >= 2) and a random 'b' bits exponent, the number of +// multiplications is a constant plus on average +// +// 2^(w-1) + (b-w)/(w+1); +// +// here 2^(w-1) is for precomputing the table (we actually need entries only +// for windows that have the lowest bit set), and (b-w)/(w+1) is an +// approximation for the expected number of w-bit windows, not counting the +// first one. +// +// Thus we should use +// +// w >= 6 if b > 671 +// w = 5 if 671 > b > 239 +// w = 4 if 239 > b > 79 +// w = 3 if 79 > b > 23 +// w <= 2 if 23 > b +// +// (with draws in between). Very small exponents are often selected +// with low Hamming weight, so we use w = 1 for b <= 23. +static int BN_window_bits_for_exponent_size(int b) { + if (b > 671) { + return 6; + } + if (b > 239) { + return 5; + } + if (b > 79) { + return 4; + } + if (b > 23) { + return 3; + } + return 1; +} + +// TABLE_SIZE is the maximum precomputation table size for *variable* sliding +// windows. This must be 2^(max_window - 1), where max_window is the largest +// value returned from |BN_window_bits_for_exponent_size|. +#define TABLE_SIZE 32 + +// TABLE_BITS_SMALL is the smallest value returned from +// |BN_window_bits_for_exponent_size| when |b| is at most |BN_BITS2| * +// |BN_SMALL_MAX_WORDS| words. +#define TABLE_BITS_SMALL 5 + +// TABLE_SIZE_SMALL is the same as |TABLE_SIZE|, but when |b| is at most +// |BN_BITS2| * |BN_SMALL_MAX_WORDS|. +#define TABLE_SIZE_SMALL (1 << (TABLE_BITS_SMALL - 1)) + +static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx) { + 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; + + // This function is only called on even moduli. + assert(!BN_is_odd(m)); + + int bits = BN_num_bits(p); + if (bits == 0) { + return BN_one(r); + } + + BN_CTX_start(ctx); + aa = BN_CTX_get(ctx); + val[0] = BN_CTX_get(ctx); + if (!aa || !val[0]) { + goto err; + } + + BN_RECP_CTX_init(&recp); + if (m->neg) { + // ignore sign of 'm' + if (!BN_copy(aa, m)) { + goto err; + } + aa->neg = 0; + if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0) { + goto err; + } + } else { + if (BN_RECP_CTX_set(&recp, m, ctx) <= 0) { + goto err; + } + } + + if (!BN_nnmod(val[0], a, m, ctx)) { + goto err; // 1 + } + if (BN_is_zero(val[0])) { + BN_zero(r); + ret = 1; + goto err; + } + + window = BN_window_bits_for_exponent_size(bits); + if (window > 1) { + if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx)) { + goto err; // 2 + } + j = 1 << (window - 1); + for (i = 1; i < j; i++) { + if (((val[i] = BN_CTX_get(ctx)) == NULL) || + !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx)) { + goto err; + } + } + } + + start = 1; // This is used to avoid multiplication etc + // when there is only the value '1' in the + // buffer. + wstart = bits - 1; // The top bit of the window + + if (!BN_one(r)) { + goto err; + } + + for (;;) { + int wvalue; // The 'value' of the window + int wend; // The bottom bit of the window + + if (!BN_is_bit_set(p, wstart)) { + if (!start) { + if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)) { + goto err; + } + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a 'set' bit, we now need to work out + // how bit a window to do. To do this we need to scan + // forward until the last set bit before the end of the + // window + wvalue = 1; + wend = 0; + for (i = 1; i < window; i++) { + if (wstart - i < 0) { + break; + } + if (BN_is_bit_set(p, wstart - i)) { + wvalue <<= (i - wend); + wvalue |= 1; + wend = i; + } + } + + // wend is the size of the current window + j = wend + 1; + // add the 'bytes above' + if (!start) { + for (i = 0; i < j; i++) { + if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)) { + goto err; + } + } + } + + // wvalue will be an odd number < 2^window + if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx)) { + goto err; + } + + // move the 'window' down further + wstart -= wend + 1; + start = 0; + if (wstart < 0) { + break; + } + } + ret = 1; + +err: + BN_CTX_end(ctx); + BN_RECP_CTX_free(&recp); + return ret; +} + +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); + } + + return mod_exp_recp(r, a, p, m, ctx); +} + +int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont) { + 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; + } + + int bits = BN_num_bits(p); + if (bits == 0) { + // x**0 mod 1 is still zero. + if (BN_abs_is_word(m, 1)) { + BN_zero(rr); + return 1; + } + return BN_one(rr); + } + + int ret = 0; + BIGNUM *val[TABLE_SIZE]; + BN_MONT_CTX *new_mont = NULL; + + BN_CTX_start(ctx); + BIGNUM *r = BN_CTX_get(ctx); + val[0] = BN_CTX_get(ctx); + 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_consttime(m, ctx); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // 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 + // 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], a, mont, ctx)) { + goto err; + } + if (window > 1) { + 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++) { + val[i] = BN_CTX_get(ctx); + if (val[i] == NULL || + !BN_mod_mul_montgomery(val[i], val[i - 1], d, 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 (;;) { + if (!BN_is_bit_set(p, wstart)) { + if (!r_is_one && !BN_mod_mul_montgomery(r, r, r, mont, ctx)) { + goto err; + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a set bit. Find the largest window we can use. + int wvalue = 1; + int wsize = 0; + for (int i = 1; i < window && i <= wstart; i++) { + if (BN_is_bit_set(p, wstart - i)) { + wvalue <<= (i - wsize); + wvalue |= 1; + wsize = i; + } + } + + // Shift |r| to the end of the window. + if (!r_is_one) { + for (int i = 0; i < wsize + 1; i++) { + if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) { + goto err; + } + } + } + + assert(wvalue & 1); + assert(wvalue < (1 << window)); + 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; + } + + r_is_one = 0; + if (wstart == wsize) { + break; + } + 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; + } + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + BN_CTX_end(ctx); + return ret; +} + +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(); + } + 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 (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 + // 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. + unsigned window = BN_window_bits_for_exponent_size(bits); + if (window > TABLE_BITS_SMALL) { + window = TABLE_BITS_SMALL; // Tolerate excessively large |p|. + } + BN_ULONG val[TABLE_SIZE_SMALL][BN_SMALL_MAX_WORDS]; + OPENSSL_memcpy(val[0], a, num * sizeof(BN_ULONG)); + if (window > 1) { + BN_ULONG d[BN_SMALL_MAX_WORDS]; + bn_mod_mul_montgomery_small(d, val[0], val[0], num, mont); + for (unsigned i = 1; i < 1u << (window - 1); i++) { + bn_mod_mul_montgomery_small(val[i], val[i - 1], d, num, mont); + } + } + + // |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, r, r, num, mont); + } + if (wstart == 0) { + break; + } + wstart--; + continue; + } + + // We now have wstart on a set bit. Find the largest window we can use. + unsigned wvalue = 1; + unsigned wsize = 0; + for (unsigned i = 1; i < window && i <= wstart; i++) { + if (bn_is_bit_set_words(p, num_p, wstart - i)) { + wvalue <<= (i - wsize); + wvalue |= 1; + wsize = i; + } + } + + // Shift |r| to the end of the window. + if (!r_is_one) { + for (unsigned i = 0; i < wsize + 1; i++) { + bn_mod_mul_montgomery_small(r, r, r, num, mont); + } + } + + assert(wvalue & 1); + assert(wvalue < (1u << window)); + 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; + } + wstart -= wsize + 1; + } + + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); + OPENSSL_cleanse(val, sizeof(val)); +} + +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]; + 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; i++) { + if (p_minus_two[i]-- != 0) { + break; + } + } + } + + bn_mod_exp_mont_small(r, a, num, p_minus_two, num, mont); +} + +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, const BN_ULONG *table, int idx, + int window) { + if (!bn_wexpand(b, top)) { + return 0; + } + + 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; + } + } + + b->width = top; + return 1; +} + +#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK \ + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1) + +// Window sizes optimized for fixed window size modular exponentiation +// algorithm (BN_mod_exp_mont_consttime). +// +// To achieve the security goals of BN_mode_exp_mont_consttime, the maximum +// size of the window must not exceed +// log_2(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH). +// +// Window size thresholds are defined for cache line sizes of 32 and 64, cache +// line sizes where log_2(32)=5 and log_2(64)=6 respectively. A window size of +// 7 should only be used on processors that have a 128 byte or greater cache +// line size. +#if MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 64 + +#define BN_window_bits_for_ctime_exponent_size(b) \ + ((b) > 937 ? 6 : (b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1) +#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (6) + +#elif MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 32 + +#define BN_window_bits_for_ctime_exponent_size(b) \ + ((b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1) +#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (5) + +#endif + +// Given a pointer value, compute the next address that is a cache line +// multiple. +#define MOD_EXP_CTIME_ALIGN(x_) \ + ((unsigned char *)(x_) + \ + (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 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, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont) { + int i, ret = 0, window, wvalue; + BN_MONT_CTX *new_mont = NULL; + + int numPowers; + unsigned char *powerbufFree = NULL; + int powerbufLen = 0; + BN_ULONG *powerbuf = NULL; + BIGNUM tmp, am; + + 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. + int max_bits = p->width * BN_BITS2; + int bits = max_bits; + if (bits == 0) { + // x**0 mod 1 is still zero. + if (BN_abs_is_word(m, 1)) { + BN_zero(rr); + return 1; + } + return BN_one(rr); + } + + // Allocate a montgomery context if it was not supplied by the caller. + if (mont == NULL) { + new_mont = BN_MONT_CTX_new_consttime(m, ctx); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // Use the width in |mont->N|, rather than the copy in |m|. The assembly + // implementation assumes it can use |top| to size R. + int top = mont->N.width; + +#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], + storage); + rr->width = 16; + rr->neg = 0; + ret = 1; + goto err; + } +#endif + + // Get the window size to use with size of p. + window = BN_window_bits_for_ctime_exponent_size(bits); +#if defined(OPENSSL_BN_ASM_MONT5) + if (window >= 5) { + window = 5; // ~5% improvement for RSA2048 sign, and even for RSA4096 + // reserve space for mont->N.d[] copy + powerbufLen += top * sizeof(mont->N.d[0]); + } +#endif + + // Allocate a buffer large enough to hold all of the pre-computed + // powers of am, am itself and tmp. + numPowers = 1 << window; + powerbufLen += + sizeof(m->d[0]) * + (top * numPowers + ((2 * top) > numPowers ? (2 * top) : numPowers)); + +#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 (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); + } + OPENSSL_memset(powerbuf, 0, powerbufLen); + + // lay down tmp and am right after powers table + tmp.d = powerbuf + top * numPowers; + am.d = tmp.d + top; + tmp.width = am.width = 0; + tmp.dmax = am.dmax = top; + tmp.neg = am.neg = 0; + tmp.flags = am.flags = BN_FLG_STATIC_DATA; + + if (!bn_one_to_montgomery(&tmp, mont, ctx)) { + goto err; + } + + // prepare a^1 in Montgomery domain + assert(!a->neg); + assert(BN_ucmp(a, m) < 0); + if (!BN_to_montgomery(&am, a, mont, ctx)) { + goto err; + } + +#if defined(OPENSSL_BN_ASM_MONT5) + // This optimization uses ideas from http://eprint.iacr.org/2011/239, + // specifically optimization of cache-timing attack countermeasures + // and pre-computation optimization. + + // Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as + // 512-bit RSA is hardly relevant, we omit it to spare size... + if (window == 5 && top > 1) { + const BN_ULONG *n0 = mont->n0; + BN_ULONG *np; + + // BN_to_montgomery can contaminate words above .top + // [in BN_DEBUG[_DEBUG] build]... + for (i = am.width; i < top; i++) { + am.d[i] = 0; + } + for (i = tmp.width; i < top; i++) { + tmp.d[i] = 0; + } + + // copy mont->N.d[] to improve cache locality + for (np = am.d + top, i = 0; i < top; i++) { + np[i] = mont->N.d[i]; + } + + bn_scatter5(tmp.d, top, powerbuf, 0); + bn_scatter5(am.d, am.width, powerbuf, 1); + bn_mul_mont(tmp.d, am.d, am.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, 2); + + // same as above, but uses squaring for 1/2 of operations + for (i = 4; i < 32; i *= 2) { + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, i); + } + for (i = 3; i < 8; i += 2) { + int j; + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + for (j = 2 * i; j < 32; j *= 2) { + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, j); + } + } + for (; i < 16; i += 2) { + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_scatter5(tmp.d, top, powerbuf, 2 * i); + } + for (; i < 32; i += 2) { + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); + bn_scatter5(tmp.d, top, powerbuf, i); + } + + bits--; + for (wvalue = 0, i = bits % 5; i >= 0; i--, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + bn_gather5(tmp.d, top, powerbuf, wvalue); + + // At this point |bits| is 4 mod 5 and at least -1. (|bits| is the first bit + // that has not been read yet.) + assert(bits >= -1 && (bits == -1 || bits % 5 == 4)); + + // Scan the exponent one window at a time starting from the most + // significant bits. + if (top & 7) { + while (bits >= 0) { + for (wvalue = 0, i = 0; i < 5; i++, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); + bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top, wvalue); + } + } else { + const uint8_t *p_bytes = (const uint8_t *)p->d; + assert(bits < max_bits); + // |p = 0| has been handled as a special case, so |max_bits| is at least + // one word. + assert(max_bits >= 64); + + // If the first bit to be read lands in the last byte, unroll the first + // iteration to avoid reading past the bounds of |p->d|. (After the first + // iteration, we are guaranteed to be past the last byte.) Note |bits| + // here is the top bit, inclusive. + if (bits - 4 >= max_bits - 8) { + // Read five bits from |bits-4| through |bits|, inclusive. + wvalue = p_bytes[p->width * BN_BYTES - 1]; + wvalue >>= (bits - 4) & 7; + wvalue &= 0x1f; + bits -= 5; + bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top, wvalue); + } + while (bits >= 0) { + // Read five bits from |bits-4| through |bits|, inclusive. + int first_bit = bits - 4; + uint16_t val; + OPENSSL_memcpy(&val, p_bytes + (first_bit >> 3), sizeof(val)); + val >>= first_bit & 7; + val &= 0x1f; + bits -= 5; + bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top, val); + } + } + + ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np, n0, top); + tmp.width = top; + if (ret) { + if (!BN_copy(rr, &tmp)) { + ret = 0; + } + goto err; // non-zero ret means it's not error + } + } else +#endif + { + copy_to_prebuf(&tmp, top, powerbuf, 0, window); + copy_to_prebuf(&am, top, powerbuf, 1, window); + + // If the window size is greater than 1, then calculate + // val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) + // (even powers could instead be computed as (a^(i/2))^2 + // to use the slight performance advantage of sqr over mul). + if (window > 1) { + if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx)) { + goto err; + } + + copy_to_prebuf(&tmp, top, powerbuf, 2, window); + + for (i = 3; i < numPowers; i++) { + // Calculate a^i = a^(i-1) * a + if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx)) { + goto err; + } + + copy_to_prebuf(&tmp, top, powerbuf, i, window); + } + } + + bits--; + for (wvalue = 0, i = bits % window; i >= 0; i--, bits--) { + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + if (!copy_from_prebuf(&tmp, top, powerbuf, wvalue, window)) { + goto err; + } + + // Scan the exponent one window at a time starting from the most + // significant bits. + while (bits >= 0) { + wvalue = 0; // The 'value' of the window + + // Scan the window, squaring the result as we go + for (i = 0; i < window; i++, bits--) { + if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) { + goto err; + } + wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); + } + + // Fetch the appropriate pre-computed value from the pre-buf + if (!copy_from_prebuf(&am, top, powerbuf, wvalue, window)) { + goto err; + } + + // Multiply the result into the intermediate result + if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx)) { + goto err; + } + } + } + + // Convert the final result from montgomery to standard format + if (!BN_from_montgomery(rr, &tmp, mont, ctx)) { + goto err; + } + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + if (powerbuf != NULL && powerbufFree == NULL) { + OPENSSL_cleanse(powerbuf, powerbufLen); + } + OPENSSL_free(powerbufFree); + return (ret); +} + +int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont) { + BIGNUM a_bignum; + BN_init(&a_bignum); + + 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; + } + + ret = BN_mod_exp_mont(rr, &a_bignum, p, m, ctx, mont); + +err: + BN_free(&a_bignum); + + return ret; +} + +#define TABLE_SIZE 32 + +int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, + BN_CTX *ctx, const BN_MONT_CTX *mont) { + BIGNUM tmp; + BN_init(&tmp); + + int ret = 0; + BN_MONT_CTX *new_mont = NULL; + + // 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); + if (new_mont == NULL) { + goto err; + } + mont = new_mont; + } + + // BN_mod_mul_montgomery removes one Montgomery factor, so passing one + // Montgomery-encoded and one non-Montgomery-encoded value gives a + // non-Montgomery-encoded result. + if (!BN_mod_exp_mont(rr, a1, p1, m, ctx, mont) || + !BN_mod_exp_mont(&tmp, a2, p2, m, ctx, mont) || + !BN_to_montgomery(rr, rr, mont, ctx) || + !BN_mod_mul_montgomery(rr, rr, &tmp, mont, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_MONT_CTX_free(new_mont); + BN_free(&tmp); + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c new file mode 100644 index 0000000..258bea2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c.grpc_back new file mode 100644 index 0000000..bd0fa6f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c new file mode 100644 index 0000000..83615d5 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c.grpc_back new file mode 100644 index 0000000..30540e3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c new file mode 100644 index 0000000..7d0d0ef --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c @@ -0,0 +1,711 @@ +/* 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 "internal.h" + + +// This file has two other implementations: x86 assembly language in +// asm/bn-586.pl and x86_64 inline assembly in asm/x86_64-gcc.c. +#if defined(OPENSSL_NO_ASM) || \ + !(defined(OPENSSL_X86) || \ + (defined(OPENSSL_X86_64) && (defined(__GNUC__) || defined(__clang__)))) + +#ifdef BN_ULLONG +#define mul_add(r, a, w, c) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(w) * (a) + (r) + (c); \ + (r) = Lw(t); \ + (c) = Hw(t); \ + } while (0) + +#define mul(r, a, w, c) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(w) * (a) + (c); \ + (r) = Lw(t); \ + (c) = Hw(t); \ + } while (0) + +#define sqr(r0, r1, a) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(a) * (a); \ + (r0) = Lw(t); \ + (r1) = Hw(t); \ + } while (0) + +#else + +#define mul_add(r, a, w, c) \ + do { \ + BN_ULONG high, low, ret, tmp = (a); \ + ret = (r); \ + BN_UMULT_LOHI(low, high, w, tmp); \ + ret += (c); \ + (c) = (ret < (c)) ? 1 : 0; \ + (c) += high; \ + ret += low; \ + (c) += (ret < low) ? 1 : 0; \ + (r) = ret; \ + } while (0) + +#define mul(r, a, w, c) \ + do { \ + BN_ULONG high, low, ret, ta = (a); \ + BN_UMULT_LOHI(low, high, w, ta); \ + ret = low + (c); \ + (c) = high; \ + (c) += (ret < low) ? 1 : 0; \ + (r) = ret; \ + } while (0) + +#define sqr(r0, r1, a) \ + do { \ + BN_ULONG tmp = (a); \ + BN_UMULT_LOHI(r0, r1, tmp, tmp); \ + } while (0) + +#endif // !BN_ULLONG + +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul_add(rp[0], ap[0], w, c1); + mul_add(rp[1], ap[1], w, c1); + mul_add(rp[2], ap[2], w, c1); + mul_add(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + + while (num) { + mul_add(rp[0], ap[0], w, c1); + ap++; + rp++; + num--; + } + + return c1; +} + +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul(rp[0], ap[0], w, c1); + mul(rp[1], ap[1], w, c1); + mul(rp[2], ap[2], w, c1); + mul(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + while (num) { + mul(rp[0], ap[0], w, c1); + ap++; + rp++; + num--; + } + return c1; +} + +void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n) { + if (n == 0) { + return; + } + + while (n & ~3) { + sqr(r[0], r[1], a[0]); + sqr(r[2], r[3], a[1]); + sqr(r[4], r[5], a[2]); + sqr(r[6], r[7], a[3]); + a += 4; + r += 8; + n -= 4; + } + while (n) { + sqr(r[0], r[1], a[0]); + a++; + r += 2; + n--; + } +} + +#ifdef BN_ULLONG +BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULLONG ll = 0; + + if (n == 0) { + return 0; + } + + while (n & ~3) { + ll += (BN_ULLONG)a[0] + b[0]; + r[0] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[1] + b[1]; + r[1] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[2] + b[2]; + r[2] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[3] + b[3]; + r[3] = (BN_ULONG)ll; + ll >>= BN_BITS2; + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + ll += (BN_ULLONG)a[0] + b[0]; + r[0] = (BN_ULONG)ll; + ll >>= BN_BITS2; + a++; + b++; + r++; + n--; + } + return (BN_ULONG)ll; +} + +#else // !BN_ULLONG + +BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULONG c, l, t; + + if (n == 0) { + return (BN_ULONG)0; + } + + c = 0; + while (n & ~3) { + t = a[0]; + t += c; + c = (t < c); + l = t + b[0]; + c += (l < t); + r[0] = l; + t = a[1]; + t += c; + c = (t < c); + l = t + b[1]; + c += (l < t); + r[1] = l; + t = a[2]; + t += c; + c = (t < c); + l = t + b[2]; + c += (l < t); + r[2] = l; + t = a[3]; + t += c; + c = (t < c); + l = t + b[3]; + c += (l < t); + r[3] = l; + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + t = a[0]; + t += c; + c = (t < c); + l = t + b[0]; + c += (l < t); + r[0] = l; + a++; + b++; + r++; + n--; + } + return (BN_ULONG)c; +} + +#endif // !BN_ULLONG + +BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULONG t1, t2; + int c = 0; + + if (n == 0) { + return (BN_ULONG)0; + } + + while (n & ~3) { + t1 = a[0]; + t2 = b[0]; + r[0] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[1]; + t2 = b[1]; + r[1] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[2]; + t2 = b[2]; + r[2] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[3]; + t2 = b[3]; + r[3] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + t1 = a[0]; + t2 = b[0]; + r[0] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + a++; + b++; + r++; + n--; + } + return c; +} + +// mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) +// mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) +// sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) +// sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) + +#ifdef BN_ULLONG + +// Keep in mind that additions to multiplication result can not overflow, +// because its high half cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a) * (b); \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += (hi); \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a) * (b); \ + BN_ULLONG tt = t + (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(tt); \ + hi = (BN_ULONG)Hw(tt); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a)[i] * (a)[i]; \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +#else + +// Keep in mind that additions to hi can not overflow, because the high word of +// a multiplication result cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a), tb = (b); \ + BN_ULONG lo, hi; \ + BN_UMULT_LOHI(lo, hi, ta, tb); \ + (c0) += lo; \ + hi += ((c0) < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a), tb = (b); \ + BN_ULONG lo, hi, tt; \ + BN_UMULT_LOHI(lo, hi, ta, tb); \ + (c0) += lo; \ + tt = hi + (((c0) < lo) ? 1 : 0); \ + (c1) += tt; \ + (c2) += ((c1) < tt) ? 1 : 0; \ + (c0) += lo; \ + hi += (c0 < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a)[i]; \ + BN_ULONG lo, hi; \ + BN_UMULT_LOHI(lo, hi, ta, ta); \ + (c0) += lo; \ + hi += (c0 < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +#endif // !BN_ULLONG + +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[4], b[0], c2, c3, c1); + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + mul_add_c(a[0], b[4], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[0], b[5], c3, c1, c2); + mul_add_c(a[1], b[4], c3, c1, c2); + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + mul_add_c(a[4], b[1], c3, c1, c2); + mul_add_c(a[5], b[0], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[6], b[0], c1, c2, c3); + mul_add_c(a[5], b[1], c1, c2, c3); + mul_add_c(a[4], b[2], c1, c2, c3); + mul_add_c(a[3], b[3], c1, c2, c3); + mul_add_c(a[2], b[4], c1, c2, c3); + mul_add_c(a[1], b[5], c1, c2, c3); + mul_add_c(a[0], b[6], c1, c2, c3); + r[6] = c1; + c1 = 0; + mul_add_c(a[0], b[7], c2, c3, c1); + mul_add_c(a[1], b[6], c2, c3, c1); + mul_add_c(a[2], b[5], c2, c3, c1); + mul_add_c(a[3], b[4], c2, c3, c1); + mul_add_c(a[4], b[3], c2, c3, c1); + mul_add_c(a[5], b[2], c2, c3, c1); + mul_add_c(a[6], b[1], c2, c3, c1); + mul_add_c(a[7], b[0], c2, c3, c1); + r[7] = c2; + c2 = 0; + mul_add_c(a[7], b[1], c3, c1, c2); + mul_add_c(a[6], b[2], c3, c1, c2); + mul_add_c(a[5], b[3], c3, c1, c2); + mul_add_c(a[4], b[4], c3, c1, c2); + mul_add_c(a[3], b[5], c3, c1, c2); + mul_add_c(a[2], b[6], c3, c1, c2); + mul_add_c(a[1], b[7], c3, c1, c2); + r[8] = c3; + c3 = 0; + mul_add_c(a[2], b[7], c1, c2, c3); + mul_add_c(a[3], b[6], c1, c2, c3); + mul_add_c(a[4], b[5], c1, c2, c3); + mul_add_c(a[5], b[4], c1, c2, c3); + mul_add_c(a[6], b[3], c1, c2, c3); + mul_add_c(a[7], b[2], c1, c2, c3); + r[9] = c1; + c1 = 0; + mul_add_c(a[7], b[3], c2, c3, c1); + mul_add_c(a[6], b[4], c2, c3, c1); + mul_add_c(a[5], b[5], c2, c3, c1); + mul_add_c(a[4], b[6], c2, c3, c1); + mul_add_c(a[3], b[7], c2, c3, c1); + r[10] = c2; + c2 = 0; + mul_add_c(a[4], b[7], c3, c1, c2); + mul_add_c(a[5], b[6], c3, c1, c2); + mul_add_c(a[6], b[5], c3, c1, c2); + mul_add_c(a[7], b[4], c3, c1, c2); + r[11] = c3; + c3 = 0; + mul_add_c(a[7], b[5], c1, c2, c3); + mul_add_c(a[6], b[6], c1, c2, c3); + mul_add_c(a[5], b[7], c1, c2, c3); + r[12] = c1; + c1 = 0; + mul_add_c(a[6], b[7], c2, c3, c1); + mul_add_c(a[7], b[6], c2, c3, c1); + r[13] = c2; + c2 = 0; + mul_add_c(a[7], b[7], c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[3], b[3], c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + sqr_add_c2(a, 4, 0, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 5, 0, c3, c1, c2); + sqr_add_c2(a, 4, 1, c3, c1, c2); + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + sqr_add_c2(a, 4, 2, c1, c2, c3); + sqr_add_c2(a, 5, 1, c1, c2, c3); + sqr_add_c2(a, 6, 0, c1, c2, c3); + r[6] = c1; + c1 = 0; + sqr_add_c2(a, 7, 0, c2, c3, c1); + sqr_add_c2(a, 6, 1, c2, c3, c1); + sqr_add_c2(a, 5, 2, c2, c3, c1); + sqr_add_c2(a, 4, 3, c2, c3, c1); + r[7] = c2; + c2 = 0; + sqr_add_c(a, 4, c3, c1, c2); + sqr_add_c2(a, 5, 3, c3, c1, c2); + sqr_add_c2(a, 6, 2, c3, c1, c2); + sqr_add_c2(a, 7, 1, c3, c1, c2); + r[8] = c3; + c3 = 0; + sqr_add_c2(a, 7, 2, c1, c2, c3); + sqr_add_c2(a, 6, 3, c1, c2, c3); + sqr_add_c2(a, 5, 4, c1, c2, c3); + r[9] = c1; + c1 = 0; + sqr_add_c(a, 5, c2, c3, c1); + sqr_add_c2(a, 6, 4, c2, c3, c1); + sqr_add_c2(a, 7, 3, c2, c3, c1); + r[10] = c2; + c2 = 0; + sqr_add_c2(a, 7, 4, c3, c1, c2); + sqr_add_c2(a, 6, 5, c3, c1, c2); + r[11] = c3; + c3 = 0; + sqr_add_c(a, 6, c1, c2, c3); + sqr_add_c2(a, 7, 5, c1, c2, c3); + r[12] = c1; + c1 = 0; + sqr_add_c2(a, 7, 6, c2, c3, c1); + r[13] = c2; + c2 = 0; + sqr_add_c(a, 7, c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +#undef mul_add +#undef mul +#undef sqr +#undef mul_add_c +#undef mul_add_c2 +#undef sqr_add_c +#undef sqr_add_c2 + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c.grpc_back new file mode 100644 index 0000000..ee80a3c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c.grpc_back @@ -0,0 +1,711 @@ +/* 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 "internal.h" + + +// This file has two other implementations: x86 assembly language in +// asm/bn-586.pl and x86_64 inline assembly in asm/x86_64-gcc.c. +#if defined(OPENSSL_NO_ASM) || \ + !(defined(OPENSSL_X86) || \ + (defined(OPENSSL_X86_64) && (defined(__GNUC__) || defined(__clang__)))) + +#ifdef BN_ULLONG +#define mul_add(r, a, w, c) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(w) * (a) + (r) + (c); \ + (r) = Lw(t); \ + (c) = Hw(t); \ + } while (0) + +#define mul(r, a, w, c) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(w) * (a) + (c); \ + (r) = Lw(t); \ + (c) = Hw(t); \ + } while (0) + +#define sqr(r0, r1, a) \ + do { \ + BN_ULLONG t; \ + t = (BN_ULLONG)(a) * (a); \ + (r0) = Lw(t); \ + (r1) = Hw(t); \ + } while (0) + +#else + +#define mul_add(r, a, w, c) \ + do { \ + BN_ULONG high, low, ret, tmp = (a); \ + ret = (r); \ + BN_UMULT_LOHI(low, high, w, tmp); \ + ret += (c); \ + (c) = (ret < (c)) ? 1 : 0; \ + (c) += high; \ + ret += low; \ + (c) += (ret < low) ? 1 : 0; \ + (r) = ret; \ + } while (0) + +#define mul(r, a, w, c) \ + do { \ + BN_ULONG high, low, ret, ta = (a); \ + BN_UMULT_LOHI(low, high, w, ta); \ + ret = low + (c); \ + (c) = high; \ + (c) += (ret < low) ? 1 : 0; \ + (r) = ret; \ + } while (0) + +#define sqr(r0, r1, a) \ + do { \ + BN_ULONG tmp = (a); \ + BN_UMULT_LOHI(r0, r1, tmp, tmp); \ + } while (0) + +#endif // !BN_ULLONG + +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul_add(rp[0], ap[0], w, c1); + mul_add(rp[1], ap[1], w, c1); + mul_add(rp[2], ap[2], w, c1); + mul_add(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + + while (num) { + mul_add(rp[0], ap[0], w, c1); + ap++; + rp++; + num--; + } + + return c1; +} + +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w) { + BN_ULONG c1 = 0; + + if (num == 0) { + return c1; + } + + while (num & ~3) { + mul(rp[0], ap[0], w, c1); + mul(rp[1], ap[1], w, c1); + mul(rp[2], ap[2], w, c1); + mul(rp[3], ap[3], w, c1); + ap += 4; + rp += 4; + num -= 4; + } + while (num) { + mul(rp[0], ap[0], w, c1); + ap++; + rp++; + num--; + } + return c1; +} + +void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n) { + if (n == 0) { + return; + } + + while (n & ~3) { + sqr(r[0], r[1], a[0]); + sqr(r[2], r[3], a[1]); + sqr(r[4], r[5], a[2]); + sqr(r[6], r[7], a[3]); + a += 4; + r += 8; + n -= 4; + } + while (n) { + sqr(r[0], r[1], a[0]); + a++; + r += 2; + n--; + } +} + +#ifdef BN_ULLONG +BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULLONG ll = 0; + + if (n == 0) { + return 0; + } + + while (n & ~3) { + ll += (BN_ULLONG)a[0] + b[0]; + r[0] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[1] + b[1]; + r[1] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[2] + b[2]; + r[2] = (BN_ULONG)ll; + ll >>= BN_BITS2; + ll += (BN_ULLONG)a[3] + b[3]; + r[3] = (BN_ULONG)ll; + ll >>= BN_BITS2; + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + ll += (BN_ULLONG)a[0] + b[0]; + r[0] = (BN_ULONG)ll; + ll >>= BN_BITS2; + a++; + b++; + r++; + n--; + } + return (BN_ULONG)ll; +} + +#else // !BN_ULLONG + +BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULONG c, l, t; + + if (n == 0) { + return (BN_ULONG)0; + } + + c = 0; + while (n & ~3) { + t = a[0]; + t += c; + c = (t < c); + l = t + b[0]; + c += (l < t); + r[0] = l; + t = a[1]; + t += c; + c = (t < c); + l = t + b[1]; + c += (l < t); + r[1] = l; + t = a[2]; + t += c; + c = (t < c); + l = t + b[2]; + c += (l < t); + r[2] = l; + t = a[3]; + t += c; + c = (t < c); + l = t + b[3]; + c += (l < t); + r[3] = l; + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + t = a[0]; + t += c; + c = (t < c); + l = t + b[0]; + c += (l < t); + r[0] = l; + a++; + b++; + r++; + n--; + } + return (BN_ULONG)c; +} + +#endif // !BN_ULLONG + +BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t n) { + BN_ULONG t1, t2; + int c = 0; + + if (n == 0) { + return (BN_ULONG)0; + } + + while (n & ~3) { + t1 = a[0]; + t2 = b[0]; + r[0] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[1]; + t2 = b[1]; + r[1] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[2]; + t2 = b[2]; + r[2] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + t1 = a[3]; + t2 = b[3]; + r[3] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + a += 4; + b += 4; + r += 4; + n -= 4; + } + while (n) { + t1 = a[0]; + t2 = b[0]; + r[0] = t1 - t2 - c; + if (t1 != t2) { + c = (t1 < t2); + } + a++; + b++; + r++; + n--; + } + return c; +} + +// mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) +// mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) +// sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) +// sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) + +#ifdef BN_ULLONG + +// Keep in mind that additions to multiplication result can not overflow, +// because its high half cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a) * (b); \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += (hi); \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a) * (b); \ + BN_ULLONG tt = t + (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(tt); \ + hi = (BN_ULONG)Hw(tt); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG hi; \ + BN_ULLONG t = (BN_ULLONG)(a)[i] * (a)[i]; \ + t += (c0); /* no carry */ \ + (c0) = (BN_ULONG)Lw(t); \ + hi = (BN_ULONG)Hw(t); \ + (c1) += hi; \ + if ((c1) < hi) { \ + (c2)++; \ + } \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +#else + +// Keep in mind that additions to hi can not overflow, because the high word of +// a multiplication result cannot be all-ones. +#define mul_add_c(a, b, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a), tb = (b); \ + BN_ULONG lo, hi; \ + BN_UMULT_LOHI(lo, hi, ta, tb); \ + (c0) += lo; \ + hi += ((c0) < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define mul_add_c2(a, b, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a), tb = (b); \ + BN_ULONG lo, hi, tt; \ + BN_UMULT_LOHI(lo, hi, ta, tb); \ + (c0) += lo; \ + tt = hi + (((c0) < lo) ? 1 : 0); \ + (c1) += tt; \ + (c2) += ((c1) < tt) ? 1 : 0; \ + (c0) += lo; \ + hi += (c0 < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define sqr_add_c(a, i, c0, c1, c2) \ + do { \ + BN_ULONG ta = (a)[i]; \ + BN_ULONG lo, hi; \ + BN_UMULT_LOHI(lo, hi, ta, ta); \ + (c0) += lo; \ + hi += (c0 < lo) ? 1 : 0; \ + (c1) += hi; \ + (c2) += ((c1) < hi) ? 1 : 0; \ + } while (0) + +#define sqr_add_c2(a, i, j, c0, c1, c2) mul_add_c2((a)[i], (a)[j], c0, c1, c2) + +#endif // !BN_ULLONG + +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[4], b[0], c2, c3, c1); + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + mul_add_c(a[0], b[4], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[0], b[5], c3, c1, c2); + mul_add_c(a[1], b[4], c3, c1, c2); + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + mul_add_c(a[4], b[1], c3, c1, c2); + mul_add_c(a[5], b[0], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[6], b[0], c1, c2, c3); + mul_add_c(a[5], b[1], c1, c2, c3); + mul_add_c(a[4], b[2], c1, c2, c3); + mul_add_c(a[3], b[3], c1, c2, c3); + mul_add_c(a[2], b[4], c1, c2, c3); + mul_add_c(a[1], b[5], c1, c2, c3); + mul_add_c(a[0], b[6], c1, c2, c3); + r[6] = c1; + c1 = 0; + mul_add_c(a[0], b[7], c2, c3, c1); + mul_add_c(a[1], b[6], c2, c3, c1); + mul_add_c(a[2], b[5], c2, c3, c1); + mul_add_c(a[3], b[4], c2, c3, c1); + mul_add_c(a[4], b[3], c2, c3, c1); + mul_add_c(a[5], b[2], c2, c3, c1); + mul_add_c(a[6], b[1], c2, c3, c1); + mul_add_c(a[7], b[0], c2, c3, c1); + r[7] = c2; + c2 = 0; + mul_add_c(a[7], b[1], c3, c1, c2); + mul_add_c(a[6], b[2], c3, c1, c2); + mul_add_c(a[5], b[3], c3, c1, c2); + mul_add_c(a[4], b[4], c3, c1, c2); + mul_add_c(a[3], b[5], c3, c1, c2); + mul_add_c(a[2], b[6], c3, c1, c2); + mul_add_c(a[1], b[7], c3, c1, c2); + r[8] = c3; + c3 = 0; + mul_add_c(a[2], b[7], c1, c2, c3); + mul_add_c(a[3], b[6], c1, c2, c3); + mul_add_c(a[4], b[5], c1, c2, c3); + mul_add_c(a[5], b[4], c1, c2, c3); + mul_add_c(a[6], b[3], c1, c2, c3); + mul_add_c(a[7], b[2], c1, c2, c3); + r[9] = c1; + c1 = 0; + mul_add_c(a[7], b[3], c2, c3, c1); + mul_add_c(a[6], b[4], c2, c3, c1); + mul_add_c(a[5], b[5], c2, c3, c1); + mul_add_c(a[4], b[6], c2, c3, c1); + mul_add_c(a[3], b[7], c2, c3, c1); + r[10] = c2; + c2 = 0; + mul_add_c(a[4], b[7], c3, c1, c2); + mul_add_c(a[5], b[6], c3, c1, c2); + mul_add_c(a[6], b[5], c3, c1, c2); + mul_add_c(a[7], b[4], c3, c1, c2); + r[11] = c3; + c3 = 0; + mul_add_c(a[7], b[5], c1, c2, c3); + mul_add_c(a[6], b[6], c1, c2, c3); + mul_add_c(a[5], b[7], c1, c2, c3); + r[12] = c1; + c1 = 0; + mul_add_c(a[6], b[7], c2, c3, c1); + mul_add_c(a[7], b[6], c2, c3, c1); + r[13] = c2; + c2 = 0; + mul_add_c(a[7], b[7], c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + mul_add_c(a[0], b[0], c1, c2, c3); + r[0] = c1; + c1 = 0; + mul_add_c(a[0], b[1], c2, c3, c1); + mul_add_c(a[1], b[0], c2, c3, c1); + r[1] = c2; + c2 = 0; + mul_add_c(a[2], b[0], c3, c1, c2); + mul_add_c(a[1], b[1], c3, c1, c2); + mul_add_c(a[0], b[2], c3, c1, c2); + r[2] = c3; + c3 = 0; + mul_add_c(a[0], b[3], c1, c2, c3); + mul_add_c(a[1], b[2], c1, c2, c3); + mul_add_c(a[2], b[1], c1, c2, c3); + mul_add_c(a[3], b[0], c1, c2, c3); + r[3] = c1; + c1 = 0; + mul_add_c(a[3], b[1], c2, c3, c1); + mul_add_c(a[2], b[2], c2, c3, c1); + mul_add_c(a[1], b[3], c2, c3, c1); + r[4] = c2; + c2 = 0; + mul_add_c(a[2], b[3], c3, c1, c2); + mul_add_c(a[3], b[2], c3, c1, c2); + r[5] = c3; + c3 = 0; + mul_add_c(a[3], b[3], c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[8]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + sqr_add_c2(a, 4, 0, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 5, 0, c3, c1, c2); + sqr_add_c2(a, 4, 1, c3, c1, c2); + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + sqr_add_c2(a, 4, 2, c1, c2, c3); + sqr_add_c2(a, 5, 1, c1, c2, c3); + sqr_add_c2(a, 6, 0, c1, c2, c3); + r[6] = c1; + c1 = 0; + sqr_add_c2(a, 7, 0, c2, c3, c1); + sqr_add_c2(a, 6, 1, c2, c3, c1); + sqr_add_c2(a, 5, 2, c2, c3, c1); + sqr_add_c2(a, 4, 3, c2, c3, c1); + r[7] = c2; + c2 = 0; + sqr_add_c(a, 4, c3, c1, c2); + sqr_add_c2(a, 5, 3, c3, c1, c2); + sqr_add_c2(a, 6, 2, c3, c1, c2); + sqr_add_c2(a, 7, 1, c3, c1, c2); + r[8] = c3; + c3 = 0; + sqr_add_c2(a, 7, 2, c1, c2, c3); + sqr_add_c2(a, 6, 3, c1, c2, c3); + sqr_add_c2(a, 5, 4, c1, c2, c3); + r[9] = c1; + c1 = 0; + sqr_add_c(a, 5, c2, c3, c1); + sqr_add_c2(a, 6, 4, c2, c3, c1); + sqr_add_c2(a, 7, 3, c2, c3, c1); + r[10] = c2; + c2 = 0; + sqr_add_c2(a, 7, 4, c3, c1, c2); + sqr_add_c2(a, 6, 5, c3, c1, c2); + r[11] = c3; + c3 = 0; + sqr_add_c(a, 6, c1, c2, c3); + sqr_add_c2(a, 7, 5, c1, c2, c3); + r[12] = c1; + c1 = 0; + sqr_add_c2(a, 7, 6, c2, c3, c1); + r[13] = c2; + c2 = 0; + sqr_add_c(a, 7, c3, c1, c2); + r[14] = c3; + r[15] = c1; +} + +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]) { + BN_ULONG c1, c2, c3; + + c1 = 0; + c2 = 0; + c3 = 0; + sqr_add_c(a, 0, c1, c2, c3); + r[0] = c1; + c1 = 0; + sqr_add_c2(a, 1, 0, c2, c3, c1); + r[1] = c2; + c2 = 0; + sqr_add_c(a, 1, c3, c1, c2); + sqr_add_c2(a, 2, 0, c3, c1, c2); + r[2] = c3; + c3 = 0; + sqr_add_c2(a, 3, 0, c1, c2, c3); + sqr_add_c2(a, 2, 1, c1, c2, c3); + r[3] = c1; + c1 = 0; + sqr_add_c(a, 2, c2, c3, c1); + sqr_add_c2(a, 3, 1, c2, c3, c1); + r[4] = c2; + c2 = 0; + sqr_add_c2(a, 3, 2, c3, c1, c2); + r[5] = c3; + c3 = 0; + sqr_add_c(a, 3, c1, c2, c3); + r[6] = c1; + r[7] = c2; +} + +#undef mul_add +#undef mul +#undef sqr +#undef mul_add_c +#undef mul_add_c2 +#undef sqr_add_c +#undef sqr_add_c2 + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h new file mode 100644 index 0000000..547415a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h.grpc_back new file mode 100644 index 0000000..d58a2ac --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c new file mode 100644 index 0000000..8d52e56 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c @@ -0,0 +1,146 @@ +/* ==================================================================== + * Copyright (c) 1998-2000 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" + + +// least significant word +#define BN_lsw(n) (((n)->width == 0) ? (BN_ULONG) 0 : (n)->d[0]) + +int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + // In 'tab', only odd-indexed entries are relevant: + // For any odd BIGNUM n, + // tab[BN_lsw(n) & 7] + // is $(-1)^{(n^2-1)/8}$ (using TeX notation). + // Note that the sign of n does not matter. + static const int tab[8] = {0, 1, 0, -1, 0, -1, 0, 1}; + + // The Jacobi symbol is only defined for odd modulus. + if (!BN_is_odd(b)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return -2; + } + + // Require b be positive. + if (BN_is_negative(b)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return -2; + } + + int ret = -2; + BN_CTX_start(ctx); + BIGNUM *A = BN_CTX_get(ctx); + BIGNUM *B = BN_CTX_get(ctx); + if (B == NULL) { + goto end; + } + + if (!BN_copy(A, a) || + !BN_copy(B, b)) { + goto end; + } + + // Adapted from logic to compute the Kronecker symbol, originally implemented + // according to Henri Cohen, "A Course in Computational Algebraic Number + // Theory" (algorithm 1.4.10). + + ret = 1; + + while (1) { + // Cohen's step 3: + + // B is positive and odd + if (BN_is_zero(A)) { + ret = BN_is_one(B) ? ret : 0; + goto end; + } + + // now A is non-zero + int i = 0; + while (!BN_is_bit_set(A, i)) { + i++; + } + if (!BN_rshift(A, A, i)) { + ret = -2; + goto end; + } + if (i & 1) { + // i is odd + // multiply 'ret' by $(-1)^{(B^2-1)/8}$ + ret = ret * tab[BN_lsw(B) & 7]; + } + + // Cohen's step 4: + // multiply 'ret' by $(-1)^{(A-1)(B-1)/4}$ + if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2) { + ret = -ret; + } + + // (A, B) := (B mod |A|, |A|) + if (!BN_nnmod(B, B, A, ctx)) { + ret = -2; + goto end; + } + BIGNUM *tmp = A; + A = B; + B = tmp; + tmp->neg = 0; + } + +end: + BN_CTX_end(ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c.grpc_back new file mode 100644 index 0000000..d1a9d50 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c.grpc_back @@ -0,0 +1,146 @@ +/* ==================================================================== + * Copyright (c) 1998-2000 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" + + +// least significant word +#define BN_lsw(n) (((n)->width == 0) ? (BN_ULONG) 0 : (n)->d[0]) + +int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + // In 'tab', only odd-indexed entries are relevant: + // For any odd BIGNUM n, + // tab[BN_lsw(n) & 7] + // is $(-1)^{(n^2-1)/8}$ (using TeX notation). + // Note that the sign of n does not matter. + static const int tab[8] = {0, 1, 0, -1, 0, -1, 0, 1}; + + // The Jacobi symbol is only defined for odd modulus. + if (!BN_is_odd(b)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return -2; + } + + // Require b be positive. + if (BN_is_negative(b)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return -2; + } + + int ret = -2; + BN_CTX_start(ctx); + BIGNUM *A = BN_CTX_get(ctx); + BIGNUM *B = BN_CTX_get(ctx); + if (B == NULL) { + goto end; + } + + if (!BN_copy(A, a) || + !BN_copy(B, b)) { + goto end; + } + + // Adapted from logic to compute the Kronecker symbol, originally implemented + // according to Henri Cohen, "A Course in Computational Algebraic Number + // Theory" (algorithm 1.4.10). + + ret = 1; + + while (1) { + // Cohen's step 3: + + // B is positive and odd + if (BN_is_zero(A)) { + ret = BN_is_one(B) ? ret : 0; + goto end; + } + + // now A is non-zero + int i = 0; + while (!BN_is_bit_set(A, i)) { + i++; + } + if (!BN_rshift(A, A, i)) { + ret = -2; + goto end; + } + if (i & 1) { + // i is odd + // multiply 'ret' by $(-1)^{(B^2-1)/8}$ + ret = ret * tab[BN_lsw(B) & 7]; + } + + // Cohen's step 4: + // multiply 'ret' by $(-1)^{(A-1)(B-1)/4}$ + if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2) { + ret = -ret; + } + + // (A, B) := (B mod |A|, |A|) + if (!BN_nnmod(B, B, A, ctx)) { + ret = -2; + goto end; + } + BIGNUM *tmp = A; + A = B; + B = tmp; + tmp->neg = 0; + } + +end: + BN_CTX_end(ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c new file mode 100644 index 0000000..a6b00e2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c @@ -0,0 +1,502 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +BN_MONT_CTX *BN_MONT_CTX_new(void) { + BN_MONT_CTX *ret = OPENSSL_malloc(sizeof(BN_MONT_CTX)); + + if (ret == NULL) { + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BN_MONT_CTX)); + BN_init(&ret->RR); + BN_init(&ret->N); + + return ret; +} + +void BN_MONT_CTX_free(BN_MONT_CTX *mont) { + if (mont == NULL) { + return; + } + + BN_free(&mont->RR); + BN_free(&mont->N); + OPENSSL_free(mont); +} + +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, const BN_MONT_CTX *from) { + if (to == from) { + return to; + } + + if (!BN_copy(&to->RR, &from->RR) || + !BN_copy(&to->N, &from->N)) { + return NULL; + } + to->n0[0] = from->n0[0]; + to->n0[1] = from->n0[1]; + return to; +} + +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; + } + if (!BN_is_odd(mod)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return 0; + } + if (BN_is_negative(mod)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + // Save the modulus. + if (!BN_copy(&mont->N, mod)) { + OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); + return 0; + } + // |mont->N| is always stored minimally. Computing RR efficiently leaks the + // size of the modulus. While the modulus may be private in RSA (one of the + // primes), their sizes are public, so this is fine. + bn_set_minimal_width(&mont->N); + + // Find n0 such that n0 * N == -1 (mod r). + // + // Only certain BN_BITS2<=32 platforms actually make use of n0[1]. For the + // 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 + mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); +#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) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + return 0; + } + ctx = new_ctx; + } + + // Save RR = R**2 (mod N). R is the smallest power of 2**BN_BITS2 such that R + // > mod. Even though the assembly on some 32-bit platforms works with 64-bit + // values, using |BN_BITS2| here, rather than |BN_MONT_CTX_N0_LIMBS * + // 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; + 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; +} + +BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx) { + BN_MONT_CTX *mont = BN_MONT_CTX_new(); + if (mont == NULL || + !BN_MONT_CTX_set(mont, mod, ctx)) { + BN_MONT_CTX_free(mont); + return NULL; + } + 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); + BN_MONT_CTX *ctx = *pmont; + CRYPTO_MUTEX_unlock_read(lock); + + if (ctx) { + return 1; + } + + CRYPTO_MUTEX_lock_write(lock); + if (*pmont == NULL) { + *pmont = BN_MONT_CTX_new_for_modulus(mod, bn_ctx); + } + const int ok = *pmont != NULL; + CRYPTO_MUTEX_unlock_write(lock); + return ok; +} + +int BN_to_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + return BN_mod_mul_montgomery(ret, a, &mont->RR, mont, ctx); +} + +static int bn_from_montgomery_in_place(BN_ULONG *r, size_t num_r, BN_ULONG *a, + size_t num_a, const BN_MONT_CTX *mont) { + const BN_ULONG *n = mont->N.d; + size_t num_n = mont->N.width; + if (num_r != num_n || num_a != 2 * num_n) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + // Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On + // input, we had |r| < |n| * R, so now |r| < 2 * |n| * R. Note that |r| + // includes |carry| which is stored separately. + BN_ULONG n0 = mont->n0[0]; + BN_ULONG carry = 0; + for (size_t i = 0; i < num_n; i++) { + BN_ULONG v = bn_mul_add_words(a + i, n, num_n, a[i] * n0); + v += carry + a[i + num_n]; + carry |= (v != a[i + num_n]); + carry &= (v <= a[i + num_n]); + a[i + num_n] = v; + } + + // Shift |num_n| words to divide by R. We have |a| < 2 * |n|. Note that |a| + // includes |carry| which is stored separately. + a += num_n; + + // |a| thus requires at most one additional subtraction |n| to be reduced. + bn_reduce_once(r, a, carry, n, num_n); + return 1; +} + +static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, + const BN_MONT_CTX *mont) { + if (r->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + const BIGNUM *n = &mont->N; + if (n->width == 0) { + ret->width = 0; + return 1; + } + + int max = 2 * n->width; // carry is stored separately + if (!bn_resize_words(r, max) || + !bn_wexpand(ret, n->width)) { + return 0; + } + + ret->width = n->width; + ret->neg = 0; + return bn_from_montgomery_in_place(ret->d, ret->width, r->d, r->width, mont); +} + +int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + int ret = 0; + BIGNUM *t; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL || + !BN_copy(t, a)) { + goto err; + } + + ret = BN_from_montgomery_word(r, t, mont); + +err: + BN_CTX_end(ctx); + + return ret; +} + +int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx) { + // If the high bit of |n| is set, R = 2^(width*BN_BITS2) < 2 * |n|, so we + // compute R - |n| rather than perform Montgomery reduction. + const BIGNUM *n = &mont->N; + if (n->width > 0 && (n->d[n->width - 1] >> (BN_BITS2 - 1)) != 0) { + if (!bn_wexpand(r, n->width)) { + return 0; + } + r->d[0] = 0 - n->d[0]; + for (int i = 1; i < n->width; i++) { + r->d[i] = ~n->d[i]; + } + r->width = n->width; + r->neg = 0; + return 1; + } + + return BN_from_montgomery(r, &mont->RR, mont, ctx); +} + +static int bn_mod_mul_montgomery_fallback(BIGNUM *r, const BIGNUM *a, + const BIGNUM *b, + const BN_MONT_CTX *mont, + BN_CTX *ctx) { + int ret = 0; + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + if (a == b) { + if (!bn_sqr_consttime(tmp, a, ctx)) { + goto err; + } + } else { + if (!bn_mul_consttime(tmp, a, b, ctx)) { + goto err; + } + } + + // reduce from aRR to aR + if (!BN_from_montgomery_word(r, tmp, mont)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + if (a->neg || b->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + +#if defined(OPENSSL_BN_ASM_MONT) + // |bn_mul_mont| requires at least 128 bits of limbs, at least for x86. + int num = mont->N.width; + if (num >= (128 / BN_BITS2) && + a->width == num && + b->width == num) { + if (!bn_wexpand(r, num)) { + return 0; + } + if (!bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { + // The check above ensures this won't happen. + assert(0); + OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); + return 0; + } + r->neg = 0; + r->width = num; + return 1; + } +#endif + + return bn_mod_mul_montgomery_fallback(r, a, b, mont, ctx); +} + +int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont) { + return !BN_is_negative(bn) && + bn_fits_in_words(bn, mont->N.width); +} + +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); +} + +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]; + 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(); + } + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); +} + +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 >= (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; + } +#endif + + // Compute the product. + BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; + if (a == b) { + bn_sqr_small(tmp, 2 * num, a, num); + } else { + bn_mul_small(tmp, 2 * num, a, num, b, num); + } + + // 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back new file mode 100644 index 0000000..b6eaf6a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back @@ -0,0 +1,502 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +BN_MONT_CTX *BN_MONT_CTX_new(void) { + BN_MONT_CTX *ret = OPENSSL_malloc(sizeof(BN_MONT_CTX)); + + if (ret == NULL) { + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(BN_MONT_CTX)); + BN_init(&ret->RR); + BN_init(&ret->N); + + return ret; +} + +void BN_MONT_CTX_free(BN_MONT_CTX *mont) { + if (mont == NULL) { + return; + } + + BN_free(&mont->RR); + BN_free(&mont->N); + OPENSSL_free(mont); +} + +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, const BN_MONT_CTX *from) { + if (to == from) { + return to; + } + + if (!BN_copy(&to->RR, &from->RR) || + !BN_copy(&to->N, &from->N)) { + return NULL; + } + to->n0[0] = from->n0[0]; + to->n0[1] = from->n0[1]; + return to; +} + +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; + } + if (!BN_is_odd(mod)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return 0; + } + if (BN_is_negative(mod)) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + // Save the modulus. + if (!BN_copy(&mont->N, mod)) { + OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); + return 0; + } + // |mont->N| is always stored minimally. Computing RR efficiently leaks the + // size of the modulus. While the modulus may be private in RSA (one of the + // primes), their sizes are public, so this is fine. + bn_set_minimal_width(&mont->N); + + // Find n0 such that n0 * N == -1 (mod r). + // + // Only certain BN_BITS2<=32 platforms actually make use of n0[1]. For the + // 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 + mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); +#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) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + return 0; + } + ctx = new_ctx; + } + + // Save RR = R**2 (mod N). R is the smallest power of 2**BN_BITS2 such that R + // > mod. Even though the assembly on some 32-bit platforms works with 64-bit + // values, using |BN_BITS2| here, rather than |BN_MONT_CTX_N0_LIMBS * + // 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; + 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; +} + +BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx) { + BN_MONT_CTX *mont = BN_MONT_CTX_new(); + if (mont == NULL || + !BN_MONT_CTX_set(mont, mod, ctx)) { + BN_MONT_CTX_free(mont); + return NULL; + } + 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); + BN_MONT_CTX *ctx = *pmont; + CRYPTO_MUTEX_unlock_read(lock); + + if (ctx) { + return 1; + } + + CRYPTO_MUTEX_lock_write(lock); + if (*pmont == NULL) { + *pmont = BN_MONT_CTX_new_for_modulus(mod, bn_ctx); + } + const int ok = *pmont != NULL; + CRYPTO_MUTEX_unlock_write(lock); + return ok; +} + +int BN_to_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + return BN_mod_mul_montgomery(ret, a, &mont->RR, mont, ctx); +} + +static int bn_from_montgomery_in_place(BN_ULONG *r, size_t num_r, BN_ULONG *a, + size_t num_a, const BN_MONT_CTX *mont) { + const BN_ULONG *n = mont->N.d; + size_t num_n = mont->N.width; + if (num_r != num_n || num_a != 2 * num_n) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + // Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On + // input, we had |r| < |n| * R, so now |r| < 2 * |n| * R. Note that |r| + // includes |carry| which is stored separately. + BN_ULONG n0 = mont->n0[0]; + BN_ULONG carry = 0; + for (size_t i = 0; i < num_n; i++) { + BN_ULONG v = bn_mul_add_words(a + i, n, num_n, a[i] * n0); + v += carry + a[i + num_n]; + carry |= (v != a[i + num_n]); + carry &= (v <= a[i + num_n]); + a[i + num_n] = v; + } + + // Shift |num_n| words to divide by R. We have |a| < 2 * |n|. Note that |a| + // includes |carry| which is stored separately. + a += num_n; + + // |a| thus requires at most one additional subtraction |n| to be reduced. + bn_reduce_once(r, a, carry, n, num_n); + return 1; +} + +static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, + const BN_MONT_CTX *mont) { + if (r->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + const BIGNUM *n = &mont->N; + if (n->width == 0) { + ret->width = 0; + return 1; + } + + int max = 2 * n->width; // carry is stored separately + if (!bn_resize_words(r, max) || + !bn_wexpand(ret, n->width)) { + return 0; + } + + ret->width = n->width; + ret->neg = 0; + return bn_from_montgomery_in_place(ret->d, ret->width, r->d, r->width, mont); +} + +int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + int ret = 0; + BIGNUM *t; + + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (t == NULL || + !BN_copy(t, a)) { + goto err; + } + + ret = BN_from_montgomery_word(r, t, mont); + +err: + BN_CTX_end(ctx); + + return ret; +} + +int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx) { + // If the high bit of |n| is set, R = 2^(width*BN_BITS2) < 2 * |n|, so we + // compute R - |n| rather than perform Montgomery reduction. + const BIGNUM *n = &mont->N; + if (n->width > 0 && (n->d[n->width - 1] >> (BN_BITS2 - 1)) != 0) { + if (!bn_wexpand(r, n->width)) { + return 0; + } + r->d[0] = 0 - n->d[0]; + for (int i = 1; i < n->width; i++) { + r->d[i] = ~n->d[i]; + } + r->width = n->width; + r->neg = 0; + return 1; + } + + return BN_from_montgomery(r, &mont->RR, mont, ctx); +} + +static int bn_mod_mul_montgomery_fallback(BIGNUM *r, const BIGNUM *a, + const BIGNUM *b, + const BN_MONT_CTX *mont, + BN_CTX *ctx) { + int ret = 0; + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + if (a == b) { + if (!bn_sqr_consttime(tmp, a, ctx)) { + goto err; + } + } else { + if (!bn_mul_consttime(tmp, a, b, ctx)) { + goto err; + } + } + + // reduce from aRR to aR + if (!BN_from_montgomery_word(r, tmp, mont)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + if (a->neg || b->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + +#if defined(OPENSSL_BN_ASM_MONT) + // |bn_mul_mont| requires at least 128 bits of limbs, at least for x86. + int num = mont->N.width; + if (num >= (128 / BN_BITS2) && + a->width == num && + b->width == num) { + if (!bn_wexpand(r, num)) { + return 0; + } + if (!bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { + // The check above ensures this won't happen. + assert(0); + OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); + return 0; + } + r->neg = 0; + r->width = num; + return 1; + } +#endif + + return bn_mod_mul_montgomery_fallback(r, a, b, mont, ctx); +} + +int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont) { + return !BN_is_negative(bn) && + bn_fits_in_words(bn, mont->N.width); +} + +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); +} + +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]; + 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(); + } + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); +} + +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 >= (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; + } +#endif + + // Compute the product. + BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; + if (a == b) { + bn_sqr_small(tmp, 2 * num, a, num); + } else { + bn_mul_small(tmp, 2 * num, a, num, b, num); + } + + // 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c new file mode 100644 index 0000000..64d07ed --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c @@ -0,0 +1,186 @@ +/* Copyright 2016 Brian Smith. + * + * 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 "../../internal.h" + + +static uint64_t bn_neg_inv_mod_r_u64(uint64_t n); + +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| or + // |BN_MONT_CTX_new_consttime|. + assert(!BN_is_zero(n)); + assert(!BN_is_negative(n)); + assert(BN_is_odd(n)); + + // r == 2**(BN_MONT_CTX_N0_LIMBS * BN_BITS2) and LG_LITTLE_R == lg(r). This + // ensures that we can do integer division by |r| by simply ignoring + // |BN_MONT_CTX_N0_LIMBS| limbs. Similarly, we can calculate values modulo + // |r| by just looking at the lowest |BN_MONT_CTX_N0_LIMBS| limbs. This is + // what makes Montgomery multiplication efficient. + // + // As shown in Algorithm 1 of "Fast Prime Field Elliptic Curve Cryptography + // with 256 Bit Primes" by Shay Gueron and Vlad Krasnov, in the loop of a + // multi-limb Montgomery multiplication of |a * b (mod n)|, given the + // unreduced product |t == a * b|, we repeatedly calculate: + // + // t1 := t % r |t1| is |t|'s lowest limb (see previous paragraph). + // t2 := t1*n0*n + // t3 := t + t2 + // t := t3 / r copy all limbs of |t3| except the lowest to |t|. + // + // In the last step, it would only make sense to ignore the lowest limb of + // |t3| if it were zero. The middle steps ensure that this is the case: + // + // t3 == 0 (mod r) + // t + t2 == 0 (mod r) + // t + t1*n0*n == 0 (mod r) + // t1*n0*n == -t (mod r) + // t*n0*n == -t (mod r) + // n0*n == -1 (mod r) + // n0 == -1/n (mod r) + // + // Thus, in each iteration of the loop, we multiply by the constant factor + // |n0|, the negative inverse of n (mod r). + + // n_mod_r = n % r. As explained above, this is done by taking the lowest + // |BN_MONT_CTX_N0_LIMBS| limbs of |n|. + uint64_t n_mod_r = n->d[0]; +#if BN_MONT_CTX_N0_LIMBS == 2 + if (n->width > 1) { + n_mod_r |= (uint64_t)n->d[1] << BN_BITS2; + } +#endif + + return bn_neg_inv_mod_r_u64(n_mod_r); +} + +// bn_neg_inv_r_mod_n_u64 calculates the -1/n mod r; i.e. it calculates |v| +// such that u*r - v*n == 1. |r| is the constant defined in |bn_mont_n0|. |n| +// must be odd. +// +// This is derived from |xbinGCD| in Henry S. Warren, Jr.'s "Montgomery +// Multiplication" (http://www.hackersdelight.org/MontgomeryMultiplication.pdf). +// It is very similar to the MODULAR-INVERSE function in Stephen R. DussΓ©'s and +// Burton S. Kaliski Jr.'s "A Cryptographic Library for the Motorola DSP56000" +// (http://link.springer.com/chapter/10.1007%2F3-540-46877-3_21). +// +// This is inspired by Joppe W. Bos's "Constant Time Modular Inversion" +// (http://www.joppebos.com/files/CTInversion.pdf) so that the inversion is +// constant-time with respect to |n|. We assume uint64_t additions, +// subtractions, shifts, and bitwise operations are all constant time, which +// may be a large leap of faith on 32-bit targets. We avoid division and +// multiplication, which tend to be the most problematic in terms of timing +// leaks. +// +// Most GCD implementations return values such that |u*r + v*n == 1|, so the +// caller would have to negate the resultant |v| for the purpose of Montgomery +// multiplication. This implementation does the negation implicitly by doing +// the computations as a difference instead of a sum. +static uint64_t bn_neg_inv_mod_r_u64(uint64_t n) { + assert(n % 2 == 1); + + // alpha == 2**(lg r - 1) == r / 2. + static const uint64_t alpha = UINT64_C(1) << (LG_LITTLE_R - 1); + + const uint64_t beta = n; + + uint64_t u = 1; + uint64_t v = 0; + + // The invariant maintained from here on is: + // 2**(lg r - i) == u*2*alpha - v*beta. + for (size_t i = 0; i < LG_LITTLE_R; ++i) { +#if BN_BITS2 == 64 && defined(BN_ULLONG) + assert((BN_ULLONG)(1) << (LG_LITTLE_R - i) == + ((BN_ULLONG)u * 2 * alpha) - ((BN_ULLONG)v * beta)); +#endif + + // Delete a common factor of 2 in u and v if |u| is even. Otherwise, set + // |u = (u + beta) / 2| and |v = (v / 2) + alpha|. + + uint64_t u_is_odd = UINT64_C(0) - (u & 1); // Either 0xff..ff or 0. + + // The addition can overflow, so use Dietz's method for it. + // + // Dietz calculates (x+y)/2 by (xβŠ•y)>>1 + x&y. This is valid for all + // (unsigned) x and y, even when x+y overflows. Evidence for 32-bit values + // (embedded in 64 bits to so that overflow can be ignored): + // + // (declare-fun x () (_ BitVec 64)) + // (declare-fun y () (_ BitVec 64)) + // (assert (let ( + // (one (_ bv1 64)) + // (thirtyTwo (_ bv32 64))) + // (and + // (bvult x (bvshl one thirtyTwo)) + // (bvult y (bvshl one thirtyTwo)) + // (not (= + // (bvadd (bvlshr (bvxor x y) one) (bvand x y)) + // (bvlshr (bvadd x y) one))) + // ))) + // (check-sat) + uint64_t beta_if_u_is_odd = beta & u_is_odd; // Either |beta| or 0. + u = ((u ^ beta_if_u_is_odd) >> 1) + (u & beta_if_u_is_odd); + + uint64_t alpha_if_u_is_odd = alpha & u_is_odd; // Either |alpha| or 0. + v = (v >> 1) + alpha_if_u_is_odd; + } + + // The invariant now shows that u*r - v*n == 1 since r == 2 * alpha. +#if BN_BITS2 == 64 && defined(BN_ULLONG) + assert(1 == ((BN_ULLONG)u * 2 * alpha) - ((BN_ULLONG)v * beta)); +#endif + + return v; +} + +int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, + BN_CTX *ctx) { + assert(!BN_is_zero(n)); + assert(!BN_is_negative(n)); + assert(BN_is_odd(n)); + + BN_zero(r); + + unsigned n_bits = BN_num_bits(n); + assert(n_bits != 0); + assert(p > n_bits); + if (n_bits == 1) { + return 1; + } + + // Set |r| to the larger power of two smaller than |n|, then shift with + // reductions the rest of the way. + if (!BN_set_bit(r, n_bits - 1) || + !bn_mod_lshift_consttime(r, r, p - (n_bits - 1), n, ctx)) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back new file mode 100644 index 0000000..c80873f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back @@ -0,0 +1,186 @@ +/* Copyright 2016 Brian Smith. + * + * 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 "../../internal.h" + + +static uint64_t bn_neg_inv_mod_r_u64(uint64_t n); + +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| or + // |BN_MONT_CTX_new_consttime|. + assert(!BN_is_zero(n)); + assert(!BN_is_negative(n)); + assert(BN_is_odd(n)); + + // r == 2**(BN_MONT_CTX_N0_LIMBS * BN_BITS2) and LG_LITTLE_R == lg(r). This + // ensures that we can do integer division by |r| by simply ignoring + // |BN_MONT_CTX_N0_LIMBS| limbs. Similarly, we can calculate values modulo + // |r| by just looking at the lowest |BN_MONT_CTX_N0_LIMBS| limbs. This is + // what makes Montgomery multiplication efficient. + // + // As shown in Algorithm 1 of "Fast Prime Field Elliptic Curve Cryptography + // with 256 Bit Primes" by Shay Gueron and Vlad Krasnov, in the loop of a + // multi-limb Montgomery multiplication of |a * b (mod n)|, given the + // unreduced product |t == a * b|, we repeatedly calculate: + // + // t1 := t % r |t1| is |t|'s lowest limb (see previous paragraph). + // t2 := t1*n0*n + // t3 := t + t2 + // t := t3 / r copy all limbs of |t3| except the lowest to |t|. + // + // In the last step, it would only make sense to ignore the lowest limb of + // |t3| if it were zero. The middle steps ensure that this is the case: + // + // t3 == 0 (mod r) + // t + t2 == 0 (mod r) + // t + t1*n0*n == 0 (mod r) + // t1*n0*n == -t (mod r) + // t*n0*n == -t (mod r) + // n0*n == -1 (mod r) + // n0 == -1/n (mod r) + // + // Thus, in each iteration of the loop, we multiply by the constant factor + // |n0|, the negative inverse of n (mod r). + + // n_mod_r = n % r. As explained above, this is done by taking the lowest + // |BN_MONT_CTX_N0_LIMBS| limbs of |n|. + uint64_t n_mod_r = n->d[0]; +#if BN_MONT_CTX_N0_LIMBS == 2 + if (n->width > 1) { + n_mod_r |= (uint64_t)n->d[1] << BN_BITS2; + } +#endif + + return bn_neg_inv_mod_r_u64(n_mod_r); +} + +// bn_neg_inv_r_mod_n_u64 calculates the -1/n mod r; i.e. it calculates |v| +// such that u*r - v*n == 1. |r| is the constant defined in |bn_mont_n0|. |n| +// must be odd. +// +// This is derived from |xbinGCD| in Henry S. Warren, Jr.'s "Montgomery +// Multiplication" (http://www.hackersdelight.org/MontgomeryMultiplication.pdf). +// It is very similar to the MODULAR-INVERSE function in Stephen R. DussΓ©'s and +// Burton S. Kaliski Jr.'s "A Cryptographic Library for the Motorola DSP56000" +// (http://link.springer.com/chapter/10.1007%2F3-540-46877-3_21). +// +// This is inspired by Joppe W. Bos's "Constant Time Modular Inversion" +// (http://www.joppebos.com/files/CTInversion.pdf) so that the inversion is +// constant-time with respect to |n|. We assume uint64_t additions, +// subtractions, shifts, and bitwise operations are all constant time, which +// may be a large leap of faith on 32-bit targets. We avoid division and +// multiplication, which tend to be the most problematic in terms of timing +// leaks. +// +// Most GCD implementations return values such that |u*r + v*n == 1|, so the +// caller would have to negate the resultant |v| for the purpose of Montgomery +// multiplication. This implementation does the negation implicitly by doing +// the computations as a difference instead of a sum. +static uint64_t bn_neg_inv_mod_r_u64(uint64_t n) { + assert(n % 2 == 1); + + // alpha == 2**(lg r - 1) == r / 2. + static const uint64_t alpha = UINT64_C(1) << (LG_LITTLE_R - 1); + + const uint64_t beta = n; + + uint64_t u = 1; + uint64_t v = 0; + + // The invariant maintained from here on is: + // 2**(lg r - i) == u*2*alpha - v*beta. + for (size_t i = 0; i < LG_LITTLE_R; ++i) { +#if BN_BITS2 == 64 && defined(BN_ULLONG) + assert((BN_ULLONG)(1) << (LG_LITTLE_R - i) == + ((BN_ULLONG)u * 2 * alpha) - ((BN_ULLONG)v * beta)); +#endif + + // Delete a common factor of 2 in u and v if |u| is even. Otherwise, set + // |u = (u + beta) / 2| and |v = (v / 2) + alpha|. + + uint64_t u_is_odd = UINT64_C(0) - (u & 1); // Either 0xff..ff or 0. + + // The addition can overflow, so use Dietz's method for it. + // + // Dietz calculates (x+y)/2 by (xβŠ•y)>>1 + x&y. This is valid for all + // (unsigned) x and y, even when x+y overflows. Evidence for 32-bit values + // (embedded in 64 bits to so that overflow can be ignored): + // + // (declare-fun x () (_ BitVec 64)) + // (declare-fun y () (_ BitVec 64)) + // (assert (let ( + // (one (_ bv1 64)) + // (thirtyTwo (_ bv32 64))) + // (and + // (bvult x (bvshl one thirtyTwo)) + // (bvult y (bvshl one thirtyTwo)) + // (not (= + // (bvadd (bvlshr (bvxor x y) one) (bvand x y)) + // (bvlshr (bvadd x y) one))) + // ))) + // (check-sat) + uint64_t beta_if_u_is_odd = beta & u_is_odd; // Either |beta| or 0. + u = ((u ^ beta_if_u_is_odd) >> 1) + (u & beta_if_u_is_odd); + + uint64_t alpha_if_u_is_odd = alpha & u_is_odd; // Either |alpha| or 0. + v = (v >> 1) + alpha_if_u_is_odd; + } + + // The invariant now shows that u*r - v*n == 1 since r == 2 * alpha. +#if BN_BITS2 == 64 && defined(BN_ULLONG) + assert(1 == ((BN_ULLONG)u * 2 * alpha) - ((BN_ULLONG)v * beta)); +#endif + + return v; +} + +int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, + BN_CTX *ctx) { + assert(!BN_is_zero(n)); + assert(!BN_is_negative(n)); + assert(BN_is_odd(n)); + + BN_zero(r); + + unsigned n_bits = BN_num_bits(n); + assert(n_bits != 0); + assert(p > n_bits); + if (n_bits == 1) { + return 1; + } + + // Set |r| to the larger power of two smaller than |n|, then shift with + // reductions the rest of the way. + if (!BN_set_bit(r, n_bits - 1) || + !bn_mod_lshift_consttime(r, r, p - (n_bits - 1), n, ctx)) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c new file mode 100644 index 0000000..7050c8d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c @@ -0,0 +1,873 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +#define BN_MUL_RECURSIVE_SIZE_NORMAL 16 +#define BN_SQR_RECURSIVE_SIZE_NORMAL BN_MUL_RECURSIVE_SIZE_NORMAL + + +static void bn_abs_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t num, BN_ULONG *tmp) { + BN_ULONG borrow = bn_sub_words(tmp, a, b, num); + bn_sub_words(r, b, a, num); + bn_select_words(r, 0 - borrow, r /* tmp < 0 */, tmp /* tmp >= 0 */, num); +} + +static void bn_mul_normal(BN_ULONG *r, const BN_ULONG *a, size_t na, + const BN_ULONG *b, size_t nb) { + if (na < nb) { + size_t itmp = na; + na = nb; + nb = itmp; + const BN_ULONG *ltmp = a; + a = b; + b = ltmp; + } + BN_ULONG *rr = &(r[na]); + if (nb == 0) { + OPENSSL_memset(r, 0, na * sizeof(BN_ULONG)); + return; + } + rr[0] = bn_mul_words(r, a, na, b[0]); + + for (;;) { + if (--nb == 0) { + return; + } + rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); + if (--nb == 0) { + return; + } + rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); + if (--nb == 0) { + return; + } + rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); + if (--nb == 0) { + return; + } + rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); + rr += 4; + r += 4; + b += 4; + } +} + +#if !defined(OPENSSL_X86) || defined(OPENSSL_NO_ASM) +// Here follows specialised variants of bn_add_words() and bn_sub_words(). They +// have the property performing operations on arrays of different sizes. The +// sizes of those arrays is expressed through cl, which is the common length ( +// basicall, min(len(a),len(b)) ), and dl, which is the delta between the two +// lengths, calculated as len(a)-len(b). All lengths are the number of +// BN_ULONGs... For the operations that require a result array as parameter, +// it must have the length cl+abs(dl). These functions should probably end up +// in bn_asm.c as soon as there are assembler counterparts for the systems that +// use assembler files. + +static BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int cl, int dl) { + BN_ULONG c, t; + + assert(cl >= 0); + c = bn_sub_words(r, a, b, cl); + + if (dl == 0) { + return c; + } + + r += cl; + a += cl; + b += cl; + + if (dl < 0) { + for (;;) { + t = b[0]; + r[0] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[1]; + r[1] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[2]; + r[2] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[3]; + r[3] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + b += 4; + r += 4; + } + } else { + int save_dl = dl; + while (c) { + t = a[0]; + r[0] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[1]; + r[1] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[2]; + r[2] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[3]; + r[3] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + save_dl = dl; + a += 4; + r += 4; + } + if (dl > 0) { + if (save_dl > dl) { + switch (save_dl - dl) { + case 1: + r[1] = a[1]; + if (--dl <= 0) { + break; + } + OPENSSL_FALLTHROUGH; + case 2: + r[2] = a[2]; + if (--dl <= 0) { + break; + } + OPENSSL_FALLTHROUGH; + case 3: + r[3] = a[3]; + if (--dl <= 0) { + break; + } + } + a += 4; + r += 4; + } + } + + if (dl > 0) { + for (;;) { + r[0] = a[0]; + if (--dl <= 0) { + break; + } + r[1] = a[1]; + if (--dl <= 0) { + break; + } + r[2] = a[2]; + if (--dl <= 0) { + break; + } + r[3] = a[3]; + if (--dl <= 0) { + break; + } + + a += 4; + r += 4; + } + } + } + + return c; +} +#else +// On other platforms the function is defined in asm. +BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + int cl, int dl); +#endif + +// bn_abs_sub_part_words computes |r| = |a| - |b|, storing the absolute value +// and returning a mask of all ones if the result was negative and all zeros if +// the result was positive. |cl| and |dl| follow the |bn_sub_part_words| calling +// convention. +// +// TODO(davidben): Make this take |size_t|. The |cl| + |dl| calling convention +// is confusing. The trouble is 32-bit x86 implements |bn_sub_part_words| in +// assembly, but we can probably just delete it? +static BN_ULONG bn_abs_sub_part_words(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int cl, int dl, + BN_ULONG *tmp) { + BN_ULONG borrow = bn_sub_part_words(tmp, a, b, cl, dl); + bn_sub_part_words(r, b, a, cl, -dl); + int r_len = cl + (dl < 0 ? -dl : dl); + borrow = 0 - borrow; + bn_select_words(r, borrow, r /* tmp < 0 */, tmp /* tmp >= 0 */, r_len); + return borrow; +} + +int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int cl = a->width < b->width ? a->width : b->width; + int dl = a->width - b->width; + int r_len = a->width < b->width ? b->width : a->width; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ok = tmp != NULL && + bn_wexpand(r, r_len) && + bn_wexpand(tmp, r_len); + if (ok) { + bn_abs_sub_part_words(r->d, a->d, b->d, cl, dl, tmp->d); + r->width = r_len; + } + BN_CTX_end(ctx); + return ok; +} + +// Karatsuba recursive multiplication algorithm +// (cf. Knuth, The Art of Computer Programming, Vol. 2) + +// bn_mul_recursive sets |r| to |a| * |b|, using |t| as scratch space. |r| has +// length 2*|n2|, |a| has length |n2| + |dna|, |b| has length |n2| + |dnb|, and +// |t| has length 4*|n2|. |n2| must be a power of two. Finally, we must have +// -|BN_MUL_RECURSIVE_SIZE_NORMAL|/2 <= |dna| <= 0 and +// -|BN_MUL_RECURSIVE_SIZE_NORMAL|/2 <= |dnb| <= 0. +// +// TODO(davidben): Simplify and |size_t| the calling convention around lengths +// here. +static void bn_mul_recursive(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + int n2, int dna, int dnb, BN_ULONG *t) { + // |n2| is a power of two. + assert(n2 != 0 && (n2 & (n2 - 1)) == 0); + // Check |dna| and |dnb| are in range. + assert(-BN_MUL_RECURSIVE_SIZE_NORMAL/2 <= dna && dna <= 0); + assert(-BN_MUL_RECURSIVE_SIZE_NORMAL/2 <= dnb && dnb <= 0); + + // Only call bn_mul_comba 8 if n2 == 8 and the + // two arrays are complete [steve] + if (n2 == 8 && dna == 0 && dnb == 0) { + bn_mul_comba8(r, a, b); + return; + } + + // Else do normal multiply + if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) { + bn_mul_normal(r, a, n2 + dna, b, n2 + dnb); + if (dna + dnb < 0) { + OPENSSL_memset(&r[2 * n2 + dna + dnb], 0, + sizeof(BN_ULONG) * -(dna + dnb)); + } + return; + } + + // Split |a| and |b| into a0,a1 and b0,b1, where a0 and b0 have size |n|. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0*b0 to r0,r1, a0*a1+b0*b1 + // to r1,r2, and a1*b1 to r2,r3. The middle term we will compute as: + // + // a0*a1 + b0*b1 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0 + // + // Note that we know |n| >= |BN_MUL_RECURSIVE_SIZE_NORMAL|/2 above, so + // |tna| and |tnb| are non-negative. + int n = n2 / 2, tna = n + dna, tnb = n + dnb; + + // t0 = a0 - a1 and t1 = b1 - b0. The result will be multiplied, so we XOR + // their sign masks, giving the sign of (a0 - a1)*(b1 - b0). t0 and t1 + // themselves store the absolute value. + BN_ULONG neg = bn_abs_sub_part_words(t, a, &a[n], tna, n - tna, &t[n2]); + neg ^= bn_abs_sub_part_words(&t[n], &b[n], b, tnb, tnb - n, &t[n2]); + + // Compute: + // t2,t3 = t0 * t1 = |(a0 - a1)*(b1 - b0)| + // r0,r1 = a0 * b0 + // r2,r3 = a1 * b1 + if (n == 4 && dna == 0 && dnb == 0) { + bn_mul_comba4(&t[n2], t, &t[n]); + + bn_mul_comba4(r, a, b); + bn_mul_comba4(&r[n2], &a[n], &b[n]); + } else if (n == 8 && dna == 0 && dnb == 0) { + bn_mul_comba8(&t[n2], t, &t[n]); + + bn_mul_comba8(r, a, b); + bn_mul_comba8(&r[n2], &a[n], &b[n]); + } else { + BN_ULONG *p = &t[n2 * 2]; + bn_mul_recursive(&t[n2], t, &t[n], n, 0, 0, p); + bn_mul_recursive(r, a, b, n, 0, 0, p); + bn_mul_recursive(&r[n2], &a[n], &b[n], n, dna, dnb, p); + } + + // t0,t1,c = r0,r1 + r2,r3 = a0*b0 + a1*b1 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + + // t2,t3,c = t0,t1,c + neg*t2,t3 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0. + // The second term is stored as the absolute value, so we do this with a + // constant-time select. + 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_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. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (int i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The product should fit without carries. + assert(c == 0); +} + +// bn_mul_part_recursive sets |r| to |a| * |b|, using |t| as scratch space. |r| +// has length 4*|n|, |a| has length |n| + |tna|, |b| has length |n| + |tnb|, and +// |t| has length 8*|n|. |n| must be a power of two. Additionally, we must have +// 0 <= tna < n and 0 <= tnb < n, and |tna| and |tnb| must differ by at most +// one. +// +// TODO(davidben): Make this take |size_t| and perhaps the actual lengths of |a| +// and |b|. +static void bn_mul_part_recursive(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int n, int tna, int tnb, + BN_ULONG *t) { + // |n| is a power of two. + assert(n != 0 && (n & (n - 1)) == 0); + // Check |tna| and |tnb| are in range. + assert(0 <= tna && tna < n); + assert(0 <= tnb && tnb < n); + assert(-1 <= tna - tnb && tna - tnb <= 1); + + int n2 = n * 2; + if (n < 8) { + bn_mul_normal(r, a, n + tna, b, n + tnb); + OPENSSL_memset(r + n2 + tna + tnb, 0, n2 - tna - tnb); + return; + } + + // Split |a| and |b| into a0,a1 and b0,b1, where a0 and b0 have size |n|. |a1| + // and |b1| have size |tna| and |tnb|, respectively. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0*b0 to r0,r1, a0*a1+b0*b1 + // to r1,r2, and a1*b1 to r2,r3. The middle term we will compute as: + // + // a0*a1 + b0*b1 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0 + + // t0 = a0 - a1 and t1 = b1 - b0. The result will be multiplied, so we XOR + // their sign masks, giving the sign of (a0 - a1)*(b1 - b0). t0 and t1 + // themselves store the absolute value. + BN_ULONG neg = bn_abs_sub_part_words(t, a, &a[n], tna, n - tna, &t[n2]); + neg ^= bn_abs_sub_part_words(&t[n], &b[n], b, tnb, tnb - n, &t[n2]); + + // Compute: + // t2,t3 = t0 * t1 = |(a0 - a1)*(b1 - b0)| + // r0,r1 = a0 * b0 + // r2,r3 = a1 * b1 + if (n == 8) { + bn_mul_comba8(&t[n2], t, &t[n]); + bn_mul_comba8(r, a, b); + + bn_mul_normal(&r[n2], &a[n], tna, &b[n], tnb); + // |bn_mul_normal| only writes |tna| + |tna| words. Zero the rest. + OPENSSL_memset(&r[n2 + tna + tnb], 0, sizeof(BN_ULONG) * (n2 - tna - tnb)); + } else { + BN_ULONG *p = &t[n2 * 2]; + bn_mul_recursive(&t[n2], t, &t[n], n, 0, 0, p); + bn_mul_recursive(r, a, b, n, 0, 0, p); + + OPENSSL_memset(&r[n2], 0, sizeof(BN_ULONG) * n2); + if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL && + tnb < BN_MUL_RECURSIVE_SIZE_NORMAL) { + bn_mul_normal(&r[n2], &a[n], tna, &b[n], tnb); + } else { + int i = n; + for (;;) { + i /= 2; + if (i < tna || i < tnb) { + // E.g., n == 16, i == 8 and tna == 11. |tna| and |tnb| are within one + // of each other, so if |tna| is larger and tna > i, then we know + // tnb >= i, and this call is valid. + bn_mul_part_recursive(&r[n2], &a[n], &b[n], i, tna - i, tnb - i, p); + break; + } + if (i == tna || i == tnb) { + // If there is only a bottom half to the number, just do it. We know + // the larger of |tna - i| and |tnb - i| is zero. The other is zero or + // -1 by because of |tna| and |tnb| differ by at most one. + bn_mul_recursive(&r[n2], &a[n], &b[n], i, tna - i, tnb - i, p); + break; + } + + // This loop will eventually terminate when |i| falls below + // |BN_MUL_RECURSIVE_SIZE_NORMAL| because we know one of |tna| and |tnb| + // exceeds that. + } + } + } + + // t0,t1,c = r0,r1 + r2,r3 = a0*b0 + a1*b1 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + + // t2,t3,c = t0,t1,c + neg*t2,t3 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0. + // The second term is stored as the absolute value, so we do this with a + // constant-time select. + 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_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. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (int i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The product should fit without carries. + assert(c == 0); +} + +// bn_mul_impl implements |BN_mul| and |bn_mul_consttime|. Note this function +// breaks |BIGNUM| invariants and may return a negative zero. This is handled by +// the callers. +static int bn_mul_impl(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int al = a->width; + int bl = b->width; + if (al == 0 || bl == 0) { + BN_zero(r); + return 1; + } + + int ret = 0; + BIGNUM *rr; + BN_CTX_start(ctx); + if (r == a || r == b) { + rr = BN_CTX_get(ctx); + if (rr == NULL) { + goto err; + } + } else { + rr = r; + } + rr->neg = a->neg ^ b->neg; + + int i = al - bl; + if (i == 0) { + if (al == 8) { + if (!bn_wexpand(rr, 16)) { + goto err; + } + rr->width = 16; + bn_mul_comba8(rr->d, a->d, b->d); + goto end; + } + } + + int top = al + bl; + static const int kMulNormalSize = 16; + if (al >= kMulNormalSize && bl >= kMulNormalSize) { + if (-1 <= i && i <= 1) { + // Find the larger power of two less than or equal to the larger length. + int j; + if (i >= 0) { + j = BN_num_bits_word((BN_ULONG)al); + } else { + j = BN_num_bits_word((BN_ULONG)bl); + } + j = 1 << (j - 1); + assert(j <= al || j <= bl); + BIGNUM *t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + if (al > j || bl > j) { + // We know |al| and |bl| are at most one from each other, so if al > j, + // bl >= j, and vice versa. Thus we can use |bn_mul_part_recursive|. + assert(al >= j && bl >= j); + if (!bn_wexpand(t, j * 8) || + !bn_wexpand(rr, j * 4)) { + goto err; + } + bn_mul_part_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d); + } else { + // al <= j && bl <= j. Additionally, we know j <= al or j <= bl, so one + // of al - j or bl - j is zero. The other, by the bound on |i| above, is + // zero or -1. Thus, we can use |bn_mul_recursive|. + if (!bn_wexpand(t, j * 4) || + !bn_wexpand(rr, j * 2)) { + goto err; + } + bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d); + } + rr->width = top; + goto end; + } + } + + if (!bn_wexpand(rr, top)) { + goto err; + } + rr->width = top; + bn_mul_normal(rr->d, a->d, al, b->d, bl); + +end: + if (r != rr && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + if (!bn_mul_impl(r, a, b, ctx)) { + return 0; + } + + // This additionally fixes any negative zeros created by |bn_mul_impl|. + bn_set_minimal_width(r); + return 1; +} + +int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + // Prevent negative zeros. + if (a->neg || b->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + return bn_mul_impl(r, a, b, ctx); +} + +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) { + abort(); + } + // TODO(davidben): Should this call |bn_mul_comba4| too? |BN_mul| does not + // hit that code. + if (num_a == 8 && num_b == 8) { + bn_mul_comba8(r, a, b); + } else { + bn_mul_normal(r, a, num_a, b, num_b); + } +} + +// tmp must have 2*n words +static void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, size_t n, + BN_ULONG *tmp) { + if (n == 0) { + return; + } + + size_t max = n * 2; + const BN_ULONG *ap = a; + BN_ULONG *rp = r; + rp[0] = rp[max - 1] = 0; + rp++; + + // Compute the contribution of a[i] * a[j] for all i < j. + if (n > 1) { + ap++; + rp[n - 1] = bn_mul_words(rp, ap, n - 1, ap[-1]); + rp += 2; + } + if (n > 2) { + for (size_t i = n - 2; i > 0; i--) { + ap++; + rp[i] = bn_mul_add_words(rp, ap, i, ap[-1]); + rp += 2; + } + } + + // The final result fits in |max| words, so none of the following operations + // will overflow. + + // Double |r|, giving the contribution of a[i] * a[j] for all i != j. + bn_add_words(r, r, r, max); + + // Add in the contribution of a[i] * a[i] for all i. + bn_sqr_words(tmp, a, n); + bn_add_words(r, r, tmp, max); +} + +// bn_sqr_recursive sets |r| to |a|^2, using |t| as scratch space. |r| has +// length 2*|n2|, |a| has length |n2|, and |t| has length 4*|n2|. |n2| must be +// a power of two. +static void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, size_t n2, + BN_ULONG *t) { + // |n2| is a power of two. + assert(n2 != 0 && (n2 & (n2 - 1)) == 0); + + if (n2 == 4) { + bn_sqr_comba4(r, a); + return; + } + if (n2 == 8) { + bn_sqr_comba8(r, a); + return; + } + if (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL) { + bn_sqr_normal(r, a, n2, t); + return; + } + + // Split |a| into a0,a1, each of size |n|. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0^2 to r0,r1, 2*a0*a1 to + // r1,r2, and a1^2 to r2,r3. + size_t n = n2 / 2; + BN_ULONG *t_recursive = &t[n2 * 2]; + + // t0 = |a0 - a1|. + bn_abs_sub_words(t, a, &a[n], n, &t[n]); + // t2,t3 = t0^2 = |a0 - a1|^2 = a0^2 - 2*a0*a1 + a1^2 + bn_sqr_recursive(&t[n2], t, n, t_recursive); + + // r0,r1 = a0^2 + bn_sqr_recursive(r, a, n, t_recursive); + + // r2,r3 = a1^2 + bn_sqr_recursive(&r[n2], &a[n], n, t_recursive); + + // t0,t1,c = r0,r1 + r2,r3 = a0^2 + a1^2 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + // t2,t3,c = t0,t1,c - t2,t3 = 2*a0*a1 + c -= bn_sub_words(&t[n2], t, &t[n2], n2); + + // We now have our three components. Add them together. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (size_t i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The square should fit without carries. + assert(c == 0); +} + +int BN_mul_word(BIGNUM *bn, BN_ULONG w) { + if (!bn->width) { + return 1; + } + + if (w == 0) { + BN_zero(bn); + return 1; + } + + BN_ULONG ll = bn_mul_words(bn->d, bn->d, bn->width, w); + if (ll) { + if (!bn_wexpand(bn, bn->width + 1)) { + return 0; + } + bn->d[bn->width++] = ll; + } + + return 1; +} + +int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + int al = a->width; + if (al <= 0) { + r->width = 0; + r->neg = 0; + return 1; + } + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *rr = (a != r) ? r : BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (!rr || !tmp) { + goto err; + } + + int max = 2 * al; // Non-zero (from above) + if (!bn_wexpand(rr, max)) { + goto err; + } + + if (al == 4) { + bn_sqr_comba4(rr->d, a->d); + } else if (al == 8) { + bn_sqr_comba8(rr->d, a->d); + } else { + if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) { + BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2]; + bn_sqr_normal(rr->d, a->d, al, t); + } else { + // If |al| is a power of two, we can use |bn_sqr_recursive|. + if (al != 0 && (al & (al - 1)) == 0) { + if (!bn_wexpand(tmp, al * 4)) { + goto err; + } + bn_sqr_recursive(rr->d, a->d, al, tmp->d); + } else { + if (!bn_wexpand(tmp, max)) { + goto err; + } + bn_sqr_normal(rr->d, a->d, al, tmp->d); + } + } + } + + rr->neg = 0; + rr->width = max; + + if (rr != r && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + if (!bn_sqr_consttime(r, a, ctx)) { + return 0; + } + + bn_set_minimal_width(r); + return 1; +} + +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) { + abort(); + } + if (num_a == 4) { + bn_sqr_comba4(r, a); + } else if (num_a == 8) { + bn_sqr_comba8(r, a); + } else { + BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; + bn_sqr_normal(r, a, num_a, tmp); + OPENSSL_cleanse(tmp, 2 * num_a * sizeof(BN_ULONG)); + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back new file mode 100644 index 0000000..640d8cd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back @@ -0,0 +1,873 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +#define BN_MUL_RECURSIVE_SIZE_NORMAL 16 +#define BN_SQR_RECURSIVE_SIZE_NORMAL BN_MUL_RECURSIVE_SIZE_NORMAL + + +static void bn_abs_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + size_t num, BN_ULONG *tmp) { + BN_ULONG borrow = bn_sub_words(tmp, a, b, num); + bn_sub_words(r, b, a, num); + bn_select_words(r, 0 - borrow, r /* tmp < 0 */, tmp /* tmp >= 0 */, num); +} + +static void bn_mul_normal(BN_ULONG *r, const BN_ULONG *a, size_t na, + const BN_ULONG *b, size_t nb) { + if (na < nb) { + size_t itmp = na; + na = nb; + nb = itmp; + const BN_ULONG *ltmp = a; + a = b; + b = ltmp; + } + BN_ULONG *rr = &(r[na]); + if (nb == 0) { + OPENSSL_memset(r, 0, na * sizeof(BN_ULONG)); + return; + } + rr[0] = bn_mul_words(r, a, na, b[0]); + + for (;;) { + if (--nb == 0) { + return; + } + rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); + if (--nb == 0) { + return; + } + rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); + if (--nb == 0) { + return; + } + rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); + if (--nb == 0) { + return; + } + rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); + rr += 4; + r += 4; + b += 4; + } +} + +#if !defined(OPENSSL_X86) || defined(OPENSSL_NO_ASM) +// Here follows specialised variants of bn_add_words() and bn_sub_words(). They +// have the property performing operations on arrays of different sizes. The +// sizes of those arrays is expressed through cl, which is the common length ( +// basicall, min(len(a),len(b)) ), and dl, which is the delta between the two +// lengths, calculated as len(a)-len(b). All lengths are the number of +// BN_ULONGs... For the operations that require a result array as parameter, +// it must have the length cl+abs(dl). These functions should probably end up +// in bn_asm.c as soon as there are assembler counterparts for the systems that +// use assembler files. + +static BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int cl, int dl) { + BN_ULONG c, t; + + assert(cl >= 0); + c = bn_sub_words(r, a, b, cl); + + if (dl == 0) { + return c; + } + + r += cl; + a += cl; + b += cl; + + if (dl < 0) { + for (;;) { + t = b[0]; + r[0] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[1]; + r[1] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[2]; + r[2] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + t = b[3]; + r[3] = 0 - t - c; + if (t != 0) { + c = 1; + } + if (++dl >= 0) { + break; + } + + b += 4; + r += 4; + } + } else { + int save_dl = dl; + while (c) { + t = a[0]; + r[0] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[1]; + r[1] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[2]; + r[2] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + t = a[3]; + r[3] = t - c; + if (t != 0) { + c = 0; + } + if (--dl <= 0) { + break; + } + + save_dl = dl; + a += 4; + r += 4; + } + if (dl > 0) { + if (save_dl > dl) { + switch (save_dl - dl) { + case 1: + r[1] = a[1]; + if (--dl <= 0) { + break; + } + OPENSSL_FALLTHROUGH; + case 2: + r[2] = a[2]; + if (--dl <= 0) { + break; + } + OPENSSL_FALLTHROUGH; + case 3: + r[3] = a[3]; + if (--dl <= 0) { + break; + } + } + a += 4; + r += 4; + } + } + + if (dl > 0) { + for (;;) { + r[0] = a[0]; + if (--dl <= 0) { + break; + } + r[1] = a[1]; + if (--dl <= 0) { + break; + } + r[2] = a[2]; + if (--dl <= 0) { + break; + } + r[3] = a[3]; + if (--dl <= 0) { + break; + } + + a += 4; + r += 4; + } + } + } + + return c; +} +#else +// On other platforms the function is defined in asm. +BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + int cl, int dl); +#endif + +// bn_abs_sub_part_words computes |r| = |a| - |b|, storing the absolute value +// and returning a mask of all ones if the result was negative and all zeros if +// the result was positive. |cl| and |dl| follow the |bn_sub_part_words| calling +// convention. +// +// TODO(davidben): Make this take |size_t|. The |cl| + |dl| calling convention +// is confusing. The trouble is 32-bit x86 implements |bn_sub_part_words| in +// assembly, but we can probably just delete it? +static BN_ULONG bn_abs_sub_part_words(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int cl, int dl, + BN_ULONG *tmp) { + BN_ULONG borrow = bn_sub_part_words(tmp, a, b, cl, dl); + bn_sub_part_words(r, b, a, cl, -dl); + int r_len = cl + (dl < 0 ? -dl : dl); + borrow = 0 - borrow; + bn_select_words(r, borrow, r /* tmp < 0 */, tmp /* tmp >= 0 */, r_len); + return borrow; +} + +int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int cl = a->width < b->width ? a->width : b->width; + int dl = a->width - b->width; + int r_len = a->width < b->width ? b->width : a->width; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ok = tmp != NULL && + bn_wexpand(r, r_len) && + bn_wexpand(tmp, r_len); + if (ok) { + bn_abs_sub_part_words(r->d, a->d, b->d, cl, dl, tmp->d); + r->width = r_len; + } + BN_CTX_end(ctx); + return ok; +} + +// Karatsuba recursive multiplication algorithm +// (cf. Knuth, The Art of Computer Programming, Vol. 2) + +// bn_mul_recursive sets |r| to |a| * |b|, using |t| as scratch space. |r| has +// length 2*|n2|, |a| has length |n2| + |dna|, |b| has length |n2| + |dnb|, and +// |t| has length 4*|n2|. |n2| must be a power of two. Finally, we must have +// -|BN_MUL_RECURSIVE_SIZE_NORMAL|/2 <= |dna| <= 0 and +// -|BN_MUL_RECURSIVE_SIZE_NORMAL|/2 <= |dnb| <= 0. +// +// TODO(davidben): Simplify and |size_t| the calling convention around lengths +// here. +static void bn_mul_recursive(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + int n2, int dna, int dnb, BN_ULONG *t) { + // |n2| is a power of two. + assert(n2 != 0 && (n2 & (n2 - 1)) == 0); + // Check |dna| and |dnb| are in range. + assert(-BN_MUL_RECURSIVE_SIZE_NORMAL/2 <= dna && dna <= 0); + assert(-BN_MUL_RECURSIVE_SIZE_NORMAL/2 <= dnb && dnb <= 0); + + // Only call bn_mul_comba 8 if n2 == 8 and the + // two arrays are complete [steve] + if (n2 == 8 && dna == 0 && dnb == 0) { + bn_mul_comba8(r, a, b); + return; + } + + // Else do normal multiply + if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) { + bn_mul_normal(r, a, n2 + dna, b, n2 + dnb); + if (dna + dnb < 0) { + OPENSSL_memset(&r[2 * n2 + dna + dnb], 0, + sizeof(BN_ULONG) * -(dna + dnb)); + } + return; + } + + // Split |a| and |b| into a0,a1 and b0,b1, where a0 and b0 have size |n|. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0*b0 to r0,r1, a0*a1+b0*b1 + // to r1,r2, and a1*b1 to r2,r3. The middle term we will compute as: + // + // a0*a1 + b0*b1 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0 + // + // Note that we know |n| >= |BN_MUL_RECURSIVE_SIZE_NORMAL|/2 above, so + // |tna| and |tnb| are non-negative. + int n = n2 / 2, tna = n + dna, tnb = n + dnb; + + // t0 = a0 - a1 and t1 = b1 - b0. The result will be multiplied, so we XOR + // their sign masks, giving the sign of (a0 - a1)*(b1 - b0). t0 and t1 + // themselves store the absolute value. + BN_ULONG neg = bn_abs_sub_part_words(t, a, &a[n], tna, n - tna, &t[n2]); + neg ^= bn_abs_sub_part_words(&t[n], &b[n], b, tnb, tnb - n, &t[n2]); + + // Compute: + // t2,t3 = t0 * t1 = |(a0 - a1)*(b1 - b0)| + // r0,r1 = a0 * b0 + // r2,r3 = a1 * b1 + if (n == 4 && dna == 0 && dnb == 0) { + bn_mul_comba4(&t[n2], t, &t[n]); + + bn_mul_comba4(r, a, b); + bn_mul_comba4(&r[n2], &a[n], &b[n]); + } else if (n == 8 && dna == 0 && dnb == 0) { + bn_mul_comba8(&t[n2], t, &t[n]); + + bn_mul_comba8(r, a, b); + bn_mul_comba8(&r[n2], &a[n], &b[n]); + } else { + BN_ULONG *p = &t[n2 * 2]; + bn_mul_recursive(&t[n2], t, &t[n], n, 0, 0, p); + bn_mul_recursive(r, a, b, n, 0, 0, p); + bn_mul_recursive(&r[n2], &a[n], &b[n], n, dna, dnb, p); + } + + // t0,t1,c = r0,r1 + r2,r3 = a0*b0 + a1*b1 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + + // t2,t3,c = t0,t1,c + neg*t2,t3 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0. + // The second term is stored as the absolute value, so we do this with a + // constant-time select. + 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_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. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (int i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The product should fit without carries. + assert(c == 0); +} + +// bn_mul_part_recursive sets |r| to |a| * |b|, using |t| as scratch space. |r| +// has length 4*|n|, |a| has length |n| + |tna|, |b| has length |n| + |tnb|, and +// |t| has length 8*|n|. |n| must be a power of two. Additionally, we must have +// 0 <= tna < n and 0 <= tnb < n, and |tna| and |tnb| must differ by at most +// one. +// +// TODO(davidben): Make this take |size_t| and perhaps the actual lengths of |a| +// and |b|. +static void bn_mul_part_recursive(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, int n, int tna, int tnb, + BN_ULONG *t) { + // |n| is a power of two. + assert(n != 0 && (n & (n - 1)) == 0); + // Check |tna| and |tnb| are in range. + assert(0 <= tna && tna < n); + assert(0 <= tnb && tnb < n); + assert(-1 <= tna - tnb && tna - tnb <= 1); + + int n2 = n * 2; + if (n < 8) { + bn_mul_normal(r, a, n + tna, b, n + tnb); + OPENSSL_memset(r + n2 + tna + tnb, 0, n2 - tna - tnb); + return; + } + + // Split |a| and |b| into a0,a1 and b0,b1, where a0 and b0 have size |n|. |a1| + // and |b1| have size |tna| and |tnb|, respectively. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0*b0 to r0,r1, a0*a1+b0*b1 + // to r1,r2, and a1*b1 to r2,r3. The middle term we will compute as: + // + // a0*a1 + b0*b1 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0 + + // t0 = a0 - a1 and t1 = b1 - b0. The result will be multiplied, so we XOR + // their sign masks, giving the sign of (a0 - a1)*(b1 - b0). t0 and t1 + // themselves store the absolute value. + BN_ULONG neg = bn_abs_sub_part_words(t, a, &a[n], tna, n - tna, &t[n2]); + neg ^= bn_abs_sub_part_words(&t[n], &b[n], b, tnb, tnb - n, &t[n2]); + + // Compute: + // t2,t3 = t0 * t1 = |(a0 - a1)*(b1 - b0)| + // r0,r1 = a0 * b0 + // r2,r3 = a1 * b1 + if (n == 8) { + bn_mul_comba8(&t[n2], t, &t[n]); + bn_mul_comba8(r, a, b); + + bn_mul_normal(&r[n2], &a[n], tna, &b[n], tnb); + // |bn_mul_normal| only writes |tna| + |tna| words. Zero the rest. + OPENSSL_memset(&r[n2 + tna + tnb], 0, sizeof(BN_ULONG) * (n2 - tna - tnb)); + } else { + BN_ULONG *p = &t[n2 * 2]; + bn_mul_recursive(&t[n2], t, &t[n], n, 0, 0, p); + bn_mul_recursive(r, a, b, n, 0, 0, p); + + OPENSSL_memset(&r[n2], 0, sizeof(BN_ULONG) * n2); + if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL && + tnb < BN_MUL_RECURSIVE_SIZE_NORMAL) { + bn_mul_normal(&r[n2], &a[n], tna, &b[n], tnb); + } else { + int i = n; + for (;;) { + i /= 2; + if (i < tna || i < tnb) { + // E.g., n == 16, i == 8 and tna == 11. |tna| and |tnb| are within one + // of each other, so if |tna| is larger and tna > i, then we know + // tnb >= i, and this call is valid. + bn_mul_part_recursive(&r[n2], &a[n], &b[n], i, tna - i, tnb - i, p); + break; + } + if (i == tna || i == tnb) { + // If there is only a bottom half to the number, just do it. We know + // the larger of |tna - i| and |tnb - i| is zero. The other is zero or + // -1 by because of |tna| and |tnb| differ by at most one. + bn_mul_recursive(&r[n2], &a[n], &b[n], i, tna - i, tnb - i, p); + break; + } + + // This loop will eventually terminate when |i| falls below + // |BN_MUL_RECURSIVE_SIZE_NORMAL| because we know one of |tna| and |tnb| + // exceeds that. + } + } + } + + // t0,t1,c = r0,r1 + r2,r3 = a0*b0 + a1*b1 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + + // t2,t3,c = t0,t1,c + neg*t2,t3 = (a0 - a1)*(b1 - b0) + a1*b1 + a0*b0. + // The second term is stored as the absolute value, so we do this with a + // constant-time select. + 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_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. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (int i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The product should fit without carries. + assert(c == 0); +} + +// bn_mul_impl implements |BN_mul| and |bn_mul_consttime|. Note this function +// breaks |BIGNUM| invariants and may return a negative zero. This is handled by +// the callers. +static int bn_mul_impl(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int al = a->width; + int bl = b->width; + if (al == 0 || bl == 0) { + BN_zero(r); + return 1; + } + + int ret = 0; + BIGNUM *rr; + BN_CTX_start(ctx); + if (r == a || r == b) { + rr = BN_CTX_get(ctx); + if (rr == NULL) { + goto err; + } + } else { + rr = r; + } + rr->neg = a->neg ^ b->neg; + + int i = al - bl; + if (i == 0) { + if (al == 8) { + if (!bn_wexpand(rr, 16)) { + goto err; + } + rr->width = 16; + bn_mul_comba8(rr->d, a->d, b->d); + goto end; + } + } + + int top = al + bl; + static const int kMulNormalSize = 16; + if (al >= kMulNormalSize && bl >= kMulNormalSize) { + if (-1 <= i && i <= 1) { + // Find the larger power of two less than or equal to the larger length. + int j; + if (i >= 0) { + j = BN_num_bits_word((BN_ULONG)al); + } else { + j = BN_num_bits_word((BN_ULONG)bl); + } + j = 1 << (j - 1); + assert(j <= al || j <= bl); + BIGNUM *t = BN_CTX_get(ctx); + if (t == NULL) { + goto err; + } + if (al > j || bl > j) { + // We know |al| and |bl| are at most one from each other, so if al > j, + // bl >= j, and vice versa. Thus we can use |bn_mul_part_recursive|. + assert(al >= j && bl >= j); + if (!bn_wexpand(t, j * 8) || + !bn_wexpand(rr, j * 4)) { + goto err; + } + bn_mul_part_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d); + } else { + // al <= j && bl <= j. Additionally, we know j <= al or j <= bl, so one + // of al - j or bl - j is zero. The other, by the bound on |i| above, is + // zero or -1. Thus, we can use |bn_mul_recursive|. + if (!bn_wexpand(t, j * 4) || + !bn_wexpand(rr, j * 2)) { + goto err; + } + bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d); + } + rr->width = top; + goto end; + } + } + + if (!bn_wexpand(rr, top)) { + goto err; + } + rr->width = top; + bn_mul_normal(rr->d, a->d, al, b->d, bl); + +end: + if (r != rr && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + if (!bn_mul_impl(r, a, b, ctx)) { + return 0; + } + + // This additionally fixes any negative zeros created by |bn_mul_impl|. + bn_set_minimal_width(r); + return 1; +} + +int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + // Prevent negative zeros. + if (a->neg || b->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + return bn_mul_impl(r, a, b, ctx); +} + +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) { + abort(); + } + // TODO(davidben): Should this call |bn_mul_comba4| too? |BN_mul| does not + // hit that code. + if (num_a == 8 && num_b == 8) { + bn_mul_comba8(r, a, b); + } else { + bn_mul_normal(r, a, num_a, b, num_b); + } +} + +// tmp must have 2*n words +static void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, size_t n, + BN_ULONG *tmp) { + if (n == 0) { + return; + } + + size_t max = n * 2; + const BN_ULONG *ap = a; + BN_ULONG *rp = r; + rp[0] = rp[max - 1] = 0; + rp++; + + // Compute the contribution of a[i] * a[j] for all i < j. + if (n > 1) { + ap++; + rp[n - 1] = bn_mul_words(rp, ap, n - 1, ap[-1]); + rp += 2; + } + if (n > 2) { + for (size_t i = n - 2; i > 0; i--) { + ap++; + rp[i] = bn_mul_add_words(rp, ap, i, ap[-1]); + rp += 2; + } + } + + // The final result fits in |max| words, so none of the following operations + // will overflow. + + // Double |r|, giving the contribution of a[i] * a[j] for all i != j. + bn_add_words(r, r, r, max); + + // Add in the contribution of a[i] * a[i] for all i. + bn_sqr_words(tmp, a, n); + bn_add_words(r, r, tmp, max); +} + +// bn_sqr_recursive sets |r| to |a|^2, using |t| as scratch space. |r| has +// length 2*|n2|, |a| has length |n2|, and |t| has length 4*|n2|. |n2| must be +// a power of two. +static void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, size_t n2, + BN_ULONG *t) { + // |n2| is a power of two. + assert(n2 != 0 && (n2 & (n2 - 1)) == 0); + + if (n2 == 4) { + bn_sqr_comba4(r, a); + return; + } + if (n2 == 8) { + bn_sqr_comba8(r, a); + return; + } + if (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL) { + bn_sqr_normal(r, a, n2, t); + return; + } + + // Split |a| into a0,a1, each of size |n|. + // Split |t| into t0,t1,t2,t3, each of size |n|, with the remaining 4*|n| used + // for recursive calls. + // Split |r| into r0,r1,r2,r3. We must contribute a0^2 to r0,r1, 2*a0*a1 to + // r1,r2, and a1^2 to r2,r3. + size_t n = n2 / 2; + BN_ULONG *t_recursive = &t[n2 * 2]; + + // t0 = |a0 - a1|. + bn_abs_sub_words(t, a, &a[n], n, &t[n]); + // t2,t3 = t0^2 = |a0 - a1|^2 = a0^2 - 2*a0*a1 + a1^2 + bn_sqr_recursive(&t[n2], t, n, t_recursive); + + // r0,r1 = a0^2 + bn_sqr_recursive(r, a, n, t_recursive); + + // r2,r3 = a1^2 + bn_sqr_recursive(&r[n2], &a[n], n, t_recursive); + + // t0,t1,c = r0,r1 + r2,r3 = a0^2 + a1^2 + BN_ULONG c = bn_add_words(t, r, &r[n2], n2); + // t2,t3,c = t0,t1,c - t2,t3 = 2*a0*a1 + c -= bn_sub_words(&t[n2], t, &t[n2], n2); + + // We now have our three components. Add them together. + // r1,r2,c = r1,r2 + t2,t3,c + c += bn_add_words(&r[n], &r[n], &t[n2], n2); + + // Propagate the carry bit to the end. + for (size_t i = n + n2; i < n2 + n2; i++) { + BN_ULONG old = r[i]; + r[i] = old + c; + c = r[i] < old; + } + + // The square should fit without carries. + assert(c == 0); +} + +int BN_mul_word(BIGNUM *bn, BN_ULONG w) { + if (!bn->width) { + return 1; + } + + if (w == 0) { + BN_zero(bn); + return 1; + } + + BN_ULONG ll = bn_mul_words(bn->d, bn->d, bn->width, w); + if (ll) { + if (!bn_wexpand(bn, bn->width + 1)) { + return 0; + } + bn->d[bn->width++] = ll; + } + + return 1; +} + +int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + int al = a->width; + if (al <= 0) { + r->width = 0; + r->neg = 0; + return 1; + } + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *rr = (a != r) ? r : BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (!rr || !tmp) { + goto err; + } + + int max = 2 * al; // Non-zero (from above) + if (!bn_wexpand(rr, max)) { + goto err; + } + + if (al == 4) { + bn_sqr_comba4(rr->d, a->d); + } else if (al == 8) { + bn_sqr_comba8(rr->d, a->d); + } else { + if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) { + BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2]; + bn_sqr_normal(rr->d, a->d, al, t); + } else { + // If |al| is a power of two, we can use |bn_sqr_recursive|. + if (al != 0 && (al & (al - 1)) == 0) { + if (!bn_wexpand(tmp, al * 4)) { + goto err; + } + bn_sqr_recursive(rr->d, a->d, al, tmp->d); + } else { + if (!bn_wexpand(tmp, max)) { + goto err; + } + bn_sqr_normal(rr->d, a->d, al, tmp->d); + } + } + } + + rr->neg = 0; + rr->width = max; + + if (rr != r && !BN_copy(r, rr)) { + goto err; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + if (!bn_sqr_consttime(r, a, ctx)) { + return 0; + } + + bn_set_minimal_width(r); + return 1; +} + +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) { + abort(); + } + if (num_a == 4) { + bn_sqr_comba4(r, a); + } else if (num_a == 8) { + bn_sqr_comba8(r, a); + } else { + BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; + bn_sqr_normal(r, a, num_a, tmp); + OPENSSL_cleanse(tmp, 2 * num_a * sizeof(BN_ULONG)); + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c new file mode 100644 index 0000000..ea41f0f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c.grpc_back new file mode 100644 index 0000000..262822f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c new file mode 100644 index 0000000..cef812c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c @@ -0,0 +1,341 @@ +/* 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 +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../rand/internal.h" + + +int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { + if (rnd == NULL) { + return 0; + } + + if (top != BN_RAND_TOP_ANY && top != BN_RAND_TOP_ONE && + top != BN_RAND_TOP_TWO) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (bottom != BN_RAND_BOTTOM_ANY && bottom != BN_RAND_BOTTOM_ODD) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (bits == 0) { + BN_zero(rnd); + return 1; + } + + if (bits > INT_MAX - (BN_BITS2 - 1)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + + 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) { + rnd->d[words - 1] |= 1; + rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); + } else { + rnd->d[words - 1] |= kThree << (bit - 1); + } + } else { + rnd->d[words - 1] |= kOne << bit; + } + } + if (bottom == BN_RAND_BOTTOM_ODD) { + rnd->d[0] |= 1; + } + + rnd->neg = 0; + rnd->width = words; + return 1; +} + +int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) { + return BN_rand(rnd, bits, top, bottom); +} + +// bn_less_than_word_mask returns a mask of all ones if the number represented +// by |len| words at |a| is less than |b| and zero otherwise. It performs this +// computation in time independent of the value of |a|. |b| is assumed public. +static crypto_word_t bn_less_than_word_mask(const BN_ULONG *a, size_t len, + BN_ULONG b) { + if (b == 0) { + return CONSTTIME_FALSE_W; + } + if (len == 0) { + return CONSTTIME_TRUE_W; + } + + // |a| < |b| iff a[1..len-1] are all zero and a[0] < b. + 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]; + } + // |mask| is now zero iff a[1..len-1] are all zero. + mask = constant_time_is_zero_w(mask); + mask &= constant_time_lt_w(a[0], b); + return mask; +} + +int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len) { + crypto_word_t mask = ~bn_less_than_word_mask(a, len, min_inclusive); + return mask & bn_less_than_words(a, max_exclusive, len); +} + +static int bn_range_to_mask(size_t *out_words, BN_ULONG *out_mask, + size_t min_inclusive, const BN_ULONG *max_exclusive, + size_t len) { + // The magnitude of |max_exclusive| is assumed public. + size_t words = len; + while (words > 0 && max_exclusive[words - 1] == 0) { + words--; + } + if (words == 0 || + (words == 1 && max_exclusive[0] <= min_inclusive)) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_RANGE); + return 0; + } + BN_ULONG mask = max_exclusive[words - 1]; + // This sets all bits in |mask| below the most significant bit. + mask |= mask >> 1; + mask |= mask >> 2; + mask |= mask >> 4; + mask |= mask >> 8; + mask |= mask >> 16; +#if defined(OPENSSL_64_BIT) + mask |= mask >> 32; +#endif + + *out_words = words; + *out_mask = mask; + return 1; +} + +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]) { + // This function implements the equivalent of steps 4 through 7 of FIPS 186-4 + // appendices B.4.2 and B.5.2. When called in those contexts, |max_exclusive| + // is n and |min_inclusive| is one. + + // Compute the bit length of |max_exclusive| (step 1), in terms of a number of + // |words| worth of entropy to fill and a mask of bits to clear in the top + // word. + size_t words; + BN_ULONG mask; + if (!bn_range_to_mask(&words, &mask, min_inclusive, max_exclusive, len)) { + return 0; + } + + // Fill any unused words with zero. + OPENSSL_memset(out + words, 0, (len - words) * sizeof(BN_ULONG)); + + unsigned count = 100; + do { + if (!--count) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_ITERATIONS); + return 0; + } + + // Steps 4 and 5. Use |words| and |mask| together to obtain a string of N + // bits, where N is the bit length of |max_exclusive|. + RAND_bytes_with_additional_data((uint8_t *)out, words * sizeof(BN_ULONG), + additional_data); + out[words - 1] &= mask; + + // If out >= max_exclusive or out < min_inclusive, retry. This implements + // the equivalent of steps 6 and 7 without leaking the value of |out|. + } while (!bn_in_range_words(out, min_inclusive, max_exclusive, words)); + return 1; +} + +int BN_rand_range_ex(BIGNUM *r, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive) { + static const uint8_t kDefaultAdditionalData[32] = {0}; + if (!bn_wexpand(r, max_exclusive->width) || + !bn_rand_range_words(r->d, min_inclusive, max_exclusive->d, + max_exclusive->width, kDefaultAdditionalData)) { + return 0; + } + + r->neg = 0; + r->width = max_exclusive->width; + return 1; +} + +int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive) { + size_t words; + BN_ULONG mask; + if (!bn_range_to_mask(&words, &mask, min_inclusive, max_exclusive->d, + max_exclusive->width) || + !bn_wexpand(r, words)) { + return 0; + } + + assert(words > 0); + assert(mask != 0); + // The range must be large enough for bit tricks to fix invalid values. + if (words == 1 && min_inclusive > mask >> 1) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_RANGE); + return 0; + } + + // Select a uniform random number with num_bits(max_exclusive) bits. + RAND_bytes((uint8_t *)r->d, words * sizeof(BN_ULONG)); + r->d[words - 1] &= mask; + + // Check, in constant-time, if the value is in range. + *out_is_uniform = + bn_in_range_words(r->d, min_inclusive, max_exclusive->d, words); + crypto_word_t in_range = *out_is_uniform; + in_range = 0 - in_range; + + // If the value is not in range, force it to be in range. + r->d[0] |= constant_time_select_w(in_range, 0, min_inclusive); + r->d[words - 1] &= constant_time_select_w(in_range, BN_MASK2, mask >> 1); + assert(bn_in_range_words(r->d, min_inclusive, max_exclusive->d, words)); + + r->neg = 0; + r->width = words; + return 1; +} + +int BN_rand_range(BIGNUM *r, const BIGNUM *range) { + return BN_rand_range_ex(r, 0, range); +} + +int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range) { + return BN_rand_range(r, range); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back new file mode 100644 index 0000000..f6812f1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back @@ -0,0 +1,341 @@ +/* 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 +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../rand/internal.h" + + +int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { + if (rnd == NULL) { + return 0; + } + + if (top != BN_RAND_TOP_ANY && top != BN_RAND_TOP_ONE && + top != BN_RAND_TOP_TWO) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (bottom != BN_RAND_BOTTOM_ANY && bottom != BN_RAND_BOTTOM_ODD) { + OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (bits == 0) { + BN_zero(rnd); + return 1; + } + + if (bits > INT_MAX - (BN_BITS2 - 1)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; + } + + 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) { + rnd->d[words - 1] |= 1; + rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); + } else { + rnd->d[words - 1] |= kThree << (bit - 1); + } + } else { + rnd->d[words - 1] |= kOne << bit; + } + } + if (bottom == BN_RAND_BOTTOM_ODD) { + rnd->d[0] |= 1; + } + + rnd->neg = 0; + rnd->width = words; + return 1; +} + +int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) { + return BN_rand(rnd, bits, top, bottom); +} + +// bn_less_than_word_mask returns a mask of all ones if the number represented +// by |len| words at |a| is less than |b| and zero otherwise. It performs this +// computation in time independent of the value of |a|. |b| is assumed public. +static crypto_word_t bn_less_than_word_mask(const BN_ULONG *a, size_t len, + BN_ULONG b) { + if (b == 0) { + return CONSTTIME_FALSE_W; + } + if (len == 0) { + return CONSTTIME_TRUE_W; + } + + // |a| < |b| iff a[1..len-1] are all zero and a[0] < b. + 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]; + } + // |mask| is now zero iff a[1..len-1] are all zero. + mask = constant_time_is_zero_w(mask); + mask &= constant_time_lt_w(a[0], b); + return mask; +} + +int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len) { + crypto_word_t mask = ~bn_less_than_word_mask(a, len, min_inclusive); + return mask & bn_less_than_words(a, max_exclusive, len); +} + +static int bn_range_to_mask(size_t *out_words, BN_ULONG *out_mask, + size_t min_inclusive, const BN_ULONG *max_exclusive, + size_t len) { + // The magnitude of |max_exclusive| is assumed public. + size_t words = len; + while (words > 0 && max_exclusive[words - 1] == 0) { + words--; + } + if (words == 0 || + (words == 1 && max_exclusive[0] <= min_inclusive)) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_RANGE); + return 0; + } + BN_ULONG mask = max_exclusive[words - 1]; + // This sets all bits in |mask| below the most significant bit. + mask |= mask >> 1; + mask |= mask >> 2; + mask |= mask >> 4; + mask |= mask >> 8; + mask |= mask >> 16; +#if defined(OPENSSL_64_BIT) + mask |= mask >> 32; +#endif + + *out_words = words; + *out_mask = mask; + return 1; +} + +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]) { + // This function implements the equivalent of steps 4 through 7 of FIPS 186-4 + // appendices B.4.2 and B.5.2. When called in those contexts, |max_exclusive| + // is n and |min_inclusive| is one. + + // Compute the bit length of |max_exclusive| (step 1), in terms of a number of + // |words| worth of entropy to fill and a mask of bits to clear in the top + // word. + size_t words; + BN_ULONG mask; + if (!bn_range_to_mask(&words, &mask, min_inclusive, max_exclusive, len)) { + return 0; + } + + // Fill any unused words with zero. + OPENSSL_memset(out + words, 0, (len - words) * sizeof(BN_ULONG)); + + unsigned count = 100; + do { + if (!--count) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_ITERATIONS); + return 0; + } + + // Steps 4 and 5. Use |words| and |mask| together to obtain a string of N + // bits, where N is the bit length of |max_exclusive|. + RAND_bytes_with_additional_data((uint8_t *)out, words * sizeof(BN_ULONG), + additional_data); + out[words - 1] &= mask; + + // If out >= max_exclusive or out < min_inclusive, retry. This implements + // the equivalent of steps 6 and 7 without leaking the value of |out|. + } while (!bn_in_range_words(out, min_inclusive, max_exclusive, words)); + return 1; +} + +int BN_rand_range_ex(BIGNUM *r, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive) { + static const uint8_t kDefaultAdditionalData[32] = {0}; + if (!bn_wexpand(r, max_exclusive->width) || + !bn_rand_range_words(r->d, min_inclusive, max_exclusive->d, + max_exclusive->width, kDefaultAdditionalData)) { + return 0; + } + + r->neg = 0; + r->width = max_exclusive->width; + return 1; +} + +int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive) { + size_t words; + BN_ULONG mask; + if (!bn_range_to_mask(&words, &mask, min_inclusive, max_exclusive->d, + max_exclusive->width) || + !bn_wexpand(r, words)) { + return 0; + } + + assert(words > 0); + assert(mask != 0); + // The range must be large enough for bit tricks to fix invalid values. + if (words == 1 && min_inclusive > mask >> 1) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_RANGE); + return 0; + } + + // Select a uniform random number with num_bits(max_exclusive) bits. + RAND_bytes((uint8_t *)r->d, words * sizeof(BN_ULONG)); + r->d[words - 1] &= mask; + + // Check, in constant-time, if the value is in range. + *out_is_uniform = + bn_in_range_words(r->d, min_inclusive, max_exclusive->d, words); + crypto_word_t in_range = *out_is_uniform; + in_range = 0 - in_range; + + // If the value is not in range, force it to be in range. + r->d[0] |= constant_time_select_w(in_range, 0, min_inclusive); + r->d[words - 1] &= constant_time_select_w(in_range, BN_MASK2, mask >> 1); + assert(bn_in_range_words(r->d, min_inclusive, max_exclusive->d, words)); + + r->neg = 0; + r->width = words; + return 1; +} + +int BN_rand_range(BIGNUM *r, const BIGNUM *range) { + return BN_rand_range_ex(r, 0, range); +} + +int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range) { + return BN_rand_range(r, range); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c new file mode 100644 index 0000000..32a624d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c @@ -0,0 +1,226 @@ +/* + * 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 + */ + +#include "rsaz_exp.h" + +#if defined(RSAZ_ENABLED) + +#include + +#include "internal.h" +#include "../../internal.h" + + +// 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +// two80 is 2^80 in RSAZ's representation. Note RSAZ uses base 2^29, so this is +// 2^(29*2 + 22) = 2^80, not 2^(64*2 + 22). +alignas(64) static const BN_ULONG two80[40] = { + 0, 0, 1 << 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 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, + 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 + 40; + m = storage + 40 * 2; // should not cross page + } else { + m = storage; // should not cross page + result = storage + 40; + a_inv = storage + 40 * 2; + } + + rsaz_1024_norm2red_avx2(m, m_norm); + rsaz_1024_norm2red_avx2(a_inv, base_norm); + rsaz_1024_norm2red_avx2(R2, RR); + + // Convert |R2| from the usual radix, giving R = 2^1024, to RSAZ's radix, + // giving R = 2^(36*29) = 2^1044. + rsaz_1024_mul_avx2(R2, R2, R2, m, k0); + // R2 = 2^2048 * 2^2048 / 2^1044 = 2^3052 + rsaz_1024_mul_avx2(R2, R2, two80, m, k0); + // R2 = 2^3052 * 2^80 / 2^1044 = 2^2088 = (2^1044)^2 + + // table[0] = 1 + rsaz_1024_mul_avx2(result, R2, one, m, k0); + // table[1] = a_inv^1 + rsaz_1024_mul_avx2(a_inv, a_inv, R2, m, k0); + + rsaz_1024_scatter5_avx2(table_s, result, 0); + rsaz_1024_scatter5_avx2(table_s, a_inv, 1); + + // table[2] = a_inv^2 + rsaz_1024_sqr_avx2(result, a_inv, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 2); +#if 0 + // This is almost 2x smaller and less than 1% slower. + for (int index = 3; index < 32; index++) { + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, index); + } +#else + // table[4] = a_inv^4 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 4); + // table[8] = a_inv^8 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 8); + // table[16] = a_inv^16 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 16); + // table[17] = a_inv^17 + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 17); + + // table[3] + rsaz_1024_gather5_avx2(result, table_s, 2); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 3); + // table[6] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 6); + // table[12] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 12); + // table[24] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 24); + // table[25] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 25); + + // table[5] + rsaz_1024_gather5_avx2(result, table_s, 4); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 5); + // table[10] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 10); + // table[20] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 20); + // table[21] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 21); + + // table[7] + rsaz_1024_gather5_avx2(result, table_s, 6); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 7); + // table[14] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 14); + // table[28] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 28); + // table[29] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 29); + + // table[9] + rsaz_1024_gather5_avx2(result, table_s, 8); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 9); + // table[18] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 18); + // table[19] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 19); + + // table[11] + rsaz_1024_gather5_avx2(result, table_s, 10); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 11); + // table[22] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 22); + // table[23] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 23); + + // table[13] + rsaz_1024_gather5_avx2(result, table_s, 12); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 13); + // table[26] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 26); + // table[27] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 27); + + // table[15] + rsaz_1024_gather5_avx2(result, table_s, 14); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 15); + // table[30] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 30); + // table[31] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 31); +#endif + + const uint8_t *p_str = (const uint8_t *)exponent; + + // load first window + int wvalue = p_str[127] >> 3; + rsaz_1024_gather5_avx2(result, table_s, wvalue); + + int index = 1014; + while (index > -1) { // Loop for the remaining 127 windows. + + rsaz_1024_sqr_avx2(result, result, m, k0, 5); + + uint16_t wvalue_16; + memcpy(&wvalue_16, &p_str[index / 8], sizeof(wvalue_16)); + wvalue = wvalue_16; + wvalue = (wvalue >> (index % 8)) & 31; + index -= 5; + + rsaz_1024_gather5_avx2(a_inv, table_s, wvalue); // Borrow |a_inv|. + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + } + + // Square four times. + rsaz_1024_sqr_avx2(result, result, m, k0, 4); + + wvalue = p_str[0] & 15; + + rsaz_1024_gather5_avx2(a_inv, table_s, wvalue); // Borrow |a_inv|. + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + + // Convert from Montgomery. + rsaz_1024_mul_avx2(result, result, one, m, k0); + + rsaz_1024_red2norm_avx2(result_norm, result); + + OPENSSL_cleanse(storage, MOD_EXP_CTIME_STORAGE_LEN * sizeof(BN_ULONG)); +} + +#endif // RSAZ_ENABLED diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back new file mode 100644 index 0000000..7e15aaf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back @@ -0,0 +1,226 @@ +/* + * 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 + */ + +#include "rsaz_exp.h" + +#if defined(RSAZ_ENABLED) + +#include + +#include "internal.h" +#include "../../internal.h" + + +// 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +// two80 is 2^80 in RSAZ's representation. Note RSAZ uses base 2^29, so this is +// 2^(29*2 + 22) = 2^80, not 2^(64*2 + 22). +alignas(64) static const BN_ULONG two80[40] = { + 0, 0, 1 << 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 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, + 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 + 40; + m = storage + 40 * 2; // should not cross page + } else { + m = storage; // should not cross page + result = storage + 40; + a_inv = storage + 40 * 2; + } + + rsaz_1024_norm2red_avx2(m, m_norm); + rsaz_1024_norm2red_avx2(a_inv, base_norm); + rsaz_1024_norm2red_avx2(R2, RR); + + // Convert |R2| from the usual radix, giving R = 2^1024, to RSAZ's radix, + // giving R = 2^(36*29) = 2^1044. + rsaz_1024_mul_avx2(R2, R2, R2, m, k0); + // R2 = 2^2048 * 2^2048 / 2^1044 = 2^3052 + rsaz_1024_mul_avx2(R2, R2, two80, m, k0); + // R2 = 2^3052 * 2^80 / 2^1044 = 2^2088 = (2^1044)^2 + + // table[0] = 1 + rsaz_1024_mul_avx2(result, R2, one, m, k0); + // table[1] = a_inv^1 + rsaz_1024_mul_avx2(a_inv, a_inv, R2, m, k0); + + rsaz_1024_scatter5_avx2(table_s, result, 0); + rsaz_1024_scatter5_avx2(table_s, a_inv, 1); + + // table[2] = a_inv^2 + rsaz_1024_sqr_avx2(result, a_inv, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 2); +#if 0 + // This is almost 2x smaller and less than 1% slower. + for (int index = 3; index < 32; index++) { + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, index); + } +#else + // table[4] = a_inv^4 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 4); + // table[8] = a_inv^8 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 8); + // table[16] = a_inv^16 + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 16); + // table[17] = a_inv^17 + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 17); + + // table[3] + rsaz_1024_gather5_avx2(result, table_s, 2); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 3); + // table[6] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 6); + // table[12] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 12); + // table[24] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 24); + // table[25] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 25); + + // table[5] + rsaz_1024_gather5_avx2(result, table_s, 4); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 5); + // table[10] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 10); + // table[20] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 20); + // table[21] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 21); + + // table[7] + rsaz_1024_gather5_avx2(result, table_s, 6); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 7); + // table[14] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 14); + // table[28] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 28); + // table[29] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 29); + + // table[9] + rsaz_1024_gather5_avx2(result, table_s, 8); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 9); + // table[18] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 18); + // table[19] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 19); + + // table[11] + rsaz_1024_gather5_avx2(result, table_s, 10); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 11); + // table[22] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 22); + // table[23] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 23); + + // table[13] + rsaz_1024_gather5_avx2(result, table_s, 12); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 13); + // table[26] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 26); + // table[27] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 27); + + // table[15] + rsaz_1024_gather5_avx2(result, table_s, 14); + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 15); + // table[30] + rsaz_1024_sqr_avx2(result, result, m, k0, 1); + rsaz_1024_scatter5_avx2(table_s, result, 30); + // table[31] + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + rsaz_1024_scatter5_avx2(table_s, result, 31); +#endif + + const uint8_t *p_str = (const uint8_t *)exponent; + + // load first window + int wvalue = p_str[127] >> 3; + rsaz_1024_gather5_avx2(result, table_s, wvalue); + + int index = 1014; + while (index > -1) { // Loop for the remaining 127 windows. + + rsaz_1024_sqr_avx2(result, result, m, k0, 5); + + uint16_t wvalue_16; + memcpy(&wvalue_16, &p_str[index / 8], sizeof(wvalue_16)); + wvalue = wvalue_16; + wvalue = (wvalue >> (index % 8)) & 31; + index -= 5; + + rsaz_1024_gather5_avx2(a_inv, table_s, wvalue); // Borrow |a_inv|. + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + } + + // Square four times. + rsaz_1024_sqr_avx2(result, result, m, k0, 4); + + wvalue = p_str[0] & 15; + + rsaz_1024_gather5_avx2(a_inv, table_s, wvalue); // Borrow |a_inv|. + rsaz_1024_mul_avx2(result, result, a_inv, m, k0); + + // Convert from Montgomery. + rsaz_1024_mul_avx2(result, result, one, m, k0); + + rsaz_1024_red2norm_avx2(result_norm, result); + + OPENSSL_cleanse(storage, MOD_EXP_CTIME_STORAGE_LEN * sizeof(BN_ULONG)); +} + +#endif // RSAZ_ENABLED diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h new file mode 100644 index 0000000..717c3d4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back new file mode 100644 index 0000000..3b06192 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c new file mode 100644 index 0000000..880866c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c @@ -0,0 +1,364 @@ +/* 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" + + +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { + int i, nw, lb, rb; + BN_ULONG *t, *f; + BN_ULONG l; + + if (n < 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + r->neg = a->neg; + nw = n / BN_BITS2; + if (!bn_wexpand(r, a->width + nw + 1)) { + return 0; + } + lb = n % BN_BITS2; + rb = BN_BITS2 - lb; + f = a->d; + t = r->d; + t[a->width + nw] = 0; + if (lb == 0) { + for (i = a->width - 1; i >= 0; i--) { + t[nw + i] = f[i]; + } + } else { + for (i = a->width - 1; i >= 0; i--) { + l = f[i]; + t[nw + i + 1] |= l >> rb; + t[nw + i] = l << lb; + } + } + OPENSSL_memset(t, 0, nw * sizeof(t[0])); + r->width = a->width + nw + 1; + bn_set_minimal_width(r); + + return 1; +} + +int BN_lshift1(BIGNUM *r, const BIGNUM *a) { + BN_ULONG *ap, *rp, t, c; + int i; + + if (r != a) { + r->neg = a->neg; + if (!bn_wexpand(r, a->width + 1)) { + return 0; + } + r->width = a->width; + } else { + if (!bn_wexpand(r, a->width + 1)) { + return 0; + } + } + ap = a->d; + rp = r->d; + c = 0; + for (i = 0; i < a->width; i++) { + t = *(ap++); + *(rp++) = (t << 1) | c; + c = t >> (BN_BITS2 - 1); + } + if (c) { + *rp = 1; + r->width++; + } + + return 1; +} + +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) { + OPENSSL_memset(r, 0, num * sizeof(BN_ULONG)); + return; + } + if (shift_bits == 0) { + OPENSSL_memmove(r, a + shift_words, (num - shift_words) * sizeof(BN_ULONG)); + } else { + for (size_t i = shift_words; i < num - 1; i++) { + r[i - shift_words] = + (a[i] >> shift_bits) | (a[i + 1] << (BN_BITS2 - shift_bits)); + } + r[num - 1 - shift_words] = a[num - 1] >> shift_bits; + } + OPENSSL_memset(r + num - shift_words, 0, shift_words * sizeof(BN_ULONG)); +} + +int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { + if (n < 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + if (!bn_wexpand(r, a->width)) { + return 0; + } + bn_rshift_words(r->d, a->d, n, a->width); + r->neg = a->neg; + r->width = a->width; + bn_set_minimal_width(r); + return 1; +} + +int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, unsigned n, + BN_CTX *ctx) { + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL || + !BN_copy(r, a) || + !bn_wexpand(tmp, r->width)) { + goto err; + } + + // Shift conditionally by powers of two. + unsigned max_bits = BN_BITS2 * r->width; + for (unsigned i = 0; (max_bits >> i) != 0; i++) { + BN_ULONG mask = (n >> i) & 1; + mask = 0 - mask; + bn_rshift_words(tmp->d, r->d, 1u << i, r->width); + bn_select_words(r->d, mask, tmp->d /* apply shift */, + r->d /* ignore shift */, r->width); + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num) { + if (num == 0) { + return; + } + for (size_t i = 0; i < num - 1; i++) { + r[i] = (a[i] >> 1) | (a[i + 1] << (BN_BITS2 - 1)); + } + r[num - 1] = a[num - 1] >> 1; +} + +int BN_rshift1(BIGNUM *r, const BIGNUM *a) { + if (!bn_wexpand(r, a->width)) { + return 0; + } + bn_rshift1_words(r->d, a->d, a->width); + r->width = a->width; + r->neg = a->neg; + bn_set_minimal_width(r); + return 1; +} + +int BN_set_bit(BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + + int i = n / BN_BITS2; + int j = n % BN_BITS2; + if (a->width <= i) { + if (!bn_wexpand(a, i + 1)) { + return 0; + } + for (int k = a->width; k < i + 1; k++) { + a->d[k] = 0; + } + a->width = i + 1; + } + + a->d[i] |= (((BN_ULONG)1) << j); + + return 1; +} + +int BN_clear_bit(BIGNUM *a, int n) { + int i, j; + + if (n < 0) { + return 0; + } + + i = n / BN_BITS2; + j = n % BN_BITS2; + if (a->width <= i) { + return 0; + } + + a->d[i] &= (~(((BN_ULONG)1) << j)); + bn_set_minimal_width(a); + return 1; +} + +int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit) { + unsigned i = bit / BN_BITS2; + unsigned j = bit % BN_BITS2; + if (i >= num) { + return 0; + } + return (a[i] >> j) & 1; +} + +int BN_is_bit_set(const BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + return bn_is_bit_set_words(a->d, a->width, n); +} + +int BN_mask_bits(BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + + int w = n / BN_BITS2; + int b = n % BN_BITS2; + if (w >= a->width) { + return 1; + } + if (b == 0) { + a->width = w; + } else { + a->width = w + 1; + a->d[w] &= ~(BN_MASK2 << b); + } + + bn_set_minimal_width(a); + return 1; +} + +static int bn_count_low_zero_bits_word(BN_ULONG l) { + 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_STATIC_ASSERT(sizeof(BN_ULONG) >= sizeof(int), + "BN_ULONG gets promoted to int"); + + crypto_word_t mask; + int bits = 0; + +#if BN_BITS2 > 32 + // Check if the lower half of |x| are all zero. + mask = constant_time_is_zero_w(l << (BN_BITS2 - 32)); + // If the lower half is all zeros, it is included in the bit count and we + // count the upper half. Otherwise, we count the lower half. + bits += 32 & mask; + l = constant_time_select_w(mask, l >> 32, l); +#endif + + // The remaining blocks are analogous iterations at lower powers of two. + mask = constant_time_is_zero_w(l << (BN_BITS2 - 16)); + bits += 16 & mask; + l = constant_time_select_w(mask, l >> 16, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 8)); + bits += 8 & mask; + l = constant_time_select_w(mask, l >> 8, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 4)); + bits += 4 & mask; + l = constant_time_select_w(mask, l >> 4, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 2)); + bits += 2 & mask; + l = constant_time_select_w(mask, l >> 2, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 1)); + bits += 1 & mask; + + return bits; +} + +int BN_count_low_zero_bits(const BIGNUM *bn) { + 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; + for (int i = 0; i < bn->width; i++) { + crypto_word_t nonzero = ~constant_time_is_zero_w(bn->d[i]); + crypto_word_t first_nonzero = ~saw_nonzero & nonzero; + saw_nonzero |= nonzero; + + int bits = bn_count_low_zero_bits_word(bn->d[i]); + ret |= first_nonzero & (i * BN_BITS2 + bits); + } + + // If got to the end of |bn| and saw no non-zero words, |bn| is zero. |ret| + // will then remain zero. + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back new file mode 100644 index 0000000..523da67 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back @@ -0,0 +1,364 @@ +/* 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" + + +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { + int i, nw, lb, rb; + BN_ULONG *t, *f; + BN_ULONG l; + + if (n < 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + r->neg = a->neg; + nw = n / BN_BITS2; + if (!bn_wexpand(r, a->width + nw + 1)) { + return 0; + } + lb = n % BN_BITS2; + rb = BN_BITS2 - lb; + f = a->d; + t = r->d; + t[a->width + nw] = 0; + if (lb == 0) { + for (i = a->width - 1; i >= 0; i--) { + t[nw + i] = f[i]; + } + } else { + for (i = a->width - 1; i >= 0; i--) { + l = f[i]; + t[nw + i + 1] |= l >> rb; + t[nw + i] = l << lb; + } + } + OPENSSL_memset(t, 0, nw * sizeof(t[0])); + r->width = a->width + nw + 1; + bn_set_minimal_width(r); + + return 1; +} + +int BN_lshift1(BIGNUM *r, const BIGNUM *a) { + BN_ULONG *ap, *rp, t, c; + int i; + + if (r != a) { + r->neg = a->neg; + if (!bn_wexpand(r, a->width + 1)) { + return 0; + } + r->width = a->width; + } else { + if (!bn_wexpand(r, a->width + 1)) { + return 0; + } + } + ap = a->d; + rp = r->d; + c = 0; + for (i = 0; i < a->width; i++) { + t = *(ap++); + *(rp++) = (t << 1) | c; + c = t >> (BN_BITS2 - 1); + } + if (c) { + *rp = 1; + r->width++; + } + + return 1; +} + +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) { + OPENSSL_memset(r, 0, num * sizeof(BN_ULONG)); + return; + } + if (shift_bits == 0) { + OPENSSL_memmove(r, a + shift_words, (num - shift_words) * sizeof(BN_ULONG)); + } else { + for (size_t i = shift_words; i < num - 1; i++) { + r[i - shift_words] = + (a[i] >> shift_bits) | (a[i + 1] << (BN_BITS2 - shift_bits)); + } + r[num - 1 - shift_words] = a[num - 1] >> shift_bits; + } + OPENSSL_memset(r + num - shift_words, 0, shift_words * sizeof(BN_ULONG)); +} + +int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { + if (n < 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + + if (!bn_wexpand(r, a->width)) { + return 0; + } + bn_rshift_words(r->d, a->d, n, a->width); + r->neg = a->neg; + r->width = a->width; + bn_set_minimal_width(r); + return 1; +} + +int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, unsigned n, + BN_CTX *ctx) { + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL || + !BN_copy(r, a) || + !bn_wexpand(tmp, r->width)) { + goto err; + } + + // Shift conditionally by powers of two. + unsigned max_bits = BN_BITS2 * r->width; + for (unsigned i = 0; (max_bits >> i) != 0; i++) { + BN_ULONG mask = (n >> i) & 1; + mask = 0 - mask; + bn_rshift_words(tmp->d, r->d, 1u << i, r->width); + bn_select_words(r->d, mask, tmp->d /* apply shift */, + r->d /* ignore shift */, r->width); + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num) { + if (num == 0) { + return; + } + for (size_t i = 0; i < num - 1; i++) { + r[i] = (a[i] >> 1) | (a[i + 1] << (BN_BITS2 - 1)); + } + r[num - 1] = a[num - 1] >> 1; +} + +int BN_rshift1(BIGNUM *r, const BIGNUM *a) { + if (!bn_wexpand(r, a->width)) { + return 0; + } + bn_rshift1_words(r->d, a->d, a->width); + r->width = a->width; + r->neg = a->neg; + bn_set_minimal_width(r); + return 1; +} + +int BN_set_bit(BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + + int i = n / BN_BITS2; + int j = n % BN_BITS2; + if (a->width <= i) { + if (!bn_wexpand(a, i + 1)) { + return 0; + } + for (int k = a->width; k < i + 1; k++) { + a->d[k] = 0; + } + a->width = i + 1; + } + + a->d[i] |= (((BN_ULONG)1) << j); + + return 1; +} + +int BN_clear_bit(BIGNUM *a, int n) { + int i, j; + + if (n < 0) { + return 0; + } + + i = n / BN_BITS2; + j = n % BN_BITS2; + if (a->width <= i) { + return 0; + } + + a->d[i] &= (~(((BN_ULONG)1) << j)); + bn_set_minimal_width(a); + return 1; +} + +int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit) { + unsigned i = bit / BN_BITS2; + unsigned j = bit % BN_BITS2; + if (i >= num) { + return 0; + } + return (a[i] >> j) & 1; +} + +int BN_is_bit_set(const BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + return bn_is_bit_set_words(a->d, a->width, n); +} + +int BN_mask_bits(BIGNUM *a, int n) { + if (n < 0) { + return 0; + } + + int w = n / BN_BITS2; + int b = n % BN_BITS2; + if (w >= a->width) { + return 1; + } + if (b == 0) { + a->width = w; + } else { + a->width = w + 1; + a->d[w] &= ~(BN_MASK2 << b); + } + + bn_set_minimal_width(a); + return 1; +} + +static int bn_count_low_zero_bits_word(BN_ULONG l) { + 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_STATIC_ASSERT(sizeof(BN_ULONG) >= sizeof(int), + "BN_ULONG gets promoted to int"); + + crypto_word_t mask; + int bits = 0; + +#if BN_BITS2 > 32 + // Check if the lower half of |x| are all zero. + mask = constant_time_is_zero_w(l << (BN_BITS2 - 32)); + // If the lower half is all zeros, it is included in the bit count and we + // count the upper half. Otherwise, we count the lower half. + bits += 32 & mask; + l = constant_time_select_w(mask, l >> 32, l); +#endif + + // The remaining blocks are analogous iterations at lower powers of two. + mask = constant_time_is_zero_w(l << (BN_BITS2 - 16)); + bits += 16 & mask; + l = constant_time_select_w(mask, l >> 16, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 8)); + bits += 8 & mask; + l = constant_time_select_w(mask, l >> 8, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 4)); + bits += 4 & mask; + l = constant_time_select_w(mask, l >> 4, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 2)); + bits += 2 & mask; + l = constant_time_select_w(mask, l >> 2, l); + + mask = constant_time_is_zero_w(l << (BN_BITS2 - 1)); + bits += 1 & mask; + + return bits; +} + +int BN_count_low_zero_bits(const BIGNUM *bn) { + 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; + for (int i = 0; i < bn->width; i++) { + crypto_word_t nonzero = ~constant_time_is_zero_w(bn->d[i]); + crypto_word_t first_nonzero = ~saw_nonzero & nonzero; + saw_nonzero |= nonzero; + + int bits = bn_count_low_zero_bits_word(bn->d[i]); + ret |= first_nonzero & (i * BN_BITS2 + bits); + } + + // If got to the end of |bn| and saw no non-zero words, |bn| is zero. |ret| + // will then remain zero. + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c new file mode 100644 index 0000000..6dd88fe --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c @@ -0,0 +1,502 @@ +/* Written by Lenka Fibikova + * and Bodo Moeller for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 1998-2000 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" + + +BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { + // Compute a square root of |a| mod |p| using the Tonelli/Shanks algorithm + // (cf. Henri Cohen, "A Course in Algebraic Computational Number Theory", + // algorithm 1.5.1). |p| is assumed to be a prime. + + BIGNUM *ret = in; + int err = 1; + int r; + BIGNUM *A, *b, *q, *t, *x, *y; + int e, i, j; + + if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) { + if (BN_abs_is_word(p, 2)) { + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + if (!BN_set_word(ret, BN_is_bit_set(a, 0))) { + if (ret != in) { + BN_free(ret); + } + return NULL; + } + return ret; + } + + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + return (NULL); + } + + if (BN_is_zero(a) || BN_is_one(a)) { + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + if (!BN_set_word(ret, BN_is_one(a))) { + if (ret != in) { + BN_free(ret); + } + return NULL; + } + return ret; + } + + BN_CTX_start(ctx); + A = BN_CTX_get(ctx); + b = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + t = BN_CTX_get(ctx); + x = BN_CTX_get(ctx); + y = BN_CTX_get(ctx); + if (y == NULL) { + goto end; + } + + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + + // A = a mod p + if (!BN_nnmod(A, a, p, ctx)) { + goto end; + } + + // now write |p| - 1 as 2^e*q where q is odd + e = 1; + while (!BN_is_bit_set(p, e)) { + e++; + } + // we'll set q later (if needed) + + if (e == 1) { + // The easy case: (|p|-1)/2 is odd, so 2 has an inverse + // modulo (|p|-1)/2, and square roots can be computed + // directly by modular exponentiation. + // We have + // 2 * (|p|+1)/4 == 1 (mod (|p|-1)/2), + // so we can use exponent (|p|+1)/4, i.e. (|p|-3)/4 + 1. + if (!BN_rshift(q, p, 2)) { + goto end; + } + q->neg = 0; + if (!BN_add_word(q, 1) || + !BN_mod_exp_mont(ret, A, q, p, ctx, NULL)) { + goto end; + } + err = 0; + goto vrfy; + } + + if (e == 2) { + // |p| == 5 (mod 8) + // + // In this case 2 is always a non-square since + // Legendre(2,p) = (-1)^((p^2-1)/8) for any odd prime. + // So if a really is a square, then 2*a is a non-square. + // Thus for + // b := (2*a)^((|p|-5)/8), + // i := (2*a)*b^2 + // we have + // i^2 = (2*a)^((1 + (|p|-5)/4)*2) + // = (2*a)^((p-1)/2) + // = -1; + // so if we set + // x := a*b*(i-1), + // then + // x^2 = a^2 * b^2 * (i^2 - 2*i + 1) + // = a^2 * b^2 * (-2*i) + // = a*(-i)*(2*a*b^2) + // = a*(-i)*i + // = a. + // + // (This is due to A.O.L. Atkin, + // , + // November 1992.) + + // t := 2*a + if (!bn_mod_lshift1_consttime(t, A, p, ctx)) { + goto end; + } + + // b := (2*a)^((|p|-5)/8) + if (!BN_rshift(q, p, 3)) { + goto end; + } + q->neg = 0; + if (!BN_mod_exp_mont(b, t, q, p, ctx, NULL)) { + goto end; + } + + // y := b^2 + if (!BN_mod_sqr(y, b, p, ctx)) { + goto end; + } + + // t := (2*a)*b^2 - 1 + if (!BN_mod_mul(t, t, y, p, ctx) || + !BN_sub_word(t, 1)) { + goto end; + } + + // x = a*b*t + if (!BN_mod_mul(x, A, b, p, ctx) || + !BN_mod_mul(x, x, t, p, ctx)) { + goto end; + } + + if (!BN_copy(ret, x)) { + goto end; + } + err = 0; + goto vrfy; + } + + // e > 2, so we really have to use the Tonelli/Shanks algorithm. + // First, find some y that is not a square. + if (!BN_copy(q, p)) { + goto end; // use 'q' as temp + } + q->neg = 0; + i = 2; + do { + // For efficiency, try small numbers first; + // if this fails, try random numbers. + if (i < 22) { + if (!BN_set_word(y, i)) { + goto end; + } + } else { + if (!BN_pseudo_rand(y, BN_num_bits(p), 0, 0)) { + goto end; + } + if (BN_ucmp(y, p) >= 0) { + if (!(p->neg ? BN_add : BN_sub)(y, y, p)) { + goto end; + } + } + // now 0 <= y < |p| + if (BN_is_zero(y)) { + if (!BN_set_word(y, i)) { + goto end; + } + } + } + + r = bn_jacobi(y, q, ctx); // here 'q' is |p| + if (r < -1) { + goto end; + } + if (r == 0) { + // m divides p + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + goto end; + } + } while (r == 1 && ++i < 82); + + if (r != -1) { + // Many rounds and still no non-square -- this is more likely + // a bug than just bad luck. + // Even if p is not prime, we should have found some y + // such that r == -1. + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_ITERATIONS); + goto end; + } + + // Here's our actual 'q': + if (!BN_rshift(q, q, e)) { + goto end; + } + + // Now that we have some non-square, we can find an element + // of order 2^e by computing its q'th power. + if (!BN_mod_exp_mont(y, y, q, p, ctx, NULL)) { + goto end; + } + if (BN_is_one(y)) { + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + goto end; + } + + // Now we know that (if p is indeed prime) there is an integer + // k, 0 <= k < 2^e, such that + // + // a^q * y^k == 1 (mod p). + // + // As a^q is a square and y is not, k must be even. + // q+1 is even, too, so there is an element + // + // X := a^((q+1)/2) * y^(k/2), + // + // and it satisfies + // + // X^2 = a^q * a * y^k + // = a, + // + // so it is the square root that we are looking for. + + // t := (q-1)/2 (note that q is odd) + if (!BN_rshift1(t, q)) { + goto end; + } + + // x := a^((q-1)/2) + if (BN_is_zero(t)) // special case: p = 2^e + 1 + { + if (!BN_nnmod(t, A, p, ctx)) { + goto end; + } + if (BN_is_zero(t)) { + // special case: a == 0 (mod p) + BN_zero(ret); + err = 0; + goto end; + } else if (!BN_one(x)) { + goto end; + } + } else { + if (!BN_mod_exp_mont(x, A, t, p, ctx, NULL)) { + goto end; + } + if (BN_is_zero(x)) { + // special case: a == 0 (mod p) + BN_zero(ret); + err = 0; + goto end; + } + } + + // b := a*x^2 (= a^q) + if (!BN_mod_sqr(b, x, p, ctx) || + !BN_mod_mul(b, b, A, p, ctx)) { + goto end; + } + + // x := a*x (= a^((q+1)/2)) + if (!BN_mod_mul(x, x, A, p, ctx)) { + goto end; + } + + while (1) { + // Now b is a^q * y^k for some even k (0 <= k < 2^E + // where E refers to the original value of e, which we + // don't keep in a variable), and x is a^((q+1)/2) * y^(k/2). + // + // We have a*b = x^2, + // y^2^(e-1) = -1, + // b^2^(e-1) = 1. + + if (BN_is_one(b)) { + if (!BN_copy(ret, x)) { + goto end; + } + err = 0; + goto vrfy; + } + + + // find smallest i such that b^(2^i) = 1 + i = 1; + if (!BN_mod_sqr(t, b, p, ctx)) { + goto end; + } + while (!BN_is_one(t)) { + i++; + if (i == e) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + goto end; + } + if (!BN_mod_mul(t, t, t, p, ctx)) { + goto end; + } + } + + + // t := y^2^(e - i - 1) + if (!BN_copy(t, y)) { + goto end; + } + for (j = e - i - 1; j > 0; j--) { + if (!BN_mod_sqr(t, t, p, ctx)) { + goto end; + } + } + if (!BN_mod_mul(y, t, t, p, ctx) || + !BN_mod_mul(x, x, t, p, ctx) || + !BN_mod_mul(b, b, y, p, ctx)) { + goto end; + } + e = i; + } + +vrfy: + if (!err) { + // verify the result -- the input might have been not a square + // (test added in 0.9.8) + + if (!BN_mod_sqr(x, ret, p, ctx)) { + err = 1; + } + + if (!err && 0 != BN_cmp(x, A)) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + err = 1; + } + } + +end: + if (err) { + if (ret != in) { + BN_clear_free(ret); + } + ret = NULL; + } + BN_CTX_end(ctx); + return ret; +} + +int BN_sqrt(BIGNUM *out_sqrt, const BIGNUM *in, BN_CTX *ctx) { + BIGNUM *estimate, *tmp, *delta, *last_delta, *tmp2; + int ok = 0, last_delta_valid = 0; + + if (in->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (BN_is_zero(in)) { + BN_zero(out_sqrt); + return 1; + } + + BN_CTX_start(ctx); + if (out_sqrt == in) { + estimate = BN_CTX_get(ctx); + } else { + estimate = out_sqrt; + } + tmp = BN_CTX_get(ctx); + last_delta = BN_CTX_get(ctx); + delta = BN_CTX_get(ctx); + if (estimate == NULL || tmp == NULL || last_delta == NULL || delta == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + goto err; + } + + // We estimate that the square root of an n-bit number is 2^{n/2}. + if (!BN_lshift(estimate, BN_value_one(), BN_num_bits(in)/2)) { + goto err; + } + + // This is Newton's method for finding a root of the equation |estimate|^2 - + // |in| = 0. + for (;;) { + // |estimate| = 1/2 * (|estimate| + |in|/|estimate|) + if (!BN_div(tmp, NULL, in, estimate, ctx) || + !BN_add(tmp, tmp, estimate) || + !BN_rshift1(estimate, tmp) || + // |tmp| = |estimate|^2 + !BN_sqr(tmp, estimate, ctx) || + // |delta| = |in| - |tmp| + !BN_sub(delta, in, tmp)) { + OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); + goto err; + } + + delta->neg = 0; + // The difference between |in| and |estimate| squared is required to always + // decrease. This ensures that the loop always terminates, but I don't have + // a proof that it always finds the square root for a given square. + if (last_delta_valid && BN_cmp(delta, last_delta) >= 0) { + break; + } + + last_delta_valid = 1; + + tmp2 = last_delta; + last_delta = delta; + delta = tmp2; + } + + if (BN_cmp(tmp, in) != 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + goto err; + } + + ok = 1; + +err: + if (ok && out_sqrt == in && !BN_copy(out_sqrt, estimate)) { + ok = 0; + } + BN_CTX_end(ctx); + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c.grpc_back new file mode 100644 index 0000000..23417d1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c.grpc_back @@ -0,0 +1,502 @@ +/* Written by Lenka Fibikova + * and Bodo Moeller for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 1998-2000 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" + + +BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { + // Compute a square root of |a| mod |p| using the Tonelli/Shanks algorithm + // (cf. Henri Cohen, "A Course in Algebraic Computational Number Theory", + // algorithm 1.5.1). |p| is assumed to be a prime. + + BIGNUM *ret = in; + int err = 1; + int r; + BIGNUM *A, *b, *q, *t, *x, *y; + int e, i, j; + + if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) { + if (BN_abs_is_word(p, 2)) { + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + if (!BN_set_word(ret, BN_is_bit_set(a, 0))) { + if (ret != in) { + BN_free(ret); + } + return NULL; + } + return ret; + } + + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + return (NULL); + } + + if (BN_is_zero(a) || BN_is_one(a)) { + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + if (!BN_set_word(ret, BN_is_one(a))) { + if (ret != in) { + BN_free(ret); + } + return NULL; + } + return ret; + } + + BN_CTX_start(ctx); + A = BN_CTX_get(ctx); + b = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + t = BN_CTX_get(ctx); + x = BN_CTX_get(ctx); + y = BN_CTX_get(ctx); + if (y == NULL) { + goto end; + } + + if (ret == NULL) { + ret = BN_new(); + } + if (ret == NULL) { + goto end; + } + + // A = a mod p + if (!BN_nnmod(A, a, p, ctx)) { + goto end; + } + + // now write |p| - 1 as 2^e*q where q is odd + e = 1; + while (!BN_is_bit_set(p, e)) { + e++; + } + // we'll set q later (if needed) + + if (e == 1) { + // The easy case: (|p|-1)/2 is odd, so 2 has an inverse + // modulo (|p|-1)/2, and square roots can be computed + // directly by modular exponentiation. + // We have + // 2 * (|p|+1)/4 == 1 (mod (|p|-1)/2), + // so we can use exponent (|p|+1)/4, i.e. (|p|-3)/4 + 1. + if (!BN_rshift(q, p, 2)) { + goto end; + } + q->neg = 0; + if (!BN_add_word(q, 1) || + !BN_mod_exp_mont(ret, A, q, p, ctx, NULL)) { + goto end; + } + err = 0; + goto vrfy; + } + + if (e == 2) { + // |p| == 5 (mod 8) + // + // In this case 2 is always a non-square since + // Legendre(2,p) = (-1)^((p^2-1)/8) for any odd prime. + // So if a really is a square, then 2*a is a non-square. + // Thus for + // b := (2*a)^((|p|-5)/8), + // i := (2*a)*b^2 + // we have + // i^2 = (2*a)^((1 + (|p|-5)/4)*2) + // = (2*a)^((p-1)/2) + // = -1; + // so if we set + // x := a*b*(i-1), + // then + // x^2 = a^2 * b^2 * (i^2 - 2*i + 1) + // = a^2 * b^2 * (-2*i) + // = a*(-i)*(2*a*b^2) + // = a*(-i)*i + // = a. + // + // (This is due to A.O.L. Atkin, + // , + // November 1992.) + + // t := 2*a + if (!bn_mod_lshift1_consttime(t, A, p, ctx)) { + goto end; + } + + // b := (2*a)^((|p|-5)/8) + if (!BN_rshift(q, p, 3)) { + goto end; + } + q->neg = 0; + if (!BN_mod_exp_mont(b, t, q, p, ctx, NULL)) { + goto end; + } + + // y := b^2 + if (!BN_mod_sqr(y, b, p, ctx)) { + goto end; + } + + // t := (2*a)*b^2 - 1 + if (!BN_mod_mul(t, t, y, p, ctx) || + !BN_sub_word(t, 1)) { + goto end; + } + + // x = a*b*t + if (!BN_mod_mul(x, A, b, p, ctx) || + !BN_mod_mul(x, x, t, p, ctx)) { + goto end; + } + + if (!BN_copy(ret, x)) { + goto end; + } + err = 0; + goto vrfy; + } + + // e > 2, so we really have to use the Tonelli/Shanks algorithm. + // First, find some y that is not a square. + if (!BN_copy(q, p)) { + goto end; // use 'q' as temp + } + q->neg = 0; + i = 2; + do { + // For efficiency, try small numbers first; + // if this fails, try random numbers. + if (i < 22) { + if (!BN_set_word(y, i)) { + goto end; + } + } else { + if (!BN_pseudo_rand(y, BN_num_bits(p), 0, 0)) { + goto end; + } + if (BN_ucmp(y, p) >= 0) { + if (!(p->neg ? BN_add : BN_sub)(y, y, p)) { + goto end; + } + } + // now 0 <= y < |p| + if (BN_is_zero(y)) { + if (!BN_set_word(y, i)) { + goto end; + } + } + } + + r = bn_jacobi(y, q, ctx); // here 'q' is |p| + if (r < -1) { + goto end; + } + if (r == 0) { + // m divides p + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + goto end; + } + } while (r == 1 && ++i < 82); + + if (r != -1) { + // Many rounds and still no non-square -- this is more likely + // a bug than just bad luck. + // Even if p is not prime, we should have found some y + // such that r == -1. + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_ITERATIONS); + goto end; + } + + // Here's our actual 'q': + if (!BN_rshift(q, q, e)) { + goto end; + } + + // Now that we have some non-square, we can find an element + // of order 2^e by computing its q'th power. + if (!BN_mod_exp_mont(y, y, q, p, ctx, NULL)) { + goto end; + } + if (BN_is_one(y)) { + OPENSSL_PUT_ERROR(BN, BN_R_P_IS_NOT_PRIME); + goto end; + } + + // Now we know that (if p is indeed prime) there is an integer + // k, 0 <= k < 2^e, such that + // + // a^q * y^k == 1 (mod p). + // + // As a^q is a square and y is not, k must be even. + // q+1 is even, too, so there is an element + // + // X := a^((q+1)/2) * y^(k/2), + // + // and it satisfies + // + // X^2 = a^q * a * y^k + // = a, + // + // so it is the square root that we are looking for. + + // t := (q-1)/2 (note that q is odd) + if (!BN_rshift1(t, q)) { + goto end; + } + + // x := a^((q-1)/2) + if (BN_is_zero(t)) // special case: p = 2^e + 1 + { + if (!BN_nnmod(t, A, p, ctx)) { + goto end; + } + if (BN_is_zero(t)) { + // special case: a == 0 (mod p) + BN_zero(ret); + err = 0; + goto end; + } else if (!BN_one(x)) { + goto end; + } + } else { + if (!BN_mod_exp_mont(x, A, t, p, ctx, NULL)) { + goto end; + } + if (BN_is_zero(x)) { + // special case: a == 0 (mod p) + BN_zero(ret); + err = 0; + goto end; + } + } + + // b := a*x^2 (= a^q) + if (!BN_mod_sqr(b, x, p, ctx) || + !BN_mod_mul(b, b, A, p, ctx)) { + goto end; + } + + // x := a*x (= a^((q+1)/2)) + if (!BN_mod_mul(x, x, A, p, ctx)) { + goto end; + } + + while (1) { + // Now b is a^q * y^k for some even k (0 <= k < 2^E + // where E refers to the original value of e, which we + // don't keep in a variable), and x is a^((q+1)/2) * y^(k/2). + // + // We have a*b = x^2, + // y^2^(e-1) = -1, + // b^2^(e-1) = 1. + + if (BN_is_one(b)) { + if (!BN_copy(ret, x)) { + goto end; + } + err = 0; + goto vrfy; + } + + + // find smallest i such that b^(2^i) = 1 + i = 1; + if (!BN_mod_sqr(t, b, p, ctx)) { + goto end; + } + while (!BN_is_one(t)) { + i++; + if (i == e) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + goto end; + } + if (!BN_mod_mul(t, t, t, p, ctx)) { + goto end; + } + } + + + // t := y^2^(e - i - 1) + if (!BN_copy(t, y)) { + goto end; + } + for (j = e - i - 1; j > 0; j--) { + if (!BN_mod_sqr(t, t, p, ctx)) { + goto end; + } + } + if (!BN_mod_mul(y, t, t, p, ctx) || + !BN_mod_mul(x, x, t, p, ctx) || + !BN_mod_mul(b, b, y, p, ctx)) { + goto end; + } + e = i; + } + +vrfy: + if (!err) { + // verify the result -- the input might have been not a square + // (test added in 0.9.8) + + if (!BN_mod_sqr(x, ret, p, ctx)) { + err = 1; + } + + if (!err && 0 != BN_cmp(x, A)) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + err = 1; + } + } + +end: + if (err) { + if (ret != in) { + BN_clear_free(ret); + } + ret = NULL; + } + BN_CTX_end(ctx); + return ret; +} + +int BN_sqrt(BIGNUM *out_sqrt, const BIGNUM *in, BN_CTX *ctx) { + BIGNUM *estimate, *tmp, *delta, *last_delta, *tmp2; + int ok = 0, last_delta_valid = 0; + + if (in->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (BN_is_zero(in)) { + BN_zero(out_sqrt); + return 1; + } + + BN_CTX_start(ctx); + if (out_sqrt == in) { + estimate = BN_CTX_get(ctx); + } else { + estimate = out_sqrt; + } + tmp = BN_CTX_get(ctx); + last_delta = BN_CTX_get(ctx); + delta = BN_CTX_get(ctx); + if (estimate == NULL || tmp == NULL || last_delta == NULL || delta == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + goto err; + } + + // We estimate that the square root of an n-bit number is 2^{n/2}. + if (!BN_lshift(estimate, BN_value_one(), BN_num_bits(in)/2)) { + goto err; + } + + // This is Newton's method for finding a root of the equation |estimate|^2 - + // |in| = 0. + for (;;) { + // |estimate| = 1/2 * (|estimate| + |in|/|estimate|) + if (!BN_div(tmp, NULL, in, estimate, ctx) || + !BN_add(tmp, tmp, estimate) || + !BN_rshift1(estimate, tmp) || + // |tmp| = |estimate|^2 + !BN_sqr(tmp, estimate, ctx) || + // |delta| = |in| - |tmp| + !BN_sub(delta, in, tmp)) { + OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); + goto err; + } + + delta->neg = 0; + // The difference between |in| and |estimate| squared is required to always + // decrease. This ensures that the loop always terminates, but I don't have + // a proof that it always finds the square root for a given square. + if (last_delta_valid && BN_cmp(delta, last_delta) >= 0) { + break; + } + + last_delta_valid = 1; + + tmp2 = last_delta; + last_delta = delta; + delta = tmp2; + } + + if (BN_cmp(tmp, in) != 0) { + OPENSSL_PUT_ERROR(BN, BN_R_NOT_A_SQUARE); + goto err; + } + + ok = 1; + +err: + if (ok && out_sqrt == in && !BN_copy(out_sqrt, estimate)) { + ok = 0; + } + BN_CTX_end(ctx); + return ok; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c new file mode 100644 index 0000000..66956d9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c @@ -0,0 +1,284 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +size_t EVP_AEAD_key_length(const EVP_AEAD *aead) { return aead->key_len; } + +size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead) { return aead->nonce_len; } + +size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead) { return aead->overhead; } + +size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead) { return aead->max_tag_len; } + +void EVP_AEAD_CTX_zero(EVP_AEAD_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_AEAD_CTX)); +} + +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 *ctx = OPENSSL_malloc(sizeof(EVP_AEAD_CTX)); + EVP_AEAD_CTX_zero(ctx); + + if (EVP_AEAD_CTX_init(ctx, aead, key, key_len, tag_len, NULL)) { + return ctx; + } + + EVP_AEAD_CTX_free(ctx); + return NULL; +} + +void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx) { + EVP_AEAD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +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) { + if (!aead->init) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_DIRECTION_SET); + ctx->aead = NULL; + return 0; + } + return EVP_AEAD_CTX_init_with_direction(ctx, aead, key, key_len, tag_len, + evp_aead_open); +} + +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) { + if (key_len != aead->key_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_KEY_SIZE); + ctx->aead = NULL; + return 0; + } + + ctx->aead = aead; + + int ok; + if (aead->init) { + ok = aead->init(ctx, key, key_len, tag_len); + } else { + ok = aead->init_with_direction(ctx, key, key_len, tag_len, dir); + } + + if (!ok) { + ctx->aead = NULL; + } + + return ok; +} + +void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx) { + if (ctx->aead == NULL) { + return; + } + ctx->aead->cleanup(ctx); + ctx->aead = NULL; +} + +// check_alias returns 1 if |out| is compatible with |in| and 0 otherwise. If +// |in| and |out| alias, we require that |in| == |out|. +static int check_alias(const uint8_t *in, size_t in_len, const uint8_t *out, + size_t out_len) { + if (!buffers_alias(in, in_len, out, out_len)) { + return 1; + } + + return in == out; +} + +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) { + if (in_len + ctx->aead->overhead < in_len /* overflow */) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + goto error; + } + + if (max_out_len < in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + goto error; + } + + if (!check_alias(in, in_len, out, max_out_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + size_t out_tag_len; + if (ctx->aead->seal_scatter(ctx, out, out + in_len, &out_tag_len, + max_out_len - in_len, nonce, nonce_len, in, + in_len, NULL, 0, ad, ad_len)) { + *out_len = in_len + out_tag_len; + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't send raw data. + OPENSSL_memset(out, 0, max_out_len); + *out_len = 0; + return 0; +} + +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) { + // |in| and |out| may alias exactly, |out_tag| may not alias. + if (!check_alias(in, in_len, out, in_len) || + buffers_alias(out, in_len, out_tag, max_out_tag_len) || + buffers_alias(in, in_len, out_tag, max_out_tag_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (!ctx->aead->seal_scatter_supports_extra_in && extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); + goto error; + } + + if (ctx->aead->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)) { + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't send raw data. + OPENSSL_memset(out, 0, in_len); + OPENSSL_memset(out_tag, 0, max_out_tag_len); + *out_tag_len = 0; + return 0; +} + +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) { + if (!check_alias(in, in_len, out, max_out_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (ctx->aead->open) { + if (!ctx->aead->open(ctx, out, out_len, max_out_len, nonce, nonce_len, in, + in_len, ad, ad_len)) { + goto error; + } + return 1; + } + + // AEADs that use the default implementation of open() must set |tag_len| at + // initialization time. + assert(ctx->tag_len); + + if (in_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + goto error; + } + + size_t plaintext_len = in_len - ctx->tag_len; + if (max_out_len < plaintext_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + goto error; + } + if (EVP_AEAD_CTX_open_gather(ctx, out, nonce, nonce_len, in, plaintext_len, + in + plaintext_len, ctx->tag_len, ad, ad_len)) { + *out_len = plaintext_len; + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't try and process bad + // data. + OPENSSL_memset(out, 0, max_out_len); + *out_len = 0; + return 0; +} + +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) { + if (!check_alias(in, in_len, out, in_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (!ctx->aead->open_gather) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_NOT_IMPLEMENTED); + goto error; + } + + if (ctx->aead->open_gather(ctx, out, nonce, nonce_len, in, in_len, in_tag, + in_tag_len, ad, ad_len)) { + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't try and process bad + // data. + OPENSSL_memset(out, 0, in_len); + return 0; +} + +const EVP_AEAD *EVP_AEAD_CTX_aead(const EVP_AEAD_CTX *ctx) { return ctx->aead; } + +int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, + size_t *out_len) { + if (ctx->aead->get_iv == NULL) { + return 0; + } + + return ctx->aead->get_iv(ctx, out_iv, out_len); +} + +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) { + assert(ctx->aead->seal_scatter_supports_extra_in || !extra_in_len); + + if (ctx->aead->tag_len) { + *out_tag_len = ctx->aead->tag_len(ctx, in_len, extra_in_len); + return 1; + } + + if (extra_in_len + ctx->tag_len < extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, ERR_R_OVERFLOW); + *out_tag_len = 0; + return 0; + } + *out_tag_len = extra_in_len + ctx->tag_len; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c.grpc_back new file mode 100644 index 0000000..8d2ad04 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c.grpc_back @@ -0,0 +1,284 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +size_t EVP_AEAD_key_length(const EVP_AEAD *aead) { return aead->key_len; } + +size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead) { return aead->nonce_len; } + +size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead) { return aead->overhead; } + +size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead) { return aead->max_tag_len; } + +void EVP_AEAD_CTX_zero(EVP_AEAD_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_AEAD_CTX)); +} + +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 *ctx = OPENSSL_malloc(sizeof(EVP_AEAD_CTX)); + EVP_AEAD_CTX_zero(ctx); + + if (EVP_AEAD_CTX_init(ctx, aead, key, key_len, tag_len, NULL)) { + return ctx; + } + + EVP_AEAD_CTX_free(ctx); + return NULL; +} + +void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx) { + EVP_AEAD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +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) { + if (!aead->init) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_DIRECTION_SET); + ctx->aead = NULL; + return 0; + } + return EVP_AEAD_CTX_init_with_direction(ctx, aead, key, key_len, tag_len, + evp_aead_open); +} + +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) { + if (key_len != aead->key_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_KEY_SIZE); + ctx->aead = NULL; + return 0; + } + + ctx->aead = aead; + + int ok; + if (aead->init) { + ok = aead->init(ctx, key, key_len, tag_len); + } else { + ok = aead->init_with_direction(ctx, key, key_len, tag_len, dir); + } + + if (!ok) { + ctx->aead = NULL; + } + + return ok; +} + +void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx) { + if (ctx->aead == NULL) { + return; + } + ctx->aead->cleanup(ctx); + ctx->aead = NULL; +} + +// check_alias returns 1 if |out| is compatible with |in| and 0 otherwise. If +// |in| and |out| alias, we require that |in| == |out|. +static int check_alias(const uint8_t *in, size_t in_len, const uint8_t *out, + size_t out_len) { + if (!buffers_alias(in, in_len, out, out_len)) { + return 1; + } + + return in == out; +} + +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) { + if (in_len + ctx->aead->overhead < in_len /* overflow */) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + goto error; + } + + if (max_out_len < in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + goto error; + } + + if (!check_alias(in, in_len, out, max_out_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + size_t out_tag_len; + if (ctx->aead->seal_scatter(ctx, out, out + in_len, &out_tag_len, + max_out_len - in_len, nonce, nonce_len, in, + in_len, NULL, 0, ad, ad_len)) { + *out_len = in_len + out_tag_len; + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't send raw data. + OPENSSL_memset(out, 0, max_out_len); + *out_len = 0; + return 0; +} + +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) { + // |in| and |out| may alias exactly, |out_tag| may not alias. + if (!check_alias(in, in_len, out, in_len) || + buffers_alias(out, in_len, out_tag, max_out_tag_len) || + buffers_alias(in, in_len, out_tag, max_out_tag_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (!ctx->aead->seal_scatter_supports_extra_in && extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); + goto error; + } + + if (ctx->aead->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)) { + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't send raw data. + OPENSSL_memset(out, 0, in_len); + OPENSSL_memset(out_tag, 0, max_out_tag_len); + *out_tag_len = 0; + return 0; +} + +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) { + if (!check_alias(in, in_len, out, max_out_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (ctx->aead->open) { + if (!ctx->aead->open(ctx, out, out_len, max_out_len, nonce, nonce_len, in, + in_len, ad, ad_len)) { + goto error; + } + return 1; + } + + // AEADs that use the default implementation of open() must set |tag_len| at + // initialization time. + assert(ctx->tag_len); + + if (in_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + goto error; + } + + size_t plaintext_len = in_len - ctx->tag_len; + if (max_out_len < plaintext_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + goto error; + } + if (EVP_AEAD_CTX_open_gather(ctx, out, nonce, nonce_len, in, plaintext_len, + in + plaintext_len, ctx->tag_len, ad, ad_len)) { + *out_len = plaintext_len; + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't try and process bad + // data. + OPENSSL_memset(out, 0, max_out_len); + *out_len = 0; + return 0; +} + +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) { + if (!check_alias(in, in_len, out, in_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT); + goto error; + } + + if (!ctx->aead->open_gather) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_NOT_IMPLEMENTED); + goto error; + } + + if (ctx->aead->open_gather(ctx, out, nonce, nonce_len, in, in_len, in_tag, + in_tag_len, ad, ad_len)) { + return 1; + } + +error: + // In the event of an error, clear the output buffer so that a caller + // that doesn't check the return value doesn't try and process bad + // data. + OPENSSL_memset(out, 0, in_len); + return 0; +} + +const EVP_AEAD *EVP_AEAD_CTX_aead(const EVP_AEAD_CTX *ctx) { return ctx->aead; } + +int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, + size_t *out_len) { + if (ctx->aead->get_iv == NULL) { + return 0; + } + + return ctx->aead->get_iv(ctx, out_iv, out_len); +} + +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) { + assert(ctx->aead->seal_scatter_supports_extra_in || !extra_in_len); + + if (ctx->aead->tag_len) { + *out_tag_len = ctx->aead->tag_len(ctx, in_len, extra_in_len); + return 1; + } + + if (extra_in_len + ctx->tag_len < extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, ERR_R_OVERFLOW); + *out_tag_len = 0; + return 0; + } + *out_tag_len = extra_in_len + ctx->tag_len; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c new file mode 100644 index 0000000..15a85ea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c @@ -0,0 +1,620 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); +} + +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) { + EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof(EVP_CIPHER_CTX)); + if (ctx) { + EVP_CIPHER_CTX_init(ctx); + } + return ctx; +} + +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) { + if (c->cipher != NULL && c->cipher->cleanup) { + c->cipher->cleanup(c); + } + OPENSSL_free(c->cipher_data); + + OPENSSL_memset(c, 0, sizeof(EVP_CIPHER_CTX)); + return 1; +} + +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) { + if (ctx) { + EVP_CIPHER_CTX_cleanup(ctx); + OPENSSL_free(ctx); + } +} + +int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) { + if (in == NULL || in->cipher == NULL) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INPUT_NOT_INITIALIZED); + return 0; + } + + EVP_CIPHER_CTX_cleanup(out); + OPENSSL_memcpy(out, in, sizeof(EVP_CIPHER_CTX)); + + if (in->cipher_data && in->cipher->ctx_size) { + out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size); + if (!out->cipher_data) { + out->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); + return 0; + } + OPENSSL_memcpy(out->cipher_data, in->cipher_data, in->cipher->ctx_size); + } + + if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY) { + if (!in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out)) { + out->cipher = NULL; + return 0; + } + } + + return 1; +} + +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, + ENGINE *engine, const uint8_t *key, const uint8_t *iv, + int enc) { + if (enc == -1) { + enc = ctx->encrypt; + } else { + if (enc) { + enc = 1; + } + ctx->encrypt = enc; + } + + if (cipher) { + // Ensure a context left from last time is cleared (the previous check + // attempted to avoid this if the same ENGINE and EVP_CIPHER could be + // used). + if (ctx->cipher) { + EVP_CIPHER_CTX_cleanup(ctx); + // Restore encrypt and flags + ctx->encrypt = enc; + } + + ctx->cipher = cipher; + if (ctx->cipher->ctx_size) { + ctx->cipher_data = OPENSSL_malloc(ctx->cipher->ctx_size); + if (!ctx->cipher_data) { + ctx->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + ctx->cipher_data = NULL; + } + + ctx->key_len = cipher->key_len; + ctx->flags = 0; + + if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) { + if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { + ctx->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INITIALIZATION_ERROR); + return 0; + } + } + } else if (!ctx->cipher) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_CIPHER_SET); + return 0; + } + + // we assume block size is a power of 2 in *cryptUpdate + assert(ctx->cipher->block_size == 1 || ctx->cipher->block_size == 8 || + ctx->cipher->block_size == 16); + + if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { + switch (EVP_CIPHER_CTX_mode(ctx)) { + case EVP_CIPH_STREAM_CIPHER: + case EVP_CIPH_ECB_MODE: + break; + + case EVP_CIPH_CFB_MODE: + ctx->num = 0; + OPENSSL_FALLTHROUGH; + + case EVP_CIPH_CBC_MODE: + assert(EVP_CIPHER_CTX_iv_length(ctx) <= sizeof(ctx->iv)); + if (iv) { + OPENSSL_memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + } + OPENSSL_memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); + break; + + case EVP_CIPH_CTR_MODE: + case EVP_CIPH_OFB_MODE: + ctx->num = 0; + // Don't reuse IV for CTR mode + if (iv) { + OPENSSL_memcpy(ctx->iv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + } + break; + + default: + return 0; + } + } + + if (key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { + if (!ctx->cipher->init(ctx, key, iv, enc)) { + return 0; + } + } + + ctx->buf_len = 0; + ctx->final_used = 0; + ctx->block_mask = ctx->cipher->block_size - 1; + return 1; +} + +int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1); +} + +int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0); +} + +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + int i, j, bl; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + i = ctx->cipher->cipher(ctx, out, in, in_len); + if (i < 0) { + return 0; + } else { + *out_len = i; + } + return 1; + } + + if (in_len <= 0) { + *out_len = 0; + return in_len == 0; + } + + if (ctx->buf_len == 0 && (in_len & ctx->block_mask) == 0) { + if (ctx->cipher->cipher(ctx, out, in, in_len)) { + *out_len = in_len; + return 1; + } else { + *out_len = 0; + return 0; + } + } + + i = ctx->buf_len; + bl = ctx->cipher->block_size; + assert(bl <= (int)sizeof(ctx->buf)); + if (i != 0) { + if (bl - i > in_len) { + OPENSSL_memcpy(&ctx->buf[i], in, in_len); + ctx->buf_len += in_len; + *out_len = 0; + return 1; + } else { + j = bl - i; + OPENSSL_memcpy(&ctx->buf[i], in, j); + if (!ctx->cipher->cipher(ctx, out, ctx->buf, bl)) { + return 0; + } + in_len -= j; + in += j; + out += bl; + *out_len = bl; + } + } else { + *out_len = 0; + } + + i = in_len & ctx->block_mask; + in_len -= i; + if (in_len > 0) { + if (!ctx->cipher->cipher(ctx, out, in, in_len)) { + return 0; + } + *out_len += in_len; + } + + if (i != 0) { + OPENSSL_memcpy(ctx->buf, &in[in_len], i); + } + ctx->buf_len = i; + return 1; +} + +int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len) { + int n, ret; + unsigned int i, b, bl; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + ret = ctx->cipher->cipher(ctx, out, NULL, 0); + if (ret < 0) { + return 0; + } else { + *out_len = ret; + } + return 1; + } + + b = ctx->cipher->block_size; + assert(b <= sizeof(ctx->buf)); + if (b == 1) { + *out_len = 0; + return 1; + } + + bl = ctx->buf_len; + if (ctx->flags & EVP_CIPH_NO_PADDING) { + if (bl) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); + return 0; + } + *out_len = 0; + return 1; + } + + n = b - bl; + for (i = bl; i < b; i++) { + ctx->buf[i] = n; + } + ret = ctx->cipher->cipher(ctx, out, ctx->buf, b); + + if (ret) { + *out_len = b; + } + + return ret; +} + +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + int fix_len; + unsigned int b; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + int r = ctx->cipher->cipher(ctx, out, in, in_len); + if (r < 0) { + *out_len = 0; + return 0; + } else { + *out_len = r; + } + return 1; + } + + if (in_len <= 0) { + *out_len = 0; + return in_len == 0; + } + + if (ctx->flags & EVP_CIPH_NO_PADDING) { + return EVP_EncryptUpdate(ctx, out, out_len, in, in_len); + } + + b = ctx->cipher->block_size; + assert(b <= sizeof(ctx->final)); + + if (ctx->final_used) { + OPENSSL_memcpy(out, ctx->final, b); + out += b; + fix_len = 1; + } else { + fix_len = 0; + } + + if (!EVP_EncryptUpdate(ctx, out, out_len, in, in_len)) { + return 0; + } + + // if we have 'decrypted' a multiple of block size, make sure + // we have a copy of this last block + if (b > 1 && !ctx->buf_len) { + *out_len -= b; + ctx->final_used = 1; + OPENSSL_memcpy(ctx->final, &out[*out_len], b); + } else { + ctx->final_used = 0; + } + + if (fix_len) { + *out_len += b; + } + + return 1; +} + +int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) { + int i, n; + unsigned int b; + *out_len = 0; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + i = ctx->cipher->cipher(ctx, out, NULL, 0); + if (i < 0) { + return 0; + } else { + *out_len = i; + } + return 1; + } + + b = ctx->cipher->block_size; + if (ctx->flags & EVP_CIPH_NO_PADDING) { + if (ctx->buf_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); + return 0; + } + *out_len = 0; + return 1; + } + + if (b > 1) { + if (ctx->buf_len || !ctx->final_used) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_WRONG_FINAL_BLOCK_LENGTH); + return 0; + } + assert(b <= sizeof(ctx->final)); + + // The following assumes that the ciphertext has been authenticated. + // Otherwise it provides a padding oracle. + n = ctx->final[b - 1]; + if (n == 0 || n > (int)b) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + for (i = 0; i < n; i++) { + if (ctx->final[--b] != n) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + } + + n = ctx->cipher->block_size - n; + for (i = 0; i < n; i++) { + out[i] = ctx->final[i]; + } + *out_len = n; + } else { + *out_len = 0; + } + + return 1; +} + +int EVP_Cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + return ctx->cipher->cipher(ctx, out, in, in_len); +} + +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + if (ctx->encrypt) { + return EVP_EncryptUpdate(ctx, out, out_len, in, in_len); + } else { + return EVP_DecryptUpdate(ctx, out, out_len, in, in_len); + } +} + +int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len) { + if (ctx->encrypt) { + return EVP_EncryptFinal_ex(ctx, out, out_len); + } else { + return EVP_DecryptFinal_ex(ctx, out, out_len); + } +} + +const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher; +} + +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; +} + +unsigned EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) { + return ctx->key_len; +} + +unsigned EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->iv_len; +} + +void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) { + return ctx->app_data; +} + +void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) { + ctx->app_data = data; +} + +uint32_t EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->flags & ~EVP_CIPH_MODE_MASK; +} + +uint32_t EVP_CIPHER_CTX_mode(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->flags & EVP_CIPH_MODE_MASK; +} + +int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int command, int arg, void *ptr) { + int ret; + if (!ctx->cipher) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_CIPHER_SET); + return 0; + } + + if (!ctx->cipher->ctrl) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_NOT_IMPLEMENTED); + return 0; + } + + ret = ctx->cipher->ctrl(ctx, command, arg, ptr); + if (ret == -1) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_OPERATION_NOT_IMPLEMENTED); + return 0; + } + + return ret; +} + +int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad) { + if (pad) { + ctx->flags &= ~EVP_CIPH_NO_PADDING; + } else { + ctx->flags |= EVP_CIPH_NO_PADDING; + } + return 1; +} + +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, unsigned key_len) { + if (c->key_len == key_len) { + return 1; + } + + if (key_len == 0 || !(c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_KEY_LENGTH); + return 0; + } + + c->key_len = key_len; + return 1; +} + +int EVP_CIPHER_nid(const EVP_CIPHER *cipher) { return cipher->nid; } + +unsigned EVP_CIPHER_block_size(const EVP_CIPHER *cipher) { + return cipher->block_size; +} + +unsigned EVP_CIPHER_key_length(const EVP_CIPHER *cipher) { + return cipher->key_len; +} + +unsigned EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) { + return cipher->iv_len; +} + +uint32_t EVP_CIPHER_flags(const EVP_CIPHER *cipher) { + return cipher->flags & ~EVP_CIPH_MODE_MASK; +} + +uint32_t EVP_CIPHER_mode(const EVP_CIPHER *cipher) { + return cipher->flags & EVP_CIPH_MODE_MASK; +} + +int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv, int enc) { + if (cipher) { + EVP_CIPHER_CTX_init(ctx); + } + return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); +} + +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit(ctx, cipher, key, iv, 1); +} + +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit(ctx, cipher, key, iv, 0); +} + +int EVP_add_cipher_alias(const char *a, const char *b) { + return 1; +} + +void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, uint32_t flags) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back new file mode 100644 index 0000000..c50c6c5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back @@ -0,0 +1,620 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); +} + +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) { + EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof(EVP_CIPHER_CTX)); + if (ctx) { + EVP_CIPHER_CTX_init(ctx); + } + return ctx; +} + +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) { + if (c->cipher != NULL && c->cipher->cleanup) { + c->cipher->cleanup(c); + } + OPENSSL_free(c->cipher_data); + + OPENSSL_memset(c, 0, sizeof(EVP_CIPHER_CTX)); + return 1; +} + +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) { + if (ctx) { + EVP_CIPHER_CTX_cleanup(ctx); + OPENSSL_free(ctx); + } +} + +int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) { + if (in == NULL || in->cipher == NULL) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INPUT_NOT_INITIALIZED); + return 0; + } + + EVP_CIPHER_CTX_cleanup(out); + OPENSSL_memcpy(out, in, sizeof(EVP_CIPHER_CTX)); + + if (in->cipher_data && in->cipher->ctx_size) { + out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size); + if (!out->cipher_data) { + out->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); + return 0; + } + OPENSSL_memcpy(out->cipher_data, in->cipher_data, in->cipher->ctx_size); + } + + if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY) { + if (!in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out)) { + out->cipher = NULL; + return 0; + } + } + + return 1; +} + +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, + ENGINE *engine, const uint8_t *key, const uint8_t *iv, + int enc) { + if (enc == -1) { + enc = ctx->encrypt; + } else { + if (enc) { + enc = 1; + } + ctx->encrypt = enc; + } + + if (cipher) { + // Ensure a context left from last time is cleared (the previous check + // attempted to avoid this if the same ENGINE and EVP_CIPHER could be + // used). + if (ctx->cipher) { + EVP_CIPHER_CTX_cleanup(ctx); + // Restore encrypt and flags + ctx->encrypt = enc; + } + + ctx->cipher = cipher; + if (ctx->cipher->ctx_size) { + ctx->cipher_data = OPENSSL_malloc(ctx->cipher->ctx_size); + if (!ctx->cipher_data) { + ctx->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + ctx->cipher_data = NULL; + } + + ctx->key_len = cipher->key_len; + ctx->flags = 0; + + if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) { + if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { + ctx->cipher = NULL; + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INITIALIZATION_ERROR); + return 0; + } + } + } else if (!ctx->cipher) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_CIPHER_SET); + return 0; + } + + // we assume block size is a power of 2 in *cryptUpdate + assert(ctx->cipher->block_size == 1 || ctx->cipher->block_size == 8 || + ctx->cipher->block_size == 16); + + if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { + switch (EVP_CIPHER_CTX_mode(ctx)) { + case EVP_CIPH_STREAM_CIPHER: + case EVP_CIPH_ECB_MODE: + break; + + case EVP_CIPH_CFB_MODE: + ctx->num = 0; + OPENSSL_FALLTHROUGH; + + case EVP_CIPH_CBC_MODE: + assert(EVP_CIPHER_CTX_iv_length(ctx) <= sizeof(ctx->iv)); + if (iv) { + OPENSSL_memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + } + OPENSSL_memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); + break; + + case EVP_CIPH_CTR_MODE: + case EVP_CIPH_OFB_MODE: + ctx->num = 0; + // Don't reuse IV for CTR mode + if (iv) { + OPENSSL_memcpy(ctx->iv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + } + break; + + default: + return 0; + } + } + + if (key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { + if (!ctx->cipher->init(ctx, key, iv, enc)) { + return 0; + } + } + + ctx->buf_len = 0; + ctx->final_used = 0; + ctx->block_mask = ctx->cipher->block_size - 1; + return 1; +} + +int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1); +} + +int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0); +} + +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + int i, j, bl; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + i = ctx->cipher->cipher(ctx, out, in, in_len); + if (i < 0) { + return 0; + } else { + *out_len = i; + } + return 1; + } + + if (in_len <= 0) { + *out_len = 0; + return in_len == 0; + } + + if (ctx->buf_len == 0 && (in_len & ctx->block_mask) == 0) { + if (ctx->cipher->cipher(ctx, out, in, in_len)) { + *out_len = in_len; + return 1; + } else { + *out_len = 0; + return 0; + } + } + + i = ctx->buf_len; + bl = ctx->cipher->block_size; + assert(bl <= (int)sizeof(ctx->buf)); + if (i != 0) { + if (bl - i > in_len) { + OPENSSL_memcpy(&ctx->buf[i], in, in_len); + ctx->buf_len += in_len; + *out_len = 0; + return 1; + } else { + j = bl - i; + OPENSSL_memcpy(&ctx->buf[i], in, j); + if (!ctx->cipher->cipher(ctx, out, ctx->buf, bl)) { + return 0; + } + in_len -= j; + in += j; + out += bl; + *out_len = bl; + } + } else { + *out_len = 0; + } + + i = in_len & ctx->block_mask; + in_len -= i; + if (in_len > 0) { + if (!ctx->cipher->cipher(ctx, out, in, in_len)) { + return 0; + } + *out_len += in_len; + } + + if (i != 0) { + OPENSSL_memcpy(ctx->buf, &in[in_len], i); + } + ctx->buf_len = i; + return 1; +} + +int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len) { + int n, ret; + unsigned int i, b, bl; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + ret = ctx->cipher->cipher(ctx, out, NULL, 0); + if (ret < 0) { + return 0; + } else { + *out_len = ret; + } + return 1; + } + + b = ctx->cipher->block_size; + assert(b <= sizeof(ctx->buf)); + if (b == 1) { + *out_len = 0; + return 1; + } + + bl = ctx->buf_len; + if (ctx->flags & EVP_CIPH_NO_PADDING) { + if (bl) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); + return 0; + } + *out_len = 0; + return 1; + } + + n = b - bl; + for (i = bl; i < b; i++) { + ctx->buf[i] = n; + } + ret = ctx->cipher->cipher(ctx, out, ctx->buf, b); + + if (ret) { + *out_len = b; + } + + return ret; +} + +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + int fix_len; + unsigned int b; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + int r = ctx->cipher->cipher(ctx, out, in, in_len); + if (r < 0) { + *out_len = 0; + return 0; + } else { + *out_len = r; + } + return 1; + } + + if (in_len <= 0) { + *out_len = 0; + return in_len == 0; + } + + if (ctx->flags & EVP_CIPH_NO_PADDING) { + return EVP_EncryptUpdate(ctx, out, out_len, in, in_len); + } + + b = ctx->cipher->block_size; + assert(b <= sizeof(ctx->final)); + + if (ctx->final_used) { + OPENSSL_memcpy(out, ctx->final, b); + out += b; + fix_len = 1; + } else { + fix_len = 0; + } + + if (!EVP_EncryptUpdate(ctx, out, out_len, in, in_len)) { + return 0; + } + + // if we have 'decrypted' a multiple of block size, make sure + // we have a copy of this last block + if (b > 1 && !ctx->buf_len) { + *out_len -= b; + ctx->final_used = 1; + OPENSSL_memcpy(ctx->final, &out[*out_len], b); + } else { + ctx->final_used = 0; + } + + if (fix_len) { + *out_len += b; + } + + return 1; +} + +int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) { + int i, n; + unsigned int b; + *out_len = 0; + + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { + i = ctx->cipher->cipher(ctx, out, NULL, 0); + if (i < 0) { + return 0; + } else { + *out_len = i; + } + return 1; + } + + b = ctx->cipher->block_size; + if (ctx->flags & EVP_CIPH_NO_PADDING) { + if (ctx->buf_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); + return 0; + } + *out_len = 0; + return 1; + } + + if (b > 1) { + if (ctx->buf_len || !ctx->final_used) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_WRONG_FINAL_BLOCK_LENGTH); + return 0; + } + assert(b <= sizeof(ctx->final)); + + // The following assumes that the ciphertext has been authenticated. + // Otherwise it provides a padding oracle. + n = ctx->final[b - 1]; + if (n == 0 || n > (int)b) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + for (i = 0; i < n; i++) { + if (ctx->final[--b] != n) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + } + + n = ctx->cipher->block_size - n; + for (i = 0; i < n; i++) { + out[i] = ctx->final[i]; + } + *out_len = n; + } else { + *out_len = 0; + } + + return 1; +} + +int EVP_Cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + return ctx->cipher->cipher(ctx, out, in, in_len); +} + +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len, + const uint8_t *in, int in_len) { + if (ctx->encrypt) { + return EVP_EncryptUpdate(ctx, out, out_len, in, in_len); + } else { + return EVP_DecryptUpdate(ctx, out, out_len, in, in_len); + } +} + +int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, int *out_len) { + if (ctx->encrypt) { + return EVP_EncryptFinal_ex(ctx, out, out_len); + } else { + return EVP_DecryptFinal_ex(ctx, out, out_len); + } +} + +const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher; +} + +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; +} + +unsigned EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) { + return ctx->key_len; +} + +unsigned EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->iv_len; +} + +void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) { + return ctx->app_data; +} + +void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) { + ctx->app_data = data; +} + +uint32_t EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->flags & ~EVP_CIPH_MODE_MASK; +} + +uint32_t EVP_CIPHER_CTX_mode(const EVP_CIPHER_CTX *ctx) { + return ctx->cipher->flags & EVP_CIPH_MODE_MASK; +} + +int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int command, int arg, void *ptr) { + int ret; + if (!ctx->cipher) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_CIPHER_SET); + return 0; + } + + if (!ctx->cipher->ctrl) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_NOT_IMPLEMENTED); + return 0; + } + + ret = ctx->cipher->ctrl(ctx, command, arg, ptr); + if (ret == -1) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_CTRL_OPERATION_NOT_IMPLEMENTED); + return 0; + } + + return ret; +} + +int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad) { + if (pad) { + ctx->flags &= ~EVP_CIPH_NO_PADDING; + } else { + ctx->flags |= EVP_CIPH_NO_PADDING; + } + return 1; +} + +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, unsigned key_len) { + if (c->key_len == key_len) { + return 1; + } + + if (key_len == 0 || !(c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_KEY_LENGTH); + return 0; + } + + c->key_len = key_len; + return 1; +} + +int EVP_CIPHER_nid(const EVP_CIPHER *cipher) { return cipher->nid; } + +unsigned EVP_CIPHER_block_size(const EVP_CIPHER *cipher) { + return cipher->block_size; +} + +unsigned EVP_CIPHER_key_length(const EVP_CIPHER *cipher) { + return cipher->key_len; +} + +unsigned EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) { + return cipher->iv_len; +} + +uint32_t EVP_CIPHER_flags(const EVP_CIPHER *cipher) { + return cipher->flags & ~EVP_CIPH_MODE_MASK; +} + +uint32_t EVP_CIPHER_mode(const EVP_CIPHER *cipher) { + return cipher->flags & EVP_CIPH_MODE_MASK; +} + +int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv, int enc) { + if (cipher) { + EVP_CIPHER_CTX_init(ctx); + } + return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); +} + +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit(ctx, cipher, key, iv, 1); +} + +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv) { + return EVP_CipherInit(ctx, cipher, key, iv, 0); +} + +int EVP_add_cipher_alias(const char *a, const char *b) { + return 1; +} + +void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, uint32_t flags) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c new file mode 100644 index 0000000..808d339 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c.grpc_back new file mode 100644 index 0000000..8f4907f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c new file mode 100644 index 0000000..2aaefbc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c @@ -0,0 +1,237 @@ +/* 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 "../delocate.h" + + +typedef struct { + union { + double align; + DES_key_schedule ks; + } ks; +} EVP_DES_KEY; + +static int des_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *)key; + EVP_DES_KEY *dat = (EVP_DES_KEY *)ctx->cipher_data; + + DES_set_key(deskey, &dat->ks.ks); + return 1; +} + +static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + EVP_DES_KEY *dat = (EVP_DES_KEY *)ctx->cipher_data; + + DES_ncbc_encrypt(in, out, in_len, &dat->ks.ks, (DES_cblock *)ctx->iv, + ctx->encrypt); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_cbc; + out->block_size = 8; + out->key_len = 8; + out->iv_len = 8; + out->ctx_size = sizeof(EVP_DES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_init_key; + out->cipher = des_cbc_cipher; +} + +static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + if (in_len < ctx->cipher->block_size) { + return 1; + } + in_len -= ctx->cipher->block_size; + + EVP_DES_KEY *dat = (EVP_DES_KEY *) ctx->cipher_data; + for (size_t i = 0; i <= in_len; i += ctx->cipher->block_size) { + DES_ecb_encrypt((DES_cblock *) (in + i), (DES_cblock *) (out + i), + &dat->ks.ks, ctx->encrypt); + } + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ecb; + out->block_size = 8; + out->key_len = 8; + out->iv_len = 0; + out->ctx_size = sizeof(EVP_DES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = des_init_key; + out->cipher = des_ecb_cipher; +} + +typedef struct { + union { + double align; + DES_key_schedule ks[3]; + } ks; +} DES_EDE_KEY; + +static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *)key; + DES_EDE_KEY *dat = (DES_EDE_KEY*) ctx->cipher_data; + + DES_set_key(&deskey[0], &dat->ks.ks[0]); + DES_set_key(&deskey[1], &dat->ks.ks[1]); + DES_set_key(&deskey[2], &dat->ks.ks[2]); + + return 1; +} + +static int des_ede3_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + DES_EDE_KEY *dat = (DES_EDE_KEY*) ctx->cipher_data; + + DES_ede3_cbc_encrypt(in, out, in_len, &dat->ks.ks[0], &dat->ks.ks[1], + &dat->ks.ks[2], (DES_cblock *)ctx->iv, ctx->encrypt); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede3_cbc; + out->block_size = 8; + out->key_len = 24; + out->iv_len = 8; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_ede3_init_key; + out->cipher = des_ede3_cbc_cipher; +} + +static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *) key; + DES_EDE_KEY *dat = (DES_EDE_KEY *) ctx->cipher_data; + + DES_set_key(&deskey[0], &dat->ks.ks[0]); + DES_set_key(&deskey[1], &dat->ks.ks[1]); + DES_set_key(&deskey[0], &dat->ks.ks[2]); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede_cbc; + out->block_size = 8; + out->key_len = 16; + out->iv_len = 8; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_ede_init_key; + out->cipher = des_ede3_cbc_cipher; +} + +static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + if (in_len < ctx->cipher->block_size) { + return 1; + } + in_len -= ctx->cipher->block_size; + + DES_EDE_KEY *dat = (DES_EDE_KEY *) ctx->cipher_data; + for (size_t i = 0; i <= in_len; i += ctx->cipher->block_size) { + DES_ecb3_encrypt((DES_cblock *) (in + i), (DES_cblock *) (out + i), + &dat->ks.ks[0], &dat->ks.ks[1], &dat->ks.ks[2], + ctx->encrypt); + } + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede_ecb; + out->block_size = 8; + out->key_len = 16; + out->iv_len = 0; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = des_ede_init_key; + out->cipher = des_ede_ecb_cipher; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede3_ecb; + out->block_size = 8; + out->key_len = 24; + out->iv_len = 0; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_ECB_MODE; + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back new file mode 100644 index 0000000..e77363b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back @@ -0,0 +1,237 @@ +/* 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 "../delocate.h" + + +typedef struct { + union { + double align; + DES_key_schedule ks; + } ks; +} EVP_DES_KEY; + +static int des_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *)key; + EVP_DES_KEY *dat = (EVP_DES_KEY *)ctx->cipher_data; + + DES_set_key(deskey, &dat->ks.ks); + return 1; +} + +static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + EVP_DES_KEY *dat = (EVP_DES_KEY *)ctx->cipher_data; + + DES_ncbc_encrypt(in, out, in_len, &dat->ks.ks, (DES_cblock *)ctx->iv, + ctx->encrypt); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_cbc; + out->block_size = 8; + out->key_len = 8; + out->iv_len = 8; + out->ctx_size = sizeof(EVP_DES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_init_key; + out->cipher = des_cbc_cipher; +} + +static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t in_len) { + if (in_len < ctx->cipher->block_size) { + return 1; + } + in_len -= ctx->cipher->block_size; + + EVP_DES_KEY *dat = (EVP_DES_KEY *) ctx->cipher_data; + for (size_t i = 0; i <= in_len; i += ctx->cipher->block_size) { + DES_ecb_encrypt((DES_cblock *) (in + i), (DES_cblock *) (out + i), + &dat->ks.ks, ctx->encrypt); + } + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ecb; + out->block_size = 8; + out->key_len = 8; + out->iv_len = 0; + out->ctx_size = sizeof(EVP_DES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = des_init_key; + out->cipher = des_ecb_cipher; +} + +typedef struct { + union { + double align; + DES_key_schedule ks[3]; + } ks; +} DES_EDE_KEY; + +static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *)key; + DES_EDE_KEY *dat = (DES_EDE_KEY*) ctx->cipher_data; + + DES_set_key(&deskey[0], &dat->ks.ks[0]); + DES_set_key(&deskey[1], &dat->ks.ks[1]); + DES_set_key(&deskey[2], &dat->ks.ks[2]); + + return 1; +} + +static int des_ede3_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + DES_EDE_KEY *dat = (DES_EDE_KEY*) ctx->cipher_data; + + DES_ede3_cbc_encrypt(in, out, in_len, &dat->ks.ks[0], &dat->ks.ks[1], + &dat->ks.ks[2], (DES_cblock *)ctx->iv, ctx->encrypt); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede3_cbc; + out->block_size = 8; + out->key_len = 24; + out->iv_len = 8; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_ede3_init_key; + out->cipher = des_ede3_cbc_cipher; +} + +static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + DES_cblock *deskey = (DES_cblock *) key; + DES_EDE_KEY *dat = (DES_EDE_KEY *) ctx->cipher_data; + + DES_set_key(&deskey[0], &dat->ks.ks[0]); + DES_set_key(&deskey[1], &dat->ks.ks[1]); + DES_set_key(&deskey[0], &dat->ks.ks[2]); + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede_cbc) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede_cbc; + out->block_size = 8; + out->key_len = 16; + out->iv_len = 8; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = des_ede_init_key; + out->cipher = des_ede3_cbc_cipher; +} + +static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len) { + if (in_len < ctx->cipher->block_size) { + return 1; + } + in_len -= ctx->cipher->block_size; + + DES_EDE_KEY *dat = (DES_EDE_KEY *) ctx->cipher_data; + for (size_t i = 0; i <= in_len; i += ctx->cipher->block_size) { + DES_ecb3_encrypt((DES_cblock *) (in + i), (DES_cblock *) (out + i), + &dat->ks.ks[0], &dat->ks.ks[1], &dat->ks.ks[2], + ctx->encrypt); + } + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede_ecb; + out->block_size = 8; + out->key_len = 16; + out->iv_len = 0; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = des_ede_init_key; + out->cipher = des_ede_ecb_cipher; +} + +DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3) { + memset(out, 0, sizeof(EVP_CIPHER)); + out->nid = NID_des_ede3_ecb; + out->block_size = 8; + out->key_len = 24; + out->iv_len = 0; + out->ctx_size = sizeof(DES_EDE_KEY); + out->flags = EVP_CIPH_ECB_MODE; + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h new file mode 100644 index 0000000..6d0160e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h.grpc_back new file mode 100644 index 0000000..68efe33 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h new file mode 100644 index 0000000..06f3c48 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h @@ -0,0 +1,89 @@ +/* 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_FIPSMODULE_DELOCATE_H +#define OPENSSL_HEADER_FIPSMODULE_DELOCATE_H + +#include + +#include "../internal.h" + + +#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) __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. +#define DEFINE_STATIC_MUTEX(name) \ + DEFINE_BSS_GET(struct CRYPTO_STATIC_MUTEX, name) +// For FIPS builds we require that CRYPTO_EX_DATA_CLASS_INIT be zero. +#define DEFINE_STATIC_EX_DATA_CLASS(name) \ + DEFINE_BSS_GET(CRYPTO_EX_DATA_CLASS, name) +#else +#define DEFINE_BSS_GET(type, name) \ + static type name; \ + static type *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_ONCE(name) \ + static CRYPTO_once_t name = CRYPTO_ONCE_INIT; \ + static CRYPTO_once_t *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_MUTEX(name) \ + static struct CRYPTO_STATIC_MUTEX name = CRYPTO_STATIC_MUTEX_INIT; \ + static struct CRYPTO_STATIC_MUTEX *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_EX_DATA_CLASS(name) \ + static CRYPTO_EX_DATA_CLASS name = CRYPTO_EX_DATA_CLASS_INIT; \ + static CRYPTO_EX_DATA_CLASS *name##_bss_get(void) { return &name; } +#endif + +#define DEFINE_DATA(type, name, accessor_decorations) \ + DEFINE_BSS_GET(type, name##_storage) \ + DEFINE_STATIC_ONCE(name##_once) \ + static void name##_do_init(type *out); \ + static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ + accessor_decorations type *name(void) { \ + CRYPTO_once(name##_once_bss_get(), name##_init); \ + /* See http://c-faq.com/ansi/constmismatch.html for why the following \ + * cast is needed. */ \ + return (const type *)name##_storage_bss_get(); \ + } \ + static void name##_do_init(type *out) + +// DEFINE_METHOD_FUNCTION defines a function named |name| which returns a +// method table of type const |type|*. In FIPS mode, to avoid rel.ro data, it +// is split into a CRYPTO_once_t-guarded initializer in the module and +// unhashed, non-module accessor functions to space reserved in the BSS. The +// method table is initialized by a caller-supplied function which takes a +// parameter named |out| of type |type|*. The caller should follow the macro +// invocation with the body of this function: +// +// DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) { +// out->type = NID_md4; +// out->md_size = MD4_DIGEST_LENGTH; +// out->flags = 0; +// out->init = md4_init; +// out->update = md4_update; +// out->final = md4_final; +// out->block_size = 64; +// out->ctx_size = sizeof(MD4_CTX); +// } +// +// This mechanism does not use a static initializer because their execution +// order is undefined. See FIPS.md for more details. +#define DEFINE_METHOD_FUNCTION(type, name) DEFINE_DATA(type, name, const) + +#define DEFINE_LOCAL_DATA(type, name) DEFINE_DATA(type, name, static const) + +#endif // OPENSSL_HEADER_FIPSMODULE_DELOCATE_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back new file mode 100644 index 0000000..d6564e4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back @@ -0,0 +1,89 @@ +/* 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_FIPSMODULE_DELOCATE_H +#define OPENSSL_HEADER_FIPSMODULE_DELOCATE_H + +#include + +#include "../internal.h" + + +#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) __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. +#define DEFINE_STATIC_MUTEX(name) \ + DEFINE_BSS_GET(struct CRYPTO_STATIC_MUTEX, name) +// For FIPS builds we require that CRYPTO_EX_DATA_CLASS_INIT be zero. +#define DEFINE_STATIC_EX_DATA_CLASS(name) \ + DEFINE_BSS_GET(CRYPTO_EX_DATA_CLASS, name) +#else +#define DEFINE_BSS_GET(type, name) \ + static type name; \ + static type *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_ONCE(name) \ + static CRYPTO_once_t name = CRYPTO_ONCE_INIT; \ + static CRYPTO_once_t *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_MUTEX(name) \ + static struct CRYPTO_STATIC_MUTEX name = CRYPTO_STATIC_MUTEX_INIT; \ + static struct CRYPTO_STATIC_MUTEX *name##_bss_get(void) { return &name; } +#define DEFINE_STATIC_EX_DATA_CLASS(name) \ + static CRYPTO_EX_DATA_CLASS name = CRYPTO_EX_DATA_CLASS_INIT; \ + static CRYPTO_EX_DATA_CLASS *name##_bss_get(void) { return &name; } +#endif + +#define DEFINE_DATA(type, name, accessor_decorations) \ + DEFINE_BSS_GET(type, name##_storage) \ + DEFINE_STATIC_ONCE(name##_once) \ + static void name##_do_init(type *out); \ + static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ + accessor_decorations type *name(void) { \ + CRYPTO_once(name##_once_bss_get(), name##_init); \ + /* See http://c-faq.com/ansi/constmismatch.html for why the following \ + * cast is needed. */ \ + return (const type *)name##_storage_bss_get(); \ + } \ + static void name##_do_init(type *out) + +// DEFINE_METHOD_FUNCTION defines a function named |name| which returns a +// method table of type const |type|*. In FIPS mode, to avoid rel.ro data, it +// is split into a CRYPTO_once_t-guarded initializer in the module and +// unhashed, non-module accessor functions to space reserved in the BSS. The +// method table is initialized by a caller-supplied function which takes a +// parameter named |out| of type |type|*. The caller should follow the macro +// invocation with the body of this function: +// +// DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) { +// out->type = NID_md4; +// out->md_size = MD4_DIGEST_LENGTH; +// out->flags = 0; +// out->init = md4_init; +// out->update = md4_update; +// out->final = md4_final; +// out->block_size = 64; +// out->ctx_size = sizeof(MD4_CTX); +// } +// +// This mechanism does not use a static initializer because their execution +// order is undefined. See FIPS.md for more details. +#define DEFINE_METHOD_FUNCTION(type, name) DEFINE_DATA(type, name, const) + +#define DEFINE_LOCAL_DATA(type, name) DEFINE_DATA(type, name, static const) + +#endif // OPENSSL_HEADER_FIPSMODULE_DELOCATE_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c new file mode 100644 index 0000000..359fcf0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c @@ -0,0 +1,785 @@ +/* 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 "internal.h" + + +static const uint32_t des_skb[8][64] = { + { // for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 + 0x00000000L, 0x00000010L, 0x20000000L, 0x20000010L, 0x00010000L, + 0x00010010L, 0x20010000L, 0x20010010L, 0x00000800L, 0x00000810L, + 0x20000800L, 0x20000810L, 0x00010800L, 0x00010810L, 0x20010800L, + 0x20010810L, 0x00000020L, 0x00000030L, 0x20000020L, 0x20000030L, + 0x00010020L, 0x00010030L, 0x20010020L, 0x20010030L, 0x00000820L, + 0x00000830L, 0x20000820L, 0x20000830L, 0x00010820L, 0x00010830L, + 0x20010820L, 0x20010830L, 0x00080000L, 0x00080010L, 0x20080000L, + 0x20080010L, 0x00090000L, 0x00090010L, 0x20090000L, 0x20090010L, + 0x00080800L, 0x00080810L, 0x20080800L, 0x20080810L, 0x00090800L, + 0x00090810L, 0x20090800L, 0x20090810L, 0x00080020L, 0x00080030L, + 0x20080020L, 0x20080030L, 0x00090020L, 0x00090030L, 0x20090020L, + 0x20090030L, 0x00080820L, 0x00080830L, 0x20080820L, 0x20080830L, + 0x00090820L, 0x00090830L, 0x20090820L, 0x20090830L, }, + { // for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 + 0x00000000L, 0x02000000L, 0x00002000L, 0x02002000L, 0x00200000L, + 0x02200000L, 0x00202000L, 0x02202000L, 0x00000004L, 0x02000004L, + 0x00002004L, 0x02002004L, 0x00200004L, 0x02200004L, 0x00202004L, + 0x02202004L, 0x00000400L, 0x02000400L, 0x00002400L, 0x02002400L, + 0x00200400L, 0x02200400L, 0x00202400L, 0x02202400L, 0x00000404L, + 0x02000404L, 0x00002404L, 0x02002404L, 0x00200404L, 0x02200404L, + 0x00202404L, 0x02202404L, 0x10000000L, 0x12000000L, 0x10002000L, + 0x12002000L, 0x10200000L, 0x12200000L, 0x10202000L, 0x12202000L, + 0x10000004L, 0x12000004L, 0x10002004L, 0x12002004L, 0x10200004L, + 0x12200004L, 0x10202004L, 0x12202004L, 0x10000400L, 0x12000400L, + 0x10002400L, 0x12002400L, 0x10200400L, 0x12200400L, 0x10202400L, + 0x12202400L, 0x10000404L, 0x12000404L, 0x10002404L, 0x12002404L, + 0x10200404L, 0x12200404L, 0x10202404L, 0x12202404L, }, + { // for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 + 0x00000000L, 0x00000001L, 0x00040000L, 0x00040001L, 0x01000000L, + 0x01000001L, 0x01040000L, 0x01040001L, 0x00000002L, 0x00000003L, + 0x00040002L, 0x00040003L, 0x01000002L, 0x01000003L, 0x01040002L, + 0x01040003L, 0x00000200L, 0x00000201L, 0x00040200L, 0x00040201L, + 0x01000200L, 0x01000201L, 0x01040200L, 0x01040201L, 0x00000202L, + 0x00000203L, 0x00040202L, 0x00040203L, 0x01000202L, 0x01000203L, + 0x01040202L, 0x01040203L, 0x08000000L, 0x08000001L, 0x08040000L, + 0x08040001L, 0x09000000L, 0x09000001L, 0x09040000L, 0x09040001L, + 0x08000002L, 0x08000003L, 0x08040002L, 0x08040003L, 0x09000002L, + 0x09000003L, 0x09040002L, 0x09040003L, 0x08000200L, 0x08000201L, + 0x08040200L, 0x08040201L, 0x09000200L, 0x09000201L, 0x09040200L, + 0x09040201L, 0x08000202L, 0x08000203L, 0x08040202L, 0x08040203L, + 0x09000202L, 0x09000203L, 0x09040202L, 0x09040203L, }, + { // for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 + 0x00000000L, 0x00100000L, 0x00000100L, 0x00100100L, 0x00000008L, + 0x00100008L, 0x00000108L, 0x00100108L, 0x00001000L, 0x00101000L, + 0x00001100L, 0x00101100L, 0x00001008L, 0x00101008L, 0x00001108L, + 0x00101108L, 0x04000000L, 0x04100000L, 0x04000100L, 0x04100100L, + 0x04000008L, 0x04100008L, 0x04000108L, 0x04100108L, 0x04001000L, + 0x04101000L, 0x04001100L, 0x04101100L, 0x04001008L, 0x04101008L, + 0x04001108L, 0x04101108L, 0x00020000L, 0x00120000L, 0x00020100L, + 0x00120100L, 0x00020008L, 0x00120008L, 0x00020108L, 0x00120108L, + 0x00021000L, 0x00121000L, 0x00021100L, 0x00121100L, 0x00021008L, + 0x00121008L, 0x00021108L, 0x00121108L, 0x04020000L, 0x04120000L, + 0x04020100L, 0x04120100L, 0x04020008L, 0x04120008L, 0x04020108L, + 0x04120108L, 0x04021000L, 0x04121000L, 0x04021100L, 0x04121100L, + 0x04021008L, 0x04121008L, 0x04021108L, 0x04121108L, }, + { // for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 + 0x00000000L, 0x10000000L, 0x00010000L, 0x10010000L, 0x00000004L, + 0x10000004L, 0x00010004L, 0x10010004L, 0x20000000L, 0x30000000L, + 0x20010000L, 0x30010000L, 0x20000004L, 0x30000004L, 0x20010004L, + 0x30010004L, 0x00100000L, 0x10100000L, 0x00110000L, 0x10110000L, + 0x00100004L, 0x10100004L, 0x00110004L, 0x10110004L, 0x20100000L, + 0x30100000L, 0x20110000L, 0x30110000L, 0x20100004L, 0x30100004L, + 0x20110004L, 0x30110004L, 0x00001000L, 0x10001000L, 0x00011000L, + 0x10011000L, 0x00001004L, 0x10001004L, 0x00011004L, 0x10011004L, + 0x20001000L, 0x30001000L, 0x20011000L, 0x30011000L, 0x20001004L, + 0x30001004L, 0x20011004L, 0x30011004L, 0x00101000L, 0x10101000L, + 0x00111000L, 0x10111000L, 0x00101004L, 0x10101004L, 0x00111004L, + 0x10111004L, 0x20101000L, 0x30101000L, 0x20111000L, 0x30111000L, + 0x20101004L, 0x30101004L, 0x20111004L, 0x30111004L, }, + { // for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 + 0x00000000L, 0x08000000L, 0x00000008L, 0x08000008L, 0x00000400L, + 0x08000400L, 0x00000408L, 0x08000408L, 0x00020000L, 0x08020000L, + 0x00020008L, 0x08020008L, 0x00020400L, 0x08020400L, 0x00020408L, + 0x08020408L, 0x00000001L, 0x08000001L, 0x00000009L, 0x08000009L, + 0x00000401L, 0x08000401L, 0x00000409L, 0x08000409L, 0x00020001L, + 0x08020001L, 0x00020009L, 0x08020009L, 0x00020401L, 0x08020401L, + 0x00020409L, 0x08020409L, 0x02000000L, 0x0A000000L, 0x02000008L, + 0x0A000008L, 0x02000400L, 0x0A000400L, 0x02000408L, 0x0A000408L, + 0x02020000L, 0x0A020000L, 0x02020008L, 0x0A020008L, 0x02020400L, + 0x0A020400L, 0x02020408L, 0x0A020408L, 0x02000001L, 0x0A000001L, + 0x02000009L, 0x0A000009L, 0x02000401L, 0x0A000401L, 0x02000409L, + 0x0A000409L, 0x02020001L, 0x0A020001L, 0x02020009L, 0x0A020009L, + 0x02020401L, 0x0A020401L, 0x02020409L, 0x0A020409L, }, + { // for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 + 0x00000000L, 0x00000100L, 0x00080000L, 0x00080100L, 0x01000000L, + 0x01000100L, 0x01080000L, 0x01080100L, 0x00000010L, 0x00000110L, + 0x00080010L, 0x00080110L, 0x01000010L, 0x01000110L, 0x01080010L, + 0x01080110L, 0x00200000L, 0x00200100L, 0x00280000L, 0x00280100L, + 0x01200000L, 0x01200100L, 0x01280000L, 0x01280100L, 0x00200010L, + 0x00200110L, 0x00280010L, 0x00280110L, 0x01200010L, 0x01200110L, + 0x01280010L, 0x01280110L, 0x00000200L, 0x00000300L, 0x00080200L, + 0x00080300L, 0x01000200L, 0x01000300L, 0x01080200L, 0x01080300L, + 0x00000210L, 0x00000310L, 0x00080210L, 0x00080310L, 0x01000210L, + 0x01000310L, 0x01080210L, 0x01080310L, 0x00200200L, 0x00200300L, + 0x00280200L, 0x00280300L, 0x01200200L, 0x01200300L, 0x01280200L, + 0x01280300L, 0x00200210L, 0x00200310L, 0x00280210L, 0x00280310L, + 0x01200210L, 0x01200310L, 0x01280210L, 0x01280310L, }, + { // for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 + 0x00000000L, 0x04000000L, 0x00040000L, 0x04040000L, 0x00000002L, + 0x04000002L, 0x00040002L, 0x04040002L, 0x00002000L, 0x04002000L, + 0x00042000L, 0x04042000L, 0x00002002L, 0x04002002L, 0x00042002L, + 0x04042002L, 0x00000020L, 0x04000020L, 0x00040020L, 0x04040020L, + 0x00000022L, 0x04000022L, 0x00040022L, 0x04040022L, 0x00002020L, + 0x04002020L, 0x00042020L, 0x04042020L, 0x00002022L, 0x04002022L, + 0x00042022L, 0x04042022L, 0x00000800L, 0x04000800L, 0x00040800L, + 0x04040800L, 0x00000802L, 0x04000802L, 0x00040802L, 0x04040802L, + 0x00002800L, 0x04002800L, 0x00042800L, 0x04042800L, 0x00002802L, + 0x04002802L, 0x00042802L, 0x04042802L, 0x00000820L, 0x04000820L, + 0x00040820L, 0x04040820L, 0x00000822L, 0x04000822L, 0x00040822L, + 0x04040822L, 0x00002820L, 0x04002820L, 0x00042820L, 0x04042820L, + 0x00002822L, 0x04002822L, 0x00042822L, 0x04042822L, }}; + +static const uint32_t DES_SPtrans[8][64] = { + { // nibble 0 + 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L, 0x02000000L, + 0x00080802L, 0x00080002L, 0x02000002L, 0x00080802L, 0x02080800L, + 0x02080000L, 0x00000802L, 0x02000802L, 0x02000000L, 0x00000000L, + 0x00080002L, 0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L, + 0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L, 0x00000002L, + 0x00000800L, 0x00080800L, 0x02080002L, 0x00000800L, 0x02000802L, + 0x02080002L, 0x00000000L, 0x00000000L, 0x02080802L, 0x02000800L, + 0x00080002L, 0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L, + 0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L, 0x00080802L, + 0x00000002L, 0x02000002L, 0x02080000L, 0x02080802L, 0x00080800L, + 0x02080000L, 0x02000802L, 0x02000000L, 0x00000802L, 0x00080002L, + 0x00000000L, 0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L, + 0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L, }, + { // nibble 1 + 0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L, 0x40000010L, + 0x00008010L, 0x40008000L, 0x00108000L, 0x00008000L, 0x40100010L, + 0x00000010L, 0x40008000L, 0x00100010L, 0x40108000L, 0x40100000L, + 0x00000010L, 0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L, + 0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L, 0x40008010L, + 0x00108010L, 0x40108000L, 0x40000010L, 0x40000000L, 0x00100000L, + 0x00008010L, 0x40108010L, 0x00100010L, 0x40108000L, 0x40008000L, + 0x00108010L, 0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L, + 0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L, 0x00008000L, + 0x40000000L, 0x00108010L, 0x40008010L, 0x40108000L, 0x00008000L, + 0x00000000L, 0x40000010L, 0x00000010L, 0x40108010L, 0x00108000L, + 0x40100000L, 0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L, + 0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L, }, + { // nibble 2 + 0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L, 0x00040001L, + 0x04000000L, 0x04000101L, 0x00040100L, 0x04000100L, 0x00040000L, + 0x04040000L, 0x00000001L, 0x04040101L, 0x00000101L, 0x00000001L, + 0x04040001L, 0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L, + 0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L, 0x04040001L, + 0x04000100L, 0x00040101L, 0x04040000L, 0x00040100L, 0x00000000L, + 0x04000000L, 0x00040101L, 0x04040100L, 0x00000100L, 0x00000001L, + 0x00040000L, 0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L, + 0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L, 0x00040001L, + 0x04000000L, 0x04040101L, 0x00000001L, 0x00040101L, 0x04000001L, + 0x04000000L, 0x04040101L, 0x00040000L, 0x04000100L, 0x04000101L, + 0x00040100L, 0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L, + 0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L, }, + { // nibble 3 + 0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L, 0x00000000L, + 0x10400000L, 0x10001008L, 0x00400008L, 0x10401000L, 0x10000008L, + 0x10000000L, 0x00001008L, 0x10000008L, 0x00401008L, 0x00400000L, + 0x10000000L, 0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L, + 0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L, 0x00001008L, + 0x00000000L, 0x00400008L, 0x10401000L, 0x10001000L, 0x10400008L, + 0x10401008L, 0x00400000L, 0x10400008L, 0x00001008L, 0x00400000L, + 0x10000008L, 0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L, + 0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L, 0x00000000L, + 0x10400008L, 0x10401000L, 0x00001000L, 0x10000000L, 0x10401008L, + 0x00401008L, 0x00400000L, 0x10401008L, 0x00000008L, 0x10001000L, + 0x00401008L, 0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L, + 0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L, }, + { // nibble 4 + 0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L, 0x08010020L, + 0x08000400L, 0x00010420L, 0x08010000L, 0x00010000L, 0x00000020L, + 0x08000020L, 0x00010400L, 0x08000420L, 0x08010020L, 0x08010400L, + 0x00000000L, 0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L, + 0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L, 0x00000020L, + 0x08000420L, 0x08010420L, 0x00010020L, 0x08010000L, 0x00000400L, + 0x00000420L, 0x08010400L, 0x08010400L, 0x08000420L, 0x00010020L, + 0x08010000L, 0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L, + 0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L, 0x00010420L, + 0x08000000L, 0x00000400L, 0x00010020L, 0x08000420L, 0x00000400L, + 0x00000000L, 0x08010420L, 0x08010020L, 0x08010400L, 0x00000420L, + 0x00010000L, 0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L, + 0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L, }, + { // nibble 5 + 0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L, 0x00200040L, + 0x00002000L, 0x80002040L, 0x00200000L, 0x00002040L, 0x80202040L, + 0x00202000L, 0x80000000L, 0x80002000L, 0x80000040L, 0x80200000L, + 0x00202040L, 0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L, + 0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L, 0x80202040L, + 0x80200000L, 0x80000000L, 0x00002040L, 0x00000040L, 0x00202000L, + 0x00202040L, 0x80002000L, 0x00002040L, 0x80000000L, 0x80002000L, + 0x00202040L, 0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L, + 0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L, 0x00200040L, + 0x80202040L, 0x00202000L, 0x00000040L, 0x80202040L, 0x00202000L, + 0x00200000L, 0x80002040L, 0x80000040L, 0x80200000L, 0x00202040L, + 0x00000000L, 0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L, + 0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L, }, + { // nibble 6 + 0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L, 0x01004204L, + 0x00004004L, 0x00004200L, 0x00000000L, 0x01000000L, 0x01000204L, + 0x00000204L, 0x01004000L, 0x00000004L, 0x01004200L, 0x01004000L, + 0x00000204L, 0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L, + 0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L, 0x01004004L, + 0x00004204L, 0x01004200L, 0x00000004L, 0x00004204L, 0x01004004L, + 0x00000200L, 0x01000000L, 0x00004204L, 0x01004000L, 0x01004004L, + 0x00000204L, 0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L, + 0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L, 0x00000200L, + 0x01000004L, 0x00000004L, 0x01000200L, 0x00000000L, 0x01000204L, + 0x01000200L, 0x00004200L, 0x00000204L, 0x00004000L, 0x01004204L, + 0x01000000L, 0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L, + 0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L, }, + { // nibble 7 + 0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L, 0x20020000L, + 0x00800080L, 0x20800000L, 0x20820080L, 0x00000080L, 0x20000000L, + 0x00820000L, 0x00020080L, 0x00820080L, 0x20020080L, 0x20000080L, + 0x20800000L, 0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L, + 0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L, 0x20000000L, + 0x00800000L, 0x20020080L, 0x20800080L, 0x00800000L, 0x00020000L, + 0x20820000L, 0x00000080L, 0x00800000L, 0x00020000L, 0x20000080L, + 0x20820080L, 0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L, + 0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L, 0x20820000L, + 0x00000080L, 0x00800080L, 0x20020000L, 0x20820080L, 0x00800000L, + 0x20800000L, 0x20000080L, 0x00820000L, 0x00020080L, 0x20020080L, + 0x20800000L, 0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L, + 0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L, }}; + +#define HPERM_OP(a, t, n, m) \ + ((t) = ((((a) << (16 - (n))) ^ (a)) & (m)), \ + (a) = (a) ^ (t) ^ ((t) >> (16 - (n)))) + +void DES_set_key(const DES_cblock *key, DES_key_schedule *schedule) { + static const int shifts2[16] = {0, 0, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 0}; + uint32_t c, d, t, s, t2; + const uint8_t *in; + int i; + + in = key->bytes; + + c2l(in, c); + c2l(in, d); + + // do PC1 in 47 simple operations :-) + // Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov) + // for the inspiration. :-) + PERM_OP(d, c, t, 4, 0x0f0f0f0fL); + HPERM_OP(c, t, -2, 0xcccc0000L); + HPERM_OP(d, t, -2, 0xcccc0000L); + PERM_OP(d, c, t, 1, 0x55555555L); + PERM_OP(c, d, t, 8, 0x00ff00ffL); + PERM_OP(d, c, t, 1, 0x55555555L); + d = (((d & 0x000000ffL) << 16L) | (d & 0x0000ff00L) | + ((d & 0x00ff0000L) >> 16L) | ((c & 0xf0000000L) >> 4L)); + c &= 0x0fffffffL; + + for (i = 0; i < ITERATIONS; i++) { + if (shifts2[i]) { + c = ((c >> 2L) | (c << 26L)); + d = ((d >> 2L) | (d << 26L)); + } else { + c = ((c >> 1L) | (c << 27L)); + d = ((d >> 1L) | (d << 27L)); + } + c &= 0x0fffffffL; + d &= 0x0fffffffL; + // could be a few less shifts but I am to lazy at this + // point in time to investigate + s = des_skb[0][(c) & 0x3f] | + des_skb[1][((c >> 6L) & 0x03) | ((c >> 7L) & 0x3c)] | + des_skb[2][((c >> 13L) & 0x0f) | ((c >> 14L) & 0x30)] | + des_skb[3][((c >> 20L) & 0x01) | ((c >> 21L) & 0x06) | + ((c >> 22L) & 0x38)]; + t = des_skb[4][(d) & 0x3f] | + des_skb[5][((d >> 7L) & 0x03) | ((d >> 8L) & 0x3c)] | + des_skb[6][(d >> 15L) & 0x3f] | + des_skb[7][((d >> 21L) & 0x0f) | ((d >> 22L) & 0x30)]; + + // table contained 0213 4657 + t2 = ((t << 16L) | (s & 0x0000ffffL)) & 0xffffffffL; + schedule->subkeys[i][0] = ROTATE(t2, 30) & 0xffffffffL; + + t2 = ((s >> 16L) | (t & 0xffff0000L)); + schedule->subkeys[i][1] = ROTATE(t2, 26) & 0xffffffffL; + } +} + +static const uint8_t kOddParity[256] = { + 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, + 14, 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, + 31, 31, 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, + 44, 47, 47, 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, + 61, 61, 62, 62, 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, + 74, 76, 76, 79, 79, 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, + 91, 91, 93, 93, 94, 94, 97, 97, 98, 98, 100, 100, 103, 103, 104, + 104, 107, 107, 109, 109, 110, 110, 112, 112, 115, 115, 117, 117, 118, 118, + 121, 121, 122, 122, 124, 124, 127, 127, 128, 128, 131, 131, 133, 133, 134, + 134, 137, 137, 138, 138, 140, 140, 143, 143, 145, 145, 146, 146, 148, 148, + 151, 151, 152, 152, 155, 155, 157, 157, 158, 158, 161, 161, 162, 162, 164, + 164, 167, 167, 168, 168, 171, 171, 173, 173, 174, 174, 176, 176, 179, 179, + 181, 181, 182, 182, 185, 185, 186, 186, 188, 188, 191, 191, 193, 193, 194, + 194, 196, 196, 199, 199, 200, 200, 203, 203, 205, 205, 206, 206, 208, 208, + 211, 211, 213, 213, 214, 214, 217, 217, 218, 218, 220, 220, 223, 223, 224, + 224, 227, 227, 229, 229, 230, 230, 233, 233, 234, 234, 236, 236, 239, 239, + 241, 241, 242, 242, 244, 244, 247, 247, 248, 248, 251, 251, 253, 253, 254, + 254 +}; + +void DES_set_odd_parity(DES_cblock *key) { + unsigned i; + + for (i = 0; i < DES_KEY_SZ; i++) { + key->bytes[i] = kOddParity[key->bytes[i]]; + } +} + +static void DES_encrypt1(uint32_t *data, const DES_key_schedule *ks, int enc) { + uint32_t l, r, t, u; + + r = data[0]; + l = data[1]; + + IP(r, l); + // Things have been modified so that the initial rotate is done outside + // the loop. This required the DES_SPtrans values in sp.h to be + // rotated 1 bit to the right. One perl script later and things have a + // 5% speed up on a sparc2. Thanks to Richard Outerbridge + // <71755.204@CompuServe.COM> for pointing this out. + // clear the top bits on machines with 8byte longs + // shift left by 2 + r = ROTATE(r, 29) & 0xffffffffL; + l = ROTATE(l, 29) & 0xffffffffL; + + // I don't know if it is worth the effort of loop unrolling the + // inner loop + if (enc) { + D_ENCRYPT(ks, l, r, 0); + D_ENCRYPT(ks, r, l, 1); + D_ENCRYPT(ks, l, r, 2); + D_ENCRYPT(ks, r, l, 3); + D_ENCRYPT(ks, l, r, 4); + D_ENCRYPT(ks, r, l, 5); + D_ENCRYPT(ks, l, r, 6); + D_ENCRYPT(ks, r, l, 7); + D_ENCRYPT(ks, l, r, 8); + D_ENCRYPT(ks, r, l, 9); + D_ENCRYPT(ks, l, r, 10); + D_ENCRYPT(ks, r, l, 11); + D_ENCRYPT(ks, l, r, 12); + D_ENCRYPT(ks, r, l, 13); + D_ENCRYPT(ks, l, r, 14); + D_ENCRYPT(ks, r, l, 15); + } else { + D_ENCRYPT(ks, l, r, 15); + D_ENCRYPT(ks, r, l, 14); + D_ENCRYPT(ks, l, r, 13); + D_ENCRYPT(ks, r, l, 12); + D_ENCRYPT(ks, l, r, 11); + D_ENCRYPT(ks, r, l, 10); + D_ENCRYPT(ks, l, r, 9); + D_ENCRYPT(ks, r, l, 8); + D_ENCRYPT(ks, l, r, 7); + D_ENCRYPT(ks, r, l, 6); + D_ENCRYPT(ks, l, r, 5); + D_ENCRYPT(ks, r, l, 4); + D_ENCRYPT(ks, l, r, 3); + D_ENCRYPT(ks, r, l, 2); + D_ENCRYPT(ks, l, r, 1); + D_ENCRYPT(ks, r, l, 0); + } + + // rotate and clear the top bits on machines with 8byte longs + l = ROTATE(l, 3) & 0xffffffffL; + r = ROTATE(r, 3) & 0xffffffffL; + + FP(r, l); + data[0] = l; + data[1] = r; +} + +static void DES_encrypt2(uint32_t *data, const DES_key_schedule *ks, int enc) { + uint32_t l, r, t, u; + + r = data[0]; + l = data[1]; + + // Things have been modified so that the initial rotate is done outside the + // loop. This required the DES_SPtrans values in sp.h to be rotated 1 bit to + // the right. One perl script later and things have a 5% speed up on a + // sparc2. Thanks to Richard Outerbridge <71755.204@CompuServe.COM> for + // pointing this out. + // clear the top bits on machines with 8byte longs + r = ROTATE(r, 29) & 0xffffffffL; + l = ROTATE(l, 29) & 0xffffffffL; + + // I don't know if it is worth the effort of loop unrolling the + // inner loop + if (enc) { + D_ENCRYPT(ks, l, r, 0); + D_ENCRYPT(ks, r, l, 1); + D_ENCRYPT(ks, l, r, 2); + D_ENCRYPT(ks, r, l, 3); + D_ENCRYPT(ks, l, r, 4); + D_ENCRYPT(ks, r, l, 5); + D_ENCRYPT(ks, l, r, 6); + D_ENCRYPT(ks, r, l, 7); + D_ENCRYPT(ks, l, r, 8); + D_ENCRYPT(ks, r, l, 9); + D_ENCRYPT(ks, l, r, 10); + D_ENCRYPT(ks, r, l, 11); + D_ENCRYPT(ks, l, r, 12); + D_ENCRYPT(ks, r, l, 13); + D_ENCRYPT(ks, l, r, 14); + D_ENCRYPT(ks, r, l, 15); + } else { + D_ENCRYPT(ks, l, r, 15); + D_ENCRYPT(ks, r, l, 14); + D_ENCRYPT(ks, l, r, 13); + D_ENCRYPT(ks, r, l, 12); + D_ENCRYPT(ks, l, r, 11); + D_ENCRYPT(ks, r, l, 10); + D_ENCRYPT(ks, l, r, 9); + D_ENCRYPT(ks, r, l, 8); + D_ENCRYPT(ks, l, r, 7); + D_ENCRYPT(ks, r, l, 6); + D_ENCRYPT(ks, l, r, 5); + D_ENCRYPT(ks, r, l, 4); + D_ENCRYPT(ks, l, r, 3); + D_ENCRYPT(ks, r, l, 2); + D_ENCRYPT(ks, l, r, 1); + D_ENCRYPT(ks, r, l, 0); + } + // rotate and clear the top bits on machines with 8byte longs + data[0] = ROTATE(l, 3) & 0xffffffffL; + data[1] = ROTATE(r, 3) & 0xffffffffL; +} + +void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, const DES_key_schedule *ks3) { + uint32_t l, r; + + l = data[0]; + r = data[1]; + IP(l, r); + data[0] = l; + data[1] = r; + DES_encrypt2((uint32_t *)data, ks1, DES_ENCRYPT); + DES_encrypt2((uint32_t *)data, ks2, DES_DECRYPT); + DES_encrypt2((uint32_t *)data, ks3, DES_ENCRYPT); + l = data[0]; + r = data[1]; + FP(r, l); + data[0] = l; + data[1] = r; +} + +void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, const DES_key_schedule *ks3) { + uint32_t l, r; + + l = data[0]; + r = data[1]; + IP(l, r); + data[0] = l; + data[1] = r; + DES_encrypt2((uint32_t *)data, ks3, DES_DECRYPT); + DES_encrypt2((uint32_t *)data, ks2, DES_ENCRYPT); + DES_encrypt2((uint32_t *)data, ks1, DES_DECRYPT); + l = data[0]; + r = data[1]; + FP(r, l); + data[0] = l; + data[1] = r; +} + +void DES_ecb_encrypt(const DES_cblock *in_block, DES_cblock *out_block, + const DES_key_schedule *schedule, int is_encrypt) { + uint32_t l; + uint32_t ll[2]; + const uint8_t *in = in_block->bytes; + uint8_t *out = out_block->bytes; + + c2l(in, l); + ll[0] = l; + c2l(in, l); + ll[1] = l; + DES_encrypt1(ll, schedule, is_encrypt); + l = ll[0]; + l2c(l, out); + l = ll[1]; + l2c(l, out); + ll[0] = ll[1] = 0; +} + +void DES_ncbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const DES_key_schedule *schedule, DES_cblock *ivec, + int enc) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + uint32_t tin[2]; + unsigned char *iv; + + iv = ivec->bytes; + + if (enc) { + c2l(iv, tout0); + c2l(iv, tout1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin[0] = tin0; + tin1 ^= tout1; + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_ENCRYPT); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + if (len != 0) { + c2ln(in, tin0, tin1, len); + tin0 ^= tout0; + tin[0] = tin0; + tin1 ^= tout1; + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_ENCRYPT); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + iv = ivec->bytes; + l2c(tout0, iv); + l2c(tout1, iv); + } else { + c2l(iv, xor0); + c2l(iv, xor1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_DECRYPT); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = tin0; + xor1 = tin1; + } + if (len != 0) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_DECRYPT); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2cn(tout0, tout1, out, len); + xor0 = tin0; + xor1 = tin1; + } + iv = ivec->bytes; + l2c(xor0, iv); + l2c(xor1, iv); + } + tin[0] = tin[1] = 0; +} + +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) { + uint32_t l0, l1; + uint32_t ll[2]; + const uint8_t *in = input->bytes; + uint8_t *out = output->bytes; + + c2l(in, l0); + c2l(in, l1); + ll[0] = l0; + ll[1] = l1; + if (enc) { + DES_encrypt3(ll, ks1, ks2, ks3); + } else { + DES_decrypt3(ll, ks1, ks2, ks3); + } + l0 = ll[0]; + l1 = ll[1]; + l2c(l0, out); + l2c(l1, out); +} + +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) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + uint32_t tin[2]; + uint8_t *iv; + + iv = ivec->bytes; + + if (enc) { + c2l(iv, tout0); + c2l(iv, tout1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin1 ^= tout1; + + tin[0] = tin0; + tin[1] = tin1; + DES_encrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + l2c(tout0, out); + l2c(tout1, out); + } + if (len != 0) { + c2ln(in, tin0, tin1, len); + tin0 ^= tout0; + tin1 ^= tout1; + + tin[0] = tin0; + tin[1] = tin1; + DES_encrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + l2c(tout0, out); + l2c(tout1, out); + } + iv = ivec->bytes; + l2c(tout0, iv); + l2c(tout1, iv); + } else { + uint32_t t0, t1; + + c2l(iv, xor0); + c2l(iv, xor1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + + t0 = tin0; + t1 = tin1; + + tin[0] = tin0; + tin[1] = tin1; + DES_decrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + tout0 ^= xor0; + tout1 ^= xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = t0; + xor1 = t1; + } + if (len != 0) { + c2l(in, tin0); + c2l(in, tin1); + + t0 = tin0; + t1 = tin1; + + tin[0] = tin0; + tin[1] = tin1; + DES_decrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + tout0 ^= xor0; + tout1 ^= xor1; + l2cn(tout0, tout1, out, len); + xor0 = t0; + xor1 = t1; + } + + iv = ivec->bytes; + l2c(xor0, iv); + l2c(xor1, iv); + } + + tin[0] = tin[1] = 0; +} + +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) { + DES_ede3_cbc_encrypt(in, out, len, ks1, ks2, ks1, ivec, enc); +} + + +// Deprecated functions. + +void DES_set_key_unchecked(const DES_cblock *key, DES_key_schedule *schedule) { + DES_set_key(key, schedule); +} + +#undef HPERM_OP +#undef c2l +#undef l2c +#undef c2ln +#undef l2cn +#undef PERM_OP +#undef IP +#undef FP +#undef LOAD_DATA +#undef D_ENCRYPT +#undef ITERATIONS +#undef HALF_ITERATIONS +#undef ROTATE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c.grpc_back new file mode 100644 index 0000000..2b0fdcd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c.grpc_back @@ -0,0 +1,785 @@ +/* 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 "internal.h" + + +static const uint32_t des_skb[8][64] = { + { // for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 + 0x00000000L, 0x00000010L, 0x20000000L, 0x20000010L, 0x00010000L, + 0x00010010L, 0x20010000L, 0x20010010L, 0x00000800L, 0x00000810L, + 0x20000800L, 0x20000810L, 0x00010800L, 0x00010810L, 0x20010800L, + 0x20010810L, 0x00000020L, 0x00000030L, 0x20000020L, 0x20000030L, + 0x00010020L, 0x00010030L, 0x20010020L, 0x20010030L, 0x00000820L, + 0x00000830L, 0x20000820L, 0x20000830L, 0x00010820L, 0x00010830L, + 0x20010820L, 0x20010830L, 0x00080000L, 0x00080010L, 0x20080000L, + 0x20080010L, 0x00090000L, 0x00090010L, 0x20090000L, 0x20090010L, + 0x00080800L, 0x00080810L, 0x20080800L, 0x20080810L, 0x00090800L, + 0x00090810L, 0x20090800L, 0x20090810L, 0x00080020L, 0x00080030L, + 0x20080020L, 0x20080030L, 0x00090020L, 0x00090030L, 0x20090020L, + 0x20090030L, 0x00080820L, 0x00080830L, 0x20080820L, 0x20080830L, + 0x00090820L, 0x00090830L, 0x20090820L, 0x20090830L, }, + { // for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 + 0x00000000L, 0x02000000L, 0x00002000L, 0x02002000L, 0x00200000L, + 0x02200000L, 0x00202000L, 0x02202000L, 0x00000004L, 0x02000004L, + 0x00002004L, 0x02002004L, 0x00200004L, 0x02200004L, 0x00202004L, + 0x02202004L, 0x00000400L, 0x02000400L, 0x00002400L, 0x02002400L, + 0x00200400L, 0x02200400L, 0x00202400L, 0x02202400L, 0x00000404L, + 0x02000404L, 0x00002404L, 0x02002404L, 0x00200404L, 0x02200404L, + 0x00202404L, 0x02202404L, 0x10000000L, 0x12000000L, 0x10002000L, + 0x12002000L, 0x10200000L, 0x12200000L, 0x10202000L, 0x12202000L, + 0x10000004L, 0x12000004L, 0x10002004L, 0x12002004L, 0x10200004L, + 0x12200004L, 0x10202004L, 0x12202004L, 0x10000400L, 0x12000400L, + 0x10002400L, 0x12002400L, 0x10200400L, 0x12200400L, 0x10202400L, + 0x12202400L, 0x10000404L, 0x12000404L, 0x10002404L, 0x12002404L, + 0x10200404L, 0x12200404L, 0x10202404L, 0x12202404L, }, + { // for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 + 0x00000000L, 0x00000001L, 0x00040000L, 0x00040001L, 0x01000000L, + 0x01000001L, 0x01040000L, 0x01040001L, 0x00000002L, 0x00000003L, + 0x00040002L, 0x00040003L, 0x01000002L, 0x01000003L, 0x01040002L, + 0x01040003L, 0x00000200L, 0x00000201L, 0x00040200L, 0x00040201L, + 0x01000200L, 0x01000201L, 0x01040200L, 0x01040201L, 0x00000202L, + 0x00000203L, 0x00040202L, 0x00040203L, 0x01000202L, 0x01000203L, + 0x01040202L, 0x01040203L, 0x08000000L, 0x08000001L, 0x08040000L, + 0x08040001L, 0x09000000L, 0x09000001L, 0x09040000L, 0x09040001L, + 0x08000002L, 0x08000003L, 0x08040002L, 0x08040003L, 0x09000002L, + 0x09000003L, 0x09040002L, 0x09040003L, 0x08000200L, 0x08000201L, + 0x08040200L, 0x08040201L, 0x09000200L, 0x09000201L, 0x09040200L, + 0x09040201L, 0x08000202L, 0x08000203L, 0x08040202L, 0x08040203L, + 0x09000202L, 0x09000203L, 0x09040202L, 0x09040203L, }, + { // for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 + 0x00000000L, 0x00100000L, 0x00000100L, 0x00100100L, 0x00000008L, + 0x00100008L, 0x00000108L, 0x00100108L, 0x00001000L, 0x00101000L, + 0x00001100L, 0x00101100L, 0x00001008L, 0x00101008L, 0x00001108L, + 0x00101108L, 0x04000000L, 0x04100000L, 0x04000100L, 0x04100100L, + 0x04000008L, 0x04100008L, 0x04000108L, 0x04100108L, 0x04001000L, + 0x04101000L, 0x04001100L, 0x04101100L, 0x04001008L, 0x04101008L, + 0x04001108L, 0x04101108L, 0x00020000L, 0x00120000L, 0x00020100L, + 0x00120100L, 0x00020008L, 0x00120008L, 0x00020108L, 0x00120108L, + 0x00021000L, 0x00121000L, 0x00021100L, 0x00121100L, 0x00021008L, + 0x00121008L, 0x00021108L, 0x00121108L, 0x04020000L, 0x04120000L, + 0x04020100L, 0x04120100L, 0x04020008L, 0x04120008L, 0x04020108L, + 0x04120108L, 0x04021000L, 0x04121000L, 0x04021100L, 0x04121100L, + 0x04021008L, 0x04121008L, 0x04021108L, 0x04121108L, }, + { // for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 + 0x00000000L, 0x10000000L, 0x00010000L, 0x10010000L, 0x00000004L, + 0x10000004L, 0x00010004L, 0x10010004L, 0x20000000L, 0x30000000L, + 0x20010000L, 0x30010000L, 0x20000004L, 0x30000004L, 0x20010004L, + 0x30010004L, 0x00100000L, 0x10100000L, 0x00110000L, 0x10110000L, + 0x00100004L, 0x10100004L, 0x00110004L, 0x10110004L, 0x20100000L, + 0x30100000L, 0x20110000L, 0x30110000L, 0x20100004L, 0x30100004L, + 0x20110004L, 0x30110004L, 0x00001000L, 0x10001000L, 0x00011000L, + 0x10011000L, 0x00001004L, 0x10001004L, 0x00011004L, 0x10011004L, + 0x20001000L, 0x30001000L, 0x20011000L, 0x30011000L, 0x20001004L, + 0x30001004L, 0x20011004L, 0x30011004L, 0x00101000L, 0x10101000L, + 0x00111000L, 0x10111000L, 0x00101004L, 0x10101004L, 0x00111004L, + 0x10111004L, 0x20101000L, 0x30101000L, 0x20111000L, 0x30111000L, + 0x20101004L, 0x30101004L, 0x20111004L, 0x30111004L, }, + { // for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 + 0x00000000L, 0x08000000L, 0x00000008L, 0x08000008L, 0x00000400L, + 0x08000400L, 0x00000408L, 0x08000408L, 0x00020000L, 0x08020000L, + 0x00020008L, 0x08020008L, 0x00020400L, 0x08020400L, 0x00020408L, + 0x08020408L, 0x00000001L, 0x08000001L, 0x00000009L, 0x08000009L, + 0x00000401L, 0x08000401L, 0x00000409L, 0x08000409L, 0x00020001L, + 0x08020001L, 0x00020009L, 0x08020009L, 0x00020401L, 0x08020401L, + 0x00020409L, 0x08020409L, 0x02000000L, 0x0A000000L, 0x02000008L, + 0x0A000008L, 0x02000400L, 0x0A000400L, 0x02000408L, 0x0A000408L, + 0x02020000L, 0x0A020000L, 0x02020008L, 0x0A020008L, 0x02020400L, + 0x0A020400L, 0x02020408L, 0x0A020408L, 0x02000001L, 0x0A000001L, + 0x02000009L, 0x0A000009L, 0x02000401L, 0x0A000401L, 0x02000409L, + 0x0A000409L, 0x02020001L, 0x0A020001L, 0x02020009L, 0x0A020009L, + 0x02020401L, 0x0A020401L, 0x02020409L, 0x0A020409L, }, + { // for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 + 0x00000000L, 0x00000100L, 0x00080000L, 0x00080100L, 0x01000000L, + 0x01000100L, 0x01080000L, 0x01080100L, 0x00000010L, 0x00000110L, + 0x00080010L, 0x00080110L, 0x01000010L, 0x01000110L, 0x01080010L, + 0x01080110L, 0x00200000L, 0x00200100L, 0x00280000L, 0x00280100L, + 0x01200000L, 0x01200100L, 0x01280000L, 0x01280100L, 0x00200010L, + 0x00200110L, 0x00280010L, 0x00280110L, 0x01200010L, 0x01200110L, + 0x01280010L, 0x01280110L, 0x00000200L, 0x00000300L, 0x00080200L, + 0x00080300L, 0x01000200L, 0x01000300L, 0x01080200L, 0x01080300L, + 0x00000210L, 0x00000310L, 0x00080210L, 0x00080310L, 0x01000210L, + 0x01000310L, 0x01080210L, 0x01080310L, 0x00200200L, 0x00200300L, + 0x00280200L, 0x00280300L, 0x01200200L, 0x01200300L, 0x01280200L, + 0x01280300L, 0x00200210L, 0x00200310L, 0x00280210L, 0x00280310L, + 0x01200210L, 0x01200310L, 0x01280210L, 0x01280310L, }, + { // for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 + 0x00000000L, 0x04000000L, 0x00040000L, 0x04040000L, 0x00000002L, + 0x04000002L, 0x00040002L, 0x04040002L, 0x00002000L, 0x04002000L, + 0x00042000L, 0x04042000L, 0x00002002L, 0x04002002L, 0x00042002L, + 0x04042002L, 0x00000020L, 0x04000020L, 0x00040020L, 0x04040020L, + 0x00000022L, 0x04000022L, 0x00040022L, 0x04040022L, 0x00002020L, + 0x04002020L, 0x00042020L, 0x04042020L, 0x00002022L, 0x04002022L, + 0x00042022L, 0x04042022L, 0x00000800L, 0x04000800L, 0x00040800L, + 0x04040800L, 0x00000802L, 0x04000802L, 0x00040802L, 0x04040802L, + 0x00002800L, 0x04002800L, 0x00042800L, 0x04042800L, 0x00002802L, + 0x04002802L, 0x00042802L, 0x04042802L, 0x00000820L, 0x04000820L, + 0x00040820L, 0x04040820L, 0x00000822L, 0x04000822L, 0x00040822L, + 0x04040822L, 0x00002820L, 0x04002820L, 0x00042820L, 0x04042820L, + 0x00002822L, 0x04002822L, 0x00042822L, 0x04042822L, }}; + +static const uint32_t DES_SPtrans[8][64] = { + { // nibble 0 + 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L, 0x02000000L, + 0x00080802L, 0x00080002L, 0x02000002L, 0x00080802L, 0x02080800L, + 0x02080000L, 0x00000802L, 0x02000802L, 0x02000000L, 0x00000000L, + 0x00080002L, 0x00080000L, 0x00000002L, 0x02000800L, 0x00080800L, + 0x02080802L, 0x02080000L, 0x00000802L, 0x02000800L, 0x00000002L, + 0x00000800L, 0x00080800L, 0x02080002L, 0x00000800L, 0x02000802L, + 0x02080002L, 0x00000000L, 0x00000000L, 0x02080802L, 0x02000800L, + 0x00080002L, 0x02080800L, 0x00080000L, 0x00000802L, 0x02000800L, + 0x02080002L, 0x00000800L, 0x00080800L, 0x02000002L, 0x00080802L, + 0x00000002L, 0x02000002L, 0x02080000L, 0x02080802L, 0x00080800L, + 0x02080000L, 0x02000802L, 0x02000000L, 0x00000802L, 0x00080002L, + 0x00000000L, 0x00080000L, 0x02000000L, 0x02000802L, 0x02080800L, + 0x00000002L, 0x02080002L, 0x00000800L, 0x00080802L, }, + { // nibble 1 + 0x40108010L, 0x00000000L, 0x00108000L, 0x40100000L, 0x40000010L, + 0x00008010L, 0x40008000L, 0x00108000L, 0x00008000L, 0x40100010L, + 0x00000010L, 0x40008000L, 0x00100010L, 0x40108000L, 0x40100000L, + 0x00000010L, 0x00100000L, 0x40008010L, 0x40100010L, 0x00008000L, + 0x00108010L, 0x40000000L, 0x00000000L, 0x00100010L, 0x40008010L, + 0x00108010L, 0x40108000L, 0x40000010L, 0x40000000L, 0x00100000L, + 0x00008010L, 0x40108010L, 0x00100010L, 0x40108000L, 0x40008000L, + 0x00108010L, 0x40108010L, 0x00100010L, 0x40000010L, 0x00000000L, + 0x40000000L, 0x00008010L, 0x00100000L, 0x40100010L, 0x00008000L, + 0x40000000L, 0x00108010L, 0x40008010L, 0x40108000L, 0x00008000L, + 0x00000000L, 0x40000010L, 0x00000010L, 0x40108010L, 0x00108000L, + 0x40100000L, 0x40100010L, 0x00100000L, 0x00008010L, 0x40008000L, + 0x40008010L, 0x00000010L, 0x40100000L, 0x00108000L, }, + { // nibble 2 + 0x04000001L, 0x04040100L, 0x00000100L, 0x04000101L, 0x00040001L, + 0x04000000L, 0x04000101L, 0x00040100L, 0x04000100L, 0x00040000L, + 0x04040000L, 0x00000001L, 0x04040101L, 0x00000101L, 0x00000001L, + 0x04040001L, 0x00000000L, 0x00040001L, 0x04040100L, 0x00000100L, + 0x00000101L, 0x04040101L, 0x00040000L, 0x04000001L, 0x04040001L, + 0x04000100L, 0x00040101L, 0x04040000L, 0x00040100L, 0x00000000L, + 0x04000000L, 0x00040101L, 0x04040100L, 0x00000100L, 0x00000001L, + 0x00040000L, 0x00000101L, 0x00040001L, 0x04040000L, 0x04000101L, + 0x00000000L, 0x04040100L, 0x00040100L, 0x04040001L, 0x00040001L, + 0x04000000L, 0x04040101L, 0x00000001L, 0x00040101L, 0x04000001L, + 0x04000000L, 0x04040101L, 0x00040000L, 0x04000100L, 0x04000101L, + 0x00040100L, 0x04000100L, 0x00000000L, 0x04040001L, 0x00000101L, + 0x04000001L, 0x00040101L, 0x00000100L, 0x04040000L, }, + { // nibble 3 + 0x00401008L, 0x10001000L, 0x00000008L, 0x10401008L, 0x00000000L, + 0x10400000L, 0x10001008L, 0x00400008L, 0x10401000L, 0x10000008L, + 0x10000000L, 0x00001008L, 0x10000008L, 0x00401008L, 0x00400000L, + 0x10000000L, 0x10400008L, 0x00401000L, 0x00001000L, 0x00000008L, + 0x00401000L, 0x10001008L, 0x10400000L, 0x00001000L, 0x00001008L, + 0x00000000L, 0x00400008L, 0x10401000L, 0x10001000L, 0x10400008L, + 0x10401008L, 0x00400000L, 0x10400008L, 0x00001008L, 0x00400000L, + 0x10000008L, 0x00401000L, 0x10001000L, 0x00000008L, 0x10400000L, + 0x10001008L, 0x00000000L, 0x00001000L, 0x00400008L, 0x00000000L, + 0x10400008L, 0x10401000L, 0x00001000L, 0x10000000L, 0x10401008L, + 0x00401008L, 0x00400000L, 0x10401008L, 0x00000008L, 0x10001000L, + 0x00401008L, 0x00400008L, 0x00401000L, 0x10400000L, 0x10001008L, + 0x00001008L, 0x10000000L, 0x10000008L, 0x10401000L, }, + { // nibble 4 + 0x08000000L, 0x00010000L, 0x00000400L, 0x08010420L, 0x08010020L, + 0x08000400L, 0x00010420L, 0x08010000L, 0x00010000L, 0x00000020L, + 0x08000020L, 0x00010400L, 0x08000420L, 0x08010020L, 0x08010400L, + 0x00000000L, 0x00010400L, 0x08000000L, 0x00010020L, 0x00000420L, + 0x08000400L, 0x00010420L, 0x00000000L, 0x08000020L, 0x00000020L, + 0x08000420L, 0x08010420L, 0x00010020L, 0x08010000L, 0x00000400L, + 0x00000420L, 0x08010400L, 0x08010400L, 0x08000420L, 0x00010020L, + 0x08010000L, 0x00010000L, 0x00000020L, 0x08000020L, 0x08000400L, + 0x08000000L, 0x00010400L, 0x08010420L, 0x00000000L, 0x00010420L, + 0x08000000L, 0x00000400L, 0x00010020L, 0x08000420L, 0x00000400L, + 0x00000000L, 0x08010420L, 0x08010020L, 0x08010400L, 0x00000420L, + 0x00010000L, 0x00010400L, 0x08010020L, 0x08000400L, 0x00000420L, + 0x00000020L, 0x00010420L, 0x08010000L, 0x08000020L, }, + { // nibble 5 + 0x80000040L, 0x00200040L, 0x00000000L, 0x80202000L, 0x00200040L, + 0x00002000L, 0x80002040L, 0x00200000L, 0x00002040L, 0x80202040L, + 0x00202000L, 0x80000000L, 0x80002000L, 0x80000040L, 0x80200000L, + 0x00202040L, 0x00200000L, 0x80002040L, 0x80200040L, 0x00000000L, + 0x00002000L, 0x00000040L, 0x80202000L, 0x80200040L, 0x80202040L, + 0x80200000L, 0x80000000L, 0x00002040L, 0x00000040L, 0x00202000L, + 0x00202040L, 0x80002000L, 0x00002040L, 0x80000000L, 0x80002000L, + 0x00202040L, 0x80202000L, 0x00200040L, 0x00000000L, 0x80002000L, + 0x80000000L, 0x00002000L, 0x80200040L, 0x00200000L, 0x00200040L, + 0x80202040L, 0x00202000L, 0x00000040L, 0x80202040L, 0x00202000L, + 0x00200000L, 0x80002040L, 0x80000040L, 0x80200000L, 0x00202040L, + 0x00000000L, 0x00002000L, 0x80000040L, 0x80002040L, 0x80202000L, + 0x80200000L, 0x00002040L, 0x00000040L, 0x80200040L, }, + { // nibble 6 + 0x00004000L, 0x00000200L, 0x01000200L, 0x01000004L, 0x01004204L, + 0x00004004L, 0x00004200L, 0x00000000L, 0x01000000L, 0x01000204L, + 0x00000204L, 0x01004000L, 0x00000004L, 0x01004200L, 0x01004000L, + 0x00000204L, 0x01000204L, 0x00004000L, 0x00004004L, 0x01004204L, + 0x00000000L, 0x01000200L, 0x01000004L, 0x00004200L, 0x01004004L, + 0x00004204L, 0x01004200L, 0x00000004L, 0x00004204L, 0x01004004L, + 0x00000200L, 0x01000000L, 0x00004204L, 0x01004000L, 0x01004004L, + 0x00000204L, 0x00004000L, 0x00000200L, 0x01000000L, 0x01004004L, + 0x01000204L, 0x00004204L, 0x00004200L, 0x00000000L, 0x00000200L, + 0x01000004L, 0x00000004L, 0x01000200L, 0x00000000L, 0x01000204L, + 0x01000200L, 0x00004200L, 0x00000204L, 0x00004000L, 0x01004204L, + 0x01000000L, 0x01004200L, 0x00000004L, 0x00004004L, 0x01004204L, + 0x01000004L, 0x01004200L, 0x01004000L, 0x00004004L, }, + { // nibble 7 + 0x20800080L, 0x20820000L, 0x00020080L, 0x00000000L, 0x20020000L, + 0x00800080L, 0x20800000L, 0x20820080L, 0x00000080L, 0x20000000L, + 0x00820000L, 0x00020080L, 0x00820080L, 0x20020080L, 0x20000080L, + 0x20800000L, 0x00020000L, 0x00820080L, 0x00800080L, 0x20020000L, + 0x20820080L, 0x20000080L, 0x00000000L, 0x00820000L, 0x20000000L, + 0x00800000L, 0x20020080L, 0x20800080L, 0x00800000L, 0x00020000L, + 0x20820000L, 0x00000080L, 0x00800000L, 0x00020000L, 0x20000080L, + 0x20820080L, 0x00020080L, 0x20000000L, 0x00000000L, 0x00820000L, + 0x20800080L, 0x20020080L, 0x20020000L, 0x00800080L, 0x20820000L, + 0x00000080L, 0x00800080L, 0x20020000L, 0x20820080L, 0x00800000L, + 0x20800000L, 0x20000080L, 0x00820000L, 0x00020080L, 0x20020080L, + 0x20800000L, 0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L, + 0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L, }}; + +#define HPERM_OP(a, t, n, m) \ + ((t) = ((((a) << (16 - (n))) ^ (a)) & (m)), \ + (a) = (a) ^ (t) ^ ((t) >> (16 - (n)))) + +void DES_set_key(const DES_cblock *key, DES_key_schedule *schedule) { + static const int shifts2[16] = {0, 0, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 0}; + uint32_t c, d, t, s, t2; + const uint8_t *in; + int i; + + in = key->bytes; + + c2l(in, c); + c2l(in, d); + + // do PC1 in 47 simple operations :-) + // Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov) + // for the inspiration. :-) + PERM_OP(d, c, t, 4, 0x0f0f0f0fL); + HPERM_OP(c, t, -2, 0xcccc0000L); + HPERM_OP(d, t, -2, 0xcccc0000L); + PERM_OP(d, c, t, 1, 0x55555555L); + PERM_OP(c, d, t, 8, 0x00ff00ffL); + PERM_OP(d, c, t, 1, 0x55555555L); + d = (((d & 0x000000ffL) << 16L) | (d & 0x0000ff00L) | + ((d & 0x00ff0000L) >> 16L) | ((c & 0xf0000000L) >> 4L)); + c &= 0x0fffffffL; + + for (i = 0; i < ITERATIONS; i++) { + if (shifts2[i]) { + c = ((c >> 2L) | (c << 26L)); + d = ((d >> 2L) | (d << 26L)); + } else { + c = ((c >> 1L) | (c << 27L)); + d = ((d >> 1L) | (d << 27L)); + } + c &= 0x0fffffffL; + d &= 0x0fffffffL; + // could be a few less shifts but I am to lazy at this + // point in time to investigate + s = des_skb[0][(c) & 0x3f] | + des_skb[1][((c >> 6L) & 0x03) | ((c >> 7L) & 0x3c)] | + des_skb[2][((c >> 13L) & 0x0f) | ((c >> 14L) & 0x30)] | + des_skb[3][((c >> 20L) & 0x01) | ((c >> 21L) & 0x06) | + ((c >> 22L) & 0x38)]; + t = des_skb[4][(d) & 0x3f] | + des_skb[5][((d >> 7L) & 0x03) | ((d >> 8L) & 0x3c)] | + des_skb[6][(d >> 15L) & 0x3f] | + des_skb[7][((d >> 21L) & 0x0f) | ((d >> 22L) & 0x30)]; + + // table contained 0213 4657 + t2 = ((t << 16L) | (s & 0x0000ffffL)) & 0xffffffffL; + schedule->subkeys[i][0] = ROTATE(t2, 30) & 0xffffffffL; + + t2 = ((s >> 16L) | (t & 0xffff0000L)); + schedule->subkeys[i][1] = ROTATE(t2, 26) & 0xffffffffL; + } +} + +static const uint8_t kOddParity[256] = { + 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, + 14, 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, + 31, 31, 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, + 44, 47, 47, 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, + 61, 61, 62, 62, 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, + 74, 76, 76, 79, 79, 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, + 91, 91, 93, 93, 94, 94, 97, 97, 98, 98, 100, 100, 103, 103, 104, + 104, 107, 107, 109, 109, 110, 110, 112, 112, 115, 115, 117, 117, 118, 118, + 121, 121, 122, 122, 124, 124, 127, 127, 128, 128, 131, 131, 133, 133, 134, + 134, 137, 137, 138, 138, 140, 140, 143, 143, 145, 145, 146, 146, 148, 148, + 151, 151, 152, 152, 155, 155, 157, 157, 158, 158, 161, 161, 162, 162, 164, + 164, 167, 167, 168, 168, 171, 171, 173, 173, 174, 174, 176, 176, 179, 179, + 181, 181, 182, 182, 185, 185, 186, 186, 188, 188, 191, 191, 193, 193, 194, + 194, 196, 196, 199, 199, 200, 200, 203, 203, 205, 205, 206, 206, 208, 208, + 211, 211, 213, 213, 214, 214, 217, 217, 218, 218, 220, 220, 223, 223, 224, + 224, 227, 227, 229, 229, 230, 230, 233, 233, 234, 234, 236, 236, 239, 239, + 241, 241, 242, 242, 244, 244, 247, 247, 248, 248, 251, 251, 253, 253, 254, + 254 +}; + +void DES_set_odd_parity(DES_cblock *key) { + unsigned i; + + for (i = 0; i < DES_KEY_SZ; i++) { + key->bytes[i] = kOddParity[key->bytes[i]]; + } +} + +static void DES_encrypt1(uint32_t *data, const DES_key_schedule *ks, int enc) { + uint32_t l, r, t, u; + + r = data[0]; + l = data[1]; + + IP(r, l); + // Things have been modified so that the initial rotate is done outside + // the loop. This required the DES_SPtrans values in sp.h to be + // rotated 1 bit to the right. One perl script later and things have a + // 5% speed up on a sparc2. Thanks to Richard Outerbridge + // <71755.204@CompuServe.COM> for pointing this out. + // clear the top bits on machines with 8byte longs + // shift left by 2 + r = ROTATE(r, 29) & 0xffffffffL; + l = ROTATE(l, 29) & 0xffffffffL; + + // I don't know if it is worth the effort of loop unrolling the + // inner loop + if (enc) { + D_ENCRYPT(ks, l, r, 0); + D_ENCRYPT(ks, r, l, 1); + D_ENCRYPT(ks, l, r, 2); + D_ENCRYPT(ks, r, l, 3); + D_ENCRYPT(ks, l, r, 4); + D_ENCRYPT(ks, r, l, 5); + D_ENCRYPT(ks, l, r, 6); + D_ENCRYPT(ks, r, l, 7); + D_ENCRYPT(ks, l, r, 8); + D_ENCRYPT(ks, r, l, 9); + D_ENCRYPT(ks, l, r, 10); + D_ENCRYPT(ks, r, l, 11); + D_ENCRYPT(ks, l, r, 12); + D_ENCRYPT(ks, r, l, 13); + D_ENCRYPT(ks, l, r, 14); + D_ENCRYPT(ks, r, l, 15); + } else { + D_ENCRYPT(ks, l, r, 15); + D_ENCRYPT(ks, r, l, 14); + D_ENCRYPT(ks, l, r, 13); + D_ENCRYPT(ks, r, l, 12); + D_ENCRYPT(ks, l, r, 11); + D_ENCRYPT(ks, r, l, 10); + D_ENCRYPT(ks, l, r, 9); + D_ENCRYPT(ks, r, l, 8); + D_ENCRYPT(ks, l, r, 7); + D_ENCRYPT(ks, r, l, 6); + D_ENCRYPT(ks, l, r, 5); + D_ENCRYPT(ks, r, l, 4); + D_ENCRYPT(ks, l, r, 3); + D_ENCRYPT(ks, r, l, 2); + D_ENCRYPT(ks, l, r, 1); + D_ENCRYPT(ks, r, l, 0); + } + + // rotate and clear the top bits on machines with 8byte longs + l = ROTATE(l, 3) & 0xffffffffL; + r = ROTATE(r, 3) & 0xffffffffL; + + FP(r, l); + data[0] = l; + data[1] = r; +} + +static void DES_encrypt2(uint32_t *data, const DES_key_schedule *ks, int enc) { + uint32_t l, r, t, u; + + r = data[0]; + l = data[1]; + + // Things have been modified so that the initial rotate is done outside the + // loop. This required the DES_SPtrans values in sp.h to be rotated 1 bit to + // the right. One perl script later and things have a 5% speed up on a + // sparc2. Thanks to Richard Outerbridge <71755.204@CompuServe.COM> for + // pointing this out. + // clear the top bits on machines with 8byte longs + r = ROTATE(r, 29) & 0xffffffffL; + l = ROTATE(l, 29) & 0xffffffffL; + + // I don't know if it is worth the effort of loop unrolling the + // inner loop + if (enc) { + D_ENCRYPT(ks, l, r, 0); + D_ENCRYPT(ks, r, l, 1); + D_ENCRYPT(ks, l, r, 2); + D_ENCRYPT(ks, r, l, 3); + D_ENCRYPT(ks, l, r, 4); + D_ENCRYPT(ks, r, l, 5); + D_ENCRYPT(ks, l, r, 6); + D_ENCRYPT(ks, r, l, 7); + D_ENCRYPT(ks, l, r, 8); + D_ENCRYPT(ks, r, l, 9); + D_ENCRYPT(ks, l, r, 10); + D_ENCRYPT(ks, r, l, 11); + D_ENCRYPT(ks, l, r, 12); + D_ENCRYPT(ks, r, l, 13); + D_ENCRYPT(ks, l, r, 14); + D_ENCRYPT(ks, r, l, 15); + } else { + D_ENCRYPT(ks, l, r, 15); + D_ENCRYPT(ks, r, l, 14); + D_ENCRYPT(ks, l, r, 13); + D_ENCRYPT(ks, r, l, 12); + D_ENCRYPT(ks, l, r, 11); + D_ENCRYPT(ks, r, l, 10); + D_ENCRYPT(ks, l, r, 9); + D_ENCRYPT(ks, r, l, 8); + D_ENCRYPT(ks, l, r, 7); + D_ENCRYPT(ks, r, l, 6); + D_ENCRYPT(ks, l, r, 5); + D_ENCRYPT(ks, r, l, 4); + D_ENCRYPT(ks, l, r, 3); + D_ENCRYPT(ks, r, l, 2); + D_ENCRYPT(ks, l, r, 1); + D_ENCRYPT(ks, r, l, 0); + } + // rotate and clear the top bits on machines with 8byte longs + data[0] = ROTATE(l, 3) & 0xffffffffL; + data[1] = ROTATE(r, 3) & 0xffffffffL; +} + +void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, const DES_key_schedule *ks3) { + uint32_t l, r; + + l = data[0]; + r = data[1]; + IP(l, r); + data[0] = l; + data[1] = r; + DES_encrypt2((uint32_t *)data, ks1, DES_ENCRYPT); + DES_encrypt2((uint32_t *)data, ks2, DES_DECRYPT); + DES_encrypt2((uint32_t *)data, ks3, DES_ENCRYPT); + l = data[0]; + r = data[1]; + FP(r, l); + data[0] = l; + data[1] = r; +} + +void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, const DES_key_schedule *ks3) { + uint32_t l, r; + + l = data[0]; + r = data[1]; + IP(l, r); + data[0] = l; + data[1] = r; + DES_encrypt2((uint32_t *)data, ks3, DES_DECRYPT); + DES_encrypt2((uint32_t *)data, ks2, DES_ENCRYPT); + DES_encrypt2((uint32_t *)data, ks1, DES_DECRYPT); + l = data[0]; + r = data[1]; + FP(r, l); + data[0] = l; + data[1] = r; +} + +void DES_ecb_encrypt(const DES_cblock *in_block, DES_cblock *out_block, + const DES_key_schedule *schedule, int is_encrypt) { + uint32_t l; + uint32_t ll[2]; + const uint8_t *in = in_block->bytes; + uint8_t *out = out_block->bytes; + + c2l(in, l); + ll[0] = l; + c2l(in, l); + ll[1] = l; + DES_encrypt1(ll, schedule, is_encrypt); + l = ll[0]; + l2c(l, out); + l = ll[1]; + l2c(l, out); + ll[0] = ll[1] = 0; +} + +void DES_ncbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const DES_key_schedule *schedule, DES_cblock *ivec, + int enc) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + uint32_t tin[2]; + unsigned char *iv; + + iv = ivec->bytes; + + if (enc) { + c2l(iv, tout0); + c2l(iv, tout1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin[0] = tin0; + tin1 ^= tout1; + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_ENCRYPT); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + if (len != 0) { + c2ln(in, tin0, tin1, len); + tin0 ^= tout0; + tin[0] = tin0; + tin1 ^= tout1; + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_ENCRYPT); + tout0 = tin[0]; + l2c(tout0, out); + tout1 = tin[1]; + l2c(tout1, out); + } + iv = ivec->bytes; + l2c(tout0, iv); + l2c(tout1, iv); + } else { + c2l(iv, xor0); + c2l(iv, xor1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_DECRYPT); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = tin0; + xor1 = tin1; + } + if (len != 0) { + c2l(in, tin0); + tin[0] = tin0; + c2l(in, tin1); + tin[1] = tin1; + DES_encrypt1((uint32_t *)tin, schedule, DES_DECRYPT); + tout0 = tin[0] ^ xor0; + tout1 = tin[1] ^ xor1; + l2cn(tout0, tout1, out, len); + xor0 = tin0; + xor1 = tin1; + } + iv = ivec->bytes; + l2c(xor0, iv); + l2c(xor1, iv); + } + tin[0] = tin[1] = 0; +} + +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) { + uint32_t l0, l1; + uint32_t ll[2]; + const uint8_t *in = input->bytes; + uint8_t *out = output->bytes; + + c2l(in, l0); + c2l(in, l1); + ll[0] = l0; + ll[1] = l1; + if (enc) { + DES_encrypt3(ll, ks1, ks2, ks3); + } else { + DES_decrypt3(ll, ks1, ks2, ks3); + } + l0 = ll[0]; + l1 = ll[1]; + l2c(l0, out); + l2c(l1, out); +} + +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) { + uint32_t tin0, tin1; + uint32_t tout0, tout1, xor0, xor1; + uint32_t tin[2]; + uint8_t *iv; + + iv = ivec->bytes; + + if (enc) { + c2l(iv, tout0); + c2l(iv, tout1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + tin0 ^= tout0; + tin1 ^= tout1; + + tin[0] = tin0; + tin[1] = tin1; + DES_encrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + l2c(tout0, out); + l2c(tout1, out); + } + if (len != 0) { + c2ln(in, tin0, tin1, len); + tin0 ^= tout0; + tin1 ^= tout1; + + tin[0] = tin0; + tin[1] = tin1; + DES_encrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + l2c(tout0, out); + l2c(tout1, out); + } + iv = ivec->bytes; + l2c(tout0, iv); + l2c(tout1, iv); + } else { + uint32_t t0, t1; + + c2l(iv, xor0); + c2l(iv, xor1); + for (; len >= 8; len -= 8) { + c2l(in, tin0); + c2l(in, tin1); + + t0 = tin0; + t1 = tin1; + + tin[0] = tin0; + tin[1] = tin1; + DES_decrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + tout0 ^= xor0; + tout1 ^= xor1; + l2c(tout0, out); + l2c(tout1, out); + xor0 = t0; + xor1 = t1; + } + if (len != 0) { + c2l(in, tin0); + c2l(in, tin1); + + t0 = tin0; + t1 = tin1; + + tin[0] = tin0; + tin[1] = tin1; + DES_decrypt3((uint32_t *)tin, ks1, ks2, ks3); + tout0 = tin[0]; + tout1 = tin[1]; + + tout0 ^= xor0; + tout1 ^= xor1; + l2cn(tout0, tout1, out, len); + xor0 = t0; + xor1 = t1; + } + + iv = ivec->bytes; + l2c(xor0, iv); + l2c(xor1, iv); + } + + tin[0] = tin[1] = 0; +} + +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) { + DES_ede3_cbc_encrypt(in, out, len, ks1, ks2, ks1, ivec, enc); +} + + +// Deprecated functions. + +void DES_set_key_unchecked(const DES_cblock *key, DES_key_schedule *schedule) { + DES_set_key(key, schedule); +} + +#undef HPERM_OP +#undef c2l +#undef l2c +#undef c2ln +#undef l2cn +#undef PERM_OP +#undef IP +#undef FP +#undef LOAD_DATA +#undef D_ENCRYPT +#undef ITERATIONS +#undef HALF_ITERATIONS +#undef ROTATE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h new file mode 100644 index 0000000..841812a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h @@ -0,0 +1,240 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_DES_INTERNAL_H + +#include + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#define c2l(c, l) \ + do { \ + (l) = ((uint32_t)(*((c)++))); \ + (l) |= ((uint32_t)(*((c)++))) << 8L; \ + (l) |= ((uint32_t)(*((c)++))) << 16L; \ + (l) |= ((uint32_t)(*((c)++))) << 24L; \ + } while (0) + +#define l2c(l, c) \ + do { \ + *((c)++) = (unsigned char)(((l)) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 8L) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 16L) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 24L) & 0xff); \ + } while (0) + +// NOTE - c is not incremented as per c2l +#define c2ln(c, l1, l2, n) \ + do { \ + (c) += (n); \ + (l1) = (l2) = 0; \ + switch (n) { \ + case 8: \ + (l2) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + (l2) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + (l2) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + (l2) |= ((uint32_t)(*(--(c)))); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + (l1) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + (l1) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + (l1) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + (l1) |= ((uint32_t)(*(--(c)))); \ + } \ + } while (0) + +// NOTE - c is not incremented as per l2c +#define l2cn(l1, l2, c, n) \ + do { \ + (c) += (n); \ + switch (n) { \ + case 8: \ + *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + *(--(c)) = (unsigned char)(((l2)) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + *(--(c)) = (unsigned char)(((l1)) & 0xff); \ + } \ + } while (0) + +/* IP and FP + * The problem is more of a geometric problem that random bit fiddling. + 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6 + 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4 +16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2 +24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0 + +32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7 +40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5 +48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3 +56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1 + +The output has been subject to swaps of the form +0 1 -> 3 1 but the odd and even bits have been put into +2 3 2 0 +different words. The main trick is to remember that +t=((l>>size)^r)&(mask); +r^=t; +l^=(t<> (n)) ^ (b)) & (m)); \ + (b) ^= (t); \ + (a) ^= ((t) << (n)); \ + } while (0) + +#define IP(l, r) \ + do { \ + uint32_t tt; \ + PERM_OP(r, l, tt, 4, 0x0f0f0f0fL); \ + PERM_OP(l, r, tt, 16, 0x0000ffffL); \ + PERM_OP(r, l, tt, 2, 0x33333333L); \ + PERM_OP(l, r, tt, 8, 0x00ff00ffL); \ + PERM_OP(r, l, tt, 1, 0x55555555L); \ + } while (0) + +#define FP(l, r) \ + do { \ + uint32_t tt; \ + PERM_OP(l, r, tt, 1, 0x55555555L); \ + PERM_OP(r, l, tt, 8, 0x00ff00ffL); \ + PERM_OP(l, r, tt, 2, 0x33333333L); \ + PERM_OP(r, l, tt, 16, 0x0000ffffL); \ + PERM_OP(l, r, tt, 4, 0x0f0f0f0fL); \ + } while (0) + +#define LOAD_DATA(ks, R, S, u, t, E0, E1) \ + do { \ + (u) = (R) ^ (ks)->subkeys[S][0]; \ + (t) = (R) ^ (ks)->subkeys[S][1]; \ + } while (0) + +#define D_ENCRYPT(ks, LL, R, S) \ + do { \ + LOAD_DATA(ks, R, S, u, t, E0, E1); \ + t = ROTATE(t, 4); \ + (LL) ^= \ + DES_SPtrans[0][(u >> 2L) & 0x3f] ^ DES_SPtrans[2][(u >> 10L) & 0x3f] ^ \ + DES_SPtrans[4][(u >> 18L) & 0x3f] ^ \ + DES_SPtrans[6][(u >> 26L) & 0x3f] ^ DES_SPtrans[1][(t >> 2L) & 0x3f] ^ \ + DES_SPtrans[3][(t >> 10L) & 0x3f] ^ \ + DES_SPtrans[5][(t >> 18L) & 0x3f] ^ DES_SPtrans[7][(t >> 26L) & 0x3f]; \ + } while (0) + +#define ITERATIONS 16 +#define HALF_ITERATIONS 8 + +#define ROTATE(a, n) (((a) >> (n)) + ((a) << (32 - (n)))) + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_DES_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h.grpc_back new file mode 100644 index 0000000..1ae3f22 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h.grpc_back @@ -0,0 +1,240 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_DES_INTERNAL_H + +#include + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#define c2l(c, l) \ + do { \ + (l) = ((uint32_t)(*((c)++))); \ + (l) |= ((uint32_t)(*((c)++))) << 8L; \ + (l) |= ((uint32_t)(*((c)++))) << 16L; \ + (l) |= ((uint32_t)(*((c)++))) << 24L; \ + } while (0) + +#define l2c(l, c) \ + do { \ + *((c)++) = (unsigned char)(((l)) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 8L) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 16L) & 0xff); \ + *((c)++) = (unsigned char)(((l) >> 24L) & 0xff); \ + } while (0) + +// NOTE - c is not incremented as per c2l +#define c2ln(c, l1, l2, n) \ + do { \ + (c) += (n); \ + (l1) = (l2) = 0; \ + switch (n) { \ + case 8: \ + (l2) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + (l2) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + (l2) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + (l2) |= ((uint32_t)(*(--(c)))); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + (l1) = ((uint32_t)(*(--(c)))) << 24L; \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + (l1) |= ((uint32_t)(*(--(c)))) << 16L; \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + (l1) |= ((uint32_t)(*(--(c)))) << 8L; \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + (l1) |= ((uint32_t)(*(--(c)))); \ + } \ + } while (0) + +// NOTE - c is not incremented as per l2c +#define l2cn(l1, l2, c, n) \ + do { \ + (c) += (n); \ + switch (n) { \ + case 8: \ + *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 7: \ + *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 6: \ + *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 5: \ + *(--(c)) = (unsigned char)(((l2)) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 4: \ + *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 3: \ + *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 2: \ + *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff); \ + OPENSSL_FALLTHROUGH; \ + case 1: \ + *(--(c)) = (unsigned char)(((l1)) & 0xff); \ + } \ + } while (0) + +/* IP and FP + * The problem is more of a geometric problem that random bit fiddling. + 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6 + 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4 +16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2 +24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0 + +32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7 +40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5 +48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3 +56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1 + +The output has been subject to swaps of the form +0 1 -> 3 1 but the odd and even bits have been put into +2 3 2 0 +different words. The main trick is to remember that +t=((l>>size)^r)&(mask); +r^=t; +l^=(t<> (n)) ^ (b)) & (m)); \ + (b) ^= (t); \ + (a) ^= ((t) << (n)); \ + } while (0) + +#define IP(l, r) \ + do { \ + uint32_t tt; \ + PERM_OP(r, l, tt, 4, 0x0f0f0f0fL); \ + PERM_OP(l, r, tt, 16, 0x0000ffffL); \ + PERM_OP(r, l, tt, 2, 0x33333333L); \ + PERM_OP(l, r, tt, 8, 0x00ff00ffL); \ + PERM_OP(r, l, tt, 1, 0x55555555L); \ + } while (0) + +#define FP(l, r) \ + do { \ + uint32_t tt; \ + PERM_OP(l, r, tt, 1, 0x55555555L); \ + PERM_OP(r, l, tt, 8, 0x00ff00ffL); \ + PERM_OP(l, r, tt, 2, 0x33333333L); \ + PERM_OP(r, l, tt, 16, 0x0000ffffL); \ + PERM_OP(l, r, tt, 4, 0x0f0f0f0fL); \ + } while (0) + +#define LOAD_DATA(ks, R, S, u, t, E0, E1) \ + do { \ + (u) = (R) ^ (ks)->subkeys[S][0]; \ + (t) = (R) ^ (ks)->subkeys[S][1]; \ + } while (0) + +#define D_ENCRYPT(ks, LL, R, S) \ + do { \ + LOAD_DATA(ks, R, S, u, t, E0, E1); \ + t = ROTATE(t, 4); \ + (LL) ^= \ + DES_SPtrans[0][(u >> 2L) & 0x3f] ^ DES_SPtrans[2][(u >> 10L) & 0x3f] ^ \ + DES_SPtrans[4][(u >> 18L) & 0x3f] ^ \ + DES_SPtrans[6][(u >> 26L) & 0x3f] ^ DES_SPtrans[1][(t >> 2L) & 0x3f] ^ \ + DES_SPtrans[3][(t >> 10L) & 0x3f] ^ \ + DES_SPtrans[5][(t >> 18L) & 0x3f] ^ DES_SPtrans[7][(t >> 26L) & 0x3f]; \ + } while (0) + +#define ITERATIONS 16 +#define HALF_ITERATIONS 8 + +#define ROTATE(a, n) (((a) >> (n)) + ((a) << (32 - (n)))) + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_DES_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c new file mode 100644 index 0000000..4bae3f4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c @@ -0,0 +1,271 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +int EVP_MD_type(const EVP_MD *md) { return md->type; } + +uint32_t EVP_MD_flags(const EVP_MD *md) { return md->flags; } + +size_t EVP_MD_size(const EVP_MD *md) { return md->md_size; } + +size_t EVP_MD_block_size(const EVP_MD *md) { return md->block_size; } + + +void EVP_MD_CTX_init(EVP_MD_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_MD_CTX)); +} + +EVP_MD_CTX *EVP_MD_CTX_new(void) { + EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof(EVP_MD_CTX)); + + if (ctx) { + EVP_MD_CTX_init(ctx); + } + + return ctx; +} + +EVP_MD_CTX *EVP_MD_CTX_create(void) { return EVP_MD_CTX_new(); } + +int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) { + OPENSSL_free(ctx->md_data); + + assert(ctx->pctx == NULL || ctx->pctx_ops != NULL); + if (ctx->pctx_ops) { + ctx->pctx_ops->free(ctx->pctx); + } + + EVP_MD_CTX_init(ctx); + + return 1; +} + +void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { + if (!ctx) { + return; + } + + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(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) { + // |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; + } + + EVP_PKEY_CTX *pctx = NULL; + assert(in->pctx == NULL || in->pctx_ops != NULL); + if (in->pctx) { + pctx = in->pctx_ops->dup(in->pctx); + if (!pctx) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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; + } + } 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; + 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); + + return 1; +} + +int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) { + EVP_MD_CTX_init(out); + return EVP_MD_CTX_copy_ex(out, in); +} + +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) { + if (ctx->digest != type) { + assert(type->ctx_size != 0); + uint8_t *md_data = OPENSSL_malloc(type->ctx_size); + if (md_data == NULL) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_free(ctx->md_data); + ctx->md_data = md_data; + ctx->digest = type; + } + + assert(ctx->pctx == NULL || ctx->pctx_ops != NULL); + + ctx->digest->init(ctx); + return 1; +} + +int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + EVP_MD_CTX_init(ctx); + return EVP_DigestInit_ex(ctx, type, NULL); +} + +int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + ctx->digest->update(ctx, data, len); + return 1; +} + +int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out, unsigned int *size) { + assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); + ctx->digest->final(ctx, md_out); + if (size != NULL) { + *size = ctx->digest->md_size; + } + OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); + return 1; +} + +int EVP_DigestFinal(EVP_MD_CTX *ctx, uint8_t *md, unsigned int *size) { + (void)EVP_DigestFinal_ex(ctx, md, size); + EVP_MD_CTX_cleanup(ctx); + return 1; +} + +int EVP_Digest(const void *data, size_t count, uint8_t *out_md, + unsigned int *out_size, const EVP_MD *type, ENGINE *impl) { + EVP_MD_CTX ctx; + int ret; + + EVP_MD_CTX_init(&ctx); + ret = EVP_DigestInit_ex(&ctx, type, impl) && + EVP_DigestUpdate(&ctx, data, count) && + EVP_DigestFinal_ex(&ctx, out_md, out_size); + EVP_MD_CTX_cleanup(&ctx); + + return ret; +} + + +const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) { + if (ctx == NULL) { + return NULL; + } + return ctx->digest; +} + +size_t EVP_MD_CTX_size(const EVP_MD_CTX *ctx) { + return EVP_MD_size(EVP_MD_CTX_md(ctx)); +} + +size_t EVP_MD_CTX_block_size(const EVP_MD_CTX *ctx) { + return EVP_MD_block_size(EVP_MD_CTX_md(ctx)); +} + +int EVP_MD_CTX_type(const EVP_MD_CTX *ctx) { + return EVP_MD_type(EVP_MD_CTX_md(ctx)); +} + +int EVP_add_digest(const EVP_MD *digest) { + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back new file mode 100644 index 0000000..a0b3bf5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back @@ -0,0 +1,271 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +int EVP_MD_type(const EVP_MD *md) { return md->type; } + +uint32_t EVP_MD_flags(const EVP_MD *md) { return md->flags; } + +size_t EVP_MD_size(const EVP_MD *md) { return md->md_size; } + +size_t EVP_MD_block_size(const EVP_MD *md) { return md->block_size; } + + +void EVP_MD_CTX_init(EVP_MD_CTX *ctx) { + OPENSSL_memset(ctx, 0, sizeof(EVP_MD_CTX)); +} + +EVP_MD_CTX *EVP_MD_CTX_new(void) { + EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof(EVP_MD_CTX)); + + if (ctx) { + EVP_MD_CTX_init(ctx); + } + + return ctx; +} + +EVP_MD_CTX *EVP_MD_CTX_create(void) { return EVP_MD_CTX_new(); } + +int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) { + OPENSSL_free(ctx->md_data); + + assert(ctx->pctx == NULL || ctx->pctx_ops != NULL); + if (ctx->pctx_ops) { + ctx->pctx_ops->free(ctx->pctx); + } + + EVP_MD_CTX_init(ctx); + + return 1; +} + +void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { + if (!ctx) { + return; + } + + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(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) { + // |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; + } + + EVP_PKEY_CTX *pctx = NULL; + assert(in->pctx == NULL || in->pctx_ops != NULL); + if (in->pctx) { + pctx = in->pctx_ops->dup(in->pctx); + if (!pctx) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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; + } + } 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; + 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); + + return 1; +} + +int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) { + EVP_MD_CTX_init(out); + return EVP_MD_CTX_copy_ex(out, in); +} + +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) { + if (ctx->digest != type) { + assert(type->ctx_size != 0); + uint8_t *md_data = OPENSSL_malloc(type->ctx_size); + if (md_data == NULL) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_free(ctx->md_data); + ctx->md_data = md_data; + ctx->digest = type; + } + + assert(ctx->pctx == NULL || ctx->pctx_ops != NULL); + + ctx->digest->init(ctx); + return 1; +} + +int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) { + EVP_MD_CTX_init(ctx); + return EVP_DigestInit_ex(ctx, type, NULL); +} + +int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) { + ctx->digest->update(ctx, data, len); + return 1; +} + +int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out, unsigned int *size) { + assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); + ctx->digest->final(ctx, md_out); + if (size != NULL) { + *size = ctx->digest->md_size; + } + OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); + return 1; +} + +int EVP_DigestFinal(EVP_MD_CTX *ctx, uint8_t *md, unsigned int *size) { + (void)EVP_DigestFinal_ex(ctx, md, size); + EVP_MD_CTX_cleanup(ctx); + return 1; +} + +int EVP_Digest(const void *data, size_t count, uint8_t *out_md, + unsigned int *out_size, const EVP_MD *type, ENGINE *impl) { + EVP_MD_CTX ctx; + int ret; + + EVP_MD_CTX_init(&ctx); + ret = EVP_DigestInit_ex(&ctx, type, impl) && + EVP_DigestUpdate(&ctx, data, count) && + EVP_DigestFinal_ex(&ctx, out_md, out_size); + EVP_MD_CTX_cleanup(&ctx); + + return ret; +} + + +const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) { + if (ctx == NULL) { + return NULL; + } + return ctx->digest; +} + +size_t EVP_MD_CTX_size(const EVP_MD_CTX *ctx) { + return EVP_MD_size(EVP_MD_CTX_md(ctx)); +} + +size_t EVP_MD_CTX_block_size(const EVP_MD_CTX *ctx) { + return EVP_MD_block_size(EVP_MD_CTX_md(ctx)); +} + +int EVP_MD_CTX_type(const EVP_MD_CTX *ctx) { + return EVP_MD_type(EVP_MD_CTX_md(ctx)); +} + +int EVP_add_digest(const EVP_MD *digest) { + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c new file mode 100644 index 0000000..bda7f78 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c @@ -0,0 +1,280 @@ +/* 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 "internal.h" +#include "../delocate.h" +#include "../../internal.h" + +#if defined(NDEBUG) +#define CHECK(x) (void) (x) +#else +#define CHECK(x) assert(x) +#endif + + +static void md4_init(EVP_MD_CTX *ctx) { + CHECK(MD4_Init(ctx->md_data)); +} + +static void md4_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(MD4_Update(ctx->md_data, data, count)); +} + +static void md4_final(EVP_MD_CTX *ctx, uint8_t *out) { + CHECK(MD4_Final(out, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) { + out->type = NID_md4; + out->md_size = MD4_DIGEST_LENGTH; + out->flags = 0; + out->init = md4_init; + out->update = md4_update; + out->final = md4_final; + out->block_size = 64; + out->ctx_size = sizeof(MD4_CTX); +} + + +static void md5_init(EVP_MD_CTX *ctx) { + CHECK(MD5_Init(ctx->md_data)); +} + +static void md5_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(MD5_Update(ctx->md_data, data, count)); +} + +static void md5_final(EVP_MD_CTX *ctx, uint8_t *out) { + CHECK(MD5_Final(out, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md5) { + out->type = NID_md5; + out->md_size = MD5_DIGEST_LENGTH; + out->flags = 0; + out->init = md5_init; + out->update = md5_update; + out->final = md5_final; + out->block_size = 64; + out->ctx_size = sizeof(MD5_CTX); +} + + +static void sha1_init(EVP_MD_CTX *ctx) { + CHECK(SHA1_Init(ctx->md_data)); +} + +static void sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA1_Update(ctx->md_data, data, count)); +} + +static void sha1_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA1_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha1) { + out->type = NID_sha1; + out->md_size = SHA_DIGEST_LENGTH; + out->flags = 0; + out->init = sha1_init; + out->update = sha1_update; + out->final = sha1_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA_CTX); +} + + +static void sha224_init(EVP_MD_CTX *ctx) { + CHECK(SHA224_Init(ctx->md_data)); +} + +static void sha224_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA224_Update(ctx->md_data, data, count)); +} + +static void sha224_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA224_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha224) { + out->type = NID_sha224; + out->md_size = SHA224_DIGEST_LENGTH; + out->flags = 0; + out->init = sha224_init; + out->update = sha224_update; + out->final = sha224_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA256_CTX); +} + + +static void sha256_init(EVP_MD_CTX *ctx) { + CHECK(SHA256_Init(ctx->md_data)); +} + +static void sha256_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA256_Update(ctx->md_data, data, count)); +} + +static void sha256_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA256_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha256) { + out->type = NID_sha256; + out->md_size = SHA256_DIGEST_LENGTH; + out->flags = 0; + out->init = sha256_init; + out->update = sha256_update; + out->final = sha256_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA256_CTX); +} + + +static void sha384_init(EVP_MD_CTX *ctx) { + CHECK(SHA384_Init(ctx->md_data)); +} + +static void sha384_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA384_Update(ctx->md_data, data, count)); +} + +static void sha384_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA384_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha384) { + out->type = NID_sha384; + out->md_size = SHA384_DIGEST_LENGTH; + out->flags = 0; + out->init = sha384_init; + out->update = sha384_update; + out->final = sha384_final; + out->block_size = 128; + out->ctx_size = sizeof(SHA512_CTX); +} + + +static void sha512_init(EVP_MD_CTX *ctx) { + CHECK(SHA512_Init(ctx->md_data)); +} + +static void sha512_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA512_Update(ctx->md_data, data, count)); +} + +static void sha512_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA512_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha512) { + out->type = NID_sha512; + out->md_size = SHA512_DIGEST_LENGTH; + out->flags = 0; + out->init = sha512_init; + out->update = sha512_update; + out->final = sha512_final; + out->block_size = 128; + out->ctx_size = sizeof(SHA512_CTX); +} + + +typedef struct { + MD5_CTX md5; + SHA_CTX sha1; +} MD5_SHA1_CTX; + +static void md5_sha1_init(EVP_MD_CTX *md_ctx) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Init(&ctx->md5) && SHA1_Init(&ctx->sha1)); +} + +static void md5_sha1_update(EVP_MD_CTX *md_ctx, const void *data, + size_t count) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Update(&ctx->md5, data, count) && + SHA1_Update(&ctx->sha1, data, count)); +} + +static void md5_sha1_final(EVP_MD_CTX *md_ctx, uint8_t *out) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Final(out, &ctx->md5) && + SHA1_Final(out + MD5_DIGEST_LENGTH, &ctx->sha1)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md5_sha1) { + out->type = NID_md5_sha1; + out->md_size = MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH; + out->flags = 0; + out->init = md5_sha1_init; + out->update = md5_sha1_update; + out->final = md5_sha1_final; + out->block_size = 64; + out->ctx_size = sizeof(MD5_SHA1_CTX); +} + +#undef CHECK diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c.grpc_back new file mode 100644 index 0000000..f2fa349 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c.grpc_back @@ -0,0 +1,280 @@ +/* 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 "internal.h" +#include "../delocate.h" +#include "../../internal.h" + +#if defined(NDEBUG) +#define CHECK(x) (void) (x) +#else +#define CHECK(x) assert(x) +#endif + + +static void md4_init(EVP_MD_CTX *ctx) { + CHECK(MD4_Init(ctx->md_data)); +} + +static void md4_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(MD4_Update(ctx->md_data, data, count)); +} + +static void md4_final(EVP_MD_CTX *ctx, uint8_t *out) { + CHECK(MD4_Final(out, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) { + out->type = NID_md4; + out->md_size = MD4_DIGEST_LENGTH; + out->flags = 0; + out->init = md4_init; + out->update = md4_update; + out->final = md4_final; + out->block_size = 64; + out->ctx_size = sizeof(MD4_CTX); +} + + +static void md5_init(EVP_MD_CTX *ctx) { + CHECK(MD5_Init(ctx->md_data)); +} + +static void md5_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(MD5_Update(ctx->md_data, data, count)); +} + +static void md5_final(EVP_MD_CTX *ctx, uint8_t *out) { + CHECK(MD5_Final(out, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md5) { + out->type = NID_md5; + out->md_size = MD5_DIGEST_LENGTH; + out->flags = 0; + out->init = md5_init; + out->update = md5_update; + out->final = md5_final; + out->block_size = 64; + out->ctx_size = sizeof(MD5_CTX); +} + + +static void sha1_init(EVP_MD_CTX *ctx) { + CHECK(SHA1_Init(ctx->md_data)); +} + +static void sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA1_Update(ctx->md_data, data, count)); +} + +static void sha1_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA1_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha1) { + out->type = NID_sha1; + out->md_size = SHA_DIGEST_LENGTH; + out->flags = 0; + out->init = sha1_init; + out->update = sha1_update; + out->final = sha1_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA_CTX); +} + + +static void sha224_init(EVP_MD_CTX *ctx) { + CHECK(SHA224_Init(ctx->md_data)); +} + +static void sha224_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA224_Update(ctx->md_data, data, count)); +} + +static void sha224_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA224_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha224) { + out->type = NID_sha224; + out->md_size = SHA224_DIGEST_LENGTH; + out->flags = 0; + out->init = sha224_init; + out->update = sha224_update; + out->final = sha224_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA256_CTX); +} + + +static void sha256_init(EVP_MD_CTX *ctx) { + CHECK(SHA256_Init(ctx->md_data)); +} + +static void sha256_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA256_Update(ctx->md_data, data, count)); +} + +static void sha256_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA256_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha256) { + out->type = NID_sha256; + out->md_size = SHA256_DIGEST_LENGTH; + out->flags = 0; + out->init = sha256_init; + out->update = sha256_update; + out->final = sha256_final; + out->block_size = 64; + out->ctx_size = sizeof(SHA256_CTX); +} + + +static void sha384_init(EVP_MD_CTX *ctx) { + CHECK(SHA384_Init(ctx->md_data)); +} + +static void sha384_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA384_Update(ctx->md_data, data, count)); +} + +static void sha384_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA384_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha384) { + out->type = NID_sha384; + out->md_size = SHA384_DIGEST_LENGTH; + out->flags = 0; + out->init = sha384_init; + out->update = sha384_update; + out->final = sha384_final; + out->block_size = 128; + out->ctx_size = sizeof(SHA512_CTX); +} + + +static void sha512_init(EVP_MD_CTX *ctx) { + CHECK(SHA512_Init(ctx->md_data)); +} + +static void sha512_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + CHECK(SHA512_Update(ctx->md_data, data, count)); +} + +static void sha512_final(EVP_MD_CTX *ctx, uint8_t *md) { + CHECK(SHA512_Final(md, ctx->md_data)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha512) { + out->type = NID_sha512; + out->md_size = SHA512_DIGEST_LENGTH; + out->flags = 0; + out->init = sha512_init; + out->update = sha512_update; + out->final = sha512_final; + out->block_size = 128; + out->ctx_size = sizeof(SHA512_CTX); +} + + +typedef struct { + MD5_CTX md5; + SHA_CTX sha1; +} MD5_SHA1_CTX; + +static void md5_sha1_init(EVP_MD_CTX *md_ctx) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Init(&ctx->md5) && SHA1_Init(&ctx->sha1)); +} + +static void md5_sha1_update(EVP_MD_CTX *md_ctx, const void *data, + size_t count) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Update(&ctx->md5, data, count) && + SHA1_Update(&ctx->sha1, data, count)); +} + +static void md5_sha1_final(EVP_MD_CTX *md_ctx, uint8_t *out) { + MD5_SHA1_CTX *ctx = md_ctx->md_data; + CHECK(MD5_Final(out, &ctx->md5) && + SHA1_Final(out + MD5_DIGEST_LENGTH, &ctx->sha1)); +} + +DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md5_sha1) { + out->type = NID_md5_sha1; + out->md_size = MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH; + out->flags = 0; + out->init = md5_sha1_init; + out->update = md5_sha1_update; + out->final = md5_sha1_final; + out->block_size = 64; + out->ctx_size = sizeof(MD5_SHA1_CTX); +} + +#undef CHECK diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h new file mode 100644 index 0000000..ebac9ab --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h @@ -0,0 +1,112 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_DIGEST_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +struct env_md_st { + // type contains a NID identifing the digest function. (For example, + // NID_md5.) + int type; + + // md_size contains the size, in bytes, of the resulting digest. + unsigned md_size; + + // flags contains the OR of |EVP_MD_FLAG_*| values. + uint32_t flags; + + // init initialises the state in |ctx->md_data|. + void (*init)(EVP_MD_CTX *ctx); + + // update hashes |len| bytes of |data| into the state in |ctx->md_data|. + void (*update)(EVP_MD_CTX *ctx, const void *data, size_t count); + + // final completes the hash and writes |md_size| bytes of digest to |out|. + void (*final)(EVP_MD_CTX *ctx, uint8_t *out); + + // block_size contains the hash's native block size. + unsigned block_size; + + // ctx_size contains the size, in bytes, of the state of the hash function. + unsigned ctx_size; +}; + +// evp_md_pctx_ops contains function pointers to allow the |pctx| member of +// |EVP_MD_CTX| to be manipulated without breaking layering by calling EVP +// functions. +struct evp_md_pctx_ops { + // free is called when an |EVP_MD_CTX| is being freed and the |pctx| also + // needs to be freed. + void (*free) (EVP_PKEY_CTX *pctx); + + // dup is called when an |EVP_MD_CTX| is copied and so the |pctx| also needs + // to be copied. + EVP_PKEY_CTX* (*dup) (EVP_PKEY_CTX *pctx); +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_DIGEST_INTERNAL diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h.grpc_back new file mode 100644 index 0000000..2d06ed0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h.grpc_back @@ -0,0 +1,112 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_DIGEST_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +struct env_md_st { + // type contains a NID identifing the digest function. (For example, + // NID_md5.) + int type; + + // md_size contains the size, in bytes, of the resulting digest. + unsigned md_size; + + // flags contains the OR of |EVP_MD_FLAG_*| values. + uint32_t flags; + + // init initialises the state in |ctx->md_data|. + void (*init)(EVP_MD_CTX *ctx); + + // update hashes |len| bytes of |data| into the state in |ctx->md_data|. + void (*update)(EVP_MD_CTX *ctx, const void *data, size_t count); + + // final completes the hash and writes |md_size| bytes of digest to |out|. + void (*final)(EVP_MD_CTX *ctx, uint8_t *out); + + // block_size contains the hash's native block size. + unsigned block_size; + + // ctx_size contains the size, in bytes, of the state of the hash function. + unsigned ctx_size; +}; + +// evp_md_pctx_ops contains function pointers to allow the |pctx| member of +// |EVP_MD_CTX| to be manipulated without breaking layering by calling EVP +// functions. +struct evp_md_pctx_ops { + // free is called when an |EVP_MD_CTX| is being freed and the |pctx| also + // needs to be freed. + void (*free) (EVP_PKEY_CTX *pctx); + + // dup is called when an |EVP_MD_CTX| is copied and so the |pctx| also needs + // to be copied. + EVP_PKEY_CTX* (*dup) (EVP_PKEY_CTX *pctx); +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_DIGEST_INTERNAL diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h new file mode 100644 index 0000000..fc325d9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h @@ -0,0 +1,268 @@ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// This is a generic 32-bit "collector" for message digest algorithms. It +// collects input character stream into chunks of 32-bit values and invokes the +// block function that performs the actual hash calculations. To make use of +// this mechanism, the following macros must be defined before including +// md32_common.h. +// +// One of |DATA_ORDER_IS_BIG_ENDIAN| or |DATA_ORDER_IS_LITTLE_ENDIAN| must be +// defined to specify the byte order of the input stream. +// +// |HASH_CBLOCK| must be defined as the integer block size, in bytes. +// +// |HASH_CTX| must be defined as the name of the context structure, which must +// have at least the following members: +// +// typedef struct _state_st { +// uint32_t h[ / sizeof(uint32_t)]; +// uint32_t Nl, Nh; +// uint8_t data[HASH_CBLOCK]; +// unsigned num; +// ... +// } _CTX; +// +// is the output length of the hash in bytes, before +// any truncation (e.g. 64 for SHA-224 and SHA-256, 128 for SHA-384 and +// SHA-512). +// +// |HASH_UPDATE| must be defined as the name of the "Update" function to +// generate. +// +// |HASH_TRANSFORM| must be defined as the the name of the "Transform" +// function to generate. +// +// |HASH_FINAL| must be defined as the name of "Final" function to generate. +// +// |HASH_BLOCK_DATA_ORDER| must be defined as the name of the "Block" function. +// That function must be implemented manually. It must be capable of operating +// on *unaligned* input data in its original (data) byte order. It must have +// this signature: +// +// void HASH_BLOCK_DATA_ORDER(uint32_t *state, const uint8_t *data, +// size_t num); +// +// It must update the hash state |state| with |num| blocks of data from |data|, +// where each block is |HASH_CBLOCK| bytes; i.e. |data| points to a array of +// |HASH_CBLOCK * num| bytes. |state| points to the |h| member of a |HASH_CTX|, +// and so will have | / sizeof(uint32_t)| elements. +// +// |HASH_MAKE_STRING(c, s)| must be defined as a block statement that converts +// the hash state |c->h| into the output byte order, storing the result in |s|. + +#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) +#error "DATA_ORDER must be defined!" +#endif + +#ifndef HASH_CBLOCK +#error "HASH_CBLOCK must be defined!" +#endif +#ifndef HASH_CTX +#error "HASH_CTX must be defined!" +#endif + +#ifndef HASH_UPDATE +#error "HASH_UPDATE must be defined!" +#endif +#ifndef HASH_TRANSFORM +#error "HASH_TRANSFORM must be defined!" +#endif +#ifndef HASH_FINAL +#error "HASH_FINAL must be defined!" +#endif + +#ifndef HASH_BLOCK_DATA_ORDER +#error "HASH_BLOCK_DATA_ORDER must be defined!" +#endif + +#ifndef HASH_MAKE_STRING +#error "HASH_MAKE_STRING must be defined!" +#endif + +#if defined(DATA_ORDER_IS_BIG_ENDIAN) + +#define HOST_c2l(c, l) \ + do { \ + (l) = (((uint32_t)(*((c)++))) << 24); \ + (l) |= (((uint32_t)(*((c)++))) << 16); \ + (l) |= (((uint32_t)(*((c)++))) << 8); \ + (l) |= (((uint32_t)(*((c)++)))); \ + } while (0) + +#define HOST_l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l) >> 24) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8) & 0xff); \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + } while (0) + +#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) + +#define HOST_c2l(c, l) \ + do { \ + (l) = (((uint32_t)(*((c)++)))); \ + (l) |= (((uint32_t)(*((c)++))) << 8); \ + (l) |= (((uint32_t)(*((c)++))) << 16); \ + (l) |= (((uint32_t)(*((c)++))) << 24); \ + } while (0) + +#define HOST_l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 24) & 0xff); \ + } while (0) + +#endif // DATA_ORDER + +int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) { + const uint8_t *data = data_; + + if (len == 0) { + return 1; + } + + uint32_t l = c->Nl + (((uint32_t)len) << 3); + if (l < c->Nl) { + // Handle carries. + c->Nh++; + } + c->Nh += (uint32_t)(len >> 29); + c->Nl = l; + + size_t n = c->num; + if (n != 0) { + if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) { + OPENSSL_memcpy(c->data + n, data, HASH_CBLOCK - n); + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + n = HASH_CBLOCK - n; + data += n; + len -= n; + c->num = 0; + // Keep |c->data| zeroed when unused. + OPENSSL_memset(c->data, 0, HASH_CBLOCK); + } else { + OPENSSL_memcpy(c->data + n, data, len); + c->num += (unsigned)len; + return 1; + } + } + + n = len / HASH_CBLOCK; + if (n > 0) { + HASH_BLOCK_DATA_ORDER(c->h, data, n); + n *= HASH_CBLOCK; + data += n; + len -= n; + } + + if (len != 0) { + c->num = (unsigned)len; + OPENSSL_memcpy(c->data, data, len); + } + return 1; +} + + +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 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; + assert(n < HASH_CBLOCK); + c->data[n] = 0x80; + n++; + + // Fill the block with zeros if there isn't room for a 64-bit length. + if (n > (HASH_CBLOCK - 8)) { + OPENSSL_memset(c->data + n, 0, HASH_CBLOCK - n); + n = 0; + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + } + OPENSSL_memset(c->data + n, 0, HASH_CBLOCK - 8 - n); + + // Append a 64-bit length to the block and process it. + uint8_t *p = c->data + HASH_CBLOCK - 8; +#if defined(DATA_ORDER_IS_BIG_ENDIAN) + HOST_l2c(c->Nh, p); + HOST_l2c(c->Nl, p); +#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) + HOST_l2c(c->Nl, p); + HOST_l2c(c->Nh, p); +#endif + assert(p == c->data + HASH_CBLOCK); + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + c->num = 0; + OPENSSL_memset(c->data, 0, HASH_CBLOCK); + + HASH_MAKE_STRING(c, out); + return 1; +} + + +#if defined(__cplusplus) +} // extern C +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back new file mode 100644 index 0000000..07d39d9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back @@ -0,0 +1,268 @@ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// This is a generic 32-bit "collector" for message digest algorithms. It +// collects input character stream into chunks of 32-bit values and invokes the +// block function that performs the actual hash calculations. To make use of +// this mechanism, the following macros must be defined before including +// md32_common.h. +// +// One of |DATA_ORDER_IS_BIG_ENDIAN| or |DATA_ORDER_IS_LITTLE_ENDIAN| must be +// defined to specify the byte order of the input stream. +// +// |HASH_CBLOCK| must be defined as the integer block size, in bytes. +// +// |HASH_CTX| must be defined as the name of the context structure, which must +// have at least the following members: +// +// typedef struct _state_st { +// uint32_t h[ / sizeof(uint32_t)]; +// uint32_t Nl, Nh; +// uint8_t data[HASH_CBLOCK]; +// unsigned num; +// ... +// } _CTX; +// +// is the output length of the hash in bytes, before +// any truncation (e.g. 64 for SHA-224 and SHA-256, 128 for SHA-384 and +// SHA-512). +// +// |HASH_UPDATE| must be defined as the name of the "Update" function to +// generate. +// +// |HASH_TRANSFORM| must be defined as the the name of the "Transform" +// function to generate. +// +// |HASH_FINAL| must be defined as the name of "Final" function to generate. +// +// |HASH_BLOCK_DATA_ORDER| must be defined as the name of the "Block" function. +// That function must be implemented manually. It must be capable of operating +// on *unaligned* input data in its original (data) byte order. It must have +// this signature: +// +// void HASH_BLOCK_DATA_ORDER(uint32_t *state, const uint8_t *data, +// size_t num); +// +// It must update the hash state |state| with |num| blocks of data from |data|, +// where each block is |HASH_CBLOCK| bytes; i.e. |data| points to a array of +// |HASH_CBLOCK * num| bytes. |state| points to the |h| member of a |HASH_CTX|, +// and so will have | / sizeof(uint32_t)| elements. +// +// |HASH_MAKE_STRING(c, s)| must be defined as a block statement that converts +// the hash state |c->h| into the output byte order, storing the result in |s|. + +#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) +#error "DATA_ORDER must be defined!" +#endif + +#ifndef HASH_CBLOCK +#error "HASH_CBLOCK must be defined!" +#endif +#ifndef HASH_CTX +#error "HASH_CTX must be defined!" +#endif + +#ifndef HASH_UPDATE +#error "HASH_UPDATE must be defined!" +#endif +#ifndef HASH_TRANSFORM +#error "HASH_TRANSFORM must be defined!" +#endif +#ifndef HASH_FINAL +#error "HASH_FINAL must be defined!" +#endif + +#ifndef HASH_BLOCK_DATA_ORDER +#error "HASH_BLOCK_DATA_ORDER must be defined!" +#endif + +#ifndef HASH_MAKE_STRING +#error "HASH_MAKE_STRING must be defined!" +#endif + +#if defined(DATA_ORDER_IS_BIG_ENDIAN) + +#define HOST_c2l(c, l) \ + do { \ + (l) = (((uint32_t)(*((c)++))) << 24); \ + (l) |= (((uint32_t)(*((c)++))) << 16); \ + (l) |= (((uint32_t)(*((c)++))) << 8); \ + (l) |= (((uint32_t)(*((c)++)))); \ + } while (0) + +#define HOST_l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l) >> 24) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8) & 0xff); \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + } while (0) + +#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) + +#define HOST_c2l(c, l) \ + do { \ + (l) = (((uint32_t)(*((c)++)))); \ + (l) |= (((uint32_t)(*((c)++))) << 8); \ + (l) |= (((uint32_t)(*((c)++))) << 16); \ + (l) |= (((uint32_t)(*((c)++))) << 24); \ + } while (0) + +#define HOST_l2c(l, c) \ + do { \ + *((c)++) = (uint8_t)(((l)) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 8) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 16) & 0xff); \ + *((c)++) = (uint8_t)(((l) >> 24) & 0xff); \ + } while (0) + +#endif // DATA_ORDER + +int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) { + const uint8_t *data = data_; + + if (len == 0) { + return 1; + } + + uint32_t l = c->Nl + (((uint32_t)len) << 3); + if (l < c->Nl) { + // Handle carries. + c->Nh++; + } + c->Nh += (uint32_t)(len >> 29); + c->Nl = l; + + size_t n = c->num; + if (n != 0) { + if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) { + OPENSSL_memcpy(c->data + n, data, HASH_CBLOCK - n); + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + n = HASH_CBLOCK - n; + data += n; + len -= n; + c->num = 0; + // Keep |c->data| zeroed when unused. + OPENSSL_memset(c->data, 0, HASH_CBLOCK); + } else { + OPENSSL_memcpy(c->data + n, data, len); + c->num += (unsigned)len; + return 1; + } + } + + n = len / HASH_CBLOCK; + if (n > 0) { + HASH_BLOCK_DATA_ORDER(c->h, data, n); + n *= HASH_CBLOCK; + data += n; + len -= n; + } + + if (len != 0) { + c->num = (unsigned)len; + OPENSSL_memcpy(c->data, data, len); + } + return 1; +} + + +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 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; + assert(n < HASH_CBLOCK); + c->data[n] = 0x80; + n++; + + // Fill the block with zeros if there isn't room for a 64-bit length. + if (n > (HASH_CBLOCK - 8)) { + OPENSSL_memset(c->data + n, 0, HASH_CBLOCK - n); + n = 0; + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + } + OPENSSL_memset(c->data + n, 0, HASH_CBLOCK - 8 - n); + + // Append a 64-bit length to the block and process it. + uint8_t *p = c->data + HASH_CBLOCK - 8; +#if defined(DATA_ORDER_IS_BIG_ENDIAN) + HOST_l2c(c->Nh, p); + HOST_l2c(c->Nl, p); +#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) + HOST_l2c(c->Nl, p); + HOST_l2c(c->Nh, p); +#endif + assert(p == c->data + HASH_CBLOCK); + HASH_BLOCK_DATA_ORDER(c->h, c->data, 1); + c->num = 0; + OPENSSL_memset(c->data, 0, HASH_CBLOCK); + + HASH_MAKE_STRING(c, out); + return 1; +} + + +#if defined(__cplusplus) +} // extern C +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c new file mode 100644 index 0000000..9ccdb33 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c @@ -0,0 +1,1080 @@ +/* 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 "../../internal.h" +#include "../bn/internal.h" +#include "../delocate.h" + + +static void ec_point_free(EC_POINT *point, int free_group); + +static const uint8_t kP224Params[6 * 28] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, + // b + 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56, + 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43, + 0x23, 0x55, 0xFF, 0xB4, + // x + 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9, + 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6, + 0x11, 0x5C, 0x1D, 0x21, + // y + 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6, + 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99, + 0x85, 0x00, 0x7e, 0x34, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45, + 0x5C, 0x5C, 0x2A, 0x3D, +}; + +static const uint8_t kP256Params[6 * 32] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD, 0x55, + 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6, + 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B, + // x + 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, + 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, + 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96, + // y + 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b, 0x8e, 0xe7, 0xeb, 0x4a, + 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce, + 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, + 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, +}; + +static const uint8_t kP384Params[6 * 48] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4, 0x98, 0x8E, 0x05, 0x6B, + 0xE3, 0xF8, 0x2D, 0x19, 0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12, + 0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A, 0xC6, 0x56, 0x39, 0x8D, + 0x8A, 0x2E, 0xD1, 0x9D, 0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF, + // x + 0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37, 0x8E, 0xB1, 0xC7, 0x1E, + 0xF3, 0x20, 0xAD, 0x74, 0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98, + 0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38, 0x55, 0x02, 0xF2, 0x5D, + 0xBF, 0x55, 0x29, 0x6C, 0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7, + // y + 0x36, 0x17, 0xde, 0x4a, 0x96, 0x26, 0x2c, 0x6f, 0x5d, 0x9e, 0x98, 0xbf, + 0x92, 0x92, 0xdc, 0x29, 0xf8, 0xf4, 0x1d, 0xbd, 0x28, 0x9a, 0x14, 0x7c, + 0xe9, 0xda, 0x31, 0x13, 0xb5, 0xf0, 0xb8, 0xc0, 0x0a, 0x60, 0xb1, 0xce, + 0x1d, 0x7e, 0x81, 0x9d, 0x7a, 0x43, 0x1d, 0x7c, 0x90, 0xea, 0x0e, 0x5f, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, 0xB2, + 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73, +}; + +static const uint8_t kP521Params[6 * 66] = { + // p + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, 0x9A, 0x1F, 0x92, 0x9A, + 0x21, 0xA0, 0xB6, 0x85, 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3, + 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, 0x09, 0xE1, 0x56, 0x19, + 0x39, 0x51, 0xEC, 0x7E, 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1, + 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, 0x34, 0xF1, 0xEF, 0x45, + 0x1F, 0xD4, 0x6B, 0x50, 0x3F, 0x00, + // x + 0x00, 0xC6, 0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, 0xE9, 0xCD, 0x9E, 0x3E, + 0xCB, 0x66, 0x23, 0x95, 0xB4, 0x42, 0x9C, 0x64, 0x81, 0x39, 0x05, 0x3F, + 0xB5, 0x21, 0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D, 0x3D, 0xBA, 0xA1, 0x4B, + 0x5E, 0x77, 0xEF, 0xE7, 0x59, 0x28, 0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF, + 0xA8, 0xDE, 0x33, 0x48, 0xB3, 0xC1, 0x85, 0x6A, 0x42, 0x9B, 0xF9, 0x7E, + 0x7E, 0x31, 0xC2, 0xE5, 0xBD, 0x66, + // y + 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04, 0x5c, 0x8a, + 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b, + 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, 0x66, 0x2c, 0x97, 0xee, + 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad, + 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40, 0x88, 0xbe, + 0x94, 0x76, 0x9f, 0xd1, 0x66, 0x50, + // order + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x51, 0x86, + 0x87, 0x83, 0xBF, 0x2F, 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09, + 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE, 0xBB, 0x6F, + 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09, +}; + +DEFINE_METHOD_FUNCTION(struct built_in_curves, OPENSSL_built_in_curves) { + // 1.3.132.0.35 + static const uint8_t kOIDP521[] = {0x2b, 0x81, 0x04, 0x00, 0x23}; + out->curves[0].nid = NID_secp521r1; + out->curves[0].oid = kOIDP521; + out->curves[0].oid_len = sizeof(kOIDP521); + out->curves[0].comment = "NIST P-521"; + out->curves[0].param_len = 66; + out->curves[0].params = kP521Params; + out->curves[0].method = EC_GFp_mont_method(); + + // 1.3.132.0.34 + static const uint8_t kOIDP384[] = {0x2b, 0x81, 0x04, 0x00, 0x22}; + out->curves[1].nid = NID_secp384r1; + out->curves[1].oid = kOIDP384; + out->curves[1].oid_len = sizeof(kOIDP384); + out->curves[1].comment = "NIST P-384"; + out->curves[1].param_len = 48; + out->curves[1].params = kP384Params; + out->curves[1].method = EC_GFp_mont_method(); + + // 1.2.840.10045.3.1.7 + static const uint8_t kOIDP256[] = {0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x03, 0x01, 0x07}; + out->curves[2].nid = NID_X9_62_prime256v1; + out->curves[2].oid = kOIDP256; + out->curves[2].oid_len = sizeof(kOIDP256); + out->curves[2].comment = "NIST P-256"; + out->curves[2].param_len = 32; + out->curves[2].params = kP256Params; + out->curves[2].method = +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + EC_GFp_nistz256_method(); +#else + EC_GFp_nistp256_method(); +#endif + + // 1.3.132.0.33 + static const uint8_t kOIDP224[] = {0x2b, 0x81, 0x04, 0x00, 0x21}; + out->curves[3].nid = NID_secp224r1; + out->curves[3].oid = kOIDP224; + out->curves[3].oid_len = sizeof(kOIDP224); + out->curves[3].comment = "NIST P-224"; + out->curves[3].param_len = 28; + out->curves[3].params = kP224Params; + out->curves[3].method = +#if defined(BORINGSSL_HAS_UINT128) && !defined(OPENSSL_SMALL) + EC_GFp_nistp224_method(); +#else + EC_GFp_mont_method(); +#endif +} + +EC_GROUP *ec_group_new(const EC_METHOD *meth) { + EC_GROUP *ret; + + if (meth == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_SLOT_FULL); + return NULL; + } + + if (meth->group_init == 0) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return NULL; + } + + ret = OPENSSL_malloc(sizeof(EC_GROUP)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(EC_GROUP)); + + ret->references = 1; + ret->meth = meth; + BN_init(&ret->order); + + if (!meth->group_init(ret)) { + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +static void ec_group_set0_generator(EC_GROUP *group, EC_POINT *generator) { + assert(group->generator == NULL); + assert(group == generator->group); + + // Avoid a reference cycle. |group->generator| does not maintain an owning + // pointer to |group|. + group->generator = generator; + int is_zero = CRYPTO_refcount_dec_and_test_zero(&group->references); + + assert(!is_zero); + (void)is_zero; +} + +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_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + return NULL; + } + + EC_GROUP *ret = ec_group_new(EC_GFp_mont_method()); + if (ret == NULL) { + return NULL; + } + + if (ret->meth->group_set_curve == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + EC_GROUP_free(ret); + return NULL; + } + if (!ret->meth->group_set_curve(ret, p, a, b, ctx)) { + EC_GROUP_free(ret); + return NULL; + } + return ret; +} + +int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, + const BIGNUM *order, const BIGNUM *cofactor) { + if (group->curve_name != NID_undef || group->generator != NULL || + 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. + // |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_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + // Require a cofactor of one for custom curves, which implies prime order. + if (!BN_is_one(cofactor)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COFACTOR); + return 0; + } + + // Require that p < 2Γ—order. This simplifies some ECDSA operations. + // + // 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)) { + goto err; + } + if (BN_cmp(tmp, &group->field) <= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + goto err; + } + + copy = EC_POINT_new(group); + if (copy == NULL || + !EC_POINT_copy(copy, generator) || + !BN_copy(&group->order, order)) { + goto err; + } + // Store the order in minimal form, so it can be used with |BN_ULONG| arrays. + bn_set_minimal_width(&group->order); + + BN_MONT_CTX_free(group->order_mont); + group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, NULL); + if (group->order_mont == NULL) { + 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); + 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) { + EC_GROUP *group = NULL; + EC_POINT *P = NULL; + BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL; + int ok = 0; + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + goto err; + } + + const unsigned param_len = curve->param_len; + const uint8_t *params = curve->params; + + if (!(p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) || + !(a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) || + !(b = BN_bin2bn(params + 2 * param_len, param_len, NULL))) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + group = ec_group_new(curve->method); + if (group == NULL || + !group->meth->group_set_curve(group, p, a, b, ctx)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + + if ((P = EC_POINT_new(group)) == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + + if (!(x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) || + !(y = BN_bin2bn(params + 4 * param_len, param_len, NULL))) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + if (!BN_bin2bn(params + 5 * param_len, param_len, &group->order)) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + 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); + goto err; + } + + ec_group_set0_generator(group, P); + P = NULL; + ok = 1; + +err: + if (!ok) { + EC_GROUP_free(group); + group = NULL; + } + EC_POINT_free(P); + BN_CTX_free(ctx); + BN_free(p); + BN_free(a); + BN_free(b); + BN_free(x); + BN_free(y); + return group; +} + +// Built-in groups are allocated lazily and static once allocated. +// TODO(davidben): Make these actually static. https://crbug.com/boringssl/20. +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) + +EC_GROUP *EC_GROUP_new_by_curve_name(int nid) { + struct built_in_groups_st *groups = built_in_groups_bss_get(); + EC_GROUP **group_ptr = NULL; + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + const struct built_in_curve *curve = NULL; + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + if (curves->curves[i].nid == nid) { + curve = &curves->curves[i]; + group_ptr = &groups->groups[i]; + break; + } + } + + if (curve == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; + } + + CRYPTO_STATIC_MUTEX_lock_read(built_in_groups_lock_bss_get()); + EC_GROUP *ret = *group_ptr; + CRYPTO_STATIC_MUTEX_unlock_read(built_in_groups_lock_bss_get()); + if (ret != NULL) { + return ret; + } + + ret = ec_group_new_from_data(curve); + if (ret == NULL) { + return NULL; + } + + EC_GROUP *to_free = NULL; + CRYPTO_STATIC_MUTEX_lock_write(built_in_groups_lock_bss_get()); + if (*group_ptr == NULL) { + *group_ptr = ret; + // Filling in |ret->curve_name| makes |EC_GROUP_free| and |EC_GROUP_dup| + // into no-ops. At this point, |ret| is considered static. + ret->curve_name = nid; + } else { + to_free = ret; + ret = *group_ptr; + } + CRYPTO_STATIC_MUTEX_unlock_write(built_in_groups_lock_bss_get()); + + EC_GROUP_free(to_free); + return ret; +} + +void EC_GROUP_free(EC_GROUP *group) { + if (group == NULL || + // Built-in curves are static. + group->curve_name != NID_undef || + !CRYPTO_refcount_dec_and_test_zero(&group->references)) { + return; + } + + if (group->meth->group_finish != NULL) { + group->meth->group_finish(group); + } + + ec_point_free(group->generator, 0 /* don't free group */); + BN_free(&group->order); + BN_MONT_CTX_free(group->order_mont); + + OPENSSL_free(group); +} + +EC_GROUP *EC_GROUP_dup(const EC_GROUP *a) { + if (a == NULL || + // Built-in curves are static. + a->curve_name != NID_undef) { + return (EC_GROUP *)a; + } + + // Groups are logically immutable (but for |EC_GROUP_set_generator| which must + // be called early on), so we simply take a reference. + EC_GROUP *group = (EC_GROUP *)a; + CRYPTO_refcount_inc(&group->references); + return group; +} + +int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ignored) { + // Note this function returns 0 if equal and non-zero otherwise. + if (a == b) { + return 0; + } + if (a->curve_name != b->curve_name) { + return 1; + } + if (a->curve_name != NID_undef) { + // Built-in curves may be compared by curve name alone. + return 0; + } + + // |a| and |b| are both custom curves. We compare the entire curve + // 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->meth != b->meth || + a->generator == NULL || + b->generator == NULL || + BN_cmp(&a->order, &b->order) != 0 || + BN_cmp(&a->field, &b->field) != 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) { + return group->generator; +} + +const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group) { + assert(!BN_is_zero(&group->order)); + return &group->order; +} + +int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { + if (BN_copy(order, EC_GROUP_get0_order(group)) == NULL) { + return 0; + } + 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. + return BN_set_word(cofactor, 1); +} + +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); +} + +int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } + +unsigned EC_GROUP_get_degree(const EC_GROUP *group) { + return BN_num_bits(&group->field); +} + +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; + } + + 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); + ec_GFp_simple_point_init(&ret->raw); + return ret; +} + +static void ec_point_free(EC_POINT *point, int free_group) { + if (!point) { + return; + } + if (free_group) { + EC_GROUP_free(point->group); + } + OPENSSL_free(point); +} + +void EC_POINT_free(EC_POINT *point) { + ec_point_free(point, 1 /* free group */); +} + +void EC_POINT_clear_free(EC_POINT *point) { EC_POINT_free(point); } + +int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) { + if (EC_GROUP_cmp(dest->group, src->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + if (dest == src) { + return 1; + } + ec_GFp_simple_point_copy(&dest->raw, &src->raw); + return 1; +} + +EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { + if (a == NULL) { + return NULL; + } + + EC_POINT *ret = EC_POINT_new(group); + if (ret == NULL || + !EC_POINT_copy(ret, a)) { + EC_POINT_free(ret); + return NULL; + } + + return ret; +} + +int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + return ec_GFp_simple_is_at_infinity(group, &point->raw); +} + +int EC_POINT_is_on_curve(const EC_GROUP *group, const 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_is_on_curve(group, &point->raw); +} + +int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, + BN_CTX *ctx) { + if (EC_GROUP_cmp(group, a->group, NULL) != 0 || + EC_GROUP_cmp(group, b->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return -1; + } + return ec_GFp_simple_cmp(group, &a->raw, &b->raw); +} + +int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, + const EC_POINT *point, BIGNUM *x, + BIGNUM *y, BN_CTX *ctx) { + if (group->meth->point_get_affine_coordinates == 0) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + if (!ec_GFp_simple_point_set_affine_coordinates(group, &point->raw, x, y)) { + return 0; + } + + if (!EC_POINT_is_on_curve(group, point, ctx)) { + // In the event of an error, defend against the caller not checking the + // return value by setting a known safe value: the base point. + const EC_POINT *generator = EC_GROUP_get0_generator(group); + // The generator can be missing if the caller is in the process of + // constructing an arbitrary group. In this, we give up and hope they're + // checking the return value. + if (generator) { + ec_GFp_simple_point_copy(&point->raw, &generator->raw); + } + OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); + return 0; + } + + return 1; +} + +int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, + const EC_POINT *b, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, r->group, NULL) != 0 || + EC_GROUP_cmp(group, a->group, NULL) != 0 || + EC_GROUP_cmp(group, b->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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 || + EC_GROUP_cmp(group, a->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + group->meth->dbl(group, &r->raw, &a->raw); + return 1; +} + + +int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, a->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + ec_GFp_simple_invert(group, &a->raw); + return 1; +} + +static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in, BN_CTX *ctx) { + if (ec_bignum_to_scalar(group, out, in)) { + return 1; + } + + ERR_clear_error(); + + // This is an unusual input, so we do not guarantee constant-time processing. + const BIGNUM *order = &group->order; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ok = tmp != NULL && + BN_nnmod(tmp, in, order, ctx) && + ec_bignum_to_scalar(group, out, tmp); + BN_CTX_end(ctx); + return ok; +} + +int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, + const EC_POINT *p, const BIGNUM *p_scalar, BN_CTX *ctx) { + // Previously, this function set |r| to the point at infinity if there was + // nothing to multiply. But, nobody should be calling this function with + // nothing to multiply in the first place. + if ((g_scalar == NULL && p_scalar == NULL) || + (p == NULL) != (p_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); + return 0; + } + + int ret = 0; + BN_CTX *new_ctx = NULL; + if (ctx == NULL) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + goto err; + } + 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) { + EC_SCALAR scalar; + if (!arbitrary_bignum_to_scalar(group, &scalar, g_scalar, ctx) || + !ec_point_mul_scalar_base(group, &r->raw, &scalar)) { + goto err; + } + } + + if (p_scalar != NULL) { + 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; + } + if (g_scalar == NULL) { + OPENSSL_memcpy(&r->raw, &tmp, sizeof(EC_RAW_POINT)); + } else { + group->meth->add(group, &r->raw, &r->raw, &tmp); + } + } + + ret = 1; + +err: + BN_CTX_free(new_ctx); + return ret; +} + +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; + } + + 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; + } + + group->meth->mul(group, r, p, scalar); + return 1; +} + +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; + } + + 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; + } + + 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) { + // 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) { + return NID_X9_62_prime_field; +} + +void EC_GROUP_set_point_conversion_form(EC_GROUP *group, + point_conversion_form_t form) { + if (form != POINT_CONVERSION_UNCOMPRESSED) { + abort(); + } +} + +size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, + size_t max_num_curves) { + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + + for (size_t i = 0; i < max_num_curves && i < OPENSSL_NUM_BUILT_IN_CURVES; + i++) { + out_curves[i].comment = curves->curves[i].comment; + out_curves[i].nid = curves->curves[i].nid; + } + + return OPENSSL_NUM_BUILT_IN_CURVES; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back new file mode 100644 index 0000000..158d66c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back @@ -0,0 +1,1080 @@ +/* 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 "../../internal.h" +#include "../bn/internal.h" +#include "../delocate.h" + + +static void ec_point_free(EC_POINT *point, int free_group); + +static const uint8_t kP224Params[6 * 28] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, + // b + 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56, + 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43, + 0x23, 0x55, 0xFF, 0xB4, + // x + 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9, + 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6, + 0x11, 0x5C, 0x1D, 0x21, + // y + 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6, + 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99, + 0x85, 0x00, 0x7e, 0x34, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45, + 0x5C, 0x5C, 0x2A, 0x3D, +}; + +static const uint8_t kP256Params[6 * 32] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD, 0x55, + 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6, + 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B, + // x + 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, + 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, + 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96, + // y + 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b, 0x8e, 0xe7, 0xeb, 0x4a, + 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce, + 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, + 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, +}; + +static const uint8_t kP384Params[6 * 48] = { + // p + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4, 0x98, 0x8E, 0x05, 0x6B, + 0xE3, 0xF8, 0x2D, 0x19, 0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12, + 0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A, 0xC6, 0x56, 0x39, 0x8D, + 0x8A, 0x2E, 0xD1, 0x9D, 0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF, + // x + 0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37, 0x8E, 0xB1, 0xC7, 0x1E, + 0xF3, 0x20, 0xAD, 0x74, 0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98, + 0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38, 0x55, 0x02, 0xF2, 0x5D, + 0xBF, 0x55, 0x29, 0x6C, 0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7, + // y + 0x36, 0x17, 0xde, 0x4a, 0x96, 0x26, 0x2c, 0x6f, 0x5d, 0x9e, 0x98, 0xbf, + 0x92, 0x92, 0xdc, 0x29, 0xf8, 0xf4, 0x1d, 0xbd, 0x28, 0x9a, 0x14, 0x7c, + 0xe9, 0xda, 0x31, 0x13, 0xb5, 0xf0, 0xb8, 0xc0, 0x0a, 0x60, 0xb1, 0xce, + 0x1d, 0x7e, 0x81, 0x9d, 0x7a, 0x43, 0x1d, 0x7c, 0x90, 0xea, 0x0e, 0x5f, + // order + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, 0xB2, + 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73, +}; + +static const uint8_t kP521Params[6 * 66] = { + // p + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // a + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + // b + 0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, 0x9A, 0x1F, 0x92, 0x9A, + 0x21, 0xA0, 0xB6, 0x85, 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3, + 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, 0x09, 0xE1, 0x56, 0x19, + 0x39, 0x51, 0xEC, 0x7E, 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1, + 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, 0x34, 0xF1, 0xEF, 0x45, + 0x1F, 0xD4, 0x6B, 0x50, 0x3F, 0x00, + // x + 0x00, 0xC6, 0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, 0xE9, 0xCD, 0x9E, 0x3E, + 0xCB, 0x66, 0x23, 0x95, 0xB4, 0x42, 0x9C, 0x64, 0x81, 0x39, 0x05, 0x3F, + 0xB5, 0x21, 0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D, 0x3D, 0xBA, 0xA1, 0x4B, + 0x5E, 0x77, 0xEF, 0xE7, 0x59, 0x28, 0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF, + 0xA8, 0xDE, 0x33, 0x48, 0xB3, 0xC1, 0x85, 0x6A, 0x42, 0x9B, 0xF9, 0x7E, + 0x7E, 0x31, 0xC2, 0xE5, 0xBD, 0x66, + // y + 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04, 0x5c, 0x8a, + 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b, + 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, 0x66, 0x2c, 0x97, 0xee, + 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad, + 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40, 0x88, 0xbe, + 0x94, 0x76, 0x9f, 0xd1, 0x66, 0x50, + // order + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x51, 0x86, + 0x87, 0x83, 0xBF, 0x2F, 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09, + 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE, 0xBB, 0x6F, + 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09, +}; + +DEFINE_METHOD_FUNCTION(struct built_in_curves, OPENSSL_built_in_curves) { + // 1.3.132.0.35 + static const uint8_t kOIDP521[] = {0x2b, 0x81, 0x04, 0x00, 0x23}; + out->curves[0].nid = NID_secp521r1; + out->curves[0].oid = kOIDP521; + out->curves[0].oid_len = sizeof(kOIDP521); + out->curves[0].comment = "NIST P-521"; + out->curves[0].param_len = 66; + out->curves[0].params = kP521Params; + out->curves[0].method = EC_GFp_mont_method(); + + // 1.3.132.0.34 + static const uint8_t kOIDP384[] = {0x2b, 0x81, 0x04, 0x00, 0x22}; + out->curves[1].nid = NID_secp384r1; + out->curves[1].oid = kOIDP384; + out->curves[1].oid_len = sizeof(kOIDP384); + out->curves[1].comment = "NIST P-384"; + out->curves[1].param_len = 48; + out->curves[1].params = kP384Params; + out->curves[1].method = EC_GFp_mont_method(); + + // 1.2.840.10045.3.1.7 + static const uint8_t kOIDP256[] = {0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x03, 0x01, 0x07}; + out->curves[2].nid = NID_X9_62_prime256v1; + out->curves[2].oid = kOIDP256; + out->curves[2].oid_len = sizeof(kOIDP256); + out->curves[2].comment = "NIST P-256"; + out->curves[2].param_len = 32; + out->curves[2].params = kP256Params; + out->curves[2].method = +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + EC_GFp_nistz256_method(); +#else + EC_GFp_nistp256_method(); +#endif + + // 1.3.132.0.33 + static const uint8_t kOIDP224[] = {0x2b, 0x81, 0x04, 0x00, 0x21}; + out->curves[3].nid = NID_secp224r1; + out->curves[3].oid = kOIDP224; + out->curves[3].oid_len = sizeof(kOIDP224); + out->curves[3].comment = "NIST P-224"; + out->curves[3].param_len = 28; + out->curves[3].params = kP224Params; + out->curves[3].method = +#if defined(BORINGSSL_HAS_UINT128) && !defined(OPENSSL_SMALL) + EC_GFp_nistp224_method(); +#else + EC_GFp_mont_method(); +#endif +} + +EC_GROUP *ec_group_new(const EC_METHOD *meth) { + EC_GROUP *ret; + + if (meth == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_SLOT_FULL); + return NULL; + } + + if (meth->group_init == 0) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return NULL; + } + + ret = OPENSSL_malloc(sizeof(EC_GROUP)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(EC_GROUP)); + + ret->references = 1; + ret->meth = meth; + BN_init(&ret->order); + + if (!meth->group_init(ret)) { + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +static void ec_group_set0_generator(EC_GROUP *group, EC_POINT *generator) { + assert(group->generator == NULL); + assert(group == generator->group); + + // Avoid a reference cycle. |group->generator| does not maintain an owning + // pointer to |group|. + group->generator = generator; + int is_zero = CRYPTO_refcount_dec_and_test_zero(&group->references); + + assert(!is_zero); + (void)is_zero; +} + +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_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + return NULL; + } + + EC_GROUP *ret = ec_group_new(EC_GFp_mont_method()); + if (ret == NULL) { + return NULL; + } + + if (ret->meth->group_set_curve == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + EC_GROUP_free(ret); + return NULL; + } + if (!ret->meth->group_set_curve(ret, p, a, b, ctx)) { + EC_GROUP_free(ret); + return NULL; + } + return ret; +} + +int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, + const BIGNUM *order, const BIGNUM *cofactor) { + if (group->curve_name != NID_undef || group->generator != NULL || + 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. + // |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_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + // Require a cofactor of one for custom curves, which implies prime order. + if (!BN_is_one(cofactor)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COFACTOR); + return 0; + } + + // Require that p < 2Γ—order. This simplifies some ECDSA operations. + // + // 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)) { + goto err; + } + if (BN_cmp(tmp, &group->field) <= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + goto err; + } + + copy = EC_POINT_new(group); + if (copy == NULL || + !EC_POINT_copy(copy, generator) || + !BN_copy(&group->order, order)) { + goto err; + } + // Store the order in minimal form, so it can be used with |BN_ULONG| arrays. + bn_set_minimal_width(&group->order); + + BN_MONT_CTX_free(group->order_mont); + group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, NULL); + if (group->order_mont == NULL) { + 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); + 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) { + EC_GROUP *group = NULL; + EC_POINT *P = NULL; + BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL; + int ok = 0; + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + goto err; + } + + const unsigned param_len = curve->param_len; + const uint8_t *params = curve->params; + + if (!(p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) || + !(a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) || + !(b = BN_bin2bn(params + 2 * param_len, param_len, NULL))) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + group = ec_group_new(curve->method); + if (group == NULL || + !group->meth->group_set_curve(group, p, a, b, ctx)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + + if ((P = EC_POINT_new(group)) == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + + if (!(x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) || + !(y = BN_bin2bn(params + 4 * param_len, param_len, NULL))) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + if (!BN_bin2bn(params + 5 * param_len, param_len, &group->order)) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + 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); + goto err; + } + + ec_group_set0_generator(group, P); + P = NULL; + ok = 1; + +err: + if (!ok) { + EC_GROUP_free(group); + group = NULL; + } + EC_POINT_free(P); + BN_CTX_free(ctx); + BN_free(p); + BN_free(a); + BN_free(b); + BN_free(x); + BN_free(y); + return group; +} + +// Built-in groups are allocated lazily and static once allocated. +// TODO(davidben): Make these actually static. https://crbug.com/boringssl/20. +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) + +EC_GROUP *EC_GROUP_new_by_curve_name(int nid) { + struct built_in_groups_st *groups = built_in_groups_bss_get(); + EC_GROUP **group_ptr = NULL; + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + const struct built_in_curve *curve = NULL; + for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) { + if (curves->curves[i].nid == nid) { + curve = &curves->curves[i]; + group_ptr = &groups->groups[i]; + break; + } + } + + if (curve == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; + } + + CRYPTO_STATIC_MUTEX_lock_read(built_in_groups_lock_bss_get()); + EC_GROUP *ret = *group_ptr; + CRYPTO_STATIC_MUTEX_unlock_read(built_in_groups_lock_bss_get()); + if (ret != NULL) { + return ret; + } + + ret = ec_group_new_from_data(curve); + if (ret == NULL) { + return NULL; + } + + EC_GROUP *to_free = NULL; + CRYPTO_STATIC_MUTEX_lock_write(built_in_groups_lock_bss_get()); + if (*group_ptr == NULL) { + *group_ptr = ret; + // Filling in |ret->curve_name| makes |EC_GROUP_free| and |EC_GROUP_dup| + // into no-ops. At this point, |ret| is considered static. + ret->curve_name = nid; + } else { + to_free = ret; + ret = *group_ptr; + } + CRYPTO_STATIC_MUTEX_unlock_write(built_in_groups_lock_bss_get()); + + EC_GROUP_free(to_free); + return ret; +} + +void EC_GROUP_free(EC_GROUP *group) { + if (group == NULL || + // Built-in curves are static. + group->curve_name != NID_undef || + !CRYPTO_refcount_dec_and_test_zero(&group->references)) { + return; + } + + if (group->meth->group_finish != NULL) { + group->meth->group_finish(group); + } + + ec_point_free(group->generator, 0 /* don't free group */); + BN_free(&group->order); + BN_MONT_CTX_free(group->order_mont); + + OPENSSL_free(group); +} + +EC_GROUP *EC_GROUP_dup(const EC_GROUP *a) { + if (a == NULL || + // Built-in curves are static. + a->curve_name != NID_undef) { + return (EC_GROUP *)a; + } + + // Groups are logically immutable (but for |EC_GROUP_set_generator| which must + // be called early on), so we simply take a reference. + EC_GROUP *group = (EC_GROUP *)a; + CRYPTO_refcount_inc(&group->references); + return group; +} + +int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ignored) { + // Note this function returns 0 if equal and non-zero otherwise. + if (a == b) { + return 0; + } + if (a->curve_name != b->curve_name) { + return 1; + } + if (a->curve_name != NID_undef) { + // Built-in curves may be compared by curve name alone. + return 0; + } + + // |a| and |b| are both custom curves. We compare the entire curve + // 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->meth != b->meth || + a->generator == NULL || + b->generator == NULL || + BN_cmp(&a->order, &b->order) != 0 || + BN_cmp(&a->field, &b->field) != 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) { + return group->generator; +} + +const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group) { + assert(!BN_is_zero(&group->order)); + return &group->order; +} + +int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { + if (BN_copy(order, EC_GROUP_get0_order(group)) == NULL) { + return 0; + } + 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. + return BN_set_word(cofactor, 1); +} + +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); +} + +int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } + +unsigned EC_GROUP_get_degree(const EC_GROUP *group) { + return BN_num_bits(&group->field); +} + +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; + } + + 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); + ec_GFp_simple_point_init(&ret->raw); + return ret; +} + +static void ec_point_free(EC_POINT *point, int free_group) { + if (!point) { + return; + } + if (free_group) { + EC_GROUP_free(point->group); + } + OPENSSL_free(point); +} + +void EC_POINT_free(EC_POINT *point) { + ec_point_free(point, 1 /* free group */); +} + +void EC_POINT_clear_free(EC_POINT *point) { EC_POINT_free(point); } + +int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) { + if (EC_GROUP_cmp(dest->group, src->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + if (dest == src) { + return 1; + } + ec_GFp_simple_point_copy(&dest->raw, &src->raw); + return 1; +} + +EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { + if (a == NULL) { + return NULL; + } + + EC_POINT *ret = EC_POINT_new(group); + if (ret == NULL || + !EC_POINT_copy(ret, a)) { + EC_POINT_free(ret); + return NULL; + } + + return ret; +} + +int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + return ec_GFp_simple_is_at_infinity(group, &point->raw); +} + +int EC_POINT_is_on_curve(const EC_GROUP *group, const 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_is_on_curve(group, &point->raw); +} + +int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, + BN_CTX *ctx) { + if (EC_GROUP_cmp(group, a->group, NULL) != 0 || + EC_GROUP_cmp(group, b->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return -1; + } + return ec_GFp_simple_cmp(group, &a->raw, &b->raw); +} + +int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, + const EC_POINT *point, BIGNUM *x, + BIGNUM *y, BN_CTX *ctx) { + if (group->meth->point_get_affine_coordinates == 0) { + OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + if (!ec_GFp_simple_point_set_affine_coordinates(group, &point->raw, x, y)) { + return 0; + } + + if (!EC_POINT_is_on_curve(group, point, ctx)) { + // In the event of an error, defend against the caller not checking the + // return value by setting a known safe value: the base point. + const EC_POINT *generator = EC_GROUP_get0_generator(group); + // The generator can be missing if the caller is in the process of + // constructing an arbitrary group. In this, we give up and hope they're + // checking the return value. + if (generator) { + ec_GFp_simple_point_copy(&point->raw, &generator->raw); + } + OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); + return 0; + } + + return 1; +} + +int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, + const EC_POINT *b, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, r->group, NULL) != 0 || + EC_GROUP_cmp(group, a->group, NULL) != 0 || + EC_GROUP_cmp(group, b->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + 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 || + EC_GROUP_cmp(group, a->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + group->meth->dbl(group, &r->raw, &a->raw); + return 1; +} + + +int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, a->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + ec_GFp_simple_invert(group, &a->raw); + return 1; +} + +static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in, BN_CTX *ctx) { + if (ec_bignum_to_scalar(group, out, in)) { + return 1; + } + + ERR_clear_error(); + + // This is an unusual input, so we do not guarantee constant-time processing. + const BIGNUM *order = &group->order; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ok = tmp != NULL && + BN_nnmod(tmp, in, order, ctx) && + ec_bignum_to_scalar(group, out, tmp); + BN_CTX_end(ctx); + return ok; +} + +int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, + const EC_POINT *p, const BIGNUM *p_scalar, BN_CTX *ctx) { + // Previously, this function set |r| to the point at infinity if there was + // nothing to multiply. But, nobody should be calling this function with + // nothing to multiply in the first place. + if ((g_scalar == NULL && p_scalar == NULL) || + (p == NULL) != (p_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); + return 0; + } + + int ret = 0; + BN_CTX *new_ctx = NULL; + if (ctx == NULL) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + goto err; + } + 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) { + EC_SCALAR scalar; + if (!arbitrary_bignum_to_scalar(group, &scalar, g_scalar, ctx) || + !ec_point_mul_scalar_base(group, &r->raw, &scalar)) { + goto err; + } + } + + if (p_scalar != NULL) { + 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; + } + if (g_scalar == NULL) { + OPENSSL_memcpy(&r->raw, &tmp, sizeof(EC_RAW_POINT)); + } else { + group->meth->add(group, &r->raw, &r->raw, &tmp); + } + } + + ret = 1; + +err: + BN_CTX_free(new_ctx); + return ret; +} + +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; + } + + 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; + } + + group->meth->mul(group, r, p, scalar); + return 1; +} + +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; + } + + 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; + } + + 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) { + // 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) { + return NID_X9_62_prime_field; +} + +void EC_GROUP_set_point_conversion_form(EC_GROUP *group, + point_conversion_form_t form) { + if (form != POINT_CONVERSION_UNCOMPRESSED) { + abort(); + } +} + +size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, + size_t max_num_curves) { + const struct built_in_curves *const curves = OPENSSL_built_in_curves(); + + for (size_t i = 0; i < max_num_curves && i < OPENSSL_NUM_BUILT_IN_CURVES; + i++) { + out_curves[i].comment = curves->curves[i].comment; + out_curves[i].nid = curves->curves[i].nid; + } + + return OPENSSL_NUM_BUILT_IN_CURVES; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c new file mode 100644 index 0000000..7cf9ffb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c @@ -0,0 +1,479 @@ +/* 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 +#include + +#include "internal.h" +#include "../delocate.h" +#include "../../internal.h" + + +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)); + if (wrapped == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(wrapped, 0, sizeof(EC_WRAPPED_SCALAR)); + wrapped->bignum.d = wrapped->scalar.words; + wrapped->bignum.width = group->order.width; + wrapped->bignum.dmax = group->order.width; + wrapped->bignum.flags = BN_FLG_STATIC_DATA; + return wrapped; +} + +static void ec_wrapped_scalar_free(EC_WRAPPED_SCALAR *scalar) { + OPENSSL_free(scalar); +} + +EC_KEY *EC_KEY_new(void) { return EC_KEY_new_method(NULL); } + +EC_KEY *EC_KEY_new_method(const ENGINE *engine) { + EC_KEY *ret = OPENSSL_malloc(sizeof(EC_KEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EC_KEY)); + + if (engine) { + ret->ecdsa_meth = ENGINE_get_ECDSA_method(engine); + } + if (ret->ecdsa_meth) { + METHOD_ref(ret->ecdsa_meth); + } + + ret->conv_form = POINT_CONVERSION_UNCOMPRESSED; + ret->references = 1; + + CRYPTO_new_ex_data(&ret->ex_data); + + if (ret->ecdsa_meth && ret->ecdsa_meth->init && !ret->ecdsa_meth->init(ret)) { + CRYPTO_free_ex_data(g_ec_ex_data_class_bss_get(), ret, &ret->ex_data); + if (ret->ecdsa_meth) { + METHOD_unref(ret->ecdsa_meth); + } + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +EC_KEY *EC_KEY_new_by_curve_name(int nid) { + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + ret->group = EC_GROUP_new_by_curve_name(nid); + if (ret->group == NULL) { + EC_KEY_free(ret); + return NULL; + } + return ret; +} + +void EC_KEY_free(EC_KEY *r) { + if (r == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&r->references)) { + return; + } + + if (r->ecdsa_meth) { + if (r->ecdsa_meth->finish) { + r->ecdsa_meth->finish(r); + } + METHOD_unref(r->ecdsa_meth); + } + + EC_GROUP_free(r->group); + EC_POINT_free(r->pub_key); + ec_wrapped_scalar_free(r->priv_key); + BN_free(r->fixed_k); + + CRYPTO_free_ex_data(g_ec_ex_data_class_bss_get(), r, &r->ex_data); + + OPENSSL_free(r); +} + +EC_KEY *EC_KEY_dup(const EC_KEY *src) { + if (src == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL) { + return NULL; + } + + if ((src->group != NULL && + !EC_KEY_set_group(ret, src->group)) || + (src->pub_key != NULL && + !EC_KEY_set_public_key(ret, src->pub_key)) || + (src->priv_key != NULL && + !EC_KEY_set_private_key(ret, EC_KEY_get0_private_key(src)))) { + EC_KEY_free(ret); + return NULL; + } + + ret->enc_flag = src->enc_flag; + ret->conv_form = src->conv_form; + return ret; +} + +int EC_KEY_up_ref(EC_KEY *r) { + CRYPTO_refcount_inc(&r->references); + return 1; +} + +int EC_KEY_is_opaque(const EC_KEY *key) { + return key->ecdsa_meth && (key->ecdsa_meth->flags & ECDSA_FLAG_OPAQUE); +} + +const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) { return key->group; } + +int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group) { + // If |key| already has a group, it is an error to switch to another one. + if (key->group != NULL) { + if (EC_GROUP_cmp(key->group, group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); + return 0; + } + return 1; + } + + assert(key->priv_key == NULL); + assert(key->pub_key == NULL); + + EC_GROUP_free(key->group); + key->group = EC_GROUP_dup(group); + return key->group != NULL; +} + +const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key) { + return key->priv_key != NULL ? &key->priv_key->bignum : NULL; +} + +int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key) { + if (key->group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + return 0; + } + + EC_WRAPPED_SCALAR *scalar = ec_wrapped_scalar_new(key->group); + if (scalar == NULL) { + return 0; + } + if (!ec_bignum_to_scalar(key->group, &scalar->scalar, priv_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_WRONG_ORDER); + ec_wrapped_scalar_free(scalar); + return 0; + } + ec_wrapped_scalar_free(key->priv_key); + key->priv_key = scalar; + return 1; +} + +const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key) { + return key->pub_key; +} + +int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) { + if (key->group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + return 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; + } + + EC_POINT_free(key->pub_key); + key->pub_key = EC_POINT_dup(pub_key, key->group); + return (key->pub_key == NULL) ? 0 : 1; +} + +unsigned int EC_KEY_get_enc_flags(const EC_KEY *key) { return key->enc_flag; } + +void EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags) { + key->enc_flag = flags; +} + +point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key) { + return key->conv_form; +} + +void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform) { + key->conv_form = cform; +} + +int EC_KEY_check_key(const EC_KEY *eckey) { + int ok = 0; + BN_CTX *ctx = NULL; + EC_POINT *point = NULL; + + if (!eckey || !eckey->group || !eckey->pub_key) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + goto err; + } + + ctx = BN_CTX_new(); + + if (ctx == NULL) { + goto err; + } + + // testing whether the pub_key is on the elliptic curve + if (!EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); + goto err; + } + // in case the priv_key is present : + // check if generator * priv_key == pub_key + if (eckey->priv_key != NULL) { + point = EC_POINT_new(eckey->group); + if (point == NULL || + !ec_point_mul_scalar_base(eckey->group, &point->raw, + &eckey->priv_key->scalar)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_PRIVATE_KEY); + goto err; + } + } + ok = 1; + +err: + BN_CTX_free(ctx); + EC_POINT_free(point); + return ok; +} + +int EC_KEY_check_fips(const EC_KEY *key) { + if (EC_KEY_is_opaque(key)) { + // Opaque keys can't be checked. + OPENSSL_PUT_ERROR(EC, EC_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + + if (!EC_KEY_check_key(key)) { + return 0; + } + + if (key->priv_key) { + uint8_t data[16] = {0}; + ECDSA_SIG *sig = ECDSA_do_sign(data, sizeof(data), key); +#if defined(BORINGSSL_FIPS_BREAK_ECDSA_PWCT) + data[0] = ~data[0]; +#endif + int ok = sig != NULL && + ECDSA_do_verify(data, sizeof(data), sig, key); + ECDSA_SIG_free(sig); + if (!ok) { + OPENSSL_PUT_ERROR(EC, EC_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + } + + return 1; +} + +int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, const BIGNUM *x, + const BIGNUM *y) { + EC_POINT *point = NULL; + int ok = 0; + + if (!key || !key->group || !x || !y) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + point = EC_POINT_new(key->group); + if (point == NULL || + !EC_POINT_set_affine_coordinates_GFp(key->group, point, x, y, NULL) || + !EC_KEY_set_public_key(key, point) || + !EC_KEY_check_key(key)) { + goto err; + } + + ok = 1; + +err: + EC_POINT_free(point); + 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); + return 0; + } + + // Check that the group order is FIPS compliant (FIPS 186-4 B.4.2). + if (BN_num_bits(EC_GROUP_get0_order(key->group)) < 160) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + static const uint8_t kDefaultAdditionalData[32] = {0}; + EC_WRAPPED_SCALAR *priv_key = ec_wrapped_scalar_new(key->group); + EC_POINT *pub_key = EC_POINT_new(key->group); + if (priv_key == NULL || pub_key == NULL || + // 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_base(key->group, &pub_key->raw, &priv_key->scalar)) { + EC_POINT_free(pub_key); + ec_wrapped_scalar_free(priv_key); + return 0; + } + + ec_wrapped_scalar_free(key->priv_key); + key->priv_key = priv_key; + EC_POINT_free(key->pub_key); + key->pub_key = pub_key; + return 1; +} + +int EC_KEY_generate_key_fips(EC_KEY *eckey) { + return EC_KEY_generate_key(eckey) && EC_KEY_check_fips(eckey); +} + +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) { + int index; + if (!CRYPTO_get_ex_new_index(g_ec_ex_data_class_bss_get(), &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int EC_KEY_set_ex_data(EC_KEY *d, int idx, void *arg) { + return CRYPTO_set_ex_data(&d->ex_data, idx, arg); +} + +void *EC_KEY_get_ex_data(const EC_KEY *d, int idx) { + return CRYPTO_get_ex_data(&d->ex_data, idx); +} + +void EC_KEY_set_asn1_flag(EC_KEY *key, int flag) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back new file mode 100644 index 0000000..0d9ce67 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back @@ -0,0 +1,479 @@ +/* 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 +#include + +#include "internal.h" +#include "../delocate.h" +#include "../../internal.h" + + +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)); + if (wrapped == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(wrapped, 0, sizeof(EC_WRAPPED_SCALAR)); + wrapped->bignum.d = wrapped->scalar.words; + wrapped->bignum.width = group->order.width; + wrapped->bignum.dmax = group->order.width; + wrapped->bignum.flags = BN_FLG_STATIC_DATA; + return wrapped; +} + +static void ec_wrapped_scalar_free(EC_WRAPPED_SCALAR *scalar) { + OPENSSL_free(scalar); +} + +EC_KEY *EC_KEY_new(void) { return EC_KEY_new_method(NULL); } + +EC_KEY *EC_KEY_new_method(const ENGINE *engine) { + EC_KEY *ret = OPENSSL_malloc(sizeof(EC_KEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(ret, 0, sizeof(EC_KEY)); + + if (engine) { + ret->ecdsa_meth = ENGINE_get_ECDSA_method(engine); + } + if (ret->ecdsa_meth) { + METHOD_ref(ret->ecdsa_meth); + } + + ret->conv_form = POINT_CONVERSION_UNCOMPRESSED; + ret->references = 1; + + CRYPTO_new_ex_data(&ret->ex_data); + + if (ret->ecdsa_meth && ret->ecdsa_meth->init && !ret->ecdsa_meth->init(ret)) { + CRYPTO_free_ex_data(g_ec_ex_data_class_bss_get(), ret, &ret->ex_data); + if (ret->ecdsa_meth) { + METHOD_unref(ret->ecdsa_meth); + } + OPENSSL_free(ret); + return NULL; + } + + return ret; +} + +EC_KEY *EC_KEY_new_by_curve_name(int nid) { + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); + return NULL; + } + ret->group = EC_GROUP_new_by_curve_name(nid); + if (ret->group == NULL) { + EC_KEY_free(ret); + return NULL; + } + return ret; +} + +void EC_KEY_free(EC_KEY *r) { + if (r == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&r->references)) { + return; + } + + if (r->ecdsa_meth) { + if (r->ecdsa_meth->finish) { + r->ecdsa_meth->finish(r); + } + METHOD_unref(r->ecdsa_meth); + } + + EC_GROUP_free(r->group); + EC_POINT_free(r->pub_key); + ec_wrapped_scalar_free(r->priv_key); + BN_free(r->fixed_k); + + CRYPTO_free_ex_data(g_ec_ex_data_class_bss_get(), r, &r->ex_data); + + OPENSSL_free(r); +} + +EC_KEY *EC_KEY_dup(const EC_KEY *src) { + if (src == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + + EC_KEY *ret = EC_KEY_new(); + if (ret == NULL) { + return NULL; + } + + if ((src->group != NULL && + !EC_KEY_set_group(ret, src->group)) || + (src->pub_key != NULL && + !EC_KEY_set_public_key(ret, src->pub_key)) || + (src->priv_key != NULL && + !EC_KEY_set_private_key(ret, EC_KEY_get0_private_key(src)))) { + EC_KEY_free(ret); + return NULL; + } + + ret->enc_flag = src->enc_flag; + ret->conv_form = src->conv_form; + return ret; +} + +int EC_KEY_up_ref(EC_KEY *r) { + CRYPTO_refcount_inc(&r->references); + return 1; +} + +int EC_KEY_is_opaque(const EC_KEY *key) { + return key->ecdsa_meth && (key->ecdsa_meth->flags & ECDSA_FLAG_OPAQUE); +} + +const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) { return key->group; } + +int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group) { + // If |key| already has a group, it is an error to switch to another one. + if (key->group != NULL) { + if (EC_GROUP_cmp(key->group, group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); + return 0; + } + return 1; + } + + assert(key->priv_key == NULL); + assert(key->pub_key == NULL); + + EC_GROUP_free(key->group); + key->group = EC_GROUP_dup(group); + return key->group != NULL; +} + +const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key) { + return key->priv_key != NULL ? &key->priv_key->bignum : NULL; +} + +int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key) { + if (key->group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + return 0; + } + + EC_WRAPPED_SCALAR *scalar = ec_wrapped_scalar_new(key->group); + if (scalar == NULL) { + return 0; + } + if (!ec_bignum_to_scalar(key->group, &scalar->scalar, priv_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_WRONG_ORDER); + ec_wrapped_scalar_free(scalar); + return 0; + } + ec_wrapped_scalar_free(key->priv_key); + key->priv_key = scalar; + return 1; +} + +const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key) { + return key->pub_key; +} + +int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) { + if (key->group == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_MISSING_PARAMETERS); + return 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; + } + + EC_POINT_free(key->pub_key); + key->pub_key = EC_POINT_dup(pub_key, key->group); + return (key->pub_key == NULL) ? 0 : 1; +} + +unsigned int EC_KEY_get_enc_flags(const EC_KEY *key) { return key->enc_flag; } + +void EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags) { + key->enc_flag = flags; +} + +point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key) { + return key->conv_form; +} + +void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform) { + key->conv_form = cform; +} + +int EC_KEY_check_key(const EC_KEY *eckey) { + int ok = 0; + BN_CTX *ctx = NULL; + EC_POINT *point = NULL; + + if (!eckey || !eckey->group || !eckey->pub_key) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + goto err; + } + + ctx = BN_CTX_new(); + + if (ctx == NULL) { + goto err; + } + + // testing whether the pub_key is on the elliptic curve + if (!EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); + goto err; + } + // in case the priv_key is present : + // check if generator * priv_key == pub_key + if (eckey->priv_key != NULL) { + point = EC_POINT_new(eckey->group); + if (point == NULL || + !ec_point_mul_scalar_base(eckey->group, &point->raw, + &eckey->priv_key->scalar)) { + OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); + goto err; + } + if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_PRIVATE_KEY); + goto err; + } + } + ok = 1; + +err: + BN_CTX_free(ctx); + EC_POINT_free(point); + return ok; +} + +int EC_KEY_check_fips(const EC_KEY *key) { + if (EC_KEY_is_opaque(key)) { + // Opaque keys can't be checked. + OPENSSL_PUT_ERROR(EC, EC_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + + if (!EC_KEY_check_key(key)) { + return 0; + } + + if (key->priv_key) { + uint8_t data[16] = {0}; + ECDSA_SIG *sig = ECDSA_do_sign(data, sizeof(data), key); +#if defined(BORINGSSL_FIPS_BREAK_ECDSA_PWCT) + data[0] = ~data[0]; +#endif + int ok = sig != NULL && + ECDSA_do_verify(data, sizeof(data), sig, key); + ECDSA_SIG_free(sig); + if (!ok) { + OPENSSL_PUT_ERROR(EC, EC_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + } + + return 1; +} + +int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, const BIGNUM *x, + const BIGNUM *y) { + EC_POINT *point = NULL; + int ok = 0; + + if (!key || !key->group || !x || !y) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + point = EC_POINT_new(key->group); + if (point == NULL || + !EC_POINT_set_affine_coordinates_GFp(key->group, point, x, y, NULL) || + !EC_KEY_set_public_key(key, point) || + !EC_KEY_check_key(key)) { + goto err; + } + + ok = 1; + +err: + EC_POINT_free(point); + 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); + return 0; + } + + // Check that the group order is FIPS compliant (FIPS 186-4 B.4.2). + if (BN_num_bits(EC_GROUP_get0_order(key->group)) < 160) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + static const uint8_t kDefaultAdditionalData[32] = {0}; + EC_WRAPPED_SCALAR *priv_key = ec_wrapped_scalar_new(key->group); + EC_POINT *pub_key = EC_POINT_new(key->group); + if (priv_key == NULL || pub_key == NULL || + // 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_base(key->group, &pub_key->raw, &priv_key->scalar)) { + EC_POINT_free(pub_key); + ec_wrapped_scalar_free(priv_key); + return 0; + } + + ec_wrapped_scalar_free(key->priv_key); + key->priv_key = priv_key; + EC_POINT_free(key->pub_key); + key->pub_key = pub_key; + return 1; +} + +int EC_KEY_generate_key_fips(EC_KEY *eckey) { + return EC_KEY_generate_key(eckey) && EC_KEY_check_fips(eckey); +} + +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) { + int index; + if (!CRYPTO_get_ex_new_index(g_ec_ex_data_class_bss_get(), &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int EC_KEY_set_ex_data(EC_KEY *d, int idx, void *arg) { + return CRYPTO_set_ex_data(&d->ex_data, idx, arg); +} + +void *EC_KEY_get_ex_data(const EC_KEY *d, int idx) { + return CRYPTO_get_ex_data(&d->ex_data, idx); +} + +void EC_KEY_set_asn1_flag(EC_KEY *key, int flag) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c new file mode 100644 index 0000000..a195b95 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back new file mode 100644 index 0000000..0cf1d91 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c new file mode 100644 index 0000000..88ff4a2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c.grpc_back new file mode 100644 index 0000000..9be9f8c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h new file mode 100644 index 0000000..6396e5c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h.grpc_back new file mode 100644 index 0000000..7934c3a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c new file mode 100644 index 0000000..aa42805 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c @@ -0,0 +1,336 @@ +/* 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 "internal.h" + + +static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, + const EC_RAW_POINT *point, + point_conversion_form_t form, + uint8_t *buf, size_t len) { + if (form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); + return 0; + } + + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + const size_t field_len = BN_num_bytes(&group->field); + size_t output_len = 1 /* type byte */ + field_len; + if (form == POINT_CONVERSION_UNCOMPRESSED) { + // Uncompressed points have a second coordinate. + output_len += field_len; + } + + // if 'buf' is NULL, just return required length + if (buf != NULL) { + if (len < output_len) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); + return 0; + } + + 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 (field_len_out != field_len) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return 0; + } + + if (form == POINT_CONVERSION_COMPRESSED) { + buf[0] = form + (y_buf[field_len - 1] & 1); + } else { + buf[0] = form; + } + } + + return output_len; +} + +static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, + const uint8_t *buf, size_t len, + BN_CTX *ctx) { + BN_CTX *new_ctx = NULL; + int ret = 0, used_ctx = 0; + + if (len == 0) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); + goto err; + } + + point_conversion_form_t form = buf[0]; + const int y_bit = form & 1; + form = form & ~1U; + if ((form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) || + (form == POINT_CONVERSION_UNCOMPRESSED && y_bit)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + const size_t field_len = BN_num_bytes(&group->field); + size_t enc_len = 1 /* type byte */ + field_len; + if (form == POINT_CONVERSION_UNCOMPRESSED) { + // Uncompressed points have a second coordinate. + enc_len += field_len; + } + + if (len != enc_len) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + } + + BN_CTX_start(ctx); + used_ctx = 1; + BIGNUM *x = BN_CTX_get(ctx); + BIGNUM *y = BN_CTX_get(ctx); + if (x == NULL || y == NULL) { + goto err; + } + + if (!BN_bin2bn(buf + 1, field_len, x)) { + goto err; + } + if (BN_ucmp(x, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (form == POINT_CONVERSION_COMPRESSED) { + if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) { + goto err; + } + } else { + if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) { + goto err; + } + if (BN_ucmp(y, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { + goto err; + } + } + + ret = 1; + +err: + if (used_ctx) { + BN_CTX_end(ctx); + } + BN_CTX_free(new_ctx); + return ret; +} + +int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, + const uint8_t *buf, size_t len, 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_oct2point(group, point, buf, len, ctx); +} + +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) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + return ec_GFp_simple_point2oct(group, &point->raw, form, buf, len); +} + +int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, + EC_POINT *point, const BIGNUM *x, + int y_bit, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + + if (BN_is_negative(x) || BN_cmp(x, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSED_POINT); + return 0; + } + + BN_CTX *new_ctx = NULL; + int ret = 0; + + ERR_clear_error(); + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + y_bit = (y_bit != 0); + + BN_CTX_start(ctx); + BIGNUM *tmp1 = BN_CTX_get(ctx); + BIGNUM *tmp2 = BN_CTX_get(ctx); + BIGNUM *a = BN_CTX_get(ctx); + BIGNUM *b = BN_CTX_get(ctx); + BIGNUM *y = BN_CTX_get(ctx); + if (y == NULL || + !EC_GROUP_get_curve_GFp(group, NULL, a, b, ctx)) { + goto err; + } + + // Recover y. We have a Weierstrass equation + // y^2 = x^3 + a*x + b, + // so y is one of the square roots of x^3 + a*x + b. + + // tmp1 := x^3 + if (!BN_mod_sqr(tmp2, x, &group->field, ctx) || + !BN_mod_mul(tmp1, tmp2, x, &group->field, ctx)) { + goto err; + } + + // tmp1 := tmp1 + a*x + if (group->a_is_minus3) { + if (!bn_mod_lshift1_consttime(tmp2, x, &group->field, ctx) || + !bn_mod_add_consttime(tmp2, tmp2, x, &group->field, ctx) || + !bn_mod_sub_consttime(tmp1, tmp1, tmp2, &group->field, ctx)) { + goto err; + } + } else { + if (!BN_mod_mul(tmp2, a, x, &group->field, ctx) || + !bn_mod_add_consttime(tmp1, tmp1, tmp2, &group->field, ctx)) { + goto err; + } + } + + // tmp1 := tmp1 + b + if (!bn_mod_add_consttime(tmp1, tmp1, b, &group->field, ctx)) { + goto err; + } + + if (!BN_mod_sqrt(y, tmp1, &group->field, ctx)) { + unsigned long err = ERR_peek_last_error(); + + if (ERR_GET_LIB(err) == ERR_LIB_BN && + ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) { + ERR_clear_error(); + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSED_POINT); + } else { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + } + goto err; + } + + if (y_bit != BN_is_odd(y)) { + if (BN_is_zero(y)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSION_BIT); + goto err; + } + if (!BN_usub(y, &group->field, y)) { + goto err; + } + } + if (y_bit != BN_is_odd(y)) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back new file mode 100644 index 0000000..04b1f2c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back @@ -0,0 +1,336 @@ +/* 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 "internal.h" + + +static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, + const EC_RAW_POINT *point, + point_conversion_form_t form, + uint8_t *buf, size_t len) { + if (form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); + return 0; + } + + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + const size_t field_len = BN_num_bytes(&group->field); + size_t output_len = 1 /* type byte */ + field_len; + if (form == POINT_CONVERSION_UNCOMPRESSED) { + // Uncompressed points have a second coordinate. + output_len += field_len; + } + + // if 'buf' is NULL, just return required length + if (buf != NULL) { + if (len < output_len) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); + return 0; + } + + 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 (field_len_out != field_len) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return 0; + } + + if (form == POINT_CONVERSION_COMPRESSED) { + buf[0] = form + (y_buf[field_len - 1] & 1); + } else { + buf[0] = form; + } + } + + return output_len; +} + +static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, + const uint8_t *buf, size_t len, + BN_CTX *ctx) { + BN_CTX *new_ctx = NULL; + int ret = 0, used_ctx = 0; + + if (len == 0) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); + goto err; + } + + point_conversion_form_t form = buf[0]; + const int y_bit = form & 1; + form = form & ~1U; + if ((form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) || + (form == POINT_CONVERSION_UNCOMPRESSED && y_bit)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + const size_t field_len = BN_num_bytes(&group->field); + size_t enc_len = 1 /* type byte */ + field_len; + if (form == POINT_CONVERSION_UNCOMPRESSED) { + // Uncompressed points have a second coordinate. + enc_len += field_len; + } + + if (len != enc_len) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + } + + BN_CTX_start(ctx); + used_ctx = 1; + BIGNUM *x = BN_CTX_get(ctx); + BIGNUM *y = BN_CTX_get(ctx); + if (x == NULL || y == NULL) { + goto err; + } + + if (!BN_bin2bn(buf + 1, field_len, x)) { + goto err; + } + if (BN_ucmp(x, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (form == POINT_CONVERSION_COMPRESSED) { + if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) { + goto err; + } + } else { + if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) { + goto err; + } + if (BN_ucmp(y, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_ENCODING); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { + goto err; + } + } + + ret = 1; + +err: + if (used_ctx) { + BN_CTX_end(ctx); + } + BN_CTX_free(new_ctx); + return ret; +} + +int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, + const uint8_t *buf, size_t len, 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_oct2point(group, point, buf, len, ctx); +} + +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) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + return ec_GFp_simple_point2oct(group, &point->raw, form, buf, len); +} + +int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, + EC_POINT *point, const BIGNUM *x, + int y_bit, BN_CTX *ctx) { + if (EC_GROUP_cmp(group, point->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + + if (BN_is_negative(x) || BN_cmp(x, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSED_POINT); + return 0; + } + + BN_CTX *new_ctx = NULL; + int ret = 0; + + ERR_clear_error(); + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + y_bit = (y_bit != 0); + + BN_CTX_start(ctx); + BIGNUM *tmp1 = BN_CTX_get(ctx); + BIGNUM *tmp2 = BN_CTX_get(ctx); + BIGNUM *a = BN_CTX_get(ctx); + BIGNUM *b = BN_CTX_get(ctx); + BIGNUM *y = BN_CTX_get(ctx); + if (y == NULL || + !EC_GROUP_get_curve_GFp(group, NULL, a, b, ctx)) { + goto err; + } + + // Recover y. We have a Weierstrass equation + // y^2 = x^3 + a*x + b, + // so y is one of the square roots of x^3 + a*x + b. + + // tmp1 := x^3 + if (!BN_mod_sqr(tmp2, x, &group->field, ctx) || + !BN_mod_mul(tmp1, tmp2, x, &group->field, ctx)) { + goto err; + } + + // tmp1 := tmp1 + a*x + if (group->a_is_minus3) { + if (!bn_mod_lshift1_consttime(tmp2, x, &group->field, ctx) || + !bn_mod_add_consttime(tmp2, tmp2, x, &group->field, ctx) || + !bn_mod_sub_consttime(tmp1, tmp1, tmp2, &group->field, ctx)) { + goto err; + } + } else { + if (!BN_mod_mul(tmp2, a, x, &group->field, ctx) || + !bn_mod_add_consttime(tmp1, tmp1, tmp2, &group->field, ctx)) { + goto err; + } + } + + // tmp1 := tmp1 + b + if (!bn_mod_add_consttime(tmp1, tmp1, b, &group->field, ctx)) { + goto err; + } + + if (!BN_mod_sqrt(y, tmp1, &group->field, ctx)) { + unsigned long err = ERR_peek_last_error(); + + if (ERR_GET_LIB(err) == ERR_LIB_BN && + ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) { + ERR_clear_error(); + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSED_POINT); + } else { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + } + goto err; + } + + if (y_bit != BN_is_odd(y)) { + if (BN_is_zero(y)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_COMPRESSION_BIT); + goto err; + } + if (!BN_usub(y, &group->field, y)) { + goto err; + } + } + if (y_bit != BN_is_odd(y)) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + goto err; + } + + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c new file mode 100644 index 0000000..4932289 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c @@ -0,0 +1,1187 @@ +/* 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. */ + +// A 64-bit implementation of the NIST P-224 elliptic curve point multiplication +// +// Inspired by Daniel J. Bernstein's public domain nistp224 implementation +// and Adam Langley's public domain 64-bit C implementation of curve25519. + +#include + +#include +#include +#include +#include + +#include + +#include "internal.h" +#include "../delocate.h" +#include "../../internal.h" + + +#if defined(BORINGSSL_HAS_UINT128) && !defined(OPENSSL_SMALL) + +// Field elements are represented as a_0 + 2^56*a_1 + 2^112*a_2 + 2^168*a_3 +// using 64-bit coefficients called 'limbs', and sometimes (for multiplication +// results) as b_0 + 2^56*b_1 + 2^112*b_2 + 2^168*b_3 + 2^224*b_4 + 2^280*b_5 + +// 2^336*b_6 using 128-bit coefficients called 'widelimbs'. A 4-p224_limb +// representation is an 'p224_felem'; a 7-p224_widelimb representation is a +// 'p224_widefelem'. Even within felems, bits of adjacent limbs overlap, and we +// don't always reduce the representations: we ensure that inputs to each +// p224_felem multiplication satisfy a_i < 2^60, so outputs satisfy b_i < +// 4*2^60*2^60, and fit into a 128-bit word without overflow. The coefficients +// are then again partially reduced to obtain an p224_felem satisfying a_i < +// 2^57. We only reduce to the unique minimal representation at the end of the +// computation. + +typedef uint64_t p224_limb; +typedef uint128_t p224_widelimb; + +typedef p224_limb p224_felem[4]; +typedef p224_widelimb p224_widefelem[7]; + +// Field element represented as a byte arrary. 28*8 = 224 bits is also the +// group order size for the elliptic curve, and we also use this type for +// scalars for point multiplication. +typedef uint8_t p224_felem_bytearray[28]; + +// Precomputed multiples of the standard generator +// Points are given in coordinates (X, Y, Z) where Z normally is 1 +// (0 for the point at infinity). +// For each field element, slice a_0 is word 0, etc. +// +// The 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^56G +// 3 | 0 0 1 1 | (2^56 + 1)G +// 4 | 0 1 0 0 | 2^112G +// 5 | 0 1 0 1 | (2^112 + 1)G +// 6 | 0 1 1 0 | (2^112 + 2^56)G +// 7 | 0 1 1 1 | (2^112 + 2^56 + 1)G +// 8 | 1 0 0 0 | 2^168G +// 9 | 1 0 0 1 | (2^168 + 1)G +// 10 | 1 0 1 0 | (2^168 + 2^56)G +// 11 | 1 0 1 1 | (2^168 + 2^56 + 1)G +// 12 | 1 1 0 0 | (2^168 + 2^112)G +// 13 | 1 1 0 1 | (2^168 + 2^112 + 1)G +// 14 | 1 1 1 0 | (2^168 + 2^112 + 2^56)G +// 15 | 1 1 1 1 | (2^168 + 2^112 + 2^56 + 1)G +// followed by a copy of this with each element multiplied by 2^28. +// +// 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. +static const p224_felem g_p224_pre_comp[2][16][3] = { + {{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, + {{0x3280d6115c1d21, 0xc1d356c2112234, 0x7f321390b94a03, 0xb70e0cbd6bb4bf}, + {0xd5819985007e34, 0x75a05a07476444, 0xfb4c22dfe6cd43, 0xbd376388b5f723}, + {1, 0, 0, 0}}, + {{0xfd9675666ebbe9, 0xbca7664d40ce5e, 0x2242df8d8a2a43, 0x1f49bbb0f99bc5}, + {0x29e0b892dc9c43, 0xece8608436e662, 0xdc858f185310d0, 0x9812dd4eb8d321}, + {1, 0, 0, 0}}, + {{0x6d3e678d5d8eb8, 0x559eed1cb362f1, 0x16e9a3bbce8a3f, 0xeedcccd8c2a748}, + {0xf19f90ed50266d, 0xabf2b4bf65f9df, 0x313865468fafec, 0x5cb379ba910a17}, + {1, 0, 0, 0}}, + {{0x0641966cab26e3, 0x91fb2991fab0a0, 0xefec27a4e13a0b, 0x0499aa8a5f8ebe}, + {0x7510407766af5d, 0x84d929610d5450, 0x81d77aae82f706, 0x6916f6d4338c5b}, + {1, 0, 0, 0}}, + {{0xea95ac3b1f15c6, 0x086000905e82d4, 0xdd323ae4d1c8b1, 0x932b56be7685a3}, + {0x9ef93dea25dbbf, 0x41665960f390f0, 0xfdec76dbe2a8a7, 0x523e80f019062a}, + {1, 0, 0, 0}}, + {{0x822fdd26732c73, 0xa01c83531b5d0f, 0x363f37347c1ba4, 0xc391b45c84725c}, + {0xbbd5e1b2d6ad24, 0xddfbcde19dfaec, 0xc393da7e222a7f, 0x1efb7890ede244}, + {1, 0, 0, 0}}, + {{0x4c9e90ca217da1, 0xd11beca79159bb, 0xff8d33c2c98b7c, 0x2610b39409f849}, + {0x44d1352ac64da0, 0xcdbb7b2c46b4fb, 0x966c079b753c89, 0xfe67e4e820b112}, + {1, 0, 0, 0}}, + {{0xe28cae2df5312d, 0xc71b61d16f5c6e, 0x79b7619a3e7c4c, 0x05c73240899b47}, + {0x9f7f6382c73e3a, 0x18615165c56bda, 0x641fab2116fd56, 0x72855882b08394}, + {1, 0, 0, 0}}, + {{0x0469182f161c09, 0x74a98ca8d00fb5, 0xb89da93489a3e0, 0x41c98768fb0c1d}, + {0xe5ea05fb32da81, 0x3dce9ffbca6855, 0x1cfe2d3fbf59e6, 0x0e5e03408738a7}, + {1, 0, 0, 0}}, + {{0xdab22b2333e87f, 0x4430137a5dd2f6, 0xe03ab9f738beb8, 0xcb0c5d0dc34f24}, + {0x764a7df0c8fda5, 0x185ba5c3fa2044, 0x9281d688bcbe50, 0xc40331df893881}, + {1, 0, 0, 0}}, + {{0xb89530796f0f60, 0xade92bd26909a3, 0x1a0c83fb4884da, 0x1765bf22a5a984}, + {0x772a9ee75db09e, 0x23bc6c67cec16f, 0x4c1edba8b14e2f, 0xe2a215d9611369}, + {1, 0, 0, 0}}, + {{0x571e509fb5efb3, 0xade88696410552, 0xc8ae85fada74fe, 0x6c7e4be83bbde3}, + {0xff9f51160f4652, 0xb47ce2495a6539, 0xa2946c53b582f4, 0x286d2db3ee9a60}, + {1, 0, 0, 0}}, + {{0x40bbd5081a44af, 0x0995183b13926c, 0xbcefba6f47f6d0, 0x215619e9cc0057}, + {0x8bc94d3b0df45e, 0xf11c54a3694f6f, 0x8631b93cdfe8b5, 0xe7e3f4b0982db9}, + {1, 0, 0, 0}}, + {{0xb17048ab3e1c7b, 0xac38f36ff8a1d8, 0x1c29819435d2c6, 0xc813132f4c07e9}, + {0x2891425503b11f, 0x08781030579fea, 0xf5426ba5cc9674, 0x1e28ebf18562bc}, + {1, 0, 0, 0}}, + {{0x9f31997cc864eb, 0x06cd91d28b5e4c, 0xff17036691a973, 0xf1aef351497c58}, + {0xdd1f2d600564ff, 0xdead073b1402db, 0x74a684435bd693, 0xeea7471f962558}, + {1, 0, 0, 0}}}, + {{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, + {{0x9665266dddf554, 0x9613d78b60ef2d, 0xce27a34cdba417, 0xd35ab74d6afc31}, + {0x85ccdd22deb15e, 0x2137e5783a6aab, 0xa141cffd8c93c6, 0x355a1830e90f2d}, + {1, 0, 0, 0}}, + {{0x1a494eadaade65, 0xd6da4da77fe53c, 0xe7992996abec86, 0x65c3553c6090e3}, + {0xfa610b1fb09346, 0xf1c6540b8a4aaf, 0xc51a13ccd3cbab, 0x02995b1b18c28a}, + {1, 0, 0, 0}}, + {{0x7874568e7295ef, 0x86b419fbe38d04, 0xdc0690a7550d9a, 0xd3966a44beac33}, + {0x2b7280ec29132f, 0xbeaa3b6a032df3, 0xdc7dd88ae41200, 0xd25e2513e3a100}, + {1, 0, 0, 0}}, + {{0x924857eb2efafd, 0xac2bce41223190, 0x8edaa1445553fc, 0x825800fd3562d5}, + {0x8d79148ea96621, 0x23a01c3dd9ed8d, 0xaf8b219f9416b5, 0xd8db0cc277daea}, + {1, 0, 0, 0}}, + {{0x76a9c3b1a700f0, 0xe9acd29bc7e691, 0x69212d1a6b0327, 0x6322e97fe154be}, + {0x469fc5465d62aa, 0x8d41ed18883b05, 0x1f8eae66c52b88, 0xe4fcbe9325be51}, + {1, 0, 0, 0}}, + {{0x825fdf583cac16, 0x020b857c7b023a, 0x683c17744b0165, 0x14ffd0a2daf2f1}, + {0x323b36184218f9, 0x4944ec4e3b47d4, 0xc15b3080841acf, 0x0bced4b01a28bb}, + {1, 0, 0, 0}}, + {{0x92ac22230df5c4, 0x52f33b4063eda8, 0xcb3f19870c0c93, 0x40064f2ba65233}, + {0xfe16f0924f8992, 0x012da25af5b517, 0x1a57bb24f723a6, 0x06f8bc76760def}, + {1, 0, 0, 0}}, + {{0x4a7084f7817cb9, 0xbcab0738ee9a78, 0x3ec11e11d9c326, 0xdc0fe90e0f1aae}, + {0xcf639ea5f98390, 0x5c350aa22ffb74, 0x9afae98a4047b7, 0x956ec2d617fc45}, + {1, 0, 0, 0}}, + {{0x4306d648c1be6a, 0x9247cd8bc9a462, 0xf5595e377d2f2e, 0xbd1c3caff1a52e}, + {0x045e14472409d0, 0x29f3e17078f773, 0x745a602b2d4f7d, 0x191837685cdfbb}, + {1, 0, 0, 0}}, + {{0x5b6ee254a8cb79, 0x4953433f5e7026, 0xe21faeb1d1def4, 0xc4c225785c09de}, + {0x307ce7bba1e518, 0x31b125b1036db8, 0x47e91868839e8f, 0xc765866e33b9f3}, + {1, 0, 0, 0}}, + {{0x3bfece24f96906, 0x4794da641e5093, 0xde5df64f95db26, 0x297ecd89714b05}, + {0x701bd3ebb2c3aa, 0x7073b4f53cb1d5, 0x13c5665658af16, 0x9895089d66fe58}, + {1, 0, 0, 0}}, + {{0x0fef05f78c4790, 0x2d773633b05d2e, 0x94229c3a951c94, 0xbbbd70df4911bb}, + {0xb2c6963d2c1168, 0x105f47a72b0d73, 0x9fdf6111614080, 0x7b7e94b39e67b0}, + {1, 0, 0, 0}}, + {{0xad1a7d6efbe2b3, 0xf012482c0da69d, 0x6b3bdf12438345, 0x40d7558d7aa4d9}, + {0x8a09fffb5c6d3d, 0x9a356e5d9ffd38, 0x5973f15f4f9b1c, 0xdcd5f59f63c3ea}, + {1, 0, 0, 0}}, + {{0xacf39f4c5ca7ab, 0x4c8071cc5fd737, 0xc64e3602cd1184, 0x0acd4644c9abba}, + {0x6c011a36d8bf6e, 0xfecd87ba24e32a, 0x19f6f56574fad8, 0x050b204ced9405}, + {1, 0, 0, 0}}, + {{0xed4f1cae7d9a96, 0x5ceef7ad94c40a, 0x778e4a3bf3ef9b, 0x7405783dc3b55e}, + {0x32477c61b6e8c6, 0xb46a97570f018b, 0x91176d0a7e95d1, 0x3df90fbc4c7d0e}, + {1, 0, 0, 0}}}}; + +static uint64_t p224_load_u64(const uint8_t in[8]) { + uint64_t ret; + OPENSSL_memcpy(&ret, in, sizeof(ret)); + return ret; +} + +// Helper functions to convert field elements to/from internal representation +static void p224_bin28_to_felem(p224_felem out, const uint8_t in[28]) { + out[0] = p224_load_u64(in) & 0x00ffffffffffffff; + out[1] = p224_load_u64(in + 7) & 0x00ffffffffffffff; + out[2] = p224_load_u64(in + 14) & 0x00ffffffffffffff; + out[3] = p224_load_u64(in + 20) >> 8; +} + +static void p224_felem_to_bin28(uint8_t out[28], const p224_felem in) { + for (size_t i = 0; i < 7; ++i) { + out[i] = in[0] >> (8 * i); + out[i + 7] = in[1] >> (8 * i); + out[i + 14] = in[2] >> (8 * i); + out[i + 21] = in[3] >> (8 * i); + } +} + +static void p224_generic_to_felem(p224_felem out, const EC_FELEM *in) { + p224_bin28_to_felem(out, in->bytes); +} + +// 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; + + // 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 <= 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 +// will cause an overflow. + +static void p224_felem_assign(p224_felem out, const p224_felem in) { + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = in[3]; +} + +// Sum two field elements: out += in +static void p224_felem_sum(p224_felem out, const p224_felem in) { + out[0] += in[0]; + out[1] += in[1]; + out[2] += in[2]; + out[3] += in[3]; +} + +// Subtract field elements: out -= in +// Assumes in[i] < 2^57 +static void p224_felem_diff(p224_felem out, const p224_felem in) { + static const p224_limb two58p2 = + (((p224_limb)1) << 58) + (((p224_limb)1) << 2); + static const p224_limb two58m2 = + (((p224_limb)1) << 58) - (((p224_limb)1) << 2); + static const p224_limb two58m42m2 = + (((p224_limb)1) << 58) - (((p224_limb)1) << 42) - (((p224_limb)1) << 2); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two58p2; + out[1] += two58m42m2; + out[2] += two58m2; + out[3] += two58m2; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; +} + +// Subtract in unreduced 128-bit mode: out -= in +// Assumes in[i] < 2^119 +static void p224_widefelem_diff(p224_widefelem out, const p224_widefelem in) { + static const p224_widelimb two120 = ((p224_widelimb)1) << 120; + static const p224_widelimb two120m64 = + (((p224_widelimb)1) << 120) - (((p224_widelimb)1) << 64); + static const p224_widelimb two120m104m64 = (((p224_widelimb)1) << 120) - + (((p224_widelimb)1) << 104) - + (((p224_widelimb)1) << 64); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two120; + out[1] += two120m64; + out[2] += two120m64; + out[3] += two120; + out[4] += two120m104m64; + out[5] += two120m64; + out[6] += two120m64; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; + out[4] -= in[4]; + out[5] -= in[5]; + out[6] -= in[6]; +} + +// Subtract in mixed mode: out128 -= in64 +// in[i] < 2^63 +static void p224_felem_diff_128_64(p224_widefelem out, const p224_felem in) { + static const p224_widelimb two64p8 = + (((p224_widelimb)1) << 64) + (((p224_widelimb)1) << 8); + static const p224_widelimb two64m8 = + (((p224_widelimb)1) << 64) - (((p224_widelimb)1) << 8); + static const p224_widelimb two64m48m8 = (((p224_widelimb)1) << 64) - + (((p224_widelimb)1) << 48) - + (((p224_widelimb)1) << 8); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two64p8; + out[1] += two64m48m8; + out[2] += two64m8; + out[3] += two64m8; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; +} + +// Multiply a field element by a scalar: out = out * scalar +// The scalars we actually use are small, so results fit without overflow +static void p224_felem_scalar(p224_felem out, const p224_limb scalar) { + out[0] *= scalar; + out[1] *= scalar; + out[2] *= scalar; + out[3] *= scalar; +} + +// Multiply an unreduced field element by a scalar: out = out * scalar +// The scalars we actually use are small, so results fit without overflow +static void p224_widefelem_scalar(p224_widefelem out, + const p224_widelimb scalar) { + out[0] *= scalar; + out[1] *= scalar; + out[2] *= scalar; + out[3] *= scalar; + out[4] *= scalar; + out[5] *= scalar; + out[6] *= scalar; +} + +// Square a field element: out = in^2 +static void p224_felem_square(p224_widefelem out, const p224_felem in) { + p224_limb tmp0, tmp1, tmp2; + tmp0 = 2 * in[0]; + tmp1 = 2 * in[1]; + tmp2 = 2 * in[2]; + out[0] = ((p224_widelimb)in[0]) * in[0]; + out[1] = ((p224_widelimb)in[0]) * tmp1; + out[2] = ((p224_widelimb)in[0]) * tmp2 + ((p224_widelimb)in[1]) * in[1]; + out[3] = ((p224_widelimb)in[3]) * tmp0 + ((p224_widelimb)in[1]) * tmp2; + out[4] = ((p224_widelimb)in[3]) * tmp1 + ((p224_widelimb)in[2]) * in[2]; + out[5] = ((p224_widelimb)in[3]) * tmp2; + out[6] = ((p224_widelimb)in[3]) * in[3]; +} + +// Multiply two field elements: out = in1 * in2 +static void p224_felem_mul(p224_widefelem out, const p224_felem in1, + const p224_felem in2) { + out[0] = ((p224_widelimb)in1[0]) * in2[0]; + out[1] = ((p224_widelimb)in1[0]) * in2[1] + ((p224_widelimb)in1[1]) * in2[0]; + out[2] = ((p224_widelimb)in1[0]) * in2[2] + ((p224_widelimb)in1[1]) * in2[1] + + ((p224_widelimb)in1[2]) * in2[0]; + out[3] = ((p224_widelimb)in1[0]) * in2[3] + ((p224_widelimb)in1[1]) * in2[2] + + ((p224_widelimb)in1[2]) * in2[1] + ((p224_widelimb)in1[3]) * in2[0]; + out[4] = ((p224_widelimb)in1[1]) * in2[3] + ((p224_widelimb)in1[2]) * in2[2] + + ((p224_widelimb)in1[3]) * in2[1]; + out[5] = ((p224_widelimb)in1[2]) * in2[3] + ((p224_widelimb)in1[3]) * in2[2]; + out[6] = ((p224_widelimb)in1[3]) * in2[3]; +} + +// Reduce seven 128-bit coefficients to four 64-bit coefficients. +// Requires in[i] < 2^126, +// ensures out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, out[3] <= 2^56 + 2^16 +static void p224_felem_reduce(p224_felem out, const p224_widefelem in) { + static const p224_widelimb two127p15 = + (((p224_widelimb)1) << 127) + (((p224_widelimb)1) << 15); + static const p224_widelimb two127m71 = + (((p224_widelimb)1) << 127) - (((p224_widelimb)1) << 71); + static const p224_widelimb two127m71m55 = (((p224_widelimb)1) << 127) - + (((p224_widelimb)1) << 71) - + (((p224_widelimb)1) << 55); + p224_widelimb output[5]; + + // Add 0 mod 2^224-2^96+1 to ensure all differences are positive + output[0] = in[0] + two127p15; + output[1] = in[1] + two127m71m55; + output[2] = in[2] + two127m71; + output[3] = in[3]; + output[4] = in[4]; + + // Eliminate in[4], in[5], in[6] + output[4] += in[6] >> 16; + output[3] += (in[6] & 0xffff) << 40; + output[2] -= in[6]; + + output[3] += in[5] >> 16; + output[2] += (in[5] & 0xffff) << 40; + output[1] -= in[5]; + + output[2] += output[4] >> 16; + output[1] += (output[4] & 0xffff) << 40; + output[0] -= output[4]; + + // Carry 2 -> 3 -> 4 + output[3] += output[2] >> 56; + output[2] &= 0x00ffffffffffffff; + + output[4] = output[3] >> 56; + output[3] &= 0x00ffffffffffffff; + + // Now output[2] < 2^56, output[3] < 2^56, output[4] < 2^72 + + // Eliminate output[4] + output[2] += output[4] >> 16; + // output[2] < 2^56 + 2^56 = 2^57 + output[1] += (output[4] & 0xffff) << 40; + output[0] -= output[4]; + + // Carry 0 -> 1 -> 2 -> 3 + output[1] += output[0] >> 56; + out[0] = output[0] & 0x00ffffffffffffff; + + output[2] += output[1] >> 56; + // output[2] < 2^57 + 2^72 + out[1] = output[1] & 0x00ffffffffffffff; + output[3] += output[2] >> 56; + // output[3] <= 2^56 + 2^16 + out[2] = output[2] & 0x00ffffffffffffff; + + // out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, + // out[3] <= 2^56 + 2^16 (due to final carry), + // so out < 2*p + out[3] = output[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 +static void p224_felem_neg(p224_felem out, const p224_felem in) { + p224_widefelem tmp = {0}; + p224_felem_diff_128_64(tmp, in); + p224_felem_reduce(out, tmp); +} + +// Zero-check: returns 1 if input is 0, and 0 otherwise. We know that field +// elements are reduced to in < 2^225, so we only need to check three cases: 0, +// 2^224 - 2^96 + 1, and 2^225 - 2^97 + 2 +static p224_limb p224_felem_is_zero(const p224_felem in) { + p224_limb zero = in[0] | in[1] | in[2] | in[3]; + zero = (((int64_t)(zero)-1) >> 63) & 1; + + p224_limb two224m96p1 = (in[0] ^ 1) | (in[1] ^ 0x00ffff0000000000) | + (in[2] ^ 0x00ffffffffffffff) | + (in[3] ^ 0x00ffffffffffffff); + two224m96p1 = (((int64_t)(two224m96p1)-1) >> 63) & 1; + p224_limb two225m97p2 = (in[0] ^ 2) | (in[1] ^ 0x00fffe0000000000) | + (in[2] ^ 0x00ffffffffffffff) | + (in[3] ^ 0x01ffffffffffffff); + two225m97p2 = (((int64_t)(two225m97p2)-1) >> 63) & 1; + return (zero | two224m96p1 | two225m97p2); +} + +// Invert a field element +// Computation chain copied from djb's code +static void p224_felem_inv(p224_felem out, const p224_felem in) { + p224_felem ftmp, ftmp2, ftmp3, ftmp4; + p224_widefelem tmp; + + p224_felem_square(tmp, in); + p224_felem_reduce(ftmp, tmp); // 2 + p224_felem_mul(tmp, in, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^2 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^3 - 2 + p224_felem_mul(tmp, in, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^3 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^4 - 2 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^5 - 4 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^6 - 8 + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^6 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^7 - 2 + for (size_t i = 0; i < 5; ++i) { // 2^12 - 2^6 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^12 - 1 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^13 - 2 + for (size_t i = 0; i < 11; ++i) { // 2^24 - 2^12 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp3, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^24 - 1 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^25 - 2 + for (size_t i = 0; i < 23; ++i) { // 2^48 - 2^24 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp3, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^48 - 1 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp4, tmp); // 2^49 - 2 + for (size_t i = 0; i < 47; ++i) { // 2^96 - 2^48 + p224_felem_square(tmp, ftmp4); + p224_felem_reduce(ftmp4, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp4); + p224_felem_reduce(ftmp3, tmp); // 2^96 - 1 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp4, tmp); // 2^97 - 2 + for (size_t i = 0; i < 23; ++i) { // 2^120 - 2^24 + p224_felem_square(tmp, ftmp4); + p224_felem_reduce(ftmp4, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp4); + p224_felem_reduce(ftmp2, tmp); // 2^120 - 1 + for (size_t i = 0; i < 6; ++i) { // 2^126 - 2^6 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^126 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^127 - 2 + p224_felem_mul(tmp, ftmp, in); + p224_felem_reduce(ftmp, tmp); // 2^127 - 1 + for (size_t i = 0; i < 97; ++i) { // 2^224 - 2^97 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); + } + p224_felem_mul(tmp, ftmp, ftmp3); + p224_felem_reduce(out, tmp); // 2^224 - 2^96 - 1 +} + +// Copy in constant time: +// if icopy == 1, copy in to out, +// if icopy == 0, copy out to itself. +static void p224_copy_conditional(p224_felem out, const p224_felem in, + p224_limb icopy) { + // icopy is a (64-bit) 0 or 1, so copy is either all-zero or all-one + const p224_limb copy = -icopy; + for (size_t i = 0; i < 4; ++i) { + const p224_limb tmp = copy & (in[i] ^ out[i]); + out[i] ^= tmp; + } +} + +// ELLIPTIC CURVE POINT OPERATIONS +// +// Points are represented in Jacobian projective coordinates: +// (X, Y, Z) corresponds to the affine point (X/Z^2, Y/Z^3), +// or to the point at infinity if Z == 0. + +// Double an elliptic curve point: +// (X', Y', Z') = 2 * (X, Y, Z), where +// X' = (3 * (X - Z^2) * (X + Z^2))^2 - 8 * X * Y^2 +// Y' = 3 * (X - Z^2) * (X + Z^2) * (4 * X * Y^2 - X') - 8 * Y^2 +// Z' = (Y + Z)^2 - Y^2 - Z^2 = 2 * Y * Z +// 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 p224_point_double(p224_felem x_out, p224_felem y_out, + p224_felem z_out, const p224_felem x_in, + const p224_felem y_in, const p224_felem z_in) { + p224_widefelem tmp, tmp2; + p224_felem delta, gamma, beta, alpha, ftmp, ftmp2; + + p224_felem_assign(ftmp, x_in); + p224_felem_assign(ftmp2, x_in); + + // delta = z^2 + p224_felem_square(tmp, z_in); + p224_felem_reduce(delta, tmp); + + // gamma = y^2 + p224_felem_square(tmp, y_in); + p224_felem_reduce(gamma, tmp); + + // beta = x*gamma + p224_felem_mul(tmp, x_in, gamma); + p224_felem_reduce(beta, tmp); + + // alpha = 3*(x-delta)*(x+delta) + p224_felem_diff(ftmp, delta); + // ftmp[i] < 2^57 + 2^58 + 2 < 2^59 + p224_felem_sum(ftmp2, delta); + // ftmp2[i] < 2^57 + 2^57 = 2^58 + p224_felem_scalar(ftmp2, 3); + // ftmp2[i] < 3 * 2^58 < 2^60 + p224_felem_mul(tmp, ftmp, ftmp2); + // tmp[i] < 2^60 * 2^59 * 4 = 2^121 + p224_felem_reduce(alpha, tmp); + + // x' = alpha^2 - 8*beta + p224_felem_square(tmp, alpha); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + p224_felem_assign(ftmp, beta); + p224_felem_scalar(ftmp, 8); + // ftmp[i] < 8 * 2^57 = 2^60 + p224_felem_diff_128_64(tmp, ftmp); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(x_out, tmp); + + // z' = (y + z)^2 - gamma - delta + p224_felem_sum(delta, gamma); + // delta[i] < 2^57 + 2^57 = 2^58 + p224_felem_assign(ftmp, y_in); + p224_felem_sum(ftmp, z_in); + // ftmp[i] < 2^57 + 2^57 = 2^58 + p224_felem_square(tmp, ftmp); + // tmp[i] < 4 * 2^58 * 2^58 = 2^118 + p224_felem_diff_128_64(tmp, delta); + // tmp[i] < 2^118 + 2^64 + 8 < 2^119 + p224_felem_reduce(z_out, tmp); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + p224_felem_scalar(beta, 4); + // beta[i] < 4 * 2^57 = 2^59 + p224_felem_diff(beta, x_out); + // beta[i] < 2^59 + 2^58 + 2 < 2^60 + p224_felem_mul(tmp, alpha, beta); + // tmp[i] < 4 * 2^57 * 2^60 = 2^119 + p224_felem_square(tmp2, gamma); + // tmp2[i] < 4 * 2^57 * 2^57 = 2^116 + p224_widefelem_scalar(tmp2, 8); + // tmp2[i] < 8 * 2^116 = 2^119 + p224_widefelem_diff(tmp, tmp2); + // tmp[i] < 2^119 + 2^120 < 2^121 + p224_felem_reduce(y_out, tmp); +} + +// Add two elliptic curve points: +// (X_1, Y_1, Z_1) + (X_2, Y_2, Z_2) = (X_3, Y_3, Z_3), where +// X_3 = (Z_1^3 * Y_2 - Z_2^3 * Y_1)^2 - (Z_1^2 * X_2 - Z_2^2 * X_1)^3 - +// 2 * Z_2^2 * X_1 * (Z_1^2 * X_2 - Z_2^2 * X_1)^2 +// Y_3 = (Z_1^3 * Y_2 - Z_2^3 * Y_1) * (Z_2^2 * X_1 * (Z_1^2 * X_2 - Z_2^2 * +// X_1)^2 - X_3) - +// Z_2^3 * Y_1 * (Z_1^2 * X_2 - Z_2^2 * X_1)^3 +// Z_3 = (Z_1^2 * X_2 - Z_2^2 * X_1) * (Z_1 * Z_2) +// +// This runs faster if 'mixed' is set, which requires Z_2 = 1 or Z_2 = 0. + +// This function is not entirely constant-time: it 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 p224_point_add(p224_felem x3, p224_felem y3, p224_felem z3, + const p224_felem x1, const p224_felem y1, + const p224_felem z1, const int mixed, + const p224_felem x2, const p224_felem y2, + const p224_felem z2) { + p224_felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, x_out, y_out, z_out; + p224_widefelem tmp, tmp2; + p224_limb z1_is_zero, z2_is_zero, x_equal, y_equal; + + if (!mixed) { + // ftmp2 = z2^2 + p224_felem_square(tmp, z2); + p224_felem_reduce(ftmp2, tmp); + + // ftmp4 = z2^3 + p224_felem_mul(tmp, ftmp2, z2); + p224_felem_reduce(ftmp4, tmp); + + // ftmp4 = z2^3*y1 + p224_felem_mul(tmp2, ftmp4, y1); + p224_felem_reduce(ftmp4, tmp2); + + // ftmp2 = z2^2*x1 + p224_felem_mul(tmp2, ftmp2, x1); + p224_felem_reduce(ftmp2, tmp2); + } else { + // We'll assume z2 = 1 (special case z2 = 0 is handled later) + + // ftmp4 = z2^3*y1 + p224_felem_assign(ftmp4, y1); + + // ftmp2 = z2^2*x1 + p224_felem_assign(ftmp2, x1); + } + + // ftmp = z1^2 + p224_felem_square(tmp, z1); + p224_felem_reduce(ftmp, tmp); + + // ftmp3 = z1^3 + p224_felem_mul(tmp, ftmp, z1); + p224_felem_reduce(ftmp3, tmp); + + // tmp = z1^3*y2 + p224_felem_mul(tmp, ftmp3, y2); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // ftmp3 = z1^3*y2 - z2^3*y1 + p224_felem_diff_128_64(tmp, ftmp4); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(ftmp3, tmp); + + // tmp = z1^2*x2 + p224_felem_mul(tmp, ftmp, x2); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // ftmp = z1^2*x2 - z2^2*x1 + p224_felem_diff_128_64(tmp, ftmp2); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(ftmp, tmp); + + // the formulae are incorrect if the points are equal + // so we check for this and do doubling if this happens + x_equal = p224_felem_is_zero(ftmp); + y_equal = p224_felem_is_zero(ftmp3); + 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) + 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; + } + + // ftmp5 = z1*z2 + if (!mixed) { + p224_felem_mul(tmp, z1, z2); + p224_felem_reduce(ftmp5, tmp); + } else { + // special case z2 = 0 is handled later + p224_felem_assign(ftmp5, z1); + } + + // z_out = (z1^2*x2 - z2^2*x1)*(z1*z2) + p224_felem_mul(tmp, ftmp, ftmp5); + p224_felem_reduce(z_out, tmp); + + // ftmp = (z1^2*x2 - z2^2*x1)^2 + p224_felem_assign(ftmp5, ftmp); + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); + + // ftmp5 = (z1^2*x2 - z2^2*x1)^3 + p224_felem_mul(tmp, ftmp, ftmp5); + p224_felem_reduce(ftmp5, tmp); + + // ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp2, tmp); + + // tmp = z2^3*y1*(z1^2*x2 - z2^2*x1)^3 + p224_felem_mul(tmp, ftmp4, ftmp5); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // tmp2 = (z1^3*y2 - z2^3*y1)^2 + p224_felem_square(tmp2, ftmp3); + // tmp2[i] < 4 * 2^57 * 2^57 < 2^116 + + // tmp2 = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 + p224_felem_diff_128_64(tmp2, ftmp5); + // tmp2[i] < 2^116 + 2^64 + 8 < 2^117 + + // ftmp5 = 2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2 + p224_felem_assign(ftmp5, ftmp2); + p224_felem_scalar(ftmp5, 2); + // ftmp5[i] < 2 * 2^57 = 2^58 + + /* x_out = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 - + 2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2 */ + p224_felem_diff_128_64(tmp2, ftmp5); + // tmp2[i] < 2^117 + 2^64 + 8 < 2^118 + p224_felem_reduce(x_out, tmp2); + + // ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out + p224_felem_diff(ftmp2, x_out); + // ftmp2[i] < 2^57 + 2^58 + 2 < 2^59 + + // tmp2 = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out) + p224_felem_mul(tmp2, ftmp3, ftmp2); + // tmp2[i] < 4 * 2^57 * 2^59 = 2^118 + + /* y_out = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out) - + z2^3*y1*(z1^2*x2 - z2^2*x1)^3 */ + p224_widefelem_diff(tmp2, tmp); + // tmp2[i] < 2^118 + 2^120 < 2^121 + p224_felem_reduce(y_out, tmp2); + + // the result (x_out, y_out, z_out) is incorrect if one of the inputs is + // the point at infinity, so we need to check for this separately + + // if point 1 is at infinity, copy point 2 to output, and vice versa + p224_copy_conditional(x_out, x2, z1_is_zero); + p224_copy_conditional(x_out, x1, z2_is_zero); + p224_copy_conditional(y_out, y2, z1_is_zero); + p224_copy_conditional(y_out, y1, z2_is_zero); + p224_copy_conditional(z_out, z2, z1_is_zero); + p224_copy_conditional(z_out, z1, z2_is_zero); + p224_felem_assign(x3, x_out); + p224_felem_assign(y3, y_out); + p224_felem_assign(z3, z_out); +} + +// p224_select_point selects the |idx|th point from a precomputation table and +// copies it to out. +static void p224_select_point(const uint64_t idx, size_t size, + const p224_felem pre_comp[/*size*/][3], + p224_felem out[3]) { + p224_limb *outlimbs = &out[0][0]; + OPENSSL_memset(outlimbs, 0, 3 * sizeof(p224_felem)); + + for (size_t i = 0; i < size; i++) { + const p224_limb *inlimbs = &pre_comp[i][0][0]; + uint64_t mask = i ^ idx; + mask |= mask >> 4; + mask |= mask >> 2; + mask |= mask >> 1; + mask &= 1; + mask--; + for (size_t j = 0; j < 4 * 3; j++) { + outlimbs[j] |= inlimbs[j] & mask; + } + } +} + +// p224_get_bit returns the |i|th bit in |in| +static char p224_get_bit(const p224_felem_bytearray in, size_t i) { + if (i >= 224) { + return 0; + } + return (in[i >> 3] >> (i & 7)) & 1; +} + +// 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; + } + + 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); + + 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]); + } + } +} + +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); + + // Set nq to the point at infinity. + p224_felem nq[3], tmp[4]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + + 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]); + } + + // 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, (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]); + } else { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; + } + } + } + + // 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_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)); + + 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]); + } + + // 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 (!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; + } + + // 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]); + } + + // 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_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]; + 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]); + } + + // 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); + + 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 { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; + } + } + } + + // 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) { + out->group_init = ec_GFp_simple_group_init; + out->group_finish = ec_GFp_simple_group_finish; + out->group_set_curve = ec_GFp_simple_group_set_curve; + out->point_get_affine_coordinates = + ec_GFp_nistp224_point_get_affine_coordinates; + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back new file mode 100644 index 0000000..f8af39b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back @@ -0,0 +1,1187 @@ +/* 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. */ + +// A 64-bit implementation of the NIST P-224 elliptic curve point multiplication +// +// Inspired by Daniel J. Bernstein's public domain nistp224 implementation +// and Adam Langley's public domain 64-bit C implementation of curve25519. + +#include + +#include +#include +#include +#include + +#include + +#include "internal.h" +#include "../delocate.h" +#include "../../internal.h" + + +#if defined(BORINGSSL_HAS_UINT128) && !defined(OPENSSL_SMALL) + +// Field elements are represented as a_0 + 2^56*a_1 + 2^112*a_2 + 2^168*a_3 +// using 64-bit coefficients called 'limbs', and sometimes (for multiplication +// results) as b_0 + 2^56*b_1 + 2^112*b_2 + 2^168*b_3 + 2^224*b_4 + 2^280*b_5 + +// 2^336*b_6 using 128-bit coefficients called 'widelimbs'. A 4-p224_limb +// representation is an 'p224_felem'; a 7-p224_widelimb representation is a +// 'p224_widefelem'. Even within felems, bits of adjacent limbs overlap, and we +// don't always reduce the representations: we ensure that inputs to each +// p224_felem multiplication satisfy a_i < 2^60, so outputs satisfy b_i < +// 4*2^60*2^60, and fit into a 128-bit word without overflow. The coefficients +// are then again partially reduced to obtain an p224_felem satisfying a_i < +// 2^57. We only reduce to the unique minimal representation at the end of the +// computation. + +typedef uint64_t p224_limb; +typedef uint128_t p224_widelimb; + +typedef p224_limb p224_felem[4]; +typedef p224_widelimb p224_widefelem[7]; + +// Field element represented as a byte arrary. 28*8 = 224 bits is also the +// group order size for the elliptic curve, and we also use this type for +// scalars for point multiplication. +typedef uint8_t p224_felem_bytearray[28]; + +// Precomputed multiples of the standard generator +// Points are given in coordinates (X, Y, Z) where Z normally is 1 +// (0 for the point at infinity). +// For each field element, slice a_0 is word 0, etc. +// +// The 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^56G +// 3 | 0 0 1 1 | (2^56 + 1)G +// 4 | 0 1 0 0 | 2^112G +// 5 | 0 1 0 1 | (2^112 + 1)G +// 6 | 0 1 1 0 | (2^112 + 2^56)G +// 7 | 0 1 1 1 | (2^112 + 2^56 + 1)G +// 8 | 1 0 0 0 | 2^168G +// 9 | 1 0 0 1 | (2^168 + 1)G +// 10 | 1 0 1 0 | (2^168 + 2^56)G +// 11 | 1 0 1 1 | (2^168 + 2^56 + 1)G +// 12 | 1 1 0 0 | (2^168 + 2^112)G +// 13 | 1 1 0 1 | (2^168 + 2^112 + 1)G +// 14 | 1 1 1 0 | (2^168 + 2^112 + 2^56)G +// 15 | 1 1 1 1 | (2^168 + 2^112 + 2^56 + 1)G +// followed by a copy of this with each element multiplied by 2^28. +// +// 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. +static const p224_felem g_p224_pre_comp[2][16][3] = { + {{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, + {{0x3280d6115c1d21, 0xc1d356c2112234, 0x7f321390b94a03, 0xb70e0cbd6bb4bf}, + {0xd5819985007e34, 0x75a05a07476444, 0xfb4c22dfe6cd43, 0xbd376388b5f723}, + {1, 0, 0, 0}}, + {{0xfd9675666ebbe9, 0xbca7664d40ce5e, 0x2242df8d8a2a43, 0x1f49bbb0f99bc5}, + {0x29e0b892dc9c43, 0xece8608436e662, 0xdc858f185310d0, 0x9812dd4eb8d321}, + {1, 0, 0, 0}}, + {{0x6d3e678d5d8eb8, 0x559eed1cb362f1, 0x16e9a3bbce8a3f, 0xeedcccd8c2a748}, + {0xf19f90ed50266d, 0xabf2b4bf65f9df, 0x313865468fafec, 0x5cb379ba910a17}, + {1, 0, 0, 0}}, + {{0x0641966cab26e3, 0x91fb2991fab0a0, 0xefec27a4e13a0b, 0x0499aa8a5f8ebe}, + {0x7510407766af5d, 0x84d929610d5450, 0x81d77aae82f706, 0x6916f6d4338c5b}, + {1, 0, 0, 0}}, + {{0xea95ac3b1f15c6, 0x086000905e82d4, 0xdd323ae4d1c8b1, 0x932b56be7685a3}, + {0x9ef93dea25dbbf, 0x41665960f390f0, 0xfdec76dbe2a8a7, 0x523e80f019062a}, + {1, 0, 0, 0}}, + {{0x822fdd26732c73, 0xa01c83531b5d0f, 0x363f37347c1ba4, 0xc391b45c84725c}, + {0xbbd5e1b2d6ad24, 0xddfbcde19dfaec, 0xc393da7e222a7f, 0x1efb7890ede244}, + {1, 0, 0, 0}}, + {{0x4c9e90ca217da1, 0xd11beca79159bb, 0xff8d33c2c98b7c, 0x2610b39409f849}, + {0x44d1352ac64da0, 0xcdbb7b2c46b4fb, 0x966c079b753c89, 0xfe67e4e820b112}, + {1, 0, 0, 0}}, + {{0xe28cae2df5312d, 0xc71b61d16f5c6e, 0x79b7619a3e7c4c, 0x05c73240899b47}, + {0x9f7f6382c73e3a, 0x18615165c56bda, 0x641fab2116fd56, 0x72855882b08394}, + {1, 0, 0, 0}}, + {{0x0469182f161c09, 0x74a98ca8d00fb5, 0xb89da93489a3e0, 0x41c98768fb0c1d}, + {0xe5ea05fb32da81, 0x3dce9ffbca6855, 0x1cfe2d3fbf59e6, 0x0e5e03408738a7}, + {1, 0, 0, 0}}, + {{0xdab22b2333e87f, 0x4430137a5dd2f6, 0xe03ab9f738beb8, 0xcb0c5d0dc34f24}, + {0x764a7df0c8fda5, 0x185ba5c3fa2044, 0x9281d688bcbe50, 0xc40331df893881}, + {1, 0, 0, 0}}, + {{0xb89530796f0f60, 0xade92bd26909a3, 0x1a0c83fb4884da, 0x1765bf22a5a984}, + {0x772a9ee75db09e, 0x23bc6c67cec16f, 0x4c1edba8b14e2f, 0xe2a215d9611369}, + {1, 0, 0, 0}}, + {{0x571e509fb5efb3, 0xade88696410552, 0xc8ae85fada74fe, 0x6c7e4be83bbde3}, + {0xff9f51160f4652, 0xb47ce2495a6539, 0xa2946c53b582f4, 0x286d2db3ee9a60}, + {1, 0, 0, 0}}, + {{0x40bbd5081a44af, 0x0995183b13926c, 0xbcefba6f47f6d0, 0x215619e9cc0057}, + {0x8bc94d3b0df45e, 0xf11c54a3694f6f, 0x8631b93cdfe8b5, 0xe7e3f4b0982db9}, + {1, 0, 0, 0}}, + {{0xb17048ab3e1c7b, 0xac38f36ff8a1d8, 0x1c29819435d2c6, 0xc813132f4c07e9}, + {0x2891425503b11f, 0x08781030579fea, 0xf5426ba5cc9674, 0x1e28ebf18562bc}, + {1, 0, 0, 0}}, + {{0x9f31997cc864eb, 0x06cd91d28b5e4c, 0xff17036691a973, 0xf1aef351497c58}, + {0xdd1f2d600564ff, 0xdead073b1402db, 0x74a684435bd693, 0xeea7471f962558}, + {1, 0, 0, 0}}}, + {{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, + {{0x9665266dddf554, 0x9613d78b60ef2d, 0xce27a34cdba417, 0xd35ab74d6afc31}, + {0x85ccdd22deb15e, 0x2137e5783a6aab, 0xa141cffd8c93c6, 0x355a1830e90f2d}, + {1, 0, 0, 0}}, + {{0x1a494eadaade65, 0xd6da4da77fe53c, 0xe7992996abec86, 0x65c3553c6090e3}, + {0xfa610b1fb09346, 0xf1c6540b8a4aaf, 0xc51a13ccd3cbab, 0x02995b1b18c28a}, + {1, 0, 0, 0}}, + {{0x7874568e7295ef, 0x86b419fbe38d04, 0xdc0690a7550d9a, 0xd3966a44beac33}, + {0x2b7280ec29132f, 0xbeaa3b6a032df3, 0xdc7dd88ae41200, 0xd25e2513e3a100}, + {1, 0, 0, 0}}, + {{0x924857eb2efafd, 0xac2bce41223190, 0x8edaa1445553fc, 0x825800fd3562d5}, + {0x8d79148ea96621, 0x23a01c3dd9ed8d, 0xaf8b219f9416b5, 0xd8db0cc277daea}, + {1, 0, 0, 0}}, + {{0x76a9c3b1a700f0, 0xe9acd29bc7e691, 0x69212d1a6b0327, 0x6322e97fe154be}, + {0x469fc5465d62aa, 0x8d41ed18883b05, 0x1f8eae66c52b88, 0xe4fcbe9325be51}, + {1, 0, 0, 0}}, + {{0x825fdf583cac16, 0x020b857c7b023a, 0x683c17744b0165, 0x14ffd0a2daf2f1}, + {0x323b36184218f9, 0x4944ec4e3b47d4, 0xc15b3080841acf, 0x0bced4b01a28bb}, + {1, 0, 0, 0}}, + {{0x92ac22230df5c4, 0x52f33b4063eda8, 0xcb3f19870c0c93, 0x40064f2ba65233}, + {0xfe16f0924f8992, 0x012da25af5b517, 0x1a57bb24f723a6, 0x06f8bc76760def}, + {1, 0, 0, 0}}, + {{0x4a7084f7817cb9, 0xbcab0738ee9a78, 0x3ec11e11d9c326, 0xdc0fe90e0f1aae}, + {0xcf639ea5f98390, 0x5c350aa22ffb74, 0x9afae98a4047b7, 0x956ec2d617fc45}, + {1, 0, 0, 0}}, + {{0x4306d648c1be6a, 0x9247cd8bc9a462, 0xf5595e377d2f2e, 0xbd1c3caff1a52e}, + {0x045e14472409d0, 0x29f3e17078f773, 0x745a602b2d4f7d, 0x191837685cdfbb}, + {1, 0, 0, 0}}, + {{0x5b6ee254a8cb79, 0x4953433f5e7026, 0xe21faeb1d1def4, 0xc4c225785c09de}, + {0x307ce7bba1e518, 0x31b125b1036db8, 0x47e91868839e8f, 0xc765866e33b9f3}, + {1, 0, 0, 0}}, + {{0x3bfece24f96906, 0x4794da641e5093, 0xde5df64f95db26, 0x297ecd89714b05}, + {0x701bd3ebb2c3aa, 0x7073b4f53cb1d5, 0x13c5665658af16, 0x9895089d66fe58}, + {1, 0, 0, 0}}, + {{0x0fef05f78c4790, 0x2d773633b05d2e, 0x94229c3a951c94, 0xbbbd70df4911bb}, + {0xb2c6963d2c1168, 0x105f47a72b0d73, 0x9fdf6111614080, 0x7b7e94b39e67b0}, + {1, 0, 0, 0}}, + {{0xad1a7d6efbe2b3, 0xf012482c0da69d, 0x6b3bdf12438345, 0x40d7558d7aa4d9}, + {0x8a09fffb5c6d3d, 0x9a356e5d9ffd38, 0x5973f15f4f9b1c, 0xdcd5f59f63c3ea}, + {1, 0, 0, 0}}, + {{0xacf39f4c5ca7ab, 0x4c8071cc5fd737, 0xc64e3602cd1184, 0x0acd4644c9abba}, + {0x6c011a36d8bf6e, 0xfecd87ba24e32a, 0x19f6f56574fad8, 0x050b204ced9405}, + {1, 0, 0, 0}}, + {{0xed4f1cae7d9a96, 0x5ceef7ad94c40a, 0x778e4a3bf3ef9b, 0x7405783dc3b55e}, + {0x32477c61b6e8c6, 0xb46a97570f018b, 0x91176d0a7e95d1, 0x3df90fbc4c7d0e}, + {1, 0, 0, 0}}}}; + +static uint64_t p224_load_u64(const uint8_t in[8]) { + uint64_t ret; + OPENSSL_memcpy(&ret, in, sizeof(ret)); + return ret; +} + +// Helper functions to convert field elements to/from internal representation +static void p224_bin28_to_felem(p224_felem out, const uint8_t in[28]) { + out[0] = p224_load_u64(in) & 0x00ffffffffffffff; + out[1] = p224_load_u64(in + 7) & 0x00ffffffffffffff; + out[2] = p224_load_u64(in + 14) & 0x00ffffffffffffff; + out[3] = p224_load_u64(in + 20) >> 8; +} + +static void p224_felem_to_bin28(uint8_t out[28], const p224_felem in) { + for (size_t i = 0; i < 7; ++i) { + out[i] = in[0] >> (8 * i); + out[i + 7] = in[1] >> (8 * i); + out[i + 14] = in[2] >> (8 * i); + out[i + 21] = in[3] >> (8 * i); + } +} + +static void p224_generic_to_felem(p224_felem out, const EC_FELEM *in) { + p224_bin28_to_felem(out, in->bytes); +} + +// 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; + + // 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 <= 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 +// will cause an overflow. + +static void p224_felem_assign(p224_felem out, const p224_felem in) { + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = in[3]; +} + +// Sum two field elements: out += in +static void p224_felem_sum(p224_felem out, const p224_felem in) { + out[0] += in[0]; + out[1] += in[1]; + out[2] += in[2]; + out[3] += in[3]; +} + +// Subtract field elements: out -= in +// Assumes in[i] < 2^57 +static void p224_felem_diff(p224_felem out, const p224_felem in) { + static const p224_limb two58p2 = + (((p224_limb)1) << 58) + (((p224_limb)1) << 2); + static const p224_limb two58m2 = + (((p224_limb)1) << 58) - (((p224_limb)1) << 2); + static const p224_limb two58m42m2 = + (((p224_limb)1) << 58) - (((p224_limb)1) << 42) - (((p224_limb)1) << 2); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two58p2; + out[1] += two58m42m2; + out[2] += two58m2; + out[3] += two58m2; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; +} + +// Subtract in unreduced 128-bit mode: out -= in +// Assumes in[i] < 2^119 +static void p224_widefelem_diff(p224_widefelem out, const p224_widefelem in) { + static const p224_widelimb two120 = ((p224_widelimb)1) << 120; + static const p224_widelimb two120m64 = + (((p224_widelimb)1) << 120) - (((p224_widelimb)1) << 64); + static const p224_widelimb two120m104m64 = (((p224_widelimb)1) << 120) - + (((p224_widelimb)1) << 104) - + (((p224_widelimb)1) << 64); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two120; + out[1] += two120m64; + out[2] += two120m64; + out[3] += two120; + out[4] += two120m104m64; + out[5] += two120m64; + out[6] += two120m64; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; + out[4] -= in[4]; + out[5] -= in[5]; + out[6] -= in[6]; +} + +// Subtract in mixed mode: out128 -= in64 +// in[i] < 2^63 +static void p224_felem_diff_128_64(p224_widefelem out, const p224_felem in) { + static const p224_widelimb two64p8 = + (((p224_widelimb)1) << 64) + (((p224_widelimb)1) << 8); + static const p224_widelimb two64m8 = + (((p224_widelimb)1) << 64) - (((p224_widelimb)1) << 8); + static const p224_widelimb two64m48m8 = (((p224_widelimb)1) << 64) - + (((p224_widelimb)1) << 48) - + (((p224_widelimb)1) << 8); + + // Add 0 mod 2^224-2^96+1 to ensure out > in + out[0] += two64p8; + out[1] += two64m48m8; + out[2] += two64m8; + out[3] += two64m8; + + out[0] -= in[0]; + out[1] -= in[1]; + out[2] -= in[2]; + out[3] -= in[3]; +} + +// Multiply a field element by a scalar: out = out * scalar +// The scalars we actually use are small, so results fit without overflow +static void p224_felem_scalar(p224_felem out, const p224_limb scalar) { + out[0] *= scalar; + out[1] *= scalar; + out[2] *= scalar; + out[3] *= scalar; +} + +// Multiply an unreduced field element by a scalar: out = out * scalar +// The scalars we actually use are small, so results fit without overflow +static void p224_widefelem_scalar(p224_widefelem out, + const p224_widelimb scalar) { + out[0] *= scalar; + out[1] *= scalar; + out[2] *= scalar; + out[3] *= scalar; + out[4] *= scalar; + out[5] *= scalar; + out[6] *= scalar; +} + +// Square a field element: out = in^2 +static void p224_felem_square(p224_widefelem out, const p224_felem in) { + p224_limb tmp0, tmp1, tmp2; + tmp0 = 2 * in[0]; + tmp1 = 2 * in[1]; + tmp2 = 2 * in[2]; + out[0] = ((p224_widelimb)in[0]) * in[0]; + out[1] = ((p224_widelimb)in[0]) * tmp1; + out[2] = ((p224_widelimb)in[0]) * tmp2 + ((p224_widelimb)in[1]) * in[1]; + out[3] = ((p224_widelimb)in[3]) * tmp0 + ((p224_widelimb)in[1]) * tmp2; + out[4] = ((p224_widelimb)in[3]) * tmp1 + ((p224_widelimb)in[2]) * in[2]; + out[5] = ((p224_widelimb)in[3]) * tmp2; + out[6] = ((p224_widelimb)in[3]) * in[3]; +} + +// Multiply two field elements: out = in1 * in2 +static void p224_felem_mul(p224_widefelem out, const p224_felem in1, + const p224_felem in2) { + out[0] = ((p224_widelimb)in1[0]) * in2[0]; + out[1] = ((p224_widelimb)in1[0]) * in2[1] + ((p224_widelimb)in1[1]) * in2[0]; + out[2] = ((p224_widelimb)in1[0]) * in2[2] + ((p224_widelimb)in1[1]) * in2[1] + + ((p224_widelimb)in1[2]) * in2[0]; + out[3] = ((p224_widelimb)in1[0]) * in2[3] + ((p224_widelimb)in1[1]) * in2[2] + + ((p224_widelimb)in1[2]) * in2[1] + ((p224_widelimb)in1[3]) * in2[0]; + out[4] = ((p224_widelimb)in1[1]) * in2[3] + ((p224_widelimb)in1[2]) * in2[2] + + ((p224_widelimb)in1[3]) * in2[1]; + out[5] = ((p224_widelimb)in1[2]) * in2[3] + ((p224_widelimb)in1[3]) * in2[2]; + out[6] = ((p224_widelimb)in1[3]) * in2[3]; +} + +// Reduce seven 128-bit coefficients to four 64-bit coefficients. +// Requires in[i] < 2^126, +// ensures out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, out[3] <= 2^56 + 2^16 +static void p224_felem_reduce(p224_felem out, const p224_widefelem in) { + static const p224_widelimb two127p15 = + (((p224_widelimb)1) << 127) + (((p224_widelimb)1) << 15); + static const p224_widelimb two127m71 = + (((p224_widelimb)1) << 127) - (((p224_widelimb)1) << 71); + static const p224_widelimb two127m71m55 = (((p224_widelimb)1) << 127) - + (((p224_widelimb)1) << 71) - + (((p224_widelimb)1) << 55); + p224_widelimb output[5]; + + // Add 0 mod 2^224-2^96+1 to ensure all differences are positive + output[0] = in[0] + two127p15; + output[1] = in[1] + two127m71m55; + output[2] = in[2] + two127m71; + output[3] = in[3]; + output[4] = in[4]; + + // Eliminate in[4], in[5], in[6] + output[4] += in[6] >> 16; + output[3] += (in[6] & 0xffff) << 40; + output[2] -= in[6]; + + output[3] += in[5] >> 16; + output[2] += (in[5] & 0xffff) << 40; + output[1] -= in[5]; + + output[2] += output[4] >> 16; + output[1] += (output[4] & 0xffff) << 40; + output[0] -= output[4]; + + // Carry 2 -> 3 -> 4 + output[3] += output[2] >> 56; + output[2] &= 0x00ffffffffffffff; + + output[4] = output[3] >> 56; + output[3] &= 0x00ffffffffffffff; + + // Now output[2] < 2^56, output[3] < 2^56, output[4] < 2^72 + + // Eliminate output[4] + output[2] += output[4] >> 16; + // output[2] < 2^56 + 2^56 = 2^57 + output[1] += (output[4] & 0xffff) << 40; + output[0] -= output[4]; + + // Carry 0 -> 1 -> 2 -> 3 + output[1] += output[0] >> 56; + out[0] = output[0] & 0x00ffffffffffffff; + + output[2] += output[1] >> 56; + // output[2] < 2^57 + 2^72 + out[1] = output[1] & 0x00ffffffffffffff; + output[3] += output[2] >> 56; + // output[3] <= 2^56 + 2^16 + out[2] = output[2] & 0x00ffffffffffffff; + + // out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, + // out[3] <= 2^56 + 2^16 (due to final carry), + // so out < 2*p + out[3] = output[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 +static void p224_felem_neg(p224_felem out, const p224_felem in) { + p224_widefelem tmp = {0}; + p224_felem_diff_128_64(tmp, in); + p224_felem_reduce(out, tmp); +} + +// Zero-check: returns 1 if input is 0, and 0 otherwise. We know that field +// elements are reduced to in < 2^225, so we only need to check three cases: 0, +// 2^224 - 2^96 + 1, and 2^225 - 2^97 + 2 +static p224_limb p224_felem_is_zero(const p224_felem in) { + p224_limb zero = in[0] | in[1] | in[2] | in[3]; + zero = (((int64_t)(zero)-1) >> 63) & 1; + + p224_limb two224m96p1 = (in[0] ^ 1) | (in[1] ^ 0x00ffff0000000000) | + (in[2] ^ 0x00ffffffffffffff) | + (in[3] ^ 0x00ffffffffffffff); + two224m96p1 = (((int64_t)(two224m96p1)-1) >> 63) & 1; + p224_limb two225m97p2 = (in[0] ^ 2) | (in[1] ^ 0x00fffe0000000000) | + (in[2] ^ 0x00ffffffffffffff) | + (in[3] ^ 0x01ffffffffffffff); + two225m97p2 = (((int64_t)(two225m97p2)-1) >> 63) & 1; + return (zero | two224m96p1 | two225m97p2); +} + +// Invert a field element +// Computation chain copied from djb's code +static void p224_felem_inv(p224_felem out, const p224_felem in) { + p224_felem ftmp, ftmp2, ftmp3, ftmp4; + p224_widefelem tmp; + + p224_felem_square(tmp, in); + p224_felem_reduce(ftmp, tmp); // 2 + p224_felem_mul(tmp, in, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^2 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^3 - 2 + p224_felem_mul(tmp, in, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^3 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^4 - 2 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^5 - 4 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^6 - 8 + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^6 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^7 - 2 + for (size_t i = 0; i < 5; ++i) { // 2^12 - 2^6 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp2, tmp); // 2^12 - 1 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^13 - 2 + for (size_t i = 0; i < 11; ++i) { // 2^24 - 2^12 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp3, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp2); + p224_felem_reduce(ftmp2, tmp); // 2^24 - 1 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^25 - 2 + for (size_t i = 0; i < 23; ++i) { // 2^48 - 2^24 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp3, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp2); + p224_felem_reduce(ftmp3, tmp); // 2^48 - 1 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp4, tmp); // 2^49 - 2 + for (size_t i = 0; i < 47; ++i) { // 2^96 - 2^48 + p224_felem_square(tmp, ftmp4); + p224_felem_reduce(ftmp4, tmp); + } + p224_felem_mul(tmp, ftmp3, ftmp4); + p224_felem_reduce(ftmp3, tmp); // 2^96 - 1 + p224_felem_square(tmp, ftmp3); + p224_felem_reduce(ftmp4, tmp); // 2^97 - 2 + for (size_t i = 0; i < 23; ++i) { // 2^120 - 2^24 + p224_felem_square(tmp, ftmp4); + p224_felem_reduce(ftmp4, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp4); + p224_felem_reduce(ftmp2, tmp); // 2^120 - 1 + for (size_t i = 0; i < 6; ++i) { // 2^126 - 2^6 + p224_felem_square(tmp, ftmp2); + p224_felem_reduce(ftmp2, tmp); + } + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^126 - 1 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); // 2^127 - 2 + p224_felem_mul(tmp, ftmp, in); + p224_felem_reduce(ftmp, tmp); // 2^127 - 1 + for (size_t i = 0; i < 97; ++i) { // 2^224 - 2^97 + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); + } + p224_felem_mul(tmp, ftmp, ftmp3); + p224_felem_reduce(out, tmp); // 2^224 - 2^96 - 1 +} + +// Copy in constant time: +// if icopy == 1, copy in to out, +// if icopy == 0, copy out to itself. +static void p224_copy_conditional(p224_felem out, const p224_felem in, + p224_limb icopy) { + // icopy is a (64-bit) 0 or 1, so copy is either all-zero or all-one + const p224_limb copy = -icopy; + for (size_t i = 0; i < 4; ++i) { + const p224_limb tmp = copy & (in[i] ^ out[i]); + out[i] ^= tmp; + } +} + +// ELLIPTIC CURVE POINT OPERATIONS +// +// Points are represented in Jacobian projective coordinates: +// (X, Y, Z) corresponds to the affine point (X/Z^2, Y/Z^3), +// or to the point at infinity if Z == 0. + +// Double an elliptic curve point: +// (X', Y', Z') = 2 * (X, Y, Z), where +// X' = (3 * (X - Z^2) * (X + Z^2))^2 - 8 * X * Y^2 +// Y' = 3 * (X - Z^2) * (X + Z^2) * (4 * X * Y^2 - X') - 8 * Y^2 +// Z' = (Y + Z)^2 - Y^2 - Z^2 = 2 * Y * Z +// 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 p224_point_double(p224_felem x_out, p224_felem y_out, + p224_felem z_out, const p224_felem x_in, + const p224_felem y_in, const p224_felem z_in) { + p224_widefelem tmp, tmp2; + p224_felem delta, gamma, beta, alpha, ftmp, ftmp2; + + p224_felem_assign(ftmp, x_in); + p224_felem_assign(ftmp2, x_in); + + // delta = z^2 + p224_felem_square(tmp, z_in); + p224_felem_reduce(delta, tmp); + + // gamma = y^2 + p224_felem_square(tmp, y_in); + p224_felem_reduce(gamma, tmp); + + // beta = x*gamma + p224_felem_mul(tmp, x_in, gamma); + p224_felem_reduce(beta, tmp); + + // alpha = 3*(x-delta)*(x+delta) + p224_felem_diff(ftmp, delta); + // ftmp[i] < 2^57 + 2^58 + 2 < 2^59 + p224_felem_sum(ftmp2, delta); + // ftmp2[i] < 2^57 + 2^57 = 2^58 + p224_felem_scalar(ftmp2, 3); + // ftmp2[i] < 3 * 2^58 < 2^60 + p224_felem_mul(tmp, ftmp, ftmp2); + // tmp[i] < 2^60 * 2^59 * 4 = 2^121 + p224_felem_reduce(alpha, tmp); + + // x' = alpha^2 - 8*beta + p224_felem_square(tmp, alpha); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + p224_felem_assign(ftmp, beta); + p224_felem_scalar(ftmp, 8); + // ftmp[i] < 8 * 2^57 = 2^60 + p224_felem_diff_128_64(tmp, ftmp); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(x_out, tmp); + + // z' = (y + z)^2 - gamma - delta + p224_felem_sum(delta, gamma); + // delta[i] < 2^57 + 2^57 = 2^58 + p224_felem_assign(ftmp, y_in); + p224_felem_sum(ftmp, z_in); + // ftmp[i] < 2^57 + 2^57 = 2^58 + p224_felem_square(tmp, ftmp); + // tmp[i] < 4 * 2^58 * 2^58 = 2^118 + p224_felem_diff_128_64(tmp, delta); + // tmp[i] < 2^118 + 2^64 + 8 < 2^119 + p224_felem_reduce(z_out, tmp); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + p224_felem_scalar(beta, 4); + // beta[i] < 4 * 2^57 = 2^59 + p224_felem_diff(beta, x_out); + // beta[i] < 2^59 + 2^58 + 2 < 2^60 + p224_felem_mul(tmp, alpha, beta); + // tmp[i] < 4 * 2^57 * 2^60 = 2^119 + p224_felem_square(tmp2, gamma); + // tmp2[i] < 4 * 2^57 * 2^57 = 2^116 + p224_widefelem_scalar(tmp2, 8); + // tmp2[i] < 8 * 2^116 = 2^119 + p224_widefelem_diff(tmp, tmp2); + // tmp[i] < 2^119 + 2^120 < 2^121 + p224_felem_reduce(y_out, tmp); +} + +// Add two elliptic curve points: +// (X_1, Y_1, Z_1) + (X_2, Y_2, Z_2) = (X_3, Y_3, Z_3), where +// X_3 = (Z_1^3 * Y_2 - Z_2^3 * Y_1)^2 - (Z_1^2 * X_2 - Z_2^2 * X_1)^3 - +// 2 * Z_2^2 * X_1 * (Z_1^2 * X_2 - Z_2^2 * X_1)^2 +// Y_3 = (Z_1^3 * Y_2 - Z_2^3 * Y_1) * (Z_2^2 * X_1 * (Z_1^2 * X_2 - Z_2^2 * +// X_1)^2 - X_3) - +// Z_2^3 * Y_1 * (Z_1^2 * X_2 - Z_2^2 * X_1)^3 +// Z_3 = (Z_1^2 * X_2 - Z_2^2 * X_1) * (Z_1 * Z_2) +// +// This runs faster if 'mixed' is set, which requires Z_2 = 1 or Z_2 = 0. + +// This function is not entirely constant-time: it 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 p224_point_add(p224_felem x3, p224_felem y3, p224_felem z3, + const p224_felem x1, const p224_felem y1, + const p224_felem z1, const int mixed, + const p224_felem x2, const p224_felem y2, + const p224_felem z2) { + p224_felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, x_out, y_out, z_out; + p224_widefelem tmp, tmp2; + p224_limb z1_is_zero, z2_is_zero, x_equal, y_equal; + + if (!mixed) { + // ftmp2 = z2^2 + p224_felem_square(tmp, z2); + p224_felem_reduce(ftmp2, tmp); + + // ftmp4 = z2^3 + p224_felem_mul(tmp, ftmp2, z2); + p224_felem_reduce(ftmp4, tmp); + + // ftmp4 = z2^3*y1 + p224_felem_mul(tmp2, ftmp4, y1); + p224_felem_reduce(ftmp4, tmp2); + + // ftmp2 = z2^2*x1 + p224_felem_mul(tmp2, ftmp2, x1); + p224_felem_reduce(ftmp2, tmp2); + } else { + // We'll assume z2 = 1 (special case z2 = 0 is handled later) + + // ftmp4 = z2^3*y1 + p224_felem_assign(ftmp4, y1); + + // ftmp2 = z2^2*x1 + p224_felem_assign(ftmp2, x1); + } + + // ftmp = z1^2 + p224_felem_square(tmp, z1); + p224_felem_reduce(ftmp, tmp); + + // ftmp3 = z1^3 + p224_felem_mul(tmp, ftmp, z1); + p224_felem_reduce(ftmp3, tmp); + + // tmp = z1^3*y2 + p224_felem_mul(tmp, ftmp3, y2); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // ftmp3 = z1^3*y2 - z2^3*y1 + p224_felem_diff_128_64(tmp, ftmp4); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(ftmp3, tmp); + + // tmp = z1^2*x2 + p224_felem_mul(tmp, ftmp, x2); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // ftmp = z1^2*x2 - z2^2*x1 + p224_felem_diff_128_64(tmp, ftmp2); + // tmp[i] < 2^116 + 2^64 + 8 < 2^117 + p224_felem_reduce(ftmp, tmp); + + // the formulae are incorrect if the points are equal + // so we check for this and do doubling if this happens + x_equal = p224_felem_is_zero(ftmp); + y_equal = p224_felem_is_zero(ftmp3); + 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) + 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; + } + + // ftmp5 = z1*z2 + if (!mixed) { + p224_felem_mul(tmp, z1, z2); + p224_felem_reduce(ftmp5, tmp); + } else { + // special case z2 = 0 is handled later + p224_felem_assign(ftmp5, z1); + } + + // z_out = (z1^2*x2 - z2^2*x1)*(z1*z2) + p224_felem_mul(tmp, ftmp, ftmp5); + p224_felem_reduce(z_out, tmp); + + // ftmp = (z1^2*x2 - z2^2*x1)^2 + p224_felem_assign(ftmp5, ftmp); + p224_felem_square(tmp, ftmp); + p224_felem_reduce(ftmp, tmp); + + // ftmp5 = (z1^2*x2 - z2^2*x1)^3 + p224_felem_mul(tmp, ftmp, ftmp5); + p224_felem_reduce(ftmp5, tmp); + + // ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 + p224_felem_mul(tmp, ftmp2, ftmp); + p224_felem_reduce(ftmp2, tmp); + + // tmp = z2^3*y1*(z1^2*x2 - z2^2*x1)^3 + p224_felem_mul(tmp, ftmp4, ftmp5); + // tmp[i] < 4 * 2^57 * 2^57 = 2^116 + + // tmp2 = (z1^3*y2 - z2^3*y1)^2 + p224_felem_square(tmp2, ftmp3); + // tmp2[i] < 4 * 2^57 * 2^57 < 2^116 + + // tmp2 = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 + p224_felem_diff_128_64(tmp2, ftmp5); + // tmp2[i] < 2^116 + 2^64 + 8 < 2^117 + + // ftmp5 = 2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2 + p224_felem_assign(ftmp5, ftmp2); + p224_felem_scalar(ftmp5, 2); + // ftmp5[i] < 2 * 2^57 = 2^58 + + /* x_out = (z1^3*y2 - z2^3*y1)^2 - (z1^2*x2 - z2^2*x1)^3 - + 2*z2^2*x1*(z1^2*x2 - z2^2*x1)^2 */ + p224_felem_diff_128_64(tmp2, ftmp5); + // tmp2[i] < 2^117 + 2^64 + 8 < 2^118 + p224_felem_reduce(x_out, tmp2); + + // ftmp2 = z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out + p224_felem_diff(ftmp2, x_out); + // ftmp2[i] < 2^57 + 2^58 + 2 < 2^59 + + // tmp2 = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out) + p224_felem_mul(tmp2, ftmp3, ftmp2); + // tmp2[i] < 4 * 2^57 * 2^59 = 2^118 + + /* y_out = (z1^3*y2 - z2^3*y1)*(z2^2*x1*(z1^2*x2 - z2^2*x1)^2 - x_out) - + z2^3*y1*(z1^2*x2 - z2^2*x1)^3 */ + p224_widefelem_diff(tmp2, tmp); + // tmp2[i] < 2^118 + 2^120 < 2^121 + p224_felem_reduce(y_out, tmp2); + + // the result (x_out, y_out, z_out) is incorrect if one of the inputs is + // the point at infinity, so we need to check for this separately + + // if point 1 is at infinity, copy point 2 to output, and vice versa + p224_copy_conditional(x_out, x2, z1_is_zero); + p224_copy_conditional(x_out, x1, z2_is_zero); + p224_copy_conditional(y_out, y2, z1_is_zero); + p224_copy_conditional(y_out, y1, z2_is_zero); + p224_copy_conditional(z_out, z2, z1_is_zero); + p224_copy_conditional(z_out, z1, z2_is_zero); + p224_felem_assign(x3, x_out); + p224_felem_assign(y3, y_out); + p224_felem_assign(z3, z_out); +} + +// p224_select_point selects the |idx|th point from a precomputation table and +// copies it to out. +static void p224_select_point(const uint64_t idx, size_t size, + const p224_felem pre_comp[/*size*/][3], + p224_felem out[3]) { + p224_limb *outlimbs = &out[0][0]; + OPENSSL_memset(outlimbs, 0, 3 * sizeof(p224_felem)); + + for (size_t i = 0; i < size; i++) { + const p224_limb *inlimbs = &pre_comp[i][0][0]; + uint64_t mask = i ^ idx; + mask |= mask >> 4; + mask |= mask >> 2; + mask |= mask >> 1; + mask &= 1; + mask--; + for (size_t j = 0; j < 4 * 3; j++) { + outlimbs[j] |= inlimbs[j] & mask; + } + } +} + +// p224_get_bit returns the |i|th bit in |in| +static char p224_get_bit(const p224_felem_bytearray in, size_t i) { + if (i >= 224) { + return 0; + } + return (in[i >> 3] >> (i & 7)) & 1; +} + +// 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; + } + + 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); + + 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]); + } + } +} + +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); + + // Set nq to the point at infinity. + p224_felem nq[3], tmp[4]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + + 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]); + } + + // 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, (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]); + } else { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; + } + } + } + + // 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_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)); + + 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]); + } + + // 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 (!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; + } + + // 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]); + } + + // 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_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]; + 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]); + } + + // 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); + + 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 { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; + } + } + } + + // 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) { + out->group_init = ec_GFp_simple_group_init; + out->group_finish = ec_GFp_simple_group_finish; + out->group_set_curve = ec_GFp_simple_group_set_curve; + out->point_get_affine_coordinates = + ec_GFp_nistp224_point_get_affine_coordinates; + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h new file mode 100644 index 0000000..8246b11 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back new file mode 100644 index 0000000..8246b11 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c new file mode 100644 index 0000000..977b08c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back new file mode 100644 index 0000000..b4af544 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h new file mode 100644 index 0000000..f349252 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back new file mode 100644 index 0000000..5deb81a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c new file mode 100644 index 0000000..2caf2f0 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c.grpc_back new file mode 100644 index 0000000..82f2a50 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c new file mode 100644 index 0000000..c9110d7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c.grpc_back new file mode 100644 index 0000000..c418c4e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c new file mode 100644 index 0000000..ab043f4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c.grpc_back new file mode 100644 index 0000000..4ed6c48 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c new file mode 100644 index 0000000..47e6482 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c.grpc_back new file mode 100644 index 0000000..4f39f18 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c new file mode 100644 index 0000000..a0de817 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c.grpc_back new file mode 100644 index 0000000..fd1b480 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c new file mode 100644 index 0000000..c7f3408 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c.grpc_back new file mode 100644 index 0000000..a7b2f08 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c new file mode 100644 index 0000000..92ebade --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back new file mode 100644 index 0000000..38771d5 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c new file mode 100644 index 0000000..2a66a1f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c.grpc_back new file mode 100644 index 0000000..2a66a1f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c new file mode 100644 index 0000000..7466f94 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c @@ -0,0 +1,228 @@ +/* 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 "../../internal.h" + + +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) { + HMAC_CTX ctx; + HMAC_CTX_init(&ctx); + if (!HMAC_Init_ex(&ctx, key, key_len, evp_md, NULL) || + !HMAC_Update(&ctx, data, data_len) || + !HMAC_Final(&ctx, out, out_len)) { + out = NULL; + } + + HMAC_CTX_cleanup(&ctx); + return out; +} + +void HMAC_CTX_init(HMAC_CTX *ctx) { + ctx->md = NULL; + EVP_MD_CTX_init(&ctx->i_ctx); + EVP_MD_CTX_init(&ctx->o_ctx); + EVP_MD_CTX_init(&ctx->md_ctx); +} + +HMAC_CTX *HMAC_CTX_new(void) { + HMAC_CTX *ctx = OPENSSL_malloc(sizeof(HMAC_CTX)); + if (ctx != NULL) { + HMAC_CTX_init(ctx); + } + return ctx; +} + +void HMAC_CTX_cleanup(HMAC_CTX *ctx) { + EVP_MD_CTX_cleanup(&ctx->i_ctx); + EVP_MD_CTX_cleanup(&ctx->o_ctx); + EVP_MD_CTX_cleanup(&ctx->md_ctx); + OPENSSL_cleanse(ctx, sizeof(HMAC_CTX)); +} + +void HMAC_CTX_free(HMAC_CTX *ctx) { + if (ctx == NULL) { + return; + } + + HMAC_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_MD *md, ENGINE *impl) { + if (md == NULL) { + md = ctx->md; + } + + // If either |key| is non-NULL or |md| has changed, initialize with a new key + // rather than rewinding the previous one. + // + // TODO(davidben,eroman): Passing the previous |md| with a NULL |key| is + // ambiguous between using the empty key and reusing the previous key. There + // exist callers which intend the latter, but the former is an awkward edge + // case. Fix to API to avoid this. + if (md != ctx->md || key != NULL) { + uint8_t pad[EVP_MAX_MD_BLOCK_SIZE]; + uint8_t key_block[EVP_MAX_MD_BLOCK_SIZE]; + unsigned key_block_len; + + size_t block_size = EVP_MD_block_size(md); + assert(block_size <= sizeof(key_block)); + if (block_size < key_len) { + // Long keys are hashed. + if (!EVP_DigestInit_ex(&ctx->md_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->md_ctx, key, key_len) || + !EVP_DigestFinal_ex(&ctx->md_ctx, key_block, &key_block_len)) { + return 0; + } + } else { + assert(key_len <= sizeof(key_block)); + OPENSSL_memcpy(key_block, key, key_len); + key_block_len = (unsigned)key_len; + } + // Keys are then padded with zeros. + if (key_block_len != EVP_MAX_MD_BLOCK_SIZE) { + OPENSSL_memset(&key_block[key_block_len], 0, sizeof(key_block) - key_block_len); + } + + for (size_t i = 0; i < EVP_MAX_MD_BLOCK_SIZE; i++) { + pad[i] = 0x36 ^ key_block[i]; + } + if (!EVP_DigestInit_ex(&ctx->i_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->i_ctx, pad, EVP_MD_block_size(md))) { + return 0; + } + + for (size_t i = 0; i < EVP_MAX_MD_BLOCK_SIZE; i++) { + pad[i] = 0x5c ^ key_block[i]; + } + if (!EVP_DigestInit_ex(&ctx->o_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->o_ctx, pad, EVP_MD_block_size(md))) { + return 0; + } + + ctx->md = md; + } + + if (!EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->i_ctx)) { + return 0; + } + + return 1; +} + +int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, size_t data_len) { + return EVP_DigestUpdate(&ctx->md_ctx, data, data_len); +} + +int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, unsigned int *out_len) { + unsigned int i; + uint8_t buf[EVP_MAX_MD_SIZE]; + + // TODO(davidben): The only thing that can officially fail here is + // |EVP_MD_CTX_copy_ex|, but even that should be impossible in this case. + if (!EVP_DigestFinal_ex(&ctx->md_ctx, buf, &i) || + !EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->o_ctx) || + !EVP_DigestUpdate(&ctx->md_ctx, buf, i) || + !EVP_DigestFinal_ex(&ctx->md_ctx, out, out_len)) { + *out_len = 0; + return 0; + } + + return 1; +} + +size_t HMAC_size(const HMAC_CTX *ctx) { + return EVP_MD_size(ctx->md); +} + +int HMAC_CTX_copy_ex(HMAC_CTX *dest, const HMAC_CTX *src) { + if (!EVP_MD_CTX_copy_ex(&dest->i_ctx, &src->i_ctx) || + !EVP_MD_CTX_copy_ex(&dest->o_ctx, &src->o_ctx) || + !EVP_MD_CTX_copy_ex(&dest->md_ctx, &src->md_ctx)) { + return 0; + } + + dest->md = src->md; + return 1; +} + +void HMAC_CTX_reset(HMAC_CTX *ctx) { + HMAC_CTX_cleanup(ctx); + HMAC_CTX_init(ctx); +} + +int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md) { + if (key && md) { + HMAC_CTX_init(ctx); + } + return HMAC_Init_ex(ctx, key, key_len, md, NULL); +} + +int HMAC_CTX_copy(HMAC_CTX *dest, const HMAC_CTX *src) { + HMAC_CTX_init(dest); + return HMAC_CTX_copy_ex(dest, src); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c.grpc_back new file mode 100644 index 0000000..fb57bf2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c.grpc_back @@ -0,0 +1,228 @@ +/* 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 "../../internal.h" + + +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) { + HMAC_CTX ctx; + HMAC_CTX_init(&ctx); + if (!HMAC_Init_ex(&ctx, key, key_len, evp_md, NULL) || + !HMAC_Update(&ctx, data, data_len) || + !HMAC_Final(&ctx, out, out_len)) { + out = NULL; + } + + HMAC_CTX_cleanup(&ctx); + return out; +} + +void HMAC_CTX_init(HMAC_CTX *ctx) { + ctx->md = NULL; + EVP_MD_CTX_init(&ctx->i_ctx); + EVP_MD_CTX_init(&ctx->o_ctx); + EVP_MD_CTX_init(&ctx->md_ctx); +} + +HMAC_CTX *HMAC_CTX_new(void) { + HMAC_CTX *ctx = OPENSSL_malloc(sizeof(HMAC_CTX)); + if (ctx != NULL) { + HMAC_CTX_init(ctx); + } + return ctx; +} + +void HMAC_CTX_cleanup(HMAC_CTX *ctx) { + EVP_MD_CTX_cleanup(&ctx->i_ctx); + EVP_MD_CTX_cleanup(&ctx->o_ctx); + EVP_MD_CTX_cleanup(&ctx->md_ctx); + OPENSSL_cleanse(ctx, sizeof(HMAC_CTX)); +} + +void HMAC_CTX_free(HMAC_CTX *ctx) { + if (ctx == NULL) { + return; + } + + HMAC_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_MD *md, ENGINE *impl) { + if (md == NULL) { + md = ctx->md; + } + + // If either |key| is non-NULL or |md| has changed, initialize with a new key + // rather than rewinding the previous one. + // + // TODO(davidben,eroman): Passing the previous |md| with a NULL |key| is + // ambiguous between using the empty key and reusing the previous key. There + // exist callers which intend the latter, but the former is an awkward edge + // case. Fix to API to avoid this. + if (md != ctx->md || key != NULL) { + uint8_t pad[EVP_MAX_MD_BLOCK_SIZE]; + uint8_t key_block[EVP_MAX_MD_BLOCK_SIZE]; + unsigned key_block_len; + + size_t block_size = EVP_MD_block_size(md); + assert(block_size <= sizeof(key_block)); + if (block_size < key_len) { + // Long keys are hashed. + if (!EVP_DigestInit_ex(&ctx->md_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->md_ctx, key, key_len) || + !EVP_DigestFinal_ex(&ctx->md_ctx, key_block, &key_block_len)) { + return 0; + } + } else { + assert(key_len <= sizeof(key_block)); + OPENSSL_memcpy(key_block, key, key_len); + key_block_len = (unsigned)key_len; + } + // Keys are then padded with zeros. + if (key_block_len != EVP_MAX_MD_BLOCK_SIZE) { + OPENSSL_memset(&key_block[key_block_len], 0, sizeof(key_block) - key_block_len); + } + + for (size_t i = 0; i < EVP_MAX_MD_BLOCK_SIZE; i++) { + pad[i] = 0x36 ^ key_block[i]; + } + if (!EVP_DigestInit_ex(&ctx->i_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->i_ctx, pad, EVP_MD_block_size(md))) { + return 0; + } + + for (size_t i = 0; i < EVP_MAX_MD_BLOCK_SIZE; i++) { + pad[i] = 0x5c ^ key_block[i]; + } + if (!EVP_DigestInit_ex(&ctx->o_ctx, md, impl) || + !EVP_DigestUpdate(&ctx->o_ctx, pad, EVP_MD_block_size(md))) { + return 0; + } + + ctx->md = md; + } + + if (!EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->i_ctx)) { + return 0; + } + + return 1; +} + +int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, size_t data_len) { + return EVP_DigestUpdate(&ctx->md_ctx, data, data_len); +} + +int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, unsigned int *out_len) { + unsigned int i; + uint8_t buf[EVP_MAX_MD_SIZE]; + + // TODO(davidben): The only thing that can officially fail here is + // |EVP_MD_CTX_copy_ex|, but even that should be impossible in this case. + if (!EVP_DigestFinal_ex(&ctx->md_ctx, buf, &i) || + !EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->o_ctx) || + !EVP_DigestUpdate(&ctx->md_ctx, buf, i) || + !EVP_DigestFinal_ex(&ctx->md_ctx, out, out_len)) { + *out_len = 0; + return 0; + } + + return 1; +} + +size_t HMAC_size(const HMAC_CTX *ctx) { + return EVP_MD_size(ctx->md); +} + +int HMAC_CTX_copy_ex(HMAC_CTX *dest, const HMAC_CTX *src) { + if (!EVP_MD_CTX_copy_ex(&dest->i_ctx, &src->i_ctx) || + !EVP_MD_CTX_copy_ex(&dest->o_ctx, &src->o_ctx) || + !EVP_MD_CTX_copy_ex(&dest->md_ctx, &src->md_ctx)) { + return 0; + } + + dest->md = src->md; + return 1; +} + +void HMAC_CTX_reset(HMAC_CTX *ctx) { + HMAC_CTX_cleanup(ctx); + HMAC_CTX_init(ctx); +} + +int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md) { + if (key && md) { + HMAC_CTX_init(ctx); + } + return HMAC_Init_ex(ctx, key, key_len, md, NULL); +} + +int HMAC_CTX_copy(HMAC_CTX *dest, const HMAC_CTX *src) { + HMAC_CTX_init(dest); + return HMAC_CTX_copy_ex(dest, src); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c new file mode 100644 index 0000000..aae87c5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c @@ -0,0 +1,29 @@ +/* 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 + + +// This file exists in order to give the fipsmodule target, in non-FIPS mode, +// something to compile. + +int FIPS_mode(void) { +#if defined(BORINGSSL_FIPS) && !defined(OPENSSL_ASAN) + return 1; +#else + return 0; +#endif +} + +int FIPS_mode_set(int on) { return on == FIPS_mode(); } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back new file mode 100644 index 0000000..2f8e408 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back @@ -0,0 +1,29 @@ +/* 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 + + +// This file exists in order to give the fipsmodule target, in non-FIPS mode, +// something to compile. + +int FIPS_mode(void) { +#if defined(BORINGSSL_FIPS) && !defined(OPENSSL_ASAN) + return 1; +#else + return 0; +#endif +} + +int FIPS_mode_set(int on) { return on == FIPS_mode(); } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c new file mode 100644 index 0000000..6bff52f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c @@ -0,0 +1,256 @@ +/* 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 *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); + MD4_Final(out, &ctx); + + return out; +} + +// Implemented from RFC1186 The MD4 Message-Digest Algorithm. + +int MD4_Init(MD4_CTX *md4) { + OPENSSL_memset(md4, 0, sizeof(MD4_CTX)); + md4->h[0] = 0x67452301UL; + md4->h[1] = 0xefcdab89UL; + md4->h[2] = 0x98badcfeUL; + md4->h[3] = 0x10325476UL; + return 1; +} + +void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num); + +#define DATA_ORDER_IS_LITTLE_ENDIAN + +#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 +#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 md4_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)) | ((b) & (d)) | ((c) & (d))) +#define H(b, c, d) ((b) ^ (c) ^ (d)) + +#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); \ + } while (0) + +#define R1(a, b, c, d, k, s, t) \ + do { \ + (a) += ((k) + (t) + G((b), (c), (d))); \ + (a) = ROTATE(a, s); \ + } while (0) + +#define R2(a, b, c, d, k, s, t) \ + do { \ + (a) += ((k) + (t) + H((b), (c), (d))); \ + (a) = ROTATE(a, s); \ + } while (0) + +void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { + uint32_t A, B, C, D, l; + uint32_t X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + + for (; num--;) { + HOST_c2l(data, l); + X0 = l; + HOST_c2l(data, l); + X1 = l; + // Round 0 + R0(A, B, C, D, X0, 3, 0); + HOST_c2l(data, l); + X2 = l; + R0(D, A, B, C, X1, 7, 0); + HOST_c2l(data, l); + X3 = l; + R0(C, D, A, B, X2, 11, 0); + HOST_c2l(data, l); + X4 = l; + R0(B, C, D, A, X3, 19, 0); + HOST_c2l(data, l); + X5 = l; + R0(A, B, C, D, X4, 3, 0); + HOST_c2l(data, l); + X6 = l; + R0(D, A, B, C, X5, 7, 0); + HOST_c2l(data, l); + X7 = l; + R0(C, D, A, B, X6, 11, 0); + HOST_c2l(data, l); + X8 = l; + R0(B, C, D, A, X7, 19, 0); + HOST_c2l(data, l); + X9 = l; + R0(A, B, C, D, X8, 3, 0); + HOST_c2l(data, l); + X10 = l; + R0(D, A, B, C, X9, 7, 0); + HOST_c2l(data, l); + X11 = l; + R0(C, D, A, B, X10, 11, 0); + HOST_c2l(data, l); + X12 = l; + R0(B, C, D, A, X11, 19, 0); + HOST_c2l(data, l); + X13 = l; + R0(A, B, C, D, X12, 3, 0); + HOST_c2l(data, l); + X14 = l; + R0(D, A, B, C, X13, 7, 0); + HOST_c2l(data, l); + X15 = l; + R0(C, D, A, B, X14, 11, 0); + R0(B, C, D, A, X15, 19, 0); + // Round 1 + R1(A, B, C, D, X0, 3, 0x5A827999L); + R1(D, A, B, C, X4, 5, 0x5A827999L); + R1(C, D, A, B, X8, 9, 0x5A827999L); + R1(B, C, D, A, X12, 13, 0x5A827999L); + R1(A, B, C, D, X1, 3, 0x5A827999L); + R1(D, A, B, C, X5, 5, 0x5A827999L); + R1(C, D, A, B, X9, 9, 0x5A827999L); + R1(B, C, D, A, X13, 13, 0x5A827999L); + R1(A, B, C, D, X2, 3, 0x5A827999L); + R1(D, A, B, C, X6, 5, 0x5A827999L); + R1(C, D, A, B, X10, 9, 0x5A827999L); + R1(B, C, D, A, X14, 13, 0x5A827999L); + R1(A, B, C, D, X3, 3, 0x5A827999L); + R1(D, A, B, C, X7, 5, 0x5A827999L); + R1(C, D, A, B, X11, 9, 0x5A827999L); + R1(B, C, D, A, X15, 13, 0x5A827999L); + // Round 2 + R2(A, B, C, D, X0, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X8, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X4, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X12, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X2, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X10, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X6, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X14, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X1, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X9, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X5, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X13, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X3, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X11, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X7, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X15, 15, 0x6ED9EBA1L); + + A = state[0] += A; + B = state[1] += B; + C = state[2] += C; + D = state[3] += D; + } +} + +#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 +#undef HASH_MAKE_STRING +#undef HASH_BLOCK_DATA_ORDER +#undef F +#undef G +#undef H +#undef ROTATE +#undef R0 +#undef R1 +#undef R2 +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back new file mode 100644 index 0000000..cc2a631 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back @@ -0,0 +1,256 @@ +/* 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 *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); + MD4_Final(out, &ctx); + + return out; +} + +// Implemented from RFC1186 The MD4 Message-Digest Algorithm. + +int MD4_Init(MD4_CTX *md4) { + OPENSSL_memset(md4, 0, sizeof(MD4_CTX)); + md4->h[0] = 0x67452301UL; + md4->h[1] = 0xefcdab89UL; + md4->h[2] = 0x98badcfeUL; + md4->h[3] = 0x10325476UL; + return 1; +} + +void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num); + +#define DATA_ORDER_IS_LITTLE_ENDIAN + +#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 +#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 md4_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)) | ((b) & (d)) | ((c) & (d))) +#define H(b, c, d) ((b) ^ (c) ^ (d)) + +#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); \ + } while (0) + +#define R1(a, b, c, d, k, s, t) \ + do { \ + (a) += ((k) + (t) + G((b), (c), (d))); \ + (a) = ROTATE(a, s); \ + } while (0) + +#define R2(a, b, c, d, k, s, t) \ + do { \ + (a) += ((k) + (t) + H((b), (c), (d))); \ + (a) = ROTATE(a, s); \ + } while (0) + +void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { + uint32_t A, B, C, D, l; + uint32_t X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + + for (; num--;) { + HOST_c2l(data, l); + X0 = l; + HOST_c2l(data, l); + X1 = l; + // Round 0 + R0(A, B, C, D, X0, 3, 0); + HOST_c2l(data, l); + X2 = l; + R0(D, A, B, C, X1, 7, 0); + HOST_c2l(data, l); + X3 = l; + R0(C, D, A, B, X2, 11, 0); + HOST_c2l(data, l); + X4 = l; + R0(B, C, D, A, X3, 19, 0); + HOST_c2l(data, l); + X5 = l; + R0(A, B, C, D, X4, 3, 0); + HOST_c2l(data, l); + X6 = l; + R0(D, A, B, C, X5, 7, 0); + HOST_c2l(data, l); + X7 = l; + R0(C, D, A, B, X6, 11, 0); + HOST_c2l(data, l); + X8 = l; + R0(B, C, D, A, X7, 19, 0); + HOST_c2l(data, l); + X9 = l; + R0(A, B, C, D, X8, 3, 0); + HOST_c2l(data, l); + X10 = l; + R0(D, A, B, C, X9, 7, 0); + HOST_c2l(data, l); + X11 = l; + R0(C, D, A, B, X10, 11, 0); + HOST_c2l(data, l); + X12 = l; + R0(B, C, D, A, X11, 19, 0); + HOST_c2l(data, l); + X13 = l; + R0(A, B, C, D, X12, 3, 0); + HOST_c2l(data, l); + X14 = l; + R0(D, A, B, C, X13, 7, 0); + HOST_c2l(data, l); + X15 = l; + R0(C, D, A, B, X14, 11, 0); + R0(B, C, D, A, X15, 19, 0); + // Round 1 + R1(A, B, C, D, X0, 3, 0x5A827999L); + R1(D, A, B, C, X4, 5, 0x5A827999L); + R1(C, D, A, B, X8, 9, 0x5A827999L); + R1(B, C, D, A, X12, 13, 0x5A827999L); + R1(A, B, C, D, X1, 3, 0x5A827999L); + R1(D, A, B, C, X5, 5, 0x5A827999L); + R1(C, D, A, B, X9, 9, 0x5A827999L); + R1(B, C, D, A, X13, 13, 0x5A827999L); + R1(A, B, C, D, X2, 3, 0x5A827999L); + R1(D, A, B, C, X6, 5, 0x5A827999L); + R1(C, D, A, B, X10, 9, 0x5A827999L); + R1(B, C, D, A, X14, 13, 0x5A827999L); + R1(A, B, C, D, X3, 3, 0x5A827999L); + R1(D, A, B, C, X7, 5, 0x5A827999L); + R1(C, D, A, B, X11, 9, 0x5A827999L); + R1(B, C, D, A, X15, 13, 0x5A827999L); + // Round 2 + R2(A, B, C, D, X0, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X8, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X4, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X12, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X2, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X10, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X6, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X14, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X1, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X9, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X5, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X13, 15, 0x6ED9EBA1L); + R2(A, B, C, D, X3, 3, 0x6ED9EBA1L); + R2(D, A, B, C, X11, 9, 0x6ED9EBA1L); + R2(C, D, A, B, X7, 11, 0x6ED9EBA1L); + R2(B, C, D, A, X15, 15, 0x6ED9EBA1L); + + A = state[0] += A; + B = state[1] += B; + C = state[2] += C; + D = state[3] += D; + } +} + +#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 +#undef HASH_MAKE_STRING +#undef HASH_BLOCK_DATA_ORDER +#undef F +#undef G +#undef H +#undef ROTATE +#undef R0 +#undef R1 +#undef R2 +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h new file mode 100644 index 0000000..d5a3d4a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h.grpc_back new file mode 100644 index 0000000..9ee9f13 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c new file mode 100644 index 0000000..e4ca5f3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c @@ -0,0 +1,301 @@ +/* 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" + + +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); + 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(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 + + +#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 +#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_ASM +#ifdef X +#undef X +#endif +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; +#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_DIGEST_LENGTH +#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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back new file mode 100644 index 0000000..a48d704 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back @@ -0,0 +1,301 @@ +/* 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" + + +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); + 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(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 + + +#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 +#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_ASM +#ifdef X +#undef X +#endif +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; +#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_DIGEST_LENGTH +#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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c new file mode 100644 index 0000000..504d319 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c.grpc_back new file mode 100644 index 0000000..3f1d777 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c new file mode 100644 index 0000000..497e5e0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c @@ -0,0 +1,202 @@ +/* ==================================================================== + * 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" + + +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 AES_KEY *key, uint8_t ivec[16], unsigned *num, + int enc, block128_f block) { + assert(in && out && key && ivec && num); + + unsigned n = *num; + + if (enc) { + while (n && len) { + *(out++) = ivec[n] ^= *(in++); + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t tmp = load_word_le(ivec + n) ^ load_word_le(in + n); + store_word_le(ivec + n, tmp); + store_word_le(out + n, tmp); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + out[n] = ivec[n] ^= in[n]; + ++n; + } + } + *num = n; + return; + } else { + while (n && len) { + uint8_t c; + *(out++) = ivec[n] ^ (c = *(in++)); + ivec[n] = c; + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t t = load_word_le(in + n); + store_word_le(out + n, load_word_le(ivec + n) ^ t); + store_word_le(ivec + n, t); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + uint8_t c; + out[n] = ivec[n] ^ (c = in[n]); + ivec[n] = c; + ++n; + } + } + *num = n; + return; + } +} + + +/* 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 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 + byte off the end */ + + if (nbits <= 0 || nbits > 128) { + return; + } + + // fill in the first half of the new IV with the current IV + OPENSSL_memcpy(ovec, ivec, 16); + // construct the new IV + (*block)(ivec, ivec, key); + num = (nbits + 7) / 8; + if (enc) { + // encrypt the input + for (n = 0; n < num; ++n) { + out[n] = (ovec[16 + n] = in[n] ^ ivec[n]); + } + } else { + // decrypt the input + for (n = 0; n < num; ++n) { + out[n] = (ovec[16 + n] = in[n]) ^ ivec[n]; + } + } + // shift ovec left... + rem = nbits % 8; + num = nbits / 8; + if (rem == 0) { + OPENSSL_memcpy(ivec, ovec + num, 16); + } else { + for (n = 0; n < 16; ++n) { + ivec[n] = ovec[n + num] << rem | ovec[n + num + 1] >> (8 - rem); + } + } + + // it is not necessary to cleanse ovec, since the IV is not secret +} + +// 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 AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block) { + size_t n; + uint8_t c[1], d[1]; + + assert(in && out && key && ivec && num); + assert(*num == 0); + + for (n = 0; n < bits; ++n) { + c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0; + cfbr_encrypt_block(c, d, 1, key, ivec, enc, block); + out[n / 8] = (out[n / 8] & ~(1 << (unsigned int)(7 - n % 8))) | + ((d[0] & 0x80) >> (unsigned int)(n % 8)); + } +} + +void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char ivec[16], unsigned *num, int enc, + block128_f block) { + size_t n; + + assert(in && out && key && ivec && num); + assert(*num == 0); + + for (n = 0; n < length; ++n) { + cfbr_encrypt_block(&in[n], &out[n], 8, key, ivec, enc, block); + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back new file mode 100644 index 0000000..8ca9004 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back @@ -0,0 +1,202 @@ +/* ==================================================================== + * 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" + + +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 AES_KEY *key, uint8_t ivec[16], unsigned *num, + int enc, block128_f block) { + assert(in && out && key && ivec && num); + + unsigned n = *num; + + if (enc) { + while (n && len) { + *(out++) = ivec[n] ^= *(in++); + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t tmp = load_word_le(ivec + n) ^ load_word_le(in + n); + store_word_le(ivec + n, tmp); + store_word_le(out + n, tmp); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + out[n] = ivec[n] ^= in[n]; + ++n; + } + } + *num = n; + return; + } else { + while (n && len) { + uint8_t c; + *(out++) = ivec[n] ^ (c = *(in++)); + ivec[n] = c; + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t t = load_word_le(in + n); + store_word_le(out + n, load_word_le(ivec + n) ^ t); + store_word_le(ivec + n, t); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + uint8_t c; + out[n] = ivec[n] ^ (c = in[n]); + ivec[n] = c; + ++n; + } + } + *num = n; + return; + } +} + + +/* 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 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 + byte off the end */ + + if (nbits <= 0 || nbits > 128) { + return; + } + + // fill in the first half of the new IV with the current IV + OPENSSL_memcpy(ovec, ivec, 16); + // construct the new IV + (*block)(ivec, ivec, key); + num = (nbits + 7) / 8; + if (enc) { + // encrypt the input + for (n = 0; n < num; ++n) { + out[n] = (ovec[16 + n] = in[n] ^ ivec[n]); + } + } else { + // decrypt the input + for (n = 0; n < num; ++n) { + out[n] = (ovec[16 + n] = in[n]) ^ ivec[n]; + } + } + // shift ovec left... + rem = nbits % 8; + num = nbits / 8; + if (rem == 0) { + OPENSSL_memcpy(ivec, ovec + num, 16); + } else { + for (n = 0; n < 16; ++n) { + ivec[n] = ovec[n + num] << rem | ovec[n + num + 1] >> (8 - rem); + } + } + + // it is not necessary to cleanse ovec, since the IV is not secret +} + +// 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 AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block) { + size_t n; + uint8_t c[1], d[1]; + + assert(in && out && key && ivec && num); + assert(*num == 0); + + for (n = 0; n < bits; ++n) { + c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0; + cfbr_encrypt_block(c, d, 1, key, ivec, enc, block); + out[n / 8] = (out[n / 8] & ~(1 << (unsigned int)(7 - n % 8))) | + ((d[0] & 0x80) >> (unsigned int)(n % 8)); + } +} + +void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char ivec[16], unsigned *num, int enc, + block128_f block) { + size_t n; + + assert(in && out && key && ivec && num); + assert(*num == 0); + + for (n = 0; n < length; ++n) { + cfbr_encrypt_block(&in[n], &out[n], 8, key, ivec, enc, block); + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c new file mode 100644 index 0000000..ebbfad4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c @@ -0,0 +1,200 @@ +/* ==================================================================== + * 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" + + +// NOTE: the IV/counter CTR mode is big-endian. The code itself +// is endian-neutral. + +// increment counter (128-bit int) by 1 +static void ctr128_inc(uint8_t *counter) { + uint32_t n = 16, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (uint8_t) c; + c >>= 8; + } while (n); +} + +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 +// contained in *num, and the encrypted counter is kept in ecount_buf. Both +// *num and ecount_buf must be initialised with zeros before the first call to +// CRYPTO_ctr128_encrypt(). +// +// This algorithm assumes that the counter is in the x lower bits of the IV +// (ivec), and that the application has full control over overflow and the rest +// 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 AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned int *num, + block128_f block) { + unsigned int n; + + assert(key && ecount_buf && num); + assert(len == 0 || (in && out)); + assert(*num < 16); + + n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ecount_buf[n]; + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ecount_buf, key); + ctr128_inc(ivec); + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, + load_word_le(in + n) ^ load_word_le(ecount_buf + n)); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ecount_buf, key); + ctr128_inc(ivec); + while (len--) { + out[n] = in[n] ^ ecount_buf[n]; + ++n; + } + } + *num = n; +} + +// increment upper 96 bits of 128-bit counter by 1 +static void ctr96_inc(uint8_t *counter) { + uint32_t n = 12, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (uint8_t) c; + c >>= 8; + } while (n); +} + +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); + assert(len == 0 || (in && out)); + assert(*num < 16); + + n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ecount_buf[n]; + --len; + n = (n + 1) % 16; + } + + ctr32 = GETU32(ivec + 12); + while (len >= 16) { + size_t blocks = len / 16; + // 1<<28 is just a not-so-small yet not-so-large number... + // Below condition is practically never met, but it has to + // be checked for code correctness. + if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28)) { + blocks = (1U << 28); + } + // As (*func) operates on 32-bit counter, caller + // has to handle overflow. 'if' below detects the + // overflow, which is then handled by limiting the + // amount of blocks to the exact overflow point... + ctr32 += (uint32_t)blocks; + if (ctr32 < blocks) { + blocks -= ctr32; + ctr32 = 0; + } + (*func)(in, out, blocks, key, ivec); + // (*func) does not update ivec, caller does: + PUTU32(ivec + 12, ctr32); + // ... overflow was detected, propogate carry. + if (ctr32 == 0) { + ctr96_inc(ivec); + } + blocks *= 16; + len -= blocks; + out += blocks; + in += blocks; + } + if (len) { + OPENSSL_memset(ecount_buf, 0, 16); + (*func)(ecount_buf, ecount_buf, 1, key, ivec); + ++ctr32; + PUTU32(ivec + 12, ctr32); + if (ctr32 == 0) { + ctr96_inc(ivec); + } + while (len--) { + out[n] = in[n] ^ ecount_buf[n]; + ++n; + } + } + + *num = n; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back new file mode 100644 index 0000000..8b0e059 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back @@ -0,0 +1,200 @@ +/* ==================================================================== + * 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" + + +// NOTE: the IV/counter CTR mode is big-endian. The code itself +// is endian-neutral. + +// increment counter (128-bit int) by 1 +static void ctr128_inc(uint8_t *counter) { + uint32_t n = 16, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (uint8_t) c; + c >>= 8; + } while (n); +} + +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 +// contained in *num, and the encrypted counter is kept in ecount_buf. Both +// *num and ecount_buf must be initialised with zeros before the first call to +// CRYPTO_ctr128_encrypt(). +// +// This algorithm assumes that the counter is in the x lower bits of the IV +// (ivec), and that the application has full control over overflow and the rest +// 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 AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned int *num, + block128_f block) { + unsigned int n; + + assert(key && ecount_buf && num); + assert(len == 0 || (in && out)); + assert(*num < 16); + + n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ecount_buf[n]; + --len; + n = (n + 1) % 16; + } + while (len >= 16) { + (*block)(ivec, ecount_buf, key); + ctr128_inc(ivec); + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, + load_word_le(in + n) ^ load_word_le(ecount_buf + n)); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ecount_buf, key); + ctr128_inc(ivec); + while (len--) { + out[n] = in[n] ^ ecount_buf[n]; + ++n; + } + } + *num = n; +} + +// increment upper 96 bits of 128-bit counter by 1 +static void ctr96_inc(uint8_t *counter) { + uint32_t n = 12, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (uint8_t) c; + c >>= 8; + } while (n); +} + +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); + assert(len == 0 || (in && out)); + assert(*num < 16); + + n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ecount_buf[n]; + --len; + n = (n + 1) % 16; + } + + ctr32 = GETU32(ivec + 12); + while (len >= 16) { + size_t blocks = len / 16; + // 1<<28 is just a not-so-small yet not-so-large number... + // Below condition is practically never met, but it has to + // be checked for code correctness. + if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28)) { + blocks = (1U << 28); + } + // As (*func) operates on 32-bit counter, caller + // has to handle overflow. 'if' below detects the + // overflow, which is then handled by limiting the + // amount of blocks to the exact overflow point... + ctr32 += (uint32_t)blocks; + if (ctr32 < blocks) { + blocks -= ctr32; + ctr32 = 0; + } + (*func)(in, out, blocks, key, ivec); + // (*func) does not update ivec, caller does: + PUTU32(ivec + 12, ctr32); + // ... overflow was detected, propogate carry. + if (ctr32 == 0) { + ctr96_inc(ivec); + } + blocks *= 16; + len -= blocks; + out += blocks; + in += blocks; + } + if (len) { + OPENSSL_memset(ecount_buf, 0, 16); + (*func)(ecount_buf, ecount_buf, 1, key, ivec); + ++ctr32; + PUTU32(ivec + 12, ctr32); + if (ctr32 == 0) { + ctr96_inc(ivec); + } + while (len--) { + out[n] = in[n] ^ ecount_buf[n]; + ++n; + } + } + + *num = n; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c new file mode 100644 index 0000000..b8e5676 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c.grpc_back new file mode 100644 index 0000000..14fff86 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c new file mode 100644 index 0000000..9eefd47 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c.grpc_back new file mode 100644 index 0000000..f8618b8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h new file mode 100644 index 0000000..98dd8ab --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h.grpc_back new file mode 100644 index 0000000..2693fa6 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c new file mode 100644 index 0000000..bbd1d9c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c @@ -0,0 +1,96 @@ +/* ==================================================================== + * 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" + + +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 AES_KEY *key, uint8_t ivec[16], unsigned *num, + block128_f block) { + assert(in && out && key && ivec && num); + + unsigned n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ivec[n]; + --len; + n = (n + 1) % 16; + } + + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t a, b; + OPENSSL_memcpy(&a, in + n, sizeof(size_t)); + OPENSSL_memcpy(&b, ivec + n, sizeof(size_t)); + + const size_t c = a ^ b; + OPENSSL_memcpy(out + n, &c, sizeof(size_t)); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + out[n] = in[n] ^ ivec[n]; + ++n; + } + } + *num = n; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back new file mode 100644 index 0000000..4c70ce6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back @@ -0,0 +1,96 @@ +/* ==================================================================== + * 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" + + +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 AES_KEY *key, uint8_t ivec[16], unsigned *num, + block128_f block) { + assert(in && out && key && ivec && num); + + unsigned n = *num; + + while (n && len) { + *(out++) = *(in++) ^ ivec[n]; + --len; + n = (n + 1) % 16; + } + + while (len >= 16) { + (*block)(ivec, ivec, key); + for (; n < 16; n += sizeof(size_t)) { + size_t a, b; + OPENSSL_memcpy(&a, in + n, sizeof(size_t)); + OPENSSL_memcpy(&b, ivec + n, sizeof(size_t)); + + const size_t c = a ^ b; + OPENSSL_memcpy(out + n, &c, sizeof(size_t)); + } + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + (*block)(ivec, ivec, key); + while (len--) { + out[n] = in[n] ^ ivec[n]; + ++n; + } + } + *num = n; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c new file mode 100644 index 0000000..7df1ce9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c @@ -0,0 +1,91 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +// byte_reverse reverses the order of the bytes in |b->c|. +static void byte_reverse(polyval_block *b) { + const uint64_t t = CRYPTO_bswap8(b->u[0]); + b->u[0] = CRYPTO_bswap8(b->u[1]); + b->u[1] = t; +} + +// reverse_and_mulX_ghash interprets the bytes |b->c| as a reversed element of +// the GHASH field, multiplies that by 'x' and serialises the result back into +// |b|, but with GHASH's backwards bit ordering. +static void reverse_and_mulX_ghash(polyval_block *b) { + uint64_t hi = b->u[0]; + uint64_t lo = b->u[1]; + const crypto_word_t carry = constant_time_eq_w(hi & 1, 1); + hi >>= 1; + hi |= lo << 63; + lo >>= 1; + lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56; + + b->u[0] = CRYPTO_bswap8(lo); + b->u[1] = CRYPTO_bswap8(hi); +} + +// POLYVAL(H, X_1, ..., X_n) = +// ByteReverse(GHASH(mulX_GHASH(ByteReverse(H)), ByteReverse(X_1), ..., +// ByteReverse(X_n))). +// +// See https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#appendix-A. + +void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]) { + polyval_block H; + OPENSSL_memcpy(H.c, key, 16); + reverse_and_mulX_ghash(&H); + + int is_avx; + CRYPTO_ghash_init(&ctx->gmult, &ctx->ghash, &ctx->H, ctx->Htable, &is_avx, + H.c); + OPENSSL_memset(&ctx->S, 0, sizeof(ctx->S)); +} + +void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, + size_t in_len) { + assert((in_len & 15) == 0); + polyval_block reversed[32]; + + while (in_len > 0) { + size_t todo = in_len; + if (todo > sizeof(reversed)) { + todo = sizeof(reversed); + } + OPENSSL_memcpy(reversed, in, todo); + in += todo; + in_len -= todo; + + size_t blocks = todo / sizeof(polyval_block); + for (size_t i = 0; i < blocks; i++) { + byte_reverse(&reversed[i]); + } + + ctx->ghash(ctx->S.u, ctx->Htable, (const uint8_t *) reversed, todo); + } +} + +void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]) { + polyval_block S = ctx->S; + byte_reverse(&S); + OPENSSL_memcpy(out, &S.c, sizeof(polyval_block)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c.grpc_back new file mode 100644 index 0000000..857dc0e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c.grpc_back @@ -0,0 +1,91 @@ +/* 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 "internal.h" +#include "../../internal.h" + + +// byte_reverse reverses the order of the bytes in |b->c|. +static void byte_reverse(polyval_block *b) { + const uint64_t t = CRYPTO_bswap8(b->u[0]); + b->u[0] = CRYPTO_bswap8(b->u[1]); + b->u[1] = t; +} + +// reverse_and_mulX_ghash interprets the bytes |b->c| as a reversed element of +// the GHASH field, multiplies that by 'x' and serialises the result back into +// |b|, but with GHASH's backwards bit ordering. +static void reverse_and_mulX_ghash(polyval_block *b) { + uint64_t hi = b->u[0]; + uint64_t lo = b->u[1]; + const crypto_word_t carry = constant_time_eq_w(hi & 1, 1); + hi >>= 1; + hi |= lo << 63; + lo >>= 1; + lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56; + + b->u[0] = CRYPTO_bswap8(lo); + b->u[1] = CRYPTO_bswap8(hi); +} + +// POLYVAL(H, X_1, ..., X_n) = +// ByteReverse(GHASH(mulX_GHASH(ByteReverse(H)), ByteReverse(X_1), ..., +// ByteReverse(X_n))). +// +// See https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#appendix-A. + +void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]) { + polyval_block H; + OPENSSL_memcpy(H.c, key, 16); + reverse_and_mulX_ghash(&H); + + int is_avx; + CRYPTO_ghash_init(&ctx->gmult, &ctx->ghash, &ctx->H, ctx->Htable, &is_avx, + H.c); + OPENSSL_memset(&ctx->S, 0, sizeof(ctx->S)); +} + +void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, + size_t in_len) { + assert((in_len & 15) == 0); + polyval_block reversed[32]; + + while (in_len > 0) { + size_t todo = in_len; + if (todo > sizeof(reversed)) { + todo = sizeof(reversed); + } + OPENSSL_memcpy(reversed, in, todo); + in += todo; + in_len -= todo; + + size_t blocks = todo / sizeof(polyval_block); + for (size_t i = 0; i < blocks; i++) { + byte_reverse(&reversed[i]); + } + + ctx->ghash(ctx->S.u, ctx->Htable, (const uint8_t *) reversed, todo); + } +} + +void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]) { + polyval_block S = ctx->S; + byte_reverse(&S); + OPENSSL_memcpy(out, &S.c, sizeof(polyval_block)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c new file mode 100644 index 0000000..ec3f321 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c @@ -0,0 +1,202 @@ +/* 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" +#include "../cipher/internal.h" + + +// Section references in this file refer to SP 800-90Ar1: +// http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf + +// See table 3. +static const uint64_t kMaxReseedCount = UINT64_C(1) << 48; + +int CTR_DRBG_init(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *personalization, size_t personalization_len) { + // Section 10.2.1.3.1 + if (personalization_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + uint8_t seed_material[CTR_DRBG_ENTROPY_LEN]; + OPENSSL_memcpy(seed_material, entropy, CTR_DRBG_ENTROPY_LEN); + + for (size_t i = 0; i < personalization_len; i++) { + seed_material[i] ^= personalization[i]; + } + + // Section 10.2.1.2 + + // kInitMask is the result of encrypting blocks with big-endian value 1, 2 + // and 3 with the all-zero AES-256 key. + static const uint8_t kInitMask[CTR_DRBG_ENTROPY_LEN] = { + 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, 0xa9, 0x63, 0xb4, 0xf1, + 0xc4, 0xcb, 0x73, 0x8b, 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, + 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18, 0x72, 0x60, 0x03, 0xca, + 0x37, 0xa6, 0x2a, 0x74, 0xd1, 0xa2, 0xf5, 0x8e, 0x75, 0x06, 0x35, 0x8e, + }; + + for (size_t i = 0; i < sizeof(kInitMask); i++) { + seed_material[i] ^= kInitMask[i]; + } + + drbg->ctr = aes_ctr_set_key(&drbg->ks, NULL, &drbg->block, seed_material, 32); + OPENSSL_memcpy(drbg->counter.bytes, seed_material + 32, 16); + drbg->reseed_counter = 1; + + return 1; +} + +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. +static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) { + drbg->counter.words[3] = + CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n); +} + +static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data, + size_t data_len) { + // Per section 10.2.1.2, |data_len| must be |CTR_DRBG_ENTROPY_LEN|. Here, we + // allow shorter inputs and right-pad them with zeros. This is equivalent to + // the specified algorithm but saves a copy in |CTR_DRBG_generate|. + if (data_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + uint8_t temp[CTR_DRBG_ENTROPY_LEN]; + for (size_t i = 0; i < CTR_DRBG_ENTROPY_LEN; i += AES_BLOCK_SIZE) { + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, temp + i, &drbg->ks); + } + + for (size_t i = 0; i < data_len; i++) { + temp[i] ^= data[i]; + } + + drbg->ctr = aes_ctr_set_key(&drbg->ks, NULL, &drbg->block, temp, 32); + OPENSSL_memcpy(drbg->counter.bytes, temp + 32, 16); + + return 1; +} + +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) { + // Section 10.2.1.4 + uint8_t entropy_copy[CTR_DRBG_ENTROPY_LEN]; + + if (additional_data_len > 0) { + if (additional_data_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + OPENSSL_memcpy(entropy_copy, entropy, CTR_DRBG_ENTROPY_LEN); + for (size_t i = 0; i < additional_data_len; i++) { + entropy_copy[i] ^= additional_data[i]; + } + + entropy = entropy_copy; + } + + if (!ctr_drbg_update(drbg, entropy, CTR_DRBG_ENTROPY_LEN)) { + return 0; + } + + drbg->reseed_counter = 1; + + return 1; +} + +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) { + // See 9.3.1 + if (out_len > CTR_DRBG_MAX_GENERATE_LENGTH) { + return 0; + } + + // See 10.2.1.5.1 + if (drbg->reseed_counter > kMaxReseedCount) { + return 0; + } + + if (additional_data_len != 0 && + !ctr_drbg_update(drbg, additional_data, additional_data_len)) { + return 0; + } + + // kChunkSize is used to interact better with the cache. Since the AES-CTR + // code assumes that it's encrypting rather than just writing keystream, the + // buffer has to be zeroed first. Without chunking, large reads would zero + // the whole buffer, flushing the L1 cache, and then do another pass (missing + // the cache every time) to β€œencrypt” it. The code can avoid this by + // chunking. + static const size_t kChunkSize = 8 * 1024; + + while (out_len >= AES_BLOCK_SIZE) { + size_t todo = kChunkSize; + if (todo > out_len) { + todo = out_len; + } + + todo &= ~(AES_BLOCK_SIZE-1); + const size_t num_blocks = todo / AES_BLOCK_SIZE; + + if (drbg->ctr) { + OPENSSL_memset(out, 0, todo); + ctr32_add(drbg, 1); + drbg->ctr(out, out, num_blocks, &drbg->ks, drbg->counter.bytes); + ctr32_add(drbg, num_blocks - 1); + } else { + for (size_t i = 0; i < todo; i += AES_BLOCK_SIZE) { + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, out + i, &drbg->ks); + } + } + + out += todo; + out_len -= todo; + } + + if (out_len > 0) { + uint8_t block[AES_BLOCK_SIZE]; + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, block, &drbg->ks); + + OPENSSL_memcpy(out, block, out_len); + } + + // Right-padding |additional_data| in step 2.2 is handled implicitly by + // |ctr_drbg_update|, to save a copy. + if (!ctr_drbg_update(drbg, additional_data, additional_data_len)) { + return 0; + } + + drbg->reseed_counter++; + return 1; +} + +void CTR_DRBG_clear(CTR_DRBG_STATE *drbg) { + OPENSSL_cleanse(drbg, sizeof(CTR_DRBG_STATE)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back new file mode 100644 index 0000000..b2fda1d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back @@ -0,0 +1,202 @@ +/* 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" +#include "../cipher/internal.h" + + +// Section references in this file refer to SP 800-90Ar1: +// http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf + +// See table 3. +static const uint64_t kMaxReseedCount = UINT64_C(1) << 48; + +int CTR_DRBG_init(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *personalization, size_t personalization_len) { + // Section 10.2.1.3.1 + if (personalization_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + uint8_t seed_material[CTR_DRBG_ENTROPY_LEN]; + OPENSSL_memcpy(seed_material, entropy, CTR_DRBG_ENTROPY_LEN); + + for (size_t i = 0; i < personalization_len; i++) { + seed_material[i] ^= personalization[i]; + } + + // Section 10.2.1.2 + + // kInitMask is the result of encrypting blocks with big-endian value 1, 2 + // and 3 with the all-zero AES-256 key. + static const uint8_t kInitMask[CTR_DRBG_ENTROPY_LEN] = { + 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, 0xa9, 0x63, 0xb4, 0xf1, + 0xc4, 0xcb, 0x73, 0x8b, 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, + 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18, 0x72, 0x60, 0x03, 0xca, + 0x37, 0xa6, 0x2a, 0x74, 0xd1, 0xa2, 0xf5, 0x8e, 0x75, 0x06, 0x35, 0x8e, + }; + + for (size_t i = 0; i < sizeof(kInitMask); i++) { + seed_material[i] ^= kInitMask[i]; + } + + drbg->ctr = aes_ctr_set_key(&drbg->ks, NULL, &drbg->block, seed_material, 32); + OPENSSL_memcpy(drbg->counter.bytes, seed_material + 32, 16); + drbg->reseed_counter = 1; + + return 1; +} + +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. +static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) { + drbg->counter.words[3] = + CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n); +} + +static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data, + size_t data_len) { + // Per section 10.2.1.2, |data_len| must be |CTR_DRBG_ENTROPY_LEN|. Here, we + // allow shorter inputs and right-pad them with zeros. This is equivalent to + // the specified algorithm but saves a copy in |CTR_DRBG_generate|. + if (data_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + uint8_t temp[CTR_DRBG_ENTROPY_LEN]; + for (size_t i = 0; i < CTR_DRBG_ENTROPY_LEN; i += AES_BLOCK_SIZE) { + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, temp + i, &drbg->ks); + } + + for (size_t i = 0; i < data_len; i++) { + temp[i] ^= data[i]; + } + + drbg->ctr = aes_ctr_set_key(&drbg->ks, NULL, &drbg->block, temp, 32); + OPENSSL_memcpy(drbg->counter.bytes, temp + 32, 16); + + return 1; +} + +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) { + // Section 10.2.1.4 + uint8_t entropy_copy[CTR_DRBG_ENTROPY_LEN]; + + if (additional_data_len > 0) { + if (additional_data_len > CTR_DRBG_ENTROPY_LEN) { + return 0; + } + + OPENSSL_memcpy(entropy_copy, entropy, CTR_DRBG_ENTROPY_LEN); + for (size_t i = 0; i < additional_data_len; i++) { + entropy_copy[i] ^= additional_data[i]; + } + + entropy = entropy_copy; + } + + if (!ctr_drbg_update(drbg, entropy, CTR_DRBG_ENTROPY_LEN)) { + return 0; + } + + drbg->reseed_counter = 1; + + return 1; +} + +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) { + // See 9.3.1 + if (out_len > CTR_DRBG_MAX_GENERATE_LENGTH) { + return 0; + } + + // See 10.2.1.5.1 + if (drbg->reseed_counter > kMaxReseedCount) { + return 0; + } + + if (additional_data_len != 0 && + !ctr_drbg_update(drbg, additional_data, additional_data_len)) { + return 0; + } + + // kChunkSize is used to interact better with the cache. Since the AES-CTR + // code assumes that it's encrypting rather than just writing keystream, the + // buffer has to be zeroed first. Without chunking, large reads would zero + // the whole buffer, flushing the L1 cache, and then do another pass (missing + // the cache every time) to β€œencrypt” it. The code can avoid this by + // chunking. + static const size_t kChunkSize = 8 * 1024; + + while (out_len >= AES_BLOCK_SIZE) { + size_t todo = kChunkSize; + if (todo > out_len) { + todo = out_len; + } + + todo &= ~(AES_BLOCK_SIZE-1); + const size_t num_blocks = todo / AES_BLOCK_SIZE; + + if (drbg->ctr) { + OPENSSL_memset(out, 0, todo); + ctr32_add(drbg, 1); + drbg->ctr(out, out, num_blocks, &drbg->ks, drbg->counter.bytes); + ctr32_add(drbg, num_blocks - 1); + } else { + for (size_t i = 0; i < todo; i += AES_BLOCK_SIZE) { + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, out + i, &drbg->ks); + } + } + + out += todo; + out_len -= todo; + } + + if (out_len > 0) { + uint8_t block[AES_BLOCK_SIZE]; + ctr32_add(drbg, 1); + drbg->block(drbg->counter.bytes, block, &drbg->ks); + + OPENSSL_memcpy(out, block, out_len); + } + + // Right-padding |additional_data| in step 2.2 is handled implicitly by + // |ctr_drbg_update|, to save a copy. + if (!ctr_drbg_update(drbg, additional_data, additional_data_len)) { + return 0; + } + + drbg->reseed_counter++; + return 1; +} + +void CTR_DRBG_clear(CTR_DRBG_STATE *drbg) { + OPENSSL_cleanse(drbg, sizeof(CTR_DRBG_STATE)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h new file mode 100644 index 0000000..fdce899 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h.grpc_back new file mode 100644 index 0000000..280aae4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c new file mode 100644 index 0000000..ad1e59b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c @@ -0,0 +1,363 @@ +/* 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 + +#if defined(BORINGSSL_FIPS) +#include +#endif + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../delocate.h" + + +// It's assumed that the operating system always has an unfailing source of +// 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 +// available we don't need to worry about an RNG failure arising from fork()ing +// the process or moving a VM, so we can keep thread-local RNG state and use it +// as an additional-data input to CTR-DRBG. +// +// (We assume that the OS entropy is safe from fork()ing and VM duplication. +// This might be a bit of a leap of faith, esp on Windows, but there's nothing +// that we can do about it.) + +// kReseedInterval is the number of generate calls made to CTR-DRBG before +// reseeding. +static const unsigned kReseedInterval = 4096; + +// CRNGT_BLOCK_SIZE is the number of bytes in a β€œblock” for the purposes of the +// continuous random number generator test in FIPS 140-2, section 4.9.2. +#define CRNGT_BLOCK_SIZE 16 + +// rand_thread_state contains the per-thread state for the RNG. +struct rand_thread_state { + CTR_DRBG_STATE drbg; + // calls is the number of generate calls made on |drbg| since it was last + // (re)seeded. This is bound by |kReseedInterval|. + unsigned calls; + // last_block_valid is non-zero iff |last_block| contains data from + // |CRYPTO_sysrand_for_seed|. + int last_block_valid; + +#if defined(BORINGSSL_FIPS) + // 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. + struct rand_thread_state *next, *prev; +#endif +}; + +#if defined(BORINGSSL_FIPS) +// thread_states_list is the head of a linked-list of all |rand_thread_state| +// objects in the process, one per thread. This is needed because FIPS requires +// that they be zeroed on process exit, but thread-local destructors aren't +// called when the whole process is exiting. +DEFINE_BSS_GET(struct rand_thread_state *, thread_states_list); +DEFINE_STATIC_MUTEX(thread_states_list_lock); + +static void rand_thread_state_clear_all(void) __attribute__((destructor)); +static void rand_thread_state_clear_all(void) { + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + for (struct rand_thread_state *cur = *thread_states_list_bss_get(); + cur != NULL; cur = cur->next) { + CTR_DRBG_clear(&cur->drbg); + } + // |thread_states_list_lock is deliberately left locked so that any threads + // that are still running will hang if they try to call |RAND_bytes|. +} +#endif + +// rand_thread_state_free frees a |rand_thread_state|. This is called when a +// thread exits. +static void rand_thread_state_free(void *state_in) { + struct rand_thread_state *state = state_in; + + if (state_in == NULL) { + return; + } + +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + + if (state->prev != NULL) { + state->prev->next = state->next; + } else { + *thread_states_list_bss_get() = state->next; + } + + if (state->next != NULL) { + state->next->prev = state->prev; + } + + CRYPTO_STATIC_MUTEX_unlock_write(thread_states_list_lock_bss_get()); + + CTR_DRBG_clear(&state->drbg); +#endif + + OPENSSL_free(state); +} + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +static int hwrand(uint8_t *buf, const size_t len) { + if (!have_rdrand()) { + return 0; + } + + const size_t len_multiple8 = len & ~7; + if (!CRYPTO_rdrand_multiple8_buf(buf, len_multiple8)) { + return 0; + } + const size_t remainder = len - len_multiple8; + + if (remainder != 0) { + assert(remainder < 8); + + uint8_t rand_buf[8]; + if (!CRYPTO_rdrand(rand_buf)) { + return 0; + } + OPENSSL_memcpy(buf + len_multiple8, rand_buf, remainder); + } + +#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(buf, 0, len); +#endif + + return 1; +} + +#else + +static int hwrand(uint8_t *buf, size_t len) { + return 0; +} + +#endif + +#if defined(BORINGSSL_FIPS) + +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_for_seed(state->last_block, sizeof(state->last_block)); + } + state->last_block_valid = 1; + } + + // We overread from /dev/urandom or RDRAND by a factor of 10 and XOR to + // whiten. +#define FIPS_OVERREAD 10 + uint8_t entropy[CTR_DRBG_ENTROPY_LEN * FIPS_OVERREAD]; + + 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) { + fprintf(stderr, "CRNGT failed.\n"); + BORINGSSL_FIPS_abort(); + } + + for (size_t i = CRNGT_BLOCK_SIZE; i < sizeof(entropy); + i += CRNGT_BLOCK_SIZE) { + if (CRYPTO_memcmp(entropy + i - CRNGT_BLOCK_SIZE, entropy + i, + CRNGT_BLOCK_SIZE) == 0) { + fprintf(stderr, "CRNGT failed.\n"); + BORINGSSL_FIPS_abort(); + } + } + OPENSSL_memcpy(state->last_block, + entropy + sizeof(entropy) - CRNGT_BLOCK_SIZE, + CRNGT_BLOCK_SIZE); + + OPENSSL_memcpy(seed, entropy, CTR_DRBG_ENTROPY_LEN); + + for (size_t i = 1; i < FIPS_OVERREAD; i++) { + for (size_t j = 0; j < CTR_DRBG_ENTROPY_LEN; j++) { + 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 + +static void rand_get_seed(struct rand_thread_state *state, + uint8_t seed[CTR_DRBG_ENTROPY_LEN]) { + // If not in FIPS mode, we don't overread from the system entropy source and + // we don't depend only on the hardware RDRAND. + CRYPTO_sysrand(seed, CTR_DRBG_ENTROPY_LEN); +} + +#endif + +void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, + const uint8_t user_additional_data[32]) { + if (out_len == 0) { + return; + } + + // Additional data is mixed into every CTR-DRBG call to protect, as best we + // can, against forks & VM clones. We do not over-read this information and + // don't reseed with it so, from the point of view of FIPS, this doesn't + // provide β€œprediction resistance”. But, in practice, it does. + uint8_t additional_data[32]; + if (!hwrand(additional_data, sizeof(additional_data))) { + // Without a hardware RNG to save us from address-space duplication, the OS + // entropy is used. This can be expensive (one read per |RAND_bytes| call) + // and so can be disabled by applications that we have ensured don't fork + // and aren't at risk of VM cloning. + if (!rand_fork_unsafe_buffering_enabled()) { + CRYPTO_sysrand(additional_data, sizeof(additional_data)); + } else { + OPENSSL_memset(additional_data, 0, sizeof(additional_data)); + } + } + + for (size_t i = 0; i < sizeof(additional_data); i++) { + additional_data[i] ^= user_additional_data[i]; + } + + struct rand_thread_state stack_state; + struct rand_thread_state *state = + CRYPTO_get_thread_local(OPENSSL_THREAD_LOCAL_RAND); + + if (state == NULL) { + state = OPENSSL_malloc(sizeof(struct rand_thread_state)); + if (state == NULL || + !CRYPTO_set_thread_local(OPENSSL_THREAD_LOCAL_RAND, state, + rand_thread_state_free)) { + // If the system is out of memory, use an ephemeral state on the + // stack. + state = &stack_state; + } + + state->last_block_valid = 0; + uint8_t seed[CTR_DRBG_ENTROPY_LEN]; + rand_get_seed(state, seed); + if (!CTR_DRBG_init(&state->drbg, seed, NULL, 0)) { + abort(); + } + state->calls = 0; + +#if defined(BORINGSSL_FIPS) + if (state != &stack_state) { + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + struct rand_thread_state **states_list = thread_states_list_bss_get(); + state->next = *states_list; + if (state->next != NULL) { + state->next->prev = state; + } + state->prev = NULL; + *states_list = state; + CRYPTO_STATIC_MUTEX_unlock_write(thread_states_list_lock_bss_get()); + } +#endif + } + + if (state->calls >= kReseedInterval) { + uint8_t seed[CTR_DRBG_ENTROPY_LEN]; + rand_get_seed(state, seed); +#if defined(BORINGSSL_FIPS) + // Take a read lock around accesses to |state->drbg|. This is needed to + // avoid returning bad entropy if we race with + // |rand_thread_state_clear_all|. + // + // This lock must be taken after any calls to |CRYPTO_sysrand| to avoid a + // bug on ppc64le. glibc may implement pthread locks by wrapping user code + // in a hardware transaction, but, on some older versions of glibc and the + // kernel, syscalls made with |syscall| did not abort the transaction. + CRYPTO_STATIC_MUTEX_lock_read(thread_states_list_lock_bss_get()); +#endif + if (!CTR_DRBG_reseed(&state->drbg, seed, NULL, 0)) { + abort(); + } + state->calls = 0; + } else { +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_lock_read(thread_states_list_lock_bss_get()); +#endif + } + + int first_call = 1; + while (out_len > 0) { + size_t todo = out_len; + if (todo > CTR_DRBG_MAX_GENERATE_LENGTH) { + todo = CTR_DRBG_MAX_GENERATE_LENGTH; + } + + if (!CTR_DRBG_generate(&state->drbg, out, todo, additional_data, + first_call ? sizeof(additional_data) : 0)) { + abort(); + } + + 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; + } + + if (state == &stack_state) { + CTR_DRBG_clear(&state->drbg); + } + +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_unlock_read(thread_states_list_lock_bss_get()); +#endif +} + +int RAND_bytes(uint8_t *out, size_t out_len) { + static const uint8_t kZeroAdditionalData[32] = {0}; + RAND_bytes_with_additional_data(out, out_len, kZeroAdditionalData); + return 1; +} + +int RAND_pseudo_bytes(uint8_t *buf, size_t len) { + return RAND_bytes(buf, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back new file mode 100644 index 0000000..87d7b30 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back @@ -0,0 +1,363 @@ +/* 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 + +#if defined(BORINGSSL_FIPS) +#include +#endif + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../delocate.h" + + +// It's assumed that the operating system always has an unfailing source of +// 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 +// available we don't need to worry about an RNG failure arising from fork()ing +// the process or moving a VM, so we can keep thread-local RNG state and use it +// as an additional-data input to CTR-DRBG. +// +// (We assume that the OS entropy is safe from fork()ing and VM duplication. +// This might be a bit of a leap of faith, esp on Windows, but there's nothing +// that we can do about it.) + +// kReseedInterval is the number of generate calls made to CTR-DRBG before +// reseeding. +static const unsigned kReseedInterval = 4096; + +// CRNGT_BLOCK_SIZE is the number of bytes in a β€œblock” for the purposes of the +// continuous random number generator test in FIPS 140-2, section 4.9.2. +#define CRNGT_BLOCK_SIZE 16 + +// rand_thread_state contains the per-thread state for the RNG. +struct rand_thread_state { + CTR_DRBG_STATE drbg; + // calls is the number of generate calls made on |drbg| since it was last + // (re)seeded. This is bound by |kReseedInterval|. + unsigned calls; + // last_block_valid is non-zero iff |last_block| contains data from + // |CRYPTO_sysrand_for_seed|. + int last_block_valid; + +#if defined(BORINGSSL_FIPS) + // 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. + struct rand_thread_state *next, *prev; +#endif +}; + +#if defined(BORINGSSL_FIPS) +// thread_states_list is the head of a linked-list of all |rand_thread_state| +// objects in the process, one per thread. This is needed because FIPS requires +// that they be zeroed on process exit, but thread-local destructors aren't +// called when the whole process is exiting. +DEFINE_BSS_GET(struct rand_thread_state *, thread_states_list); +DEFINE_STATIC_MUTEX(thread_states_list_lock); + +static void rand_thread_state_clear_all(void) __attribute__((destructor)); +static void rand_thread_state_clear_all(void) { + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + for (struct rand_thread_state *cur = *thread_states_list_bss_get(); + cur != NULL; cur = cur->next) { + CTR_DRBG_clear(&cur->drbg); + } + // |thread_states_list_lock is deliberately left locked so that any threads + // that are still running will hang if they try to call |RAND_bytes|. +} +#endif + +// rand_thread_state_free frees a |rand_thread_state|. This is called when a +// thread exits. +static void rand_thread_state_free(void *state_in) { + struct rand_thread_state *state = state_in; + + if (state_in == NULL) { + return; + } + +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + + if (state->prev != NULL) { + state->prev->next = state->next; + } else { + *thread_states_list_bss_get() = state->next; + } + + if (state->next != NULL) { + state->next->prev = state->prev; + } + + CRYPTO_STATIC_MUTEX_unlock_write(thread_states_list_lock_bss_get()); + + CTR_DRBG_clear(&state->drbg); +#endif + + OPENSSL_free(state); +} + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +static int hwrand(uint8_t *buf, const size_t len) { + if (!have_rdrand()) { + return 0; + } + + const size_t len_multiple8 = len & ~7; + if (!CRYPTO_rdrand_multiple8_buf(buf, len_multiple8)) { + return 0; + } + const size_t remainder = len - len_multiple8; + + if (remainder != 0) { + assert(remainder < 8); + + uint8_t rand_buf[8]; + if (!CRYPTO_rdrand(rand_buf)) { + return 0; + } + OPENSSL_memcpy(buf + len_multiple8, rand_buf, remainder); + } + +#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(buf, 0, len); +#endif + + return 1; +} + +#else + +static int hwrand(uint8_t *buf, size_t len) { + return 0; +} + +#endif + +#if defined(BORINGSSL_FIPS) + +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_for_seed(state->last_block, sizeof(state->last_block)); + } + state->last_block_valid = 1; + } + + // We overread from /dev/urandom or RDRAND by a factor of 10 and XOR to + // whiten. +#define FIPS_OVERREAD 10 + uint8_t entropy[CTR_DRBG_ENTROPY_LEN * FIPS_OVERREAD]; + + 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) { + fprintf(stderr, "CRNGT failed.\n"); + BORINGSSL_FIPS_abort(); + } + + for (size_t i = CRNGT_BLOCK_SIZE; i < sizeof(entropy); + i += CRNGT_BLOCK_SIZE) { + if (CRYPTO_memcmp(entropy + i - CRNGT_BLOCK_SIZE, entropy + i, + CRNGT_BLOCK_SIZE) == 0) { + fprintf(stderr, "CRNGT failed.\n"); + BORINGSSL_FIPS_abort(); + } + } + OPENSSL_memcpy(state->last_block, + entropy + sizeof(entropy) - CRNGT_BLOCK_SIZE, + CRNGT_BLOCK_SIZE); + + OPENSSL_memcpy(seed, entropy, CTR_DRBG_ENTROPY_LEN); + + for (size_t i = 1; i < FIPS_OVERREAD; i++) { + for (size_t j = 0; j < CTR_DRBG_ENTROPY_LEN; j++) { + 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 + +static void rand_get_seed(struct rand_thread_state *state, + uint8_t seed[CTR_DRBG_ENTROPY_LEN]) { + // If not in FIPS mode, we don't overread from the system entropy source and + // we don't depend only on the hardware RDRAND. + CRYPTO_sysrand(seed, CTR_DRBG_ENTROPY_LEN); +} + +#endif + +void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, + const uint8_t user_additional_data[32]) { + if (out_len == 0) { + return; + } + + // Additional data is mixed into every CTR-DRBG call to protect, as best we + // can, against forks & VM clones. We do not over-read this information and + // don't reseed with it so, from the point of view of FIPS, this doesn't + // provide β€œprediction resistance”. But, in practice, it does. + uint8_t additional_data[32]; + if (!hwrand(additional_data, sizeof(additional_data))) { + // Without a hardware RNG to save us from address-space duplication, the OS + // entropy is used. This can be expensive (one read per |RAND_bytes| call) + // and so can be disabled by applications that we have ensured don't fork + // and aren't at risk of VM cloning. + if (!rand_fork_unsafe_buffering_enabled()) { + CRYPTO_sysrand(additional_data, sizeof(additional_data)); + } else { + OPENSSL_memset(additional_data, 0, sizeof(additional_data)); + } + } + + for (size_t i = 0; i < sizeof(additional_data); i++) { + additional_data[i] ^= user_additional_data[i]; + } + + struct rand_thread_state stack_state; + struct rand_thread_state *state = + CRYPTO_get_thread_local(OPENSSL_THREAD_LOCAL_RAND); + + if (state == NULL) { + state = OPENSSL_malloc(sizeof(struct rand_thread_state)); + if (state == NULL || + !CRYPTO_set_thread_local(OPENSSL_THREAD_LOCAL_RAND, state, + rand_thread_state_free)) { + // If the system is out of memory, use an ephemeral state on the + // stack. + state = &stack_state; + } + + state->last_block_valid = 0; + uint8_t seed[CTR_DRBG_ENTROPY_LEN]; + rand_get_seed(state, seed); + if (!CTR_DRBG_init(&state->drbg, seed, NULL, 0)) { + abort(); + } + state->calls = 0; + +#if defined(BORINGSSL_FIPS) + if (state != &stack_state) { + CRYPTO_STATIC_MUTEX_lock_write(thread_states_list_lock_bss_get()); + struct rand_thread_state **states_list = thread_states_list_bss_get(); + state->next = *states_list; + if (state->next != NULL) { + state->next->prev = state; + } + state->prev = NULL; + *states_list = state; + CRYPTO_STATIC_MUTEX_unlock_write(thread_states_list_lock_bss_get()); + } +#endif + } + + if (state->calls >= kReseedInterval) { + uint8_t seed[CTR_DRBG_ENTROPY_LEN]; + rand_get_seed(state, seed); +#if defined(BORINGSSL_FIPS) + // Take a read lock around accesses to |state->drbg|. This is needed to + // avoid returning bad entropy if we race with + // |rand_thread_state_clear_all|. + // + // This lock must be taken after any calls to |CRYPTO_sysrand| to avoid a + // bug on ppc64le. glibc may implement pthread locks by wrapping user code + // in a hardware transaction, but, on some older versions of glibc and the + // kernel, syscalls made with |syscall| did not abort the transaction. + CRYPTO_STATIC_MUTEX_lock_read(thread_states_list_lock_bss_get()); +#endif + if (!CTR_DRBG_reseed(&state->drbg, seed, NULL, 0)) { + abort(); + } + state->calls = 0; + } else { +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_lock_read(thread_states_list_lock_bss_get()); +#endif + } + + int first_call = 1; + while (out_len > 0) { + size_t todo = out_len; + if (todo > CTR_DRBG_MAX_GENERATE_LENGTH) { + todo = CTR_DRBG_MAX_GENERATE_LENGTH; + } + + if (!CTR_DRBG_generate(&state->drbg, out, todo, additional_data, + first_call ? sizeof(additional_data) : 0)) { + abort(); + } + + 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; + } + + if (state == &stack_state) { + CTR_DRBG_clear(&state->drbg); + } + +#if defined(BORINGSSL_FIPS) + CRYPTO_STATIC_MUTEX_unlock_read(thread_states_list_lock_bss_get()); +#endif +} + +int RAND_bytes(uint8_t *out, size_t out_len) { + static const uint8_t kZeroAdditionalData[32] = {0}; + RAND_bytes_with_additional_data(out, out_len, kZeroAdditionalData); + return 1; +} + +int RAND_pseudo_bytes(uint8_t *buf, size_t len) { + return RAND_bytes(buf, len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c new file mode 100644 index 0000000..e2aa36a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c.grpc_back new file mode 100644 index 0000000..4a60eb2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c new file mode 100644 index 0000000..652cae6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c @@ -0,0 +1,239 @@ +/* ==================================================================== + * 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 (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 "internal.h" +#include "../../internal.h" + + +#define BN_BLINDING_COUNTER 32 + +struct bn_blinding_st { + BIGNUM *A; // The base blinding factor, Montgomery-encoded. + BIGNUM *Ai; // The inverse of the blinding factor, Montgomery-encoded. + unsigned counter; +}; + +static int bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +BN_BLINDING *BN_BLINDING_new(void) { + BN_BLINDING *ret = OPENSSL_malloc(sizeof(BN_BLINDING)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(BN_BLINDING)); + + ret->A = BN_new(); + if (ret->A == NULL) { + goto err; + } + + ret->Ai = BN_new(); + if (ret->Ai == NULL) { + goto err; + } + + // The blinding values need to be created before this blinding can be used. + ret->counter = BN_BLINDING_COUNTER - 1; + + return ret; + +err: + BN_BLINDING_free(ret); + return NULL; +} + +void BN_BLINDING_free(BN_BLINDING *r) { + if (r == NULL) { + return; + } + + BN_free(r->A); + BN_free(r->Ai); + OPENSSL_free(r); +} + +static int bn_blinding_update(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + if (++b->counter == BN_BLINDING_COUNTER) { + // re-create blinding parameters + if (!bn_blinding_create_param(b, e, mont, ctx)) { + goto err; + } + b->counter = 0; + } else { + if (!BN_mod_mul_montgomery(b->A, b->A, b->A, mont, ctx) || + !BN_mod_mul_montgomery(b->Ai, b->Ai, b->Ai, mont, ctx)) { + goto err; + } + } + + return 1; + +err: + // |A| and |Ai| may be in an inconsistent state so they both need to be + // replaced the next time this blinding is used. Note that this is only + // sufficient because support for |BN_BLINDING_NO_UPDATE| and + // |BN_BLINDING_NO_RECREATE| was previously dropped. + b->counter = BN_BLINDING_COUNTER - 1; + + return 0; +} + +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + // |n| is not Montgomery-encoded and |b->A| is. |BN_mod_mul_montgomery| + // cancels one Montgomery factor, so the resulting value of |n| is unencoded. + if (!bn_blinding_update(b, e, mont, ctx) || + !BN_mod_mul_montgomery(n, n, b->A, mont, ctx)) { + return 0; + } + + return 1; +} + +int BN_BLINDING_invert(BIGNUM *n, const BN_BLINDING *b, BN_MONT_CTX *mont, + BN_CTX *ctx) { + // |n| is not Montgomery-encoded and |b->A| is. |BN_mod_mul_montgomery| + // cancels one Montgomery factor, so the resulting value of |n| is unencoded. + return BN_mod_mul_montgomery(n, n, b->Ai, mont, ctx); +} + +static int bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + int no_inverse; + if (!BN_rand_range_ex(b->A, 1, &mont->N) || + // Compute |b->A|^-1 in Montgomery form. Note |BN_from_montgomery| + + // |BN_mod_inverse_blinded| is equivalent to, but more efficient than, + // |BN_mod_inverse_blinded| + |BN_to_montgomery|. + // + // We do not retry if |b->A| has no inverse. Finding a non-invertible + // value of |b->A| is equivalent to factoring |mont->N|. There is + // negligible probability of stumbling on one at random. + !BN_from_montgomery(b->Ai, b->A, mont, ctx) || + !BN_mod_inverse_blinded(b->Ai, &no_inverse, b->Ai, mont, ctx) || + // TODO(davidben): |BN_mod_exp_mont| internally computes the result in + // Montgomery form. Save a pair of Montgomery reductions and a + // multiplication by returning that value directly. + !BN_mod_exp_mont(b->A, b->A, e, &mont->N, ctx, mont) || + !BN_to_montgomery(b->A, b->A, mont, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c.grpc_back new file mode 100644 index 0000000..b05f9c9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c.grpc_back @@ -0,0 +1,239 @@ +/* ==================================================================== + * 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 (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 "internal.h" +#include "../../internal.h" + + +#define BN_BLINDING_COUNTER 32 + +struct bn_blinding_st { + BIGNUM *A; // The base blinding factor, Montgomery-encoded. + BIGNUM *Ai; // The inverse of the blinding factor, Montgomery-encoded. + unsigned counter; +}; + +static int bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +BN_BLINDING *BN_BLINDING_new(void) { + BN_BLINDING *ret = OPENSSL_malloc(sizeof(BN_BLINDING)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(BN_BLINDING)); + + ret->A = BN_new(); + if (ret->A == NULL) { + goto err; + } + + ret->Ai = BN_new(); + if (ret->Ai == NULL) { + goto err; + } + + // The blinding values need to be created before this blinding can be used. + ret->counter = BN_BLINDING_COUNTER - 1; + + return ret; + +err: + BN_BLINDING_free(ret); + return NULL; +} + +void BN_BLINDING_free(BN_BLINDING *r) { + if (r == NULL) { + return; + } + + BN_free(r->A); + BN_free(r->Ai); + OPENSSL_free(r); +} + +static int bn_blinding_update(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + if (++b->counter == BN_BLINDING_COUNTER) { + // re-create blinding parameters + if (!bn_blinding_create_param(b, e, mont, ctx)) { + goto err; + } + b->counter = 0; + } else { + if (!BN_mod_mul_montgomery(b->A, b->A, b->A, mont, ctx) || + !BN_mod_mul_montgomery(b->Ai, b->Ai, b->Ai, mont, ctx)) { + goto err; + } + } + + return 1; + +err: + // |A| and |Ai| may be in an inconsistent state so they both need to be + // replaced the next time this blinding is used. Note that this is only + // sufficient because support for |BN_BLINDING_NO_UPDATE| and + // |BN_BLINDING_NO_RECREATE| was previously dropped. + b->counter = BN_BLINDING_COUNTER - 1; + + return 0; +} + +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + // |n| is not Montgomery-encoded and |b->A| is. |BN_mod_mul_montgomery| + // cancels one Montgomery factor, so the resulting value of |n| is unencoded. + if (!bn_blinding_update(b, e, mont, ctx) || + !BN_mod_mul_montgomery(n, n, b->A, mont, ctx)) { + return 0; + } + + return 1; +} + +int BN_BLINDING_invert(BIGNUM *n, const BN_BLINDING *b, BN_MONT_CTX *mont, + BN_CTX *ctx) { + // |n| is not Montgomery-encoded and |b->A| is. |BN_mod_mul_montgomery| + // cancels one Montgomery factor, so the resulting value of |n| is unencoded. + return BN_mod_mul_montgomery(n, n, b->Ai, mont, ctx); +} + +static int bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + int no_inverse; + if (!BN_rand_range_ex(b->A, 1, &mont->N) || + // Compute |b->A|^-1 in Montgomery form. Note |BN_from_montgomery| + + // |BN_mod_inverse_blinded| is equivalent to, but more efficient than, + // |BN_mod_inverse_blinded| + |BN_to_montgomery|. + // + // We do not retry if |b->A| has no inverse. Finding a non-invertible + // value of |b->A| is equivalent to factoring |mont->N|. There is + // negligible probability of stumbling on one at random. + !BN_from_montgomery(b->Ai, b->A, mont, ctx) || + !BN_mod_inverse_blinded(b->Ai, &no_inverse, b->Ai, mont, ctx) || + // TODO(davidben): |BN_mod_exp_mont| internally computes the result in + // Montgomery form. Save a pair of Montgomery reductions and a + // multiplication by returning that value directly. + !BN_mod_exp_mont(b->A, b->A, e, &mont->N, ctx, mont) || + !BN_to_montgomery(b->A, b->A, mont, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h new file mode 100644 index 0000000..91ab372 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h @@ -0,0 +1,126 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_RSA_INTERNAL_H + +#include + +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Default implementations of RSA operations. + +const RSA_METHOD *RSA_default_method(void); + +size_t rsa_default_size(const RSA *rsa); +int rsa_default_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 rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding); +int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len); + + +BN_BLINDING *BN_BLINDING_new(void); +void BN_BLINDING_free(BN_BLINDING *b); +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont_ctx, BN_CTX *ctx); +int BN_BLINDING_invert(BIGNUM *n, const BN_BLINDING *b, BN_MONT_CTX *mont_ctx, + BN_CTX *ctx); + + +int RSA_padding_add_PKCS1_type_1(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len); +int RSA_padding_check_PKCS1_type_1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len); +int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len); +int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len); +int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len, const uint8_t *param, + size_t param_len, const EVP_MD *md, + const EVP_MD *mgf1md); +int RSA_padding_add_none(uint8_t *to, size_t to_len, const uint8_t *from, + size_t from_len); + +// RSA_private_transform calls either the method-specific |private_transform| +// function (if given) or the generic one. See the comment for +// |private_transform| in |rsa_meth_st|. +int RSA_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len); + + +// This constant is exported for test purposes. +extern const BN_ULONG kBoringSSLRSASqrtTwo[]; +extern const size_t kBoringSSLRSASqrtTwoLen; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_RSA_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h.grpc_back new file mode 100644 index 0000000..f913058 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h.grpc_back @@ -0,0 +1,126 @@ +/* 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_INTERNAL_H +#define OPENSSL_HEADER_RSA_INTERNAL_H + +#include + +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Default implementations of RSA operations. + +const RSA_METHOD *RSA_default_method(void); + +size_t rsa_default_size(const RSA *rsa); +int rsa_default_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 rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding); +int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len); + + +BN_BLINDING *BN_BLINDING_new(void); +void BN_BLINDING_free(BN_BLINDING *b); +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, const BIGNUM *e, + const BN_MONT_CTX *mont_ctx, BN_CTX *ctx); +int BN_BLINDING_invert(BIGNUM *n, const BN_BLINDING *b, BN_MONT_CTX *mont_ctx, + BN_CTX *ctx); + + +int RSA_padding_add_PKCS1_type_1(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len); +int RSA_padding_check_PKCS1_type_1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len); +int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len); +int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len); +int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len, const uint8_t *param, + size_t param_len, const EVP_MD *md, + const EVP_MD *mgf1md); +int RSA_padding_add_none(uint8_t *to, size_t to_len, const uint8_t *from, + size_t from_len); + +// RSA_private_transform calls either the method-specific |private_transform| +// function (if given) or the generic one. See the comment for +// |private_transform| in |rsa_meth_st|. +int RSA_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len); + + +// This constant is exported for test purposes. +extern const BN_ULONG kBoringSSLRSASqrtTwo[]; +extern const size_t kBoringSSLRSASqrtTwoLen; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_RSA_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c new file mode 100644 index 0000000..0696238 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c @@ -0,0 +1,695 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2005. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +#define RSA_PKCS1_PADDING_SIZE 11 + +int RSA_padding_add_PKCS1_type_1(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len) { + // See RFC 8017, section 9.2. + if (to_len < RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); + return 0; + } + + to[0] = 0; + to[1] = 1; + OPENSSL_memset(to + 2, 0xff, to_len - 3 - from_len); + to[to_len - from_len - 1] = 0; + OPENSSL_memcpy(to + to_len - from_len, from, from_len); + return 1; +} + +int RSA_padding_check_PKCS1_type_1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len) { + // See RFC 8017, section 9.2. This is part of signature verification and thus + // does not need to run in constant-time. + if (from_len < 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_SMALL); + return 0; + } + + // Check the header. + if (from[0] != 0 || from[1] != 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BLOCK_TYPE_IS_NOT_01); + return 0; + } + + // Scan over padded data, looking for the 00. + size_t pad; + for (pad = 2 /* header */; pad < from_len; pad++) { + if (from[pad] == 0x00) { + break; + } + + if (from[pad] != 0xff) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT); + return 0; + } + } + + if (pad == from_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING); + return 0; + } + + if (pad < 2 /* header */ + 8) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_PAD_BYTE_COUNT); + return 0; + } + + // Skip over the 00. + pad++; + + if (from_len - pad > max_out) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + return 0; + } + + OPENSSL_memcpy(out, from + pad, from_len - pad); + *out_len = from_len - pad; + return 1; +} + +static int rand_nonzero(uint8_t *out, size_t len) { + if (!RAND_bytes(out, len)) { + return 0; + } + + for (size_t i = 0; i < len; i++) { + while (out[i] == 0) { + if (!RAND_bytes(out + i, 1)) { + return 0; + } + } + } + + return 1; +} + +int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len) { + // See RFC 8017, section 7.2.1. + if (to_len < RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + return 0; + } + + to[0] = 0; + to[1] = 2; + + size_t padding_len = to_len - 3 - from_len; + if (!rand_nonzero(to + 2, padding_len)) { + return 0; + } + + to[2 + padding_len] = 0; + OPENSSL_memcpy(to + to_len - from_len, from, from_len); + return 1; +} + +int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len) { + if (from_len == 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_EMPTY_PUBLIC_KEY); + return 0; + } + + // PKCS#1 v1.5 decryption. See "PKCS #1 v2.2: RSA Cryptography + // Standard", section 7.2.2. + if (from_len < RSA_PKCS1_PADDING_SIZE) { + // |from| is zero-padded to the size of the RSA modulus, a public value, so + // this can be rejected in non-constant time. + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + crypto_word_t first_byte_is_zero = constant_time_eq_w(from[0], 0); + crypto_word_t second_byte_is_two = constant_time_eq_w(from[1], 2); + + crypto_word_t zero_index = 0, looking_for_index = CONSTTIME_TRUE_W; + for (size_t i = 2; i < from_len; i++) { + crypto_word_t equals0 = constant_time_is_zero_w(from[i]); + zero_index = + constant_time_select_w(looking_for_index & equals0, i, zero_index); + looking_for_index = constant_time_select_w(equals0, 0, looking_for_index); + } + + // The input must begin with 00 02. + crypto_word_t valid_index = first_byte_is_zero; + valid_index &= second_byte_is_two; + + // We must have found the end of PS. + valid_index &= ~looking_for_index; + + // PS must be at least 8 bytes long, and it starts two bytes into |from|. + valid_index &= constant_time_ge_w(zero_index, 2 + 8); + + // Skip the zero byte. + zero_index++; + + // NOTE: Although this logic attempts to be constant time, the API contracts + // of this function and |RSA_decrypt| with |RSA_PKCS1_PADDING| make it + // 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; + } + + const size_t msg_len = from_len - zero_index; + if (msg_len > max_out) { + // This shouldn't happen because this function is always called with + // |max_out| as the key size and |from_len| is bounded by the key size. + OPENSSL_PUT_ERROR(RSA, RSA_R_PKCS_DECODING_ERROR); + return 0; + } + + OPENSSL_memcpy(out, &from[zero_index], msg_len); + *out_len = msg_len; + return 1; +} + +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_FOR_KEY_SIZE); + return 0; + } + + if (from_len < to_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(to, from, from_len); + return 1; +} + +static int PKCS1_MGF1(uint8_t *out, size_t len, const uint8_t *seed, + size_t seed_len, const EVP_MD *md) { + int ret = 0; + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + + size_t md_len = EVP_MD_size(md); + + for (uint32_t i = 0; len > 0; i++) { + uint8_t counter[4]; + counter[0] = (uint8_t)(i >> 24); + counter[1] = (uint8_t)(i >> 16); + counter[2] = (uint8_t)(i >> 8); + counter[3] = (uint8_t)i; + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, seed, seed_len) || + !EVP_DigestUpdate(&ctx, counter, sizeof(counter))) { + goto err; + } + + if (md_len <= len) { + if (!EVP_DigestFinal_ex(&ctx, out, NULL)) { + goto err; + } + out += md_len; + len -= md_len; + } else { + uint8_t digest[EVP_MAX_MD_SIZE]; + if (!EVP_DigestFinal_ex(&ctx, digest, NULL)) { + goto err; + } + OPENSSL_memcpy(out, digest, len); + len = 0; + } + } + + ret = 1; + +err: + EVP_MD_CTX_cleanup(&ctx); + return ret; +} + +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) { + if (md == NULL) { + md = EVP_sha1(); + } + if (mgf1md == NULL) { + mgf1md = md; + } + + size_t mdlen = EVP_MD_size(md); + + if (to_len < 2 * mdlen + 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + size_t emlen = to_len - 1; + if (from_len > emlen - 2 * mdlen - 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + return 0; + } + + if (emlen < 2 * mdlen + 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + to[0] = 0; + uint8_t *seed = to + 1; + uint8_t *db = to + mdlen + 1; + + if (!EVP_Digest(param, param_len, db, NULL, md, NULL)) { + return 0; + } + OPENSSL_memset(db + mdlen, 0, emlen - from_len - 2 * mdlen - 1); + db[emlen - from_len - mdlen - 1] = 0x01; + OPENSSL_memcpy(db + emlen - from_len - mdlen, from, from_len); + if (!RAND_bytes(seed, mdlen)) { + return 0; + } + + uint8_t *dbmask = OPENSSL_malloc(emlen - mdlen); + if (dbmask == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = 0; + if (!PKCS1_MGF1(dbmask, emlen - mdlen, seed, mdlen, mgf1md)) { + goto out; + } + for (size_t i = 0; i < emlen - mdlen; i++) { + db[i] ^= dbmask[i]; + } + + uint8_t seedmask[EVP_MAX_MD_SIZE]; + if (!PKCS1_MGF1(seedmask, mdlen, db, emlen - mdlen, mgf1md)) { + goto out; + } + for (size_t i = 0; i < mdlen; i++) { + seed[i] ^= seedmask[i]; + } + ret = 1; + +out: + OPENSSL_free(dbmask); + return ret; +} + +int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len, const uint8_t *param, + size_t param_len, const EVP_MD *md, + const EVP_MD *mgf1md) { + uint8_t *db = NULL; + + if (md == NULL) { + md = EVP_sha1(); + } + if (mgf1md == NULL) { + mgf1md = md; + } + + size_t mdlen = EVP_MD_size(md); + + // The encoded message is one byte smaller than the modulus to ensure that it + // doesn't end up greater than the modulus. Thus there's an extra "+1" here + // compared to https://tools.ietf.org/html/rfc2437#section-9.1.1.2. + if (from_len < 1 + 2*mdlen + 1) { + // 'from_len' is the length of the modulus, i.e. does not depend on the + // particular ciphertext. + goto decoding_err; + } + + size_t dblen = from_len - mdlen - 1; + db = OPENSSL_malloc(dblen); + if (db == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + const uint8_t *maskedseed = from + 1; + const uint8_t *maskeddb = from + 1 + mdlen; + + uint8_t seed[EVP_MAX_MD_SIZE]; + if (!PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md)) { + goto err; + } + for (size_t i = 0; i < mdlen; i++) { + seed[i] ^= maskedseed[i]; + } + + if (!PKCS1_MGF1(db, dblen, seed, mdlen, mgf1md)) { + goto err; + } + for (size_t i = 0; i < dblen; i++) { + db[i] ^= maskeddb[i]; + } + + uint8_t phash[EVP_MAX_MD_SIZE]; + if (!EVP_Digest(param, param_len, phash, NULL, md, NULL)) { + goto err; + } + + crypto_word_t bad = ~constant_time_is_zero_w(CRYPTO_memcmp(db, phash, mdlen)); + bad |= ~constant_time_is_zero_w(from[0]); + + crypto_word_t looking_for_one_byte = CONSTTIME_TRUE_W; + size_t one_index = 0; + for (size_t i = mdlen; i < dblen; i++) { + crypto_word_t equals1 = constant_time_eq_w(db[i], 1); + crypto_word_t equals0 = constant_time_eq_w(db[i], 0); + one_index = + constant_time_select_w(looking_for_one_byte & equals1, i, one_index); + looking_for_one_byte = + constant_time_select_w(equals1, 0, looking_for_one_byte); + bad |= looking_for_one_byte & ~equals0; + } + + bad |= looking_for_one_byte; + + if (bad) { + goto decoding_err; + } + + one_index++; + size_t mlen = dblen - one_index; + if (max_out < mlen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + goto err; + } + + OPENSSL_memcpy(out, db + one_index, mlen); + *out_len = mlen; + OPENSSL_free(db); + return 1; + +decoding_err: + // to avoid chosen ciphertext attacks, the error message should not reveal + // which kind of decoding error happened + OPENSSL_PUT_ERROR(RSA, RSA_R_OAEP_DECODING_ERROR); + err: + OPENSSL_free(db); + return 0; +} + +static const uint8_t kPSSZeroes[] = {0, 0, 0, 0, 0, 0, 0, 0}; + +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; + int ret = 0; + int maskedDBLen, MSBits, emLen; + size_t hLen; + const uint8_t *H; + uint8_t *DB = NULL; + EVP_MD_CTX ctx; + uint8_t H_[EVP_MAX_MD_SIZE]; + EVP_MD_CTX_init(&ctx); + + if (mgf1Hash == NULL) { + mgf1Hash = Hash; + } + + hLen = EVP_MD_size(Hash); + + // Negative sLen has special meanings: + // -1 sLen == hLen + // -2 salt length is autorecovered from signature + // -N reserved + if (sLen == -1) { + sLen = hLen; + } else if (sLen == -2) { + sLen = -2; + } else if (sLen < -2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } + + MSBits = (BN_num_bits(rsa->n) - 1) & 0x7; + emLen = RSA_size(rsa); + if (EM[0] & (0xFF << MSBits)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_FIRST_OCTET_INVALID); + goto err; + } + if (MSBits == 0) { + EM++; + emLen--; + } + if (emLen < (int)hLen + 2 || emLen < ((int)hLen + sLen + 2)) { + // sLen can be small negative + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + goto err; + } + if (EM[emLen - 1] != 0xbc) { + OPENSSL_PUT_ERROR(RSA, RSA_R_LAST_OCTET_INVALID); + goto err; + } + maskedDBLen = emLen - hLen - 1; + H = EM + maskedDBLen; + DB = OPENSSL_malloc(maskedDBLen); + if (!DB) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!PKCS1_MGF1(DB, maskedDBLen, H, hLen, mgf1Hash)) { + goto err; + } + for (i = 0; i < maskedDBLen; i++) { + DB[i] ^= EM[i]; + } + if (MSBits) { + DB[0] &= 0xFF >> (8 - MSBits); + } + for (i = 0; DB[i] == 0 && i < (maskedDBLen - 1); i++) { + ; + } + if (DB[i++] != 0x1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_RECOVERY_FAILED); + goto err; + } + if (sLen >= 0 && (maskedDBLen - i) != sLen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } + if (!EVP_DigestInit_ex(&ctx, Hash, NULL) || + !EVP_DigestUpdate(&ctx, kPSSZeroes, sizeof(kPSSZeroes)) || + !EVP_DigestUpdate(&ctx, mHash, hLen) || + !EVP_DigestUpdate(&ctx, DB + i, maskedDBLen - i) || + !EVP_DigestFinal_ex(&ctx, H_, NULL)) { + goto err; + } + if (OPENSSL_memcmp(H_, H, hLen)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_SIGNATURE); + ret = 0; + } else { + ret = 1; + } + +err: + OPENSSL_free(DB); + EVP_MD_CTX_cleanup(&ctx); + + return ret; +} + +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) { + int ret = 0; + size_t maskedDBLen, MSBits, emLen; + size_t hLen; + unsigned char *H, *salt = NULL, *p; + + if (mgf1Hash == NULL) { + mgf1Hash = Hash; + } + + hLen = EVP_MD_size(Hash); + + if (BN_is_zero(rsa->n)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_EMPTY_PUBLIC_KEY); + goto err; + } + + MSBits = (BN_num_bits(rsa->n) - 1) & 0x7; + emLen = RSA_size(rsa); + if (MSBits == 0) { + assert(emLen >= 1); + *EM++ = 0; + emLen--; + } + + if (emLen < hLen + 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + goto err; + } + + // Negative sLenRequested has special meanings: + // -1 sLen == hLen + // -2 salt length is maximized + // -N reserved + size_t sLen; + if (sLenRequested == -1) { + sLen = hLen; + } else if (sLenRequested == -2) { + sLen = emLen - hLen - 2; + } else if (sLenRequested < 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } else { + sLen = (size_t)sLenRequested; + } + + if (emLen - hLen - 2 < sLen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + goto err; + } + + if (sLen > 0) { + salt = OPENSSL_malloc(sLen); + if (!salt) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!RAND_bytes(salt, sLen)) { + goto err; + } + } + maskedDBLen = emLen - hLen - 1; + H = EM + maskedDBLen; + + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + int digest_ok = EVP_DigestInit_ex(&ctx, Hash, NULL) && + EVP_DigestUpdate(&ctx, kPSSZeroes, sizeof(kPSSZeroes)) && + EVP_DigestUpdate(&ctx, mHash, hLen) && + EVP_DigestUpdate(&ctx, salt, sLen) && + EVP_DigestFinal_ex(&ctx, H, NULL); + EVP_MD_CTX_cleanup(&ctx); + if (!digest_ok) { + goto err; + } + + // Generate dbMask in place then perform XOR on it + if (!PKCS1_MGF1(EM, maskedDBLen, H, hLen, mgf1Hash)) { + goto err; + } + + p = EM; + + // Initial PS XORs with all zeroes which is a NOP so just update + // pointer. Note from a test above this value is guaranteed to + // be non-negative. + p += emLen - sLen - hLen - 2; + *p++ ^= 0x1; + if (sLen > 0) { + for (size_t i = 0; i < sLen; i++) { + *p++ ^= salt[i]; + } + } + if (MSBits) { + EM[0] &= 0xFF >> (8 - MSBits); + } + + // H is already in place so just set final 0xbc + + EM[emLen - 1] = 0xbc; + + ret = 1; + +err: + OPENSSL_free(salt); + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back new file mode 100644 index 0000000..28f1b45 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back @@ -0,0 +1,695 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2005. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +#define RSA_PKCS1_PADDING_SIZE 11 + +int RSA_padding_add_PKCS1_type_1(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len) { + // See RFC 8017, section 9.2. + if (to_len < RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); + return 0; + } + + to[0] = 0; + to[1] = 1; + OPENSSL_memset(to + 2, 0xff, to_len - 3 - from_len); + to[to_len - from_len - 1] = 0; + OPENSSL_memcpy(to + to_len - from_len, from, from_len); + return 1; +} + +int RSA_padding_check_PKCS1_type_1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len) { + // See RFC 8017, section 9.2. This is part of signature verification and thus + // does not need to run in constant-time. + if (from_len < 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_SMALL); + return 0; + } + + // Check the header. + if (from[0] != 0 || from[1] != 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BLOCK_TYPE_IS_NOT_01); + return 0; + } + + // Scan over padded data, looking for the 00. + size_t pad; + for (pad = 2 /* header */; pad < from_len; pad++) { + if (from[pad] == 0x00) { + break; + } + + if (from[pad] != 0xff) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT); + return 0; + } + } + + if (pad == from_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING); + return 0; + } + + if (pad < 2 /* header */ + 8) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_PAD_BYTE_COUNT); + return 0; + } + + // Skip over the 00. + pad++; + + if (from_len - pad > max_out) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + return 0; + } + + OPENSSL_memcpy(out, from + pad, from_len - pad); + *out_len = from_len - pad; + return 1; +} + +static int rand_nonzero(uint8_t *out, size_t len) { + if (!RAND_bytes(out, len)) { + return 0; + } + + for (size_t i = 0; i < len; i++) { + while (out[i] == 0) { + if (!RAND_bytes(out + i, 1)) { + return 0; + } + } + } + + return 1; +} + +int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, + const uint8_t *from, size_t from_len) { + // See RFC 8017, section 7.2.1. + if (to_len < RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + return 0; + } + + to[0] = 0; + to[1] = 2; + + size_t padding_len = to_len - 3 - from_len; + if (!rand_nonzero(to + 2, padding_len)) { + return 0; + } + + to[2 + padding_len] = 0; + OPENSSL_memcpy(to + to_len - from_len, from, from_len); + return 1; +} + +int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len) { + if (from_len == 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_EMPTY_PUBLIC_KEY); + return 0; + } + + // PKCS#1 v1.5 decryption. See "PKCS #1 v2.2: RSA Cryptography + // Standard", section 7.2.2. + if (from_len < RSA_PKCS1_PADDING_SIZE) { + // |from| is zero-padded to the size of the RSA modulus, a public value, so + // this can be rejected in non-constant time. + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + crypto_word_t first_byte_is_zero = constant_time_eq_w(from[0], 0); + crypto_word_t second_byte_is_two = constant_time_eq_w(from[1], 2); + + crypto_word_t zero_index = 0, looking_for_index = CONSTTIME_TRUE_W; + for (size_t i = 2; i < from_len; i++) { + crypto_word_t equals0 = constant_time_is_zero_w(from[i]); + zero_index = + constant_time_select_w(looking_for_index & equals0, i, zero_index); + looking_for_index = constant_time_select_w(equals0, 0, looking_for_index); + } + + // The input must begin with 00 02. + crypto_word_t valid_index = first_byte_is_zero; + valid_index &= second_byte_is_two; + + // We must have found the end of PS. + valid_index &= ~looking_for_index; + + // PS must be at least 8 bytes long, and it starts two bytes into |from|. + valid_index &= constant_time_ge_w(zero_index, 2 + 8); + + // Skip the zero byte. + zero_index++; + + // NOTE: Although this logic attempts to be constant time, the API contracts + // of this function and |RSA_decrypt| with |RSA_PKCS1_PADDING| make it + // 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; + } + + const size_t msg_len = from_len - zero_index; + if (msg_len > max_out) { + // This shouldn't happen because this function is always called with + // |max_out| as the key size and |from_len| is bounded by the key size. + OPENSSL_PUT_ERROR(RSA, RSA_R_PKCS_DECODING_ERROR); + return 0; + } + + OPENSSL_memcpy(out, &from[zero_index], msg_len); + *out_len = msg_len; + return 1; +} + +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_FOR_KEY_SIZE); + return 0; + } + + if (from_len < to_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(to, from, from_len); + return 1; +} + +static int PKCS1_MGF1(uint8_t *out, size_t len, const uint8_t *seed, + size_t seed_len, const EVP_MD *md) { + int ret = 0; + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + + size_t md_len = EVP_MD_size(md); + + for (uint32_t i = 0; len > 0; i++) { + uint8_t counter[4]; + counter[0] = (uint8_t)(i >> 24); + counter[1] = (uint8_t)(i >> 16); + counter[2] = (uint8_t)(i >> 8); + counter[3] = (uint8_t)i; + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, seed, seed_len) || + !EVP_DigestUpdate(&ctx, counter, sizeof(counter))) { + goto err; + } + + if (md_len <= len) { + if (!EVP_DigestFinal_ex(&ctx, out, NULL)) { + goto err; + } + out += md_len; + len -= md_len; + } else { + uint8_t digest[EVP_MAX_MD_SIZE]; + if (!EVP_DigestFinal_ex(&ctx, digest, NULL)) { + goto err; + } + OPENSSL_memcpy(out, digest, len); + len = 0; + } + } + + ret = 1; + +err: + EVP_MD_CTX_cleanup(&ctx); + return ret; +} + +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) { + if (md == NULL) { + md = EVP_sha1(); + } + if (mgf1md == NULL) { + mgf1md = md; + } + + size_t mdlen = EVP_MD_size(md); + + if (to_len < 2 * mdlen + 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + size_t emlen = to_len - 1; + if (from_len > emlen - 2 * mdlen - 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + return 0; + } + + if (emlen < 2 * mdlen + 1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + to[0] = 0; + uint8_t *seed = to + 1; + uint8_t *db = to + mdlen + 1; + + if (!EVP_Digest(param, param_len, db, NULL, md, NULL)) { + return 0; + } + OPENSSL_memset(db + mdlen, 0, emlen - from_len - 2 * mdlen - 1); + db[emlen - from_len - mdlen - 1] = 0x01; + OPENSSL_memcpy(db + emlen - from_len - mdlen, from, from_len); + if (!RAND_bytes(seed, mdlen)) { + return 0; + } + + uint8_t *dbmask = OPENSSL_malloc(emlen - mdlen); + if (dbmask == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = 0; + if (!PKCS1_MGF1(dbmask, emlen - mdlen, seed, mdlen, mgf1md)) { + goto out; + } + for (size_t i = 0; i < emlen - mdlen; i++) { + db[i] ^= dbmask[i]; + } + + uint8_t seedmask[EVP_MAX_MD_SIZE]; + if (!PKCS1_MGF1(seedmask, mdlen, db, emlen - mdlen, mgf1md)) { + goto out; + } + for (size_t i = 0; i < mdlen; i++) { + seed[i] ^= seedmask[i]; + } + ret = 1; + +out: + OPENSSL_free(dbmask); + return ret; +} + +int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *from, + size_t from_len, const uint8_t *param, + size_t param_len, const EVP_MD *md, + const EVP_MD *mgf1md) { + uint8_t *db = NULL; + + if (md == NULL) { + md = EVP_sha1(); + } + if (mgf1md == NULL) { + mgf1md = md; + } + + size_t mdlen = EVP_MD_size(md); + + // The encoded message is one byte smaller than the modulus to ensure that it + // doesn't end up greater than the modulus. Thus there's an extra "+1" here + // compared to https://tools.ietf.org/html/rfc2437#section-9.1.1.2. + if (from_len < 1 + 2*mdlen + 1) { + // 'from_len' is the length of the modulus, i.e. does not depend on the + // particular ciphertext. + goto decoding_err; + } + + size_t dblen = from_len - mdlen - 1; + db = OPENSSL_malloc(dblen); + if (db == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + const uint8_t *maskedseed = from + 1; + const uint8_t *maskeddb = from + 1 + mdlen; + + uint8_t seed[EVP_MAX_MD_SIZE]; + if (!PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md)) { + goto err; + } + for (size_t i = 0; i < mdlen; i++) { + seed[i] ^= maskedseed[i]; + } + + if (!PKCS1_MGF1(db, dblen, seed, mdlen, mgf1md)) { + goto err; + } + for (size_t i = 0; i < dblen; i++) { + db[i] ^= maskeddb[i]; + } + + uint8_t phash[EVP_MAX_MD_SIZE]; + if (!EVP_Digest(param, param_len, phash, NULL, md, NULL)) { + goto err; + } + + crypto_word_t bad = ~constant_time_is_zero_w(CRYPTO_memcmp(db, phash, mdlen)); + bad |= ~constant_time_is_zero_w(from[0]); + + crypto_word_t looking_for_one_byte = CONSTTIME_TRUE_W; + size_t one_index = 0; + for (size_t i = mdlen; i < dblen; i++) { + crypto_word_t equals1 = constant_time_eq_w(db[i], 1); + crypto_word_t equals0 = constant_time_eq_w(db[i], 0); + one_index = + constant_time_select_w(looking_for_one_byte & equals1, i, one_index); + looking_for_one_byte = + constant_time_select_w(equals1, 0, looking_for_one_byte); + bad |= looking_for_one_byte & ~equals0; + } + + bad |= looking_for_one_byte; + + if (bad) { + goto decoding_err; + } + + one_index++; + size_t mlen = dblen - one_index; + if (max_out < mlen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + goto err; + } + + OPENSSL_memcpy(out, db + one_index, mlen); + *out_len = mlen; + OPENSSL_free(db); + return 1; + +decoding_err: + // to avoid chosen ciphertext attacks, the error message should not reveal + // which kind of decoding error happened + OPENSSL_PUT_ERROR(RSA, RSA_R_OAEP_DECODING_ERROR); + err: + OPENSSL_free(db); + return 0; +} + +static const uint8_t kPSSZeroes[] = {0, 0, 0, 0, 0, 0, 0, 0}; + +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; + int ret = 0; + int maskedDBLen, MSBits, emLen; + size_t hLen; + const uint8_t *H; + uint8_t *DB = NULL; + EVP_MD_CTX ctx; + uint8_t H_[EVP_MAX_MD_SIZE]; + EVP_MD_CTX_init(&ctx); + + if (mgf1Hash == NULL) { + mgf1Hash = Hash; + } + + hLen = EVP_MD_size(Hash); + + // Negative sLen has special meanings: + // -1 sLen == hLen + // -2 salt length is autorecovered from signature + // -N reserved + if (sLen == -1) { + sLen = hLen; + } else if (sLen == -2) { + sLen = -2; + } else if (sLen < -2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } + + MSBits = (BN_num_bits(rsa->n) - 1) & 0x7; + emLen = RSA_size(rsa); + if (EM[0] & (0xFF << MSBits)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_FIRST_OCTET_INVALID); + goto err; + } + if (MSBits == 0) { + EM++; + emLen--; + } + if (emLen < (int)hLen + 2 || emLen < ((int)hLen + sLen + 2)) { + // sLen can be small negative + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + goto err; + } + if (EM[emLen - 1] != 0xbc) { + OPENSSL_PUT_ERROR(RSA, RSA_R_LAST_OCTET_INVALID); + goto err; + } + maskedDBLen = emLen - hLen - 1; + H = EM + maskedDBLen; + DB = OPENSSL_malloc(maskedDBLen); + if (!DB) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!PKCS1_MGF1(DB, maskedDBLen, H, hLen, mgf1Hash)) { + goto err; + } + for (i = 0; i < maskedDBLen; i++) { + DB[i] ^= EM[i]; + } + if (MSBits) { + DB[0] &= 0xFF >> (8 - MSBits); + } + for (i = 0; DB[i] == 0 && i < (maskedDBLen - 1); i++) { + ; + } + if (DB[i++] != 0x1) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_RECOVERY_FAILED); + goto err; + } + if (sLen >= 0 && (maskedDBLen - i) != sLen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } + if (!EVP_DigestInit_ex(&ctx, Hash, NULL) || + !EVP_DigestUpdate(&ctx, kPSSZeroes, sizeof(kPSSZeroes)) || + !EVP_DigestUpdate(&ctx, mHash, hLen) || + !EVP_DigestUpdate(&ctx, DB + i, maskedDBLen - i) || + !EVP_DigestFinal_ex(&ctx, H_, NULL)) { + goto err; + } + if (OPENSSL_memcmp(H_, H, hLen)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_SIGNATURE); + ret = 0; + } else { + ret = 1; + } + +err: + OPENSSL_free(DB); + EVP_MD_CTX_cleanup(&ctx); + + return ret; +} + +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) { + int ret = 0; + size_t maskedDBLen, MSBits, emLen; + size_t hLen; + unsigned char *H, *salt = NULL, *p; + + if (mgf1Hash == NULL) { + mgf1Hash = Hash; + } + + hLen = EVP_MD_size(Hash); + + if (BN_is_zero(rsa->n)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_EMPTY_PUBLIC_KEY); + goto err; + } + + MSBits = (BN_num_bits(rsa->n) - 1) & 0x7; + emLen = RSA_size(rsa); + if (MSBits == 0) { + assert(emLen >= 1); + *EM++ = 0; + emLen--; + } + + if (emLen < hLen + 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + goto err; + } + + // Negative sLenRequested has special meanings: + // -1 sLen == hLen + // -2 salt length is maximized + // -N reserved + size_t sLen; + if (sLenRequested == -1) { + sLen = hLen; + } else if (sLenRequested == -2) { + sLen = emLen - hLen - 2; + } else if (sLenRequested < 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_SLEN_CHECK_FAILED); + goto err; + } else { + sLen = (size_t)sLenRequested; + } + + if (emLen - hLen - 2 < sLen) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + goto err; + } + + if (sLen > 0) { + salt = OPENSSL_malloc(sLen); + if (!salt) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!RAND_bytes(salt, sLen)) { + goto err; + } + } + maskedDBLen = emLen - hLen - 1; + H = EM + maskedDBLen; + + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + int digest_ok = EVP_DigestInit_ex(&ctx, Hash, NULL) && + EVP_DigestUpdate(&ctx, kPSSZeroes, sizeof(kPSSZeroes)) && + EVP_DigestUpdate(&ctx, mHash, hLen) && + EVP_DigestUpdate(&ctx, salt, sLen) && + EVP_DigestFinal_ex(&ctx, H, NULL); + EVP_MD_CTX_cleanup(&ctx); + if (!digest_ok) { + goto err; + } + + // Generate dbMask in place then perform XOR on it + if (!PKCS1_MGF1(EM, maskedDBLen, H, hLen, mgf1Hash)) { + goto err; + } + + p = EM; + + // Initial PS XORs with all zeroes which is a NOP so just update + // pointer. Note from a test above this value is guaranteed to + // be non-negative. + p += emLen - sLen - hLen - 2; + *p++ ^= 0x1; + if (sLen > 0) { + for (size_t i = 0; i < sLen; i++) { + *p++ ^= salt[i]; + } + } + if (MSBits) { + EM[0] &= 0xFF >> (8 - MSBits); + } + + // H is already in place so just set final 0xbc + + EM[emLen - 1] = 0xbc; + + ret = 1; + +err: + OPENSSL_free(salt); + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c new file mode 100644 index 0000000..cfe51b3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c @@ -0,0 +1,885 @@ +/* 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 +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "../../internal.h" +#include "internal.h" + + +// 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); } + +RSA *RSA_new_method(const ENGINE *engine) { + RSA *rsa = OPENSSL_malloc(sizeof(RSA)); + if (rsa == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(rsa, 0, sizeof(RSA)); + + if (engine) { + rsa->meth = ENGINE_get_RSA_method(engine); + } + + if (rsa->meth == NULL) { + rsa->meth = (RSA_METHOD *) RSA_default_method(); + } + METHOD_ref(rsa->meth); + + rsa->references = 1; + rsa->flags = rsa->meth->flags; + CRYPTO_MUTEX_init(&rsa->lock); + CRYPTO_new_ex_data(&rsa->ex_data); + + if (rsa->meth->init && !rsa->meth->init(rsa)) { + CRYPTO_free_ex_data(g_rsa_ex_data_class_bss_get(), rsa, &rsa->ex_data); + CRYPTO_MUTEX_cleanup(&rsa->lock); + METHOD_unref(rsa->meth); + OPENSSL_free(rsa); + return NULL; + } + + return rsa; +} + +void RSA_free(RSA *rsa) { + unsigned u; + + if (rsa == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&rsa->references)) { + return; + } + + if (rsa->meth->finish) { + rsa->meth->finish(rsa); + } + METHOD_unref(rsa->meth); + + CRYPTO_free_ex_data(g_rsa_ex_data_class_bss_get(), rsa, &rsa->ex_data); + + BN_free(rsa->n); + BN_free(rsa->e); + BN_free(rsa->d); + BN_free(rsa->p); + BN_free(rsa->q); + BN_free(rsa->dmp1); + BN_free(rsa->dmq1); + BN_free(rsa->iqmp); + BN_MONT_CTX_free(rsa->mont_n); + BN_MONT_CTX_free(rsa->mont_p); + BN_MONT_CTX_free(rsa->mont_q); + BN_free(rsa->d_fixed); + BN_free(rsa->dmp1_fixed); + BN_free(rsa->dmq1_fixed); + BN_free(rsa->inv_small_mod_large_mont); + for (u = 0; u < rsa->num_blindings; u++) { + BN_BLINDING_free(rsa->blindings[u]); + } + OPENSSL_free(rsa->blindings); + OPENSSL_free(rsa->blindings_inuse); + CRYPTO_MUTEX_cleanup(&rsa->lock); + OPENSSL_free(rsa); +} + +int RSA_up_ref(RSA *rsa) { + CRYPTO_refcount_inc(&rsa->references); + return 1; +} + +unsigned RSA_bits(const RSA *rsa) { return BN_num_bits(rsa->n); } + +void RSA_get0_key(const RSA *rsa, const BIGNUM **out_n, const BIGNUM **out_e, + const BIGNUM **out_d) { + if (out_n != NULL) { + *out_n = rsa->n; + } + if (out_e != NULL) { + *out_e = rsa->e; + } + if (out_d != NULL) { + *out_d = rsa->d; + } +} + +void RSA_get0_factors(const RSA *rsa, const BIGNUM **out_p, + const BIGNUM **out_q) { + if (out_p != NULL) { + *out_p = rsa->p; + } + if (out_q != NULL) { + *out_q = rsa->q; + } +} + +void RSA_get0_crt_params(const RSA *rsa, const BIGNUM **out_dmp1, + const BIGNUM **out_dmq1, const BIGNUM **out_iqmp) { + if (out_dmp1 != NULL) { + *out_dmp1 = rsa->dmp1; + } + if (out_dmq1 != NULL) { + *out_dmq1 = rsa->dmq1; + } + if (out_iqmp != NULL) { + *out_iqmp = rsa->iqmp; + } +} + +int RSA_set0_key(RSA *rsa, BIGNUM *n, BIGNUM *e, BIGNUM *d) { + if ((rsa->n == NULL && n == NULL) || + (rsa->e == NULL && e == NULL)) { + return 0; + } + + if (n != NULL) { + BN_free(rsa->n); + rsa->n = n; + } + if (e != NULL) { + BN_free(rsa->e); + rsa->e = e; + } + if (d != NULL) { + BN_free(rsa->d); + rsa->d = d; + } + + return 1; +} + +int RSA_set0_factors(RSA *rsa, BIGNUM *p, BIGNUM *q) { + if ((rsa->p == NULL && p == NULL) || + (rsa->q == NULL && q == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(rsa->p); + rsa->p = p; + } + if (q != NULL) { + BN_free(rsa->q); + rsa->q = q; + } + + return 1; +} + +int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { + if ((rsa->dmp1 == NULL && dmp1 == NULL) || + (rsa->dmq1 == NULL && dmq1 == NULL) || + (rsa->iqmp == NULL && iqmp == NULL)) { + return 0; + } + + if (dmp1 != NULL) { + BN_free(rsa->dmp1); + rsa->dmp1 = dmp1; + } + if (dmq1 != NULL) { + BN_free(rsa->dmq1); + rsa->dmq1 = dmq1; + } + if (iqmp != NULL) { + BN_free(rsa->iqmp); + rsa->iqmp = iqmp; + } + + return 1; +} + +int RSA_public_encrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_encrypt(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +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) { + if (rsa->meth->sign_raw) { + return rsa->meth->sign_raw(rsa, out_len, out, max_out, in, in_len, padding); + } + + return rsa_default_sign_raw(rsa, out_len, out, max_out, in, in_len, padding); +} + +int RSA_private_encrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_sign_raw(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +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) { + if (rsa->meth->decrypt) { + return rsa->meth->decrypt(rsa, out_len, out, max_out, in, in_len, padding); + } + + return rsa_default_decrypt(rsa, out_len, out, max_out, in, in_len, padding); +} + +int RSA_private_decrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_decrypt(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +int RSA_public_decrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_verify_raw(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +unsigned RSA_size(const RSA *rsa) { + if (rsa->meth->size) { + return rsa->meth->size(rsa); + } + + return rsa_default_size(rsa); +} + +int RSA_is_opaque(const RSA *rsa) { + return rsa->meth && (rsa->meth->flags & RSA_FLAG_OPAQUE); +} + +int RSA_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_rsa_ex_data_class_bss_get(), &index, argl, + argp, free_func)) { + return -1; + } + return index; +} + +int RSA_set_ex_data(RSA *rsa, int idx, void *arg) { + return CRYPTO_set_ex_data(&rsa->ex_data, idx, arg); +} + +void *RSA_get_ex_data(const RSA *rsa, int idx) { + return CRYPTO_get_ex_data(&rsa->ex_data, idx); +} + +// SSL_SIG_LENGTH is the size of an SSL/TLS (prior to TLS 1.2) signature: it's +// the length of an MD5 and SHA1 hash. +static const unsigned SSL_SIG_LENGTH = 36; + +// pkcs1_sig_prefix contains the ASN.1, DER encoded prefix for a hash that is +// to be signed with PKCS#1. +struct pkcs1_sig_prefix { + // nid identifies the hash function. + int nid; + // hash_len is the expected length of the hash function. + uint8_t hash_len; + // len is the number of bytes of |bytes| which are valid. + uint8_t len; + // bytes contains the DER bytes. + uint8_t bytes[19]; +}; + +// kPKCS1SigPrefixes contains the ASN.1 prefixes for PKCS#1 signatures with +// different hash functions. +static const struct pkcs1_sig_prefix kPKCS1SigPrefixes[] = { + { + NID_md5, + MD5_DIGEST_LENGTH, + 18, + {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x02, 0x05, 0x05, 0x00, 0x04, 0x10}, + }, + { + NID_sha1, + SHA_DIGEST_LENGTH, + 15, + {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, + 0x00, 0x04, 0x14}, + }, + { + NID_sha224, + SHA224_DIGEST_LENGTH, + 19, + {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}, + }, + { + NID_sha256, + SHA256_DIGEST_LENGTH, + 19, + {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, + }, + { + NID_sha384, + SHA384_DIGEST_LENGTH, + 19, + {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, + }, + { + NID_sha512, + SHA512_DIGEST_LENGTH, + 19, + {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, + }, + { + NID_undef, 0, 0, {0}, + }, +}; + +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) { + unsigned i; + + if (hash_nid == NID_md5_sha1) { + // Special case: SSL signature, just check the length. + if (msg_len != SSL_SIG_LENGTH) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + *out_msg = (uint8_t*) msg; + *out_msg_len = SSL_SIG_LENGTH; + *is_alloced = 0; + return 1; + } + + for (i = 0; kPKCS1SigPrefixes[i].nid != NID_undef; i++) { + const struct pkcs1_sig_prefix *sig_prefix = &kPKCS1SigPrefixes[i]; + if (sig_prefix->nid != hash_nid) { + continue; + } + + if (msg_len != sig_prefix->hash_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + const uint8_t* prefix = sig_prefix->bytes; + unsigned prefix_len = sig_prefix->len; + unsigned signed_msg_len; + uint8_t *signed_msg; + + signed_msg_len = prefix_len + msg_len; + if (signed_msg_len < prefix_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_TOO_LONG); + return 0; + } + + signed_msg = OPENSSL_malloc(signed_msg_len); + if (!signed_msg) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(signed_msg, prefix, prefix_len); + OPENSSL_memcpy(signed_msg + prefix_len, msg, msg_len); + + *out_msg = signed_msg; + *out_msg_len = signed_msg_len; + *is_alloced = 1; + + return 1; + } + + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE); + return 0; +} + +int RSA_sign(int hash_nid, const uint8_t *in, unsigned in_len, uint8_t *out, + unsigned *out_len, RSA *rsa) { + const unsigned rsa_size = RSA_size(rsa); + int ret = 0; + uint8_t *signed_msg = NULL; + size_t signed_msg_len = 0; + int signed_msg_is_alloced = 0; + size_t size_t_out_len; + + if (rsa->meth->sign) { + return rsa->meth->sign(hash_nid, in, in_len, out, out_len, rsa); + } + + if (!RSA_add_pkcs1_prefix(&signed_msg, &signed_msg_len, + &signed_msg_is_alloced, hash_nid, in, in_len) || + !RSA_sign_raw(rsa, &size_t_out_len, out, rsa_size, signed_msg, + signed_msg_len, RSA_PKCS1_PADDING)) { + goto err; + } + + *out_len = size_t_out_len; + ret = 1; + +err: + if (signed_msg_is_alloced) { + OPENSSL_free(signed_msg); + } + return ret; +} + +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) { + if (in_len != EVP_MD_size(md)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + size_t padded_len = RSA_size(rsa); + uint8_t *padded = OPENSSL_malloc(padded_len); + if (padded == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = + RSA_padding_add_PKCS1_PSS_mgf1(rsa, padded, in, md, mgf1_md, salt_len) && + RSA_sign_raw(rsa, out_len, out, max_out, padded, padded_len, + RSA_NO_PADDING); + OPENSSL_free(padded); + return ret; +} + +int RSA_verify(int hash_nid, const uint8_t *msg, size_t msg_len, + const uint8_t *sig, size_t sig_len, RSA *rsa) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const size_t rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int ret = 0; + uint8_t *signed_msg = NULL; + size_t signed_msg_len = 0, len; + int signed_msg_is_alloced = 0; + + if (hash_nid == NID_md5_sha1 && msg_len != SSL_SIG_LENGTH) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + buf = OPENSSL_malloc(rsa_size); + if (!buf) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!RSA_verify_raw(rsa, &len, buf, rsa_size, sig, sig_len, + RSA_PKCS1_PADDING)) { + goto out; + } + + if (!RSA_add_pkcs1_prefix(&signed_msg, &signed_msg_len, + &signed_msg_is_alloced, hash_nid, msg, msg_len)) { + goto out; + } + + // Check that no other information follows the hash value (FIPS 186-4 Section + // 5.5) and it matches the expected hash. + if (len != signed_msg_len || OPENSSL_memcmp(buf, signed_msg, len) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_SIGNATURE); + goto out; + } + + ret = 1; + +out: + OPENSSL_free(buf); + if (signed_msg_is_alloced) { + OPENSSL_free(signed_msg); + } + return ret; +} + +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) { + if (msg_len != EVP_MD_size(md)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + size_t em_len = RSA_size(rsa); + uint8_t *em = OPENSSL_malloc(em_len); + if (em == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = 0; + if (!RSA_verify_raw(rsa, &em_len, em, em_len, sig, sig_len, RSA_NO_PADDING)) { + goto err; + } + + if (em_len != RSA_size(rsa)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + ret = RSA_verify_PKCS1_PSS_mgf1(rsa, msg, md, mgf1_md, em, salt_len); + +err: + OPENSSL_free(em); + return ret; +} + +static int check_mod_inverse(int *out_ok, const BIGNUM *a, const BIGNUM *ainv, + const BIGNUM *m, int check_reduced, BN_CTX *ctx) { + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ret = tmp != NULL && + bn_mul_consttime(tmp, a, ainv, ctx) && + bn_div_consttime(NULL, tmp, tmp, m, ctx); + if (ret) { + *out_ok = BN_is_one(tmp); + if (check_reduced && (BN_is_negative(ainv) || BN_cmp(ainv, m) >= 0)) { + *out_ok = 0; + } + } + BN_CTX_end(ctx); + return ret; +} + +int RSA_check_key(const RSA *key) { + BIGNUM n, pm1, qm1, lcm, dmp1, dmq1, iqmp_times_q; + BN_CTX *ctx; + int ok = 0, has_crt_values; + + if (RSA_is_opaque(key)) { + // Opaque keys can't be checked. + return 1; + } + + if ((key->p != NULL) != (key->q != NULL)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ONLY_ONE_OF_P_Q_GIVEN); + return 0; + } + + if (!key->n || !key->e) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + if (!key->d || !key->p) { + // For a public key, or without p and q, there's nothing that can be + // checked. + return 1; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + BN_init(&n); + BN_init(&pm1); + BN_init(&qm1); + BN_init(&lcm); + BN_init(&dmp1); + BN_init(&dmq1); + BN_init(&iqmp_times_q); + + int d_ok; + if (!bn_mul_consttime(&n, key->p, key->q, ctx) || + // lcm = lcm(p, q) + !bn_usub_consttime(&pm1, key->p, BN_value_one()) || + !bn_usub_consttime(&qm1, key->q, BN_value_one()) || + !bn_lcm_consttime(&lcm, &pm1, &qm1, ctx) || + // Other implementations use the Euler totient rather than the Carmichael + // totient, so allow unreduced |key->d|. + !check_mod_inverse(&d_ok, key->e, key->d, &lcm, + 0 /* don't require reduced */, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + goto out; + } + + if (BN_cmp(&n, key->n) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_N_NOT_EQUAL_P_Q); + goto out; + } + + if (!d_ok) { + OPENSSL_PUT_ERROR(RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1); + goto out; + } + + if (BN_is_negative(key->d) || BN_cmp(key->d, key->n) >= 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_D_OUT_OF_RANGE); + goto out; + } + + has_crt_values = key->dmp1 != NULL; + if (has_crt_values != (key->dmq1 != NULL) || + has_crt_values != (key->iqmp != NULL)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INCONSISTENT_SET_OF_CRT_VALUES); + goto out; + } + + if (has_crt_values) { + int dmp1_ok, dmq1_ok, iqmp_ok; + if (!check_mod_inverse(&dmp1_ok, key->e, key->dmp1, &pm1, + 1 /* check reduced */, ctx) || + !check_mod_inverse(&dmq1_ok, key->e, key->dmq1, &qm1, + 1 /* check reduced */, ctx) || + !check_mod_inverse(&iqmp_ok, key->q, key->iqmp, key->p, + 1 /* check reduced */, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + goto out; + } + + if (!dmp1_ok || !dmq1_ok || !iqmp_ok) { + OPENSSL_PUT_ERROR(RSA, RSA_R_CRT_VALUES_INCORRECT); + goto out; + } + } + + ok = 1; + +out: + BN_free(&n); + BN_free(&pm1); + BN_free(&qm1); + BN_free(&lcm); + BN_free(&dmp1); + BN_free(&dmq1); + BN_free(&iqmp_times_q); + BN_CTX_free(ctx); + + return ok; +} + + +// This is the product of the 132 smallest odd primes, from 3 to 751. +static const BN_ULONG kSmallFactorsLimbs[] = { + TOBN(0xc4309333, 0x3ef4e3e1), TOBN(0x71161eb6, 0xcd2d655f), + TOBN(0x95e2238c, 0x0bf94862), TOBN(0x3eb233d3, 0x24f7912b), + TOBN(0x6b55514b, 0xbf26c483), TOBN(0x0a84d817, 0x5a144871), + TOBN(0x77d12fee, 0x9b82210a), TOBN(0xdb5b93c2, 0x97f050b3), + TOBN(0x4acad6b9, 0x4d6c026b), TOBN(0xeb7751f3, 0x54aec893), + TOBN(0xdba53368, 0x36bc85c4), TOBN(0xd85a1b28, 0x7f5ec78e), + TOBN(0x2eb072d8, 0x6b322244), TOBN(0xbba51112, 0x5e2b3aea), + TOBN(0x36ed1a6c, 0x0e2486bf), TOBN(0x5f270460, 0xec0c5727), + 0x000017b1 +}; + +DEFINE_LOCAL_DATA(BIGNUM, g_small_factors) { + out->d = (BN_ULONG *) kSmallFactorsLimbs; + out->width = OPENSSL_ARRAY_SIZE(kSmallFactorsLimbs); + out->dmax = out->width; + out->neg = 0; + out->flags = BN_FLG_STATIC_DATA; +} + +int RSA_check_fips(RSA *key) { + if (RSA_is_opaque(key)) { + // Opaque keys can't be checked. + OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + + if (!RSA_check_key(key)) { + return 0; + } + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + BIGNUM small_gcd; + BN_init(&small_gcd); + + 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 || + !BN_is_odd(key->n) || + !BN_is_odd(key->e) || + !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_for_generation, + ctx, NULL) || + primality_result != bn_non_prime_power_composite) { + OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); + ret = 0; + } + + BN_free(&small_gcd); + BN_CTX_free(ctx); + + if (!ret || key->d == NULL || key->p == NULL) { + // On a failure or on only a public key, there's nothing else can be + // checked. + return ret; + } + + // FIPS pairwise consistency test (FIPS 140-2 4.9.2). Per FIPS 140-2 IG, + // section 9.9, it is not known whether |rsa| will be used for signing or + // encryption, so either pair-wise consistency self-test is acceptable. We + // perform a signing test. + uint8_t data[32] = {0}; + unsigned sig_len = RSA_size(key); + uint8_t *sig = OPENSSL_malloc(sig_len); + if (sig == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!RSA_sign(NID_sha256, data, sizeof(data), sig, &sig_len, key)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + ret = 0; + goto cleanup; + } +#if defined(BORINGSSL_FIPS_BREAK_RSA_PWCT) + data[0] = ~data[0]; +#endif + if (!RSA_verify(NID_sha256, data, sizeof(data), sig, sig_len, key)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + ret = 0; + } + +cleanup: + OPENSSL_free(sig); + + return ret; +} + +int RSA_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len) { + if (rsa->meth->private_transform) { + return rsa->meth->private_transform(rsa, out, in, len); + } + + return rsa_default_private_transform(rsa, out, in, len); +} + +int RSA_flags(const RSA *rsa) { return rsa->flags; } + +int RSA_blinding_on(RSA *rsa, BN_CTX *ctx) { + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back new file mode 100644 index 0000000..0830b05 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back @@ -0,0 +1,885 @@ +/* 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 +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "../../internal.h" +#include "internal.h" + + +// 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); } + +RSA *RSA_new_method(const ENGINE *engine) { + RSA *rsa = OPENSSL_malloc(sizeof(RSA)); + if (rsa == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memset(rsa, 0, sizeof(RSA)); + + if (engine) { + rsa->meth = ENGINE_get_RSA_method(engine); + } + + if (rsa->meth == NULL) { + rsa->meth = (RSA_METHOD *) RSA_default_method(); + } + METHOD_ref(rsa->meth); + + rsa->references = 1; + rsa->flags = rsa->meth->flags; + CRYPTO_MUTEX_init(&rsa->lock); + CRYPTO_new_ex_data(&rsa->ex_data); + + if (rsa->meth->init && !rsa->meth->init(rsa)) { + CRYPTO_free_ex_data(g_rsa_ex_data_class_bss_get(), rsa, &rsa->ex_data); + CRYPTO_MUTEX_cleanup(&rsa->lock); + METHOD_unref(rsa->meth); + OPENSSL_free(rsa); + return NULL; + } + + return rsa; +} + +void RSA_free(RSA *rsa) { + unsigned u; + + if (rsa == NULL) { + return; + } + + if (!CRYPTO_refcount_dec_and_test_zero(&rsa->references)) { + return; + } + + if (rsa->meth->finish) { + rsa->meth->finish(rsa); + } + METHOD_unref(rsa->meth); + + CRYPTO_free_ex_data(g_rsa_ex_data_class_bss_get(), rsa, &rsa->ex_data); + + BN_free(rsa->n); + BN_free(rsa->e); + BN_free(rsa->d); + BN_free(rsa->p); + BN_free(rsa->q); + BN_free(rsa->dmp1); + BN_free(rsa->dmq1); + BN_free(rsa->iqmp); + BN_MONT_CTX_free(rsa->mont_n); + BN_MONT_CTX_free(rsa->mont_p); + BN_MONT_CTX_free(rsa->mont_q); + BN_free(rsa->d_fixed); + BN_free(rsa->dmp1_fixed); + BN_free(rsa->dmq1_fixed); + BN_free(rsa->inv_small_mod_large_mont); + for (u = 0; u < rsa->num_blindings; u++) { + BN_BLINDING_free(rsa->blindings[u]); + } + OPENSSL_free(rsa->blindings); + OPENSSL_free(rsa->blindings_inuse); + CRYPTO_MUTEX_cleanup(&rsa->lock); + OPENSSL_free(rsa); +} + +int RSA_up_ref(RSA *rsa) { + CRYPTO_refcount_inc(&rsa->references); + return 1; +} + +unsigned RSA_bits(const RSA *rsa) { return BN_num_bits(rsa->n); } + +void RSA_get0_key(const RSA *rsa, const BIGNUM **out_n, const BIGNUM **out_e, + const BIGNUM **out_d) { + if (out_n != NULL) { + *out_n = rsa->n; + } + if (out_e != NULL) { + *out_e = rsa->e; + } + if (out_d != NULL) { + *out_d = rsa->d; + } +} + +void RSA_get0_factors(const RSA *rsa, const BIGNUM **out_p, + const BIGNUM **out_q) { + if (out_p != NULL) { + *out_p = rsa->p; + } + if (out_q != NULL) { + *out_q = rsa->q; + } +} + +void RSA_get0_crt_params(const RSA *rsa, const BIGNUM **out_dmp1, + const BIGNUM **out_dmq1, const BIGNUM **out_iqmp) { + if (out_dmp1 != NULL) { + *out_dmp1 = rsa->dmp1; + } + if (out_dmq1 != NULL) { + *out_dmq1 = rsa->dmq1; + } + if (out_iqmp != NULL) { + *out_iqmp = rsa->iqmp; + } +} + +int RSA_set0_key(RSA *rsa, BIGNUM *n, BIGNUM *e, BIGNUM *d) { + if ((rsa->n == NULL && n == NULL) || + (rsa->e == NULL && e == NULL)) { + return 0; + } + + if (n != NULL) { + BN_free(rsa->n); + rsa->n = n; + } + if (e != NULL) { + BN_free(rsa->e); + rsa->e = e; + } + if (d != NULL) { + BN_free(rsa->d); + rsa->d = d; + } + + return 1; +} + +int RSA_set0_factors(RSA *rsa, BIGNUM *p, BIGNUM *q) { + if ((rsa->p == NULL && p == NULL) || + (rsa->q == NULL && q == NULL)) { + return 0; + } + + if (p != NULL) { + BN_free(rsa->p); + rsa->p = p; + } + if (q != NULL) { + BN_free(rsa->q); + rsa->q = q; + } + + return 1; +} + +int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { + if ((rsa->dmp1 == NULL && dmp1 == NULL) || + (rsa->dmq1 == NULL && dmq1 == NULL) || + (rsa->iqmp == NULL && iqmp == NULL)) { + return 0; + } + + if (dmp1 != NULL) { + BN_free(rsa->dmp1); + rsa->dmp1 = dmp1; + } + if (dmq1 != NULL) { + BN_free(rsa->dmq1); + rsa->dmq1 = dmq1; + } + if (iqmp != NULL) { + BN_free(rsa->iqmp); + rsa->iqmp = iqmp; + } + + return 1; +} + +int RSA_public_encrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_encrypt(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +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) { + if (rsa->meth->sign_raw) { + return rsa->meth->sign_raw(rsa, out_len, out, max_out, in, in_len, padding); + } + + return rsa_default_sign_raw(rsa, out_len, out, max_out, in, in_len, padding); +} + +int RSA_private_encrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_sign_raw(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +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) { + if (rsa->meth->decrypt) { + return rsa->meth->decrypt(rsa, out_len, out, max_out, in, in_len, padding); + } + + return rsa_default_decrypt(rsa, out_len, out, max_out, in, in_len, padding); +} + +int RSA_private_decrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_decrypt(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +int RSA_public_decrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, + int padding) { + size_t out_len; + + if (!RSA_verify_raw(rsa, &out_len, to, RSA_size(rsa), from, flen, padding)) { + return -1; + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); + return -1; + } + return out_len; +} + +unsigned RSA_size(const RSA *rsa) { + if (rsa->meth->size) { + return rsa->meth->size(rsa); + } + + return rsa_default_size(rsa); +} + +int RSA_is_opaque(const RSA *rsa) { + return rsa->meth && (rsa->meth->flags & RSA_FLAG_OPAQUE); +} + +int RSA_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_rsa_ex_data_class_bss_get(), &index, argl, + argp, free_func)) { + return -1; + } + return index; +} + +int RSA_set_ex_data(RSA *rsa, int idx, void *arg) { + return CRYPTO_set_ex_data(&rsa->ex_data, idx, arg); +} + +void *RSA_get_ex_data(const RSA *rsa, int idx) { + return CRYPTO_get_ex_data(&rsa->ex_data, idx); +} + +// SSL_SIG_LENGTH is the size of an SSL/TLS (prior to TLS 1.2) signature: it's +// the length of an MD5 and SHA1 hash. +static const unsigned SSL_SIG_LENGTH = 36; + +// pkcs1_sig_prefix contains the ASN.1, DER encoded prefix for a hash that is +// to be signed with PKCS#1. +struct pkcs1_sig_prefix { + // nid identifies the hash function. + int nid; + // hash_len is the expected length of the hash function. + uint8_t hash_len; + // len is the number of bytes of |bytes| which are valid. + uint8_t len; + // bytes contains the DER bytes. + uint8_t bytes[19]; +}; + +// kPKCS1SigPrefixes contains the ASN.1 prefixes for PKCS#1 signatures with +// different hash functions. +static const struct pkcs1_sig_prefix kPKCS1SigPrefixes[] = { + { + NID_md5, + MD5_DIGEST_LENGTH, + 18, + {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x02, 0x05, 0x05, 0x00, 0x04, 0x10}, + }, + { + NID_sha1, + SHA_DIGEST_LENGTH, + 15, + {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, + 0x00, 0x04, 0x14}, + }, + { + NID_sha224, + SHA224_DIGEST_LENGTH, + 19, + {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}, + }, + { + NID_sha256, + SHA256_DIGEST_LENGTH, + 19, + {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, + }, + { + NID_sha384, + SHA384_DIGEST_LENGTH, + 19, + {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, + }, + { + NID_sha512, + SHA512_DIGEST_LENGTH, + 19, + {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, + }, + { + NID_undef, 0, 0, {0}, + }, +}; + +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) { + unsigned i; + + if (hash_nid == NID_md5_sha1) { + // Special case: SSL signature, just check the length. + if (msg_len != SSL_SIG_LENGTH) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + *out_msg = (uint8_t*) msg; + *out_msg_len = SSL_SIG_LENGTH; + *is_alloced = 0; + return 1; + } + + for (i = 0; kPKCS1SigPrefixes[i].nid != NID_undef; i++) { + const struct pkcs1_sig_prefix *sig_prefix = &kPKCS1SigPrefixes[i]; + if (sig_prefix->nid != hash_nid) { + continue; + } + + if (msg_len != sig_prefix->hash_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + const uint8_t* prefix = sig_prefix->bytes; + unsigned prefix_len = sig_prefix->len; + unsigned signed_msg_len; + uint8_t *signed_msg; + + signed_msg_len = prefix_len + msg_len; + if (signed_msg_len < prefix_len) { + OPENSSL_PUT_ERROR(RSA, RSA_R_TOO_LONG); + return 0; + } + + signed_msg = OPENSSL_malloc(signed_msg_len); + if (!signed_msg) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(signed_msg, prefix, prefix_len); + OPENSSL_memcpy(signed_msg + prefix_len, msg, msg_len); + + *out_msg = signed_msg; + *out_msg_len = signed_msg_len; + *is_alloced = 1; + + return 1; + } + + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE); + return 0; +} + +int RSA_sign(int hash_nid, const uint8_t *in, unsigned in_len, uint8_t *out, + unsigned *out_len, RSA *rsa) { + const unsigned rsa_size = RSA_size(rsa); + int ret = 0; + uint8_t *signed_msg = NULL; + size_t signed_msg_len = 0; + int signed_msg_is_alloced = 0; + size_t size_t_out_len; + + if (rsa->meth->sign) { + return rsa->meth->sign(hash_nid, in, in_len, out, out_len, rsa); + } + + if (!RSA_add_pkcs1_prefix(&signed_msg, &signed_msg_len, + &signed_msg_is_alloced, hash_nid, in, in_len) || + !RSA_sign_raw(rsa, &size_t_out_len, out, rsa_size, signed_msg, + signed_msg_len, RSA_PKCS1_PADDING)) { + goto err; + } + + *out_len = size_t_out_len; + ret = 1; + +err: + if (signed_msg_is_alloced) { + OPENSSL_free(signed_msg); + } + return ret; +} + +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) { + if (in_len != EVP_MD_size(md)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + size_t padded_len = RSA_size(rsa); + uint8_t *padded = OPENSSL_malloc(padded_len); + if (padded == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = + RSA_padding_add_PKCS1_PSS_mgf1(rsa, padded, in, md, mgf1_md, salt_len) && + RSA_sign_raw(rsa, out_len, out, max_out, padded, padded_len, + RSA_NO_PADDING); + OPENSSL_free(padded); + return ret; +} + +int RSA_verify(int hash_nid, const uint8_t *msg, size_t msg_len, + const uint8_t *sig, size_t sig_len, RSA *rsa) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const size_t rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int ret = 0; + uint8_t *signed_msg = NULL; + size_t signed_msg_len = 0, len; + int signed_msg_is_alloced = 0; + + if (hash_nid == NID_md5_sha1 && msg_len != SSL_SIG_LENGTH) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + buf = OPENSSL_malloc(rsa_size); + if (!buf) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!RSA_verify_raw(rsa, &len, buf, rsa_size, sig, sig_len, + RSA_PKCS1_PADDING)) { + goto out; + } + + if (!RSA_add_pkcs1_prefix(&signed_msg, &signed_msg_len, + &signed_msg_is_alloced, hash_nid, msg, msg_len)) { + goto out; + } + + // Check that no other information follows the hash value (FIPS 186-4 Section + // 5.5) and it matches the expected hash. + if (len != signed_msg_len || OPENSSL_memcmp(buf, signed_msg, len) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_SIGNATURE); + goto out; + } + + ret = 1; + +out: + OPENSSL_free(buf); + if (signed_msg_is_alloced) { + OPENSSL_free(signed_msg); + } + return ret; +} + +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) { + if (msg_len != EVP_MD_size(md)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INVALID_MESSAGE_LENGTH); + return 0; + } + + size_t em_len = RSA_size(rsa); + uint8_t *em = OPENSSL_malloc(em_len); + if (em == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = 0; + if (!RSA_verify_raw(rsa, &em_len, em, em_len, sig, sig_len, RSA_NO_PADDING)) { + goto err; + } + + if (em_len != RSA_size(rsa)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + ret = RSA_verify_PKCS1_PSS_mgf1(rsa, msg, md, mgf1_md, em, salt_len); + +err: + OPENSSL_free(em); + return ret; +} + +static int check_mod_inverse(int *out_ok, const BIGNUM *a, const BIGNUM *ainv, + const BIGNUM *m, int check_reduced, BN_CTX *ctx) { + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + int ret = tmp != NULL && + bn_mul_consttime(tmp, a, ainv, ctx) && + bn_div_consttime(NULL, tmp, tmp, m, ctx); + if (ret) { + *out_ok = BN_is_one(tmp); + if (check_reduced && (BN_is_negative(ainv) || BN_cmp(ainv, m) >= 0)) { + *out_ok = 0; + } + } + BN_CTX_end(ctx); + return ret; +} + +int RSA_check_key(const RSA *key) { + BIGNUM n, pm1, qm1, lcm, dmp1, dmq1, iqmp_times_q; + BN_CTX *ctx; + int ok = 0, has_crt_values; + + if (RSA_is_opaque(key)) { + // Opaque keys can't be checked. + return 1; + } + + if ((key->p != NULL) != (key->q != NULL)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ONLY_ONE_OF_P_Q_GIVEN); + return 0; + } + + if (!key->n || !key->e) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + if (!key->d || !key->p) { + // For a public key, or without p and q, there's nothing that can be + // checked. + return 1; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + BN_init(&n); + BN_init(&pm1); + BN_init(&qm1); + BN_init(&lcm); + BN_init(&dmp1); + BN_init(&dmq1); + BN_init(&iqmp_times_q); + + int d_ok; + if (!bn_mul_consttime(&n, key->p, key->q, ctx) || + // lcm = lcm(p, q) + !bn_usub_consttime(&pm1, key->p, BN_value_one()) || + !bn_usub_consttime(&qm1, key->q, BN_value_one()) || + !bn_lcm_consttime(&lcm, &pm1, &qm1, ctx) || + // Other implementations use the Euler totient rather than the Carmichael + // totient, so allow unreduced |key->d|. + !check_mod_inverse(&d_ok, key->e, key->d, &lcm, + 0 /* don't require reduced */, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + goto out; + } + + if (BN_cmp(&n, key->n) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_N_NOT_EQUAL_P_Q); + goto out; + } + + if (!d_ok) { + OPENSSL_PUT_ERROR(RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1); + goto out; + } + + if (BN_is_negative(key->d) || BN_cmp(key->d, key->n) >= 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_D_OUT_OF_RANGE); + goto out; + } + + has_crt_values = key->dmp1 != NULL; + if (has_crt_values != (key->dmq1 != NULL) || + has_crt_values != (key->iqmp != NULL)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INCONSISTENT_SET_OF_CRT_VALUES); + goto out; + } + + if (has_crt_values) { + int dmp1_ok, dmq1_ok, iqmp_ok; + if (!check_mod_inverse(&dmp1_ok, key->e, key->dmp1, &pm1, + 1 /* check reduced */, ctx) || + !check_mod_inverse(&dmq1_ok, key->e, key->dmq1, &qm1, + 1 /* check reduced */, ctx) || + !check_mod_inverse(&iqmp_ok, key->q, key->iqmp, key->p, + 1 /* check reduced */, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + goto out; + } + + if (!dmp1_ok || !dmq1_ok || !iqmp_ok) { + OPENSSL_PUT_ERROR(RSA, RSA_R_CRT_VALUES_INCORRECT); + goto out; + } + } + + ok = 1; + +out: + BN_free(&n); + BN_free(&pm1); + BN_free(&qm1); + BN_free(&lcm); + BN_free(&dmp1); + BN_free(&dmq1); + BN_free(&iqmp_times_q); + BN_CTX_free(ctx); + + return ok; +} + + +// This is the product of the 132 smallest odd primes, from 3 to 751. +static const BN_ULONG kSmallFactorsLimbs[] = { + TOBN(0xc4309333, 0x3ef4e3e1), TOBN(0x71161eb6, 0xcd2d655f), + TOBN(0x95e2238c, 0x0bf94862), TOBN(0x3eb233d3, 0x24f7912b), + TOBN(0x6b55514b, 0xbf26c483), TOBN(0x0a84d817, 0x5a144871), + TOBN(0x77d12fee, 0x9b82210a), TOBN(0xdb5b93c2, 0x97f050b3), + TOBN(0x4acad6b9, 0x4d6c026b), TOBN(0xeb7751f3, 0x54aec893), + TOBN(0xdba53368, 0x36bc85c4), TOBN(0xd85a1b28, 0x7f5ec78e), + TOBN(0x2eb072d8, 0x6b322244), TOBN(0xbba51112, 0x5e2b3aea), + TOBN(0x36ed1a6c, 0x0e2486bf), TOBN(0x5f270460, 0xec0c5727), + 0x000017b1 +}; + +DEFINE_LOCAL_DATA(BIGNUM, g_small_factors) { + out->d = (BN_ULONG *) kSmallFactorsLimbs; + out->width = OPENSSL_ARRAY_SIZE(kSmallFactorsLimbs); + out->dmax = out->width; + out->neg = 0; + out->flags = BN_FLG_STATIC_DATA; +} + +int RSA_check_fips(RSA *key) { + if (RSA_is_opaque(key)) { + // Opaque keys can't be checked. + OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); + return 0; + } + + if (!RSA_check_key(key)) { + return 0; + } + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + BIGNUM small_gcd; + BN_init(&small_gcd); + + 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 || + !BN_is_odd(key->n) || + !BN_is_odd(key->e) || + !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_for_generation, + ctx, NULL) || + primality_result != bn_non_prime_power_composite) { + OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); + ret = 0; + } + + BN_free(&small_gcd); + BN_CTX_free(ctx); + + if (!ret || key->d == NULL || key->p == NULL) { + // On a failure or on only a public key, there's nothing else can be + // checked. + return ret; + } + + // FIPS pairwise consistency test (FIPS 140-2 4.9.2). Per FIPS 140-2 IG, + // section 9.9, it is not known whether |rsa| will be used for signing or + // encryption, so either pair-wise consistency self-test is acceptable. We + // perform a signing test. + uint8_t data[32] = {0}; + unsigned sig_len = RSA_size(key); + uint8_t *sig = OPENSSL_malloc(sig_len); + if (sig == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!RSA_sign(NID_sha256, data, sizeof(data), sig, &sig_len, key)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + ret = 0; + goto cleanup; + } +#if defined(BORINGSSL_FIPS_BREAK_RSA_PWCT) + data[0] = ~data[0]; +#endif + if (!RSA_verify(NID_sha256, data, sizeof(data), sig, sig_len, key)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + ret = 0; + } + +cleanup: + OPENSSL_free(sig); + + return ret; +} + +int RSA_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len) { + if (rsa->meth->private_transform) { + return rsa->meth->private_transform(rsa, out, in, len); + } + + return rsa_default_private_transform(rsa, out, in, len); +} + +int RSA_flags(const RSA *rsa) { return rsa->flags; } + +int RSA_blinding_on(RSA *rsa, BN_CTX *ctx) { + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c new file mode 100644 index 0000000..e8ec84b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c @@ -0,0 +1,1344 @@ +/* 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 "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" +#include "../delocate.h" + + +static int check_modulus_and_exponent_sizes(const RSA *rsa) { + unsigned rsa_bits = BN_num_bits(rsa->n); + + if (rsa_bits > 16 * 1024) { + OPENSSL_PUT_ERROR(RSA, RSA_R_MODULUS_TOO_LARGE); + return 0; + } + + // Mitigate DoS attacks by limiting the exponent size. 33 bits was chosen as + // the limit based on the recommendations in [1] and [2]. Windows CryptoAPI + // doesn't support values larger than 32 bits [3], so it is unlikely that + // exponents larger than 32 bits are being used for anything Windows commonly + // does. + // + // [1] https://www.imperialviolet.org/2012/03/16/rsae.html + // [2] https://www.imperialviolet.org/2012/03/17/rsados.html + // [3] https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx + static const unsigned kMaxExponentBits = 33; + + if (BN_num_bits(rsa->e) > kMaxExponentBits) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_E_VALUE); + return 0; + } + + // Verify |n > e|. Comparing |rsa_bits| to |kMaxExponentBits| is a small + // shortcut to comparing |n| and |e| directly. In reality, |kMaxExponentBits| + // is much smaller than the minimum RSA key size that any application should + // accept. + if (rsa_bits <= kMaxExponentBits) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + assert(BN_ucmp(rsa->n, rsa->e) > 0); + + return 1; +} + +static int ensure_fixed_copy(BIGNUM **out, const BIGNUM *in, int width) { + if (*out != NULL) { + return 1; + } + BIGNUM *copy = BN_dup(in); + if (copy == NULL || + !bn_resize_words(copy, width)) { + BN_free(copy); + return 0; + } + *out = copy; + CONSTTIME_SECRET(copy->d, sizeof(BN_ULONG) * width); + + return 1; +} + +// freeze_private_key finishes initializing |rsa|'s private key components. +// After this function has returned, |rsa| may not be changed. This is needed +// because |RSA| is a public struct and, additionally, OpenSSL 1.1.0 opaquified +// it wrong (see https://github.com/openssl/openssl/issues/5158). +static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { + CRYPTO_MUTEX_lock_read(&rsa->lock); + int frozen = rsa->private_key_frozen; + CRYPTO_MUTEX_unlock_read(&rsa->lock); + if (frozen) { + return 1; + } + + int ret = 0; + CRYPTO_MUTEX_lock_write(&rsa->lock); + if (rsa->private_key_frozen) { + ret = 1; + goto err; + } + + // Pre-compute various intermediate values, as well as copies of private + // exponents with correct widths. Note that other threads may concurrently + // read from |rsa->n|, |rsa->e|, etc., so any fixes must be in separate + // copies. We use |mont_n->N|, |mont_p->N|, and |mont_q->N| as copies of |n|, + // |p|, and |q| with the correct minimal widths. + + if (rsa->mont_n == NULL) { + rsa->mont_n = BN_MONT_CTX_new_for_modulus(rsa->n, ctx); + if (rsa->mont_n == NULL) { + goto err; + } + } + const BIGNUM *n_fixed = &rsa->mont_n->N; + + // The only public upper-bound of |rsa->d| is the bit length of |rsa->n|. The + // ASN.1 serialization of RSA private keys unfortunately leaks the byte length + // of |rsa->d|, but normalize it so we only leak it once, rather than per + // operation. + if (rsa->d != NULL && + !ensure_fixed_copy(&rsa->d_fixed, rsa->d, n_fixed->width)) { + goto err; + } + + 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_consttime(rsa->p, ctx); + if (rsa->mont_p == NULL) { + goto err; + } + } + const BIGNUM *p_fixed = &rsa->mont_p->N; + + if (rsa->mont_q == NULL) { + rsa->mont_q = BN_MONT_CTX_new_consttime(rsa->q, ctx); + if (rsa->mont_q == NULL) { + goto err; + } + } + const BIGNUM *q_fixed = &rsa->mont_q->N; + + if (rsa->dmp1 != NULL && rsa->dmq1 != NULL) { + // Key generation relies on this function to compute |iqmp|. + if (rsa->iqmp == NULL) { + BIGNUM *iqmp = BN_new(); + if (iqmp == NULL || + !bn_mod_inverse_secret_prime(iqmp, rsa->q, rsa->p, ctx, + rsa->mont_p)) { + BN_free(iqmp); + goto err; + } + rsa->iqmp = iqmp; + } + + // CRT components are only publicly bounded by their corresponding + // moduli's bit lengths. |rsa->iqmp| is unused outside of this one-time + // setup, so we do not compute a fixed-width version of it. + if (!ensure_fixed_copy(&rsa->dmp1_fixed, rsa->dmp1, p_fixed->width) || + !ensure_fixed_copy(&rsa->dmq1_fixed, rsa->dmq1, q_fixed->width)) { + goto err; + } + + // Compute |inv_small_mod_large_mont|. Note that it is always modulo the + // larger prime, independent of what is stored in |rsa->iqmp|. + if (rsa->inv_small_mod_large_mont == NULL) { + BIGNUM *inv_small_mod_large_mont = BN_new(); + int ok; + if (BN_cmp(rsa->p, rsa->q) < 0) { + ok = inv_small_mod_large_mont != NULL && + bn_mod_inverse_secret_prime(inv_small_mod_large_mont, rsa->p, + rsa->q, ctx, rsa->mont_q) && + BN_to_montgomery(inv_small_mod_large_mont, + inv_small_mod_large_mont, rsa->mont_q, ctx); + } else { + ok = inv_small_mod_large_mont != NULL && + BN_to_montgomery(inv_small_mod_large_mont, rsa->iqmp, + rsa->mont_p, ctx); + } + if (!ok) { + BN_free(inv_small_mod_large_mont); + 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); + } + } + } + + rsa->private_key_frozen = 1; + ret = 1; + +err: + CRYPTO_MUTEX_unlock_write(&rsa->lock); + return ret; +} + +size_t rsa_default_size(const RSA *rsa) { + return BN_num_bytes(rsa->n); +} + +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) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const unsigned rsa_size = RSA_size(rsa); + BIGNUM *f, *result; + uint8_t *buf = NULL; + BN_CTX *ctx = NULL; + int i, ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (!check_modulus_and_exponent_sizes(rsa)) { + return 0; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + buf = OPENSSL_malloc(rsa_size); + if (!f || !result || !buf) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + i = RSA_padding_add_PKCS1_type_2(buf, rsa_size, in, in_len); + break; + case RSA_PKCS1_OAEP_PADDING: + // Use the default parameters: SHA-1 for both hashes and no label. + i = RSA_padding_add_PKCS1_OAEP_mgf1(buf, rsa_size, in, in_len, + NULL, 0, NULL, NULL); + break; + case RSA_NO_PADDING: + i = RSA_padding_add_none(buf, rsa_size, in, in_len); + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (i <= 0) { + goto err; + } + + if (BN_bin2bn(buf, rsa_size, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + // usually the padding functions would catch this + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) || + !BN_mod_exp_mont(result, f, rsa->e, &rsa->mont_n->N, ctx, rsa->mont_n)) { + goto err; + } + + // put in leading 0 bytes if the number is less than the length of the + // modulus + if (!BN_bn2bin_padded(out, rsa_size, result)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + *out_len = rsa_size; + ret = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + OPENSSL_free(buf); + + return ret; +} + +// 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 +// none are free, the cache will be extended by a extra element and the new +// BN_BLINDING is returned. +// +// On success, the index of the assigned BN_BLINDING is written to +// |*index_used| and must be passed to |rsa_blinding_release| when finished. +static BN_BLINDING *rsa_blinding_get(RSA *rsa, unsigned *index_used, + BN_CTX *ctx) { + assert(ctx != NULL); + assert(rsa->mont_n != NULL); + + BN_BLINDING *ret = NULL; + CRYPTO_MUTEX_lock_write(&rsa->lock); + + 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 (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; + } + + // 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 (new_num_blindings > MAX_BLINDINGS_PER_RSA) { + new_num_blindings = MAX_BLINDINGS_PER_RSA; + } + assert(new_num_blindings > rsa->num_blindings); + + 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); + OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); + + 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; + } + } + 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 = new_num_blindings; + + goto out; + +err: + OPENSSL_free(new_blindings_inuse); + OPENSSL_free(new_blindings); + +out: + CRYPTO_MUTEX_unlock_write(&rsa->lock); + return ret; +} + +// rsa_blinding_release marks the cached BN_BLINDING at the given index as free +// for other threads to use. +static void rsa_blinding_release(RSA *rsa, BN_BLINDING *blinding, + unsigned blinding_index) { + if (blinding_index == MAX_BLINDINGS_PER_RSA) { + // This blinding wasn't cached. + BN_BLINDING_free(blinding); + return; + } + + CRYPTO_MUTEX_lock_write(&rsa->lock); + rsa->blindings_inuse[blinding_index] = 0; + CRYPTO_MUTEX_unlock_write(&rsa->lock); +} + +// signing +int rsa_default_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) { + const unsigned rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int i, ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + i = RSA_padding_add_PKCS1_type_1(buf, rsa_size, in, in_len); + break; + case RSA_NO_PADDING: + i = RSA_padding_add_none(buf, rsa_size, in, in_len); + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (i <= 0) { + goto err; + } + + if (!RSA_private_transform(rsa, out, buf, rsa_size)) { + goto err; + } + + CONSTTIME_DECLASSIFY(out, rsa_size); + *out_len = rsa_size; + ret = 1; + +err: + OPENSSL_free(buf); + + return ret; +} + +int rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding) { + const unsigned rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (padding == RSA_NO_PADDING) { + buf = out; + } else { + // Allocate a temporary buffer to hold the padded plaintext. + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + if (in_len != rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN); + goto err; + } + + if (!RSA_private_transform(rsa, buf, in, rsa_size)) { + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + ret = + RSA_padding_check_PKCS1_type_2(out, out_len, rsa_size, buf, rsa_size); + break; + case RSA_PKCS1_OAEP_PADDING: + // Use the default parameters: SHA-1 for both hashes and no label. + ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, out_len, rsa_size, buf, + rsa_size, NULL, 0, NULL, NULL); + break; + case RSA_NO_PADDING: + *out_len = rsa_size; + ret = 1; + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + 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: + if (padding != RSA_NO_PADDING) { + OPENSSL_free(buf); + } + + return ret; +} + +static int mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + +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) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const unsigned rsa_size = RSA_size(rsa); + BIGNUM *f, *result; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (in_len != rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN); + return 0; + } + + if (!check_modulus_and_exponent_sizes(rsa)) { + return 0; + } + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + + int ret = 0; + uint8_t *buf = NULL; + + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + if (f == NULL || result == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (padding == RSA_NO_PADDING) { + buf = out; + } else { + // Allocate a temporary buffer to hold the padded plaintext. + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + if (BN_bin2bn(in, in_len, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) || + !BN_mod_exp_mont(result, f, rsa->e, &rsa->mont_n->N, ctx, rsa->mont_n)) { + goto err; + } + + if (!BN_bn2bin_padded(buf, rsa_size, result)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + ret = + RSA_padding_check_PKCS1_type_1(out, out_len, rsa_size, buf, rsa_size); + break; + case RSA_NO_PADDING: + ret = 1; + *out_len = rsa_size; + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (!ret) { + OPENSSL_PUT_ERROR(RSA, RSA_R_PADDING_CHECK_FAILED); + goto err; + } + +err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + if (buf != out) { + OPENSSL_free(buf); + } + return ret; +} + +int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len) { + if (rsa->n == NULL || rsa->d == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + BIGNUM *f, *result; + BN_CTX *ctx = NULL; + unsigned blinding_index = 0; + BN_BLINDING *blinding = NULL; + int ret = 0; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + + if (f == NULL || result == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (BN_bin2bn(in, len, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + // Usually the padding functions would catch this. + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!freeze_private_key(rsa, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + const int do_blinding = (rsa->flags & RSA_FLAG_NO_BLINDING) == 0; + + if (rsa->e == NULL && do_blinding) { + // We cannot do blinding or verification without |e|, and continuing without + // those countermeasures is dangerous. However, the Java/Android RSA API + // requires support for keys where only |d| and |n| (and not |e|) are known. + // The callers that require that bad behavior set |RSA_FLAG_NO_BLINDING|. + OPENSSL_PUT_ERROR(RSA, RSA_R_NO_PUBLIC_EXPONENT); + goto err; + } + + if (do_blinding) { + blinding = rsa_blinding_get(rsa, &blinding_index, ctx); + if (blinding == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!BN_BLINDING_convert(f, blinding, rsa->e, rsa->mont_n, ctx)) { + goto err; + } + } + + if (rsa->p != NULL && rsa->q != NULL && rsa->e != NULL && rsa->dmp1 != 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; + } + } else if (!BN_mod_exp_mont_consttime(result, f, rsa->d_fixed, rsa->n, ctx, + rsa->mont_n)) { + goto err; + } + + // Verify the result to protect against fault attacks as described in the + // 1997 paper "On the Importance of Checking Cryptographic Protocols for + // Faults" by Dan Boneh, Richard A. DeMillo, and Richard J. Lipton. Some + // implementations do this only when the CRT is used, but we do it in all + // cases. Section 6 of the aforementioned paper describes an attack that + // works when the CRT isn't used. That attack is much less likely to succeed + // than the CRT attack, but there have likely been improvements since 1997. + // + // This check is cheap assuming |e| is small; it almost always is. + if (rsa->e != NULL) { + BIGNUM *vrfy = BN_CTX_get(ctx); + if (vrfy == NULL || + !BN_mod_exp_mont(vrfy, result, rsa->e, rsa->n, ctx, rsa->mont_n) || + !BN_equal_consttime(vrfy, f)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + } + + if (do_blinding && + !BN_BLINDING_invert(result, blinding, rsa->mont_n, ctx)) { + goto err; + } + + // The computation should have left |result| as a maximally-wide number, so + // that it and serializing does not leak information about the magnitude of + // the result. + // + // 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); + goto err; + } + + ret = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + if (blinding != NULL) { + rsa_blinding_release(rsa, blinding, blinding_index); + } + + return ret; +} + +// mod_montgomery sets |r| to |I| mod |p|. |I| must already be fully reduced +// modulo |p| times |q|. It returns one on success and zero on error. +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. The caller should have checked + // this already. + if (!bn_less_than_montgomery_R(q, mont_p)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + + if (// Reduce mod p with Montgomery reduction. This computes I * R^-1 mod p. + !BN_from_montgomery(r, I, mont_p, ctx) || + // Multiply by R^2 and do another Montgomery reduction to compute + // I * R^-1 * R^2 * R^-1 = I mod p. + !BN_to_montgomery(r, r, mont_p, ctx)) { + return 0; + } + + // By precomputing R^3 mod p (normally |BN_MONT_CTX| only uses R^2 mod p) and + // adjusting the API for |BN_mod_exp_mont_consttime|, we could instead compute + // I * R mod p here and save a reduction per prime. But this would require + // changing the RSAZ code and may not be worth it. Note that the RSAZ code + // uses a different radix, so it uses R' = 2^1044. There we'd actually want + // R^2 * R', and would futher benefit from a precomputed R'^2. It currently + // converts |mont_p->RR| to R'^2. + return 1; +} + +static int mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) { + assert(ctx != NULL); + + assert(rsa->n != NULL); + assert(rsa->e != NULL); + assert(rsa->d != NULL); + assert(rsa->p != NULL); + assert(rsa->q != NULL); + assert(rsa->dmp1 != NULL); + assert(rsa->dmq1 != NULL); + assert(rsa->iqmp != NULL); + + BIGNUM *r1, *m1; + int ret = 0; + + BN_CTX_start(ctx); + r1 = BN_CTX_get(ctx); + m1 = BN_CTX_get(ctx); + if (r1 == NULL || + m1 == NULL) { + goto err; + } + + if (!freeze_private_key(rsa, ctx)) { + goto err; + } + + // Implementing RSA with CRT in constant-time is sensitive to which prime is + // larger. Canonicalize fields so that |p| is the larger prime. + const BIGNUM *dmp1 = rsa->dmp1_fixed, *dmq1 = rsa->dmq1_fixed; + const BN_MONT_CTX *mont_p = rsa->mont_p, *mont_q = rsa->mont_q; + if (BN_cmp(rsa->p, rsa->q) < 0) { + mont_p = rsa->mont_q; + mont_q = rsa->mont_p; + dmp1 = rsa->dmq1_fixed; + dmq1 = rsa->dmp1_fixed; + } + + // Use the minimal-width versions of |n|, |p|, and |q|. Either works, but if + // someone gives us non-minimal values, these will be slightly more efficient + // on the non-Montgomery operations. + const BIGNUM *n = &rsa->mont_n->N; + const BIGNUM *p = &mont_p->N; + const BIGNUM *q = &mont_q->N; + + // This is a pre-condition for |mod_montgomery|. It was already checked by the + // caller. + assert(BN_ucmp(I, n) < 0); + + if (// |m1| is the result modulo |q|. + !mod_montgomery(r1, I, q, mont_q, p, ctx) || + !BN_mod_exp_mont_consttime(m1, r1, dmq1, q, ctx, mont_q) || + // |r0| is the result modulo |p|. + !mod_montgomery(r1, I, p, mont_p, q, ctx) || + !BN_mod_exp_mont_consttime(r0, r1, dmp1, p, ctx, mont_p) || + // Compute r0 = r0 - m1 mod p. |p| is the larger prime, so |m1| is already + // fully reduced mod |p|. + !bn_mod_sub_consttime(r0, r0, m1, p, ctx) || + // r0 = r0 * iqmp mod p. We use Montgomery multiplication to compute this + // in constant time. |inv_small_mod_large_mont| is in Montgomery form and + // r0 is not, so the result is taken out of Montgomery form. + !BN_mod_mul_montgomery(r0, r0, rsa->inv_small_mod_large_mont, mont_p, + ctx) || + // r0 = r0 * q + m1 gives the final result. Reducing modulo q gives m1, so + // it is correct mod p. Reducing modulo p gives (r0-m1)*iqmp*q + m1 = r0, + // so it is correct mod q. Finally, the result is bounded by [m1, n + m1), + // and the result is at least |m1|, so this must be the unique answer in + // [0, n). + !bn_mul_consttime(r0, r0, q, ctx) || + !bn_uadd_consttime(r0, r0, m1) || + // The result should be bounded by |n|, but fixed-width operations may + // bound the width slightly higher, so fix it. + !bn_resize_words(r0, n->width)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int ensure_bignum(BIGNUM **out) { + if (*out == NULL) { + *out = BN_new(); + } + return *out != NULL; +} + +// kBoringSSLRSASqrtTwo is the BIGNUM representation of ⌊2ΒΉβ΅Β³β΅Γ—βˆš2βŒ‹. This is +// chosen to give enough precision for 3072-bit RSA, the largest key size FIPS +// specifies. Key sizes beyond this will round up. +// +// To verify this number, check that nΒ² < 2³⁰⁷¹ < (n+1)Β², where n is value +// represented here. Note the components are listed in little-endian order. Here +// is some sample Python code to check: +// +// >>> TOBN = lambda a, b: a << 32 | b +// >>> l = [ ] +// >>> n = sum(a * 2**(64*i) for i, a in enumerate(l)) +// >>> n**2 < 2**3071 < (n+1)**2 +// True +const BN_ULONG kBoringSSLRSASqrtTwo[] = { + TOBN(0xdea06241, 0xf7aa81c2), TOBN(0xf6a1be3f, 0xca221307), + TOBN(0x332a5e9f, 0x7bda1ebf), TOBN(0x0104dc01, 0xfe32352f), + TOBN(0xb8cf341b, 0x6f8236c7), TOBN(0x4264dabc, 0xd528b651), + TOBN(0xf4d3a02c, 0xebc93e0c), TOBN(0x81394ab6, 0xd8fd0efd), + TOBN(0xeaa4a089, 0x9040ca4a), TOBN(0xf52f120f, 0x836e582e), + TOBN(0xcb2a6343, 0x31f3c84d), TOBN(0xc6d5a8a3, 0x8bb7e9dc), + TOBN(0x460abc72, 0x2f7c4e33), TOBN(0xcab1bc91, 0x1688458a), + TOBN(0x53059c60, 0x11bc337b), TOBN(0xd2202e87, 0x42af1f4e), + TOBN(0x78048736, 0x3dfa2768), TOBN(0x0f74a85e, 0x439c7b4a), + TOBN(0xa8b1fe6f, 0xdc83db39), TOBN(0x4afc8304, 0x3ab8a2c3), + TOBN(0xed17ac85, 0x83339915), TOBN(0x1d6f60ba, 0x893ba84c), + TOBN(0x597d89b3, 0x754abe9f), TOBN(0xb504f333, 0xf9de6484), +}; +const size_t kBoringSSLRSASqrtTwoLen = OPENSSL_ARRAY_SIZE(kBoringSSLRSASqrtTwo); + +// generate_prime sets |out| to a prime with length |bits| such that |out|-1 is +// 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, + BN_GENCB *cb) { + if (bits < 128 || (bits % BN_BITS2) != 0) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + assert(BN_is_pow2(pow2_bits_100)); + assert(BN_is_bit_set(pow2_bits_100, bits - 100)); + + // See FIPS 186-4 appendix B.3.3, steps 4 and 5. Note |bits| here is nlen/2. + + // 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 * 8 : bits * 5; + + int ret = 0, tries = 0, rand_tries = 0; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + for (;;) { + // Generate a random number of length |bits| where the bottom bit is set + // (steps 4.2, 4.3, 5.2 and 5.3) and the top bit is set (implied by the + // bound checked below in steps 4.4 and 5.5). + if (!BN_rand(out, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD) || + !BN_GENCB_call(cb, BN_GENCB_GENERATED, rand_tries++)) { + goto err; + } + + if (p != NULL) { + // If |p| and |out| are too close, try again (step 5.4). + if (!bn_abs_sub_consttime(tmp, out, p, ctx)) { + goto err; + } + if (BN_cmp(tmp, pow2_bits_100) <= 0) { + continue; + } + } + + // If out < 2^(bits-1)Γ—βˆš2, try again (steps 4.4 and 5.5). This is equivalent + // to out <= ⌊2^(bits-1)Γ—βˆš2βŒ‹, or out <= sqrt2 for FIPS key sizes. + // + // For larger keys, the comparison is approximate, leaning towards + // retrying. That is, we reject a negligible fraction of primes that are + // within the FIPS bound, but we will never accept a prime outside the + // bound, ensuring the resulting RSA key is the right size. + if (BN_cmp(out, sqrt2) <= 0) { + continue; + } + + // RSA key generation's bottleneck is discarding composites. If it fails + // 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; + if (!BN_sub(tmp, out, BN_value_one()) || + !bn_is_relatively_prime(&relatively_prime, tmp, e, ctx)) { + goto err; + } + 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_for_generation, ctx, 0, cb)) { + goto err; + } + if (is_probable_prime) { + ret = 1; + goto err; + } + } + } + + // If we've tried too many times to find a prime, abort (steps 4.7 and + // 5.8). + tries++; + if (tries >= limit) { + OPENSSL_PUT_ERROR(RSA, RSA_R_TOO_MANY_ITERATIONS); + goto err; + } + if (!BN_GENCB_call(cb, 2, tries)) { + goto err; + } + } + +err: + BN_CTX_end(ctx); + return ret; +} + +// 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. + + // Always generate RSA keys which are a multiple of 128 bits. Round |bits| + // down as needed. + bits &= ~127; + + // Reject excessively small keys. + if (bits < 256) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + // Reject excessively large public exponents. Windows CryptoAPI and Go don't + // support values larger than 32 bits, so match their limits for generating + // keys. (|check_modulus_and_exponent_sizes| uses a slightly more conservative + // value, but we don't need to support generating such keys.) + // https://github.com/golang/go/issues/3161 + // https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx + if (BN_num_bits(e_value) > 32) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_E_VALUE); + return 0; + } + + int ret = 0; + int prime_bits = bits / 2; + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + goto bn_err; + } + BN_CTX_start(ctx); + BIGNUM *totient = BN_CTX_get(ctx); + BIGNUM *pm1 = BN_CTX_get(ctx); + BIGNUM *qm1 = BN_CTX_get(ctx); + BIGNUM *sqrt2 = BN_CTX_get(ctx); + BIGNUM *pow2_prime_bits_100 = BN_CTX_get(ctx); + BIGNUM *pow2_prime_bits = BN_CTX_get(ctx); + if (totient == NULL || pm1 == NULL || qm1 == NULL || sqrt2 == NULL || + pow2_prime_bits_100 == NULL || pow2_prime_bits == NULL || + !BN_set_bit(pow2_prime_bits_100, prime_bits - 100) || + !BN_set_bit(pow2_prime_bits, prime_bits)) { + goto bn_err; + } + + // We need the RSA components non-NULL. + if (!ensure_bignum(&rsa->n) || + !ensure_bignum(&rsa->d) || + !ensure_bignum(&rsa->e) || + !ensure_bignum(&rsa->p) || + !ensure_bignum(&rsa->q) || + !ensure_bignum(&rsa->dmp1) || + !ensure_bignum(&rsa->dmq1)) { + goto bn_err; + } + + if (!BN_copy(rsa->e, e_value)) { + goto bn_err; + } + + // Compute sqrt2 >= ⌊2^(prime_bits-1)Γ—βˆš2βŒ‹. + if (!bn_set_words(sqrt2, kBoringSSLRSASqrtTwo, kBoringSSLRSASqrtTwoLen)) { + goto bn_err; + } + int sqrt2_bits = kBoringSSLRSASqrtTwoLen * BN_BITS2; + assert(sqrt2_bits == (int)BN_num_bits(sqrt2)); + if (sqrt2_bits > prime_bits) { + // For key sizes up to 3072 (prime_bits = 1536), this is exactly + // ⌊2^(prime_bits-1)Γ—βˆš2βŒ‹. + if (!BN_rshift(sqrt2, sqrt2, sqrt2_bits - prime_bits)) { + goto bn_err; + } + } else if (prime_bits > sqrt2_bits) { + // For key sizes beyond 3072, this is approximate. We err towards retrying + // to ensure our key is the right size and round up. + if (!BN_add_word(sqrt2, 1) || + !BN_lshift(sqrt2, sqrt2, prime_bits - sqrt2_bits)) { + goto bn_err; + } + } + assert(prime_bits == (int)BN_num_bits(sqrt2)); + + 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) || + !generate_prime(rsa->q, prime_bits, rsa->e, rsa->p, sqrt2, + pow2_prime_bits_100, ctx, cb) || + !BN_GENCB_call(cb, 3, 1)) { + goto bn_err; + } + + if (BN_cmp(rsa->p, rsa->q) < 0) { + BIGNUM *tmp = rsa->p; + rsa->p = rsa->q; + rsa->q = tmp; + } + + // Calculate d = e^(-1) (mod lcm(p-1, q-1)), per FIPS 186-4. This differs + // from typical RSA implementations which use (p-1)*(q-1). + // + // Note this means the size of d might reveal information about p-1 and + // q-1. However, we do operations with Chinese Remainder Theorem, so we only + // use d (mod p-1) and d (mod q-1) as exponents. Using a minimal totient + // does not affect those two values. + int no_inverse; + if (!bn_usub_consttime(pm1, rsa->p, BN_value_one()) || + !bn_usub_consttime(qm1, rsa->q, BN_value_one()) || + !bn_lcm_consttime(totient, pm1, qm1, ctx) || + !bn_mod_inverse_consttime(rsa->d, &no_inverse, rsa->e, totient, ctx)) { + goto bn_err; + } + + // Retry if |rsa->d| <= 2^|prime_bits|. See appendix B.3.1's guidance on + // values for d. + } while (BN_cmp(rsa->d, pow2_prime_bits) <= 0); + + if (// Calculate n. + !bn_mul_consttime(rsa->n, rsa->p, rsa->q, ctx) || + // Calculate d mod (p-1). + !bn_div_consttime(NULL, rsa->dmp1, rsa->d, pm1, ctx) || + // Calculate d mod (q-1) + !bn_div_consttime(NULL, rsa->dmq1, rsa->d, qm1, ctx)) { + goto bn_err; + } + bn_set_minimal_width(rsa->n); + + // Sanity-check that |rsa->n| has the specified size. This is implied by + // |generate_prime|'s bounds. + if (BN_num_bits(rsa->n) != (unsigned)bits) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + // Call |freeze_private_key| to compute the inverse of q mod p, by way of + // |rsa->mont_p|. + if (!freeze_private_key(rsa, ctx)) { + goto bn_err; + } + + // The key generation process is complex and thus error-prone. It could be + // disastrous to generate and then use a bad key so double-check that the key + // makes sense. + if (!RSA_check_key(rsa)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INTERNAL_ERROR); + goto err; + } + + ret = 1; + +bn_err: + if (!ret) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + } +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + 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. + if (bits != 2048 && bits != 3072) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + return 0; + } + + BIGNUM *e = BN_new(); + int ret = e != NULL && + BN_set_word(e, RSA_F4) && + RSA_generate_key_ex(rsa, bits, e, cb) && + RSA_check_fips(rsa); + BN_free(e); + return ret; +} + +DEFINE_METHOD_FUNCTION(RSA_METHOD, RSA_default_method) { + // All of the methods are NULL to make it easier for the compiler/linker to + // drop unused functions. The wrapper functions will select the appropriate + // |rsa_default_*| implementation. + OPENSSL_memset(out, 0, sizeof(RSA_METHOD)); + out->common.is_static = 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back new file mode 100644 index 0000000..94fb75c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back @@ -0,0 +1,1344 @@ +/* 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 "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" +#include "../delocate.h" + + +static int check_modulus_and_exponent_sizes(const RSA *rsa) { + unsigned rsa_bits = BN_num_bits(rsa->n); + + if (rsa_bits > 16 * 1024) { + OPENSSL_PUT_ERROR(RSA, RSA_R_MODULUS_TOO_LARGE); + return 0; + } + + // Mitigate DoS attacks by limiting the exponent size. 33 bits was chosen as + // the limit based on the recommendations in [1] and [2]. Windows CryptoAPI + // doesn't support values larger than 32 bits [3], so it is unlikely that + // exponents larger than 32 bits are being used for anything Windows commonly + // does. + // + // [1] https://www.imperialviolet.org/2012/03/16/rsae.html + // [2] https://www.imperialviolet.org/2012/03/17/rsados.html + // [3] https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx + static const unsigned kMaxExponentBits = 33; + + if (BN_num_bits(rsa->e) > kMaxExponentBits) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_E_VALUE); + return 0; + } + + // Verify |n > e|. Comparing |rsa_bits| to |kMaxExponentBits| is a small + // shortcut to comparing |n| and |e| directly. In reality, |kMaxExponentBits| + // is much smaller than the minimum RSA key size that any application should + // accept. + if (rsa_bits <= kMaxExponentBits) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + assert(BN_ucmp(rsa->n, rsa->e) > 0); + + return 1; +} + +static int ensure_fixed_copy(BIGNUM **out, const BIGNUM *in, int width) { + if (*out != NULL) { + return 1; + } + BIGNUM *copy = BN_dup(in); + if (copy == NULL || + !bn_resize_words(copy, width)) { + BN_free(copy); + return 0; + } + *out = copy; + CONSTTIME_SECRET(copy->d, sizeof(BN_ULONG) * width); + + return 1; +} + +// freeze_private_key finishes initializing |rsa|'s private key components. +// After this function has returned, |rsa| may not be changed. This is needed +// because |RSA| is a public struct and, additionally, OpenSSL 1.1.0 opaquified +// it wrong (see https://github.com/openssl/openssl/issues/5158). +static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { + CRYPTO_MUTEX_lock_read(&rsa->lock); + int frozen = rsa->private_key_frozen; + CRYPTO_MUTEX_unlock_read(&rsa->lock); + if (frozen) { + return 1; + } + + int ret = 0; + CRYPTO_MUTEX_lock_write(&rsa->lock); + if (rsa->private_key_frozen) { + ret = 1; + goto err; + } + + // Pre-compute various intermediate values, as well as copies of private + // exponents with correct widths. Note that other threads may concurrently + // read from |rsa->n|, |rsa->e|, etc., so any fixes must be in separate + // copies. We use |mont_n->N|, |mont_p->N|, and |mont_q->N| as copies of |n|, + // |p|, and |q| with the correct minimal widths. + + if (rsa->mont_n == NULL) { + rsa->mont_n = BN_MONT_CTX_new_for_modulus(rsa->n, ctx); + if (rsa->mont_n == NULL) { + goto err; + } + } + const BIGNUM *n_fixed = &rsa->mont_n->N; + + // The only public upper-bound of |rsa->d| is the bit length of |rsa->n|. The + // ASN.1 serialization of RSA private keys unfortunately leaks the byte length + // of |rsa->d|, but normalize it so we only leak it once, rather than per + // operation. + if (rsa->d != NULL && + !ensure_fixed_copy(&rsa->d_fixed, rsa->d, n_fixed->width)) { + goto err; + } + + 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_consttime(rsa->p, ctx); + if (rsa->mont_p == NULL) { + goto err; + } + } + const BIGNUM *p_fixed = &rsa->mont_p->N; + + if (rsa->mont_q == NULL) { + rsa->mont_q = BN_MONT_CTX_new_consttime(rsa->q, ctx); + if (rsa->mont_q == NULL) { + goto err; + } + } + const BIGNUM *q_fixed = &rsa->mont_q->N; + + if (rsa->dmp1 != NULL && rsa->dmq1 != NULL) { + // Key generation relies on this function to compute |iqmp|. + if (rsa->iqmp == NULL) { + BIGNUM *iqmp = BN_new(); + if (iqmp == NULL || + !bn_mod_inverse_secret_prime(iqmp, rsa->q, rsa->p, ctx, + rsa->mont_p)) { + BN_free(iqmp); + goto err; + } + rsa->iqmp = iqmp; + } + + // CRT components are only publicly bounded by their corresponding + // moduli's bit lengths. |rsa->iqmp| is unused outside of this one-time + // setup, so we do not compute a fixed-width version of it. + if (!ensure_fixed_copy(&rsa->dmp1_fixed, rsa->dmp1, p_fixed->width) || + !ensure_fixed_copy(&rsa->dmq1_fixed, rsa->dmq1, q_fixed->width)) { + goto err; + } + + // Compute |inv_small_mod_large_mont|. Note that it is always modulo the + // larger prime, independent of what is stored in |rsa->iqmp|. + if (rsa->inv_small_mod_large_mont == NULL) { + BIGNUM *inv_small_mod_large_mont = BN_new(); + int ok; + if (BN_cmp(rsa->p, rsa->q) < 0) { + ok = inv_small_mod_large_mont != NULL && + bn_mod_inverse_secret_prime(inv_small_mod_large_mont, rsa->p, + rsa->q, ctx, rsa->mont_q) && + BN_to_montgomery(inv_small_mod_large_mont, + inv_small_mod_large_mont, rsa->mont_q, ctx); + } else { + ok = inv_small_mod_large_mont != NULL && + BN_to_montgomery(inv_small_mod_large_mont, rsa->iqmp, + rsa->mont_p, ctx); + } + if (!ok) { + BN_free(inv_small_mod_large_mont); + 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); + } + } + } + + rsa->private_key_frozen = 1; + ret = 1; + +err: + CRYPTO_MUTEX_unlock_write(&rsa->lock); + return ret; +} + +size_t rsa_default_size(const RSA *rsa) { + return BN_num_bytes(rsa->n); +} + +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) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const unsigned rsa_size = RSA_size(rsa); + BIGNUM *f, *result; + uint8_t *buf = NULL; + BN_CTX *ctx = NULL; + int i, ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (!check_modulus_and_exponent_sizes(rsa)) { + return 0; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + buf = OPENSSL_malloc(rsa_size); + if (!f || !result || !buf) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + i = RSA_padding_add_PKCS1_type_2(buf, rsa_size, in, in_len); + break; + case RSA_PKCS1_OAEP_PADDING: + // Use the default parameters: SHA-1 for both hashes and no label. + i = RSA_padding_add_PKCS1_OAEP_mgf1(buf, rsa_size, in, in_len, + NULL, 0, NULL, NULL); + break; + case RSA_NO_PADDING: + i = RSA_padding_add_none(buf, rsa_size, in, in_len); + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (i <= 0) { + goto err; + } + + if (BN_bin2bn(buf, rsa_size, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + // usually the padding functions would catch this + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) || + !BN_mod_exp_mont(result, f, rsa->e, &rsa->mont_n->N, ctx, rsa->mont_n)) { + goto err; + } + + // put in leading 0 bytes if the number is less than the length of the + // modulus + if (!BN_bn2bin_padded(out, rsa_size, result)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + *out_len = rsa_size; + ret = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + OPENSSL_free(buf); + + return ret; +} + +// 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 +// none are free, the cache will be extended by a extra element and the new +// BN_BLINDING is returned. +// +// On success, the index of the assigned BN_BLINDING is written to +// |*index_used| and must be passed to |rsa_blinding_release| when finished. +static BN_BLINDING *rsa_blinding_get(RSA *rsa, unsigned *index_used, + BN_CTX *ctx) { + assert(ctx != NULL); + assert(rsa->mont_n != NULL); + + BN_BLINDING *ret = NULL; + CRYPTO_MUTEX_lock_write(&rsa->lock); + + 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 (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; + } + + // 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 (new_num_blindings > MAX_BLINDINGS_PER_RSA) { + new_num_blindings = MAX_BLINDINGS_PER_RSA; + } + assert(new_num_blindings > rsa->num_blindings); + + 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); + OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); + + 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; + } + } + 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 = new_num_blindings; + + goto out; + +err: + OPENSSL_free(new_blindings_inuse); + OPENSSL_free(new_blindings); + +out: + CRYPTO_MUTEX_unlock_write(&rsa->lock); + return ret; +} + +// rsa_blinding_release marks the cached BN_BLINDING at the given index as free +// for other threads to use. +static void rsa_blinding_release(RSA *rsa, BN_BLINDING *blinding, + unsigned blinding_index) { + if (blinding_index == MAX_BLINDINGS_PER_RSA) { + // This blinding wasn't cached. + BN_BLINDING_free(blinding); + return; + } + + CRYPTO_MUTEX_lock_write(&rsa->lock); + rsa->blindings_inuse[blinding_index] = 0; + CRYPTO_MUTEX_unlock_write(&rsa->lock); +} + +// signing +int rsa_default_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) { + const unsigned rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int i, ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + i = RSA_padding_add_PKCS1_type_1(buf, rsa_size, in, in_len); + break; + case RSA_NO_PADDING: + i = RSA_padding_add_none(buf, rsa_size, in, in_len); + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (i <= 0) { + goto err; + } + + if (!RSA_private_transform(rsa, out, buf, rsa_size)) { + goto err; + } + + CONSTTIME_DECLASSIFY(out, rsa_size); + *out_len = rsa_size; + ret = 1; + +err: + OPENSSL_free(buf); + + return ret; +} + +int rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding) { + const unsigned rsa_size = RSA_size(rsa); + uint8_t *buf = NULL; + int ret = 0; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (padding == RSA_NO_PADDING) { + buf = out; + } else { + // Allocate a temporary buffer to hold the padded plaintext. + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + if (in_len != rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN); + goto err; + } + + if (!RSA_private_transform(rsa, buf, in, rsa_size)) { + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + ret = + RSA_padding_check_PKCS1_type_2(out, out_len, rsa_size, buf, rsa_size); + break; + case RSA_PKCS1_OAEP_PADDING: + // Use the default parameters: SHA-1 for both hashes and no label. + ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, out_len, rsa_size, buf, + rsa_size, NULL, 0, NULL, NULL); + break; + case RSA_NO_PADDING: + *out_len = rsa_size; + ret = 1; + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + 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: + if (padding != RSA_NO_PADDING) { + OPENSSL_free(buf); + } + + return ret; +} + +static int mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + +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) { + if (rsa->n == NULL || rsa->e == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + const unsigned rsa_size = RSA_size(rsa); + BIGNUM *f, *result; + + if (max_out < rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (in_len != rsa_size) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN); + return 0; + } + + if (!check_modulus_and_exponent_sizes(rsa)) { + return 0; + } + + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + + int ret = 0; + uint8_t *buf = NULL; + + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + if (f == NULL || result == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (padding == RSA_NO_PADDING) { + buf = out; + } else { + // Allocate a temporary buffer to hold the padded plaintext. + buf = OPENSSL_malloc(rsa_size); + if (buf == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + if (BN_bin2bn(in, in_len, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) || + !BN_mod_exp_mont(result, f, rsa->e, &rsa->mont_n->N, ctx, rsa->mont_n)) { + goto err; + } + + if (!BN_bn2bin_padded(buf, rsa_size, result)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + switch (padding) { + case RSA_PKCS1_PADDING: + ret = + RSA_padding_check_PKCS1_type_1(out, out_len, rsa_size, buf, rsa_size); + break; + case RSA_NO_PADDING: + ret = 1; + *out_len = rsa_size; + break; + default: + OPENSSL_PUT_ERROR(RSA, RSA_R_UNKNOWN_PADDING_TYPE); + goto err; + } + + if (!ret) { + OPENSSL_PUT_ERROR(RSA, RSA_R_PADDING_CHECK_FAILED); + goto err; + } + +err: + BN_CTX_end(ctx); + BN_CTX_free(ctx); + if (buf != out) { + OPENSSL_free(buf); + } + return ret; +} + +int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len) { + if (rsa->n == NULL || rsa->d == NULL) { + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + + BIGNUM *f, *result; + BN_CTX *ctx = NULL; + unsigned blinding_index = 0; + BN_BLINDING *blinding = NULL; + int ret = 0; + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + f = BN_CTX_get(ctx); + result = BN_CTX_get(ctx); + + if (f == NULL || result == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (BN_bin2bn(in, len, f) == NULL) { + goto err; + } + + if (BN_ucmp(f, rsa->n) >= 0) { + // Usually the padding functions would catch this. + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); + goto err; + } + + if (!freeze_private_key(rsa, ctx)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + const int do_blinding = (rsa->flags & RSA_FLAG_NO_BLINDING) == 0; + + if (rsa->e == NULL && do_blinding) { + // We cannot do blinding or verification without |e|, and continuing without + // those countermeasures is dangerous. However, the Java/Android RSA API + // requires support for keys where only |d| and |n| (and not |e|) are known. + // The callers that require that bad behavior set |RSA_FLAG_NO_BLINDING|. + OPENSSL_PUT_ERROR(RSA, RSA_R_NO_PUBLIC_EXPONENT); + goto err; + } + + if (do_blinding) { + blinding = rsa_blinding_get(rsa, &blinding_index, ctx); + if (blinding == NULL) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!BN_BLINDING_convert(f, blinding, rsa->e, rsa->mont_n, ctx)) { + goto err; + } + } + + if (rsa->p != NULL && rsa->q != NULL && rsa->e != NULL && rsa->dmp1 != 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; + } + } else if (!BN_mod_exp_mont_consttime(result, f, rsa->d_fixed, rsa->n, ctx, + rsa->mont_n)) { + goto err; + } + + // Verify the result to protect against fault attacks as described in the + // 1997 paper "On the Importance of Checking Cryptographic Protocols for + // Faults" by Dan Boneh, Richard A. DeMillo, and Richard J. Lipton. Some + // implementations do this only when the CRT is used, but we do it in all + // cases. Section 6 of the aforementioned paper describes an attack that + // works when the CRT isn't used. That attack is much less likely to succeed + // than the CRT attack, but there have likely been improvements since 1997. + // + // This check is cheap assuming |e| is small; it almost always is. + if (rsa->e != NULL) { + BIGNUM *vrfy = BN_CTX_get(ctx); + if (vrfy == NULL || + !BN_mod_exp_mont(vrfy, result, rsa->e, rsa->n, ctx, rsa->mont_n) || + !BN_equal_consttime(vrfy, f)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + } + + if (do_blinding && + !BN_BLINDING_invert(result, blinding, rsa->mont_n, ctx)) { + goto err; + } + + // The computation should have left |result| as a maximally-wide number, so + // that it and serializing does not leak information about the magnitude of + // the result. + // + // 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); + goto err; + } + + ret = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + if (blinding != NULL) { + rsa_blinding_release(rsa, blinding, blinding_index); + } + + return ret; +} + +// mod_montgomery sets |r| to |I| mod |p|. |I| must already be fully reduced +// modulo |p| times |q|. It returns one on success and zero on error. +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. The caller should have checked + // this already. + if (!bn_less_than_montgomery_R(q, mont_p)) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + + if (// Reduce mod p with Montgomery reduction. This computes I * R^-1 mod p. + !BN_from_montgomery(r, I, mont_p, ctx) || + // Multiply by R^2 and do another Montgomery reduction to compute + // I * R^-1 * R^2 * R^-1 = I mod p. + !BN_to_montgomery(r, r, mont_p, ctx)) { + return 0; + } + + // By precomputing R^3 mod p (normally |BN_MONT_CTX| only uses R^2 mod p) and + // adjusting the API for |BN_mod_exp_mont_consttime|, we could instead compute + // I * R mod p here and save a reduction per prime. But this would require + // changing the RSAZ code and may not be worth it. Note that the RSAZ code + // uses a different radix, so it uses R' = 2^1044. There we'd actually want + // R^2 * R', and would futher benefit from a precomputed R'^2. It currently + // converts |mont_p->RR| to R'^2. + return 1; +} + +static int mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) { + assert(ctx != NULL); + + assert(rsa->n != NULL); + assert(rsa->e != NULL); + assert(rsa->d != NULL); + assert(rsa->p != NULL); + assert(rsa->q != NULL); + assert(rsa->dmp1 != NULL); + assert(rsa->dmq1 != NULL); + assert(rsa->iqmp != NULL); + + BIGNUM *r1, *m1; + int ret = 0; + + BN_CTX_start(ctx); + r1 = BN_CTX_get(ctx); + m1 = BN_CTX_get(ctx); + if (r1 == NULL || + m1 == NULL) { + goto err; + } + + if (!freeze_private_key(rsa, ctx)) { + goto err; + } + + // Implementing RSA with CRT in constant-time is sensitive to which prime is + // larger. Canonicalize fields so that |p| is the larger prime. + const BIGNUM *dmp1 = rsa->dmp1_fixed, *dmq1 = rsa->dmq1_fixed; + const BN_MONT_CTX *mont_p = rsa->mont_p, *mont_q = rsa->mont_q; + if (BN_cmp(rsa->p, rsa->q) < 0) { + mont_p = rsa->mont_q; + mont_q = rsa->mont_p; + dmp1 = rsa->dmq1_fixed; + dmq1 = rsa->dmp1_fixed; + } + + // Use the minimal-width versions of |n|, |p|, and |q|. Either works, but if + // someone gives us non-minimal values, these will be slightly more efficient + // on the non-Montgomery operations. + const BIGNUM *n = &rsa->mont_n->N; + const BIGNUM *p = &mont_p->N; + const BIGNUM *q = &mont_q->N; + + // This is a pre-condition for |mod_montgomery|. It was already checked by the + // caller. + assert(BN_ucmp(I, n) < 0); + + if (// |m1| is the result modulo |q|. + !mod_montgomery(r1, I, q, mont_q, p, ctx) || + !BN_mod_exp_mont_consttime(m1, r1, dmq1, q, ctx, mont_q) || + // |r0| is the result modulo |p|. + !mod_montgomery(r1, I, p, mont_p, q, ctx) || + !BN_mod_exp_mont_consttime(r0, r1, dmp1, p, ctx, mont_p) || + // Compute r0 = r0 - m1 mod p. |p| is the larger prime, so |m1| is already + // fully reduced mod |p|. + !bn_mod_sub_consttime(r0, r0, m1, p, ctx) || + // r0 = r0 * iqmp mod p. We use Montgomery multiplication to compute this + // in constant time. |inv_small_mod_large_mont| is in Montgomery form and + // r0 is not, so the result is taken out of Montgomery form. + !BN_mod_mul_montgomery(r0, r0, rsa->inv_small_mod_large_mont, mont_p, + ctx) || + // r0 = r0 * q + m1 gives the final result. Reducing modulo q gives m1, so + // it is correct mod p. Reducing modulo p gives (r0-m1)*iqmp*q + m1 = r0, + // so it is correct mod q. Finally, the result is bounded by [m1, n + m1), + // and the result is at least |m1|, so this must be the unique answer in + // [0, n). + !bn_mul_consttime(r0, r0, q, ctx) || + !bn_uadd_consttime(r0, r0, m1) || + // The result should be bounded by |n|, but fixed-width operations may + // bound the width slightly higher, so fix it. + !bn_resize_words(r0, n->width)) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int ensure_bignum(BIGNUM **out) { + if (*out == NULL) { + *out = BN_new(); + } + return *out != NULL; +} + +// kBoringSSLRSASqrtTwo is the BIGNUM representation of ⌊2ΒΉβ΅Β³β΅Γ—βˆš2βŒ‹. This is +// chosen to give enough precision for 3072-bit RSA, the largest key size FIPS +// specifies. Key sizes beyond this will round up. +// +// To verify this number, check that nΒ² < 2³⁰⁷¹ < (n+1)Β², where n is value +// represented here. Note the components are listed in little-endian order. Here +// is some sample Python code to check: +// +// >>> TOBN = lambda a, b: a << 32 | b +// >>> l = [ ] +// >>> n = sum(a * 2**(64*i) for i, a in enumerate(l)) +// >>> n**2 < 2**3071 < (n+1)**2 +// True +const BN_ULONG kBoringSSLRSASqrtTwo[] = { + TOBN(0xdea06241, 0xf7aa81c2), TOBN(0xf6a1be3f, 0xca221307), + TOBN(0x332a5e9f, 0x7bda1ebf), TOBN(0x0104dc01, 0xfe32352f), + TOBN(0xb8cf341b, 0x6f8236c7), TOBN(0x4264dabc, 0xd528b651), + TOBN(0xf4d3a02c, 0xebc93e0c), TOBN(0x81394ab6, 0xd8fd0efd), + TOBN(0xeaa4a089, 0x9040ca4a), TOBN(0xf52f120f, 0x836e582e), + TOBN(0xcb2a6343, 0x31f3c84d), TOBN(0xc6d5a8a3, 0x8bb7e9dc), + TOBN(0x460abc72, 0x2f7c4e33), TOBN(0xcab1bc91, 0x1688458a), + TOBN(0x53059c60, 0x11bc337b), TOBN(0xd2202e87, 0x42af1f4e), + TOBN(0x78048736, 0x3dfa2768), TOBN(0x0f74a85e, 0x439c7b4a), + TOBN(0xa8b1fe6f, 0xdc83db39), TOBN(0x4afc8304, 0x3ab8a2c3), + TOBN(0xed17ac85, 0x83339915), TOBN(0x1d6f60ba, 0x893ba84c), + TOBN(0x597d89b3, 0x754abe9f), TOBN(0xb504f333, 0xf9de6484), +}; +const size_t kBoringSSLRSASqrtTwoLen = OPENSSL_ARRAY_SIZE(kBoringSSLRSASqrtTwo); + +// generate_prime sets |out| to a prime with length |bits| such that |out|-1 is +// 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, + BN_GENCB *cb) { + if (bits < 128 || (bits % BN_BITS2) != 0) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; + } + assert(BN_is_pow2(pow2_bits_100)); + assert(BN_is_bit_set(pow2_bits_100, bits - 100)); + + // See FIPS 186-4 appendix B.3.3, steps 4 and 5. Note |bits| here is nlen/2. + + // 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 * 8 : bits * 5; + + int ret = 0, tries = 0, rand_tries = 0; + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + for (;;) { + // Generate a random number of length |bits| where the bottom bit is set + // (steps 4.2, 4.3, 5.2 and 5.3) and the top bit is set (implied by the + // bound checked below in steps 4.4 and 5.5). + if (!BN_rand(out, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD) || + !BN_GENCB_call(cb, BN_GENCB_GENERATED, rand_tries++)) { + goto err; + } + + if (p != NULL) { + // If |p| and |out| are too close, try again (step 5.4). + if (!bn_abs_sub_consttime(tmp, out, p, ctx)) { + goto err; + } + if (BN_cmp(tmp, pow2_bits_100) <= 0) { + continue; + } + } + + // If out < 2^(bits-1)Γ—βˆš2, try again (steps 4.4 and 5.5). This is equivalent + // to out <= ⌊2^(bits-1)Γ—βˆš2βŒ‹, or out <= sqrt2 for FIPS key sizes. + // + // For larger keys, the comparison is approximate, leaning towards + // retrying. That is, we reject a negligible fraction of primes that are + // within the FIPS bound, but we will never accept a prime outside the + // bound, ensuring the resulting RSA key is the right size. + if (BN_cmp(out, sqrt2) <= 0) { + continue; + } + + // RSA key generation's bottleneck is discarding composites. If it fails + // 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; + if (!BN_sub(tmp, out, BN_value_one()) || + !bn_is_relatively_prime(&relatively_prime, tmp, e, ctx)) { + goto err; + } + 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_for_generation, ctx, 0, cb)) { + goto err; + } + if (is_probable_prime) { + ret = 1; + goto err; + } + } + } + + // If we've tried too many times to find a prime, abort (steps 4.7 and + // 5.8). + tries++; + if (tries >= limit) { + OPENSSL_PUT_ERROR(RSA, RSA_R_TOO_MANY_ITERATIONS); + goto err; + } + if (!BN_GENCB_call(cb, 2, tries)) { + goto err; + } + } + +err: + BN_CTX_end(ctx); + return ret; +} + +// 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. + + // Always generate RSA keys which are a multiple of 128 bits. Round |bits| + // down as needed. + bits &= ~127; + + // Reject excessively small keys. + if (bits < 256) { + OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); + return 0; + } + + // Reject excessively large public exponents. Windows CryptoAPI and Go don't + // support values larger than 32 bits, so match their limits for generating + // keys. (|check_modulus_and_exponent_sizes| uses a slightly more conservative + // value, but we don't need to support generating such keys.) + // https://github.com/golang/go/issues/3161 + // https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx + if (BN_num_bits(e_value) > 32) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_E_VALUE); + return 0; + } + + int ret = 0; + int prime_bits = bits / 2; + BN_CTX *ctx = BN_CTX_new(); + if (ctx == NULL) { + goto bn_err; + } + BN_CTX_start(ctx); + BIGNUM *totient = BN_CTX_get(ctx); + BIGNUM *pm1 = BN_CTX_get(ctx); + BIGNUM *qm1 = BN_CTX_get(ctx); + BIGNUM *sqrt2 = BN_CTX_get(ctx); + BIGNUM *pow2_prime_bits_100 = BN_CTX_get(ctx); + BIGNUM *pow2_prime_bits = BN_CTX_get(ctx); + if (totient == NULL || pm1 == NULL || qm1 == NULL || sqrt2 == NULL || + pow2_prime_bits_100 == NULL || pow2_prime_bits == NULL || + !BN_set_bit(pow2_prime_bits_100, prime_bits - 100) || + !BN_set_bit(pow2_prime_bits, prime_bits)) { + goto bn_err; + } + + // We need the RSA components non-NULL. + if (!ensure_bignum(&rsa->n) || + !ensure_bignum(&rsa->d) || + !ensure_bignum(&rsa->e) || + !ensure_bignum(&rsa->p) || + !ensure_bignum(&rsa->q) || + !ensure_bignum(&rsa->dmp1) || + !ensure_bignum(&rsa->dmq1)) { + goto bn_err; + } + + if (!BN_copy(rsa->e, e_value)) { + goto bn_err; + } + + // Compute sqrt2 >= ⌊2^(prime_bits-1)Γ—βˆš2βŒ‹. + if (!bn_set_words(sqrt2, kBoringSSLRSASqrtTwo, kBoringSSLRSASqrtTwoLen)) { + goto bn_err; + } + int sqrt2_bits = kBoringSSLRSASqrtTwoLen * BN_BITS2; + assert(sqrt2_bits == (int)BN_num_bits(sqrt2)); + if (sqrt2_bits > prime_bits) { + // For key sizes up to 3072 (prime_bits = 1536), this is exactly + // ⌊2^(prime_bits-1)Γ—βˆš2βŒ‹. + if (!BN_rshift(sqrt2, sqrt2, sqrt2_bits - prime_bits)) { + goto bn_err; + } + } else if (prime_bits > sqrt2_bits) { + // For key sizes beyond 3072, this is approximate. We err towards retrying + // to ensure our key is the right size and round up. + if (!BN_add_word(sqrt2, 1) || + !BN_lshift(sqrt2, sqrt2, prime_bits - sqrt2_bits)) { + goto bn_err; + } + } + assert(prime_bits == (int)BN_num_bits(sqrt2)); + + 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) || + !generate_prime(rsa->q, prime_bits, rsa->e, rsa->p, sqrt2, + pow2_prime_bits_100, ctx, cb) || + !BN_GENCB_call(cb, 3, 1)) { + goto bn_err; + } + + if (BN_cmp(rsa->p, rsa->q) < 0) { + BIGNUM *tmp = rsa->p; + rsa->p = rsa->q; + rsa->q = tmp; + } + + // Calculate d = e^(-1) (mod lcm(p-1, q-1)), per FIPS 186-4. This differs + // from typical RSA implementations which use (p-1)*(q-1). + // + // Note this means the size of d might reveal information about p-1 and + // q-1. However, we do operations with Chinese Remainder Theorem, so we only + // use d (mod p-1) and d (mod q-1) as exponents. Using a minimal totient + // does not affect those two values. + int no_inverse; + if (!bn_usub_consttime(pm1, rsa->p, BN_value_one()) || + !bn_usub_consttime(qm1, rsa->q, BN_value_one()) || + !bn_lcm_consttime(totient, pm1, qm1, ctx) || + !bn_mod_inverse_consttime(rsa->d, &no_inverse, rsa->e, totient, ctx)) { + goto bn_err; + } + + // Retry if |rsa->d| <= 2^|prime_bits|. See appendix B.3.1's guidance on + // values for d. + } while (BN_cmp(rsa->d, pow2_prime_bits) <= 0); + + if (// Calculate n. + !bn_mul_consttime(rsa->n, rsa->p, rsa->q, ctx) || + // Calculate d mod (p-1). + !bn_div_consttime(NULL, rsa->dmp1, rsa->d, pm1, ctx) || + // Calculate d mod (q-1) + !bn_div_consttime(NULL, rsa->dmq1, rsa->d, qm1, ctx)) { + goto bn_err; + } + bn_set_minimal_width(rsa->n); + + // Sanity-check that |rsa->n| has the specified size. This is implied by + // |generate_prime|'s bounds. + if (BN_num_bits(rsa->n) != (unsigned)bits) { + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + goto err; + } + + // Call |freeze_private_key| to compute the inverse of q mod p, by way of + // |rsa->mont_p|. + if (!freeze_private_key(rsa, ctx)) { + goto bn_err; + } + + // The key generation process is complex and thus error-prone. It could be + // disastrous to generate and then use a bad key so double-check that the key + // makes sense. + if (!RSA_check_key(rsa)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_INTERNAL_ERROR); + goto err; + } + + ret = 1; + +bn_err: + if (!ret) { + OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN); + } +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + 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. + if (bits != 2048 && bits != 3072) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + return 0; + } + + BIGNUM *e = BN_new(); + int ret = e != NULL && + BN_set_word(e, RSA_F4) && + RSA_generate_key_ex(rsa, bits, e, cb) && + RSA_check_fips(rsa); + BN_free(e); + return ret; +} + +DEFINE_METHOD_FUNCTION(RSA_METHOD, RSA_default_method) { + // All of the methods are NULL to make it easier for the compiler/linker to + // drop unused functions. The wrapper functions will select the appropriate + // |rsa_default_*| implementation. + OPENSSL_memset(out, 0, sizeof(RSA_METHOD)); + out->common.is_static = 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c new file mode 100644 index 0000000..ab5c732 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c @@ -0,0 +1,654 @@ +/* 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 +#include + +#include "../../internal.h" +#include "../ec/internal.h" +#include "../rand/internal.h" + + +// MSVC wants to put a NUL byte at the end of non-char arrays and so cannot +// 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++) { + 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) { + fprintf(stderr, "%s failed.\nExpected: ", name); + hexdump(expected, expected_len); + fprintf(stderr, "\nCalculated: "); + hexdump(actual, expected_len); + fprintf(stderr, "\n"); + fflush(stderr); + return 0; + } + return 1; +} + +static int set_bignum(BIGNUM **out, const uint8_t *in, size_t len) { + *out = BN_bin2bn(in, len, NULL); + return *out != NULL; +} + +static RSA *self_test_rsa_key(void) { + static const uint8_t kN[] = { + 0xd3, 0x3a, 0x62, 0x9f, 0x07, 0x77, 0xb0, 0x18, 0xf3, 0xff, 0xfe, 0xcc, + 0xc9, 0xa2, 0xc2, 0x3a, 0xa6, 0x1d, 0xd8, 0xf0, 0x26, 0x5b, 0x38, 0x90, + 0x17, 0x48, 0x15, 0xce, 0x21, 0xcd, 0xd6, 0x62, 0x99, 0xe2, 0xd7, 0xda, + 0x40, 0x80, 0x3c, 0xad, 0x18, 0xb7, 0x26, 0xe9, 0x30, 0x8a, 0x23, 0x3f, + 0x68, 0x9a, 0x9c, 0x31, 0x34, 0x91, 0x99, 0x06, 0x11, 0x36, 0xb2, 0x9e, + 0x3a, 0xd0, 0xbc, 0xb9, 0x93, 0x4e, 0xb8, 0x72, 0xa1, 0x9f, 0xb6, 0x8c, + 0xd5, 0x17, 0x1f, 0x7e, 0xaa, 0x75, 0xbb, 0xdf, 0xa1, 0x70, 0x48, 0xc4, + 0xec, 0x9a, 0x51, 0xed, 0x41, 0xc9, 0x74, 0xc0, 0x3e, 0x1e, 0x85, 0x2f, + 0xbe, 0x34, 0xc7, 0x65, 0x34, 0x8b, 0x4d, 0x55, 0x4b, 0xe1, 0x45, 0x54, + 0x0d, 0x75, 0x7e, 0x89, 0x4d, 0x0c, 0xf6, 0x33, 0xe5, 0xfc, 0xfb, 0x56, + 0x1b, 0xf2, 0x39, 0x9d, 0xe0, 0xff, 0x55, 0xcf, 0x02, 0x05, 0xb9, 0x74, + 0xd2, 0x91, 0xfc, 0x87, 0xe1, 0xbb, 0x97, 0x2a, 0xe4, 0xdd, 0x20, 0xc0, + 0x38, 0x47, 0xc0, 0x76, 0x3f, 0xa1, 0x9b, 0x5c, 0x20, 0xff, 0xff, 0xc7, + 0x49, 0x3b, 0x4c, 0xaf, 0x99, 0xa6, 0x3e, 0x82, 0x5c, 0x58, 0x27, 0xce, + 0x01, 0x03, 0xc3, 0x16, 0x35, 0x20, 0xe9, 0xf0, 0x15, 0x7a, 0x41, 0xd5, + 0x1f, 0x52, 0xea, 0xdf, 0xad, 0x4c, 0xbb, 0x0d, 0xcb, 0x04, 0x91, 0xb0, + 0x95, 0xa8, 0xce, 0x25, 0xfd, 0xd2, 0x62, 0x47, 0x77, 0xee, 0x13, 0xf1, + 0x48, 0x72, 0x9e, 0xd9, 0x2d, 0xe6, 0x5f, 0xa4, 0xc6, 0x9e, 0x5a, 0xb2, + 0xc6, 0xa2, 0xf7, 0x0a, 0x16, 0x17, 0xae, 0x6b, 0x1c, 0x30, 0x7c, 0x63, + 0x08, 0x83, 0xe7, 0x43, 0xec, 0x54, 0x5e, 0x2c, 0x08, 0x0b, 0x5e, 0x46, + 0xa7, 0x10, 0x93, 0x43, 0x53, 0x4e, 0xe3, 0x16, 0x73, 0x55, 0xce, 0xf2, + 0x94, 0xc0, 0xbe, 0xb3, + }; + static const uint8_t kE[] = {0x01, 0x00, 0x01}; // 65537 + static const uint8_t kD[] = { + 0x2f, 0x2c, 0x1e, 0xd2, 0x3d, 0x2c, 0xb1, 0x9b, 0x21, 0x02, 0xce, 0xb8, + 0x95, 0x5f, 0x4f, 0xd9, 0x21, 0x38, 0x11, 0x36, 0xb0, 0x9a, 0x36, 0xab, + 0x97, 0x47, 0x75, 0xf7, 0x2e, 0xfd, 0x75, 0x1f, 0x58, 0x16, 0x9c, 0xf6, + 0x14, 0xe9, 0x8e, 0xa3, 0x69, 0x9d, 0x9d, 0x86, 0xfe, 0x5c, 0x1b, 0x3b, + 0x11, 0xf5, 0x55, 0x64, 0x77, 0xc4, 0xfc, 0x53, 0xaa, 0x8c, 0x78, 0x9f, + 0x75, 0xab, 0x20, 0x3a, 0xa1, 0x77, 0x37, 0x22, 0x02, 0x8e, 0x54, 0x8a, + 0x67, 0x1c, 0x5e, 0xe0, 0x3e, 0xd9, 0x44, 0x37, 0xd1, 0x29, 0xee, 0x56, + 0x6c, 0x30, 0x9a, 0x93, 0x4d, 0xd9, 0xdb, 0xc5, 0x03, 0x1a, 0x75, 0xcc, + 0x0f, 0xc2, 0x61, 0xb5, 0x6c, 0x62, 0x9f, 0xc6, 0xa8, 0xc7, 0x8a, 0x60, + 0x17, 0x11, 0x62, 0x4c, 0xef, 0x74, 0x31, 0x97, 0xad, 0x89, 0x2d, 0xe8, + 0x31, 0x1d, 0x8b, 0x58, 0x82, 0xe3, 0x03, 0x1a, 0x6b, 0xdf, 0x3f, 0x3e, + 0xa4, 0x27, 0x19, 0xef, 0x46, 0x7a, 0x90, 0xdf, 0xa7, 0xe7, 0xc9, 0x66, + 0xab, 0x41, 0x1d, 0x65, 0x78, 0x1c, 0x18, 0x40, 0x5c, 0xd6, 0x87, 0xb5, + 0xea, 0x29, 0x44, 0xb3, 0xf5, 0xb3, 0xd2, 0x4f, 0xce, 0x88, 0x78, 0x49, + 0x27, 0x4e, 0x0b, 0x30, 0x85, 0xfb, 0x73, 0xfd, 0x8b, 0x32, 0x15, 0xee, + 0x1f, 0xc9, 0x0e, 0x89, 0xb9, 0x43, 0x2f, 0xe9, 0x60, 0x8d, 0xda, 0xae, + 0x2b, 0x30, 0x99, 0xee, 0x88, 0x81, 0x20, 0x7b, 0x4a, 0xc3, 0x18, 0xf2, + 0x94, 0x02, 0x79, 0x94, 0xaa, 0x65, 0xd9, 0x1b, 0x45, 0x2a, 0xac, 0x6e, + 0x30, 0x48, 0x57, 0xea, 0xbe, 0x79, 0x7d, 0xfc, 0x67, 0xaa, 0x47, 0xc0, + 0xf7, 0x52, 0xfd, 0x0b, 0x63, 0x4e, 0x3d, 0x2e, 0xcc, 0x36, 0xa0, 0xdb, + 0x92, 0x0b, 0xa9, 0x1b, 0xeb, 0xc2, 0xd5, 0x08, 0xd3, 0x85, 0x87, 0xf8, + 0x5d, 0x1a, 0xf6, 0xc1, + }; + static const uint8_t kP[] = { + 0xf7, 0x06, 0xa3, 0x98, 0x8a, 0x52, 0xf8, 0x63, 0x68, 0x27, 0x4f, 0x68, + 0x7f, 0x34, 0xec, 0x8e, 0x5d, 0xf8, 0x30, 0x92, 0xb3, 0x62, 0x4c, 0xeb, + 0xdb, 0x19, 0x6b, 0x09, 0xc5, 0xa3, 0xf0, 0xbb, 0xff, 0x0f, 0xc2, 0xd4, + 0x9b, 0xc9, 0x54, 0x4f, 0xb9, 0xf9, 0xe1, 0x4c, 0xf0, 0xe3, 0x4c, 0x90, + 0xda, 0x7a, 0x01, 0xc2, 0x9f, 0xc4, 0xc8, 0x8e, 0xb1, 0x1e, 0x93, 0x75, + 0x75, 0xc6, 0x13, 0x25, 0xc3, 0xee, 0x3b, 0xcc, 0xb8, 0x72, 0x6c, 0x49, + 0xb0, 0x09, 0xfb, 0xab, 0x44, 0xeb, 0x4d, 0x40, 0xf0, 0x61, 0x6b, 0xe5, + 0xe6, 0xfe, 0x3e, 0x0a, 0x77, 0x26, 0x39, 0x76, 0x3d, 0x4c, 0x3e, 0x9b, + 0x5b, 0xc0, 0xaf, 0xa2, 0x58, 0x76, 0xb0, 0xe9, 0xda, 0x7f, 0x0e, 0x78, + 0xc9, 0x76, 0x49, 0x5c, 0xfa, 0xb3, 0xb0, 0x15, 0x4b, 0x41, 0xc7, 0x27, + 0xa4, 0x75, 0x28, 0x5c, 0x30, 0x69, 0x50, 0x29, + }; + static const uint8_t kQ[] = { + 0xda, 0xe6, 0xd2, 0xbb, 0x44, 0xff, 0x4f, 0xdf, 0x57, 0xc1, 0x11, 0xa3, + 0x51, 0xba, 0x17, 0x89, 0x4c, 0x01, 0xc0, 0x0c, 0x97, 0x34, 0x50, 0xcf, + 0x32, 0x1e, 0xc0, 0xbd, 0x7b, 0x35, 0xb5, 0x6a, 0x26, 0xcc, 0xea, 0x4c, + 0x8e, 0x87, 0x4a, 0x67, 0x8b, 0xd3, 0xe5, 0x4f, 0x3a, 0x60, 0x48, 0x59, + 0x04, 0x93, 0x39, 0xd7, 0x7c, 0xfb, 0x19, 0x1a, 0x34, 0xd5, 0xe8, 0xaf, + 0xe7, 0x22, 0x2c, 0x0d, 0xc2, 0x91, 0x69, 0xb6, 0xe9, 0x2a, 0xe9, 0x1c, + 0x4c, 0x6e, 0x8f, 0x40, 0xf5, 0xa8, 0x3e, 0x82, 0x69, 0x69, 0xbe, 0x9f, + 0x7d, 0x5c, 0x7f, 0x92, 0x78, 0x17, 0xa3, 0x6d, 0x41, 0x2d, 0x72, 0xed, + 0x3f, 0x71, 0xfa, 0x97, 0xb4, 0x63, 0xe4, 0x4f, 0xd9, 0x46, 0x03, 0xfb, + 0x00, 0xeb, 0x30, 0x70, 0xb9, 0x51, 0xd9, 0x0a, 0xd2, 0xf8, 0x50, 0xd4, + 0xfb, 0x43, 0x84, 0xf8, 0xac, 0x58, 0xc3, 0x7b, + }; + static const uint8_t kDModPMinusOne[] = { + 0xf5, 0x50, 0x8f, 0x88, 0x7d, 0xdd, 0xb5, 0xb4, 0x2a, 0x8b, 0xd7, 0x4d, + 0x23, 0xfe, 0xaf, 0xe9, 0x16, 0x22, 0xd2, 0x41, 0xed, 0x88, 0xf2, 0x70, + 0xcb, 0x4d, 0xeb, 0xc1, 0x71, 0x97, 0xc4, 0x0b, 0x3e, 0x5a, 0x2d, 0x96, + 0xab, 0xfa, 0xfd, 0x12, 0x8b, 0xd3, 0x3e, 0x4e, 0x05, 0x6f, 0x04, 0xeb, + 0x59, 0x3c, 0x0e, 0xa1, 0x73, 0xbe, 0x9d, 0x99, 0x2f, 0x05, 0xf9, 0x54, + 0x8d, 0x98, 0x1e, 0x0d, 0xc4, 0x0c, 0xc3, 0x30, 0x23, 0xff, 0xe5, 0xd0, + 0x2b, 0xd5, 0x4e, 0x2b, 0xa0, 0xae, 0xb8, 0x32, 0x84, 0x45, 0x8b, 0x3c, + 0x6d, 0xf0, 0x10, 0x36, 0x9e, 0x6a, 0xc4, 0x67, 0xca, 0xa9, 0xfc, 0x06, + 0x96, 0xd0, 0xbc, 0xda, 0xd1, 0x55, 0x55, 0x8d, 0x77, 0x21, 0xf4, 0x82, + 0x39, 0x37, 0x91, 0xd5, 0x97, 0x56, 0x78, 0xc8, 0x3c, 0xcb, 0x5e, 0xf6, + 0xdc, 0x58, 0x48, 0xb3, 0x7c, 0x94, 0x29, 0x39, + }; + static const uint8_t kDModQMinusOne[] = { + 0x64, 0x65, 0xbd, 0x7d, 0x1a, 0x96, 0x26, 0xa1, 0xfe, 0xf3, 0x94, 0x0d, + 0x5d, 0xec, 0x85, 0xe2, 0xf8, 0xb3, 0x4c, 0xcb, 0xf9, 0x85, 0x8b, 0x12, + 0x9c, 0xa0, 0x32, 0x32, 0x35, 0x92, 0x5a, 0x94, 0x47, 0x1b, 0x70, 0xd2, + 0x90, 0x04, 0x49, 0x01, 0xd8, 0xc5, 0xe4, 0xc4, 0x43, 0xb7, 0xe9, 0x36, + 0xba, 0xbc, 0x73, 0xa8, 0xfb, 0xaf, 0x86, 0xc1, 0xd8, 0x3d, 0xcb, 0xac, + 0xf1, 0xcb, 0x60, 0x7d, 0x27, 0x21, 0xde, 0x64, 0x7f, 0xe8, 0xa8, 0x65, + 0xcc, 0x40, 0x60, 0xff, 0xa0, 0x2b, 0xfc, 0x0f, 0x80, 0x1d, 0x79, 0xca, + 0x58, 0x8a, 0xd6, 0x0f, 0xed, 0x78, 0x9a, 0x02, 0x00, 0x04, 0xc2, 0x53, + 0x41, 0xe8, 0x1a, 0xd0, 0xfd, 0x71, 0x5b, 0x43, 0xac, 0x19, 0x4a, 0xb6, + 0x12, 0xa3, 0xcb, 0xe1, 0xc7, 0x7d, 0x5c, 0x98, 0x74, 0x4e, 0x63, 0x74, + 0x6b, 0x91, 0x7a, 0x29, 0x3b, 0x92, 0xb2, 0x85, + }; + static const uint8_t kQInverseModP[] = { + 0xd0, 0xde, 0x19, 0xda, 0x1e, 0xa2, 0xd8, 0x8f, 0x1c, 0x92, 0x73, 0xb0, + 0xc9, 0x90, 0xc7, 0xf5, 0xec, 0xc5, 0x89, 0x01, 0x05, 0x78, 0x11, 0x2d, + 0x74, 0x34, 0x44, 0xad, 0xd5, 0xf7, 0xa4, 0xfe, 0x9f, 0x25, 0x4d, 0x0b, + 0x92, 0xe3, 0xb8, 0x7d, 0xd3, 0xfd, 0xa5, 0xca, 0x95, 0x60, 0xa3, 0xf9, + 0x55, 0x42, 0x14, 0xb2, 0x45, 0x51, 0x9f, 0x73, 0x88, 0x43, 0x8a, 0xd1, + 0x65, 0x9e, 0xd1, 0xf7, 0x82, 0x2a, 0x2a, 0x8d, 0x70, 0x56, 0xe3, 0xef, + 0xc9, 0x0e, 0x2a, 0x2c, 0x15, 0xaf, 0x7f, 0x97, 0x81, 0x66, 0xf3, 0xb5, + 0x00, 0xa9, 0x26, 0xcc, 0x1e, 0xc2, 0x98, 0xdd, 0xd3, 0x37, 0x06, 0x79, + 0xb3, 0x60, 0x58, 0x79, 0x99, 0x3f, 0xa3, 0x15, 0x1f, 0x31, 0xe3, 0x11, + 0x88, 0x4c, 0x35, 0x57, 0xfa, 0x79, 0xd7, 0xd8, 0x72, 0xee, 0x73, 0x95, + 0x89, 0x29, 0xc7, 0x05, 0x27, 0x68, 0x90, 0x15, + }; + + RSA *rsa = RSA_new(); + if (rsa == NULL || + !set_bignum(&rsa->n, kN, sizeof(kN)) || + !set_bignum(&rsa->e, kE, sizeof(kE)) || + !set_bignum(&rsa->d, kD, sizeof(kD)) || + !set_bignum(&rsa->p, kP, sizeof(kP)) || + !set_bignum(&rsa->q, kQ, sizeof(kQ)) || + !set_bignum(&rsa->dmp1, kDModPMinusOne, sizeof(kDModPMinusOne)) || + !set_bignum(&rsa->dmq1, kDModQMinusOne, sizeof(kDModQMinusOne)) || + !set_bignum(&rsa->iqmp, kQInverseModP, sizeof(kQInverseModP))) { + RSA_free(rsa); + return NULL; + } + + return rsa; +} + +static EC_KEY *self_test_ecdsa_key(void) { + static const uint8_t kQx[] = { + 0xc8, 0x15, 0x61, 0xec, 0xf2, 0xe5, 0x4e, 0xde, 0xfe, 0x66, 0x17, + 0xdb, 0x1c, 0x7a, 0x34, 0xa7, 0x07, 0x44, 0xdd, 0xb2, 0x61, 0xf2, + 0x69, 0xb8, 0x3d, 0xac, 0xfc, 0xd2, 0xad, 0xe5, 0xa6, 0x81, + }; + static const uint8_t kQy[] = { + 0xe0, 0xe2, 0xaf, 0xa3, 0xf9, 0xb6, 0xab, 0xe4, 0xc6, 0x98, 0xef, + 0x64, 0x95, 0xf1, 0xbe, 0x49, 0xa3, 0x19, 0x6c, 0x50, 0x56, 0xac, + 0xb3, 0x76, 0x3f, 0xe4, 0x50, 0x7e, 0xec, 0x59, 0x6e, 0x88, + }; + static const uint8_t kD[] = { + 0xc6, 0xc1, 0xaa, 0xda, 0x15, 0xb0, 0x76, 0x61, 0xf8, 0x14, 0x2c, + 0x6c, 0xaf, 0x0f, 0xdb, 0x24, 0x1a, 0xff, 0x2e, 0xfe, 0x46, 0xc0, + 0x93, 0x8b, 0x74, 0xf2, 0xbc, 0xc5, 0x30, 0x52, 0xb0, 0x77, + }; + + EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + BIGNUM *qx = BN_bin2bn(kQx, sizeof(kQx), NULL); + BIGNUM *qy = BN_bin2bn(kQy, sizeof(kQy), NULL); + BIGNUM *d = BN_bin2bn(kD, sizeof(kD), NULL); + if (ec_key == NULL || qx == NULL || qy == NULL || d == NULL || + !EC_KEY_set_public_key_affine_coordinates(ec_key, qx, qy) || + !EC_KEY_set_private_key(ec_key, d)) { + EC_KEY_free(ec_key); + ec_key = NULL; + } + + BN_free(qx); + BN_free(qy); + BN_free(d); + return ec_key; +} + +#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] = + "BoringCryptoModule FIPS KAT Encryption and Decryption Plaintext!"; + static const uint8_t kAESCBCCiphertext[64] = { + 0x87, 0x2d, 0x98, 0xc2, 0xcc, 0x31, 0x5b, 0x41, 0xe0, 0xfa, 0x7b, + 0x0a, 0x71, 0xc0, 0x42, 0xbf, 0x4f, 0x61, 0xd0, 0x0d, 0x58, 0x8c, + 0xf7, 0x05, 0xfb, 0x94, 0x89, 0xd3, 0xbc, 0xaa, 0x1a, 0x50, 0x45, + 0x1f, 0xc3, 0x8c, 0xb8, 0x98, 0x86, 0xa3, 0xe3, 0x6c, 0xfc, 0xad, + 0x3a, 0xb5, 0x59, 0x27, 0x7d, 0x21, 0x07, 0xca, 0x4c, 0x1d, 0x55, + 0x34, 0xdd, 0x5a, 0x2d, 0xc4, 0xb4, 0xf5, 0xa8, +#if !defined(BORINGSSL_FIPS_BREAK_AES_CBC) + 0x35 +#else + 0x00 +#endif + }; + static const uint8_t kAESGCMCiphertext[80] = { + 0x4a, 0xd8, 0xe7, 0x7d, 0x78, 0xd7, 0x7d, 0x5e, 0xb2, 0x11, 0xb6, 0xc9, + 0xa4, 0xbc, 0xb2, 0xae, 0xbe, 0x93, 0xd1, 0xb7, 0xfe, 0x65, 0xc1, 0x82, + 0x2a, 0xb6, 0x71, 0x5f, 0x1a, 0x7c, 0xe0, 0x1b, 0x2b, 0xe2, 0x53, 0xfa, + 0xa0, 0x47, 0xfa, 0xd7, 0x8f, 0xb1, 0x4a, 0xc4, 0xdc, 0x89, 0xf9, 0xb4, + 0x14, 0x4d, 0xde, 0x95, 0xea, 0x29, 0x69, 0x76, 0x81, 0xa3, 0x5c, 0x33, + 0xd8, 0x37, 0xd8, 0xfa, 0x47, 0x19, 0x46, 0x2f, 0xf1, 0x90, 0xb7, 0x61, + 0x8f, 0x6f, 0xdd, 0x31, 0x3f, 0x6a, 0x64, +#if !defined(BORINGSSL_FIPS_BREAK_AES_GCM) + 0x0d +#else + 0x00 +#endif + }; + static const DES_cblock kDESKey1 = {"BCMDESK1"}; + static const DES_cblock kDESKey2 = {"BCMDESK2"}; + static const DES_cblock kDESKey3 = {"BCMDESK3"}; + static const DES_cblock kDESIV = {"BCMDESIV"}; + static const uint8_t kDESCiphertext[64] = { + 0xa4, 0x30, 0x7a, 0x4c, 0x1f, 0x60, 0x16, 0xd7, 0x4f, 0x41, 0xe1, + 0xbb, 0x27, 0xc4, 0x27, 0x37, 0xd4, 0x7f, 0xb9, 0x10, 0xf8, 0xbc, + 0xaf, 0x93, 0x91, 0xb8, 0x88, 0x24, 0xb1, 0xf6, 0xf8, 0xbd, 0x31, + 0x96, 0x06, 0x76, 0xde, 0x32, 0xcd, 0x29, 0x29, 0xba, 0x70, 0x5f, + 0xea, 0xc0, 0xcb, 0xde, 0xc7, 0x75, 0x90, 0xe0, 0x0f, 0x5e, 0x2c, + 0x0d, 0x49, 0x20, 0xd5, 0x30, 0x83, 0xf8, 0x08, +#if !defined(BORINGSSL_FIPS_BREAK_DES) + 0x5a +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA1[20] = { + 0xc6, 0xf8, 0xc9, 0x63, 0x1c, 0x14, 0x23, 0x62, 0x9b, 0xbd, + 0x55, 0x82, 0xf4, 0xd6, 0x1d, 0xf2, 0xab, 0x7d, 0xc8, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_1) + 0x28 +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA256[32] = { + 0x37, 0xbd, 0x70, 0x53, 0x72, 0xfc, 0xd4, 0x03, 0x79, 0x70, 0xfb, + 0x06, 0x95, 0xb1, 0x2a, 0x82, 0x48, 0xe1, 0x3e, 0xf2, 0x33, 0xfb, + 0xef, 0x29, 0x81, 0x22, 0x45, 0x40, 0x43, 0x70, 0xce, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_256) + 0x0f +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA512[64] = { + 0x08, 0x6a, 0x1c, 0x84, 0x61, 0x9d, 0x8e, 0xb3, 0xc0, 0x97, 0x4e, + 0xa1, 0x9f, 0x9c, 0xdc, 0xaf, 0x3b, 0x5c, 0x31, 0xf0, 0xf2, 0x74, + 0xc3, 0xbd, 0x6e, 0xd6, 0x1e, 0xb2, 0xbb, 0x34, 0x74, 0x72, 0x5c, + 0x51, 0x29, 0x8b, 0x87, 0x3a, 0xa3, 0xf2, 0x25, 0x23, 0xd4, 0x1c, + 0x82, 0x1b, 0xfe, 0xd3, 0xc6, 0xee, 0xb5, 0xd6, 0xaf, 0x07, 0x7b, + 0x98, 0xca, 0xa7, 0x01, 0xf3, 0x94, 0xf3, 0x68, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_512) + 0x14 +#else + 0x00 +#endif + }; + static const uint8_t kRSASignature[256] = { + 0x62, 0x66, 0x4b, 0xe3, 0xb1, 0xd2, 0x83, 0xf1, 0xa8, 0x56, 0x2b, 0x33, + 0x60, 0x1e, 0xdb, 0x1e, 0x06, 0xf7, 0xa7, 0x1e, 0xa8, 0xef, 0x03, 0x4d, + 0x0c, 0xf6, 0x83, 0x75, 0x7a, 0xf0, 0x14, 0xc7, 0xe2, 0x94, 0x3a, 0xb5, + 0x67, 0x56, 0xa5, 0x48, 0x7f, 0x3a, 0xa5, 0xbf, 0xf7, 0x1d, 0x44, 0xa6, + 0x34, 0xed, 0x9b, 0xd6, 0x51, 0xaa, 0x2c, 0x4e, 0xce, 0x60, 0x5f, 0xe9, + 0x0e, 0xd5, 0xcd, 0xeb, 0x23, 0x27, 0xf8, 0xfb, 0x45, 0xe5, 0x34, 0x63, + 0x77, 0x7f, 0x2e, 0x80, 0xcf, 0x9d, 0x2e, 0xfc, 0xe2, 0x50, 0x75, 0x29, + 0x46, 0xf4, 0xaf, 0x91, 0xed, 0x36, 0xe1, 0x5e, 0xef, 0x66, 0xa1, 0xff, + 0x27, 0xfc, 0x87, 0x7e, 0x60, 0x84, 0x0f, 0x54, 0x51, 0x56, 0x0f, 0x68, + 0x99, 0xc0, 0x3f, 0xeb, 0xa5, 0xa0, 0x46, 0xb0, 0x86, 0x02, 0xb0, 0xc8, + 0xe8, 0x46, 0x13, 0x06, 0xcd, 0xb7, 0x8a, 0xd0, 0x3b, 0x46, 0xd0, 0x14, + 0x64, 0x53, 0x9b, 0x5b, 0x5e, 0x02, 0x45, 0xba, 0x6e, 0x7e, 0x0a, 0xb9, + 0x9e, 0x62, 0xb7, 0xd5, 0x7a, 0x87, 0xea, 0xd3, 0x24, 0xa5, 0xef, 0xb3, + 0xdc, 0x05, 0x9c, 0x04, 0x60, 0x4b, 0xde, 0xa8, 0x90, 0x08, 0x7b, 0x6a, + 0x5f, 0xb4, 0x3f, 0xda, 0xc5, 0x1f, 0x6e, 0xd6, 0x15, 0xde, 0x65, 0xa4, + 0x6e, 0x62, 0x9d, 0x8f, 0xa8, 0xbe, 0x86, 0xf6, 0x09, 0x90, 0x40, 0xa5, + 0xf4, 0x23, 0xc5, 0xf6, 0x38, 0x86, 0x0d, 0x1c, 0xed, 0x4a, 0x0a, 0xae, + 0xa4, 0x26, 0xc2, 0x2e, 0xd3, 0x13, 0x66, 0x61, 0xea, 0x35, 0x01, 0x0e, + 0x13, 0xda, 0x78, 0x20, 0xae, 0x59, 0x5f, 0x9b, 0xa9, 0x6c, 0xf9, 0x1b, + 0xdf, 0x76, 0x53, 0xc8, 0xa7, 0xf5, 0x63, 0x6d, 0xf3, 0xff, 0xfd, 0xaf, + 0x75, 0x4b, 0xac, 0x67, 0xb1, 0x3c, 0xbf, 0x5e, 0xde, 0x73, 0x02, 0x6d, + 0xd2, 0x0c, 0xb1, +#if !defined(BORINGSSL_FIPS_BREAK_RSA_SIG) + 0x64 +#else + 0x00 +#endif + }; + const uint8_t kDRBGEntropy[48] = + "BCM Known Answer Test DBRG Initial Entropy "; + const uint8_t kDRBGPersonalization[18] = "BCMPersonalization"; + const uint8_t kDRBGAD[16] = "BCM DRBG KAT AD "; + const uint8_t kDRBGOutput[64] = { + 0x1d, 0x63, 0xdf, 0x05, 0x51, 0x49, 0x22, 0x46, 0xcd, 0x9b, 0xc5, + 0xbb, 0xf1, 0x5d, 0x44, 0xae, 0x13, 0x78, 0xb1, 0xe4, 0x7c, 0xf1, + 0x96, 0x33, 0x3d, 0x60, 0xb6, 0x29, 0xd4, 0xbb, 0x6b, 0x44, 0xf9, + 0xef, 0xd9, 0xf4, 0xa2, 0xba, 0x48, 0xea, 0x39, 0x75, 0x59, 0x32, + 0xf7, 0x31, 0x2c, 0x98, 0x14, 0x2b, 0x49, 0xdf, 0x02, 0xb6, 0x5d, + 0x71, 0x09, 0x50, 0xdb, 0x23, 0xdb, 0xe5, 0x22, +#if !defined(BORINGSSL_FIPS_BREAK_DRBG) + 0x95 +#else + 0x00 +#endif + }; + const uint8_t kDRBGEntropy2[48] = + "BCM Known Answer Test DBRG Reseed Entropy "; + const uint8_t kDRBGReseedOutput[64] = { + 0xa4, 0x77, 0x05, 0xdb, 0x14, 0x11, 0x76, 0x71, 0x42, 0x5b, 0xd8, + 0xd7, 0xa5, 0x4f, 0x8b, 0x39, 0xf2, 0x10, 0x4a, 0x50, 0x5b, 0xa2, + 0xc8, 0xf0, 0xbb, 0x3e, 0xa1, 0xa5, 0x90, 0x7d, 0x54, 0xd9, 0xc6, + 0xb0, 0x96, 0xc0, 0x2b, 0x7e, 0x9b, 0xc9, 0xa1, 0xdd, 0x78, 0x2e, + 0xd5, 0xa8, 0x66, 0x16, 0xbd, 0x18, 0x3c, 0xf2, 0xaa, 0x7a, 0x2b, + 0x37, 0xf9, 0xab, 0x35, 0x64, 0x15, 0x01, 0x3f, 0xc4, + }; + const uint8_t kECDSASigR[32] = { + 0x67, 0x80, 0xc5, 0xfc, 0x70, 0x27, 0x5e, 0x2c, 0x70, 0x61, 0xa0, + 0xe7, 0x87, 0x7b, 0xb1, 0x74, 0xde, 0xad, 0xeb, 0x98, 0x87, 0x02, + 0x7f, 0x3f, 0xa8, 0x36, 0x54, 0x15, 0x8b, 0xa7, 0xf5, +#if !defined(BORINGSSL_FIPS_BREAK_ECDSA_SIG) + 0x0c, +#else + 0x00, +#endif + }; + const uint8_t kECDSASigS[32] = { + 0xa5, 0x93, 0xe0, 0x23, 0x91, 0xe7, 0x4b, 0x8d, 0x77, 0x25, 0xa6, + 0xba, 0x4d, 0xd9, 0x86, 0x77, 0xda, 0x7d, 0x8f, 0xef, 0xc4, 0x1a, + 0xf0, 0xcc, 0x81, 0xe5, 0xea, 0x3f, 0xc2, 0x41, 0x7f, 0xd8, + }; + + EVP_AEAD_CTX aead_ctx; + EVP_AEAD_CTX_zero(&aead_ctx); + RSA *rsa_key = NULL; + EC_KEY *ec_key = NULL; + ECDSA_SIG *sig = NULL; + int ret = 0; + + AES_KEY aes_key; + uint8_t aes_iv[16]; + uint8_t output[256]; + + // 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, + AES_ENCRYPT); + if (!check_test(kAESCBCCiphertext, output, sizeof(kAESCBCCiphertext), + "AES-CBC Encryption KAT")) { + goto err; + } + + // 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), + &aes_key, aes_iv, AES_DECRYPT); + if (!check_test(kPlaintext, output, sizeof(kPlaintext), + "AES-CBC Decryption KAT")) { + goto err; + } + + size_t out_len; + uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; + 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; + } + + // AES-GCM Encryption KAT + if (!EVP_AEAD_CTX_seal(&aead_ctx, output, &out_len, sizeof(output), nonce, + EVP_AEAD_nonce_length(EVP_aead_aes_128_gcm()), + 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; + } + + // AES-GCM Decryption KAT + if (!EVP_AEAD_CTX_open(&aead_ctx, output, &out_len, sizeof(output), nonce, + EVP_AEAD_nonce_length(EVP_aead_aes_128_gcm()), + kAESGCMCiphertext, sizeof(kAESGCMCiphertext), NULL, + 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; + } + + DES_key_schedule des1, des2, des3; + DES_cblock des_iv; + DES_set_key(&kDESKey1, &des1); + DES_set_key(&kDESKey2, &des2); + DES_set_key(&kDESKey3, &des3); + + // 3DES Encryption KAT + memcpy(&des_iv, &kDESIV, sizeof(des_iv)); + DES_ede3_cbc_encrypt(kPlaintext, output, sizeof(kPlaintext), &des1, &des2, + &des3, &des_iv, DES_ENCRYPT); + if (!check_test(kDESCiphertext, output, sizeof(kDESCiphertext), + "3DES Encryption KAT")) { + goto err; + } + + // 3DES Decryption KAT + memcpy(&des_iv, &kDESIV, sizeof(des_iv)); + DES_ede3_cbc_encrypt(kDESCiphertext, output, sizeof(kDESCiphertext), &des1, + &des2, &des3, &des_iv, DES_DECRYPT); + if (!check_test(kPlaintext, output, sizeof(kPlaintext), + "3DES Decryption KAT")) { + goto err; + } + + // SHA-1 KAT + SHA1(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA1, output, sizeof(kPlaintextSHA1), + "SHA-1 KAT")) { + goto err; + } + + // SHA-256 KAT + SHA256(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA256, output, sizeof(kPlaintextSHA256), + "SHA-256 KAT")) { + goto err; + } + + // SHA-512 KAT + SHA512(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA512, output, sizeof(kPlaintextSHA512), + "SHA-512 KAT")) { + goto err; + } + + rsa_key = self_test_rsa_key(); + if (rsa_key == NULL) { + fprintf(stderr, "RSA KeyGen failed\n"); + goto err; + } + + // RSA Sign KAT + unsigned sig_len; + + // Disable blinding for the power-on tests because it's not needed and + // triggers an entropy draw. + rsa_key->flags |= RSA_FLAG_NO_BLINDING; + + if (!RSA_sign(NID_sha256, kPlaintextSHA256, sizeof(kPlaintextSHA256), output, + &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)) { + fprintf(stderr, "RSA Verify KAT failed.\n"); + goto err; + } + + ec_key = self_test_ecdsa_key(); + if (ec_key == NULL) { + fprintf(stderr, "ECDSA KeyGen failed\n"); + goto err; + } + + // ECDSA Sign/Verify PWCT + + // The 'k' value for ECDSA is fixed to avoid an entropy draw. + ec_key->fixed_k = BN_new(); + if (ec_key->fixed_k == NULL || + !BN_set_word(ec_key->fixed_k, 42)) { + fprintf(stderr, "Out of memory\n"); + goto err; + } + + sig = ECDSA_do_sign(kPlaintextSHA256, sizeof(kPlaintextSHA256), ec_key); + + uint8_t ecdsa_r_bytes[sizeof(kECDSASigR)]; + uint8_t ecdsa_s_bytes[sizeof(kECDSASigS)]; + if (sig == NULL || + BN_num_bytes(sig->r) != sizeof(ecdsa_r_bytes) || + !BN_bn2bin(sig->r, ecdsa_r_bytes) || + BN_num_bytes(sig->s) != sizeof(ecdsa_s_bytes) || + !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")) { + fprintf(stderr, "ECDSA KAT failed.\n"); + goto err; + } + + // DBRG KAT + CTR_DRBG_STATE drbg; + if (!CTR_DRBG_init(&drbg, kDRBGEntropy, kDRBGPersonalization, + sizeof(kDRBGPersonalization)) || + !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGOutput), kDRBGAD, + sizeof(kDRBGAD)) || + !check_test(kDRBGOutput, output, sizeof(kDRBGOutput), + "DBRG Generate KAT") || + !CTR_DRBG_reseed(&drbg, kDRBGEntropy2, kDRBGAD, sizeof(kDRBGAD)) || + !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGReseedOutput), kDRBGAD, + sizeof(kDRBGAD)) || + !check_test(kDRBGReseedOutput, output, sizeof(kDRBGReseedOutput), + "DRBG Reseed KAT")) { + fprintf(stderr, "CTR-DRBG failed.\n"); + goto err; + } + CTR_DRBG_clear(&drbg); + + CTR_DRBG_STATE kZeroDRBG; + memset(&kZeroDRBG, 0, sizeof(kZeroDRBG)); + if (!check_test(&kZeroDRBG, &drbg, sizeof(drbg), "DRBG Clear KAT")) { + goto err; + } + + 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); + EC_KEY_free(ec_key); + ECDSA_SIG_free(sig); + + return ret; +} + +int BORINGSSL_self_test(void) { + return boringssl_fips_self_test(NULL, 0); +} + +#endif // !_MSC_VER diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back new file mode 100644 index 0000000..d8a61c3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back @@ -0,0 +1,654 @@ +/* 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 +#include + +#include "../../internal.h" +#include "../ec/internal.h" +#include "../rand/internal.h" + + +// MSVC wants to put a NUL byte at the end of non-char arrays and so cannot +// 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++) { + 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) { + fprintf(stderr, "%s failed.\nExpected: ", name); + hexdump(expected, expected_len); + fprintf(stderr, "\nCalculated: "); + hexdump(actual, expected_len); + fprintf(stderr, "\n"); + fflush(stderr); + return 0; + } + return 1; +} + +static int set_bignum(BIGNUM **out, const uint8_t *in, size_t len) { + *out = BN_bin2bn(in, len, NULL); + return *out != NULL; +} + +static RSA *self_test_rsa_key(void) { + static const uint8_t kN[] = { + 0xd3, 0x3a, 0x62, 0x9f, 0x07, 0x77, 0xb0, 0x18, 0xf3, 0xff, 0xfe, 0xcc, + 0xc9, 0xa2, 0xc2, 0x3a, 0xa6, 0x1d, 0xd8, 0xf0, 0x26, 0x5b, 0x38, 0x90, + 0x17, 0x48, 0x15, 0xce, 0x21, 0xcd, 0xd6, 0x62, 0x99, 0xe2, 0xd7, 0xda, + 0x40, 0x80, 0x3c, 0xad, 0x18, 0xb7, 0x26, 0xe9, 0x30, 0x8a, 0x23, 0x3f, + 0x68, 0x9a, 0x9c, 0x31, 0x34, 0x91, 0x99, 0x06, 0x11, 0x36, 0xb2, 0x9e, + 0x3a, 0xd0, 0xbc, 0xb9, 0x93, 0x4e, 0xb8, 0x72, 0xa1, 0x9f, 0xb6, 0x8c, + 0xd5, 0x17, 0x1f, 0x7e, 0xaa, 0x75, 0xbb, 0xdf, 0xa1, 0x70, 0x48, 0xc4, + 0xec, 0x9a, 0x51, 0xed, 0x41, 0xc9, 0x74, 0xc0, 0x3e, 0x1e, 0x85, 0x2f, + 0xbe, 0x34, 0xc7, 0x65, 0x34, 0x8b, 0x4d, 0x55, 0x4b, 0xe1, 0x45, 0x54, + 0x0d, 0x75, 0x7e, 0x89, 0x4d, 0x0c, 0xf6, 0x33, 0xe5, 0xfc, 0xfb, 0x56, + 0x1b, 0xf2, 0x39, 0x9d, 0xe0, 0xff, 0x55, 0xcf, 0x02, 0x05, 0xb9, 0x74, + 0xd2, 0x91, 0xfc, 0x87, 0xe1, 0xbb, 0x97, 0x2a, 0xe4, 0xdd, 0x20, 0xc0, + 0x38, 0x47, 0xc0, 0x76, 0x3f, 0xa1, 0x9b, 0x5c, 0x20, 0xff, 0xff, 0xc7, + 0x49, 0x3b, 0x4c, 0xaf, 0x99, 0xa6, 0x3e, 0x82, 0x5c, 0x58, 0x27, 0xce, + 0x01, 0x03, 0xc3, 0x16, 0x35, 0x20, 0xe9, 0xf0, 0x15, 0x7a, 0x41, 0xd5, + 0x1f, 0x52, 0xea, 0xdf, 0xad, 0x4c, 0xbb, 0x0d, 0xcb, 0x04, 0x91, 0xb0, + 0x95, 0xa8, 0xce, 0x25, 0xfd, 0xd2, 0x62, 0x47, 0x77, 0xee, 0x13, 0xf1, + 0x48, 0x72, 0x9e, 0xd9, 0x2d, 0xe6, 0x5f, 0xa4, 0xc6, 0x9e, 0x5a, 0xb2, + 0xc6, 0xa2, 0xf7, 0x0a, 0x16, 0x17, 0xae, 0x6b, 0x1c, 0x30, 0x7c, 0x63, + 0x08, 0x83, 0xe7, 0x43, 0xec, 0x54, 0x5e, 0x2c, 0x08, 0x0b, 0x5e, 0x46, + 0xa7, 0x10, 0x93, 0x43, 0x53, 0x4e, 0xe3, 0x16, 0x73, 0x55, 0xce, 0xf2, + 0x94, 0xc0, 0xbe, 0xb3, + }; + static const uint8_t kE[] = {0x01, 0x00, 0x01}; // 65537 + static const uint8_t kD[] = { + 0x2f, 0x2c, 0x1e, 0xd2, 0x3d, 0x2c, 0xb1, 0x9b, 0x21, 0x02, 0xce, 0xb8, + 0x95, 0x5f, 0x4f, 0xd9, 0x21, 0x38, 0x11, 0x36, 0xb0, 0x9a, 0x36, 0xab, + 0x97, 0x47, 0x75, 0xf7, 0x2e, 0xfd, 0x75, 0x1f, 0x58, 0x16, 0x9c, 0xf6, + 0x14, 0xe9, 0x8e, 0xa3, 0x69, 0x9d, 0x9d, 0x86, 0xfe, 0x5c, 0x1b, 0x3b, + 0x11, 0xf5, 0x55, 0x64, 0x77, 0xc4, 0xfc, 0x53, 0xaa, 0x8c, 0x78, 0x9f, + 0x75, 0xab, 0x20, 0x3a, 0xa1, 0x77, 0x37, 0x22, 0x02, 0x8e, 0x54, 0x8a, + 0x67, 0x1c, 0x5e, 0xe0, 0x3e, 0xd9, 0x44, 0x37, 0xd1, 0x29, 0xee, 0x56, + 0x6c, 0x30, 0x9a, 0x93, 0x4d, 0xd9, 0xdb, 0xc5, 0x03, 0x1a, 0x75, 0xcc, + 0x0f, 0xc2, 0x61, 0xb5, 0x6c, 0x62, 0x9f, 0xc6, 0xa8, 0xc7, 0x8a, 0x60, + 0x17, 0x11, 0x62, 0x4c, 0xef, 0x74, 0x31, 0x97, 0xad, 0x89, 0x2d, 0xe8, + 0x31, 0x1d, 0x8b, 0x58, 0x82, 0xe3, 0x03, 0x1a, 0x6b, 0xdf, 0x3f, 0x3e, + 0xa4, 0x27, 0x19, 0xef, 0x46, 0x7a, 0x90, 0xdf, 0xa7, 0xe7, 0xc9, 0x66, + 0xab, 0x41, 0x1d, 0x65, 0x78, 0x1c, 0x18, 0x40, 0x5c, 0xd6, 0x87, 0xb5, + 0xea, 0x29, 0x44, 0xb3, 0xf5, 0xb3, 0xd2, 0x4f, 0xce, 0x88, 0x78, 0x49, + 0x27, 0x4e, 0x0b, 0x30, 0x85, 0xfb, 0x73, 0xfd, 0x8b, 0x32, 0x15, 0xee, + 0x1f, 0xc9, 0x0e, 0x89, 0xb9, 0x43, 0x2f, 0xe9, 0x60, 0x8d, 0xda, 0xae, + 0x2b, 0x30, 0x99, 0xee, 0x88, 0x81, 0x20, 0x7b, 0x4a, 0xc3, 0x18, 0xf2, + 0x94, 0x02, 0x79, 0x94, 0xaa, 0x65, 0xd9, 0x1b, 0x45, 0x2a, 0xac, 0x6e, + 0x30, 0x48, 0x57, 0xea, 0xbe, 0x79, 0x7d, 0xfc, 0x67, 0xaa, 0x47, 0xc0, + 0xf7, 0x52, 0xfd, 0x0b, 0x63, 0x4e, 0x3d, 0x2e, 0xcc, 0x36, 0xa0, 0xdb, + 0x92, 0x0b, 0xa9, 0x1b, 0xeb, 0xc2, 0xd5, 0x08, 0xd3, 0x85, 0x87, 0xf8, + 0x5d, 0x1a, 0xf6, 0xc1, + }; + static const uint8_t kP[] = { + 0xf7, 0x06, 0xa3, 0x98, 0x8a, 0x52, 0xf8, 0x63, 0x68, 0x27, 0x4f, 0x68, + 0x7f, 0x34, 0xec, 0x8e, 0x5d, 0xf8, 0x30, 0x92, 0xb3, 0x62, 0x4c, 0xeb, + 0xdb, 0x19, 0x6b, 0x09, 0xc5, 0xa3, 0xf0, 0xbb, 0xff, 0x0f, 0xc2, 0xd4, + 0x9b, 0xc9, 0x54, 0x4f, 0xb9, 0xf9, 0xe1, 0x4c, 0xf0, 0xe3, 0x4c, 0x90, + 0xda, 0x7a, 0x01, 0xc2, 0x9f, 0xc4, 0xc8, 0x8e, 0xb1, 0x1e, 0x93, 0x75, + 0x75, 0xc6, 0x13, 0x25, 0xc3, 0xee, 0x3b, 0xcc, 0xb8, 0x72, 0x6c, 0x49, + 0xb0, 0x09, 0xfb, 0xab, 0x44, 0xeb, 0x4d, 0x40, 0xf0, 0x61, 0x6b, 0xe5, + 0xe6, 0xfe, 0x3e, 0x0a, 0x77, 0x26, 0x39, 0x76, 0x3d, 0x4c, 0x3e, 0x9b, + 0x5b, 0xc0, 0xaf, 0xa2, 0x58, 0x76, 0xb0, 0xe9, 0xda, 0x7f, 0x0e, 0x78, + 0xc9, 0x76, 0x49, 0x5c, 0xfa, 0xb3, 0xb0, 0x15, 0x4b, 0x41, 0xc7, 0x27, + 0xa4, 0x75, 0x28, 0x5c, 0x30, 0x69, 0x50, 0x29, + }; + static const uint8_t kQ[] = { + 0xda, 0xe6, 0xd2, 0xbb, 0x44, 0xff, 0x4f, 0xdf, 0x57, 0xc1, 0x11, 0xa3, + 0x51, 0xba, 0x17, 0x89, 0x4c, 0x01, 0xc0, 0x0c, 0x97, 0x34, 0x50, 0xcf, + 0x32, 0x1e, 0xc0, 0xbd, 0x7b, 0x35, 0xb5, 0x6a, 0x26, 0xcc, 0xea, 0x4c, + 0x8e, 0x87, 0x4a, 0x67, 0x8b, 0xd3, 0xe5, 0x4f, 0x3a, 0x60, 0x48, 0x59, + 0x04, 0x93, 0x39, 0xd7, 0x7c, 0xfb, 0x19, 0x1a, 0x34, 0xd5, 0xe8, 0xaf, + 0xe7, 0x22, 0x2c, 0x0d, 0xc2, 0x91, 0x69, 0xb6, 0xe9, 0x2a, 0xe9, 0x1c, + 0x4c, 0x6e, 0x8f, 0x40, 0xf5, 0xa8, 0x3e, 0x82, 0x69, 0x69, 0xbe, 0x9f, + 0x7d, 0x5c, 0x7f, 0x92, 0x78, 0x17, 0xa3, 0x6d, 0x41, 0x2d, 0x72, 0xed, + 0x3f, 0x71, 0xfa, 0x97, 0xb4, 0x63, 0xe4, 0x4f, 0xd9, 0x46, 0x03, 0xfb, + 0x00, 0xeb, 0x30, 0x70, 0xb9, 0x51, 0xd9, 0x0a, 0xd2, 0xf8, 0x50, 0xd4, + 0xfb, 0x43, 0x84, 0xf8, 0xac, 0x58, 0xc3, 0x7b, + }; + static const uint8_t kDModPMinusOne[] = { + 0xf5, 0x50, 0x8f, 0x88, 0x7d, 0xdd, 0xb5, 0xb4, 0x2a, 0x8b, 0xd7, 0x4d, + 0x23, 0xfe, 0xaf, 0xe9, 0x16, 0x22, 0xd2, 0x41, 0xed, 0x88, 0xf2, 0x70, + 0xcb, 0x4d, 0xeb, 0xc1, 0x71, 0x97, 0xc4, 0x0b, 0x3e, 0x5a, 0x2d, 0x96, + 0xab, 0xfa, 0xfd, 0x12, 0x8b, 0xd3, 0x3e, 0x4e, 0x05, 0x6f, 0x04, 0xeb, + 0x59, 0x3c, 0x0e, 0xa1, 0x73, 0xbe, 0x9d, 0x99, 0x2f, 0x05, 0xf9, 0x54, + 0x8d, 0x98, 0x1e, 0x0d, 0xc4, 0x0c, 0xc3, 0x30, 0x23, 0xff, 0xe5, 0xd0, + 0x2b, 0xd5, 0x4e, 0x2b, 0xa0, 0xae, 0xb8, 0x32, 0x84, 0x45, 0x8b, 0x3c, + 0x6d, 0xf0, 0x10, 0x36, 0x9e, 0x6a, 0xc4, 0x67, 0xca, 0xa9, 0xfc, 0x06, + 0x96, 0xd0, 0xbc, 0xda, 0xd1, 0x55, 0x55, 0x8d, 0x77, 0x21, 0xf4, 0x82, + 0x39, 0x37, 0x91, 0xd5, 0x97, 0x56, 0x78, 0xc8, 0x3c, 0xcb, 0x5e, 0xf6, + 0xdc, 0x58, 0x48, 0xb3, 0x7c, 0x94, 0x29, 0x39, + }; + static const uint8_t kDModQMinusOne[] = { + 0x64, 0x65, 0xbd, 0x7d, 0x1a, 0x96, 0x26, 0xa1, 0xfe, 0xf3, 0x94, 0x0d, + 0x5d, 0xec, 0x85, 0xe2, 0xf8, 0xb3, 0x4c, 0xcb, 0xf9, 0x85, 0x8b, 0x12, + 0x9c, 0xa0, 0x32, 0x32, 0x35, 0x92, 0x5a, 0x94, 0x47, 0x1b, 0x70, 0xd2, + 0x90, 0x04, 0x49, 0x01, 0xd8, 0xc5, 0xe4, 0xc4, 0x43, 0xb7, 0xe9, 0x36, + 0xba, 0xbc, 0x73, 0xa8, 0xfb, 0xaf, 0x86, 0xc1, 0xd8, 0x3d, 0xcb, 0xac, + 0xf1, 0xcb, 0x60, 0x7d, 0x27, 0x21, 0xde, 0x64, 0x7f, 0xe8, 0xa8, 0x65, + 0xcc, 0x40, 0x60, 0xff, 0xa0, 0x2b, 0xfc, 0x0f, 0x80, 0x1d, 0x79, 0xca, + 0x58, 0x8a, 0xd6, 0x0f, 0xed, 0x78, 0x9a, 0x02, 0x00, 0x04, 0xc2, 0x53, + 0x41, 0xe8, 0x1a, 0xd0, 0xfd, 0x71, 0x5b, 0x43, 0xac, 0x19, 0x4a, 0xb6, + 0x12, 0xa3, 0xcb, 0xe1, 0xc7, 0x7d, 0x5c, 0x98, 0x74, 0x4e, 0x63, 0x74, + 0x6b, 0x91, 0x7a, 0x29, 0x3b, 0x92, 0xb2, 0x85, + }; + static const uint8_t kQInverseModP[] = { + 0xd0, 0xde, 0x19, 0xda, 0x1e, 0xa2, 0xd8, 0x8f, 0x1c, 0x92, 0x73, 0xb0, + 0xc9, 0x90, 0xc7, 0xf5, 0xec, 0xc5, 0x89, 0x01, 0x05, 0x78, 0x11, 0x2d, + 0x74, 0x34, 0x44, 0xad, 0xd5, 0xf7, 0xa4, 0xfe, 0x9f, 0x25, 0x4d, 0x0b, + 0x92, 0xe3, 0xb8, 0x7d, 0xd3, 0xfd, 0xa5, 0xca, 0x95, 0x60, 0xa3, 0xf9, + 0x55, 0x42, 0x14, 0xb2, 0x45, 0x51, 0x9f, 0x73, 0x88, 0x43, 0x8a, 0xd1, + 0x65, 0x9e, 0xd1, 0xf7, 0x82, 0x2a, 0x2a, 0x8d, 0x70, 0x56, 0xe3, 0xef, + 0xc9, 0x0e, 0x2a, 0x2c, 0x15, 0xaf, 0x7f, 0x97, 0x81, 0x66, 0xf3, 0xb5, + 0x00, 0xa9, 0x26, 0xcc, 0x1e, 0xc2, 0x98, 0xdd, 0xd3, 0x37, 0x06, 0x79, + 0xb3, 0x60, 0x58, 0x79, 0x99, 0x3f, 0xa3, 0x15, 0x1f, 0x31, 0xe3, 0x11, + 0x88, 0x4c, 0x35, 0x57, 0xfa, 0x79, 0xd7, 0xd8, 0x72, 0xee, 0x73, 0x95, + 0x89, 0x29, 0xc7, 0x05, 0x27, 0x68, 0x90, 0x15, + }; + + RSA *rsa = RSA_new(); + if (rsa == NULL || + !set_bignum(&rsa->n, kN, sizeof(kN)) || + !set_bignum(&rsa->e, kE, sizeof(kE)) || + !set_bignum(&rsa->d, kD, sizeof(kD)) || + !set_bignum(&rsa->p, kP, sizeof(kP)) || + !set_bignum(&rsa->q, kQ, sizeof(kQ)) || + !set_bignum(&rsa->dmp1, kDModPMinusOne, sizeof(kDModPMinusOne)) || + !set_bignum(&rsa->dmq1, kDModQMinusOne, sizeof(kDModQMinusOne)) || + !set_bignum(&rsa->iqmp, kQInverseModP, sizeof(kQInverseModP))) { + RSA_free(rsa); + return NULL; + } + + return rsa; +} + +static EC_KEY *self_test_ecdsa_key(void) { + static const uint8_t kQx[] = { + 0xc8, 0x15, 0x61, 0xec, 0xf2, 0xe5, 0x4e, 0xde, 0xfe, 0x66, 0x17, + 0xdb, 0x1c, 0x7a, 0x34, 0xa7, 0x07, 0x44, 0xdd, 0xb2, 0x61, 0xf2, + 0x69, 0xb8, 0x3d, 0xac, 0xfc, 0xd2, 0xad, 0xe5, 0xa6, 0x81, + }; + static const uint8_t kQy[] = { + 0xe0, 0xe2, 0xaf, 0xa3, 0xf9, 0xb6, 0xab, 0xe4, 0xc6, 0x98, 0xef, + 0x64, 0x95, 0xf1, 0xbe, 0x49, 0xa3, 0x19, 0x6c, 0x50, 0x56, 0xac, + 0xb3, 0x76, 0x3f, 0xe4, 0x50, 0x7e, 0xec, 0x59, 0x6e, 0x88, + }; + static const uint8_t kD[] = { + 0xc6, 0xc1, 0xaa, 0xda, 0x15, 0xb0, 0x76, 0x61, 0xf8, 0x14, 0x2c, + 0x6c, 0xaf, 0x0f, 0xdb, 0x24, 0x1a, 0xff, 0x2e, 0xfe, 0x46, 0xc0, + 0x93, 0x8b, 0x74, 0xf2, 0xbc, 0xc5, 0x30, 0x52, 0xb0, 0x77, + }; + + EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + BIGNUM *qx = BN_bin2bn(kQx, sizeof(kQx), NULL); + BIGNUM *qy = BN_bin2bn(kQy, sizeof(kQy), NULL); + BIGNUM *d = BN_bin2bn(kD, sizeof(kD), NULL); + if (ec_key == NULL || qx == NULL || qy == NULL || d == NULL || + !EC_KEY_set_public_key_affine_coordinates(ec_key, qx, qy) || + !EC_KEY_set_private_key(ec_key, d)) { + EC_KEY_free(ec_key); + ec_key = NULL; + } + + BN_free(qx); + BN_free(qy); + BN_free(d); + return ec_key; +} + +#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] = + "BoringCryptoModule FIPS KAT Encryption and Decryption Plaintext!"; + static const uint8_t kAESCBCCiphertext[64] = { + 0x87, 0x2d, 0x98, 0xc2, 0xcc, 0x31, 0x5b, 0x41, 0xe0, 0xfa, 0x7b, + 0x0a, 0x71, 0xc0, 0x42, 0xbf, 0x4f, 0x61, 0xd0, 0x0d, 0x58, 0x8c, + 0xf7, 0x05, 0xfb, 0x94, 0x89, 0xd3, 0xbc, 0xaa, 0x1a, 0x50, 0x45, + 0x1f, 0xc3, 0x8c, 0xb8, 0x98, 0x86, 0xa3, 0xe3, 0x6c, 0xfc, 0xad, + 0x3a, 0xb5, 0x59, 0x27, 0x7d, 0x21, 0x07, 0xca, 0x4c, 0x1d, 0x55, + 0x34, 0xdd, 0x5a, 0x2d, 0xc4, 0xb4, 0xf5, 0xa8, +#if !defined(BORINGSSL_FIPS_BREAK_AES_CBC) + 0x35 +#else + 0x00 +#endif + }; + static const uint8_t kAESGCMCiphertext[80] = { + 0x4a, 0xd8, 0xe7, 0x7d, 0x78, 0xd7, 0x7d, 0x5e, 0xb2, 0x11, 0xb6, 0xc9, + 0xa4, 0xbc, 0xb2, 0xae, 0xbe, 0x93, 0xd1, 0xb7, 0xfe, 0x65, 0xc1, 0x82, + 0x2a, 0xb6, 0x71, 0x5f, 0x1a, 0x7c, 0xe0, 0x1b, 0x2b, 0xe2, 0x53, 0xfa, + 0xa0, 0x47, 0xfa, 0xd7, 0x8f, 0xb1, 0x4a, 0xc4, 0xdc, 0x89, 0xf9, 0xb4, + 0x14, 0x4d, 0xde, 0x95, 0xea, 0x29, 0x69, 0x76, 0x81, 0xa3, 0x5c, 0x33, + 0xd8, 0x37, 0xd8, 0xfa, 0x47, 0x19, 0x46, 0x2f, 0xf1, 0x90, 0xb7, 0x61, + 0x8f, 0x6f, 0xdd, 0x31, 0x3f, 0x6a, 0x64, +#if !defined(BORINGSSL_FIPS_BREAK_AES_GCM) + 0x0d +#else + 0x00 +#endif + }; + static const DES_cblock kDESKey1 = {"BCMDESK1"}; + static const DES_cblock kDESKey2 = {"BCMDESK2"}; + static const DES_cblock kDESKey3 = {"BCMDESK3"}; + static const DES_cblock kDESIV = {"BCMDESIV"}; + static const uint8_t kDESCiphertext[64] = { + 0xa4, 0x30, 0x7a, 0x4c, 0x1f, 0x60, 0x16, 0xd7, 0x4f, 0x41, 0xe1, + 0xbb, 0x27, 0xc4, 0x27, 0x37, 0xd4, 0x7f, 0xb9, 0x10, 0xf8, 0xbc, + 0xaf, 0x93, 0x91, 0xb8, 0x88, 0x24, 0xb1, 0xf6, 0xf8, 0xbd, 0x31, + 0x96, 0x06, 0x76, 0xde, 0x32, 0xcd, 0x29, 0x29, 0xba, 0x70, 0x5f, + 0xea, 0xc0, 0xcb, 0xde, 0xc7, 0x75, 0x90, 0xe0, 0x0f, 0x5e, 0x2c, + 0x0d, 0x49, 0x20, 0xd5, 0x30, 0x83, 0xf8, 0x08, +#if !defined(BORINGSSL_FIPS_BREAK_DES) + 0x5a +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA1[20] = { + 0xc6, 0xf8, 0xc9, 0x63, 0x1c, 0x14, 0x23, 0x62, 0x9b, 0xbd, + 0x55, 0x82, 0xf4, 0xd6, 0x1d, 0xf2, 0xab, 0x7d, 0xc8, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_1) + 0x28 +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA256[32] = { + 0x37, 0xbd, 0x70, 0x53, 0x72, 0xfc, 0xd4, 0x03, 0x79, 0x70, 0xfb, + 0x06, 0x95, 0xb1, 0x2a, 0x82, 0x48, 0xe1, 0x3e, 0xf2, 0x33, 0xfb, + 0xef, 0x29, 0x81, 0x22, 0x45, 0x40, 0x43, 0x70, 0xce, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_256) + 0x0f +#else + 0x00 +#endif + }; + static const uint8_t kPlaintextSHA512[64] = { + 0x08, 0x6a, 0x1c, 0x84, 0x61, 0x9d, 0x8e, 0xb3, 0xc0, 0x97, 0x4e, + 0xa1, 0x9f, 0x9c, 0xdc, 0xaf, 0x3b, 0x5c, 0x31, 0xf0, 0xf2, 0x74, + 0xc3, 0xbd, 0x6e, 0xd6, 0x1e, 0xb2, 0xbb, 0x34, 0x74, 0x72, 0x5c, + 0x51, 0x29, 0x8b, 0x87, 0x3a, 0xa3, 0xf2, 0x25, 0x23, 0xd4, 0x1c, + 0x82, 0x1b, 0xfe, 0xd3, 0xc6, 0xee, 0xb5, 0xd6, 0xaf, 0x07, 0x7b, + 0x98, 0xca, 0xa7, 0x01, 0xf3, 0x94, 0xf3, 0x68, +#if !defined(BORINGSSL_FIPS_BREAK_SHA_512) + 0x14 +#else + 0x00 +#endif + }; + static const uint8_t kRSASignature[256] = { + 0x62, 0x66, 0x4b, 0xe3, 0xb1, 0xd2, 0x83, 0xf1, 0xa8, 0x56, 0x2b, 0x33, + 0x60, 0x1e, 0xdb, 0x1e, 0x06, 0xf7, 0xa7, 0x1e, 0xa8, 0xef, 0x03, 0x4d, + 0x0c, 0xf6, 0x83, 0x75, 0x7a, 0xf0, 0x14, 0xc7, 0xe2, 0x94, 0x3a, 0xb5, + 0x67, 0x56, 0xa5, 0x48, 0x7f, 0x3a, 0xa5, 0xbf, 0xf7, 0x1d, 0x44, 0xa6, + 0x34, 0xed, 0x9b, 0xd6, 0x51, 0xaa, 0x2c, 0x4e, 0xce, 0x60, 0x5f, 0xe9, + 0x0e, 0xd5, 0xcd, 0xeb, 0x23, 0x27, 0xf8, 0xfb, 0x45, 0xe5, 0x34, 0x63, + 0x77, 0x7f, 0x2e, 0x80, 0xcf, 0x9d, 0x2e, 0xfc, 0xe2, 0x50, 0x75, 0x29, + 0x46, 0xf4, 0xaf, 0x91, 0xed, 0x36, 0xe1, 0x5e, 0xef, 0x66, 0xa1, 0xff, + 0x27, 0xfc, 0x87, 0x7e, 0x60, 0x84, 0x0f, 0x54, 0x51, 0x56, 0x0f, 0x68, + 0x99, 0xc0, 0x3f, 0xeb, 0xa5, 0xa0, 0x46, 0xb0, 0x86, 0x02, 0xb0, 0xc8, + 0xe8, 0x46, 0x13, 0x06, 0xcd, 0xb7, 0x8a, 0xd0, 0x3b, 0x46, 0xd0, 0x14, + 0x64, 0x53, 0x9b, 0x5b, 0x5e, 0x02, 0x45, 0xba, 0x6e, 0x7e, 0x0a, 0xb9, + 0x9e, 0x62, 0xb7, 0xd5, 0x7a, 0x87, 0xea, 0xd3, 0x24, 0xa5, 0xef, 0xb3, + 0xdc, 0x05, 0x9c, 0x04, 0x60, 0x4b, 0xde, 0xa8, 0x90, 0x08, 0x7b, 0x6a, + 0x5f, 0xb4, 0x3f, 0xda, 0xc5, 0x1f, 0x6e, 0xd6, 0x15, 0xde, 0x65, 0xa4, + 0x6e, 0x62, 0x9d, 0x8f, 0xa8, 0xbe, 0x86, 0xf6, 0x09, 0x90, 0x40, 0xa5, + 0xf4, 0x23, 0xc5, 0xf6, 0x38, 0x86, 0x0d, 0x1c, 0xed, 0x4a, 0x0a, 0xae, + 0xa4, 0x26, 0xc2, 0x2e, 0xd3, 0x13, 0x66, 0x61, 0xea, 0x35, 0x01, 0x0e, + 0x13, 0xda, 0x78, 0x20, 0xae, 0x59, 0x5f, 0x9b, 0xa9, 0x6c, 0xf9, 0x1b, + 0xdf, 0x76, 0x53, 0xc8, 0xa7, 0xf5, 0x63, 0x6d, 0xf3, 0xff, 0xfd, 0xaf, + 0x75, 0x4b, 0xac, 0x67, 0xb1, 0x3c, 0xbf, 0x5e, 0xde, 0x73, 0x02, 0x6d, + 0xd2, 0x0c, 0xb1, +#if !defined(BORINGSSL_FIPS_BREAK_RSA_SIG) + 0x64 +#else + 0x00 +#endif + }; + const uint8_t kDRBGEntropy[48] = + "BCM Known Answer Test DBRG Initial Entropy "; + const uint8_t kDRBGPersonalization[18] = "BCMPersonalization"; + const uint8_t kDRBGAD[16] = "BCM DRBG KAT AD "; + const uint8_t kDRBGOutput[64] = { + 0x1d, 0x63, 0xdf, 0x05, 0x51, 0x49, 0x22, 0x46, 0xcd, 0x9b, 0xc5, + 0xbb, 0xf1, 0x5d, 0x44, 0xae, 0x13, 0x78, 0xb1, 0xe4, 0x7c, 0xf1, + 0x96, 0x33, 0x3d, 0x60, 0xb6, 0x29, 0xd4, 0xbb, 0x6b, 0x44, 0xf9, + 0xef, 0xd9, 0xf4, 0xa2, 0xba, 0x48, 0xea, 0x39, 0x75, 0x59, 0x32, + 0xf7, 0x31, 0x2c, 0x98, 0x14, 0x2b, 0x49, 0xdf, 0x02, 0xb6, 0x5d, + 0x71, 0x09, 0x50, 0xdb, 0x23, 0xdb, 0xe5, 0x22, +#if !defined(BORINGSSL_FIPS_BREAK_DRBG) + 0x95 +#else + 0x00 +#endif + }; + const uint8_t kDRBGEntropy2[48] = + "BCM Known Answer Test DBRG Reseed Entropy "; + const uint8_t kDRBGReseedOutput[64] = { + 0xa4, 0x77, 0x05, 0xdb, 0x14, 0x11, 0x76, 0x71, 0x42, 0x5b, 0xd8, + 0xd7, 0xa5, 0x4f, 0x8b, 0x39, 0xf2, 0x10, 0x4a, 0x50, 0x5b, 0xa2, + 0xc8, 0xf0, 0xbb, 0x3e, 0xa1, 0xa5, 0x90, 0x7d, 0x54, 0xd9, 0xc6, + 0xb0, 0x96, 0xc0, 0x2b, 0x7e, 0x9b, 0xc9, 0xa1, 0xdd, 0x78, 0x2e, + 0xd5, 0xa8, 0x66, 0x16, 0xbd, 0x18, 0x3c, 0xf2, 0xaa, 0x7a, 0x2b, + 0x37, 0xf9, 0xab, 0x35, 0x64, 0x15, 0x01, 0x3f, 0xc4, + }; + const uint8_t kECDSASigR[32] = { + 0x67, 0x80, 0xc5, 0xfc, 0x70, 0x27, 0x5e, 0x2c, 0x70, 0x61, 0xa0, + 0xe7, 0x87, 0x7b, 0xb1, 0x74, 0xde, 0xad, 0xeb, 0x98, 0x87, 0x02, + 0x7f, 0x3f, 0xa8, 0x36, 0x54, 0x15, 0x8b, 0xa7, 0xf5, +#if !defined(BORINGSSL_FIPS_BREAK_ECDSA_SIG) + 0x0c, +#else + 0x00, +#endif + }; + const uint8_t kECDSASigS[32] = { + 0xa5, 0x93, 0xe0, 0x23, 0x91, 0xe7, 0x4b, 0x8d, 0x77, 0x25, 0xa6, + 0xba, 0x4d, 0xd9, 0x86, 0x77, 0xda, 0x7d, 0x8f, 0xef, 0xc4, 0x1a, + 0xf0, 0xcc, 0x81, 0xe5, 0xea, 0x3f, 0xc2, 0x41, 0x7f, 0xd8, + }; + + EVP_AEAD_CTX aead_ctx; + EVP_AEAD_CTX_zero(&aead_ctx); + RSA *rsa_key = NULL; + EC_KEY *ec_key = NULL; + ECDSA_SIG *sig = NULL; + int ret = 0; + + AES_KEY aes_key; + uint8_t aes_iv[16]; + uint8_t output[256]; + + // 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, + AES_ENCRYPT); + if (!check_test(kAESCBCCiphertext, output, sizeof(kAESCBCCiphertext), + "AES-CBC Encryption KAT")) { + goto err; + } + + // 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), + &aes_key, aes_iv, AES_DECRYPT); + if (!check_test(kPlaintext, output, sizeof(kPlaintext), + "AES-CBC Decryption KAT")) { + goto err; + } + + size_t out_len; + uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; + 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; + } + + // AES-GCM Encryption KAT + if (!EVP_AEAD_CTX_seal(&aead_ctx, output, &out_len, sizeof(output), nonce, + EVP_AEAD_nonce_length(EVP_aead_aes_128_gcm()), + 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; + } + + // AES-GCM Decryption KAT + if (!EVP_AEAD_CTX_open(&aead_ctx, output, &out_len, sizeof(output), nonce, + EVP_AEAD_nonce_length(EVP_aead_aes_128_gcm()), + kAESGCMCiphertext, sizeof(kAESGCMCiphertext), NULL, + 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; + } + + DES_key_schedule des1, des2, des3; + DES_cblock des_iv; + DES_set_key(&kDESKey1, &des1); + DES_set_key(&kDESKey2, &des2); + DES_set_key(&kDESKey3, &des3); + + // 3DES Encryption KAT + memcpy(&des_iv, &kDESIV, sizeof(des_iv)); + DES_ede3_cbc_encrypt(kPlaintext, output, sizeof(kPlaintext), &des1, &des2, + &des3, &des_iv, DES_ENCRYPT); + if (!check_test(kDESCiphertext, output, sizeof(kDESCiphertext), + "3DES Encryption KAT")) { + goto err; + } + + // 3DES Decryption KAT + memcpy(&des_iv, &kDESIV, sizeof(des_iv)); + DES_ede3_cbc_encrypt(kDESCiphertext, output, sizeof(kDESCiphertext), &des1, + &des2, &des3, &des_iv, DES_DECRYPT); + if (!check_test(kPlaintext, output, sizeof(kPlaintext), + "3DES Decryption KAT")) { + goto err; + } + + // SHA-1 KAT + SHA1(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA1, output, sizeof(kPlaintextSHA1), + "SHA-1 KAT")) { + goto err; + } + + // SHA-256 KAT + SHA256(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA256, output, sizeof(kPlaintextSHA256), + "SHA-256 KAT")) { + goto err; + } + + // SHA-512 KAT + SHA512(kPlaintext, sizeof(kPlaintext), output); + if (!check_test(kPlaintextSHA512, output, sizeof(kPlaintextSHA512), + "SHA-512 KAT")) { + goto err; + } + + rsa_key = self_test_rsa_key(); + if (rsa_key == NULL) { + fprintf(stderr, "RSA KeyGen failed\n"); + goto err; + } + + // RSA Sign KAT + unsigned sig_len; + + // Disable blinding for the power-on tests because it's not needed and + // triggers an entropy draw. + rsa_key->flags |= RSA_FLAG_NO_BLINDING; + + if (!RSA_sign(NID_sha256, kPlaintextSHA256, sizeof(kPlaintextSHA256), output, + &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)) { + fprintf(stderr, "RSA Verify KAT failed.\n"); + goto err; + } + + ec_key = self_test_ecdsa_key(); + if (ec_key == NULL) { + fprintf(stderr, "ECDSA KeyGen failed\n"); + goto err; + } + + // ECDSA Sign/Verify PWCT + + // The 'k' value for ECDSA is fixed to avoid an entropy draw. + ec_key->fixed_k = BN_new(); + if (ec_key->fixed_k == NULL || + !BN_set_word(ec_key->fixed_k, 42)) { + fprintf(stderr, "Out of memory\n"); + goto err; + } + + sig = ECDSA_do_sign(kPlaintextSHA256, sizeof(kPlaintextSHA256), ec_key); + + uint8_t ecdsa_r_bytes[sizeof(kECDSASigR)]; + uint8_t ecdsa_s_bytes[sizeof(kECDSASigS)]; + if (sig == NULL || + BN_num_bytes(sig->r) != sizeof(ecdsa_r_bytes) || + !BN_bn2bin(sig->r, ecdsa_r_bytes) || + BN_num_bytes(sig->s) != sizeof(ecdsa_s_bytes) || + !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")) { + fprintf(stderr, "ECDSA KAT failed.\n"); + goto err; + } + + // DBRG KAT + CTR_DRBG_STATE drbg; + if (!CTR_DRBG_init(&drbg, kDRBGEntropy, kDRBGPersonalization, + sizeof(kDRBGPersonalization)) || + !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGOutput), kDRBGAD, + sizeof(kDRBGAD)) || + !check_test(kDRBGOutput, output, sizeof(kDRBGOutput), + "DBRG Generate KAT") || + !CTR_DRBG_reseed(&drbg, kDRBGEntropy2, kDRBGAD, sizeof(kDRBGAD)) || + !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGReseedOutput), kDRBGAD, + sizeof(kDRBGAD)) || + !check_test(kDRBGReseedOutput, output, sizeof(kDRBGReseedOutput), + "DRBG Reseed KAT")) { + fprintf(stderr, "CTR-DRBG failed.\n"); + goto err; + } + CTR_DRBG_clear(&drbg); + + CTR_DRBG_STATE kZeroDRBG; + memset(&kZeroDRBG, 0, sizeof(kZeroDRBG)); + if (!check_test(&kZeroDRBG, &drbg, sizeof(drbg), "DRBG Clear KAT")) { + goto err; + } + + 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); + EC_KEY_free(ec_key); + ECDSA_SIG_free(sig); + + return ret; +} + +int BORINGSSL_self_test(void) { + return boringssl_fips_self_test(NULL, 0); +} + +#endif // !_MSC_VER diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h new file mode 100644 index 0000000..9891ddf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h.grpc_back new file mode 100644 index 0000000..cc90914 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c new file mode 100644 index 0000000..9a99775 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c @@ -0,0 +1,361 @@ +/* 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.] */ + +// Altivec-optimized SHA1 in C. This is tested on ppc64le only. +// +// References: +// https://software.intel.com/en-us/articles/improving-the-performance-of-the-secure-hash-algorithm-1 +// http://arctic.org/~dean/crypto/sha1.html +// +// This code used the generic SHA-1 from OpenSSL as a basis and AltiVec +// optimisations were added on top. + +#include + +#if defined(OPENSSL_PPC64LE) + +#include + +void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); + +static uint32_t rotate(uint32_t a, int n) { return (a << n) | (a >> (32 - n)); } + +typedef vector unsigned int vec_uint32_t; +typedef vector unsigned char vec_uint8_t; + +// Vector constants +static const vec_uint8_t k_swap_endianness = {3, 2, 1, 0, 7, 6, 5, 4, + 11, 10, 9, 8, 15, 14, 13, 12}; + +// Shift amounts for byte and bit shifts and rotations +static const vec_uint8_t k_4_bytes = {32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32}; +static const vec_uint8_t k_12_bytes = {96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96}; + +#define K_00_19 0x5a827999UL +#define K_20_39 0x6ed9eba1UL +#define K_40_59 0x8f1bbcdcUL +#define K_60_79 0xca62c1d6UL + +// Vector versions of the above. +static const vec_uint32_t K_00_19_x_4 = {K_00_19, K_00_19, K_00_19, K_00_19}; +static const vec_uint32_t K_20_39_x_4 = {K_20_39, K_20_39, K_20_39, K_20_39}; +static const vec_uint32_t K_40_59_x_4 = {K_40_59, K_40_59, K_40_59, K_40_59}; +static const vec_uint32_t K_60_79_x_4 = {K_60_79, K_60_79, K_60_79, K_60_79}; + +// vector message scheduling: compute message schedule for round i..i+3 where i +// is divisible by 4. We return the schedule w[i..i+3] as a vector. In +// addition, we also precompute sum w[i..+3] and an additive constant K. This +// is done to offload some computation of f() in the integer execution units. +// +// Byte shifting code below may not be correct for big-endian systems. +static vec_uint32_t sched_00_15(vec_uint32_t *pre_added, const void *data, + vec_uint32_t k) { + const vector unsigned char unaligned_data = + vec_vsx_ld(0, (const unsigned char*) data); + const vec_uint32_t v = (vec_uint32_t) unaligned_data; + const vec_uint32_t w = vec_perm(v, v, k_swap_endianness); + vec_st(w + k, 0, pre_added); + return w; +} + +// Compute w[i..i+3] using these steps for i in [16, 20, 24, 28] +// +// w'[i ] = (w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]) <<< 1 +// w'[i+1] = (w[i-2] ^ w[i-7] ^ w[i-13] ^ w[i-15]) <<< 1 +// w'[i+2] = (w[i-1] ^ w[i-6] ^ w[i-12] ^ w[i-14]) <<< 1 +// w'[i+3] = ( 0 ^ w[i-5] ^ w[i-11] ^ w[i-13]) <<< 1 +// +// w[ i] = w'[ i] +// w[i+1] = w'[i+1] +// w[i+2] = w'[i+2] +// w[i+3] = w'[i+3] ^ (w'[i] <<< 1) +static vec_uint32_t sched_16_31(vec_uint32_t *pre_added, vec_uint32_t minus_4, + vec_uint32_t minus_8, vec_uint32_t minus_12, + vec_uint32_t minus_16, vec_uint32_t k) { + const vec_uint32_t minus_3 = vec_sro(minus_4, k_4_bytes); + const vec_uint32_t minus_14 = vec_sld((minus_12), (minus_16), 8); + const vec_uint32_t k_1_bit = vec_splat_u32(1); + const vec_uint32_t w_prime = + vec_rl(minus_3 ^ minus_8 ^ minus_14 ^ minus_16, k_1_bit); + const vec_uint32_t w = + w_prime ^ vec_rl(vec_slo(w_prime, k_12_bytes), k_1_bit); + vec_st(w + k, 0, pre_added); + return w; +} + +// Compute w[i..i+3] using this relation for i in [32, 36, 40 ... 76] +// w[i] = (w[i-6] ^ w[i-16] ^ w[i-28] ^ w[i-32]), 2) <<< 2 +static vec_uint32_t sched_32_79(vec_uint32_t *pre_added, vec_uint32_t minus_4, + vec_uint32_t minus_8, vec_uint32_t minus_16, + vec_uint32_t minus_28, vec_uint32_t minus_32, + vec_uint32_t k) { + const vec_uint32_t minus_6 = vec_sld(minus_4, minus_8, 8); + const vec_uint32_t k_2_bits = vec_splat_u32(2); + const vec_uint32_t w = + vec_rl(minus_6 ^ minus_16 ^ minus_28 ^ minus_32, k_2_bits); + vec_st(w + k, 0, pre_added); + return w; +} + +// As pointed out by Wei Dai , F() below can be simplified +// to the code in F_00_19. Wei attributes these optimisations to Peter +// Gutmann's SHS code, and he attributes it to Rich Schroeppel. #define +// F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) I've just become aware of another +// tweak to be made, again from Wei Dai, in F_40_59, (x&a)|(y&a) -> (x|y)&a +#define F_00_19(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F_20_39(b, c, d) ((b) ^ (c) ^ (d)) +#define F_40_59(b, c, d) (((b) & (c)) | (((b) | (c)) & (d))) +#define F_60_79(b, c, d) F_20_39(b, c, d) + +// We pre-added the K constants during message scheduling. +#define BODY_00_19(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_00_19((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_20_39(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_20_39((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_40_59(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_40_59((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_60_79(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_60_79((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { + uint32_t A, B, C, D, E, T; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + + for (;;) { + vec_uint32_t vw[20]; + const uint32_t *w = (const uint32_t *)&vw; + + vec_uint32_t k = K_00_19_x_4; + const vec_uint32_t w0 = sched_00_15(vw + 0, data + 0, k); + BODY_00_19(0, A, B, C, D, E, T); + BODY_00_19(1, T, A, B, C, D, E); + BODY_00_19(2, E, T, A, B, C, D); + BODY_00_19(3, D, E, T, A, B, C); + + const vec_uint32_t w4 = sched_00_15(vw + 1, data + 16, k); + BODY_00_19(4, C, D, E, T, A, B); + BODY_00_19(5, B, C, D, E, T, A); + BODY_00_19(6, A, B, C, D, E, T); + BODY_00_19(7, T, A, B, C, D, E); + + const vec_uint32_t w8 = sched_00_15(vw + 2, data + 32, k); + BODY_00_19(8, E, T, A, B, C, D); + BODY_00_19(9, D, E, T, A, B, C); + BODY_00_19(10, C, D, E, T, A, B); + BODY_00_19(11, B, C, D, E, T, A); + + const vec_uint32_t w12 = sched_00_15(vw + 3, data + 48, k); + BODY_00_19(12, A, B, C, D, E, T); + BODY_00_19(13, T, A, B, C, D, E); + BODY_00_19(14, E, T, A, B, C, D); + BODY_00_19(15, D, E, T, A, B, C); + + const vec_uint32_t w16 = sched_16_31(vw + 4, w12, w8, w4, w0, k); + BODY_00_19(16, C, D, E, T, A, B); + BODY_00_19(17, B, C, D, E, T, A); + BODY_00_19(18, A, B, C, D, E, T); + BODY_00_19(19, T, A, B, C, D, E); + + k = K_20_39_x_4; + const vec_uint32_t w20 = sched_16_31(vw + 5, w16, w12, w8, w4, k); + BODY_20_39(20, E, T, A, B, C, D); + BODY_20_39(21, D, E, T, A, B, C); + BODY_20_39(22, C, D, E, T, A, B); + BODY_20_39(23, B, C, D, E, T, A); + + const vec_uint32_t w24 = sched_16_31(vw + 6, w20, w16, w12, w8, k); + BODY_20_39(24, A, B, C, D, E, T); + BODY_20_39(25, T, A, B, C, D, E); + BODY_20_39(26, E, T, A, B, C, D); + BODY_20_39(27, D, E, T, A, B, C); + + const vec_uint32_t w28 = sched_16_31(vw + 7, w24, w20, w16, w12, k); + BODY_20_39(28, C, D, E, T, A, B); + BODY_20_39(29, B, C, D, E, T, A); + BODY_20_39(30, A, B, C, D, E, T); + BODY_20_39(31, T, A, B, C, D, E); + + const vec_uint32_t w32 = sched_32_79(vw + 8, w28, w24, w16, w4, w0, k); + BODY_20_39(32, E, T, A, B, C, D); + BODY_20_39(33, D, E, T, A, B, C); + BODY_20_39(34, C, D, E, T, A, B); + BODY_20_39(35, B, C, D, E, T, A); + + const vec_uint32_t w36 = sched_32_79(vw + 9, w32, w28, w20, w8, w4, k); + BODY_20_39(36, A, B, C, D, E, T); + BODY_20_39(37, T, A, B, C, D, E); + BODY_20_39(38, E, T, A, B, C, D); + BODY_20_39(39, D, E, T, A, B, C); + + k = K_40_59_x_4; + const vec_uint32_t w40 = sched_32_79(vw + 10, w36, w32, w24, w12, w8, k); + BODY_40_59(40, C, D, E, T, A, B); + BODY_40_59(41, B, C, D, E, T, A); + BODY_40_59(42, A, B, C, D, E, T); + BODY_40_59(43, T, A, B, C, D, E); + + const vec_uint32_t w44 = sched_32_79(vw + 11, w40, w36, w28, w16, w12, k); + BODY_40_59(44, E, T, A, B, C, D); + BODY_40_59(45, D, E, T, A, B, C); + BODY_40_59(46, C, D, E, T, A, B); + BODY_40_59(47, B, C, D, E, T, A); + + const vec_uint32_t w48 = sched_32_79(vw + 12, w44, w40, w32, w20, w16, k); + BODY_40_59(48, A, B, C, D, E, T); + BODY_40_59(49, T, A, B, C, D, E); + BODY_40_59(50, E, T, A, B, C, D); + BODY_40_59(51, D, E, T, A, B, C); + + const vec_uint32_t w52 = sched_32_79(vw + 13, w48, w44, w36, w24, w20, k); + BODY_40_59(52, C, D, E, T, A, B); + BODY_40_59(53, B, C, D, E, T, A); + BODY_40_59(54, A, B, C, D, E, T); + BODY_40_59(55, T, A, B, C, D, E); + + const vec_uint32_t w56 = sched_32_79(vw + 14, w52, w48, w40, w28, w24, k); + BODY_40_59(56, E, T, A, B, C, D); + BODY_40_59(57, D, E, T, A, B, C); + BODY_40_59(58, C, D, E, T, A, B); + BODY_40_59(59, B, C, D, E, T, A); + + k = K_60_79_x_4; + const vec_uint32_t w60 = sched_32_79(vw + 15, w56, w52, w44, w32, w28, k); + BODY_60_79(60, A, B, C, D, E, T); + BODY_60_79(61, T, A, B, C, D, E); + BODY_60_79(62, E, T, A, B, C, D); + BODY_60_79(63, D, E, T, A, B, C); + + const vec_uint32_t w64 = sched_32_79(vw + 16, w60, w56, w48, w36, w32, k); + BODY_60_79(64, C, D, E, T, A, B); + BODY_60_79(65, B, C, D, E, T, A); + BODY_60_79(66, A, B, C, D, E, T); + BODY_60_79(67, T, A, B, C, D, E); + + const vec_uint32_t w68 = sched_32_79(vw + 17, w64, w60, w52, w40, w36, k); + BODY_60_79(68, E, T, A, B, C, D); + BODY_60_79(69, D, E, T, A, B, C); + BODY_60_79(70, C, D, E, T, A, B); + BODY_60_79(71, B, C, D, E, T, A); + + const vec_uint32_t w72 = sched_32_79(vw + 18, w68, w64, w56, w44, w40, k); + BODY_60_79(72, A, B, C, D, E, T); + BODY_60_79(73, T, A, B, C, D, E); + BODY_60_79(74, E, T, A, B, C, D); + BODY_60_79(75, D, E, T, A, B, C); + + // We don't use the last value + (void)sched_32_79(vw + 19, w72, w68, w60, w48, w44, k); + BODY_60_79(76, C, D, E, T, A, B); + BODY_60_79(77, B, C, D, E, T, A); + BODY_60_79(78, A, B, C, D, E, T); + BODY_60_79(79, T, A, B, C, D, E); + + const uint32_t mask = 0xffffffffUL; + state[0] = (state[0] + E) & mask; + state[1] = (state[1] + T) & mask; + state[2] = (state[2] + A) & mask; + state[3] = (state[3] + B) & mask; + state[4] = (state[4] + C) & mask; + + data += 64; + if (--num == 0) { + break; + } + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + } +} + +#endif // OPENSSL_PPC64LE + +#undef K_00_19 +#undef K_20_39 +#undef K_40_59 +#undef K_60_79 +#undef F_00_19 +#undef F_20_39 +#undef F_40_59 +#undef F_60_79 +#undef BODY_00_19 +#undef BODY_20_39 +#undef BODY_40_59 +#undef BODY_60_79 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back new file mode 100644 index 0000000..3152827 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back @@ -0,0 +1,361 @@ +/* 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.] */ + +// Altivec-optimized SHA1 in C. This is tested on ppc64le only. +// +// References: +// https://software.intel.com/en-us/articles/improving-the-performance-of-the-secure-hash-algorithm-1 +// http://arctic.org/~dean/crypto/sha1.html +// +// This code used the generic SHA-1 from OpenSSL as a basis and AltiVec +// optimisations were added on top. + +#include + +#if defined(OPENSSL_PPC64LE) + +#include + +void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); + +static uint32_t rotate(uint32_t a, int n) { return (a << n) | (a >> (32 - n)); } + +typedef vector unsigned int vec_uint32_t; +typedef vector unsigned char vec_uint8_t; + +// Vector constants +static const vec_uint8_t k_swap_endianness = {3, 2, 1, 0, 7, 6, 5, 4, + 11, 10, 9, 8, 15, 14, 13, 12}; + +// Shift amounts for byte and bit shifts and rotations +static const vec_uint8_t k_4_bytes = {32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32}; +static const vec_uint8_t k_12_bytes = {96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96}; + +#define K_00_19 0x5a827999UL +#define K_20_39 0x6ed9eba1UL +#define K_40_59 0x8f1bbcdcUL +#define K_60_79 0xca62c1d6UL + +// Vector versions of the above. +static const vec_uint32_t K_00_19_x_4 = {K_00_19, K_00_19, K_00_19, K_00_19}; +static const vec_uint32_t K_20_39_x_4 = {K_20_39, K_20_39, K_20_39, K_20_39}; +static const vec_uint32_t K_40_59_x_4 = {K_40_59, K_40_59, K_40_59, K_40_59}; +static const vec_uint32_t K_60_79_x_4 = {K_60_79, K_60_79, K_60_79, K_60_79}; + +// vector message scheduling: compute message schedule for round i..i+3 where i +// is divisible by 4. We return the schedule w[i..i+3] as a vector. In +// addition, we also precompute sum w[i..+3] and an additive constant K. This +// is done to offload some computation of f() in the integer execution units. +// +// Byte shifting code below may not be correct for big-endian systems. +static vec_uint32_t sched_00_15(vec_uint32_t *pre_added, const void *data, + vec_uint32_t k) { + const vector unsigned char unaligned_data = + vec_vsx_ld(0, (const unsigned char*) data); + const vec_uint32_t v = (vec_uint32_t) unaligned_data; + const vec_uint32_t w = vec_perm(v, v, k_swap_endianness); + vec_st(w + k, 0, pre_added); + return w; +} + +// Compute w[i..i+3] using these steps for i in [16, 20, 24, 28] +// +// w'[i ] = (w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]) <<< 1 +// w'[i+1] = (w[i-2] ^ w[i-7] ^ w[i-13] ^ w[i-15]) <<< 1 +// w'[i+2] = (w[i-1] ^ w[i-6] ^ w[i-12] ^ w[i-14]) <<< 1 +// w'[i+3] = ( 0 ^ w[i-5] ^ w[i-11] ^ w[i-13]) <<< 1 +// +// w[ i] = w'[ i] +// w[i+1] = w'[i+1] +// w[i+2] = w'[i+2] +// w[i+3] = w'[i+3] ^ (w'[i] <<< 1) +static vec_uint32_t sched_16_31(vec_uint32_t *pre_added, vec_uint32_t minus_4, + vec_uint32_t minus_8, vec_uint32_t minus_12, + vec_uint32_t minus_16, vec_uint32_t k) { + const vec_uint32_t minus_3 = vec_sro(minus_4, k_4_bytes); + const vec_uint32_t minus_14 = vec_sld((minus_12), (minus_16), 8); + const vec_uint32_t k_1_bit = vec_splat_u32(1); + const vec_uint32_t w_prime = + vec_rl(minus_3 ^ minus_8 ^ minus_14 ^ minus_16, k_1_bit); + const vec_uint32_t w = + w_prime ^ vec_rl(vec_slo(w_prime, k_12_bytes), k_1_bit); + vec_st(w + k, 0, pre_added); + return w; +} + +// Compute w[i..i+3] using this relation for i in [32, 36, 40 ... 76] +// w[i] = (w[i-6] ^ w[i-16] ^ w[i-28] ^ w[i-32]), 2) <<< 2 +static vec_uint32_t sched_32_79(vec_uint32_t *pre_added, vec_uint32_t minus_4, + vec_uint32_t minus_8, vec_uint32_t minus_16, + vec_uint32_t minus_28, vec_uint32_t minus_32, + vec_uint32_t k) { + const vec_uint32_t minus_6 = vec_sld(minus_4, minus_8, 8); + const vec_uint32_t k_2_bits = vec_splat_u32(2); + const vec_uint32_t w = + vec_rl(minus_6 ^ minus_16 ^ minus_28 ^ minus_32, k_2_bits); + vec_st(w + k, 0, pre_added); + return w; +} + +// As pointed out by Wei Dai , F() below can be simplified +// to the code in F_00_19. Wei attributes these optimisations to Peter +// Gutmann's SHS code, and he attributes it to Rich Schroeppel. #define +// F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) I've just become aware of another +// tweak to be made, again from Wei Dai, in F_40_59, (x&a)|(y&a) -> (x|y)&a +#define F_00_19(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F_20_39(b, c, d) ((b) ^ (c) ^ (d)) +#define F_40_59(b, c, d) (((b) & (c)) | (((b) | (c)) & (d))) +#define F_60_79(b, c, d) F_20_39(b, c, d) + +// We pre-added the K constants during message scheduling. +#define BODY_00_19(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_00_19((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_20_39(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_20_39((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_40_59(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_40_59((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +#define BODY_60_79(i, a, b, c, d, e, f) \ + do { \ + (f) = w[i] + (e) + rotate((a), 5) + F_60_79((b), (c), (d)); \ + (b) = rotate((b), 30); \ + } while (0) + +void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { + uint32_t A, B, C, D, E, T; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + + for (;;) { + vec_uint32_t vw[20]; + const uint32_t *w = (const uint32_t *)&vw; + + vec_uint32_t k = K_00_19_x_4; + const vec_uint32_t w0 = sched_00_15(vw + 0, data + 0, k); + BODY_00_19(0, A, B, C, D, E, T); + BODY_00_19(1, T, A, B, C, D, E); + BODY_00_19(2, E, T, A, B, C, D); + BODY_00_19(3, D, E, T, A, B, C); + + const vec_uint32_t w4 = sched_00_15(vw + 1, data + 16, k); + BODY_00_19(4, C, D, E, T, A, B); + BODY_00_19(5, B, C, D, E, T, A); + BODY_00_19(6, A, B, C, D, E, T); + BODY_00_19(7, T, A, B, C, D, E); + + const vec_uint32_t w8 = sched_00_15(vw + 2, data + 32, k); + BODY_00_19(8, E, T, A, B, C, D); + BODY_00_19(9, D, E, T, A, B, C); + BODY_00_19(10, C, D, E, T, A, B); + BODY_00_19(11, B, C, D, E, T, A); + + const vec_uint32_t w12 = sched_00_15(vw + 3, data + 48, k); + BODY_00_19(12, A, B, C, D, E, T); + BODY_00_19(13, T, A, B, C, D, E); + BODY_00_19(14, E, T, A, B, C, D); + BODY_00_19(15, D, E, T, A, B, C); + + const vec_uint32_t w16 = sched_16_31(vw + 4, w12, w8, w4, w0, k); + BODY_00_19(16, C, D, E, T, A, B); + BODY_00_19(17, B, C, D, E, T, A); + BODY_00_19(18, A, B, C, D, E, T); + BODY_00_19(19, T, A, B, C, D, E); + + k = K_20_39_x_4; + const vec_uint32_t w20 = sched_16_31(vw + 5, w16, w12, w8, w4, k); + BODY_20_39(20, E, T, A, B, C, D); + BODY_20_39(21, D, E, T, A, B, C); + BODY_20_39(22, C, D, E, T, A, B); + BODY_20_39(23, B, C, D, E, T, A); + + const vec_uint32_t w24 = sched_16_31(vw + 6, w20, w16, w12, w8, k); + BODY_20_39(24, A, B, C, D, E, T); + BODY_20_39(25, T, A, B, C, D, E); + BODY_20_39(26, E, T, A, B, C, D); + BODY_20_39(27, D, E, T, A, B, C); + + const vec_uint32_t w28 = sched_16_31(vw + 7, w24, w20, w16, w12, k); + BODY_20_39(28, C, D, E, T, A, B); + BODY_20_39(29, B, C, D, E, T, A); + BODY_20_39(30, A, B, C, D, E, T); + BODY_20_39(31, T, A, B, C, D, E); + + const vec_uint32_t w32 = sched_32_79(vw + 8, w28, w24, w16, w4, w0, k); + BODY_20_39(32, E, T, A, B, C, D); + BODY_20_39(33, D, E, T, A, B, C); + BODY_20_39(34, C, D, E, T, A, B); + BODY_20_39(35, B, C, D, E, T, A); + + const vec_uint32_t w36 = sched_32_79(vw + 9, w32, w28, w20, w8, w4, k); + BODY_20_39(36, A, B, C, D, E, T); + BODY_20_39(37, T, A, B, C, D, E); + BODY_20_39(38, E, T, A, B, C, D); + BODY_20_39(39, D, E, T, A, B, C); + + k = K_40_59_x_4; + const vec_uint32_t w40 = sched_32_79(vw + 10, w36, w32, w24, w12, w8, k); + BODY_40_59(40, C, D, E, T, A, B); + BODY_40_59(41, B, C, D, E, T, A); + BODY_40_59(42, A, B, C, D, E, T); + BODY_40_59(43, T, A, B, C, D, E); + + const vec_uint32_t w44 = sched_32_79(vw + 11, w40, w36, w28, w16, w12, k); + BODY_40_59(44, E, T, A, B, C, D); + BODY_40_59(45, D, E, T, A, B, C); + BODY_40_59(46, C, D, E, T, A, B); + BODY_40_59(47, B, C, D, E, T, A); + + const vec_uint32_t w48 = sched_32_79(vw + 12, w44, w40, w32, w20, w16, k); + BODY_40_59(48, A, B, C, D, E, T); + BODY_40_59(49, T, A, B, C, D, E); + BODY_40_59(50, E, T, A, B, C, D); + BODY_40_59(51, D, E, T, A, B, C); + + const vec_uint32_t w52 = sched_32_79(vw + 13, w48, w44, w36, w24, w20, k); + BODY_40_59(52, C, D, E, T, A, B); + BODY_40_59(53, B, C, D, E, T, A); + BODY_40_59(54, A, B, C, D, E, T); + BODY_40_59(55, T, A, B, C, D, E); + + const vec_uint32_t w56 = sched_32_79(vw + 14, w52, w48, w40, w28, w24, k); + BODY_40_59(56, E, T, A, B, C, D); + BODY_40_59(57, D, E, T, A, B, C); + BODY_40_59(58, C, D, E, T, A, B); + BODY_40_59(59, B, C, D, E, T, A); + + k = K_60_79_x_4; + const vec_uint32_t w60 = sched_32_79(vw + 15, w56, w52, w44, w32, w28, k); + BODY_60_79(60, A, B, C, D, E, T); + BODY_60_79(61, T, A, B, C, D, E); + BODY_60_79(62, E, T, A, B, C, D); + BODY_60_79(63, D, E, T, A, B, C); + + const vec_uint32_t w64 = sched_32_79(vw + 16, w60, w56, w48, w36, w32, k); + BODY_60_79(64, C, D, E, T, A, B); + BODY_60_79(65, B, C, D, E, T, A); + BODY_60_79(66, A, B, C, D, E, T); + BODY_60_79(67, T, A, B, C, D, E); + + const vec_uint32_t w68 = sched_32_79(vw + 17, w64, w60, w52, w40, w36, k); + BODY_60_79(68, E, T, A, B, C, D); + BODY_60_79(69, D, E, T, A, B, C); + BODY_60_79(70, C, D, E, T, A, B); + BODY_60_79(71, B, C, D, E, T, A); + + const vec_uint32_t w72 = sched_32_79(vw + 18, w68, w64, w56, w44, w40, k); + BODY_60_79(72, A, B, C, D, E, T); + BODY_60_79(73, T, A, B, C, D, E); + BODY_60_79(74, E, T, A, B, C, D); + BODY_60_79(75, D, E, T, A, B, C); + + // We don't use the last value + (void)sched_32_79(vw + 19, w72, w68, w60, w48, w44, k); + BODY_60_79(76, C, D, E, T, A, B); + BODY_60_79(77, B, C, D, E, T, A); + BODY_60_79(78, A, B, C, D, E, T); + BODY_60_79(79, T, A, B, C, D, E); + + const uint32_t mask = 0xffffffffUL; + state[0] = (state[0] + E) & mask; + state[1] = (state[1] + T) & mask; + state[2] = (state[2] + A) & mask; + state[3] = (state[3] + B) & mask; + state[4] = (state[4] + C) & mask; + + data += 64; + if (--num == 0) { + break; + } + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + } +} + +#endif // OPENSSL_PPC64LE + +#undef K_00_19 +#undef K_20_39 +#undef K_40_59 +#undef K_60_79 +#undef F_00_19 +#undef F_20_39 +#undef F_40_59 +#undef F_60_79 +#undef BODY_00_19 +#undef BODY_20_39 +#undef BODY_40_59 +#undef BODY_60_79 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c new file mode 100644 index 0000000..1e5aaea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c @@ -0,0 +1,371 @@ +/* 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" + + +int SHA1_Init(SHA_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA_CTX)); + sha->h[0] = 0x67452301UL; + sha->h[1] = 0xefcdab89UL; + sha->h[2] = 0x98badcfeUL; + sha->h[3] = 0x10325476UL; + sha->h[4] = 0xc3d2e1f0UL; + return 1; +} + +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); + SHA1_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +#define DATA_ORDER_IS_BIG_ENDIAN + +#define HASH_CTX SHA_CTX +#define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 20 +#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)); \ + ll = (c)->h[4]; \ + HOST_l2c(ll, (s)); \ + } while (0) + +#define HASH_UPDATE SHA1_Update +#define HASH_TRANSFORM SHA1_Transform +#define HASH_FINAL SHA1_Final +#define HASH_BLOCK_DATA_ORDER sha1_block_data_order +#define ROTATE(a, n) (((a) << (n)) | ((a) >> (32 - (n)))) +#define Xupdate(a, ix, ia, ib, ic, id) \ + do { \ + (a) = ((ia) ^ (ib) ^ (ic) ^ (id)); \ + (ix) = (a) = ROTATE((a), 1); \ + } while (0) + +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); +#endif + +#include "../digest/md32_common.h" + +#define K_00_19 0x5a827999UL +#define K_20_39 0x6ed9eba1UL +#define K_40_59 0x8f1bbcdcUL +#define K_60_79 0xca62c1d6UL + +// As pointed out by Wei Dai , F() below can be simplified +// to the code in F_00_19. Wei attributes these optimisations to Peter +// Gutmann's SHS code, and he attributes it to Rich Schroeppel. #define +// F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) I've just become aware of another +// tweak to be made, again from Wei Dai, in F_40_59, (x&a)|(y&a) -> (x|y)&a +#define F_00_19(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F_20_39(b, c, d) ((b) ^ (c) ^ (d)) +#define F_40_59(b, c, d) (((b) & (c)) | (((b) | (c)) & (d))) +#define F_60_79(b, c, d) F_20_39(b, c, d) + +#define BODY_00_15(i, a, b, c, d, e, f, xi) \ + do { \ + (f) = (xi) + (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_16_19(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xi, xa, xb, xc, xd); \ + (f) += (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_20_31(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xi, xa, xb, xc, xd); \ + (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_32_39(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_40_59(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) += (e) + K_40_59 + ROTATE((a), 5) + F_40_59((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_60_79(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) = (xa) + (e) + K_60_79 + ROTATE((a), 5) + F_60_79((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#ifdef X +#undef X +#endif + +/* Originally X was an array. As it's automatic it's natural +* to expect RISC compiler to accomodate at least part of it in +* the register bank, isn't it? Unfortunately not all compilers +* "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 + +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { + register uint32_t A, B, C, D, E, T, l; + uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, + XX11, XX12, XX13, XX14, XX15; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + + for (;;) { + HOST_c2l(data, l); + X(0) = l; + HOST_c2l(data, l); + X(1) = l; + BODY_00_15(0, A, B, C, D, E, T, X(0)); + HOST_c2l(data, l); + X(2) = l; + BODY_00_15(1, T, A, B, C, D, E, X(1)); + HOST_c2l(data, l); + X(3) = l; + BODY_00_15(2, E, T, A, B, C, D, X(2)); + HOST_c2l(data, l); + X(4) = l; + BODY_00_15(3, D, E, T, A, B, C, X(3)); + HOST_c2l(data, l); + X(5) = l; + BODY_00_15(4, C, D, E, T, A, B, X(4)); + HOST_c2l(data, l); + X(6) = l; + BODY_00_15(5, B, C, D, E, T, A, X(5)); + HOST_c2l(data, l); + X(7) = l; + BODY_00_15(6, A, B, C, D, E, T, X(6)); + HOST_c2l(data, l); + X(8) = l; + BODY_00_15(7, T, A, B, C, D, E, X(7)); + HOST_c2l(data, l); + X(9) = l; + BODY_00_15(8, E, T, A, B, C, D, X(8)); + HOST_c2l(data, l); + X(10) = l; + BODY_00_15(9, D, E, T, A, B, C, X(9)); + HOST_c2l(data, l); + X(11) = l; + BODY_00_15(10, C, D, E, T, A, B, X(10)); + HOST_c2l(data, l); + X(12) = l; + BODY_00_15(11, B, C, D, E, T, A, X(11)); + HOST_c2l(data, l); + X(13) = l; + BODY_00_15(12, A, B, C, D, E, T, X(12)); + HOST_c2l(data, l); + X(14) = l; + BODY_00_15(13, T, A, B, C, D, E, X(13)); + HOST_c2l(data, l); + X(15) = l; + BODY_00_15(14, E, T, A, B, C, D, X(14)); + BODY_00_15(15, D, E, T, A, B, C, X(15)); + + BODY_16_19(16, C, D, E, T, A, B, X(0), X(0), X(2), X(8), X(13)); + BODY_16_19(17, B, C, D, E, T, A, X(1), X(1), X(3), X(9), X(14)); + BODY_16_19(18, A, B, C, D, E, T, X(2), X(2), X(4), X(10), X(15)); + BODY_16_19(19, T, A, B, C, D, E, X(3), X(3), X(5), X(11), X(0)); + + BODY_20_31(20, E, T, A, B, C, D, X(4), X(4), X(6), X(12), X(1)); + BODY_20_31(21, D, E, T, A, B, C, X(5), X(5), X(7), X(13), X(2)); + BODY_20_31(22, C, D, E, T, A, B, X(6), X(6), X(8), X(14), X(3)); + BODY_20_31(23, B, C, D, E, T, A, X(7), X(7), X(9), X(15), X(4)); + BODY_20_31(24, A, B, C, D, E, T, X(8), X(8), X(10), X(0), X(5)); + BODY_20_31(25, T, A, B, C, D, E, X(9), X(9), X(11), X(1), X(6)); + BODY_20_31(26, E, T, A, B, C, D, X(10), X(10), X(12), X(2), X(7)); + BODY_20_31(27, D, E, T, A, B, C, X(11), X(11), X(13), X(3), X(8)); + BODY_20_31(28, C, D, E, T, A, B, X(12), X(12), X(14), X(4), X(9)); + BODY_20_31(29, B, C, D, E, T, A, X(13), X(13), X(15), X(5), X(10)); + BODY_20_31(30, A, B, C, D, E, T, X(14), X(14), X(0), X(6), X(11)); + BODY_20_31(31, T, A, B, C, D, E, X(15), X(15), X(1), X(7), X(12)); + + BODY_32_39(32, E, T, A, B, C, D, X(0), X(2), X(8), X(13)); + BODY_32_39(33, D, E, T, A, B, C, X(1), X(3), X(9), X(14)); + BODY_32_39(34, C, D, E, T, A, B, X(2), X(4), X(10), X(15)); + BODY_32_39(35, B, C, D, E, T, A, X(3), X(5), X(11), X(0)); + BODY_32_39(36, A, B, C, D, E, T, X(4), X(6), X(12), X(1)); + BODY_32_39(37, T, A, B, C, D, E, X(5), X(7), X(13), X(2)); + BODY_32_39(38, E, T, A, B, C, D, X(6), X(8), X(14), X(3)); + BODY_32_39(39, D, E, T, A, B, C, X(7), X(9), X(15), X(4)); + + BODY_40_59(40, C, D, E, T, A, B, X(8), X(10), X(0), X(5)); + BODY_40_59(41, B, C, D, E, T, A, X(9), X(11), X(1), X(6)); + BODY_40_59(42, A, B, C, D, E, T, X(10), X(12), X(2), X(7)); + BODY_40_59(43, T, A, B, C, D, E, X(11), X(13), X(3), X(8)); + BODY_40_59(44, E, T, A, B, C, D, X(12), X(14), X(4), X(9)); + BODY_40_59(45, D, E, T, A, B, C, X(13), X(15), X(5), X(10)); + BODY_40_59(46, C, D, E, T, A, B, X(14), X(0), X(6), X(11)); + BODY_40_59(47, B, C, D, E, T, A, X(15), X(1), X(7), X(12)); + BODY_40_59(48, A, B, C, D, E, T, X(0), X(2), X(8), X(13)); + BODY_40_59(49, T, A, B, C, D, E, X(1), X(3), X(9), X(14)); + BODY_40_59(50, E, T, A, B, C, D, X(2), X(4), X(10), X(15)); + BODY_40_59(51, D, E, T, A, B, C, X(3), X(5), X(11), X(0)); + BODY_40_59(52, C, D, E, T, A, B, X(4), X(6), X(12), X(1)); + BODY_40_59(53, B, C, D, E, T, A, X(5), X(7), X(13), X(2)); + BODY_40_59(54, A, B, C, D, E, T, X(6), X(8), X(14), X(3)); + BODY_40_59(55, T, A, B, C, D, E, X(7), X(9), X(15), X(4)); + BODY_40_59(56, E, T, A, B, C, D, X(8), X(10), X(0), X(5)); + BODY_40_59(57, D, E, T, A, B, C, X(9), X(11), X(1), X(6)); + BODY_40_59(58, C, D, E, T, A, B, X(10), X(12), X(2), X(7)); + BODY_40_59(59, B, C, D, E, T, A, X(11), X(13), X(3), X(8)); + + BODY_60_79(60, A, B, C, D, E, T, X(12), X(14), X(4), X(9)); + BODY_60_79(61, T, A, B, C, D, E, X(13), X(15), X(5), X(10)); + BODY_60_79(62, E, T, A, B, C, D, X(14), X(0), X(6), X(11)); + BODY_60_79(63, D, E, T, A, B, C, X(15), X(1), X(7), X(12)); + BODY_60_79(64, C, D, E, T, A, B, X(0), X(2), X(8), X(13)); + BODY_60_79(65, B, C, D, E, T, A, X(1), X(3), X(9), X(14)); + BODY_60_79(66, A, B, C, D, E, T, X(2), X(4), X(10), X(15)); + BODY_60_79(67, T, A, B, C, D, E, X(3), X(5), X(11), X(0)); + BODY_60_79(68, E, T, A, B, C, D, X(4), X(6), X(12), X(1)); + BODY_60_79(69, D, E, T, A, B, C, X(5), X(7), X(13), X(2)); + BODY_60_79(70, C, D, E, T, A, B, X(6), X(8), X(14), X(3)); + BODY_60_79(71, B, C, D, E, T, A, X(7), X(9), X(15), X(4)); + BODY_60_79(72, A, B, C, D, E, T, X(8), X(10), X(0), X(5)); + BODY_60_79(73, T, A, B, C, D, E, X(9), X(11), X(1), X(6)); + BODY_60_79(74, E, T, A, B, C, D, X(10), X(12), X(2), X(7)); + BODY_60_79(75, D, E, T, A, B, C, X(11), X(13), X(3), X(8)); + BODY_60_79(76, C, D, E, T, A, B, X(12), X(14), X(4), X(9)); + BODY_60_79(77, B, C, D, E, T, A, X(13), X(15), X(5), X(10)); + BODY_60_79(78, A, B, C, D, E, T, X(14), X(0), X(6), X(11)); + BODY_60_79(79, T, A, B, C, D, E, X(15), X(1), X(7), X(12)); + + state[0] = (state[0] + E) & 0xffffffffL; + state[1] = (state[1] + T) & 0xffffffffL; + state[2] = (state[2] + A) & 0xffffffffL; + state[3] = (state[3] + B) & 0xffffffffL; + state[4] = (state[4] + C) & 0xffffffffL; + + if (--num == 0) { + break; + } + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + } +} +#endif + +#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 +#undef HASH_FINAL +#undef HASH_BLOCK_DATA_ORDER +#undef ROTATE +#undef Xupdate +#undef K_00_19 +#undef K_20_39 +#undef K_40_59 +#undef K_60_79 +#undef F_00_19 +#undef F_20_39 +#undef F_40_59 +#undef F_60_79 +#undef BODY_00_15 +#undef BODY_16_19 +#undef BODY_20_31 +#undef BODY_32_39 +#undef BODY_40_59 +#undef BODY_60_79 +#undef X +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back new file mode 100644 index 0000000..3b76194 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back @@ -0,0 +1,371 @@ +/* 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" + + +int SHA1_Init(SHA_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA_CTX)); + sha->h[0] = 0x67452301UL; + sha->h[1] = 0xefcdab89UL; + sha->h[2] = 0x98badcfeUL; + sha->h[3] = 0x10325476UL; + sha->h[4] = 0xc3d2e1f0UL; + return 1; +} + +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); + SHA1_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +#define DATA_ORDER_IS_BIG_ENDIAN + +#define HASH_CTX SHA_CTX +#define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 20 +#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)); \ + ll = (c)->h[4]; \ + HOST_l2c(ll, (s)); \ + } while (0) + +#define HASH_UPDATE SHA1_Update +#define HASH_TRANSFORM SHA1_Transform +#define HASH_FINAL SHA1_Final +#define HASH_BLOCK_DATA_ORDER sha1_block_data_order +#define ROTATE(a, n) (((a) << (n)) | ((a) >> (32 - (n)))) +#define Xupdate(a, ix, ia, ib, ic, id) \ + do { \ + (a) = ((ia) ^ (ib) ^ (ic) ^ (id)); \ + (ix) = (a) = ROTATE((a), 1); \ + } while (0) + +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); +#endif + +#include "../digest/md32_common.h" + +#define K_00_19 0x5a827999UL +#define K_20_39 0x6ed9eba1UL +#define K_40_59 0x8f1bbcdcUL +#define K_60_79 0xca62c1d6UL + +// As pointed out by Wei Dai , F() below can be simplified +// to the code in F_00_19. Wei attributes these optimisations to Peter +// Gutmann's SHS code, and he attributes it to Rich Schroeppel. #define +// F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) I've just become aware of another +// tweak to be made, again from Wei Dai, in F_40_59, (x&a)|(y&a) -> (x|y)&a +#define F_00_19(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F_20_39(b, c, d) ((b) ^ (c) ^ (d)) +#define F_40_59(b, c, d) (((b) & (c)) | (((b) | (c)) & (d))) +#define F_60_79(b, c, d) F_20_39(b, c, d) + +#define BODY_00_15(i, a, b, c, d, e, f, xi) \ + do { \ + (f) = (xi) + (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_16_19(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xi, xa, xb, xc, xd); \ + (f) += (e) + K_00_19 + ROTATE((a), 5) + F_00_19((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_20_31(i, a, b, c, d, e, f, xi, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xi, xa, xb, xc, xd); \ + (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_32_39(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) += (e) + K_20_39 + ROTATE((a), 5) + F_20_39((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_40_59(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) += (e) + K_40_59 + ROTATE((a), 5) + F_40_59((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#define BODY_60_79(i, a, b, c, d, e, f, xa, xb, xc, xd) \ + do { \ + Xupdate(f, xa, xa, xb, xc, xd); \ + (f) = (xa) + (e) + K_60_79 + ROTATE((a), 5) + F_60_79((b), (c), (d)); \ + (b) = ROTATE((b), 30); \ + } while (0) + +#ifdef X +#undef X +#endif + +/* Originally X was an array. As it's automatic it's natural +* to expect RISC compiler to accomodate at least part of it in +* the register bank, isn't it? Unfortunately not all compilers +* "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 + +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { + register uint32_t A, B, C, D, E, T, l; + uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, + XX11, XX12, XX13, XX14, XX15; + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + + for (;;) { + HOST_c2l(data, l); + X(0) = l; + HOST_c2l(data, l); + X(1) = l; + BODY_00_15(0, A, B, C, D, E, T, X(0)); + HOST_c2l(data, l); + X(2) = l; + BODY_00_15(1, T, A, B, C, D, E, X(1)); + HOST_c2l(data, l); + X(3) = l; + BODY_00_15(2, E, T, A, B, C, D, X(2)); + HOST_c2l(data, l); + X(4) = l; + BODY_00_15(3, D, E, T, A, B, C, X(3)); + HOST_c2l(data, l); + X(5) = l; + BODY_00_15(4, C, D, E, T, A, B, X(4)); + HOST_c2l(data, l); + X(6) = l; + BODY_00_15(5, B, C, D, E, T, A, X(5)); + HOST_c2l(data, l); + X(7) = l; + BODY_00_15(6, A, B, C, D, E, T, X(6)); + HOST_c2l(data, l); + X(8) = l; + BODY_00_15(7, T, A, B, C, D, E, X(7)); + HOST_c2l(data, l); + X(9) = l; + BODY_00_15(8, E, T, A, B, C, D, X(8)); + HOST_c2l(data, l); + X(10) = l; + BODY_00_15(9, D, E, T, A, B, C, X(9)); + HOST_c2l(data, l); + X(11) = l; + BODY_00_15(10, C, D, E, T, A, B, X(10)); + HOST_c2l(data, l); + X(12) = l; + BODY_00_15(11, B, C, D, E, T, A, X(11)); + HOST_c2l(data, l); + X(13) = l; + BODY_00_15(12, A, B, C, D, E, T, X(12)); + HOST_c2l(data, l); + X(14) = l; + BODY_00_15(13, T, A, B, C, D, E, X(13)); + HOST_c2l(data, l); + X(15) = l; + BODY_00_15(14, E, T, A, B, C, D, X(14)); + BODY_00_15(15, D, E, T, A, B, C, X(15)); + + BODY_16_19(16, C, D, E, T, A, B, X(0), X(0), X(2), X(8), X(13)); + BODY_16_19(17, B, C, D, E, T, A, X(1), X(1), X(3), X(9), X(14)); + BODY_16_19(18, A, B, C, D, E, T, X(2), X(2), X(4), X(10), X(15)); + BODY_16_19(19, T, A, B, C, D, E, X(3), X(3), X(5), X(11), X(0)); + + BODY_20_31(20, E, T, A, B, C, D, X(4), X(4), X(6), X(12), X(1)); + BODY_20_31(21, D, E, T, A, B, C, X(5), X(5), X(7), X(13), X(2)); + BODY_20_31(22, C, D, E, T, A, B, X(6), X(6), X(8), X(14), X(3)); + BODY_20_31(23, B, C, D, E, T, A, X(7), X(7), X(9), X(15), X(4)); + BODY_20_31(24, A, B, C, D, E, T, X(8), X(8), X(10), X(0), X(5)); + BODY_20_31(25, T, A, B, C, D, E, X(9), X(9), X(11), X(1), X(6)); + BODY_20_31(26, E, T, A, B, C, D, X(10), X(10), X(12), X(2), X(7)); + BODY_20_31(27, D, E, T, A, B, C, X(11), X(11), X(13), X(3), X(8)); + BODY_20_31(28, C, D, E, T, A, B, X(12), X(12), X(14), X(4), X(9)); + BODY_20_31(29, B, C, D, E, T, A, X(13), X(13), X(15), X(5), X(10)); + BODY_20_31(30, A, B, C, D, E, T, X(14), X(14), X(0), X(6), X(11)); + BODY_20_31(31, T, A, B, C, D, E, X(15), X(15), X(1), X(7), X(12)); + + BODY_32_39(32, E, T, A, B, C, D, X(0), X(2), X(8), X(13)); + BODY_32_39(33, D, E, T, A, B, C, X(1), X(3), X(9), X(14)); + BODY_32_39(34, C, D, E, T, A, B, X(2), X(4), X(10), X(15)); + BODY_32_39(35, B, C, D, E, T, A, X(3), X(5), X(11), X(0)); + BODY_32_39(36, A, B, C, D, E, T, X(4), X(6), X(12), X(1)); + BODY_32_39(37, T, A, B, C, D, E, X(5), X(7), X(13), X(2)); + BODY_32_39(38, E, T, A, B, C, D, X(6), X(8), X(14), X(3)); + BODY_32_39(39, D, E, T, A, B, C, X(7), X(9), X(15), X(4)); + + BODY_40_59(40, C, D, E, T, A, B, X(8), X(10), X(0), X(5)); + BODY_40_59(41, B, C, D, E, T, A, X(9), X(11), X(1), X(6)); + BODY_40_59(42, A, B, C, D, E, T, X(10), X(12), X(2), X(7)); + BODY_40_59(43, T, A, B, C, D, E, X(11), X(13), X(3), X(8)); + BODY_40_59(44, E, T, A, B, C, D, X(12), X(14), X(4), X(9)); + BODY_40_59(45, D, E, T, A, B, C, X(13), X(15), X(5), X(10)); + BODY_40_59(46, C, D, E, T, A, B, X(14), X(0), X(6), X(11)); + BODY_40_59(47, B, C, D, E, T, A, X(15), X(1), X(7), X(12)); + BODY_40_59(48, A, B, C, D, E, T, X(0), X(2), X(8), X(13)); + BODY_40_59(49, T, A, B, C, D, E, X(1), X(3), X(9), X(14)); + BODY_40_59(50, E, T, A, B, C, D, X(2), X(4), X(10), X(15)); + BODY_40_59(51, D, E, T, A, B, C, X(3), X(5), X(11), X(0)); + BODY_40_59(52, C, D, E, T, A, B, X(4), X(6), X(12), X(1)); + BODY_40_59(53, B, C, D, E, T, A, X(5), X(7), X(13), X(2)); + BODY_40_59(54, A, B, C, D, E, T, X(6), X(8), X(14), X(3)); + BODY_40_59(55, T, A, B, C, D, E, X(7), X(9), X(15), X(4)); + BODY_40_59(56, E, T, A, B, C, D, X(8), X(10), X(0), X(5)); + BODY_40_59(57, D, E, T, A, B, C, X(9), X(11), X(1), X(6)); + BODY_40_59(58, C, D, E, T, A, B, X(10), X(12), X(2), X(7)); + BODY_40_59(59, B, C, D, E, T, A, X(11), X(13), X(3), X(8)); + + BODY_60_79(60, A, B, C, D, E, T, X(12), X(14), X(4), X(9)); + BODY_60_79(61, T, A, B, C, D, E, X(13), X(15), X(5), X(10)); + BODY_60_79(62, E, T, A, B, C, D, X(14), X(0), X(6), X(11)); + BODY_60_79(63, D, E, T, A, B, C, X(15), X(1), X(7), X(12)); + BODY_60_79(64, C, D, E, T, A, B, X(0), X(2), X(8), X(13)); + BODY_60_79(65, B, C, D, E, T, A, X(1), X(3), X(9), X(14)); + BODY_60_79(66, A, B, C, D, E, T, X(2), X(4), X(10), X(15)); + BODY_60_79(67, T, A, B, C, D, E, X(3), X(5), X(11), X(0)); + BODY_60_79(68, E, T, A, B, C, D, X(4), X(6), X(12), X(1)); + BODY_60_79(69, D, E, T, A, B, C, X(5), X(7), X(13), X(2)); + BODY_60_79(70, C, D, E, T, A, B, X(6), X(8), X(14), X(3)); + BODY_60_79(71, B, C, D, E, T, A, X(7), X(9), X(15), X(4)); + BODY_60_79(72, A, B, C, D, E, T, X(8), X(10), X(0), X(5)); + BODY_60_79(73, T, A, B, C, D, E, X(9), X(11), X(1), X(6)); + BODY_60_79(74, E, T, A, B, C, D, X(10), X(12), X(2), X(7)); + BODY_60_79(75, D, E, T, A, B, C, X(11), X(13), X(3), X(8)); + BODY_60_79(76, C, D, E, T, A, B, X(12), X(14), X(4), X(9)); + BODY_60_79(77, B, C, D, E, T, A, X(13), X(15), X(5), X(10)); + BODY_60_79(78, A, B, C, D, E, T, X(14), X(0), X(6), X(11)); + BODY_60_79(79, T, A, B, C, D, E, X(15), X(1), X(7), X(12)); + + state[0] = (state[0] + E) & 0xffffffffL; + state[1] = (state[1] + T) & 0xffffffffL; + state[2] = (state[2] + A) & 0xffffffffL; + state[3] = (state[3] + B) & 0xffffffffL; + state[4] = (state[4] + C) & 0xffffffffL; + + if (--num == 0) { + break; + } + + A = state[0]; + B = state[1]; + C = state[2]; + D = state[3]; + E = state[4]; + } +} +#endif + +#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 +#undef HASH_FINAL +#undef HASH_BLOCK_DATA_ORDER +#undef ROTATE +#undef Xupdate +#undef K_00_19 +#undef K_20_39 +#undef K_40_59 +#undef K_60_79 +#undef F_00_19 +#undef F_20_39 +#undef F_40_59 +#undef F_60_79 +#undef BODY_00_15 +#undef BODY_16_19 +#undef BODY_20_31 +#undef BODY_32_39 +#undef BODY_40_59 +#undef BODY_60_79 +#undef X +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c new file mode 100644 index 0000000..fb73553 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c @@ -0,0 +1,343 @@ +/* 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" + + +int SHA224_Init(SHA256_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); + sha->h[0] = 0xc1059ed8UL; + sha->h[1] = 0x367cd507UL; + sha->h[2] = 0x3070dd17UL; + sha->h[3] = 0xf70e5939UL; + sha->h[4] = 0xffc00b31UL; + sha->h[5] = 0x68581511UL; + sha->h[6] = 0x64f98fa7UL; + sha->h[7] = 0xbefa4fa4UL; + sha->md_len = SHA224_DIGEST_LENGTH; + return 1; +} + +int SHA256_Init(SHA256_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); + sha->h[0] = 0x6a09e667UL; + sha->h[1] = 0xbb67ae85UL; + sha->h[2] = 0x3c6ef372UL; + sha->h[3] = 0xa54ff53aUL; + sha->h[4] = 0x510e527fUL; + sha->h[5] = 0x9b05688cUL; + sha->h[6] = 0x1f83d9abUL; + sha->h[7] = 0x5be0cd19UL; + sha->md_len = SHA256_DIGEST_LENGTH; + return 1; +} + +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); + SHA224_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return 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); + SHA256_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +int SHA224_Update(SHA256_CTX *ctx, const void *data, size_t len) { + return SHA256_Update(ctx, data, len); +} + +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 +// to truncate to amount of bytes not divisible by 4. I bet not, but if it is, +// then default: case shall be extended. For reference. Idea behind separate +// cases for pre-defined lenghts is to let the compiler decide if it's +// appropriate to unroll small loops. +// +// TODO(davidben): The small |md_len| case is one of the few places a low-level +// hash 'final' function can fail. This should never happen. +#define HASH_MAKE_STRING(c, s) \ + do { \ + uint32_t ll; \ + unsigned int nn; \ + switch ((c)->md_len) { \ + case SHA224_DIGEST_LENGTH: \ + for (nn = 0; nn < SHA224_DIGEST_LENGTH / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + case SHA256_DIGEST_LENGTH: \ + for (nn = 0; nn < SHA256_DIGEST_LENGTH / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + default: \ + if ((c)->md_len > SHA256_DIGEST_LENGTH) { \ + return 0; \ + } \ + for (nn = 0; nn < (c)->md_len / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + } \ + } while (0) + + +#define HASH_UPDATE SHA256_Update +#define HASH_TRANSFORM SHA256_Transform +#define HASH_FINAL SHA256_Final +#define HASH_BLOCK_DATA_ORDER sha256_block_data_order +#ifndef SHA256_ASM +static void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num); +#endif + +#include "../digest/md32_common.h" + +#ifndef SHA256_ASM +static const uint32_t K256[64] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, + 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, + 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, + 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, + 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, + 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, + 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, + 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, + 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, + 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL}; + +#define ROTATE(a, n) (((a) << (n)) | ((a) >> (32 - (n)))) + +// FIPS specification refers to right rotations, while our ROTATE macro +// is left one. This is why you might notice that rotation coefficients +// differ from those observed in FIPS document by 32-N... +#define Sigma0(x) (ROTATE((x), 30) ^ ROTATE((x), 19) ^ ROTATE((x), 10)) +#define Sigma1(x) (ROTATE((x), 26) ^ ROTATE((x), 21) ^ ROTATE((x), 7)) +#define sigma0(x) (ROTATE((x), 25) ^ ROTATE((x), 14) ^ ((x) >> 3)) +#define sigma1(x) (ROTATE((x), 15) ^ ROTATE((x), 13) ^ ((x) >> 10)) + +#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + +#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ + do { \ + T1 += h + Sigma1(e) + Ch(e, f, g) + K256[i]; \ + h = Sigma0(a) + Maj(a, b, c); \ + d += T1; \ + h += T1; \ + } while (0) + +#define ROUND_16_63(i, a, b, c, d, e, f, g, h, X) \ + do { \ + s0 = X[(i + 1) & 0x0f]; \ + s0 = sigma0(s0); \ + s1 = X[(i + 14) & 0x0f]; \ + s1 = sigma1(s1); \ + T1 = X[(i) & 0x0f] += s0 + s1 + X[(i + 9) & 0x0f]; \ + ROUND_00_15(i, a, b, c, d, e, f, g, h); \ + } while (0) + +static void sha256_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { + uint32_t a, b, c, d, e, f, g, h, s0, s1, T1; + uint32_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]; + + uint32_t l; + + HOST_c2l(data, l); + T1 = X[0] = l; + ROUND_00_15(0, a, b, c, d, e, f, g, h); + HOST_c2l(data, l); + T1 = X[1] = l; + ROUND_00_15(1, h, a, b, c, d, e, f, g); + HOST_c2l(data, l); + T1 = X[2] = l; + ROUND_00_15(2, g, h, a, b, c, d, e, f); + HOST_c2l(data, l); + T1 = X[3] = l; + ROUND_00_15(3, f, g, h, a, b, c, d, e); + HOST_c2l(data, l); + T1 = X[4] = l; + ROUND_00_15(4, e, f, g, h, a, b, c, d); + HOST_c2l(data, l); + T1 = X[5] = l; + ROUND_00_15(5, d, e, f, g, h, a, b, c); + HOST_c2l(data, l); + T1 = X[6] = l; + ROUND_00_15(6, c, d, e, f, g, h, a, b); + HOST_c2l(data, l); + T1 = X[7] = l; + ROUND_00_15(7, b, c, d, e, f, g, h, a); + HOST_c2l(data, l); + T1 = X[8] = l; + ROUND_00_15(8, a, b, c, d, e, f, g, h); + HOST_c2l(data, l); + T1 = X[9] = l; + ROUND_00_15(9, h, a, b, c, d, e, f, g); + HOST_c2l(data, l); + T1 = X[10] = l; + ROUND_00_15(10, g, h, a, b, c, d, e, f); + HOST_c2l(data, l); + T1 = X[11] = l; + ROUND_00_15(11, f, g, h, a, b, c, d, e); + HOST_c2l(data, l); + T1 = X[12] = l; + ROUND_00_15(12, e, f, g, h, a, b, c, d); + HOST_c2l(data, l); + T1 = X[13] = l; + ROUND_00_15(13, d, e, f, g, h, a, b, c); + HOST_c2l(data, l); + T1 = X[14] = l; + ROUND_00_15(14, c, d, e, f, g, h, a, b); + HOST_c2l(data, l); + T1 = X[15] = l; + ROUND_00_15(15, b, c, d, e, f, g, h, a); + + for (i = 16; i < 64; i += 8) { + ROUND_16_63(i + 0, a, b, c, d, e, f, g, h, X); + ROUND_16_63(i + 1, h, a, b, c, d, e, f, g, X); + ROUND_16_63(i + 2, g, h, a, b, c, d, e, f, X); + ROUND_16_63(i + 3, f, g, h, a, b, c, d, e, X); + ROUND_16_63(i + 4, e, f, g, h, a, b, c, d, X); + ROUND_16_63(i + 5, d, e, f, g, h, a, b, c, X); + ROUND_16_63(i + 6, c, d, e, f, g, h, a, b, X); + ROUND_16_63(i + 7, 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; + } +} + +#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 +#undef HASH_FINAL +#undef HASH_BLOCK_DATA_ORDER +#undef ROTATE +#undef Sigma0 +#undef Sigma1 +#undef sigma0 +#undef sigma1 +#undef Ch +#undef Maj +#undef ROUND_00_15 +#undef ROUND_16_63 +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back new file mode 100644 index 0000000..0e42446 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back @@ -0,0 +1,343 @@ +/* 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" + + +int SHA224_Init(SHA256_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); + sha->h[0] = 0xc1059ed8UL; + sha->h[1] = 0x367cd507UL; + sha->h[2] = 0x3070dd17UL; + sha->h[3] = 0xf70e5939UL; + sha->h[4] = 0xffc00b31UL; + sha->h[5] = 0x68581511UL; + sha->h[6] = 0x64f98fa7UL; + sha->h[7] = 0xbefa4fa4UL; + sha->md_len = SHA224_DIGEST_LENGTH; + return 1; +} + +int SHA256_Init(SHA256_CTX *sha) { + OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); + sha->h[0] = 0x6a09e667UL; + sha->h[1] = 0xbb67ae85UL; + sha->h[2] = 0x3c6ef372UL; + sha->h[3] = 0xa54ff53aUL; + sha->h[4] = 0x510e527fUL; + sha->h[5] = 0x9b05688cUL; + sha->h[6] = 0x1f83d9abUL; + sha->h[7] = 0x5be0cd19UL; + sha->md_len = SHA256_DIGEST_LENGTH; + return 1; +} + +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); + SHA224_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return 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); + SHA256_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +int SHA224_Update(SHA256_CTX *ctx, const void *data, size_t len) { + return SHA256_Update(ctx, data, len); +} + +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 +// to truncate to amount of bytes not divisible by 4. I bet not, but if it is, +// then default: case shall be extended. For reference. Idea behind separate +// cases for pre-defined lenghts is to let the compiler decide if it's +// appropriate to unroll small loops. +// +// TODO(davidben): The small |md_len| case is one of the few places a low-level +// hash 'final' function can fail. This should never happen. +#define HASH_MAKE_STRING(c, s) \ + do { \ + uint32_t ll; \ + unsigned int nn; \ + switch ((c)->md_len) { \ + case SHA224_DIGEST_LENGTH: \ + for (nn = 0; nn < SHA224_DIGEST_LENGTH / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + case SHA256_DIGEST_LENGTH: \ + for (nn = 0; nn < SHA256_DIGEST_LENGTH / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + default: \ + if ((c)->md_len > SHA256_DIGEST_LENGTH) { \ + return 0; \ + } \ + for (nn = 0; nn < (c)->md_len / 4; nn++) { \ + ll = (c)->h[nn]; \ + HOST_l2c(ll, (s)); \ + } \ + break; \ + } \ + } while (0) + + +#define HASH_UPDATE SHA256_Update +#define HASH_TRANSFORM SHA256_Transform +#define HASH_FINAL SHA256_Final +#define HASH_BLOCK_DATA_ORDER sha256_block_data_order +#ifndef SHA256_ASM +static void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num); +#endif + +#include "../digest/md32_common.h" + +#ifndef SHA256_ASM +static const uint32_t K256[64] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, + 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, + 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, + 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, + 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, + 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, + 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, + 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, + 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, + 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL}; + +#define ROTATE(a, n) (((a) << (n)) | ((a) >> (32 - (n)))) + +// FIPS specification refers to right rotations, while our ROTATE macro +// is left one. This is why you might notice that rotation coefficients +// differ from those observed in FIPS document by 32-N... +#define Sigma0(x) (ROTATE((x), 30) ^ ROTATE((x), 19) ^ ROTATE((x), 10)) +#define Sigma1(x) (ROTATE((x), 26) ^ ROTATE((x), 21) ^ ROTATE((x), 7)) +#define sigma0(x) (ROTATE((x), 25) ^ ROTATE((x), 14) ^ ((x) >> 3)) +#define sigma1(x) (ROTATE((x), 15) ^ ROTATE((x), 13) ^ ((x) >> 10)) + +#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + +#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ + do { \ + T1 += h + Sigma1(e) + Ch(e, f, g) + K256[i]; \ + h = Sigma0(a) + Maj(a, b, c); \ + d += T1; \ + h += T1; \ + } while (0) + +#define ROUND_16_63(i, a, b, c, d, e, f, g, h, X) \ + do { \ + s0 = X[(i + 1) & 0x0f]; \ + s0 = sigma0(s0); \ + s1 = X[(i + 14) & 0x0f]; \ + s1 = sigma1(s1); \ + T1 = X[(i) & 0x0f] += s0 + s1 + X[(i + 9) & 0x0f]; \ + ROUND_00_15(i, a, b, c, d, e, f, g, h); \ + } while (0) + +static void sha256_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { + uint32_t a, b, c, d, e, f, g, h, s0, s1, T1; + uint32_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]; + + uint32_t l; + + HOST_c2l(data, l); + T1 = X[0] = l; + ROUND_00_15(0, a, b, c, d, e, f, g, h); + HOST_c2l(data, l); + T1 = X[1] = l; + ROUND_00_15(1, h, a, b, c, d, e, f, g); + HOST_c2l(data, l); + T1 = X[2] = l; + ROUND_00_15(2, g, h, a, b, c, d, e, f); + HOST_c2l(data, l); + T1 = X[3] = l; + ROUND_00_15(3, f, g, h, a, b, c, d, e); + HOST_c2l(data, l); + T1 = X[4] = l; + ROUND_00_15(4, e, f, g, h, a, b, c, d); + HOST_c2l(data, l); + T1 = X[5] = l; + ROUND_00_15(5, d, e, f, g, h, a, b, c); + HOST_c2l(data, l); + T1 = X[6] = l; + ROUND_00_15(6, c, d, e, f, g, h, a, b); + HOST_c2l(data, l); + T1 = X[7] = l; + ROUND_00_15(7, b, c, d, e, f, g, h, a); + HOST_c2l(data, l); + T1 = X[8] = l; + ROUND_00_15(8, a, b, c, d, e, f, g, h); + HOST_c2l(data, l); + T1 = X[9] = l; + ROUND_00_15(9, h, a, b, c, d, e, f, g); + HOST_c2l(data, l); + T1 = X[10] = l; + ROUND_00_15(10, g, h, a, b, c, d, e, f); + HOST_c2l(data, l); + T1 = X[11] = l; + ROUND_00_15(11, f, g, h, a, b, c, d, e); + HOST_c2l(data, l); + T1 = X[12] = l; + ROUND_00_15(12, e, f, g, h, a, b, c, d); + HOST_c2l(data, l); + T1 = X[13] = l; + ROUND_00_15(13, d, e, f, g, h, a, b, c); + HOST_c2l(data, l); + T1 = X[14] = l; + ROUND_00_15(14, c, d, e, f, g, h, a, b); + HOST_c2l(data, l); + T1 = X[15] = l; + ROUND_00_15(15, b, c, d, e, f, g, h, a); + + for (i = 16; i < 64; i += 8) { + ROUND_16_63(i + 0, a, b, c, d, e, f, g, h, X); + ROUND_16_63(i + 1, h, a, b, c, d, e, f, g, X); + ROUND_16_63(i + 2, g, h, a, b, c, d, e, f, X); + ROUND_16_63(i + 3, f, g, h, a, b, c, d, e, X); + ROUND_16_63(i + 4, e, f, g, h, a, b, c, d, X); + ROUND_16_63(i + 5, d, e, f, g, h, a, b, c, X); + ROUND_16_63(i + 6, c, d, e, f, g, h, a, b, X); + ROUND_16_63(i + 7, 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; + } +} + +#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 +#undef HASH_FINAL +#undef HASH_BLOCK_DATA_ORDER +#undef ROTATE +#undef Sigma0 +#undef Sigma1 +#undef sigma0 +#undef sigma1 +#undef Ch +#undef Maj +#undef ROUND_00_15 +#undef ROUND_16_63 +#undef HOST_c2l +#undef HOST_l2c diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c new file mode 100644 index 0000000..7a0b89f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c.grpc_back new file mode 100644 index 0000000..848f3b6 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h new file mode 100644 index 0000000..ae3ab7f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h @@ -0,0 +1,39 @@ +/* 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_FIPSMODULE_TLS_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_FIPSMODULE_TLS_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// tls1_prf calculates |out_len| bytes of the TLS PDF, using |digest|, and +// writes them to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int CRYPTO_tls1_prf(const EVP_MD *digest, + uint8_t *out, size_t out_len, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len); + + +#if defined(__cplusplus) +} +#endif + +#endif // OPENSSL_HEADER_CRYPTO_FIPSMODULE_TLS_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h.grpc_back new file mode 100644 index 0000000..ef642a6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h.grpc_back @@ -0,0 +1,39 @@ +/* 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_FIPSMODULE_TLS_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_FIPSMODULE_TLS_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// tls1_prf calculates |out_len| bytes of the TLS PDF, using |digest|, and +// writes them to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int CRYPTO_tls1_prf(const EVP_MD *digest, + uint8_t *out, size_t out_len, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len); + + +#if defined(__cplusplus) +} +#endif + +#endif // OPENSSL_HEADER_CRYPTO_FIPSMODULE_TLS_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c new file mode 100644 index 0000000..07e2e4d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c @@ -0,0 +1,165 @@ +/* ==================================================================== + * 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). */ + +#include + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// tls1_P_hash computes the TLS P_ function as described in RFC 5246, +// section 5. It XORs |out_len| bytes to |out|, using |md| as the hash and +// |secret| as the secret. |label|, |seed1|, and |seed2| are concatenated to +// form the seed parameter. It returns true on success and false on failure. +static int tls1_P_hash(uint8_t *out, size_t out_len, + const EVP_MD *md, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len) { + HMAC_CTX ctx, ctx_tmp, ctx_init; + uint8_t A1[EVP_MAX_MD_SIZE]; + unsigned A1_len; + int ret = 0; + + const size_t chunk = EVP_MD_size(md); + HMAC_CTX_init(&ctx); + HMAC_CTX_init(&ctx_tmp); + HMAC_CTX_init(&ctx_init); + + if (!HMAC_Init_ex(&ctx_init, secret, secret_len, md, NULL) || + !HMAC_CTX_copy_ex(&ctx, &ctx_init) || + !HMAC_Update(&ctx, (const uint8_t *) label, label_len) || + !HMAC_Update(&ctx, seed1, seed1_len) || + !HMAC_Update(&ctx, seed2, seed2_len) || + !HMAC_Final(&ctx, A1, &A1_len)) { + goto err; + } + + for (;;) { + unsigned len; + uint8_t hmac[EVP_MAX_MD_SIZE]; + if (!HMAC_CTX_copy_ex(&ctx, &ctx_init) || + !HMAC_Update(&ctx, A1, A1_len) || + // Save a copy of |ctx| to compute the next A1 value below. + (out_len > chunk && !HMAC_CTX_copy_ex(&ctx_tmp, &ctx)) || + !HMAC_Update(&ctx, (const uint8_t *) label, label_len) || + !HMAC_Update(&ctx, seed1, seed1_len) || + !HMAC_Update(&ctx, seed2, seed2_len) || + !HMAC_Final(&ctx, hmac, &len)) { + goto err; + } + assert(len == chunk); + + // XOR the result into |out|. + if (len > out_len) { + len = out_len; + } + for (unsigned i = 0; i < len; i++) { + out[i] ^= hmac[i]; + } + out += len; + out_len -= len; + + if (out_len == 0) { + break; + } + + // Calculate the next A1 value. + if (!HMAC_Final(&ctx_tmp, A1, &A1_len)) { + goto err; + } + } + + ret = 1; + +err: + OPENSSL_cleanse(A1, sizeof(A1)); + HMAC_CTX_cleanup(&ctx); + HMAC_CTX_cleanup(&ctx_tmp); + HMAC_CTX_cleanup(&ctx_init); + return ret; +} + +int CRYPTO_tls1_prf(const EVP_MD *digest, + uint8_t *out, size_t out_len, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len) { + if (out_len == 0) { + return 1; + } + + OPENSSL_memset(out, 0, out_len); + + if (digest == EVP_md5_sha1()) { + // If using the MD5/SHA1 PRF, |secret| is partitioned between MD5 and SHA-1. + size_t secret_half = secret_len - (secret_len / 2); + if (!tls1_P_hash(out, out_len, EVP_md5(), secret, secret_half, label, + label_len, seed1, seed1_len, seed2, seed2_len)) { + return 0; + } + + // Note that, if |secret_len| is odd, the two halves share a byte. + secret += secret_len - secret_half; + secret_len = secret_half; + digest = EVP_sha1(); + } + + return tls1_P_hash(out, out_len, digest, secret, secret_len, label, label_len, + seed1, seed1_len, seed2, seed2_len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c.grpc_back new file mode 100644 index 0000000..347e998 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c.grpc_back @@ -0,0 +1,165 @@ +/* ==================================================================== + * 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). */ + +#include + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// tls1_P_hash computes the TLS P_ function as described in RFC 5246, +// section 5. It XORs |out_len| bytes to |out|, using |md| as the hash and +// |secret| as the secret. |label|, |seed1|, and |seed2| are concatenated to +// form the seed parameter. It returns true on success and false on failure. +static int tls1_P_hash(uint8_t *out, size_t out_len, + const EVP_MD *md, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len) { + HMAC_CTX ctx, ctx_tmp, ctx_init; + uint8_t A1[EVP_MAX_MD_SIZE]; + unsigned A1_len; + int ret = 0; + + const size_t chunk = EVP_MD_size(md); + HMAC_CTX_init(&ctx); + HMAC_CTX_init(&ctx_tmp); + HMAC_CTX_init(&ctx_init); + + if (!HMAC_Init_ex(&ctx_init, secret, secret_len, md, NULL) || + !HMAC_CTX_copy_ex(&ctx, &ctx_init) || + !HMAC_Update(&ctx, (const uint8_t *) label, label_len) || + !HMAC_Update(&ctx, seed1, seed1_len) || + !HMAC_Update(&ctx, seed2, seed2_len) || + !HMAC_Final(&ctx, A1, &A1_len)) { + goto err; + } + + for (;;) { + unsigned len; + uint8_t hmac[EVP_MAX_MD_SIZE]; + if (!HMAC_CTX_copy_ex(&ctx, &ctx_init) || + !HMAC_Update(&ctx, A1, A1_len) || + // Save a copy of |ctx| to compute the next A1 value below. + (out_len > chunk && !HMAC_CTX_copy_ex(&ctx_tmp, &ctx)) || + !HMAC_Update(&ctx, (const uint8_t *) label, label_len) || + !HMAC_Update(&ctx, seed1, seed1_len) || + !HMAC_Update(&ctx, seed2, seed2_len) || + !HMAC_Final(&ctx, hmac, &len)) { + goto err; + } + assert(len == chunk); + + // XOR the result into |out|. + if (len > out_len) { + len = out_len; + } + for (unsigned i = 0; i < len; i++) { + out[i] ^= hmac[i]; + } + out += len; + out_len -= len; + + if (out_len == 0) { + break; + } + + // Calculate the next A1 value. + if (!HMAC_Final(&ctx_tmp, A1, &A1_len)) { + goto err; + } + } + + ret = 1; + +err: + OPENSSL_cleanse(A1, sizeof(A1)); + HMAC_CTX_cleanup(&ctx); + HMAC_CTX_cleanup(&ctx_tmp); + HMAC_CTX_cleanup(&ctx_init); + return ret; +} + +int CRYPTO_tls1_prf(const EVP_MD *digest, + uint8_t *out, size_t out_len, + const uint8_t *secret, size_t secret_len, + const char *label, size_t label_len, + const uint8_t *seed1, size_t seed1_len, + const uint8_t *seed2, size_t seed2_len) { + if (out_len == 0) { + return 1; + } + + OPENSSL_memset(out, 0, out_len); + + if (digest == EVP_md5_sha1()) { + // If using the MD5/SHA1 PRF, |secret| is partitioned between MD5 and SHA-1. + size_t secret_half = secret_len - (secret_len / 2); + if (!tls1_P_hash(out, out_len, EVP_md5(), secret, secret_half, label, + label_len, seed1, seed1_len, seed2, seed2_len)) { + return 0; + } + + // Note that, if |secret_len| is odd, the two halves share a byte. + secret += secret_len - secret_half; + secret_len = secret_half; + digest = EVP_sha1(); + } + + return tls1_P_hash(out, out_len, digest, secret, secret_len, label, label_len, + seed1, seed1_len, seed2, seed2_len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c new file mode 100644 index 0000000..7f4a28b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c @@ -0,0 +1,112 @@ +/* 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 "../internal.h" + + +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) { + // https://tools.ietf.org/html/rfc5869#section-2 + uint8_t prk[EVP_MAX_MD_SIZE]; + size_t prk_len; + + if (!HKDF_extract(prk, &prk_len, digest, secret, secret_len, salt, + salt_len) || + !HKDF_expand(out_key, out_len, digest, prk, prk_len, info, info_len)) { + return 0; + } + + return 1; +} + +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) { + // https://tools.ietf.org/html/rfc5869#section-2.2 + + // If salt is not given, HashLength zeros are used. However, HMAC does that + // internally already so we can ignore it. + unsigned len; + if (HMAC(digest, salt, salt_len, secret, secret_len, out_key, &len) == NULL) { + OPENSSL_PUT_ERROR(HKDF, ERR_R_HMAC_LIB); + return 0; + } + *out_len = len; + assert(*out_len == EVP_MD_size(digest)); + return 1; +} + +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) { + // https://tools.ietf.org/html/rfc5869#section-2.3 + const size_t digest_len = EVP_MD_size(digest); + uint8_t previous[EVP_MAX_MD_SIZE]; + size_t n, done = 0; + unsigned i; + int ret = 0; + HMAC_CTX hmac; + + // Expand key material to desired length. + n = (out_len + digest_len - 1) / digest_len; + if (out_len + digest_len < out_len || n > 255) { + OPENSSL_PUT_ERROR(HKDF, HKDF_R_OUTPUT_TOO_LARGE); + return 0; + } + + HMAC_CTX_init(&hmac); + if (!HMAC_Init_ex(&hmac, prk, prk_len, digest, NULL)) { + goto out; + } + + for (i = 0; i < n; i++) { + uint8_t ctr = i + 1; + size_t todo; + + if (i != 0 && (!HMAC_Init_ex(&hmac, NULL, 0, NULL, NULL) || + !HMAC_Update(&hmac, previous, digest_len))) { + goto out; + } + if (!HMAC_Update(&hmac, info, info_len) || + !HMAC_Update(&hmac, &ctr, 1) || + !HMAC_Final(&hmac, previous, NULL)) { + goto out; + } + + todo = digest_len; + if (done + todo > out_len) { + todo = out_len - done; + } + OPENSSL_memcpy(out_key + done, previous, todo); + done += todo; + } + + ret = 1; + +out: + HMAC_CTX_cleanup(&hmac); + if (ret != 1) { + OPENSSL_PUT_ERROR(HKDF, ERR_R_HMAC_LIB); + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c.grpc_back new file mode 100644 index 0000000..23b60af --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c.grpc_back @@ -0,0 +1,112 @@ +/* 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 "../internal.h" + + +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) { + // https://tools.ietf.org/html/rfc5869#section-2 + uint8_t prk[EVP_MAX_MD_SIZE]; + size_t prk_len; + + if (!HKDF_extract(prk, &prk_len, digest, secret, secret_len, salt, + salt_len) || + !HKDF_expand(out_key, out_len, digest, prk, prk_len, info, info_len)) { + return 0; + } + + return 1; +} + +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) { + // https://tools.ietf.org/html/rfc5869#section-2.2 + + // If salt is not given, HashLength zeros are used. However, HMAC does that + // internally already so we can ignore it. + unsigned len; + if (HMAC(digest, salt, salt_len, secret, secret_len, out_key, &len) == NULL) { + OPENSSL_PUT_ERROR(HKDF, ERR_R_HMAC_LIB); + return 0; + } + *out_len = len; + assert(*out_len == EVP_MD_size(digest)); + return 1; +} + +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) { + // https://tools.ietf.org/html/rfc5869#section-2.3 + const size_t digest_len = EVP_MD_size(digest); + uint8_t previous[EVP_MAX_MD_SIZE]; + size_t n, done = 0; + unsigned i; + int ret = 0; + HMAC_CTX hmac; + + // Expand key material to desired length. + n = (out_len + digest_len - 1) / digest_len; + if (out_len + digest_len < out_len || n > 255) { + OPENSSL_PUT_ERROR(HKDF, HKDF_R_OUTPUT_TOO_LARGE); + return 0; + } + + HMAC_CTX_init(&hmac); + if (!HMAC_Init_ex(&hmac, prk, prk_len, digest, NULL)) { + goto out; + } + + for (i = 0; i < n; i++) { + uint8_t ctr = i + 1; + size_t todo; + + if (i != 0 && (!HMAC_Init_ex(&hmac, NULL, 0, NULL, NULL) || + !HMAC_Update(&hmac, previous, digest_len))) { + goto out; + } + if (!HMAC_Update(&hmac, info, info_len) || + !HMAC_Update(&hmac, &ctr, 1) || + !HMAC_Final(&hmac, previous, NULL)) { + goto out; + } + + todo = digest_len; + if (done + todo > out_len) { + todo = out_len - done; + } + OPENSSL_memcpy(out_key + done, previous, todo); + done += todo; + } + + ret = 1; + +out: + HMAC_CTX_cleanup(&hmac); + if (ret != 1) { + OPENSSL_PUT_ERROR(HKDF, ERR_R_HMAC_LIB); + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c new file mode 100644 index 0000000..2195fec --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c.grpc_back new file mode 100644 index 0000000..67ff4c1 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h new file mode 100644 index 0000000..26762ce --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h.grpc_back new file mode 100644 index 0000000..c0d9bd2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/internal.h new file mode 100644 index 0000000..4035328 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/internal.h.grpc_back new file mode 100644 index 0000000..edba9f9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c new file mode 100644 index 0000000..dc4cfbc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c @@ -0,0 +1,348 @@ +/* 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 "../internal.h" + + +// kMinNumBuckets is the minimum size of the buckets array in an |_LHASH|. +static const size_t kMinNumBuckets = 16; + +// kMaxAverageChainLength contains the maximum, average chain length. When the +// average chain length exceeds this value, the hash table will be resized. +static const size_t kMaxAverageChainLength = 2; +static const size_t kMinAverageChainLength = 1; + +struct lhash_st { + // num_items contains the total number of items in the hash table. + size_t num_items; + // buckets is an array of |num_buckets| pointers. Each points to the head of + // a chain of LHASH_ITEM objects that have the same hash value, mod + // |num_buckets|. + LHASH_ITEM **buckets; + // num_buckets contains the length of |buckets|. This value is always >= + // kMinNumBuckets. + size_t num_buckets; + // callback_depth contains the current depth of |lh_doall| or |lh_doall_arg| + // calls. If non-zero then this suppresses resizing of the |buckets| array, + // which would otherwise disrupt the iteration. + unsigned callback_depth; + + lhash_cmp_func comp; + lhash_hash_func hash; +}; + +_LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp) { + _LHASH *ret = OPENSSL_malloc(sizeof(_LHASH)); + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(_LHASH)); + + ret->num_buckets = kMinNumBuckets; + ret->buckets = OPENSSL_malloc(sizeof(LHASH_ITEM *) * ret->num_buckets); + if (ret->buckets == NULL) { + OPENSSL_free(ret); + return NULL; + } + OPENSSL_memset(ret->buckets, 0, sizeof(LHASH_ITEM *) * ret->num_buckets); + + ret->comp = comp; + ret->hash = hash; + return ret; +} + +void lh_free(_LHASH *lh) { + if (lh == NULL) { + return; + } + + for (size_t i = 0; i < lh->num_buckets; i++) { + LHASH_ITEM *next; + for (LHASH_ITEM *n = lh->buckets[i]; n != NULL; n = next) { + next = n->next; + OPENSSL_free(n); + } + } + + OPENSSL_free(lh->buckets); + OPENSSL_free(lh); +} + +size_t lh_num_items(const _LHASH *lh) { return lh->num_items; } + +// get_next_ptr_and_hash returns a pointer to the pointer that points to the +// item equal to |data|. In other words, it searches for an item equal to |data| +// and, if it's at the start of a chain, then it returns a pointer to an +// element of |lh->buckets|, otherwise it returns a pointer to the |next| +// element of the previous item in the chain. If an element equal to |data| is +// 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, + 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; + } + + 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; + } + + return ret; +} + +// 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; + } + + return ret; +} + +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; +} + +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 +// redistributes the existing items into it before making it |lh->buckets| and +// freeing the old array. +static void lh_rebucket(_LHASH *lh, const size_t new_num_buckets) { + LHASH_ITEM **new_buckets, *cur, *next; + size_t i, alloc_size; + + alloc_size = sizeof(LHASH_ITEM *) * new_num_buckets; + if (alloc_size / sizeof(LHASH_ITEM*) != new_num_buckets) { + return; + } + + new_buckets = OPENSSL_malloc(alloc_size); + if (new_buckets == NULL) { + return; + } + OPENSSL_memset(new_buckets, 0, alloc_size); + + for (i = 0; i < lh->num_buckets; i++) { + for (cur = lh->buckets[i]; cur != NULL; cur = next) { + const size_t new_bucket = cur->hash % new_num_buckets; + next = cur->next; + cur->next = new_buckets[new_bucket]; + new_buckets[new_bucket] = cur; + } + } + + OPENSSL_free(lh->buckets); + + lh->num_buckets = new_num_buckets; + lh->buckets = new_buckets; +} + +// lh_maybe_resize resizes the |buckets| array if needed. +static void lh_maybe_resize(_LHASH *lh) { + size_t avg_chain_length; + + if (lh->callback_depth > 0) { + // Don't resize the hash if we are currently iterating over it. + return; + } + + assert(lh->num_buckets >= kMinNumBuckets); + avg_chain_length = lh->num_items / lh->num_buckets; + + if (avg_chain_length > kMaxAverageChainLength) { + const size_t new_num_buckets = lh->num_buckets * 2; + + if (new_num_buckets > lh->num_buckets) { + lh_rebucket(lh, new_num_buckets); + } + } else if (avg_chain_length < kMinAverageChainLength && + lh->num_buckets > kMinNumBuckets) { + size_t new_num_buckets = lh->num_buckets / 2; + + if (new_num_buckets < kMinNumBuckets) { + new_num_buckets = kMinNumBuckets; + } + + lh_rebucket(lh, new_num_buckets); + } +} + +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, call_hash_func, call_cmp_func); + + + if (*next_ptr != NULL) { + // An element equal to |data| already exists in the hash table. It will be + // replaced. + *old_data = (*next_ptr)->data; + (*next_ptr)->data = data; + return 1; + } + + // An element equal to |data| doesn't exist in the hash table yet. + item = OPENSSL_malloc(sizeof(LHASH_ITEM)); + if (item == NULL) { + return 0; + } + + item->data = data; + item->hash = hash; + item->next = NULL; + *next_ptr = item; + lh->num_items++; + lh_maybe_resize(lh); + + return 1; +} + +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, call_hash_func, call_cmp_func); + + if (*next_ptr == NULL) { + // No such element. + return NULL; + } + + item = *next_ptr; + *next_ptr = item->next; + ret = item->data; + OPENSSL_free(item); + + lh->num_items--; + lh_maybe_resize(lh); + + return ret; +} + +void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { + if (lh == NULL) { + return; + } + + if (lh->callback_depth < UINT_MAX) { + // |callback_depth| is a saturating counter. + lh->callback_depth++; + } + + for (size_t i = 0; i < lh->num_buckets; i++) { + LHASH_ITEM *next; + for (LHASH_ITEM *cur = lh->buckets[i]; cur != NULL; cur = next) { + next = cur->next; + func(cur->data, arg); + } + } + + if (lh->callback_depth < UINT_MAX) { + lh->callback_depth--; + } + + // The callback may have added or removed elements and the non-zero value of + // |callback_depth| will have suppressed any resizing. Thus any needed + // resizing is done here. + lh_maybe_resize(lh); +} + +uint32_t lh_strhash(const char *c) { + if (c == NULL) { + return 0; + } + + return OPENSSL_hash32(c, strlen(c)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back new file mode 100644 index 0000000..98ee60a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back @@ -0,0 +1,348 @@ +/* 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 "../internal.h" + + +// kMinNumBuckets is the minimum size of the buckets array in an |_LHASH|. +static const size_t kMinNumBuckets = 16; + +// kMaxAverageChainLength contains the maximum, average chain length. When the +// average chain length exceeds this value, the hash table will be resized. +static const size_t kMaxAverageChainLength = 2; +static const size_t kMinAverageChainLength = 1; + +struct lhash_st { + // num_items contains the total number of items in the hash table. + size_t num_items; + // buckets is an array of |num_buckets| pointers. Each points to the head of + // a chain of LHASH_ITEM objects that have the same hash value, mod + // |num_buckets|. + LHASH_ITEM **buckets; + // num_buckets contains the length of |buckets|. This value is always >= + // kMinNumBuckets. + size_t num_buckets; + // callback_depth contains the current depth of |lh_doall| or |lh_doall_arg| + // calls. If non-zero then this suppresses resizing of the |buckets| array, + // which would otherwise disrupt the iteration. + unsigned callback_depth; + + lhash_cmp_func comp; + lhash_hash_func hash; +}; + +_LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp) { + _LHASH *ret = OPENSSL_malloc(sizeof(_LHASH)); + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(_LHASH)); + + ret->num_buckets = kMinNumBuckets; + ret->buckets = OPENSSL_malloc(sizeof(LHASH_ITEM *) * ret->num_buckets); + if (ret->buckets == NULL) { + OPENSSL_free(ret); + return NULL; + } + OPENSSL_memset(ret->buckets, 0, sizeof(LHASH_ITEM *) * ret->num_buckets); + + ret->comp = comp; + ret->hash = hash; + return ret; +} + +void lh_free(_LHASH *lh) { + if (lh == NULL) { + return; + } + + for (size_t i = 0; i < lh->num_buckets; i++) { + LHASH_ITEM *next; + for (LHASH_ITEM *n = lh->buckets[i]; n != NULL; n = next) { + next = n->next; + OPENSSL_free(n); + } + } + + OPENSSL_free(lh->buckets); + OPENSSL_free(lh); +} + +size_t lh_num_items(const _LHASH *lh) { return lh->num_items; } + +// get_next_ptr_and_hash returns a pointer to the pointer that points to the +// item equal to |data|. In other words, it searches for an item equal to |data| +// and, if it's at the start of a chain, then it returns a pointer to an +// element of |lh->buckets|, otherwise it returns a pointer to the |next| +// element of the previous item in the chain. If an element equal to |data| is +// 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, + 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; + } + + 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; + } + + return ret; +} + +// 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; + } + + return ret; +} + +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; +} + +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 +// redistributes the existing items into it before making it |lh->buckets| and +// freeing the old array. +static void lh_rebucket(_LHASH *lh, const size_t new_num_buckets) { + LHASH_ITEM **new_buckets, *cur, *next; + size_t i, alloc_size; + + alloc_size = sizeof(LHASH_ITEM *) * new_num_buckets; + if (alloc_size / sizeof(LHASH_ITEM*) != new_num_buckets) { + return; + } + + new_buckets = OPENSSL_malloc(alloc_size); + if (new_buckets == NULL) { + return; + } + OPENSSL_memset(new_buckets, 0, alloc_size); + + for (i = 0; i < lh->num_buckets; i++) { + for (cur = lh->buckets[i]; cur != NULL; cur = next) { + const size_t new_bucket = cur->hash % new_num_buckets; + next = cur->next; + cur->next = new_buckets[new_bucket]; + new_buckets[new_bucket] = cur; + } + } + + OPENSSL_free(lh->buckets); + + lh->num_buckets = new_num_buckets; + lh->buckets = new_buckets; +} + +// lh_maybe_resize resizes the |buckets| array if needed. +static void lh_maybe_resize(_LHASH *lh) { + size_t avg_chain_length; + + if (lh->callback_depth > 0) { + // Don't resize the hash if we are currently iterating over it. + return; + } + + assert(lh->num_buckets >= kMinNumBuckets); + avg_chain_length = lh->num_items / lh->num_buckets; + + if (avg_chain_length > kMaxAverageChainLength) { + const size_t new_num_buckets = lh->num_buckets * 2; + + if (new_num_buckets > lh->num_buckets) { + lh_rebucket(lh, new_num_buckets); + } + } else if (avg_chain_length < kMinAverageChainLength && + lh->num_buckets > kMinNumBuckets) { + size_t new_num_buckets = lh->num_buckets / 2; + + if (new_num_buckets < kMinNumBuckets) { + new_num_buckets = kMinNumBuckets; + } + + lh_rebucket(lh, new_num_buckets); + } +} + +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, call_hash_func, call_cmp_func); + + + if (*next_ptr != NULL) { + // An element equal to |data| already exists in the hash table. It will be + // replaced. + *old_data = (*next_ptr)->data; + (*next_ptr)->data = data; + return 1; + } + + // An element equal to |data| doesn't exist in the hash table yet. + item = OPENSSL_malloc(sizeof(LHASH_ITEM)); + if (item == NULL) { + return 0; + } + + item->data = data; + item->hash = hash; + item->next = NULL; + *next_ptr = item; + lh->num_items++; + lh_maybe_resize(lh); + + return 1; +} + +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, call_hash_func, call_cmp_func); + + if (*next_ptr == NULL) { + // No such element. + return NULL; + } + + item = *next_ptr; + *next_ptr = item->next; + ret = item->data; + OPENSSL_free(item); + + lh->num_items--; + lh_maybe_resize(lh); + + return ret; +} + +void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { + if (lh == NULL) { + return; + } + + if (lh->callback_depth < UINT_MAX) { + // |callback_depth| is a saturating counter. + lh->callback_depth++; + } + + for (size_t i = 0; i < lh->num_buckets; i++) { + LHASH_ITEM *next; + for (LHASH_ITEM *cur = lh->buckets[i]; cur != NULL; cur = next) { + next = cur->next; + func(cur->data, arg); + } + } + + if (lh->callback_depth < UINT_MAX) { + lh->callback_depth--; + } + + // The callback may have added or removed elements and the non-zero value of + // |callback_depth| will have suppressed any resizing. Thus any needed + // resizing is done here. + lh_maybe_resize(lh); +} + +uint32_t lh_strhash(const char *c) { + if (c == NULL) { + return 0; + } + + return OPENSSL_hash32(c, strlen(c)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/mem.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/mem.c new file mode 100644 index 0000000..da8eccb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/mem.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/mem.c.grpc_back new file mode 100644 index 0000000..7fc5f98 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c new file mode 100644 index 0000000..ccb8425 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c @@ -0,0 +1,549 @@ +/* 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 "obj_dat.h" +#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; +static LHASH_OF(ASN1_OBJECT) *global_added_by_nid = NULL; +static LHASH_OF(ASN1_OBJECT) *global_added_by_short_name = NULL; +static LHASH_OF(ASN1_OBJECT) *global_added_by_long_name = NULL; + +static struct CRYPTO_STATIC_MUTEX global_next_nid_lock = + CRYPTO_STATIC_MUTEX_INIT; +static unsigned global_next_nid = NUM_NID; + +static int obj_next_nid(void) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&global_next_nid_lock); + ret = global_next_nid++; + CRYPTO_STATIC_MUTEX_unlock_write(&global_next_nid_lock); + + return ret; +} + +ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o) { + ASN1_OBJECT *r; + unsigned char *data = NULL; + char *sn = NULL, *ln = NULL; + + if (o == NULL) { + return NULL; + } + + if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) { + // TODO(fork): this is a little dangerous. + return (ASN1_OBJECT *)o; + } + + r = ASN1_OBJECT_new(); + if (r == NULL) { + OPENSSL_PUT_ERROR(OBJ, ERR_R_ASN1_LIB); + return NULL; + } + r->ln = r->sn = NULL; + + data = OPENSSL_malloc(o->length); + if (data == NULL) { + goto err; + } + if (o->data != NULL) { + OPENSSL_memcpy(data, o->data, o->length); + } + + // once data is attached to an object, it remains const + r->data = data; + r->length = o->length; + r->nid = o->nid; + + if (o->ln != NULL) { + ln = OPENSSL_strdup(o->ln); + if (ln == NULL) { + goto err; + } + } + + if (o->sn != NULL) { + sn = OPENSSL_strdup(o->sn); + if (sn == NULL) { + goto err; + } + } + + r->sn = sn; + r->ln = ln; + + r->flags = + o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA); + return r; + +err: + OPENSSL_PUT_ERROR(OBJ, ERR_R_MALLOC_FAILURE); + OPENSSL_free(ln); + OPENSSL_free(sn); + OPENSSL_free(data); + OPENSSL_free(r); + return NULL; +} + +int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + int ret; + + ret = a->length - b->length; + if (ret) { + return ret; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +const uint8_t *OBJ_get0_data(const ASN1_OBJECT *obj) { + if (obj == NULL) { + return NULL; + } + + return obj->data; +} + +size_t OBJ_length(const ASN1_OBJECT *obj) { + if (obj == NULL || obj->length < 0) { + return 0; + } + + return (size_t)obj->length; +} + +// obj_cmp is called to search the kNIDsInOIDOrder array. The |key| argument is +// 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) { + uint16_t nid = *((const uint16_t *)element); + const ASN1_OBJECT *a = key; + const ASN1_OBJECT *b = &kObjects[nid]; + + if (a->length < b->length) { + return -1; + } else if (a->length > b->length) { + return 1; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +int OBJ_obj2nid(const ASN1_OBJECT *obj) { + if (obj == NULL) { + return NID_undef; + } + + if (obj->nid != 0) { + return obj->nid; + } + + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_data != NULL) { + ASN1_OBJECT *match; + + match = lh_ASN1_OBJECT_retrieve(global_added_by_data, obj); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + const uint16_t *nid_ptr = + bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), + sizeof(kNIDsInOIDOrder[0]), obj_cmp); + if (nid_ptr == NULL) { + return NID_undef; + } + + return kObjects[*nid_ptr].nid; +} + +int OBJ_cbs2nid(const CBS *cbs) { + if (CBS_len(cbs) > INT_MAX) { + return NID_undef; + } + + ASN1_OBJECT obj; + OPENSSL_memset(&obj, 0, sizeof(obj)); + obj.data = CBS_data(cbs); + obj.length = (int)CBS_len(cbs); + + return OBJ_obj2nid(&obj); +} + +// short_name_cmp is called to search the kNIDsInShortNameOrder array. The +// |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; + uint16_t nid = *((const uint16_t *)element); + + return strcmp(name, kObjects[nid].sn); +} + +int OBJ_sn2nid(const char *short_name) { + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_short_name != NULL) { + ASN1_OBJECT *match, template; + + template.sn = short_name; + match = lh_ASN1_OBJECT_retrieve(global_added_by_short_name, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + 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; + } + + return kObjects[*nid_ptr].nid; +} + +// long_name_cmp is called to search the kNIDsInLongNameOrder array. The +// |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; + uint16_t nid = *((const uint16_t *)element); + + return strcmp(name, kObjects[nid].ln); +} + +int OBJ_ln2nid(const char *long_name) { + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_long_name != NULL) { + ASN1_OBJECT *match, template; + + template.ln = long_name; + match = lh_ASN1_OBJECT_retrieve(global_added_by_long_name, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + 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; + } + + return kObjects[*nid_ptr].nid; +} + +int OBJ_txt2nid(const char *s) { + ASN1_OBJECT *obj; + int nid; + + obj = OBJ_txt2obj(s, 0 /* search names */); + nid = OBJ_obj2nid(obj); + ASN1_OBJECT_free(obj); + return nid; +} + +OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + CBB oid; + + if (obj == NULL || + !CBB_add_asn1(out, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, obj->data, obj->length) || + !CBB_flush(out)) { + return 0; + } + + return 1; +} + +const ASN1_OBJECT *OBJ_nid2obj(int nid) { + if (nid >= 0 && nid < NUM_NID) { + if (nid != NID_undef && kObjects[nid].nid == NID_undef) { + goto err; + } + return &kObjects[nid]; + } + + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_nid != NULL) { + ASN1_OBJECT *match, template; + + template.nid = nid; + match = lh_ASN1_OBJECT_retrieve(global_added_by_nid, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + +err: + OPENSSL_PUT_ERROR(OBJ, OBJ_R_UNKNOWN_NID); + return NULL; +} + +const char *OBJ_nid2sn(int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + return NULL; + } + + return obj->sn; +} + +const char *OBJ_nid2ln(int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + return NULL; + } + + return obj->ln; +} + +static ASN1_OBJECT *create_object_with_text_oid(int (*get_nid)(void), + const char *oid, + const char *short_name, + const char *long_name) { + uint8_t *buf; + size_t len; + CBB cbb; + if (!CBB_init(&cbb, 32) || + !CBB_add_asn1_oid_from_text(&cbb, oid, strlen(oid)) || + !CBB_finish(&cbb, &buf, &len)) { + OPENSSL_PUT_ERROR(OBJ, OBJ_R_INVALID_OID_STRING); + CBB_cleanup(&cbb); + return NULL; + } + + ASN1_OBJECT *ret = ASN1_OBJECT_create(get_nid ? get_nid() : NID_undef, buf, + len, short_name, long_name); + OPENSSL_free(buf); + return ret; +} + +ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) { + if (!dont_search_names) { + int nid = OBJ_sn2nid(s); + if (nid == NID_undef) { + nid = OBJ_ln2nid(s); + } + + if (nid != NID_undef) { + return (ASN1_OBJECT*) OBJ_nid2obj(nid); + } + } + + return create_object_with_text_oid(NULL, s, NULL, NULL); +} + +static int strlcpy_int(char *dst, const char *src, int 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; + } + return (int)ret; +} + +int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, + int always_return_oid) { + // Python depends on the empty OID successfully encoding as the empty + // string. + if (obj == NULL || obj->length == 0) { + return strlcpy_int(out, "", out_len); + } + + if (!always_return_oid) { + int nid = OBJ_obj2nid(obj); + if (nid != NID_undef) { + const char *name = OBJ_nid2ln(nid); + if (name == NULL) { + name = OBJ_nid2sn(nid); + } + if (name != NULL) { + return strlcpy_int(out, name, out_len); + } + } + } + + CBS cbs; + CBS_init(&cbs, obj->data, obj->length); + char *txt = CBS_asn1_oid_to_text(&cbs); + if (txt == NULL) { + if (out_len > 0) { + out[0] = '\0'; + } + return -1; + } + + int ret = strlcpy_int(out, txt, out_len); + OPENSSL_free(txt); + return ret; +} + +static uint32_t hash_nid(const ASN1_OBJECT *obj) { + return obj->nid; +} + +static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return a->nid - b->nid; +} + +static uint32_t hash_data(const ASN1_OBJECT *obj) { + return OPENSSL_hash32(obj->data, obj->length); +} + +static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + int i = a->length - b->length; + if (i) { + return i; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +static uint32_t hash_short_name(const ASN1_OBJECT *obj) { + return lh_strhash(obj->sn); +} + +static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return strcmp(a->sn, b->sn); +} + +static uint32_t hash_long_name(const ASN1_OBJECT *obj) { + return lh_strhash(obj->ln); +} + +static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return strcmp(a->ln, b->ln); +} + +// obj_add_object inserts |obj| into the various global hashes for run-time +// added objects. It returns one on success or zero otherwise. +static int obj_add_object(ASN1_OBJECT *obj) { + int ok; + ASN1_OBJECT *old_object; + + obj->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA); + + CRYPTO_STATIC_MUTEX_lock_write(&global_added_lock); + if (global_added_by_nid == NULL) { + global_added_by_nid = lh_ASN1_OBJECT_new(hash_nid, cmp_nid); + global_added_by_data = lh_ASN1_OBJECT_new(hash_data, cmp_data); + global_added_by_short_name = lh_ASN1_OBJECT_new(hash_short_name, cmp_short_name); + global_added_by_long_name = lh_ASN1_OBJECT_new(hash_long_name, cmp_long_name); + } + + // We don't pay attention to |old_object| (which contains any previous object + // that was evicted from the hashes) because we don't have a reference count + // on ASN1_OBJECT values. Also, we should never have duplicates nids and so + // should always have objects in |global_added_by_nid|. + + ok = lh_ASN1_OBJECT_insert(global_added_by_nid, &old_object, obj); + if (obj->length != 0 && obj->data != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_data, &old_object, obj); + } + if (obj->sn != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_short_name, &old_object, obj); + } + if (obj->ln != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_long_name, &old_object, obj); + } + CRYPTO_STATIC_MUTEX_unlock_write(&global_added_lock); + + return ok; +} + +int OBJ_create(const char *oid, const char *short_name, const char *long_name) { + ASN1_OBJECT *op = + create_object_with_text_oid(obj_next_nid, oid, short_name, long_name); + if (op == NULL || + !obj_add_object(op)) { + return NID_undef; + } + return op->nid; +} + +void OBJ_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back new file mode 100644 index 0000000..3bf1abf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back @@ -0,0 +1,549 @@ +/* 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 "obj_dat.h" +#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; +static LHASH_OF(ASN1_OBJECT) *global_added_by_nid = NULL; +static LHASH_OF(ASN1_OBJECT) *global_added_by_short_name = NULL; +static LHASH_OF(ASN1_OBJECT) *global_added_by_long_name = NULL; + +static struct CRYPTO_STATIC_MUTEX global_next_nid_lock = + CRYPTO_STATIC_MUTEX_INIT; +static unsigned global_next_nid = NUM_NID; + +static int obj_next_nid(void) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&global_next_nid_lock); + ret = global_next_nid++; + CRYPTO_STATIC_MUTEX_unlock_write(&global_next_nid_lock); + + return ret; +} + +ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o) { + ASN1_OBJECT *r; + unsigned char *data = NULL; + char *sn = NULL, *ln = NULL; + + if (o == NULL) { + return NULL; + } + + if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) { + // TODO(fork): this is a little dangerous. + return (ASN1_OBJECT *)o; + } + + r = ASN1_OBJECT_new(); + if (r == NULL) { + OPENSSL_PUT_ERROR(OBJ, ERR_R_ASN1_LIB); + return NULL; + } + r->ln = r->sn = NULL; + + data = OPENSSL_malloc(o->length); + if (data == NULL) { + goto err; + } + if (o->data != NULL) { + OPENSSL_memcpy(data, o->data, o->length); + } + + // once data is attached to an object, it remains const + r->data = data; + r->length = o->length; + r->nid = o->nid; + + if (o->ln != NULL) { + ln = OPENSSL_strdup(o->ln); + if (ln == NULL) { + goto err; + } + } + + if (o->sn != NULL) { + sn = OPENSSL_strdup(o->sn); + if (sn == NULL) { + goto err; + } + } + + r->sn = sn; + r->ln = ln; + + r->flags = + o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA); + return r; + +err: + OPENSSL_PUT_ERROR(OBJ, ERR_R_MALLOC_FAILURE); + OPENSSL_free(ln); + OPENSSL_free(sn); + OPENSSL_free(data); + OPENSSL_free(r); + return NULL; +} + +int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + int ret; + + ret = a->length - b->length; + if (ret) { + return ret; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +const uint8_t *OBJ_get0_data(const ASN1_OBJECT *obj) { + if (obj == NULL) { + return NULL; + } + + return obj->data; +} + +size_t OBJ_length(const ASN1_OBJECT *obj) { + if (obj == NULL || obj->length < 0) { + return 0; + } + + return (size_t)obj->length; +} + +// obj_cmp is called to search the kNIDsInOIDOrder array. The |key| argument is +// 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) { + uint16_t nid = *((const uint16_t *)element); + const ASN1_OBJECT *a = key; + const ASN1_OBJECT *b = &kObjects[nid]; + + if (a->length < b->length) { + return -1; + } else if (a->length > b->length) { + return 1; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +int OBJ_obj2nid(const ASN1_OBJECT *obj) { + if (obj == NULL) { + return NID_undef; + } + + if (obj->nid != 0) { + return obj->nid; + } + + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_data != NULL) { + ASN1_OBJECT *match; + + match = lh_ASN1_OBJECT_retrieve(global_added_by_data, obj); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + const uint16_t *nid_ptr = + bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), + sizeof(kNIDsInOIDOrder[0]), obj_cmp); + if (nid_ptr == NULL) { + return NID_undef; + } + + return kObjects[*nid_ptr].nid; +} + +int OBJ_cbs2nid(const CBS *cbs) { + if (CBS_len(cbs) > INT_MAX) { + return NID_undef; + } + + ASN1_OBJECT obj; + OPENSSL_memset(&obj, 0, sizeof(obj)); + obj.data = CBS_data(cbs); + obj.length = (int)CBS_len(cbs); + + return OBJ_obj2nid(&obj); +} + +// short_name_cmp is called to search the kNIDsInShortNameOrder array. The +// |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; + uint16_t nid = *((const uint16_t *)element); + + return strcmp(name, kObjects[nid].sn); +} + +int OBJ_sn2nid(const char *short_name) { + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_short_name != NULL) { + ASN1_OBJECT *match, template; + + template.sn = short_name; + match = lh_ASN1_OBJECT_retrieve(global_added_by_short_name, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + 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; + } + + return kObjects[*nid_ptr].nid; +} + +// long_name_cmp is called to search the kNIDsInLongNameOrder array. The +// |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; + uint16_t nid = *((const uint16_t *)element); + + return strcmp(name, kObjects[nid].ln); +} + +int OBJ_ln2nid(const char *long_name) { + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_long_name != NULL) { + ASN1_OBJECT *match, template; + + template.ln = long_name; + match = lh_ASN1_OBJECT_retrieve(global_added_by_long_name, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match->nid; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + + 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; + } + + return kObjects[*nid_ptr].nid; +} + +int OBJ_txt2nid(const char *s) { + ASN1_OBJECT *obj; + int nid; + + obj = OBJ_txt2obj(s, 0 /* search names */); + nid = OBJ_obj2nid(obj); + ASN1_OBJECT_free(obj); + return nid; +} + +OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + CBB oid; + + if (obj == NULL || + !CBB_add_asn1(out, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, obj->data, obj->length) || + !CBB_flush(out)) { + return 0; + } + + return 1; +} + +const ASN1_OBJECT *OBJ_nid2obj(int nid) { + if (nid >= 0 && nid < NUM_NID) { + if (nid != NID_undef && kObjects[nid].nid == NID_undef) { + goto err; + } + return &kObjects[nid]; + } + + CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); + if (global_added_by_nid != NULL) { + ASN1_OBJECT *match, template; + + template.nid = nid; + match = lh_ASN1_OBJECT_retrieve(global_added_by_nid, &template); + if (match != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + return match; + } + } + CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); + +err: + OPENSSL_PUT_ERROR(OBJ, OBJ_R_UNKNOWN_NID); + return NULL; +} + +const char *OBJ_nid2sn(int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + return NULL; + } + + return obj->sn; +} + +const char *OBJ_nid2ln(int nid) { + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + return NULL; + } + + return obj->ln; +} + +static ASN1_OBJECT *create_object_with_text_oid(int (*get_nid)(void), + const char *oid, + const char *short_name, + const char *long_name) { + uint8_t *buf; + size_t len; + CBB cbb; + if (!CBB_init(&cbb, 32) || + !CBB_add_asn1_oid_from_text(&cbb, oid, strlen(oid)) || + !CBB_finish(&cbb, &buf, &len)) { + OPENSSL_PUT_ERROR(OBJ, OBJ_R_INVALID_OID_STRING); + CBB_cleanup(&cbb); + return NULL; + } + + ASN1_OBJECT *ret = ASN1_OBJECT_create(get_nid ? get_nid() : NID_undef, buf, + len, short_name, long_name); + OPENSSL_free(buf); + return ret; +} + +ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) { + if (!dont_search_names) { + int nid = OBJ_sn2nid(s); + if (nid == NID_undef) { + nid = OBJ_ln2nid(s); + } + + if (nid != NID_undef) { + return (ASN1_OBJECT*) OBJ_nid2obj(nid); + } + } + + return create_object_with_text_oid(NULL, s, NULL, NULL); +} + +static int strlcpy_int(char *dst, const char *src, int 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; + } + return (int)ret; +} + +int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, + int always_return_oid) { + // Python depends on the empty OID successfully encoding as the empty + // string. + if (obj == NULL || obj->length == 0) { + return strlcpy_int(out, "", out_len); + } + + if (!always_return_oid) { + int nid = OBJ_obj2nid(obj); + if (nid != NID_undef) { + const char *name = OBJ_nid2ln(nid); + if (name == NULL) { + name = OBJ_nid2sn(nid); + } + if (name != NULL) { + return strlcpy_int(out, name, out_len); + } + } + } + + CBS cbs; + CBS_init(&cbs, obj->data, obj->length); + char *txt = CBS_asn1_oid_to_text(&cbs); + if (txt == NULL) { + if (out_len > 0) { + out[0] = '\0'; + } + return -1; + } + + int ret = strlcpy_int(out, txt, out_len); + OPENSSL_free(txt); + return ret; +} + +static uint32_t hash_nid(const ASN1_OBJECT *obj) { + return obj->nid; +} + +static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return a->nid - b->nid; +} + +static uint32_t hash_data(const ASN1_OBJECT *obj) { + return OPENSSL_hash32(obj->data, obj->length); +} + +static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + int i = a->length - b->length; + if (i) { + return i; + } + return OPENSSL_memcmp(a->data, b->data, a->length); +} + +static uint32_t hash_short_name(const ASN1_OBJECT *obj) { + return lh_strhash(obj->sn); +} + +static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return strcmp(a->sn, b->sn); +} + +static uint32_t hash_long_name(const ASN1_OBJECT *obj) { + return lh_strhash(obj->ln); +} + +static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) { + return strcmp(a->ln, b->ln); +} + +// obj_add_object inserts |obj| into the various global hashes for run-time +// added objects. It returns one on success or zero otherwise. +static int obj_add_object(ASN1_OBJECT *obj) { + int ok; + ASN1_OBJECT *old_object; + + obj->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | + ASN1_OBJECT_FLAG_DYNAMIC_DATA); + + CRYPTO_STATIC_MUTEX_lock_write(&global_added_lock); + if (global_added_by_nid == NULL) { + global_added_by_nid = lh_ASN1_OBJECT_new(hash_nid, cmp_nid); + global_added_by_data = lh_ASN1_OBJECT_new(hash_data, cmp_data); + global_added_by_short_name = lh_ASN1_OBJECT_new(hash_short_name, cmp_short_name); + global_added_by_long_name = lh_ASN1_OBJECT_new(hash_long_name, cmp_long_name); + } + + // We don't pay attention to |old_object| (which contains any previous object + // that was evicted from the hashes) because we don't have a reference count + // on ASN1_OBJECT values. Also, we should never have duplicates nids and so + // should always have objects in |global_added_by_nid|. + + ok = lh_ASN1_OBJECT_insert(global_added_by_nid, &old_object, obj); + if (obj->length != 0 && obj->data != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_data, &old_object, obj); + } + if (obj->sn != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_short_name, &old_object, obj); + } + if (obj->ln != NULL) { + ok &= lh_ASN1_OBJECT_insert(global_added_by_long_name, &old_object, obj); + } + CRYPTO_STATIC_MUTEX_unlock_write(&global_added_lock); + + return ok; +} + +int OBJ_create(const char *oid, const char *short_name, const char *long_name) { + ASN1_OBJECT *op = + create_object_with_text_oid(obj_next_nid, oid, short_name, long_name); + if (op == NULL || + !obj_add_object(op)) { + return NID_undef; + } + return op->nid; +} + +void OBJ_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h new file mode 100644 index 0000000..888ea67 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h @@ -0,0 +1,11571 @@ +/* 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. */ + + +#define NUM_NID 962 + +static const uint8_t kObjectData[] = { + /* NID_rsadsi */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + /* NID_pkcs */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + /* NID_md2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x02, + /* NID_md5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x05, + /* NID_rc4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x04, + /* NID_rsaEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x01, + /* NID_md2WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x02, + /* NID_md5WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x04, + /* NID_pbeWithMD2AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x01, + /* NID_pbeWithMD5AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x03, + /* NID_X500 */ + 0x55, + /* NID_X509 */ + 0x55, + 0x04, + /* NID_commonName */ + 0x55, + 0x04, + 0x03, + /* NID_countryName */ + 0x55, + 0x04, + 0x06, + /* NID_localityName */ + 0x55, + 0x04, + 0x07, + /* NID_stateOrProvinceName */ + 0x55, + 0x04, + 0x08, + /* NID_organizationName */ + 0x55, + 0x04, + 0x0a, + /* NID_organizationalUnitName */ + 0x55, + 0x04, + 0x0b, + /* NID_rsa */ + 0x55, + 0x08, + 0x01, + 0x01, + /* NID_pkcs7 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + /* NID_pkcs7_data */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x01, + /* NID_pkcs7_signed */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x02, + /* NID_pkcs7_enveloped */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x03, + /* NID_pkcs7_signedAndEnveloped */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x04, + /* NID_pkcs7_digest */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x05, + /* NID_pkcs7_encrypted */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x06, + /* NID_pkcs3 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + /* NID_dhKeyAgreement */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + 0x01, + /* NID_des_ecb */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x06, + /* NID_des_cfb64 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x09, + /* NID_des_cbc */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x07, + /* NID_des_ede_ecb */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x11, + /* NID_idea_cbc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x81, + 0x3c, + 0x07, + 0x01, + 0x01, + 0x02, + /* NID_rc2_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x02, + /* NID_sha */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x12, + /* NID_shaWithRSAEncryption */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0f, + /* NID_des_ede3_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x07, + /* NID_des_ofb64 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x08, + /* NID_pkcs9 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + /* NID_pkcs9_emailAddress */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x01, + /* NID_pkcs9_unstructuredName */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x02, + /* NID_pkcs9_contentType */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x03, + /* NID_pkcs9_messageDigest */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x04, + /* NID_pkcs9_signingTime */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x05, + /* NID_pkcs9_countersignature */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x06, + /* NID_pkcs9_challengePassword */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x07, + /* NID_pkcs9_unstructuredAddress */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x08, + /* NID_pkcs9_extCertAttributes */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x09, + /* NID_netscape */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + /* NID_netscape_cert_extension */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + /* NID_netscape_data_type */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + /* NID_sha1 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1a, + /* NID_sha1WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x05, + /* NID_dsaWithSHA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0d, + /* NID_dsa_2 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0c, + /* NID_pbeWithSHA1AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0b, + /* NID_id_pbkdf2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0c, + /* NID_dsaWithSHA1_2 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1b, + /* NID_netscape_cert_type */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x01, + /* NID_netscape_base_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x02, + /* NID_netscape_revocation_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x03, + /* NID_netscape_ca_revocation_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x04, + /* NID_netscape_renewal_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x07, + /* NID_netscape_ca_policy_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x08, + /* NID_netscape_ssl_server_name */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0c, + /* NID_netscape_comment */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0d, + /* NID_netscape_cert_sequence */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + 0x05, + /* NID_id_ce */ + 0x55, + 0x1d, + /* NID_subject_key_identifier */ + 0x55, + 0x1d, + 0x0e, + /* NID_key_usage */ + 0x55, + 0x1d, + 0x0f, + /* NID_private_key_usage_period */ + 0x55, + 0x1d, + 0x10, + /* NID_subject_alt_name */ + 0x55, + 0x1d, + 0x11, + /* NID_issuer_alt_name */ + 0x55, + 0x1d, + 0x12, + /* NID_basic_constraints */ + 0x55, + 0x1d, + 0x13, + /* NID_crl_number */ + 0x55, + 0x1d, + 0x14, + /* NID_certificate_policies */ + 0x55, + 0x1d, + 0x20, + /* NID_authority_key_identifier */ + 0x55, + 0x1d, + 0x23, + /* NID_bf_cbc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x97, + 0x55, + 0x01, + 0x02, + /* NID_mdc2 */ + 0x55, + 0x08, + 0x03, + 0x65, + /* NID_mdc2WithRSA */ + 0x55, + 0x08, + 0x03, + 0x64, + /* NID_givenName */ + 0x55, + 0x04, + 0x2a, + /* NID_surname */ + 0x55, + 0x04, + 0x04, + /* NID_initials */ + 0x55, + 0x04, + 0x2b, + /* NID_crl_distribution_points */ + 0x55, + 0x1d, + 0x1f, + /* NID_md5WithRSA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x03, + /* NID_serialNumber */ + 0x55, + 0x04, + 0x05, + /* NID_title */ + 0x55, + 0x04, + 0x0c, + /* NID_description */ + 0x55, + 0x04, + 0x0d, + /* NID_cast5_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0a, + /* NID_pbeWithMD5AndCast5_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0c, + /* NID_dsaWithSHA1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x03, + /* NID_sha1WithRSA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1d, + /* NID_dsa */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x01, + /* NID_ripemd160 */ + 0x2b, + 0x24, + 0x03, + 0x02, + 0x01, + /* NID_ripemd160WithRSA */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x01, + 0x02, + /* NID_rc5_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x08, + /* NID_zlib_compression */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x08, + /* NID_ext_key_usage */ + 0x55, + 0x1d, + 0x25, + /* NID_id_pkix */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + /* NID_id_kp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + /* NID_server_auth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x01, + /* NID_client_auth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x02, + /* NID_code_sign */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x03, + /* NID_email_protect */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x04, + /* NID_time_stamp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x08, + /* NID_ms_code_ind */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x15, + /* NID_ms_code_com */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x16, + /* NID_ms_ctl_sign */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x01, + /* NID_ms_sgc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x03, + /* NID_ms_efs */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x04, + /* NID_ns_sgc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x04, + 0x01, + /* NID_delta_crl */ + 0x55, + 0x1d, + 0x1b, + /* NID_crl_reason */ + 0x55, + 0x1d, + 0x15, + /* NID_invalidity_date */ + 0x55, + 0x1d, + 0x18, + /* NID_sxnet */ + 0x2b, + 0x65, + 0x01, + 0x04, + 0x01, + /* NID_pbe_WithSHA1And128BitRC4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x01, + /* NID_pbe_WithSHA1And40BitRC4 */ + 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, + /* NID_pbe_WithSHA1And2_Key_TripleDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x04, + /* NID_pbe_WithSHA1And128BitRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x05, + /* NID_pbe_WithSHA1And40BitRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x06, + /* NID_keyBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x01, + /* NID_pkcs8ShroudedKeyBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x02, + /* NID_certBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x03, + /* NID_crlBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x04, + /* NID_secretBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x05, + /* NID_safeContentsBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x06, + /* NID_friendlyName */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x14, + /* NID_localKeyID */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x15, + /* NID_x509Certificate */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x01, + /* NID_sdsiCertificate */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x02, + /* NID_x509Crl */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x17, + 0x01, + /* NID_pbes2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0d, + /* NID_pbmac1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0e, + /* NID_hmacWithSHA1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x07, + /* NID_id_qt_cps */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x01, + /* NID_id_qt_unotice */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x02, + /* NID_SMIMECapabilities */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0f, + /* NID_pbeWithMD2AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x04, + /* NID_pbeWithMD5AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x06, + /* NID_pbeWithSHA1AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0a, + /* NID_ms_ext_req */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x0e, + /* NID_ext_req */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0e, + /* NID_name */ + 0x55, + 0x04, + 0x29, + /* NID_dnQualifier */ + 0x55, + 0x04, + 0x2e, + /* NID_id_pe */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + /* NID_id_ad */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + /* NID_info_access */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x01, + /* NID_ad_OCSP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + /* NID_ad_ca_issuers */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x02, + /* NID_OCSP_sign */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x09, + /* NID_member_body */ + 0x2a, + /* NID_ISO_US */ + 0x2a, + 0x86, + 0x48, + /* NID_X9_57 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + /* NID_X9cm */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + /* NID_pkcs1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + /* NID_pkcs5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + /* NID_SMIME */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + /* NID_id_smime_mod */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + /* NID_id_smime_ct */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + /* NID_id_smime_aa */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + /* NID_id_smime_alg */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + /* NID_id_smime_cd */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, + /* NID_id_smime_spq */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + /* NID_id_smime_cti */ + 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, + /* NID_id_smime_mod_ess */ + 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, + /* NID_id_smime_mod_msg_v3 */ + 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, + /* NID_id_smime_mod_ets_eSignature_97 */ + 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, + /* NID_id_smime_mod_ets_eSigPolicy_97 */ + 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, + /* NID_id_smime_ct_authData */ + 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, + /* NID_id_smime_ct_TSTInfo */ + 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, + /* NID_id_smime_ct_contentInfo */ + 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, + /* NID_id_smime_ct_DVCSResponseData */ + 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, + /* NID_id_smime_aa_securityLabel */ + 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, + /* NID_id_smime_aa_contentHint */ + 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, + /* NID_id_smime_aa_encapContentType */ + 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, + /* NID_id_smime_aa_macValue */ + 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, + /* NID_id_smime_aa_contentReference */ + 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, + /* NID_id_smime_aa_signingCertificate */ + 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, + /* NID_id_smime_aa_timeStampToken */ + 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, + /* NID_id_smime_aa_ets_commitmentType */ + 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, + /* NID_id_smime_aa_ets_signerAttr */ + 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, + /* NID_id_smime_aa_ets_contentTimestamp */ + 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, + /* NID_id_smime_aa_ets_certValues */ + 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, + /* NID_id_smime_aa_ets_escTimeStamp */ + 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, + /* NID_id_smime_aa_ets_archiveTimeStamp */ + 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, + /* NID_id_smime_aa_dvcs_dvc */ + 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, + /* NID_id_smime_alg_ESDHwithRC2 */ + 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, + /* NID_id_smime_alg_RC2wrap */ + 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, + /* NID_id_smime_alg_CMS3DESwrap */ + 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, + /* NID_id_smime_cd_ldap */ + 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, + /* NID_id_smime_spq_ets_sqt_unotice */ + 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, + /* NID_id_smime_cti_ets_proofOfReceipt */ + 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, + /* NID_id_smime_cti_ets_proofOfSender */ + 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, + /* NID_id_smime_cti_ets_proofOfCreation */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x06, + /* NID_md4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x04, + /* NID_id_pkix_mod */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + /* NID_id_qt */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + /* NID_id_it */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + /* NID_id_pkip */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + /* NID_id_alg */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + /* NID_id_cmc */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + /* NID_id_on */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + /* NID_id_pda */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + /* NID_id_aca */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + /* NID_id_qcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + /* NID_id_cct */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + /* NID_id_pkix1_explicit_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x01, + /* NID_id_pkix1_implicit_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x02, + /* NID_id_pkix1_explicit_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x03, + /* NID_id_pkix1_implicit_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x04, + /* NID_id_mod_crmf */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x05, + /* NID_id_mod_cmc */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x06, + /* NID_id_mod_kea_profile_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x07, + /* NID_id_mod_kea_profile_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x08, + /* NID_id_mod_cmp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x09, + /* NID_id_mod_qualified_cert_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0a, + /* NID_id_mod_qualified_cert_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0b, + /* NID_id_mod_attribute_cert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0c, + /* NID_id_mod_timestamp_protocol */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0d, + /* NID_id_mod_ocsp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0e, + /* NID_id_mod_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0f, + /* NID_id_mod_cmp2000 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x10, + /* NID_biometricInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x02, + /* NID_qcStatements */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x03, + /* NID_ac_auditEntity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x04, + /* NID_ac_targeting */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x05, + /* NID_aaControls */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x06, + /* NID_sbgp_ipAddrBlock */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x07, + /* NID_sbgp_autonomousSysNum */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x08, + /* NID_sbgp_routerIdentifier */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x09, + /* NID_textNotice */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x03, + /* NID_ipsecEndSystem */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x05, + /* NID_ipsecTunnel */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x06, + /* NID_ipsecUser */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x07, + /* NID_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x0a, + /* NID_id_it_caProtEncCert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x01, + /* NID_id_it_signKeyPairTypes */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x02, + /* NID_id_it_encKeyPairTypes */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x03, + /* NID_id_it_preferredSymmAlg */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x04, + /* NID_id_it_caKeyUpdateInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x05, + /* NID_id_it_currentCRL */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x06, + /* NID_id_it_unsupportedOIDs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x07, + /* NID_id_it_subscriptionRequest */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x08, + /* NID_id_it_subscriptionResponse */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x09, + /* NID_id_it_keyPairParamReq */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0a, + /* NID_id_it_keyPairParamRep */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0b, + /* NID_id_it_revPassphrase */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0c, + /* NID_id_it_implicitConfirm */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0d, + /* NID_id_it_confirmWaitTime */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0e, + /* NID_id_it_origPKIMessage */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0f, + /* NID_id_regCtrl */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + /* NID_id_regInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + /* NID_id_regCtrl_regToken */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x01, + /* NID_id_regCtrl_authenticator */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x02, + /* NID_id_regCtrl_pkiPublicationInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x03, + /* NID_id_regCtrl_pkiArchiveOptions */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x04, + /* NID_id_regCtrl_oldCertID */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x05, + /* NID_id_regCtrl_protocolEncrKey */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x06, + /* NID_id_regInfo_utf8Pairs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x01, + /* NID_id_regInfo_certReq */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x02, + /* NID_id_alg_des40 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x01, + /* NID_id_alg_noSignature */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x02, + /* NID_id_alg_dh_sig_hmac_sha1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x03, + /* NID_id_alg_dh_pop */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x04, + /* NID_id_cmc_statusInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x01, + /* NID_id_cmc_identification */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x02, + /* NID_id_cmc_identityProof */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x03, + /* NID_id_cmc_dataReturn */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x04, + /* NID_id_cmc_transactionId */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x05, + /* NID_id_cmc_senderNonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x06, + /* NID_id_cmc_recipientNonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x07, + /* NID_id_cmc_addExtensions */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x08, + /* NID_id_cmc_encryptedPOP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x09, + /* NID_id_cmc_decryptedPOP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0a, + /* NID_id_cmc_lraPOPWitness */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0b, + /* NID_id_cmc_getCert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0f, + /* NID_id_cmc_getCRL */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x10, + /* NID_id_cmc_revokeRequest */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x11, + /* NID_id_cmc_regInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x12, + /* NID_id_cmc_responseInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x13, + /* NID_id_cmc_queryPending */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x15, + /* NID_id_cmc_popLinkRandom */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x16, + /* NID_id_cmc_popLinkWitness */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x17, + /* NID_id_cmc_confirmCertAcceptance */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x18, + /* NID_id_on_personalData */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x01, + /* NID_id_pda_dateOfBirth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x01, + /* NID_id_pda_placeOfBirth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x02, + /* NID_id_pda_gender */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x03, + /* NID_id_pda_countryOfCitizenship */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x04, + /* NID_id_pda_countryOfResidence */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x05, + /* NID_id_aca_authenticationInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x01, + /* NID_id_aca_accessIdentity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x02, + /* NID_id_aca_chargingIdentity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x03, + /* NID_id_aca_group */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x04, + /* NID_id_aca_role */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x05, + /* NID_id_qcs_pkixQCSyntax_v1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + 0x01, + /* NID_id_cct_crs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x01, + /* NID_id_cct_PKIData */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x02, + /* NID_id_cct_PKIResponse */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x03, + /* NID_ad_timeStamping */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x03, + /* NID_ad_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x04, + /* NID_id_pkix_OCSP_basic */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x01, + /* NID_id_pkix_OCSP_Nonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x02, + /* NID_id_pkix_OCSP_CrlID */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x03, + /* NID_id_pkix_OCSP_acceptableResponses */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x04, + /* NID_id_pkix_OCSP_noCheck */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x05, + /* NID_id_pkix_OCSP_archiveCutoff */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x06, + /* NID_id_pkix_OCSP_serviceLocator */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x07, + /* NID_id_pkix_OCSP_extendedStatus */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x08, + /* NID_id_pkix_OCSP_valid */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x09, + /* NID_id_pkix_OCSP_path */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0a, + /* NID_id_pkix_OCSP_trustRoot */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0b, + /* NID_algorithm */ + 0x2b, + 0x0e, + 0x03, + 0x02, + /* NID_rsaSignature */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0b, + /* NID_X500algorithms */ + 0x55, + 0x08, + /* NID_org */ + 0x2b, + /* NID_dod */ + 0x2b, + 0x06, + /* NID_iana */ + 0x2b, + 0x06, + 0x01, + /* NID_Directory */ + 0x2b, + 0x06, + 0x01, + 0x01, + /* NID_Management */ + 0x2b, + 0x06, + 0x01, + 0x02, + /* NID_Experimental */ + 0x2b, + 0x06, + 0x01, + 0x03, + /* NID_Private */ + 0x2b, + 0x06, + 0x01, + 0x04, + /* NID_Security */ + 0x2b, + 0x06, + 0x01, + 0x05, + /* NID_SNMPv2 */ + 0x2b, + 0x06, + 0x01, + 0x06, + /* NID_Mail */ + 0x2b, + 0x06, + 0x01, + 0x07, + /* NID_Enterprises */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + /* NID_dcObject */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x8b, + 0x3a, + 0x82, + 0x58, + /* NID_domainComponent */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x19, + /* NID_Domain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0d, + /* NID_selected_attribute_types */ + 0x55, + 0x01, + 0x05, + /* NID_clearance */ + 0x55, + 0x01, + 0x05, + 0x37, + /* NID_md4WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x03, + /* NID_ac_proxying */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0a, + /* NID_sinfo_access */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0b, + /* NID_id_aca_encAttrs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x06, + /* NID_role */ + 0x55, + 0x04, + 0x48, + /* NID_policy_constraints */ + 0x55, + 0x1d, + 0x24, + /* NID_target_information */ + 0x55, + 0x1d, + 0x37, + /* NID_no_rev_avail */ + 0x55, + 0x1d, + 0x38, + /* NID_ansi_X9_62 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + /* NID_X9_62_prime_field */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x01, + /* NID_X9_62_characteristic_two_field */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + /* NID_X9_62_id_ecPublicKey */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x02, + 0x01, + /* NID_X9_62_prime192v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x01, + /* NID_X9_62_prime192v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x02, + /* NID_X9_62_prime192v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x03, + /* NID_X9_62_prime239v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x04, + /* NID_X9_62_prime239v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x05, + /* NID_X9_62_prime239v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x06, + /* NID_X9_62_prime256v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x07, + /* NID_ecdsa_with_SHA1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x01, + /* NID_ms_csp_name */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x01, + /* NID_aes_128_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x01, + /* NID_aes_128_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x02, + /* NID_aes_128_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x03, + /* NID_aes_128_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x04, + /* NID_aes_192_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x15, + /* NID_aes_192_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x16, + /* NID_aes_192_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x17, + /* NID_aes_192_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x18, + /* NID_aes_256_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x29, + /* NID_aes_256_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2a, + /* NID_aes_256_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2b, + /* NID_aes_256_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2c, + /* NID_hold_instruction_code */ + 0x55, + 0x1d, + 0x17, + /* NID_hold_instruction_none */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x01, + /* NID_hold_instruction_call_issuer */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x02, + /* NID_hold_instruction_reject */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x03, + /* NID_data */ + 0x09, + /* NID_pss */ + 0x09, + 0x92, + 0x26, + /* NID_ucl */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + /* NID_pilot */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + /* NID_pilotAttributeType */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + /* NID_pilotAttributeSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + /* NID_pilotObjectClass */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + /* NID_pilotGroups */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x0a, + /* NID_iA5StringSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x04, + /* NID_caseIgnoreIA5StringSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x05, + /* NID_pilotObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x03, + /* NID_pilotPerson */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x04, + /* NID_account */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x05, + /* NID_document */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x06, + /* NID_room */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x07, + /* NID_documentSeries */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x09, + /* NID_rFC822localPart */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0e, + /* NID_dNSDomain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0f, + /* NID_domainRelatedObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x11, + /* NID_friendlyCountry */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x12, + /* NID_simpleSecurityObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x13, + /* NID_pilotOrganization */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x14, + /* NID_pilotDSA */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x15, + /* NID_qualityLabelledData */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x16, + /* NID_userId */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x01, + /* NID_textEncodedORAddress */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x02, + /* NID_rfc822Mailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x03, + /* NID_info */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x04, + /* NID_favouriteDrink */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x05, + /* NID_roomNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x06, + /* NID_photo */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x07, + /* NID_userClass */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x08, + /* NID_host */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x09, + /* NID_manager */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0a, + /* NID_documentIdentifier */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0b, + /* NID_documentTitle */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0c, + /* NID_documentVersion */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0d, + /* NID_documentAuthor */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0e, + /* NID_documentLocation */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0f, + /* NID_homeTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x14, + /* NID_secretary */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x15, + /* NID_otherMailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x16, + /* NID_lastModifiedTime */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x17, + /* NID_lastModifiedBy */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x18, + /* NID_aRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1a, + /* NID_pilotAttributeType27 */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1b, + /* NID_mXRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1c, + /* NID_nSRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1d, + /* NID_sOARecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1e, + /* NID_cNAMERecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1f, + /* NID_associatedDomain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x25, + /* NID_associatedName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x26, + /* NID_homePostalAddress */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x27, + /* NID_personalTitle */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x28, + /* NID_mobileTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x29, + /* NID_pagerTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2a, + /* NID_friendlyCountryName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2b, + /* NID_organizationalStatus */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2d, + /* NID_janetMailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2e, + /* NID_mailPreferenceOption */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2f, + /* NID_buildingName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x30, + /* NID_dSAQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x31, + /* NID_singleLevelQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x32, + /* NID_subtreeMinimumQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x33, + /* NID_subtreeMaximumQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x34, + /* NID_personalSignature */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x35, + /* NID_dITRedirect */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x36, + /* NID_audio */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x37, + /* NID_documentPublisher */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x38, + /* NID_x500UniqueIdentifier */ + 0x55, + 0x04, + 0x2d, + /* NID_mime_mhs */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + /* NID_mime_mhs_headings */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + /* NID_mime_mhs_bodies */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x02, + /* NID_id_hex_partial_message */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x01, + /* NID_id_hex_multipart_message */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x02, + /* NID_generationQualifier */ + 0x55, + 0x04, + 0x2c, + /* NID_pseudonym */ + 0x55, + 0x04, + 0x41, + /* NID_id_set */ + 0x67, + 0x2a, + /* NID_set_ctype */ + 0x67, + 0x2a, + 0x00, + /* NID_set_msgExt */ + 0x67, + 0x2a, + 0x01, + /* NID_set_attr */ + 0x67, + 0x2a, + 0x03, + /* NID_set_policy */ + 0x67, + 0x2a, + 0x05, + /* NID_set_certExt */ + 0x67, + 0x2a, + 0x07, + /* NID_set_brand */ + 0x67, + 0x2a, + 0x08, + /* NID_setct_PANData */ + 0x67, + 0x2a, + 0x00, + 0x00, + /* NID_setct_PANToken */ + 0x67, + 0x2a, + 0x00, + 0x01, + /* NID_setct_PANOnly */ + 0x67, + 0x2a, + 0x00, + 0x02, + /* NID_setct_OIData */ + 0x67, + 0x2a, + 0x00, + 0x03, + /* NID_setct_PI */ + 0x67, + 0x2a, + 0x00, + 0x04, + /* NID_setct_PIData */ + 0x67, + 0x2a, + 0x00, + 0x05, + /* NID_setct_PIDataUnsigned */ + 0x67, + 0x2a, + 0x00, + 0x06, + /* NID_setct_HODInput */ + 0x67, + 0x2a, + 0x00, + 0x07, + /* NID_setct_AuthResBaggage */ + 0x67, + 0x2a, + 0x00, + 0x08, + /* NID_setct_AuthRevReqBaggage */ + 0x67, + 0x2a, + 0x00, + 0x09, + /* NID_setct_AuthRevResBaggage */ + 0x67, + 0x2a, + 0x00, + 0x0a, + /* NID_setct_CapTokenSeq */ + 0x67, + 0x2a, + 0x00, + 0x0b, + /* NID_setct_PInitResData */ + 0x67, + 0x2a, + 0x00, + 0x0c, + /* NID_setct_PI_TBS */ + 0x67, + 0x2a, + 0x00, + 0x0d, + /* NID_setct_PResData */ + 0x67, + 0x2a, + 0x00, + 0x0e, + /* NID_setct_AuthReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x10, + /* NID_setct_AuthResTBS */ + 0x67, + 0x2a, + 0x00, + 0x11, + /* NID_setct_AuthResTBSX */ + 0x67, + 0x2a, + 0x00, + 0x12, + /* NID_setct_AuthTokenTBS */ + 0x67, + 0x2a, + 0x00, + 0x13, + /* NID_setct_CapTokenData */ + 0x67, + 0x2a, + 0x00, + 0x14, + /* NID_setct_CapTokenTBS */ + 0x67, + 0x2a, + 0x00, + 0x15, + /* NID_setct_AcqCardCodeMsg */ + 0x67, + 0x2a, + 0x00, + 0x16, + /* NID_setct_AuthRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x17, + /* NID_setct_AuthRevResData */ + 0x67, + 0x2a, + 0x00, + 0x18, + /* NID_setct_AuthRevResTBS */ + 0x67, + 0x2a, + 0x00, + 0x19, + /* NID_setct_CapReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x1a, + /* NID_setct_CapReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x1b, + /* NID_setct_CapResData */ + 0x67, + 0x2a, + 0x00, + 0x1c, + /* NID_setct_CapRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x1d, + /* NID_setct_CapRevReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x1e, + /* NID_setct_CapRevResData */ + 0x67, + 0x2a, + 0x00, + 0x1f, + /* NID_setct_CredReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x20, + /* NID_setct_CredReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x21, + /* NID_setct_CredResData */ + 0x67, + 0x2a, + 0x00, + 0x22, + /* NID_setct_CredRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x23, + /* NID_setct_CredRevReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x24, + /* NID_setct_CredRevResData */ + 0x67, + 0x2a, + 0x00, + 0x25, + /* NID_setct_PCertReqData */ + 0x67, + 0x2a, + 0x00, + 0x26, + /* NID_setct_PCertResTBS */ + 0x67, + 0x2a, + 0x00, + 0x27, + /* NID_setct_BatchAdminReqData */ + 0x67, + 0x2a, + 0x00, + 0x28, + /* NID_setct_BatchAdminResData */ + 0x67, + 0x2a, + 0x00, + 0x29, + /* NID_setct_CardCInitResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2a, + /* NID_setct_MeAqCInitResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2b, + /* NID_setct_RegFormResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2c, + /* NID_setct_CertReqData */ + 0x67, + 0x2a, + 0x00, + 0x2d, + /* NID_setct_CertReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x2e, + /* NID_setct_CertResData */ + 0x67, + 0x2a, + 0x00, + 0x2f, + /* NID_setct_CertInqReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x30, + /* NID_setct_ErrorTBS */ + 0x67, + 0x2a, + 0x00, + 0x31, + /* NID_setct_PIDualSignedTBE */ + 0x67, + 0x2a, + 0x00, + 0x32, + /* NID_setct_PIUnsignedTBE */ + 0x67, + 0x2a, + 0x00, + 0x33, + /* NID_setct_AuthReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x34, + /* NID_setct_AuthResTBE */ + 0x67, + 0x2a, + 0x00, + 0x35, + /* NID_setct_AuthResTBEX */ + 0x67, + 0x2a, + 0x00, + 0x36, + /* NID_setct_AuthTokenTBE */ + 0x67, + 0x2a, + 0x00, + 0x37, + /* NID_setct_CapTokenTBE */ + 0x67, + 0x2a, + 0x00, + 0x38, + /* NID_setct_CapTokenTBEX */ + 0x67, + 0x2a, + 0x00, + 0x39, + /* NID_setct_AcqCardCodeMsgTBE */ + 0x67, + 0x2a, + 0x00, + 0x3a, + /* NID_setct_AuthRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x3b, + /* NID_setct_AuthRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x3c, + /* NID_setct_AuthRevResTBEB */ + 0x67, + 0x2a, + 0x00, + 0x3d, + /* NID_setct_CapReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x3e, + /* NID_setct_CapReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x3f, + /* NID_setct_CapResTBE */ + 0x67, + 0x2a, + 0x00, + 0x40, + /* NID_setct_CapRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x41, + /* NID_setct_CapRevReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x42, + /* NID_setct_CapRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x43, + /* NID_setct_CredReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x44, + /* NID_setct_CredReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x45, + /* NID_setct_CredResTBE */ + 0x67, + 0x2a, + 0x00, + 0x46, + /* NID_setct_CredRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x47, + /* NID_setct_CredRevReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x48, + /* NID_setct_CredRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x49, + /* NID_setct_BatchAdminReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4a, + /* NID_setct_BatchAdminResTBE */ + 0x67, + 0x2a, + 0x00, + 0x4b, + /* NID_setct_RegFormReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4c, + /* NID_setct_CertReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4d, + /* NID_setct_CertReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x4e, + /* NID_setct_CertResTBE */ + 0x67, + 0x2a, + 0x00, + 0x4f, + /* NID_setct_CRLNotificationTBS */ + 0x67, + 0x2a, + 0x00, + 0x50, + /* NID_setct_CRLNotificationResTBS */ + 0x67, + 0x2a, + 0x00, + 0x51, + /* NID_setct_BCIDistributionTBS */ + 0x67, + 0x2a, + 0x00, + 0x52, + /* NID_setext_genCrypt */ + 0x67, + 0x2a, + 0x01, + 0x01, + /* NID_setext_miAuth */ + 0x67, + 0x2a, + 0x01, + 0x03, + /* NID_setext_pinSecure */ + 0x67, + 0x2a, + 0x01, + 0x04, + /* NID_setext_pinAny */ + 0x67, + 0x2a, + 0x01, + 0x05, + /* NID_setext_track2 */ + 0x67, + 0x2a, + 0x01, + 0x07, + /* NID_setext_cv */ + 0x67, + 0x2a, + 0x01, + 0x08, + /* NID_set_policy_root */ + 0x67, + 0x2a, + 0x05, + 0x00, + /* NID_setCext_hashedRoot */ + 0x67, + 0x2a, + 0x07, + 0x00, + /* NID_setCext_certType */ + 0x67, + 0x2a, + 0x07, + 0x01, + /* NID_setCext_merchData */ + 0x67, + 0x2a, + 0x07, + 0x02, + /* NID_setCext_cCertRequired */ + 0x67, + 0x2a, + 0x07, + 0x03, + /* NID_setCext_tunneling */ + 0x67, + 0x2a, + 0x07, + 0x04, + /* NID_setCext_setExt */ + 0x67, + 0x2a, + 0x07, + 0x05, + /* NID_setCext_setQualf */ + 0x67, + 0x2a, + 0x07, + 0x06, + /* NID_setCext_PGWYcapabilities */ + 0x67, + 0x2a, + 0x07, + 0x07, + /* NID_setCext_TokenIdentifier */ + 0x67, + 0x2a, + 0x07, + 0x08, + /* NID_setCext_Track2Data */ + 0x67, + 0x2a, + 0x07, + 0x09, + /* NID_setCext_TokenType */ + 0x67, + 0x2a, + 0x07, + 0x0a, + /* NID_setCext_IssuerCapabilities */ + 0x67, + 0x2a, + 0x07, + 0x0b, + /* NID_setAttr_Cert */ + 0x67, + 0x2a, + 0x03, + 0x00, + /* NID_setAttr_PGWYcap */ + 0x67, + 0x2a, + 0x03, + 0x01, + /* NID_setAttr_TokenType */ + 0x67, + 0x2a, + 0x03, + 0x02, + /* NID_setAttr_IssCap */ + 0x67, + 0x2a, + 0x03, + 0x03, + /* NID_set_rootKeyThumb */ + 0x67, + 0x2a, + 0x03, + 0x00, + 0x00, + /* NID_set_addPolicy */ + 0x67, + 0x2a, + 0x03, + 0x00, + 0x01, + /* NID_setAttr_Token_EMV */ + 0x67, + 0x2a, + 0x03, + 0x02, + 0x01, + /* NID_setAttr_Token_B0Prime */ + 0x67, + 0x2a, + 0x03, + 0x02, + 0x02, + /* NID_setAttr_IssCap_CVM */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + /* NID_setAttr_IssCap_T2 */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + /* NID_setAttr_IssCap_Sig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + /* NID_setAttr_GenCryptgrm */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + 0x01, + /* NID_setAttr_T2Enc */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x01, + /* NID_setAttr_T2cleartxt */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x02, + /* NID_setAttr_TokICCsig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x01, + /* NID_setAttr_SecDevSig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x02, + /* NID_set_brand_IATA_ATA */ + 0x67, + 0x2a, + 0x08, + 0x01, + /* NID_set_brand_Diners */ + 0x67, + 0x2a, + 0x08, + 0x1e, + /* NID_set_brand_AmericanExpress */ + 0x67, + 0x2a, + 0x08, + 0x22, + /* NID_set_brand_JCB */ + 0x67, + 0x2a, + 0x08, + 0x23, + /* NID_set_brand_Visa */ + 0x67, + 0x2a, + 0x08, + 0x04, + /* NID_set_brand_MasterCard */ + 0x67, + 0x2a, + 0x08, + 0x05, + /* NID_set_brand_Novus */ + 0x67, + 0x2a, + 0x08, + 0xae, + 0x7b, + /* NID_des_cdmf */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x0a, + /* NID_rsaOAEPEncryptionSET */ + 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, + /* NID_ms_upn */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x03, + /* NID_streetAddress */ + 0x55, + 0x04, + 0x09, + /* NID_postalCode */ + 0x55, + 0x04, + 0x11, + /* NID_id_ppl */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + /* NID_proxyCertInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0e, + /* NID_id_ppl_anyLanguage */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x00, + /* NID_id_ppl_inheritAll */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x01, + /* NID_name_constraints */ + 0x55, + 0x1d, + 0x1e, + /* NID_Independent */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x02, + /* NID_sha256WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0b, + /* NID_sha384WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0c, + /* NID_sha512WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0d, + /* NID_sha224WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0e, + /* NID_sha256 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x01, + /* NID_sha384 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x02, + /* NID_sha512 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x03, + /* NID_sha224 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x04, + /* NID_identified_organization */ + 0x2b, + /* NID_certicom_arc */ + 0x2b, + 0x81, + 0x04, + /* NID_wap */ + 0x67, + 0x2b, + /* NID_wap_wsg */ + 0x67, + 0x2b, + 0x01, + /* NID_X9_62_id_characteristic_two_basis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + /* NID_X9_62_onBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x01, + /* NID_X9_62_tpBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x02, + /* NID_X9_62_ppBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x03, + /* NID_X9_62_c2pnb163v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x01, + /* NID_X9_62_c2pnb163v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x02, + /* NID_X9_62_c2pnb163v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x03, + /* NID_X9_62_c2pnb176v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x04, + /* NID_X9_62_c2tnb191v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x05, + /* NID_X9_62_c2tnb191v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x06, + /* NID_X9_62_c2tnb191v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x07, + /* NID_X9_62_c2onb191v4 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x08, + /* NID_X9_62_c2onb191v5 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x09, + /* NID_X9_62_c2pnb208w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0a, + /* NID_X9_62_c2tnb239v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0b, + /* NID_X9_62_c2tnb239v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0c, + /* NID_X9_62_c2tnb239v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0d, + /* NID_X9_62_c2onb239v4 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0e, + /* NID_X9_62_c2onb239v5 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0f, + /* NID_X9_62_c2pnb272w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x10, + /* NID_X9_62_c2pnb304w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x11, + /* NID_X9_62_c2tnb359v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x12, + /* NID_X9_62_c2pnb368w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x13, + /* NID_X9_62_c2tnb431r1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x14, + /* NID_secp112r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x06, + /* NID_secp112r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x07, + /* NID_secp128r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1c, + /* NID_secp128r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1d, + /* NID_secp160k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x09, + /* NID_secp160r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x08, + /* NID_secp160r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1e, + /* NID_secp192k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1f, + /* NID_secp224k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x20, + /* NID_secp224r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x21, + /* NID_secp256k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0a, + /* NID_secp384r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x22, + /* NID_secp521r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x23, + /* NID_sect113r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x04, + /* NID_sect113r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x05, + /* NID_sect131r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x16, + /* NID_sect131r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x17, + /* NID_sect163k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x01, + /* NID_sect163r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x02, + /* NID_sect163r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0f, + /* NID_sect193r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x18, + /* NID_sect193r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x19, + /* NID_sect233k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1a, + /* NID_sect233r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1b, + /* NID_sect239k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x03, + /* NID_sect283k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x10, + /* NID_sect283r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x11, + /* NID_sect409k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x24, + /* NID_sect409r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x25, + /* NID_sect571k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x26, + /* NID_sect571r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x27, + /* NID_wap_wsg_idm_ecid_wtls1 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x01, + /* NID_wap_wsg_idm_ecid_wtls3 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x03, + /* NID_wap_wsg_idm_ecid_wtls4 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x04, + /* NID_wap_wsg_idm_ecid_wtls5 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x05, + /* NID_wap_wsg_idm_ecid_wtls6 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x06, + /* NID_wap_wsg_idm_ecid_wtls7 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x07, + /* NID_wap_wsg_idm_ecid_wtls8 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x08, + /* NID_wap_wsg_idm_ecid_wtls9 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x09, + /* NID_wap_wsg_idm_ecid_wtls10 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0a, + /* NID_wap_wsg_idm_ecid_wtls11 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0b, + /* NID_wap_wsg_idm_ecid_wtls12 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0c, + /* NID_any_policy */ + 0x55, + 0x1d, + 0x20, + 0x00, + /* NID_policy_mappings */ + 0x55, + 0x1d, + 0x21, + /* NID_inhibit_any_policy */ + 0x55, + 0x1d, + 0x36, + /* NID_camellia_128_cbc */ + 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, + /* NID_camellia_256_cbc */ + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x04, + /* NID_camellia_128_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x01, + /* NID_camellia_192_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x15, + /* NID_camellia_256_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x29, + /* NID_camellia_128_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x04, + /* NID_camellia_192_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x18, + /* NID_camellia_256_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2c, + /* NID_camellia_128_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x03, + /* NID_camellia_192_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x17, + /* NID_camellia_256_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2b, + /* NID_subject_directory_attributes */ + 0x55, + 0x1d, + 0x09, + /* NID_issuing_distribution_point */ + 0x55, + 0x1d, + 0x1c, + /* NID_certificate_issuer */ + 0x55, + 0x1d, + 0x1d, + /* NID_kisa */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + /* NID_seed_ecb */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x03, + /* NID_seed_cbc */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x04, + /* NID_seed_ofb128 */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x06, + /* NID_seed_cfb128 */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x05, + /* NID_hmac_md5 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x01, + /* NID_hmac_sha1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x02, + /* NID_id_PasswordBasedMAC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0d, + /* NID_id_DHBasedMac */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x1e, + /* NID_id_it_suppLangTags */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x10, + /* NID_caRepository */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x05, + /* NID_id_smime_ct_compressedData */ + 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, + /* NID_id_aes128_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x05, + /* NID_id_aes192_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x19, + /* NID_id_aes256_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2d, + /* NID_ecdsa_with_Recommended */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x02, + /* NID_ecdsa_with_Specified */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + /* NID_ecdsa_with_SHA224 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x01, + /* NID_ecdsa_with_SHA256 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x02, + /* NID_ecdsa_with_SHA384 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x03, + /* NID_ecdsa_with_SHA512 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x04, + /* NID_hmacWithMD5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x06, + /* NID_hmacWithSHA224 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x08, + /* NID_hmacWithSHA256 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x09, + /* NID_hmacWithSHA384 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0a, + /* NID_hmacWithSHA512 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0b, + /* NID_dsa_with_SHA224 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x01, + /* NID_dsa_with_SHA256 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x02, + /* NID_whirlpool */ + 0x28, + 0xcf, + 0x06, + 0x03, + 0x00, + 0x37, + /* NID_cryptopro */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + /* NID_cryptocom */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + /* NID_id_GostR3411_94_with_GostR3410_2001 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x03, + /* NID_id_GostR3411_94_with_GostR3410_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x04, + /* NID_id_GostR3411_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x09, + /* NID_id_HMACGostR3411_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0a, + /* NID_id_GostR3410_2001 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x13, + /* NID_id_GostR3410_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + /* NID_id_Gost28147_89 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x15, + /* NID_id_Gost28147_89_MAC */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x16, + /* NID_id_GostR3411_94_prf */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x17, + /* NID_id_GostR3410_2001DH */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x62, + /* NID_id_GostR3410_94DH */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x63, + /* NID_id_Gost28147_89_CryptoPro_KeyMeshing */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x01, + /* NID_id_Gost28147_89_None_KeyMeshing */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x00, + /* NID_id_GostR3411_94_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x00, + /* NID_id_GostR3411_94_CryptoProParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x01, + /* NID_id_Gost28147_89_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x00, + /* NID_id_Gost28147_89_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x01, + /* NID_id_Gost28147_89_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x02, + /* NID_id_Gost28147_89_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x03, + /* NID_id_Gost28147_89_CryptoPro_D_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x04, + /* NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x05, + /* NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x06, + /* NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x07, + /* NID_id_GostR3410_94_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x00, + /* NID_id_GostR3410_94_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x02, + /* NID_id_GostR3410_94_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x03, + /* NID_id_GostR3410_94_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x04, + /* NID_id_GostR3410_94_CryptoPro_D_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x05, + /* NID_id_GostR3410_94_CryptoPro_XchA_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x01, + /* NID_id_GostR3410_94_CryptoPro_XchB_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x02, + /* NID_id_GostR3410_94_CryptoPro_XchC_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x03, + /* NID_id_GostR3410_2001_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x00, + /* NID_id_GostR3410_2001_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x01, + /* NID_id_GostR3410_2001_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x02, + /* NID_id_GostR3410_2001_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x03, + /* NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x00, + /* NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x01, + /* NID_id_GostR3410_94_a */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x01, + /* NID_id_GostR3410_94_aBis */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x02, + /* NID_id_GostR3410_94_b */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x03, + /* NID_id_GostR3410_94_bBis */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x04, + /* NID_id_Gost28147_89_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x06, + 0x01, + /* NID_id_GostR3410_94_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x03, + /* NID_id_GostR3410_2001_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x04, + /* NID_id_GostR3411_94_with_GostR3410_94_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x03, + /* NID_id_GostR3411_94_with_GostR3410_2001_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x04, + /* NID_id_GostR3410_2001_ParamSet_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x08, + 0x01, + /* NID_LocalKeySet */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x02, + /* NID_freshest_crl */ + 0x55, + 0x1d, + 0x2e, + /* NID_id_on_permanentIdentifier */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x03, + /* NID_searchGuide */ + 0x55, + 0x04, + 0x0e, + /* NID_businessCategory */ + 0x55, + 0x04, + 0x0f, + /* NID_postalAddress */ + 0x55, + 0x04, + 0x10, + /* NID_postOfficeBox */ + 0x55, + 0x04, + 0x12, + /* NID_physicalDeliveryOfficeName */ + 0x55, + 0x04, + 0x13, + /* NID_telephoneNumber */ + 0x55, + 0x04, + 0x14, + /* NID_telexNumber */ + 0x55, + 0x04, + 0x15, + /* NID_teletexTerminalIdentifier */ + 0x55, + 0x04, + 0x16, + /* NID_facsimileTelephoneNumber */ + 0x55, + 0x04, + 0x17, + /* NID_x121Address */ + 0x55, + 0x04, + 0x18, + /* NID_internationaliSDNNumber */ + 0x55, + 0x04, + 0x19, + /* NID_registeredAddress */ + 0x55, + 0x04, + 0x1a, + /* NID_destinationIndicator */ + 0x55, + 0x04, + 0x1b, + /* NID_preferredDeliveryMethod */ + 0x55, + 0x04, + 0x1c, + /* NID_presentationAddress */ + 0x55, + 0x04, + 0x1d, + /* NID_supportedApplicationContext */ + 0x55, + 0x04, + 0x1e, + /* NID_member */ + 0x55, + 0x04, + 0x1f, + /* NID_owner */ + 0x55, + 0x04, + 0x20, + /* NID_roleOccupant */ + 0x55, + 0x04, + 0x21, + /* NID_seeAlso */ + 0x55, + 0x04, + 0x22, + /* NID_userPassword */ + 0x55, + 0x04, + 0x23, + /* NID_userCertificate */ + 0x55, + 0x04, + 0x24, + /* NID_cACertificate */ + 0x55, + 0x04, + 0x25, + /* NID_authorityRevocationList */ + 0x55, + 0x04, + 0x26, + /* NID_certificateRevocationList */ + 0x55, + 0x04, + 0x27, + /* NID_crossCertificatePair */ + 0x55, + 0x04, + 0x28, + /* NID_enhancedSearchGuide */ + 0x55, + 0x04, + 0x2f, + /* NID_protocolInformation */ + 0x55, + 0x04, + 0x30, + /* NID_distinguishedName */ + 0x55, + 0x04, + 0x31, + /* NID_uniqueMember */ + 0x55, + 0x04, + 0x32, + /* NID_houseIdentifier */ + 0x55, + 0x04, + 0x33, + /* NID_supportedAlgorithms */ + 0x55, + 0x04, + 0x34, + /* NID_deltaRevocationList */ + 0x55, + 0x04, + 0x35, + /* NID_dmdName */ + 0x55, + 0x04, + 0x36, + /* NID_id_alg_PWRI_KEK */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x09, + /* NID_aes_128_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x06, + /* NID_aes_128_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x07, + /* NID_id_aes128_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x08, + /* NID_aes_192_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1a, + /* NID_aes_192_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1b, + /* NID_id_aes192_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1c, + /* NID_aes_256_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2e, + /* NID_aes_256_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2f, + /* NID_id_aes256_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x30, + /* NID_id_camellia128_wrap */ + 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, + /* NID_id_camellia256_wrap */ + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x04, + /* NID_anyExtendedKeyUsage */ + 0x55, + 0x1d, + 0x25, + 0x00, + /* NID_mgf1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x08, + /* NID_rsassaPss */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0a, + /* NID_rsaesOaep */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x07, + /* NID_dhpublicnumber */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3e, + 0x02, + 0x01, + /* NID_brainpoolP160r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x01, + /* NID_brainpoolP160t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x02, + /* NID_brainpoolP192r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x03, + /* NID_brainpoolP192t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x04, + /* NID_brainpoolP224r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x05, + /* NID_brainpoolP224t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x06, + /* NID_brainpoolP256r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x07, + /* NID_brainpoolP256t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x08, + /* NID_brainpoolP320r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x09, + /* NID_brainpoolP320t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0a, + /* NID_brainpoolP384r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0b, + /* NID_brainpoolP384t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0c, + /* NID_brainpoolP512r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0d, + /* NID_brainpoolP512t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0e, + /* NID_pSpecified */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x09, + /* NID_dhSinglePass_stdDH_sha1kdf_scheme */ + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x02, + /* NID_dhSinglePass_stdDH_sha224kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x00, + /* NID_dhSinglePass_stdDH_sha256kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x01, + /* NID_dhSinglePass_stdDH_sha384kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x02, + /* NID_dhSinglePass_stdDH_sha512kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x03, + /* NID_dhSinglePass_cofactorDH_sha1kdf_scheme */ + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x03, + /* NID_dhSinglePass_cofactorDH_sha224kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x00, + /* NID_dhSinglePass_cofactorDH_sha256kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x01, + /* NID_dhSinglePass_cofactorDH_sha384kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x02, + /* NID_dhSinglePass_cofactorDH_sha512kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x03, + /* NID_X25519 */ + 0x2b, + 0x65, + 0x6e, + /* NID_ED25519 */ + 0x2b, + 0x65, + 0x70, + /* NID_ED448 */ + 0x2b, + 0x65, + 0x71, + /* NID_X448 */ + 0x2b, + 0x65, + 0x6f, +}; + +static const ASN1_OBJECT kObjects[NUM_NID] = { + {"UNDEF", "undefined", NID_undef, 0, NULL, 0}, + {"rsadsi", "RSA Data Security, Inc.", NID_rsadsi, 6, &kObjectData[0], 0}, + {"pkcs", "RSA Data Security, Inc. PKCS", NID_pkcs, 7, &kObjectData[6], 0}, + {"MD2", "md2", NID_md2, 8, &kObjectData[13], 0}, + {"MD5", "md5", NID_md5, 8, &kObjectData[21], 0}, + {"RC4", "rc4", NID_rc4, 8, &kObjectData[29], 0}, + {"rsaEncryption", "rsaEncryption", NID_rsaEncryption, 9, &kObjectData[37], + 0}, + {"RSA-MD2", "md2WithRSAEncryption", NID_md2WithRSAEncryption, 9, + &kObjectData[46], 0}, + {"RSA-MD5", "md5WithRSAEncryption", NID_md5WithRSAEncryption, 9, + &kObjectData[55], 0}, + {"PBE-MD2-DES", "pbeWithMD2AndDES-CBC", NID_pbeWithMD2AndDES_CBC, 9, + &kObjectData[64], 0}, + {"PBE-MD5-DES", "pbeWithMD5AndDES-CBC", NID_pbeWithMD5AndDES_CBC, 9, + &kObjectData[73], 0}, + {"X500", "directory services (X.500)", NID_X500, 1, &kObjectData[82], 0}, + {"X509", "X509", NID_X509, 2, &kObjectData[83], 0}, + {"CN", "commonName", NID_commonName, 3, &kObjectData[85], 0}, + {"C", "countryName", NID_countryName, 3, &kObjectData[88], 0}, + {"L", "localityName", NID_localityName, 3, &kObjectData[91], 0}, + {"ST", "stateOrProvinceName", NID_stateOrProvinceName, 3, &kObjectData[94], + 0}, + {"O", "organizationName", NID_organizationName, 3, &kObjectData[97], 0}, + {"OU", "organizationalUnitName", NID_organizationalUnitName, 3, + &kObjectData[100], 0}, + {"RSA", "rsa", NID_rsa, 4, &kObjectData[103], 0}, + {"pkcs7", "pkcs7", NID_pkcs7, 8, &kObjectData[107], 0}, + {"pkcs7-data", "pkcs7-data", NID_pkcs7_data, 9, &kObjectData[115], 0}, + {"pkcs7-signedData", "pkcs7-signedData", NID_pkcs7_signed, 9, + &kObjectData[124], 0}, + {"pkcs7-envelopedData", "pkcs7-envelopedData", NID_pkcs7_enveloped, 9, + &kObjectData[133], 0}, + {"pkcs7-signedAndEnvelopedData", "pkcs7-signedAndEnvelopedData", + NID_pkcs7_signedAndEnveloped, 9, &kObjectData[142], 0}, + {"pkcs7-digestData", "pkcs7-digestData", NID_pkcs7_digest, 9, + &kObjectData[151], 0}, + {"pkcs7-encryptedData", "pkcs7-encryptedData", NID_pkcs7_encrypted, 9, + &kObjectData[160], 0}, + {"pkcs3", "pkcs3", NID_pkcs3, 8, &kObjectData[169], 0}, + {"dhKeyAgreement", "dhKeyAgreement", NID_dhKeyAgreement, 9, + &kObjectData[177], 0}, + {"DES-ECB", "des-ecb", NID_des_ecb, 5, &kObjectData[186], 0}, + {"DES-CFB", "des-cfb", NID_des_cfb64, 5, &kObjectData[191], 0}, + {"DES-CBC", "des-cbc", NID_des_cbc, 5, &kObjectData[196], 0}, + {"DES-EDE", "des-ede", NID_des_ede_ecb, 5, &kObjectData[201], 0}, + {"DES-EDE3", "des-ede3", NID_des_ede3_ecb, 0, NULL, 0}, + {"IDEA-CBC", "idea-cbc", NID_idea_cbc, 11, &kObjectData[206], 0}, + {"IDEA-CFB", "idea-cfb", NID_idea_cfb64, 0, NULL, 0}, + {"IDEA-ECB", "idea-ecb", NID_idea_ecb, 0, NULL, 0}, + {"RC2-CBC", "rc2-cbc", NID_rc2_cbc, 8, &kObjectData[217], 0}, + {"RC2-ECB", "rc2-ecb", NID_rc2_ecb, 0, NULL, 0}, + {"RC2-CFB", "rc2-cfb", NID_rc2_cfb64, 0, NULL, 0}, + {"RC2-OFB", "rc2-ofb", NID_rc2_ofb64, 0, NULL, 0}, + {"SHA", "sha", NID_sha, 5, &kObjectData[225], 0}, + {"RSA-SHA", "shaWithRSAEncryption", NID_shaWithRSAEncryption, 5, + &kObjectData[230], 0}, + {"DES-EDE-CBC", "des-ede-cbc", NID_des_ede_cbc, 0, NULL, 0}, + {"DES-EDE3-CBC", "des-ede3-cbc", NID_des_ede3_cbc, 8, &kObjectData[235], 0}, + {"DES-OFB", "des-ofb", NID_des_ofb64, 5, &kObjectData[243], 0}, + {"IDEA-OFB", "idea-ofb", NID_idea_ofb64, 0, NULL, 0}, + {"pkcs9", "pkcs9", NID_pkcs9, 8, &kObjectData[248], 0}, + {"emailAddress", "emailAddress", NID_pkcs9_emailAddress, 9, + &kObjectData[256], 0}, + {"unstructuredName", "unstructuredName", NID_pkcs9_unstructuredName, 9, + &kObjectData[265], 0}, + {"contentType", "contentType", NID_pkcs9_contentType, 9, &kObjectData[274], + 0}, + {"messageDigest", "messageDigest", NID_pkcs9_messageDigest, 9, + &kObjectData[283], 0}, + {"signingTime", "signingTime", NID_pkcs9_signingTime, 9, &kObjectData[292], + 0}, + {"countersignature", "countersignature", NID_pkcs9_countersignature, 9, + &kObjectData[301], 0}, + {"challengePassword", "challengePassword", NID_pkcs9_challengePassword, 9, + &kObjectData[310], 0}, + {"unstructuredAddress", "unstructuredAddress", + NID_pkcs9_unstructuredAddress, 9, &kObjectData[319], 0}, + {"extendedCertificateAttributes", "extendedCertificateAttributes", + NID_pkcs9_extCertAttributes, 9, &kObjectData[328], 0}, + {"Netscape", "Netscape Communications Corp.", NID_netscape, 7, + &kObjectData[337], 0}, + {"nsCertExt", "Netscape Certificate Extension", NID_netscape_cert_extension, + 8, &kObjectData[344], 0}, + {"nsDataType", "Netscape Data Type", NID_netscape_data_type, 8, + &kObjectData[352], 0}, + {"DES-EDE-CFB", "des-ede-cfb", NID_des_ede_cfb64, 0, NULL, 0}, + {"DES-EDE3-CFB", "des-ede3-cfb", NID_des_ede3_cfb64, 0, NULL, 0}, + {"DES-EDE-OFB", "des-ede-ofb", NID_des_ede_ofb64, 0, NULL, 0}, + {"DES-EDE3-OFB", "des-ede3-ofb", NID_des_ede3_ofb64, 0, NULL, 0}, + {"SHA1", "sha1", NID_sha1, 5, &kObjectData[360], 0}, + {"RSA-SHA1", "sha1WithRSAEncryption", NID_sha1WithRSAEncryption, 9, + &kObjectData[365], 0}, + {"DSA-SHA", "dsaWithSHA", NID_dsaWithSHA, 5, &kObjectData[374], 0}, + {"DSA-old", "dsaEncryption-old", NID_dsa_2, 5, &kObjectData[379], 0}, + {"PBE-SHA1-RC2-64", "pbeWithSHA1AndRC2-CBC", NID_pbeWithSHA1AndRC2_CBC, 9, + &kObjectData[384], 0}, + {"PBKDF2", "PBKDF2", NID_id_pbkdf2, 9, &kObjectData[393], 0}, + {"DSA-SHA1-old", "dsaWithSHA1-old", NID_dsaWithSHA1_2, 5, &kObjectData[402], + 0}, + {"nsCertType", "Netscape Cert Type", NID_netscape_cert_type, 9, + &kObjectData[407], 0}, + {"nsBaseUrl", "Netscape Base Url", NID_netscape_base_url, 9, + &kObjectData[416], 0}, + {"nsRevocationUrl", "Netscape Revocation Url", NID_netscape_revocation_url, + 9, &kObjectData[425], 0}, + {"nsCaRevocationUrl", "Netscape CA Revocation Url", + NID_netscape_ca_revocation_url, 9, &kObjectData[434], 0}, + {"nsRenewalUrl", "Netscape Renewal Url", NID_netscape_renewal_url, 9, + &kObjectData[443], 0}, + {"nsCaPolicyUrl", "Netscape CA Policy Url", NID_netscape_ca_policy_url, 9, + &kObjectData[452], 0}, + {"nsSslServerName", "Netscape SSL Server Name", + NID_netscape_ssl_server_name, 9, &kObjectData[461], 0}, + {"nsComment", "Netscape Comment", NID_netscape_comment, 9, + &kObjectData[470], 0}, + {"nsCertSequence", "Netscape Certificate Sequence", + NID_netscape_cert_sequence, 9, &kObjectData[479], 0}, + {"DESX-CBC", "desx-cbc", NID_desx_cbc, 0, NULL, 0}, + {"id-ce", "id-ce", NID_id_ce, 2, &kObjectData[488], 0}, + {"subjectKeyIdentifier", "X509v3 Subject Key Identifier", + NID_subject_key_identifier, 3, &kObjectData[490], 0}, + {"keyUsage", "X509v3 Key Usage", NID_key_usage, 3, &kObjectData[493], 0}, + {"privateKeyUsagePeriod", "X509v3 Private Key Usage Period", + NID_private_key_usage_period, 3, &kObjectData[496], 0}, + {"subjectAltName", "X509v3 Subject Alternative Name", NID_subject_alt_name, + 3, &kObjectData[499], 0}, + {"issuerAltName", "X509v3 Issuer Alternative Name", NID_issuer_alt_name, 3, + &kObjectData[502], 0}, + {"basicConstraints", "X509v3 Basic Constraints", NID_basic_constraints, 3, + &kObjectData[505], 0}, + {"crlNumber", "X509v3 CRL Number", NID_crl_number, 3, &kObjectData[508], 0}, + {"certificatePolicies", "X509v3 Certificate Policies", + NID_certificate_policies, 3, &kObjectData[511], 0}, + {"authorityKeyIdentifier", "X509v3 Authority Key Identifier", + NID_authority_key_identifier, 3, &kObjectData[514], 0}, + {"BF-CBC", "bf-cbc", NID_bf_cbc, 9, &kObjectData[517], 0}, + {"BF-ECB", "bf-ecb", NID_bf_ecb, 0, NULL, 0}, + {"BF-CFB", "bf-cfb", NID_bf_cfb64, 0, NULL, 0}, + {"BF-OFB", "bf-ofb", NID_bf_ofb64, 0, NULL, 0}, + {"MDC2", "mdc2", NID_mdc2, 4, &kObjectData[526], 0}, + {"RSA-MDC2", "mdc2WithRSA", NID_mdc2WithRSA, 4, &kObjectData[530], 0}, + {"RC4-40", "rc4-40", NID_rc4_40, 0, NULL, 0}, + {"RC2-40-CBC", "rc2-40-cbc", NID_rc2_40_cbc, 0, NULL, 0}, + {"GN", "givenName", NID_givenName, 3, &kObjectData[534], 0}, + {"SN", "surname", NID_surname, 3, &kObjectData[537], 0}, + {"initials", "initials", NID_initials, 3, &kObjectData[540], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"crlDistributionPoints", "X509v3 CRL Distribution Points", + NID_crl_distribution_points, 3, &kObjectData[543], 0}, + {"RSA-NP-MD5", "md5WithRSA", NID_md5WithRSA, 5, &kObjectData[546], 0}, + {"serialNumber", "serialNumber", NID_serialNumber, 3, &kObjectData[551], 0}, + {"title", "title", NID_title, 3, &kObjectData[554], 0}, + {"description", "description", NID_description, 3, &kObjectData[557], 0}, + {"CAST5-CBC", "cast5-cbc", NID_cast5_cbc, 9, &kObjectData[560], 0}, + {"CAST5-ECB", "cast5-ecb", NID_cast5_ecb, 0, NULL, 0}, + {"CAST5-CFB", "cast5-cfb", NID_cast5_cfb64, 0, NULL, 0}, + {"CAST5-OFB", "cast5-ofb", NID_cast5_ofb64, 0, NULL, 0}, + {"pbeWithMD5AndCast5CBC", "pbeWithMD5AndCast5CBC", + NID_pbeWithMD5AndCast5_CBC, 9, &kObjectData[569], 0}, + {"DSA-SHA1", "dsaWithSHA1", NID_dsaWithSHA1, 7, &kObjectData[578], 0}, + {"MD5-SHA1", "md5-sha1", NID_md5_sha1, 0, NULL, 0}, + {"RSA-SHA1-2", "sha1WithRSA", NID_sha1WithRSA, 5, &kObjectData[585], 0}, + {"DSA", "dsaEncryption", NID_dsa, 7, &kObjectData[590], 0}, + {"RIPEMD160", "ripemd160", NID_ripemd160, 5, &kObjectData[597], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"RSA-RIPEMD160", "ripemd160WithRSA", NID_ripemd160WithRSA, 6, + &kObjectData[602], 0}, + {"RC5-CBC", "rc5-cbc", NID_rc5_cbc, 8, &kObjectData[608], 0}, + {"RC5-ECB", "rc5-ecb", NID_rc5_ecb, 0, NULL, 0}, + {"RC5-CFB", "rc5-cfb", NID_rc5_cfb64, 0, NULL, 0}, + {"RC5-OFB", "rc5-ofb", NID_rc5_ofb64, 0, NULL, 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"ZLIB", "zlib compression", NID_zlib_compression, 11, &kObjectData[616], + 0}, + {"extendedKeyUsage", "X509v3 Extended Key Usage", NID_ext_key_usage, 3, + &kObjectData[627], 0}, + {"PKIX", "PKIX", NID_id_pkix, 6, &kObjectData[630], 0}, + {"id-kp", "id-kp", NID_id_kp, 7, &kObjectData[636], 0}, + {"serverAuth", "TLS Web Server Authentication", NID_server_auth, 8, + &kObjectData[643], 0}, + {"clientAuth", "TLS Web Client Authentication", NID_client_auth, 8, + &kObjectData[651], 0}, + {"codeSigning", "Code Signing", NID_code_sign, 8, &kObjectData[659], 0}, + {"emailProtection", "E-mail Protection", NID_email_protect, 8, + &kObjectData[667], 0}, + {"timeStamping", "Time Stamping", NID_time_stamp, 8, &kObjectData[675], 0}, + {"msCodeInd", "Microsoft Individual Code Signing", NID_ms_code_ind, 10, + &kObjectData[683], 0}, + {"msCodeCom", "Microsoft Commercial Code Signing", NID_ms_code_com, 10, + &kObjectData[693], 0}, + {"msCTLSign", "Microsoft Trust List Signing", NID_ms_ctl_sign, 10, + &kObjectData[703], 0}, + {"msSGC", "Microsoft Server Gated Crypto", NID_ms_sgc, 10, + &kObjectData[713], 0}, + {"msEFS", "Microsoft Encrypted File System", NID_ms_efs, 10, + &kObjectData[723], 0}, + {"nsSGC", "Netscape Server Gated Crypto", NID_ns_sgc, 9, &kObjectData[733], + 0}, + {"deltaCRL", "X509v3 Delta CRL Indicator", NID_delta_crl, 3, + &kObjectData[742], 0}, + {"CRLReason", "X509v3 CRL Reason Code", NID_crl_reason, 3, + &kObjectData[745], 0}, + {"invalidityDate", "Invalidity Date", NID_invalidity_date, 3, + &kObjectData[748], 0}, + {"SXNetID", "Strong Extranet ID", NID_sxnet, 5, &kObjectData[751], 0}, + {"PBE-SHA1-RC4-128", "pbeWithSHA1And128BitRC4", + NID_pbe_WithSHA1And128BitRC4, 10, &kObjectData[756], 0}, + {"PBE-SHA1-RC4-40", "pbeWithSHA1And40BitRC4", NID_pbe_WithSHA1And40BitRC4, + 10, &kObjectData[766], 0}, + {"PBE-SHA1-3DES", "pbeWithSHA1And3-KeyTripleDES-CBC", + NID_pbe_WithSHA1And3_Key_TripleDES_CBC, 10, &kObjectData[776], 0}, + {"PBE-SHA1-2DES", "pbeWithSHA1And2-KeyTripleDES-CBC", + NID_pbe_WithSHA1And2_Key_TripleDES_CBC, 10, &kObjectData[786], 0}, + {"PBE-SHA1-RC2-128", "pbeWithSHA1And128BitRC2-CBC", + NID_pbe_WithSHA1And128BitRC2_CBC, 10, &kObjectData[796], 0}, + {"PBE-SHA1-RC2-40", "pbeWithSHA1And40BitRC2-CBC", + NID_pbe_WithSHA1And40BitRC2_CBC, 10, &kObjectData[806], 0}, + {"keyBag", "keyBag", NID_keyBag, 11, &kObjectData[816], 0}, + {"pkcs8ShroudedKeyBag", "pkcs8ShroudedKeyBag", NID_pkcs8ShroudedKeyBag, 11, + &kObjectData[827], 0}, + {"certBag", "certBag", NID_certBag, 11, &kObjectData[838], 0}, + {"crlBag", "crlBag", NID_crlBag, 11, &kObjectData[849], 0}, + {"secretBag", "secretBag", NID_secretBag, 11, &kObjectData[860], 0}, + {"safeContentsBag", "safeContentsBag", NID_safeContentsBag, 11, + &kObjectData[871], 0}, + {"friendlyName", "friendlyName", NID_friendlyName, 9, &kObjectData[882], 0}, + {"localKeyID", "localKeyID", NID_localKeyID, 9, &kObjectData[891], 0}, + {"x509Certificate", "x509Certificate", NID_x509Certificate, 10, + &kObjectData[900], 0}, + {"sdsiCertificate", "sdsiCertificate", NID_sdsiCertificate, 10, + &kObjectData[910], 0}, + {"x509Crl", "x509Crl", NID_x509Crl, 10, &kObjectData[920], 0}, + {"PBES2", "PBES2", NID_pbes2, 9, &kObjectData[930], 0}, + {"PBMAC1", "PBMAC1", NID_pbmac1, 9, &kObjectData[939], 0}, + {"hmacWithSHA1", "hmacWithSHA1", NID_hmacWithSHA1, 8, &kObjectData[948], 0}, + {"id-qt-cps", "Policy Qualifier CPS", NID_id_qt_cps, 8, &kObjectData[956], + 0}, + {"id-qt-unotice", "Policy Qualifier User Notice", NID_id_qt_unotice, 8, + &kObjectData[964], 0}, + {"RC2-64-CBC", "rc2-64-cbc", NID_rc2_64_cbc, 0, NULL, 0}, + {"SMIME-CAPS", "S/MIME Capabilities", NID_SMIMECapabilities, 9, + &kObjectData[972], 0}, + {"PBE-MD2-RC2-64", "pbeWithMD2AndRC2-CBC", NID_pbeWithMD2AndRC2_CBC, 9, + &kObjectData[981], 0}, + {"PBE-MD5-RC2-64", "pbeWithMD5AndRC2-CBC", NID_pbeWithMD5AndRC2_CBC, 9, + &kObjectData[990], 0}, + {"PBE-SHA1-DES", "pbeWithSHA1AndDES-CBC", NID_pbeWithSHA1AndDES_CBC, 9, + &kObjectData[999], 0}, + {"msExtReq", "Microsoft Extension Request", NID_ms_ext_req, 10, + &kObjectData[1008], 0}, + {"extReq", "Extension Request", NID_ext_req, 9, &kObjectData[1018], 0}, + {"name", "name", NID_name, 3, &kObjectData[1027], 0}, + {"dnQualifier", "dnQualifier", NID_dnQualifier, 3, &kObjectData[1030], 0}, + {"id-pe", "id-pe", NID_id_pe, 7, &kObjectData[1033], 0}, + {"id-ad", "id-ad", NID_id_ad, 7, &kObjectData[1040], 0}, + {"authorityInfoAccess", "Authority Information Access", NID_info_access, 8, + &kObjectData[1047], 0}, + {"OCSP", "OCSP", NID_ad_OCSP, 8, &kObjectData[1055], 0}, + {"caIssuers", "CA Issuers", NID_ad_ca_issuers, 8, &kObjectData[1063], 0}, + {"OCSPSigning", "OCSP Signing", NID_OCSP_sign, 8, &kObjectData[1071], 0}, + {"ISO", "iso", NID_iso, 0, NULL, 0}, + {"member-body", "ISO Member Body", NID_member_body, 1, &kObjectData[1079], + 0}, + {"ISO-US", "ISO US Member Body", NID_ISO_US, 3, &kObjectData[1080], 0}, + {"X9-57", "X9.57", NID_X9_57, 5, &kObjectData[1083], 0}, + {"X9cm", "X9.57 CM ?", NID_X9cm, 6, &kObjectData[1088], 0}, + {"pkcs1", "pkcs1", NID_pkcs1, 8, &kObjectData[1094], 0}, + {"pkcs5", "pkcs5", NID_pkcs5, 8, &kObjectData[1102], 0}, + {"SMIME", "S/MIME", NID_SMIME, 9, &kObjectData[1110], 0}, + {"id-smime-mod", "id-smime-mod", NID_id_smime_mod, 10, &kObjectData[1119], + 0}, + {"id-smime-ct", "id-smime-ct", NID_id_smime_ct, 10, &kObjectData[1129], 0}, + {"id-smime-aa", "id-smime-aa", NID_id_smime_aa, 10, &kObjectData[1139], 0}, + {"id-smime-alg", "id-smime-alg", NID_id_smime_alg, 10, &kObjectData[1149], + 0}, + {"id-smime-cd", "id-smime-cd", NID_id_smime_cd, 10, &kObjectData[1159], 0}, + {"id-smime-spq", "id-smime-spq", NID_id_smime_spq, 10, &kObjectData[1169], + 0}, + {"id-smime-cti", "id-smime-cti", NID_id_smime_cti, 10, &kObjectData[1179], + 0}, + {"id-smime-mod-cms", "id-smime-mod-cms", NID_id_smime_mod_cms, 11, + &kObjectData[1189], 0}, + {"id-smime-mod-ess", "id-smime-mod-ess", NID_id_smime_mod_ess, 11, + &kObjectData[1200], 0}, + {"id-smime-mod-oid", "id-smime-mod-oid", NID_id_smime_mod_oid, 11, + &kObjectData[1211], 0}, + {"id-smime-mod-msg-v3", "id-smime-mod-msg-v3", NID_id_smime_mod_msg_v3, 11, + &kObjectData[1222], 0}, + {"id-smime-mod-ets-eSignature-88", "id-smime-mod-ets-eSignature-88", + NID_id_smime_mod_ets_eSignature_88, 11, &kObjectData[1233], 0}, + {"id-smime-mod-ets-eSignature-97", "id-smime-mod-ets-eSignature-97", + NID_id_smime_mod_ets_eSignature_97, 11, &kObjectData[1244], 0}, + {"id-smime-mod-ets-eSigPolicy-88", "id-smime-mod-ets-eSigPolicy-88", + NID_id_smime_mod_ets_eSigPolicy_88, 11, &kObjectData[1255], 0}, + {"id-smime-mod-ets-eSigPolicy-97", "id-smime-mod-ets-eSigPolicy-97", + NID_id_smime_mod_ets_eSigPolicy_97, 11, &kObjectData[1266], 0}, + {"id-smime-ct-receipt", "id-smime-ct-receipt", NID_id_smime_ct_receipt, 11, + &kObjectData[1277], 0}, + {"id-smime-ct-authData", "id-smime-ct-authData", NID_id_smime_ct_authData, + 11, &kObjectData[1288], 0}, + {"id-smime-ct-publishCert", "id-smime-ct-publishCert", + NID_id_smime_ct_publishCert, 11, &kObjectData[1299], 0}, + {"id-smime-ct-TSTInfo", "id-smime-ct-TSTInfo", NID_id_smime_ct_TSTInfo, 11, + &kObjectData[1310], 0}, + {"id-smime-ct-TDTInfo", "id-smime-ct-TDTInfo", NID_id_smime_ct_TDTInfo, 11, + &kObjectData[1321], 0}, + {"id-smime-ct-contentInfo", "id-smime-ct-contentInfo", + NID_id_smime_ct_contentInfo, 11, &kObjectData[1332], 0}, + {"id-smime-ct-DVCSRequestData", "id-smime-ct-DVCSRequestData", + NID_id_smime_ct_DVCSRequestData, 11, &kObjectData[1343], 0}, + {"id-smime-ct-DVCSResponseData", "id-smime-ct-DVCSResponseData", + NID_id_smime_ct_DVCSResponseData, 11, &kObjectData[1354], 0}, + {"id-smime-aa-receiptRequest", "id-smime-aa-receiptRequest", + NID_id_smime_aa_receiptRequest, 11, &kObjectData[1365], 0}, + {"id-smime-aa-securityLabel", "id-smime-aa-securityLabel", + NID_id_smime_aa_securityLabel, 11, &kObjectData[1376], 0}, + {"id-smime-aa-mlExpandHistory", "id-smime-aa-mlExpandHistory", + NID_id_smime_aa_mlExpandHistory, 11, &kObjectData[1387], 0}, + {"id-smime-aa-contentHint", "id-smime-aa-contentHint", + NID_id_smime_aa_contentHint, 11, &kObjectData[1398], 0}, + {"id-smime-aa-msgSigDigest", "id-smime-aa-msgSigDigest", + NID_id_smime_aa_msgSigDigest, 11, &kObjectData[1409], 0}, + {"id-smime-aa-encapContentType", "id-smime-aa-encapContentType", + NID_id_smime_aa_encapContentType, 11, &kObjectData[1420], 0}, + {"id-smime-aa-contentIdentifier", "id-smime-aa-contentIdentifier", + NID_id_smime_aa_contentIdentifier, 11, &kObjectData[1431], 0}, + {"id-smime-aa-macValue", "id-smime-aa-macValue", NID_id_smime_aa_macValue, + 11, &kObjectData[1442], 0}, + {"id-smime-aa-equivalentLabels", "id-smime-aa-equivalentLabels", + NID_id_smime_aa_equivalentLabels, 11, &kObjectData[1453], 0}, + {"id-smime-aa-contentReference", "id-smime-aa-contentReference", + NID_id_smime_aa_contentReference, 11, &kObjectData[1464], 0}, + {"id-smime-aa-encrypKeyPref", "id-smime-aa-encrypKeyPref", + NID_id_smime_aa_encrypKeyPref, 11, &kObjectData[1475], 0}, + {"id-smime-aa-signingCertificate", "id-smime-aa-signingCertificate", + NID_id_smime_aa_signingCertificate, 11, &kObjectData[1486], 0}, + {"id-smime-aa-smimeEncryptCerts", "id-smime-aa-smimeEncryptCerts", + NID_id_smime_aa_smimeEncryptCerts, 11, &kObjectData[1497], 0}, + {"id-smime-aa-timeStampToken", "id-smime-aa-timeStampToken", + NID_id_smime_aa_timeStampToken, 11, &kObjectData[1508], 0}, + {"id-smime-aa-ets-sigPolicyId", "id-smime-aa-ets-sigPolicyId", + NID_id_smime_aa_ets_sigPolicyId, 11, &kObjectData[1519], 0}, + {"id-smime-aa-ets-commitmentType", "id-smime-aa-ets-commitmentType", + NID_id_smime_aa_ets_commitmentType, 11, &kObjectData[1530], 0}, + {"id-smime-aa-ets-signerLocation", "id-smime-aa-ets-signerLocation", + NID_id_smime_aa_ets_signerLocation, 11, &kObjectData[1541], 0}, + {"id-smime-aa-ets-signerAttr", "id-smime-aa-ets-signerAttr", + NID_id_smime_aa_ets_signerAttr, 11, &kObjectData[1552], 0}, + {"id-smime-aa-ets-otherSigCert", "id-smime-aa-ets-otherSigCert", + NID_id_smime_aa_ets_otherSigCert, 11, &kObjectData[1563], 0}, + {"id-smime-aa-ets-contentTimestamp", "id-smime-aa-ets-contentTimestamp", + NID_id_smime_aa_ets_contentTimestamp, 11, &kObjectData[1574], 0}, + {"id-smime-aa-ets-CertificateRefs", "id-smime-aa-ets-CertificateRefs", + NID_id_smime_aa_ets_CertificateRefs, 11, &kObjectData[1585], 0}, + {"id-smime-aa-ets-RevocationRefs", "id-smime-aa-ets-RevocationRefs", + NID_id_smime_aa_ets_RevocationRefs, 11, &kObjectData[1596], 0}, + {"id-smime-aa-ets-certValues", "id-smime-aa-ets-certValues", + NID_id_smime_aa_ets_certValues, 11, &kObjectData[1607], 0}, + {"id-smime-aa-ets-revocationValues", "id-smime-aa-ets-revocationValues", + NID_id_smime_aa_ets_revocationValues, 11, &kObjectData[1618], 0}, + {"id-smime-aa-ets-escTimeStamp", "id-smime-aa-ets-escTimeStamp", + NID_id_smime_aa_ets_escTimeStamp, 11, &kObjectData[1629], 0}, + {"id-smime-aa-ets-certCRLTimestamp", "id-smime-aa-ets-certCRLTimestamp", + NID_id_smime_aa_ets_certCRLTimestamp, 11, &kObjectData[1640], 0}, + {"id-smime-aa-ets-archiveTimeStamp", "id-smime-aa-ets-archiveTimeStamp", + NID_id_smime_aa_ets_archiveTimeStamp, 11, &kObjectData[1651], 0}, + {"id-smime-aa-signatureType", "id-smime-aa-signatureType", + NID_id_smime_aa_signatureType, 11, &kObjectData[1662], 0}, + {"id-smime-aa-dvcs-dvc", "id-smime-aa-dvcs-dvc", NID_id_smime_aa_dvcs_dvc, + 11, &kObjectData[1673], 0}, + {"id-smime-alg-ESDHwith3DES", "id-smime-alg-ESDHwith3DES", + NID_id_smime_alg_ESDHwith3DES, 11, &kObjectData[1684], 0}, + {"id-smime-alg-ESDHwithRC2", "id-smime-alg-ESDHwithRC2", + NID_id_smime_alg_ESDHwithRC2, 11, &kObjectData[1695], 0}, + {"id-smime-alg-3DESwrap", "id-smime-alg-3DESwrap", + NID_id_smime_alg_3DESwrap, 11, &kObjectData[1706], 0}, + {"id-smime-alg-RC2wrap", "id-smime-alg-RC2wrap", NID_id_smime_alg_RC2wrap, + 11, &kObjectData[1717], 0}, + {"id-smime-alg-ESDH", "id-smime-alg-ESDH", NID_id_smime_alg_ESDH, 11, + &kObjectData[1728], 0}, + {"id-smime-alg-CMS3DESwrap", "id-smime-alg-CMS3DESwrap", + NID_id_smime_alg_CMS3DESwrap, 11, &kObjectData[1739], 0}, + {"id-smime-alg-CMSRC2wrap", "id-smime-alg-CMSRC2wrap", + NID_id_smime_alg_CMSRC2wrap, 11, &kObjectData[1750], 0}, + {"id-smime-cd-ldap", "id-smime-cd-ldap", NID_id_smime_cd_ldap, 11, + &kObjectData[1761], 0}, + {"id-smime-spq-ets-sqt-uri", "id-smime-spq-ets-sqt-uri", + NID_id_smime_spq_ets_sqt_uri, 11, &kObjectData[1772], 0}, + {"id-smime-spq-ets-sqt-unotice", "id-smime-spq-ets-sqt-unotice", + NID_id_smime_spq_ets_sqt_unotice, 11, &kObjectData[1783], 0}, + {"id-smime-cti-ets-proofOfOrigin", "id-smime-cti-ets-proofOfOrigin", + NID_id_smime_cti_ets_proofOfOrigin, 11, &kObjectData[1794], 0}, + {"id-smime-cti-ets-proofOfReceipt", "id-smime-cti-ets-proofOfReceipt", + NID_id_smime_cti_ets_proofOfReceipt, 11, &kObjectData[1805], 0}, + {"id-smime-cti-ets-proofOfDelivery", "id-smime-cti-ets-proofOfDelivery", + NID_id_smime_cti_ets_proofOfDelivery, 11, &kObjectData[1816], 0}, + {"id-smime-cti-ets-proofOfSender", "id-smime-cti-ets-proofOfSender", + NID_id_smime_cti_ets_proofOfSender, 11, &kObjectData[1827], 0}, + {"id-smime-cti-ets-proofOfApproval", "id-smime-cti-ets-proofOfApproval", + NID_id_smime_cti_ets_proofOfApproval, 11, &kObjectData[1838], 0}, + {"id-smime-cti-ets-proofOfCreation", "id-smime-cti-ets-proofOfCreation", + NID_id_smime_cti_ets_proofOfCreation, 11, &kObjectData[1849], 0}, + {"MD4", "md4", NID_md4, 8, &kObjectData[1860], 0}, + {"id-pkix-mod", "id-pkix-mod", NID_id_pkix_mod, 7, &kObjectData[1868], 0}, + {"id-qt", "id-qt", NID_id_qt, 7, &kObjectData[1875], 0}, + {"id-it", "id-it", NID_id_it, 7, &kObjectData[1882], 0}, + {"id-pkip", "id-pkip", NID_id_pkip, 7, &kObjectData[1889], 0}, + {"id-alg", "id-alg", NID_id_alg, 7, &kObjectData[1896], 0}, + {"id-cmc", "id-cmc", NID_id_cmc, 7, &kObjectData[1903], 0}, + {"id-on", "id-on", NID_id_on, 7, &kObjectData[1910], 0}, + {"id-pda", "id-pda", NID_id_pda, 7, &kObjectData[1917], 0}, + {"id-aca", "id-aca", NID_id_aca, 7, &kObjectData[1924], 0}, + {"id-qcs", "id-qcs", NID_id_qcs, 7, &kObjectData[1931], 0}, + {"id-cct", "id-cct", NID_id_cct, 7, &kObjectData[1938], 0}, + {"id-pkix1-explicit-88", "id-pkix1-explicit-88", NID_id_pkix1_explicit_88, + 8, &kObjectData[1945], 0}, + {"id-pkix1-implicit-88", "id-pkix1-implicit-88", NID_id_pkix1_implicit_88, + 8, &kObjectData[1953], 0}, + {"id-pkix1-explicit-93", "id-pkix1-explicit-93", NID_id_pkix1_explicit_93, + 8, &kObjectData[1961], 0}, + {"id-pkix1-implicit-93", "id-pkix1-implicit-93", NID_id_pkix1_implicit_93, + 8, &kObjectData[1969], 0}, + {"id-mod-crmf", "id-mod-crmf", NID_id_mod_crmf, 8, &kObjectData[1977], 0}, + {"id-mod-cmc", "id-mod-cmc", NID_id_mod_cmc, 8, &kObjectData[1985], 0}, + {"id-mod-kea-profile-88", "id-mod-kea-profile-88", + NID_id_mod_kea_profile_88, 8, &kObjectData[1993], 0}, + {"id-mod-kea-profile-93", "id-mod-kea-profile-93", + NID_id_mod_kea_profile_93, 8, &kObjectData[2001], 0}, + {"id-mod-cmp", "id-mod-cmp", NID_id_mod_cmp, 8, &kObjectData[2009], 0}, + {"id-mod-qualified-cert-88", "id-mod-qualified-cert-88", + NID_id_mod_qualified_cert_88, 8, &kObjectData[2017], 0}, + {"id-mod-qualified-cert-93", "id-mod-qualified-cert-93", + NID_id_mod_qualified_cert_93, 8, &kObjectData[2025], 0}, + {"id-mod-attribute-cert", "id-mod-attribute-cert", + NID_id_mod_attribute_cert, 8, &kObjectData[2033], 0}, + {"id-mod-timestamp-protocol", "id-mod-timestamp-protocol", + NID_id_mod_timestamp_protocol, 8, &kObjectData[2041], 0}, + {"id-mod-ocsp", "id-mod-ocsp", NID_id_mod_ocsp, 8, &kObjectData[2049], 0}, + {"id-mod-dvcs", "id-mod-dvcs", NID_id_mod_dvcs, 8, &kObjectData[2057], 0}, + {"id-mod-cmp2000", "id-mod-cmp2000", NID_id_mod_cmp2000, 8, + &kObjectData[2065], 0}, + {"biometricInfo", "Biometric Info", NID_biometricInfo, 8, + &kObjectData[2073], 0}, + {"qcStatements", "qcStatements", NID_qcStatements, 8, &kObjectData[2081], + 0}, + {"ac-auditEntity", "ac-auditEntity", NID_ac_auditEntity, 8, + &kObjectData[2089], 0}, + {"ac-targeting", "ac-targeting", NID_ac_targeting, 8, &kObjectData[2097], + 0}, + {"aaControls", "aaControls", NID_aaControls, 8, &kObjectData[2105], 0}, + {"sbgp-ipAddrBlock", "sbgp-ipAddrBlock", NID_sbgp_ipAddrBlock, 8, + &kObjectData[2113], 0}, + {"sbgp-autonomousSysNum", "sbgp-autonomousSysNum", + NID_sbgp_autonomousSysNum, 8, &kObjectData[2121], 0}, + {"sbgp-routerIdentifier", "sbgp-routerIdentifier", + NID_sbgp_routerIdentifier, 8, &kObjectData[2129], 0}, + {"textNotice", "textNotice", NID_textNotice, 8, &kObjectData[2137], 0}, + {"ipsecEndSystem", "IPSec End System", NID_ipsecEndSystem, 8, + &kObjectData[2145], 0}, + {"ipsecTunnel", "IPSec Tunnel", NID_ipsecTunnel, 8, &kObjectData[2153], 0}, + {"ipsecUser", "IPSec User", NID_ipsecUser, 8, &kObjectData[2161], 0}, + {"DVCS", "dvcs", NID_dvcs, 8, &kObjectData[2169], 0}, + {"id-it-caProtEncCert", "id-it-caProtEncCert", NID_id_it_caProtEncCert, 8, + &kObjectData[2177], 0}, + {"id-it-signKeyPairTypes", "id-it-signKeyPairTypes", + NID_id_it_signKeyPairTypes, 8, &kObjectData[2185], 0}, + {"id-it-encKeyPairTypes", "id-it-encKeyPairTypes", + NID_id_it_encKeyPairTypes, 8, &kObjectData[2193], 0}, + {"id-it-preferredSymmAlg", "id-it-preferredSymmAlg", + NID_id_it_preferredSymmAlg, 8, &kObjectData[2201], 0}, + {"id-it-caKeyUpdateInfo", "id-it-caKeyUpdateInfo", + NID_id_it_caKeyUpdateInfo, 8, &kObjectData[2209], 0}, + {"id-it-currentCRL", "id-it-currentCRL", NID_id_it_currentCRL, 8, + &kObjectData[2217], 0}, + {"id-it-unsupportedOIDs", "id-it-unsupportedOIDs", + NID_id_it_unsupportedOIDs, 8, &kObjectData[2225], 0}, + {"id-it-subscriptionRequest", "id-it-subscriptionRequest", + NID_id_it_subscriptionRequest, 8, &kObjectData[2233], 0}, + {"id-it-subscriptionResponse", "id-it-subscriptionResponse", + NID_id_it_subscriptionResponse, 8, &kObjectData[2241], 0}, + {"id-it-keyPairParamReq", "id-it-keyPairParamReq", + NID_id_it_keyPairParamReq, 8, &kObjectData[2249], 0}, + {"id-it-keyPairParamRep", "id-it-keyPairParamRep", + NID_id_it_keyPairParamRep, 8, &kObjectData[2257], 0}, + {"id-it-revPassphrase", "id-it-revPassphrase", NID_id_it_revPassphrase, 8, + &kObjectData[2265], 0}, + {"id-it-implicitConfirm", "id-it-implicitConfirm", + NID_id_it_implicitConfirm, 8, &kObjectData[2273], 0}, + {"id-it-confirmWaitTime", "id-it-confirmWaitTime", + NID_id_it_confirmWaitTime, 8, &kObjectData[2281], 0}, + {"id-it-origPKIMessage", "id-it-origPKIMessage", NID_id_it_origPKIMessage, + 8, &kObjectData[2289], 0}, + {"id-regCtrl", "id-regCtrl", NID_id_regCtrl, 8, &kObjectData[2297], 0}, + {"id-regInfo", "id-regInfo", NID_id_regInfo, 8, &kObjectData[2305], 0}, + {"id-regCtrl-regToken", "id-regCtrl-regToken", NID_id_regCtrl_regToken, 9, + &kObjectData[2313], 0}, + {"id-regCtrl-authenticator", "id-regCtrl-authenticator", + NID_id_regCtrl_authenticator, 9, &kObjectData[2322], 0}, + {"id-regCtrl-pkiPublicationInfo", "id-regCtrl-pkiPublicationInfo", + NID_id_regCtrl_pkiPublicationInfo, 9, &kObjectData[2331], 0}, + {"id-regCtrl-pkiArchiveOptions", "id-regCtrl-pkiArchiveOptions", + NID_id_regCtrl_pkiArchiveOptions, 9, &kObjectData[2340], 0}, + {"id-regCtrl-oldCertID", "id-regCtrl-oldCertID", NID_id_regCtrl_oldCertID, + 9, &kObjectData[2349], 0}, + {"id-regCtrl-protocolEncrKey", "id-regCtrl-protocolEncrKey", + NID_id_regCtrl_protocolEncrKey, 9, &kObjectData[2358], 0}, + {"id-regInfo-utf8Pairs", "id-regInfo-utf8Pairs", NID_id_regInfo_utf8Pairs, + 9, &kObjectData[2367], 0}, + {"id-regInfo-certReq", "id-regInfo-certReq", NID_id_regInfo_certReq, 9, + &kObjectData[2376], 0}, + {"id-alg-des40", "id-alg-des40", NID_id_alg_des40, 8, &kObjectData[2385], + 0}, + {"id-alg-noSignature", "id-alg-noSignature", NID_id_alg_noSignature, 8, + &kObjectData[2393], 0}, + {"id-alg-dh-sig-hmac-sha1", "id-alg-dh-sig-hmac-sha1", + NID_id_alg_dh_sig_hmac_sha1, 8, &kObjectData[2401], 0}, + {"id-alg-dh-pop", "id-alg-dh-pop", NID_id_alg_dh_pop, 8, &kObjectData[2409], + 0}, + {"id-cmc-statusInfo", "id-cmc-statusInfo", NID_id_cmc_statusInfo, 8, + &kObjectData[2417], 0}, + {"id-cmc-identification", "id-cmc-identification", + NID_id_cmc_identification, 8, &kObjectData[2425], 0}, + {"id-cmc-identityProof", "id-cmc-identityProof", NID_id_cmc_identityProof, + 8, &kObjectData[2433], 0}, + {"id-cmc-dataReturn", "id-cmc-dataReturn", NID_id_cmc_dataReturn, 8, + &kObjectData[2441], 0}, + {"id-cmc-transactionId", "id-cmc-transactionId", NID_id_cmc_transactionId, + 8, &kObjectData[2449], 0}, + {"id-cmc-senderNonce", "id-cmc-senderNonce", NID_id_cmc_senderNonce, 8, + &kObjectData[2457], 0}, + {"id-cmc-recipientNonce", "id-cmc-recipientNonce", + NID_id_cmc_recipientNonce, 8, &kObjectData[2465], 0}, + {"id-cmc-addExtensions", "id-cmc-addExtensions", NID_id_cmc_addExtensions, + 8, &kObjectData[2473], 0}, + {"id-cmc-encryptedPOP", "id-cmc-encryptedPOP", NID_id_cmc_encryptedPOP, 8, + &kObjectData[2481], 0}, + {"id-cmc-decryptedPOP", "id-cmc-decryptedPOP", NID_id_cmc_decryptedPOP, 8, + &kObjectData[2489], 0}, + {"id-cmc-lraPOPWitness", "id-cmc-lraPOPWitness", NID_id_cmc_lraPOPWitness, + 8, &kObjectData[2497], 0}, + {"id-cmc-getCert", "id-cmc-getCert", NID_id_cmc_getCert, 8, + &kObjectData[2505], 0}, + {"id-cmc-getCRL", "id-cmc-getCRL", NID_id_cmc_getCRL, 8, &kObjectData[2513], + 0}, + {"id-cmc-revokeRequest", "id-cmc-revokeRequest", NID_id_cmc_revokeRequest, + 8, &kObjectData[2521], 0}, + {"id-cmc-regInfo", "id-cmc-regInfo", NID_id_cmc_regInfo, 8, + &kObjectData[2529], 0}, + {"id-cmc-responseInfo", "id-cmc-responseInfo", NID_id_cmc_responseInfo, 8, + &kObjectData[2537], 0}, + {"id-cmc-queryPending", "id-cmc-queryPending", NID_id_cmc_queryPending, 8, + &kObjectData[2545], 0}, + {"id-cmc-popLinkRandom", "id-cmc-popLinkRandom", NID_id_cmc_popLinkRandom, + 8, &kObjectData[2553], 0}, + {"id-cmc-popLinkWitness", "id-cmc-popLinkWitness", + NID_id_cmc_popLinkWitness, 8, &kObjectData[2561], 0}, + {"id-cmc-confirmCertAcceptance", "id-cmc-confirmCertAcceptance", + NID_id_cmc_confirmCertAcceptance, 8, &kObjectData[2569], 0}, + {"id-on-personalData", "id-on-personalData", NID_id_on_personalData, 8, + &kObjectData[2577], 0}, + {"id-pda-dateOfBirth", "id-pda-dateOfBirth", NID_id_pda_dateOfBirth, 8, + &kObjectData[2585], 0}, + {"id-pda-placeOfBirth", "id-pda-placeOfBirth", NID_id_pda_placeOfBirth, 8, + &kObjectData[2593], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"id-pda-gender", "id-pda-gender", NID_id_pda_gender, 8, &kObjectData[2601], + 0}, + {"id-pda-countryOfCitizenship", "id-pda-countryOfCitizenship", + NID_id_pda_countryOfCitizenship, 8, &kObjectData[2609], 0}, + {"id-pda-countryOfResidence", "id-pda-countryOfResidence", + NID_id_pda_countryOfResidence, 8, &kObjectData[2617], 0}, + {"id-aca-authenticationInfo", "id-aca-authenticationInfo", + NID_id_aca_authenticationInfo, 8, &kObjectData[2625], 0}, + {"id-aca-accessIdentity", "id-aca-accessIdentity", + NID_id_aca_accessIdentity, 8, &kObjectData[2633], 0}, + {"id-aca-chargingIdentity", "id-aca-chargingIdentity", + NID_id_aca_chargingIdentity, 8, &kObjectData[2641], 0}, + {"id-aca-group", "id-aca-group", NID_id_aca_group, 8, &kObjectData[2649], + 0}, + {"id-aca-role", "id-aca-role", NID_id_aca_role, 8, &kObjectData[2657], 0}, + {"id-qcs-pkixQCSyntax-v1", "id-qcs-pkixQCSyntax-v1", + NID_id_qcs_pkixQCSyntax_v1, 8, &kObjectData[2665], 0}, + {"id-cct-crs", "id-cct-crs", NID_id_cct_crs, 8, &kObjectData[2673], 0}, + {"id-cct-PKIData", "id-cct-PKIData", NID_id_cct_PKIData, 8, + &kObjectData[2681], 0}, + {"id-cct-PKIResponse", "id-cct-PKIResponse", NID_id_cct_PKIResponse, 8, + &kObjectData[2689], 0}, + {"ad_timestamping", "AD Time Stamping", NID_ad_timeStamping, 8, + &kObjectData[2697], 0}, + {"AD_DVCS", "ad dvcs", NID_ad_dvcs, 8, &kObjectData[2705], 0}, + {"basicOCSPResponse", "Basic OCSP Response", NID_id_pkix_OCSP_basic, 9, + &kObjectData[2713], 0}, + {"Nonce", "OCSP Nonce", NID_id_pkix_OCSP_Nonce, 9, &kObjectData[2722], 0}, + {"CrlID", "OCSP CRL ID", NID_id_pkix_OCSP_CrlID, 9, &kObjectData[2731], 0}, + {"acceptableResponses", "Acceptable OCSP Responses", + NID_id_pkix_OCSP_acceptableResponses, 9, &kObjectData[2740], 0}, + {"noCheck", "OCSP No Check", NID_id_pkix_OCSP_noCheck, 9, + &kObjectData[2749], 0}, + {"archiveCutoff", "OCSP Archive Cutoff", NID_id_pkix_OCSP_archiveCutoff, 9, + &kObjectData[2758], 0}, + {"serviceLocator", "OCSP Service Locator", NID_id_pkix_OCSP_serviceLocator, + 9, &kObjectData[2767], 0}, + {"extendedStatus", "Extended OCSP Status", NID_id_pkix_OCSP_extendedStatus, + 9, &kObjectData[2776], 0}, + {"valid", "valid", NID_id_pkix_OCSP_valid, 9, &kObjectData[2785], 0}, + {"path", "path", NID_id_pkix_OCSP_path, 9, &kObjectData[2794], 0}, + {"trustRoot", "Trust Root", NID_id_pkix_OCSP_trustRoot, 9, + &kObjectData[2803], 0}, + {"algorithm", "algorithm", NID_algorithm, 4, &kObjectData[2812], 0}, + {"rsaSignature", "rsaSignature", NID_rsaSignature, 5, &kObjectData[2816], + 0}, + {"X500algorithms", "directory services - algorithms", NID_X500algorithms, 2, + &kObjectData[2821], 0}, + {"ORG", "org", NID_org, 1, &kObjectData[2823], 0}, + {"DOD", "dod", NID_dod, 2, &kObjectData[2824], 0}, + {"IANA", "iana", NID_iana, 3, &kObjectData[2826], 0}, + {"directory", "Directory", NID_Directory, 4, &kObjectData[2829], 0}, + {"mgmt", "Management", NID_Management, 4, &kObjectData[2833], 0}, + {"experimental", "Experimental", NID_Experimental, 4, &kObjectData[2837], + 0}, + {"private", "Private", NID_Private, 4, &kObjectData[2841], 0}, + {"security", "Security", NID_Security, 4, &kObjectData[2845], 0}, + {"snmpv2", "SNMPv2", NID_SNMPv2, 4, &kObjectData[2849], 0}, + {"Mail", "Mail", NID_Mail, 4, &kObjectData[2853], 0}, + {"enterprises", "Enterprises", NID_Enterprises, 5, &kObjectData[2857], 0}, + {"dcobject", "dcObject", NID_dcObject, 9, &kObjectData[2862], 0}, + {"DC", "domainComponent", NID_domainComponent, 10, &kObjectData[2871], 0}, + {"domain", "Domain", NID_Domain, 10, &kObjectData[2881], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"selected-attribute-types", "Selected Attribute Types", + NID_selected_attribute_types, 3, &kObjectData[2891], 0}, + {"clearance", "clearance", NID_clearance, 4, &kObjectData[2894], 0}, + {"RSA-MD4", "md4WithRSAEncryption", NID_md4WithRSAEncryption, 9, + &kObjectData[2898], 0}, + {"ac-proxying", "ac-proxying", NID_ac_proxying, 8, &kObjectData[2907], 0}, + {"subjectInfoAccess", "Subject Information Access", NID_sinfo_access, 8, + &kObjectData[2915], 0}, + {"id-aca-encAttrs", "id-aca-encAttrs", NID_id_aca_encAttrs, 8, + &kObjectData[2923], 0}, + {"role", "role", NID_role, 3, &kObjectData[2931], 0}, + {"policyConstraints", "X509v3 Policy Constraints", NID_policy_constraints, + 3, &kObjectData[2934], 0}, + {"targetInformation", "X509v3 AC Targeting", NID_target_information, 3, + &kObjectData[2937], 0}, + {"noRevAvail", "X509v3 No Revocation Available", NID_no_rev_avail, 3, + &kObjectData[2940], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"ansi-X9-62", "ANSI X9.62", NID_ansi_X9_62, 5, &kObjectData[2943], 0}, + {"prime-field", "prime-field", NID_X9_62_prime_field, 7, &kObjectData[2948], + 0}, + {"characteristic-two-field", "characteristic-two-field", + NID_X9_62_characteristic_two_field, 7, &kObjectData[2955], 0}, + {"id-ecPublicKey", "id-ecPublicKey", NID_X9_62_id_ecPublicKey, 7, + &kObjectData[2962], 0}, + {"prime192v1", "prime192v1", NID_X9_62_prime192v1, 8, &kObjectData[2969], + 0}, + {"prime192v2", "prime192v2", NID_X9_62_prime192v2, 8, &kObjectData[2977], + 0}, + {"prime192v3", "prime192v3", NID_X9_62_prime192v3, 8, &kObjectData[2985], + 0}, + {"prime239v1", "prime239v1", NID_X9_62_prime239v1, 8, &kObjectData[2993], + 0}, + {"prime239v2", "prime239v2", NID_X9_62_prime239v2, 8, &kObjectData[3001], + 0}, + {"prime239v3", "prime239v3", NID_X9_62_prime239v3, 8, &kObjectData[3009], + 0}, + {"prime256v1", "prime256v1", NID_X9_62_prime256v1, 8, &kObjectData[3017], + 0}, + {"ecdsa-with-SHA1", "ecdsa-with-SHA1", NID_ecdsa_with_SHA1, 7, + &kObjectData[3025], 0}, + {"CSPName", "Microsoft CSP Name", NID_ms_csp_name, 9, &kObjectData[3032], + 0}, + {"AES-128-ECB", "aes-128-ecb", NID_aes_128_ecb, 9, &kObjectData[3041], 0}, + {"AES-128-CBC", "aes-128-cbc", NID_aes_128_cbc, 9, &kObjectData[3050], 0}, + {"AES-128-OFB", "aes-128-ofb", NID_aes_128_ofb128, 9, &kObjectData[3059], + 0}, + {"AES-128-CFB", "aes-128-cfb", NID_aes_128_cfb128, 9, &kObjectData[3068], + 0}, + {"AES-192-ECB", "aes-192-ecb", NID_aes_192_ecb, 9, &kObjectData[3077], 0}, + {"AES-192-CBC", "aes-192-cbc", NID_aes_192_cbc, 9, &kObjectData[3086], 0}, + {"AES-192-OFB", "aes-192-ofb", NID_aes_192_ofb128, 9, &kObjectData[3095], + 0}, + {"AES-192-CFB", "aes-192-cfb", NID_aes_192_cfb128, 9, &kObjectData[3104], + 0}, + {"AES-256-ECB", "aes-256-ecb", NID_aes_256_ecb, 9, &kObjectData[3113], 0}, + {"AES-256-CBC", "aes-256-cbc", NID_aes_256_cbc, 9, &kObjectData[3122], 0}, + {"AES-256-OFB", "aes-256-ofb", NID_aes_256_ofb128, 9, &kObjectData[3131], + 0}, + {"AES-256-CFB", "aes-256-cfb", NID_aes_256_cfb128, 9, &kObjectData[3140], + 0}, + {"holdInstructionCode", "Hold Instruction Code", NID_hold_instruction_code, + 3, &kObjectData[3149], 0}, + {"holdInstructionNone", "Hold Instruction None", NID_hold_instruction_none, + 7, &kObjectData[3152], 0}, + {"holdInstructionCallIssuer", "Hold Instruction Call Issuer", + NID_hold_instruction_call_issuer, 7, &kObjectData[3159], 0}, + {"holdInstructionReject", "Hold Instruction Reject", + NID_hold_instruction_reject, 7, &kObjectData[3166], 0}, + {"data", "data", NID_data, 1, &kObjectData[3173], 0}, + {"pss", "pss", NID_pss, 3, &kObjectData[3174], 0}, + {"ucl", "ucl", NID_ucl, 7, &kObjectData[3177], 0}, + {"pilot", "pilot", NID_pilot, 8, &kObjectData[3184], 0}, + {"pilotAttributeType", "pilotAttributeType", NID_pilotAttributeType, 9, + &kObjectData[3192], 0}, + {"pilotAttributeSyntax", "pilotAttributeSyntax", NID_pilotAttributeSyntax, + 9, &kObjectData[3201], 0}, + {"pilotObjectClass", "pilotObjectClass", NID_pilotObjectClass, 9, + &kObjectData[3210], 0}, + {"pilotGroups", "pilotGroups", NID_pilotGroups, 9, &kObjectData[3219], 0}, + {"iA5StringSyntax", "iA5StringSyntax", NID_iA5StringSyntax, 10, + &kObjectData[3228], 0}, + {"caseIgnoreIA5StringSyntax", "caseIgnoreIA5StringSyntax", + NID_caseIgnoreIA5StringSyntax, 10, &kObjectData[3238], 0}, + {"pilotObject", "pilotObject", NID_pilotObject, 10, &kObjectData[3248], 0}, + {"pilotPerson", "pilotPerson", NID_pilotPerson, 10, &kObjectData[3258], 0}, + {"account", "account", NID_account, 10, &kObjectData[3268], 0}, + {"document", "document", NID_document, 10, &kObjectData[3278], 0}, + {"room", "room", NID_room, 10, &kObjectData[3288], 0}, + {"documentSeries", "documentSeries", NID_documentSeries, 10, + &kObjectData[3298], 0}, + {"rFC822localPart", "rFC822localPart", NID_rFC822localPart, 10, + &kObjectData[3308], 0}, + {"dNSDomain", "dNSDomain", NID_dNSDomain, 10, &kObjectData[3318], 0}, + {"domainRelatedObject", "domainRelatedObject", NID_domainRelatedObject, 10, + &kObjectData[3328], 0}, + {"friendlyCountry", "friendlyCountry", NID_friendlyCountry, 10, + &kObjectData[3338], 0}, + {"simpleSecurityObject", "simpleSecurityObject", NID_simpleSecurityObject, + 10, &kObjectData[3348], 0}, + {"pilotOrganization", "pilotOrganization", NID_pilotOrganization, 10, + &kObjectData[3358], 0}, + {"pilotDSA", "pilotDSA", NID_pilotDSA, 10, &kObjectData[3368], 0}, + {"qualityLabelledData", "qualityLabelledData", NID_qualityLabelledData, 10, + &kObjectData[3378], 0}, + {"UID", "userId", NID_userId, 10, &kObjectData[3388], 0}, + {"textEncodedORAddress", "textEncodedORAddress", NID_textEncodedORAddress, + 10, &kObjectData[3398], 0}, + {"mail", "rfc822Mailbox", NID_rfc822Mailbox, 10, &kObjectData[3408], 0}, + {"info", "info", NID_info, 10, &kObjectData[3418], 0}, + {"favouriteDrink", "favouriteDrink", NID_favouriteDrink, 10, + &kObjectData[3428], 0}, + {"roomNumber", "roomNumber", NID_roomNumber, 10, &kObjectData[3438], 0}, + {"photo", "photo", NID_photo, 10, &kObjectData[3448], 0}, + {"userClass", "userClass", NID_userClass, 10, &kObjectData[3458], 0}, + {"host", "host", NID_host, 10, &kObjectData[3468], 0}, + {"manager", "manager", NID_manager, 10, &kObjectData[3478], 0}, + {"documentIdentifier", "documentIdentifier", NID_documentIdentifier, 10, + &kObjectData[3488], 0}, + {"documentTitle", "documentTitle", NID_documentTitle, 10, + &kObjectData[3498], 0}, + {"documentVersion", "documentVersion", NID_documentVersion, 10, + &kObjectData[3508], 0}, + {"documentAuthor", "documentAuthor", NID_documentAuthor, 10, + &kObjectData[3518], 0}, + {"documentLocation", "documentLocation", NID_documentLocation, 10, + &kObjectData[3528], 0}, + {"homeTelephoneNumber", "homeTelephoneNumber", NID_homeTelephoneNumber, 10, + &kObjectData[3538], 0}, + {"secretary", "secretary", NID_secretary, 10, &kObjectData[3548], 0}, + {"otherMailbox", "otherMailbox", NID_otherMailbox, 10, &kObjectData[3558], + 0}, + {"lastModifiedTime", "lastModifiedTime", NID_lastModifiedTime, 10, + &kObjectData[3568], 0}, + {"lastModifiedBy", "lastModifiedBy", NID_lastModifiedBy, 10, + &kObjectData[3578], 0}, + {"aRecord", "aRecord", NID_aRecord, 10, &kObjectData[3588], 0}, + {"pilotAttributeType27", "pilotAttributeType27", NID_pilotAttributeType27, + 10, &kObjectData[3598], 0}, + {"mXRecord", "mXRecord", NID_mXRecord, 10, &kObjectData[3608], 0}, + {"nSRecord", "nSRecord", NID_nSRecord, 10, &kObjectData[3618], 0}, + {"sOARecord", "sOARecord", NID_sOARecord, 10, &kObjectData[3628], 0}, + {"cNAMERecord", "cNAMERecord", NID_cNAMERecord, 10, &kObjectData[3638], 0}, + {"associatedDomain", "associatedDomain", NID_associatedDomain, 10, + &kObjectData[3648], 0}, + {"associatedName", "associatedName", NID_associatedName, 10, + &kObjectData[3658], 0}, + {"homePostalAddress", "homePostalAddress", NID_homePostalAddress, 10, + &kObjectData[3668], 0}, + {"personalTitle", "personalTitle", NID_personalTitle, 10, + &kObjectData[3678], 0}, + {"mobileTelephoneNumber", "mobileTelephoneNumber", + NID_mobileTelephoneNumber, 10, &kObjectData[3688], 0}, + {"pagerTelephoneNumber", "pagerTelephoneNumber", NID_pagerTelephoneNumber, + 10, &kObjectData[3698], 0}, + {"friendlyCountryName", "friendlyCountryName", NID_friendlyCountryName, 10, + &kObjectData[3708], 0}, + {"organizationalStatus", "organizationalStatus", NID_organizationalStatus, + 10, &kObjectData[3718], 0}, + {"janetMailbox", "janetMailbox", NID_janetMailbox, 10, &kObjectData[3728], + 0}, + {"mailPreferenceOption", "mailPreferenceOption", NID_mailPreferenceOption, + 10, &kObjectData[3738], 0}, + {"buildingName", "buildingName", NID_buildingName, 10, &kObjectData[3748], + 0}, + {"dSAQuality", "dSAQuality", NID_dSAQuality, 10, &kObjectData[3758], 0}, + {"singleLevelQuality", "singleLevelQuality", NID_singleLevelQuality, 10, + &kObjectData[3768], 0}, + {"subtreeMinimumQuality", "subtreeMinimumQuality", + NID_subtreeMinimumQuality, 10, &kObjectData[3778], 0}, + {"subtreeMaximumQuality", "subtreeMaximumQuality", + NID_subtreeMaximumQuality, 10, &kObjectData[3788], 0}, + {"personalSignature", "personalSignature", NID_personalSignature, 10, + &kObjectData[3798], 0}, + {"dITRedirect", "dITRedirect", NID_dITRedirect, 10, &kObjectData[3808], 0}, + {"audio", "audio", NID_audio, 10, &kObjectData[3818], 0}, + {"documentPublisher", "documentPublisher", NID_documentPublisher, 10, + &kObjectData[3828], 0}, + {"x500UniqueIdentifier", "x500UniqueIdentifier", NID_x500UniqueIdentifier, + 3, &kObjectData[3838], 0}, + {"mime-mhs", "MIME MHS", NID_mime_mhs, 5, &kObjectData[3841], 0}, + {"mime-mhs-headings", "mime-mhs-headings", NID_mime_mhs_headings, 6, + &kObjectData[3846], 0}, + {"mime-mhs-bodies", "mime-mhs-bodies", NID_mime_mhs_bodies, 6, + &kObjectData[3852], 0}, + {"id-hex-partial-message", "id-hex-partial-message", + NID_id_hex_partial_message, 7, &kObjectData[3858], 0}, + {"id-hex-multipart-message", "id-hex-multipart-message", + NID_id_hex_multipart_message, 7, &kObjectData[3865], 0}, + {"generationQualifier", "generationQualifier", NID_generationQualifier, 3, + &kObjectData[3872], 0}, + {"pseudonym", "pseudonym", NID_pseudonym, 3, &kObjectData[3875], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"id-set", "Secure Electronic Transactions", NID_id_set, 2, + &kObjectData[3878], 0}, + {"set-ctype", "content types", NID_set_ctype, 3, &kObjectData[3880], 0}, + {"set-msgExt", "message extensions", NID_set_msgExt, 3, &kObjectData[3883], + 0}, + {"set-attr", "set-attr", NID_set_attr, 3, &kObjectData[3886], 0}, + {"set-policy", "set-policy", NID_set_policy, 3, &kObjectData[3889], 0}, + {"set-certExt", "certificate extensions", NID_set_certExt, 3, + &kObjectData[3892], 0}, + {"set-brand", "set-brand", NID_set_brand, 3, &kObjectData[3895], 0}, + {"setct-PANData", "setct-PANData", NID_setct_PANData, 4, &kObjectData[3898], + 0}, + {"setct-PANToken", "setct-PANToken", NID_setct_PANToken, 4, + &kObjectData[3902], 0}, + {"setct-PANOnly", "setct-PANOnly", NID_setct_PANOnly, 4, &kObjectData[3906], + 0}, + {"setct-OIData", "setct-OIData", NID_setct_OIData, 4, &kObjectData[3910], + 0}, + {"setct-PI", "setct-PI", NID_setct_PI, 4, &kObjectData[3914], 0}, + {"setct-PIData", "setct-PIData", NID_setct_PIData, 4, &kObjectData[3918], + 0}, + {"setct-PIDataUnsigned", "setct-PIDataUnsigned", NID_setct_PIDataUnsigned, + 4, &kObjectData[3922], 0}, + {"setct-HODInput", "setct-HODInput", NID_setct_HODInput, 4, + &kObjectData[3926], 0}, + {"setct-AuthResBaggage", "setct-AuthResBaggage", NID_setct_AuthResBaggage, + 4, &kObjectData[3930], 0}, + {"setct-AuthRevReqBaggage", "setct-AuthRevReqBaggage", + NID_setct_AuthRevReqBaggage, 4, &kObjectData[3934], 0}, + {"setct-AuthRevResBaggage", "setct-AuthRevResBaggage", + NID_setct_AuthRevResBaggage, 4, &kObjectData[3938], 0}, + {"setct-CapTokenSeq", "setct-CapTokenSeq", NID_setct_CapTokenSeq, 4, + &kObjectData[3942], 0}, + {"setct-PInitResData", "setct-PInitResData", NID_setct_PInitResData, 4, + &kObjectData[3946], 0}, + {"setct-PI-TBS", "setct-PI-TBS", NID_setct_PI_TBS, 4, &kObjectData[3950], + 0}, + {"setct-PResData", "setct-PResData", NID_setct_PResData, 4, + &kObjectData[3954], 0}, + {"setct-AuthReqTBS", "setct-AuthReqTBS", NID_setct_AuthReqTBS, 4, + &kObjectData[3958], 0}, + {"setct-AuthResTBS", "setct-AuthResTBS", NID_setct_AuthResTBS, 4, + &kObjectData[3962], 0}, + {"setct-AuthResTBSX", "setct-AuthResTBSX", NID_setct_AuthResTBSX, 4, + &kObjectData[3966], 0}, + {"setct-AuthTokenTBS", "setct-AuthTokenTBS", NID_setct_AuthTokenTBS, 4, + &kObjectData[3970], 0}, + {"setct-CapTokenData", "setct-CapTokenData", NID_setct_CapTokenData, 4, + &kObjectData[3974], 0}, + {"setct-CapTokenTBS", "setct-CapTokenTBS", NID_setct_CapTokenTBS, 4, + &kObjectData[3978], 0}, + {"setct-AcqCardCodeMsg", "setct-AcqCardCodeMsg", NID_setct_AcqCardCodeMsg, + 4, &kObjectData[3982], 0}, + {"setct-AuthRevReqTBS", "setct-AuthRevReqTBS", NID_setct_AuthRevReqTBS, 4, + &kObjectData[3986], 0}, + {"setct-AuthRevResData", "setct-AuthRevResData", NID_setct_AuthRevResData, + 4, &kObjectData[3990], 0}, + {"setct-AuthRevResTBS", "setct-AuthRevResTBS", NID_setct_AuthRevResTBS, 4, + &kObjectData[3994], 0}, + {"setct-CapReqTBS", "setct-CapReqTBS", NID_setct_CapReqTBS, 4, + &kObjectData[3998], 0}, + {"setct-CapReqTBSX", "setct-CapReqTBSX", NID_setct_CapReqTBSX, 4, + &kObjectData[4002], 0}, + {"setct-CapResData", "setct-CapResData", NID_setct_CapResData, 4, + &kObjectData[4006], 0}, + {"setct-CapRevReqTBS", "setct-CapRevReqTBS", NID_setct_CapRevReqTBS, 4, + &kObjectData[4010], 0}, + {"setct-CapRevReqTBSX", "setct-CapRevReqTBSX", NID_setct_CapRevReqTBSX, 4, + &kObjectData[4014], 0}, + {"setct-CapRevResData", "setct-CapRevResData", NID_setct_CapRevResData, 4, + &kObjectData[4018], 0}, + {"setct-CredReqTBS", "setct-CredReqTBS", NID_setct_CredReqTBS, 4, + &kObjectData[4022], 0}, + {"setct-CredReqTBSX", "setct-CredReqTBSX", NID_setct_CredReqTBSX, 4, + &kObjectData[4026], 0}, + {"setct-CredResData", "setct-CredResData", NID_setct_CredResData, 4, + &kObjectData[4030], 0}, + {"setct-CredRevReqTBS", "setct-CredRevReqTBS", NID_setct_CredRevReqTBS, 4, + &kObjectData[4034], 0}, + {"setct-CredRevReqTBSX", "setct-CredRevReqTBSX", NID_setct_CredRevReqTBSX, + 4, &kObjectData[4038], 0}, + {"setct-CredRevResData", "setct-CredRevResData", NID_setct_CredRevResData, + 4, &kObjectData[4042], 0}, + {"setct-PCertReqData", "setct-PCertReqData", NID_setct_PCertReqData, 4, + &kObjectData[4046], 0}, + {"setct-PCertResTBS", "setct-PCertResTBS", NID_setct_PCertResTBS, 4, + &kObjectData[4050], 0}, + {"setct-BatchAdminReqData", "setct-BatchAdminReqData", + NID_setct_BatchAdminReqData, 4, &kObjectData[4054], 0}, + {"setct-BatchAdminResData", "setct-BatchAdminResData", + NID_setct_BatchAdminResData, 4, &kObjectData[4058], 0}, + {"setct-CardCInitResTBS", "setct-CardCInitResTBS", + NID_setct_CardCInitResTBS, 4, &kObjectData[4062], 0}, + {"setct-MeAqCInitResTBS", "setct-MeAqCInitResTBS", + NID_setct_MeAqCInitResTBS, 4, &kObjectData[4066], 0}, + {"setct-RegFormResTBS", "setct-RegFormResTBS", NID_setct_RegFormResTBS, 4, + &kObjectData[4070], 0}, + {"setct-CertReqData", "setct-CertReqData", NID_setct_CertReqData, 4, + &kObjectData[4074], 0}, + {"setct-CertReqTBS", "setct-CertReqTBS", NID_setct_CertReqTBS, 4, + &kObjectData[4078], 0}, + {"setct-CertResData", "setct-CertResData", NID_setct_CertResData, 4, + &kObjectData[4082], 0}, + {"setct-CertInqReqTBS", "setct-CertInqReqTBS", NID_setct_CertInqReqTBS, 4, + &kObjectData[4086], 0}, + {"setct-ErrorTBS", "setct-ErrorTBS", NID_setct_ErrorTBS, 4, + &kObjectData[4090], 0}, + {"setct-PIDualSignedTBE", "setct-PIDualSignedTBE", + NID_setct_PIDualSignedTBE, 4, &kObjectData[4094], 0}, + {"setct-PIUnsignedTBE", "setct-PIUnsignedTBE", NID_setct_PIUnsignedTBE, 4, + &kObjectData[4098], 0}, + {"setct-AuthReqTBE", "setct-AuthReqTBE", NID_setct_AuthReqTBE, 4, + &kObjectData[4102], 0}, + {"setct-AuthResTBE", "setct-AuthResTBE", NID_setct_AuthResTBE, 4, + &kObjectData[4106], 0}, + {"setct-AuthResTBEX", "setct-AuthResTBEX", NID_setct_AuthResTBEX, 4, + &kObjectData[4110], 0}, + {"setct-AuthTokenTBE", "setct-AuthTokenTBE", NID_setct_AuthTokenTBE, 4, + &kObjectData[4114], 0}, + {"setct-CapTokenTBE", "setct-CapTokenTBE", NID_setct_CapTokenTBE, 4, + &kObjectData[4118], 0}, + {"setct-CapTokenTBEX", "setct-CapTokenTBEX", NID_setct_CapTokenTBEX, 4, + &kObjectData[4122], 0}, + {"setct-AcqCardCodeMsgTBE", "setct-AcqCardCodeMsgTBE", + NID_setct_AcqCardCodeMsgTBE, 4, &kObjectData[4126], 0}, + {"setct-AuthRevReqTBE", "setct-AuthRevReqTBE", NID_setct_AuthRevReqTBE, 4, + &kObjectData[4130], 0}, + {"setct-AuthRevResTBE", "setct-AuthRevResTBE", NID_setct_AuthRevResTBE, 4, + &kObjectData[4134], 0}, + {"setct-AuthRevResTBEB", "setct-AuthRevResTBEB", NID_setct_AuthRevResTBEB, + 4, &kObjectData[4138], 0}, + {"setct-CapReqTBE", "setct-CapReqTBE", NID_setct_CapReqTBE, 4, + &kObjectData[4142], 0}, + {"setct-CapReqTBEX", "setct-CapReqTBEX", NID_setct_CapReqTBEX, 4, + &kObjectData[4146], 0}, + {"setct-CapResTBE", "setct-CapResTBE", NID_setct_CapResTBE, 4, + &kObjectData[4150], 0}, + {"setct-CapRevReqTBE", "setct-CapRevReqTBE", NID_setct_CapRevReqTBE, 4, + &kObjectData[4154], 0}, + {"setct-CapRevReqTBEX", "setct-CapRevReqTBEX", NID_setct_CapRevReqTBEX, 4, + &kObjectData[4158], 0}, + {"setct-CapRevResTBE", "setct-CapRevResTBE", NID_setct_CapRevResTBE, 4, + &kObjectData[4162], 0}, + {"setct-CredReqTBE", "setct-CredReqTBE", NID_setct_CredReqTBE, 4, + &kObjectData[4166], 0}, + {"setct-CredReqTBEX", "setct-CredReqTBEX", NID_setct_CredReqTBEX, 4, + &kObjectData[4170], 0}, + {"setct-CredResTBE", "setct-CredResTBE", NID_setct_CredResTBE, 4, + &kObjectData[4174], 0}, + {"setct-CredRevReqTBE", "setct-CredRevReqTBE", NID_setct_CredRevReqTBE, 4, + &kObjectData[4178], 0}, + {"setct-CredRevReqTBEX", "setct-CredRevReqTBEX", NID_setct_CredRevReqTBEX, + 4, &kObjectData[4182], 0}, + {"setct-CredRevResTBE", "setct-CredRevResTBE", NID_setct_CredRevResTBE, 4, + &kObjectData[4186], 0}, + {"setct-BatchAdminReqTBE", "setct-BatchAdminReqTBE", + NID_setct_BatchAdminReqTBE, 4, &kObjectData[4190], 0}, + {"setct-BatchAdminResTBE", "setct-BatchAdminResTBE", + NID_setct_BatchAdminResTBE, 4, &kObjectData[4194], 0}, + {"setct-RegFormReqTBE", "setct-RegFormReqTBE", NID_setct_RegFormReqTBE, 4, + &kObjectData[4198], 0}, + {"setct-CertReqTBE", "setct-CertReqTBE", NID_setct_CertReqTBE, 4, + &kObjectData[4202], 0}, + {"setct-CertReqTBEX", "setct-CertReqTBEX", NID_setct_CertReqTBEX, 4, + &kObjectData[4206], 0}, + {"setct-CertResTBE", "setct-CertResTBE", NID_setct_CertResTBE, 4, + &kObjectData[4210], 0}, + {"setct-CRLNotificationTBS", "setct-CRLNotificationTBS", + NID_setct_CRLNotificationTBS, 4, &kObjectData[4214], 0}, + {"setct-CRLNotificationResTBS", "setct-CRLNotificationResTBS", + NID_setct_CRLNotificationResTBS, 4, &kObjectData[4218], 0}, + {"setct-BCIDistributionTBS", "setct-BCIDistributionTBS", + NID_setct_BCIDistributionTBS, 4, &kObjectData[4222], 0}, + {"setext-genCrypt", "generic cryptogram", NID_setext_genCrypt, 4, + &kObjectData[4226], 0}, + {"setext-miAuth", "merchant initiated auth", NID_setext_miAuth, 4, + &kObjectData[4230], 0}, + {"setext-pinSecure", "setext-pinSecure", NID_setext_pinSecure, 4, + &kObjectData[4234], 0}, + {"setext-pinAny", "setext-pinAny", NID_setext_pinAny, 4, &kObjectData[4238], + 0}, + {"setext-track2", "setext-track2", NID_setext_track2, 4, &kObjectData[4242], + 0}, + {"setext-cv", "additional verification", NID_setext_cv, 4, + &kObjectData[4246], 0}, + {"set-policy-root", "set-policy-root", NID_set_policy_root, 4, + &kObjectData[4250], 0}, + {"setCext-hashedRoot", "setCext-hashedRoot", NID_setCext_hashedRoot, 4, + &kObjectData[4254], 0}, + {"setCext-certType", "setCext-certType", NID_setCext_certType, 4, + &kObjectData[4258], 0}, + {"setCext-merchData", "setCext-merchData", NID_setCext_merchData, 4, + &kObjectData[4262], 0}, + {"setCext-cCertRequired", "setCext-cCertRequired", + NID_setCext_cCertRequired, 4, &kObjectData[4266], 0}, + {"setCext-tunneling", "setCext-tunneling", NID_setCext_tunneling, 4, + &kObjectData[4270], 0}, + {"setCext-setExt", "setCext-setExt", NID_setCext_setExt, 4, + &kObjectData[4274], 0}, + {"setCext-setQualf", "setCext-setQualf", NID_setCext_setQualf, 4, + &kObjectData[4278], 0}, + {"setCext-PGWYcapabilities", "setCext-PGWYcapabilities", + NID_setCext_PGWYcapabilities, 4, &kObjectData[4282], 0}, + {"setCext-TokenIdentifier", "setCext-TokenIdentifier", + NID_setCext_TokenIdentifier, 4, &kObjectData[4286], 0}, + {"setCext-Track2Data", "setCext-Track2Data", NID_setCext_Track2Data, 4, + &kObjectData[4290], 0}, + {"setCext-TokenType", "setCext-TokenType", NID_setCext_TokenType, 4, + &kObjectData[4294], 0}, + {"setCext-IssuerCapabilities", "setCext-IssuerCapabilities", + NID_setCext_IssuerCapabilities, 4, &kObjectData[4298], 0}, + {"setAttr-Cert", "setAttr-Cert", NID_setAttr_Cert, 4, &kObjectData[4302], + 0}, + {"setAttr-PGWYcap", "payment gateway capabilities", NID_setAttr_PGWYcap, 4, + &kObjectData[4306], 0}, + {"setAttr-TokenType", "setAttr-TokenType", NID_setAttr_TokenType, 4, + &kObjectData[4310], 0}, + {"setAttr-IssCap", "issuer capabilities", NID_setAttr_IssCap, 4, + &kObjectData[4314], 0}, + {"set-rootKeyThumb", "set-rootKeyThumb", NID_set_rootKeyThumb, 5, + &kObjectData[4318], 0}, + {"set-addPolicy", "set-addPolicy", NID_set_addPolicy, 5, &kObjectData[4323], + 0}, + {"setAttr-Token-EMV", "setAttr-Token-EMV", NID_setAttr_Token_EMV, 5, + &kObjectData[4328], 0}, + {"setAttr-Token-B0Prime", "setAttr-Token-B0Prime", + NID_setAttr_Token_B0Prime, 5, &kObjectData[4333], 0}, + {"setAttr-IssCap-CVM", "setAttr-IssCap-CVM", NID_setAttr_IssCap_CVM, 5, + &kObjectData[4338], 0}, + {"setAttr-IssCap-T2", "setAttr-IssCap-T2", NID_setAttr_IssCap_T2, 5, + &kObjectData[4343], 0}, + {"setAttr-IssCap-Sig", "setAttr-IssCap-Sig", NID_setAttr_IssCap_Sig, 5, + &kObjectData[4348], 0}, + {"setAttr-GenCryptgrm", "generate cryptogram", NID_setAttr_GenCryptgrm, 6, + &kObjectData[4353], 0}, + {"setAttr-T2Enc", "encrypted track 2", NID_setAttr_T2Enc, 6, + &kObjectData[4359], 0}, + {"setAttr-T2cleartxt", "cleartext track 2", NID_setAttr_T2cleartxt, 6, + &kObjectData[4365], 0}, + {"setAttr-TokICCsig", "ICC or token signature", NID_setAttr_TokICCsig, 6, + &kObjectData[4371], 0}, + {"setAttr-SecDevSig", "secure device signature", NID_setAttr_SecDevSig, 6, + &kObjectData[4377], 0}, + {"set-brand-IATA-ATA", "set-brand-IATA-ATA", NID_set_brand_IATA_ATA, 4, + &kObjectData[4383], 0}, + {"set-brand-Diners", "set-brand-Diners", NID_set_brand_Diners, 4, + &kObjectData[4387], 0}, + {"set-brand-AmericanExpress", "set-brand-AmericanExpress", + NID_set_brand_AmericanExpress, 4, &kObjectData[4391], 0}, + {"set-brand-JCB", "set-brand-JCB", NID_set_brand_JCB, 4, &kObjectData[4395], + 0}, + {"set-brand-Visa", "set-brand-Visa", NID_set_brand_Visa, 4, + &kObjectData[4399], 0}, + {"set-brand-MasterCard", "set-brand-MasterCard", NID_set_brand_MasterCard, + 4, &kObjectData[4403], 0}, + {"set-brand-Novus", "set-brand-Novus", NID_set_brand_Novus, 5, + &kObjectData[4407], 0}, + {"DES-CDMF", "des-cdmf", NID_des_cdmf, 8, &kObjectData[4412], 0}, + {"rsaOAEPEncryptionSET", "rsaOAEPEncryptionSET", NID_rsaOAEPEncryptionSET, + 9, &kObjectData[4420], 0}, + {"ITU-T", "itu-t", NID_itu_t, 0, NULL, 0}, + {"JOINT-ISO-ITU-T", "joint-iso-itu-t", NID_joint_iso_itu_t, 0, NULL, 0}, + {"international-organizations", "International Organizations", + NID_international_organizations, 1, &kObjectData[4429], 0}, + {"msSmartcardLogin", "Microsoft Smartcardlogin", NID_ms_smartcard_login, 10, + &kObjectData[4430], 0}, + {"msUPN", "Microsoft Universal Principal Name", NID_ms_upn, 10, + &kObjectData[4440], 0}, + {"AES-128-CFB1", "aes-128-cfb1", NID_aes_128_cfb1, 0, NULL, 0}, + {"AES-192-CFB1", "aes-192-cfb1", NID_aes_192_cfb1, 0, NULL, 0}, + {"AES-256-CFB1", "aes-256-cfb1", NID_aes_256_cfb1, 0, NULL, 0}, + {"AES-128-CFB8", "aes-128-cfb8", NID_aes_128_cfb8, 0, NULL, 0}, + {"AES-192-CFB8", "aes-192-cfb8", NID_aes_192_cfb8, 0, NULL, 0}, + {"AES-256-CFB8", "aes-256-cfb8", NID_aes_256_cfb8, 0, NULL, 0}, + {"DES-CFB1", "des-cfb1", NID_des_cfb1, 0, NULL, 0}, + {"DES-CFB8", "des-cfb8", NID_des_cfb8, 0, NULL, 0}, + {"DES-EDE3-CFB1", "des-ede3-cfb1", NID_des_ede3_cfb1, 0, NULL, 0}, + {"DES-EDE3-CFB8", "des-ede3-cfb8", NID_des_ede3_cfb8, 0, NULL, 0}, + {"street", "streetAddress", NID_streetAddress, 3, &kObjectData[4450], 0}, + {"postalCode", "postalCode", NID_postalCode, 3, &kObjectData[4453], 0}, + {"id-ppl", "id-ppl", NID_id_ppl, 7, &kObjectData[4456], 0}, + {"proxyCertInfo", "Proxy Certificate Information", NID_proxyCertInfo, 8, + &kObjectData[4463], 0}, + {"id-ppl-anyLanguage", "Any language", NID_id_ppl_anyLanguage, 8, + &kObjectData[4471], 0}, + {"id-ppl-inheritAll", "Inherit all", NID_id_ppl_inheritAll, 8, + &kObjectData[4479], 0}, + {"nameConstraints", "X509v3 Name Constraints", NID_name_constraints, 3, + &kObjectData[4487], 0}, + {"id-ppl-independent", "Independent", NID_Independent, 8, + &kObjectData[4490], 0}, + {"RSA-SHA256", "sha256WithRSAEncryption", NID_sha256WithRSAEncryption, 9, + &kObjectData[4498], 0}, + {"RSA-SHA384", "sha384WithRSAEncryption", NID_sha384WithRSAEncryption, 9, + &kObjectData[4507], 0}, + {"RSA-SHA512", "sha512WithRSAEncryption", NID_sha512WithRSAEncryption, 9, + &kObjectData[4516], 0}, + {"RSA-SHA224", "sha224WithRSAEncryption", NID_sha224WithRSAEncryption, 9, + &kObjectData[4525], 0}, + {"SHA256", "sha256", NID_sha256, 9, &kObjectData[4534], 0}, + {"SHA384", "sha384", NID_sha384, 9, &kObjectData[4543], 0}, + {"SHA512", "sha512", NID_sha512, 9, &kObjectData[4552], 0}, + {"SHA224", "sha224", NID_sha224, 9, &kObjectData[4561], 0}, + {"identified-organization", "identified-organization", + NID_identified_organization, 1, &kObjectData[4570], 0}, + {"certicom-arc", "certicom-arc", NID_certicom_arc, 3, &kObjectData[4571], + 0}, + {"wap", "wap", NID_wap, 2, &kObjectData[4574], 0}, + {"wap-wsg", "wap-wsg", NID_wap_wsg, 3, &kObjectData[4576], 0}, + {"id-characteristic-two-basis", "id-characteristic-two-basis", + NID_X9_62_id_characteristic_two_basis, 8, &kObjectData[4579], 0}, + {"onBasis", "onBasis", NID_X9_62_onBasis, 9, &kObjectData[4587], 0}, + {"tpBasis", "tpBasis", NID_X9_62_tpBasis, 9, &kObjectData[4596], 0}, + {"ppBasis", "ppBasis", NID_X9_62_ppBasis, 9, &kObjectData[4605], 0}, + {"c2pnb163v1", "c2pnb163v1", NID_X9_62_c2pnb163v1, 8, &kObjectData[4614], + 0}, + {"c2pnb163v2", "c2pnb163v2", NID_X9_62_c2pnb163v2, 8, &kObjectData[4622], + 0}, + {"c2pnb163v3", "c2pnb163v3", NID_X9_62_c2pnb163v3, 8, &kObjectData[4630], + 0}, + {"c2pnb176v1", "c2pnb176v1", NID_X9_62_c2pnb176v1, 8, &kObjectData[4638], + 0}, + {"c2tnb191v1", "c2tnb191v1", NID_X9_62_c2tnb191v1, 8, &kObjectData[4646], + 0}, + {"c2tnb191v2", "c2tnb191v2", NID_X9_62_c2tnb191v2, 8, &kObjectData[4654], + 0}, + {"c2tnb191v3", "c2tnb191v3", NID_X9_62_c2tnb191v3, 8, &kObjectData[4662], + 0}, + {"c2onb191v4", "c2onb191v4", NID_X9_62_c2onb191v4, 8, &kObjectData[4670], + 0}, + {"c2onb191v5", "c2onb191v5", NID_X9_62_c2onb191v5, 8, &kObjectData[4678], + 0}, + {"c2pnb208w1", "c2pnb208w1", NID_X9_62_c2pnb208w1, 8, &kObjectData[4686], + 0}, + {"c2tnb239v1", "c2tnb239v1", NID_X9_62_c2tnb239v1, 8, &kObjectData[4694], + 0}, + {"c2tnb239v2", "c2tnb239v2", NID_X9_62_c2tnb239v2, 8, &kObjectData[4702], + 0}, + {"c2tnb239v3", "c2tnb239v3", NID_X9_62_c2tnb239v3, 8, &kObjectData[4710], + 0}, + {"c2onb239v4", "c2onb239v4", NID_X9_62_c2onb239v4, 8, &kObjectData[4718], + 0}, + {"c2onb239v5", "c2onb239v5", NID_X9_62_c2onb239v5, 8, &kObjectData[4726], + 0}, + {"c2pnb272w1", "c2pnb272w1", NID_X9_62_c2pnb272w1, 8, &kObjectData[4734], + 0}, + {"c2pnb304w1", "c2pnb304w1", NID_X9_62_c2pnb304w1, 8, &kObjectData[4742], + 0}, + {"c2tnb359v1", "c2tnb359v1", NID_X9_62_c2tnb359v1, 8, &kObjectData[4750], + 0}, + {"c2pnb368w1", "c2pnb368w1", NID_X9_62_c2pnb368w1, 8, &kObjectData[4758], + 0}, + {"c2tnb431r1", "c2tnb431r1", NID_X9_62_c2tnb431r1, 8, &kObjectData[4766], + 0}, + {"secp112r1", "secp112r1", NID_secp112r1, 5, &kObjectData[4774], 0}, + {"secp112r2", "secp112r2", NID_secp112r2, 5, &kObjectData[4779], 0}, + {"secp128r1", "secp128r1", NID_secp128r1, 5, &kObjectData[4784], 0}, + {"secp128r2", "secp128r2", NID_secp128r2, 5, &kObjectData[4789], 0}, + {"secp160k1", "secp160k1", NID_secp160k1, 5, &kObjectData[4794], 0}, + {"secp160r1", "secp160r1", NID_secp160r1, 5, &kObjectData[4799], 0}, + {"secp160r2", "secp160r2", NID_secp160r2, 5, &kObjectData[4804], 0}, + {"secp192k1", "secp192k1", NID_secp192k1, 5, &kObjectData[4809], 0}, + {"secp224k1", "secp224k1", NID_secp224k1, 5, &kObjectData[4814], 0}, + {"secp224r1", "secp224r1", NID_secp224r1, 5, &kObjectData[4819], 0}, + {"secp256k1", "secp256k1", NID_secp256k1, 5, &kObjectData[4824], 0}, + {"secp384r1", "secp384r1", NID_secp384r1, 5, &kObjectData[4829], 0}, + {"secp521r1", "secp521r1", NID_secp521r1, 5, &kObjectData[4834], 0}, + {"sect113r1", "sect113r1", NID_sect113r1, 5, &kObjectData[4839], 0}, + {"sect113r2", "sect113r2", NID_sect113r2, 5, &kObjectData[4844], 0}, + {"sect131r1", "sect131r1", NID_sect131r1, 5, &kObjectData[4849], 0}, + {"sect131r2", "sect131r2", NID_sect131r2, 5, &kObjectData[4854], 0}, + {"sect163k1", "sect163k1", NID_sect163k1, 5, &kObjectData[4859], 0}, + {"sect163r1", "sect163r1", NID_sect163r1, 5, &kObjectData[4864], 0}, + {"sect163r2", "sect163r2", NID_sect163r2, 5, &kObjectData[4869], 0}, + {"sect193r1", "sect193r1", NID_sect193r1, 5, &kObjectData[4874], 0}, + {"sect193r2", "sect193r2", NID_sect193r2, 5, &kObjectData[4879], 0}, + {"sect233k1", "sect233k1", NID_sect233k1, 5, &kObjectData[4884], 0}, + {"sect233r1", "sect233r1", NID_sect233r1, 5, &kObjectData[4889], 0}, + {"sect239k1", "sect239k1", NID_sect239k1, 5, &kObjectData[4894], 0}, + {"sect283k1", "sect283k1", NID_sect283k1, 5, &kObjectData[4899], 0}, + {"sect283r1", "sect283r1", NID_sect283r1, 5, &kObjectData[4904], 0}, + {"sect409k1", "sect409k1", NID_sect409k1, 5, &kObjectData[4909], 0}, + {"sect409r1", "sect409r1", NID_sect409r1, 5, &kObjectData[4914], 0}, + {"sect571k1", "sect571k1", NID_sect571k1, 5, &kObjectData[4919], 0}, + {"sect571r1", "sect571r1", NID_sect571r1, 5, &kObjectData[4924], 0}, + {"wap-wsg-idm-ecid-wtls1", "wap-wsg-idm-ecid-wtls1", + NID_wap_wsg_idm_ecid_wtls1, 5, &kObjectData[4929], 0}, + {"wap-wsg-idm-ecid-wtls3", "wap-wsg-idm-ecid-wtls3", + NID_wap_wsg_idm_ecid_wtls3, 5, &kObjectData[4934], 0}, + {"wap-wsg-idm-ecid-wtls4", "wap-wsg-idm-ecid-wtls4", + NID_wap_wsg_idm_ecid_wtls4, 5, &kObjectData[4939], 0}, + {"wap-wsg-idm-ecid-wtls5", "wap-wsg-idm-ecid-wtls5", + NID_wap_wsg_idm_ecid_wtls5, 5, &kObjectData[4944], 0}, + {"wap-wsg-idm-ecid-wtls6", "wap-wsg-idm-ecid-wtls6", + NID_wap_wsg_idm_ecid_wtls6, 5, &kObjectData[4949], 0}, + {"wap-wsg-idm-ecid-wtls7", "wap-wsg-idm-ecid-wtls7", + NID_wap_wsg_idm_ecid_wtls7, 5, &kObjectData[4954], 0}, + {"wap-wsg-idm-ecid-wtls8", "wap-wsg-idm-ecid-wtls8", + NID_wap_wsg_idm_ecid_wtls8, 5, &kObjectData[4959], 0}, + {"wap-wsg-idm-ecid-wtls9", "wap-wsg-idm-ecid-wtls9", + NID_wap_wsg_idm_ecid_wtls9, 5, &kObjectData[4964], 0}, + {"wap-wsg-idm-ecid-wtls10", "wap-wsg-idm-ecid-wtls10", + NID_wap_wsg_idm_ecid_wtls10, 5, &kObjectData[4969], 0}, + {"wap-wsg-idm-ecid-wtls11", "wap-wsg-idm-ecid-wtls11", + NID_wap_wsg_idm_ecid_wtls11, 5, &kObjectData[4974], 0}, + {"wap-wsg-idm-ecid-wtls12", "wap-wsg-idm-ecid-wtls12", + NID_wap_wsg_idm_ecid_wtls12, 5, &kObjectData[4979], 0}, + {"anyPolicy", "X509v3 Any Policy", NID_any_policy, 4, &kObjectData[4984], + 0}, + {"policyMappings", "X509v3 Policy Mappings", NID_policy_mappings, 3, + &kObjectData[4988], 0}, + {"inhibitAnyPolicy", "X509v3 Inhibit Any Policy", NID_inhibit_any_policy, 3, + &kObjectData[4991], 0}, + {"Oakley-EC2N-3", "ipsec3", NID_ipsec3, 0, NULL, 0}, + {"Oakley-EC2N-4", "ipsec4", NID_ipsec4, 0, NULL, 0}, + {"CAMELLIA-128-CBC", "camellia-128-cbc", NID_camellia_128_cbc, 11, + &kObjectData[4994], 0}, + {"CAMELLIA-192-CBC", "camellia-192-cbc", NID_camellia_192_cbc, 11, + &kObjectData[5005], 0}, + {"CAMELLIA-256-CBC", "camellia-256-cbc", NID_camellia_256_cbc, 11, + &kObjectData[5016], 0}, + {"CAMELLIA-128-ECB", "camellia-128-ecb", NID_camellia_128_ecb, 8, + &kObjectData[5027], 0}, + {"CAMELLIA-192-ECB", "camellia-192-ecb", NID_camellia_192_ecb, 8, + &kObjectData[5035], 0}, + {"CAMELLIA-256-ECB", "camellia-256-ecb", NID_camellia_256_ecb, 8, + &kObjectData[5043], 0}, + {"CAMELLIA-128-CFB", "camellia-128-cfb", NID_camellia_128_cfb128, 8, + &kObjectData[5051], 0}, + {"CAMELLIA-192-CFB", "camellia-192-cfb", NID_camellia_192_cfb128, 8, + &kObjectData[5059], 0}, + {"CAMELLIA-256-CFB", "camellia-256-cfb", NID_camellia_256_cfb128, 8, + &kObjectData[5067], 0}, + {"CAMELLIA-128-CFB1", "camellia-128-cfb1", NID_camellia_128_cfb1, 0, NULL, + 0}, + {"CAMELLIA-192-CFB1", "camellia-192-cfb1", NID_camellia_192_cfb1, 0, NULL, + 0}, + {"CAMELLIA-256-CFB1", "camellia-256-cfb1", NID_camellia_256_cfb1, 0, NULL, + 0}, + {"CAMELLIA-128-CFB8", "camellia-128-cfb8", NID_camellia_128_cfb8, 0, NULL, + 0}, + {"CAMELLIA-192-CFB8", "camellia-192-cfb8", NID_camellia_192_cfb8, 0, NULL, + 0}, + {"CAMELLIA-256-CFB8", "camellia-256-cfb8", NID_camellia_256_cfb8, 0, NULL, + 0}, + {"CAMELLIA-128-OFB", "camellia-128-ofb", NID_camellia_128_ofb128, 8, + &kObjectData[5075], 0}, + {"CAMELLIA-192-OFB", "camellia-192-ofb", NID_camellia_192_ofb128, 8, + &kObjectData[5083], 0}, + {"CAMELLIA-256-OFB", "camellia-256-ofb", NID_camellia_256_ofb128, 8, + &kObjectData[5091], 0}, + {"subjectDirectoryAttributes", "X509v3 Subject Directory Attributes", + NID_subject_directory_attributes, 3, &kObjectData[5099], 0}, + {"issuingDistributionPoint", "X509v3 Issuing Distribution Point", + NID_issuing_distribution_point, 3, &kObjectData[5102], 0}, + {"certificateIssuer", "X509v3 Certificate Issuer", NID_certificate_issuer, + 3, &kObjectData[5105], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"KISA", "kisa", NID_kisa, 6, &kObjectData[5108], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"SEED-ECB", "seed-ecb", NID_seed_ecb, 8, &kObjectData[5114], 0}, + {"SEED-CBC", "seed-cbc", NID_seed_cbc, 8, &kObjectData[5122], 0}, + {"SEED-OFB", "seed-ofb", NID_seed_ofb128, 8, &kObjectData[5130], 0}, + {"SEED-CFB", "seed-cfb", NID_seed_cfb128, 8, &kObjectData[5138], 0}, + {"HMAC-MD5", "hmac-md5", NID_hmac_md5, 8, &kObjectData[5146], 0}, + {"HMAC-SHA1", "hmac-sha1", NID_hmac_sha1, 8, &kObjectData[5154], 0}, + {"id-PasswordBasedMAC", "password based MAC", NID_id_PasswordBasedMAC, 9, + &kObjectData[5162], 0}, + {"id-DHBasedMac", "Diffie-Hellman based MAC", NID_id_DHBasedMac, 9, + &kObjectData[5171], 0}, + {"id-it-suppLangTags", "id-it-suppLangTags", NID_id_it_suppLangTags, 8, + &kObjectData[5180], 0}, + {"caRepository", "CA Repository", NID_caRepository, 8, &kObjectData[5188], + 0}, + {"id-smime-ct-compressedData", "id-smime-ct-compressedData", + NID_id_smime_ct_compressedData, 11, &kObjectData[5196], 0}, + {"id-ct-asciiTextWithCRLF", "id-ct-asciiTextWithCRLF", + NID_id_ct_asciiTextWithCRLF, 11, &kObjectData[5207], 0}, + {"id-aes128-wrap", "id-aes128-wrap", NID_id_aes128_wrap, 9, + &kObjectData[5218], 0}, + {"id-aes192-wrap", "id-aes192-wrap", NID_id_aes192_wrap, 9, + &kObjectData[5227], 0}, + {"id-aes256-wrap", "id-aes256-wrap", NID_id_aes256_wrap, 9, + &kObjectData[5236], 0}, + {"ecdsa-with-Recommended", "ecdsa-with-Recommended", + NID_ecdsa_with_Recommended, 7, &kObjectData[5245], 0}, + {"ecdsa-with-Specified", "ecdsa-with-Specified", NID_ecdsa_with_Specified, + 7, &kObjectData[5252], 0}, + {"ecdsa-with-SHA224", "ecdsa-with-SHA224", NID_ecdsa_with_SHA224, 8, + &kObjectData[5259], 0}, + {"ecdsa-with-SHA256", "ecdsa-with-SHA256", NID_ecdsa_with_SHA256, 8, + &kObjectData[5267], 0}, + {"ecdsa-with-SHA384", "ecdsa-with-SHA384", NID_ecdsa_with_SHA384, 8, + &kObjectData[5275], 0}, + {"ecdsa-with-SHA512", "ecdsa-with-SHA512", NID_ecdsa_with_SHA512, 8, + &kObjectData[5283], 0}, + {"hmacWithMD5", "hmacWithMD5", NID_hmacWithMD5, 8, &kObjectData[5291], 0}, + {"hmacWithSHA224", "hmacWithSHA224", NID_hmacWithSHA224, 8, + &kObjectData[5299], 0}, + {"hmacWithSHA256", "hmacWithSHA256", NID_hmacWithSHA256, 8, + &kObjectData[5307], 0}, + {"hmacWithSHA384", "hmacWithSHA384", NID_hmacWithSHA384, 8, + &kObjectData[5315], 0}, + {"hmacWithSHA512", "hmacWithSHA512", NID_hmacWithSHA512, 8, + &kObjectData[5323], 0}, + {"dsa_with_SHA224", "dsa_with_SHA224", NID_dsa_with_SHA224, 9, + &kObjectData[5331], 0}, + {"dsa_with_SHA256", "dsa_with_SHA256", NID_dsa_with_SHA256, 9, + &kObjectData[5340], 0}, + {"whirlpool", "whirlpool", NID_whirlpool, 6, &kObjectData[5349], 0}, + {"cryptopro", "cryptopro", NID_cryptopro, 5, &kObjectData[5355], 0}, + {"cryptocom", "cryptocom", NID_cryptocom, 5, &kObjectData[5360], 0}, + {"id-GostR3411-94-with-GostR3410-2001", + "GOST R 34.11-94 with GOST R 34.10-2001", + NID_id_GostR3411_94_with_GostR3410_2001, 6, &kObjectData[5365], 0}, + {"id-GostR3411-94-with-GostR3410-94", + "GOST R 34.11-94 with GOST R 34.10-94", + NID_id_GostR3411_94_with_GostR3410_94, 6, &kObjectData[5371], 0}, + {"md_gost94", "GOST R 34.11-94", NID_id_GostR3411_94, 6, &kObjectData[5377], + 0}, + {"id-HMACGostR3411-94", "HMAC GOST 34.11-94", NID_id_HMACGostR3411_94, 6, + &kObjectData[5383], 0}, + {"gost2001", "GOST R 34.10-2001", NID_id_GostR3410_2001, 6, + &kObjectData[5389], 0}, + {"gost94", "GOST R 34.10-94", NID_id_GostR3410_94, 6, &kObjectData[5395], + 0}, + {"gost89", "GOST 28147-89", NID_id_Gost28147_89, 6, &kObjectData[5401], 0}, + {"gost89-cnt", "gost89-cnt", NID_gost89_cnt, 0, NULL, 0}, + {"gost-mac", "GOST 28147-89 MAC", NID_id_Gost28147_89_MAC, 6, + &kObjectData[5407], 0}, + {"prf-gostr3411-94", "GOST R 34.11-94 PRF", NID_id_GostR3411_94_prf, 6, + &kObjectData[5413], 0}, + {"id-GostR3410-2001DH", "GOST R 34.10-2001 DH", NID_id_GostR3410_2001DH, 6, + &kObjectData[5419], 0}, + {"id-GostR3410-94DH", "GOST R 34.10-94 DH", NID_id_GostR3410_94DH, 6, + &kObjectData[5425], 0}, + {"id-Gost28147-89-CryptoPro-KeyMeshing", + "id-Gost28147-89-CryptoPro-KeyMeshing", + NID_id_Gost28147_89_CryptoPro_KeyMeshing, 7, &kObjectData[5431], 0}, + {"id-Gost28147-89-None-KeyMeshing", "id-Gost28147-89-None-KeyMeshing", + NID_id_Gost28147_89_None_KeyMeshing, 7, &kObjectData[5438], 0}, + {"id-GostR3411-94-TestParamSet", "id-GostR3411-94-TestParamSet", + NID_id_GostR3411_94_TestParamSet, 7, &kObjectData[5445], 0}, + {"id-GostR3411-94-CryptoProParamSet", "id-GostR3411-94-CryptoProParamSet", + NID_id_GostR3411_94_CryptoProParamSet, 7, &kObjectData[5452], 0}, + {"id-Gost28147-89-TestParamSet", "id-Gost28147-89-TestParamSet", + NID_id_Gost28147_89_TestParamSet, 7, &kObjectData[5459], 0}, + {"id-Gost28147-89-CryptoPro-A-ParamSet", + "id-Gost28147-89-CryptoPro-A-ParamSet", + NID_id_Gost28147_89_CryptoPro_A_ParamSet, 7, &kObjectData[5466], 0}, + {"id-Gost28147-89-CryptoPro-B-ParamSet", + "id-Gost28147-89-CryptoPro-B-ParamSet", + NID_id_Gost28147_89_CryptoPro_B_ParamSet, 7, &kObjectData[5473], 0}, + {"id-Gost28147-89-CryptoPro-C-ParamSet", + "id-Gost28147-89-CryptoPro-C-ParamSet", + NID_id_Gost28147_89_CryptoPro_C_ParamSet, 7, &kObjectData[5480], 0}, + {"id-Gost28147-89-CryptoPro-D-ParamSet", + "id-Gost28147-89-CryptoPro-D-ParamSet", + NID_id_Gost28147_89_CryptoPro_D_ParamSet, 7, &kObjectData[5487], 0}, + {"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", + "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", + NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet, 7, &kObjectData[5494], + 0}, + {"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", + "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", + NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet, 7, &kObjectData[5501], + 0}, + {"id-Gost28147-89-CryptoPro-RIC-1-ParamSet", + "id-Gost28147-89-CryptoPro-RIC-1-ParamSet", + NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet, 7, &kObjectData[5508], 0}, + {"id-GostR3410-94-TestParamSet", "id-GostR3410-94-TestParamSet", + NID_id_GostR3410_94_TestParamSet, 7, &kObjectData[5515], 0}, + {"id-GostR3410-94-CryptoPro-A-ParamSet", + "id-GostR3410-94-CryptoPro-A-ParamSet", + NID_id_GostR3410_94_CryptoPro_A_ParamSet, 7, &kObjectData[5522], 0}, + {"id-GostR3410-94-CryptoPro-B-ParamSet", + "id-GostR3410-94-CryptoPro-B-ParamSet", + NID_id_GostR3410_94_CryptoPro_B_ParamSet, 7, &kObjectData[5529], 0}, + {"id-GostR3410-94-CryptoPro-C-ParamSet", + "id-GostR3410-94-CryptoPro-C-ParamSet", + NID_id_GostR3410_94_CryptoPro_C_ParamSet, 7, &kObjectData[5536], 0}, + {"id-GostR3410-94-CryptoPro-D-ParamSet", + "id-GostR3410-94-CryptoPro-D-ParamSet", + NID_id_GostR3410_94_CryptoPro_D_ParamSet, 7, &kObjectData[5543], 0}, + {"id-GostR3410-94-CryptoPro-XchA-ParamSet", + "id-GostR3410-94-CryptoPro-XchA-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchA_ParamSet, 7, &kObjectData[5550], 0}, + {"id-GostR3410-94-CryptoPro-XchB-ParamSet", + "id-GostR3410-94-CryptoPro-XchB-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchB_ParamSet, 7, &kObjectData[5557], 0}, + {"id-GostR3410-94-CryptoPro-XchC-ParamSet", + "id-GostR3410-94-CryptoPro-XchC-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchC_ParamSet, 7, &kObjectData[5564], 0}, + {"id-GostR3410-2001-TestParamSet", "id-GostR3410-2001-TestParamSet", + NID_id_GostR3410_2001_TestParamSet, 7, &kObjectData[5571], 0}, + {"id-GostR3410-2001-CryptoPro-A-ParamSet", + "id-GostR3410-2001-CryptoPro-A-ParamSet", + NID_id_GostR3410_2001_CryptoPro_A_ParamSet, 7, &kObjectData[5578], 0}, + {"id-GostR3410-2001-CryptoPro-B-ParamSet", + "id-GostR3410-2001-CryptoPro-B-ParamSet", + NID_id_GostR3410_2001_CryptoPro_B_ParamSet, 7, &kObjectData[5585], 0}, + {"id-GostR3410-2001-CryptoPro-C-ParamSet", + "id-GostR3410-2001-CryptoPro-C-ParamSet", + NID_id_GostR3410_2001_CryptoPro_C_ParamSet, 7, &kObjectData[5592], 0}, + {"id-GostR3410-2001-CryptoPro-XchA-ParamSet", + "id-GostR3410-2001-CryptoPro-XchA-ParamSet", + NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet, 7, &kObjectData[5599], 0}, + {"id-GostR3410-2001-CryptoPro-XchB-ParamSet", + "id-GostR3410-2001-CryptoPro-XchB-ParamSet", + NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet, 7, &kObjectData[5606], 0}, + {"id-GostR3410-94-a", "id-GostR3410-94-a", NID_id_GostR3410_94_a, 7, + &kObjectData[5613], 0}, + {"id-GostR3410-94-aBis", "id-GostR3410-94-aBis", NID_id_GostR3410_94_aBis, + 7, &kObjectData[5620], 0}, + {"id-GostR3410-94-b", "id-GostR3410-94-b", NID_id_GostR3410_94_b, 7, + &kObjectData[5627], 0}, + {"id-GostR3410-94-bBis", "id-GostR3410-94-bBis", NID_id_GostR3410_94_bBis, + 7, &kObjectData[5634], 0}, + {"id-Gost28147-89-cc", "GOST 28147-89 Cryptocom ParamSet", + NID_id_Gost28147_89_cc, 8, &kObjectData[5641], 0}, + {"gost94cc", "GOST 34.10-94 Cryptocom", NID_id_GostR3410_94_cc, 8, + &kObjectData[5649], 0}, + {"gost2001cc", "GOST 34.10-2001 Cryptocom", NID_id_GostR3410_2001_cc, 8, + &kObjectData[5657], 0}, + {"id-GostR3411-94-with-GostR3410-94-cc", + "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom", + NID_id_GostR3411_94_with_GostR3410_94_cc, 8, &kObjectData[5665], 0}, + {"id-GostR3411-94-with-GostR3410-2001-cc", + "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom", + NID_id_GostR3411_94_with_GostR3410_2001_cc, 8, &kObjectData[5673], 0}, + {"id-GostR3410-2001-ParamSet-cc", + "GOST R 3410-2001 Parameter Set Cryptocom", + NID_id_GostR3410_2001_ParamSet_cc, 8, &kObjectData[5681], 0}, + {"HMAC", "hmac", NID_hmac, 0, NULL, 0}, + {"LocalKeySet", "Microsoft Local Key set", NID_LocalKeySet, 9, + &kObjectData[5689], 0}, + {"freshestCRL", "X509v3 Freshest CRL", NID_freshest_crl, 3, + &kObjectData[5698], 0}, + {"id-on-permanentIdentifier", "Permanent Identifier", + NID_id_on_permanentIdentifier, 8, &kObjectData[5701], 0}, + {"searchGuide", "searchGuide", NID_searchGuide, 3, &kObjectData[5709], 0}, + {"businessCategory", "businessCategory", NID_businessCategory, 3, + &kObjectData[5712], 0}, + {"postalAddress", "postalAddress", NID_postalAddress, 3, &kObjectData[5715], + 0}, + {"postOfficeBox", "postOfficeBox", NID_postOfficeBox, 3, &kObjectData[5718], + 0}, + {"physicalDeliveryOfficeName", "physicalDeliveryOfficeName", + NID_physicalDeliveryOfficeName, 3, &kObjectData[5721], 0}, + {"telephoneNumber", "telephoneNumber", NID_telephoneNumber, 3, + &kObjectData[5724], 0}, + {"telexNumber", "telexNumber", NID_telexNumber, 3, &kObjectData[5727], 0}, + {"teletexTerminalIdentifier", "teletexTerminalIdentifier", + NID_teletexTerminalIdentifier, 3, &kObjectData[5730], 0}, + {"facsimileTelephoneNumber", "facsimileTelephoneNumber", + NID_facsimileTelephoneNumber, 3, &kObjectData[5733], 0}, + {"x121Address", "x121Address", NID_x121Address, 3, &kObjectData[5736], 0}, + {"internationaliSDNNumber", "internationaliSDNNumber", + NID_internationaliSDNNumber, 3, &kObjectData[5739], 0}, + {"registeredAddress", "registeredAddress", NID_registeredAddress, 3, + &kObjectData[5742], 0}, + {"destinationIndicator", "destinationIndicator", NID_destinationIndicator, + 3, &kObjectData[5745], 0}, + {"preferredDeliveryMethod", "preferredDeliveryMethod", + NID_preferredDeliveryMethod, 3, &kObjectData[5748], 0}, + {"presentationAddress", "presentationAddress", NID_presentationAddress, 3, + &kObjectData[5751], 0}, + {"supportedApplicationContext", "supportedApplicationContext", + NID_supportedApplicationContext, 3, &kObjectData[5754], 0}, + {"member", "member", NID_member, 3, &kObjectData[5757], 0}, + {"owner", "owner", NID_owner, 3, &kObjectData[5760], 0}, + {"roleOccupant", "roleOccupant", NID_roleOccupant, 3, &kObjectData[5763], + 0}, + {"seeAlso", "seeAlso", NID_seeAlso, 3, &kObjectData[5766], 0}, + {"userPassword", "userPassword", NID_userPassword, 3, &kObjectData[5769], + 0}, + {"userCertificate", "userCertificate", NID_userCertificate, 3, + &kObjectData[5772], 0}, + {"cACertificate", "cACertificate", NID_cACertificate, 3, &kObjectData[5775], + 0}, + {"authorityRevocationList", "authorityRevocationList", + NID_authorityRevocationList, 3, &kObjectData[5778], 0}, + {"certificateRevocationList", "certificateRevocationList", + NID_certificateRevocationList, 3, &kObjectData[5781], 0}, + {"crossCertificatePair", "crossCertificatePair", NID_crossCertificatePair, + 3, &kObjectData[5784], 0}, + {"enhancedSearchGuide", "enhancedSearchGuide", NID_enhancedSearchGuide, 3, + &kObjectData[5787], 0}, + {"protocolInformation", "protocolInformation", NID_protocolInformation, 3, + &kObjectData[5790], 0}, + {"distinguishedName", "distinguishedName", NID_distinguishedName, 3, + &kObjectData[5793], 0}, + {"uniqueMember", "uniqueMember", NID_uniqueMember, 3, &kObjectData[5796], + 0}, + {"houseIdentifier", "houseIdentifier", NID_houseIdentifier, 3, + &kObjectData[5799], 0}, + {"supportedAlgorithms", "supportedAlgorithms", NID_supportedAlgorithms, 3, + &kObjectData[5802], 0}, + {"deltaRevocationList", "deltaRevocationList", NID_deltaRevocationList, 3, + &kObjectData[5805], 0}, + {"dmdName", "dmdName", NID_dmdName, 3, &kObjectData[5808], 0}, + {"id-alg-PWRI-KEK", "id-alg-PWRI-KEK", NID_id_alg_PWRI_KEK, 11, + &kObjectData[5811], 0}, + {"CMAC", "cmac", NID_cmac, 0, NULL, 0}, + {"id-aes128-GCM", "aes-128-gcm", NID_aes_128_gcm, 9, &kObjectData[5822], 0}, + {"id-aes128-CCM", "aes-128-ccm", NID_aes_128_ccm, 9, &kObjectData[5831], 0}, + {"id-aes128-wrap-pad", "id-aes128-wrap-pad", NID_id_aes128_wrap_pad, 9, + &kObjectData[5840], 0}, + {"id-aes192-GCM", "aes-192-gcm", NID_aes_192_gcm, 9, &kObjectData[5849], 0}, + {"id-aes192-CCM", "aes-192-ccm", NID_aes_192_ccm, 9, &kObjectData[5858], 0}, + {"id-aes192-wrap-pad", "id-aes192-wrap-pad", NID_id_aes192_wrap_pad, 9, + &kObjectData[5867], 0}, + {"id-aes256-GCM", "aes-256-gcm", NID_aes_256_gcm, 9, &kObjectData[5876], 0}, + {"id-aes256-CCM", "aes-256-ccm", NID_aes_256_ccm, 9, &kObjectData[5885], 0}, + {"id-aes256-wrap-pad", "id-aes256-wrap-pad", NID_id_aes256_wrap_pad, 9, + &kObjectData[5894], 0}, + {"AES-128-CTR", "aes-128-ctr", NID_aes_128_ctr, 0, NULL, 0}, + {"AES-192-CTR", "aes-192-ctr", NID_aes_192_ctr, 0, NULL, 0}, + {"AES-256-CTR", "aes-256-ctr", NID_aes_256_ctr, 0, NULL, 0}, + {"id-camellia128-wrap", "id-camellia128-wrap", NID_id_camellia128_wrap, 11, + &kObjectData[5903], 0}, + {"id-camellia192-wrap", "id-camellia192-wrap", NID_id_camellia192_wrap, 11, + &kObjectData[5914], 0}, + {"id-camellia256-wrap", "id-camellia256-wrap", NID_id_camellia256_wrap, 11, + &kObjectData[5925], 0}, + {"anyExtendedKeyUsage", "Any Extended Key Usage", NID_anyExtendedKeyUsage, + 4, &kObjectData[5936], 0}, + {"MGF1", "mgf1", NID_mgf1, 9, &kObjectData[5940], 0}, + {"RSASSA-PSS", "rsassaPss", NID_rsassaPss, 9, &kObjectData[5949], 0}, + {"AES-128-XTS", "aes-128-xts", NID_aes_128_xts, 0, NULL, 0}, + {"AES-256-XTS", "aes-256-xts", NID_aes_256_xts, 0, NULL, 0}, + {"RC4-HMAC-MD5", "rc4-hmac-md5", NID_rc4_hmac_md5, 0, NULL, 0}, + {"AES-128-CBC-HMAC-SHA1", "aes-128-cbc-hmac-sha1", + NID_aes_128_cbc_hmac_sha1, 0, NULL, 0}, + {"AES-192-CBC-HMAC-SHA1", "aes-192-cbc-hmac-sha1", + NID_aes_192_cbc_hmac_sha1, 0, NULL, 0}, + {"AES-256-CBC-HMAC-SHA1", "aes-256-cbc-hmac-sha1", + NID_aes_256_cbc_hmac_sha1, 0, NULL, 0}, + {"RSAES-OAEP", "rsaesOaep", NID_rsaesOaep, 9, &kObjectData[5958], 0}, + {"dhpublicnumber", "X9.42 DH", NID_dhpublicnumber, 7, &kObjectData[5967], + 0}, + {"brainpoolP160r1", "brainpoolP160r1", NID_brainpoolP160r1, 9, + &kObjectData[5974], 0}, + {"brainpoolP160t1", "brainpoolP160t1", NID_brainpoolP160t1, 9, + &kObjectData[5983], 0}, + {"brainpoolP192r1", "brainpoolP192r1", NID_brainpoolP192r1, 9, + &kObjectData[5992], 0}, + {"brainpoolP192t1", "brainpoolP192t1", NID_brainpoolP192t1, 9, + &kObjectData[6001], 0}, + {"brainpoolP224r1", "brainpoolP224r1", NID_brainpoolP224r1, 9, + &kObjectData[6010], 0}, + {"brainpoolP224t1", "brainpoolP224t1", NID_brainpoolP224t1, 9, + &kObjectData[6019], 0}, + {"brainpoolP256r1", "brainpoolP256r1", NID_brainpoolP256r1, 9, + &kObjectData[6028], 0}, + {"brainpoolP256t1", "brainpoolP256t1", NID_brainpoolP256t1, 9, + &kObjectData[6037], 0}, + {"brainpoolP320r1", "brainpoolP320r1", NID_brainpoolP320r1, 9, + &kObjectData[6046], 0}, + {"brainpoolP320t1", "brainpoolP320t1", NID_brainpoolP320t1, 9, + &kObjectData[6055], 0}, + {"brainpoolP384r1", "brainpoolP384r1", NID_brainpoolP384r1, 9, + &kObjectData[6064], 0}, + {"brainpoolP384t1", "brainpoolP384t1", NID_brainpoolP384t1, 9, + &kObjectData[6073], 0}, + {"brainpoolP512r1", "brainpoolP512r1", NID_brainpoolP512r1, 9, + &kObjectData[6082], 0}, + {"brainpoolP512t1", "brainpoolP512t1", NID_brainpoolP512t1, 9, + &kObjectData[6091], 0}, + {"PSPECIFIED", "pSpecified", NID_pSpecified, 9, &kObjectData[6100], 0}, + {"dhSinglePass-stdDH-sha1kdf-scheme", "dhSinglePass-stdDH-sha1kdf-scheme", + NID_dhSinglePass_stdDH_sha1kdf_scheme, 9, &kObjectData[6109], 0}, + {"dhSinglePass-stdDH-sha224kdf-scheme", + "dhSinglePass-stdDH-sha224kdf-scheme", + NID_dhSinglePass_stdDH_sha224kdf_scheme, 6, &kObjectData[6118], 0}, + {"dhSinglePass-stdDH-sha256kdf-scheme", + "dhSinglePass-stdDH-sha256kdf-scheme", + NID_dhSinglePass_stdDH_sha256kdf_scheme, 6, &kObjectData[6124], 0}, + {"dhSinglePass-stdDH-sha384kdf-scheme", + "dhSinglePass-stdDH-sha384kdf-scheme", + NID_dhSinglePass_stdDH_sha384kdf_scheme, 6, &kObjectData[6130], 0}, + {"dhSinglePass-stdDH-sha512kdf-scheme", + "dhSinglePass-stdDH-sha512kdf-scheme", + NID_dhSinglePass_stdDH_sha512kdf_scheme, 6, &kObjectData[6136], 0}, + {"dhSinglePass-cofactorDH-sha1kdf-scheme", + "dhSinglePass-cofactorDH-sha1kdf-scheme", + NID_dhSinglePass_cofactorDH_sha1kdf_scheme, 9, &kObjectData[6142], 0}, + {"dhSinglePass-cofactorDH-sha224kdf-scheme", + "dhSinglePass-cofactorDH-sha224kdf-scheme", + NID_dhSinglePass_cofactorDH_sha224kdf_scheme, 6, &kObjectData[6151], 0}, + {"dhSinglePass-cofactorDH-sha256kdf-scheme", + "dhSinglePass-cofactorDH-sha256kdf-scheme", + NID_dhSinglePass_cofactorDH_sha256kdf_scheme, 6, &kObjectData[6157], 0}, + {"dhSinglePass-cofactorDH-sha384kdf-scheme", + "dhSinglePass-cofactorDH-sha384kdf-scheme", + NID_dhSinglePass_cofactorDH_sha384kdf_scheme, 6, &kObjectData[6163], 0}, + {"dhSinglePass-cofactorDH-sha512kdf-scheme", + "dhSinglePass-cofactorDH-sha512kdf-scheme", + 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, 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}, + {"KxECDHE", "kx-ecdhe", NID_kx_ecdhe, 0, NULL, 0}, + {"KxPSK", "kx-psk", NID_kx_psk, 0, NULL, 0}, + {"AuthRSA", "auth-rsa", NID_auth_rsa, 0, NULL, 0}, + {"AuthECDSA", "auth-ecdsa", NID_auth_ecdsa, 0, NULL, 0}, + {"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 uint16_t kNIDsInShortNameOrder[] = { + 364 /* AD_DVCS */, + 419 /* AES-128-CBC */, + 916 /* AES-128-CBC-HMAC-SHA1 */, + 421 /* AES-128-CFB */, + 650 /* AES-128-CFB1 */, + 653 /* AES-128-CFB8 */, + 904 /* AES-128-CTR */, + 418 /* AES-128-ECB */, + 420 /* AES-128-OFB */, + 913 /* AES-128-XTS */, + 423 /* AES-192-CBC */, + 917 /* AES-192-CBC-HMAC-SHA1 */, + 425 /* AES-192-CFB */, + 651 /* AES-192-CFB1 */, + 654 /* AES-192-CFB8 */, + 905 /* AES-192-CTR */, + 422 /* AES-192-ECB */, + 424 /* AES-192-OFB */, + 427 /* AES-256-CBC */, + 918 /* AES-256-CBC-HMAC-SHA1 */, + 429 /* AES-256-CFB */, + 652 /* AES-256-CFB1 */, + 655 /* AES-256-CFB8 */, + 906 /* AES-256-CTR */, + 426 /* AES-256-ECB */, + 428 /* AES-256-OFB */, + 914 /* AES-256-XTS */, + 958 /* AuthANY */, + 955 /* AuthECDSA */, + 956 /* AuthPSK */, + 954 /* AuthRSA */, + 91 /* BF-CBC */, + 93 /* BF-CFB */, + 92 /* BF-ECB */, + 94 /* BF-OFB */, + 14 /* C */, + 751 /* CAMELLIA-128-CBC */, + 757 /* CAMELLIA-128-CFB */, + 760 /* CAMELLIA-128-CFB1 */, + 763 /* CAMELLIA-128-CFB8 */, + 754 /* CAMELLIA-128-ECB */, + 766 /* CAMELLIA-128-OFB */, + 752 /* CAMELLIA-192-CBC */, + 758 /* CAMELLIA-192-CFB */, + 761 /* CAMELLIA-192-CFB1 */, + 764 /* CAMELLIA-192-CFB8 */, + 755 /* CAMELLIA-192-ECB */, + 767 /* CAMELLIA-192-OFB */, + 753 /* CAMELLIA-256-CBC */, + 759 /* CAMELLIA-256-CFB */, + 762 /* CAMELLIA-256-CFB1 */, + 765 /* CAMELLIA-256-CFB8 */, + 756 /* CAMELLIA-256-ECB */, + 768 /* CAMELLIA-256-OFB */, + 108 /* CAST5-CBC */, + 110 /* CAST5-CFB */, + 109 /* CAST5-ECB */, + 111 /* CAST5-OFB */, + 959 /* CECPQ2 */, + 894 /* CMAC */, + 13 /* CN */, + 141 /* CRLReason */, + 417 /* CSPName */, + 950 /* ChaCha20-Poly1305 */, + 367 /* CrlID */, + 391 /* DC */, + 31 /* DES-CBC */, + 643 /* DES-CDMF */, + 30 /* DES-CFB */, + 656 /* DES-CFB1 */, + 657 /* DES-CFB8 */, + 29 /* DES-ECB */, + 32 /* DES-EDE */, + 43 /* DES-EDE-CBC */, + 60 /* DES-EDE-CFB */, + 62 /* DES-EDE-OFB */, + 33 /* DES-EDE3 */, + 44 /* DES-EDE3-CBC */, + 61 /* DES-EDE3-CFB */, + 658 /* DES-EDE3-CFB1 */, + 659 /* DES-EDE3-CFB8 */, + 63 /* DES-EDE3-OFB */, + 45 /* DES-OFB */, + 80 /* DESX-CBC */, + 380 /* DOD */, + 116 /* DSA */, + 66 /* DSA-SHA */, + 113 /* DSA-SHA1 */, + 70 /* DSA-SHA1-old */, + 67 /* DSA-old */, + 297 /* DVCS */, + 949 /* ED25519 */, + 960 /* ED448 */, + 99 /* GN */, + 855 /* HMAC */, + 780 /* HMAC-MD5 */, + 781 /* HMAC-SHA1 */, + 381 /* IANA */, + 34 /* IDEA-CBC */, + 35 /* IDEA-CFB */, + 36 /* IDEA-ECB */, + 46 /* IDEA-OFB */, + 181 /* ISO */, + 183 /* ISO-US */, + 645 /* ITU-T */, + 646 /* JOINT-ISO-ITU-T */, + 773 /* KISA */, + 957 /* KxANY */, + 952 /* KxECDHE */, + 953 /* KxPSK */, + 951 /* KxRSA */, + 15 /* L */, + 856 /* LocalKeySet */, + 3 /* MD2 */, + 257 /* MD4 */, + 4 /* MD5 */, + 114 /* MD5-SHA1 */, + 95 /* MDC2 */, + 911 /* MGF1 */, + 388 /* Mail */, + 57 /* Netscape */, + 366 /* Nonce */, + 17 /* O */, + 178 /* OCSP */, + 180 /* OCSPSigning */, + 379 /* ORG */, + 18 /* OU */, + 749 /* Oakley-EC2N-3 */, + 750 /* Oakley-EC2N-4 */, + 9 /* PBE-MD2-DES */, + 168 /* PBE-MD2-RC2-64 */, + 10 /* PBE-MD5-DES */, + 169 /* PBE-MD5-RC2-64 */, + 147 /* PBE-SHA1-2DES */, + 146 /* PBE-SHA1-3DES */, + 170 /* PBE-SHA1-DES */, + 148 /* PBE-SHA1-RC2-128 */, + 149 /* PBE-SHA1-RC2-40 */, + 68 /* PBE-SHA1-RC2-64 */, + 144 /* PBE-SHA1-RC4-128 */, + 145 /* PBE-SHA1-RC4-40 */, + 161 /* PBES2 */, + 69 /* PBKDF2 */, + 162 /* PBMAC1 */, + 127 /* PKIX */, + 935 /* PSPECIFIED */, + 98 /* RC2-40-CBC */, + 166 /* RC2-64-CBC */, + 37 /* RC2-CBC */, + 39 /* RC2-CFB */, + 38 /* RC2-ECB */, + 40 /* RC2-OFB */, + 5 /* RC4 */, + 97 /* RC4-40 */, + 915 /* RC4-HMAC-MD5 */, + 120 /* RC5-CBC */, + 122 /* RC5-CFB */, + 121 /* RC5-ECB */, + 123 /* RC5-OFB */, + 117 /* RIPEMD160 */, + 19 /* RSA */, + 7 /* RSA-MD2 */, + 396 /* RSA-MD4 */, + 8 /* RSA-MD5 */, + 96 /* RSA-MDC2 */, + 104 /* RSA-NP-MD5 */, + 119 /* RSA-RIPEMD160 */, + 42 /* RSA-SHA */, + 65 /* RSA-SHA1 */, + 115 /* RSA-SHA1-2 */, + 671 /* RSA-SHA224 */, + 668 /* RSA-SHA256 */, + 669 /* RSA-SHA384 */, + 670 /* RSA-SHA512 */, + 919 /* RSAES-OAEP */, + 912 /* RSASSA-PSS */, + 777 /* SEED-CBC */, + 779 /* SEED-CFB */, + 776 /* SEED-ECB */, + 778 /* SEED-OFB */, + 41 /* SHA */, + 64 /* SHA1 */, + 675 /* SHA224 */, + 672 /* SHA256 */, + 673 /* SHA384 */, + 674 /* SHA512 */, + 188 /* SMIME */, + 167 /* SMIME-CAPS */, + 100 /* SN */, + 16 /* ST */, + 143 /* SXNetID */, + 458 /* UID */, + 0 /* UNDEF */, + 948 /* X25519 */, + 961 /* X448 */, + 11 /* X500 */, + 378 /* X500algorithms */, + 12 /* X509 */, + 184 /* X9-57 */, + 185 /* X9cm */, + 125 /* ZLIB */, + 478 /* aRecord */, + 289 /* aaControls */, + 287 /* ac-auditEntity */, + 397 /* ac-proxying */, + 288 /* ac-targeting */, + 368 /* acceptableResponses */, + 446 /* account */, + 363 /* ad_timestamping */, + 376 /* algorithm */, + 405 /* ansi-X9-62 */, + 910 /* anyExtendedKeyUsage */, + 746 /* anyPolicy */, + 370 /* archiveCutoff */, + 484 /* associatedDomain */, + 485 /* associatedName */, + 501 /* audio */, + 177 /* authorityInfoAccess */, + 90 /* authorityKeyIdentifier */, + 882 /* authorityRevocationList */, + 87 /* basicConstraints */, + 365 /* basicOCSPResponse */, + 285 /* biometricInfo */, + 921 /* brainpoolP160r1 */, + 922 /* brainpoolP160t1 */, + 923 /* brainpoolP192r1 */, + 924 /* brainpoolP192t1 */, + 925 /* brainpoolP224r1 */, + 926 /* brainpoolP224t1 */, + 927 /* brainpoolP256r1 */, + 928 /* brainpoolP256t1 */, + 929 /* brainpoolP320r1 */, + 930 /* brainpoolP320t1 */, + 931 /* brainpoolP384r1 */, + 932 /* brainpoolP384t1 */, + 933 /* brainpoolP512r1 */, + 934 /* brainpoolP512t1 */, + 494 /* buildingName */, + 860 /* businessCategory */, + 691 /* c2onb191v4 */, + 692 /* c2onb191v5 */, + 697 /* c2onb239v4 */, + 698 /* c2onb239v5 */, + 684 /* c2pnb163v1 */, + 685 /* c2pnb163v2 */, + 686 /* c2pnb163v3 */, + 687 /* c2pnb176v1 */, + 693 /* c2pnb208w1 */, + 699 /* c2pnb272w1 */, + 700 /* c2pnb304w1 */, + 702 /* c2pnb368w1 */, + 688 /* c2tnb191v1 */, + 689 /* c2tnb191v2 */, + 690 /* c2tnb191v3 */, + 694 /* c2tnb239v1 */, + 695 /* c2tnb239v2 */, + 696 /* c2tnb239v3 */, + 701 /* c2tnb359v1 */, + 703 /* c2tnb431r1 */, + 881 /* cACertificate */, + 483 /* cNAMERecord */, + 179 /* caIssuers */, + 785 /* caRepository */, + 443 /* caseIgnoreIA5StringSyntax */, + 152 /* certBag */, + 677 /* certicom-arc */, + 771 /* certificateIssuer */, + 89 /* certificatePolicies */, + 883 /* certificateRevocationList */, + 54 /* challengePassword */, + 407 /* characteristic-two-field */, + 395 /* clearance */, + 130 /* clientAuth */, + 131 /* codeSigning */, + 50 /* contentType */, + 53 /* countersignature */, + 153 /* crlBag */, + 103 /* crlDistributionPoints */, + 88 /* crlNumber */, + 884 /* crossCertificatePair */, + 806 /* cryptocom */, + 805 /* cryptopro */, + 500 /* dITRedirect */, + 451 /* dNSDomain */, + 495 /* dSAQuality */, + 434 /* data */, + 390 /* dcobject */, + 140 /* deltaCRL */, + 891 /* deltaRevocationList */, + 107 /* description */, + 871 /* destinationIndicator */, + 947 /* dh-cofactor-kdf */, + 946 /* dh-std-kdf */, + 28 /* dhKeyAgreement */, + 941 /* dhSinglePass-cofactorDH-sha1kdf-scheme */, + 942 /* dhSinglePass-cofactorDH-sha224kdf-scheme */, + 943 /* dhSinglePass-cofactorDH-sha256kdf-scheme */, + 944 /* dhSinglePass-cofactorDH-sha384kdf-scheme */, + 945 /* dhSinglePass-cofactorDH-sha512kdf-scheme */, + 936 /* dhSinglePass-stdDH-sha1kdf-scheme */, + 937 /* dhSinglePass-stdDH-sha224kdf-scheme */, + 938 /* dhSinglePass-stdDH-sha256kdf-scheme */, + 939 /* dhSinglePass-stdDH-sha384kdf-scheme */, + 940 /* dhSinglePass-stdDH-sha512kdf-scheme */, + 920 /* dhpublicnumber */, + 382 /* directory */, + 887 /* distinguishedName */, + 892 /* dmdName */, + 174 /* dnQualifier */, + 447 /* document */, + 471 /* documentAuthor */, + 468 /* documentIdentifier */, + 472 /* documentLocation */, + 502 /* documentPublisher */, + 449 /* documentSeries */, + 469 /* documentTitle */, + 470 /* documentVersion */, + 392 /* domain */, + 452 /* domainRelatedObject */, + 802 /* dsa_with_SHA224 */, + 803 /* dsa_with_SHA256 */, + 791 /* ecdsa-with-Recommended */, + 416 /* ecdsa-with-SHA1 */, + 793 /* ecdsa-with-SHA224 */, + 794 /* ecdsa-with-SHA256 */, + 795 /* ecdsa-with-SHA384 */, + 796 /* ecdsa-with-SHA512 */, + 792 /* ecdsa-with-Specified */, + 48 /* emailAddress */, + 132 /* emailProtection */, + 885 /* enhancedSearchGuide */, + 389 /* enterprises */, + 384 /* experimental */, + 172 /* extReq */, + 56 /* extendedCertificateAttributes */, + 126 /* extendedKeyUsage */, + 372 /* extendedStatus */, + 867 /* facsimileTelephoneNumber */, + 462 /* favouriteDrink */, + 857 /* freshestCRL */, + 453 /* friendlyCountry */, + 490 /* friendlyCountryName */, + 156 /* friendlyName */, + 509 /* generationQualifier */, + 815 /* gost-mac */, + 811 /* gost2001 */, + 851 /* gost2001cc */, + 813 /* gost89 */, + 814 /* gost89-cnt */, + 812 /* gost94 */, + 850 /* gost94cc */, + 797 /* hmacWithMD5 */, + 163 /* hmacWithSHA1 */, + 798 /* hmacWithSHA224 */, + 799 /* hmacWithSHA256 */, + 800 /* hmacWithSHA384 */, + 801 /* hmacWithSHA512 */, + 432 /* holdInstructionCallIssuer */, + 430 /* holdInstructionCode */, + 431 /* holdInstructionNone */, + 433 /* holdInstructionReject */, + 486 /* homePostalAddress */, + 473 /* homeTelephoneNumber */, + 466 /* host */, + 889 /* houseIdentifier */, + 442 /* iA5StringSyntax */, + 783 /* id-DHBasedMac */, + 824 /* id-Gost28147-89-CryptoPro-A-ParamSet */, + 825 /* id-Gost28147-89-CryptoPro-B-ParamSet */, + 826 /* id-Gost28147-89-CryptoPro-C-ParamSet */, + 827 /* id-Gost28147-89-CryptoPro-D-ParamSet */, + 819 /* id-Gost28147-89-CryptoPro-KeyMeshing */, + 829 /* id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet */, + 828 /* id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet */, + 830 /* id-Gost28147-89-CryptoPro-RIC-1-ParamSet */, + 820 /* id-Gost28147-89-None-KeyMeshing */, + 823 /* id-Gost28147-89-TestParamSet */, + 849 /* id-Gost28147-89-cc */, + 840 /* id-GostR3410-2001-CryptoPro-A-ParamSet */, + 841 /* id-GostR3410-2001-CryptoPro-B-ParamSet */, + 842 /* id-GostR3410-2001-CryptoPro-C-ParamSet */, + 843 /* id-GostR3410-2001-CryptoPro-XchA-ParamSet */, + 844 /* id-GostR3410-2001-CryptoPro-XchB-ParamSet */, + 854 /* id-GostR3410-2001-ParamSet-cc */, + 839 /* id-GostR3410-2001-TestParamSet */, + 817 /* id-GostR3410-2001DH */, + 832 /* id-GostR3410-94-CryptoPro-A-ParamSet */, + 833 /* id-GostR3410-94-CryptoPro-B-ParamSet */, + 834 /* id-GostR3410-94-CryptoPro-C-ParamSet */, + 835 /* id-GostR3410-94-CryptoPro-D-ParamSet */, + 836 /* id-GostR3410-94-CryptoPro-XchA-ParamSet */, + 837 /* id-GostR3410-94-CryptoPro-XchB-ParamSet */, + 838 /* id-GostR3410-94-CryptoPro-XchC-ParamSet */, + 831 /* id-GostR3410-94-TestParamSet */, + 845 /* id-GostR3410-94-a */, + 846 /* id-GostR3410-94-aBis */, + 847 /* id-GostR3410-94-b */, + 848 /* id-GostR3410-94-bBis */, + 818 /* id-GostR3410-94DH */, + 822 /* id-GostR3411-94-CryptoProParamSet */, + 821 /* id-GostR3411-94-TestParamSet */, + 807 /* id-GostR3411-94-with-GostR3410-2001 */, + 853 /* id-GostR3411-94-with-GostR3410-2001-cc */, + 808 /* id-GostR3411-94-with-GostR3410-94 */, + 852 /* id-GostR3411-94-with-GostR3410-94-cc */, + 810 /* id-HMACGostR3411-94 */, + 782 /* id-PasswordBasedMAC */, + 266 /* id-aca */, + 355 /* id-aca-accessIdentity */, + 354 /* id-aca-authenticationInfo */, + 356 /* id-aca-chargingIdentity */, + 399 /* id-aca-encAttrs */, + 357 /* id-aca-group */, + 358 /* id-aca-role */, + 176 /* id-ad */, + 896 /* id-aes128-CCM */, + 895 /* id-aes128-GCM */, + 788 /* id-aes128-wrap */, + 897 /* id-aes128-wrap-pad */, + 899 /* id-aes192-CCM */, + 898 /* id-aes192-GCM */, + 789 /* id-aes192-wrap */, + 900 /* id-aes192-wrap-pad */, + 902 /* id-aes256-CCM */, + 901 /* id-aes256-GCM */, + 790 /* id-aes256-wrap */, + 903 /* id-aes256-wrap-pad */, + 262 /* id-alg */, + 893 /* id-alg-PWRI-KEK */, + 323 /* id-alg-des40 */, + 326 /* id-alg-dh-pop */, + 325 /* id-alg-dh-sig-hmac-sha1 */, + 324 /* id-alg-noSignature */, + 907 /* id-camellia128-wrap */, + 908 /* id-camellia192-wrap */, + 909 /* id-camellia256-wrap */, + 268 /* id-cct */, + 361 /* id-cct-PKIData */, + 362 /* id-cct-PKIResponse */, + 360 /* id-cct-crs */, + 81 /* id-ce */, + 680 /* id-characteristic-two-basis */, + 263 /* id-cmc */, + 334 /* id-cmc-addExtensions */, + 346 /* id-cmc-confirmCertAcceptance */, + 330 /* id-cmc-dataReturn */, + 336 /* id-cmc-decryptedPOP */, + 335 /* id-cmc-encryptedPOP */, + 339 /* id-cmc-getCRL */, + 338 /* id-cmc-getCert */, + 328 /* id-cmc-identification */, + 329 /* id-cmc-identityProof */, + 337 /* id-cmc-lraPOPWitness */, + 344 /* id-cmc-popLinkRandom */, + 345 /* id-cmc-popLinkWitness */, + 343 /* id-cmc-queryPending */, + 333 /* id-cmc-recipientNonce */, + 341 /* id-cmc-regInfo */, + 342 /* id-cmc-responseInfo */, + 340 /* id-cmc-revokeRequest */, + 332 /* id-cmc-senderNonce */, + 327 /* id-cmc-statusInfo */, + 331 /* id-cmc-transactionId */, + 787 /* id-ct-asciiTextWithCRLF */, + 408 /* id-ecPublicKey */, + 508 /* id-hex-multipart-message */, + 507 /* id-hex-partial-message */, + 260 /* id-it */, + 302 /* id-it-caKeyUpdateInfo */, + 298 /* id-it-caProtEncCert */, + 311 /* id-it-confirmWaitTime */, + 303 /* id-it-currentCRL */, + 300 /* id-it-encKeyPairTypes */, + 310 /* id-it-implicitConfirm */, + 308 /* id-it-keyPairParamRep */, + 307 /* id-it-keyPairParamReq */, + 312 /* id-it-origPKIMessage */, + 301 /* id-it-preferredSymmAlg */, + 309 /* id-it-revPassphrase */, + 299 /* id-it-signKeyPairTypes */, + 305 /* id-it-subscriptionRequest */, + 306 /* id-it-subscriptionResponse */, + 784 /* id-it-suppLangTags */, + 304 /* id-it-unsupportedOIDs */, + 128 /* id-kp */, + 280 /* id-mod-attribute-cert */, + 274 /* id-mod-cmc */, + 277 /* id-mod-cmp */, + 284 /* id-mod-cmp2000 */, + 273 /* id-mod-crmf */, + 283 /* id-mod-dvcs */, + 275 /* id-mod-kea-profile-88 */, + 276 /* id-mod-kea-profile-93 */, + 282 /* id-mod-ocsp */, + 278 /* id-mod-qualified-cert-88 */, + 279 /* id-mod-qualified-cert-93 */, + 281 /* id-mod-timestamp-protocol */, + 264 /* id-on */, + 858 /* id-on-permanentIdentifier */, + 347 /* id-on-personalData */, + 265 /* id-pda */, + 352 /* id-pda-countryOfCitizenship */, + 353 /* id-pda-countryOfResidence */, + 348 /* id-pda-dateOfBirth */, + 351 /* id-pda-gender */, + 349 /* id-pda-placeOfBirth */, + 175 /* id-pe */, + 261 /* id-pkip */, + 258 /* id-pkix-mod */, + 269 /* id-pkix1-explicit-88 */, + 271 /* id-pkix1-explicit-93 */, + 270 /* id-pkix1-implicit-88 */, + 272 /* id-pkix1-implicit-93 */, + 662 /* id-ppl */, + 664 /* id-ppl-anyLanguage */, + 667 /* id-ppl-independent */, + 665 /* id-ppl-inheritAll */, + 267 /* id-qcs */, + 359 /* id-qcs-pkixQCSyntax-v1 */, + 259 /* id-qt */, + 164 /* id-qt-cps */, + 165 /* id-qt-unotice */, + 313 /* id-regCtrl */, + 316 /* id-regCtrl-authenticator */, + 319 /* id-regCtrl-oldCertID */, + 318 /* id-regCtrl-pkiArchiveOptions */, + 317 /* id-regCtrl-pkiPublicationInfo */, + 320 /* id-regCtrl-protocolEncrKey */, + 315 /* id-regCtrl-regToken */, + 314 /* id-regInfo */, + 322 /* id-regInfo-certReq */, + 321 /* id-regInfo-utf8Pairs */, + 512 /* id-set */, + 191 /* id-smime-aa */, + 215 /* id-smime-aa-contentHint */, + 218 /* id-smime-aa-contentIdentifier */, + 221 /* id-smime-aa-contentReference */, + 240 /* id-smime-aa-dvcs-dvc */, + 217 /* id-smime-aa-encapContentType */, + 222 /* id-smime-aa-encrypKeyPref */, + 220 /* id-smime-aa-equivalentLabels */, + 232 /* id-smime-aa-ets-CertificateRefs */, + 233 /* id-smime-aa-ets-RevocationRefs */, + 238 /* id-smime-aa-ets-archiveTimeStamp */, + 237 /* id-smime-aa-ets-certCRLTimestamp */, + 234 /* id-smime-aa-ets-certValues */, + 227 /* id-smime-aa-ets-commitmentType */, + 231 /* id-smime-aa-ets-contentTimestamp */, + 236 /* id-smime-aa-ets-escTimeStamp */, + 230 /* id-smime-aa-ets-otherSigCert */, + 235 /* id-smime-aa-ets-revocationValues */, + 226 /* id-smime-aa-ets-sigPolicyId */, + 229 /* id-smime-aa-ets-signerAttr */, + 228 /* id-smime-aa-ets-signerLocation */, + 219 /* id-smime-aa-macValue */, + 214 /* id-smime-aa-mlExpandHistory */, + 216 /* id-smime-aa-msgSigDigest */, + 212 /* id-smime-aa-receiptRequest */, + 213 /* id-smime-aa-securityLabel */, + 239 /* id-smime-aa-signatureType */, + 223 /* id-smime-aa-signingCertificate */, + 224 /* id-smime-aa-smimeEncryptCerts */, + 225 /* id-smime-aa-timeStampToken */, + 192 /* id-smime-alg */, + 243 /* id-smime-alg-3DESwrap */, + 246 /* id-smime-alg-CMS3DESwrap */, + 247 /* id-smime-alg-CMSRC2wrap */, + 245 /* id-smime-alg-ESDH */, + 241 /* id-smime-alg-ESDHwith3DES */, + 242 /* id-smime-alg-ESDHwithRC2 */, + 244 /* id-smime-alg-RC2wrap */, + 193 /* id-smime-cd */, + 248 /* id-smime-cd-ldap */, + 190 /* id-smime-ct */, + 210 /* id-smime-ct-DVCSRequestData */, + 211 /* id-smime-ct-DVCSResponseData */, + 208 /* id-smime-ct-TDTInfo */, + 207 /* id-smime-ct-TSTInfo */, + 205 /* id-smime-ct-authData */, + 786 /* id-smime-ct-compressedData */, + 209 /* id-smime-ct-contentInfo */, + 206 /* id-smime-ct-publishCert */, + 204 /* id-smime-ct-receipt */, + 195 /* id-smime-cti */, + 255 /* id-smime-cti-ets-proofOfApproval */, + 256 /* id-smime-cti-ets-proofOfCreation */, + 253 /* id-smime-cti-ets-proofOfDelivery */, + 251 /* id-smime-cti-ets-proofOfOrigin */, + 252 /* id-smime-cti-ets-proofOfReceipt */, + 254 /* id-smime-cti-ets-proofOfSender */, + 189 /* id-smime-mod */, + 196 /* id-smime-mod-cms */, + 197 /* id-smime-mod-ess */, + 202 /* id-smime-mod-ets-eSigPolicy-88 */, + 203 /* id-smime-mod-ets-eSigPolicy-97 */, + 200 /* id-smime-mod-ets-eSignature-88 */, + 201 /* id-smime-mod-ets-eSignature-97 */, + 199 /* id-smime-mod-msg-v3 */, + 198 /* id-smime-mod-oid */, + 194 /* id-smime-spq */, + 250 /* id-smime-spq-ets-sqt-unotice */, + 249 /* id-smime-spq-ets-sqt-uri */, + 676 /* identified-organization */, + 461 /* info */, + 748 /* inhibitAnyPolicy */, + 101 /* initials */, + 647 /* international-organizations */, + 869 /* internationaliSDNNumber */, + 142 /* invalidityDate */, + 294 /* ipsecEndSystem */, + 295 /* ipsecTunnel */, + 296 /* ipsecUser */, + 86 /* issuerAltName */, + 770 /* issuingDistributionPoint */, + 492 /* janetMailbox */, + 150 /* keyBag */, + 83 /* keyUsage */, + 477 /* lastModifiedBy */, + 476 /* lastModifiedTime */, + 157 /* localKeyID */, + 480 /* mXRecord */, + 460 /* mail */, + 493 /* mailPreferenceOption */, + 467 /* manager */, + 809 /* md_gost94 */, + 875 /* member */, + 182 /* member-body */, + 51 /* messageDigest */, + 383 /* mgmt */, + 504 /* mime-mhs */, + 506 /* mime-mhs-bodies */, + 505 /* mime-mhs-headings */, + 488 /* mobileTelephoneNumber */, + 136 /* msCTLSign */, + 135 /* msCodeCom */, + 134 /* msCodeInd */, + 138 /* msEFS */, + 171 /* msExtReq */, + 137 /* msSGC */, + 648 /* msSmartcardLogin */, + 649 /* msUPN */, + 481 /* nSRecord */, + 173 /* name */, + 666 /* nameConstraints */, + 369 /* noCheck */, + 403 /* noRevAvail */, + 72 /* nsBaseUrl */, + 76 /* nsCaPolicyUrl */, + 74 /* nsCaRevocationUrl */, + 58 /* nsCertExt */, + 79 /* nsCertSequence */, + 71 /* nsCertType */, + 78 /* nsComment */, + 59 /* nsDataType */, + 75 /* nsRenewalUrl */, + 73 /* nsRevocationUrl */, + 139 /* nsSGC */, + 77 /* nsSslServerName */, + 681 /* onBasis */, + 491 /* organizationalStatus */, + 475 /* otherMailbox */, + 876 /* owner */, + 489 /* pagerTelephoneNumber */, + 374 /* path */, + 112 /* pbeWithMD5AndCast5CBC */, + 499 /* personalSignature */, + 487 /* personalTitle */, + 464 /* photo */, + 863 /* physicalDeliveryOfficeName */, + 437 /* pilot */, + 439 /* pilotAttributeSyntax */, + 438 /* pilotAttributeType */, + 479 /* pilotAttributeType27 */, + 456 /* pilotDSA */, + 441 /* pilotGroups */, + 444 /* pilotObject */, + 440 /* pilotObjectClass */, + 455 /* pilotOrganization */, + 445 /* pilotPerson */, + 2 /* pkcs */, + 186 /* pkcs1 */, + 27 /* pkcs3 */, + 187 /* pkcs5 */, + 20 /* pkcs7 */, + 21 /* pkcs7-data */, + 25 /* pkcs7-digestData */, + 26 /* pkcs7-encryptedData */, + 23 /* pkcs7-envelopedData */, + 24 /* pkcs7-signedAndEnvelopedData */, + 22 /* pkcs7-signedData */, + 151 /* pkcs8ShroudedKeyBag */, + 47 /* pkcs9 */, + 401 /* policyConstraints */, + 747 /* policyMappings */, + 862 /* postOfficeBox */, + 861 /* postalAddress */, + 661 /* postalCode */, + 683 /* ppBasis */, + 872 /* preferredDeliveryMethod */, + 873 /* presentationAddress */, + 816 /* prf-gostr3411-94 */, + 406 /* prime-field */, + 409 /* prime192v1 */, + 410 /* prime192v2 */, + 411 /* prime192v3 */, + 412 /* prime239v1 */, + 413 /* prime239v2 */, + 414 /* prime239v3 */, + 415 /* prime256v1 */, + 385 /* private */, + 84 /* privateKeyUsagePeriod */, + 886 /* protocolInformation */, + 663 /* proxyCertInfo */, + 510 /* pseudonym */, + 435 /* pss */, + 286 /* qcStatements */, + 457 /* qualityLabelledData */, + 450 /* rFC822localPart */, + 870 /* registeredAddress */, + 400 /* role */, + 877 /* roleOccupant */, + 448 /* room */, + 463 /* roomNumber */, + 6 /* rsaEncryption */, + 644 /* rsaOAEPEncryptionSET */, + 377 /* rsaSignature */, + 1 /* rsadsi */, + 482 /* sOARecord */, + 155 /* safeContentsBag */, + 291 /* sbgp-autonomousSysNum */, + 290 /* sbgp-ipAddrBlock */, + 292 /* sbgp-routerIdentifier */, + 159 /* sdsiCertificate */, + 859 /* searchGuide */, + 704 /* secp112r1 */, + 705 /* secp112r2 */, + 706 /* secp128r1 */, + 707 /* secp128r2 */, + 708 /* secp160k1 */, + 709 /* secp160r1 */, + 710 /* secp160r2 */, + 711 /* secp192k1 */, + 712 /* secp224k1 */, + 713 /* secp224r1 */, + 714 /* secp256k1 */, + 715 /* secp384r1 */, + 716 /* secp521r1 */, + 154 /* secretBag */, + 474 /* secretary */, + 717 /* sect113r1 */, + 718 /* sect113r2 */, + 719 /* sect131r1 */, + 720 /* sect131r2 */, + 721 /* sect163k1 */, + 722 /* sect163r1 */, + 723 /* sect163r2 */, + 724 /* sect193r1 */, + 725 /* sect193r2 */, + 726 /* sect233k1 */, + 727 /* sect233r1 */, + 728 /* sect239k1 */, + 729 /* sect283k1 */, + 730 /* sect283r1 */, + 731 /* sect409k1 */, + 732 /* sect409r1 */, + 733 /* sect571k1 */, + 734 /* sect571r1 */, + 386 /* security */, + 878 /* seeAlso */, + 394 /* selected-attribute-types */, + 105 /* serialNumber */, + 129 /* serverAuth */, + 371 /* serviceLocator */, + 625 /* set-addPolicy */, + 515 /* set-attr */, + 518 /* set-brand */, + 638 /* set-brand-AmericanExpress */, + 637 /* set-brand-Diners */, + 636 /* set-brand-IATA-ATA */, + 639 /* set-brand-JCB */, + 641 /* set-brand-MasterCard */, + 642 /* set-brand-Novus */, + 640 /* set-brand-Visa */, + 517 /* set-certExt */, + 513 /* set-ctype */, + 514 /* set-msgExt */, + 516 /* set-policy */, + 607 /* set-policy-root */, + 624 /* set-rootKeyThumb */, + 620 /* setAttr-Cert */, + 631 /* setAttr-GenCryptgrm */, + 623 /* setAttr-IssCap */, + 628 /* setAttr-IssCap-CVM */, + 630 /* setAttr-IssCap-Sig */, + 629 /* setAttr-IssCap-T2 */, + 621 /* setAttr-PGWYcap */, + 635 /* setAttr-SecDevSig */, + 632 /* setAttr-T2Enc */, + 633 /* setAttr-T2cleartxt */, + 634 /* setAttr-TokICCsig */, + 627 /* setAttr-Token-B0Prime */, + 626 /* setAttr-Token-EMV */, + 622 /* setAttr-TokenType */, + 619 /* setCext-IssuerCapabilities */, + 615 /* setCext-PGWYcapabilities */, + 616 /* setCext-TokenIdentifier */, + 618 /* setCext-TokenType */, + 617 /* setCext-Track2Data */, + 611 /* setCext-cCertRequired */, + 609 /* setCext-certType */, + 608 /* setCext-hashedRoot */, + 610 /* setCext-merchData */, + 613 /* setCext-setExt */, + 614 /* setCext-setQualf */, + 612 /* setCext-tunneling */, + 540 /* setct-AcqCardCodeMsg */, + 576 /* setct-AcqCardCodeMsgTBE */, + 570 /* setct-AuthReqTBE */, + 534 /* setct-AuthReqTBS */, + 527 /* setct-AuthResBaggage */, + 571 /* setct-AuthResTBE */, + 572 /* setct-AuthResTBEX */, + 535 /* setct-AuthResTBS */, + 536 /* setct-AuthResTBSX */, + 528 /* setct-AuthRevReqBaggage */, + 577 /* setct-AuthRevReqTBE */, + 541 /* setct-AuthRevReqTBS */, + 529 /* setct-AuthRevResBaggage */, + 542 /* setct-AuthRevResData */, + 578 /* setct-AuthRevResTBE */, + 579 /* setct-AuthRevResTBEB */, + 543 /* setct-AuthRevResTBS */, + 573 /* setct-AuthTokenTBE */, + 537 /* setct-AuthTokenTBS */, + 600 /* setct-BCIDistributionTBS */, + 558 /* setct-BatchAdminReqData */, + 592 /* setct-BatchAdminReqTBE */, + 559 /* setct-BatchAdminResData */, + 593 /* setct-BatchAdminResTBE */, + 599 /* setct-CRLNotificationResTBS */, + 598 /* setct-CRLNotificationTBS */, + 580 /* setct-CapReqTBE */, + 581 /* setct-CapReqTBEX */, + 544 /* setct-CapReqTBS */, + 545 /* setct-CapReqTBSX */, + 546 /* setct-CapResData */, + 582 /* setct-CapResTBE */, + 583 /* setct-CapRevReqTBE */, + 584 /* setct-CapRevReqTBEX */, + 547 /* setct-CapRevReqTBS */, + 548 /* setct-CapRevReqTBSX */, + 549 /* setct-CapRevResData */, + 585 /* setct-CapRevResTBE */, + 538 /* setct-CapTokenData */, + 530 /* setct-CapTokenSeq */, + 574 /* setct-CapTokenTBE */, + 575 /* setct-CapTokenTBEX */, + 539 /* setct-CapTokenTBS */, + 560 /* setct-CardCInitResTBS */, + 566 /* setct-CertInqReqTBS */, + 563 /* setct-CertReqData */, + 595 /* setct-CertReqTBE */, + 596 /* setct-CertReqTBEX */, + 564 /* setct-CertReqTBS */, + 565 /* setct-CertResData */, + 597 /* setct-CertResTBE */, + 586 /* setct-CredReqTBE */, + 587 /* setct-CredReqTBEX */, + 550 /* setct-CredReqTBS */, + 551 /* setct-CredReqTBSX */, + 552 /* setct-CredResData */, + 588 /* setct-CredResTBE */, + 589 /* setct-CredRevReqTBE */, + 590 /* setct-CredRevReqTBEX */, + 553 /* setct-CredRevReqTBS */, + 554 /* setct-CredRevReqTBSX */, + 555 /* setct-CredRevResData */, + 591 /* setct-CredRevResTBE */, + 567 /* setct-ErrorTBS */, + 526 /* setct-HODInput */, + 561 /* setct-MeAqCInitResTBS */, + 522 /* setct-OIData */, + 519 /* setct-PANData */, + 521 /* setct-PANOnly */, + 520 /* setct-PANToken */, + 556 /* setct-PCertReqData */, + 557 /* setct-PCertResTBS */, + 523 /* setct-PI */, + 532 /* setct-PI-TBS */, + 524 /* setct-PIData */, + 525 /* setct-PIDataUnsigned */, + 568 /* setct-PIDualSignedTBE */, + 569 /* setct-PIUnsignedTBE */, + 531 /* setct-PInitResData */, + 533 /* setct-PResData */, + 594 /* setct-RegFormReqTBE */, + 562 /* setct-RegFormResTBS */, + 606 /* setext-cv */, + 601 /* setext-genCrypt */, + 602 /* setext-miAuth */, + 604 /* setext-pinAny */, + 603 /* setext-pinSecure */, + 605 /* setext-track2 */, + 52 /* signingTime */, + 454 /* simpleSecurityObject */, + 496 /* singleLevelQuality */, + 387 /* snmpv2 */, + 660 /* street */, + 85 /* subjectAltName */, + 769 /* subjectDirectoryAttributes */, + 398 /* subjectInfoAccess */, + 82 /* subjectKeyIdentifier */, + 498 /* subtreeMaximumQuality */, + 497 /* subtreeMinimumQuality */, + 890 /* supportedAlgorithms */, + 874 /* supportedApplicationContext */, + 402 /* targetInformation */, + 864 /* telephoneNumber */, + 866 /* teletexTerminalIdentifier */, + 865 /* telexNumber */, + 459 /* textEncodedORAddress */, + 293 /* textNotice */, + 133 /* timeStamping */, + 106 /* title */, + 682 /* tpBasis */, + 375 /* trustRoot */, + 436 /* ucl */, + 888 /* uniqueMember */, + 55 /* unstructuredAddress */, + 49 /* unstructuredName */, + 880 /* userCertificate */, + 465 /* userClass */, + 879 /* userPassword */, + 373 /* valid */, + 678 /* wap */, + 679 /* wap-wsg */, + 735 /* wap-wsg-idm-ecid-wtls1 */, + 743 /* wap-wsg-idm-ecid-wtls10 */, + 744 /* wap-wsg-idm-ecid-wtls11 */, + 745 /* wap-wsg-idm-ecid-wtls12 */, + 736 /* wap-wsg-idm-ecid-wtls3 */, + 737 /* wap-wsg-idm-ecid-wtls4 */, + 738 /* wap-wsg-idm-ecid-wtls5 */, + 739 /* wap-wsg-idm-ecid-wtls6 */, + 740 /* wap-wsg-idm-ecid-wtls7 */, + 741 /* wap-wsg-idm-ecid-wtls8 */, + 742 /* wap-wsg-idm-ecid-wtls9 */, + 804 /* whirlpool */, + 868 /* x121Address */, + 503 /* x500UniqueIdentifier */, + 158 /* x509Certificate */, + 160 /* x509Crl */, +}; + +static const uint16_t kNIDsInLongNameOrder[] = { + 363 /* AD Time Stamping */, + 405 /* ANSI X9.62 */, + 368 /* Acceptable OCSP Responses */, + 910 /* Any Extended Key Usage */, + 664 /* Any language */, + 177 /* Authority Information Access */, + 365 /* Basic OCSP Response */, + 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 */, + 172 /* Extension Request */, + 813 /* GOST 28147-89 */, + 849 /* GOST 28147-89 Cryptocom ParamSet */, + 815 /* GOST 28147-89 MAC */, + 851 /* GOST 34.10-2001 Cryptocom */, + 850 /* GOST 34.10-94 Cryptocom */, + 811 /* GOST R 34.10-2001 */, + 817 /* GOST R 34.10-2001 DH */, + 812 /* GOST R 34.10-94 */, + 818 /* GOST R 34.10-94 DH */, + 809 /* GOST R 34.11-94 */, + 816 /* GOST R 34.11-94 PRF */, + 807 /* GOST R 34.11-94 with GOST R 34.10-2001 */, + 853 /* GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom */, + 808 /* GOST R 34.11-94 with GOST R 34.10-94 */, + 852 /* GOST R 34.11-94 with GOST R 34.10-94 Cryptocom */, + 854 /* GOST R 3410-2001 Parameter Set Cryptocom */, + 810 /* HMAC GOST 34.11-94 */, + 432 /* Hold Instruction Call Issuer */, + 430 /* Hold Instruction Code */, + 431 /* Hold Instruction None */, + 433 /* Hold Instruction Reject */, + 634 /* ICC or token signature */, + 294 /* IPSec End System */, + 295 /* IPSec Tunnel */, + 296 /* IPSec User */, + 182 /* ISO Member Body */, + 183 /* ISO US Member Body */, + 667 /* Independent */, + 665 /* Inherit all */, + 647 /* International Organizations */, + 142 /* Invalidity Date */, + 504 /* MIME MHS */, + 388 /* Mail */, + 383 /* Management */, + 417 /* Microsoft CSP Name */, + 135 /* Microsoft Commercial Code Signing */, + 138 /* Microsoft Encrypted File System */, + 171 /* Microsoft Extension Request */, + 134 /* Microsoft Individual Code Signing */, + 856 /* Microsoft Local Key set */, + 137 /* Microsoft Server Gated Crypto */, + 648 /* Microsoft Smartcardlogin */, + 136 /* Microsoft Trust List Signing */, + 649 /* Microsoft Universal Principal Name */, + 72 /* Netscape Base Url */, + 76 /* Netscape CA Policy Url */, + 74 /* Netscape CA Revocation Url */, + 71 /* Netscape Cert Type */, + 58 /* Netscape Certificate Extension */, + 79 /* Netscape Certificate Sequence */, + 78 /* Netscape Comment */, + 57 /* Netscape Communications Corp. */, + 59 /* Netscape Data Type */, + 75 /* Netscape Renewal Url */, + 73 /* Netscape Revocation Url */, + 77 /* Netscape SSL Server Name */, + 139 /* Netscape Server Gated Crypto */, + 178 /* OCSP */, + 370 /* OCSP Archive Cutoff */, + 367 /* OCSP CRL ID */, + 369 /* OCSP No Check */, + 366 /* OCSP Nonce */, + 371 /* OCSP Service Locator */, + 180 /* OCSP Signing */, + 161 /* PBES2 */, + 69 /* PBKDF2 */, + 162 /* PBMAC1 */, + 127 /* PKIX */, + 858 /* Permanent Identifier */, + 164 /* Policy Qualifier CPS */, + 165 /* Policy Qualifier User Notice */, + 385 /* Private */, + 663 /* Proxy Certificate Information */, + 1 /* RSA Data Security, Inc. */, + 2 /* RSA Data Security, Inc. PKCS */, + 188 /* S/MIME */, + 167 /* S/MIME Capabilities */, + 387 /* SNMPv2 */, + 512 /* Secure Electronic Transactions */, + 386 /* Security */, + 394 /* Selected Attribute Types */, + 143 /* Strong Extranet ID */, + 398 /* Subject Information Access */, + 130 /* TLS Web Client Authentication */, + 129 /* TLS Web Server Authentication */, + 133 /* Time Stamping */, + 375 /* Trust Root */, + 948 /* X25519 */, + 961 /* X448 */, + 12 /* X509 */, + 402 /* X509v3 AC Targeting */, + 746 /* X509v3 Any Policy */, + 90 /* X509v3 Authority Key Identifier */, + 87 /* X509v3 Basic Constraints */, + 103 /* X509v3 CRL Distribution Points */, + 88 /* X509v3 CRL Number */, + 141 /* X509v3 CRL Reason Code */, + 771 /* X509v3 Certificate Issuer */, + 89 /* X509v3 Certificate Policies */, + 140 /* X509v3 Delta CRL Indicator */, + 126 /* X509v3 Extended Key Usage */, + 857 /* X509v3 Freshest CRL */, + 748 /* X509v3 Inhibit Any Policy */, + 86 /* X509v3 Issuer Alternative Name */, + 770 /* X509v3 Issuing Distribution Point */, + 83 /* X509v3 Key Usage */, + 666 /* X509v3 Name Constraints */, + 403 /* X509v3 No Revocation Available */, + 401 /* X509v3 Policy Constraints */, + 747 /* X509v3 Policy Mappings */, + 84 /* X509v3 Private Key Usage Period */, + 85 /* X509v3 Subject Alternative Name */, + 769 /* X509v3 Subject Directory Attributes */, + 82 /* X509v3 Subject Key Identifier */, + 920 /* X9.42 DH */, + 184 /* X9.57 */, + 185 /* X9.57 CM ? */, + 478 /* aRecord */, + 289 /* aaControls */, + 287 /* ac-auditEntity */, + 397 /* ac-proxying */, + 288 /* ac-targeting */, + 446 /* account */, + 364 /* ad dvcs */, + 606 /* additional verification */, + 419 /* aes-128-cbc */, + 916 /* aes-128-cbc-hmac-sha1 */, + 896 /* aes-128-ccm */, + 421 /* aes-128-cfb */, + 650 /* aes-128-cfb1 */, + 653 /* aes-128-cfb8 */, + 904 /* aes-128-ctr */, + 418 /* aes-128-ecb */, + 895 /* aes-128-gcm */, + 420 /* aes-128-ofb */, + 913 /* aes-128-xts */, + 423 /* aes-192-cbc */, + 917 /* aes-192-cbc-hmac-sha1 */, + 899 /* aes-192-ccm */, + 425 /* aes-192-cfb */, + 651 /* aes-192-cfb1 */, + 654 /* aes-192-cfb8 */, + 905 /* aes-192-ctr */, + 422 /* aes-192-ecb */, + 898 /* aes-192-gcm */, + 424 /* aes-192-ofb */, + 427 /* aes-256-cbc */, + 918 /* aes-256-cbc-hmac-sha1 */, + 902 /* aes-256-ccm */, + 429 /* aes-256-cfb */, + 652 /* aes-256-cfb1 */, + 655 /* aes-256-cfb8 */, + 906 /* aes-256-ctr */, + 426 /* aes-256-ecb */, + 901 /* aes-256-gcm */, + 428 /* aes-256-ofb */, + 914 /* aes-256-xts */, + 376 /* algorithm */, + 484 /* associatedDomain */, + 485 /* associatedName */, + 501 /* audio */, + 958 /* auth-any */, + 955 /* auth-ecdsa */, + 956 /* auth-psk */, + 954 /* auth-rsa */, + 882 /* authorityRevocationList */, + 91 /* bf-cbc */, + 93 /* bf-cfb */, + 92 /* bf-ecb */, + 94 /* bf-ofb */, + 921 /* brainpoolP160r1 */, + 922 /* brainpoolP160t1 */, + 923 /* brainpoolP192r1 */, + 924 /* brainpoolP192t1 */, + 925 /* brainpoolP224r1 */, + 926 /* brainpoolP224t1 */, + 927 /* brainpoolP256r1 */, + 928 /* brainpoolP256t1 */, + 929 /* brainpoolP320r1 */, + 930 /* brainpoolP320t1 */, + 931 /* brainpoolP384r1 */, + 932 /* brainpoolP384t1 */, + 933 /* brainpoolP512r1 */, + 934 /* brainpoolP512t1 */, + 494 /* buildingName */, + 860 /* businessCategory */, + 691 /* c2onb191v4 */, + 692 /* c2onb191v5 */, + 697 /* c2onb239v4 */, + 698 /* c2onb239v5 */, + 684 /* c2pnb163v1 */, + 685 /* c2pnb163v2 */, + 686 /* c2pnb163v3 */, + 687 /* c2pnb176v1 */, + 693 /* c2pnb208w1 */, + 699 /* c2pnb272w1 */, + 700 /* c2pnb304w1 */, + 702 /* c2pnb368w1 */, + 688 /* c2tnb191v1 */, + 689 /* c2tnb191v2 */, + 690 /* c2tnb191v3 */, + 694 /* c2tnb239v1 */, + 695 /* c2tnb239v2 */, + 696 /* c2tnb239v3 */, + 701 /* c2tnb359v1 */, + 703 /* c2tnb431r1 */, + 881 /* cACertificate */, + 483 /* cNAMERecord */, + 751 /* camellia-128-cbc */, + 757 /* camellia-128-cfb */, + 760 /* camellia-128-cfb1 */, + 763 /* camellia-128-cfb8 */, + 754 /* camellia-128-ecb */, + 766 /* camellia-128-ofb */, + 752 /* camellia-192-cbc */, + 758 /* camellia-192-cfb */, + 761 /* camellia-192-cfb1 */, + 764 /* camellia-192-cfb8 */, + 755 /* camellia-192-ecb */, + 767 /* camellia-192-ofb */, + 753 /* camellia-256-cbc */, + 759 /* camellia-256-cfb */, + 762 /* camellia-256-cfb1 */, + 765 /* camellia-256-cfb8 */, + 756 /* camellia-256-ecb */, + 768 /* camellia-256-ofb */, + 443 /* caseIgnoreIA5StringSyntax */, + 108 /* cast5-cbc */, + 110 /* cast5-cfb */, + 109 /* cast5-ecb */, + 111 /* cast5-ofb */, + 152 /* certBag */, + 677 /* certicom-arc */, + 517 /* certificate extensions */, + 883 /* certificateRevocationList */, + 950 /* chacha20-poly1305 */, + 54 /* challengePassword */, + 407 /* characteristic-two-field */, + 395 /* clearance */, + 633 /* cleartext track 2 */, + 894 /* cmac */, + 13 /* commonName */, + 513 /* content types */, + 50 /* contentType */, + 53 /* countersignature */, + 14 /* countryName */, + 153 /* crlBag */, + 884 /* crossCertificatePair */, + 806 /* cryptocom */, + 805 /* cryptopro */, + 500 /* dITRedirect */, + 451 /* dNSDomain */, + 495 /* dSAQuality */, + 434 /* data */, + 390 /* dcObject */, + 891 /* deltaRevocationList */, + 31 /* des-cbc */, + 643 /* des-cdmf */, + 30 /* des-cfb */, + 656 /* des-cfb1 */, + 657 /* des-cfb8 */, + 29 /* des-ecb */, + 32 /* des-ede */, + 43 /* des-ede-cbc */, + 60 /* des-ede-cfb */, + 62 /* des-ede-ofb */, + 33 /* des-ede3 */, + 44 /* des-ede3-cbc */, + 61 /* des-ede3-cfb */, + 658 /* des-ede3-cfb1 */, + 659 /* des-ede3-cfb8 */, + 63 /* des-ede3-ofb */, + 45 /* des-ofb */, + 107 /* description */, + 871 /* destinationIndicator */, + 80 /* desx-cbc */, + 947 /* dh-cofactor-kdf */, + 946 /* dh-std-kdf */, + 28 /* dhKeyAgreement */, + 941 /* dhSinglePass-cofactorDH-sha1kdf-scheme */, + 942 /* dhSinglePass-cofactorDH-sha224kdf-scheme */, + 943 /* dhSinglePass-cofactorDH-sha256kdf-scheme */, + 944 /* dhSinglePass-cofactorDH-sha384kdf-scheme */, + 945 /* dhSinglePass-cofactorDH-sha512kdf-scheme */, + 936 /* dhSinglePass-stdDH-sha1kdf-scheme */, + 937 /* dhSinglePass-stdDH-sha224kdf-scheme */, + 938 /* dhSinglePass-stdDH-sha256kdf-scheme */, + 939 /* dhSinglePass-stdDH-sha384kdf-scheme */, + 940 /* dhSinglePass-stdDH-sha512kdf-scheme */, + 11 /* directory services (X.500) */, + 378 /* directory services - algorithms */, + 887 /* distinguishedName */, + 892 /* dmdName */, + 174 /* dnQualifier */, + 447 /* document */, + 471 /* documentAuthor */, + 468 /* documentIdentifier */, + 472 /* documentLocation */, + 502 /* documentPublisher */, + 449 /* documentSeries */, + 469 /* documentTitle */, + 470 /* documentVersion */, + 380 /* dod */, + 391 /* domainComponent */, + 452 /* domainRelatedObject */, + 116 /* dsaEncryption */, + 67 /* dsaEncryption-old */, + 66 /* dsaWithSHA */, + 113 /* dsaWithSHA1 */, + 70 /* dsaWithSHA1-old */, + 802 /* dsa_with_SHA224 */, + 803 /* dsa_with_SHA256 */, + 297 /* dvcs */, + 791 /* ecdsa-with-Recommended */, + 416 /* ecdsa-with-SHA1 */, + 793 /* ecdsa-with-SHA224 */, + 794 /* ecdsa-with-SHA256 */, + 795 /* ecdsa-with-SHA384 */, + 796 /* ecdsa-with-SHA512 */, + 792 /* ecdsa-with-Specified */, + 48 /* emailAddress */, + 632 /* encrypted track 2 */, + 885 /* enhancedSearchGuide */, + 56 /* extendedCertificateAttributes */, + 867 /* facsimileTelephoneNumber */, + 462 /* favouriteDrink */, + 453 /* friendlyCountry */, + 490 /* friendlyCountryName */, + 156 /* friendlyName */, + 631 /* generate cryptogram */, + 509 /* generationQualifier */, + 601 /* generic cryptogram */, + 99 /* givenName */, + 814 /* gost89-cnt */, + 855 /* hmac */, + 780 /* hmac-md5 */, + 781 /* hmac-sha1 */, + 797 /* hmacWithMD5 */, + 163 /* hmacWithSHA1 */, + 798 /* hmacWithSHA224 */, + 799 /* hmacWithSHA256 */, + 800 /* hmacWithSHA384 */, + 801 /* hmacWithSHA512 */, + 486 /* homePostalAddress */, + 473 /* homeTelephoneNumber */, + 466 /* host */, + 889 /* houseIdentifier */, + 442 /* iA5StringSyntax */, + 381 /* iana */, + 824 /* id-Gost28147-89-CryptoPro-A-ParamSet */, + 825 /* id-Gost28147-89-CryptoPro-B-ParamSet */, + 826 /* id-Gost28147-89-CryptoPro-C-ParamSet */, + 827 /* id-Gost28147-89-CryptoPro-D-ParamSet */, + 819 /* id-Gost28147-89-CryptoPro-KeyMeshing */, + 829 /* id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet */, + 828 /* id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet */, + 830 /* id-Gost28147-89-CryptoPro-RIC-1-ParamSet */, + 820 /* id-Gost28147-89-None-KeyMeshing */, + 823 /* id-Gost28147-89-TestParamSet */, + 840 /* id-GostR3410-2001-CryptoPro-A-ParamSet */, + 841 /* id-GostR3410-2001-CryptoPro-B-ParamSet */, + 842 /* id-GostR3410-2001-CryptoPro-C-ParamSet */, + 843 /* id-GostR3410-2001-CryptoPro-XchA-ParamSet */, + 844 /* id-GostR3410-2001-CryptoPro-XchB-ParamSet */, + 839 /* id-GostR3410-2001-TestParamSet */, + 832 /* id-GostR3410-94-CryptoPro-A-ParamSet */, + 833 /* id-GostR3410-94-CryptoPro-B-ParamSet */, + 834 /* id-GostR3410-94-CryptoPro-C-ParamSet */, + 835 /* id-GostR3410-94-CryptoPro-D-ParamSet */, + 836 /* id-GostR3410-94-CryptoPro-XchA-ParamSet */, + 837 /* id-GostR3410-94-CryptoPro-XchB-ParamSet */, + 838 /* id-GostR3410-94-CryptoPro-XchC-ParamSet */, + 831 /* id-GostR3410-94-TestParamSet */, + 845 /* id-GostR3410-94-a */, + 846 /* id-GostR3410-94-aBis */, + 847 /* id-GostR3410-94-b */, + 848 /* id-GostR3410-94-bBis */, + 822 /* id-GostR3411-94-CryptoProParamSet */, + 821 /* id-GostR3411-94-TestParamSet */, + 266 /* id-aca */, + 355 /* id-aca-accessIdentity */, + 354 /* id-aca-authenticationInfo */, + 356 /* id-aca-chargingIdentity */, + 399 /* id-aca-encAttrs */, + 357 /* id-aca-group */, + 358 /* id-aca-role */, + 176 /* id-ad */, + 788 /* id-aes128-wrap */, + 897 /* id-aes128-wrap-pad */, + 789 /* id-aes192-wrap */, + 900 /* id-aes192-wrap-pad */, + 790 /* id-aes256-wrap */, + 903 /* id-aes256-wrap-pad */, + 262 /* id-alg */, + 893 /* id-alg-PWRI-KEK */, + 323 /* id-alg-des40 */, + 326 /* id-alg-dh-pop */, + 325 /* id-alg-dh-sig-hmac-sha1 */, + 324 /* id-alg-noSignature */, + 907 /* id-camellia128-wrap */, + 908 /* id-camellia192-wrap */, + 909 /* id-camellia256-wrap */, + 268 /* id-cct */, + 361 /* id-cct-PKIData */, + 362 /* id-cct-PKIResponse */, + 360 /* id-cct-crs */, + 81 /* id-ce */, + 680 /* id-characteristic-two-basis */, + 263 /* id-cmc */, + 334 /* id-cmc-addExtensions */, + 346 /* id-cmc-confirmCertAcceptance */, + 330 /* id-cmc-dataReturn */, + 336 /* id-cmc-decryptedPOP */, + 335 /* id-cmc-encryptedPOP */, + 339 /* id-cmc-getCRL */, + 338 /* id-cmc-getCert */, + 328 /* id-cmc-identification */, + 329 /* id-cmc-identityProof */, + 337 /* id-cmc-lraPOPWitness */, + 344 /* id-cmc-popLinkRandom */, + 345 /* id-cmc-popLinkWitness */, + 343 /* id-cmc-queryPending */, + 333 /* id-cmc-recipientNonce */, + 341 /* id-cmc-regInfo */, + 342 /* id-cmc-responseInfo */, + 340 /* id-cmc-revokeRequest */, + 332 /* id-cmc-senderNonce */, + 327 /* id-cmc-statusInfo */, + 331 /* id-cmc-transactionId */, + 787 /* id-ct-asciiTextWithCRLF */, + 408 /* id-ecPublicKey */, + 508 /* id-hex-multipart-message */, + 507 /* id-hex-partial-message */, + 260 /* id-it */, + 302 /* id-it-caKeyUpdateInfo */, + 298 /* id-it-caProtEncCert */, + 311 /* id-it-confirmWaitTime */, + 303 /* id-it-currentCRL */, + 300 /* id-it-encKeyPairTypes */, + 310 /* id-it-implicitConfirm */, + 308 /* id-it-keyPairParamRep */, + 307 /* id-it-keyPairParamReq */, + 312 /* id-it-origPKIMessage */, + 301 /* id-it-preferredSymmAlg */, + 309 /* id-it-revPassphrase */, + 299 /* id-it-signKeyPairTypes */, + 305 /* id-it-subscriptionRequest */, + 306 /* id-it-subscriptionResponse */, + 784 /* id-it-suppLangTags */, + 304 /* id-it-unsupportedOIDs */, + 128 /* id-kp */, + 280 /* id-mod-attribute-cert */, + 274 /* id-mod-cmc */, + 277 /* id-mod-cmp */, + 284 /* id-mod-cmp2000 */, + 273 /* id-mod-crmf */, + 283 /* id-mod-dvcs */, + 275 /* id-mod-kea-profile-88 */, + 276 /* id-mod-kea-profile-93 */, + 282 /* id-mod-ocsp */, + 278 /* id-mod-qualified-cert-88 */, + 279 /* id-mod-qualified-cert-93 */, + 281 /* id-mod-timestamp-protocol */, + 264 /* id-on */, + 347 /* id-on-personalData */, + 265 /* id-pda */, + 352 /* id-pda-countryOfCitizenship */, + 353 /* id-pda-countryOfResidence */, + 348 /* id-pda-dateOfBirth */, + 351 /* id-pda-gender */, + 349 /* id-pda-placeOfBirth */, + 175 /* id-pe */, + 261 /* id-pkip */, + 258 /* id-pkix-mod */, + 269 /* id-pkix1-explicit-88 */, + 271 /* id-pkix1-explicit-93 */, + 270 /* id-pkix1-implicit-88 */, + 272 /* id-pkix1-implicit-93 */, + 662 /* id-ppl */, + 267 /* id-qcs */, + 359 /* id-qcs-pkixQCSyntax-v1 */, + 259 /* id-qt */, + 313 /* id-regCtrl */, + 316 /* id-regCtrl-authenticator */, + 319 /* id-regCtrl-oldCertID */, + 318 /* id-regCtrl-pkiArchiveOptions */, + 317 /* id-regCtrl-pkiPublicationInfo */, + 320 /* id-regCtrl-protocolEncrKey */, + 315 /* id-regCtrl-regToken */, + 314 /* id-regInfo */, + 322 /* id-regInfo-certReq */, + 321 /* id-regInfo-utf8Pairs */, + 191 /* id-smime-aa */, + 215 /* id-smime-aa-contentHint */, + 218 /* id-smime-aa-contentIdentifier */, + 221 /* id-smime-aa-contentReference */, + 240 /* id-smime-aa-dvcs-dvc */, + 217 /* id-smime-aa-encapContentType */, + 222 /* id-smime-aa-encrypKeyPref */, + 220 /* id-smime-aa-equivalentLabels */, + 232 /* id-smime-aa-ets-CertificateRefs */, + 233 /* id-smime-aa-ets-RevocationRefs */, + 238 /* id-smime-aa-ets-archiveTimeStamp */, + 237 /* id-smime-aa-ets-certCRLTimestamp */, + 234 /* id-smime-aa-ets-certValues */, + 227 /* id-smime-aa-ets-commitmentType */, + 231 /* id-smime-aa-ets-contentTimestamp */, + 236 /* id-smime-aa-ets-escTimeStamp */, + 230 /* id-smime-aa-ets-otherSigCert */, + 235 /* id-smime-aa-ets-revocationValues */, + 226 /* id-smime-aa-ets-sigPolicyId */, + 229 /* id-smime-aa-ets-signerAttr */, + 228 /* id-smime-aa-ets-signerLocation */, + 219 /* id-smime-aa-macValue */, + 214 /* id-smime-aa-mlExpandHistory */, + 216 /* id-smime-aa-msgSigDigest */, + 212 /* id-smime-aa-receiptRequest */, + 213 /* id-smime-aa-securityLabel */, + 239 /* id-smime-aa-signatureType */, + 223 /* id-smime-aa-signingCertificate */, + 224 /* id-smime-aa-smimeEncryptCerts */, + 225 /* id-smime-aa-timeStampToken */, + 192 /* id-smime-alg */, + 243 /* id-smime-alg-3DESwrap */, + 246 /* id-smime-alg-CMS3DESwrap */, + 247 /* id-smime-alg-CMSRC2wrap */, + 245 /* id-smime-alg-ESDH */, + 241 /* id-smime-alg-ESDHwith3DES */, + 242 /* id-smime-alg-ESDHwithRC2 */, + 244 /* id-smime-alg-RC2wrap */, + 193 /* id-smime-cd */, + 248 /* id-smime-cd-ldap */, + 190 /* id-smime-ct */, + 210 /* id-smime-ct-DVCSRequestData */, + 211 /* id-smime-ct-DVCSResponseData */, + 208 /* id-smime-ct-TDTInfo */, + 207 /* id-smime-ct-TSTInfo */, + 205 /* id-smime-ct-authData */, + 786 /* id-smime-ct-compressedData */, + 209 /* id-smime-ct-contentInfo */, + 206 /* id-smime-ct-publishCert */, + 204 /* id-smime-ct-receipt */, + 195 /* id-smime-cti */, + 255 /* id-smime-cti-ets-proofOfApproval */, + 256 /* id-smime-cti-ets-proofOfCreation */, + 253 /* id-smime-cti-ets-proofOfDelivery */, + 251 /* id-smime-cti-ets-proofOfOrigin */, + 252 /* id-smime-cti-ets-proofOfReceipt */, + 254 /* id-smime-cti-ets-proofOfSender */, + 189 /* id-smime-mod */, + 196 /* id-smime-mod-cms */, + 197 /* id-smime-mod-ess */, + 202 /* id-smime-mod-ets-eSigPolicy-88 */, + 203 /* id-smime-mod-ets-eSigPolicy-97 */, + 200 /* id-smime-mod-ets-eSignature-88 */, + 201 /* id-smime-mod-ets-eSignature-97 */, + 199 /* id-smime-mod-msg-v3 */, + 198 /* id-smime-mod-oid */, + 194 /* id-smime-spq */, + 250 /* id-smime-spq-ets-sqt-unotice */, + 249 /* id-smime-spq-ets-sqt-uri */, + 34 /* idea-cbc */, + 35 /* idea-cfb */, + 36 /* idea-ecb */, + 46 /* idea-ofb */, + 676 /* identified-organization */, + 461 /* info */, + 101 /* initials */, + 869 /* internationaliSDNNumber */, + 749 /* ipsec3 */, + 750 /* ipsec4 */, + 181 /* iso */, + 623 /* issuer capabilities */, + 645 /* itu-t */, + 492 /* janetMailbox */, + 646 /* joint-iso-itu-t */, + 150 /* keyBag */, + 773 /* kisa */, + 957 /* kx-any */, + 952 /* kx-ecdhe */, + 953 /* kx-psk */, + 951 /* kx-rsa */, + 477 /* lastModifiedBy */, + 476 /* lastModifiedTime */, + 157 /* localKeyID */, + 15 /* localityName */, + 480 /* mXRecord */, + 493 /* mailPreferenceOption */, + 467 /* manager */, + 3 /* md2 */, + 7 /* md2WithRSAEncryption */, + 257 /* md4 */, + 396 /* md4WithRSAEncryption */, + 4 /* md5 */, + 114 /* md5-sha1 */, + 104 /* md5WithRSA */, + 8 /* md5WithRSAEncryption */, + 95 /* mdc2 */, + 96 /* mdc2WithRSA */, + 875 /* member */, + 602 /* merchant initiated auth */, + 514 /* message extensions */, + 51 /* messageDigest */, + 911 /* mgf1 */, + 506 /* mime-mhs-bodies */, + 505 /* mime-mhs-headings */, + 488 /* mobileTelephoneNumber */, + 481 /* nSRecord */, + 173 /* name */, + 681 /* onBasis */, + 379 /* org */, + 17 /* organizationName */, + 491 /* organizationalStatus */, + 18 /* organizationalUnitName */, + 475 /* otherMailbox */, + 876 /* owner */, + 935 /* pSpecified */, + 489 /* pagerTelephoneNumber */, + 782 /* password based MAC */, + 374 /* path */, + 621 /* payment gateway capabilities */, + 9 /* pbeWithMD2AndDES-CBC */, + 168 /* pbeWithMD2AndRC2-CBC */, + 112 /* pbeWithMD5AndCast5CBC */, + 10 /* pbeWithMD5AndDES-CBC */, + 169 /* pbeWithMD5AndRC2-CBC */, + 148 /* pbeWithSHA1And128BitRC2-CBC */, + 144 /* pbeWithSHA1And128BitRC4 */, + 147 /* pbeWithSHA1And2-KeyTripleDES-CBC */, + 146 /* pbeWithSHA1And3-KeyTripleDES-CBC */, + 149 /* pbeWithSHA1And40BitRC2-CBC */, + 145 /* pbeWithSHA1And40BitRC4 */, + 170 /* pbeWithSHA1AndDES-CBC */, + 68 /* pbeWithSHA1AndRC2-CBC */, + 499 /* personalSignature */, + 487 /* personalTitle */, + 464 /* photo */, + 863 /* physicalDeliveryOfficeName */, + 437 /* pilot */, + 439 /* pilotAttributeSyntax */, + 438 /* pilotAttributeType */, + 479 /* pilotAttributeType27 */, + 456 /* pilotDSA */, + 441 /* pilotGroups */, + 444 /* pilotObject */, + 440 /* pilotObjectClass */, + 455 /* pilotOrganization */, + 445 /* pilotPerson */, + 186 /* pkcs1 */, + 27 /* pkcs3 */, + 187 /* pkcs5 */, + 20 /* pkcs7 */, + 21 /* pkcs7-data */, + 25 /* pkcs7-digestData */, + 26 /* pkcs7-encryptedData */, + 23 /* pkcs7-envelopedData */, + 24 /* pkcs7-signedAndEnvelopedData */, + 22 /* pkcs7-signedData */, + 151 /* pkcs8ShroudedKeyBag */, + 47 /* pkcs9 */, + 862 /* postOfficeBox */, + 861 /* postalAddress */, + 661 /* postalCode */, + 683 /* ppBasis */, + 872 /* preferredDeliveryMethod */, + 873 /* presentationAddress */, + 406 /* prime-field */, + 409 /* prime192v1 */, + 410 /* prime192v2 */, + 411 /* prime192v3 */, + 412 /* prime239v1 */, + 413 /* prime239v2 */, + 414 /* prime239v3 */, + 415 /* prime256v1 */, + 886 /* protocolInformation */, + 510 /* pseudonym */, + 435 /* pss */, + 286 /* qcStatements */, + 457 /* qualityLabelledData */, + 450 /* rFC822localPart */, + 98 /* rc2-40-cbc */, + 166 /* rc2-64-cbc */, + 37 /* rc2-cbc */, + 39 /* rc2-cfb */, + 38 /* rc2-ecb */, + 40 /* rc2-ofb */, + 5 /* rc4 */, + 97 /* rc4-40 */, + 915 /* rc4-hmac-md5 */, + 120 /* rc5-cbc */, + 122 /* rc5-cfb */, + 121 /* rc5-ecb */, + 123 /* rc5-ofb */, + 870 /* registeredAddress */, + 460 /* rfc822Mailbox */, + 117 /* ripemd160 */, + 119 /* ripemd160WithRSA */, + 400 /* role */, + 877 /* roleOccupant */, + 448 /* room */, + 463 /* roomNumber */, + 19 /* rsa */, + 6 /* rsaEncryption */, + 644 /* rsaOAEPEncryptionSET */, + 377 /* rsaSignature */, + 919 /* rsaesOaep */, + 912 /* rsassaPss */, + 482 /* sOARecord */, + 155 /* safeContentsBag */, + 291 /* sbgp-autonomousSysNum */, + 290 /* sbgp-ipAddrBlock */, + 292 /* sbgp-routerIdentifier */, + 159 /* sdsiCertificate */, + 859 /* searchGuide */, + 704 /* secp112r1 */, + 705 /* secp112r2 */, + 706 /* secp128r1 */, + 707 /* secp128r2 */, + 708 /* secp160k1 */, + 709 /* secp160r1 */, + 710 /* secp160r2 */, + 711 /* secp192k1 */, + 712 /* secp224k1 */, + 713 /* secp224r1 */, + 714 /* secp256k1 */, + 715 /* secp384r1 */, + 716 /* secp521r1 */, + 154 /* secretBag */, + 474 /* secretary */, + 717 /* sect113r1 */, + 718 /* sect113r2 */, + 719 /* sect131r1 */, + 720 /* sect131r2 */, + 721 /* sect163k1 */, + 722 /* sect163r1 */, + 723 /* sect163r2 */, + 724 /* sect193r1 */, + 725 /* sect193r2 */, + 726 /* sect233k1 */, + 727 /* sect233r1 */, + 728 /* sect239k1 */, + 729 /* sect283k1 */, + 730 /* sect283r1 */, + 731 /* sect409k1 */, + 732 /* sect409r1 */, + 733 /* sect571k1 */, + 734 /* sect571r1 */, + 635 /* secure device signature */, + 878 /* seeAlso */, + 777 /* seed-cbc */, + 779 /* seed-cfb */, + 776 /* seed-ecb */, + 778 /* seed-ofb */, + 105 /* serialNumber */, + 625 /* set-addPolicy */, + 515 /* set-attr */, + 518 /* set-brand */, + 638 /* set-brand-AmericanExpress */, + 637 /* set-brand-Diners */, + 636 /* set-brand-IATA-ATA */, + 639 /* set-brand-JCB */, + 641 /* set-brand-MasterCard */, + 642 /* set-brand-Novus */, + 640 /* set-brand-Visa */, + 516 /* set-policy */, + 607 /* set-policy-root */, + 624 /* set-rootKeyThumb */, + 620 /* setAttr-Cert */, + 628 /* setAttr-IssCap-CVM */, + 630 /* setAttr-IssCap-Sig */, + 629 /* setAttr-IssCap-T2 */, + 627 /* setAttr-Token-B0Prime */, + 626 /* setAttr-Token-EMV */, + 622 /* setAttr-TokenType */, + 619 /* setCext-IssuerCapabilities */, + 615 /* setCext-PGWYcapabilities */, + 616 /* setCext-TokenIdentifier */, + 618 /* setCext-TokenType */, + 617 /* setCext-Track2Data */, + 611 /* setCext-cCertRequired */, + 609 /* setCext-certType */, + 608 /* setCext-hashedRoot */, + 610 /* setCext-merchData */, + 613 /* setCext-setExt */, + 614 /* setCext-setQualf */, + 612 /* setCext-tunneling */, + 540 /* setct-AcqCardCodeMsg */, + 576 /* setct-AcqCardCodeMsgTBE */, + 570 /* setct-AuthReqTBE */, + 534 /* setct-AuthReqTBS */, + 527 /* setct-AuthResBaggage */, + 571 /* setct-AuthResTBE */, + 572 /* setct-AuthResTBEX */, + 535 /* setct-AuthResTBS */, + 536 /* setct-AuthResTBSX */, + 528 /* setct-AuthRevReqBaggage */, + 577 /* setct-AuthRevReqTBE */, + 541 /* setct-AuthRevReqTBS */, + 529 /* setct-AuthRevResBaggage */, + 542 /* setct-AuthRevResData */, + 578 /* setct-AuthRevResTBE */, + 579 /* setct-AuthRevResTBEB */, + 543 /* setct-AuthRevResTBS */, + 573 /* setct-AuthTokenTBE */, + 537 /* setct-AuthTokenTBS */, + 600 /* setct-BCIDistributionTBS */, + 558 /* setct-BatchAdminReqData */, + 592 /* setct-BatchAdminReqTBE */, + 559 /* setct-BatchAdminResData */, + 593 /* setct-BatchAdminResTBE */, + 599 /* setct-CRLNotificationResTBS */, + 598 /* setct-CRLNotificationTBS */, + 580 /* setct-CapReqTBE */, + 581 /* setct-CapReqTBEX */, + 544 /* setct-CapReqTBS */, + 545 /* setct-CapReqTBSX */, + 546 /* setct-CapResData */, + 582 /* setct-CapResTBE */, + 583 /* setct-CapRevReqTBE */, + 584 /* setct-CapRevReqTBEX */, + 547 /* setct-CapRevReqTBS */, + 548 /* setct-CapRevReqTBSX */, + 549 /* setct-CapRevResData */, + 585 /* setct-CapRevResTBE */, + 538 /* setct-CapTokenData */, + 530 /* setct-CapTokenSeq */, + 574 /* setct-CapTokenTBE */, + 575 /* setct-CapTokenTBEX */, + 539 /* setct-CapTokenTBS */, + 560 /* setct-CardCInitResTBS */, + 566 /* setct-CertInqReqTBS */, + 563 /* setct-CertReqData */, + 595 /* setct-CertReqTBE */, + 596 /* setct-CertReqTBEX */, + 564 /* setct-CertReqTBS */, + 565 /* setct-CertResData */, + 597 /* setct-CertResTBE */, + 586 /* setct-CredReqTBE */, + 587 /* setct-CredReqTBEX */, + 550 /* setct-CredReqTBS */, + 551 /* setct-CredReqTBSX */, + 552 /* setct-CredResData */, + 588 /* setct-CredResTBE */, + 589 /* setct-CredRevReqTBE */, + 590 /* setct-CredRevReqTBEX */, + 553 /* setct-CredRevReqTBS */, + 554 /* setct-CredRevReqTBSX */, + 555 /* setct-CredRevResData */, + 591 /* setct-CredRevResTBE */, + 567 /* setct-ErrorTBS */, + 526 /* setct-HODInput */, + 561 /* setct-MeAqCInitResTBS */, + 522 /* setct-OIData */, + 519 /* setct-PANData */, + 521 /* setct-PANOnly */, + 520 /* setct-PANToken */, + 556 /* setct-PCertReqData */, + 557 /* setct-PCertResTBS */, + 523 /* setct-PI */, + 532 /* setct-PI-TBS */, + 524 /* setct-PIData */, + 525 /* setct-PIDataUnsigned */, + 568 /* setct-PIDualSignedTBE */, + 569 /* setct-PIUnsignedTBE */, + 531 /* setct-PInitResData */, + 533 /* setct-PResData */, + 594 /* setct-RegFormReqTBE */, + 562 /* setct-RegFormResTBS */, + 604 /* setext-pinAny */, + 603 /* setext-pinSecure */, + 605 /* setext-track2 */, + 41 /* sha */, + 64 /* sha1 */, + 115 /* sha1WithRSA */, + 65 /* sha1WithRSAEncryption */, + 675 /* sha224 */, + 671 /* sha224WithRSAEncryption */, + 672 /* sha256 */, + 668 /* sha256WithRSAEncryption */, + 673 /* sha384 */, + 669 /* sha384WithRSAEncryption */, + 674 /* sha512 */, + 670 /* sha512WithRSAEncryption */, + 42 /* shaWithRSAEncryption */, + 52 /* signingTime */, + 454 /* simpleSecurityObject */, + 496 /* singleLevelQuality */, + 16 /* stateOrProvinceName */, + 660 /* streetAddress */, + 498 /* subtreeMaximumQuality */, + 497 /* subtreeMinimumQuality */, + 890 /* supportedAlgorithms */, + 874 /* supportedApplicationContext */, + 100 /* surname */, + 864 /* telephoneNumber */, + 866 /* teletexTerminalIdentifier */, + 865 /* telexNumber */, + 459 /* textEncodedORAddress */, + 293 /* textNotice */, + 106 /* title */, + 682 /* tpBasis */, + 436 /* ucl */, + 0 /* undefined */, + 888 /* uniqueMember */, + 55 /* unstructuredAddress */, + 49 /* unstructuredName */, + 880 /* userCertificate */, + 465 /* userClass */, + 458 /* userId */, + 879 /* userPassword */, + 373 /* valid */, + 678 /* wap */, + 679 /* wap-wsg */, + 735 /* wap-wsg-idm-ecid-wtls1 */, + 743 /* wap-wsg-idm-ecid-wtls10 */, + 744 /* wap-wsg-idm-ecid-wtls11 */, + 745 /* wap-wsg-idm-ecid-wtls12 */, + 736 /* wap-wsg-idm-ecid-wtls3 */, + 737 /* wap-wsg-idm-ecid-wtls4 */, + 738 /* wap-wsg-idm-ecid-wtls5 */, + 739 /* wap-wsg-idm-ecid-wtls6 */, + 740 /* wap-wsg-idm-ecid-wtls7 */, + 741 /* wap-wsg-idm-ecid-wtls8 */, + 742 /* wap-wsg-idm-ecid-wtls9 */, + 804 /* whirlpool */, + 868 /* x121Address */, + 503 /* x500UniqueIdentifier */, + 158 /* x509Certificate */, + 160 /* x509Crl */, + 125 /* zlib compression */, +}; + +static const uint16_t kNIDsInOIDOrder[] = { + 434 /* 0.9 (OBJ_data) */, + 182 /* 1.2 (OBJ_member_body) */, + 379 /* 1.3 (OBJ_org) */, + 676 /* 1.3 (OBJ_identified_organization) */, + 11 /* 2.5 (OBJ_X500) */, + 647 /* 2.23 (OBJ_international_organizations) */, + 380 /* 1.3.6 (OBJ_dod) */, + 12 /* 2.5.4 (OBJ_X509) */, + 378 /* 2.5.8 (OBJ_X500algorithms) */, + 81 /* 2.5.29 (OBJ_id_ce) */, + 512 /* 2.23.42 (OBJ_id_set) */, + 678 /* 2.23.43 (OBJ_wap) */, + 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) */, + 100 /* 2.5.4.4 (OBJ_surname) */, + 105 /* 2.5.4.5 (OBJ_serialNumber) */, + 14 /* 2.5.4.6 (OBJ_countryName) */, + 15 /* 2.5.4.7 (OBJ_localityName) */, + 16 /* 2.5.4.8 (OBJ_stateOrProvinceName) */, + 660 /* 2.5.4.9 (OBJ_streetAddress) */, + 17 /* 2.5.4.10 (OBJ_organizationName) */, + 18 /* 2.5.4.11 (OBJ_organizationalUnitName) */, + 106 /* 2.5.4.12 (OBJ_title) */, + 107 /* 2.5.4.13 (OBJ_description) */, + 859 /* 2.5.4.14 (OBJ_searchGuide) */, + 860 /* 2.5.4.15 (OBJ_businessCategory) */, + 861 /* 2.5.4.16 (OBJ_postalAddress) */, + 661 /* 2.5.4.17 (OBJ_postalCode) */, + 862 /* 2.5.4.18 (OBJ_postOfficeBox) */, + 863 /* 2.5.4.19 (OBJ_physicalDeliveryOfficeName) */, + 864 /* 2.5.4.20 (OBJ_telephoneNumber) */, + 865 /* 2.5.4.21 (OBJ_telexNumber) */, + 866 /* 2.5.4.22 (OBJ_teletexTerminalIdentifier) */, + 867 /* 2.5.4.23 (OBJ_facsimileTelephoneNumber) */, + 868 /* 2.5.4.24 (OBJ_x121Address) */, + 869 /* 2.5.4.25 (OBJ_internationaliSDNNumber) */, + 870 /* 2.5.4.26 (OBJ_registeredAddress) */, + 871 /* 2.5.4.27 (OBJ_destinationIndicator) */, + 872 /* 2.5.4.28 (OBJ_preferredDeliveryMethod) */, + 873 /* 2.5.4.29 (OBJ_presentationAddress) */, + 874 /* 2.5.4.30 (OBJ_supportedApplicationContext) */, + 875 /* 2.5.4.31 (OBJ_member) */, + 876 /* 2.5.4.32 (OBJ_owner) */, + 877 /* 2.5.4.33 (OBJ_roleOccupant) */, + 878 /* 2.5.4.34 (OBJ_seeAlso) */, + 879 /* 2.5.4.35 (OBJ_userPassword) */, + 880 /* 2.5.4.36 (OBJ_userCertificate) */, + 881 /* 2.5.4.37 (OBJ_cACertificate) */, + 882 /* 2.5.4.38 (OBJ_authorityRevocationList) */, + 883 /* 2.5.4.39 (OBJ_certificateRevocationList) */, + 884 /* 2.5.4.40 (OBJ_crossCertificatePair) */, + 173 /* 2.5.4.41 (OBJ_name) */, + 99 /* 2.5.4.42 (OBJ_givenName) */, + 101 /* 2.5.4.43 (OBJ_initials) */, + 509 /* 2.5.4.44 (OBJ_generationQualifier) */, + 503 /* 2.5.4.45 (OBJ_x500UniqueIdentifier) */, + 174 /* 2.5.4.46 (OBJ_dnQualifier) */, + 885 /* 2.5.4.47 (OBJ_enhancedSearchGuide) */, + 886 /* 2.5.4.48 (OBJ_protocolInformation) */, + 887 /* 2.5.4.49 (OBJ_distinguishedName) */, + 888 /* 2.5.4.50 (OBJ_uniqueMember) */, + 889 /* 2.5.4.51 (OBJ_houseIdentifier) */, + 890 /* 2.5.4.52 (OBJ_supportedAlgorithms) */, + 891 /* 2.5.4.53 (OBJ_deltaRevocationList) */, + 892 /* 2.5.4.54 (OBJ_dmdName) */, + 510 /* 2.5.4.65 (OBJ_pseudonym) */, + 400 /* 2.5.4.72 (OBJ_role) */, + 769 /* 2.5.29.9 (OBJ_subject_directory_attributes) */, + 82 /* 2.5.29.14 (OBJ_subject_key_identifier) */, + 83 /* 2.5.29.15 (OBJ_key_usage) */, + 84 /* 2.5.29.16 (OBJ_private_key_usage_period) */, + 85 /* 2.5.29.17 (OBJ_subject_alt_name) */, + 86 /* 2.5.29.18 (OBJ_issuer_alt_name) */, + 87 /* 2.5.29.19 (OBJ_basic_constraints) */, + 88 /* 2.5.29.20 (OBJ_crl_number) */, + 141 /* 2.5.29.21 (OBJ_crl_reason) */, + 430 /* 2.5.29.23 (OBJ_hold_instruction_code) */, + 142 /* 2.5.29.24 (OBJ_invalidity_date) */, + 140 /* 2.5.29.27 (OBJ_delta_crl) */, + 770 /* 2.5.29.28 (OBJ_issuing_distribution_point) */, + 771 /* 2.5.29.29 (OBJ_certificate_issuer) */, + 666 /* 2.5.29.30 (OBJ_name_constraints) */, + 103 /* 2.5.29.31 (OBJ_crl_distribution_points) */, + 89 /* 2.5.29.32 (OBJ_certificate_policies) */, + 747 /* 2.5.29.33 (OBJ_policy_mappings) */, + 90 /* 2.5.29.35 (OBJ_authority_key_identifier) */, + 401 /* 2.5.29.36 (OBJ_policy_constraints) */, + 126 /* 2.5.29.37 (OBJ_ext_key_usage) */, + 857 /* 2.5.29.46 (OBJ_freshest_crl) */, + 748 /* 2.5.29.54 (OBJ_inhibit_any_policy) */, + 402 /* 2.5.29.55 (OBJ_target_information) */, + 403 /* 2.5.29.56 (OBJ_no_rev_avail) */, + 513 /* 2.23.42.0 (OBJ_set_ctype) */, + 514 /* 2.23.42.1 (OBJ_set_msgExt) */, + 515 /* 2.23.42.3 (OBJ_set_attr) */, + 516 /* 2.23.42.5 (OBJ_set_policy) */, + 517 /* 2.23.42.7 (OBJ_set_certExt) */, + 518 /* 2.23.42.8 (OBJ_set_brand) */, + 679 /* 2.23.43.1 (OBJ_wap_wsg) */, + 382 /* 1.3.6.1.1 (OBJ_Directory) */, + 383 /* 1.3.6.1.2 (OBJ_Management) */, + 384 /* 1.3.6.1.3 (OBJ_Experimental) */, + 385 /* 1.3.6.1.4 (OBJ_Private) */, + 386 /* 1.3.6.1.5 (OBJ_Security) */, + 387 /* 1.3.6.1.6 (OBJ_SNMPv2) */, + 388 /* 1.3.6.1.7 (OBJ_Mail) */, + 376 /* 1.3.14.3.2 (OBJ_algorithm) */, + 395 /* 2.5.1.5.55 (OBJ_clearance) */, + 19 /* 2.5.8.1.1 (OBJ_rsa) */, + 96 /* 2.5.8.3.100 (OBJ_mdc2WithRSA) */, + 95 /* 2.5.8.3.101 (OBJ_mdc2) */, + 746 /* 2.5.29.32.0 (OBJ_any_policy) */, + 910 /* 2.5.29.37.0 (OBJ_anyExtendedKeyUsage) */, + 519 /* 2.23.42.0.0 (OBJ_setct_PANData) */, + 520 /* 2.23.42.0.1 (OBJ_setct_PANToken) */, + 521 /* 2.23.42.0.2 (OBJ_setct_PANOnly) */, + 522 /* 2.23.42.0.3 (OBJ_setct_OIData) */, + 523 /* 2.23.42.0.4 (OBJ_setct_PI) */, + 524 /* 2.23.42.0.5 (OBJ_setct_PIData) */, + 525 /* 2.23.42.0.6 (OBJ_setct_PIDataUnsigned) */, + 526 /* 2.23.42.0.7 (OBJ_setct_HODInput) */, + 527 /* 2.23.42.0.8 (OBJ_setct_AuthResBaggage) */, + 528 /* 2.23.42.0.9 (OBJ_setct_AuthRevReqBaggage) */, + 529 /* 2.23.42.0.10 (OBJ_setct_AuthRevResBaggage) */, + 530 /* 2.23.42.0.11 (OBJ_setct_CapTokenSeq) */, + 531 /* 2.23.42.0.12 (OBJ_setct_PInitResData) */, + 532 /* 2.23.42.0.13 (OBJ_setct_PI_TBS) */, + 533 /* 2.23.42.0.14 (OBJ_setct_PResData) */, + 534 /* 2.23.42.0.16 (OBJ_setct_AuthReqTBS) */, + 535 /* 2.23.42.0.17 (OBJ_setct_AuthResTBS) */, + 536 /* 2.23.42.0.18 (OBJ_setct_AuthResTBSX) */, + 537 /* 2.23.42.0.19 (OBJ_setct_AuthTokenTBS) */, + 538 /* 2.23.42.0.20 (OBJ_setct_CapTokenData) */, + 539 /* 2.23.42.0.21 (OBJ_setct_CapTokenTBS) */, + 540 /* 2.23.42.0.22 (OBJ_setct_AcqCardCodeMsg) */, + 541 /* 2.23.42.0.23 (OBJ_setct_AuthRevReqTBS) */, + 542 /* 2.23.42.0.24 (OBJ_setct_AuthRevResData) */, + 543 /* 2.23.42.0.25 (OBJ_setct_AuthRevResTBS) */, + 544 /* 2.23.42.0.26 (OBJ_setct_CapReqTBS) */, + 545 /* 2.23.42.0.27 (OBJ_setct_CapReqTBSX) */, + 546 /* 2.23.42.0.28 (OBJ_setct_CapResData) */, + 547 /* 2.23.42.0.29 (OBJ_setct_CapRevReqTBS) */, + 548 /* 2.23.42.0.30 (OBJ_setct_CapRevReqTBSX) */, + 549 /* 2.23.42.0.31 (OBJ_setct_CapRevResData) */, + 550 /* 2.23.42.0.32 (OBJ_setct_CredReqTBS) */, + 551 /* 2.23.42.0.33 (OBJ_setct_CredReqTBSX) */, + 552 /* 2.23.42.0.34 (OBJ_setct_CredResData) */, + 553 /* 2.23.42.0.35 (OBJ_setct_CredRevReqTBS) */, + 554 /* 2.23.42.0.36 (OBJ_setct_CredRevReqTBSX) */, + 555 /* 2.23.42.0.37 (OBJ_setct_CredRevResData) */, + 556 /* 2.23.42.0.38 (OBJ_setct_PCertReqData) */, + 557 /* 2.23.42.0.39 (OBJ_setct_PCertResTBS) */, + 558 /* 2.23.42.0.40 (OBJ_setct_BatchAdminReqData) */, + 559 /* 2.23.42.0.41 (OBJ_setct_BatchAdminResData) */, + 560 /* 2.23.42.0.42 (OBJ_setct_CardCInitResTBS) */, + 561 /* 2.23.42.0.43 (OBJ_setct_MeAqCInitResTBS) */, + 562 /* 2.23.42.0.44 (OBJ_setct_RegFormResTBS) */, + 563 /* 2.23.42.0.45 (OBJ_setct_CertReqData) */, + 564 /* 2.23.42.0.46 (OBJ_setct_CertReqTBS) */, + 565 /* 2.23.42.0.47 (OBJ_setct_CertResData) */, + 566 /* 2.23.42.0.48 (OBJ_setct_CertInqReqTBS) */, + 567 /* 2.23.42.0.49 (OBJ_setct_ErrorTBS) */, + 568 /* 2.23.42.0.50 (OBJ_setct_PIDualSignedTBE) */, + 569 /* 2.23.42.0.51 (OBJ_setct_PIUnsignedTBE) */, + 570 /* 2.23.42.0.52 (OBJ_setct_AuthReqTBE) */, + 571 /* 2.23.42.0.53 (OBJ_setct_AuthResTBE) */, + 572 /* 2.23.42.0.54 (OBJ_setct_AuthResTBEX) */, + 573 /* 2.23.42.0.55 (OBJ_setct_AuthTokenTBE) */, + 574 /* 2.23.42.0.56 (OBJ_setct_CapTokenTBE) */, + 575 /* 2.23.42.0.57 (OBJ_setct_CapTokenTBEX) */, + 576 /* 2.23.42.0.58 (OBJ_setct_AcqCardCodeMsgTBE) */, + 577 /* 2.23.42.0.59 (OBJ_setct_AuthRevReqTBE) */, + 578 /* 2.23.42.0.60 (OBJ_setct_AuthRevResTBE) */, + 579 /* 2.23.42.0.61 (OBJ_setct_AuthRevResTBEB) */, + 580 /* 2.23.42.0.62 (OBJ_setct_CapReqTBE) */, + 581 /* 2.23.42.0.63 (OBJ_setct_CapReqTBEX) */, + 582 /* 2.23.42.0.64 (OBJ_setct_CapResTBE) */, + 583 /* 2.23.42.0.65 (OBJ_setct_CapRevReqTBE) */, + 584 /* 2.23.42.0.66 (OBJ_setct_CapRevReqTBEX) */, + 585 /* 2.23.42.0.67 (OBJ_setct_CapRevResTBE) */, + 586 /* 2.23.42.0.68 (OBJ_setct_CredReqTBE) */, + 587 /* 2.23.42.0.69 (OBJ_setct_CredReqTBEX) */, + 588 /* 2.23.42.0.70 (OBJ_setct_CredResTBE) */, + 589 /* 2.23.42.0.71 (OBJ_setct_CredRevReqTBE) */, + 590 /* 2.23.42.0.72 (OBJ_setct_CredRevReqTBEX) */, + 591 /* 2.23.42.0.73 (OBJ_setct_CredRevResTBE) */, + 592 /* 2.23.42.0.74 (OBJ_setct_BatchAdminReqTBE) */, + 593 /* 2.23.42.0.75 (OBJ_setct_BatchAdminResTBE) */, + 594 /* 2.23.42.0.76 (OBJ_setct_RegFormReqTBE) */, + 595 /* 2.23.42.0.77 (OBJ_setct_CertReqTBE) */, + 596 /* 2.23.42.0.78 (OBJ_setct_CertReqTBEX) */, + 597 /* 2.23.42.0.79 (OBJ_setct_CertResTBE) */, + 598 /* 2.23.42.0.80 (OBJ_setct_CRLNotificationTBS) */, + 599 /* 2.23.42.0.81 (OBJ_setct_CRLNotificationResTBS) */, + 600 /* 2.23.42.0.82 (OBJ_setct_BCIDistributionTBS) */, + 601 /* 2.23.42.1.1 (OBJ_setext_genCrypt) */, + 602 /* 2.23.42.1.3 (OBJ_setext_miAuth) */, + 603 /* 2.23.42.1.4 (OBJ_setext_pinSecure) */, + 604 /* 2.23.42.1.5 (OBJ_setext_pinAny) */, + 605 /* 2.23.42.1.7 (OBJ_setext_track2) */, + 606 /* 2.23.42.1.8 (OBJ_setext_cv) */, + 620 /* 2.23.42.3.0 (OBJ_setAttr_Cert) */, + 621 /* 2.23.42.3.1 (OBJ_setAttr_PGWYcap) */, + 622 /* 2.23.42.3.2 (OBJ_setAttr_TokenType) */, + 623 /* 2.23.42.3.3 (OBJ_setAttr_IssCap) */, + 607 /* 2.23.42.5.0 (OBJ_set_policy_root) */, + 608 /* 2.23.42.7.0 (OBJ_setCext_hashedRoot) */, + 609 /* 2.23.42.7.1 (OBJ_setCext_certType) */, + 610 /* 2.23.42.7.2 (OBJ_setCext_merchData) */, + 611 /* 2.23.42.7.3 (OBJ_setCext_cCertRequired) */, + 612 /* 2.23.42.7.4 (OBJ_setCext_tunneling) */, + 613 /* 2.23.42.7.5 (OBJ_setCext_setExt) */, + 614 /* 2.23.42.7.6 (OBJ_setCext_setQualf) */, + 615 /* 2.23.42.7.7 (OBJ_setCext_PGWYcapabilities) */, + 616 /* 2.23.42.7.8 (OBJ_setCext_TokenIdentifier) */, + 617 /* 2.23.42.7.9 (OBJ_setCext_Track2Data) */, + 618 /* 2.23.42.7.10 (OBJ_setCext_TokenType) */, + 619 /* 2.23.42.7.11 (OBJ_setCext_IssuerCapabilities) */, + 636 /* 2.23.42.8.1 (OBJ_set_brand_IATA_ATA) */, + 640 /* 2.23.42.8.4 (OBJ_set_brand_Visa) */, + 641 /* 2.23.42.8.5 (OBJ_set_brand_MasterCard) */, + 637 /* 2.23.42.8.30 (OBJ_set_brand_Diners) */, + 638 /* 2.23.42.8.34 (OBJ_set_brand_AmericanExpress) */, + 639 /* 2.23.42.8.35 (OBJ_set_brand_JCB) */, + 805 /* 1.2.643.2.2 (OBJ_cryptopro) */, + 806 /* 1.2.643.2.9 (OBJ_cryptocom) */, + 184 /* 1.2.840.10040 (OBJ_X9_57) */, + 405 /* 1.2.840.10045 (OBJ_ansi_X9_62) */, + 389 /* 1.3.6.1.4.1 (OBJ_Enterprises) */, + 504 /* 1.3.6.1.7.1 (OBJ_mime_mhs) */, + 104 /* 1.3.14.3.2.3 (OBJ_md5WithRSA) */, + 29 /* 1.3.14.3.2.6 (OBJ_des_ecb) */, + 31 /* 1.3.14.3.2.7 (OBJ_des_cbc) */, + 45 /* 1.3.14.3.2.8 (OBJ_des_ofb64) */, + 30 /* 1.3.14.3.2.9 (OBJ_des_cfb64) */, + 377 /* 1.3.14.3.2.11 (OBJ_rsaSignature) */, + 67 /* 1.3.14.3.2.12 (OBJ_dsa_2) */, + 66 /* 1.3.14.3.2.13 (OBJ_dsaWithSHA) */, + 42 /* 1.3.14.3.2.15 (OBJ_shaWithRSAEncryption) */, + 32 /* 1.3.14.3.2.17 (OBJ_des_ede_ecb) */, + 41 /* 1.3.14.3.2.18 (OBJ_sha) */, + 64 /* 1.3.14.3.2.26 (OBJ_sha1) */, + 70 /* 1.3.14.3.2.27 (OBJ_dsaWithSHA1_2) */, + 115 /* 1.3.14.3.2.29 (OBJ_sha1WithRSA) */, + 117 /* 1.3.36.3.2.1 (OBJ_ripemd160) */, + 143 /* 1.3.101.1.4.1 (OBJ_sxnet) */, + 721 /* 1.3.132.0.1 (OBJ_sect163k1) */, + 722 /* 1.3.132.0.2 (OBJ_sect163r1) */, + 728 /* 1.3.132.0.3 (OBJ_sect239k1) */, + 717 /* 1.3.132.0.4 (OBJ_sect113r1) */, + 718 /* 1.3.132.0.5 (OBJ_sect113r2) */, + 704 /* 1.3.132.0.6 (OBJ_secp112r1) */, + 705 /* 1.3.132.0.7 (OBJ_secp112r2) */, + 709 /* 1.3.132.0.8 (OBJ_secp160r1) */, + 708 /* 1.3.132.0.9 (OBJ_secp160k1) */, + 714 /* 1.3.132.0.10 (OBJ_secp256k1) */, + 723 /* 1.3.132.0.15 (OBJ_sect163r2) */, + 729 /* 1.3.132.0.16 (OBJ_sect283k1) */, + 730 /* 1.3.132.0.17 (OBJ_sect283r1) */, + 719 /* 1.3.132.0.22 (OBJ_sect131r1) */, + 720 /* 1.3.132.0.23 (OBJ_sect131r2) */, + 724 /* 1.3.132.0.24 (OBJ_sect193r1) */, + 725 /* 1.3.132.0.25 (OBJ_sect193r2) */, + 726 /* 1.3.132.0.26 (OBJ_sect233k1) */, + 727 /* 1.3.132.0.27 (OBJ_sect233r1) */, + 706 /* 1.3.132.0.28 (OBJ_secp128r1) */, + 707 /* 1.3.132.0.29 (OBJ_secp128r2) */, + 710 /* 1.3.132.0.30 (OBJ_secp160r2) */, + 711 /* 1.3.132.0.31 (OBJ_secp192k1) */, + 712 /* 1.3.132.0.32 (OBJ_secp224k1) */, + 713 /* 1.3.132.0.33 (OBJ_secp224r1) */, + 715 /* 1.3.132.0.34 (OBJ_secp384r1) */, + 716 /* 1.3.132.0.35 (OBJ_secp521r1) */, + 731 /* 1.3.132.0.36 (OBJ_sect409k1) */, + 732 /* 1.3.132.0.37 (OBJ_sect409r1) */, + 733 /* 1.3.132.0.38 (OBJ_sect571k1) */, + 734 /* 1.3.132.0.39 (OBJ_sect571r1) */, + 624 /* 2.23.42.3.0.0 (OBJ_set_rootKeyThumb) */, + 625 /* 2.23.42.3.0.1 (OBJ_set_addPolicy) */, + 626 /* 2.23.42.3.2.1 (OBJ_setAttr_Token_EMV) */, + 627 /* 2.23.42.3.2.2 (OBJ_setAttr_Token_B0Prime) */, + 628 /* 2.23.42.3.3.3 (OBJ_setAttr_IssCap_CVM) */, + 629 /* 2.23.42.3.3.4 (OBJ_setAttr_IssCap_T2) */, + 630 /* 2.23.42.3.3.5 (OBJ_setAttr_IssCap_Sig) */, + 642 /* 2.23.42.8.6011 (OBJ_set_brand_Novus) */, + 735 /* 2.23.43.1.4.1 (OBJ_wap_wsg_idm_ecid_wtls1) */, + 736 /* 2.23.43.1.4.3 (OBJ_wap_wsg_idm_ecid_wtls3) */, + 737 /* 2.23.43.1.4.4 (OBJ_wap_wsg_idm_ecid_wtls4) */, + 738 /* 2.23.43.1.4.5 (OBJ_wap_wsg_idm_ecid_wtls5) */, + 739 /* 2.23.43.1.4.6 (OBJ_wap_wsg_idm_ecid_wtls6) */, + 740 /* 2.23.43.1.4.7 (OBJ_wap_wsg_idm_ecid_wtls7) */, + 741 /* 2.23.43.1.4.8 (OBJ_wap_wsg_idm_ecid_wtls8) */, + 742 /* 2.23.43.1.4.9 (OBJ_wap_wsg_idm_ecid_wtls9) */, + 743 /* 2.23.43.1.4.10 (OBJ_wap_wsg_idm_ecid_wtls10) */, + 744 /* 2.23.43.1.4.11 (OBJ_wap_wsg_idm_ecid_wtls11) */, + 745 /* 2.23.43.1.4.12 (OBJ_wap_wsg_idm_ecid_wtls12) */, + 804 /* 1.0.10118.3.0.55 (OBJ_whirlpool) */, + 773 /* 1.2.410.200004 (OBJ_kisa) */, + 807 /* 1.2.643.2.2.3 (OBJ_id_GostR3411_94_with_GostR3410_2001) */, + 808 /* 1.2.643.2.2.4 (OBJ_id_GostR3411_94_with_GostR3410_94) */, + 809 /* 1.2.643.2.2.9 (OBJ_id_GostR3411_94) */, + 810 /* 1.2.643.2.2.10 (OBJ_id_HMACGostR3411_94) */, + 811 /* 1.2.643.2.2.19 (OBJ_id_GostR3410_2001) */, + 812 /* 1.2.643.2.2.20 (OBJ_id_GostR3410_94) */, + 813 /* 1.2.643.2.2.21 (OBJ_id_Gost28147_89) */, + 815 /* 1.2.643.2.2.22 (OBJ_id_Gost28147_89_MAC) */, + 816 /* 1.2.643.2.2.23 (OBJ_id_GostR3411_94_prf) */, + 817 /* 1.2.643.2.2.98 (OBJ_id_GostR3410_2001DH) */, + 818 /* 1.2.643.2.2.99 (OBJ_id_GostR3410_94DH) */, + 1 /* 1.2.840.113549 (OBJ_rsadsi) */, + 185 /* 1.2.840.10040.4 (OBJ_X9cm) */, + 127 /* 1.3.6.1.5.5.7 (OBJ_id_pkix) */, + 505 /* 1.3.6.1.7.1.1 (OBJ_mime_mhs_headings) */, + 506 /* 1.3.6.1.7.1.2 (OBJ_mime_mhs_bodies) */, + 119 /* 1.3.36.3.3.1.2 (OBJ_ripemd160WithRSA) */, + 937 /* 1.3.132.1.11.0 (OBJ_dhSinglePass_stdDH_sha224kdf_scheme) */, + 938 /* 1.3.132.1.11.1 (OBJ_dhSinglePass_stdDH_sha256kdf_scheme) */, + 939 /* 1.3.132.1.11.2 (OBJ_dhSinglePass_stdDH_sha384kdf_scheme) */, + 940 /* 1.3.132.1.11.3 (OBJ_dhSinglePass_stdDH_sha512kdf_scheme) */, + 942 /* 1.3.132.1.14.0 (OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme) */, + 943 /* 1.3.132.1.14.1 (OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme) */, + 944 /* 1.3.132.1.14.2 (OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme) */, + 945 /* 1.3.132.1.14.3 (OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme) */, + 631 /* 2.23.42.3.3.3.1 (OBJ_setAttr_GenCryptgrm) */, + 632 /* 2.23.42.3.3.4.1 (OBJ_setAttr_T2Enc) */, + 633 /* 2.23.42.3.3.4.2 (OBJ_setAttr_T2cleartxt) */, + 634 /* 2.23.42.3.3.5.1 (OBJ_setAttr_TokICCsig) */, + 635 /* 2.23.42.3.3.5.2 (OBJ_setAttr_SecDevSig) */, + 436 /* 0.9.2342.19200300 (OBJ_ucl) */, + 820 /* 1.2.643.2.2.14.0 (OBJ_id_Gost28147_89_None_KeyMeshing) */, + 819 /* 1.2.643.2.2.14.1 (OBJ_id_Gost28147_89_CryptoPro_KeyMeshing) */, + 845 /* 1.2.643.2.2.20.1 (OBJ_id_GostR3410_94_a) */, + 846 /* 1.2.643.2.2.20.2 (OBJ_id_GostR3410_94_aBis) */, + 847 /* 1.2.643.2.2.20.3 (OBJ_id_GostR3410_94_b) */, + 848 /* 1.2.643.2.2.20.4 (OBJ_id_GostR3410_94_bBis) */, + 821 /* 1.2.643.2.2.30.0 (OBJ_id_GostR3411_94_TestParamSet) */, + 822 /* 1.2.643.2.2.30.1 (OBJ_id_GostR3411_94_CryptoProParamSet) */, + 823 /* 1.2.643.2.2.31.0 (OBJ_id_Gost28147_89_TestParamSet) */, + 824 /* 1.2.643.2.2.31.1 (OBJ_id_Gost28147_89_CryptoPro_A_ParamSet) */, + 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) + */ + , + 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) */, + 832 /* 1.2.643.2.2.32.2 (OBJ_id_GostR3410_94_CryptoPro_A_ParamSet) */, + 833 /* 1.2.643.2.2.32.3 (OBJ_id_GostR3410_94_CryptoPro_B_ParamSet) */, + 834 /* 1.2.643.2.2.32.4 (OBJ_id_GostR3410_94_CryptoPro_C_ParamSet) */, + 835 /* 1.2.643.2.2.32.5 (OBJ_id_GostR3410_94_CryptoPro_D_ParamSet) */, + 836 /* 1.2.643.2.2.33.1 (OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet) */, + 837 /* 1.2.643.2.2.33.2 (OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet) */, + 838 /* 1.2.643.2.2.33.3 (OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet) */, + 839 /* 1.2.643.2.2.35.0 (OBJ_id_GostR3410_2001_TestParamSet) */, + 840 /* 1.2.643.2.2.35.1 (OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet) */, + 841 /* 1.2.643.2.2.35.2 (OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet) */, + 842 /* 1.2.643.2.2.35.3 (OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet) */, + 843 /* 1.2.643.2.2.36.0 (OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet) */, + 844 /* 1.2.643.2.2.36.1 (OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet) */, + 2 /* 1.2.840.113549.1 (OBJ_pkcs) */, + 431 /* 1.2.840.10040.2.1 (OBJ_hold_instruction_none) */, + 432 /* 1.2.840.10040.2.2 (OBJ_hold_instruction_call_issuer) */, + 433 /* 1.2.840.10040.2.3 (OBJ_hold_instruction_reject) */, + 116 /* 1.2.840.10040.4.1 (OBJ_dsa) */, + 113 /* 1.2.840.10040.4.3 (OBJ_dsaWithSHA1) */, + 406 /* 1.2.840.10045.1.1 (OBJ_X9_62_prime_field) */, + 407 /* 1.2.840.10045.1.2 (OBJ_X9_62_characteristic_two_field) */, + 408 /* 1.2.840.10045.2.1 (OBJ_X9_62_id_ecPublicKey) */, + 416 /* 1.2.840.10045.4.1 (OBJ_ecdsa_with_SHA1) */, + 791 /* 1.2.840.10045.4.2 (OBJ_ecdsa_with_Recommended) */, + 792 /* 1.2.840.10045.4.3 (OBJ_ecdsa_with_Specified) */, + 920 /* 1.2.840.10046.2.1 (OBJ_dhpublicnumber) */, + 258 /* 1.3.6.1.5.5.7.0 (OBJ_id_pkix_mod) */, + 175 /* 1.3.6.1.5.5.7.1 (OBJ_id_pe) */, + 259 /* 1.3.6.1.5.5.7.2 (OBJ_id_qt) */, + 128 /* 1.3.6.1.5.5.7.3 (OBJ_id_kp) */, + 260 /* 1.3.6.1.5.5.7.4 (OBJ_id_it) */, + 261 /* 1.3.6.1.5.5.7.5 (OBJ_id_pkip) */, + 262 /* 1.3.6.1.5.5.7.6 (OBJ_id_alg) */, + 263 /* 1.3.6.1.5.5.7.7 (OBJ_id_cmc) */, + 264 /* 1.3.6.1.5.5.7.8 (OBJ_id_on) */, + 265 /* 1.3.6.1.5.5.7.9 (OBJ_id_pda) */, + 266 /* 1.3.6.1.5.5.7.10 (OBJ_id_aca) */, + 267 /* 1.3.6.1.5.5.7.11 (OBJ_id_qcs) */, + 268 /* 1.3.6.1.5.5.7.12 (OBJ_id_cct) */, + 662 /* 1.3.6.1.5.5.7.21 (OBJ_id_ppl) */, + 176 /* 1.3.6.1.5.5.7.48 (OBJ_id_ad) */, + 507 /* 1.3.6.1.7.1.1.1 (OBJ_id_hex_partial_message) */, + 508 /* 1.3.6.1.7.1.1.2 (OBJ_id_hex_multipart_message) */, + 57 /* 2.16.840.1.113730 (OBJ_netscape) */, + 754 /* 0.3.4401.5.3.1.9.1 (OBJ_camellia_128_ecb) */, + 766 /* 0.3.4401.5.3.1.9.3 (OBJ_camellia_128_ofb128) */, + 757 /* 0.3.4401.5.3.1.9.4 (OBJ_camellia_128_cfb128) */, + 755 /* 0.3.4401.5.3.1.9.21 (OBJ_camellia_192_ecb) */, + 767 /* 0.3.4401.5.3.1.9.23 (OBJ_camellia_192_ofb128) */, + 758 /* 0.3.4401.5.3.1.9.24 (OBJ_camellia_192_cfb128) */, + 756 /* 0.3.4401.5.3.1.9.41 (OBJ_camellia_256_ecb) */, + 768 /* 0.3.4401.5.3.1.9.43 (OBJ_camellia_256_ofb128) */, + 759 /* 0.3.4401.5.3.1.9.44 (OBJ_camellia_256_cfb128) */, + 437 /* 0.9.2342.19200300.100 (OBJ_pilot) */, + 776 /* 1.2.410.200004.1.3 (OBJ_seed_ecb) */, + 777 /* 1.2.410.200004.1.4 (OBJ_seed_cbc) */, + 779 /* 1.2.410.200004.1.5 (OBJ_seed_cfb128) */, + 778 /* 1.2.410.200004.1.6 (OBJ_seed_ofb128) */, + 852 /* 1.2.643.2.9.1.3.3 (OBJ_id_GostR3411_94_with_GostR3410_94_cc) */, + 853 /* 1.2.643.2.9.1.3.4 (OBJ_id_GostR3411_94_with_GostR3410_2001_cc) */, + 850 /* 1.2.643.2.9.1.5.3 (OBJ_id_GostR3410_94_cc) */, + 851 /* 1.2.643.2.9.1.5.4 (OBJ_id_GostR3410_2001_cc) */, + 849 /* 1.2.643.2.9.1.6.1 (OBJ_id_Gost28147_89_cc) */, + 854 /* 1.2.643.2.9.1.8.1 (OBJ_id_GostR3410_2001_ParamSet_cc) */, + 186 /* 1.2.840.113549.1.1 (OBJ_pkcs1) */, + 27 /* 1.2.840.113549.1.3 (OBJ_pkcs3) */, + 187 /* 1.2.840.113549.1.5 (OBJ_pkcs5) */, + 20 /* 1.2.840.113549.1.7 (OBJ_pkcs7) */, + 47 /* 1.2.840.113549.1.9 (OBJ_pkcs9) */, + 3 /* 1.2.840.113549.2.2 (OBJ_md2) */, + 257 /* 1.2.840.113549.2.4 (OBJ_md4) */, + 4 /* 1.2.840.113549.2.5 (OBJ_md5) */, + 797 /* 1.2.840.113549.2.6 (OBJ_hmacWithMD5) */, + 163 /* 1.2.840.113549.2.7 (OBJ_hmacWithSHA1) */, + 798 /* 1.2.840.113549.2.8 (OBJ_hmacWithSHA224) */, + 799 /* 1.2.840.113549.2.9 (OBJ_hmacWithSHA256) */, + 800 /* 1.2.840.113549.2.10 (OBJ_hmacWithSHA384) */, + 801 /* 1.2.840.113549.2.11 (OBJ_hmacWithSHA512) */, + 37 /* 1.2.840.113549.3.2 (OBJ_rc2_cbc) */, + 5 /* 1.2.840.113549.3.4 (OBJ_rc4) */, + 44 /* 1.2.840.113549.3.7 (OBJ_des_ede3_cbc) */, + 120 /* 1.2.840.113549.3.8 (OBJ_rc5_cbc) */, + 643 /* 1.2.840.113549.3.10 (OBJ_des_cdmf) */, + 680 /* 1.2.840.10045.1.2.3 (OBJ_X9_62_id_characteristic_two_basis) */, + 684 /* 1.2.840.10045.3.0.1 (OBJ_X9_62_c2pnb163v1) */, + 685 /* 1.2.840.10045.3.0.2 (OBJ_X9_62_c2pnb163v2) */, + 686 /* 1.2.840.10045.3.0.3 (OBJ_X9_62_c2pnb163v3) */, + 687 /* 1.2.840.10045.3.0.4 (OBJ_X9_62_c2pnb176v1) */, + 688 /* 1.2.840.10045.3.0.5 (OBJ_X9_62_c2tnb191v1) */, + 689 /* 1.2.840.10045.3.0.6 (OBJ_X9_62_c2tnb191v2) */, + 690 /* 1.2.840.10045.3.0.7 (OBJ_X9_62_c2tnb191v3) */, + 691 /* 1.2.840.10045.3.0.8 (OBJ_X9_62_c2onb191v4) */, + 692 /* 1.2.840.10045.3.0.9 (OBJ_X9_62_c2onb191v5) */, + 693 /* 1.2.840.10045.3.0.10 (OBJ_X9_62_c2pnb208w1) */, + 694 /* 1.2.840.10045.3.0.11 (OBJ_X9_62_c2tnb239v1) */, + 695 /* 1.2.840.10045.3.0.12 (OBJ_X9_62_c2tnb239v2) */, + 696 /* 1.2.840.10045.3.0.13 (OBJ_X9_62_c2tnb239v3) */, + 697 /* 1.2.840.10045.3.0.14 (OBJ_X9_62_c2onb239v4) */, + 698 /* 1.2.840.10045.3.0.15 (OBJ_X9_62_c2onb239v5) */, + 699 /* 1.2.840.10045.3.0.16 (OBJ_X9_62_c2pnb272w1) */, + 700 /* 1.2.840.10045.3.0.17 (OBJ_X9_62_c2pnb304w1) */, + 701 /* 1.2.840.10045.3.0.18 (OBJ_X9_62_c2tnb359v1) */, + 702 /* 1.2.840.10045.3.0.19 (OBJ_X9_62_c2pnb368w1) */, + 703 /* 1.2.840.10045.3.0.20 (OBJ_X9_62_c2tnb431r1) */, + 409 /* 1.2.840.10045.3.1.1 (OBJ_X9_62_prime192v1) */, + 410 /* 1.2.840.10045.3.1.2 (OBJ_X9_62_prime192v2) */, + 411 /* 1.2.840.10045.3.1.3 (OBJ_X9_62_prime192v3) */, + 412 /* 1.2.840.10045.3.1.4 (OBJ_X9_62_prime239v1) */, + 413 /* 1.2.840.10045.3.1.5 (OBJ_X9_62_prime239v2) */, + 414 /* 1.2.840.10045.3.1.6 (OBJ_X9_62_prime239v3) */, + 415 /* 1.2.840.10045.3.1.7 (OBJ_X9_62_prime256v1) */, + 793 /* 1.2.840.10045.4.3.1 (OBJ_ecdsa_with_SHA224) */, + 794 /* 1.2.840.10045.4.3.2 (OBJ_ecdsa_with_SHA256) */, + 795 /* 1.2.840.10045.4.3.3 (OBJ_ecdsa_with_SHA384) */, + 796 /* 1.2.840.10045.4.3.4 (OBJ_ecdsa_with_SHA512) */, + 269 /* 1.3.6.1.5.5.7.0.1 (OBJ_id_pkix1_explicit_88) */, + 270 /* 1.3.6.1.5.5.7.0.2 (OBJ_id_pkix1_implicit_88) */, + 271 /* 1.3.6.1.5.5.7.0.3 (OBJ_id_pkix1_explicit_93) */, + 272 /* 1.3.6.1.5.5.7.0.4 (OBJ_id_pkix1_implicit_93) */, + 273 /* 1.3.6.1.5.5.7.0.5 (OBJ_id_mod_crmf) */, + 274 /* 1.3.6.1.5.5.7.0.6 (OBJ_id_mod_cmc) */, + 275 /* 1.3.6.1.5.5.7.0.7 (OBJ_id_mod_kea_profile_88) */, + 276 /* 1.3.6.1.5.5.7.0.8 (OBJ_id_mod_kea_profile_93) */, + 277 /* 1.3.6.1.5.5.7.0.9 (OBJ_id_mod_cmp) */, + 278 /* 1.3.6.1.5.5.7.0.10 (OBJ_id_mod_qualified_cert_88) */, + 279 /* 1.3.6.1.5.5.7.0.11 (OBJ_id_mod_qualified_cert_93) */, + 280 /* 1.3.6.1.5.5.7.0.12 (OBJ_id_mod_attribute_cert) */, + 281 /* 1.3.6.1.5.5.7.0.13 (OBJ_id_mod_timestamp_protocol) */, + 282 /* 1.3.6.1.5.5.7.0.14 (OBJ_id_mod_ocsp) */, + 283 /* 1.3.6.1.5.5.7.0.15 (OBJ_id_mod_dvcs) */, + 284 /* 1.3.6.1.5.5.7.0.16 (OBJ_id_mod_cmp2000) */, + 177 /* 1.3.6.1.5.5.7.1.1 (OBJ_info_access) */, + 285 /* 1.3.6.1.5.5.7.1.2 (OBJ_biometricInfo) */, + 286 /* 1.3.6.1.5.5.7.1.3 (OBJ_qcStatements) */, + 287 /* 1.3.6.1.5.5.7.1.4 (OBJ_ac_auditEntity) */, + 288 /* 1.3.6.1.5.5.7.1.5 (OBJ_ac_targeting) */, + 289 /* 1.3.6.1.5.5.7.1.6 (OBJ_aaControls) */, + 290 /* 1.3.6.1.5.5.7.1.7 (OBJ_sbgp_ipAddrBlock) */, + 291 /* 1.3.6.1.5.5.7.1.8 (OBJ_sbgp_autonomousSysNum) */, + 292 /* 1.3.6.1.5.5.7.1.9 (OBJ_sbgp_routerIdentifier) */, + 397 /* 1.3.6.1.5.5.7.1.10 (OBJ_ac_proxying) */, + 398 /* 1.3.6.1.5.5.7.1.11 (OBJ_sinfo_access) */, + 663 /* 1.3.6.1.5.5.7.1.14 (OBJ_proxyCertInfo) */, + 164 /* 1.3.6.1.5.5.7.2.1 (OBJ_id_qt_cps) */, + 165 /* 1.3.6.1.5.5.7.2.2 (OBJ_id_qt_unotice) */, + 293 /* 1.3.6.1.5.5.7.2.3 (OBJ_textNotice) */, + 129 /* 1.3.6.1.5.5.7.3.1 (OBJ_server_auth) */, + 130 /* 1.3.6.1.5.5.7.3.2 (OBJ_client_auth) */, + 131 /* 1.3.6.1.5.5.7.3.3 (OBJ_code_sign) */, + 132 /* 1.3.6.1.5.5.7.3.4 (OBJ_email_protect) */, + 294 /* 1.3.6.1.5.5.7.3.5 (OBJ_ipsecEndSystem) */, + 295 /* 1.3.6.1.5.5.7.3.6 (OBJ_ipsecTunnel) */, + 296 /* 1.3.6.1.5.5.7.3.7 (OBJ_ipsecUser) */, + 133 /* 1.3.6.1.5.5.7.3.8 (OBJ_time_stamp) */, + 180 /* 1.3.6.1.5.5.7.3.9 (OBJ_OCSP_sign) */, + 297 /* 1.3.6.1.5.5.7.3.10 (OBJ_dvcs) */, + 298 /* 1.3.6.1.5.5.7.4.1 (OBJ_id_it_caProtEncCert) */, + 299 /* 1.3.6.1.5.5.7.4.2 (OBJ_id_it_signKeyPairTypes) */, + 300 /* 1.3.6.1.5.5.7.4.3 (OBJ_id_it_encKeyPairTypes) */, + 301 /* 1.3.6.1.5.5.7.4.4 (OBJ_id_it_preferredSymmAlg) */, + 302 /* 1.3.6.1.5.5.7.4.5 (OBJ_id_it_caKeyUpdateInfo) */, + 303 /* 1.3.6.1.5.5.7.4.6 (OBJ_id_it_currentCRL) */, + 304 /* 1.3.6.1.5.5.7.4.7 (OBJ_id_it_unsupportedOIDs) */, + 305 /* 1.3.6.1.5.5.7.4.8 (OBJ_id_it_subscriptionRequest) */, + 306 /* 1.3.6.1.5.5.7.4.9 (OBJ_id_it_subscriptionResponse) */, + 307 /* 1.3.6.1.5.5.7.4.10 (OBJ_id_it_keyPairParamReq) */, + 308 /* 1.3.6.1.5.5.7.4.11 (OBJ_id_it_keyPairParamRep) */, + 309 /* 1.3.6.1.5.5.7.4.12 (OBJ_id_it_revPassphrase) */, + 310 /* 1.3.6.1.5.5.7.4.13 (OBJ_id_it_implicitConfirm) */, + 311 /* 1.3.6.1.5.5.7.4.14 (OBJ_id_it_confirmWaitTime) */, + 312 /* 1.3.6.1.5.5.7.4.15 (OBJ_id_it_origPKIMessage) */, + 784 /* 1.3.6.1.5.5.7.4.16 (OBJ_id_it_suppLangTags) */, + 313 /* 1.3.6.1.5.5.7.5.1 (OBJ_id_regCtrl) */, + 314 /* 1.3.6.1.5.5.7.5.2 (OBJ_id_regInfo) */, + 323 /* 1.3.6.1.5.5.7.6.1 (OBJ_id_alg_des40) */, + 324 /* 1.3.6.1.5.5.7.6.2 (OBJ_id_alg_noSignature) */, + 325 /* 1.3.6.1.5.5.7.6.3 (OBJ_id_alg_dh_sig_hmac_sha1) */, + 326 /* 1.3.6.1.5.5.7.6.4 (OBJ_id_alg_dh_pop) */, + 327 /* 1.3.6.1.5.5.7.7.1 (OBJ_id_cmc_statusInfo) */, + 328 /* 1.3.6.1.5.5.7.7.2 (OBJ_id_cmc_identification) */, + 329 /* 1.3.6.1.5.5.7.7.3 (OBJ_id_cmc_identityProof) */, + 330 /* 1.3.6.1.5.5.7.7.4 (OBJ_id_cmc_dataReturn) */, + 331 /* 1.3.6.1.5.5.7.7.5 (OBJ_id_cmc_transactionId) */, + 332 /* 1.3.6.1.5.5.7.7.6 (OBJ_id_cmc_senderNonce) */, + 333 /* 1.3.6.1.5.5.7.7.7 (OBJ_id_cmc_recipientNonce) */, + 334 /* 1.3.6.1.5.5.7.7.8 (OBJ_id_cmc_addExtensions) */, + 335 /* 1.3.6.1.5.5.7.7.9 (OBJ_id_cmc_encryptedPOP) */, + 336 /* 1.3.6.1.5.5.7.7.10 (OBJ_id_cmc_decryptedPOP) */, + 337 /* 1.3.6.1.5.5.7.7.11 (OBJ_id_cmc_lraPOPWitness) */, + 338 /* 1.3.6.1.5.5.7.7.15 (OBJ_id_cmc_getCert) */, + 339 /* 1.3.6.1.5.5.7.7.16 (OBJ_id_cmc_getCRL) */, + 340 /* 1.3.6.1.5.5.7.7.17 (OBJ_id_cmc_revokeRequest) */, + 341 /* 1.3.6.1.5.5.7.7.18 (OBJ_id_cmc_regInfo) */, + 342 /* 1.3.6.1.5.5.7.7.19 (OBJ_id_cmc_responseInfo) */, + 343 /* 1.3.6.1.5.5.7.7.21 (OBJ_id_cmc_queryPending) */, + 344 /* 1.3.6.1.5.5.7.7.22 (OBJ_id_cmc_popLinkRandom) */, + 345 /* 1.3.6.1.5.5.7.7.23 (OBJ_id_cmc_popLinkWitness) */, + 346 /* 1.3.6.1.5.5.7.7.24 (OBJ_id_cmc_confirmCertAcceptance) */, + 347 /* 1.3.6.1.5.5.7.8.1 (OBJ_id_on_personalData) */, + 858 /* 1.3.6.1.5.5.7.8.3 (OBJ_id_on_permanentIdentifier) */, + 348 /* 1.3.6.1.5.5.7.9.1 (OBJ_id_pda_dateOfBirth) */, + 349 /* 1.3.6.1.5.5.7.9.2 (OBJ_id_pda_placeOfBirth) */, + 351 /* 1.3.6.1.5.5.7.9.3 (OBJ_id_pda_gender) */, + 352 /* 1.3.6.1.5.5.7.9.4 (OBJ_id_pda_countryOfCitizenship) */, + 353 /* 1.3.6.1.5.5.7.9.5 (OBJ_id_pda_countryOfResidence) */, + 354 /* 1.3.6.1.5.5.7.10.1 (OBJ_id_aca_authenticationInfo) */, + 355 /* 1.3.6.1.5.5.7.10.2 (OBJ_id_aca_accessIdentity) */, + 356 /* 1.3.6.1.5.5.7.10.3 (OBJ_id_aca_chargingIdentity) */, + 357 /* 1.3.6.1.5.5.7.10.4 (OBJ_id_aca_group) */, + 358 /* 1.3.6.1.5.5.7.10.5 (OBJ_id_aca_role) */, + 399 /* 1.3.6.1.5.5.7.10.6 (OBJ_id_aca_encAttrs) */, + 359 /* 1.3.6.1.5.5.7.11.1 (OBJ_id_qcs_pkixQCSyntax_v1) */, + 360 /* 1.3.6.1.5.5.7.12.1 (OBJ_id_cct_crs) */, + 361 /* 1.3.6.1.5.5.7.12.2 (OBJ_id_cct_PKIData) */, + 362 /* 1.3.6.1.5.5.7.12.3 (OBJ_id_cct_PKIResponse) */, + 664 /* 1.3.6.1.5.5.7.21.0 (OBJ_id_ppl_anyLanguage) */, + 665 /* 1.3.6.1.5.5.7.21.1 (OBJ_id_ppl_inheritAll) */, + 667 /* 1.3.6.1.5.5.7.21.2 (OBJ_Independent) */, + 178 /* 1.3.6.1.5.5.7.48.1 (OBJ_ad_OCSP) */, + 179 /* 1.3.6.1.5.5.7.48.2 (OBJ_ad_ca_issuers) */, + 363 /* 1.3.6.1.5.5.7.48.3 (OBJ_ad_timeStamping) */, + 364 /* 1.3.6.1.5.5.7.48.4 (OBJ_ad_dvcs) */, + 785 /* 1.3.6.1.5.5.7.48.5 (OBJ_caRepository) */, + 780 /* 1.3.6.1.5.5.8.1.1 (OBJ_hmac_md5) */, + 781 /* 1.3.6.1.5.5.8.1.2 (OBJ_hmac_sha1) */, + 58 /* 2.16.840.1.113730.1 (OBJ_netscape_cert_extension) */, + 59 /* 2.16.840.1.113730.2 (OBJ_netscape_data_type) */, + 438 /* 0.9.2342.19200300.100.1 (OBJ_pilotAttributeType) */, + 439 /* 0.9.2342.19200300.100.3 (OBJ_pilotAttributeSyntax) */, + 440 /* 0.9.2342.19200300.100.4 (OBJ_pilotObjectClass) */, + 441 /* 0.9.2342.19200300.100.10 (OBJ_pilotGroups) */, + 108 /* 1.2.840.113533.7.66.10 (OBJ_cast5_cbc) */, + 112 /* 1.2.840.113533.7.66.12 (OBJ_pbeWithMD5AndCast5_CBC) */, + 782 /* 1.2.840.113533.7.66.13 (OBJ_id_PasswordBasedMAC) */, + 783 /* 1.2.840.113533.7.66.30 (OBJ_id_DHBasedMac) */, + 6 /* 1.2.840.113549.1.1.1 (OBJ_rsaEncryption) */, + 7 /* 1.2.840.113549.1.1.2 (OBJ_md2WithRSAEncryption) */, + 396 /* 1.2.840.113549.1.1.3 (OBJ_md4WithRSAEncryption) */, + 8 /* 1.2.840.113549.1.1.4 (OBJ_md5WithRSAEncryption) */, + 65 /* 1.2.840.113549.1.1.5 (OBJ_sha1WithRSAEncryption) */, + 644 /* 1.2.840.113549.1.1.6 (OBJ_rsaOAEPEncryptionSET) */, + 919 /* 1.2.840.113549.1.1.7 (OBJ_rsaesOaep) */, + 911 /* 1.2.840.113549.1.1.8 (OBJ_mgf1) */, + 935 /* 1.2.840.113549.1.1.9 (OBJ_pSpecified) */, + 912 /* 1.2.840.113549.1.1.10 (OBJ_rsassaPss) */, + 668 /* 1.2.840.113549.1.1.11 (OBJ_sha256WithRSAEncryption) */, + 669 /* 1.2.840.113549.1.1.12 (OBJ_sha384WithRSAEncryption) */, + 670 /* 1.2.840.113549.1.1.13 (OBJ_sha512WithRSAEncryption) */, + 671 /* 1.2.840.113549.1.1.14 (OBJ_sha224WithRSAEncryption) */, + 28 /* 1.2.840.113549.1.3.1 (OBJ_dhKeyAgreement) */, + 9 /* 1.2.840.113549.1.5.1 (OBJ_pbeWithMD2AndDES_CBC) */, + 10 /* 1.2.840.113549.1.5.3 (OBJ_pbeWithMD5AndDES_CBC) */, + 168 /* 1.2.840.113549.1.5.4 (OBJ_pbeWithMD2AndRC2_CBC) */, + 169 /* 1.2.840.113549.1.5.6 (OBJ_pbeWithMD5AndRC2_CBC) */, + 170 /* 1.2.840.113549.1.5.10 (OBJ_pbeWithSHA1AndDES_CBC) */, + 68 /* 1.2.840.113549.1.5.11 (OBJ_pbeWithSHA1AndRC2_CBC) */, + 69 /* 1.2.840.113549.1.5.12 (OBJ_id_pbkdf2) */, + 161 /* 1.2.840.113549.1.5.13 (OBJ_pbes2) */, + 162 /* 1.2.840.113549.1.5.14 (OBJ_pbmac1) */, + 21 /* 1.2.840.113549.1.7.1 (OBJ_pkcs7_data) */, + 22 /* 1.2.840.113549.1.7.2 (OBJ_pkcs7_signed) */, + 23 /* 1.2.840.113549.1.7.3 (OBJ_pkcs7_enveloped) */, + 24 /* 1.2.840.113549.1.7.4 (OBJ_pkcs7_signedAndEnveloped) */, + 25 /* 1.2.840.113549.1.7.5 (OBJ_pkcs7_digest) */, + 26 /* 1.2.840.113549.1.7.6 (OBJ_pkcs7_encrypted) */, + 48 /* 1.2.840.113549.1.9.1 (OBJ_pkcs9_emailAddress) */, + 49 /* 1.2.840.113549.1.9.2 (OBJ_pkcs9_unstructuredName) */, + 50 /* 1.2.840.113549.1.9.3 (OBJ_pkcs9_contentType) */, + 51 /* 1.2.840.113549.1.9.4 (OBJ_pkcs9_messageDigest) */, + 52 /* 1.2.840.113549.1.9.5 (OBJ_pkcs9_signingTime) */, + 53 /* 1.2.840.113549.1.9.6 (OBJ_pkcs9_countersignature) */, + 54 /* 1.2.840.113549.1.9.7 (OBJ_pkcs9_challengePassword) */, + 55 /* 1.2.840.113549.1.9.8 (OBJ_pkcs9_unstructuredAddress) */, + 56 /* 1.2.840.113549.1.9.9 (OBJ_pkcs9_extCertAttributes) */, + 172 /* 1.2.840.113549.1.9.14 (OBJ_ext_req) */, + 167 /* 1.2.840.113549.1.9.15 (OBJ_SMIMECapabilities) */, + 188 /* 1.2.840.113549.1.9.16 (OBJ_SMIME) */, + 156 /* 1.2.840.113549.1.9.20 (OBJ_friendlyName) */, + 157 /* 1.2.840.113549.1.9.21 (OBJ_localKeyID) */, + 681 /* 1.2.840.10045.1.2.3.1 (OBJ_X9_62_onBasis) */, + 682 /* 1.2.840.10045.1.2.3.2 (OBJ_X9_62_tpBasis) */, + 683 /* 1.2.840.10045.1.2.3.3 (OBJ_X9_62_ppBasis) */, + 417 /* 1.3.6.1.4.1.311.17.1 (OBJ_ms_csp_name) */, + 856 /* 1.3.6.1.4.1.311.17.2 (OBJ_LocalKeySet) */, + 390 /* 1.3.6.1.4.1.1466.344 (OBJ_dcObject) */, + 91 /* 1.3.6.1.4.1.3029.1.2 (OBJ_bf_cbc) */, + 315 /* 1.3.6.1.5.5.7.5.1.1 (OBJ_id_regCtrl_regToken) */, + 316 /* 1.3.6.1.5.5.7.5.1.2 (OBJ_id_regCtrl_authenticator) */, + 317 /* 1.3.6.1.5.5.7.5.1.3 (OBJ_id_regCtrl_pkiPublicationInfo) */, + 318 /* 1.3.6.1.5.5.7.5.1.4 (OBJ_id_regCtrl_pkiArchiveOptions) */, + 319 /* 1.3.6.1.5.5.7.5.1.5 (OBJ_id_regCtrl_oldCertID) */, + 320 /* 1.3.6.1.5.5.7.5.1.6 (OBJ_id_regCtrl_protocolEncrKey) */, + 321 /* 1.3.6.1.5.5.7.5.2.1 (OBJ_id_regInfo_utf8Pairs) */, + 322 /* 1.3.6.1.5.5.7.5.2.2 (OBJ_id_regInfo_certReq) */, + 365 /* 1.3.6.1.5.5.7.48.1.1 (OBJ_id_pkix_OCSP_basic) */, + 366 /* 1.3.6.1.5.5.7.48.1.2 (OBJ_id_pkix_OCSP_Nonce) */, + 367 /* 1.3.6.1.5.5.7.48.1.3 (OBJ_id_pkix_OCSP_CrlID) */, + 368 /* 1.3.6.1.5.5.7.48.1.4 (OBJ_id_pkix_OCSP_acceptableResponses) */, + 369 /* 1.3.6.1.5.5.7.48.1.5 (OBJ_id_pkix_OCSP_noCheck) */, + 370 /* 1.3.6.1.5.5.7.48.1.6 (OBJ_id_pkix_OCSP_archiveCutoff) */, + 371 /* 1.3.6.1.5.5.7.48.1.7 (OBJ_id_pkix_OCSP_serviceLocator) */, + 372 /* 1.3.6.1.5.5.7.48.1.8 (OBJ_id_pkix_OCSP_extendedStatus) */, + 373 /* 1.3.6.1.5.5.7.48.1.9 (OBJ_id_pkix_OCSP_valid) */, + 374 /* 1.3.6.1.5.5.7.48.1.10 (OBJ_id_pkix_OCSP_path) */, + 375 /* 1.3.6.1.5.5.7.48.1.11 (OBJ_id_pkix_OCSP_trustRoot) */, + 921 /* 1.3.36.3.3.2.8.1.1.1 (OBJ_brainpoolP160r1) */, + 922 /* 1.3.36.3.3.2.8.1.1.2 (OBJ_brainpoolP160t1) */, + 923 /* 1.3.36.3.3.2.8.1.1.3 (OBJ_brainpoolP192r1) */, + 924 /* 1.3.36.3.3.2.8.1.1.4 (OBJ_brainpoolP192t1) */, + 925 /* 1.3.36.3.3.2.8.1.1.5 (OBJ_brainpoolP224r1) */, + 926 /* 1.3.36.3.3.2.8.1.1.6 (OBJ_brainpoolP224t1) */, + 927 /* 1.3.36.3.3.2.8.1.1.7 (OBJ_brainpoolP256r1) */, + 928 /* 1.3.36.3.3.2.8.1.1.8 (OBJ_brainpoolP256t1) */, + 929 /* 1.3.36.3.3.2.8.1.1.9 (OBJ_brainpoolP320r1) */, + 930 /* 1.3.36.3.3.2.8.1.1.10 (OBJ_brainpoolP320t1) */, + 931 /* 1.3.36.3.3.2.8.1.1.11 (OBJ_brainpoolP384r1) */, + 932 /* 1.3.36.3.3.2.8.1.1.12 (OBJ_brainpoolP384t1) */, + 933 /* 1.3.36.3.3.2.8.1.1.13 (OBJ_brainpoolP512r1) */, + 934 /* 1.3.36.3.3.2.8.1.1.14 (OBJ_brainpoolP512t1) */, + 936 /* 1.3.133.16.840.63.0.2 (OBJ_dhSinglePass_stdDH_sha1kdf_scheme) */, + 941 /* 1.3.133.16.840.63.0.3 (OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme) */ + , + 418 /* 2.16.840.1.101.3.4.1.1 (OBJ_aes_128_ecb) */, + 419 /* 2.16.840.1.101.3.4.1.2 (OBJ_aes_128_cbc) */, + 420 /* 2.16.840.1.101.3.4.1.3 (OBJ_aes_128_ofb128) */, + 421 /* 2.16.840.1.101.3.4.1.4 (OBJ_aes_128_cfb128) */, + 788 /* 2.16.840.1.101.3.4.1.5 (OBJ_id_aes128_wrap) */, + 895 /* 2.16.840.1.101.3.4.1.6 (OBJ_aes_128_gcm) */, + 896 /* 2.16.840.1.101.3.4.1.7 (OBJ_aes_128_ccm) */, + 897 /* 2.16.840.1.101.3.4.1.8 (OBJ_id_aes128_wrap_pad) */, + 422 /* 2.16.840.1.101.3.4.1.21 (OBJ_aes_192_ecb) */, + 423 /* 2.16.840.1.101.3.4.1.22 (OBJ_aes_192_cbc) */, + 424 /* 2.16.840.1.101.3.4.1.23 (OBJ_aes_192_ofb128) */, + 425 /* 2.16.840.1.101.3.4.1.24 (OBJ_aes_192_cfb128) */, + 789 /* 2.16.840.1.101.3.4.1.25 (OBJ_id_aes192_wrap) */, + 898 /* 2.16.840.1.101.3.4.1.26 (OBJ_aes_192_gcm) */, + 899 /* 2.16.840.1.101.3.4.1.27 (OBJ_aes_192_ccm) */, + 900 /* 2.16.840.1.101.3.4.1.28 (OBJ_id_aes192_wrap_pad) */, + 426 /* 2.16.840.1.101.3.4.1.41 (OBJ_aes_256_ecb) */, + 427 /* 2.16.840.1.101.3.4.1.42 (OBJ_aes_256_cbc) */, + 428 /* 2.16.840.1.101.3.4.1.43 (OBJ_aes_256_ofb128) */, + 429 /* 2.16.840.1.101.3.4.1.44 (OBJ_aes_256_cfb128) */, + 790 /* 2.16.840.1.101.3.4.1.45 (OBJ_id_aes256_wrap) */, + 901 /* 2.16.840.1.101.3.4.1.46 (OBJ_aes_256_gcm) */, + 902 /* 2.16.840.1.101.3.4.1.47 (OBJ_aes_256_ccm) */, + 903 /* 2.16.840.1.101.3.4.1.48 (OBJ_id_aes256_wrap_pad) */, + 672 /* 2.16.840.1.101.3.4.2.1 (OBJ_sha256) */, + 673 /* 2.16.840.1.101.3.4.2.2 (OBJ_sha384) */, + 674 /* 2.16.840.1.101.3.4.2.3 (OBJ_sha512) */, + 675 /* 2.16.840.1.101.3.4.2.4 (OBJ_sha224) */, + 802 /* 2.16.840.1.101.3.4.3.1 (OBJ_dsa_with_SHA224) */, + 803 /* 2.16.840.1.101.3.4.3.2 (OBJ_dsa_with_SHA256) */, + 71 /* 2.16.840.1.113730.1.1 (OBJ_netscape_cert_type) */, + 72 /* 2.16.840.1.113730.1.2 (OBJ_netscape_base_url) */, + 73 /* 2.16.840.1.113730.1.3 (OBJ_netscape_revocation_url) */, + 74 /* 2.16.840.1.113730.1.4 (OBJ_netscape_ca_revocation_url) */, + 75 /* 2.16.840.1.113730.1.7 (OBJ_netscape_renewal_url) */, + 76 /* 2.16.840.1.113730.1.8 (OBJ_netscape_ca_policy_url) */, + 77 /* 2.16.840.1.113730.1.12 (OBJ_netscape_ssl_server_name) */, + 78 /* 2.16.840.1.113730.1.13 (OBJ_netscape_comment) */, + 79 /* 2.16.840.1.113730.2.5 (OBJ_netscape_cert_sequence) */, + 139 /* 2.16.840.1.113730.4.1 (OBJ_ns_sgc) */, + 458 /* 0.9.2342.19200300.100.1.1 (OBJ_userId) */, + 459 /* 0.9.2342.19200300.100.1.2 (OBJ_textEncodedORAddress) */, + 460 /* 0.9.2342.19200300.100.1.3 (OBJ_rfc822Mailbox) */, + 461 /* 0.9.2342.19200300.100.1.4 (OBJ_info) */, + 462 /* 0.9.2342.19200300.100.1.5 (OBJ_favouriteDrink) */, + 463 /* 0.9.2342.19200300.100.1.6 (OBJ_roomNumber) */, + 464 /* 0.9.2342.19200300.100.1.7 (OBJ_photo) */, + 465 /* 0.9.2342.19200300.100.1.8 (OBJ_userClass) */, + 466 /* 0.9.2342.19200300.100.1.9 (OBJ_host) */, + 467 /* 0.9.2342.19200300.100.1.10 (OBJ_manager) */, + 468 /* 0.9.2342.19200300.100.1.11 (OBJ_documentIdentifier) */, + 469 /* 0.9.2342.19200300.100.1.12 (OBJ_documentTitle) */, + 470 /* 0.9.2342.19200300.100.1.13 (OBJ_documentVersion) */, + 471 /* 0.9.2342.19200300.100.1.14 (OBJ_documentAuthor) */, + 472 /* 0.9.2342.19200300.100.1.15 (OBJ_documentLocation) */, + 473 /* 0.9.2342.19200300.100.1.20 (OBJ_homeTelephoneNumber) */, + 474 /* 0.9.2342.19200300.100.1.21 (OBJ_secretary) */, + 475 /* 0.9.2342.19200300.100.1.22 (OBJ_otherMailbox) */, + 476 /* 0.9.2342.19200300.100.1.23 (OBJ_lastModifiedTime) */, + 477 /* 0.9.2342.19200300.100.1.24 (OBJ_lastModifiedBy) */, + 391 /* 0.9.2342.19200300.100.1.25 (OBJ_domainComponent) */, + 478 /* 0.9.2342.19200300.100.1.26 (OBJ_aRecord) */, + 479 /* 0.9.2342.19200300.100.1.27 (OBJ_pilotAttributeType27) */, + 480 /* 0.9.2342.19200300.100.1.28 (OBJ_mXRecord) */, + 481 /* 0.9.2342.19200300.100.1.29 (OBJ_nSRecord) */, + 482 /* 0.9.2342.19200300.100.1.30 (OBJ_sOARecord) */, + 483 /* 0.9.2342.19200300.100.1.31 (OBJ_cNAMERecord) */, + 484 /* 0.9.2342.19200300.100.1.37 (OBJ_associatedDomain) */, + 485 /* 0.9.2342.19200300.100.1.38 (OBJ_associatedName) */, + 486 /* 0.9.2342.19200300.100.1.39 (OBJ_homePostalAddress) */, + 487 /* 0.9.2342.19200300.100.1.40 (OBJ_personalTitle) */, + 488 /* 0.9.2342.19200300.100.1.41 (OBJ_mobileTelephoneNumber) */, + 489 /* 0.9.2342.19200300.100.1.42 (OBJ_pagerTelephoneNumber) */, + 490 /* 0.9.2342.19200300.100.1.43 (OBJ_friendlyCountryName) */, + 491 /* 0.9.2342.19200300.100.1.45 (OBJ_organizationalStatus) */, + 492 /* 0.9.2342.19200300.100.1.46 (OBJ_janetMailbox) */, + 493 /* 0.9.2342.19200300.100.1.47 (OBJ_mailPreferenceOption) */, + 494 /* 0.9.2342.19200300.100.1.48 (OBJ_buildingName) */, + 495 /* 0.9.2342.19200300.100.1.49 (OBJ_dSAQuality) */, + 496 /* 0.9.2342.19200300.100.1.50 (OBJ_singleLevelQuality) */, + 497 /* 0.9.2342.19200300.100.1.51 (OBJ_subtreeMinimumQuality) */, + 498 /* 0.9.2342.19200300.100.1.52 (OBJ_subtreeMaximumQuality) */, + 499 /* 0.9.2342.19200300.100.1.53 (OBJ_personalSignature) */, + 500 /* 0.9.2342.19200300.100.1.54 (OBJ_dITRedirect) */, + 501 /* 0.9.2342.19200300.100.1.55 (OBJ_audio) */, + 502 /* 0.9.2342.19200300.100.1.56 (OBJ_documentPublisher) */, + 442 /* 0.9.2342.19200300.100.3.4 (OBJ_iA5StringSyntax) */, + 443 /* 0.9.2342.19200300.100.3.5 (OBJ_caseIgnoreIA5StringSyntax) */, + 444 /* 0.9.2342.19200300.100.4.3 (OBJ_pilotObject) */, + 445 /* 0.9.2342.19200300.100.4.4 (OBJ_pilotPerson) */, + 446 /* 0.9.2342.19200300.100.4.5 (OBJ_account) */, + 447 /* 0.9.2342.19200300.100.4.6 (OBJ_document) */, + 448 /* 0.9.2342.19200300.100.4.7 (OBJ_room) */, + 449 /* 0.9.2342.19200300.100.4.9 (OBJ_documentSeries) */, + 392 /* 0.9.2342.19200300.100.4.13 (OBJ_Domain) */, + 450 /* 0.9.2342.19200300.100.4.14 (OBJ_rFC822localPart) */, + 451 /* 0.9.2342.19200300.100.4.15 (OBJ_dNSDomain) */, + 452 /* 0.9.2342.19200300.100.4.17 (OBJ_domainRelatedObject) */, + 453 /* 0.9.2342.19200300.100.4.18 (OBJ_friendlyCountry) */, + 454 /* 0.9.2342.19200300.100.4.19 (OBJ_simpleSecurityObject) */, + 455 /* 0.9.2342.19200300.100.4.20 (OBJ_pilotOrganization) */, + 456 /* 0.9.2342.19200300.100.4.21 (OBJ_pilotDSA) */, + 457 /* 0.9.2342.19200300.100.4.22 (OBJ_qualityLabelledData) */, + 189 /* 1.2.840.113549.1.9.16.0 (OBJ_id_smime_mod) */, + 190 /* 1.2.840.113549.1.9.16.1 (OBJ_id_smime_ct) */, + 191 /* 1.2.840.113549.1.9.16.2 (OBJ_id_smime_aa) */, + 192 /* 1.2.840.113549.1.9.16.3 (OBJ_id_smime_alg) */, + 193 /* 1.2.840.113549.1.9.16.4 (OBJ_id_smime_cd) */, + 194 /* 1.2.840.113549.1.9.16.5 (OBJ_id_smime_spq) */, + 195 /* 1.2.840.113549.1.9.16.6 (OBJ_id_smime_cti) */, + 158 /* 1.2.840.113549.1.9.22.1 (OBJ_x509Certificate) */, + 159 /* 1.2.840.113549.1.9.22.2 (OBJ_sdsiCertificate) */, + 160 /* 1.2.840.113549.1.9.23.1 (OBJ_x509Crl) */, + 144 /* 1.2.840.113549.1.12.1.1 (OBJ_pbe_WithSHA1And128BitRC4) */, + 145 /* 1.2.840.113549.1.12.1.2 (OBJ_pbe_WithSHA1And40BitRC4) */, + 146 /* 1.2.840.113549.1.12.1.3 (OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC) */, + 147 /* 1.2.840.113549.1.12.1.4 (OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC) */, + 148 /* 1.2.840.113549.1.12.1.5 (OBJ_pbe_WithSHA1And128BitRC2_CBC) */, + 149 /* 1.2.840.113549.1.12.1.6 (OBJ_pbe_WithSHA1And40BitRC2_CBC) */, + 171 /* 1.3.6.1.4.1.311.2.1.14 (OBJ_ms_ext_req) */, + 134 /* 1.3.6.1.4.1.311.2.1.21 (OBJ_ms_code_ind) */, + 135 /* 1.3.6.1.4.1.311.2.1.22 (OBJ_ms_code_com) */, + 136 /* 1.3.6.1.4.1.311.10.3.1 (OBJ_ms_ctl_sign) */, + 137 /* 1.3.6.1.4.1.311.10.3.3 (OBJ_ms_sgc) */, + 138 /* 1.3.6.1.4.1.311.10.3.4 (OBJ_ms_efs) */, + 648 /* 1.3.6.1.4.1.311.20.2.2 (OBJ_ms_smartcard_login) */, + 649 /* 1.3.6.1.4.1.311.20.2.3 (OBJ_ms_upn) */, + 751 /* 1.2.392.200011.61.1.1.1.2 (OBJ_camellia_128_cbc) */, + 752 /* 1.2.392.200011.61.1.1.1.3 (OBJ_camellia_192_cbc) */, + 753 /* 1.2.392.200011.61.1.1.1.4 (OBJ_camellia_256_cbc) */, + 907 /* 1.2.392.200011.61.1.1.3.2 (OBJ_id_camellia128_wrap) */, + 908 /* 1.2.392.200011.61.1.1.3.3 (OBJ_id_camellia192_wrap) */, + 909 /* 1.2.392.200011.61.1.1.3.4 (OBJ_id_camellia256_wrap) */, + 196 /* 1.2.840.113549.1.9.16.0.1 (OBJ_id_smime_mod_cms) */, + 197 /* 1.2.840.113549.1.9.16.0.2 (OBJ_id_smime_mod_ess) */, + 198 /* 1.2.840.113549.1.9.16.0.3 (OBJ_id_smime_mod_oid) */, + 199 /* 1.2.840.113549.1.9.16.0.4 (OBJ_id_smime_mod_msg_v3) */, + 200 /* 1.2.840.113549.1.9.16.0.5 (OBJ_id_smime_mod_ets_eSignature_88) */, + 201 /* 1.2.840.113549.1.9.16.0.6 (OBJ_id_smime_mod_ets_eSignature_97) */, + 202 /* 1.2.840.113549.1.9.16.0.7 (OBJ_id_smime_mod_ets_eSigPolicy_88) */, + 203 /* 1.2.840.113549.1.9.16.0.8 (OBJ_id_smime_mod_ets_eSigPolicy_97) */, + 204 /* 1.2.840.113549.1.9.16.1.1 (OBJ_id_smime_ct_receipt) */, + 205 /* 1.2.840.113549.1.9.16.1.2 (OBJ_id_smime_ct_authData) */, + 206 /* 1.2.840.113549.1.9.16.1.3 (OBJ_id_smime_ct_publishCert) */, + 207 /* 1.2.840.113549.1.9.16.1.4 (OBJ_id_smime_ct_TSTInfo) */, + 208 /* 1.2.840.113549.1.9.16.1.5 (OBJ_id_smime_ct_TDTInfo) */, + 209 /* 1.2.840.113549.1.9.16.1.6 (OBJ_id_smime_ct_contentInfo) */, + 210 /* 1.2.840.113549.1.9.16.1.7 (OBJ_id_smime_ct_DVCSRequestData) */, + 211 /* 1.2.840.113549.1.9.16.1.8 (OBJ_id_smime_ct_DVCSResponseData) */, + 786 /* 1.2.840.113549.1.9.16.1.9 (OBJ_id_smime_ct_compressedData) */, + 787 /* 1.2.840.113549.1.9.16.1.27 (OBJ_id_ct_asciiTextWithCRLF) */, + 212 /* 1.2.840.113549.1.9.16.2.1 (OBJ_id_smime_aa_receiptRequest) */, + 213 /* 1.2.840.113549.1.9.16.2.2 (OBJ_id_smime_aa_securityLabel) */, + 214 /* 1.2.840.113549.1.9.16.2.3 (OBJ_id_smime_aa_mlExpandHistory) */, + 215 /* 1.2.840.113549.1.9.16.2.4 (OBJ_id_smime_aa_contentHint) */, + 216 /* 1.2.840.113549.1.9.16.2.5 (OBJ_id_smime_aa_msgSigDigest) */, + 217 /* 1.2.840.113549.1.9.16.2.6 (OBJ_id_smime_aa_encapContentType) */, + 218 /* 1.2.840.113549.1.9.16.2.7 (OBJ_id_smime_aa_contentIdentifier) */, + 219 /* 1.2.840.113549.1.9.16.2.8 (OBJ_id_smime_aa_macValue) */, + 220 /* 1.2.840.113549.1.9.16.2.9 (OBJ_id_smime_aa_equivalentLabels) */, + 221 /* 1.2.840.113549.1.9.16.2.10 (OBJ_id_smime_aa_contentReference) */, + 222 /* 1.2.840.113549.1.9.16.2.11 (OBJ_id_smime_aa_encrypKeyPref) */, + 223 /* 1.2.840.113549.1.9.16.2.12 (OBJ_id_smime_aa_signingCertificate) */, + 224 /* 1.2.840.113549.1.9.16.2.13 (OBJ_id_smime_aa_smimeEncryptCerts) */, + 225 /* 1.2.840.113549.1.9.16.2.14 (OBJ_id_smime_aa_timeStampToken) */, + 226 /* 1.2.840.113549.1.9.16.2.15 (OBJ_id_smime_aa_ets_sigPolicyId) */, + 227 /* 1.2.840.113549.1.9.16.2.16 (OBJ_id_smime_aa_ets_commitmentType) */, + 228 /* 1.2.840.113549.1.9.16.2.17 (OBJ_id_smime_aa_ets_signerLocation) */, + 229 /* 1.2.840.113549.1.9.16.2.18 (OBJ_id_smime_aa_ets_signerAttr) */, + 230 /* 1.2.840.113549.1.9.16.2.19 (OBJ_id_smime_aa_ets_otherSigCert) */, + 231 /* 1.2.840.113549.1.9.16.2.20 (OBJ_id_smime_aa_ets_contentTimestamp) */, + 232 /* 1.2.840.113549.1.9.16.2.21 (OBJ_id_smime_aa_ets_CertificateRefs) */, + 233 /* 1.2.840.113549.1.9.16.2.22 (OBJ_id_smime_aa_ets_RevocationRefs) */, + 234 /* 1.2.840.113549.1.9.16.2.23 (OBJ_id_smime_aa_ets_certValues) */, + 235 /* 1.2.840.113549.1.9.16.2.24 (OBJ_id_smime_aa_ets_revocationValues) */, + 236 /* 1.2.840.113549.1.9.16.2.25 (OBJ_id_smime_aa_ets_escTimeStamp) */, + 237 /* 1.2.840.113549.1.9.16.2.26 (OBJ_id_smime_aa_ets_certCRLTimestamp) */, + 238 /* 1.2.840.113549.1.9.16.2.27 (OBJ_id_smime_aa_ets_archiveTimeStamp) */, + 239 /* 1.2.840.113549.1.9.16.2.28 (OBJ_id_smime_aa_signatureType) */, + 240 /* 1.2.840.113549.1.9.16.2.29 (OBJ_id_smime_aa_dvcs_dvc) */, + 241 /* 1.2.840.113549.1.9.16.3.1 (OBJ_id_smime_alg_ESDHwith3DES) */, + 242 /* 1.2.840.113549.1.9.16.3.2 (OBJ_id_smime_alg_ESDHwithRC2) */, + 243 /* 1.2.840.113549.1.9.16.3.3 (OBJ_id_smime_alg_3DESwrap) */, + 244 /* 1.2.840.113549.1.9.16.3.4 (OBJ_id_smime_alg_RC2wrap) */, + 245 /* 1.2.840.113549.1.9.16.3.5 (OBJ_id_smime_alg_ESDH) */, + 246 /* 1.2.840.113549.1.9.16.3.6 (OBJ_id_smime_alg_CMS3DESwrap) */, + 247 /* 1.2.840.113549.1.9.16.3.7 (OBJ_id_smime_alg_CMSRC2wrap) */, + 125 /* 1.2.840.113549.1.9.16.3.8 (OBJ_zlib_compression) */, + 893 /* 1.2.840.113549.1.9.16.3.9 (OBJ_id_alg_PWRI_KEK) */, + 248 /* 1.2.840.113549.1.9.16.4.1 (OBJ_id_smime_cd_ldap) */, + 249 /* 1.2.840.113549.1.9.16.5.1 (OBJ_id_smime_spq_ets_sqt_uri) */, + 250 /* 1.2.840.113549.1.9.16.5.2 (OBJ_id_smime_spq_ets_sqt_unotice) */, + 251 /* 1.2.840.113549.1.9.16.6.1 (OBJ_id_smime_cti_ets_proofOfOrigin) */, + 252 /* 1.2.840.113549.1.9.16.6.2 (OBJ_id_smime_cti_ets_proofOfReceipt) */, + 253 /* 1.2.840.113549.1.9.16.6.3 (OBJ_id_smime_cti_ets_proofOfDelivery) */, + 254 /* 1.2.840.113549.1.9.16.6.4 (OBJ_id_smime_cti_ets_proofOfSender) */, + 255 /* 1.2.840.113549.1.9.16.6.5 (OBJ_id_smime_cti_ets_proofOfApproval) */, + 256 /* 1.2.840.113549.1.9.16.6.6 (OBJ_id_smime_cti_ets_proofOfCreation) */, + 150 /* 1.2.840.113549.1.12.10.1.1 (OBJ_keyBag) */, + 151 /* 1.2.840.113549.1.12.10.1.2 (OBJ_pkcs8ShroudedKeyBag) */, + 152 /* 1.2.840.113549.1.12.10.1.3 (OBJ_certBag) */, + 153 /* 1.2.840.113549.1.12.10.1.4 (OBJ_crlBag) */, + 154 /* 1.2.840.113549.1.12.10.1.5 (OBJ_secretBag) */, + 155 /* 1.2.840.113549.1.12.10.1.6 (OBJ_safeContentsBag) */, + 34 /* 1.3.6.1.4.1.188.7.1.1.2 (OBJ_idea_cbc) */, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back new file mode 100644 index 0000000..888ea67 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back @@ -0,0 +1,11571 @@ +/* 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. */ + + +#define NUM_NID 962 + +static const uint8_t kObjectData[] = { + /* NID_rsadsi */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + /* NID_pkcs */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + /* NID_md2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x02, + /* NID_md5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x05, + /* NID_rc4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x04, + /* NID_rsaEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x01, + /* NID_md2WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x02, + /* NID_md5WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x04, + /* NID_pbeWithMD2AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x01, + /* NID_pbeWithMD5AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x03, + /* NID_X500 */ + 0x55, + /* NID_X509 */ + 0x55, + 0x04, + /* NID_commonName */ + 0x55, + 0x04, + 0x03, + /* NID_countryName */ + 0x55, + 0x04, + 0x06, + /* NID_localityName */ + 0x55, + 0x04, + 0x07, + /* NID_stateOrProvinceName */ + 0x55, + 0x04, + 0x08, + /* NID_organizationName */ + 0x55, + 0x04, + 0x0a, + /* NID_organizationalUnitName */ + 0x55, + 0x04, + 0x0b, + /* NID_rsa */ + 0x55, + 0x08, + 0x01, + 0x01, + /* NID_pkcs7 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + /* NID_pkcs7_data */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x01, + /* NID_pkcs7_signed */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x02, + /* NID_pkcs7_enveloped */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x03, + /* NID_pkcs7_signedAndEnveloped */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x04, + /* NID_pkcs7_digest */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x05, + /* NID_pkcs7_encrypted */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x06, + /* NID_pkcs3 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + /* NID_dhKeyAgreement */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + 0x01, + /* NID_des_ecb */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x06, + /* NID_des_cfb64 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x09, + /* NID_des_cbc */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x07, + /* NID_des_ede_ecb */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x11, + /* NID_idea_cbc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x81, + 0x3c, + 0x07, + 0x01, + 0x01, + 0x02, + /* NID_rc2_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x02, + /* NID_sha */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x12, + /* NID_shaWithRSAEncryption */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0f, + /* NID_des_ede3_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x07, + /* NID_des_ofb64 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x08, + /* NID_pkcs9 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + /* NID_pkcs9_emailAddress */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x01, + /* NID_pkcs9_unstructuredName */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x02, + /* NID_pkcs9_contentType */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x03, + /* NID_pkcs9_messageDigest */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x04, + /* NID_pkcs9_signingTime */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x05, + /* NID_pkcs9_countersignature */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x06, + /* NID_pkcs9_challengePassword */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x07, + /* NID_pkcs9_unstructuredAddress */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x08, + /* NID_pkcs9_extCertAttributes */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x09, + /* NID_netscape */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + /* NID_netscape_cert_extension */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + /* NID_netscape_data_type */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + /* NID_sha1 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1a, + /* NID_sha1WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x05, + /* NID_dsaWithSHA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0d, + /* NID_dsa_2 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0c, + /* NID_pbeWithSHA1AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0b, + /* NID_id_pbkdf2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0c, + /* NID_dsaWithSHA1_2 */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1b, + /* NID_netscape_cert_type */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x01, + /* NID_netscape_base_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x02, + /* NID_netscape_revocation_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x03, + /* NID_netscape_ca_revocation_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x04, + /* NID_netscape_renewal_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x07, + /* NID_netscape_ca_policy_url */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x08, + /* NID_netscape_ssl_server_name */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0c, + /* NID_netscape_comment */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0d, + /* NID_netscape_cert_sequence */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + 0x05, + /* NID_id_ce */ + 0x55, + 0x1d, + /* NID_subject_key_identifier */ + 0x55, + 0x1d, + 0x0e, + /* NID_key_usage */ + 0x55, + 0x1d, + 0x0f, + /* NID_private_key_usage_period */ + 0x55, + 0x1d, + 0x10, + /* NID_subject_alt_name */ + 0x55, + 0x1d, + 0x11, + /* NID_issuer_alt_name */ + 0x55, + 0x1d, + 0x12, + /* NID_basic_constraints */ + 0x55, + 0x1d, + 0x13, + /* NID_crl_number */ + 0x55, + 0x1d, + 0x14, + /* NID_certificate_policies */ + 0x55, + 0x1d, + 0x20, + /* NID_authority_key_identifier */ + 0x55, + 0x1d, + 0x23, + /* NID_bf_cbc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x97, + 0x55, + 0x01, + 0x02, + /* NID_mdc2 */ + 0x55, + 0x08, + 0x03, + 0x65, + /* NID_mdc2WithRSA */ + 0x55, + 0x08, + 0x03, + 0x64, + /* NID_givenName */ + 0x55, + 0x04, + 0x2a, + /* NID_surname */ + 0x55, + 0x04, + 0x04, + /* NID_initials */ + 0x55, + 0x04, + 0x2b, + /* NID_crl_distribution_points */ + 0x55, + 0x1d, + 0x1f, + /* NID_md5WithRSA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x03, + /* NID_serialNumber */ + 0x55, + 0x04, + 0x05, + /* NID_title */ + 0x55, + 0x04, + 0x0c, + /* NID_description */ + 0x55, + 0x04, + 0x0d, + /* NID_cast5_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0a, + /* NID_pbeWithMD5AndCast5_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0c, + /* NID_dsaWithSHA1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x03, + /* NID_sha1WithRSA */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1d, + /* NID_dsa */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x01, + /* NID_ripemd160 */ + 0x2b, + 0x24, + 0x03, + 0x02, + 0x01, + /* NID_ripemd160WithRSA */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x01, + 0x02, + /* NID_rc5_cbc */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x08, + /* NID_zlib_compression */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x08, + /* NID_ext_key_usage */ + 0x55, + 0x1d, + 0x25, + /* NID_id_pkix */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + /* NID_id_kp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + /* NID_server_auth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x01, + /* NID_client_auth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x02, + /* NID_code_sign */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x03, + /* NID_email_protect */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x04, + /* NID_time_stamp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x08, + /* NID_ms_code_ind */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x15, + /* NID_ms_code_com */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x16, + /* NID_ms_ctl_sign */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x01, + /* NID_ms_sgc */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x03, + /* NID_ms_efs */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x04, + /* NID_ns_sgc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x04, + 0x01, + /* NID_delta_crl */ + 0x55, + 0x1d, + 0x1b, + /* NID_crl_reason */ + 0x55, + 0x1d, + 0x15, + /* NID_invalidity_date */ + 0x55, + 0x1d, + 0x18, + /* NID_sxnet */ + 0x2b, + 0x65, + 0x01, + 0x04, + 0x01, + /* NID_pbe_WithSHA1And128BitRC4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x01, + /* NID_pbe_WithSHA1And40BitRC4 */ + 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, + /* NID_pbe_WithSHA1And2_Key_TripleDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x04, + /* NID_pbe_WithSHA1And128BitRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x05, + /* NID_pbe_WithSHA1And40BitRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x06, + /* NID_keyBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x01, + /* NID_pkcs8ShroudedKeyBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x02, + /* NID_certBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x03, + /* NID_crlBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x04, + /* NID_secretBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x05, + /* NID_safeContentsBag */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x06, + /* NID_friendlyName */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x14, + /* NID_localKeyID */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x15, + /* NID_x509Certificate */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x01, + /* NID_sdsiCertificate */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x02, + /* NID_x509Crl */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x17, + 0x01, + /* NID_pbes2 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0d, + /* NID_pbmac1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0e, + /* NID_hmacWithSHA1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x07, + /* NID_id_qt_cps */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x01, + /* NID_id_qt_unotice */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x02, + /* NID_SMIMECapabilities */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0f, + /* NID_pbeWithMD2AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x04, + /* NID_pbeWithMD5AndRC2_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x06, + /* NID_pbeWithSHA1AndDES_CBC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0a, + /* NID_ms_ext_req */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x0e, + /* NID_ext_req */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0e, + /* NID_name */ + 0x55, + 0x04, + 0x29, + /* NID_dnQualifier */ + 0x55, + 0x04, + 0x2e, + /* NID_id_pe */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + /* NID_id_ad */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + /* NID_info_access */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x01, + /* NID_ad_OCSP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + /* NID_ad_ca_issuers */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x02, + /* NID_OCSP_sign */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x09, + /* NID_member_body */ + 0x2a, + /* NID_ISO_US */ + 0x2a, + 0x86, + 0x48, + /* NID_X9_57 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + /* NID_X9cm */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + /* NID_pkcs1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + /* NID_pkcs5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + /* NID_SMIME */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + /* NID_id_smime_mod */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + /* NID_id_smime_ct */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + /* NID_id_smime_aa */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + /* NID_id_smime_alg */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + /* NID_id_smime_cd */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, + /* NID_id_smime_spq */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + /* NID_id_smime_cti */ + 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, + /* NID_id_smime_mod_ess */ + 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, + /* NID_id_smime_mod_msg_v3 */ + 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, + /* NID_id_smime_mod_ets_eSignature_97 */ + 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, + /* NID_id_smime_mod_ets_eSigPolicy_97 */ + 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, + /* NID_id_smime_ct_authData */ + 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, + /* NID_id_smime_ct_TSTInfo */ + 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, + /* NID_id_smime_ct_contentInfo */ + 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, + /* NID_id_smime_ct_DVCSResponseData */ + 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, + /* NID_id_smime_aa_securityLabel */ + 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, + /* NID_id_smime_aa_contentHint */ + 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, + /* NID_id_smime_aa_encapContentType */ + 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, + /* NID_id_smime_aa_macValue */ + 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, + /* NID_id_smime_aa_contentReference */ + 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, + /* NID_id_smime_aa_signingCertificate */ + 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, + /* NID_id_smime_aa_timeStampToken */ + 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, + /* NID_id_smime_aa_ets_commitmentType */ + 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, + /* NID_id_smime_aa_ets_signerAttr */ + 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, + /* NID_id_smime_aa_ets_contentTimestamp */ + 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, + /* NID_id_smime_aa_ets_certValues */ + 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, + /* NID_id_smime_aa_ets_escTimeStamp */ + 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, + /* NID_id_smime_aa_ets_archiveTimeStamp */ + 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, + /* NID_id_smime_aa_dvcs_dvc */ + 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, + /* NID_id_smime_alg_ESDHwithRC2 */ + 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, + /* NID_id_smime_alg_RC2wrap */ + 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, + /* NID_id_smime_alg_CMS3DESwrap */ + 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, + /* NID_id_smime_cd_ldap */ + 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, + /* NID_id_smime_spq_ets_sqt_unotice */ + 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, + /* NID_id_smime_cti_ets_proofOfReceipt */ + 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, + /* NID_id_smime_cti_ets_proofOfSender */ + 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, + /* NID_id_smime_cti_ets_proofOfCreation */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x06, + /* NID_md4 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x04, + /* NID_id_pkix_mod */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + /* NID_id_qt */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + /* NID_id_it */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + /* NID_id_pkip */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + /* NID_id_alg */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + /* NID_id_cmc */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + /* NID_id_on */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + /* NID_id_pda */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + /* NID_id_aca */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + /* NID_id_qcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + /* NID_id_cct */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + /* NID_id_pkix1_explicit_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x01, + /* NID_id_pkix1_implicit_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x02, + /* NID_id_pkix1_explicit_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x03, + /* NID_id_pkix1_implicit_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x04, + /* NID_id_mod_crmf */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x05, + /* NID_id_mod_cmc */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x06, + /* NID_id_mod_kea_profile_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x07, + /* NID_id_mod_kea_profile_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x08, + /* NID_id_mod_cmp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x09, + /* NID_id_mod_qualified_cert_88 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0a, + /* NID_id_mod_qualified_cert_93 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0b, + /* NID_id_mod_attribute_cert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0c, + /* NID_id_mod_timestamp_protocol */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0d, + /* NID_id_mod_ocsp */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0e, + /* NID_id_mod_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0f, + /* NID_id_mod_cmp2000 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x10, + /* NID_biometricInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x02, + /* NID_qcStatements */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x03, + /* NID_ac_auditEntity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x04, + /* NID_ac_targeting */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x05, + /* NID_aaControls */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x06, + /* NID_sbgp_ipAddrBlock */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x07, + /* NID_sbgp_autonomousSysNum */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x08, + /* NID_sbgp_routerIdentifier */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x09, + /* NID_textNotice */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x03, + /* NID_ipsecEndSystem */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x05, + /* NID_ipsecTunnel */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x06, + /* NID_ipsecUser */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x07, + /* NID_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x0a, + /* NID_id_it_caProtEncCert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x01, + /* NID_id_it_signKeyPairTypes */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x02, + /* NID_id_it_encKeyPairTypes */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x03, + /* NID_id_it_preferredSymmAlg */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x04, + /* NID_id_it_caKeyUpdateInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x05, + /* NID_id_it_currentCRL */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x06, + /* NID_id_it_unsupportedOIDs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x07, + /* NID_id_it_subscriptionRequest */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x08, + /* NID_id_it_subscriptionResponse */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x09, + /* NID_id_it_keyPairParamReq */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0a, + /* NID_id_it_keyPairParamRep */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0b, + /* NID_id_it_revPassphrase */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0c, + /* NID_id_it_implicitConfirm */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0d, + /* NID_id_it_confirmWaitTime */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0e, + /* NID_id_it_origPKIMessage */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0f, + /* NID_id_regCtrl */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + /* NID_id_regInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + /* NID_id_regCtrl_regToken */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x01, + /* NID_id_regCtrl_authenticator */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x02, + /* NID_id_regCtrl_pkiPublicationInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x03, + /* NID_id_regCtrl_pkiArchiveOptions */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x04, + /* NID_id_regCtrl_oldCertID */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x05, + /* NID_id_regCtrl_protocolEncrKey */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x06, + /* NID_id_regInfo_utf8Pairs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x01, + /* NID_id_regInfo_certReq */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x02, + /* NID_id_alg_des40 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x01, + /* NID_id_alg_noSignature */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x02, + /* NID_id_alg_dh_sig_hmac_sha1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x03, + /* NID_id_alg_dh_pop */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x04, + /* NID_id_cmc_statusInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x01, + /* NID_id_cmc_identification */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x02, + /* NID_id_cmc_identityProof */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x03, + /* NID_id_cmc_dataReturn */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x04, + /* NID_id_cmc_transactionId */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x05, + /* NID_id_cmc_senderNonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x06, + /* NID_id_cmc_recipientNonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x07, + /* NID_id_cmc_addExtensions */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x08, + /* NID_id_cmc_encryptedPOP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x09, + /* NID_id_cmc_decryptedPOP */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0a, + /* NID_id_cmc_lraPOPWitness */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0b, + /* NID_id_cmc_getCert */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0f, + /* NID_id_cmc_getCRL */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x10, + /* NID_id_cmc_revokeRequest */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x11, + /* NID_id_cmc_regInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x12, + /* NID_id_cmc_responseInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x13, + /* NID_id_cmc_queryPending */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x15, + /* NID_id_cmc_popLinkRandom */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x16, + /* NID_id_cmc_popLinkWitness */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x17, + /* NID_id_cmc_confirmCertAcceptance */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x18, + /* NID_id_on_personalData */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x01, + /* NID_id_pda_dateOfBirth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x01, + /* NID_id_pda_placeOfBirth */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x02, + /* NID_id_pda_gender */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x03, + /* NID_id_pda_countryOfCitizenship */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x04, + /* NID_id_pda_countryOfResidence */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x05, + /* NID_id_aca_authenticationInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x01, + /* NID_id_aca_accessIdentity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x02, + /* NID_id_aca_chargingIdentity */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x03, + /* NID_id_aca_group */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x04, + /* NID_id_aca_role */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x05, + /* NID_id_qcs_pkixQCSyntax_v1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + 0x01, + /* NID_id_cct_crs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x01, + /* NID_id_cct_PKIData */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x02, + /* NID_id_cct_PKIResponse */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x03, + /* NID_ad_timeStamping */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x03, + /* NID_ad_dvcs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x04, + /* NID_id_pkix_OCSP_basic */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x01, + /* NID_id_pkix_OCSP_Nonce */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x02, + /* NID_id_pkix_OCSP_CrlID */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x03, + /* NID_id_pkix_OCSP_acceptableResponses */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x04, + /* NID_id_pkix_OCSP_noCheck */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x05, + /* NID_id_pkix_OCSP_archiveCutoff */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x06, + /* NID_id_pkix_OCSP_serviceLocator */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x07, + /* NID_id_pkix_OCSP_extendedStatus */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x08, + /* NID_id_pkix_OCSP_valid */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x09, + /* NID_id_pkix_OCSP_path */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0a, + /* NID_id_pkix_OCSP_trustRoot */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0b, + /* NID_algorithm */ + 0x2b, + 0x0e, + 0x03, + 0x02, + /* NID_rsaSignature */ + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0b, + /* NID_X500algorithms */ + 0x55, + 0x08, + /* NID_org */ + 0x2b, + /* NID_dod */ + 0x2b, + 0x06, + /* NID_iana */ + 0x2b, + 0x06, + 0x01, + /* NID_Directory */ + 0x2b, + 0x06, + 0x01, + 0x01, + /* NID_Management */ + 0x2b, + 0x06, + 0x01, + 0x02, + /* NID_Experimental */ + 0x2b, + 0x06, + 0x01, + 0x03, + /* NID_Private */ + 0x2b, + 0x06, + 0x01, + 0x04, + /* NID_Security */ + 0x2b, + 0x06, + 0x01, + 0x05, + /* NID_SNMPv2 */ + 0x2b, + 0x06, + 0x01, + 0x06, + /* NID_Mail */ + 0x2b, + 0x06, + 0x01, + 0x07, + /* NID_Enterprises */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + /* NID_dcObject */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x8b, + 0x3a, + 0x82, + 0x58, + /* NID_domainComponent */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x19, + /* NID_Domain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0d, + /* NID_selected_attribute_types */ + 0x55, + 0x01, + 0x05, + /* NID_clearance */ + 0x55, + 0x01, + 0x05, + 0x37, + /* NID_md4WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x03, + /* NID_ac_proxying */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0a, + /* NID_sinfo_access */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0b, + /* NID_id_aca_encAttrs */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x06, + /* NID_role */ + 0x55, + 0x04, + 0x48, + /* NID_policy_constraints */ + 0x55, + 0x1d, + 0x24, + /* NID_target_information */ + 0x55, + 0x1d, + 0x37, + /* NID_no_rev_avail */ + 0x55, + 0x1d, + 0x38, + /* NID_ansi_X9_62 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + /* NID_X9_62_prime_field */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x01, + /* NID_X9_62_characteristic_two_field */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + /* NID_X9_62_id_ecPublicKey */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x02, + 0x01, + /* NID_X9_62_prime192v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x01, + /* NID_X9_62_prime192v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x02, + /* NID_X9_62_prime192v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x03, + /* NID_X9_62_prime239v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x04, + /* NID_X9_62_prime239v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x05, + /* NID_X9_62_prime239v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x06, + /* NID_X9_62_prime256v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x07, + /* NID_ecdsa_with_SHA1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x01, + /* NID_ms_csp_name */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x01, + /* NID_aes_128_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x01, + /* NID_aes_128_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x02, + /* NID_aes_128_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x03, + /* NID_aes_128_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x04, + /* NID_aes_192_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x15, + /* NID_aes_192_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x16, + /* NID_aes_192_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x17, + /* NID_aes_192_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x18, + /* NID_aes_256_ecb */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x29, + /* NID_aes_256_cbc */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2a, + /* NID_aes_256_ofb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2b, + /* NID_aes_256_cfb128 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2c, + /* NID_hold_instruction_code */ + 0x55, + 0x1d, + 0x17, + /* NID_hold_instruction_none */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x01, + /* NID_hold_instruction_call_issuer */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x02, + /* NID_hold_instruction_reject */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x03, + /* NID_data */ + 0x09, + /* NID_pss */ + 0x09, + 0x92, + 0x26, + /* NID_ucl */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + /* NID_pilot */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + /* NID_pilotAttributeType */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + /* NID_pilotAttributeSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + /* NID_pilotObjectClass */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + /* NID_pilotGroups */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x0a, + /* NID_iA5StringSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x04, + /* NID_caseIgnoreIA5StringSyntax */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x05, + /* NID_pilotObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x03, + /* NID_pilotPerson */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x04, + /* NID_account */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x05, + /* NID_document */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x06, + /* NID_room */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x07, + /* NID_documentSeries */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x09, + /* NID_rFC822localPart */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0e, + /* NID_dNSDomain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0f, + /* NID_domainRelatedObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x11, + /* NID_friendlyCountry */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x12, + /* NID_simpleSecurityObject */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x13, + /* NID_pilotOrganization */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x14, + /* NID_pilotDSA */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x15, + /* NID_qualityLabelledData */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x16, + /* NID_userId */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x01, + /* NID_textEncodedORAddress */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x02, + /* NID_rfc822Mailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x03, + /* NID_info */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x04, + /* NID_favouriteDrink */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x05, + /* NID_roomNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x06, + /* NID_photo */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x07, + /* NID_userClass */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x08, + /* NID_host */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x09, + /* NID_manager */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0a, + /* NID_documentIdentifier */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0b, + /* NID_documentTitle */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0c, + /* NID_documentVersion */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0d, + /* NID_documentAuthor */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0e, + /* NID_documentLocation */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0f, + /* NID_homeTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x14, + /* NID_secretary */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x15, + /* NID_otherMailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x16, + /* NID_lastModifiedTime */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x17, + /* NID_lastModifiedBy */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x18, + /* NID_aRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1a, + /* NID_pilotAttributeType27 */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1b, + /* NID_mXRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1c, + /* NID_nSRecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1d, + /* NID_sOARecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1e, + /* NID_cNAMERecord */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1f, + /* NID_associatedDomain */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x25, + /* NID_associatedName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x26, + /* NID_homePostalAddress */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x27, + /* NID_personalTitle */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x28, + /* NID_mobileTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x29, + /* NID_pagerTelephoneNumber */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2a, + /* NID_friendlyCountryName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2b, + /* NID_organizationalStatus */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2d, + /* NID_janetMailbox */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2e, + /* NID_mailPreferenceOption */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2f, + /* NID_buildingName */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x30, + /* NID_dSAQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x31, + /* NID_singleLevelQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x32, + /* NID_subtreeMinimumQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x33, + /* NID_subtreeMaximumQuality */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x34, + /* NID_personalSignature */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x35, + /* NID_dITRedirect */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x36, + /* NID_audio */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x37, + /* NID_documentPublisher */ + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x38, + /* NID_x500UniqueIdentifier */ + 0x55, + 0x04, + 0x2d, + /* NID_mime_mhs */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + /* NID_mime_mhs_headings */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + /* NID_mime_mhs_bodies */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x02, + /* NID_id_hex_partial_message */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x01, + /* NID_id_hex_multipart_message */ + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x02, + /* NID_generationQualifier */ + 0x55, + 0x04, + 0x2c, + /* NID_pseudonym */ + 0x55, + 0x04, + 0x41, + /* NID_id_set */ + 0x67, + 0x2a, + /* NID_set_ctype */ + 0x67, + 0x2a, + 0x00, + /* NID_set_msgExt */ + 0x67, + 0x2a, + 0x01, + /* NID_set_attr */ + 0x67, + 0x2a, + 0x03, + /* NID_set_policy */ + 0x67, + 0x2a, + 0x05, + /* NID_set_certExt */ + 0x67, + 0x2a, + 0x07, + /* NID_set_brand */ + 0x67, + 0x2a, + 0x08, + /* NID_setct_PANData */ + 0x67, + 0x2a, + 0x00, + 0x00, + /* NID_setct_PANToken */ + 0x67, + 0x2a, + 0x00, + 0x01, + /* NID_setct_PANOnly */ + 0x67, + 0x2a, + 0x00, + 0x02, + /* NID_setct_OIData */ + 0x67, + 0x2a, + 0x00, + 0x03, + /* NID_setct_PI */ + 0x67, + 0x2a, + 0x00, + 0x04, + /* NID_setct_PIData */ + 0x67, + 0x2a, + 0x00, + 0x05, + /* NID_setct_PIDataUnsigned */ + 0x67, + 0x2a, + 0x00, + 0x06, + /* NID_setct_HODInput */ + 0x67, + 0x2a, + 0x00, + 0x07, + /* NID_setct_AuthResBaggage */ + 0x67, + 0x2a, + 0x00, + 0x08, + /* NID_setct_AuthRevReqBaggage */ + 0x67, + 0x2a, + 0x00, + 0x09, + /* NID_setct_AuthRevResBaggage */ + 0x67, + 0x2a, + 0x00, + 0x0a, + /* NID_setct_CapTokenSeq */ + 0x67, + 0x2a, + 0x00, + 0x0b, + /* NID_setct_PInitResData */ + 0x67, + 0x2a, + 0x00, + 0x0c, + /* NID_setct_PI_TBS */ + 0x67, + 0x2a, + 0x00, + 0x0d, + /* NID_setct_PResData */ + 0x67, + 0x2a, + 0x00, + 0x0e, + /* NID_setct_AuthReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x10, + /* NID_setct_AuthResTBS */ + 0x67, + 0x2a, + 0x00, + 0x11, + /* NID_setct_AuthResTBSX */ + 0x67, + 0x2a, + 0x00, + 0x12, + /* NID_setct_AuthTokenTBS */ + 0x67, + 0x2a, + 0x00, + 0x13, + /* NID_setct_CapTokenData */ + 0x67, + 0x2a, + 0x00, + 0x14, + /* NID_setct_CapTokenTBS */ + 0x67, + 0x2a, + 0x00, + 0x15, + /* NID_setct_AcqCardCodeMsg */ + 0x67, + 0x2a, + 0x00, + 0x16, + /* NID_setct_AuthRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x17, + /* NID_setct_AuthRevResData */ + 0x67, + 0x2a, + 0x00, + 0x18, + /* NID_setct_AuthRevResTBS */ + 0x67, + 0x2a, + 0x00, + 0x19, + /* NID_setct_CapReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x1a, + /* NID_setct_CapReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x1b, + /* NID_setct_CapResData */ + 0x67, + 0x2a, + 0x00, + 0x1c, + /* NID_setct_CapRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x1d, + /* NID_setct_CapRevReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x1e, + /* NID_setct_CapRevResData */ + 0x67, + 0x2a, + 0x00, + 0x1f, + /* NID_setct_CredReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x20, + /* NID_setct_CredReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x21, + /* NID_setct_CredResData */ + 0x67, + 0x2a, + 0x00, + 0x22, + /* NID_setct_CredRevReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x23, + /* NID_setct_CredRevReqTBSX */ + 0x67, + 0x2a, + 0x00, + 0x24, + /* NID_setct_CredRevResData */ + 0x67, + 0x2a, + 0x00, + 0x25, + /* NID_setct_PCertReqData */ + 0x67, + 0x2a, + 0x00, + 0x26, + /* NID_setct_PCertResTBS */ + 0x67, + 0x2a, + 0x00, + 0x27, + /* NID_setct_BatchAdminReqData */ + 0x67, + 0x2a, + 0x00, + 0x28, + /* NID_setct_BatchAdminResData */ + 0x67, + 0x2a, + 0x00, + 0x29, + /* NID_setct_CardCInitResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2a, + /* NID_setct_MeAqCInitResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2b, + /* NID_setct_RegFormResTBS */ + 0x67, + 0x2a, + 0x00, + 0x2c, + /* NID_setct_CertReqData */ + 0x67, + 0x2a, + 0x00, + 0x2d, + /* NID_setct_CertReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x2e, + /* NID_setct_CertResData */ + 0x67, + 0x2a, + 0x00, + 0x2f, + /* NID_setct_CertInqReqTBS */ + 0x67, + 0x2a, + 0x00, + 0x30, + /* NID_setct_ErrorTBS */ + 0x67, + 0x2a, + 0x00, + 0x31, + /* NID_setct_PIDualSignedTBE */ + 0x67, + 0x2a, + 0x00, + 0x32, + /* NID_setct_PIUnsignedTBE */ + 0x67, + 0x2a, + 0x00, + 0x33, + /* NID_setct_AuthReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x34, + /* NID_setct_AuthResTBE */ + 0x67, + 0x2a, + 0x00, + 0x35, + /* NID_setct_AuthResTBEX */ + 0x67, + 0x2a, + 0x00, + 0x36, + /* NID_setct_AuthTokenTBE */ + 0x67, + 0x2a, + 0x00, + 0x37, + /* NID_setct_CapTokenTBE */ + 0x67, + 0x2a, + 0x00, + 0x38, + /* NID_setct_CapTokenTBEX */ + 0x67, + 0x2a, + 0x00, + 0x39, + /* NID_setct_AcqCardCodeMsgTBE */ + 0x67, + 0x2a, + 0x00, + 0x3a, + /* NID_setct_AuthRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x3b, + /* NID_setct_AuthRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x3c, + /* NID_setct_AuthRevResTBEB */ + 0x67, + 0x2a, + 0x00, + 0x3d, + /* NID_setct_CapReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x3e, + /* NID_setct_CapReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x3f, + /* NID_setct_CapResTBE */ + 0x67, + 0x2a, + 0x00, + 0x40, + /* NID_setct_CapRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x41, + /* NID_setct_CapRevReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x42, + /* NID_setct_CapRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x43, + /* NID_setct_CredReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x44, + /* NID_setct_CredReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x45, + /* NID_setct_CredResTBE */ + 0x67, + 0x2a, + 0x00, + 0x46, + /* NID_setct_CredRevReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x47, + /* NID_setct_CredRevReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x48, + /* NID_setct_CredRevResTBE */ + 0x67, + 0x2a, + 0x00, + 0x49, + /* NID_setct_BatchAdminReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4a, + /* NID_setct_BatchAdminResTBE */ + 0x67, + 0x2a, + 0x00, + 0x4b, + /* NID_setct_RegFormReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4c, + /* NID_setct_CertReqTBE */ + 0x67, + 0x2a, + 0x00, + 0x4d, + /* NID_setct_CertReqTBEX */ + 0x67, + 0x2a, + 0x00, + 0x4e, + /* NID_setct_CertResTBE */ + 0x67, + 0x2a, + 0x00, + 0x4f, + /* NID_setct_CRLNotificationTBS */ + 0x67, + 0x2a, + 0x00, + 0x50, + /* NID_setct_CRLNotificationResTBS */ + 0x67, + 0x2a, + 0x00, + 0x51, + /* NID_setct_BCIDistributionTBS */ + 0x67, + 0x2a, + 0x00, + 0x52, + /* NID_setext_genCrypt */ + 0x67, + 0x2a, + 0x01, + 0x01, + /* NID_setext_miAuth */ + 0x67, + 0x2a, + 0x01, + 0x03, + /* NID_setext_pinSecure */ + 0x67, + 0x2a, + 0x01, + 0x04, + /* NID_setext_pinAny */ + 0x67, + 0x2a, + 0x01, + 0x05, + /* NID_setext_track2 */ + 0x67, + 0x2a, + 0x01, + 0x07, + /* NID_setext_cv */ + 0x67, + 0x2a, + 0x01, + 0x08, + /* NID_set_policy_root */ + 0x67, + 0x2a, + 0x05, + 0x00, + /* NID_setCext_hashedRoot */ + 0x67, + 0x2a, + 0x07, + 0x00, + /* NID_setCext_certType */ + 0x67, + 0x2a, + 0x07, + 0x01, + /* NID_setCext_merchData */ + 0x67, + 0x2a, + 0x07, + 0x02, + /* NID_setCext_cCertRequired */ + 0x67, + 0x2a, + 0x07, + 0x03, + /* NID_setCext_tunneling */ + 0x67, + 0x2a, + 0x07, + 0x04, + /* NID_setCext_setExt */ + 0x67, + 0x2a, + 0x07, + 0x05, + /* NID_setCext_setQualf */ + 0x67, + 0x2a, + 0x07, + 0x06, + /* NID_setCext_PGWYcapabilities */ + 0x67, + 0x2a, + 0x07, + 0x07, + /* NID_setCext_TokenIdentifier */ + 0x67, + 0x2a, + 0x07, + 0x08, + /* NID_setCext_Track2Data */ + 0x67, + 0x2a, + 0x07, + 0x09, + /* NID_setCext_TokenType */ + 0x67, + 0x2a, + 0x07, + 0x0a, + /* NID_setCext_IssuerCapabilities */ + 0x67, + 0x2a, + 0x07, + 0x0b, + /* NID_setAttr_Cert */ + 0x67, + 0x2a, + 0x03, + 0x00, + /* NID_setAttr_PGWYcap */ + 0x67, + 0x2a, + 0x03, + 0x01, + /* NID_setAttr_TokenType */ + 0x67, + 0x2a, + 0x03, + 0x02, + /* NID_setAttr_IssCap */ + 0x67, + 0x2a, + 0x03, + 0x03, + /* NID_set_rootKeyThumb */ + 0x67, + 0x2a, + 0x03, + 0x00, + 0x00, + /* NID_set_addPolicy */ + 0x67, + 0x2a, + 0x03, + 0x00, + 0x01, + /* NID_setAttr_Token_EMV */ + 0x67, + 0x2a, + 0x03, + 0x02, + 0x01, + /* NID_setAttr_Token_B0Prime */ + 0x67, + 0x2a, + 0x03, + 0x02, + 0x02, + /* NID_setAttr_IssCap_CVM */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + /* NID_setAttr_IssCap_T2 */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + /* NID_setAttr_IssCap_Sig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + /* NID_setAttr_GenCryptgrm */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + 0x01, + /* NID_setAttr_T2Enc */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x01, + /* NID_setAttr_T2cleartxt */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x02, + /* NID_setAttr_TokICCsig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x01, + /* NID_setAttr_SecDevSig */ + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x02, + /* NID_set_brand_IATA_ATA */ + 0x67, + 0x2a, + 0x08, + 0x01, + /* NID_set_brand_Diners */ + 0x67, + 0x2a, + 0x08, + 0x1e, + /* NID_set_brand_AmericanExpress */ + 0x67, + 0x2a, + 0x08, + 0x22, + /* NID_set_brand_JCB */ + 0x67, + 0x2a, + 0x08, + 0x23, + /* NID_set_brand_Visa */ + 0x67, + 0x2a, + 0x08, + 0x04, + /* NID_set_brand_MasterCard */ + 0x67, + 0x2a, + 0x08, + 0x05, + /* NID_set_brand_Novus */ + 0x67, + 0x2a, + 0x08, + 0xae, + 0x7b, + /* NID_des_cdmf */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x0a, + /* NID_rsaOAEPEncryptionSET */ + 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, + /* NID_ms_upn */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x03, + /* NID_streetAddress */ + 0x55, + 0x04, + 0x09, + /* NID_postalCode */ + 0x55, + 0x04, + 0x11, + /* NID_id_ppl */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + /* NID_proxyCertInfo */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0e, + /* NID_id_ppl_anyLanguage */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x00, + /* NID_id_ppl_inheritAll */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x01, + /* NID_name_constraints */ + 0x55, + 0x1d, + 0x1e, + /* NID_Independent */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x02, + /* NID_sha256WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0b, + /* NID_sha384WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0c, + /* NID_sha512WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0d, + /* NID_sha224WithRSAEncryption */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0e, + /* NID_sha256 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x01, + /* NID_sha384 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x02, + /* NID_sha512 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x03, + /* NID_sha224 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x04, + /* NID_identified_organization */ + 0x2b, + /* NID_certicom_arc */ + 0x2b, + 0x81, + 0x04, + /* NID_wap */ + 0x67, + 0x2b, + /* NID_wap_wsg */ + 0x67, + 0x2b, + 0x01, + /* NID_X9_62_id_characteristic_two_basis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + /* NID_X9_62_onBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x01, + /* NID_X9_62_tpBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x02, + /* NID_X9_62_ppBasis */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x03, + /* NID_X9_62_c2pnb163v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x01, + /* NID_X9_62_c2pnb163v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x02, + /* NID_X9_62_c2pnb163v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x03, + /* NID_X9_62_c2pnb176v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x04, + /* NID_X9_62_c2tnb191v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x05, + /* NID_X9_62_c2tnb191v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x06, + /* NID_X9_62_c2tnb191v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x07, + /* NID_X9_62_c2onb191v4 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x08, + /* NID_X9_62_c2onb191v5 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x09, + /* NID_X9_62_c2pnb208w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0a, + /* NID_X9_62_c2tnb239v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0b, + /* NID_X9_62_c2tnb239v2 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0c, + /* NID_X9_62_c2tnb239v3 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0d, + /* NID_X9_62_c2onb239v4 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0e, + /* NID_X9_62_c2onb239v5 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0f, + /* NID_X9_62_c2pnb272w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x10, + /* NID_X9_62_c2pnb304w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x11, + /* NID_X9_62_c2tnb359v1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x12, + /* NID_X9_62_c2pnb368w1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x13, + /* NID_X9_62_c2tnb431r1 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x14, + /* NID_secp112r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x06, + /* NID_secp112r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x07, + /* NID_secp128r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1c, + /* NID_secp128r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1d, + /* NID_secp160k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x09, + /* NID_secp160r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x08, + /* NID_secp160r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1e, + /* NID_secp192k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1f, + /* NID_secp224k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x20, + /* NID_secp224r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x21, + /* NID_secp256k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0a, + /* NID_secp384r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x22, + /* NID_secp521r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x23, + /* NID_sect113r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x04, + /* NID_sect113r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x05, + /* NID_sect131r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x16, + /* NID_sect131r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x17, + /* NID_sect163k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x01, + /* NID_sect163r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x02, + /* NID_sect163r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0f, + /* NID_sect193r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x18, + /* NID_sect193r2 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x19, + /* NID_sect233k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1a, + /* NID_sect233r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1b, + /* NID_sect239k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x03, + /* NID_sect283k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x10, + /* NID_sect283r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x11, + /* NID_sect409k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x24, + /* NID_sect409r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x25, + /* NID_sect571k1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x26, + /* NID_sect571r1 */ + 0x2b, + 0x81, + 0x04, + 0x00, + 0x27, + /* NID_wap_wsg_idm_ecid_wtls1 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x01, + /* NID_wap_wsg_idm_ecid_wtls3 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x03, + /* NID_wap_wsg_idm_ecid_wtls4 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x04, + /* NID_wap_wsg_idm_ecid_wtls5 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x05, + /* NID_wap_wsg_idm_ecid_wtls6 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x06, + /* NID_wap_wsg_idm_ecid_wtls7 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x07, + /* NID_wap_wsg_idm_ecid_wtls8 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x08, + /* NID_wap_wsg_idm_ecid_wtls9 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x09, + /* NID_wap_wsg_idm_ecid_wtls10 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0a, + /* NID_wap_wsg_idm_ecid_wtls11 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0b, + /* NID_wap_wsg_idm_ecid_wtls12 */ + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0c, + /* NID_any_policy */ + 0x55, + 0x1d, + 0x20, + 0x00, + /* NID_policy_mappings */ + 0x55, + 0x1d, + 0x21, + /* NID_inhibit_any_policy */ + 0x55, + 0x1d, + 0x36, + /* NID_camellia_128_cbc */ + 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, + /* NID_camellia_256_cbc */ + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x04, + /* NID_camellia_128_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x01, + /* NID_camellia_192_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x15, + /* NID_camellia_256_ecb */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x29, + /* NID_camellia_128_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x04, + /* NID_camellia_192_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x18, + /* NID_camellia_256_cfb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2c, + /* NID_camellia_128_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x03, + /* NID_camellia_192_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x17, + /* NID_camellia_256_ofb128 */ + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2b, + /* NID_subject_directory_attributes */ + 0x55, + 0x1d, + 0x09, + /* NID_issuing_distribution_point */ + 0x55, + 0x1d, + 0x1c, + /* NID_certificate_issuer */ + 0x55, + 0x1d, + 0x1d, + /* NID_kisa */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + /* NID_seed_ecb */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x03, + /* NID_seed_cbc */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x04, + /* NID_seed_ofb128 */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x06, + /* NID_seed_cfb128 */ + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x05, + /* NID_hmac_md5 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x01, + /* NID_hmac_sha1 */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x02, + /* NID_id_PasswordBasedMAC */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0d, + /* NID_id_DHBasedMac */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x1e, + /* NID_id_it_suppLangTags */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x10, + /* NID_caRepository */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x05, + /* NID_id_smime_ct_compressedData */ + 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, + /* NID_id_aes128_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x05, + /* NID_id_aes192_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x19, + /* NID_id_aes256_wrap */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2d, + /* NID_ecdsa_with_Recommended */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x02, + /* NID_ecdsa_with_Specified */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + /* NID_ecdsa_with_SHA224 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x01, + /* NID_ecdsa_with_SHA256 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x02, + /* NID_ecdsa_with_SHA384 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x03, + /* NID_ecdsa_with_SHA512 */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x04, + /* NID_hmacWithMD5 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x06, + /* NID_hmacWithSHA224 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x08, + /* NID_hmacWithSHA256 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x09, + /* NID_hmacWithSHA384 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0a, + /* NID_hmacWithSHA512 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0b, + /* NID_dsa_with_SHA224 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x01, + /* NID_dsa_with_SHA256 */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x02, + /* NID_whirlpool */ + 0x28, + 0xcf, + 0x06, + 0x03, + 0x00, + 0x37, + /* NID_cryptopro */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + /* NID_cryptocom */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + /* NID_id_GostR3411_94_with_GostR3410_2001 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x03, + /* NID_id_GostR3411_94_with_GostR3410_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x04, + /* NID_id_GostR3411_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x09, + /* NID_id_HMACGostR3411_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0a, + /* NID_id_GostR3410_2001 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x13, + /* NID_id_GostR3410_94 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + /* NID_id_Gost28147_89 */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x15, + /* NID_id_Gost28147_89_MAC */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x16, + /* NID_id_GostR3411_94_prf */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x17, + /* NID_id_GostR3410_2001DH */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x62, + /* NID_id_GostR3410_94DH */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x63, + /* NID_id_Gost28147_89_CryptoPro_KeyMeshing */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x01, + /* NID_id_Gost28147_89_None_KeyMeshing */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x00, + /* NID_id_GostR3411_94_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x00, + /* NID_id_GostR3411_94_CryptoProParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x01, + /* NID_id_Gost28147_89_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x00, + /* NID_id_Gost28147_89_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x01, + /* NID_id_Gost28147_89_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x02, + /* NID_id_Gost28147_89_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x03, + /* NID_id_Gost28147_89_CryptoPro_D_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x04, + /* NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x05, + /* NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x06, + /* NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x07, + /* NID_id_GostR3410_94_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x00, + /* NID_id_GostR3410_94_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x02, + /* NID_id_GostR3410_94_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x03, + /* NID_id_GostR3410_94_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x04, + /* NID_id_GostR3410_94_CryptoPro_D_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x05, + /* NID_id_GostR3410_94_CryptoPro_XchA_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x01, + /* NID_id_GostR3410_94_CryptoPro_XchB_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x02, + /* NID_id_GostR3410_94_CryptoPro_XchC_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x03, + /* NID_id_GostR3410_2001_TestParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x00, + /* NID_id_GostR3410_2001_CryptoPro_A_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x01, + /* NID_id_GostR3410_2001_CryptoPro_B_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x02, + /* NID_id_GostR3410_2001_CryptoPro_C_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x03, + /* NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x00, + /* NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x01, + /* NID_id_GostR3410_94_a */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x01, + /* NID_id_GostR3410_94_aBis */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x02, + /* NID_id_GostR3410_94_b */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x03, + /* NID_id_GostR3410_94_bBis */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x04, + /* NID_id_Gost28147_89_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x06, + 0x01, + /* NID_id_GostR3410_94_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x03, + /* NID_id_GostR3410_2001_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x04, + /* NID_id_GostR3411_94_with_GostR3410_94_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x03, + /* NID_id_GostR3411_94_with_GostR3410_2001_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x04, + /* NID_id_GostR3410_2001_ParamSet_cc */ + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x08, + 0x01, + /* NID_LocalKeySet */ + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x02, + /* NID_freshest_crl */ + 0x55, + 0x1d, + 0x2e, + /* NID_id_on_permanentIdentifier */ + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x03, + /* NID_searchGuide */ + 0x55, + 0x04, + 0x0e, + /* NID_businessCategory */ + 0x55, + 0x04, + 0x0f, + /* NID_postalAddress */ + 0x55, + 0x04, + 0x10, + /* NID_postOfficeBox */ + 0x55, + 0x04, + 0x12, + /* NID_physicalDeliveryOfficeName */ + 0x55, + 0x04, + 0x13, + /* NID_telephoneNumber */ + 0x55, + 0x04, + 0x14, + /* NID_telexNumber */ + 0x55, + 0x04, + 0x15, + /* NID_teletexTerminalIdentifier */ + 0x55, + 0x04, + 0x16, + /* NID_facsimileTelephoneNumber */ + 0x55, + 0x04, + 0x17, + /* NID_x121Address */ + 0x55, + 0x04, + 0x18, + /* NID_internationaliSDNNumber */ + 0x55, + 0x04, + 0x19, + /* NID_registeredAddress */ + 0x55, + 0x04, + 0x1a, + /* NID_destinationIndicator */ + 0x55, + 0x04, + 0x1b, + /* NID_preferredDeliveryMethod */ + 0x55, + 0x04, + 0x1c, + /* NID_presentationAddress */ + 0x55, + 0x04, + 0x1d, + /* NID_supportedApplicationContext */ + 0x55, + 0x04, + 0x1e, + /* NID_member */ + 0x55, + 0x04, + 0x1f, + /* NID_owner */ + 0x55, + 0x04, + 0x20, + /* NID_roleOccupant */ + 0x55, + 0x04, + 0x21, + /* NID_seeAlso */ + 0x55, + 0x04, + 0x22, + /* NID_userPassword */ + 0x55, + 0x04, + 0x23, + /* NID_userCertificate */ + 0x55, + 0x04, + 0x24, + /* NID_cACertificate */ + 0x55, + 0x04, + 0x25, + /* NID_authorityRevocationList */ + 0x55, + 0x04, + 0x26, + /* NID_certificateRevocationList */ + 0x55, + 0x04, + 0x27, + /* NID_crossCertificatePair */ + 0x55, + 0x04, + 0x28, + /* NID_enhancedSearchGuide */ + 0x55, + 0x04, + 0x2f, + /* NID_protocolInformation */ + 0x55, + 0x04, + 0x30, + /* NID_distinguishedName */ + 0x55, + 0x04, + 0x31, + /* NID_uniqueMember */ + 0x55, + 0x04, + 0x32, + /* NID_houseIdentifier */ + 0x55, + 0x04, + 0x33, + /* NID_supportedAlgorithms */ + 0x55, + 0x04, + 0x34, + /* NID_deltaRevocationList */ + 0x55, + 0x04, + 0x35, + /* NID_dmdName */ + 0x55, + 0x04, + 0x36, + /* NID_id_alg_PWRI_KEK */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x09, + /* NID_aes_128_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x06, + /* NID_aes_128_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x07, + /* NID_id_aes128_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x08, + /* NID_aes_192_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1a, + /* NID_aes_192_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1b, + /* NID_id_aes192_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1c, + /* NID_aes_256_gcm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2e, + /* NID_aes_256_ccm */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2f, + /* NID_id_aes256_wrap_pad */ + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x30, + /* NID_id_camellia128_wrap */ + 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, + /* NID_id_camellia256_wrap */ + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x04, + /* NID_anyExtendedKeyUsage */ + 0x55, + 0x1d, + 0x25, + 0x00, + /* NID_mgf1 */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x08, + /* NID_rsassaPss */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0a, + /* NID_rsaesOaep */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x07, + /* NID_dhpublicnumber */ + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3e, + 0x02, + 0x01, + /* NID_brainpoolP160r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x01, + /* NID_brainpoolP160t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x02, + /* NID_brainpoolP192r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x03, + /* NID_brainpoolP192t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x04, + /* NID_brainpoolP224r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x05, + /* NID_brainpoolP224t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x06, + /* NID_brainpoolP256r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x07, + /* NID_brainpoolP256t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x08, + /* NID_brainpoolP320r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x09, + /* NID_brainpoolP320t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0a, + /* NID_brainpoolP384r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0b, + /* NID_brainpoolP384t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0c, + /* NID_brainpoolP512r1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0d, + /* NID_brainpoolP512t1 */ + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0e, + /* NID_pSpecified */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x09, + /* NID_dhSinglePass_stdDH_sha1kdf_scheme */ + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x02, + /* NID_dhSinglePass_stdDH_sha224kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x00, + /* NID_dhSinglePass_stdDH_sha256kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x01, + /* NID_dhSinglePass_stdDH_sha384kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x02, + /* NID_dhSinglePass_stdDH_sha512kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x03, + /* NID_dhSinglePass_cofactorDH_sha1kdf_scheme */ + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x03, + /* NID_dhSinglePass_cofactorDH_sha224kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x00, + /* NID_dhSinglePass_cofactorDH_sha256kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x01, + /* NID_dhSinglePass_cofactorDH_sha384kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x02, + /* NID_dhSinglePass_cofactorDH_sha512kdf_scheme */ + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x03, + /* NID_X25519 */ + 0x2b, + 0x65, + 0x6e, + /* NID_ED25519 */ + 0x2b, + 0x65, + 0x70, + /* NID_ED448 */ + 0x2b, + 0x65, + 0x71, + /* NID_X448 */ + 0x2b, + 0x65, + 0x6f, +}; + +static const ASN1_OBJECT kObjects[NUM_NID] = { + {"UNDEF", "undefined", NID_undef, 0, NULL, 0}, + {"rsadsi", "RSA Data Security, Inc.", NID_rsadsi, 6, &kObjectData[0], 0}, + {"pkcs", "RSA Data Security, Inc. PKCS", NID_pkcs, 7, &kObjectData[6], 0}, + {"MD2", "md2", NID_md2, 8, &kObjectData[13], 0}, + {"MD5", "md5", NID_md5, 8, &kObjectData[21], 0}, + {"RC4", "rc4", NID_rc4, 8, &kObjectData[29], 0}, + {"rsaEncryption", "rsaEncryption", NID_rsaEncryption, 9, &kObjectData[37], + 0}, + {"RSA-MD2", "md2WithRSAEncryption", NID_md2WithRSAEncryption, 9, + &kObjectData[46], 0}, + {"RSA-MD5", "md5WithRSAEncryption", NID_md5WithRSAEncryption, 9, + &kObjectData[55], 0}, + {"PBE-MD2-DES", "pbeWithMD2AndDES-CBC", NID_pbeWithMD2AndDES_CBC, 9, + &kObjectData[64], 0}, + {"PBE-MD5-DES", "pbeWithMD5AndDES-CBC", NID_pbeWithMD5AndDES_CBC, 9, + &kObjectData[73], 0}, + {"X500", "directory services (X.500)", NID_X500, 1, &kObjectData[82], 0}, + {"X509", "X509", NID_X509, 2, &kObjectData[83], 0}, + {"CN", "commonName", NID_commonName, 3, &kObjectData[85], 0}, + {"C", "countryName", NID_countryName, 3, &kObjectData[88], 0}, + {"L", "localityName", NID_localityName, 3, &kObjectData[91], 0}, + {"ST", "stateOrProvinceName", NID_stateOrProvinceName, 3, &kObjectData[94], + 0}, + {"O", "organizationName", NID_organizationName, 3, &kObjectData[97], 0}, + {"OU", "organizationalUnitName", NID_organizationalUnitName, 3, + &kObjectData[100], 0}, + {"RSA", "rsa", NID_rsa, 4, &kObjectData[103], 0}, + {"pkcs7", "pkcs7", NID_pkcs7, 8, &kObjectData[107], 0}, + {"pkcs7-data", "pkcs7-data", NID_pkcs7_data, 9, &kObjectData[115], 0}, + {"pkcs7-signedData", "pkcs7-signedData", NID_pkcs7_signed, 9, + &kObjectData[124], 0}, + {"pkcs7-envelopedData", "pkcs7-envelopedData", NID_pkcs7_enveloped, 9, + &kObjectData[133], 0}, + {"pkcs7-signedAndEnvelopedData", "pkcs7-signedAndEnvelopedData", + NID_pkcs7_signedAndEnveloped, 9, &kObjectData[142], 0}, + {"pkcs7-digestData", "pkcs7-digestData", NID_pkcs7_digest, 9, + &kObjectData[151], 0}, + {"pkcs7-encryptedData", "pkcs7-encryptedData", NID_pkcs7_encrypted, 9, + &kObjectData[160], 0}, + {"pkcs3", "pkcs3", NID_pkcs3, 8, &kObjectData[169], 0}, + {"dhKeyAgreement", "dhKeyAgreement", NID_dhKeyAgreement, 9, + &kObjectData[177], 0}, + {"DES-ECB", "des-ecb", NID_des_ecb, 5, &kObjectData[186], 0}, + {"DES-CFB", "des-cfb", NID_des_cfb64, 5, &kObjectData[191], 0}, + {"DES-CBC", "des-cbc", NID_des_cbc, 5, &kObjectData[196], 0}, + {"DES-EDE", "des-ede", NID_des_ede_ecb, 5, &kObjectData[201], 0}, + {"DES-EDE3", "des-ede3", NID_des_ede3_ecb, 0, NULL, 0}, + {"IDEA-CBC", "idea-cbc", NID_idea_cbc, 11, &kObjectData[206], 0}, + {"IDEA-CFB", "idea-cfb", NID_idea_cfb64, 0, NULL, 0}, + {"IDEA-ECB", "idea-ecb", NID_idea_ecb, 0, NULL, 0}, + {"RC2-CBC", "rc2-cbc", NID_rc2_cbc, 8, &kObjectData[217], 0}, + {"RC2-ECB", "rc2-ecb", NID_rc2_ecb, 0, NULL, 0}, + {"RC2-CFB", "rc2-cfb", NID_rc2_cfb64, 0, NULL, 0}, + {"RC2-OFB", "rc2-ofb", NID_rc2_ofb64, 0, NULL, 0}, + {"SHA", "sha", NID_sha, 5, &kObjectData[225], 0}, + {"RSA-SHA", "shaWithRSAEncryption", NID_shaWithRSAEncryption, 5, + &kObjectData[230], 0}, + {"DES-EDE-CBC", "des-ede-cbc", NID_des_ede_cbc, 0, NULL, 0}, + {"DES-EDE3-CBC", "des-ede3-cbc", NID_des_ede3_cbc, 8, &kObjectData[235], 0}, + {"DES-OFB", "des-ofb", NID_des_ofb64, 5, &kObjectData[243], 0}, + {"IDEA-OFB", "idea-ofb", NID_idea_ofb64, 0, NULL, 0}, + {"pkcs9", "pkcs9", NID_pkcs9, 8, &kObjectData[248], 0}, + {"emailAddress", "emailAddress", NID_pkcs9_emailAddress, 9, + &kObjectData[256], 0}, + {"unstructuredName", "unstructuredName", NID_pkcs9_unstructuredName, 9, + &kObjectData[265], 0}, + {"contentType", "contentType", NID_pkcs9_contentType, 9, &kObjectData[274], + 0}, + {"messageDigest", "messageDigest", NID_pkcs9_messageDigest, 9, + &kObjectData[283], 0}, + {"signingTime", "signingTime", NID_pkcs9_signingTime, 9, &kObjectData[292], + 0}, + {"countersignature", "countersignature", NID_pkcs9_countersignature, 9, + &kObjectData[301], 0}, + {"challengePassword", "challengePassword", NID_pkcs9_challengePassword, 9, + &kObjectData[310], 0}, + {"unstructuredAddress", "unstructuredAddress", + NID_pkcs9_unstructuredAddress, 9, &kObjectData[319], 0}, + {"extendedCertificateAttributes", "extendedCertificateAttributes", + NID_pkcs9_extCertAttributes, 9, &kObjectData[328], 0}, + {"Netscape", "Netscape Communications Corp.", NID_netscape, 7, + &kObjectData[337], 0}, + {"nsCertExt", "Netscape Certificate Extension", NID_netscape_cert_extension, + 8, &kObjectData[344], 0}, + {"nsDataType", "Netscape Data Type", NID_netscape_data_type, 8, + &kObjectData[352], 0}, + {"DES-EDE-CFB", "des-ede-cfb", NID_des_ede_cfb64, 0, NULL, 0}, + {"DES-EDE3-CFB", "des-ede3-cfb", NID_des_ede3_cfb64, 0, NULL, 0}, + {"DES-EDE-OFB", "des-ede-ofb", NID_des_ede_ofb64, 0, NULL, 0}, + {"DES-EDE3-OFB", "des-ede3-ofb", NID_des_ede3_ofb64, 0, NULL, 0}, + {"SHA1", "sha1", NID_sha1, 5, &kObjectData[360], 0}, + {"RSA-SHA1", "sha1WithRSAEncryption", NID_sha1WithRSAEncryption, 9, + &kObjectData[365], 0}, + {"DSA-SHA", "dsaWithSHA", NID_dsaWithSHA, 5, &kObjectData[374], 0}, + {"DSA-old", "dsaEncryption-old", NID_dsa_2, 5, &kObjectData[379], 0}, + {"PBE-SHA1-RC2-64", "pbeWithSHA1AndRC2-CBC", NID_pbeWithSHA1AndRC2_CBC, 9, + &kObjectData[384], 0}, + {"PBKDF2", "PBKDF2", NID_id_pbkdf2, 9, &kObjectData[393], 0}, + {"DSA-SHA1-old", "dsaWithSHA1-old", NID_dsaWithSHA1_2, 5, &kObjectData[402], + 0}, + {"nsCertType", "Netscape Cert Type", NID_netscape_cert_type, 9, + &kObjectData[407], 0}, + {"nsBaseUrl", "Netscape Base Url", NID_netscape_base_url, 9, + &kObjectData[416], 0}, + {"nsRevocationUrl", "Netscape Revocation Url", NID_netscape_revocation_url, + 9, &kObjectData[425], 0}, + {"nsCaRevocationUrl", "Netscape CA Revocation Url", + NID_netscape_ca_revocation_url, 9, &kObjectData[434], 0}, + {"nsRenewalUrl", "Netscape Renewal Url", NID_netscape_renewal_url, 9, + &kObjectData[443], 0}, + {"nsCaPolicyUrl", "Netscape CA Policy Url", NID_netscape_ca_policy_url, 9, + &kObjectData[452], 0}, + {"nsSslServerName", "Netscape SSL Server Name", + NID_netscape_ssl_server_name, 9, &kObjectData[461], 0}, + {"nsComment", "Netscape Comment", NID_netscape_comment, 9, + &kObjectData[470], 0}, + {"nsCertSequence", "Netscape Certificate Sequence", + NID_netscape_cert_sequence, 9, &kObjectData[479], 0}, + {"DESX-CBC", "desx-cbc", NID_desx_cbc, 0, NULL, 0}, + {"id-ce", "id-ce", NID_id_ce, 2, &kObjectData[488], 0}, + {"subjectKeyIdentifier", "X509v3 Subject Key Identifier", + NID_subject_key_identifier, 3, &kObjectData[490], 0}, + {"keyUsage", "X509v3 Key Usage", NID_key_usage, 3, &kObjectData[493], 0}, + {"privateKeyUsagePeriod", "X509v3 Private Key Usage Period", + NID_private_key_usage_period, 3, &kObjectData[496], 0}, + {"subjectAltName", "X509v3 Subject Alternative Name", NID_subject_alt_name, + 3, &kObjectData[499], 0}, + {"issuerAltName", "X509v3 Issuer Alternative Name", NID_issuer_alt_name, 3, + &kObjectData[502], 0}, + {"basicConstraints", "X509v3 Basic Constraints", NID_basic_constraints, 3, + &kObjectData[505], 0}, + {"crlNumber", "X509v3 CRL Number", NID_crl_number, 3, &kObjectData[508], 0}, + {"certificatePolicies", "X509v3 Certificate Policies", + NID_certificate_policies, 3, &kObjectData[511], 0}, + {"authorityKeyIdentifier", "X509v3 Authority Key Identifier", + NID_authority_key_identifier, 3, &kObjectData[514], 0}, + {"BF-CBC", "bf-cbc", NID_bf_cbc, 9, &kObjectData[517], 0}, + {"BF-ECB", "bf-ecb", NID_bf_ecb, 0, NULL, 0}, + {"BF-CFB", "bf-cfb", NID_bf_cfb64, 0, NULL, 0}, + {"BF-OFB", "bf-ofb", NID_bf_ofb64, 0, NULL, 0}, + {"MDC2", "mdc2", NID_mdc2, 4, &kObjectData[526], 0}, + {"RSA-MDC2", "mdc2WithRSA", NID_mdc2WithRSA, 4, &kObjectData[530], 0}, + {"RC4-40", "rc4-40", NID_rc4_40, 0, NULL, 0}, + {"RC2-40-CBC", "rc2-40-cbc", NID_rc2_40_cbc, 0, NULL, 0}, + {"GN", "givenName", NID_givenName, 3, &kObjectData[534], 0}, + {"SN", "surname", NID_surname, 3, &kObjectData[537], 0}, + {"initials", "initials", NID_initials, 3, &kObjectData[540], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"crlDistributionPoints", "X509v3 CRL Distribution Points", + NID_crl_distribution_points, 3, &kObjectData[543], 0}, + {"RSA-NP-MD5", "md5WithRSA", NID_md5WithRSA, 5, &kObjectData[546], 0}, + {"serialNumber", "serialNumber", NID_serialNumber, 3, &kObjectData[551], 0}, + {"title", "title", NID_title, 3, &kObjectData[554], 0}, + {"description", "description", NID_description, 3, &kObjectData[557], 0}, + {"CAST5-CBC", "cast5-cbc", NID_cast5_cbc, 9, &kObjectData[560], 0}, + {"CAST5-ECB", "cast5-ecb", NID_cast5_ecb, 0, NULL, 0}, + {"CAST5-CFB", "cast5-cfb", NID_cast5_cfb64, 0, NULL, 0}, + {"CAST5-OFB", "cast5-ofb", NID_cast5_ofb64, 0, NULL, 0}, + {"pbeWithMD5AndCast5CBC", "pbeWithMD5AndCast5CBC", + NID_pbeWithMD5AndCast5_CBC, 9, &kObjectData[569], 0}, + {"DSA-SHA1", "dsaWithSHA1", NID_dsaWithSHA1, 7, &kObjectData[578], 0}, + {"MD5-SHA1", "md5-sha1", NID_md5_sha1, 0, NULL, 0}, + {"RSA-SHA1-2", "sha1WithRSA", NID_sha1WithRSA, 5, &kObjectData[585], 0}, + {"DSA", "dsaEncryption", NID_dsa, 7, &kObjectData[590], 0}, + {"RIPEMD160", "ripemd160", NID_ripemd160, 5, &kObjectData[597], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"RSA-RIPEMD160", "ripemd160WithRSA", NID_ripemd160WithRSA, 6, + &kObjectData[602], 0}, + {"RC5-CBC", "rc5-cbc", NID_rc5_cbc, 8, &kObjectData[608], 0}, + {"RC5-ECB", "rc5-ecb", NID_rc5_ecb, 0, NULL, 0}, + {"RC5-CFB", "rc5-cfb", NID_rc5_cfb64, 0, NULL, 0}, + {"RC5-OFB", "rc5-ofb", NID_rc5_ofb64, 0, NULL, 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"ZLIB", "zlib compression", NID_zlib_compression, 11, &kObjectData[616], + 0}, + {"extendedKeyUsage", "X509v3 Extended Key Usage", NID_ext_key_usage, 3, + &kObjectData[627], 0}, + {"PKIX", "PKIX", NID_id_pkix, 6, &kObjectData[630], 0}, + {"id-kp", "id-kp", NID_id_kp, 7, &kObjectData[636], 0}, + {"serverAuth", "TLS Web Server Authentication", NID_server_auth, 8, + &kObjectData[643], 0}, + {"clientAuth", "TLS Web Client Authentication", NID_client_auth, 8, + &kObjectData[651], 0}, + {"codeSigning", "Code Signing", NID_code_sign, 8, &kObjectData[659], 0}, + {"emailProtection", "E-mail Protection", NID_email_protect, 8, + &kObjectData[667], 0}, + {"timeStamping", "Time Stamping", NID_time_stamp, 8, &kObjectData[675], 0}, + {"msCodeInd", "Microsoft Individual Code Signing", NID_ms_code_ind, 10, + &kObjectData[683], 0}, + {"msCodeCom", "Microsoft Commercial Code Signing", NID_ms_code_com, 10, + &kObjectData[693], 0}, + {"msCTLSign", "Microsoft Trust List Signing", NID_ms_ctl_sign, 10, + &kObjectData[703], 0}, + {"msSGC", "Microsoft Server Gated Crypto", NID_ms_sgc, 10, + &kObjectData[713], 0}, + {"msEFS", "Microsoft Encrypted File System", NID_ms_efs, 10, + &kObjectData[723], 0}, + {"nsSGC", "Netscape Server Gated Crypto", NID_ns_sgc, 9, &kObjectData[733], + 0}, + {"deltaCRL", "X509v3 Delta CRL Indicator", NID_delta_crl, 3, + &kObjectData[742], 0}, + {"CRLReason", "X509v3 CRL Reason Code", NID_crl_reason, 3, + &kObjectData[745], 0}, + {"invalidityDate", "Invalidity Date", NID_invalidity_date, 3, + &kObjectData[748], 0}, + {"SXNetID", "Strong Extranet ID", NID_sxnet, 5, &kObjectData[751], 0}, + {"PBE-SHA1-RC4-128", "pbeWithSHA1And128BitRC4", + NID_pbe_WithSHA1And128BitRC4, 10, &kObjectData[756], 0}, + {"PBE-SHA1-RC4-40", "pbeWithSHA1And40BitRC4", NID_pbe_WithSHA1And40BitRC4, + 10, &kObjectData[766], 0}, + {"PBE-SHA1-3DES", "pbeWithSHA1And3-KeyTripleDES-CBC", + NID_pbe_WithSHA1And3_Key_TripleDES_CBC, 10, &kObjectData[776], 0}, + {"PBE-SHA1-2DES", "pbeWithSHA1And2-KeyTripleDES-CBC", + NID_pbe_WithSHA1And2_Key_TripleDES_CBC, 10, &kObjectData[786], 0}, + {"PBE-SHA1-RC2-128", "pbeWithSHA1And128BitRC2-CBC", + NID_pbe_WithSHA1And128BitRC2_CBC, 10, &kObjectData[796], 0}, + {"PBE-SHA1-RC2-40", "pbeWithSHA1And40BitRC2-CBC", + NID_pbe_WithSHA1And40BitRC2_CBC, 10, &kObjectData[806], 0}, + {"keyBag", "keyBag", NID_keyBag, 11, &kObjectData[816], 0}, + {"pkcs8ShroudedKeyBag", "pkcs8ShroudedKeyBag", NID_pkcs8ShroudedKeyBag, 11, + &kObjectData[827], 0}, + {"certBag", "certBag", NID_certBag, 11, &kObjectData[838], 0}, + {"crlBag", "crlBag", NID_crlBag, 11, &kObjectData[849], 0}, + {"secretBag", "secretBag", NID_secretBag, 11, &kObjectData[860], 0}, + {"safeContentsBag", "safeContentsBag", NID_safeContentsBag, 11, + &kObjectData[871], 0}, + {"friendlyName", "friendlyName", NID_friendlyName, 9, &kObjectData[882], 0}, + {"localKeyID", "localKeyID", NID_localKeyID, 9, &kObjectData[891], 0}, + {"x509Certificate", "x509Certificate", NID_x509Certificate, 10, + &kObjectData[900], 0}, + {"sdsiCertificate", "sdsiCertificate", NID_sdsiCertificate, 10, + &kObjectData[910], 0}, + {"x509Crl", "x509Crl", NID_x509Crl, 10, &kObjectData[920], 0}, + {"PBES2", "PBES2", NID_pbes2, 9, &kObjectData[930], 0}, + {"PBMAC1", "PBMAC1", NID_pbmac1, 9, &kObjectData[939], 0}, + {"hmacWithSHA1", "hmacWithSHA1", NID_hmacWithSHA1, 8, &kObjectData[948], 0}, + {"id-qt-cps", "Policy Qualifier CPS", NID_id_qt_cps, 8, &kObjectData[956], + 0}, + {"id-qt-unotice", "Policy Qualifier User Notice", NID_id_qt_unotice, 8, + &kObjectData[964], 0}, + {"RC2-64-CBC", "rc2-64-cbc", NID_rc2_64_cbc, 0, NULL, 0}, + {"SMIME-CAPS", "S/MIME Capabilities", NID_SMIMECapabilities, 9, + &kObjectData[972], 0}, + {"PBE-MD2-RC2-64", "pbeWithMD2AndRC2-CBC", NID_pbeWithMD2AndRC2_CBC, 9, + &kObjectData[981], 0}, + {"PBE-MD5-RC2-64", "pbeWithMD5AndRC2-CBC", NID_pbeWithMD5AndRC2_CBC, 9, + &kObjectData[990], 0}, + {"PBE-SHA1-DES", "pbeWithSHA1AndDES-CBC", NID_pbeWithSHA1AndDES_CBC, 9, + &kObjectData[999], 0}, + {"msExtReq", "Microsoft Extension Request", NID_ms_ext_req, 10, + &kObjectData[1008], 0}, + {"extReq", "Extension Request", NID_ext_req, 9, &kObjectData[1018], 0}, + {"name", "name", NID_name, 3, &kObjectData[1027], 0}, + {"dnQualifier", "dnQualifier", NID_dnQualifier, 3, &kObjectData[1030], 0}, + {"id-pe", "id-pe", NID_id_pe, 7, &kObjectData[1033], 0}, + {"id-ad", "id-ad", NID_id_ad, 7, &kObjectData[1040], 0}, + {"authorityInfoAccess", "Authority Information Access", NID_info_access, 8, + &kObjectData[1047], 0}, + {"OCSP", "OCSP", NID_ad_OCSP, 8, &kObjectData[1055], 0}, + {"caIssuers", "CA Issuers", NID_ad_ca_issuers, 8, &kObjectData[1063], 0}, + {"OCSPSigning", "OCSP Signing", NID_OCSP_sign, 8, &kObjectData[1071], 0}, + {"ISO", "iso", NID_iso, 0, NULL, 0}, + {"member-body", "ISO Member Body", NID_member_body, 1, &kObjectData[1079], + 0}, + {"ISO-US", "ISO US Member Body", NID_ISO_US, 3, &kObjectData[1080], 0}, + {"X9-57", "X9.57", NID_X9_57, 5, &kObjectData[1083], 0}, + {"X9cm", "X9.57 CM ?", NID_X9cm, 6, &kObjectData[1088], 0}, + {"pkcs1", "pkcs1", NID_pkcs1, 8, &kObjectData[1094], 0}, + {"pkcs5", "pkcs5", NID_pkcs5, 8, &kObjectData[1102], 0}, + {"SMIME", "S/MIME", NID_SMIME, 9, &kObjectData[1110], 0}, + {"id-smime-mod", "id-smime-mod", NID_id_smime_mod, 10, &kObjectData[1119], + 0}, + {"id-smime-ct", "id-smime-ct", NID_id_smime_ct, 10, &kObjectData[1129], 0}, + {"id-smime-aa", "id-smime-aa", NID_id_smime_aa, 10, &kObjectData[1139], 0}, + {"id-smime-alg", "id-smime-alg", NID_id_smime_alg, 10, &kObjectData[1149], + 0}, + {"id-smime-cd", "id-smime-cd", NID_id_smime_cd, 10, &kObjectData[1159], 0}, + {"id-smime-spq", "id-smime-spq", NID_id_smime_spq, 10, &kObjectData[1169], + 0}, + {"id-smime-cti", "id-smime-cti", NID_id_smime_cti, 10, &kObjectData[1179], + 0}, + {"id-smime-mod-cms", "id-smime-mod-cms", NID_id_smime_mod_cms, 11, + &kObjectData[1189], 0}, + {"id-smime-mod-ess", "id-smime-mod-ess", NID_id_smime_mod_ess, 11, + &kObjectData[1200], 0}, + {"id-smime-mod-oid", "id-smime-mod-oid", NID_id_smime_mod_oid, 11, + &kObjectData[1211], 0}, + {"id-smime-mod-msg-v3", "id-smime-mod-msg-v3", NID_id_smime_mod_msg_v3, 11, + &kObjectData[1222], 0}, + {"id-smime-mod-ets-eSignature-88", "id-smime-mod-ets-eSignature-88", + NID_id_smime_mod_ets_eSignature_88, 11, &kObjectData[1233], 0}, + {"id-smime-mod-ets-eSignature-97", "id-smime-mod-ets-eSignature-97", + NID_id_smime_mod_ets_eSignature_97, 11, &kObjectData[1244], 0}, + {"id-smime-mod-ets-eSigPolicy-88", "id-smime-mod-ets-eSigPolicy-88", + NID_id_smime_mod_ets_eSigPolicy_88, 11, &kObjectData[1255], 0}, + {"id-smime-mod-ets-eSigPolicy-97", "id-smime-mod-ets-eSigPolicy-97", + NID_id_smime_mod_ets_eSigPolicy_97, 11, &kObjectData[1266], 0}, + {"id-smime-ct-receipt", "id-smime-ct-receipt", NID_id_smime_ct_receipt, 11, + &kObjectData[1277], 0}, + {"id-smime-ct-authData", "id-smime-ct-authData", NID_id_smime_ct_authData, + 11, &kObjectData[1288], 0}, + {"id-smime-ct-publishCert", "id-smime-ct-publishCert", + NID_id_smime_ct_publishCert, 11, &kObjectData[1299], 0}, + {"id-smime-ct-TSTInfo", "id-smime-ct-TSTInfo", NID_id_smime_ct_TSTInfo, 11, + &kObjectData[1310], 0}, + {"id-smime-ct-TDTInfo", "id-smime-ct-TDTInfo", NID_id_smime_ct_TDTInfo, 11, + &kObjectData[1321], 0}, + {"id-smime-ct-contentInfo", "id-smime-ct-contentInfo", + NID_id_smime_ct_contentInfo, 11, &kObjectData[1332], 0}, + {"id-smime-ct-DVCSRequestData", "id-smime-ct-DVCSRequestData", + NID_id_smime_ct_DVCSRequestData, 11, &kObjectData[1343], 0}, + {"id-smime-ct-DVCSResponseData", "id-smime-ct-DVCSResponseData", + NID_id_smime_ct_DVCSResponseData, 11, &kObjectData[1354], 0}, + {"id-smime-aa-receiptRequest", "id-smime-aa-receiptRequest", + NID_id_smime_aa_receiptRequest, 11, &kObjectData[1365], 0}, + {"id-smime-aa-securityLabel", "id-smime-aa-securityLabel", + NID_id_smime_aa_securityLabel, 11, &kObjectData[1376], 0}, + {"id-smime-aa-mlExpandHistory", "id-smime-aa-mlExpandHistory", + NID_id_smime_aa_mlExpandHistory, 11, &kObjectData[1387], 0}, + {"id-smime-aa-contentHint", "id-smime-aa-contentHint", + NID_id_smime_aa_contentHint, 11, &kObjectData[1398], 0}, + {"id-smime-aa-msgSigDigest", "id-smime-aa-msgSigDigest", + NID_id_smime_aa_msgSigDigest, 11, &kObjectData[1409], 0}, + {"id-smime-aa-encapContentType", "id-smime-aa-encapContentType", + NID_id_smime_aa_encapContentType, 11, &kObjectData[1420], 0}, + {"id-smime-aa-contentIdentifier", "id-smime-aa-contentIdentifier", + NID_id_smime_aa_contentIdentifier, 11, &kObjectData[1431], 0}, + {"id-smime-aa-macValue", "id-smime-aa-macValue", NID_id_smime_aa_macValue, + 11, &kObjectData[1442], 0}, + {"id-smime-aa-equivalentLabels", "id-smime-aa-equivalentLabels", + NID_id_smime_aa_equivalentLabels, 11, &kObjectData[1453], 0}, + {"id-smime-aa-contentReference", "id-smime-aa-contentReference", + NID_id_smime_aa_contentReference, 11, &kObjectData[1464], 0}, + {"id-smime-aa-encrypKeyPref", "id-smime-aa-encrypKeyPref", + NID_id_smime_aa_encrypKeyPref, 11, &kObjectData[1475], 0}, + {"id-smime-aa-signingCertificate", "id-smime-aa-signingCertificate", + NID_id_smime_aa_signingCertificate, 11, &kObjectData[1486], 0}, + {"id-smime-aa-smimeEncryptCerts", "id-smime-aa-smimeEncryptCerts", + NID_id_smime_aa_smimeEncryptCerts, 11, &kObjectData[1497], 0}, + {"id-smime-aa-timeStampToken", "id-smime-aa-timeStampToken", + NID_id_smime_aa_timeStampToken, 11, &kObjectData[1508], 0}, + {"id-smime-aa-ets-sigPolicyId", "id-smime-aa-ets-sigPolicyId", + NID_id_smime_aa_ets_sigPolicyId, 11, &kObjectData[1519], 0}, + {"id-smime-aa-ets-commitmentType", "id-smime-aa-ets-commitmentType", + NID_id_smime_aa_ets_commitmentType, 11, &kObjectData[1530], 0}, + {"id-smime-aa-ets-signerLocation", "id-smime-aa-ets-signerLocation", + NID_id_smime_aa_ets_signerLocation, 11, &kObjectData[1541], 0}, + {"id-smime-aa-ets-signerAttr", "id-smime-aa-ets-signerAttr", + NID_id_smime_aa_ets_signerAttr, 11, &kObjectData[1552], 0}, + {"id-smime-aa-ets-otherSigCert", "id-smime-aa-ets-otherSigCert", + NID_id_smime_aa_ets_otherSigCert, 11, &kObjectData[1563], 0}, + {"id-smime-aa-ets-contentTimestamp", "id-smime-aa-ets-contentTimestamp", + NID_id_smime_aa_ets_contentTimestamp, 11, &kObjectData[1574], 0}, + {"id-smime-aa-ets-CertificateRefs", "id-smime-aa-ets-CertificateRefs", + NID_id_smime_aa_ets_CertificateRefs, 11, &kObjectData[1585], 0}, + {"id-smime-aa-ets-RevocationRefs", "id-smime-aa-ets-RevocationRefs", + NID_id_smime_aa_ets_RevocationRefs, 11, &kObjectData[1596], 0}, + {"id-smime-aa-ets-certValues", "id-smime-aa-ets-certValues", + NID_id_smime_aa_ets_certValues, 11, &kObjectData[1607], 0}, + {"id-smime-aa-ets-revocationValues", "id-smime-aa-ets-revocationValues", + NID_id_smime_aa_ets_revocationValues, 11, &kObjectData[1618], 0}, + {"id-smime-aa-ets-escTimeStamp", "id-smime-aa-ets-escTimeStamp", + NID_id_smime_aa_ets_escTimeStamp, 11, &kObjectData[1629], 0}, + {"id-smime-aa-ets-certCRLTimestamp", "id-smime-aa-ets-certCRLTimestamp", + NID_id_smime_aa_ets_certCRLTimestamp, 11, &kObjectData[1640], 0}, + {"id-smime-aa-ets-archiveTimeStamp", "id-smime-aa-ets-archiveTimeStamp", + NID_id_smime_aa_ets_archiveTimeStamp, 11, &kObjectData[1651], 0}, + {"id-smime-aa-signatureType", "id-smime-aa-signatureType", + NID_id_smime_aa_signatureType, 11, &kObjectData[1662], 0}, + {"id-smime-aa-dvcs-dvc", "id-smime-aa-dvcs-dvc", NID_id_smime_aa_dvcs_dvc, + 11, &kObjectData[1673], 0}, + {"id-smime-alg-ESDHwith3DES", "id-smime-alg-ESDHwith3DES", + NID_id_smime_alg_ESDHwith3DES, 11, &kObjectData[1684], 0}, + {"id-smime-alg-ESDHwithRC2", "id-smime-alg-ESDHwithRC2", + NID_id_smime_alg_ESDHwithRC2, 11, &kObjectData[1695], 0}, + {"id-smime-alg-3DESwrap", "id-smime-alg-3DESwrap", + NID_id_smime_alg_3DESwrap, 11, &kObjectData[1706], 0}, + {"id-smime-alg-RC2wrap", "id-smime-alg-RC2wrap", NID_id_smime_alg_RC2wrap, + 11, &kObjectData[1717], 0}, + {"id-smime-alg-ESDH", "id-smime-alg-ESDH", NID_id_smime_alg_ESDH, 11, + &kObjectData[1728], 0}, + {"id-smime-alg-CMS3DESwrap", "id-smime-alg-CMS3DESwrap", + NID_id_smime_alg_CMS3DESwrap, 11, &kObjectData[1739], 0}, + {"id-smime-alg-CMSRC2wrap", "id-smime-alg-CMSRC2wrap", + NID_id_smime_alg_CMSRC2wrap, 11, &kObjectData[1750], 0}, + {"id-smime-cd-ldap", "id-smime-cd-ldap", NID_id_smime_cd_ldap, 11, + &kObjectData[1761], 0}, + {"id-smime-spq-ets-sqt-uri", "id-smime-spq-ets-sqt-uri", + NID_id_smime_spq_ets_sqt_uri, 11, &kObjectData[1772], 0}, + {"id-smime-spq-ets-sqt-unotice", "id-smime-spq-ets-sqt-unotice", + NID_id_smime_spq_ets_sqt_unotice, 11, &kObjectData[1783], 0}, + {"id-smime-cti-ets-proofOfOrigin", "id-smime-cti-ets-proofOfOrigin", + NID_id_smime_cti_ets_proofOfOrigin, 11, &kObjectData[1794], 0}, + {"id-smime-cti-ets-proofOfReceipt", "id-smime-cti-ets-proofOfReceipt", + NID_id_smime_cti_ets_proofOfReceipt, 11, &kObjectData[1805], 0}, + {"id-smime-cti-ets-proofOfDelivery", "id-smime-cti-ets-proofOfDelivery", + NID_id_smime_cti_ets_proofOfDelivery, 11, &kObjectData[1816], 0}, + {"id-smime-cti-ets-proofOfSender", "id-smime-cti-ets-proofOfSender", + NID_id_smime_cti_ets_proofOfSender, 11, &kObjectData[1827], 0}, + {"id-smime-cti-ets-proofOfApproval", "id-smime-cti-ets-proofOfApproval", + NID_id_smime_cti_ets_proofOfApproval, 11, &kObjectData[1838], 0}, + {"id-smime-cti-ets-proofOfCreation", "id-smime-cti-ets-proofOfCreation", + NID_id_smime_cti_ets_proofOfCreation, 11, &kObjectData[1849], 0}, + {"MD4", "md4", NID_md4, 8, &kObjectData[1860], 0}, + {"id-pkix-mod", "id-pkix-mod", NID_id_pkix_mod, 7, &kObjectData[1868], 0}, + {"id-qt", "id-qt", NID_id_qt, 7, &kObjectData[1875], 0}, + {"id-it", "id-it", NID_id_it, 7, &kObjectData[1882], 0}, + {"id-pkip", "id-pkip", NID_id_pkip, 7, &kObjectData[1889], 0}, + {"id-alg", "id-alg", NID_id_alg, 7, &kObjectData[1896], 0}, + {"id-cmc", "id-cmc", NID_id_cmc, 7, &kObjectData[1903], 0}, + {"id-on", "id-on", NID_id_on, 7, &kObjectData[1910], 0}, + {"id-pda", "id-pda", NID_id_pda, 7, &kObjectData[1917], 0}, + {"id-aca", "id-aca", NID_id_aca, 7, &kObjectData[1924], 0}, + {"id-qcs", "id-qcs", NID_id_qcs, 7, &kObjectData[1931], 0}, + {"id-cct", "id-cct", NID_id_cct, 7, &kObjectData[1938], 0}, + {"id-pkix1-explicit-88", "id-pkix1-explicit-88", NID_id_pkix1_explicit_88, + 8, &kObjectData[1945], 0}, + {"id-pkix1-implicit-88", "id-pkix1-implicit-88", NID_id_pkix1_implicit_88, + 8, &kObjectData[1953], 0}, + {"id-pkix1-explicit-93", "id-pkix1-explicit-93", NID_id_pkix1_explicit_93, + 8, &kObjectData[1961], 0}, + {"id-pkix1-implicit-93", "id-pkix1-implicit-93", NID_id_pkix1_implicit_93, + 8, &kObjectData[1969], 0}, + {"id-mod-crmf", "id-mod-crmf", NID_id_mod_crmf, 8, &kObjectData[1977], 0}, + {"id-mod-cmc", "id-mod-cmc", NID_id_mod_cmc, 8, &kObjectData[1985], 0}, + {"id-mod-kea-profile-88", "id-mod-kea-profile-88", + NID_id_mod_kea_profile_88, 8, &kObjectData[1993], 0}, + {"id-mod-kea-profile-93", "id-mod-kea-profile-93", + NID_id_mod_kea_profile_93, 8, &kObjectData[2001], 0}, + {"id-mod-cmp", "id-mod-cmp", NID_id_mod_cmp, 8, &kObjectData[2009], 0}, + {"id-mod-qualified-cert-88", "id-mod-qualified-cert-88", + NID_id_mod_qualified_cert_88, 8, &kObjectData[2017], 0}, + {"id-mod-qualified-cert-93", "id-mod-qualified-cert-93", + NID_id_mod_qualified_cert_93, 8, &kObjectData[2025], 0}, + {"id-mod-attribute-cert", "id-mod-attribute-cert", + NID_id_mod_attribute_cert, 8, &kObjectData[2033], 0}, + {"id-mod-timestamp-protocol", "id-mod-timestamp-protocol", + NID_id_mod_timestamp_protocol, 8, &kObjectData[2041], 0}, + {"id-mod-ocsp", "id-mod-ocsp", NID_id_mod_ocsp, 8, &kObjectData[2049], 0}, + {"id-mod-dvcs", "id-mod-dvcs", NID_id_mod_dvcs, 8, &kObjectData[2057], 0}, + {"id-mod-cmp2000", "id-mod-cmp2000", NID_id_mod_cmp2000, 8, + &kObjectData[2065], 0}, + {"biometricInfo", "Biometric Info", NID_biometricInfo, 8, + &kObjectData[2073], 0}, + {"qcStatements", "qcStatements", NID_qcStatements, 8, &kObjectData[2081], + 0}, + {"ac-auditEntity", "ac-auditEntity", NID_ac_auditEntity, 8, + &kObjectData[2089], 0}, + {"ac-targeting", "ac-targeting", NID_ac_targeting, 8, &kObjectData[2097], + 0}, + {"aaControls", "aaControls", NID_aaControls, 8, &kObjectData[2105], 0}, + {"sbgp-ipAddrBlock", "sbgp-ipAddrBlock", NID_sbgp_ipAddrBlock, 8, + &kObjectData[2113], 0}, + {"sbgp-autonomousSysNum", "sbgp-autonomousSysNum", + NID_sbgp_autonomousSysNum, 8, &kObjectData[2121], 0}, + {"sbgp-routerIdentifier", "sbgp-routerIdentifier", + NID_sbgp_routerIdentifier, 8, &kObjectData[2129], 0}, + {"textNotice", "textNotice", NID_textNotice, 8, &kObjectData[2137], 0}, + {"ipsecEndSystem", "IPSec End System", NID_ipsecEndSystem, 8, + &kObjectData[2145], 0}, + {"ipsecTunnel", "IPSec Tunnel", NID_ipsecTunnel, 8, &kObjectData[2153], 0}, + {"ipsecUser", "IPSec User", NID_ipsecUser, 8, &kObjectData[2161], 0}, + {"DVCS", "dvcs", NID_dvcs, 8, &kObjectData[2169], 0}, + {"id-it-caProtEncCert", "id-it-caProtEncCert", NID_id_it_caProtEncCert, 8, + &kObjectData[2177], 0}, + {"id-it-signKeyPairTypes", "id-it-signKeyPairTypes", + NID_id_it_signKeyPairTypes, 8, &kObjectData[2185], 0}, + {"id-it-encKeyPairTypes", "id-it-encKeyPairTypes", + NID_id_it_encKeyPairTypes, 8, &kObjectData[2193], 0}, + {"id-it-preferredSymmAlg", "id-it-preferredSymmAlg", + NID_id_it_preferredSymmAlg, 8, &kObjectData[2201], 0}, + {"id-it-caKeyUpdateInfo", "id-it-caKeyUpdateInfo", + NID_id_it_caKeyUpdateInfo, 8, &kObjectData[2209], 0}, + {"id-it-currentCRL", "id-it-currentCRL", NID_id_it_currentCRL, 8, + &kObjectData[2217], 0}, + {"id-it-unsupportedOIDs", "id-it-unsupportedOIDs", + NID_id_it_unsupportedOIDs, 8, &kObjectData[2225], 0}, + {"id-it-subscriptionRequest", "id-it-subscriptionRequest", + NID_id_it_subscriptionRequest, 8, &kObjectData[2233], 0}, + {"id-it-subscriptionResponse", "id-it-subscriptionResponse", + NID_id_it_subscriptionResponse, 8, &kObjectData[2241], 0}, + {"id-it-keyPairParamReq", "id-it-keyPairParamReq", + NID_id_it_keyPairParamReq, 8, &kObjectData[2249], 0}, + {"id-it-keyPairParamRep", "id-it-keyPairParamRep", + NID_id_it_keyPairParamRep, 8, &kObjectData[2257], 0}, + {"id-it-revPassphrase", "id-it-revPassphrase", NID_id_it_revPassphrase, 8, + &kObjectData[2265], 0}, + {"id-it-implicitConfirm", "id-it-implicitConfirm", + NID_id_it_implicitConfirm, 8, &kObjectData[2273], 0}, + {"id-it-confirmWaitTime", "id-it-confirmWaitTime", + NID_id_it_confirmWaitTime, 8, &kObjectData[2281], 0}, + {"id-it-origPKIMessage", "id-it-origPKIMessage", NID_id_it_origPKIMessage, + 8, &kObjectData[2289], 0}, + {"id-regCtrl", "id-regCtrl", NID_id_regCtrl, 8, &kObjectData[2297], 0}, + {"id-regInfo", "id-regInfo", NID_id_regInfo, 8, &kObjectData[2305], 0}, + {"id-regCtrl-regToken", "id-regCtrl-regToken", NID_id_regCtrl_regToken, 9, + &kObjectData[2313], 0}, + {"id-regCtrl-authenticator", "id-regCtrl-authenticator", + NID_id_regCtrl_authenticator, 9, &kObjectData[2322], 0}, + {"id-regCtrl-pkiPublicationInfo", "id-regCtrl-pkiPublicationInfo", + NID_id_regCtrl_pkiPublicationInfo, 9, &kObjectData[2331], 0}, + {"id-regCtrl-pkiArchiveOptions", "id-regCtrl-pkiArchiveOptions", + NID_id_regCtrl_pkiArchiveOptions, 9, &kObjectData[2340], 0}, + {"id-regCtrl-oldCertID", "id-regCtrl-oldCertID", NID_id_regCtrl_oldCertID, + 9, &kObjectData[2349], 0}, + {"id-regCtrl-protocolEncrKey", "id-regCtrl-protocolEncrKey", + NID_id_regCtrl_protocolEncrKey, 9, &kObjectData[2358], 0}, + {"id-regInfo-utf8Pairs", "id-regInfo-utf8Pairs", NID_id_regInfo_utf8Pairs, + 9, &kObjectData[2367], 0}, + {"id-regInfo-certReq", "id-regInfo-certReq", NID_id_regInfo_certReq, 9, + &kObjectData[2376], 0}, + {"id-alg-des40", "id-alg-des40", NID_id_alg_des40, 8, &kObjectData[2385], + 0}, + {"id-alg-noSignature", "id-alg-noSignature", NID_id_alg_noSignature, 8, + &kObjectData[2393], 0}, + {"id-alg-dh-sig-hmac-sha1", "id-alg-dh-sig-hmac-sha1", + NID_id_alg_dh_sig_hmac_sha1, 8, &kObjectData[2401], 0}, + {"id-alg-dh-pop", "id-alg-dh-pop", NID_id_alg_dh_pop, 8, &kObjectData[2409], + 0}, + {"id-cmc-statusInfo", "id-cmc-statusInfo", NID_id_cmc_statusInfo, 8, + &kObjectData[2417], 0}, + {"id-cmc-identification", "id-cmc-identification", + NID_id_cmc_identification, 8, &kObjectData[2425], 0}, + {"id-cmc-identityProof", "id-cmc-identityProof", NID_id_cmc_identityProof, + 8, &kObjectData[2433], 0}, + {"id-cmc-dataReturn", "id-cmc-dataReturn", NID_id_cmc_dataReturn, 8, + &kObjectData[2441], 0}, + {"id-cmc-transactionId", "id-cmc-transactionId", NID_id_cmc_transactionId, + 8, &kObjectData[2449], 0}, + {"id-cmc-senderNonce", "id-cmc-senderNonce", NID_id_cmc_senderNonce, 8, + &kObjectData[2457], 0}, + {"id-cmc-recipientNonce", "id-cmc-recipientNonce", + NID_id_cmc_recipientNonce, 8, &kObjectData[2465], 0}, + {"id-cmc-addExtensions", "id-cmc-addExtensions", NID_id_cmc_addExtensions, + 8, &kObjectData[2473], 0}, + {"id-cmc-encryptedPOP", "id-cmc-encryptedPOP", NID_id_cmc_encryptedPOP, 8, + &kObjectData[2481], 0}, + {"id-cmc-decryptedPOP", "id-cmc-decryptedPOP", NID_id_cmc_decryptedPOP, 8, + &kObjectData[2489], 0}, + {"id-cmc-lraPOPWitness", "id-cmc-lraPOPWitness", NID_id_cmc_lraPOPWitness, + 8, &kObjectData[2497], 0}, + {"id-cmc-getCert", "id-cmc-getCert", NID_id_cmc_getCert, 8, + &kObjectData[2505], 0}, + {"id-cmc-getCRL", "id-cmc-getCRL", NID_id_cmc_getCRL, 8, &kObjectData[2513], + 0}, + {"id-cmc-revokeRequest", "id-cmc-revokeRequest", NID_id_cmc_revokeRequest, + 8, &kObjectData[2521], 0}, + {"id-cmc-regInfo", "id-cmc-regInfo", NID_id_cmc_regInfo, 8, + &kObjectData[2529], 0}, + {"id-cmc-responseInfo", "id-cmc-responseInfo", NID_id_cmc_responseInfo, 8, + &kObjectData[2537], 0}, + {"id-cmc-queryPending", "id-cmc-queryPending", NID_id_cmc_queryPending, 8, + &kObjectData[2545], 0}, + {"id-cmc-popLinkRandom", "id-cmc-popLinkRandom", NID_id_cmc_popLinkRandom, + 8, &kObjectData[2553], 0}, + {"id-cmc-popLinkWitness", "id-cmc-popLinkWitness", + NID_id_cmc_popLinkWitness, 8, &kObjectData[2561], 0}, + {"id-cmc-confirmCertAcceptance", "id-cmc-confirmCertAcceptance", + NID_id_cmc_confirmCertAcceptance, 8, &kObjectData[2569], 0}, + {"id-on-personalData", "id-on-personalData", NID_id_on_personalData, 8, + &kObjectData[2577], 0}, + {"id-pda-dateOfBirth", "id-pda-dateOfBirth", NID_id_pda_dateOfBirth, 8, + &kObjectData[2585], 0}, + {"id-pda-placeOfBirth", "id-pda-placeOfBirth", NID_id_pda_placeOfBirth, 8, + &kObjectData[2593], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"id-pda-gender", "id-pda-gender", NID_id_pda_gender, 8, &kObjectData[2601], + 0}, + {"id-pda-countryOfCitizenship", "id-pda-countryOfCitizenship", + NID_id_pda_countryOfCitizenship, 8, &kObjectData[2609], 0}, + {"id-pda-countryOfResidence", "id-pda-countryOfResidence", + NID_id_pda_countryOfResidence, 8, &kObjectData[2617], 0}, + {"id-aca-authenticationInfo", "id-aca-authenticationInfo", + NID_id_aca_authenticationInfo, 8, &kObjectData[2625], 0}, + {"id-aca-accessIdentity", "id-aca-accessIdentity", + NID_id_aca_accessIdentity, 8, &kObjectData[2633], 0}, + {"id-aca-chargingIdentity", "id-aca-chargingIdentity", + NID_id_aca_chargingIdentity, 8, &kObjectData[2641], 0}, + {"id-aca-group", "id-aca-group", NID_id_aca_group, 8, &kObjectData[2649], + 0}, + {"id-aca-role", "id-aca-role", NID_id_aca_role, 8, &kObjectData[2657], 0}, + {"id-qcs-pkixQCSyntax-v1", "id-qcs-pkixQCSyntax-v1", + NID_id_qcs_pkixQCSyntax_v1, 8, &kObjectData[2665], 0}, + {"id-cct-crs", "id-cct-crs", NID_id_cct_crs, 8, &kObjectData[2673], 0}, + {"id-cct-PKIData", "id-cct-PKIData", NID_id_cct_PKIData, 8, + &kObjectData[2681], 0}, + {"id-cct-PKIResponse", "id-cct-PKIResponse", NID_id_cct_PKIResponse, 8, + &kObjectData[2689], 0}, + {"ad_timestamping", "AD Time Stamping", NID_ad_timeStamping, 8, + &kObjectData[2697], 0}, + {"AD_DVCS", "ad dvcs", NID_ad_dvcs, 8, &kObjectData[2705], 0}, + {"basicOCSPResponse", "Basic OCSP Response", NID_id_pkix_OCSP_basic, 9, + &kObjectData[2713], 0}, + {"Nonce", "OCSP Nonce", NID_id_pkix_OCSP_Nonce, 9, &kObjectData[2722], 0}, + {"CrlID", "OCSP CRL ID", NID_id_pkix_OCSP_CrlID, 9, &kObjectData[2731], 0}, + {"acceptableResponses", "Acceptable OCSP Responses", + NID_id_pkix_OCSP_acceptableResponses, 9, &kObjectData[2740], 0}, + {"noCheck", "OCSP No Check", NID_id_pkix_OCSP_noCheck, 9, + &kObjectData[2749], 0}, + {"archiveCutoff", "OCSP Archive Cutoff", NID_id_pkix_OCSP_archiveCutoff, 9, + &kObjectData[2758], 0}, + {"serviceLocator", "OCSP Service Locator", NID_id_pkix_OCSP_serviceLocator, + 9, &kObjectData[2767], 0}, + {"extendedStatus", "Extended OCSP Status", NID_id_pkix_OCSP_extendedStatus, + 9, &kObjectData[2776], 0}, + {"valid", "valid", NID_id_pkix_OCSP_valid, 9, &kObjectData[2785], 0}, + {"path", "path", NID_id_pkix_OCSP_path, 9, &kObjectData[2794], 0}, + {"trustRoot", "Trust Root", NID_id_pkix_OCSP_trustRoot, 9, + &kObjectData[2803], 0}, + {"algorithm", "algorithm", NID_algorithm, 4, &kObjectData[2812], 0}, + {"rsaSignature", "rsaSignature", NID_rsaSignature, 5, &kObjectData[2816], + 0}, + {"X500algorithms", "directory services - algorithms", NID_X500algorithms, 2, + &kObjectData[2821], 0}, + {"ORG", "org", NID_org, 1, &kObjectData[2823], 0}, + {"DOD", "dod", NID_dod, 2, &kObjectData[2824], 0}, + {"IANA", "iana", NID_iana, 3, &kObjectData[2826], 0}, + {"directory", "Directory", NID_Directory, 4, &kObjectData[2829], 0}, + {"mgmt", "Management", NID_Management, 4, &kObjectData[2833], 0}, + {"experimental", "Experimental", NID_Experimental, 4, &kObjectData[2837], + 0}, + {"private", "Private", NID_Private, 4, &kObjectData[2841], 0}, + {"security", "Security", NID_Security, 4, &kObjectData[2845], 0}, + {"snmpv2", "SNMPv2", NID_SNMPv2, 4, &kObjectData[2849], 0}, + {"Mail", "Mail", NID_Mail, 4, &kObjectData[2853], 0}, + {"enterprises", "Enterprises", NID_Enterprises, 5, &kObjectData[2857], 0}, + {"dcobject", "dcObject", NID_dcObject, 9, &kObjectData[2862], 0}, + {"DC", "domainComponent", NID_domainComponent, 10, &kObjectData[2871], 0}, + {"domain", "Domain", NID_Domain, 10, &kObjectData[2881], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"selected-attribute-types", "Selected Attribute Types", + NID_selected_attribute_types, 3, &kObjectData[2891], 0}, + {"clearance", "clearance", NID_clearance, 4, &kObjectData[2894], 0}, + {"RSA-MD4", "md4WithRSAEncryption", NID_md4WithRSAEncryption, 9, + &kObjectData[2898], 0}, + {"ac-proxying", "ac-proxying", NID_ac_proxying, 8, &kObjectData[2907], 0}, + {"subjectInfoAccess", "Subject Information Access", NID_sinfo_access, 8, + &kObjectData[2915], 0}, + {"id-aca-encAttrs", "id-aca-encAttrs", NID_id_aca_encAttrs, 8, + &kObjectData[2923], 0}, + {"role", "role", NID_role, 3, &kObjectData[2931], 0}, + {"policyConstraints", "X509v3 Policy Constraints", NID_policy_constraints, + 3, &kObjectData[2934], 0}, + {"targetInformation", "X509v3 AC Targeting", NID_target_information, 3, + &kObjectData[2937], 0}, + {"noRevAvail", "X509v3 No Revocation Available", NID_no_rev_avail, 3, + &kObjectData[2940], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"ansi-X9-62", "ANSI X9.62", NID_ansi_X9_62, 5, &kObjectData[2943], 0}, + {"prime-field", "prime-field", NID_X9_62_prime_field, 7, &kObjectData[2948], + 0}, + {"characteristic-two-field", "characteristic-two-field", + NID_X9_62_characteristic_two_field, 7, &kObjectData[2955], 0}, + {"id-ecPublicKey", "id-ecPublicKey", NID_X9_62_id_ecPublicKey, 7, + &kObjectData[2962], 0}, + {"prime192v1", "prime192v1", NID_X9_62_prime192v1, 8, &kObjectData[2969], + 0}, + {"prime192v2", "prime192v2", NID_X9_62_prime192v2, 8, &kObjectData[2977], + 0}, + {"prime192v3", "prime192v3", NID_X9_62_prime192v3, 8, &kObjectData[2985], + 0}, + {"prime239v1", "prime239v1", NID_X9_62_prime239v1, 8, &kObjectData[2993], + 0}, + {"prime239v2", "prime239v2", NID_X9_62_prime239v2, 8, &kObjectData[3001], + 0}, + {"prime239v3", "prime239v3", NID_X9_62_prime239v3, 8, &kObjectData[3009], + 0}, + {"prime256v1", "prime256v1", NID_X9_62_prime256v1, 8, &kObjectData[3017], + 0}, + {"ecdsa-with-SHA1", "ecdsa-with-SHA1", NID_ecdsa_with_SHA1, 7, + &kObjectData[3025], 0}, + {"CSPName", "Microsoft CSP Name", NID_ms_csp_name, 9, &kObjectData[3032], + 0}, + {"AES-128-ECB", "aes-128-ecb", NID_aes_128_ecb, 9, &kObjectData[3041], 0}, + {"AES-128-CBC", "aes-128-cbc", NID_aes_128_cbc, 9, &kObjectData[3050], 0}, + {"AES-128-OFB", "aes-128-ofb", NID_aes_128_ofb128, 9, &kObjectData[3059], + 0}, + {"AES-128-CFB", "aes-128-cfb", NID_aes_128_cfb128, 9, &kObjectData[3068], + 0}, + {"AES-192-ECB", "aes-192-ecb", NID_aes_192_ecb, 9, &kObjectData[3077], 0}, + {"AES-192-CBC", "aes-192-cbc", NID_aes_192_cbc, 9, &kObjectData[3086], 0}, + {"AES-192-OFB", "aes-192-ofb", NID_aes_192_ofb128, 9, &kObjectData[3095], + 0}, + {"AES-192-CFB", "aes-192-cfb", NID_aes_192_cfb128, 9, &kObjectData[3104], + 0}, + {"AES-256-ECB", "aes-256-ecb", NID_aes_256_ecb, 9, &kObjectData[3113], 0}, + {"AES-256-CBC", "aes-256-cbc", NID_aes_256_cbc, 9, &kObjectData[3122], 0}, + {"AES-256-OFB", "aes-256-ofb", NID_aes_256_ofb128, 9, &kObjectData[3131], + 0}, + {"AES-256-CFB", "aes-256-cfb", NID_aes_256_cfb128, 9, &kObjectData[3140], + 0}, + {"holdInstructionCode", "Hold Instruction Code", NID_hold_instruction_code, + 3, &kObjectData[3149], 0}, + {"holdInstructionNone", "Hold Instruction None", NID_hold_instruction_none, + 7, &kObjectData[3152], 0}, + {"holdInstructionCallIssuer", "Hold Instruction Call Issuer", + NID_hold_instruction_call_issuer, 7, &kObjectData[3159], 0}, + {"holdInstructionReject", "Hold Instruction Reject", + NID_hold_instruction_reject, 7, &kObjectData[3166], 0}, + {"data", "data", NID_data, 1, &kObjectData[3173], 0}, + {"pss", "pss", NID_pss, 3, &kObjectData[3174], 0}, + {"ucl", "ucl", NID_ucl, 7, &kObjectData[3177], 0}, + {"pilot", "pilot", NID_pilot, 8, &kObjectData[3184], 0}, + {"pilotAttributeType", "pilotAttributeType", NID_pilotAttributeType, 9, + &kObjectData[3192], 0}, + {"pilotAttributeSyntax", "pilotAttributeSyntax", NID_pilotAttributeSyntax, + 9, &kObjectData[3201], 0}, + {"pilotObjectClass", "pilotObjectClass", NID_pilotObjectClass, 9, + &kObjectData[3210], 0}, + {"pilotGroups", "pilotGroups", NID_pilotGroups, 9, &kObjectData[3219], 0}, + {"iA5StringSyntax", "iA5StringSyntax", NID_iA5StringSyntax, 10, + &kObjectData[3228], 0}, + {"caseIgnoreIA5StringSyntax", "caseIgnoreIA5StringSyntax", + NID_caseIgnoreIA5StringSyntax, 10, &kObjectData[3238], 0}, + {"pilotObject", "pilotObject", NID_pilotObject, 10, &kObjectData[3248], 0}, + {"pilotPerson", "pilotPerson", NID_pilotPerson, 10, &kObjectData[3258], 0}, + {"account", "account", NID_account, 10, &kObjectData[3268], 0}, + {"document", "document", NID_document, 10, &kObjectData[3278], 0}, + {"room", "room", NID_room, 10, &kObjectData[3288], 0}, + {"documentSeries", "documentSeries", NID_documentSeries, 10, + &kObjectData[3298], 0}, + {"rFC822localPart", "rFC822localPart", NID_rFC822localPart, 10, + &kObjectData[3308], 0}, + {"dNSDomain", "dNSDomain", NID_dNSDomain, 10, &kObjectData[3318], 0}, + {"domainRelatedObject", "domainRelatedObject", NID_domainRelatedObject, 10, + &kObjectData[3328], 0}, + {"friendlyCountry", "friendlyCountry", NID_friendlyCountry, 10, + &kObjectData[3338], 0}, + {"simpleSecurityObject", "simpleSecurityObject", NID_simpleSecurityObject, + 10, &kObjectData[3348], 0}, + {"pilotOrganization", "pilotOrganization", NID_pilotOrganization, 10, + &kObjectData[3358], 0}, + {"pilotDSA", "pilotDSA", NID_pilotDSA, 10, &kObjectData[3368], 0}, + {"qualityLabelledData", "qualityLabelledData", NID_qualityLabelledData, 10, + &kObjectData[3378], 0}, + {"UID", "userId", NID_userId, 10, &kObjectData[3388], 0}, + {"textEncodedORAddress", "textEncodedORAddress", NID_textEncodedORAddress, + 10, &kObjectData[3398], 0}, + {"mail", "rfc822Mailbox", NID_rfc822Mailbox, 10, &kObjectData[3408], 0}, + {"info", "info", NID_info, 10, &kObjectData[3418], 0}, + {"favouriteDrink", "favouriteDrink", NID_favouriteDrink, 10, + &kObjectData[3428], 0}, + {"roomNumber", "roomNumber", NID_roomNumber, 10, &kObjectData[3438], 0}, + {"photo", "photo", NID_photo, 10, &kObjectData[3448], 0}, + {"userClass", "userClass", NID_userClass, 10, &kObjectData[3458], 0}, + {"host", "host", NID_host, 10, &kObjectData[3468], 0}, + {"manager", "manager", NID_manager, 10, &kObjectData[3478], 0}, + {"documentIdentifier", "documentIdentifier", NID_documentIdentifier, 10, + &kObjectData[3488], 0}, + {"documentTitle", "documentTitle", NID_documentTitle, 10, + &kObjectData[3498], 0}, + {"documentVersion", "documentVersion", NID_documentVersion, 10, + &kObjectData[3508], 0}, + {"documentAuthor", "documentAuthor", NID_documentAuthor, 10, + &kObjectData[3518], 0}, + {"documentLocation", "documentLocation", NID_documentLocation, 10, + &kObjectData[3528], 0}, + {"homeTelephoneNumber", "homeTelephoneNumber", NID_homeTelephoneNumber, 10, + &kObjectData[3538], 0}, + {"secretary", "secretary", NID_secretary, 10, &kObjectData[3548], 0}, + {"otherMailbox", "otherMailbox", NID_otherMailbox, 10, &kObjectData[3558], + 0}, + {"lastModifiedTime", "lastModifiedTime", NID_lastModifiedTime, 10, + &kObjectData[3568], 0}, + {"lastModifiedBy", "lastModifiedBy", NID_lastModifiedBy, 10, + &kObjectData[3578], 0}, + {"aRecord", "aRecord", NID_aRecord, 10, &kObjectData[3588], 0}, + {"pilotAttributeType27", "pilotAttributeType27", NID_pilotAttributeType27, + 10, &kObjectData[3598], 0}, + {"mXRecord", "mXRecord", NID_mXRecord, 10, &kObjectData[3608], 0}, + {"nSRecord", "nSRecord", NID_nSRecord, 10, &kObjectData[3618], 0}, + {"sOARecord", "sOARecord", NID_sOARecord, 10, &kObjectData[3628], 0}, + {"cNAMERecord", "cNAMERecord", NID_cNAMERecord, 10, &kObjectData[3638], 0}, + {"associatedDomain", "associatedDomain", NID_associatedDomain, 10, + &kObjectData[3648], 0}, + {"associatedName", "associatedName", NID_associatedName, 10, + &kObjectData[3658], 0}, + {"homePostalAddress", "homePostalAddress", NID_homePostalAddress, 10, + &kObjectData[3668], 0}, + {"personalTitle", "personalTitle", NID_personalTitle, 10, + &kObjectData[3678], 0}, + {"mobileTelephoneNumber", "mobileTelephoneNumber", + NID_mobileTelephoneNumber, 10, &kObjectData[3688], 0}, + {"pagerTelephoneNumber", "pagerTelephoneNumber", NID_pagerTelephoneNumber, + 10, &kObjectData[3698], 0}, + {"friendlyCountryName", "friendlyCountryName", NID_friendlyCountryName, 10, + &kObjectData[3708], 0}, + {"organizationalStatus", "organizationalStatus", NID_organizationalStatus, + 10, &kObjectData[3718], 0}, + {"janetMailbox", "janetMailbox", NID_janetMailbox, 10, &kObjectData[3728], + 0}, + {"mailPreferenceOption", "mailPreferenceOption", NID_mailPreferenceOption, + 10, &kObjectData[3738], 0}, + {"buildingName", "buildingName", NID_buildingName, 10, &kObjectData[3748], + 0}, + {"dSAQuality", "dSAQuality", NID_dSAQuality, 10, &kObjectData[3758], 0}, + {"singleLevelQuality", "singleLevelQuality", NID_singleLevelQuality, 10, + &kObjectData[3768], 0}, + {"subtreeMinimumQuality", "subtreeMinimumQuality", + NID_subtreeMinimumQuality, 10, &kObjectData[3778], 0}, + {"subtreeMaximumQuality", "subtreeMaximumQuality", + NID_subtreeMaximumQuality, 10, &kObjectData[3788], 0}, + {"personalSignature", "personalSignature", NID_personalSignature, 10, + &kObjectData[3798], 0}, + {"dITRedirect", "dITRedirect", NID_dITRedirect, 10, &kObjectData[3808], 0}, + {"audio", "audio", NID_audio, 10, &kObjectData[3818], 0}, + {"documentPublisher", "documentPublisher", NID_documentPublisher, 10, + &kObjectData[3828], 0}, + {"x500UniqueIdentifier", "x500UniqueIdentifier", NID_x500UniqueIdentifier, + 3, &kObjectData[3838], 0}, + {"mime-mhs", "MIME MHS", NID_mime_mhs, 5, &kObjectData[3841], 0}, + {"mime-mhs-headings", "mime-mhs-headings", NID_mime_mhs_headings, 6, + &kObjectData[3846], 0}, + {"mime-mhs-bodies", "mime-mhs-bodies", NID_mime_mhs_bodies, 6, + &kObjectData[3852], 0}, + {"id-hex-partial-message", "id-hex-partial-message", + NID_id_hex_partial_message, 7, &kObjectData[3858], 0}, + {"id-hex-multipart-message", "id-hex-multipart-message", + NID_id_hex_multipart_message, 7, &kObjectData[3865], 0}, + {"generationQualifier", "generationQualifier", NID_generationQualifier, 3, + &kObjectData[3872], 0}, + {"pseudonym", "pseudonym", NID_pseudonym, 3, &kObjectData[3875], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"id-set", "Secure Electronic Transactions", NID_id_set, 2, + &kObjectData[3878], 0}, + {"set-ctype", "content types", NID_set_ctype, 3, &kObjectData[3880], 0}, + {"set-msgExt", "message extensions", NID_set_msgExt, 3, &kObjectData[3883], + 0}, + {"set-attr", "set-attr", NID_set_attr, 3, &kObjectData[3886], 0}, + {"set-policy", "set-policy", NID_set_policy, 3, &kObjectData[3889], 0}, + {"set-certExt", "certificate extensions", NID_set_certExt, 3, + &kObjectData[3892], 0}, + {"set-brand", "set-brand", NID_set_brand, 3, &kObjectData[3895], 0}, + {"setct-PANData", "setct-PANData", NID_setct_PANData, 4, &kObjectData[3898], + 0}, + {"setct-PANToken", "setct-PANToken", NID_setct_PANToken, 4, + &kObjectData[3902], 0}, + {"setct-PANOnly", "setct-PANOnly", NID_setct_PANOnly, 4, &kObjectData[3906], + 0}, + {"setct-OIData", "setct-OIData", NID_setct_OIData, 4, &kObjectData[3910], + 0}, + {"setct-PI", "setct-PI", NID_setct_PI, 4, &kObjectData[3914], 0}, + {"setct-PIData", "setct-PIData", NID_setct_PIData, 4, &kObjectData[3918], + 0}, + {"setct-PIDataUnsigned", "setct-PIDataUnsigned", NID_setct_PIDataUnsigned, + 4, &kObjectData[3922], 0}, + {"setct-HODInput", "setct-HODInput", NID_setct_HODInput, 4, + &kObjectData[3926], 0}, + {"setct-AuthResBaggage", "setct-AuthResBaggage", NID_setct_AuthResBaggage, + 4, &kObjectData[3930], 0}, + {"setct-AuthRevReqBaggage", "setct-AuthRevReqBaggage", + NID_setct_AuthRevReqBaggage, 4, &kObjectData[3934], 0}, + {"setct-AuthRevResBaggage", "setct-AuthRevResBaggage", + NID_setct_AuthRevResBaggage, 4, &kObjectData[3938], 0}, + {"setct-CapTokenSeq", "setct-CapTokenSeq", NID_setct_CapTokenSeq, 4, + &kObjectData[3942], 0}, + {"setct-PInitResData", "setct-PInitResData", NID_setct_PInitResData, 4, + &kObjectData[3946], 0}, + {"setct-PI-TBS", "setct-PI-TBS", NID_setct_PI_TBS, 4, &kObjectData[3950], + 0}, + {"setct-PResData", "setct-PResData", NID_setct_PResData, 4, + &kObjectData[3954], 0}, + {"setct-AuthReqTBS", "setct-AuthReqTBS", NID_setct_AuthReqTBS, 4, + &kObjectData[3958], 0}, + {"setct-AuthResTBS", "setct-AuthResTBS", NID_setct_AuthResTBS, 4, + &kObjectData[3962], 0}, + {"setct-AuthResTBSX", "setct-AuthResTBSX", NID_setct_AuthResTBSX, 4, + &kObjectData[3966], 0}, + {"setct-AuthTokenTBS", "setct-AuthTokenTBS", NID_setct_AuthTokenTBS, 4, + &kObjectData[3970], 0}, + {"setct-CapTokenData", "setct-CapTokenData", NID_setct_CapTokenData, 4, + &kObjectData[3974], 0}, + {"setct-CapTokenTBS", "setct-CapTokenTBS", NID_setct_CapTokenTBS, 4, + &kObjectData[3978], 0}, + {"setct-AcqCardCodeMsg", "setct-AcqCardCodeMsg", NID_setct_AcqCardCodeMsg, + 4, &kObjectData[3982], 0}, + {"setct-AuthRevReqTBS", "setct-AuthRevReqTBS", NID_setct_AuthRevReqTBS, 4, + &kObjectData[3986], 0}, + {"setct-AuthRevResData", "setct-AuthRevResData", NID_setct_AuthRevResData, + 4, &kObjectData[3990], 0}, + {"setct-AuthRevResTBS", "setct-AuthRevResTBS", NID_setct_AuthRevResTBS, 4, + &kObjectData[3994], 0}, + {"setct-CapReqTBS", "setct-CapReqTBS", NID_setct_CapReqTBS, 4, + &kObjectData[3998], 0}, + {"setct-CapReqTBSX", "setct-CapReqTBSX", NID_setct_CapReqTBSX, 4, + &kObjectData[4002], 0}, + {"setct-CapResData", "setct-CapResData", NID_setct_CapResData, 4, + &kObjectData[4006], 0}, + {"setct-CapRevReqTBS", "setct-CapRevReqTBS", NID_setct_CapRevReqTBS, 4, + &kObjectData[4010], 0}, + {"setct-CapRevReqTBSX", "setct-CapRevReqTBSX", NID_setct_CapRevReqTBSX, 4, + &kObjectData[4014], 0}, + {"setct-CapRevResData", "setct-CapRevResData", NID_setct_CapRevResData, 4, + &kObjectData[4018], 0}, + {"setct-CredReqTBS", "setct-CredReqTBS", NID_setct_CredReqTBS, 4, + &kObjectData[4022], 0}, + {"setct-CredReqTBSX", "setct-CredReqTBSX", NID_setct_CredReqTBSX, 4, + &kObjectData[4026], 0}, + {"setct-CredResData", "setct-CredResData", NID_setct_CredResData, 4, + &kObjectData[4030], 0}, + {"setct-CredRevReqTBS", "setct-CredRevReqTBS", NID_setct_CredRevReqTBS, 4, + &kObjectData[4034], 0}, + {"setct-CredRevReqTBSX", "setct-CredRevReqTBSX", NID_setct_CredRevReqTBSX, + 4, &kObjectData[4038], 0}, + {"setct-CredRevResData", "setct-CredRevResData", NID_setct_CredRevResData, + 4, &kObjectData[4042], 0}, + {"setct-PCertReqData", "setct-PCertReqData", NID_setct_PCertReqData, 4, + &kObjectData[4046], 0}, + {"setct-PCertResTBS", "setct-PCertResTBS", NID_setct_PCertResTBS, 4, + &kObjectData[4050], 0}, + {"setct-BatchAdminReqData", "setct-BatchAdminReqData", + NID_setct_BatchAdminReqData, 4, &kObjectData[4054], 0}, + {"setct-BatchAdminResData", "setct-BatchAdminResData", + NID_setct_BatchAdminResData, 4, &kObjectData[4058], 0}, + {"setct-CardCInitResTBS", "setct-CardCInitResTBS", + NID_setct_CardCInitResTBS, 4, &kObjectData[4062], 0}, + {"setct-MeAqCInitResTBS", "setct-MeAqCInitResTBS", + NID_setct_MeAqCInitResTBS, 4, &kObjectData[4066], 0}, + {"setct-RegFormResTBS", "setct-RegFormResTBS", NID_setct_RegFormResTBS, 4, + &kObjectData[4070], 0}, + {"setct-CertReqData", "setct-CertReqData", NID_setct_CertReqData, 4, + &kObjectData[4074], 0}, + {"setct-CertReqTBS", "setct-CertReqTBS", NID_setct_CertReqTBS, 4, + &kObjectData[4078], 0}, + {"setct-CertResData", "setct-CertResData", NID_setct_CertResData, 4, + &kObjectData[4082], 0}, + {"setct-CertInqReqTBS", "setct-CertInqReqTBS", NID_setct_CertInqReqTBS, 4, + &kObjectData[4086], 0}, + {"setct-ErrorTBS", "setct-ErrorTBS", NID_setct_ErrorTBS, 4, + &kObjectData[4090], 0}, + {"setct-PIDualSignedTBE", "setct-PIDualSignedTBE", + NID_setct_PIDualSignedTBE, 4, &kObjectData[4094], 0}, + {"setct-PIUnsignedTBE", "setct-PIUnsignedTBE", NID_setct_PIUnsignedTBE, 4, + &kObjectData[4098], 0}, + {"setct-AuthReqTBE", "setct-AuthReqTBE", NID_setct_AuthReqTBE, 4, + &kObjectData[4102], 0}, + {"setct-AuthResTBE", "setct-AuthResTBE", NID_setct_AuthResTBE, 4, + &kObjectData[4106], 0}, + {"setct-AuthResTBEX", "setct-AuthResTBEX", NID_setct_AuthResTBEX, 4, + &kObjectData[4110], 0}, + {"setct-AuthTokenTBE", "setct-AuthTokenTBE", NID_setct_AuthTokenTBE, 4, + &kObjectData[4114], 0}, + {"setct-CapTokenTBE", "setct-CapTokenTBE", NID_setct_CapTokenTBE, 4, + &kObjectData[4118], 0}, + {"setct-CapTokenTBEX", "setct-CapTokenTBEX", NID_setct_CapTokenTBEX, 4, + &kObjectData[4122], 0}, + {"setct-AcqCardCodeMsgTBE", "setct-AcqCardCodeMsgTBE", + NID_setct_AcqCardCodeMsgTBE, 4, &kObjectData[4126], 0}, + {"setct-AuthRevReqTBE", "setct-AuthRevReqTBE", NID_setct_AuthRevReqTBE, 4, + &kObjectData[4130], 0}, + {"setct-AuthRevResTBE", "setct-AuthRevResTBE", NID_setct_AuthRevResTBE, 4, + &kObjectData[4134], 0}, + {"setct-AuthRevResTBEB", "setct-AuthRevResTBEB", NID_setct_AuthRevResTBEB, + 4, &kObjectData[4138], 0}, + {"setct-CapReqTBE", "setct-CapReqTBE", NID_setct_CapReqTBE, 4, + &kObjectData[4142], 0}, + {"setct-CapReqTBEX", "setct-CapReqTBEX", NID_setct_CapReqTBEX, 4, + &kObjectData[4146], 0}, + {"setct-CapResTBE", "setct-CapResTBE", NID_setct_CapResTBE, 4, + &kObjectData[4150], 0}, + {"setct-CapRevReqTBE", "setct-CapRevReqTBE", NID_setct_CapRevReqTBE, 4, + &kObjectData[4154], 0}, + {"setct-CapRevReqTBEX", "setct-CapRevReqTBEX", NID_setct_CapRevReqTBEX, 4, + &kObjectData[4158], 0}, + {"setct-CapRevResTBE", "setct-CapRevResTBE", NID_setct_CapRevResTBE, 4, + &kObjectData[4162], 0}, + {"setct-CredReqTBE", "setct-CredReqTBE", NID_setct_CredReqTBE, 4, + &kObjectData[4166], 0}, + {"setct-CredReqTBEX", "setct-CredReqTBEX", NID_setct_CredReqTBEX, 4, + &kObjectData[4170], 0}, + {"setct-CredResTBE", "setct-CredResTBE", NID_setct_CredResTBE, 4, + &kObjectData[4174], 0}, + {"setct-CredRevReqTBE", "setct-CredRevReqTBE", NID_setct_CredRevReqTBE, 4, + &kObjectData[4178], 0}, + {"setct-CredRevReqTBEX", "setct-CredRevReqTBEX", NID_setct_CredRevReqTBEX, + 4, &kObjectData[4182], 0}, + {"setct-CredRevResTBE", "setct-CredRevResTBE", NID_setct_CredRevResTBE, 4, + &kObjectData[4186], 0}, + {"setct-BatchAdminReqTBE", "setct-BatchAdminReqTBE", + NID_setct_BatchAdminReqTBE, 4, &kObjectData[4190], 0}, + {"setct-BatchAdminResTBE", "setct-BatchAdminResTBE", + NID_setct_BatchAdminResTBE, 4, &kObjectData[4194], 0}, + {"setct-RegFormReqTBE", "setct-RegFormReqTBE", NID_setct_RegFormReqTBE, 4, + &kObjectData[4198], 0}, + {"setct-CertReqTBE", "setct-CertReqTBE", NID_setct_CertReqTBE, 4, + &kObjectData[4202], 0}, + {"setct-CertReqTBEX", "setct-CertReqTBEX", NID_setct_CertReqTBEX, 4, + &kObjectData[4206], 0}, + {"setct-CertResTBE", "setct-CertResTBE", NID_setct_CertResTBE, 4, + &kObjectData[4210], 0}, + {"setct-CRLNotificationTBS", "setct-CRLNotificationTBS", + NID_setct_CRLNotificationTBS, 4, &kObjectData[4214], 0}, + {"setct-CRLNotificationResTBS", "setct-CRLNotificationResTBS", + NID_setct_CRLNotificationResTBS, 4, &kObjectData[4218], 0}, + {"setct-BCIDistributionTBS", "setct-BCIDistributionTBS", + NID_setct_BCIDistributionTBS, 4, &kObjectData[4222], 0}, + {"setext-genCrypt", "generic cryptogram", NID_setext_genCrypt, 4, + &kObjectData[4226], 0}, + {"setext-miAuth", "merchant initiated auth", NID_setext_miAuth, 4, + &kObjectData[4230], 0}, + {"setext-pinSecure", "setext-pinSecure", NID_setext_pinSecure, 4, + &kObjectData[4234], 0}, + {"setext-pinAny", "setext-pinAny", NID_setext_pinAny, 4, &kObjectData[4238], + 0}, + {"setext-track2", "setext-track2", NID_setext_track2, 4, &kObjectData[4242], + 0}, + {"setext-cv", "additional verification", NID_setext_cv, 4, + &kObjectData[4246], 0}, + {"set-policy-root", "set-policy-root", NID_set_policy_root, 4, + &kObjectData[4250], 0}, + {"setCext-hashedRoot", "setCext-hashedRoot", NID_setCext_hashedRoot, 4, + &kObjectData[4254], 0}, + {"setCext-certType", "setCext-certType", NID_setCext_certType, 4, + &kObjectData[4258], 0}, + {"setCext-merchData", "setCext-merchData", NID_setCext_merchData, 4, + &kObjectData[4262], 0}, + {"setCext-cCertRequired", "setCext-cCertRequired", + NID_setCext_cCertRequired, 4, &kObjectData[4266], 0}, + {"setCext-tunneling", "setCext-tunneling", NID_setCext_tunneling, 4, + &kObjectData[4270], 0}, + {"setCext-setExt", "setCext-setExt", NID_setCext_setExt, 4, + &kObjectData[4274], 0}, + {"setCext-setQualf", "setCext-setQualf", NID_setCext_setQualf, 4, + &kObjectData[4278], 0}, + {"setCext-PGWYcapabilities", "setCext-PGWYcapabilities", + NID_setCext_PGWYcapabilities, 4, &kObjectData[4282], 0}, + {"setCext-TokenIdentifier", "setCext-TokenIdentifier", + NID_setCext_TokenIdentifier, 4, &kObjectData[4286], 0}, + {"setCext-Track2Data", "setCext-Track2Data", NID_setCext_Track2Data, 4, + &kObjectData[4290], 0}, + {"setCext-TokenType", "setCext-TokenType", NID_setCext_TokenType, 4, + &kObjectData[4294], 0}, + {"setCext-IssuerCapabilities", "setCext-IssuerCapabilities", + NID_setCext_IssuerCapabilities, 4, &kObjectData[4298], 0}, + {"setAttr-Cert", "setAttr-Cert", NID_setAttr_Cert, 4, &kObjectData[4302], + 0}, + {"setAttr-PGWYcap", "payment gateway capabilities", NID_setAttr_PGWYcap, 4, + &kObjectData[4306], 0}, + {"setAttr-TokenType", "setAttr-TokenType", NID_setAttr_TokenType, 4, + &kObjectData[4310], 0}, + {"setAttr-IssCap", "issuer capabilities", NID_setAttr_IssCap, 4, + &kObjectData[4314], 0}, + {"set-rootKeyThumb", "set-rootKeyThumb", NID_set_rootKeyThumb, 5, + &kObjectData[4318], 0}, + {"set-addPolicy", "set-addPolicy", NID_set_addPolicy, 5, &kObjectData[4323], + 0}, + {"setAttr-Token-EMV", "setAttr-Token-EMV", NID_setAttr_Token_EMV, 5, + &kObjectData[4328], 0}, + {"setAttr-Token-B0Prime", "setAttr-Token-B0Prime", + NID_setAttr_Token_B0Prime, 5, &kObjectData[4333], 0}, + {"setAttr-IssCap-CVM", "setAttr-IssCap-CVM", NID_setAttr_IssCap_CVM, 5, + &kObjectData[4338], 0}, + {"setAttr-IssCap-T2", "setAttr-IssCap-T2", NID_setAttr_IssCap_T2, 5, + &kObjectData[4343], 0}, + {"setAttr-IssCap-Sig", "setAttr-IssCap-Sig", NID_setAttr_IssCap_Sig, 5, + &kObjectData[4348], 0}, + {"setAttr-GenCryptgrm", "generate cryptogram", NID_setAttr_GenCryptgrm, 6, + &kObjectData[4353], 0}, + {"setAttr-T2Enc", "encrypted track 2", NID_setAttr_T2Enc, 6, + &kObjectData[4359], 0}, + {"setAttr-T2cleartxt", "cleartext track 2", NID_setAttr_T2cleartxt, 6, + &kObjectData[4365], 0}, + {"setAttr-TokICCsig", "ICC or token signature", NID_setAttr_TokICCsig, 6, + &kObjectData[4371], 0}, + {"setAttr-SecDevSig", "secure device signature", NID_setAttr_SecDevSig, 6, + &kObjectData[4377], 0}, + {"set-brand-IATA-ATA", "set-brand-IATA-ATA", NID_set_brand_IATA_ATA, 4, + &kObjectData[4383], 0}, + {"set-brand-Diners", "set-brand-Diners", NID_set_brand_Diners, 4, + &kObjectData[4387], 0}, + {"set-brand-AmericanExpress", "set-brand-AmericanExpress", + NID_set_brand_AmericanExpress, 4, &kObjectData[4391], 0}, + {"set-brand-JCB", "set-brand-JCB", NID_set_brand_JCB, 4, &kObjectData[4395], + 0}, + {"set-brand-Visa", "set-brand-Visa", NID_set_brand_Visa, 4, + &kObjectData[4399], 0}, + {"set-brand-MasterCard", "set-brand-MasterCard", NID_set_brand_MasterCard, + 4, &kObjectData[4403], 0}, + {"set-brand-Novus", "set-brand-Novus", NID_set_brand_Novus, 5, + &kObjectData[4407], 0}, + {"DES-CDMF", "des-cdmf", NID_des_cdmf, 8, &kObjectData[4412], 0}, + {"rsaOAEPEncryptionSET", "rsaOAEPEncryptionSET", NID_rsaOAEPEncryptionSET, + 9, &kObjectData[4420], 0}, + {"ITU-T", "itu-t", NID_itu_t, 0, NULL, 0}, + {"JOINT-ISO-ITU-T", "joint-iso-itu-t", NID_joint_iso_itu_t, 0, NULL, 0}, + {"international-organizations", "International Organizations", + NID_international_organizations, 1, &kObjectData[4429], 0}, + {"msSmartcardLogin", "Microsoft Smartcardlogin", NID_ms_smartcard_login, 10, + &kObjectData[4430], 0}, + {"msUPN", "Microsoft Universal Principal Name", NID_ms_upn, 10, + &kObjectData[4440], 0}, + {"AES-128-CFB1", "aes-128-cfb1", NID_aes_128_cfb1, 0, NULL, 0}, + {"AES-192-CFB1", "aes-192-cfb1", NID_aes_192_cfb1, 0, NULL, 0}, + {"AES-256-CFB1", "aes-256-cfb1", NID_aes_256_cfb1, 0, NULL, 0}, + {"AES-128-CFB8", "aes-128-cfb8", NID_aes_128_cfb8, 0, NULL, 0}, + {"AES-192-CFB8", "aes-192-cfb8", NID_aes_192_cfb8, 0, NULL, 0}, + {"AES-256-CFB8", "aes-256-cfb8", NID_aes_256_cfb8, 0, NULL, 0}, + {"DES-CFB1", "des-cfb1", NID_des_cfb1, 0, NULL, 0}, + {"DES-CFB8", "des-cfb8", NID_des_cfb8, 0, NULL, 0}, + {"DES-EDE3-CFB1", "des-ede3-cfb1", NID_des_ede3_cfb1, 0, NULL, 0}, + {"DES-EDE3-CFB8", "des-ede3-cfb8", NID_des_ede3_cfb8, 0, NULL, 0}, + {"street", "streetAddress", NID_streetAddress, 3, &kObjectData[4450], 0}, + {"postalCode", "postalCode", NID_postalCode, 3, &kObjectData[4453], 0}, + {"id-ppl", "id-ppl", NID_id_ppl, 7, &kObjectData[4456], 0}, + {"proxyCertInfo", "Proxy Certificate Information", NID_proxyCertInfo, 8, + &kObjectData[4463], 0}, + {"id-ppl-anyLanguage", "Any language", NID_id_ppl_anyLanguage, 8, + &kObjectData[4471], 0}, + {"id-ppl-inheritAll", "Inherit all", NID_id_ppl_inheritAll, 8, + &kObjectData[4479], 0}, + {"nameConstraints", "X509v3 Name Constraints", NID_name_constraints, 3, + &kObjectData[4487], 0}, + {"id-ppl-independent", "Independent", NID_Independent, 8, + &kObjectData[4490], 0}, + {"RSA-SHA256", "sha256WithRSAEncryption", NID_sha256WithRSAEncryption, 9, + &kObjectData[4498], 0}, + {"RSA-SHA384", "sha384WithRSAEncryption", NID_sha384WithRSAEncryption, 9, + &kObjectData[4507], 0}, + {"RSA-SHA512", "sha512WithRSAEncryption", NID_sha512WithRSAEncryption, 9, + &kObjectData[4516], 0}, + {"RSA-SHA224", "sha224WithRSAEncryption", NID_sha224WithRSAEncryption, 9, + &kObjectData[4525], 0}, + {"SHA256", "sha256", NID_sha256, 9, &kObjectData[4534], 0}, + {"SHA384", "sha384", NID_sha384, 9, &kObjectData[4543], 0}, + {"SHA512", "sha512", NID_sha512, 9, &kObjectData[4552], 0}, + {"SHA224", "sha224", NID_sha224, 9, &kObjectData[4561], 0}, + {"identified-organization", "identified-organization", + NID_identified_organization, 1, &kObjectData[4570], 0}, + {"certicom-arc", "certicom-arc", NID_certicom_arc, 3, &kObjectData[4571], + 0}, + {"wap", "wap", NID_wap, 2, &kObjectData[4574], 0}, + {"wap-wsg", "wap-wsg", NID_wap_wsg, 3, &kObjectData[4576], 0}, + {"id-characteristic-two-basis", "id-characteristic-two-basis", + NID_X9_62_id_characteristic_two_basis, 8, &kObjectData[4579], 0}, + {"onBasis", "onBasis", NID_X9_62_onBasis, 9, &kObjectData[4587], 0}, + {"tpBasis", "tpBasis", NID_X9_62_tpBasis, 9, &kObjectData[4596], 0}, + {"ppBasis", "ppBasis", NID_X9_62_ppBasis, 9, &kObjectData[4605], 0}, + {"c2pnb163v1", "c2pnb163v1", NID_X9_62_c2pnb163v1, 8, &kObjectData[4614], + 0}, + {"c2pnb163v2", "c2pnb163v2", NID_X9_62_c2pnb163v2, 8, &kObjectData[4622], + 0}, + {"c2pnb163v3", "c2pnb163v3", NID_X9_62_c2pnb163v3, 8, &kObjectData[4630], + 0}, + {"c2pnb176v1", "c2pnb176v1", NID_X9_62_c2pnb176v1, 8, &kObjectData[4638], + 0}, + {"c2tnb191v1", "c2tnb191v1", NID_X9_62_c2tnb191v1, 8, &kObjectData[4646], + 0}, + {"c2tnb191v2", "c2tnb191v2", NID_X9_62_c2tnb191v2, 8, &kObjectData[4654], + 0}, + {"c2tnb191v3", "c2tnb191v3", NID_X9_62_c2tnb191v3, 8, &kObjectData[4662], + 0}, + {"c2onb191v4", "c2onb191v4", NID_X9_62_c2onb191v4, 8, &kObjectData[4670], + 0}, + {"c2onb191v5", "c2onb191v5", NID_X9_62_c2onb191v5, 8, &kObjectData[4678], + 0}, + {"c2pnb208w1", "c2pnb208w1", NID_X9_62_c2pnb208w1, 8, &kObjectData[4686], + 0}, + {"c2tnb239v1", "c2tnb239v1", NID_X9_62_c2tnb239v1, 8, &kObjectData[4694], + 0}, + {"c2tnb239v2", "c2tnb239v2", NID_X9_62_c2tnb239v2, 8, &kObjectData[4702], + 0}, + {"c2tnb239v3", "c2tnb239v3", NID_X9_62_c2tnb239v3, 8, &kObjectData[4710], + 0}, + {"c2onb239v4", "c2onb239v4", NID_X9_62_c2onb239v4, 8, &kObjectData[4718], + 0}, + {"c2onb239v5", "c2onb239v5", NID_X9_62_c2onb239v5, 8, &kObjectData[4726], + 0}, + {"c2pnb272w1", "c2pnb272w1", NID_X9_62_c2pnb272w1, 8, &kObjectData[4734], + 0}, + {"c2pnb304w1", "c2pnb304w1", NID_X9_62_c2pnb304w1, 8, &kObjectData[4742], + 0}, + {"c2tnb359v1", "c2tnb359v1", NID_X9_62_c2tnb359v1, 8, &kObjectData[4750], + 0}, + {"c2pnb368w1", "c2pnb368w1", NID_X9_62_c2pnb368w1, 8, &kObjectData[4758], + 0}, + {"c2tnb431r1", "c2tnb431r1", NID_X9_62_c2tnb431r1, 8, &kObjectData[4766], + 0}, + {"secp112r1", "secp112r1", NID_secp112r1, 5, &kObjectData[4774], 0}, + {"secp112r2", "secp112r2", NID_secp112r2, 5, &kObjectData[4779], 0}, + {"secp128r1", "secp128r1", NID_secp128r1, 5, &kObjectData[4784], 0}, + {"secp128r2", "secp128r2", NID_secp128r2, 5, &kObjectData[4789], 0}, + {"secp160k1", "secp160k1", NID_secp160k1, 5, &kObjectData[4794], 0}, + {"secp160r1", "secp160r1", NID_secp160r1, 5, &kObjectData[4799], 0}, + {"secp160r2", "secp160r2", NID_secp160r2, 5, &kObjectData[4804], 0}, + {"secp192k1", "secp192k1", NID_secp192k1, 5, &kObjectData[4809], 0}, + {"secp224k1", "secp224k1", NID_secp224k1, 5, &kObjectData[4814], 0}, + {"secp224r1", "secp224r1", NID_secp224r1, 5, &kObjectData[4819], 0}, + {"secp256k1", "secp256k1", NID_secp256k1, 5, &kObjectData[4824], 0}, + {"secp384r1", "secp384r1", NID_secp384r1, 5, &kObjectData[4829], 0}, + {"secp521r1", "secp521r1", NID_secp521r1, 5, &kObjectData[4834], 0}, + {"sect113r1", "sect113r1", NID_sect113r1, 5, &kObjectData[4839], 0}, + {"sect113r2", "sect113r2", NID_sect113r2, 5, &kObjectData[4844], 0}, + {"sect131r1", "sect131r1", NID_sect131r1, 5, &kObjectData[4849], 0}, + {"sect131r2", "sect131r2", NID_sect131r2, 5, &kObjectData[4854], 0}, + {"sect163k1", "sect163k1", NID_sect163k1, 5, &kObjectData[4859], 0}, + {"sect163r1", "sect163r1", NID_sect163r1, 5, &kObjectData[4864], 0}, + {"sect163r2", "sect163r2", NID_sect163r2, 5, &kObjectData[4869], 0}, + {"sect193r1", "sect193r1", NID_sect193r1, 5, &kObjectData[4874], 0}, + {"sect193r2", "sect193r2", NID_sect193r2, 5, &kObjectData[4879], 0}, + {"sect233k1", "sect233k1", NID_sect233k1, 5, &kObjectData[4884], 0}, + {"sect233r1", "sect233r1", NID_sect233r1, 5, &kObjectData[4889], 0}, + {"sect239k1", "sect239k1", NID_sect239k1, 5, &kObjectData[4894], 0}, + {"sect283k1", "sect283k1", NID_sect283k1, 5, &kObjectData[4899], 0}, + {"sect283r1", "sect283r1", NID_sect283r1, 5, &kObjectData[4904], 0}, + {"sect409k1", "sect409k1", NID_sect409k1, 5, &kObjectData[4909], 0}, + {"sect409r1", "sect409r1", NID_sect409r1, 5, &kObjectData[4914], 0}, + {"sect571k1", "sect571k1", NID_sect571k1, 5, &kObjectData[4919], 0}, + {"sect571r1", "sect571r1", NID_sect571r1, 5, &kObjectData[4924], 0}, + {"wap-wsg-idm-ecid-wtls1", "wap-wsg-idm-ecid-wtls1", + NID_wap_wsg_idm_ecid_wtls1, 5, &kObjectData[4929], 0}, + {"wap-wsg-idm-ecid-wtls3", "wap-wsg-idm-ecid-wtls3", + NID_wap_wsg_idm_ecid_wtls3, 5, &kObjectData[4934], 0}, + {"wap-wsg-idm-ecid-wtls4", "wap-wsg-idm-ecid-wtls4", + NID_wap_wsg_idm_ecid_wtls4, 5, &kObjectData[4939], 0}, + {"wap-wsg-idm-ecid-wtls5", "wap-wsg-idm-ecid-wtls5", + NID_wap_wsg_idm_ecid_wtls5, 5, &kObjectData[4944], 0}, + {"wap-wsg-idm-ecid-wtls6", "wap-wsg-idm-ecid-wtls6", + NID_wap_wsg_idm_ecid_wtls6, 5, &kObjectData[4949], 0}, + {"wap-wsg-idm-ecid-wtls7", "wap-wsg-idm-ecid-wtls7", + NID_wap_wsg_idm_ecid_wtls7, 5, &kObjectData[4954], 0}, + {"wap-wsg-idm-ecid-wtls8", "wap-wsg-idm-ecid-wtls8", + NID_wap_wsg_idm_ecid_wtls8, 5, &kObjectData[4959], 0}, + {"wap-wsg-idm-ecid-wtls9", "wap-wsg-idm-ecid-wtls9", + NID_wap_wsg_idm_ecid_wtls9, 5, &kObjectData[4964], 0}, + {"wap-wsg-idm-ecid-wtls10", "wap-wsg-idm-ecid-wtls10", + NID_wap_wsg_idm_ecid_wtls10, 5, &kObjectData[4969], 0}, + {"wap-wsg-idm-ecid-wtls11", "wap-wsg-idm-ecid-wtls11", + NID_wap_wsg_idm_ecid_wtls11, 5, &kObjectData[4974], 0}, + {"wap-wsg-idm-ecid-wtls12", "wap-wsg-idm-ecid-wtls12", + NID_wap_wsg_idm_ecid_wtls12, 5, &kObjectData[4979], 0}, + {"anyPolicy", "X509v3 Any Policy", NID_any_policy, 4, &kObjectData[4984], + 0}, + {"policyMappings", "X509v3 Policy Mappings", NID_policy_mappings, 3, + &kObjectData[4988], 0}, + {"inhibitAnyPolicy", "X509v3 Inhibit Any Policy", NID_inhibit_any_policy, 3, + &kObjectData[4991], 0}, + {"Oakley-EC2N-3", "ipsec3", NID_ipsec3, 0, NULL, 0}, + {"Oakley-EC2N-4", "ipsec4", NID_ipsec4, 0, NULL, 0}, + {"CAMELLIA-128-CBC", "camellia-128-cbc", NID_camellia_128_cbc, 11, + &kObjectData[4994], 0}, + {"CAMELLIA-192-CBC", "camellia-192-cbc", NID_camellia_192_cbc, 11, + &kObjectData[5005], 0}, + {"CAMELLIA-256-CBC", "camellia-256-cbc", NID_camellia_256_cbc, 11, + &kObjectData[5016], 0}, + {"CAMELLIA-128-ECB", "camellia-128-ecb", NID_camellia_128_ecb, 8, + &kObjectData[5027], 0}, + {"CAMELLIA-192-ECB", "camellia-192-ecb", NID_camellia_192_ecb, 8, + &kObjectData[5035], 0}, + {"CAMELLIA-256-ECB", "camellia-256-ecb", NID_camellia_256_ecb, 8, + &kObjectData[5043], 0}, + {"CAMELLIA-128-CFB", "camellia-128-cfb", NID_camellia_128_cfb128, 8, + &kObjectData[5051], 0}, + {"CAMELLIA-192-CFB", "camellia-192-cfb", NID_camellia_192_cfb128, 8, + &kObjectData[5059], 0}, + {"CAMELLIA-256-CFB", "camellia-256-cfb", NID_camellia_256_cfb128, 8, + &kObjectData[5067], 0}, + {"CAMELLIA-128-CFB1", "camellia-128-cfb1", NID_camellia_128_cfb1, 0, NULL, + 0}, + {"CAMELLIA-192-CFB1", "camellia-192-cfb1", NID_camellia_192_cfb1, 0, NULL, + 0}, + {"CAMELLIA-256-CFB1", "camellia-256-cfb1", NID_camellia_256_cfb1, 0, NULL, + 0}, + {"CAMELLIA-128-CFB8", "camellia-128-cfb8", NID_camellia_128_cfb8, 0, NULL, + 0}, + {"CAMELLIA-192-CFB8", "camellia-192-cfb8", NID_camellia_192_cfb8, 0, NULL, + 0}, + {"CAMELLIA-256-CFB8", "camellia-256-cfb8", NID_camellia_256_cfb8, 0, NULL, + 0}, + {"CAMELLIA-128-OFB", "camellia-128-ofb", NID_camellia_128_ofb128, 8, + &kObjectData[5075], 0}, + {"CAMELLIA-192-OFB", "camellia-192-ofb", NID_camellia_192_ofb128, 8, + &kObjectData[5083], 0}, + {"CAMELLIA-256-OFB", "camellia-256-ofb", NID_camellia_256_ofb128, 8, + &kObjectData[5091], 0}, + {"subjectDirectoryAttributes", "X509v3 Subject Directory Attributes", + NID_subject_directory_attributes, 3, &kObjectData[5099], 0}, + {"issuingDistributionPoint", "X509v3 Issuing Distribution Point", + NID_issuing_distribution_point, 3, &kObjectData[5102], 0}, + {"certificateIssuer", "X509v3 Certificate Issuer", NID_certificate_issuer, + 3, &kObjectData[5105], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"KISA", "kisa", NID_kisa, 6, &kObjectData[5108], 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {NULL, NULL, NID_undef, 0, NULL, 0}, + {"SEED-ECB", "seed-ecb", NID_seed_ecb, 8, &kObjectData[5114], 0}, + {"SEED-CBC", "seed-cbc", NID_seed_cbc, 8, &kObjectData[5122], 0}, + {"SEED-OFB", "seed-ofb", NID_seed_ofb128, 8, &kObjectData[5130], 0}, + {"SEED-CFB", "seed-cfb", NID_seed_cfb128, 8, &kObjectData[5138], 0}, + {"HMAC-MD5", "hmac-md5", NID_hmac_md5, 8, &kObjectData[5146], 0}, + {"HMAC-SHA1", "hmac-sha1", NID_hmac_sha1, 8, &kObjectData[5154], 0}, + {"id-PasswordBasedMAC", "password based MAC", NID_id_PasswordBasedMAC, 9, + &kObjectData[5162], 0}, + {"id-DHBasedMac", "Diffie-Hellman based MAC", NID_id_DHBasedMac, 9, + &kObjectData[5171], 0}, + {"id-it-suppLangTags", "id-it-suppLangTags", NID_id_it_suppLangTags, 8, + &kObjectData[5180], 0}, + {"caRepository", "CA Repository", NID_caRepository, 8, &kObjectData[5188], + 0}, + {"id-smime-ct-compressedData", "id-smime-ct-compressedData", + NID_id_smime_ct_compressedData, 11, &kObjectData[5196], 0}, + {"id-ct-asciiTextWithCRLF", "id-ct-asciiTextWithCRLF", + NID_id_ct_asciiTextWithCRLF, 11, &kObjectData[5207], 0}, + {"id-aes128-wrap", "id-aes128-wrap", NID_id_aes128_wrap, 9, + &kObjectData[5218], 0}, + {"id-aes192-wrap", "id-aes192-wrap", NID_id_aes192_wrap, 9, + &kObjectData[5227], 0}, + {"id-aes256-wrap", "id-aes256-wrap", NID_id_aes256_wrap, 9, + &kObjectData[5236], 0}, + {"ecdsa-with-Recommended", "ecdsa-with-Recommended", + NID_ecdsa_with_Recommended, 7, &kObjectData[5245], 0}, + {"ecdsa-with-Specified", "ecdsa-with-Specified", NID_ecdsa_with_Specified, + 7, &kObjectData[5252], 0}, + {"ecdsa-with-SHA224", "ecdsa-with-SHA224", NID_ecdsa_with_SHA224, 8, + &kObjectData[5259], 0}, + {"ecdsa-with-SHA256", "ecdsa-with-SHA256", NID_ecdsa_with_SHA256, 8, + &kObjectData[5267], 0}, + {"ecdsa-with-SHA384", "ecdsa-with-SHA384", NID_ecdsa_with_SHA384, 8, + &kObjectData[5275], 0}, + {"ecdsa-with-SHA512", "ecdsa-with-SHA512", NID_ecdsa_with_SHA512, 8, + &kObjectData[5283], 0}, + {"hmacWithMD5", "hmacWithMD5", NID_hmacWithMD5, 8, &kObjectData[5291], 0}, + {"hmacWithSHA224", "hmacWithSHA224", NID_hmacWithSHA224, 8, + &kObjectData[5299], 0}, + {"hmacWithSHA256", "hmacWithSHA256", NID_hmacWithSHA256, 8, + &kObjectData[5307], 0}, + {"hmacWithSHA384", "hmacWithSHA384", NID_hmacWithSHA384, 8, + &kObjectData[5315], 0}, + {"hmacWithSHA512", "hmacWithSHA512", NID_hmacWithSHA512, 8, + &kObjectData[5323], 0}, + {"dsa_with_SHA224", "dsa_with_SHA224", NID_dsa_with_SHA224, 9, + &kObjectData[5331], 0}, + {"dsa_with_SHA256", "dsa_with_SHA256", NID_dsa_with_SHA256, 9, + &kObjectData[5340], 0}, + {"whirlpool", "whirlpool", NID_whirlpool, 6, &kObjectData[5349], 0}, + {"cryptopro", "cryptopro", NID_cryptopro, 5, &kObjectData[5355], 0}, + {"cryptocom", "cryptocom", NID_cryptocom, 5, &kObjectData[5360], 0}, + {"id-GostR3411-94-with-GostR3410-2001", + "GOST R 34.11-94 with GOST R 34.10-2001", + NID_id_GostR3411_94_with_GostR3410_2001, 6, &kObjectData[5365], 0}, + {"id-GostR3411-94-with-GostR3410-94", + "GOST R 34.11-94 with GOST R 34.10-94", + NID_id_GostR3411_94_with_GostR3410_94, 6, &kObjectData[5371], 0}, + {"md_gost94", "GOST R 34.11-94", NID_id_GostR3411_94, 6, &kObjectData[5377], + 0}, + {"id-HMACGostR3411-94", "HMAC GOST 34.11-94", NID_id_HMACGostR3411_94, 6, + &kObjectData[5383], 0}, + {"gost2001", "GOST R 34.10-2001", NID_id_GostR3410_2001, 6, + &kObjectData[5389], 0}, + {"gost94", "GOST R 34.10-94", NID_id_GostR3410_94, 6, &kObjectData[5395], + 0}, + {"gost89", "GOST 28147-89", NID_id_Gost28147_89, 6, &kObjectData[5401], 0}, + {"gost89-cnt", "gost89-cnt", NID_gost89_cnt, 0, NULL, 0}, + {"gost-mac", "GOST 28147-89 MAC", NID_id_Gost28147_89_MAC, 6, + &kObjectData[5407], 0}, + {"prf-gostr3411-94", "GOST R 34.11-94 PRF", NID_id_GostR3411_94_prf, 6, + &kObjectData[5413], 0}, + {"id-GostR3410-2001DH", "GOST R 34.10-2001 DH", NID_id_GostR3410_2001DH, 6, + &kObjectData[5419], 0}, + {"id-GostR3410-94DH", "GOST R 34.10-94 DH", NID_id_GostR3410_94DH, 6, + &kObjectData[5425], 0}, + {"id-Gost28147-89-CryptoPro-KeyMeshing", + "id-Gost28147-89-CryptoPro-KeyMeshing", + NID_id_Gost28147_89_CryptoPro_KeyMeshing, 7, &kObjectData[5431], 0}, + {"id-Gost28147-89-None-KeyMeshing", "id-Gost28147-89-None-KeyMeshing", + NID_id_Gost28147_89_None_KeyMeshing, 7, &kObjectData[5438], 0}, + {"id-GostR3411-94-TestParamSet", "id-GostR3411-94-TestParamSet", + NID_id_GostR3411_94_TestParamSet, 7, &kObjectData[5445], 0}, + {"id-GostR3411-94-CryptoProParamSet", "id-GostR3411-94-CryptoProParamSet", + NID_id_GostR3411_94_CryptoProParamSet, 7, &kObjectData[5452], 0}, + {"id-Gost28147-89-TestParamSet", "id-Gost28147-89-TestParamSet", + NID_id_Gost28147_89_TestParamSet, 7, &kObjectData[5459], 0}, + {"id-Gost28147-89-CryptoPro-A-ParamSet", + "id-Gost28147-89-CryptoPro-A-ParamSet", + NID_id_Gost28147_89_CryptoPro_A_ParamSet, 7, &kObjectData[5466], 0}, + {"id-Gost28147-89-CryptoPro-B-ParamSet", + "id-Gost28147-89-CryptoPro-B-ParamSet", + NID_id_Gost28147_89_CryptoPro_B_ParamSet, 7, &kObjectData[5473], 0}, + {"id-Gost28147-89-CryptoPro-C-ParamSet", + "id-Gost28147-89-CryptoPro-C-ParamSet", + NID_id_Gost28147_89_CryptoPro_C_ParamSet, 7, &kObjectData[5480], 0}, + {"id-Gost28147-89-CryptoPro-D-ParamSet", + "id-Gost28147-89-CryptoPro-D-ParamSet", + NID_id_Gost28147_89_CryptoPro_D_ParamSet, 7, &kObjectData[5487], 0}, + {"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", + "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", + NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet, 7, &kObjectData[5494], + 0}, + {"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", + "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", + NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet, 7, &kObjectData[5501], + 0}, + {"id-Gost28147-89-CryptoPro-RIC-1-ParamSet", + "id-Gost28147-89-CryptoPro-RIC-1-ParamSet", + NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet, 7, &kObjectData[5508], 0}, + {"id-GostR3410-94-TestParamSet", "id-GostR3410-94-TestParamSet", + NID_id_GostR3410_94_TestParamSet, 7, &kObjectData[5515], 0}, + {"id-GostR3410-94-CryptoPro-A-ParamSet", + "id-GostR3410-94-CryptoPro-A-ParamSet", + NID_id_GostR3410_94_CryptoPro_A_ParamSet, 7, &kObjectData[5522], 0}, + {"id-GostR3410-94-CryptoPro-B-ParamSet", + "id-GostR3410-94-CryptoPro-B-ParamSet", + NID_id_GostR3410_94_CryptoPro_B_ParamSet, 7, &kObjectData[5529], 0}, + {"id-GostR3410-94-CryptoPro-C-ParamSet", + "id-GostR3410-94-CryptoPro-C-ParamSet", + NID_id_GostR3410_94_CryptoPro_C_ParamSet, 7, &kObjectData[5536], 0}, + {"id-GostR3410-94-CryptoPro-D-ParamSet", + "id-GostR3410-94-CryptoPro-D-ParamSet", + NID_id_GostR3410_94_CryptoPro_D_ParamSet, 7, &kObjectData[5543], 0}, + {"id-GostR3410-94-CryptoPro-XchA-ParamSet", + "id-GostR3410-94-CryptoPro-XchA-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchA_ParamSet, 7, &kObjectData[5550], 0}, + {"id-GostR3410-94-CryptoPro-XchB-ParamSet", + "id-GostR3410-94-CryptoPro-XchB-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchB_ParamSet, 7, &kObjectData[5557], 0}, + {"id-GostR3410-94-CryptoPro-XchC-ParamSet", + "id-GostR3410-94-CryptoPro-XchC-ParamSet", + NID_id_GostR3410_94_CryptoPro_XchC_ParamSet, 7, &kObjectData[5564], 0}, + {"id-GostR3410-2001-TestParamSet", "id-GostR3410-2001-TestParamSet", + NID_id_GostR3410_2001_TestParamSet, 7, &kObjectData[5571], 0}, + {"id-GostR3410-2001-CryptoPro-A-ParamSet", + "id-GostR3410-2001-CryptoPro-A-ParamSet", + NID_id_GostR3410_2001_CryptoPro_A_ParamSet, 7, &kObjectData[5578], 0}, + {"id-GostR3410-2001-CryptoPro-B-ParamSet", + "id-GostR3410-2001-CryptoPro-B-ParamSet", + NID_id_GostR3410_2001_CryptoPro_B_ParamSet, 7, &kObjectData[5585], 0}, + {"id-GostR3410-2001-CryptoPro-C-ParamSet", + "id-GostR3410-2001-CryptoPro-C-ParamSet", + NID_id_GostR3410_2001_CryptoPro_C_ParamSet, 7, &kObjectData[5592], 0}, + {"id-GostR3410-2001-CryptoPro-XchA-ParamSet", + "id-GostR3410-2001-CryptoPro-XchA-ParamSet", + NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet, 7, &kObjectData[5599], 0}, + {"id-GostR3410-2001-CryptoPro-XchB-ParamSet", + "id-GostR3410-2001-CryptoPro-XchB-ParamSet", + NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet, 7, &kObjectData[5606], 0}, + {"id-GostR3410-94-a", "id-GostR3410-94-a", NID_id_GostR3410_94_a, 7, + &kObjectData[5613], 0}, + {"id-GostR3410-94-aBis", "id-GostR3410-94-aBis", NID_id_GostR3410_94_aBis, + 7, &kObjectData[5620], 0}, + {"id-GostR3410-94-b", "id-GostR3410-94-b", NID_id_GostR3410_94_b, 7, + &kObjectData[5627], 0}, + {"id-GostR3410-94-bBis", "id-GostR3410-94-bBis", NID_id_GostR3410_94_bBis, + 7, &kObjectData[5634], 0}, + {"id-Gost28147-89-cc", "GOST 28147-89 Cryptocom ParamSet", + NID_id_Gost28147_89_cc, 8, &kObjectData[5641], 0}, + {"gost94cc", "GOST 34.10-94 Cryptocom", NID_id_GostR3410_94_cc, 8, + &kObjectData[5649], 0}, + {"gost2001cc", "GOST 34.10-2001 Cryptocom", NID_id_GostR3410_2001_cc, 8, + &kObjectData[5657], 0}, + {"id-GostR3411-94-with-GostR3410-94-cc", + "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom", + NID_id_GostR3411_94_with_GostR3410_94_cc, 8, &kObjectData[5665], 0}, + {"id-GostR3411-94-with-GostR3410-2001-cc", + "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom", + NID_id_GostR3411_94_with_GostR3410_2001_cc, 8, &kObjectData[5673], 0}, + {"id-GostR3410-2001-ParamSet-cc", + "GOST R 3410-2001 Parameter Set Cryptocom", + NID_id_GostR3410_2001_ParamSet_cc, 8, &kObjectData[5681], 0}, + {"HMAC", "hmac", NID_hmac, 0, NULL, 0}, + {"LocalKeySet", "Microsoft Local Key set", NID_LocalKeySet, 9, + &kObjectData[5689], 0}, + {"freshestCRL", "X509v3 Freshest CRL", NID_freshest_crl, 3, + &kObjectData[5698], 0}, + {"id-on-permanentIdentifier", "Permanent Identifier", + NID_id_on_permanentIdentifier, 8, &kObjectData[5701], 0}, + {"searchGuide", "searchGuide", NID_searchGuide, 3, &kObjectData[5709], 0}, + {"businessCategory", "businessCategory", NID_businessCategory, 3, + &kObjectData[5712], 0}, + {"postalAddress", "postalAddress", NID_postalAddress, 3, &kObjectData[5715], + 0}, + {"postOfficeBox", "postOfficeBox", NID_postOfficeBox, 3, &kObjectData[5718], + 0}, + {"physicalDeliveryOfficeName", "physicalDeliveryOfficeName", + NID_physicalDeliveryOfficeName, 3, &kObjectData[5721], 0}, + {"telephoneNumber", "telephoneNumber", NID_telephoneNumber, 3, + &kObjectData[5724], 0}, + {"telexNumber", "telexNumber", NID_telexNumber, 3, &kObjectData[5727], 0}, + {"teletexTerminalIdentifier", "teletexTerminalIdentifier", + NID_teletexTerminalIdentifier, 3, &kObjectData[5730], 0}, + {"facsimileTelephoneNumber", "facsimileTelephoneNumber", + NID_facsimileTelephoneNumber, 3, &kObjectData[5733], 0}, + {"x121Address", "x121Address", NID_x121Address, 3, &kObjectData[5736], 0}, + {"internationaliSDNNumber", "internationaliSDNNumber", + NID_internationaliSDNNumber, 3, &kObjectData[5739], 0}, + {"registeredAddress", "registeredAddress", NID_registeredAddress, 3, + &kObjectData[5742], 0}, + {"destinationIndicator", "destinationIndicator", NID_destinationIndicator, + 3, &kObjectData[5745], 0}, + {"preferredDeliveryMethod", "preferredDeliveryMethod", + NID_preferredDeliveryMethod, 3, &kObjectData[5748], 0}, + {"presentationAddress", "presentationAddress", NID_presentationAddress, 3, + &kObjectData[5751], 0}, + {"supportedApplicationContext", "supportedApplicationContext", + NID_supportedApplicationContext, 3, &kObjectData[5754], 0}, + {"member", "member", NID_member, 3, &kObjectData[5757], 0}, + {"owner", "owner", NID_owner, 3, &kObjectData[5760], 0}, + {"roleOccupant", "roleOccupant", NID_roleOccupant, 3, &kObjectData[5763], + 0}, + {"seeAlso", "seeAlso", NID_seeAlso, 3, &kObjectData[5766], 0}, + {"userPassword", "userPassword", NID_userPassword, 3, &kObjectData[5769], + 0}, + {"userCertificate", "userCertificate", NID_userCertificate, 3, + &kObjectData[5772], 0}, + {"cACertificate", "cACertificate", NID_cACertificate, 3, &kObjectData[5775], + 0}, + {"authorityRevocationList", "authorityRevocationList", + NID_authorityRevocationList, 3, &kObjectData[5778], 0}, + {"certificateRevocationList", "certificateRevocationList", + NID_certificateRevocationList, 3, &kObjectData[5781], 0}, + {"crossCertificatePair", "crossCertificatePair", NID_crossCertificatePair, + 3, &kObjectData[5784], 0}, + {"enhancedSearchGuide", "enhancedSearchGuide", NID_enhancedSearchGuide, 3, + &kObjectData[5787], 0}, + {"protocolInformation", "protocolInformation", NID_protocolInformation, 3, + &kObjectData[5790], 0}, + {"distinguishedName", "distinguishedName", NID_distinguishedName, 3, + &kObjectData[5793], 0}, + {"uniqueMember", "uniqueMember", NID_uniqueMember, 3, &kObjectData[5796], + 0}, + {"houseIdentifier", "houseIdentifier", NID_houseIdentifier, 3, + &kObjectData[5799], 0}, + {"supportedAlgorithms", "supportedAlgorithms", NID_supportedAlgorithms, 3, + &kObjectData[5802], 0}, + {"deltaRevocationList", "deltaRevocationList", NID_deltaRevocationList, 3, + &kObjectData[5805], 0}, + {"dmdName", "dmdName", NID_dmdName, 3, &kObjectData[5808], 0}, + {"id-alg-PWRI-KEK", "id-alg-PWRI-KEK", NID_id_alg_PWRI_KEK, 11, + &kObjectData[5811], 0}, + {"CMAC", "cmac", NID_cmac, 0, NULL, 0}, + {"id-aes128-GCM", "aes-128-gcm", NID_aes_128_gcm, 9, &kObjectData[5822], 0}, + {"id-aes128-CCM", "aes-128-ccm", NID_aes_128_ccm, 9, &kObjectData[5831], 0}, + {"id-aes128-wrap-pad", "id-aes128-wrap-pad", NID_id_aes128_wrap_pad, 9, + &kObjectData[5840], 0}, + {"id-aes192-GCM", "aes-192-gcm", NID_aes_192_gcm, 9, &kObjectData[5849], 0}, + {"id-aes192-CCM", "aes-192-ccm", NID_aes_192_ccm, 9, &kObjectData[5858], 0}, + {"id-aes192-wrap-pad", "id-aes192-wrap-pad", NID_id_aes192_wrap_pad, 9, + &kObjectData[5867], 0}, + {"id-aes256-GCM", "aes-256-gcm", NID_aes_256_gcm, 9, &kObjectData[5876], 0}, + {"id-aes256-CCM", "aes-256-ccm", NID_aes_256_ccm, 9, &kObjectData[5885], 0}, + {"id-aes256-wrap-pad", "id-aes256-wrap-pad", NID_id_aes256_wrap_pad, 9, + &kObjectData[5894], 0}, + {"AES-128-CTR", "aes-128-ctr", NID_aes_128_ctr, 0, NULL, 0}, + {"AES-192-CTR", "aes-192-ctr", NID_aes_192_ctr, 0, NULL, 0}, + {"AES-256-CTR", "aes-256-ctr", NID_aes_256_ctr, 0, NULL, 0}, + {"id-camellia128-wrap", "id-camellia128-wrap", NID_id_camellia128_wrap, 11, + &kObjectData[5903], 0}, + {"id-camellia192-wrap", "id-camellia192-wrap", NID_id_camellia192_wrap, 11, + &kObjectData[5914], 0}, + {"id-camellia256-wrap", "id-camellia256-wrap", NID_id_camellia256_wrap, 11, + &kObjectData[5925], 0}, + {"anyExtendedKeyUsage", "Any Extended Key Usage", NID_anyExtendedKeyUsage, + 4, &kObjectData[5936], 0}, + {"MGF1", "mgf1", NID_mgf1, 9, &kObjectData[5940], 0}, + {"RSASSA-PSS", "rsassaPss", NID_rsassaPss, 9, &kObjectData[5949], 0}, + {"AES-128-XTS", "aes-128-xts", NID_aes_128_xts, 0, NULL, 0}, + {"AES-256-XTS", "aes-256-xts", NID_aes_256_xts, 0, NULL, 0}, + {"RC4-HMAC-MD5", "rc4-hmac-md5", NID_rc4_hmac_md5, 0, NULL, 0}, + {"AES-128-CBC-HMAC-SHA1", "aes-128-cbc-hmac-sha1", + NID_aes_128_cbc_hmac_sha1, 0, NULL, 0}, + {"AES-192-CBC-HMAC-SHA1", "aes-192-cbc-hmac-sha1", + NID_aes_192_cbc_hmac_sha1, 0, NULL, 0}, + {"AES-256-CBC-HMAC-SHA1", "aes-256-cbc-hmac-sha1", + NID_aes_256_cbc_hmac_sha1, 0, NULL, 0}, + {"RSAES-OAEP", "rsaesOaep", NID_rsaesOaep, 9, &kObjectData[5958], 0}, + {"dhpublicnumber", "X9.42 DH", NID_dhpublicnumber, 7, &kObjectData[5967], + 0}, + {"brainpoolP160r1", "brainpoolP160r1", NID_brainpoolP160r1, 9, + &kObjectData[5974], 0}, + {"brainpoolP160t1", "brainpoolP160t1", NID_brainpoolP160t1, 9, + &kObjectData[5983], 0}, + {"brainpoolP192r1", "brainpoolP192r1", NID_brainpoolP192r1, 9, + &kObjectData[5992], 0}, + {"brainpoolP192t1", "brainpoolP192t1", NID_brainpoolP192t1, 9, + &kObjectData[6001], 0}, + {"brainpoolP224r1", "brainpoolP224r1", NID_brainpoolP224r1, 9, + &kObjectData[6010], 0}, + {"brainpoolP224t1", "brainpoolP224t1", NID_brainpoolP224t1, 9, + &kObjectData[6019], 0}, + {"brainpoolP256r1", "brainpoolP256r1", NID_brainpoolP256r1, 9, + &kObjectData[6028], 0}, + {"brainpoolP256t1", "brainpoolP256t1", NID_brainpoolP256t1, 9, + &kObjectData[6037], 0}, + {"brainpoolP320r1", "brainpoolP320r1", NID_brainpoolP320r1, 9, + &kObjectData[6046], 0}, + {"brainpoolP320t1", "brainpoolP320t1", NID_brainpoolP320t1, 9, + &kObjectData[6055], 0}, + {"brainpoolP384r1", "brainpoolP384r1", NID_brainpoolP384r1, 9, + &kObjectData[6064], 0}, + {"brainpoolP384t1", "brainpoolP384t1", NID_brainpoolP384t1, 9, + &kObjectData[6073], 0}, + {"brainpoolP512r1", "brainpoolP512r1", NID_brainpoolP512r1, 9, + &kObjectData[6082], 0}, + {"brainpoolP512t1", "brainpoolP512t1", NID_brainpoolP512t1, 9, + &kObjectData[6091], 0}, + {"PSPECIFIED", "pSpecified", NID_pSpecified, 9, &kObjectData[6100], 0}, + {"dhSinglePass-stdDH-sha1kdf-scheme", "dhSinglePass-stdDH-sha1kdf-scheme", + NID_dhSinglePass_stdDH_sha1kdf_scheme, 9, &kObjectData[6109], 0}, + {"dhSinglePass-stdDH-sha224kdf-scheme", + "dhSinglePass-stdDH-sha224kdf-scheme", + NID_dhSinglePass_stdDH_sha224kdf_scheme, 6, &kObjectData[6118], 0}, + {"dhSinglePass-stdDH-sha256kdf-scheme", + "dhSinglePass-stdDH-sha256kdf-scheme", + NID_dhSinglePass_stdDH_sha256kdf_scheme, 6, &kObjectData[6124], 0}, + {"dhSinglePass-stdDH-sha384kdf-scheme", + "dhSinglePass-stdDH-sha384kdf-scheme", + NID_dhSinglePass_stdDH_sha384kdf_scheme, 6, &kObjectData[6130], 0}, + {"dhSinglePass-stdDH-sha512kdf-scheme", + "dhSinglePass-stdDH-sha512kdf-scheme", + NID_dhSinglePass_stdDH_sha512kdf_scheme, 6, &kObjectData[6136], 0}, + {"dhSinglePass-cofactorDH-sha1kdf-scheme", + "dhSinglePass-cofactorDH-sha1kdf-scheme", + NID_dhSinglePass_cofactorDH_sha1kdf_scheme, 9, &kObjectData[6142], 0}, + {"dhSinglePass-cofactorDH-sha224kdf-scheme", + "dhSinglePass-cofactorDH-sha224kdf-scheme", + NID_dhSinglePass_cofactorDH_sha224kdf_scheme, 6, &kObjectData[6151], 0}, + {"dhSinglePass-cofactorDH-sha256kdf-scheme", + "dhSinglePass-cofactorDH-sha256kdf-scheme", + NID_dhSinglePass_cofactorDH_sha256kdf_scheme, 6, &kObjectData[6157], 0}, + {"dhSinglePass-cofactorDH-sha384kdf-scheme", + "dhSinglePass-cofactorDH-sha384kdf-scheme", + NID_dhSinglePass_cofactorDH_sha384kdf_scheme, 6, &kObjectData[6163], 0}, + {"dhSinglePass-cofactorDH-sha512kdf-scheme", + "dhSinglePass-cofactorDH-sha512kdf-scheme", + 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, 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}, + {"KxECDHE", "kx-ecdhe", NID_kx_ecdhe, 0, NULL, 0}, + {"KxPSK", "kx-psk", NID_kx_psk, 0, NULL, 0}, + {"AuthRSA", "auth-rsa", NID_auth_rsa, 0, NULL, 0}, + {"AuthECDSA", "auth-ecdsa", NID_auth_ecdsa, 0, NULL, 0}, + {"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 uint16_t kNIDsInShortNameOrder[] = { + 364 /* AD_DVCS */, + 419 /* AES-128-CBC */, + 916 /* AES-128-CBC-HMAC-SHA1 */, + 421 /* AES-128-CFB */, + 650 /* AES-128-CFB1 */, + 653 /* AES-128-CFB8 */, + 904 /* AES-128-CTR */, + 418 /* AES-128-ECB */, + 420 /* AES-128-OFB */, + 913 /* AES-128-XTS */, + 423 /* AES-192-CBC */, + 917 /* AES-192-CBC-HMAC-SHA1 */, + 425 /* AES-192-CFB */, + 651 /* AES-192-CFB1 */, + 654 /* AES-192-CFB8 */, + 905 /* AES-192-CTR */, + 422 /* AES-192-ECB */, + 424 /* AES-192-OFB */, + 427 /* AES-256-CBC */, + 918 /* AES-256-CBC-HMAC-SHA1 */, + 429 /* AES-256-CFB */, + 652 /* AES-256-CFB1 */, + 655 /* AES-256-CFB8 */, + 906 /* AES-256-CTR */, + 426 /* AES-256-ECB */, + 428 /* AES-256-OFB */, + 914 /* AES-256-XTS */, + 958 /* AuthANY */, + 955 /* AuthECDSA */, + 956 /* AuthPSK */, + 954 /* AuthRSA */, + 91 /* BF-CBC */, + 93 /* BF-CFB */, + 92 /* BF-ECB */, + 94 /* BF-OFB */, + 14 /* C */, + 751 /* CAMELLIA-128-CBC */, + 757 /* CAMELLIA-128-CFB */, + 760 /* CAMELLIA-128-CFB1 */, + 763 /* CAMELLIA-128-CFB8 */, + 754 /* CAMELLIA-128-ECB */, + 766 /* CAMELLIA-128-OFB */, + 752 /* CAMELLIA-192-CBC */, + 758 /* CAMELLIA-192-CFB */, + 761 /* CAMELLIA-192-CFB1 */, + 764 /* CAMELLIA-192-CFB8 */, + 755 /* CAMELLIA-192-ECB */, + 767 /* CAMELLIA-192-OFB */, + 753 /* CAMELLIA-256-CBC */, + 759 /* CAMELLIA-256-CFB */, + 762 /* CAMELLIA-256-CFB1 */, + 765 /* CAMELLIA-256-CFB8 */, + 756 /* CAMELLIA-256-ECB */, + 768 /* CAMELLIA-256-OFB */, + 108 /* CAST5-CBC */, + 110 /* CAST5-CFB */, + 109 /* CAST5-ECB */, + 111 /* CAST5-OFB */, + 959 /* CECPQ2 */, + 894 /* CMAC */, + 13 /* CN */, + 141 /* CRLReason */, + 417 /* CSPName */, + 950 /* ChaCha20-Poly1305 */, + 367 /* CrlID */, + 391 /* DC */, + 31 /* DES-CBC */, + 643 /* DES-CDMF */, + 30 /* DES-CFB */, + 656 /* DES-CFB1 */, + 657 /* DES-CFB8 */, + 29 /* DES-ECB */, + 32 /* DES-EDE */, + 43 /* DES-EDE-CBC */, + 60 /* DES-EDE-CFB */, + 62 /* DES-EDE-OFB */, + 33 /* DES-EDE3 */, + 44 /* DES-EDE3-CBC */, + 61 /* DES-EDE3-CFB */, + 658 /* DES-EDE3-CFB1 */, + 659 /* DES-EDE3-CFB8 */, + 63 /* DES-EDE3-OFB */, + 45 /* DES-OFB */, + 80 /* DESX-CBC */, + 380 /* DOD */, + 116 /* DSA */, + 66 /* DSA-SHA */, + 113 /* DSA-SHA1 */, + 70 /* DSA-SHA1-old */, + 67 /* DSA-old */, + 297 /* DVCS */, + 949 /* ED25519 */, + 960 /* ED448 */, + 99 /* GN */, + 855 /* HMAC */, + 780 /* HMAC-MD5 */, + 781 /* HMAC-SHA1 */, + 381 /* IANA */, + 34 /* IDEA-CBC */, + 35 /* IDEA-CFB */, + 36 /* IDEA-ECB */, + 46 /* IDEA-OFB */, + 181 /* ISO */, + 183 /* ISO-US */, + 645 /* ITU-T */, + 646 /* JOINT-ISO-ITU-T */, + 773 /* KISA */, + 957 /* KxANY */, + 952 /* KxECDHE */, + 953 /* KxPSK */, + 951 /* KxRSA */, + 15 /* L */, + 856 /* LocalKeySet */, + 3 /* MD2 */, + 257 /* MD4 */, + 4 /* MD5 */, + 114 /* MD5-SHA1 */, + 95 /* MDC2 */, + 911 /* MGF1 */, + 388 /* Mail */, + 57 /* Netscape */, + 366 /* Nonce */, + 17 /* O */, + 178 /* OCSP */, + 180 /* OCSPSigning */, + 379 /* ORG */, + 18 /* OU */, + 749 /* Oakley-EC2N-3 */, + 750 /* Oakley-EC2N-4 */, + 9 /* PBE-MD2-DES */, + 168 /* PBE-MD2-RC2-64 */, + 10 /* PBE-MD5-DES */, + 169 /* PBE-MD5-RC2-64 */, + 147 /* PBE-SHA1-2DES */, + 146 /* PBE-SHA1-3DES */, + 170 /* PBE-SHA1-DES */, + 148 /* PBE-SHA1-RC2-128 */, + 149 /* PBE-SHA1-RC2-40 */, + 68 /* PBE-SHA1-RC2-64 */, + 144 /* PBE-SHA1-RC4-128 */, + 145 /* PBE-SHA1-RC4-40 */, + 161 /* PBES2 */, + 69 /* PBKDF2 */, + 162 /* PBMAC1 */, + 127 /* PKIX */, + 935 /* PSPECIFIED */, + 98 /* RC2-40-CBC */, + 166 /* RC2-64-CBC */, + 37 /* RC2-CBC */, + 39 /* RC2-CFB */, + 38 /* RC2-ECB */, + 40 /* RC2-OFB */, + 5 /* RC4 */, + 97 /* RC4-40 */, + 915 /* RC4-HMAC-MD5 */, + 120 /* RC5-CBC */, + 122 /* RC5-CFB */, + 121 /* RC5-ECB */, + 123 /* RC5-OFB */, + 117 /* RIPEMD160 */, + 19 /* RSA */, + 7 /* RSA-MD2 */, + 396 /* RSA-MD4 */, + 8 /* RSA-MD5 */, + 96 /* RSA-MDC2 */, + 104 /* RSA-NP-MD5 */, + 119 /* RSA-RIPEMD160 */, + 42 /* RSA-SHA */, + 65 /* RSA-SHA1 */, + 115 /* RSA-SHA1-2 */, + 671 /* RSA-SHA224 */, + 668 /* RSA-SHA256 */, + 669 /* RSA-SHA384 */, + 670 /* RSA-SHA512 */, + 919 /* RSAES-OAEP */, + 912 /* RSASSA-PSS */, + 777 /* SEED-CBC */, + 779 /* SEED-CFB */, + 776 /* SEED-ECB */, + 778 /* SEED-OFB */, + 41 /* SHA */, + 64 /* SHA1 */, + 675 /* SHA224 */, + 672 /* SHA256 */, + 673 /* SHA384 */, + 674 /* SHA512 */, + 188 /* SMIME */, + 167 /* SMIME-CAPS */, + 100 /* SN */, + 16 /* ST */, + 143 /* SXNetID */, + 458 /* UID */, + 0 /* UNDEF */, + 948 /* X25519 */, + 961 /* X448 */, + 11 /* X500 */, + 378 /* X500algorithms */, + 12 /* X509 */, + 184 /* X9-57 */, + 185 /* X9cm */, + 125 /* ZLIB */, + 478 /* aRecord */, + 289 /* aaControls */, + 287 /* ac-auditEntity */, + 397 /* ac-proxying */, + 288 /* ac-targeting */, + 368 /* acceptableResponses */, + 446 /* account */, + 363 /* ad_timestamping */, + 376 /* algorithm */, + 405 /* ansi-X9-62 */, + 910 /* anyExtendedKeyUsage */, + 746 /* anyPolicy */, + 370 /* archiveCutoff */, + 484 /* associatedDomain */, + 485 /* associatedName */, + 501 /* audio */, + 177 /* authorityInfoAccess */, + 90 /* authorityKeyIdentifier */, + 882 /* authorityRevocationList */, + 87 /* basicConstraints */, + 365 /* basicOCSPResponse */, + 285 /* biometricInfo */, + 921 /* brainpoolP160r1 */, + 922 /* brainpoolP160t1 */, + 923 /* brainpoolP192r1 */, + 924 /* brainpoolP192t1 */, + 925 /* brainpoolP224r1 */, + 926 /* brainpoolP224t1 */, + 927 /* brainpoolP256r1 */, + 928 /* brainpoolP256t1 */, + 929 /* brainpoolP320r1 */, + 930 /* brainpoolP320t1 */, + 931 /* brainpoolP384r1 */, + 932 /* brainpoolP384t1 */, + 933 /* brainpoolP512r1 */, + 934 /* brainpoolP512t1 */, + 494 /* buildingName */, + 860 /* businessCategory */, + 691 /* c2onb191v4 */, + 692 /* c2onb191v5 */, + 697 /* c2onb239v4 */, + 698 /* c2onb239v5 */, + 684 /* c2pnb163v1 */, + 685 /* c2pnb163v2 */, + 686 /* c2pnb163v3 */, + 687 /* c2pnb176v1 */, + 693 /* c2pnb208w1 */, + 699 /* c2pnb272w1 */, + 700 /* c2pnb304w1 */, + 702 /* c2pnb368w1 */, + 688 /* c2tnb191v1 */, + 689 /* c2tnb191v2 */, + 690 /* c2tnb191v3 */, + 694 /* c2tnb239v1 */, + 695 /* c2tnb239v2 */, + 696 /* c2tnb239v3 */, + 701 /* c2tnb359v1 */, + 703 /* c2tnb431r1 */, + 881 /* cACertificate */, + 483 /* cNAMERecord */, + 179 /* caIssuers */, + 785 /* caRepository */, + 443 /* caseIgnoreIA5StringSyntax */, + 152 /* certBag */, + 677 /* certicom-arc */, + 771 /* certificateIssuer */, + 89 /* certificatePolicies */, + 883 /* certificateRevocationList */, + 54 /* challengePassword */, + 407 /* characteristic-two-field */, + 395 /* clearance */, + 130 /* clientAuth */, + 131 /* codeSigning */, + 50 /* contentType */, + 53 /* countersignature */, + 153 /* crlBag */, + 103 /* crlDistributionPoints */, + 88 /* crlNumber */, + 884 /* crossCertificatePair */, + 806 /* cryptocom */, + 805 /* cryptopro */, + 500 /* dITRedirect */, + 451 /* dNSDomain */, + 495 /* dSAQuality */, + 434 /* data */, + 390 /* dcobject */, + 140 /* deltaCRL */, + 891 /* deltaRevocationList */, + 107 /* description */, + 871 /* destinationIndicator */, + 947 /* dh-cofactor-kdf */, + 946 /* dh-std-kdf */, + 28 /* dhKeyAgreement */, + 941 /* dhSinglePass-cofactorDH-sha1kdf-scheme */, + 942 /* dhSinglePass-cofactorDH-sha224kdf-scheme */, + 943 /* dhSinglePass-cofactorDH-sha256kdf-scheme */, + 944 /* dhSinglePass-cofactorDH-sha384kdf-scheme */, + 945 /* dhSinglePass-cofactorDH-sha512kdf-scheme */, + 936 /* dhSinglePass-stdDH-sha1kdf-scheme */, + 937 /* dhSinglePass-stdDH-sha224kdf-scheme */, + 938 /* dhSinglePass-stdDH-sha256kdf-scheme */, + 939 /* dhSinglePass-stdDH-sha384kdf-scheme */, + 940 /* dhSinglePass-stdDH-sha512kdf-scheme */, + 920 /* dhpublicnumber */, + 382 /* directory */, + 887 /* distinguishedName */, + 892 /* dmdName */, + 174 /* dnQualifier */, + 447 /* document */, + 471 /* documentAuthor */, + 468 /* documentIdentifier */, + 472 /* documentLocation */, + 502 /* documentPublisher */, + 449 /* documentSeries */, + 469 /* documentTitle */, + 470 /* documentVersion */, + 392 /* domain */, + 452 /* domainRelatedObject */, + 802 /* dsa_with_SHA224 */, + 803 /* dsa_with_SHA256 */, + 791 /* ecdsa-with-Recommended */, + 416 /* ecdsa-with-SHA1 */, + 793 /* ecdsa-with-SHA224 */, + 794 /* ecdsa-with-SHA256 */, + 795 /* ecdsa-with-SHA384 */, + 796 /* ecdsa-with-SHA512 */, + 792 /* ecdsa-with-Specified */, + 48 /* emailAddress */, + 132 /* emailProtection */, + 885 /* enhancedSearchGuide */, + 389 /* enterprises */, + 384 /* experimental */, + 172 /* extReq */, + 56 /* extendedCertificateAttributes */, + 126 /* extendedKeyUsage */, + 372 /* extendedStatus */, + 867 /* facsimileTelephoneNumber */, + 462 /* favouriteDrink */, + 857 /* freshestCRL */, + 453 /* friendlyCountry */, + 490 /* friendlyCountryName */, + 156 /* friendlyName */, + 509 /* generationQualifier */, + 815 /* gost-mac */, + 811 /* gost2001 */, + 851 /* gost2001cc */, + 813 /* gost89 */, + 814 /* gost89-cnt */, + 812 /* gost94 */, + 850 /* gost94cc */, + 797 /* hmacWithMD5 */, + 163 /* hmacWithSHA1 */, + 798 /* hmacWithSHA224 */, + 799 /* hmacWithSHA256 */, + 800 /* hmacWithSHA384 */, + 801 /* hmacWithSHA512 */, + 432 /* holdInstructionCallIssuer */, + 430 /* holdInstructionCode */, + 431 /* holdInstructionNone */, + 433 /* holdInstructionReject */, + 486 /* homePostalAddress */, + 473 /* homeTelephoneNumber */, + 466 /* host */, + 889 /* houseIdentifier */, + 442 /* iA5StringSyntax */, + 783 /* id-DHBasedMac */, + 824 /* id-Gost28147-89-CryptoPro-A-ParamSet */, + 825 /* id-Gost28147-89-CryptoPro-B-ParamSet */, + 826 /* id-Gost28147-89-CryptoPro-C-ParamSet */, + 827 /* id-Gost28147-89-CryptoPro-D-ParamSet */, + 819 /* id-Gost28147-89-CryptoPro-KeyMeshing */, + 829 /* id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet */, + 828 /* id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet */, + 830 /* id-Gost28147-89-CryptoPro-RIC-1-ParamSet */, + 820 /* id-Gost28147-89-None-KeyMeshing */, + 823 /* id-Gost28147-89-TestParamSet */, + 849 /* id-Gost28147-89-cc */, + 840 /* id-GostR3410-2001-CryptoPro-A-ParamSet */, + 841 /* id-GostR3410-2001-CryptoPro-B-ParamSet */, + 842 /* id-GostR3410-2001-CryptoPro-C-ParamSet */, + 843 /* id-GostR3410-2001-CryptoPro-XchA-ParamSet */, + 844 /* id-GostR3410-2001-CryptoPro-XchB-ParamSet */, + 854 /* id-GostR3410-2001-ParamSet-cc */, + 839 /* id-GostR3410-2001-TestParamSet */, + 817 /* id-GostR3410-2001DH */, + 832 /* id-GostR3410-94-CryptoPro-A-ParamSet */, + 833 /* id-GostR3410-94-CryptoPro-B-ParamSet */, + 834 /* id-GostR3410-94-CryptoPro-C-ParamSet */, + 835 /* id-GostR3410-94-CryptoPro-D-ParamSet */, + 836 /* id-GostR3410-94-CryptoPro-XchA-ParamSet */, + 837 /* id-GostR3410-94-CryptoPro-XchB-ParamSet */, + 838 /* id-GostR3410-94-CryptoPro-XchC-ParamSet */, + 831 /* id-GostR3410-94-TestParamSet */, + 845 /* id-GostR3410-94-a */, + 846 /* id-GostR3410-94-aBis */, + 847 /* id-GostR3410-94-b */, + 848 /* id-GostR3410-94-bBis */, + 818 /* id-GostR3410-94DH */, + 822 /* id-GostR3411-94-CryptoProParamSet */, + 821 /* id-GostR3411-94-TestParamSet */, + 807 /* id-GostR3411-94-with-GostR3410-2001 */, + 853 /* id-GostR3411-94-with-GostR3410-2001-cc */, + 808 /* id-GostR3411-94-with-GostR3410-94 */, + 852 /* id-GostR3411-94-with-GostR3410-94-cc */, + 810 /* id-HMACGostR3411-94 */, + 782 /* id-PasswordBasedMAC */, + 266 /* id-aca */, + 355 /* id-aca-accessIdentity */, + 354 /* id-aca-authenticationInfo */, + 356 /* id-aca-chargingIdentity */, + 399 /* id-aca-encAttrs */, + 357 /* id-aca-group */, + 358 /* id-aca-role */, + 176 /* id-ad */, + 896 /* id-aes128-CCM */, + 895 /* id-aes128-GCM */, + 788 /* id-aes128-wrap */, + 897 /* id-aes128-wrap-pad */, + 899 /* id-aes192-CCM */, + 898 /* id-aes192-GCM */, + 789 /* id-aes192-wrap */, + 900 /* id-aes192-wrap-pad */, + 902 /* id-aes256-CCM */, + 901 /* id-aes256-GCM */, + 790 /* id-aes256-wrap */, + 903 /* id-aes256-wrap-pad */, + 262 /* id-alg */, + 893 /* id-alg-PWRI-KEK */, + 323 /* id-alg-des40 */, + 326 /* id-alg-dh-pop */, + 325 /* id-alg-dh-sig-hmac-sha1 */, + 324 /* id-alg-noSignature */, + 907 /* id-camellia128-wrap */, + 908 /* id-camellia192-wrap */, + 909 /* id-camellia256-wrap */, + 268 /* id-cct */, + 361 /* id-cct-PKIData */, + 362 /* id-cct-PKIResponse */, + 360 /* id-cct-crs */, + 81 /* id-ce */, + 680 /* id-characteristic-two-basis */, + 263 /* id-cmc */, + 334 /* id-cmc-addExtensions */, + 346 /* id-cmc-confirmCertAcceptance */, + 330 /* id-cmc-dataReturn */, + 336 /* id-cmc-decryptedPOP */, + 335 /* id-cmc-encryptedPOP */, + 339 /* id-cmc-getCRL */, + 338 /* id-cmc-getCert */, + 328 /* id-cmc-identification */, + 329 /* id-cmc-identityProof */, + 337 /* id-cmc-lraPOPWitness */, + 344 /* id-cmc-popLinkRandom */, + 345 /* id-cmc-popLinkWitness */, + 343 /* id-cmc-queryPending */, + 333 /* id-cmc-recipientNonce */, + 341 /* id-cmc-regInfo */, + 342 /* id-cmc-responseInfo */, + 340 /* id-cmc-revokeRequest */, + 332 /* id-cmc-senderNonce */, + 327 /* id-cmc-statusInfo */, + 331 /* id-cmc-transactionId */, + 787 /* id-ct-asciiTextWithCRLF */, + 408 /* id-ecPublicKey */, + 508 /* id-hex-multipart-message */, + 507 /* id-hex-partial-message */, + 260 /* id-it */, + 302 /* id-it-caKeyUpdateInfo */, + 298 /* id-it-caProtEncCert */, + 311 /* id-it-confirmWaitTime */, + 303 /* id-it-currentCRL */, + 300 /* id-it-encKeyPairTypes */, + 310 /* id-it-implicitConfirm */, + 308 /* id-it-keyPairParamRep */, + 307 /* id-it-keyPairParamReq */, + 312 /* id-it-origPKIMessage */, + 301 /* id-it-preferredSymmAlg */, + 309 /* id-it-revPassphrase */, + 299 /* id-it-signKeyPairTypes */, + 305 /* id-it-subscriptionRequest */, + 306 /* id-it-subscriptionResponse */, + 784 /* id-it-suppLangTags */, + 304 /* id-it-unsupportedOIDs */, + 128 /* id-kp */, + 280 /* id-mod-attribute-cert */, + 274 /* id-mod-cmc */, + 277 /* id-mod-cmp */, + 284 /* id-mod-cmp2000 */, + 273 /* id-mod-crmf */, + 283 /* id-mod-dvcs */, + 275 /* id-mod-kea-profile-88 */, + 276 /* id-mod-kea-profile-93 */, + 282 /* id-mod-ocsp */, + 278 /* id-mod-qualified-cert-88 */, + 279 /* id-mod-qualified-cert-93 */, + 281 /* id-mod-timestamp-protocol */, + 264 /* id-on */, + 858 /* id-on-permanentIdentifier */, + 347 /* id-on-personalData */, + 265 /* id-pda */, + 352 /* id-pda-countryOfCitizenship */, + 353 /* id-pda-countryOfResidence */, + 348 /* id-pda-dateOfBirth */, + 351 /* id-pda-gender */, + 349 /* id-pda-placeOfBirth */, + 175 /* id-pe */, + 261 /* id-pkip */, + 258 /* id-pkix-mod */, + 269 /* id-pkix1-explicit-88 */, + 271 /* id-pkix1-explicit-93 */, + 270 /* id-pkix1-implicit-88 */, + 272 /* id-pkix1-implicit-93 */, + 662 /* id-ppl */, + 664 /* id-ppl-anyLanguage */, + 667 /* id-ppl-independent */, + 665 /* id-ppl-inheritAll */, + 267 /* id-qcs */, + 359 /* id-qcs-pkixQCSyntax-v1 */, + 259 /* id-qt */, + 164 /* id-qt-cps */, + 165 /* id-qt-unotice */, + 313 /* id-regCtrl */, + 316 /* id-regCtrl-authenticator */, + 319 /* id-regCtrl-oldCertID */, + 318 /* id-regCtrl-pkiArchiveOptions */, + 317 /* id-regCtrl-pkiPublicationInfo */, + 320 /* id-regCtrl-protocolEncrKey */, + 315 /* id-regCtrl-regToken */, + 314 /* id-regInfo */, + 322 /* id-regInfo-certReq */, + 321 /* id-regInfo-utf8Pairs */, + 512 /* id-set */, + 191 /* id-smime-aa */, + 215 /* id-smime-aa-contentHint */, + 218 /* id-smime-aa-contentIdentifier */, + 221 /* id-smime-aa-contentReference */, + 240 /* id-smime-aa-dvcs-dvc */, + 217 /* id-smime-aa-encapContentType */, + 222 /* id-smime-aa-encrypKeyPref */, + 220 /* id-smime-aa-equivalentLabels */, + 232 /* id-smime-aa-ets-CertificateRefs */, + 233 /* id-smime-aa-ets-RevocationRefs */, + 238 /* id-smime-aa-ets-archiveTimeStamp */, + 237 /* id-smime-aa-ets-certCRLTimestamp */, + 234 /* id-smime-aa-ets-certValues */, + 227 /* id-smime-aa-ets-commitmentType */, + 231 /* id-smime-aa-ets-contentTimestamp */, + 236 /* id-smime-aa-ets-escTimeStamp */, + 230 /* id-smime-aa-ets-otherSigCert */, + 235 /* id-smime-aa-ets-revocationValues */, + 226 /* id-smime-aa-ets-sigPolicyId */, + 229 /* id-smime-aa-ets-signerAttr */, + 228 /* id-smime-aa-ets-signerLocation */, + 219 /* id-smime-aa-macValue */, + 214 /* id-smime-aa-mlExpandHistory */, + 216 /* id-smime-aa-msgSigDigest */, + 212 /* id-smime-aa-receiptRequest */, + 213 /* id-smime-aa-securityLabel */, + 239 /* id-smime-aa-signatureType */, + 223 /* id-smime-aa-signingCertificate */, + 224 /* id-smime-aa-smimeEncryptCerts */, + 225 /* id-smime-aa-timeStampToken */, + 192 /* id-smime-alg */, + 243 /* id-smime-alg-3DESwrap */, + 246 /* id-smime-alg-CMS3DESwrap */, + 247 /* id-smime-alg-CMSRC2wrap */, + 245 /* id-smime-alg-ESDH */, + 241 /* id-smime-alg-ESDHwith3DES */, + 242 /* id-smime-alg-ESDHwithRC2 */, + 244 /* id-smime-alg-RC2wrap */, + 193 /* id-smime-cd */, + 248 /* id-smime-cd-ldap */, + 190 /* id-smime-ct */, + 210 /* id-smime-ct-DVCSRequestData */, + 211 /* id-smime-ct-DVCSResponseData */, + 208 /* id-smime-ct-TDTInfo */, + 207 /* id-smime-ct-TSTInfo */, + 205 /* id-smime-ct-authData */, + 786 /* id-smime-ct-compressedData */, + 209 /* id-smime-ct-contentInfo */, + 206 /* id-smime-ct-publishCert */, + 204 /* id-smime-ct-receipt */, + 195 /* id-smime-cti */, + 255 /* id-smime-cti-ets-proofOfApproval */, + 256 /* id-smime-cti-ets-proofOfCreation */, + 253 /* id-smime-cti-ets-proofOfDelivery */, + 251 /* id-smime-cti-ets-proofOfOrigin */, + 252 /* id-smime-cti-ets-proofOfReceipt */, + 254 /* id-smime-cti-ets-proofOfSender */, + 189 /* id-smime-mod */, + 196 /* id-smime-mod-cms */, + 197 /* id-smime-mod-ess */, + 202 /* id-smime-mod-ets-eSigPolicy-88 */, + 203 /* id-smime-mod-ets-eSigPolicy-97 */, + 200 /* id-smime-mod-ets-eSignature-88 */, + 201 /* id-smime-mod-ets-eSignature-97 */, + 199 /* id-smime-mod-msg-v3 */, + 198 /* id-smime-mod-oid */, + 194 /* id-smime-spq */, + 250 /* id-smime-spq-ets-sqt-unotice */, + 249 /* id-smime-spq-ets-sqt-uri */, + 676 /* identified-organization */, + 461 /* info */, + 748 /* inhibitAnyPolicy */, + 101 /* initials */, + 647 /* international-organizations */, + 869 /* internationaliSDNNumber */, + 142 /* invalidityDate */, + 294 /* ipsecEndSystem */, + 295 /* ipsecTunnel */, + 296 /* ipsecUser */, + 86 /* issuerAltName */, + 770 /* issuingDistributionPoint */, + 492 /* janetMailbox */, + 150 /* keyBag */, + 83 /* keyUsage */, + 477 /* lastModifiedBy */, + 476 /* lastModifiedTime */, + 157 /* localKeyID */, + 480 /* mXRecord */, + 460 /* mail */, + 493 /* mailPreferenceOption */, + 467 /* manager */, + 809 /* md_gost94 */, + 875 /* member */, + 182 /* member-body */, + 51 /* messageDigest */, + 383 /* mgmt */, + 504 /* mime-mhs */, + 506 /* mime-mhs-bodies */, + 505 /* mime-mhs-headings */, + 488 /* mobileTelephoneNumber */, + 136 /* msCTLSign */, + 135 /* msCodeCom */, + 134 /* msCodeInd */, + 138 /* msEFS */, + 171 /* msExtReq */, + 137 /* msSGC */, + 648 /* msSmartcardLogin */, + 649 /* msUPN */, + 481 /* nSRecord */, + 173 /* name */, + 666 /* nameConstraints */, + 369 /* noCheck */, + 403 /* noRevAvail */, + 72 /* nsBaseUrl */, + 76 /* nsCaPolicyUrl */, + 74 /* nsCaRevocationUrl */, + 58 /* nsCertExt */, + 79 /* nsCertSequence */, + 71 /* nsCertType */, + 78 /* nsComment */, + 59 /* nsDataType */, + 75 /* nsRenewalUrl */, + 73 /* nsRevocationUrl */, + 139 /* nsSGC */, + 77 /* nsSslServerName */, + 681 /* onBasis */, + 491 /* organizationalStatus */, + 475 /* otherMailbox */, + 876 /* owner */, + 489 /* pagerTelephoneNumber */, + 374 /* path */, + 112 /* pbeWithMD5AndCast5CBC */, + 499 /* personalSignature */, + 487 /* personalTitle */, + 464 /* photo */, + 863 /* physicalDeliveryOfficeName */, + 437 /* pilot */, + 439 /* pilotAttributeSyntax */, + 438 /* pilotAttributeType */, + 479 /* pilotAttributeType27 */, + 456 /* pilotDSA */, + 441 /* pilotGroups */, + 444 /* pilotObject */, + 440 /* pilotObjectClass */, + 455 /* pilotOrganization */, + 445 /* pilotPerson */, + 2 /* pkcs */, + 186 /* pkcs1 */, + 27 /* pkcs3 */, + 187 /* pkcs5 */, + 20 /* pkcs7 */, + 21 /* pkcs7-data */, + 25 /* pkcs7-digestData */, + 26 /* pkcs7-encryptedData */, + 23 /* pkcs7-envelopedData */, + 24 /* pkcs7-signedAndEnvelopedData */, + 22 /* pkcs7-signedData */, + 151 /* pkcs8ShroudedKeyBag */, + 47 /* pkcs9 */, + 401 /* policyConstraints */, + 747 /* policyMappings */, + 862 /* postOfficeBox */, + 861 /* postalAddress */, + 661 /* postalCode */, + 683 /* ppBasis */, + 872 /* preferredDeliveryMethod */, + 873 /* presentationAddress */, + 816 /* prf-gostr3411-94 */, + 406 /* prime-field */, + 409 /* prime192v1 */, + 410 /* prime192v2 */, + 411 /* prime192v3 */, + 412 /* prime239v1 */, + 413 /* prime239v2 */, + 414 /* prime239v3 */, + 415 /* prime256v1 */, + 385 /* private */, + 84 /* privateKeyUsagePeriod */, + 886 /* protocolInformation */, + 663 /* proxyCertInfo */, + 510 /* pseudonym */, + 435 /* pss */, + 286 /* qcStatements */, + 457 /* qualityLabelledData */, + 450 /* rFC822localPart */, + 870 /* registeredAddress */, + 400 /* role */, + 877 /* roleOccupant */, + 448 /* room */, + 463 /* roomNumber */, + 6 /* rsaEncryption */, + 644 /* rsaOAEPEncryptionSET */, + 377 /* rsaSignature */, + 1 /* rsadsi */, + 482 /* sOARecord */, + 155 /* safeContentsBag */, + 291 /* sbgp-autonomousSysNum */, + 290 /* sbgp-ipAddrBlock */, + 292 /* sbgp-routerIdentifier */, + 159 /* sdsiCertificate */, + 859 /* searchGuide */, + 704 /* secp112r1 */, + 705 /* secp112r2 */, + 706 /* secp128r1 */, + 707 /* secp128r2 */, + 708 /* secp160k1 */, + 709 /* secp160r1 */, + 710 /* secp160r2 */, + 711 /* secp192k1 */, + 712 /* secp224k1 */, + 713 /* secp224r1 */, + 714 /* secp256k1 */, + 715 /* secp384r1 */, + 716 /* secp521r1 */, + 154 /* secretBag */, + 474 /* secretary */, + 717 /* sect113r1 */, + 718 /* sect113r2 */, + 719 /* sect131r1 */, + 720 /* sect131r2 */, + 721 /* sect163k1 */, + 722 /* sect163r1 */, + 723 /* sect163r2 */, + 724 /* sect193r1 */, + 725 /* sect193r2 */, + 726 /* sect233k1 */, + 727 /* sect233r1 */, + 728 /* sect239k1 */, + 729 /* sect283k1 */, + 730 /* sect283r1 */, + 731 /* sect409k1 */, + 732 /* sect409r1 */, + 733 /* sect571k1 */, + 734 /* sect571r1 */, + 386 /* security */, + 878 /* seeAlso */, + 394 /* selected-attribute-types */, + 105 /* serialNumber */, + 129 /* serverAuth */, + 371 /* serviceLocator */, + 625 /* set-addPolicy */, + 515 /* set-attr */, + 518 /* set-brand */, + 638 /* set-brand-AmericanExpress */, + 637 /* set-brand-Diners */, + 636 /* set-brand-IATA-ATA */, + 639 /* set-brand-JCB */, + 641 /* set-brand-MasterCard */, + 642 /* set-brand-Novus */, + 640 /* set-brand-Visa */, + 517 /* set-certExt */, + 513 /* set-ctype */, + 514 /* set-msgExt */, + 516 /* set-policy */, + 607 /* set-policy-root */, + 624 /* set-rootKeyThumb */, + 620 /* setAttr-Cert */, + 631 /* setAttr-GenCryptgrm */, + 623 /* setAttr-IssCap */, + 628 /* setAttr-IssCap-CVM */, + 630 /* setAttr-IssCap-Sig */, + 629 /* setAttr-IssCap-T2 */, + 621 /* setAttr-PGWYcap */, + 635 /* setAttr-SecDevSig */, + 632 /* setAttr-T2Enc */, + 633 /* setAttr-T2cleartxt */, + 634 /* setAttr-TokICCsig */, + 627 /* setAttr-Token-B0Prime */, + 626 /* setAttr-Token-EMV */, + 622 /* setAttr-TokenType */, + 619 /* setCext-IssuerCapabilities */, + 615 /* setCext-PGWYcapabilities */, + 616 /* setCext-TokenIdentifier */, + 618 /* setCext-TokenType */, + 617 /* setCext-Track2Data */, + 611 /* setCext-cCertRequired */, + 609 /* setCext-certType */, + 608 /* setCext-hashedRoot */, + 610 /* setCext-merchData */, + 613 /* setCext-setExt */, + 614 /* setCext-setQualf */, + 612 /* setCext-tunneling */, + 540 /* setct-AcqCardCodeMsg */, + 576 /* setct-AcqCardCodeMsgTBE */, + 570 /* setct-AuthReqTBE */, + 534 /* setct-AuthReqTBS */, + 527 /* setct-AuthResBaggage */, + 571 /* setct-AuthResTBE */, + 572 /* setct-AuthResTBEX */, + 535 /* setct-AuthResTBS */, + 536 /* setct-AuthResTBSX */, + 528 /* setct-AuthRevReqBaggage */, + 577 /* setct-AuthRevReqTBE */, + 541 /* setct-AuthRevReqTBS */, + 529 /* setct-AuthRevResBaggage */, + 542 /* setct-AuthRevResData */, + 578 /* setct-AuthRevResTBE */, + 579 /* setct-AuthRevResTBEB */, + 543 /* setct-AuthRevResTBS */, + 573 /* setct-AuthTokenTBE */, + 537 /* setct-AuthTokenTBS */, + 600 /* setct-BCIDistributionTBS */, + 558 /* setct-BatchAdminReqData */, + 592 /* setct-BatchAdminReqTBE */, + 559 /* setct-BatchAdminResData */, + 593 /* setct-BatchAdminResTBE */, + 599 /* setct-CRLNotificationResTBS */, + 598 /* setct-CRLNotificationTBS */, + 580 /* setct-CapReqTBE */, + 581 /* setct-CapReqTBEX */, + 544 /* setct-CapReqTBS */, + 545 /* setct-CapReqTBSX */, + 546 /* setct-CapResData */, + 582 /* setct-CapResTBE */, + 583 /* setct-CapRevReqTBE */, + 584 /* setct-CapRevReqTBEX */, + 547 /* setct-CapRevReqTBS */, + 548 /* setct-CapRevReqTBSX */, + 549 /* setct-CapRevResData */, + 585 /* setct-CapRevResTBE */, + 538 /* setct-CapTokenData */, + 530 /* setct-CapTokenSeq */, + 574 /* setct-CapTokenTBE */, + 575 /* setct-CapTokenTBEX */, + 539 /* setct-CapTokenTBS */, + 560 /* setct-CardCInitResTBS */, + 566 /* setct-CertInqReqTBS */, + 563 /* setct-CertReqData */, + 595 /* setct-CertReqTBE */, + 596 /* setct-CertReqTBEX */, + 564 /* setct-CertReqTBS */, + 565 /* setct-CertResData */, + 597 /* setct-CertResTBE */, + 586 /* setct-CredReqTBE */, + 587 /* setct-CredReqTBEX */, + 550 /* setct-CredReqTBS */, + 551 /* setct-CredReqTBSX */, + 552 /* setct-CredResData */, + 588 /* setct-CredResTBE */, + 589 /* setct-CredRevReqTBE */, + 590 /* setct-CredRevReqTBEX */, + 553 /* setct-CredRevReqTBS */, + 554 /* setct-CredRevReqTBSX */, + 555 /* setct-CredRevResData */, + 591 /* setct-CredRevResTBE */, + 567 /* setct-ErrorTBS */, + 526 /* setct-HODInput */, + 561 /* setct-MeAqCInitResTBS */, + 522 /* setct-OIData */, + 519 /* setct-PANData */, + 521 /* setct-PANOnly */, + 520 /* setct-PANToken */, + 556 /* setct-PCertReqData */, + 557 /* setct-PCertResTBS */, + 523 /* setct-PI */, + 532 /* setct-PI-TBS */, + 524 /* setct-PIData */, + 525 /* setct-PIDataUnsigned */, + 568 /* setct-PIDualSignedTBE */, + 569 /* setct-PIUnsignedTBE */, + 531 /* setct-PInitResData */, + 533 /* setct-PResData */, + 594 /* setct-RegFormReqTBE */, + 562 /* setct-RegFormResTBS */, + 606 /* setext-cv */, + 601 /* setext-genCrypt */, + 602 /* setext-miAuth */, + 604 /* setext-pinAny */, + 603 /* setext-pinSecure */, + 605 /* setext-track2 */, + 52 /* signingTime */, + 454 /* simpleSecurityObject */, + 496 /* singleLevelQuality */, + 387 /* snmpv2 */, + 660 /* street */, + 85 /* subjectAltName */, + 769 /* subjectDirectoryAttributes */, + 398 /* subjectInfoAccess */, + 82 /* subjectKeyIdentifier */, + 498 /* subtreeMaximumQuality */, + 497 /* subtreeMinimumQuality */, + 890 /* supportedAlgorithms */, + 874 /* supportedApplicationContext */, + 402 /* targetInformation */, + 864 /* telephoneNumber */, + 866 /* teletexTerminalIdentifier */, + 865 /* telexNumber */, + 459 /* textEncodedORAddress */, + 293 /* textNotice */, + 133 /* timeStamping */, + 106 /* title */, + 682 /* tpBasis */, + 375 /* trustRoot */, + 436 /* ucl */, + 888 /* uniqueMember */, + 55 /* unstructuredAddress */, + 49 /* unstructuredName */, + 880 /* userCertificate */, + 465 /* userClass */, + 879 /* userPassword */, + 373 /* valid */, + 678 /* wap */, + 679 /* wap-wsg */, + 735 /* wap-wsg-idm-ecid-wtls1 */, + 743 /* wap-wsg-idm-ecid-wtls10 */, + 744 /* wap-wsg-idm-ecid-wtls11 */, + 745 /* wap-wsg-idm-ecid-wtls12 */, + 736 /* wap-wsg-idm-ecid-wtls3 */, + 737 /* wap-wsg-idm-ecid-wtls4 */, + 738 /* wap-wsg-idm-ecid-wtls5 */, + 739 /* wap-wsg-idm-ecid-wtls6 */, + 740 /* wap-wsg-idm-ecid-wtls7 */, + 741 /* wap-wsg-idm-ecid-wtls8 */, + 742 /* wap-wsg-idm-ecid-wtls9 */, + 804 /* whirlpool */, + 868 /* x121Address */, + 503 /* x500UniqueIdentifier */, + 158 /* x509Certificate */, + 160 /* x509Crl */, +}; + +static const uint16_t kNIDsInLongNameOrder[] = { + 363 /* AD Time Stamping */, + 405 /* ANSI X9.62 */, + 368 /* Acceptable OCSP Responses */, + 910 /* Any Extended Key Usage */, + 664 /* Any language */, + 177 /* Authority Information Access */, + 365 /* Basic OCSP Response */, + 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 */, + 172 /* Extension Request */, + 813 /* GOST 28147-89 */, + 849 /* GOST 28147-89 Cryptocom ParamSet */, + 815 /* GOST 28147-89 MAC */, + 851 /* GOST 34.10-2001 Cryptocom */, + 850 /* GOST 34.10-94 Cryptocom */, + 811 /* GOST R 34.10-2001 */, + 817 /* GOST R 34.10-2001 DH */, + 812 /* GOST R 34.10-94 */, + 818 /* GOST R 34.10-94 DH */, + 809 /* GOST R 34.11-94 */, + 816 /* GOST R 34.11-94 PRF */, + 807 /* GOST R 34.11-94 with GOST R 34.10-2001 */, + 853 /* GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom */, + 808 /* GOST R 34.11-94 with GOST R 34.10-94 */, + 852 /* GOST R 34.11-94 with GOST R 34.10-94 Cryptocom */, + 854 /* GOST R 3410-2001 Parameter Set Cryptocom */, + 810 /* HMAC GOST 34.11-94 */, + 432 /* Hold Instruction Call Issuer */, + 430 /* Hold Instruction Code */, + 431 /* Hold Instruction None */, + 433 /* Hold Instruction Reject */, + 634 /* ICC or token signature */, + 294 /* IPSec End System */, + 295 /* IPSec Tunnel */, + 296 /* IPSec User */, + 182 /* ISO Member Body */, + 183 /* ISO US Member Body */, + 667 /* Independent */, + 665 /* Inherit all */, + 647 /* International Organizations */, + 142 /* Invalidity Date */, + 504 /* MIME MHS */, + 388 /* Mail */, + 383 /* Management */, + 417 /* Microsoft CSP Name */, + 135 /* Microsoft Commercial Code Signing */, + 138 /* Microsoft Encrypted File System */, + 171 /* Microsoft Extension Request */, + 134 /* Microsoft Individual Code Signing */, + 856 /* Microsoft Local Key set */, + 137 /* Microsoft Server Gated Crypto */, + 648 /* Microsoft Smartcardlogin */, + 136 /* Microsoft Trust List Signing */, + 649 /* Microsoft Universal Principal Name */, + 72 /* Netscape Base Url */, + 76 /* Netscape CA Policy Url */, + 74 /* Netscape CA Revocation Url */, + 71 /* Netscape Cert Type */, + 58 /* Netscape Certificate Extension */, + 79 /* Netscape Certificate Sequence */, + 78 /* Netscape Comment */, + 57 /* Netscape Communications Corp. */, + 59 /* Netscape Data Type */, + 75 /* Netscape Renewal Url */, + 73 /* Netscape Revocation Url */, + 77 /* Netscape SSL Server Name */, + 139 /* Netscape Server Gated Crypto */, + 178 /* OCSP */, + 370 /* OCSP Archive Cutoff */, + 367 /* OCSP CRL ID */, + 369 /* OCSP No Check */, + 366 /* OCSP Nonce */, + 371 /* OCSP Service Locator */, + 180 /* OCSP Signing */, + 161 /* PBES2 */, + 69 /* PBKDF2 */, + 162 /* PBMAC1 */, + 127 /* PKIX */, + 858 /* Permanent Identifier */, + 164 /* Policy Qualifier CPS */, + 165 /* Policy Qualifier User Notice */, + 385 /* Private */, + 663 /* Proxy Certificate Information */, + 1 /* RSA Data Security, Inc. */, + 2 /* RSA Data Security, Inc. PKCS */, + 188 /* S/MIME */, + 167 /* S/MIME Capabilities */, + 387 /* SNMPv2 */, + 512 /* Secure Electronic Transactions */, + 386 /* Security */, + 394 /* Selected Attribute Types */, + 143 /* Strong Extranet ID */, + 398 /* Subject Information Access */, + 130 /* TLS Web Client Authentication */, + 129 /* TLS Web Server Authentication */, + 133 /* Time Stamping */, + 375 /* Trust Root */, + 948 /* X25519 */, + 961 /* X448 */, + 12 /* X509 */, + 402 /* X509v3 AC Targeting */, + 746 /* X509v3 Any Policy */, + 90 /* X509v3 Authority Key Identifier */, + 87 /* X509v3 Basic Constraints */, + 103 /* X509v3 CRL Distribution Points */, + 88 /* X509v3 CRL Number */, + 141 /* X509v3 CRL Reason Code */, + 771 /* X509v3 Certificate Issuer */, + 89 /* X509v3 Certificate Policies */, + 140 /* X509v3 Delta CRL Indicator */, + 126 /* X509v3 Extended Key Usage */, + 857 /* X509v3 Freshest CRL */, + 748 /* X509v3 Inhibit Any Policy */, + 86 /* X509v3 Issuer Alternative Name */, + 770 /* X509v3 Issuing Distribution Point */, + 83 /* X509v3 Key Usage */, + 666 /* X509v3 Name Constraints */, + 403 /* X509v3 No Revocation Available */, + 401 /* X509v3 Policy Constraints */, + 747 /* X509v3 Policy Mappings */, + 84 /* X509v3 Private Key Usage Period */, + 85 /* X509v3 Subject Alternative Name */, + 769 /* X509v3 Subject Directory Attributes */, + 82 /* X509v3 Subject Key Identifier */, + 920 /* X9.42 DH */, + 184 /* X9.57 */, + 185 /* X9.57 CM ? */, + 478 /* aRecord */, + 289 /* aaControls */, + 287 /* ac-auditEntity */, + 397 /* ac-proxying */, + 288 /* ac-targeting */, + 446 /* account */, + 364 /* ad dvcs */, + 606 /* additional verification */, + 419 /* aes-128-cbc */, + 916 /* aes-128-cbc-hmac-sha1 */, + 896 /* aes-128-ccm */, + 421 /* aes-128-cfb */, + 650 /* aes-128-cfb1 */, + 653 /* aes-128-cfb8 */, + 904 /* aes-128-ctr */, + 418 /* aes-128-ecb */, + 895 /* aes-128-gcm */, + 420 /* aes-128-ofb */, + 913 /* aes-128-xts */, + 423 /* aes-192-cbc */, + 917 /* aes-192-cbc-hmac-sha1 */, + 899 /* aes-192-ccm */, + 425 /* aes-192-cfb */, + 651 /* aes-192-cfb1 */, + 654 /* aes-192-cfb8 */, + 905 /* aes-192-ctr */, + 422 /* aes-192-ecb */, + 898 /* aes-192-gcm */, + 424 /* aes-192-ofb */, + 427 /* aes-256-cbc */, + 918 /* aes-256-cbc-hmac-sha1 */, + 902 /* aes-256-ccm */, + 429 /* aes-256-cfb */, + 652 /* aes-256-cfb1 */, + 655 /* aes-256-cfb8 */, + 906 /* aes-256-ctr */, + 426 /* aes-256-ecb */, + 901 /* aes-256-gcm */, + 428 /* aes-256-ofb */, + 914 /* aes-256-xts */, + 376 /* algorithm */, + 484 /* associatedDomain */, + 485 /* associatedName */, + 501 /* audio */, + 958 /* auth-any */, + 955 /* auth-ecdsa */, + 956 /* auth-psk */, + 954 /* auth-rsa */, + 882 /* authorityRevocationList */, + 91 /* bf-cbc */, + 93 /* bf-cfb */, + 92 /* bf-ecb */, + 94 /* bf-ofb */, + 921 /* brainpoolP160r1 */, + 922 /* brainpoolP160t1 */, + 923 /* brainpoolP192r1 */, + 924 /* brainpoolP192t1 */, + 925 /* brainpoolP224r1 */, + 926 /* brainpoolP224t1 */, + 927 /* brainpoolP256r1 */, + 928 /* brainpoolP256t1 */, + 929 /* brainpoolP320r1 */, + 930 /* brainpoolP320t1 */, + 931 /* brainpoolP384r1 */, + 932 /* brainpoolP384t1 */, + 933 /* brainpoolP512r1 */, + 934 /* brainpoolP512t1 */, + 494 /* buildingName */, + 860 /* businessCategory */, + 691 /* c2onb191v4 */, + 692 /* c2onb191v5 */, + 697 /* c2onb239v4 */, + 698 /* c2onb239v5 */, + 684 /* c2pnb163v1 */, + 685 /* c2pnb163v2 */, + 686 /* c2pnb163v3 */, + 687 /* c2pnb176v1 */, + 693 /* c2pnb208w1 */, + 699 /* c2pnb272w1 */, + 700 /* c2pnb304w1 */, + 702 /* c2pnb368w1 */, + 688 /* c2tnb191v1 */, + 689 /* c2tnb191v2 */, + 690 /* c2tnb191v3 */, + 694 /* c2tnb239v1 */, + 695 /* c2tnb239v2 */, + 696 /* c2tnb239v3 */, + 701 /* c2tnb359v1 */, + 703 /* c2tnb431r1 */, + 881 /* cACertificate */, + 483 /* cNAMERecord */, + 751 /* camellia-128-cbc */, + 757 /* camellia-128-cfb */, + 760 /* camellia-128-cfb1 */, + 763 /* camellia-128-cfb8 */, + 754 /* camellia-128-ecb */, + 766 /* camellia-128-ofb */, + 752 /* camellia-192-cbc */, + 758 /* camellia-192-cfb */, + 761 /* camellia-192-cfb1 */, + 764 /* camellia-192-cfb8 */, + 755 /* camellia-192-ecb */, + 767 /* camellia-192-ofb */, + 753 /* camellia-256-cbc */, + 759 /* camellia-256-cfb */, + 762 /* camellia-256-cfb1 */, + 765 /* camellia-256-cfb8 */, + 756 /* camellia-256-ecb */, + 768 /* camellia-256-ofb */, + 443 /* caseIgnoreIA5StringSyntax */, + 108 /* cast5-cbc */, + 110 /* cast5-cfb */, + 109 /* cast5-ecb */, + 111 /* cast5-ofb */, + 152 /* certBag */, + 677 /* certicom-arc */, + 517 /* certificate extensions */, + 883 /* certificateRevocationList */, + 950 /* chacha20-poly1305 */, + 54 /* challengePassword */, + 407 /* characteristic-two-field */, + 395 /* clearance */, + 633 /* cleartext track 2 */, + 894 /* cmac */, + 13 /* commonName */, + 513 /* content types */, + 50 /* contentType */, + 53 /* countersignature */, + 14 /* countryName */, + 153 /* crlBag */, + 884 /* crossCertificatePair */, + 806 /* cryptocom */, + 805 /* cryptopro */, + 500 /* dITRedirect */, + 451 /* dNSDomain */, + 495 /* dSAQuality */, + 434 /* data */, + 390 /* dcObject */, + 891 /* deltaRevocationList */, + 31 /* des-cbc */, + 643 /* des-cdmf */, + 30 /* des-cfb */, + 656 /* des-cfb1 */, + 657 /* des-cfb8 */, + 29 /* des-ecb */, + 32 /* des-ede */, + 43 /* des-ede-cbc */, + 60 /* des-ede-cfb */, + 62 /* des-ede-ofb */, + 33 /* des-ede3 */, + 44 /* des-ede3-cbc */, + 61 /* des-ede3-cfb */, + 658 /* des-ede3-cfb1 */, + 659 /* des-ede3-cfb8 */, + 63 /* des-ede3-ofb */, + 45 /* des-ofb */, + 107 /* description */, + 871 /* destinationIndicator */, + 80 /* desx-cbc */, + 947 /* dh-cofactor-kdf */, + 946 /* dh-std-kdf */, + 28 /* dhKeyAgreement */, + 941 /* dhSinglePass-cofactorDH-sha1kdf-scheme */, + 942 /* dhSinglePass-cofactorDH-sha224kdf-scheme */, + 943 /* dhSinglePass-cofactorDH-sha256kdf-scheme */, + 944 /* dhSinglePass-cofactorDH-sha384kdf-scheme */, + 945 /* dhSinglePass-cofactorDH-sha512kdf-scheme */, + 936 /* dhSinglePass-stdDH-sha1kdf-scheme */, + 937 /* dhSinglePass-stdDH-sha224kdf-scheme */, + 938 /* dhSinglePass-stdDH-sha256kdf-scheme */, + 939 /* dhSinglePass-stdDH-sha384kdf-scheme */, + 940 /* dhSinglePass-stdDH-sha512kdf-scheme */, + 11 /* directory services (X.500) */, + 378 /* directory services - algorithms */, + 887 /* distinguishedName */, + 892 /* dmdName */, + 174 /* dnQualifier */, + 447 /* document */, + 471 /* documentAuthor */, + 468 /* documentIdentifier */, + 472 /* documentLocation */, + 502 /* documentPublisher */, + 449 /* documentSeries */, + 469 /* documentTitle */, + 470 /* documentVersion */, + 380 /* dod */, + 391 /* domainComponent */, + 452 /* domainRelatedObject */, + 116 /* dsaEncryption */, + 67 /* dsaEncryption-old */, + 66 /* dsaWithSHA */, + 113 /* dsaWithSHA1 */, + 70 /* dsaWithSHA1-old */, + 802 /* dsa_with_SHA224 */, + 803 /* dsa_with_SHA256 */, + 297 /* dvcs */, + 791 /* ecdsa-with-Recommended */, + 416 /* ecdsa-with-SHA1 */, + 793 /* ecdsa-with-SHA224 */, + 794 /* ecdsa-with-SHA256 */, + 795 /* ecdsa-with-SHA384 */, + 796 /* ecdsa-with-SHA512 */, + 792 /* ecdsa-with-Specified */, + 48 /* emailAddress */, + 632 /* encrypted track 2 */, + 885 /* enhancedSearchGuide */, + 56 /* extendedCertificateAttributes */, + 867 /* facsimileTelephoneNumber */, + 462 /* favouriteDrink */, + 453 /* friendlyCountry */, + 490 /* friendlyCountryName */, + 156 /* friendlyName */, + 631 /* generate cryptogram */, + 509 /* generationQualifier */, + 601 /* generic cryptogram */, + 99 /* givenName */, + 814 /* gost89-cnt */, + 855 /* hmac */, + 780 /* hmac-md5 */, + 781 /* hmac-sha1 */, + 797 /* hmacWithMD5 */, + 163 /* hmacWithSHA1 */, + 798 /* hmacWithSHA224 */, + 799 /* hmacWithSHA256 */, + 800 /* hmacWithSHA384 */, + 801 /* hmacWithSHA512 */, + 486 /* homePostalAddress */, + 473 /* homeTelephoneNumber */, + 466 /* host */, + 889 /* houseIdentifier */, + 442 /* iA5StringSyntax */, + 381 /* iana */, + 824 /* id-Gost28147-89-CryptoPro-A-ParamSet */, + 825 /* id-Gost28147-89-CryptoPro-B-ParamSet */, + 826 /* id-Gost28147-89-CryptoPro-C-ParamSet */, + 827 /* id-Gost28147-89-CryptoPro-D-ParamSet */, + 819 /* id-Gost28147-89-CryptoPro-KeyMeshing */, + 829 /* id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet */, + 828 /* id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet */, + 830 /* id-Gost28147-89-CryptoPro-RIC-1-ParamSet */, + 820 /* id-Gost28147-89-None-KeyMeshing */, + 823 /* id-Gost28147-89-TestParamSet */, + 840 /* id-GostR3410-2001-CryptoPro-A-ParamSet */, + 841 /* id-GostR3410-2001-CryptoPro-B-ParamSet */, + 842 /* id-GostR3410-2001-CryptoPro-C-ParamSet */, + 843 /* id-GostR3410-2001-CryptoPro-XchA-ParamSet */, + 844 /* id-GostR3410-2001-CryptoPro-XchB-ParamSet */, + 839 /* id-GostR3410-2001-TestParamSet */, + 832 /* id-GostR3410-94-CryptoPro-A-ParamSet */, + 833 /* id-GostR3410-94-CryptoPro-B-ParamSet */, + 834 /* id-GostR3410-94-CryptoPro-C-ParamSet */, + 835 /* id-GostR3410-94-CryptoPro-D-ParamSet */, + 836 /* id-GostR3410-94-CryptoPro-XchA-ParamSet */, + 837 /* id-GostR3410-94-CryptoPro-XchB-ParamSet */, + 838 /* id-GostR3410-94-CryptoPro-XchC-ParamSet */, + 831 /* id-GostR3410-94-TestParamSet */, + 845 /* id-GostR3410-94-a */, + 846 /* id-GostR3410-94-aBis */, + 847 /* id-GostR3410-94-b */, + 848 /* id-GostR3410-94-bBis */, + 822 /* id-GostR3411-94-CryptoProParamSet */, + 821 /* id-GostR3411-94-TestParamSet */, + 266 /* id-aca */, + 355 /* id-aca-accessIdentity */, + 354 /* id-aca-authenticationInfo */, + 356 /* id-aca-chargingIdentity */, + 399 /* id-aca-encAttrs */, + 357 /* id-aca-group */, + 358 /* id-aca-role */, + 176 /* id-ad */, + 788 /* id-aes128-wrap */, + 897 /* id-aes128-wrap-pad */, + 789 /* id-aes192-wrap */, + 900 /* id-aes192-wrap-pad */, + 790 /* id-aes256-wrap */, + 903 /* id-aes256-wrap-pad */, + 262 /* id-alg */, + 893 /* id-alg-PWRI-KEK */, + 323 /* id-alg-des40 */, + 326 /* id-alg-dh-pop */, + 325 /* id-alg-dh-sig-hmac-sha1 */, + 324 /* id-alg-noSignature */, + 907 /* id-camellia128-wrap */, + 908 /* id-camellia192-wrap */, + 909 /* id-camellia256-wrap */, + 268 /* id-cct */, + 361 /* id-cct-PKIData */, + 362 /* id-cct-PKIResponse */, + 360 /* id-cct-crs */, + 81 /* id-ce */, + 680 /* id-characteristic-two-basis */, + 263 /* id-cmc */, + 334 /* id-cmc-addExtensions */, + 346 /* id-cmc-confirmCertAcceptance */, + 330 /* id-cmc-dataReturn */, + 336 /* id-cmc-decryptedPOP */, + 335 /* id-cmc-encryptedPOP */, + 339 /* id-cmc-getCRL */, + 338 /* id-cmc-getCert */, + 328 /* id-cmc-identification */, + 329 /* id-cmc-identityProof */, + 337 /* id-cmc-lraPOPWitness */, + 344 /* id-cmc-popLinkRandom */, + 345 /* id-cmc-popLinkWitness */, + 343 /* id-cmc-queryPending */, + 333 /* id-cmc-recipientNonce */, + 341 /* id-cmc-regInfo */, + 342 /* id-cmc-responseInfo */, + 340 /* id-cmc-revokeRequest */, + 332 /* id-cmc-senderNonce */, + 327 /* id-cmc-statusInfo */, + 331 /* id-cmc-transactionId */, + 787 /* id-ct-asciiTextWithCRLF */, + 408 /* id-ecPublicKey */, + 508 /* id-hex-multipart-message */, + 507 /* id-hex-partial-message */, + 260 /* id-it */, + 302 /* id-it-caKeyUpdateInfo */, + 298 /* id-it-caProtEncCert */, + 311 /* id-it-confirmWaitTime */, + 303 /* id-it-currentCRL */, + 300 /* id-it-encKeyPairTypes */, + 310 /* id-it-implicitConfirm */, + 308 /* id-it-keyPairParamRep */, + 307 /* id-it-keyPairParamReq */, + 312 /* id-it-origPKIMessage */, + 301 /* id-it-preferredSymmAlg */, + 309 /* id-it-revPassphrase */, + 299 /* id-it-signKeyPairTypes */, + 305 /* id-it-subscriptionRequest */, + 306 /* id-it-subscriptionResponse */, + 784 /* id-it-suppLangTags */, + 304 /* id-it-unsupportedOIDs */, + 128 /* id-kp */, + 280 /* id-mod-attribute-cert */, + 274 /* id-mod-cmc */, + 277 /* id-mod-cmp */, + 284 /* id-mod-cmp2000 */, + 273 /* id-mod-crmf */, + 283 /* id-mod-dvcs */, + 275 /* id-mod-kea-profile-88 */, + 276 /* id-mod-kea-profile-93 */, + 282 /* id-mod-ocsp */, + 278 /* id-mod-qualified-cert-88 */, + 279 /* id-mod-qualified-cert-93 */, + 281 /* id-mod-timestamp-protocol */, + 264 /* id-on */, + 347 /* id-on-personalData */, + 265 /* id-pda */, + 352 /* id-pda-countryOfCitizenship */, + 353 /* id-pda-countryOfResidence */, + 348 /* id-pda-dateOfBirth */, + 351 /* id-pda-gender */, + 349 /* id-pda-placeOfBirth */, + 175 /* id-pe */, + 261 /* id-pkip */, + 258 /* id-pkix-mod */, + 269 /* id-pkix1-explicit-88 */, + 271 /* id-pkix1-explicit-93 */, + 270 /* id-pkix1-implicit-88 */, + 272 /* id-pkix1-implicit-93 */, + 662 /* id-ppl */, + 267 /* id-qcs */, + 359 /* id-qcs-pkixQCSyntax-v1 */, + 259 /* id-qt */, + 313 /* id-regCtrl */, + 316 /* id-regCtrl-authenticator */, + 319 /* id-regCtrl-oldCertID */, + 318 /* id-regCtrl-pkiArchiveOptions */, + 317 /* id-regCtrl-pkiPublicationInfo */, + 320 /* id-regCtrl-protocolEncrKey */, + 315 /* id-regCtrl-regToken */, + 314 /* id-regInfo */, + 322 /* id-regInfo-certReq */, + 321 /* id-regInfo-utf8Pairs */, + 191 /* id-smime-aa */, + 215 /* id-smime-aa-contentHint */, + 218 /* id-smime-aa-contentIdentifier */, + 221 /* id-smime-aa-contentReference */, + 240 /* id-smime-aa-dvcs-dvc */, + 217 /* id-smime-aa-encapContentType */, + 222 /* id-smime-aa-encrypKeyPref */, + 220 /* id-smime-aa-equivalentLabels */, + 232 /* id-smime-aa-ets-CertificateRefs */, + 233 /* id-smime-aa-ets-RevocationRefs */, + 238 /* id-smime-aa-ets-archiveTimeStamp */, + 237 /* id-smime-aa-ets-certCRLTimestamp */, + 234 /* id-smime-aa-ets-certValues */, + 227 /* id-smime-aa-ets-commitmentType */, + 231 /* id-smime-aa-ets-contentTimestamp */, + 236 /* id-smime-aa-ets-escTimeStamp */, + 230 /* id-smime-aa-ets-otherSigCert */, + 235 /* id-smime-aa-ets-revocationValues */, + 226 /* id-smime-aa-ets-sigPolicyId */, + 229 /* id-smime-aa-ets-signerAttr */, + 228 /* id-smime-aa-ets-signerLocation */, + 219 /* id-smime-aa-macValue */, + 214 /* id-smime-aa-mlExpandHistory */, + 216 /* id-smime-aa-msgSigDigest */, + 212 /* id-smime-aa-receiptRequest */, + 213 /* id-smime-aa-securityLabel */, + 239 /* id-smime-aa-signatureType */, + 223 /* id-smime-aa-signingCertificate */, + 224 /* id-smime-aa-smimeEncryptCerts */, + 225 /* id-smime-aa-timeStampToken */, + 192 /* id-smime-alg */, + 243 /* id-smime-alg-3DESwrap */, + 246 /* id-smime-alg-CMS3DESwrap */, + 247 /* id-smime-alg-CMSRC2wrap */, + 245 /* id-smime-alg-ESDH */, + 241 /* id-smime-alg-ESDHwith3DES */, + 242 /* id-smime-alg-ESDHwithRC2 */, + 244 /* id-smime-alg-RC2wrap */, + 193 /* id-smime-cd */, + 248 /* id-smime-cd-ldap */, + 190 /* id-smime-ct */, + 210 /* id-smime-ct-DVCSRequestData */, + 211 /* id-smime-ct-DVCSResponseData */, + 208 /* id-smime-ct-TDTInfo */, + 207 /* id-smime-ct-TSTInfo */, + 205 /* id-smime-ct-authData */, + 786 /* id-smime-ct-compressedData */, + 209 /* id-smime-ct-contentInfo */, + 206 /* id-smime-ct-publishCert */, + 204 /* id-smime-ct-receipt */, + 195 /* id-smime-cti */, + 255 /* id-smime-cti-ets-proofOfApproval */, + 256 /* id-smime-cti-ets-proofOfCreation */, + 253 /* id-smime-cti-ets-proofOfDelivery */, + 251 /* id-smime-cti-ets-proofOfOrigin */, + 252 /* id-smime-cti-ets-proofOfReceipt */, + 254 /* id-smime-cti-ets-proofOfSender */, + 189 /* id-smime-mod */, + 196 /* id-smime-mod-cms */, + 197 /* id-smime-mod-ess */, + 202 /* id-smime-mod-ets-eSigPolicy-88 */, + 203 /* id-smime-mod-ets-eSigPolicy-97 */, + 200 /* id-smime-mod-ets-eSignature-88 */, + 201 /* id-smime-mod-ets-eSignature-97 */, + 199 /* id-smime-mod-msg-v3 */, + 198 /* id-smime-mod-oid */, + 194 /* id-smime-spq */, + 250 /* id-smime-spq-ets-sqt-unotice */, + 249 /* id-smime-spq-ets-sqt-uri */, + 34 /* idea-cbc */, + 35 /* idea-cfb */, + 36 /* idea-ecb */, + 46 /* idea-ofb */, + 676 /* identified-organization */, + 461 /* info */, + 101 /* initials */, + 869 /* internationaliSDNNumber */, + 749 /* ipsec3 */, + 750 /* ipsec4 */, + 181 /* iso */, + 623 /* issuer capabilities */, + 645 /* itu-t */, + 492 /* janetMailbox */, + 646 /* joint-iso-itu-t */, + 150 /* keyBag */, + 773 /* kisa */, + 957 /* kx-any */, + 952 /* kx-ecdhe */, + 953 /* kx-psk */, + 951 /* kx-rsa */, + 477 /* lastModifiedBy */, + 476 /* lastModifiedTime */, + 157 /* localKeyID */, + 15 /* localityName */, + 480 /* mXRecord */, + 493 /* mailPreferenceOption */, + 467 /* manager */, + 3 /* md2 */, + 7 /* md2WithRSAEncryption */, + 257 /* md4 */, + 396 /* md4WithRSAEncryption */, + 4 /* md5 */, + 114 /* md5-sha1 */, + 104 /* md5WithRSA */, + 8 /* md5WithRSAEncryption */, + 95 /* mdc2 */, + 96 /* mdc2WithRSA */, + 875 /* member */, + 602 /* merchant initiated auth */, + 514 /* message extensions */, + 51 /* messageDigest */, + 911 /* mgf1 */, + 506 /* mime-mhs-bodies */, + 505 /* mime-mhs-headings */, + 488 /* mobileTelephoneNumber */, + 481 /* nSRecord */, + 173 /* name */, + 681 /* onBasis */, + 379 /* org */, + 17 /* organizationName */, + 491 /* organizationalStatus */, + 18 /* organizationalUnitName */, + 475 /* otherMailbox */, + 876 /* owner */, + 935 /* pSpecified */, + 489 /* pagerTelephoneNumber */, + 782 /* password based MAC */, + 374 /* path */, + 621 /* payment gateway capabilities */, + 9 /* pbeWithMD2AndDES-CBC */, + 168 /* pbeWithMD2AndRC2-CBC */, + 112 /* pbeWithMD5AndCast5CBC */, + 10 /* pbeWithMD5AndDES-CBC */, + 169 /* pbeWithMD5AndRC2-CBC */, + 148 /* pbeWithSHA1And128BitRC2-CBC */, + 144 /* pbeWithSHA1And128BitRC4 */, + 147 /* pbeWithSHA1And2-KeyTripleDES-CBC */, + 146 /* pbeWithSHA1And3-KeyTripleDES-CBC */, + 149 /* pbeWithSHA1And40BitRC2-CBC */, + 145 /* pbeWithSHA1And40BitRC4 */, + 170 /* pbeWithSHA1AndDES-CBC */, + 68 /* pbeWithSHA1AndRC2-CBC */, + 499 /* personalSignature */, + 487 /* personalTitle */, + 464 /* photo */, + 863 /* physicalDeliveryOfficeName */, + 437 /* pilot */, + 439 /* pilotAttributeSyntax */, + 438 /* pilotAttributeType */, + 479 /* pilotAttributeType27 */, + 456 /* pilotDSA */, + 441 /* pilotGroups */, + 444 /* pilotObject */, + 440 /* pilotObjectClass */, + 455 /* pilotOrganization */, + 445 /* pilotPerson */, + 186 /* pkcs1 */, + 27 /* pkcs3 */, + 187 /* pkcs5 */, + 20 /* pkcs7 */, + 21 /* pkcs7-data */, + 25 /* pkcs7-digestData */, + 26 /* pkcs7-encryptedData */, + 23 /* pkcs7-envelopedData */, + 24 /* pkcs7-signedAndEnvelopedData */, + 22 /* pkcs7-signedData */, + 151 /* pkcs8ShroudedKeyBag */, + 47 /* pkcs9 */, + 862 /* postOfficeBox */, + 861 /* postalAddress */, + 661 /* postalCode */, + 683 /* ppBasis */, + 872 /* preferredDeliveryMethod */, + 873 /* presentationAddress */, + 406 /* prime-field */, + 409 /* prime192v1 */, + 410 /* prime192v2 */, + 411 /* prime192v3 */, + 412 /* prime239v1 */, + 413 /* prime239v2 */, + 414 /* prime239v3 */, + 415 /* prime256v1 */, + 886 /* protocolInformation */, + 510 /* pseudonym */, + 435 /* pss */, + 286 /* qcStatements */, + 457 /* qualityLabelledData */, + 450 /* rFC822localPart */, + 98 /* rc2-40-cbc */, + 166 /* rc2-64-cbc */, + 37 /* rc2-cbc */, + 39 /* rc2-cfb */, + 38 /* rc2-ecb */, + 40 /* rc2-ofb */, + 5 /* rc4 */, + 97 /* rc4-40 */, + 915 /* rc4-hmac-md5 */, + 120 /* rc5-cbc */, + 122 /* rc5-cfb */, + 121 /* rc5-ecb */, + 123 /* rc5-ofb */, + 870 /* registeredAddress */, + 460 /* rfc822Mailbox */, + 117 /* ripemd160 */, + 119 /* ripemd160WithRSA */, + 400 /* role */, + 877 /* roleOccupant */, + 448 /* room */, + 463 /* roomNumber */, + 19 /* rsa */, + 6 /* rsaEncryption */, + 644 /* rsaOAEPEncryptionSET */, + 377 /* rsaSignature */, + 919 /* rsaesOaep */, + 912 /* rsassaPss */, + 482 /* sOARecord */, + 155 /* safeContentsBag */, + 291 /* sbgp-autonomousSysNum */, + 290 /* sbgp-ipAddrBlock */, + 292 /* sbgp-routerIdentifier */, + 159 /* sdsiCertificate */, + 859 /* searchGuide */, + 704 /* secp112r1 */, + 705 /* secp112r2 */, + 706 /* secp128r1 */, + 707 /* secp128r2 */, + 708 /* secp160k1 */, + 709 /* secp160r1 */, + 710 /* secp160r2 */, + 711 /* secp192k1 */, + 712 /* secp224k1 */, + 713 /* secp224r1 */, + 714 /* secp256k1 */, + 715 /* secp384r1 */, + 716 /* secp521r1 */, + 154 /* secretBag */, + 474 /* secretary */, + 717 /* sect113r1 */, + 718 /* sect113r2 */, + 719 /* sect131r1 */, + 720 /* sect131r2 */, + 721 /* sect163k1 */, + 722 /* sect163r1 */, + 723 /* sect163r2 */, + 724 /* sect193r1 */, + 725 /* sect193r2 */, + 726 /* sect233k1 */, + 727 /* sect233r1 */, + 728 /* sect239k1 */, + 729 /* sect283k1 */, + 730 /* sect283r1 */, + 731 /* sect409k1 */, + 732 /* sect409r1 */, + 733 /* sect571k1 */, + 734 /* sect571r1 */, + 635 /* secure device signature */, + 878 /* seeAlso */, + 777 /* seed-cbc */, + 779 /* seed-cfb */, + 776 /* seed-ecb */, + 778 /* seed-ofb */, + 105 /* serialNumber */, + 625 /* set-addPolicy */, + 515 /* set-attr */, + 518 /* set-brand */, + 638 /* set-brand-AmericanExpress */, + 637 /* set-brand-Diners */, + 636 /* set-brand-IATA-ATA */, + 639 /* set-brand-JCB */, + 641 /* set-brand-MasterCard */, + 642 /* set-brand-Novus */, + 640 /* set-brand-Visa */, + 516 /* set-policy */, + 607 /* set-policy-root */, + 624 /* set-rootKeyThumb */, + 620 /* setAttr-Cert */, + 628 /* setAttr-IssCap-CVM */, + 630 /* setAttr-IssCap-Sig */, + 629 /* setAttr-IssCap-T2 */, + 627 /* setAttr-Token-B0Prime */, + 626 /* setAttr-Token-EMV */, + 622 /* setAttr-TokenType */, + 619 /* setCext-IssuerCapabilities */, + 615 /* setCext-PGWYcapabilities */, + 616 /* setCext-TokenIdentifier */, + 618 /* setCext-TokenType */, + 617 /* setCext-Track2Data */, + 611 /* setCext-cCertRequired */, + 609 /* setCext-certType */, + 608 /* setCext-hashedRoot */, + 610 /* setCext-merchData */, + 613 /* setCext-setExt */, + 614 /* setCext-setQualf */, + 612 /* setCext-tunneling */, + 540 /* setct-AcqCardCodeMsg */, + 576 /* setct-AcqCardCodeMsgTBE */, + 570 /* setct-AuthReqTBE */, + 534 /* setct-AuthReqTBS */, + 527 /* setct-AuthResBaggage */, + 571 /* setct-AuthResTBE */, + 572 /* setct-AuthResTBEX */, + 535 /* setct-AuthResTBS */, + 536 /* setct-AuthResTBSX */, + 528 /* setct-AuthRevReqBaggage */, + 577 /* setct-AuthRevReqTBE */, + 541 /* setct-AuthRevReqTBS */, + 529 /* setct-AuthRevResBaggage */, + 542 /* setct-AuthRevResData */, + 578 /* setct-AuthRevResTBE */, + 579 /* setct-AuthRevResTBEB */, + 543 /* setct-AuthRevResTBS */, + 573 /* setct-AuthTokenTBE */, + 537 /* setct-AuthTokenTBS */, + 600 /* setct-BCIDistributionTBS */, + 558 /* setct-BatchAdminReqData */, + 592 /* setct-BatchAdminReqTBE */, + 559 /* setct-BatchAdminResData */, + 593 /* setct-BatchAdminResTBE */, + 599 /* setct-CRLNotificationResTBS */, + 598 /* setct-CRLNotificationTBS */, + 580 /* setct-CapReqTBE */, + 581 /* setct-CapReqTBEX */, + 544 /* setct-CapReqTBS */, + 545 /* setct-CapReqTBSX */, + 546 /* setct-CapResData */, + 582 /* setct-CapResTBE */, + 583 /* setct-CapRevReqTBE */, + 584 /* setct-CapRevReqTBEX */, + 547 /* setct-CapRevReqTBS */, + 548 /* setct-CapRevReqTBSX */, + 549 /* setct-CapRevResData */, + 585 /* setct-CapRevResTBE */, + 538 /* setct-CapTokenData */, + 530 /* setct-CapTokenSeq */, + 574 /* setct-CapTokenTBE */, + 575 /* setct-CapTokenTBEX */, + 539 /* setct-CapTokenTBS */, + 560 /* setct-CardCInitResTBS */, + 566 /* setct-CertInqReqTBS */, + 563 /* setct-CertReqData */, + 595 /* setct-CertReqTBE */, + 596 /* setct-CertReqTBEX */, + 564 /* setct-CertReqTBS */, + 565 /* setct-CertResData */, + 597 /* setct-CertResTBE */, + 586 /* setct-CredReqTBE */, + 587 /* setct-CredReqTBEX */, + 550 /* setct-CredReqTBS */, + 551 /* setct-CredReqTBSX */, + 552 /* setct-CredResData */, + 588 /* setct-CredResTBE */, + 589 /* setct-CredRevReqTBE */, + 590 /* setct-CredRevReqTBEX */, + 553 /* setct-CredRevReqTBS */, + 554 /* setct-CredRevReqTBSX */, + 555 /* setct-CredRevResData */, + 591 /* setct-CredRevResTBE */, + 567 /* setct-ErrorTBS */, + 526 /* setct-HODInput */, + 561 /* setct-MeAqCInitResTBS */, + 522 /* setct-OIData */, + 519 /* setct-PANData */, + 521 /* setct-PANOnly */, + 520 /* setct-PANToken */, + 556 /* setct-PCertReqData */, + 557 /* setct-PCertResTBS */, + 523 /* setct-PI */, + 532 /* setct-PI-TBS */, + 524 /* setct-PIData */, + 525 /* setct-PIDataUnsigned */, + 568 /* setct-PIDualSignedTBE */, + 569 /* setct-PIUnsignedTBE */, + 531 /* setct-PInitResData */, + 533 /* setct-PResData */, + 594 /* setct-RegFormReqTBE */, + 562 /* setct-RegFormResTBS */, + 604 /* setext-pinAny */, + 603 /* setext-pinSecure */, + 605 /* setext-track2 */, + 41 /* sha */, + 64 /* sha1 */, + 115 /* sha1WithRSA */, + 65 /* sha1WithRSAEncryption */, + 675 /* sha224 */, + 671 /* sha224WithRSAEncryption */, + 672 /* sha256 */, + 668 /* sha256WithRSAEncryption */, + 673 /* sha384 */, + 669 /* sha384WithRSAEncryption */, + 674 /* sha512 */, + 670 /* sha512WithRSAEncryption */, + 42 /* shaWithRSAEncryption */, + 52 /* signingTime */, + 454 /* simpleSecurityObject */, + 496 /* singleLevelQuality */, + 16 /* stateOrProvinceName */, + 660 /* streetAddress */, + 498 /* subtreeMaximumQuality */, + 497 /* subtreeMinimumQuality */, + 890 /* supportedAlgorithms */, + 874 /* supportedApplicationContext */, + 100 /* surname */, + 864 /* telephoneNumber */, + 866 /* teletexTerminalIdentifier */, + 865 /* telexNumber */, + 459 /* textEncodedORAddress */, + 293 /* textNotice */, + 106 /* title */, + 682 /* tpBasis */, + 436 /* ucl */, + 0 /* undefined */, + 888 /* uniqueMember */, + 55 /* unstructuredAddress */, + 49 /* unstructuredName */, + 880 /* userCertificate */, + 465 /* userClass */, + 458 /* userId */, + 879 /* userPassword */, + 373 /* valid */, + 678 /* wap */, + 679 /* wap-wsg */, + 735 /* wap-wsg-idm-ecid-wtls1 */, + 743 /* wap-wsg-idm-ecid-wtls10 */, + 744 /* wap-wsg-idm-ecid-wtls11 */, + 745 /* wap-wsg-idm-ecid-wtls12 */, + 736 /* wap-wsg-idm-ecid-wtls3 */, + 737 /* wap-wsg-idm-ecid-wtls4 */, + 738 /* wap-wsg-idm-ecid-wtls5 */, + 739 /* wap-wsg-idm-ecid-wtls6 */, + 740 /* wap-wsg-idm-ecid-wtls7 */, + 741 /* wap-wsg-idm-ecid-wtls8 */, + 742 /* wap-wsg-idm-ecid-wtls9 */, + 804 /* whirlpool */, + 868 /* x121Address */, + 503 /* x500UniqueIdentifier */, + 158 /* x509Certificate */, + 160 /* x509Crl */, + 125 /* zlib compression */, +}; + +static const uint16_t kNIDsInOIDOrder[] = { + 434 /* 0.9 (OBJ_data) */, + 182 /* 1.2 (OBJ_member_body) */, + 379 /* 1.3 (OBJ_org) */, + 676 /* 1.3 (OBJ_identified_organization) */, + 11 /* 2.5 (OBJ_X500) */, + 647 /* 2.23 (OBJ_international_organizations) */, + 380 /* 1.3.6 (OBJ_dod) */, + 12 /* 2.5.4 (OBJ_X509) */, + 378 /* 2.5.8 (OBJ_X500algorithms) */, + 81 /* 2.5.29 (OBJ_id_ce) */, + 512 /* 2.23.42 (OBJ_id_set) */, + 678 /* 2.23.43 (OBJ_wap) */, + 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) */, + 100 /* 2.5.4.4 (OBJ_surname) */, + 105 /* 2.5.4.5 (OBJ_serialNumber) */, + 14 /* 2.5.4.6 (OBJ_countryName) */, + 15 /* 2.5.4.7 (OBJ_localityName) */, + 16 /* 2.5.4.8 (OBJ_stateOrProvinceName) */, + 660 /* 2.5.4.9 (OBJ_streetAddress) */, + 17 /* 2.5.4.10 (OBJ_organizationName) */, + 18 /* 2.5.4.11 (OBJ_organizationalUnitName) */, + 106 /* 2.5.4.12 (OBJ_title) */, + 107 /* 2.5.4.13 (OBJ_description) */, + 859 /* 2.5.4.14 (OBJ_searchGuide) */, + 860 /* 2.5.4.15 (OBJ_businessCategory) */, + 861 /* 2.5.4.16 (OBJ_postalAddress) */, + 661 /* 2.5.4.17 (OBJ_postalCode) */, + 862 /* 2.5.4.18 (OBJ_postOfficeBox) */, + 863 /* 2.5.4.19 (OBJ_physicalDeliveryOfficeName) */, + 864 /* 2.5.4.20 (OBJ_telephoneNumber) */, + 865 /* 2.5.4.21 (OBJ_telexNumber) */, + 866 /* 2.5.4.22 (OBJ_teletexTerminalIdentifier) */, + 867 /* 2.5.4.23 (OBJ_facsimileTelephoneNumber) */, + 868 /* 2.5.4.24 (OBJ_x121Address) */, + 869 /* 2.5.4.25 (OBJ_internationaliSDNNumber) */, + 870 /* 2.5.4.26 (OBJ_registeredAddress) */, + 871 /* 2.5.4.27 (OBJ_destinationIndicator) */, + 872 /* 2.5.4.28 (OBJ_preferredDeliveryMethod) */, + 873 /* 2.5.4.29 (OBJ_presentationAddress) */, + 874 /* 2.5.4.30 (OBJ_supportedApplicationContext) */, + 875 /* 2.5.4.31 (OBJ_member) */, + 876 /* 2.5.4.32 (OBJ_owner) */, + 877 /* 2.5.4.33 (OBJ_roleOccupant) */, + 878 /* 2.5.4.34 (OBJ_seeAlso) */, + 879 /* 2.5.4.35 (OBJ_userPassword) */, + 880 /* 2.5.4.36 (OBJ_userCertificate) */, + 881 /* 2.5.4.37 (OBJ_cACertificate) */, + 882 /* 2.5.4.38 (OBJ_authorityRevocationList) */, + 883 /* 2.5.4.39 (OBJ_certificateRevocationList) */, + 884 /* 2.5.4.40 (OBJ_crossCertificatePair) */, + 173 /* 2.5.4.41 (OBJ_name) */, + 99 /* 2.5.4.42 (OBJ_givenName) */, + 101 /* 2.5.4.43 (OBJ_initials) */, + 509 /* 2.5.4.44 (OBJ_generationQualifier) */, + 503 /* 2.5.4.45 (OBJ_x500UniqueIdentifier) */, + 174 /* 2.5.4.46 (OBJ_dnQualifier) */, + 885 /* 2.5.4.47 (OBJ_enhancedSearchGuide) */, + 886 /* 2.5.4.48 (OBJ_protocolInformation) */, + 887 /* 2.5.4.49 (OBJ_distinguishedName) */, + 888 /* 2.5.4.50 (OBJ_uniqueMember) */, + 889 /* 2.5.4.51 (OBJ_houseIdentifier) */, + 890 /* 2.5.4.52 (OBJ_supportedAlgorithms) */, + 891 /* 2.5.4.53 (OBJ_deltaRevocationList) */, + 892 /* 2.5.4.54 (OBJ_dmdName) */, + 510 /* 2.5.4.65 (OBJ_pseudonym) */, + 400 /* 2.5.4.72 (OBJ_role) */, + 769 /* 2.5.29.9 (OBJ_subject_directory_attributes) */, + 82 /* 2.5.29.14 (OBJ_subject_key_identifier) */, + 83 /* 2.5.29.15 (OBJ_key_usage) */, + 84 /* 2.5.29.16 (OBJ_private_key_usage_period) */, + 85 /* 2.5.29.17 (OBJ_subject_alt_name) */, + 86 /* 2.5.29.18 (OBJ_issuer_alt_name) */, + 87 /* 2.5.29.19 (OBJ_basic_constraints) */, + 88 /* 2.5.29.20 (OBJ_crl_number) */, + 141 /* 2.5.29.21 (OBJ_crl_reason) */, + 430 /* 2.5.29.23 (OBJ_hold_instruction_code) */, + 142 /* 2.5.29.24 (OBJ_invalidity_date) */, + 140 /* 2.5.29.27 (OBJ_delta_crl) */, + 770 /* 2.5.29.28 (OBJ_issuing_distribution_point) */, + 771 /* 2.5.29.29 (OBJ_certificate_issuer) */, + 666 /* 2.5.29.30 (OBJ_name_constraints) */, + 103 /* 2.5.29.31 (OBJ_crl_distribution_points) */, + 89 /* 2.5.29.32 (OBJ_certificate_policies) */, + 747 /* 2.5.29.33 (OBJ_policy_mappings) */, + 90 /* 2.5.29.35 (OBJ_authority_key_identifier) */, + 401 /* 2.5.29.36 (OBJ_policy_constraints) */, + 126 /* 2.5.29.37 (OBJ_ext_key_usage) */, + 857 /* 2.5.29.46 (OBJ_freshest_crl) */, + 748 /* 2.5.29.54 (OBJ_inhibit_any_policy) */, + 402 /* 2.5.29.55 (OBJ_target_information) */, + 403 /* 2.5.29.56 (OBJ_no_rev_avail) */, + 513 /* 2.23.42.0 (OBJ_set_ctype) */, + 514 /* 2.23.42.1 (OBJ_set_msgExt) */, + 515 /* 2.23.42.3 (OBJ_set_attr) */, + 516 /* 2.23.42.5 (OBJ_set_policy) */, + 517 /* 2.23.42.7 (OBJ_set_certExt) */, + 518 /* 2.23.42.8 (OBJ_set_brand) */, + 679 /* 2.23.43.1 (OBJ_wap_wsg) */, + 382 /* 1.3.6.1.1 (OBJ_Directory) */, + 383 /* 1.3.6.1.2 (OBJ_Management) */, + 384 /* 1.3.6.1.3 (OBJ_Experimental) */, + 385 /* 1.3.6.1.4 (OBJ_Private) */, + 386 /* 1.3.6.1.5 (OBJ_Security) */, + 387 /* 1.3.6.1.6 (OBJ_SNMPv2) */, + 388 /* 1.3.6.1.7 (OBJ_Mail) */, + 376 /* 1.3.14.3.2 (OBJ_algorithm) */, + 395 /* 2.5.1.5.55 (OBJ_clearance) */, + 19 /* 2.5.8.1.1 (OBJ_rsa) */, + 96 /* 2.5.8.3.100 (OBJ_mdc2WithRSA) */, + 95 /* 2.5.8.3.101 (OBJ_mdc2) */, + 746 /* 2.5.29.32.0 (OBJ_any_policy) */, + 910 /* 2.5.29.37.0 (OBJ_anyExtendedKeyUsage) */, + 519 /* 2.23.42.0.0 (OBJ_setct_PANData) */, + 520 /* 2.23.42.0.1 (OBJ_setct_PANToken) */, + 521 /* 2.23.42.0.2 (OBJ_setct_PANOnly) */, + 522 /* 2.23.42.0.3 (OBJ_setct_OIData) */, + 523 /* 2.23.42.0.4 (OBJ_setct_PI) */, + 524 /* 2.23.42.0.5 (OBJ_setct_PIData) */, + 525 /* 2.23.42.0.6 (OBJ_setct_PIDataUnsigned) */, + 526 /* 2.23.42.0.7 (OBJ_setct_HODInput) */, + 527 /* 2.23.42.0.8 (OBJ_setct_AuthResBaggage) */, + 528 /* 2.23.42.0.9 (OBJ_setct_AuthRevReqBaggage) */, + 529 /* 2.23.42.0.10 (OBJ_setct_AuthRevResBaggage) */, + 530 /* 2.23.42.0.11 (OBJ_setct_CapTokenSeq) */, + 531 /* 2.23.42.0.12 (OBJ_setct_PInitResData) */, + 532 /* 2.23.42.0.13 (OBJ_setct_PI_TBS) */, + 533 /* 2.23.42.0.14 (OBJ_setct_PResData) */, + 534 /* 2.23.42.0.16 (OBJ_setct_AuthReqTBS) */, + 535 /* 2.23.42.0.17 (OBJ_setct_AuthResTBS) */, + 536 /* 2.23.42.0.18 (OBJ_setct_AuthResTBSX) */, + 537 /* 2.23.42.0.19 (OBJ_setct_AuthTokenTBS) */, + 538 /* 2.23.42.0.20 (OBJ_setct_CapTokenData) */, + 539 /* 2.23.42.0.21 (OBJ_setct_CapTokenTBS) */, + 540 /* 2.23.42.0.22 (OBJ_setct_AcqCardCodeMsg) */, + 541 /* 2.23.42.0.23 (OBJ_setct_AuthRevReqTBS) */, + 542 /* 2.23.42.0.24 (OBJ_setct_AuthRevResData) */, + 543 /* 2.23.42.0.25 (OBJ_setct_AuthRevResTBS) */, + 544 /* 2.23.42.0.26 (OBJ_setct_CapReqTBS) */, + 545 /* 2.23.42.0.27 (OBJ_setct_CapReqTBSX) */, + 546 /* 2.23.42.0.28 (OBJ_setct_CapResData) */, + 547 /* 2.23.42.0.29 (OBJ_setct_CapRevReqTBS) */, + 548 /* 2.23.42.0.30 (OBJ_setct_CapRevReqTBSX) */, + 549 /* 2.23.42.0.31 (OBJ_setct_CapRevResData) */, + 550 /* 2.23.42.0.32 (OBJ_setct_CredReqTBS) */, + 551 /* 2.23.42.0.33 (OBJ_setct_CredReqTBSX) */, + 552 /* 2.23.42.0.34 (OBJ_setct_CredResData) */, + 553 /* 2.23.42.0.35 (OBJ_setct_CredRevReqTBS) */, + 554 /* 2.23.42.0.36 (OBJ_setct_CredRevReqTBSX) */, + 555 /* 2.23.42.0.37 (OBJ_setct_CredRevResData) */, + 556 /* 2.23.42.0.38 (OBJ_setct_PCertReqData) */, + 557 /* 2.23.42.0.39 (OBJ_setct_PCertResTBS) */, + 558 /* 2.23.42.0.40 (OBJ_setct_BatchAdminReqData) */, + 559 /* 2.23.42.0.41 (OBJ_setct_BatchAdminResData) */, + 560 /* 2.23.42.0.42 (OBJ_setct_CardCInitResTBS) */, + 561 /* 2.23.42.0.43 (OBJ_setct_MeAqCInitResTBS) */, + 562 /* 2.23.42.0.44 (OBJ_setct_RegFormResTBS) */, + 563 /* 2.23.42.0.45 (OBJ_setct_CertReqData) */, + 564 /* 2.23.42.0.46 (OBJ_setct_CertReqTBS) */, + 565 /* 2.23.42.0.47 (OBJ_setct_CertResData) */, + 566 /* 2.23.42.0.48 (OBJ_setct_CertInqReqTBS) */, + 567 /* 2.23.42.0.49 (OBJ_setct_ErrorTBS) */, + 568 /* 2.23.42.0.50 (OBJ_setct_PIDualSignedTBE) */, + 569 /* 2.23.42.0.51 (OBJ_setct_PIUnsignedTBE) */, + 570 /* 2.23.42.0.52 (OBJ_setct_AuthReqTBE) */, + 571 /* 2.23.42.0.53 (OBJ_setct_AuthResTBE) */, + 572 /* 2.23.42.0.54 (OBJ_setct_AuthResTBEX) */, + 573 /* 2.23.42.0.55 (OBJ_setct_AuthTokenTBE) */, + 574 /* 2.23.42.0.56 (OBJ_setct_CapTokenTBE) */, + 575 /* 2.23.42.0.57 (OBJ_setct_CapTokenTBEX) */, + 576 /* 2.23.42.0.58 (OBJ_setct_AcqCardCodeMsgTBE) */, + 577 /* 2.23.42.0.59 (OBJ_setct_AuthRevReqTBE) */, + 578 /* 2.23.42.0.60 (OBJ_setct_AuthRevResTBE) */, + 579 /* 2.23.42.0.61 (OBJ_setct_AuthRevResTBEB) */, + 580 /* 2.23.42.0.62 (OBJ_setct_CapReqTBE) */, + 581 /* 2.23.42.0.63 (OBJ_setct_CapReqTBEX) */, + 582 /* 2.23.42.0.64 (OBJ_setct_CapResTBE) */, + 583 /* 2.23.42.0.65 (OBJ_setct_CapRevReqTBE) */, + 584 /* 2.23.42.0.66 (OBJ_setct_CapRevReqTBEX) */, + 585 /* 2.23.42.0.67 (OBJ_setct_CapRevResTBE) */, + 586 /* 2.23.42.0.68 (OBJ_setct_CredReqTBE) */, + 587 /* 2.23.42.0.69 (OBJ_setct_CredReqTBEX) */, + 588 /* 2.23.42.0.70 (OBJ_setct_CredResTBE) */, + 589 /* 2.23.42.0.71 (OBJ_setct_CredRevReqTBE) */, + 590 /* 2.23.42.0.72 (OBJ_setct_CredRevReqTBEX) */, + 591 /* 2.23.42.0.73 (OBJ_setct_CredRevResTBE) */, + 592 /* 2.23.42.0.74 (OBJ_setct_BatchAdminReqTBE) */, + 593 /* 2.23.42.0.75 (OBJ_setct_BatchAdminResTBE) */, + 594 /* 2.23.42.0.76 (OBJ_setct_RegFormReqTBE) */, + 595 /* 2.23.42.0.77 (OBJ_setct_CertReqTBE) */, + 596 /* 2.23.42.0.78 (OBJ_setct_CertReqTBEX) */, + 597 /* 2.23.42.0.79 (OBJ_setct_CertResTBE) */, + 598 /* 2.23.42.0.80 (OBJ_setct_CRLNotificationTBS) */, + 599 /* 2.23.42.0.81 (OBJ_setct_CRLNotificationResTBS) */, + 600 /* 2.23.42.0.82 (OBJ_setct_BCIDistributionTBS) */, + 601 /* 2.23.42.1.1 (OBJ_setext_genCrypt) */, + 602 /* 2.23.42.1.3 (OBJ_setext_miAuth) */, + 603 /* 2.23.42.1.4 (OBJ_setext_pinSecure) */, + 604 /* 2.23.42.1.5 (OBJ_setext_pinAny) */, + 605 /* 2.23.42.1.7 (OBJ_setext_track2) */, + 606 /* 2.23.42.1.8 (OBJ_setext_cv) */, + 620 /* 2.23.42.3.0 (OBJ_setAttr_Cert) */, + 621 /* 2.23.42.3.1 (OBJ_setAttr_PGWYcap) */, + 622 /* 2.23.42.3.2 (OBJ_setAttr_TokenType) */, + 623 /* 2.23.42.3.3 (OBJ_setAttr_IssCap) */, + 607 /* 2.23.42.5.0 (OBJ_set_policy_root) */, + 608 /* 2.23.42.7.0 (OBJ_setCext_hashedRoot) */, + 609 /* 2.23.42.7.1 (OBJ_setCext_certType) */, + 610 /* 2.23.42.7.2 (OBJ_setCext_merchData) */, + 611 /* 2.23.42.7.3 (OBJ_setCext_cCertRequired) */, + 612 /* 2.23.42.7.4 (OBJ_setCext_tunneling) */, + 613 /* 2.23.42.7.5 (OBJ_setCext_setExt) */, + 614 /* 2.23.42.7.6 (OBJ_setCext_setQualf) */, + 615 /* 2.23.42.7.7 (OBJ_setCext_PGWYcapabilities) */, + 616 /* 2.23.42.7.8 (OBJ_setCext_TokenIdentifier) */, + 617 /* 2.23.42.7.9 (OBJ_setCext_Track2Data) */, + 618 /* 2.23.42.7.10 (OBJ_setCext_TokenType) */, + 619 /* 2.23.42.7.11 (OBJ_setCext_IssuerCapabilities) */, + 636 /* 2.23.42.8.1 (OBJ_set_brand_IATA_ATA) */, + 640 /* 2.23.42.8.4 (OBJ_set_brand_Visa) */, + 641 /* 2.23.42.8.5 (OBJ_set_brand_MasterCard) */, + 637 /* 2.23.42.8.30 (OBJ_set_brand_Diners) */, + 638 /* 2.23.42.8.34 (OBJ_set_brand_AmericanExpress) */, + 639 /* 2.23.42.8.35 (OBJ_set_brand_JCB) */, + 805 /* 1.2.643.2.2 (OBJ_cryptopro) */, + 806 /* 1.2.643.2.9 (OBJ_cryptocom) */, + 184 /* 1.2.840.10040 (OBJ_X9_57) */, + 405 /* 1.2.840.10045 (OBJ_ansi_X9_62) */, + 389 /* 1.3.6.1.4.1 (OBJ_Enterprises) */, + 504 /* 1.3.6.1.7.1 (OBJ_mime_mhs) */, + 104 /* 1.3.14.3.2.3 (OBJ_md5WithRSA) */, + 29 /* 1.3.14.3.2.6 (OBJ_des_ecb) */, + 31 /* 1.3.14.3.2.7 (OBJ_des_cbc) */, + 45 /* 1.3.14.3.2.8 (OBJ_des_ofb64) */, + 30 /* 1.3.14.3.2.9 (OBJ_des_cfb64) */, + 377 /* 1.3.14.3.2.11 (OBJ_rsaSignature) */, + 67 /* 1.3.14.3.2.12 (OBJ_dsa_2) */, + 66 /* 1.3.14.3.2.13 (OBJ_dsaWithSHA) */, + 42 /* 1.3.14.3.2.15 (OBJ_shaWithRSAEncryption) */, + 32 /* 1.3.14.3.2.17 (OBJ_des_ede_ecb) */, + 41 /* 1.3.14.3.2.18 (OBJ_sha) */, + 64 /* 1.3.14.3.2.26 (OBJ_sha1) */, + 70 /* 1.3.14.3.2.27 (OBJ_dsaWithSHA1_2) */, + 115 /* 1.3.14.3.2.29 (OBJ_sha1WithRSA) */, + 117 /* 1.3.36.3.2.1 (OBJ_ripemd160) */, + 143 /* 1.3.101.1.4.1 (OBJ_sxnet) */, + 721 /* 1.3.132.0.1 (OBJ_sect163k1) */, + 722 /* 1.3.132.0.2 (OBJ_sect163r1) */, + 728 /* 1.3.132.0.3 (OBJ_sect239k1) */, + 717 /* 1.3.132.0.4 (OBJ_sect113r1) */, + 718 /* 1.3.132.0.5 (OBJ_sect113r2) */, + 704 /* 1.3.132.0.6 (OBJ_secp112r1) */, + 705 /* 1.3.132.0.7 (OBJ_secp112r2) */, + 709 /* 1.3.132.0.8 (OBJ_secp160r1) */, + 708 /* 1.3.132.0.9 (OBJ_secp160k1) */, + 714 /* 1.3.132.0.10 (OBJ_secp256k1) */, + 723 /* 1.3.132.0.15 (OBJ_sect163r2) */, + 729 /* 1.3.132.0.16 (OBJ_sect283k1) */, + 730 /* 1.3.132.0.17 (OBJ_sect283r1) */, + 719 /* 1.3.132.0.22 (OBJ_sect131r1) */, + 720 /* 1.3.132.0.23 (OBJ_sect131r2) */, + 724 /* 1.3.132.0.24 (OBJ_sect193r1) */, + 725 /* 1.3.132.0.25 (OBJ_sect193r2) */, + 726 /* 1.3.132.0.26 (OBJ_sect233k1) */, + 727 /* 1.3.132.0.27 (OBJ_sect233r1) */, + 706 /* 1.3.132.0.28 (OBJ_secp128r1) */, + 707 /* 1.3.132.0.29 (OBJ_secp128r2) */, + 710 /* 1.3.132.0.30 (OBJ_secp160r2) */, + 711 /* 1.3.132.0.31 (OBJ_secp192k1) */, + 712 /* 1.3.132.0.32 (OBJ_secp224k1) */, + 713 /* 1.3.132.0.33 (OBJ_secp224r1) */, + 715 /* 1.3.132.0.34 (OBJ_secp384r1) */, + 716 /* 1.3.132.0.35 (OBJ_secp521r1) */, + 731 /* 1.3.132.0.36 (OBJ_sect409k1) */, + 732 /* 1.3.132.0.37 (OBJ_sect409r1) */, + 733 /* 1.3.132.0.38 (OBJ_sect571k1) */, + 734 /* 1.3.132.0.39 (OBJ_sect571r1) */, + 624 /* 2.23.42.3.0.0 (OBJ_set_rootKeyThumb) */, + 625 /* 2.23.42.3.0.1 (OBJ_set_addPolicy) */, + 626 /* 2.23.42.3.2.1 (OBJ_setAttr_Token_EMV) */, + 627 /* 2.23.42.3.2.2 (OBJ_setAttr_Token_B0Prime) */, + 628 /* 2.23.42.3.3.3 (OBJ_setAttr_IssCap_CVM) */, + 629 /* 2.23.42.3.3.4 (OBJ_setAttr_IssCap_T2) */, + 630 /* 2.23.42.3.3.5 (OBJ_setAttr_IssCap_Sig) */, + 642 /* 2.23.42.8.6011 (OBJ_set_brand_Novus) */, + 735 /* 2.23.43.1.4.1 (OBJ_wap_wsg_idm_ecid_wtls1) */, + 736 /* 2.23.43.1.4.3 (OBJ_wap_wsg_idm_ecid_wtls3) */, + 737 /* 2.23.43.1.4.4 (OBJ_wap_wsg_idm_ecid_wtls4) */, + 738 /* 2.23.43.1.4.5 (OBJ_wap_wsg_idm_ecid_wtls5) */, + 739 /* 2.23.43.1.4.6 (OBJ_wap_wsg_idm_ecid_wtls6) */, + 740 /* 2.23.43.1.4.7 (OBJ_wap_wsg_idm_ecid_wtls7) */, + 741 /* 2.23.43.1.4.8 (OBJ_wap_wsg_idm_ecid_wtls8) */, + 742 /* 2.23.43.1.4.9 (OBJ_wap_wsg_idm_ecid_wtls9) */, + 743 /* 2.23.43.1.4.10 (OBJ_wap_wsg_idm_ecid_wtls10) */, + 744 /* 2.23.43.1.4.11 (OBJ_wap_wsg_idm_ecid_wtls11) */, + 745 /* 2.23.43.1.4.12 (OBJ_wap_wsg_idm_ecid_wtls12) */, + 804 /* 1.0.10118.3.0.55 (OBJ_whirlpool) */, + 773 /* 1.2.410.200004 (OBJ_kisa) */, + 807 /* 1.2.643.2.2.3 (OBJ_id_GostR3411_94_with_GostR3410_2001) */, + 808 /* 1.2.643.2.2.4 (OBJ_id_GostR3411_94_with_GostR3410_94) */, + 809 /* 1.2.643.2.2.9 (OBJ_id_GostR3411_94) */, + 810 /* 1.2.643.2.2.10 (OBJ_id_HMACGostR3411_94) */, + 811 /* 1.2.643.2.2.19 (OBJ_id_GostR3410_2001) */, + 812 /* 1.2.643.2.2.20 (OBJ_id_GostR3410_94) */, + 813 /* 1.2.643.2.2.21 (OBJ_id_Gost28147_89) */, + 815 /* 1.2.643.2.2.22 (OBJ_id_Gost28147_89_MAC) */, + 816 /* 1.2.643.2.2.23 (OBJ_id_GostR3411_94_prf) */, + 817 /* 1.2.643.2.2.98 (OBJ_id_GostR3410_2001DH) */, + 818 /* 1.2.643.2.2.99 (OBJ_id_GostR3410_94DH) */, + 1 /* 1.2.840.113549 (OBJ_rsadsi) */, + 185 /* 1.2.840.10040.4 (OBJ_X9cm) */, + 127 /* 1.3.6.1.5.5.7 (OBJ_id_pkix) */, + 505 /* 1.3.6.1.7.1.1 (OBJ_mime_mhs_headings) */, + 506 /* 1.3.6.1.7.1.2 (OBJ_mime_mhs_bodies) */, + 119 /* 1.3.36.3.3.1.2 (OBJ_ripemd160WithRSA) */, + 937 /* 1.3.132.1.11.0 (OBJ_dhSinglePass_stdDH_sha224kdf_scheme) */, + 938 /* 1.3.132.1.11.1 (OBJ_dhSinglePass_stdDH_sha256kdf_scheme) */, + 939 /* 1.3.132.1.11.2 (OBJ_dhSinglePass_stdDH_sha384kdf_scheme) */, + 940 /* 1.3.132.1.11.3 (OBJ_dhSinglePass_stdDH_sha512kdf_scheme) */, + 942 /* 1.3.132.1.14.0 (OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme) */, + 943 /* 1.3.132.1.14.1 (OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme) */, + 944 /* 1.3.132.1.14.2 (OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme) */, + 945 /* 1.3.132.1.14.3 (OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme) */, + 631 /* 2.23.42.3.3.3.1 (OBJ_setAttr_GenCryptgrm) */, + 632 /* 2.23.42.3.3.4.1 (OBJ_setAttr_T2Enc) */, + 633 /* 2.23.42.3.3.4.2 (OBJ_setAttr_T2cleartxt) */, + 634 /* 2.23.42.3.3.5.1 (OBJ_setAttr_TokICCsig) */, + 635 /* 2.23.42.3.3.5.2 (OBJ_setAttr_SecDevSig) */, + 436 /* 0.9.2342.19200300 (OBJ_ucl) */, + 820 /* 1.2.643.2.2.14.0 (OBJ_id_Gost28147_89_None_KeyMeshing) */, + 819 /* 1.2.643.2.2.14.1 (OBJ_id_Gost28147_89_CryptoPro_KeyMeshing) */, + 845 /* 1.2.643.2.2.20.1 (OBJ_id_GostR3410_94_a) */, + 846 /* 1.2.643.2.2.20.2 (OBJ_id_GostR3410_94_aBis) */, + 847 /* 1.2.643.2.2.20.3 (OBJ_id_GostR3410_94_b) */, + 848 /* 1.2.643.2.2.20.4 (OBJ_id_GostR3410_94_bBis) */, + 821 /* 1.2.643.2.2.30.0 (OBJ_id_GostR3411_94_TestParamSet) */, + 822 /* 1.2.643.2.2.30.1 (OBJ_id_GostR3411_94_CryptoProParamSet) */, + 823 /* 1.2.643.2.2.31.0 (OBJ_id_Gost28147_89_TestParamSet) */, + 824 /* 1.2.643.2.2.31.1 (OBJ_id_Gost28147_89_CryptoPro_A_ParamSet) */, + 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) + */ + , + 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) */, + 832 /* 1.2.643.2.2.32.2 (OBJ_id_GostR3410_94_CryptoPro_A_ParamSet) */, + 833 /* 1.2.643.2.2.32.3 (OBJ_id_GostR3410_94_CryptoPro_B_ParamSet) */, + 834 /* 1.2.643.2.2.32.4 (OBJ_id_GostR3410_94_CryptoPro_C_ParamSet) */, + 835 /* 1.2.643.2.2.32.5 (OBJ_id_GostR3410_94_CryptoPro_D_ParamSet) */, + 836 /* 1.2.643.2.2.33.1 (OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet) */, + 837 /* 1.2.643.2.2.33.2 (OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet) */, + 838 /* 1.2.643.2.2.33.3 (OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet) */, + 839 /* 1.2.643.2.2.35.0 (OBJ_id_GostR3410_2001_TestParamSet) */, + 840 /* 1.2.643.2.2.35.1 (OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet) */, + 841 /* 1.2.643.2.2.35.2 (OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet) */, + 842 /* 1.2.643.2.2.35.3 (OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet) */, + 843 /* 1.2.643.2.2.36.0 (OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet) */, + 844 /* 1.2.643.2.2.36.1 (OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet) */, + 2 /* 1.2.840.113549.1 (OBJ_pkcs) */, + 431 /* 1.2.840.10040.2.1 (OBJ_hold_instruction_none) */, + 432 /* 1.2.840.10040.2.2 (OBJ_hold_instruction_call_issuer) */, + 433 /* 1.2.840.10040.2.3 (OBJ_hold_instruction_reject) */, + 116 /* 1.2.840.10040.4.1 (OBJ_dsa) */, + 113 /* 1.2.840.10040.4.3 (OBJ_dsaWithSHA1) */, + 406 /* 1.2.840.10045.1.1 (OBJ_X9_62_prime_field) */, + 407 /* 1.2.840.10045.1.2 (OBJ_X9_62_characteristic_two_field) */, + 408 /* 1.2.840.10045.2.1 (OBJ_X9_62_id_ecPublicKey) */, + 416 /* 1.2.840.10045.4.1 (OBJ_ecdsa_with_SHA1) */, + 791 /* 1.2.840.10045.4.2 (OBJ_ecdsa_with_Recommended) */, + 792 /* 1.2.840.10045.4.3 (OBJ_ecdsa_with_Specified) */, + 920 /* 1.2.840.10046.2.1 (OBJ_dhpublicnumber) */, + 258 /* 1.3.6.1.5.5.7.0 (OBJ_id_pkix_mod) */, + 175 /* 1.3.6.1.5.5.7.1 (OBJ_id_pe) */, + 259 /* 1.3.6.1.5.5.7.2 (OBJ_id_qt) */, + 128 /* 1.3.6.1.5.5.7.3 (OBJ_id_kp) */, + 260 /* 1.3.6.1.5.5.7.4 (OBJ_id_it) */, + 261 /* 1.3.6.1.5.5.7.5 (OBJ_id_pkip) */, + 262 /* 1.3.6.1.5.5.7.6 (OBJ_id_alg) */, + 263 /* 1.3.6.1.5.5.7.7 (OBJ_id_cmc) */, + 264 /* 1.3.6.1.5.5.7.8 (OBJ_id_on) */, + 265 /* 1.3.6.1.5.5.7.9 (OBJ_id_pda) */, + 266 /* 1.3.6.1.5.5.7.10 (OBJ_id_aca) */, + 267 /* 1.3.6.1.5.5.7.11 (OBJ_id_qcs) */, + 268 /* 1.3.6.1.5.5.7.12 (OBJ_id_cct) */, + 662 /* 1.3.6.1.5.5.7.21 (OBJ_id_ppl) */, + 176 /* 1.3.6.1.5.5.7.48 (OBJ_id_ad) */, + 507 /* 1.3.6.1.7.1.1.1 (OBJ_id_hex_partial_message) */, + 508 /* 1.3.6.1.7.1.1.2 (OBJ_id_hex_multipart_message) */, + 57 /* 2.16.840.1.113730 (OBJ_netscape) */, + 754 /* 0.3.4401.5.3.1.9.1 (OBJ_camellia_128_ecb) */, + 766 /* 0.3.4401.5.3.1.9.3 (OBJ_camellia_128_ofb128) */, + 757 /* 0.3.4401.5.3.1.9.4 (OBJ_camellia_128_cfb128) */, + 755 /* 0.3.4401.5.3.1.9.21 (OBJ_camellia_192_ecb) */, + 767 /* 0.3.4401.5.3.1.9.23 (OBJ_camellia_192_ofb128) */, + 758 /* 0.3.4401.5.3.1.9.24 (OBJ_camellia_192_cfb128) */, + 756 /* 0.3.4401.5.3.1.9.41 (OBJ_camellia_256_ecb) */, + 768 /* 0.3.4401.5.3.1.9.43 (OBJ_camellia_256_ofb128) */, + 759 /* 0.3.4401.5.3.1.9.44 (OBJ_camellia_256_cfb128) */, + 437 /* 0.9.2342.19200300.100 (OBJ_pilot) */, + 776 /* 1.2.410.200004.1.3 (OBJ_seed_ecb) */, + 777 /* 1.2.410.200004.1.4 (OBJ_seed_cbc) */, + 779 /* 1.2.410.200004.1.5 (OBJ_seed_cfb128) */, + 778 /* 1.2.410.200004.1.6 (OBJ_seed_ofb128) */, + 852 /* 1.2.643.2.9.1.3.3 (OBJ_id_GostR3411_94_with_GostR3410_94_cc) */, + 853 /* 1.2.643.2.9.1.3.4 (OBJ_id_GostR3411_94_with_GostR3410_2001_cc) */, + 850 /* 1.2.643.2.9.1.5.3 (OBJ_id_GostR3410_94_cc) */, + 851 /* 1.2.643.2.9.1.5.4 (OBJ_id_GostR3410_2001_cc) */, + 849 /* 1.2.643.2.9.1.6.1 (OBJ_id_Gost28147_89_cc) */, + 854 /* 1.2.643.2.9.1.8.1 (OBJ_id_GostR3410_2001_ParamSet_cc) */, + 186 /* 1.2.840.113549.1.1 (OBJ_pkcs1) */, + 27 /* 1.2.840.113549.1.3 (OBJ_pkcs3) */, + 187 /* 1.2.840.113549.1.5 (OBJ_pkcs5) */, + 20 /* 1.2.840.113549.1.7 (OBJ_pkcs7) */, + 47 /* 1.2.840.113549.1.9 (OBJ_pkcs9) */, + 3 /* 1.2.840.113549.2.2 (OBJ_md2) */, + 257 /* 1.2.840.113549.2.4 (OBJ_md4) */, + 4 /* 1.2.840.113549.2.5 (OBJ_md5) */, + 797 /* 1.2.840.113549.2.6 (OBJ_hmacWithMD5) */, + 163 /* 1.2.840.113549.2.7 (OBJ_hmacWithSHA1) */, + 798 /* 1.2.840.113549.2.8 (OBJ_hmacWithSHA224) */, + 799 /* 1.2.840.113549.2.9 (OBJ_hmacWithSHA256) */, + 800 /* 1.2.840.113549.2.10 (OBJ_hmacWithSHA384) */, + 801 /* 1.2.840.113549.2.11 (OBJ_hmacWithSHA512) */, + 37 /* 1.2.840.113549.3.2 (OBJ_rc2_cbc) */, + 5 /* 1.2.840.113549.3.4 (OBJ_rc4) */, + 44 /* 1.2.840.113549.3.7 (OBJ_des_ede3_cbc) */, + 120 /* 1.2.840.113549.3.8 (OBJ_rc5_cbc) */, + 643 /* 1.2.840.113549.3.10 (OBJ_des_cdmf) */, + 680 /* 1.2.840.10045.1.2.3 (OBJ_X9_62_id_characteristic_two_basis) */, + 684 /* 1.2.840.10045.3.0.1 (OBJ_X9_62_c2pnb163v1) */, + 685 /* 1.2.840.10045.3.0.2 (OBJ_X9_62_c2pnb163v2) */, + 686 /* 1.2.840.10045.3.0.3 (OBJ_X9_62_c2pnb163v3) */, + 687 /* 1.2.840.10045.3.0.4 (OBJ_X9_62_c2pnb176v1) */, + 688 /* 1.2.840.10045.3.0.5 (OBJ_X9_62_c2tnb191v1) */, + 689 /* 1.2.840.10045.3.0.6 (OBJ_X9_62_c2tnb191v2) */, + 690 /* 1.2.840.10045.3.0.7 (OBJ_X9_62_c2tnb191v3) */, + 691 /* 1.2.840.10045.3.0.8 (OBJ_X9_62_c2onb191v4) */, + 692 /* 1.2.840.10045.3.0.9 (OBJ_X9_62_c2onb191v5) */, + 693 /* 1.2.840.10045.3.0.10 (OBJ_X9_62_c2pnb208w1) */, + 694 /* 1.2.840.10045.3.0.11 (OBJ_X9_62_c2tnb239v1) */, + 695 /* 1.2.840.10045.3.0.12 (OBJ_X9_62_c2tnb239v2) */, + 696 /* 1.2.840.10045.3.0.13 (OBJ_X9_62_c2tnb239v3) */, + 697 /* 1.2.840.10045.3.0.14 (OBJ_X9_62_c2onb239v4) */, + 698 /* 1.2.840.10045.3.0.15 (OBJ_X9_62_c2onb239v5) */, + 699 /* 1.2.840.10045.3.0.16 (OBJ_X9_62_c2pnb272w1) */, + 700 /* 1.2.840.10045.3.0.17 (OBJ_X9_62_c2pnb304w1) */, + 701 /* 1.2.840.10045.3.0.18 (OBJ_X9_62_c2tnb359v1) */, + 702 /* 1.2.840.10045.3.0.19 (OBJ_X9_62_c2pnb368w1) */, + 703 /* 1.2.840.10045.3.0.20 (OBJ_X9_62_c2tnb431r1) */, + 409 /* 1.2.840.10045.3.1.1 (OBJ_X9_62_prime192v1) */, + 410 /* 1.2.840.10045.3.1.2 (OBJ_X9_62_prime192v2) */, + 411 /* 1.2.840.10045.3.1.3 (OBJ_X9_62_prime192v3) */, + 412 /* 1.2.840.10045.3.1.4 (OBJ_X9_62_prime239v1) */, + 413 /* 1.2.840.10045.3.1.5 (OBJ_X9_62_prime239v2) */, + 414 /* 1.2.840.10045.3.1.6 (OBJ_X9_62_prime239v3) */, + 415 /* 1.2.840.10045.3.1.7 (OBJ_X9_62_prime256v1) */, + 793 /* 1.2.840.10045.4.3.1 (OBJ_ecdsa_with_SHA224) */, + 794 /* 1.2.840.10045.4.3.2 (OBJ_ecdsa_with_SHA256) */, + 795 /* 1.2.840.10045.4.3.3 (OBJ_ecdsa_with_SHA384) */, + 796 /* 1.2.840.10045.4.3.4 (OBJ_ecdsa_with_SHA512) */, + 269 /* 1.3.6.1.5.5.7.0.1 (OBJ_id_pkix1_explicit_88) */, + 270 /* 1.3.6.1.5.5.7.0.2 (OBJ_id_pkix1_implicit_88) */, + 271 /* 1.3.6.1.5.5.7.0.3 (OBJ_id_pkix1_explicit_93) */, + 272 /* 1.3.6.1.5.5.7.0.4 (OBJ_id_pkix1_implicit_93) */, + 273 /* 1.3.6.1.5.5.7.0.5 (OBJ_id_mod_crmf) */, + 274 /* 1.3.6.1.5.5.7.0.6 (OBJ_id_mod_cmc) */, + 275 /* 1.3.6.1.5.5.7.0.7 (OBJ_id_mod_kea_profile_88) */, + 276 /* 1.3.6.1.5.5.7.0.8 (OBJ_id_mod_kea_profile_93) */, + 277 /* 1.3.6.1.5.5.7.0.9 (OBJ_id_mod_cmp) */, + 278 /* 1.3.6.1.5.5.7.0.10 (OBJ_id_mod_qualified_cert_88) */, + 279 /* 1.3.6.1.5.5.7.0.11 (OBJ_id_mod_qualified_cert_93) */, + 280 /* 1.3.6.1.5.5.7.0.12 (OBJ_id_mod_attribute_cert) */, + 281 /* 1.3.6.1.5.5.7.0.13 (OBJ_id_mod_timestamp_protocol) */, + 282 /* 1.3.6.1.5.5.7.0.14 (OBJ_id_mod_ocsp) */, + 283 /* 1.3.6.1.5.5.7.0.15 (OBJ_id_mod_dvcs) */, + 284 /* 1.3.6.1.5.5.7.0.16 (OBJ_id_mod_cmp2000) */, + 177 /* 1.3.6.1.5.5.7.1.1 (OBJ_info_access) */, + 285 /* 1.3.6.1.5.5.7.1.2 (OBJ_biometricInfo) */, + 286 /* 1.3.6.1.5.5.7.1.3 (OBJ_qcStatements) */, + 287 /* 1.3.6.1.5.5.7.1.4 (OBJ_ac_auditEntity) */, + 288 /* 1.3.6.1.5.5.7.1.5 (OBJ_ac_targeting) */, + 289 /* 1.3.6.1.5.5.7.1.6 (OBJ_aaControls) */, + 290 /* 1.3.6.1.5.5.7.1.7 (OBJ_sbgp_ipAddrBlock) */, + 291 /* 1.3.6.1.5.5.7.1.8 (OBJ_sbgp_autonomousSysNum) */, + 292 /* 1.3.6.1.5.5.7.1.9 (OBJ_sbgp_routerIdentifier) */, + 397 /* 1.3.6.1.5.5.7.1.10 (OBJ_ac_proxying) */, + 398 /* 1.3.6.1.5.5.7.1.11 (OBJ_sinfo_access) */, + 663 /* 1.3.6.1.5.5.7.1.14 (OBJ_proxyCertInfo) */, + 164 /* 1.3.6.1.5.5.7.2.1 (OBJ_id_qt_cps) */, + 165 /* 1.3.6.1.5.5.7.2.2 (OBJ_id_qt_unotice) */, + 293 /* 1.3.6.1.5.5.7.2.3 (OBJ_textNotice) */, + 129 /* 1.3.6.1.5.5.7.3.1 (OBJ_server_auth) */, + 130 /* 1.3.6.1.5.5.7.3.2 (OBJ_client_auth) */, + 131 /* 1.3.6.1.5.5.7.3.3 (OBJ_code_sign) */, + 132 /* 1.3.6.1.5.5.7.3.4 (OBJ_email_protect) */, + 294 /* 1.3.6.1.5.5.7.3.5 (OBJ_ipsecEndSystem) */, + 295 /* 1.3.6.1.5.5.7.3.6 (OBJ_ipsecTunnel) */, + 296 /* 1.3.6.1.5.5.7.3.7 (OBJ_ipsecUser) */, + 133 /* 1.3.6.1.5.5.7.3.8 (OBJ_time_stamp) */, + 180 /* 1.3.6.1.5.5.7.3.9 (OBJ_OCSP_sign) */, + 297 /* 1.3.6.1.5.5.7.3.10 (OBJ_dvcs) */, + 298 /* 1.3.6.1.5.5.7.4.1 (OBJ_id_it_caProtEncCert) */, + 299 /* 1.3.6.1.5.5.7.4.2 (OBJ_id_it_signKeyPairTypes) */, + 300 /* 1.3.6.1.5.5.7.4.3 (OBJ_id_it_encKeyPairTypes) */, + 301 /* 1.3.6.1.5.5.7.4.4 (OBJ_id_it_preferredSymmAlg) */, + 302 /* 1.3.6.1.5.5.7.4.5 (OBJ_id_it_caKeyUpdateInfo) */, + 303 /* 1.3.6.1.5.5.7.4.6 (OBJ_id_it_currentCRL) */, + 304 /* 1.3.6.1.5.5.7.4.7 (OBJ_id_it_unsupportedOIDs) */, + 305 /* 1.3.6.1.5.5.7.4.8 (OBJ_id_it_subscriptionRequest) */, + 306 /* 1.3.6.1.5.5.7.4.9 (OBJ_id_it_subscriptionResponse) */, + 307 /* 1.3.6.1.5.5.7.4.10 (OBJ_id_it_keyPairParamReq) */, + 308 /* 1.3.6.1.5.5.7.4.11 (OBJ_id_it_keyPairParamRep) */, + 309 /* 1.3.6.1.5.5.7.4.12 (OBJ_id_it_revPassphrase) */, + 310 /* 1.3.6.1.5.5.7.4.13 (OBJ_id_it_implicitConfirm) */, + 311 /* 1.3.6.1.5.5.7.4.14 (OBJ_id_it_confirmWaitTime) */, + 312 /* 1.3.6.1.5.5.7.4.15 (OBJ_id_it_origPKIMessage) */, + 784 /* 1.3.6.1.5.5.7.4.16 (OBJ_id_it_suppLangTags) */, + 313 /* 1.3.6.1.5.5.7.5.1 (OBJ_id_regCtrl) */, + 314 /* 1.3.6.1.5.5.7.5.2 (OBJ_id_regInfo) */, + 323 /* 1.3.6.1.5.5.7.6.1 (OBJ_id_alg_des40) */, + 324 /* 1.3.6.1.5.5.7.6.2 (OBJ_id_alg_noSignature) */, + 325 /* 1.3.6.1.5.5.7.6.3 (OBJ_id_alg_dh_sig_hmac_sha1) */, + 326 /* 1.3.6.1.5.5.7.6.4 (OBJ_id_alg_dh_pop) */, + 327 /* 1.3.6.1.5.5.7.7.1 (OBJ_id_cmc_statusInfo) */, + 328 /* 1.3.6.1.5.5.7.7.2 (OBJ_id_cmc_identification) */, + 329 /* 1.3.6.1.5.5.7.7.3 (OBJ_id_cmc_identityProof) */, + 330 /* 1.3.6.1.5.5.7.7.4 (OBJ_id_cmc_dataReturn) */, + 331 /* 1.3.6.1.5.5.7.7.5 (OBJ_id_cmc_transactionId) */, + 332 /* 1.3.6.1.5.5.7.7.6 (OBJ_id_cmc_senderNonce) */, + 333 /* 1.3.6.1.5.5.7.7.7 (OBJ_id_cmc_recipientNonce) */, + 334 /* 1.3.6.1.5.5.7.7.8 (OBJ_id_cmc_addExtensions) */, + 335 /* 1.3.6.1.5.5.7.7.9 (OBJ_id_cmc_encryptedPOP) */, + 336 /* 1.3.6.1.5.5.7.7.10 (OBJ_id_cmc_decryptedPOP) */, + 337 /* 1.3.6.1.5.5.7.7.11 (OBJ_id_cmc_lraPOPWitness) */, + 338 /* 1.3.6.1.5.5.7.7.15 (OBJ_id_cmc_getCert) */, + 339 /* 1.3.6.1.5.5.7.7.16 (OBJ_id_cmc_getCRL) */, + 340 /* 1.3.6.1.5.5.7.7.17 (OBJ_id_cmc_revokeRequest) */, + 341 /* 1.3.6.1.5.5.7.7.18 (OBJ_id_cmc_regInfo) */, + 342 /* 1.3.6.1.5.5.7.7.19 (OBJ_id_cmc_responseInfo) */, + 343 /* 1.3.6.1.5.5.7.7.21 (OBJ_id_cmc_queryPending) */, + 344 /* 1.3.6.1.5.5.7.7.22 (OBJ_id_cmc_popLinkRandom) */, + 345 /* 1.3.6.1.5.5.7.7.23 (OBJ_id_cmc_popLinkWitness) */, + 346 /* 1.3.6.1.5.5.7.7.24 (OBJ_id_cmc_confirmCertAcceptance) */, + 347 /* 1.3.6.1.5.5.7.8.1 (OBJ_id_on_personalData) */, + 858 /* 1.3.6.1.5.5.7.8.3 (OBJ_id_on_permanentIdentifier) */, + 348 /* 1.3.6.1.5.5.7.9.1 (OBJ_id_pda_dateOfBirth) */, + 349 /* 1.3.6.1.5.5.7.9.2 (OBJ_id_pda_placeOfBirth) */, + 351 /* 1.3.6.1.5.5.7.9.3 (OBJ_id_pda_gender) */, + 352 /* 1.3.6.1.5.5.7.9.4 (OBJ_id_pda_countryOfCitizenship) */, + 353 /* 1.3.6.1.5.5.7.9.5 (OBJ_id_pda_countryOfResidence) */, + 354 /* 1.3.6.1.5.5.7.10.1 (OBJ_id_aca_authenticationInfo) */, + 355 /* 1.3.6.1.5.5.7.10.2 (OBJ_id_aca_accessIdentity) */, + 356 /* 1.3.6.1.5.5.7.10.3 (OBJ_id_aca_chargingIdentity) */, + 357 /* 1.3.6.1.5.5.7.10.4 (OBJ_id_aca_group) */, + 358 /* 1.3.6.1.5.5.7.10.5 (OBJ_id_aca_role) */, + 399 /* 1.3.6.1.5.5.7.10.6 (OBJ_id_aca_encAttrs) */, + 359 /* 1.3.6.1.5.5.7.11.1 (OBJ_id_qcs_pkixQCSyntax_v1) */, + 360 /* 1.3.6.1.5.5.7.12.1 (OBJ_id_cct_crs) */, + 361 /* 1.3.6.1.5.5.7.12.2 (OBJ_id_cct_PKIData) */, + 362 /* 1.3.6.1.5.5.7.12.3 (OBJ_id_cct_PKIResponse) */, + 664 /* 1.3.6.1.5.5.7.21.0 (OBJ_id_ppl_anyLanguage) */, + 665 /* 1.3.6.1.5.5.7.21.1 (OBJ_id_ppl_inheritAll) */, + 667 /* 1.3.6.1.5.5.7.21.2 (OBJ_Independent) */, + 178 /* 1.3.6.1.5.5.7.48.1 (OBJ_ad_OCSP) */, + 179 /* 1.3.6.1.5.5.7.48.2 (OBJ_ad_ca_issuers) */, + 363 /* 1.3.6.1.5.5.7.48.3 (OBJ_ad_timeStamping) */, + 364 /* 1.3.6.1.5.5.7.48.4 (OBJ_ad_dvcs) */, + 785 /* 1.3.6.1.5.5.7.48.5 (OBJ_caRepository) */, + 780 /* 1.3.6.1.5.5.8.1.1 (OBJ_hmac_md5) */, + 781 /* 1.3.6.1.5.5.8.1.2 (OBJ_hmac_sha1) */, + 58 /* 2.16.840.1.113730.1 (OBJ_netscape_cert_extension) */, + 59 /* 2.16.840.1.113730.2 (OBJ_netscape_data_type) */, + 438 /* 0.9.2342.19200300.100.1 (OBJ_pilotAttributeType) */, + 439 /* 0.9.2342.19200300.100.3 (OBJ_pilotAttributeSyntax) */, + 440 /* 0.9.2342.19200300.100.4 (OBJ_pilotObjectClass) */, + 441 /* 0.9.2342.19200300.100.10 (OBJ_pilotGroups) */, + 108 /* 1.2.840.113533.7.66.10 (OBJ_cast5_cbc) */, + 112 /* 1.2.840.113533.7.66.12 (OBJ_pbeWithMD5AndCast5_CBC) */, + 782 /* 1.2.840.113533.7.66.13 (OBJ_id_PasswordBasedMAC) */, + 783 /* 1.2.840.113533.7.66.30 (OBJ_id_DHBasedMac) */, + 6 /* 1.2.840.113549.1.1.1 (OBJ_rsaEncryption) */, + 7 /* 1.2.840.113549.1.1.2 (OBJ_md2WithRSAEncryption) */, + 396 /* 1.2.840.113549.1.1.3 (OBJ_md4WithRSAEncryption) */, + 8 /* 1.2.840.113549.1.1.4 (OBJ_md5WithRSAEncryption) */, + 65 /* 1.2.840.113549.1.1.5 (OBJ_sha1WithRSAEncryption) */, + 644 /* 1.2.840.113549.1.1.6 (OBJ_rsaOAEPEncryptionSET) */, + 919 /* 1.2.840.113549.1.1.7 (OBJ_rsaesOaep) */, + 911 /* 1.2.840.113549.1.1.8 (OBJ_mgf1) */, + 935 /* 1.2.840.113549.1.1.9 (OBJ_pSpecified) */, + 912 /* 1.2.840.113549.1.1.10 (OBJ_rsassaPss) */, + 668 /* 1.2.840.113549.1.1.11 (OBJ_sha256WithRSAEncryption) */, + 669 /* 1.2.840.113549.1.1.12 (OBJ_sha384WithRSAEncryption) */, + 670 /* 1.2.840.113549.1.1.13 (OBJ_sha512WithRSAEncryption) */, + 671 /* 1.2.840.113549.1.1.14 (OBJ_sha224WithRSAEncryption) */, + 28 /* 1.2.840.113549.1.3.1 (OBJ_dhKeyAgreement) */, + 9 /* 1.2.840.113549.1.5.1 (OBJ_pbeWithMD2AndDES_CBC) */, + 10 /* 1.2.840.113549.1.5.3 (OBJ_pbeWithMD5AndDES_CBC) */, + 168 /* 1.2.840.113549.1.5.4 (OBJ_pbeWithMD2AndRC2_CBC) */, + 169 /* 1.2.840.113549.1.5.6 (OBJ_pbeWithMD5AndRC2_CBC) */, + 170 /* 1.2.840.113549.1.5.10 (OBJ_pbeWithSHA1AndDES_CBC) */, + 68 /* 1.2.840.113549.1.5.11 (OBJ_pbeWithSHA1AndRC2_CBC) */, + 69 /* 1.2.840.113549.1.5.12 (OBJ_id_pbkdf2) */, + 161 /* 1.2.840.113549.1.5.13 (OBJ_pbes2) */, + 162 /* 1.2.840.113549.1.5.14 (OBJ_pbmac1) */, + 21 /* 1.2.840.113549.1.7.1 (OBJ_pkcs7_data) */, + 22 /* 1.2.840.113549.1.7.2 (OBJ_pkcs7_signed) */, + 23 /* 1.2.840.113549.1.7.3 (OBJ_pkcs7_enveloped) */, + 24 /* 1.2.840.113549.1.7.4 (OBJ_pkcs7_signedAndEnveloped) */, + 25 /* 1.2.840.113549.1.7.5 (OBJ_pkcs7_digest) */, + 26 /* 1.2.840.113549.1.7.6 (OBJ_pkcs7_encrypted) */, + 48 /* 1.2.840.113549.1.9.1 (OBJ_pkcs9_emailAddress) */, + 49 /* 1.2.840.113549.1.9.2 (OBJ_pkcs9_unstructuredName) */, + 50 /* 1.2.840.113549.1.9.3 (OBJ_pkcs9_contentType) */, + 51 /* 1.2.840.113549.1.9.4 (OBJ_pkcs9_messageDigest) */, + 52 /* 1.2.840.113549.1.9.5 (OBJ_pkcs9_signingTime) */, + 53 /* 1.2.840.113549.1.9.6 (OBJ_pkcs9_countersignature) */, + 54 /* 1.2.840.113549.1.9.7 (OBJ_pkcs9_challengePassword) */, + 55 /* 1.2.840.113549.1.9.8 (OBJ_pkcs9_unstructuredAddress) */, + 56 /* 1.2.840.113549.1.9.9 (OBJ_pkcs9_extCertAttributes) */, + 172 /* 1.2.840.113549.1.9.14 (OBJ_ext_req) */, + 167 /* 1.2.840.113549.1.9.15 (OBJ_SMIMECapabilities) */, + 188 /* 1.2.840.113549.1.9.16 (OBJ_SMIME) */, + 156 /* 1.2.840.113549.1.9.20 (OBJ_friendlyName) */, + 157 /* 1.2.840.113549.1.9.21 (OBJ_localKeyID) */, + 681 /* 1.2.840.10045.1.2.3.1 (OBJ_X9_62_onBasis) */, + 682 /* 1.2.840.10045.1.2.3.2 (OBJ_X9_62_tpBasis) */, + 683 /* 1.2.840.10045.1.2.3.3 (OBJ_X9_62_ppBasis) */, + 417 /* 1.3.6.1.4.1.311.17.1 (OBJ_ms_csp_name) */, + 856 /* 1.3.6.1.4.1.311.17.2 (OBJ_LocalKeySet) */, + 390 /* 1.3.6.1.4.1.1466.344 (OBJ_dcObject) */, + 91 /* 1.3.6.1.4.1.3029.1.2 (OBJ_bf_cbc) */, + 315 /* 1.3.6.1.5.5.7.5.1.1 (OBJ_id_regCtrl_regToken) */, + 316 /* 1.3.6.1.5.5.7.5.1.2 (OBJ_id_regCtrl_authenticator) */, + 317 /* 1.3.6.1.5.5.7.5.1.3 (OBJ_id_regCtrl_pkiPublicationInfo) */, + 318 /* 1.3.6.1.5.5.7.5.1.4 (OBJ_id_regCtrl_pkiArchiveOptions) */, + 319 /* 1.3.6.1.5.5.7.5.1.5 (OBJ_id_regCtrl_oldCertID) */, + 320 /* 1.3.6.1.5.5.7.5.1.6 (OBJ_id_regCtrl_protocolEncrKey) */, + 321 /* 1.3.6.1.5.5.7.5.2.1 (OBJ_id_regInfo_utf8Pairs) */, + 322 /* 1.3.6.1.5.5.7.5.2.2 (OBJ_id_regInfo_certReq) */, + 365 /* 1.3.6.1.5.5.7.48.1.1 (OBJ_id_pkix_OCSP_basic) */, + 366 /* 1.3.6.1.5.5.7.48.1.2 (OBJ_id_pkix_OCSP_Nonce) */, + 367 /* 1.3.6.1.5.5.7.48.1.3 (OBJ_id_pkix_OCSP_CrlID) */, + 368 /* 1.3.6.1.5.5.7.48.1.4 (OBJ_id_pkix_OCSP_acceptableResponses) */, + 369 /* 1.3.6.1.5.5.7.48.1.5 (OBJ_id_pkix_OCSP_noCheck) */, + 370 /* 1.3.6.1.5.5.7.48.1.6 (OBJ_id_pkix_OCSP_archiveCutoff) */, + 371 /* 1.3.6.1.5.5.7.48.1.7 (OBJ_id_pkix_OCSP_serviceLocator) */, + 372 /* 1.3.6.1.5.5.7.48.1.8 (OBJ_id_pkix_OCSP_extendedStatus) */, + 373 /* 1.3.6.1.5.5.7.48.1.9 (OBJ_id_pkix_OCSP_valid) */, + 374 /* 1.3.6.1.5.5.7.48.1.10 (OBJ_id_pkix_OCSP_path) */, + 375 /* 1.3.6.1.5.5.7.48.1.11 (OBJ_id_pkix_OCSP_trustRoot) */, + 921 /* 1.3.36.3.3.2.8.1.1.1 (OBJ_brainpoolP160r1) */, + 922 /* 1.3.36.3.3.2.8.1.1.2 (OBJ_brainpoolP160t1) */, + 923 /* 1.3.36.3.3.2.8.1.1.3 (OBJ_brainpoolP192r1) */, + 924 /* 1.3.36.3.3.2.8.1.1.4 (OBJ_brainpoolP192t1) */, + 925 /* 1.3.36.3.3.2.8.1.1.5 (OBJ_brainpoolP224r1) */, + 926 /* 1.3.36.3.3.2.8.1.1.6 (OBJ_brainpoolP224t1) */, + 927 /* 1.3.36.3.3.2.8.1.1.7 (OBJ_brainpoolP256r1) */, + 928 /* 1.3.36.3.3.2.8.1.1.8 (OBJ_brainpoolP256t1) */, + 929 /* 1.3.36.3.3.2.8.1.1.9 (OBJ_brainpoolP320r1) */, + 930 /* 1.3.36.3.3.2.8.1.1.10 (OBJ_brainpoolP320t1) */, + 931 /* 1.3.36.3.3.2.8.1.1.11 (OBJ_brainpoolP384r1) */, + 932 /* 1.3.36.3.3.2.8.1.1.12 (OBJ_brainpoolP384t1) */, + 933 /* 1.3.36.3.3.2.8.1.1.13 (OBJ_brainpoolP512r1) */, + 934 /* 1.3.36.3.3.2.8.1.1.14 (OBJ_brainpoolP512t1) */, + 936 /* 1.3.133.16.840.63.0.2 (OBJ_dhSinglePass_stdDH_sha1kdf_scheme) */, + 941 /* 1.3.133.16.840.63.0.3 (OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme) */ + , + 418 /* 2.16.840.1.101.3.4.1.1 (OBJ_aes_128_ecb) */, + 419 /* 2.16.840.1.101.3.4.1.2 (OBJ_aes_128_cbc) */, + 420 /* 2.16.840.1.101.3.4.1.3 (OBJ_aes_128_ofb128) */, + 421 /* 2.16.840.1.101.3.4.1.4 (OBJ_aes_128_cfb128) */, + 788 /* 2.16.840.1.101.3.4.1.5 (OBJ_id_aes128_wrap) */, + 895 /* 2.16.840.1.101.3.4.1.6 (OBJ_aes_128_gcm) */, + 896 /* 2.16.840.1.101.3.4.1.7 (OBJ_aes_128_ccm) */, + 897 /* 2.16.840.1.101.3.4.1.8 (OBJ_id_aes128_wrap_pad) */, + 422 /* 2.16.840.1.101.3.4.1.21 (OBJ_aes_192_ecb) */, + 423 /* 2.16.840.1.101.3.4.1.22 (OBJ_aes_192_cbc) */, + 424 /* 2.16.840.1.101.3.4.1.23 (OBJ_aes_192_ofb128) */, + 425 /* 2.16.840.1.101.3.4.1.24 (OBJ_aes_192_cfb128) */, + 789 /* 2.16.840.1.101.3.4.1.25 (OBJ_id_aes192_wrap) */, + 898 /* 2.16.840.1.101.3.4.1.26 (OBJ_aes_192_gcm) */, + 899 /* 2.16.840.1.101.3.4.1.27 (OBJ_aes_192_ccm) */, + 900 /* 2.16.840.1.101.3.4.1.28 (OBJ_id_aes192_wrap_pad) */, + 426 /* 2.16.840.1.101.3.4.1.41 (OBJ_aes_256_ecb) */, + 427 /* 2.16.840.1.101.3.4.1.42 (OBJ_aes_256_cbc) */, + 428 /* 2.16.840.1.101.3.4.1.43 (OBJ_aes_256_ofb128) */, + 429 /* 2.16.840.1.101.3.4.1.44 (OBJ_aes_256_cfb128) */, + 790 /* 2.16.840.1.101.3.4.1.45 (OBJ_id_aes256_wrap) */, + 901 /* 2.16.840.1.101.3.4.1.46 (OBJ_aes_256_gcm) */, + 902 /* 2.16.840.1.101.3.4.1.47 (OBJ_aes_256_ccm) */, + 903 /* 2.16.840.1.101.3.4.1.48 (OBJ_id_aes256_wrap_pad) */, + 672 /* 2.16.840.1.101.3.4.2.1 (OBJ_sha256) */, + 673 /* 2.16.840.1.101.3.4.2.2 (OBJ_sha384) */, + 674 /* 2.16.840.1.101.3.4.2.3 (OBJ_sha512) */, + 675 /* 2.16.840.1.101.3.4.2.4 (OBJ_sha224) */, + 802 /* 2.16.840.1.101.3.4.3.1 (OBJ_dsa_with_SHA224) */, + 803 /* 2.16.840.1.101.3.4.3.2 (OBJ_dsa_with_SHA256) */, + 71 /* 2.16.840.1.113730.1.1 (OBJ_netscape_cert_type) */, + 72 /* 2.16.840.1.113730.1.2 (OBJ_netscape_base_url) */, + 73 /* 2.16.840.1.113730.1.3 (OBJ_netscape_revocation_url) */, + 74 /* 2.16.840.1.113730.1.4 (OBJ_netscape_ca_revocation_url) */, + 75 /* 2.16.840.1.113730.1.7 (OBJ_netscape_renewal_url) */, + 76 /* 2.16.840.1.113730.1.8 (OBJ_netscape_ca_policy_url) */, + 77 /* 2.16.840.1.113730.1.12 (OBJ_netscape_ssl_server_name) */, + 78 /* 2.16.840.1.113730.1.13 (OBJ_netscape_comment) */, + 79 /* 2.16.840.1.113730.2.5 (OBJ_netscape_cert_sequence) */, + 139 /* 2.16.840.1.113730.4.1 (OBJ_ns_sgc) */, + 458 /* 0.9.2342.19200300.100.1.1 (OBJ_userId) */, + 459 /* 0.9.2342.19200300.100.1.2 (OBJ_textEncodedORAddress) */, + 460 /* 0.9.2342.19200300.100.1.3 (OBJ_rfc822Mailbox) */, + 461 /* 0.9.2342.19200300.100.1.4 (OBJ_info) */, + 462 /* 0.9.2342.19200300.100.1.5 (OBJ_favouriteDrink) */, + 463 /* 0.9.2342.19200300.100.1.6 (OBJ_roomNumber) */, + 464 /* 0.9.2342.19200300.100.1.7 (OBJ_photo) */, + 465 /* 0.9.2342.19200300.100.1.8 (OBJ_userClass) */, + 466 /* 0.9.2342.19200300.100.1.9 (OBJ_host) */, + 467 /* 0.9.2342.19200300.100.1.10 (OBJ_manager) */, + 468 /* 0.9.2342.19200300.100.1.11 (OBJ_documentIdentifier) */, + 469 /* 0.9.2342.19200300.100.1.12 (OBJ_documentTitle) */, + 470 /* 0.9.2342.19200300.100.1.13 (OBJ_documentVersion) */, + 471 /* 0.9.2342.19200300.100.1.14 (OBJ_documentAuthor) */, + 472 /* 0.9.2342.19200300.100.1.15 (OBJ_documentLocation) */, + 473 /* 0.9.2342.19200300.100.1.20 (OBJ_homeTelephoneNumber) */, + 474 /* 0.9.2342.19200300.100.1.21 (OBJ_secretary) */, + 475 /* 0.9.2342.19200300.100.1.22 (OBJ_otherMailbox) */, + 476 /* 0.9.2342.19200300.100.1.23 (OBJ_lastModifiedTime) */, + 477 /* 0.9.2342.19200300.100.1.24 (OBJ_lastModifiedBy) */, + 391 /* 0.9.2342.19200300.100.1.25 (OBJ_domainComponent) */, + 478 /* 0.9.2342.19200300.100.1.26 (OBJ_aRecord) */, + 479 /* 0.9.2342.19200300.100.1.27 (OBJ_pilotAttributeType27) */, + 480 /* 0.9.2342.19200300.100.1.28 (OBJ_mXRecord) */, + 481 /* 0.9.2342.19200300.100.1.29 (OBJ_nSRecord) */, + 482 /* 0.9.2342.19200300.100.1.30 (OBJ_sOARecord) */, + 483 /* 0.9.2342.19200300.100.1.31 (OBJ_cNAMERecord) */, + 484 /* 0.9.2342.19200300.100.1.37 (OBJ_associatedDomain) */, + 485 /* 0.9.2342.19200300.100.1.38 (OBJ_associatedName) */, + 486 /* 0.9.2342.19200300.100.1.39 (OBJ_homePostalAddress) */, + 487 /* 0.9.2342.19200300.100.1.40 (OBJ_personalTitle) */, + 488 /* 0.9.2342.19200300.100.1.41 (OBJ_mobileTelephoneNumber) */, + 489 /* 0.9.2342.19200300.100.1.42 (OBJ_pagerTelephoneNumber) */, + 490 /* 0.9.2342.19200300.100.1.43 (OBJ_friendlyCountryName) */, + 491 /* 0.9.2342.19200300.100.1.45 (OBJ_organizationalStatus) */, + 492 /* 0.9.2342.19200300.100.1.46 (OBJ_janetMailbox) */, + 493 /* 0.9.2342.19200300.100.1.47 (OBJ_mailPreferenceOption) */, + 494 /* 0.9.2342.19200300.100.1.48 (OBJ_buildingName) */, + 495 /* 0.9.2342.19200300.100.1.49 (OBJ_dSAQuality) */, + 496 /* 0.9.2342.19200300.100.1.50 (OBJ_singleLevelQuality) */, + 497 /* 0.9.2342.19200300.100.1.51 (OBJ_subtreeMinimumQuality) */, + 498 /* 0.9.2342.19200300.100.1.52 (OBJ_subtreeMaximumQuality) */, + 499 /* 0.9.2342.19200300.100.1.53 (OBJ_personalSignature) */, + 500 /* 0.9.2342.19200300.100.1.54 (OBJ_dITRedirect) */, + 501 /* 0.9.2342.19200300.100.1.55 (OBJ_audio) */, + 502 /* 0.9.2342.19200300.100.1.56 (OBJ_documentPublisher) */, + 442 /* 0.9.2342.19200300.100.3.4 (OBJ_iA5StringSyntax) */, + 443 /* 0.9.2342.19200300.100.3.5 (OBJ_caseIgnoreIA5StringSyntax) */, + 444 /* 0.9.2342.19200300.100.4.3 (OBJ_pilotObject) */, + 445 /* 0.9.2342.19200300.100.4.4 (OBJ_pilotPerson) */, + 446 /* 0.9.2342.19200300.100.4.5 (OBJ_account) */, + 447 /* 0.9.2342.19200300.100.4.6 (OBJ_document) */, + 448 /* 0.9.2342.19200300.100.4.7 (OBJ_room) */, + 449 /* 0.9.2342.19200300.100.4.9 (OBJ_documentSeries) */, + 392 /* 0.9.2342.19200300.100.4.13 (OBJ_Domain) */, + 450 /* 0.9.2342.19200300.100.4.14 (OBJ_rFC822localPart) */, + 451 /* 0.9.2342.19200300.100.4.15 (OBJ_dNSDomain) */, + 452 /* 0.9.2342.19200300.100.4.17 (OBJ_domainRelatedObject) */, + 453 /* 0.9.2342.19200300.100.4.18 (OBJ_friendlyCountry) */, + 454 /* 0.9.2342.19200300.100.4.19 (OBJ_simpleSecurityObject) */, + 455 /* 0.9.2342.19200300.100.4.20 (OBJ_pilotOrganization) */, + 456 /* 0.9.2342.19200300.100.4.21 (OBJ_pilotDSA) */, + 457 /* 0.9.2342.19200300.100.4.22 (OBJ_qualityLabelledData) */, + 189 /* 1.2.840.113549.1.9.16.0 (OBJ_id_smime_mod) */, + 190 /* 1.2.840.113549.1.9.16.1 (OBJ_id_smime_ct) */, + 191 /* 1.2.840.113549.1.9.16.2 (OBJ_id_smime_aa) */, + 192 /* 1.2.840.113549.1.9.16.3 (OBJ_id_smime_alg) */, + 193 /* 1.2.840.113549.1.9.16.4 (OBJ_id_smime_cd) */, + 194 /* 1.2.840.113549.1.9.16.5 (OBJ_id_smime_spq) */, + 195 /* 1.2.840.113549.1.9.16.6 (OBJ_id_smime_cti) */, + 158 /* 1.2.840.113549.1.9.22.1 (OBJ_x509Certificate) */, + 159 /* 1.2.840.113549.1.9.22.2 (OBJ_sdsiCertificate) */, + 160 /* 1.2.840.113549.1.9.23.1 (OBJ_x509Crl) */, + 144 /* 1.2.840.113549.1.12.1.1 (OBJ_pbe_WithSHA1And128BitRC4) */, + 145 /* 1.2.840.113549.1.12.1.2 (OBJ_pbe_WithSHA1And40BitRC4) */, + 146 /* 1.2.840.113549.1.12.1.3 (OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC) */, + 147 /* 1.2.840.113549.1.12.1.4 (OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC) */, + 148 /* 1.2.840.113549.1.12.1.5 (OBJ_pbe_WithSHA1And128BitRC2_CBC) */, + 149 /* 1.2.840.113549.1.12.1.6 (OBJ_pbe_WithSHA1And40BitRC2_CBC) */, + 171 /* 1.3.6.1.4.1.311.2.1.14 (OBJ_ms_ext_req) */, + 134 /* 1.3.6.1.4.1.311.2.1.21 (OBJ_ms_code_ind) */, + 135 /* 1.3.6.1.4.1.311.2.1.22 (OBJ_ms_code_com) */, + 136 /* 1.3.6.1.4.1.311.10.3.1 (OBJ_ms_ctl_sign) */, + 137 /* 1.3.6.1.4.1.311.10.3.3 (OBJ_ms_sgc) */, + 138 /* 1.3.6.1.4.1.311.10.3.4 (OBJ_ms_efs) */, + 648 /* 1.3.6.1.4.1.311.20.2.2 (OBJ_ms_smartcard_login) */, + 649 /* 1.3.6.1.4.1.311.20.2.3 (OBJ_ms_upn) */, + 751 /* 1.2.392.200011.61.1.1.1.2 (OBJ_camellia_128_cbc) */, + 752 /* 1.2.392.200011.61.1.1.1.3 (OBJ_camellia_192_cbc) */, + 753 /* 1.2.392.200011.61.1.1.1.4 (OBJ_camellia_256_cbc) */, + 907 /* 1.2.392.200011.61.1.1.3.2 (OBJ_id_camellia128_wrap) */, + 908 /* 1.2.392.200011.61.1.1.3.3 (OBJ_id_camellia192_wrap) */, + 909 /* 1.2.392.200011.61.1.1.3.4 (OBJ_id_camellia256_wrap) */, + 196 /* 1.2.840.113549.1.9.16.0.1 (OBJ_id_smime_mod_cms) */, + 197 /* 1.2.840.113549.1.9.16.0.2 (OBJ_id_smime_mod_ess) */, + 198 /* 1.2.840.113549.1.9.16.0.3 (OBJ_id_smime_mod_oid) */, + 199 /* 1.2.840.113549.1.9.16.0.4 (OBJ_id_smime_mod_msg_v3) */, + 200 /* 1.2.840.113549.1.9.16.0.5 (OBJ_id_smime_mod_ets_eSignature_88) */, + 201 /* 1.2.840.113549.1.9.16.0.6 (OBJ_id_smime_mod_ets_eSignature_97) */, + 202 /* 1.2.840.113549.1.9.16.0.7 (OBJ_id_smime_mod_ets_eSigPolicy_88) */, + 203 /* 1.2.840.113549.1.9.16.0.8 (OBJ_id_smime_mod_ets_eSigPolicy_97) */, + 204 /* 1.2.840.113549.1.9.16.1.1 (OBJ_id_smime_ct_receipt) */, + 205 /* 1.2.840.113549.1.9.16.1.2 (OBJ_id_smime_ct_authData) */, + 206 /* 1.2.840.113549.1.9.16.1.3 (OBJ_id_smime_ct_publishCert) */, + 207 /* 1.2.840.113549.1.9.16.1.4 (OBJ_id_smime_ct_TSTInfo) */, + 208 /* 1.2.840.113549.1.9.16.1.5 (OBJ_id_smime_ct_TDTInfo) */, + 209 /* 1.2.840.113549.1.9.16.1.6 (OBJ_id_smime_ct_contentInfo) */, + 210 /* 1.2.840.113549.1.9.16.1.7 (OBJ_id_smime_ct_DVCSRequestData) */, + 211 /* 1.2.840.113549.1.9.16.1.8 (OBJ_id_smime_ct_DVCSResponseData) */, + 786 /* 1.2.840.113549.1.9.16.1.9 (OBJ_id_smime_ct_compressedData) */, + 787 /* 1.2.840.113549.1.9.16.1.27 (OBJ_id_ct_asciiTextWithCRLF) */, + 212 /* 1.2.840.113549.1.9.16.2.1 (OBJ_id_smime_aa_receiptRequest) */, + 213 /* 1.2.840.113549.1.9.16.2.2 (OBJ_id_smime_aa_securityLabel) */, + 214 /* 1.2.840.113549.1.9.16.2.3 (OBJ_id_smime_aa_mlExpandHistory) */, + 215 /* 1.2.840.113549.1.9.16.2.4 (OBJ_id_smime_aa_contentHint) */, + 216 /* 1.2.840.113549.1.9.16.2.5 (OBJ_id_smime_aa_msgSigDigest) */, + 217 /* 1.2.840.113549.1.9.16.2.6 (OBJ_id_smime_aa_encapContentType) */, + 218 /* 1.2.840.113549.1.9.16.2.7 (OBJ_id_smime_aa_contentIdentifier) */, + 219 /* 1.2.840.113549.1.9.16.2.8 (OBJ_id_smime_aa_macValue) */, + 220 /* 1.2.840.113549.1.9.16.2.9 (OBJ_id_smime_aa_equivalentLabels) */, + 221 /* 1.2.840.113549.1.9.16.2.10 (OBJ_id_smime_aa_contentReference) */, + 222 /* 1.2.840.113549.1.9.16.2.11 (OBJ_id_smime_aa_encrypKeyPref) */, + 223 /* 1.2.840.113549.1.9.16.2.12 (OBJ_id_smime_aa_signingCertificate) */, + 224 /* 1.2.840.113549.1.9.16.2.13 (OBJ_id_smime_aa_smimeEncryptCerts) */, + 225 /* 1.2.840.113549.1.9.16.2.14 (OBJ_id_smime_aa_timeStampToken) */, + 226 /* 1.2.840.113549.1.9.16.2.15 (OBJ_id_smime_aa_ets_sigPolicyId) */, + 227 /* 1.2.840.113549.1.9.16.2.16 (OBJ_id_smime_aa_ets_commitmentType) */, + 228 /* 1.2.840.113549.1.9.16.2.17 (OBJ_id_smime_aa_ets_signerLocation) */, + 229 /* 1.2.840.113549.1.9.16.2.18 (OBJ_id_smime_aa_ets_signerAttr) */, + 230 /* 1.2.840.113549.1.9.16.2.19 (OBJ_id_smime_aa_ets_otherSigCert) */, + 231 /* 1.2.840.113549.1.9.16.2.20 (OBJ_id_smime_aa_ets_contentTimestamp) */, + 232 /* 1.2.840.113549.1.9.16.2.21 (OBJ_id_smime_aa_ets_CertificateRefs) */, + 233 /* 1.2.840.113549.1.9.16.2.22 (OBJ_id_smime_aa_ets_RevocationRefs) */, + 234 /* 1.2.840.113549.1.9.16.2.23 (OBJ_id_smime_aa_ets_certValues) */, + 235 /* 1.2.840.113549.1.9.16.2.24 (OBJ_id_smime_aa_ets_revocationValues) */, + 236 /* 1.2.840.113549.1.9.16.2.25 (OBJ_id_smime_aa_ets_escTimeStamp) */, + 237 /* 1.2.840.113549.1.9.16.2.26 (OBJ_id_smime_aa_ets_certCRLTimestamp) */, + 238 /* 1.2.840.113549.1.9.16.2.27 (OBJ_id_smime_aa_ets_archiveTimeStamp) */, + 239 /* 1.2.840.113549.1.9.16.2.28 (OBJ_id_smime_aa_signatureType) */, + 240 /* 1.2.840.113549.1.9.16.2.29 (OBJ_id_smime_aa_dvcs_dvc) */, + 241 /* 1.2.840.113549.1.9.16.3.1 (OBJ_id_smime_alg_ESDHwith3DES) */, + 242 /* 1.2.840.113549.1.9.16.3.2 (OBJ_id_smime_alg_ESDHwithRC2) */, + 243 /* 1.2.840.113549.1.9.16.3.3 (OBJ_id_smime_alg_3DESwrap) */, + 244 /* 1.2.840.113549.1.9.16.3.4 (OBJ_id_smime_alg_RC2wrap) */, + 245 /* 1.2.840.113549.1.9.16.3.5 (OBJ_id_smime_alg_ESDH) */, + 246 /* 1.2.840.113549.1.9.16.3.6 (OBJ_id_smime_alg_CMS3DESwrap) */, + 247 /* 1.2.840.113549.1.9.16.3.7 (OBJ_id_smime_alg_CMSRC2wrap) */, + 125 /* 1.2.840.113549.1.9.16.3.8 (OBJ_zlib_compression) */, + 893 /* 1.2.840.113549.1.9.16.3.9 (OBJ_id_alg_PWRI_KEK) */, + 248 /* 1.2.840.113549.1.9.16.4.1 (OBJ_id_smime_cd_ldap) */, + 249 /* 1.2.840.113549.1.9.16.5.1 (OBJ_id_smime_spq_ets_sqt_uri) */, + 250 /* 1.2.840.113549.1.9.16.5.2 (OBJ_id_smime_spq_ets_sqt_unotice) */, + 251 /* 1.2.840.113549.1.9.16.6.1 (OBJ_id_smime_cti_ets_proofOfOrigin) */, + 252 /* 1.2.840.113549.1.9.16.6.2 (OBJ_id_smime_cti_ets_proofOfReceipt) */, + 253 /* 1.2.840.113549.1.9.16.6.3 (OBJ_id_smime_cti_ets_proofOfDelivery) */, + 254 /* 1.2.840.113549.1.9.16.6.4 (OBJ_id_smime_cti_ets_proofOfSender) */, + 255 /* 1.2.840.113549.1.9.16.6.5 (OBJ_id_smime_cti_ets_proofOfApproval) */, + 256 /* 1.2.840.113549.1.9.16.6.6 (OBJ_id_smime_cti_ets_proofOfCreation) */, + 150 /* 1.2.840.113549.1.12.10.1.1 (OBJ_keyBag) */, + 151 /* 1.2.840.113549.1.12.10.1.2 (OBJ_pkcs8ShroudedKeyBag) */, + 152 /* 1.2.840.113549.1.12.10.1.3 (OBJ_certBag) */, + 153 /* 1.2.840.113549.1.12.10.1.4 (OBJ_crlBag) */, + 154 /* 1.2.840.113549.1.12.10.1.5 (OBJ_secretBag) */, + 155 /* 1.2.840.113549.1.12.10.1.6 (OBJ_safeContentsBag) */, + 34 /* 1.3.6.1.4.1.188.7.1.1.2 (OBJ_idea_cbc) */, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c new file mode 100644 index 0000000..303a8d9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c @@ -0,0 +1,122 @@ +/* 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 "../internal.h" + + +typedef struct { + int sign_nid; + int digest_nid; + int pkey_nid; +} nid_triple; + +static const nid_triple kTriples[] = { + // RSA PKCS#1. + {NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption}, + {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption}, + {NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption}, + {NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption}, + {NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption}, + {NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption}, + {NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption}, + // DSA. + {NID_dsaWithSHA1, NID_sha1, NID_dsa}, + {NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2}, + {NID_dsa_with_SHA224, NID_sha224, NID_dsa}, + {NID_dsa_with_SHA256, NID_sha256, NID_dsa}, + // ECDSA. + {NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey}, + // The following algorithms use more complex (or simpler) parameters. The + // digest "undef" indicates the caller should handle this explicitly. + {NID_rsassaPss, NID_undef, NID_rsaEncryption}, + {NID_ED25519, NID_undef, NID_ED25519}, +}; + +int OBJ_find_sigid_algs(int sign_nid, int *out_digest_nid, int *out_pkey_nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kTriples); i++) { + if (kTriples[i].sign_nid == sign_nid) { + if (out_digest_nid != NULL) { + *out_digest_nid = kTriples[i].digest_nid; + } + if (out_pkey_nid != NULL) { + *out_pkey_nid = kTriples[i].pkey_nid; + } + return 1; + } + } + + return 0; +} + +int OBJ_find_sigid_by_algs(int *out_sign_nid, int digest_nid, int pkey_nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kTriples); i++) { + if (kTriples[i].digest_nid == digest_nid && + kTriples[i].pkey_nid == pkey_nid) { + if (out_sign_nid != NULL) { + *out_sign_nid = kTriples[i].sign_nid; + } + return 1; + } + } + + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c.grpc_back new file mode 100644 index 0000000..21bde27 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c.grpc_back @@ -0,0 +1,122 @@ +/* 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 "../internal.h" + + +typedef struct { + int sign_nid; + int digest_nid; + int pkey_nid; +} nid_triple; + +static const nid_triple kTriples[] = { + // RSA PKCS#1. + {NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption}, + {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption}, + {NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption}, + {NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption}, + {NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption}, + {NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption}, + {NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption}, + // DSA. + {NID_dsaWithSHA1, NID_sha1, NID_dsa}, + {NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2}, + {NID_dsa_with_SHA224, NID_sha224, NID_dsa}, + {NID_dsa_with_SHA256, NID_sha256, NID_dsa}, + // ECDSA. + {NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey}, + {NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey}, + // The following algorithms use more complex (or simpler) parameters. The + // digest "undef" indicates the caller should handle this explicitly. + {NID_rsassaPss, NID_undef, NID_rsaEncryption}, + {NID_ED25519, NID_undef, NID_ED25519}, +}; + +int OBJ_find_sigid_algs(int sign_nid, int *out_digest_nid, int *out_pkey_nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kTriples); i++) { + if (kTriples[i].sign_nid == sign_nid) { + if (out_digest_nid != NULL) { + *out_digest_nid = kTriples[i].digest_nid; + } + if (out_pkey_nid != NULL) { + *out_pkey_nid = kTriples[i].pkey_nid; + } + return 1; + } + } + + return 0; +} + +int OBJ_find_sigid_by_algs(int *out_sign_nid, int digest_nid, int pkey_nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kTriples); i++) { + if (kTriples[i].digest_nid == digest_nid && + kTriples[i].pkey_nid == pkey_nid) { + if (out_sign_nid != NULL) { + *out_sign_nid = kTriples[i].sign_nid; + } + return 1; + } + } + + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c new file mode 100644 index 0000000..1cb8242 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c @@ -0,0 +1,261 @@ +/* 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). */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); +static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); +static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey); + +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 + * read in an EVP_PKEY structure with PEM_read_bio_PrivateKey() and extract + * the relevant private key: this means can handle "traditional" and PKCS#8 + * formats transparently. + */ +static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa) +{ + RSA *rtmp; + if (!key) + return NULL; + rtmp = EVP_PKEY_get1_RSA(key); + EVP_PKEY_free(key); + if (!rtmp) + return NULL; + if (rsa) { + RSA_free(*rsa); + *rsa = rtmp; + } + return rtmp; +} + +RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **rsa, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_rsa(pktmp, rsa); +} + +#ifndef OPENSSL_NO_FP_API + +RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb, void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_rsa(pktmp, rsa); +} + +#endif + +IMPLEMENT_PEM_write_cb_const(RSAPrivateKey, RSA, PEM_STRING_RSA, + RSAPrivateKey) + + +IMPLEMENT_PEM_rw_const(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, + RSAPublicKey) IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, + PEM_STRING_PUBLIC, + RSA_PUBKEY) +#ifndef OPENSSL_NO_DSA +static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa) +{ + DSA *dtmp; + if (!key) + return NULL; + dtmp = EVP_PKEY_get1_DSA(key); + EVP_PKEY_free(key); + if (!dtmp) + return NULL; + if (dsa) { + DSA_free(*dsa); + *dsa = dtmp; + } + return dtmp; +} + +DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **dsa, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ +} + +IMPLEMENT_PEM_write_cb_const(DSAPrivateKey, DSA, PEM_STRING_DSA, + DSAPrivateKey) + + IMPLEMENT_PEM_rw(DSA_PUBKEY, DSA, PEM_STRING_PUBLIC, DSA_PUBKEY) +# ifndef OPENSSL_NO_FP_API +DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ +} + +# endif + +IMPLEMENT_PEM_rw_const(DSAparams, DSA, PEM_STRING_DSAPARAMS, DSAparams) +#endif +static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey) +{ + EC_KEY *dtmp; + if (!key) + return NULL; + dtmp = EVP_PKEY_get1_EC_KEY(key); + EVP_PKEY_free(key); + if (!dtmp) + return NULL; + if (eckey) { + EC_KEY_free(*eckey); + *eckey = dtmp; + } + return dtmp; +} + +EC_KEY *PEM_read_bio_ECPrivateKey(BIO *bp, EC_KEY **key, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_eckey(pktmp, key); /* will free pktmp */ +} + +IMPLEMENT_PEM_write_cb(ECPrivateKey, EC_KEY, PEM_STRING_ECPRIVATEKEY, + ECPrivateKey) + + IMPLEMENT_PEM_rw(EC_PUBKEY, EC_KEY, PEM_STRING_PUBLIC, EC_PUBKEY) +#ifndef OPENSSL_NO_FP_API +EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_eckey(pktmp, eckey); /* will free pktmp */ +} + +#endif + +IMPLEMENT_PEM_write_const(DHparams, DH, PEM_STRING_DHPARAMS, DHparams) + + IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back new file mode 100644 index 0000000..6b40883 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back @@ -0,0 +1,261 @@ +/* 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). */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); +static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); +static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey); + +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 + * read in an EVP_PKEY structure with PEM_read_bio_PrivateKey() and extract + * the relevant private key: this means can handle "traditional" and PKCS#8 + * formats transparently. + */ +static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa) +{ + RSA *rtmp; + if (!key) + return NULL; + rtmp = EVP_PKEY_get1_RSA(key); + EVP_PKEY_free(key); + if (!rtmp) + return NULL; + if (rsa) { + RSA_free(*rsa); + *rsa = rtmp; + } + return rtmp; +} + +RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **rsa, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_rsa(pktmp, rsa); +} + +#ifndef OPENSSL_NO_FP_API + +RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb, void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_rsa(pktmp, rsa); +} + +#endif + +IMPLEMENT_PEM_write_cb_const(RSAPrivateKey, RSA, PEM_STRING_RSA, + RSAPrivateKey) + + +IMPLEMENT_PEM_rw_const(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, + RSAPublicKey) IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, + PEM_STRING_PUBLIC, + RSA_PUBKEY) +#ifndef OPENSSL_NO_DSA +static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa) +{ + DSA *dtmp; + if (!key) + return NULL; + dtmp = EVP_PKEY_get1_DSA(key); + EVP_PKEY_free(key); + if (!dtmp) + return NULL; + if (dsa) { + DSA_free(*dsa); + *dsa = dtmp; + } + return dtmp; +} + +DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **dsa, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ +} + +IMPLEMENT_PEM_write_cb_const(DSAPrivateKey, DSA, PEM_STRING_DSA, + DSAPrivateKey) + + IMPLEMENT_PEM_rw(DSA_PUBKEY, DSA, PEM_STRING_PUBLIC, DSA_PUBKEY) +# ifndef OPENSSL_NO_FP_API +DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ +} + +# endif + +IMPLEMENT_PEM_rw_const(DSAparams, DSA, PEM_STRING_DSAPARAMS, DSAparams) +#endif +static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey) +{ + EC_KEY *dtmp; + if (!key) + return NULL; + dtmp = EVP_PKEY_get1_EC_KEY(key); + EVP_PKEY_free(key); + if (!dtmp) + return NULL; + if (eckey) { + EC_KEY_free(*eckey); + *eckey = dtmp; + } + return dtmp; +} + +EC_KEY *PEM_read_bio_ECPrivateKey(BIO *bp, EC_KEY **key, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u); + return pkey_get_eckey(pktmp, key); /* will free pktmp */ +} + +IMPLEMENT_PEM_write_cb(ECPrivateKey, EC_KEY, PEM_STRING_ECPRIVATEKEY, + ECPrivateKey) + + IMPLEMENT_PEM_rw(EC_PUBKEY, EC_KEY, PEM_STRING_PUBLIC, EC_PUBKEY) +#ifndef OPENSSL_NO_FP_API +EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb, + void *u) +{ + EVP_PKEY *pktmp; + pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); + return pkey_get_eckey(pktmp, eckey); /* will free pktmp */ +} + +#endif + +IMPLEMENT_PEM_write_const(DHparams, DH, PEM_STRING_DHPARAMS, DHparams) + + IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c new file mode 100644 index 0000000..394044a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c.grpc_back new file mode 100644 index 0000000..1cda35b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c new file mode 100644 index 0000000..7414611 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c @@ -0,0 +1,777 @@ +/* crypto/pem/pem_lib.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 +#include +#include + +#include "../internal.h" + + +#define MIN_LENGTH 4 + +static int load_iv(char **fromp, unsigned char *to, int num); +static int check_pem(const char *nm, const char *name); + +void PEM_proc_type(char *buf, int type) +{ + const char *str; + + if (type == PEM_TYPE_ENCRYPTED) + str = "ENCRYPTED"; + else if (type == PEM_TYPE_MIC_CLEAR) + str = "MIC-CLEAR"; + else if (type == PEM_TYPE_MIC_ONLY) + str = "MIC-ONLY"; + else + str = "BAD-TYPE"; + + 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) +{ + static const unsigned char map[17] = "0123456789ABCDEF"; + long i; + int j; + + 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; + for (i = 0; i < len; i++) { + buf[j + i * 2] = map[(str[i] >> 4) & 0x0f]; + buf[j + i * 2 + 1] = map[(str[i]) & 0x0f]; + } + buf[j + i * 2] = '\n'; + buf[j + i * 2 + 1] = '\0'; +} + +#ifndef OPENSSL_NO_FP_API +void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, + 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 NULL; + } + void *ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); + BIO_free(b); + return ret; +} +#endif + +static int check_pem(const char *nm, const char *name) +{ + /* Normal matching nm and name */ + if (!strcmp(nm, name)) + return 1; + + /* Make PEM_STRING_EVP_PKEY match any private key */ + + if (!strcmp(name, PEM_STRING_EVP_PKEY)) { + return !strcmp(nm, PEM_STRING_PKCS8) || + !strcmp(nm, PEM_STRING_PKCS8INF) || + !strcmp(nm, PEM_STRING_RSA) || + !strcmp(nm, PEM_STRING_EC) || + !strcmp(nm, PEM_STRING_DSA); + } + + /* Permit older strings */ + + if (!strcmp(nm, PEM_STRING_X509_OLD) && !strcmp(name, PEM_STRING_X509)) + return 1; + + if (!strcmp(nm, PEM_STRING_X509_REQ_OLD) && + !strcmp(name, PEM_STRING_X509_REQ)) + return 1; + + /* Allow normal certs to be read as trusted certs */ + if (!strcmp(nm, PEM_STRING_X509) && + !strcmp(name, PEM_STRING_X509_TRUSTED)) + return 1; + + if (!strcmp(nm, PEM_STRING_X509_OLD) && + !strcmp(name, PEM_STRING_X509_TRUSTED)) + return 1; + + /* Some CAs use PKCS#7 with CERTIFICATE headers */ + if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_PKCS7)) + return 1; + + if (!strcmp(nm, PEM_STRING_PKCS7_SIGNED) && + !strcmp(name, PEM_STRING_PKCS7)) + return 1; + +#ifndef OPENSSL_NO_CMS + if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_CMS)) + return 1; + /* Allow CMS to be read from PKCS#7 headers */ + if (!strcmp(nm, PEM_STRING_PKCS7) && !strcmp(name, PEM_STRING_CMS)) + return 1; +#endif + + 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) +{ + EVP_CIPHER_INFO cipher; + char *nm = NULL, *header = NULL; + unsigned char *data = NULL; + long len; + int ret = 0; + + for (;;) { + if (!PEM_read_bio(bp, &nm, &header, &data, &len)) { + 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)) + break; + OPENSSL_free(nm); + OPENSSL_free(header); + OPENSSL_free(data); + } + if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) + goto err; + if (!PEM_do_header(&cipher, data, &len, cb, u)) + goto err; + + *pdata = data; + *plen = len; + + if (pnm) + *pnm = nm; + + ret = 1; + + err: + if (!ret || !pnm) + OPENSSL_free(nm); + OPENSSL_free(header); + if (!ret) + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +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 = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); + BIO_free(b); + return ret; +} +#endif + +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 *callback, void *u) +{ + EVP_CIPHER_CTX ctx; + int dsize = 0, i, j, ret = 0; + unsigned char *p, *data = NULL; + const char *objstr = NULL; + char buf[PEM_BUFSIZE]; + unsigned char key[EVP_MAX_KEY_LENGTH]; + unsigned char iv[EVP_MAX_IV_LENGTH]; + + if (enc != NULL) { + objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); + if (objstr == NULL || + cipher_by_name(objstr) == NULL || + EVP_CIPHER_iv_length(enc) < 8) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + } + + if ((dsize = i2d(x, NULL)) < 0) { + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + dsize = 0; + goto err; + } + /* dzise + 8 bytes are needed */ + /* actually it needs the cipher block size extra... */ + data = (unsigned char *)OPENSSL_malloc((unsigned int)dsize + 20); + if (data == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + p = data; + i = i2d(x, &p); + + if (enc != NULL) { + const unsigned iv_len = EVP_CIPHER_iv_length(enc); + + if (kstr == NULL) { + klen = 0; + if (!callback) + callback = PEM_def_callback; + klen = (*callback) (buf, PEM_BUFSIZE, 1, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_READ_KEY); + goto err; + } + kstr = (unsigned char *)buf; + } + assert(iv_len <= (int)sizeof(iv)); + if (!RAND_bytes(iv, iv_len)) /* Generate a salt */ + goto err; + /* + * The 'iv' is used as the iv and as a salt. It is NOT taken from + * the BytesToKey function + */ + if (!EVP_BytesToKey(enc, EVP_md5(), iv, kstr, klen, 1, key, NULL)) + goto err; + + if (kstr == (unsigned char *)buf) + OPENSSL_cleanse(buf, PEM_BUFSIZE); + + 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); + /* k=strlen(buf); */ + + EVP_CIPHER_CTX_init(&ctx); + ret = 1; + if (!EVP_EncryptInit_ex(&ctx, enc, NULL, key, iv) + || !EVP_EncryptUpdate(&ctx, data, &j, data, i) + || !EVP_EncryptFinal_ex(&ctx, &(data[j]), &i)) + ret = 0; + else + i += j; + EVP_CIPHER_CTX_cleanup(&ctx); + if (ret == 0) + goto err; + } else { + ret = 1; + buf[0] = '\0'; + } + i = PEM_write_bio(bp, name, buf, data, i); + if (i <= 0) + ret = 0; + err: + OPENSSL_cleanse(key, sizeof(key)); + OPENSSL_cleanse(iv, sizeof(iv)); + OPENSSL_cleanse((char *)&ctx, sizeof(ctx)); + OPENSSL_cleanse(buf, PEM_BUFSIZE); + OPENSSL_free(data); + return (ret); +} + +int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, + pem_password_cb *callback, void *u) +{ + int i = 0, j, o, klen; + long len; + EVP_CIPHER_CTX ctx; + unsigned char key[EVP_MAX_KEY_LENGTH]; + char buf[PEM_BUFSIZE]; + + len = *plen; + + if (cipher->cipher == NULL) + return (1); + + klen = 0; + if (!callback) + callback = PEM_def_callback; + klen = callback(buf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + return (0); + } + + if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]), + (unsigned char *)buf, klen, 1, key, NULL)) + return 0; + + j = (int)len; + EVP_CIPHER_CTX_init(&ctx); + o = EVP_DecryptInit_ex(&ctx, cipher->cipher, NULL, key, &(cipher->iv[0])); + if (o) + o = EVP_DecryptUpdate(&ctx, data, &i, data, j); + if (o) + o = EVP_DecryptFinal_ex(&ctx, &(data[i]), &j); + EVP_CIPHER_CTX_cleanup(&ctx); + OPENSSL_cleanse((char *)buf, sizeof(buf)); + OPENSSL_cleanse((char *)key, sizeof(key)); + if (!o) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_DECRYPT); + return (0); + } + j += i; + *plen = j; + return (1); +} + +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) +{ + const EVP_CIPHER *enc = NULL; + char *p, c; + 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) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_PROC_TYPE); + return (0); + } + header += 11; + if (*header != '4') + return (0); + header++; + if (*header != ',') + return (0); + header++; + if (strncmp(header, "ENCRYPTED", 9) != 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_ENCRYPTED); + return (0); + } + for (; (*header != '\n') && (*header != '\0'); header++) ; + if (*header == '\0') { + OPENSSL_PUT_ERROR(PEM, PEM_R_SHORT_HEADER); + return (0); + } + header++; + if (strncmp(header, "DEK-Info: ", 10) != 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_DEK_INFO); + return (0); + } + header += 10; + + p = header; + for (;;) { + c = *header; + if (!(((c >= 'A') && (c <= 'Z')) || (c == '-') || + ((c >= '0') && (c <= '9')))) + break; + header++; + } + *header = '\0'; + cipher->cipher = enc = cipher_by_name(p); + *header = c; + header++; + + if (enc == NULL) { + 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); + + return (1); +} + +static int load_iv(char **fromp, unsigned char *to, int num) +{ + int v, i; + char *from; + + from = *fromp; + for (i = 0; i < num; i++) + to[i] = 0; + num *= 2; + for (i = 0; i < num; i++) { + if ((*from >= '0') && (*from <= '9')) + v = *from - '0'; + else if ((*from >= 'A') && (*from <= 'F')) + v = *from - 'A' + 10; + else if ((*from >= 'a') && (*from <= 'f')) + v = *from - 'a' + 10; + else { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_IV_CHARS); + return (0); + } + from++; + to[i / 2] |= v << (long)((!(i & 1)) * 4); + } + + *fromp = from; + return (1); +} + +#ifndef OPENSSL_NO_FP_API +int PEM_write(FILE *fp, const char *name, const char *header, + const unsigned char *data, long len) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_write_bio(b, name, header, data, len); + BIO_free(b); + return (ret); +} +#endif + +int PEM_write_bio(BIO *bp, const char *name, const char *header, + const unsigned char *data, long len) +{ + int nlen, n, i, j, outl; + unsigned char *buf = NULL; + EVP_ENCODE_CTX ctx; + int reason = ERR_R_BUF_LIB; + + EVP_EncodeInit(&ctx); + nlen = strlen(name); + + if ((BIO_write(bp, "-----BEGIN ", 11) != 11) || + (BIO_write(bp, name, nlen) != nlen) || + (BIO_write(bp, "-----\n", 6) != 6)) + goto err; + + i = strlen(header); + if (i > 0) { + if ((BIO_write(bp, header, i) != i) || (BIO_write(bp, "\n", 1) != 1)) + goto err; + } + + buf = OPENSSL_malloc(PEM_BUFSIZE * 8); + if (buf == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + + i = j = 0; + while (len > 0) { + n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len); + EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n); + if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl)) + goto err; + i += outl; + len -= n; + j += n; + } + EVP_EncodeFinal(&ctx, buf, &outl); + if ((outl > 0) && (BIO_write(bp, (char *)buf, outl) != outl)) + goto err; + OPENSSL_free(buf); + buf = NULL; + if ((BIO_write(bp, "-----END ", 9) != 9) || + (BIO_write(bp, name, nlen) != nlen) || + (BIO_write(bp, "-----\n", 6) != 6)) + goto err; + return (i + outl); + err: + if (buf) { + OPENSSL_free(buf); + } + OPENSSL_PUT_ERROR(PEM, reason); + return (0); +} + +#ifndef OPENSSL_NO_FP_API +int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, + long *len) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_read_bio(b, name, header, data, len); + BIO_free(b); + return (ret); +} +#endif + +int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, + long *len) +{ + EVP_ENCODE_CTX ctx; + int end = 0, i, k, bl = 0, hl = 0, nohead = 0; + char buf[256]; + BUF_MEM *nameB; + BUF_MEM *headerB; + BUF_MEM *dataB, *tmpB; + + nameB = BUF_MEM_new(); + headerB = BUF_MEM_new(); + dataB = BUF_MEM_new(); + if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL)) { + BUF_MEM_free(nameB); + BUF_MEM_free(headerB); + BUF_MEM_free(dataB); + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + return (0); + } + + buf[254] = '\0'; + for (;;) { + i = BIO_gets(bp, buf, 254); + + if (i <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NO_START_LINE); + goto err; + } + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (strncmp(buf, "-----BEGIN ", 11) == 0) { + i = strlen(&(buf[11])); + + if (strncmp(&(buf[11 + i - 6]), "-----\n", 6) != 0) + continue; + if (!BUF_MEM_grow(nameB, i + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(nameB->data, &(buf[11]), i - 6); + nameB->data[i - 6] = '\0'; + break; + } + } + hl = 0; + if (!BUF_MEM_grow(headerB, 256)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + headerB->data[0] = '\0'; + for (;;) { + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (buf[0] == '\n') + break; + if (!BUF_MEM_grow(headerB, hl + i + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + if (strncmp(buf, "-----END ", 9) == 0) { + nohead = 1; + break; + } + OPENSSL_memcpy(&(headerB->data[hl]), buf, i); + headerB->data[hl + i] = '\0'; + hl += i; + } + + bl = 0; + if (!BUF_MEM_grow(dataB, 1024)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + dataB->data[0] = '\0'; + if (!nohead) { + for (;;) { + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (i != 65) + end = 1; + if (strncmp(buf, "-----END ", 9) == 0) + break; + if (i > 65) + break; + if (!BUF_MEM_grow_clean(dataB, i + bl + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(&(dataB->data[bl]), buf, i); + dataB->data[bl + i] = '\0'; + bl += i; + if (end) { + buf[0] = '\0'; + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + break; + } + } + } else { + tmpB = headerB; + headerB = dataB; + dataB = tmpB; + bl = hl; + } + i = strlen(nameB->data); + if ((strncmp(buf, "-----END ", 9) != 0) || + (strncmp(nameB->data, &(buf[9]), i) != 0) || + (strncmp(&(buf[9 + i]), "-----\n", 6) != 0)) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_END_LINE); + goto err; + } + + EVP_DecodeInit(&ctx); + i = EVP_DecodeUpdate(&ctx, + (unsigned char *)dataB->data, &bl, + (unsigned char *)dataB->data, bl); + if (i < 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_BASE64_DECODE); + goto err; + } + i = EVP_DecodeFinal(&ctx, (unsigned char *)&(dataB->data[bl]), &k); + if (i < 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_BASE64_DECODE); + goto err; + } + bl += k; + + if (bl == 0) + goto err; + *name = nameB->data; + *header = headerB->data; + *data = (unsigned char *)dataB->data; + *len = bl; + OPENSSL_free(nameB); + OPENSSL_free(headerB); + OPENSSL_free(dataB); + return (1); + err: + BUF_MEM_free(nameB); + BUF_MEM_free(headerB); + BUF_MEM_free(dataB); + return (0); +} + +int PEM_def_callback(char *buf, int size, int rwflag, void *userdata) +{ + if (!buf || !userdata || size < 0) { + return 0; + } + size_t len = strlen((char *)userdata); + if (len >= (size_t)size) { + return 0; + } + OPENSSL_strlcpy(buf, userdata, (size_t)size); + return len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back new file mode 100644 index 0000000..00c0e0a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back @@ -0,0 +1,777 @@ +/* crypto/pem/pem_lib.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 +#include +#include + +#include "../internal.h" + + +#define MIN_LENGTH 4 + +static int load_iv(char **fromp, unsigned char *to, int num); +static int check_pem(const char *nm, const char *name); + +void PEM_proc_type(char *buf, int type) +{ + const char *str; + + if (type == PEM_TYPE_ENCRYPTED) + str = "ENCRYPTED"; + else if (type == PEM_TYPE_MIC_CLEAR) + str = "MIC-CLEAR"; + else if (type == PEM_TYPE_MIC_ONLY) + str = "MIC-ONLY"; + else + str = "BAD-TYPE"; + + 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) +{ + static const unsigned char map[17] = "0123456789ABCDEF"; + long i; + int j; + + 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; + for (i = 0; i < len; i++) { + buf[j + i * 2] = map[(str[i] >> 4) & 0x0f]; + buf[j + i * 2 + 1] = map[(str[i]) & 0x0f]; + } + buf[j + i * 2] = '\n'; + buf[j + i * 2 + 1] = '\0'; +} + +#ifndef OPENSSL_NO_FP_API +void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, + 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 NULL; + } + void *ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); + BIO_free(b); + return ret; +} +#endif + +static int check_pem(const char *nm, const char *name) +{ + /* Normal matching nm and name */ + if (!strcmp(nm, name)) + return 1; + + /* Make PEM_STRING_EVP_PKEY match any private key */ + + if (!strcmp(name, PEM_STRING_EVP_PKEY)) { + return !strcmp(nm, PEM_STRING_PKCS8) || + !strcmp(nm, PEM_STRING_PKCS8INF) || + !strcmp(nm, PEM_STRING_RSA) || + !strcmp(nm, PEM_STRING_EC) || + !strcmp(nm, PEM_STRING_DSA); + } + + /* Permit older strings */ + + if (!strcmp(nm, PEM_STRING_X509_OLD) && !strcmp(name, PEM_STRING_X509)) + return 1; + + if (!strcmp(nm, PEM_STRING_X509_REQ_OLD) && + !strcmp(name, PEM_STRING_X509_REQ)) + return 1; + + /* Allow normal certs to be read as trusted certs */ + if (!strcmp(nm, PEM_STRING_X509) && + !strcmp(name, PEM_STRING_X509_TRUSTED)) + return 1; + + if (!strcmp(nm, PEM_STRING_X509_OLD) && + !strcmp(name, PEM_STRING_X509_TRUSTED)) + return 1; + + /* Some CAs use PKCS#7 with CERTIFICATE headers */ + if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_PKCS7)) + return 1; + + if (!strcmp(nm, PEM_STRING_PKCS7_SIGNED) && + !strcmp(name, PEM_STRING_PKCS7)) + return 1; + +#ifndef OPENSSL_NO_CMS + if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_CMS)) + return 1; + /* Allow CMS to be read from PKCS#7 headers */ + if (!strcmp(nm, PEM_STRING_PKCS7) && !strcmp(name, PEM_STRING_CMS)) + return 1; +#endif + + 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) +{ + EVP_CIPHER_INFO cipher; + char *nm = NULL, *header = NULL; + unsigned char *data = NULL; + long len; + int ret = 0; + + for (;;) { + if (!PEM_read_bio(bp, &nm, &header, &data, &len)) { + 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)) + break; + OPENSSL_free(nm); + OPENSSL_free(header); + OPENSSL_free(data); + } + if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) + goto err; + if (!PEM_do_header(&cipher, data, &len, cb, u)) + goto err; + + *pdata = data; + *plen = len; + + if (pnm) + *pnm = nm; + + ret = 1; + + err: + if (!ret || !pnm) + OPENSSL_free(nm); + OPENSSL_free(header); + if (!ret) + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +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 = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); + BIO_free(b); + return ret; +} +#endif + +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 *callback, void *u) +{ + EVP_CIPHER_CTX ctx; + int dsize = 0, i, j, ret = 0; + unsigned char *p, *data = NULL; + const char *objstr = NULL; + char buf[PEM_BUFSIZE]; + unsigned char key[EVP_MAX_KEY_LENGTH]; + unsigned char iv[EVP_MAX_IV_LENGTH]; + + if (enc != NULL) { + objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); + if (objstr == NULL || + cipher_by_name(objstr) == NULL || + EVP_CIPHER_iv_length(enc) < 8) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + } + + if ((dsize = i2d(x, NULL)) < 0) { + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + dsize = 0; + goto err; + } + /* dzise + 8 bytes are needed */ + /* actually it needs the cipher block size extra... */ + data = (unsigned char *)OPENSSL_malloc((unsigned int)dsize + 20); + if (data == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + p = data; + i = i2d(x, &p); + + if (enc != NULL) { + const unsigned iv_len = EVP_CIPHER_iv_length(enc); + + if (kstr == NULL) { + klen = 0; + if (!callback) + callback = PEM_def_callback; + klen = (*callback) (buf, PEM_BUFSIZE, 1, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_READ_KEY); + goto err; + } + kstr = (unsigned char *)buf; + } + assert(iv_len <= (int)sizeof(iv)); + if (!RAND_bytes(iv, iv_len)) /* Generate a salt */ + goto err; + /* + * The 'iv' is used as the iv and as a salt. It is NOT taken from + * the BytesToKey function + */ + if (!EVP_BytesToKey(enc, EVP_md5(), iv, kstr, klen, 1, key, NULL)) + goto err; + + if (kstr == (unsigned char *)buf) + OPENSSL_cleanse(buf, PEM_BUFSIZE); + + 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); + /* k=strlen(buf); */ + + EVP_CIPHER_CTX_init(&ctx); + ret = 1; + if (!EVP_EncryptInit_ex(&ctx, enc, NULL, key, iv) + || !EVP_EncryptUpdate(&ctx, data, &j, data, i) + || !EVP_EncryptFinal_ex(&ctx, &(data[j]), &i)) + ret = 0; + else + i += j; + EVP_CIPHER_CTX_cleanup(&ctx); + if (ret == 0) + goto err; + } else { + ret = 1; + buf[0] = '\0'; + } + i = PEM_write_bio(bp, name, buf, data, i); + if (i <= 0) + ret = 0; + err: + OPENSSL_cleanse(key, sizeof(key)); + OPENSSL_cleanse(iv, sizeof(iv)); + OPENSSL_cleanse((char *)&ctx, sizeof(ctx)); + OPENSSL_cleanse(buf, PEM_BUFSIZE); + OPENSSL_free(data); + return (ret); +} + +int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, + pem_password_cb *callback, void *u) +{ + int i = 0, j, o, klen; + long len; + EVP_CIPHER_CTX ctx; + unsigned char key[EVP_MAX_KEY_LENGTH]; + char buf[PEM_BUFSIZE]; + + len = *plen; + + if (cipher->cipher == NULL) + return (1); + + klen = 0; + if (!callback) + callback = PEM_def_callback; + klen = callback(buf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + return (0); + } + + if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]), + (unsigned char *)buf, klen, 1, key, NULL)) + return 0; + + j = (int)len; + EVP_CIPHER_CTX_init(&ctx); + o = EVP_DecryptInit_ex(&ctx, cipher->cipher, NULL, key, &(cipher->iv[0])); + if (o) + o = EVP_DecryptUpdate(&ctx, data, &i, data, j); + if (o) + o = EVP_DecryptFinal_ex(&ctx, &(data[i]), &j); + EVP_CIPHER_CTX_cleanup(&ctx); + OPENSSL_cleanse((char *)buf, sizeof(buf)); + OPENSSL_cleanse((char *)key, sizeof(key)); + if (!o) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_DECRYPT); + return (0); + } + j += i; + *plen = j; + return (1); +} + +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) +{ + const EVP_CIPHER *enc = NULL; + char *p, c; + 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) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_PROC_TYPE); + return (0); + } + header += 11; + if (*header != '4') + return (0); + header++; + if (*header != ',') + return (0); + header++; + if (strncmp(header, "ENCRYPTED", 9) != 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_ENCRYPTED); + return (0); + } + for (; (*header != '\n') && (*header != '\0'); header++) ; + if (*header == '\0') { + OPENSSL_PUT_ERROR(PEM, PEM_R_SHORT_HEADER); + return (0); + } + header++; + if (strncmp(header, "DEK-Info: ", 10) != 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NOT_DEK_INFO); + return (0); + } + header += 10; + + p = header; + for (;;) { + c = *header; + if (!(((c >= 'A') && (c <= 'Z')) || (c == '-') || + ((c >= '0') && (c <= '9')))) + break; + header++; + } + *header = '\0'; + cipher->cipher = enc = cipher_by_name(p); + *header = c; + header++; + + if (enc == NULL) { + 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); + + return (1); +} + +static int load_iv(char **fromp, unsigned char *to, int num) +{ + int v, i; + char *from; + + from = *fromp; + for (i = 0; i < num; i++) + to[i] = 0; + num *= 2; + for (i = 0; i < num; i++) { + if ((*from >= '0') && (*from <= '9')) + v = *from - '0'; + else if ((*from >= 'A') && (*from <= 'F')) + v = *from - 'A' + 10; + else if ((*from >= 'a') && (*from <= 'f')) + v = *from - 'a' + 10; + else { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_IV_CHARS); + return (0); + } + from++; + to[i / 2] |= v << (long)((!(i & 1)) * 4); + } + + *fromp = from; + return (1); +} + +#ifndef OPENSSL_NO_FP_API +int PEM_write(FILE *fp, const char *name, const char *header, + const unsigned char *data, long len) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_write_bio(b, name, header, data, len); + BIO_free(b); + return (ret); +} +#endif + +int PEM_write_bio(BIO *bp, const char *name, const char *header, + const unsigned char *data, long len) +{ + int nlen, n, i, j, outl; + unsigned char *buf = NULL; + EVP_ENCODE_CTX ctx; + int reason = ERR_R_BUF_LIB; + + EVP_EncodeInit(&ctx); + nlen = strlen(name); + + if ((BIO_write(bp, "-----BEGIN ", 11) != 11) || + (BIO_write(bp, name, nlen) != nlen) || + (BIO_write(bp, "-----\n", 6) != 6)) + goto err; + + i = strlen(header); + if (i > 0) { + if ((BIO_write(bp, header, i) != i) || (BIO_write(bp, "\n", 1) != 1)) + goto err; + } + + buf = OPENSSL_malloc(PEM_BUFSIZE * 8); + if (buf == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } + + i = j = 0; + while (len > 0) { + n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len); + EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n); + if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl)) + goto err; + i += outl; + len -= n; + j += n; + } + EVP_EncodeFinal(&ctx, buf, &outl); + if ((outl > 0) && (BIO_write(bp, (char *)buf, outl) != outl)) + goto err; + OPENSSL_free(buf); + buf = NULL; + if ((BIO_write(bp, "-----END ", 9) != 9) || + (BIO_write(bp, name, nlen) != nlen) || + (BIO_write(bp, "-----\n", 6) != 6)) + goto err; + return (i + outl); + err: + if (buf) { + OPENSSL_free(buf); + } + OPENSSL_PUT_ERROR(PEM, reason); + return (0); +} + +#ifndef OPENSSL_NO_FP_API +int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, + long *len) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_read_bio(b, name, header, data, len); + BIO_free(b); + return (ret); +} +#endif + +int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, + long *len) +{ + EVP_ENCODE_CTX ctx; + int end = 0, i, k, bl = 0, hl = 0, nohead = 0; + char buf[256]; + BUF_MEM *nameB; + BUF_MEM *headerB; + BUF_MEM *dataB, *tmpB; + + nameB = BUF_MEM_new(); + headerB = BUF_MEM_new(); + dataB = BUF_MEM_new(); + if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL)) { + BUF_MEM_free(nameB); + BUF_MEM_free(headerB); + BUF_MEM_free(dataB); + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + return (0); + } + + buf[254] = '\0'; + for (;;) { + i = BIO_gets(bp, buf, 254); + + if (i <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_NO_START_LINE); + goto err; + } + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (strncmp(buf, "-----BEGIN ", 11) == 0) { + i = strlen(&(buf[11])); + + if (strncmp(&(buf[11 + i - 6]), "-----\n", 6) != 0) + continue; + if (!BUF_MEM_grow(nameB, i + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(nameB->data, &(buf[11]), i - 6); + nameB->data[i - 6] = '\0'; + break; + } + } + hl = 0; + if (!BUF_MEM_grow(headerB, 256)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + headerB->data[0] = '\0'; + for (;;) { + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (buf[0] == '\n') + break; + if (!BUF_MEM_grow(headerB, hl + i + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + if (strncmp(buf, "-----END ", 9) == 0) { + nohead = 1; + break; + } + OPENSSL_memcpy(&(headerB->data[hl]), buf, i); + headerB->data[hl + i] = '\0'; + hl += i; + } + + bl = 0; + if (!BUF_MEM_grow(dataB, 1024)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + dataB->data[0] = '\0'; + if (!nohead) { + for (;;) { + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + if (i != 65) + end = 1; + if (strncmp(buf, "-----END ", 9) == 0) + break; + if (i > 65) + break; + if (!BUF_MEM_grow_clean(dataB, i + bl + 9)) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memcpy(&(dataB->data[bl]), buf, i); + dataB->data[bl + i] = '\0'; + bl += i; + if (end) { + buf[0] = '\0'; + i = BIO_gets(bp, buf, 254); + if (i <= 0) + break; + + while ((i >= 0) && (buf[i] <= ' ')) + i--; + buf[++i] = '\n'; + buf[++i] = '\0'; + + break; + } + } + } else { + tmpB = headerB; + headerB = dataB; + dataB = tmpB; + bl = hl; + } + i = strlen(nameB->data); + if ((strncmp(buf, "-----END ", 9) != 0) || + (strncmp(nameB->data, &(buf[9]), i) != 0) || + (strncmp(&(buf[9 + i]), "-----\n", 6) != 0)) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_END_LINE); + goto err; + } + + EVP_DecodeInit(&ctx); + i = EVP_DecodeUpdate(&ctx, + (unsigned char *)dataB->data, &bl, + (unsigned char *)dataB->data, bl); + if (i < 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_BASE64_DECODE); + goto err; + } + i = EVP_DecodeFinal(&ctx, (unsigned char *)&(dataB->data[bl]), &k); + if (i < 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_BASE64_DECODE); + goto err; + } + bl += k; + + if (bl == 0) + goto err; + *name = nameB->data; + *header = headerB->data; + *data = (unsigned char *)dataB->data; + *len = bl; + OPENSSL_free(nameB); + OPENSSL_free(headerB); + OPENSSL_free(dataB); + return (1); + err: + BUF_MEM_free(nameB); + BUF_MEM_free(headerB); + BUF_MEM_free(dataB); + return (0); +} + +int PEM_def_callback(char *buf, int size, int rwflag, void *userdata) +{ + if (!buf || !userdata || size < 0) { + return 0; + } + size_t len = strlen((char *)userdata); + if (len >= (size_t)size) { + return 0; + } + OPENSSL_strlcpy(buf, userdata, (size_t)size); + return len; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c new file mode 100644 index 0000000..d9df9c1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c @@ -0,0 +1,87 @@ +/* crypto/pem/pem_oth.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 + +/* Handle 'other' PEMs: not private keys */ + +void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, + pem_password_cb *cb, void *u) +{ + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + char *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, NULL, name, bp, cb, u)) + return NULL; + p = data; + ret = d2i(x, &p, len); + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + OPENSSL_free(data); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back new file mode 100644 index 0000000..797f822 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back @@ -0,0 +1,87 @@ +/* crypto/pem/pem_oth.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 + +/* Handle 'other' PEMs: not private keys */ + +void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, + pem_password_cb *cb, void *u) +{ + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + char *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, NULL, name, bp, cb, u)) + return NULL; + p = data; + ret = d2i(x, &p, len); + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + OPENSSL_free(data); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c new file mode 100644 index 0000000..507b8e1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c @@ -0,0 +1,257 @@ +/* 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 + +static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, + int nid, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u); +static int do_pk8pkey_fp(FILE *bp, EVP_PKEY *x, int isder, + int nid, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u); + +/* + * These functions write a private key in PKCS#8 format: it is a "drop in" + * replacement for PEM_write_bio_PrivateKey() and friends. As usual if 'enc' + * is NULL then it uses the unencrypted private key form. The 'nid' versions + * uses PKCS#5 v1.5 PBE algorithms whereas the others use PKCS#5 v2.0. + */ + +int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_bio_PKCS8PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 1, nid, NULL, kstr, klen, cb, u); +} + +static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, + const EVP_CIPHER *enc, char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + X509_SIG *p8; + PKCS8_PRIV_KEY_INFO *p8inf; + char buf[PEM_BUFSIZE]; + int ret; + if (!(p8inf = EVP_PKEY2PKCS8(x))) { + OPENSSL_PUT_ERROR(PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY); + return 0; + } + if (enc || (nid != -1)) { + if (!kstr) { + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(buf, PEM_BUFSIZE, 1, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_READ_KEY); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return 0; + } + + kstr = buf; + } + p8 = PKCS8_encrypt(nid, enc, kstr, klen, NULL, 0, 0, p8inf); + if (kstr == buf) + OPENSSL_cleanse(buf, klen); + PKCS8_PRIV_KEY_INFO_free(p8inf); + if (isder) + ret = i2d_PKCS8_bio(bp, p8); + else + ret = PEM_write_bio_PKCS8(bp, p8); + X509_SIG_free(p8); + return ret; + } else { + if (isder) + ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); + else + ret = PEM_write_bio_PKCS8_PRIV_KEY_INFO(bp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; + } +} + +EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + PKCS8_PRIV_KEY_INFO *p8inf = NULL; + X509_SIG *p8 = NULL; + int klen; + EVP_PKEY *ret; + char psbuf[PEM_BUFSIZE]; + p8 = d2i_PKCS8_bio(bp, NULL); + if (!p8) + return NULL; + + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(psbuf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + X509_SIG_free(p8); + return NULL; + } + p8inf = PKCS8_decrypt(p8, psbuf, klen); + X509_SIG_free(p8); + OPENSSL_cleanse(psbuf, klen); + if (!p8inf) + return NULL; + ret = EVP_PKCS82PKEY(p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + if (!ret) + return NULL; + if (x) { + if (*x) + EVP_PKEY_free(*x); + *x = ret; + } + return ret; +} + +#ifndef OPENSSL_NO_FP_API + +int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 0, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, + void *u) +{ + return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u); +} + +static int do_pk8pkey_fp(FILE *fp, EVP_PKEY *x, int isder, int nid, + const EVP_CIPHER *enc, char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + BIO *bp; + int ret; + if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return (0); + } + ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u); + BIO_free(bp); + return ret; +} + +EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + BIO *bp; + EVP_PKEY *ret; + if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return NULL; + } + ret = d2i_PKCS8PrivateKey_bio(bp, x, cb, u); + BIO_free(bp); + return ret; +} + +#endif + +IMPLEMENT_PEM_rw(PKCS8, X509_SIG, PEM_STRING_PKCS8, X509_SIG) + + +IMPLEMENT_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, + PKCS8_PRIV_KEY_INFO) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back new file mode 100644 index 0000000..819a329 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back @@ -0,0 +1,257 @@ +/* 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 + +static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, + int nid, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u); +static int do_pk8pkey_fp(FILE *bp, EVP_PKEY *x, int isder, + int nid, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u); + +/* + * These functions write a private key in PKCS#8 format: it is a "drop in" + * replacement for PEM_write_bio_PrivateKey() and friends. As usual if 'enc' + * is NULL then it uses the unencrypted private key form. The 'nid' versions + * uses PKCS#5 v1.5 PBE algorithms whereas the others use PKCS#5 v2.0. + */ + +int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_bio_PKCS8PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey(bp, x, 1, nid, NULL, kstr, klen, cb, u); +} + +static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, + const EVP_CIPHER *enc, char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + X509_SIG *p8; + PKCS8_PRIV_KEY_INFO *p8inf; + char buf[PEM_BUFSIZE]; + int ret; + if (!(p8inf = EVP_PKEY2PKCS8(x))) { + OPENSSL_PUT_ERROR(PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY); + return 0; + } + if (enc || (nid != -1)) { + if (!kstr) { + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(buf, PEM_BUFSIZE, 1, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_READ_KEY); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return 0; + } + + kstr = buf; + } + p8 = PKCS8_encrypt(nid, enc, kstr, klen, NULL, 0, 0, p8inf); + if (kstr == buf) + OPENSSL_cleanse(buf, klen); + PKCS8_PRIV_KEY_INFO_free(p8inf); + if (isder) + ret = i2d_PKCS8_bio(bp, p8); + else + ret = PEM_write_bio_PKCS8(bp, p8); + X509_SIG_free(p8); + return ret; + } else { + if (isder) + ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); + else + ret = PEM_write_bio_PKCS8_PRIV_KEY_INFO(bp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; + } +} + +EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + PKCS8_PRIV_KEY_INFO *p8inf = NULL; + X509_SIG *p8 = NULL; + int klen; + EVP_PKEY *ret; + char psbuf[PEM_BUFSIZE]; + p8 = d2i_PKCS8_bio(bp, NULL); + if (!p8) + return NULL; + + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(psbuf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + X509_SIG_free(p8); + return NULL; + } + p8inf = PKCS8_decrypt(p8, psbuf, klen); + X509_SIG_free(p8); + OPENSSL_cleanse(psbuf, klen); + if (!p8inf) + return NULL; + ret = EVP_PKCS82PKEY(p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + if (!ret) + return NULL; + if (x) { + if (*x) + EVP_PKEY_free(*x); + *x = ret; + } + return ret; +} + +#ifndef OPENSSL_NO_FP_API + +int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u); +} + +int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return do_pk8pkey_fp(fp, x, 0, nid, NULL, kstr, klen, cb, u); +} + +int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cb, + void *u) +{ + return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u); +} + +static int do_pk8pkey_fp(FILE *fp, EVP_PKEY *x, int isder, int nid, + const EVP_CIPHER *enc, char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + BIO *bp; + int ret; + if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return (0); + } + ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u); + BIO_free(bp); + return ret; +} + +EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + BIO *bp; + EVP_PKEY *ret; + if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return NULL; + } + ret = d2i_PKCS8PrivateKey_bio(bp, x, cb, u); + BIO_free(bp); + return ret; +} + +#endif + +IMPLEMENT_PEM_rw(PKCS8, X509_SIG, PEM_STRING_PKCS8, X509_SIG) + + +IMPLEMENT_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, + PKCS8_PRIV_KEY_INFO) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c new file mode 100644 index 0000000..a7160a6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c @@ -0,0 +1,218 @@ +/* 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 + +EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + char *nm = NULL; + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + EVP_PKEY *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_EVP_PKEY, bp, cb, u)) + return NULL; + p = data; + + if (strcmp(nm, PEM_STRING_PKCS8INF) == 0) { + PKCS8_PRIV_KEY_INFO *p8inf; + p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len); + if (!p8inf) + goto p8err; + ret = EVP_PKCS82PKEY(p8inf); + if (x) { + if (*x) + EVP_PKEY_free((EVP_PKEY *)*x); + *x = ret; + } + PKCS8_PRIV_KEY_INFO_free(p8inf); + } else if (strcmp(nm, PEM_STRING_PKCS8) == 0) { + PKCS8_PRIV_KEY_INFO *p8inf; + X509_SIG *p8; + int klen; + char psbuf[PEM_BUFSIZE]; + p8 = d2i_X509_SIG(NULL, &p, len); + if (!p8) + goto p8err; + + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(psbuf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + X509_SIG_free(p8); + goto err; + } + p8inf = PKCS8_decrypt(p8, psbuf, klen); + X509_SIG_free(p8); + OPENSSL_cleanse(psbuf, klen); + if (!p8inf) + goto p8err; + ret = EVP_PKCS82PKEY(p8inf); + if (x) { + if (*x) + EVP_PKEY_free((EVP_PKEY *)*x); + *x = ret; + } + PKCS8_PRIV_KEY_INFO_free(p8inf); + } else if (strcmp(nm, PEM_STRING_RSA) == 0) { + /* TODO(davidben): d2i_PrivateKey parses PKCS#8 along with the + * standalone format. This and the cases below probably should not + * accept PKCS#8. */ + ret = d2i_PrivateKey(EVP_PKEY_RSA, x, &p, len); + } else if (strcmp(nm, PEM_STRING_EC) == 0) { + ret = d2i_PrivateKey(EVP_PKEY_EC, x, &p, len); + } else if (strcmp(nm, PEM_STRING_DSA) == 0) { + ret = d2i_PrivateKey(EVP_PKEY_DSA, x, &p, len); + } + p8err: + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + + err: + OPENSSL_free(nm); + OPENSSL_free(data); + return (ret); +} + +int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + unsigned char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return PEM_write_bio_PKCS8PrivateKey(bp, x, enc, (char *)kstr, klen, cb, u); +} + +#ifndef OPENSSL_NO_FP_API +EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, 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 NULL; + } + EVP_PKEY *ret = PEM_read_bio_PrivateKey(b, x, cb, u); + BIO_free(b); + 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 = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); + BIO_free(b); + return ret; +} + +#endif + +/* Transparently read in PKCS#3 or X9.42 DH parameters */ + +DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) +{ + char *nm = NULL; + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + DH *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_DHPARAMS, bp, cb, u)) + return NULL; + p = data; + + ret = d2i_DHparams(x, &p, len); + + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + OPENSSL_free(nm); + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +DH *PEM_read_DHparams(FILE *fp, DH **x, 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 NULL; + } + DH *ret = PEM_read_bio_DHparams(b, x, cb, u); + BIO_free(b); + return ret; +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back new file mode 100644 index 0000000..5776535 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back @@ -0,0 +1,218 @@ +/* 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 + +EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u) +{ + char *nm = NULL; + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + EVP_PKEY *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_EVP_PKEY, bp, cb, u)) + return NULL; + p = data; + + if (strcmp(nm, PEM_STRING_PKCS8INF) == 0) { + PKCS8_PRIV_KEY_INFO *p8inf; + p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len); + if (!p8inf) + goto p8err; + ret = EVP_PKCS82PKEY(p8inf); + if (x) { + if (*x) + EVP_PKEY_free((EVP_PKEY *)*x); + *x = ret; + } + PKCS8_PRIV_KEY_INFO_free(p8inf); + } else if (strcmp(nm, PEM_STRING_PKCS8) == 0) { + PKCS8_PRIV_KEY_INFO *p8inf; + X509_SIG *p8; + int klen; + char psbuf[PEM_BUFSIZE]; + p8 = d2i_X509_SIG(NULL, &p, len); + if (!p8) + goto p8err; + + klen = 0; + if (!cb) + cb = PEM_def_callback; + klen = cb(psbuf, PEM_BUFSIZE, 0, u); + if (klen <= 0) { + OPENSSL_PUT_ERROR(PEM, PEM_R_BAD_PASSWORD_READ); + X509_SIG_free(p8); + goto err; + } + p8inf = PKCS8_decrypt(p8, psbuf, klen); + X509_SIG_free(p8); + OPENSSL_cleanse(psbuf, klen); + if (!p8inf) + goto p8err; + ret = EVP_PKCS82PKEY(p8inf); + if (x) { + if (*x) + EVP_PKEY_free((EVP_PKEY *)*x); + *x = ret; + } + PKCS8_PRIV_KEY_INFO_free(p8inf); + } else if (strcmp(nm, PEM_STRING_RSA) == 0) { + /* TODO(davidben): d2i_PrivateKey parses PKCS#8 along with the + * standalone format. This and the cases below probably should not + * accept PKCS#8. */ + ret = d2i_PrivateKey(EVP_PKEY_RSA, x, &p, len); + } else if (strcmp(nm, PEM_STRING_EC) == 0) { + ret = d2i_PrivateKey(EVP_PKEY_EC, x, &p, len); + } else if (strcmp(nm, PEM_STRING_DSA) == 0) { + ret = d2i_PrivateKey(EVP_PKEY_DSA, x, &p, len); + } + p8err: + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + + err: + OPENSSL_free(nm); + OPENSSL_free(data); + return (ret); +} + +int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + unsigned char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + return PEM_write_bio_PKCS8PrivateKey(bp, x, enc, (char *)kstr, klen, cb, u); +} + +#ifndef OPENSSL_NO_FP_API +EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, 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 NULL; + } + EVP_PKEY *ret = PEM_read_bio_PrivateKey(b, x, cb, u); + BIO_free(b); + 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 = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + int ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); + BIO_free(b); + return ret; +} + +#endif + +/* Transparently read in PKCS#3 or X9.42 DH parameters */ + +DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) +{ + char *nm = NULL; + const unsigned char *p = NULL; + unsigned char *data = NULL; + long len; + DH *ret = NULL; + + if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_DHPARAMS, bp, cb, u)) + return NULL; + p = data; + + ret = d2i_DHparams(x, &p, len); + + if (ret == NULL) + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + OPENSSL_free(nm); + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +DH *PEM_read_DHparams(FILE *fp, DH **x, 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 NULL; + } + DH *ret = PEM_read_bio_DHparams(b, x, cb, u); + BIO_free(b); + return ret; +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c new file mode 100644 index 0000000..0d9b3be --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c @@ -0,0 +1,65 @@ +/* pem_x509.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 + +IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c.grpc_back new file mode 100644 index 0000000..97f814d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c.grpc_back @@ -0,0 +1,65 @@ +/* pem_x509.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 + +IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c new file mode 100644 index 0000000..86dbe0c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c @@ -0,0 +1,65 @@ +/* pem_xaux.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 + +IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c.grpc_back new file mode 100644 index 0000000..b0cceca --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c.grpc_back @@ -0,0 +1,65 @@ +/* pem_xaux.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 + +IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h new file mode 100644 index 0000000..538d249 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h @@ -0,0 +1,49 @@ +/* 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_PKCS7_INTERNAL_H +#define OPENSSL_HEADER_PKCS7_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7 +// SignedData blob from |cbs| and sets |*out| to point to the rest of the +// input. If the input is in BER format, then |*der_bytes| will be set to a +// pointer that needs to be freed by the caller once they have finished +// processing |*out| (which will be pointing into |*der_bytes|). +// +// 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); + +// pkcs7_bundle writes a PKCS#7, SignedData structure to |out| and then calls +// |cb| with a CBB to which certificate or CRL data can be written, and the +// opaque context pointer, |arg|. The callback can return zero to indicate an +// error. +// +// pkcs7_bundle returns one on success or zero on error. +int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), + const void *arg); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_PKCS7_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h.grpc_back new file mode 100644 index 0000000..9541bea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h.grpc_back @@ -0,0 +1,49 @@ +/* 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_PKCS7_INTERNAL_H +#define OPENSSL_HEADER_PKCS7_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7 +// SignedData blob from |cbs| and sets |*out| to point to the rest of the +// input. If the input is in BER format, then |*der_bytes| will be set to a +// pointer that needs to be freed by the caller once they have finished +// processing |*out| (which will be pointing into |*der_bytes|). +// +// 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); + +// pkcs7_bundle writes a PKCS#7, SignedData structure to |out| and then calls +// |cb| with a CBB to which certificate or CRL data can be written, and the +// opaque context pointer, |arg|. The callback can return zero to indicate an +// error. +// +// pkcs7_bundle returns one on success or zero on error. +int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), + const void *arg); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_PKCS7_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c new file mode 100644 index 0000000..3b54a7f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c @@ -0,0 +1,159 @@ +/* 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 "internal.h" +#include "../bytestring/internal.h" + + +// 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.2 +static const uint8_t kPKCS7SignedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x02}; + +// pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7 +// SignedData blob from |cbs| and sets |*out| to point to the rest of the +// input. If the input is in BER format, then |*der_bytes| will be set to a +// pointer that needs to be freed by the caller once they have finished +// processing |*out| (which will be pointing into |*der_bytes|). +// +// 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) { + 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, &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; + } + + if (!CBS_mem_equal(&content_type, kPKCS7SignedData, + sizeof(kPKCS7SignedData))) { + OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NOT_PKCS7_SIGNED_DATA); + goto err; + } + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBS_get_asn1(&content_info, &wrapped_signed_data, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_asn1(&wrapped_signed_data, &signed_data, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&signed_data, &version) || + !CBS_get_asn1(&signed_data, NULL /* digests */, CBS_ASN1_SET) || + !CBS_get_asn1(&signed_data, NULL /* content */, CBS_ASN1_SEQUENCE)) { + goto err; + } + + if (version < 1) { + OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_BAD_PKCS7_VERSION); + goto err; + } + + CBS_init(out, CBS_data(&signed_data), CBS_len(&signed_data)); + return 1; + +err: + OPENSSL_free(*der_bytes); + *der_bytes = NULL; + return 0; +} + +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, has_certificates; + const size_t initial_certs_len = sk_CRYPTO_BUFFER_num(out_certs); + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + 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)) { + goto err; + } + + CRYPTO_BUFFER *buf = CRYPTO_BUFFER_new_from_CBS(&cert, pool); + if (buf == NULL || + !sk_CRYPTO_BUFFER_push(out_certs, buf)) { + CRYPTO_BUFFER_free(buf); + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(der_bytes); + + if (!ret) { + while (sk_CRYPTO_BUFFER_num(out_certs) != initial_certs_len) { + CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_pop(out_certs); + CRYPTO_BUFFER_free(buf); + } + } + + return ret; +} + +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, signer_infos; + + // See https://tools.ietf.org/html/rfc2315#section-7 + if (!CBB_add_asn1(out, &outer_seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&outer_seq, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPKCS7SignedData, sizeof(kPKCS7SignedData)) || + !CBB_add_asn1(&outer_seq, &wrapped_seq, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + // See https://tools.ietf.org/html/rfc2315#section-9.1 + !CBB_add_asn1(&wrapped_seq, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&seq, &version_bytes, CBS_ASN1_INTEGER) || + !CBB_add_u8(&version_bytes, 1) || + !CBB_add_asn1(&seq, &digest_algos_set, CBS_ASN1_SET) || + !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) || + !CBB_add_asn1(&seq, &signer_infos, CBS_ASN1_SET)) { + return 0; + } + + return CBB_flush(out); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back new file mode 100644 index 0000000..1d0b139 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back @@ -0,0 +1,159 @@ +/* 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 "internal.h" +#include "../bytestring/internal.h" + + +// 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.2 +static const uint8_t kPKCS7SignedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x02}; + +// pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7 +// SignedData blob from |cbs| and sets |*out| to point to the rest of the +// input. If the input is in BER format, then |*der_bytes| will be set to a +// pointer that needs to be freed by the caller once they have finished +// processing |*out| (which will be pointing into |*der_bytes|). +// +// 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) { + 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, &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; + } + + if (!CBS_mem_equal(&content_type, kPKCS7SignedData, + sizeof(kPKCS7SignedData))) { + OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NOT_PKCS7_SIGNED_DATA); + goto err; + } + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBS_get_asn1(&content_info, &wrapped_signed_data, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_asn1(&wrapped_signed_data, &signed_data, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&signed_data, &version) || + !CBS_get_asn1(&signed_data, NULL /* digests */, CBS_ASN1_SET) || + !CBS_get_asn1(&signed_data, NULL /* content */, CBS_ASN1_SEQUENCE)) { + goto err; + } + + if (version < 1) { + OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_BAD_PKCS7_VERSION); + goto err; + } + + CBS_init(out, CBS_data(&signed_data), CBS_len(&signed_data)); + return 1; + +err: + OPENSSL_free(*der_bytes); + *der_bytes = NULL; + return 0; +} + +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, has_certificates; + const size_t initial_certs_len = sk_CRYPTO_BUFFER_num(out_certs); + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + 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)) { + goto err; + } + + CRYPTO_BUFFER *buf = CRYPTO_BUFFER_new_from_CBS(&cert, pool); + if (buf == NULL || + !sk_CRYPTO_BUFFER_push(out_certs, buf)) { + CRYPTO_BUFFER_free(buf); + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(der_bytes); + + if (!ret) { + while (sk_CRYPTO_BUFFER_num(out_certs) != initial_certs_len) { + CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_pop(out_certs); + CRYPTO_BUFFER_free(buf); + } + } + + return ret; +} + +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, signer_infos; + + // See https://tools.ietf.org/html/rfc2315#section-7 + if (!CBB_add_asn1(out, &outer_seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&outer_seq, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPKCS7SignedData, sizeof(kPKCS7SignedData)) || + !CBB_add_asn1(&outer_seq, &wrapped_seq, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + // See https://tools.ietf.org/html/rfc2315#section-9.1 + !CBB_add_asn1(&wrapped_seq, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&seq, &version_bytes, CBS_ASN1_INTEGER) || + !CBB_add_u8(&version_bytes, 1) || + !CBB_add_asn1(&seq, &digest_algos_set, CBS_ASN1_SET) || + !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) || + !CBB_add_asn1(&seq, &signer_infos, CBS_ASN1_SET)) { + return 0; + } + + return CBB_flush(out); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c new file mode 100644 index 0000000..b420714 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c.grpc_back new file mode 100644 index 0000000..107bdea --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h new file mode 100644 index 0000000..5f43fcc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h.grpc_back new file mode 100644 index 0000000..c3302f7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c new file mode 100644 index 0000000..4468d9e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c @@ -0,0 +1,316 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999-2004. + */ +/* ==================================================================== + * 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 "internal.h" +#include "../internal.h" + + +// 1.2.840.113549.1.5.12 +static const uint8_t kPBKDF2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x05, 0x0c}; + +// 1.2.840.113549.1.5.13 +static const uint8_t kPBES2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x05, 0x0d}; + +// 1.2.840.113549.2.7 +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; + int nid; + const EVP_CIPHER *(*cipher_func)(void); +} kCipherOIDs[] = { + // 1.2.840.113549.3.2 + {{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x02}, + 8, + NID_rc2_cbc, + &EVP_rc2_cbc}, + // 1.2.840.113549.3.7 + {{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x07}, + 8, + NID_des_ede3_cbc, + &EVP_des_ede3_cbc}, + // 2.16.840.1.101.3.4.1.2 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x02}, + 9, + NID_aes_128_cbc, + &EVP_aes_128_cbc}, + // 2.16.840.1.101.3.4.1.22 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x16}, + 9, + NID_aes_192_cbc, + &EVP_aes_192_cbc}, + // 2.16.840.1.101.3.4.1.42 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2a}, + 9, + NID_aes_256_cbc, + &EVP_aes_256_cbc}, +}; + +static const EVP_CIPHER *cbs_to_cipher(const CBS *cbs) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kCipherOIDs); i++) { + if (CBS_mem_equal(cbs, kCipherOIDs[i].oid, kCipherOIDs[i].oid_len)) { + return kCipherOIDs[i].cipher_func(); + } + } + + return NULL; +} + +static int add_cipher_oid(CBB *out, int nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kCipherOIDs); i++) { + if (kCipherOIDs[i].nid == nid) { + CBB child; + return CBB_add_asn1(out, &child, CBS_ASN1_OBJECT) && + CBB_add_bytes(&child, kCipherOIDs[i].oid, + kCipherOIDs[i].oid_len) && + CBB_flush(out); + } + } + + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_CIPHER); + return 0; +} + +static int pkcs5_pbe2_cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + 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(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; +} + +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) { + int cipher_nid = EVP_CIPHER_nid(cipher); + if (cipher_nid == NID_undef) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER); + return 0; + } + + // Generate a random IV. + uint8_t iv[EVP_MAX_IV_LENGTH]; + if (!RAND_bytes(iv, EVP_CIPHER_iv_length(cipher))) { + return 0; + } + + // See RFC 2898, appendix A. + CBB algorithm, oid, param, kdf, kdf_oid, kdf_param, salt_cbb, cipher_cbb, + iv_cbb; + if (!CBB_add_asn1(out, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPBES2, sizeof(kPBES2)) || + !CBB_add_asn1(&algorithm, ¶m, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(¶m, &kdf, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&kdf, &kdf_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&kdf_oid, kPBKDF2, sizeof(kPBKDF2)) || + !CBB_add_asn1(&kdf, &kdf_param, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&kdf_param, &salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&salt_cbb, salt, salt_len) || + !CBB_add_asn1_uint64(&kdf_param, iterations) || + // Specify a key length for RC2. + (cipher_nid == NID_rc2_cbc && + !CBB_add_asn1_uint64(&kdf_param, EVP_CIPHER_key_length(cipher))) || + // Omit the PRF. We use the default hmacWithSHA1. + !CBB_add_asn1(¶m, &cipher_cbb, CBS_ASN1_SEQUENCE) || + !add_cipher_oid(&cipher_cbb, cipher_nid) || + // RFC 2898 says RC2-CBC and RC5-CBC-Pad use a SEQUENCE with version and + // IV, but OpenSSL always uses an OCTET STRING IV, so we do the same. + !CBB_add_asn1(&cipher_cbb, &iv_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&iv_cbb, iv, EVP_CIPHER_iv_length(cipher)) || + !CBB_flush(out)) { + return 0; + } + + 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, + const char *pass, size_t pass_len, CBS *param) { + CBS pbe_param, kdf, kdf_obj, enc_scheme, enc_obj; + if (!CBS_get_asn1(param, &pbe_param, CBS_ASN1_SEQUENCE) || + CBS_len(param) != 0 || + !CBS_get_asn1(&pbe_param, &kdf, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&pbe_param, &enc_scheme, CBS_ASN1_SEQUENCE) || + CBS_len(&pbe_param) != 0 || + !CBS_get_asn1(&kdf, &kdf_obj, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&enc_scheme, &enc_obj, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + // Only PBKDF2 is supported. + if (!CBS_mem_equal(&kdf_obj, kPBKDF2, sizeof(kPBKDF2))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION); + return 0; + } + + // See if we recognise the encryption algorithm. + const EVP_CIPHER *cipher = cbs_to_cipher(&enc_obj); + if (cipher == NULL) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_CIPHER); + return 0; + } + + // Parse the KDF parameters. See RFC 8018, appendix A.2. + CBS pbkdf2_params, salt; + uint64_t iterations; + if (!CBS_get_asn1(&kdf, &pbkdf2_params, CBS_ASN1_SEQUENCE) || + CBS_len(&kdf) != 0 || + !CBS_get_asn1(&pbkdf2_params, &salt, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_uint64(&pbkdf2_params, &iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (!pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + // The optional keyLength parameter, if present, must match the key length of + // the cipher. + if (CBS_peek_asn1_tag(&pbkdf2_params, CBS_ASN1_INTEGER)) { + uint64_t key_len; + if (!CBS_get_asn1_uint64(&pbkdf2_params, &key_len)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (key_len != EVP_CIPHER_key_length(cipher)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_KEYLENGTH); + return 0; + } + } + + 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) || + !CBS_get_asn1(&alg_id, &prf, CBS_ASN1_OBJECT) || + CBS_len(&pbkdf2_params) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + 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; + } + + // All supported PRFs use a NULL parameter. + CBS null; + if (!CBS_get_asn1(&alg_id, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(&alg_id) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + } + + // Parse the encryption scheme parameters. Note OpenSSL does not match the + // specification. Per RFC 2898, this should depend on the encryption scheme. + // In particular, RC2-CBC uses a SEQUENCE with version and IV. We align with + // OpenSSL. + CBS iv; + if (!CBS_get_asn1(&enc_scheme, &iv, CBS_ASN1_OCTETSTRING) || + CBS_len(&enc_scheme) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_PRF); + return 0; + } + + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back new file mode 100644 index 0000000..e58cf44 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back @@ -0,0 +1,316 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999-2004. + */ +/* ==================================================================== + * 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 "internal.h" +#include "../internal.h" + + +// 1.2.840.113549.1.5.12 +static const uint8_t kPBKDF2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x05, 0x0c}; + +// 1.2.840.113549.1.5.13 +static const uint8_t kPBES2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x05, 0x0d}; + +// 1.2.840.113549.2.7 +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; + int nid; + const EVP_CIPHER *(*cipher_func)(void); +} kCipherOIDs[] = { + // 1.2.840.113549.3.2 + {{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x02}, + 8, + NID_rc2_cbc, + &EVP_rc2_cbc}, + // 1.2.840.113549.3.7 + {{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x07}, + 8, + NID_des_ede3_cbc, + &EVP_des_ede3_cbc}, + // 2.16.840.1.101.3.4.1.2 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x02}, + 9, + NID_aes_128_cbc, + &EVP_aes_128_cbc}, + // 2.16.840.1.101.3.4.1.22 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x16}, + 9, + NID_aes_192_cbc, + &EVP_aes_192_cbc}, + // 2.16.840.1.101.3.4.1.42 + {{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2a}, + 9, + NID_aes_256_cbc, + &EVP_aes_256_cbc}, +}; + +static const EVP_CIPHER *cbs_to_cipher(const CBS *cbs) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kCipherOIDs); i++) { + if (CBS_mem_equal(cbs, kCipherOIDs[i].oid, kCipherOIDs[i].oid_len)) { + return kCipherOIDs[i].cipher_func(); + } + } + + return NULL; +} + +static int add_cipher_oid(CBB *out, int nid) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kCipherOIDs); i++) { + if (kCipherOIDs[i].nid == nid) { + CBB child; + return CBB_add_asn1(out, &child, CBS_ASN1_OBJECT) && + CBB_add_bytes(&child, kCipherOIDs[i].oid, + kCipherOIDs[i].oid_len) && + CBB_flush(out); + } + } + + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_CIPHER); + return 0; +} + +static int pkcs5_pbe2_cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + 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(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; +} + +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) { + int cipher_nid = EVP_CIPHER_nid(cipher); + if (cipher_nid == NID_undef) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER); + return 0; + } + + // Generate a random IV. + uint8_t iv[EVP_MAX_IV_LENGTH]; + if (!RAND_bytes(iv, EVP_CIPHER_iv_length(cipher))) { + return 0; + } + + // See RFC 2898, appendix A. + CBB algorithm, oid, param, kdf, kdf_oid, kdf_param, salt_cbb, cipher_cbb, + iv_cbb; + if (!CBB_add_asn1(out, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPBES2, sizeof(kPBES2)) || + !CBB_add_asn1(&algorithm, ¶m, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(¶m, &kdf, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&kdf, &kdf_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&kdf_oid, kPBKDF2, sizeof(kPBKDF2)) || + !CBB_add_asn1(&kdf, &kdf_param, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&kdf_param, &salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&salt_cbb, salt, salt_len) || + !CBB_add_asn1_uint64(&kdf_param, iterations) || + // Specify a key length for RC2. + (cipher_nid == NID_rc2_cbc && + !CBB_add_asn1_uint64(&kdf_param, EVP_CIPHER_key_length(cipher))) || + // Omit the PRF. We use the default hmacWithSHA1. + !CBB_add_asn1(¶m, &cipher_cbb, CBS_ASN1_SEQUENCE) || + !add_cipher_oid(&cipher_cbb, cipher_nid) || + // RFC 2898 says RC2-CBC and RC5-CBC-Pad use a SEQUENCE with version and + // IV, but OpenSSL always uses an OCTET STRING IV, so we do the same. + !CBB_add_asn1(&cipher_cbb, &iv_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&iv_cbb, iv, EVP_CIPHER_iv_length(cipher)) || + !CBB_flush(out)) { + return 0; + } + + 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, + const char *pass, size_t pass_len, CBS *param) { + CBS pbe_param, kdf, kdf_obj, enc_scheme, enc_obj; + if (!CBS_get_asn1(param, &pbe_param, CBS_ASN1_SEQUENCE) || + CBS_len(param) != 0 || + !CBS_get_asn1(&pbe_param, &kdf, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&pbe_param, &enc_scheme, CBS_ASN1_SEQUENCE) || + CBS_len(&pbe_param) != 0 || + !CBS_get_asn1(&kdf, &kdf_obj, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&enc_scheme, &enc_obj, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + // Only PBKDF2 is supported. + if (!CBS_mem_equal(&kdf_obj, kPBKDF2, sizeof(kPBKDF2))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION); + return 0; + } + + // See if we recognise the encryption algorithm. + const EVP_CIPHER *cipher = cbs_to_cipher(&enc_obj); + if (cipher == NULL) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_CIPHER); + return 0; + } + + // Parse the KDF parameters. See RFC 8018, appendix A.2. + CBS pbkdf2_params, salt; + uint64_t iterations; + if (!CBS_get_asn1(&kdf, &pbkdf2_params, CBS_ASN1_SEQUENCE) || + CBS_len(&kdf) != 0 || + !CBS_get_asn1(&pbkdf2_params, &salt, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_uint64(&pbkdf2_params, &iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (!pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + // The optional keyLength parameter, if present, must match the key length of + // the cipher. + if (CBS_peek_asn1_tag(&pbkdf2_params, CBS_ASN1_INTEGER)) { + uint64_t key_len; + if (!CBS_get_asn1_uint64(&pbkdf2_params, &key_len)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (key_len != EVP_CIPHER_key_length(cipher)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_KEYLENGTH); + return 0; + } + } + + 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) || + !CBS_get_asn1(&alg_id, &prf, CBS_ASN1_OBJECT) || + CBS_len(&pbkdf2_params) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + 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; + } + + // All supported PRFs use a NULL parameter. + CBS null; + if (!CBS_get_asn1(&alg_id, &null, CBS_ASN1_NULL) || + CBS_len(&null) != 0 || + CBS_len(&alg_id) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + } + + // Parse the encryption scheme parameters. Note OpenSSL does not match the + // specification. Per RFC 2898, this should depend on the encryption scheme. + // In particular, RC2-CBC uses a SEQUENCE with version and IV. We align with + // OpenSSL. + CBS iv; + if (!CBS_get_asn1(&enc_scheme, &iv, CBS_ASN1_OCTETSTRING) || + CBS_len(&enc_scheme) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_PRF); + return 0; + } + + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c new file mode 100644 index 0000000..91836b2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c @@ -0,0 +1,530 @@ +/* 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 "internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +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; + } + + // 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. + 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, + size_t salt_len, uint8_t id, unsigned iterations, + size_t out_len, uint8_t *out, const EVP_MD *md) { + // See https://tools.ietf.org/html/rfc7292#appendix-B. Quoted parts of the + // specification have errata applied and other typos fixed. + + if (iterations < 1) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + int ret = 0; + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + uint8_t *pass_raw = NULL, *I = NULL; + size_t pass_raw_len = 0, I_len = 0; + // If |pass| is NULL, we use the empty string rather than {0, 0} as the raw + // password. + if (pass != NULL && + !pkcs12_encode_password(pass, pass_len, &pass_raw, &pass_raw_len)) { + goto err; + } + + // In the spec, |block_size| is called "v", but measured in bits. + size_t block_size = EVP_MD_block_size(md); + + // 1. Construct a string, D (the "diversifier"), by concatenating v/8 copies + // of ID. + uint8_t D[EVP_MAX_MD_BLOCK_SIZE]; + OPENSSL_memset(D, id, block_size); + + // 2. Concatenate copies of the salt together to create a string S of length + // v(ceiling(s/v)) bits (the final copy of the salt may be truncated to + // create S). Note that if the salt is the empty string, then so is S. + // + // 3. Concatenate copies of the password together to create a string P of + // length v(ceiling(p/v)) bits (the final copy of the password may be + // truncated to create P). Note that if the password is the empty string, + // then so is P. + // + // 4. Set I=S||P to be the concatenation of S and P. + if (salt_len + block_size - 1 < salt_len || + pass_raw_len + block_size - 1 < pass_raw_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + size_t S_len = block_size * ((salt_len + block_size - 1) / block_size); + size_t P_len = block_size * ((pass_raw_len + block_size - 1) / block_size); + I_len = S_len + P_len; + if (I_len < S_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + + I = OPENSSL_malloc(I_len); + if (I_len != 0 && I == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + + for (size_t i = 0; i < S_len; i++) { + I[i] = salt[i % salt_len]; + } + for (size_t i = 0; i < P_len; i++) { + I[i + S_len] = pass_raw[i % pass_raw_len]; + } + + while (out_len != 0) { + // A. Set A_i=H^r(D||I). (i.e., the r-th hash of D||I, + // H(H(H(... H(D||I)))) + uint8_t A[EVP_MAX_MD_SIZE]; + unsigned A_len; + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, D, block_size) || + !EVP_DigestUpdate(&ctx, I, I_len) || + !EVP_DigestFinal_ex(&ctx, A, &A_len)) { + goto err; + } + for (unsigned iter = 1; iter < iterations; iter++) { + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, A, A_len) || + !EVP_DigestFinal_ex(&ctx, A, &A_len)) { + goto err; + } + } + + size_t todo = out_len < A_len ? out_len : A_len; + OPENSSL_memcpy(out, A, todo); + out += todo; + out_len -= todo; + if (out_len == 0) { + break; + } + + // B. Concatenate copies of A_i to create a string B of length v bits (the + // final copy of A_i may be truncated to create B). + uint8_t B[EVP_MAX_MD_BLOCK_SIZE]; + for (size_t i = 0; i < block_size; i++) { + B[i] = A[i % A_len]; + } + + // C. Treating I as a concatenation I_0, I_1, ..., I_(k-1) of v-bit blocks, + // where k=ceiling(s/v)+ceiling(p/v), modify I by setting I_j=(I_j+B+1) mod + // 2^v for each j. + assert(I_len % block_size == 0); + for (size_t i = 0; i < I_len; i += block_size) { + unsigned carry = 1; + for (size_t j = block_size - 1; j < block_size; j--) { + carry += I[i + j] + B[j]; + I[i + j] = (uint8_t)carry; + carry >>= 8; + } + } + } + + ret = 1; + +err: + OPENSSL_free(I); + OPENSSL_free(pass_raw); + EVP_MD_CTX_cleanup(&ctx); + return ret; +} + +static int pkcs12_pbe_cipher_init(const struct pbe_suite *suite, + EVP_CIPHER_CTX *ctx, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len, + int is_encrypt) { + const EVP_CIPHER *cipher = suite->cipher_func(); + const EVP_MD *md = suite->md_func(); + + uint8_t key[EVP_MAX_KEY_LENGTH]; + uint8_t iv[EVP_MAX_IV_LENGTH]; + if (!pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_KEY_ID, iterations, + EVP_CIPHER_key_length(cipher), key, md) || + !pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_IV_ID, iterations, + EVP_CIPHER_iv_length(cipher), iv, md)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_KEY_GEN_ERROR); + return 0; + } + + int ret = EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, is_encrypt); + OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); + OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); + return ret; +} + +static int pkcs12_pbe_decrypt_init(const struct pbe_suite *suite, + EVP_CIPHER_CTX *ctx, const char *pass, + size_t pass_len, CBS *param) { + CBS pbe_param, salt; + uint64_t iterations; + if (!CBS_get_asn1(param, &pbe_param, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&pbe_param, &salt, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_uint64(&pbe_param, &iterations) || + CBS_len(&pbe_param) != 0 || + CBS_len(param) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (!pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + return pkcs12_pbe_cipher_init(suite, ctx, (unsigned)iterations, pass, + pass_len, CBS_data(&salt), CBS_len(&salt), + 0 /* decrypt */); +} + +static const struct pbe_suite kBuiltinPBE[] = { + { + NID_pbe_WithSHA1And40BitRC2_CBC, + // 1.2.840.113549.1.12.1.6 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x06}, + 10, + EVP_rc2_40_cbc, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbe_WithSHA1And128BitRC4, + // 1.2.840.113549.1.12.1.1 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x01}, + 10, + EVP_rc4, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbe_WithSHA1And3_Key_TripleDES_CBC, + // 1.2.840.113549.1.12.1.3 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03}, + 10, + EVP_des_ede3_cbc, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbes2, + // 1.2.840.113549.1.5.13 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0d}, + 9, + NULL, + NULL, + PKCS5_pbe2_decrypt_init, + }, +}; + +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 |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]; + } + } + + return NULL; +} + +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; + } + + // See RFC 2898, appendix A.3. + CBB algorithm, oid, param, salt_cbb; + if (!CBB_add_asn1(out, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, suite->oid, suite->oid_len) || + !CBB_add_asn1(&algorithm, ¶m, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(¶m, &salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&salt_cbb, salt, salt_len) || + !CBB_add_asn1_uint64(¶m, iterations) || + !CBB_flush(out)) { + return 0; + } + + return pkcs12_pbe_cipher_init(suite, ctx, iterations, pass, pass_len, salt, + salt_len, 1 /* encrypt */); +} + +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) { + int ret = 0; + uint8_t *buf = NULL;; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + + CBS obj; + if (!CBS_get_asn1(algorithm, &obj, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + goto err; + } + + const struct pbe_suite *suite = NULL; + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kBuiltinPBE); i++) { + if (CBS_mem_equal(&obj, kBuiltinPBE[i].oid, kBuiltinPBE[i].oid_len)) { + suite = &kBuiltinPBE[i]; + break; + } + } + if (suite == NULL) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNKNOWN_ALGORITHM); + goto err; + } + + if (!suite->decrypt_init(suite, &ctx, pass, pass_len, algorithm)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_KEYGEN_FAILURE); + goto err; + } + + buf = OPENSSL_malloc(in_len); + if (buf == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (in_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + + int n1, n2; + if (!EVP_DecryptUpdate(&ctx, buf, &n1, in, (int)in_len) || + !EVP_DecryptFinal_ex(&ctx, buf + n1, &n2)) { + goto err; + } + + *out = buf; + *out_len = n1 + n2; + ret = 1; + buf = NULL; + +err: + OPENSSL_free(buf); + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} + +EVP_PKEY *PKCS8_parse_encrypted_private_key(CBS *cbs, const char *pass, + size_t pass_len) { + // See RFC 5208, section 6. + CBS epki, algorithm, ciphertext; + if (!CBS_get_asn1(cbs, &epki, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&epki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || + CBS_len(&epki) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + uint8_t *out; + size_t out_len; + if (!pkcs8_pbe_decrypt(&out, &out_len, &algorithm, pass, pass_len, + CBS_data(&ciphertext), CBS_len(&ciphertext))) { + return 0; + } + + CBS pki; + CBS_init(&pki, out, out_len); + EVP_PKEY *ret = EVP_parse_private_key(&pki); + OPENSSL_free(out); + return ret; +} + +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) { + int ret = 0; + uint8_t *plaintext = NULL, *salt_buf = NULL; + size_t plaintext_len = 0; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + + // Generate a random salt if necessary. + if (salt == NULL) { + if (salt_len == 0) { + salt_len = PKCS5_SALT_LEN; + } + + salt_buf = OPENSSL_malloc(salt_len); + if (salt_buf == NULL || + !RAND_bytes(salt_buf, salt_len)) { + goto err; + } + + salt = salt_buf; + } + + if (iterations <= 0) { + iterations = PKCS5_DEFAULT_ITERATIONS; + } + + // Serialize the input key. + CBB plaintext_cbb; + if (!CBB_init(&plaintext_cbb, 128) || + !EVP_marshal_private_key(&plaintext_cbb, pkey) || + !CBB_finish(&plaintext_cbb, &plaintext, &plaintext_len)) { + CBB_cleanup(&plaintext_cbb); + goto err; + } + + CBB epki; + if (!CBB_add_asn1(out, &epki, CBS_ASN1_SEQUENCE)) { + 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, + pass, pass_len, salt, salt_len); + } else { + alg_ok = pkcs12_pbe_encrypt_init(&epki, &ctx, pbe_nid, (unsigned)iterations, + pass, pass_len, salt, salt_len); + } + if (!alg_ok) { + goto err; + } + + size_t max_out = plaintext_len + EVP_CIPHER_CTX_block_size(&ctx); + if (max_out < plaintext_len) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_TOO_LONG); + goto err; + } + + CBB ciphertext; + uint8_t *ptr; + int n1, n2; + if (!CBB_add_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || + !CBB_reserve(&ciphertext, &ptr, max_out) || + !EVP_CipherUpdate(&ctx, ptr, &n1, plaintext, plaintext_len) || + !EVP_CipherFinal_ex(&ctx, ptr + n1, &n2) || + !CBB_did_write(&ciphertext, n1 + n2) || + !CBB_flush(out)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(plaintext); + OPENSSL_free(salt_buf); + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back new file mode 100644 index 0000000..a19b4a3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back @@ -0,0 +1,530 @@ +/* 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 "internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +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; + } + + // 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. + 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, + size_t salt_len, uint8_t id, unsigned iterations, + size_t out_len, uint8_t *out, const EVP_MD *md) { + // See https://tools.ietf.org/html/rfc7292#appendix-B. Quoted parts of the + // specification have errata applied and other typos fixed. + + if (iterations < 1) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + int ret = 0; + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + uint8_t *pass_raw = NULL, *I = NULL; + size_t pass_raw_len = 0, I_len = 0; + // If |pass| is NULL, we use the empty string rather than {0, 0} as the raw + // password. + if (pass != NULL && + !pkcs12_encode_password(pass, pass_len, &pass_raw, &pass_raw_len)) { + goto err; + } + + // In the spec, |block_size| is called "v", but measured in bits. + size_t block_size = EVP_MD_block_size(md); + + // 1. Construct a string, D (the "diversifier"), by concatenating v/8 copies + // of ID. + uint8_t D[EVP_MAX_MD_BLOCK_SIZE]; + OPENSSL_memset(D, id, block_size); + + // 2. Concatenate copies of the salt together to create a string S of length + // v(ceiling(s/v)) bits (the final copy of the salt may be truncated to + // create S). Note that if the salt is the empty string, then so is S. + // + // 3. Concatenate copies of the password together to create a string P of + // length v(ceiling(p/v)) bits (the final copy of the password may be + // truncated to create P). Note that if the password is the empty string, + // then so is P. + // + // 4. Set I=S||P to be the concatenation of S and P. + if (salt_len + block_size - 1 < salt_len || + pass_raw_len + block_size - 1 < pass_raw_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + size_t S_len = block_size * ((salt_len + block_size - 1) / block_size); + size_t P_len = block_size * ((pass_raw_len + block_size - 1) / block_size); + I_len = S_len + P_len; + if (I_len < S_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + + I = OPENSSL_malloc(I_len); + if (I_len != 0 && I == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + + for (size_t i = 0; i < S_len; i++) { + I[i] = salt[i % salt_len]; + } + for (size_t i = 0; i < P_len; i++) { + I[i + S_len] = pass_raw[i % pass_raw_len]; + } + + while (out_len != 0) { + // A. Set A_i=H^r(D||I). (i.e., the r-th hash of D||I, + // H(H(H(... H(D||I)))) + uint8_t A[EVP_MAX_MD_SIZE]; + unsigned A_len; + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, D, block_size) || + !EVP_DigestUpdate(&ctx, I, I_len) || + !EVP_DigestFinal_ex(&ctx, A, &A_len)) { + goto err; + } + for (unsigned iter = 1; iter < iterations; iter++) { + if (!EVP_DigestInit_ex(&ctx, md, NULL) || + !EVP_DigestUpdate(&ctx, A, A_len) || + !EVP_DigestFinal_ex(&ctx, A, &A_len)) { + goto err; + } + } + + size_t todo = out_len < A_len ? out_len : A_len; + OPENSSL_memcpy(out, A, todo); + out += todo; + out_len -= todo; + if (out_len == 0) { + break; + } + + // B. Concatenate copies of A_i to create a string B of length v bits (the + // final copy of A_i may be truncated to create B). + uint8_t B[EVP_MAX_MD_BLOCK_SIZE]; + for (size_t i = 0; i < block_size; i++) { + B[i] = A[i % A_len]; + } + + // C. Treating I as a concatenation I_0, I_1, ..., I_(k-1) of v-bit blocks, + // where k=ceiling(s/v)+ceiling(p/v), modify I by setting I_j=(I_j+B+1) mod + // 2^v for each j. + assert(I_len % block_size == 0); + for (size_t i = 0; i < I_len; i += block_size) { + unsigned carry = 1; + for (size_t j = block_size - 1; j < block_size; j--) { + carry += I[i + j] + B[j]; + I[i + j] = (uint8_t)carry; + carry >>= 8; + } + } + } + + ret = 1; + +err: + OPENSSL_free(I); + OPENSSL_free(pass_raw); + EVP_MD_CTX_cleanup(&ctx); + return ret; +} + +static int pkcs12_pbe_cipher_init(const struct pbe_suite *suite, + EVP_CIPHER_CTX *ctx, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len, + int is_encrypt) { + const EVP_CIPHER *cipher = suite->cipher_func(); + const EVP_MD *md = suite->md_func(); + + uint8_t key[EVP_MAX_KEY_LENGTH]; + uint8_t iv[EVP_MAX_IV_LENGTH]; + if (!pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_KEY_ID, iterations, + EVP_CIPHER_key_length(cipher), key, md) || + !pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_IV_ID, iterations, + EVP_CIPHER_iv_length(cipher), iv, md)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_KEY_GEN_ERROR); + return 0; + } + + int ret = EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, is_encrypt); + OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); + OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); + return ret; +} + +static int pkcs12_pbe_decrypt_init(const struct pbe_suite *suite, + EVP_CIPHER_CTX *ctx, const char *pass, + size_t pass_len, CBS *param) { + CBS pbe_param, salt; + uint64_t iterations; + if (!CBS_get_asn1(param, &pbe_param, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&pbe_param, &salt, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_uint64(&pbe_param, &iterations) || + CBS_len(&pbe_param) != 0 || + CBS_len(param) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + if (!pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); + return 0; + } + + return pkcs12_pbe_cipher_init(suite, ctx, (unsigned)iterations, pass, + pass_len, CBS_data(&salt), CBS_len(&salt), + 0 /* decrypt */); +} + +static const struct pbe_suite kBuiltinPBE[] = { + { + NID_pbe_WithSHA1And40BitRC2_CBC, + // 1.2.840.113549.1.12.1.6 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x06}, + 10, + EVP_rc2_40_cbc, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbe_WithSHA1And128BitRC4, + // 1.2.840.113549.1.12.1.1 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x01}, + 10, + EVP_rc4, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbe_WithSHA1And3_Key_TripleDES_CBC, + // 1.2.840.113549.1.12.1.3 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03}, + 10, + EVP_des_ede3_cbc, + EVP_sha1, + pkcs12_pbe_decrypt_init, + }, + { + NID_pbes2, + // 1.2.840.113549.1.5.13 + {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0d}, + 9, + NULL, + NULL, + PKCS5_pbe2_decrypt_init, + }, +}; + +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 |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]; + } + } + + return NULL; +} + +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; + } + + // See RFC 2898, appendix A.3. + CBB algorithm, oid, param, salt_cbb; + if (!CBB_add_asn1(out, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, suite->oid, suite->oid_len) || + !CBB_add_asn1(&algorithm, ¶m, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(¶m, &salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&salt_cbb, salt, salt_len) || + !CBB_add_asn1_uint64(¶m, iterations) || + !CBB_flush(out)) { + return 0; + } + + return pkcs12_pbe_cipher_init(suite, ctx, iterations, pass, pass_len, salt, + salt_len, 1 /* encrypt */); +} + +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) { + int ret = 0; + uint8_t *buf = NULL;; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + + CBS obj; + if (!CBS_get_asn1(algorithm, &obj, CBS_ASN1_OBJECT)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + goto err; + } + + const struct pbe_suite *suite = NULL; + for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kBuiltinPBE); i++) { + if (CBS_mem_equal(&obj, kBuiltinPBE[i].oid, kBuiltinPBE[i].oid_len)) { + suite = &kBuiltinPBE[i]; + break; + } + } + if (suite == NULL) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNKNOWN_ALGORITHM); + goto err; + } + + if (!suite->decrypt_init(suite, &ctx, pass, pass_len, algorithm)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_KEYGEN_FAILURE); + goto err; + } + + buf = OPENSSL_malloc(in_len); + if (buf == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (in_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + goto err; + } + + int n1, n2; + if (!EVP_DecryptUpdate(&ctx, buf, &n1, in, (int)in_len) || + !EVP_DecryptFinal_ex(&ctx, buf + n1, &n2)) { + goto err; + } + + *out = buf; + *out_len = n1 + n2; + ret = 1; + buf = NULL; + +err: + OPENSSL_free(buf); + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} + +EVP_PKEY *PKCS8_parse_encrypted_private_key(CBS *cbs, const char *pass, + size_t pass_len) { + // See RFC 5208, section 6. + CBS epki, algorithm, ciphertext; + if (!CBS_get_asn1(cbs, &epki, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&epki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || + CBS_len(&epki) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + return 0; + } + + uint8_t *out; + size_t out_len; + if (!pkcs8_pbe_decrypt(&out, &out_len, &algorithm, pass, pass_len, + CBS_data(&ciphertext), CBS_len(&ciphertext))) { + return 0; + } + + CBS pki; + CBS_init(&pki, out, out_len); + EVP_PKEY *ret = EVP_parse_private_key(&pki); + OPENSSL_free(out); + return ret; +} + +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) { + int ret = 0; + uint8_t *plaintext = NULL, *salt_buf = NULL; + size_t plaintext_len = 0; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + + // Generate a random salt if necessary. + if (salt == NULL) { + if (salt_len == 0) { + salt_len = PKCS5_SALT_LEN; + } + + salt_buf = OPENSSL_malloc(salt_len); + if (salt_buf == NULL || + !RAND_bytes(salt_buf, salt_len)) { + goto err; + } + + salt = salt_buf; + } + + if (iterations <= 0) { + iterations = PKCS5_DEFAULT_ITERATIONS; + } + + // Serialize the input key. + CBB plaintext_cbb; + if (!CBB_init(&plaintext_cbb, 128) || + !EVP_marshal_private_key(&plaintext_cbb, pkey) || + !CBB_finish(&plaintext_cbb, &plaintext, &plaintext_len)) { + CBB_cleanup(&plaintext_cbb); + goto err; + } + + CBB epki; + if (!CBB_add_asn1(out, &epki, CBS_ASN1_SEQUENCE)) { + 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, + pass, pass_len, salt, salt_len); + } else { + alg_ok = pkcs12_pbe_encrypt_init(&epki, &ctx, pbe_nid, (unsigned)iterations, + pass, pass_len, salt, salt_len); + } + if (!alg_ok) { + goto err; + } + + size_t max_out = plaintext_len + EVP_CIPHER_CTX_block_size(&ctx); + if (max_out < plaintext_len) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_TOO_LONG); + goto err; + } + + CBB ciphertext; + uint8_t *ptr; + int n1, n2; + if (!CBB_add_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || + !CBB_reserve(&ciphertext, &ptr, max_out) || + !EVP_CipherUpdate(&ctx, ptr, &n1, plaintext, plaintext_len) || + !EVP_CipherFinal_ex(&ctx, ptr + n1, &n2) || + !CBB_did_write(&ciphertext, n1 + n2) || + !CBB_flush(out)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(plaintext); + OPENSSL_free(salt_buf); + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c new file mode 100644 index 0000000..b64123e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c.grpc_back new file mode 100644 index 0000000..4458b56 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h new file mode 100644 index 0000000..fe4708c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h @@ -0,0 +1,41 @@ +/* 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_POLY1305_INTERNAL_H +#define OPENSSL_HEADER_POLY1305_INTERNAL_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) +#define OPENSSL_POLY1305_NEON + +void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]); + +void CRYPTO_poly1305_update_neon(poly1305_state *state, const uint8_t *in, + size_t in_len); + +void CRYPTO_poly1305_finish_neon(poly1305_state *state, uint8_t mac[16]); +#endif + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_POLY1305_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h.grpc_back new file mode 100644 index 0000000..251b1f4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h.grpc_back @@ -0,0 +1,41 @@ +/* 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_POLY1305_INTERNAL_H +#define OPENSSL_HEADER_POLY1305_INTERNAL_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) +#define OPENSSL_POLY1305_NEON + +void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]); + +void CRYPTO_poly1305_update_neon(poly1305_state *state, const uint8_t *in, + size_t in_len); + +void CRYPTO_poly1305_finish_neon(poly1305_state *state, uint8_t mac[16]); +#endif + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_POLY1305_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c new file mode 100644 index 0000000..8812be3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c @@ -0,0 +1,318 @@ +/* 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 implementation of poly1305 is by Andrew Moon +// (https://github.com/floodyberry/poly1305-donna) and released as public +// domain. + +#include + +#include + +#include + +#include "internal.h" +#include "../internal.h" + + +#if !defined(BORINGSSL_HAS_UINT128) || !defined(OPENSSL_X86_64) + +// We can assume little-endian. +static uint32_t U8TO32_LE(const uint8_t *m) { + uint32_t r; + OPENSSL_memcpy(&r, m, sizeof(r)); + return r; +} + +static void U32TO8_LE(uint8_t *m, uint32_t v) { + OPENSSL_memcpy(m, &v, sizeof(v)); +} + +static uint64_t mul32x32_64(uint32_t a, uint32_t b) { return (uint64_t)a * b; } + +struct poly1305_state_st { + uint32_t r0, r1, r2, r3, r4; + uint32_t s1, s2, s3, s4; + uint32_t h0, h1, h2, h3, h4; + uint8_t buf[16]; + unsigned int buf_used; + uint8_t key[16]; +}; + +static inline struct poly1305_state_st *poly1305_aligned_state( + poly1305_state *state) { + return (struct poly1305_state_st *)(((uintptr_t)state + 63) & ~63); +} + +// poly1305_blocks updates |state| given some amount of input data. This +// function may only be called with a |len| that is not a multiple of 16 at the +// end of the data. Otherwise the input must be buffered into 16 byte blocks. +static void poly1305_update(struct poly1305_state_st *state, const uint8_t *in, + size_t len) { + uint32_t t0, t1, t2, t3; + uint64_t t[5]; + uint32_t b; + uint64_t c; + size_t j; + uint8_t mp[16]; + + if (len < 16) { + goto poly1305_donna_atmost15bytes; + } + +poly1305_donna_16bytes: + t0 = U8TO32_LE(in); + t1 = U8TO32_LE(in + 4); + t2 = U8TO32_LE(in + 8); + t3 = U8TO32_LE(in + 12); + + in += 16; + len -= 16; + + state->h0 += t0 & 0x3ffffff; + state->h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff; + state->h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff; + state->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff; + state->h4 += (t3 >> 8) | (1 << 24); + +poly1305_donna_mul: + t[0] = mul32x32_64(state->h0, state->r0) + mul32x32_64(state->h1, state->s4) + + mul32x32_64(state->h2, state->s3) + mul32x32_64(state->h3, state->s2) + + mul32x32_64(state->h4, state->s1); + t[1] = mul32x32_64(state->h0, state->r1) + mul32x32_64(state->h1, state->r0) + + mul32x32_64(state->h2, state->s4) + mul32x32_64(state->h3, state->s3) + + mul32x32_64(state->h4, state->s2); + t[2] = mul32x32_64(state->h0, state->r2) + mul32x32_64(state->h1, state->r1) + + mul32x32_64(state->h2, state->r0) + mul32x32_64(state->h3, state->s4) + + mul32x32_64(state->h4, state->s3); + t[3] = mul32x32_64(state->h0, state->r3) + mul32x32_64(state->h1, state->r2) + + mul32x32_64(state->h2, state->r1) + mul32x32_64(state->h3, state->r0) + + mul32x32_64(state->h4, state->s4); + t[4] = mul32x32_64(state->h0, state->r4) + mul32x32_64(state->h1, state->r3) + + mul32x32_64(state->h2, state->r2) + mul32x32_64(state->h3, state->r1) + + mul32x32_64(state->h4, state->r0); + + state->h0 = (uint32_t)t[0] & 0x3ffffff; + c = (t[0] >> 26); + t[1] += c; + state->h1 = (uint32_t)t[1] & 0x3ffffff; + b = (uint32_t)(t[1] >> 26); + t[2] += b; + state->h2 = (uint32_t)t[2] & 0x3ffffff; + b = (uint32_t)(t[2] >> 26); + t[3] += b; + state->h3 = (uint32_t)t[3] & 0x3ffffff; + b = (uint32_t)(t[3] >> 26); + t[4] += b; + state->h4 = (uint32_t)t[4] & 0x3ffffff; + b = (uint32_t)(t[4] >> 26); + state->h0 += b * 5; + + if (len >= 16) { + goto poly1305_donna_16bytes; + } + +// final bytes +poly1305_donna_atmost15bytes: + if (!len) { + return; + } + + for (j = 0; j < len; j++) { + mp[j] = in[j]; + } + mp[j++] = 1; + for (; j < 16; j++) { + mp[j] = 0; + } + len = 0; + + t0 = U8TO32_LE(mp + 0); + t1 = U8TO32_LE(mp + 4); + t2 = U8TO32_LE(mp + 8); + t3 = U8TO32_LE(mp + 12); + + state->h0 += t0 & 0x3ffffff; + state->h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff; + state->h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff; + state->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff; + state->h4 += (t3 >> 8); + + goto poly1305_donna_mul; +} + +void CRYPTO_poly1305_init(poly1305_state *statep, const uint8_t key[32]) { + struct poly1305_state_st *state = poly1305_aligned_state(statep); + uint32_t t0, t1, t2, t3; + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_init_neon(statep, key); + return; + } +#endif + + t0 = U8TO32_LE(key + 0); + t1 = U8TO32_LE(key + 4); + t2 = U8TO32_LE(key + 8); + t3 = U8TO32_LE(key + 12); + + // precompute multipliers + state->r0 = t0 & 0x3ffffff; + t0 >>= 26; + t0 |= t1 << 6; + state->r1 = t0 & 0x3ffff03; + t1 >>= 20; + t1 |= t2 << 12; + state->r2 = t1 & 0x3ffc0ff; + t2 >>= 14; + t2 |= t3 << 18; + state->r3 = t2 & 0x3f03fff; + t3 >>= 8; + state->r4 = t3 & 0x00fffff; + + state->s1 = state->r1 * 5; + state->s2 = state->r2 * 5; + state->s3 = state->r3 * 5; + state->s4 = state->r4 * 5; + + // init state + state->h0 = 0; + state->h1 = 0; + state->h2 = 0; + state->h3 = 0; + state->h4 = 0; + + state->buf_used = 0; + OPENSSL_memcpy(state->key, key + 16, sizeof(state->key)); +} + +void CRYPTO_poly1305_update(poly1305_state *statep, const uint8_t *in, + size_t in_len) { + unsigned int i; + struct poly1305_state_st *state = poly1305_aligned_state(statep); + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_update_neon(statep, in, in_len); + return; + } +#endif + + if (state->buf_used) { + unsigned todo = 16 - state->buf_used; + if (todo > in_len) { + todo = (unsigned)in_len; + } + for (i = 0; i < todo; i++) { + state->buf[state->buf_used + i] = in[i]; + } + state->buf_used += todo; + in_len -= todo; + in += todo; + + if (state->buf_used == 16) { + poly1305_update(state, state->buf, 16); + state->buf_used = 0; + } + } + + if (in_len >= 16) { + size_t todo = in_len & ~0xf; + poly1305_update(state, in, todo); + in += todo; + in_len &= 0xf; + } + + if (in_len) { + for (i = 0; i < in_len; i++) { + state->buf[i] = in[i]; + } + state->buf_used = (unsigned)in_len; + } +} + +void CRYPTO_poly1305_finish(poly1305_state *statep, uint8_t mac[16]) { + struct poly1305_state_st *state = poly1305_aligned_state(statep); + uint64_t f0, f1, f2, f3; + uint32_t g0, g1, g2, g3, g4; + uint32_t b, nb; + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_finish_neon(statep, mac); + return; + } +#endif + + if (state->buf_used) { + poly1305_update(state, state->buf, state->buf_used); + } + + b = state->h0 >> 26; + state->h0 = state->h0 & 0x3ffffff; + state->h1 += b; + b = state->h1 >> 26; + state->h1 = state->h1 & 0x3ffffff; + state->h2 += b; + b = state->h2 >> 26; + state->h2 = state->h2 & 0x3ffffff; + state->h3 += b; + b = state->h3 >> 26; + state->h3 = state->h3 & 0x3ffffff; + state->h4 += b; + b = state->h4 >> 26; + state->h4 = state->h4 & 0x3ffffff; + state->h0 += b * 5; + + g0 = state->h0 + 5; + b = g0 >> 26; + g0 &= 0x3ffffff; + g1 = state->h1 + b; + b = g1 >> 26; + g1 &= 0x3ffffff; + g2 = state->h2 + b; + b = g2 >> 26; + g2 &= 0x3ffffff; + g3 = state->h3 + b; + b = g3 >> 26; + g3 &= 0x3ffffff; + g4 = state->h4 + b - (1 << 26); + + b = (g4 >> 31) - 1; + nb = ~b; + state->h0 = (state->h0 & nb) | (g0 & b); + state->h1 = (state->h1 & nb) | (g1 & b); + state->h2 = (state->h2 & nb) | (g2 & b); + state->h3 = (state->h3 & nb) | (g3 & b); + state->h4 = (state->h4 & nb) | (g4 & b); + + f0 = ((state->h0) | (state->h1 << 26)) + (uint64_t)U8TO32_LE(&state->key[0]); + f1 = ((state->h1 >> 6) | (state->h2 << 20)) + + (uint64_t)U8TO32_LE(&state->key[4]); + f2 = ((state->h2 >> 12) | (state->h3 << 14)) + + (uint64_t)U8TO32_LE(&state->key[8]); + f3 = ((state->h3 >> 18) | (state->h4 << 8)) + + (uint64_t)U8TO32_LE(&state->key[12]); + + U32TO8_LE(&mac[0], f0); + f1 += (f0 >> 32); + U32TO8_LE(&mac[4], f1); + f2 += (f1 >> 32); + U32TO8_LE(&mac[8], f2); + f3 += (f2 >> 32); + U32TO8_LE(&mac[12], f3); +} + +#endif // !BORINGSSL_HAS_UINT128 || !OPENSSL_X86_64 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back new file mode 100644 index 0000000..a6dd145 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back @@ -0,0 +1,318 @@ +/* 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 implementation of poly1305 is by Andrew Moon +// (https://github.com/floodyberry/poly1305-donna) and released as public +// domain. + +#include + +#include + +#include + +#include "internal.h" +#include "../internal.h" + + +#if !defined(BORINGSSL_HAS_UINT128) || !defined(OPENSSL_X86_64) + +// We can assume little-endian. +static uint32_t U8TO32_LE(const uint8_t *m) { + uint32_t r; + OPENSSL_memcpy(&r, m, sizeof(r)); + return r; +} + +static void U32TO8_LE(uint8_t *m, uint32_t v) { + OPENSSL_memcpy(m, &v, sizeof(v)); +} + +static uint64_t mul32x32_64(uint32_t a, uint32_t b) { return (uint64_t)a * b; } + +struct poly1305_state_st { + uint32_t r0, r1, r2, r3, r4; + uint32_t s1, s2, s3, s4; + uint32_t h0, h1, h2, h3, h4; + uint8_t buf[16]; + unsigned int buf_used; + uint8_t key[16]; +}; + +static inline struct poly1305_state_st *poly1305_aligned_state( + poly1305_state *state) { + return (struct poly1305_state_st *)(((uintptr_t)state + 63) & ~63); +} + +// poly1305_blocks updates |state| given some amount of input data. This +// function may only be called with a |len| that is not a multiple of 16 at the +// end of the data. Otherwise the input must be buffered into 16 byte blocks. +static void poly1305_update(struct poly1305_state_st *state, const uint8_t *in, + size_t len) { + uint32_t t0, t1, t2, t3; + uint64_t t[5]; + uint32_t b; + uint64_t c; + size_t j; + uint8_t mp[16]; + + if (len < 16) { + goto poly1305_donna_atmost15bytes; + } + +poly1305_donna_16bytes: + t0 = U8TO32_LE(in); + t1 = U8TO32_LE(in + 4); + t2 = U8TO32_LE(in + 8); + t3 = U8TO32_LE(in + 12); + + in += 16; + len -= 16; + + state->h0 += t0 & 0x3ffffff; + state->h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff; + state->h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff; + state->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff; + state->h4 += (t3 >> 8) | (1 << 24); + +poly1305_donna_mul: + t[0] = mul32x32_64(state->h0, state->r0) + mul32x32_64(state->h1, state->s4) + + mul32x32_64(state->h2, state->s3) + mul32x32_64(state->h3, state->s2) + + mul32x32_64(state->h4, state->s1); + t[1] = mul32x32_64(state->h0, state->r1) + mul32x32_64(state->h1, state->r0) + + mul32x32_64(state->h2, state->s4) + mul32x32_64(state->h3, state->s3) + + mul32x32_64(state->h4, state->s2); + t[2] = mul32x32_64(state->h0, state->r2) + mul32x32_64(state->h1, state->r1) + + mul32x32_64(state->h2, state->r0) + mul32x32_64(state->h3, state->s4) + + mul32x32_64(state->h4, state->s3); + t[3] = mul32x32_64(state->h0, state->r3) + mul32x32_64(state->h1, state->r2) + + mul32x32_64(state->h2, state->r1) + mul32x32_64(state->h3, state->r0) + + mul32x32_64(state->h4, state->s4); + t[4] = mul32x32_64(state->h0, state->r4) + mul32x32_64(state->h1, state->r3) + + mul32x32_64(state->h2, state->r2) + mul32x32_64(state->h3, state->r1) + + mul32x32_64(state->h4, state->r0); + + state->h0 = (uint32_t)t[0] & 0x3ffffff; + c = (t[0] >> 26); + t[1] += c; + state->h1 = (uint32_t)t[1] & 0x3ffffff; + b = (uint32_t)(t[1] >> 26); + t[2] += b; + state->h2 = (uint32_t)t[2] & 0x3ffffff; + b = (uint32_t)(t[2] >> 26); + t[3] += b; + state->h3 = (uint32_t)t[3] & 0x3ffffff; + b = (uint32_t)(t[3] >> 26); + t[4] += b; + state->h4 = (uint32_t)t[4] & 0x3ffffff; + b = (uint32_t)(t[4] >> 26); + state->h0 += b * 5; + + if (len >= 16) { + goto poly1305_donna_16bytes; + } + +// final bytes +poly1305_donna_atmost15bytes: + if (!len) { + return; + } + + for (j = 0; j < len; j++) { + mp[j] = in[j]; + } + mp[j++] = 1; + for (; j < 16; j++) { + mp[j] = 0; + } + len = 0; + + t0 = U8TO32_LE(mp + 0); + t1 = U8TO32_LE(mp + 4); + t2 = U8TO32_LE(mp + 8); + t3 = U8TO32_LE(mp + 12); + + state->h0 += t0 & 0x3ffffff; + state->h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff; + state->h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff; + state->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff; + state->h4 += (t3 >> 8); + + goto poly1305_donna_mul; +} + +void CRYPTO_poly1305_init(poly1305_state *statep, const uint8_t key[32]) { + struct poly1305_state_st *state = poly1305_aligned_state(statep); + uint32_t t0, t1, t2, t3; + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_init_neon(statep, key); + return; + } +#endif + + t0 = U8TO32_LE(key + 0); + t1 = U8TO32_LE(key + 4); + t2 = U8TO32_LE(key + 8); + t3 = U8TO32_LE(key + 12); + + // precompute multipliers + state->r0 = t0 & 0x3ffffff; + t0 >>= 26; + t0 |= t1 << 6; + state->r1 = t0 & 0x3ffff03; + t1 >>= 20; + t1 |= t2 << 12; + state->r2 = t1 & 0x3ffc0ff; + t2 >>= 14; + t2 |= t3 << 18; + state->r3 = t2 & 0x3f03fff; + t3 >>= 8; + state->r4 = t3 & 0x00fffff; + + state->s1 = state->r1 * 5; + state->s2 = state->r2 * 5; + state->s3 = state->r3 * 5; + state->s4 = state->r4 * 5; + + // init state + state->h0 = 0; + state->h1 = 0; + state->h2 = 0; + state->h3 = 0; + state->h4 = 0; + + state->buf_used = 0; + OPENSSL_memcpy(state->key, key + 16, sizeof(state->key)); +} + +void CRYPTO_poly1305_update(poly1305_state *statep, const uint8_t *in, + size_t in_len) { + unsigned int i; + struct poly1305_state_st *state = poly1305_aligned_state(statep); + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_update_neon(statep, in, in_len); + return; + } +#endif + + if (state->buf_used) { + unsigned todo = 16 - state->buf_used; + if (todo > in_len) { + todo = (unsigned)in_len; + } + for (i = 0; i < todo; i++) { + state->buf[state->buf_used + i] = in[i]; + } + state->buf_used += todo; + in_len -= todo; + in += todo; + + if (state->buf_used == 16) { + poly1305_update(state, state->buf, 16); + state->buf_used = 0; + } + } + + if (in_len >= 16) { + size_t todo = in_len & ~0xf; + poly1305_update(state, in, todo); + in += todo; + in_len &= 0xf; + } + + if (in_len) { + for (i = 0; i < in_len; i++) { + state->buf[i] = in[i]; + } + state->buf_used = (unsigned)in_len; + } +} + +void CRYPTO_poly1305_finish(poly1305_state *statep, uint8_t mac[16]) { + struct poly1305_state_st *state = poly1305_aligned_state(statep); + uint64_t f0, f1, f2, f3; + uint32_t g0, g1, g2, g3, g4; + uint32_t b, nb; + +#if defined(OPENSSL_POLY1305_NEON) + if (CRYPTO_is_NEON_capable()) { + CRYPTO_poly1305_finish_neon(statep, mac); + return; + } +#endif + + if (state->buf_used) { + poly1305_update(state, state->buf, state->buf_used); + } + + b = state->h0 >> 26; + state->h0 = state->h0 & 0x3ffffff; + state->h1 += b; + b = state->h1 >> 26; + state->h1 = state->h1 & 0x3ffffff; + state->h2 += b; + b = state->h2 >> 26; + state->h2 = state->h2 & 0x3ffffff; + state->h3 += b; + b = state->h3 >> 26; + state->h3 = state->h3 & 0x3ffffff; + state->h4 += b; + b = state->h4 >> 26; + state->h4 = state->h4 & 0x3ffffff; + state->h0 += b * 5; + + g0 = state->h0 + 5; + b = g0 >> 26; + g0 &= 0x3ffffff; + g1 = state->h1 + b; + b = g1 >> 26; + g1 &= 0x3ffffff; + g2 = state->h2 + b; + b = g2 >> 26; + g2 &= 0x3ffffff; + g3 = state->h3 + b; + b = g3 >> 26; + g3 &= 0x3ffffff; + g4 = state->h4 + b - (1 << 26); + + b = (g4 >> 31) - 1; + nb = ~b; + state->h0 = (state->h0 & nb) | (g0 & b); + state->h1 = (state->h1 & nb) | (g1 & b); + state->h2 = (state->h2 & nb) | (g2 & b); + state->h3 = (state->h3 & nb) | (g3 & b); + state->h4 = (state->h4 & nb) | (g4 & b); + + f0 = ((state->h0) | (state->h1 << 26)) + (uint64_t)U8TO32_LE(&state->key[0]); + f1 = ((state->h1 >> 6) | (state->h2 << 20)) + + (uint64_t)U8TO32_LE(&state->key[4]); + f2 = ((state->h2 >> 12) | (state->h3 << 14)) + + (uint64_t)U8TO32_LE(&state->key[8]); + f3 = ((state->h3 >> 18) | (state->h4 << 8)) + + (uint64_t)U8TO32_LE(&state->key[12]); + + U32TO8_LE(&mac[0], f0); + f1 += (f0 >> 32); + U32TO8_LE(&mac[4], f1); + f2 += (f1 >> 32); + U32TO8_LE(&mac[8], f2); + f3 += (f2 >> 32); + U32TO8_LE(&mac[12], f3); +} + +#endif // !BORINGSSL_HAS_UINT128 || !OPENSSL_X86_64 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c new file mode 100644 index 0000000..4944278 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c @@ -0,0 +1,305 @@ +/* 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 implementation was taken from the public domain, neon2 version in +// SUPERCOP by D. J. Bernstein and Peter Schwabe. + +#include + +#include + +#include "../internal.h" +#include "internal.h" + + +#if defined(OPENSSL_POLY1305_NEON) + +typedef struct { + uint32_t v[12]; // for alignment; only using 10 +} fe1305x2; + +#define addmulmod openssl_poly1305_neon2_addmulmod +#define blocks openssl_poly1305_neon2_blocks + +extern void addmulmod(fe1305x2 *r, const fe1305x2 *x, const fe1305x2 *y, + const fe1305x2 *c); + +extern int blocks(fe1305x2 *h, const fe1305x2 *precomp, const uint8_t *in, + unsigned int inlen); + +static void freeze(fe1305x2 *r) { + int i; + + uint32_t x0 = r->v[0]; + uint32_t x1 = r->v[2]; + uint32_t x2 = r->v[4]; + uint32_t x3 = r->v[6]; + uint32_t x4 = r->v[8]; + uint32_t y0; + uint32_t y1; + uint32_t y2; + uint32_t y3; + uint32_t y4; + uint32_t swap; + + for (i = 0; i < 3; ++i) { + x1 += x0 >> 26; + x0 &= 0x3ffffff; + x2 += x1 >> 26; + x1 &= 0x3ffffff; + x3 += x2 >> 26; + x2 &= 0x3ffffff; + x4 += x3 >> 26; + x3 &= 0x3ffffff; + x0 += 5 * (x4 >> 26); + x4 &= 0x3ffffff; + } + + y0 = x0 + 5; + y1 = x1 + (y0 >> 26); + y0 &= 0x3ffffff; + y2 = x2 + (y1 >> 26); + y1 &= 0x3ffffff; + y3 = x3 + (y2 >> 26); + y2 &= 0x3ffffff; + y4 = x4 + (y3 >> 26); + y3 &= 0x3ffffff; + swap = -(y4 >> 26); + y4 &= 0x3ffffff; + + y0 ^= x0; + y1 ^= x1; + y2 ^= x2; + y3 ^= x3; + y4 ^= x4; + + y0 &= swap; + y1 &= swap; + y2 &= swap; + y3 &= swap; + y4 &= swap; + + y0 ^= x0; + y1 ^= x1; + y2 ^= x2; + y3 ^= x3; + y4 ^= x4; + + r->v[0] = y0; + r->v[2] = y1; + r->v[4] = y2; + r->v[6] = y3; + r->v[8] = y4; +} + +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]; + uint32_t x3 = x->v[6]; + uint32_t x4 = x->v[8]; + + x1 += x0 >> 26; + x0 &= 0x3ffffff; + x2 += x1 >> 26; + x1 &= 0x3ffffff; + x3 += x2 >> 26; + x2 &= 0x3ffffff; + x4 += x3 >> 26; + x3 &= 0x3ffffff; + + 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, size_t xlen) { + unsigned i; + uint8_t t[17]; + + for (i = 0; (i < 16) && (i < xlen); i++) { + t[i] = x[i]; + } + xlen -= i; + x += i; + t[i++] = 1; + for (; i < 17; i++) { + t[i] = 0; + } + + r->v[0] = 0x3ffffff & load32(t); + r->v[2] = 0x3ffffff & (load32(t + 3) >> 2); + r->v[4] = 0x3ffffff & (load32(t + 6) >> 4); + r->v[6] = 0x3ffffff & (load32(t + 9) >> 6); + r->v[8] = load32(t + 13); + + if (xlen) { + for (i = 0; (i < 16) && (i < xlen); i++) { + t[i] = x[i]; + } + t[i++] = 1; + for (; i < 17; i++) { + t[i] = 0; + } + + r->v[1] = 0x3ffffff & load32(t); + r->v[3] = 0x3ffffff & (load32(t + 3) >> 2); + r->v[5] = 0x3ffffff & (load32(t + 6) >> 4); + r->v[7] = 0x3ffffff & (load32(t + 9) >> 6); + r->v[9] = load32(t + 13); + } else { + r->v[1] = r->v[3] = r->v[5] = r->v[7] = r->v[9] = 0; + } +} + +static const alignas(16) fe1305x2 zero; + +struct poly1305_state_st { + uint8_t data[sizeof(fe1305x2[5]) + 128]; + uint8_t buf[32]; + unsigned int buf_used; + uint8_t key[16]; +}; + +void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + unsigned int j; + + 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 + } + + addmulmod(precomp, r, r, &zero); // precompute r^2 + addmulmod(precomp + 1, precomp, precomp, &zero); // precompute r^4 + + OPENSSL_memcpy(st->key, key + 16, 16); + st->buf_used = 0; +} + +void CRYPTO_poly1305_update_neon(poly1305_state *state, const uint8_t *in, + size_t in_len) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + unsigned int i; + + if (st->buf_used) { + unsigned int todo = 32 - st->buf_used; + if (todo > in_len) { + todo = in_len; + } + for (i = 0; i < todo; i++) { + st->buf[st->buf_used + i] = in[i]; + } + st->buf_used += todo; + in_len -= todo; + in += todo; + + if (st->buf_used == sizeof(st->buf) && in_len) { + addmulmod(h, h, precomp, &zero); + fe1305x2_frombytearray(c, st->buf, sizeof(st->buf)); + for (i = 0; i < 10; i++) { + h->v[i] += c->v[i]; + } + st->buf_used = 0; + } + } + + while (in_len > 32) { + unsigned int tlen = 1048576; + if (in_len < tlen) { + tlen = in_len; + } + tlen -= blocks(h, precomp, in, tlen); + in_len -= tlen; + in += tlen; + } + + if (in_len) { + for (i = 0; i < in_len; i++) { + st->buf[i] = in[i]; + } + st->buf_used = in_len; + } +} + +void CRYPTO_poly1305_finish_neon(poly1305_state *state, uint8_t mac[16]) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + + addmulmod(h, h, precomp, &zero); + + if (st->buf_used > 16) { + fe1305x2_frombytearray(c, st->buf, st->buf_used); + precomp->v[1] = r->v[1]; + precomp->v[3] = r->v[3]; + precomp->v[5] = r->v[5]; + precomp->v[7] = r->v[7]; + precomp->v[9] = r->v[9]; + addmulmod(h, h, precomp, c); + } else if (st->buf_used > 0) { + fe1305x2_frombytearray(c, st->buf, st->buf_used); + r->v[1] = 1; + r->v[3] = 0; + r->v[5] = 0; + r->v[7] = 0; + r->v[9] = 0; + addmulmod(h, h, r, c); + } + + h->v[0] += h->v[1]; + h->v[2] += h->v[3]; + h->v[4] += h->v[5]; + h->v[6] += h->v[7]; + h->v[8] += h->v[9]; + freeze(h); + + fe1305x2_frombytearray(c, st->key, 16); + c->v[8] ^= (1 << 24); + + h->v[0] += c->v[0]; + h->v[2] += c->v[2]; + h->v[4] += c->v[4]; + h->v[6] += c->v[6]; + h->v[8] += c->v[8]; + fe1305x2_tobytearray(mac, h); +} + +#endif // OPENSSL_POLY1305_NEON diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back new file mode 100644 index 0000000..004221d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back @@ -0,0 +1,305 @@ +/* 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 implementation was taken from the public domain, neon2 version in +// SUPERCOP by D. J. Bernstein and Peter Schwabe. + +#include + +#include + +#include "../internal.h" +#include "internal.h" + + +#if defined(OPENSSL_POLY1305_NEON) + +typedef struct { + uint32_t v[12]; // for alignment; only using 10 +} fe1305x2; + +#define addmulmod openssl_poly1305_neon2_addmulmod +#define blocks openssl_poly1305_neon2_blocks + +extern void addmulmod(fe1305x2 *r, const fe1305x2 *x, const fe1305x2 *y, + const fe1305x2 *c); + +extern int blocks(fe1305x2 *h, const fe1305x2 *precomp, const uint8_t *in, + unsigned int inlen); + +static void freeze(fe1305x2 *r) { + int i; + + uint32_t x0 = r->v[0]; + uint32_t x1 = r->v[2]; + uint32_t x2 = r->v[4]; + uint32_t x3 = r->v[6]; + uint32_t x4 = r->v[8]; + uint32_t y0; + uint32_t y1; + uint32_t y2; + uint32_t y3; + uint32_t y4; + uint32_t swap; + + for (i = 0; i < 3; ++i) { + x1 += x0 >> 26; + x0 &= 0x3ffffff; + x2 += x1 >> 26; + x1 &= 0x3ffffff; + x3 += x2 >> 26; + x2 &= 0x3ffffff; + x4 += x3 >> 26; + x3 &= 0x3ffffff; + x0 += 5 * (x4 >> 26); + x4 &= 0x3ffffff; + } + + y0 = x0 + 5; + y1 = x1 + (y0 >> 26); + y0 &= 0x3ffffff; + y2 = x2 + (y1 >> 26); + y1 &= 0x3ffffff; + y3 = x3 + (y2 >> 26); + y2 &= 0x3ffffff; + y4 = x4 + (y3 >> 26); + y3 &= 0x3ffffff; + swap = -(y4 >> 26); + y4 &= 0x3ffffff; + + y0 ^= x0; + y1 ^= x1; + y2 ^= x2; + y3 ^= x3; + y4 ^= x4; + + y0 &= swap; + y1 &= swap; + y2 &= swap; + y3 &= swap; + y4 &= swap; + + y0 ^= x0; + y1 ^= x1; + y2 ^= x2; + y3 ^= x3; + y4 ^= x4; + + r->v[0] = y0; + r->v[2] = y1; + r->v[4] = y2; + r->v[6] = y3; + r->v[8] = y4; +} + +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]; + uint32_t x3 = x->v[6]; + uint32_t x4 = x->v[8]; + + x1 += x0 >> 26; + x0 &= 0x3ffffff; + x2 += x1 >> 26; + x1 &= 0x3ffffff; + x3 += x2 >> 26; + x2 &= 0x3ffffff; + x4 += x3 >> 26; + x3 &= 0x3ffffff; + + 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, size_t xlen) { + unsigned i; + uint8_t t[17]; + + for (i = 0; (i < 16) && (i < xlen); i++) { + t[i] = x[i]; + } + xlen -= i; + x += i; + t[i++] = 1; + for (; i < 17; i++) { + t[i] = 0; + } + + r->v[0] = 0x3ffffff & load32(t); + r->v[2] = 0x3ffffff & (load32(t + 3) >> 2); + r->v[4] = 0x3ffffff & (load32(t + 6) >> 4); + r->v[6] = 0x3ffffff & (load32(t + 9) >> 6); + r->v[8] = load32(t + 13); + + if (xlen) { + for (i = 0; (i < 16) && (i < xlen); i++) { + t[i] = x[i]; + } + t[i++] = 1; + for (; i < 17; i++) { + t[i] = 0; + } + + r->v[1] = 0x3ffffff & load32(t); + r->v[3] = 0x3ffffff & (load32(t + 3) >> 2); + r->v[5] = 0x3ffffff & (load32(t + 6) >> 4); + r->v[7] = 0x3ffffff & (load32(t + 9) >> 6); + r->v[9] = load32(t + 13); + } else { + r->v[1] = r->v[3] = r->v[5] = r->v[7] = r->v[9] = 0; + } +} + +static const alignas(16) fe1305x2 zero; + +struct poly1305_state_st { + uint8_t data[sizeof(fe1305x2[5]) + 128]; + uint8_t buf[32]; + unsigned int buf_used; + uint8_t key[16]; +}; + +void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + unsigned int j; + + 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 + } + + addmulmod(precomp, r, r, &zero); // precompute r^2 + addmulmod(precomp + 1, precomp, precomp, &zero); // precompute r^4 + + OPENSSL_memcpy(st->key, key + 16, 16); + st->buf_used = 0; +} + +void CRYPTO_poly1305_update_neon(poly1305_state *state, const uint8_t *in, + size_t in_len) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + unsigned int i; + + if (st->buf_used) { + unsigned int todo = 32 - st->buf_used; + if (todo > in_len) { + todo = in_len; + } + for (i = 0; i < todo; i++) { + st->buf[st->buf_used + i] = in[i]; + } + st->buf_used += todo; + in_len -= todo; + in += todo; + + if (st->buf_used == sizeof(st->buf) && in_len) { + addmulmod(h, h, precomp, &zero); + fe1305x2_frombytearray(c, st->buf, sizeof(st->buf)); + for (i = 0; i < 10; i++) { + h->v[i] += c->v[i]; + } + st->buf_used = 0; + } + } + + while (in_len > 32) { + unsigned int tlen = 1048576; + if (in_len < tlen) { + tlen = in_len; + } + tlen -= blocks(h, precomp, in, tlen); + in_len -= tlen; + in += tlen; + } + + if (in_len) { + for (i = 0; i < in_len; i++) { + st->buf[i] = in[i]; + } + st->buf_used = in_len; + } +} + +void CRYPTO_poly1305_finish_neon(poly1305_state *state, uint8_t mac[16]) { + struct poly1305_state_st *st = (struct poly1305_state_st *)(state); + fe1305x2 *const r = (fe1305x2 *)(st->data + (15 & (-(int)st->data))); + fe1305x2 *const h = r + 1; + fe1305x2 *const c = h + 1; + fe1305x2 *const precomp = c + 1; + + addmulmod(h, h, precomp, &zero); + + if (st->buf_used > 16) { + fe1305x2_frombytearray(c, st->buf, st->buf_used); + precomp->v[1] = r->v[1]; + precomp->v[3] = r->v[3]; + precomp->v[5] = r->v[5]; + precomp->v[7] = r->v[7]; + precomp->v[9] = r->v[9]; + addmulmod(h, h, precomp, c); + } else if (st->buf_used > 0) { + fe1305x2_frombytearray(c, st->buf, st->buf_used); + r->v[1] = 1; + r->v[3] = 0; + r->v[5] = 0; + r->v[7] = 0; + r->v[9] = 0; + addmulmod(h, h, r, c); + } + + h->v[0] += h->v[1]; + h->v[2] += h->v[3]; + h->v[4] += h->v[5]; + h->v[6] += h->v[7]; + h->v[8] += h->v[9]; + freeze(h); + + fe1305x2_frombytearray(c, st->key, 16); + c->v[8] ^= (1 << 24); + + h->v[0] += c->v[0]; + h->v[2] += c->v[2]; + h->v[4] += c->v[4]; + h->v[6] += c->v[6]; + h->v[8] += c->v[8]; + fe1305x2_tobytearray(mac, h); +} + +#endif // OPENSSL_POLY1305_NEON diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c new file mode 100644 index 0000000..81410f4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c @@ -0,0 +1,856 @@ +/* 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 implementation of poly1305 is by Andrew Moon +// (https://github.com/floodyberry/poly1305-donna) and released as public +// domain. It implements SIMD vectorization based on the algorithm described in +// http://cr.yp.to/papers.html#neoncrypto. Unrolled to 2 powers, i.e. 64 byte +// block size + +#include + +#include "../internal.h" + + +#if defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_X86_64) + +#include + +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; + +static const alignas(16) uint32_t poly1305_x64_sse2_message_mask[4] = { + (1 << 26) - 1, 0, (1 << 26) - 1, 0}; +static const alignas(16) uint32_t poly1305_x64_sse2_5[4] = {5, 0, 5, 0}; +static const alignas(16) uint32_t poly1305_x64_sse2_1shl128[4] = { + (1 << 24), 0, (1 << 24), 0}; + +static inline uint128_t add128(uint128_t a, uint128_t b) { return a + b; } + +static inline uint128_t add128_64(uint128_t a, uint64_t b) { return a + b; } + +static inline uint128_t mul64x64_128(uint64_t a, uint64_t b) { + return (uint128_t)a * b; +} + +static inline uint64_t lo128(uint128_t a) { return (uint64_t)a; } + +static inline uint64_t shr128(uint128_t v, const int shift) { + return (uint64_t)(v >> shift); +} + +static inline uint64_t shr128_pair(uint64_t hi, uint64_t lo, const int shift) { + return (uint64_t)((((uint128_t)hi << 64) | lo) >> shift); +} + +typedef struct poly1305_power_t { + union { + xmmi v; + uint64_t u[2]; + uint32_t d[4]; + } R20, R21, R22, R23, R24, S21, S22, S23, S24; +} poly1305_power; + +typedef struct poly1305_state_internal_t { + poly1305_power P[2]; /* 288 bytes, top 32 bit halves unused = 144 + bytes of free storage */ + union { + xmmi H[5]; // 80 bytes + uint64_t HH[10]; + }; + // uint64_t r0,r1,r2; [24 bytes] + // uint64_t pad0,pad1; [16 bytes] + uint64_t started; // 8 bytes + uint64_t leftover; // 8 bytes + uint8_t buffer[64]; // 64 bytes +} poly1305_state_internal; /* 448 bytes total + 63 bytes for + alignment = 511 bytes raw */ + +static inline poly1305_state_internal *poly1305_aligned_state( + poly1305_state *state) { + return (poly1305_state_internal *)(((uint64_t)state + 63) & ~63); +} + +static inline size_t poly1305_min(size_t a, size_t b) { + return (a < b) ? a : b; +} + +void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { + poly1305_state_internal *st = poly1305_aligned_state(state); + poly1305_power *p; + uint64_t r0, r1, r2; + uint64_t t0, t1; + + // clamp key + t0 = load_u64_le(key + 0); + t1 = load_u64_le(key + 8); + r0 = t0 & 0xffc0fffffff; + t0 >>= 44; + t0 |= t1 << 20; + r1 = t0 & 0xfffffc0ffff; + t1 >>= 24; + r2 = t1 & 0x00ffffffc0f; + + // store r in un-used space of st->P[1] + p = &st->P[1]; + p->R20.d[1] = (uint32_t)(r0); + p->R20.d[3] = (uint32_t)(r0 >> 32); + p->R21.d[1] = (uint32_t)(r1); + p->R21.d[3] = (uint32_t)(r1 >> 32); + p->R22.d[1] = (uint32_t)(r2); + p->R22.d[3] = (uint32_t)(r2 >> 32); + + // store pad + 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(); + st->H[1] = _mm_setzero_si128(); + st->H[2] = _mm_setzero_si128(); + st->H[3] = _mm_setzero_si128(); + st->H[4] = _mm_setzero_si128(); + + st->started = 0; + st->leftover = 0; +} + +static void poly1305_first_block(poly1305_state_internal *st, + const uint8_t *m) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + xmmi T5, T6; + poly1305_power *p; + uint128_t d[3]; + uint64_t r0, r1, r2; + uint64_t r20, r21, r22, s22; + uint64_t pad0, pad1; + uint64_t c; + uint64_t i; + + // pull out stored info + p = &st->P[1]; + + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + pad0 = ((uint64_t)p->R23.d[3] << 32) | (uint64_t)p->R23.d[1]; + pad1 = ((uint64_t)p->R24.d[3] << 32) | (uint64_t)p->R24.d[1]; + + // compute powers r^2,r^4 + r20 = r0; + r21 = r1; + r22 = r2; + for (i = 0; i < 2; i++) { + s22 = r22 * (5 << 2); + + d[0] = add128(mul64x64_128(r20, r20), mul64x64_128(r21 * 2, s22)); + d[1] = add128(mul64x64_128(r22, s22), mul64x64_128(r20 * 2, r21)); + d[2] = add128(mul64x64_128(r21, r21), mul64x64_128(r22 * 2, r20)); + + r20 = lo128(d[0]) & 0xfffffffffff; + c = shr128(d[0], 44); + d[1] = add128_64(d[1], c); + r21 = lo128(d[1]) & 0xfffffffffff; + c = shr128(d[1], 44); + d[2] = add128_64(d[2], c); + r22 = lo128(d[2]) & 0x3ffffffffff; + c = shr128(d[2], 42); + r20 += c * 5; + c = (r20 >> 44); + r20 = r20 & 0xfffffffffff; + r21 += c; + + p->R20.v = _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)(r20)&0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R21.v = _mm_shuffle_epi32( + _mm_cvtsi32_si128((uint32_t)((r20 >> 26) | (r21 << 18)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R22.v = + _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)((r21 >> 8)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R23.v = _mm_shuffle_epi32( + _mm_cvtsi32_si128((uint32_t)((r21 >> 34) | (r22 << 10)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R24.v = _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)((r22 >> 16))), + _MM_SHUFFLE(1, 0, 1, 0)); + p->S21.v = _mm_mul_epu32(p->R21.v, FIVE); + p->S22.v = _mm_mul_epu32(p->R22.v, FIVE); + p->S23.v = _mm_mul_epu32(p->R23.v, FIVE); + p->S24.v = _mm_mul_epu32(p->R24.v, FIVE); + p--; + } + + // put saved info back + p = &st->P[1]; + p->R20.d[1] = (uint32_t)(r0); + p->R20.d[3] = (uint32_t)(r0 >> 32); + p->R21.d[1] = (uint32_t)(r1); + p->R21.d[3] = (uint32_t)(r1 >> 32); + p->R22.d[1] = (uint32_t)(r2); + p->R22.d[3] = (uint32_t)(r2 >> 32); + p->R23.d[1] = (uint32_t)(pad0); + p->R23.d[3] = (uint32_t)(pad0 >> 32); + p->R24.d[1] = (uint32_t)(pad1); + p->R24.d[3] = (uint32_t)(pad1 >> 32); + + // H = [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + st->H[0] = _mm_and_si128(MMASK, T5); + st->H[1] = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + st->H[2] = _mm_and_si128(MMASK, T5); + st->H[3] = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + st->H[4] = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); +} + +static void poly1305_blocks(poly1305_state_internal *st, const uint8_t *m, + size_t bytes) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + + poly1305_power *p; + xmmi H0, H1, H2, H3, H4; + xmmi T0, T1, T2, T3, T4, T5, T6; + xmmi M0, M1, M2, M3, M4; + xmmi C1, C2; + + H0 = st->H[0]; + H1 = st->H[1]; + H2 = st->H[2]; + H3 = st->H[3]; + H4 = st->H[4]; + + while (bytes >= 64) { + // H *= [r^4,r^4] + p = &st->P[0]; + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My]*[r^2,r^2] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + p = &st->P[1]; + T5 = _mm_mul_epu32(M0, p->R20.v); + T6 = _mm_mul_epu32(M0, p->R21.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M1, p->S24.v); + T6 = _mm_mul_epu32(M1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M2, p->S23.v); + T6 = _mm_mul_epu32(M2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M3, p->S22.v); + T6 = _mm_mul_epu32(M3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M4, p->S21.v); + T6 = _mm_mul_epu32(M4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M0, p->R22.v); + T6 = _mm_mul_epu32(M0, p->R23.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M1, p->R21.v); + T6 = _mm_mul_epu32(M1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M2, p->R20.v); + T6 = _mm_mul_epu32(M2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M3, p->S24.v); + T6 = _mm_mul_epu32(M3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M4, p->S23.v); + T6 = _mm_mul_epu32(M4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M0, p->R24.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 32)), + _mm_loadl_epi64((const xmmi *)(m + 48))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 40)), + _mm_loadl_epi64((const xmmi *)(m + 56))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + T0 = _mm_add_epi64(T0, M0); + T1 = _mm_add_epi64(T1, M1); + T2 = _mm_add_epi64(T2, M2); + T3 = _mm_add_epi64(T3, M3); + T4 = _mm_add_epi64(T4, M4); + + // reduce + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = (H*[r^4,r^4] + [Mx,My]*[r^2,r^2] + [Mx,My]) + H0 = T0; + H1 = T1; + H2 = T2; + H3 = T3; + H4 = T4; + + m += 64; + bytes -= 64; + } + + st->H[0] = H0; + st->H[1] = H1; + st->H[2] = H2; + st->H[3] = H3; + st->H[4] = H4; +} + +static size_t poly1305_combine(poly1305_state_internal *st, const uint8_t *m, + size_t bytes) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + + poly1305_power *p; + xmmi H0, H1, H2, H3, H4; + xmmi M0, M1, M2, M3, M4; + xmmi T0, T1, T2, T3, T4, T5, T6; + xmmi C1, C2; + + uint64_t r0, r1, r2; + uint64_t t0, t1, t2, t3, t4; + uint64_t c; + size_t consumed = 0; + + H0 = st->H[0]; + H1 = st->H[1]; + H2 = st->H[2]; + H3 = st->H[3]; + H4 = st->H[4]; + + // p = [r^2,r^2] + p = &st->P[1]; + + if (bytes >= 32) { + // H *= [r^2,r^2] + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + T0 = _mm_add_epi64(T0, M0); + T1 = _mm_add_epi64(T1, M1); + T2 = _mm_add_epi64(T2, M2); + T3 = _mm_add_epi64(T3, M3); + T4 = _mm_add_epi64(T4, M4); + + // reduce + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = (H*[r^2,r^2] + [Mx,My]) + H0 = T0; + H1 = T1; + H2 = T2; + H3 = T3; + H4 = T4; + + consumed = 32; + } + + // finalize, H *= [r^2,r] + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + + p->R20.d[2] = (uint32_t)(r0)&0x3ffffff; + p->R21.d[2] = (uint32_t)((r0 >> 26) | (r1 << 18)) & 0x3ffffff; + p->R22.d[2] = (uint32_t)((r1 >> 8)) & 0x3ffffff; + p->R23.d[2] = (uint32_t)((r1 >> 34) | (r2 << 10)) & 0x3ffffff; + p->R24.d[2] = (uint32_t)((r2 >> 16)); + p->S21.d[2] = p->R21.d[2] * 5; + p->S22.d[2] = p->R22.d[2] * 5; + p->S23.d[2] = p->R23.d[2] * 5; + p->S24.d[2] = p->R24.d[2] * 5; + + // H *= [r^2,r] + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = H[0]+H[1] + H0 = _mm_add_epi64(T0, _mm_srli_si128(T0, 8)); + H1 = _mm_add_epi64(T1, _mm_srli_si128(T1, 8)); + H2 = _mm_add_epi64(T2, _mm_srli_si128(T2, 8)); + H3 = _mm_add_epi64(T3, _mm_srli_si128(T3, 8)); + H4 = _mm_add_epi64(T4, _mm_srli_si128(T4, 8)); + + t0 = _mm_cvtsi128_si32(H0); + c = (t0 >> 26); + t0 &= 0x3ffffff; + t1 = _mm_cvtsi128_si32(H1) + c; + c = (t1 >> 26); + t1 &= 0x3ffffff; + t2 = _mm_cvtsi128_si32(H2) + c; + c = (t2 >> 26); + t2 &= 0x3ffffff; + t3 = _mm_cvtsi128_si32(H3) + c; + c = (t3 >> 26); + t3 &= 0x3ffffff; + t4 = _mm_cvtsi128_si32(H4) + c; + c = (t4 >> 26); + t4 &= 0x3ffffff; + t0 = t0 + (c * 5); + c = (t0 >> 26); + t0 &= 0x3ffffff; + t1 = t1 + c; + + st->HH[0] = ((t0) | (t1 << 26)) & UINT64_C(0xfffffffffff); + st->HH[1] = ((t1 >> 18) | (t2 << 8) | (t3 << 34)) & UINT64_C(0xfffffffffff); + st->HH[2] = ((t3 >> 10) | (t4 << 16)) & UINT64_C(0x3ffffffffff); + + return consumed; +} + +void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *m, + size_t bytes) { + 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)) { + poly1305_first_block(st, m); + m += 32; + bytes -= 32; + } else { + want = poly1305_min(32 - st->leftover, bytes); + OPENSSL_memcpy(st->buffer + st->leftover, m, want); + bytes -= want; + m += want; + st->leftover += want; + if ((st->leftover < 32) || (bytes == 0)) { + return; + } + poly1305_first_block(st, st->buffer); + st->leftover = 0; + } + st->started = 1; + } + + // handle leftover + if (st->leftover) { + want = poly1305_min(64 - st->leftover, bytes); + OPENSSL_memcpy(st->buffer + st->leftover, m, want); + bytes -= want; + m += want; + st->leftover += want; + if (st->leftover < 64) { + return; + } + poly1305_blocks(st, st->buffer, 64); + st->leftover = 0; + } + + // process 64 byte blocks + if (bytes >= 64) { + want = (bytes & ~63); + poly1305_blocks(st, m, want); + m += want; + bytes -= want; + } + + if (bytes) { + OPENSSL_memcpy(st->buffer + st->leftover, m, bytes); + st->leftover += bytes; + } +} + +void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { + poly1305_state_internal *st = poly1305_aligned_state(state); + size_t leftover = st->leftover; + uint8_t *m = st->buffer; + uint128_t d[3]; + uint64_t h0, h1, h2; + uint64_t t0, t1; + uint64_t g0, g1, g2, c, nc; + uint64_t r0, r1, r2, s1, s2; + poly1305_power *p; + + if (st->started) { + size_t consumed = poly1305_combine(st, m, leftover); + leftover -= consumed; + m += consumed; + } + + // st->HH will either be 0 or have the combined result + h0 = st->HH[0]; + h1 = st->HH[1]; + h2 = st->HH[2]; + + p = &st->P[1]; + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + s1 = r1 * (5 << 2); + s2 = r2 * (5 << 2); + + if (leftover < 16) { + goto poly1305_donna_atmost15bytes; + } + +poly1305_donna_atleast16bytes: + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); + h0 += t0 & 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += t0 & 0xfffffffffff; + h2 += (t1 >> 24) | ((uint64_t)1 << 40); + +poly1305_donna_mul: + d[0] = add128(add128(mul64x64_128(h0, r0), mul64x64_128(h1, s2)), + mul64x64_128(h2, s1)); + d[1] = add128(add128(mul64x64_128(h0, r1), mul64x64_128(h1, r0)), + mul64x64_128(h2, s2)); + d[2] = add128(add128(mul64x64_128(h0, r2), mul64x64_128(h1, r1)), + mul64x64_128(h2, r0)); + h0 = lo128(d[0]) & 0xfffffffffff; + c = shr128(d[0], 44); + d[1] = add128_64(d[1], c); + h1 = lo128(d[1]) & 0xfffffffffff; + c = shr128(d[1], 44); + d[2] = add128_64(d[2], c); + h2 = lo128(d[2]) & 0x3ffffffffff; + c = shr128(d[2], 42); + h0 += c * 5; + + m += 16; + leftover -= 16; + if (leftover >= 16) { + goto poly1305_donna_atleast16bytes; + } + +// final bytes +poly1305_donna_atmost15bytes: + if (!leftover) { + goto poly1305_donna_finish; + } + + m[leftover++] = 1; + OPENSSL_memset(m + leftover, 0, 16 - leftover); + leftover = 16; + + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); + h0 += t0 & 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += t0 & 0xfffffffffff; + h2 += (t1 >> 24); + + goto poly1305_donna_mul; + +poly1305_donna_finish: + c = (h0 >> 44); + h0 &= 0xfffffffffff; + h1 += c; + c = (h1 >> 44); + h1 &= 0xfffffffffff; + h2 += c; + c = (h2 >> 42); + h2 &= 0x3ffffffffff; + h0 += c * 5; + + g0 = h0 + 5; + c = (g0 >> 44); + g0 &= 0xfffffffffff; + g1 = h1 + c; + c = (g1 >> 44); + g1 &= 0xfffffffffff; + g2 = h2 + c - ((uint64_t)1 << 42); + + c = (g2 >> 63) - 1; + nc = ~c; + h0 = (h0 & nc) | (g0 & c); + h1 = (h1 & nc) | (g1 & c); + h2 = (h2 & nc) | (g2 & c); + + // pad + t0 = ((uint64_t)p->R23.d[3] << 32) | (uint64_t)p->R23.d[1]; + t1 = ((uint64_t)p->R24.d[3] << 32) | (uint64_t)p->R24.d[1]; + h0 += (t0 & 0xfffffffffff); + c = (h0 >> 44); + h0 &= 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += (t0 & 0xfffffffffff) + c; + c = (h1 >> 44); + h1 &= 0xfffffffffff; + t1 = (t1 >> 24); + h2 += (t1)+c; + + store_u64_le(mac + 0, ((h0) | (h1 << 44))); + store_u64_le(mac + 8, ((h1 >> 20) | (h2 << 24))); +} + +#endif // BORINGSSL_HAS_UINT128 && OPENSSL_X86_64 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back new file mode 100644 index 0000000..29cd5c3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back @@ -0,0 +1,856 @@ +/* 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 implementation of poly1305 is by Andrew Moon +// (https://github.com/floodyberry/poly1305-donna) and released as public +// domain. It implements SIMD vectorization based on the algorithm described in +// http://cr.yp.to/papers.html#neoncrypto. Unrolled to 2 powers, i.e. 64 byte +// block size + +#include + +#include "../internal.h" + + +#if defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_X86_64) + +#include + +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; + +static const alignas(16) uint32_t poly1305_x64_sse2_message_mask[4] = { + (1 << 26) - 1, 0, (1 << 26) - 1, 0}; +static const alignas(16) uint32_t poly1305_x64_sse2_5[4] = {5, 0, 5, 0}; +static const alignas(16) uint32_t poly1305_x64_sse2_1shl128[4] = { + (1 << 24), 0, (1 << 24), 0}; + +static inline uint128_t add128(uint128_t a, uint128_t b) { return a + b; } + +static inline uint128_t add128_64(uint128_t a, uint64_t b) { return a + b; } + +static inline uint128_t mul64x64_128(uint64_t a, uint64_t b) { + return (uint128_t)a * b; +} + +static inline uint64_t lo128(uint128_t a) { return (uint64_t)a; } + +static inline uint64_t shr128(uint128_t v, const int shift) { + return (uint64_t)(v >> shift); +} + +static inline uint64_t shr128_pair(uint64_t hi, uint64_t lo, const int shift) { + return (uint64_t)((((uint128_t)hi << 64) | lo) >> shift); +} + +typedef struct poly1305_power_t { + union { + xmmi v; + uint64_t u[2]; + uint32_t d[4]; + } R20, R21, R22, R23, R24, S21, S22, S23, S24; +} poly1305_power; + +typedef struct poly1305_state_internal_t { + poly1305_power P[2]; /* 288 bytes, top 32 bit halves unused = 144 + bytes of free storage */ + union { + xmmi H[5]; // 80 bytes + uint64_t HH[10]; + }; + // uint64_t r0,r1,r2; [24 bytes] + // uint64_t pad0,pad1; [16 bytes] + uint64_t started; // 8 bytes + uint64_t leftover; // 8 bytes + uint8_t buffer[64]; // 64 bytes +} poly1305_state_internal; /* 448 bytes total + 63 bytes for + alignment = 511 bytes raw */ + +static inline poly1305_state_internal *poly1305_aligned_state( + poly1305_state *state) { + return (poly1305_state_internal *)(((uint64_t)state + 63) & ~63); +} + +static inline size_t poly1305_min(size_t a, size_t b) { + return (a < b) ? a : b; +} + +void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { + poly1305_state_internal *st = poly1305_aligned_state(state); + poly1305_power *p; + uint64_t r0, r1, r2; + uint64_t t0, t1; + + // clamp key + t0 = load_u64_le(key + 0); + t1 = load_u64_le(key + 8); + r0 = t0 & 0xffc0fffffff; + t0 >>= 44; + t0 |= t1 << 20; + r1 = t0 & 0xfffffc0ffff; + t1 >>= 24; + r2 = t1 & 0x00ffffffc0f; + + // store r in un-used space of st->P[1] + p = &st->P[1]; + p->R20.d[1] = (uint32_t)(r0); + p->R20.d[3] = (uint32_t)(r0 >> 32); + p->R21.d[1] = (uint32_t)(r1); + p->R21.d[3] = (uint32_t)(r1 >> 32); + p->R22.d[1] = (uint32_t)(r2); + p->R22.d[3] = (uint32_t)(r2 >> 32); + + // store pad + 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(); + st->H[1] = _mm_setzero_si128(); + st->H[2] = _mm_setzero_si128(); + st->H[3] = _mm_setzero_si128(); + st->H[4] = _mm_setzero_si128(); + + st->started = 0; + st->leftover = 0; +} + +static void poly1305_first_block(poly1305_state_internal *st, + const uint8_t *m) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + xmmi T5, T6; + poly1305_power *p; + uint128_t d[3]; + uint64_t r0, r1, r2; + uint64_t r20, r21, r22, s22; + uint64_t pad0, pad1; + uint64_t c; + uint64_t i; + + // pull out stored info + p = &st->P[1]; + + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + pad0 = ((uint64_t)p->R23.d[3] << 32) | (uint64_t)p->R23.d[1]; + pad1 = ((uint64_t)p->R24.d[3] << 32) | (uint64_t)p->R24.d[1]; + + // compute powers r^2,r^4 + r20 = r0; + r21 = r1; + r22 = r2; + for (i = 0; i < 2; i++) { + s22 = r22 * (5 << 2); + + d[0] = add128(mul64x64_128(r20, r20), mul64x64_128(r21 * 2, s22)); + d[1] = add128(mul64x64_128(r22, s22), mul64x64_128(r20 * 2, r21)); + d[2] = add128(mul64x64_128(r21, r21), mul64x64_128(r22 * 2, r20)); + + r20 = lo128(d[0]) & 0xfffffffffff; + c = shr128(d[0], 44); + d[1] = add128_64(d[1], c); + r21 = lo128(d[1]) & 0xfffffffffff; + c = shr128(d[1], 44); + d[2] = add128_64(d[2], c); + r22 = lo128(d[2]) & 0x3ffffffffff; + c = shr128(d[2], 42); + r20 += c * 5; + c = (r20 >> 44); + r20 = r20 & 0xfffffffffff; + r21 += c; + + p->R20.v = _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)(r20)&0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R21.v = _mm_shuffle_epi32( + _mm_cvtsi32_si128((uint32_t)((r20 >> 26) | (r21 << 18)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R22.v = + _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)((r21 >> 8)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R23.v = _mm_shuffle_epi32( + _mm_cvtsi32_si128((uint32_t)((r21 >> 34) | (r22 << 10)) & 0x3ffffff), + _MM_SHUFFLE(1, 0, 1, 0)); + p->R24.v = _mm_shuffle_epi32(_mm_cvtsi32_si128((uint32_t)((r22 >> 16))), + _MM_SHUFFLE(1, 0, 1, 0)); + p->S21.v = _mm_mul_epu32(p->R21.v, FIVE); + p->S22.v = _mm_mul_epu32(p->R22.v, FIVE); + p->S23.v = _mm_mul_epu32(p->R23.v, FIVE); + p->S24.v = _mm_mul_epu32(p->R24.v, FIVE); + p--; + } + + // put saved info back + p = &st->P[1]; + p->R20.d[1] = (uint32_t)(r0); + p->R20.d[3] = (uint32_t)(r0 >> 32); + p->R21.d[1] = (uint32_t)(r1); + p->R21.d[3] = (uint32_t)(r1 >> 32); + p->R22.d[1] = (uint32_t)(r2); + p->R22.d[3] = (uint32_t)(r2 >> 32); + p->R23.d[1] = (uint32_t)(pad0); + p->R23.d[3] = (uint32_t)(pad0 >> 32); + p->R24.d[1] = (uint32_t)(pad1); + p->R24.d[3] = (uint32_t)(pad1 >> 32); + + // H = [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + st->H[0] = _mm_and_si128(MMASK, T5); + st->H[1] = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + st->H[2] = _mm_and_si128(MMASK, T5); + st->H[3] = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + st->H[4] = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); +} + +static void poly1305_blocks(poly1305_state_internal *st, const uint8_t *m, + size_t bytes) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + + poly1305_power *p; + xmmi H0, H1, H2, H3, H4; + xmmi T0, T1, T2, T3, T4, T5, T6; + xmmi M0, M1, M2, M3, M4; + xmmi C1, C2; + + H0 = st->H[0]; + H1 = st->H[1]; + H2 = st->H[2]; + H3 = st->H[3]; + H4 = st->H[4]; + + while (bytes >= 64) { + // H *= [r^4,r^4] + p = &st->P[0]; + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My]*[r^2,r^2] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + p = &st->P[1]; + T5 = _mm_mul_epu32(M0, p->R20.v); + T6 = _mm_mul_epu32(M0, p->R21.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M1, p->S24.v); + T6 = _mm_mul_epu32(M1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M2, p->S23.v); + T6 = _mm_mul_epu32(M2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M3, p->S22.v); + T6 = _mm_mul_epu32(M3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M4, p->S21.v); + T6 = _mm_mul_epu32(M4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(M0, p->R22.v); + T6 = _mm_mul_epu32(M0, p->R23.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M1, p->R21.v); + T6 = _mm_mul_epu32(M1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M2, p->R20.v); + T6 = _mm_mul_epu32(M2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M3, p->S24.v); + T6 = _mm_mul_epu32(M3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M4, p->S23.v); + T6 = _mm_mul_epu32(M4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(M0, p->R24.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(M4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 32)), + _mm_loadl_epi64((const xmmi *)(m + 48))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 40)), + _mm_loadl_epi64((const xmmi *)(m + 56))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + T0 = _mm_add_epi64(T0, M0); + T1 = _mm_add_epi64(T1, M1); + T2 = _mm_add_epi64(T2, M2); + T3 = _mm_add_epi64(T3, M3); + T4 = _mm_add_epi64(T4, M4); + + // reduce + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = (H*[r^4,r^4] + [Mx,My]*[r^2,r^2] + [Mx,My]) + H0 = T0; + H1 = T1; + H2 = T2; + H3 = T3; + H4 = T4; + + m += 64; + bytes -= 64; + } + + st->H[0] = H0; + st->H[1] = H1; + st->H[2] = H2; + st->H[3] = H3; + st->H[4] = H4; +} + +static size_t poly1305_combine(poly1305_state_internal *st, const uint8_t *m, + size_t bytes) { + const xmmi MMASK = _mm_load_si128((const xmmi *)poly1305_x64_sse2_message_mask); + const xmmi HIBIT = _mm_load_si128((const xmmi *)poly1305_x64_sse2_1shl128); + const xmmi FIVE = _mm_load_si128((const xmmi *)poly1305_x64_sse2_5); + + poly1305_power *p; + xmmi H0, H1, H2, H3, H4; + xmmi M0, M1, M2, M3, M4; + xmmi T0, T1, T2, T3, T4, T5, T6; + xmmi C1, C2; + + uint64_t r0, r1, r2; + uint64_t t0, t1, t2, t3, t4; + uint64_t c; + size_t consumed = 0; + + H0 = st->H[0]; + H1 = st->H[1]; + H2 = st->H[2]; + H3 = st->H[3]; + H4 = st->H[4]; + + // p = [r^2,r^2] + p = &st->P[1]; + + if (bytes >= 32) { + // H *= [r^2,r^2] + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + // H += [Mx,My] + T5 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 0)), + _mm_loadl_epi64((const xmmi *)(m + 16))); + T6 = _mm_unpacklo_epi64(_mm_loadl_epi64((const xmmi *)(m + 8)), + _mm_loadl_epi64((const xmmi *)(m + 24))); + M0 = _mm_and_si128(MMASK, T5); + M1 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + T5 = _mm_or_si128(_mm_srli_epi64(T5, 52), _mm_slli_epi64(T6, 12)); + M2 = _mm_and_si128(MMASK, T5); + M3 = _mm_and_si128(MMASK, _mm_srli_epi64(T5, 26)); + M4 = _mm_or_si128(_mm_srli_epi64(T6, 40), HIBIT); + + T0 = _mm_add_epi64(T0, M0); + T1 = _mm_add_epi64(T1, M1); + T2 = _mm_add_epi64(T2, M2); + T3 = _mm_add_epi64(T3, M3); + T4 = _mm_add_epi64(T4, M4); + + // reduce + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = (H*[r^2,r^2] + [Mx,My]) + H0 = T0; + H1 = T1; + H2 = T2; + H3 = T3; + H4 = T4; + + consumed = 32; + } + + // finalize, H *= [r^2,r] + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + + p->R20.d[2] = (uint32_t)(r0)&0x3ffffff; + p->R21.d[2] = (uint32_t)((r0 >> 26) | (r1 << 18)) & 0x3ffffff; + p->R22.d[2] = (uint32_t)((r1 >> 8)) & 0x3ffffff; + p->R23.d[2] = (uint32_t)((r1 >> 34) | (r2 << 10)) & 0x3ffffff; + p->R24.d[2] = (uint32_t)((r2 >> 16)); + p->S21.d[2] = p->R21.d[2] * 5; + p->S22.d[2] = p->R22.d[2] * 5; + p->S23.d[2] = p->R23.d[2] * 5; + p->S24.d[2] = p->R24.d[2] * 5; + + // H *= [r^2,r] + T0 = _mm_mul_epu32(H0, p->R20.v); + T1 = _mm_mul_epu32(H0, p->R21.v); + T2 = _mm_mul_epu32(H0, p->R22.v); + T3 = _mm_mul_epu32(H0, p->R23.v); + T4 = _mm_mul_epu32(H0, p->R24.v); + T5 = _mm_mul_epu32(H1, p->S24.v); + T6 = _mm_mul_epu32(H1, p->R20.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H2, p->S23.v); + T6 = _mm_mul_epu32(H2, p->S24.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H3, p->S22.v); + T6 = _mm_mul_epu32(H3, p->S23.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H4, p->S21.v); + T6 = _mm_mul_epu32(H4, p->S22.v); + T0 = _mm_add_epi64(T0, T5); + T1 = _mm_add_epi64(T1, T6); + T5 = _mm_mul_epu32(H1, p->R21.v); + T6 = _mm_mul_epu32(H1, p->R22.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H2, p->R20.v); + T6 = _mm_mul_epu32(H2, p->R21.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H3, p->S24.v); + T6 = _mm_mul_epu32(H3, p->R20.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H4, p->S23.v); + T6 = _mm_mul_epu32(H4, p->S24.v); + T2 = _mm_add_epi64(T2, T5); + T3 = _mm_add_epi64(T3, T6); + T5 = _mm_mul_epu32(H1, p->R23.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H2, p->R22.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H3, p->R21.v); + T4 = _mm_add_epi64(T4, T5); + T5 = _mm_mul_epu32(H4, p->R20.v); + T4 = _mm_add_epi64(T4, T5); + + C1 = _mm_srli_epi64(T0, 26); + C2 = _mm_srli_epi64(T3, 26); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_and_si128(T3, MMASK); + T1 = _mm_add_epi64(T1, C1); + T4 = _mm_add_epi64(T4, C2); + C1 = _mm_srli_epi64(T1, 26); + C2 = _mm_srli_epi64(T4, 26); + T1 = _mm_and_si128(T1, MMASK); + T4 = _mm_and_si128(T4, MMASK); + T2 = _mm_add_epi64(T2, C1); + T0 = _mm_add_epi64(T0, _mm_mul_epu32(C2, FIVE)); + C1 = _mm_srli_epi64(T2, 26); + C2 = _mm_srli_epi64(T0, 26); + T2 = _mm_and_si128(T2, MMASK); + T0 = _mm_and_si128(T0, MMASK); + T3 = _mm_add_epi64(T3, C1); + T1 = _mm_add_epi64(T1, C2); + C1 = _mm_srli_epi64(T3, 26); + T3 = _mm_and_si128(T3, MMASK); + T4 = _mm_add_epi64(T4, C1); + + // H = H[0]+H[1] + H0 = _mm_add_epi64(T0, _mm_srli_si128(T0, 8)); + H1 = _mm_add_epi64(T1, _mm_srli_si128(T1, 8)); + H2 = _mm_add_epi64(T2, _mm_srli_si128(T2, 8)); + H3 = _mm_add_epi64(T3, _mm_srli_si128(T3, 8)); + H4 = _mm_add_epi64(T4, _mm_srli_si128(T4, 8)); + + t0 = _mm_cvtsi128_si32(H0); + c = (t0 >> 26); + t0 &= 0x3ffffff; + t1 = _mm_cvtsi128_si32(H1) + c; + c = (t1 >> 26); + t1 &= 0x3ffffff; + t2 = _mm_cvtsi128_si32(H2) + c; + c = (t2 >> 26); + t2 &= 0x3ffffff; + t3 = _mm_cvtsi128_si32(H3) + c; + c = (t3 >> 26); + t3 &= 0x3ffffff; + t4 = _mm_cvtsi128_si32(H4) + c; + c = (t4 >> 26); + t4 &= 0x3ffffff; + t0 = t0 + (c * 5); + c = (t0 >> 26); + t0 &= 0x3ffffff; + t1 = t1 + c; + + st->HH[0] = ((t0) | (t1 << 26)) & UINT64_C(0xfffffffffff); + st->HH[1] = ((t1 >> 18) | (t2 << 8) | (t3 << 34)) & UINT64_C(0xfffffffffff); + st->HH[2] = ((t3 >> 10) | (t4 << 16)) & UINT64_C(0x3ffffffffff); + + return consumed; +} + +void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *m, + size_t bytes) { + 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)) { + poly1305_first_block(st, m); + m += 32; + bytes -= 32; + } else { + want = poly1305_min(32 - st->leftover, bytes); + OPENSSL_memcpy(st->buffer + st->leftover, m, want); + bytes -= want; + m += want; + st->leftover += want; + if ((st->leftover < 32) || (bytes == 0)) { + return; + } + poly1305_first_block(st, st->buffer); + st->leftover = 0; + } + st->started = 1; + } + + // handle leftover + if (st->leftover) { + want = poly1305_min(64 - st->leftover, bytes); + OPENSSL_memcpy(st->buffer + st->leftover, m, want); + bytes -= want; + m += want; + st->leftover += want; + if (st->leftover < 64) { + return; + } + poly1305_blocks(st, st->buffer, 64); + st->leftover = 0; + } + + // process 64 byte blocks + if (bytes >= 64) { + want = (bytes & ~63); + poly1305_blocks(st, m, want); + m += want; + bytes -= want; + } + + if (bytes) { + OPENSSL_memcpy(st->buffer + st->leftover, m, bytes); + st->leftover += bytes; + } +} + +void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { + poly1305_state_internal *st = poly1305_aligned_state(state); + size_t leftover = st->leftover; + uint8_t *m = st->buffer; + uint128_t d[3]; + uint64_t h0, h1, h2; + uint64_t t0, t1; + uint64_t g0, g1, g2, c, nc; + uint64_t r0, r1, r2, s1, s2; + poly1305_power *p; + + if (st->started) { + size_t consumed = poly1305_combine(st, m, leftover); + leftover -= consumed; + m += consumed; + } + + // st->HH will either be 0 or have the combined result + h0 = st->HH[0]; + h1 = st->HH[1]; + h2 = st->HH[2]; + + p = &st->P[1]; + r0 = ((uint64_t)p->R20.d[3] << 32) | (uint64_t)p->R20.d[1]; + r1 = ((uint64_t)p->R21.d[3] << 32) | (uint64_t)p->R21.d[1]; + r2 = ((uint64_t)p->R22.d[3] << 32) | (uint64_t)p->R22.d[1]; + s1 = r1 * (5 << 2); + s2 = r2 * (5 << 2); + + if (leftover < 16) { + goto poly1305_donna_atmost15bytes; + } + +poly1305_donna_atleast16bytes: + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); + h0 += t0 & 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += t0 & 0xfffffffffff; + h2 += (t1 >> 24) | ((uint64_t)1 << 40); + +poly1305_donna_mul: + d[0] = add128(add128(mul64x64_128(h0, r0), mul64x64_128(h1, s2)), + mul64x64_128(h2, s1)); + d[1] = add128(add128(mul64x64_128(h0, r1), mul64x64_128(h1, r0)), + mul64x64_128(h2, s2)); + d[2] = add128(add128(mul64x64_128(h0, r2), mul64x64_128(h1, r1)), + mul64x64_128(h2, r0)); + h0 = lo128(d[0]) & 0xfffffffffff; + c = shr128(d[0], 44); + d[1] = add128_64(d[1], c); + h1 = lo128(d[1]) & 0xfffffffffff; + c = shr128(d[1], 44); + d[2] = add128_64(d[2], c); + h2 = lo128(d[2]) & 0x3ffffffffff; + c = shr128(d[2], 42); + h0 += c * 5; + + m += 16; + leftover -= 16; + if (leftover >= 16) { + goto poly1305_donna_atleast16bytes; + } + +// final bytes +poly1305_donna_atmost15bytes: + if (!leftover) { + goto poly1305_donna_finish; + } + + m[leftover++] = 1; + OPENSSL_memset(m + leftover, 0, 16 - leftover); + leftover = 16; + + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); + h0 += t0 & 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += t0 & 0xfffffffffff; + h2 += (t1 >> 24); + + goto poly1305_donna_mul; + +poly1305_donna_finish: + c = (h0 >> 44); + h0 &= 0xfffffffffff; + h1 += c; + c = (h1 >> 44); + h1 &= 0xfffffffffff; + h2 += c; + c = (h2 >> 42); + h2 &= 0x3ffffffffff; + h0 += c * 5; + + g0 = h0 + 5; + c = (g0 >> 44); + g0 &= 0xfffffffffff; + g1 = h1 + c; + c = (g1 >> 44); + g1 &= 0xfffffffffff; + g2 = h2 + c - ((uint64_t)1 << 42); + + c = (g2 >> 63) - 1; + nc = ~c; + h0 = (h0 & nc) | (g0 & c); + h1 = (h1 & nc) | (g1 & c); + h2 = (h2 & nc) | (g2 & c); + + // pad + t0 = ((uint64_t)p->R23.d[3] << 32) | (uint64_t)p->R23.d[1]; + t1 = ((uint64_t)p->R24.d[3] << 32) | (uint64_t)p->R24.d[1]; + h0 += (t0 & 0xfffffffffff); + c = (h0 >> 44); + h0 &= 0xfffffffffff; + t0 = shr128_pair(t1, t0, 44); + h1 += (t0 & 0xfffffffffff) + c; + c = (h1 >> 44); + h1 &= 0xfffffffffff; + t1 = (t1 >> 24); + h2 += (t1)+c; + + store_u64_le(mac + 0, ((h0) | (h1 << 44))); + store_u64_le(mac + 8, ((h1 >> 20) | (h2 << 24))); +} + +#endif // BORINGSSL_HAS_UINT128 && OPENSSL_X86_64 diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h new file mode 100644 index 0000000..b8ae032 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h.grpc_back new file mode 100644 index 0000000..ed91de6 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c new file mode 100644 index 0000000..e457856 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c @@ -0,0 +1,220 @@ +/* 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 "../internal.h" +#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); +} + +static int CRYPTO_BUFFER_cmp(const CRYPTO_BUFFER *a, const CRYPTO_BUFFER *b) { + if (a->len != b->len) { + return 1; + } + return OPENSSL_memcmp(a->data, b->data, a->len); +} + +CRYPTO_BUFFER_POOL* CRYPTO_BUFFER_POOL_new(void) { + CRYPTO_BUFFER_POOL *pool = OPENSSL_malloc(sizeof(CRYPTO_BUFFER_POOL)); + if (pool == NULL) { + return NULL; + } + + OPENSSL_memset(pool, 0, sizeof(CRYPTO_BUFFER_POOL)); + pool->bufs = lh_CRYPTO_BUFFER_new(CRYPTO_BUFFER_hash, CRYPTO_BUFFER_cmp); + if (pool->bufs == NULL) { + OPENSSL_free(pool); + return NULL; + } + + CRYPTO_MUTEX_init(&pool->lock); + + return pool; +} + +void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool) { + if (pool == NULL) { + return; + } + +#if !defined(NDEBUG) + CRYPTO_MUTEX_lock_write(&pool->lock); + assert(lh_CRYPTO_BUFFER_num_items(pool->bufs) == 0); + CRYPTO_MUTEX_unlock_write(&pool->lock); +#endif + + lh_CRYPTO_BUFFER_free(pool->bufs); + CRYPTO_MUTEX_cleanup(&pool->lock); + OPENSSL_free(pool); +} + +CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, + CRYPTO_BUFFER_POOL *pool) { + if (pool != NULL) { + CRYPTO_BUFFER tmp; + tmp.data = (uint8_t *) data; + tmp.len = len; + + CRYPTO_MUTEX_lock_read(&pool->lock); + CRYPTO_BUFFER *const duplicate = + lh_CRYPTO_BUFFER_retrieve(pool->bufs, &tmp); + if (duplicate != NULL) { + CRYPTO_refcount_inc(&duplicate->references); + } + CRYPTO_MUTEX_unlock_read(&pool->lock); + + if (duplicate != NULL) { + return duplicate; + } + } + + CRYPTO_BUFFER *const buf = OPENSSL_malloc(sizeof(CRYPTO_BUFFER)); + if (buf == NULL) { + return NULL; + } + OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); + + buf->data = OPENSSL_memdup(data, len); + if (len != 0 && buf->data == NULL) { + OPENSSL_free(buf); + return NULL; + } + + buf->len = len; + buf->references = 1; + + if (pool == NULL) { + return buf; + } + + buf->pool = pool; + + CRYPTO_MUTEX_lock_write(&pool->lock); + CRYPTO_BUFFER *duplicate = lh_CRYPTO_BUFFER_retrieve(pool->bufs, buf); + int inserted = 0; + if (duplicate == NULL) { + CRYPTO_BUFFER *old = NULL; + inserted = lh_CRYPTO_BUFFER_insert(pool->bufs, &old, buf); + assert(old == NULL); + } else { + CRYPTO_refcount_inc(&duplicate->references); + } + CRYPTO_MUTEX_unlock_write(&pool->lock); + + if (!inserted) { + // We raced to insert |buf| into the pool and lost, or else there was an + // error inserting. + OPENSSL_free(buf->data); + OPENSSL_free(buf); + return duplicate; + } + + 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); +} + +void CRYPTO_BUFFER_free(CRYPTO_BUFFER *buf) { + if (buf == NULL) { + return; + } + + CRYPTO_BUFFER_POOL *const pool = buf->pool; + if (pool == NULL) { + if (CRYPTO_refcount_dec_and_test_zero(&buf->references)) { + // If a reference count of zero is observed, there cannot be a reference + // from any pool to this buffer and thus we are able to free this + // buffer. + OPENSSL_free(buf->data); + OPENSSL_free(buf); + } + + return; + } + + CRYPTO_MUTEX_lock_write(&pool->lock); + if (!CRYPTO_refcount_dec_and_test_zero(&buf->references)) { + CRYPTO_MUTEX_unlock_write(&buf->pool->lock); + return; + } + + // We have an exclusive lock on the pool, therefore no concurrent lookups can + // find this buffer and increment the reference count. Thus, if the count is + // zero there are and can never be any more references and thus we can free + // this buffer. + void *found = lh_CRYPTO_BUFFER_delete(pool->bufs, buf); + assert(found != NULL); + assert(found == buf); + (void)found; + CRYPTO_MUTEX_unlock_write(&buf->pool->lock); + OPENSSL_free(buf->data); + OPENSSL_free(buf); +} + +int CRYPTO_BUFFER_up_ref(CRYPTO_BUFFER *buf) { + // This is safe in the case that |buf->pool| is NULL because it's just + // standard reference counting in that case. + // + // This is also safe if |buf->pool| is non-NULL because, if it were racing + // with |CRYPTO_BUFFER_free| then the two callers must have independent + // references already and so the reference count will never hit zero. + CRYPTO_refcount_inc(&buf->references); + return 1; +} + +const uint8_t *CRYPTO_BUFFER_data(const CRYPTO_BUFFER *buf) { + return buf->data; +} + +size_t CRYPTO_BUFFER_len(const CRYPTO_BUFFER *buf) { + return buf->len; +} + +void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out) { + CBS_init(out, buf->data, buf->len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back new file mode 100644 index 0000000..917e43c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back @@ -0,0 +1,220 @@ +/* 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 "../internal.h" +#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); +} + +static int CRYPTO_BUFFER_cmp(const CRYPTO_BUFFER *a, const CRYPTO_BUFFER *b) { + if (a->len != b->len) { + return 1; + } + return OPENSSL_memcmp(a->data, b->data, a->len); +} + +CRYPTO_BUFFER_POOL* CRYPTO_BUFFER_POOL_new(void) { + CRYPTO_BUFFER_POOL *pool = OPENSSL_malloc(sizeof(CRYPTO_BUFFER_POOL)); + if (pool == NULL) { + return NULL; + } + + OPENSSL_memset(pool, 0, sizeof(CRYPTO_BUFFER_POOL)); + pool->bufs = lh_CRYPTO_BUFFER_new(CRYPTO_BUFFER_hash, CRYPTO_BUFFER_cmp); + if (pool->bufs == NULL) { + OPENSSL_free(pool); + return NULL; + } + + CRYPTO_MUTEX_init(&pool->lock); + + return pool; +} + +void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool) { + if (pool == NULL) { + return; + } + +#if !defined(NDEBUG) + CRYPTO_MUTEX_lock_write(&pool->lock); + assert(lh_CRYPTO_BUFFER_num_items(pool->bufs) == 0); + CRYPTO_MUTEX_unlock_write(&pool->lock); +#endif + + lh_CRYPTO_BUFFER_free(pool->bufs); + CRYPTO_MUTEX_cleanup(&pool->lock); + OPENSSL_free(pool); +} + +CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, + CRYPTO_BUFFER_POOL *pool) { + if (pool != NULL) { + CRYPTO_BUFFER tmp; + tmp.data = (uint8_t *) data; + tmp.len = len; + + CRYPTO_MUTEX_lock_read(&pool->lock); + CRYPTO_BUFFER *const duplicate = + lh_CRYPTO_BUFFER_retrieve(pool->bufs, &tmp); + if (duplicate != NULL) { + CRYPTO_refcount_inc(&duplicate->references); + } + CRYPTO_MUTEX_unlock_read(&pool->lock); + + if (duplicate != NULL) { + return duplicate; + } + } + + CRYPTO_BUFFER *const buf = OPENSSL_malloc(sizeof(CRYPTO_BUFFER)); + if (buf == NULL) { + return NULL; + } + OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); + + buf->data = OPENSSL_memdup(data, len); + if (len != 0 && buf->data == NULL) { + OPENSSL_free(buf); + return NULL; + } + + buf->len = len; + buf->references = 1; + + if (pool == NULL) { + return buf; + } + + buf->pool = pool; + + CRYPTO_MUTEX_lock_write(&pool->lock); + CRYPTO_BUFFER *duplicate = lh_CRYPTO_BUFFER_retrieve(pool->bufs, buf); + int inserted = 0; + if (duplicate == NULL) { + CRYPTO_BUFFER *old = NULL; + inserted = lh_CRYPTO_BUFFER_insert(pool->bufs, &old, buf); + assert(old == NULL); + } else { + CRYPTO_refcount_inc(&duplicate->references); + } + CRYPTO_MUTEX_unlock_write(&pool->lock); + + if (!inserted) { + // We raced to insert |buf| into the pool and lost, or else there was an + // error inserting. + OPENSSL_free(buf->data); + OPENSSL_free(buf); + return duplicate; + } + + 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); +} + +void CRYPTO_BUFFER_free(CRYPTO_BUFFER *buf) { + if (buf == NULL) { + return; + } + + CRYPTO_BUFFER_POOL *const pool = buf->pool; + if (pool == NULL) { + if (CRYPTO_refcount_dec_and_test_zero(&buf->references)) { + // If a reference count of zero is observed, there cannot be a reference + // from any pool to this buffer and thus we are able to free this + // buffer. + OPENSSL_free(buf->data); + OPENSSL_free(buf); + } + + return; + } + + CRYPTO_MUTEX_lock_write(&pool->lock); + if (!CRYPTO_refcount_dec_and_test_zero(&buf->references)) { + CRYPTO_MUTEX_unlock_write(&buf->pool->lock); + return; + } + + // We have an exclusive lock on the pool, therefore no concurrent lookups can + // find this buffer and increment the reference count. Thus, if the count is + // zero there are and can never be any more references and thus we can free + // this buffer. + void *found = lh_CRYPTO_BUFFER_delete(pool->bufs, buf); + assert(found != NULL); + assert(found == buf); + (void)found; + CRYPTO_MUTEX_unlock_write(&buf->pool->lock); + OPENSSL_free(buf->data); + OPENSSL_free(buf); +} + +int CRYPTO_BUFFER_up_ref(CRYPTO_BUFFER *buf) { + // This is safe in the case that |buf->pool| is NULL because it's just + // standard reference counting in that case. + // + // This is also safe if |buf->pool| is non-NULL because, if it were racing + // with |CRYPTO_BUFFER_free| then the two callers must have independent + // references already and so the reference count will never hit zero. + CRYPTO_refcount_inc(&buf->references); + return 1; +} + +const uint8_t *CRYPTO_BUFFER_data(const CRYPTO_BUFFER *buf) { + return buf->data; +} + +size_t CRYPTO_BUFFER_len(const CRYPTO_BUFFER *buf) { + return buf->len; +} + +void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out) { + CBS_init(out, buf->data, buf->len); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c new file mode 100644 index 0000000..bbb16e0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c @@ -0,0 +1,56 @@ +/* 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(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include + +#include + +#include "../internal.h" +#include "../fipsmodule/rand/internal.h" + + +// g_num_calls is the number of calls to |CRYPTO_sysrand| that have occurred. +// +// This is intentionally not thread-safe. If the fuzzer mode is ever used in a +// multi-threaded program, replace this with a thread-local. (A mutex would not +// be deterministic.) +static uint64_t g_num_calls = 0; + +void RAND_reset_for_fuzzing(void) { g_num_calls = 0; } + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + static const uint8_t kZeroKey[32]; + + uint8_t nonce[12]; + OPENSSL_memset(nonce, 0, sizeof(nonce)); + OPENSSL_memcpy(nonce, &g_num_calls, sizeof(g_num_calls)); + + OPENSSL_memset(out, 0, requested); + CRYPTO_chacha_20(out, out, requested, kZeroKey, nonce, 0); + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back new file mode 100644 index 0000000..34547ea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back @@ -0,0 +1,56 @@ +/* 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(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include + +#include + +#include "../internal.h" +#include "../fipsmodule/rand/internal.h" + + +// g_num_calls is the number of calls to |CRYPTO_sysrand| that have occurred. +// +// This is intentionally not thread-safe. If the fuzzer mode is ever used in a +// multi-threaded program, replace this with a thread-local. (A mutex would not +// be deterministic.) +static uint64_t g_num_calls = 0; + +void RAND_reset_for_fuzzing(void) { g_num_calls = 0; } + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + static const uint8_t kZeroKey[32]; + + uint8_t nonce[12]; + OPENSSL_memset(nonce, 0, sizeof(nonce)); + OPENSSL_memcpy(nonce, &g_num_calls, sizeof(g_num_calls)); + + OPENSSL_memset(out, 0, requested); + CRYPTO_chacha_20(out, out, requested, kZeroKey, nonce, 0); + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c new file mode 100644 index 0000000..bd90472 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c @@ -0,0 +1,46 @@ +/* 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 "../fipsmodule/rand/internal.h" + + +// g_buffering_enabled is true if fork-unsafe buffering has been enabled. +static int g_buffering_enabled = 0; + +// g_lock protects |g_buffering_enabled|. +static struct CRYPTO_STATIC_MUTEX g_lock = CRYPTO_STATIC_MUTEX_INIT; + +#if !defined(OPENSSL_WINDOWS) +void RAND_enable_fork_unsafe_buffering(int fd) { + // We no longer support setting the file-descriptor with this function. + if (fd != -1) { + abort(); + } + + CRYPTO_STATIC_MUTEX_lock_write(&g_lock); + g_buffering_enabled = 1; + CRYPTO_STATIC_MUTEX_unlock_write(&g_lock); +} +#endif + +int rand_fork_unsafe_buffering_enabled(void) { + CRYPTO_STATIC_MUTEX_lock_read(&g_lock); + const int ret = g_buffering_enabled; + CRYPTO_STATIC_MUTEX_unlock_read(&g_lock); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c.grpc_back new file mode 100644 index 0000000..0f1ecec --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c.grpc_back @@ -0,0 +1,46 @@ +/* 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 "../fipsmodule/rand/internal.h" + + +// g_buffering_enabled is true if fork-unsafe buffering has been enabled. +static int g_buffering_enabled = 0; + +// g_lock protects |g_buffering_enabled|. +static struct CRYPTO_STATIC_MUTEX g_lock = CRYPTO_STATIC_MUTEX_INIT; + +#if !defined(OPENSSL_WINDOWS) +void RAND_enable_fork_unsafe_buffering(int fd) { + // We no longer support setting the file-descriptor with this function. + if (fd != -1) { + abort(); + } + + CRYPTO_STATIC_MUTEX_lock_write(&g_lock); + g_buffering_enabled = 1; + CRYPTO_STATIC_MUTEX_unlock_write(&g_lock); +} +#endif + +int rand_fork_unsafe_buffering_enabled(void) { + CRYPTO_STATIC_MUTEX_lock_read(&g_lock); + const int ret = g_buffering_enabled; + CRYPTO_STATIC_MUTEX_unlock_read(&g_lock); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c new file mode 100644 index 0000000..95aa311 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c.grpc_back new file mode 100644 index 0000000..0514d80 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c new file mode 100644 index 0000000..7c3c66f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c @@ -0,0 +1,70 @@ +/* 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 + + +void RAND_seed(const void *buf, int num) { + // OpenSSH calls |RAND_seed| before jailing on the assumption that any needed + // file descriptors etc will be opened. + uint8_t unused; + RAND_bytes(&unused, sizeof(unused)); +} + +int RAND_load_file(const char *path, long num) { + if (num < 0) { // read the "whole file" + return 1; + } else if (num <= INT_MAX) { + return (int) num; + } else { + return INT_MAX; + } +} + +const char *RAND_file_name(char *buf, size_t num) { return NULL; } + +void RAND_add(const void *buf, int num, double entropy) {} + +int RAND_egd(const char *path) { + return 255; +} + +int RAND_poll(void) { + return 1; +} + +int RAND_status(void) { + return 1; +} + +static const struct rand_meth_st kSSLeayMethod = { + RAND_seed, + RAND_bytes, + RAND_cleanup, + RAND_add, + RAND_pseudo_bytes, + RAND_status, +}; + +RAND_METHOD *RAND_SSLeay(void) { + return (RAND_METHOD*) &kSSLeayMethod; +} + +const RAND_METHOD *RAND_get_rand_method(void) { return RAND_SSLeay(); } + +void RAND_set_rand_method(const RAND_METHOD *method) {} + +void RAND_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c.grpc_back new file mode 100644 index 0000000..bed9e1e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c.grpc_back @@ -0,0 +1,70 @@ +/* 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 + + +void RAND_seed(const void *buf, int num) { + // OpenSSH calls |RAND_seed| before jailing on the assumption that any needed + // file descriptors etc will be opened. + uint8_t unused; + RAND_bytes(&unused, sizeof(unused)); +} + +int RAND_load_file(const char *path, long num) { + if (num < 0) { // read the "whole file" + return 1; + } else if (num <= INT_MAX) { + return (int) num; + } else { + return INT_MAX; + } +} + +const char *RAND_file_name(char *buf, size_t num) { return NULL; } + +void RAND_add(const void *buf, int num, double entropy) {} + +int RAND_egd(const char *path) { + return 255; +} + +int RAND_poll(void) { + return 1; +} + +int RAND_status(void) { + return 1; +} + +static const struct rand_meth_st kSSLeayMethod = { + RAND_seed, + RAND_bytes, + RAND_cleanup, + RAND_add, + RAND_pseudo_bytes, + RAND_status, +}; + +RAND_METHOD *RAND_SSLeay(void) { + return (RAND_METHOD*) &kSSLeayMethod; +} + +const RAND_METHOD *RAND_get_rand_method(void) { return RAND_SSLeay(); } + +void RAND_set_rand_method(const RAND_METHOD *method) {} + +void RAND_cleanup(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c new file mode 100644 index 0000000..c524633 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c @@ -0,0 +1,53 @@ +/* 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 + +#if defined(OPENSSL_WINDOWS) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include +#include + +OPENSSL_MSVC_PRAGMA(warning(push, 3)) + +#include + +// #define needed to link in RtlGenRandom(), a.k.a. SystemFunction036. See the +// "Community Additions" comment on MSDN here: +// http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx +#define SystemFunction036 NTAPI SystemFunction036 +#include +#undef SystemFunction036 + +OPENSSL_MSVC_PRAGMA(warning(pop)) + +#include "../fipsmodule/rand/internal.h" + + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + while (requested > 0) { + ULONG output_bytes_this_pass = ULONG_MAX; + if (requested < output_bytes_this_pass) { + output_bytes_this_pass = (ULONG)requested; + } + if (RtlGenRandom(out, output_bytes_this_pass) == FALSE) { + abort(); + } + requested -= output_bytes_this_pass; + out += output_bytes_this_pass; + } + return; +} + +#endif // OPENSSL_WINDOWS && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c.grpc_back new file mode 100644 index 0000000..c955587 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c.grpc_back @@ -0,0 +1,53 @@ +/* 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 + +#if defined(OPENSSL_WINDOWS) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include +#include + +OPENSSL_MSVC_PRAGMA(warning(push, 3)) + +#include + +// #define needed to link in RtlGenRandom(), a.k.a. SystemFunction036. See the +// "Community Additions" comment on MSDN here: +// http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx +#define SystemFunction036 NTAPI SystemFunction036 +#include +#undef SystemFunction036 + +OPENSSL_MSVC_PRAGMA(warning(pop)) + +#include "../fipsmodule/rand/internal.h" + + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + while (requested > 0) { + ULONG output_bytes_this_pass = ULONG_MAX; + if (requested < output_bytes_this_pass) { + output_bytes_this_pass = (ULONG)requested; + } + if (RtlGenRandom(out, output_bytes_this_pass) == FALSE) { + abort(); + } + requested -= output_bytes_this_pass; + out += output_bytes_this_pass; + } + return; +} + +#endif // OPENSSL_WINDOWS && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c new file mode 100644 index 0000000..0fb6339 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c @@ -0,0 +1,98 @@ +/* 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 + + +void RC4(RC4_KEY *key, size_t len, const uint8_t *in, uint8_t *out) { + uint32_t x = key->x; + uint32_t y = key->y; + uint32_t *d = key->data; + + for (size_t i = 0; i < len; i++) { + x = (x + 1) & 0xff; + uint32_t tx = d[x]; + y = (tx + y) & 0xff; + uint32_t ty = d[y]; + d[x] = ty; + d[y] = tx; + out[i] = d[(tx + ty) & 0xff] ^ in[i]; + } + + key->x = x; + key->y = y; +} + +void RC4_set_key(RC4_KEY *rc4key, unsigned len, const uint8_t *key) { + uint32_t *d = &rc4key->data[0]; + rc4key->x = 0; + rc4key->y = 0; + + for (unsigned i = 0; i < 256; i++) { + d[i] = i; + } + + unsigned id1 = 0, id2 = 0; + for (unsigned i = 0; i < 256; i++) { + uint32_t tmp = d[i]; + id2 = (key[id1] + tmp + id2) & 0xff; + if (++id1 == len) { + id1 = 0; + } + d[i] = d[id2]; + d[id2] = tmp; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c.grpc_back new file mode 100644 index 0000000..a27a657 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c.grpc_back @@ -0,0 +1,98 @@ +/* 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 + + +void RC4(RC4_KEY *key, size_t len, const uint8_t *in, uint8_t *out) { + uint32_t x = key->x; + uint32_t y = key->y; + uint32_t *d = key->data; + + for (size_t i = 0; i < len; i++) { + x = (x + 1) & 0xff; + uint32_t tx = d[x]; + y = (tx + y) & 0xff; + uint32_t ty = d[y]; + d[x] = ty; + d[y] = tx; + out[i] = d[(tx + ty) & 0xff] ^ in[i]; + } + + key->x = x; + key->y = y; +} + +void RC4_set_key(RC4_KEY *rc4key, unsigned len, const uint8_t *key) { + uint32_t *d = &rc4key->data[0]; + rc4key->x = 0; + rc4key->y = 0; + + for (unsigned i = 0; i < 256; i++) { + d[i] = i; + } + + unsigned id1 = 0, id2 = 0; + for (unsigned i = 0; i < 256; i++) { + uint32_t tmp = d[i]; + id2 = (key[id1] + tmp + id2) & 0xff; + if (++id1 == len) { + id1 = 0; + } + d[i] = d[id2]; + d[id2] = tmp; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c new file mode 100644 index 0000000..ffb1a7e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c @@ -0,0 +1,67 @@ +/* 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 "internal.h" + + +#if defined(OPENSSL_C11_ATOMIC) + +#include +#include +#include +#include + +#include + + +// See comment above the typedef of CRYPTO_refcount_t about these tests. +static_assert(alignof(CRYPTO_refcount_t) == alignof(_Atomic CRYPTO_refcount_t), + "_Atomic alters the needed alignment of a reference count"); +static_assert(sizeof(CRYPTO_refcount_t) == sizeof(_Atomic CRYPTO_refcount_t), + "_Atomic alters the size of a reference count"); + +static_assert((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, + "CRYPTO_REFCOUNT_MAX is incorrect"); + +void CRYPTO_refcount_inc(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *) in_count; + uint32_t expected = atomic_load(count); + + while (expected != CRYPTO_REFCOUNT_MAX) { + uint32_t new_value = expected + 1; + if (atomic_compare_exchange_weak(count, &expected, new_value)) { + break; + } + } +} + +int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *)in_count; + uint32_t expected = atomic_load(count); + + for (;;) { + if (expected == 0) { + abort(); + } else if (expected == CRYPTO_REFCOUNT_MAX) { + return 0; + } else { + const uint32_t new_value = expected - 1; + if (atomic_compare_exchange_weak(count, &expected, new_value)) { + return new_value == 0; + } + } + } +} + +#endif // OPENSSL_C11_ATOMIC diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c.grpc_back new file mode 100644 index 0000000..0a331a4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c.grpc_back @@ -0,0 +1,67 @@ +/* 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 "internal.h" + + +#if defined(OPENSSL_C11_ATOMIC) + +#include +#include +#include +#include + +#include + + +// See comment above the typedef of CRYPTO_refcount_t about these tests. +static_assert(alignof(CRYPTO_refcount_t) == alignof(_Atomic CRYPTO_refcount_t), + "_Atomic alters the needed alignment of a reference count"); +static_assert(sizeof(CRYPTO_refcount_t) == sizeof(_Atomic CRYPTO_refcount_t), + "_Atomic alters the size of a reference count"); + +static_assert((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, + "CRYPTO_REFCOUNT_MAX is incorrect"); + +void CRYPTO_refcount_inc(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *) in_count; + uint32_t expected = atomic_load(count); + + while (expected != CRYPTO_REFCOUNT_MAX) { + uint32_t new_value = expected + 1; + if (atomic_compare_exchange_weak(count, &expected, new_value)) { + break; + } + } +} + +int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *)in_count; + uint32_t expected = atomic_load(count); + + for (;;) { + if (expected == 0) { + abort(); + } else if (expected == CRYPTO_REFCOUNT_MAX) { + return 0; + } else { + const uint32_t new_value = expected - 1; + if (atomic_compare_exchange_weak(count, &expected, new_value)) { + return new_value == 0; + } + } + } +} + +#endif // OPENSSL_C11_ATOMIC diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c new file mode 100644 index 0000000..0d01352 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c @@ -0,0 +1,53 @@ +/* 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 "internal.h" + +#include + +#include + + +#if !defined(OPENSSL_C11_ATOMIC) + +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; + +void CRYPTO_refcount_inc(CRYPTO_refcount_t *count) { + CRYPTO_STATIC_MUTEX_lock_write(&g_refcount_lock); + if (*count < CRYPTO_REFCOUNT_MAX) { + (*count)++; + } + CRYPTO_STATIC_MUTEX_unlock_write(&g_refcount_lock); +} + +int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&g_refcount_lock); + if (*count == 0) { + abort(); + } + if (*count < CRYPTO_REFCOUNT_MAX) { + (*count)--; + } + ret = (*count == 0); + CRYPTO_STATIC_MUTEX_unlock_write(&g_refcount_lock); + + return ret; +} + +#endif // OPENSSL_C11_ATOMIC diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back new file mode 100644 index 0000000..fb1c11f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back @@ -0,0 +1,53 @@ +/* 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 "internal.h" + +#include + +#include + + +#if !defined(OPENSSL_C11_ATOMIC) + +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; + +void CRYPTO_refcount_inc(CRYPTO_refcount_t *count) { + CRYPTO_STATIC_MUTEX_lock_write(&g_refcount_lock); + if (*count < CRYPTO_REFCOUNT_MAX) { + (*count)++; + } + CRYPTO_STATIC_MUTEX_unlock_write(&g_refcount_lock); +} + +int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count) { + int ret; + + CRYPTO_STATIC_MUTEX_lock_write(&g_refcount_lock); + if (*count == 0) { + abort(); + } + if (*count < CRYPTO_REFCOUNT_MAX) { + (*count)--; + } + ret = (*count == 0); + CRYPTO_STATIC_MUTEX_unlock_write(&g_refcount_lock); + + return ret; +} + +#endif // OPENSSL_C11_ATOMIC diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c new file mode 100644 index 0000000..6d4f9b8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c @@ -0,0 +1,325 @@ +/* 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../fipsmodule/rsa/internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // An RSA object may be missing some components. + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +RSA *RSA_parse_public_key(CBS *cbs) { + RSA *ret = RSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->n) || + !parse_integer(&child, &ret->e) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + + if (!BN_is_odd(ret->e) || + BN_num_bits(ret->e) < 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + RSA_free(ret); + return NULL; + } + + return ret; +} + +RSA *RSA_public_key_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + RSA *ret = RSA_parse_public_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + return ret; +} + +int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, rsa->n) || + !marshal_integer(&child, rsa->e) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int RSA_public_key_to_bytes(uint8_t **out_bytes, size_t *out_len, + const RSA *rsa) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !RSA_marshal_public_key(&cbb, rsa) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +// kVersionTwoPrime is the value of the version field for a two-prime +// RSAPrivateKey structure (RFC 3447). +static const uint64_t kVersionTwoPrime = 0; + +RSA *RSA_parse_private_key(CBS *cbs) { + RSA *ret = RSA_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + uint64_t version; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&child, &version)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + goto err; + } + + if (version != kVersionTwoPrime) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_VERSION); + goto err; + } + + if (!parse_integer(&child, &ret->n) || + !parse_integer(&child, &ret->e) || + !parse_integer(&child, &ret->d) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->dmp1) || + !parse_integer(&child, &ret->dmq1) || + !parse_integer(&child, &ret->iqmp)) { + goto err; + } + + if (CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + goto err; + } + + if (!RSA_check_key(ret)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + goto err; + } + + return ret; + +err: + RSA_free(ret); + return NULL; +} + +RSA *RSA_private_key_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + RSA *ret = RSA_parse_private_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + return ret; +} + +int RSA_marshal_private_key(CBB *cbb, const RSA *rsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&child, kVersionTwoPrime) || + !marshal_integer(&child, rsa->n) || + !marshal_integer(&child, rsa->e) || + !marshal_integer(&child, rsa->d) || + !marshal_integer(&child, rsa->p) || + !marshal_integer(&child, rsa->q) || + !marshal_integer(&child, rsa->dmp1) || + !marshal_integer(&child, rsa->dmq1) || + !marshal_integer(&child, rsa->iqmp) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int RSA_private_key_to_bytes(uint8_t **out_bytes, size_t *out_len, + const RSA *rsa) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !RSA_marshal_private_key(&cbb, rsa) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +RSA *d2i_RSAPublicKey(RSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + RSA *ret = RSA_parse_public_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + RSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_RSAPublicKey(const RSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !RSA_marshal_public_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +RSA *d2i_RSAPrivateKey(RSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + RSA *ret = RSA_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + RSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !RSA_marshal_private_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +RSA *RSAPublicKey_dup(const RSA *rsa) { + uint8_t *der; + size_t der_len; + if (!RSA_public_key_to_bytes(&der, &der_len, rsa)) { + return NULL; + } + RSA *ret = RSA_public_key_from_bytes(der, der_len); + OPENSSL_free(der); + return ret; +} + +RSA *RSAPrivateKey_dup(const RSA *rsa) { + uint8_t *der; + size_t der_len; + if (!RSA_private_key_to_bytes(&der, &der_len, rsa)) { + return NULL; + } + RSA *ret = RSA_private_key_from_bytes(der, der_len); + OPENSSL_free(der); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c.grpc_back new file mode 100644 index 0000000..3cc6a9c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c.grpc_back @@ -0,0 +1,325 @@ +/* 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../fipsmodule/rsa/internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +static int parse_integer(CBS *cbs, BIGNUM **out) { + assert(*out == NULL); + *out = BN_new(); + if (*out == NULL) { + return 0; + } + return BN_parse_asn1_unsigned(cbs, *out); +} + +static int marshal_integer(CBB *cbb, BIGNUM *bn) { + if (bn == NULL) { + // An RSA object may be missing some components. + OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); + return 0; + } + return BN_marshal_asn1(cbb, bn); +} + +RSA *RSA_parse_public_key(CBS *cbs) { + RSA *ret = RSA_new(); + if (ret == NULL) { + return NULL; + } + CBS child; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !parse_integer(&child, &ret->n) || + !parse_integer(&child, &ret->e) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + + if (!BN_is_odd(ret->e) || + BN_num_bits(ret->e) < 2) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + RSA_free(ret); + return NULL; + } + + return ret; +} + +RSA *RSA_public_key_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + RSA *ret = RSA_parse_public_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + return ret; +} + +int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !marshal_integer(&child, rsa->n) || + !marshal_integer(&child, rsa->e) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int RSA_public_key_to_bytes(uint8_t **out_bytes, size_t *out_len, + const RSA *rsa) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !RSA_marshal_public_key(&cbb, rsa) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +// kVersionTwoPrime is the value of the version field for a two-prime +// RSAPrivateKey structure (RFC 3447). +static const uint64_t kVersionTwoPrime = 0; + +RSA *RSA_parse_private_key(CBS *cbs) { + RSA *ret = RSA_new(); + if (ret == NULL) { + return NULL; + } + + CBS child; + uint64_t version; + if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&child, &version)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + goto err; + } + + if (version != kVersionTwoPrime) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_VERSION); + goto err; + } + + if (!parse_integer(&child, &ret->n) || + !parse_integer(&child, &ret->e) || + !parse_integer(&child, &ret->d) || + !parse_integer(&child, &ret->p) || + !parse_integer(&child, &ret->q) || + !parse_integer(&child, &ret->dmp1) || + !parse_integer(&child, &ret->dmq1) || + !parse_integer(&child, &ret->iqmp)) { + goto err; + } + + if (CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + goto err; + } + + if (!RSA_check_key(ret)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS); + goto err; + } + + return ret; + +err: + RSA_free(ret); + return NULL; +} + +RSA *RSA_private_key_from_bytes(const uint8_t *in, size_t in_len) { + CBS cbs; + CBS_init(&cbs, in, in_len); + RSA *ret = RSA_parse_private_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING); + RSA_free(ret); + return NULL; + } + return ret; +} + +int RSA_marshal_private_key(CBB *cbb, const RSA *rsa) { + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&child, kVersionTwoPrime) || + !marshal_integer(&child, rsa->n) || + !marshal_integer(&child, rsa->e) || + !marshal_integer(&child, rsa->d) || + !marshal_integer(&child, rsa->p) || + !marshal_integer(&child, rsa->q) || + !marshal_integer(&child, rsa->dmp1) || + !marshal_integer(&child, rsa->dmq1) || + !marshal_integer(&child, rsa->iqmp) || + !CBB_flush(cbb)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + return 0; + } + return 1; +} + +int RSA_private_key_to_bytes(uint8_t **out_bytes, size_t *out_len, + const RSA *rsa) { + CBB cbb; + CBB_zero(&cbb); + if (!CBB_init(&cbb, 0) || + !RSA_marshal_private_key(&cbb, rsa) || + !CBB_finish(&cbb, out_bytes, out_len)) { + OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR); + CBB_cleanup(&cbb); + return 0; + } + return 1; +} + +RSA *d2i_RSAPublicKey(RSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + RSA *ret = RSA_parse_public_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + RSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_RSAPublicKey(const RSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !RSA_marshal_public_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +RSA *d2i_RSAPrivateKey(RSA **out, const uint8_t **inp, long len) { + if (len < 0) { + return NULL; + } + CBS cbs; + CBS_init(&cbs, *inp, (size_t)len); + RSA *ret = RSA_parse_private_key(&cbs); + if (ret == NULL) { + return NULL; + } + if (out != NULL) { + RSA_free(*out); + *out = ret; + } + *inp = CBS_data(&cbs); + return ret; +} + +int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp) { + CBB cbb; + if (!CBB_init(&cbb, 0) || + !RSA_marshal_private_key(&cbb, in)) { + CBB_cleanup(&cbb); + return -1; + } + return CBB_finish_i2d(&cbb, outp); +} + +RSA *RSAPublicKey_dup(const RSA *rsa) { + uint8_t *der; + size_t der_len; + if (!RSA_public_key_to_bytes(&der, &der_len, rsa)) { + return NULL; + } + RSA *ret = RSA_public_key_from_bytes(der, der_len); + OPENSSL_free(der); + return ret; +} + +RSA *RSAPrivateKey_dup(const RSA *rsa) { + uint8_t *der; + size_t der_len; + if (!RSA_private_key_to_bytes(&der, &der_len, rsa)) { + return NULL; + } + RSA *ret = RSA_private_key_from_bytes(der, der_len); + OPENSSL_free(der); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c new file mode 100644 index 0000000..40f6b4f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c.grpc_back new file mode 100644 index 0000000..71970b8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c new file mode 100644 index 0000000..26e73bf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c.grpc_back new file mode 100644 index 0000000..f55c3ca --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c new file mode 100644 index 0000000..79399de --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c.grpc_back new file mode 100644 index 0000000..599bd7b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c new file mode 100644 index 0000000..dc8e248 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c @@ -0,0 +1,110 @@ +/* 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 + + +int CRYPTO_num_locks(void) { return 1; } + +void CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, + const char *file, int line)) {} + +void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, + const char *file, int line) { + return NULL; +} + +void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, + const char *file, int line)) {} + +const char *CRYPTO_get_lock_name(int lock_num) { + return "No old-style OpenSSL locks anymore"; +} + +int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { return 1; } + +void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val) {} + +void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) {} + +void CRYPTO_THREADID_current(CRYPTO_THREADID *id) {} + +void CRYPTO_set_id_callback(unsigned long (*func)(void)) {} + +void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( + *dyn_create_function)(const char *file, int line)) {} + +void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( + int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)) {} + +void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( + struct CRYPTO_dynlock_value *l, const char *file, int line)) {} + +struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))( + const char *file, int line) { + return NULL; +} + +void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, + struct CRYPTO_dynlock_value *l, + const char *file, int line) { + return NULL; +} + +void (*CRYPTO_get_dynlock_destroy_callback(void))( + struct CRYPTO_dynlock_value *l, const char *file, int line) { + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c.grpc_back new file mode 100644 index 0000000..25acce1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread.c.grpc_back @@ -0,0 +1,110 @@ +/* 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 + + +int CRYPTO_num_locks(void) { return 1; } + +void CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, + const char *file, int line)) {} + +void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, + const char *file, int line) { + return NULL; +} + +void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, + const char *file, int line)) {} + +const char *CRYPTO_get_lock_name(int lock_num) { + return "No old-style OpenSSL locks anymore"; +} + +int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { return 1; } + +void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val) {} + +void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) {} + +void CRYPTO_THREADID_current(CRYPTO_THREADID *id) {} + +void CRYPTO_set_id_callback(unsigned long (*func)(void)) {} + +void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( + *dyn_create_function)(const char *file, int line)) {} + +void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( + int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)) {} + +void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( + struct CRYPTO_dynlock_value *l, const char *file, int line)) {} + +struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))( + const char *file, int line) { + return NULL; +} + +void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, + struct CRYPTO_dynlock_value *l, + const char *file, int line) { + return NULL; +} + +void (*CRYPTO_get_dynlock_destroy_callback(void))( + struct CRYPTO_dynlock_value *l, const char *file, int line) { + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c new file mode 100644 index 0000000..4f07b9d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c @@ -0,0 +1,59 @@ +/* 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 "internal.h" + +#if !defined(OPENSSL_THREADS) + +void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (*once) { + return; + } + *once = 1; + init(); +} + +static void *g_thread_locals[NUM_OPENSSL_THREAD_LOCALS]; + +void *CRYPTO_get_thread_local(thread_local_data_t index) { + return g_thread_locals[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + g_thread_locals[index] = value; + return 1; +} + +#endif // !OPENSSL_THREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back new file mode 100644 index 0000000..4f07b9d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back @@ -0,0 +1,59 @@ +/* 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 "internal.h" + +#if !defined(OPENSSL_THREADS) + +void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) {} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) {} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (*once) { + return; + } + *once = 1; + init(); +} + +static void *g_thread_locals[NUM_OPENSSL_THREAD_LOCALS]; + +void *CRYPTO_get_thread_local(thread_local_data_t index) { + return g_thread_locals[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + g_thread_locals[index] = value; + return 1; +} + +#endif // !OPENSSL_THREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c new file mode 100644 index 0000000..3f378bf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c @@ -0,0 +1,206 @@ +/* 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 "internal.h" + +#if defined(OPENSSL_PTHREADS) + +#include +#include +#include + +#include +#include + + +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) { + abort(); + } +} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_rdlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_wrlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) { + pthread_rwlock_destroy((pthread_rwlock_t *) lock); +} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_rdlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_wrlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_unlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_unlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (pthread_once(once, init) != 0) { + abort(); + } +} + +static pthread_mutex_t g_destructors_lock = PTHREAD_MUTEX_INITIALIZER; +static thread_local_destructor_t g_destructors[NUM_OPENSSL_THREAD_LOCALS]; + +// thread_local_destructor is called when a thread exits. It releases thread +// local data for that thread only. +static void thread_local_destructor(void *arg) { + if (arg == NULL) { + return; + } + + thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; + if (pthread_mutex_lock(&g_destructors_lock) != 0) { + return; + } + OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); + pthread_mutex_unlock(&g_destructors_lock); + + unsigned i; + void **pointers = arg; + for (i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + if (destructors[i] != NULL) { + destructors[i](pointers[i]); + } + } + + OPENSSL_free(pointers); +} + +static pthread_once_t g_thread_local_init_once = PTHREAD_ONCE_INIT; +static pthread_key_t g_thread_local_key; +static int g_thread_local_key_created = 0; + +// OPENSSL_DANGEROUS_RELEASE_PTHREAD_KEY can be defined to cause +// |pthread_key_delete| to be called in a destructor function. This can be +// useful for programs that dlclose BoringSSL. +// +// Note that dlclose()ing BoringSSL is not supported and will leak memory: +// thread-local values will be leaked as well as anything initialised via a +// once. The |pthread_key_t| is destroyed because they run out very quickly, +// while the other leaks are slow, and this allows code that happens to use +// dlclose() despite all the problems to continue functioning. +// +// This is marked "dangerous" because it can cause multi-threaded processes to +// crash (even if they don't use dlclose): if the destructor runs while other +// threads are still executing then they may end up using an invalid key to +// access thread-local variables. +// +// This may be removed after February 2020. +#if defined(OPENSSL_DANGEROUS_RELEASE_PTHREAD_KEY) && \ + (defined(__GNUC__) || defined(__clang__)) +// thread_key_destructor is called when the library is unloaded with dlclose. +static void thread_key_destructor(void) __attribute__((destructor, unused)); +static void thread_key_destructor(void) { + if (g_thread_local_key_created) { + g_thread_local_key_created = 0; + pthread_key_delete(g_thread_local_key); + } +} +#endif + +static void thread_local_init(void) { + g_thread_local_key_created = + pthread_key_create(&g_thread_local_key, thread_local_destructor) == 0; +} + +void *CRYPTO_get_thread_local(thread_local_data_t index) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (!g_thread_local_key_created) { + return NULL; + } + + void **pointers = pthread_getspecific(g_thread_local_key); + if (pointers == NULL) { + return NULL; + } + return pointers[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (!g_thread_local_key_created) { + destructor(value); + return 0; + } + + void **pointers = pthread_getspecific(g_thread_local_key); + if (pointers == NULL) { + pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pointers == NULL) { + destructor(value); + return 0; + } + OPENSSL_memset(pointers, 0, sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pthread_setspecific(g_thread_local_key, pointers) != 0) { + OPENSSL_free(pointers); + destructor(value); + return 0; + } + } + + if (pthread_mutex_lock(&g_destructors_lock) != 0) { + destructor(value); + return 0; + } + g_destructors[index] = destructor; + pthread_mutex_unlock(&g_destructors_lock); + + pointers[index] = value; + return 1; +} + +#endif // OPENSSL_PTHREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back new file mode 100644 index 0000000..832e90e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back @@ -0,0 +1,206 @@ +/* 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 "internal.h" + +#if defined(OPENSSL_PTHREADS) + +#include +#include +#include + +#include +#include + + +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) { + abort(); + } +} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_rdlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_wrlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) { + if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { + abort(); + } +} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) { + pthread_rwlock_destroy((pthread_rwlock_t *) lock); +} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_rdlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_wrlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_unlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { + if (pthread_rwlock_unlock(&lock->lock) != 0) { + abort(); + } +} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (pthread_once(once, init) != 0) { + abort(); + } +} + +static pthread_mutex_t g_destructors_lock = PTHREAD_MUTEX_INITIALIZER; +static thread_local_destructor_t g_destructors[NUM_OPENSSL_THREAD_LOCALS]; + +// thread_local_destructor is called when a thread exits. It releases thread +// local data for that thread only. +static void thread_local_destructor(void *arg) { + if (arg == NULL) { + return; + } + + thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; + if (pthread_mutex_lock(&g_destructors_lock) != 0) { + return; + } + OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); + pthread_mutex_unlock(&g_destructors_lock); + + unsigned i; + void **pointers = arg; + for (i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + if (destructors[i] != NULL) { + destructors[i](pointers[i]); + } + } + + OPENSSL_free(pointers); +} + +static pthread_once_t g_thread_local_init_once = PTHREAD_ONCE_INIT; +static pthread_key_t g_thread_local_key; +static int g_thread_local_key_created = 0; + +// OPENSSL_DANGEROUS_RELEASE_PTHREAD_KEY can be defined to cause +// |pthread_key_delete| to be called in a destructor function. This can be +// useful for programs that dlclose BoringSSL. +// +// Note that dlclose()ing BoringSSL is not supported and will leak memory: +// thread-local values will be leaked as well as anything initialised via a +// once. The |pthread_key_t| is destroyed because they run out very quickly, +// while the other leaks are slow, and this allows code that happens to use +// dlclose() despite all the problems to continue functioning. +// +// This is marked "dangerous" because it can cause multi-threaded processes to +// crash (even if they don't use dlclose): if the destructor runs while other +// threads are still executing then they may end up using an invalid key to +// access thread-local variables. +// +// This may be removed after February 2020. +#if defined(OPENSSL_DANGEROUS_RELEASE_PTHREAD_KEY) && \ + (defined(__GNUC__) || defined(__clang__)) +// thread_key_destructor is called when the library is unloaded with dlclose. +static void thread_key_destructor(void) __attribute__((destructor, unused)); +static void thread_key_destructor(void) { + if (g_thread_local_key_created) { + g_thread_local_key_created = 0; + pthread_key_delete(g_thread_local_key); + } +} +#endif + +static void thread_local_init(void) { + g_thread_local_key_created = + pthread_key_create(&g_thread_local_key, thread_local_destructor) == 0; +} + +void *CRYPTO_get_thread_local(thread_local_data_t index) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (!g_thread_local_key_created) { + return NULL; + } + + void **pointers = pthread_getspecific(g_thread_local_key); + if (pointers == NULL) { + return NULL; + } + return pointers[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (!g_thread_local_key_created) { + destructor(value); + return 0; + } + + void **pointers = pthread_getspecific(g_thread_local_key); + if (pointers == NULL) { + pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pointers == NULL) { + destructor(value); + return 0; + } + OPENSSL_memset(pointers, 0, sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pthread_setspecific(g_thread_local_key, pointers) != 0) { + OPENSSL_free(pointers); + destructor(value); + return 0; + } + } + + if (pthread_mutex_lock(&g_destructors_lock) != 0) { + destructor(value); + return 0; + } + g_destructors[index] = destructor; + pthread_mutex_unlock(&g_destructors_lock); + + pointers[index] = value; + return 1; +} + +#endif // OPENSSL_PTHREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c new file mode 100644 index 0000000..a981f03 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c @@ -0,0 +1,256 @@ +/* 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 "internal.h" + +#if defined(OPENSSL_WINDOWS_THREADS) + +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) + +#include +#include + +#include +#include + + +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; + (**init)(); + return TRUE; +} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (!InitOnceExecuteOnce(once, call_once_init, &init, NULL)) { + abort(); + } +} + +void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) { + InitializeSRWLock((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) { + AcquireSRWLockShared((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) { + AcquireSRWLockExclusive((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) { + ReleaseSRWLockShared((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) { + ReleaseSRWLockExclusive((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) { + // SRWLOCKs require no cleanup. +} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) { + AcquireSRWLockShared(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) { + AcquireSRWLockExclusive(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) { + ReleaseSRWLockShared(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { + ReleaseSRWLockExclusive(&lock->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; +static DWORD g_thread_local_key; +static int g_thread_local_failed; + +static void thread_local_init(void) { + g_thread_local_key = TlsAlloc(); + g_thread_local_failed = (g_thread_local_key == TLS_OUT_OF_INDEXES); +} + +static void NTAPI thread_local_destructor(PVOID module, DWORD reason, + PVOID reserved) { + // Only free memory on |DLL_THREAD_DETACH|, not |DLL_PROCESS_DETACH|. In + // VS2015's debug runtime, the C runtime has been unloaded by the time + // |DLL_PROCESS_DETACH| runs. See https://crbug.com/575795. This is consistent + // with |pthread_key_create| which does not call destructors on process exit, + // only thread exit. + if (reason != DLL_THREAD_DETACH) { + return; + } + + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (g_thread_local_failed) { + return; + } + + void **pointers = (void**) TlsGetValue(g_thread_local_key); + if (pointers == NULL) { + return; + } + + thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; + + AcquireSRWLockExclusive(&g_destructors_lock); + OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); + ReleaseSRWLockExclusive(&g_destructors_lock); + + for (unsigned i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + if (destructors[i] != NULL) { + destructors[i](pointers[i]); + } + } + + OPENSSL_free(pointers); +} + +// Thread Termination Callbacks. +// +// Windows doesn't support a per-thread destructor with its TLS primitives. +// So, we build it manually by inserting a function to be called on each +// thread's exit. This magic is from http://www.codeproject.com/threads/tls.asp +// and it works for VC++ 7.0 and later. +// +// Force a reference to _tls_used to make the linker create the TLS directory +// 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:" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) +#else +__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 +// called automatically by the OS loader code (not the CRT) when the module is +// loaded and on thread creation. They are NOT called if the module has been +// loaded by a LoadLibrary() call. It must have implicitly been loaded at +// process startup. +// +// By implicitly loaded, I mean that it is directly referenced by the main EXE +// or by one of its dependent DLLs. Delay-loaded DLL doesn't count as being +// implicitly loaded. +// +// See VC\crt\src\tlssup.c for reference. + +// The linker must not discard p_thread_callback_boringssl. (We force a +// reference to this variable with a linker /INCLUDE:symbol pragma to ensure +// that.) If this variable is discarded, the OnThreadExit function will never +// be called. +#ifdef _WIN64 + +// .CRT section is merged with .rdata on x64 so it must be constant data. +#pragma const_seg(".CRT$XLC") +// When defining a const variable, it must have external linkage to be sure the +// linker doesn't discard it. +extern const PIMAGE_TLS_CALLBACK p_thread_callback_boringssl; +const PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; +// Reset the default section. +#pragma const_seg() + +#else + +#pragma data_seg(".CRT$XLC") +PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; +// Reset the default section. +#pragma data_seg() + +#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 = get_thread_locals(); + if (pointers == NULL) { + return NULL; + } + return pointers[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (g_thread_local_failed) { + destructor(value); + return 0; + } + + void **pointers = get_thread_locals(); + if (pointers == NULL) { + pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pointers == NULL) { + destructor(value); + return 0; + } + OPENSSL_memset(pointers, 0, sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (TlsSetValue(g_thread_local_key, pointers) == 0) { + OPENSSL_free(pointers); + destructor(value); + return 0; + } + } + + AcquireSRWLockExclusive(&g_destructors_lock); + g_destructors[index] = destructor; + ReleaseSRWLockExclusive(&g_destructors_lock); + + pointers[index] = value; + return 1; +} + +#endif // OPENSSL_WINDOWS_THREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back new file mode 100644 index 0000000..c8e19f5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back @@ -0,0 +1,256 @@ +/* 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 "internal.h" + +#if defined(OPENSSL_WINDOWS_THREADS) + +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) + +#include +#include + +#include +#include + + +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; + (**init)(); + return TRUE; +} + +void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { + if (!InitOnceExecuteOnce(once, call_once_init, &init, NULL)) { + abort(); + } +} + +void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) { + InitializeSRWLock((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) { + AcquireSRWLockShared((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) { + AcquireSRWLockExclusive((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) { + ReleaseSRWLockShared((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) { + ReleaseSRWLockExclusive((SRWLOCK *) lock); +} + +void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock) { + // SRWLOCKs require no cleanup. +} + +void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock) { + AcquireSRWLockShared(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock) { + AcquireSRWLockExclusive(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock) { + ReleaseSRWLockShared(&lock->lock); +} + +void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { + ReleaseSRWLockExclusive(&lock->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; +static DWORD g_thread_local_key; +static int g_thread_local_failed; + +static void thread_local_init(void) { + g_thread_local_key = TlsAlloc(); + g_thread_local_failed = (g_thread_local_key == TLS_OUT_OF_INDEXES); +} + +static void NTAPI thread_local_destructor(PVOID module, DWORD reason, + PVOID reserved) { + // Only free memory on |DLL_THREAD_DETACH|, not |DLL_PROCESS_DETACH|. In + // VS2015's debug runtime, the C runtime has been unloaded by the time + // |DLL_PROCESS_DETACH| runs. See https://crbug.com/575795. This is consistent + // with |pthread_key_create| which does not call destructors on process exit, + // only thread exit. + if (reason != DLL_THREAD_DETACH) { + return; + } + + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (g_thread_local_failed) { + return; + } + + void **pointers = (void**) TlsGetValue(g_thread_local_key); + if (pointers == NULL) { + return; + } + + thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; + + AcquireSRWLockExclusive(&g_destructors_lock); + OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); + ReleaseSRWLockExclusive(&g_destructors_lock); + + for (unsigned i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + if (destructors[i] != NULL) { + destructors[i](pointers[i]); + } + } + + OPENSSL_free(pointers); +} + +// Thread Termination Callbacks. +// +// Windows doesn't support a per-thread destructor with its TLS primitives. +// So, we build it manually by inserting a function to be called on each +// thread's exit. This magic is from http://www.codeproject.com/threads/tls.asp +// and it works for VC++ 7.0 and later. +// +// Force a reference to _tls_used to make the linker create the TLS directory +// 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:" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) +#else +__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 +// called automatically by the OS loader code (not the CRT) when the module is +// loaded and on thread creation. They are NOT called if the module has been +// loaded by a LoadLibrary() call. It must have implicitly been loaded at +// process startup. +// +// By implicitly loaded, I mean that it is directly referenced by the main EXE +// or by one of its dependent DLLs. Delay-loaded DLL doesn't count as being +// implicitly loaded. +// +// See VC\crt\src\tlssup.c for reference. + +// The linker must not discard p_thread_callback_boringssl. (We force a +// reference to this variable with a linker /INCLUDE:symbol pragma to ensure +// that.) If this variable is discarded, the OnThreadExit function will never +// be called. +#ifdef _WIN64 + +// .CRT section is merged with .rdata on x64 so it must be constant data. +#pragma const_seg(".CRT$XLC") +// When defining a const variable, it must have external linkage to be sure the +// linker doesn't discard it. +extern const PIMAGE_TLS_CALLBACK p_thread_callback_boringssl; +const PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; +// Reset the default section. +#pragma const_seg() + +#else + +#pragma data_seg(".CRT$XLC") +PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; +// Reset the default section. +#pragma data_seg() + +#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 = get_thread_locals(); + if (pointers == NULL) { + return NULL; + } + return pointers[index]; +} + +int CRYPTO_set_thread_local(thread_local_data_t index, void *value, + thread_local_destructor_t destructor) { + CRYPTO_once(&g_thread_local_init_once, thread_local_init); + if (g_thread_local_failed) { + destructor(value); + return 0; + } + + void **pointers = get_thread_locals(); + if (pointers == NULL) { + pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (pointers == NULL) { + destructor(value); + return 0; + } + OPENSSL_memset(pointers, 0, sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); + if (TlsSetValue(g_thread_local_key, pointers) == 0) { + OPENSSL_free(pointers); + destructor(value); + return 0; + } + } + + AcquireSRWLockExclusive(&g_destructors_lock); + g_destructors[index] = destructor; + ReleaseSRWLockExclusive(&g_destructors_lock); + + pointers[index] = value; + return 1; +} + +#endif // OPENSSL_WINDOWS_THREADS diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c new file mode 100644 index 0000000..7186690 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c @@ -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.] */ + +#include + +#include +#include +#include +#include + +int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, + unsigned char *md, unsigned int *len) +{ + int i, ret; + unsigned char *str, *p; + + i = i2d(data, NULL); + if ((str = (unsigned char *)OPENSSL_malloc(i)) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (0); + } + p = str; + i2d(data, &p); + + ret = EVP_Digest(str, i, md, len, type, NULL); + OPENSSL_free(str); + return ret; +} + +int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, + unsigned char *md, unsigned int *len) +{ + int i, ret; + unsigned char *str = NULL; + + i = ASN1_item_i2d(asn, &str, it); + if (!str) + return (0); + + ret = EVP_Digest(str, i, md, len, type, NULL); + OPENSSL_free(str); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c.grpc_back new file mode 100644 index 0000000..b88d6ac --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c.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.] */ + +#include + +#include +#include +#include +#include + +int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, + unsigned char *md, unsigned int *len) +{ + int i, ret; + unsigned char *str, *p; + + i = i2d(data, NULL); + if ((str = (unsigned char *)OPENSSL_malloc(i)) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (0); + } + p = str; + i2d(data, &p); + + ret = EVP_Digest(str, i, md, len, type, NULL); + OPENSSL_free(str); + return ret; +} + +int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, + unsigned char *md, unsigned int *len) +{ + int i, ret; + unsigned char *str = NULL; + + i = ASN1_item_i2d(asn, &str, it); + if (!str) + return (0); + + ret = EVP_Digest(str, i, md, len, type, NULL); + OPENSSL_free(str); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c new file mode 100644 index 0000000..c3d5cb8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c @@ -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.] */ + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" + +int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, + X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *asn, + EVP_PKEY *pkey, const EVP_MD *type) +{ + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + if (!EVP_DigestSignInit(&ctx, NULL, type, NULL, pkey)) { + EVP_MD_CTX_cleanup(&ctx); + return 0; + } + return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx); +} + +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) +{ + EVP_PKEY *pkey; + unsigned char *buf_in = NULL, *buf_out = NULL; + size_t inl = 0, outl = 0; + + pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + + /* Write out the requested copies of the AlgorithmIdentifier. */ + if (algor1 && !x509_digest_sign_algorithm(ctx, algor1)) { + goto err; + } + if (algor2 && !x509_digest_sign_algorithm(ctx, algor2)) { + goto err; + } + + inl = ASN1_item_i2d(asn, &buf_in, it); + outl = EVP_PKEY_size(pkey); + buf_out = OPENSSL_malloc((unsigned int)outl); + if ((buf_in == NULL) || (buf_out == NULL)) { + outl = 0; + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!EVP_DigestSign(ctx, buf_out, &outl, buf_in, inl)) { + outl = 0; + OPENSSL_PUT_ERROR(X509, ERR_R_EVP_LIB); + goto err; + } + if (signature->data != NULL) + OPENSSL_free(signature->data); + signature->data = buf_out; + buf_out = NULL; + signature->length = outl; + /* + * In the interests of compatibility, I'll make sure that the bit string + * has a 'not-used bits' value of 0 + */ + signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + signature->flags |= ASN1_STRING_FLAG_BITS_LEFT; + err: + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(buf_in); + OPENSSL_free(buf_out); + return (outl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c.grpc_back new file mode 100644 index 0000000..6c7f713 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c.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.] */ + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" + +int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, + X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *asn, + EVP_PKEY *pkey, const EVP_MD *type) +{ + EVP_MD_CTX ctx; + EVP_MD_CTX_init(&ctx); + if (!EVP_DigestSignInit(&ctx, NULL, type, NULL, pkey)) { + EVP_MD_CTX_cleanup(&ctx); + return 0; + } + return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx); +} + +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) +{ + EVP_PKEY *pkey; + unsigned char *buf_in = NULL, *buf_out = NULL; + size_t inl = 0, outl = 0; + + pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + + /* Write out the requested copies of the AlgorithmIdentifier. */ + if (algor1 && !x509_digest_sign_algorithm(ctx, algor1)) { + goto err; + } + if (algor2 && !x509_digest_sign_algorithm(ctx, algor2)) { + goto err; + } + + inl = ASN1_item_i2d(asn, &buf_in, it); + outl = EVP_PKEY_size(pkey); + buf_out = OPENSSL_malloc((unsigned int)outl); + if ((buf_in == NULL) || (buf_out == NULL)) { + outl = 0; + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!EVP_DigestSign(ctx, buf_out, &outl, buf_in, inl)) { + outl = 0; + OPENSSL_PUT_ERROR(X509, ERR_R_EVP_LIB); + goto err; + } + if (signature->data != NULL) + OPENSSL_free(signature->data); + signature->data = buf_out; + buf_out = NULL; + signature->length = outl; + /* + * In the interests of compatibility, I'll make sure that the bit string + * has a 'not-used bits' value of 0 + */ + signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + signature->flags |= ASN1_STRING_FLAG_BITS_LEFT; + err: + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(buf_in); + OPENSSL_free(buf_out); + return (outl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c new file mode 100644 index 0000000..1d89f39 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c @@ -0,0 +1,653 @@ +/* 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 "charmap.h" +#include "../asn1/asn1_locl.h" + +/* + * ASN1_STRING_print_ex() and X509_NAME_print_ex(). Enhanced string and name + * printing routines handling multibyte characters, RFC2253 and a host of + * other options. + */ + +#define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253) + +#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \ + ASN1_STRFLGS_ESC_QUOTE | \ + ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB) + +static int send_bio_chars(void *arg, const void *buf, int len) +{ + if (!arg) + return 1; + if (BIO_write(arg, buf, len) != len) + return 0; + return 1; +} + +static int send_fp_chars(void *arg, const void *buf, int len) +{ + if (!arg) + return 1; + if (fwrite(buf, 1, len, arg) != (unsigned int)len) + return 0; + return 1; +} + +typedef int char_io (void *arg, const void *buf, int len); + +/* + * This function handles display of strings, one character at a time. It is + * passed an unsigned long for each character because it could come from 2 or + * even 4 byte forms. + */ + +#define HEX_SIZE(type) (sizeof(type)*2) + +static int do_esc_char(uint32_t c, unsigned char flags, char *do_quotes, + char_io *io_ch, void *arg) +{ + unsigned char chflgs, chtmp; + char tmphex[HEX_SIZE(uint32_t) + 3]; + + if (c > 0xffff) { + BIO_snprintf(tmphex, sizeof tmphex, "\\W%08" PRIX32, c); + if (!io_ch(arg, tmphex, 10)) + return -1; + return 10; + } + if (c > 0xff) { + BIO_snprintf(tmphex, sizeof tmphex, "\\U%04" PRIX32, c); + if (!io_ch(arg, tmphex, 6)) + return -1; + return 6; + } + chtmp = (unsigned char)c; + if (chtmp > 0x7f) + chflgs = flags & ASN1_STRFLGS_ESC_MSB; + else + chflgs = char_type[chtmp] & flags; + if (chflgs & CHARTYPE_BS_ESC) { + /* If we don't escape with quotes, signal we need quotes */ + if (chflgs & ASN1_STRFLGS_ESC_QUOTE) { + if (do_quotes) + *do_quotes = 1; + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 1; + } + if (!io_ch(arg, "\\", 1)) + return -1; + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 2; + } + if (chflgs & (ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB)) { + BIO_snprintf(tmphex, 11, "\\%02X", chtmp); + if (!io_ch(arg, tmphex, 3)) + return -1; + return 3; + } + /* + * If we get this far and do any escaping at all must escape the escape + * character itself: backslash. + */ + if (chtmp == '\\' && flags & ESC_FLAGS) { + if (!io_ch(arg, "\\\\", 2)) + return -1; + return 2; + } + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 1; +} + +#define BUF_TYPE_WIDTH_MASK 0x7 +#define BUF_TYPE_CONVUTF8 0x8 + +/* + * This function sends each character in a buffer to do_esc_char(). It + * interprets the content formats and converts to or from UTF8 as + * appropriate. + */ + +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, 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 (charwidth) { + case 4: + c = ((uint32_t)*p++) << 24; + c |= ((uint32_t)*p++) << 16; + c |= ((uint32_t)*p++) << 8; + c |= *p++; + break; + + case 2: + c = ((uint32_t)*p++) << 8; + c |= *p++; + break; + + case 1: + c = *p++; + break; + + case 0: + i = UTF8_getc(p, buflen, &c); + if (i < 0) + return -1; /* Invalid UTF8String */ + buflen -= i; + p += i; + break; + default: + return -1; /* invalid width */ + } + if (p == q && flags & ASN1_STRFLGS_ESC_2253) + orflags = CHARTYPE_LAST_ESC_2253; + if (type & BUF_TYPE_CONVUTF8) { + unsigned char utfbuf[6]; + int utflen; + utflen = UTF8_putc(utfbuf, sizeof utfbuf, c); + for (i = 0; i < utflen; i++) { + /* + * We don't need to worry about setting orflags correctly + * because if utflen==1 its value will be correct anyway + * otherwise each character will be > 0x7f and so the + * character will never be escaped on first and last. + */ + len = + do_esc_char(utfbuf[i], (unsigned char)(flags | orflags), + quotes, io_ch, arg); + if (len < 0) + return -1; + outlen += len; + } + } else { + len = + do_esc_char(c, (unsigned char)(flags | orflags), quotes, + io_ch, arg); + if (len < 0) + return -1; + outlen += len; + } + } + return outlen; +} + +/* This function hex dumps a buffer of characters */ + +static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, + int buflen) +{ + static const char hexdig[] = "0123456789ABCDEF"; + unsigned char *p, *q; + char hextmp[2]; + if (arg) { + p = buf; + q = buf + buflen; + while (p != q) { + hextmp[0] = hexdig[*p >> 4]; + hextmp[1] = hexdig[*p & 0xf]; + if (!io_ch(arg, hextmp, 2)) + return -1; + p++; + } + } + return buflen << 1; +} + +/* + * "dump" a string. This is done when the type is unknown, or the flags + * request it. We can either dump the content octets or the entire DER + * encoding. This uses the RFC2253 #01234 format. + */ + +static int do_dump(unsigned long lflags, char_io *io_ch, void *arg, + ASN1_STRING *str) +{ + /* + * Placing the ASN1_STRING in a temp ASN1_TYPE allows the DER encoding to + * readily obtained + */ + ASN1_TYPE t; + unsigned char *der_buf, *p; + int outlen, der_len; + + if (!io_ch(arg, "#", 1)) + return -1; + /* If we don't dump DER encoding just dump content octets */ + if (!(lflags & ASN1_STRFLGS_DUMP_DER)) { + outlen = do_hex_dump(io_ch, arg, str->data, str->length); + if (outlen < 0) + return -1; + return outlen + 1; + } + t.type = str->type; + t.value.ptr = (char *)str; + der_len = i2d_ASN1_TYPE(&t, NULL); + der_buf = OPENSSL_malloc(der_len); + if (!der_buf) + return -1; + p = der_buf; + i2d_ASN1_TYPE(&t, &p); + outlen = do_hex_dump(io_ch, arg, der_buf, der_len); + OPENSSL_free(der_buf); + if (outlen < 0) + return -1; + return outlen + 1; +} + +/* + * Lookup table to convert tags to character widths, 0 = UTF8 encoded, -1 is + * used for non string types otherwise it is the number of bytes per + * character + */ + +static const signed char tag2nbyte[] = { + -1, -1, -1, -1, -1, /* 0-4 */ + -1, -1, -1, -1, -1, /* 5-9 */ + -1, -1, 0, -1, /* 10-13 */ + -1, -1, -1, -1, /* 15-17 */ + 1, 1, 1, /* 18-20 */ + -1, 1, 1, 1, /* 21-24 */ + -1, 1, -1, /* 25-27 */ + 4, -1, 2 /* 28-30 */ +}; + +/* + * This is the main function, print out an ASN1_STRING taking note of various + * escape and display options. Returns number of characters written or -1 if + * an error occurred. + */ + +static int do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, + ASN1_STRING *str) +{ + int outlen, len; + int type; + char quotes; + unsigned char flags; + quotes = 0; + /* Keep a copy of escape flags */ + flags = (unsigned char)(lflags & ESC_FLAGS); + + type = str->type; + + outlen = 0; + + if (lflags & ASN1_STRFLGS_SHOW_TYPE) { + const char *tagname; + tagname = ASN1_tag2str(type); + outlen += strlen(tagname); + if (!io_ch(arg, tagname, outlen) || !io_ch(arg, ":", 1)) + return -1; + outlen++; + } + + /* Decide what to do with type, either dump content or display it */ + + /* Dump everything */ + if (lflags & ASN1_STRFLGS_DUMP_ALL) + type = -1; + /* Ignore the string type */ + else if (lflags & ASN1_STRFLGS_IGNORE_TYPE) + type = 1; + else { + /* Else determine width based on type */ + if ((type > 0) && (type < 31)) + type = tag2nbyte[type]; + else + type = -1; + if ((type == -1) && !(lflags & ASN1_STRFLGS_DUMP_UNKNOWN)) + type = 1; + } + + if (type == -1) { + len = do_dump(lflags, io_ch, arg, str); + if (len < 0) + return -1; + outlen += len; + return outlen; + } + + if (lflags & ASN1_STRFLGS_UTF8_CONVERT) { + /* + * Note: if string is UTF8 and we want to convert to UTF8 then we + * just interpret it as 1 byte per character to avoid converting + * twice. + */ + if (!type) + type = 1; + else + type |= BUF_TYPE_CONVUTF8; + } + + len = do_buf(str->data, str->length, type, flags, "es, io_ch, NULL); + if (len < 0) + return -1; + outlen += len; + if (quotes) + outlen += 2; + if (!arg) + return outlen; + if (quotes && !io_ch(arg, "\"", 1)) + return -1; + if (do_buf(str->data, str->length, type, flags, NULL, io_ch, arg) < 0) + return -1; + if (quotes && !io_ch(arg, "\"", 1)) + return -1; + return outlen; +} + +/* Used for line indenting: print 'indent' spaces */ + +static int do_indent(char_io *io_ch, void *arg, int indent) +{ + int i; + for (i = 0; i < indent; i++) + if (!io_ch(arg, " ", 1)) + return 0; + return 1; +} + +#define FN_WIDTH_LN 25 +#define FN_WIDTH_SN 10 + +static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, + int indent, unsigned long flags) +{ + int i, prev = -1, orflags, cnt; + int fn_opt, fn_nid; + ASN1_OBJECT *fn; + ASN1_STRING *val; + X509_NAME_ENTRY *ent; + char objtmp[80]; + const char *objbuf; + int outlen, len; + const char *sep_dn, *sep_mv, *sep_eq; + int sep_dn_len, sep_mv_len, sep_eq_len; + if (indent < 0) + indent = 0; + outlen = indent; + if (!do_indent(io_ch, arg, indent)) + return -1; + switch (flags & XN_FLAG_SEP_MASK) { + case XN_FLAG_SEP_MULTILINE: + sep_dn = "\n"; + sep_dn_len = 1; + sep_mv = " + "; + sep_mv_len = 3; + break; + + case XN_FLAG_SEP_COMMA_PLUS: + sep_dn = ","; + sep_dn_len = 1; + sep_mv = "+"; + sep_mv_len = 1; + indent = 0; + break; + + case XN_FLAG_SEP_CPLUS_SPC: + sep_dn = ", "; + sep_dn_len = 2; + sep_mv = " + "; + sep_mv_len = 3; + indent = 0; + break; + + case XN_FLAG_SEP_SPLUS_SPC: + sep_dn = "; "; + sep_dn_len = 2; + sep_mv = " + "; + sep_mv_len = 3; + indent = 0; + break; + + default: + return -1; + } + + if (flags & XN_FLAG_SPC_EQ) { + sep_eq = " = "; + sep_eq_len = 3; + } else { + sep_eq = "="; + sep_eq_len = 1; + } + + fn_opt = flags & XN_FLAG_FN_MASK; + + cnt = X509_NAME_entry_count(n); + for (i = 0; i < cnt; i++) { + if (flags & XN_FLAG_DN_REV) + ent = X509_NAME_get_entry(n, cnt - i - 1); + else + ent = X509_NAME_get_entry(n, i); + if (prev != -1) { + if (prev == ent->set) { + if (!io_ch(arg, sep_mv, sep_mv_len)) + return -1; + outlen += sep_mv_len; + } else { + if (!io_ch(arg, sep_dn, sep_dn_len)) + return -1; + outlen += sep_dn_len; + if (!do_indent(io_ch, arg, indent)) + return -1; + outlen += indent; + } + } + prev = ent->set; + fn = X509_NAME_ENTRY_get_object(ent); + val = X509_NAME_ENTRY_get_data(ent); + fn_nid = OBJ_obj2nid(fn); + if (fn_opt != XN_FLAG_FN_NONE) { + int objlen, fld_len; + if ((fn_opt == XN_FLAG_FN_OID) || (fn_nid == NID_undef)) { + OBJ_obj2txt(objtmp, sizeof objtmp, fn, 1); + fld_len = 0; /* XXX: what should this be? */ + objbuf = objtmp; + } else { + if (fn_opt == XN_FLAG_FN_SN) { + fld_len = FN_WIDTH_SN; + objbuf = OBJ_nid2sn(fn_nid); + } else if (fn_opt == XN_FLAG_FN_LN) { + fld_len = FN_WIDTH_LN; + objbuf = OBJ_nid2ln(fn_nid); + } else { + fld_len = 0; /* XXX: what should this be? */ + objbuf = ""; + } + } + objlen = strlen(objbuf); + if (!io_ch(arg, objbuf, objlen)) + return -1; + if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) { + if (!do_indent(io_ch, arg, fld_len - objlen)) + return -1; + outlen += fld_len - objlen; + } + if (!io_ch(arg, sep_eq, sep_eq_len)) + return -1; + outlen += objlen + sep_eq_len; + } + /* + * If the field name is unknown then fix up the DER dump flag. We + * might want to limit this further so it will DER dump on anything + * other than a few 'standard' fields. + */ + if ((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS)) + orflags = ASN1_STRFLGS_DUMP_ALL; + else + orflags = 0; + + len = do_print_ex(io_ch, arg, flags | orflags, val); + if (len < 0) + return -1; + outlen += len; + } + return outlen; +} + +/* Wrappers round the main functions */ + +int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, + unsigned long flags) +{ + if (flags == XN_FLAG_COMPAT) + return X509_NAME_print(out, nm, indent); + return do_name_ex(send_bio_chars, out, nm, indent, flags); +} + +#ifndef OPENSSL_NO_FP_API +int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, + unsigned long flags) +{ + if (flags == XN_FLAG_COMPAT) { + BIO *btmp; + int ret; + btmp = BIO_new_fp(fp, BIO_NOCLOSE); + if (!btmp) + return -1; + ret = X509_NAME_print(btmp, nm, indent); + BIO_free(btmp); + return ret; + } + return do_name_ex(send_fp_chars, fp, nm, indent, flags); +} +#endif + +int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) +{ + return do_print_ex(send_bio_chars, out, flags, str); +} + +#ifndef OPENSSL_NO_FP_API +int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) +{ + return do_print_ex(send_fp_chars, fp, flags, str); +} +#endif + +/* + * Utility function: convert any string type to UTF8, returns number of bytes + * in output string or a negative error code + */ + +int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in) +{ + ASN1_STRING stmp, *str = &stmp; + int mbflag, type, ret; + if (!in) + return -1; + type = in->type; + if ((type < 0) || (type > 30)) + return -1; + mbflag = tag2nbyte[type]; + if (mbflag == -1) + return -1; + mbflag |= MBSTRING_FLAG; + stmp.data = NULL; + stmp.length = 0; + stmp.flags = 0; + ret = + ASN1_mbstring_copy(&str, in->data, in->length, mbflag, + B_ASN1_UTF8STRING); + if (ret < 0) + return ret; + *out = stmp.data; + return stmp.length; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back new file mode 100644 index 0000000..6dc183a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back @@ -0,0 +1,653 @@ +/* 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 "charmap.h" +#include "../asn1/asn1_locl.h" + +/* + * ASN1_STRING_print_ex() and X509_NAME_print_ex(). Enhanced string and name + * printing routines handling multibyte characters, RFC2253 and a host of + * other options. + */ + +#define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253) + +#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \ + ASN1_STRFLGS_ESC_QUOTE | \ + ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB) + +static int send_bio_chars(void *arg, const void *buf, int len) +{ + if (!arg) + return 1; + if (BIO_write(arg, buf, len) != len) + return 0; + return 1; +} + +static int send_fp_chars(void *arg, const void *buf, int len) +{ + if (!arg) + return 1; + if (fwrite(buf, 1, len, arg) != (unsigned int)len) + return 0; + return 1; +} + +typedef int char_io (void *arg, const void *buf, int len); + +/* + * This function handles display of strings, one character at a time. It is + * passed an unsigned long for each character because it could come from 2 or + * even 4 byte forms. + */ + +#define HEX_SIZE(type) (sizeof(type)*2) + +static int do_esc_char(uint32_t c, unsigned char flags, char *do_quotes, + char_io *io_ch, void *arg) +{ + unsigned char chflgs, chtmp; + char tmphex[HEX_SIZE(uint32_t) + 3]; + + if (c > 0xffff) { + BIO_snprintf(tmphex, sizeof tmphex, "\\W%08" PRIX32, c); + if (!io_ch(arg, tmphex, 10)) + return -1; + return 10; + } + if (c > 0xff) { + BIO_snprintf(tmphex, sizeof tmphex, "\\U%04" PRIX32, c); + if (!io_ch(arg, tmphex, 6)) + return -1; + return 6; + } + chtmp = (unsigned char)c; + if (chtmp > 0x7f) + chflgs = flags & ASN1_STRFLGS_ESC_MSB; + else + chflgs = char_type[chtmp] & flags; + if (chflgs & CHARTYPE_BS_ESC) { + /* If we don't escape with quotes, signal we need quotes */ + if (chflgs & ASN1_STRFLGS_ESC_QUOTE) { + if (do_quotes) + *do_quotes = 1; + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 1; + } + if (!io_ch(arg, "\\", 1)) + return -1; + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 2; + } + if (chflgs & (ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB)) { + BIO_snprintf(tmphex, 11, "\\%02X", chtmp); + if (!io_ch(arg, tmphex, 3)) + return -1; + return 3; + } + /* + * If we get this far and do any escaping at all must escape the escape + * character itself: backslash. + */ + if (chtmp == '\\' && flags & ESC_FLAGS) { + if (!io_ch(arg, "\\\\", 2)) + return -1; + return 2; + } + if (!io_ch(arg, &chtmp, 1)) + return -1; + return 1; +} + +#define BUF_TYPE_WIDTH_MASK 0x7 +#define BUF_TYPE_CONVUTF8 0x8 + +/* + * This function sends each character in a buffer to do_esc_char(). It + * interprets the content formats and converts to or from UTF8 as + * appropriate. + */ + +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, 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 (charwidth) { + case 4: + c = ((uint32_t)*p++) << 24; + c |= ((uint32_t)*p++) << 16; + c |= ((uint32_t)*p++) << 8; + c |= *p++; + break; + + case 2: + c = ((uint32_t)*p++) << 8; + c |= *p++; + break; + + case 1: + c = *p++; + break; + + case 0: + i = UTF8_getc(p, buflen, &c); + if (i < 0) + return -1; /* Invalid UTF8String */ + buflen -= i; + p += i; + break; + default: + return -1; /* invalid width */ + } + if (p == q && flags & ASN1_STRFLGS_ESC_2253) + orflags = CHARTYPE_LAST_ESC_2253; + if (type & BUF_TYPE_CONVUTF8) { + unsigned char utfbuf[6]; + int utflen; + utflen = UTF8_putc(utfbuf, sizeof utfbuf, c); + for (i = 0; i < utflen; i++) { + /* + * We don't need to worry about setting orflags correctly + * because if utflen==1 its value will be correct anyway + * otherwise each character will be > 0x7f and so the + * character will never be escaped on first and last. + */ + len = + do_esc_char(utfbuf[i], (unsigned char)(flags | orflags), + quotes, io_ch, arg); + if (len < 0) + return -1; + outlen += len; + } + } else { + len = + do_esc_char(c, (unsigned char)(flags | orflags), quotes, + io_ch, arg); + if (len < 0) + return -1; + outlen += len; + } + } + return outlen; +} + +/* This function hex dumps a buffer of characters */ + +static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, + int buflen) +{ + static const char hexdig[] = "0123456789ABCDEF"; + unsigned char *p, *q; + char hextmp[2]; + if (arg) { + p = buf; + q = buf + buflen; + while (p != q) { + hextmp[0] = hexdig[*p >> 4]; + hextmp[1] = hexdig[*p & 0xf]; + if (!io_ch(arg, hextmp, 2)) + return -1; + p++; + } + } + return buflen << 1; +} + +/* + * "dump" a string. This is done when the type is unknown, or the flags + * request it. We can either dump the content octets or the entire DER + * encoding. This uses the RFC2253 #01234 format. + */ + +static int do_dump(unsigned long lflags, char_io *io_ch, void *arg, + ASN1_STRING *str) +{ + /* + * Placing the ASN1_STRING in a temp ASN1_TYPE allows the DER encoding to + * readily obtained + */ + ASN1_TYPE t; + unsigned char *der_buf, *p; + int outlen, der_len; + + if (!io_ch(arg, "#", 1)) + return -1; + /* If we don't dump DER encoding just dump content octets */ + if (!(lflags & ASN1_STRFLGS_DUMP_DER)) { + outlen = do_hex_dump(io_ch, arg, str->data, str->length); + if (outlen < 0) + return -1; + return outlen + 1; + } + t.type = str->type; + t.value.ptr = (char *)str; + der_len = i2d_ASN1_TYPE(&t, NULL); + der_buf = OPENSSL_malloc(der_len); + if (!der_buf) + return -1; + p = der_buf; + i2d_ASN1_TYPE(&t, &p); + outlen = do_hex_dump(io_ch, arg, der_buf, der_len); + OPENSSL_free(der_buf); + if (outlen < 0) + return -1; + return outlen + 1; +} + +/* + * Lookup table to convert tags to character widths, 0 = UTF8 encoded, -1 is + * used for non string types otherwise it is the number of bytes per + * character + */ + +static const signed char tag2nbyte[] = { + -1, -1, -1, -1, -1, /* 0-4 */ + -1, -1, -1, -1, -1, /* 5-9 */ + -1, -1, 0, -1, /* 10-13 */ + -1, -1, -1, -1, /* 15-17 */ + 1, 1, 1, /* 18-20 */ + -1, 1, 1, 1, /* 21-24 */ + -1, 1, -1, /* 25-27 */ + 4, -1, 2 /* 28-30 */ +}; + +/* + * This is the main function, print out an ASN1_STRING taking note of various + * escape and display options. Returns number of characters written or -1 if + * an error occurred. + */ + +static int do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, + ASN1_STRING *str) +{ + int outlen, len; + int type; + char quotes; + unsigned char flags; + quotes = 0; + /* Keep a copy of escape flags */ + flags = (unsigned char)(lflags & ESC_FLAGS); + + type = str->type; + + outlen = 0; + + if (lflags & ASN1_STRFLGS_SHOW_TYPE) { + const char *tagname; + tagname = ASN1_tag2str(type); + outlen += strlen(tagname); + if (!io_ch(arg, tagname, outlen) || !io_ch(arg, ":", 1)) + return -1; + outlen++; + } + + /* Decide what to do with type, either dump content or display it */ + + /* Dump everything */ + if (lflags & ASN1_STRFLGS_DUMP_ALL) + type = -1; + /* Ignore the string type */ + else if (lflags & ASN1_STRFLGS_IGNORE_TYPE) + type = 1; + else { + /* Else determine width based on type */ + if ((type > 0) && (type < 31)) + type = tag2nbyte[type]; + else + type = -1; + if ((type == -1) && !(lflags & ASN1_STRFLGS_DUMP_UNKNOWN)) + type = 1; + } + + if (type == -1) { + len = do_dump(lflags, io_ch, arg, str); + if (len < 0) + return -1; + outlen += len; + return outlen; + } + + if (lflags & ASN1_STRFLGS_UTF8_CONVERT) { + /* + * Note: if string is UTF8 and we want to convert to UTF8 then we + * just interpret it as 1 byte per character to avoid converting + * twice. + */ + if (!type) + type = 1; + else + type |= BUF_TYPE_CONVUTF8; + } + + len = do_buf(str->data, str->length, type, flags, "es, io_ch, NULL); + if (len < 0) + return -1; + outlen += len; + if (quotes) + outlen += 2; + if (!arg) + return outlen; + if (quotes && !io_ch(arg, "\"", 1)) + return -1; + if (do_buf(str->data, str->length, type, flags, NULL, io_ch, arg) < 0) + return -1; + if (quotes && !io_ch(arg, "\"", 1)) + return -1; + return outlen; +} + +/* Used for line indenting: print 'indent' spaces */ + +static int do_indent(char_io *io_ch, void *arg, int indent) +{ + int i; + for (i = 0; i < indent; i++) + if (!io_ch(arg, " ", 1)) + return 0; + return 1; +} + +#define FN_WIDTH_LN 25 +#define FN_WIDTH_SN 10 + +static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, + int indent, unsigned long flags) +{ + int i, prev = -1, orflags, cnt; + int fn_opt, fn_nid; + ASN1_OBJECT *fn; + ASN1_STRING *val; + X509_NAME_ENTRY *ent; + char objtmp[80]; + const char *objbuf; + int outlen, len; + const char *sep_dn, *sep_mv, *sep_eq; + int sep_dn_len, sep_mv_len, sep_eq_len; + if (indent < 0) + indent = 0; + outlen = indent; + if (!do_indent(io_ch, arg, indent)) + return -1; + switch (flags & XN_FLAG_SEP_MASK) { + case XN_FLAG_SEP_MULTILINE: + sep_dn = "\n"; + sep_dn_len = 1; + sep_mv = " + "; + sep_mv_len = 3; + break; + + case XN_FLAG_SEP_COMMA_PLUS: + sep_dn = ","; + sep_dn_len = 1; + sep_mv = "+"; + sep_mv_len = 1; + indent = 0; + break; + + case XN_FLAG_SEP_CPLUS_SPC: + sep_dn = ", "; + sep_dn_len = 2; + sep_mv = " + "; + sep_mv_len = 3; + indent = 0; + break; + + case XN_FLAG_SEP_SPLUS_SPC: + sep_dn = "; "; + sep_dn_len = 2; + sep_mv = " + "; + sep_mv_len = 3; + indent = 0; + break; + + default: + return -1; + } + + if (flags & XN_FLAG_SPC_EQ) { + sep_eq = " = "; + sep_eq_len = 3; + } else { + sep_eq = "="; + sep_eq_len = 1; + } + + fn_opt = flags & XN_FLAG_FN_MASK; + + cnt = X509_NAME_entry_count(n); + for (i = 0; i < cnt; i++) { + if (flags & XN_FLAG_DN_REV) + ent = X509_NAME_get_entry(n, cnt - i - 1); + else + ent = X509_NAME_get_entry(n, i); + if (prev != -1) { + if (prev == ent->set) { + if (!io_ch(arg, sep_mv, sep_mv_len)) + return -1; + outlen += sep_mv_len; + } else { + if (!io_ch(arg, sep_dn, sep_dn_len)) + return -1; + outlen += sep_dn_len; + if (!do_indent(io_ch, arg, indent)) + return -1; + outlen += indent; + } + } + prev = ent->set; + fn = X509_NAME_ENTRY_get_object(ent); + val = X509_NAME_ENTRY_get_data(ent); + fn_nid = OBJ_obj2nid(fn); + if (fn_opt != XN_FLAG_FN_NONE) { + int objlen, fld_len; + if ((fn_opt == XN_FLAG_FN_OID) || (fn_nid == NID_undef)) { + OBJ_obj2txt(objtmp, sizeof objtmp, fn, 1); + fld_len = 0; /* XXX: what should this be? */ + objbuf = objtmp; + } else { + if (fn_opt == XN_FLAG_FN_SN) { + fld_len = FN_WIDTH_SN; + objbuf = OBJ_nid2sn(fn_nid); + } else if (fn_opt == XN_FLAG_FN_LN) { + fld_len = FN_WIDTH_LN; + objbuf = OBJ_nid2ln(fn_nid); + } else { + fld_len = 0; /* XXX: what should this be? */ + objbuf = ""; + } + } + objlen = strlen(objbuf); + if (!io_ch(arg, objbuf, objlen)) + return -1; + if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) { + if (!do_indent(io_ch, arg, fld_len - objlen)) + return -1; + outlen += fld_len - objlen; + } + if (!io_ch(arg, sep_eq, sep_eq_len)) + return -1; + outlen += objlen + sep_eq_len; + } + /* + * If the field name is unknown then fix up the DER dump flag. We + * might want to limit this further so it will DER dump on anything + * other than a few 'standard' fields. + */ + if ((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS)) + orflags = ASN1_STRFLGS_DUMP_ALL; + else + orflags = 0; + + len = do_print_ex(io_ch, arg, flags | orflags, val); + if (len < 0) + return -1; + outlen += len; + } + return outlen; +} + +/* Wrappers round the main functions */ + +int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, + unsigned long flags) +{ + if (flags == XN_FLAG_COMPAT) + return X509_NAME_print(out, nm, indent); + return do_name_ex(send_bio_chars, out, nm, indent, flags); +} + +#ifndef OPENSSL_NO_FP_API +int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, + unsigned long flags) +{ + if (flags == XN_FLAG_COMPAT) { + BIO *btmp; + int ret; + btmp = BIO_new_fp(fp, BIO_NOCLOSE); + if (!btmp) + return -1; + ret = X509_NAME_print(btmp, nm, indent); + BIO_free(btmp); + return ret; + } + return do_name_ex(send_fp_chars, fp, nm, indent, flags); +} +#endif + +int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) +{ + return do_print_ex(send_bio_chars, out, flags, str); +} + +#ifndef OPENSSL_NO_FP_API +int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) +{ + return do_print_ex(send_fp_chars, fp, flags, str); +} +#endif + +/* + * Utility function: convert any string type to UTF8, returns number of bytes + * in output string or a negative error code + */ + +int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in) +{ + ASN1_STRING stmp, *str = &stmp; + int mbflag, type, ret; + if (!in) + return -1; + type = in->type; + if ((type < 0) || (type > 30)) + return -1; + mbflag = tag2nbyte[type]; + if (mbflag == -1) + return -1; + mbflag |= MBSTRING_FLAG; + stmp.data = NULL; + stmp.length = 0; + stmp.flags = 0; + ret = + ASN1_mbstring_copy(&str, in->data, in->length, mbflag, + B_ASN1_UTF8STRING); + if (ret < 0) + return ret; + *out = stmp.data; + return stmp.length; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c new file mode 100644 index 0000000..f8e7a99 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c @@ -0,0 +1,114 @@ +/* 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 "internal.h" + +int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, + ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) +{ + EVP_MD_CTX ctx; + uint8_t *buf_in = NULL; + int ret = 0, inl = 0; + + if (!pkey) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (signature->type == V_ASN1_BIT_STRING && signature->flags & 0x7) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_BIT_STRING_BITS_LEFT); + return 0; + } + + EVP_MD_CTX_init(&ctx); + + if (!x509_digest_verify_init(&ctx, a, pkey)) { + goto err; + } + + inl = ASN1_item_i2d(asn, &buf_in, it); + + if (buf_in == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!EVP_DigestVerify(&ctx, signature->data, (size_t)signature->length, + buf_in, inl)) { + OPENSSL_PUT_ERROR(X509, ERR_R_EVP_LIB); + goto err; + } + + ret = 1; + +err: + OPENSSL_free(buf_in); + EVP_MD_CTX_cleanup(&ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back new file mode 100644 index 0000000..8587b59 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back @@ -0,0 +1,114 @@ +/* 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 "internal.h" + +int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, + ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) +{ + EVP_MD_CTX ctx; + uint8_t *buf_in = NULL; + int ret = 0, inl = 0; + + if (!pkey) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (signature->type == V_ASN1_BIT_STRING && signature->flags & 0x7) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_BIT_STRING_BITS_LEFT); + return 0; + } + + EVP_MD_CTX_init(&ctx); + + if (!x509_digest_verify_init(&ctx, a, pkey)) { + goto err; + } + + inl = ASN1_item_i2d(asn, &buf_in, it); + + if (buf_in == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!EVP_DigestVerify(&ctx, signature->data, (size_t)signature->length, + buf_in, inl)) { + OPENSSL_PUT_ERROR(X509, ERR_R_EVP_LIB); + goto err; + } + + ret = 1; + +err: + OPENSSL_free(buf_in); + EVP_MD_CTX_cleanup(&ctx); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c new file mode 100644 index 0000000..aadcafb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c @@ -0,0 +1,153 @@ +/* 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 "internal.h" + + +int x509_digest_sign_algorithm(EVP_MD_CTX *ctx, X509_ALGOR *algor) { + EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + if (pkey == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_CONTEXT_NOT_INITIALISED); + return 0; + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) { + int pad_mode; + if (!EVP_PKEY_CTX_get_rsa_padding(ctx->pctx, &pad_mode)) { + return 0; + } + /* RSA-PSS has special signature algorithm logic. */ + if (pad_mode == RSA_PKCS1_PSS_PADDING) { + return x509_rsa_ctx_to_pss(ctx, algor); + } + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_ED25519) { + return X509_ALGOR_set0(algor, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL); + } + + /* Default behavior: look up the OID for the algorithm/hash pair and encode + * that. */ + const EVP_MD *digest = EVP_MD_CTX_md(ctx); + if (digest == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_CONTEXT_NOT_INITIALISED); + return 0; + } + + int sign_nid; + if (!OBJ_find_sigid_by_algs(&sign_nid, EVP_MD_type(digest), + EVP_PKEY_id(pkey))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED); + return 0; + } + + /* RSA signature algorithms include an explicit NULL parameter. Others omit + * it. */ + int paramtype = + (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) ? V_ASN1_NULL : V_ASN1_UNDEF; + X509_ALGOR_set0(algor, OBJ_nid2obj(sign_nid), paramtype, NULL); + return 1; +} + +int x509_digest_verify_init(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, + EVP_PKEY *pkey) { + /* Convert the signature OID into digest and public key OIDs. */ + int sigalg_nid = OBJ_obj2nid(sigalg->algorithm); + int digest_nid, pkey_nid; + if (!OBJ_find_sigid_algs(sigalg_nid, &digest_nid, &pkey_nid)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); + return 0; + } + + /* Check the public key OID matches the public key type. */ + if (pkey_nid != EVP_PKEY_id(pkey)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE); + return 0; + } + + /* NID_undef signals that there are custom parameters to set. */ + if (digest_nid == NID_undef) { + if (sigalg_nid == NID_rsassaPss) { + return x509_rsa_pss_to_ctx(ctx, sigalg, pkey); + } + if (sigalg_nid == NID_ED25519) { + if (sigalg->parameter != NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PARAMETER); + return 0; + } + return EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey); + } + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); + return 0; + } + + /* Otherwise, initialize with the digest from the OID. */ + const EVP_MD *digest = EVP_get_digestbynid(digest_nid); + if (digest == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); + return 0; + } + + return EVP_DigestVerifyInit(ctx, NULL, digest, NULL, pkey); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c.grpc_back new file mode 100644 index 0000000..8f53fff --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c.grpc_back @@ -0,0 +1,153 @@ +/* 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 "internal.h" + + +int x509_digest_sign_algorithm(EVP_MD_CTX *ctx, X509_ALGOR *algor) { + EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + if (pkey == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_CONTEXT_NOT_INITIALISED); + return 0; + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) { + int pad_mode; + if (!EVP_PKEY_CTX_get_rsa_padding(ctx->pctx, &pad_mode)) { + return 0; + } + /* RSA-PSS has special signature algorithm logic. */ + if (pad_mode == RSA_PKCS1_PSS_PADDING) { + return x509_rsa_ctx_to_pss(ctx, algor); + } + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_ED25519) { + return X509_ALGOR_set0(algor, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL); + } + + /* Default behavior: look up the OID for the algorithm/hash pair and encode + * that. */ + const EVP_MD *digest = EVP_MD_CTX_md(ctx); + if (digest == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_CONTEXT_NOT_INITIALISED); + return 0; + } + + int sign_nid; + if (!OBJ_find_sigid_by_algs(&sign_nid, EVP_MD_type(digest), + EVP_PKEY_id(pkey))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED); + return 0; + } + + /* RSA signature algorithms include an explicit NULL parameter. Others omit + * it. */ + int paramtype = + (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) ? V_ASN1_NULL : V_ASN1_UNDEF; + X509_ALGOR_set0(algor, OBJ_nid2obj(sign_nid), paramtype, NULL); + return 1; +} + +int x509_digest_verify_init(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, + EVP_PKEY *pkey) { + /* Convert the signature OID into digest and public key OIDs. */ + int sigalg_nid = OBJ_obj2nid(sigalg->algorithm); + int digest_nid, pkey_nid; + if (!OBJ_find_sigid_algs(sigalg_nid, &digest_nid, &pkey_nid)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); + return 0; + } + + /* Check the public key OID matches the public key type. */ + if (pkey_nid != EVP_PKEY_id(pkey)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE); + return 0; + } + + /* NID_undef signals that there are custom parameters to set. */ + if (digest_nid == NID_undef) { + if (sigalg_nid == NID_rsassaPss) { + return x509_rsa_pss_to_ctx(ctx, sigalg, pkey); + } + if (sigalg_nid == NID_ED25519) { + if (sigalg->parameter != NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PARAMETER); + return 0; + } + return EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey); + } + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); + return 0; + } + + /* Otherwise, initialize with the digest from the OID. */ + const EVP_MD *digest = EVP_get_digestbynid(digest_nid); + if (digest == NULL) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); + return 0; + } + + return EVP_DigestVerifyInit(ctx, NULL, digest, NULL, pkey); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c new file mode 100644 index 0000000..62b1a8e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c @@ -0,0 +1,842 @@ +/* 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 "../internal.h" +#include "../x509v3/internal.h" + +/* + * Although this file is in crypto/x509 for layering purposes, it emits + * errors from the ASN.1 module for OpenSSL compatibility. + */ + +#define ASN1_GEN_FLAG 0x10000 +#define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1) +#define ASN1_GEN_FLAG_EXP (ASN1_GEN_FLAG|2) +#define ASN1_GEN_FLAG_TAG (ASN1_GEN_FLAG|3) +#define ASN1_GEN_FLAG_BITWRAP (ASN1_GEN_FLAG|4) +#define ASN1_GEN_FLAG_OCTWRAP (ASN1_GEN_FLAG|5) +#define ASN1_GEN_FLAG_SEQWRAP (ASN1_GEN_FLAG|6) +#define ASN1_GEN_FLAG_SETWRAP (ASN1_GEN_FLAG|7) +#define ASN1_GEN_FLAG_FORMAT (ASN1_GEN_FLAG|8) + +#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val} + +#define ASN1_FLAG_EXP_MAX 20 +/* Maximum number of nested sequences */ +#define ASN1_GEN_SEQ_MAX_DEPTH 50 + +/* Input formats */ + +/* ASCII: default */ +#define ASN1_GEN_FORMAT_ASCII 1 +/* UTF8 */ +#define ASN1_GEN_FORMAT_UTF8 2 +/* Hex */ +#define ASN1_GEN_FORMAT_HEX 3 +/* List of bits */ +#define ASN1_GEN_FORMAT_BITLIST 4 + +struct tag_name_st { + const char *strnam; + int len; + int tag; +}; + +typedef struct { + int exp_tag; + int exp_class; + int exp_constructed; + int exp_pad; + long exp_len; +} tag_exp_type; + +typedef struct { + int imp_tag; + int imp_class; + int utype; + int format; + const char *str; + tag_exp_type exp_list[ASN1_FLAG_EXP_MAX]; + int exp_count; +} tag_exp_arg; + +static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, + int *perr); +static int bitstr_cb(const char *elem, int len, void *bitstr); +static int asn1_cb(const char *elem, int len, void *bitstr); +static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, + int exp_constructed, int exp_pad, int imp_ok); +static int parse_tagging(const char *vstart, int vlen, int *ptag, + int *pclass); +static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf, + int depth, int *perr); +static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype); +static int asn1_str2tag(const char *tagstr, int len); + +ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf) +{ + X509V3_CTX cnf; + + if (!nconf) + return ASN1_generate_v3(str, NULL); + + X509V3_set_nconf(&cnf, nconf); + return ASN1_generate_v3(str, &cnf); +} + +ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf) +{ + int err = 0; + ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err); + if (err) + OPENSSL_PUT_ERROR(ASN1, err); + return ret; +} + +static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, + int *perr) +{ + ASN1_TYPE *ret; + tag_exp_arg asn1_tags; + tag_exp_type *etmp; + + int i, len; + + unsigned char *orig_der = NULL, *new_der = NULL; + const unsigned char *cpy_start; + unsigned char *p; + const unsigned char *cp; + int cpy_len; + long hdr_len = 0; + int hdr_constructed = 0, hdr_tag, hdr_class; + int r; + + asn1_tags.imp_tag = -1; + asn1_tags.imp_class = -1; + asn1_tags.format = ASN1_GEN_FORMAT_ASCII; + asn1_tags.exp_count = 0; + if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) { + *perr = ASN1_R_UNKNOWN_TAG; + return NULL; + } + + if ((asn1_tags.utype == V_ASN1_SEQUENCE) + || (asn1_tags.utype == V_ASN1_SET)) { + if (!cnf) { + *perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG; + return NULL; + } + if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) { + *perr = ASN1_R_ILLEGAL_NESTED_TAGGING; + return NULL; + } + ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr); + } else + ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype); + + if (!ret) + return NULL; + + /* If no tagging return base type */ + if ((asn1_tags.imp_tag == -1) && (asn1_tags.exp_count == 0)) + return ret; + + /* Generate the encoding */ + cpy_len = i2d_ASN1_TYPE(ret, &orig_der); + ASN1_TYPE_free(ret); + ret = NULL; + /* Set point to start copying for modified encoding */ + cpy_start = orig_der; + + /* Do we need IMPLICIT tagging? */ + if (asn1_tags.imp_tag != -1) { + /* If IMPLICIT we will replace the underlying tag */ + /* Skip existing tag+len */ + r = ASN1_get_object(&cpy_start, &hdr_len, &hdr_tag, &hdr_class, + cpy_len); + if (r & 0x80) + goto err; + /* Update copy length */ + cpy_len -= cpy_start - orig_der; + /* + * For IMPLICIT tagging the length should match the original length + * and constructed flag should be consistent. + */ + if (r & 0x1) { + /* Indefinite length constructed */ + hdr_constructed = 2; + hdr_len = 0; + } else + /* Just retain constructed flag */ + hdr_constructed = r & V_ASN1_CONSTRUCTED; + /* + * Work out new length with IMPLICIT tag: ignore constructed because + * it will mess up if indefinite length + */ + len = ASN1_object_size(0, hdr_len, asn1_tags.imp_tag); + } else + len = cpy_len; + + /* Work out length in any EXPLICIT, starting from end */ + + for (i = 0, etmp = asn1_tags.exp_list + asn1_tags.exp_count - 1; + i < asn1_tags.exp_count; i++, etmp--) { + /* Content length: number of content octets + any padding */ + len += etmp->exp_pad; + etmp->exp_len = len; + /* Total object length: length including new header */ + len = ASN1_object_size(0, len, etmp->exp_tag); + } + + /* Allocate buffer for new encoding */ + + new_der = OPENSSL_malloc(len); + if (!new_der) + goto err; + + /* Generate tagged encoding */ + + p = new_der; + + /* Output explicit tags first */ + + for (i = 0, etmp = asn1_tags.exp_list; i < asn1_tags.exp_count; + i++, etmp++) { + ASN1_put_object(&p, etmp->exp_constructed, etmp->exp_len, + etmp->exp_tag, etmp->exp_class); + if (etmp->exp_pad) + *p++ = 0; + } + + /* If IMPLICIT, output tag */ + + if (asn1_tags.imp_tag != -1) { + if (asn1_tags.imp_class == V_ASN1_UNIVERSAL + && (asn1_tags.imp_tag == V_ASN1_SEQUENCE + || asn1_tags.imp_tag == V_ASN1_SET)) + hdr_constructed = V_ASN1_CONSTRUCTED; + ASN1_put_object(&p, hdr_constructed, hdr_len, + asn1_tags.imp_tag, asn1_tags.imp_class); + } + + /* Copy across original encoding */ + OPENSSL_memcpy(p, cpy_start, cpy_len); + + cp = new_der; + + /* Obtain new ASN1_TYPE structure */ + ret = d2i_ASN1_TYPE(NULL, &cp, len); + + err: + if (orig_der) + OPENSSL_free(orig_der); + if (new_der) + OPENSSL_free(new_der); + + return ret; + +} + +static int asn1_cb(const char *elem, int len, void *bitstr) +{ + tag_exp_arg *arg = bitstr; + int i; + int utype; + int vlen = 0; + const char *p, *vstart = NULL; + + int tmp_tag, tmp_class; + + if (elem == NULL) + return -1; + + for (i = 0, p = elem; i < len; p++, i++) { + /* Look for the ':' in name value pairs */ + if (*p == ':') { + vstart = p + 1; + vlen = len - (vstart - elem); + len = p - elem; + break; + } + } + + utype = asn1_str2tag(elem, len); + + if (utype == -1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_TAG); + ERR_add_error_data(2, "tag=", elem); + return -1; + } + + /* If this is not a modifier mark end of string and exit */ + if (!(utype & ASN1_GEN_FLAG)) { + arg->utype = utype; + arg->str = vstart; + /* If no value and not end of string, error */ + if (!vstart && elem[len]) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_VALUE); + return -1; + } + return 0; + } + + switch (utype) { + + case ASN1_GEN_FLAG_IMP: + /* Check for illegal multiple IMPLICIT tagging */ + if (arg->imp_tag != -1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING); + return -1; + } + if (!parse_tagging(vstart, vlen, &arg->imp_tag, &arg->imp_class)) + return -1; + break; + + case ASN1_GEN_FLAG_EXP: + + if (!parse_tagging(vstart, vlen, &tmp_tag, &tmp_class)) + return -1; + if (!append_exp(arg, tmp_tag, tmp_class, 1, 0, 0)) + return -1; + break; + + case ASN1_GEN_FLAG_SEQWRAP: + if (!append_exp(arg, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, 1, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_SETWRAP: + if (!append_exp(arg, V_ASN1_SET, V_ASN1_UNIVERSAL, 1, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_BITWRAP: + if (!append_exp(arg, V_ASN1_BIT_STRING, V_ASN1_UNIVERSAL, 0, 1, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_OCTWRAP: + if (!append_exp(arg, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL, 0, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_FORMAT: + if (!vstart) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + if (!strncmp(vstart, "ASCII", 5)) + arg->format = ASN1_GEN_FORMAT_ASCII; + else if (!strncmp(vstart, "UTF8", 4)) + arg->format = ASN1_GEN_FORMAT_UTF8; + else if (!strncmp(vstart, "HEX", 3)) + arg->format = ASN1_GEN_FORMAT_HEX; + else if (!strncmp(vstart, "BITLIST", 7)) + arg->format = ASN1_GEN_FORMAT_BITLIST; + else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + break; + + } + + return 1; + +} + +static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass) +{ + char erch[2]; + long tag_num; + char *eptr; + if (!vstart) + return 0; + tag_num = strtoul(vstart, &eptr, 10); + /* Check we haven't gone past max length: should be impossible */ + if (eptr && *eptr && (eptr > vstart + vlen)) + return 0; + if (tag_num < 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_NUMBER); + return 0; + } + *ptag = tag_num; + /* If we have non numeric characters, parse them */ + if (eptr) + vlen -= eptr - vstart; + else + vlen = 0; + if (vlen) { + switch (*eptr) { + + case 'U': + *pclass = V_ASN1_UNIVERSAL; + break; + + case 'A': + *pclass = V_ASN1_APPLICATION; + break; + + case 'P': + *pclass = V_ASN1_PRIVATE; + break; + + case 'C': + *pclass = V_ASN1_CONTEXT_SPECIFIC; + break; + + default: + erch[0] = *eptr; + erch[1] = 0; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_MODIFIER); + ERR_add_error_data(2, "Char=", erch); + return 0; + break; + + } + } else + *pclass = V_ASN1_CONTEXT_SPECIFIC; + + return 1; + +} + +/* Handle multiple types: SET and SEQUENCE */ + +static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf, + int depth, int *perr) +{ + ASN1_TYPE *ret = NULL; + STACK_OF(ASN1_TYPE) *sk = NULL; + STACK_OF(CONF_VALUE) *sect = NULL; + unsigned char *der = NULL; + int derlen; + size_t i; + sk = sk_ASN1_TYPE_new_null(); + if (!sk) + goto bad; + if (section) { + if (!cnf) + goto bad; + sect = X509V3_get_section(cnf, (char *)section); + if (!sect) + goto bad; + for (i = 0; i < sk_CONF_VALUE_num(sect); i++) { + ASN1_TYPE *typ = + generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf, + depth + 1, perr); + if (!typ) + goto bad; + if (!sk_ASN1_TYPE_push(sk, typ)) + goto bad; + } + } + + /* + * Now we has a STACK of the components, convert to the correct form + */ + + if (utype == V_ASN1_SET) + derlen = i2d_ASN1_SET_ANY(sk, &der); + else + derlen = i2d_ASN1_SEQUENCE_ANY(sk, &der); + + if (derlen < 0) + goto bad; + + if (!(ret = ASN1_TYPE_new())) + goto bad; + + if (!(ret->value.asn1_string = ASN1_STRING_type_new(utype))) + goto bad; + + ret->type = utype; + + ret->value.asn1_string->data = der; + ret->value.asn1_string->length = derlen; + + der = NULL; + + bad: + + if (der) + OPENSSL_free(der); + + if (sk) + sk_ASN1_TYPE_pop_free(sk, ASN1_TYPE_free); + if (sect) + X509V3_section_free(cnf, sect); + + return ret; +} + +static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, + int exp_constructed, int exp_pad, int imp_ok) +{ + tag_exp_type *exp_tmp; + /* Can only have IMPLICIT if permitted */ + if ((arg->imp_tag != -1) && !imp_ok) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG); + return 0; + } + + if (arg->exp_count == ASN1_FLAG_EXP_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DEPTH_EXCEEDED); + return 0; + } + + exp_tmp = &arg->exp_list[arg->exp_count++]; + + /* + * If IMPLICIT set tag to implicit value then reset implicit tag since it + * has been used. + */ + if (arg->imp_tag != -1) { + exp_tmp->exp_tag = arg->imp_tag; + exp_tmp->exp_class = arg->imp_class; + arg->imp_tag = -1; + arg->imp_class = -1; + } else { + exp_tmp->exp_tag = exp_tag; + exp_tmp->exp_class = exp_class; + } + exp_tmp->exp_constructed = exp_constructed; + exp_tmp->exp_pad = exp_pad; + + return 1; +} + +static int asn1_str2tag(const char *tagstr, int len) +{ + unsigned int i; + static const struct tag_name_st *tntmp, tnst[] = { + ASN1_GEN_STR("BOOL", V_ASN1_BOOLEAN), + ASN1_GEN_STR("BOOLEAN", V_ASN1_BOOLEAN), + ASN1_GEN_STR("NULL", V_ASN1_NULL), + ASN1_GEN_STR("INT", V_ASN1_INTEGER), + ASN1_GEN_STR("INTEGER", V_ASN1_INTEGER), + ASN1_GEN_STR("ENUM", V_ASN1_ENUMERATED), + ASN1_GEN_STR("ENUMERATED", V_ASN1_ENUMERATED), + ASN1_GEN_STR("OID", V_ASN1_OBJECT), + ASN1_GEN_STR("OBJECT", V_ASN1_OBJECT), + ASN1_GEN_STR("UTCTIME", V_ASN1_UTCTIME), + ASN1_GEN_STR("UTC", V_ASN1_UTCTIME), + ASN1_GEN_STR("GENERALIZEDTIME", V_ASN1_GENERALIZEDTIME), + ASN1_GEN_STR("GENTIME", V_ASN1_GENERALIZEDTIME), + ASN1_GEN_STR("OCT", V_ASN1_OCTET_STRING), + ASN1_GEN_STR("OCTETSTRING", V_ASN1_OCTET_STRING), + ASN1_GEN_STR("BITSTR", V_ASN1_BIT_STRING), + ASN1_GEN_STR("BITSTRING", V_ASN1_BIT_STRING), + ASN1_GEN_STR("UNIVERSALSTRING", V_ASN1_UNIVERSALSTRING), + ASN1_GEN_STR("UNIV", V_ASN1_UNIVERSALSTRING), + ASN1_GEN_STR("IA5", V_ASN1_IA5STRING), + ASN1_GEN_STR("IA5STRING", V_ASN1_IA5STRING), + ASN1_GEN_STR("UTF8", V_ASN1_UTF8STRING), + ASN1_GEN_STR("UTF8String", V_ASN1_UTF8STRING), + ASN1_GEN_STR("BMP", V_ASN1_BMPSTRING), + ASN1_GEN_STR("BMPSTRING", V_ASN1_BMPSTRING), + ASN1_GEN_STR("VISIBLESTRING", V_ASN1_VISIBLESTRING), + ASN1_GEN_STR("VISIBLE", V_ASN1_VISIBLESTRING), + ASN1_GEN_STR("PRINTABLESTRING", V_ASN1_PRINTABLESTRING), + ASN1_GEN_STR("PRINTABLE", V_ASN1_PRINTABLESTRING), + ASN1_GEN_STR("T61", V_ASN1_T61STRING), + ASN1_GEN_STR("T61STRING", V_ASN1_T61STRING), + ASN1_GEN_STR("TELETEXSTRING", V_ASN1_T61STRING), + ASN1_GEN_STR("GeneralString", V_ASN1_GENERALSTRING), + ASN1_GEN_STR("GENSTR", V_ASN1_GENERALSTRING), + ASN1_GEN_STR("NUMERIC", V_ASN1_NUMERICSTRING), + ASN1_GEN_STR("NUMERICSTRING", V_ASN1_NUMERICSTRING), + + /* Special cases */ + ASN1_GEN_STR("SEQUENCE", V_ASN1_SEQUENCE), + ASN1_GEN_STR("SEQ", V_ASN1_SEQUENCE), + ASN1_GEN_STR("SET", V_ASN1_SET), + /* type modifiers */ + /* Explicit tag */ + ASN1_GEN_STR("EXP", ASN1_GEN_FLAG_EXP), + ASN1_GEN_STR("EXPLICIT", ASN1_GEN_FLAG_EXP), + /* Implicit tag */ + ASN1_GEN_STR("IMP", ASN1_GEN_FLAG_IMP), + ASN1_GEN_STR("IMPLICIT", ASN1_GEN_FLAG_IMP), + /* OCTET STRING wrapper */ + ASN1_GEN_STR("OCTWRAP", ASN1_GEN_FLAG_OCTWRAP), + /* SEQUENCE wrapper */ + ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP), + /* SET wrapper */ + ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SETWRAP), + /* BIT STRING wrapper */ + ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP), + ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT), + ASN1_GEN_STR("FORMAT", ASN1_GEN_FLAG_FORMAT), + }; + + if (len == -1) + len = strlen(tagstr); + + tntmp = tnst; + for (i = 0; i < sizeof(tnst) / sizeof(struct tag_name_st); i++, tntmp++) { + if ((len == tntmp->len) && !strncmp(tntmp->strnam, tagstr, len)) + return tntmp->tag; + } + + return -1; +} + +static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) +{ + ASN1_TYPE *atmp = NULL; + + CONF_VALUE vtmp; + + unsigned char *rdata; + long rdlen; + + int no_unused = 1; + + if (!(atmp = ASN1_TYPE_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (!str) + str = ""; + + switch (utype) { + + case V_ASN1_NULL: + if (str && *str) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NULL_VALUE); + goto bad_form; + } + break; + + case V_ASN1_BOOLEAN: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ASCII_FORMAT); + goto bad_form; + } + vtmp.name = NULL; + vtmp.section = NULL; + vtmp.value = (char *)str; + if (!X509V3_get_value_bool(&vtmp, &atmp->value.boolean)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_BOOLEAN); + goto bad_str; + } + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.integer = s2i_ASN1_INTEGER(NULL, (char *)str))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_INTEGER); + goto bad_str; + } + break; + + case V_ASN1_OBJECT: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.object = OBJ_txt2obj(str, 0))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_OBJECT); + goto bad_str; + } + break; + + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.asn1_string = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + if (!ASN1_STRING_set(atmp->value.asn1_string, str, -1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + atmp->value.asn1_string->type = utype; + if (!ASN1_TIME_check(atmp->value.asn1_string)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_TIME_VALUE); + goto bad_str; + } + + break; + + case V_ASN1_BMPSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_IA5STRING: + case V_ASN1_T61STRING: + case V_ASN1_UTF8STRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_NUMERICSTRING: + + if (format == ASN1_GEN_FORMAT_ASCII) + format = MBSTRING_ASC; + else if (format == ASN1_GEN_FORMAT_UTF8) + format = MBSTRING_UTF8; + else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_FORMAT); + goto bad_form; + } + + if (ASN1_mbstring_copy(&atmp->value.asn1_string, (unsigned char *)str, + -1, format, ASN1_tag2bit(utype)) <= 0) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + + break; + + case V_ASN1_BIT_STRING: + + case V_ASN1_OCTET_STRING: + + if (!(atmp->value.asn1_string = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_form; + } + + if (format == ASN1_GEN_FORMAT_HEX) { + + if (!(rdata = x509v3_hex_to_bytes((char *)str, &rdlen))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_HEX); + goto bad_str; + } + + atmp->value.asn1_string->data = rdata; + atmp->value.asn1_string->length = rdlen; + atmp->value.asn1_string->type = utype; + + } else if (format == ASN1_GEN_FORMAT_ASCII) + ASN1_STRING_set(atmp->value.asn1_string, str, -1); + else if ((format == ASN1_GEN_FORMAT_BITLIST) + && (utype == V_ASN1_BIT_STRING)) { + if (!CONF_parse_list + (str, ',', 1, bitstr_cb, atmp->value.bit_string)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_LIST_ERROR); + goto bad_str; + } + no_unused = 0; + + } else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT); + goto bad_form; + } + + if ((utype == V_ASN1_BIT_STRING) && no_unused) { + atmp->value.asn1_string->flags + &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + atmp->value.asn1_string->flags |= ASN1_STRING_FLAG_BITS_LEFT; + } + + break; + + default: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_TYPE); + goto bad_str; + break; + } + + atmp->type = utype; + return atmp; + + bad_str: + ERR_add_error_data(2, "string=", str); + bad_form: + + ASN1_TYPE_free(atmp); + return NULL; + +} + +static int bitstr_cb(const char *elem, int len, void *bitstr) +{ + long bitnum; + char *eptr; + if (!elem) + return 0; + bitnum = strtoul(elem, &eptr, 10); + if (eptr && *eptr && (eptr != elem + len)) + return 0; + if (bitnum < 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_NUMBER); + return 0; + } + if (!ASN1_BIT_STRING_set_bit(bitstr, bitnum, 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back new file mode 100644 index 0000000..98a6fac --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back @@ -0,0 +1,842 @@ +/* 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 "../internal.h" +#include "../x509v3/internal.h" + +/* + * Although this file is in crypto/x509 for layering purposes, it emits + * errors from the ASN.1 module for OpenSSL compatibility. + */ + +#define ASN1_GEN_FLAG 0x10000 +#define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1) +#define ASN1_GEN_FLAG_EXP (ASN1_GEN_FLAG|2) +#define ASN1_GEN_FLAG_TAG (ASN1_GEN_FLAG|3) +#define ASN1_GEN_FLAG_BITWRAP (ASN1_GEN_FLAG|4) +#define ASN1_GEN_FLAG_OCTWRAP (ASN1_GEN_FLAG|5) +#define ASN1_GEN_FLAG_SEQWRAP (ASN1_GEN_FLAG|6) +#define ASN1_GEN_FLAG_SETWRAP (ASN1_GEN_FLAG|7) +#define ASN1_GEN_FLAG_FORMAT (ASN1_GEN_FLAG|8) + +#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val} + +#define ASN1_FLAG_EXP_MAX 20 +/* Maximum number of nested sequences */ +#define ASN1_GEN_SEQ_MAX_DEPTH 50 + +/* Input formats */ + +/* ASCII: default */ +#define ASN1_GEN_FORMAT_ASCII 1 +/* UTF8 */ +#define ASN1_GEN_FORMAT_UTF8 2 +/* Hex */ +#define ASN1_GEN_FORMAT_HEX 3 +/* List of bits */ +#define ASN1_GEN_FORMAT_BITLIST 4 + +struct tag_name_st { + const char *strnam; + int len; + int tag; +}; + +typedef struct { + int exp_tag; + int exp_class; + int exp_constructed; + int exp_pad; + long exp_len; +} tag_exp_type; + +typedef struct { + int imp_tag; + int imp_class; + int utype; + int format; + const char *str; + tag_exp_type exp_list[ASN1_FLAG_EXP_MAX]; + int exp_count; +} tag_exp_arg; + +static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, + int *perr); +static int bitstr_cb(const char *elem, int len, void *bitstr); +static int asn1_cb(const char *elem, int len, void *bitstr); +static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, + int exp_constructed, int exp_pad, int imp_ok); +static int parse_tagging(const char *vstart, int vlen, int *ptag, + int *pclass); +static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf, + int depth, int *perr); +static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype); +static int asn1_str2tag(const char *tagstr, int len); + +ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf) +{ + X509V3_CTX cnf; + + if (!nconf) + return ASN1_generate_v3(str, NULL); + + X509V3_set_nconf(&cnf, nconf); + return ASN1_generate_v3(str, &cnf); +} + +ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf) +{ + int err = 0; + ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err); + if (err) + OPENSSL_PUT_ERROR(ASN1, err); + return ret; +} + +static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, + int *perr) +{ + ASN1_TYPE *ret; + tag_exp_arg asn1_tags; + tag_exp_type *etmp; + + int i, len; + + unsigned char *orig_der = NULL, *new_der = NULL; + const unsigned char *cpy_start; + unsigned char *p; + const unsigned char *cp; + int cpy_len; + long hdr_len = 0; + int hdr_constructed = 0, hdr_tag, hdr_class; + int r; + + asn1_tags.imp_tag = -1; + asn1_tags.imp_class = -1; + asn1_tags.format = ASN1_GEN_FORMAT_ASCII; + asn1_tags.exp_count = 0; + if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) { + *perr = ASN1_R_UNKNOWN_TAG; + return NULL; + } + + if ((asn1_tags.utype == V_ASN1_SEQUENCE) + || (asn1_tags.utype == V_ASN1_SET)) { + if (!cnf) { + *perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG; + return NULL; + } + if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) { + *perr = ASN1_R_ILLEGAL_NESTED_TAGGING; + return NULL; + } + ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr); + } else + ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype); + + if (!ret) + return NULL; + + /* If no tagging return base type */ + if ((asn1_tags.imp_tag == -1) && (asn1_tags.exp_count == 0)) + return ret; + + /* Generate the encoding */ + cpy_len = i2d_ASN1_TYPE(ret, &orig_der); + ASN1_TYPE_free(ret); + ret = NULL; + /* Set point to start copying for modified encoding */ + cpy_start = orig_der; + + /* Do we need IMPLICIT tagging? */ + if (asn1_tags.imp_tag != -1) { + /* If IMPLICIT we will replace the underlying tag */ + /* Skip existing tag+len */ + r = ASN1_get_object(&cpy_start, &hdr_len, &hdr_tag, &hdr_class, + cpy_len); + if (r & 0x80) + goto err; + /* Update copy length */ + cpy_len -= cpy_start - orig_der; + /* + * For IMPLICIT tagging the length should match the original length + * and constructed flag should be consistent. + */ + if (r & 0x1) { + /* Indefinite length constructed */ + hdr_constructed = 2; + hdr_len = 0; + } else + /* Just retain constructed flag */ + hdr_constructed = r & V_ASN1_CONSTRUCTED; + /* + * Work out new length with IMPLICIT tag: ignore constructed because + * it will mess up if indefinite length + */ + len = ASN1_object_size(0, hdr_len, asn1_tags.imp_tag); + } else + len = cpy_len; + + /* Work out length in any EXPLICIT, starting from end */ + + for (i = 0, etmp = asn1_tags.exp_list + asn1_tags.exp_count - 1; + i < asn1_tags.exp_count; i++, etmp--) { + /* Content length: number of content octets + any padding */ + len += etmp->exp_pad; + etmp->exp_len = len; + /* Total object length: length including new header */ + len = ASN1_object_size(0, len, etmp->exp_tag); + } + + /* Allocate buffer for new encoding */ + + new_der = OPENSSL_malloc(len); + if (!new_der) + goto err; + + /* Generate tagged encoding */ + + p = new_der; + + /* Output explicit tags first */ + + for (i = 0, etmp = asn1_tags.exp_list; i < asn1_tags.exp_count; + i++, etmp++) { + ASN1_put_object(&p, etmp->exp_constructed, etmp->exp_len, + etmp->exp_tag, etmp->exp_class); + if (etmp->exp_pad) + *p++ = 0; + } + + /* If IMPLICIT, output tag */ + + if (asn1_tags.imp_tag != -1) { + if (asn1_tags.imp_class == V_ASN1_UNIVERSAL + && (asn1_tags.imp_tag == V_ASN1_SEQUENCE + || asn1_tags.imp_tag == V_ASN1_SET)) + hdr_constructed = V_ASN1_CONSTRUCTED; + ASN1_put_object(&p, hdr_constructed, hdr_len, + asn1_tags.imp_tag, asn1_tags.imp_class); + } + + /* Copy across original encoding */ + OPENSSL_memcpy(p, cpy_start, cpy_len); + + cp = new_der; + + /* Obtain new ASN1_TYPE structure */ + ret = d2i_ASN1_TYPE(NULL, &cp, len); + + err: + if (orig_der) + OPENSSL_free(orig_der); + if (new_der) + OPENSSL_free(new_der); + + return ret; + +} + +static int asn1_cb(const char *elem, int len, void *bitstr) +{ + tag_exp_arg *arg = bitstr; + int i; + int utype; + int vlen = 0; + const char *p, *vstart = NULL; + + int tmp_tag, tmp_class; + + if (elem == NULL) + return -1; + + for (i = 0, p = elem; i < len; p++, i++) { + /* Look for the ':' in name value pairs */ + if (*p == ':') { + vstart = p + 1; + vlen = len - (vstart - elem); + len = p - elem; + break; + } + } + + utype = asn1_str2tag(elem, len); + + if (utype == -1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_TAG); + ERR_add_error_data(2, "tag=", elem); + return -1; + } + + /* If this is not a modifier mark end of string and exit */ + if (!(utype & ASN1_GEN_FLAG)) { + arg->utype = utype; + arg->str = vstart; + /* If no value and not end of string, error */ + if (!vstart && elem[len]) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_MISSING_VALUE); + return -1; + } + return 0; + } + + switch (utype) { + + case ASN1_GEN_FLAG_IMP: + /* Check for illegal multiple IMPLICIT tagging */ + if (arg->imp_tag != -1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING); + return -1; + } + if (!parse_tagging(vstart, vlen, &arg->imp_tag, &arg->imp_class)) + return -1; + break; + + case ASN1_GEN_FLAG_EXP: + + if (!parse_tagging(vstart, vlen, &tmp_tag, &tmp_class)) + return -1; + if (!append_exp(arg, tmp_tag, tmp_class, 1, 0, 0)) + return -1; + break; + + case ASN1_GEN_FLAG_SEQWRAP: + if (!append_exp(arg, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, 1, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_SETWRAP: + if (!append_exp(arg, V_ASN1_SET, V_ASN1_UNIVERSAL, 1, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_BITWRAP: + if (!append_exp(arg, V_ASN1_BIT_STRING, V_ASN1_UNIVERSAL, 0, 1, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_OCTWRAP: + if (!append_exp(arg, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL, 0, 0, 1)) + return -1; + break; + + case ASN1_GEN_FLAG_FORMAT: + if (!vstart) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + if (!strncmp(vstart, "ASCII", 5)) + arg->format = ASN1_GEN_FORMAT_ASCII; + else if (!strncmp(vstart, "UTF8", 4)) + arg->format = ASN1_GEN_FORMAT_UTF8; + else if (!strncmp(vstart, "HEX", 3)) + arg->format = ASN1_GEN_FORMAT_HEX; + else if (!strncmp(vstart, "BITLIST", 7)) + arg->format = ASN1_GEN_FORMAT_BITLIST; + else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + break; + + } + + return 1; + +} + +static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass) +{ + char erch[2]; + long tag_num; + char *eptr; + if (!vstart) + return 0; + tag_num = strtoul(vstart, &eptr, 10); + /* Check we haven't gone past max length: should be impossible */ + if (eptr && *eptr && (eptr > vstart + vlen)) + return 0; + if (tag_num < 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_NUMBER); + return 0; + } + *ptag = tag_num; + /* If we have non numeric characters, parse them */ + if (eptr) + vlen -= eptr - vstart; + else + vlen = 0; + if (vlen) { + switch (*eptr) { + + case 'U': + *pclass = V_ASN1_UNIVERSAL; + break; + + case 'A': + *pclass = V_ASN1_APPLICATION; + break; + + case 'P': + *pclass = V_ASN1_PRIVATE; + break; + + case 'C': + *pclass = V_ASN1_CONTEXT_SPECIFIC; + break; + + default: + erch[0] = *eptr; + erch[1] = 0; + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_MODIFIER); + ERR_add_error_data(2, "Char=", erch); + return 0; + break; + + } + } else + *pclass = V_ASN1_CONTEXT_SPECIFIC; + + return 1; + +} + +/* Handle multiple types: SET and SEQUENCE */ + +static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf, + int depth, int *perr) +{ + ASN1_TYPE *ret = NULL; + STACK_OF(ASN1_TYPE) *sk = NULL; + STACK_OF(CONF_VALUE) *sect = NULL; + unsigned char *der = NULL; + int derlen; + size_t i; + sk = sk_ASN1_TYPE_new_null(); + if (!sk) + goto bad; + if (section) { + if (!cnf) + goto bad; + sect = X509V3_get_section(cnf, (char *)section); + if (!sect) + goto bad; + for (i = 0; i < sk_CONF_VALUE_num(sect); i++) { + ASN1_TYPE *typ = + generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf, + depth + 1, perr); + if (!typ) + goto bad; + if (!sk_ASN1_TYPE_push(sk, typ)) + goto bad; + } + } + + /* + * Now we has a STACK of the components, convert to the correct form + */ + + if (utype == V_ASN1_SET) + derlen = i2d_ASN1_SET_ANY(sk, &der); + else + derlen = i2d_ASN1_SEQUENCE_ANY(sk, &der); + + if (derlen < 0) + goto bad; + + if (!(ret = ASN1_TYPE_new())) + goto bad; + + if (!(ret->value.asn1_string = ASN1_STRING_type_new(utype))) + goto bad; + + ret->type = utype; + + ret->value.asn1_string->data = der; + ret->value.asn1_string->length = derlen; + + der = NULL; + + bad: + + if (der) + OPENSSL_free(der); + + if (sk) + sk_ASN1_TYPE_pop_free(sk, ASN1_TYPE_free); + if (sect) + X509V3_section_free(cnf, sect); + + return ret; +} + +static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, + int exp_constructed, int exp_pad, int imp_ok) +{ + tag_exp_type *exp_tmp; + /* Can only have IMPLICIT if permitted */ + if ((arg->imp_tag != -1) && !imp_ok) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG); + return 0; + } + + if (arg->exp_count == ASN1_FLAG_EXP_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DEPTH_EXCEEDED); + return 0; + } + + exp_tmp = &arg->exp_list[arg->exp_count++]; + + /* + * If IMPLICIT set tag to implicit value then reset implicit tag since it + * has been used. + */ + if (arg->imp_tag != -1) { + exp_tmp->exp_tag = arg->imp_tag; + exp_tmp->exp_class = arg->imp_class; + arg->imp_tag = -1; + arg->imp_class = -1; + } else { + exp_tmp->exp_tag = exp_tag; + exp_tmp->exp_class = exp_class; + } + exp_tmp->exp_constructed = exp_constructed; + exp_tmp->exp_pad = exp_pad; + + return 1; +} + +static int asn1_str2tag(const char *tagstr, int len) +{ + unsigned int i; + static const struct tag_name_st *tntmp, tnst[] = { + ASN1_GEN_STR("BOOL", V_ASN1_BOOLEAN), + ASN1_GEN_STR("BOOLEAN", V_ASN1_BOOLEAN), + ASN1_GEN_STR("NULL", V_ASN1_NULL), + ASN1_GEN_STR("INT", V_ASN1_INTEGER), + ASN1_GEN_STR("INTEGER", V_ASN1_INTEGER), + ASN1_GEN_STR("ENUM", V_ASN1_ENUMERATED), + ASN1_GEN_STR("ENUMERATED", V_ASN1_ENUMERATED), + ASN1_GEN_STR("OID", V_ASN1_OBJECT), + ASN1_GEN_STR("OBJECT", V_ASN1_OBJECT), + ASN1_GEN_STR("UTCTIME", V_ASN1_UTCTIME), + ASN1_GEN_STR("UTC", V_ASN1_UTCTIME), + ASN1_GEN_STR("GENERALIZEDTIME", V_ASN1_GENERALIZEDTIME), + ASN1_GEN_STR("GENTIME", V_ASN1_GENERALIZEDTIME), + ASN1_GEN_STR("OCT", V_ASN1_OCTET_STRING), + ASN1_GEN_STR("OCTETSTRING", V_ASN1_OCTET_STRING), + ASN1_GEN_STR("BITSTR", V_ASN1_BIT_STRING), + ASN1_GEN_STR("BITSTRING", V_ASN1_BIT_STRING), + ASN1_GEN_STR("UNIVERSALSTRING", V_ASN1_UNIVERSALSTRING), + ASN1_GEN_STR("UNIV", V_ASN1_UNIVERSALSTRING), + ASN1_GEN_STR("IA5", V_ASN1_IA5STRING), + ASN1_GEN_STR("IA5STRING", V_ASN1_IA5STRING), + ASN1_GEN_STR("UTF8", V_ASN1_UTF8STRING), + ASN1_GEN_STR("UTF8String", V_ASN1_UTF8STRING), + ASN1_GEN_STR("BMP", V_ASN1_BMPSTRING), + ASN1_GEN_STR("BMPSTRING", V_ASN1_BMPSTRING), + ASN1_GEN_STR("VISIBLESTRING", V_ASN1_VISIBLESTRING), + ASN1_GEN_STR("VISIBLE", V_ASN1_VISIBLESTRING), + ASN1_GEN_STR("PRINTABLESTRING", V_ASN1_PRINTABLESTRING), + ASN1_GEN_STR("PRINTABLE", V_ASN1_PRINTABLESTRING), + ASN1_GEN_STR("T61", V_ASN1_T61STRING), + ASN1_GEN_STR("T61STRING", V_ASN1_T61STRING), + ASN1_GEN_STR("TELETEXSTRING", V_ASN1_T61STRING), + ASN1_GEN_STR("GeneralString", V_ASN1_GENERALSTRING), + ASN1_GEN_STR("GENSTR", V_ASN1_GENERALSTRING), + ASN1_GEN_STR("NUMERIC", V_ASN1_NUMERICSTRING), + ASN1_GEN_STR("NUMERICSTRING", V_ASN1_NUMERICSTRING), + + /* Special cases */ + ASN1_GEN_STR("SEQUENCE", V_ASN1_SEQUENCE), + ASN1_GEN_STR("SEQ", V_ASN1_SEQUENCE), + ASN1_GEN_STR("SET", V_ASN1_SET), + /* type modifiers */ + /* Explicit tag */ + ASN1_GEN_STR("EXP", ASN1_GEN_FLAG_EXP), + ASN1_GEN_STR("EXPLICIT", ASN1_GEN_FLAG_EXP), + /* Implicit tag */ + ASN1_GEN_STR("IMP", ASN1_GEN_FLAG_IMP), + ASN1_GEN_STR("IMPLICIT", ASN1_GEN_FLAG_IMP), + /* OCTET STRING wrapper */ + ASN1_GEN_STR("OCTWRAP", ASN1_GEN_FLAG_OCTWRAP), + /* SEQUENCE wrapper */ + ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP), + /* SET wrapper */ + ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SETWRAP), + /* BIT STRING wrapper */ + ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP), + ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT), + ASN1_GEN_STR("FORMAT", ASN1_GEN_FLAG_FORMAT), + }; + + if (len == -1) + len = strlen(tagstr); + + tntmp = tnst; + for (i = 0; i < sizeof(tnst) / sizeof(struct tag_name_st); i++, tntmp++) { + if ((len == tntmp->len) && !strncmp(tntmp->strnam, tagstr, len)) + return tntmp->tag; + } + + return -1; +} + +static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) +{ + ASN1_TYPE *atmp = NULL; + + CONF_VALUE vtmp; + + unsigned char *rdata; + long rdlen; + + int no_unused = 1; + + if (!(atmp = ASN1_TYPE_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (!str) + str = ""; + + switch (utype) { + + case V_ASN1_NULL: + if (str && *str) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_NULL_VALUE); + goto bad_form; + } + break; + + case V_ASN1_BOOLEAN: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ASCII_FORMAT); + goto bad_form; + } + vtmp.name = NULL; + vtmp.section = NULL; + vtmp.value = (char *)str; + if (!X509V3_get_value_bool(&vtmp, &atmp->value.boolean)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_BOOLEAN); + goto bad_str; + } + break; + + case V_ASN1_INTEGER: + case V_ASN1_ENUMERATED: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.integer = s2i_ASN1_INTEGER(NULL, (char *)str))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_INTEGER); + goto bad_str; + } + break; + + case V_ASN1_OBJECT: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.object = OBJ_txt2obj(str, 0))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_OBJECT); + goto bad_str; + } + break; + + case V_ASN1_UTCTIME: + case V_ASN1_GENERALIZEDTIME: + if (format != ASN1_GEN_FORMAT_ASCII) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT); + goto bad_form; + } + if (!(atmp->value.asn1_string = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + if (!ASN1_STRING_set(atmp->value.asn1_string, str, -1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + atmp->value.asn1_string->type = utype; + if (!ASN1_TIME_check(atmp->value.asn1_string)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_TIME_VALUE); + goto bad_str; + } + + break; + + case V_ASN1_BMPSTRING: + case V_ASN1_PRINTABLESTRING: + case V_ASN1_IA5STRING: + case V_ASN1_T61STRING: + case V_ASN1_UTF8STRING: + case V_ASN1_VISIBLESTRING: + case V_ASN1_UNIVERSALSTRING: + case V_ASN1_GENERALSTRING: + case V_ASN1_NUMERICSTRING: + + if (format == ASN1_GEN_FORMAT_ASCII) + format = MBSTRING_ASC; + else if (format == ASN1_GEN_FORMAT_UTF8) + format = MBSTRING_UTF8; + else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_FORMAT); + goto bad_form; + } + + if (ASN1_mbstring_copy(&atmp->value.asn1_string, (unsigned char *)str, + -1, format, ASN1_tag2bit(utype)) <= 0) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_str; + } + + break; + + case V_ASN1_BIT_STRING: + + case V_ASN1_OCTET_STRING: + + if (!(atmp->value.asn1_string = ASN1_STRING_new())) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto bad_form; + } + + if (format == ASN1_GEN_FORMAT_HEX) { + + if (!(rdata = x509v3_hex_to_bytes((char *)str, &rdlen))) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_HEX); + goto bad_str; + } + + atmp->value.asn1_string->data = rdata; + atmp->value.asn1_string->length = rdlen; + atmp->value.asn1_string->type = utype; + + } else if (format == ASN1_GEN_FORMAT_ASCII) + ASN1_STRING_set(atmp->value.asn1_string, str, -1); + else if ((format == ASN1_GEN_FORMAT_BITLIST) + && (utype == V_ASN1_BIT_STRING)) { + if (!CONF_parse_list + (str, ',', 1, bitstr_cb, atmp->value.bit_string)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_LIST_ERROR); + goto bad_str; + } + no_unused = 0; + + } else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT); + goto bad_form; + } + + if ((utype == V_ASN1_BIT_STRING) && no_unused) { + atmp->value.asn1_string->flags + &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + atmp->value.asn1_string->flags |= ASN1_STRING_FLAG_BITS_LEFT; + } + + break; + + default: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_TYPE); + goto bad_str; + break; + } + + atmp->type = utype; + return atmp; + + bad_str: + ERR_add_error_data(2, "string=", str); + bad_form: + + ASN1_TYPE_free(atmp); + return NULL; + +} + +static int bitstr_cb(const char *elem, int len, void *bitstr) +{ + long bitnum; + char *eptr; + if (!elem) + return 0; + bitnum = strtoul(elem, &eptr, 10); + if (eptr && *eptr && (eptr != elem + len)) + return 0; + if (bitnum < 0) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_NUMBER); + return 0; + } + if (!ASN1_BIT_STRING_set_bit(bitstr, bitnum, 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c new file mode 100644 index 0000000..d2c0437 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c @@ -0,0 +1,458 @@ +/* crypto/x509/by_dir.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 + +#if !defined(OPENSSL_TRUSTY) + +#include "../internal.h" + +typedef struct lookup_dir_hashes_st { + unsigned long hash; + int suffix; +} BY_DIR_HASH; + +typedef struct lookup_dir_entry_st { + char *dir; + int dir_type; + STACK_OF(BY_DIR_HASH) *hashes; +} BY_DIR_ENTRY; + +typedef struct lookup_dir_st { + BUF_MEM *buffer; + STACK_OF(BY_DIR_ENTRY) *dirs; +} BY_DIR; + +DEFINE_STACK_OF(BY_DIR_HASH) +DEFINE_STACK_OF(BY_DIR_ENTRY) + +static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, + char **ret); +static int new_dir(X509_LOOKUP *lu); +static void free_dir(X509_LOOKUP *lu); +static int add_cert_dir(BY_DIR *ctx, const char *dir, int type); +static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, + X509_OBJECT *ret); +static X509_LOOKUP_METHOD x509_dir_lookup = { + "Load certs from files in a directory", + new_dir, /* new */ + free_dir, /* free */ + NULL, /* init */ + NULL, /* shutdown */ + dir_ctrl, /* ctrl */ + get_cert_by_subject, /* get_by_subject */ + NULL, /* get_by_issuer_serial */ + NULL, /* get_by_fingerprint */ + NULL, /* get_by_alias */ +}; + +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void) +{ + return (&x509_dir_lookup); +} + +static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, + char **retp) +{ + int ret = 0; + BY_DIR *ld; + char *dir = NULL; + + ld = (BY_DIR *)ctx->method_data; + + switch (cmd) { + case X509_L_ADD_DIR: + if (argl == X509_FILETYPE_DEFAULT) { + dir = (char *)getenv(X509_get_default_cert_dir_env()); + if (dir) + ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM); + else + ret = add_cert_dir(ld, X509_get_default_cert_dir(), + X509_FILETYPE_PEM); + if (!ret) { + OPENSSL_PUT_ERROR(X509, X509_R_LOADING_CERT_DIR); + } + } else + ret = add_cert_dir(ld, argp, (int)argl); + break; + } + return (ret); +} + +static int new_dir(X509_LOOKUP *lu) +{ + BY_DIR *a; + + if ((a = (BY_DIR *)OPENSSL_malloc(sizeof(BY_DIR))) == NULL) + return (0); + if ((a->buffer = BUF_MEM_new()) == NULL) { + OPENSSL_free(a); + return (0); + } + a->dirs = NULL; + lu->method_data = (char *)a; + return (1); +} + +static void by_dir_hash_free(BY_DIR_HASH *hash) +{ + OPENSSL_free(hash); +} + +static int by_dir_hash_cmp(const BY_DIR_HASH **a, const BY_DIR_HASH **b) +{ + if ((*a)->hash > (*b)->hash) + return 1; + if ((*a)->hash < (*b)->hash) + return -1; + return 0; +} + +static void by_dir_entry_free(BY_DIR_ENTRY *ent) +{ + if (ent->dir) + OPENSSL_free(ent->dir); + if (ent->hashes) + sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); + OPENSSL_free(ent); +} + +static void free_dir(X509_LOOKUP *lu) +{ + BY_DIR *a; + + a = (BY_DIR *)lu->method_data; + if (a->dirs != NULL) + sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free); + if (a->buffer != NULL) + BUF_MEM_free(a->buffer); + OPENSSL_free(a); +} + +static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) +{ + size_t j, len; + const char *s, *ss, *p; + + if (dir == NULL || !*dir) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_DIRECTORY); + return 0; + } + + s = dir; + p = s; + do { + if ((*p == ':') || (*p == '\0')) { + BY_DIR_ENTRY *ent; + ss = s; + s = p + 1; + len = p - ss; + if (len == 0) + continue; + for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { + ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); + if (strlen(ent->dir) == len && + strncmp(ent->dir, ss, len) == 0) + break; + } + if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) + continue; + if (ctx->dirs == NULL) { + ctx->dirs = sk_BY_DIR_ENTRY_new_null(); + if (!ctx->dirs) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + } + ent = OPENSSL_malloc(sizeof(BY_DIR_ENTRY)); + if (!ent) + return 0; + ent->dir_type = type; + ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); + ent->dir = OPENSSL_malloc(len + 1); + if (!ent->dir || !ent->hashes) { + by_dir_entry_free(ent); + return 0; + } + OPENSSL_strlcpy(ent->dir, ss, len + 1); + if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { + by_dir_entry_free(ent); + return 0; + } + } + } while (*p++ != '\0'); + return 1; +} + +/* + * g_ent_hashes_lock protects the |hashes| member of all |BY_DIR_ENTRY| + * objects. + */ +static struct CRYPTO_STATIC_MUTEX g_ent_hashes_lock = + CRYPTO_STATIC_MUTEX_INIT; + +static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + BY_DIR *ctx; + union { + struct { + X509 st_x509; + X509_CINF st_x509_cinf; + } x509; + struct { + X509_CRL st_crl; + X509_CRL_INFO st_crl_info; + } crl; + } data; + int ok = 0; + size_t i; + int j, k; + unsigned long h; + unsigned long hash_array[2]; + int hash_index; + BUF_MEM *b = NULL; + X509_OBJECT stmp, *tmp; + const char *postfix = ""; + + if (name == NULL) + return (0); + + stmp.type = type; + if (type == X509_LU_X509) { + data.x509.st_x509.cert_info = &data.x509.st_x509_cinf; + data.x509.st_x509_cinf.subject = name; + stmp.data.x509 = &data.x509.st_x509; + postfix = ""; + } else if (type == X509_LU_CRL) { + data.crl.st_crl.crl = &data.crl.st_crl_info; + data.crl.st_crl_info.issuer = name; + stmp.data.crl = &data.crl.st_crl; + postfix = "r"; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_WRONG_LOOKUP_TYPE); + goto finish; + } + + if ((b = BUF_MEM_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + goto finish; + } + + ctx = (BY_DIR *)xl->method_data; + + hash_array[0] = X509_NAME_hash(name); + hash_array[1] = X509_NAME_hash_old(name); + for (hash_index = 0; hash_index < 2; ++hash_index) { + h = hash_array[hash_index]; + for (i = 0; i < sk_BY_DIR_ENTRY_num(ctx->dirs); i++) { + BY_DIR_ENTRY *ent; + size_t idx; + BY_DIR_HASH htmp, *hent; + ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i); + j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1; + if (!BUF_MEM_grow(b, j)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto finish; + } + if (type == X509_LU_CRL && ent->hashes) { + htmp.hash = h; + CRYPTO_STATIC_MUTEX_lock_read(&g_ent_hashes_lock); + if (sk_BY_DIR_HASH_find(ent->hashes, &idx, &htmp)) { + hent = sk_BY_DIR_HASH_value(ent->hashes, idx); + k = hent->suffix; + } else { + hent = NULL; + k = 0; + } + CRYPTO_STATIC_MUTEX_unlock_read(&g_ent_hashes_lock); + } else { + k = 0; + hent = NULL; + } + for (;;) { + char c = '/'; +#ifdef OPENSSL_SYS_VMS + c = ent->dir[strlen(ent->dir) - 1]; + if (c != ':' && c != '>' && c != ']') { + /* + * If no separator is present, we assume the directory + * specifier is a logical name, and add a colon. We + * really should use better VMS routines for merging + * things like this, but this will do for now... -- + * Richard Levitte + */ + c = ':'; + } else { + c = '\0'; + } +#endif + if (c == '\0') { + /* + * This is special. When c == '\0', no directory + * separator should be added. + */ + BIO_snprintf(b->data, b->max, + "%s%08lx.%s%d", ent->dir, h, postfix, k); + } else { + BIO_snprintf(b->data, b->max, + "%s%c%08lx.%s%d", ent->dir, c, h, + postfix, k); + } +#ifndef OPENSSL_NO_POSIX_IO +# if defined(_WIN32) && !defined(stat) +# define stat _stat +# endif + { + struct stat st; + if (stat(b->data, &st) < 0) + break; + } +#endif + /* found one. */ + if (type == X509_LU_X509) { + if ((X509_load_cert_file(xl, b->data, + ent->dir_type)) == 0) + break; + } else if (type == X509_LU_CRL) { + if ((X509_load_crl_file(xl, b->data, ent->dir_type)) == 0) + break; + } + /* else case will caught higher up */ + k++; + } + + /* + * we have added it to the cache so now pull it out again + */ + 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); + } + CRYPTO_MUTEX_unlock_write(&xl->store_ctx->objs_lock); + + /* + * If a CRL, update the last file suffix added for this + */ + + if (type == X509_LU_CRL) { + CRYPTO_STATIC_MUTEX_lock_write(&g_ent_hashes_lock); + /* + * Look for entry again in case another thread added an entry + * first. + */ + 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); + } + if (!hent) { + hent = OPENSSL_malloc(sizeof(BY_DIR_HASH)); + if (hent == NULL) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + ok = 0; + goto finish; + } + hent->hash = h; + hent->suffix = k; + if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + OPENSSL_free(hent); + ok = 0; + goto finish; + } + sk_BY_DIR_HASH_sort(ent->hashes); + } else if (hent->suffix < k) + hent->suffix = k; + + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + } + + if (tmp != NULL) { + ok = 1; + ret->type = tmp->type; + OPENSSL_memcpy(&ret->data, &tmp->data, sizeof(ret->data)); + /* + * If we were going to up the reference count, we would need + * to do it on a perl 'type' basis + */ + /* + * CRYPTO_add(&tmp->data.x509->references,1, + * CRYPTO_LOCK_X509); + */ + goto finish; + } + } + } + finish: + if (b != NULL) + BUF_MEM_free(b); + return (ok); +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back new file mode 100644 index 0000000..7b91cbd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back @@ -0,0 +1,458 @@ +/* crypto/x509/by_dir.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 + +#if !defined(OPENSSL_TRUSTY) + +#include "../internal.h" + +typedef struct lookup_dir_hashes_st { + unsigned long hash; + int suffix; +} BY_DIR_HASH; + +typedef struct lookup_dir_entry_st { + char *dir; + int dir_type; + STACK_OF(BY_DIR_HASH) *hashes; +} BY_DIR_ENTRY; + +typedef struct lookup_dir_st { + BUF_MEM *buffer; + STACK_OF(BY_DIR_ENTRY) *dirs; +} BY_DIR; + +DEFINE_STACK_OF(BY_DIR_HASH) +DEFINE_STACK_OF(BY_DIR_ENTRY) + +static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, + char **ret); +static int new_dir(X509_LOOKUP *lu); +static void free_dir(X509_LOOKUP *lu); +static int add_cert_dir(BY_DIR *ctx, const char *dir, int type); +static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, + X509_OBJECT *ret); +static X509_LOOKUP_METHOD x509_dir_lookup = { + "Load certs from files in a directory", + new_dir, /* new */ + free_dir, /* free */ + NULL, /* init */ + NULL, /* shutdown */ + dir_ctrl, /* ctrl */ + get_cert_by_subject, /* get_by_subject */ + NULL, /* get_by_issuer_serial */ + NULL, /* get_by_fingerprint */ + NULL, /* get_by_alias */ +}; + +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void) +{ + return (&x509_dir_lookup); +} + +static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, + char **retp) +{ + int ret = 0; + BY_DIR *ld; + char *dir = NULL; + + ld = (BY_DIR *)ctx->method_data; + + switch (cmd) { + case X509_L_ADD_DIR: + if (argl == X509_FILETYPE_DEFAULT) { + dir = (char *)getenv(X509_get_default_cert_dir_env()); + if (dir) + ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM); + else + ret = add_cert_dir(ld, X509_get_default_cert_dir(), + X509_FILETYPE_PEM); + if (!ret) { + OPENSSL_PUT_ERROR(X509, X509_R_LOADING_CERT_DIR); + } + } else + ret = add_cert_dir(ld, argp, (int)argl); + break; + } + return (ret); +} + +static int new_dir(X509_LOOKUP *lu) +{ + BY_DIR *a; + + if ((a = (BY_DIR *)OPENSSL_malloc(sizeof(BY_DIR))) == NULL) + return (0); + if ((a->buffer = BUF_MEM_new()) == NULL) { + OPENSSL_free(a); + return (0); + } + a->dirs = NULL; + lu->method_data = (char *)a; + return (1); +} + +static void by_dir_hash_free(BY_DIR_HASH *hash) +{ + OPENSSL_free(hash); +} + +static int by_dir_hash_cmp(const BY_DIR_HASH **a, const BY_DIR_HASH **b) +{ + if ((*a)->hash > (*b)->hash) + return 1; + if ((*a)->hash < (*b)->hash) + return -1; + return 0; +} + +static void by_dir_entry_free(BY_DIR_ENTRY *ent) +{ + if (ent->dir) + OPENSSL_free(ent->dir); + if (ent->hashes) + sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); + OPENSSL_free(ent); +} + +static void free_dir(X509_LOOKUP *lu) +{ + BY_DIR *a; + + a = (BY_DIR *)lu->method_data; + if (a->dirs != NULL) + sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free); + if (a->buffer != NULL) + BUF_MEM_free(a->buffer); + OPENSSL_free(a); +} + +static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) +{ + size_t j, len; + const char *s, *ss, *p; + + if (dir == NULL || !*dir) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_DIRECTORY); + return 0; + } + + s = dir; + p = s; + do { + if ((*p == ':') || (*p == '\0')) { + BY_DIR_ENTRY *ent; + ss = s; + s = p + 1; + len = p - ss; + if (len == 0) + continue; + for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { + ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); + if (strlen(ent->dir) == len && + strncmp(ent->dir, ss, len) == 0) + break; + } + if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) + continue; + if (ctx->dirs == NULL) { + ctx->dirs = sk_BY_DIR_ENTRY_new_null(); + if (!ctx->dirs) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + } + ent = OPENSSL_malloc(sizeof(BY_DIR_ENTRY)); + if (!ent) + return 0; + ent->dir_type = type; + ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); + ent->dir = OPENSSL_malloc(len + 1); + if (!ent->dir || !ent->hashes) { + by_dir_entry_free(ent); + return 0; + } + OPENSSL_strlcpy(ent->dir, ss, len + 1); + if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { + by_dir_entry_free(ent); + return 0; + } + } + } while (*p++ != '\0'); + return 1; +} + +/* + * g_ent_hashes_lock protects the |hashes| member of all |BY_DIR_ENTRY| + * objects. + */ +static struct CRYPTO_STATIC_MUTEX g_ent_hashes_lock = + CRYPTO_STATIC_MUTEX_INIT; + +static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + BY_DIR *ctx; + union { + struct { + X509 st_x509; + X509_CINF st_x509_cinf; + } x509; + struct { + X509_CRL st_crl; + X509_CRL_INFO st_crl_info; + } crl; + } data; + int ok = 0; + size_t i; + int j, k; + unsigned long h; + unsigned long hash_array[2]; + int hash_index; + BUF_MEM *b = NULL; + X509_OBJECT stmp, *tmp; + const char *postfix = ""; + + if (name == NULL) + return (0); + + stmp.type = type; + if (type == X509_LU_X509) { + data.x509.st_x509.cert_info = &data.x509.st_x509_cinf; + data.x509.st_x509_cinf.subject = name; + stmp.data.x509 = &data.x509.st_x509; + postfix = ""; + } else if (type == X509_LU_CRL) { + data.crl.st_crl.crl = &data.crl.st_crl_info; + data.crl.st_crl_info.issuer = name; + stmp.data.crl = &data.crl.st_crl; + postfix = "r"; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_WRONG_LOOKUP_TYPE); + goto finish; + } + + if ((b = BUF_MEM_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + goto finish; + } + + ctx = (BY_DIR *)xl->method_data; + + hash_array[0] = X509_NAME_hash(name); + hash_array[1] = X509_NAME_hash_old(name); + for (hash_index = 0; hash_index < 2; ++hash_index) { + h = hash_array[hash_index]; + for (i = 0; i < sk_BY_DIR_ENTRY_num(ctx->dirs); i++) { + BY_DIR_ENTRY *ent; + size_t idx; + BY_DIR_HASH htmp, *hent; + ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i); + j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1; + if (!BUF_MEM_grow(b, j)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto finish; + } + if (type == X509_LU_CRL && ent->hashes) { + htmp.hash = h; + CRYPTO_STATIC_MUTEX_lock_read(&g_ent_hashes_lock); + if (sk_BY_DIR_HASH_find(ent->hashes, &idx, &htmp)) { + hent = sk_BY_DIR_HASH_value(ent->hashes, idx); + k = hent->suffix; + } else { + hent = NULL; + k = 0; + } + CRYPTO_STATIC_MUTEX_unlock_read(&g_ent_hashes_lock); + } else { + k = 0; + hent = NULL; + } + for (;;) { + char c = '/'; +#ifdef OPENSSL_SYS_VMS + c = ent->dir[strlen(ent->dir) - 1]; + if (c != ':' && c != '>' && c != ']') { + /* + * If no separator is present, we assume the directory + * specifier is a logical name, and add a colon. We + * really should use better VMS routines for merging + * things like this, but this will do for now... -- + * Richard Levitte + */ + c = ':'; + } else { + c = '\0'; + } +#endif + if (c == '\0') { + /* + * This is special. When c == '\0', no directory + * separator should be added. + */ + BIO_snprintf(b->data, b->max, + "%s%08lx.%s%d", ent->dir, h, postfix, k); + } else { + BIO_snprintf(b->data, b->max, + "%s%c%08lx.%s%d", ent->dir, c, h, + postfix, k); + } +#ifndef OPENSSL_NO_POSIX_IO +# if defined(_WIN32) && !defined(stat) +# define stat _stat +# endif + { + struct stat st; + if (stat(b->data, &st) < 0) + break; + } +#endif + /* found one. */ + if (type == X509_LU_X509) { + if ((X509_load_cert_file(xl, b->data, + ent->dir_type)) == 0) + break; + } else if (type == X509_LU_CRL) { + if ((X509_load_crl_file(xl, b->data, ent->dir_type)) == 0) + break; + } + /* else case will caught higher up */ + k++; + } + + /* + * we have added it to the cache so now pull it out again + */ + 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); + } + CRYPTO_MUTEX_unlock_write(&xl->store_ctx->objs_lock); + + /* + * If a CRL, update the last file suffix added for this + */ + + if (type == X509_LU_CRL) { + CRYPTO_STATIC_MUTEX_lock_write(&g_ent_hashes_lock); + /* + * Look for entry again in case another thread added an entry + * first. + */ + 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); + } + if (!hent) { + hent = OPENSSL_malloc(sizeof(BY_DIR_HASH)); + if (hent == NULL) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + ok = 0; + goto finish; + } + hent->hash = h; + hent->suffix = k; + if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + OPENSSL_free(hent); + ok = 0; + goto finish; + } + sk_BY_DIR_HASH_sort(ent->hashes); + } else if (hent->suffix < k) + hent->suffix = k; + + CRYPTO_STATIC_MUTEX_unlock_write(&g_ent_hashes_lock); + } + + if (tmp != NULL) { + ok = 1; + ret->type = tmp->type; + OPENSSL_memcpy(&ret->data, &tmp->data, sizeof(ret->data)); + /* + * If we were going to up the reference count, we would need + * to do it on a perl 'type' basis + */ + /* + * CRYPTO_add(&tmp->data.x509->references,1, + * CRYPTO_LOCK_X509); + */ + goto finish; + } + } + } + finish: + if (b != NULL) + BUF_MEM_free(b); + return (ok); +} + +#endif // OPENSSL_TRUSTY diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c new file mode 100644 index 0000000..dd61302 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c @@ -0,0 +1,275 @@ +/* crypto/x509/by_file.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 + +#ifndef OPENSSL_NO_STDIO + +static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +static X509_LOOKUP_METHOD x509_file_lookup = { + "Load file into cache", + NULL, /* new */ + NULL, /* free */ + NULL, /* init */ + NULL, /* shutdown */ + by_file_ctrl, /* ctrl */ + NULL, /* get_by_subject */ + NULL, /* get_by_issuer_serial */ + NULL, /* get_by_fingerprint */ + NULL, /* get_by_alias */ +}; + +X509_LOOKUP_METHOD *X509_LOOKUP_file(void) +{ + return (&x509_file_lookup); +} + +static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, + long argl, char **ret) +{ + int ok = 0; + const char *file; + + switch (cmd) { + case X509_L_FILE_LOAD: + if (argl == X509_FILETYPE_DEFAULT) { + file = getenv(X509_get_default_cert_file_env()); + if (file) + ok = (X509_load_cert_crl_file(ctx, file, + X509_FILETYPE_PEM) != 0); + + else + ok = (X509_load_cert_crl_file + (ctx, X509_get_default_cert_file(), + X509_FILETYPE_PEM) != 0); + + if (!ok) { + OPENSSL_PUT_ERROR(X509, X509_R_LOADING_DEFAULTS); + } + } else { + if (argl == X509_FILETYPE_PEM) + ok = (X509_load_cert_crl_file(ctx, argp, + X509_FILETYPE_PEM) != 0); + else + ok = (X509_load_cert_file(ctx, argp, (int)argl) != 0); + } + break; + } + return (ok); +} + +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) +{ + int ret = 0; + BIO *in = NULL; + int i, count = 0; + X509 *x = NULL; + + if (file == NULL) + return (1); + in = BIO_new(BIO_s_file()); + + if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + goto err; + } + + if (type == X509_FILETYPE_PEM) { + for (;;) { + x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL); + if (x == NULL) { + 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; + } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; + } + i = X509_STORE_add_cert(ctx->store_ctx, x); + if (!i) + goto err; + count++; + X509_free(x); + x = NULL; + } + ret = count; + } else if (type == X509_FILETYPE_ASN1) { + x = d2i_X509_bio(in, NULL); + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + goto err; + } + i = X509_STORE_add_cert(ctx->store_ctx, x); + if (!i) + goto err; + ret = i; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_BAD_X509_FILETYPE); + goto err; + } + err: + if (x != NULL) + X509_free(x); + if (in != NULL) + BIO_free(in); + return (ret); +} + +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) +{ + int ret = 0; + BIO *in = NULL; + int i, count = 0; + X509_CRL *x = NULL; + + if (file == NULL) + return (1); + in = BIO_new(BIO_s_file()); + + if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + goto err; + } + + if (type == X509_FILETYPE_PEM) { + for (;;) { + x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); + if (x == NULL) { + 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; + } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; + } + i = X509_STORE_add_crl(ctx->store_ctx, x); + if (!i) + goto err; + count++; + X509_CRL_free(x); + x = NULL; + } + ret = count; + } else if (type == X509_FILETYPE_ASN1) { + x = d2i_X509_CRL_bio(in, NULL); + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + goto err; + } + i = X509_STORE_add_crl(ctx->store_ctx, x); + if (!i) + goto err; + ret = i; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_BAD_X509_FILETYPE); + goto err; + } + err: + if (x != NULL) + X509_CRL_free(x); + if (in != NULL) + BIO_free(in); + return (ret); +} + +int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type) +{ + STACK_OF(X509_INFO) *inf; + X509_INFO *itmp; + BIO *in; + size_t i; + int count = 0; + if (type != X509_FILETYPE_PEM) + return X509_load_cert_file(ctx, file, type); + in = BIO_new_file(file, "r"); + if (!in) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + return 0; + } + inf = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL); + BIO_free(in); + if (!inf) { + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + return 0; + } + for (i = 0; i < sk_X509_INFO_num(inf); i++) { + itmp = sk_X509_INFO_value(inf, i); + if (itmp->x509) { + X509_STORE_add_cert(ctx->store_ctx, itmp->x509); + count++; + } + if (itmp->crl) { + X509_STORE_add_crl(ctx->store_ctx, itmp->crl); + count++; + } + } + sk_X509_INFO_pop_free(inf, X509_INFO_free); + return count; +} + +#endif /* OPENSSL_NO_STDIO */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back new file mode 100644 index 0000000..994beb9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back @@ -0,0 +1,275 @@ +/* crypto/x509/by_file.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 + +#ifndef OPENSSL_NO_STDIO + +static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +static X509_LOOKUP_METHOD x509_file_lookup = { + "Load file into cache", + NULL, /* new */ + NULL, /* free */ + NULL, /* init */ + NULL, /* shutdown */ + by_file_ctrl, /* ctrl */ + NULL, /* get_by_subject */ + NULL, /* get_by_issuer_serial */ + NULL, /* get_by_fingerprint */ + NULL, /* get_by_alias */ +}; + +X509_LOOKUP_METHOD *X509_LOOKUP_file(void) +{ + return (&x509_file_lookup); +} + +static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, + long argl, char **ret) +{ + int ok = 0; + const char *file; + + switch (cmd) { + case X509_L_FILE_LOAD: + if (argl == X509_FILETYPE_DEFAULT) { + file = getenv(X509_get_default_cert_file_env()); + if (file) + ok = (X509_load_cert_crl_file(ctx, file, + X509_FILETYPE_PEM) != 0); + + else + ok = (X509_load_cert_crl_file + (ctx, X509_get_default_cert_file(), + X509_FILETYPE_PEM) != 0); + + if (!ok) { + OPENSSL_PUT_ERROR(X509, X509_R_LOADING_DEFAULTS); + } + } else { + if (argl == X509_FILETYPE_PEM) + ok = (X509_load_cert_crl_file(ctx, argp, + X509_FILETYPE_PEM) != 0); + else + ok = (X509_load_cert_file(ctx, argp, (int)argl) != 0); + } + break; + } + return (ok); +} + +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) +{ + int ret = 0; + BIO *in = NULL; + int i, count = 0; + X509 *x = NULL; + + if (file == NULL) + return (1); + in = BIO_new(BIO_s_file()); + + if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + goto err; + } + + if (type == X509_FILETYPE_PEM) { + for (;;) { + x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL); + if (x == NULL) { + 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; + } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; + } + i = X509_STORE_add_cert(ctx->store_ctx, x); + if (!i) + goto err; + count++; + X509_free(x); + x = NULL; + } + ret = count; + } else if (type == X509_FILETYPE_ASN1) { + x = d2i_X509_bio(in, NULL); + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + goto err; + } + i = X509_STORE_add_cert(ctx->store_ctx, x); + if (!i) + goto err; + ret = i; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_BAD_X509_FILETYPE); + goto err; + } + err: + if (x != NULL) + X509_free(x); + if (in != NULL) + BIO_free(in); + return (ret); +} + +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) +{ + int ret = 0; + BIO *in = NULL; + int i, count = 0; + X509_CRL *x = NULL; + + if (file == NULL) + return (1); + in = BIO_new(BIO_s_file()); + + if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + goto err; + } + + if (type == X509_FILETYPE_PEM) { + for (;;) { + x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); + if (x == NULL) { + 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; + } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; + } + i = X509_STORE_add_crl(ctx->store_ctx, x); + if (!i) + goto err; + count++; + X509_CRL_free(x); + x = NULL; + } + ret = count; + } else if (type == X509_FILETYPE_ASN1) { + x = d2i_X509_CRL_bio(in, NULL); + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + goto err; + } + i = X509_STORE_add_crl(ctx->store_ctx, x); + if (!i) + goto err; + ret = i; + } else { + OPENSSL_PUT_ERROR(X509, X509_R_BAD_X509_FILETYPE); + goto err; + } + err: + if (x != NULL) + X509_CRL_free(x); + if (in != NULL) + BIO_free(in); + return (ret); +} + +int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type) +{ + STACK_OF(X509_INFO) *inf; + X509_INFO *itmp; + BIO *in; + size_t i; + int count = 0; + if (type != X509_FILETYPE_PEM) + return X509_load_cert_file(ctx, file, type); + in = BIO_new_file(file, "r"); + if (!in) { + OPENSSL_PUT_ERROR(X509, ERR_R_SYS_LIB); + return 0; + } + inf = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL); + BIO_free(in); + if (!inf) { + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + return 0; + } + for (i = 0; i < sk_X509_INFO_num(inf); i++) { + itmp = sk_X509_INFO_value(inf, i); + if (itmp->x509) { + X509_STORE_add_cert(ctx->store_ctx, itmp->x509); + count++; + } + if (itmp->crl) { + X509_STORE_add_crl(ctx->store_ctx, itmp->crl); + count++; + } + } + sk_X509_INFO_pop_free(inf, X509_INFO_free); + return count; +} + +#endif /* OPENSSL_NO_STDIO */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h new file mode 100644 index 0000000..3305ad1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h @@ -0,0 +1,15 @@ +/* + * Auto generated with chartype.pl script. Mask of various character + * properties + */ + +static const unsigned char char_type[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 120, 0, 1, 40, 0, 0, 0, 16, 16, 16, 0, 25, 25, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 9, 9, 16, 9, 16, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 1, 0, 0, 0, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 2 +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h.grpc_back new file mode 100644 index 0000000..3305ad1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h.grpc_back @@ -0,0 +1,15 @@ +/* + * Auto generated with chartype.pl script. Mask of various character + * properties + */ + +static const unsigned char char_type[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 120, 0, 1, 40, 0, 0, 0, 16, 16, 16, 0, 25, 25, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 9, 9, 16, 9, 16, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 1, 0, 0, 0, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 2 +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c new file mode 100644 index 0000000..df75012 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c @@ -0,0 +1,83 @@ +/* crypto/asn1/i2d_pr.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 + + +int i2d_PrivateKey(const EVP_PKEY *a, uint8_t **pp) +{ + switch (EVP_PKEY_id(a)) { + case EVP_PKEY_RSA: + return i2d_RSAPrivateKey(a->pkey.rsa, pp); + case EVP_PKEY_EC: + return i2d_ECPrivateKey(a->pkey.ec, pp); + case EVP_PKEY_DSA: + return i2d_DSAPrivateKey(a->pkey.dsa, pp); + default: + /* + * Although this file is in crypto/x509 for layering reasons, it emits + * an error code from ASN1 for OpenSSL compatibility. + */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return -1; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c.grpc_back new file mode 100644 index 0000000..c3fb8a8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c.grpc_back @@ -0,0 +1,83 @@ +/* crypto/asn1/i2d_pr.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 + + +int i2d_PrivateKey(const EVP_PKEY *a, uint8_t **pp) +{ + switch (EVP_PKEY_id(a)) { + case EVP_PKEY_RSA: + return i2d_RSAPrivateKey(a->pkey.rsa, pp); + case EVP_PKEY_EC: + return i2d_ECPrivateKey(a->pkey.ec, pp); + case EVP_PKEY_DSA: + return i2d_DSAPrivateKey(a->pkey.dsa, pp); + default: + /* + * Although this file is in crypto/x509 for layering reasons, it emits + * an error code from ASN1 for OpenSSL compatibility. + */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return -1; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h new file mode 100644 index 0000000..435f90c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h @@ -0,0 +1,66 @@ +/* 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_X509_INTERNAL_H +#define OPENSSL_HEADER_X509_INTERNAL_H + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* RSA-PSS functions. */ + +/* x509_rsa_pss_to_ctx configures |ctx| for an RSA-PSS operation based on + * signature algorithm parameters in |sigalg| (which must have type + * |NID_rsassaPss|) and key |pkey|. It returns one on success and zero on + * error. */ +int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey); + +/* x509_rsa_pss_to_ctx sets |algor| to the signature algorithm parameters for + * |ctx|, which must have been configured for an RSA-PSS signing operation. It + * returns one on success and zero on error. */ +int x509_rsa_ctx_to_pss(EVP_MD_CTX *ctx, X509_ALGOR *algor); + +/* x509_print_rsa_pss_params prints a human-readable representation of RSA-PSS + * parameters in |sigalg| to |bp|. It returns one on success and zero on + * error. */ +int x509_print_rsa_pss_params(BIO *bp, const X509_ALGOR *sigalg, int indent, + ASN1_PCTX *pctx); + + +/* Signature algorithm functions. */ + +/* x509_digest_sign_algorithm encodes the signing parameters of |ctx| as an + * AlgorithmIdentifer and saves the result in |algor|. It returns one on + * success, or zero on error. */ +int x509_digest_sign_algorithm(EVP_MD_CTX *ctx, X509_ALGOR *algor); + +/* x509_digest_verify_init sets up |ctx| for a signature verification operation + * with public key |pkey| and parameters from |algor|. The |ctx| argument must + * have been initialised with |EVP_MD_CTX_init|. It returns one on success, or + * zero on error. */ +int x509_digest_verify_init(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, + EVP_PKEY *pkey); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_X509_INTERNAL_H */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h.grpc_back new file mode 100644 index 0000000..4957c1e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h.grpc_back @@ -0,0 +1,66 @@ +/* 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_X509_INTERNAL_H +#define OPENSSL_HEADER_X509_INTERNAL_H + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* RSA-PSS functions. */ + +/* x509_rsa_pss_to_ctx configures |ctx| for an RSA-PSS operation based on + * signature algorithm parameters in |sigalg| (which must have type + * |NID_rsassaPss|) and key |pkey|. It returns one on success and zero on + * error. */ +int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey); + +/* x509_rsa_pss_to_ctx sets |algor| to the signature algorithm parameters for + * |ctx|, which must have been configured for an RSA-PSS signing operation. It + * returns one on success and zero on error. */ +int x509_rsa_ctx_to_pss(EVP_MD_CTX *ctx, X509_ALGOR *algor); + +/* x509_print_rsa_pss_params prints a human-readable representation of RSA-PSS + * parameters in |sigalg| to |bp|. It returns one on success and zero on + * error. */ +int x509_print_rsa_pss_params(BIO *bp, const X509_ALGOR *sigalg, int indent, + ASN1_PCTX *pctx); + + +/* Signature algorithm functions. */ + +/* x509_digest_sign_algorithm encodes the signing parameters of |ctx| as an + * AlgorithmIdentifer and saves the result in |algor|. It returns one on + * success, or zero on error. */ +int x509_digest_sign_algorithm(EVP_MD_CTX *ctx, X509_ALGOR *algor); + +/* x509_digest_verify_init sets up |ctx| for a signature verification operation + * with public key |pkey| and parameters from |algor|. The |ctx| argument must + * have been initialised with |EVP_MD_CTX_init|. It returns one on success, or + * zero on error. */ +int x509_digest_verify_init(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, + EVP_PKEY *pkey); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_X509_INTERNAL_H */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c new file mode 100644 index 0000000..30ee781 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c @@ -0,0 +1,385 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +ASN1_SEQUENCE(RSA_PSS_PARAMS) = { + ASN1_EXP_OPT(RSA_PSS_PARAMS, hashAlgorithm, X509_ALGOR,0), + ASN1_EXP_OPT(RSA_PSS_PARAMS, maskGenAlgorithm, X509_ALGOR,1), + ASN1_EXP_OPT(RSA_PSS_PARAMS, saltLength, ASN1_INTEGER,2), + ASN1_EXP_OPT(RSA_PSS_PARAMS, trailerField, ASN1_INTEGER,3), +} ASN1_SEQUENCE_END(RSA_PSS_PARAMS) + +IMPLEMENT_ASN1_FUNCTIONS(RSA_PSS_PARAMS) + + +/* Given an MGF1 Algorithm ID decode to an Algorithm Identifier */ +static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { + if (alg == NULL || alg->parameter == NULL || + OBJ_obj2nid(alg->algorithm) != NID_mgf1 || + alg->parameter->type != V_ASN1_SEQUENCE) { + return NULL; + } + + const uint8_t *p = alg->parameter->value.sequence->data; + int plen = alg->parameter->value.sequence->length; + return d2i_X509_ALGOR(NULL, &p, plen); +} + +static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg, + X509_ALGOR **pmaskHash) { + *pmaskHash = NULL; + + if (alg->parameter == NULL || alg->parameter->type != V_ASN1_SEQUENCE) { + return NULL; + } + + const uint8_t *p = alg->parameter->value.sequence->data; + int plen = alg->parameter->value.sequence->length; + RSA_PSS_PARAMS *pss = d2i_RSA_PSS_PARAMS(NULL, &p, plen); + if (pss == NULL) { + return NULL; + } + + *pmaskHash = rsa_mgf1_decode(pss->maskGenAlgorithm); + return pss; +} + +/* allocate and set algorithm ID from EVP_MD, default SHA1 */ +static int rsa_md_to_algor(X509_ALGOR **palg, const EVP_MD *md) { + if (EVP_MD_type(md) == NID_sha1) { + return 1; + } + *palg = X509_ALGOR_new(); + if (*palg == NULL) { + return 0; + } + X509_ALGOR_set_md(*palg, md); + return 1; +} + +/* Allocate and set MGF1 algorithm ID from EVP_MD */ +static int rsa_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md) { + X509_ALGOR *algtmp = NULL; + ASN1_STRING *stmp = NULL; + *palg = NULL; + + if (EVP_MD_type(mgf1md) == NID_sha1) { + return 1; + } + /* need to embed algorithm ID inside another */ + if (!rsa_md_to_algor(&algtmp, mgf1md) || + !ASN1_item_pack(algtmp, ASN1_ITEM_rptr(X509_ALGOR), &stmp)) { + goto err; + } + *palg = X509_ALGOR_new(); + if (!*palg) { + goto err; + } + X509_ALGOR_set0(*palg, OBJ_nid2obj(NID_mgf1), V_ASN1_SEQUENCE, stmp); + stmp = NULL; + +err: + ASN1_STRING_free(stmp); + X509_ALGOR_free(algtmp); + if (*palg) { + return 1; + } + + return 0; +} + +/* convert algorithm ID to EVP_MD, default SHA1 */ +static const EVP_MD *rsa_algor_to_md(X509_ALGOR *alg) { + const EVP_MD *md; + if (!alg) { + return EVP_sha1(); + } + md = EVP_get_digestbyobj(alg->algorithm); + if (md == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + } + return md; +} + +/* convert MGF1 algorithm ID to EVP_MD, default SHA1 */ +static const EVP_MD *rsa_mgf1_to_md(X509_ALGOR *alg, X509_ALGOR *maskHash) { + const EVP_MD *md; + if (!alg) { + return EVP_sha1(); + } + /* Check mask and lookup mask hash algorithm */ + if (OBJ_obj2nid(alg->algorithm) != NID_mgf1 || + maskHash == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + return NULL; + } + md = EVP_get_digestbyobj(maskHash->algorithm); + if (md == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + return NULL; + } + return md; +} + +int x509_rsa_ctx_to_pss(EVP_MD_CTX *ctx, X509_ALGOR *algor) { + const EVP_MD *sigmd, *mgf1md; + int saltlen; + if (!EVP_PKEY_CTX_get_signature_md(ctx->pctx, &sigmd) || + !EVP_PKEY_CTX_get_rsa_mgf1_md(ctx->pctx, &mgf1md) || + !EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx->pctx, &saltlen)) { + return 0; + } + + EVP_PKEY *pk = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + if (saltlen == -1) { + saltlen = EVP_MD_size(sigmd); + } else if (saltlen == -2) { + saltlen = EVP_PKEY_size(pk) - EVP_MD_size(sigmd) - 2; + if (((EVP_PKEY_bits(pk) - 1) & 0x7) == 0) { + saltlen--; + } + } else { + return 0; + } + + int ret = 0; + ASN1_STRING *os = NULL; + RSA_PSS_PARAMS *pss = RSA_PSS_PARAMS_new(); + if (!pss) { + goto err; + } + + if (saltlen != 20) { + pss->saltLength = ASN1_INTEGER_new(); + if (!pss->saltLength || + !ASN1_INTEGER_set(pss->saltLength, saltlen)) { + goto err; + } + } + + if (!rsa_md_to_algor(&pss->hashAlgorithm, sigmd) || + !rsa_md_to_mgf1(&pss->maskGenAlgorithm, mgf1md)) { + goto err; + } + + /* Finally create string with pss parameter encoding. */ + if (!ASN1_item_pack(pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), &os)) { + goto err; + } + + X509_ALGOR_set0(algor, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os); + os = NULL; + ret = 1; + +err: + RSA_PSS_PARAMS_free(pss); + ASN1_STRING_free(os); + return ret; +} + +int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey) { + assert(OBJ_obj2nid(sigalg->algorithm) == NID_rsassaPss); + + /* Decode PSS parameters */ + int ret = 0; + X509_ALGOR *maskHash; + RSA_PSS_PARAMS *pss = rsa_pss_decode(sigalg, &maskHash); + if (pss == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + + const EVP_MD *mgf1md = rsa_mgf1_to_md(pss->maskGenAlgorithm, maskHash); + const EVP_MD *md = rsa_algor_to_md(pss->hashAlgorithm); + if (mgf1md == NULL || md == NULL) { + goto err; + } + + int saltlen = 20; + if (pss->saltLength != NULL) { + saltlen = ASN1_INTEGER_get(pss->saltLength); + + /* Could perform more salt length sanity checks but the main + * RSA routines will trap other invalid values anyway. */ + if (saltlen < 0) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + } + + /* low-level routines support only trailer field 0xbc (value 1) + * and PKCS#1 says we should reject any other value anyway. */ + if (pss->trailerField != NULL && ASN1_INTEGER_get(pss->trailerField) != 1) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + + EVP_PKEY_CTX *pctx; + if (!EVP_DigestVerifyInit(ctx, &pctx, md, NULL, pkey) || + !EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, saltlen) || + !EVP_PKEY_CTX_set_rsa_mgf1_md(pctx, mgf1md)) { + goto err; + } + + ret = 1; + +err: + RSA_PSS_PARAMS_free(pss); + X509_ALGOR_free(maskHash); + return ret; +} + +int x509_print_rsa_pss_params(BIO *bp, const X509_ALGOR *sigalg, int indent, + ASN1_PCTX *pctx) { + assert(OBJ_obj2nid(sigalg->algorithm) == NID_rsassaPss); + + int rv = 0; + X509_ALGOR *maskHash; + RSA_PSS_PARAMS *pss = rsa_pss_decode(sigalg, &maskHash); + if (!pss) { + if (BIO_puts(bp, " (INVALID PSS PARAMETERS)\n") <= 0) { + goto err; + } + rv = 1; + goto err; + } + + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Hash Algorithm: ") <= 0) { + goto err; + } + + if (pss->hashAlgorithm) { + if (i2a_ASN1_OBJECT(bp, pss->hashAlgorithm->algorithm) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "sha1 (default)") <= 0) { + goto err; + } + + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Mask Algorithm: ") <= 0) { + goto err; + } + + if (pss->maskGenAlgorithm) { + if (i2a_ASN1_OBJECT(bp, pss->maskGenAlgorithm->algorithm) <= 0 || + BIO_puts(bp, " with ") <= 0) { + goto err; + } + + if (maskHash) { + if (i2a_ASN1_OBJECT(bp, maskHash->algorithm) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "INVALID") <= 0) { + goto err; + } + } else if (BIO_puts(bp, "mgf1 with sha1 (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + if (!BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Salt Length: 0x") <= 0) { + goto err; + } + + if (pss->saltLength) { + if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "14 (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + if (!BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Trailer Field: 0x") <= 0) { + goto err; + } + + if (pss->trailerField) { + if (i2a_ASN1_INTEGER(bp, pss->trailerField) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "BC (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + rv = 1; + +err: + RSA_PSS_PARAMS_free(pss); + X509_ALGOR_free(maskHash); + return rv; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c.grpc_back new file mode 100644 index 0000000..9230934 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c.grpc_back @@ -0,0 +1,385 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2006. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "internal.h" + + +ASN1_SEQUENCE(RSA_PSS_PARAMS) = { + ASN1_EXP_OPT(RSA_PSS_PARAMS, hashAlgorithm, X509_ALGOR,0), + ASN1_EXP_OPT(RSA_PSS_PARAMS, maskGenAlgorithm, X509_ALGOR,1), + ASN1_EXP_OPT(RSA_PSS_PARAMS, saltLength, ASN1_INTEGER,2), + ASN1_EXP_OPT(RSA_PSS_PARAMS, trailerField, ASN1_INTEGER,3), +} ASN1_SEQUENCE_END(RSA_PSS_PARAMS) + +IMPLEMENT_ASN1_FUNCTIONS(RSA_PSS_PARAMS) + + +/* Given an MGF1 Algorithm ID decode to an Algorithm Identifier */ +static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { + if (alg == NULL || alg->parameter == NULL || + OBJ_obj2nid(alg->algorithm) != NID_mgf1 || + alg->parameter->type != V_ASN1_SEQUENCE) { + return NULL; + } + + const uint8_t *p = alg->parameter->value.sequence->data; + int plen = alg->parameter->value.sequence->length; + return d2i_X509_ALGOR(NULL, &p, plen); +} + +static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg, + X509_ALGOR **pmaskHash) { + *pmaskHash = NULL; + + if (alg->parameter == NULL || alg->parameter->type != V_ASN1_SEQUENCE) { + return NULL; + } + + const uint8_t *p = alg->parameter->value.sequence->data; + int plen = alg->parameter->value.sequence->length; + RSA_PSS_PARAMS *pss = d2i_RSA_PSS_PARAMS(NULL, &p, plen); + if (pss == NULL) { + return NULL; + } + + *pmaskHash = rsa_mgf1_decode(pss->maskGenAlgorithm); + return pss; +} + +/* allocate and set algorithm ID from EVP_MD, default SHA1 */ +static int rsa_md_to_algor(X509_ALGOR **palg, const EVP_MD *md) { + if (EVP_MD_type(md) == NID_sha1) { + return 1; + } + *palg = X509_ALGOR_new(); + if (*palg == NULL) { + return 0; + } + X509_ALGOR_set_md(*palg, md); + return 1; +} + +/* Allocate and set MGF1 algorithm ID from EVP_MD */ +static int rsa_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md) { + X509_ALGOR *algtmp = NULL; + ASN1_STRING *stmp = NULL; + *palg = NULL; + + if (EVP_MD_type(mgf1md) == NID_sha1) { + return 1; + } + /* need to embed algorithm ID inside another */ + if (!rsa_md_to_algor(&algtmp, mgf1md) || + !ASN1_item_pack(algtmp, ASN1_ITEM_rptr(X509_ALGOR), &stmp)) { + goto err; + } + *palg = X509_ALGOR_new(); + if (!*palg) { + goto err; + } + X509_ALGOR_set0(*palg, OBJ_nid2obj(NID_mgf1), V_ASN1_SEQUENCE, stmp); + stmp = NULL; + +err: + ASN1_STRING_free(stmp); + X509_ALGOR_free(algtmp); + if (*palg) { + return 1; + } + + return 0; +} + +/* convert algorithm ID to EVP_MD, default SHA1 */ +static const EVP_MD *rsa_algor_to_md(X509_ALGOR *alg) { + const EVP_MD *md; + if (!alg) { + return EVP_sha1(); + } + md = EVP_get_digestbyobj(alg->algorithm); + if (md == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + } + return md; +} + +/* convert MGF1 algorithm ID to EVP_MD, default SHA1 */ +static const EVP_MD *rsa_mgf1_to_md(X509_ALGOR *alg, X509_ALGOR *maskHash) { + const EVP_MD *md; + if (!alg) { + return EVP_sha1(); + } + /* Check mask and lookup mask hash algorithm */ + if (OBJ_obj2nid(alg->algorithm) != NID_mgf1 || + maskHash == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + return NULL; + } + md = EVP_get_digestbyobj(maskHash->algorithm); + if (md == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + return NULL; + } + return md; +} + +int x509_rsa_ctx_to_pss(EVP_MD_CTX *ctx, X509_ALGOR *algor) { + const EVP_MD *sigmd, *mgf1md; + int saltlen; + if (!EVP_PKEY_CTX_get_signature_md(ctx->pctx, &sigmd) || + !EVP_PKEY_CTX_get_rsa_mgf1_md(ctx->pctx, &mgf1md) || + !EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx->pctx, &saltlen)) { + return 0; + } + + EVP_PKEY *pk = EVP_PKEY_CTX_get0_pkey(ctx->pctx); + if (saltlen == -1) { + saltlen = EVP_MD_size(sigmd); + } else if (saltlen == -2) { + saltlen = EVP_PKEY_size(pk) - EVP_MD_size(sigmd) - 2; + if (((EVP_PKEY_bits(pk) - 1) & 0x7) == 0) { + saltlen--; + } + } else { + return 0; + } + + int ret = 0; + ASN1_STRING *os = NULL; + RSA_PSS_PARAMS *pss = RSA_PSS_PARAMS_new(); + if (!pss) { + goto err; + } + + if (saltlen != 20) { + pss->saltLength = ASN1_INTEGER_new(); + if (!pss->saltLength || + !ASN1_INTEGER_set(pss->saltLength, saltlen)) { + goto err; + } + } + + if (!rsa_md_to_algor(&pss->hashAlgorithm, sigmd) || + !rsa_md_to_mgf1(&pss->maskGenAlgorithm, mgf1md)) { + goto err; + } + + /* Finally create string with pss parameter encoding. */ + if (!ASN1_item_pack(pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), &os)) { + goto err; + } + + X509_ALGOR_set0(algor, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os); + os = NULL; + ret = 1; + +err: + RSA_PSS_PARAMS_free(pss); + ASN1_STRING_free(os); + return ret; +} + +int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey) { + assert(OBJ_obj2nid(sigalg->algorithm) == NID_rsassaPss); + + /* Decode PSS parameters */ + int ret = 0; + X509_ALGOR *maskHash; + RSA_PSS_PARAMS *pss = rsa_pss_decode(sigalg, &maskHash); + if (pss == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + + const EVP_MD *mgf1md = rsa_mgf1_to_md(pss->maskGenAlgorithm, maskHash); + const EVP_MD *md = rsa_algor_to_md(pss->hashAlgorithm); + if (mgf1md == NULL || md == NULL) { + goto err; + } + + int saltlen = 20; + if (pss->saltLength != NULL) { + saltlen = ASN1_INTEGER_get(pss->saltLength); + + /* Could perform more salt length sanity checks but the main + * RSA routines will trap other invalid values anyway. */ + if (saltlen < 0) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + } + + /* low-level routines support only trailer field 0xbc (value 1) + * and PKCS#1 says we should reject any other value anyway. */ + if (pss->trailerField != NULL && ASN1_INTEGER_get(pss->trailerField) != 1) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_PSS_PARAMETERS); + goto err; + } + + EVP_PKEY_CTX *pctx; + if (!EVP_DigestVerifyInit(ctx, &pctx, md, NULL, pkey) || + !EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, saltlen) || + !EVP_PKEY_CTX_set_rsa_mgf1_md(pctx, mgf1md)) { + goto err; + } + + ret = 1; + +err: + RSA_PSS_PARAMS_free(pss); + X509_ALGOR_free(maskHash); + return ret; +} + +int x509_print_rsa_pss_params(BIO *bp, const X509_ALGOR *sigalg, int indent, + ASN1_PCTX *pctx) { + assert(OBJ_obj2nid(sigalg->algorithm) == NID_rsassaPss); + + int rv = 0; + X509_ALGOR *maskHash; + RSA_PSS_PARAMS *pss = rsa_pss_decode(sigalg, &maskHash); + if (!pss) { + if (BIO_puts(bp, " (INVALID PSS PARAMETERS)\n") <= 0) { + goto err; + } + rv = 1; + goto err; + } + + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Hash Algorithm: ") <= 0) { + goto err; + } + + if (pss->hashAlgorithm) { + if (i2a_ASN1_OBJECT(bp, pss->hashAlgorithm->algorithm) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "sha1 (default)") <= 0) { + goto err; + } + + if (BIO_puts(bp, "\n") <= 0 || + !BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Mask Algorithm: ") <= 0) { + goto err; + } + + if (pss->maskGenAlgorithm) { + if (i2a_ASN1_OBJECT(bp, pss->maskGenAlgorithm->algorithm) <= 0 || + BIO_puts(bp, " with ") <= 0) { + goto err; + } + + if (maskHash) { + if (i2a_ASN1_OBJECT(bp, maskHash->algorithm) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "INVALID") <= 0) { + goto err; + } + } else if (BIO_puts(bp, "mgf1 with sha1 (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + if (!BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Salt Length: 0x") <= 0) { + goto err; + } + + if (pss->saltLength) { + if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "14 (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + if (!BIO_indent(bp, indent, 128) || + BIO_puts(bp, "Trailer Field: 0x") <= 0) { + goto err; + } + + if (pss->trailerField) { + if (i2a_ASN1_INTEGER(bp, pss->trailerField) <= 0) { + goto err; + } + } else if (BIO_puts(bp, "BC (default)") <= 0) { + goto err; + } + BIO_puts(bp, "\n"); + + rv = 1; + +err: + RSA_PSS_PARAMS_free(pss); + X509_ALGOR_free(maskHash); + return rv; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c new file mode 100644 index 0000000..5c03f8f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c @@ -0,0 +1,125 @@ +/* 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 + +#ifndef OPENSSL_NO_FP_API +int X509_CRL_print_fp(FILE *fp, X509_CRL *x) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_CRL_print(b, x); + BIO_free(b); + return ret; +} +#endif + +int X509_CRL_print(BIO *out, X509_CRL *x) +{ + STACK_OF(X509_REVOKED) *rev; + X509_REVOKED *r; + long l; + size_t i; + char *p; + + BIO_printf(out, "Certificate Revocation List (CRL):\n"); + l = X509_CRL_get_version(x); + BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l); + X509_signature_print(out, x->sig_alg, NULL); + p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); + BIO_printf(out, "%8sIssuer: %s\n", "", p); + OPENSSL_free(p); + BIO_printf(out, "%8sLast Update: ", ""); + ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x)); + BIO_printf(out, "\n%8sNext Update: ", ""); + if (X509_CRL_get_nextUpdate(x)) + ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x)); + else + BIO_printf(out, "NONE"); + BIO_printf(out, "\n"); + + X509V3_extensions_print(out, "CRL extensions", x->crl->extensions, 0, 8); + + rev = X509_CRL_get_REVOKED(x); + + if (sk_X509_REVOKED_num(rev) > 0) + BIO_printf(out, "Revoked Certificates:\n"); + else + BIO_printf(out, "No Revoked Certificates.\n"); + + for (i = 0; i < sk_X509_REVOKED_num(rev); i++) { + r = sk_X509_REVOKED_value(rev, i); + BIO_printf(out, " Serial Number: "); + i2a_ASN1_INTEGER(out, r->serialNumber); + BIO_printf(out, "\n Revocation Date: "); + ASN1_TIME_print(out, r->revocationDate); + BIO_printf(out, "\n"); + X509V3_extensions_print(out, "CRL entry extensions", + r->extensions, 0, 8); + } + X509_signature_print(out, x->sig_alg, x->signature); + + return 1; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back new file mode 100644 index 0000000..dc9b87f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back @@ -0,0 +1,125 @@ +/* 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 + +#ifndef OPENSSL_NO_FP_API +int X509_CRL_print_fp(FILE *fp, X509_CRL *x) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_CRL_print(b, x); + BIO_free(b); + return ret; +} +#endif + +int X509_CRL_print(BIO *out, X509_CRL *x) +{ + STACK_OF(X509_REVOKED) *rev; + X509_REVOKED *r; + long l; + size_t i; + char *p; + + BIO_printf(out, "Certificate Revocation List (CRL):\n"); + l = X509_CRL_get_version(x); + BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l); + X509_signature_print(out, x->sig_alg, NULL); + p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); + BIO_printf(out, "%8sIssuer: %s\n", "", p); + OPENSSL_free(p); + BIO_printf(out, "%8sLast Update: ", ""); + ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x)); + BIO_printf(out, "\n%8sNext Update: ", ""); + if (X509_CRL_get_nextUpdate(x)) + ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x)); + else + BIO_printf(out, "NONE"); + BIO_printf(out, "\n"); + + X509V3_extensions_print(out, "CRL extensions", x->crl->extensions, 0, 8); + + rev = X509_CRL_get_REVOKED(x); + + if (sk_X509_REVOKED_num(rev) > 0) + BIO_printf(out, "Revoked Certificates:\n"); + else + BIO_printf(out, "No Revoked Certificates.\n"); + + for (i = 0; i < sk_X509_REVOKED_num(rev); i++) { + r = sk_X509_REVOKED_value(rev, i); + BIO_printf(out, " Serial Number: "); + i2a_ASN1_INTEGER(out, r->serialNumber); + BIO_printf(out, "\n Revocation Date: "); + ASN1_TIME_print(out, r->revocationDate); + BIO_printf(out, "\n"); + X509V3_extensions_print(out, "CRL entry extensions", + r->extensions, 0, 8); + } + X509_signature_print(out, x->sig_alg, x->signature); + + return 1; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c new file mode 100644 index 0000000..0e30794 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c @@ -0,0 +1,244 @@ +/* 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 + + +int X509_REQ_print_fp(FILE *fp, X509_REQ *x) { + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); + if (bio == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_REQ_print(bio, x); + BIO_free(bio); + return ret; +} + +int X509_REQ_print_ex(BIO *bio, X509_REQ *x, unsigned long nmflags, + unsigned long cflag) { + long l; + EVP_PKEY *pkey; + STACK_OF(X509_ATTRIBUTE) * sk; + char mlch = ' '; + + int nmindent = 0; + + if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { + mlch = '\n'; + nmindent = 12; + } + + if (nmflags == X509_FLAG_COMPAT) { + nmindent = 16; + } + + X509_REQ_INFO *ri = x->req_info; + if (!(cflag & X509_FLAG_NO_HEADER)) { + if (BIO_write(bio, "Certificate Request:\n", 21) <= 0 || + BIO_write(bio, " Data:\n", 10) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_VERSION)) { + l = X509_REQ_get_version(x); + if (BIO_printf(bio, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_SUBJECT)) { + if (BIO_printf(bio, " Subject:%c", mlch) <= 0 || + X509_NAME_print_ex(bio, ri->subject, nmindent, nmflags) < 0 || + BIO_write(bio, "\n", 1) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_PUBKEY)) { + if (BIO_write(bio, " Subject Public Key Info:\n", 33) <= 0 || + BIO_printf(bio, "%12sPublic Key Algorithm: ", "") <= 0 || + i2a_ASN1_OBJECT(bio, ri->pubkey->algor->algorithm) <= 0 || + BIO_puts(bio, "\n") <= 0) { + goto err; + } + + pkey = X509_REQ_get_pubkey(x); + if (pkey == NULL) { + BIO_printf(bio, "%12sUnable to load Public Key\n", ""); + ERR_print_errors(bio); + } else { + EVP_PKEY_print_public(bio, pkey, 16, NULL); + EVP_PKEY_free(pkey); + } + } + + if (!(cflag & X509_FLAG_NO_ATTRIBUTES)) { + if (BIO_printf(bio, "%8sAttributes:\n", "") <= 0) { + goto err; + } + + sk = x->req_info->attributes; + if (sk_X509_ATTRIBUTE_num(sk) == 0) { + if (BIO_printf(bio, "%12sa0:00\n", "") <= 0) { + goto err; + } + } else { + size_t i; + for (i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) { + X509_ATTRIBUTE *a = sk_X509_ATTRIBUTE_value(sk, i); + ASN1_OBJECT *aobj = X509_ATTRIBUTE_get0_object(a); + + if (X509_REQ_extension_nid(OBJ_obj2nid(aobj))) { + continue; + } + + if (BIO_printf(bio, "%12s", "") <= 0) { + goto err; + } + + const int num_attrs = X509_ATTRIBUTE_count(a); + const int obj_str_len = i2a_ASN1_OBJECT(bio, aobj); + if (obj_str_len <= 0) { + if (BIO_puts(bio, "(Unable to print attribute ID.)\n") < 0) { + goto err; + } else { + continue; + } + } + + int j; + for (j = 0; j < num_attrs; j++) { + const ASN1_TYPE *at = X509_ATTRIBUTE_get0_type(a, j); + const int type = at->type; + ASN1_BIT_STRING *bs = at->value.asn1_string; + + int k; + for (k = 25 - obj_str_len; k > 0; k--) { + if (BIO_write(bio, " ", 1) != 1) { + goto err; + } + } + + if (BIO_puts(bio, ":") <= 0) { + goto err; + } + + if (type == V_ASN1_PRINTABLESTRING || + type == V_ASN1_UTF8STRING || + type == V_ASN1_IA5STRING || + type == V_ASN1_T61STRING) { + if (BIO_write(bio, (char *)bs->data, bs->length) != bs->length) { + goto err; + } + BIO_puts(bio, "\n"); + } else { + BIO_puts(bio, "unable to print attribute\n"); + } + } + } + } + } + + if (!(cflag & X509_FLAG_NO_EXTENSIONS)) { + STACK_OF(X509_EXTENSION) *exts = X509_REQ_get_extensions(x); + if (exts) { + BIO_printf(bio, "%8sRequested Extensions:\n", ""); + + size_t i; + for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { + X509_EXTENSION *ex = sk_X509_EXTENSION_value(exts, i); + if (BIO_printf(bio, "%12s", "") <= 0) { + goto err; + } + ASN1_OBJECT *obj = X509_EXTENSION_get_object(ex); + i2a_ASN1_OBJECT(bio, obj); + const int is_critical = X509_EXTENSION_get_critical(ex); + if (BIO_printf(bio, ": %s\n", is_critical ? "critical" : "") <= 0) { + goto err; + } + if (!X509V3_EXT_print(bio, ex, cflag, 16)) { + BIO_printf(bio, "%16s", ""); + ASN1_STRING_print(bio, X509_EXTENSION_get_data(ex)); + } + if (BIO_write(bio, "\n", 1) <= 0) { + goto err; + } + } + sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); + } + } + + if (!(cflag & X509_FLAG_NO_SIGDUMP) && + !X509_signature_print(bio, x->sig_alg, x->signature)) { + goto err; + } + + return 1; + +err: + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; +} + +int X509_REQ_print(BIO *bio, X509_REQ *req) { + return X509_REQ_print_ex(bio, req, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back new file mode 100644 index 0000000..2fd36f8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back @@ -0,0 +1,244 @@ +/* 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 + + +int X509_REQ_print_fp(FILE *fp, X509_REQ *x) { + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); + if (bio == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_REQ_print(bio, x); + BIO_free(bio); + return ret; +} + +int X509_REQ_print_ex(BIO *bio, X509_REQ *x, unsigned long nmflags, + unsigned long cflag) { + long l; + EVP_PKEY *pkey; + STACK_OF(X509_ATTRIBUTE) * sk; + char mlch = ' '; + + int nmindent = 0; + + if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { + mlch = '\n'; + nmindent = 12; + } + + if (nmflags == X509_FLAG_COMPAT) { + nmindent = 16; + } + + X509_REQ_INFO *ri = x->req_info; + if (!(cflag & X509_FLAG_NO_HEADER)) { + if (BIO_write(bio, "Certificate Request:\n", 21) <= 0 || + BIO_write(bio, " Data:\n", 10) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_VERSION)) { + l = X509_REQ_get_version(x); + if (BIO_printf(bio, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_SUBJECT)) { + if (BIO_printf(bio, " Subject:%c", mlch) <= 0 || + X509_NAME_print_ex(bio, ri->subject, nmindent, nmflags) < 0 || + BIO_write(bio, "\n", 1) <= 0) { + goto err; + } + } + if (!(cflag & X509_FLAG_NO_PUBKEY)) { + if (BIO_write(bio, " Subject Public Key Info:\n", 33) <= 0 || + BIO_printf(bio, "%12sPublic Key Algorithm: ", "") <= 0 || + i2a_ASN1_OBJECT(bio, ri->pubkey->algor->algorithm) <= 0 || + BIO_puts(bio, "\n") <= 0) { + goto err; + } + + pkey = X509_REQ_get_pubkey(x); + if (pkey == NULL) { + BIO_printf(bio, "%12sUnable to load Public Key\n", ""); + ERR_print_errors(bio); + } else { + EVP_PKEY_print_public(bio, pkey, 16, NULL); + EVP_PKEY_free(pkey); + } + } + + if (!(cflag & X509_FLAG_NO_ATTRIBUTES)) { + if (BIO_printf(bio, "%8sAttributes:\n", "") <= 0) { + goto err; + } + + sk = x->req_info->attributes; + if (sk_X509_ATTRIBUTE_num(sk) == 0) { + if (BIO_printf(bio, "%12sa0:00\n", "") <= 0) { + goto err; + } + } else { + size_t i; + for (i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) { + X509_ATTRIBUTE *a = sk_X509_ATTRIBUTE_value(sk, i); + ASN1_OBJECT *aobj = X509_ATTRIBUTE_get0_object(a); + + if (X509_REQ_extension_nid(OBJ_obj2nid(aobj))) { + continue; + } + + if (BIO_printf(bio, "%12s", "") <= 0) { + goto err; + } + + const int num_attrs = X509_ATTRIBUTE_count(a); + const int obj_str_len = i2a_ASN1_OBJECT(bio, aobj); + if (obj_str_len <= 0) { + if (BIO_puts(bio, "(Unable to print attribute ID.)\n") < 0) { + goto err; + } else { + continue; + } + } + + int j; + for (j = 0; j < num_attrs; j++) { + const ASN1_TYPE *at = X509_ATTRIBUTE_get0_type(a, j); + const int type = at->type; + ASN1_BIT_STRING *bs = at->value.asn1_string; + + int k; + for (k = 25 - obj_str_len; k > 0; k--) { + if (BIO_write(bio, " ", 1) != 1) { + goto err; + } + } + + if (BIO_puts(bio, ":") <= 0) { + goto err; + } + + if (type == V_ASN1_PRINTABLESTRING || + type == V_ASN1_UTF8STRING || + type == V_ASN1_IA5STRING || + type == V_ASN1_T61STRING) { + if (BIO_write(bio, (char *)bs->data, bs->length) != bs->length) { + goto err; + } + BIO_puts(bio, "\n"); + } else { + BIO_puts(bio, "unable to print attribute\n"); + } + } + } + } + } + + if (!(cflag & X509_FLAG_NO_EXTENSIONS)) { + STACK_OF(X509_EXTENSION) *exts = X509_REQ_get_extensions(x); + if (exts) { + BIO_printf(bio, "%8sRequested Extensions:\n", ""); + + size_t i; + for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { + X509_EXTENSION *ex = sk_X509_EXTENSION_value(exts, i); + if (BIO_printf(bio, "%12s", "") <= 0) { + goto err; + } + ASN1_OBJECT *obj = X509_EXTENSION_get_object(ex); + i2a_ASN1_OBJECT(bio, obj); + const int is_critical = X509_EXTENSION_get_critical(ex); + if (BIO_printf(bio, ": %s\n", is_critical ? "critical" : "") <= 0) { + goto err; + } + if (!X509V3_EXT_print(bio, ex, cflag, 16)) { + BIO_printf(bio, "%16s", ""); + ASN1_STRING_print(bio, X509_EXTENSION_get_data(ex)); + } + if (BIO_write(bio, "\n", 1) <= 0) { + goto err; + } + } + sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); + } + } + + if (!(cflag & X509_FLAG_NO_SIGDUMP) && + !X509_signature_print(bio, x->sig_alg, x->signature)) { + goto err; + } + + return 1; + +err: + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; +} + +int X509_REQ_print(BIO *bio, X509_REQ *req) { + return X509_REQ_print_ex(bio, req, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c new file mode 100644 index 0000000..a7f2f81 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c @@ -0,0 +1,544 @@ +/* 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 "internal.h" + + +#ifndef OPENSSL_NO_FP_API +int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, + unsigned long cflag) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_print_ex(b, x, nmflag, cflag); + BIO_free(b); + return ret; +} + +int X509_print_fp(FILE *fp, X509 *x) +{ + return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} +#endif + +int X509_print(BIO *bp, X509 *x) +{ + return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} + +int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, + unsigned long cflag) +{ + long l; + int ret = 0, i; + char *m = NULL, mlch = ' '; + int nmindent = 0; + X509_CINF *ci; + ASN1_INTEGER *bs; + EVP_PKEY *pkey = NULL; + const char *neg; + + if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { + mlch = '\n'; + nmindent = 12; + } + + if (nmflags == X509_FLAG_COMPAT) + nmindent = 16; + + ci = x->cert_info; + if (!(cflag & X509_FLAG_NO_HEADER)) { + if (BIO_write(bp, "Certificate:\n", 13) <= 0) + goto err; + if (BIO_write(bp, " Data:\n", 10) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_VERSION)) { + l = X509_get_version(x); + if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_SERIAL)) { + + if (BIO_write(bp, " Serial Number:", 22) <= 0) + goto err; + + bs = X509_get_serialNumber(x); + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { + l = ASN1_INTEGER_get(bs); + if (bs->type == V_ASN1_NEG_INTEGER) { + l = -l; + neg = "-"; + } else + neg = ""; + if (BIO_printf(bp, " %s%lu (%s0x%lx)\n", neg, l, neg, l) <= 0) + goto err; + } else { + neg = (bs->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : ""; + if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0) + goto err; + + for (i = 0; i < bs->length; i++) { + if (BIO_printf(bp, "%02x%c", bs->data[i], + ((i + 1 == bs->length) ? '\n' : ':')) <= 0) + goto err; + } + } + + } + + if (!(cflag & X509_FLAG_NO_SIGNAME)) { + if (X509_signature_print(bp, ci->signature, NULL) <= 0) + goto err; + } + + if (!(cflag & X509_FLAG_NO_ISSUER)) { + if (BIO_printf(bp, " Issuer:%c", mlch) <= 0) + goto err; + if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags) + < 0) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_VALIDITY)) { + if (BIO_write(bp, " Validity\n", 17) <= 0) + goto err; + if (BIO_write(bp, " Not Before: ", 24) <= 0) + goto err; + if (!ASN1_TIME_print(bp, X509_get_notBefore(x))) + goto err; + if (BIO_write(bp, "\n Not After : ", 25) <= 0) + goto err; + if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_SUBJECT)) { + if (BIO_printf(bp, " Subject:%c", mlch) <= 0) + goto err; + if (X509_NAME_print_ex + (bp, X509_get_subject_name(x), nmindent, nmflags) < 0) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_PUBKEY)) { + if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0) + goto err; + if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0) + goto err; + if (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0) + goto err; + if (BIO_puts(bp, "\n") <= 0) + goto err; + + pkey = X509_get_pubkey(x); + if (pkey == NULL) { + BIO_printf(bp, "%12sUnable to load Public Key\n", ""); + ERR_print_errors(bp); + } else { + EVP_PKEY_print_public(bp, pkey, 16, NULL); + EVP_PKEY_free(pkey); + } + } + + if (!(cflag & X509_FLAG_NO_IDS)) { + if (ci->issuerUID) { + if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0) + goto err; + if (!X509_signature_dump(bp, ci->issuerUID, 12)) + goto err; + } + if (ci->subjectUID) { + if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0) + goto err; + if (!X509_signature_dump(bp, ci->subjectUID, 12)) + goto err; + } + } + + if (!(cflag & X509_FLAG_NO_EXTENSIONS)) + X509V3_extensions_print(bp, "X509v3 extensions", + ci->extensions, cflag, 8); + + if (!(cflag & X509_FLAG_NO_SIGDUMP)) { + if (X509_signature_print(bp, x->sig_alg, x->signature) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_AUX)) { + if (!X509_CERT_AUX_print(bp, x->aux, 0)) + goto err; + } + ret = 1; + err: + if (m != NULL) + OPENSSL_free(m); + return (ret); +} + +int X509_ocspid_print(BIO *bp, X509 *x) +{ + unsigned char *der = NULL; + unsigned char *dertmp; + int derlen; + int i; + unsigned char SHA1md[SHA_DIGEST_LENGTH]; + + /* + * display the hash of the subject as it would appear in OCSP requests + */ + if (BIO_printf(bp, " Subject OCSP hash: ") <= 0) + goto err; + derlen = i2d_X509_NAME(x->cert_info->subject, NULL); + if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL) + goto err; + i2d_X509_NAME(x->cert_info->subject, &dertmp); + + if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) + goto err; + for (i = 0; i < SHA_DIGEST_LENGTH; i++) { + if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) + goto err; + } + OPENSSL_free(der); + der = NULL; + + /* + * display the hash of the public key as it would appear in OCSP requests + */ + if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0) + goto err; + + if (!EVP_Digest(x->cert_info->key->public_key->data, + x->cert_info->key->public_key->length, + SHA1md, NULL, EVP_sha1(), NULL)) + goto err; + for (i = 0; i < SHA_DIGEST_LENGTH; i++) { + if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) + goto err; + } + BIO_printf(bp, "\n"); + + return (1); + err: + if (der != NULL) + OPENSSL_free(der); + return (0); +} + +int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, + const ASN1_STRING *sig) +{ + if (BIO_puts(bp, " Signature Algorithm: ") <= 0) + return 0; + if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) + return 0; + + /* RSA-PSS signatures have parameters to print. */ + int sig_nid = OBJ_obj2nid(sigalg->algorithm); + if (sig_nid == NID_rsassaPss && + !x509_print_rsa_pss_params(bp, sigalg, 9, 0)) { + return 0; + } + + if (sig) + return X509_signature_dump(bp, sig, 9); + else if (BIO_puts(bp, "\n") <= 0) + return 0; + return 1; +} + +int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v) +{ + int i, n; + char buf[80]; + const char *p; + + if (v == NULL) + return (0); + n = 0; + p = (const char *)v->data; + for (i = 0; i < v->length; i++) { + if ((p[i] > '~') || ((p[i] < ' ') && + (p[i] != '\n') && (p[i] != '\r'))) + buf[n] = '.'; + else + buf[n] = p[i]; + n++; + if (n >= 80) { + if (BIO_write(bp, buf, n) <= 0) + return (0); + n = 0; + } + } + if (n > 0) + if (BIO_write(bp, buf, n) <= 0) + return (0); + return (1); +} + +int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) +{ + if (tm->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_print(bp, tm); + if (tm->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_print(bp, tm); + BIO_write(bp, "Bad time value", 14); + return (0); +} + +static const char *const mon[12] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +}; + +int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) +{ + char *v; + int gmt = 0; + int i; + int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; + char *f = NULL; + int f_len = 0; + + i = tm->length; + v = (char *)tm->data; + + if (i < 12) + goto err; + if (v[i - 1] == 'Z') + gmt = 1; + for (i = 0; i < 12; i++) + if ((v[i] > '9') || (v[i] < '0')) + goto err; + y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - + '0'); + M = (v[4] - '0') * 10 + (v[5] - '0'); + if ((M > 12) || (M < 1)) + goto err; + d = (v[6] - '0') * 10 + (v[7] - '0'); + h = (v[8] - '0') * 10 + (v[9] - '0'); + m = (v[10] - '0') * 10 + (v[11] - '0'); + if (tm->length >= 14 && + (v[12] >= '0') && (v[12] <= '9') && + (v[13] >= '0') && (v[13] <= '9')) { + s = (v[12] - '0') * 10 + (v[13] - '0'); + /* Check for fractions of seconds. */ + if (tm->length >= 15 && v[14] == '.') { + int l = tm->length; + f = &v[14]; /* The decimal point. */ + f_len = 1; + while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') + ++f_len; + } + } + + if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", + mon[M - 1], d, h, m, s, f_len, f, y, + (gmt) ? " GMT" : "") <= 0) + return (0); + else + return (1); + err: + BIO_write(bp, "Bad time value", 14); + return (0); +} + +// consume_two_digits is a helper function for ASN1_UTCTIME_print. If |*v|, +// assumed to be |*len| bytes long, has two leading digits, updates |*out| with +// their value, updates |v| and |len|, and returns one. Otherwise, returns +// zero. +static int consume_two_digits(int* out, const char **v, int *len) { + if (*len < 2|| !isdigit((*v)[0]) || !isdigit((*v)[1])) { + return 0; + } + *out = ((*v)[0] - '0') * 10 + ((*v)[1] - '0'); + *len -= 2; + *v += 2; + return 1; +} + +// consume_zulu_timezone is a helper function for ASN1_UTCTIME_print. If |*v|, +// assumed to be |*len| bytes long, starts with "Z" then it updates |*v| and +// |*len| and returns one. Otherwise returns zero. +static int consume_zulu_timezone(const char **v, int *len) { + if (*len == 0 || (*v)[0] != 'Z') { + return 0; + } + + *len -= 1; + *v += 1; + return 1; +} + +int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) { + const char *v = (const char *)tm->data; + int len = tm->length; + int Y = 0, M = 0, D = 0, h = 0, m = 0, s = 0; + + // YYMMDDhhmm are required to be present. + if (!consume_two_digits(&Y, &v, &len) || + !consume_two_digits(&M, &v, &len) || + !consume_two_digits(&D, &v, &len) || + !consume_two_digits(&h, &v, &len) || + !consume_two_digits(&m, &v, &len)) { + goto err; + } + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, requires seconds + // to be present, but historically this code has forgiven its absence. + consume_two_digits(&s, &v, &len); + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, specifies this + // interpretation of the year. + if (Y < 50) { + Y += 2000; + } else { + Y += 1900; + } + if (M > 12 || M == 0) { + goto err; + } + if (D > 31 || D == 0) { + goto err; + } + if (h > 23 || m > 59 || s > 60) { + goto err; + } + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, requires the "Z" + // to be present, but historically this code has forgiven its absence. + const int is_gmt = consume_zulu_timezone(&v, &len); + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, does not permit + // the specification of timezones using the +hhmm / -hhmm syntax, which is + // the only other thing that might legitimately be found at the end. + if (len) { + goto err; + } + + return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", mon[M - 1], D, h, m, s, Y, + is_gmt ? " GMT" : "") > 0; + +err: + BIO_write(bp, "Bad time value", 14); + return 0; +} + +int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) +{ + char *s, *c, *b; + int ret = 0, l, i; + + l = 80 - 2 - obase; + + b = X509_NAME_oneline(name, NULL, 0); + if (!b) + return 0; + if (!*b) { + OPENSSL_free(b); + return 1; + } + s = b + 1; /* skip the first slash */ + + c = s; + for (;;) { + if (((*s == '/') && + ((s[1] >= 'A') && (s[1] <= 'Z') && ((s[2] == '=') || + ((s[2] >= 'A') + && (s[2] <= 'Z') + && (s[3] == '=')) + ))) || (*s == '\0')) { + i = s - c; + if (BIO_write(bp, c, i) != i) + goto err; + c = s + 1; /* skip following slash */ + if (*s != '\0') { + if (BIO_write(bp, ", ", 2) != 2) + goto err; + } + l--; + } + if (*s == '\0') + break; + s++; + l--; + } + + ret = 1; + if (0) { + err: + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + } + OPENSSL_free(b); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back new file mode 100644 index 0000000..e45a765 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back @@ -0,0 +1,544 @@ +/* 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 "internal.h" + + +#ifndef OPENSSL_NO_FP_API +int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, + unsigned long cflag) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + return 0; + } + int ret = X509_print_ex(b, x, nmflag, cflag); + BIO_free(b); + return ret; +} + +int X509_print_fp(FILE *fp, X509 *x) +{ + return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} +#endif + +int X509_print(BIO *bp, X509 *x) +{ + return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); +} + +int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, + unsigned long cflag) +{ + long l; + int ret = 0, i; + char *m = NULL, mlch = ' '; + int nmindent = 0; + X509_CINF *ci; + ASN1_INTEGER *bs; + EVP_PKEY *pkey = NULL; + const char *neg; + + if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { + mlch = '\n'; + nmindent = 12; + } + + if (nmflags == X509_FLAG_COMPAT) + nmindent = 16; + + ci = x->cert_info; + if (!(cflag & X509_FLAG_NO_HEADER)) { + if (BIO_write(bp, "Certificate:\n", 13) <= 0) + goto err; + if (BIO_write(bp, " Data:\n", 10) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_VERSION)) { + l = X509_get_version(x); + if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_SERIAL)) { + + if (BIO_write(bp, " Serial Number:", 22) <= 0) + goto err; + + bs = X509_get_serialNumber(x); + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { + l = ASN1_INTEGER_get(bs); + if (bs->type == V_ASN1_NEG_INTEGER) { + l = -l; + neg = "-"; + } else + neg = ""; + if (BIO_printf(bp, " %s%lu (%s0x%lx)\n", neg, l, neg, l) <= 0) + goto err; + } else { + neg = (bs->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : ""; + if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0) + goto err; + + for (i = 0; i < bs->length; i++) { + if (BIO_printf(bp, "%02x%c", bs->data[i], + ((i + 1 == bs->length) ? '\n' : ':')) <= 0) + goto err; + } + } + + } + + if (!(cflag & X509_FLAG_NO_SIGNAME)) { + if (X509_signature_print(bp, ci->signature, NULL) <= 0) + goto err; + } + + if (!(cflag & X509_FLAG_NO_ISSUER)) { + if (BIO_printf(bp, " Issuer:%c", mlch) <= 0) + goto err; + if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags) + < 0) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_VALIDITY)) { + if (BIO_write(bp, " Validity\n", 17) <= 0) + goto err; + if (BIO_write(bp, " Not Before: ", 24) <= 0) + goto err; + if (!ASN1_TIME_print(bp, X509_get_notBefore(x))) + goto err; + if (BIO_write(bp, "\n Not After : ", 25) <= 0) + goto err; + if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_SUBJECT)) { + if (BIO_printf(bp, " Subject:%c", mlch) <= 0) + goto err; + if (X509_NAME_print_ex + (bp, X509_get_subject_name(x), nmindent, nmflags) < 0) + goto err; + if (BIO_write(bp, "\n", 1) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_PUBKEY)) { + if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0) + goto err; + if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0) + goto err; + if (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0) + goto err; + if (BIO_puts(bp, "\n") <= 0) + goto err; + + pkey = X509_get_pubkey(x); + if (pkey == NULL) { + BIO_printf(bp, "%12sUnable to load Public Key\n", ""); + ERR_print_errors(bp); + } else { + EVP_PKEY_print_public(bp, pkey, 16, NULL); + EVP_PKEY_free(pkey); + } + } + + if (!(cflag & X509_FLAG_NO_IDS)) { + if (ci->issuerUID) { + if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0) + goto err; + if (!X509_signature_dump(bp, ci->issuerUID, 12)) + goto err; + } + if (ci->subjectUID) { + if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0) + goto err; + if (!X509_signature_dump(bp, ci->subjectUID, 12)) + goto err; + } + } + + if (!(cflag & X509_FLAG_NO_EXTENSIONS)) + X509V3_extensions_print(bp, "X509v3 extensions", + ci->extensions, cflag, 8); + + if (!(cflag & X509_FLAG_NO_SIGDUMP)) { + if (X509_signature_print(bp, x->sig_alg, x->signature) <= 0) + goto err; + } + if (!(cflag & X509_FLAG_NO_AUX)) { + if (!X509_CERT_AUX_print(bp, x->aux, 0)) + goto err; + } + ret = 1; + err: + if (m != NULL) + OPENSSL_free(m); + return (ret); +} + +int X509_ocspid_print(BIO *bp, X509 *x) +{ + unsigned char *der = NULL; + unsigned char *dertmp; + int derlen; + int i; + unsigned char SHA1md[SHA_DIGEST_LENGTH]; + + /* + * display the hash of the subject as it would appear in OCSP requests + */ + if (BIO_printf(bp, " Subject OCSP hash: ") <= 0) + goto err; + derlen = i2d_X509_NAME(x->cert_info->subject, NULL); + if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL) + goto err; + i2d_X509_NAME(x->cert_info->subject, &dertmp); + + if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) + goto err; + for (i = 0; i < SHA_DIGEST_LENGTH; i++) { + if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) + goto err; + } + OPENSSL_free(der); + der = NULL; + + /* + * display the hash of the public key as it would appear in OCSP requests + */ + if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0) + goto err; + + if (!EVP_Digest(x->cert_info->key->public_key->data, + x->cert_info->key->public_key->length, + SHA1md, NULL, EVP_sha1(), NULL)) + goto err; + for (i = 0; i < SHA_DIGEST_LENGTH; i++) { + if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) + goto err; + } + BIO_printf(bp, "\n"); + + return (1); + err: + if (der != NULL) + OPENSSL_free(der); + return (0); +} + +int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, + const ASN1_STRING *sig) +{ + if (BIO_puts(bp, " Signature Algorithm: ") <= 0) + return 0; + if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) + return 0; + + /* RSA-PSS signatures have parameters to print. */ + int sig_nid = OBJ_obj2nid(sigalg->algorithm); + if (sig_nid == NID_rsassaPss && + !x509_print_rsa_pss_params(bp, sigalg, 9, 0)) { + return 0; + } + + if (sig) + return X509_signature_dump(bp, sig, 9); + else if (BIO_puts(bp, "\n") <= 0) + return 0; + return 1; +} + +int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v) +{ + int i, n; + char buf[80]; + const char *p; + + if (v == NULL) + return (0); + n = 0; + p = (const char *)v->data; + for (i = 0; i < v->length; i++) { + if ((p[i] > '~') || ((p[i] < ' ') && + (p[i] != '\n') && (p[i] != '\r'))) + buf[n] = '.'; + else + buf[n] = p[i]; + n++; + if (n >= 80) { + if (BIO_write(bp, buf, n) <= 0) + return (0); + n = 0; + } + } + if (n > 0) + if (BIO_write(bp, buf, n) <= 0) + return (0); + return (1); +} + +int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) +{ + if (tm->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_print(bp, tm); + if (tm->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_print(bp, tm); + BIO_write(bp, "Bad time value", 14); + return (0); +} + +static const char *const mon[12] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +}; + +int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) +{ + char *v; + int gmt = 0; + int i; + int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; + char *f = NULL; + int f_len = 0; + + i = tm->length; + v = (char *)tm->data; + + if (i < 12) + goto err; + if (v[i - 1] == 'Z') + gmt = 1; + for (i = 0; i < 12; i++) + if ((v[i] > '9') || (v[i] < '0')) + goto err; + y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - + '0'); + M = (v[4] - '0') * 10 + (v[5] - '0'); + if ((M > 12) || (M < 1)) + goto err; + d = (v[6] - '0') * 10 + (v[7] - '0'); + h = (v[8] - '0') * 10 + (v[9] - '0'); + m = (v[10] - '0') * 10 + (v[11] - '0'); + if (tm->length >= 14 && + (v[12] >= '0') && (v[12] <= '9') && + (v[13] >= '0') && (v[13] <= '9')) { + s = (v[12] - '0') * 10 + (v[13] - '0'); + /* Check for fractions of seconds. */ + if (tm->length >= 15 && v[14] == '.') { + int l = tm->length; + f = &v[14]; /* The decimal point. */ + f_len = 1; + while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') + ++f_len; + } + } + + if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", + mon[M - 1], d, h, m, s, f_len, f, y, + (gmt) ? " GMT" : "") <= 0) + return (0); + else + return (1); + err: + BIO_write(bp, "Bad time value", 14); + return (0); +} + +// consume_two_digits is a helper function for ASN1_UTCTIME_print. If |*v|, +// assumed to be |*len| bytes long, has two leading digits, updates |*out| with +// their value, updates |v| and |len|, and returns one. Otherwise, returns +// zero. +static int consume_two_digits(int* out, const char **v, int *len) { + if (*len < 2|| !isdigit((*v)[0]) || !isdigit((*v)[1])) { + return 0; + } + *out = ((*v)[0] - '0') * 10 + ((*v)[1] - '0'); + *len -= 2; + *v += 2; + return 1; +} + +// consume_zulu_timezone is a helper function for ASN1_UTCTIME_print. If |*v|, +// assumed to be |*len| bytes long, starts with "Z" then it updates |*v| and +// |*len| and returns one. Otherwise returns zero. +static int consume_zulu_timezone(const char **v, int *len) { + if (*len == 0 || (*v)[0] != 'Z') { + return 0; + } + + *len -= 1; + *v += 1; + return 1; +} + +int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) { + const char *v = (const char *)tm->data; + int len = tm->length; + int Y = 0, M = 0, D = 0, h = 0, m = 0, s = 0; + + // YYMMDDhhmm are required to be present. + if (!consume_two_digits(&Y, &v, &len) || + !consume_two_digits(&M, &v, &len) || + !consume_two_digits(&D, &v, &len) || + !consume_two_digits(&h, &v, &len) || + !consume_two_digits(&m, &v, &len)) { + goto err; + } + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, requires seconds + // to be present, but historically this code has forgiven its absence. + consume_two_digits(&s, &v, &len); + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, specifies this + // interpretation of the year. + if (Y < 50) { + Y += 2000; + } else { + Y += 1900; + } + if (M > 12 || M == 0) { + goto err; + } + if (D > 31 || D == 0) { + goto err; + } + if (h > 23 || m > 59 || s > 60) { + goto err; + } + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, requires the "Z" + // to be present, but historically this code has forgiven its absence. + const int is_gmt = consume_zulu_timezone(&v, &len); + + // https://tools.ietf.org/html/rfc5280, section 4.1.2.5.1, does not permit + // the specification of timezones using the +hhmm / -hhmm syntax, which is + // the only other thing that might legitimately be found at the end. + if (len) { + goto err; + } + + return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", mon[M - 1], D, h, m, s, Y, + is_gmt ? " GMT" : "") > 0; + +err: + BIO_write(bp, "Bad time value", 14); + return 0; +} + +int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) +{ + char *s, *c, *b; + int ret = 0, l, i; + + l = 80 - 2 - obase; + + b = X509_NAME_oneline(name, NULL, 0); + if (!b) + return 0; + if (!*b) { + OPENSSL_free(b); + return 1; + } + s = b + 1; /* skip the first slash */ + + c = s; + for (;;) { + if (((*s == '/') && + ((s[1] >= 'A') && (s[1] <= 'Z') && ((s[2] == '=') || + ((s[2] >= 'A') + && (s[2] <= 'Z') + && (s[3] == '=')) + ))) || (*s == '\0')) { + i = s - c; + if (BIO_write(bp, c, i) != i) + goto err; + c = s + 1; /* skip following slash */ + if (*s != '\0') { + if (BIO_write(bp, ", ", 2) != 2) + goto err; + } + l--; + } + if (*s == '\0') + break; + s++; + l--; + } + + ret = 1; + if (0) { + err: + OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); + } + OPENSSL_free(b); + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c new file mode 100644 index 0000000..89d7fce --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c @@ -0,0 +1,111 @@ +/* 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 + +/* X509_CERT_AUX and string set routines */ + +int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent) +{ + char oidstr[80], first; + size_t i; + int j; + if (!aux) + return 1; + if (aux->trust) { + first = 1; + BIO_printf(out, "%*sTrusted Uses:\n%*s", indent, "", indent + 2, ""); + for (i = 0; i < sk_ASN1_OBJECT_num(aux->trust); i++) { + if (!first) + BIO_puts(out, ", "); + else + first = 0; + OBJ_obj2txt(oidstr, sizeof oidstr, + sk_ASN1_OBJECT_value(aux->trust, i), 0); + BIO_puts(out, oidstr); + } + BIO_puts(out, "\n"); + } else + BIO_printf(out, "%*sNo Trusted Uses.\n", indent, ""); + if (aux->reject) { + first = 1; + BIO_printf(out, "%*sRejected Uses:\n%*s", indent, "", indent + 2, ""); + for (i = 0; i < sk_ASN1_OBJECT_num(aux->reject); i++) { + if (!first) + BIO_puts(out, ", "); + else + first = 0; + OBJ_obj2txt(oidstr, sizeof oidstr, + sk_ASN1_OBJECT_value(aux->reject, i), 0); + BIO_puts(out, oidstr); + } + BIO_puts(out, "\n"); + } else + BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); + if (aux->alias) + BIO_printf(out, "%*sAlias: %s\n", indent, "", aux->alias->data); + if (aux->keyid) { + BIO_printf(out, "%*sKey Id: ", indent, ""); + for (j = 0; j < aux->keyid->length; j++) + BIO_printf(out, "%s%02X", j ? ":" : "", aux->keyid->data[j]); + BIO_write(out, "\n", 1); + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c.grpc_back new file mode 100644 index 0000000..5436828 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c.grpc_back @@ -0,0 +1,111 @@ +/* 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 + +/* X509_CERT_AUX and string set routines */ + +int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent) +{ + char oidstr[80], first; + size_t i; + int j; + if (!aux) + return 1; + if (aux->trust) { + first = 1; + BIO_printf(out, "%*sTrusted Uses:\n%*s", indent, "", indent + 2, ""); + for (i = 0; i < sk_ASN1_OBJECT_num(aux->trust); i++) { + if (!first) + BIO_puts(out, ", "); + else + first = 0; + OBJ_obj2txt(oidstr, sizeof oidstr, + sk_ASN1_OBJECT_value(aux->trust, i), 0); + BIO_puts(out, oidstr); + } + BIO_puts(out, "\n"); + } else + BIO_printf(out, "%*sNo Trusted Uses.\n", indent, ""); + if (aux->reject) { + first = 1; + BIO_printf(out, "%*sRejected Uses:\n%*s", indent, "", indent + 2, ""); + for (i = 0; i < sk_ASN1_OBJECT_num(aux->reject); i++) { + if (!first) + BIO_puts(out, ", "); + else + first = 0; + OBJ_obj2txt(oidstr, sizeof oidstr, + sk_ASN1_OBJECT_value(aux->reject, i), 0); + BIO_puts(out, oidstr); + } + BIO_puts(out, "\n"); + } else + BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); + if (aux->alias) + BIO_printf(out, "%*sAlias: %s\n", indent, "", aux->alias->data); + if (aux->keyid) { + BIO_printf(out, "%*sKey Id: ", indent, ""); + for (j = 0; j < aux->keyid->length; j++) + BIO_printf(out, "%s%02X", j ? ":" : "", aux->keyid->data[j]); + BIO_write(out, "\n", 1); + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h new file mode 100644 index 0000000..53b4a0d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h @@ -0,0 +1,71 @@ +/* vpm_int.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2013. + */ +/* ==================================================================== + * Copyright (c) 2013 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). + * + */ + +/* internal only structure to hold additional X509_VERIFY_PARAM data */ + +struct X509_VERIFY_PARAM_ID_st { + STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */ + unsigned int hostflags; /* Flags to control matching features */ + char *peername; /* Matching hostname in peer certificate */ + char *email; /* If not NULL email address to match */ + size_t emaillen; + unsigned char *ip; /* If not NULL IP address to match */ + size_t iplen; /* Length of IP address */ + unsigned char poison; /* Fail all verifications */ +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h.grpc_back new file mode 100644 index 0000000..53b4a0d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h.grpc_back @@ -0,0 +1,71 @@ +/* vpm_int.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2013. + */ +/* ==================================================================== + * Copyright (c) 2013 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). + * + */ + +/* internal only structure to hold additional X509_VERIFY_PARAM data */ + +struct X509_VERIFY_PARAM_ID_st { + STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */ + unsigned int hostflags; /* Flags to control matching features */ + char *peername; /* Matching hostname in peer certificate */ + char *email; /* If not NULL email address to match */ + size_t emaillen; + unsigned char *ip; /* If not NULL IP address to match */ + size_t iplen; /* Length of IP address */ + unsigned char poison; /* Fail all verifications */ +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c new file mode 100644 index 0000000..fd217c9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c @@ -0,0 +1,157 @@ +/* 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 + + +/* |X509_R_UNSUPPORTED_ALGORITHM| is no longer emitted, but continue to define + * it to avoid downstream churn. */ +OPENSSL_DECLARE_ERROR_REASON(X509, UNSUPPORTED_ALGORITHM) + +int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, + int ptype, void *pval, uint8_t *penc, int penclen) { + uint8_t **ppenc = NULL; + if (version >= 0) { + if (!ASN1_INTEGER_set(priv->version, version)) { + return 0; + } + } + + if (penc) { + int pmtype; + ASN1_OCTET_STRING *oct; + + oct = ASN1_OCTET_STRING_new(); + if (!oct) { + return 0; + } + oct->data = penc; + ppenc = &oct->data; + oct->length = penclen; + if (priv->broken == PKCS8_NO_OCTET) { + pmtype = V_ASN1_SEQUENCE; + } else { + pmtype = V_ASN1_OCTET_STRING; + } + ASN1_TYPE_set(priv->pkey, pmtype, oct); + } + + if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval)) { + /* If call fails do not swallow 'enc' */ + if (ppenc) { + *ppenc = NULL; + } + return 0; + } + + return 1; +} + +int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, const uint8_t **pk, int *ppklen, + X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8) { + if (ppkalg) { + *ppkalg = p8->pkeyalg->algorithm; + } + + if (p8->pkey->type == V_ASN1_OCTET_STRING) { + p8->broken = PKCS8_OK; + if (pk) { + *pk = p8->pkey->value.octet_string->data; + *ppklen = p8->pkey->value.octet_string->length; + } + } else if (p8->pkey->type == V_ASN1_SEQUENCE) { + p8->broken = PKCS8_NO_OCTET; + if (pk) { + *pk = p8->pkey->value.sequence->data; + *ppklen = p8->pkey->value.sequence->length; + } + } else { + return 0; + } + + if (pa) { + *pa = p8->pkeyalg; + } + return 1; +} + +int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) { + const uint8_t *s; + int i, n; + + n = sig->length; + s = sig->data; + for (i = 0; i < n; i++) { + if ((i % 18) == 0) { + if (BIO_write(bp, "\n", 1) <= 0 || + BIO_indent(bp, indent, indent) <= 0) { + return 0; + } + } + if (BIO_printf(bp, "%02x%s", s[i], ((i + 1) == n) ? "" : ":") <= 0) { + return 0; + } + } + if (BIO_write(bp, "\n", 1) != 1) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c.grpc_back new file mode 100644 index 0000000..188fd49 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c.grpc_back @@ -0,0 +1,157 @@ +/* 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 + + +/* |X509_R_UNSUPPORTED_ALGORITHM| is no longer emitted, but continue to define + * it to avoid downstream churn. */ +OPENSSL_DECLARE_ERROR_REASON(X509, UNSUPPORTED_ALGORITHM) + +int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, + int ptype, void *pval, uint8_t *penc, int penclen) { + uint8_t **ppenc = NULL; + if (version >= 0) { + if (!ASN1_INTEGER_set(priv->version, version)) { + return 0; + } + } + + if (penc) { + int pmtype; + ASN1_OCTET_STRING *oct; + + oct = ASN1_OCTET_STRING_new(); + if (!oct) { + return 0; + } + oct->data = penc; + ppenc = &oct->data; + oct->length = penclen; + if (priv->broken == PKCS8_NO_OCTET) { + pmtype = V_ASN1_SEQUENCE; + } else { + pmtype = V_ASN1_OCTET_STRING; + } + ASN1_TYPE_set(priv->pkey, pmtype, oct); + } + + if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval)) { + /* If call fails do not swallow 'enc' */ + if (ppenc) { + *ppenc = NULL; + } + return 0; + } + + return 1; +} + +int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, const uint8_t **pk, int *ppklen, + X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8) { + if (ppkalg) { + *ppkalg = p8->pkeyalg->algorithm; + } + + if (p8->pkey->type == V_ASN1_OCTET_STRING) { + p8->broken = PKCS8_OK; + if (pk) { + *pk = p8->pkey->value.octet_string->data; + *ppklen = p8->pkey->value.octet_string->length; + } + } else if (p8->pkey->type == V_ASN1_SEQUENCE) { + p8->broken = PKCS8_NO_OCTET; + if (pk) { + *pk = p8->pkey->value.sequence->data; + *ppklen = p8->pkey->value.sequence->length; + } + } else { + return 0; + } + + if (pa) { + *pa = p8->pkeyalg; + } + return 1; +} + +int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) { + const uint8_t *s; + int i, n; + + n = sig->length; + s = sig->data; + for (i = 0; i < n; i++) { + if ((i % 18) == 0) { + if (BIO_write(bp, "\n", 1) <= 0 || + BIO_indent(bp, indent, indent) <= 0) { + return 0; + } + } + if (BIO_printf(bp, "%02x%s", s[i], ((i + 1) == n) ? "" : ":") <= 0) { + return 0; + } + } + if (BIO_write(bp, "\n", 1) != 1) { + return 0; + } + + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c new file mode 100644 index 0000000..9b5ee59 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c @@ -0,0 +1,381 @@ +/* crypto/x509/x509_att.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 + +int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) +{ + return sk_X509_ATTRIBUTE_num(x); +} + +int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509at_get_attr_by_OBJ(x, obj, lastpos)); +} + +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos) +{ + int n; + X509_ATTRIBUTE *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_ATTRIBUTE_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_ATTRIBUTE_value(sk, lastpos); + if (OBJ_cmp(ex->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) +{ + if (x == NULL || loc < 0 || sk_X509_ATTRIBUTE_num(x) <= (size_t)loc) + return NULL; + else + return sk_X509_ATTRIBUTE_value(x, loc); +} + +X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) +{ + X509_ATTRIBUTE *ret; + + if (x == NULL || loc < 0 || sk_X509_ATTRIBUTE_num(x) <= (size_t)loc) + return (NULL); + ret = sk_X509_ATTRIBUTE_delete(x, loc); + return (ret); +} + +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr) +{ + X509_ATTRIBUTE *new_attr = NULL; + STACK_OF(X509_ATTRIBUTE) *sk = NULL; + + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + goto err2; + } + + if (*x == NULL) { + if ((sk = sk_X509_ATTRIBUTE_new_null()) == NULL) + goto err; + } else + sk = *x; + + if ((new_attr = X509_ATTRIBUTE_dup(attr)) == NULL) + goto err2; + if (!sk_X509_ATTRIBUTE_push(sk, new_attr)) + goto err; + if (*x == NULL) + *x = sk; + return (sk); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + err2: + if (new_attr != NULL) + X509_ATTRIBUTE_free(new_attr); + if (sk != NULL) + sk_X509_ATTRIBUTE_free(sk); + return (NULL); +} + +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) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + **x, int nid, int type, + const unsigned char *bytes, + int len) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +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) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + ASN1_OBJECT *obj, int lastpos, int type) +{ + int i; + X509_ATTRIBUTE *at; + i = X509at_get_attr_by_OBJ(x, obj, lastpos); + if (i == -1) + return NULL; + if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1)) + return NULL; + at = X509at_get_attr(x, i); + if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1)) + return NULL; + return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, + int len) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return (NULL); + } + return X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, + int atrtype, const void *data, + int len) +{ + X509_ATTRIBUTE *ret; + + if ((attr == NULL) || (*attr == NULL)) { + if ((ret = X509_ATTRIBUTE_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + } else + ret = *attr; + + if (!X509_ATTRIBUTE_set1_object(ret, obj)) + goto err; + if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len)) + goto err; + + if ((attr != NULL) && (*attr == NULL)) + *attr = ret; + return (ret); + err: + if ((attr == NULL) || (ret != *attr)) + X509_ATTRIBUTE_free(ret); + return (NULL); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, + const unsigned char *bytes, + int len) +{ + ASN1_OBJECT *obj; + X509_ATTRIBUTE *nattr; + + obj = OBJ_txt2obj(atrname, 0); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_FIELD_NAME); + ERR_add_error_data(2, "name=", atrname); + return (NULL); + } + nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len); + ASN1_OBJECT_free(obj); + return nattr; +} + +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) +{ + if ((attr == NULL) || (obj == NULL)) + return (0); + ASN1_OBJECT_free(attr->object); + attr->object = OBJ_dup(obj); + return attr->object != NULL; +} + +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, + const void *data, int len) +{ + ASN1_TYPE *ttmp = NULL; + ASN1_STRING *stmp = NULL; + int atype = 0; + if (!attr) + return 0; + if (attrtype & MBSTRING_FLAG) { + stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype, + OBJ_obj2nid(attr->object)); + if (!stmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + return 0; + } + atype = stmp->type; + } else if (len != -1) { + if (!(stmp = ASN1_STRING_type_new(attrtype))) + goto err; + if (!ASN1_STRING_set(stmp, data, len)) + goto err; + atype = attrtype; + } + if (!(attr->value.set = sk_ASN1_TYPE_new_null())) + goto err; + attr->single = 0; + /* + * This is a bit naughty because the attribute should really have at + * least one value but some types use and zero length SET and require + * this. + */ + if (attrtype == 0) { + ASN1_STRING_free(stmp); + return 1; + } + if (!(ttmp = ASN1_TYPE_new())) + goto err; + if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { + if (!ASN1_TYPE_set1(ttmp, attrtype, data)) + goto err; + } else { + ASN1_TYPE_set(ttmp, atype, stmp); + stmp = NULL; + } + if (!sk_ASN1_TYPE_push(attr->value.set, ttmp)) + goto err; + return 1; + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ASN1_TYPE_free(ttmp); + ASN1_STRING_free(stmp); + return 0; +} + +int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) +{ + if (!attr->single) + return sk_ASN1_TYPE_num(attr->value.set); + if (attr->value.single) + return 1; + return 0; +} + +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) +{ + if (attr == NULL) + return (NULL); + return (attr->object); +} + +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, + int atrtype, void *data) +{ + ASN1_TYPE *ttmp; + ttmp = X509_ATTRIBUTE_get0_type(attr, idx); + if (!ttmp) + return NULL; + if (atrtype != ASN1_TYPE_get(ttmp)) { + OPENSSL_PUT_ERROR(X509, X509_R_WRONG_TYPE); + return NULL; + } + return ttmp->value.ptr; +} + +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) +{ + if (attr == NULL) + return (NULL); + if (idx >= X509_ATTRIBUTE_count(attr)) + return NULL; + if (!attr->single) + return sk_ASN1_TYPE_value(attr->value.set, idx); + else + return attr->value.single; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c.grpc_back new file mode 100644 index 0000000..85d65e7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c.grpc_back @@ -0,0 +1,381 @@ +/* crypto/x509/x509_att.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 + +int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) +{ + return sk_X509_ATTRIBUTE_num(x); +} + +int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509at_get_attr_by_OBJ(x, obj, lastpos)); +} + +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos) +{ + int n; + X509_ATTRIBUTE *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_ATTRIBUTE_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_ATTRIBUTE_value(sk, lastpos); + if (OBJ_cmp(ex->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) +{ + if (x == NULL || loc < 0 || sk_X509_ATTRIBUTE_num(x) <= (size_t)loc) + return NULL; + else + return sk_X509_ATTRIBUTE_value(x, loc); +} + +X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) +{ + X509_ATTRIBUTE *ret; + + if (x == NULL || loc < 0 || sk_X509_ATTRIBUTE_num(x) <= (size_t)loc) + return (NULL); + ret = sk_X509_ATTRIBUTE_delete(x, loc); + return (ret); +} + +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr) +{ + X509_ATTRIBUTE *new_attr = NULL; + STACK_OF(X509_ATTRIBUTE) *sk = NULL; + + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + goto err2; + } + + if (*x == NULL) { + if ((sk = sk_X509_ATTRIBUTE_new_null()) == NULL) + goto err; + } else + sk = *x; + + if ((new_attr = X509_ATTRIBUTE_dup(attr)) == NULL) + goto err2; + if (!sk_X509_ATTRIBUTE_push(sk, new_attr)) + goto err; + if (*x == NULL) + *x = sk; + return (sk); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + err2: + if (new_attr != NULL) + X509_ATTRIBUTE_free(new_attr); + if (sk != NULL) + sk_X509_ATTRIBUTE_free(sk); + return (NULL); +} + +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) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + **x, int nid, int type, + const unsigned char *bytes, + int len) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +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) +{ + X509_ATTRIBUTE *attr; + STACK_OF(X509_ATTRIBUTE) *ret; + attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len); + if (!attr) + return 0; + ret = X509at_add1_attr(x, attr); + X509_ATTRIBUTE_free(attr); + return ret; +} + +void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + ASN1_OBJECT *obj, int lastpos, int type) +{ + int i; + X509_ATTRIBUTE *at; + i = X509at_get_attr_by_OBJ(x, obj, lastpos); + if (i == -1) + return NULL; + if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1)) + return NULL; + at = X509at_get_attr(x, i); + if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1)) + return NULL; + return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, + int len) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return (NULL); + } + return X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, + int atrtype, const void *data, + int len) +{ + X509_ATTRIBUTE *ret; + + if ((attr == NULL) || (*attr == NULL)) { + if ((ret = X509_ATTRIBUTE_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + } else + ret = *attr; + + if (!X509_ATTRIBUTE_set1_object(ret, obj)) + goto err; + if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len)) + goto err; + + if ((attr != NULL) && (*attr == NULL)) + *attr = ret; + return (ret); + err: + if ((attr == NULL) || (ret != *attr)) + X509_ATTRIBUTE_free(ret); + return (NULL); +} + +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, + const unsigned char *bytes, + int len) +{ + ASN1_OBJECT *obj; + X509_ATTRIBUTE *nattr; + + obj = OBJ_txt2obj(atrname, 0); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_FIELD_NAME); + ERR_add_error_data(2, "name=", atrname); + return (NULL); + } + nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len); + ASN1_OBJECT_free(obj); + return nattr; +} + +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) +{ + if ((attr == NULL) || (obj == NULL)) + return (0); + ASN1_OBJECT_free(attr->object); + attr->object = OBJ_dup(obj); + return attr->object != NULL; +} + +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, + const void *data, int len) +{ + ASN1_TYPE *ttmp = NULL; + ASN1_STRING *stmp = NULL; + int atype = 0; + if (!attr) + return 0; + if (attrtype & MBSTRING_FLAG) { + stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype, + OBJ_obj2nid(attr->object)); + if (!stmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + return 0; + } + atype = stmp->type; + } else if (len != -1) { + if (!(stmp = ASN1_STRING_type_new(attrtype))) + goto err; + if (!ASN1_STRING_set(stmp, data, len)) + goto err; + atype = attrtype; + } + if (!(attr->value.set = sk_ASN1_TYPE_new_null())) + goto err; + attr->single = 0; + /* + * This is a bit naughty because the attribute should really have at + * least one value but some types use and zero length SET and require + * this. + */ + if (attrtype == 0) { + ASN1_STRING_free(stmp); + return 1; + } + if (!(ttmp = ASN1_TYPE_new())) + goto err; + if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { + if (!ASN1_TYPE_set1(ttmp, attrtype, data)) + goto err; + } else { + ASN1_TYPE_set(ttmp, atype, stmp); + stmp = NULL; + } + if (!sk_ASN1_TYPE_push(attr->value.set, ttmp)) + goto err; + return 1; + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ASN1_TYPE_free(ttmp); + ASN1_STRING_free(stmp); + return 0; +} + +int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) +{ + if (!attr->single) + return sk_ASN1_TYPE_num(attr->value.set); + if (attr->value.single) + return 1; + return 0; +} + +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) +{ + if (attr == NULL) + return (NULL); + return (attr->object); +} + +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, + int atrtype, void *data) +{ + ASN1_TYPE *ttmp; + ttmp = X509_ATTRIBUTE_get0_type(attr, idx); + if (!ttmp) + return NULL; + if (atrtype != ASN1_TYPE_get(ttmp)) { + OPENSSL_PUT_ERROR(X509, X509_R_WRONG_TYPE); + return NULL; + } + return ttmp->value.ptr; +} + +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) +{ + if (attr == NULL) + return (NULL); + if (idx >= X509_ATTRIBUTE_count(attr)) + return NULL; + if (!attr->single) + return sk_ASN1_TYPE_value(attr->value.set, idx); + else + return attr->value.single; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c new file mode 100644 index 0000000..5d7c02f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c @@ -0,0 +1,476 @@ +/* crypto/x509/x509_cmp.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 "../internal.h" + + +int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b) +{ + int i; + X509_CINF *ai, *bi; + + ai = a->cert_info; + bi = b->cert_info; + i = M_ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber); + if (i) + return (i); + return (X509_NAME_cmp(ai->issuer, bi->issuer)); +} + +unsigned long X509_issuer_and_serial_hash(X509 *a) +{ + unsigned long ret = 0; + EVP_MD_CTX ctx; + unsigned char md[16]; + char *f; + + EVP_MD_CTX_init(&ctx); + f = X509_NAME_oneline(a->cert_info->issuer, NULL, 0); + if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) + goto err; + if (!EVP_DigestUpdate(&ctx, (unsigned char *)f, strlen(f))) + goto err; + OPENSSL_free(f); + if (!EVP_DigestUpdate + (&ctx, (unsigned char *)a->cert_info->serialNumber->data, + (unsigned long)a->cert_info->serialNumber->length)) + goto err; + if (!EVP_DigestFinal_ex(&ctx, &(md[0]), NULL)) + goto err; + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + err: + EVP_MD_CTX_cleanup(&ctx); + return (ret); +} + +int X509_issuer_name_cmp(const X509 *a, const X509 *b) +{ + return (X509_NAME_cmp(a->cert_info->issuer, b->cert_info->issuer)); +} + +int X509_subject_name_cmp(const X509 *a, const X509 *b) +{ + return (X509_NAME_cmp(a->cert_info->subject, b->cert_info->subject)); +} + +int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b) +{ + return (X509_NAME_cmp(a->crl->issuer, b->crl->issuer)); +} + +int X509_CRL_match(const X509_CRL *a, const X509_CRL *b) +{ + return OPENSSL_memcmp(a->sha1_hash, b->sha1_hash, 20); +} + +X509_NAME *X509_get_issuer_name(X509 *a) +{ + return (a->cert_info->issuer); +} + +unsigned long X509_issuer_name_hash(X509 *x) +{ + return (X509_NAME_hash(x->cert_info->issuer)); +} + +unsigned long X509_issuer_name_hash_old(X509 *x) +{ + return (X509_NAME_hash_old(x->cert_info->issuer)); +} + +X509_NAME *X509_get_subject_name(X509 *a) +{ + return (a->cert_info->subject); +} + +ASN1_INTEGER *X509_get_serialNumber(X509 *a) +{ + return (a->cert_info->serialNumber); +} + +unsigned long X509_subject_name_hash(X509 *x) +{ + return (X509_NAME_hash(x->cert_info->subject)); +} + +unsigned long X509_subject_name_hash_old(X509 *x) +{ + return (X509_NAME_hash_old(x->cert_info->subject)); +} + +/* + * Compare two certificates: they must be identical for this to work. NB: + * Although "cmp" operations are generally prototyped to take "const" + * arguments (eg. for use in STACKs), the way X509 handling is - these + * operations may involve ensuring the hashes are up-to-date and ensuring + * certain cert information is cached. So this is the point where the + * "depth-first" constification tree has to halt with an evil cast. + */ +int X509_cmp(const X509 *a, const X509 *b) +{ + int rv; + /* ensure hash is valid */ + X509_check_purpose((X509 *)a, -1, 0); + X509_check_purpose((X509 *)b, -1, 0); + + rv = OPENSSL_memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); + if (rv) + return rv; + /* Check for match against stored encoding too */ + if (!a->cert_info->enc.modified && !b->cert_info->enc.modified) { + rv = (int)(a->cert_info->enc.len - b->cert_info->enc.len); + if (rv) + return rv; + return OPENSSL_memcmp(a->cert_info->enc.enc, b->cert_info->enc.enc, + a->cert_info->enc.len); + } + return rv; +} + +int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b) +{ + int ret; + + /* Ensure canonical encoding is present and up to date */ + + if (!a->canon_enc || a->modified) { + ret = i2d_X509_NAME((X509_NAME *)a, NULL); + if (ret < 0) + return -2; + } + + if (!b->canon_enc || b->modified) { + ret = i2d_X509_NAME((X509_NAME *)b, NULL); + if (ret < 0) + return -2; + } + + ret = a->canon_enclen - b->canon_enclen; + + if (ret) + return ret; + + return OPENSSL_memcmp(a->canon_enc, b->canon_enc, a->canon_enclen); + +} + +unsigned long X509_NAME_hash(X509_NAME *x) +{ + unsigned long ret = 0; + unsigned char md[SHA_DIGEST_LENGTH]; + + /* Make sure X509_NAME structure contains valid cached encoding */ + i2d_X509_NAME(x, NULL); + if (!EVP_Digest(x->canon_enc, x->canon_enclen, md, NULL, EVP_sha1(), + NULL)) + return 0; + + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + return (ret); +} + +/* + * I now DER encode the name and hash it. Since I cache the DER encoding, + * this is reasonably efficient. + */ + +unsigned long X509_NAME_hash_old(X509_NAME *x) +{ + EVP_MD_CTX md_ctx; + unsigned long ret = 0; + unsigned char md[16]; + + /* Make sure X509_NAME structure contains valid cached encoding */ + i2d_X509_NAME(x, NULL); + EVP_MD_CTX_init(&md_ctx); + /* EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); */ + if (EVP_DigestInit_ex(&md_ctx, EVP_md5(), NULL) + && EVP_DigestUpdate(&md_ctx, x->bytes->data, x->bytes->length) + && EVP_DigestFinal_ex(&md_ctx, md, NULL)) + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + EVP_MD_CTX_cleanup(&md_ctx); + + return (ret); +} + +/* Search a stack of X509 for a match */ +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name, + ASN1_INTEGER *serial) +{ + size_t i; + X509_CINF cinf; + X509 x, *x509 = NULL; + + if (!sk) + return NULL; + + x.cert_info = &cinf; + cinf.serialNumber = serial; + cinf.issuer = name; + + for (i = 0; i < sk_X509_num(sk); i++) { + x509 = sk_X509_value(sk, i); + if (X509_issuer_and_serial_cmp(x509, &x) == 0) + return (x509); + } + return (NULL); +} + +X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name) +{ + X509 *x509; + size_t i; + + for (i = 0; i < sk_X509_num(sk); i++) { + x509 = sk_X509_value(sk, i); + if (X509_NAME_cmp(X509_get_subject_name(x509), name) == 0) + return (x509); + } + return (NULL); +} + +EVP_PKEY *X509_get_pubkey(X509 *x) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (NULL); + return (X509_PUBKEY_get(x->cert_info->key)); +} + +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) +{ + if (!x) + return NULL; + return x->cert_info->key->public_key; +} + +int X509_check_private_key(X509 *x, const EVP_PKEY *k) +{ + EVP_PKEY *xk; + int ret; + + xk = X509_get_pubkey(x); + + if (xk) + ret = EVP_PKEY_cmp(xk, k); + else + ret = -2; + + switch (ret) { + case 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); + } + if (xk) + EVP_PKEY_free(xk); + if (ret > 0) + return 1; + return 0; +} + +/* + * Check a suite B algorithm is permitted: pass in a public key and the NID + * of its signature (or 0 if no signature). The pflags is a pointer to a + * flags field which must contain the suite B verification flags. + */ + +static int check_suite_b(EVP_PKEY *pkey, int sign_nid, unsigned long *pflags) +{ + const EC_GROUP *grp = NULL; + int curve_nid; + if (pkey && pkey->type == EVP_PKEY_EC) + grp = EC_KEY_get0_group(pkey->pkey.ec); + if (!grp) + return X509_V_ERR_SUITE_B_INVALID_ALGORITHM; + curve_nid = EC_GROUP_get_curve_name(grp); + /* Check curve is consistent with LOS */ + if (curve_nid == NID_secp384r1) { /* P-384 */ + /* + * Check signature algorithm is consistent with curve. + */ + if (sign_nid != -1 && sign_nid != NID_ecdsa_with_SHA384) + return X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM; + if (!(*pflags & X509_V_FLAG_SUITEB_192_LOS)) + return X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED; + /* If we encounter P-384 we cannot use P-256 later */ + *pflags &= ~X509_V_FLAG_SUITEB_128_LOS_ONLY; + } else if (curve_nid == NID_X9_62_prime256v1) { /* P-256 */ + if (sign_nid != -1 && sign_nid != NID_ecdsa_with_SHA256) + return X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM; + if (!(*pflags & X509_V_FLAG_SUITEB_128_LOS_ONLY)) + return X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED; + } else + return X509_V_ERR_SUITE_B_INVALID_CURVE; + + return X509_V_OK; +} + +int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain, + unsigned long flags) +{ + int rv, sign_nid; + size_t i; + EVP_PKEY *pk = NULL; + unsigned long tflags; + if (!(flags & X509_V_FLAG_SUITEB_128_LOS)) + return X509_V_OK; + tflags = flags; + /* If no EE certificate passed in must be first in chain */ + if (x == NULL) { + x = sk_X509_value(chain, 0); + i = 1; + } else + i = 0; + + if (X509_get_version(x) != 2) { + rv = X509_V_ERR_SUITE_B_INVALID_VERSION; + /* Correct error depth */ + i = 0; + goto end; + } + + pk = X509_get_pubkey(x); + /* Check EE key only */ + rv = check_suite_b(pk, -1, &tflags); + if (rv != X509_V_OK) { + /* Correct error depth */ + i = 0; + goto end; + } + for (; i < sk_X509_num(chain); i++) { + sign_nid = X509_get_signature_nid(x); + x = sk_X509_value(chain, i); + if (X509_get_version(x) != 2) { + rv = X509_V_ERR_SUITE_B_INVALID_VERSION; + goto end; + } + EVP_PKEY_free(pk); + pk = X509_get_pubkey(x); + rv = check_suite_b(pk, sign_nid, &tflags); + if (rv != X509_V_OK) + goto end; + } + + /* Final check: root CA signature */ + rv = check_suite_b(pk, X509_get_signature_nid(x), &tflags); + end: + if (pk) + EVP_PKEY_free(pk); + if (rv != X509_V_OK) { + /* Invalid signature or LOS errors are for previous cert */ + if ((rv == X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM + || rv == X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED) && i) + i--; + /* + * If we have LOS error and flags changed then we are signing P-384 + * with P-256. Use more meaninggul error. + */ + if (rv == X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED && flags != tflags) + rv = X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256; + if (perror_depth) + *perror_depth = i; + } + return rv; +} + +int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags) +{ + int sign_nid; + if (!(flags & X509_V_FLAG_SUITEB_128_LOS)) + return X509_V_OK; + sign_nid = OBJ_obj2nid(crl->crl->sig_alg->algorithm); + return check_suite_b(pk, sign_nid, &flags); +} + +/* + * Not strictly speaking an "up_ref" as a STACK doesn't have a reference + * count but it has the same effect by duping the STACK and upping the ref of + * each X509 structure. + */ +STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain) +{ + STACK_OF(X509) *ret; + size_t i; + ret = sk_X509_dup(chain); + for (i = 0; i < sk_X509_num(ret); i++) { + X509_up_ref(sk_X509_value(ret, i)); + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back new file mode 100644 index 0000000..28f2e95 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back @@ -0,0 +1,476 @@ +/* crypto/x509/x509_cmp.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 "../internal.h" + + +int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b) +{ + int i; + X509_CINF *ai, *bi; + + ai = a->cert_info; + bi = b->cert_info; + i = M_ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber); + if (i) + return (i); + return (X509_NAME_cmp(ai->issuer, bi->issuer)); +} + +unsigned long X509_issuer_and_serial_hash(X509 *a) +{ + unsigned long ret = 0; + EVP_MD_CTX ctx; + unsigned char md[16]; + char *f; + + EVP_MD_CTX_init(&ctx); + f = X509_NAME_oneline(a->cert_info->issuer, NULL, 0); + if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) + goto err; + if (!EVP_DigestUpdate(&ctx, (unsigned char *)f, strlen(f))) + goto err; + OPENSSL_free(f); + if (!EVP_DigestUpdate + (&ctx, (unsigned char *)a->cert_info->serialNumber->data, + (unsigned long)a->cert_info->serialNumber->length)) + goto err; + if (!EVP_DigestFinal_ex(&ctx, &(md[0]), NULL)) + goto err; + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + err: + EVP_MD_CTX_cleanup(&ctx); + return (ret); +} + +int X509_issuer_name_cmp(const X509 *a, const X509 *b) +{ + return (X509_NAME_cmp(a->cert_info->issuer, b->cert_info->issuer)); +} + +int X509_subject_name_cmp(const X509 *a, const X509 *b) +{ + return (X509_NAME_cmp(a->cert_info->subject, b->cert_info->subject)); +} + +int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b) +{ + return (X509_NAME_cmp(a->crl->issuer, b->crl->issuer)); +} + +int X509_CRL_match(const X509_CRL *a, const X509_CRL *b) +{ + return OPENSSL_memcmp(a->sha1_hash, b->sha1_hash, 20); +} + +X509_NAME *X509_get_issuer_name(X509 *a) +{ + return (a->cert_info->issuer); +} + +unsigned long X509_issuer_name_hash(X509 *x) +{ + return (X509_NAME_hash(x->cert_info->issuer)); +} + +unsigned long X509_issuer_name_hash_old(X509 *x) +{ + return (X509_NAME_hash_old(x->cert_info->issuer)); +} + +X509_NAME *X509_get_subject_name(X509 *a) +{ + return (a->cert_info->subject); +} + +ASN1_INTEGER *X509_get_serialNumber(X509 *a) +{ + return (a->cert_info->serialNumber); +} + +unsigned long X509_subject_name_hash(X509 *x) +{ + return (X509_NAME_hash(x->cert_info->subject)); +} + +unsigned long X509_subject_name_hash_old(X509 *x) +{ + return (X509_NAME_hash_old(x->cert_info->subject)); +} + +/* + * Compare two certificates: they must be identical for this to work. NB: + * Although "cmp" operations are generally prototyped to take "const" + * arguments (eg. for use in STACKs), the way X509 handling is - these + * operations may involve ensuring the hashes are up-to-date and ensuring + * certain cert information is cached. So this is the point where the + * "depth-first" constification tree has to halt with an evil cast. + */ +int X509_cmp(const X509 *a, const X509 *b) +{ + int rv; + /* ensure hash is valid */ + X509_check_purpose((X509 *)a, -1, 0); + X509_check_purpose((X509 *)b, -1, 0); + + rv = OPENSSL_memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); + if (rv) + return rv; + /* Check for match against stored encoding too */ + if (!a->cert_info->enc.modified && !b->cert_info->enc.modified) { + rv = (int)(a->cert_info->enc.len - b->cert_info->enc.len); + if (rv) + return rv; + return OPENSSL_memcmp(a->cert_info->enc.enc, b->cert_info->enc.enc, + a->cert_info->enc.len); + } + return rv; +} + +int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b) +{ + int ret; + + /* Ensure canonical encoding is present and up to date */ + + if (!a->canon_enc || a->modified) { + ret = i2d_X509_NAME((X509_NAME *)a, NULL); + if (ret < 0) + return -2; + } + + if (!b->canon_enc || b->modified) { + ret = i2d_X509_NAME((X509_NAME *)b, NULL); + if (ret < 0) + return -2; + } + + ret = a->canon_enclen - b->canon_enclen; + + if (ret) + return ret; + + return OPENSSL_memcmp(a->canon_enc, b->canon_enc, a->canon_enclen); + +} + +unsigned long X509_NAME_hash(X509_NAME *x) +{ + unsigned long ret = 0; + unsigned char md[SHA_DIGEST_LENGTH]; + + /* Make sure X509_NAME structure contains valid cached encoding */ + i2d_X509_NAME(x, NULL); + if (!EVP_Digest(x->canon_enc, x->canon_enclen, md, NULL, EVP_sha1(), + NULL)) + return 0; + + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + return (ret); +} + +/* + * I now DER encode the name and hash it. Since I cache the DER encoding, + * this is reasonably efficient. + */ + +unsigned long X509_NAME_hash_old(X509_NAME *x) +{ + EVP_MD_CTX md_ctx; + unsigned long ret = 0; + unsigned char md[16]; + + /* Make sure X509_NAME structure contains valid cached encoding */ + i2d_X509_NAME(x, NULL); + EVP_MD_CTX_init(&md_ctx); + /* EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); */ + if (EVP_DigestInit_ex(&md_ctx, EVP_md5(), NULL) + && EVP_DigestUpdate(&md_ctx, x->bytes->data, x->bytes->length) + && EVP_DigestFinal_ex(&md_ctx, md, NULL)) + ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | + ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) + ) & 0xffffffffL; + EVP_MD_CTX_cleanup(&md_ctx); + + return (ret); +} + +/* Search a stack of X509 for a match */ +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name, + ASN1_INTEGER *serial) +{ + size_t i; + X509_CINF cinf; + X509 x, *x509 = NULL; + + if (!sk) + return NULL; + + x.cert_info = &cinf; + cinf.serialNumber = serial; + cinf.issuer = name; + + for (i = 0; i < sk_X509_num(sk); i++) { + x509 = sk_X509_value(sk, i); + if (X509_issuer_and_serial_cmp(x509, &x) == 0) + return (x509); + } + return (NULL); +} + +X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name) +{ + X509 *x509; + size_t i; + + for (i = 0; i < sk_X509_num(sk); i++) { + x509 = sk_X509_value(sk, i); + if (X509_NAME_cmp(X509_get_subject_name(x509), name) == 0) + return (x509); + } + return (NULL); +} + +EVP_PKEY *X509_get_pubkey(X509 *x) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (NULL); + return (X509_PUBKEY_get(x->cert_info->key)); +} + +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) +{ + if (!x) + return NULL; + return x->cert_info->key->public_key; +} + +int X509_check_private_key(X509 *x, const EVP_PKEY *k) +{ + EVP_PKEY *xk; + int ret; + + xk = X509_get_pubkey(x); + + if (xk) + ret = EVP_PKEY_cmp(xk, k); + else + ret = -2; + + switch (ret) { + case 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); + } + if (xk) + EVP_PKEY_free(xk); + if (ret > 0) + return 1; + return 0; +} + +/* + * Check a suite B algorithm is permitted: pass in a public key and the NID + * of its signature (or 0 if no signature). The pflags is a pointer to a + * flags field which must contain the suite B verification flags. + */ + +static int check_suite_b(EVP_PKEY *pkey, int sign_nid, unsigned long *pflags) +{ + const EC_GROUP *grp = NULL; + int curve_nid; + if (pkey && pkey->type == EVP_PKEY_EC) + grp = EC_KEY_get0_group(pkey->pkey.ec); + if (!grp) + return X509_V_ERR_SUITE_B_INVALID_ALGORITHM; + curve_nid = EC_GROUP_get_curve_name(grp); + /* Check curve is consistent with LOS */ + if (curve_nid == NID_secp384r1) { /* P-384 */ + /* + * Check signature algorithm is consistent with curve. + */ + if (sign_nid != -1 && sign_nid != NID_ecdsa_with_SHA384) + return X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM; + if (!(*pflags & X509_V_FLAG_SUITEB_192_LOS)) + return X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED; + /* If we encounter P-384 we cannot use P-256 later */ + *pflags &= ~X509_V_FLAG_SUITEB_128_LOS_ONLY; + } else if (curve_nid == NID_X9_62_prime256v1) { /* P-256 */ + if (sign_nid != -1 && sign_nid != NID_ecdsa_with_SHA256) + return X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM; + if (!(*pflags & X509_V_FLAG_SUITEB_128_LOS_ONLY)) + return X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED; + } else + return X509_V_ERR_SUITE_B_INVALID_CURVE; + + return X509_V_OK; +} + +int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain, + unsigned long flags) +{ + int rv, sign_nid; + size_t i; + EVP_PKEY *pk = NULL; + unsigned long tflags; + if (!(flags & X509_V_FLAG_SUITEB_128_LOS)) + return X509_V_OK; + tflags = flags; + /* If no EE certificate passed in must be first in chain */ + if (x == NULL) { + x = sk_X509_value(chain, 0); + i = 1; + } else + i = 0; + + if (X509_get_version(x) != 2) { + rv = X509_V_ERR_SUITE_B_INVALID_VERSION; + /* Correct error depth */ + i = 0; + goto end; + } + + pk = X509_get_pubkey(x); + /* Check EE key only */ + rv = check_suite_b(pk, -1, &tflags); + if (rv != X509_V_OK) { + /* Correct error depth */ + i = 0; + goto end; + } + for (; i < sk_X509_num(chain); i++) { + sign_nid = X509_get_signature_nid(x); + x = sk_X509_value(chain, i); + if (X509_get_version(x) != 2) { + rv = X509_V_ERR_SUITE_B_INVALID_VERSION; + goto end; + } + EVP_PKEY_free(pk); + pk = X509_get_pubkey(x); + rv = check_suite_b(pk, sign_nid, &tflags); + if (rv != X509_V_OK) + goto end; + } + + /* Final check: root CA signature */ + rv = check_suite_b(pk, X509_get_signature_nid(x), &tflags); + end: + if (pk) + EVP_PKEY_free(pk); + if (rv != X509_V_OK) { + /* Invalid signature or LOS errors are for previous cert */ + if ((rv == X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM + || rv == X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED) && i) + i--; + /* + * If we have LOS error and flags changed then we are signing P-384 + * with P-256. Use more meaninggul error. + */ + if (rv == X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED && flags != tflags) + rv = X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256; + if (perror_depth) + *perror_depth = i; + } + return rv; +} + +int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags) +{ + int sign_nid; + if (!(flags & X509_V_FLAG_SUITEB_128_LOS)) + return X509_V_OK; + sign_nid = OBJ_obj2nid(crl->crl->sig_alg->algorithm); + return check_suite_b(pk, sign_nid, &flags); +} + +/* + * Not strictly speaking an "up_ref" as a STACK doesn't have a reference + * count but it has the same effect by duping the STACK and upping the ref of + * each X509 structure. + */ +STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain) +{ + STACK_OF(X509) *ret; + size_t i; + ret = sk_X509_dup(chain); + for (i = 0; i < sk_X509_num(ret); i++) { + X509_up_ref(sk_X509_value(ret, i)); + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c new file mode 100644 index 0000000..a407c1e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c @@ -0,0 +1,106 @@ +/* crypto/x509/x509_d2.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 + +#ifndef OPENSSL_NO_STDIO +int X509_STORE_set_default_paths(X509_STORE *ctx) +{ + X509_LOOKUP *lookup; + + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()); + if (lookup == NULL) + return (0); + X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT); + + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir()); + if (lookup == NULL) + return (0); + X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT); + + /* clear any errors */ + ERR_clear_error(); + + return (1); +} + +int X509_STORE_load_locations(X509_STORE *ctx, const char *file, + const char *path) +{ + X509_LOOKUP *lookup; + + if (file != NULL) { + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()); + if (lookup == NULL) + return (0); + if (X509_LOOKUP_load_file(lookup, file, X509_FILETYPE_PEM) != 1) + return (0); + } + if (path != NULL) { + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir()); + if (lookup == NULL) + return (0); + if (X509_LOOKUP_add_dir(lookup, path, X509_FILETYPE_PEM) != 1) + return (0); + } + if ((path == NULL) && (file == NULL)) + return (0); + return (1); +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c.grpc_back new file mode 100644 index 0000000..69ae54e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c.grpc_back @@ -0,0 +1,106 @@ +/* crypto/x509/x509_d2.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 + +#ifndef OPENSSL_NO_STDIO +int X509_STORE_set_default_paths(X509_STORE *ctx) +{ + X509_LOOKUP *lookup; + + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()); + if (lookup == NULL) + return (0); + X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT); + + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir()); + if (lookup == NULL) + return (0); + X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT); + + /* clear any errors */ + ERR_clear_error(); + + return (1); +} + +int X509_STORE_load_locations(X509_STORE *ctx, const char *file, + const char *path) +{ + X509_LOOKUP *lookup; + + if (file != NULL) { + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()); + if (lookup == NULL) + return (0); + if (X509_LOOKUP_load_file(lookup, file, X509_FILETYPE_PEM) != 1) + return (0); + } + if (path != NULL) { + lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir()); + if (lookup == NULL) + return (0); + if (X509_LOOKUP_add_dir(lookup, path, X509_FILETYPE_PEM) != 1) + return (0); + } + if ((path == NULL) && (file == NULL)) + return (0); + return (1); +} + +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c new file mode 100644 index 0000000..bcc741e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c @@ -0,0 +1,103 @@ +/* crypto/x509/x509_def.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 + +/* TODO(fork): cleanup */ + +#if defined(OPENSSL_FUCHSIA) +#define OPENSSLDIR "/config/ssl" +#else +#define OPENSSLDIR "/etc/ssl" +#endif + +#define X509_CERT_AREA OPENSSLDIR +#define X509_CERT_DIR OPENSSLDIR "/certs" +#define X509_CERT_FILE OPENSSLDIR "/cert.pem" +#define X509_PRIVATE_DIR OPENSSLDIR "/private" +#define X509_CERT_DIR_EVP "SSL_CERT_DIR" +#define X509_CERT_FILE_EVP "SSL_CERT_FILE" + +const char *X509_get_default_private_dir(void) +{ + return (X509_PRIVATE_DIR); +} + +const char *X509_get_default_cert_area(void) +{ + return (X509_CERT_AREA); +} + +const char *X509_get_default_cert_dir(void) +{ + return (X509_CERT_DIR); +} + +const char *X509_get_default_cert_file(void) +{ + return (X509_CERT_FILE); +} + +const char *X509_get_default_cert_dir_env(void) +{ + return (X509_CERT_DIR_EVP); +} + +const char *X509_get_default_cert_file_env(void) +{ + return (X509_CERT_FILE_EVP); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back new file mode 100644 index 0000000..d2bc3e5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back @@ -0,0 +1,103 @@ +/* crypto/x509/x509_def.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 + +/* TODO(fork): cleanup */ + +#if defined(OPENSSL_FUCHSIA) +#define OPENSSLDIR "/config/ssl" +#else +#define OPENSSLDIR "/etc/ssl" +#endif + +#define X509_CERT_AREA OPENSSLDIR +#define X509_CERT_DIR OPENSSLDIR "/certs" +#define X509_CERT_FILE OPENSSLDIR "/cert.pem" +#define X509_PRIVATE_DIR OPENSSLDIR "/private" +#define X509_CERT_DIR_EVP "SSL_CERT_DIR" +#define X509_CERT_FILE_EVP "SSL_CERT_FILE" + +const char *X509_get_default_private_dir(void) +{ + return (X509_PRIVATE_DIR); +} + +const char *X509_get_default_cert_area(void) +{ + return (X509_CERT_AREA); +} + +const char *X509_get_default_cert_dir(void) +{ + return (X509_CERT_DIR); +} + +const char *X509_get_default_cert_file(void) +{ + return (X509_CERT_FILE); +} + +const char *X509_get_default_cert_dir_env(void) +{ + return (X509_CERT_DIR_EVP); +} + +const char *X509_get_default_cert_file_env(void) +{ + return (X509_CERT_FILE_EVP); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c new file mode 100644 index 0000000..69aaafb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c @@ -0,0 +1,206 @@ +/* crypto/x509/x509_ext.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 + +int X509_CRL_get_ext_count(X509_CRL *x) +{ + return (X509v3_get_ext_count(x->crl->extensions)); +} + +int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); +} + +int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); +} + +int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc) +{ + return (X509v3_get_ext(x->crl->extensions, loc)); +} + +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) +{ + return (X509v3_delete_ext(x->crl->extensions, loc)); +} + +void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); +} + +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags); +} + +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL); +} + +int X509_get_ext_count(X509 *x) +{ + return (X509v3_get_ext_count(x->cert_info->extensions)); +} + +int X509_get_ext_by_NID(X509 *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); +} + +int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); +} + +int X509_get_ext_by_critical(X509 *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical + (x->cert_info->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_get_ext(X509 *x, int loc) +{ + return (X509v3_get_ext(x->cert_info->extensions, loc)); +} + +X509_EXTENSION *X509_delete_ext(X509 *x, int loc) +{ + return (X509v3_delete_ext(x->cert_info->extensions, loc)); +} + +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL); +} + +void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); +} + +int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit, + flags); +} + +int X509_REVOKED_get_ext_count(X509_REVOKED *x) +{ + return (X509v3_get_ext_count(x->extensions)); +} + +int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos)); +} + +int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, + int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos)); +} + +int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc) +{ + return (X509v3_get_ext(x->extensions, loc)); +} + +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc) +{ + return (X509v3_delete_ext(x->extensions, loc)); +} + +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL); +} + +void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->extensions, nid, crit, idx); +} + +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags); +} + +IMPLEMENT_ASN1_SET_OF(X509_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c.grpc_back new file mode 100644 index 0000000..a329f6f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c.grpc_back @@ -0,0 +1,206 @@ +/* crypto/x509/x509_ext.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 + +int X509_CRL_get_ext_count(X509_CRL *x) +{ + return (X509v3_get_ext_count(x->crl->extensions)); +} + +int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); +} + +int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); +} + +int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc) +{ + return (X509v3_get_ext(x->crl->extensions, loc)); +} + +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) +{ + return (X509v3_delete_ext(x->crl->extensions, loc)); +} + +void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); +} + +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags); +} + +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL); +} + +int X509_get_ext_count(X509 *x) +{ + return (X509v3_get_ext_count(x->cert_info->extensions)); +} + +int X509_get_ext_by_NID(X509 *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); +} + +int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); +} + +int X509_get_ext_by_critical(X509 *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical + (x->cert_info->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_get_ext(X509 *x, int loc) +{ + return (X509v3_get_ext(x->cert_info->extensions, loc)); +} + +X509_EXTENSION *X509_delete_ext(X509 *x, int loc) +{ + return (X509v3_delete_ext(x->cert_info->extensions, loc)); +} + +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL); +} + +void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); +} + +int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit, + flags); +} + +int X509_REVOKED_get_ext_count(X509_REVOKED *x) +{ + return (X509v3_get_ext_count(x->extensions)); +} + +int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos) +{ + return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos)); +} + +int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, + int lastpos) +{ + return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos)); +} + +int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos) +{ + return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos)); +} + +X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc) +{ + return (X509v3_get_ext(x->extensions, loc)); +} + +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc) +{ + return (X509v3_delete_ext(x->extensions, loc)); +} + +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) +{ + return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL); +} + +void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) +{ + return X509V3_get_d2i(x->extensions, nid, crit, idx); +} + +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, + unsigned long flags) +{ + return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags); +} + +IMPLEMENT_ASN1_SET_OF(X509_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c new file mode 100644 index 0000000..6b10097 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c @@ -0,0 +1,834 @@ +/* crypto/x509/x509_lu.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 "../internal.h" + +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) +{ + X509_LOOKUP *ret; + + ret = (X509_LOOKUP *)OPENSSL_malloc(sizeof(X509_LOOKUP)); + if (ret == NULL) + return NULL; + + ret->init = 0; + ret->skip = 0; + ret->method = method; + ret->method_data = NULL; + ret->store_ctx = NULL; + if ((method->new_item != NULL) && !method->new_item(ret)) { + OPENSSL_free(ret); + return NULL; + } + return ret; +} + +void X509_LOOKUP_free(X509_LOOKUP *ctx) +{ + if (ctx == NULL) + return; + if ((ctx->method != NULL) && (ctx->method->free != NULL)) + (*ctx->method->free) (ctx); + OPENSSL_free(ctx); +} + +int X509_LOOKUP_init(X509_LOOKUP *ctx) +{ + if (ctx->method == NULL) + return 0; + if (ctx->method->init != NULL) + return ctx->method->init(ctx); + else + return 1; +} + +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) +{ + if (ctx->method == NULL) + return 0; + if (ctx->method->shutdown != NULL) + return ctx->method->shutdown(ctx); + else + return 1; +} + +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, + char **ret) +{ + if (ctx->method == NULL) + return -1; + if (ctx->method->ctrl != NULL) + return ctx->method->ctrl(ctx, cmd, argc, argl, ret); + else + return 1; +} + +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) + return 0; + if (ctx->skip) + return 0; + return ctx->method->get_by_subject(ctx, type, name, ret) > 0; +} + +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial, X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_issuer_serial == NULL)) + return 0; + return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret) > 0; +} + +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + unsigned char *bytes, int len, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) + return 0; + return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret) > 0; +} + +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) + return 0; + return ctx->method->get_by_alias(ctx, type, str, len, ret) > 0; +} + +static int x509_object_cmp(const X509_OBJECT **a, const X509_OBJECT **b) +{ + int ret; + + ret = ((*a)->type - (*b)->type); + if (ret) + return ret; + switch ((*a)->type) { + case X509_LU_X509: + ret = X509_subject_name_cmp((*a)->data.x509, (*b)->data.x509); + break; + case X509_LU_CRL: + ret = X509_CRL_cmp((*a)->data.crl, (*b)->data.crl); + break; + default: + /* abort(); */ + return 0; + } + return ret; +} + +X509_STORE *X509_STORE_new(void) +{ + X509_STORE *ret; + + if ((ret = (X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL) + return NULL; + OPENSSL_memset(ret, 0, sizeof(*ret)); + CRYPTO_MUTEX_init(&ret->objs_lock); + ret->objs = sk_X509_OBJECT_new(x509_object_cmp); + if (ret->objs == NULL) + goto err; + ret->cache = 1; + ret->get_cert_methods = sk_X509_LOOKUP_new_null(); + if (ret->get_cert_methods == NULL) + goto err; + ret->param = X509_VERIFY_PARAM_new(); + if (ret->param == NULL) + goto err; + + ret->references = 1; + return ret; + err: + if (ret) { + CRYPTO_MUTEX_cleanup(&ret->objs_lock); + if (ret->param) + X509_VERIFY_PARAM_free(ret->param); + if (ret->get_cert_methods) + sk_X509_LOOKUP_free(ret->get_cert_methods); + if (ret->objs) + sk_X509_OBJECT_free(ret->objs); + OPENSSL_free(ret); + } + return NULL; +} + +int X509_STORE_up_ref(X509_STORE *store) +{ + CRYPTO_refcount_inc(&store->references); + return 1; +} + +static void cleanup(X509_OBJECT *a) +{ + if (a == NULL) { + return; + } + if (a->type == X509_LU_X509) { + X509_free(a->data.x509); + } else if (a->type == X509_LU_CRL) { + X509_CRL_free(a->data.crl); + } else { + /* abort(); */ + } + + OPENSSL_free(a); +} + +void X509_STORE_free(X509_STORE *vfy) +{ + size_t j; + STACK_OF(X509_LOOKUP) *sk; + X509_LOOKUP *lu; + + if (vfy == NULL) + return; + + if (!CRYPTO_refcount_dec_and_test_zero(&vfy->references)) { + return; + } + + CRYPTO_MUTEX_cleanup(&vfy->objs_lock); + + sk = vfy->get_cert_methods; + for (j = 0; j < sk_X509_LOOKUP_num(sk); j++) { + lu = sk_X509_LOOKUP_value(sk, j); + X509_LOOKUP_shutdown(lu); + X509_LOOKUP_free(lu); + } + sk_X509_LOOKUP_free(sk); + sk_X509_OBJECT_pop_free(vfy->objs, cleanup); + + if (vfy->param) + X509_VERIFY_PARAM_free(vfy->param); + OPENSSL_free(vfy); +} + +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) +{ + size_t i; + STACK_OF(X509_LOOKUP) *sk; + X509_LOOKUP *lu; + + sk = v->get_cert_methods; + for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) { + lu = sk_X509_LOOKUP_value(sk, i); + if (m == lu->method) { + return lu; + } + } + /* a new one */ + lu = X509_LOOKUP_new(m); + if (lu == NULL) + return NULL; + else { + lu->store_ctx = v; + if (sk_X509_LOOKUP_push(v->get_cert_methods, lu)) + return lu; + else { + X509_LOOKUP_free(lu); + return NULL; + } + } +} + +int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + X509_STORE *ctx = vs->ctx; + X509_LOOKUP *lu; + X509_OBJECT stmp, *tmp; + int i; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + tmp = X509_OBJECT_retrieve_by_subject(ctx->objs, type, name); + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + if (tmp == NULL || type == X509_LU_CRL) { + for (i = 0; i < (int)sk_X509_LOOKUP_num(ctx->get_cert_methods); i++) { + lu = sk_X509_LOOKUP_value(ctx->get_cert_methods, i); + if (X509_LOOKUP_by_subject(lu, type, name, &stmp)) { + tmp = &stmp; + break; + } + } + if (tmp == NULL) + return 0; + } + + /* + * if (ret->data.ptr != NULL) X509_OBJECT_free_contents(ret); + */ + + ret->type = tmp->type; + ret->data.ptr = tmp->data.ptr; + + X509_OBJECT_up_ref_count(ret); + + return 1; +} + +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) +{ + X509_OBJECT *obj; + int ret = 1; + + if (x == NULL) + return 0; + obj = (X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT)); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + obj->type = X509_LU_X509; + obj->data.x509 = x; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + + X509_OBJECT_up_ref_count(obj); + + if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, X509_R_CERT_ALREADY_IN_HASH_TABLE); + ret = 0; + } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ret = 0; + } + + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + return ret; +} + +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) +{ + X509_OBJECT *obj; + int ret = 1; + + if (x == NULL) + return 0; + obj = (X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT)); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + obj->type = X509_LU_CRL; + obj->data.crl = x; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + + X509_OBJECT_up_ref_count(obj); + + if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, X509_R_CERT_ALREADY_IN_HASH_TABLE); + ret = 0; + } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ret = 0; + } + + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + return ret; +} + +void X509_STORE_set0_additional_untrusted(X509_STORE *ctx, + STACK_OF(X509) *untrusted) { + ctx->additional_untrusted = untrusted; +} + +int X509_OBJECT_up_ref_count(X509_OBJECT *a) +{ + switch (a->type) { + case X509_LU_X509: + X509_up_ref(a->data.x509); + break; + case X509_LU_CRL: + X509_CRL_up_ref(a->data.crl); + break; + } + return 1; +} + +void X509_OBJECT_free_contents(X509_OBJECT *a) +{ + switch (a->type) { + case X509_LU_X509: + X509_free(a->data.x509); + break; + case X509_LU_CRL: + X509_CRL_free(a->data.crl); + break; + } +} + +int X509_OBJECT_get_type(const X509_OBJECT *a) +{ + return a->type; +} + +X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a) +{ + if (a == NULL || a->type != X509_LU_X509) { + return NULL; + } + return a->data.x509; +} + +static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name, int *pnmatch) +{ + X509_OBJECT stmp; + X509 x509_s; + X509_CINF cinf_s; + X509_CRL crl_s; + X509_CRL_INFO crl_info_s; + + stmp.type = type; + switch (type) { + case X509_LU_X509: + stmp.data.x509 = &x509_s; + x509_s.cert_info = &cinf_s; + cinf_s.subject = name; + break; + case X509_LU_CRL: + stmp.data.crl = &crl_s; + crl_s.crl = &crl_info_s; + crl_info_s.issuer = name; + break; + default: + /* abort(); */ + return -1; + } + + size_t idx; + sk_X509_OBJECT_sort(h); + if (!sk_X509_OBJECT_find(h, &idx, &stmp)) + return -1; + + if (pnmatch != NULL) { + int tidx; + const X509_OBJECT *tobj, *pstmp; + *pnmatch = 1; + pstmp = &stmp; + for (tidx = idx + 1; tidx < (int)sk_X509_OBJECT_num(h); tidx++) { + tobj = sk_X509_OBJECT_value(h, tidx); + if (x509_object_cmp(&tobj, &pstmp)) + break; + (*pnmatch)++; + } + } + + return idx; +} + +int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name) +{ + return x509_object_idx_cnt(h, type, name, NULL); +} + +X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + int type, X509_NAME *name) +{ + int idx; + idx = X509_OBJECT_idx_by_subject(h, type, name); + if (idx == -1) + return NULL; + return sk_X509_OBJECT_value(h, idx); +} + +STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *st) +{ + return st->objs; +} + +STACK_OF (X509) * X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) +{ + int i, idx, cnt; + STACK_OF(X509) *sk; + X509 *x; + X509_OBJECT *obj; + sk = sk_X509_new_null(); + if (sk == NULL) + return NULL; + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); + if (idx < 0) { + /* + * Nothing found in cache: do lookup to possibly add new objects to + * cache + */ + X509_OBJECT xobj; + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + if (!X509_STORE_get_by_subject(ctx, X509_LU_X509, nm, &xobj)) { + sk_X509_free(sk); + return NULL; + } + X509_OBJECT_free_contents(&xobj); + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); + if (idx < 0) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_free(sk); + return NULL; + } + } + for (i = 0; i < cnt; i++, idx++) { + obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); + x = obj->data.x509; + if (!sk_X509_push(sk, x)) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_pop_free(sk, X509_free); + return NULL; + } + X509_up_ref(x); + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return sk; + +} + +STACK_OF (X509_CRL) * X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) +{ + int i, idx, cnt; + STACK_OF(X509_CRL) *sk; + X509_CRL *x; + X509_OBJECT *obj, xobj; + sk = sk_X509_CRL_new_null(); + if (sk == NULL) + return NULL; + + /* Always do lookup to possibly add new CRLs to cache. */ + if (!X509_STORE_get_by_subject(ctx, X509_LU_CRL, nm, &xobj)) { + sk_X509_CRL_free(sk); + return NULL; + } + X509_OBJECT_free_contents(&xobj); + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt); + if (idx < 0) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_CRL_free(sk); + return NULL; + } + + for (i = 0; i < cnt; i++, idx++) { + obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); + x = obj->data.crl; + X509_CRL_up_ref(x); + if (!sk_X509_CRL_push(sk, x)) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + X509_CRL_free(x); + sk_X509_CRL_pop_free(sk, X509_CRL_free); + return NULL; + } + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return sk; +} + +X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + X509_OBJECT *x) +{ + size_t idx, i; + X509_OBJECT *obj; + + sk_X509_OBJECT_sort(h); + if (!sk_X509_OBJECT_find(h, &idx, x)) { + return NULL; + } + if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL)) + return sk_X509_OBJECT_value(h, idx); + for (i = idx; i < sk_X509_OBJECT_num(h); i++) { + obj = sk_X509_OBJECT_value(h, i); + if (x509_object_cmp + ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x)) + return NULL; + if (x->type == X509_LU_X509) { + if (!X509_cmp(obj->data.x509, x->data.x509)) + return obj; + } else if (x->type == X509_LU_CRL) { + if (!X509_CRL_match(obj->data.crl, x->data.crl)) + return obj; + } else + return obj; + } + return NULL; +} + +/* + * Try to get issuer certificate from store. Due to limitations of the API + * this can only retrieve a single certificate matching a given subject name. + * However it will fill the cache with all matching certificates, so we can + * examine the cache for all matches. Return values are: 1 lookup + * successful. 0 certificate not found. -1 some other error. + */ +int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) +{ + X509_NAME *xn; + X509_OBJECT obj, *pobj; + int idx, ret; + size_t i; + xn = X509_get_issuer_name(x); + if (!X509_STORE_get_by_subject(ctx, X509_LU_X509, xn, &obj)) + return 0; + /* If certificate matches all OK */ + if (ctx->check_issued(ctx, x, obj.data.x509)) { + *issuer = obj.data.x509; + return 1; + } + X509_OBJECT_free_contents(&obj); + + /* Else find index of first cert accepted by 'check_issued' */ + ret = 0; + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn); + if (idx != -1) { /* should be true as we've had at least one + * match */ + /* Look through all matching certs for suitable issuer */ + for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++) { + pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i); + /* See if we've run past the matches */ + if (pobj->type != X509_LU_X509) + break; + if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))) + break; + if (ctx->check_issued(ctx, x, pobj->data.x509)) { + *issuer = pobj->data.x509; + X509_OBJECT_up_ref_count(pobj); + ret = 1; + break; + } + } + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return ret; +} + +int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags) +{ + return X509_VERIFY_PARAM_set_flags(ctx->param, flags); +} + +int X509_STORE_set_depth(X509_STORE *ctx, int depth) +{ + X509_VERIFY_PARAM_set_depth(ctx->param, depth); + return 1; +} + +int X509_STORE_set_purpose(X509_STORE *ctx, int purpose) +{ + return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); +} + +int X509_STORE_set_trust(X509_STORE *ctx, int trust) +{ + return X509_VERIFY_PARAM_set_trust(ctx->param, trust); +} + +int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *param) +{ + return X509_VERIFY_PARAM_set1(ctx->param, param); +} + +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, + X509_STORE_CTX_verify_cb verify_cb) +{ + ctx->verify_cb = verify_cb; +} + +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) +{ + return ctx->cleanup; +} + +X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) +{ + return ctx->ctx; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back new file mode 100644 index 0000000..4046c3e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back @@ -0,0 +1,834 @@ +/* crypto/x509/x509_lu.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 "../internal.h" + +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) +{ + X509_LOOKUP *ret; + + ret = (X509_LOOKUP *)OPENSSL_malloc(sizeof(X509_LOOKUP)); + if (ret == NULL) + return NULL; + + ret->init = 0; + ret->skip = 0; + ret->method = method; + ret->method_data = NULL; + ret->store_ctx = NULL; + if ((method->new_item != NULL) && !method->new_item(ret)) { + OPENSSL_free(ret); + return NULL; + } + return ret; +} + +void X509_LOOKUP_free(X509_LOOKUP *ctx) +{ + if (ctx == NULL) + return; + if ((ctx->method != NULL) && (ctx->method->free != NULL)) + (*ctx->method->free) (ctx); + OPENSSL_free(ctx); +} + +int X509_LOOKUP_init(X509_LOOKUP *ctx) +{ + if (ctx->method == NULL) + return 0; + if (ctx->method->init != NULL) + return ctx->method->init(ctx); + else + return 1; +} + +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) +{ + if (ctx->method == NULL) + return 0; + if (ctx->method->shutdown != NULL) + return ctx->method->shutdown(ctx); + else + return 1; +} + +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, + char **ret) +{ + if (ctx->method == NULL) + return -1; + if (ctx->method->ctrl != NULL) + return ctx->method->ctrl(ctx, cmd, argc, argl, ret); + else + return 1; +} + +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) + return 0; + if (ctx->skip) + return 0; + return ctx->method->get_by_subject(ctx, type, name, ret) > 0; +} + +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial, X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_issuer_serial == NULL)) + return 0; + return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret) > 0; +} + +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + unsigned char *bytes, int len, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) + return 0; + return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret) > 0; +} + +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, + X509_OBJECT *ret) +{ + if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) + return 0; + return ctx->method->get_by_alias(ctx, type, str, len, ret) > 0; +} + +static int x509_object_cmp(const X509_OBJECT **a, const X509_OBJECT **b) +{ + int ret; + + ret = ((*a)->type - (*b)->type); + if (ret) + return ret; + switch ((*a)->type) { + case X509_LU_X509: + ret = X509_subject_name_cmp((*a)->data.x509, (*b)->data.x509); + break; + case X509_LU_CRL: + ret = X509_CRL_cmp((*a)->data.crl, (*b)->data.crl); + break; + default: + /* abort(); */ + return 0; + } + return ret; +} + +X509_STORE *X509_STORE_new(void) +{ + X509_STORE *ret; + + if ((ret = (X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL) + return NULL; + OPENSSL_memset(ret, 0, sizeof(*ret)); + CRYPTO_MUTEX_init(&ret->objs_lock); + ret->objs = sk_X509_OBJECT_new(x509_object_cmp); + if (ret->objs == NULL) + goto err; + ret->cache = 1; + ret->get_cert_methods = sk_X509_LOOKUP_new_null(); + if (ret->get_cert_methods == NULL) + goto err; + ret->param = X509_VERIFY_PARAM_new(); + if (ret->param == NULL) + goto err; + + ret->references = 1; + return ret; + err: + if (ret) { + CRYPTO_MUTEX_cleanup(&ret->objs_lock); + if (ret->param) + X509_VERIFY_PARAM_free(ret->param); + if (ret->get_cert_methods) + sk_X509_LOOKUP_free(ret->get_cert_methods); + if (ret->objs) + sk_X509_OBJECT_free(ret->objs); + OPENSSL_free(ret); + } + return NULL; +} + +int X509_STORE_up_ref(X509_STORE *store) +{ + CRYPTO_refcount_inc(&store->references); + return 1; +} + +static void cleanup(X509_OBJECT *a) +{ + if (a == NULL) { + return; + } + if (a->type == X509_LU_X509) { + X509_free(a->data.x509); + } else if (a->type == X509_LU_CRL) { + X509_CRL_free(a->data.crl); + } else { + /* abort(); */ + } + + OPENSSL_free(a); +} + +void X509_STORE_free(X509_STORE *vfy) +{ + size_t j; + STACK_OF(X509_LOOKUP) *sk; + X509_LOOKUP *lu; + + if (vfy == NULL) + return; + + if (!CRYPTO_refcount_dec_and_test_zero(&vfy->references)) { + return; + } + + CRYPTO_MUTEX_cleanup(&vfy->objs_lock); + + sk = vfy->get_cert_methods; + for (j = 0; j < sk_X509_LOOKUP_num(sk); j++) { + lu = sk_X509_LOOKUP_value(sk, j); + X509_LOOKUP_shutdown(lu); + X509_LOOKUP_free(lu); + } + sk_X509_LOOKUP_free(sk); + sk_X509_OBJECT_pop_free(vfy->objs, cleanup); + + if (vfy->param) + X509_VERIFY_PARAM_free(vfy->param); + OPENSSL_free(vfy); +} + +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) +{ + size_t i; + STACK_OF(X509_LOOKUP) *sk; + X509_LOOKUP *lu; + + sk = v->get_cert_methods; + for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) { + lu = sk_X509_LOOKUP_value(sk, i); + if (m == lu->method) { + return lu; + } + } + /* a new one */ + lu = X509_LOOKUP_new(m); + if (lu == NULL) + return NULL; + else { + lu->store_ctx = v; + if (sk_X509_LOOKUP_push(v->get_cert_methods, lu)) + return lu; + else { + X509_LOOKUP_free(lu); + return NULL; + } + } +} + +int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, + X509_OBJECT *ret) +{ + X509_STORE *ctx = vs->ctx; + X509_LOOKUP *lu; + X509_OBJECT stmp, *tmp; + int i; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + tmp = X509_OBJECT_retrieve_by_subject(ctx->objs, type, name); + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + if (tmp == NULL || type == X509_LU_CRL) { + for (i = 0; i < (int)sk_X509_LOOKUP_num(ctx->get_cert_methods); i++) { + lu = sk_X509_LOOKUP_value(ctx->get_cert_methods, i); + if (X509_LOOKUP_by_subject(lu, type, name, &stmp)) { + tmp = &stmp; + break; + } + } + if (tmp == NULL) + return 0; + } + + /* + * if (ret->data.ptr != NULL) X509_OBJECT_free_contents(ret); + */ + + ret->type = tmp->type; + ret->data.ptr = tmp->data.ptr; + + X509_OBJECT_up_ref_count(ret); + + return 1; +} + +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) +{ + X509_OBJECT *obj; + int ret = 1; + + if (x == NULL) + return 0; + obj = (X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT)); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + obj->type = X509_LU_X509; + obj->data.x509 = x; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + + X509_OBJECT_up_ref_count(obj); + + if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, X509_R_CERT_ALREADY_IN_HASH_TABLE); + ret = 0; + } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ret = 0; + } + + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + return ret; +} + +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) +{ + X509_OBJECT *obj; + int ret = 1; + + if (x == NULL) + return 0; + obj = (X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT)); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + obj->type = X509_LU_CRL; + obj->data.crl = x; + + CRYPTO_MUTEX_lock_write(&ctx->objs_lock); + + X509_OBJECT_up_ref_count(obj); + + if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, X509_R_CERT_ALREADY_IN_HASH_TABLE); + ret = 0; + } else if (!sk_X509_OBJECT_push(ctx->objs, obj)) { + X509_OBJECT_free_contents(obj); + OPENSSL_free(obj); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ret = 0; + } + + CRYPTO_MUTEX_unlock_write(&ctx->objs_lock); + + return ret; +} + +void X509_STORE_set0_additional_untrusted(X509_STORE *ctx, + STACK_OF(X509) *untrusted) { + ctx->additional_untrusted = untrusted; +} + +int X509_OBJECT_up_ref_count(X509_OBJECT *a) +{ + switch (a->type) { + case X509_LU_X509: + X509_up_ref(a->data.x509); + break; + case X509_LU_CRL: + X509_CRL_up_ref(a->data.crl); + break; + } + return 1; +} + +void X509_OBJECT_free_contents(X509_OBJECT *a) +{ + switch (a->type) { + case X509_LU_X509: + X509_free(a->data.x509); + break; + case X509_LU_CRL: + X509_CRL_free(a->data.crl); + break; + } +} + +int X509_OBJECT_get_type(const X509_OBJECT *a) +{ + return a->type; +} + +X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a) +{ + if (a == NULL || a->type != X509_LU_X509) { + return NULL; + } + return a->data.x509; +} + +static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name, int *pnmatch) +{ + X509_OBJECT stmp; + X509 x509_s; + X509_CINF cinf_s; + X509_CRL crl_s; + X509_CRL_INFO crl_info_s; + + stmp.type = type; + switch (type) { + case X509_LU_X509: + stmp.data.x509 = &x509_s; + x509_s.cert_info = &cinf_s; + cinf_s.subject = name; + break; + case X509_LU_CRL: + stmp.data.crl = &crl_s; + crl_s.crl = &crl_info_s; + crl_info_s.issuer = name; + break; + default: + /* abort(); */ + return -1; + } + + size_t idx; + sk_X509_OBJECT_sort(h); + if (!sk_X509_OBJECT_find(h, &idx, &stmp)) + return -1; + + if (pnmatch != NULL) { + int tidx; + const X509_OBJECT *tobj, *pstmp; + *pnmatch = 1; + pstmp = &stmp; + for (tidx = idx + 1; tidx < (int)sk_X509_OBJECT_num(h); tidx++) { + tobj = sk_X509_OBJECT_value(h, tidx); + if (x509_object_cmp(&tobj, &pstmp)) + break; + (*pnmatch)++; + } + } + + return idx; +} + +int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name) +{ + return x509_object_idx_cnt(h, type, name, NULL); +} + +X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + int type, X509_NAME *name) +{ + int idx; + idx = X509_OBJECT_idx_by_subject(h, type, name); + if (idx == -1) + return NULL; + return sk_X509_OBJECT_value(h, idx); +} + +STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *st) +{ + return st->objs; +} + +STACK_OF (X509) * X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) +{ + int i, idx, cnt; + STACK_OF(X509) *sk; + X509 *x; + X509_OBJECT *obj; + sk = sk_X509_new_null(); + if (sk == NULL) + return NULL; + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); + if (idx < 0) { + /* + * Nothing found in cache: do lookup to possibly add new objects to + * cache + */ + X509_OBJECT xobj; + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + if (!X509_STORE_get_by_subject(ctx, X509_LU_X509, nm, &xobj)) { + sk_X509_free(sk); + return NULL; + } + X509_OBJECT_free_contents(&xobj); + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); + if (idx < 0) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_free(sk); + return NULL; + } + } + for (i = 0; i < cnt; i++, idx++) { + obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); + x = obj->data.x509; + if (!sk_X509_push(sk, x)) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_pop_free(sk, X509_free); + return NULL; + } + X509_up_ref(x); + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return sk; + +} + +STACK_OF (X509_CRL) * X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) +{ + int i, idx, cnt; + STACK_OF(X509_CRL) *sk; + X509_CRL *x; + X509_OBJECT *obj, xobj; + sk = sk_X509_CRL_new_null(); + if (sk == NULL) + return NULL; + + /* Always do lookup to possibly add new CRLs to cache. */ + if (!X509_STORE_get_by_subject(ctx, X509_LU_CRL, nm, &xobj)) { + sk_X509_CRL_free(sk); + return NULL; + } + X509_OBJECT_free_contents(&xobj); + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt); + if (idx < 0) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + sk_X509_CRL_free(sk); + return NULL; + } + + for (i = 0; i < cnt; i++, idx++) { + obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); + x = obj->data.crl; + X509_CRL_up_ref(x); + if (!sk_X509_CRL_push(sk, x)) { + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + X509_CRL_free(x); + sk_X509_CRL_pop_free(sk, X509_CRL_free); + return NULL; + } + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return sk; +} + +X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + X509_OBJECT *x) +{ + size_t idx, i; + X509_OBJECT *obj; + + sk_X509_OBJECT_sort(h); + if (!sk_X509_OBJECT_find(h, &idx, x)) { + return NULL; + } + if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL)) + return sk_X509_OBJECT_value(h, idx); + for (i = idx; i < sk_X509_OBJECT_num(h); i++) { + obj = sk_X509_OBJECT_value(h, i); + if (x509_object_cmp + ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x)) + return NULL; + if (x->type == X509_LU_X509) { + if (!X509_cmp(obj->data.x509, x->data.x509)) + return obj; + } else if (x->type == X509_LU_CRL) { + if (!X509_CRL_match(obj->data.crl, x->data.crl)) + return obj; + } else + return obj; + } + return NULL; +} + +/* + * Try to get issuer certificate from store. Due to limitations of the API + * this can only retrieve a single certificate matching a given subject name. + * However it will fill the cache with all matching certificates, so we can + * examine the cache for all matches. Return values are: 1 lookup + * successful. 0 certificate not found. -1 some other error. + */ +int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) +{ + X509_NAME *xn; + X509_OBJECT obj, *pobj; + int idx, ret; + size_t i; + xn = X509_get_issuer_name(x); + if (!X509_STORE_get_by_subject(ctx, X509_LU_X509, xn, &obj)) + return 0; + /* If certificate matches all OK */ + if (ctx->check_issued(ctx, x, obj.data.x509)) { + *issuer = obj.data.x509; + return 1; + } + X509_OBJECT_free_contents(&obj); + + /* Else find index of first cert accepted by 'check_issued' */ + ret = 0; + CRYPTO_MUTEX_lock_write(&ctx->ctx->objs_lock); + idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn); + if (idx != -1) { /* should be true as we've had at least one + * match */ + /* Look through all matching certs for suitable issuer */ + for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++) { + pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i); + /* See if we've run past the matches */ + if (pobj->type != X509_LU_X509) + break; + if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))) + break; + if (ctx->check_issued(ctx, x, pobj->data.x509)) { + *issuer = pobj->data.x509; + X509_OBJECT_up_ref_count(pobj); + ret = 1; + break; + } + } + } + CRYPTO_MUTEX_unlock_write(&ctx->ctx->objs_lock); + return ret; +} + +int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags) +{ + return X509_VERIFY_PARAM_set_flags(ctx->param, flags); +} + +int X509_STORE_set_depth(X509_STORE *ctx, int depth) +{ + X509_VERIFY_PARAM_set_depth(ctx->param, depth); + return 1; +} + +int X509_STORE_set_purpose(X509_STORE *ctx, int purpose) +{ + return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); +} + +int X509_STORE_set_trust(X509_STORE *ctx, int trust) +{ + return X509_VERIFY_PARAM_set_trust(ctx->param, trust); +} + +int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *param) +{ + return X509_VERIFY_PARAM_set1(ctx->param, param); +} + +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, + X509_STORE_CTX_verify_cb verify_cb) +{ + ctx->verify_cb = verify_cb; +} + +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) +{ + return ctx->cleanup; +} + +X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) +{ + return ctx->ctx; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c new file mode 100644 index 0000000..5721779 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c @@ -0,0 +1,198 @@ +/* crypto/x509/x509_obj.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 "../internal.h" + + +/* + * Limit to ensure we don't overflow: much greater than + * anything enountered in practice. + */ + +#define NAME_ONELINE_MAX (1024 * 1024) + +char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) +{ + X509_NAME_ENTRY *ne; + size_t i; + int n, lold, l, l1, l2, num, j, type; + const char *s; + char *p; + unsigned char *q; + BUF_MEM *b = NULL; + static const char hex[17] = "0123456789ABCDEF"; + int gs_doit[4]; + char tmp_buf[80]; + + if (buf == NULL) { + if ((b = BUF_MEM_new()) == NULL) + goto err; + if (!BUF_MEM_grow(b, 200)) + goto err; + b->data[0] = '\0'; + len = 200; + } else if (len <= 0) { + return NULL; + } + if (a == NULL) { + if (b) { + buf = b->data; + OPENSSL_free(b); + } + OPENSSL_strlcpy(buf, "NO X509_NAME", len); + return buf; + } + + len--; /* space for '\0' */ + l = 0; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + ne = sk_X509_NAME_ENTRY_value(a->entries, i); + n = OBJ_obj2nid(ne->object); + if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { + i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); + s = tmp_buf; + } + l1 = strlen(s); + + type = ne->value->type; + num = ne->value->length; + if (num > NAME_ONELINE_MAX) { + OPENSSL_PUT_ERROR(X509, X509_R_NAME_TOO_LONG); + goto end; + } + q = ne->value->data; + + if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; + for (j = 0; j < num; j++) + if (q[j] != 0) + gs_doit[j & 3] = 1; + + if (gs_doit[0] | gs_doit[1] | gs_doit[2]) + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; + else { + gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; + gs_doit[3] = 1; + } + } else + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; + + for (l2 = j = 0; j < num; j++) { + if (!gs_doit[j & 3]) + continue; + l2++; + if ((q[j] < ' ') || (q[j] > '~')) + l2 += 3; + } + + lold = l; + l += 1 + l1 + 1 + l2; + if (l > NAME_ONELINE_MAX) { + OPENSSL_PUT_ERROR(X509, X509_R_NAME_TOO_LONG); + goto end; + } + if (b != NULL) { + if (!BUF_MEM_grow(b, l + 1)) + goto err; + p = &(b->data[lold]); + } else if (l > len) { + break; + } else + p = &(buf[lold]); + *(p++) = '/'; + OPENSSL_memcpy(p, s, (unsigned int)l1); + p += l1; + *(p++) = '='; + + q = ne->value->data; + + for (j = 0; j < num; j++) { + if (!gs_doit[j & 3]) + continue; + n = q[j]; + if ((n < ' ') || (n > '~')) { + *(p++) = '\\'; + *(p++) = 'x'; + *(p++) = hex[(n >> 4) & 0x0f]; + *(p++) = hex[n & 0x0f]; + } else + *(p++) = n; + } + *p = '\0'; + } + if (b != NULL) { + p = b->data; + OPENSSL_free(b); + } else + p = buf; + if (i == 0) + *p = '\0'; + return (p); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + end: + BUF_MEM_free(b); + return (NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back new file mode 100644 index 0000000..520b7a0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back @@ -0,0 +1,198 @@ +/* crypto/x509/x509_obj.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 "../internal.h" + + +/* + * Limit to ensure we don't overflow: much greater than + * anything enountered in practice. + */ + +#define NAME_ONELINE_MAX (1024 * 1024) + +char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) +{ + X509_NAME_ENTRY *ne; + size_t i; + int n, lold, l, l1, l2, num, j, type; + const char *s; + char *p; + unsigned char *q; + BUF_MEM *b = NULL; + static const char hex[17] = "0123456789ABCDEF"; + int gs_doit[4]; + char tmp_buf[80]; + + if (buf == NULL) { + if ((b = BUF_MEM_new()) == NULL) + goto err; + if (!BUF_MEM_grow(b, 200)) + goto err; + b->data[0] = '\0'; + len = 200; + } else if (len <= 0) { + return NULL; + } + if (a == NULL) { + if (b) { + buf = b->data; + OPENSSL_free(b); + } + OPENSSL_strlcpy(buf, "NO X509_NAME", len); + return buf; + } + + len--; /* space for '\0' */ + l = 0; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + ne = sk_X509_NAME_ENTRY_value(a->entries, i); + n = OBJ_obj2nid(ne->object); + if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { + i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); + s = tmp_buf; + } + l1 = strlen(s); + + type = ne->value->type; + num = ne->value->length; + if (num > NAME_ONELINE_MAX) { + OPENSSL_PUT_ERROR(X509, X509_R_NAME_TOO_LONG); + goto end; + } + q = ne->value->data; + + if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; + for (j = 0; j < num; j++) + if (q[j] != 0) + gs_doit[j & 3] = 1; + + if (gs_doit[0] | gs_doit[1] | gs_doit[2]) + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; + else { + gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; + gs_doit[3] = 1; + } + } else + gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; + + for (l2 = j = 0; j < num; j++) { + if (!gs_doit[j & 3]) + continue; + l2++; + if ((q[j] < ' ') || (q[j] > '~')) + l2 += 3; + } + + lold = l; + l += 1 + l1 + 1 + l2; + if (l > NAME_ONELINE_MAX) { + OPENSSL_PUT_ERROR(X509, X509_R_NAME_TOO_LONG); + goto end; + } + if (b != NULL) { + if (!BUF_MEM_grow(b, l + 1)) + goto err; + p = &(b->data[lold]); + } else if (l > len) { + break; + } else + p = &(buf[lold]); + *(p++) = '/'; + OPENSSL_memcpy(p, s, (unsigned int)l1); + p += l1; + *(p++) = '='; + + q = ne->value->data; + + for (j = 0; j < num; j++) { + if (!gs_doit[j & 3]) + continue; + n = q[j]; + if ((n < ' ') || (n > '~')) { + *(p++) = '\\'; + *(p++) = 'x'; + *(p++) = hex[(n >> 4) & 0x0f]; + *(p++) = hex[n & 0x0f]; + } else + *(p++) = n; + } + *p = '\0'; + } + if (b != NULL) { + p = b->data; + OPENSSL_free(b); + } else + p = buf; + if (i == 0) + *p = '\0'; + return (p); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + end: + BUF_MEM_free(b); + return (NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c new file mode 100644 index 0000000..24bf53a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c @@ -0,0 +1,116 @@ +/* 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 + +X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) +{ + X509 *ret = NULL; + X509_CINF *xi = NULL; + X509_NAME *xn; + EVP_PKEY *pubkey = NULL; + int res; + + if ((ret = X509_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + + /* duplicate the request */ + xi = ret->cert_info; + + if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0) { + if ((xi->version = M_ASN1_INTEGER_new()) == NULL) + goto err; + if (!ASN1_INTEGER_set(xi->version, 2)) + goto err; + /* + * xi->extensions=ri->attributes; <- bad, should not ever be done + * ri->attributes=NULL; + */ + } + + xn = X509_REQ_get_subject_name(r); + if (X509_set_subject_name(ret, xn) == 0) + goto err; + if (X509_set_issuer_name(ret, xn) == 0) + goto err; + + if (X509_gmtime_adj(xi->validity->notBefore, 0) == NULL) + goto err; + if (X509_gmtime_adj(xi->validity->notAfter, (long)60 * 60 * 24 * days) == + NULL) + goto err; + + pubkey = X509_REQ_get_pubkey(r); + res = X509_set_pubkey(ret, pubkey); + EVP_PKEY_free(pubkey); + + if (!res || !X509_sign(ret, pkey, EVP_md5())) + goto err; + if (0) { + err: + X509_free(ret); + ret = NULL; + } + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back new file mode 100644 index 0000000..723bd49 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back @@ -0,0 +1,116 @@ +/* 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 + +X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) +{ + X509 *ret = NULL; + X509_CINF *xi = NULL; + X509_NAME *xn; + EVP_PKEY *pubkey = NULL; + int res; + + if ((ret = X509_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + + /* duplicate the request */ + xi = ret->cert_info; + + if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0) { + if ((xi->version = M_ASN1_INTEGER_new()) == NULL) + goto err; + if (!ASN1_INTEGER_set(xi->version, 2)) + goto err; + /* + * xi->extensions=ri->attributes; <- bad, should not ever be done + * ri->attributes=NULL; + */ + } + + xn = X509_REQ_get_subject_name(r); + if (X509_set_subject_name(ret, xn) == 0) + goto err; + if (X509_set_issuer_name(ret, xn) == 0) + goto err; + + if (X509_gmtime_adj(xi->validity->notBefore, 0) == NULL) + goto err; + if (X509_gmtime_adj(xi->validity->notAfter, (long)60 * 60 * 24 * days) == + NULL) + goto err; + + pubkey = X509_REQ_get_pubkey(r); + res = X509_set_pubkey(ret, pubkey); + EVP_PKEY_free(pubkey); + + if (!res || !X509_sign(ret, pkey, EVP_md5())) + goto err; + if (0) { + err: + X509_free(ret); + ret = NULL; + } + return (ret); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c new file mode 100644 index 0000000..4478c3c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c @@ -0,0 +1,341 @@ +/* crypto/x509/x509_req.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 + +X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + X509_REQ *ret; + X509_REQ_INFO *ri; + int i; + EVP_PKEY *pktmp; + + ret = X509_REQ_new(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + ri = ret->req_info; + + ri->version->length = 1; + ri->version->data = (unsigned char *)OPENSSL_malloc(1); + if (ri->version->data == NULL) + goto err; + ri->version->data[0] = 0; /* version == 0 */ + + if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x))) + goto err; + + pktmp = X509_get_pubkey(x); + if (pktmp == NULL) + goto err; + i = X509_REQ_set_pubkey(ret, pktmp); + EVP_PKEY_free(pktmp); + if (!i) + goto err; + + if (pkey != NULL) { + if (!X509_REQ_sign(ret, pkey, md)) + goto err; + } + return (ret); + err: + X509_REQ_free(ret); + return (NULL); +} + +EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) +{ + if ((req == NULL) || (req->req_info == NULL)) + return (NULL); + return (X509_PUBKEY_get(req->req_info->pubkey)); +} + +int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) +{ + EVP_PKEY *xk = NULL; + int ok = 0; + + xk = X509_REQ_get_pubkey(x); + switch (EVP_PKEY_cmp(xk, k)) { + case 1: + ok = 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: + if (k->type == EVP_PKEY_EC) { + OPENSSL_PUT_ERROR(X509, ERR_R_EC_LIB); + break; + } + if (k->type == EVP_PKEY_DH) { + /* No idea */ + OPENSSL_PUT_ERROR(X509, X509_R_CANT_CHECK_DH_KEY); + break; + } + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + } + + EVP_PKEY_free(xk); + return (ok); +} + +/* + * It seems several organisations had the same idea of including a list of + * extensions in a certificate request. There are at least two OIDs that are + * used and there may be more: so the list is configurable. + */ + +static const int ext_nid_list[] = { NID_ext_req, NID_ms_ext_req, NID_undef }; + +static const int *ext_nids = ext_nid_list; + +int X509_REQ_extension_nid(int req_nid) +{ + int i, nid; + for (i = 0;; i++) { + nid = ext_nids[i]; + if (nid == NID_undef) + return 0; + else if (req_nid == nid) + return 1; + } +} + +const int *X509_REQ_get_extension_nids(void) +{ + return ext_nids; +} + +void X509_REQ_set_extension_nids(const int *nids) +{ + ext_nids = nids; +} + +STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req) +{ + X509_ATTRIBUTE *attr; + ASN1_TYPE *ext = NULL; + int idx; + const int *pnid; + const unsigned char *p; + + if ((req == NULL) || (req->req_info == NULL) || !ext_nids) + return (NULL); + for (pnid = ext_nids; *pnid != NID_undef; pnid++) { + idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); + if (idx == -1) + continue; + attr = X509_REQ_get_attr(req, idx); + if (attr->single) + ext = attr->value.single; + else if (sk_ASN1_TYPE_num(attr->value.set)) + ext = sk_ASN1_TYPE_value(attr->value.set, 0); + break; + } + if (!ext || (ext->type != V_ASN1_SEQUENCE)) + return NULL; + p = ext->value.sequence->data; + return (STACK_OF(X509_EXTENSION) *) + ASN1_item_d2i(NULL, &p, ext->value.sequence->length, + ASN1_ITEM_rptr(X509_EXTENSIONS)); +} + +/* + * Add a STACK_OF extensions to a certificate request: allow alternative OIDs + * in case we want to create a non standard one. + */ + +int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + int nid) +{ + ASN1_TYPE *at = NULL; + X509_ATTRIBUTE *attr = NULL; + if (!(at = ASN1_TYPE_new()) || !(at->value.sequence = ASN1_STRING_new())) + goto err; + + at->type = V_ASN1_SEQUENCE; + /* Generate encoding of extensions */ + at->value.sequence->length = + ASN1_item_i2d((ASN1_VALUE *)exts, + &at->value.sequence->data, + ASN1_ITEM_rptr(X509_EXTENSIONS)); + if (!(attr = X509_ATTRIBUTE_new())) + goto err; + if (!(attr->value.set = sk_ASN1_TYPE_new_null())) + goto err; + if (!sk_ASN1_TYPE_push(attr->value.set, at)) + goto err; + at = NULL; + attr->single = 0; + attr->object = (ASN1_OBJECT *)OBJ_nid2obj(nid); + if (!req->req_info->attributes) { + if (!(req->req_info->attributes = sk_X509_ATTRIBUTE_new_null())) + goto err; + } + if (!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) + goto err; + return 1; + err: + X509_ATTRIBUTE_free(attr); + ASN1_TYPE_free(at); + return 0; +} + +/* This is the normal usage: use the "official" OID */ +int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) +{ + return X509_REQ_add_extensions_nid(req, exts, NID_ext_req); +} + +/* Request attribute functions */ + +int X509_REQ_get_attr_count(const X509_REQ *req) +{ + return X509at_get_attr_count(req->req_info->attributes); +} + +int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) +{ + return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos); +} + +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, + int lastpos) +{ + return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); +} + +X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc) +{ + return X509at_get_attr(req->req_info->attributes, loc); +} + +X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc) +{ + return X509at_delete_attr(req->req_info->attributes, loc); +} + +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) +{ + if (X509at_add1_attr(&req->req_info->attributes, attr)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, + type, bytes, len)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_NID(&req->req_info->attributes, nid, + type, bytes, len)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, + type, bytes, len)) + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back new file mode 100644 index 0000000..d918b09 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back @@ -0,0 +1,341 @@ +/* crypto/x509/x509_req.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 + +X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + X509_REQ *ret; + X509_REQ_INFO *ri; + int i; + EVP_PKEY *pktmp; + + ret = X509_REQ_new(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + + ri = ret->req_info; + + ri->version->length = 1; + ri->version->data = (unsigned char *)OPENSSL_malloc(1); + if (ri->version->data == NULL) + goto err; + ri->version->data[0] = 0; /* version == 0 */ + + if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x))) + goto err; + + pktmp = X509_get_pubkey(x); + if (pktmp == NULL) + goto err; + i = X509_REQ_set_pubkey(ret, pktmp); + EVP_PKEY_free(pktmp); + if (!i) + goto err; + + if (pkey != NULL) { + if (!X509_REQ_sign(ret, pkey, md)) + goto err; + } + return (ret); + err: + X509_REQ_free(ret); + return (NULL); +} + +EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) +{ + if ((req == NULL) || (req->req_info == NULL)) + return (NULL); + return (X509_PUBKEY_get(req->req_info->pubkey)); +} + +int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) +{ + EVP_PKEY *xk = NULL; + int ok = 0; + + xk = X509_REQ_get_pubkey(x); + switch (EVP_PKEY_cmp(xk, k)) { + case 1: + ok = 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: + if (k->type == EVP_PKEY_EC) { + OPENSSL_PUT_ERROR(X509, ERR_R_EC_LIB); + break; + } + if (k->type == EVP_PKEY_DH) { + /* No idea */ + OPENSSL_PUT_ERROR(X509, X509_R_CANT_CHECK_DH_KEY); + break; + } + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + } + + EVP_PKEY_free(xk); + return (ok); +} + +/* + * It seems several organisations had the same idea of including a list of + * extensions in a certificate request. There are at least two OIDs that are + * used and there may be more: so the list is configurable. + */ + +static const int ext_nid_list[] = { NID_ext_req, NID_ms_ext_req, NID_undef }; + +static const int *ext_nids = ext_nid_list; + +int X509_REQ_extension_nid(int req_nid) +{ + int i, nid; + for (i = 0;; i++) { + nid = ext_nids[i]; + if (nid == NID_undef) + return 0; + else if (req_nid == nid) + return 1; + } +} + +const int *X509_REQ_get_extension_nids(void) +{ + return ext_nids; +} + +void X509_REQ_set_extension_nids(const int *nids) +{ + ext_nids = nids; +} + +STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req) +{ + X509_ATTRIBUTE *attr; + ASN1_TYPE *ext = NULL; + int idx; + const int *pnid; + const unsigned char *p; + + if ((req == NULL) || (req->req_info == NULL) || !ext_nids) + return (NULL); + for (pnid = ext_nids; *pnid != NID_undef; pnid++) { + idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); + if (idx == -1) + continue; + attr = X509_REQ_get_attr(req, idx); + if (attr->single) + ext = attr->value.single; + else if (sk_ASN1_TYPE_num(attr->value.set)) + ext = sk_ASN1_TYPE_value(attr->value.set, 0); + break; + } + if (!ext || (ext->type != V_ASN1_SEQUENCE)) + return NULL; + p = ext->value.sequence->data; + return (STACK_OF(X509_EXTENSION) *) + ASN1_item_d2i(NULL, &p, ext->value.sequence->length, + ASN1_ITEM_rptr(X509_EXTENSIONS)); +} + +/* + * Add a STACK_OF extensions to a certificate request: allow alternative OIDs + * in case we want to create a non standard one. + */ + +int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + int nid) +{ + ASN1_TYPE *at = NULL; + X509_ATTRIBUTE *attr = NULL; + if (!(at = ASN1_TYPE_new()) || !(at->value.sequence = ASN1_STRING_new())) + goto err; + + at->type = V_ASN1_SEQUENCE; + /* Generate encoding of extensions */ + at->value.sequence->length = + ASN1_item_i2d((ASN1_VALUE *)exts, + &at->value.sequence->data, + ASN1_ITEM_rptr(X509_EXTENSIONS)); + if (!(attr = X509_ATTRIBUTE_new())) + goto err; + if (!(attr->value.set = sk_ASN1_TYPE_new_null())) + goto err; + if (!sk_ASN1_TYPE_push(attr->value.set, at)) + goto err; + at = NULL; + attr->single = 0; + attr->object = (ASN1_OBJECT *)OBJ_nid2obj(nid); + if (!req->req_info->attributes) { + if (!(req->req_info->attributes = sk_X509_ATTRIBUTE_new_null())) + goto err; + } + if (!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) + goto err; + return 1; + err: + X509_ATTRIBUTE_free(attr); + ASN1_TYPE_free(at); + return 0; +} + +/* This is the normal usage: use the "official" OID */ +int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) +{ + return X509_REQ_add_extensions_nid(req, exts, NID_ext_req); +} + +/* Request attribute functions */ + +int X509_REQ_get_attr_count(const X509_REQ *req) +{ + return X509at_get_attr_count(req->req_info->attributes); +} + +int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) +{ + return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos); +} + +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, + int lastpos) +{ + return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); +} + +X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc) +{ + return X509at_get_attr(req->req_info->attributes, loc); +} + +X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc) +{ + return X509at_delete_attr(req->req_info->attributes, loc); +} + +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) +{ + if (X509at_add1_attr(&req->req_info->attributes, attr)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, + type, bytes, len)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_NID(&req->req_info->attributes, nid, + type, bytes, len)) + return 1; + return 0; +} + +int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, + type, bytes, len)) + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c new file mode 100644 index 0000000..7c8ba99 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c @@ -0,0 +1,169 @@ +/* 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 + +int X509_set_version(X509 *x, long version) +{ + if (x == NULL) + return (0); + if (version == 0) { + M_ASN1_INTEGER_free(x->cert_info->version); + x->cert_info->version = NULL; + return (1); + } + if (x->cert_info->version == NULL) { + if ((x->cert_info->version = M_ASN1_INTEGER_new()) == NULL) + return (0); + } + return (ASN1_INTEGER_set(x->cert_info->version, version)); +} + +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) +{ + ASN1_INTEGER *in; + + if (x == NULL) + return (0); + in = x->cert_info->serialNumber; + if (in != serial) { + in = M_ASN1_INTEGER_dup(serial); + if (in != NULL) { + M_ASN1_INTEGER_free(x->cert_info->serialNumber); + x->cert_info->serialNumber = in; + } + } + return (in != NULL); +} + +int X509_set_issuer_name(X509 *x, X509_NAME *name) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_NAME_set(&x->cert_info->issuer, name)); +} + +int X509_set_subject_name(X509 *x, X509_NAME *name) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_NAME_set(&x->cert_info->subject, name)); +} + +int X509_set_notBefore(X509 *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if ((x == NULL) || (x->cert_info->validity == NULL)) + return (0); + in = x->cert_info->validity->notBefore; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->cert_info->validity->notBefore); + x->cert_info->validity->notBefore = in; + } + } + return (in != NULL); +} + +const ASN1_TIME *X509_get0_notBefore(const X509 *x) +{ + return x->cert_info->validity->notBefore; +} + +int X509_set_notAfter(X509 *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if ((x == NULL) || (x->cert_info->validity == NULL)) + return (0); + in = x->cert_info->validity->notAfter; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->cert_info->validity->notAfter); + x->cert_info->validity->notAfter = in; + } + } + return (in != NULL); +} + +const ASN1_TIME *X509_get0_notAfter(const X509 *x) +{ + return x->cert_info->validity->notAfter; +} + +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back new file mode 100644 index 0000000..0aa92bd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back @@ -0,0 +1,169 @@ +/* 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 + +int X509_set_version(X509 *x, long version) +{ + if (x == NULL) + return (0); + if (version == 0) { + M_ASN1_INTEGER_free(x->cert_info->version); + x->cert_info->version = NULL; + return (1); + } + if (x->cert_info->version == NULL) { + if ((x->cert_info->version = M_ASN1_INTEGER_new()) == NULL) + return (0); + } + return (ASN1_INTEGER_set(x->cert_info->version, version)); +} + +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) +{ + ASN1_INTEGER *in; + + if (x == NULL) + return (0); + in = x->cert_info->serialNumber; + if (in != serial) { + in = M_ASN1_INTEGER_dup(serial); + if (in != NULL) { + M_ASN1_INTEGER_free(x->cert_info->serialNumber); + x->cert_info->serialNumber = in; + } + } + return (in != NULL); +} + +int X509_set_issuer_name(X509 *x, X509_NAME *name) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_NAME_set(&x->cert_info->issuer, name)); +} + +int X509_set_subject_name(X509 *x, X509_NAME *name) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_NAME_set(&x->cert_info->subject, name)); +} + +int X509_set_notBefore(X509 *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if ((x == NULL) || (x->cert_info->validity == NULL)) + return (0); + in = x->cert_info->validity->notBefore; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->cert_info->validity->notBefore); + x->cert_info->validity->notBefore = in; + } + } + return (in != NULL); +} + +const ASN1_TIME *X509_get0_notBefore(const X509 *x) +{ + return x->cert_info->validity->notBefore; +} + +int X509_set_notAfter(X509 *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if ((x == NULL) || (x->cert_info->validity == NULL)) + return (0); + in = x->cert_info->validity->notAfter; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->cert_info->validity->notAfter); + x->cert_info->validity->notAfter = in; + } + } + return (in != NULL); +} + +const ASN1_TIME *X509_get0_notAfter(const X509 *x) +{ + return x->cert_info->validity->notAfter; +} + +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->cert_info == NULL)) + return (0); + return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); +} + +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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c new file mode 100644 index 0000000..f95d898 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c @@ -0,0 +1,326 @@ +/* + * 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 + +static int tr_cmp(const X509_TRUST **a, const X509_TRUST **b); +static void trtable_free(X509_TRUST *p); + +static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); +static int trust_1oid(X509_TRUST *trust, X509 *x, int flags); +static int trust_compat(X509_TRUST *trust, X509 *x, int flags); + +static int obj_trust(int id, X509 *x, int flags); +static int (*default_trust) (int id, X509 *x, int flags) = obj_trust; + +/* + * WARNING: the following table should be kept in order of trust and without + * any gaps so we can just subtract the minimum trust value to get an index + * into the table + */ + +static X509_TRUST trstandard[] = { + {X509_TRUST_COMPAT, 0, trust_compat, (char *)"compatible", 0, NULL}, + {X509_TRUST_SSL_CLIENT, 0, trust_1oidany, (char *)"SSL Client", + NID_client_auth, NULL}, + {X509_TRUST_SSL_SERVER, 0, trust_1oidany, (char *)"SSL Server", + NID_server_auth, NULL}, + {X509_TRUST_EMAIL, 0, trust_1oidany, (char *)"S/MIME email", + NID_email_protect, NULL}, + {X509_TRUST_OBJECT_SIGN, 0, trust_1oidany, (char *)"Object Signer", + NID_code_sign, NULL}, + {X509_TRUST_OCSP_SIGN, 0, trust_1oid, (char *)"OCSP responder", + NID_OCSP_sign, NULL}, + {X509_TRUST_OCSP_REQUEST, 0, trust_1oid, (char *)"OCSP request", + NID_ad_OCSP, NULL}, + {X509_TRUST_TSA, 0, trust_1oidany, (char *)"TSA server", NID_time_stamp, + NULL} +}; + +#define X509_TRUST_COUNT (sizeof(trstandard)/sizeof(X509_TRUST)) + +static STACK_OF(X509_TRUST) *trtable = NULL; + +static int tr_cmp(const X509_TRUST **a, const X509_TRUST **b) +{ + return (*a)->trust - (*b)->trust; +} + +int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *, + int) { + int (*oldtrust) (int, X509 *, int); + oldtrust = default_trust; + default_trust = trust; + return oldtrust; +} + +int X509_check_trust(X509 *x, int id, int flags) +{ + X509_TRUST *pt; + int idx; + if (id == -1) + return 1; + /* We get this as a default value */ + if (id == 0) { + int rv; + rv = obj_trust(NID_anyExtendedKeyUsage, x, 0); + if (rv != X509_TRUST_UNTRUSTED) + return rv; + return trust_compat(NULL, x, 0); + } + idx = X509_TRUST_get_by_id(id); + if (idx == -1) + return default_trust(id, x, flags); + pt = X509_TRUST_get0(idx); + return pt->check_trust(pt, x, flags); +} + +int X509_TRUST_get_count(void) +{ + if (!trtable) + return X509_TRUST_COUNT; + return sk_X509_TRUST_num(trtable) + X509_TRUST_COUNT; +} + +X509_TRUST *X509_TRUST_get0(int idx) +{ + if (idx < 0) + return NULL; + if (idx < (int)X509_TRUST_COUNT) + return trstandard + idx; + return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT); +} + +int X509_TRUST_get_by_id(int id) +{ + X509_TRUST tmp; + size_t idx; + + if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX)) + return id - X509_TRUST_MIN; + tmp.trust = id; + if (!trtable) + return -1; + sk_X509_TRUST_sort(trtable); + if (!sk_X509_TRUST_find(trtable, &idx, &tmp)) { + return -1; + } + return idx + X509_TRUST_COUNT; +} + +int X509_TRUST_set(int *t, int trust) +{ + if (X509_TRUST_get_by_id(trust) == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_TRUST); + return 0; + } + *t = trust; + return 1; +} + +int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), + char *name, int arg1, void *arg2) +{ + int idx; + X509_TRUST *trtmp; + char *name_dup; + + /* + * This is set according to what we change: application can't set it + */ + flags &= ~X509_TRUST_DYNAMIC; + /* This will always be set for application modified trust entries */ + flags |= X509_TRUST_DYNAMIC_NAME; + /* Get existing entry if any */ + idx = X509_TRUST_get_by_id(id); + /* Need a new entry */ + if (idx == -1) { + if (!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + trtmp->flags = X509_TRUST_DYNAMIC; + } else + trtmp = X509_TRUST_get0(idx); + + /* Duplicate the supplied name. */ + name_dup = OPENSSL_strdup(name); + if (name_dup == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (idx == -1) + OPENSSL_free(trtmp); + return 0; + } + + /* OPENSSL_free existing name if dynamic */ + if (trtmp->flags & X509_TRUST_DYNAMIC_NAME) + OPENSSL_free(trtmp->name); + trtmp->name = name_dup; + /* Keep the dynamic flag of existing entry */ + trtmp->flags &= X509_TRUST_DYNAMIC; + /* Set all other flags */ + trtmp->flags |= flags; + + trtmp->trust = id; + trtmp->check_trust = ck; + trtmp->arg1 = arg1; + trtmp->arg2 = arg2; + + /* If its a new entry manage the dynamic table */ + if (idx == -1) { + if (!trtable && !(trtable = sk_X509_TRUST_new(tr_cmp))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + trtable_free(trtmp); + return 0; + } + if (!sk_X509_TRUST_push(trtable, trtmp)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + trtable_free(trtmp); + return 0; + } + } + return 1; +} + +static void trtable_free(X509_TRUST *p) +{ + if (!p) + return; + if (p->flags & X509_TRUST_DYNAMIC) { + if (p->flags & X509_TRUST_DYNAMIC_NAME) + OPENSSL_free(p->name); + OPENSSL_free(p); + } +} + +void X509_TRUST_cleanup(void) +{ + unsigned int i; + for (i = 0; i < X509_TRUST_COUNT; i++) + trtable_free(trstandard + i); + sk_X509_TRUST_pop_free(trtable, trtable_free); + trtable = NULL; +} + +int X509_TRUST_get_flags(X509_TRUST *xp) +{ + return xp->flags; +} + +char *X509_TRUST_get0_name(X509_TRUST *xp) +{ + return xp->name; +} + +int X509_TRUST_get_trust(X509_TRUST *xp) +{ + return xp->trust; +} + +static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags) +{ + if (x->aux && (x->aux->trust || x->aux->reject)) + return obj_trust(trust->arg1, x, flags); + /* + * we don't have any trust settings: for compatibility we return trusted + * if it is self signed + */ + return trust_compat(trust, x, flags); +} + +static int trust_1oid(X509_TRUST *trust, X509 *x, int flags) +{ + if (x->aux) + return obj_trust(trust->arg1, x, flags); + return X509_TRUST_UNTRUSTED; +} + +static int trust_compat(X509_TRUST *trust, X509 *x, int flags) +{ + X509_check_purpose(x, -1, 0); + if (x->ex_flags & EXFLAG_SS) + return X509_TRUST_TRUSTED; + else + return X509_TRUST_UNTRUSTED; +} + +static int obj_trust(int id, X509 *x, int flags) +{ + ASN1_OBJECT *obj; + size_t i; + X509_CERT_AUX *ax; + ax = x->aux; + if (!ax) + return X509_TRUST_UNTRUSTED; + if (ax->reject) { + for (i = 0; i < sk_ASN1_OBJECT_num(ax->reject); i++) { + obj = sk_ASN1_OBJECT_value(ax->reject, i); + if (OBJ_obj2nid(obj) == id) + return X509_TRUST_REJECTED; + } + } + if (ax->trust) { + for (i = 0; i < sk_ASN1_OBJECT_num(ax->trust); i++) { + obj = sk_ASN1_OBJECT_value(ax->trust, i); + if (OBJ_obj2nid(obj) == id) + return X509_TRUST_TRUSTED; + } + } + return X509_TRUST_UNTRUSTED; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back new file mode 100644 index 0000000..18ac883 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back @@ -0,0 +1,326 @@ +/* + * 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 + +static int tr_cmp(const X509_TRUST **a, const X509_TRUST **b); +static void trtable_free(X509_TRUST *p); + +static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); +static int trust_1oid(X509_TRUST *trust, X509 *x, int flags); +static int trust_compat(X509_TRUST *trust, X509 *x, int flags); + +static int obj_trust(int id, X509 *x, int flags); +static int (*default_trust) (int id, X509 *x, int flags) = obj_trust; + +/* + * WARNING: the following table should be kept in order of trust and without + * any gaps so we can just subtract the minimum trust value to get an index + * into the table + */ + +static X509_TRUST trstandard[] = { + {X509_TRUST_COMPAT, 0, trust_compat, (char *)"compatible", 0, NULL}, + {X509_TRUST_SSL_CLIENT, 0, trust_1oidany, (char *)"SSL Client", + NID_client_auth, NULL}, + {X509_TRUST_SSL_SERVER, 0, trust_1oidany, (char *)"SSL Server", + NID_server_auth, NULL}, + {X509_TRUST_EMAIL, 0, trust_1oidany, (char *)"S/MIME email", + NID_email_protect, NULL}, + {X509_TRUST_OBJECT_SIGN, 0, trust_1oidany, (char *)"Object Signer", + NID_code_sign, NULL}, + {X509_TRUST_OCSP_SIGN, 0, trust_1oid, (char *)"OCSP responder", + NID_OCSP_sign, NULL}, + {X509_TRUST_OCSP_REQUEST, 0, trust_1oid, (char *)"OCSP request", + NID_ad_OCSP, NULL}, + {X509_TRUST_TSA, 0, trust_1oidany, (char *)"TSA server", NID_time_stamp, + NULL} +}; + +#define X509_TRUST_COUNT (sizeof(trstandard)/sizeof(X509_TRUST)) + +static STACK_OF(X509_TRUST) *trtable = NULL; + +static int tr_cmp(const X509_TRUST **a, const X509_TRUST **b) +{ + return (*a)->trust - (*b)->trust; +} + +int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *, + int) { + int (*oldtrust) (int, X509 *, int); + oldtrust = default_trust; + default_trust = trust; + return oldtrust; +} + +int X509_check_trust(X509 *x, int id, int flags) +{ + X509_TRUST *pt; + int idx; + if (id == -1) + return 1; + /* We get this as a default value */ + if (id == 0) { + int rv; + rv = obj_trust(NID_anyExtendedKeyUsage, x, 0); + if (rv != X509_TRUST_UNTRUSTED) + return rv; + return trust_compat(NULL, x, 0); + } + idx = X509_TRUST_get_by_id(id); + if (idx == -1) + return default_trust(id, x, flags); + pt = X509_TRUST_get0(idx); + return pt->check_trust(pt, x, flags); +} + +int X509_TRUST_get_count(void) +{ + if (!trtable) + return X509_TRUST_COUNT; + return sk_X509_TRUST_num(trtable) + X509_TRUST_COUNT; +} + +X509_TRUST *X509_TRUST_get0(int idx) +{ + if (idx < 0) + return NULL; + if (idx < (int)X509_TRUST_COUNT) + return trstandard + idx; + return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT); +} + +int X509_TRUST_get_by_id(int id) +{ + X509_TRUST tmp; + size_t idx; + + if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX)) + return id - X509_TRUST_MIN; + tmp.trust = id; + if (!trtable) + return -1; + sk_X509_TRUST_sort(trtable); + if (!sk_X509_TRUST_find(trtable, &idx, &tmp)) { + return -1; + } + return idx + X509_TRUST_COUNT; +} + +int X509_TRUST_set(int *t, int trust) +{ + if (X509_TRUST_get_by_id(trust) == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_TRUST); + return 0; + } + *t = trust; + return 1; +} + +int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), + char *name, int arg1, void *arg2) +{ + int idx; + X509_TRUST *trtmp; + char *name_dup; + + /* + * This is set according to what we change: application can't set it + */ + flags &= ~X509_TRUST_DYNAMIC; + /* This will always be set for application modified trust entries */ + flags |= X509_TRUST_DYNAMIC_NAME; + /* Get existing entry if any */ + idx = X509_TRUST_get_by_id(id); + /* Need a new entry */ + if (idx == -1) { + if (!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + trtmp->flags = X509_TRUST_DYNAMIC; + } else + trtmp = X509_TRUST_get0(idx); + + /* Duplicate the supplied name. */ + name_dup = OPENSSL_strdup(name); + if (name_dup == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (idx == -1) + OPENSSL_free(trtmp); + return 0; + } + + /* OPENSSL_free existing name if dynamic */ + if (trtmp->flags & X509_TRUST_DYNAMIC_NAME) + OPENSSL_free(trtmp->name); + trtmp->name = name_dup; + /* Keep the dynamic flag of existing entry */ + trtmp->flags &= X509_TRUST_DYNAMIC; + /* Set all other flags */ + trtmp->flags |= flags; + + trtmp->trust = id; + trtmp->check_trust = ck; + trtmp->arg1 = arg1; + trtmp->arg2 = arg2; + + /* If its a new entry manage the dynamic table */ + if (idx == -1) { + if (!trtable && !(trtable = sk_X509_TRUST_new(tr_cmp))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + trtable_free(trtmp); + return 0; + } + if (!sk_X509_TRUST_push(trtable, trtmp)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + trtable_free(trtmp); + return 0; + } + } + return 1; +} + +static void trtable_free(X509_TRUST *p) +{ + if (!p) + return; + if (p->flags & X509_TRUST_DYNAMIC) { + if (p->flags & X509_TRUST_DYNAMIC_NAME) + OPENSSL_free(p->name); + OPENSSL_free(p); + } +} + +void X509_TRUST_cleanup(void) +{ + unsigned int i; + for (i = 0; i < X509_TRUST_COUNT; i++) + trtable_free(trstandard + i); + sk_X509_TRUST_pop_free(trtable, trtable_free); + trtable = NULL; +} + +int X509_TRUST_get_flags(X509_TRUST *xp) +{ + return xp->flags; +} + +char *X509_TRUST_get0_name(X509_TRUST *xp) +{ + return xp->name; +} + +int X509_TRUST_get_trust(X509_TRUST *xp) +{ + return xp->trust; +} + +static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags) +{ + if (x->aux && (x->aux->trust || x->aux->reject)) + return obj_trust(trust->arg1, x, flags); + /* + * we don't have any trust settings: for compatibility we return trusted + * if it is self signed + */ + return trust_compat(trust, x, flags); +} + +static int trust_1oid(X509_TRUST *trust, X509 *x, int flags) +{ + if (x->aux) + return obj_trust(trust->arg1, x, flags); + return X509_TRUST_UNTRUSTED; +} + +static int trust_compat(X509_TRUST *trust, X509 *x, int flags) +{ + X509_check_purpose(x, -1, 0); + if (x->ex_flags & EXFLAG_SS) + return X509_TRUST_TRUSTED; + else + return X509_TRUST_UNTRUSTED; +} + +static int obj_trust(int id, X509 *x, int flags) +{ + ASN1_OBJECT *obj; + size_t i; + X509_CERT_AUX *ax; + ax = x->aux; + if (!ax) + return X509_TRUST_UNTRUSTED; + if (ax->reject) { + for (i = 0; i < sk_ASN1_OBJECT_num(ax->reject); i++) { + obj = sk_ASN1_OBJECT_value(ax->reject, i); + if (OBJ_obj2nid(obj) == id) + return X509_TRUST_REJECTED; + } + } + if (ax->trust) { + for (i = 0; i < sk_ASN1_OBJECT_num(ax->trust); i++) { + obj = sk_ASN1_OBJECT_value(ax->trust, i); + if (OBJ_obj2nid(obj) == id) + return X509_TRUST_TRUSTED; + } + } + return X509_TRUST_UNTRUSTED; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c new file mode 100644 index 0000000..9a2eca8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c @@ -0,0 +1,204 @@ +/* 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 + +const char *X509_verify_cert_error_string(long n) +{ + switch ((int)n) { + case X509_V_OK: + return ("ok"); + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + return ("unable to get issuer certificate"); + case X509_V_ERR_UNABLE_TO_GET_CRL: + return ("unable to get certificate CRL"); + case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: + return ("unable to decrypt certificate's signature"); + case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: + return ("unable to decrypt CRL's signature"); + case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: + return ("unable to decode issuer public key"); + case X509_V_ERR_CERT_SIGNATURE_FAILURE: + return ("certificate signature failure"); + case X509_V_ERR_CRL_SIGNATURE_FAILURE: + return ("CRL signature failure"); + case X509_V_ERR_CERT_NOT_YET_VALID: + return ("certificate is not yet valid"); + case X509_V_ERR_CRL_NOT_YET_VALID: + return ("CRL is not yet valid"); + case X509_V_ERR_CERT_HAS_EXPIRED: + return ("certificate has expired"); + case X509_V_ERR_CRL_HAS_EXPIRED: + return ("CRL has expired"); + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + return ("format error in certificate's notBefore field"); + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + return ("format error in certificate's notAfter field"); + case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + return ("format error in CRL's lastUpdate field"); + case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + return ("format error in CRL's nextUpdate field"); + case X509_V_ERR_OUT_OF_MEM: + return ("out of memory"); + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + return ("self signed certificate"); + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + return ("self signed certificate in certificate chain"); + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + return ("unable to get local issuer certificate"); + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + return ("unable to verify the first certificate"); + case X509_V_ERR_CERT_CHAIN_TOO_LONG: + return ("certificate chain too long"); + case X509_V_ERR_CERT_REVOKED: + return ("certificate revoked"); + case X509_V_ERR_INVALID_CA: + return ("invalid CA certificate"); + case X509_V_ERR_INVALID_NON_CA: + return ("invalid non-CA certificate (has CA markings)"); + case X509_V_ERR_PATH_LENGTH_EXCEEDED: + return ("path length constraint exceeded"); + case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED: + return ("proxy path length constraint exceeded"); + case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED: + return + ("proxy certificates not allowed, please set the appropriate flag"); + case X509_V_ERR_INVALID_PURPOSE: + return ("unsupported certificate purpose"); + case X509_V_ERR_CERT_UNTRUSTED: + return ("certificate not trusted"); + case X509_V_ERR_CERT_REJECTED: + return ("certificate rejected"); + case X509_V_ERR_APPLICATION_VERIFICATION: + return ("application verification failure"); + case X509_V_ERR_SUBJECT_ISSUER_MISMATCH: + return ("subject issuer mismatch"); + case X509_V_ERR_AKID_SKID_MISMATCH: + return ("authority and subject key identifier mismatch"); + case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: + return ("authority and issuer serial number mismatch"); + case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: + return ("key usage does not include certificate signing"); + case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: + return ("unable to get CRL issuer certificate"); + case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION: + return ("unhandled critical extension"); + case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN: + return ("key usage does not include CRL signing"); + case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE: + return ("key usage does not include digital signature"); + case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION: + return ("unhandled critical CRL extension"); + case X509_V_ERR_INVALID_EXTENSION: + return ("invalid or inconsistent certificate extension"); + case X509_V_ERR_INVALID_POLICY_EXTENSION: + return ("invalid or inconsistent certificate policy extension"); + case X509_V_ERR_NO_EXPLICIT_POLICY: + return ("no explicit policy"); + case X509_V_ERR_DIFFERENT_CRL_SCOPE: + return ("Different CRL scope"); + case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: + return ("Unsupported extension feature"); + case X509_V_ERR_UNNESTED_RESOURCE: + return ("RFC 3779 resource not subset of parent's resources"); + + case X509_V_ERR_PERMITTED_VIOLATION: + return ("permitted subtree violation"); + case X509_V_ERR_EXCLUDED_VIOLATION: + return ("excluded subtree violation"); + case X509_V_ERR_SUBTREE_MINMAX: + return ("name constraints minimum and maximum not supported"); + case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: + return ("unsupported name constraint type"); + case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: + return ("unsupported or invalid name constraint syntax"); + case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: + return ("unsupported or invalid name syntax"); + case X509_V_ERR_CRL_PATH_VALIDATION_ERROR: + return ("CRL path validation error"); + + case X509_V_ERR_SUITE_B_INVALID_VERSION: + return ("Suite B: certificate version invalid"); + case X509_V_ERR_SUITE_B_INVALID_ALGORITHM: + return ("Suite B: invalid public key algorithm"); + case X509_V_ERR_SUITE_B_INVALID_CURVE: + return ("Suite B: invalid ECC curve"); + case X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM: + return ("Suite B: invalid signature algorithm"); + case X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED: + return ("Suite B: curve not allowed for this LOS"); + case X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256: + return ("Suite B: cannot sign P-384 with P-256"); + + case X509_V_ERR_HOSTNAME_MISMATCH: + return ("Hostname mismatch"); + case X509_V_ERR_EMAIL_MISMATCH: + return ("Email address mismatch"); + case X509_V_ERR_IP_ADDRESS_MISMATCH: + return ("IP address mismatch"); + + case X509_V_ERR_INVALID_CALL: + return ("Invalid certificate verification context"); + 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: + return "unknown certificate verification error"; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back new file mode 100644 index 0000000..8e6ac27 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back @@ -0,0 +1,204 @@ +/* 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 + +const char *X509_verify_cert_error_string(long n) +{ + switch ((int)n) { + case X509_V_OK: + return ("ok"); + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + return ("unable to get issuer certificate"); + case X509_V_ERR_UNABLE_TO_GET_CRL: + return ("unable to get certificate CRL"); + case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: + return ("unable to decrypt certificate's signature"); + case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: + return ("unable to decrypt CRL's signature"); + case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: + return ("unable to decode issuer public key"); + case X509_V_ERR_CERT_SIGNATURE_FAILURE: + return ("certificate signature failure"); + case X509_V_ERR_CRL_SIGNATURE_FAILURE: + return ("CRL signature failure"); + case X509_V_ERR_CERT_NOT_YET_VALID: + return ("certificate is not yet valid"); + case X509_V_ERR_CRL_NOT_YET_VALID: + return ("CRL is not yet valid"); + case X509_V_ERR_CERT_HAS_EXPIRED: + return ("certificate has expired"); + case X509_V_ERR_CRL_HAS_EXPIRED: + return ("CRL has expired"); + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + return ("format error in certificate's notBefore field"); + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + return ("format error in certificate's notAfter field"); + case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + return ("format error in CRL's lastUpdate field"); + case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + return ("format error in CRL's nextUpdate field"); + case X509_V_ERR_OUT_OF_MEM: + return ("out of memory"); + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + return ("self signed certificate"); + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + return ("self signed certificate in certificate chain"); + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + return ("unable to get local issuer certificate"); + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + return ("unable to verify the first certificate"); + case X509_V_ERR_CERT_CHAIN_TOO_LONG: + return ("certificate chain too long"); + case X509_V_ERR_CERT_REVOKED: + return ("certificate revoked"); + case X509_V_ERR_INVALID_CA: + return ("invalid CA certificate"); + case X509_V_ERR_INVALID_NON_CA: + return ("invalid non-CA certificate (has CA markings)"); + case X509_V_ERR_PATH_LENGTH_EXCEEDED: + return ("path length constraint exceeded"); + case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED: + return ("proxy path length constraint exceeded"); + case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED: + return + ("proxy certificates not allowed, please set the appropriate flag"); + case X509_V_ERR_INVALID_PURPOSE: + return ("unsupported certificate purpose"); + case X509_V_ERR_CERT_UNTRUSTED: + return ("certificate not trusted"); + case X509_V_ERR_CERT_REJECTED: + return ("certificate rejected"); + case X509_V_ERR_APPLICATION_VERIFICATION: + return ("application verification failure"); + case X509_V_ERR_SUBJECT_ISSUER_MISMATCH: + return ("subject issuer mismatch"); + case X509_V_ERR_AKID_SKID_MISMATCH: + return ("authority and subject key identifier mismatch"); + case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: + return ("authority and issuer serial number mismatch"); + case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: + return ("key usage does not include certificate signing"); + case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: + return ("unable to get CRL issuer certificate"); + case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION: + return ("unhandled critical extension"); + case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN: + return ("key usage does not include CRL signing"); + case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE: + return ("key usage does not include digital signature"); + case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION: + return ("unhandled critical CRL extension"); + case X509_V_ERR_INVALID_EXTENSION: + return ("invalid or inconsistent certificate extension"); + case X509_V_ERR_INVALID_POLICY_EXTENSION: + return ("invalid or inconsistent certificate policy extension"); + case X509_V_ERR_NO_EXPLICIT_POLICY: + return ("no explicit policy"); + case X509_V_ERR_DIFFERENT_CRL_SCOPE: + return ("Different CRL scope"); + case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: + return ("Unsupported extension feature"); + case X509_V_ERR_UNNESTED_RESOURCE: + return ("RFC 3779 resource not subset of parent's resources"); + + case X509_V_ERR_PERMITTED_VIOLATION: + return ("permitted subtree violation"); + case X509_V_ERR_EXCLUDED_VIOLATION: + return ("excluded subtree violation"); + case X509_V_ERR_SUBTREE_MINMAX: + return ("name constraints minimum and maximum not supported"); + case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: + return ("unsupported name constraint type"); + case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: + return ("unsupported or invalid name constraint syntax"); + case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: + return ("unsupported or invalid name syntax"); + case X509_V_ERR_CRL_PATH_VALIDATION_ERROR: + return ("CRL path validation error"); + + case X509_V_ERR_SUITE_B_INVALID_VERSION: + return ("Suite B: certificate version invalid"); + case X509_V_ERR_SUITE_B_INVALID_ALGORITHM: + return ("Suite B: invalid public key algorithm"); + case X509_V_ERR_SUITE_B_INVALID_CURVE: + return ("Suite B: invalid ECC curve"); + case X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM: + return ("Suite B: invalid signature algorithm"); + case X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED: + return ("Suite B: curve not allowed for this LOS"); + case X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256: + return ("Suite B: cannot sign P-384 with P-256"); + + case X509_V_ERR_HOSTNAME_MISMATCH: + return ("Hostname mismatch"); + case X509_V_ERR_EMAIL_MISMATCH: + return ("Email address mismatch"); + case X509_V_ERR_IP_ADDRESS_MISMATCH: + return ("IP address mismatch"); + + case X509_V_ERR_INVALID_CALL: + return ("Invalid certificate verification context"); + 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: + return "unknown certificate verification error"; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c new file mode 100644 index 0000000..0cb893f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c @@ -0,0 +1,278 @@ +/* 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 + +int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x) +{ + if (x == NULL) + return (0); + return (sk_X509_EXTENSION_num(x)); +} + +int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, + int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509v3_get_ext_by_OBJ(x, obj, lastpos)); +} + +int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, + const ASN1_OBJECT *obj, int lastpos) +{ + int n; + X509_EXTENSION *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_EXTENSION_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_EXTENSION_value(sk, lastpos); + if (OBJ_cmp(ex->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, + int lastpos) +{ + int n; + X509_EXTENSION *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_EXTENSION_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_EXTENSION_value(sk, lastpos); + if (((ex->critical > 0) && crit) || ((ex->critical <= 0) && !crit)) + return (lastpos); + } + return (-1); +} + +X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc) +{ + if (x == NULL || loc < 0 || sk_X509_EXTENSION_num(x) <= (size_t)loc) + return NULL; + else + return sk_X509_EXTENSION_value(x, loc); +} + +X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc) +{ + X509_EXTENSION *ret; + + if (x == NULL || loc < 0 || sk_X509_EXTENSION_num(x) <= (size_t)loc) + return (NULL); + ret = sk_X509_EXTENSION_delete(x, loc); + return (ret); +} + +STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc) +{ + X509_EXTENSION *new_ex = NULL; + int n; + STACK_OF(X509_EXTENSION) *sk = NULL; + + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + goto err2; + } + + if (*x == NULL) { + if ((sk = sk_X509_EXTENSION_new_null()) == NULL) + goto err; + } else + sk = *x; + + n = sk_X509_EXTENSION_num(sk); + if (loc > n) + loc = n; + else if (loc < 0) + loc = n; + + if ((new_ex = X509_EXTENSION_dup(ex)) == NULL) + goto err2; + if (!sk_X509_EXTENSION_insert(sk, new_ex, loc)) + goto err; + if (*x == NULL) + *x = sk; + return (sk); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + err2: + if (new_ex != NULL) + X509_EXTENSION_free(new_ex); + if (sk != NULL) + sk_X509_EXTENSION_free(sk); + return (NULL); +} + +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, + int crit, + ASN1_OCTET_STRING *data) +{ + const ASN1_OBJECT *obj; + X509_EXTENSION *ret; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return (NULL); + } + ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); + return (ret); +} + +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + const ASN1_OBJECT *obj, int crit, + ASN1_OCTET_STRING *data) +{ + X509_EXTENSION *ret; + + if ((ex == NULL) || (*ex == NULL)) { + if ((ret = X509_EXTENSION_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + } else + ret = *ex; + + if (!X509_EXTENSION_set_object(ret, obj)) + goto err; + if (!X509_EXTENSION_set_critical(ret, crit)) + goto err; + if (!X509_EXTENSION_set_data(ret, data)) + goto err; + + if ((ex != NULL) && (*ex == NULL)) + *ex = ret; + return (ret); + err: + if ((ex == NULL) || (ret != *ex)) + X509_EXTENSION_free(ret); + return (NULL); +} + +int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj) +{ + if ((ex == NULL) || (obj == NULL)) + return (0); + ASN1_OBJECT_free(ex->object); + ex->object = OBJ_dup(obj); + return ex->object != NULL; +} + +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) +{ + if (ex == NULL) + return (0); + ex->critical = (crit) ? 0xFF : -1; + return (1); +} + +int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) +{ + int i; + + if (ex == NULL) + return (0); + i = M_ASN1_OCTET_STRING_set(ex->value, data->data, data->length); + if (!i) + return (0); + return (1); +} + +ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (NULL); + return (ex->object); +} + +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (NULL); + return (ex->value); +} + +int X509_EXTENSION_get_critical(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (0); + if (ex->critical > 0) + return 1; + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c.grpc_back new file mode 100644 index 0000000..ecbc0dd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c.grpc_back @@ -0,0 +1,278 @@ +/* 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 + +int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x) +{ + if (x == NULL) + return (0); + return (sk_X509_EXTENSION_num(x)); +} + +int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, + int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509v3_get_ext_by_OBJ(x, obj, lastpos)); +} + +int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, + const ASN1_OBJECT *obj, int lastpos) +{ + int n; + X509_EXTENSION *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_EXTENSION_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_EXTENSION_value(sk, lastpos); + if (OBJ_cmp(ex->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, + int lastpos) +{ + int n; + X509_EXTENSION *ex; + + if (sk == NULL) + return (-1); + lastpos++; + if (lastpos < 0) + lastpos = 0; + n = sk_X509_EXTENSION_num(sk); + for (; lastpos < n; lastpos++) { + ex = sk_X509_EXTENSION_value(sk, lastpos); + if (((ex->critical > 0) && crit) || ((ex->critical <= 0) && !crit)) + return (lastpos); + } + return (-1); +} + +X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc) +{ + if (x == NULL || loc < 0 || sk_X509_EXTENSION_num(x) <= (size_t)loc) + return NULL; + else + return sk_X509_EXTENSION_value(x, loc); +} + +X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc) +{ + X509_EXTENSION *ret; + + if (x == NULL || loc < 0 || sk_X509_EXTENSION_num(x) <= (size_t)loc) + return (NULL); + ret = sk_X509_EXTENSION_delete(x, loc); + return (ret); +} + +STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc) +{ + X509_EXTENSION *new_ex = NULL; + int n; + STACK_OF(X509_EXTENSION) *sk = NULL; + + if (x == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + goto err2; + } + + if (*x == NULL) { + if ((sk = sk_X509_EXTENSION_new_null()) == NULL) + goto err; + } else + sk = *x; + + n = sk_X509_EXTENSION_num(sk); + if (loc > n) + loc = n; + else if (loc < 0) + loc = n; + + if ((new_ex = X509_EXTENSION_dup(ex)) == NULL) + goto err2; + if (!sk_X509_EXTENSION_insert(sk, new_ex, loc)) + goto err; + if (*x == NULL) + *x = sk; + return (sk); + err: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + err2: + if (new_ex != NULL) + X509_EXTENSION_free(new_ex); + if (sk != NULL) + sk_X509_EXTENSION_free(sk); + return (NULL); +} + +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, + int crit, + ASN1_OCTET_STRING *data) +{ + const ASN1_OBJECT *obj; + X509_EXTENSION *ret; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return (NULL); + } + ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); + return (ret); +} + +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + const ASN1_OBJECT *obj, int crit, + ASN1_OCTET_STRING *data) +{ + X509_EXTENSION *ret; + + if ((ex == NULL) || (*ex == NULL)) { + if ((ret = X509_EXTENSION_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + } else + ret = *ex; + + if (!X509_EXTENSION_set_object(ret, obj)) + goto err; + if (!X509_EXTENSION_set_critical(ret, crit)) + goto err; + if (!X509_EXTENSION_set_data(ret, data)) + goto err; + + if ((ex != NULL) && (*ex == NULL)) + *ex = ret; + return (ret); + err: + if ((ex == NULL) || (ret != *ex)) + X509_EXTENSION_free(ret); + return (NULL); +} + +int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj) +{ + if ((ex == NULL) || (obj == NULL)) + return (0); + ASN1_OBJECT_free(ex->object); + ex->object = OBJ_dup(obj); + return ex->object != NULL; +} + +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) +{ + if (ex == NULL) + return (0); + ex->critical = (crit) ? 0xFF : -1; + return (1); +} + +int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) +{ + int i; + + if (ex == NULL) + return (0); + i = M_ASN1_OCTET_STRING_set(ex->value, data->data, data->length); + if (!i) + return (0); + return (1); +} + +ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (NULL); + return (ex->object); +} + +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (NULL); + return (ex->value); +} + +int X509_EXTENSION_get_critical(X509_EXTENSION *ex) +{ + if (ex == NULL) + return (0); + if (ex->critical > 0) + return 1; + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c new file mode 100644 index 0000000..3267f12 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c @@ -0,0 +1,2482 @@ +/* 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 "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; + +/* CRL score values */ + +/* No unhandled critical extensions */ + +#define CRL_SCORE_NOCRITICAL 0x100 + +/* certificate is within CRL scope */ + +#define CRL_SCORE_SCOPE 0x080 + +/* CRL times valid */ + +#define CRL_SCORE_TIME 0x040 + +/* Issuer name matches certificate */ + +#define CRL_SCORE_ISSUER_NAME 0x020 + +/* If this score or above CRL is probably valid */ + +#define CRL_SCORE_VALID (CRL_SCORE_NOCRITICAL|CRL_SCORE_TIME|CRL_SCORE_SCOPE) + +/* CRL issuer is certificate issuer */ + +#define CRL_SCORE_ISSUER_CERT 0x018 + +/* CRL issuer is on certificate path */ + +#define CRL_SCORE_SAME_PATH 0x008 + +/* CRL issuer matches CRL AKID */ + +#define CRL_SCORE_AKID 0x004 + +/* Have a delta CRL with valid times */ + +#define CRL_SCORE_TIME_DELTA 0x002 + +static int null_callback(int ok, X509_STORE_CTX *e); +static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); +static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x); +static int check_chain_extensions(X509_STORE_CTX *ctx); +static int check_name_constraints(X509_STORE_CTX *ctx); +static int check_id(X509_STORE_CTX *ctx); +static int check_trust(X509_STORE_CTX *ctx); +static int check_revocation(X509_STORE_CTX *ctx); +static int check_cert(X509_STORE_CTX *ctx); +static int check_policy(X509_STORE_CTX *ctx); + +static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, + unsigned int *preasons, X509_CRL *crl, X509 *x); +static int get_crl_delta(X509_STORE_CTX *ctx, + X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x); +static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, + int *pcrl_score, X509_CRL *base, + STACK_OF(X509_CRL) *crls); +static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer, + int *pcrl_score); +static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score, + unsigned int *preasons); +static int check_crl_path(X509_STORE_CTX *ctx, X509 *x); +static int check_crl_chain(X509_STORE_CTX *ctx, + STACK_OF(X509) *cert_path, + STACK_OF(X509) *crl_path); + +static int internal_verify(X509_STORE_CTX *ctx); + +static int null_callback(int ok, X509_STORE_CTX *e) +{ + return ok; +} + +/* Return 1 is a certificate is self signed */ +static int cert_self_signed(X509 *x) +{ + X509_check_purpose(x, -1, 0); + if (x->ex_flags & EXFLAG_SS) + return 1; + else + return 0; +} + +/* Given a certificate try and find an exact match in the store */ + +static X509 *lookup_cert_match(X509_STORE_CTX *ctx, X509 *x) +{ + STACK_OF(X509) *certs; + X509 *xtmp = NULL; + size_t i; + /* Lookup all certs with matching subject name */ + certs = ctx->lookup_certs(ctx, X509_get_subject_name(x)); + if (certs == NULL) + return NULL; + /* Look for exact match */ + for (i = 0; i < sk_X509_num(certs); i++) { + xtmp = sk_X509_value(certs, i); + if (!X509_cmp(xtmp, x)) + break; + } + if (i < sk_X509_num(certs)) + X509_up_ref(xtmp); + else + xtmp = NULL; + sk_X509_pop_free(certs, X509_free); + return xtmp; +} + +int X509_verify_cert(X509_STORE_CTX *ctx) +{ + X509 *x, *xtmp, *xtmp2, *chain_ss = NULL; + int bad_chain = 0; + X509_VERIFY_PARAM *param = ctx->param; + int depth, i, ok = 0; + int num, j, retry, trust; + int (*cb) (int xok, X509_STORE_CTX *xctx); + STACK_OF(X509) *sktmp = NULL; + if (ctx->cert == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); + ctx->error = X509_V_ERR_INVALID_CALL; + return -1; + } + if (ctx->chain != NULL) { + /* + * This X509_STORE_CTX has already been used to verify a cert. We + * cannot do another one. + */ + OPENSSL_PUT_ERROR(X509, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + ctx->error = X509_V_ERR_INVALID_CALL; + return -1; + } + + cb = ctx->verify_cb; + + /* + * first we make sure the chain we are going to build is present and that + * the first entry is in place + */ + ctx->chain = sk_X509_new_null(); + if (ctx->chain == NULL || !sk_X509_push(ctx->chain, ctx->cert)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + X509_up_ref(ctx->cert); + ctx->last_untrusted = 1; + + /* We use a temporary STACK so we can chop and hack at it. + * sktmp = ctx->untrusted ++ ctx->ctx->additional_untrusted */ + if (ctx->untrusted != NULL + && (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + + if (ctx->ctx->additional_untrusted != NULL) { + if (sktmp == NULL) { + sktmp = sk_X509_new_null(); + if (sktmp == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + } + + for (size_t k = 0; k < sk_X509_num(ctx->ctx->additional_untrusted); + k++) { + if (!sk_X509_push(sktmp, + sk_X509_value(ctx->ctx->additional_untrusted, + k))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + } + } + + num = sk_X509_num(ctx->chain); + x = sk_X509_value(ctx->chain, num - 1); + depth = param->depth; + + for (;;) { + /* If we have enough, we break */ + if (depth < num) + break; /* FIXME: If this happens, we should take + * note of it and, if appropriate, use the + * X509_V_ERR_CERT_CHAIN_TOO_LONG error code + * later. */ + + /* If we are self signed, we break */ + if (cert_self_signed(x)) + break; + /* + * If asked see if we can find issuer in trusted store first + */ + if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) { + ok = ctx->get_issuer(&xtmp, ctx, x); + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; + goto end; + } + /* + * If successful for now free up cert so it will be picked up + * again later. + */ + if (ok > 0) { + X509_free(xtmp); + break; + } + } + + /* If we were passed a cert chain, use it first */ + if (sktmp != NULL) { + xtmp = find_issuer(ctx, sktmp, x); + if (xtmp != NULL) { + if (!sk_X509_push(ctx->chain, xtmp)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + ok = 0; + goto end; + } + X509_up_ref(xtmp); + (void)sk_X509_delete_ptr(sktmp, xtmp); + ctx->last_untrusted++; + x = xtmp; + num++; + /* + * reparse the full chain for the next one + */ + continue; + } + } + break; + } + + /* Remember how many untrusted certs we have */ + j = num; + /* + * at this point, chain should contain a list of untrusted certificates. + * We now need to add at least one trusted one, if possible, otherwise we + * complain. + */ + + do { + /* + * Examine last certificate in chain and see if it is self signed. + */ + i = sk_X509_num(ctx->chain); + x = sk_X509_value(ctx->chain, i - 1); + if (cert_self_signed(x)) { + /* we have a self signed certificate */ + if (sk_X509_num(ctx->chain) == 1) { + /* + * We have a single self signed certificate: see if we can + * find it in the store. We must have an exact match to avoid + * possible impersonation. + */ + ok = ctx->get_issuer(&xtmp, ctx, x); + if ((ok <= 0) || X509_cmp(x, xtmp)) { + ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT; + ctx->current_cert = x; + ctx->error_depth = i - 1; + if (ok == 1) + X509_free(xtmp); + bad_chain = 1; + ok = cb(0, ctx); + if (!ok) + goto end; + } else { + /* + * We have a match: replace certificate with store + * version so we get any trust settings. + */ + X509_free(x); + x = xtmp; + (void)sk_X509_set(ctx->chain, i - 1, x); + ctx->last_untrusted = 0; + } + } else { + /* + * extract and save self signed certificate for later use + */ + chain_ss = sk_X509_pop(ctx->chain); + ctx->last_untrusted--; + num--; + j--; + x = sk_X509_value(ctx->chain, num - 1); + } + } + /* We now lookup certs from the certificate store */ + for (;;) { + /* If we have enough, we break */ + if (depth < num) + break; + /* If we are self signed, we break */ + if (cert_self_signed(x)) + break; + ok = ctx->get_issuer(&xtmp, ctx, x); + + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; + goto end; + } + if (ok == 0) + break; + x = xtmp; + if (!sk_X509_push(ctx->chain, x)) { + X509_free(xtmp); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + ok = 0; + goto end; + } + num++; + } + + /* we now have our chain, lets check it... */ + trust = check_trust(ctx); + + /* If explicitly rejected error */ + if (trust == X509_TRUST_REJECTED) { + ok = 0; + goto end; + } + /* + * If it's not explicitly trusted then check if there is an alternative + * chain that could be used. We only do this if we haven't already + * checked via TRUSTED_FIRST and the user hasn't switched off alternate + * chain checking + */ + retry = 0; + if (trust != X509_TRUST_TRUSTED + && !(ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) + && !(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS)) { + while (j-- > 1) { + xtmp2 = sk_X509_value(ctx->chain, j - 1); + ok = ctx->get_issuer(&xtmp, ctx, xtmp2); + if (ok < 0) + goto end; + /* Check if we found an alternate chain */ + if (ok > 0) { + /* + * Free up the found cert we'll add it again later + */ + X509_free(xtmp); + + /* + * Dump all the certs above this point - we've found an + * alternate chain + */ + while (num > j) { + xtmp = sk_X509_pop(ctx->chain); + X509_free(xtmp); + num--; + } + ctx->last_untrusted = sk_X509_num(ctx->chain); + retry = 1; + break; + } + } + } + } while (retry); + + /* + * If not explicitly trusted then indicate error unless it's a single + * self signed certificate in which case we've indicated an error already + * and set bad_chain == 1 + */ + if (trust != X509_TRUST_TRUSTED && !bad_chain) { + if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) { + if (ctx->last_untrusted >= num) + ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; + else + ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT; + ctx->current_cert = x; + } else { + + sk_X509_push(ctx->chain, chain_ss); + num++; + ctx->last_untrusted = num; + ctx->current_cert = chain_ss; + ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN; + chain_ss = NULL; + } + + ctx->error_depth = num - 1; + bad_chain = 1; + ok = cb(0, ctx); + if (!ok) + goto end; + } + + /* We have the chain complete: now we need to check its purpose */ + ok = check_chain_extensions(ctx); + + if (!ok) + goto end; + + ok = check_id(ctx); + + if (!ok) + goto end; + + /* + * Check revocation status: we do this after copying parameters because + * they may be needed for CRL signature verification. + */ + + ok = ctx->check_revocation(ctx); + if (!ok) + goto end; + + int err = X509_chain_check_suiteb(&ctx->error_depth, NULL, ctx->chain, + ctx->param->flags); + if (err != X509_V_OK) { + ctx->error = err; + ctx->current_cert = sk_X509_value(ctx->chain, ctx->error_depth); + ok = cb(0, ctx); + if (!ok) + goto end; + } + + /* At this point, we have a chain and need to verify it */ + if (ctx->verify != NULL) + ok = ctx->verify(ctx); + else + ok = internal_verify(ctx); + if (!ok) + goto end; + + /* Check name constraints */ + + ok = check_name_constraints(ctx); + if (!ok) + goto end; + + /* If we get this far evaluate policies */ + if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK)) + ok = ctx->check_policy(ctx); + + end: + if (sktmp != NULL) + sk_X509_free(sktmp); + if (chain_ss != NULL) + X509_free(chain_ss); + + /* Safety net, error returns must set ctx->error */ + if (ok <= 0 && ctx->error == X509_V_OK) + ctx->error = X509_V_ERR_UNSPECIFIED; + return ok; +} + +/* + * Given a STACK_OF(X509) find the issuer of cert (if any) + */ + +static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x) +{ + size_t i; + X509 *issuer; + for (i = 0; i < sk_X509_num(sk); i++) { + issuer = sk_X509_value(sk, i); + if (ctx->check_issued(ctx, x, issuer)) + return issuer; + } + return NULL; +} + +/* Given a possible certificate and issuer check them */ + +static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer) +{ + int ret; + ret = X509_check_issued(issuer, x); + if (ret == X509_V_OK) + return 1; + /* If we haven't asked for issuer errors don't set ctx */ + if (!(ctx->param->flags & X509_V_FLAG_CB_ISSUER_CHECK)) + return 0; + + ctx->error = ret; + ctx->current_cert = x; + ctx->current_issuer = issuer; + return ctx->verify_cb(0, ctx); +} + +/* Alternative lookup method: look from a STACK stored in other_ctx */ + +static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) +{ + *issuer = find_issuer(ctx, ctx->other_ctx, x); + if (*issuer) { + X509_up_ref(*issuer); + return 1; + } else + return 0; +} + +/* + * Check a certificate chains extensions for consistency with the supplied + * purpose + */ + +static int check_chain_extensions(X509_STORE_CTX *ctx) +{ + int i, ok = 0, plen = 0; + X509 *x; + int (*cb) (int xok, X509_STORE_CTX *xctx); + int proxy_path_length = 0; + int purpose; + int allow_proxy_certs; + cb = ctx->verify_cb; + + 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) { + allow_proxy_certs = 0; + purpose = X509_PURPOSE_CRL_SIGN; + } else { + allow_proxy_certs = + ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); + purpose = ctx->param->purpose; + } + + ca_requirement = ca_or_leaf; + + /* Check all untrusted certificates */ + for (i = 0; i < ctx->last_untrusted; i++) { + int ret; + x = sk_X509_value(ctx->chain, i); + if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) + && (x->ex_flags & EXFLAG_CRITICAL)) { + ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { + ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + + switch (ca_requirement) { + case ca_or_leaf: + ret = 1; + break; + case must_not_be_ca: + if (X509_check_ca(x)) { + ret = 0; + ctx->error = X509_V_ERR_INVALID_NON_CA; + } else + ret = 1; + break; + 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; + ok = cb(0, ctx); + if (!ok) + goto end; + } + if (ctx->param->purpose > 0) { + 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; + ok = cb(0, ctx); + if (!ok) + goto end; + } + } + /* Check pathlen if not self issued */ + if ((i > 1) && !(x->ex_flags & EXFLAG_SI) + && (x->ex_pathlen != -1) + && (plen > (x->ex_pathlen + proxy_path_length + 1))) { + ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + /* Increment path length if not self issued */ + if (!(x->ex_flags & EXFLAG_SI)) + plen++; + /* + * If this certificate is a proxy certificate, the next certificate + * must be another proxy certificate or a EE certificate. If not, + * the next certificate must be a CA certificate. + */ + if (x->ex_flags & EXFLAG_PROXY) { + if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { + ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + proxy_path_length++; + 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) +{ + 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--) { + X509 *x = sk_X509_value(ctx->chain, i); + /* Ignore self issued certs unless last in chain */ + if (i && (x->ex_flags & EXFLAG_SI)) + continue; + /* + * Check against constraints for all certificates higher in chain + * including trust anchor. Trust anchor not strictly speaking needed + * but if it includes constraints it is to be assumed it expects them + * to be obeyed. + */ + 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: + continue; + case X509_V_ERR_OUT_OF_MEM: + ctx->error = rv; + return 0; + default: + ctx->error = rv; + ctx->error_depth = i; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + break; + } + } + } + } + + /* 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; +} + +static int check_id_error(X509_STORE_CTX *ctx, int errcode) +{ + ctx->error = errcode; + ctx->current_cert = ctx->cert; + ctx->error_depth = 0; + return ctx->verify_cb(0, ctx); +} + +static int check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) +{ + size_t i; + size_t n = sk_OPENSSL_STRING_num(id->hosts); + char *name; + + if (id->peername != NULL) { + OPENSSL_free(id->peername); + id->peername = NULL; + } + for (i = 0; i < n; ++i) { + name = sk_OPENSSL_STRING_value(id->hosts, i); + if (X509_check_host(x, name, strlen(name), id->hostflags, + &id->peername) > 0) + return 1; + } + return n == 0; +} + +static int check_id(X509_STORE_CTX *ctx) +{ + X509_VERIFY_PARAM *vpm = ctx->param; + X509_VERIFY_PARAM_ID *id = vpm->id; + X509 *x = ctx->cert; + if (id->poison) { + if (!check_id_error(ctx, X509_V_ERR_INVALID_CALL)) + return 0; + } + if (id->hosts && check_hosts(x, id) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_HOSTNAME_MISMATCH)) + return 0; + } + if (id->email && X509_check_email(x, id->email, id->emaillen, 0) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_EMAIL_MISMATCH)) + return 0; + } + if (id->ip && X509_check_ip(x, id->ip, id->iplen, 0) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_IP_ADDRESS_MISMATCH)) + return 0; + } + return 1; +} + +static int check_trust(X509_STORE_CTX *ctx) +{ + size_t i; + int ok; + X509 *x = NULL; + int (*cb) (int xok, X509_STORE_CTX *xctx); + cb = ctx->verify_cb; + /* Check all trusted certificates in chain */ + for (i = ctx->last_untrusted; i < sk_X509_num(ctx->chain); i++) { + x = sk_X509_value(ctx->chain, i); + ok = X509_check_trust(x, ctx->param->trust, 0); + /* If explicitly trusted return trusted */ + if (ok == X509_TRUST_TRUSTED) + return X509_TRUST_TRUSTED; + /* + * If explicitly rejected notify callback and reject if not + * overridden. + */ + if (ok == X509_TRUST_REJECTED) { + ctx->error_depth = i; + ctx->current_cert = x; + ctx->error = X509_V_ERR_CERT_REJECTED; + ok = cb(0, ctx); + if (!ok) + return X509_TRUST_REJECTED; + } + } + /* + * If we accept partial chains and have at least one trusted certificate + * return success. + */ + if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { + X509 *mx; + if (ctx->last_untrusted < (int)sk_X509_num(ctx->chain)) + return X509_TRUST_TRUSTED; + x = sk_X509_value(ctx->chain, 0); + mx = lookup_cert_match(ctx, x); + if (mx) { + (void)sk_X509_set(ctx->chain, 0, mx); + X509_free(x); + ctx->last_untrusted = 0; + return X509_TRUST_TRUSTED; + } + } + + /* + * If no trusted certs in chain at all return untrusted and allow + * standard (no issuer cert) etc errors to be indicated. + */ + return X509_TRUST_UNTRUSTED; +} + +static int check_revocation(X509_STORE_CTX *ctx) +{ + int i, last, ok; + if (!(ctx->param->flags & X509_V_FLAG_CRL_CHECK)) + return 1; + if (ctx->param->flags & X509_V_FLAG_CRL_CHECK_ALL) + last = sk_X509_num(ctx->chain) - 1; + else { + /* If checking CRL paths this isn't the EE certificate */ + if (ctx->parent) + return 1; + last = 0; + } + for (i = 0; i <= last; i++) { + ctx->error_depth = i; + ok = check_cert(ctx); + if (!ok) + return ok; + } + return 1; +} + +static int check_cert(X509_STORE_CTX *ctx) +{ + X509_CRL *crl = NULL, *dcrl = NULL; + X509 *x; + int ok = 0, cnum; + unsigned int last_reasons; + cnum = ctx->error_depth; + x = sk_X509_value(ctx->chain, cnum); + ctx->current_cert = x; + ctx->current_issuer = NULL; + ctx->current_crl_score = 0; + ctx->current_reasons = 0; + while (ctx->current_reasons != CRLDP_ALL_REASONS) { + last_reasons = ctx->current_reasons; + /* Try to retrieve relevant CRL */ + if (ctx->get_crl) + ok = ctx->get_crl(ctx, &crl, x); + else + ok = get_crl_delta(ctx, &crl, &dcrl, x); + /* + * If error looking up CRL, nothing we can do except notify callback + */ + if (!ok) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL; + ok = ctx->verify_cb(0, ctx); + goto err; + } + ctx->current_crl = crl; + ok = ctx->check_crl(ctx, crl); + if (!ok) + goto err; + + if (dcrl) { + ok = ctx->check_crl(ctx, dcrl); + if (!ok) + goto err; + ok = ctx->cert_crl(ctx, dcrl, x); + if (!ok) + goto err; + } else + ok = 1; + + /* Don't look in full CRL if delta reason is removefromCRL */ + if (ok != 2) { + ok = ctx->cert_crl(ctx, crl, x); + if (!ok) + goto err; + } + + X509_CRL_free(crl); + X509_CRL_free(dcrl); + crl = NULL; + dcrl = NULL; + /* + * If reasons not updated we wont get anywhere by another iteration, + * so exit loop. + */ + if (last_reasons == ctx->current_reasons) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL; + ok = ctx->verify_cb(0, ctx); + goto err; + } + } + err: + X509_CRL_free(crl); + X509_CRL_free(dcrl); + + ctx->current_crl = NULL; + return ok; + +} + +/* Check CRL times against values in X509_STORE_CTX */ + +static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify) +{ + time_t *ptime; + int i; + if (notify) + ctx->current_crl = crl; + if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) + ptime = &ctx->param->check_time; + else + ptime = NULL; + + i = X509_cmp_time(X509_CRL_get_lastUpdate(crl), ptime); + if (i == 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i > 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_CRL_NOT_YET_VALID; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (X509_CRL_get_nextUpdate(crl)) { + i = X509_cmp_time(X509_CRL_get_nextUpdate(crl), ptime); + + if (i == 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + /* Ignore expiry of base CRL is delta is valid */ + if ((i < 0) && !(ctx->current_crl_score & CRL_SCORE_TIME_DELTA)) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_CRL_HAS_EXPIRED; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + } + + if (notify) + ctx->current_crl = NULL; + + return 1; +} + +static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, + X509 **pissuer, int *pscore, unsigned int *preasons, + STACK_OF(X509_CRL) *crls) +{ + int crl_score, best_score = *pscore; + size_t i; + unsigned int reasons, best_reasons = 0; + X509 *x = ctx->current_cert; + X509_CRL *crl, *best_crl = NULL; + X509 *crl_issuer = NULL, *best_crl_issuer = NULL; + + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + crl = sk_X509_CRL_value(crls, i); + reasons = *preasons; + crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x); + if (crl_score < best_score || crl_score == 0) + continue; + /* If current CRL is equivalent use it if it is newer */ + if (crl_score == best_score && best_crl != NULL) { + int day, sec; + if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl), + X509_CRL_get_lastUpdate(crl)) == 0) + continue; + /* + * ASN1_TIME_diff never returns inconsistent signs for |day| + * and |sec|. + */ + if (day <= 0 && sec <= 0) + continue; + } + best_crl = crl; + best_crl_issuer = crl_issuer; + best_score = crl_score; + best_reasons = reasons; + } + + if (best_crl) { + if (*pcrl) + X509_CRL_free(*pcrl); + *pcrl = best_crl; + *pissuer = best_crl_issuer; + *pscore = best_score; + *preasons = best_reasons; + X509_CRL_up_ref(best_crl); + if (*pdcrl) { + X509_CRL_free(*pdcrl); + *pdcrl = NULL; + } + get_delta_sk(ctx, pdcrl, pscore, best_crl, crls); + } + + if (best_score >= CRL_SCORE_VALID) + return 1; + + return 0; +} + +/* + * Compare two CRL extensions for delta checking purposes. They should be + * both present or both absent. If both present all fields must be identical. + */ + +static int crl_extension_match(X509_CRL *a, X509_CRL *b, int nid) +{ + ASN1_OCTET_STRING *exta, *extb; + int i; + i = X509_CRL_get_ext_by_NID(a, nid, -1); + if (i >= 0) { + /* Can't have multiple occurrences */ + if (X509_CRL_get_ext_by_NID(a, nid, i) != -1) + return 0; + exta = X509_EXTENSION_get_data(X509_CRL_get_ext(a, i)); + } else + exta = NULL; + + i = X509_CRL_get_ext_by_NID(b, nid, -1); + + if (i >= 0) { + + if (X509_CRL_get_ext_by_NID(b, nid, i) != -1) + return 0; + extb = X509_EXTENSION_get_data(X509_CRL_get_ext(b, i)); + } else + extb = NULL; + + if (!exta && !extb) + return 1; + + if (!exta || !extb) + return 0; + + if (ASN1_OCTET_STRING_cmp(exta, extb)) + return 0; + + return 1; +} + +/* See if a base and delta are compatible */ + +static int check_delta_base(X509_CRL *delta, X509_CRL *base) +{ + /* Delta CRL must be a delta */ + if (!delta->base_crl_number) + return 0; + /* Base must have a CRL number */ + if (!base->crl_number) + return 0; + /* Issuer names must match */ + if (X509_NAME_cmp(X509_CRL_get_issuer(base), X509_CRL_get_issuer(delta))) + return 0; + /* AKID and IDP must match */ + if (!crl_extension_match(delta, base, NID_authority_key_identifier)) + return 0; + if (!crl_extension_match(delta, base, NID_issuing_distribution_point)) + return 0; + /* Delta CRL base number must not exceed Full CRL number. */ + if (ASN1_INTEGER_cmp(delta->base_crl_number, base->crl_number) > 0) + return 0; + /* Delta CRL number must exceed full CRL number */ + if (ASN1_INTEGER_cmp(delta->crl_number, base->crl_number) > 0) + return 1; + return 0; +} + +/* + * For a given base CRL find a delta... maybe extend to delta scoring or + * retrieve a chain of deltas... + */ + +static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, int *pscore, + X509_CRL *base, STACK_OF(X509_CRL) *crls) +{ + X509_CRL *delta; + size_t i; + if (!(ctx->param->flags & X509_V_FLAG_USE_DELTAS)) + return; + if (!((ctx->current_cert->ex_flags | base->flags) & EXFLAG_FRESHEST)) + return; + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + delta = sk_X509_CRL_value(crls, i); + if (check_delta_base(delta, base)) { + if (check_crl_time(ctx, delta, 0)) + *pscore |= CRL_SCORE_TIME_DELTA; + X509_CRL_up_ref(delta); + *dcrl = delta; + return; + } + } + *dcrl = NULL; +} + +/* + * For a given CRL return how suitable it is for the supplied certificate + * 'x'. The return value is a mask of several criteria. If the issuer is not + * the certificate issuer this is returned in *pissuer. The reasons mask is + * also used to determine if the CRL is suitable: if no new reasons the CRL + * is rejected, otherwise reasons is updated. + */ + +static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, + unsigned int *preasons, X509_CRL *crl, X509 *x) +{ + + int crl_score = 0; + unsigned int tmp_reasons = *preasons, crl_reasons; + + /* First see if we can reject CRL straight away */ + + /* Invalid IDP cannot be processed */ + if (crl->idp_flags & IDP_INVALID) + return 0; + /* Reason codes or indirect CRLs need extended CRL support */ + if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) { + if (crl->idp_flags & (IDP_INDIRECT | IDP_REASONS)) + return 0; + } else if (crl->idp_flags & IDP_REASONS) { + /* If no new reasons reject */ + if (!(crl->idp_reasons & ~tmp_reasons)) + return 0; + } + /* Don't process deltas at this stage */ + else if (crl->base_crl_number) + return 0; + /* If issuer name doesn't match certificate need indirect CRL */ + if (X509_NAME_cmp(X509_get_issuer_name(x), X509_CRL_get_issuer(crl))) { + if (!(crl->idp_flags & IDP_INDIRECT)) + return 0; + } else + crl_score |= CRL_SCORE_ISSUER_NAME; + + if (!(crl->flags & EXFLAG_CRITICAL)) + crl_score |= CRL_SCORE_NOCRITICAL; + + /* Check expiry */ + if (check_crl_time(ctx, crl, 0)) + crl_score |= CRL_SCORE_TIME; + + /* Check authority key ID and locate certificate issuer */ + crl_akid_check(ctx, crl, pissuer, &crl_score); + + /* If we can't locate certificate issuer at this point forget it */ + + if (!(crl_score & CRL_SCORE_AKID)) + return 0; + + /* Check cert for matching CRL distribution points */ + + if (crl_crldp_check(x, crl, crl_score, &crl_reasons)) { + /* If no new reasons reject */ + if (!(crl_reasons & ~tmp_reasons)) + return 0; + tmp_reasons |= crl_reasons; + crl_score |= CRL_SCORE_SCOPE; + } + + *preasons = tmp_reasons; + + return crl_score; + +} + +static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, + X509 **pissuer, int *pcrl_score) +{ + X509 *crl_issuer = NULL; + X509_NAME *cnm = X509_CRL_get_issuer(crl); + int cidx = ctx->error_depth; + size_t i; + + if ((size_t)cidx != sk_X509_num(ctx->chain) - 1) + cidx++; + + crl_issuer = sk_X509_value(ctx->chain, cidx); + + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { + *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; + *pissuer = crl_issuer; + return; + } + } + + for (cidx++; cidx < (int)sk_X509_num(ctx->chain); cidx++) { + crl_issuer = sk_X509_value(ctx->chain, cidx); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_SAME_PATH; + *pissuer = crl_issuer; + return; + } + } + + /* Anything else needs extended CRL support */ + + if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) + return; + + /* + * Otherwise the CRL issuer is not on the path. Look for it in the set of + * untrusted certificates. + */ + for (i = 0; i < sk_X509_num(ctx->untrusted); i++) { + crl_issuer = sk_X509_value(ctx->untrusted, i); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pissuer = crl_issuer; + *pcrl_score |= CRL_SCORE_AKID; + return; + } + } + + for (i = 0; i < sk_X509_num(ctx->ctx->additional_untrusted); i++) { + crl_issuer = sk_X509_value(ctx->ctx->additional_untrusted, i); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pissuer = crl_issuer; + *pcrl_score |= CRL_SCORE_AKID; + return; + } + } +} + +/* + * Check the path of a CRL issuer certificate. This creates a new + * X509_STORE_CTX and populates it with most of the parameters from the + * parent. This could be optimised somewhat since a lot of path checking will + * be duplicated by the parent, but this will rarely be used in practice. + */ + +static int check_crl_path(X509_STORE_CTX *ctx, X509 *x) +{ + X509_STORE_CTX crl_ctx; + int ret; + /* Don't allow recursive CRL path validation */ + if (ctx->parent) + return 0; + if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) + return -1; + + crl_ctx.crls = ctx->crls; + /* Copy verify params across */ + X509_STORE_CTX_set0_param(&crl_ctx, ctx->param); + + crl_ctx.parent = ctx; + crl_ctx.verify_cb = ctx->verify_cb; + + /* Verify CRL issuer */ + ret = X509_verify_cert(&crl_ctx); + + if (ret <= 0) + goto err; + + /* Check chain is acceptable */ + + ret = check_crl_chain(ctx, ctx->chain, crl_ctx.chain); + err: + X509_STORE_CTX_cleanup(&crl_ctx); + return ret; +} + +/* + * RFC3280 says nothing about the relationship between CRL path and + * certificate path, which could lead to situations where a certificate could + * be revoked or validated by a CA not authorised to do so. RFC5280 is more + * strict and states that the two paths must end in the same trust anchor, + * though some discussions remain... until this is resolved we use the + * RFC5280 version + */ + +static int check_crl_chain(X509_STORE_CTX *ctx, + STACK_OF(X509) *cert_path, + STACK_OF(X509) *crl_path) +{ + X509 *cert_ta, *crl_ta; + cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); + crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); + if (!X509_cmp(cert_ta, crl_ta)) + return 1; + return 0; +} + +/* + * Check for match between two dist point names: three separate cases. 1. + * Both are relative names and compare X509_NAME types. 2. One full, one + * relative. Compare X509_NAME to GENERAL_NAMES. 3. Both are full names and + * compare two GENERAL_NAMES. 4. One is NULL: automatic match. + */ + +static int idp_check_dp(DIST_POINT_NAME *a, DIST_POINT_NAME *b) +{ + X509_NAME *nm = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gena, *genb; + size_t i, j; + if (!a || !b) + return 1; + if (a->type == 1) { + if (!a->dpname) + return 0; + /* Case 1: two X509_NAME */ + if (b->type == 1) { + if (!b->dpname) + return 0; + if (!X509_NAME_cmp(a->dpname, b->dpname)) + return 1; + else + return 0; + } + /* Case 2: set name and GENERAL_NAMES appropriately */ + nm = a->dpname; + gens = b->name.fullname; + } else if (b->type == 1) { + if (!b->dpname) + return 0; + /* Case 2: set name and GENERAL_NAMES appropriately */ + gens = a->name.fullname; + nm = b->dpname; + } + + /* Handle case 2 with one GENERAL_NAMES and one X509_NAME */ + if (nm) { + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gena = sk_GENERAL_NAME_value(gens, i); + if (gena->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(nm, gena->d.directoryName)) + return 1; + } + return 0; + } + + /* Else case 3: two GENERAL_NAMES */ + + for (i = 0; i < sk_GENERAL_NAME_num(a->name.fullname); i++) { + gena = sk_GENERAL_NAME_value(a->name.fullname, i); + for (j = 0; j < sk_GENERAL_NAME_num(b->name.fullname); j++) { + genb = sk_GENERAL_NAME_value(b->name.fullname, j); + if (!GENERAL_NAME_cmp(gena, genb)) + return 1; + } + } + + return 0; + +} + +static int crldp_check_crlissuer(DIST_POINT *dp, X509_CRL *crl, int crl_score) +{ + size_t i; + X509_NAME *nm = X509_CRL_get_issuer(crl); + /* If no CRLissuer return is successful iff don't need a match */ + if (!dp->CRLissuer) + return ! !(crl_score & CRL_SCORE_ISSUER_NAME); + for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i); + if (gen->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(gen->d.directoryName, nm)) + return 1; + } + return 0; +} + +/* Check CRLDP and IDP */ + +static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score, + unsigned int *preasons) +{ + size_t i; + if (crl->idp_flags & IDP_ONLYATTR) + return 0; + if (x->ex_flags & EXFLAG_CA) { + if (crl->idp_flags & IDP_ONLYUSER) + return 0; + } else { + if (crl->idp_flags & IDP_ONLYCA) + return 0; + } + *preasons = crl->idp_reasons; + for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) { + DIST_POINT *dp = sk_DIST_POINT_value(x->crldp, i); + if (crldp_check_crlissuer(dp, crl, crl_score)) { + if (!crl->idp || idp_check_dp(dp->distpoint, crl->idp->distpoint)) { + *preasons &= dp->dp_reasons; + return 1; + } + } + } + if ((!crl->idp || !crl->idp->distpoint) + && (crl_score & CRL_SCORE_ISSUER_NAME)) + return 1; + return 0; +} + +/* + * Retrieve CRL corresponding to current certificate. If deltas enabled try + * to find a delta CRL too + */ + +static int get_crl_delta(X509_STORE_CTX *ctx, + X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x) +{ + int ok; + X509 *issuer = NULL; + int crl_score = 0; + unsigned int reasons; + X509_CRL *crl = NULL, *dcrl = NULL; + STACK_OF(X509_CRL) *skcrl; + X509_NAME *nm = X509_get_issuer_name(x); + reasons = ctx->current_reasons; + ok = get_crl_sk(ctx, &crl, &dcrl, + &issuer, &crl_score, &reasons, ctx->crls); + + if (ok) + goto done; + + /* Lookup CRLs from store */ + + skcrl = ctx->lookup_crls(ctx, nm); + + /* If no CRLs found and a near match from get_crl_sk use that */ + if (!skcrl && crl) + goto done; + + get_crl_sk(ctx, &crl, &dcrl, &issuer, &crl_score, &reasons, skcrl); + + sk_X509_CRL_pop_free(skcrl, X509_CRL_free); + + done: + + /* If we got any kind of CRL use it and return success */ + if (crl) { + ctx->current_issuer = issuer; + ctx->current_crl_score = crl_score; + ctx->current_reasons = reasons; + *pcrl = crl; + *pdcrl = dcrl; + return 1; + } + + return 0; +} + +/* Check CRL validity */ +static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl) +{ + X509 *issuer = NULL; + EVP_PKEY *ikey = NULL; + int ok = 0, chnum, cnum; + cnum = ctx->error_depth; + chnum = sk_X509_num(ctx->chain) - 1; + /* if we have an alternative CRL issuer cert use that */ + if (ctx->current_issuer) + issuer = ctx->current_issuer; + + /* + * Else find CRL issuer: if not last certificate then issuer is next + * certificate in chain. + */ + else if (cnum < chnum) + issuer = sk_X509_value(ctx->chain, cnum + 1); + else { + issuer = sk_X509_value(ctx->chain, chnum); + /* If not self signed, can't check signature */ + if (!ctx->check_issued(ctx, issuer, issuer)) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + + if (issuer) { + /* + * Skip most tests for deltas because they have already been done + */ + if (!crl->base_crl_number) { + /* Check for cRLSign bit if keyUsage present */ + if ((issuer->ex_flags & EXFLAG_KUSAGE) && + !(issuer->ex_kusage & KU_CRL_SIGN)) { + ctx->error = X509_V_ERR_KEYUSAGE_NO_CRL_SIGN; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + if (!(ctx->current_crl_score & CRL_SCORE_SCOPE)) { + ctx->error = X509_V_ERR_DIFFERENT_CRL_SCOPE; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + if (!(ctx->current_crl_score & CRL_SCORE_SAME_PATH)) { + if (check_crl_path(ctx, ctx->current_issuer) <= 0) { + ctx->error = X509_V_ERR_CRL_PATH_VALIDATION_ERROR; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + + if (crl->idp_flags & IDP_INVALID) { + ctx->error = X509_V_ERR_INVALID_EXTENSION; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + } + + if (!(ctx->current_crl_score & CRL_SCORE_TIME)) { + ok = check_crl_time(ctx, crl, 1); + if (!ok) + goto err; + } + + /* Attempt to get issuer certificate public key */ + ikey = X509_get_pubkey(issuer); + + if (!ikey) { + ctx->error = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } else { + int rv; + rv = X509_CRL_check_suiteb(crl, ikey, ctx->param->flags); + if (rv != X509_V_OK) { + ctx->error = rv; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + /* Verify CRL signature */ + if (X509_CRL_verify(crl, ikey) <= 0) { + ctx->error = X509_V_ERR_CRL_SIGNATURE_FAILURE; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + } + + ok = 1; + + err: + EVP_PKEY_free(ikey); + return ok; +} + +/* Check certificate against CRL */ +static int cert_crl(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x) +{ + int ok; + X509_REVOKED *rev; + /* + * The rules changed for this... previously if a CRL contained unhandled + * critical extensions it could still be used to indicate a certificate + * was revoked. This has since been changed since critical extension can + * change the meaning of CRL entries. + */ + if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) + && (crl->flags & EXFLAG_CRITICAL)) { + ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION; + ok = ctx->verify_cb(0, ctx); + if (!ok) + return 0; + } + /* + * Look for serial number of certificate in CRL If found make sure reason + * is not removeFromCRL. + */ + if (X509_CRL_get0_by_cert(crl, &rev, x)) { + if (rev->reason == CRL_REASON_REMOVE_FROM_CRL) + return 2; + ctx->error = X509_V_ERR_CERT_REVOKED; + ok = ctx->verify_cb(0, ctx); + if (!ok) + return 0; + } + + return 1; +} + +static int check_policy(X509_STORE_CTX *ctx) +{ + int ret; + if (ctx->parent) + return 1; + ret = X509_policy_check(&ctx->tree, &ctx->explicit_policy, ctx->chain, + ctx->param->policies, ctx->param->flags); + if (ret == 0) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + return 0; + } + /* Invalid or inconsistent extensions */ + if (ret == -1) { + /* + * Locate certificates with bad extensions and notify callback. + */ + X509 *x; + size_t i; + for (i = 1; i < sk_X509_num(ctx->chain); i++) { + x = sk_X509_value(ctx->chain, i); + if (!(x->ex_flags & EXFLAG_INVALID_POLICY)) + continue; + ctx->current_cert = x; + ctx->error = X509_V_ERR_INVALID_POLICY_EXTENSION; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + return 1; + } + if (ret == -2) { + ctx->current_cert = NULL; + ctx->error = X509_V_ERR_NO_EXPLICIT_POLICY; + return ctx->verify_cb(0, ctx); + } + + if (ctx->param->flags & X509_V_FLAG_NOTIFY_POLICY) { + ctx->current_cert = NULL; + /* + * Verification errors need to be "sticky", a callback may have allowed + * an SSL handshake to continue despite an error, and we must then + * remain in an error state. Therefore, we MUST NOT clear earlier + * verification errors by setting the error to X509_V_OK. + */ + if (!ctx->verify_cb(2, ctx)) + return 0; + } + + return 1; +} + +static int check_cert_time(X509_STORE_CTX *ctx, X509 *x) +{ + time_t *ptime; + int i; + + if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) + ptime = &ctx->param->check_time; + else + ptime = NULL; + + i = X509_cmp_time(X509_get_notBefore(x), ptime); + if (i == 0) { + ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i > 0) { + ctx->error = X509_V_ERR_CERT_NOT_YET_VALID; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + i = X509_cmp_time(X509_get_notAfter(x), ptime); + if (i == 0) { + ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i < 0) { + ctx->error = X509_V_ERR_CERT_HAS_EXPIRED; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + return 1; +} + +static int internal_verify(X509_STORE_CTX *ctx) +{ + int ok = 0, n; + X509 *xs, *xi; + EVP_PKEY *pkey = NULL; + int (*cb) (int xok, X509_STORE_CTX *xctx); + + cb = ctx->verify_cb; + + n = sk_X509_num(ctx->chain); + ctx->error_depth = n - 1; + n--; + xi = sk_X509_value(ctx->chain, n); + + if (ctx->check_issued(ctx, xi, xi)) + xs = xi; + else { + if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { + xs = xi; + goto check_cert; + } + if (n <= 0) { + ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; + ctx->current_cert = xi; + ok = cb(0, ctx); + goto end; + } else { + n--; + ctx->error_depth = n; + xs = sk_X509_value(ctx->chain, n); + } + } + +/* ctx->error=0; not needed */ + while (n >= 0) { + ctx->error_depth = n; + + /* + * Skip signature check for self signed certificates unless + * explicitly asked for. It doesn't add any security and just wastes + * time. + */ + if (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE)) { + if ((pkey = X509_get_pubkey(xi)) == NULL) { + ctx->error = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; + ctx->current_cert = xi; + ok = (*cb) (0, ctx); + if (!ok) + goto end; + } else if (X509_verify(xs, pkey) <= 0) { + ctx->error = X509_V_ERR_CERT_SIGNATURE_FAILURE; + ctx->current_cert = xs; + ok = (*cb) (0, ctx); + if (!ok) { + EVP_PKEY_free(pkey); + goto end; + } + } + EVP_PKEY_free(pkey); + pkey = NULL; + } + + check_cert: + ok = check_cert_time(ctx, xs); + if (!ok) + goto end; + + /* The last error (if any) is still in the error value */ + ctx->current_issuer = xi; + ctx->current_cert = xs; + ok = (*cb) (1, ctx); + if (!ok) + goto end; + + n--; + if (n >= 0) { + xi = xs; + xs = sk_X509_value(ctx->chain, n); + } + } + ok = 1; + end: + return ok; +} + +int X509_cmp_current_time(const ASN1_TIME *ctm) +{ + return X509_cmp_time(ctm, NULL); +} + +int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) +{ + 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; + + /* + * 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." + */ + switch (ctm->type) { + case V_ASN1_UTCTIME: + if (ctm->length != (int)(utctime_length)) + return 0; + break; + case V_ASN1_GENERALIZEDTIME: + if (ctm->length != (int)(generalizedtime_length)) + return 0; + break; + default: + return 0; + } + + /** + * 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; + } + if (ctm->data[ctm->length - 1] != 'Z') + 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; + + /* + * 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) +{ + return X509_time_adj(s, adj, NULL); +} + +ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_tm) +{ + return X509_time_adj_ex(s, 0, offset_sec, in_tm); +} + +ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, + int offset_day, long offset_sec, time_t *in_tm) +{ + time_t t = 0; + + if (in_tm) + t = *in_tm; + else + time(&t); + + if (s && !(s->flags & ASN1_STRING_FLAG_MSTRING)) { + if (s->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_adj(s, t, offset_day, offset_sec); + if (s->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec); + } + return ASN1_TIME_adj(s, t, offset_day, offset_sec); +} + +/* Make a delta CRL as the diff between two full CRLs */ + +X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, + EVP_PKEY *skey, const EVP_MD *md, unsigned int flags) +{ + X509_CRL *crl = NULL; + int i; + size_t j; + STACK_OF(X509_REVOKED) *revs = NULL; + /* CRLs can't be delta already */ + if (base->base_crl_number || newer->base_crl_number) { + OPENSSL_PUT_ERROR(X509, X509_R_CRL_ALREADY_DELTA); + return NULL; + } + /* Base and new CRL must have a CRL number */ + if (!base->crl_number || !newer->crl_number) { + OPENSSL_PUT_ERROR(X509, X509_R_NO_CRL_NUMBER); + return NULL; + } + /* Issuer names must match */ + if (X509_NAME_cmp(X509_CRL_get_issuer(base), X509_CRL_get_issuer(newer))) { + OPENSSL_PUT_ERROR(X509, X509_R_ISSUER_MISMATCH); + return NULL; + } + /* AKID and IDP must match */ + if (!crl_extension_match(base, newer, NID_authority_key_identifier)) { + OPENSSL_PUT_ERROR(X509, X509_R_AKID_MISMATCH); + return NULL; + } + if (!crl_extension_match(base, newer, NID_issuing_distribution_point)) { + OPENSSL_PUT_ERROR(X509, X509_R_IDP_MISMATCH); + return NULL; + } + /* Newer CRL number must exceed full CRL number */ + if (ASN1_INTEGER_cmp(newer->crl_number, base->crl_number) <= 0) { + OPENSSL_PUT_ERROR(X509, X509_R_NEWER_CRL_NOT_NEWER); + return NULL; + } + /* CRLs must verify */ + if (skey && (X509_CRL_verify(base, skey) <= 0 || + X509_CRL_verify(newer, skey) <= 0)) { + OPENSSL_PUT_ERROR(X509, X509_R_CRL_VERIFY_FAILURE); + return NULL; + } + /* Create new CRL */ + crl = X509_CRL_new(); + if (!crl || !X509_CRL_set_version(crl, 1)) + goto memerr; + /* Set issuer name */ + if (!X509_CRL_set_issuer_name(crl, X509_CRL_get_issuer(newer))) + goto memerr; + + if (!X509_CRL_set_lastUpdate(crl, X509_CRL_get_lastUpdate(newer))) + goto memerr; + if (!X509_CRL_set_nextUpdate(crl, X509_CRL_get_nextUpdate(newer))) + goto memerr; + + /* Set base CRL number: must be critical */ + + if (!X509_CRL_add1_ext_i2d(crl, NID_delta_crl, base->crl_number, 1, 0)) + goto memerr; + + /* + * Copy extensions across from newest CRL to delta: this will set CRL + * number to correct value too. + */ + + for (i = 0; i < X509_CRL_get_ext_count(newer); i++) { + X509_EXTENSION *ext; + ext = X509_CRL_get_ext(newer, i); + if (!X509_CRL_add_ext(crl, ext, -1)) + goto memerr; + } + + /* Go through revoked entries, copying as needed */ + + revs = X509_CRL_get_REVOKED(newer); + + for (j = 0; j < sk_X509_REVOKED_num(revs); j++) { + X509_REVOKED *rvn, *rvtmp; + rvn = sk_X509_REVOKED_value(revs, j); + /* + * Add only if not also in base. TODO: need something cleverer here + * for some more complex CRLs covering multiple CAs. + */ + if (!X509_CRL_get0_by_serial(base, &rvtmp, rvn->serialNumber)) { + rvtmp = X509_REVOKED_dup(rvn); + if (!rvtmp) + goto memerr; + if (!X509_CRL_add0_revoked(crl, rvtmp)) { + X509_REVOKED_free(rvtmp); + goto memerr; + } + } + } + /* TODO: optionally prune deleted entries */ + + if (skey && md && !X509_CRL_sign(crl, skey, md)) + goto memerr; + + return crl; + + memerr: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (crl) + X509_CRL_free(crl); + return NULL; +} + +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) +{ + /* + * This function is (usually) called only once, by + * SSL_get_ex_data_X509_STORE_CTX_idx (ssl/ssl_cert.c). + */ + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data) +{ + return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); +} + +void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx) +{ + return CRYPTO_get_ex_data(&ctx->ex_data, idx); +} + +int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx) +{ + return ctx->error; +} + +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err) +{ + ctx->error = err; +} + +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) +{ + return ctx->error_depth; +} + +X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) +{ + return ctx->current_cert; +} + +STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) +{ + return ctx->chain; +} + +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) +{ + if (!ctx->chain) + return NULL; + return X509_chain_up_ref(ctx->chain); +} + +X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx) +{ + return ctx->current_issuer; +} + +X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx) +{ + return ctx->current_crl; +} + +X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx) +{ + return ctx->parent; +} + +void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) +{ + ctx->cert = x; +} + +void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + ctx->untrusted = sk; +} + +STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx) +{ + return ctx->untrusted; +} + +void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk) +{ + ctx->crls = sk; +} + +int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose) +{ + return X509_STORE_CTX_purpose_inherit(ctx, 0, purpose, 0); +} + +int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust) +{ + return X509_STORE_CTX_purpose_inherit(ctx, 0, 0, trust); +} + +/* + * This function is used to set the X509_STORE_CTX purpose and trust values. + * This is intended to be used when another structure has its own trust and + * purpose values which (if set) will be inherited by the ctx. If they aren't + * set then we will usually have a default purpose in mind which should then + * be used to set the trust value. An example of this is SSL use: an SSL + * structure will have its own purpose and trust settings which the + * application can set: if they aren't set then we use the default of SSL + * client/server. + */ + +int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust) +{ + int idx; + /* If purpose not set use default */ + if (!purpose) + purpose = def_purpose; + /* If we have a purpose then check it is valid */ + if (purpose) { + X509_PURPOSE *ptmp; + idx = X509_PURPOSE_get_by_id(purpose); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_PURPOSE_ID); + return 0; + } + ptmp = X509_PURPOSE_get0(idx); + if (ptmp->trust == X509_TRUST_DEFAULT) { + idx = X509_PURPOSE_get_by_id(def_purpose); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_PURPOSE_ID); + return 0; + } + ptmp = X509_PURPOSE_get0(idx); + } + /* If trust not set then get from purpose default */ + if (!trust) + trust = ptmp->trust; + } + if (trust) { + idx = X509_TRUST_get_by_id(trust); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_TRUST_ID); + return 0; + } + } + + if (purpose && !ctx->param->purpose) + ctx->param->purpose = purpose; + if (trust && !ctx->param->trust) + ctx->param->trust = trust; + return 1; +} + +X509_STORE_CTX *X509_STORE_CTX_new(void) +{ + X509_STORE_CTX *ctx; + ctx = (X509_STORE_CTX *)OPENSSL_malloc(sizeof(X509_STORE_CTX)); + if (!ctx) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + X509_STORE_CTX_zero(ctx); + return ctx; +} + +void X509_STORE_CTX_zero(X509_STORE_CTX *ctx) +{ + OPENSSL_memset(ctx, 0, sizeof(X509_STORE_CTX)); +} + +void X509_STORE_CTX_free(X509_STORE_CTX *ctx) +{ + if (ctx == NULL) { + return; + } + X509_STORE_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, + STACK_OF(X509) *chain) +{ + int ret = 1; + + X509_STORE_CTX_zero(ctx); + ctx->ctx = store; + ctx->cert = x509; + ctx->untrusted = chain; + + CRYPTO_new_ex_data(&ctx->ex_data); + + ctx->param = X509_VERIFY_PARAM_new(); + if (!ctx->param) + goto err; + + /* + * Inherit callbacks and flags from X509_STORE if not set use defaults. + */ + + if (store) + ret = X509_VERIFY_PARAM_inherit(ctx->param, store->param); + else + ctx->param->inh_flags |= X509_VP_FLAG_DEFAULT | X509_VP_FLAG_ONCE; + + if (store) { + ctx->verify_cb = store->verify_cb; + ctx->cleanup = store->cleanup; + } else + ctx->cleanup = 0; + + if (ret) + ret = X509_VERIFY_PARAM_inherit(ctx->param, + X509_VERIFY_PARAM_lookup("default")); + + if (ret == 0) + goto err; + + if (store && store->check_issued) + ctx->check_issued = store->check_issued; + else + ctx->check_issued = check_issued; + + if (store && store->get_issuer) + ctx->get_issuer = store->get_issuer; + else + ctx->get_issuer = X509_STORE_CTX_get1_issuer; + + if (store && store->verify_cb) + ctx->verify_cb = store->verify_cb; + else + ctx->verify_cb = null_callback; + + if (store && store->verify) + ctx->verify = store->verify; + else + ctx->verify = internal_verify; + + if (store && store->check_revocation) + ctx->check_revocation = store->check_revocation; + else + ctx->check_revocation = check_revocation; + + if (store && store->get_crl) + ctx->get_crl = store->get_crl; + else + ctx->get_crl = NULL; + + if (store && store->check_crl) + ctx->check_crl = store->check_crl; + else + ctx->check_crl = check_crl; + + if (store && store->cert_crl) + ctx->cert_crl = store->cert_crl; + else + ctx->cert_crl = cert_crl; + + if (store && store->lookup_certs) + ctx->lookup_certs = store->lookup_certs; + else + ctx->lookup_certs = X509_STORE_get1_certs; + + if (store && store->lookup_crls) + ctx->lookup_crls = store->lookup_crls; + else + ctx->lookup_crls = X509_STORE_get1_crls; + + ctx->check_policy = check_policy; + + return 1; + + err: + CRYPTO_free_ex_data(&g_ex_data_class, ctx, &ctx->ex_data); + if (ctx->param != NULL) { + X509_VERIFY_PARAM_free(ctx->param); + } + + OPENSSL_memset(ctx, 0, sizeof(X509_STORE_CTX)); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; +} + +/* + * Set alternative lookup method: just a STACK of trusted certificates. This + * avoids X509_STORE nastiness where it isn't needed. + */ + +void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + ctx->other_ctx = sk; + ctx->get_issuer = get_issuer_sk; +} + +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) +{ + /* We need to be idempotent because, unfortunately, |X509_STORE_CTX_free| + * also calls this function. */ + if (ctx->cleanup != NULL) { + ctx->cleanup(ctx); + ctx->cleanup = NULL; + } + if (ctx->param != NULL) { + if (ctx->parent == NULL) + X509_VERIFY_PARAM_free(ctx->param); + ctx->param = NULL; + } + if (ctx->tree != NULL) { + X509_policy_tree_free(ctx->tree); + ctx->tree = NULL; + } + if (ctx->chain != NULL) { + sk_X509_pop_free(ctx->chain, X509_free); + ctx->chain = NULL; + } + CRYPTO_free_ex_data(&g_ex_data_class, ctx, &(ctx->ex_data)); + OPENSSL_memset(&ctx->ex_data, 0, sizeof(CRYPTO_EX_DATA)); +} + +void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth) +{ + X509_VERIFY_PARAM_set_depth(ctx->param, depth); +} + +void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags) +{ + X509_VERIFY_PARAM_set_flags(ctx->param, flags); +} + +void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t) +{ + 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 *)) +{ + ctx->verify_cb = verify_cb; +} + +X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx) +{ + return ctx->tree; +} + +int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx) +{ + return ctx->explicit_policy; +} + +int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name) +{ + const X509_VERIFY_PARAM *param; + param = X509_VERIFY_PARAM_lookup(name); + if (!param) + return 0; + return X509_VERIFY_PARAM_inherit(ctx->param, param); +} + +X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx) +{ + return ctx->param; +} + +void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param) +{ + if (ctx->param) + X509_VERIFY_PARAM_free(ctx->param); + ctx->param = param; +} + +IMPLEMENT_ASN1_SET_OF(X509) + +IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back new file mode 100644 index 0000000..23bbeb5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back @@ -0,0 +1,2482 @@ +/* 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 "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; + +/* CRL score values */ + +/* No unhandled critical extensions */ + +#define CRL_SCORE_NOCRITICAL 0x100 + +/* certificate is within CRL scope */ + +#define CRL_SCORE_SCOPE 0x080 + +/* CRL times valid */ + +#define CRL_SCORE_TIME 0x040 + +/* Issuer name matches certificate */ + +#define CRL_SCORE_ISSUER_NAME 0x020 + +/* If this score or above CRL is probably valid */ + +#define CRL_SCORE_VALID (CRL_SCORE_NOCRITICAL|CRL_SCORE_TIME|CRL_SCORE_SCOPE) + +/* CRL issuer is certificate issuer */ + +#define CRL_SCORE_ISSUER_CERT 0x018 + +/* CRL issuer is on certificate path */ + +#define CRL_SCORE_SAME_PATH 0x008 + +/* CRL issuer matches CRL AKID */ + +#define CRL_SCORE_AKID 0x004 + +/* Have a delta CRL with valid times */ + +#define CRL_SCORE_TIME_DELTA 0x002 + +static int null_callback(int ok, X509_STORE_CTX *e); +static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); +static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x); +static int check_chain_extensions(X509_STORE_CTX *ctx); +static int check_name_constraints(X509_STORE_CTX *ctx); +static int check_id(X509_STORE_CTX *ctx); +static int check_trust(X509_STORE_CTX *ctx); +static int check_revocation(X509_STORE_CTX *ctx); +static int check_cert(X509_STORE_CTX *ctx); +static int check_policy(X509_STORE_CTX *ctx); + +static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, + unsigned int *preasons, X509_CRL *crl, X509 *x); +static int get_crl_delta(X509_STORE_CTX *ctx, + X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x); +static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, + int *pcrl_score, X509_CRL *base, + STACK_OF(X509_CRL) *crls); +static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer, + int *pcrl_score); +static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score, + unsigned int *preasons); +static int check_crl_path(X509_STORE_CTX *ctx, X509 *x); +static int check_crl_chain(X509_STORE_CTX *ctx, + STACK_OF(X509) *cert_path, + STACK_OF(X509) *crl_path); + +static int internal_verify(X509_STORE_CTX *ctx); + +static int null_callback(int ok, X509_STORE_CTX *e) +{ + return ok; +} + +/* Return 1 is a certificate is self signed */ +static int cert_self_signed(X509 *x) +{ + X509_check_purpose(x, -1, 0); + if (x->ex_flags & EXFLAG_SS) + return 1; + else + return 0; +} + +/* Given a certificate try and find an exact match in the store */ + +static X509 *lookup_cert_match(X509_STORE_CTX *ctx, X509 *x) +{ + STACK_OF(X509) *certs; + X509 *xtmp = NULL; + size_t i; + /* Lookup all certs with matching subject name */ + certs = ctx->lookup_certs(ctx, X509_get_subject_name(x)); + if (certs == NULL) + return NULL; + /* Look for exact match */ + for (i = 0; i < sk_X509_num(certs); i++) { + xtmp = sk_X509_value(certs, i); + if (!X509_cmp(xtmp, x)) + break; + } + if (i < sk_X509_num(certs)) + X509_up_ref(xtmp); + else + xtmp = NULL; + sk_X509_pop_free(certs, X509_free); + return xtmp; +} + +int X509_verify_cert(X509_STORE_CTX *ctx) +{ + X509 *x, *xtmp, *xtmp2, *chain_ss = NULL; + int bad_chain = 0; + X509_VERIFY_PARAM *param = ctx->param; + int depth, i, ok = 0; + int num, j, retry, trust; + int (*cb) (int xok, X509_STORE_CTX *xctx); + STACK_OF(X509) *sktmp = NULL; + if (ctx->cert == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); + ctx->error = X509_V_ERR_INVALID_CALL; + return -1; + } + if (ctx->chain != NULL) { + /* + * This X509_STORE_CTX has already been used to verify a cert. We + * cannot do another one. + */ + OPENSSL_PUT_ERROR(X509, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + ctx->error = X509_V_ERR_INVALID_CALL; + return -1; + } + + cb = ctx->verify_cb; + + /* + * first we make sure the chain we are going to build is present and that + * the first entry is in place + */ + ctx->chain = sk_X509_new_null(); + if (ctx->chain == NULL || !sk_X509_push(ctx->chain, ctx->cert)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + X509_up_ref(ctx->cert); + ctx->last_untrusted = 1; + + /* We use a temporary STACK so we can chop and hack at it. + * sktmp = ctx->untrusted ++ ctx->ctx->additional_untrusted */ + if (ctx->untrusted != NULL + && (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + + if (ctx->ctx->additional_untrusted != NULL) { + if (sktmp == NULL) { + sktmp = sk_X509_new_null(); + if (sktmp == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + } + + for (size_t k = 0; k < sk_X509_num(ctx->ctx->additional_untrusted); + k++) { + if (!sk_X509_push(sktmp, + sk_X509_value(ctx->ctx->additional_untrusted, + k))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + goto end; + } + } + } + + num = sk_X509_num(ctx->chain); + x = sk_X509_value(ctx->chain, num - 1); + depth = param->depth; + + for (;;) { + /* If we have enough, we break */ + if (depth < num) + break; /* FIXME: If this happens, we should take + * note of it and, if appropriate, use the + * X509_V_ERR_CERT_CHAIN_TOO_LONG error code + * later. */ + + /* If we are self signed, we break */ + if (cert_self_signed(x)) + break; + /* + * If asked see if we can find issuer in trusted store first + */ + if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) { + ok = ctx->get_issuer(&xtmp, ctx, x); + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; + goto end; + } + /* + * If successful for now free up cert so it will be picked up + * again later. + */ + if (ok > 0) { + X509_free(xtmp); + break; + } + } + + /* If we were passed a cert chain, use it first */ + if (sktmp != NULL) { + xtmp = find_issuer(ctx, sktmp, x); + if (xtmp != NULL) { + if (!sk_X509_push(ctx->chain, xtmp)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + ok = 0; + goto end; + } + X509_up_ref(xtmp); + (void)sk_X509_delete_ptr(sktmp, xtmp); + ctx->last_untrusted++; + x = xtmp; + num++; + /* + * reparse the full chain for the next one + */ + continue; + } + } + break; + } + + /* Remember how many untrusted certs we have */ + j = num; + /* + * at this point, chain should contain a list of untrusted certificates. + * We now need to add at least one trusted one, if possible, otherwise we + * complain. + */ + + do { + /* + * Examine last certificate in chain and see if it is self signed. + */ + i = sk_X509_num(ctx->chain); + x = sk_X509_value(ctx->chain, i - 1); + if (cert_self_signed(x)) { + /* we have a self signed certificate */ + if (sk_X509_num(ctx->chain) == 1) { + /* + * We have a single self signed certificate: see if we can + * find it in the store. We must have an exact match to avoid + * possible impersonation. + */ + ok = ctx->get_issuer(&xtmp, ctx, x); + if ((ok <= 0) || X509_cmp(x, xtmp)) { + ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT; + ctx->current_cert = x; + ctx->error_depth = i - 1; + if (ok == 1) + X509_free(xtmp); + bad_chain = 1; + ok = cb(0, ctx); + if (!ok) + goto end; + } else { + /* + * We have a match: replace certificate with store + * version so we get any trust settings. + */ + X509_free(x); + x = xtmp; + (void)sk_X509_set(ctx->chain, i - 1, x); + ctx->last_untrusted = 0; + } + } else { + /* + * extract and save self signed certificate for later use + */ + chain_ss = sk_X509_pop(ctx->chain); + ctx->last_untrusted--; + num--; + j--; + x = sk_X509_value(ctx->chain, num - 1); + } + } + /* We now lookup certs from the certificate store */ + for (;;) { + /* If we have enough, we break */ + if (depth < num) + break; + /* If we are self signed, we break */ + if (cert_self_signed(x)) + break; + ok = ctx->get_issuer(&xtmp, ctx, x); + + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; + goto end; + } + if (ok == 0) + break; + x = xtmp; + if (!sk_X509_push(ctx->chain, x)) { + X509_free(xtmp); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + ok = 0; + goto end; + } + num++; + } + + /* we now have our chain, lets check it... */ + trust = check_trust(ctx); + + /* If explicitly rejected error */ + if (trust == X509_TRUST_REJECTED) { + ok = 0; + goto end; + } + /* + * If it's not explicitly trusted then check if there is an alternative + * chain that could be used. We only do this if we haven't already + * checked via TRUSTED_FIRST and the user hasn't switched off alternate + * chain checking + */ + retry = 0; + if (trust != X509_TRUST_TRUSTED + && !(ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) + && !(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS)) { + while (j-- > 1) { + xtmp2 = sk_X509_value(ctx->chain, j - 1); + ok = ctx->get_issuer(&xtmp, ctx, xtmp2); + if (ok < 0) + goto end; + /* Check if we found an alternate chain */ + if (ok > 0) { + /* + * Free up the found cert we'll add it again later + */ + X509_free(xtmp); + + /* + * Dump all the certs above this point - we've found an + * alternate chain + */ + while (num > j) { + xtmp = sk_X509_pop(ctx->chain); + X509_free(xtmp); + num--; + } + ctx->last_untrusted = sk_X509_num(ctx->chain); + retry = 1; + break; + } + } + } + } while (retry); + + /* + * If not explicitly trusted then indicate error unless it's a single + * self signed certificate in which case we've indicated an error already + * and set bad_chain == 1 + */ + if (trust != X509_TRUST_TRUSTED && !bad_chain) { + if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) { + if (ctx->last_untrusted >= num) + ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; + else + ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT; + ctx->current_cert = x; + } else { + + sk_X509_push(ctx->chain, chain_ss); + num++; + ctx->last_untrusted = num; + ctx->current_cert = chain_ss; + ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN; + chain_ss = NULL; + } + + ctx->error_depth = num - 1; + bad_chain = 1; + ok = cb(0, ctx); + if (!ok) + goto end; + } + + /* We have the chain complete: now we need to check its purpose */ + ok = check_chain_extensions(ctx); + + if (!ok) + goto end; + + ok = check_id(ctx); + + if (!ok) + goto end; + + /* + * Check revocation status: we do this after copying parameters because + * they may be needed for CRL signature verification. + */ + + ok = ctx->check_revocation(ctx); + if (!ok) + goto end; + + int err = X509_chain_check_suiteb(&ctx->error_depth, NULL, ctx->chain, + ctx->param->flags); + if (err != X509_V_OK) { + ctx->error = err; + ctx->current_cert = sk_X509_value(ctx->chain, ctx->error_depth); + ok = cb(0, ctx); + if (!ok) + goto end; + } + + /* At this point, we have a chain and need to verify it */ + if (ctx->verify != NULL) + ok = ctx->verify(ctx); + else + ok = internal_verify(ctx); + if (!ok) + goto end; + + /* Check name constraints */ + + ok = check_name_constraints(ctx); + if (!ok) + goto end; + + /* If we get this far evaluate policies */ + if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK)) + ok = ctx->check_policy(ctx); + + end: + if (sktmp != NULL) + sk_X509_free(sktmp); + if (chain_ss != NULL) + X509_free(chain_ss); + + /* Safety net, error returns must set ctx->error */ + if (ok <= 0 && ctx->error == X509_V_OK) + ctx->error = X509_V_ERR_UNSPECIFIED; + return ok; +} + +/* + * Given a STACK_OF(X509) find the issuer of cert (if any) + */ + +static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x) +{ + size_t i; + X509 *issuer; + for (i = 0; i < sk_X509_num(sk); i++) { + issuer = sk_X509_value(sk, i); + if (ctx->check_issued(ctx, x, issuer)) + return issuer; + } + return NULL; +} + +/* Given a possible certificate and issuer check them */ + +static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer) +{ + int ret; + ret = X509_check_issued(issuer, x); + if (ret == X509_V_OK) + return 1; + /* If we haven't asked for issuer errors don't set ctx */ + if (!(ctx->param->flags & X509_V_FLAG_CB_ISSUER_CHECK)) + return 0; + + ctx->error = ret; + ctx->current_cert = x; + ctx->current_issuer = issuer; + return ctx->verify_cb(0, ctx); +} + +/* Alternative lookup method: look from a STACK stored in other_ctx */ + +static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) +{ + *issuer = find_issuer(ctx, ctx->other_ctx, x); + if (*issuer) { + X509_up_ref(*issuer); + return 1; + } else + return 0; +} + +/* + * Check a certificate chains extensions for consistency with the supplied + * purpose + */ + +static int check_chain_extensions(X509_STORE_CTX *ctx) +{ + int i, ok = 0, plen = 0; + X509 *x; + int (*cb) (int xok, X509_STORE_CTX *xctx); + int proxy_path_length = 0; + int purpose; + int allow_proxy_certs; + cb = ctx->verify_cb; + + 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) { + allow_proxy_certs = 0; + purpose = X509_PURPOSE_CRL_SIGN; + } else { + allow_proxy_certs = + ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); + purpose = ctx->param->purpose; + } + + ca_requirement = ca_or_leaf; + + /* Check all untrusted certificates */ + for (i = 0; i < ctx->last_untrusted; i++) { + int ret; + x = sk_X509_value(ctx->chain, i); + if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) + && (x->ex_flags & EXFLAG_CRITICAL)) { + ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { + ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + + switch (ca_requirement) { + case ca_or_leaf: + ret = 1; + break; + case must_not_be_ca: + if (X509_check_ca(x)) { + ret = 0; + ctx->error = X509_V_ERR_INVALID_NON_CA; + } else + ret = 1; + break; + 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; + ok = cb(0, ctx); + if (!ok) + goto end; + } + if (ctx->param->purpose > 0) { + 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; + ok = cb(0, ctx); + if (!ok) + goto end; + } + } + /* Check pathlen if not self issued */ + if ((i > 1) && !(x->ex_flags & EXFLAG_SI) + && (x->ex_pathlen != -1) + && (plen > (x->ex_pathlen + proxy_path_length + 1))) { + ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + /* Increment path length if not self issued */ + if (!(x->ex_flags & EXFLAG_SI)) + plen++; + /* + * If this certificate is a proxy certificate, the next certificate + * must be another proxy certificate or a EE certificate. If not, + * the next certificate must be a CA certificate. + */ + if (x->ex_flags & EXFLAG_PROXY) { + if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { + ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + proxy_path_length++; + 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) +{ + 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--) { + X509 *x = sk_X509_value(ctx->chain, i); + /* Ignore self issued certs unless last in chain */ + if (i && (x->ex_flags & EXFLAG_SI)) + continue; + /* + * Check against constraints for all certificates higher in chain + * including trust anchor. Trust anchor not strictly speaking needed + * but if it includes constraints it is to be assumed it expects them + * to be obeyed. + */ + 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: + continue; + case X509_V_ERR_OUT_OF_MEM: + ctx->error = rv; + return 0; + default: + ctx->error = rv; + ctx->error_depth = i; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + break; + } + } + } + } + + /* 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; +} + +static int check_id_error(X509_STORE_CTX *ctx, int errcode) +{ + ctx->error = errcode; + ctx->current_cert = ctx->cert; + ctx->error_depth = 0; + return ctx->verify_cb(0, ctx); +} + +static int check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) +{ + size_t i; + size_t n = sk_OPENSSL_STRING_num(id->hosts); + char *name; + + if (id->peername != NULL) { + OPENSSL_free(id->peername); + id->peername = NULL; + } + for (i = 0; i < n; ++i) { + name = sk_OPENSSL_STRING_value(id->hosts, i); + if (X509_check_host(x, name, strlen(name), id->hostflags, + &id->peername) > 0) + return 1; + } + return n == 0; +} + +static int check_id(X509_STORE_CTX *ctx) +{ + X509_VERIFY_PARAM *vpm = ctx->param; + X509_VERIFY_PARAM_ID *id = vpm->id; + X509 *x = ctx->cert; + if (id->poison) { + if (!check_id_error(ctx, X509_V_ERR_INVALID_CALL)) + return 0; + } + if (id->hosts && check_hosts(x, id) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_HOSTNAME_MISMATCH)) + return 0; + } + if (id->email && X509_check_email(x, id->email, id->emaillen, 0) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_EMAIL_MISMATCH)) + return 0; + } + if (id->ip && X509_check_ip(x, id->ip, id->iplen, 0) <= 0) { + if (!check_id_error(ctx, X509_V_ERR_IP_ADDRESS_MISMATCH)) + return 0; + } + return 1; +} + +static int check_trust(X509_STORE_CTX *ctx) +{ + size_t i; + int ok; + X509 *x = NULL; + int (*cb) (int xok, X509_STORE_CTX *xctx); + cb = ctx->verify_cb; + /* Check all trusted certificates in chain */ + for (i = ctx->last_untrusted; i < sk_X509_num(ctx->chain); i++) { + x = sk_X509_value(ctx->chain, i); + ok = X509_check_trust(x, ctx->param->trust, 0); + /* If explicitly trusted return trusted */ + if (ok == X509_TRUST_TRUSTED) + return X509_TRUST_TRUSTED; + /* + * If explicitly rejected notify callback and reject if not + * overridden. + */ + if (ok == X509_TRUST_REJECTED) { + ctx->error_depth = i; + ctx->current_cert = x; + ctx->error = X509_V_ERR_CERT_REJECTED; + ok = cb(0, ctx); + if (!ok) + return X509_TRUST_REJECTED; + } + } + /* + * If we accept partial chains and have at least one trusted certificate + * return success. + */ + if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { + X509 *mx; + if (ctx->last_untrusted < (int)sk_X509_num(ctx->chain)) + return X509_TRUST_TRUSTED; + x = sk_X509_value(ctx->chain, 0); + mx = lookup_cert_match(ctx, x); + if (mx) { + (void)sk_X509_set(ctx->chain, 0, mx); + X509_free(x); + ctx->last_untrusted = 0; + return X509_TRUST_TRUSTED; + } + } + + /* + * If no trusted certs in chain at all return untrusted and allow + * standard (no issuer cert) etc errors to be indicated. + */ + return X509_TRUST_UNTRUSTED; +} + +static int check_revocation(X509_STORE_CTX *ctx) +{ + int i, last, ok; + if (!(ctx->param->flags & X509_V_FLAG_CRL_CHECK)) + return 1; + if (ctx->param->flags & X509_V_FLAG_CRL_CHECK_ALL) + last = sk_X509_num(ctx->chain) - 1; + else { + /* If checking CRL paths this isn't the EE certificate */ + if (ctx->parent) + return 1; + last = 0; + } + for (i = 0; i <= last; i++) { + ctx->error_depth = i; + ok = check_cert(ctx); + if (!ok) + return ok; + } + return 1; +} + +static int check_cert(X509_STORE_CTX *ctx) +{ + X509_CRL *crl = NULL, *dcrl = NULL; + X509 *x; + int ok = 0, cnum; + unsigned int last_reasons; + cnum = ctx->error_depth; + x = sk_X509_value(ctx->chain, cnum); + ctx->current_cert = x; + ctx->current_issuer = NULL; + ctx->current_crl_score = 0; + ctx->current_reasons = 0; + while (ctx->current_reasons != CRLDP_ALL_REASONS) { + last_reasons = ctx->current_reasons; + /* Try to retrieve relevant CRL */ + if (ctx->get_crl) + ok = ctx->get_crl(ctx, &crl, x); + else + ok = get_crl_delta(ctx, &crl, &dcrl, x); + /* + * If error looking up CRL, nothing we can do except notify callback + */ + if (!ok) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL; + ok = ctx->verify_cb(0, ctx); + goto err; + } + ctx->current_crl = crl; + ok = ctx->check_crl(ctx, crl); + if (!ok) + goto err; + + if (dcrl) { + ok = ctx->check_crl(ctx, dcrl); + if (!ok) + goto err; + ok = ctx->cert_crl(ctx, dcrl, x); + if (!ok) + goto err; + } else + ok = 1; + + /* Don't look in full CRL if delta reason is removefromCRL */ + if (ok != 2) { + ok = ctx->cert_crl(ctx, crl, x); + if (!ok) + goto err; + } + + X509_CRL_free(crl); + X509_CRL_free(dcrl); + crl = NULL; + dcrl = NULL; + /* + * If reasons not updated we wont get anywhere by another iteration, + * so exit loop. + */ + if (last_reasons == ctx->current_reasons) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL; + ok = ctx->verify_cb(0, ctx); + goto err; + } + } + err: + X509_CRL_free(crl); + X509_CRL_free(dcrl); + + ctx->current_crl = NULL; + return ok; + +} + +/* Check CRL times against values in X509_STORE_CTX */ + +static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify) +{ + time_t *ptime; + int i; + if (notify) + ctx->current_crl = crl; + if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) + ptime = &ctx->param->check_time; + else + ptime = NULL; + + i = X509_cmp_time(X509_CRL_get_lastUpdate(crl), ptime); + if (i == 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i > 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_CRL_NOT_YET_VALID; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (X509_CRL_get_nextUpdate(crl)) { + i = X509_cmp_time(X509_CRL_get_nextUpdate(crl), ptime); + + if (i == 0) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + /* Ignore expiry of base CRL is delta is valid */ + if ((i < 0) && !(ctx->current_crl_score & CRL_SCORE_TIME_DELTA)) { + if (!notify) + return 0; + ctx->error = X509_V_ERR_CRL_HAS_EXPIRED; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + } + + if (notify) + ctx->current_crl = NULL; + + return 1; +} + +static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, + X509 **pissuer, int *pscore, unsigned int *preasons, + STACK_OF(X509_CRL) *crls) +{ + int crl_score, best_score = *pscore; + size_t i; + unsigned int reasons, best_reasons = 0; + X509 *x = ctx->current_cert; + X509_CRL *crl, *best_crl = NULL; + X509 *crl_issuer = NULL, *best_crl_issuer = NULL; + + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + crl = sk_X509_CRL_value(crls, i); + reasons = *preasons; + crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x); + if (crl_score < best_score || crl_score == 0) + continue; + /* If current CRL is equivalent use it if it is newer */ + if (crl_score == best_score && best_crl != NULL) { + int day, sec; + if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl), + X509_CRL_get_lastUpdate(crl)) == 0) + continue; + /* + * ASN1_TIME_diff never returns inconsistent signs for |day| + * and |sec|. + */ + if (day <= 0 && sec <= 0) + continue; + } + best_crl = crl; + best_crl_issuer = crl_issuer; + best_score = crl_score; + best_reasons = reasons; + } + + if (best_crl) { + if (*pcrl) + X509_CRL_free(*pcrl); + *pcrl = best_crl; + *pissuer = best_crl_issuer; + *pscore = best_score; + *preasons = best_reasons; + X509_CRL_up_ref(best_crl); + if (*pdcrl) { + X509_CRL_free(*pdcrl); + *pdcrl = NULL; + } + get_delta_sk(ctx, pdcrl, pscore, best_crl, crls); + } + + if (best_score >= CRL_SCORE_VALID) + return 1; + + return 0; +} + +/* + * Compare two CRL extensions for delta checking purposes. They should be + * both present or both absent. If both present all fields must be identical. + */ + +static int crl_extension_match(X509_CRL *a, X509_CRL *b, int nid) +{ + ASN1_OCTET_STRING *exta, *extb; + int i; + i = X509_CRL_get_ext_by_NID(a, nid, -1); + if (i >= 0) { + /* Can't have multiple occurrences */ + if (X509_CRL_get_ext_by_NID(a, nid, i) != -1) + return 0; + exta = X509_EXTENSION_get_data(X509_CRL_get_ext(a, i)); + } else + exta = NULL; + + i = X509_CRL_get_ext_by_NID(b, nid, -1); + + if (i >= 0) { + + if (X509_CRL_get_ext_by_NID(b, nid, i) != -1) + return 0; + extb = X509_EXTENSION_get_data(X509_CRL_get_ext(b, i)); + } else + extb = NULL; + + if (!exta && !extb) + return 1; + + if (!exta || !extb) + return 0; + + if (ASN1_OCTET_STRING_cmp(exta, extb)) + return 0; + + return 1; +} + +/* See if a base and delta are compatible */ + +static int check_delta_base(X509_CRL *delta, X509_CRL *base) +{ + /* Delta CRL must be a delta */ + if (!delta->base_crl_number) + return 0; + /* Base must have a CRL number */ + if (!base->crl_number) + return 0; + /* Issuer names must match */ + if (X509_NAME_cmp(X509_CRL_get_issuer(base), X509_CRL_get_issuer(delta))) + return 0; + /* AKID and IDP must match */ + if (!crl_extension_match(delta, base, NID_authority_key_identifier)) + return 0; + if (!crl_extension_match(delta, base, NID_issuing_distribution_point)) + return 0; + /* Delta CRL base number must not exceed Full CRL number. */ + if (ASN1_INTEGER_cmp(delta->base_crl_number, base->crl_number) > 0) + return 0; + /* Delta CRL number must exceed full CRL number */ + if (ASN1_INTEGER_cmp(delta->crl_number, base->crl_number) > 0) + return 1; + return 0; +} + +/* + * For a given base CRL find a delta... maybe extend to delta scoring or + * retrieve a chain of deltas... + */ + +static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, int *pscore, + X509_CRL *base, STACK_OF(X509_CRL) *crls) +{ + X509_CRL *delta; + size_t i; + if (!(ctx->param->flags & X509_V_FLAG_USE_DELTAS)) + return; + if (!((ctx->current_cert->ex_flags | base->flags) & EXFLAG_FRESHEST)) + return; + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + delta = sk_X509_CRL_value(crls, i); + if (check_delta_base(delta, base)) { + if (check_crl_time(ctx, delta, 0)) + *pscore |= CRL_SCORE_TIME_DELTA; + X509_CRL_up_ref(delta); + *dcrl = delta; + return; + } + } + *dcrl = NULL; +} + +/* + * For a given CRL return how suitable it is for the supplied certificate + * 'x'. The return value is a mask of several criteria. If the issuer is not + * the certificate issuer this is returned in *pissuer. The reasons mask is + * also used to determine if the CRL is suitable: if no new reasons the CRL + * is rejected, otherwise reasons is updated. + */ + +static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, + unsigned int *preasons, X509_CRL *crl, X509 *x) +{ + + int crl_score = 0; + unsigned int tmp_reasons = *preasons, crl_reasons; + + /* First see if we can reject CRL straight away */ + + /* Invalid IDP cannot be processed */ + if (crl->idp_flags & IDP_INVALID) + return 0; + /* Reason codes or indirect CRLs need extended CRL support */ + if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) { + if (crl->idp_flags & (IDP_INDIRECT | IDP_REASONS)) + return 0; + } else if (crl->idp_flags & IDP_REASONS) { + /* If no new reasons reject */ + if (!(crl->idp_reasons & ~tmp_reasons)) + return 0; + } + /* Don't process deltas at this stage */ + else if (crl->base_crl_number) + return 0; + /* If issuer name doesn't match certificate need indirect CRL */ + if (X509_NAME_cmp(X509_get_issuer_name(x), X509_CRL_get_issuer(crl))) { + if (!(crl->idp_flags & IDP_INDIRECT)) + return 0; + } else + crl_score |= CRL_SCORE_ISSUER_NAME; + + if (!(crl->flags & EXFLAG_CRITICAL)) + crl_score |= CRL_SCORE_NOCRITICAL; + + /* Check expiry */ + if (check_crl_time(ctx, crl, 0)) + crl_score |= CRL_SCORE_TIME; + + /* Check authority key ID and locate certificate issuer */ + crl_akid_check(ctx, crl, pissuer, &crl_score); + + /* If we can't locate certificate issuer at this point forget it */ + + if (!(crl_score & CRL_SCORE_AKID)) + return 0; + + /* Check cert for matching CRL distribution points */ + + if (crl_crldp_check(x, crl, crl_score, &crl_reasons)) { + /* If no new reasons reject */ + if (!(crl_reasons & ~tmp_reasons)) + return 0; + tmp_reasons |= crl_reasons; + crl_score |= CRL_SCORE_SCOPE; + } + + *preasons = tmp_reasons; + + return crl_score; + +} + +static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, + X509 **pissuer, int *pcrl_score) +{ + X509 *crl_issuer = NULL; + X509_NAME *cnm = X509_CRL_get_issuer(crl); + int cidx = ctx->error_depth; + size_t i; + + if ((size_t)cidx != sk_X509_num(ctx->chain) - 1) + cidx++; + + crl_issuer = sk_X509_value(ctx->chain, cidx); + + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { + *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; + *pissuer = crl_issuer; + return; + } + } + + for (cidx++; cidx < (int)sk_X509_num(ctx->chain); cidx++) { + crl_issuer = sk_X509_value(ctx->chain, cidx); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_SAME_PATH; + *pissuer = crl_issuer; + return; + } + } + + /* Anything else needs extended CRL support */ + + if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) + return; + + /* + * Otherwise the CRL issuer is not on the path. Look for it in the set of + * untrusted certificates. + */ + for (i = 0; i < sk_X509_num(ctx->untrusted); i++) { + crl_issuer = sk_X509_value(ctx->untrusted, i); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pissuer = crl_issuer; + *pcrl_score |= CRL_SCORE_AKID; + return; + } + } + + for (i = 0; i < sk_X509_num(ctx->ctx->additional_untrusted); i++) { + crl_issuer = sk_X509_value(ctx->ctx->additional_untrusted, i); + if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) + continue; + if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { + *pissuer = crl_issuer; + *pcrl_score |= CRL_SCORE_AKID; + return; + } + } +} + +/* + * Check the path of a CRL issuer certificate. This creates a new + * X509_STORE_CTX and populates it with most of the parameters from the + * parent. This could be optimised somewhat since a lot of path checking will + * be duplicated by the parent, but this will rarely be used in practice. + */ + +static int check_crl_path(X509_STORE_CTX *ctx, X509 *x) +{ + X509_STORE_CTX crl_ctx; + int ret; + /* Don't allow recursive CRL path validation */ + if (ctx->parent) + return 0; + if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) + return -1; + + crl_ctx.crls = ctx->crls; + /* Copy verify params across */ + X509_STORE_CTX_set0_param(&crl_ctx, ctx->param); + + crl_ctx.parent = ctx; + crl_ctx.verify_cb = ctx->verify_cb; + + /* Verify CRL issuer */ + ret = X509_verify_cert(&crl_ctx); + + if (ret <= 0) + goto err; + + /* Check chain is acceptable */ + + ret = check_crl_chain(ctx, ctx->chain, crl_ctx.chain); + err: + X509_STORE_CTX_cleanup(&crl_ctx); + return ret; +} + +/* + * RFC3280 says nothing about the relationship between CRL path and + * certificate path, which could lead to situations where a certificate could + * be revoked or validated by a CA not authorised to do so. RFC5280 is more + * strict and states that the two paths must end in the same trust anchor, + * though some discussions remain... until this is resolved we use the + * RFC5280 version + */ + +static int check_crl_chain(X509_STORE_CTX *ctx, + STACK_OF(X509) *cert_path, + STACK_OF(X509) *crl_path) +{ + X509 *cert_ta, *crl_ta; + cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); + crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); + if (!X509_cmp(cert_ta, crl_ta)) + return 1; + return 0; +} + +/* + * Check for match between two dist point names: three separate cases. 1. + * Both are relative names and compare X509_NAME types. 2. One full, one + * relative. Compare X509_NAME to GENERAL_NAMES. 3. Both are full names and + * compare two GENERAL_NAMES. 4. One is NULL: automatic match. + */ + +static int idp_check_dp(DIST_POINT_NAME *a, DIST_POINT_NAME *b) +{ + X509_NAME *nm = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gena, *genb; + size_t i, j; + if (!a || !b) + return 1; + if (a->type == 1) { + if (!a->dpname) + return 0; + /* Case 1: two X509_NAME */ + if (b->type == 1) { + if (!b->dpname) + return 0; + if (!X509_NAME_cmp(a->dpname, b->dpname)) + return 1; + else + return 0; + } + /* Case 2: set name and GENERAL_NAMES appropriately */ + nm = a->dpname; + gens = b->name.fullname; + } else if (b->type == 1) { + if (!b->dpname) + return 0; + /* Case 2: set name and GENERAL_NAMES appropriately */ + gens = a->name.fullname; + nm = b->dpname; + } + + /* Handle case 2 with one GENERAL_NAMES and one X509_NAME */ + if (nm) { + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gena = sk_GENERAL_NAME_value(gens, i); + if (gena->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(nm, gena->d.directoryName)) + return 1; + } + return 0; + } + + /* Else case 3: two GENERAL_NAMES */ + + for (i = 0; i < sk_GENERAL_NAME_num(a->name.fullname); i++) { + gena = sk_GENERAL_NAME_value(a->name.fullname, i); + for (j = 0; j < sk_GENERAL_NAME_num(b->name.fullname); j++) { + genb = sk_GENERAL_NAME_value(b->name.fullname, j); + if (!GENERAL_NAME_cmp(gena, genb)) + return 1; + } + } + + return 0; + +} + +static int crldp_check_crlissuer(DIST_POINT *dp, X509_CRL *crl, int crl_score) +{ + size_t i; + X509_NAME *nm = X509_CRL_get_issuer(crl); + /* If no CRLissuer return is successful iff don't need a match */ + if (!dp->CRLissuer) + return ! !(crl_score & CRL_SCORE_ISSUER_NAME); + for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i); + if (gen->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(gen->d.directoryName, nm)) + return 1; + } + return 0; +} + +/* Check CRLDP and IDP */ + +static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score, + unsigned int *preasons) +{ + size_t i; + if (crl->idp_flags & IDP_ONLYATTR) + return 0; + if (x->ex_flags & EXFLAG_CA) { + if (crl->idp_flags & IDP_ONLYUSER) + return 0; + } else { + if (crl->idp_flags & IDP_ONLYCA) + return 0; + } + *preasons = crl->idp_reasons; + for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) { + DIST_POINT *dp = sk_DIST_POINT_value(x->crldp, i); + if (crldp_check_crlissuer(dp, crl, crl_score)) { + if (!crl->idp || idp_check_dp(dp->distpoint, crl->idp->distpoint)) { + *preasons &= dp->dp_reasons; + return 1; + } + } + } + if ((!crl->idp || !crl->idp->distpoint) + && (crl_score & CRL_SCORE_ISSUER_NAME)) + return 1; + return 0; +} + +/* + * Retrieve CRL corresponding to current certificate. If deltas enabled try + * to find a delta CRL too + */ + +static int get_crl_delta(X509_STORE_CTX *ctx, + X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x) +{ + int ok; + X509 *issuer = NULL; + int crl_score = 0; + unsigned int reasons; + X509_CRL *crl = NULL, *dcrl = NULL; + STACK_OF(X509_CRL) *skcrl; + X509_NAME *nm = X509_get_issuer_name(x); + reasons = ctx->current_reasons; + ok = get_crl_sk(ctx, &crl, &dcrl, + &issuer, &crl_score, &reasons, ctx->crls); + + if (ok) + goto done; + + /* Lookup CRLs from store */ + + skcrl = ctx->lookup_crls(ctx, nm); + + /* If no CRLs found and a near match from get_crl_sk use that */ + if (!skcrl && crl) + goto done; + + get_crl_sk(ctx, &crl, &dcrl, &issuer, &crl_score, &reasons, skcrl); + + sk_X509_CRL_pop_free(skcrl, X509_CRL_free); + + done: + + /* If we got any kind of CRL use it and return success */ + if (crl) { + ctx->current_issuer = issuer; + ctx->current_crl_score = crl_score; + ctx->current_reasons = reasons; + *pcrl = crl; + *pdcrl = dcrl; + return 1; + } + + return 0; +} + +/* Check CRL validity */ +static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl) +{ + X509 *issuer = NULL; + EVP_PKEY *ikey = NULL; + int ok = 0, chnum, cnum; + cnum = ctx->error_depth; + chnum = sk_X509_num(ctx->chain) - 1; + /* if we have an alternative CRL issuer cert use that */ + if (ctx->current_issuer) + issuer = ctx->current_issuer; + + /* + * Else find CRL issuer: if not last certificate then issuer is next + * certificate in chain. + */ + else if (cnum < chnum) + issuer = sk_X509_value(ctx->chain, cnum + 1); + else { + issuer = sk_X509_value(ctx->chain, chnum); + /* If not self signed, can't check signature */ + if (!ctx->check_issued(ctx, issuer, issuer)) { + ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + + if (issuer) { + /* + * Skip most tests for deltas because they have already been done + */ + if (!crl->base_crl_number) { + /* Check for cRLSign bit if keyUsage present */ + if ((issuer->ex_flags & EXFLAG_KUSAGE) && + !(issuer->ex_kusage & KU_CRL_SIGN)) { + ctx->error = X509_V_ERR_KEYUSAGE_NO_CRL_SIGN; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + if (!(ctx->current_crl_score & CRL_SCORE_SCOPE)) { + ctx->error = X509_V_ERR_DIFFERENT_CRL_SCOPE; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + if (!(ctx->current_crl_score & CRL_SCORE_SAME_PATH)) { + if (check_crl_path(ctx, ctx->current_issuer) <= 0) { + ctx->error = X509_V_ERR_CRL_PATH_VALIDATION_ERROR; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + + if (crl->idp_flags & IDP_INVALID) { + ctx->error = X509_V_ERR_INVALID_EXTENSION; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + + } + + if (!(ctx->current_crl_score & CRL_SCORE_TIME)) { + ok = check_crl_time(ctx, crl, 1); + if (!ok) + goto err; + } + + /* Attempt to get issuer certificate public key */ + ikey = X509_get_pubkey(issuer); + + if (!ikey) { + ctx->error = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } else { + int rv; + rv = X509_CRL_check_suiteb(crl, ikey, ctx->param->flags); + if (rv != X509_V_OK) { + ctx->error = rv; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + /* Verify CRL signature */ + if (X509_CRL_verify(crl, ikey) <= 0) { + ctx->error = X509_V_ERR_CRL_SIGNATURE_FAILURE; + ok = ctx->verify_cb(0, ctx); + if (!ok) + goto err; + } + } + } + + ok = 1; + + err: + EVP_PKEY_free(ikey); + return ok; +} + +/* Check certificate against CRL */ +static int cert_crl(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x) +{ + int ok; + X509_REVOKED *rev; + /* + * The rules changed for this... previously if a CRL contained unhandled + * critical extensions it could still be used to indicate a certificate + * was revoked. This has since been changed since critical extension can + * change the meaning of CRL entries. + */ + if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) + && (crl->flags & EXFLAG_CRITICAL)) { + ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION; + ok = ctx->verify_cb(0, ctx); + if (!ok) + return 0; + } + /* + * Look for serial number of certificate in CRL If found make sure reason + * is not removeFromCRL. + */ + if (X509_CRL_get0_by_cert(crl, &rev, x)) { + if (rev->reason == CRL_REASON_REMOVE_FROM_CRL) + return 2; + ctx->error = X509_V_ERR_CERT_REVOKED; + ok = ctx->verify_cb(0, ctx); + if (!ok) + return 0; + } + + return 1; +} + +static int check_policy(X509_STORE_CTX *ctx) +{ + int ret; + if (ctx->parent) + return 1; + ret = X509_policy_check(&ctx->tree, &ctx->explicit_policy, ctx->chain, + ctx->param->policies, ctx->param->flags); + if (ret == 0) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + return 0; + } + /* Invalid or inconsistent extensions */ + if (ret == -1) { + /* + * Locate certificates with bad extensions and notify callback. + */ + X509 *x; + size_t i; + for (i = 1; i < sk_X509_num(ctx->chain); i++) { + x = sk_X509_value(ctx->chain, i); + if (!(x->ex_flags & EXFLAG_INVALID_POLICY)) + continue; + ctx->current_cert = x; + ctx->error = X509_V_ERR_INVALID_POLICY_EXTENSION; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + return 1; + } + if (ret == -2) { + ctx->current_cert = NULL; + ctx->error = X509_V_ERR_NO_EXPLICIT_POLICY; + return ctx->verify_cb(0, ctx); + } + + if (ctx->param->flags & X509_V_FLAG_NOTIFY_POLICY) { + ctx->current_cert = NULL; + /* + * Verification errors need to be "sticky", a callback may have allowed + * an SSL handshake to continue despite an error, and we must then + * remain in an error state. Therefore, we MUST NOT clear earlier + * verification errors by setting the error to X509_V_OK. + */ + if (!ctx->verify_cb(2, ctx)) + return 0; + } + + return 1; +} + +static int check_cert_time(X509_STORE_CTX *ctx, X509 *x) +{ + time_t *ptime; + int i; + + if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) + ptime = &ctx->param->check_time; + else + ptime = NULL; + + i = X509_cmp_time(X509_get_notBefore(x), ptime); + if (i == 0) { + ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i > 0) { + ctx->error = X509_V_ERR_CERT_NOT_YET_VALID; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + i = X509_cmp_time(X509_get_notAfter(x), ptime); + if (i == 0) { + ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + if (i < 0) { + ctx->error = X509_V_ERR_CERT_HAS_EXPIRED; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + + return 1; +} + +static int internal_verify(X509_STORE_CTX *ctx) +{ + int ok = 0, n; + X509 *xs, *xi; + EVP_PKEY *pkey = NULL; + int (*cb) (int xok, X509_STORE_CTX *xctx); + + cb = ctx->verify_cb; + + n = sk_X509_num(ctx->chain); + ctx->error_depth = n - 1; + n--; + xi = sk_X509_value(ctx->chain, n); + + if (ctx->check_issued(ctx, xi, xi)) + xs = xi; + else { + if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { + xs = xi; + goto check_cert; + } + if (n <= 0) { + ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; + ctx->current_cert = xi; + ok = cb(0, ctx); + goto end; + } else { + n--; + ctx->error_depth = n; + xs = sk_X509_value(ctx->chain, n); + } + } + +/* ctx->error=0; not needed */ + while (n >= 0) { + ctx->error_depth = n; + + /* + * Skip signature check for self signed certificates unless + * explicitly asked for. It doesn't add any security and just wastes + * time. + */ + if (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE)) { + if ((pkey = X509_get_pubkey(xi)) == NULL) { + ctx->error = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; + ctx->current_cert = xi; + ok = (*cb) (0, ctx); + if (!ok) + goto end; + } else if (X509_verify(xs, pkey) <= 0) { + ctx->error = X509_V_ERR_CERT_SIGNATURE_FAILURE; + ctx->current_cert = xs; + ok = (*cb) (0, ctx); + if (!ok) { + EVP_PKEY_free(pkey); + goto end; + } + } + EVP_PKEY_free(pkey); + pkey = NULL; + } + + check_cert: + ok = check_cert_time(ctx, xs); + if (!ok) + goto end; + + /* The last error (if any) is still in the error value */ + ctx->current_issuer = xi; + ctx->current_cert = xs; + ok = (*cb) (1, ctx); + if (!ok) + goto end; + + n--; + if (n >= 0) { + xi = xs; + xs = sk_X509_value(ctx->chain, n); + } + } + ok = 1; + end: + return ok; +} + +int X509_cmp_current_time(const ASN1_TIME *ctm) +{ + return X509_cmp_time(ctm, NULL); +} + +int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) +{ + 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; + + /* + * 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." + */ + switch (ctm->type) { + case V_ASN1_UTCTIME: + if (ctm->length != (int)(utctime_length)) + return 0; + break; + case V_ASN1_GENERALIZEDTIME: + if (ctm->length != (int)(generalizedtime_length)) + return 0; + break; + default: + return 0; + } + + /** + * 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; + } + if (ctm->data[ctm->length - 1] != 'Z') + 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; + + /* + * 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) +{ + return X509_time_adj(s, adj, NULL); +} + +ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_tm) +{ + return X509_time_adj_ex(s, 0, offset_sec, in_tm); +} + +ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, + int offset_day, long offset_sec, time_t *in_tm) +{ + time_t t = 0; + + if (in_tm) + t = *in_tm; + else + time(&t); + + if (s && !(s->flags & ASN1_STRING_FLAG_MSTRING)) { + if (s->type == V_ASN1_UTCTIME) + return ASN1_UTCTIME_adj(s, t, offset_day, offset_sec); + if (s->type == V_ASN1_GENERALIZEDTIME) + return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec); + } + return ASN1_TIME_adj(s, t, offset_day, offset_sec); +} + +/* Make a delta CRL as the diff between two full CRLs */ + +X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, + EVP_PKEY *skey, const EVP_MD *md, unsigned int flags) +{ + X509_CRL *crl = NULL; + int i; + size_t j; + STACK_OF(X509_REVOKED) *revs = NULL; + /* CRLs can't be delta already */ + if (base->base_crl_number || newer->base_crl_number) { + OPENSSL_PUT_ERROR(X509, X509_R_CRL_ALREADY_DELTA); + return NULL; + } + /* Base and new CRL must have a CRL number */ + if (!base->crl_number || !newer->crl_number) { + OPENSSL_PUT_ERROR(X509, X509_R_NO_CRL_NUMBER); + return NULL; + } + /* Issuer names must match */ + if (X509_NAME_cmp(X509_CRL_get_issuer(base), X509_CRL_get_issuer(newer))) { + OPENSSL_PUT_ERROR(X509, X509_R_ISSUER_MISMATCH); + return NULL; + } + /* AKID and IDP must match */ + if (!crl_extension_match(base, newer, NID_authority_key_identifier)) { + OPENSSL_PUT_ERROR(X509, X509_R_AKID_MISMATCH); + return NULL; + } + if (!crl_extension_match(base, newer, NID_issuing_distribution_point)) { + OPENSSL_PUT_ERROR(X509, X509_R_IDP_MISMATCH); + return NULL; + } + /* Newer CRL number must exceed full CRL number */ + if (ASN1_INTEGER_cmp(newer->crl_number, base->crl_number) <= 0) { + OPENSSL_PUT_ERROR(X509, X509_R_NEWER_CRL_NOT_NEWER); + return NULL; + } + /* CRLs must verify */ + if (skey && (X509_CRL_verify(base, skey) <= 0 || + X509_CRL_verify(newer, skey) <= 0)) { + OPENSSL_PUT_ERROR(X509, X509_R_CRL_VERIFY_FAILURE); + return NULL; + } + /* Create new CRL */ + crl = X509_CRL_new(); + if (!crl || !X509_CRL_set_version(crl, 1)) + goto memerr; + /* Set issuer name */ + if (!X509_CRL_set_issuer_name(crl, X509_CRL_get_issuer(newer))) + goto memerr; + + if (!X509_CRL_set_lastUpdate(crl, X509_CRL_get_lastUpdate(newer))) + goto memerr; + if (!X509_CRL_set_nextUpdate(crl, X509_CRL_get_nextUpdate(newer))) + goto memerr; + + /* Set base CRL number: must be critical */ + + if (!X509_CRL_add1_ext_i2d(crl, NID_delta_crl, base->crl_number, 1, 0)) + goto memerr; + + /* + * Copy extensions across from newest CRL to delta: this will set CRL + * number to correct value too. + */ + + for (i = 0; i < X509_CRL_get_ext_count(newer); i++) { + X509_EXTENSION *ext; + ext = X509_CRL_get_ext(newer, i); + if (!X509_CRL_add_ext(crl, ext, -1)) + goto memerr; + } + + /* Go through revoked entries, copying as needed */ + + revs = X509_CRL_get_REVOKED(newer); + + for (j = 0; j < sk_X509_REVOKED_num(revs); j++) { + X509_REVOKED *rvn, *rvtmp; + rvn = sk_X509_REVOKED_value(revs, j); + /* + * Add only if not also in base. TODO: need something cleverer here + * for some more complex CRLs covering multiple CAs. + */ + if (!X509_CRL_get0_by_serial(base, &rvtmp, rvn->serialNumber)) { + rvtmp = X509_REVOKED_dup(rvn); + if (!rvtmp) + goto memerr; + if (!X509_CRL_add0_revoked(crl, rvtmp)) { + X509_REVOKED_free(rvtmp); + goto memerr; + } + } + } + /* TODO: optionally prune deleted entries */ + + if (skey && md && !X509_CRL_sign(crl, skey, md)) + goto memerr; + + return crl; + + memerr: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (crl) + X509_CRL_free(crl); + return NULL; +} + +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) +{ + /* + * This function is (usually) called only once, by + * SSL_get_ex_data_X509_STORE_CTX_idx (ssl/ssl_cert.c). + */ + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data) +{ + return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); +} + +void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx) +{ + return CRYPTO_get_ex_data(&ctx->ex_data, idx); +} + +int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx) +{ + return ctx->error; +} + +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err) +{ + ctx->error = err; +} + +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) +{ + return ctx->error_depth; +} + +X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) +{ + return ctx->current_cert; +} + +STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) +{ + return ctx->chain; +} + +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) +{ + if (!ctx->chain) + return NULL; + return X509_chain_up_ref(ctx->chain); +} + +X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx) +{ + return ctx->current_issuer; +} + +X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx) +{ + return ctx->current_crl; +} + +X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx) +{ + return ctx->parent; +} + +void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) +{ + ctx->cert = x; +} + +void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + ctx->untrusted = sk; +} + +STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx) +{ + return ctx->untrusted; +} + +void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk) +{ + ctx->crls = sk; +} + +int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose) +{ + return X509_STORE_CTX_purpose_inherit(ctx, 0, purpose, 0); +} + +int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust) +{ + return X509_STORE_CTX_purpose_inherit(ctx, 0, 0, trust); +} + +/* + * This function is used to set the X509_STORE_CTX purpose and trust values. + * This is intended to be used when another structure has its own trust and + * purpose values which (if set) will be inherited by the ctx. If they aren't + * set then we will usually have a default purpose in mind which should then + * be used to set the trust value. An example of this is SSL use: an SSL + * structure will have its own purpose and trust settings which the + * application can set: if they aren't set then we use the default of SSL + * client/server. + */ + +int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust) +{ + int idx; + /* If purpose not set use default */ + if (!purpose) + purpose = def_purpose; + /* If we have a purpose then check it is valid */ + if (purpose) { + X509_PURPOSE *ptmp; + idx = X509_PURPOSE_get_by_id(purpose); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_PURPOSE_ID); + return 0; + } + ptmp = X509_PURPOSE_get0(idx); + if (ptmp->trust == X509_TRUST_DEFAULT) { + idx = X509_PURPOSE_get_by_id(def_purpose); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_PURPOSE_ID); + return 0; + } + ptmp = X509_PURPOSE_get0(idx); + } + /* If trust not set then get from purpose default */ + if (!trust) + trust = ptmp->trust; + } + if (trust) { + idx = X509_TRUST_get_by_id(trust); + if (idx == -1) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_TRUST_ID); + return 0; + } + } + + if (purpose && !ctx->param->purpose) + ctx->param->purpose = purpose; + if (trust && !ctx->param->trust) + ctx->param->trust = trust; + return 1; +} + +X509_STORE_CTX *X509_STORE_CTX_new(void) +{ + X509_STORE_CTX *ctx; + ctx = (X509_STORE_CTX *)OPENSSL_malloc(sizeof(X509_STORE_CTX)); + if (!ctx) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + X509_STORE_CTX_zero(ctx); + return ctx; +} + +void X509_STORE_CTX_zero(X509_STORE_CTX *ctx) +{ + OPENSSL_memset(ctx, 0, sizeof(X509_STORE_CTX)); +} + +void X509_STORE_CTX_free(X509_STORE_CTX *ctx) +{ + if (ctx == NULL) { + return; + } + X509_STORE_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, + STACK_OF(X509) *chain) +{ + int ret = 1; + + X509_STORE_CTX_zero(ctx); + ctx->ctx = store; + ctx->cert = x509; + ctx->untrusted = chain; + + CRYPTO_new_ex_data(&ctx->ex_data); + + ctx->param = X509_VERIFY_PARAM_new(); + if (!ctx->param) + goto err; + + /* + * Inherit callbacks and flags from X509_STORE if not set use defaults. + */ + + if (store) + ret = X509_VERIFY_PARAM_inherit(ctx->param, store->param); + else + ctx->param->inh_flags |= X509_VP_FLAG_DEFAULT | X509_VP_FLAG_ONCE; + + if (store) { + ctx->verify_cb = store->verify_cb; + ctx->cleanup = store->cleanup; + } else + ctx->cleanup = 0; + + if (ret) + ret = X509_VERIFY_PARAM_inherit(ctx->param, + X509_VERIFY_PARAM_lookup("default")); + + if (ret == 0) + goto err; + + if (store && store->check_issued) + ctx->check_issued = store->check_issued; + else + ctx->check_issued = check_issued; + + if (store && store->get_issuer) + ctx->get_issuer = store->get_issuer; + else + ctx->get_issuer = X509_STORE_CTX_get1_issuer; + + if (store && store->verify_cb) + ctx->verify_cb = store->verify_cb; + else + ctx->verify_cb = null_callback; + + if (store && store->verify) + ctx->verify = store->verify; + else + ctx->verify = internal_verify; + + if (store && store->check_revocation) + ctx->check_revocation = store->check_revocation; + else + ctx->check_revocation = check_revocation; + + if (store && store->get_crl) + ctx->get_crl = store->get_crl; + else + ctx->get_crl = NULL; + + if (store && store->check_crl) + ctx->check_crl = store->check_crl; + else + ctx->check_crl = check_crl; + + if (store && store->cert_crl) + ctx->cert_crl = store->cert_crl; + else + ctx->cert_crl = cert_crl; + + if (store && store->lookup_certs) + ctx->lookup_certs = store->lookup_certs; + else + ctx->lookup_certs = X509_STORE_get1_certs; + + if (store && store->lookup_crls) + ctx->lookup_crls = store->lookup_crls; + else + ctx->lookup_crls = X509_STORE_get1_crls; + + ctx->check_policy = check_policy; + + return 1; + + err: + CRYPTO_free_ex_data(&g_ex_data_class, ctx, &ctx->ex_data); + if (ctx->param != NULL) { + X509_VERIFY_PARAM_free(ctx->param); + } + + OPENSSL_memset(ctx, 0, sizeof(X509_STORE_CTX)); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; +} + +/* + * Set alternative lookup method: just a STACK of trusted certificates. This + * avoids X509_STORE nastiness where it isn't needed. + */ + +void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + ctx->other_ctx = sk; + ctx->get_issuer = get_issuer_sk; +} + +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) +{ + /* We need to be idempotent because, unfortunately, |X509_STORE_CTX_free| + * also calls this function. */ + if (ctx->cleanup != NULL) { + ctx->cleanup(ctx); + ctx->cleanup = NULL; + } + if (ctx->param != NULL) { + if (ctx->parent == NULL) + X509_VERIFY_PARAM_free(ctx->param); + ctx->param = NULL; + } + if (ctx->tree != NULL) { + X509_policy_tree_free(ctx->tree); + ctx->tree = NULL; + } + if (ctx->chain != NULL) { + sk_X509_pop_free(ctx->chain, X509_free); + ctx->chain = NULL; + } + CRYPTO_free_ex_data(&g_ex_data_class, ctx, &(ctx->ex_data)); + OPENSSL_memset(&ctx->ex_data, 0, sizeof(CRYPTO_EX_DATA)); +} + +void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth) +{ + X509_VERIFY_PARAM_set_depth(ctx->param, depth); +} + +void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags) +{ + X509_VERIFY_PARAM_set_flags(ctx->param, flags); +} + +void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t) +{ + 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 *)) +{ + ctx->verify_cb = verify_cb; +} + +X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx) +{ + return ctx->tree; +} + +int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx) +{ + return ctx->explicit_policy; +} + +int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name) +{ + const X509_VERIFY_PARAM *param; + param = X509_VERIFY_PARAM_lookup(name); + if (!param) + return 0; + return X509_VERIFY_PARAM_inherit(ctx->param, param); +} + +X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx) +{ + return ctx->param; +} + +void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param) +{ + if (ctx->param) + X509_VERIFY_PARAM_free(ctx->param); + ctx->param = param; +} + +IMPLEMENT_ASN1_SET_OF(X509) + +IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c new file mode 100644 index 0000000..4113562 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c @@ -0,0 +1,671 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include + +#include +#include +#include +#include +#include + +#include "vpm_int.h" +#include "../internal.h" + + +/* X509_VERIFY_PARAM functions */ + +#define SET_HOST 0 +#define ADD_HOST 1 + +static char *str_copy(char *s) +{ + return OPENSSL_strdup(s); +} + +static void str_free(char *s) +{ + OPENSSL_free(s); +} + +#define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free) + +static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, + const char *name, size_t namelen) +{ + char *copy; + + if (name == NULL || namelen == 0) { + // Unlike OpenSSL, we reject trying to set or add an empty name. + return 0; + } + + /* + * Refuse names with embedded NUL bytes. + * XXX: Do we need to push an error onto the error stack? + */ + if (name && OPENSSL_memchr(name, '\0', namelen)) + return 0; + + if (mode == SET_HOST && id->hosts) { + string_stack_free(id->hosts); + id->hosts = NULL; + } + + copy = OPENSSL_strndup(name, namelen); + if (copy == NULL) + return 0; + + if (id->hosts == NULL && + (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { + OPENSSL_free(copy); + return 0; + } + + if (!sk_OPENSSL_STRING_push(id->hosts, copy)) { + OPENSSL_free(copy); + if (sk_OPENSSL_STRING_num(id->hosts) == 0) { + sk_OPENSSL_STRING_free(id->hosts); + id->hosts = NULL; + } + return 0; + } + + return 1; +} + +static void x509_verify_param_zero(X509_VERIFY_PARAM *param) +{ + X509_VERIFY_PARAM_ID *paramid; + if (!param) + return; + param->name = NULL; + param->purpose = 0; + param->trust = 0; + /* + * param->inh_flags = X509_VP_FLAG_DEFAULT; + */ + param->inh_flags = 0; + param->flags = 0; + param->depth = -1; + if (param->policies) { + sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free); + param->policies = NULL; + } + paramid = param->id; + if (paramid->hosts) { + string_stack_free(paramid->hosts); + paramid->hosts = NULL; + } + if (paramid->peername) { + OPENSSL_free(paramid->peername); + paramid->peername = NULL; + } + if (paramid->email) { + OPENSSL_free(paramid->email); + paramid->email = NULL; + paramid->emaillen = 0; + } + if (paramid->ip) { + OPENSSL_free(paramid->ip); + paramid->ip = NULL; + paramid->iplen = 0; + } + paramid->poison = 0; +} + +X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) +{ + X509_VERIFY_PARAM *param; + X509_VERIFY_PARAM_ID *paramid; + param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM)); + if (!param) + return NULL; + paramid = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM_ID)); + if (!paramid) { + OPENSSL_free(param); + return NULL; + } + OPENSSL_memset(param, 0, sizeof(X509_VERIFY_PARAM)); + OPENSSL_memset(paramid, 0, sizeof(X509_VERIFY_PARAM_ID)); + param->id = paramid; + x509_verify_param_zero(param); + return param; +} + +void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param) +{ + if (param == NULL) + return; + x509_verify_param_zero(param); + OPENSSL_free(param->id); + OPENSSL_free(param); +} + +/*- + * This function determines how parameters are "inherited" from one structure + * to another. There are several different ways this can happen. + * + * 1. If a child structure needs to have its values initialized from a parent + * they are simply copied across. For example SSL_CTX copied to SSL. + * 2. If the structure should take on values only if they are currently unset. + * For example the values in an SSL structure will take appropriate value + * for SSL servers or clients but only if the application has not set new + * ones. + * + * The "inh_flags" field determines how this function behaves. + * + * Normally any values which are set in the default are not copied from the + * destination and verify flags are ORed together. + * + * If X509_VP_FLAG_DEFAULT is set then anything set in the source is copied + * to the destination. Effectively the values in "to" become default values + * which will be used only if nothing new is set in "from". + * + * If X509_VP_FLAG_OVERWRITE is set then all value are copied across whether + * they are set or not. Flags is still Ored though. + * + * If X509_VP_FLAG_RESET_FLAGS is set then the flags value is copied instead + * of ORed. + * + * If X509_VP_FLAG_LOCKED is set then no values are copied. + * + * If X509_VP_FLAG_ONCE is set then the current inh_flags setting is zeroed + * after the next call. + */ + +/* Macro to test if a field should be copied from src to dest */ + +#define test_x509_verify_param_copy(field, def) \ + (to_overwrite || \ + ((src->field != (def)) && (to_default || (dest->field == (def))))) + +/* As above but for ID fields */ + +#define test_x509_verify_param_copy_id(idf, def) \ + test_x509_verify_param_copy(id->idf, def) + +/* Macro to test and copy a field if necessary */ + +#define x509_verify_param_copy(field, def) \ + if (test_x509_verify_param_copy(field, def)) \ + dest->field = src->field + +int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *dest, + const X509_VERIFY_PARAM *src) +{ + unsigned long inh_flags; + int to_default, to_overwrite; + X509_VERIFY_PARAM_ID *id; + if (!src) + return 1; + id = src->id; + inh_flags = dest->inh_flags | src->inh_flags; + + if (inh_flags & X509_VP_FLAG_ONCE) + dest->inh_flags = 0; + + if (inh_flags & X509_VP_FLAG_LOCKED) + return 1; + + if (inh_flags & X509_VP_FLAG_DEFAULT) + to_default = 1; + else + to_default = 0; + + if (inh_flags & X509_VP_FLAG_OVERWRITE) + to_overwrite = 1; + else + to_overwrite = 0; + + x509_verify_param_copy(purpose, 0); + x509_verify_param_copy(trust, 0); + x509_verify_param_copy(depth, -1); + + /* If overwrite or check time not set, copy across */ + + if (to_overwrite || !(dest->flags & X509_V_FLAG_USE_CHECK_TIME)) { + dest->check_time = src->check_time; + dest->flags &= ~X509_V_FLAG_USE_CHECK_TIME; + /* Don't need to copy flag: that is done below */ + } + + if (inh_flags & X509_VP_FLAG_RESET_FLAGS) + dest->flags = 0; + + dest->flags |= src->flags; + + if (test_x509_verify_param_copy(policies, NULL)) { + if (!X509_VERIFY_PARAM_set1_policies(dest, src->policies)) + return 0; + } + + /* Copy the host flags if and only if we're copying the host list */ + if (test_x509_verify_param_copy_id(hosts, NULL)) { + if (dest->id->hosts) { + string_stack_free(dest->id->hosts); + dest->id->hosts = NULL; + } + if (id->hosts) { + dest->id->hosts = + sk_OPENSSL_STRING_deep_copy(id->hosts, str_copy, str_free); + if (dest->id->hosts == NULL) + return 0; + dest->id->hostflags = id->hostflags; + } + } + + if (test_x509_verify_param_copy_id(email, NULL)) { + if (!X509_VERIFY_PARAM_set1_email(dest, id->email, id->emaillen)) + return 0; + } + + if (test_x509_verify_param_copy_id(ip, NULL)) { + if (!X509_VERIFY_PARAM_set1_ip(dest, id->ip, id->iplen)) + return 0; + } + + dest->id->poison = src->id->poison; + + return 1; +} + +int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from) +{ + unsigned long save_flags = to->inh_flags; + int ret; + to->inh_flags |= X509_VP_FLAG_DEFAULT; + ret = X509_VERIFY_PARAM_inherit(to, from); + to->inh_flags = save_flags; + return ret; +} + +static int int_x509_param_set1(char **pdest, size_t *pdestlen, + const char *src, size_t srclen) +{ + void *tmp; + if (src == NULL || srclen == 0) { + // Unlike OpenSSL, we do not allow an empty string to disable previously + // configured checks. + return 0; + } + + tmp = OPENSSL_memdup(src, srclen); + if (!tmp) { + return 0; + } + + if (*pdest) + OPENSSL_free(*pdest); + *pdest = tmp; + if (pdestlen) + *pdestlen = srclen; + return 1; +} + +int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) +{ + if (param->name) + OPENSSL_free(param->name); + param->name = OPENSSL_strdup(name); + if (param->name) + return 1; + return 0; +} + +int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags) +{ + param->flags |= flags; + if (flags & X509_V_FLAG_POLICY_MASK) + param->flags |= X509_V_FLAG_POLICY_CHECK; + return 1; +} + +int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags) +{ + param->flags &= ~flags; + return 1; +} + +unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param) +{ + return param->flags; +} + +int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) +{ + return X509_PURPOSE_set(¶m->purpose, purpose); +} + +int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) +{ + return X509_TRUST_set(¶m->trust, trust); +} + +void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth) +{ + param->depth = depth; +} + +void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t) +{ + param->check_time = t; + param->flags |= X509_V_FLAG_USE_CHECK_TIME; +} + +int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy) +{ + if (!param->policies) { + param->policies = sk_ASN1_OBJECT_new_null(); + if (!param->policies) + return 0; + } + if (!sk_ASN1_OBJECT_push(param->policies, policy)) + return 0; + return 1; +} + +int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies) +{ + size_t i; + ASN1_OBJECT *oid, *doid; + if (!param) + return 0; + if (param->policies) + sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free); + + if (!policies) { + param->policies = NULL; + return 1; + } + + param->policies = sk_ASN1_OBJECT_new_null(); + if (!param->policies) + return 0; + + for (i = 0; i < sk_ASN1_OBJECT_num(policies); i++) { + oid = sk_ASN1_OBJECT_value(policies, i); + doid = OBJ_dup(oid); + if (!doid) + return 0; + if (!sk_ASN1_OBJECT_push(param->policies, doid)) { + ASN1_OBJECT_free(doid); + return 0; + } + } + param->flags |= X509_V_FLAG_POLICY_CHECK; + return 1; +} + +int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen) +{ + if (!int_x509_param_set_hosts(param->id, SET_HOST, name, namelen)) { + param->id->poison = 1; + return 0; + } + return 1; +} + +int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen) +{ + if (!int_x509_param_set_hosts(param->id, ADD_HOST, name, namelen)) { + param->id->poison = 1; + return 0; + } + return 1; +} + +void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags) +{ + param->id->hostflags = flags; +} + +char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param) +{ + return param->id->peername; +} + +int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, + const char *email, size_t emaillen) +{ + if (OPENSSL_memchr(email, '\0', emaillen) != NULL || + !int_x509_param_set1(¶m->id->email, ¶m->id->emaillen, + email, emaillen)) { + param->id->poison = 1; + return 0; + } + + return 1; +} + +int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, + const unsigned char *ip, size_t iplen) +{ + if ((iplen != 4 && iplen != 16) || + !int_x509_param_set1((char **)¶m->id->ip, ¶m->id->iplen, + (char *)ip, iplen)) { + param->id->poison = 1; + return 0; + } + + return 1; +} + +int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc) +{ + unsigned char ipout[16]; + size_t iplen; + + iplen = (size_t)a2i_ipadd(ipout, ipasc); + if (iplen == 0) + return 0; + return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen); +} + +int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param) +{ + return param->depth; +} + +const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param) +{ + return param->name; +} + +static const X509_VERIFY_PARAM_ID _empty_id = + { NULL, 0U, NULL, NULL, 0, NULL, 0, 0 }; + +#define vpm_empty_id ((X509_VERIFY_PARAM_ID *)&_empty_id) + +/* + * Default verify parameters: these are used for various applications and can + * be overridden by the user specified table. NB: the 'name' field *must* be + * in alphabetical order because it will be searched using OBJ_search. + */ + +static const X509_VERIFY_PARAM default_table[] = { + { + (char *)"default", /* X509 default parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + 0, /* purpose */ + 0, /* trust */ + 100, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"pkcs7", /* S/MIME sign parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SMIME_SIGN, /* purpose */ + X509_TRUST_EMAIL, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"smime_sign", /* S/MIME sign parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SMIME_SIGN, /* purpose */ + X509_TRUST_EMAIL, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"ssl_client", /* SSL/TLS client parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SSL_CLIENT, /* purpose */ + X509_TRUST_SSL_CLIENT, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"ssl_server", /* SSL/TLS server parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SSL_SERVER, /* purpose */ + X509_TRUST_SSL_SERVER, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id} +}; + +static STACK_OF(X509_VERIFY_PARAM) *param_table = NULL; + +static int param_cmp(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b) +{ + return strcmp((*a)->name, (*b)->name); +} + +int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param) +{ + X509_VERIFY_PARAM *ptmp; + if (!param_table) { + param_table = sk_X509_VERIFY_PARAM_new(param_cmp); + if (!param_table) + return 0; + } 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); + (void)sk_X509_VERIFY_PARAM_delete(param_table, idx); + } + } + if (!sk_X509_VERIFY_PARAM_push(param_table, param)) + return 0; + return 1; +} + +int X509_VERIFY_PARAM_get_count(void) +{ + int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + if (param_table) + num += sk_X509_VERIFY_PARAM_num(param_table); + return num; +} + +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id) +{ + int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + if (id < num) + return default_table + id; + return sk_X509_VERIFY_PARAM_value(param_table, id - num); +} + +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name) +{ + X509_VERIFY_PARAM pm; + unsigned i, limit; + + 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); + } + + limit = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + for (i = 0; i < limit; i++) { + if (strcmp(default_table[i].name, name) == 0) { + return &default_table[i]; + } + } + return NULL; +} + +void X509_VERIFY_PARAM_table_cleanup(void) +{ + if (param_table) + sk_X509_VERIFY_PARAM_pop_free(param_table, X509_VERIFY_PARAM_free); + param_table = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back new file mode 100644 index 0000000..d8d1efe --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back @@ -0,0 +1,671 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include + +#include +#include +#include +#include +#include + +#include "vpm_int.h" +#include "../internal.h" + + +/* X509_VERIFY_PARAM functions */ + +#define SET_HOST 0 +#define ADD_HOST 1 + +static char *str_copy(char *s) +{ + return OPENSSL_strdup(s); +} + +static void str_free(char *s) +{ + OPENSSL_free(s); +} + +#define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free) + +static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, + const char *name, size_t namelen) +{ + char *copy; + + if (name == NULL || namelen == 0) { + // Unlike OpenSSL, we reject trying to set or add an empty name. + return 0; + } + + /* + * Refuse names with embedded NUL bytes. + * XXX: Do we need to push an error onto the error stack? + */ + if (name && OPENSSL_memchr(name, '\0', namelen)) + return 0; + + if (mode == SET_HOST && id->hosts) { + string_stack_free(id->hosts); + id->hosts = NULL; + } + + copy = OPENSSL_strndup(name, namelen); + if (copy == NULL) + return 0; + + if (id->hosts == NULL && + (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { + OPENSSL_free(copy); + return 0; + } + + if (!sk_OPENSSL_STRING_push(id->hosts, copy)) { + OPENSSL_free(copy); + if (sk_OPENSSL_STRING_num(id->hosts) == 0) { + sk_OPENSSL_STRING_free(id->hosts); + id->hosts = NULL; + } + return 0; + } + + return 1; +} + +static void x509_verify_param_zero(X509_VERIFY_PARAM *param) +{ + X509_VERIFY_PARAM_ID *paramid; + if (!param) + return; + param->name = NULL; + param->purpose = 0; + param->trust = 0; + /* + * param->inh_flags = X509_VP_FLAG_DEFAULT; + */ + param->inh_flags = 0; + param->flags = 0; + param->depth = -1; + if (param->policies) { + sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free); + param->policies = NULL; + } + paramid = param->id; + if (paramid->hosts) { + string_stack_free(paramid->hosts); + paramid->hosts = NULL; + } + if (paramid->peername) { + OPENSSL_free(paramid->peername); + paramid->peername = NULL; + } + if (paramid->email) { + OPENSSL_free(paramid->email); + paramid->email = NULL; + paramid->emaillen = 0; + } + if (paramid->ip) { + OPENSSL_free(paramid->ip); + paramid->ip = NULL; + paramid->iplen = 0; + } + paramid->poison = 0; +} + +X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) +{ + X509_VERIFY_PARAM *param; + X509_VERIFY_PARAM_ID *paramid; + param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM)); + if (!param) + return NULL; + paramid = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM_ID)); + if (!paramid) { + OPENSSL_free(param); + return NULL; + } + OPENSSL_memset(param, 0, sizeof(X509_VERIFY_PARAM)); + OPENSSL_memset(paramid, 0, sizeof(X509_VERIFY_PARAM_ID)); + param->id = paramid; + x509_verify_param_zero(param); + return param; +} + +void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param) +{ + if (param == NULL) + return; + x509_verify_param_zero(param); + OPENSSL_free(param->id); + OPENSSL_free(param); +} + +/*- + * This function determines how parameters are "inherited" from one structure + * to another. There are several different ways this can happen. + * + * 1. If a child structure needs to have its values initialized from a parent + * they are simply copied across. For example SSL_CTX copied to SSL. + * 2. If the structure should take on values only if they are currently unset. + * For example the values in an SSL structure will take appropriate value + * for SSL servers or clients but only if the application has not set new + * ones. + * + * The "inh_flags" field determines how this function behaves. + * + * Normally any values which are set in the default are not copied from the + * destination and verify flags are ORed together. + * + * If X509_VP_FLAG_DEFAULT is set then anything set in the source is copied + * to the destination. Effectively the values in "to" become default values + * which will be used only if nothing new is set in "from". + * + * If X509_VP_FLAG_OVERWRITE is set then all value are copied across whether + * they are set or not. Flags is still Ored though. + * + * If X509_VP_FLAG_RESET_FLAGS is set then the flags value is copied instead + * of ORed. + * + * If X509_VP_FLAG_LOCKED is set then no values are copied. + * + * If X509_VP_FLAG_ONCE is set then the current inh_flags setting is zeroed + * after the next call. + */ + +/* Macro to test if a field should be copied from src to dest */ + +#define test_x509_verify_param_copy(field, def) \ + (to_overwrite || \ + ((src->field != (def)) && (to_default || (dest->field == (def))))) + +/* As above but for ID fields */ + +#define test_x509_verify_param_copy_id(idf, def) \ + test_x509_verify_param_copy(id->idf, def) + +/* Macro to test and copy a field if necessary */ + +#define x509_verify_param_copy(field, def) \ + if (test_x509_verify_param_copy(field, def)) \ + dest->field = src->field + +int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *dest, + const X509_VERIFY_PARAM *src) +{ + unsigned long inh_flags; + int to_default, to_overwrite; + X509_VERIFY_PARAM_ID *id; + if (!src) + return 1; + id = src->id; + inh_flags = dest->inh_flags | src->inh_flags; + + if (inh_flags & X509_VP_FLAG_ONCE) + dest->inh_flags = 0; + + if (inh_flags & X509_VP_FLAG_LOCKED) + return 1; + + if (inh_flags & X509_VP_FLAG_DEFAULT) + to_default = 1; + else + to_default = 0; + + if (inh_flags & X509_VP_FLAG_OVERWRITE) + to_overwrite = 1; + else + to_overwrite = 0; + + x509_verify_param_copy(purpose, 0); + x509_verify_param_copy(trust, 0); + x509_verify_param_copy(depth, -1); + + /* If overwrite or check time not set, copy across */ + + if (to_overwrite || !(dest->flags & X509_V_FLAG_USE_CHECK_TIME)) { + dest->check_time = src->check_time; + dest->flags &= ~X509_V_FLAG_USE_CHECK_TIME; + /* Don't need to copy flag: that is done below */ + } + + if (inh_flags & X509_VP_FLAG_RESET_FLAGS) + dest->flags = 0; + + dest->flags |= src->flags; + + if (test_x509_verify_param_copy(policies, NULL)) { + if (!X509_VERIFY_PARAM_set1_policies(dest, src->policies)) + return 0; + } + + /* Copy the host flags if and only if we're copying the host list */ + if (test_x509_verify_param_copy_id(hosts, NULL)) { + if (dest->id->hosts) { + string_stack_free(dest->id->hosts); + dest->id->hosts = NULL; + } + if (id->hosts) { + dest->id->hosts = + sk_OPENSSL_STRING_deep_copy(id->hosts, str_copy, str_free); + if (dest->id->hosts == NULL) + return 0; + dest->id->hostflags = id->hostflags; + } + } + + if (test_x509_verify_param_copy_id(email, NULL)) { + if (!X509_VERIFY_PARAM_set1_email(dest, id->email, id->emaillen)) + return 0; + } + + if (test_x509_verify_param_copy_id(ip, NULL)) { + if (!X509_VERIFY_PARAM_set1_ip(dest, id->ip, id->iplen)) + return 0; + } + + dest->id->poison = src->id->poison; + + return 1; +} + +int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from) +{ + unsigned long save_flags = to->inh_flags; + int ret; + to->inh_flags |= X509_VP_FLAG_DEFAULT; + ret = X509_VERIFY_PARAM_inherit(to, from); + to->inh_flags = save_flags; + return ret; +} + +static int int_x509_param_set1(char **pdest, size_t *pdestlen, + const char *src, size_t srclen) +{ + void *tmp; + if (src == NULL || srclen == 0) { + // Unlike OpenSSL, we do not allow an empty string to disable previously + // configured checks. + return 0; + } + + tmp = OPENSSL_memdup(src, srclen); + if (!tmp) { + return 0; + } + + if (*pdest) + OPENSSL_free(*pdest); + *pdest = tmp; + if (pdestlen) + *pdestlen = srclen; + return 1; +} + +int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) +{ + if (param->name) + OPENSSL_free(param->name); + param->name = OPENSSL_strdup(name); + if (param->name) + return 1; + return 0; +} + +int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags) +{ + param->flags |= flags; + if (flags & X509_V_FLAG_POLICY_MASK) + param->flags |= X509_V_FLAG_POLICY_CHECK; + return 1; +} + +int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags) +{ + param->flags &= ~flags; + return 1; +} + +unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param) +{ + return param->flags; +} + +int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) +{ + return X509_PURPOSE_set(¶m->purpose, purpose); +} + +int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) +{ + return X509_TRUST_set(¶m->trust, trust); +} + +void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth) +{ + param->depth = depth; +} + +void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t) +{ + param->check_time = t; + param->flags |= X509_V_FLAG_USE_CHECK_TIME; +} + +int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy) +{ + if (!param->policies) { + param->policies = sk_ASN1_OBJECT_new_null(); + if (!param->policies) + return 0; + } + if (!sk_ASN1_OBJECT_push(param->policies, policy)) + return 0; + return 1; +} + +int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies) +{ + size_t i; + ASN1_OBJECT *oid, *doid; + if (!param) + return 0; + if (param->policies) + sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free); + + if (!policies) { + param->policies = NULL; + return 1; + } + + param->policies = sk_ASN1_OBJECT_new_null(); + if (!param->policies) + return 0; + + for (i = 0; i < sk_ASN1_OBJECT_num(policies); i++) { + oid = sk_ASN1_OBJECT_value(policies, i); + doid = OBJ_dup(oid); + if (!doid) + return 0; + if (!sk_ASN1_OBJECT_push(param->policies, doid)) { + ASN1_OBJECT_free(doid); + return 0; + } + } + param->flags |= X509_V_FLAG_POLICY_CHECK; + return 1; +} + +int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen) +{ + if (!int_x509_param_set_hosts(param->id, SET_HOST, name, namelen)) { + param->id->poison = 1; + return 0; + } + return 1; +} + +int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen) +{ + if (!int_x509_param_set_hosts(param->id, ADD_HOST, name, namelen)) { + param->id->poison = 1; + return 0; + } + return 1; +} + +void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags) +{ + param->id->hostflags = flags; +} + +char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param) +{ + return param->id->peername; +} + +int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, + const char *email, size_t emaillen) +{ + if (OPENSSL_memchr(email, '\0', emaillen) != NULL || + !int_x509_param_set1(¶m->id->email, ¶m->id->emaillen, + email, emaillen)) { + param->id->poison = 1; + return 0; + } + + return 1; +} + +int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, + const unsigned char *ip, size_t iplen) +{ + if ((iplen != 4 && iplen != 16) || + !int_x509_param_set1((char **)¶m->id->ip, ¶m->id->iplen, + (char *)ip, iplen)) { + param->id->poison = 1; + return 0; + } + + return 1; +} + +int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc) +{ + unsigned char ipout[16]; + size_t iplen; + + iplen = (size_t)a2i_ipadd(ipout, ipasc); + if (iplen == 0) + return 0; + return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen); +} + +int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param) +{ + return param->depth; +} + +const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param) +{ + return param->name; +} + +static const X509_VERIFY_PARAM_ID _empty_id = + { NULL, 0U, NULL, NULL, 0, NULL, 0, 0 }; + +#define vpm_empty_id ((X509_VERIFY_PARAM_ID *)&_empty_id) + +/* + * Default verify parameters: these are used for various applications and can + * be overridden by the user specified table. NB: the 'name' field *must* be + * in alphabetical order because it will be searched using OBJ_search. + */ + +static const X509_VERIFY_PARAM default_table[] = { + { + (char *)"default", /* X509 default parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + 0, /* purpose */ + 0, /* trust */ + 100, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"pkcs7", /* S/MIME sign parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SMIME_SIGN, /* purpose */ + X509_TRUST_EMAIL, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"smime_sign", /* S/MIME sign parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SMIME_SIGN, /* purpose */ + X509_TRUST_EMAIL, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"ssl_client", /* SSL/TLS client parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SSL_CLIENT, /* purpose */ + X509_TRUST_SSL_CLIENT, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id}, + { + (char *)"ssl_server", /* SSL/TLS server parameters */ + 0, /* Check time */ + 0, /* internal flags */ + 0, /* flags */ + X509_PURPOSE_SSL_SERVER, /* purpose */ + X509_TRUST_SSL_SERVER, /* trust */ + -1, /* depth */ + NULL, /* policies */ + vpm_empty_id} +}; + +static STACK_OF(X509_VERIFY_PARAM) *param_table = NULL; + +static int param_cmp(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b) +{ + return strcmp((*a)->name, (*b)->name); +} + +int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param) +{ + X509_VERIFY_PARAM *ptmp; + if (!param_table) { + param_table = sk_X509_VERIFY_PARAM_new(param_cmp); + if (!param_table) + return 0; + } 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); + (void)sk_X509_VERIFY_PARAM_delete(param_table, idx); + } + } + if (!sk_X509_VERIFY_PARAM_push(param_table, param)) + return 0; + return 1; +} + +int X509_VERIFY_PARAM_get_count(void) +{ + int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + if (param_table) + num += sk_X509_VERIFY_PARAM_num(param_table); + return num; +} + +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id) +{ + int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + if (id < num) + return default_table + id; + return sk_X509_VERIFY_PARAM_value(param_table, id - num); +} + +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name) +{ + X509_VERIFY_PARAM pm; + unsigned i, limit; + + 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); + } + + limit = sizeof(default_table) / sizeof(X509_VERIFY_PARAM); + for (i = 0; i < limit; i++) { + if (strcmp(default_table[i].name, name) == 0) { + return &default_table[i]; + } + } + return NULL; +} + +void X509_VERIFY_PARAM_table_cleanup(void) +{ + if (param_table) + sk_X509_VERIFY_PARAM_pop_free(param_table, X509_VERIFY_PARAM_free); + param_table = NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c new file mode 100644 index 0000000..d42b423 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c @@ -0,0 +1,210 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" + +int X509_CRL_set_version(X509_CRL *x, long version) +{ + if (x == NULL) + return (0); + if (x->crl->version == NULL) { + if ((x->crl->version = M_ASN1_INTEGER_new()) == NULL) + return (0); + } + return (ASN1_INTEGER_set(x->crl->version, version)); +} + +int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name) +{ + if ((x == NULL) || (x->crl == NULL)) + return (0); + return (X509_NAME_set(&x->crl->issuer, name)); +} + +int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if (x == NULL) + return (0); + in = x->crl->lastUpdate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->crl->lastUpdate); + x->crl->lastUpdate = in; + } + } + return (in != NULL); +} + +int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if (x == NULL) + return (0); + in = x->crl->nextUpdate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->crl->nextUpdate); + x->crl->nextUpdate = in; + } + } + return (in != NULL); +} + +int X509_CRL_sort(X509_CRL *c) +{ + size_t i; + X509_REVOKED *r; + /* + * sort the data so it will be written in serial number order + */ + sk_X509_REVOKED_sort(c->crl->revoked); + for (i = 0; i < sk_X509_REVOKED_num(c->crl->revoked); i++) { + r = sk_X509_REVOKED_value(c->crl->revoked, i); + r->sequence = i; + } + c->crl->enc.modified = 1; + return 1; +} + +int X509_CRL_up_ref(X509_CRL *crl) +{ + CRYPTO_refcount_inc(&crl->references); + 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; + + if (x == NULL) + return (0); + in = x->revocationDate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->revocationDate); + x->revocationDate = in; + } + } + 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; + + if (x == NULL) + return (0); + in = x->serialNumber; + if (in != serial) { + in = M_ASN1_INTEGER_dup(serial); + if (in != NULL) { + M_ASN1_INTEGER_free(x->serialNumber); + x->serialNumber = in; + } + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back new file mode 100644 index 0000000..6f2708c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back @@ -0,0 +1,210 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * Copyright (c) 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 + * 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 "../internal.h" + +int X509_CRL_set_version(X509_CRL *x, long version) +{ + if (x == NULL) + return (0); + if (x->crl->version == NULL) { + if ((x->crl->version = M_ASN1_INTEGER_new()) == NULL) + return (0); + } + return (ASN1_INTEGER_set(x->crl->version, version)); +} + +int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name) +{ + if ((x == NULL) || (x->crl == NULL)) + return (0); + return (X509_NAME_set(&x->crl->issuer, name)); +} + +int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if (x == NULL) + return (0); + in = x->crl->lastUpdate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->crl->lastUpdate); + x->crl->lastUpdate = in; + } + } + return (in != NULL); +} + +int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + ASN1_TIME *in; + + if (x == NULL) + return (0); + in = x->crl->nextUpdate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->crl->nextUpdate); + x->crl->nextUpdate = in; + } + } + return (in != NULL); +} + +int X509_CRL_sort(X509_CRL *c) +{ + size_t i; + X509_REVOKED *r; + /* + * sort the data so it will be written in serial number order + */ + sk_X509_REVOKED_sort(c->crl->revoked); + for (i = 0; i < sk_X509_REVOKED_num(c->crl->revoked); i++) { + r = sk_X509_REVOKED_value(c->crl->revoked, i); + r->sequence = i; + } + c->crl->enc.modified = 1; + return 1; +} + +int X509_CRL_up_ref(X509_CRL *crl) +{ + CRYPTO_refcount_inc(&crl->references); + 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; + + if (x == NULL) + return (0); + in = x->revocationDate; + if (in != tm) { + in = M_ASN1_TIME_dup(tm); + if (in != NULL) { + M_ASN1_TIME_free(x->revocationDate); + x->revocationDate = in; + } + } + 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; + + if (x == NULL) + return (0); + in = x->serialNumber; + if (in != serial) { + in = M_ASN1_INTEGER_dup(serial); + if (in != NULL) { + M_ASN1_INTEGER_free(x->serialNumber); + x->serialNumber = in; + } + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c new file mode 100644 index 0000000..2f758bb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c @@ -0,0 +1,388 @@ +/* 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 "../internal.h" + + +int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-1); + return (X509_NAME_get_text_by_OBJ(name, obj, buf, len)); +} + +int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + char *buf, int len) +{ + int i; + ASN1_STRING *data; + + i = X509_NAME_get_index_by_OBJ(name, obj, -1); + if (i < 0) + return (-1); + data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i)); + i = (data->length > (len - 1)) ? (len - 1) : data->length; + if (buf == NULL) + return (data->length); + OPENSSL_memcpy(buf, data->data, i); + buf[i] = '\0'; + return (i); +} + +int X509_NAME_entry_count(X509_NAME *name) +{ + if (name == NULL) + return (0); + return (sk_X509_NAME_ENTRY_num(name->entries)); +} + +int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509_NAME_get_index_by_OBJ(name, obj, lastpos)); +} + +/* NOTE: you should be passsing -1, not 0 as lastpos */ +int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + int lastpos) +{ + int n; + X509_NAME_ENTRY *ne; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL) + return (-1); + if (lastpos < 0) + lastpos = -1; + sk = name->entries; + n = sk_X509_NAME_ENTRY_num(sk); + for (lastpos++; lastpos < n; lastpos++) { + ne = sk_X509_NAME_ENTRY_value(sk, lastpos); + if (OBJ_cmp(ne->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc) +{ + if (name == NULL || loc < 0 + || sk_X509_NAME_ENTRY_num(name->entries) <= (size_t)loc) + return (NULL); + else + return (sk_X509_NAME_ENTRY_value(name->entries, loc)); +} + +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) +{ + X509_NAME_ENTRY *ret; + int i, n, set_prev, set_next; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL || loc < 0 + || sk_X509_NAME_ENTRY_num(name->entries) <= (size_t)loc) + return (NULL); + sk = name->entries; + ret = sk_X509_NAME_ENTRY_delete(sk, loc); + n = sk_X509_NAME_ENTRY_num(sk); + name->modified = 1; + if (loc == n) + return (ret); + + /* else we need to fixup the set field */ + if (loc != 0) + set_prev = (sk_X509_NAME_ENTRY_value(sk, loc - 1))->set; + else + set_prev = ret->set - 1; + set_next = sk_X509_NAME_ENTRY_value(sk, loc)->set; + + /* + * set_prev is the previous set set is the current set set_next is the + * following prev 1 1 1 1 1 1 1 1 set 1 1 2 2 next 1 1 2 2 2 2 3 2 so + * basically only if prev and next differ by 2, then re-number down by 1 + */ + if (set_prev + 1 < set_next) + for (i = loc; i < n; i++) + sk_X509_NAME_ENTRY_value(sk, i)->set--; + return (ret); +} + +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, + unsigned char *bytes, int len, int loc, + int set) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_OBJ(NULL, obj, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + unsigned char *bytes, int len, int loc, + int set) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_NID(NULL, nid, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +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) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_txt(NULL, field, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +/* + * if set is -1, append to previous set, 0 'a new one', and 1, prepend to the + * guy we are about to stomp on. + */ +int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, + int set) +{ + X509_NAME_ENTRY *new_name = NULL; + int n, i, inc; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL) + return (0); + sk = name->entries; + n = sk_X509_NAME_ENTRY_num(sk); + if (loc > n) + loc = n; + else if (loc < 0) + loc = n; + + inc = (set == 0); + name->modified = 1; + + if (set == -1) { + if (loc == 0) { + set = 0; + inc = 1; + } else { + set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; + } + } else { /* if (set >= 0) */ + + if (loc >= n) { + if (loc != 0) + set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1; + else + set = 0; + } else + set = sk_X509_NAME_ENTRY_value(sk, loc)->set; + } + + if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) + goto err; + new_name->set = set; + if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + if (inc) { + n = sk_X509_NAME_ENTRY_num(sk); + for (i = loc + 1; i < n; i++) + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; + } + return (1); + err: + if (new_name != NULL) + X509_NAME_ENTRY_free(new_name); + return (0); +} + +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, + const unsigned char *bytes, + int len) +{ + ASN1_OBJECT *obj; + X509_NAME_ENTRY *nentry; + + obj = OBJ_txt2obj(field, 0); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_FIELD_NAME); + ERR_add_error_data(2, "name=", field); + return (NULL); + } + nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len); + ASN1_OBJECT_free(obj); + return nentry; +} + +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, unsigned char *bytes, + int len) +{ + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return NULL; + } + return X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len); +} + +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) +{ + X509_NAME_ENTRY *ret; + + if ((ne == NULL) || (*ne == NULL)) { + if ((ret = X509_NAME_ENTRY_new()) == NULL) + return (NULL); + } else + ret = *ne; + + if (!X509_NAME_ENTRY_set_object(ret, obj)) + goto err; + if (!X509_NAME_ENTRY_set_data(ret, type, bytes, len)) + goto err; + + if ((ne != NULL) && (*ne == NULL)) + *ne = ret; + return (ret); + err: + if ((ne == NULL) || (ret != *ne)) + X509_NAME_ENTRY_free(ret); + return (NULL); +} + +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj) +{ + if ((ne == NULL) || (obj == NULL)) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + return (0); + } + ASN1_OBJECT_free(ne->object); + ne->object = OBJ_dup(obj); + return ((ne->object == NULL) ? 0 : 1); +} + +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len) +{ + int i; + + if ((ne == NULL) || ((bytes == NULL) && (len != 0))) + return (0); + if ((type > 0) && (type & MBSTRING_FLAG)) + return ASN1_STRING_set_by_NID(&ne->value, bytes, + len, type, + OBJ_obj2nid(ne->object)) ? 1 : 0; + if (len < 0) + len = strlen((const char *)bytes); + i = ASN1_STRING_set(ne->value, bytes, len); + if (!i) + return (0); + if (type != V_ASN1_UNDEF) { + if (type == V_ASN1_APP_CHOOSE) + ne->value->type = ASN1_PRINTABLE_type(bytes, len); + else + ne->value->type = type; + } + return (1); +} + +ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne) +{ + if (ne == NULL) + return (NULL); + return (ne->object); +} + +ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne) +{ + if (ne == NULL) + return (NULL); + return (ne->value); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back new file mode 100644 index 0000000..fa621f2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back @@ -0,0 +1,388 @@ +/* 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 "../internal.h" + + +int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-1); + return (X509_NAME_get_text_by_OBJ(name, obj, buf, len)); +} + +int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + char *buf, int len) +{ + int i; + ASN1_STRING *data; + + i = X509_NAME_get_index_by_OBJ(name, obj, -1); + if (i < 0) + return (-1); + data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i)); + i = (data->length > (len - 1)) ? (len - 1) : data->length; + if (buf == NULL) + return (data->length); + OPENSSL_memcpy(buf, data->data, i); + buf[i] = '\0'; + return (i); +} + +int X509_NAME_entry_count(X509_NAME *name) +{ + if (name == NULL) + return (0); + return (sk_X509_NAME_ENTRY_num(name->entries)); +} + +int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) +{ + const ASN1_OBJECT *obj; + + obj = OBJ_nid2obj(nid); + if (obj == NULL) + return (-2); + return (X509_NAME_get_index_by_OBJ(name, obj, lastpos)); +} + +/* NOTE: you should be passsing -1, not 0 as lastpos */ +int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + int lastpos) +{ + int n; + X509_NAME_ENTRY *ne; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL) + return (-1); + if (lastpos < 0) + lastpos = -1; + sk = name->entries; + n = sk_X509_NAME_ENTRY_num(sk); + for (lastpos++; lastpos < n; lastpos++) { + ne = sk_X509_NAME_ENTRY_value(sk, lastpos); + if (OBJ_cmp(ne->object, obj) == 0) + return (lastpos); + } + return (-1); +} + +X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc) +{ + if (name == NULL || loc < 0 + || sk_X509_NAME_ENTRY_num(name->entries) <= (size_t)loc) + return (NULL); + else + return (sk_X509_NAME_ENTRY_value(name->entries, loc)); +} + +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) +{ + X509_NAME_ENTRY *ret; + int i, n, set_prev, set_next; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL || loc < 0 + || sk_X509_NAME_ENTRY_num(name->entries) <= (size_t)loc) + return (NULL); + sk = name->entries; + ret = sk_X509_NAME_ENTRY_delete(sk, loc); + n = sk_X509_NAME_ENTRY_num(sk); + name->modified = 1; + if (loc == n) + return (ret); + + /* else we need to fixup the set field */ + if (loc != 0) + set_prev = (sk_X509_NAME_ENTRY_value(sk, loc - 1))->set; + else + set_prev = ret->set - 1; + set_next = sk_X509_NAME_ENTRY_value(sk, loc)->set; + + /* + * set_prev is the previous set set is the current set set_next is the + * following prev 1 1 1 1 1 1 1 1 set 1 1 2 2 next 1 1 2 2 2 2 3 2 so + * basically only if prev and next differ by 2, then re-number down by 1 + */ + if (set_prev + 1 < set_next) + for (i = loc; i < n; i++) + sk_X509_NAME_ENTRY_value(sk, i)->set--; + return (ret); +} + +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, + unsigned char *bytes, int len, int loc, + int set) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_OBJ(NULL, obj, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + unsigned char *bytes, int len, int loc, + int set) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_NID(NULL, nid, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +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) +{ + X509_NAME_ENTRY *ne; + int ret; + ne = X509_NAME_ENTRY_create_by_txt(NULL, field, type, bytes, len); + if (!ne) + return 0; + ret = X509_NAME_add_entry(name, ne, loc, set); + X509_NAME_ENTRY_free(ne); + return ret; +} + +/* + * if set is -1, append to previous set, 0 'a new one', and 1, prepend to the + * guy we are about to stomp on. + */ +int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, + int set) +{ + X509_NAME_ENTRY *new_name = NULL; + int n, i, inc; + STACK_OF(X509_NAME_ENTRY) *sk; + + if (name == NULL) + return (0); + sk = name->entries; + n = sk_X509_NAME_ENTRY_num(sk); + if (loc > n) + loc = n; + else if (loc < 0) + loc = n; + + inc = (set == 0); + name->modified = 1; + + if (set == -1) { + if (loc == 0) { + set = 0; + inc = 1; + } else { + set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; + } + } else { /* if (set >= 0) */ + + if (loc >= n) { + if (loc != 0) + set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1; + else + set = 0; + } else + set = sk_X509_NAME_ENTRY_value(sk, loc)->set; + } + + if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) + goto err; + new_name->set = set; + if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + if (inc) { + n = sk_X509_NAME_ENTRY_num(sk); + for (i = loc + 1; i < n; i++) + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; + } + return (1); + err: + if (new_name != NULL) + X509_NAME_ENTRY_free(new_name); + return (0); +} + +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, + const unsigned char *bytes, + int len) +{ + ASN1_OBJECT *obj; + X509_NAME_ENTRY *nentry; + + obj = OBJ_txt2obj(field, 0); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_INVALID_FIELD_NAME); + ERR_add_error_data(2, "name=", field); + return (NULL); + } + nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len); + ASN1_OBJECT_free(obj); + return nentry; +} + +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, unsigned char *bytes, + int len) +{ + const ASN1_OBJECT *obj = OBJ_nid2obj(nid); + if (obj == NULL) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_NID); + return NULL; + } + return X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len); +} + +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) +{ + X509_NAME_ENTRY *ret; + + if ((ne == NULL) || (*ne == NULL)) { + if ((ret = X509_NAME_ENTRY_new()) == NULL) + return (NULL); + } else + ret = *ne; + + if (!X509_NAME_ENTRY_set_object(ret, obj)) + goto err; + if (!X509_NAME_ENTRY_set_data(ret, type, bytes, len)) + goto err; + + if ((ne != NULL) && (*ne == NULL)) + *ne = ret; + return (ret); + err: + if ((ne == NULL) || (ret != *ne)) + X509_NAME_ENTRY_free(ret); + return (NULL); +} + +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj) +{ + if ((ne == NULL) || (obj == NULL)) { + OPENSSL_PUT_ERROR(X509, ERR_R_PASSED_NULL_PARAMETER); + return (0); + } + ASN1_OBJECT_free(ne->object); + ne->object = OBJ_dup(obj); + return ((ne->object == NULL) ? 0 : 1); +} + +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len) +{ + int i; + + if ((ne == NULL) || ((bytes == NULL) && (len != 0))) + return (0); + if ((type > 0) && (type & MBSTRING_FLAG)) + return ASN1_STRING_set_by_NID(&ne->value, bytes, + len, type, + OBJ_obj2nid(ne->object)) ? 1 : 0; + if (len < 0) + len = strlen((const char *)bytes); + i = ASN1_STRING_set(ne->value, bytes, len); + if (!i) + return (0); + if (type != V_ASN1_UNDEF) { + if (type == V_ASN1_APP_CHOOSE) + ne->value->type = ASN1_PRINTABLE_type(bytes, len); + else + ne->value->type = type; + } + return (1); +} + +ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne) +{ + if (ne == NULL) + return (NULL); + return (ne->object); +} + +ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne) +{ + if (ne == NULL) + return (NULL); + return (ne->value); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c new file mode 100644 index 0000000..d364ede --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c @@ -0,0 +1,81 @@ +/* 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 X509_REQ_set_version(X509_REQ *x, long version) +{ + if (x == NULL) + return (0); + return (ASN1_INTEGER_set(x->req_info->version, version)); +} + +int X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) +{ + if ((x == NULL) || (x->req_info == NULL)) + return (0); + return (X509_NAME_set(&x->req_info->subject, name)); +} + +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->req_info == NULL)) + return (0); + return (X509_PUBKEY_set(&x->req_info->pubkey, pkey)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c.grpc_back new file mode 100644 index 0000000..c4e6683 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c.grpc_back @@ -0,0 +1,81 @@ +/* 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 X509_REQ_set_version(X509_REQ *x, long version) +{ + if (x == NULL) + return (0); + return (ASN1_INTEGER_set(x->req_info->version, version)); +} + +int X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) +{ + if ((x == NULL) || (x->req_info == NULL)) + return (0); + return (X509_NAME_set(&x->req_info->subject, name)); +} + +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->req_info == NULL)) + return (0); + return (X509_PUBKEY_set(&x->req_info->pubkey, pkey)); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c new file mode 100644 index 0000000..2df5ef6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c @@ -0,0 +1,137 @@ +/* + * 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 + +int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->spkac == NULL)) + return (0); + return (X509_PUBKEY_set(&(x->spkac->pubkey), pkey)); +} + +EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x) +{ + if ((x == NULL) || (x->spkac == NULL)) + return (NULL); + return (X509_PUBKEY_get(x->spkac->pubkey)); +} + +/* Load a Netscape SPKI from a base64 encoded string */ + +NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len) +{ + unsigned char *spki_der; + const unsigned char *p; + size_t spki_len; + NETSCAPE_SPKI *spki; + if (len <= 0) + len = strlen(str); + if (!EVP_DecodedLength(&spki_len, len)) { + OPENSSL_PUT_ERROR(X509, X509_R_BASE64_DECODE_ERROR); + return NULL; + } + if (!(spki_der = OPENSSL_malloc(spki_len))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (!EVP_DecodeBase64 + (spki_der, &spki_len, spki_len, (const uint8_t *)str, len)) { + OPENSSL_PUT_ERROR(X509, X509_R_BASE64_DECODE_ERROR); + OPENSSL_free(spki_der); + return NULL; + } + p = spki_der; + spki = d2i_NETSCAPE_SPKI(NULL, &p, spki_len); + OPENSSL_free(spki_der); + return spki; +} + +/* Generate a base64 encoded string from an SPKI */ + +char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki) +{ + unsigned char *der_spki, *p; + char *b64_str; + size_t b64_len; + int der_len; + der_len = i2d_NETSCAPE_SPKI(spki, NULL); + if (!EVP_EncodedLength(&b64_len, der_len)) { + OPENSSL_PUT_ERROR(X509, ERR_R_OVERFLOW); + return NULL; + } + der_spki = OPENSSL_malloc(der_len); + if (der_spki == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + b64_str = OPENSSL_malloc(b64_len); + if (b64_str == NULL) { + OPENSSL_free(der_spki); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + p = der_spki; + i2d_NETSCAPE_SPKI(spki, &p); + EVP_EncodeBlock((unsigned char *)b64_str, der_spki, der_len); + OPENSSL_free(der_spki); + return b64_str; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c.grpc_back new file mode 100644 index 0000000..4a9b95e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c.grpc_back @@ -0,0 +1,137 @@ +/* + * 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 + +int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey) +{ + if ((x == NULL) || (x->spkac == NULL)) + return (0); + return (X509_PUBKEY_set(&(x->spkac->pubkey), pkey)); +} + +EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x) +{ + if ((x == NULL) || (x->spkac == NULL)) + return (NULL); + return (X509_PUBKEY_get(x->spkac->pubkey)); +} + +/* Load a Netscape SPKI from a base64 encoded string */ + +NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len) +{ + unsigned char *spki_der; + const unsigned char *p; + size_t spki_len; + NETSCAPE_SPKI *spki; + if (len <= 0) + len = strlen(str); + if (!EVP_DecodedLength(&spki_len, len)) { + OPENSSL_PUT_ERROR(X509, X509_R_BASE64_DECODE_ERROR); + return NULL; + } + if (!(spki_der = OPENSSL_malloc(spki_len))) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + if (!EVP_DecodeBase64 + (spki_der, &spki_len, spki_len, (const uint8_t *)str, len)) { + OPENSSL_PUT_ERROR(X509, X509_R_BASE64_DECODE_ERROR); + OPENSSL_free(spki_der); + return NULL; + } + p = spki_der; + spki = d2i_NETSCAPE_SPKI(NULL, &p, spki_len); + OPENSSL_free(spki_der); + return spki; +} + +/* Generate a base64 encoded string from an SPKI */ + +char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki) +{ + unsigned char *der_spki, *p; + char *b64_str; + size_t b64_len; + int der_len; + der_len = i2d_NETSCAPE_SPKI(spki, NULL); + if (!EVP_EncodedLength(&b64_len, der_len)) { + OPENSSL_PUT_ERROR(X509, ERR_R_OVERFLOW); + return NULL; + } + der_spki = OPENSSL_malloc(der_len); + if (der_spki == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + b64_str = OPENSSL_malloc(b64_len); + if (b64_str == NULL) { + OPENSSL_free(der_spki); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return NULL; + } + p = der_spki; + i2d_NETSCAPE_SPKI(spki, &p); + EVP_EncodeBlock((unsigned char *)b64_str, der_spki, der_len); + OPENSSL_free(der_spki); + return b64_str; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c new file mode 100644 index 0000000..8863b78 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c @@ -0,0 +1,151 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 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 + + +ASN1_SEQUENCE(X509_ALGOR) = { + ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT), + ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY) +} ASN1_SEQUENCE_END(X509_ALGOR) + +ASN1_ITEM_TEMPLATE(X509_ALGORS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR) +ASN1_ITEM_TEMPLATE_END(X509_ALGORS) + +IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR) + +IMPLEMENT_ASN1_SET_OF(X509_ALGOR) + +int X509_ALGOR_set0(X509_ALGOR *alg, const ASN1_OBJECT *aobj, int ptype, + void *pval) +{ + if (!alg) + return 0; + if (ptype != V_ASN1_UNDEF) { + if (alg->parameter == NULL) + alg->parameter = ASN1_TYPE_new(); + if (alg->parameter == NULL) + return 0; + } + if (alg) { + if (alg->algorithm) + ASN1_OBJECT_free(alg->algorithm); + alg->algorithm = (ASN1_OBJECT *)aobj; + } + if (ptype == 0) + return 1; + if (ptype == V_ASN1_UNDEF) { + if (alg->parameter) { + ASN1_TYPE_free(alg->parameter); + alg->parameter = NULL; + } + } else + ASN1_TYPE_set(alg->parameter, ptype, pval); + return 1; +} + +void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, + const X509_ALGOR *algor) +{ + if (paobj) + *paobj = algor->algorithm; + if (pptype) { + if (algor->parameter == NULL) { + *pptype = V_ASN1_UNDEF; + return; + } else + *pptype = algor->parameter->type; + if (ppval) + *ppval = algor->parameter->value.ptr; + } +} + +/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ + +void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) +{ + int param_type; + + if (EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) + param_type = V_ASN1_UNDEF; + else + param_type = V_ASN1_NULL; + + X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); + +} + +/* + * X509_ALGOR_cmp returns 0 if |a| and |b| are equal and non-zero otherwise. + */ +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) +{ + int rv; + rv = OBJ_cmp(a->algorithm, b->algorithm); + if (rv) + return rv; + if (!a->parameter && !b->parameter) + return 0; + return ASN1_TYPE_cmp(a->parameter, b->parameter); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c.grpc_back new file mode 100644 index 0000000..13c9a8c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c.grpc_back @@ -0,0 +1,151 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 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 + + +ASN1_SEQUENCE(X509_ALGOR) = { + ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT), + ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY) +} ASN1_SEQUENCE_END(X509_ALGOR) + +ASN1_ITEM_TEMPLATE(X509_ALGORS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR) +ASN1_ITEM_TEMPLATE_END(X509_ALGORS) + +IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR) + +IMPLEMENT_ASN1_SET_OF(X509_ALGOR) + +int X509_ALGOR_set0(X509_ALGOR *alg, const ASN1_OBJECT *aobj, int ptype, + void *pval) +{ + if (!alg) + return 0; + if (ptype != V_ASN1_UNDEF) { + if (alg->parameter == NULL) + alg->parameter = ASN1_TYPE_new(); + if (alg->parameter == NULL) + return 0; + } + if (alg) { + if (alg->algorithm) + ASN1_OBJECT_free(alg->algorithm); + alg->algorithm = (ASN1_OBJECT *)aobj; + } + if (ptype == 0) + return 1; + if (ptype == V_ASN1_UNDEF) { + if (alg->parameter) { + ASN1_TYPE_free(alg->parameter); + alg->parameter = NULL; + } + } else + ASN1_TYPE_set(alg->parameter, ptype, pval); + return 1; +} + +void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, + const X509_ALGOR *algor) +{ + if (paobj) + *paobj = algor->algorithm; + if (pptype) { + if (algor->parameter == NULL) { + *pptype = V_ASN1_UNDEF; + return; + } else + *pptype = algor->parameter->type; + if (ppval) + *ppval = algor->parameter->value.ptr; + } +} + +/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ + +void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) +{ + int param_type; + + if (EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) + param_type = V_ASN1_UNDEF; + else + param_type = V_ASN1_NULL; + + X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); + +} + +/* + * X509_ALGOR_cmp returns 0 if |a| and |b| are equal and non-zero otherwise. + */ +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) +{ + int rv; + rv = OBJ_cmp(a->algorithm, b->algorithm); + if (rv) + return rv; + if (!a->parameter && !b->parameter) + return 0; + return ASN1_TYPE_cmp(a->parameter, b->parameter); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c new file mode 100644 index 0000000..31949a3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c.grpc_back new file mode 100644 index 0000000..33c11b6 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c new file mode 100644 index 0000000..1e7f845 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c @@ -0,0 +1,111 @@ +/* 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 + +/* + * X509_ATTRIBUTE: this has the following form: typedef struct + * x509_attributes_st { ASN1_OBJECT *object; int single; union { char *ptr; + * STACK_OF(ASN1_TYPE) *set; ASN1_TYPE *single; } value; } X509_ATTRIBUTE; + * this needs some extra thought because the CHOICE type is merged with the + * main structure and because the value can be anything at all we *must* try + * the SET OF first because the ASN1_ANY type will swallow anything including + * the whole SET OF structure. + */ + +ASN1_CHOICE(X509_ATTRIBUTE_SET) = { + ASN1_SET_OF(X509_ATTRIBUTE, value.set, ASN1_ANY), + ASN1_SIMPLE(X509_ATTRIBUTE, value.single, ASN1_ANY) +} ASN1_CHOICE_END_selector(X509_ATTRIBUTE, X509_ATTRIBUTE_SET, single) + +ASN1_SEQUENCE(X509_ATTRIBUTE) = { + ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT), + /* CHOICE type merged with parent */ + ASN1_EX_COMBINE(0, 0, X509_ATTRIBUTE_SET) +} ASN1_SEQUENCE_END(X509_ATTRIBUTE) + +IMPLEMENT_ASN1_FUNCTIONS(X509_ATTRIBUTE) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) + +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) +{ + X509_ATTRIBUTE *ret = NULL; + ASN1_TYPE *val = NULL; + + if ((ret = X509_ATTRIBUTE_new()) == NULL) + return (NULL); + /* TODO(fork): const correctness. */ + ret->object = (ASN1_OBJECT *)OBJ_nid2obj(nid); + ret->single = 0; + if ((ret->value.set = sk_ASN1_TYPE_new_null()) == NULL) + goto err; + if ((val = ASN1_TYPE_new()) == NULL) + goto err; + if (!sk_ASN1_TYPE_push(ret->value.set, val)) + goto err; + + ASN1_TYPE_set(val, atrtype, value); + return (ret); + err: + if (ret != NULL) + X509_ATTRIBUTE_free(ret); + if (val != NULL) + ASN1_TYPE_free(val); + return (NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c.grpc_back new file mode 100644 index 0000000..de8c95c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c.grpc_back @@ -0,0 +1,111 @@ +/* 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 + +/* + * X509_ATTRIBUTE: this has the following form: typedef struct + * x509_attributes_st { ASN1_OBJECT *object; int single; union { char *ptr; + * STACK_OF(ASN1_TYPE) *set; ASN1_TYPE *single; } value; } X509_ATTRIBUTE; + * this needs some extra thought because the CHOICE type is merged with the + * main structure and because the value can be anything at all we *must* try + * the SET OF first because the ASN1_ANY type will swallow anything including + * the whole SET OF structure. + */ + +ASN1_CHOICE(X509_ATTRIBUTE_SET) = { + ASN1_SET_OF(X509_ATTRIBUTE, value.set, ASN1_ANY), + ASN1_SIMPLE(X509_ATTRIBUTE, value.single, ASN1_ANY) +} ASN1_CHOICE_END_selector(X509_ATTRIBUTE, X509_ATTRIBUTE_SET, single) + +ASN1_SEQUENCE(X509_ATTRIBUTE) = { + ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT), + /* CHOICE type merged with parent */ + ASN1_EX_COMBINE(0, 0, X509_ATTRIBUTE_SET) +} ASN1_SEQUENCE_END(X509_ATTRIBUTE) + +IMPLEMENT_ASN1_FUNCTIONS(X509_ATTRIBUTE) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) + +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) +{ + X509_ATTRIBUTE *ret = NULL; + ASN1_TYPE *val = NULL; + + if ((ret = X509_ATTRIBUTE_new()) == NULL) + return (NULL); + /* TODO(fork): const correctness. */ + ret->object = (ASN1_OBJECT *)OBJ_nid2obj(nid); + ret->single = 0; + if ((ret->value.set = sk_ASN1_TYPE_new_null()) == NULL) + goto err; + if ((val = ASN1_TYPE_new()) == NULL) + goto err; + if (!sk_ASN1_TYPE_push(ret->value.set, val)) + goto err; + + ASN1_TYPE_set(val, atrtype, value); + return (ret); + err: + if (ret != NULL) + X509_ATTRIBUTE_free(ret); + if (val != NULL) + ASN1_TYPE_free(val); + return (NULL); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c new file mode 100644 index 0000000..b1ba6fb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c @@ -0,0 +1,541 @@ +/* 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 "../internal.h" + +/* + * Method to handle CRL access. In general a CRL could be very large (several + * Mb) and can consume large amounts of resources if stored in memory by + * multiple processes. This method allows general CRL operations to be + * redirected to more efficient callbacks: for example a CRL entry database. + */ + +#define X509_CRL_METHOD_DYNAMIC 1 + +struct x509_crl_method_st { + int flags; + 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); +}; + +static int X509_REVOKED_cmp(const X509_REVOKED **a, const X509_REVOKED **b); +static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); + +ASN1_SEQUENCE(X509_REVOKED) = { + ASN1_SIMPLE(X509_REVOKED,serialNumber, ASN1_INTEGER), + ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME), + ASN1_SEQUENCE_OF_OPT(X509_REVOKED,extensions, X509_EXTENSION) +} ASN1_SEQUENCE_END(X509_REVOKED) + +static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r); +static int def_crl_lookup(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial, + X509_NAME *issuer); + +static const X509_CRL_METHOD int_crl_meth = { + 0, + 0, 0, + def_crl_lookup, + def_crl_verify +}; + +static const X509_CRL_METHOD *default_crl_method = &int_crl_meth; + +/* + * The X509_CRL_INFO structure needs a bit of customisation. Since we cache + * the original encoding the signature wont be affected by reordering of the + * revoked field. + */ +static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_CRL_INFO *a = (X509_CRL_INFO *)*pval; + + if (!a || !a->revoked) + return 1; + switch (operation) { + /* + * Just set cmp function here. We don't sort because that would + * affect the output of X509_CRL_print(). + */ + case ASN1_OP_D2I_POST: + (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp); + break; + } + return 1; +} + + +ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb) = { + ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(X509_CRL_INFO, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME), + ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME), + ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME), + ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED), + ASN1_EXP_SEQUENCE_OF_OPT(X509_CRL_INFO, extensions, X509_EXTENSION, 0) +} ASN1_SEQUENCE_END_enc(X509_CRL_INFO, X509_CRL_INFO) + +/* + * Set CRL entry issuer according to CRL certificate issuer extension. Check + * for unhandled critical CRL entry extensions. + */ + +static int crl_set_issuers(X509_CRL *crl) +{ + + size_t i, k; + int j; + GENERAL_NAMES *gens, *gtmp; + STACK_OF(X509_REVOKED) *revoked; + + revoked = X509_CRL_get_REVOKED(crl); + + gens = NULL; + for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) { + X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i); + STACK_OF(X509_EXTENSION) *exts; + ASN1_ENUMERATED *reason; + X509_EXTENSION *ext; + gtmp = X509_REVOKED_get_ext_d2i(rev, + NID_certificate_issuer, &j, NULL); + if (!gtmp && (j != -1)) { + crl->flags |= EXFLAG_INVALID; + return 1; + } + + if (gtmp) { + gens = gtmp; + if (!crl->issuers) { + crl->issuers = sk_GENERAL_NAMES_new_null(); + if (!crl->issuers) + return 0; + } + if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) + return 0; + } + rev->issuer = gens; + + reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL); + if (!reason && (j != -1)) { + crl->flags |= EXFLAG_INVALID; + return 1; + } + + if (reason) { + rev->reason = ASN1_ENUMERATED_get(reason); + ASN1_ENUMERATED_free(reason); + } else + rev->reason = CRL_REASON_NONE; + + /* Check for critical CRL entry extensions */ + + exts = rev->extensions; + + for (k = 0; k < sk_X509_EXTENSION_num(exts); k++) { + ext = sk_X509_EXTENSION_value(exts, k); + if (ext->critical > 0) { + if (OBJ_obj2nid(ext->object) == NID_certificate_issuer) + continue; + crl->flags |= EXFLAG_CRITICAL; + break; + } + } + + } + + return 1; + +} + +/* + * The X509_CRL structure needs a bit of customisation. Cache some extensions + * and hash of the whole CRL. + */ +static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_CRL *crl = (X509_CRL *)*pval; + STACK_OF(X509_EXTENSION) *exts; + X509_EXTENSION *ext; + size_t idx; + + switch (operation) { + case ASN1_OP_NEW_POST: + crl->idp = NULL; + crl->akid = NULL; + crl->flags = 0; + crl->idp_flags = 0; + crl->idp_reasons = CRLDP_ALL_REASONS; + crl->meth = default_crl_method; + crl->meth_data = NULL; + crl->issuers = NULL; + crl->crl_number = NULL; + crl->base_crl_number = NULL; + break; + + case ASN1_OP_D2I_POST: + X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL); + crl->idp = X509_CRL_get_ext_d2i(crl, + NID_issuing_distribution_point, NULL, + NULL); + if (crl->idp) + setup_idp(crl, crl->idp); + + crl->akid = X509_CRL_get_ext_d2i(crl, + NID_authority_key_identifier, NULL, + NULL); + + crl->crl_number = X509_CRL_get_ext_d2i(crl, + NID_crl_number, NULL, NULL); + + crl->base_crl_number = X509_CRL_get_ext_d2i(crl, + NID_delta_crl, NULL, + NULL); + /* Delta CRLs must have CRL number */ + if (crl->base_crl_number && !crl->crl_number) + crl->flags |= EXFLAG_INVALID; + + /* + * See if we have any unhandled critical CRL extensions and indicate + * this in a flag. We only currently handle IDP so anything else + * critical sets the flag. This code accesses the X509_CRL structure + * directly: applications shouldn't do this. + */ + + exts = crl->crl->extensions; + + for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) { + int nid; + ext = sk_X509_EXTENSION_value(exts, idx); + nid = OBJ_obj2nid(ext->object); + if (nid == NID_freshest_crl) + crl->flags |= EXFLAG_FRESHEST; + if (ext->critical > 0) { + /* We handle IDP and deltas */ + if ((nid == NID_issuing_distribution_point) + || (nid == NID_authority_key_identifier) + || (nid == NID_delta_crl)) + continue; + crl->flags |= EXFLAG_CRITICAL; + break; + } + } + + if (!crl_set_issuers(crl)) + return 0; + + if (crl->meth->crl_init) { + if (crl->meth->crl_init(crl) == 0) + return 0; + } + break; + + case ASN1_OP_FREE_POST: + /* |crl->meth| may be NULL if constructing the object failed before + * |ASN1_OP_NEW_POST| was run. */ + if (crl->meth && crl->meth->crl_free) { + if (!crl->meth->crl_free(crl)) + return 0; + } + if (crl->akid) + AUTHORITY_KEYID_free(crl->akid); + if (crl->idp) + ISSUING_DIST_POINT_free(crl->idp); + ASN1_INTEGER_free(crl->crl_number); + ASN1_INTEGER_free(crl->base_crl_number); + sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); + break; + } + return 1; +} + +/* Convert IDP into a more convenient form */ + +static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp) +{ + int idp_only = 0; + /* Set various flags according to IDP */ + crl->idp_flags |= IDP_PRESENT; + if (idp->onlyuser > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYUSER; + } + if (idp->onlyCA > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYCA; + } + if (idp->onlyattr > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYATTR; + } + + if (idp_only > 1) + crl->idp_flags |= IDP_INVALID; + + if (idp->indirectCRL > 0) + crl->idp_flags |= IDP_INDIRECT; + + if (idp->onlysomereasons) { + crl->idp_flags |= IDP_REASONS; + if (idp->onlysomereasons->length > 0) + crl->idp_reasons = idp->onlysomereasons->data[0]; + if (idp->onlysomereasons->length > 1) + crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8); + crl->idp_reasons &= CRLDP_ALL_REASONS; + } + + DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl)); +} + +ASN1_SEQUENCE_ref(X509_CRL, crl_cb) = { + ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO), + ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_CRL, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REVOKED) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_REVOKED) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CRL_INFO) +IMPLEMENT_ASN1_FUNCTIONS(X509_CRL) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_CRL) + +static int X509_REVOKED_cmp(const X509_REVOKED **a, const X509_REVOKED **b) +{ + return (ASN1_STRING_cmp((ASN1_STRING *)(*a)->serialNumber, + (ASN1_STRING *)(*b)->serialNumber)); +} + +int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) +{ + X509_CRL_INFO *inf; + inf = crl->crl; + if (!inf->revoked) + inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); + if (!inf->revoked || !sk_X509_REVOKED_push(inf->revoked, rev)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + inf->enc.modified = 1; + return 1; +} + +int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r) +{ + if (crl->meth->crl_verify) + return crl->meth->crl_verify(crl, r); + return 0; +} + +int X509_CRL_get0_by_serial(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial) +{ + if (crl->meth->crl_lookup) + return crl->meth->crl_lookup(crl, ret, serial, NULL); + return 0; +} + +int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) +{ + if (crl->meth->crl_lookup) + return crl->meth->crl_lookup(crl, ret, + X509_get_serialNumber(x), + X509_get_issuer_name(x)); + return 0; +} + +static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CRL_INFO), + crl->sig_alg, crl->signature, crl->crl, r)); +} + +static int crl_revoked_issuer_match(X509_CRL *crl, X509_NAME *nm, + X509_REVOKED *rev) +{ + size_t i; + + if (!rev->issuer) { + if (!nm) + return 1; + if (!X509_NAME_cmp(nm, X509_CRL_get_issuer(crl))) + return 1; + return 0; + } + + if (!nm) + nm = X509_CRL_get_issuer(crl); + + for (i = 0; i < sk_GENERAL_NAME_num(rev->issuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(rev->issuer, i); + if (gen->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(nm, gen->d.directoryName)) + return 1; + } + return 0; + +} + +static struct CRYPTO_STATIC_MUTEX g_crl_sort_lock = CRYPTO_STATIC_MUTEX_INIT; + +static int def_crl_lookup(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial, + X509_NAME *issuer) +{ + X509_REVOKED rtmp, *rev; + size_t idx; + rtmp.serialNumber = serial; + /* + * Sort revoked into serial number order if not already sorted. Do this + * under a lock to avoid race condition. + */ + + CRYPTO_STATIC_MUTEX_lock_read(&g_crl_sort_lock); + const int is_sorted = sk_X509_REVOKED_is_sorted(crl->crl->revoked); + CRYPTO_STATIC_MUTEX_unlock_read(&g_crl_sort_lock); + + if (!is_sorted) { + CRYPTO_STATIC_MUTEX_lock_write(&g_crl_sort_lock); + if (!sk_X509_REVOKED_is_sorted(crl->crl->revoked)) { + sk_X509_REVOKED_sort(crl->crl->revoked); + } + CRYPTO_STATIC_MUTEX_unlock_write(&g_crl_sort_lock); + } + + if (!sk_X509_REVOKED_find(crl->crl->revoked, &idx, &rtmp)) + return 0; + /* Need to look for matching name */ + for (; idx < sk_X509_REVOKED_num(crl->crl->revoked); idx++) { + rev = sk_X509_REVOKED_value(crl->crl->revoked, idx); + if (ASN1_INTEGER_cmp(rev->serialNumber, serial)) + return 0; + if (crl_revoked_issuer_match(crl, issuer, rev)) { + if (ret) + *ret = rev; + if (rev->reason == CRL_REASON_REMOVE_FROM_CRL) + return 2; + return 1; + } + } + return 0; +} + +void X509_CRL_set_default_method(const X509_CRL_METHOD *meth) +{ + if (meth == NULL) + default_crl_method = &int_crl_meth; + else + default_crl_method = meth; +} + +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)) +{ + X509_CRL_METHOD *m; + m = OPENSSL_malloc(sizeof(X509_CRL_METHOD)); + if (!m) + return NULL; + m->crl_init = crl_init; + m->crl_free = crl_free; + m->crl_lookup = crl_lookup; + m->crl_verify = crl_verify; + m->flags = X509_CRL_METHOD_DYNAMIC; + return m; +} + +void X509_CRL_METHOD_free(X509_CRL_METHOD *m) +{ + if (!(m->flags & X509_CRL_METHOD_DYNAMIC)) + return; + OPENSSL_free(m); +} + +void X509_CRL_set_meth_data(X509_CRL *crl, void *dat) +{ + crl->meth_data = dat; +} + +void *X509_CRL_get_meth_data(X509_CRL *crl) +{ + return crl->meth_data; +} + +IMPLEMENT_ASN1_SET_OF(X509_REVOKED) + +IMPLEMENT_ASN1_SET_OF(X509_CRL) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c.grpc_back new file mode 100644 index 0000000..6450e84 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c.grpc_back @@ -0,0 +1,541 @@ +/* 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 "../internal.h" + +/* + * Method to handle CRL access. In general a CRL could be very large (several + * Mb) and can consume large amounts of resources if stored in memory by + * multiple processes. This method allows general CRL operations to be + * redirected to more efficient callbacks: for example a CRL entry database. + */ + +#define X509_CRL_METHOD_DYNAMIC 1 + +struct x509_crl_method_st { + int flags; + 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); +}; + +static int X509_REVOKED_cmp(const X509_REVOKED **a, const X509_REVOKED **b); +static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); + +ASN1_SEQUENCE(X509_REVOKED) = { + ASN1_SIMPLE(X509_REVOKED,serialNumber, ASN1_INTEGER), + ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME), + ASN1_SEQUENCE_OF_OPT(X509_REVOKED,extensions, X509_EXTENSION) +} ASN1_SEQUENCE_END(X509_REVOKED) + +static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r); +static int def_crl_lookup(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial, + X509_NAME *issuer); + +static const X509_CRL_METHOD int_crl_meth = { + 0, + 0, 0, + def_crl_lookup, + def_crl_verify +}; + +static const X509_CRL_METHOD *default_crl_method = &int_crl_meth; + +/* + * The X509_CRL_INFO structure needs a bit of customisation. Since we cache + * the original encoding the signature wont be affected by reordering of the + * revoked field. + */ +static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_CRL_INFO *a = (X509_CRL_INFO *)*pval; + + if (!a || !a->revoked) + return 1; + switch (operation) { + /* + * Just set cmp function here. We don't sort because that would + * affect the output of X509_CRL_print(). + */ + case ASN1_OP_D2I_POST: + (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp); + break; + } + return 1; +} + + +ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb) = { + ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(X509_CRL_INFO, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME), + ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME), + ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME), + ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED), + ASN1_EXP_SEQUENCE_OF_OPT(X509_CRL_INFO, extensions, X509_EXTENSION, 0) +} ASN1_SEQUENCE_END_enc(X509_CRL_INFO, X509_CRL_INFO) + +/* + * Set CRL entry issuer according to CRL certificate issuer extension. Check + * for unhandled critical CRL entry extensions. + */ + +static int crl_set_issuers(X509_CRL *crl) +{ + + size_t i, k; + int j; + GENERAL_NAMES *gens, *gtmp; + STACK_OF(X509_REVOKED) *revoked; + + revoked = X509_CRL_get_REVOKED(crl); + + gens = NULL; + for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) { + X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i); + STACK_OF(X509_EXTENSION) *exts; + ASN1_ENUMERATED *reason; + X509_EXTENSION *ext; + gtmp = X509_REVOKED_get_ext_d2i(rev, + NID_certificate_issuer, &j, NULL); + if (!gtmp && (j != -1)) { + crl->flags |= EXFLAG_INVALID; + return 1; + } + + if (gtmp) { + gens = gtmp; + if (!crl->issuers) { + crl->issuers = sk_GENERAL_NAMES_new_null(); + if (!crl->issuers) + return 0; + } + if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) + return 0; + } + rev->issuer = gens; + + reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL); + if (!reason && (j != -1)) { + crl->flags |= EXFLAG_INVALID; + return 1; + } + + if (reason) { + rev->reason = ASN1_ENUMERATED_get(reason); + ASN1_ENUMERATED_free(reason); + } else + rev->reason = CRL_REASON_NONE; + + /* Check for critical CRL entry extensions */ + + exts = rev->extensions; + + for (k = 0; k < sk_X509_EXTENSION_num(exts); k++) { + ext = sk_X509_EXTENSION_value(exts, k); + if (ext->critical > 0) { + if (OBJ_obj2nid(ext->object) == NID_certificate_issuer) + continue; + crl->flags |= EXFLAG_CRITICAL; + break; + } + } + + } + + return 1; + +} + +/* + * The X509_CRL structure needs a bit of customisation. Cache some extensions + * and hash of the whole CRL. + */ +static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_CRL *crl = (X509_CRL *)*pval; + STACK_OF(X509_EXTENSION) *exts; + X509_EXTENSION *ext; + size_t idx; + + switch (operation) { + case ASN1_OP_NEW_POST: + crl->idp = NULL; + crl->akid = NULL; + crl->flags = 0; + crl->idp_flags = 0; + crl->idp_reasons = CRLDP_ALL_REASONS; + crl->meth = default_crl_method; + crl->meth_data = NULL; + crl->issuers = NULL; + crl->crl_number = NULL; + crl->base_crl_number = NULL; + break; + + case ASN1_OP_D2I_POST: + X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL); + crl->idp = X509_CRL_get_ext_d2i(crl, + NID_issuing_distribution_point, NULL, + NULL); + if (crl->idp) + setup_idp(crl, crl->idp); + + crl->akid = X509_CRL_get_ext_d2i(crl, + NID_authority_key_identifier, NULL, + NULL); + + crl->crl_number = X509_CRL_get_ext_d2i(crl, + NID_crl_number, NULL, NULL); + + crl->base_crl_number = X509_CRL_get_ext_d2i(crl, + NID_delta_crl, NULL, + NULL); + /* Delta CRLs must have CRL number */ + if (crl->base_crl_number && !crl->crl_number) + crl->flags |= EXFLAG_INVALID; + + /* + * See if we have any unhandled critical CRL extensions and indicate + * this in a flag. We only currently handle IDP so anything else + * critical sets the flag. This code accesses the X509_CRL structure + * directly: applications shouldn't do this. + */ + + exts = crl->crl->extensions; + + for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) { + int nid; + ext = sk_X509_EXTENSION_value(exts, idx); + nid = OBJ_obj2nid(ext->object); + if (nid == NID_freshest_crl) + crl->flags |= EXFLAG_FRESHEST; + if (ext->critical > 0) { + /* We handle IDP and deltas */ + if ((nid == NID_issuing_distribution_point) + || (nid == NID_authority_key_identifier) + || (nid == NID_delta_crl)) + continue; + crl->flags |= EXFLAG_CRITICAL; + break; + } + } + + if (!crl_set_issuers(crl)) + return 0; + + if (crl->meth->crl_init) { + if (crl->meth->crl_init(crl) == 0) + return 0; + } + break; + + case ASN1_OP_FREE_POST: + /* |crl->meth| may be NULL if constructing the object failed before + * |ASN1_OP_NEW_POST| was run. */ + if (crl->meth && crl->meth->crl_free) { + if (!crl->meth->crl_free(crl)) + return 0; + } + if (crl->akid) + AUTHORITY_KEYID_free(crl->akid); + if (crl->idp) + ISSUING_DIST_POINT_free(crl->idp); + ASN1_INTEGER_free(crl->crl_number); + ASN1_INTEGER_free(crl->base_crl_number); + sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); + break; + } + return 1; +} + +/* Convert IDP into a more convenient form */ + +static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp) +{ + int idp_only = 0; + /* Set various flags according to IDP */ + crl->idp_flags |= IDP_PRESENT; + if (idp->onlyuser > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYUSER; + } + if (idp->onlyCA > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYCA; + } + if (idp->onlyattr > 0) { + idp_only++; + crl->idp_flags |= IDP_ONLYATTR; + } + + if (idp_only > 1) + crl->idp_flags |= IDP_INVALID; + + if (idp->indirectCRL > 0) + crl->idp_flags |= IDP_INDIRECT; + + if (idp->onlysomereasons) { + crl->idp_flags |= IDP_REASONS; + if (idp->onlysomereasons->length > 0) + crl->idp_reasons = idp->onlysomereasons->data[0]; + if (idp->onlysomereasons->length > 1) + crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8); + crl->idp_reasons &= CRLDP_ALL_REASONS; + } + + DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl)); +} + +ASN1_SEQUENCE_ref(X509_CRL, crl_cb) = { + ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO), + ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_CRL, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REVOKED) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_REVOKED) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CRL_INFO) +IMPLEMENT_ASN1_FUNCTIONS(X509_CRL) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_CRL) + +static int X509_REVOKED_cmp(const X509_REVOKED **a, const X509_REVOKED **b) +{ + return (ASN1_STRING_cmp((ASN1_STRING *)(*a)->serialNumber, + (ASN1_STRING *)(*b)->serialNumber)); +} + +int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) +{ + X509_CRL_INFO *inf; + inf = crl->crl; + if (!inf->revoked) + inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); + if (!inf->revoked || !sk_X509_REVOKED_push(inf->revoked, rev)) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + inf->enc.modified = 1; + return 1; +} + +int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r) +{ + if (crl->meth->crl_verify) + return crl->meth->crl_verify(crl, r); + return 0; +} + +int X509_CRL_get0_by_serial(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial) +{ + if (crl->meth->crl_lookup) + return crl->meth->crl_lookup(crl, ret, serial, NULL); + return 0; +} + +int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) +{ + if (crl->meth->crl_lookup) + return crl->meth->crl_lookup(crl, ret, + X509_get_serialNumber(x), + X509_get_issuer_name(x)); + return 0; +} + +static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CRL_INFO), + crl->sig_alg, crl->signature, crl->crl, r)); +} + +static int crl_revoked_issuer_match(X509_CRL *crl, X509_NAME *nm, + X509_REVOKED *rev) +{ + size_t i; + + if (!rev->issuer) { + if (!nm) + return 1; + if (!X509_NAME_cmp(nm, X509_CRL_get_issuer(crl))) + return 1; + return 0; + } + + if (!nm) + nm = X509_CRL_get_issuer(crl); + + for (i = 0; i < sk_GENERAL_NAME_num(rev->issuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(rev->issuer, i); + if (gen->type != GEN_DIRNAME) + continue; + if (!X509_NAME_cmp(nm, gen->d.directoryName)) + return 1; + } + return 0; + +} + +static struct CRYPTO_STATIC_MUTEX g_crl_sort_lock = CRYPTO_STATIC_MUTEX_INIT; + +static int def_crl_lookup(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial, + X509_NAME *issuer) +{ + X509_REVOKED rtmp, *rev; + size_t idx; + rtmp.serialNumber = serial; + /* + * Sort revoked into serial number order if not already sorted. Do this + * under a lock to avoid race condition. + */ + + CRYPTO_STATIC_MUTEX_lock_read(&g_crl_sort_lock); + const int is_sorted = sk_X509_REVOKED_is_sorted(crl->crl->revoked); + CRYPTO_STATIC_MUTEX_unlock_read(&g_crl_sort_lock); + + if (!is_sorted) { + CRYPTO_STATIC_MUTEX_lock_write(&g_crl_sort_lock); + if (!sk_X509_REVOKED_is_sorted(crl->crl->revoked)) { + sk_X509_REVOKED_sort(crl->crl->revoked); + } + CRYPTO_STATIC_MUTEX_unlock_write(&g_crl_sort_lock); + } + + if (!sk_X509_REVOKED_find(crl->crl->revoked, &idx, &rtmp)) + return 0; + /* Need to look for matching name */ + for (; idx < sk_X509_REVOKED_num(crl->crl->revoked); idx++) { + rev = sk_X509_REVOKED_value(crl->crl->revoked, idx); + if (ASN1_INTEGER_cmp(rev->serialNumber, serial)) + return 0; + if (crl_revoked_issuer_match(crl, issuer, rev)) { + if (ret) + *ret = rev; + if (rev->reason == CRL_REASON_REMOVE_FROM_CRL) + return 2; + return 1; + } + } + return 0; +} + +void X509_CRL_set_default_method(const X509_CRL_METHOD *meth) +{ + if (meth == NULL) + default_crl_method = &int_crl_meth; + else + default_crl_method = meth; +} + +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)) +{ + X509_CRL_METHOD *m; + m = OPENSSL_malloc(sizeof(X509_CRL_METHOD)); + if (!m) + return NULL; + m->crl_init = crl_init; + m->crl_free = crl_free; + m->crl_lookup = crl_lookup; + m->crl_verify = crl_verify; + m->flags = X509_CRL_METHOD_DYNAMIC; + return m; +} + +void X509_CRL_METHOD_free(X509_CRL_METHOD *m) +{ + if (!(m->flags & X509_CRL_METHOD_DYNAMIC)) + return; + OPENSSL_free(m); +} + +void X509_CRL_set_meth_data(X509_CRL *crl, void *dat) +{ + crl->meth_data = dat; +} + +void *X509_CRL_get_meth_data(X509_CRL *crl) +{ + return crl->meth_data; +} + +IMPLEMENT_ASN1_SET_OF(X509_REVOKED) + +IMPLEMENT_ASN1_SET_OF(X509_CRL) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c new file mode 100644 index 0000000..ca653e8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c @@ -0,0 +1,75 @@ +/* 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 + + +ASN1_SEQUENCE(X509_EXTENSION) = { + ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT), + ASN1_OPT(X509_EXTENSION, critical, ASN1_BOOLEAN), + ASN1_SIMPLE(X509_EXTENSION, value, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(X509_EXTENSION) + +ASN1_ITEM_TEMPLATE(X509_EXTENSIONS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Extension, X509_EXTENSION) +ASN1_ITEM_TEMPLATE_END(X509_EXTENSIONS) + +IMPLEMENT_ASN1_FUNCTIONS(X509_EXTENSION) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c.grpc_back new file mode 100644 index 0000000..36403e4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c.grpc_back @@ -0,0 +1,75 @@ +/* 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 + + +ASN1_SEQUENCE(X509_EXTENSION) = { + ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT), + ASN1_OPT(X509_EXTENSION, critical, ASN1_BOOLEAN), + ASN1_SIMPLE(X509_EXTENSION, value, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(X509_EXTENSION) + +ASN1_ITEM_TEMPLATE(X509_EXTENSIONS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Extension, X509_EXTENSION) +ASN1_ITEM_TEMPLATE_END(X509_EXTENSIONS) + +IMPLEMENT_ASN1_FUNCTIONS(X509_EXTENSION) +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c new file mode 100644 index 0000000..4217eb1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c @@ -0,0 +1,98 @@ +/* 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 + +X509_INFO *X509_INFO_new(void) +{ + X509_INFO *ret = NULL; + + ret = (X509_INFO *)OPENSSL_malloc(sizeof(X509_INFO)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + + ret->enc_cipher.cipher = NULL; + ret->enc_len = 0; + ret->enc_data = NULL; + + ret->x509 = NULL; + ret->crl = NULL; + ret->x_pkey = NULL; + return (ret); +} + +void X509_INFO_free(X509_INFO *x) +{ + if (x == NULL) + return; + + if (x->x509 != NULL) + X509_free(x->x509); + if (x->crl != NULL) + X509_CRL_free(x->crl); + if (x->x_pkey != NULL) + X509_PKEY_free(x->x_pkey); + if (x->enc_data != NULL) + OPENSSL_free(x->enc_data); + OPENSSL_free(x); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c.grpc_back new file mode 100644 index 0000000..177cd0e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c.grpc_back @@ -0,0 +1,98 @@ +/* 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 + +X509_INFO *X509_INFO_new(void) +{ + X509_INFO *ret = NULL; + + ret = (X509_INFO *)OPENSSL_malloc(sizeof(X509_INFO)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (NULL); + } + + ret->enc_cipher.cipher = NULL; + ret->enc_len = 0; + ret->enc_data = NULL; + + ret->x509 = NULL; + ret->crl = NULL; + ret->x_pkey = NULL; + return (ret); +} + +void X509_INFO_free(X509_INFO *x) +{ + if (x == NULL) + return; + + if (x->x509 != NULL) + X509_free(x->x509); + if (x->crl != NULL) + X509_CRL_free(x->crl); + if (x->x_pkey != NULL) + X509_PKEY_free(x->x_pkey); + if (x->enc_data != NULL) + OPENSSL_free(x->enc_data); + OPENSSL_free(x); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c new file mode 100644 index 0000000..5775c56 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c @@ -0,0 +1,554 @@ +/* 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 "../asn1/asn1_locl.h" +#include "../internal.h" + + +typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; +DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) + +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + +static int x509_name_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); +static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it); +static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); + +static int x509_name_encode(X509_NAME *a); +static int x509_name_canon(X509_NAME *a); +static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in); +static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * intname, + unsigned char **in); + +ASN1_SEQUENCE(X509_NAME_ENTRY) = { + ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT), + ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE) +} ASN1_SEQUENCE_END(X509_NAME_ENTRY) + +IMPLEMENT_ASN1_FUNCTIONS(X509_NAME_ENTRY) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) + +/* + * For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } so + * declare two template wrappers for this + */ + +ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, RDNS, X509_NAME_ENTRY) +ASN1_ITEM_TEMPLATE_END(X509_NAME_ENTRIES) + +ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Name, X509_NAME_ENTRIES) +ASN1_ITEM_TEMPLATE_END(X509_NAME_INTERNAL) + +/* + * Normally that's where it would end: we'd have two nested STACK structures + * representing the ASN1. Unfortunately X509_NAME uses a completely different + * form and caches encodings so we have to process the internal form and + * convert to the external form. + */ + +static const ASN1_EXTERN_FUNCS x509_name_ff = { + NULL, + x509_name_ex_new, + x509_name_ex_free, + 0, /* Default clear behaviour is OK */ + x509_name_ex_d2i, + x509_name_ex_i2d, + NULL, +}; + +IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff) + +IMPLEMENT_ASN1_FUNCTIONS(X509_NAME) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME) + +static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) +{ + X509_NAME *ret = NULL; + ret = OPENSSL_malloc(sizeof(X509_NAME)); + if (!ret) + goto memerr; + if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) + goto memerr; + if ((ret->bytes = BUF_MEM_new()) == NULL) + goto memerr; + ret->canon_enc = NULL; + ret->canon_enclen = 0; + ret->modified = 1; + *val = (ASN1_VALUE *)ret; + return 1; + + memerr: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (ret) { + if (ret->entries) + sk_X509_NAME_ENTRY_free(ret->entries); + OPENSSL_free(ret); + } + return 0; +} + +static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + X509_NAME *a; + if (!pval || !*pval) + return; + a = (X509_NAME *)*pval; + + BUF_MEM_free(a->bytes); + sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free); + if (a->canon_enc) + OPENSSL_free(a->canon_enc); + OPENSSL_free(a); + *pval = NULL; +} + +static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne) +{ + sk_X509_NAME_ENTRY_free(ne); +} + +static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne) +{ + sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free); +} + +static int x509_name_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_ITEM *it, int tag, int aclass, + char opt, ASN1_TLC *ctx) +{ + const unsigned char *p = *in, *q; + union { + STACK_OF(STACK_OF_X509_NAME_ENTRY) *s; + ASN1_VALUE *a; + } intname = { + NULL + }; + union { + X509_NAME *x; + ASN1_VALUE *a; + } nm = { + NULL + }; + size_t i, j; + int ret; + STACK_OF(X509_NAME_ENTRY) *entries; + X509_NAME_ENTRY *entry; + /* Bound the size of an X509_NAME we are willing to parse. */ + if (len > X509_NAME_MAX) { + len = X509_NAME_MAX; + } + q = p; + + /* Get internal representation of Name */ + ret = ASN1_item_ex_d2i(&intname.a, + &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL), + tag, aclass, opt, ctx); + + if (ret <= 0) + return ret; + + if (*val) + x509_name_ex_free(val, NULL); + if (!x509_name_ex_new(&nm.a, NULL)) + goto err; + /* We've decoded it: now cache encoding */ + if (!BUF_MEM_grow(nm.x->bytes, p - q)) + goto err; + OPENSSL_memcpy(nm.x->bytes->data, q, p - q); + + /* Convert internal representation to X509_NAME structure */ + for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) { + entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i); + for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) { + entry = sk_X509_NAME_ENTRY_value(entries, j); + entry->set = i; + if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry)) + goto err; + (void)sk_X509_NAME_ENTRY_set(entries, j, NULL); + } + } + ret = x509_name_canon(nm.x); + if (!ret) + goto err; + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + nm.x->modified = 0; + *val = nm.a; + *in = p; + return ret; + err: + if (nm.x != NULL) + X509_NAME_free(nm.x); + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_pop_free); + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + return 0; +} + +static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + int ret; + X509_NAME *a = (X509_NAME *)*val; + if (a->modified) { + ret = x509_name_encode(a); + if (ret < 0) + return ret; + ret = x509_name_canon(a); + if (ret < 0) + return ret; + } + ret = a->bytes->length; + if (out != NULL) { + OPENSSL_memcpy(*out, a->bytes->data, ret); + *out += ret; + } + return ret; +} + +static int x509_name_encode(X509_NAME *a) +{ + union { + STACK_OF(STACK_OF_X509_NAME_ENTRY) *s; + ASN1_VALUE *a; + } intname = { + NULL + }; + int len; + unsigned char *p; + STACK_OF(X509_NAME_ENTRY) *entries = NULL; + X509_NAME_ENTRY *entry; + int set = -1; + size_t i; + intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null(); + if (!intname.s) + goto memerr; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + entry = sk_X509_NAME_ENTRY_value(a->entries, i); + if (entry->set != set) { + entries = sk_X509_NAME_ENTRY_new_null(); + if (!entries) + goto memerr; + if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) { + sk_X509_NAME_ENTRY_free(entries); + goto memerr; + } + set = entry->set; + } + if (!sk_X509_NAME_ENTRY_push(entries, entry)) + goto memerr; + } + len = ASN1_item_ex_i2d(&intname.a, NULL, + ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); + if (!BUF_MEM_grow(a->bytes, len)) + goto memerr; + p = (unsigned char *)a->bytes->data; + ASN1_item_ex_i2d(&intname.a, + &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + a->modified = 0; + return len; + memerr: + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return -1; +} + +/* + * This function generates the canonical encoding of the Name structure. In + * it all strings are converted to UTF8, leading, trailing and multiple + * spaces collapsed, converted to lower case and the leading SEQUENCE header + * removed. In future we could also normalize the UTF8 too. By doing this + * comparison of Name structures can be rapidly perfomed by just using + * OPENSSL_memcmp() of the canonical encoding. By omitting the leading SEQUENCE name + * constraints of type dirName can also be checked with a simple OPENSSL_memcmp(). + */ + +static int x509_name_canon(X509_NAME *a) +{ + unsigned char *p; + STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname = NULL; + STACK_OF(X509_NAME_ENTRY) *entries = NULL; + X509_NAME_ENTRY *entry, *tmpentry = NULL; + int set = -1, ret = 0, len; + size_t i; + + if (a->canon_enc) { + OPENSSL_free(a->canon_enc); + a->canon_enc = NULL; + } + /* Special case: empty X509_NAME => null encoding */ + if (sk_X509_NAME_ENTRY_num(a->entries) == 0) { + a->canon_enclen = 0; + return 1; + } + intname = sk_STACK_OF_X509_NAME_ENTRY_new_null(); + if (!intname) + goto err; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + entry = sk_X509_NAME_ENTRY_value(a->entries, i); + if (entry->set != set) { + entries = sk_X509_NAME_ENTRY_new_null(); + if (!entries) + goto err; + if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) { + sk_X509_NAME_ENTRY_free(entries); + goto err; + } + set = entry->set; + } + tmpentry = X509_NAME_ENTRY_new(); + if (tmpentry == NULL) + goto err; + tmpentry->object = OBJ_dup(entry->object); + if (!asn1_string_canon(tmpentry->value, entry->value)) + goto err; + if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) + goto err; + tmpentry = NULL; + } + + /* Finally generate encoding */ + + len = i2d_name_canon(intname, NULL); + if (len < 0) { + goto err; + } + a->canon_enclen = len; + + p = OPENSSL_malloc(a->canon_enclen); + + if (!p) + goto err; + + a->canon_enc = p; + + i2d_name_canon(intname, &p); + + ret = 1; + + err: + + if (tmpentry) + X509_NAME_ENTRY_free(tmpentry); + if (intname) + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname, + local_sk_X509_NAME_ENTRY_pop_free); + return ret; +} + +/* Bitmap of all the types of string that will be canonicalized. */ + +#define ASN1_MASK_CANON \ + (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \ + | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \ + | B_ASN1_VISIBLESTRING) + +static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) +{ + unsigned char *to, *from; + int len, i; + + /* If type not in bitmask just copy string across */ + if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) { + if (!ASN1_STRING_copy(out, in)) + return 0; + return 1; + } + + out->type = V_ASN1_UTF8STRING; + out->length = ASN1_STRING_to_UTF8(&out->data, in); + if (out->length == -1) + return 0; + + to = out->data; + from = to; + + len = out->length; + + /* + * Convert string in place to canonical form. Ultimately we may need to + * handle a wider range of characters but for now ignore anything with + * MSB set and rely on the isspace() and tolower() functions. + */ + + /* Ignore leading spaces */ + while ((len > 0) && !(*from & 0x80) && isspace(*from)) { + from++; + len--; + } + + to = from + len; + + /* Ignore trailing spaces */ + while ((len > 0) && !(to[-1] & 0x80) && isspace(to[-1])) { + to--; + len--; + } + + to = out->data; + + i = 0; + while (i < len) { + /* If MSB set just copy across */ + if (*from & 0x80) { + *to++ = *from++; + i++; + } + /* Collapse multiple spaces */ + else if (isspace(*from)) { + /* Copy one space across */ + *to++ = ' '; + /* + * Ignore subsequent spaces. Note: don't need to check len here + * because we know the last character is a non-space so we can't + * overflow. + */ + do { + from++; + i++; + } + while (!(*from & 0x80) && isspace(*from)); + } else { + *to++ = OPENSSL_tolower(*from); + from++; + i++; + } + } + + out->length = to - out->data; + + return 1; + +} + +static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname, + unsigned char **in) +{ + int len, ltmp; + size_t i; + ASN1_VALUE *v; + STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname; + + len = 0; + for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) { + v = sk_ASN1_VALUE_value(intname, i); + ltmp = ASN1_item_ex_i2d(&v, in, + ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1); + if (ltmp < 0) + return ltmp; + len += ltmp; + } + return len; +} + +int X509_NAME_set(X509_NAME **xn, X509_NAME *name) +{ + if ((name = X509_NAME_dup(name)) == NULL) + return 0; + X509_NAME_free(*xn); + *xn = name; + return 1; +} + +IMPLEMENT_ASN1_SET_OF(X509_NAME_ENTRY) + +int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne) +{ + return ne->set; +} + +int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, + size_t *pderlen) +{ + /* Make sure encoding is valid */ + if (i2d_X509_NAME(nm, NULL) <= 0) + return 0; + if (pder != NULL) + *pder = (unsigned char *)nm->bytes->data; + if (pderlen != NULL) + *pderlen = nm->bytes->length; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c.grpc_back new file mode 100644 index 0000000..7824100 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c.grpc_back @@ -0,0 +1,554 @@ +/* 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 "../asn1/asn1_locl.h" +#include "../internal.h" + + +typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; +DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) + +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + +static int x509_name_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); +static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it); +static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); + +static int x509_name_encode(X509_NAME *a); +static int x509_name_canon(X509_NAME *a); +static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in); +static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * intname, + unsigned char **in); + +ASN1_SEQUENCE(X509_NAME_ENTRY) = { + ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT), + ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE) +} ASN1_SEQUENCE_END(X509_NAME_ENTRY) + +IMPLEMENT_ASN1_FUNCTIONS(X509_NAME_ENTRY) +IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) + +/* + * For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } so + * declare two template wrappers for this + */ + +ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, RDNS, X509_NAME_ENTRY) +ASN1_ITEM_TEMPLATE_END(X509_NAME_ENTRIES) + +ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Name, X509_NAME_ENTRIES) +ASN1_ITEM_TEMPLATE_END(X509_NAME_INTERNAL) + +/* + * Normally that's where it would end: we'd have two nested STACK structures + * representing the ASN1. Unfortunately X509_NAME uses a completely different + * form and caches encodings so we have to process the internal form and + * convert to the external form. + */ + +static const ASN1_EXTERN_FUNCS x509_name_ff = { + NULL, + x509_name_ex_new, + x509_name_ex_free, + 0, /* Default clear behaviour is OK */ + x509_name_ex_d2i, + x509_name_ex_i2d, + NULL, +}; + +IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff) + +IMPLEMENT_ASN1_FUNCTIONS(X509_NAME) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME) + +static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) +{ + X509_NAME *ret = NULL; + ret = OPENSSL_malloc(sizeof(X509_NAME)); + if (!ret) + goto memerr; + if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) + goto memerr; + if ((ret->bytes = BUF_MEM_new()) == NULL) + goto memerr; + ret->canon_enc = NULL; + ret->canon_enclen = 0; + ret->modified = 1; + *val = (ASN1_VALUE *)ret; + return 1; + + memerr: + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + if (ret) { + if (ret->entries) + sk_X509_NAME_ENTRY_free(ret->entries); + OPENSSL_free(ret); + } + return 0; +} + +static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) +{ + X509_NAME *a; + if (!pval || !*pval) + return; + a = (X509_NAME *)*pval; + + BUF_MEM_free(a->bytes); + sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free); + if (a->canon_enc) + OPENSSL_free(a->canon_enc); + OPENSSL_free(a); + *pval = NULL; +} + +static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne) +{ + sk_X509_NAME_ENTRY_free(ne); +} + +static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne) +{ + sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free); +} + +static int x509_name_ex_d2i(ASN1_VALUE **val, + const unsigned char **in, long len, + const ASN1_ITEM *it, int tag, int aclass, + char opt, ASN1_TLC *ctx) +{ + const unsigned char *p = *in, *q; + union { + STACK_OF(STACK_OF_X509_NAME_ENTRY) *s; + ASN1_VALUE *a; + } intname = { + NULL + }; + union { + X509_NAME *x; + ASN1_VALUE *a; + } nm = { + NULL + }; + size_t i, j; + int ret; + STACK_OF(X509_NAME_ENTRY) *entries; + X509_NAME_ENTRY *entry; + /* Bound the size of an X509_NAME we are willing to parse. */ + if (len > X509_NAME_MAX) { + len = X509_NAME_MAX; + } + q = p; + + /* Get internal representation of Name */ + ret = ASN1_item_ex_d2i(&intname.a, + &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL), + tag, aclass, opt, ctx); + + if (ret <= 0) + return ret; + + if (*val) + x509_name_ex_free(val, NULL); + if (!x509_name_ex_new(&nm.a, NULL)) + goto err; + /* We've decoded it: now cache encoding */ + if (!BUF_MEM_grow(nm.x->bytes, p - q)) + goto err; + OPENSSL_memcpy(nm.x->bytes->data, q, p - q); + + /* Convert internal representation to X509_NAME structure */ + for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) { + entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i); + for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) { + entry = sk_X509_NAME_ENTRY_value(entries, j); + entry->set = i; + if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry)) + goto err; + (void)sk_X509_NAME_ENTRY_set(entries, j, NULL); + } + } + ret = x509_name_canon(nm.x); + if (!ret) + goto err; + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + nm.x->modified = 0; + *val = nm.a; + *in = p; + return ret; + err: + if (nm.x != NULL) + X509_NAME_free(nm.x); + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_pop_free); + OPENSSL_PUT_ERROR(X509, ERR_R_ASN1_LIB); + return 0; +} + +static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass) +{ + int ret; + X509_NAME *a = (X509_NAME *)*val; + if (a->modified) { + ret = x509_name_encode(a); + if (ret < 0) + return ret; + ret = x509_name_canon(a); + if (ret < 0) + return ret; + } + ret = a->bytes->length; + if (out != NULL) { + OPENSSL_memcpy(*out, a->bytes->data, ret); + *out += ret; + } + return ret; +} + +static int x509_name_encode(X509_NAME *a) +{ + union { + STACK_OF(STACK_OF_X509_NAME_ENTRY) *s; + ASN1_VALUE *a; + } intname = { + NULL + }; + int len; + unsigned char *p; + STACK_OF(X509_NAME_ENTRY) *entries = NULL; + X509_NAME_ENTRY *entry; + int set = -1; + size_t i; + intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null(); + if (!intname.s) + goto memerr; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + entry = sk_X509_NAME_ENTRY_value(a->entries, i); + if (entry->set != set) { + entries = sk_X509_NAME_ENTRY_new_null(); + if (!entries) + goto memerr; + if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) { + sk_X509_NAME_ENTRY_free(entries); + goto memerr; + } + set = entry->set; + } + if (!sk_X509_NAME_ENTRY_push(entries, entry)) + goto memerr; + } + len = ASN1_item_ex_i2d(&intname.a, NULL, + ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); + if (!BUF_MEM_grow(a->bytes, len)) + goto memerr; + p = (unsigned char *)a->bytes->data; + ASN1_item_ex_i2d(&intname.a, + &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + a->modified = 0; + return len; + memerr: + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, + local_sk_X509_NAME_ENTRY_free); + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return -1; +} + +/* + * This function generates the canonical encoding of the Name structure. In + * it all strings are converted to UTF8, leading, trailing and multiple + * spaces collapsed, converted to lower case and the leading SEQUENCE header + * removed. In future we could also normalize the UTF8 too. By doing this + * comparison of Name structures can be rapidly perfomed by just using + * OPENSSL_memcmp() of the canonical encoding. By omitting the leading SEQUENCE name + * constraints of type dirName can also be checked with a simple OPENSSL_memcmp(). + */ + +static int x509_name_canon(X509_NAME *a) +{ + unsigned char *p; + STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname = NULL; + STACK_OF(X509_NAME_ENTRY) *entries = NULL; + X509_NAME_ENTRY *entry, *tmpentry = NULL; + int set = -1, ret = 0, len; + size_t i; + + if (a->canon_enc) { + OPENSSL_free(a->canon_enc); + a->canon_enc = NULL; + } + /* Special case: empty X509_NAME => null encoding */ + if (sk_X509_NAME_ENTRY_num(a->entries) == 0) { + a->canon_enclen = 0; + return 1; + } + intname = sk_STACK_OF_X509_NAME_ENTRY_new_null(); + if (!intname) + goto err; + for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { + entry = sk_X509_NAME_ENTRY_value(a->entries, i); + if (entry->set != set) { + entries = sk_X509_NAME_ENTRY_new_null(); + if (!entries) + goto err; + if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) { + sk_X509_NAME_ENTRY_free(entries); + goto err; + } + set = entry->set; + } + tmpentry = X509_NAME_ENTRY_new(); + if (tmpentry == NULL) + goto err; + tmpentry->object = OBJ_dup(entry->object); + if (!asn1_string_canon(tmpentry->value, entry->value)) + goto err; + if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) + goto err; + tmpentry = NULL; + } + + /* Finally generate encoding */ + + len = i2d_name_canon(intname, NULL); + if (len < 0) { + goto err; + } + a->canon_enclen = len; + + p = OPENSSL_malloc(a->canon_enclen); + + if (!p) + goto err; + + a->canon_enc = p; + + i2d_name_canon(intname, &p); + + ret = 1; + + err: + + if (tmpentry) + X509_NAME_ENTRY_free(tmpentry); + if (intname) + sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname, + local_sk_X509_NAME_ENTRY_pop_free); + return ret; +} + +/* Bitmap of all the types of string that will be canonicalized. */ + +#define ASN1_MASK_CANON \ + (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \ + | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \ + | B_ASN1_VISIBLESTRING) + +static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) +{ + unsigned char *to, *from; + int len, i; + + /* If type not in bitmask just copy string across */ + if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) { + if (!ASN1_STRING_copy(out, in)) + return 0; + return 1; + } + + out->type = V_ASN1_UTF8STRING; + out->length = ASN1_STRING_to_UTF8(&out->data, in); + if (out->length == -1) + return 0; + + to = out->data; + from = to; + + len = out->length; + + /* + * Convert string in place to canonical form. Ultimately we may need to + * handle a wider range of characters but for now ignore anything with + * MSB set and rely on the isspace() and tolower() functions. + */ + + /* Ignore leading spaces */ + while ((len > 0) && !(*from & 0x80) && isspace(*from)) { + from++; + len--; + } + + to = from + len; + + /* Ignore trailing spaces */ + while ((len > 0) && !(to[-1] & 0x80) && isspace(to[-1])) { + to--; + len--; + } + + to = out->data; + + i = 0; + while (i < len) { + /* If MSB set just copy across */ + if (*from & 0x80) { + *to++ = *from++; + i++; + } + /* Collapse multiple spaces */ + else if (isspace(*from)) { + /* Copy one space across */ + *to++ = ' '; + /* + * Ignore subsequent spaces. Note: don't need to check len here + * because we know the last character is a non-space so we can't + * overflow. + */ + do { + from++; + i++; + } + while (!(*from & 0x80) && isspace(*from)); + } else { + *to++ = OPENSSL_tolower(*from); + from++; + i++; + } + } + + out->length = to - out->data; + + return 1; + +} + +static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname, + unsigned char **in) +{ + int len, ltmp; + size_t i; + ASN1_VALUE *v; + STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname; + + len = 0; + for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) { + v = sk_ASN1_VALUE_value(intname, i); + ltmp = ASN1_item_ex_i2d(&v, in, + ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1); + if (ltmp < 0) + return ltmp; + len += ltmp; + } + return len; +} + +int X509_NAME_set(X509_NAME **xn, X509_NAME *name) +{ + if ((name = X509_NAME_dup(name)) == NULL) + return 0; + X509_NAME_free(*xn); + *xn = name; + return 1; +} + +IMPLEMENT_ASN1_SET_OF(X509_NAME_ENTRY) + +int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne) +{ + return ne->set; +} + +int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, + size_t *pderlen) +{ + /* Make sure encoding is valid */ + if (i2d_X509_NAME(nm, NULL) <= 0) + return 0; + if (pder != NULL) + *pder = (unsigned char *)nm->bytes->data; + if (pderlen != NULL) + *pderlen = nm->bytes->length; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c new file mode 100644 index 0000000..126560d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c @@ -0,0 +1,106 @@ +/* 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 "../internal.h" + + +X509_PKEY *X509_PKEY_new(void) +{ + X509_PKEY *ret = OPENSSL_malloc(sizeof(X509_PKEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memset(ret, 0, sizeof(X509_PKEY)); + + ret->enc_algor = X509_ALGOR_new(); + if (ret->enc_algor == NULL) + goto err; + ret->enc_pkey = M_ASN1_OCTET_STRING_new(); + if (ret->enc_pkey == NULL) + goto err; + return ret; + + err: + if (ret != NULL) + X509_PKEY_free(ret); + return NULL; +} + +void X509_PKEY_free(X509_PKEY *x) +{ + if (x == NULL) + return; + + if (x->enc_algor != NULL) + X509_ALGOR_free(x->enc_algor); + if (x->enc_pkey != NULL) + M_ASN1_OCTET_STRING_free(x->enc_pkey); + if (x->dec_pkey != NULL) + EVP_PKEY_free(x->dec_pkey); + if ((x->key_data != NULL) && (x->key_free)) + OPENSSL_free(x->key_data); + OPENSSL_free(x); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c.grpc_back new file mode 100644 index 0000000..8231a24 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c.grpc_back @@ -0,0 +1,106 @@ +/* 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 "../internal.h" + + +X509_PKEY *X509_PKEY_new(void) +{ + X509_PKEY *ret = OPENSSL_malloc(sizeof(X509_PKEY)); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_memset(ret, 0, sizeof(X509_PKEY)); + + ret->enc_algor = X509_ALGOR_new(); + if (ret->enc_algor == NULL) + goto err; + ret->enc_pkey = M_ASN1_OCTET_STRING_new(); + if (ret->enc_pkey == NULL) + goto err; + return ret; + + err: + if (ret != NULL) + X509_PKEY_free(ret); + return NULL; +} + +void X509_PKEY_free(X509_PKEY *x) +{ + if (x == NULL) + return; + + if (x->enc_algor != NULL) + X509_ALGOR_free(x->enc_algor); + if (x->enc_pkey != NULL) + M_ASN1_OCTET_STRING_free(x->enc_pkey); + if (x->dec_pkey != NULL) + EVP_PKEY_free(x->dec_pkey); + if ((x->key_data != NULL) && (x->key_free)) + OPENSSL_free(x->key_data); + OPENSSL_free(x); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c new file mode 100644 index 0000000..a948854 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c @@ -0,0 +1,368 @@ +/* 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 "../internal.h" + +/* Minor tweak to operation: free up EVP_PKEY */ +static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + if (operation == ASN1_OP_FREE_POST) { + X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval; + EVP_PKEY_free(pubkey->pkey); + } + return 1; +} + +ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = { + ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), + ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) + +IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) + +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) +{ + X509_PUBKEY *pk = NULL; + uint8_t *spki = NULL; + size_t spki_len; + + if (x == NULL) + return (0); + + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EVP_marshal_public_key(&cbb, pkey) || + !CBB_finish(&cbb, &spki, &spki_len) || + spki_len > LONG_MAX) { + CBB_cleanup(&cbb); + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_ENCODE_ERROR); + goto error; + } + + const uint8_t *p = spki; + pk = d2i_X509_PUBKEY(NULL, &p, (long)spki_len); + if (pk == NULL || p != spki + spki_len) { + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_DECODE_ERROR); + goto error; + } + + OPENSSL_free(spki); + X509_PUBKEY_free(*x); + *x = pk; + + return 1; + error: + X509_PUBKEY_free(pk); + OPENSSL_free(spki); + return 0; +} + +/* g_pubkey_lock is used to protect the initialisation of the |pkey| member of + * |X509_PUBKEY| objects. Really |X509_PUBKEY| should have a |CRYPTO_once_t| + * inside it for this, but |CRYPTO_once_t| is private and |X509_PUBKEY| is + * not. */ +static struct CRYPTO_STATIC_MUTEX g_pubkey_lock = CRYPTO_STATIC_MUTEX_INIT; + +EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) +{ + EVP_PKEY *ret = NULL; + uint8_t *spki = NULL; + + if (key == NULL) + goto error; + + CRYPTO_STATIC_MUTEX_lock_read(&g_pubkey_lock); + if (key->pkey != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); + EVP_PKEY_up_ref(key->pkey); + return key->pkey; + } + CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); + + /* Re-encode the |X509_PUBKEY| to DER and parse it. */ + int spki_len = i2d_X509_PUBKEY(key, &spki); + if (spki_len < 0) { + goto error; + } + CBS cbs; + CBS_init(&cbs, spki, (size_t)spki_len); + ret = EVP_parse_public_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_DECODE_ERROR); + goto error; + } + + /* Check to see if another thread set key->pkey first */ + CRYPTO_STATIC_MUTEX_lock_write(&g_pubkey_lock); + if (key->pkey) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_pubkey_lock); + EVP_PKEY_free(ret); + ret = key->pkey; + } else { + key->pkey = ret; + CRYPTO_STATIC_MUTEX_unlock_write(&g_pubkey_lock); + } + + OPENSSL_free(spki); + EVP_PKEY_up_ref(ret); + return ret; + + error: + OPENSSL_free(spki); + EVP_PKEY_free(ret); + return NULL; +} + +/* + * Now two pseudo ASN1 routines that take an EVP_PKEY structure and encode or + * decode as X509_PUBKEY + */ + +EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) +{ + X509_PUBKEY *xpk; + EVP_PKEY *pktmp; + xpk = d2i_X509_PUBKEY(NULL, pp, length); + if (!xpk) + return NULL; + pktmp = X509_PUBKEY_get(xpk); + X509_PUBKEY_free(xpk); + if (!pktmp) + return NULL; + if (a) { + EVP_PKEY_free(*a); + *a = pktmp; + } + return pktmp; +} + +int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp) +{ + X509_PUBKEY *xpk = NULL; + int ret; + if (!a) + return 0; + if (!X509_PUBKEY_set(&xpk, (EVP_PKEY *)a)) + return 0; + ret = i2d_X509_PUBKEY(xpk, pp); + X509_PUBKEY_free(xpk); + return ret; +} + +/* + * The following are equivalents but which return RSA and DSA keys + */ +RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + RSA *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return NULL; + key = EVP_PKEY_get1_RSA(pkey); + EVP_PKEY_free(pkey); + if (!key) + return NULL; + *pp = q; + if (a) { + RSA_free(*a); + *a = key; + } + return key; +} + +int i2d_RSA_PUBKEY(const RSA *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return 0; + pktmp = EVP_PKEY_new(); + if (!pktmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + EVP_PKEY_set1_RSA(pktmp, (RSA *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return ret; +} + +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + DSA *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return NULL; + key = EVP_PKEY_get1_DSA(pkey); + EVP_PKEY_free(pkey); + if (!key) + return NULL; + *pp = q; + if (a) { + DSA_free(*a); + *a = key; + } + return key; +} + +int i2d_DSA_PUBKEY(const DSA *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return 0; + pktmp = EVP_PKEY_new(); + if (!pktmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + EVP_PKEY_set1_DSA(pktmp, (DSA *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return ret; +} +#endif + +EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + EC_KEY *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return (NULL); + key = EVP_PKEY_get1_EC_KEY(pkey); + EVP_PKEY_free(pkey); + if (!key) + return (NULL); + *pp = q; + if (a) { + EC_KEY_free(*a); + *a = key; + } + return (key); +} + +int i2d_EC_PUBKEY(const EC_KEY *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return (0); + if ((pktmp = EVP_PKEY_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (0); + } + EVP_PKEY_set1_EC_KEY(pktmp, (EC_KEY *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return (ret); +} + +int X509_PUBKEY_set0_param(X509_PUBKEY *pub, const ASN1_OBJECT *aobj, + int ptype, void *pval, + unsigned char *penc, int penclen) +{ + if (!X509_ALGOR_set0(pub->algor, aobj, ptype, pval)) + return 0; + if (penc) { + if (pub->public_key->data) + OPENSSL_free(pub->public_key->data); + pub->public_key->data = penc; + pub->public_key->length = penclen; + /* Set number of unused bits to zero */ + pub->public_key->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + pub->public_key->flags |= ASN1_STRING_FLAG_BITS_LEFT; + } + return 1; +} + +int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, X509_PUBKEY *pub) +{ + if (ppkalg) + *ppkalg = pub->algor->algorithm; + if (pk) { + *pk = pub->public_key->data; + *ppklen = pub->public_key->length; + } + if (pa) + *pa = pub->algor; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c.grpc_back new file mode 100644 index 0000000..3d07d66 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c.grpc_back @@ -0,0 +1,368 @@ +/* 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 "../internal.h" + +/* Minor tweak to operation: free up EVP_PKEY */ +static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + if (operation == ASN1_OP_FREE_POST) { + X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval; + EVP_PKEY_free(pubkey->pkey); + } + return 1; +} + +ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = { + ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), + ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) + +IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) + +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) +{ + X509_PUBKEY *pk = NULL; + uint8_t *spki = NULL; + size_t spki_len; + + if (x == NULL) + return (0); + + CBB cbb; + if (!CBB_init(&cbb, 0) || + !EVP_marshal_public_key(&cbb, pkey) || + !CBB_finish(&cbb, &spki, &spki_len) || + spki_len > LONG_MAX) { + CBB_cleanup(&cbb); + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_ENCODE_ERROR); + goto error; + } + + const uint8_t *p = spki; + pk = d2i_X509_PUBKEY(NULL, &p, (long)spki_len); + if (pk == NULL || p != spki + spki_len) { + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_DECODE_ERROR); + goto error; + } + + OPENSSL_free(spki); + X509_PUBKEY_free(*x); + *x = pk; + + return 1; + error: + X509_PUBKEY_free(pk); + OPENSSL_free(spki); + return 0; +} + +/* g_pubkey_lock is used to protect the initialisation of the |pkey| member of + * |X509_PUBKEY| objects. Really |X509_PUBKEY| should have a |CRYPTO_once_t| + * inside it for this, but |CRYPTO_once_t| is private and |X509_PUBKEY| is + * not. */ +static struct CRYPTO_STATIC_MUTEX g_pubkey_lock = CRYPTO_STATIC_MUTEX_INIT; + +EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) +{ + EVP_PKEY *ret = NULL; + uint8_t *spki = NULL; + + if (key == NULL) + goto error; + + CRYPTO_STATIC_MUTEX_lock_read(&g_pubkey_lock); + if (key->pkey != NULL) { + CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); + EVP_PKEY_up_ref(key->pkey); + return key->pkey; + } + CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); + + /* Re-encode the |X509_PUBKEY| to DER and parse it. */ + int spki_len = i2d_X509_PUBKEY(key, &spki); + if (spki_len < 0) { + goto error; + } + CBS cbs; + CBS_init(&cbs, spki, (size_t)spki_len); + ret = EVP_parse_public_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(X509, X509_R_PUBLIC_KEY_DECODE_ERROR); + goto error; + } + + /* Check to see if another thread set key->pkey first */ + CRYPTO_STATIC_MUTEX_lock_write(&g_pubkey_lock); + if (key->pkey) { + CRYPTO_STATIC_MUTEX_unlock_write(&g_pubkey_lock); + EVP_PKEY_free(ret); + ret = key->pkey; + } else { + key->pkey = ret; + CRYPTO_STATIC_MUTEX_unlock_write(&g_pubkey_lock); + } + + OPENSSL_free(spki); + EVP_PKEY_up_ref(ret); + return ret; + + error: + OPENSSL_free(spki); + EVP_PKEY_free(ret); + return NULL; +} + +/* + * Now two pseudo ASN1 routines that take an EVP_PKEY structure and encode or + * decode as X509_PUBKEY + */ + +EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) +{ + X509_PUBKEY *xpk; + EVP_PKEY *pktmp; + xpk = d2i_X509_PUBKEY(NULL, pp, length); + if (!xpk) + return NULL; + pktmp = X509_PUBKEY_get(xpk); + X509_PUBKEY_free(xpk); + if (!pktmp) + return NULL; + if (a) { + EVP_PKEY_free(*a); + *a = pktmp; + } + return pktmp; +} + +int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp) +{ + X509_PUBKEY *xpk = NULL; + int ret; + if (!a) + return 0; + if (!X509_PUBKEY_set(&xpk, (EVP_PKEY *)a)) + return 0; + ret = i2d_X509_PUBKEY(xpk, pp); + X509_PUBKEY_free(xpk); + return ret; +} + +/* + * The following are equivalents but which return RSA and DSA keys + */ +RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + RSA *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return NULL; + key = EVP_PKEY_get1_RSA(pkey); + EVP_PKEY_free(pkey); + if (!key) + return NULL; + *pp = q; + if (a) { + RSA_free(*a); + *a = key; + } + return key; +} + +int i2d_RSA_PUBKEY(const RSA *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return 0; + pktmp = EVP_PKEY_new(); + if (!pktmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + EVP_PKEY_set1_RSA(pktmp, (RSA *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return ret; +} + +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + DSA *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return NULL; + key = EVP_PKEY_get1_DSA(pkey); + EVP_PKEY_free(pkey); + if (!key) + return NULL; + *pp = q; + if (a) { + DSA_free(*a); + *a = key; + } + return key; +} + +int i2d_DSA_PUBKEY(const DSA *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return 0; + pktmp = EVP_PKEY_new(); + if (!pktmp) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return 0; + } + EVP_PKEY_set1_DSA(pktmp, (DSA *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return ret; +} +#endif + +EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length) +{ + EVP_PKEY *pkey; + EC_KEY *key; + const unsigned char *q; + q = *pp; + pkey = d2i_PUBKEY(NULL, &q, length); + if (!pkey) + return (NULL); + key = EVP_PKEY_get1_EC_KEY(pkey); + EVP_PKEY_free(pkey); + if (!key) + return (NULL); + *pp = q; + if (a) { + EC_KEY_free(*a); + *a = key; + } + return (key); +} + +int i2d_EC_PUBKEY(const EC_KEY *a, unsigned char **pp) +{ + EVP_PKEY *pktmp; + int ret; + if (!a) + return (0); + if ((pktmp = EVP_PKEY_new()) == NULL) { + OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); + return (0); + } + EVP_PKEY_set1_EC_KEY(pktmp, (EC_KEY *)a); + ret = i2d_PUBKEY(pktmp, pp); + EVP_PKEY_free(pktmp); + return (ret); +} + +int X509_PUBKEY_set0_param(X509_PUBKEY *pub, const ASN1_OBJECT *aobj, + int ptype, void *pval, + unsigned char *penc, int penclen) +{ + if (!X509_ALGOR_set0(pub->algor, aobj, ptype, pval)) + return 0; + if (penc) { + if (pub->public_key->data) + OPENSSL_free(pub->public_key->data); + pub->public_key->data = penc; + pub->public_key->length = penclen; + /* Set number of unused bits to zero */ + pub->public_key->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); + pub->public_key->flags |= ASN1_STRING_FLAG_BITS_LEFT; + } + return 1; +} + +int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, X509_PUBKEY *pub) +{ + if (ppkalg) + *ppkalg = pub->algor->algorithm; + if (pk) { + *pk = pub->public_key->data; + *ppklen = pub->public_key->length; + } + if (pa) + *pa = pub->algor; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c new file mode 100644 index 0000000..a19775a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c @@ -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.] */ + +#include + +#include +#include +#include + +/* + * X509_REQ_INFO is handled in an unusual way to get round invalid encodings. + * Some broken certificate requests don't encode the attributes field if it + * is empty. This is in violation of PKCS#10 but we need to tolerate it. We + * do this by making the attributes field OPTIONAL then using the callback to + * initialise it to an empty STACK. This means that the field will be + * correctly encoded unless we NULL out the field. As a result we no longer + * need the req_kludge field because the information is now contained in the + * attributes field: 1. If it is NULL then it's the invalid omission. 2. If + * it is empty it is the correct encoding. 3. If it is not empty then some + * attributes are present. + */ + +static int rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval; + + if (operation == ASN1_OP_NEW_POST) { + rinf->attributes = sk_X509_ATTRIBUTE_new_null(); + if (!rinf->attributes) + return 0; + } + return 1; +} + +ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = { + ASN1_SIMPLE(X509_REQ_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(X509_REQ_INFO, subject, X509_NAME), + ASN1_SIMPLE(X509_REQ_INFO, pubkey, X509_PUBKEY), + /* This isn't really OPTIONAL but it gets round invalid + * encodings + */ + ASN1_IMP_SET_OF_OPT(X509_REQ_INFO, attributes, X509_ATTRIBUTE, 0) +} ASN1_SEQUENCE_END_enc(X509_REQ_INFO, X509_REQ_INFO) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REQ_INFO) + +ASN1_SEQUENCE_ref(X509_REQ, 0) = { + ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO), + ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_REQ, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509_REQ, X509_REQ) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REQ) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c.grpc_back new file mode 100644 index 0000000..5dfe19e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c.grpc_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.] */ + +#include + +#include +#include +#include + +/* + * X509_REQ_INFO is handled in an unusual way to get round invalid encodings. + * Some broken certificate requests don't encode the attributes field if it + * is empty. This is in violation of PKCS#10 but we need to tolerate it. We + * do this by making the attributes field OPTIONAL then using the callback to + * initialise it to an empty STACK. This means that the field will be + * correctly encoded unless we NULL out the field. As a result we no longer + * need the req_kludge field because the information is now contained in the + * attributes field: 1. If it is NULL then it's the invalid omission. 2. If + * it is empty it is the correct encoding. 3. If it is not empty then some + * attributes are present. + */ + +static int rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval; + + if (operation == ASN1_OP_NEW_POST) { + rinf->attributes = sk_X509_ATTRIBUTE_new_null(); + if (!rinf->attributes) + return 0; + } + return 1; +} + +ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = { + ASN1_SIMPLE(X509_REQ_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(X509_REQ_INFO, subject, X509_NAME), + ASN1_SIMPLE(X509_REQ_INFO, pubkey, X509_PUBKEY), + /* This isn't really OPTIONAL but it gets round invalid + * encodings + */ + ASN1_IMP_SET_OF_OPT(X509_REQ_INFO, attributes, X509_ATTRIBUTE, 0) +} ASN1_SEQUENCE_END_enc(X509_REQ_INFO, X509_REQ_INFO) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REQ_INFO) + +ASN1_SEQUENCE_ref(X509_REQ, 0) = { + ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO), + ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509_REQ, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509_REQ, X509_REQ) + +IMPLEMENT_ASN1_FUNCTIONS(X509_REQ) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c new file mode 100644 index 0000000..b3c5ea5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c @@ -0,0 +1,69 @@ +/* crypto/asn1/x_sig.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 + + +ASN1_SEQUENCE(X509_SIG) = { + ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR), + ASN1_SIMPLE(X509_SIG, digest, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(X509_SIG) + +IMPLEMENT_ASN1_FUNCTIONS(X509_SIG) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c.grpc_back new file mode 100644 index 0000000..e18024a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c.grpc_back @@ -0,0 +1,69 @@ +/* crypto/asn1/x_sig.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 + + +ASN1_SEQUENCE(X509_SIG) = { + ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR), + ASN1_SIMPLE(X509_SIG, digest, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(X509_SIG) + +IMPLEMENT_ASN1_FUNCTIONS(X509_SIG) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c new file mode 100644 index 0000000..2b05a41 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c @@ -0,0 +1,80 @@ +/* crypto/asn1/x_spki.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.] */ + + /* + * This module was send to me my Pat Richards who wrote it. + * It is under my Copyright with his permission. + */ + +#include +#include + + +ASN1_SEQUENCE(NETSCAPE_SPKAC) = { + ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY), + ASN1_SIMPLE(NETSCAPE_SPKAC, challenge, ASN1_IA5STRING) +} ASN1_SEQUENCE_END(NETSCAPE_SPKAC) + +IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + +ASN1_SEQUENCE(NETSCAPE_SPKI) = { + ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC), + ASN1_SIMPLE(NETSCAPE_SPKI, sig_algor, X509_ALGOR), + ASN1_SIMPLE(NETSCAPE_SPKI, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END(NETSCAPE_SPKI) + +IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKI) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c.grpc_back new file mode 100644 index 0000000..86da6dd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c.grpc_back @@ -0,0 +1,80 @@ +/* crypto/asn1/x_spki.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.] */ + + /* + * This module was send to me my Pat Richards who wrote it. + * It is under my Copyright with his permission. + */ + +#include +#include + + +ASN1_SEQUENCE(NETSCAPE_SPKAC) = { + ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY), + ASN1_SIMPLE(NETSCAPE_SPKAC, challenge, ASN1_IA5STRING) +} ASN1_SEQUENCE_END(NETSCAPE_SPKAC) + +IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + +ASN1_SEQUENCE(NETSCAPE_SPKI) = { + ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC), + ASN1_SIMPLE(NETSCAPE_SPKI, sig_algor, X509_ALGOR), + ASN1_SIMPLE(NETSCAPE_SPKI, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END(NETSCAPE_SPKI) + +IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKI) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c new file mode 100644 index 0000000..797f71d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c @@ -0,0 +1,69 @@ +/* crypto/asn1/x_val.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 + + +ASN1_SEQUENCE(X509_VAL) = { + ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME), + ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME) +} ASN1_SEQUENCE_END(X509_VAL) + +IMPLEMENT_ASN1_FUNCTIONS(X509_VAL) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c.grpc_back new file mode 100644 index 0000000..ad4f7e1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c.grpc_back @@ -0,0 +1,69 @@ +/* crypto/asn1/x_val.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 + + +ASN1_SEQUENCE(X509_VAL) = { + ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME), + ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME) +} ASN1_SEQUENCE_END(X509_VAL) + +IMPLEMENT_ASN1_FUNCTIONS(X509_VAL) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c new file mode 100644 index 0000000..7b42b94 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c @@ -0,0 +1,334 @@ +/* crypto/asn1/x_x509.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 "../internal.h" + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = { + ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), + ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER), + ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR), + ASN1_SIMPLE(X509_CINF, issuer, X509_NAME), + ASN1_SIMPLE(X509_CINF, validity, X509_VAL), + ASN1_SIMPLE(X509_CINF, subject, X509_NAME), + ASN1_SIMPLE(X509_CINF, key, X509_PUBKEY), + ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1), + ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2), + ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3) +} ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CINF) +/* X509 top level structure needs a bit of customisation */ + +extern void policy_cache_free(X509_POLICY_CACHE *cache); + +static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509 *ret = (X509 *)*pval; + + switch (operation) { + + case ASN1_OP_NEW_POST: + ret->name = NULL; + ret->ex_flags = 0; + ret->ex_pathlen = -1; + ret->skid = NULL; + ret->akid = NULL; + ret->aux = NULL; + ret->crldp = NULL; + ret->buf = NULL; + CRYPTO_new_ex_data(&ret->ex_data); + CRYPTO_MUTEX_init(&ret->lock); + break; + + case ASN1_OP_D2I_PRE: + CRYPTO_BUFFER_free(ret->buf); + ret->buf = NULL; + break; + + case ASN1_OP_D2I_POST: + if (ret->name != NULL) + OPENSSL_free(ret->name); + ret->name = X509_NAME_oneline(ret->cert_info->subject, NULL, 0); + break; + + case ASN1_OP_FREE_POST: + CRYPTO_MUTEX_cleanup(&ret->lock); + CRYPTO_free_ex_data(&g_ex_data_class, ret, &ret->ex_data); + X509_CERT_AUX_free(ret->aux); + ASN1_OCTET_STRING_free(ret->skid); + AUTHORITY_KEYID_free(ret->akid); + CRL_DIST_POINTS_free(ret->crldp); + policy_cache_free(ret->policy_cache); + GENERAL_NAMES_free(ret->altname); + NAME_CONSTRAINTS_free(ret->nc); + CRYPTO_BUFFER_free(ret->buf); + OPENSSL_free(ret->name); + break; + + } + + return 1; + +} + +ASN1_SEQUENCE_ref(X509, x509_cb) = { + ASN1_SIMPLE(X509, cert_info, X509_CINF), + ASN1_SIMPLE(X509, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509, X509) + +IMPLEMENT_ASN1_FUNCTIONS(X509) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509) + +X509 *X509_parse_from_buffer(CRYPTO_BUFFER *buf) { + if (CRYPTO_BUFFER_len(buf) > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + X509 *x509 = X509_new(); + if (x509 == NULL) { + return NULL; + } + + x509->cert_info->enc.alias_only_on_next_parse = 1; + + const uint8_t *inp = CRYPTO_BUFFER_data(buf); + X509 *x509p = x509; + X509 *ret = d2i_X509(&x509p, &inp, CRYPTO_BUFFER_len(buf)); + if (ret == NULL || + inp - CRYPTO_BUFFER_data(buf) != (ptrdiff_t)CRYPTO_BUFFER_len(buf)) { + X509_free(x509p); + return NULL; + } + assert(x509p == x509); + assert(ret == x509); + + CRYPTO_BUFFER_up_ref(buf); + ret->buf = buf; + + return ret; +} + +int X509_up_ref(X509 *x) +{ + CRYPTO_refcount_inc(&x->references); + return 1; +} + +int X509_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int X509_set_ex_data(X509 *r, int idx, void *arg) +{ + return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); +} + +void *X509_get_ex_data(X509 *r, int idx) +{ + return (CRYPTO_get_ex_data(&r->ex_data, idx)); +} + +/* + * X509_AUX ASN1 routines. X509_AUX is the name given to a certificate with + * extra info tagged on the end. Since these functions set how a certificate + * is trusted they should only be used when the certificate comes from a + * reliable source such as local storage. + */ + +X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) +{ + const unsigned char *q = *pp; + X509 *ret; + int freeret = 0; + + if (!a || *a == NULL) + freeret = 1; + ret = d2i_X509(a, &q, length); + /* If certificate unreadable then forget it */ + if (!ret) + return NULL; + /* update length */ + length -= q - *pp; + /* Parse auxiliary information if there is any. */ + if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length)) + goto err; + *pp = q; + return ret; + err: + if (freeret) { + X509_free(ret); + if (a) + *a = NULL; + } + return NULL; +} + +/* + * Serialize trusted certificate to *pp or just return the required buffer + * length if pp == NULL. We ultimately want to avoid modifying *pp in the + * error path, but that depends on similar hygiene in lower-level functions. + * Here we avoid compounding the problem. + */ +static int i2d_x509_aux_internal(X509 *a, unsigned char **pp) +{ + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; + + assert(pp == NULL || *pp != NULL); + + /* + * This might perturb *pp on error, but fixing that belongs in i2d_X509() + * not here. It should be that if a == NULL length is zero, but we check + * both just in case. + */ + length = i2d_X509(a, pp); + if (length <= 0 || a == NULL) { + return length; + } + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + + return length; +} + +/* + * Serialize trusted certificate to *pp, or just return the required buffer + * length if pp == NULL. + * + * When pp is not NULL, but *pp == NULL, we allocate the buffer, but since + * we're writing two ASN.1 objects back to back, we can't have i2d_X509() do + * the allocation, nor can we allow i2d_X509_CERT_AUX() to increment the + * allocated buffer. + */ +int i2d_X509_AUX(X509 *a, unsigned char **pp) +{ + int length; + unsigned char *tmp; + + /* Buffer provided by caller */ + if (pp == NULL || *pp != NULL) + return i2d_x509_aux_internal(a, pp); + + /* Obtain the combined length */ + if ((length = i2d_x509_aux_internal(a, NULL)) <= 0) + return length; + + /* Allocate requisite combined storage */ + *pp = tmp = OPENSSL_malloc(length); + if (tmp == NULL) + return -1; /* Push error onto error stack? */ + + /* Encode, but keep *pp at the originally malloced pointer */ + length = i2d_x509_aux_internal(a, &tmp); + if (length <= 0) { + OPENSSL_free(*pp); + *pp = NULL; + } + 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) +{ + if (psig) + *psig = x->signature; + if (palg) + *palg = x->sig_alg; +} + +int X509_get_signature_nid(const X509 *x) +{ + return OBJ_obj2nid(x->sig_alg->algorithm); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back new file mode 100644 index 0000000..9ece062 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back @@ -0,0 +1,334 @@ +/* crypto/asn1/x_x509.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 "../internal.h" + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT; + +ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = { + ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), + ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER), + ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR), + ASN1_SIMPLE(X509_CINF, issuer, X509_NAME), + ASN1_SIMPLE(X509_CINF, validity, X509_VAL), + ASN1_SIMPLE(X509_CINF, subject, X509_NAME), + ASN1_SIMPLE(X509_CINF, key, X509_PUBKEY), + ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1), + ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2), + ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3) +} ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CINF) +/* X509 top level structure needs a bit of customisation */ + +extern void policy_cache_free(X509_POLICY_CACHE *cache); + +static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + X509 *ret = (X509 *)*pval; + + switch (operation) { + + case ASN1_OP_NEW_POST: + ret->name = NULL; + ret->ex_flags = 0; + ret->ex_pathlen = -1; + ret->skid = NULL; + ret->akid = NULL; + ret->aux = NULL; + ret->crldp = NULL; + ret->buf = NULL; + CRYPTO_new_ex_data(&ret->ex_data); + CRYPTO_MUTEX_init(&ret->lock); + break; + + case ASN1_OP_D2I_PRE: + CRYPTO_BUFFER_free(ret->buf); + ret->buf = NULL; + break; + + case ASN1_OP_D2I_POST: + if (ret->name != NULL) + OPENSSL_free(ret->name); + ret->name = X509_NAME_oneline(ret->cert_info->subject, NULL, 0); + break; + + case ASN1_OP_FREE_POST: + CRYPTO_MUTEX_cleanup(&ret->lock); + CRYPTO_free_ex_data(&g_ex_data_class, ret, &ret->ex_data); + X509_CERT_AUX_free(ret->aux); + ASN1_OCTET_STRING_free(ret->skid); + AUTHORITY_KEYID_free(ret->akid); + CRL_DIST_POINTS_free(ret->crldp); + policy_cache_free(ret->policy_cache); + GENERAL_NAMES_free(ret->altname); + NAME_CONSTRAINTS_free(ret->nc); + CRYPTO_BUFFER_free(ret->buf); + OPENSSL_free(ret->name); + break; + + } + + return 1; + +} + +ASN1_SEQUENCE_ref(X509, x509_cb) = { + ASN1_SIMPLE(X509, cert_info, X509_CINF), + ASN1_SIMPLE(X509, sig_alg, X509_ALGOR), + ASN1_SIMPLE(X509, signature, ASN1_BIT_STRING) +} ASN1_SEQUENCE_END_ref(X509, X509) + +IMPLEMENT_ASN1_FUNCTIONS(X509) + +IMPLEMENT_ASN1_DUP_FUNCTION(X509) + +X509 *X509_parse_from_buffer(CRYPTO_BUFFER *buf) { + if (CRYPTO_BUFFER_len(buf) > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + X509 *x509 = X509_new(); + if (x509 == NULL) { + return NULL; + } + + x509->cert_info->enc.alias_only_on_next_parse = 1; + + const uint8_t *inp = CRYPTO_BUFFER_data(buf); + X509 *x509p = x509; + X509 *ret = d2i_X509(&x509p, &inp, CRYPTO_BUFFER_len(buf)); + if (ret == NULL || + inp - CRYPTO_BUFFER_data(buf) != (ptrdiff_t)CRYPTO_BUFFER_len(buf)) { + X509_free(x509p); + return NULL; + } + assert(x509p == x509); + assert(ret == x509); + + CRYPTO_BUFFER_up_ref(buf); + ret->buf = buf; + + return ret; +} + +int X509_up_ref(X509 *x) +{ + CRYPTO_refcount_inc(&x->references); + return 1; +} + +int X509_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int X509_set_ex_data(X509 *r, int idx, void *arg) +{ + return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); +} + +void *X509_get_ex_data(X509 *r, int idx) +{ + return (CRYPTO_get_ex_data(&r->ex_data, idx)); +} + +/* + * X509_AUX ASN1 routines. X509_AUX is the name given to a certificate with + * extra info tagged on the end. Since these functions set how a certificate + * is trusted they should only be used when the certificate comes from a + * reliable source such as local storage. + */ + +X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) +{ + const unsigned char *q = *pp; + X509 *ret; + int freeret = 0; + + if (!a || *a == NULL) + freeret = 1; + ret = d2i_X509(a, &q, length); + /* If certificate unreadable then forget it */ + if (!ret) + return NULL; + /* update length */ + length -= q - *pp; + /* Parse auxiliary information if there is any. */ + if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length)) + goto err; + *pp = q; + return ret; + err: + if (freeret) { + X509_free(ret); + if (a) + *a = NULL; + } + return NULL; +} + +/* + * Serialize trusted certificate to *pp or just return the required buffer + * length if pp == NULL. We ultimately want to avoid modifying *pp in the + * error path, but that depends on similar hygiene in lower-level functions. + * Here we avoid compounding the problem. + */ +static int i2d_x509_aux_internal(X509 *a, unsigned char **pp) +{ + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; + + assert(pp == NULL || *pp != NULL); + + /* + * This might perturb *pp on error, but fixing that belongs in i2d_X509() + * not here. It should be that if a == NULL length is zero, but we check + * both just in case. + */ + length = i2d_X509(a, pp); + if (length <= 0 || a == NULL) { + return length; + } + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + + return length; +} + +/* + * Serialize trusted certificate to *pp, or just return the required buffer + * length if pp == NULL. + * + * When pp is not NULL, but *pp == NULL, we allocate the buffer, but since + * we're writing two ASN.1 objects back to back, we can't have i2d_X509() do + * the allocation, nor can we allow i2d_X509_CERT_AUX() to increment the + * allocated buffer. + */ +int i2d_X509_AUX(X509 *a, unsigned char **pp) +{ + int length; + unsigned char *tmp; + + /* Buffer provided by caller */ + if (pp == NULL || *pp != NULL) + return i2d_x509_aux_internal(a, pp); + + /* Obtain the combined length */ + if ((length = i2d_x509_aux_internal(a, NULL)) <= 0) + return length; + + /* Allocate requisite combined storage */ + *pp = tmp = OPENSSL_malloc(length); + if (tmp == NULL) + return -1; /* Push error onto error stack? */ + + /* Encode, but keep *pp at the originally malloced pointer */ + length = i2d_x509_aux_internal(a, &tmp); + if (length <= 0) { + OPENSSL_free(*pp); + *pp = NULL; + } + 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) +{ + if (psig) + *psig = x->signature; + if (palg) + *palg = x->sig_alg; +} + +int X509_get_signature_nid(const X509 *x) +{ + return OBJ_obj2nid(x->sig_alg->algorithm); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c new file mode 100644 index 0000000..e2ed356 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c @@ -0,0 +1,198 @@ +/* + * 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 + +/* + * X509_CERT_AUX routines. These are used to encode additional user + * modifiable data about a certificate. This data is appended to the X509 + * encoding when the *_X509_AUX routines are used. This means that the + * "traditional" X509 routines will simply ignore the extra data. + */ + +static X509_CERT_AUX *aux_get(X509 *x); + +ASN1_SEQUENCE(X509_CERT_AUX) = { + ASN1_SEQUENCE_OF_OPT(X509_CERT_AUX, trust, ASN1_OBJECT), + ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, reject, ASN1_OBJECT, 0), + ASN1_OPT(X509_CERT_AUX, alias, ASN1_UTF8STRING), + ASN1_OPT(X509_CERT_AUX, keyid, ASN1_OCTET_STRING), + ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, other, X509_ALGOR, 1) +} ASN1_SEQUENCE_END(X509_CERT_AUX) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_AUX) + +static X509_CERT_AUX *aux_get(X509 *x) +{ + if (!x) + return NULL; + if (!x->aux && !(x->aux = X509_CERT_AUX_new())) + return NULL; + return x->aux; +} + +int X509_alias_set1(X509 *x, unsigned char *name, int len) +{ + X509_CERT_AUX *aux; + if (!name) { + if (!x || !x->aux || !x->aux->alias) + return 1; + ASN1_UTF8STRING_free(x->aux->alias); + x->aux->alias = NULL; + return 1; + } + if (!(aux = aux_get(x))) + return 0; + if (!aux->alias && !(aux->alias = ASN1_UTF8STRING_new())) + return 0; + return ASN1_STRING_set(aux->alias, name, len); +} + +int X509_keyid_set1(X509 *x, unsigned char *id, int len) +{ + X509_CERT_AUX *aux; + if (!id) { + if (!x || !x->aux || !x->aux->keyid) + return 1; + ASN1_OCTET_STRING_free(x->aux->keyid); + x->aux->keyid = NULL; + return 1; + } + if (!(aux = aux_get(x))) + return 0; + if (!aux->keyid && !(aux->keyid = ASN1_OCTET_STRING_new())) + return 0; + return ASN1_STRING_set(aux->keyid, id, len); +} + +unsigned char *X509_alias_get0(X509 *x, int *len) +{ + if (!x->aux || !x->aux->alias) + return NULL; + if (len) + *len = x->aux->alias->length; + return x->aux->alias->data; +} + +unsigned char *X509_keyid_get0(X509 *x, int *len) +{ + if (!x->aux || !x->aux->keyid) + return NULL; + if (len) + *len = x->aux->keyid->length; + return x->aux->keyid->data; +} + +int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj) +{ + ASN1_OBJECT *objtmp = OBJ_dup(obj); + if (objtmp == NULL) + goto err; + X509_CERT_AUX *aux = aux_get(x); + if (aux->trust == NULL) { + aux->trust = sk_ASN1_OBJECT_new_null(); + if (aux->trust == NULL) + goto err; + } + if (!sk_ASN1_OBJECT_push(aux->trust, objtmp)) + goto err; + return 1; + + err: + ASN1_OBJECT_free(objtmp); + return 0; +} + +int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) +{ + ASN1_OBJECT *objtmp = OBJ_dup(obj); + if (objtmp == NULL) + goto err; + X509_CERT_AUX *aux = aux_get(x); + if (aux->reject == NULL) { + aux->reject = sk_ASN1_OBJECT_new_null(); + if (aux->reject == NULL) + goto err; + } + if (!sk_ASN1_OBJECT_push(aux->reject, objtmp)) + goto err; + return 1; + + err: + ASN1_OBJECT_free(objtmp); + return 0; +} + +void X509_trust_clear(X509 *x) +{ + if (x->aux && x->aux->trust) { + sk_ASN1_OBJECT_pop_free(x->aux->trust, ASN1_OBJECT_free); + x->aux->trust = NULL; + } +} + +void X509_reject_clear(X509 *x) +{ + if (x->aux && x->aux->reject) { + sk_ASN1_OBJECT_pop_free(x->aux->reject, ASN1_OBJECT_free); + x->aux->reject = NULL; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c.grpc_back new file mode 100644 index 0000000..dccc46a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c.grpc_back @@ -0,0 +1,198 @@ +/* + * 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 + +/* + * X509_CERT_AUX routines. These are used to encode additional user + * modifiable data about a certificate. This data is appended to the X509 + * encoding when the *_X509_AUX routines are used. This means that the + * "traditional" X509 routines will simply ignore the extra data. + */ + +static X509_CERT_AUX *aux_get(X509 *x); + +ASN1_SEQUENCE(X509_CERT_AUX) = { + ASN1_SEQUENCE_OF_OPT(X509_CERT_AUX, trust, ASN1_OBJECT), + ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, reject, ASN1_OBJECT, 0), + ASN1_OPT(X509_CERT_AUX, alias, ASN1_UTF8STRING), + ASN1_OPT(X509_CERT_AUX, keyid, ASN1_OCTET_STRING), + ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, other, X509_ALGOR, 1) +} ASN1_SEQUENCE_END(X509_CERT_AUX) + +IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_AUX) + +static X509_CERT_AUX *aux_get(X509 *x) +{ + if (!x) + return NULL; + if (!x->aux && !(x->aux = X509_CERT_AUX_new())) + return NULL; + return x->aux; +} + +int X509_alias_set1(X509 *x, unsigned char *name, int len) +{ + X509_CERT_AUX *aux; + if (!name) { + if (!x || !x->aux || !x->aux->alias) + return 1; + ASN1_UTF8STRING_free(x->aux->alias); + x->aux->alias = NULL; + return 1; + } + if (!(aux = aux_get(x))) + return 0; + if (!aux->alias && !(aux->alias = ASN1_UTF8STRING_new())) + return 0; + return ASN1_STRING_set(aux->alias, name, len); +} + +int X509_keyid_set1(X509 *x, unsigned char *id, int len) +{ + X509_CERT_AUX *aux; + if (!id) { + if (!x || !x->aux || !x->aux->keyid) + return 1; + ASN1_OCTET_STRING_free(x->aux->keyid); + x->aux->keyid = NULL; + return 1; + } + if (!(aux = aux_get(x))) + return 0; + if (!aux->keyid && !(aux->keyid = ASN1_OCTET_STRING_new())) + return 0; + return ASN1_STRING_set(aux->keyid, id, len); +} + +unsigned char *X509_alias_get0(X509 *x, int *len) +{ + if (!x->aux || !x->aux->alias) + return NULL; + if (len) + *len = x->aux->alias->length; + return x->aux->alias->data; +} + +unsigned char *X509_keyid_get0(X509 *x, int *len) +{ + if (!x->aux || !x->aux->keyid) + return NULL; + if (len) + *len = x->aux->keyid->length; + return x->aux->keyid->data; +} + +int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj) +{ + ASN1_OBJECT *objtmp = OBJ_dup(obj); + if (objtmp == NULL) + goto err; + X509_CERT_AUX *aux = aux_get(x); + if (aux->trust == NULL) { + aux->trust = sk_ASN1_OBJECT_new_null(); + if (aux->trust == NULL) + goto err; + } + if (!sk_ASN1_OBJECT_push(aux->trust, objtmp)) + goto err; + return 1; + + err: + ASN1_OBJECT_free(objtmp); + return 0; +} + +int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) +{ + ASN1_OBJECT *objtmp = OBJ_dup(obj); + if (objtmp == NULL) + goto err; + X509_CERT_AUX *aux = aux_get(x); + if (aux->reject == NULL) { + aux->reject = sk_ASN1_OBJECT_new_null(); + if (aux->reject == NULL) + goto err; + } + if (!sk_ASN1_OBJECT_push(aux->reject, objtmp)) + goto err; + return 1; + + err: + ASN1_OBJECT_free(objtmp); + return 0; +} + +void X509_trust_clear(X509 *x) +{ + if (x->aux && x->aux->trust) { + sk_ASN1_OBJECT_pop_free(x->aux->trust, ASN1_OBJECT_free); + x->aux->trust = NULL; + } +} + +void X509_reject_clear(X509 *x) +{ + if (x->aux && x->aux->reject) { + sk_ASN1_OBJECT_pop_free(x->aux->reject, ASN1_OBJECT_free); + x->aux->reject = NULL; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h new file mode 100644 index 0000000..a6ca45b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h @@ -0,0 +1,141 @@ +/* + * 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). */ + +/* This file contains a table of "standard" extensions */ + +#if defined(__cplusplus) +extern "C" { +#endif + +extern const X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku; +extern const X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, + v3_sinfo; +extern const X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, + v3_akey_id; +extern const X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate; +extern const X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, + v3_freshest_crl; +extern const X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, + v3_ocsp_acutoff; +extern const X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, + v3_ocsp_serviceloc; +extern const X509V3_EXT_METHOD v3_crl_hold, v3_pci; +extern const X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; +extern const X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp; +extern const X509V3_EXT_METHOD v3_addr, v3_asid; + +/* + * This table will be searched using OBJ_bsearch so it *must* kept in order + * of the ext_nid values. + */ + +/* TODO(fork): OCSP support */ +#define OPENSSL_NO_OCSP + +static const X509V3_EXT_METHOD *const standard_exts[] = { + &v3_nscert, + &v3_ns_ia5_list[0], + &v3_ns_ia5_list[1], + &v3_ns_ia5_list[2], + &v3_ns_ia5_list[3], + &v3_ns_ia5_list[4], + &v3_ns_ia5_list[5], + &v3_ns_ia5_list[6], + &v3_skey_id, + &v3_key_usage, + &v3_pkey_usage_period, + &v3_alt[0], + &v3_alt[1], + &v3_bcons, + &v3_crl_num, + &v3_cpols, + &v3_akey_id, + &v3_crld, + &v3_ext_ku, + &v3_delta_crl, + &v3_crl_reason, + &v3_crl_invdate, + &v3_sxnet, + &v3_info, +#ifndef OPENSSL_NO_OCSP + &v3_ocsp_nonce, + &v3_ocsp_crlid, + &v3_ocsp_accresp, + &v3_ocsp_acutoff, + &v3_ocsp_serviceloc, +#endif + &v3_ocsp_nocheck, + &v3_sinfo, + &v3_policy_constraints, +#ifndef OPENSSL_NO_OCSP + &v3_crl_hold, +#endif + &v3_pci, + &v3_name_constraints, + &v3_policy_mappings, + &v3_inhibit_anyp, + &v3_idp, + &v3_alt[2], + &v3_freshest_crl, +}; + +/* Number of standard extensions */ + +#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *)) + +#if defined(__cplusplus) +} /* extern C */ +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back new file mode 100644 index 0000000..a6ca45b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back @@ -0,0 +1,141 @@ +/* + * 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). */ + +/* This file contains a table of "standard" extensions */ + +#if defined(__cplusplus) +extern "C" { +#endif + +extern const X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku; +extern const X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, + v3_sinfo; +extern const X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, + v3_akey_id; +extern const X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate; +extern const X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, + v3_freshest_crl; +extern const X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, + v3_ocsp_acutoff; +extern const X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, + v3_ocsp_serviceloc; +extern const X509V3_EXT_METHOD v3_crl_hold, v3_pci; +extern const X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; +extern const X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp; +extern const X509V3_EXT_METHOD v3_addr, v3_asid; + +/* + * This table will be searched using OBJ_bsearch so it *must* kept in order + * of the ext_nid values. + */ + +/* TODO(fork): OCSP support */ +#define OPENSSL_NO_OCSP + +static const X509V3_EXT_METHOD *const standard_exts[] = { + &v3_nscert, + &v3_ns_ia5_list[0], + &v3_ns_ia5_list[1], + &v3_ns_ia5_list[2], + &v3_ns_ia5_list[3], + &v3_ns_ia5_list[4], + &v3_ns_ia5_list[5], + &v3_ns_ia5_list[6], + &v3_skey_id, + &v3_key_usage, + &v3_pkey_usage_period, + &v3_alt[0], + &v3_alt[1], + &v3_bcons, + &v3_crl_num, + &v3_cpols, + &v3_akey_id, + &v3_crld, + &v3_ext_ku, + &v3_delta_crl, + &v3_crl_reason, + &v3_crl_invdate, + &v3_sxnet, + &v3_info, +#ifndef OPENSSL_NO_OCSP + &v3_ocsp_nonce, + &v3_ocsp_crlid, + &v3_ocsp_accresp, + &v3_ocsp_acutoff, + &v3_ocsp_serviceloc, +#endif + &v3_ocsp_nocheck, + &v3_sinfo, + &v3_policy_constraints, +#ifndef OPENSSL_NO_OCSP + &v3_crl_hold, +#endif + &v3_pci, + &v3_name_constraints, + &v3_policy_mappings, + &v3_inhibit_anyp, + &v3_idp, + &v3_alt[2], + &v3_freshest_crl, +}; + +/* Number of standard extensions */ + +#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *)) + +#if defined(__cplusplus) +} /* extern C */ +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h new file mode 100644 index 0000000..edcdd6b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h.grpc_back new file mode 100644 index 0000000..c143d73 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c new file mode 100644 index 0000000..2aeb426 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c @@ -0,0 +1,286 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include +#include +#include +#include + +#include "pcy_int.h" +#include "../internal.h" + +static int policy_data_cmp(const X509_POLICY_DATA **a, + const X509_POLICY_DATA **b); +static int policy_cache_set_int(long *out, ASN1_INTEGER *value); + +/* + * Set cache entry according to CertificatePolicies extension. Note: this + * destroys the passed CERTIFICATEPOLICIES structure. + */ + +static int policy_cache_create(X509 *x, + CERTIFICATEPOLICIES *policies, int crit) +{ + size_t i; + int ret = 0; + X509_POLICY_CACHE *cache = x->policy_cache; + X509_POLICY_DATA *data = NULL; + POLICYINFO *policy; + if (sk_POLICYINFO_num(policies) == 0) + goto bad_policy; + cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp); + if (!cache->data) + goto bad_policy; + for (i = 0; i < sk_POLICYINFO_num(policies); i++) { + policy = sk_POLICYINFO_value(policies, i); + data = policy_data_new(policy, NULL, crit); + if (!data) + goto bad_policy; + /* + * 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; + goto bad_policy; + } + cache->anyPolicy = data; + } else if (sk_X509_POLICY_DATA_find(cache->data, NULL, data)) { + ret = -1; + goto bad_policy; + } else if (!sk_X509_POLICY_DATA_push(cache->data, data)) + goto bad_policy; + data = NULL; + } + ret = 1; + bad_policy: + if (ret == -1) + x->ex_flags |= EXFLAG_INVALID_POLICY; + if (data) + policy_data_free(data); + sk_POLICYINFO_pop_free(policies, POLICYINFO_free); + if (ret <= 0) { + sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); + cache->data = NULL; + } + return ret; +} + +static int policy_cache_new(X509 *x) +{ + X509_POLICY_CACHE *cache; + ASN1_INTEGER *ext_any = NULL; + POLICY_CONSTRAINTS *ext_pcons = NULL; + CERTIFICATEPOLICIES *ext_cpols = NULL; + POLICY_MAPPINGS *ext_pmaps = NULL; + int i; + cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE)); + if (!cache) + return 0; + cache->anyPolicy = NULL; + cache->data = NULL; + cache->any_skip = -1; + cache->explicit_skip = -1; + cache->map_skip = -1; + + x->policy_cache = cache; + + /* + * Handle requireExplicitPolicy *first*. Need to process this even if we + * don't have any policies. + */ + ext_pcons = X509_get_ext_d2i(x, NID_policy_constraints, &i, NULL); + + if (!ext_pcons) { + if (i != -1) + goto bad_cache; + } else { + if (!ext_pcons->requireExplicitPolicy + && !ext_pcons->inhibitPolicyMapping) + goto bad_cache; + if (!policy_cache_set_int(&cache->explicit_skip, + ext_pcons->requireExplicitPolicy)) + goto bad_cache; + if (!policy_cache_set_int(&cache->map_skip, + ext_pcons->inhibitPolicyMapping)) + goto bad_cache; + } + + /* Process CertificatePolicies */ + + ext_cpols = X509_get_ext_d2i(x, NID_certificate_policies, &i, NULL); + /* + * If no CertificatePolicies extension or problem decoding then there is + * no point continuing because the valid policies will be NULL. + */ + if (!ext_cpols) { + /* If not absent some problem with extension */ + if (i != -1) + goto bad_cache; + return 1; + } + + i = policy_cache_create(x, ext_cpols, i); + + /* NB: ext_cpols freed by policy_cache_set_policies */ + + if (i <= 0) + return i; + + ext_pmaps = X509_get_ext_d2i(x, NID_policy_mappings, &i, NULL); + + if (!ext_pmaps) { + /* If not absent some problem with extension */ + if (i != -1) + goto bad_cache; + } else { + i = policy_cache_set_mapping(x, ext_pmaps); + if (i <= 0) + goto bad_cache; + } + + ext_any = X509_get_ext_d2i(x, NID_inhibit_any_policy, &i, NULL); + + if (!ext_any) { + if (i != -1) + goto bad_cache; + } else if (!policy_cache_set_int(&cache->any_skip, ext_any)) + goto bad_cache; + + if (0) { + bad_cache: + x->ex_flags |= EXFLAG_INVALID_POLICY; + } + + if (ext_pcons) + POLICY_CONSTRAINTS_free(ext_pcons); + + if (ext_any) + ASN1_INTEGER_free(ext_any); + + return 1; + +} + +void policy_cache_free(X509_POLICY_CACHE *cache) +{ + if (!cache) + return; + if (cache->anyPolicy) + policy_data_free(cache->anyPolicy); + if (cache->data) + sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); + OPENSSL_free(cache); +} + +/* + * g_x509_policy_cache_lock is used to protect against concurrent calls to + * |policy_cache_new|. Ideally this would be done with a |CRYPTO_once_t| in + * the |X509| structure, but |CRYPTO_once_t| isn't public. + */ +static struct CRYPTO_STATIC_MUTEX g_x509_policy_cache_lock = + CRYPTO_STATIC_MUTEX_INIT; + +const X509_POLICY_CACHE *policy_cache_set(X509 *x) +{ + X509_POLICY_CACHE *cache; + + CRYPTO_STATIC_MUTEX_lock_read(&g_x509_policy_cache_lock); + cache = x->policy_cache; + CRYPTO_STATIC_MUTEX_unlock_read(&g_x509_policy_cache_lock); + + if (cache != NULL) + return cache; + + CRYPTO_STATIC_MUTEX_lock_write(&g_x509_policy_cache_lock); + if (x->policy_cache == NULL) + policy_cache_new(x); + cache = x->policy_cache; + CRYPTO_STATIC_MUTEX_unlock_write(&g_x509_policy_cache_lock); + + return cache; +} + +X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id) +{ + size_t idx; + 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); +} + +static int policy_data_cmp(const X509_POLICY_DATA **a, + const X509_POLICY_DATA **b) +{ + return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy); +} + +static int policy_cache_set_int(long *out, ASN1_INTEGER *value) +{ + if (value == NULL) + return 1; + if (value->type == V_ASN1_NEG_INTEGER) + return 0; + *out = ASN1_INTEGER_get(value); + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back new file mode 100644 index 0000000..755c079 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back @@ -0,0 +1,286 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include +#include +#include +#include + +#include "pcy_int.h" +#include "../internal.h" + +static int policy_data_cmp(const X509_POLICY_DATA **a, + const X509_POLICY_DATA **b); +static int policy_cache_set_int(long *out, ASN1_INTEGER *value); + +/* + * Set cache entry according to CertificatePolicies extension. Note: this + * destroys the passed CERTIFICATEPOLICIES structure. + */ + +static int policy_cache_create(X509 *x, + CERTIFICATEPOLICIES *policies, int crit) +{ + size_t i; + int ret = 0; + X509_POLICY_CACHE *cache = x->policy_cache; + X509_POLICY_DATA *data = NULL; + POLICYINFO *policy; + if (sk_POLICYINFO_num(policies) == 0) + goto bad_policy; + cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp); + if (!cache->data) + goto bad_policy; + for (i = 0; i < sk_POLICYINFO_num(policies); i++) { + policy = sk_POLICYINFO_value(policies, i); + data = policy_data_new(policy, NULL, crit); + if (!data) + goto bad_policy; + /* + * 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; + goto bad_policy; + } + cache->anyPolicy = data; + } else if (sk_X509_POLICY_DATA_find(cache->data, NULL, data)) { + ret = -1; + goto bad_policy; + } else if (!sk_X509_POLICY_DATA_push(cache->data, data)) + goto bad_policy; + data = NULL; + } + ret = 1; + bad_policy: + if (ret == -1) + x->ex_flags |= EXFLAG_INVALID_POLICY; + if (data) + policy_data_free(data); + sk_POLICYINFO_pop_free(policies, POLICYINFO_free); + if (ret <= 0) { + sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); + cache->data = NULL; + } + return ret; +} + +static int policy_cache_new(X509 *x) +{ + X509_POLICY_CACHE *cache; + ASN1_INTEGER *ext_any = NULL; + POLICY_CONSTRAINTS *ext_pcons = NULL; + CERTIFICATEPOLICIES *ext_cpols = NULL; + POLICY_MAPPINGS *ext_pmaps = NULL; + int i; + cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE)); + if (!cache) + return 0; + cache->anyPolicy = NULL; + cache->data = NULL; + cache->any_skip = -1; + cache->explicit_skip = -1; + cache->map_skip = -1; + + x->policy_cache = cache; + + /* + * Handle requireExplicitPolicy *first*. Need to process this even if we + * don't have any policies. + */ + ext_pcons = X509_get_ext_d2i(x, NID_policy_constraints, &i, NULL); + + if (!ext_pcons) { + if (i != -1) + goto bad_cache; + } else { + if (!ext_pcons->requireExplicitPolicy + && !ext_pcons->inhibitPolicyMapping) + goto bad_cache; + if (!policy_cache_set_int(&cache->explicit_skip, + ext_pcons->requireExplicitPolicy)) + goto bad_cache; + if (!policy_cache_set_int(&cache->map_skip, + ext_pcons->inhibitPolicyMapping)) + goto bad_cache; + } + + /* Process CertificatePolicies */ + + ext_cpols = X509_get_ext_d2i(x, NID_certificate_policies, &i, NULL); + /* + * If no CertificatePolicies extension or problem decoding then there is + * no point continuing because the valid policies will be NULL. + */ + if (!ext_cpols) { + /* If not absent some problem with extension */ + if (i != -1) + goto bad_cache; + return 1; + } + + i = policy_cache_create(x, ext_cpols, i); + + /* NB: ext_cpols freed by policy_cache_set_policies */ + + if (i <= 0) + return i; + + ext_pmaps = X509_get_ext_d2i(x, NID_policy_mappings, &i, NULL); + + if (!ext_pmaps) { + /* If not absent some problem with extension */ + if (i != -1) + goto bad_cache; + } else { + i = policy_cache_set_mapping(x, ext_pmaps); + if (i <= 0) + goto bad_cache; + } + + ext_any = X509_get_ext_d2i(x, NID_inhibit_any_policy, &i, NULL); + + if (!ext_any) { + if (i != -1) + goto bad_cache; + } else if (!policy_cache_set_int(&cache->any_skip, ext_any)) + goto bad_cache; + + if (0) { + bad_cache: + x->ex_flags |= EXFLAG_INVALID_POLICY; + } + + if (ext_pcons) + POLICY_CONSTRAINTS_free(ext_pcons); + + if (ext_any) + ASN1_INTEGER_free(ext_any); + + return 1; + +} + +void policy_cache_free(X509_POLICY_CACHE *cache) +{ + if (!cache) + return; + if (cache->anyPolicy) + policy_data_free(cache->anyPolicy); + if (cache->data) + sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); + OPENSSL_free(cache); +} + +/* + * g_x509_policy_cache_lock is used to protect against concurrent calls to + * |policy_cache_new|. Ideally this would be done with a |CRYPTO_once_t| in + * the |X509| structure, but |CRYPTO_once_t| isn't public. + */ +static struct CRYPTO_STATIC_MUTEX g_x509_policy_cache_lock = + CRYPTO_STATIC_MUTEX_INIT; + +const X509_POLICY_CACHE *policy_cache_set(X509 *x) +{ + X509_POLICY_CACHE *cache; + + CRYPTO_STATIC_MUTEX_lock_read(&g_x509_policy_cache_lock); + cache = x->policy_cache; + CRYPTO_STATIC_MUTEX_unlock_read(&g_x509_policy_cache_lock); + + if (cache != NULL) + return cache; + + CRYPTO_STATIC_MUTEX_lock_write(&g_x509_policy_cache_lock); + if (x->policy_cache == NULL) + policy_cache_new(x); + cache = x->policy_cache; + CRYPTO_STATIC_MUTEX_unlock_write(&g_x509_policy_cache_lock); + + return cache; +} + +X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id) +{ + size_t idx; + 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); +} + +static int policy_data_cmp(const X509_POLICY_DATA **a, + const X509_POLICY_DATA **b) +{ + return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy); +} + +static int policy_cache_set_int(long *out, ASN1_INTEGER *value) +{ + if (value == NULL) + return 1; + if (value->type == V_ASN1_NEG_INTEGER) + return 0; + *out = ASN1_INTEGER_get(value); + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c new file mode 100644 index 0000000..e8ab073 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c @@ -0,0 +1,130 @@ +/* pcy_data.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include +#include +#include +#include + +#include "pcy_int.h" + +/* Policy Node routines */ + +void policy_data_free(X509_POLICY_DATA *data) +{ + ASN1_OBJECT_free(data->valid_policy); + /* Don't free qualifiers if shared */ + if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS)) + sk_POLICYQUALINFO_pop_free(data->qualifier_set, POLICYQUALINFO_free); + sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free); + OPENSSL_free(data); +} + +/* + * Create a data based on an existing policy. If 'id' is NULL use the oid in + * the policy, otherwise use 'id'. This behaviour covers the two types of + * data in RFC3280: data with from a CertificatePolcies extension and + * additional data with just the qualifiers of anyPolicy and ID from another + * source. + */ + +X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, + const ASN1_OBJECT *cid, int crit) +{ + X509_POLICY_DATA *ret; + ASN1_OBJECT *id; + if (!policy && !cid) + return NULL; + if (cid) { + id = OBJ_dup(cid); + if (!id) + return NULL; + } else + id = NULL; + ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); + if (!ret) + return NULL; + ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); + if (!ret->expected_policy_set) { + OPENSSL_free(ret); + if (id) + ASN1_OBJECT_free(id); + return NULL; + } + + if (crit) + ret->flags = POLICY_DATA_FLAG_CRITICAL; + else + ret->flags = 0; + + if (id) + ret->valid_policy = id; + else { + ret->valid_policy = policy->policyid; + policy->policyid = NULL; + } + + if (policy) { + ret->qualifier_set = policy->qualifiers; + policy->qualifiers = NULL; + } else + ret->qualifier_set = NULL; + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c.grpc_back new file mode 100644 index 0000000..498de4d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c.grpc_back @@ -0,0 +1,130 @@ +/* pcy_data.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include +#include +#include +#include + +#include "pcy_int.h" + +/* Policy Node routines */ + +void policy_data_free(X509_POLICY_DATA *data) +{ + ASN1_OBJECT_free(data->valid_policy); + /* Don't free qualifiers if shared */ + if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS)) + sk_POLICYQUALINFO_pop_free(data->qualifier_set, POLICYQUALINFO_free); + sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free); + OPENSSL_free(data); +} + +/* + * Create a data based on an existing policy. If 'id' is NULL use the oid in + * the policy, otherwise use 'id'. This behaviour covers the two types of + * data in RFC3280: data with from a CertificatePolcies extension and + * additional data with just the qualifiers of anyPolicy and ID from another + * source. + */ + +X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, + const ASN1_OBJECT *cid, int crit) +{ + X509_POLICY_DATA *ret; + ASN1_OBJECT *id; + if (!policy && !cid) + return NULL; + if (cid) { + id = OBJ_dup(cid); + if (!id) + return NULL; + } else + id = NULL; + ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); + if (!ret) + return NULL; + ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); + if (!ret->expected_policy_set) { + OPENSSL_free(ret); + if (id) + ASN1_OBJECT_free(id); + return NULL; + } + + if (crit) + ret->flags = POLICY_DATA_FLAG_CRITICAL; + else + ret->flags = 0; + + if (id) + ret->valid_policy = id; + else { + ret->valid_policy = policy->policyid; + policy->policyid = NULL; + } + + if (policy) { + ret->qualifier_set = policy->qualifiers; + policy->qualifiers = NULL; + } else + ret->qualifier_set = NULL; + + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h new file mode 100644 index 0000000..fc6e20a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h @@ -0,0 +1,217 @@ +/* pcy_int.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +typedef struct X509_POLICY_DATA_st X509_POLICY_DATA; + +DEFINE_STACK_OF(X509_POLICY_DATA) + +/* Internal structures */ + +/* + * This structure and the field names correspond to the Policy 'node' of + * RFC3280. NB this structure contains no pointers to parent or child data: + * X509_POLICY_NODE contains that. This means that the main policy data can + * be kept static and cached with the certificate. + */ + +struct X509_POLICY_DATA_st { + unsigned int flags; + /* Policy OID and qualifiers for this data */ + ASN1_OBJECT *valid_policy; + STACK_OF(POLICYQUALINFO) *qualifier_set; + STACK_OF(ASN1_OBJECT) *expected_policy_set; +}; + +/* X509_POLICY_DATA flags values */ + +/* + * This flag indicates the structure has been mapped using a policy mapping + * extension. If policy mapping is not active its references get deleted. + */ + +#define POLICY_DATA_FLAG_MAPPED 0x1 + +/* + * This flag indicates the data doesn't correspond to a policy in Certificate + * Policies: it has been mapped to any policy. + */ + +#define POLICY_DATA_FLAG_MAPPED_ANY 0x2 + +/* AND with flags to see if any mapping has occurred */ + +#define POLICY_DATA_FLAG_MAP_MASK 0x3 + +/* qualifiers are shared and shouldn't be freed */ + +#define POLICY_DATA_FLAG_SHARED_QUALIFIERS 0x4 + +/* Parent node is an extra node and should be freed */ + +#define POLICY_DATA_FLAG_EXTRA_NODE 0x8 + +/* Corresponding CertificatePolicies is critical */ + +#define POLICY_DATA_FLAG_CRITICAL 0x10 + +/* This structure is cached with a certificate */ + +struct X509_POLICY_CACHE_st { + /* anyPolicy data or NULL if no anyPolicy */ + X509_POLICY_DATA *anyPolicy; + /* other policy data */ + STACK_OF(X509_POLICY_DATA) *data; + /* If InhibitAnyPolicy present this is its value or -1 if absent. */ + long any_skip; + /* + * If policyConstraints and requireExplicitPolicy present this is its + * value or -1 if absent. + */ + long explicit_skip; + /* + * If policyConstraints and policyMapping present this is its value or -1 + * if absent. + */ + long map_skip; +}; + +/* + * #define POLICY_CACHE_FLAG_CRITICAL POLICY_DATA_FLAG_CRITICAL + */ + +/* This structure represents the relationship between nodes */ + +struct X509_POLICY_NODE_st { + /* node data this refers to */ + const X509_POLICY_DATA *data; + /* Parent node */ + X509_POLICY_NODE *parent; + /* Number of child nodes */ + int nchild; +}; + +struct X509_POLICY_LEVEL_st { + /* Cert for this level */ + X509 *cert; + /* nodes at this level */ + STACK_OF(X509_POLICY_NODE) *nodes; + /* anyPolicy node */ + X509_POLICY_NODE *anyPolicy; + /* Extra data */ + /* + * STACK_OF(X509_POLICY_DATA) *extra_data; + */ + unsigned int flags; +}; + +struct X509_POLICY_TREE_st { + /* This is the tree 'level' data */ + X509_POLICY_LEVEL *levels; + int nlevel; + /* + * Extra policy data when additional nodes (not from the certificate) are + * required. + */ + STACK_OF(X509_POLICY_DATA) *extra_data; + /* This is the authority constained policy set */ + STACK_OF(X509_POLICY_NODE) *auth_policies; + STACK_OF(X509_POLICY_NODE) *user_policies; + unsigned int flags; +}; + +/* Set if anyPolicy present in user policies */ +#define POLICY_FLAG_ANY_POLICY 0x2 + +/* Useful macros */ + +#define node_data_critical(data) ((data)->flags & POLICY_DATA_FLAG_CRITICAL) +#define node_critical(node) node_data_critical((node)->data) + +/* Internal functions */ + +X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *id, + int crit); +void policy_data_free(X509_POLICY_DATA *data); + +X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id); +int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps); + +STACK_OF(X509_POLICY_NODE) *policy_node_cmp_new(void); + +void policy_cache_init(void); + +void policy_cache_free(X509_POLICY_CACHE *cache); + +X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, + const X509_POLICY_NODE *parent, + const ASN1_OBJECT *id); + +X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk, + const ASN1_OBJECT *id); + +X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, + X509_POLICY_TREE *tree); +void policy_node_free(X509_POLICY_NODE *node); +int policy_node_match(const X509_POLICY_LEVEL *lvl, + const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); + +const X509_POLICY_CACHE *policy_cache_set(X509 *x); diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h.grpc_back new file mode 100644 index 0000000..fc6e20a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h.grpc_back @@ -0,0 +1,217 @@ +/* pcy_int.h */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +typedef struct X509_POLICY_DATA_st X509_POLICY_DATA; + +DEFINE_STACK_OF(X509_POLICY_DATA) + +/* Internal structures */ + +/* + * This structure and the field names correspond to the Policy 'node' of + * RFC3280. NB this structure contains no pointers to parent or child data: + * X509_POLICY_NODE contains that. This means that the main policy data can + * be kept static and cached with the certificate. + */ + +struct X509_POLICY_DATA_st { + unsigned int flags; + /* Policy OID and qualifiers for this data */ + ASN1_OBJECT *valid_policy; + STACK_OF(POLICYQUALINFO) *qualifier_set; + STACK_OF(ASN1_OBJECT) *expected_policy_set; +}; + +/* X509_POLICY_DATA flags values */ + +/* + * This flag indicates the structure has been mapped using a policy mapping + * extension. If policy mapping is not active its references get deleted. + */ + +#define POLICY_DATA_FLAG_MAPPED 0x1 + +/* + * This flag indicates the data doesn't correspond to a policy in Certificate + * Policies: it has been mapped to any policy. + */ + +#define POLICY_DATA_FLAG_MAPPED_ANY 0x2 + +/* AND with flags to see if any mapping has occurred */ + +#define POLICY_DATA_FLAG_MAP_MASK 0x3 + +/* qualifiers are shared and shouldn't be freed */ + +#define POLICY_DATA_FLAG_SHARED_QUALIFIERS 0x4 + +/* Parent node is an extra node and should be freed */ + +#define POLICY_DATA_FLAG_EXTRA_NODE 0x8 + +/* Corresponding CertificatePolicies is critical */ + +#define POLICY_DATA_FLAG_CRITICAL 0x10 + +/* This structure is cached with a certificate */ + +struct X509_POLICY_CACHE_st { + /* anyPolicy data or NULL if no anyPolicy */ + X509_POLICY_DATA *anyPolicy; + /* other policy data */ + STACK_OF(X509_POLICY_DATA) *data; + /* If InhibitAnyPolicy present this is its value or -1 if absent. */ + long any_skip; + /* + * If policyConstraints and requireExplicitPolicy present this is its + * value or -1 if absent. + */ + long explicit_skip; + /* + * If policyConstraints and policyMapping present this is its value or -1 + * if absent. + */ + long map_skip; +}; + +/* + * #define POLICY_CACHE_FLAG_CRITICAL POLICY_DATA_FLAG_CRITICAL + */ + +/* This structure represents the relationship between nodes */ + +struct X509_POLICY_NODE_st { + /* node data this refers to */ + const X509_POLICY_DATA *data; + /* Parent node */ + X509_POLICY_NODE *parent; + /* Number of child nodes */ + int nchild; +}; + +struct X509_POLICY_LEVEL_st { + /* Cert for this level */ + X509 *cert; + /* nodes at this level */ + STACK_OF(X509_POLICY_NODE) *nodes; + /* anyPolicy node */ + X509_POLICY_NODE *anyPolicy; + /* Extra data */ + /* + * STACK_OF(X509_POLICY_DATA) *extra_data; + */ + unsigned int flags; +}; + +struct X509_POLICY_TREE_st { + /* This is the tree 'level' data */ + X509_POLICY_LEVEL *levels; + int nlevel; + /* + * Extra policy data when additional nodes (not from the certificate) are + * required. + */ + STACK_OF(X509_POLICY_DATA) *extra_data; + /* This is the authority constained policy set */ + STACK_OF(X509_POLICY_NODE) *auth_policies; + STACK_OF(X509_POLICY_NODE) *user_policies; + unsigned int flags; +}; + +/* Set if anyPolicy present in user policies */ +#define POLICY_FLAG_ANY_POLICY 0x2 + +/* Useful macros */ + +#define node_data_critical(data) ((data)->flags & POLICY_DATA_FLAG_CRITICAL) +#define node_critical(node) node_data_critical((node)->data) + +/* Internal functions */ + +X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *id, + int crit); +void policy_data_free(X509_POLICY_DATA *data); + +X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id); +int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps); + +STACK_OF(X509_POLICY_NODE) *policy_node_cmp_new(void); + +void policy_cache_init(void); + +void policy_cache_free(X509_POLICY_CACHE *cache); + +X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, + const X509_POLICY_NODE *parent, + const ASN1_OBJECT *id); + +X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk, + const ASN1_OBJECT *id); + +X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, + X509_POLICY_TREE *tree); +void policy_node_free(X509_POLICY_NODE *node); +int policy_node_match(const X509_POLICY_LEVEL *lvl, + const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); + +const X509_POLICY_CACHE *policy_cache_set(X509 *x); diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c new file mode 100644 index 0000000..f7283a6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c @@ -0,0 +1,155 @@ +/* pcy_lib.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include + +#include "pcy_int.h" + +/* accessor functions */ + +/* X509_POLICY_TREE stuff */ + +int X509_policy_tree_level_count(const X509_POLICY_TREE *tree) +{ + if (!tree) + return 0; + return tree->nlevel; +} + +X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, + int i) +{ + if (!tree || (i < 0) || (i >= tree->nlevel)) + return NULL; + return tree->levels + i; +} + +STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + X509_POLICY_TREE + *tree) +{ + if (!tree) + return NULL; + return tree->auth_policies; +} + +STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + X509_POLICY_TREE + *tree) +{ + if (!tree) + return NULL; + if (tree->flags & POLICY_FLAG_ANY_POLICY) + return tree->auth_policies; + else + return tree->user_policies; +} + +/* X509_POLICY_LEVEL stuff */ + +int X509_policy_level_node_count(X509_POLICY_LEVEL *level) +{ + int n; + if (!level) + return 0; + if (level->anyPolicy) + n = 1; + else + n = 0; + if (level->nodes) + n += sk_X509_POLICY_NODE_num(level->nodes); + return n; +} + +X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i) +{ + if (!level) + return NULL; + if (level->anyPolicy) { + if (i == 0) + return level->anyPolicy; + i--; + } + return sk_X509_POLICY_NODE_value(level->nodes, i); +} + +/* X509_POLICY_NODE stuff */ + +const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node) +{ + if (!node) + return NULL; + return node->data->valid_policy; +} + +STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + X509_POLICY_NODE + *node) +{ + if (!node) + return NULL; + return node->data->qualifier_set; +} + +const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE + *node) +{ + if (!node) + return NULL; + return node->parent; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c.grpc_back new file mode 100644 index 0000000..7d5f067 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c.grpc_back @@ -0,0 +1,155 @@ +/* pcy_lib.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include + +#include "pcy_int.h" + +/* accessor functions */ + +/* X509_POLICY_TREE stuff */ + +int X509_policy_tree_level_count(const X509_POLICY_TREE *tree) +{ + if (!tree) + return 0; + return tree->nlevel; +} + +X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, + int i) +{ + if (!tree || (i < 0) || (i >= tree->nlevel)) + return NULL; + return tree->levels + i; +} + +STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + X509_POLICY_TREE + *tree) +{ + if (!tree) + return NULL; + return tree->auth_policies; +} + +STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + X509_POLICY_TREE + *tree) +{ + if (!tree) + return NULL; + if (tree->flags & POLICY_FLAG_ANY_POLICY) + return tree->auth_policies; + else + return tree->user_policies; +} + +/* X509_POLICY_LEVEL stuff */ + +int X509_policy_level_node_count(X509_POLICY_LEVEL *level) +{ + int n; + if (!level) + return 0; + if (level->anyPolicy) + n = 1; + else + n = 0; + if (level->nodes) + n += sk_X509_POLICY_NODE_num(level->nodes); + return n; +} + +X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i) +{ + if (!level) + return NULL; + if (level->anyPolicy) { + if (i == 0) + return level->anyPolicy; + i--; + } + return sk_X509_POLICY_NODE_value(level->nodes, i); +} + +/* X509_POLICY_NODE stuff */ + +const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node) +{ + if (!node) + return NULL; + return node->data->valid_policy; +} + +STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + X509_POLICY_NODE + *node) +{ + if (!node) + return NULL; + return node->data->qualifier_set; +} + +const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE + *node) +{ + if (!node) + return NULL; + return node->parent; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c new file mode 100644 index 0000000..e0a1520 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c @@ -0,0 +1,130 @@ +/* pcy_map.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include +#include +#include + +#include "pcy_int.h" + +/* + * Set policy mapping entries in cache. Note: this modifies the passed + * POLICY_MAPPINGS structure + */ + +int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps) +{ + POLICY_MAPPING *map; + X509_POLICY_DATA *data; + X509_POLICY_CACHE *cache = x->policy_cache; + size_t i; + int ret = 0; + if (sk_POLICY_MAPPING_num(maps) == 0) { + ret = -1; + goto bad_mapping; + } + for (i = 0; i < sk_POLICY_MAPPING_num(maps); i++) { + map = sk_POLICY_MAPPING_value(maps, i); + /* Reject if map to or from anyPolicy */ + if ((OBJ_obj2nid(map->subjectDomainPolicy) == NID_any_policy) + || (OBJ_obj2nid(map->issuerDomainPolicy) == NID_any_policy)) { + ret = -1; + goto bad_mapping; + } + + /* Attempt to find matching policy data */ + data = policy_cache_find_data(cache, map->issuerDomainPolicy); + /* If we don't have anyPolicy can't map */ + if (!data && !cache->anyPolicy) + continue; + + /* Create a NODE from anyPolicy */ + if (!data) { + data = policy_data_new(NULL, map->issuerDomainPolicy, + cache->anyPolicy->flags + & POLICY_DATA_FLAG_CRITICAL); + if (!data) + goto bad_mapping; + data->qualifier_set = cache->anyPolicy->qualifier_set; + /* + * map->issuerDomainPolicy = NULL; + */ + data->flags |= POLICY_DATA_FLAG_MAPPED_ANY; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!sk_X509_POLICY_DATA_push(cache->data, data)) { + policy_data_free(data); + goto bad_mapping; + } + } else + data->flags |= POLICY_DATA_FLAG_MAPPED; + if (!sk_ASN1_OBJECT_push(data->expected_policy_set, + map->subjectDomainPolicy)) + goto bad_mapping; + map->subjectDomainPolicy = NULL; + + } + + ret = 1; + bad_mapping: + if (ret == -1) + x->ex_flags |= EXFLAG_INVALID_POLICY; + sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free); + return ret; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c.grpc_back new file mode 100644 index 0000000..7263c69 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c.grpc_back @@ -0,0 +1,130 @@ +/* pcy_map.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include +#include +#include + +#include "pcy_int.h" + +/* + * Set policy mapping entries in cache. Note: this modifies the passed + * POLICY_MAPPINGS structure + */ + +int policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps) +{ + POLICY_MAPPING *map; + X509_POLICY_DATA *data; + X509_POLICY_CACHE *cache = x->policy_cache; + size_t i; + int ret = 0; + if (sk_POLICY_MAPPING_num(maps) == 0) { + ret = -1; + goto bad_mapping; + } + for (i = 0; i < sk_POLICY_MAPPING_num(maps); i++) { + map = sk_POLICY_MAPPING_value(maps, i); + /* Reject if map to or from anyPolicy */ + if ((OBJ_obj2nid(map->subjectDomainPolicy) == NID_any_policy) + || (OBJ_obj2nid(map->issuerDomainPolicy) == NID_any_policy)) { + ret = -1; + goto bad_mapping; + } + + /* Attempt to find matching policy data */ + data = policy_cache_find_data(cache, map->issuerDomainPolicy); + /* If we don't have anyPolicy can't map */ + if (!data && !cache->anyPolicy) + continue; + + /* Create a NODE from anyPolicy */ + if (!data) { + data = policy_data_new(NULL, map->issuerDomainPolicy, + cache->anyPolicy->flags + & POLICY_DATA_FLAG_CRITICAL); + if (!data) + goto bad_mapping; + data->qualifier_set = cache->anyPolicy->qualifier_set; + /* + * map->issuerDomainPolicy = NULL; + */ + data->flags |= POLICY_DATA_FLAG_MAPPED_ANY; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!sk_X509_POLICY_DATA_push(cache->data, data)) { + policy_data_free(data); + goto bad_mapping; + } + } else + data->flags |= POLICY_DATA_FLAG_MAPPED; + if (!sk_ASN1_OBJECT_push(data->expected_policy_set, + map->subjectDomainPolicy)) + goto bad_mapping; + map->subjectDomainPolicy = NULL; + + } + + ret = 1; + bad_mapping: + if (ret == -1) + x->ex_flags |= EXFLAG_INVALID_POLICY; + sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free); + return ret; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c new file mode 100644 index 0000000..dba4861 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c @@ -0,0 +1,189 @@ +/* pcy_node.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include +#include +#include +#include + +#include "pcy_int.h" + +static int node_cmp(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b) +{ + return OBJ_cmp((*a)->data->valid_policy, (*b)->data->valid_policy); +} + +STACK_OF(X509_POLICY_NODE) *policy_node_cmp_new(void) +{ + return sk_X509_POLICY_NODE_new(node_cmp); +} + +X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *nodes, + const ASN1_OBJECT *id) +{ + X509_POLICY_DATA n; + X509_POLICY_NODE l; + size_t idx; + + 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; + + return sk_X509_POLICY_NODE_value(nodes, idx); + +} + +X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, + const X509_POLICY_NODE *parent, + const ASN1_OBJECT *id) +{ + X509_POLICY_NODE *node; + size_t i; + for (i = 0; i < sk_X509_POLICY_NODE_num(level->nodes); i++) { + node = sk_X509_POLICY_NODE_value(level->nodes, i); + if (node->parent == parent) { + if (!OBJ_cmp(node->data->valid_policy, id)) + return node; + } + } + return NULL; +} + +X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, + X509_POLICY_TREE *tree) +{ + X509_POLICY_NODE *node; + node = OPENSSL_malloc(sizeof(X509_POLICY_NODE)); + if (!node) + return NULL; + node->data = data; + node->parent = parent; + node->nchild = 0; + if (level) { + if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { + if (level->anyPolicy) + goto node_error; + level->anyPolicy = node; + } else { + + if (!level->nodes) + level->nodes = policy_node_cmp_new(); + if (!level->nodes) + goto node_error; + if (!sk_X509_POLICY_NODE_push(level->nodes, node)) + goto node_error; + } + } + + if (tree) { + if (!tree->extra_data) + tree->extra_data = sk_X509_POLICY_DATA_new_null(); + if (!tree->extra_data) + goto node_error; + if (!sk_X509_POLICY_DATA_push(tree->extra_data, data)) + goto node_error; + } + + if (parent) + parent->nchild++; + + return node; + + node_error: + policy_node_free(node); + return 0; + +} + +void policy_node_free(X509_POLICY_NODE *node) +{ + OPENSSL_free(node); +} + +/* + * See if a policy node matches a policy OID. If mapping enabled look through + * expected policy set otherwise just valid policy. + */ + +int policy_node_match(const X509_POLICY_LEVEL *lvl, + const X509_POLICY_NODE *node, const ASN1_OBJECT *oid) +{ + size_t i; + ASN1_OBJECT *policy_oid; + const X509_POLICY_DATA *x = node->data; + + if ((lvl->flags & X509_V_FLAG_INHIBIT_MAP) + || !(x->flags & POLICY_DATA_FLAG_MAP_MASK)) { + if (!OBJ_cmp(x->valid_policy, oid)) + return 1; + return 0; + } + + for (i = 0; i < sk_ASN1_OBJECT_num(x->expected_policy_set); i++) { + policy_oid = sk_ASN1_OBJECT_value(x->expected_policy_set, i); + if (!OBJ_cmp(policy_oid, oid)) + return 1; + } + return 0; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back new file mode 100644 index 0000000..6682282 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back @@ -0,0 +1,189 @@ +/* pcy_node.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). */ + +#include +#include +#include +#include +#include + +#include "pcy_int.h" + +static int node_cmp(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b) +{ + return OBJ_cmp((*a)->data->valid_policy, (*b)->data->valid_policy); +} + +STACK_OF(X509_POLICY_NODE) *policy_node_cmp_new(void) +{ + return sk_X509_POLICY_NODE_new(node_cmp); +} + +X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *nodes, + const ASN1_OBJECT *id) +{ + X509_POLICY_DATA n; + X509_POLICY_NODE l; + size_t idx; + + 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; + + return sk_X509_POLICY_NODE_value(nodes, idx); + +} + +X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, + const X509_POLICY_NODE *parent, + const ASN1_OBJECT *id) +{ + X509_POLICY_NODE *node; + size_t i; + for (i = 0; i < sk_X509_POLICY_NODE_num(level->nodes); i++) { + node = sk_X509_POLICY_NODE_value(level->nodes, i); + if (node->parent == parent) { + if (!OBJ_cmp(node->data->valid_policy, id)) + return node; + } + } + return NULL; +} + +X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, + X509_POLICY_TREE *tree) +{ + X509_POLICY_NODE *node; + node = OPENSSL_malloc(sizeof(X509_POLICY_NODE)); + if (!node) + return NULL; + node->data = data; + node->parent = parent; + node->nchild = 0; + if (level) { + if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { + if (level->anyPolicy) + goto node_error; + level->anyPolicy = node; + } else { + + if (!level->nodes) + level->nodes = policy_node_cmp_new(); + if (!level->nodes) + goto node_error; + if (!sk_X509_POLICY_NODE_push(level->nodes, node)) + goto node_error; + } + } + + if (tree) { + if (!tree->extra_data) + tree->extra_data = sk_X509_POLICY_DATA_new_null(); + if (!tree->extra_data) + goto node_error; + if (!sk_X509_POLICY_DATA_push(tree->extra_data, data)) + goto node_error; + } + + if (parent) + parent->nchild++; + + return node; + + node_error: + policy_node_free(node); + return 0; + +} + +void policy_node_free(X509_POLICY_NODE *node) +{ + OPENSSL_free(node); +} + +/* + * See if a policy node matches a policy OID. If mapping enabled look through + * expected policy set otherwise just valid policy. + */ + +int policy_node_match(const X509_POLICY_LEVEL *lvl, + const X509_POLICY_NODE *node, const ASN1_OBJECT *oid) +{ + size_t i; + ASN1_OBJECT *policy_oid; + const X509_POLICY_DATA *x = node->data; + + if ((lvl->flags & X509_V_FLAG_INHIBIT_MAP) + || !(x->flags & POLICY_DATA_FLAG_MAP_MASK)) { + if (!OBJ_cmp(x->valid_policy, oid)) + return 1; + return 0; + } + + for (i = 0; i < sk_ASN1_OBJECT_num(x->expected_policy_set); i++) { + policy_oid = sk_ASN1_OBJECT_value(x->expected_policy_set, i); + if (!OBJ_cmp(policy_oid, oid)) + return 1; + } + return 0; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c new file mode 100644 index 0000000..9436172 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c @@ -0,0 +1,842 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "pcy_int.h" +#include "../internal.h" + +/* + * Enable this to print out the complete policy tree at various point during + * evaluation. + */ + +/* + * #define OPENSSL_POLICY_DEBUG + */ + +#ifdef OPENSSL_POLICY_DEBUG + +static void expected_print(BIO *err, X509_POLICY_LEVEL *lev, + X509_POLICY_NODE *node, int indent) +{ + if ((lev->flags & X509_V_FLAG_INHIBIT_MAP) + || !(node->data->flags & POLICY_DATA_FLAG_MAP_MASK)) + BIO_puts(err, " Not Mapped\n"); + else { + int i; + STACK_OF(ASN1_OBJECT) *pset = node->data->expected_policy_set; + ASN1_OBJECT *oid; + BIO_puts(err, " Expected: "); + for (i = 0; i < sk_ASN1_OBJECT_num(pset); i++) { + oid = sk_ASN1_OBJECT_value(pset, i); + if (i) + BIO_puts(err, ", "); + i2a_ASN1_OBJECT(err, oid); + } + BIO_puts(err, "\n"); + } +} + +static void tree_print(char *str, X509_POLICY_TREE *tree, + X509_POLICY_LEVEL *curr) +{ + X509_POLICY_LEVEL *plev; + X509_POLICY_NODE *node; + int i; + BIO *err; + err = BIO_new_fp(stderr, BIO_NOCLOSE); + if (!curr) + curr = tree->levels + tree->nlevel; + else + curr++; + BIO_printf(err, "Level print after %s\n", str); + BIO_printf(err, "Printing Up to Level %ld\n", curr - tree->levels); + for (plev = tree->levels; plev != curr; plev++) { + BIO_printf(err, "Level %ld, flags = %x\n", + plev - tree->levels, plev->flags); + for (i = 0; i < sk_X509_POLICY_NODE_num(plev->nodes); i++) { + node = sk_X509_POLICY_NODE_value(plev->nodes, i); + X509_POLICY_NODE_print(err, node, 2); + expected_print(err, plev, node, 2); + BIO_printf(err, " Flags: %x\n", node->data->flags); + } + if (plev->anyPolicy) + X509_POLICY_NODE_print(err, plev->anyPolicy, 2); + } + + BIO_free(err); + +} +#else + +# define tree_print(a,b,c) /* */ + +#endif + +/*- + * Initialize policy tree. Return values: + * 0 Some internal error occurred. + * -1 Inconsistent or invalid extensions in certificates. + * 1 Tree initialized OK. + * 2 Policy tree is empty. + * 5 Tree OK and requireExplicitPolicy true. + * 6 Tree empty and requireExplicitPolicy true. + */ + +static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, + unsigned int flags) +{ + X509_POLICY_TREE *tree; + X509_POLICY_LEVEL *level; + const X509_POLICY_CACHE *cache; + X509_POLICY_DATA *data = NULL; + X509 *x; + int ret = 1; + int i, n; + int explicit_policy; + int any_skip; + int map_skip; + *ptree = NULL; + n = sk_X509_num(certs); + +#if 0 + /* Disable policy mapping for now... */ + flags |= X509_V_FLAG_INHIBIT_MAP; +#endif + + if (flags & X509_V_FLAG_EXPLICIT_POLICY) + explicit_policy = 0; + else + explicit_policy = n + 1; + + if (flags & X509_V_FLAG_INHIBIT_ANY) + any_skip = 0; + else + any_skip = n + 1; + + if (flags & X509_V_FLAG_INHIBIT_MAP) + map_skip = 0; + else + map_skip = n + 1; + + /* Can't do anything with just a trust anchor */ + if (n == 1) + return 1; + /* + * First setup policy cache in all certificates apart from the trust + * anchor. Note any bad cache results on the way. Also can calculate + * explicit_policy value at this point. + */ + for (i = n - 2; i >= 0; i--) { + x = sk_X509_value(certs, i); + X509_check_purpose(x, -1, -1); + cache = policy_cache_set(x); + /* If cache NULL something bad happened: return immediately */ + if (cache == NULL) + return 0; + /* + * If inconsistent extensions keep a note of it but continue + */ + if (x->ex_flags & EXFLAG_INVALID_POLICY) + ret = -1; + /* + * Otherwise if we have no data (hence no CertificatePolicies) and + * haven't already set an inconsistent code note it. + */ + else if ((ret == 1) && !cache->data) + ret = 2; + if (explicit_policy > 0) { + if (!(x->ex_flags & EXFLAG_SI)) + explicit_policy--; + if ((cache->explicit_skip != -1) + && (cache->explicit_skip < explicit_policy)) + explicit_policy = cache->explicit_skip; + } + } + + if (ret != 1) { + if (ret == 2 && !explicit_policy) + return 6; + return ret; + } + + /* If we get this far initialize the tree */ + + tree = OPENSSL_malloc(sizeof(X509_POLICY_TREE)); + + if (!tree) + return 0; + + tree->flags = 0; + tree->levels = OPENSSL_malloc(sizeof(X509_POLICY_LEVEL) * n); + tree->nlevel = 0; + tree->extra_data = NULL; + tree->auth_policies = NULL; + tree->user_policies = NULL; + + if (!tree->levels) { + OPENSSL_free(tree); + return 0; + } + + OPENSSL_memset(tree->levels, 0, n * sizeof(X509_POLICY_LEVEL)); + + tree->nlevel = n; + + level = tree->levels; + + /* Root data: initialize to anyPolicy */ + + data = policy_data_new(NULL, OBJ_nid2obj(NID_any_policy), 0); + + if (!data || !level_add_node(level, data, NULL, tree)) + goto bad_tree; + + for (i = n - 2; i >= 0; i--) { + level++; + x = sk_X509_value(certs, i); + cache = policy_cache_set(x); + X509_up_ref(x); + level->cert = x; + + if (!cache->anyPolicy) + level->flags |= X509_V_FLAG_INHIBIT_ANY; + + /* Determine inhibit any and inhibit map flags */ + if (any_skip == 0) { + /* + * Any matching allowed if certificate is self issued and not the + * last in the chain. + */ + if (!(x->ex_flags & EXFLAG_SI) || (i == 0)) + level->flags |= X509_V_FLAG_INHIBIT_ANY; + } else { + if (!(x->ex_flags & EXFLAG_SI)) + any_skip--; + if ((cache->any_skip >= 0) + && (cache->any_skip < any_skip)) + any_skip = cache->any_skip; + } + + if (map_skip == 0) + level->flags |= X509_V_FLAG_INHIBIT_MAP; + else { + if (!(x->ex_flags & EXFLAG_SI)) + map_skip--; + if ((cache->map_skip >= 0) + && (cache->map_skip < map_skip)) + map_skip = cache->map_skip; + } + + } + + *ptree = tree; + + if (explicit_policy) + return 1; + else + return 5; + + bad_tree: + + X509_policy_tree_free(tree); + + return 0; + +} + +static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, + X509_POLICY_DATA *data) +{ + X509_POLICY_LEVEL *last = curr - 1; + X509_POLICY_NODE *node; + int matched = 0; + size_t i; + /* Iterate through all in nodes linking matches */ + for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) { + node = sk_X509_POLICY_NODE_value(last->nodes, i); + if (policy_node_match(last, node, data->valid_policy)) { + if (!level_add_node(curr, data, node, NULL)) + return 0; + matched = 1; + } + } + if (!matched && last->anyPolicy) { + if (!level_add_node(curr, data, last->anyPolicy, NULL)) + return 0; + } + return 1; +} + +/* + * This corresponds to RFC3280 6.1.3(d)(1): link any data from + * CertificatePolicies onto matching parent or anyPolicy if no match. + */ + +static int tree_link_nodes(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache) +{ + size_t i; + X509_POLICY_DATA *data; + + for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) { + data = sk_X509_POLICY_DATA_value(cache->data, i); + /* + * If a node is mapped any it doesn't have a corresponding + * CertificatePolicies entry. However such an identical node would + * be created if anyPolicy matching is enabled because there would be + * no match with the parent valid_policy_set. So we create link + * because then it will have the mapping flags right and we can prune + * it later. + */ +#if 0 + if ((data->flags & POLICY_DATA_FLAG_MAPPED_ANY) + && !(curr->flags & X509_V_FLAG_INHIBIT_ANY)) + continue; +#endif + /* Look for matching nodes in previous level */ + if (!tree_link_matching_nodes(curr, data)) + return 0; + } + return 1; +} + +/* + * This corresponds to RFC3280 6.1.3(d)(2): Create new data for any unmatched + * policies in the parent and link to anyPolicy. + */ + +static int tree_add_unmatched(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id, + X509_POLICY_NODE *node, X509_POLICY_TREE *tree) +{ + X509_POLICY_DATA *data; + if (id == NULL) + id = node->data->valid_policy; + /* + * Create a new node with qualifiers from anyPolicy and id from unmatched + * node. + */ + data = policy_data_new(NULL, id, node_critical(node)); + + if (data == NULL) + return 0; + /* Curr may not have anyPolicy */ + data->qualifier_set = cache->anyPolicy->qualifier_set; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!level_add_node(curr, data, node, tree)) { + policy_data_free(data); + return 0; + } + + return 1; +} + +static int tree_link_unmatched(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + X509_POLICY_NODE *node, X509_POLICY_TREE *tree) +{ + const X509_POLICY_LEVEL *last = curr - 1; + size_t i; + + if ((last->flags & X509_V_FLAG_INHIBIT_MAP) + || !(node->data->flags & POLICY_DATA_FLAG_MAPPED)) { + /* If no policy mapping: matched if one child present */ + if (node->nchild) + return 1; + if (!tree_add_unmatched(curr, cache, NULL, node, tree)) + return 0; + /* Add it */ + } else { + /* If mapping: matched if one child per expected policy set */ + STACK_OF(ASN1_OBJECT) *expset = node->data->expected_policy_set; + if ((size_t)node->nchild == sk_ASN1_OBJECT_num(expset)) + return 1; + /* Locate unmatched nodes */ + for (i = 0; i < sk_ASN1_OBJECT_num(expset); i++) { + ASN1_OBJECT *oid = sk_ASN1_OBJECT_value(expset, i); + if (level_find_node(curr, node, oid)) + continue; + if (!tree_add_unmatched(curr, cache, oid, node, tree)) + return 0; + } + + } + + return 1; + +} + +static int tree_link_any(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + X509_POLICY_TREE *tree) +{ + size_t i; + /* + * X509_POLICY_DATA *data; + */ + X509_POLICY_NODE *node; + X509_POLICY_LEVEL *last = curr - 1; + + for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) { + node = sk_X509_POLICY_NODE_value(last->nodes, i); + + if (!tree_link_unmatched(curr, cache, node, tree)) + return 0; + +#if 0 + + /* + * Skip any node with any children: we only want unmathced nodes. + * Note: need something better for policy mapping because each node + * may have multiple children + */ + if (node->nchild) + continue; + + /* + * Create a new node with qualifiers from anyPolicy and id from + * unmatched node. + */ + data = policy_data_new(NULL, node->data->valid_policy, + node_critical(node)); + + if (data == NULL) + return 0; + /* Curr may not have anyPolicy */ + data->qualifier_set = cache->anyPolicy->qualifier_set; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!level_add_node(curr, data, node, tree)) { + policy_data_free(data); + return 0; + } +#endif + + } + /* Finally add link to anyPolicy */ + if (last->anyPolicy) { + if (!level_add_node(curr, cache->anyPolicy, last->anyPolicy, NULL)) + return 0; + } + return 1; +} + +/* + * Prune the tree: delete any child mapped child data on the current level + * then proceed up the tree deleting any data with no children. If we ever + * have no data on a level we can halt because the tree will be empty. + */ + +static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) +{ + STACK_OF(X509_POLICY_NODE) *nodes; + X509_POLICY_NODE *node; + int i; + nodes = curr->nodes; + if (curr->flags & X509_V_FLAG_INHIBIT_MAP) { + for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) { + node = sk_X509_POLICY_NODE_value(nodes, i); + /* Delete any mapped data: see RFC3280 XXXX */ + if (node->data->flags & POLICY_DATA_FLAG_MAP_MASK) { + node->parent->nchild--; + OPENSSL_free(node); + (void)sk_X509_POLICY_NODE_delete(nodes, i); + } + } + } + + for (;;) { + --curr; + nodes = curr->nodes; + for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) { + node = sk_X509_POLICY_NODE_value(nodes, i); + if (node->nchild == 0) { + node->parent->nchild--; + OPENSSL_free(node); + (void)sk_X509_POLICY_NODE_delete(nodes, i); + } + } + if (curr->anyPolicy && !curr->anyPolicy->nchild) { + if (curr->anyPolicy->parent) + curr->anyPolicy->parent->nchild--; + OPENSSL_free(curr->anyPolicy); + curr->anyPolicy = NULL; + } + if (curr == tree->levels) { + /* If we zapped anyPolicy at top then tree is empty */ + if (!curr->anyPolicy) + return 2; + return 1; + } + } + +} + +static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes, + X509_POLICY_NODE *pcy) +{ + if (!*pnodes) { + *pnodes = policy_node_cmp_new(); + if (!*pnodes) + return 0; + } 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; + + return 1; + +} + +/* + * Calculate the authority set based on policy tree. The 'pnodes' parameter + * is used as a store for the set of policy nodes used to calculate the user + * set. If the authority set is not anyPolicy then pnodes will just point to + * the authority set. If however the authority set is anyPolicy then the set + * of valid policies (other than anyPolicy) is store in pnodes. The return + * value of '2' is used in this case to indicate that pnodes should be freed. + */ + +static int tree_calculate_authority_set(X509_POLICY_TREE *tree, + STACK_OF(X509_POLICY_NODE) **pnodes) +{ + X509_POLICY_LEVEL *curr; + X509_POLICY_NODE *node, *anyptr; + STACK_OF(X509_POLICY_NODE) **addnodes; + int i; + size_t j; + curr = tree->levels + tree->nlevel - 1; + + /* If last level contains anyPolicy set is anyPolicy */ + if (curr->anyPolicy) { + if (!tree_add_auth_node(&tree->auth_policies, curr->anyPolicy)) + return 0; + addnodes = pnodes; + } else + /* Add policies to authority set */ + addnodes = &tree->auth_policies; + + curr = tree->levels; + for (i = 1; i < tree->nlevel; i++) { + /* + * If no anyPolicy node on this this level it can't appear on lower + * levels so end search. + */ + if (!(anyptr = curr->anyPolicy)) + break; + curr++; + for (j = 0; j < sk_X509_POLICY_NODE_num(curr->nodes); j++) { + node = sk_X509_POLICY_NODE_value(curr->nodes, j); + if ((node->parent == anyptr) + && !tree_add_auth_node(addnodes, node)) + return 0; + } + } + + if (addnodes == pnodes) + return 2; + + *pnodes = tree->auth_policies; + + return 1; +} + +static int tree_calculate_user_set(X509_POLICY_TREE *tree, + STACK_OF(ASN1_OBJECT) *policy_oids, + STACK_OF(X509_POLICY_NODE) *auth_nodes) +{ + size_t i; + X509_POLICY_NODE *node; + ASN1_OBJECT *oid; + + X509_POLICY_NODE *anyPolicy; + X509_POLICY_DATA *extra; + + /* + * Check if anyPolicy present in authority constrained policy set: this + * will happen if it is a leaf node. + */ + + if (sk_ASN1_OBJECT_num(policy_oids) <= 0) + return 1; + + anyPolicy = tree->levels[tree->nlevel - 1].anyPolicy; + + for (i = 0; i < sk_ASN1_OBJECT_num(policy_oids); i++) { + oid = sk_ASN1_OBJECT_value(policy_oids, i); + if (OBJ_obj2nid(oid) == NID_any_policy) { + tree->flags |= POLICY_FLAG_ANY_POLICY; + return 1; + } + } + + for (i = 0; i < sk_ASN1_OBJECT_num(policy_oids); i++) { + oid = sk_ASN1_OBJECT_value(policy_oids, i); + node = tree_find_sk(auth_nodes, oid); + if (!node) { + if (!anyPolicy) + continue; + /* + * Create a new node with policy ID from user set and qualifiers + * from anyPolicy. + */ + extra = policy_data_new(NULL, oid, node_critical(anyPolicy)); + if (!extra) + return 0; + extra->qualifier_set = anyPolicy->data->qualifier_set; + extra->flags = POLICY_DATA_FLAG_SHARED_QUALIFIERS + | POLICY_DATA_FLAG_EXTRA_NODE; + node = level_add_node(NULL, extra, anyPolicy->parent, tree); + } + if (!tree->user_policies) { + tree->user_policies = sk_X509_POLICY_NODE_new_null(); + if (!tree->user_policies) + return 1; + } + if (!sk_X509_POLICY_NODE_push(tree->user_policies, node)) + return 0; + } + return 1; + +} + +static int tree_evaluate(X509_POLICY_TREE *tree) +{ + int ret, i; + X509_POLICY_LEVEL *curr = tree->levels + 1; + const X509_POLICY_CACHE *cache; + + for (i = 1; i < tree->nlevel; i++, curr++) { + cache = policy_cache_set(curr->cert); + if (!tree_link_nodes(curr, cache)) + return 0; + + if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) + && !tree_link_any(curr, cache, tree)) + return 0; + tree_print("before tree_prune()", tree, curr); + ret = tree_prune(tree, curr); + if (ret != 1) + return ret; + } + + return 1; + +} + +static void exnode_free(X509_POLICY_NODE *node) +{ + if (node->data && (node->data->flags & POLICY_DATA_FLAG_EXTRA_NODE)) + OPENSSL_free(node); +} + +void X509_policy_tree_free(X509_POLICY_TREE *tree) +{ + X509_POLICY_LEVEL *curr; + int i; + + if (!tree) + return; + + sk_X509_POLICY_NODE_free(tree->auth_policies); + sk_X509_POLICY_NODE_pop_free(tree->user_policies, exnode_free); + + for (i = 0, curr = tree->levels; i < tree->nlevel; i++, curr++) { + if (curr->cert) + X509_free(curr->cert); + if (curr->nodes) + sk_X509_POLICY_NODE_pop_free(curr->nodes, policy_node_free); + if (curr->anyPolicy) + policy_node_free(curr->anyPolicy); + } + + if (tree->extra_data) + sk_X509_POLICY_DATA_pop_free(tree->extra_data, policy_data_free); + + OPENSSL_free(tree->levels); + OPENSSL_free(tree); + +} + +/*- + * Application policy checking function. + * Return codes: + * 0 Internal Error. + * 1 Successful. + * -1 One or more certificates contain invalid or inconsistent extensions + * -2 User constrained policy set empty and requireExplicit true. + */ + +int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags) +{ + int ret; + int calc_ret; + X509_POLICY_TREE *tree = NULL; + STACK_OF(X509_POLICY_NODE) *nodes, *auth_nodes = NULL; + *ptree = NULL; + + *pexplicit_policy = 0; + ret = tree_init(&tree, certs, flags); + + switch (ret) { + + /* Tree empty requireExplicit False: OK */ + case 2: + return 1; + + /* Some internal error */ + case -1: + return -1; + + /* Some internal error */ + case 0: + return 0; + + /* Tree empty requireExplicit True: Error */ + + case 6: + *pexplicit_policy = 1; + return -2; + + /* Tree OK requireExplicit True: OK and continue */ + case 5: + *pexplicit_policy = 1; + break; + + /* Tree OK: continue */ + + case 1: + if (!tree) + /* + * tree_init() returns success and a null tree + * if it's just looking at a trust anchor. + * I'm not sure that returning success here is + * correct, but I'm sure that reporting this + * as an internal error which our caller + * interprets as a malloc failure is wrong. + */ + return 1; + break; + } + + if (!tree) + goto error; + ret = tree_evaluate(tree); + + tree_print("tree_evaluate()", tree, NULL); + + if (ret <= 0) + goto error; + + /* Return value 2 means tree empty */ + if (ret == 2) { + X509_policy_tree_free(tree); + if (*pexplicit_policy) + return -2; + else + return 1; + } + + /* Tree is not empty: continue */ + + calc_ret = tree_calculate_authority_set(tree, &auth_nodes); + + if (!calc_ret) + goto error; + + ret = tree_calculate_user_set(tree, policy_oids, auth_nodes); + + if (calc_ret == 2) + sk_X509_POLICY_NODE_free(auth_nodes); + + if (!ret) + goto error; + + + if (tree) + *ptree = tree; + + if (*pexplicit_policy) { + nodes = X509_policy_tree_get0_user_policies(tree); + if (sk_X509_POLICY_NODE_num(nodes) <= 0) + return -2; + } + + return 1; + + error: + + X509_policy_tree_free(tree); + + return 0; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back new file mode 100644 index 0000000..136b45f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back @@ -0,0 +1,842 @@ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2004. + */ +/* ==================================================================== + * Copyright (c) 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). + * + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "pcy_int.h" +#include "../internal.h" + +/* + * Enable this to print out the complete policy tree at various point during + * evaluation. + */ + +/* + * #define OPENSSL_POLICY_DEBUG + */ + +#ifdef OPENSSL_POLICY_DEBUG + +static void expected_print(BIO *err, X509_POLICY_LEVEL *lev, + X509_POLICY_NODE *node, int indent) +{ + if ((lev->flags & X509_V_FLAG_INHIBIT_MAP) + || !(node->data->flags & POLICY_DATA_FLAG_MAP_MASK)) + BIO_puts(err, " Not Mapped\n"); + else { + int i; + STACK_OF(ASN1_OBJECT) *pset = node->data->expected_policy_set; + ASN1_OBJECT *oid; + BIO_puts(err, " Expected: "); + for (i = 0; i < sk_ASN1_OBJECT_num(pset); i++) { + oid = sk_ASN1_OBJECT_value(pset, i); + if (i) + BIO_puts(err, ", "); + i2a_ASN1_OBJECT(err, oid); + } + BIO_puts(err, "\n"); + } +} + +static void tree_print(char *str, X509_POLICY_TREE *tree, + X509_POLICY_LEVEL *curr) +{ + X509_POLICY_LEVEL *plev; + X509_POLICY_NODE *node; + int i; + BIO *err; + err = BIO_new_fp(stderr, BIO_NOCLOSE); + if (!curr) + curr = tree->levels + tree->nlevel; + else + curr++; + BIO_printf(err, "Level print after %s\n", str); + BIO_printf(err, "Printing Up to Level %ld\n", curr - tree->levels); + for (plev = tree->levels; plev != curr; plev++) { + BIO_printf(err, "Level %ld, flags = %x\n", + plev - tree->levels, plev->flags); + for (i = 0; i < sk_X509_POLICY_NODE_num(plev->nodes); i++) { + node = sk_X509_POLICY_NODE_value(plev->nodes, i); + X509_POLICY_NODE_print(err, node, 2); + expected_print(err, plev, node, 2); + BIO_printf(err, " Flags: %x\n", node->data->flags); + } + if (plev->anyPolicy) + X509_POLICY_NODE_print(err, plev->anyPolicy, 2); + } + + BIO_free(err); + +} +#else + +# define tree_print(a,b,c) /* */ + +#endif + +/*- + * Initialize policy tree. Return values: + * 0 Some internal error occurred. + * -1 Inconsistent or invalid extensions in certificates. + * 1 Tree initialized OK. + * 2 Policy tree is empty. + * 5 Tree OK and requireExplicitPolicy true. + * 6 Tree empty and requireExplicitPolicy true. + */ + +static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, + unsigned int flags) +{ + X509_POLICY_TREE *tree; + X509_POLICY_LEVEL *level; + const X509_POLICY_CACHE *cache; + X509_POLICY_DATA *data = NULL; + X509 *x; + int ret = 1; + int i, n; + int explicit_policy; + int any_skip; + int map_skip; + *ptree = NULL; + n = sk_X509_num(certs); + +#if 0 + /* Disable policy mapping for now... */ + flags |= X509_V_FLAG_INHIBIT_MAP; +#endif + + if (flags & X509_V_FLAG_EXPLICIT_POLICY) + explicit_policy = 0; + else + explicit_policy = n + 1; + + if (flags & X509_V_FLAG_INHIBIT_ANY) + any_skip = 0; + else + any_skip = n + 1; + + if (flags & X509_V_FLAG_INHIBIT_MAP) + map_skip = 0; + else + map_skip = n + 1; + + /* Can't do anything with just a trust anchor */ + if (n == 1) + return 1; + /* + * First setup policy cache in all certificates apart from the trust + * anchor. Note any bad cache results on the way. Also can calculate + * explicit_policy value at this point. + */ + for (i = n - 2; i >= 0; i--) { + x = sk_X509_value(certs, i); + X509_check_purpose(x, -1, -1); + cache = policy_cache_set(x); + /* If cache NULL something bad happened: return immediately */ + if (cache == NULL) + return 0; + /* + * If inconsistent extensions keep a note of it but continue + */ + if (x->ex_flags & EXFLAG_INVALID_POLICY) + ret = -1; + /* + * Otherwise if we have no data (hence no CertificatePolicies) and + * haven't already set an inconsistent code note it. + */ + else if ((ret == 1) && !cache->data) + ret = 2; + if (explicit_policy > 0) { + if (!(x->ex_flags & EXFLAG_SI)) + explicit_policy--; + if ((cache->explicit_skip != -1) + && (cache->explicit_skip < explicit_policy)) + explicit_policy = cache->explicit_skip; + } + } + + if (ret != 1) { + if (ret == 2 && !explicit_policy) + return 6; + return ret; + } + + /* If we get this far initialize the tree */ + + tree = OPENSSL_malloc(sizeof(X509_POLICY_TREE)); + + if (!tree) + return 0; + + tree->flags = 0; + tree->levels = OPENSSL_malloc(sizeof(X509_POLICY_LEVEL) * n); + tree->nlevel = 0; + tree->extra_data = NULL; + tree->auth_policies = NULL; + tree->user_policies = NULL; + + if (!tree->levels) { + OPENSSL_free(tree); + return 0; + } + + OPENSSL_memset(tree->levels, 0, n * sizeof(X509_POLICY_LEVEL)); + + tree->nlevel = n; + + level = tree->levels; + + /* Root data: initialize to anyPolicy */ + + data = policy_data_new(NULL, OBJ_nid2obj(NID_any_policy), 0); + + if (!data || !level_add_node(level, data, NULL, tree)) + goto bad_tree; + + for (i = n - 2; i >= 0; i--) { + level++; + x = sk_X509_value(certs, i); + cache = policy_cache_set(x); + X509_up_ref(x); + level->cert = x; + + if (!cache->anyPolicy) + level->flags |= X509_V_FLAG_INHIBIT_ANY; + + /* Determine inhibit any and inhibit map flags */ + if (any_skip == 0) { + /* + * Any matching allowed if certificate is self issued and not the + * last in the chain. + */ + if (!(x->ex_flags & EXFLAG_SI) || (i == 0)) + level->flags |= X509_V_FLAG_INHIBIT_ANY; + } else { + if (!(x->ex_flags & EXFLAG_SI)) + any_skip--; + if ((cache->any_skip >= 0) + && (cache->any_skip < any_skip)) + any_skip = cache->any_skip; + } + + if (map_skip == 0) + level->flags |= X509_V_FLAG_INHIBIT_MAP; + else { + if (!(x->ex_flags & EXFLAG_SI)) + map_skip--; + if ((cache->map_skip >= 0) + && (cache->map_skip < map_skip)) + map_skip = cache->map_skip; + } + + } + + *ptree = tree; + + if (explicit_policy) + return 1; + else + return 5; + + bad_tree: + + X509_policy_tree_free(tree); + + return 0; + +} + +static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, + X509_POLICY_DATA *data) +{ + X509_POLICY_LEVEL *last = curr - 1; + X509_POLICY_NODE *node; + int matched = 0; + size_t i; + /* Iterate through all in nodes linking matches */ + for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) { + node = sk_X509_POLICY_NODE_value(last->nodes, i); + if (policy_node_match(last, node, data->valid_policy)) { + if (!level_add_node(curr, data, node, NULL)) + return 0; + matched = 1; + } + } + if (!matched && last->anyPolicy) { + if (!level_add_node(curr, data, last->anyPolicy, NULL)) + return 0; + } + return 1; +} + +/* + * This corresponds to RFC3280 6.1.3(d)(1): link any data from + * CertificatePolicies onto matching parent or anyPolicy if no match. + */ + +static int tree_link_nodes(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache) +{ + size_t i; + X509_POLICY_DATA *data; + + for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) { + data = sk_X509_POLICY_DATA_value(cache->data, i); + /* + * If a node is mapped any it doesn't have a corresponding + * CertificatePolicies entry. However such an identical node would + * be created if anyPolicy matching is enabled because there would be + * no match with the parent valid_policy_set. So we create link + * because then it will have the mapping flags right and we can prune + * it later. + */ +#if 0 + if ((data->flags & POLICY_DATA_FLAG_MAPPED_ANY) + && !(curr->flags & X509_V_FLAG_INHIBIT_ANY)) + continue; +#endif + /* Look for matching nodes in previous level */ + if (!tree_link_matching_nodes(curr, data)) + return 0; + } + return 1; +} + +/* + * This corresponds to RFC3280 6.1.3(d)(2): Create new data for any unmatched + * policies in the parent and link to anyPolicy. + */ + +static int tree_add_unmatched(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + const ASN1_OBJECT *id, + X509_POLICY_NODE *node, X509_POLICY_TREE *tree) +{ + X509_POLICY_DATA *data; + if (id == NULL) + id = node->data->valid_policy; + /* + * Create a new node with qualifiers from anyPolicy and id from unmatched + * node. + */ + data = policy_data_new(NULL, id, node_critical(node)); + + if (data == NULL) + return 0; + /* Curr may not have anyPolicy */ + data->qualifier_set = cache->anyPolicy->qualifier_set; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!level_add_node(curr, data, node, tree)) { + policy_data_free(data); + return 0; + } + + return 1; +} + +static int tree_link_unmatched(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + X509_POLICY_NODE *node, X509_POLICY_TREE *tree) +{ + const X509_POLICY_LEVEL *last = curr - 1; + size_t i; + + if ((last->flags & X509_V_FLAG_INHIBIT_MAP) + || !(node->data->flags & POLICY_DATA_FLAG_MAPPED)) { + /* If no policy mapping: matched if one child present */ + if (node->nchild) + return 1; + if (!tree_add_unmatched(curr, cache, NULL, node, tree)) + return 0; + /* Add it */ + } else { + /* If mapping: matched if one child per expected policy set */ + STACK_OF(ASN1_OBJECT) *expset = node->data->expected_policy_set; + if ((size_t)node->nchild == sk_ASN1_OBJECT_num(expset)) + return 1; + /* Locate unmatched nodes */ + for (i = 0; i < sk_ASN1_OBJECT_num(expset); i++) { + ASN1_OBJECT *oid = sk_ASN1_OBJECT_value(expset, i); + if (level_find_node(curr, node, oid)) + continue; + if (!tree_add_unmatched(curr, cache, oid, node, tree)) + return 0; + } + + } + + return 1; + +} + +static int tree_link_any(X509_POLICY_LEVEL *curr, + const X509_POLICY_CACHE *cache, + X509_POLICY_TREE *tree) +{ + size_t i; + /* + * X509_POLICY_DATA *data; + */ + X509_POLICY_NODE *node; + X509_POLICY_LEVEL *last = curr - 1; + + for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) { + node = sk_X509_POLICY_NODE_value(last->nodes, i); + + if (!tree_link_unmatched(curr, cache, node, tree)) + return 0; + +#if 0 + + /* + * Skip any node with any children: we only want unmathced nodes. + * Note: need something better for policy mapping because each node + * may have multiple children + */ + if (node->nchild) + continue; + + /* + * Create a new node with qualifiers from anyPolicy and id from + * unmatched node. + */ + data = policy_data_new(NULL, node->data->valid_policy, + node_critical(node)); + + if (data == NULL) + return 0; + /* Curr may not have anyPolicy */ + data->qualifier_set = cache->anyPolicy->qualifier_set; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; + if (!level_add_node(curr, data, node, tree)) { + policy_data_free(data); + return 0; + } +#endif + + } + /* Finally add link to anyPolicy */ + if (last->anyPolicy) { + if (!level_add_node(curr, cache->anyPolicy, last->anyPolicy, NULL)) + return 0; + } + return 1; +} + +/* + * Prune the tree: delete any child mapped child data on the current level + * then proceed up the tree deleting any data with no children. If we ever + * have no data on a level we can halt because the tree will be empty. + */ + +static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) +{ + STACK_OF(X509_POLICY_NODE) *nodes; + X509_POLICY_NODE *node; + int i; + nodes = curr->nodes; + if (curr->flags & X509_V_FLAG_INHIBIT_MAP) { + for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) { + node = sk_X509_POLICY_NODE_value(nodes, i); + /* Delete any mapped data: see RFC3280 XXXX */ + if (node->data->flags & POLICY_DATA_FLAG_MAP_MASK) { + node->parent->nchild--; + OPENSSL_free(node); + (void)sk_X509_POLICY_NODE_delete(nodes, i); + } + } + } + + for (;;) { + --curr; + nodes = curr->nodes; + for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) { + node = sk_X509_POLICY_NODE_value(nodes, i); + if (node->nchild == 0) { + node->parent->nchild--; + OPENSSL_free(node); + (void)sk_X509_POLICY_NODE_delete(nodes, i); + } + } + if (curr->anyPolicy && !curr->anyPolicy->nchild) { + if (curr->anyPolicy->parent) + curr->anyPolicy->parent->nchild--; + OPENSSL_free(curr->anyPolicy); + curr->anyPolicy = NULL; + } + if (curr == tree->levels) { + /* If we zapped anyPolicy at top then tree is empty */ + if (!curr->anyPolicy) + return 2; + return 1; + } + } + +} + +static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes, + X509_POLICY_NODE *pcy) +{ + if (!*pnodes) { + *pnodes = policy_node_cmp_new(); + if (!*pnodes) + return 0; + } 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; + + return 1; + +} + +/* + * Calculate the authority set based on policy tree. The 'pnodes' parameter + * is used as a store for the set of policy nodes used to calculate the user + * set. If the authority set is not anyPolicy then pnodes will just point to + * the authority set. If however the authority set is anyPolicy then the set + * of valid policies (other than anyPolicy) is store in pnodes. The return + * value of '2' is used in this case to indicate that pnodes should be freed. + */ + +static int tree_calculate_authority_set(X509_POLICY_TREE *tree, + STACK_OF(X509_POLICY_NODE) **pnodes) +{ + X509_POLICY_LEVEL *curr; + X509_POLICY_NODE *node, *anyptr; + STACK_OF(X509_POLICY_NODE) **addnodes; + int i; + size_t j; + curr = tree->levels + tree->nlevel - 1; + + /* If last level contains anyPolicy set is anyPolicy */ + if (curr->anyPolicy) { + if (!tree_add_auth_node(&tree->auth_policies, curr->anyPolicy)) + return 0; + addnodes = pnodes; + } else + /* Add policies to authority set */ + addnodes = &tree->auth_policies; + + curr = tree->levels; + for (i = 1; i < tree->nlevel; i++) { + /* + * If no anyPolicy node on this this level it can't appear on lower + * levels so end search. + */ + if (!(anyptr = curr->anyPolicy)) + break; + curr++; + for (j = 0; j < sk_X509_POLICY_NODE_num(curr->nodes); j++) { + node = sk_X509_POLICY_NODE_value(curr->nodes, j); + if ((node->parent == anyptr) + && !tree_add_auth_node(addnodes, node)) + return 0; + } + } + + if (addnodes == pnodes) + return 2; + + *pnodes = tree->auth_policies; + + return 1; +} + +static int tree_calculate_user_set(X509_POLICY_TREE *tree, + STACK_OF(ASN1_OBJECT) *policy_oids, + STACK_OF(X509_POLICY_NODE) *auth_nodes) +{ + size_t i; + X509_POLICY_NODE *node; + ASN1_OBJECT *oid; + + X509_POLICY_NODE *anyPolicy; + X509_POLICY_DATA *extra; + + /* + * Check if anyPolicy present in authority constrained policy set: this + * will happen if it is a leaf node. + */ + + if (sk_ASN1_OBJECT_num(policy_oids) <= 0) + return 1; + + anyPolicy = tree->levels[tree->nlevel - 1].anyPolicy; + + for (i = 0; i < sk_ASN1_OBJECT_num(policy_oids); i++) { + oid = sk_ASN1_OBJECT_value(policy_oids, i); + if (OBJ_obj2nid(oid) == NID_any_policy) { + tree->flags |= POLICY_FLAG_ANY_POLICY; + return 1; + } + } + + for (i = 0; i < sk_ASN1_OBJECT_num(policy_oids); i++) { + oid = sk_ASN1_OBJECT_value(policy_oids, i); + node = tree_find_sk(auth_nodes, oid); + if (!node) { + if (!anyPolicy) + continue; + /* + * Create a new node with policy ID from user set and qualifiers + * from anyPolicy. + */ + extra = policy_data_new(NULL, oid, node_critical(anyPolicy)); + if (!extra) + return 0; + extra->qualifier_set = anyPolicy->data->qualifier_set; + extra->flags = POLICY_DATA_FLAG_SHARED_QUALIFIERS + | POLICY_DATA_FLAG_EXTRA_NODE; + node = level_add_node(NULL, extra, anyPolicy->parent, tree); + } + if (!tree->user_policies) { + tree->user_policies = sk_X509_POLICY_NODE_new_null(); + if (!tree->user_policies) + return 1; + } + if (!sk_X509_POLICY_NODE_push(tree->user_policies, node)) + return 0; + } + return 1; + +} + +static int tree_evaluate(X509_POLICY_TREE *tree) +{ + int ret, i; + X509_POLICY_LEVEL *curr = tree->levels + 1; + const X509_POLICY_CACHE *cache; + + for (i = 1; i < tree->nlevel; i++, curr++) { + cache = policy_cache_set(curr->cert); + if (!tree_link_nodes(curr, cache)) + return 0; + + if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) + && !tree_link_any(curr, cache, tree)) + return 0; + tree_print("before tree_prune()", tree, curr); + ret = tree_prune(tree, curr); + if (ret != 1) + return ret; + } + + return 1; + +} + +static void exnode_free(X509_POLICY_NODE *node) +{ + if (node->data && (node->data->flags & POLICY_DATA_FLAG_EXTRA_NODE)) + OPENSSL_free(node); +} + +void X509_policy_tree_free(X509_POLICY_TREE *tree) +{ + X509_POLICY_LEVEL *curr; + int i; + + if (!tree) + return; + + sk_X509_POLICY_NODE_free(tree->auth_policies); + sk_X509_POLICY_NODE_pop_free(tree->user_policies, exnode_free); + + for (i = 0, curr = tree->levels; i < tree->nlevel; i++, curr++) { + if (curr->cert) + X509_free(curr->cert); + if (curr->nodes) + sk_X509_POLICY_NODE_pop_free(curr->nodes, policy_node_free); + if (curr->anyPolicy) + policy_node_free(curr->anyPolicy); + } + + if (tree->extra_data) + sk_X509_POLICY_DATA_pop_free(tree->extra_data, policy_data_free); + + OPENSSL_free(tree->levels); + OPENSSL_free(tree); + +} + +/*- + * Application policy checking function. + * Return codes: + * 0 Internal Error. + * 1 Successful. + * -1 One or more certificates contain invalid or inconsistent extensions + * -2 User constrained policy set empty and requireExplicit true. + */ + +int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags) +{ + int ret; + int calc_ret; + X509_POLICY_TREE *tree = NULL; + STACK_OF(X509_POLICY_NODE) *nodes, *auth_nodes = NULL; + *ptree = NULL; + + *pexplicit_policy = 0; + ret = tree_init(&tree, certs, flags); + + switch (ret) { + + /* Tree empty requireExplicit False: OK */ + case 2: + return 1; + + /* Some internal error */ + case -1: + return -1; + + /* Some internal error */ + case 0: + return 0; + + /* Tree empty requireExplicit True: Error */ + + case 6: + *pexplicit_policy = 1; + return -2; + + /* Tree OK requireExplicit True: OK and continue */ + case 5: + *pexplicit_policy = 1; + break; + + /* Tree OK: continue */ + + case 1: + if (!tree) + /* + * tree_init() returns success and a null tree + * if it's just looking at a trust anchor. + * I'm not sure that returning success here is + * correct, but I'm sure that reporting this + * as an internal error which our caller + * interprets as a malloc failure is wrong. + */ + return 1; + break; + } + + if (!tree) + goto error; + ret = tree_evaluate(tree); + + tree_print("tree_evaluate()", tree, NULL); + + if (ret <= 0) + goto error; + + /* Return value 2 means tree empty */ + if (ret == 2) { + X509_policy_tree_free(tree); + if (*pexplicit_policy) + return -2; + else + return 1; + } + + /* Tree is not empty: continue */ + + calc_ret = tree_calculate_authority_set(tree, &auth_nodes); + + if (!calc_ret) + goto error; + + ret = tree_calculate_user_set(tree, policy_oids, auth_nodes); + + if (calc_ret == 2) + sk_X509_POLICY_NODE_free(auth_nodes); + + if (!ret) + goto error; + + + if (tree) + *ptree = tree; + + if (*pexplicit_policy) { + nodes = X509_policy_tree_get0_user_policies(tree); + if (sk_X509_POLICY_NODE_num(nodes) <= 0) + return -2; + } + + return 1; + + error: + + X509_policy_tree_free(tree); + + return 0; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c new file mode 100644 index 0000000..1cc899b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c @@ -0,0 +1,207 @@ +/* v3_akey.c */ +/* + * 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 "internal.h" + + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + AUTHORITY_KEYID *akeyid, + STACK_OF(CONF_VALUE) + *extlist); +static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_akey_id = { + NID_authority_key_identifier, + X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_KEYID), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_KEYID, + (X509V3_EXT_V2I)v2i_AUTHORITY_KEYID, + 0, 0, + NULL +}; + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + AUTHORITY_KEYID *akeyid, + STACK_OF(CONF_VALUE) + *extlist) +{ + char *tmp; + if (akeyid->keyid) { + 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 = x509v3_bytes_to_hex(akeyid->serial->data, akeyid->serial->length); + X509V3_add_value("serial", tmp, &extlist); + OPENSSL_free(tmp); + } + return extlist; +} + +/* + * Currently two options: keyid: use the issuers subject keyid, the value + * 'always' means its is an error if the issuer certificate doesn't have a + * key id. issuer: use the issuers cert issuer and serial number. The default + * is to only use this if keyid is not present. With the option 'always' this + * is always included. + */ + +static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + char keyid = 0, issuer = 0; + size_t i; + int j; + CONF_VALUE *cnf; + ASN1_OCTET_STRING *ikeyid = NULL; + X509_NAME *isname = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gen = NULL; + ASN1_INTEGER *serial = NULL; + X509_EXTENSION *ext; + X509 *cert; + AUTHORITY_KEYID *akeyid; + + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + cnf = sk_CONF_VALUE_value(values, i); + if (!strcmp(cnf->name, "keyid")) { + keyid = 1; + if (cnf->value && !strcmp(cnf->value, "always")) + keyid = 2; + } else if (!strcmp(cnf->name, "issuer")) { + issuer = 1; + if (cnf->value && !strcmp(cnf->value, "always")) + issuer = 2; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_OPTION); + ERR_add_error_data(2, "name=", cnf->name); + return NULL; + } + } + + if (!ctx || !ctx->issuer_cert) { + if (ctx && (ctx->flags == CTX_TEST)) + return AUTHORITY_KEYID_new(); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_ISSUER_CERTIFICATE); + return NULL; + } + + cert = ctx->issuer_cert; + + if (keyid) { + j = X509_get_ext_by_NID(cert, NID_subject_key_identifier, -1); + if ((j >= 0) && (ext = X509_get_ext(cert, j))) + ikeyid = X509V3_EXT_d2i(ext); + if (keyid == 2 && !ikeyid) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID); + return NULL; + } + } + + if ((issuer && !ikeyid) || (issuer == 2)) { + isname = X509_NAME_dup(X509_get_issuer_name(cert)); + serial = M_ASN1_INTEGER_dup(X509_get_serialNumber(cert)); + if (!isname || !serial) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS); + goto err; + } + } + + if (!(akeyid = AUTHORITY_KEYID_new())) + goto err; + + if (isname) { + if (!(gens = sk_GENERAL_NAME_new_null()) + || !(gen = GENERAL_NAME_new()) + || !sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen->type = GEN_DIRNAME; + gen->d.dirn = isname; + } + + akeyid->issuer = gens; + akeyid->serial = serial; + akeyid->keyid = ikeyid; + + return akeyid; + + err: + X509_NAME_free(isname); + M_ASN1_INTEGER_free(serial); + M_ASN1_OCTET_STRING_free(ikeyid); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back new file mode 100644 index 0000000..30c02e2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back @@ -0,0 +1,207 @@ +/* v3_akey.c */ +/* + * 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 "internal.h" + + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + AUTHORITY_KEYID *akeyid, + STACK_OF(CONF_VALUE) + *extlist); +static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_akey_id = { + NID_authority_key_identifier, + X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_KEYID), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_KEYID, + (X509V3_EXT_V2I)v2i_AUTHORITY_KEYID, + 0, 0, + NULL +}; + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + AUTHORITY_KEYID *akeyid, + STACK_OF(CONF_VALUE) + *extlist) +{ + char *tmp; + if (akeyid->keyid) { + 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 = x509v3_bytes_to_hex(akeyid->serial->data, akeyid->serial->length); + X509V3_add_value("serial", tmp, &extlist); + OPENSSL_free(tmp); + } + return extlist; +} + +/* + * Currently two options: keyid: use the issuers subject keyid, the value + * 'always' means its is an error if the issuer certificate doesn't have a + * key id. issuer: use the issuers cert issuer and serial number. The default + * is to only use this if keyid is not present. With the option 'always' this + * is always included. + */ + +static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + char keyid = 0, issuer = 0; + size_t i; + int j; + CONF_VALUE *cnf; + ASN1_OCTET_STRING *ikeyid = NULL; + X509_NAME *isname = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gen = NULL; + ASN1_INTEGER *serial = NULL; + X509_EXTENSION *ext; + X509 *cert; + AUTHORITY_KEYID *akeyid; + + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + cnf = sk_CONF_VALUE_value(values, i); + if (!strcmp(cnf->name, "keyid")) { + keyid = 1; + if (cnf->value && !strcmp(cnf->value, "always")) + keyid = 2; + } else if (!strcmp(cnf->name, "issuer")) { + issuer = 1; + if (cnf->value && !strcmp(cnf->value, "always")) + issuer = 2; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_OPTION); + ERR_add_error_data(2, "name=", cnf->name); + return NULL; + } + } + + if (!ctx || !ctx->issuer_cert) { + if (ctx && (ctx->flags == CTX_TEST)) + return AUTHORITY_KEYID_new(); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_ISSUER_CERTIFICATE); + return NULL; + } + + cert = ctx->issuer_cert; + + if (keyid) { + j = X509_get_ext_by_NID(cert, NID_subject_key_identifier, -1); + if ((j >= 0) && (ext = X509_get_ext(cert, j))) + ikeyid = X509V3_EXT_d2i(ext); + if (keyid == 2 && !ikeyid) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID); + return NULL; + } + } + + if ((issuer && !ikeyid) || (issuer == 2)) { + isname = X509_NAME_dup(X509_get_issuer_name(cert)); + serial = M_ASN1_INTEGER_dup(X509_get_serialNumber(cert)); + if (!isname || !serial) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS); + goto err; + } + } + + if (!(akeyid = AUTHORITY_KEYID_new())) + goto err; + + if (isname) { + if (!(gens = sk_GENERAL_NAME_new_null()) + || !(gen = GENERAL_NAME_new()) + || !sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen->type = GEN_DIRNAME; + gen->d.dirn = isname; + } + + akeyid->issuer = gens; + akeyid->serial = serial; + akeyid->keyid = ikeyid; + + return akeyid; + + err: + X509_NAME_free(isname); + M_ASN1_INTEGER_free(serial); + M_ASN1_OCTET_STRING_free(ikeyid); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c new file mode 100644 index 0000000..950cae9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c @@ -0,0 +1,72 @@ +/* v3_akey_asn1.c */ +/* + * 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 + + +ASN1_SEQUENCE(AUTHORITY_KEYID) = { + ASN1_IMP_OPT(AUTHORITY_KEYID, keyid, ASN1_OCTET_STRING, 0), + ASN1_IMP_SEQUENCE_OF_OPT(AUTHORITY_KEYID, issuer, GENERAL_NAME, 1), + ASN1_IMP_OPT(AUTHORITY_KEYID, serial, ASN1_INTEGER, 2) +} ASN1_SEQUENCE_END(AUTHORITY_KEYID) + +IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_KEYID) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c.grpc_back new file mode 100644 index 0000000..844dee5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c.grpc_back @@ -0,0 +1,72 @@ +/* v3_akey_asn1.c */ +/* + * 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 + + +ASN1_SEQUENCE(AUTHORITY_KEYID) = { + ASN1_IMP_OPT(AUTHORITY_KEYID, keyid, ASN1_OCTET_STRING, 0), + ASN1_IMP_SEQUENCE_OF_OPT(AUTHORITY_KEYID, issuer, GENERAL_NAME, 1), + ASN1_IMP_OPT(AUTHORITY_KEYID, serial, ASN1_INTEGER, 2) +} ASN1_SEQUENCE_END(AUTHORITY_KEYID) + +IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_KEYID) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c new file mode 100644 index 0000000..9a5cfa3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c @@ -0,0 +1,629 @@ +/* v3_alt.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 1999-2003 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 "internal.h" + + +static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p); +static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); +static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); +static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); + +const X509V3_EXT_METHOD v3_alt[] = { + {NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + (X509V3_EXT_V2I)v2i_subject_alt, + NULL, NULL, NULL}, + + {NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + (X509V3_EXT_V2I)v2i_issuer_alt, + NULL, NULL, NULL}, + + {NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + NULL, NULL, NULL, NULL}, +}; + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gens, + STACK_OF(CONF_VALUE) *ret) +{ + size_t i; + GENERAL_NAME *gen; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gen = sk_GENERAL_NAME_value(gens, i); + ret = i2v_GENERAL_NAME(method, gen, ret); + } + if (!ret) + return sk_CONF_VALUE_new_null(); + return ret; +} + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, + GENERAL_NAME *gen, + STACK_OF(CONF_VALUE) *ret) +{ + unsigned char *p; + char oline[256], htmp[5]; + int i; + switch (gen->type) { + case GEN_OTHERNAME: + if (!X509V3_add_value("othername", "", &ret)) + return NULL; + break; + + case GEN_X400: + if (!X509V3_add_value("X400Name", "", &ret)) + return NULL; + break; + + case GEN_EDIPARTY: + if (!X509V3_add_value("EdiPartyName", "", &ret)) + return NULL; + break; + + case GEN_EMAIL: + if (!X509V3_add_value_uchar("email", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_DNS: + if (!X509V3_add_value_uchar("DNS", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_URI: + if (!X509V3_add_value_uchar("URI", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_DIRNAME: + if (X509_NAME_oneline(gen->d.dirn, oline, 256) == NULL + || !X509V3_add_value("DirName", oline, &ret)) + return NULL; + break; + + case GEN_IPADD: + p = gen->d.ip->data; + if (gen->d.ip->length == 4) + BIO_snprintf(oline, sizeof oline, + "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + else if (gen->d.ip->length == 16) { + oline[0] = 0; + for (i = 0; i < 8; i++) { + BIO_snprintf(htmp, sizeof htmp, "%X", p[0] << 8 | p[1]); + p += 2; + OPENSSL_strlcat(oline, htmp, sizeof(oline)); + if (i != 7) + OPENSSL_strlcat(oline, ":", sizeof(oline)); + } + } else { + if (!X509V3_add_value("IP Address", "", &ret)) + return NULL; + break; + } + if (!X509V3_add_value("IP Address", oline, &ret)) + return NULL; + break; + + case GEN_RID: + i2t_ASN1_OBJECT(oline, 256, gen->d.rid); + if (!X509V3_add_value("Registered ID", oline, &ret)) + return NULL; + break; + } + return ret; +} + +int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) +{ + unsigned char *p; + int i; + switch (gen->type) { + case GEN_OTHERNAME: + BIO_printf(out, "othername:"); + break; + + case GEN_X400: + BIO_printf(out, "X400Name:"); + break; + + case GEN_EDIPARTY: + /* Maybe fix this: it is supported now */ + BIO_printf(out, "EdiPartyName:"); + break; + + case GEN_EMAIL: + BIO_printf(out, "email:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_DNS: + BIO_printf(out, "DNS:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_URI: + BIO_printf(out, "URI:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_DIRNAME: + BIO_printf(out, "DirName: "); + X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE); + break; + + case GEN_IPADD: + p = gen->d.ip->data; + if (gen->d.ip->length == 4) + BIO_printf(out, "IP Address:%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + else if (gen->d.ip->length == 16) { + BIO_printf(out, "IP Address"); + for (i = 0; i < 8; i++) { + BIO_printf(out, ":%X", p[0] << 8 | p[1]); + p += 2; + } + BIO_puts(out, "\n"); + } else { + BIO_printf(out, "IP Address:"); + break; + } + break; + + case GEN_RID: + BIO_printf(out, "Registered ID"); + i2a_ASN1_OBJECT(out, gen->d.rid); + break; + } + return 1; +} + +static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value && + !strcmp(cnf->value, "copy")) { + if (!copy_issuer(ctx, gens)) + goto err; + } else { + GENERAL_NAME *gen; + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +/* Append subject altname of issuer to issuer alt name of subject */ + +static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens) +{ + GENERAL_NAMES *ialt; + GENERAL_NAME *gen; + X509_EXTENSION *ext; + int i; + size_t j; + if (ctx && (ctx->flags == CTX_TEST)) + return 1; + if (!ctx || !ctx->issuer_cert) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_ISSUER_DETAILS); + goto err; + } + i = X509_get_ext_by_NID(ctx->issuer_cert, NID_subject_alt_name, -1); + if (i < 0) + return 1; + if (!(ext = X509_get_ext(ctx->issuer_cert, i)) || + !(ialt = X509V3_EXT_d2i(ext))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ISSUER_DECODE_ERROR); + goto err; + } + + for (j = 0; j < sk_GENERAL_NAME_num(ialt); j++) { + gen = sk_GENERAL_NAME_value(ialt, j); + if (!sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + sk_GENERAL_NAME_free(ialt); + + return 1; + + err: + return 0; + +} + +static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && + !strcmp(cnf->value, "copy")) { + if (!copy_email(ctx, gens, 0)) + goto err; + } else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && + !strcmp(cnf->value, "move")) { + if (!copy_email(ctx, gens, 1)) + goto err; + } else { + GENERAL_NAME *gen; + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +/* + * Copy any email addresses in a certificate or request to GENERAL_NAMES + */ + +static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p) +{ + X509_NAME *nm; + ASN1_IA5STRING *email = NULL; + X509_NAME_ENTRY *ne; + GENERAL_NAME *gen = NULL; + int i; + if (ctx != NULL && ctx->flags == CTX_TEST) + return 1; + if (!ctx || (!ctx->subject_cert && !ctx->subject_req)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_SUBJECT_DETAILS); + goto err; + } + /* Find the subject name */ + if (ctx->subject_cert) + nm = X509_get_subject_name(ctx->subject_cert); + else + nm = X509_REQ_get_subject_name(ctx->subject_req); + + /* Now add any email address(es) to STACK */ + i = -1; + while ((i = X509_NAME_get_index_by_NID(nm, + NID_pkcs9_emailAddress, i)) >= 0) { + ne = X509_NAME_get_entry(nm, i); + email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne)); + if (move_p) { + X509_NAME_delete_entry(nm, i); + X509_NAME_ENTRY_free(ne); + i--; + } + if (!email || !(gen = GENERAL_NAME_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen->d.ia5 = email; + email = NULL; + gen->type = GEN_EMAIL; + if (!sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen = NULL; + } + + return 1; + + err: + GENERAL_NAME_free(gen); + M_ASN1_IA5STRING_free(email); + return 0; + +} + +GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAME *gen; + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf) +{ + return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0); +} + +GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, int gen_type, char *value, + int is_nc) +{ + char is_string = 0; + GENERAL_NAME *gen = NULL; + + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE); + return NULL; + } + + if (out) + gen = out; + else { + gen = GENERAL_NAME_new(); + if (gen == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + } + + switch (gen_type) { + case GEN_URI: + case GEN_EMAIL: + case GEN_DNS: + is_string = 1; + break; + + case GEN_RID: + { + ASN1_OBJECT *obj; + if (!(obj = OBJ_txt2obj(value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); + ERR_add_error_data(2, "value=", value); + goto err; + } + gen->d.rid = obj; + } + break; + + case GEN_IPADD: + if (is_nc) + gen->d.ip = a2i_IPADDRESS_NC(value); + else + gen->d.ip = a2i_IPADDRESS(value); + if (gen->d.ip == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_IP_ADDRESS); + ERR_add_error_data(2, "value=", value); + goto err; + } + break; + + case GEN_DIRNAME: + if (!do_dirname(gen, value, ctx)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DIRNAME_ERROR); + goto err; + } + break; + + case GEN_OTHERNAME: + if (!do_othername(gen, value, ctx)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OTHERNAME_ERROR); + goto err; + } + break; + default: + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_TYPE); + goto err; + } + + if (is_string) { + if (!(gen->d.ia5 = M_ASN1_IA5STRING_new()) || + !ASN1_STRING_set(gen->d.ia5, (unsigned char *)value, + strlen(value))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + gen->type = gen_type; + + return gen; + + err: + if (!out) + GENERAL_NAME_free(gen); + return NULL; +} + +GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc) +{ + int type; + + char *name, *value; + + name = cnf->name; + value = cnf->value; + + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE); + return NULL; + } + + if (!x509v3_name_cmp(name, "email")) + type = GEN_EMAIL; + else if (!x509v3_name_cmp(name, "URI")) + type = GEN_URI; + else if (!x509v3_name_cmp(name, "DNS")) + type = GEN_DNS; + else if (!x509v3_name_cmp(name, "RID")) + type = GEN_RID; + else if (!x509v3_name_cmp(name, "IP")) + type = GEN_IPADD; + else if (!x509v3_name_cmp(name, "dirName")) + type = GEN_DIRNAME; + else if (!x509v3_name_cmp(name, "otherName")) + type = GEN_OTHERNAME; + else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION); + ERR_add_error_data(2, "name=", name); + return NULL; + } + + return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc); + +} + +static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +{ + char *objtmp = NULL, *p; + int objlen; + if (!(p = strchr(value, ';'))) + return 0; + if (!(gen->d.otherName = OTHERNAME_new())) + return 0; + /* + * Free this up because we will overwrite it. no need to free type_id + * because it is static + */ + ASN1_TYPE_free(gen->d.otherName->value); + if (!(gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx))) + return 0; + objlen = p - value; + objtmp = OPENSSL_malloc(objlen + 1); + if (objtmp == NULL) + return 0; + OPENSSL_strlcpy(objtmp, value, objlen + 1); + gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); + OPENSSL_free(objtmp); + if (!gen->d.otherName->type_id) + return 0; + return 1; +} + +static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +{ + int ret = 0; + STACK_OF(CONF_VALUE) *sk = NULL; + X509_NAME *nm = X509_NAME_new(); + if (nm == NULL) + goto err; + sk = X509V3_get_section(ctx, value); + if (sk == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + ERR_add_error_data(2, "section=", value); + goto err; + } + /* FIXME: should allow other character types... */ + if (!X509V3_NAME_from_section(nm, sk, MBSTRING_ASC)) + goto err; + gen->d.dirn = nm; + ret = 1; + + err: + if (!ret) + X509_NAME_free(nm); + X509V3_section_free(ctx, sk); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back new file mode 100644 index 0000000..0e79b45 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back @@ -0,0 +1,629 @@ +/* v3_alt.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 1999-2003 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 "internal.h" + + +static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p); +static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); +static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); +static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); + +const X509V3_EXT_METHOD v3_alt[] = { + {NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + (X509V3_EXT_V2I)v2i_subject_alt, + NULL, NULL, NULL}, + + {NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + (X509V3_EXT_V2I)v2i_issuer_alt, + NULL, NULL, NULL}, + + {NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_GENERAL_NAMES, + NULL, NULL, NULL, NULL}, +}; + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gens, + STACK_OF(CONF_VALUE) *ret) +{ + size_t i; + GENERAL_NAME *gen; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gen = sk_GENERAL_NAME_value(gens, i); + ret = i2v_GENERAL_NAME(method, gen, ret); + } + if (!ret) + return sk_CONF_VALUE_new_null(); + return ret; +} + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, + GENERAL_NAME *gen, + STACK_OF(CONF_VALUE) *ret) +{ + unsigned char *p; + char oline[256], htmp[5]; + int i; + switch (gen->type) { + case GEN_OTHERNAME: + if (!X509V3_add_value("othername", "", &ret)) + return NULL; + break; + + case GEN_X400: + if (!X509V3_add_value("X400Name", "", &ret)) + return NULL; + break; + + case GEN_EDIPARTY: + if (!X509V3_add_value("EdiPartyName", "", &ret)) + return NULL; + break; + + case GEN_EMAIL: + if (!X509V3_add_value_uchar("email", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_DNS: + if (!X509V3_add_value_uchar("DNS", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_URI: + if (!X509V3_add_value_uchar("URI", gen->d.ia5->data, &ret)) + return NULL; + break; + + case GEN_DIRNAME: + if (X509_NAME_oneline(gen->d.dirn, oline, 256) == NULL + || !X509V3_add_value("DirName", oline, &ret)) + return NULL; + break; + + case GEN_IPADD: + p = gen->d.ip->data; + if (gen->d.ip->length == 4) + BIO_snprintf(oline, sizeof oline, + "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + else if (gen->d.ip->length == 16) { + oline[0] = 0; + for (i = 0; i < 8; i++) { + BIO_snprintf(htmp, sizeof htmp, "%X", p[0] << 8 | p[1]); + p += 2; + OPENSSL_strlcat(oline, htmp, sizeof(oline)); + if (i != 7) + OPENSSL_strlcat(oline, ":", sizeof(oline)); + } + } else { + if (!X509V3_add_value("IP Address", "", &ret)) + return NULL; + break; + } + if (!X509V3_add_value("IP Address", oline, &ret)) + return NULL; + break; + + case GEN_RID: + i2t_ASN1_OBJECT(oline, 256, gen->d.rid); + if (!X509V3_add_value("Registered ID", oline, &ret)) + return NULL; + break; + } + return ret; +} + +int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) +{ + unsigned char *p; + int i; + switch (gen->type) { + case GEN_OTHERNAME: + BIO_printf(out, "othername:"); + break; + + case GEN_X400: + BIO_printf(out, "X400Name:"); + break; + + case GEN_EDIPARTY: + /* Maybe fix this: it is supported now */ + BIO_printf(out, "EdiPartyName:"); + break; + + case GEN_EMAIL: + BIO_printf(out, "email:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_DNS: + BIO_printf(out, "DNS:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_URI: + BIO_printf(out, "URI:"); + ASN1_STRING_print(out, gen->d.ia5); + break; + + case GEN_DIRNAME: + BIO_printf(out, "DirName: "); + X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE); + break; + + case GEN_IPADD: + p = gen->d.ip->data; + if (gen->d.ip->length == 4) + BIO_printf(out, "IP Address:%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + else if (gen->d.ip->length == 16) { + BIO_printf(out, "IP Address"); + for (i = 0; i < 8; i++) { + BIO_printf(out, ":%X", p[0] << 8 | p[1]); + p += 2; + } + BIO_puts(out, "\n"); + } else { + BIO_printf(out, "IP Address:"); + break; + } + break; + + case GEN_RID: + BIO_printf(out, "Registered ID"); + i2a_ASN1_OBJECT(out, gen->d.rid); + break; + } + return 1; +} + +static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value && + !strcmp(cnf->value, "copy")) { + if (!copy_issuer(ctx, gens)) + goto err; + } else { + GENERAL_NAME *gen; + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +/* Append subject altname of issuer to issuer alt name of subject */ + +static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens) +{ + GENERAL_NAMES *ialt; + GENERAL_NAME *gen; + X509_EXTENSION *ext; + int i; + size_t j; + if (ctx && (ctx->flags == CTX_TEST)) + return 1; + if (!ctx || !ctx->issuer_cert) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_ISSUER_DETAILS); + goto err; + } + i = X509_get_ext_by_NID(ctx->issuer_cert, NID_subject_alt_name, -1); + if (i < 0) + return 1; + if (!(ext = X509_get_ext(ctx->issuer_cert, i)) || + !(ialt = X509V3_EXT_d2i(ext))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ISSUER_DECODE_ERROR); + goto err; + } + + for (j = 0; j < sk_GENERAL_NAME_num(ialt); j++) { + gen = sk_GENERAL_NAME_value(ialt, j); + if (!sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + sk_GENERAL_NAME_free(ialt); + + return 1; + + err: + return 0; + +} + +static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && + !strcmp(cnf->value, "copy")) { + if (!copy_email(ctx, gens, 0)) + goto err; + } else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && + !strcmp(cnf->value, "move")) { + if (!copy_email(ctx, gens, 1)) + goto err; + } else { + GENERAL_NAME *gen; + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +/* + * Copy any email addresses in a certificate or request to GENERAL_NAMES + */ + +static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p) +{ + X509_NAME *nm; + ASN1_IA5STRING *email = NULL; + X509_NAME_ENTRY *ne; + GENERAL_NAME *gen = NULL; + int i; + if (ctx != NULL && ctx->flags == CTX_TEST) + return 1; + if (!ctx || (!ctx->subject_cert && !ctx->subject_req)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_SUBJECT_DETAILS); + goto err; + } + /* Find the subject name */ + if (ctx->subject_cert) + nm = X509_get_subject_name(ctx->subject_cert); + else + nm = X509_REQ_get_subject_name(ctx->subject_req); + + /* Now add any email address(es) to STACK */ + i = -1; + while ((i = X509_NAME_get_index_by_NID(nm, + NID_pkcs9_emailAddress, i)) >= 0) { + ne = X509_NAME_get_entry(nm, i); + email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne)); + if (move_p) { + X509_NAME_delete_entry(nm, i); + X509_NAME_ENTRY_free(ne); + i--; + } + if (!email || !(gen = GENERAL_NAME_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen->d.ia5 = email; + email = NULL; + gen->type = GEN_EMAIL; + if (!sk_GENERAL_NAME_push(gens, gen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + gen = NULL; + } + + return 1; + + err: + GENERAL_NAME_free(gen); + M_ASN1_IA5STRING_free(email); + return 0; + +} + +GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + GENERAL_NAME *gen; + GENERAL_NAMES *gens = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(gens = sk_GENERAL_NAME_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + sk_GENERAL_NAME_push(gens, gen); + } + return gens; + err: + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return NULL; +} + +GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf) +{ + return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0); +} + +GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, int gen_type, char *value, + int is_nc) +{ + char is_string = 0; + GENERAL_NAME *gen = NULL; + + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE); + return NULL; + } + + if (out) + gen = out; + else { + gen = GENERAL_NAME_new(); + if (gen == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + } + + switch (gen_type) { + case GEN_URI: + case GEN_EMAIL: + case GEN_DNS: + is_string = 1; + break; + + case GEN_RID: + { + ASN1_OBJECT *obj; + if (!(obj = OBJ_txt2obj(value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); + ERR_add_error_data(2, "value=", value); + goto err; + } + gen->d.rid = obj; + } + break; + + case GEN_IPADD: + if (is_nc) + gen->d.ip = a2i_IPADDRESS_NC(value); + else + gen->d.ip = a2i_IPADDRESS(value); + if (gen->d.ip == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_IP_ADDRESS); + ERR_add_error_data(2, "value=", value); + goto err; + } + break; + + case GEN_DIRNAME: + if (!do_dirname(gen, value, ctx)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DIRNAME_ERROR); + goto err; + } + break; + + case GEN_OTHERNAME: + if (!do_othername(gen, value, ctx)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OTHERNAME_ERROR); + goto err; + } + break; + default: + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_TYPE); + goto err; + } + + if (is_string) { + if (!(gen->d.ia5 = M_ASN1_IA5STRING_new()) || + !ASN1_STRING_set(gen->d.ia5, (unsigned char *)value, + strlen(value))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + gen->type = gen_type; + + return gen; + + err: + if (!out) + GENERAL_NAME_free(gen); + return NULL; +} + +GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc) +{ + int type; + + char *name, *value; + + name = cnf->name; + value = cnf->value; + + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE); + return NULL; + } + + if (!x509v3_name_cmp(name, "email")) + type = GEN_EMAIL; + else if (!x509v3_name_cmp(name, "URI")) + type = GEN_URI; + else if (!x509v3_name_cmp(name, "DNS")) + type = GEN_DNS; + else if (!x509v3_name_cmp(name, "RID")) + type = GEN_RID; + else if (!x509v3_name_cmp(name, "IP")) + type = GEN_IPADD; + else if (!x509v3_name_cmp(name, "dirName")) + type = GEN_DIRNAME; + else if (!x509v3_name_cmp(name, "otherName")) + type = GEN_OTHERNAME; + else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION); + ERR_add_error_data(2, "name=", name); + return NULL; + } + + return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc); + +} + +static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +{ + char *objtmp = NULL, *p; + int objlen; + if (!(p = strchr(value, ';'))) + return 0; + if (!(gen->d.otherName = OTHERNAME_new())) + return 0; + /* + * Free this up because we will overwrite it. no need to free type_id + * because it is static + */ + ASN1_TYPE_free(gen->d.otherName->value); + if (!(gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx))) + return 0; + objlen = p - value; + objtmp = OPENSSL_malloc(objlen + 1); + if (objtmp == NULL) + return 0; + OPENSSL_strlcpy(objtmp, value, objlen + 1); + gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); + OPENSSL_free(objtmp); + if (!gen->d.otherName->type_id) + return 0; + return 1; +} + +static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +{ + int ret = 0; + STACK_OF(CONF_VALUE) *sk = NULL; + X509_NAME *nm = X509_NAME_new(); + if (nm == NULL) + goto err; + sk = X509V3_get_section(ctx, value); + if (sk == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + ERR_add_error_data(2, "section=", value); + goto err; + } + /* FIXME: should allow other character types... */ + if (!X509V3_NAME_from_section(nm, sk, MBSTRING_ASC)) + goto err; + gen->d.dirn = nm; + ret = 1; + + err: + if (!ret) + X509_NAME_free(nm); + X509V3_section_free(ctx, sk); + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c new file mode 100644 index 0000000..ee52e14 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c @@ -0,0 +1,133 @@ +/* v3_bcons.c */ +/* + * 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 + +static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + BASIC_CONSTRAINTS *bcons, + STACK_OF(CONF_VALUE) + *extlist); +static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_bcons = { + NID_basic_constraints, 0, + ASN1_ITEM_ref(BASIC_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_BASIC_CONSTRAINTS, + (X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS, + NULL, NULL, + NULL +}; + +ASN1_SEQUENCE(BASIC_CONSTRAINTS) = { + ASN1_OPT(BASIC_CONSTRAINTS, ca, ASN1_FBOOLEAN), + ASN1_OPT(BASIC_CONSTRAINTS, pathlen, ASN1_INTEGER) +} ASN1_SEQUENCE_END(BASIC_CONSTRAINTS) + +IMPLEMENT_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) + +static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + BASIC_CONSTRAINTS *bcons, + STACK_OF(CONF_VALUE) + *extlist) +{ + X509V3_add_value_bool("CA", bcons->ca, &extlist); + X509V3_add_value_int("pathlen", bcons->pathlen, &extlist); + return extlist; +} + +static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + BASIC_CONSTRAINTS *bcons = NULL; + CONF_VALUE *val; + size_t i; + if (!(bcons = BASIC_CONSTRAINTS_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + val = sk_CONF_VALUE_value(values, i); + if (!strcmp(val->name, "CA")) { + if (!X509V3_get_value_bool(val, &bcons->ca)) + goto err; + } else if (!strcmp(val->name, "pathlen")) { + if (!X509V3_get_value_int(val, &bcons->pathlen)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(val); + goto err; + } + } + return bcons; + err: + BASIC_CONSTRAINTS_free(bcons); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c.grpc_back new file mode 100644 index 0000000..aefefdf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c.grpc_back @@ -0,0 +1,133 @@ +/* v3_bcons.c */ +/* + * 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 + +static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + BASIC_CONSTRAINTS *bcons, + STACK_OF(CONF_VALUE) + *extlist); +static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_bcons = { + NID_basic_constraints, 0, + ASN1_ITEM_ref(BASIC_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_BASIC_CONSTRAINTS, + (X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS, + NULL, NULL, + NULL +}; + +ASN1_SEQUENCE(BASIC_CONSTRAINTS) = { + ASN1_OPT(BASIC_CONSTRAINTS, ca, ASN1_FBOOLEAN), + ASN1_OPT(BASIC_CONSTRAINTS, pathlen, ASN1_INTEGER) +} ASN1_SEQUENCE_END(BASIC_CONSTRAINTS) + +IMPLEMENT_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) + +static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + BASIC_CONSTRAINTS *bcons, + STACK_OF(CONF_VALUE) + *extlist) +{ + X509V3_add_value_bool("CA", bcons->ca, &extlist); + X509V3_add_value_int("pathlen", bcons->pathlen, &extlist); + return extlist; +} + +static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + BASIC_CONSTRAINTS *bcons = NULL; + CONF_VALUE *val; + size_t i; + if (!(bcons = BASIC_CONSTRAINTS_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + val = sk_CONF_VALUE_value(values, i); + if (!strcmp(val->name, "CA")) { + if (!X509V3_get_value_bool(val, &bcons->ca)) + goto err; + } else if (!strcmp(val->name, "pathlen")) { + if (!X509V3_get_value_int(val, &bcons->pathlen)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(val); + goto err; + } + } + return bcons; + err: + BASIC_CONSTRAINTS_free(bcons); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c new file mode 100644 index 0000000..0e8d074 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c @@ -0,0 +1,141 @@ +/* v3_bitst.c */ +/* + * 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 + +static const BIT_STRING_BITNAME ns_cert_type_table[] = { + {0, "SSL Client", "client"}, + {1, "SSL Server", "server"}, + {2, "S/MIME", "email"}, + {3, "Object Signing", "objsign"}, + {4, "Unused", "reserved"}, + {5, "SSL CA", "sslCA"}, + {6, "S/MIME CA", "emailCA"}, + {7, "Object Signing CA", "objCA"}, + {-1, NULL, NULL} +}; + +static const BIT_STRING_BITNAME key_usage_type_table[] = { + {0, "Digital Signature", "digitalSignature"}, + {1, "Non Repudiation", "nonRepudiation"}, + {2, "Key Encipherment", "keyEncipherment"}, + {3, "Data Encipherment", "dataEncipherment"}, + {4, "Key Agreement", "keyAgreement"}, + {5, "Certificate Sign", "keyCertSign"}, + {6, "CRL Sign", "cRLSign"}, + {7, "Encipher Only", "encipherOnly"}, + {8, "Decipher Only", "decipherOnly"}, + {-1, NULL, NULL} +}; + +const X509V3_EXT_METHOD v3_nscert = +EXT_BITSTRING(NID_netscape_cert_type, ns_cert_type_table); +const X509V3_EXT_METHOD v3_key_usage = +EXT_BITSTRING(NID_key_usage, key_usage_type_table); + +STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *ret) +{ + const BIT_STRING_BITNAME *bnam; + for (bnam = method->usr_data; bnam->lname; bnam++) { + if (ASN1_BIT_STRING_get_bit(bits, bnam->bitnum)) + X509V3_add_value(bnam->lname, NULL, &ret); + } + return ret; +} + +ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + CONF_VALUE *val; + ASN1_BIT_STRING *bs; + size_t i; + const BIT_STRING_BITNAME *bnam; + if (!(bs = M_ASN1_BIT_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + for (bnam = method->usr_data; bnam->lname; bnam++) { + if (!strcmp(bnam->sname, val->name) || + !strcmp(bnam->lname, val->name)) { + if (!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_BIT_STRING_free(bs); + return NULL; + } + break; + } + } + if (!bnam->lname) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT); + X509V3_conf_err(val); + M_ASN1_BIT_STRING_free(bs); + return NULL; + } + } + return bs; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c.grpc_back new file mode 100644 index 0000000..86a8c36 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c.grpc_back @@ -0,0 +1,141 @@ +/* v3_bitst.c */ +/* + * 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 + +static const BIT_STRING_BITNAME ns_cert_type_table[] = { + {0, "SSL Client", "client"}, + {1, "SSL Server", "server"}, + {2, "S/MIME", "email"}, + {3, "Object Signing", "objsign"}, + {4, "Unused", "reserved"}, + {5, "SSL CA", "sslCA"}, + {6, "S/MIME CA", "emailCA"}, + {7, "Object Signing CA", "objCA"}, + {-1, NULL, NULL} +}; + +static const BIT_STRING_BITNAME key_usage_type_table[] = { + {0, "Digital Signature", "digitalSignature"}, + {1, "Non Repudiation", "nonRepudiation"}, + {2, "Key Encipherment", "keyEncipherment"}, + {3, "Data Encipherment", "dataEncipherment"}, + {4, "Key Agreement", "keyAgreement"}, + {5, "Certificate Sign", "keyCertSign"}, + {6, "CRL Sign", "cRLSign"}, + {7, "Encipher Only", "encipherOnly"}, + {8, "Decipher Only", "decipherOnly"}, + {-1, NULL, NULL} +}; + +const X509V3_EXT_METHOD v3_nscert = +EXT_BITSTRING(NID_netscape_cert_type, ns_cert_type_table); +const X509V3_EXT_METHOD v3_key_usage = +EXT_BITSTRING(NID_key_usage, key_usage_type_table); + +STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *ret) +{ + const BIT_STRING_BITNAME *bnam; + for (bnam = method->usr_data; bnam->lname; bnam++) { + if (ASN1_BIT_STRING_get_bit(bits, bnam->bitnum)) + X509V3_add_value(bnam->lname, NULL, &ret); + } + return ret; +} + +ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + CONF_VALUE *val; + ASN1_BIT_STRING *bs; + size_t i; + const BIT_STRING_BITNAME *bnam; + if (!(bs = M_ASN1_BIT_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + for (bnam = method->usr_data; bnam->lname; bnam++) { + if (!strcmp(bnam->sname, val->name) || + !strcmp(bnam->lname, val->name)) { + if (!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_BIT_STRING_free(bs); + return NULL; + } + break; + } + } + if (!bnam->lname) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT); + X509V3_conf_err(val); + M_ASN1_BIT_STRING_free(bs); + return NULL; + } + } + return bs; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c new file mode 100644 index 0000000..c346ad2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c @@ -0,0 +1,463 @@ +/* v3_conf.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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). */ + +/* extension creation utilities */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "internal.h" + +static int v3_check_critical(char **value); +static int v3_check_generic(char **value); +static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value); +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int type, + X509V3_CTX *ctx); +static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, + int ext_nid, int crit, void *ext_struc); +static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, + long *ext_len); +/* CONF *conf: Config file */ +/* char *name: Name */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, + char *value) +{ + int crit; + int ext_type; + X509_EXTENSION *ret; + crit = v3_check_critical(&value); + if ((ext_type = v3_check_generic(&value))) + return v3_generic_extension(name, value, crit, ext_type, ctx); + ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value); + if (!ret) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_IN_EXTENSION); + ERR_add_error_data(4, "name=", name, ", value=", value); + } + return ret; +} + +/* CONF *conf: Config file */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + char *value) +{ + int crit; + int ext_type; + crit = v3_check_critical(&value); + if ((ext_type = v3_check_generic(&value))) + return v3_generic_extension(OBJ_nid2sn(ext_nid), + value, crit, ext_type, ctx); + return do_ext_nconf(conf, ctx, ext_nid, crit, value); +} + +/* CONF *conf: Config file */ +/* char *value: Value */ +static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value) +{ + const X509V3_EXT_METHOD *method; + X509_EXTENSION *ext; + STACK_OF(CONF_VALUE) *nval; + void *ext_struc; + if (ext_nid == NID_undef) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME); + return NULL; + } + if (!(method = X509V3_EXT_get_nid(ext_nid))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION); + return NULL; + } + /* Now get internal extension representation based on type */ + if (method->v2i) { + if (*value == '@') + nval = NCONF_get_section(conf, value + 1); + else + nval = X509V3_parse_list(value); + if (nval == NULL || sk_CONF_VALUE_num(nval) <= 0) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_EXTENSION_STRING); + ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=", + value); + if (*value != '@') + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + return NULL; + } + ext_struc = method->v2i(method, ctx, nval); + if (*value != '@') + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + if (!ext_struc) + return NULL; + } else if (method->s2i) { + if (!(ext_struc = method->s2i(method, ctx, value))) + return NULL; + } else if (method->r2i) { + if (!ctx->db || !ctx->db_meth) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_CONFIG_DATABASE); + return NULL; + } + if (!(ext_struc = method->r2i(method, ctx, value))) + return NULL; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED); + ERR_add_error_data(2, "name=", OBJ_nid2sn(ext_nid)); + return NULL; + } + + ext = do_ext_i2d(method, ext_nid, crit, ext_struc); + if (method->it) + ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it)); + else + method->ext_free(ext_struc); + return ext; + +} + +static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, + int ext_nid, int crit, void *ext_struc) +{ + unsigned char *ext_der; + int ext_len; + ASN1_OCTET_STRING *ext_oct; + X509_EXTENSION *ext; + /* Convert internal representation to DER */ + if (method->it) { + ext_der = NULL; + ext_len = + ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it)); + if (ext_len < 0) + goto merr; + } else { + unsigned char *p; + ext_len = method->i2d(ext_struc, NULL); + if (!(ext_der = OPENSSL_malloc(ext_len))) + goto merr; + p = ext_der; + method->i2d(ext_struc, &p); + } + if (!(ext_oct = M_ASN1_OCTET_STRING_new())) + goto merr; + ext_oct->data = ext_der; + ext_oct->length = ext_len; + + ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); + if (!ext) + goto merr; + M_ASN1_OCTET_STRING_free(ext_oct); + + return ext; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + +} + +/* Given an internal structure, nid and critical flag create an extension */ + +X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) +{ + const X509V3_EXT_METHOD *method; + if (!(method = X509V3_EXT_get_nid(ext_nid))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION); + return NULL; + } + return do_ext_i2d(method, ext_nid, crit, ext_struc); +} + +/* Check the extension string for critical flag */ +static int v3_check_critical(char **value) +{ + char *p = *value; + if ((strlen(p) < 9) || strncmp(p, "critical,", 9)) + return 0; + p += 9; + while (isspace((unsigned char)*p)) + p++; + *value = p; + return 1; +} + +/* Check extension string for generic extension and return the type */ +static int v3_check_generic(char **value) +{ + int gen_type = 0; + char *p = *value; + if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) { + p += 4; + gen_type = 1; + } else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5)) { + p += 5; + gen_type = 2; + } else + return 0; + + while (isspace((unsigned char)*p)) + p++; + *value = p; + return gen_type; +} + +/* Create a generic extension: for now just handle DER type */ +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int gen_type, + X509V3_CTX *ctx) +{ + unsigned char *ext_der = NULL; + long ext_len = 0; + ASN1_OBJECT *obj = NULL; + ASN1_OCTET_STRING *oct = NULL; + X509_EXTENSION *extension = NULL; + if (!(obj = OBJ_txt2obj(ext, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_NAME_ERROR); + ERR_add_error_data(2, "name=", ext); + goto err; + } + + if (gen_type == 1) + ext_der = x509v3_hex_to_bytes(value, &ext_len); + else if (gen_type == 2) + ext_der = generic_asn1(value, ctx, &ext_len); + + if (ext_der == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_VALUE_ERROR); + ERR_add_error_data(2, "value=", value); + goto err; + } + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + oct->data = ext_der; + oct->length = ext_len; + ext_der = NULL; + + extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct); + + err: + ASN1_OBJECT_free(obj); + M_ASN1_OCTET_STRING_free(oct); + if (ext_der) + OPENSSL_free(ext_der); + return extension; + +} + +static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, + long *ext_len) +{ + ASN1_TYPE *typ; + unsigned char *ext_der = NULL; + typ = ASN1_generate_v3(value, ctx); + if (typ == NULL) + return NULL; + *ext_len = i2d_ASN1_TYPE(typ, &ext_der); + ASN1_TYPE_free(typ); + return ext_der; +} + +/* + * This is the main function: add a bunch of extensions based on a config + * file section to an extension STACK. + */ + +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, + STACK_OF(X509_EXTENSION) **sk) +{ + X509_EXTENSION *ext; + STACK_OF(CONF_VALUE) *nval; + CONF_VALUE *val; + size_t i; + if (!(nval = NCONF_get_section(conf, section))) + return 0; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!(ext = X509V3_EXT_nconf(conf, ctx, val->name, val->value))) + return 0; + if (sk) + X509v3_add_ext(sk, ext, -1); + X509_EXTENSION_free(ext); + } + return 1; +} + +/* + * Convenience functions to add extensions to a certificate, CRL and request + */ + +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509 *cert) +{ + STACK_OF(X509_EXTENSION) **sk = NULL; + if (cert) + sk = &cert->cert_info->extensions; + return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); +} + +/* Same as above but for a CRL */ + +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509_CRL *crl) +{ + STACK_OF(X509_EXTENSION) **sk = NULL; + if (crl) + sk = &crl->crl->extensions; + return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); +} + +/* Add extensions to certificate request */ + +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509_REQ *req) +{ + STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL; + int i; + if (req) + sk = &extlist; + i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); + if (!i || !sk) + return i; + i = X509_REQ_add_extensions(req, extlist); + sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free); + return i; +} + +/* Config database functions */ + +char *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) +{ + if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OPERATION_NOT_DEFINED); + return NULL; + } + if (ctx->db_meth->get_string) + return ctx->db_meth->get_string(ctx->db, name, section); + return NULL; +} + +STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section) +{ + if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OPERATION_NOT_DEFINED); + return NULL; + } + if (ctx->db_meth->get_section) + return ctx->db_meth->get_section(ctx->db, section); + return NULL; +} + +void X509V3_string_free(X509V3_CTX *ctx, char *str) +{ + if (!str) + return; + if (ctx->db_meth->free_string) + ctx->db_meth->free_string(ctx->db, str); +} + +void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section) +{ + if (!section) + return; + if (ctx->db_meth->free_section) + ctx->db_meth->free_section(ctx->db, section); +} + +static char *nconf_get_string(void *db, char *section, char *value) +{ + /* TODO(fork): this should return a const value. */ + return (char *)NCONF_get_string(db, section, value); +} + +static STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section) +{ + return NCONF_get_section(db, section); +} + +static const X509V3_CONF_METHOD nconf_method = { + nconf_get_string, + nconf_get_section, + NULL, + NULL +}; + +void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf) +{ + ctx->db_meth = &nconf_method; + ctx->db = conf; +} + +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, + X509_CRL *crl, int flags) +{ + ctx->issuer_cert = issuer; + ctx->subject_cert = subj; + ctx->crl = crl; + ctx->subject_req = req; + ctx->flags = flags; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back new file mode 100644 index 0000000..e98d0fc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back @@ -0,0 +1,463 @@ +/* v3_conf.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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). */ + +/* extension creation utilities */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "internal.h" + +static int v3_check_critical(char **value); +static int v3_check_generic(char **value); +static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value); +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int type, + X509V3_CTX *ctx); +static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, + int ext_nid, int crit, void *ext_struc); +static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, + long *ext_len); +/* CONF *conf: Config file */ +/* char *name: Name */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, + char *value) +{ + int crit; + int ext_type; + X509_EXTENSION *ret; + crit = v3_check_critical(&value); + if ((ext_type = v3_check_generic(&value))) + return v3_generic_extension(name, value, crit, ext_type, ctx); + ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value); + if (!ret) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_IN_EXTENSION); + ERR_add_error_data(4, "name=", name, ", value=", value); + } + return ret; +} + +/* CONF *conf: Config file */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + char *value) +{ + int crit; + int ext_type; + crit = v3_check_critical(&value); + if ((ext_type = v3_check_generic(&value))) + return v3_generic_extension(OBJ_nid2sn(ext_nid), + value, crit, ext_type, ctx); + return do_ext_nconf(conf, ctx, ext_nid, crit, value); +} + +/* CONF *conf: Config file */ +/* char *value: Value */ +static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value) +{ + const X509V3_EXT_METHOD *method; + X509_EXTENSION *ext; + STACK_OF(CONF_VALUE) *nval; + void *ext_struc; + if (ext_nid == NID_undef) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME); + return NULL; + } + if (!(method = X509V3_EXT_get_nid(ext_nid))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION); + return NULL; + } + /* Now get internal extension representation based on type */ + if (method->v2i) { + if (*value == '@') + nval = NCONF_get_section(conf, value + 1); + else + nval = X509V3_parse_list(value); + if (nval == NULL || sk_CONF_VALUE_num(nval) <= 0) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_EXTENSION_STRING); + ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=", + value); + if (*value != '@') + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + return NULL; + } + ext_struc = method->v2i(method, ctx, nval); + if (*value != '@') + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + if (!ext_struc) + return NULL; + } else if (method->s2i) { + if (!(ext_struc = method->s2i(method, ctx, value))) + return NULL; + } else if (method->r2i) { + if (!ctx->db || !ctx->db_meth) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_CONFIG_DATABASE); + return NULL; + } + if (!(ext_struc = method->r2i(method, ctx, value))) + return NULL; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED); + ERR_add_error_data(2, "name=", OBJ_nid2sn(ext_nid)); + return NULL; + } + + ext = do_ext_i2d(method, ext_nid, crit, ext_struc); + if (method->it) + ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it)); + else + method->ext_free(ext_struc); + return ext; + +} + +static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, + int ext_nid, int crit, void *ext_struc) +{ + unsigned char *ext_der; + int ext_len; + ASN1_OCTET_STRING *ext_oct; + X509_EXTENSION *ext; + /* Convert internal representation to DER */ + if (method->it) { + ext_der = NULL; + ext_len = + ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it)); + if (ext_len < 0) + goto merr; + } else { + unsigned char *p; + ext_len = method->i2d(ext_struc, NULL); + if (!(ext_der = OPENSSL_malloc(ext_len))) + goto merr; + p = ext_der; + method->i2d(ext_struc, &p); + } + if (!(ext_oct = M_ASN1_OCTET_STRING_new())) + goto merr; + ext_oct->data = ext_der; + ext_oct->length = ext_len; + + ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); + if (!ext) + goto merr; + M_ASN1_OCTET_STRING_free(ext_oct); + + return ext; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + +} + +/* Given an internal structure, nid and critical flag create an extension */ + +X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) +{ + const X509V3_EXT_METHOD *method; + if (!(method = X509V3_EXT_get_nid(ext_nid))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNKNOWN_EXTENSION); + return NULL; + } + return do_ext_i2d(method, ext_nid, crit, ext_struc); +} + +/* Check the extension string for critical flag */ +static int v3_check_critical(char **value) +{ + char *p = *value; + if ((strlen(p) < 9) || strncmp(p, "critical,", 9)) + return 0; + p += 9; + while (isspace((unsigned char)*p)) + p++; + *value = p; + return 1; +} + +/* Check extension string for generic extension and return the type */ +static int v3_check_generic(char **value) +{ + int gen_type = 0; + char *p = *value; + if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) { + p += 4; + gen_type = 1; + } else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5)) { + p += 5; + gen_type = 2; + } else + return 0; + + while (isspace((unsigned char)*p)) + p++; + *value = p; + return gen_type; +} + +/* Create a generic extension: for now just handle DER type */ +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int gen_type, + X509V3_CTX *ctx) +{ + unsigned char *ext_der = NULL; + long ext_len = 0; + ASN1_OBJECT *obj = NULL; + ASN1_OCTET_STRING *oct = NULL; + X509_EXTENSION *extension = NULL; + if (!(obj = OBJ_txt2obj(ext, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_NAME_ERROR); + ERR_add_error_data(2, "name=", ext); + goto err; + } + + if (gen_type == 1) + ext_der = x509v3_hex_to_bytes(value, &ext_len); + else if (gen_type == 2) + ext_der = generic_asn1(value, ctx, &ext_len); + + if (ext_der == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_VALUE_ERROR); + ERR_add_error_data(2, "value=", value); + goto err; + } + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + oct->data = ext_der; + oct->length = ext_len; + ext_der = NULL; + + extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct); + + err: + ASN1_OBJECT_free(obj); + M_ASN1_OCTET_STRING_free(oct); + if (ext_der) + OPENSSL_free(ext_der); + return extension; + +} + +static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, + long *ext_len) +{ + ASN1_TYPE *typ; + unsigned char *ext_der = NULL; + typ = ASN1_generate_v3(value, ctx); + if (typ == NULL) + return NULL; + *ext_len = i2d_ASN1_TYPE(typ, &ext_der); + ASN1_TYPE_free(typ); + return ext_der; +} + +/* + * This is the main function: add a bunch of extensions based on a config + * file section to an extension STACK. + */ + +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, + STACK_OF(X509_EXTENSION) **sk) +{ + X509_EXTENSION *ext; + STACK_OF(CONF_VALUE) *nval; + CONF_VALUE *val; + size_t i; + if (!(nval = NCONF_get_section(conf, section))) + return 0; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!(ext = X509V3_EXT_nconf(conf, ctx, val->name, val->value))) + return 0; + if (sk) + X509v3_add_ext(sk, ext, -1); + X509_EXTENSION_free(ext); + } + return 1; +} + +/* + * Convenience functions to add extensions to a certificate, CRL and request + */ + +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509 *cert) +{ + STACK_OF(X509_EXTENSION) **sk = NULL; + if (cert) + sk = &cert->cert_info->extensions; + return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); +} + +/* Same as above but for a CRL */ + +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509_CRL *crl) +{ + STACK_OF(X509_EXTENSION) **sk = NULL; + if (crl) + sk = &crl->crl->extensions; + return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); +} + +/* Add extensions to certificate request */ + +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, + X509_REQ *req) +{ + STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL; + int i; + if (req) + sk = &extlist; + i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); + if (!i || !sk) + return i; + i = X509_REQ_add_extensions(req, extlist); + sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free); + return i; +} + +/* Config database functions */ + +char *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) +{ + if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OPERATION_NOT_DEFINED); + return NULL; + } + if (ctx->db_meth->get_string) + return ctx->db_meth->get_string(ctx->db, name, section); + return NULL; +} + +STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section) +{ + if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_OPERATION_NOT_DEFINED); + return NULL; + } + if (ctx->db_meth->get_section) + return ctx->db_meth->get_section(ctx->db, section); + return NULL; +} + +void X509V3_string_free(X509V3_CTX *ctx, char *str) +{ + if (!str) + return; + if (ctx->db_meth->free_string) + ctx->db_meth->free_string(ctx->db, str); +} + +void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section) +{ + if (!section) + return; + if (ctx->db_meth->free_section) + ctx->db_meth->free_section(ctx->db, section); +} + +static char *nconf_get_string(void *db, char *section, char *value) +{ + /* TODO(fork): this should return a const value. */ + return (char *)NCONF_get_string(db, section, value); +} + +static STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section) +{ + return NCONF_get_section(db, section); +} + +static const X509V3_CONF_METHOD nconf_method = { + nconf_get_string, + nconf_get_section, + NULL, + NULL +}; + +void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf) +{ + ctx->db_meth = &nconf_method; + ctx->db = conf; +} + +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, + X509_CRL *crl, int flags) +{ + ctx->issuer_cert = issuer; + ctx->subject_cert = subj; + ctx->crl = crl; + ctx->subject_req = req; + ctx->flags = flags; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c new file mode 100644 index 0000000..c20b57e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c @@ -0,0 +1,503 @@ +/* v3_cpols.c */ +/* + * 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). + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "pcy_int.h" + +/* Certificate policies extension support: this one is a bit complex... */ + +static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, + BIO *out, int indent); +static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value); +static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, + int indent); +static void print_notice(BIO *out, USERNOTICE *notice, int indent); +static POLICYINFO *policy_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *polstrs, int ia5org); +static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *unot, int ia5org); +static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); + +const X509V3_EXT_METHOD v3_cpols = { + NID_certificate_policies, 0, ASN1_ITEM_ref(CERTIFICATEPOLICIES), + 0, 0, 0, 0, + 0, 0, + 0, 0, + (X509V3_EXT_I2R)i2r_certpol, + (X509V3_EXT_R2I)r2i_certpol, + NULL +}; + +ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO) +ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES) + +IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) + +ASN1_SEQUENCE(POLICYINFO) = { + ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT), + ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO) +} ASN1_SEQUENCE_END(POLICYINFO) + +IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO) + +ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY); + +ASN1_ADB(POLICYQUALINFO) = { + ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)), + ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE)) +} ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL); + +ASN1_SEQUENCE(POLICYQUALINFO) = { + ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT), + ASN1_ADB_OBJECT(POLICYQUALINFO) +} ASN1_SEQUENCE_END(POLICYQUALINFO) + +IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO) + +ASN1_SEQUENCE(USERNOTICE) = { + ASN1_OPT(USERNOTICE, noticeref, NOTICEREF), + ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT) +} ASN1_SEQUENCE_END(USERNOTICE) + +IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE) + +ASN1_SEQUENCE(NOTICEREF) = { + ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT), + ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER) +} ASN1_SEQUENCE_END(NOTICEREF) + +IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF) + +static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value) +{ + STACK_OF(POLICYINFO) *pols = NULL; + char *pstr; + POLICYINFO *pol; + ASN1_OBJECT *pobj; + STACK_OF(CONF_VALUE) *vals; + CONF_VALUE *cnf; + size_t i; + int ia5org; + pols = sk_POLICYINFO_new_null(); + if (pols == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + vals = X509V3_parse_list(value); + if (vals == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_X509V3_LIB); + goto err; + } + ia5org = 0; + for (i = 0; i < sk_CONF_VALUE_num(vals); i++) { + cnf = sk_CONF_VALUE_value(vals, i); + if (cnf->value || !cnf->name) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pstr = cnf->name; + if (!strcmp(pstr, "ia5org")) { + ia5org = 1; + continue; + } else if (*pstr == '@') { + STACK_OF(CONF_VALUE) *polsect; + polsect = X509V3_get_section(ctx, pstr + 1); + if (!polsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + + X509V3_conf_err(cnf); + goto err; + } + pol = policy_section(ctx, polsect, ia5org); + X509V3_section_free(ctx, polsect); + if (!pol) + goto err; + } else { + if (!(pobj = OBJ_txt2obj(cnf->name, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pol = POLICYINFO_new(); + if (pol == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ASN1_OBJECT_free(pobj); + goto err; + } + pol->policyid = pobj; + } + if (!sk_POLICYINFO_push(pols, pol)) { + POLICYINFO_free(pol); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + return pols; + err: + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + sk_POLICYINFO_pop_free(pols, POLICYINFO_free); + return NULL; +} + +static POLICYINFO *policy_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *polstrs, int ia5org) +{ + size_t i; + CONF_VALUE *cnf; + POLICYINFO *pol; + POLICYQUALINFO *qual; + if (!(pol = POLICYINFO_new())) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(polstrs); i++) { + cnf = sk_CONF_VALUE_value(polstrs, i); + if (!strcmp(cnf->name, "policyIdentifier")) { + ASN1_OBJECT *pobj; + if (!(pobj = OBJ_txt2obj(cnf->value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pol->policyid = pobj; + + } else if (!x509v3_name_cmp(cnf->name, "CPS")) { + if (!pol->qualifiers) + pol->qualifiers = sk_POLICYQUALINFO_new_null(); + if (!(qual = POLICYQUALINFO_new())) + goto merr; + if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) + goto merr; + /* TODO(fork): const correctness */ + qual->pqualid = (ASN1_OBJECT *)OBJ_nid2obj(NID_id_qt_cps); + if (qual->pqualid == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); + goto err; + } + qual->d.cpsuri = M_ASN1_IA5STRING_new(); + if (qual->d.cpsuri == NULL) { + goto err; + } + if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value, + strlen(cnf->value))) + goto merr; + } 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); + X509V3_conf_err(cnf); + goto err; + } + unot = X509V3_get_section(ctx, cnf->value + 1); + if (!unot) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + + X509V3_conf_err(cnf); + goto err; + } + qual = notice_section(ctx, unot, ia5org); + X509V3_section_free(ctx, unot); + if (!qual) + goto err; + if (!pol->qualifiers) + pol->qualifiers = sk_POLICYQUALINFO_new_null(); + if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) + goto merr; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); + + X509V3_conf_err(cnf); + goto err; + } + } + if (!pol->policyid) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_POLICY_IDENTIFIER); + goto err; + } + + return pol; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + POLICYINFO_free(pol); + return NULL; + +} + +static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *unot, int ia5org) +{ + size_t i; + int ret; + CONF_VALUE *cnf; + USERNOTICE *not; + POLICYQUALINFO *qual; + if (!(qual = POLICYQUALINFO_new())) + goto merr; + /* TODO(fork): const correctness */ + qual->pqualid = (ASN1_OBJECT *)OBJ_nid2obj(NID_id_qt_unotice); + if (qual->pqualid == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!(not = USERNOTICE_new())) + goto merr; + qual->d.usernotice = not; + for (i = 0; i < sk_CONF_VALUE_num(unot); i++) { + cnf = sk_CONF_VALUE_value(unot, i); + if (!strcmp(cnf->name, "explicitText")) { + not->exptext = M_ASN1_VISIBLESTRING_new(); + if (not->exptext == NULL) + goto merr; + if (!ASN1_STRING_set(not->exptext, cnf->value, + strlen(cnf->value))) + goto merr; + } else if (!strcmp(cnf->name, "organization")) { + NOTICEREF *nref; + if (!not->noticeref) { + if (!(nref = NOTICEREF_new())) + goto merr; + not->noticeref = nref; + } else + nref = not->noticeref; + if (ia5org) + nref->organization->type = V_ASN1_IA5STRING; + else + nref->organization->type = V_ASN1_VISIBLESTRING; + if (!ASN1_STRING_set(nref->organization, cnf->value, + strlen(cnf->value))) + goto merr; + } else if (!strcmp(cnf->name, "noticeNumbers")) { + NOTICEREF *nref; + STACK_OF(CONF_VALUE) *nos; + if (!not->noticeref) { + if (!(nref = NOTICEREF_new())) + goto merr; + not->noticeref = nref; + } else + nref = not->noticeref; + nos = X509V3_parse_list(cnf->value); + if (!nos || !sk_CONF_VALUE_num(nos)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBERS); + X509V3_conf_err(cnf); + goto err; + } + ret = nref_nos(nref->noticenos, nos); + sk_CONF_VALUE_pop_free(nos, X509V3_conf_free); + if (!ret) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); + X509V3_conf_err(cnf); + goto err; + } + } + + if (not->noticeref && + (!not->noticeref->noticenos || !not->noticeref->organization)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS); + goto err; + } + + return qual; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + POLICYQUALINFO_free(qual); + return NULL; +} + +static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos) +{ + CONF_VALUE *cnf; + ASN1_INTEGER *aint; + + size_t i; + + for (i = 0; i < sk_CONF_VALUE_num(nos); i++) { + cnf = sk_CONF_VALUE_value(nos, i); + if (!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBER); + goto err; + } + if (!sk_ASN1_INTEGER_push(nnums, aint)) + goto merr; + } + return 1; + + merr: + ASN1_INTEGER_free(aint); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + return 0; +} + +static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, + BIO *out, int indent) +{ + size_t i; + POLICYINFO *pinfo; + /* First print out the policy OIDs */ + for (i = 0; i < sk_POLICYINFO_num(pol); i++) { + pinfo = sk_POLICYINFO_value(pol, i); + BIO_printf(out, "%*sPolicy: ", indent, ""); + i2a_ASN1_OBJECT(out, pinfo->policyid); + BIO_puts(out, "\n"); + if (pinfo->qualifiers) + print_qualifiers(out, pinfo->qualifiers, indent + 2); + } + return 1; +} + +static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, + int indent) +{ + POLICYQUALINFO *qualinfo; + size_t i; + for (i = 0; i < sk_POLICYQUALINFO_num(quals); i++) { + qualinfo = sk_POLICYQUALINFO_value(quals, i); + switch (OBJ_obj2nid(qualinfo->pqualid)) { + case NID_id_qt_cps: + BIO_printf(out, "%*sCPS: %s\n", indent, "", + qualinfo->d.cpsuri->data); + break; + + case NID_id_qt_unotice: + BIO_printf(out, "%*sUser Notice:\n", indent, ""); + print_notice(out, qualinfo->d.usernotice, indent + 2); + break; + + default: + BIO_printf(out, "%*sUnknown Qualifier: ", indent + 2, ""); + + i2a_ASN1_OBJECT(out, qualinfo->pqualid); + BIO_puts(out, "\n"); + break; + } + } +} + +static void print_notice(BIO *out, USERNOTICE *notice, int indent) +{ + size_t i; + if (notice->noticeref) { + NOTICEREF *ref; + ref = notice->noticeref; + BIO_printf(out, "%*sOrganization: %s\n", indent, "", + ref->organization->data); + BIO_printf(out, "%*sNumber%s: ", indent, "", + sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : ""); + for (i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) { + ASN1_INTEGER *num; + char *tmp; + num = sk_ASN1_INTEGER_value(ref->noticenos, i); + if (i) + BIO_puts(out, ", "); + if (num == NULL) + BIO_puts(out, "(null)"); + else { + tmp = i2s_ASN1_INTEGER(NULL, num); + if (tmp == NULL) + return; + BIO_puts(out, tmp); + OPENSSL_free(tmp); + } + } + BIO_puts(out, "\n"); + } + if (notice->exptext) + BIO_printf(out, "%*sExplicit Text: %s\n", indent, "", + notice->exptext->data); +} + +void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent) +{ + const X509_POLICY_DATA *dat = node->data; + + BIO_printf(out, "%*sPolicy: ", indent, ""); + + i2a_ASN1_OBJECT(out, dat->valid_policy); + BIO_puts(out, "\n"); + BIO_printf(out, "%*s%s\n", indent + 2, "", + node_data_critical(dat) ? "Critical" : "Non Critical"); + if (dat->qualifier_set) + print_qualifiers(out, dat->qualifier_set, indent + 2); + else + BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back new file mode 100644 index 0000000..18d260b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back @@ -0,0 +1,503 @@ +/* v3_cpols.c */ +/* + * 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). + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "pcy_int.h" + +/* Certificate policies extension support: this one is a bit complex... */ + +static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, + BIO *out, int indent); +static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value); +static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, + int indent); +static void print_notice(BIO *out, USERNOTICE *notice, int indent); +static POLICYINFO *policy_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *polstrs, int ia5org); +static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *unot, int ia5org); +static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); + +const X509V3_EXT_METHOD v3_cpols = { + NID_certificate_policies, 0, ASN1_ITEM_ref(CERTIFICATEPOLICIES), + 0, 0, 0, 0, + 0, 0, + 0, 0, + (X509V3_EXT_I2R)i2r_certpol, + (X509V3_EXT_R2I)r2i_certpol, + NULL +}; + +ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO) +ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES) + +IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) + +ASN1_SEQUENCE(POLICYINFO) = { + ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT), + ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO) +} ASN1_SEQUENCE_END(POLICYINFO) + +IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO) + +ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY); + +ASN1_ADB(POLICYQUALINFO) = { + ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)), + ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE)) +} ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL); + +ASN1_SEQUENCE(POLICYQUALINFO) = { + ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT), + ASN1_ADB_OBJECT(POLICYQUALINFO) +} ASN1_SEQUENCE_END(POLICYQUALINFO) + +IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO) + +ASN1_SEQUENCE(USERNOTICE) = { + ASN1_OPT(USERNOTICE, noticeref, NOTICEREF), + ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT) +} ASN1_SEQUENCE_END(USERNOTICE) + +IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE) + +ASN1_SEQUENCE(NOTICEREF) = { + ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT), + ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER) +} ASN1_SEQUENCE_END(NOTICEREF) + +IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF) + +static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value) +{ + STACK_OF(POLICYINFO) *pols = NULL; + char *pstr; + POLICYINFO *pol; + ASN1_OBJECT *pobj; + STACK_OF(CONF_VALUE) *vals; + CONF_VALUE *cnf; + size_t i; + int ia5org; + pols = sk_POLICYINFO_new_null(); + if (pols == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + vals = X509V3_parse_list(value); + if (vals == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_X509V3_LIB); + goto err; + } + ia5org = 0; + for (i = 0; i < sk_CONF_VALUE_num(vals); i++) { + cnf = sk_CONF_VALUE_value(vals, i); + if (cnf->value || !cnf->name) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pstr = cnf->name; + if (!strcmp(pstr, "ia5org")) { + ia5org = 1; + continue; + } else if (*pstr == '@') { + STACK_OF(CONF_VALUE) *polsect; + polsect = X509V3_get_section(ctx, pstr + 1); + if (!polsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + + X509V3_conf_err(cnf); + goto err; + } + pol = policy_section(ctx, polsect, ia5org); + X509V3_section_free(ctx, polsect); + if (!pol) + goto err; + } else { + if (!(pobj = OBJ_txt2obj(cnf->name, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pol = POLICYINFO_new(); + if (pol == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ASN1_OBJECT_free(pobj); + goto err; + } + pol->policyid = pobj; + } + if (!sk_POLICYINFO_push(pols, pol)) { + POLICYINFO_free(pol); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + } + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + return pols; + err: + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + sk_POLICYINFO_pop_free(pols, POLICYINFO_free); + return NULL; +} + +static POLICYINFO *policy_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *polstrs, int ia5org) +{ + size_t i; + CONF_VALUE *cnf; + POLICYINFO *pol; + POLICYQUALINFO *qual; + if (!(pol = POLICYINFO_new())) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(polstrs); i++) { + cnf = sk_CONF_VALUE_value(polstrs, i); + if (!strcmp(cnf->name, "policyIdentifier")) { + ASN1_OBJECT *pobj; + if (!(pobj = OBJ_txt2obj(cnf->value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(cnf); + goto err; + } + pol->policyid = pobj; + + } else if (!x509v3_name_cmp(cnf->name, "CPS")) { + if (!pol->qualifiers) + pol->qualifiers = sk_POLICYQUALINFO_new_null(); + if (!(qual = POLICYQUALINFO_new())) + goto merr; + if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) + goto merr; + /* TODO(fork): const correctness */ + qual->pqualid = (ASN1_OBJECT *)OBJ_nid2obj(NID_id_qt_cps); + if (qual->pqualid == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); + goto err; + } + qual->d.cpsuri = M_ASN1_IA5STRING_new(); + if (qual->d.cpsuri == NULL) { + goto err; + } + if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value, + strlen(cnf->value))) + goto merr; + } 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); + X509V3_conf_err(cnf); + goto err; + } + unot = X509V3_get_section(ctx, cnf->value + 1); + if (!unot) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + + X509V3_conf_err(cnf); + goto err; + } + qual = notice_section(ctx, unot, ia5org); + X509V3_section_free(ctx, unot); + if (!qual) + goto err; + if (!pol->qualifiers) + pol->qualifiers = sk_POLICYQUALINFO_new_null(); + if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) + goto merr; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); + + X509V3_conf_err(cnf); + goto err; + } + } + if (!pol->policyid) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_POLICY_IDENTIFIER); + goto err; + } + + return pol; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + POLICYINFO_free(pol); + return NULL; + +} + +static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *unot, int ia5org) +{ + size_t i; + int ret; + CONF_VALUE *cnf; + USERNOTICE *not; + POLICYQUALINFO *qual; + if (!(qual = POLICYQUALINFO_new())) + goto merr; + /* TODO(fork): const correctness */ + qual->pqualid = (ASN1_OBJECT *)OBJ_nid2obj(NID_id_qt_unotice); + if (qual->pqualid == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!(not = USERNOTICE_new())) + goto merr; + qual->d.usernotice = not; + for (i = 0; i < sk_CONF_VALUE_num(unot); i++) { + cnf = sk_CONF_VALUE_value(unot, i); + if (!strcmp(cnf->name, "explicitText")) { + not->exptext = M_ASN1_VISIBLESTRING_new(); + if (not->exptext == NULL) + goto merr; + if (!ASN1_STRING_set(not->exptext, cnf->value, + strlen(cnf->value))) + goto merr; + } else if (!strcmp(cnf->name, "organization")) { + NOTICEREF *nref; + if (!not->noticeref) { + if (!(nref = NOTICEREF_new())) + goto merr; + not->noticeref = nref; + } else + nref = not->noticeref; + if (ia5org) + nref->organization->type = V_ASN1_IA5STRING; + else + nref->organization->type = V_ASN1_VISIBLESTRING; + if (!ASN1_STRING_set(nref->organization, cnf->value, + strlen(cnf->value))) + goto merr; + } else if (!strcmp(cnf->name, "noticeNumbers")) { + NOTICEREF *nref; + STACK_OF(CONF_VALUE) *nos; + if (!not->noticeref) { + if (!(nref = NOTICEREF_new())) + goto merr; + not->noticeref = nref; + } else + nref = not->noticeref; + nos = X509V3_parse_list(cnf->value); + if (!nos || !sk_CONF_VALUE_num(nos)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBERS); + X509V3_conf_err(cnf); + goto err; + } + ret = nref_nos(nref->noticenos, nos); + sk_CONF_VALUE_pop_free(nos, X509V3_conf_free); + if (!ret) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); + X509V3_conf_err(cnf); + goto err; + } + } + + if (not->noticeref && + (!not->noticeref->noticenos || !not->noticeref->organization)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS); + goto err; + } + + return qual; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + POLICYQUALINFO_free(qual); + return NULL; +} + +static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos) +{ + CONF_VALUE *cnf; + ASN1_INTEGER *aint; + + size_t i; + + for (i = 0; i < sk_CONF_VALUE_num(nos); i++) { + cnf = sk_CONF_VALUE_value(nos, i); + if (!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBER); + goto err; + } + if (!sk_ASN1_INTEGER_push(nnums, aint)) + goto merr; + } + return 1; + + merr: + ASN1_INTEGER_free(aint); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + + err: + return 0; +} + +static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, + BIO *out, int indent) +{ + size_t i; + POLICYINFO *pinfo; + /* First print out the policy OIDs */ + for (i = 0; i < sk_POLICYINFO_num(pol); i++) { + pinfo = sk_POLICYINFO_value(pol, i); + BIO_printf(out, "%*sPolicy: ", indent, ""); + i2a_ASN1_OBJECT(out, pinfo->policyid); + BIO_puts(out, "\n"); + if (pinfo->qualifiers) + print_qualifiers(out, pinfo->qualifiers, indent + 2); + } + return 1; +} + +static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, + int indent) +{ + POLICYQUALINFO *qualinfo; + size_t i; + for (i = 0; i < sk_POLICYQUALINFO_num(quals); i++) { + qualinfo = sk_POLICYQUALINFO_value(quals, i); + switch (OBJ_obj2nid(qualinfo->pqualid)) { + case NID_id_qt_cps: + BIO_printf(out, "%*sCPS: %s\n", indent, "", + qualinfo->d.cpsuri->data); + break; + + case NID_id_qt_unotice: + BIO_printf(out, "%*sUser Notice:\n", indent, ""); + print_notice(out, qualinfo->d.usernotice, indent + 2); + break; + + default: + BIO_printf(out, "%*sUnknown Qualifier: ", indent + 2, ""); + + i2a_ASN1_OBJECT(out, qualinfo->pqualid); + BIO_puts(out, "\n"); + break; + } + } +} + +static void print_notice(BIO *out, USERNOTICE *notice, int indent) +{ + size_t i; + if (notice->noticeref) { + NOTICEREF *ref; + ref = notice->noticeref; + BIO_printf(out, "%*sOrganization: %s\n", indent, "", + ref->organization->data); + BIO_printf(out, "%*sNumber%s: ", indent, "", + sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : ""); + for (i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) { + ASN1_INTEGER *num; + char *tmp; + num = sk_ASN1_INTEGER_value(ref->noticenos, i); + if (i) + BIO_puts(out, ", "); + if (num == NULL) + BIO_puts(out, "(null)"); + else { + tmp = i2s_ASN1_INTEGER(NULL, num); + if (tmp == NULL) + return; + BIO_puts(out, tmp); + OPENSSL_free(tmp); + } + } + BIO_puts(out, "\n"); + } + if (notice->exptext) + BIO_printf(out, "%*sExplicit Text: %s\n", indent, "", + notice->exptext->data); +} + +void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent) +{ + const X509_POLICY_DATA *dat = node->data; + + BIO_printf(out, "%*sPolicy: ", indent, ""); + + i2a_ASN1_OBJECT(out, dat->valid_policy); + BIO_puts(out, "\n"); + BIO_printf(out, "%*s%s\n", indent + 2, "", + node_data_critical(dat) ? "Critical" : "Non Critical"); + if (dat->qualifier_set) + print_qualifiers(out, dat->qualifier_set, indent + 2); + else + BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c new file mode 100644 index 0000000..d0c64cf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c @@ -0,0 +1,561 @@ +/* v3_crld.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 + +static void *v2i_crld(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, + int indent); + +const X509V3_EXT_METHOD v3_crld = { + NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_crld, + i2r_crldp, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_freshest_crl = { + NID_freshest_crl, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_crld, + i2r_crldp, 0, + NULL +}; + +static STACK_OF(GENERAL_NAME) *gnames_from_sectname(X509V3_CTX *ctx, + char *sect) +{ + STACK_OF(CONF_VALUE) *gnsect; + STACK_OF(GENERAL_NAME) *gens; + if (*sect == '@') + gnsect = X509V3_get_section(ctx, sect + 1); + else + gnsect = X509V3_parse_list(sect); + if (!gnsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + return NULL; + } + gens = v2i_GENERAL_NAMES(NULL, ctx, gnsect); + if (*sect == '@') + X509V3_section_free(ctx, gnsect); + else + sk_CONF_VALUE_pop_free(gnsect, X509V3_conf_free); + return gens; +} + +static int set_dist_point_name(DIST_POINT_NAME **pdp, X509V3_CTX *ctx, + CONF_VALUE *cnf) +{ + STACK_OF(GENERAL_NAME) *fnm = NULL; + STACK_OF(X509_NAME_ENTRY) *rnm = NULL; + if (!strncmp(cnf->name, "fullname", 9)) { + fnm = gnames_from_sectname(ctx, cnf->value); + if (!fnm) + goto err; + } else if (!strcmp(cnf->name, "relativename")) { + int ret; + STACK_OF(CONF_VALUE) *dnsect; + X509_NAME *nm; + nm = X509_NAME_new(); + if (!nm) + return -1; + dnsect = X509V3_get_section(ctx, cnf->value); + if (!dnsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + return -1; + } + ret = X509V3_NAME_from_section(nm, dnsect, MBSTRING_ASC); + X509V3_section_free(ctx, dnsect); + rnm = nm->entries; + nm->entries = NULL; + X509_NAME_free(nm); + if (!ret || sk_X509_NAME_ENTRY_num(rnm) <= 0) + goto err; + /* + * Since its a name fragment can't have more than one RDNSequence + */ + if (sk_X509_NAME_ENTRY_value(rnm, + sk_X509_NAME_ENTRY_num(rnm) - 1)->set) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_MULTIPLE_RDNS); + goto err; + } + } else + return 0; + + if (*pdp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DISTPOINT_ALREADY_SET); + goto err; + } + + *pdp = DIST_POINT_NAME_new(); + if (!*pdp) + goto err; + if (fnm) { + (*pdp)->type = 0; + (*pdp)->name.fullname = fnm; + } else { + (*pdp)->type = 1; + (*pdp)->name.relativename = rnm; + } + + return 1; + + err: + if (fnm) + sk_GENERAL_NAME_pop_free(fnm, GENERAL_NAME_free); + if (rnm) + sk_X509_NAME_ENTRY_pop_free(rnm, X509_NAME_ENTRY_free); + return -1; +} + +static const BIT_STRING_BITNAME reason_flags[] = { + {0, "Unused", "unused"}, + {1, "Key Compromise", "keyCompromise"}, + {2, "CA Compromise", "CACompromise"}, + {3, "Affiliation Changed", "affiliationChanged"}, + {4, "Superseded", "superseded"}, + {5, "Cessation Of Operation", "cessationOfOperation"}, + {6, "Certificate Hold", "certificateHold"}, + {7, "Privilege Withdrawn", "privilegeWithdrawn"}, + {8, "AA Compromise", "AACompromise"}, + {-1, NULL, NULL} +}; + +static int set_reasons(ASN1_BIT_STRING **preas, char *value) +{ + STACK_OF(CONF_VALUE) *rsk = NULL; + const BIT_STRING_BITNAME *pbn; + const char *bnam; + size_t i; + int ret = 0; + rsk = X509V3_parse_list(value); + if (!rsk) + return 0; + if (*preas) + return 0; + for (i = 0; i < sk_CONF_VALUE_num(rsk); i++) { + bnam = sk_CONF_VALUE_value(rsk, i)->name; + if (!*preas) { + *preas = ASN1_BIT_STRING_new(); + if (!*preas) + goto err; + } + for (pbn = reason_flags; pbn->lname; pbn++) { + if (!strcmp(pbn->sname, bnam)) { + if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1)) + goto err; + break; + } + } + if (!pbn->lname) + goto err; + } + ret = 1; + + err: + sk_CONF_VALUE_pop_free(rsk, X509V3_conf_free); + return ret; +} + +static int print_reasons(BIO *out, const char *rname, + ASN1_BIT_STRING *rflags, int indent) +{ + int first = 1; + const BIT_STRING_BITNAME *pbn; + BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, ""); + for (pbn = reason_flags; pbn->lname; pbn++) { + if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) { + if (first) + first = 0; + else + BIO_puts(out, ", "); + BIO_puts(out, pbn->lname); + } + } + if (first) + BIO_puts(out, "\n"); + else + BIO_puts(out, "\n"); + return 1; +} + +static DIST_POINT *crldp_from_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + size_t i; + CONF_VALUE *cnf; + DIST_POINT *point = NULL; + point = DIST_POINT_new(); + if (!point) + goto err; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + int ret; + cnf = sk_CONF_VALUE_value(nval, i); + ret = set_dist_point_name(&point->distpoint, ctx, cnf); + if (ret > 0) + continue; + if (ret < 0) + goto err; + if (!strcmp(cnf->name, "reasons")) { + if (!set_reasons(&point->reasons, cnf->value)) + goto err; + } else if (!strcmp(cnf->name, "CRLissuer")) { + point->CRLissuer = gnames_from_sectname(ctx, cnf->value); + if (!point->CRLissuer) + goto err; + } + } + + return point; + + err: + if (point) + DIST_POINT_free(point); + return NULL; +} + +static void *v2i_crld(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + STACK_OF(DIST_POINT) *crld = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gen = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(crld = sk_DIST_POINT_new_null())) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + DIST_POINT *point; + cnf = sk_CONF_VALUE_value(nval, i); + if (!cnf->value) { + STACK_OF(CONF_VALUE) *dpsect; + dpsect = X509V3_get_section(ctx, cnf->name); + if (!dpsect) + goto err; + point = crldp_from_section(ctx, dpsect); + X509V3_section_free(ctx, dpsect); + if (!point) + goto err; + if (!sk_DIST_POINT_push(crld, point)) { + DIST_POINT_free(point); + goto merr; + } + } else { + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + if (!(gens = GENERAL_NAMES_new())) + goto merr; + if (!sk_GENERAL_NAME_push(gens, gen)) + goto merr; + gen = NULL; + if (!(point = DIST_POINT_new())) + goto merr; + if (!sk_DIST_POINT_push(crld, point)) { + DIST_POINT_free(point); + goto merr; + } + if (!(point->distpoint = DIST_POINT_NAME_new())) + goto merr; + point->distpoint->name.fullname = gens; + point->distpoint->type = 0; + gens = NULL; + } + } + return crld; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + GENERAL_NAME_free(gen); + GENERAL_NAMES_free(gens); + sk_DIST_POINT_pop_free(crld, DIST_POINT_free); + return NULL; +} + +IMPLEMENT_ASN1_SET_OF(DIST_POINT) + +static int dpn_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval; + + switch (operation) { + case ASN1_OP_NEW_POST: + dpn->dpname = NULL; + break; + + case ASN1_OP_FREE_POST: + if (dpn->dpname) + X509_NAME_free(dpn->dpname); + break; + } + return 1; +} + + +ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = { + ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0), + ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) +} ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type) + + +IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME) + +ASN1_SEQUENCE(DIST_POINT) = { + ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0), + ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1), + ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2) +} ASN1_SEQUENCE_END(DIST_POINT) + +IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT) + +ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, DIST_POINT) +ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) + +IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS) + +ASN1_SEQUENCE(ISSUING_DIST_POINT) = { + ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3), + ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5) +} ASN1_SEQUENCE_END(ISSUING_DIST_POINT) + +IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + +static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, + int indent); +static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); + +const X509V3_EXT_METHOD v3_idp = { + NID_issuing_distribution_point, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(ISSUING_DIST_POINT), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_idp, + i2r_idp, 0, + NULL +}; + +static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + ISSUING_DIST_POINT *idp = NULL; + CONF_VALUE *cnf; + char *name, *val; + size_t i; + int ret; + idp = ISSUING_DIST_POINT_new(); + if (!idp) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + name = cnf->name; + val = cnf->value; + ret = set_dist_point_name(&idp->distpoint, ctx, cnf); + if (ret > 0) + continue; + if (ret < 0) + goto err; + if (!strcmp(name, "onlyuser")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyuser)) + goto err; + } else if (!strcmp(name, "onlyCA")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyCA)) + goto err; + } else if (!strcmp(name, "onlyAA")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyattr)) + goto err; + } else if (!strcmp(name, "indirectCRL")) { + if (!X509V3_get_value_bool(cnf, &idp->indirectCRL)) + goto err; + } else if (!strcmp(name, "onlysomereasons")) { + if (!set_reasons(&idp->onlysomereasons, val)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(cnf); + goto err; + } + } + return idp; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + ISSUING_DIST_POINT_free(idp); + return NULL; +} + +static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent) +{ + size_t i; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + BIO_printf(out, "%*s", indent + 2, ""); + GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i)); + BIO_puts(out, "\n"); + } + return 1; +} + +static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent) +{ + if (dpn->type == 0) { + BIO_printf(out, "%*sFull Name:\n", indent, ""); + print_gens(out, dpn->name.fullname, indent); + } else { + X509_NAME ntmp; + ntmp.entries = dpn->name.relativename; + BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, ""); + X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE); + BIO_puts(out, "\n"); + } + return 1; +} + +static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, + int indent) +{ + ISSUING_DIST_POINT *idp = pidp; + if (idp->distpoint) + print_distpoint(out, idp->distpoint, indent); + if (idp->onlyuser > 0) + BIO_printf(out, "%*sOnly User Certificates\n", indent, ""); + if (idp->onlyCA > 0) + BIO_printf(out, "%*sOnly CA Certificates\n", indent, ""); + if (idp->indirectCRL > 0) + BIO_printf(out, "%*sIndirect CRL\n", indent, ""); + if (idp->onlysomereasons) + print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent); + if (idp->onlyattr > 0) + BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, ""); + if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0) + && (idp->indirectCRL <= 0) && !idp->onlysomereasons + && (idp->onlyattr <= 0)) + BIO_printf(out, "%*s\n", indent, ""); + + return 1; +} + +static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, + int indent) +{ + STACK_OF(DIST_POINT) *crld = pcrldp; + DIST_POINT *point; + size_t i; + for (i = 0; i < sk_DIST_POINT_num(crld); i++) { + BIO_puts(out, "\n"); + point = sk_DIST_POINT_value(crld, i); + if (point->distpoint) + print_distpoint(out, point->distpoint, indent); + if (point->reasons) + print_reasons(out, "Reasons", point->reasons, indent); + if (point->CRLissuer) { + BIO_printf(out, "%*sCRL Issuer:\n", indent, ""); + print_gens(out, point->CRLissuer, indent); + } + } + return 1; +} + +int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname) +{ + size_t i; + STACK_OF(X509_NAME_ENTRY) *frag; + X509_NAME_ENTRY *ne; + if (!dpn || (dpn->type != 1)) + return 1; + frag = dpn->name.relativename; + dpn->dpname = X509_NAME_dup(iname); + if (!dpn->dpname) + return 0; + for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) { + ne = sk_X509_NAME_ENTRY_value(frag, i); + if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1)) { + X509_NAME_free(dpn->dpname); + dpn->dpname = NULL; + return 0; + } + } + /* generate cached encoding of name */ + if (i2d_X509_NAME(dpn->dpname, NULL) < 0) { + X509_NAME_free(dpn->dpname); + dpn->dpname = NULL; + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c.grpc_back new file mode 100644 index 0000000..c93c449 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c.grpc_back @@ -0,0 +1,561 @@ +/* v3_crld.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 + +static void *v2i_crld(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, + int indent); + +const X509V3_EXT_METHOD v3_crld = { + NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_crld, + i2r_crldp, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_freshest_crl = { + NID_freshest_crl, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_crld, + i2r_crldp, 0, + NULL +}; + +static STACK_OF(GENERAL_NAME) *gnames_from_sectname(X509V3_CTX *ctx, + char *sect) +{ + STACK_OF(CONF_VALUE) *gnsect; + STACK_OF(GENERAL_NAME) *gens; + if (*sect == '@') + gnsect = X509V3_get_section(ctx, sect + 1); + else + gnsect = X509V3_parse_list(sect); + if (!gnsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + return NULL; + } + gens = v2i_GENERAL_NAMES(NULL, ctx, gnsect); + if (*sect == '@') + X509V3_section_free(ctx, gnsect); + else + sk_CONF_VALUE_pop_free(gnsect, X509V3_conf_free); + return gens; +} + +static int set_dist_point_name(DIST_POINT_NAME **pdp, X509V3_CTX *ctx, + CONF_VALUE *cnf) +{ + STACK_OF(GENERAL_NAME) *fnm = NULL; + STACK_OF(X509_NAME_ENTRY) *rnm = NULL; + if (!strncmp(cnf->name, "fullname", 9)) { + fnm = gnames_from_sectname(ctx, cnf->value); + if (!fnm) + goto err; + } else if (!strcmp(cnf->name, "relativename")) { + int ret; + STACK_OF(CONF_VALUE) *dnsect; + X509_NAME *nm; + nm = X509_NAME_new(); + if (!nm) + return -1; + dnsect = X509V3_get_section(ctx, cnf->value); + if (!dnsect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND); + return -1; + } + ret = X509V3_NAME_from_section(nm, dnsect, MBSTRING_ASC); + X509V3_section_free(ctx, dnsect); + rnm = nm->entries; + nm->entries = NULL; + X509_NAME_free(nm); + if (!ret || sk_X509_NAME_ENTRY_num(rnm) <= 0) + goto err; + /* + * Since its a name fragment can't have more than one RDNSequence + */ + if (sk_X509_NAME_ENTRY_value(rnm, + sk_X509_NAME_ENTRY_num(rnm) - 1)->set) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_MULTIPLE_RDNS); + goto err; + } + } else + return 0; + + if (*pdp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DISTPOINT_ALREADY_SET); + goto err; + } + + *pdp = DIST_POINT_NAME_new(); + if (!*pdp) + goto err; + if (fnm) { + (*pdp)->type = 0; + (*pdp)->name.fullname = fnm; + } else { + (*pdp)->type = 1; + (*pdp)->name.relativename = rnm; + } + + return 1; + + err: + if (fnm) + sk_GENERAL_NAME_pop_free(fnm, GENERAL_NAME_free); + if (rnm) + sk_X509_NAME_ENTRY_pop_free(rnm, X509_NAME_ENTRY_free); + return -1; +} + +static const BIT_STRING_BITNAME reason_flags[] = { + {0, "Unused", "unused"}, + {1, "Key Compromise", "keyCompromise"}, + {2, "CA Compromise", "CACompromise"}, + {3, "Affiliation Changed", "affiliationChanged"}, + {4, "Superseded", "superseded"}, + {5, "Cessation Of Operation", "cessationOfOperation"}, + {6, "Certificate Hold", "certificateHold"}, + {7, "Privilege Withdrawn", "privilegeWithdrawn"}, + {8, "AA Compromise", "AACompromise"}, + {-1, NULL, NULL} +}; + +static int set_reasons(ASN1_BIT_STRING **preas, char *value) +{ + STACK_OF(CONF_VALUE) *rsk = NULL; + const BIT_STRING_BITNAME *pbn; + const char *bnam; + size_t i; + int ret = 0; + rsk = X509V3_parse_list(value); + if (!rsk) + return 0; + if (*preas) + return 0; + for (i = 0; i < sk_CONF_VALUE_num(rsk); i++) { + bnam = sk_CONF_VALUE_value(rsk, i)->name; + if (!*preas) { + *preas = ASN1_BIT_STRING_new(); + if (!*preas) + goto err; + } + for (pbn = reason_flags; pbn->lname; pbn++) { + if (!strcmp(pbn->sname, bnam)) { + if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1)) + goto err; + break; + } + } + if (!pbn->lname) + goto err; + } + ret = 1; + + err: + sk_CONF_VALUE_pop_free(rsk, X509V3_conf_free); + return ret; +} + +static int print_reasons(BIO *out, const char *rname, + ASN1_BIT_STRING *rflags, int indent) +{ + int first = 1; + const BIT_STRING_BITNAME *pbn; + BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, ""); + for (pbn = reason_flags; pbn->lname; pbn++) { + if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) { + if (first) + first = 0; + else + BIO_puts(out, ", "); + BIO_puts(out, pbn->lname); + } + } + if (first) + BIO_puts(out, "\n"); + else + BIO_puts(out, "\n"); + return 1; +} + +static DIST_POINT *crldp_from_section(X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + size_t i; + CONF_VALUE *cnf; + DIST_POINT *point = NULL; + point = DIST_POINT_new(); + if (!point) + goto err; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + int ret; + cnf = sk_CONF_VALUE_value(nval, i); + ret = set_dist_point_name(&point->distpoint, ctx, cnf); + if (ret > 0) + continue; + if (ret < 0) + goto err; + if (!strcmp(cnf->name, "reasons")) { + if (!set_reasons(&point->reasons, cnf->value)) + goto err; + } else if (!strcmp(cnf->name, "CRLissuer")) { + point->CRLissuer = gnames_from_sectname(ctx, cnf->value); + if (!point->CRLissuer) + goto err; + } + } + + return point; + + err: + if (point) + DIST_POINT_free(point); + return NULL; +} + +static void *v2i_crld(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + STACK_OF(DIST_POINT) *crld = NULL; + GENERAL_NAMES *gens = NULL; + GENERAL_NAME *gen = NULL; + CONF_VALUE *cnf; + size_t i; + if (!(crld = sk_DIST_POINT_new_null())) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + DIST_POINT *point; + cnf = sk_CONF_VALUE_value(nval, i); + if (!cnf->value) { + STACK_OF(CONF_VALUE) *dpsect; + dpsect = X509V3_get_section(ctx, cnf->name); + if (!dpsect) + goto err; + point = crldp_from_section(ctx, dpsect); + X509V3_section_free(ctx, dpsect); + if (!point) + goto err; + if (!sk_DIST_POINT_push(crld, point)) { + DIST_POINT_free(point); + goto merr; + } + } else { + if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) + goto err; + if (!(gens = GENERAL_NAMES_new())) + goto merr; + if (!sk_GENERAL_NAME_push(gens, gen)) + goto merr; + gen = NULL; + if (!(point = DIST_POINT_new())) + goto merr; + if (!sk_DIST_POINT_push(crld, point)) { + DIST_POINT_free(point); + goto merr; + } + if (!(point->distpoint = DIST_POINT_NAME_new())) + goto merr; + point->distpoint->name.fullname = gens; + point->distpoint->type = 0; + gens = NULL; + } + } + return crld; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + GENERAL_NAME_free(gen); + GENERAL_NAMES_free(gens); + sk_DIST_POINT_pop_free(crld, DIST_POINT_free); + return NULL; +} + +IMPLEMENT_ASN1_SET_OF(DIST_POINT) + +static int dpn_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) +{ + DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval; + + switch (operation) { + case ASN1_OP_NEW_POST: + dpn->dpname = NULL; + break; + + case ASN1_OP_FREE_POST: + if (dpn->dpname) + X509_NAME_free(dpn->dpname); + break; + } + return 1; +} + + +ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = { + ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0), + ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) +} ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type) + + +IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME) + +ASN1_SEQUENCE(DIST_POINT) = { + ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0), + ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1), + ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2) +} ASN1_SEQUENCE_END(DIST_POINT) + +IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT) + +ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, DIST_POINT) +ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) + +IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS) + +ASN1_SEQUENCE(ISSUING_DIST_POINT) = { + ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3), + ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4), + ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5) +} ASN1_SEQUENCE_END(ISSUING_DIST_POINT) + +IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + +static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, + int indent); +static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); + +const X509V3_EXT_METHOD v3_idp = { + NID_issuing_distribution_point, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(ISSUING_DIST_POINT), + 0, 0, 0, 0, + 0, 0, + 0, + v2i_idp, + i2r_idp, 0, + NULL +}; + +static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + ISSUING_DIST_POINT *idp = NULL; + CONF_VALUE *cnf; + char *name, *val; + size_t i; + int ret; + idp = ISSUING_DIST_POINT_new(); + if (!idp) + goto merr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + name = cnf->name; + val = cnf->value; + ret = set_dist_point_name(&idp->distpoint, ctx, cnf); + if (ret > 0) + continue; + if (ret < 0) + goto err; + if (!strcmp(name, "onlyuser")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyuser)) + goto err; + } else if (!strcmp(name, "onlyCA")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyCA)) + goto err; + } else if (!strcmp(name, "onlyAA")) { + if (!X509V3_get_value_bool(cnf, &idp->onlyattr)) + goto err; + } else if (!strcmp(name, "indirectCRL")) { + if (!X509V3_get_value_bool(cnf, &idp->indirectCRL)) + goto err; + } else if (!strcmp(name, "onlysomereasons")) { + if (!set_reasons(&idp->onlysomereasons, val)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(cnf); + goto err; + } + } + return idp; + + merr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + ISSUING_DIST_POINT_free(idp); + return NULL; +} + +static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent) +{ + size_t i; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + BIO_printf(out, "%*s", indent + 2, ""); + GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i)); + BIO_puts(out, "\n"); + } + return 1; +} + +static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent) +{ + if (dpn->type == 0) { + BIO_printf(out, "%*sFull Name:\n", indent, ""); + print_gens(out, dpn->name.fullname, indent); + } else { + X509_NAME ntmp; + ntmp.entries = dpn->name.relativename; + BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, ""); + X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE); + BIO_puts(out, "\n"); + } + return 1; +} + +static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, + int indent) +{ + ISSUING_DIST_POINT *idp = pidp; + if (idp->distpoint) + print_distpoint(out, idp->distpoint, indent); + if (idp->onlyuser > 0) + BIO_printf(out, "%*sOnly User Certificates\n", indent, ""); + if (idp->onlyCA > 0) + BIO_printf(out, "%*sOnly CA Certificates\n", indent, ""); + if (idp->indirectCRL > 0) + BIO_printf(out, "%*sIndirect CRL\n", indent, ""); + if (idp->onlysomereasons) + print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent); + if (idp->onlyattr > 0) + BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, ""); + if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0) + && (idp->indirectCRL <= 0) && !idp->onlysomereasons + && (idp->onlyattr <= 0)) + BIO_printf(out, "%*s\n", indent, ""); + + return 1; +} + +static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, + int indent) +{ + STACK_OF(DIST_POINT) *crld = pcrldp; + DIST_POINT *point; + size_t i; + for (i = 0; i < sk_DIST_POINT_num(crld); i++) { + BIO_puts(out, "\n"); + point = sk_DIST_POINT_value(crld, i); + if (point->distpoint) + print_distpoint(out, point->distpoint, indent); + if (point->reasons) + print_reasons(out, "Reasons", point->reasons, indent); + if (point->CRLissuer) { + BIO_printf(out, "%*sCRL Issuer:\n", indent, ""); + print_gens(out, point->CRLissuer, indent); + } + } + return 1; +} + +int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname) +{ + size_t i; + STACK_OF(X509_NAME_ENTRY) *frag; + X509_NAME_ENTRY *ne; + if (!dpn || (dpn->type != 1)) + return 1; + frag = dpn->name.relativename; + dpn->dpname = X509_NAME_dup(iname); + if (!dpn->dpname) + return 0; + for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) { + ne = sk_X509_NAME_ENTRY_value(frag, i); + if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1)) { + X509_NAME_free(dpn->dpname); + dpn->dpname = NULL; + return 0; + } + } + /* generate cached encoding of name */ + if (i2d_X509_NAME(dpn->dpname, NULL) < 0) { + X509_NAME_free(dpn->dpname); + dpn->dpname = NULL; + return 0; + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c new file mode 100644 index 0000000..8f3c31f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c @@ -0,0 +1,100 @@ +/* v3_enum.c */ +/* + * 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 + +static const ENUMERATED_NAMES crl_reasons[] = { + {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, + {CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"}, + {CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"}, + {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", + "affiliationChanged"}, + {CRL_REASON_SUPERSEDED, "Superseded", "superseded"}, + {CRL_REASON_CESSATION_OF_OPERATION, + "Cessation Of Operation", "cessationOfOperation"}, + {CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"}, + {CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"}, + {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", + "privilegeWithdrawn"}, + {CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"}, + {-1, NULL, NULL} +}; + +const X509V3_EXT_METHOD v3_crl_reason = { + NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, + 0, + 0, 0, 0, 0, + (void *)crl_reasons +}; + +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e) +{ + const ENUMERATED_NAMES *enam; + long strval; + strval = ASN1_ENUMERATED_get(e); + for (enam = method->usr_data; enam->lname; enam++) { + if (strval == enam->bitnum) + return OPENSSL_strdup(enam->lname); + } + return i2s_ASN1_ENUMERATED(method, e); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back new file mode 100644 index 0000000..eff77e8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back @@ -0,0 +1,100 @@ +/* v3_enum.c */ +/* + * 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 + +static const ENUMERATED_NAMES crl_reasons[] = { + {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, + {CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"}, + {CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"}, + {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", + "affiliationChanged"}, + {CRL_REASON_SUPERSEDED, "Superseded", "superseded"}, + {CRL_REASON_CESSATION_OF_OPERATION, + "Cessation Of Operation", "cessationOfOperation"}, + {CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"}, + {CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"}, + {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", + "privilegeWithdrawn"}, + {CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"}, + {-1, NULL, NULL} +}; + +const X509V3_EXT_METHOD v3_crl_reason = { + NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, + 0, + 0, 0, 0, 0, + (void *)crl_reasons +}; + +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e) +{ + const ENUMERATED_NAMES *enam; + long strval; + strval = ASN1_ENUMERATED_get(e); + for (enam = method->usr_data; enam->lname; enam++) { + if (strval == enam->bitnum) + return OPENSSL_strdup(enam->lname); + } + return i2s_ASN1_ENUMERATED(method, e); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c new file mode 100644 index 0000000..199576d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c @@ -0,0 +1,148 @@ +/* v3_extku.c */ +/* + * 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 + +static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD + *method, void *eku, STACK_OF(CONF_VALUE) + *extlist); + +const X509V3_EXT_METHOD v3_ext_ku = { + NID_ext_key_usage, 0, + ASN1_ITEM_ref(EXTENDED_KEY_USAGE), + 0, 0, 0, 0, + 0, 0, + i2v_EXTENDED_KEY_USAGE, + v2i_EXTENDED_KEY_USAGE, + 0, 0, + NULL +}; + +/* NB OCSP acceptable responses also is a SEQUENCE OF OBJECT */ +const X509V3_EXT_METHOD v3_ocsp_accresp = { + NID_id_pkix_OCSP_acceptableResponses, 0, + ASN1_ITEM_ref(EXTENDED_KEY_USAGE), + 0, 0, 0, 0, + 0, 0, + i2v_EXTENDED_KEY_USAGE, + v2i_EXTENDED_KEY_USAGE, + 0, 0, + NULL +}; + +ASN1_ITEM_TEMPLATE(EXTENDED_KEY_USAGE) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, EXTENDED_KEY_USAGE, ASN1_OBJECT) +ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE) + +IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) + +static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *ext_list) +{ + EXTENDED_KEY_USAGE *eku = a; + size_t i; + ASN1_OBJECT *obj; + char obj_tmp[80]; + for (i = 0; i < sk_ASN1_OBJECT_num(eku); i++) { + obj = sk_ASN1_OBJECT_value(eku, i); + i2t_ASN1_OBJECT(obj_tmp, 80, obj); + X509V3_add_value(NULL, obj_tmp, &ext_list); + } + return ext_list; +} + +static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + EXTENDED_KEY_USAGE *extku; + char *extval; + ASN1_OBJECT *objtmp; + CONF_VALUE *val; + size_t i; + + if (!(extku = sk_ASN1_OBJECT_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (val->value) + extval = val->value; + else + extval = val->name; + if (!(objtmp = OBJ_txt2obj(extval, 0))) { + sk_ASN1_OBJECT_pop_free(extku, ASN1_OBJECT_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + sk_ASN1_OBJECT_push(extku, objtmp); + } + return extku; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c.grpc_back new file mode 100644 index 0000000..952e032 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c.grpc_back @@ -0,0 +1,148 @@ +/* v3_extku.c */ +/* + * 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 + +static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD + *method, void *eku, STACK_OF(CONF_VALUE) + *extlist); + +const X509V3_EXT_METHOD v3_ext_ku = { + NID_ext_key_usage, 0, + ASN1_ITEM_ref(EXTENDED_KEY_USAGE), + 0, 0, 0, 0, + 0, 0, + i2v_EXTENDED_KEY_USAGE, + v2i_EXTENDED_KEY_USAGE, + 0, 0, + NULL +}; + +/* NB OCSP acceptable responses also is a SEQUENCE OF OBJECT */ +const X509V3_EXT_METHOD v3_ocsp_accresp = { + NID_id_pkix_OCSP_acceptableResponses, 0, + ASN1_ITEM_ref(EXTENDED_KEY_USAGE), + 0, 0, 0, 0, + 0, 0, + i2v_EXTENDED_KEY_USAGE, + v2i_EXTENDED_KEY_USAGE, + 0, 0, + NULL +}; + +ASN1_ITEM_TEMPLATE(EXTENDED_KEY_USAGE) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, EXTENDED_KEY_USAGE, ASN1_OBJECT) +ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE) + +IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) + +static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *ext_list) +{ + EXTENDED_KEY_USAGE *eku = a; + size_t i; + ASN1_OBJECT *obj; + char obj_tmp[80]; + for (i = 0; i < sk_ASN1_OBJECT_num(eku); i++) { + obj = sk_ASN1_OBJECT_value(eku, i); + i2t_ASN1_OBJECT(obj_tmp, 80, obj); + X509V3_add_value(NULL, obj_tmp, &ext_list); + } + return ext_list; +} + +static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + EXTENDED_KEY_USAGE *extku; + char *extval; + ASN1_OBJECT *objtmp; + CONF_VALUE *val; + size_t i; + + if (!(extku = sk_ASN1_OBJECT_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (val->value) + extval = val->value; + else + extval = val->name; + if (!(objtmp = OBJ_txt2obj(extval, 0))) { + sk_ASN1_OBJECT_pop_free(extku, ASN1_OBJECT_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + sk_ASN1_OBJECT_push(extku, objtmp); + } + return extku; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c new file mode 100644 index 0000000..ef503ce --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c @@ -0,0 +1,246 @@ +/* v3_genn.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 + + +ASN1_SEQUENCE(OTHERNAME) = { + ASN1_SIMPLE(OTHERNAME, type_id, ASN1_OBJECT), + /* Maybe have a true ANY DEFINED BY later */ + ASN1_EXP(OTHERNAME, value, ASN1_ANY, 0) +} ASN1_SEQUENCE_END(OTHERNAME) + +IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME) + +ASN1_SEQUENCE(EDIPARTYNAME) = { + ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0), + ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1) +} ASN1_SEQUENCE_END(EDIPARTYNAME) + +IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME) + +ASN1_CHOICE(GENERAL_NAME) = { + ASN1_IMP(GENERAL_NAME, d.otherName, OTHERNAME, GEN_OTHERNAME), + ASN1_IMP(GENERAL_NAME, d.rfc822Name, ASN1_IA5STRING, GEN_EMAIL), + ASN1_IMP(GENERAL_NAME, d.dNSName, ASN1_IA5STRING, GEN_DNS), + /* Don't decode this */ + ASN1_IMP(GENERAL_NAME, d.x400Address, ASN1_SEQUENCE, GEN_X400), + /* X509_NAME is a CHOICE type so use EXPLICIT */ + ASN1_EXP(GENERAL_NAME, d.directoryName, X509_NAME, GEN_DIRNAME), + ASN1_IMP(GENERAL_NAME, d.ediPartyName, EDIPARTYNAME, GEN_EDIPARTY), + ASN1_IMP(GENERAL_NAME, d.uniformResourceIdentifier, ASN1_IA5STRING, GEN_URI), + ASN1_IMP(GENERAL_NAME, d.iPAddress, ASN1_OCTET_STRING, GEN_IPADD), + ASN1_IMP(GENERAL_NAME, d.registeredID, ASN1_OBJECT, GEN_RID) +} ASN1_CHOICE_END(GENERAL_NAME) + +IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME) + +ASN1_ITEM_TEMPLATE(GENERAL_NAMES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, GENERAL_NAME) +ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) + +IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) + +IMPLEMENT_ASN1_DUP_FUNCTION(GENERAL_NAME) + +/* Returns 0 if they are equal, != 0 otherwise. */ +int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) +{ + int result = -1; + + if (!a || !b || a->type != b->type) + return -1; + switch (a->type) { + case GEN_X400: + case GEN_EDIPARTY: + result = ASN1_TYPE_cmp(a->d.other, b->d.other); + break; + + case GEN_OTHERNAME: + result = OTHERNAME_cmp(a->d.otherName, b->d.otherName); + break; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + result = ASN1_STRING_cmp(a->d.ia5, b->d.ia5); + break; + + case GEN_DIRNAME: + result = X509_NAME_cmp(a->d.dirn, b->d.dirn); + break; + + case GEN_IPADD: + result = ASN1_OCTET_STRING_cmp(a->d.ip, b->d.ip); + break; + + case GEN_RID: + result = OBJ_cmp(a->d.rid, b->d.rid); + break; + } + return result; +} + +/* Returns 0 if they are equal, != 0 otherwise. */ +int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b) +{ + int result = -1; + + if (!a || !b) + return -1; + /* Check their type first. */ + if ((result = OBJ_cmp(a->type_id, b->type_id)) != 0) + return result; + /* Check the value. */ + result = ASN1_TYPE_cmp(a->value, b->value); + return result; +} + +void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value) +{ + switch (type) { + case GEN_X400: + case GEN_EDIPARTY: + a->d.other = value; + break; + + case GEN_OTHERNAME: + a->d.otherName = value; + break; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + a->d.ia5 = value; + break; + + case GEN_DIRNAME: + a->d.dirn = value; + break; + + case GEN_IPADD: + a->d.ip = value; + break; + + case GEN_RID: + a->d.rid = value; + break; + } + a->type = type; +} + +void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype) +{ + if (ptype) + *ptype = a->type; + switch (a->type) { + case GEN_X400: + case GEN_EDIPARTY: + return a->d.other; + + case GEN_OTHERNAME: + return a->d.otherName; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + return a->d.ia5; + + case GEN_DIRNAME: + return a->d.dirn; + + case GEN_IPADD: + return a->d.ip; + + case GEN_RID: + return a->d.rid; + + default: + return NULL; + } +} + +int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, + ASN1_OBJECT *oid, ASN1_TYPE *value) +{ + OTHERNAME *oth; + oth = OTHERNAME_new(); + if (!oth) + return 0; + ASN1_TYPE_free(oth->value); + oth->type_id = oid; + oth->value = value; + GENERAL_NAME_set0_value(gen, GEN_OTHERNAME, oth); + return 1; +} + +int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, + ASN1_OBJECT **poid, ASN1_TYPE **pvalue) +{ + if (gen->type != GEN_OTHERNAME) + return 0; + if (poid) + *poid = gen->d.otherName->type_id; + if (pvalue) + *pvalue = gen->d.otherName->value; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back new file mode 100644 index 0000000..552a524 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back @@ -0,0 +1,246 @@ +/* v3_genn.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-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 + * 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 + + +ASN1_SEQUENCE(OTHERNAME) = { + ASN1_SIMPLE(OTHERNAME, type_id, ASN1_OBJECT), + /* Maybe have a true ANY DEFINED BY later */ + ASN1_EXP(OTHERNAME, value, ASN1_ANY, 0) +} ASN1_SEQUENCE_END(OTHERNAME) + +IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME) + +ASN1_SEQUENCE(EDIPARTYNAME) = { + ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0), + ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1) +} ASN1_SEQUENCE_END(EDIPARTYNAME) + +IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME) + +ASN1_CHOICE(GENERAL_NAME) = { + ASN1_IMP(GENERAL_NAME, d.otherName, OTHERNAME, GEN_OTHERNAME), + ASN1_IMP(GENERAL_NAME, d.rfc822Name, ASN1_IA5STRING, GEN_EMAIL), + ASN1_IMP(GENERAL_NAME, d.dNSName, ASN1_IA5STRING, GEN_DNS), + /* Don't decode this */ + ASN1_IMP(GENERAL_NAME, d.x400Address, ASN1_SEQUENCE, GEN_X400), + /* X509_NAME is a CHOICE type so use EXPLICIT */ + ASN1_EXP(GENERAL_NAME, d.directoryName, X509_NAME, GEN_DIRNAME), + ASN1_IMP(GENERAL_NAME, d.ediPartyName, EDIPARTYNAME, GEN_EDIPARTY), + ASN1_IMP(GENERAL_NAME, d.uniformResourceIdentifier, ASN1_IA5STRING, GEN_URI), + ASN1_IMP(GENERAL_NAME, d.iPAddress, ASN1_OCTET_STRING, GEN_IPADD), + ASN1_IMP(GENERAL_NAME, d.registeredID, ASN1_OBJECT, GEN_RID) +} ASN1_CHOICE_END(GENERAL_NAME) + +IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME) + +ASN1_ITEM_TEMPLATE(GENERAL_NAMES) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, GENERAL_NAME) +ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) + +IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) + +IMPLEMENT_ASN1_DUP_FUNCTION(GENERAL_NAME) + +/* Returns 0 if they are equal, != 0 otherwise. */ +int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) +{ + int result = -1; + + if (!a || !b || a->type != b->type) + return -1; + switch (a->type) { + case GEN_X400: + case GEN_EDIPARTY: + result = ASN1_TYPE_cmp(a->d.other, b->d.other); + break; + + case GEN_OTHERNAME: + result = OTHERNAME_cmp(a->d.otherName, b->d.otherName); + break; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + result = ASN1_STRING_cmp(a->d.ia5, b->d.ia5); + break; + + case GEN_DIRNAME: + result = X509_NAME_cmp(a->d.dirn, b->d.dirn); + break; + + case GEN_IPADD: + result = ASN1_OCTET_STRING_cmp(a->d.ip, b->d.ip); + break; + + case GEN_RID: + result = OBJ_cmp(a->d.rid, b->d.rid); + break; + } + return result; +} + +/* Returns 0 if they are equal, != 0 otherwise. */ +int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b) +{ + int result = -1; + + if (!a || !b) + return -1; + /* Check their type first. */ + if ((result = OBJ_cmp(a->type_id, b->type_id)) != 0) + return result; + /* Check the value. */ + result = ASN1_TYPE_cmp(a->value, b->value); + return result; +} + +void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value) +{ + switch (type) { + case GEN_X400: + case GEN_EDIPARTY: + a->d.other = value; + break; + + case GEN_OTHERNAME: + a->d.otherName = value; + break; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + a->d.ia5 = value; + break; + + case GEN_DIRNAME: + a->d.dirn = value; + break; + + case GEN_IPADD: + a->d.ip = value; + break; + + case GEN_RID: + a->d.rid = value; + break; + } + a->type = type; +} + +void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype) +{ + if (ptype) + *ptype = a->type; + switch (a->type) { + case GEN_X400: + case GEN_EDIPARTY: + return a->d.other; + + case GEN_OTHERNAME: + return a->d.otherName; + + case GEN_EMAIL: + case GEN_DNS: + case GEN_URI: + return a->d.ia5; + + case GEN_DIRNAME: + return a->d.dirn; + + case GEN_IPADD: + return a->d.ip; + + case GEN_RID: + return a->d.rid; + + default: + return NULL; + } +} + +int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, + ASN1_OBJECT *oid, ASN1_TYPE *value) +{ + OTHERNAME *oth; + oth = OTHERNAME_new(); + if (!oth) + return 0; + ASN1_TYPE_free(oth->value); + oth->type_id = oid; + oth->value = value; + GENERAL_NAME_set0_value(gen, GEN_OTHERNAME, oth); + return 1; +} + +int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, + ASN1_OBJECT **poid, ASN1_TYPE **pvalue) +{ + if (gen->type != GEN_OTHERNAME) + return 0; + if (poid) + *poid = gen->d.otherName->type_id; + if (pvalue) + *pvalue = gen->d.otherName->value; + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c new file mode 100644 index 0000000..b88c8b9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c @@ -0,0 +1,122 @@ +/* v3_ia5.c */ +/* + * 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 "../internal.h" + + +static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + ASN1_IA5STRING *ia5); +static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str); +const X509V3_EXT_METHOD v3_ns_ia5_list[] = { + EXT_IA5STRING(NID_netscape_base_url), + EXT_IA5STRING(NID_netscape_revocation_url), + EXT_IA5STRING(NID_netscape_ca_revocation_url), + EXT_IA5STRING(NID_netscape_renewal_url), + EXT_IA5STRING(NID_netscape_ca_policy_url), + EXT_IA5STRING(NID_netscape_ssl_server_name), + EXT_IA5STRING(NID_netscape_comment), + EXT_END +}; + +static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + ASN1_IA5STRING *ia5) +{ + char *tmp; + if (!ia5 || !ia5->length) + return NULL; + if (!(tmp = OPENSSL_malloc(ia5->length + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memcpy(tmp, ia5->data, ia5->length); + tmp[ia5->length] = 0; + return tmp; +} + +static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_IA5STRING *ia5; + if (!str) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return NULL; + } + if (!(ia5 = M_ASN1_IA5STRING_new())) + goto err; + if (!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char *)str, + strlen(str))) { + M_ASN1_IA5STRING_free(ia5); + goto err; + } + return ia5; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c.grpc_back new file mode 100644 index 0000000..6b2056d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c.grpc_back @@ -0,0 +1,122 @@ +/* v3_ia5.c */ +/* + * 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 "../internal.h" + + +static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + ASN1_IA5STRING *ia5); +static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str); +const X509V3_EXT_METHOD v3_ns_ia5_list[] = { + EXT_IA5STRING(NID_netscape_base_url), + EXT_IA5STRING(NID_netscape_revocation_url), + EXT_IA5STRING(NID_netscape_ca_revocation_url), + EXT_IA5STRING(NID_netscape_renewal_url), + EXT_IA5STRING(NID_netscape_ca_policy_url), + EXT_IA5STRING(NID_netscape_ssl_server_name), + EXT_IA5STRING(NID_netscape_comment), + EXT_END +}; + +static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + ASN1_IA5STRING *ia5) +{ + char *tmp; + if (!ia5 || !ia5->length) + return NULL; + if (!(tmp = OPENSSL_malloc(ia5->length + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + OPENSSL_memcpy(tmp, ia5->data, ia5->length); + tmp[ia5->length] = 0; + return tmp; +} + +static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_IA5STRING *ia5; + if (!str) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return NULL; + } + if (!(ia5 = M_ASN1_IA5STRING_new())) + goto err; + if (!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char *)str, + strlen(str))) { + M_ASN1_IA5STRING_free(ia5); + goto err; + } + return ia5; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c new file mode 100644 index 0000000..e566892 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c @@ -0,0 +1,218 @@ +/* v3_info.c */ +/* + * 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 + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, AUTHORITY_INFO_ACCESS + *ainfo, STACK_OF(CONF_VALUE) + *ret); +static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) + *nval); + +const X509V3_EXT_METHOD v3_info = { NID_info_access, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_INFO_ACCESS, + (X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS, + 0, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_sinfo = { NID_sinfo_access, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_INFO_ACCESS, + (X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS, + 0, 0, + NULL +}; + +ASN1_SEQUENCE(ACCESS_DESCRIPTION) = { + ASN1_SIMPLE(ACCESS_DESCRIPTION, method, ASN1_OBJECT), + ASN1_SIMPLE(ACCESS_DESCRIPTION, location, GENERAL_NAME) +} ASN1_SEQUENCE_END(ACCESS_DESCRIPTION) + +IMPLEMENT_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) + +ASN1_ITEM_TEMPLATE(AUTHORITY_INFO_ACCESS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, ACCESS_DESCRIPTION) +ASN1_ITEM_TEMPLATE_END(AUTHORITY_INFO_ACCESS) + +IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( + X509V3_EXT_METHOD *method, AUTHORITY_INFO_ACCESS *ainfo, + STACK_OF(CONF_VALUE) *ret) +{ + ACCESS_DESCRIPTION *desc; + size_t i; + int nlen; + char objtmp[80], *ntmp; + CONF_VALUE *vtmp; + STACK_OF(CONF_VALUE) *tret = ret; + + for (i = 0; i < sk_ACCESS_DESCRIPTION_num(ainfo); i++) { + STACK_OF(CONF_VALUE) *tmp; + + desc = sk_ACCESS_DESCRIPTION_value(ainfo, i); + tmp = i2v_GENERAL_NAME(method, desc->location, tret); + if (tmp == NULL) + goto err; + tret = tmp; + vtmp = sk_CONF_VALUE_value(tret, i); + i2t_ASN1_OBJECT(objtmp, sizeof objtmp, desc->method); + nlen = strlen(objtmp) + strlen(vtmp->name) + 5; + ntmp = OPENSSL_malloc(nlen); + if (ntmp == NULL) + goto err; + OPENSSL_strlcpy(ntmp, objtmp, nlen); + OPENSSL_strlcat(ntmp, " - ", nlen); + OPENSSL_strlcat(ntmp, vtmp->name, nlen); + OPENSSL_free(vtmp->name); + vtmp->name = ntmp; + + } + if (ret == NULL && tret == NULL) + return sk_CONF_VALUE_new_null(); + + return tret; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + if (ret == NULL && tret != NULL) + sk_CONF_VALUE_pop_free(tret, X509V3_conf_free); + return NULL; +} + +static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) + *nval) +{ + AUTHORITY_INFO_ACCESS *ainfo = NULL; + CONF_VALUE *cnf, ctmp; + ACCESS_DESCRIPTION *acc; + size_t i; + int objlen; + char *objtmp, *ptmp; + if (!(ainfo = sk_ACCESS_DESCRIPTION_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!(acc = ACCESS_DESCRIPTION_new()) + || !sk_ACCESS_DESCRIPTION_push(ainfo, acc)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + ptmp = strchr(cnf->name, ';'); + if (!ptmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SYNTAX); + goto err; + } + objlen = ptmp - cnf->name; + ctmp.name = ptmp + 1; + ctmp.value = cnf->value; + if (!v2i_GENERAL_NAME_ex(acc->location, method, ctx, &ctmp, 0)) + goto err; + if (!(objtmp = OPENSSL_malloc(objlen + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_strlcpy(objtmp, cnf->name, objlen + 1); + acc->method = OBJ_txt2obj(objtmp, 0); + if (!acc->method) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); + ERR_add_error_data(2, "value=", objtmp); + OPENSSL_free(objtmp); + goto err; + } + OPENSSL_free(objtmp); + + } + return ainfo; + err: + sk_ACCESS_DESCRIPTION_pop_free(ainfo, ACCESS_DESCRIPTION_free); + return NULL; +} + +int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a) +{ + i2a_ASN1_OBJECT(bp, a->method); +#ifdef UNDEF + i2a_GENERAL_NAME(bp, a->location); +#endif + return 2; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back new file mode 100644 index 0000000..7a48bd5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back @@ -0,0 +1,218 @@ +/* v3_info.c */ +/* + * 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 + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, AUTHORITY_INFO_ACCESS + *ainfo, STACK_OF(CONF_VALUE) + *ret); +static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) + *nval); + +const X509V3_EXT_METHOD v3_info = { NID_info_access, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_INFO_ACCESS, + (X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS, + 0, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_sinfo = { NID_sinfo_access, X509V3_EXT_MULTILINE, + ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS), + 0, 0, 0, 0, + 0, 0, + (X509V3_EXT_I2V) i2v_AUTHORITY_INFO_ACCESS, + (X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS, + 0, 0, + NULL +}; + +ASN1_SEQUENCE(ACCESS_DESCRIPTION) = { + ASN1_SIMPLE(ACCESS_DESCRIPTION, method, ASN1_OBJECT), + ASN1_SIMPLE(ACCESS_DESCRIPTION, location, GENERAL_NAME) +} ASN1_SEQUENCE_END(ACCESS_DESCRIPTION) + +IMPLEMENT_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) + +ASN1_ITEM_TEMPLATE(AUTHORITY_INFO_ACCESS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, ACCESS_DESCRIPTION) +ASN1_ITEM_TEMPLATE_END(AUTHORITY_INFO_ACCESS) + +IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( + X509V3_EXT_METHOD *method, AUTHORITY_INFO_ACCESS *ainfo, + STACK_OF(CONF_VALUE) *ret) +{ + ACCESS_DESCRIPTION *desc; + size_t i; + int nlen; + char objtmp[80], *ntmp; + CONF_VALUE *vtmp; + STACK_OF(CONF_VALUE) *tret = ret; + + for (i = 0; i < sk_ACCESS_DESCRIPTION_num(ainfo); i++) { + STACK_OF(CONF_VALUE) *tmp; + + desc = sk_ACCESS_DESCRIPTION_value(ainfo, i); + tmp = i2v_GENERAL_NAME(method, desc->location, tret); + if (tmp == NULL) + goto err; + tret = tmp; + vtmp = sk_CONF_VALUE_value(tret, i); + i2t_ASN1_OBJECT(objtmp, sizeof objtmp, desc->method); + nlen = strlen(objtmp) + strlen(vtmp->name) + 5; + ntmp = OPENSSL_malloc(nlen); + if (ntmp == NULL) + goto err; + OPENSSL_strlcpy(ntmp, objtmp, nlen); + OPENSSL_strlcat(ntmp, " - ", nlen); + OPENSSL_strlcat(ntmp, vtmp->name, nlen); + OPENSSL_free(vtmp->name); + vtmp->name = ntmp; + + } + if (ret == NULL && tret == NULL) + return sk_CONF_VALUE_new_null(); + + return tret; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + if (ret == NULL && tret != NULL) + sk_CONF_VALUE_pop_free(tret, X509V3_conf_free); + return NULL; +} + +static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD + *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) + *nval) +{ + AUTHORITY_INFO_ACCESS *ainfo = NULL; + CONF_VALUE *cnf, ctmp; + ACCESS_DESCRIPTION *acc; + size_t i; + int objlen; + char *objtmp, *ptmp; + if (!(ainfo = sk_ACCESS_DESCRIPTION_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!(acc = ACCESS_DESCRIPTION_new()) + || !sk_ACCESS_DESCRIPTION_push(ainfo, acc)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + ptmp = strchr(cnf->name, ';'); + if (!ptmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SYNTAX); + goto err; + } + objlen = ptmp - cnf->name; + ctmp.name = ptmp + 1; + ctmp.value = cnf->value; + if (!v2i_GENERAL_NAME_ex(acc->location, method, ctx, &ctmp, 0)) + goto err; + if (!(objtmp = OPENSSL_malloc(objlen + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + OPENSSL_strlcpy(objtmp, cnf->name, objlen + 1); + acc->method = OBJ_txt2obj(objtmp, 0); + if (!acc->method) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); + ERR_add_error_data(2, "value=", objtmp); + OPENSSL_free(objtmp); + goto err; + } + OPENSSL_free(objtmp); + + } + return ainfo; + err: + sk_ACCESS_DESCRIPTION_pop_free(ainfo, ACCESS_DESCRIPTION_free); + return NULL; +} + +int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a) +{ + i2a_ASN1_OBJECT(bp, a->method); +#ifdef UNDEF + i2a_GENERAL_NAME(bp, a->location); +#endif + return 2; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c new file mode 100644 index 0000000..3cf01ca --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c @@ -0,0 +1,91 @@ +/* v3_int.c */ +/* + * 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). */ + +#include + +#include +#include + +const X509V3_EXT_METHOD v3_crl_num = { + NID_crl_number, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + 0, + 0, 0, 0, 0, NULL +}; + +const X509V3_EXT_METHOD v3_delta_crl = { + NID_delta_crl, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + 0, + 0, 0, 0, 0, NULL +}; + +static void *s2i_asn1_int(X509V3_EXT_METHOD *meth, X509V3_CTX *ctx, + char *value) +{ + return s2i_ASN1_INTEGER(meth, value); +} + +const X509V3_EXT_METHOD v3_inhibit_anyp = { + NID_inhibit_any_policy, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + (X509V3_EXT_S2I)s2i_asn1_int, + 0, 0, 0, 0, NULL +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c.grpc_back new file mode 100644 index 0000000..7bde446 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c.grpc_back @@ -0,0 +1,91 @@ +/* v3_int.c */ +/* + * 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). */ + +#include + +#include +#include + +const X509V3_EXT_METHOD v3_crl_num = { + NID_crl_number, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + 0, + 0, 0, 0, 0, NULL +}; + +const X509V3_EXT_METHOD v3_delta_crl = { + NID_delta_crl, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + 0, + 0, 0, 0, 0, NULL +}; + +static void *s2i_asn1_int(X509V3_EXT_METHOD *meth, X509V3_CTX *ctx, + char *value) +{ + return s2i_ASN1_INTEGER(meth, value); +} + +const X509V3_EXT_METHOD v3_inhibit_anyp = { + NID_inhibit_any_policy, 0, ASN1_ITEM_ref(ASN1_INTEGER), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_INTEGER, + (X509V3_EXT_S2I)s2i_asn1_int, + 0, 0, 0, 0, NULL +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c new file mode 100644 index 0000000..262521a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c @@ -0,0 +1,371 @@ +/* v3_lib.c */ +/* + * 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). + * + */ +/* X509 v3 extension utilities */ + +#include + +#include +#include +#include +#include +#include + +#include "ext_dat.h" +static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL; + +static void ext_list_free(X509V3_EXT_METHOD *ext); + +static int ext_stack_cmp(const X509V3_EXT_METHOD **a, + const X509V3_EXT_METHOD **b) +{ + return ((*a)->ext_nid - (*b)->ext_nid); +} + +int X509V3_EXT_add(X509V3_EXT_METHOD *ext) +{ + if (!ext_list && !(ext_list = sk_X509V3_EXT_METHOD_new(ext_stack_cmp))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ext_list_free(ext); + return 0; + } + if (!sk_X509V3_EXT_METHOD_push(ext_list, ext)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ext_list_free(ext); + return 0; + } + return 1; +} + +static int ext_cmp(const void *void_a, const void *void_b) +{ + const X509V3_EXT_METHOD **a = (const X509V3_EXT_METHOD **)void_a; + const X509V3_EXT_METHOD **b = (const X509V3_EXT_METHOD **)void_b; + return ext_stack_cmp(a, b); +} + +const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) +{ + X509V3_EXT_METHOD tmp; + const X509V3_EXT_METHOD *t = &tmp, *const *ret; + size_t idx; + + if (nid < 0) + return NULL; + tmp.ext_nid = nid; + ret = + bsearch(&t, standard_exts, STANDARD_EXTENSION_COUNT, + sizeof(X509V3_EXT_METHOD *), ext_cmp); + if (ret) + return *ret; + 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); +} + +const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) +{ + int nid; + if ((nid = OBJ_obj2nid(ext->object)) == NID_undef) + return NULL; + return X509V3_EXT_get_nid(nid); +} + +int X509V3_EXT_free(int nid, void *ext_data) +{ + const X509V3_EXT_METHOD *ext_method = X509V3_EXT_get_nid(nid); + if (ext_method == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION); + return 0; + } + + if (ext_method->it != NULL) + ASN1_item_free(ext_data, ASN1_ITEM_ptr(ext_method->it)); + else if (ext_method->ext_free != NULL) + ext_method->ext_free(ext_data); + else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION); + return 0; + } + + return 1; +} + +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist) +{ + for (; extlist->ext_nid != -1; extlist++) + if (!X509V3_EXT_add(extlist)) + return 0; + return 1; +} + +int X509V3_EXT_add_alias(int nid_to, int nid_from) +{ + const X509V3_EXT_METHOD *ext; + X509V3_EXT_METHOD *tmpext; + + if (!(ext = X509V3_EXT_get_nid(nid_from))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_NOT_FOUND); + return 0; + } + if (! + (tmpext = + (X509V3_EXT_METHOD *)OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return 0; + } + *tmpext = *ext; + tmpext->ext_nid = nid_to; + tmpext->ext_flags |= X509V3_EXT_DYNAMIC; + return X509V3_EXT_add(tmpext); +} + +void X509V3_EXT_cleanup(void) +{ + sk_X509V3_EXT_METHOD_pop_free(ext_list, ext_list_free); + ext_list = NULL; +} + +static void ext_list_free(X509V3_EXT_METHOD *ext) +{ + if (ext->ext_flags & X509V3_EXT_DYNAMIC) + OPENSSL_free(ext); +} + +/* + * Legacy function: we don't need to add standard extensions any more because + * they are now kept in ext_dat.h. + */ + +int X509V3_add_standard_extensions(void) +{ + return 1; +} + +/* Return an extension internal structure */ + +void *X509V3_EXT_d2i(X509_EXTENSION *ext) +{ + const X509V3_EXT_METHOD *method; + const unsigned char *p; + + if (!(method = X509V3_EXT_get(ext))) + return NULL; + p = ext->value->data; + if (method->it) + return ASN1_item_d2i(NULL, &p, ext->value->length, + ASN1_ITEM_ptr(method->it)); + return method->d2i(NULL, &p, ext->value->length); +} + +/* + * Get critical flag and decoded version of extension from a NID. The "idx" + * variable returns the last found extension and can be used to retrieve + * multiple extensions of the same NID. However multiple extensions with the + * same NID is usually due to a badly encoded certificate so if idx is NULL + * we choke if multiple extensions exist. The "crit" variable is set to the + * critical value. The return value is the decoded extension or NULL on + * error. The actual error can have several different causes, the value of + * *crit reflects the cause: >= 0, extension found but not decoded (reflects + * critical value). -1 extension not found. -2 extension occurs more than + * once. + */ + +void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + int *idx) +{ + int lastpos; + size_t i; + X509_EXTENSION *ex, *found_ex = NULL; + if (!x) { + if (idx) + *idx = -1; + if (crit) + *crit = -1; + return NULL; + } + if (idx) + lastpos = *idx + 1; + else + lastpos = 0; + if (lastpos < 0) + lastpos = 0; + for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) { + ex = sk_X509_EXTENSION_value(x, i); + if (OBJ_obj2nid(ex->object) == nid) { + if (idx) { + *idx = i; + found_ex = ex; + break; + } else if (found_ex) { + /* Found more than one */ + if (crit) + *crit = -2; + return NULL; + } + found_ex = ex; + } + } + if (found_ex) { + /* Found it */ + if (crit) + *crit = X509_EXTENSION_get_critical(found_ex); + return X509V3_EXT_d2i(found_ex); + } + + /* Extension not found */ + if (idx) + *idx = -1; + if (crit) + *crit = -1; + return NULL; +} + +/* + * This function is a general extension append, replace and delete utility. + * The precise operation is governed by the 'flags' value. The 'crit' and + * 'value' arguments (if relevant) are the extensions internal structure. + */ + +int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, + int crit, unsigned long flags) +{ + int errcode, extidx = -1; + X509_EXTENSION *ext = NULL, *extmp; + STACK_OF(X509_EXTENSION) *ret = NULL; + unsigned long ext_op = flags & X509V3_ADD_OP_MASK; + + /* + * If appending we don't care if it exists, otherwise look for existing + * extension. + */ + if (ext_op != X509V3_ADD_APPEND) + extidx = X509v3_get_ext_by_NID(*x, nid, -1); + + /* See if extension exists */ + if (extidx >= 0) { + /* If keep existing, nothing to do */ + if (ext_op == X509V3_ADD_KEEP_EXISTING) + return 1; + /* If default then its an error */ + if (ext_op == X509V3_ADD_DEFAULT) { + errcode = X509V3_R_EXTENSION_EXISTS; + goto err; + } + /* If delete, just delete it */ + if (ext_op == X509V3_ADD_DELETE) { + if (!sk_X509_EXTENSION_delete(*x, extidx)) + return -1; + return 1; + } + } else { + /* + * If replace existing or delete, error since extension must exist + */ + if ((ext_op == X509V3_ADD_REPLACE_EXISTING) || + (ext_op == X509V3_ADD_DELETE)) { + errcode = X509V3_R_EXTENSION_NOT_FOUND; + goto err; + } + } + + /* + * If we get this far then we have to create an extension: could have + * some flags for alternative encoding schemes... + */ + + ext = X509V3_EXT_i2d(nid, crit, value); + + if (!ext) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CREATING_EXTENSION); + return 0; + } + + /* If extension exists replace it.. */ + if (extidx >= 0) { + extmp = sk_X509_EXTENSION_value(*x, extidx); + X509_EXTENSION_free(extmp); + if (!sk_X509_EXTENSION_set(*x, extidx, ext)) + return -1; + return 1; + } + + if ((ret = *x) == NULL + && (ret = sk_X509_EXTENSION_new_null()) == NULL) + goto m_fail; + if (!sk_X509_EXTENSION_push(ret, ext)) + goto m_fail; + + *x = ret; + return 1; + + m_fail: + if (ret != *x) + sk_X509_EXTENSION_free(ret); + X509_EXTENSION_free(ext); + return -1; + + err: + if (!(flags & X509V3_ADD_SILENT)) + OPENSSL_PUT_ERROR(X509V3, errcode); + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back new file mode 100644 index 0000000..d5eda3d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back @@ -0,0 +1,371 @@ +/* v3_lib.c */ +/* + * 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). + * + */ +/* X509 v3 extension utilities */ + +#include + +#include +#include +#include +#include +#include + +#include "ext_dat.h" +static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL; + +static void ext_list_free(X509V3_EXT_METHOD *ext); + +static int ext_stack_cmp(const X509V3_EXT_METHOD **a, + const X509V3_EXT_METHOD **b) +{ + return ((*a)->ext_nid - (*b)->ext_nid); +} + +int X509V3_EXT_add(X509V3_EXT_METHOD *ext) +{ + if (!ext_list && !(ext_list = sk_X509V3_EXT_METHOD_new(ext_stack_cmp))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ext_list_free(ext); + return 0; + } + if (!sk_X509V3_EXT_METHOD_push(ext_list, ext)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + ext_list_free(ext); + return 0; + } + return 1; +} + +static int ext_cmp(const void *void_a, const void *void_b) +{ + const X509V3_EXT_METHOD **a = (const X509V3_EXT_METHOD **)void_a; + const X509V3_EXT_METHOD **b = (const X509V3_EXT_METHOD **)void_b; + return ext_stack_cmp(a, b); +} + +const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) +{ + X509V3_EXT_METHOD tmp; + const X509V3_EXT_METHOD *t = &tmp, *const *ret; + size_t idx; + + if (nid < 0) + return NULL; + tmp.ext_nid = nid; + ret = + bsearch(&t, standard_exts, STANDARD_EXTENSION_COUNT, + sizeof(X509V3_EXT_METHOD *), ext_cmp); + if (ret) + return *ret; + 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); +} + +const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) +{ + int nid; + if ((nid = OBJ_obj2nid(ext->object)) == NID_undef) + return NULL; + return X509V3_EXT_get_nid(nid); +} + +int X509V3_EXT_free(int nid, void *ext_data) +{ + const X509V3_EXT_METHOD *ext_method = X509V3_EXT_get_nid(nid); + if (ext_method == NULL) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION); + return 0; + } + + if (ext_method->it != NULL) + ASN1_item_free(ext_data, ASN1_ITEM_ptr(ext_method->it)); + else if (ext_method->ext_free != NULL) + ext_method->ext_free(ext_data); + else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION); + return 0; + } + + return 1; +} + +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist) +{ + for (; extlist->ext_nid != -1; extlist++) + if (!X509V3_EXT_add(extlist)) + return 0; + return 1; +} + +int X509V3_EXT_add_alias(int nid_to, int nid_from) +{ + const X509V3_EXT_METHOD *ext; + X509V3_EXT_METHOD *tmpext; + + if (!(ext = X509V3_EXT_get_nid(nid_from))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_NOT_FOUND); + return 0; + } + if (! + (tmpext = + (X509V3_EXT_METHOD *)OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return 0; + } + *tmpext = *ext; + tmpext->ext_nid = nid_to; + tmpext->ext_flags |= X509V3_EXT_DYNAMIC; + return X509V3_EXT_add(tmpext); +} + +void X509V3_EXT_cleanup(void) +{ + sk_X509V3_EXT_METHOD_pop_free(ext_list, ext_list_free); + ext_list = NULL; +} + +static void ext_list_free(X509V3_EXT_METHOD *ext) +{ + if (ext->ext_flags & X509V3_EXT_DYNAMIC) + OPENSSL_free(ext); +} + +/* + * Legacy function: we don't need to add standard extensions any more because + * they are now kept in ext_dat.h. + */ + +int X509V3_add_standard_extensions(void) +{ + return 1; +} + +/* Return an extension internal structure */ + +void *X509V3_EXT_d2i(X509_EXTENSION *ext) +{ + const X509V3_EXT_METHOD *method; + const unsigned char *p; + + if (!(method = X509V3_EXT_get(ext))) + return NULL; + p = ext->value->data; + if (method->it) + return ASN1_item_d2i(NULL, &p, ext->value->length, + ASN1_ITEM_ptr(method->it)); + return method->d2i(NULL, &p, ext->value->length); +} + +/* + * Get critical flag and decoded version of extension from a NID. The "idx" + * variable returns the last found extension and can be used to retrieve + * multiple extensions of the same NID. However multiple extensions with the + * same NID is usually due to a badly encoded certificate so if idx is NULL + * we choke if multiple extensions exist. The "crit" variable is set to the + * critical value. The return value is the decoded extension or NULL on + * error. The actual error can have several different causes, the value of + * *crit reflects the cause: >= 0, extension found but not decoded (reflects + * critical value). -1 extension not found. -2 extension occurs more than + * once. + */ + +void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + int *idx) +{ + int lastpos; + size_t i; + X509_EXTENSION *ex, *found_ex = NULL; + if (!x) { + if (idx) + *idx = -1; + if (crit) + *crit = -1; + return NULL; + } + if (idx) + lastpos = *idx + 1; + else + lastpos = 0; + if (lastpos < 0) + lastpos = 0; + for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) { + ex = sk_X509_EXTENSION_value(x, i); + if (OBJ_obj2nid(ex->object) == nid) { + if (idx) { + *idx = i; + found_ex = ex; + break; + } else if (found_ex) { + /* Found more than one */ + if (crit) + *crit = -2; + return NULL; + } + found_ex = ex; + } + } + if (found_ex) { + /* Found it */ + if (crit) + *crit = X509_EXTENSION_get_critical(found_ex); + return X509V3_EXT_d2i(found_ex); + } + + /* Extension not found */ + if (idx) + *idx = -1; + if (crit) + *crit = -1; + return NULL; +} + +/* + * This function is a general extension append, replace and delete utility. + * The precise operation is governed by the 'flags' value. The 'crit' and + * 'value' arguments (if relevant) are the extensions internal structure. + */ + +int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, + int crit, unsigned long flags) +{ + int errcode, extidx = -1; + X509_EXTENSION *ext = NULL, *extmp; + STACK_OF(X509_EXTENSION) *ret = NULL; + unsigned long ext_op = flags & X509V3_ADD_OP_MASK; + + /* + * If appending we don't care if it exists, otherwise look for existing + * extension. + */ + if (ext_op != X509V3_ADD_APPEND) + extidx = X509v3_get_ext_by_NID(*x, nid, -1); + + /* See if extension exists */ + if (extidx >= 0) { + /* If keep existing, nothing to do */ + if (ext_op == X509V3_ADD_KEEP_EXISTING) + return 1; + /* If default then its an error */ + if (ext_op == X509V3_ADD_DEFAULT) { + errcode = X509V3_R_EXTENSION_EXISTS; + goto err; + } + /* If delete, just delete it */ + if (ext_op == X509V3_ADD_DELETE) { + if (!sk_X509_EXTENSION_delete(*x, extidx)) + return -1; + return 1; + } + } else { + /* + * If replace existing or delete, error since extension must exist + */ + if ((ext_op == X509V3_ADD_REPLACE_EXISTING) || + (ext_op == X509V3_ADD_DELETE)) { + errcode = X509V3_R_EXTENSION_NOT_FOUND; + goto err; + } + } + + /* + * If we get this far then we have to create an extension: could have + * some flags for alternative encoding schemes... + */ + + ext = X509V3_EXT_i2d(nid, crit, value); + + if (!ext) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CREATING_EXTENSION); + return 0; + } + + /* If extension exists replace it.. */ + if (extidx >= 0) { + extmp = sk_X509_EXTENSION_value(*x, extidx); + X509_EXTENSION_free(extmp); + if (!sk_X509_EXTENSION_set(*x, extidx, ext)) + return -1; + return 1; + } + + if ((ret = *x) == NULL + && (ret = sk_X509_EXTENSION_new_null()) == NULL) + goto m_fail; + if (!sk_X509_EXTENSION_push(ret, ext)) + goto m_fail; + + *x = ret; + return 1; + + m_fail: + if (ret != *x) + sk_X509_EXTENSION_free(ret); + X509_EXTENSION_free(ext); + return -1; + + err: + if (!(flags & X509V3_ADD_SILENT)) + OPENSSL_PUT_ERROR(X509V3, errcode); + return 0; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c new file mode 100644 index 0000000..fb3a818 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c @@ -0,0 +1,501 @@ +/* v3_ncons.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 "../internal.h" + + +static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a, + BIO *bp, int ind); +static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method, + STACK_OF(GENERAL_SUBTREE) *trees, BIO *bp, + int ind, const char *name); +static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip); + +static int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc); +static int nc_match_single(GENERAL_NAME *sub, GENERAL_NAME *gen); +static int nc_dn(X509_NAME *sub, X509_NAME *nm); +static int nc_dns(ASN1_IA5STRING *sub, ASN1_IA5STRING *dns); +static int nc_email(ASN1_IA5STRING *sub, ASN1_IA5STRING *eml); +static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base); + +const X509V3_EXT_METHOD v3_name_constraints = { + NID_name_constraints, 0, + ASN1_ITEM_ref(NAME_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + 0, v2i_NAME_CONSTRAINTS, + i2r_NAME_CONSTRAINTS, 0, + NULL +}; + +ASN1_SEQUENCE(GENERAL_SUBTREE) = { + ASN1_SIMPLE(GENERAL_SUBTREE, base, GENERAL_NAME), + ASN1_IMP_OPT(GENERAL_SUBTREE, minimum, ASN1_INTEGER, 0), + ASN1_IMP_OPT(GENERAL_SUBTREE, maximum, ASN1_INTEGER, 1) +} ASN1_SEQUENCE_END(GENERAL_SUBTREE) + +ASN1_SEQUENCE(NAME_CONSTRAINTS) = { + ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, permittedSubtrees, + GENERAL_SUBTREE, 0), + ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, excludedSubtrees, + GENERAL_SUBTREE, 1), +} ASN1_SEQUENCE_END(NAME_CONSTRAINTS) + + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + size_t i; + CONF_VALUE tval, *val; + STACK_OF(GENERAL_SUBTREE) **ptree = NULL; + NAME_CONSTRAINTS *ncons = NULL; + GENERAL_SUBTREE *sub = NULL; + ncons = NAME_CONSTRAINTS_new(); + if (!ncons) + goto memerr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!strncmp(val->name, "permitted", 9) && val->name[9]) { + ptree = &ncons->permittedSubtrees; + tval.name = val->name + 10; + } else if (!strncmp(val->name, "excluded", 8) && val->name[8]) { + ptree = &ncons->excludedSubtrees; + tval.name = val->name + 9; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SYNTAX); + goto err; + } + tval.value = val->value; + sub = GENERAL_SUBTREE_new(); + if (!v2i_GENERAL_NAME_ex(sub->base, method, ctx, &tval, 1)) + goto err; + if (!*ptree) + *ptree = sk_GENERAL_SUBTREE_new_null(); + if (!*ptree || !sk_GENERAL_SUBTREE_push(*ptree, sub)) + goto memerr; + sub = NULL; + } + + return ncons; + + memerr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + if (ncons) + NAME_CONSTRAINTS_free(ncons); + if (sub) + GENERAL_SUBTREE_free(sub); + + return NULL; +} + +static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a, + BIO *bp, int ind) +{ + NAME_CONSTRAINTS *ncons = a; + do_i2r_name_constraints(method, ncons->permittedSubtrees, + bp, ind, "Permitted"); + do_i2r_name_constraints(method, ncons->excludedSubtrees, + bp, ind, "Excluded"); + return 1; +} + +static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method, + STACK_OF(GENERAL_SUBTREE) *trees, + BIO *bp, int ind, const char *name) +{ + GENERAL_SUBTREE *tree; + size_t i; + if (sk_GENERAL_SUBTREE_num(trees) > 0) + BIO_printf(bp, "%*s%s:\n", ind, "", name); + for (i = 0; i < sk_GENERAL_SUBTREE_num(trees); i++) { + tree = sk_GENERAL_SUBTREE_value(trees, i); + BIO_printf(bp, "%*s", ind + 2, ""); + if (tree->base->type == GEN_IPADD) + print_nc_ipadd(bp, tree->base->d.ip); + else + GENERAL_NAME_print(bp, tree->base); + BIO_puts(bp, "\n"); + } + return 1; +} + +static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip) +{ + int i, len; + unsigned char *p; + p = ip->data; + len = ip->length; + BIO_puts(bp, "IP:"); + if (len == 8) { + BIO_printf(bp, "%d.%d.%d.%d/%d.%d.%d.%d", + p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); + } else if (len == 32) { + for (i = 0; i < 16; i++) { + BIO_printf(bp, "%X", p[0] << 8 | p[1]); + p += 2; + if (i == 7) + BIO_puts(bp, "/"); + else if (i != 15) + BIO_puts(bp, ":"); + } + } else + BIO_printf(bp, "IP Address:"); + return 1; +} + +/*- + * Check a certificate conforms to a specified set of constraints. + * Return values: + * X509_V_OK: All constraints obeyed. + * X509_V_ERR_PERMITTED_VIOLATION: Permitted subtree violation. + * X509_V_ERR_EXCLUDED_VIOLATION: Excluded subtree violation. + * X509_V_ERR_SUBTREE_MINMAX: Min or max values present and matching type. + * X509_V_ERR_UNSPECIFIED: Unspecified error. + * X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: Unsupported constraint type. + * X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: Bad or unsupported constraint + * syntax. + * X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: Bad or unsupported syntax of name. + */ + +int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc) +{ + int r, i; + size_t j; + X509_NAME *nm; + + nm = X509_get_subject_name(x); + + /* Guard against certificates with an excessive number of names or + * constraints causing a computationally expensive name constraints + * check. */ + size_t name_count = + X509_NAME_entry_count(nm) + sk_GENERAL_NAME_num(x->altname); + size_t constraint_count = sk_GENERAL_SUBTREE_num(nc->permittedSubtrees) + + sk_GENERAL_SUBTREE_num(nc->excludedSubtrees); + size_t check_count = constraint_count * name_count; + if (name_count < (size_t)X509_NAME_entry_count(nm) || + constraint_count < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees) || + (constraint_count && check_count / constraint_count != name_count) || + check_count > 1 << 20) { + return X509_V_ERR_UNSPECIFIED; + } + + if (X509_NAME_entry_count(nm) > 0) { + GENERAL_NAME gntmp; + gntmp.type = GEN_DIRNAME; + gntmp.d.directoryName = nm; + + r = nc_match(&gntmp, nc); + + if (r != X509_V_OK) + return r; + + gntmp.type = GEN_EMAIL; + + /* Process any email address attributes in subject name */ + + for (i = -1;;) { + X509_NAME_ENTRY *ne; + i = X509_NAME_get_index_by_NID(nm, NID_pkcs9_emailAddress, i); + if (i == -1) + break; + ne = X509_NAME_get_entry(nm, i); + gntmp.d.rfc822Name = X509_NAME_ENTRY_get_data(ne); + if (gntmp.d.rfc822Name->type != V_ASN1_IA5STRING) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + + r = nc_match(&gntmp, nc); + + if (r != X509_V_OK) + return r; + } + + } + + for (j = 0; j < sk_GENERAL_NAME_num(x->altname); j++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(x->altname, j); + r = nc_match(gen, nc); + if (r != X509_V_OK) + return r; + } + + return X509_V_OK; + +} + +static int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc) +{ + GENERAL_SUBTREE *sub; + int r, match = 0; + size_t i; + + /* + * Permitted subtrees: if any subtrees exist of matching the type at + * least one subtree must match. + */ + + for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees); i++) { + sub = sk_GENERAL_SUBTREE_value(nc->permittedSubtrees, i); + if (gen->type != sub->base->type) + continue; + if (sub->minimum || sub->maximum) + return X509_V_ERR_SUBTREE_MINMAX; + /* If we already have a match don't bother trying any more */ + if (match == 2) + continue; + if (match == 0) + match = 1; + r = nc_match_single(gen, sub->base); + if (r == X509_V_OK) + match = 2; + else if (r != X509_V_ERR_PERMITTED_VIOLATION) + return r; + } + + if (match == 1) + return X509_V_ERR_PERMITTED_VIOLATION; + + /* Excluded subtrees: must not match any of these */ + + for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->excludedSubtrees); i++) { + sub = sk_GENERAL_SUBTREE_value(nc->excludedSubtrees, i); + if (gen->type != sub->base->type) + continue; + if (sub->minimum || sub->maximum) + return X509_V_ERR_SUBTREE_MINMAX; + + r = nc_match_single(gen, sub->base); + if (r == X509_V_OK) + return X509_V_ERR_EXCLUDED_VIOLATION; + else if (r != X509_V_ERR_PERMITTED_VIOLATION) + return r; + + } + + return X509_V_OK; + +} + +static int nc_match_single(GENERAL_NAME *gen, GENERAL_NAME *base) +{ + switch (base->type) { + case GEN_DIRNAME: + return nc_dn(gen->d.directoryName, base->d.directoryName); + + case GEN_DNS: + return nc_dns(gen->d.dNSName, base->d.dNSName); + + case GEN_EMAIL: + return nc_email(gen->d.rfc822Name, base->d.rfc822Name); + + case GEN_URI: + return nc_uri(gen->d.uniformResourceIdentifier, + base->d.uniformResourceIdentifier); + + default: + return X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE; + } + +} + +/* + * directoryName name constraint matching. The canonical encoding of + * X509_NAME makes this comparison easy. It is matched if the subtree is a + * subset of the name. + */ + +static int nc_dn(X509_NAME *nm, X509_NAME *base) +{ + /* Ensure canonical encodings are up to date. */ + if (nm->modified && i2d_X509_NAME(nm, NULL) < 0) + return X509_V_ERR_OUT_OF_MEM; + if (base->modified && i2d_X509_NAME(base, NULL) < 0) + return X509_V_ERR_OUT_OF_MEM; + if (base->canon_enclen > nm->canon_enclen) + return X509_V_ERR_PERMITTED_VIOLATION; + if (OPENSSL_memcmp(base->canon_enc, nm->canon_enc, base->canon_enclen)) + return X509_V_ERR_PERMITTED_VIOLATION; + return X509_V_OK; +} + +static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base) +{ + char *baseptr = (char *)base->data; + char *dnsptr = (char *)dns->data; + /* Empty matches everything */ + if (!*baseptr) + return X509_V_OK; + /* + * Otherwise can add zero or more components on the left so compare RHS + * and if dns is longer and expect '.' as preceding character. + */ + if (dns->length > base->length) { + dnsptr += dns->length - base->length; + if (*baseptr != '.' && dnsptr[-1] != '.') + return X509_V_ERR_PERMITTED_VIOLATION; + } + + if (OPENSSL_strcasecmp(baseptr, dnsptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} + +static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base) +{ + const char *baseptr = (char *)base->data; + const char *emlptr = (char *)eml->data; + + const char *baseat = strchr(baseptr, '@'); + const char *emlat = strchr(emlptr, '@'); + if (!emlat) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + /* Special case: inital '.' is RHS match */ + if (!baseat && (*baseptr == '.')) { + if (eml->length > base->length) { + emlptr += eml->length - base->length; + if (!OPENSSL_strcasecmp(baseptr, emlptr)) + return X509_V_OK; + } + return X509_V_ERR_PERMITTED_VIOLATION; + } + + /* If we have anything before '@' match local part */ + + if (baseat) { + if (baseat != baseptr) { + if ((baseat - baseptr) != (emlat - emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + /* Case sensitive match of local part */ + if (strncmp(baseptr, emlptr, emlat - emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + } + /* Position base after '@' */ + baseptr = baseat + 1; + } + emlptr = emlat + 1; + /* Just have hostname left to match: case insensitive */ + if (OPENSSL_strcasecmp(baseptr, emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} + +static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base) +{ + const char *baseptr = (char *)base->data; + const char *hostptr = (char *)uri->data; + const char *p = strchr(hostptr, ':'); + int hostlen; + /* Check for foo:// and skip past it */ + if (!p || (p[1] != '/') || (p[2] != '/')) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + hostptr = p + 3; + + /* Determine length of hostname part of URI */ + + /* Look for a port indicator as end of hostname first */ + + p = strchr(hostptr, ':'); + /* Otherwise look for trailing slash */ + if (!p) + p = strchr(hostptr, '/'); + + if (!p) + hostlen = strlen(hostptr); + else + hostlen = p - hostptr; + + if (hostlen == 0) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + + /* Special case: inital '.' is RHS match */ + if (*baseptr == '.') { + if (hostlen > base->length) { + p = hostptr + hostlen - base->length; + if (!OPENSSL_strncasecmp(p, baseptr, base->length)) + return X509_V_OK; + } + return X509_V_ERR_PERMITTED_VIOLATION; + } + + if ((base->length != (int)hostlen) + || OPENSSL_strncasecmp(hostptr, baseptr, hostlen)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c.grpc_back new file mode 100644 index 0000000..593a520 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c.grpc_back @@ -0,0 +1,501 @@ +/* v3_ncons.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 "../internal.h" + + +static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a, + BIO *bp, int ind); +static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method, + STACK_OF(GENERAL_SUBTREE) *trees, BIO *bp, + int ind, const char *name); +static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip); + +static int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc); +static int nc_match_single(GENERAL_NAME *sub, GENERAL_NAME *gen); +static int nc_dn(X509_NAME *sub, X509_NAME *nm); +static int nc_dns(ASN1_IA5STRING *sub, ASN1_IA5STRING *dns); +static int nc_email(ASN1_IA5STRING *sub, ASN1_IA5STRING *eml); +static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base); + +const X509V3_EXT_METHOD v3_name_constraints = { + NID_name_constraints, 0, + ASN1_ITEM_ref(NAME_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + 0, v2i_NAME_CONSTRAINTS, + i2r_NAME_CONSTRAINTS, 0, + NULL +}; + +ASN1_SEQUENCE(GENERAL_SUBTREE) = { + ASN1_SIMPLE(GENERAL_SUBTREE, base, GENERAL_NAME), + ASN1_IMP_OPT(GENERAL_SUBTREE, minimum, ASN1_INTEGER, 0), + ASN1_IMP_OPT(GENERAL_SUBTREE, maximum, ASN1_INTEGER, 1) +} ASN1_SEQUENCE_END(GENERAL_SUBTREE) + +ASN1_SEQUENCE(NAME_CONSTRAINTS) = { + ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, permittedSubtrees, + GENERAL_SUBTREE, 0), + ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, excludedSubtrees, + GENERAL_SUBTREE, 1), +} ASN1_SEQUENCE_END(NAME_CONSTRAINTS) + + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + size_t i; + CONF_VALUE tval, *val; + STACK_OF(GENERAL_SUBTREE) **ptree = NULL; + NAME_CONSTRAINTS *ncons = NULL; + GENERAL_SUBTREE *sub = NULL; + ncons = NAME_CONSTRAINTS_new(); + if (!ncons) + goto memerr; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!strncmp(val->name, "permitted", 9) && val->name[9]) { + ptree = &ncons->permittedSubtrees; + tval.name = val->name + 10; + } else if (!strncmp(val->name, "excluded", 8) && val->name[8]) { + ptree = &ncons->excludedSubtrees; + tval.name = val->name + 9; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SYNTAX); + goto err; + } + tval.value = val->value; + sub = GENERAL_SUBTREE_new(); + if (!v2i_GENERAL_NAME_ex(sub->base, method, ctx, &tval, 1)) + goto err; + if (!*ptree) + *ptree = sk_GENERAL_SUBTREE_new_null(); + if (!*ptree || !sk_GENERAL_SUBTREE_push(*ptree, sub)) + goto memerr; + sub = NULL; + } + + return ncons; + + memerr: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + err: + if (ncons) + NAME_CONSTRAINTS_free(ncons); + if (sub) + GENERAL_SUBTREE_free(sub); + + return NULL; +} + +static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a, + BIO *bp, int ind) +{ + NAME_CONSTRAINTS *ncons = a; + do_i2r_name_constraints(method, ncons->permittedSubtrees, + bp, ind, "Permitted"); + do_i2r_name_constraints(method, ncons->excludedSubtrees, + bp, ind, "Excluded"); + return 1; +} + +static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method, + STACK_OF(GENERAL_SUBTREE) *trees, + BIO *bp, int ind, const char *name) +{ + GENERAL_SUBTREE *tree; + size_t i; + if (sk_GENERAL_SUBTREE_num(trees) > 0) + BIO_printf(bp, "%*s%s:\n", ind, "", name); + for (i = 0; i < sk_GENERAL_SUBTREE_num(trees); i++) { + tree = sk_GENERAL_SUBTREE_value(trees, i); + BIO_printf(bp, "%*s", ind + 2, ""); + if (tree->base->type == GEN_IPADD) + print_nc_ipadd(bp, tree->base->d.ip); + else + GENERAL_NAME_print(bp, tree->base); + BIO_puts(bp, "\n"); + } + return 1; +} + +static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip) +{ + int i, len; + unsigned char *p; + p = ip->data; + len = ip->length; + BIO_puts(bp, "IP:"); + if (len == 8) { + BIO_printf(bp, "%d.%d.%d.%d/%d.%d.%d.%d", + p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); + } else if (len == 32) { + for (i = 0; i < 16; i++) { + BIO_printf(bp, "%X", p[0] << 8 | p[1]); + p += 2; + if (i == 7) + BIO_puts(bp, "/"); + else if (i != 15) + BIO_puts(bp, ":"); + } + } else + BIO_printf(bp, "IP Address:"); + return 1; +} + +/*- + * Check a certificate conforms to a specified set of constraints. + * Return values: + * X509_V_OK: All constraints obeyed. + * X509_V_ERR_PERMITTED_VIOLATION: Permitted subtree violation. + * X509_V_ERR_EXCLUDED_VIOLATION: Excluded subtree violation. + * X509_V_ERR_SUBTREE_MINMAX: Min or max values present and matching type. + * X509_V_ERR_UNSPECIFIED: Unspecified error. + * X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: Unsupported constraint type. + * X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: Bad or unsupported constraint + * syntax. + * X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: Bad or unsupported syntax of name. + */ + +int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc) +{ + int r, i; + size_t j; + X509_NAME *nm; + + nm = X509_get_subject_name(x); + + /* Guard against certificates with an excessive number of names or + * constraints causing a computationally expensive name constraints + * check. */ + size_t name_count = + X509_NAME_entry_count(nm) + sk_GENERAL_NAME_num(x->altname); + size_t constraint_count = sk_GENERAL_SUBTREE_num(nc->permittedSubtrees) + + sk_GENERAL_SUBTREE_num(nc->excludedSubtrees); + size_t check_count = constraint_count * name_count; + if (name_count < (size_t)X509_NAME_entry_count(nm) || + constraint_count < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees) || + (constraint_count && check_count / constraint_count != name_count) || + check_count > 1 << 20) { + return X509_V_ERR_UNSPECIFIED; + } + + if (X509_NAME_entry_count(nm) > 0) { + GENERAL_NAME gntmp; + gntmp.type = GEN_DIRNAME; + gntmp.d.directoryName = nm; + + r = nc_match(&gntmp, nc); + + if (r != X509_V_OK) + return r; + + gntmp.type = GEN_EMAIL; + + /* Process any email address attributes in subject name */ + + for (i = -1;;) { + X509_NAME_ENTRY *ne; + i = X509_NAME_get_index_by_NID(nm, NID_pkcs9_emailAddress, i); + if (i == -1) + break; + ne = X509_NAME_get_entry(nm, i); + gntmp.d.rfc822Name = X509_NAME_ENTRY_get_data(ne); + if (gntmp.d.rfc822Name->type != V_ASN1_IA5STRING) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + + r = nc_match(&gntmp, nc); + + if (r != X509_V_OK) + return r; + } + + } + + for (j = 0; j < sk_GENERAL_NAME_num(x->altname); j++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(x->altname, j); + r = nc_match(gen, nc); + if (r != X509_V_OK) + return r; + } + + return X509_V_OK; + +} + +static int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc) +{ + GENERAL_SUBTREE *sub; + int r, match = 0; + size_t i; + + /* + * Permitted subtrees: if any subtrees exist of matching the type at + * least one subtree must match. + */ + + for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees); i++) { + sub = sk_GENERAL_SUBTREE_value(nc->permittedSubtrees, i); + if (gen->type != sub->base->type) + continue; + if (sub->minimum || sub->maximum) + return X509_V_ERR_SUBTREE_MINMAX; + /* If we already have a match don't bother trying any more */ + if (match == 2) + continue; + if (match == 0) + match = 1; + r = nc_match_single(gen, sub->base); + if (r == X509_V_OK) + match = 2; + else if (r != X509_V_ERR_PERMITTED_VIOLATION) + return r; + } + + if (match == 1) + return X509_V_ERR_PERMITTED_VIOLATION; + + /* Excluded subtrees: must not match any of these */ + + for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->excludedSubtrees); i++) { + sub = sk_GENERAL_SUBTREE_value(nc->excludedSubtrees, i); + if (gen->type != sub->base->type) + continue; + if (sub->minimum || sub->maximum) + return X509_V_ERR_SUBTREE_MINMAX; + + r = nc_match_single(gen, sub->base); + if (r == X509_V_OK) + return X509_V_ERR_EXCLUDED_VIOLATION; + else if (r != X509_V_ERR_PERMITTED_VIOLATION) + return r; + + } + + return X509_V_OK; + +} + +static int nc_match_single(GENERAL_NAME *gen, GENERAL_NAME *base) +{ + switch (base->type) { + case GEN_DIRNAME: + return nc_dn(gen->d.directoryName, base->d.directoryName); + + case GEN_DNS: + return nc_dns(gen->d.dNSName, base->d.dNSName); + + case GEN_EMAIL: + return nc_email(gen->d.rfc822Name, base->d.rfc822Name); + + case GEN_URI: + return nc_uri(gen->d.uniformResourceIdentifier, + base->d.uniformResourceIdentifier); + + default: + return X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE; + } + +} + +/* + * directoryName name constraint matching. The canonical encoding of + * X509_NAME makes this comparison easy. It is matched if the subtree is a + * subset of the name. + */ + +static int nc_dn(X509_NAME *nm, X509_NAME *base) +{ + /* Ensure canonical encodings are up to date. */ + if (nm->modified && i2d_X509_NAME(nm, NULL) < 0) + return X509_V_ERR_OUT_OF_MEM; + if (base->modified && i2d_X509_NAME(base, NULL) < 0) + return X509_V_ERR_OUT_OF_MEM; + if (base->canon_enclen > nm->canon_enclen) + return X509_V_ERR_PERMITTED_VIOLATION; + if (OPENSSL_memcmp(base->canon_enc, nm->canon_enc, base->canon_enclen)) + return X509_V_ERR_PERMITTED_VIOLATION; + return X509_V_OK; +} + +static int nc_dns(ASN1_IA5STRING *dns, ASN1_IA5STRING *base) +{ + char *baseptr = (char *)base->data; + char *dnsptr = (char *)dns->data; + /* Empty matches everything */ + if (!*baseptr) + return X509_V_OK; + /* + * Otherwise can add zero or more components on the left so compare RHS + * and if dns is longer and expect '.' as preceding character. + */ + if (dns->length > base->length) { + dnsptr += dns->length - base->length; + if (*baseptr != '.' && dnsptr[-1] != '.') + return X509_V_ERR_PERMITTED_VIOLATION; + } + + if (OPENSSL_strcasecmp(baseptr, dnsptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} + +static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base) +{ + const char *baseptr = (char *)base->data; + const char *emlptr = (char *)eml->data; + + const char *baseat = strchr(baseptr, '@'); + const char *emlat = strchr(emlptr, '@'); + if (!emlat) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + /* Special case: inital '.' is RHS match */ + if (!baseat && (*baseptr == '.')) { + if (eml->length > base->length) { + emlptr += eml->length - base->length; + if (!OPENSSL_strcasecmp(baseptr, emlptr)) + return X509_V_OK; + } + return X509_V_ERR_PERMITTED_VIOLATION; + } + + /* If we have anything before '@' match local part */ + + if (baseat) { + if (baseat != baseptr) { + if ((baseat - baseptr) != (emlat - emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + /* Case sensitive match of local part */ + if (strncmp(baseptr, emlptr, emlat - emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + } + /* Position base after '@' */ + baseptr = baseat + 1; + } + emlptr = emlat + 1; + /* Just have hostname left to match: case insensitive */ + if (OPENSSL_strcasecmp(baseptr, emlptr)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} + +static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base) +{ + const char *baseptr = (char *)base->data; + const char *hostptr = (char *)uri->data; + const char *p = strchr(hostptr, ':'); + int hostlen; + /* Check for foo:// and skip past it */ + if (!p || (p[1] != '/') || (p[2] != '/')) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + hostptr = p + 3; + + /* Determine length of hostname part of URI */ + + /* Look for a port indicator as end of hostname first */ + + p = strchr(hostptr, ':'); + /* Otherwise look for trailing slash */ + if (!p) + p = strchr(hostptr, '/'); + + if (!p) + hostlen = strlen(hostptr); + else + hostlen = p - hostptr; + + if (hostlen == 0) + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + + /* Special case: inital '.' is RHS match */ + if (*baseptr == '.') { + if (hostlen > base->length) { + p = hostptr + hostlen - base->length; + if (!OPENSSL_strncasecmp(p, baseptr, base->length)) + return X509_V_OK; + } + return X509_V_ERR_PERMITTED_VIOLATION; + } + + if ((base->length != (int)hostlen) + || OPENSSL_strncasecmp(hostptr, baseptr, hostlen)) + return X509_V_ERR_PERMITTED_VIOLATION; + + return X509_V_OK; + +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c new file mode 100644 index 0000000..b3bdee3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c.grpc_back new file mode 100644 index 0000000..c63646a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c new file mode 100644 index 0000000..9aedb25 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c @@ -0,0 +1,288 @@ +/* v3_pci.c -*- mode:C; c-file-style: "eay" -*- */ +/* + * Contributed to the OpenSSL Project 2004 by Richard Levitte + * (richard@levitte.org) + */ +/* Copyright (c) 2004 Kungliga Tekniska HΓΆgskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * 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. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE 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. + */ + +#include + +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "internal.h" + + +static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, + BIO *out, int indent); +static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str); + +const X509V3_EXT_METHOD v3_pci = + { NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION), + 0, 0, 0, 0, + 0, 0, + NULL, NULL, + (X509V3_EXT_I2R)i2r_pci, + (X509V3_EXT_R2I)r2i_pci, + NULL, +}; + +static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci, + BIO *out, int indent) +{ + BIO_printf(out, "%*sPath Length Constraint: ", indent, ""); + if (pci->pcPathLengthConstraint) + i2a_ASN1_INTEGER(out, pci->pcPathLengthConstraint); + else + BIO_printf(out, "infinite"); + BIO_puts(out, "\n"); + BIO_printf(out, "%*sPolicy Language: ", indent, ""); + i2a_ASN1_OBJECT(out, pci->proxyPolicy->policyLanguage); + BIO_puts(out, "\n"); + if (pci->proxyPolicy->policy && pci->proxyPolicy->policy->data) + BIO_printf(out, "%*sPolicy Text: %s\n", indent, "", + pci->proxyPolicy->policy->data); + return 1; +} + +static int process_pci_value(CONF_VALUE *val, + ASN1_OBJECT **language, ASN1_INTEGER **pathlen, + ASN1_OCTET_STRING **policy) +{ + int free_policy = 0; + + if (strcmp(val->name, "language") == 0) { + if (*language) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED); + X509V3_conf_err(val); + return 0; + } + if (!(*language = OBJ_txt2obj(val->value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return 0; + } + } else if (strcmp(val->name, "pathlen") == 0) { + if (*pathlen) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED); + X509V3_conf_err(val); + return 0; + } + if (!X509V3_get_value_int(val, pathlen)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_POLICY_PATH_LENGTH); + X509V3_conf_err(val); + return 0; + } + } else if (strcmp(val->name, "policy") == 0) { + unsigned char *tmp_data = NULL; + long val_len; + if (!*policy) { + *policy = ASN1_OCTET_STRING_new(); + if (!*policy) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + return 0; + } + free_policy = 1; + } + if (strncmp(val->value, "hex:", 4) == 0) { + unsigned char *tmp_data2 = + x509v3_hex_to_bytes(val->value + 4, &val_len); + + if (!tmp_data2) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); + X509V3_conf_err(val); + goto err; + } + + tmp_data = OPENSSL_realloc((*policy)->data, + (*policy)->length + val_len + 1); + if (tmp_data) { + (*policy)->data = tmp_data; + OPENSSL_memcpy(&(*policy)->data[(*policy)->length], + tmp_data2, val_len); + (*policy)->length += val_len; + (*policy)->data[(*policy)->length] = '\0'; + } else { + OPENSSL_free(tmp_data2); + /* + * realloc failure implies the original data space is b0rked + * too! + */ + (*policy)->data = NULL; + (*policy)->length = 0; + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + OPENSSL_free(tmp_data2); + } else if (strncmp(val->value, "text:", 5) == 0) { + val_len = strlen(val->value + 5); + tmp_data = OPENSSL_realloc((*policy)->data, + (*policy)->length + val_len + 1); + if (tmp_data) { + (*policy)->data = tmp_data; + OPENSSL_memcpy(&(*policy)->data[(*policy)->length], + val->value + 5, val_len); + (*policy)->length += val_len; + (*policy)->data[(*policy)->length] = '\0'; + } else { + /* + * realloc failure implies the original data space is b0rked + * too! + */ + (*policy)->data = NULL; + (*policy)->length = 0; + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG); + X509V3_conf_err(val); + goto err; + } + if (!tmp_data) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + } + return 1; + err: + if (free_policy) { + ASN1_OCTET_STRING_free(*policy); + *policy = NULL; + } + return 0; +} + +static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value) +{ + PROXY_CERT_INFO_EXTENSION *pci = NULL; + STACK_OF(CONF_VALUE) *vals; + ASN1_OBJECT *language = NULL; + ASN1_INTEGER *pathlen = NULL; + ASN1_OCTET_STRING *policy = NULL; + size_t i, j; + int nid; + + vals = X509V3_parse_list(value); + for (i = 0; i < sk_CONF_VALUE_num(vals); i++) { + CONF_VALUE *cnf = sk_CONF_VALUE_value(vals, i); + if (!cnf->name || (*cnf->name != '@' && !cnf->value)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING); + X509V3_conf_err(cnf); + goto err; + } + if (*cnf->name == '@') { + STACK_OF(CONF_VALUE) *sect; + int success_p = 1; + + sect = X509V3_get_section(ctx, cnf->name + 1); + if (!sect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + X509V3_conf_err(cnf); + goto err; + } + for (j = 0; success_p && j < sk_CONF_VALUE_num(sect); j++) { + success_p = + process_pci_value(sk_CONF_VALUE_value(sect, j), + &language, &pathlen, &policy); + } + X509V3_section_free(ctx, sect); + if (!success_p) + goto err; + } else { + if (!process_pci_value(cnf, &language, &pathlen, &policy)) { + X509V3_conf_err(cnf); + goto err; + } + } + } + + /* Language is mandatory */ + if (!language) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED); + goto err; + } + nid = OBJ_obj2nid(language); + if ((nid == NID_Independent || nid == NID_id_ppl_inheritAll) && policy) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY); + goto err; + } + + pci = PROXY_CERT_INFO_EXTENSION_new(); + if (!pci) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + pci->proxyPolicy->policyLanguage = language; + language = NULL; + pci->proxyPolicy->policy = policy; + policy = NULL; + pci->pcPathLengthConstraint = pathlen; + pathlen = NULL; + goto end; + err: + if (language) { + ASN1_OBJECT_free(language); + language = NULL; + } + if (pathlen) { + ASN1_INTEGER_free(pathlen); + pathlen = NULL; + } + if (policy) { + ASN1_OCTET_STRING_free(policy); + policy = NULL; + } + if (pci) { + PROXY_CERT_INFO_EXTENSION_free(pci); + pci = NULL; + } + end: + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + return pci; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back new file mode 100644 index 0000000..f9031c0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back @@ -0,0 +1,288 @@ +/* v3_pci.c -*- mode:C; c-file-style: "eay" -*- */ +/* + * Contributed to the OpenSSL Project 2004 by Richard Levitte + * (richard@levitte.org) + */ +/* Copyright (c) 2004 Kungliga Tekniska HΓΆgskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * 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. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE 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. + */ + +#include + +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "internal.h" + + +static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, + BIO *out, int indent); +static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str); + +const X509V3_EXT_METHOD v3_pci = + { NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION), + 0, 0, 0, 0, + 0, 0, + NULL, NULL, + (X509V3_EXT_I2R)i2r_pci, + (X509V3_EXT_R2I)r2i_pci, + NULL, +}; + +static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci, + BIO *out, int indent) +{ + BIO_printf(out, "%*sPath Length Constraint: ", indent, ""); + if (pci->pcPathLengthConstraint) + i2a_ASN1_INTEGER(out, pci->pcPathLengthConstraint); + else + BIO_printf(out, "infinite"); + BIO_puts(out, "\n"); + BIO_printf(out, "%*sPolicy Language: ", indent, ""); + i2a_ASN1_OBJECT(out, pci->proxyPolicy->policyLanguage); + BIO_puts(out, "\n"); + if (pci->proxyPolicy->policy && pci->proxyPolicy->policy->data) + BIO_printf(out, "%*sPolicy Text: %s\n", indent, "", + pci->proxyPolicy->policy->data); + return 1; +} + +static int process_pci_value(CONF_VALUE *val, + ASN1_OBJECT **language, ASN1_INTEGER **pathlen, + ASN1_OCTET_STRING **policy) +{ + int free_policy = 0; + + if (strcmp(val->name, "language") == 0) { + if (*language) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED); + X509V3_conf_err(val); + return 0; + } + if (!(*language = OBJ_txt2obj(val->value, 0))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return 0; + } + } else if (strcmp(val->name, "pathlen") == 0) { + if (*pathlen) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED); + X509V3_conf_err(val); + return 0; + } + if (!X509V3_get_value_int(val, pathlen)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_POLICY_PATH_LENGTH); + X509V3_conf_err(val); + return 0; + } + } else if (strcmp(val->name, "policy") == 0) { + unsigned char *tmp_data = NULL; + long val_len; + if (!*policy) { + *policy = ASN1_OCTET_STRING_new(); + if (!*policy) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + return 0; + } + free_policy = 1; + } + if (strncmp(val->value, "hex:", 4) == 0) { + unsigned char *tmp_data2 = + x509v3_hex_to_bytes(val->value + 4, &val_len); + + if (!tmp_data2) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); + X509V3_conf_err(val); + goto err; + } + + tmp_data = OPENSSL_realloc((*policy)->data, + (*policy)->length + val_len + 1); + if (tmp_data) { + (*policy)->data = tmp_data; + OPENSSL_memcpy(&(*policy)->data[(*policy)->length], + tmp_data2, val_len); + (*policy)->length += val_len; + (*policy)->data[(*policy)->length] = '\0'; + } else { + OPENSSL_free(tmp_data2); + /* + * realloc failure implies the original data space is b0rked + * too! + */ + (*policy)->data = NULL; + (*policy)->length = 0; + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + OPENSSL_free(tmp_data2); + } else if (strncmp(val->value, "text:", 5) == 0) { + val_len = strlen(val->value + 5); + tmp_data = OPENSSL_realloc((*policy)->data, + (*policy)->length + val_len + 1); + if (tmp_data) { + (*policy)->data = tmp_data; + OPENSSL_memcpy(&(*policy)->data[(*policy)->length], + val->value + 5, val_len); + (*policy)->length += val_len; + (*policy)->data[(*policy)->length] = '\0'; + } else { + /* + * realloc failure implies the original data space is b0rked + * too! + */ + (*policy)->data = NULL; + (*policy)->length = 0; + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG); + X509V3_conf_err(val); + goto err; + } + if (!tmp_data) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + X509V3_conf_err(val); + goto err; + } + } + return 1; + err: + if (free_policy) { + ASN1_OCTET_STRING_free(*policy); + *policy = NULL; + } + return 0; +} + +static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value) +{ + PROXY_CERT_INFO_EXTENSION *pci = NULL; + STACK_OF(CONF_VALUE) *vals; + ASN1_OBJECT *language = NULL; + ASN1_INTEGER *pathlen = NULL; + ASN1_OCTET_STRING *policy = NULL; + size_t i, j; + int nid; + + vals = X509V3_parse_list(value); + for (i = 0; i < sk_CONF_VALUE_num(vals); i++) { + CONF_VALUE *cnf = sk_CONF_VALUE_value(vals, i); + if (!cnf->name || (*cnf->name != '@' && !cnf->value)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING); + X509V3_conf_err(cnf); + goto err; + } + if (*cnf->name == '@') { + STACK_OF(CONF_VALUE) *sect; + int success_p = 1; + + sect = X509V3_get_section(ctx, cnf->name + 1); + if (!sect) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); + X509V3_conf_err(cnf); + goto err; + } + for (j = 0; success_p && j < sk_CONF_VALUE_num(sect); j++) { + success_p = + process_pci_value(sk_CONF_VALUE_value(sect, j), + &language, &pathlen, &policy); + } + X509V3_section_free(ctx, sect); + if (!success_p) + goto err; + } else { + if (!process_pci_value(cnf, &language, &pathlen, &policy)) { + X509V3_conf_err(cnf); + goto err; + } + } + } + + /* Language is mandatory */ + if (!language) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED); + goto err; + } + nid = OBJ_obj2nid(language); + if ((nid == NID_Independent || nid == NID_id_ppl_inheritAll) && policy) { + OPENSSL_PUT_ERROR(X509V3, + X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY); + goto err; + } + + pci = PROXY_CERT_INFO_EXTENSION_new(); + if (!pci) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + pci->proxyPolicy->policyLanguage = language; + language = NULL; + pci->proxyPolicy->policy = policy; + policy = NULL; + pci->pcPathLengthConstraint = pathlen; + pathlen = NULL; + goto end; + err: + if (language) { + ASN1_OBJECT_free(language); + language = NULL; + } + if (pathlen) { + ASN1_INTEGER_free(pathlen); + pathlen = NULL; + } + if (policy) { + ASN1_OCTET_STRING_free(policy); + policy = NULL; + } + if (pci) { + PROXY_CERT_INFO_EXTENSION_free(pci); + pci = NULL; + } + end: + sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); + return pci; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c new file mode 100644 index 0000000..f803cc8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c @@ -0,0 +1,57 @@ +/* v3_pcia.c -*- mode:C; c-file-style: "eay" -*- */ +/* + * Contributed to the OpenSSL Project 2004 by Richard Levitte + * (richard@levitte.org) + */ +/* Copyright (c) 2004 Kungliga Tekniska HΓΆgskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * 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. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE 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. + */ + +#include +#include +#include + + +ASN1_SEQUENCE(PROXY_POLICY) = + { + ASN1_SIMPLE(PROXY_POLICY,policyLanguage,ASN1_OBJECT), + ASN1_OPT(PROXY_POLICY,policy,ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(PROXY_POLICY) + +IMPLEMENT_ASN1_FUNCTIONS(PROXY_POLICY) + +ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) = + { + ASN1_OPT(PROXY_CERT_INFO_EXTENSION,pcPathLengthConstraint,ASN1_INTEGER), + ASN1_SIMPLE(PROXY_CERT_INFO_EXTENSION,proxyPolicy,PROXY_POLICY) +} ASN1_SEQUENCE_END(PROXY_CERT_INFO_EXTENSION) + +IMPLEMENT_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c.grpc_back new file mode 100644 index 0000000..3f285f3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c.grpc_back @@ -0,0 +1,57 @@ +/* v3_pcia.c -*- mode:C; c-file-style: "eay" -*- */ +/* + * Contributed to the OpenSSL Project 2004 by Richard Levitte + * (richard@levitte.org) + */ +/* Copyright (c) 2004 Kungliga Tekniska HΓΆgskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * 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. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE 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. + */ + +#include +#include +#include + + +ASN1_SEQUENCE(PROXY_POLICY) = + { + ASN1_SIMPLE(PROXY_POLICY,policyLanguage,ASN1_OBJECT), + ASN1_OPT(PROXY_POLICY,policy,ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(PROXY_POLICY) + +IMPLEMENT_ASN1_FUNCTIONS(PROXY_POLICY) + +ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) = + { + ASN1_OPT(PROXY_CERT_INFO_EXTENSION,pcPathLengthConstraint,ASN1_INTEGER), + ASN1_SIMPLE(PROXY_CERT_INFO_EXTENSION,proxyPolicy,PROXY_POLICY) +} ASN1_SEQUENCE_END(PROXY_CERT_INFO_EXTENSION) + +IMPLEMENT_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c new file mode 100644 index 0000000..5558ca3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c @@ -0,0 +1,139 @@ +/* v3_pcons.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 + +static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD + *method, void *bcons, STACK_OF(CONF_VALUE) + *extlist); +static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_policy_constraints = { + NID_policy_constraints, 0, + ASN1_ITEM_ref(POLICY_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + i2v_POLICY_CONSTRAINTS, + v2i_POLICY_CONSTRAINTS, + NULL, NULL, + NULL +}; + +ASN1_SEQUENCE(POLICY_CONSTRAINTS) = { + ASN1_IMP_OPT(POLICY_CONSTRAINTS, requireExplicitPolicy, ASN1_INTEGER,0), + ASN1_IMP_OPT(POLICY_CONSTRAINTS, inhibitPolicyMapping, ASN1_INTEGER,1) +} ASN1_SEQUENCE_END(POLICY_CONSTRAINTS) + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) + +static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *extlist) +{ + POLICY_CONSTRAINTS *pcons = a; + X509V3_add_value_int("Require Explicit Policy", + pcons->requireExplicitPolicy, &extlist); + X509V3_add_value_int("Inhibit Policy Mapping", + pcons->inhibitPolicyMapping, &extlist); + return extlist; +} + +static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + POLICY_CONSTRAINTS *pcons = NULL; + CONF_VALUE *val; + size_t i; + if (!(pcons = POLICY_CONSTRAINTS_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + val = sk_CONF_VALUE_value(values, i); + if (!strcmp(val->name, "requireExplicitPolicy")) { + if (!X509V3_get_value_int(val, &pcons->requireExplicitPolicy)) + goto err; + } else if (!strcmp(val->name, "inhibitPolicyMapping")) { + if (!X509V3_get_value_int(val, &pcons->inhibitPolicyMapping)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(val); + goto err; + } + } + if (!pcons->inhibitPolicyMapping && !pcons->requireExplicitPolicy) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION); + goto err; + } + + return pcons; + err: + POLICY_CONSTRAINTS_free(pcons); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c.grpc_back new file mode 100644 index 0000000..1a46314 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c.grpc_back @@ -0,0 +1,139 @@ +/* v3_pcons.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 + +static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD + *method, void *bcons, STACK_OF(CONF_VALUE) + *extlist); +static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values); + +const X509V3_EXT_METHOD v3_policy_constraints = { + NID_policy_constraints, 0, + ASN1_ITEM_ref(POLICY_CONSTRAINTS), + 0, 0, 0, 0, + 0, 0, + i2v_POLICY_CONSTRAINTS, + v2i_POLICY_CONSTRAINTS, + NULL, NULL, + NULL +}; + +ASN1_SEQUENCE(POLICY_CONSTRAINTS) = { + ASN1_IMP_OPT(POLICY_CONSTRAINTS, requireExplicitPolicy, ASN1_INTEGER,0), + ASN1_IMP_OPT(POLICY_CONSTRAINTS, inhibitPolicyMapping, ASN1_INTEGER,1) +} ASN1_SEQUENCE_END(POLICY_CONSTRAINTS) + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) + +static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *extlist) +{ + POLICY_CONSTRAINTS *pcons = a; + X509V3_add_value_int("Require Explicit Policy", + pcons->requireExplicitPolicy, &extlist); + X509V3_add_value_int("Inhibit Policy Mapping", + pcons->inhibitPolicyMapping, &extlist); + return extlist; +} + +static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *values) +{ + POLICY_CONSTRAINTS *pcons = NULL; + CONF_VALUE *val; + size_t i; + if (!(pcons = POLICY_CONSTRAINTS_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + for (i = 0; i < sk_CONF_VALUE_num(values); i++) { + val = sk_CONF_VALUE_value(values, i); + if (!strcmp(val->name, "requireExplicitPolicy")) { + if (!X509V3_get_value_int(val, &pcons->requireExplicitPolicy)) + goto err; + } else if (!strcmp(val->name, "inhibitPolicyMapping")) { + if (!X509V3_get_value_int(val, &pcons->inhibitPolicyMapping)) + goto err; + } else { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME); + X509V3_conf_err(val); + goto err; + } + } + if (!pcons->inhibitPolicyMapping && !pcons->requireExplicitPolicy) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION); + goto err; + } + + return pcons; + err: + POLICY_CONSTRAINTS_free(pcons); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c new file mode 100644 index 0000000..d448741 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c @@ -0,0 +1,110 @@ +/* v3_pku.c */ +/* + * 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 + +static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + PKEY_USAGE_PERIOD *usage, BIO *out, + int indent); +/* + * static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + * X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values); + */ +const X509V3_EXT_METHOD v3_pkey_usage_period = { + NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD), + 0, 0, 0, 0, + 0, 0, 0, 0, + (X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL, + NULL +}; + +ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = { + ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0), + ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1) +} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD) + +IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + PKEY_USAGE_PERIOD *usage, BIO *out, + int indent) +{ + BIO_printf(out, "%*s", indent, ""); + if (usage->notBefore) { + BIO_write(out, "Not Before: ", 12); + ASN1_GENERALIZEDTIME_print(out, usage->notBefore); + if (usage->notAfter) + BIO_write(out, ", ", 2); + } + if (usage->notAfter) { + BIO_write(out, "Not After: ", 11); + ASN1_GENERALIZEDTIME_print(out, usage->notAfter); + } + return 1; +} + +/* + * static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values) + * X509V3_EXT_METHOD *method; X509V3_CTX *ctx; STACK_OF(CONF_VALUE) *values; + * { return NULL; } + */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c.grpc_back new file mode 100644 index 0000000..e4868b4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c.grpc_back @@ -0,0 +1,110 @@ +/* v3_pku.c */ +/* + * 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 + +static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + PKEY_USAGE_PERIOD *usage, BIO *out, + int indent); +/* + * static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + * X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values); + */ +const X509V3_EXT_METHOD v3_pkey_usage_period = { + NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD), + 0, 0, 0, 0, + 0, 0, 0, 0, + (X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL, + NULL +}; + +ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = { + ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0), + ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1) +} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD) + +IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + PKEY_USAGE_PERIOD *usage, BIO *out, + int indent) +{ + BIO_printf(out, "%*s", indent, ""); + if (usage->notBefore) { + BIO_write(out, "Not Before: ", 12); + ASN1_GENERALIZEDTIME_print(out, usage->notBefore); + if (usage->notAfter) + BIO_write(out, ", ", 2); + } + if (usage->notAfter) { + BIO_write(out, "Not After: ", 11); + ASN1_GENERALIZEDTIME_print(out, usage->notAfter); + } + return 1; +} + +/* + * static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values) + * X509V3_EXT_METHOD *method; X509V3_CTX *ctx; STACK_OF(CONF_VALUE) *values; + * { return NULL; } + */ diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c new file mode 100644 index 0000000..8c43dca --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c @@ -0,0 +1,154 @@ +/* v3_pmaps.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 + +static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD + *method, void *pmps, STACK_OF(CONF_VALUE) + *extlist); + +const X509V3_EXT_METHOD v3_policy_mappings = { + NID_policy_mappings, 0, + ASN1_ITEM_ref(POLICY_MAPPINGS), + 0, 0, 0, 0, + 0, 0, + i2v_POLICY_MAPPINGS, + v2i_POLICY_MAPPINGS, + 0, 0, + NULL +}; + +ASN1_SEQUENCE(POLICY_MAPPING) = { + ASN1_SIMPLE(POLICY_MAPPING, issuerDomainPolicy, ASN1_OBJECT), + ASN1_SIMPLE(POLICY_MAPPING, subjectDomainPolicy, ASN1_OBJECT) +} ASN1_SEQUENCE_END(POLICY_MAPPING) + +ASN1_ITEM_TEMPLATE(POLICY_MAPPINGS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, POLICY_MAPPINGS, + POLICY_MAPPING) +ASN1_ITEM_TEMPLATE_END(POLICY_MAPPINGS) + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) + +static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *ext_list) +{ + POLICY_MAPPINGS *pmaps = a; + POLICY_MAPPING *pmap; + size_t i; + char obj_tmp1[80]; + char obj_tmp2[80]; + for (i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) { + pmap = sk_POLICY_MAPPING_value(pmaps, i); + i2t_ASN1_OBJECT(obj_tmp1, 80, pmap->issuerDomainPolicy); + i2t_ASN1_OBJECT(obj_tmp2, 80, pmap->subjectDomainPolicy); + X509V3_add_value(obj_tmp1, obj_tmp2, &ext_list); + } + return ext_list; +} + +static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + POLICY_MAPPINGS *pmaps; + POLICY_MAPPING *pmap; + ASN1_OBJECT *obj1, *obj2; + CONF_VALUE *val; + size_t i; + + if (!(pmaps = sk_POLICY_MAPPING_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!val->value || !val->name) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + obj1 = OBJ_txt2obj(val->name, 0); + obj2 = OBJ_txt2obj(val->value, 0); + if (!obj1 || !obj2) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + pmap = POLICY_MAPPING_new(); + if (!pmap) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + pmap->issuerDomainPolicy = obj1; + pmap->subjectDomainPolicy = obj2; + sk_POLICY_MAPPING_push(pmaps, pmap); + } + return pmaps; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c.grpc_back new file mode 100644 index 0000000..caacdb2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c.grpc_back @@ -0,0 +1,154 @@ +/* v3_pmaps.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2003 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 + +static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD + *method, void *pmps, STACK_OF(CONF_VALUE) + *extlist); + +const X509V3_EXT_METHOD v3_policy_mappings = { + NID_policy_mappings, 0, + ASN1_ITEM_ref(POLICY_MAPPINGS), + 0, 0, 0, 0, + 0, 0, + i2v_POLICY_MAPPINGS, + v2i_POLICY_MAPPINGS, + 0, 0, + NULL +}; + +ASN1_SEQUENCE(POLICY_MAPPING) = { + ASN1_SIMPLE(POLICY_MAPPING, issuerDomainPolicy, ASN1_OBJECT), + ASN1_SIMPLE(POLICY_MAPPING, subjectDomainPolicy, ASN1_OBJECT) +} ASN1_SEQUENCE_END(POLICY_MAPPING) + +ASN1_ITEM_TEMPLATE(POLICY_MAPPINGS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, POLICY_MAPPINGS, + POLICY_MAPPING) +ASN1_ITEM_TEMPLATE_END(POLICY_MAPPINGS) + +IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) + +static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD + *method, void *a, STACK_OF(CONF_VALUE) + *ext_list) +{ + POLICY_MAPPINGS *pmaps = a; + POLICY_MAPPING *pmap; + size_t i; + char obj_tmp1[80]; + char obj_tmp2[80]; + for (i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) { + pmap = sk_POLICY_MAPPING_value(pmaps, i); + i2t_ASN1_OBJECT(obj_tmp1, 80, pmap->issuerDomainPolicy); + i2t_ASN1_OBJECT(obj_tmp2, 80, pmap->subjectDomainPolicy); + X509V3_add_value(obj_tmp1, obj_tmp2, &ext_list); + } + return ext_list; +} + +static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) +{ + POLICY_MAPPINGS *pmaps; + POLICY_MAPPING *pmap; + ASN1_OBJECT *obj1, *obj2; + CONF_VALUE *val; + size_t i; + + if (!(pmaps = sk_POLICY_MAPPING_new_null())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + val = sk_CONF_VALUE_value(nval, i); + if (!val->value || !val->name) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + obj1 = OBJ_txt2obj(val->name, 0); + obj2 = OBJ_txt2obj(val->value, 0); + if (!obj1 || !obj2) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); + X509V3_conf_err(val); + return NULL; + } + pmap = POLICY_MAPPING_new(); + if (!pmap) { + sk_POLICY_MAPPING_pop_free(pmaps, POLICY_MAPPING_free); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + pmap->issuerDomainPolicy = obj1; + pmap->subjectDomainPolicy = obj2; + sk_POLICY_MAPPING_push(pmaps, pmap); + } + return pmaps; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c new file mode 100644 index 0000000..dbe3adc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c @@ -0,0 +1,229 @@ +/* v3_prn.c */ +/* + * 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). */ + +/* X509 v3 extension utilities */ + +#include + +#include +#include +#include +#include + +/* Extension printing routines */ + +static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, + unsigned long flag, int indent, int supported); + +/* Print out a name+value stack */ + +void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml) +{ + size_t i; + CONF_VALUE *nval; + if (!val) + return; + if (!ml || !sk_CONF_VALUE_num(val)) { + BIO_printf(out, "%*s", indent, ""); + if (!sk_CONF_VALUE_num(val)) + BIO_puts(out, "\n"); + } + for (i = 0; i < sk_CONF_VALUE_num(val); i++) { + if (ml) + BIO_printf(out, "%*s", indent, ""); + else if (i > 0) + BIO_printf(out, ", "); + nval = sk_CONF_VALUE_value(val, i); + if (!nval->name) + BIO_puts(out, nval->value); + else if (!nval->value) + BIO_puts(out, nval->name); + else + BIO_printf(out, "%s:%s", nval->name, nval->value); + if (ml) + BIO_puts(out, "\n"); + } +} + +/* Main routine: print out a general extension */ + +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, + int indent) +{ + void *ext_str = NULL; + char *value = NULL; + const unsigned char *p; + const X509V3_EXT_METHOD *method; + STACK_OF(CONF_VALUE) *nval = NULL; + int ok = 1; + + if (!(method = X509V3_EXT_get(ext))) + return unknown_ext_print(out, ext, flag, indent, 0); + p = ext->value->data; + if (method->it) + ext_str = + ASN1_item_d2i(NULL, &p, ext->value->length, + ASN1_ITEM_ptr(method->it)); + else + ext_str = method->d2i(NULL, &p, ext->value->length); + + if (!ext_str) + return unknown_ext_print(out, ext, flag, indent, 1); + + if (method->i2s) { + if (!(value = method->i2s(method, ext_str))) { + ok = 0; + goto err; + } + BIO_printf(out, "%*s%s", indent, "", value); + } else if (method->i2v) { + if (!(nval = method->i2v(method, ext_str, NULL))) { + ok = 0; + goto err; + } + X509V3_EXT_val_prn(out, nval, indent, + method->ext_flags & X509V3_EXT_MULTILINE); + } else if (method->i2r) { + if (!method->i2r(method, ext_str, out, indent)) + ok = 0; + } else + ok = 0; + + err: + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + if (value) + OPENSSL_free(value); + if (method->it) + ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it)); + else + method->ext_free(ext_str); + return ok; +} + +int X509V3_extensions_print(BIO *bp, const char *title, + STACK_OF(X509_EXTENSION) *exts, + unsigned long flag, int indent) +{ + size_t i; + int j; + + if (sk_X509_EXTENSION_num(exts) <= 0) + return 1; + + if (title) { + BIO_printf(bp, "%*s%s:\n", indent, "", title); + indent += 4; + } + + for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { + ASN1_OBJECT *obj; + X509_EXTENSION *ex; + ex = sk_X509_EXTENSION_value(exts, i); + if (indent && BIO_printf(bp, "%*s", indent, "") <= 0) + return 0; + obj = X509_EXTENSION_get_object(ex); + i2a_ASN1_OBJECT(bp, obj); + j = X509_EXTENSION_get_critical(ex); + if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0) + return 0; + if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { + BIO_printf(bp, "%*s", indent + 4, ""); + M_ASN1_OCTET_STRING_print(bp, ex->value); + } + if (BIO_write(bp, "\n", 1) <= 0) + return 0; + } + return 1; +} + +static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, + unsigned long flag, int indent, int supported) +{ + switch (flag & X509V3_EXT_UNKNOWN_MASK) { + + case X509V3_EXT_DEFAULT: + return 0; + + case X509V3_EXT_ERROR_UNKNOWN: + if (supported) + BIO_printf(out, "%*s", indent, ""); + else + BIO_printf(out, "%*s", indent, ""); + return 1; + + case X509V3_EXT_PARSE_UNKNOWN: + case X509V3_EXT_DUMP_UNKNOWN: + return BIO_hexdump(out, ext->value->data, ext->value->length, indent); + + default: + return 1; + } +} + +#ifndef OPENSSL_NO_FP_API +int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) +{ + BIO *bio_tmp; + int ret; + if (!(bio_tmp = BIO_new_fp(fp, BIO_NOCLOSE))) + return 0; + ret = X509V3_EXT_print(bio_tmp, ext, flag, indent); + BIO_free(bio_tmp); + return ret; +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c.grpc_back new file mode 100644 index 0000000..2f5efcf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c.grpc_back @@ -0,0 +1,229 @@ +/* v3_prn.c */ +/* + * 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). */ + +/* X509 v3 extension utilities */ + +#include + +#include +#include +#include +#include + +/* Extension printing routines */ + +static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, + unsigned long flag, int indent, int supported); + +/* Print out a name+value stack */ + +void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml) +{ + size_t i; + CONF_VALUE *nval; + if (!val) + return; + if (!ml || !sk_CONF_VALUE_num(val)) { + BIO_printf(out, "%*s", indent, ""); + if (!sk_CONF_VALUE_num(val)) + BIO_puts(out, "\n"); + } + for (i = 0; i < sk_CONF_VALUE_num(val); i++) { + if (ml) + BIO_printf(out, "%*s", indent, ""); + else if (i > 0) + BIO_printf(out, ", "); + nval = sk_CONF_VALUE_value(val, i); + if (!nval->name) + BIO_puts(out, nval->value); + else if (!nval->value) + BIO_puts(out, nval->name); + else + BIO_printf(out, "%s:%s", nval->name, nval->value); + if (ml) + BIO_puts(out, "\n"); + } +} + +/* Main routine: print out a general extension */ + +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, + int indent) +{ + void *ext_str = NULL; + char *value = NULL; + const unsigned char *p; + const X509V3_EXT_METHOD *method; + STACK_OF(CONF_VALUE) *nval = NULL; + int ok = 1; + + if (!(method = X509V3_EXT_get(ext))) + return unknown_ext_print(out, ext, flag, indent, 0); + p = ext->value->data; + if (method->it) + ext_str = + ASN1_item_d2i(NULL, &p, ext->value->length, + ASN1_ITEM_ptr(method->it)); + else + ext_str = method->d2i(NULL, &p, ext->value->length); + + if (!ext_str) + return unknown_ext_print(out, ext, flag, indent, 1); + + if (method->i2s) { + if (!(value = method->i2s(method, ext_str))) { + ok = 0; + goto err; + } + BIO_printf(out, "%*s%s", indent, "", value); + } else if (method->i2v) { + if (!(nval = method->i2v(method, ext_str, NULL))) { + ok = 0; + goto err; + } + X509V3_EXT_val_prn(out, nval, indent, + method->ext_flags & X509V3_EXT_MULTILINE); + } else if (method->i2r) { + if (!method->i2r(method, ext_str, out, indent)) + ok = 0; + } else + ok = 0; + + err: + sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); + if (value) + OPENSSL_free(value); + if (method->it) + ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it)); + else + method->ext_free(ext_str); + return ok; +} + +int X509V3_extensions_print(BIO *bp, const char *title, + STACK_OF(X509_EXTENSION) *exts, + unsigned long flag, int indent) +{ + size_t i; + int j; + + if (sk_X509_EXTENSION_num(exts) <= 0) + return 1; + + if (title) { + BIO_printf(bp, "%*s%s:\n", indent, "", title); + indent += 4; + } + + for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { + ASN1_OBJECT *obj; + X509_EXTENSION *ex; + ex = sk_X509_EXTENSION_value(exts, i); + if (indent && BIO_printf(bp, "%*s", indent, "") <= 0) + return 0; + obj = X509_EXTENSION_get_object(ex); + i2a_ASN1_OBJECT(bp, obj); + j = X509_EXTENSION_get_critical(ex); + if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0) + return 0; + if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { + BIO_printf(bp, "%*s", indent + 4, ""); + M_ASN1_OCTET_STRING_print(bp, ex->value); + } + if (BIO_write(bp, "\n", 1) <= 0) + return 0; + } + return 1; +} + +static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, + unsigned long flag, int indent, int supported) +{ + switch (flag & X509V3_EXT_UNKNOWN_MASK) { + + case X509V3_EXT_DEFAULT: + return 0; + + case X509V3_EXT_ERROR_UNKNOWN: + if (supported) + BIO_printf(out, "%*s", indent, ""); + else + BIO_printf(out, "%*s", indent, ""); + return 1; + + case X509V3_EXT_PARSE_UNKNOWN: + case X509V3_EXT_DUMP_UNKNOWN: + return BIO_hexdump(out, ext->value->data, ext->value->length, indent); + + default: + return 1; + } +} + +#ifndef OPENSSL_NO_FP_API +int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) +{ + BIO *bio_tmp; + int ret; + if (!(bio_tmp = BIO_new_fp(fp, BIO_NOCLOSE))) + return 0; + ret = X509V3_EXT_print(bio_tmp, ext, flag, indent); + BIO_free(bio_tmp); + return ret; +} +#endif diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c new file mode 100644 index 0000000..deaf586 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c @@ -0,0 +1,843 @@ +/* v3_purp.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * 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). */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../internal.h" + +#define V1_ROOT (EXFLAG_V1|EXFLAG_SS) +#define ku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage))) +#define xku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage))) +#define ns_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage))) + +static void x509v3_cache_extensions(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, + int ca); +static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int purpose_smime(const X509 *x, int ca); +static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); +static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); + +static int xp_cmp(const X509_PURPOSE **a, const X509_PURPOSE **b); +static void xptable_free(X509_PURPOSE *p); + +static X509_PURPOSE xstandard[] = { + {X509_PURPOSE_SSL_CLIENT, X509_TRUST_SSL_CLIENT, 0, + check_purpose_ssl_client, (char *)"SSL client", (char *)"sslclient", + NULL}, + {X509_PURPOSE_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, + check_purpose_ssl_server, (char *)"SSL server", (char *)"sslserver", + NULL}, + {X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, + check_purpose_ns_ssl_server, (char *)"Netscape SSL server", + (char *)"nssslserver", NULL}, + {X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, + (char *)"S/MIME signing", (char *)"smimesign", NULL}, + {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, + check_purpose_smime_encrypt, (char *)"S/MIME encryption", + (char *)"smimeencrypt", NULL}, + {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, + (char *)"CRL signing", (char *)"crlsign", NULL}, + {X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, (char *)"Any Purpose", + (char *)"any", NULL}, + {X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, + (char *)"OCSP helper", (char *)"ocsphelper", NULL}, + {X509_PURPOSE_TIMESTAMP_SIGN, X509_TRUST_TSA, 0, + check_purpose_timestamp_sign, (char *)"Time Stamp signing", + (char *)"timestampsign", NULL}, +}; + +#define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) + +static STACK_OF(X509_PURPOSE) *xptable = NULL; + +static int xp_cmp(const X509_PURPOSE **a, const X509_PURPOSE **b) +{ + return (*a)->purpose - (*b)->purpose; +} + +/* + * As much as I'd like to make X509_check_purpose use a "const" X509* I + * really can't because it does recalculate hashes and do other non-const + * things. + */ +int X509_check_purpose(X509 *x, int id, int ca) +{ + int idx; + const X509_PURPOSE *pt; + x509v3_cache_extensions(x); + if (id == -1) + return 1; + idx = X509_PURPOSE_get_by_id(id); + if (idx == -1) + return -1; + pt = X509_PURPOSE_get0(idx); + return pt->check_purpose(pt, x, ca); +} + +int X509_PURPOSE_set(int *p, int purpose) +{ + if (X509_PURPOSE_get_by_id(purpose) == -1) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_PURPOSE); + return 0; + } + *p = purpose; + return 1; +} + +int X509_PURPOSE_get_count(void) +{ + if (!xptable) + return X509_PURPOSE_COUNT; + return sk_X509_PURPOSE_num(xptable) + X509_PURPOSE_COUNT; +} + +X509_PURPOSE *X509_PURPOSE_get0(int idx) +{ + if (idx < 0) + return NULL; + if (idx < (int)X509_PURPOSE_COUNT) + return xstandard + idx; + return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT); +} + +int X509_PURPOSE_get_by_sname(char *sname) +{ + int i; + X509_PURPOSE *xptmp; + for (i = 0; i < X509_PURPOSE_get_count(); i++) { + xptmp = X509_PURPOSE_get0(i); + if (!strcmp(xptmp->sname, sname)) + return i; + } + return -1; +} + +int X509_PURPOSE_get_by_id(int purpose) +{ + X509_PURPOSE tmp; + size_t idx; + + if ((purpose >= X509_PURPOSE_MIN) && (purpose <= X509_PURPOSE_MAX)) + return purpose - X509_PURPOSE_MIN; + tmp.purpose = 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; +} + +int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck) (const X509_PURPOSE *, const X509 *, int), + char *name, char *sname, void *arg) +{ + int idx; + X509_PURPOSE *ptmp; + char *name_dup, *sname_dup; + + /* + * This is set according to what we change: application can't set it + */ + flags &= ~X509_PURPOSE_DYNAMIC; + /* This will always be set for application modified trust entries */ + flags |= X509_PURPOSE_DYNAMIC_NAME; + /* Get existing entry if any */ + idx = X509_PURPOSE_get_by_id(id); + /* Need a new entry */ + if (idx == -1) { + if (!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return 0; + } + ptmp->flags = X509_PURPOSE_DYNAMIC; + } else + ptmp = X509_PURPOSE_get0(idx); + + /* Duplicate the supplied names. */ + 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) + OPENSSL_free(name_dup); + if (sname_dup != NULL) + OPENSSL_free(sname_dup); + if (idx == -1) + OPENSSL_free(ptmp); + return 0; + } + + /* OPENSSL_free existing name if dynamic */ + if (ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) { + OPENSSL_free(ptmp->name); + OPENSSL_free(ptmp->sname); + } + /* dup supplied name */ + ptmp->name = name_dup; + ptmp->sname = sname_dup; + /* Keep the dynamic flag of existing entry */ + ptmp->flags &= X509_PURPOSE_DYNAMIC; + /* Set all other flags */ + ptmp->flags |= flags; + + ptmp->purpose = id; + ptmp->trust = trust; + ptmp->check_purpose = ck; + ptmp->usr_data = arg; + + /* If its a new entry manage the dynamic table */ + if (idx == -1) { + if (!xptable && !(xptable = sk_X509_PURPOSE_new(xp_cmp))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + xptable_free(ptmp); + return 0; + } + if (!sk_X509_PURPOSE_push(xptable, ptmp)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + xptable_free(ptmp); + return 0; + } + } + return 1; +} + +static void xptable_free(X509_PURPOSE *p) +{ + if (!p) + return; + if (p->flags & X509_PURPOSE_DYNAMIC) { + if (p->flags & X509_PURPOSE_DYNAMIC_NAME) { + OPENSSL_free(p->name); + OPENSSL_free(p->sname); + } + OPENSSL_free(p); + } +} + +void X509_PURPOSE_cleanup(void) +{ + unsigned int i; + sk_X509_PURPOSE_pop_free(xptable, xptable_free); + for (i = 0; i < X509_PURPOSE_COUNT; i++) + xptable_free(xstandard + i); + xptable = NULL; +} + +int X509_PURPOSE_get_id(X509_PURPOSE *xp) +{ + return xp->purpose; +} + +char *X509_PURPOSE_get0_name(X509_PURPOSE *xp) +{ + return xp->name; +} + +char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp) +{ + return xp->sname; +} + +int X509_PURPOSE_get_trust(X509_PURPOSE *xp) +{ + return xp->trust; +} + +static int nid_cmp(const void *void_a, const void *void_b) +{ + const int *a = void_a, *b = void_b; + + return *a - *b; +} + +int X509_supported_extension(X509_EXTENSION *ex) +{ + /* + * This table is a list of the NIDs of supported extensions: that is + * those which are used by the verify process. If an extension is + * critical and doesn't appear in this list then the verify process will + * normally reject the certificate. The list must be kept in numerical + * order because it will be searched using bsearch. + */ + + static const int supported_nids[] = { + NID_netscape_cert_type, /* 71 */ + NID_key_usage, /* 83 */ + NID_subject_alt_name, /* 85 */ + NID_basic_constraints, /* 87 */ + NID_certificate_policies, /* 89 */ + NID_ext_key_usage, /* 126 */ + NID_policy_constraints, /* 401 */ + NID_proxyCertInfo, /* 663 */ + NID_name_constraints, /* 666 */ + NID_policy_mappings, /* 747 */ + NID_inhibit_any_policy /* 748 */ + }; + + int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex)); + + if (ex_nid == NID_undef) + return 0; + + if (bsearch + (&ex_nid, supported_nids, sizeof(supported_nids) / sizeof(int), + sizeof(int), nid_cmp) != NULL) + return 1; + return 0; +} + +static void setup_dp(X509 *x, DIST_POINT *dp) +{ + X509_NAME *iname = NULL; + size_t i; + if (dp->reasons) { + if (dp->reasons->length > 0) + dp->dp_reasons = dp->reasons->data[0]; + if (dp->reasons->length > 1) + dp->dp_reasons |= (dp->reasons->data[1] << 8); + dp->dp_reasons &= CRLDP_ALL_REASONS; + } else + dp->dp_reasons = CRLDP_ALL_REASONS; + if (!dp->distpoint || (dp->distpoint->type != 1)) + return; + for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i); + if (gen->type == GEN_DIRNAME) { + iname = gen->d.directoryName; + break; + } + } + if (!iname) + iname = X509_get_issuer_name(x); + + DIST_POINT_set_dpname(dp->distpoint, iname); + +} + +static void setup_crldp(X509 *x) +{ + size_t i; + x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL); + for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) + setup_dp(x, sk_DIST_POINT_value(x->crldp, i)); +} + +static void x509v3_cache_extensions(X509 *x) +{ + BASIC_CONSTRAINTS *bs; + PROXY_CERT_INFO_EXTENSION *pci; + ASN1_BIT_STRING *usage; + ASN1_BIT_STRING *ns; + EXTENDED_KEY_USAGE *extusage; + X509_EXTENSION *ex; + size_t i; + int j; + + CRYPTO_MUTEX_lock_read(&x->lock); + const int is_set = x->ex_flags & EXFLAG_SET; + CRYPTO_MUTEX_unlock_read(&x->lock); + + if (is_set) { + return; + } + + CRYPTO_MUTEX_lock_write(&x->lock); + if (x->ex_flags & EXFLAG_SET) { + CRYPTO_MUTEX_unlock_write(&x->lock); + return; + } + + X509_digest(x, EVP_sha1(), x->sha1_hash, NULL); + /* V1 should mean no extensions ... */ + if (!X509_get_version(x)) + x->ex_flags |= EXFLAG_V1; + /* Handle basic constraints */ + if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) { + if (bs->ca) + x->ex_flags |= EXFLAG_CA; + if (bs->pathlen) { + if ((bs->pathlen->type == V_ASN1_NEG_INTEGER) + || !bs->ca) { + x->ex_flags |= EXFLAG_INVALID; + x->ex_pathlen = 0; + } else + x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen); + } else + x->ex_pathlen = -1; + BASIC_CONSTRAINTS_free(bs); + x->ex_flags |= EXFLAG_BCONS; + } + /* Handle proxy certificates */ + if ((pci = X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) { + if (x->ex_flags & EXFLAG_CA + || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0 + || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) { + x->ex_flags |= EXFLAG_INVALID; + } + if (pci->pcPathLengthConstraint) { + x->ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint); + } else + x->ex_pcpathlen = -1; + PROXY_CERT_INFO_EXTENSION_free(pci); + x->ex_flags |= EXFLAG_PROXY; + } + /* Handle key usage */ + if ((usage = X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) { + if (usage->length > 0) { + x->ex_kusage = usage->data[0]; + if (usage->length > 1) + x->ex_kusage |= usage->data[1] << 8; + } else + x->ex_kusage = 0; + x->ex_flags |= EXFLAG_KUSAGE; + ASN1_BIT_STRING_free(usage); + } + x->ex_xkusage = 0; + if ((extusage = X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) { + x->ex_flags |= EXFLAG_XKUSAGE; + for (i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) { + switch (OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage, i))) { + case NID_server_auth: + x->ex_xkusage |= XKU_SSL_SERVER; + break; + + case NID_client_auth: + x->ex_xkusage |= XKU_SSL_CLIENT; + break; + + case NID_email_protect: + x->ex_xkusage |= XKU_SMIME; + break; + + case NID_code_sign: + x->ex_xkusage |= XKU_CODE_SIGN; + break; + + case NID_ms_sgc: + case NID_ns_sgc: + x->ex_xkusage |= XKU_SGC; + break; + + case NID_OCSP_sign: + x->ex_xkusage |= XKU_OCSP_SIGN; + break; + + case NID_time_stamp: + x->ex_xkusage |= XKU_TIMESTAMP; + break; + + case NID_dvcs: + x->ex_xkusage |= XKU_DVCS; + break; + + case NID_anyExtendedKeyUsage: + x->ex_xkusage |= XKU_ANYEKU; + break; + } + } + sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); + } + + if ((ns = X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) { + if (ns->length > 0) + x->ex_nscert = ns->data[0]; + else + x->ex_nscert = 0; + x->ex_flags |= EXFLAG_NSCERT; + ASN1_BIT_STRING_free(ns); + } + x->skid = X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL); + x->akid = X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL); + /* Does subject name match issuer ? */ + if (!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) { + x->ex_flags |= EXFLAG_SI; + /* If SKID matches AKID also indicate self signed */ + if (X509_check_akid(x, x->akid) == X509_V_OK && + !ku_reject(x, KU_KEY_CERT_SIGN)) + x->ex_flags |= EXFLAG_SS; + } + x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + x->nc = X509_get_ext_d2i(x, NID_name_constraints, &j, NULL); + if (!x->nc && (j != -1)) + x->ex_flags |= EXFLAG_INVALID; + setup_crldp(x); + + for (j = 0; j < X509_get_ext_count(x); j++) { + ex = X509_get_ext(x, j); + if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) + == NID_freshest_crl) + x->ex_flags |= EXFLAG_FRESHEST; + if (!X509_EXTENSION_get_critical(ex)) + continue; + if (!X509_supported_extension(ex)) { + x->ex_flags |= EXFLAG_CRITICAL; + break; + } + } + x->ex_flags |= EXFLAG_SET; + + CRYPTO_MUTEX_unlock_write(&x->lock); +} + +/* 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; + /* 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) +{ + x509v3_cache_extensions(x); + return check_ca(x); +} + +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_ca(x); + /* We need to do digital signatures or key agreement */ + if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_KEY_AGREEMENT)) + return 0; + /* nsCertType if present should allow SSL client use */ + if (ns_reject(x, NS_SSL_CLIENT)) + return 0; + return 1; +} + +/* + * Key usage needed for TLS/SSL server: digital signature, encipherment or + * key agreement. The ssl code can check this more thoroughly for individual + * key types. + */ +#define KU_TLS \ + (KU_DIGITAL_SIGNATURE|KU_KEY_ENCIPHERMENT|KU_KEY_AGREEMENT) + +static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + if (xku_reject(x, XKU_SSL_SERVER)) + return 0; + if (ca) + return check_ca(x); + + if (ns_reject(x, NS_SSL_SERVER)) + return 0; + if (ku_reject(x, KU_TLS)) + return 0; + + return 1; + +} + +static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = check_purpose_ssl_server(xp, x, ca); + if (!ret || ca) + return ret; + /* We need to encipher or Netscape complains */ + if (ku_reject(x, KU_KEY_ENCIPHERMENT)) + return 0; + return ret; +} + +/* 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) { + /* check nsCertType if present */ + 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) { + return (x->ex_nscert & NS_SMIME) == NS_SMIME; + } + return 1; +} + +static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = purpose_smime(x, ca); + if (!ret || ca) + return ret; + if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION)) + return 0; + return ret; +} + +static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = purpose_smime(x, ca); + if (!ret || ca) + return ret; + if (ku_reject(x, KU_KEY_ENCIPHERMENT)) + return 0; + return ret; +} + +static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + if (ca) { + return check_ca(x); + } + if (ku_reject(x, KU_CRL_SIGN)) + return 0; + return 1; +} + +/* + * OCSP helper: this is *not* a full OCSP check. It just checks that each CA + * is valid. Additional checks must be made on the chain. + */ + +static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca) +{ + if (ca) + return check_ca(x); + /* leaf certificate is checked in OCSP_verify() */ + return 1; +} + +static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int i_ext; + + /* If ca is true we must return if this is a valid CA certificate. */ + if (ca) + return check_ca(x); + + /* + * Check the optional key usage field: + * if Key Usage is present, it must be one of digitalSignature + * and/or nonRepudiation (other values are not consistent and shall + * be rejected). + */ + if ((x->ex_flags & EXFLAG_KUSAGE) + && ((x->ex_kusage & ~(KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)) || + !(x->ex_kusage & (KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)))) + return 0; + + /* Only time stamp key usage is permitted and it's required. */ + if (!(x->ex_flags & EXFLAG_XKUSAGE) || x->ex_xkusage != XKU_TIMESTAMP) + return 0; + + /* Extended Key Usage MUST be critical */ + i_ext = X509_get_ext_by_NID((X509 *)x, NID_ext_key_usage, -1); + if (i_ext >= 0) { + X509_EXTENSION *ext = X509_get_ext((X509 *)x, i_ext); + if (!X509_EXTENSION_get_critical(ext)) + return 0; + } + + return 1; +} + +static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) +{ + return 1; +} + +/* + * Various checks to see if one certificate issued the second. This can be + * used to prune a set of possible issuer certificates which have been looked + * up using some simple method such as by subject name. These are: 1. Check + * issuer_name(subject) == subject_name(issuer) 2. If akid(subject) exists + * check it matches issuer 3. If key_usage(issuer) exists check it supports + * certificate signing returns 0 for OK, positive for reason for mismatch, + * reasons match codes for X509_verify_cert() + */ + +int X509_check_issued(X509 *issuer, X509 *subject) +{ + if (X509_NAME_cmp(X509_get_subject_name(issuer), + X509_get_issuer_name(subject))) + return X509_V_ERR_SUBJECT_ISSUER_MISMATCH; + x509v3_cache_extensions(issuer); + x509v3_cache_extensions(subject); + + if (subject->akid) { + int ret = X509_check_akid(issuer, subject->akid); + if (ret != X509_V_OK) + return ret; + } + + if (subject->ex_flags & EXFLAG_PROXY) { + if (ku_reject(issuer, KU_DIGITAL_SIGNATURE)) + return X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE; + } else if (ku_reject(issuer, KU_KEY_CERT_SIGN)) + return X509_V_ERR_KEYUSAGE_NO_CERTSIGN; + return X509_V_OK; +} + +int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) +{ + + if (!akid) + return X509_V_OK; + + /* Check key ids (if present) */ + if (akid->keyid && issuer->skid && + ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid)) + return X509_V_ERR_AKID_SKID_MISMATCH; + /* Check serial number */ + if (akid->serial && + ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial)) + return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; + /* Check issuer name */ + if (akid->issuer) { + /* + * Ugh, for some peculiar reason AKID includes SEQUENCE OF + * GeneralName. So look for a DirName. There may be more than one but + * we only take any notice of the first. + */ + GENERAL_NAMES *gens; + GENERAL_NAME *gen; + X509_NAME *nm = NULL; + size_t i; + gens = akid->issuer; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gen = sk_GENERAL_NAME_value(gens, i); + if (gen->type == GEN_DIRNAME) { + nm = gen->d.dirn; + break; + } + } + if (nm && X509_NAME_cmp(nm, X509_get_issuer_name(issuer))) + return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back new file mode 100644 index 0000000..d9d105e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back @@ -0,0 +1,843 @@ +/* v3_purp.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project + * 2001. + */ +/* ==================================================================== + * 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). */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../internal.h" + +#define V1_ROOT (EXFLAG_V1|EXFLAG_SS) +#define ku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage))) +#define xku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage))) +#define ns_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage))) + +static void x509v3_cache_extensions(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, + int ca); +static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int purpose_smime(const X509 *x, int ca); +static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, + int ca); +static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); +static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); + +static int xp_cmp(const X509_PURPOSE **a, const X509_PURPOSE **b); +static void xptable_free(X509_PURPOSE *p); + +static X509_PURPOSE xstandard[] = { + {X509_PURPOSE_SSL_CLIENT, X509_TRUST_SSL_CLIENT, 0, + check_purpose_ssl_client, (char *)"SSL client", (char *)"sslclient", + NULL}, + {X509_PURPOSE_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, + check_purpose_ssl_server, (char *)"SSL server", (char *)"sslserver", + NULL}, + {X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, + check_purpose_ns_ssl_server, (char *)"Netscape SSL server", + (char *)"nssslserver", NULL}, + {X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, + (char *)"S/MIME signing", (char *)"smimesign", NULL}, + {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, + check_purpose_smime_encrypt, (char *)"S/MIME encryption", + (char *)"smimeencrypt", NULL}, + {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, + (char *)"CRL signing", (char *)"crlsign", NULL}, + {X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, (char *)"Any Purpose", + (char *)"any", NULL}, + {X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, + (char *)"OCSP helper", (char *)"ocsphelper", NULL}, + {X509_PURPOSE_TIMESTAMP_SIGN, X509_TRUST_TSA, 0, + check_purpose_timestamp_sign, (char *)"Time Stamp signing", + (char *)"timestampsign", NULL}, +}; + +#define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) + +static STACK_OF(X509_PURPOSE) *xptable = NULL; + +static int xp_cmp(const X509_PURPOSE **a, const X509_PURPOSE **b) +{ + return (*a)->purpose - (*b)->purpose; +} + +/* + * As much as I'd like to make X509_check_purpose use a "const" X509* I + * really can't because it does recalculate hashes and do other non-const + * things. + */ +int X509_check_purpose(X509 *x, int id, int ca) +{ + int idx; + const X509_PURPOSE *pt; + x509v3_cache_extensions(x); + if (id == -1) + return 1; + idx = X509_PURPOSE_get_by_id(id); + if (idx == -1) + return -1; + pt = X509_PURPOSE_get0(idx); + return pt->check_purpose(pt, x, ca); +} + +int X509_PURPOSE_set(int *p, int purpose) +{ + if (X509_PURPOSE_get_by_id(purpose) == -1) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_PURPOSE); + return 0; + } + *p = purpose; + return 1; +} + +int X509_PURPOSE_get_count(void) +{ + if (!xptable) + return X509_PURPOSE_COUNT; + return sk_X509_PURPOSE_num(xptable) + X509_PURPOSE_COUNT; +} + +X509_PURPOSE *X509_PURPOSE_get0(int idx) +{ + if (idx < 0) + return NULL; + if (idx < (int)X509_PURPOSE_COUNT) + return xstandard + idx; + return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT); +} + +int X509_PURPOSE_get_by_sname(char *sname) +{ + int i; + X509_PURPOSE *xptmp; + for (i = 0; i < X509_PURPOSE_get_count(); i++) { + xptmp = X509_PURPOSE_get0(i); + if (!strcmp(xptmp->sname, sname)) + return i; + } + return -1; +} + +int X509_PURPOSE_get_by_id(int purpose) +{ + X509_PURPOSE tmp; + size_t idx; + + if ((purpose >= X509_PURPOSE_MIN) && (purpose <= X509_PURPOSE_MAX)) + return purpose - X509_PURPOSE_MIN; + tmp.purpose = 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; +} + +int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck) (const X509_PURPOSE *, const X509 *, int), + char *name, char *sname, void *arg) +{ + int idx; + X509_PURPOSE *ptmp; + char *name_dup, *sname_dup; + + /* + * This is set according to what we change: application can't set it + */ + flags &= ~X509_PURPOSE_DYNAMIC; + /* This will always be set for application modified trust entries */ + flags |= X509_PURPOSE_DYNAMIC_NAME; + /* Get existing entry if any */ + idx = X509_PURPOSE_get_by_id(id); + /* Need a new entry */ + if (idx == -1) { + if (!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return 0; + } + ptmp->flags = X509_PURPOSE_DYNAMIC; + } else + ptmp = X509_PURPOSE_get0(idx); + + /* Duplicate the supplied names. */ + 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) + OPENSSL_free(name_dup); + if (sname_dup != NULL) + OPENSSL_free(sname_dup); + if (idx == -1) + OPENSSL_free(ptmp); + return 0; + } + + /* OPENSSL_free existing name if dynamic */ + if (ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) { + OPENSSL_free(ptmp->name); + OPENSSL_free(ptmp->sname); + } + /* dup supplied name */ + ptmp->name = name_dup; + ptmp->sname = sname_dup; + /* Keep the dynamic flag of existing entry */ + ptmp->flags &= X509_PURPOSE_DYNAMIC; + /* Set all other flags */ + ptmp->flags |= flags; + + ptmp->purpose = id; + ptmp->trust = trust; + ptmp->check_purpose = ck; + ptmp->usr_data = arg; + + /* If its a new entry manage the dynamic table */ + if (idx == -1) { + if (!xptable && !(xptable = sk_X509_PURPOSE_new(xp_cmp))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + xptable_free(ptmp); + return 0; + } + if (!sk_X509_PURPOSE_push(xptable, ptmp)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + xptable_free(ptmp); + return 0; + } + } + return 1; +} + +static void xptable_free(X509_PURPOSE *p) +{ + if (!p) + return; + if (p->flags & X509_PURPOSE_DYNAMIC) { + if (p->flags & X509_PURPOSE_DYNAMIC_NAME) { + OPENSSL_free(p->name); + OPENSSL_free(p->sname); + } + OPENSSL_free(p); + } +} + +void X509_PURPOSE_cleanup(void) +{ + unsigned int i; + sk_X509_PURPOSE_pop_free(xptable, xptable_free); + for (i = 0; i < X509_PURPOSE_COUNT; i++) + xptable_free(xstandard + i); + xptable = NULL; +} + +int X509_PURPOSE_get_id(X509_PURPOSE *xp) +{ + return xp->purpose; +} + +char *X509_PURPOSE_get0_name(X509_PURPOSE *xp) +{ + return xp->name; +} + +char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp) +{ + return xp->sname; +} + +int X509_PURPOSE_get_trust(X509_PURPOSE *xp) +{ + return xp->trust; +} + +static int nid_cmp(const void *void_a, const void *void_b) +{ + const int *a = void_a, *b = void_b; + + return *a - *b; +} + +int X509_supported_extension(X509_EXTENSION *ex) +{ + /* + * This table is a list of the NIDs of supported extensions: that is + * those which are used by the verify process. If an extension is + * critical and doesn't appear in this list then the verify process will + * normally reject the certificate. The list must be kept in numerical + * order because it will be searched using bsearch. + */ + + static const int supported_nids[] = { + NID_netscape_cert_type, /* 71 */ + NID_key_usage, /* 83 */ + NID_subject_alt_name, /* 85 */ + NID_basic_constraints, /* 87 */ + NID_certificate_policies, /* 89 */ + NID_ext_key_usage, /* 126 */ + NID_policy_constraints, /* 401 */ + NID_proxyCertInfo, /* 663 */ + NID_name_constraints, /* 666 */ + NID_policy_mappings, /* 747 */ + NID_inhibit_any_policy /* 748 */ + }; + + int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex)); + + if (ex_nid == NID_undef) + return 0; + + if (bsearch + (&ex_nid, supported_nids, sizeof(supported_nids) / sizeof(int), + sizeof(int), nid_cmp) != NULL) + return 1; + return 0; +} + +static void setup_dp(X509 *x, DIST_POINT *dp) +{ + X509_NAME *iname = NULL; + size_t i; + if (dp->reasons) { + if (dp->reasons->length > 0) + dp->dp_reasons = dp->reasons->data[0]; + if (dp->reasons->length > 1) + dp->dp_reasons |= (dp->reasons->data[1] << 8); + dp->dp_reasons &= CRLDP_ALL_REASONS; + } else + dp->dp_reasons = CRLDP_ALL_REASONS; + if (!dp->distpoint || (dp->distpoint->type != 1)) + return; + for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) { + GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i); + if (gen->type == GEN_DIRNAME) { + iname = gen->d.directoryName; + break; + } + } + if (!iname) + iname = X509_get_issuer_name(x); + + DIST_POINT_set_dpname(dp->distpoint, iname); + +} + +static void setup_crldp(X509 *x) +{ + size_t i; + x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL); + for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) + setup_dp(x, sk_DIST_POINT_value(x->crldp, i)); +} + +static void x509v3_cache_extensions(X509 *x) +{ + BASIC_CONSTRAINTS *bs; + PROXY_CERT_INFO_EXTENSION *pci; + ASN1_BIT_STRING *usage; + ASN1_BIT_STRING *ns; + EXTENDED_KEY_USAGE *extusage; + X509_EXTENSION *ex; + size_t i; + int j; + + CRYPTO_MUTEX_lock_read(&x->lock); + const int is_set = x->ex_flags & EXFLAG_SET; + CRYPTO_MUTEX_unlock_read(&x->lock); + + if (is_set) { + return; + } + + CRYPTO_MUTEX_lock_write(&x->lock); + if (x->ex_flags & EXFLAG_SET) { + CRYPTO_MUTEX_unlock_write(&x->lock); + return; + } + + X509_digest(x, EVP_sha1(), x->sha1_hash, NULL); + /* V1 should mean no extensions ... */ + if (!X509_get_version(x)) + x->ex_flags |= EXFLAG_V1; + /* Handle basic constraints */ + if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) { + if (bs->ca) + x->ex_flags |= EXFLAG_CA; + if (bs->pathlen) { + if ((bs->pathlen->type == V_ASN1_NEG_INTEGER) + || !bs->ca) { + x->ex_flags |= EXFLAG_INVALID; + x->ex_pathlen = 0; + } else + x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen); + } else + x->ex_pathlen = -1; + BASIC_CONSTRAINTS_free(bs); + x->ex_flags |= EXFLAG_BCONS; + } + /* Handle proxy certificates */ + if ((pci = X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) { + if (x->ex_flags & EXFLAG_CA + || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0 + || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) { + x->ex_flags |= EXFLAG_INVALID; + } + if (pci->pcPathLengthConstraint) { + x->ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint); + } else + x->ex_pcpathlen = -1; + PROXY_CERT_INFO_EXTENSION_free(pci); + x->ex_flags |= EXFLAG_PROXY; + } + /* Handle key usage */ + if ((usage = X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) { + if (usage->length > 0) { + x->ex_kusage = usage->data[0]; + if (usage->length > 1) + x->ex_kusage |= usage->data[1] << 8; + } else + x->ex_kusage = 0; + x->ex_flags |= EXFLAG_KUSAGE; + ASN1_BIT_STRING_free(usage); + } + x->ex_xkusage = 0; + if ((extusage = X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) { + x->ex_flags |= EXFLAG_XKUSAGE; + for (i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) { + switch (OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage, i))) { + case NID_server_auth: + x->ex_xkusage |= XKU_SSL_SERVER; + break; + + case NID_client_auth: + x->ex_xkusage |= XKU_SSL_CLIENT; + break; + + case NID_email_protect: + x->ex_xkusage |= XKU_SMIME; + break; + + case NID_code_sign: + x->ex_xkusage |= XKU_CODE_SIGN; + break; + + case NID_ms_sgc: + case NID_ns_sgc: + x->ex_xkusage |= XKU_SGC; + break; + + case NID_OCSP_sign: + x->ex_xkusage |= XKU_OCSP_SIGN; + break; + + case NID_time_stamp: + x->ex_xkusage |= XKU_TIMESTAMP; + break; + + case NID_dvcs: + x->ex_xkusage |= XKU_DVCS; + break; + + case NID_anyExtendedKeyUsage: + x->ex_xkusage |= XKU_ANYEKU; + break; + } + } + sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); + } + + if ((ns = X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) { + if (ns->length > 0) + x->ex_nscert = ns->data[0]; + else + x->ex_nscert = 0; + x->ex_flags |= EXFLAG_NSCERT; + ASN1_BIT_STRING_free(ns); + } + x->skid = X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL); + x->akid = X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL); + /* Does subject name match issuer ? */ + if (!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) { + x->ex_flags |= EXFLAG_SI; + /* If SKID matches AKID also indicate self signed */ + if (X509_check_akid(x, x->akid) == X509_V_OK && + !ku_reject(x, KU_KEY_CERT_SIGN)) + x->ex_flags |= EXFLAG_SS; + } + x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + x->nc = X509_get_ext_d2i(x, NID_name_constraints, &j, NULL); + if (!x->nc && (j != -1)) + x->ex_flags |= EXFLAG_INVALID; + setup_crldp(x); + + for (j = 0; j < X509_get_ext_count(x); j++) { + ex = X509_get_ext(x, j); + if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) + == NID_freshest_crl) + x->ex_flags |= EXFLAG_FRESHEST; + if (!X509_EXTENSION_get_critical(ex)) + continue; + if (!X509_supported_extension(ex)) { + x->ex_flags |= EXFLAG_CRITICAL; + break; + } + } + x->ex_flags |= EXFLAG_SET; + + CRYPTO_MUTEX_unlock_write(&x->lock); +} + +/* 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; + /* 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) +{ + x509v3_cache_extensions(x); + return check_ca(x); +} + +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_ca(x); + /* We need to do digital signatures or key agreement */ + if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_KEY_AGREEMENT)) + return 0; + /* nsCertType if present should allow SSL client use */ + if (ns_reject(x, NS_SSL_CLIENT)) + return 0; + return 1; +} + +/* + * Key usage needed for TLS/SSL server: digital signature, encipherment or + * key agreement. The ssl code can check this more thoroughly for individual + * key types. + */ +#define KU_TLS \ + (KU_DIGITAL_SIGNATURE|KU_KEY_ENCIPHERMENT|KU_KEY_AGREEMENT) + +static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + if (xku_reject(x, XKU_SSL_SERVER)) + return 0; + if (ca) + return check_ca(x); + + if (ns_reject(x, NS_SSL_SERVER)) + return 0; + if (ku_reject(x, KU_TLS)) + return 0; + + return 1; + +} + +static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = check_purpose_ssl_server(xp, x, ca); + if (!ret || ca) + return ret; + /* We need to encipher or Netscape complains */ + if (ku_reject(x, KU_KEY_ENCIPHERMENT)) + return 0; + return ret; +} + +/* 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) { + /* check nsCertType if present */ + 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) { + return (x->ex_nscert & NS_SMIME) == NS_SMIME; + } + return 1; +} + +static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = purpose_smime(x, ca); + if (!ret || ca) + return ret; + if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION)) + return 0; + return ret; +} + +static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int ret; + ret = purpose_smime(x, ca); + if (!ret || ca) + return ret; + if (ku_reject(x, KU_KEY_ENCIPHERMENT)) + return 0; + return ret; +} + +static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + if (ca) { + return check_ca(x); + } + if (ku_reject(x, KU_CRL_SIGN)) + return 0; + return 1; +} + +/* + * OCSP helper: this is *not* a full OCSP check. It just checks that each CA + * is valid. Additional checks must be made on the chain. + */ + +static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca) +{ + if (ca) + return check_ca(x); + /* leaf certificate is checked in OCSP_verify() */ + return 1; +} + +static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, + int ca) +{ + int i_ext; + + /* If ca is true we must return if this is a valid CA certificate. */ + if (ca) + return check_ca(x); + + /* + * Check the optional key usage field: + * if Key Usage is present, it must be one of digitalSignature + * and/or nonRepudiation (other values are not consistent and shall + * be rejected). + */ + if ((x->ex_flags & EXFLAG_KUSAGE) + && ((x->ex_kusage & ~(KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)) || + !(x->ex_kusage & (KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)))) + return 0; + + /* Only time stamp key usage is permitted and it's required. */ + if (!(x->ex_flags & EXFLAG_XKUSAGE) || x->ex_xkusage != XKU_TIMESTAMP) + return 0; + + /* Extended Key Usage MUST be critical */ + i_ext = X509_get_ext_by_NID((X509 *)x, NID_ext_key_usage, -1); + if (i_ext >= 0) { + X509_EXTENSION *ext = X509_get_ext((X509 *)x, i_ext); + if (!X509_EXTENSION_get_critical(ext)) + return 0; + } + + return 1; +} + +static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) +{ + return 1; +} + +/* + * Various checks to see if one certificate issued the second. This can be + * used to prune a set of possible issuer certificates which have been looked + * up using some simple method such as by subject name. These are: 1. Check + * issuer_name(subject) == subject_name(issuer) 2. If akid(subject) exists + * check it matches issuer 3. If key_usage(issuer) exists check it supports + * certificate signing returns 0 for OK, positive for reason for mismatch, + * reasons match codes for X509_verify_cert() + */ + +int X509_check_issued(X509 *issuer, X509 *subject) +{ + if (X509_NAME_cmp(X509_get_subject_name(issuer), + X509_get_issuer_name(subject))) + return X509_V_ERR_SUBJECT_ISSUER_MISMATCH; + x509v3_cache_extensions(issuer); + x509v3_cache_extensions(subject); + + if (subject->akid) { + int ret = X509_check_akid(issuer, subject->akid); + if (ret != X509_V_OK) + return ret; + } + + if (subject->ex_flags & EXFLAG_PROXY) { + if (ku_reject(issuer, KU_DIGITAL_SIGNATURE)) + return X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE; + } else if (ku_reject(issuer, KU_KEY_CERT_SIGN)) + return X509_V_ERR_KEYUSAGE_NO_CERTSIGN; + return X509_V_OK; +} + +int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) +{ + + if (!akid) + return X509_V_OK; + + /* Check key ids (if present) */ + if (akid->keyid && issuer->skid && + ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid)) + return X509_V_ERR_AKID_SKID_MISMATCH; + /* Check serial number */ + if (akid->serial && + ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial)) + return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; + /* Check issuer name */ + if (akid->issuer) { + /* + * Ugh, for some peculiar reason AKID includes SEQUENCE OF + * GeneralName. So look for a DirName. There may be more than one but + * we only take any notice of the first. + */ + GENERAL_NAMES *gens; + GENERAL_NAME *gen; + X509_NAME *nm = NULL; + size_t i; + gens = akid->issuer; + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + gen = sk_GENERAL_NAME_value(gens, i); + if (gen->type == GEN_DIRNAME) { + nm = gen->d.dirn; + break; + } + } + if (nm && X509_NAME_cmp(nm, X509_get_issuer_name(issuer))) + return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; + } + 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/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c new file mode 100644 index 0000000..ffb4198 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c @@ -0,0 +1,155 @@ +/* v3_skey.c */ +/* + * 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 "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 = { + NID_subject_key_identifier, 0, ASN1_ITEM_ref(ASN1_OCTET_STRING), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING, + (X509V3_EXT_S2I)s2i_skey_id, + 0, 0, 0, 0, + NULL +}; + +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct) +{ + return x509v3_bytes_to_hex(oct->data, oct->length); +} + +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_OCTET_STRING *oct; + long length; + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (!(oct->data = x509v3_hex_to_bytes(str, &length))) { + M_ASN1_OCTET_STRING_free(oct); + return NULL; + } + + oct->length = length; + + return oct; + +} + +static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_OCTET_STRING *oct; + ASN1_BIT_STRING *pk; + unsigned char pkey_dig[EVP_MAX_MD_SIZE]; + unsigned int diglen; + + if (strcmp(str, "hash")) + return s2i_ASN1_OCTET_STRING(method, ctx, str); + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (ctx && (ctx->flags == CTX_TEST)) + return oct; + + if (!ctx || (!ctx->subject_req && !ctx->subject_cert)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_PUBLIC_KEY); + goto err; + } + + if (ctx->subject_req) + pk = ctx->subject_req->req_info->pubkey->public_key; + else + pk = ctx->subject_cert->cert_info->key->public_key; + + if (!pk) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_PUBLIC_KEY); + goto err; + } + + if (!EVP_Digest + (pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL)) + goto err; + + if (!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + return oct; + + err: + M_ASN1_OCTET_STRING_free(oct); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back new file mode 100644 index 0000000..6a16e78 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back @@ -0,0 +1,155 @@ +/* v3_skey.c */ +/* + * 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 "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 = { + NID_subject_key_identifier, 0, ASN1_ITEM_ref(ASN1_OCTET_STRING), + 0, 0, 0, 0, + (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING, + (X509V3_EXT_S2I)s2i_skey_id, + 0, 0, 0, 0, + NULL +}; + +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct) +{ + return x509v3_bytes_to_hex(oct->data, oct->length); +} + +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_OCTET_STRING *oct; + long length; + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (!(oct->data = x509v3_hex_to_bytes(str, &length))) { + M_ASN1_OCTET_STRING_free(oct); + return NULL; + } + + oct->length = length; + + return oct; + +} + +static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) +{ + ASN1_OCTET_STRING *oct; + ASN1_BIT_STRING *pk; + unsigned char pkey_dig[EVP_MAX_MD_SIZE]; + unsigned int diglen; + + if (strcmp(str, "hash")) + return s2i_ASN1_OCTET_STRING(method, ctx, str); + + if (!(oct = M_ASN1_OCTET_STRING_new())) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + + if (ctx && (ctx->flags == CTX_TEST)) + return oct; + + if (!ctx || (!ctx->subject_req && !ctx->subject_cert)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_PUBLIC_KEY); + goto err; + } + + if (ctx->subject_req) + pk = ctx->subject_req->req_info->pubkey->public_key; + else + pk = ctx->subject_cert->cert_info->key->public_key; + + if (!pk) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_PUBLIC_KEY); + goto err; + } + + if (!EVP_Digest + (pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL)) + goto err; + + if (!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + + return oct; + + err: + M_ASN1_OCTET_STRING_free(oct); + return NULL; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c new file mode 100644 index 0000000..75ff4bc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c @@ -0,0 +1,274 @@ +/* v3_sxnet.c */ +/* + * 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 + +/* Support for Thawte strong extranet extension */ + +#define SXNET_TEST + +static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, + int indent); +#ifdef SXNET_TEST +static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +#endif +const X509V3_EXT_METHOD v3_sxnet = { + NID_sxnet, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(SXNET), + 0, 0, 0, 0, + 0, 0, + 0, +#ifdef SXNET_TEST + (X509V3_EXT_V2I)sxnet_v2i, +#else + 0, +#endif + (X509V3_EXT_I2R)sxnet_i2r, + 0, + NULL +}; + +ASN1_SEQUENCE(SXNETID) = { + ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER), + ASN1_SIMPLE(SXNETID, user, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(SXNETID) + +IMPLEMENT_ASN1_FUNCTIONS(SXNETID) + +ASN1_SEQUENCE(SXNET) = { + ASN1_SIMPLE(SXNET, version, ASN1_INTEGER), + ASN1_SEQUENCE_OF(SXNET, ids, SXNETID) +} ASN1_SEQUENCE_END(SXNET) + +IMPLEMENT_ASN1_FUNCTIONS(SXNET) + +static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, + int indent) +{ + long v; + char *tmp; + SXNETID *id; + size_t i; + v = ASN1_INTEGER_get(sx->version); + BIO_printf(out, "%*sVersion: %ld (0x%lX)", indent, "", v + 1, v); + for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { + id = sk_SXNETID_value(sx->ids, i); + tmp = i2s_ASN1_INTEGER(NULL, id->zone); + BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); + OPENSSL_free(tmp); + M_ASN1_OCTET_STRING_print(out, id->user); + } + return 1; +} + +#ifdef SXNET_TEST + +/* + * NBB: this is used for testing only. It should *not* be used for anything + * else because it will just take static IDs from the configuration file and + * they should really be separate values for each user. + */ + +static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + CONF_VALUE *cnf; + SXNET *sx = NULL; + size_t i; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1)) + return NULL; + } + return sx; +} + +#endif + +/* Strong Extranet utility functions */ + +/* Add an id given the zone as an ASCII number */ + +int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen) +{ + ASN1_INTEGER *izone = NULL; + if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE); + return 0; + } + return SXNET_add_id_INTEGER(psx, izone, user, userlen); +} + +/* Add an id given the zone as an unsigned long */ + +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, + int userlen) +{ + ASN1_INTEGER *izone = NULL; + if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_INTEGER_free(izone); + return 0; + } + return SXNET_add_id_INTEGER(psx, izone, user, userlen); + +} + +/* + * Add an id given the zone as an ASN1_INTEGER. Note this version uses the + * passed integer and doesn't make a copy so don't free it up afterwards. + */ + +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, + int userlen) +{ + SXNET *sx = NULL; + SXNETID *id = NULL; + if (!psx || !zone || !user) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return 0; + } + if (userlen == -1) + userlen = strlen(user); + if (userlen > 64) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_USER_TOO_LONG); + return 0; + } + if (!*psx) { + if (!(sx = SXNET_new())) + goto err; + if (!ASN1_INTEGER_set(sx->version, 0)) + goto err; + *psx = sx; + } else + sx = *psx; + if (SXNET_get_id_INTEGER(sx, zone)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DUPLICATE_ZONE_ID); + return 0; + } + + if (!(id = SXNETID_new())) + goto err; + if (userlen == -1) + userlen = strlen(user); + + if (!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) + goto err; + if (!sk_SXNETID_push(sx->ids, id)) + goto err; + id->zone = zone; + return 1; + + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + SXNETID_free(id); + SXNET_free(sx); + *psx = NULL; + return 0; +} + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone) +{ + ASN1_INTEGER *izone = NULL; + ASN1_OCTET_STRING *oct; + if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE); + return NULL; + } + oct = SXNET_get_id_INTEGER(sx, izone); + M_ASN1_INTEGER_free(izone); + return oct; +} + +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone) +{ + ASN1_INTEGER *izone = NULL; + ASN1_OCTET_STRING *oct; + if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_INTEGER_free(izone); + return NULL; + } + oct = SXNET_get_id_INTEGER(sx, izone); + M_ASN1_INTEGER_free(izone); + return oct; +} + +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone) +{ + SXNETID *id; + size_t i; + for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { + id = sk_SXNETID_value(sx->ids, i); + if (!M_ASN1_INTEGER_cmp(id->zone, zone)) + return id->user; + } + return NULL; +} + +IMPLEMENT_ASN1_SET_OF(SXNETID) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c.grpc_back new file mode 100644 index 0000000..51c5a67 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c.grpc_back @@ -0,0 +1,274 @@ +/* v3_sxnet.c */ +/* + * 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 + +/* Support for Thawte strong extranet extension */ + +#define SXNET_TEST + +static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, + int indent); +#ifdef SXNET_TEST +static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +#endif +const X509V3_EXT_METHOD v3_sxnet = { + NID_sxnet, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(SXNET), + 0, 0, 0, 0, + 0, 0, + 0, +#ifdef SXNET_TEST + (X509V3_EXT_V2I)sxnet_v2i, +#else + 0, +#endif + (X509V3_EXT_I2R)sxnet_i2r, + 0, + NULL +}; + +ASN1_SEQUENCE(SXNETID) = { + ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER), + ASN1_SIMPLE(SXNETID, user, ASN1_OCTET_STRING) +} ASN1_SEQUENCE_END(SXNETID) + +IMPLEMENT_ASN1_FUNCTIONS(SXNETID) + +ASN1_SEQUENCE(SXNET) = { + ASN1_SIMPLE(SXNET, version, ASN1_INTEGER), + ASN1_SEQUENCE_OF(SXNET, ids, SXNETID) +} ASN1_SEQUENCE_END(SXNET) + +IMPLEMENT_ASN1_FUNCTIONS(SXNET) + +static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, + int indent) +{ + long v; + char *tmp; + SXNETID *id; + size_t i; + v = ASN1_INTEGER_get(sx->version); + BIO_printf(out, "%*sVersion: %ld (0x%lX)", indent, "", v + 1, v); + for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { + id = sk_SXNETID_value(sx->ids, i); + tmp = i2s_ASN1_INTEGER(NULL, id->zone); + BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); + OPENSSL_free(tmp); + M_ASN1_OCTET_STRING_print(out, id->user); + } + return 1; +} + +#ifdef SXNET_TEST + +/* + * NBB: this is used for testing only. It should *not* be used for anything + * else because it will just take static IDs from the configuration file and + * they should really be separate values for each user. + */ + +static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval) +{ + CONF_VALUE *cnf; + SXNET *sx = NULL; + size_t i; + for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { + cnf = sk_CONF_VALUE_value(nval, i); + if (!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1)) + return NULL; + } + return sx; +} + +#endif + +/* Strong Extranet utility functions */ + +/* Add an id given the zone as an ASCII number */ + +int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen) +{ + ASN1_INTEGER *izone = NULL; + if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE); + return 0; + } + return SXNET_add_id_INTEGER(psx, izone, user, userlen); +} + +/* Add an id given the zone as an unsigned long */ + +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, + int userlen) +{ + ASN1_INTEGER *izone = NULL; + if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_INTEGER_free(izone); + return 0; + } + return SXNET_add_id_INTEGER(psx, izone, user, userlen); + +} + +/* + * Add an id given the zone as an ASN1_INTEGER. Note this version uses the + * passed integer and doesn't make a copy so don't free it up afterwards. + */ + +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, + int userlen) +{ + SXNET *sx = NULL; + SXNETID *id = NULL; + if (!psx || !zone || !user) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return 0; + } + if (userlen == -1) + userlen = strlen(user); + if (userlen > 64) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_USER_TOO_LONG); + return 0; + } + if (!*psx) { + if (!(sx = SXNET_new())) + goto err; + if (!ASN1_INTEGER_set(sx->version, 0)) + goto err; + *psx = sx; + } else + sx = *psx; + if (SXNET_get_id_INTEGER(sx, zone)) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_DUPLICATE_ZONE_ID); + return 0; + } + + if (!(id = SXNETID_new())) + goto err; + if (userlen == -1) + userlen = strlen(user); + + if (!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) + goto err; + if (!sk_SXNETID_push(sx->ids, id)) + goto err; + id->zone = zone; + return 1; + + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + SXNETID_free(id); + SXNET_free(sx); + *psx = NULL; + return 0; +} + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone) +{ + ASN1_INTEGER *izone = NULL; + ASN1_OCTET_STRING *oct; + if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE); + return NULL; + } + oct = SXNET_get_id_INTEGER(sx, izone); + M_ASN1_INTEGER_free(izone); + return oct; +} + +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone) +{ + ASN1_INTEGER *izone = NULL; + ASN1_OCTET_STRING *oct; + if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + M_ASN1_INTEGER_free(izone); + return NULL; + } + oct = SXNET_get_id_INTEGER(sx, izone); + M_ASN1_INTEGER_free(izone); + return oct; +} + +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone) +{ + SXNETID *id; + size_t i; + for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { + id = sk_SXNETID_value(sx->ids, i); + if (!M_ASN1_INTEGER_cmp(id->zone, zone)) + return id->user; + } + return NULL; +} + +IMPLEMENT_ASN1_SET_OF(SXNETID) diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c new file mode 100644 index 0000000..3f8a00c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c @@ -0,0 +1,1395 @@ +/* v3_utl.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 1999-2003 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). + * + */ +/* X509 v3 extension utilities */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../conf/internal.h" +#include "../internal.h" +#include "internal.h" + + +static char *strip_spaces(char *name); +static int sk_strcmp(const OPENSSL_STRING *a, const OPENSSL_STRING *b); +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, + GENERAL_NAMES *gens); +static void str_free(OPENSSL_STRING str); +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); + +static int ipv4_from_asc(unsigned char *v4, const char *in); +static int ipv6_from_asc(unsigned char *v6, const char *in); +static int ipv6_cb(const char *elem, int len, void *usr); +static int ipv6_hex(unsigned char *out, const char *in, int inlen); + +/* Add a CONF_VALUE name value pair to stack */ + +int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist) +{ + CONF_VALUE *vtmp = NULL; + char *tname = NULL, *tvalue = NULL; + if (name && !(tname = OPENSSL_strdup(name))) + goto err; + if (value && !(tvalue = OPENSSL_strdup(value))) + goto err; + if (!(vtmp = CONF_VALUE_new())) + goto err; + if (!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) + goto err; + vtmp->section = NULL; + vtmp->name = tname; + vtmp->value = tvalue; + if (!sk_CONF_VALUE_push(*extlist, vtmp)) + goto err; + return 1; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + if (vtmp) + OPENSSL_free(vtmp); + if (tname) + OPENSSL_free(tname); + if (tvalue) + OPENSSL_free(tvalue); + return 0; +} + +int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist) +{ + return X509V3_add_value(name, (const char *)value, extlist); +} + +/* Free function for STACK_OF(CONF_VALUE) */ + +void X509V3_conf_free(CONF_VALUE *conf) +{ + if (!conf) + return; + if (conf->name) + OPENSSL_free(conf->name); + if (conf->value) + OPENSSL_free(conf->value); + if (conf->section) + OPENSSL_free(conf->section); + OPENSSL_free(conf); +} + +int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist) +{ + if (asn1_bool) + return X509V3_add_value(name, "TRUE", extlist); + return X509V3_add_value(name, "FALSE", extlist); +} + +int X509V3_add_value_bool_nf(char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist) +{ + if (asn1_bool) + return X509V3_add_value(name, "TRUE", extlist); + return 1; +} + +static char *bignum_to_string(const BIGNUM *bn) +{ + char *tmp, *ret; + size_t len; + + /* + * Display large numbers in hex and small numbers in decimal. Converting to + * decimal takes quadratic time and is no more useful than hex for large + * numbers. + */ + if (BN_num_bits(bn) < 32) { + return BN_bn2dec(bn); + } + + tmp = BN_bn2hex(bn); + if (tmp == NULL) { + return NULL; + } + + len = strlen(tmp) + 3; + ret = OPENSSL_malloc(len); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + OPENSSL_free(tmp); + return NULL; + } + + /* Prepend "0x", but place it after the "-" if negative. */ + if (tmp[0] == '-') { + OPENSSL_strlcpy(ret, "-0x", len); + OPENSSL_strlcat(ret, tmp + 1, len); + } else { + OPENSSL_strlcpy(ret, "0x", len); + OPENSSL_strlcat(ret, tmp, len); + } + OPENSSL_free(tmp); + return ret; +} + +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a) +{ + BIGNUM *bntmp = NULL; + char *strtmp = NULL; + if (!a) + return NULL; + if (!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) || + !(strtmp = bignum_to_string(bntmp))) + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + BN_free(bntmp); + return strtmp; +} + +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) +{ + BIGNUM *bntmp = NULL; + char *strtmp = NULL; + if (!a) + return NULL; + if (!(bntmp = ASN1_INTEGER_to_BN(a, NULL)) || + !(strtmp = bignum_to_string(bntmp))) + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + BN_free(bntmp); + return strtmp; +} + +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) +{ + BIGNUM *bn = NULL; + ASN1_INTEGER *aint; + int isneg, ishex; + int ret; + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + return 0; + } + bn = BN_new(); + if (value[0] == '-') { + value++; + isneg = 1; + } else + isneg = 0; + + if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) { + value += 2; + ishex = 1; + } else + ishex = 0; + + if (ishex) + ret = BN_hex2bn(&bn, value); + else + ret = BN_dec2bn(&bn, value); + + if (!ret || value[ret]) { + BN_free(bn); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BN_DEC2BN_ERROR); + return 0; + } + + if (isneg && BN_is_zero(bn)) + isneg = 0; + + aint = BN_to_ASN1_INTEGER(bn, NULL); + BN_free(bn); + if (!aint) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR); + return 0; + } + if (isneg) + aint->type |= V_ASN1_NEG; + return aint; +} + +int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist) +{ + char *strtmp; + int ret; + if (!aint) + return 1; + if (!(strtmp = i2s_ASN1_INTEGER(NULL, aint))) + return 0; + ret = X509V3_add_value(name, strtmp, extlist); + OPENSSL_free(strtmp); + return ret; +} + +int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool) +{ + char *btmp; + if (!(btmp = value->value)) + goto err; + if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true") + || !strcmp(btmp, "Y") || !strcmp(btmp, "y") + || !strcmp(btmp, "YES") || !strcmp(btmp, "yes")) { + *asn1_bool = 0xff; + return 1; + } else if (!strcmp(btmp, "FALSE") || !strcmp(btmp, "false") + || !strcmp(btmp, "N") || !strcmp(btmp, "n") + || !strcmp(btmp, "NO") || !strcmp(btmp, "no")) { + *asn1_bool = 0; + return 1; + } + err: + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_BOOLEAN_STRING); + X509V3_conf_err(value); + return 0; +} + +int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint) +{ + ASN1_INTEGER *itmp; + if (!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) { + X509V3_conf_err(value); + return 0; + } + *aint = itmp; + return 1; +} + +#define HDR_NAME 1 +#define HDR_VALUE 2 + +/* + * #define DEBUG + */ + +STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line) +{ + char *p, *q, c; + char *ntmp, *vtmp; + STACK_OF(CONF_VALUE) *values = NULL; + char *linebuf; + int state; + /* We are going to modify the line so copy it first */ + linebuf = OPENSSL_strdup(line); + if (linebuf == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + state = HDR_NAME; + ntmp = NULL; + /* Go through all characters */ + for (p = linebuf, q = linebuf; (c = *p) && (c != '\r') && (c != '\n'); + p++) { + + switch (state) { + case HDR_NAME: + if (c == ':') { + state = HDR_VALUE; + *p = 0; + ntmp = strip_spaces(q); + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + q = p + 1; + } else if (c == ',') { + *p = 0; + ntmp = strip_spaces(q); + q = p + 1; +#if 0 + printf("%s\n", ntmp); +#endif + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + X509V3_add_value(ntmp, NULL, &values); + } + break; + + case HDR_VALUE: + if (c == ',') { + state = HDR_NAME; + *p = 0; + vtmp = strip_spaces(q); +#if 0 + printf("%s\n", ntmp); +#endif + if (!vtmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + goto err; + } + X509V3_add_value(ntmp, vtmp, &values); + ntmp = NULL; + q = p + 1; + } + + } + } + + if (state == HDR_VALUE) { + vtmp = strip_spaces(q); +#if 0 + printf("%s=%s\n", ntmp, vtmp); +#endif + if (!vtmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + goto err; + } + X509V3_add_value(ntmp, vtmp, &values); + } else { + ntmp = strip_spaces(q); +#if 0 + printf("%s\n", ntmp); +#endif + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + X509V3_add_value(ntmp, NULL, &values); + } + OPENSSL_free(linebuf); + return values; + + err: + OPENSSL_free(linebuf); + sk_CONF_VALUE_pop_free(values, X509V3_conf_free); + return NULL; + +} + +/* Delete leading and trailing spaces from a string */ +static char *strip_spaces(char *name) +{ + char *p, *q; + /* Skip over leading spaces */ + p = name; + while (*p && isspace((unsigned char)*p)) + p++; + if (!*p) + return NULL; + q = p + strlen(p) - 1; + while ((q != p) && isspace((unsigned char)*q)) + q--; + if (p != q) + q[1] = 0; + if (!*p) + return NULL; + return p; +} + +/* hex string utilities */ + +/* + * Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its + * hex representation @@@ (Contents of buffer are always kept in ASCII, also + * on EBCDIC machines) + */ + +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len) +{ + char *tmp, *q; + const unsigned char *p; + int i; + static const char hexdig[] = "0123456789ABCDEF"; + if (!buffer || !len) + return NULL; + if (!(tmp = OPENSSL_malloc(len * 3 + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + q = tmp; + for (i = 0, p = buffer; i < len; i++, p++) { + *q++ = hexdig[(*p >> 4) & 0xf]; + *q++ = hexdig[*p & 0xf]; + *q++ = ':'; + } + q[-1] = 0; + + return tmp; +} + +unsigned char *x509v3_hex_to_bytes(const char *str, long *len) +{ + unsigned char *hexbuf, *q; + unsigned char ch, cl, *p; + if (!str) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return NULL; + } + if (!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) + goto err; + for (p = (unsigned char *)str, q = hexbuf; *p;) { + ch = *p++; + if (ch == ':') + continue; + cl = *p++; + if (!cl) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ODD_NUMBER_OF_DIGITS); + OPENSSL_free(hexbuf); + return NULL; + } + + if ((ch >= '0') && (ch <= '9')) + ch -= '0'; + else if ((ch >= 'a') && (ch <= 'f')) + ch -= 'a' - 10; + else if ((ch >= 'A') && (ch <= 'F')) + ch -= 'A' - 10; + else + goto badhex; + + if ((cl >= '0') && (cl <= '9')) + cl -= '0'; + else if ((cl >= 'a') && (cl <= 'f')) + cl -= 'a' - 10; + else if ((cl >= 'A') && (cl <= 'F')) + cl -= 'A' - 10; + else + goto badhex; + + *q++ = (ch << 4) | cl; + } + + if (len) + *len = q - hexbuf; + + return hexbuf; + + err: + if (hexbuf) + OPENSSL_free(hexbuf); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + + badhex: + OPENSSL_free(hexbuf); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); + return NULL; + +} + +int x509v3_name_cmp(const char *name, const char *cmp) +{ + int len, ret; + char c; + len = strlen(cmp); + if ((ret = strncmp(name, cmp, len))) + return ret; + c = name[len]; + if (!c || (c == '.')) + return 0; + return 1; +} + +static int sk_strcmp(const OPENSSL_STRING *a, const OPENSSL_STRING *b) +{ + return strcmp(*a, *b); +} + +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) +{ + GENERAL_NAMES *gens; + STACK_OF(OPENSSL_STRING) *ret; + + gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + ret = get_email(X509_get_subject_name(x), gens); + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return ret; +} + +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) +{ + AUTHORITY_INFO_ACCESS *info; + STACK_OF(OPENSSL_STRING) *ret = NULL; + size_t i; + + info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); + if (!info) + return NULL; + for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) { + ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i); + if (OBJ_obj2nid(ad->method) == NID_ad_OCSP) { + if (ad->location->type == GEN_URI) { + if (!append_ia5 + (&ret, ad->location->d.uniformResourceIdentifier)) + break; + } + } + } + AUTHORITY_INFO_ACCESS_free(info); + return ret; +} + +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) +{ + GENERAL_NAMES *gens; + STACK_OF(X509_EXTENSION) *exts; + STACK_OF(OPENSSL_STRING) *ret; + + exts = X509_REQ_get_extensions(x); + gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); + ret = get_email(X509_REQ_get_subject_name(x), gens); + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); + return ret; +} + +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, + GENERAL_NAMES *gens) +{ + STACK_OF(OPENSSL_STRING) *ret = NULL; + X509_NAME_ENTRY *ne; + ASN1_IA5STRING *email; + GENERAL_NAME *gen; + int i; + size_t j; + /* Now add any email address(es) to STACK */ + i = -1; + /* First supplied X509_NAME */ + while ((i = X509_NAME_get_index_by_NID(name, + NID_pkcs9_emailAddress, i)) >= 0) { + ne = X509_NAME_get_entry(name, i); + email = X509_NAME_ENTRY_get_data(ne); + if (!append_ia5(&ret, email)) + return NULL; + } + for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) { + gen = sk_GENERAL_NAME_value(gens, j); + if (gen->type != GEN_EMAIL) + continue; + if (!append_ia5(&ret, gen->d.ia5)) + return NULL; + } + return ret; +} + +static void str_free(OPENSSL_STRING str) +{ + OPENSSL_free(str); +} + +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) +{ + char *emtmp; + /* First some sanity checks */ + if (email->type != V_ASN1_IA5STRING) + return 1; + if (!email->data || !email->length) + return 1; + if (!*sk) + *sk = sk_OPENSSL_STRING_new(sk_strcmp); + 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 = OPENSSL_strdup((char *)email->data); + if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { + X509_email_free(*sk); + *sk = NULL; + return 0; + } + return 1; +} + +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) +{ + sk_OPENSSL_STRING_pop_free(sk, str_free); +} + +typedef int (*equal_fn) (const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags); + +/* Skip pattern prefix to match "wildcard" subject */ +static void skip_prefix(const unsigned char **p, size_t *plen, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *pattern = *p; + size_t pattern_len = *plen; + + /* + * If subject starts with a leading '.' followed by more octets, and + * pattern is longer, compare just an equal-length suffix with the + * full subject (starting at the '.'), provided the prefix contains + * no NULs. + */ + if ((flags & _X509_CHECK_FLAG_DOT_SUBDOMAINS) == 0) + return; + + while (pattern_len > subject_len && *pattern) { + if ((flags & X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS) && + *pattern == '.') + break; + ++pattern; + --pattern_len; + } + + /* Skip if entire prefix acceptable */ + if (pattern_len == subject_len) { + *p = pattern; + *plen = pattern_len; + } +} + +/* Compare while ASCII ignoring case. */ +static int equal_nocase(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); + if (pattern_len != subject_len) + return 0; + while (pattern_len) { + unsigned char l = *pattern; + unsigned char r = *subject; + /* The pattern must not contain NUL characters. */ + if (l == 0) + return 0; + if (l != r) { + if ('A' <= l && l <= 'Z') + l = (l - 'A') + 'a'; + if ('A' <= r && r <= 'Z') + r = (r - 'A') + 'a'; + if (l != r) + return 0; + } + ++pattern; + ++subject; + --pattern_len; + } + return 1; +} + +/* Compare using OPENSSL_memcmp. */ +static int equal_case(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); + if (pattern_len != subject_len) + return 0; + return !OPENSSL_memcmp(pattern, subject, pattern_len); +} + +/* + * RFC 5280, section 7.5, requires that only the domain is compared in a + * case-insensitive manner. + */ +static int equal_email(const unsigned char *a, size_t a_len, + const unsigned char *b, size_t b_len, + unsigned int unused_flags) +{ + size_t i = a_len; + if (a_len != b_len) + return 0; + /* + * We search backwards for the '@' character, so that we do not have to + * deal with quoted local-parts. The domain part is compared in a + * case-insensitive manner. + */ + while (i > 0) { + --i; + if (a[i] == '@' || b[i] == '@') { + if (!equal_nocase(a + i, a_len - i, b + i, a_len - i, 0)) + return 0; + break; + } + } + if (i == 0) + i = a_len; + return equal_case(a, i, b, i, 0); +} + +/* + * Compare the prefix and suffix with the subject, and check that the + * characters in-between are valid. + */ +static int wildcard_match(const unsigned char *prefix, size_t prefix_len, + const unsigned char *suffix, size_t suffix_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *wildcard_start; + const unsigned char *wildcard_end; + const unsigned char *p; + int allow_multi = 0; + int allow_idna = 0; + + if (subject_len < prefix_len + suffix_len) + return 0; + if (!equal_nocase(prefix, prefix_len, subject, prefix_len, flags)) + return 0; + wildcard_start = subject + prefix_len; + wildcard_end = subject + (subject_len - suffix_len); + if (!equal_nocase(wildcard_end, suffix_len, suffix, suffix_len, flags)) + return 0; + /* + * If the wildcard makes up the entire first label, it must match at + * least one character. + */ + if (prefix_len == 0 && *suffix == '.') { + if (wildcard_start == wildcard_end) + return 0; + allow_idna = 1; + if (flags & X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS) + allow_multi = 1; + } + /* IDNA labels cannot match partial wildcards */ + if (!allow_idna && + subject_len >= 4 + && OPENSSL_strncasecmp((char *)subject, "xn--", 4) == 0) + return 0; + /* The wildcard may match a literal '*' */ + if (wildcard_end == wildcard_start + 1 && *wildcard_start == '*') + return 1; + /* + * Check that the part matched by the wildcard contains only + * permitted characters and only matches a single label unless + * allow_multi is set. + */ + for (p = wildcard_start; p != wildcard_end; ++p) + if (!(('0' <= *p && *p <= '9') || + ('A' <= *p && *p <= 'Z') || + ('a' <= *p && *p <= 'z') || + *p == '-' || (allow_multi && *p == '.'))) + return 0; + return 1; +} + +#define LABEL_START (1 << 0) +#define LABEL_END (1 << 1) +#define LABEL_HYPHEN (1 << 2) +#define LABEL_IDNA (1 << 3) + +static const unsigned char *valid_star(const unsigned char *p, size_t len, + unsigned int flags) +{ + const unsigned char *star = 0; + size_t i; + int state = LABEL_START; + int dots = 0; + for (i = 0; i < len; ++i) { + /* + * Locate first and only legal wildcard, either at the start + * or end of a non-IDNA first and not final label. + */ + if (p[i] == '*') { + int atstart = (state & LABEL_START); + int atend = (i == len - 1 || p[i + 1] == '.'); + /* + * At most one wildcard per pattern. + * No wildcards in IDNA labels. + * No wildcards after the first label. + */ + if (star != NULL || (state & LABEL_IDNA) != 0 || dots) + return NULL; + /* Only full-label '*.example.com' wildcards? */ + if ((flags & X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS) + && (!atstart || !atend)) + return NULL; + /* No 'foo*bar' wildcards */ + if (!atstart && !atend) + return NULL; + star = &p[i]; + state &= ~LABEL_START; + } else if (('a' <= p[i] && p[i] <= 'z') + || ('A' <= p[i] && p[i] <= 'Z') + || ('0' <= p[i] && p[i] <= '9')) { + if ((state & LABEL_START) != 0 + && len - i >= 4 + && OPENSSL_strncasecmp((char *)&p[i], "xn--", 4) == 0) + state |= LABEL_IDNA; + state &= ~(LABEL_HYPHEN | LABEL_START); + } else if (p[i] == '.') { + if ((state & (LABEL_HYPHEN | LABEL_START)) != 0) + return NULL; + state = LABEL_START; + ++dots; + } else if (p[i] == '-') { + /* no domain/subdomain starts with '-' */ + if ((state & LABEL_START) != 0) + return NULL; + state |= LABEL_HYPHEN; + } else + return NULL; + } + + /* + * The final label must not end in a hyphen or ".", and + * there must be at least two dots after the star. + */ + if ((state & (LABEL_START | LABEL_HYPHEN)) != 0 || dots < 2) + return NULL; + return star; +} + +/* Compare using wildcards. */ +static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *star = NULL; + + /* + * Subject names starting with '.' can only match a wildcard pattern + * via a subject sub-domain pattern suffix match. + */ + if (!(subject_len > 1 && subject[0] == '.')) + star = valid_star(pattern, pattern_len, flags); + if (star == NULL) + return equal_nocase(pattern, pattern_len, + subject, subject_len, flags); + return wildcard_match(pattern, star - pattern, + star + 1, (pattern + pattern_len) - star - 1, + 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 + * to UTF8. + */ + +static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, + unsigned int flags, int check_type, const char *b, + size_t blen, char **peername) +{ + int rv = 0; + + if (!a->data || !a->length) + return 0; + if (cmp_type > 0) { + if (cmp_type != a->type) + return 0; + if (cmp_type == V_ASN1_IA5STRING) + rv = equal(a->data, a->length, (unsigned char *)b, blen, flags); + else if (a->length == (int)blen && !OPENSSL_memcmp(a->data, b, blen)) + rv = 1; + if (rv > 0 && peername) + *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; + /* + * 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 = OPENSSL_strndup((char *)astr, astrlen); + OPENSSL_free(astr); + } + return rv; +} + +static int do_x509_check(X509 *x, const char *chk, size_t chklen, + unsigned int flags, int check_type, char **peername) +{ + GENERAL_NAMES *gens = NULL; + X509_NAME *name = NULL; + size_t i; + int j; + int cnid = NID_undef; + int alt_type; + int rv = 0; + equal_fn equal; + + /* See below, this flag is internal-only */ + flags &= ~_X509_CHECK_FLAG_DOT_SUBDOMAINS; + if (check_type == GEN_EMAIL) { + cnid = NID_pkcs9_emailAddress; + alt_type = V_ASN1_IA5STRING; + equal = equal_email; + } else if (check_type == GEN_DNS) { + cnid = NID_commonName; + /* Implicit client-side DNS sub-domain pattern */ + if (chklen > 1 && chk[0] == '.') + flags |= _X509_CHECK_FLAG_DOT_SUBDOMAINS; + alt_type = V_ASN1_IA5STRING; + if (flags & X509_CHECK_FLAG_NO_WILDCARDS) + equal = equal_nocase; + else + equal = equal_wildcard; + } else { + alt_type = V_ASN1_OCTET_STRING; + equal = equal_case; + } + + gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + if (gens) { + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + GENERAL_NAME *gen; + ASN1_STRING *cstr; + gen = sk_GENERAL_NAME_value(gens, i); + if (gen->type != check_type) + continue; + if (check_type == GEN_EMAIL) + cstr = gen->d.rfc822Name; + else if (check_type == GEN_DNS) + cstr = gen->d.dNSName; + else + cstr = gen->d.iPAddress; + /* Positive on success, negative on error! */ + if ((rv = do_check_string(cstr, alt_type, equal, flags, check_type, + chk, chklen, peername)) != 0) + break; + } + GENERAL_NAMES_free(gens); + return rv; + } + + /* We're done if CN-ID is not pertinent */ + if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT)) + return 0; + + j = -1; + name = X509_get_subject_name(x); + while ((j = X509_NAME_get_index_by_NID(name, cnid, j)) >= 0) { + X509_NAME_ENTRY *ne; + ASN1_STRING *str; + 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, check_type, + chk, chklen, peername)) != 0) + return rv; + } + return 0; +} + +int X509_check_host(X509 *x, const char *chk, size_t chklen, + unsigned int flags, char **peername) +{ + if (chk == NULL) + return -2; + if (OPENSSL_memchr(chk, '\0', chklen)) + return -2; + return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername); +} + +int X509_check_email(X509 *x, const char *chk, size_t chklen, + unsigned int flags) +{ + if (chk == NULL) + return -2; + if (OPENSSL_memchr(chk, '\0', chklen)) + return -2; + return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL); +} + +int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, + unsigned int flags) +{ + if (chk == NULL) + return -2; + return do_x509_check(x, (char *)chk, chklen, flags, GEN_IPADD, NULL); +} + +int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags) +{ + unsigned char ipout[16]; + size_t iplen; + + if (ipasc == NULL) + return -2; + iplen = (size_t)a2i_ipadd(ipout, ipasc); + if (iplen == 0) + return -2; + return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL); +} + +/* + * Convert IP addresses both IPv4 and IPv6 into an OCTET STRING compatible + * with RFC3280. + */ + +ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc) +{ + unsigned char ipout[16]; + ASN1_OCTET_STRING *ret; + int iplen; + + /* If string contains a ':' assume IPv6 */ + + iplen = a2i_ipadd(ipout, ipasc); + + if (!iplen) + return NULL; + + ret = ASN1_OCTET_STRING_new(); + if (!ret) + return NULL; + if (!ASN1_OCTET_STRING_set(ret, ipout, iplen)) { + ASN1_OCTET_STRING_free(ret); + return NULL; + } + return ret; +} + +ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) +{ + ASN1_OCTET_STRING *ret = NULL; + unsigned char ipout[32]; + char *iptmp = NULL, *p; + int iplen1, iplen2; + p = strchr(ipasc, '/'); + if (!p) + return NULL; + iptmp = OPENSSL_strdup(ipasc); + if (!iptmp) + return NULL; + p = iptmp + (p - ipasc); + *p++ = 0; + + iplen1 = a2i_ipadd(ipout, iptmp); + + if (!iplen1) + goto err; + + iplen2 = a2i_ipadd(ipout + iplen1, p); + + OPENSSL_free(iptmp); + iptmp = NULL; + + if (!iplen2 || (iplen1 != iplen2)) + goto err; + + ret = ASN1_OCTET_STRING_new(); + if (!ret) + goto err; + if (!ASN1_OCTET_STRING_set(ret, ipout, iplen1 + iplen2)) + goto err; + + return ret; + + err: + if (iptmp) + OPENSSL_free(iptmp); + if (ret) + ASN1_OCTET_STRING_free(ret); + return NULL; +} + +int a2i_ipadd(unsigned char *ipout, const char *ipasc) +{ + /* If string contains a ':' assume IPv6 */ + + if (strchr(ipasc, ':')) { + if (!ipv6_from_asc(ipout, ipasc)) + return 0; + return 16; + } else { + if (!ipv4_from_asc(ipout, ipasc)) + return 0; + return 4; + } +} + +static int ipv4_from_asc(unsigned char *v4, const char *in) +{ + int a0, a1, a2, a3; + if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4) + return 0; + if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255) + || (a2 < 0) || (a2 > 255) || (a3 < 0) || (a3 > 255)) + return 0; + v4[0] = a0; + v4[1] = a1; + v4[2] = a2; + v4[3] = a3; + return 1; +} + +typedef struct { + /* Temporary store for IPV6 output */ + unsigned char tmp[16]; + /* Total number of bytes in tmp */ + int total; + /* The position of a zero (corresponding to '::') */ + int zero_pos; + /* Number of zeroes */ + int zero_cnt; +} IPV6_STAT; + +static int ipv6_from_asc(unsigned char *v6, const char *in) +{ + IPV6_STAT v6stat; + v6stat.total = 0; + v6stat.zero_pos = -1; + v6stat.zero_cnt = 0; + /* + * Treat the IPv6 representation as a list of values separated by ':'. + * The presence of a '::' will parse as one, two or three zero length + * elements. + */ + if (!CONF_parse_list(in, ':', 0, ipv6_cb, &v6stat)) + return 0; + + /* Now for some sanity checks */ + + if (v6stat.zero_pos == -1) { + /* If no '::' must have exactly 16 bytes */ + if (v6stat.total != 16) + return 0; + } else { + /* If '::' must have less than 16 bytes */ + if (v6stat.total == 16) + return 0; + /* More than three zeroes is an error */ + if (v6stat.zero_cnt > 3) + return 0; + /* Can only have three zeroes if nothing else present */ + else if (v6stat.zero_cnt == 3) { + if (v6stat.total > 0) + return 0; + } + /* Can only have two zeroes if at start or end */ + else if (v6stat.zero_cnt == 2) { + if ((v6stat.zero_pos != 0) + && (v6stat.zero_pos != v6stat.total)) + return 0; + } else + /* Can only have one zero if *not* start or end */ + { + if ((v6stat.zero_pos == 0) + || (v6stat.zero_pos == v6stat.total)) + return 0; + } + } + + /* Format result */ + + if (v6stat.zero_pos >= 0) { + /* Copy initial part */ + OPENSSL_memcpy(v6, v6stat.tmp, v6stat.zero_pos); + /* Zero middle */ + OPENSSL_memset(v6 + v6stat.zero_pos, 0, 16 - v6stat.total); + /* Copy final part */ + if (v6stat.total != v6stat.zero_pos) + OPENSSL_memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total, + v6stat.tmp + v6stat.zero_pos, + v6stat.total - v6stat.zero_pos); + } else + OPENSSL_memcpy(v6, v6stat.tmp, 16); + + return 1; +} + +static int ipv6_cb(const char *elem, int len, void *usr) +{ + IPV6_STAT *s = usr; + /* Error if 16 bytes written */ + if (s->total == 16) + return 0; + if (len == 0) { + /* Zero length element, corresponds to '::' */ + if (s->zero_pos == -1) + s->zero_pos = s->total; + /* If we've already got a :: its an error */ + else if (s->zero_pos != s->total) + return 0; + s->zero_cnt++; + } else { + /* If more than 4 characters could be final a.b.c.d form */ + if (len > 4) { + /* Need at least 4 bytes left */ + if (s->total > 12) + return 0; + /* Must be end of string */ + if (elem[len]) + return 0; + if (!ipv4_from_asc(s->tmp + s->total, elem)) + return 0; + s->total += 4; + } else { + if (!ipv6_hex(s->tmp + s->total, elem, len)) + return 0; + s->total += 2; + } + } + return 1; +} + +/* + * Convert a string of up to 4 hex digits into the corresponding IPv6 form. + */ + +static int ipv6_hex(unsigned char *out, const char *in, int inlen) +{ + unsigned char c; + unsigned int num = 0; + if (inlen > 4) + return 0; + while (inlen--) { + c = *in++; + num <<= 4; + if ((c >= '0') && (c <= '9')) + num |= c - '0'; + else if ((c >= 'A') && (c <= 'F')) + num |= c - 'A' + 10; + else if ((c >= 'a') && (c <= 'f')) + num |= c - 'a' + 10; + else + return 0; + } + out[0] = num >> 8; + out[1] = num & 0xff; + return 1; +} + +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF (CONF_VALUE) * dn_sk, + unsigned long chtype) +{ + CONF_VALUE *v; + int mval; + size_t i; + char *p, *type; + if (!nm) + return 0; + + for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) { + v = sk_CONF_VALUE_value(dn_sk, i); + type = v->name; + /* + * Skip past any leading X. X: X, etc to allow for multiple instances + */ + for (p = type; *p; p++) + if ((*p == ':') || (*p == ',') || (*p == '.')) { + p++; + if (*p) + type = p; + break; + } + if (*type == '+') { + mval = -1; + type++; + } else + mval = 0; + if (!X509_NAME_add_entry_by_txt(nm, type, chtype, + (unsigned char *)v->value, -1, -1, + mval)) + return 0; + + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back new file mode 100644 index 0000000..9138ef7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back @@ -0,0 +1,1395 @@ +/* v3_utl.c */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 1999-2003 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). + * + */ +/* X509 v3 extension utilities */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../conf/internal.h" +#include "../internal.h" +#include "internal.h" + + +static char *strip_spaces(char *name); +static int sk_strcmp(const OPENSSL_STRING *a, const OPENSSL_STRING *b); +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, + GENERAL_NAMES *gens); +static void str_free(OPENSSL_STRING str); +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); + +static int ipv4_from_asc(unsigned char *v4, const char *in); +static int ipv6_from_asc(unsigned char *v6, const char *in); +static int ipv6_cb(const char *elem, int len, void *usr); +static int ipv6_hex(unsigned char *out, const char *in, int inlen); + +/* Add a CONF_VALUE name value pair to stack */ + +int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist) +{ + CONF_VALUE *vtmp = NULL; + char *tname = NULL, *tvalue = NULL; + if (name && !(tname = OPENSSL_strdup(name))) + goto err; + if (value && !(tvalue = OPENSSL_strdup(value))) + goto err; + if (!(vtmp = CONF_VALUE_new())) + goto err; + if (!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) + goto err; + vtmp->section = NULL; + vtmp->name = tname; + vtmp->value = tvalue; + if (!sk_CONF_VALUE_push(*extlist, vtmp)) + goto err; + return 1; + err: + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + if (vtmp) + OPENSSL_free(vtmp); + if (tname) + OPENSSL_free(tname); + if (tvalue) + OPENSSL_free(tvalue); + return 0; +} + +int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist) +{ + return X509V3_add_value(name, (const char *)value, extlist); +} + +/* Free function for STACK_OF(CONF_VALUE) */ + +void X509V3_conf_free(CONF_VALUE *conf) +{ + if (!conf) + return; + if (conf->name) + OPENSSL_free(conf->name); + if (conf->value) + OPENSSL_free(conf->value); + if (conf->section) + OPENSSL_free(conf->section); + OPENSSL_free(conf); +} + +int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist) +{ + if (asn1_bool) + return X509V3_add_value(name, "TRUE", extlist); + return X509V3_add_value(name, "FALSE", extlist); +} + +int X509V3_add_value_bool_nf(char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist) +{ + if (asn1_bool) + return X509V3_add_value(name, "TRUE", extlist); + return 1; +} + +static char *bignum_to_string(const BIGNUM *bn) +{ + char *tmp, *ret; + size_t len; + + /* + * Display large numbers in hex and small numbers in decimal. Converting to + * decimal takes quadratic time and is no more useful than hex for large + * numbers. + */ + if (BN_num_bits(bn) < 32) { + return BN_bn2dec(bn); + } + + tmp = BN_bn2hex(bn); + if (tmp == NULL) { + return NULL; + } + + len = strlen(tmp) + 3; + ret = OPENSSL_malloc(len); + if (ret == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + OPENSSL_free(tmp); + return NULL; + } + + /* Prepend "0x", but place it after the "-" if negative. */ + if (tmp[0] == '-') { + OPENSSL_strlcpy(ret, "-0x", len); + OPENSSL_strlcat(ret, tmp + 1, len); + } else { + OPENSSL_strlcpy(ret, "0x", len); + OPENSSL_strlcat(ret, tmp, len); + } + OPENSSL_free(tmp); + return ret; +} + +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a) +{ + BIGNUM *bntmp = NULL; + char *strtmp = NULL; + if (!a) + return NULL; + if (!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) || + !(strtmp = bignum_to_string(bntmp))) + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + BN_free(bntmp); + return strtmp; +} + +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) +{ + BIGNUM *bntmp = NULL; + char *strtmp = NULL; + if (!a) + return NULL; + if (!(bntmp = ASN1_INTEGER_to_BN(a, NULL)) || + !(strtmp = bignum_to_string(bntmp))) + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + BN_free(bntmp); + return strtmp; +} + +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) +{ + BIGNUM *bn = NULL; + ASN1_INTEGER *aint; + int isneg, ishex; + int ret; + if (!value) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + return 0; + } + bn = BN_new(); + if (value[0] == '-') { + value++; + isneg = 1; + } else + isneg = 0; + + if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) { + value += 2; + ishex = 1; + } else + ishex = 0; + + if (ishex) + ret = BN_hex2bn(&bn, value); + else + ret = BN_dec2bn(&bn, value); + + if (!ret || value[ret]) { + BN_free(bn); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BN_DEC2BN_ERROR); + return 0; + } + + if (isneg && BN_is_zero(bn)) + isneg = 0; + + aint = BN_to_ASN1_INTEGER(bn, NULL); + BN_free(bn); + if (!aint) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR); + return 0; + } + if (isneg) + aint->type |= V_ASN1_NEG; + return aint; +} + +int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist) +{ + char *strtmp; + int ret; + if (!aint) + return 1; + if (!(strtmp = i2s_ASN1_INTEGER(NULL, aint))) + return 0; + ret = X509V3_add_value(name, strtmp, extlist); + OPENSSL_free(strtmp); + return ret; +} + +int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool) +{ + char *btmp; + if (!(btmp = value->value)) + goto err; + if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true") + || !strcmp(btmp, "Y") || !strcmp(btmp, "y") + || !strcmp(btmp, "YES") || !strcmp(btmp, "yes")) { + *asn1_bool = 0xff; + return 1; + } else if (!strcmp(btmp, "FALSE") || !strcmp(btmp, "false") + || !strcmp(btmp, "N") || !strcmp(btmp, "n") + || !strcmp(btmp, "NO") || !strcmp(btmp, "no")) { + *asn1_bool = 0; + return 1; + } + err: + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_BOOLEAN_STRING); + X509V3_conf_err(value); + return 0; +} + +int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint) +{ + ASN1_INTEGER *itmp; + if (!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) { + X509V3_conf_err(value); + return 0; + } + *aint = itmp; + return 1; +} + +#define HDR_NAME 1 +#define HDR_VALUE 2 + +/* + * #define DEBUG + */ + +STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line) +{ + char *p, *q, c; + char *ntmp, *vtmp; + STACK_OF(CONF_VALUE) *values = NULL; + char *linebuf; + int state; + /* We are going to modify the line so copy it first */ + linebuf = OPENSSL_strdup(line); + if (linebuf == NULL) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + goto err; + } + state = HDR_NAME; + ntmp = NULL; + /* Go through all characters */ + for (p = linebuf, q = linebuf; (c = *p) && (c != '\r') && (c != '\n'); + p++) { + + switch (state) { + case HDR_NAME: + if (c == ':') { + state = HDR_VALUE; + *p = 0; + ntmp = strip_spaces(q); + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + q = p + 1; + } else if (c == ',') { + *p = 0; + ntmp = strip_spaces(q); + q = p + 1; +#if 0 + printf("%s\n", ntmp); +#endif + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + X509V3_add_value(ntmp, NULL, &values); + } + break; + + case HDR_VALUE: + if (c == ',') { + state = HDR_NAME; + *p = 0; + vtmp = strip_spaces(q); +#if 0 + printf("%s\n", ntmp); +#endif + if (!vtmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + goto err; + } + X509V3_add_value(ntmp, vtmp, &values); + ntmp = NULL; + q = p + 1; + } + + } + } + + if (state == HDR_VALUE) { + vtmp = strip_spaces(q); +#if 0 + printf("%s=%s\n", ntmp, vtmp); +#endif + if (!vtmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); + goto err; + } + X509V3_add_value(ntmp, vtmp, &values); + } else { + ntmp = strip_spaces(q); +#if 0 + printf("%s\n", ntmp); +#endif + if (!ntmp) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); + goto err; + } + X509V3_add_value(ntmp, NULL, &values); + } + OPENSSL_free(linebuf); + return values; + + err: + OPENSSL_free(linebuf); + sk_CONF_VALUE_pop_free(values, X509V3_conf_free); + return NULL; + +} + +/* Delete leading and trailing spaces from a string */ +static char *strip_spaces(char *name) +{ + char *p, *q; + /* Skip over leading spaces */ + p = name; + while (*p && isspace((unsigned char)*p)) + p++; + if (!*p) + return NULL; + q = p + strlen(p) - 1; + while ((q != p) && isspace((unsigned char)*q)) + q--; + if (p != q) + q[1] = 0; + if (!*p) + return NULL; + return p; +} + +/* hex string utilities */ + +/* + * Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its + * hex representation @@@ (Contents of buffer are always kept in ASCII, also + * on EBCDIC machines) + */ + +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len) +{ + char *tmp, *q; + const unsigned char *p; + int i; + static const char hexdig[] = "0123456789ABCDEF"; + if (!buffer || !len) + return NULL; + if (!(tmp = OPENSSL_malloc(len * 3 + 1))) { + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + } + q = tmp; + for (i = 0, p = buffer; i < len; i++, p++) { + *q++ = hexdig[(*p >> 4) & 0xf]; + *q++ = hexdig[*p & 0xf]; + *q++ = ':'; + } + q[-1] = 0; + + return tmp; +} + +unsigned char *x509v3_hex_to_bytes(const char *str, long *len) +{ + unsigned char *hexbuf, *q; + unsigned char ch, cl, *p; + if (!str) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT); + return NULL; + } + if (!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) + goto err; + for (p = (unsigned char *)str, q = hexbuf; *p;) { + ch = *p++; + if (ch == ':') + continue; + cl = *p++; + if (!cl) { + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ODD_NUMBER_OF_DIGITS); + OPENSSL_free(hexbuf); + return NULL; + } + + if ((ch >= '0') && (ch <= '9')) + ch -= '0'; + else if ((ch >= 'a') && (ch <= 'f')) + ch -= 'a' - 10; + else if ((ch >= 'A') && (ch <= 'F')) + ch -= 'A' - 10; + else + goto badhex; + + if ((cl >= '0') && (cl <= '9')) + cl -= '0'; + else if ((cl >= 'a') && (cl <= 'f')) + cl -= 'a' - 10; + else if ((cl >= 'A') && (cl <= 'F')) + cl -= 'A' - 10; + else + goto badhex; + + *q++ = (ch << 4) | cl; + } + + if (len) + *len = q - hexbuf; + + return hexbuf; + + err: + if (hexbuf) + OPENSSL_free(hexbuf); + OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); + return NULL; + + badhex: + OPENSSL_free(hexbuf); + OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); + return NULL; + +} + +int x509v3_name_cmp(const char *name, const char *cmp) +{ + int len, ret; + char c; + len = strlen(cmp); + if ((ret = strncmp(name, cmp, len))) + return ret; + c = name[len]; + if (!c || (c == '.')) + return 0; + return 1; +} + +static int sk_strcmp(const OPENSSL_STRING *a, const OPENSSL_STRING *b) +{ + return strcmp(*a, *b); +} + +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) +{ + GENERAL_NAMES *gens; + STACK_OF(OPENSSL_STRING) *ret; + + gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + ret = get_email(X509_get_subject_name(x), gens); + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + return ret; +} + +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) +{ + AUTHORITY_INFO_ACCESS *info; + STACK_OF(OPENSSL_STRING) *ret = NULL; + size_t i; + + info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); + if (!info) + return NULL; + for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) { + ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i); + if (OBJ_obj2nid(ad->method) == NID_ad_OCSP) { + if (ad->location->type == GEN_URI) { + if (!append_ia5 + (&ret, ad->location->d.uniformResourceIdentifier)) + break; + } + } + } + AUTHORITY_INFO_ACCESS_free(info); + return ret; +} + +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) +{ + GENERAL_NAMES *gens; + STACK_OF(X509_EXTENSION) *exts; + STACK_OF(OPENSSL_STRING) *ret; + + exts = X509_REQ_get_extensions(x); + gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); + ret = get_email(X509_REQ_get_subject_name(x), gens); + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); + sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); + return ret; +} + +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, + GENERAL_NAMES *gens) +{ + STACK_OF(OPENSSL_STRING) *ret = NULL; + X509_NAME_ENTRY *ne; + ASN1_IA5STRING *email; + GENERAL_NAME *gen; + int i; + size_t j; + /* Now add any email address(es) to STACK */ + i = -1; + /* First supplied X509_NAME */ + while ((i = X509_NAME_get_index_by_NID(name, + NID_pkcs9_emailAddress, i)) >= 0) { + ne = X509_NAME_get_entry(name, i); + email = X509_NAME_ENTRY_get_data(ne); + if (!append_ia5(&ret, email)) + return NULL; + } + for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) { + gen = sk_GENERAL_NAME_value(gens, j); + if (gen->type != GEN_EMAIL) + continue; + if (!append_ia5(&ret, gen->d.ia5)) + return NULL; + } + return ret; +} + +static void str_free(OPENSSL_STRING str) +{ + OPENSSL_free(str); +} + +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) +{ + char *emtmp; + /* First some sanity checks */ + if (email->type != V_ASN1_IA5STRING) + return 1; + if (!email->data || !email->length) + return 1; + if (!*sk) + *sk = sk_OPENSSL_STRING_new(sk_strcmp); + 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 = OPENSSL_strdup((char *)email->data); + if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { + X509_email_free(*sk); + *sk = NULL; + return 0; + } + return 1; +} + +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) +{ + sk_OPENSSL_STRING_pop_free(sk, str_free); +} + +typedef int (*equal_fn) (const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags); + +/* Skip pattern prefix to match "wildcard" subject */ +static void skip_prefix(const unsigned char **p, size_t *plen, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *pattern = *p; + size_t pattern_len = *plen; + + /* + * If subject starts with a leading '.' followed by more octets, and + * pattern is longer, compare just an equal-length suffix with the + * full subject (starting at the '.'), provided the prefix contains + * no NULs. + */ + if ((flags & _X509_CHECK_FLAG_DOT_SUBDOMAINS) == 0) + return; + + while (pattern_len > subject_len && *pattern) { + if ((flags & X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS) && + *pattern == '.') + break; + ++pattern; + --pattern_len; + } + + /* Skip if entire prefix acceptable */ + if (pattern_len == subject_len) { + *p = pattern; + *plen = pattern_len; + } +} + +/* Compare while ASCII ignoring case. */ +static int equal_nocase(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); + if (pattern_len != subject_len) + return 0; + while (pattern_len) { + unsigned char l = *pattern; + unsigned char r = *subject; + /* The pattern must not contain NUL characters. */ + if (l == 0) + return 0; + if (l != r) { + if ('A' <= l && l <= 'Z') + l = (l - 'A') + 'a'; + if ('A' <= r && r <= 'Z') + r = (r - 'A') + 'a'; + if (l != r) + return 0; + } + ++pattern; + ++subject; + --pattern_len; + } + return 1; +} + +/* Compare using OPENSSL_memcmp. */ +static int equal_case(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); + if (pattern_len != subject_len) + return 0; + return !OPENSSL_memcmp(pattern, subject, pattern_len); +} + +/* + * RFC 5280, section 7.5, requires that only the domain is compared in a + * case-insensitive manner. + */ +static int equal_email(const unsigned char *a, size_t a_len, + const unsigned char *b, size_t b_len, + unsigned int unused_flags) +{ + size_t i = a_len; + if (a_len != b_len) + return 0; + /* + * We search backwards for the '@' character, so that we do not have to + * deal with quoted local-parts. The domain part is compared in a + * case-insensitive manner. + */ + while (i > 0) { + --i; + if (a[i] == '@' || b[i] == '@') { + if (!equal_nocase(a + i, a_len - i, b + i, a_len - i, 0)) + return 0; + break; + } + } + if (i == 0) + i = a_len; + return equal_case(a, i, b, i, 0); +} + +/* + * Compare the prefix and suffix with the subject, and check that the + * characters in-between are valid. + */ +static int wildcard_match(const unsigned char *prefix, size_t prefix_len, + const unsigned char *suffix, size_t suffix_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *wildcard_start; + const unsigned char *wildcard_end; + const unsigned char *p; + int allow_multi = 0; + int allow_idna = 0; + + if (subject_len < prefix_len + suffix_len) + return 0; + if (!equal_nocase(prefix, prefix_len, subject, prefix_len, flags)) + return 0; + wildcard_start = subject + prefix_len; + wildcard_end = subject + (subject_len - suffix_len); + if (!equal_nocase(wildcard_end, suffix_len, suffix, suffix_len, flags)) + return 0; + /* + * If the wildcard makes up the entire first label, it must match at + * least one character. + */ + if (prefix_len == 0 && *suffix == '.') { + if (wildcard_start == wildcard_end) + return 0; + allow_idna = 1; + if (flags & X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS) + allow_multi = 1; + } + /* IDNA labels cannot match partial wildcards */ + if (!allow_idna && + subject_len >= 4 + && OPENSSL_strncasecmp((char *)subject, "xn--", 4) == 0) + return 0; + /* The wildcard may match a literal '*' */ + if (wildcard_end == wildcard_start + 1 && *wildcard_start == '*') + return 1; + /* + * Check that the part matched by the wildcard contains only + * permitted characters and only matches a single label unless + * allow_multi is set. + */ + for (p = wildcard_start; p != wildcard_end; ++p) + if (!(('0' <= *p && *p <= '9') || + ('A' <= *p && *p <= 'Z') || + ('a' <= *p && *p <= 'z') || + *p == '-' || (allow_multi && *p == '.'))) + return 0; + return 1; +} + +#define LABEL_START (1 << 0) +#define LABEL_END (1 << 1) +#define LABEL_HYPHEN (1 << 2) +#define LABEL_IDNA (1 << 3) + +static const unsigned char *valid_star(const unsigned char *p, size_t len, + unsigned int flags) +{ + const unsigned char *star = 0; + size_t i; + int state = LABEL_START; + int dots = 0; + for (i = 0; i < len; ++i) { + /* + * Locate first and only legal wildcard, either at the start + * or end of a non-IDNA first and not final label. + */ + if (p[i] == '*') { + int atstart = (state & LABEL_START); + int atend = (i == len - 1 || p[i + 1] == '.'); + /* + * At most one wildcard per pattern. + * No wildcards in IDNA labels. + * No wildcards after the first label. + */ + if (star != NULL || (state & LABEL_IDNA) != 0 || dots) + return NULL; + /* Only full-label '*.example.com' wildcards? */ + if ((flags & X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS) + && (!atstart || !atend)) + return NULL; + /* No 'foo*bar' wildcards */ + if (!atstart && !atend) + return NULL; + star = &p[i]; + state &= ~LABEL_START; + } else if (('a' <= p[i] && p[i] <= 'z') + || ('A' <= p[i] && p[i] <= 'Z') + || ('0' <= p[i] && p[i] <= '9')) { + if ((state & LABEL_START) != 0 + && len - i >= 4 + && OPENSSL_strncasecmp((char *)&p[i], "xn--", 4) == 0) + state |= LABEL_IDNA; + state &= ~(LABEL_HYPHEN | LABEL_START); + } else if (p[i] == '.') { + if ((state & (LABEL_HYPHEN | LABEL_START)) != 0) + return NULL; + state = LABEL_START; + ++dots; + } else if (p[i] == '-') { + /* no domain/subdomain starts with '-' */ + if ((state & LABEL_START) != 0) + return NULL; + state |= LABEL_HYPHEN; + } else + return NULL; + } + + /* + * The final label must not end in a hyphen or ".", and + * there must be at least two dots after the star. + */ + if ((state & (LABEL_START | LABEL_HYPHEN)) != 0 || dots < 2) + return NULL; + return star; +} + +/* Compare using wildcards. */ +static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, + const unsigned char *subject, size_t subject_len, + unsigned int flags) +{ + const unsigned char *star = NULL; + + /* + * Subject names starting with '.' can only match a wildcard pattern + * via a subject sub-domain pattern suffix match. + */ + if (!(subject_len > 1 && subject[0] == '.')) + star = valid_star(pattern, pattern_len, flags); + if (star == NULL) + return equal_nocase(pattern, pattern_len, + subject, subject_len, flags); + return wildcard_match(pattern, star - pattern, + star + 1, (pattern + pattern_len) - star - 1, + 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 + * to UTF8. + */ + +static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, + unsigned int flags, int check_type, const char *b, + size_t blen, char **peername) +{ + int rv = 0; + + if (!a->data || !a->length) + return 0; + if (cmp_type > 0) { + if (cmp_type != a->type) + return 0; + if (cmp_type == V_ASN1_IA5STRING) + rv = equal(a->data, a->length, (unsigned char *)b, blen, flags); + else if (a->length == (int)blen && !OPENSSL_memcmp(a->data, b, blen)) + rv = 1; + if (rv > 0 && peername) + *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; + /* + * 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 = OPENSSL_strndup((char *)astr, astrlen); + OPENSSL_free(astr); + } + return rv; +} + +static int do_x509_check(X509 *x, const char *chk, size_t chklen, + unsigned int flags, int check_type, char **peername) +{ + GENERAL_NAMES *gens = NULL; + X509_NAME *name = NULL; + size_t i; + int j; + int cnid = NID_undef; + int alt_type; + int rv = 0; + equal_fn equal; + + /* See below, this flag is internal-only */ + flags &= ~_X509_CHECK_FLAG_DOT_SUBDOMAINS; + if (check_type == GEN_EMAIL) { + cnid = NID_pkcs9_emailAddress; + alt_type = V_ASN1_IA5STRING; + equal = equal_email; + } else if (check_type == GEN_DNS) { + cnid = NID_commonName; + /* Implicit client-side DNS sub-domain pattern */ + if (chklen > 1 && chk[0] == '.') + flags |= _X509_CHECK_FLAG_DOT_SUBDOMAINS; + alt_type = V_ASN1_IA5STRING; + if (flags & X509_CHECK_FLAG_NO_WILDCARDS) + equal = equal_nocase; + else + equal = equal_wildcard; + } else { + alt_type = V_ASN1_OCTET_STRING; + equal = equal_case; + } + + gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + if (gens) { + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { + GENERAL_NAME *gen; + ASN1_STRING *cstr; + gen = sk_GENERAL_NAME_value(gens, i); + if (gen->type != check_type) + continue; + if (check_type == GEN_EMAIL) + cstr = gen->d.rfc822Name; + else if (check_type == GEN_DNS) + cstr = gen->d.dNSName; + else + cstr = gen->d.iPAddress; + /* Positive on success, negative on error! */ + if ((rv = do_check_string(cstr, alt_type, equal, flags, check_type, + chk, chklen, peername)) != 0) + break; + } + GENERAL_NAMES_free(gens); + return rv; + } + + /* We're done if CN-ID is not pertinent */ + if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT)) + return 0; + + j = -1; + name = X509_get_subject_name(x); + while ((j = X509_NAME_get_index_by_NID(name, cnid, j)) >= 0) { + X509_NAME_ENTRY *ne; + ASN1_STRING *str; + 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, check_type, + chk, chklen, peername)) != 0) + return rv; + } + return 0; +} + +int X509_check_host(X509 *x, const char *chk, size_t chklen, + unsigned int flags, char **peername) +{ + if (chk == NULL) + return -2; + if (OPENSSL_memchr(chk, '\0', chklen)) + return -2; + return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername); +} + +int X509_check_email(X509 *x, const char *chk, size_t chklen, + unsigned int flags) +{ + if (chk == NULL) + return -2; + if (OPENSSL_memchr(chk, '\0', chklen)) + return -2; + return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL); +} + +int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, + unsigned int flags) +{ + if (chk == NULL) + return -2; + return do_x509_check(x, (char *)chk, chklen, flags, GEN_IPADD, NULL); +} + +int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags) +{ + unsigned char ipout[16]; + size_t iplen; + + if (ipasc == NULL) + return -2; + iplen = (size_t)a2i_ipadd(ipout, ipasc); + if (iplen == 0) + return -2; + return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL); +} + +/* + * Convert IP addresses both IPv4 and IPv6 into an OCTET STRING compatible + * with RFC3280. + */ + +ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc) +{ + unsigned char ipout[16]; + ASN1_OCTET_STRING *ret; + int iplen; + + /* If string contains a ':' assume IPv6 */ + + iplen = a2i_ipadd(ipout, ipasc); + + if (!iplen) + return NULL; + + ret = ASN1_OCTET_STRING_new(); + if (!ret) + return NULL; + if (!ASN1_OCTET_STRING_set(ret, ipout, iplen)) { + ASN1_OCTET_STRING_free(ret); + return NULL; + } + return ret; +} + +ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) +{ + ASN1_OCTET_STRING *ret = NULL; + unsigned char ipout[32]; + char *iptmp = NULL, *p; + int iplen1, iplen2; + p = strchr(ipasc, '/'); + if (!p) + return NULL; + iptmp = OPENSSL_strdup(ipasc); + if (!iptmp) + return NULL; + p = iptmp + (p - ipasc); + *p++ = 0; + + iplen1 = a2i_ipadd(ipout, iptmp); + + if (!iplen1) + goto err; + + iplen2 = a2i_ipadd(ipout + iplen1, p); + + OPENSSL_free(iptmp); + iptmp = NULL; + + if (!iplen2 || (iplen1 != iplen2)) + goto err; + + ret = ASN1_OCTET_STRING_new(); + if (!ret) + goto err; + if (!ASN1_OCTET_STRING_set(ret, ipout, iplen1 + iplen2)) + goto err; + + return ret; + + err: + if (iptmp) + OPENSSL_free(iptmp); + if (ret) + ASN1_OCTET_STRING_free(ret); + return NULL; +} + +int a2i_ipadd(unsigned char *ipout, const char *ipasc) +{ + /* If string contains a ':' assume IPv6 */ + + if (strchr(ipasc, ':')) { + if (!ipv6_from_asc(ipout, ipasc)) + return 0; + return 16; + } else { + if (!ipv4_from_asc(ipout, ipasc)) + return 0; + return 4; + } +} + +static int ipv4_from_asc(unsigned char *v4, const char *in) +{ + int a0, a1, a2, a3; + if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4) + return 0; + if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255) + || (a2 < 0) || (a2 > 255) || (a3 < 0) || (a3 > 255)) + return 0; + v4[0] = a0; + v4[1] = a1; + v4[2] = a2; + v4[3] = a3; + return 1; +} + +typedef struct { + /* Temporary store for IPV6 output */ + unsigned char tmp[16]; + /* Total number of bytes in tmp */ + int total; + /* The position of a zero (corresponding to '::') */ + int zero_pos; + /* Number of zeroes */ + int zero_cnt; +} IPV6_STAT; + +static int ipv6_from_asc(unsigned char *v6, const char *in) +{ + IPV6_STAT v6stat; + v6stat.total = 0; + v6stat.zero_pos = -1; + v6stat.zero_cnt = 0; + /* + * Treat the IPv6 representation as a list of values separated by ':'. + * The presence of a '::' will parse as one, two or three zero length + * elements. + */ + if (!CONF_parse_list(in, ':', 0, ipv6_cb, &v6stat)) + return 0; + + /* Now for some sanity checks */ + + if (v6stat.zero_pos == -1) { + /* If no '::' must have exactly 16 bytes */ + if (v6stat.total != 16) + return 0; + } else { + /* If '::' must have less than 16 bytes */ + if (v6stat.total == 16) + return 0; + /* More than three zeroes is an error */ + if (v6stat.zero_cnt > 3) + return 0; + /* Can only have three zeroes if nothing else present */ + else if (v6stat.zero_cnt == 3) { + if (v6stat.total > 0) + return 0; + } + /* Can only have two zeroes if at start or end */ + else if (v6stat.zero_cnt == 2) { + if ((v6stat.zero_pos != 0) + && (v6stat.zero_pos != v6stat.total)) + return 0; + } else + /* Can only have one zero if *not* start or end */ + { + if ((v6stat.zero_pos == 0) + || (v6stat.zero_pos == v6stat.total)) + return 0; + } + } + + /* Format result */ + + if (v6stat.zero_pos >= 0) { + /* Copy initial part */ + OPENSSL_memcpy(v6, v6stat.tmp, v6stat.zero_pos); + /* Zero middle */ + OPENSSL_memset(v6 + v6stat.zero_pos, 0, 16 - v6stat.total); + /* Copy final part */ + if (v6stat.total != v6stat.zero_pos) + OPENSSL_memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total, + v6stat.tmp + v6stat.zero_pos, + v6stat.total - v6stat.zero_pos); + } else + OPENSSL_memcpy(v6, v6stat.tmp, 16); + + return 1; +} + +static int ipv6_cb(const char *elem, int len, void *usr) +{ + IPV6_STAT *s = usr; + /* Error if 16 bytes written */ + if (s->total == 16) + return 0; + if (len == 0) { + /* Zero length element, corresponds to '::' */ + if (s->zero_pos == -1) + s->zero_pos = s->total; + /* If we've already got a :: its an error */ + else if (s->zero_pos != s->total) + return 0; + s->zero_cnt++; + } else { + /* If more than 4 characters could be final a.b.c.d form */ + if (len > 4) { + /* Need at least 4 bytes left */ + if (s->total > 12) + return 0; + /* Must be end of string */ + if (elem[len]) + return 0; + if (!ipv4_from_asc(s->tmp + s->total, elem)) + return 0; + s->total += 4; + } else { + if (!ipv6_hex(s->tmp + s->total, elem, len)) + return 0; + s->total += 2; + } + } + return 1; +} + +/* + * Convert a string of up to 4 hex digits into the corresponding IPv6 form. + */ + +static int ipv6_hex(unsigned char *out, const char *in, int inlen) +{ + unsigned char c; + unsigned int num = 0; + if (inlen > 4) + return 0; + while (inlen--) { + c = *in++; + num <<= 4; + if ((c >= '0') && (c <= '9')) + num |= c - '0'; + else if ((c >= 'A') && (c <= 'F')) + num |= c - 'A' + 10; + else if ((c >= 'a') && (c <= 'f')) + num |= c - 'a' + 10; + else + return 0; + } + out[0] = num >> 8; + out[1] = num & 0xff; + return 1; +} + +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF (CONF_VALUE) * dn_sk, + unsigned long chtype) +{ + CONF_VALUE *v; + int mval; + size_t i; + char *p, *type; + if (!nm) + return 0; + + for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) { + v = sk_CONF_VALUE_value(dn_sk, i); + type = v->name; + /* + * Skip past any leading X. X: X, etc to allow for multiple instances + */ + for (p = type; *p; p++) + if ((*p == ':') || (*p == ',') || (*p == '.')) { + p++; + if (*p) + type = p; + break; + } + if (*type == '+') { + mval = -1; + type++; + } else + mval = 0; + if (!X509_NAME_add_entry_by_txt(nm, type, chtype, + (unsigned char *)v->value, -1, -1, + mval)) + return 0; + + } + return 1; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/BoringSSL.modulemap b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/BoringSSL.modulemap new file mode 100644 index 0000000..283008b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/BoringSSL.modulemap @@ -0,0 +1,6 @@ + framework module openssl { + umbrella header "umbrella.h" + textual header "arm_arch.h" + export * + module * { export * } + } diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h new file mode 100644 index 0000000..acfd6f8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h @@ -0,0 +1,459 @@ +/* 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_AEAD_H +#define OPENSSL_HEADER_AEAD_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.back new file mode 100644 index 0000000..6d78db2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.back @@ -0,0 +1,459 @@ +/* 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_AEAD_H +#define OPENSSL_HEADER_AEAD_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back new file mode 100644 index 0000000..6d78db2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back @@ -0,0 +1,459 @@ +/* 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_AEAD_H +#define OPENSSL_HEADER_AEAD_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h new file mode 100644 index 0000000..dcfc17c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h @@ -0,0 +1,195 @@ +/* ==================================================================== + * 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. + * ==================================================================== */ + +#ifndef OPENSSL_HEADER_AES_H +#define OPENSSL_HEADER_AES_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.back new file mode 100644 index 0000000..e560625 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.back @@ -0,0 +1,195 @@ +/* ==================================================================== + * 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. + * ==================================================================== */ + +#ifndef OPENSSL_HEADER_AES_H +#define OPENSSL_HEADER_AES_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back new file mode 100644 index 0000000..e560625 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back @@ -0,0 +1,195 @@ +/* ==================================================================== + * 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. + * ==================================================================== */ + +#ifndef OPENSSL_HEADER_AES_H +#define OPENSSL_HEADER_AES_H + +#include + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h new file mode 100644 index 0000000..faa2655 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.back new file mode 100644 index 0000000..faa2655 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.grpc_back new file mode 100644 index 0000000..faa2655 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h new file mode 100644 index 0000000..4e2630f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.back new file mode 100644 index 0000000..6ae831b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_back new file mode 100644 index 0000000..6ae831b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h new file mode 100644 index 0000000..666e569 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.back new file mode 100644 index 0000000..666e569 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.grpc_back new file mode 100644 index 0000000..666e569 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h new file mode 100644 index 0000000..44995df --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.back new file mode 100644 index 0000000..7bd7701 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.grpc_back new file mode 100644 index 0000000..7bd7701 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h new file mode 100644 index 0000000..5a78ac4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h.back new file mode 100644 index 0000000..e347c09 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_back new file mode 100644 index 0000000..e347c09 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h new file mode 100644 index 0000000..a41cf5f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.back new file mode 100644 index 0000000..c88546d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_back new file mode 100644 index 0000000..c88546d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h new file mode 100644 index 0000000..3b0c867 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.back new file mode 100644 index 0000000..da0dcdf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_back new file mode 100644 index 0000000..da0dcdf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h new file mode 100644 index 0000000..c0e701d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.back new file mode 100644 index 0000000..293b175 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.grpc_back new file mode 100644 index 0000000..293b175 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.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.] */ + +#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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h new file mode 100644 index 0000000..e0d6b5c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.back new file mode 100644 index 0000000..5cd2563 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_back new file mode 100644 index 0000000..5cd2563 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h new file mode 100644 index 0000000..0ef0db5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.back new file mode 100644 index 0000000..a57f000 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_back new file mode 100644 index 0000000..a57f000 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h new file mode 100644 index 0000000..c6b721c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.back new file mode 100644 index 0000000..c6b721c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.grpc_back new file mode 100644 index 0000000..c6b721c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h new file mode 100644 index 0000000..5f04dfc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.back new file mode 100644 index 0000000..1f9c879 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_back new file mode 100644 index 0000000..1f9c879 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h new file mode 100644 index 0000000..95d4f1b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.back new file mode 100644 index 0000000..1a0f82d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.grpc_back new file mode 100644 index 0000000..1a0f82d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cast.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_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h new file mode 100644 index 0000000..18a97c3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.back new file mode 100644 index 0000000..684fc5b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.grpc_back new file mode 100644 index 0000000..684fc5b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h new file mode 100644 index 0000000..8d686de --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.back new file mode 100644 index 0000000..d22a6c2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_back new file mode 100644 index 0000000..d22a6c2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h new file mode 100644 index 0000000..4c22360 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.back new file mode 100644 index 0000000..3e8cf92 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_back new file mode 100644 index 0000000..3e8cf92 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h new file mode 100644 index 0000000..30c6c44 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.back new file mode 100644 index 0000000..ae71869 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_back new file mode 100644 index 0000000..ae71869 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h new file mode 100644 index 0000000..fc8deef --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.back new file mode 100644 index 0000000..ae55967 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_back new file mode 100644 index 0000000..ae55967 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h new file mode 100644 index 0000000..63120a9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.back new file mode 100644 index 0000000..6aa661a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_back new file mode 100644 index 0000000..6aa661a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h new file mode 100644 index 0000000..45d8ace --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.back new file mode 100644 index 0000000..a455389 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_back new file mode 100644 index 0000000..a455389 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h new file mode 100644 index 0000000..a817755 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h.back new file mode 100644 index 0000000..af1c822 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/des.h.grpc_back new file mode 100644 index 0000000..af1c822 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h new file mode 100644 index 0000000..4c59828 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.back new file mode 100644 index 0000000..7e10303 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_back new file mode 100644 index 0000000..7e10303 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h new file mode 100644 index 0000000..e364407 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.back new file mode 100644 index 0000000..c3ceb7f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_back new file mode 100644 index 0000000..c3ceb7f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h new file mode 100644 index 0000000..45fdd5b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.back new file mode 100644 index 0000000..8e3b9b3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_back new file mode 100644 index 0000000..8e3b9b3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h new file mode 100644 index 0000000..38ca801 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.back new file mode 100644 index 0000000..38ca801 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.grpc_back new file mode 100644 index 0000000..38ca801 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h new file mode 100644 index 0000000..4095f63 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.back new file mode 100644 index 0000000..f2d8bac --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.grpc_back new file mode 100644 index 0000000..f2d8bac --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h new file mode 100644 index 0000000..6944b77 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.back new file mode 100644 index 0000000..cfad93e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_back new file mode 100644 index 0000000..cfad93e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h new file mode 100644 index 0000000..f2052fe --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.back new file mode 100644 index 0000000..932ad8e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_back new file mode 100644 index 0000000..932ad8e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h new file mode 100644 index 0000000..1857367 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.back new file mode 100644 index 0000000..0130ccc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_back new file mode 100644 index 0000000..0130ccc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h new file mode 100644 index 0000000..116384b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.back new file mode 100644 index 0000000..d4d353e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_back new file mode 100644 index 0000000..d4d353e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h new file mode 100644 index 0000000..ce0b354 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.back new file mode 100644 index 0000000..ce60de4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_back new file mode 100644 index 0000000..ce60de4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h new file mode 100644 index 0000000..7da1fdd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h.back new file mode 100644 index 0000000..f9cd9f2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_back new file mode 100644 index 0000000..f9cd9f2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h new file mode 100644 index 0000000..71a9803 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.back new file mode 100644 index 0000000..d5d102e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_back new file mode 100644 index 0000000..d5d102e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h new file mode 100644 index 0000000..fbba1c6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.back new file mode 100644 index 0000000..102f8a8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.grpc_back new file mode 100644 index 0000000..102f8a8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h new file mode 100644 index 0000000..fac6965 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.back new file mode 100644 index 0000000..59aaa49 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.grpc_back new file mode 100644 index 0000000..59aaa49 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h new file mode 100644 index 0000000..8547885 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.back new file mode 100644 index 0000000..b5d1e42 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_back new file mode 100644 index 0000000..b5d1e42 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h new file mode 100644 index 0000000..7ce7c0f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.back new file mode 100644 index 0000000..5390696 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.grpc_back new file mode 100644 index 0000000..5390696 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h new file mode 100644 index 0000000..302cbe2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.back new file mode 100644 index 0000000..302cbe2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.grpc_back new file mode 100644 index 0000000..302cbe2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h new file mode 100644 index 0000000..c0cb074 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.back new file mode 100644 index 0000000..29e09c8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.grpc_back new file mode 100644 index 0000000..29e09c8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h new file mode 100644 index 0000000..f4e4512 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.back new file mode 100644 index 0000000..b213bc6 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_back new file mode 100644 index 0000000..b213bc6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h new file mode 100644 index 0000000..5c7705d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.back new file mode 100644 index 0000000..5486512 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_back new file mode 100644 index 0000000..5486512 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h new file mode 100644 index 0000000..4138695 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.back new file mode 100644 index 0000000..cceabcd --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_back new file mode 100644 index 0000000..cceabcd --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h new file mode 100644 index 0000000..676a194 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.back new file mode 100644 index 0000000..a15f4e3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_back new file mode 100644 index 0000000..a15f4e3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h new file mode 100644 index 0000000..41f3e9d --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.back new file mode 100644 index 0000000..764188f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_back new file mode 100644 index 0000000..764188f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h new file mode 100644 index 0000000..e7ccadc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.back new file mode 100644 index 0000000..e7ccadc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.grpc_back new file mode 100644 index 0000000..e7ccadc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h new file mode 100644 index 0000000..dd6556f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.back new file mode 100644 index 0000000..dd6556f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.grpc_back new file mode 100644 index 0000000..dd6556f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h new file mode 100644 index 0000000..3c6ffd8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.back new file mode 100644 index 0000000..3c6ffd8 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.grpc_back new file mode 100644 index 0000000..3c6ffd8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h new file mode 100644 index 0000000..a3555d4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.back new file mode 100644 index 0000000..a3555d4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.grpc_back new file mode 100644 index 0000000..a3555d4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h new file mode 100644 index 0000000..c2b3fe7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.back new file mode 100644 index 0000000..c2b3fe7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.grpc_back new file mode 100644 index 0000000..c2b3fe7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h new file mode 100644 index 0000000..f5fb945 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.back new file mode 100644 index 0000000..9c0ff93 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.grpc_back new file mode 100644 index 0000000..9c0ff93 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h new file mode 100644 index 0000000..b5e9516 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.back new file mode 100644 index 0000000..b5e9516 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.grpc_back new file mode 100644 index 0000000..b5e9516 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h new file mode 100644 index 0000000..987d7b8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.back new file mode 100644 index 0000000..cb6155f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.grpc_back new file mode 100644 index 0000000..cb6155f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h new file mode 100644 index 0000000..c48a56f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.back new file mode 100644 index 0000000..385b995 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_back new file mode 100644 index 0000000..385b995 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h new file mode 100644 index 0000000..e488238 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.back new file mode 100644 index 0000000..a38ef21 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_back new file mode 100644 index 0000000..a38ef21 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h new file mode 100644 index 0000000..80f47c9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.back new file mode 100644 index 0000000..0e4bdd5 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_back new file mode 100644 index 0000000..0e4bdd5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h new file mode 100644 index 0000000..7daecc2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.back new file mode 100644 index 0000000..5d02e12 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.grpc_back new file mode 100644 index 0000000..5d02e12 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h new file mode 100644 index 0000000..1680e3a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.back new file mode 100644 index 0000000..acf56ae --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.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_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.grpc_back new file mode 100644 index 0000000..acf56ae --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h new file mode 100644 index 0000000..40e25e2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.back new file mode 100644 index 0000000..d859b1f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_back new file mode 100644 index 0000000..d859b1f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h new file mode 100644 index 0000000..03209f7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.back new file mode 100644 index 0000000..2e5cc89 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_back new file mode 100644 index 0000000..2e5cc89 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h new file mode 100644 index 0000000..6e5e433 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.back new file mode 100644 index 0000000..6e5e433 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.grpc_back new file mode 100644 index 0000000..6e5e433 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h new file mode 100644 index 0000000..c27189e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.back new file mode 100644 index 0000000..b163e6a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_back new file mode 100644 index 0000000..b163e6a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h new file mode 100644 index 0000000..32283ef --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.back new file mode 100644 index 0000000..fe08aa7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.grpc_back new file mode 100644 index 0000000..fe08aa7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h new file mode 100644 index 0000000..299d247 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h.back new file mode 100644 index 0000000..1d732eb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_back new file mode 100644 index 0000000..1d732eb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h new file mode 100644 index 0000000..39f6a85 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.back new file mode 100644 index 0000000..39f6a85 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.grpc_back new file mode 100644 index 0000000..39f6a85 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h new file mode 100644 index 0000000..ae570af --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h @@ -0,0 +1,5035 @@ +/* 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_H +#define OPENSSL_HEADER_SSL_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#endif + +// NGINX needs this #include. Consider revisiting this after NGINX 1.14.0 has +// been out for a year or so (assuming that they fix it in that release.) See +// https://boringssl-review.googlesource.com/c/boringssl/+/21664. +#include + +// Forward-declare struct timeval. On Windows, it is defined in winsock2.h and +// Windows headers define too many macros to be included in public headers. +// However, only a forward declaration is needed. +struct timeval; + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SSL implementation. + + +// SSL contexts. +// +// |SSL_CTX| objects manage shared state and configuration between multiple TLS +// or DTLS connections. Whether the connections are TLS or DTLS is selected by +// an |SSL_METHOD| on creation. +// +// |SSL_CTX| are reference-counted and may be shared by connections across +// 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 connections. +OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); + +// DTLS_method is the |SSL_METHOD| used for DTLS connections. +OPENSSL_EXPORT const SSL_METHOD *DTLS_method(void); + +// TLS_with_buffers_method is like |TLS_method|, but avoids all use of +// crypto/x509. All client connections created with |TLS_with_buffers_method| +// will fail unless a certificate verifier is installed with +// |SSL_set_custom_verify| or |SSL_CTX_set_custom_verify|. +OPENSSL_EXPORT const SSL_METHOD *TLS_with_buffers_method(void); + +// DTLS_with_buffers_method is like |DTLS_method|, but avoids all use of +// crypto/x509. +OPENSSL_EXPORT const SSL_METHOD *DTLS_with_buffers_method(void); + +// SSL_CTX_new returns a newly-allocated |SSL_CTX| with default settings or NULL +// on error. +OPENSSL_EXPORT SSL_CTX *SSL_CTX_new(const SSL_METHOD *method); + +// SSL_CTX_up_ref increments the reference count of |ctx|. It returns one. +OPENSSL_EXPORT int SSL_CTX_up_ref(SSL_CTX *ctx); + +// SSL_CTX_free releases memory associated with |ctx|. +OPENSSL_EXPORT void SSL_CTX_free(SSL_CTX *ctx); + + +// SSL connections. +// +// An |SSL| object represents a single TLS or DTLS connection. Although the +// shared |SSL_CTX| is thread-safe, an |SSL| is not thread-safe and may only be +// used on one thread at a time. + +// SSL_new returns a newly-allocated |SSL| using |ctx| or NULL on error. The new +// connection inherits settings from |ctx| at the time of creation. Settings may +// also be individually configured on the connection. +// +// On creation, an |SSL| is not configured to be either a client or server. Call +// |SSL_set_connect_state| or |SSL_set_accept_state| to set this. +OPENSSL_EXPORT SSL *SSL_new(SSL_CTX *ctx); + +// SSL_free releases memory associated with |ssl|. +OPENSSL_EXPORT void SSL_free(SSL *ssl); + +// SSL_get_SSL_CTX returns the |SSL_CTX| associated with |ssl|. If +// |SSL_set_SSL_CTX| is called, it returns the new |SSL_CTX|, not the initial +// one. +OPENSSL_EXPORT SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); + +// SSL_set_connect_state configures |ssl| to be a client. +OPENSSL_EXPORT void SSL_set_connect_state(SSL *ssl); + +// SSL_set_accept_state configures |ssl| to be a server. +OPENSSL_EXPORT void SSL_set_accept_state(SSL *ssl); + +// SSL_is_server returns one if |ssl| is configured as a server and zero +// otherwise. +OPENSSL_EXPORT int SSL_is_server(const SSL *ssl); + +// SSL_is_dtls returns one if |ssl| is a DTLS connection and zero otherwise. +OPENSSL_EXPORT int SSL_is_dtls(const SSL *ssl); + +// SSL_set_bio configures |ssl| to read from |rbio| and write to |wbio|. |ssl| +// takes ownership of the two |BIO|s. If |rbio| and |wbio| are the same, |ssl| +// only takes ownership of one reference. +// +// In DTLS, |rbio| must be non-blocking to properly handle timeouts and +// retransmits. +// +// If |rbio| is the same as the currently configured |BIO| for reading, that +// side is left untouched and is not freed. +// +// If |wbio| is the same as the currently configured |BIO| for writing AND |ssl| +// is not currently configured to read from and write to the same |BIO|, that +// side is left untouched and is not freed. This asymmetry is present for +// historical reasons. +// +// Due to the very complex historical behavior of this function, calling this +// function if |ssl| already has |BIO|s configured is deprecated. Prefer +// |SSL_set0_rbio| and |SSL_set0_wbio| instead. +OPENSSL_EXPORT void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); + +// SSL_set0_rbio configures |ssl| to write to |rbio|. It takes ownership of +// |rbio|. +// +// Note that, although this function and |SSL_set0_wbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_rbio(SSL *ssl, BIO *rbio); + +// SSL_set0_wbio configures |ssl| to write to |wbio|. It takes ownership of +// |wbio|. +// +// Note that, although this function and |SSL_set0_rbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_wbio(SSL *ssl, BIO *wbio); + +// SSL_get_rbio returns the |BIO| that |ssl| reads from. +OPENSSL_EXPORT BIO *SSL_get_rbio(const SSL *ssl); + +// SSL_get_wbio returns the |BIO| that |ssl| writes to. +OPENSSL_EXPORT BIO *SSL_get_wbio(const SSL *ssl); + +// SSL_get_fd calls |SSL_get_rfd|. +OPENSSL_EXPORT int SSL_get_fd(const SSL *ssl); + +// SSL_get_rfd returns the file descriptor that |ssl| is configured to read +// from. If |ssl|'s read |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_rfd(const SSL *ssl); + +// SSL_get_wfd returns the file descriptor that |ssl| is configured to write +// to. If |ssl|'s write |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_wfd(const SSL *ssl); + +// SSL_set_fd configures |ssl| to read from and write to |fd|. It returns one +// on success and zero on allocation error. The caller retains ownership of +// |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_fd(SSL *ssl, int fd); + +// SSL_set_rfd configures |ssl| to read from |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_rfd(SSL *ssl, int fd); + +// SSL_set_wfd configures |ssl| to write to |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd); + +// SSL_do_handshake continues the current handshake. If there is none or the +// handshake has completed or False Started, it returns one. Otherwise, it +// returns <= 0. The caller should pass the value into |SSL_get_error| to +// determine how to proceed. +// +// In DTLS, the caller must drive retransmissions. Whenever |SSL_get_error| +// signals |SSL_ERROR_WANT_READ|, use |DTLSv1_get_timeout| to determine the +// current timeout. If it expires before the next retry, call +// |DTLSv1_handle_timeout|. Note that DTLS handshake retransmissions use fresh +// sequence numbers, so it is not sufficient to replay packets at the transport. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_do_handshake(SSL *ssl); + +// SSL_connect configures |ssl| as a client, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_connect(SSL *ssl); + +// SSL_accept configures |ssl| as a server, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_accept(SSL *ssl); + +// SSL_read reads up to |num| bytes from |ssl| into |buf|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes read. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_read(SSL *ssl, void *buf, int num); + +// SSL_peek behaves like |SSL_read| but does not consume any bytes returned. +OPENSSL_EXPORT int SSL_peek(SSL *ssl, void *buf, int num); + +// SSL_pending returns the number of bytes available in |ssl|. It does not read +// from the transport. +OPENSSL_EXPORT int SSL_pending(const SSL *ssl); + +// SSL_write writes up to |num| bytes from |buf| into |ssl|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes written. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// In TLS, a non-blocking |SSL_write| differs from non-blocking |write| in that +// a failed |SSL_write| still commits to the data passed in. When retrying, the +// caller must supply the original write buffer (or a larger one containing the +// original as a prefix). By default, retries will fail if they also do not +// reuse the same |buf| pointer. This may be relaxed with +// |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER|, but the buffer contents still must be +// unchanged. +// +// By default, in TLS, |SSL_write| will not return success until all |num| bytes +// are written. This may be relaxed with |SSL_MODE_ENABLE_PARTIAL_WRITE|. It +// allows |SSL_write| to complete with a partial result when only part of the +// input was written in a single record. +// +// In DTLS, neither |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER| and +// |SSL_MODE_ENABLE_PARTIAL_WRITE| do anything. The caller may retry with a +// different buffer freely. A single call to |SSL_write| only ever writes a +// single record in a single packet, so |num| must be at most +// |SSL3_RT_MAX_PLAIN_LENGTH|. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); + +// 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. +// +// 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 +// enabled, |SSL_shutdown| will not send a close_notify alert or wait for one +// from the peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ctx|. +OPENSSL_EXPORT int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); + +// SSL_set_quiet_shutdown sets quiet shutdown on |ssl| to |mode|. If enabled, +// |SSL_shutdown| will not send a close_notify alert or wait for one from the +// peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_set_quiet_shutdown(SSL *ssl, int mode); + +// SSL_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ssl|. +OPENSSL_EXPORT int SSL_get_quiet_shutdown(const SSL *ssl); + +// SSL_get_error returns a |SSL_ERROR_*| value for the most recent operation on +// |ssl|. It should be called after an operation failed to determine whether the +// error was fatal and, if not, when to retry. +OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); + +// SSL_ERROR_NONE indicates the operation succeeded. +#define SSL_ERROR_NONE 0 + +// SSL_ERROR_SSL indicates the operation failed within the library. The caller +// may inspect the error queue for more information. +#define SSL_ERROR_SSL 1 + +// SSL_ERROR_WANT_READ indicates the operation failed attempting to read from +// the transport. The caller may retry the operation when the transport is ready +// for reading. +// +// If signaled by a DTLS handshake, the caller must also call +// |DTLSv1_get_timeout| and |DTLSv1_handle_timeout| as appropriate. See +// |SSL_do_handshake|. +#define SSL_ERROR_WANT_READ 2 + +// SSL_ERROR_WANT_WRITE indicates the operation failed attempting to write to +// the transport. The caller may retry the operation when the transport is ready +// for writing. +#define SSL_ERROR_WANT_WRITE 3 + +// SSL_ERROR_WANT_X509_LOOKUP indicates the operation failed in calling the +// |cert_cb| or |client_cert_cb|. The caller may retry the operation when the +// callback is ready to return a certificate or one has been configured +// externally. +// +// See also |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb|. +#define SSL_ERROR_WANT_X509_LOOKUP 4 + +// SSL_ERROR_SYSCALL indicates the operation failed externally to the library. +// The caller should consult the system-specific error mechanism. This is +// typically |errno| but may be something custom if using a custom |BIO|. It +// may also be signaled if the transport returned EOF, in which case the +// operation's return value will be zero. +#define SSL_ERROR_SYSCALL 5 + +// SSL_ERROR_ZERO_RETURN indicates the operation failed because the connection +// was cleanly shut down with a close_notify alert. +#define SSL_ERROR_ZERO_RETURN 6 + +// SSL_ERROR_WANT_CONNECT indicates the operation failed attempting to connect +// the transport (the |BIO| signaled |BIO_RR_CONNECT|). The caller may retry the +// operation when the transport is ready. +#define SSL_ERROR_WANT_CONNECT 7 + +// SSL_ERROR_WANT_ACCEPT indicates the operation failed attempting to accept a +// connection from the transport (the |BIO| signaled |BIO_RR_ACCEPT|). The +// caller may retry the operation when the transport is ready. +// +// TODO(davidben): Remove this. It's used by accept BIOs which are bizarre. +#define SSL_ERROR_WANT_ACCEPT 8 + +// SSL_ERROR_WANT_CHANNEL_ID_LOOKUP indicates the operation failed looking up +// the Channel ID key. The caller may retry the operation when |channel_id_cb| +// is ready to return a key or one has been configured with +// |SSL_set1_tls_channel_id|. +// +// See also |SSL_CTX_set_channel_id_cb|. +#define SSL_ERROR_WANT_CHANNEL_ID_LOOKUP 9 + +// SSL_ERROR_PENDING_SESSION indicates the operation failed because the session +// lookup callback indicated the session was unavailable. The caller may retry +// the operation when lookup has completed. +// +// See also |SSL_CTX_sess_set_get_cb| and |SSL_magic_pending_session_ptr|. +#define SSL_ERROR_PENDING_SESSION 11 + +// SSL_ERROR_PENDING_CERTIFICATE indicates the operation failed because the +// early callback indicated certificate lookup was incomplete. The caller may +// retry the operation when lookup has completed. +// +// See also |SSL_CTX_set_select_certificate_cb|. +#define SSL_ERROR_PENDING_CERTIFICATE 12 + +// SSL_ERROR_WANT_PRIVATE_KEY_OPERATION indicates the operation failed because +// a private key operation was unfinished. The caller may retry the operation +// when the private key operation is complete. +// +// See also |SSL_set_private_key_method| and +// |SSL_CTX_set_private_key_method|. +#define SSL_ERROR_WANT_PRIVATE_KEY_OPERATION 13 + +// SSL_ERROR_PENDING_TICKET indicates that a ticket decryption is pending. The +// caller may retry the operation when the decryption is ready. +// +// See also |SSL_CTX_set_ticket_aead_method|. +#define SSL_ERROR_PENDING_TICKET 14 + +// SSL_ERROR_EARLY_DATA_REJECTED indicates that early data was rejected. The +// caller should treat this as a connection failure and retry any operations +// associated with the rejected early data. |SSL_reset_early_data_reject| may be +// used to reuse the underlying connection for the retry. +#define SSL_ERROR_EARLY_DATA_REJECTED 15 + +// SSL_ERROR_WANT_CERTIFICATE_VERIFY indicates the operation failed because +// certificate verification was incomplete. The caller may retry the operation +// when certificate verification is complete. +// +// See also |SSL_CTX_set_custom_verify|. +#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. +OPENSSL_EXPORT int SSL_set_mtu(SSL *ssl, unsigned mtu); + +// DTLSv1_set_initial_timeout_duration sets the initial duration for a DTLS +// handshake timeout. +// +// This duration overrides the default of 1 second, which is the strong +// recommendation of RFC 6347 (see section 4.2.4.1). However, there may exist +// situations where a shorter timeout would be beneficial, such as for +// time-sensitive applications. +OPENSSL_EXPORT void DTLSv1_set_initial_timeout_duration(SSL *ssl, + unsigned duration_ms); + +// DTLSv1_get_timeout queries the next DTLS handshake timeout. If there is a +// timeout in progress, it sets |*out| to the time remaining and returns one. +// Otherwise, it returns zero. +// +// When the timeout expires, call |DTLSv1_handle_timeout| to handle the +// retransmit behavior. +// +// NOTE: This function must be queried again whenever the handshake state +// machine changes, including when |DTLSv1_handle_timeout| is called. +OPENSSL_EXPORT int DTLSv1_get_timeout(const SSL *ssl, struct timeval *out); + +// DTLSv1_handle_timeout is called when a DTLS handshake timeout expires. If no +// timeout had expired, it returns 0. Otherwise, it retransmits the previous +// flight of handshake messages and returns 1. If too many timeouts had expired +// without progress or an error occurs, it returns -1. +// +// The caller's external timer should be compatible with the one |ssl| queries +// within some fudge factor. Otherwise, the call will be a no-op, but +// |DTLSv1_get_timeout| will return an updated timeout. +// +// If the function returns -1, checking if |SSL_get_error| returns +// |SSL_ERROR_WANT_WRITE| may be used to determine if the retransmit failed due +// to a non-fatal error at the write |BIO|. However, the operation may not be +// retried until the next timeout fires. +// +// WARNING: This function breaks the usual return value convention. +// +// TODO(davidben): This |SSL_ERROR_WANT_WRITE| behavior is kind of bizarre. +OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); + + +// Protocol versions. + +#define DTLS1_VERSION_MAJOR 0xfe +#define SSL3_VERSION_MAJOR 0x03 + +#define SSL3_VERSION 0x0300 +#define TLS1_VERSION 0x0301 +#define TLS1_1_VERSION 0x0302 +#define TLS1_2_VERSION 0x0303 +#define TLS1_3_VERSION 0x0304 + +#define DTLS1_VERSION 0xfeff +#define DTLS1_2_VERSION 0xfefd + +// 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. +OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, + uint16_t version); + +// SSL_CTX_set_max_proto_version sets the maximum protocol version for |ctx| to +// |version|. If |version| is zero, the default maximum version is used. It +// returns one on success and zero if |version| is invalid. +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. +OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); + +// SSL_set_max_proto_version sets the maximum protocol version for |ssl| to +// |version|. If |version| is zero, the default maximum version is used. It +// 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. +OPENSSL_EXPORT int SSL_version(const SSL *ssl); + + +// Options. +// +// Options configure protocol behavior. + +// SSL_OP_NO_QUERY_MTU, in DTLS, disables querying the MTU from the underlying +// |BIO|. Instead, the MTU is configured with |SSL_set_mtu|. +#define SSL_OP_NO_QUERY_MTU 0x00001000L + +// SSL_OP_NO_TICKET disables session ticket support (RFC 5077). +#define SSL_OP_NO_TICKET 0x00004000L + +// SSL_OP_CIPHER_SERVER_PREFERENCE configures servers to select ciphers and +// ECDHE curves according to the server's preferences instead of the +// client's. +#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L + +// 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_TLSv1 0x04000000L +#define SSL_OP_NO_TLSv1_2 0x08000000L +#define SSL_OP_NO_TLSv1_1 0x10000000L +#define SSL_OP_NO_TLSv1_3 0x20000000L +#define SSL_OP_NO_DTLSv1 SSL_OP_NO_TLSv1 +#define SSL_OP_NO_DTLSv1_2 SSL_OP_NO_TLSv1_2 + +// SSL_CTX_set_options enables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_clear_options disables all options set in |options| (which should be +// one or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_get_options returns a bitmask of |SSL_OP_*| values that represent all +// the options enabled for |ctx|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_options(const SSL_CTX *ctx); + +// SSL_set_options enables all options set in |options| (which should be one or +// more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_set_options(SSL *ssl, uint32_t options); + +// SSL_clear_options disables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_clear_options(SSL *ssl, uint32_t options); + +// SSL_get_options returns a bitmask of |SSL_OP_*| values that represent all the +// options enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); + + +// Modes. +// +// Modes configure API behavior. + +// SSL_MODE_ENABLE_PARTIAL_WRITE, in TLS, allows |SSL_write| to complete with a +// partial result when the only part of the input was written in a single +// record. In DTLS, it does nothing. +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L + +// SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, in TLS, allows retrying an incomplete +// |SSL_write| with a different buffer. However, |SSL_write| still assumes the +// buffer contents are unchanged. This is not the default to avoid the +// misconception that non-blocking |SSL_write| behaves like non-blocking +// |write|. In DTLS, it does nothing. +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L + +// SSL_MODE_NO_AUTO_CHAIN disables automatically building a certificate chain +// before sending certificates to the peer. This flag is set (and the feature +// disabled) by default. +// TODO(davidben): Remove this behavior. https://crbug.com/boringssl/42. +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L + +// SSL_MODE_ENABLE_FALSE_START allows clients to send application data before +// receipt of ChangeCipherSpec and Finished. This mode enables full handshakes +// to 'complete' in one RTT. See RFC 7918. +// +// When False Start is enabled, |SSL_do_handshake| may succeed before the +// handshake has completely finished. |SSL_write| will function at this point, +// and |SSL_read| will transparently wait for the final handshake leg before +// returning application data. To determine if False Start occurred or when the +// handshake is completely finished, see |SSL_in_false_start|, |SSL_in_init|, +// 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 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 +// fail with SSL_R_SESSION_MAY_NOT_BE_CREATED. This can be used to enforce that +// session resumption is used for a given SSL*. +#define SSL_MODE_NO_SESSION_CREATION 0x00000200L + +// SSL_MODE_SEND_FALLBACK_SCSV sends TLS_FALLBACK_SCSV in the ClientHello. +// To be set only by applications that reconnect with a downgraded protocol +// version; see RFC 7507 for details. +// +// DO NOT ENABLE THIS if your application attempts a normal handshake. Only use +// this in explicit fallback retries, following the guidance in RFC 7507. +#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000400L + +// SSL_CTX_set_mode enables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_clear_mode disables all modes set in |mode| (which should be one or +// more of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_get_mode returns a bitmask of |SSL_MODE_*| values that represent all +// the modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx); + +// SSL_set_mode enables all modes set in |mode| (which should be one or more of +// the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_set_mode(SSL *ssl, uint32_t mode); + +// SSL_clear_mode disables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode); + +// SSL_get_mode returns a bitmask of |SSL_MODE_*| values that represent all the +// modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_mode(const SSL *ssl); + +// SSL_CTX_set0_buffer_pool sets a |CRYPTO_BUFFER_POOL| that will be used to +// store certificates. This can allow multiple connections to share +// certificates and thus save memory. +// +// The SSL_CTX does not take ownership of |pool| and the caller must ensure +// that |pool| outlives |ctx| and all objects linked to it, including |SSL|, +// |X509| and |SSL_SESSION| objects. Basically, don't ever free |pool|. +OPENSSL_EXPORT void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, + CRYPTO_BUFFER_POOL *pool); + + +// Configuring certificates and private keys. +// +// These functions configure the connection's leaf certificate, private key, and +// certificate chain. The certificate chain is ordered leaf to root (as sent on +// the wire) but does not include the leaf. Both client and server certificates +// use these functions. +// +// Certificates and keys may be configured before the handshake or dynamically +// in the early callback and certificate callback. + +// SSL_CTX_use_certificate sets |ctx|'s leaf certificate to |x509|. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x509); + +// SSL_use_certificate sets |ssl|'s leaf certificate to |x509|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_use_certificate(SSL *ssl, X509 *x509); + +// SSL_CTX_use_PrivateKey sets |ctx|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); + +// SSL_use_PrivateKey sets |ssl|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); + +// SSL_CTX_set0_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_CTX_set1_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_set0_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_set1_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_CTX_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On +// success, it returns one and takes ownership of |x509|. Otherwise, it returns +// zero. +OPENSSL_EXPORT int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_CTX_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It +// returns one on success and zero on failure. The caller retains ownership of +// |x509| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On success, +// it returns one and takes ownership of |x509|. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_add0_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_add_extra_chain_cert calls |SSL_CTX_add0_chain_cert|. +OPENSSL_EXPORT int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It returns +// one on success and zero on failure. The caller retains ownership of |x509| +// and may release it freely. +OPENSSL_EXPORT int SSL_add1_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_clear_chain_certs clears |ctx|'s certificate chain and returns +// one. +OPENSSL_EXPORT int SSL_CTX_clear_chain_certs(SSL_CTX *ctx); + +// SSL_CTX_clear_extra_chain_certs calls |SSL_CTX_clear_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); + +// SSL_clear_chain_certs clears |ssl|'s certificate chain and returns one. +OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); + +// SSL_CTX_set_cert_cb sets a callback that is called to select a certificate. +// The callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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_CTX_set_cert_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, void *arg), + void *arg); + +// SSL_set_cert_cb sets a callback that is called to select a certificate. The +// callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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. 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(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); + +// SSL_CTX_check_private_key returns one if the certificate and private key +// configured in |ctx| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_check_private_key(const SSL_CTX *ctx); + +// SSL_check_private_key returns one if the certificate and private key +// configured in |ssl| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_check_private_key(const SSL *ssl); + +// SSL_CTX_get0_certificate returns |ctx|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); + +// SSL_get_certificate returns |ssl|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_get_certificate(const SSL *ssl); + +// SSL_CTX_get0_privatekey returns |ctx|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); + +// SSL_get_privatekey returns |ssl|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_get_privatekey(const SSL *ssl); + +// SSL_CTX_get0_chain_certs sets |*out_chain| to |ctx|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_CTX_get_extra_chain_certs calls |SSL_CTX_get0_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_get0_chain_certs sets |*out_chain| to |ssl|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_get0_chain_certs(const SSL *ssl, + STACK_OF(X509) **out_chain); + +// SSL_CTX_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request it. The |list| argument must +// contain one or more SCT structures serialised as a SignedCertificateTimestamp +// List (see https://tools.ietf.org/html/rfc6962#section-3.3) – i.e. each SCT +// is prefixed by a big-endian, uint16 length and the concatenation of one or +// more such prefixed SCTs are themselves also prefixed by a uint16 length. It +// returns one on success and zero on error. The caller retains ownership of +// |list|. +OPENSSL_EXPORT int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request is. The same format as the +// one used for |SSL_CTX_set_signed_cert_timestamp_list| applies. The caller +// retains ownership of |list|. +OPENSSL_EXPORT int SSL_set_signed_cert_timestamp_list(SSL *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_CTX_set_ocsp_response sets the OCSP response that is sent to clients +// which request it. It returns one on success and zero on error. The caller +// retains ownership of |response|. +OPENSSL_EXPORT int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, + const uint8_t *response, + size_t response_len); + +// SSL_set_ocsp_response sets the OCSP response that is sent to clients which +// request it. It returns one on success and zero on error. The caller retains +// ownership of |response|. +OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, + const uint8_t *response, + size_t response_len); + +// SSL_SIGN_* are signature algorithm values as defined in TLS 1.3. +#define SSL_SIGN_RSA_PKCS1_SHA1 0x0201 +#define SSL_SIGN_RSA_PKCS1_SHA256 0x0401 +#define SSL_SIGN_RSA_PKCS1_SHA384 0x0501 +#define SSL_SIGN_RSA_PKCS1_SHA512 0x0601 +#define SSL_SIGN_ECDSA_SHA1 0x0203 +#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_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 +// specify raw RSASSA-PKCS1-v1_5 with an MD5/SHA-1 concatenation, as used in TLS +// before TLS 1.2. +#define SSL_SIGN_RSA_PKCS1_MD5_SHA1 0xff01 + +// SSL_get_signature_algorithm_name returns a human-readable name for |sigalg|, +// or NULL if unknown. If |include_curve| is one, the curve for ECDSA algorithms +// is included as in TLS 1.3. Otherwise, it is excluded as in TLS 1.2. +OPENSSL_EXPORT const char *SSL_get_signature_algorithm_name(uint16_t sigalg, + int include_curve); + +// SSL_get_signature_algorithm_key_type returns the key type associated with +// |sigalg| as an |EVP_PKEY_*| constant or |EVP_PKEY_NONE| if unknown. +OPENSSL_EXPORT int SSL_get_signature_algorithm_key_type(uint16_t sigalg); + +// SSL_get_signature_algorithm_digest returns the digest function associated +// with |sigalg| or |NULL| if |sigalg| has no prehash (Ed25519) or is unknown. +OPENSSL_EXPORT const EVP_MD *SSL_get_signature_algorithm_digest( + uint16_t sigalg); + +// SSL_is_signature_algorithm_rsa_pss returns one if |sigalg| is an RSA-PSS +// signature algorithm and zero otherwise. +OPENSSL_EXPORT int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg); + +// SSL_CTX_set_signing_algorithm_prefs configures |ctx| to use |prefs| as the +// preference list when signing with |ctx|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + +// SSL_set_signing_algorithm_prefs configures |ssl| to use |prefs| as the +// preference list when signing with |ssl|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_set_signing_algorithm_prefs(SSL *ssl, + const uint16_t *prefs, + size_t num_prefs); + + +// Certificate and private key convenience functions. + +// SSL_CTX_set_chain_and_key sets the certificate chain and private key for a +// TLS client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_set_chain_and_key sets the certificate chain and private key for a TLS +// client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_CTX_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); + +// SSL_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); + +// The following functions configure certificates or private keys but take as +// input DER-encoded structures. They return one on success and zero on +// failure. + +OPENSSL_EXPORT int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, + const uint8_t *der); +OPENSSL_EXPORT int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, + const uint8_t *der, size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +// The following functions configure certificates or private keys but take as +// input files to read from. They return one on success and zero on failure. The +// |type| parameter is one of the |SSL_FILETYPE_*| values and determines whether +// the file's contents are read as PEM or DER. + +#define SSL_FILETYPE_PEM 1 +#define SSL_FILETYPE_ASN1 2 + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, + const char *file, + int type); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_certificate_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_PrivateKey_file(SSL *ssl, const char *file, + int type); + +// SSL_CTX_use_certificate_chain_file configures certificates for |ctx|. It +// reads the contents of |file| as a PEM-encoded leaf certificate followed +// optionally by the certificate chain to send to the peer. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, + const char *file); + +// SSL_CTX_set_default_passwd_cb sets the password callback for PEM-based +// convenience functions called on |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, + pem_password_cb *cb); + +// SSL_CTX_get_default_passwd_cb returns the callback set by +// |SSL_CTX_set_default_passwd_cb|. +OPENSSL_EXPORT pem_password_cb *SSL_CTX_get_default_passwd_cb( + const SSL_CTX *ctx); + +// SSL_CTX_set_default_passwd_cb_userdata sets the userdata parameter for +// |ctx|'s password callback. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, + void *data); + +// SSL_CTX_get_default_passwd_cb_userdata returns the userdata parameter set by +// |SSL_CTX_set_default_passwd_cb_userdata|. +OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); + + +// Custom private keys. + +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { + ssl_private_key_success, + ssl_private_key_retry, + ssl_private_key_failure, +}; + +// ssl_private_key_method_st (aka |SSL_PRIVATE_KEY_METHOD|) describes private +// key hooks. This is used to off-load signing operations to a custom, +// potentially asynchronous, backend. Metadata about the key such as the type +// and size are parsed out of the certificate. +struct ssl_private_key_method_st { + // sign signs the message |in| in using the specified signature algorithm. On + // success, it returns |ssl_private_key_success| and writes at most |max_out| + // bytes of signature data to |out| and sets |*out_len| to the number of bytes + // written. On failure, it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. |sign| should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed. This will result in a call to |complete|. + // + // |signature_algorithm| is one of the |SSL_SIGN_*| values, as defined in TLS + // 1.3. Note that, in TLS 1.2, ECDSA algorithms do not require that curve + // sizes match hash sizes, so the curve portion of |SSL_SIGN_ECDSA_*| values + // must be ignored. BoringSSL will internally handle the curve matching logic + // where appropriate. + // + // It is an error to call |sign| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*sign)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out, + uint16_t signature_algorithm, + const uint8_t *in, size_t in_len); + + // decrypt decrypts |in_len| bytes of encrypted data from |in|. On success it + // returns |ssl_private_key_success|, writes at most |max_out| bytes of + // decrypted data to |out| and sets |*out_len| to the actual number of bytes + // written. On failure it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. The caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in a call to |complete|. This + // function only works with RSA keys and should perform a raw RSA decryption + // operation with no padding. + // + // It is an error to call |decrypt| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*decrypt)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + + // complete completes a pending operation. If the operation has completed, it + // returns |ssl_private_key_success| and writes the result to |out| as in + // |sign|. Otherwise, it returns |ssl_private_key_failure| on failure and + // |ssl_private_key_retry| if the operation is still in progress. + // + // |complete| may be called arbitrarily many times before completion, but it + // is an error to call |complete| if there is no pending operation in progress + // on |ssl|. + enum ssl_private_key_result_t (*complete)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); +}; + +// SSL_set_private_key_method configures a custom private key on |ssl|. +// |key_method| must remain valid for the lifetime of |ssl|. +OPENSSL_EXPORT void SSL_set_private_key_method( + SSL *ssl, const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_CTX_set_private_key_method configures a custom private key on |ctx|. +// |key_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_private_key_method( + SSL_CTX *ctx, const SSL_PRIVATE_KEY_METHOD *key_method); + + +// Cipher suites. +// +// |SSL_CIPHER| objects represent cipher suites. + +DEFINE_CONST_STACK_OF(SSL_CIPHER) + +// SSL_get_cipher_by_value returns the structure representing a TLS cipher +// suite based on its assigned number, or NULL if unknown. See +// 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 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); + +// SSL_CIPHER_is_block_cipher returns one if |cipher| is a block cipher. +OPENSSL_EXPORT int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_cipher_nid returns the NID for |cipher|'s bulk +// cipher. Possible values are |NID_aes_128_gcm|, |NID_aes_256_gcm|, +// |NID_chacha20_poly1305|, |NID_aes_128_cbc|, |NID_aes_256_cbc|, and +// |NID_des_ede3_cbc|. +OPENSSL_EXPORT int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_digest_nid returns the NID for |cipher|'s HMAC if it is a +// legacy cipher suite. For modern AEAD-based ciphers (see +// |SSL_CIPHER_is_aead|), it returns |NID_undef|. +// +// Note this function only returns the legacy HMAC digest, not the PRF hash. +OPENSSL_EXPORT int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_kx_nid returns the NID for |cipher|'s key exchange. This may +// be |NID_kx_rsa|, |NID_kx_ecdhe|, or |NID_kx_psk| for TLS 1.2. In TLS 1.3, +// cipher suites do not specify the key exchange, so this function returns +// |NID_kx_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_auth_nid returns the NID for |cipher|'s authentication +// type. This may be |NID_auth_rsa|, |NID_auth_ecdsa|, or |NID_auth_psk| for TLS +// 1.2. In TLS 1.3, cipher suites do not specify authentication, so this +// function returns |NID_auth_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_prf_nid retuns the NID for |cipher|'s PRF hash. If |cipher| is +// a pre-TLS-1.2 cipher, it returns |NID_md5_sha1| but note these ciphers use +// SHA-256 in TLS 1.2. Other return values may be treated uniformly in all +// applicable versions. +OPENSSL_EXPORT int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_min_version returns the minimum protocol version required +// for |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_max_version returns the maximum protocol version that +// supports |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_standard_name returns the standard IETF name for |cipher|. For +// example, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256". +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". 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 +// method used by |cipher|. For example, "ECDHE_ECDSA". TLS 1.3 AEAD-only +// ciphers return the string "GENERIC". +OPENSSL_EXPORT const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_bits returns the strength, in bits, of |cipher|. If +// |out_alg_bits| is not NULL, it writes the number of bits consumed by the +// symmetric algorithm to |*out_alg_bits|. +OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, + int *out_alg_bits); + + +// Cipher suite configuration. +// +// OpenSSL uses a mini-language to configure cipher suites. The language +// maintains an ordered list of enabled ciphers, along with an ordered list of +// disabled but available ciphers. Initially, all ciphers are disabled with a +// default ordering. The cipher string is then interpreted as a sequence of +// directives, separated by colons, each of which modifies this state. +// +// Most directives consist of a one character or empty opcode followed by a +// selector which matches a subset of available ciphers. +// +// Available opcodes are: +// +// The empty opcode enables and appends all matching disabled ciphers to the +// end of the enabled list. The newly appended ciphers are ordered relative to +// each other matching their order in the disabled list. +// +// |-| disables all matching enabled ciphers and prepends them to the disabled +// list, with relative order from the enabled list preserved. This means the +// most recently disabled ciphers get highest preference relative to other +// disabled ciphers if re-enabled. +// +// |+| moves all matching enabled ciphers to the end of the enabled list, with +// relative order preserved. +// +// |!| deletes all matching ciphers, enabled or not, from either list. Deleted +// ciphers will not matched by future operations. +// +// A selector may be a specific cipher (using either the standard or OpenSSL +// name for the cipher) or one or more rules separated by |+|. The final +// selector matches the intersection of each rule. For instance, |AESGCM+aECDSA| +// matches ECDSA-authenticated AES-GCM ciphers. +// +// Available cipher rules are: +// +// |ALL| matches all ciphers. +// +// |kRSA|, |kDHE|, |kECDHE|, and |kPSK| match ciphers using plain RSA, DHE, +// ECDHE, and plain PSK key exchanges, respectively. Note that ECDHE_PSK is +// matched by |kECDHE| and not |kPSK|. +// +// |aRSA|, |aECDSA|, and |aPSK| match ciphers authenticated by RSA, ECDSA, and +// a pre-shared key, respectively. +// +// |RSA|, |DHE|, |ECDHE|, |PSK|, |ECDSA|, and |PSK| are aliases for the +// corresponding |k*| or |a*| cipher rule. |RSA| is an alias for |kRSA|, not +// |aRSA|. +// +// |3DES|, |AES128|, |AES256|, |AES|, |AESGCM|, |CHACHA20| match ciphers +// whose bulk cipher use the corresponding encryption scheme. Note that +// |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. +// +// |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. +// +// Deprecated cipher rules: +// +// |kEDH|, |EDH|, |kEECDH|, and |EECDH| are legacy aliases for |kDHE|, |DHE|, +// |kECDHE|, and |ECDHE|, respectively. +// +// |HIGH| is an alias for |ALL|. +// +// |FIPS| is an alias for |HIGH|. +// +// |SSLv3| and |TLSv1| match ciphers available in TLS 1.1 or earlier. +// |TLSv1_2| matches ciphers new in TLS 1.2. This is confusing and should not +// be used. +// +// Unknown rules are silently ignored by legacy APIs, and rejected by APIs with +// "strict" in the name, which should be preferred. Cipher lists can be long +// and it's easy to commit typos. Strict functions will also reject the use of +// spaces, semi-colons and commas as alternative separators. +// +// The special |@STRENGTH| directive will sort all enabled ciphers by strength. +// +// The |DEFAULT| directive, when appearing at the front of the string, expands +// to the default ordering of available ciphers. +// +// If configuring a server, one may also configure equal-preference groups to +// partially respect the client's preferences when +// |SSL_OP_CIPHER_SERVER_PREFERENCE| is enabled. Ciphers in an equal-preference +// group have equal priority and use the client order. This may be used to +// enforce that AEADs are preferred but select AES-GCM vs. ChaCha20-Poly1305 +// based on client preferences. An equal-preference is specified with square +// brackets, combining multiple selectors separated by |. For example: +// +// [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. +// +// TLS 1.3 ciphers do not participate in this mechanism and instead have a +// built-in preference order. Functions to set cipher lists do not affect TLS +// 1.3, and functions to query the cipher list do not include TLS 1.3 +// ciphers. + +// SSL_DEFAULT_CIPHER_LIST is the default cipher suite configuration. It is +// substituted when a cipher string starts with 'DEFAULT'. +#define SSL_DEFAULT_CIPHER_LIST "ALL" + +// SSL_CTX_set_strict_cipher_list configures the cipher list for |ctx|, +// evaluating |str| as a cipher string and returning error if |str| contains +// anything meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, + const char *str); + +// SSL_CTX_set_cipher_list configures the cipher list for |ctx|, evaluating +// |str| as a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_CTX_set_strict_cipher_list|. This function tolerates +// garbage inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); + +// SSL_set_strict_cipher_list configures the cipher list for |ssl|, evaluating +// |str| as a cipher string and returning error if |str| contains anything +// meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_set_strict_cipher_list(SSL *ssl, const char *str); + +// SSL_set_cipher_list configures the cipher list for |ssl|, evaluating |str| as +// a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_set_strict_cipher_list|. This function tolerates garbage +// inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_set_cipher_list(SSL *ssl, const char *str); + +// SSL_CTX_get_ciphers returns the cipher list for |ctx|, in order of +// preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); + +// SSL_CTX_cipher_in_group returns one if the |i|th cipher (see +// |SSL_CTX_get_ciphers|) is in the same equipreference group as the one +// following it and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i); + +// SSL_get_ciphers returns the cipher list for |ssl|, in order of preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl); + + +// Connection information. + +// SSL_is_init_finished returns one if |ssl| has completed its initial handshake +// and has no pending handshake. It returns zero otherwise. +OPENSSL_EXPORT int SSL_is_init_finished(const SSL *ssl); + +// SSL_in_init returns one if |ssl| has a pending handshake and zero +// otherwise. +OPENSSL_EXPORT int SSL_in_init(const SSL *ssl); + +// SSL_in_false_start returns one if |ssl| has a pending handshake that is in +// False Start. |SSL_write| may be called at this point without waiting for the +// peer, but |SSL_read| will complete the handshake before accepting application +// data. +// +// See also |SSL_MODE_ENABLE_FALSE_START|. +OPENSSL_EXPORT int SSL_in_false_start(const SSL *ssl); + +// SSL_get_peer_certificate returns the peer's leaf certificate or NULL if the +// peer did not use certificates. The caller must call |X509_free| on the +// result to release it. +OPENSSL_EXPORT X509 *SSL_get_peer_certificate(const SSL *ssl); + +// SSL_get_peer_cert_chain returns the peer's certificate chain or NULL if +// unavailable or 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. +// +// WARNING: This function behaves differently between client and server. If +// |ssl| is a server, the returned chain does not include the leaf certificate. +// If a client, it does. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); + +// SSL_get_peer_full_cert_chain returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the same as |SSL_get_peer_cert_chain| except that this function +// always returns the full chain, i.e. the first element of the return value +// (if any) will be the leaf certificate. In constrast, +// |SSL_get_peer_cert_chain| returns only the intermediate certificates if the +// |ssl| is a server. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); + +// SSL_get0_peer_certificates returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. +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 +// |*out_len| bytes of SCT information from the server. This is only valid if +// |ssl| is a client. 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_get0_signed_cert_timestamp_list(const SSL *ssl, + const uint8_t **out, + size_t *out_len); + +// SSL_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_get0_ocsp_response(const SSL *ssl, const uint8_t **out, + size_t *out_len); + +// SSL_get_tls_unique writes at most |max_out| bytes of the tls-unique value +// for |ssl| to |out| and sets |*out_len| to the number of bytes written. It +// returns one on success or zero on error. In general |max_out| should be at +// least 12. +// +// This function will always fail if the initial handshake has not completed. +// The tls-unique value will change after a renegotiation but, since +// renegotiations can be initiated by the server at any point, the higher-level +// protocol must either leave them disabled or define states in which the +// tls-unique value can be read. +// +// The tls-unique value is defined by +// https://tools.ietf.org/html/rfc5929#section-3.1. Due to a weakness in the +// TLS protocol, tls-unique is broken for resumed connections unless the +// Extended Master Secret extension is negotiated. Thus this function will +// return zero if |ssl| performed session resumption unless EMS was used when +// negotiating the original session. +OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); + +// SSL_get_extms_support returns one if the Extended Master Secret extension or +// TLS 1.3 was negotiated. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); + +// 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 +// and zero otherwise. +// +// TODO(davidben): Hammer down the semantics of this API while a handshake, +// initial or renego, is in progress. +OPENSSL_EXPORT int SSL_session_reused(const SSL *ssl); + +// SSL_get_secure_renegotiation_support returns one if the peer supports secure +// renegotiation (RFC 5746) or TLS 1.3. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_secure_renegotiation_support(const SSL *ssl); + +// SSL_export_keying_material exports a value derived from the master secret, as +// specified in RFC 5705. It writes |out_len| bytes to |out| given a label and +// optional context. (Since a zero length context is allowed, the |use_context| +// flag controls whether a context is included.) +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT 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); + + +// Sessions. +// +// An |SSL_SESSION| represents an SSL session that may be resumed in an +// abbreviated handshake. It is reference-counted and immutable. Once +// established, an |SSL_SESSION| may be shared by multiple |SSL| objects on +// different threads and must not be modified. + +DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + +// SSL_SESSION_new returns a newly-allocated blank |SSL_SESSION| or NULL on +// error. This may be useful when writing tests but should otherwise not be +// used. +OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_new(const SSL_CTX *ctx); + +// SSL_SESSION_up_ref increments the reference count of |session| and returns +// one. +OPENSSL_EXPORT int SSL_SESSION_up_ref(SSL_SESSION *session); + +// SSL_SESSION_free decrements the reference count of |session|. If it reaches +// zero, all data referenced by |session| and |session| itself are released. +OPENSSL_EXPORT void SSL_SESSION_free(SSL_SESSION *session); + +// SSL_SESSION_to_bytes serializes |in| into a newly allocated buffer and sets +// |*out_data| to that buffer and |*out_len| to its length. The caller takes +// ownership of the buffer and must call |OPENSSL_free| when done. It returns +// one on success and zero on error. +OPENSSL_EXPORT int SSL_SESSION_to_bytes(const SSL_SESSION *in, + uint8_t **out_data, size_t *out_len); + +// SSL_SESSION_to_bytes_for_ticket serializes |in|, but excludes the session +// identification information, namely the session ID and ticket. +OPENSSL_EXPORT int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, + uint8_t **out_data, + size_t *out_len); + +// SSL_SESSION_from_bytes parses |in_len| bytes from |in| as an SSL_SESSION. It +// returns a newly-allocated |SSL_SESSION| on success or NULL on error. +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 "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| +// was established at. +OPENSSL_EXPORT uint16_t +SSL_SESSION_get_protocol_version(const SSL_SESSION *session); + +// SSL_SESSION_set_protocol_version sets |session|'s TLS or DTLS version to +// |version|. This may be useful when writing tests but should otherwise not be +// used. It returns one on success and zero on error. +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); + +// SSL_SESSION_get_timeout returns the lifetime of |session| in seconds. +OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer returns the peer leaf certificate stored in +// |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. +OPENSSL_EXPORT size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, + uint8_t *out, size_t max_out); + +// SSL_SESSION_set_time sets |session|'s creation time to |time| and returns +// |time|. This function may be useful in writing tests but otherwise should not +// be used. +OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, + uint64_t time); + +// SSL_SESSION_set_timeout sets |session|'s timeout to |timeout| and returns +// one. This function may be useful in writing tests but otherwise should not +// be used. +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 +// should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_SESSION_should_be_single_use returns one if |session| should be +// single-use (TLS 1.3 and later) and zero otherwise. +// +// If this function returns one, clients retain multiple sessions and use each +// only once. This prevents passive observers from correlating connections with +// 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 +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_is_resumable(const SSL_SESSION *session); + +// SSL_SESSION_has_ticket returns one if |session| has a ticket and zero +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_has_ticket(const SSL_SESSION *session); + +// SSL_SESSION_get0_ticket sets |*out_ticket| and |*out_len| to |session|'s +// ticket, or NULL and zero if it does not have one. |out_ticket| may be NULL +// if only the ticket length is needed. +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. +// +// Session caching allows connections to be established more efficiently based +// on saved parameters from a previous connection, called a session (see +// |SSL_SESSION|). The client offers a saved session, using an opaque identifier +// from a previous connection. The server may accept the session, if it has the +// parameters available. Otherwise, it will decline and continue with a full +// handshake. +// +// This requires both the client and the server to retain session state. A +// client does so with a stateful session cache. A server may do the same or, if +// supported by both sides, statelessly using session tickets. For more +// information on the latter, see the next section. +// +// For a server, the library implements a built-in internal session cache as an +// in-memory hash table. Servers may also use |SSL_CTX_sess_set_get_cb| and +// |SSL_CTX_sess_set_new_cb| to implement a custom external session cache. In +// particular, this may be used to share a session cache between multiple +// servers in a large deployment. An external cache may be used in addition to +// or instead of the internal one. Use |SSL_CTX_set_session_cache_mode| to +// toggle the internal cache. +// +// For a client, the only option is an external session cache. Clients may use +// |SSL_CTX_sess_set_new_cb| to register a callback for when new sessions are +// available. These may be cached and, in subsequent compatible connections, +// configured with |SSL_set_session|. +// +// Note that offering or accepting a session short-circuits certificate +// verification and most parameter negotiation. Resuming sessions across +// different contexts may result in security failures and surprising +// behavior. For a typical client, this means sessions for different hosts must +// be cached under different keys. A client that connects to the same host with, +// e.g., different cipher suite settings or client certificates should also use +// separate session caches between those contexts. Servers should also partition +// session caches between SNI hosts with |SSL_CTX_set_session_id_context|. +// +// Note also, in TLS 1.2 and earlier, offering sessions allows passive observers +// to correlate different client connections. TLS 1.3 and later fix this, +// provided clients use sessions at most once. Session caches are managed by the +// caller in BoringSSL, so this must be implemented externally. See +// |SSL_SESSION_should_be_single_use| for details. + +// SSL_SESS_CACHE_OFF disables all session caching. +#define SSL_SESS_CACHE_OFF 0x0000 + +// SSL_SESS_CACHE_CLIENT enables session caching for a client. The internal +// cache is never used on a client, so this only enables the callbacks. +#define SSL_SESS_CACHE_CLIENT 0x0001 + +// SSL_SESS_CACHE_SERVER enables session caching for a server. +#define SSL_SESS_CACHE_SERVER 0x0002 + +// SSL_SESS_CACHE_BOTH enables session caching for both client and server. +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER) + +// SSL_SESS_CACHE_NO_AUTO_CLEAR disables automatically calling +// |SSL_CTX_flush_sessions| every 255 connections. +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 + +// SSL_SESS_CACHE_NO_INTERNAL_LOOKUP, on a server, disables looking up a session +// from the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 + +// SSL_SESS_CACHE_NO_INTERNAL_STORE, on a server, disables storing sessions in +// the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 + +// SSL_SESS_CACHE_NO_INTERNAL, on a server, disables the internal session +// cache. +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) + +// SSL_CTX_set_session_cache_mode sets the session cache mode bits for |ctx| to +// |mode|. It returns the previous value. +OPENSSL_EXPORT int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_session_cache_mode returns the session cache mode bits for +// |ctx| +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|. 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); + +// SSL_DEFAULT_SESSION_TIMEOUT is the default lifetime, in seconds, of a +// session in TLS 1.2 or earlier. This is how long we are willing to use the +// secret to encrypt traffic without fresh key material. +#define SSL_DEFAULT_SESSION_TIMEOUT (2 * 60 * 60) + +// SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT is the default lifetime, in seconds, of a +// session for TLS 1.3 psk_dhe_ke. This is how long we are willing to use the +// secret as an authenticator. +#define SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT (2 * 24 * 60 * 60) + +// SSL_DEFAULT_SESSION_AUTH_TIMEOUT is the default non-renewable lifetime, in +// seconds, of a TLS 1.3 session. This is how long we are willing to trust the +// signature in the initial handshake. +#define SSL_DEFAULT_SESSION_AUTH_TIMEOUT (7 * 24 * 60 * 60) + +// SSL_CTX_set_timeout sets the lifetime, in seconds, of TLS 1.2 (or earlier) +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT uint32_t SSL_CTX_set_timeout(SSL_CTX *ctx, uint32_t timeout); + +// SSL_CTX_set_session_psk_dhe_timeout sets the lifetime, in seconds, of TLS 1.3 +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, + uint32_t timeout); + +// SSL_CTX_get_timeout returns the lifetime, in seconds, of TLS 1.2 (or earlier) +// 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 +// connection without a matching session ID context. +// +// For a server, if |SSL_VERIFY_PEER| is enabled, it is an error to not set a +// session ID context. +OPENSSL_EXPORT int SSL_CTX_set_session_id_context(SSL_CTX *ctx, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_set_session_id_context sets |ssl|'s session ID context to |sid_ctx|. It +// returns one on success and zero on error. See also +// |SSL_CTX_set_session_id_context|. +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. It returns NULL on error. +OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, + size_t *out_len); + +// SSL_SESSION_CACHE_MAX_SIZE_DEFAULT is the default maximum size of a session +// cache. +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024 * 20) + +// SSL_CTX_sess_set_cache_size sets the maximum size of |ctx|'s internal session +// cache to |size|. It returns the previous value. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, + unsigned long size); + +// SSL_CTX_sess_get_cache_size returns the maximum size of |ctx|'s internal +// session cache. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx); + +// SSL_CTX_sess_number returns the number of sessions in |ctx|'s internal +// session cache. +OPENSSL_EXPORT size_t SSL_CTX_sess_number(const SSL_CTX *ctx); + +// SSL_CTX_add_session inserts |session| into |ctx|'s internal session cache. It +// returns one on success and zero on error or if |session| is already in the +// cache. The caller retains its reference to |session|. +OPENSSL_EXPORT int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_remove_session removes |session| from |ctx|'s internal session cache. +// It returns one on success and zero if |session| was not in the cache. +OPENSSL_EXPORT int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_flush_sessions removes all sessions from |ctx| which have expired as +// of time |time|. If |time| is zero, all sessions are removed. +OPENSSL_EXPORT void SSL_CTX_flush_sessions(SSL_CTX *ctx, uint64_t time); + +// SSL_CTX_sess_set_new_cb sets the callback to be called when a new session is +// established and ready to be cached. If the session cache is disabled (the +// appropriate one of |SSL_SESS_CACHE_CLIENT| or |SSL_SESS_CACHE_SERVER| is +// unset), the callback is not called. +// +// The callback is passed a reference to |session|. It returns one if it takes +// ownership (and then calls |SSL_SESSION_free| when done) and zero otherwise. A +// consumer which places |session| into an in-memory cache will likely return +// one, with the cache calling |SSL_SESSION_free|. A consumer which serializes +// |session| with |SSL_SESSION_to_bytes| may not need to retain |session| and +// will likely return zero. Returning one is equivalent to calling +// |SSL_SESSION_up_ref| and then returning zero. +// +// Note: For a client, the callback may be called on abbreviated handshakes if a +// ticket is renewed. Further, it may not be called until some time after +// |SSL_do_handshake| or |SSL_connect| completes if False Start is enabled. Thus +// it's recommended to use this callback over calling |SSL_get_session| on +// handshake completion. +OPENSSL_EXPORT void SSL_CTX_sess_set_new_cb( + SSL_CTX *ctx, int (*new_session_cb)(SSL *ssl, SSL_SESSION *session)); + +// SSL_CTX_sess_get_new_cb returns the callback set by +// |SSL_CTX_sess_set_new_cb|. +OPENSSL_EXPORT int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))( + SSL *ssl, SSL_SESSION *session); + +// SSL_CTX_sess_set_remove_cb sets a callback which is called when a session is +// removed from the internal session cache. +// +// TODO(davidben): What is the point of this callback? It seems useless since it +// only fires on sessions in the internal cache. +OPENSSL_EXPORT void SSL_CTX_sess_set_remove_cb( + SSL_CTX *ctx, + void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *session)); + +// SSL_CTX_sess_get_remove_cb returns the callback set by +// |SSL_CTX_sess_set_remove_cb|. +OPENSSL_EXPORT void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))( + SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_sess_set_get_cb sets a callback to look up a session by ID for a +// server. The callback is passed the session ID and should return a matching +// |SSL_SESSION| or NULL if not found. It should set |*out_copy| to zero and +// return a new reference to the session. This callback is not used for a +// client. +// +// For historical reasons, if |*out_copy| is set to one (default), the SSL +// library will take a new reference to the returned |SSL_SESSION|, expecting +// the callback to return a non-owning pointer. This is not recommended. If +// |ctx| and thus the callback is used on multiple threads, the session may be +// removed and invalidated before the SSL library calls |SSL_SESSION_up_ref|, +// whereas the callback may synchronize internally. +// +// To look up a session asynchronously, the callback may return +// |SSL_magic_pending_session_ptr|. See the documentation for that function and +// |SSL_ERROR_PENDING_SESSION|. +// +// If the internal session cache is enabled, the callback is only consulted if +// the internal cache does not return a match. +OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( + SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *id, + int id_len, int *out_copy)); + +// SSL_CTX_sess_get_get_cb returns the callback set by +// |SSL_CTX_sess_set_get_cb|. +OPENSSL_EXPORT SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))( + SSL *ssl, const uint8_t *id, int id_len, int *out_copy); + +// SSL_magic_pending_session_ptr returns a magic |SSL_SESSION|* which indicates +// that the session isn't currently unavailable. |SSL_get_error| will then +// return |SSL_ERROR_PENDING_SESSION| and the handshake can be retried later +// when the lookup has completed. +OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); + + +// Session tickets. +// +// Session tickets, from RFC 5077, allow session resumption without server-side +// state. The server maintains a secret ticket key and sends the client opaque +// encrypted session parameters, called a ticket. When offering the session, the +// client sends the ticket which the server decrypts to recover session state. +// Session tickets are enabled by default but may be disabled with +// |SSL_OP_NO_TICKET|. +// +// 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| 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 +// encryption and authentication. +// 3) One can configure an |SSL_TICKET_AEAD_METHOD| to have more control +// and the option of asynchronous decryption. +// +// An attacker that compromises a server's session ticket key can impersonate +// the server and, prior to TLS 1.3, retroactively decrypt all application +// traffic from sessions using that ticket key. Thus ticket keys must be +// regularly rotated for forward secrecy. Note the default key is rotated +// automatically once every 48 hours but manually configured keys are not. + +// SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL is the interval with which the +// default session ticket encryption key is rotated, if in use. If any +// non-default ticket encryption mechanism is configured, automatic rotation is +// disabled. +#define SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL (2 * 24 * 60 * 60) + +// SSL_CTX_get_tlsext_ticket_keys writes |ctx|'s session ticket key material to +// |len| bytes of |out|. It returns one on success and zero if |len| is not +// 48. If |out| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, + size_t len); + +// SSL_CTX_set_tlsext_ticket_keys sets |ctx|'s session ticket key material to +// |len| bytes of |in|. It returns one on success and zero if |len| is not +// 48. If |in| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, + size_t len); + +// SSL_TICKET_KEY_NAME_LEN is the length of the key name prefix of a session +// ticket. +#define SSL_TICKET_KEY_NAME_LEN 16 + +// SSL_CTX_set_tlsext_ticket_key_cb sets the ticket callback to |callback| and +// returns one. |callback| will be called when encrypting a new ticket and when +// decrypting a ticket from the client. +// +// In both modes, |ctx| and |hmac_ctx| will already have been initialized with +// |EVP_CIPHER_CTX_init| and |HMAC_CTX_init|, respectively. |callback| +// configures |hmac_ctx| with an HMAC digest and key, and configures |ctx| +// for encryption or decryption, based on the mode. +// +// When encrypting a new ticket, |encrypt| will be one. It writes a public +// 16-byte key name to |key_name| and a fresh IV to |iv|. The output IV length +// must match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns 1 on success and -1 on error. +// +// When decrypting a ticket, |encrypt| will be zero. |key_name| will point to a +// 16-byte key name and |iv| points to an IV. The length of the IV consumed must +// match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns -1 to abort the handshake, 0 if decrypting the ticket +// failed, and 1 or 2 on success. If it returns 2, the ticket will be renewed. +// This may be used to re-key the ticket. +// +// WARNING: |callback| wildly breaks the usual return value convention and is +// called in two different modes. +OPENSSL_EXPORT 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)); + +// 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 BORINGSSL_ENUM_INT { + // ssl_ticket_aead_success indicates that the ticket was successfully + // decrypted. + ssl_ticket_aead_success, + // ssl_ticket_aead_retry indicates that the operation could not be + // immediately completed and must be reattempted, via |open|, at a later + // point. + ssl_ticket_aead_retry, + // ssl_ticket_aead_ignore_ticket indicates that the ticket should be ignored + // (i.e. is corrupt or otherwise undecryptable). + ssl_ticket_aead_ignore_ticket, + // ssl_ticket_aead_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_ticket_aead_error, +}; + +// ssl_ticket_aead_method_st (aka |SSL_TICKET_AEAD_METHOD|) contains methods +// for encrypting and decrypting session tickets. +struct ssl_ticket_aead_method_st { + // max_overhead returns the maximum number of bytes of overhead that |seal| + // may add. + size_t (*max_overhead)(SSL *ssl); + + // seal encrypts and authenticates |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes to |out|, and puts the number of bytes written in + // |*out_len|. The |in| and |out| buffers may be equal but will not otherwise + // alias. It returns one on success or zero on error. + int (*seal)(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, + const uint8_t *in, size_t in_len); + + // open authenticates and decrypts |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes of plaintext to |out|, and puts the number of bytes + // written in |*out_len|. The |in| and |out| buffers may be equal but will + // not otherwise alias. See |ssl_ticket_aead_result_t| for details of the + // return values. In the case that a retry is indicated, the caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in another call to |open|. + enum ssl_ticket_aead_result_t (*open)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out_len, const uint8_t *in, + size_t in_len); +}; + +// SSL_CTX_set_ticket_aead_method configures a custom ticket AEAD method table +// on |ctx|. |aead_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_ticket_aead_method( + SSL_CTX *ctx, const SSL_TICKET_AEAD_METHOD *aead_method); + + +// Elliptic curve Diffie-Hellman. +// +// Cipher suites using an ECDHE key exchange perform Diffie-Hellman over an +// elliptic curve negotiated by both endpoints. See RFC 4492. Only named curves +// are supported. ECDHE is always enabled, but the curve preferences may be +// configured with these functions. +// +// Note that TLS 1.3 renames these from curves to groups. For consistency, we +// currently use the TLS 1.2 name in the API. + +// SSL_CTX_set1_curves sets the preferred curves for |ctx| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, + size_t curves_len); + +// SSL_set1_curves sets the preferred curves for |ssl| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_set1_curves(SSL *ssl, const int *curves, + size_t curves_len); + +// SSL_CTX_set1_curves_list sets the preferred curves for |ctx| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves); + +// SSL_set1_curves_list sets the preferred curves for |ssl| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); + +// SSL_CURVE_* define TLS curve IDs. +#define SSL_CURVE_SECP224R1 21 +#define SSL_CURVE_SECP256R1 23 +#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. +// +// TODO(davidben): This API currently does not work correctly if there is a +// renegotiation in progress. Fix this. +OPENSSL_EXPORT uint16_t SSL_get_curve_id(const SSL *ssl); + +// SSL_get_curve_name returns a human-readable name for the curve specified by +// the given TLS curve id, or NULL if the curve is unknown. +OPENSSL_EXPORT const char *SSL_get_curve_name(uint16_t curve_id); + + +// Certificate verification. +// +// SSL may authenticate either endpoint with an X.509 certificate. Typically +// this is used to authenticate the server to the client. These functions +// configure certificate verification. +// +// WARNING: By default, certificate verification errors on a client are not +// fatal. See |SSL_VERIFY_NONE| This may be configured with +// |SSL_CTX_set_verify|. +// +// By default clients are anonymous but a server may request a certificate from +// the client by setting |SSL_VERIFY_PEER|. +// +// Many of these functions use OpenSSL's legacy X.509 stack which is +// underdocumented and deprecated, but the replacement isn't ready yet. For +// now, consumers may use the existing stack or bypass it by performing +// certificate verification externally. This may be done with +// |SSL_CTX_set_cert_verify_callback| or by extracting the chain with +// |SSL_get_peer_cert_chain| after the handshake. In the future, functions will +// be added to use the SSL stack without dependency on any part of the legacy +// X.509 and ASN.1 stack. +// +// To augment certificate verification, a client may also enable OCSP stapling +// (RFC 6066) and Certificate Transparency (RFC 6962) extensions. + +// SSL_VERIFY_NONE, on a client, verifies the server certificate but does not +// make errors fatal. The result may be checked with |SSL_get_verify_result|. On +// a server it does not request a client certificate. This is the default. +#define SSL_VERIFY_NONE 0x00 + +// SSL_VERIFY_PEER, on a client, makes server certificate errors fatal. On a +// server it requests a client certificate and makes errors fatal. However, +// anonymous clients are still allowed. See +// |SSL_VERIFY_FAIL_IF_NO_PEER_CERT|. +#define SSL_VERIFY_PEER 0x01 + +// SSL_VERIFY_FAIL_IF_NO_PEER_CERT configures a server to reject connections if +// the client declines to send a certificate. This flag must be used together +// with |SSL_VERIFY_PEER|, otherwise it won't work. +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 + +// SSL_VERIFY_PEER_IF_NO_OBC configures a server to request a client certificate +// if and only if Channel ID is not negotiated. +#define SSL_VERIFY_PEER_IF_NO_OBC 0x04 + +// SSL_CTX_set_verify configures certificate verification behavior. |mode| is +// one of the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is +// used to customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_verify( + SSL_CTX *ctx, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); + +// SSL_set_verify configures certificate verification behavior. |mode| is one of +// the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is used to +// customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, + int (*callback)(int ok, + X509_STORE_CTX *store_ctx)); + +enum ssl_verify_result_t BORINGSSL_ENUM_INT { + ssl_verify_ok, + ssl_verify_invalid, + ssl_verify_retry, +}; + +// SSL_CTX_set_custom_verify configures certificate verification. |mode| is one +// of the |SSL_VERIFY_*| values defined above. |callback| performs the +// certificate verification. +// +// The callback may call |SSL_get0_peer_certificates| for the certificate chain +// to validate. The callback should return |ssl_verify_ok| if the certificate is +// valid. If the certificate is invalid, the callback should return +// |ssl_verify_invalid| and optionally set |*out_alert| to an alert to send to +// the peer. Some useful alerts include |SSL_AD_CERTIFICATE_EXPIRED|, +// |SSL_AD_CERTIFICATE_REVOKED|, |SSL_AD_UNKNOWN_CA|, |SSL_AD_BAD_CERTIFICATE|, +// |SSL_AD_CERTIFICATE_UNKNOWN|, and |SSL_AD_INTERNAL_ERROR|. See RFC 5246 +// section 7.2.2 for their precise meanings. If unspecified, +// |SSL_AD_CERTIFICATE_UNKNOWN| will be sent by default. +// +// To verify a certificate asynchronously, the callback may return +// |ssl_verify_retry|. The handshake will then pause with |SSL_get_error| +// returning |SSL_ERROR_WANT_CERTIFICATE_VERIFY|. +OPENSSL_EXPORT void SSL_CTX_set_custom_verify( + SSL_CTX *ctx, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_set_custom_verify behaves like |SSL_CTX_set_custom_verify| but configures +// an individual |SSL|. +OPENSSL_EXPORT void SSL_set_custom_verify( + SSL *ssl, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_CTX_get_verify_mode returns |ctx|'s verify mode, set by +// |SSL_CTX_set_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|. 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 +// |SSL_CTX_set_verify|. +OPENSSL_EXPORT int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_get_verify_callback returns the callback set by |SSL_CTX_set_verify| or +// |SSL_set_verify|. +OPENSSL_EXPORT int (*SSL_get_verify_callback(const SSL *ssl))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_CTX_set_verify_depth sets the maximum depth of a certificate chain +// accepted in verification. This number does not include the leaf, so a depth +// of 1 allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); + +// SSL_set_verify_depth sets the maximum depth of a certificate chain accepted +// in verification. This number does not include the leaf, so a depth of 1 +// allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_set_verify_depth(SSL *ssl, int depth); + +// SSL_CTX_get_verify_depth returns the maximum depth of a certificate accepted +// in verification. +OPENSSL_EXPORT int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); + +// SSL_get_verify_depth returns the maximum depth of a certificate accepted in +// verification. +OPENSSL_EXPORT int SSL_get_verify_depth(const SSL *ssl); + +// SSL_CTX_set1_param sets verification parameters from |param|. It returns one +// on success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_CTX_set1_param(SSL_CTX *ctx, + const X509_VERIFY_PARAM *param); + +// SSL_set1_param sets verification parameters from |param|. It returns one on +// success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_set1_param(SSL *ssl, + const X509_VERIFY_PARAM *param); + +// SSL_CTX_get0_param returns |ctx|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); + +// SSL_get0_param returns |ssl|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); + +// SSL_CTX_set_purpose sets |ctx|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose); + +// SSL_set_purpose sets |ssl|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_purpose(SSL *ssl, int purpose); + +// SSL_CTX_set_trust sets |ctx|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_trust(SSL_CTX *ctx, int trust); + +// SSL_set_trust sets |ssl|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_trust(SSL *ssl, int trust); + +// SSL_CTX_set_cert_store sets |ctx|'s certificate store to |store|. It takes +// ownership of |store|. The store is used for certificate verification. +// +// The store is also used for the auto-chaining feature, but this is deprecated. +// See also |SSL_MODE_NO_AUTO_CHAIN|. +OPENSSL_EXPORT void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); + +// SSL_CTX_get_cert_store returns |ctx|'s certificate store. +OPENSSL_EXPORT X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); + +// SSL_CTX_set_default_verify_paths loads the OpenSSL system-default trust +// anchors into |ctx|'s store. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); + +// SSL_CTX_load_verify_locations loads trust anchors into |ctx|'s store from +// |ca_file| and |ca_dir|, either of which may be NULL. If |ca_file| is passed, +// it is opened and PEM-encoded CA certificates are read. If |ca_dir| is passed, +// it is treated as a directory in OpenSSL's hashed directory format. It returns +// one on success and zero on failure. +// +// See +// https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html +// for documentation on the directory format. +OPENSSL_EXPORT int SSL_CTX_load_verify_locations(SSL_CTX *ctx, + const char *ca_file, + const char *ca_dir); + +// SSL_get_verify_result returns the result of certificate verification. It is +// either |X509_V_OK| or a |X509_V_ERR_*| value. +OPENSSL_EXPORT long SSL_get_verify_result(const SSL *ssl); + +// SSL_alert_from_verify_result returns the SSL alert code, such as +// |SSL_AD_CERTIFICATE_EXPIRED|, that corresponds to an |X509_V_ERR_*| value. +// The return value is always an alert, even when |result| is |X509_V_OK|. +OPENSSL_EXPORT int SSL_alert_from_verify_result(long result); + +// SSL_get_ex_data_X509_STORE_CTX_idx returns the ex_data index used to look up +// the |SSL| associated with an |X509_STORE_CTX| in the verify callback. +OPENSSL_EXPORT int SSL_get_ex_data_X509_STORE_CTX_idx(void); + +// SSL_CTX_set_cert_verify_callback sets a custom callback to be called on +// certificate verification rather than |X509_verify_cert|. |store_ctx| contains +// the verification parameters. The callback should return one on success and +// zero on fatal error. It may use |X509_STORE_CTX_set_error| to set a +// verification result. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| to recover the +// |SSL| object from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_cert_verify_callback( + SSL_CTX *ctx, int (*callback)(X509_STORE_CTX *store_ctx, void *arg), + void *arg); + +// SSL_enable_signed_cert_timestamps causes |ssl| (which must be the client end +// of a connection) to request SCTs from the server. See +// https://tools.ietf.org/html/rfc6962. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_enable_signed_cert_timestamps(SSL *ssl); + +// SSL_CTX_enable_signed_cert_timestamps enables SCT requests on all client SSL +// objects created from |ctx|. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx); + +// SSL_enable_ocsp_stapling causes |ssl| (which must be the client end of a +// connection) to request a stapled OCSP response from the server. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_enable_ocsp_stapling(SSL *ssl); + +// SSL_CTX_enable_ocsp_stapling enables OCSP stapling on all client SSL objects +// created from |ctx|. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx); + +// SSL_CTX_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL_CTX|. +OPENSSL_EXPORT int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_CTX_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +OPENSSL_EXPORT int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL|. +OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); + +// SSL_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +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. 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 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|. +OPENSSL_EXPORT int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + + +// Client certificate CA list. +// +// When requesting a client certificate, a server may advertise a list of +// certificate authorities which are accepted. These functions may be used to +// configure this list. + +// SSL_set_client_CA_list sets |ssl|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_set_client_CA_list(SSL *ssl, + STACK_OF(X509_NAME) *name_list); + +// SSL_CTX_set_client_CA_list sets |ctx|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, + STACK_OF(X509_NAME) *name_list); + +// SSL_set0_client_CAs sets |ssl|'s client certificate CA list to |name_list|, +// which should contain DER-encoded distinguished names (RFC 5280). It takes +// ownership of |name_list|. +OPENSSL_EXPORT void SSL_set0_client_CAs(SSL *ssl, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_CTX_set0_client_CAs sets |ctx|'s client certificate CA list to +// |name_list|, which should contain DER-encoded distinguished names (RFC 5280). +// It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_get_client_CA_list returns |ssl|'s client certificate CA list. If |ssl| +// has not been configured as a client, this is the list configured by +// |SSL_CTX_set_client_CA_list|. +// +// If configured as a client, it returns the client certificate CA list sent by +// the server. In this mode, the behavior is undefined except 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. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); + +// SSL_get0_server_requested_CAs returns the CAs sent by a server to guide a +// client in certificate selection. They are a series of DER-encoded X.509 +// names. This function may only be called during a callback set by +// |SSL_CTX_set_cert_cb| or when the handshake is paused because of it. +// +// 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 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) * + SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); + +// SSL_add_client_CA appends |x509|'s subject to the client certificate CA list. +// It returns one on success or zero on error. The caller retains ownership of +// |x509|. +OPENSSL_EXPORT int SSL_add_client_CA(SSL *ssl, X509 *x509); + +// SSL_CTX_add_client_CA appends |x509|'s subject to the client certificate CA +// list. It returns one on success or zero on error. The caller retains +// ownership of |x509|. +OPENSSL_EXPORT int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509); + +// SSL_load_client_CA_file opens |file| and reads PEM-encoded certificates from +// it. It returns a newly-allocated stack of the certificate subjects or NULL +// on error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); + +// SSL_dup_CA_list makes a deep copy of |list|. It returns the new list on +// success or NULL on allocation error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *list); + +// SSL_add_file_cert_subjects_to_stack behaves like |SSL_load_client_CA_file| +// but appends the result to |out|. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *file); + + +// Server name indication. +// +// The server_name extension (RFC 3546) allows the client to advertise the name +// of the server it is connecting to. This is used in virtual hosting +// deployments to select one of a several certificates on a single IP. Only the +// host_name name type is supported. + +#define TLSEXT_NAMETYPE_host_name 0 + +// SSL_set_tlsext_host_name, for a client, configures |ssl| to advertise |name| +// in the server_name extension. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_tlsext_host_name(SSL *ssl, const char *name); + +// SSL_get_servername, for a server, returns the hostname supplied by the +// client or NULL if there was none. The |type| argument must be +// |TLSEXT_NAMETYPE_host_name|. +OPENSSL_EXPORT const char *SSL_get_servername(const SSL *ssl, const int type); + +// SSL_get_servername_type, for a server, returns |TLSEXT_NAMETYPE_host_name| +// if the client sent a hostname and -1 otherwise. +OPENSSL_EXPORT int SSL_get_servername_type(const SSL *ssl); + +// SSL_CTX_set_tlsext_servername_callback configures |callback| to be called on +// the server after ClientHello extensions have been parsed and returns one. +// The callback may use |SSL_get_servername| to examine the server_name +// extension and returns a |SSL_TLSEXT_ERR_*| value. The value of |arg| may be +// set by calling |SSL_CTX_set_tlsext_servername_arg|. +// +// If the callback returns |SSL_TLSEXT_ERR_NOACK|, the server_name extension is +// not acknowledged in the ServerHello. If the return value is +// |SSL_TLSEXT_ERR_ALERT_FATAL|, then |*out_alert| is the alert to send, +// defaulting to |SSL_AD_UNRECOGNIZED_NAME|. |SSL_TLSEXT_ERR_ALERT_WARNING| is +// ignored and treated as |SSL_TLSEXT_ERR_OK|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_callback( + SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)); + +// SSL_CTX_set_tlsext_servername_arg sets the argument to the servername +// callback and returns one. See |SSL_CTX_set_tlsext_servername_callback|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg); + +// SSL_TLSEXT_ERR_* are values returned by some extension-related callbacks. +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +// SSL_set_SSL_CTX changes |ssl|'s |SSL_CTX|. |ssl| will use the +// certificate-related settings from |ctx|, and |SSL_get_SSL_CTX| will report +// |ctx|. This function may be used during the callbacks registered by +// |SSL_CTX_set_select_certificate_cb|, +// |SSL_CTX_set_tlsext_servername_callback|, and |SSL_CTX_set_cert_cb| or when +// the handshake is paused from them. It is typically used to switch +// certificates based on SNI. +// +// Note the session cache and related settings will continue to use the initial +// |SSL_CTX|. Callers should use |SSL_CTX_set_session_id_context| to partition +// the session cache between different domains. +// +// TODO(davidben): Should other settings change after this call? +OPENSSL_EXPORT SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx); + + +// Application-layer protocol negotiation. +// +// The ALPN extension (RFC 7301) allows negotiating different application-layer +// protocols over a single port. This is used, for example, to negotiate +// HTTP/2. + +// SSL_CTX_set_alpn_protos sets the client ALPN protocol list on |ctx| to +// |protos|. |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, + unsigned protos_len); + +// SSL_set_alpn_protos sets the client ALPN protocol list on |ssl| to |protos|. +// |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, + unsigned protos_len); + +// SSL_CTX_set_alpn_select_cb sets a callback function on |ctx| that is called +// during ClientHello processing in order to select an ALPN protocol from the +// client's list of offered protocols. Configuring this callback enables ALPN on +// a server. +// +// The callback is passed a wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings) ALPN protocol list in |in|. It should set |*out| and +// |*out_len| to the selected protocol and return |SSL_TLSEXT_ERR_OK| on +// success. It does not pass ownership of the buffer. Otherwise, it should +// return |SSL_TLSEXT_ERR_NOACK|. Other |SSL_TLSEXT_ERR_*| values are +// unimplemented and will be treated as |SSL_TLSEXT_ERR_NOACK|. +// +// The cipher suite is selected before negotiating ALPN. The callback may use +// |SSL_get_pending_cipher| to query the cipher suite. +OPENSSL_EXPORT 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); + +// SSL_get0_alpn_selected gets the selected ALPN protocol (if any) from |ssl|. +// On return it sets |*out_data| to point to |*out_len| bytes of protocol name +// (not including the leading length-prefix byte). If the server didn't respond +// with a negotiated protocol then |*out_len| will be zero. +OPENSSL_EXPORT void SSL_get0_alpn_selected(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_CTX_set_allow_unknown_alpn_protos configures client connections on |ctx| +// to allow unknown ALPN protocols from the server. Otherwise, by default, the +// client will require that the protocol be advertised in +// |SSL_CTX_set_alpn_protos|. +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 +// and deprecated in favor of it. + +// SSL_CTX_set_next_protos_advertised_cb sets a callback that is called when a +// TLS server needs a list of supported protocols for Next Protocol +// Negotiation. The returned list must be in wire format. The list is returned +// by setting |*out| to point to it and |*out_len| to its length. This memory +// will not be modified, but one should assume that |ssl| keeps a reference to +// it. +// +// The callback should return |SSL_TLSEXT_ERR_OK| if it wishes to advertise. +// Otherwise, no such extension will be included in the ServerHello. +OPENSSL_EXPORT 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); + +// SSL_CTX_set_next_proto_select_cb sets a callback that is called when a client +// needs to select a protocol from the server's provided list. |*out| must be +// set to point to the selected protocol (which may be within |in|). The length +// of the protocol name must be written into |*out_len|. The server's advertised +// protocols are provided in |in| and |in_len|. The callback can assume that +// |in| is syntactically valid. +// +// The client must select a protocol. It is fatal to the connection if this +// callback returns a value other than |SSL_TLSEXT_ERR_OK|. +// +// Configuring this callback enables NPN on a client. +OPENSSL_EXPORT 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); + +// SSL_get0_next_proto_negotiated sets |*out_data| and |*out_len| to point to +// the client's requested protocol for this connection. If the client didn't +// request any protocol, then |*out_data| is set to NULL. +// +// Note that the client can request any protocol it chooses. The value returned +// from this function need not be a member of the list of supported protocols +// provided by the server. +OPENSSL_EXPORT void SSL_get0_next_proto_negotiated(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_select_next_proto implements the standard protocol selection. It is +// expected that this function is called from the callback set by +// |SSL_CTX_set_next_proto_select_cb|. +// +// |peer| and |supported| must be vectors of 8-bit, length-prefixed byte strings +// containing the peer and locally-configured protocols, respectively. The +// length byte itself is not included in the length. A byte string of length 0 +// is invalid. No byte string may be truncated. |supported| is assumed to be +// non-empty. +// +// This function finds the first protocol in |peer| which is also in +// |supported|. If one was found, it sets |*out| and |*out_len| to point to it +// and returns |OPENSSL_NPN_NEGOTIATED|. Otherwise, it returns +// |OPENSSL_NPN_NO_OVERLAP| and sets |*out| and |*out_len| to the first +// supported protocol. +OPENSSL_EXPORT 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); + +#define OPENSSL_NPN_UNSUPPORTED 0 +#define OPENSSL_NPN_NEGOTIATED 1 +#define OPENSSL_NPN_NO_OVERLAP 2 + + +// Channel ID. +// +// See draft-balfanz-tls-channelid-01. + +// SSL_CTX_set_tls_channel_id_enabled configures whether connections associated +// with |ctx| should enable Channel ID. +OPENSSL_EXPORT void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, + int enabled); + +// SSL_set_tls_channel_id_enabled configures whether |ssl| should enable Channel +// ID. +OPENSSL_EXPORT void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled); + +// SSL_CTX_set1_tls_channel_id configures a TLS client to send a TLS Channel ID +// to compatible servers. |private_key| must be a P-256 EC key. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, + EVP_PKEY *private_key); + +// SSL_set1_tls_channel_id configures a TLS client to send a TLS Channel ID to +// compatible servers. |private_key| must be a P-256 EC key. It returns one on +// success and zero on error. +OPENSSL_EXPORT int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key); + +// SSL_get_tls_channel_id gets the client's TLS Channel ID from a server |SSL*| +// and copies up to the first |max_out| bytes into |out|. The Channel ID +// consists of the client's P-256 public key as an (x,y) pair where each is a +// 32-byte, big-endian field element. It returns 0 if the client didn't offer a +// Channel ID and the length of the complete Channel ID otherwise. +OPENSSL_EXPORT size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_CTX_set_channel_id_cb sets a callback to be called when a TLS Channel ID +// is requested. The callback may set |*out_pkey| to a key, passing a reference +// to the caller. If none is returned, the handshake will pause and +// |SSL_get_error| will return |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +// +// See also |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +OPENSSL_EXPORT void SSL_CTX_set_channel_id_cb( + SSL_CTX *ctx, void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey)); + +// SSL_CTX_get_channel_id_cb returns the callback set by +// |SSL_CTX_set_channel_id_cb|. +OPENSSL_EXPORT void (*SSL_CTX_get_channel_id_cb(SSL_CTX *ctx))( + SSL *ssl, EVP_PKEY **out_pkey); + + +// Token Binding. +// +// See draft-ietf-tokbind-protocol-16. + +// SSL_set_token_binding_params sets |params| as the Token Binding Key +// parameters (section 3 of draft-ietf-tokbind-protocol-16) to negotiate on the +// connection. If this function is not called, or if |len| is 0, then this +// endpoint will not attempt to negotiate Token Binding. |params| are provided +// in preference order, with the more preferred parameters at the beginning of +// the list. This function returns 1 on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, + size_t len); + +// SSL_is_token_binding_negotiated returns 1 if Token Binding was negotiated +// on this connection and 0 otherwise. On a server, it is possible for this +// function to return 1 when the client's view of the connection is that Token +// Binding was not negotiated. This occurs when the server indicates a version +// of Token Binding less than the client's minimum version. +OPENSSL_EXPORT int SSL_is_token_binding_negotiated(const SSL *ssl); + +// SSL_get_negotiated_token_binding_param returns the TokenBindingKeyParameters +// enum value that was negotiated. It is only valid to call this function if +// SSL_is_token_binding_negotiated returned 1, otherwise this function returns +// an undefined value. +OPENSSL_EXPORT uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl); + + +// DTLS-SRTP. +// +// See RFC 5764. + +// srtp_protection_profile_st (aka |SRTP_PROTECTION_PROFILE|) is an SRTP +// profile for use with the use_srtp extension. +struct srtp_protection_profile_st { + const char *name; + unsigned long id; +} /* SRTP_PROTECTION_PROFILE */; + +DEFINE_CONST_STACK_OF(SRTP_PROTECTION_PROFILE) + +// SRTP_* define constants for SRTP profiles. +#define SRTP_AES128_CM_SHA1_80 0x0001 +#define SRTP_AES128_CM_SHA1_32 0x0002 +#define SRTP_AES128_F8_SHA1_80 0x0003 +#define SRTP_AES128_F8_SHA1_32 0x0004 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 + +// SSL_CTX_set_srtp_profiles enables SRTP for all SSL objects created from +// |ctx|. |profile| contains a colon-separated list of profile names. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_srtp_profiles enables SRTP for |ssl|. |profile| contains a +// colon-separated list of profile names. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set_srtp_profiles(SSL *ssl, const char *profiles); + +// SSL_get_srtp_profiles returns the SRTP profiles supported by |ssl|. +OPENSSL_EXPORT STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles( + SSL *ssl); + +// SSL_get_selected_srtp_profile returns the selected SRTP profile, or NULL if +// SRTP was not negotiated. +OPENSSL_EXPORT const SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile( + SSL *ssl); + + +// Pre-shared keys. +// +// Connections may be configured with PSK (Pre-Shared Key) cipher suites. These +// authenticate using out-of-band pre-shared keys rather than certificates. See +// RFC 4279. +// +// This implementation uses NUL-terminated C strings for identities and identity +// hints, so values with a NUL character are not supported. (RFC 4279 does not +// specify the format of an identity.) + +// PSK_MAX_IDENTITY_LEN is the maximum supported length of a PSK identity, +// excluding the NUL terminator. +#define PSK_MAX_IDENTITY_LEN 128 + +// PSK_MAX_PSK_LEN is the maximum supported length of a pre-shared key. +#define PSK_MAX_PSK_LEN 256 + +// SSL_CTX_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. +// +// The callback is passed the identity hint in |hint| or NULL if none was +// provided. It should select a PSK identity and write the identity and the +// corresponding PSK to |identity| and |psk|, respectively. The identity is +// written as a NUL-terminated C string of length (excluding the NUL terminator) +// at most |max_identity_len|. The PSK's length must be at most |max_psk_len|. +// The callback returns the length of the PSK or 0 if no suitable identity was +// found. +OPENSSL_EXPORT 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)); + +// SSL_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. See also |SSL_CTX_set_psk_client_callback|. +OPENSSL_EXPORT 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_CTX_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. +// +// The callback is passed the identity in |identity|. It should write a PSK of +// length at most |max_psk_len| to |psk| and return the number of bytes written +// or zero if the PSK identity is unknown. +OPENSSL_EXPORT void SSL_CTX_set_psk_server_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. See also |SSL_CTX_set_psk_server_callback|. +OPENSSL_EXPORT void SSL_set_psk_server_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_CTX_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, + const char *identity_hint); + +// SSL_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_use_psk_identity_hint(SSL *ssl, + const char *identity_hint); + +// SSL_get_psk_identity_hint returns the PSK identity hint advertised for |ssl| +// or NULL if there is none. +OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); + +// SSL_get_psk_identity, after the handshake completes, returns the PSK identity +// that was negotiated by |ssl| or NULL if PSK was not used. +OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); + + +// 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 +// transport parameters. draft-ietf-quic-transport (section 7.4) defines the +// contents of that extension (a TransportParameters struct) and describes how +// to handle it and its semantic meaning. +// +// BoringSSL handles this extension as an opaque byte string. The caller is +// responsible for serializing and parsing it. + +// SSL_set_quic_transport_params configures |ssl| to send |params| (of length +// |params_len|) in the quic_transport_parameters extension in either the +// ClientHello or EncryptedExtensions handshake message. This extension will +// only be sent if the TLS version is at least 1.3, and for a server, only if +// the client sent the extension. The buffer pointed to by |params| only need be +// valid for the duration of the call to this function. This function returns 1 +// on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_quic_transport_params(SSL *ssl, + const uint8_t *params, + size_t params_len); + +// SSL_get_peer_quic_transport_params provides the caller with the value of the +// quic_transport_parameters extension sent by the peer. A pointer to the buffer +// containing the TransportParameters will be put in |*out_params|, and its +// length in |*params_len|. This buffer will be valid for the lifetime of the +// |SSL|. If no params were received from the peer, |*out_params_len| will be 0. +OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + 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 +// implemented. It may cause interoperability or security failures when used. +// +// Early data, or 0-RTT, is a feature in TLS 1.3 which allows clients to send +// data on the first flight during a resumption handshake. This can save a +// round-trip in some application protocols. +// +// 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 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 +// be used to send half-RTT data. |SSL_read| will consume early data and +// transition to 1-RTT data as appropriate. Prior to the transition, +// |SSL_in_init| will report the handshake is still in progress. Callers may use +// it or |SSL_in_early_data| to defer or reject requests as needed. +// +// Early data as a client is more complex. If the offered session (see +// |SSL_set_session|) is 0-RTT-capable, the handshake will return after sending +// the ClientHello. The predicted peer certificates and ALPN protocol will be +// available via the usual APIs. |SSL_write| will write early data, up to the +// session's limit. Writes past this limit and |SSL_read| will complete the +// handshake before continuing. Callers may also call |SSL_do_handshake| again +// to complete the handshake sooner. +// +// If the server accepts early data, the handshake will succeed. |SSL_read| and +// |SSL_write| will then act as in a 1-RTT handshake. The peer certificates and +// ALPN protocol will be as predicted and need not be re-queried. +// +// If the server rejects early data, |SSL_do_handshake| (and thus |SSL_read| and +// |SSL_write|) will then fail with |SSL_get_error| returning +// |SSL_ERROR_EARLY_DATA_REJECTED|. The caller should treat this as a connection +// error and most likely perform a high-level retry. Note the server may still +// have processed the early data due to attacker replays. +// +// To then continue the handshake on the original connection, use +// |SSL_reset_early_data_reject|. The connection will then behave as one which +// had not yet completed the handshake. This allows a faster retry than making a +// fresh connection. |SSL_do_handshake| will complete the full handshake, +// possibly resulting in different peer certificates, ALPN protocol, and other +// properties. The caller must disregard any values from before the reset and +// query again. +// +// 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|. +OPENSSL_EXPORT void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled); + +// SSL_set_early_data_enabled sets whether early data is allowed to be used +// with resumptions using |ssl|. See |SSL_CTX_set_early_data_enabled| for more +// information. +OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); + +// SSL_in_early_data returns one if |ssl| has a pending handshake that has +// progressed enough to send or receive early data. Clients may call |SSL_write| +// to send early data, but |SSL_read| will complete the handshake before +// accepting application data. Servers may call |SSL_read| to read early data +// 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); + +// SSL_reset_early_data_reject resets |ssl| after an early data reject. All +// 0-RTT state is discarded, including any pending |SSL_write| calls. The caller +// should treat |ssl| as a logically fresh connection, usually by driving the +// handshake to completion using |SSL_do_handshake|. +// +// It is an error to call this function on an |SSL| object that is not signaling +// |SSL_ERROR_EARLY_DATA_REJECTED|. +OPENSSL_EXPORT void SSL_reset_early_data_reject(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); + +// 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 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 +// value corresponds to an alert description. Consumers may add or subtract +// |SSL_AD_REASON_OFFSET| to convert between them. +// +// make_errors.go reserves error codes above 1000 for manually-assigned errors. +// This value must be kept in sync with reservedReasonCode in make_errors.h +#define SSL_AD_REASON_OFFSET 1000 + +// 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 +#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED +#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 // 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 +#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED +#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN +#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER +#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA +#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED +#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR +#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR +#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION +#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION +#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY +#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR +#define SSL_AD_INAPPROPRIATE_FALLBACK SSL3_AD_INAPPROPRIATE_FALLBACK +#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED +#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION +#define SSL_AD_MISSING_EXTENSION TLS1_AD_MISSING_EXTENSION +#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION +#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE +#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE \ + TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE +#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE +#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY +#define SSL_AD_CERTIFICATE_REQUIRED TLS1_AD_CERTIFICATE_REQUIRED + +// SSL_alert_type_string_long returns a string description of |value| as an +// alert type (warning or fatal). +OPENSSL_EXPORT const char *SSL_alert_type_string_long(int value); + +// SSL_alert_desc_string_long returns a string description of |value| as an +// alert description or "unknown" if unknown. +OPENSSL_EXPORT const char *SSL_alert_desc_string_long(int value); + +// SSL_send_fatal_alert sends a fatal alert over |ssl| of the specified type, +// which should be one of the |SSL_AD_*| constants. It returns one on success +// and <= 0 on error. The caller should pass the return value into +// |SSL_get_error| to determine how to proceed. Once this function has been +// called, future calls to |SSL_write| will fail. +// +// If retrying a failed operation due to |SSL_ERROR_WANT_WRITE|, subsequent +// calls must use the same |alert| parameter. +OPENSSL_EXPORT int SSL_send_fatal_alert(SSL *ssl, uint8_t alert); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int SSL_set_ex_data(SSL *ssl, int idx, void *data); +OPENSSL_EXPORT void *SSL_get_ex_data(const SSL *ssl, int idx); +OPENSSL_EXPORT int SSL_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 SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, + void *data); +OPENSSL_EXPORT void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, + int idx); +OPENSSL_EXPORT int SSL_SESSION_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 SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data); +OPENSSL_EXPORT void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); +OPENSSL_EXPORT 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); + + +// Low-level record-layer state. + +// 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 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, + const uint8_t **out_write_iv, + size_t *out_iv_len); + +// SSL_get_key_block_len returns the length of |ssl|'s key block. +OPENSSL_EXPORT size_t SSL_get_key_block_len(const SSL *ssl); + +// SSL_generate_key_block generates |out_len| bytes of key material for |ssl|'s +// current connection state. +OPENSSL_EXPORT int SSL_generate_key_block(const SSL *ssl, uint8_t *out, + size_t out_len); + +// SSL_get_read_sequence returns, in TLS, the expected sequence number of the +// next incoming record in the current epoch. In DTLS, it returns the maximum +// sequence number received in the current epoch and includes the epoch number +// in the two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_read_sequence(const SSL *ssl); + +// SSL_get_write_sequence returns the sequence number of the next outgoing +// record in the current epoch. In DTLS, it includes the epoch number in the +// two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); + + +// Obscure functions. + +// 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. +// |write_p| is one for outgoing messages and zero for incoming messages. +// +// For each record header, |cb| is called with |version| = 0 and |content_type| +// = |SSL3_RT_HEADER|. The |len| bytes from |buf| contain the header. Note that +// this does not include the record body. If the record is sealed, the length +// in the header is the length of the ciphertext. +// +// For each handshake message, ChangeCipherSpec, and alert, |version| is the +// protocol version and |content_type| is the corresponding record type. The +// |len| bytes from |buf| contain the handshake message, one-byte +// ChangeCipherSpec body, and two-byte alert, respectively. +// +// For a V2ClientHello, |version| is |SSL2_VERSION|, |content_type| is zero, and +// the |len| bytes from |buf| contain the V2ClientHello structure. +OPENSSL_EXPORT 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)); + +// SSL_CTX_set_msg_callback_arg sets the |arg| parameter of the message +// callback. +OPENSSL_EXPORT void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); + +// SSL_set_msg_callback installs |cb| as the message callback of |ssl|. See +// |SSL_CTX_set_msg_callback| for when this callback is called. +OPENSSL_EXPORT 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_set_msg_callback_arg sets the |arg| parameter of the message callback. +OPENSSL_EXPORT void SSL_set_msg_callback_arg(SSL *ssl, void *arg); + +// SSL_CTX_set_keylog_callback configures a callback to log key material. This +// is intended for debugging use with tools like Wireshark. The |cb| function +// should log |line| followed by a newline, synchronizing with any concurrent +// access to the log. +// +// The format is described in +// https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format. +OPENSSL_EXPORT void SSL_CTX_set_keylog_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, const char *line)); + +// SSL_CTX_get_keylog_callback returns the callback configured by +// |SSL_CTX_set_keylog_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( + const SSL *ssl, const char *line); + +// SSL_CTX_set_current_time_cb configures a callback to retrieve the current +// time, which should be set in |*out_clock|. This can be used for testing +// purposes; for example, a callback can be configured that returns a time +// set explicitly by the test. The |ssl| pointer passed to |cb| is always null. +OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); + +// 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 +// renegotiation attempts by a server. If |ssl| is a server, peer-initiated +// renegotiations are *always* rejected and this function does nothing. +// +// The renegotiation mode defaults to |ssl_renegotiate_never|, but may be set +// at any point in a connection's lifetime. Set it to |ssl_renegotiate_once| to +// allow one renegotiation, |ssl_renegotiate_freely| to allow all +// renegotiations or |ssl_renegotiate_ignore| to ignore HelloRequest messages. +// 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); + +// SSL_total_renegotiations returns the total number of renegotiation handshakes +// performed by |ssl|. This includes the pending renegotiation, if any. +OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); + +// 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) + +// SSL_CTX_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ctx|. +OPENSSL_EXPORT size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx); + +// SSL_CTX_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, + size_t max_cert_list); + +// SSL_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ssl|. +OPENSSL_EXPORT size_t SSL_get_max_cert_list(const SSL *ssl); + +// SSL_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list); + +// SSL_CTX_set_max_send_fragment sets the maximum length, in bytes, of records +// sent by |ctx|. Beyond this length, handshake messages and application data +// will be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, + size_t max_send_fragment); + +// SSL_set_max_send_fragment sets the maximum length, in bytes, of records sent +// by |ssl|. Beyond this length, handshake messages and application data will +// be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_set_max_send_fragment(SSL *ssl, + size_t max_send_fragment); + +// ssl_early_callback_ctx (aka |SSL_CLIENT_HELLO|) is passed to certain +// callbacks that are called very early on during the server handshake. At this +// point, much of the SSL* hasn't been filled out and only the ClientHello can +// be depended on. +typedef struct ssl_early_callback_ctx { + SSL *ssl; + const uint8_t *client_hello; + size_t client_hello_len; + uint16_t version; + const uint8_t *random; + size_t random_len; + const uint8_t *session_id; + size_t session_id_len; + const uint8_t *cipher_suites; + size_t cipher_suites_len; + const uint8_t *compression_methods; + size_t compression_methods_len; + const uint8_t *extensions; + size_t extensions_len; +} SSL_CLIENT_HELLO; + +// ssl_select_cert_result_t enumerates the possible results from selecting a +// certificate with |select_certificate_cb|. +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, + // ssl_select_cert_retry indicates that the operation could not be + // immediately completed and must be reattempted at a later point. + ssl_select_cert_retry = 0, + // ssl_select_cert_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_select_cert_error = -1, +}; + +// SSL_early_callback_ctx_extension_get searches the extensions in +// |client_hello| for an extension of the given type. If not found, it returns +// zero. Otherwise it sets |out_data| to point to the extension contents (not +// including the type and length bytes), sets |out_len| to the length of the +// extension contents and returns one. +OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( + const SSL_CLIENT_HELLO *client_hello, uint16_t extension_type, + const uint8_t **out_data, size_t *out_len); + +// SSL_CTX_set_select_certificate_cb sets a callback that is called before most +// ClientHello processing and before the decision whether to resume a session +// is made. The callback may inspect the ClientHello and configure the +// connection. See |ssl_select_cert_result_t| for details of the return values. +// +// In the case that a retry is indicated, |SSL_get_error| will return +// |SSL_ERROR_PENDING_CERTIFICATE| and the caller should arrange for the +// 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( + SSL_CTX *ctx, + enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)); + +// SSL_CTX_set_dos_protection_cb sets a callback that is called once the +// resumption decision for a ClientHello has been made. It can return one to +// allow the handshake to continue or zero to cause the handshake to abort. +OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( + SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); + +// 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. +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 +#define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +// SSL_CTX_set_info_callback configures a callback to be run when various +// events occur during a connection's lifetime. The |type| argument determines +// the type of event and the meaning of the |value| argument. Callbacks must +// ignore unexpected |type| values. +// +// |SSL_CB_READ_ALERT| is signaled for each alert received, warning or fatal. +// The |value| argument is a 16-bit value where the alert level (either +// |SSL3_AL_WARNING| or |SSL3_AL_FATAL|) is in the most-significant eight bits +// and the alert type (one of |SSL_AD_*|) is in the least-significant eight. +// +// |SSL_CB_WRITE_ALERT| is signaled for each alert sent. The |value| argument +// is constructed as with |SSL_CB_READ_ALERT|. +// +// |SSL_CB_HANDSHAKE_START| is signaled when a handshake begins. The |value| +// argument is always one. +// +// |SSL_CB_HANDSHAKE_DONE| is signaled when a handshake completes successfully. +// The |value| argument is always one. If a handshake False Starts, this event +// may be used to determine when the Finished message is received. +// +// The following event types expose implementation details of the handshake +// state machine. Consuming them is deprecated. +// +// |SSL_CB_ACCEPT_LOOP| (respectively, |SSL_CB_CONNECT_LOOP|) is signaled when +// a server (respectively, client) handshake progresses. The |value| argument +// is always one. +// +// |SSL_CB_ACCEPT_EXIT| (respectively, |SSL_CB_CONNECT_EXIT|) is signaled when +// a server (respectively, client) handshake completes, fails, or is paused. +// The |value| argument is one if the handshake succeeded and <= 0 +// otherwise. +OPENSSL_EXPORT void SSL_CTX_set_info_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_CTX_get_info_callback returns the callback set by +// |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, + int type, + int value); + +// SSL_set_info_callback configures a callback to be run at various events +// during a connection's lifetime. See |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void SSL_set_info_callback( + SSL *ssl, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_get_info_callback returns the callback set by |SSL_set_info_callback|. +OPENSSL_EXPORT void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, + int type, + int value); + +// SSL_state_string_long returns the current state of the handshake state +// machine as a string. This may be useful for debugging and logging. +OPENSSL_EXPORT const char *SSL_state_string_long(const SSL *ssl); + +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + +// SSL_get_shutdown returns a bitmask with a subset of |SSL_SENT_SHUTDOWN| and +// |SSL_RECEIVED_SHUTDOWN| to query whether close_notify was sent or received, +// respectively. +OPENSSL_EXPORT int SSL_get_shutdown(const SSL *ssl); + +// SSL_get_peer_signature_algorithm returns the signature algorithm used by the +// peer. If not applicable, it returns zero. +OPENSSL_EXPORT uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl); + +// SSL_get_client_random writes up to |max_out| bytes of the most recent +// handshake's client_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the client_random. +OPENSSL_EXPORT size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_server_random writes up to |max_out| bytes of the most recent +// handshake's server_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the server_random. +OPENSSL_EXPORT size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_pending_cipher returns the cipher suite for the current handshake or +// NULL if one has not been negotiated yet or there is no pending handshake. +OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); + +// SSL_set_retain_only_sha256_of_client_certs, on a server, sets whether 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 |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); + +// SSL_CTX_set_retain_only_sha256_of_client_certs, on a server, sets whether +// 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 |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); + +// SSL_CTX_set_grease_enabled configures whether sockets on |ctx| should enable +// GREASE. See draft-davidben-tls-grease-01. +OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); + +// SSL_max_seal_overhead returns the maximum overhead, in bytes, of sealing a +// record with |ssl|. +OPENSSL_EXPORT size_t SSL_max_seal_overhead(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_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. + +// SSL_library_init calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int SSL_library_init(void); + +// SSL_CIPHER_description writes a description of |cipher| into |buf| and +// returns |buf|. If |buf| is NULL, it returns a newly allocated string, to be +// freed with |OPENSSL_free|, or NULL on error. +// +// The description includes a trailing newline and has the form: +// AES128-SHA Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1 +// +// Consider |SSL_CIPHER_standard_name| or |SSL_CIPHER_get_name| instead. +OPENSSL_EXPORT const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, + char *buf, int len); + +// SSL_CIPHER_get_version returns the string "TLSv1/SSLv3". +OPENSSL_EXPORT const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_rfc_name returns a newly-allocated string containing the +// result of |SSL_CIPHER_standard_name| or NULL on error. The caller is +// responsible for calling |OPENSSL_free| on the result. +// +// Use |SSL_CIPHER_standard_name| instead. +OPENSSL_EXPORT char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher); + +typedef void COMP_METHOD; +typedef struct ssl_comp_st SSL_COMP; + +// SSL_COMP_get_compression_methods returns NULL. +OPENSSL_EXPORT STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + +// SSL_COMP_add_compression_method returns one. +OPENSSL_EXPORT int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); + +// SSL_COMP_get_name returns NULL. +OPENSSL_EXPORT const char *SSL_COMP_get_name(const COMP_METHOD *comp); + +// SSL_COMP_get0_name returns the |name| member of |comp|. +OPENSSL_EXPORT const char *SSL_COMP_get0_name(const SSL_COMP *comp); + +// SSL_COMP_get_id returns the |id| member of |comp|. +OPENSSL_EXPORT int SSL_COMP_get_id(const SSL_COMP *comp); + +// SSL_COMP_free_compression_methods does nothing. +OPENSSL_EXPORT void SSL_COMP_free_compression_methods(void); + +// SSLv23_method calls |TLS_method|. +OPENSSL_EXPORT const SSL_METHOD *SSLv23_method(void); + +// These version-specific methods behave exactly like |TLS_method| and +// |DTLS_method| except they also call |SSL_CTX_set_min_proto_version| and +// |SSL_CTX_set_max_proto_version| to lock connections to that protocol +// version. +OPENSSL_EXPORT const SSL_METHOD *TLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_method(void); + +// These client- and server-specific methods call their corresponding generic +// methods. +OPENSSL_EXPORT const SSL_METHOD *TLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_client_method(void); + +// SSL_clear resets |ssl| to allow another connection and returns one on success +// or zero on failure. It returns most configuration state but releases memory +// associated with the current connection. +// +// Free |ssl| and create a new one instead. +OPENSSL_EXPORT int SSL_clear(SSL *ssl); + +// SSL_CTX_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_rsa_callback( + SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_set_tmp_rsa_callback(SSL *ssl, + RSA *(*cb)(SSL *ssl, int is_export, + int keylength)); + +// SSL_CTX_sess_connect returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_cb_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_misses returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_misses(const SSL_CTX *ctx); + +// SSL_CTX_sess_timeouts returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_timeouts(const SSL_CTX *ctx); + +// SSL_CTX_sess_cache_full returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cache_full(const SSL_CTX *ctx); + +// SSL_cutthrough_complete calls |SSL_in_false_start|. +OPENSSL_EXPORT int SSL_cutthrough_complete(const SSL *ssl); + +// SSL_num_renegotiations calls |SSL_total_renegotiations|. +OPENSSL_EXPORT int SSL_num_renegotiations(const SSL *ssl); + +// SSL_CTX_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx); + +// SSL_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_need_tmp_RSA(const SSL *ssl); + +// SSL_CTX_set_tmp_rsa returns one. +OPENSSL_EXPORT int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa); + +// SSL_set_tmp_rsa returns one. +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 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 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); + +// SSL_get_shared_ciphers writes an empty string to |buf| and returns a +// 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 + +// i2d_SSL_SESSION serializes |in| to the bytes pointed to by |*pp|. On success, +// it returns the number of bytes written and advances |*pp| by that many bytes. +// On failure, it returns -1. If |pp| is NULL, no bytes are written and only the +// length is returned. +// +// Use |SSL_SESSION_to_bytes| instead. +OPENSSL_EXPORT int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp); + +// d2i_SSL_SESSION parses a serialized session from the |length| bytes pointed +// to by |*pp|. It returns the new |SSL_SESSION| and advances |*pp| by the +// number of bytes consumed on success and NULL on failure. The caller takes +// ownership of the new session and must call |SSL_SESSION_free| when done. +// +// If |a| is non-NULL, |*a| is released and set the new |SSL_SESSION|. +// +// Use |SSL_SESSION_from_bytes| instead. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const uint8_t **pp, + long length); + +// i2d_SSL_SESSION_bio serializes |session| and writes the result to |bio|. It +// returns the number of bytes written on success and <= 0 on error. +OPENSSL_EXPORT int i2d_SSL_SESSION_bio(BIO *bio, const SSL_SESSION *session); + +// d2i_SSL_SESSION_bio reads a serialized |SSL_SESSION| from |bio| and returns a +// newly-allocated |SSL_SESSION| or NULL on error. If |out| is not NULL, it also +// frees |*out| and sets |*out| to the new |SSL_SESSION|. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **out); + +// ERR_load_SSL_strings does nothing. +OPENSSL_EXPORT void ERR_load_SSL_strings(void); + +// SSL_load_error_strings does nothing. +OPENSSL_EXPORT void SSL_load_error_strings(void); + +// SSL_CTX_set_tlsext_use_srtp calls |SSL_CTX_set_srtp_profiles|. It returns +// zero on success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_CTX_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_tlsext_use_srtp calls |SSL_set_srtp_profiles|. It returns zero on +// success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); + +// SSL_get_current_compression returns NULL. +OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); + +// SSL_get_current_expansion returns NULL. +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); + +// SSL_CTX_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); + +// SSL_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_set_tmp_dh(SSL *ssl, const DH *dh); + +// SSL_CTX_set_tmp_dh_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_dh_callback( + SSL_CTX *ctx, DH *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_dh_callback does nothing. +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)) +#define SSL_SESSION_set_app_data(s, a) \ + (SSL_SESSION_set_ex_data(s, 0, (char *)(a))) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s, 0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx, 0)) +#define SSL_CTX_set_app_data(ctx, arg) \ + (SSL_CTX_set_ex_data(ctx, 0, (char *)(arg))) + +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() + +#define SSL_get_cipher(ssl) SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_bits(ssl, out_alg_bits) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), out_alg_bits) +#define SSL_get_cipher_version(ssl) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_name(ssl) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_time(session) SSL_SESSION_get_time(session) +#define SSL_set_time(session, time) SSL_SESSION_set_time((session), (time)) +#define SSL_get_timeout(session) SSL_SESSION_get_timeout(session) +#define SSL_set_timeout(session, timeout) \ + SSL_SESSION_set_timeout((session), (timeout)) + +struct ssl_comp_st { + int id; + const char *name; + char *method; +}; + +DEFINE_STACK_OF(SSL_COMP) + +// The following flags do nothing and are included only to make it easier to +// compile code with BoringSSL. +#define SSL_MODE_AUTO_RETRY 0 +#define SSL_MODE_RELEASE_BUFFERS 0 +#define SSL_MODE_SEND_CLIENTHELLO_TIME 0 +#define SSL_MODE_SEND_SERVERHELLO_TIME 0 +#define SSL_OP_ALL 0 +#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0 +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0 +#define SSL_OP_EPHEMERAL_RSA 0 +#define SSL_OP_LEGACY_SERVER_CONNECT 0 +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0 +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0 +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0 +#define SSL_OP_NETSCAPE_CA_DN_BUG 0 +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0 +#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 +#define SSL_OP_SINGLE_ECDH_USE 0 +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0 +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0 +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0 +#define SSL_OP_TLS_D5_BUG 0 +#define SSL_OP_TLS_ROLLBACK_BUG 0 +#define SSL_VERIFY_CLIENT_ONCE 0 + +// SSL_cache_hit calls |SSL_session_reused|. +OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); + +// SSL_get_default_timeout returns |SSL_DEFAULT_SESSION_TIMEOUT|. +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 "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 +// |SSL_get_ciphers| or NULL if out of range. Use |SSL_get_ciphers| instead. +OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); + +// SSL_CTX_set_client_cert_cb sets a callback which is called on the client if +// the server requests a client certificate and none is configured. On success, +// the callback should return one and set |*out_x509| to |*out_pkey| to a leaf +// certificate and private key, respectively, passing ownership. It should +// return zero to send no certificate and -1 to fail or pause the handshake. If +// the handshake is paused, |SSL_get_error| will return +// |SSL_ERROR_WANT_X509_LOOKUP|. +// +// The callback may call |SSL_get0_certificate_types| and +// |SSL_get_client_CA_list| for information on the server's certificate request. +// +// Use |SSL_CTX_set_cert_cb| instead. Configuring intermediate certificates with +// this function is confusing. This callback may not be registered concurrently +// with |SSL_CTX_set_cert_cb| or |SSL_set_cert_cb|. +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 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. +OPENSSL_EXPORT int SSL_want(const SSL *ssl); + +#define SSL_want_read(ssl) (SSL_want(ssl) == SSL_READING) +#define SSL_want_write(ssl) (SSL_want(ssl) == SSL_WRITING) + + // 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 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 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, + size_t count); + +// SSL_alert_type_string returns "!". Use |SSL_alert_type_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_type_string(int value); + +// SSL_alert_desc_string returns "!!". Use |SSL_alert_desc_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_desc_string(int value); + +// SSL_state_string returns "!!!!!!". Use |SSL_state_string_long| for a more +// intelligible string. +OPENSSL_EXPORT const char *SSL_state_string(const SSL *ssl); + +// SSL_TXT_* expand to strings. +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" +#define SSL_TXT_FIPS "FIPS" +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHE "kDHE" +#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_kECDHE "kECDHE" +#define SSL_TXT_kEECDH "kEECDH" +#define SSL_TXT_kPSK "kPSK" +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aECDSA "aECDSA" +#define SSL_TXT_aPSK "aPSK" +#define SSL_TXT_DH "DH" +#define SSL_TXT_DHE "DHE" +#define SSL_TXT_EDH "EDH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_ECDH "ECDH" +#define SSL_TXT_ECDHE "ECDHE" +#define SSL_TXT_EECDH "EECDH" +#define SSL_TXT_ECDSA "ECDSA" +#define SSL_TXT_PSK "PSK" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_AES128 "AES128" +#define SSL_TXT_AES256 "AES256" +#define SSL_TXT_AES "AES" +#define SSL_TXT_AES_GCM "AESGCM" +#define SSL_TXT_CHACHA20 "CHACHA20" +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" +#define SSL_TXT_SHA256 "SHA256" +#define SSL_TXT_SHA384 "SHA384" +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_TLSV1_1 "TLSv1.1" +#define SSL_TXT_TLSV1_2 "TLSv1.2" +#define SSL_TXT_TLSV1_3 "TLSv1.3" +#define SSL_TXT_ALL "ALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +typedef struct ssl_conf_ctx_st SSL_CONF_CTX; + +// SSL_state returns |SSL_ST_INIT| if a handshake is in progress and |SSL_ST_OK| +// otherwise. +// +// Use |SSL_is_init| instead. +OPENSSL_EXPORT int SSL_state(const SSL *ssl); + +#define SSL_get_state(ssl) SSL_state(ssl) + +// SSL_set_shutdown causes |ssl| to behave as if the shutdown bitmask (see +// |SSL_get_shutdown|) were |mode|. This may be used to skip sending or +// receiving close_notify in |SSL_shutdown| by causing the implementation to +// believe the events already happened. +// +// It is an error to use |SSL_set_shutdown| to unset a bit that has already been +// set. Doing so will trigger an |assert| in debug builds and otherwise be +// ignored. +// +// Use |SSL_CTX_set_quiet_shutdown| instead. +OPENSSL_EXPORT void SSL_set_shutdown(SSL *ssl, int mode); + +// SSL_CTX_set_tmp_ecdh calls |SSL_CTX_set1_curves| with a one-element list +// containing |ec_key|'s curve. +OPENSSL_EXPORT int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key); + +// SSL_set_tmp_ecdh calls |SSL_set1_curves| with a one-element list containing +// |ec_key|'s curve. +OPENSSL_EXPORT int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key); + +// SSL_add_dir_cert_subjects_to_stack lists files in directory |dir|. It calls +// |SSL_add_file_cert_subjects_to_stack| on each file and returns one on success +// or zero on error. This function is only available from the libdecrepit +// library. +OPENSSL_EXPORT int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *dir); + +// SSL_set_verify_result calls |abort| unless |result| is |X509_V_OK|. +// +// TODO(davidben): Remove this function once it has been removed from +// netty-tcnative. +OPENSSL_EXPORT void SSL_set_verify_result(SSL *ssl, long result); + +// SSL_CTX_enable_tls_channel_id calls |SSL_CTX_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx); + +// SSL_enable_tls_channel_id calls |SSL_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_enable_tls_channel_id(SSL *ssl); + +// BIO_f_ssl returns a |BIO_METHOD| that can wrap an |SSL*| in a |BIO*|. Note +// that this has quite different behaviour from the version in OpenSSL (notably +// that it doesn't try to auto renegotiate). +// +// IMPORTANT: if you are not curl, don't use this. +OPENSSL_EXPORT const BIO_METHOD *BIO_f_ssl(void); + +// BIO_set_ssl sets |ssl| as the underlying connection for |bio|, which must +// have been created using |BIO_f_ssl|. If |take_owership| is true, |bio| will +// call |SSL_free| on |ssl| when closed. It returns one on success or something +// other than one on error. +OPENSSL_EXPORT long BIO_set_ssl(BIO *bio, SSL *ssl, int take_owership); + +// SSL_CTX_set_ecdh_auto returns one. +#define SSL_CTX_set_ecdh_auto(ctx, onoff) 1 + +// SSL_set_ecdh_auto returns one. +#define SSL_set_ecdh_auto(ssl, onoff) 1 + +// SSL_get_session returns a non-owning pointer to |ssl|'s session. For +// historical reasons, which session it returns depends on |ssl|'s state. +// +// Prior to the start of the initial handshake, it returns the session the +// caller set with |SSL_set_session|. After the initial handshake has finished +// and if no additional handshakes are in progress, it returns the currently +// active session. Its behavior is undefined while a handshake is in progress. +// +// If trying to add new sessions to an external session cache, use +// |SSL_CTX_sess_set_new_cb| instead. In particular, using the callback is +// required as of TLS 1.3. For compatibility, this function will return an +// unresumable session which may be cached, but will never be resumed. +// +// If querying properties of the connection, use APIs on the |SSL| object. +OPENSSL_EXPORT SSL_SESSION *SSL_get_session(const SSL *ssl); + +// SSL_get0_session is an alias for |SSL_get_session|. +#define SSL_get0_session SSL_get_session + +// SSL_get1_session acts like |SSL_get_session| but returns a new reference to +// the session. +OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); + +#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_SSL_DEFAULT 0 + +// OPENSSL_init_ssl calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, + const OPENSSL_INIT_SETTINGS *settings); + +// 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 + +// 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. +// +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); + +// 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); + +// 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); + +// 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__) + + +// 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. +// +// Although using either the CTRL values or their wrapper macros in #ifdefs is +// still supported, the CTRL values may not be passed to |SSL_ctrl| and +// |SSL_CTX_ctrl|. Call the functions (previously wrapper macros) instead. +// +// See PORTING.md in the BoringSSL source tree for a table of corresponding +// functions. +// https://boringssl.googlesource.com/boringssl/+/master/PORTING.md#Replacements-for-values + +#define DTLS_CTRL_GET_TIMEOUT doesnt_exist +#define DTLS_CTRL_HANDLE_TIMEOUT doesnt_exist +#define SSL_CTRL_CHAIN doesnt_exist +#define SSL_CTRL_CHAIN_CERT doesnt_exist +#define SSL_CTRL_CHANNEL_ID doesnt_exist +#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_CLEAR_MODE doesnt_exist +#define SSL_CTRL_CLEAR_OPTIONS doesnt_exist +#define SSL_CTRL_EXTRA_CHAIN_CERT doesnt_exist +#define SSL_CTRL_GET_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_CHANNEL_ID doesnt_exist +#define SSL_CTRL_GET_CLIENT_CERT_TYPES doesnt_exist +#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_MAX_CERT_LIST doesnt_exist +#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 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS doesnt_exist +#define SSL_CTRL_MODE doesnt_exist +#define SSL_CTRL_NEED_TMP_RSA doesnt_exist +#define SSL_CTRL_OPTIONS doesnt_exist +#define SSL_CTRL_SESS_NUMBER doesnt_exist +#define SSL_CTRL_SET_CURVES doesnt_exist +#define SSL_CTRL_SET_CURVES_LIST doesnt_exist +#define SSL_CTRL_SET_ECDH_AUTO doesnt_exist +#define SSL_CTRL_SET_MAX_CERT_LIST doesnt_exist +#define SSL_CTRL_SET_MAX_SEND_FRAGMENT doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK_ARG doesnt_exist +#define SSL_CTRL_SET_MTU doesnt_exist +#define SSL_CTRL_SET_READ_AHEAD doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_MODE doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_SIZE doesnt_exist +#define SSL_CTRL_SET_TLSEXT_HOSTNAME doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB doesnt_exist +#define SSL_CTRL_SET_TMP_DH doesnt_exist +#define SSL_CTRL_SET_TMP_DH_CB doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH_CB doesnt_exist +#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) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +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, + kDiscard, + kIncompleteRecord, + kAlertCloseNotify, + kError, +}; + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// OpenRecord decrypts the first complete SSL record from |in| in-place, sets +// |out| to the decrypted application data, and |out_record_len| to the length +// of the encrypted record. Returns: +// - kOK if an application-data record was successfully decrypted and verified. +// - kDiscard if a record was sucessfully processed, but should be discarded. +// - kIncompleteRecord if |in| did not contain a complete record. +// - kAlertCloseNotify if a record was successfully processed but is a +// close_notify alert. +// - kError if an error occurred or the record is invalid. |*out_alert| will be +// set to an alert to emit, or zero if no alert should be emitted. +OPENSSL_EXPORT OpenRecordResult OpenRecord(SSL *ssl, Span *out, + size_t *out_record_len, + uint8_t *out_alert, + Span in); + +OPENSSL_EXPORT size_t SealRecordPrefixLen(const SSL *ssl, size_t plaintext_len); + +// SealRecordSuffixLen returns the length of the suffix written by |SealRecord|. +// +// |plaintext_len| must be equal to the size of the plaintext passed to +// |SealRecord|. +// +// |plaintext_len| must not exceed |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The returned +// suffix length will not exceed |SSL3_RT_MAX_ENCRYPTED_OVERHEAD|. +OPENSSL_EXPORT size_t SealRecordSuffixLen(const SSL *ssl, size_t plaintext_len); + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// SealRecord encrypts the cleartext of |in| and scatters the resulting TLS +// application data record between |out_prefix|, |out|, and |out_suffix|. It +// returns true on success or false if an error occurred. +// +// The length of |out_prefix| must equal |SealRecordPrefixLen|. The length of +// |out| must equal the length of |in|, which must not exceed +// |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The length of |out_suffix| must equal +// |SealRecordSuffixLen|. +// +// If enabled, |SealRecord| may perform TLS 1.0 CBC 1/n-1 record splitting. +// |SealRecordPrefixLen| accounts for the required overhead if that is the case. +// +// |out| may equal |in| to encrypt in-place but may not otherwise alias. +// |out_prefix| and |out_suffix| may not alias anything. +OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, + Span out, Span out_suffix, + Span in); + + +// *** EXPERIMENTAL β€” DO NOT USE WITHOUT CHECKING *** +// +// Split handshakes. +// +// Split handshakes allows the handshake part of a TLS connection to be +// performed in a different process (or on a different machine) than the data +// exchange. This only applies to servers. +// +// In the first part of a split handshake, an |SSL| (where the |SSL_CTX| has +// been configured with |SSL_CTX_set_handoff_mode|) is used normally. Once the +// ClientHello message has been received, the handshake will stop and +// |SSL_get_error| will indicate |SSL_ERROR_HANDOFF|. At this point (and only +// at this point), |SSL_serialize_handoff| can be called to write the β€œhandoff” +// 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|, 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 +// as normal. +// +// 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 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 +// fatal. +// WARNING: The handback data contains sensitive key material and must be +// protected. +// WARNING: Some calls on the final |SSL| will not work. Just as an example, +// calls like |SSL_get0_session_id_context| and |SSL_get_privatekey| won't +// work because the certificate used for handshaking isn't available. +// WARNING: |SSL_apply_handoff| may trigger β€œmsg” callback calls. + +OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); +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); + +// 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++ + +#endif // !defined(BORINGSSL_NO_CXX) + +#endif + +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 101 +#define SSL_R_BAD_ALERT 102 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 104 +#define SSL_R_BAD_DH_P_LENGTH 105 +#define SSL_R_BAD_DIGEST_LENGTH 106 +#define SSL_R_BAD_ECC_CERT 107 +#define SSL_R_BAD_ECPOINT 108 +#define SSL_R_BAD_HANDSHAKE_RECORD 109 +#define SSL_R_BAD_HELLO_REQUEST 110 +#define SSL_R_BAD_LENGTH 111 +#define SSL_R_BAD_PACKET_LENGTH 112 +#define SSL_R_BAD_RSA_ENCRYPT 113 +#define SSL_R_BAD_SIGNATURE 114 +#define SSL_R_BAD_SRTP_MKI_VALUE 115 +#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 116 +#define SSL_R_BAD_SSL_FILETYPE 117 +#define SSL_R_BAD_WRITE_RETRY 118 +#define SSL_R_BIO_NOT_SET 119 +#define SSL_R_BN_LIB 120 +#define SSL_R_BUFFER_TOO_SMALL 121 +#define SSL_R_CA_DN_LENGTH_MISMATCH 122 +#define SSL_R_CA_DN_TOO_LONG 123 +#define SSL_R_CCS_RECEIVED_EARLY 124 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 125 +#define SSL_R_CERT_CB_ERROR 126 +#define SSL_R_CERT_LENGTH_MISMATCH 127 +#define SSL_R_CHANNEL_ID_NOT_P256 128 +#define SSL_R_CHANNEL_ID_SIGNATURE_INVALID 129 +#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 130 +#define SSL_R_CLIENTHELLO_PARSE_FAILED 131 +#define SSL_R_CLIENTHELLO_TLSEXT 132 +#define SSL_R_CONNECTION_REJECTED 133 +#define SSL_R_CONNECTION_TYPE_NOT_SET 134 +#define SSL_R_CUSTOM_EXTENSION_ERROR 135 +#define SSL_R_DATA_LENGTH_TOO_LONG 136 +#define SSL_R_DECODE_ERROR 137 +#define SSL_R_DECRYPTION_FAILED 138 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 139 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 140 +#define SSL_R_DH_P_TOO_LONG 141 +#define SSL_R_DIGEST_CHECK_FAILED 142 +#define SSL_R_DTLS_MESSAGE_TOO_BIG 143 +#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 144 +#define SSL_R_EMS_STATE_INCONSISTENT 145 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 146 +#define SSL_R_ERROR_ADDING_EXTENSION 147 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 148 +#define SSL_R_ERROR_PARSING_EXTENSION 149 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 150 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 151 +#define SSL_R_FRAGMENT_MISMATCH 152 +#define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 153 +#define SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO 154 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_INAPPROPRIATE_FALLBACK 157 +#define SSL_R_INVALID_COMMAND 158 +#define SSL_R_INVALID_MESSAGE 159 +#define SSL_R_INVALID_SSL_SESSION 160 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 161 +#define SSL_R_LENGTH_MISMATCH 162 +#define SSL_R_MISSING_EXTENSION 164 +#define SSL_R_MISSING_RSA_CERTIFICATE 165 +#define SSL_R_MISSING_TMP_DH_KEY 166 +#define SSL_R_MISSING_TMP_ECDH_KEY 167 +#define SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS 168 +#define SSL_R_MTU_TOO_SMALL 169 +#define SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN 170 +#define SSL_R_NESTED_GROUP 171 +#define SSL_R_NO_CERTIFICATES_RETURNED 172 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 173 +#define SSL_R_NO_CERTIFICATE_SET 174 +#define SSL_R_NO_CIPHERS_AVAILABLE 175 +#define SSL_R_NO_CIPHERS_PASSED 176 +#define SSL_R_NO_CIPHER_MATCH 177 +#define SSL_R_NO_COMPRESSION_SPECIFIED 178 +#define SSL_R_NO_METHOD_SPECIFIED 179 +#define SSL_R_NO_P256_SUPPORT 180 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 181 +#define SSL_R_NO_RENEGOTIATION 182 +#define SSL_R_NO_REQUIRED_DIGEST 183 +#define SSL_R_NO_SHARED_CIPHER 184 +#define SSL_R_NULL_SSL_CTX 185 +#define SSL_R_NULL_SSL_METHOD_PASSED 186 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 187 +#define SSL_R_OLD_SESSION_VERSION_NOT_RETURNED 188 +#define SSL_R_OUTPUT_ALIASES_INPUT 189 +#define SSL_R_PARSE_TLSEXT 190 +#define SSL_R_PATH_TOO_LONG 191 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 192 +#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 193 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 194 +#define SSL_R_PSK_IDENTITY_NOT_FOUND 195 +#define SSL_R_PSK_NO_CLIENT_CB 196 +#define SSL_R_PSK_NO_SERVER_CB 197 +#define SSL_R_READ_TIMEOUT_EXPIRED 198 +#define SSL_R_RECORD_LENGTH_MISMATCH 199 +#define SSL_R_RECORD_TOO_LARGE 200 +#define SSL_R_RENEGOTIATION_ENCODING_ERR 201 +#define SSL_R_RENEGOTIATION_MISMATCH 202 +#define SSL_R_REQUIRED_CIPHER_MISSING 203 +#define SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION 204 +#define SSL_R_RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION 205 +#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 206 +#define SSL_R_SERVERHELLO_TLSEXT 207 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 208 +#define SSL_R_SESSION_MAY_NOT_BE_CREATED 209 +#define SSL_R_SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER 210 +#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 211 +#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 212 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 213 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 214 +#define SSL_R_SSL_HANDSHAKE_FAILURE 215 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 216 +#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 217 +#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 218 +#define SSL_R_TOO_MANY_EMPTY_FRAGMENTS 219 +#define SSL_R_TOO_MANY_WARNING_ALERTS 220 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 221 +#define SSL_R_UNEXPECTED_EXTENSION 222 +#define SSL_R_UNEXPECTED_MESSAGE 223 +#define SSL_R_UNEXPECTED_OPERATOR_IN_GROUP 224 +#define SSL_R_UNEXPECTED_RECORD 225 +#define SSL_R_UNINITIALIZED 226 +#define SSL_R_UNKNOWN_ALERT_TYPE 227 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 228 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 229 +#define SSL_R_UNKNOWN_CIPHER_TYPE 230 +#define SSL_R_UNKNOWN_DIGEST 231 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 232 +#define SSL_R_UNKNOWN_PROTOCOL 233 +#define SSL_R_UNKNOWN_SSL_VERSION 234 +#define SSL_R_UNKNOWN_STATE 235 +#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 236 +#define SSL_R_UNSUPPORTED_CIPHER 237 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 238 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 239 +#define SSL_R_UNSUPPORTED_PROTOCOL 240 +#define SSL_R_WRONG_CERTIFICATE_TYPE 241 +#define SSL_R_WRONG_CIPHER_RETURNED 242 +#define SSL_R_WRONG_CURVE 243 +#define SSL_R_WRONG_MESSAGE_TYPE 244 +#define SSL_R_WRONG_SIGNATURE_TYPE 245 +#define SSL_R_WRONG_SSL_VERSION 246 +#define SSL_R_WRONG_VERSION_NUMBER 247 +#define SSL_R_X509_LIB 248 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 249 +#define SSL_R_SHUTDOWN_WHILE_IN_INIT 250 +#define SSL_R_INVALID_OUTER_RECORD_TYPE 251 +#define SSL_R_UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY 252 +#define SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS 253 +#define SSL_R_DOWNGRADE_DETECTED 254 +#define SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE 255 +#define SSL_R_INVALID_COMPRESSION_LIST 256 +#define SSL_R_DUPLICATE_EXTENSION 257 +#define SSL_R_MISSING_KEY_SHARE 258 +#define SSL_R_INVALID_ALPN_PROTOCOL 259 +#define SSL_R_TOO_MANY_KEY_UPDATES 260 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 261 +#define SSL_R_NO_CIPHERS_SPECIFIED 262 +#define SSL_R_RENEGOTIATION_EMS_MISMATCH 263 +#define SSL_R_DUPLICATE_KEY_SHARE 264 +#define SSL_R_NO_GROUPS_SPECIFIED 265 +#define SSL_R_NO_SHARED_GROUP 266 +#define SSL_R_PRE_SHARED_KEY_MUST_BE_LAST 267 +#define SSL_R_OLD_SESSION_PRF_HASH_MISMATCH 268 +#define SSL_R_INVALID_SCT_LIST 269 +#define SSL_R_TOO_MUCH_SKIPPED_EARLY_DATA 270 +#define SSL_R_PSK_IDENTITY_BINDER_COUNT_MISMATCH 271 +#define SSL_R_CANNOT_PARSE_LEAF_CERT 272 +#define SSL_R_SERVER_CERT_CHANGED 273 +#define SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH 274 +#define SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD 275 +#define SSL_R_TICKET_ENCRYPTION_FAILED 276 +#define SSL_R_ALPN_MISMATCH_ON_EARLY_DATA 277 +#define SSL_R_WRONG_VERSION_ON_EARLY_DATA 278 +#define SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA 279 +#define SSL_R_NO_SUPPORTED_VERSIONS_ENABLED 280 +#define SSL_R_APPLICATION_DATA_INSTEAD_OF_HANDSHAKE 281 +#define SSL_R_EMPTY_HELLO_RETRY_REQUEST 282 +#define SSL_R_EARLY_DATA_NOT_IN_USE 283 +#define SSL_R_HANDSHAKE_NOT_COMPLETE 284 +#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 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 +#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 +#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 +#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 +#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 +#define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 +#define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 + +#endif // OPENSSL_HEADER_SSL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back new file mode 100644 index 0000000..042ccb5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back @@ -0,0 +1,5039 @@ +/* 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_H +#define OPENSSL_HEADER_SSL_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#endif + +// NGINX needs this #include. Consider revisiting this after NGINX 1.14.0 has +// been out for a year or so (assuming that they fix it in that release.) See +// https://boringssl-review.googlesource.com/c/boringssl/+/21664. +#include + +// Forward-declare struct timeval. On Windows, it is defined in winsock2.h and +// Windows headers define too many macros to be included in public headers. +// However, only a forward declaration is needed. +struct timeval; + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SSL implementation. + + +// SSL contexts. +// +// |SSL_CTX| objects manage shared state and configuration between multiple TLS +// or DTLS connections. Whether the connections are TLS or DTLS is selected by +// an |SSL_METHOD| on creation. +// +// |SSL_CTX| are reference-counted and may be shared by connections across +// 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 connections. +OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); + +// DTLS_method is the |SSL_METHOD| used for DTLS connections. +OPENSSL_EXPORT const SSL_METHOD *DTLS_method(void); + +// TLS_with_buffers_method is like |TLS_method|, but avoids all use of +// crypto/x509. All client connections created with |TLS_with_buffers_method| +// will fail unless a certificate verifier is installed with +// |SSL_set_custom_verify| or |SSL_CTX_set_custom_verify|. +OPENSSL_EXPORT const SSL_METHOD *TLS_with_buffers_method(void); + +// DTLS_with_buffers_method is like |DTLS_method|, but avoids all use of +// crypto/x509. +OPENSSL_EXPORT const SSL_METHOD *DTLS_with_buffers_method(void); + +// SSL_CTX_new returns a newly-allocated |SSL_CTX| with default settings or NULL +// on error. +OPENSSL_EXPORT SSL_CTX *SSL_CTX_new(const SSL_METHOD *method); + +// SSL_CTX_up_ref increments the reference count of |ctx|. It returns one. +OPENSSL_EXPORT int SSL_CTX_up_ref(SSL_CTX *ctx); + +// SSL_CTX_free releases memory associated with |ctx|. +OPENSSL_EXPORT void SSL_CTX_free(SSL_CTX *ctx); + + +// SSL connections. +// +// An |SSL| object represents a single TLS or DTLS connection. Although the +// shared |SSL_CTX| is thread-safe, an |SSL| is not thread-safe and may only be +// used on one thread at a time. + +// SSL_new returns a newly-allocated |SSL| using |ctx| or NULL on error. The new +// connection inherits settings from |ctx| at the time of creation. Settings may +// also be individually configured on the connection. +// +// On creation, an |SSL| is not configured to be either a client or server. Call +// |SSL_set_connect_state| or |SSL_set_accept_state| to set this. +OPENSSL_EXPORT SSL *SSL_new(SSL_CTX *ctx); + +// SSL_free releases memory associated with |ssl|. +OPENSSL_EXPORT void SSL_free(SSL *ssl); + +// SSL_get_SSL_CTX returns the |SSL_CTX| associated with |ssl|. If +// |SSL_set_SSL_CTX| is called, it returns the new |SSL_CTX|, not the initial +// one. +OPENSSL_EXPORT SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); + +// SSL_set_connect_state configures |ssl| to be a client. +OPENSSL_EXPORT void SSL_set_connect_state(SSL *ssl); + +// SSL_set_accept_state configures |ssl| to be a server. +OPENSSL_EXPORT void SSL_set_accept_state(SSL *ssl); + +// SSL_is_server returns one if |ssl| is configured as a server and zero +// otherwise. +OPENSSL_EXPORT int SSL_is_server(const SSL *ssl); + +// SSL_is_dtls returns one if |ssl| is a DTLS connection and zero otherwise. +OPENSSL_EXPORT int SSL_is_dtls(const SSL *ssl); + +// SSL_set_bio configures |ssl| to read from |rbio| and write to |wbio|. |ssl| +// takes ownership of the two |BIO|s. If |rbio| and |wbio| are the same, |ssl| +// only takes ownership of one reference. +// +// In DTLS, |rbio| must be non-blocking to properly handle timeouts and +// retransmits. +// +// If |rbio| is the same as the currently configured |BIO| for reading, that +// side is left untouched and is not freed. +// +// If |wbio| is the same as the currently configured |BIO| for writing AND |ssl| +// is not currently configured to read from and write to the same |BIO|, that +// side is left untouched and is not freed. This asymmetry is present for +// historical reasons. +// +// Due to the very complex historical behavior of this function, calling this +// function if |ssl| already has |BIO|s configured is deprecated. Prefer +// |SSL_set0_rbio| and |SSL_set0_wbio| instead. +OPENSSL_EXPORT void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); + +// SSL_set0_rbio configures |ssl| to write to |rbio|. It takes ownership of +// |rbio|. +// +// Note that, although this function and |SSL_set0_wbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_rbio(SSL *ssl, BIO *rbio); + +// SSL_set0_wbio configures |ssl| to write to |wbio|. It takes ownership of +// |wbio|. +// +// Note that, although this function and |SSL_set0_rbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_wbio(SSL *ssl, BIO *wbio); + +// SSL_get_rbio returns the |BIO| that |ssl| reads from. +OPENSSL_EXPORT BIO *SSL_get_rbio(const SSL *ssl); + +// SSL_get_wbio returns the |BIO| that |ssl| writes to. +OPENSSL_EXPORT BIO *SSL_get_wbio(const SSL *ssl); + +// SSL_get_fd calls |SSL_get_rfd|. +OPENSSL_EXPORT int SSL_get_fd(const SSL *ssl); + +// SSL_get_rfd returns the file descriptor that |ssl| is configured to read +// from. If |ssl|'s read |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_rfd(const SSL *ssl); + +// SSL_get_wfd returns the file descriptor that |ssl| is configured to write +// to. If |ssl|'s write |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_wfd(const SSL *ssl); + +// SSL_set_fd configures |ssl| to read from and write to |fd|. It returns one +// on success and zero on allocation error. The caller retains ownership of +// |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_fd(SSL *ssl, int fd); + +// SSL_set_rfd configures |ssl| to read from |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_rfd(SSL *ssl, int fd); + +// SSL_set_wfd configures |ssl| to write to |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd); + +// SSL_do_handshake continues the current handshake. If there is none or the +// handshake has completed or False Started, it returns one. Otherwise, it +// returns <= 0. The caller should pass the value into |SSL_get_error| to +// determine how to proceed. +// +// In DTLS, the caller must drive retransmissions. Whenever |SSL_get_error| +// signals |SSL_ERROR_WANT_READ|, use |DTLSv1_get_timeout| to determine the +// current timeout. If it expires before the next retry, call +// |DTLSv1_handle_timeout|. Note that DTLS handshake retransmissions use fresh +// sequence numbers, so it is not sufficient to replay packets at the transport. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_do_handshake(SSL *ssl); + +// SSL_connect configures |ssl| as a client, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_connect(SSL *ssl); + +// SSL_accept configures |ssl| as a server, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_accept(SSL *ssl); + +// SSL_read reads up to |num| bytes from |ssl| into |buf|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes read. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_read(SSL *ssl, void *buf, int num); + +// SSL_peek behaves like |SSL_read| but does not consume any bytes returned. +OPENSSL_EXPORT int SSL_peek(SSL *ssl, void *buf, int num); + +// SSL_pending returns the number of bytes available in |ssl|. It does not read +// from the transport. +OPENSSL_EXPORT int SSL_pending(const SSL *ssl); + +// SSL_write writes up to |num| bytes from |buf| into |ssl|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes written. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// In TLS, a non-blocking |SSL_write| differs from non-blocking |write| in that +// a failed |SSL_write| still commits to the data passed in. When retrying, the +// caller must supply the original write buffer (or a larger one containing the +// original as a prefix). By default, retries will fail if they also do not +// reuse the same |buf| pointer. This may be relaxed with +// |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER|, but the buffer contents still must be +// unchanged. +// +// By default, in TLS, |SSL_write| will not return success until all |num| bytes +// are written. This may be relaxed with |SSL_MODE_ENABLE_PARTIAL_WRITE|. It +// allows |SSL_write| to complete with a partial result when only part of the +// input was written in a single record. +// +// In DTLS, neither |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER| and +// |SSL_MODE_ENABLE_PARTIAL_WRITE| do anything. The caller may retry with a +// different buffer freely. A single call to |SSL_write| only ever writes a +// single record in a single packet, so |num| must be at most +// |SSL3_RT_MAX_PLAIN_LENGTH|. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); + +// 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. +// +// 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 +// enabled, |SSL_shutdown| will not send a close_notify alert or wait for one +// from the peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ctx|. +OPENSSL_EXPORT int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); + +// SSL_set_quiet_shutdown sets quiet shutdown on |ssl| to |mode|. If enabled, +// |SSL_shutdown| will not send a close_notify alert or wait for one from the +// peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_set_quiet_shutdown(SSL *ssl, int mode); + +// SSL_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ssl|. +OPENSSL_EXPORT int SSL_get_quiet_shutdown(const SSL *ssl); + +// SSL_get_error returns a |SSL_ERROR_*| value for the most recent operation on +// |ssl|. It should be called after an operation failed to determine whether the +// error was fatal and, if not, when to retry. +OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); + +// SSL_ERROR_NONE indicates the operation succeeded. +#define SSL_ERROR_NONE 0 + +// SSL_ERROR_SSL indicates the operation failed within the library. The caller +// may inspect the error queue for more information. +#define SSL_ERROR_SSL 1 + +// SSL_ERROR_WANT_READ indicates the operation failed attempting to read from +// the transport. The caller may retry the operation when the transport is ready +// for reading. +// +// If signaled by a DTLS handshake, the caller must also call +// |DTLSv1_get_timeout| and |DTLSv1_handle_timeout| as appropriate. See +// |SSL_do_handshake|. +#define SSL_ERROR_WANT_READ 2 + +// SSL_ERROR_WANT_WRITE indicates the operation failed attempting to write to +// the transport. The caller may retry the operation when the transport is ready +// for writing. +#define SSL_ERROR_WANT_WRITE 3 + +// SSL_ERROR_WANT_X509_LOOKUP indicates the operation failed in calling the +// |cert_cb| or |client_cert_cb|. The caller may retry the operation when the +// callback is ready to return a certificate or one has been configured +// externally. +// +// See also |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb|. +#define SSL_ERROR_WANT_X509_LOOKUP 4 + +// SSL_ERROR_SYSCALL indicates the operation failed externally to the library. +// The caller should consult the system-specific error mechanism. This is +// typically |errno| but may be something custom if using a custom |BIO|. It +// may also be signaled if the transport returned EOF, in which case the +// operation's return value will be zero. +#define SSL_ERROR_SYSCALL 5 + +// SSL_ERROR_ZERO_RETURN indicates the operation failed because the connection +// was cleanly shut down with a close_notify alert. +#define SSL_ERROR_ZERO_RETURN 6 + +// SSL_ERROR_WANT_CONNECT indicates the operation failed attempting to connect +// the transport (the |BIO| signaled |BIO_RR_CONNECT|). The caller may retry the +// operation when the transport is ready. +#define SSL_ERROR_WANT_CONNECT 7 + +// SSL_ERROR_WANT_ACCEPT indicates the operation failed attempting to accept a +// connection from the transport (the |BIO| signaled |BIO_RR_ACCEPT|). The +// caller may retry the operation when the transport is ready. +// +// TODO(davidben): Remove this. It's used by accept BIOs which are bizarre. +#define SSL_ERROR_WANT_ACCEPT 8 + +// SSL_ERROR_WANT_CHANNEL_ID_LOOKUP indicates the operation failed looking up +// the Channel ID key. The caller may retry the operation when |channel_id_cb| +// is ready to return a key or one has been configured with +// |SSL_set1_tls_channel_id|. +// +// See also |SSL_CTX_set_channel_id_cb|. +#define SSL_ERROR_WANT_CHANNEL_ID_LOOKUP 9 + +// SSL_ERROR_PENDING_SESSION indicates the operation failed because the session +// lookup callback indicated the session was unavailable. The caller may retry +// the operation when lookup has completed. +// +// See also |SSL_CTX_sess_set_get_cb| and |SSL_magic_pending_session_ptr|. +#define SSL_ERROR_PENDING_SESSION 11 + +// SSL_ERROR_PENDING_CERTIFICATE indicates the operation failed because the +// early callback indicated certificate lookup was incomplete. The caller may +// retry the operation when lookup has completed. +// +// See also |SSL_CTX_set_select_certificate_cb|. +#define SSL_ERROR_PENDING_CERTIFICATE 12 + +// SSL_ERROR_WANT_PRIVATE_KEY_OPERATION indicates the operation failed because +// a private key operation was unfinished. The caller may retry the operation +// when the private key operation is complete. +// +// See also |SSL_set_private_key_method| and +// |SSL_CTX_set_private_key_method|. +#define SSL_ERROR_WANT_PRIVATE_KEY_OPERATION 13 + +// SSL_ERROR_PENDING_TICKET indicates that a ticket decryption is pending. The +// caller may retry the operation when the decryption is ready. +// +// See also |SSL_CTX_set_ticket_aead_method|. +#define SSL_ERROR_PENDING_TICKET 14 + +// SSL_ERROR_EARLY_DATA_REJECTED indicates that early data was rejected. The +// caller should treat this as a connection failure and retry any operations +// associated with the rejected early data. |SSL_reset_early_data_reject| may be +// used to reuse the underlying connection for the retry. +#define SSL_ERROR_EARLY_DATA_REJECTED 15 + +// SSL_ERROR_WANT_CERTIFICATE_VERIFY indicates the operation failed because +// certificate verification was incomplete. The caller may retry the operation +// when certificate verification is complete. +// +// See also |SSL_CTX_set_custom_verify|. +#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. +OPENSSL_EXPORT int SSL_set_mtu(SSL *ssl, unsigned mtu); + +// DTLSv1_set_initial_timeout_duration sets the initial duration for a DTLS +// handshake timeout. +// +// This duration overrides the default of 1 second, which is the strong +// recommendation of RFC 6347 (see section 4.2.4.1). However, there may exist +// situations where a shorter timeout would be beneficial, such as for +// time-sensitive applications. +OPENSSL_EXPORT void DTLSv1_set_initial_timeout_duration(SSL *ssl, + unsigned duration_ms); + +// DTLSv1_get_timeout queries the next DTLS handshake timeout. If there is a +// timeout in progress, it sets |*out| to the time remaining and returns one. +// Otherwise, it returns zero. +// +// When the timeout expires, call |DTLSv1_handle_timeout| to handle the +// retransmit behavior. +// +// NOTE: This function must be queried again whenever the handshake state +// machine changes, including when |DTLSv1_handle_timeout| is called. +OPENSSL_EXPORT int DTLSv1_get_timeout(const SSL *ssl, struct timeval *out); + +// DTLSv1_handle_timeout is called when a DTLS handshake timeout expires. If no +// timeout had expired, it returns 0. Otherwise, it retransmits the previous +// flight of handshake messages and returns 1. If too many timeouts had expired +// without progress or an error occurs, it returns -1. +// +// The caller's external timer should be compatible with the one |ssl| queries +// within some fudge factor. Otherwise, the call will be a no-op, but +// |DTLSv1_get_timeout| will return an updated timeout. +// +// If the function returns -1, checking if |SSL_get_error| returns +// |SSL_ERROR_WANT_WRITE| may be used to determine if the retransmit failed due +// to a non-fatal error at the write |BIO|. However, the operation may not be +// retried until the next timeout fires. +// +// WARNING: This function breaks the usual return value convention. +// +// TODO(davidben): This |SSL_ERROR_WANT_WRITE| behavior is kind of bizarre. +OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); + + +// Protocol versions. + +#define DTLS1_VERSION_MAJOR 0xfe +#define SSL3_VERSION_MAJOR 0x03 + +#define SSL3_VERSION 0x0300 +#define TLS1_VERSION 0x0301 +#define TLS1_1_VERSION 0x0302 +#define TLS1_2_VERSION 0x0303 +#define TLS1_3_VERSION 0x0304 + +#define DTLS1_VERSION 0xfeff +#define DTLS1_2_VERSION 0xfefd + +// 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. +OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, + uint16_t version); + +// SSL_CTX_set_max_proto_version sets the maximum protocol version for |ctx| to +// |version|. If |version| is zero, the default maximum version is used. It +// returns one on success and zero if |version| is invalid. +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. +OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); + +// SSL_set_max_proto_version sets the maximum protocol version for |ssl| to +// |version|. If |version| is zero, the default maximum version is used. It +// 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. +OPENSSL_EXPORT int SSL_version(const SSL *ssl); + + +// Options. +// +// Options configure protocol behavior. + +// SSL_OP_NO_QUERY_MTU, in DTLS, disables querying the MTU from the underlying +// |BIO|. Instead, the MTU is configured with |SSL_set_mtu|. +#define SSL_OP_NO_QUERY_MTU 0x00001000L + +// SSL_OP_NO_TICKET disables session ticket support (RFC 5077). +#define SSL_OP_NO_TICKET 0x00004000L + +// SSL_OP_CIPHER_SERVER_PREFERENCE configures servers to select ciphers and +// ECDHE curves according to the server's preferences instead of the +// client's. +#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L + +// 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_TLSv1 0x04000000L +#define SSL_OP_NO_TLSv1_2 0x08000000L +#define SSL_OP_NO_TLSv1_1 0x10000000L +#define SSL_OP_NO_TLSv1_3 0x20000000L +#define SSL_OP_NO_DTLSv1 SSL_OP_NO_TLSv1 +#define SSL_OP_NO_DTLSv1_2 SSL_OP_NO_TLSv1_2 + +// SSL_CTX_set_options enables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_clear_options disables all options set in |options| (which should be +// one or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_get_options returns a bitmask of |SSL_OP_*| values that represent all +// the options enabled for |ctx|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_options(const SSL_CTX *ctx); + +// SSL_set_options enables all options set in |options| (which should be one or +// more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_set_options(SSL *ssl, uint32_t options); + +// SSL_clear_options disables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_clear_options(SSL *ssl, uint32_t options); + +// SSL_get_options returns a bitmask of |SSL_OP_*| values that represent all the +// options enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); + + +// Modes. +// +// Modes configure API behavior. + +// SSL_MODE_ENABLE_PARTIAL_WRITE, in TLS, allows |SSL_write| to complete with a +// partial result when the only part of the input was written in a single +// record. In DTLS, it does nothing. +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L + +// SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, in TLS, allows retrying an incomplete +// |SSL_write| with a different buffer. However, |SSL_write| still assumes the +// buffer contents are unchanged. This is not the default to avoid the +// misconception that non-blocking |SSL_write| behaves like non-blocking +// |write|. In DTLS, it does nothing. +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L + +// SSL_MODE_NO_AUTO_CHAIN disables automatically building a certificate chain +// before sending certificates to the peer. This flag is set (and the feature +// disabled) by default. +// TODO(davidben): Remove this behavior. https://crbug.com/boringssl/42. +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L + +// SSL_MODE_ENABLE_FALSE_START allows clients to send application data before +// receipt of ChangeCipherSpec and Finished. This mode enables full handshakes +// to 'complete' in one RTT. See RFC 7918. +// +// When False Start is enabled, |SSL_do_handshake| may succeed before the +// handshake has completely finished. |SSL_write| will function at this point, +// and |SSL_read| will transparently wait for the final handshake leg before +// returning application data. To determine if False Start occurred or when the +// handshake is completely finished, see |SSL_in_false_start|, |SSL_in_init|, +// 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 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 +// fail with SSL_R_SESSION_MAY_NOT_BE_CREATED. This can be used to enforce that +// session resumption is used for a given SSL*. +#define SSL_MODE_NO_SESSION_CREATION 0x00000200L + +// SSL_MODE_SEND_FALLBACK_SCSV sends TLS_FALLBACK_SCSV in the ClientHello. +// To be set only by applications that reconnect with a downgraded protocol +// version; see RFC 7507 for details. +// +// DO NOT ENABLE THIS if your application attempts a normal handshake. Only use +// this in explicit fallback retries, following the guidance in RFC 7507. +#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000400L + +// SSL_CTX_set_mode enables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_clear_mode disables all modes set in |mode| (which should be one or +// more of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_get_mode returns a bitmask of |SSL_MODE_*| values that represent all +// the modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx); + +// SSL_set_mode enables all modes set in |mode| (which should be one or more of +// the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_set_mode(SSL *ssl, uint32_t mode); + +// SSL_clear_mode disables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode); + +// SSL_get_mode returns a bitmask of |SSL_MODE_*| values that represent all the +// modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_mode(const SSL *ssl); + +// SSL_CTX_set0_buffer_pool sets a |CRYPTO_BUFFER_POOL| that will be used to +// store certificates. This can allow multiple connections to share +// certificates and thus save memory. +// +// The SSL_CTX does not take ownership of |pool| and the caller must ensure +// that |pool| outlives |ctx| and all objects linked to it, including |SSL|, +// |X509| and |SSL_SESSION| objects. Basically, don't ever free |pool|. +OPENSSL_EXPORT void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, + CRYPTO_BUFFER_POOL *pool); + + +// Configuring certificates and private keys. +// +// These functions configure the connection's leaf certificate, private key, and +// certificate chain. The certificate chain is ordered leaf to root (as sent on +// the wire) but does not include the leaf. Both client and server certificates +// use these functions. +// +// Certificates and keys may be configured before the handshake or dynamically +// in the early callback and certificate callback. + +// SSL_CTX_use_certificate sets |ctx|'s leaf certificate to |x509|. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x509); + +// SSL_use_certificate sets |ssl|'s leaf certificate to |x509|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_use_certificate(SSL *ssl, X509 *x509); + +// SSL_CTX_use_PrivateKey sets |ctx|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); + +// SSL_use_PrivateKey sets |ssl|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); + +// SSL_CTX_set0_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_CTX_set1_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_set0_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_set1_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_CTX_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On +// success, it returns one and takes ownership of |x509|. Otherwise, it returns +// zero. +OPENSSL_EXPORT int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_CTX_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It +// returns one on success and zero on failure. The caller retains ownership of +// |x509| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On success, +// it returns one and takes ownership of |x509|. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_add0_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_add_extra_chain_cert calls |SSL_CTX_add0_chain_cert|. +OPENSSL_EXPORT int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It returns +// one on success and zero on failure. The caller retains ownership of |x509| +// and may release it freely. +OPENSSL_EXPORT int SSL_add1_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_clear_chain_certs clears |ctx|'s certificate chain and returns +// one. +OPENSSL_EXPORT int SSL_CTX_clear_chain_certs(SSL_CTX *ctx); + +// SSL_CTX_clear_extra_chain_certs calls |SSL_CTX_clear_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); + +// SSL_clear_chain_certs clears |ssl|'s certificate chain and returns one. +OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); + +// SSL_CTX_set_cert_cb sets a callback that is called to select a certificate. +// The callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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_CTX_set_cert_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, void *arg), + void *arg); + +// SSL_set_cert_cb sets a callback that is called to select a certificate. The +// callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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. 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(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); + +// SSL_CTX_check_private_key returns one if the certificate and private key +// configured in |ctx| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_check_private_key(const SSL_CTX *ctx); + +// SSL_check_private_key returns one if the certificate and private key +// configured in |ssl| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_check_private_key(const SSL *ssl); + +// SSL_CTX_get0_certificate returns |ctx|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); + +// SSL_get_certificate returns |ssl|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_get_certificate(const SSL *ssl); + +// SSL_CTX_get0_privatekey returns |ctx|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); + +// SSL_get_privatekey returns |ssl|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_get_privatekey(const SSL *ssl); + +// SSL_CTX_get0_chain_certs sets |*out_chain| to |ctx|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_CTX_get_extra_chain_certs calls |SSL_CTX_get0_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_get0_chain_certs sets |*out_chain| to |ssl|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_get0_chain_certs(const SSL *ssl, + STACK_OF(X509) **out_chain); + +// SSL_CTX_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request it. The |list| argument must +// contain one or more SCT structures serialised as a SignedCertificateTimestamp +// List (see https://tools.ietf.org/html/rfc6962#section-3.3) – i.e. each SCT +// is prefixed by a big-endian, uint16 length and the concatenation of one or +// more such prefixed SCTs are themselves also prefixed by a uint16 length. It +// returns one on success and zero on error. The caller retains ownership of +// |list|. +OPENSSL_EXPORT int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request is. The same format as the +// one used for |SSL_CTX_set_signed_cert_timestamp_list| applies. The caller +// retains ownership of |list|. +OPENSSL_EXPORT int SSL_set_signed_cert_timestamp_list(SSL *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_CTX_set_ocsp_response sets the OCSP response that is sent to clients +// which request it. It returns one on success and zero on error. The caller +// retains ownership of |response|. +OPENSSL_EXPORT int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, + const uint8_t *response, + size_t response_len); + +// SSL_set_ocsp_response sets the OCSP response that is sent to clients which +// request it. It returns one on success and zero on error. The caller retains +// ownership of |response|. +OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, + const uint8_t *response, + size_t response_len); + +// SSL_SIGN_* are signature algorithm values as defined in TLS 1.3. +#define SSL_SIGN_RSA_PKCS1_SHA1 0x0201 +#define SSL_SIGN_RSA_PKCS1_SHA256 0x0401 +#define SSL_SIGN_RSA_PKCS1_SHA384 0x0501 +#define SSL_SIGN_RSA_PKCS1_SHA512 0x0601 +#define SSL_SIGN_ECDSA_SHA1 0x0203 +#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_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 +// specify raw RSASSA-PKCS1-v1_5 with an MD5/SHA-1 concatenation, as used in TLS +// before TLS 1.2. +#define SSL_SIGN_RSA_PKCS1_MD5_SHA1 0xff01 + +// SSL_get_signature_algorithm_name returns a human-readable name for |sigalg|, +// or NULL if unknown. If |include_curve| is one, the curve for ECDSA algorithms +// is included as in TLS 1.3. Otherwise, it is excluded as in TLS 1.2. +OPENSSL_EXPORT const char *SSL_get_signature_algorithm_name(uint16_t sigalg, + int include_curve); + +// SSL_get_signature_algorithm_key_type returns the key type associated with +// |sigalg| as an |EVP_PKEY_*| constant or |EVP_PKEY_NONE| if unknown. +OPENSSL_EXPORT int SSL_get_signature_algorithm_key_type(uint16_t sigalg); + +// SSL_get_signature_algorithm_digest returns the digest function associated +// with |sigalg| or |NULL| if |sigalg| has no prehash (Ed25519) or is unknown. +OPENSSL_EXPORT const EVP_MD *SSL_get_signature_algorithm_digest( + uint16_t sigalg); + +// SSL_is_signature_algorithm_rsa_pss returns one if |sigalg| is an RSA-PSS +// signature algorithm and zero otherwise. +OPENSSL_EXPORT int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg); + +// SSL_CTX_set_signing_algorithm_prefs configures |ctx| to use |prefs| as the +// preference list when signing with |ctx|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + +// SSL_set_signing_algorithm_prefs configures |ssl| to use |prefs| as the +// preference list when signing with |ssl|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_set_signing_algorithm_prefs(SSL *ssl, + const uint16_t *prefs, + size_t num_prefs); + + +// Certificate and private key convenience functions. + +// SSL_CTX_set_chain_and_key sets the certificate chain and private key for a +// TLS client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_set_chain_and_key sets the certificate chain and private key for a TLS +// client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_CTX_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); + +// SSL_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); + +// The following functions configure certificates or private keys but take as +// input DER-encoded structures. They return one on success and zero on +// failure. + +OPENSSL_EXPORT int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, + const uint8_t *der); +OPENSSL_EXPORT int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, + const uint8_t *der, size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +// The following functions configure certificates or private keys but take as +// input files to read from. They return one on success and zero on failure. The +// |type| parameter is one of the |SSL_FILETYPE_*| values and determines whether +// the file's contents are read as PEM or DER. + +#define SSL_FILETYPE_PEM 1 +#define SSL_FILETYPE_ASN1 2 + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, + const char *file, + int type); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_certificate_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_PrivateKey_file(SSL *ssl, const char *file, + int type); + +// SSL_CTX_use_certificate_chain_file configures certificates for |ctx|. It +// reads the contents of |file| as a PEM-encoded leaf certificate followed +// optionally by the certificate chain to send to the peer. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, + const char *file); + +// SSL_CTX_set_default_passwd_cb sets the password callback for PEM-based +// convenience functions called on |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, + pem_password_cb *cb); + +// SSL_CTX_get_default_passwd_cb returns the callback set by +// |SSL_CTX_set_default_passwd_cb|. +OPENSSL_EXPORT pem_password_cb *SSL_CTX_get_default_passwd_cb( + const SSL_CTX *ctx); + +// SSL_CTX_set_default_passwd_cb_userdata sets the userdata parameter for +// |ctx|'s password callback. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, + void *data); + +// SSL_CTX_get_default_passwd_cb_userdata returns the userdata parameter set by +// |SSL_CTX_set_default_passwd_cb_userdata|. +OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); + + +// Custom private keys. + +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { + ssl_private_key_success, + ssl_private_key_retry, + ssl_private_key_failure, +}; + +// ssl_private_key_method_st (aka |SSL_PRIVATE_KEY_METHOD|) describes private +// key hooks. This is used to off-load signing operations to a custom, +// potentially asynchronous, backend. Metadata about the key such as the type +// and size are parsed out of the certificate. +struct ssl_private_key_method_st { + // sign signs the message |in| in using the specified signature algorithm. On + // success, it returns |ssl_private_key_success| and writes at most |max_out| + // bytes of signature data to |out| and sets |*out_len| to the number of bytes + // written. On failure, it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. |sign| should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed. This will result in a call to |complete|. + // + // |signature_algorithm| is one of the |SSL_SIGN_*| values, as defined in TLS + // 1.3. Note that, in TLS 1.2, ECDSA algorithms do not require that curve + // sizes match hash sizes, so the curve portion of |SSL_SIGN_ECDSA_*| values + // must be ignored. BoringSSL will internally handle the curve matching logic + // where appropriate. + // + // It is an error to call |sign| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*sign)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out, + uint16_t signature_algorithm, + const uint8_t *in, size_t in_len); + + // decrypt decrypts |in_len| bytes of encrypted data from |in|. On success it + // returns |ssl_private_key_success|, writes at most |max_out| bytes of + // decrypted data to |out| and sets |*out_len| to the actual number of bytes + // written. On failure it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. The caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in a call to |complete|. This + // function only works with RSA keys and should perform a raw RSA decryption + // operation with no padding. + // + // It is an error to call |decrypt| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*decrypt)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + + // complete completes a pending operation. If the operation has completed, it + // returns |ssl_private_key_success| and writes the result to |out| as in + // |sign|. Otherwise, it returns |ssl_private_key_failure| on failure and + // |ssl_private_key_retry| if the operation is still in progress. + // + // |complete| may be called arbitrarily many times before completion, but it + // is an error to call |complete| if there is no pending operation in progress + // on |ssl|. + enum ssl_private_key_result_t (*complete)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); +}; + +// SSL_set_private_key_method configures a custom private key on |ssl|. +// |key_method| must remain valid for the lifetime of |ssl|. +OPENSSL_EXPORT void SSL_set_private_key_method( + SSL *ssl, const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_CTX_set_private_key_method configures a custom private key on |ctx|. +// |key_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_private_key_method( + SSL_CTX *ctx, const SSL_PRIVATE_KEY_METHOD *key_method); + + +// Cipher suites. +// +// |SSL_CIPHER| objects represent cipher suites. + +DEFINE_CONST_STACK_OF(SSL_CIPHER) + +// SSL_get_cipher_by_value returns the structure representing a TLS cipher +// suite based on its assigned number, or NULL if unknown. See +// 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 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); + +// SSL_CIPHER_is_block_cipher returns one if |cipher| is a block cipher. +OPENSSL_EXPORT int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_cipher_nid returns the NID for |cipher|'s bulk +// cipher. Possible values are |NID_aes_128_gcm|, |NID_aes_256_gcm|, +// |NID_chacha20_poly1305|, |NID_aes_128_cbc|, |NID_aes_256_cbc|, and +// |NID_des_ede3_cbc|. +OPENSSL_EXPORT int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_digest_nid returns the NID for |cipher|'s HMAC if it is a +// legacy cipher suite. For modern AEAD-based ciphers (see +// |SSL_CIPHER_is_aead|), it returns |NID_undef|. +// +// Note this function only returns the legacy HMAC digest, not the PRF hash. +OPENSSL_EXPORT int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_kx_nid returns the NID for |cipher|'s key exchange. This may +// be |NID_kx_rsa|, |NID_kx_ecdhe|, or |NID_kx_psk| for TLS 1.2. In TLS 1.3, +// cipher suites do not specify the key exchange, so this function returns +// |NID_kx_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_auth_nid returns the NID for |cipher|'s authentication +// type. This may be |NID_auth_rsa|, |NID_auth_ecdsa|, or |NID_auth_psk| for TLS +// 1.2. In TLS 1.3, cipher suites do not specify authentication, so this +// function returns |NID_auth_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_prf_nid retuns the NID for |cipher|'s PRF hash. If |cipher| is +// a pre-TLS-1.2 cipher, it returns |NID_md5_sha1| but note these ciphers use +// SHA-256 in TLS 1.2. Other return values may be treated uniformly in all +// applicable versions. +OPENSSL_EXPORT int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_min_version returns the minimum protocol version required +// for |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_max_version returns the maximum protocol version that +// supports |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_standard_name returns the standard IETF name for |cipher|. For +// example, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256". +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". 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 +// method used by |cipher|. For example, "ECDHE_ECDSA". TLS 1.3 AEAD-only +// ciphers return the string "GENERIC". +OPENSSL_EXPORT const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_bits returns the strength, in bits, of |cipher|. If +// |out_alg_bits| is not NULL, it writes the number of bits consumed by the +// symmetric algorithm to |*out_alg_bits|. +OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, + int *out_alg_bits); + + +// Cipher suite configuration. +// +// OpenSSL uses a mini-language to configure cipher suites. The language +// maintains an ordered list of enabled ciphers, along with an ordered list of +// disabled but available ciphers. Initially, all ciphers are disabled with a +// default ordering. The cipher string is then interpreted as a sequence of +// directives, separated by colons, each of which modifies this state. +// +// Most directives consist of a one character or empty opcode followed by a +// selector which matches a subset of available ciphers. +// +// Available opcodes are: +// +// The empty opcode enables and appends all matching disabled ciphers to the +// end of the enabled list. The newly appended ciphers are ordered relative to +// each other matching their order in the disabled list. +// +// |-| disables all matching enabled ciphers and prepends them to the disabled +// list, with relative order from the enabled list preserved. This means the +// most recently disabled ciphers get highest preference relative to other +// disabled ciphers if re-enabled. +// +// |+| moves all matching enabled ciphers to the end of the enabled list, with +// relative order preserved. +// +// |!| deletes all matching ciphers, enabled or not, from either list. Deleted +// ciphers will not matched by future operations. +// +// A selector may be a specific cipher (using either the standard or OpenSSL +// name for the cipher) or one or more rules separated by |+|. The final +// selector matches the intersection of each rule. For instance, |AESGCM+aECDSA| +// matches ECDSA-authenticated AES-GCM ciphers. +// +// Available cipher rules are: +// +// |ALL| matches all ciphers. +// +// |kRSA|, |kDHE|, |kECDHE|, and |kPSK| match ciphers using plain RSA, DHE, +// ECDHE, and plain PSK key exchanges, respectively. Note that ECDHE_PSK is +// matched by |kECDHE| and not |kPSK|. +// +// |aRSA|, |aECDSA|, and |aPSK| match ciphers authenticated by RSA, ECDSA, and +// a pre-shared key, respectively. +// +// |RSA|, |DHE|, |ECDHE|, |PSK|, |ECDSA|, and |PSK| are aliases for the +// corresponding |k*| or |a*| cipher rule. |RSA| is an alias for |kRSA|, not +// |aRSA|. +// +// |3DES|, |AES128|, |AES256|, |AES|, |AESGCM|, |CHACHA20| match ciphers +// whose bulk cipher use the corresponding encryption scheme. Note that +// |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. +// +// |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. +// +// Deprecated cipher rules: +// +// |kEDH|, |EDH|, |kEECDH|, and |EECDH| are legacy aliases for |kDHE|, |DHE|, +// |kECDHE|, and |ECDHE|, respectively. +// +// |HIGH| is an alias for |ALL|. +// +// |FIPS| is an alias for |HIGH|. +// +// |SSLv3| and |TLSv1| match ciphers available in TLS 1.1 or earlier. +// |TLSv1_2| matches ciphers new in TLS 1.2. This is confusing and should not +// be used. +// +// Unknown rules are silently ignored by legacy APIs, and rejected by APIs with +// "strict" in the name, which should be preferred. Cipher lists can be long +// and it's easy to commit typos. Strict functions will also reject the use of +// spaces, semi-colons and commas as alternative separators. +// +// The special |@STRENGTH| directive will sort all enabled ciphers by strength. +// +// The |DEFAULT| directive, when appearing at the front of the string, expands +// to the default ordering of available ciphers. +// +// If configuring a server, one may also configure equal-preference groups to +// partially respect the client's preferences when +// |SSL_OP_CIPHER_SERVER_PREFERENCE| is enabled. Ciphers in an equal-preference +// group have equal priority and use the client order. This may be used to +// enforce that AEADs are preferred but select AES-GCM vs. ChaCha20-Poly1305 +// based on client preferences. An equal-preference is specified with square +// brackets, combining multiple selectors separated by |. For example: +// +// [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. +// +// TLS 1.3 ciphers do not participate in this mechanism and instead have a +// built-in preference order. Functions to set cipher lists do not affect TLS +// 1.3, and functions to query the cipher list do not include TLS 1.3 +// ciphers. + +// SSL_DEFAULT_CIPHER_LIST is the default cipher suite configuration. It is +// substituted when a cipher string starts with 'DEFAULT'. +#define SSL_DEFAULT_CIPHER_LIST "ALL" + +// SSL_CTX_set_strict_cipher_list configures the cipher list for |ctx|, +// evaluating |str| as a cipher string and returning error if |str| contains +// anything meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, + const char *str); + +// SSL_CTX_set_cipher_list configures the cipher list for |ctx|, evaluating +// |str| as a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_CTX_set_strict_cipher_list|. This function tolerates +// garbage inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); + +// SSL_set_strict_cipher_list configures the cipher list for |ssl|, evaluating +// |str| as a cipher string and returning error if |str| contains anything +// meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_set_strict_cipher_list(SSL *ssl, const char *str); + +// SSL_set_cipher_list configures the cipher list for |ssl|, evaluating |str| as +// a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_set_strict_cipher_list|. This function tolerates garbage +// inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_set_cipher_list(SSL *ssl, const char *str); + +// SSL_CTX_get_ciphers returns the cipher list for |ctx|, in order of +// preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); + +// SSL_CTX_cipher_in_group returns one if the |i|th cipher (see +// |SSL_CTX_get_ciphers|) is in the same equipreference group as the one +// following it and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i); + +// SSL_get_ciphers returns the cipher list for |ssl|, in order of preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl); + + +// Connection information. + +// SSL_is_init_finished returns one if |ssl| has completed its initial handshake +// and has no pending handshake. It returns zero otherwise. +OPENSSL_EXPORT int SSL_is_init_finished(const SSL *ssl); + +// SSL_in_init returns one if |ssl| has a pending handshake and zero +// otherwise. +OPENSSL_EXPORT int SSL_in_init(const SSL *ssl); + +// SSL_in_false_start returns one if |ssl| has a pending handshake that is in +// False Start. |SSL_write| may be called at this point without waiting for the +// peer, but |SSL_read| will complete the handshake before accepting application +// data. +// +// See also |SSL_MODE_ENABLE_FALSE_START|. +OPENSSL_EXPORT int SSL_in_false_start(const SSL *ssl); + +// SSL_get_peer_certificate returns the peer's leaf certificate or NULL if the +// peer did not use certificates. The caller must call |X509_free| on the +// result to release it. +OPENSSL_EXPORT X509 *SSL_get_peer_certificate(const SSL *ssl); + +// SSL_get_peer_cert_chain returns the peer's certificate chain or NULL if +// unavailable or 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. +// +// WARNING: This function behaves differently between client and server. If +// |ssl| is a server, the returned chain does not include the leaf certificate. +// If a client, it does. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); + +// SSL_get_peer_full_cert_chain returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the same as |SSL_get_peer_cert_chain| except that this function +// always returns the full chain, i.e. the first element of the return value +// (if any) will be the leaf certificate. In constrast, +// |SSL_get_peer_cert_chain| returns only the intermediate certificates if the +// |ssl| is a server. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); + +// SSL_get0_peer_certificates returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. +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 +// |*out_len| bytes of SCT information from the server. This is only valid if +// |ssl| is a client. 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_get0_signed_cert_timestamp_list(const SSL *ssl, + const uint8_t **out, + size_t *out_len); + +// SSL_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_get0_ocsp_response(const SSL *ssl, const uint8_t **out, + size_t *out_len); + +// SSL_get_tls_unique writes at most |max_out| bytes of the tls-unique value +// for |ssl| to |out| and sets |*out_len| to the number of bytes written. It +// returns one on success or zero on error. In general |max_out| should be at +// least 12. +// +// This function will always fail if the initial handshake has not completed. +// The tls-unique value will change after a renegotiation but, since +// renegotiations can be initiated by the server at any point, the higher-level +// protocol must either leave them disabled or define states in which the +// tls-unique value can be read. +// +// The tls-unique value is defined by +// https://tools.ietf.org/html/rfc5929#section-3.1. Due to a weakness in the +// TLS protocol, tls-unique is broken for resumed connections unless the +// Extended Master Secret extension is negotiated. Thus this function will +// return zero if |ssl| performed session resumption unless EMS was used when +// negotiating the original session. +OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); + +// SSL_get_extms_support returns one if the Extended Master Secret extension or +// TLS 1.3 was negotiated. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); + +// 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 +// and zero otherwise. +// +// TODO(davidben): Hammer down the semantics of this API while a handshake, +// initial or renego, is in progress. +OPENSSL_EXPORT int SSL_session_reused(const SSL *ssl); + +// SSL_get_secure_renegotiation_support returns one if the peer supports secure +// renegotiation (RFC 5746) or TLS 1.3. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_secure_renegotiation_support(const SSL *ssl); + +// SSL_export_keying_material exports a value derived from the master secret, as +// specified in RFC 5705. It writes |out_len| bytes to |out| given a label and +// optional context. (Since a zero length context is allowed, the |use_context| +// flag controls whether a context is included.) +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT 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); + + +// Sessions. +// +// An |SSL_SESSION| represents an SSL session that may be resumed in an +// abbreviated handshake. It is reference-counted and immutable. Once +// established, an |SSL_SESSION| may be shared by multiple |SSL| objects on +// different threads and must not be modified. + +DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + +// SSL_SESSION_new returns a newly-allocated blank |SSL_SESSION| or NULL on +// error. This may be useful when writing tests but should otherwise not be +// used. +OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_new(const SSL_CTX *ctx); + +// SSL_SESSION_up_ref increments the reference count of |session| and returns +// one. +OPENSSL_EXPORT int SSL_SESSION_up_ref(SSL_SESSION *session); + +// SSL_SESSION_free decrements the reference count of |session|. If it reaches +// zero, all data referenced by |session| and |session| itself are released. +OPENSSL_EXPORT void SSL_SESSION_free(SSL_SESSION *session); + +// SSL_SESSION_to_bytes serializes |in| into a newly allocated buffer and sets +// |*out_data| to that buffer and |*out_len| to its length. The caller takes +// ownership of the buffer and must call |OPENSSL_free| when done. It returns +// one on success and zero on error. +OPENSSL_EXPORT int SSL_SESSION_to_bytes(const SSL_SESSION *in, + uint8_t **out_data, size_t *out_len); + +// SSL_SESSION_to_bytes_for_ticket serializes |in|, but excludes the session +// identification information, namely the session ID and ticket. +OPENSSL_EXPORT int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, + uint8_t **out_data, + size_t *out_len); + +// SSL_SESSION_from_bytes parses |in_len| bytes from |in| as an SSL_SESSION. It +// returns a newly-allocated |SSL_SESSION| on success or NULL on error. +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 "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| +// was established at. +OPENSSL_EXPORT uint16_t +SSL_SESSION_get_protocol_version(const SSL_SESSION *session); + +// SSL_SESSION_set_protocol_version sets |session|'s TLS or DTLS version to +// |version|. This may be useful when writing tests but should otherwise not be +// used. It returns one on success and zero on error. +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); + +// SSL_SESSION_get_timeout returns the lifetime of |session| in seconds. +OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer returns the peer leaf certificate stored in +// |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. +OPENSSL_EXPORT size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, + uint8_t *out, size_t max_out); + +// SSL_SESSION_set_time sets |session|'s creation time to |time| and returns +// |time|. This function may be useful in writing tests but otherwise should not +// be used. +OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, + uint64_t time); + +// SSL_SESSION_set_timeout sets |session|'s timeout to |timeout| and returns +// one. This function may be useful in writing tests but otherwise should not +// be used. +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 +// should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_SESSION_should_be_single_use returns one if |session| should be +// single-use (TLS 1.3 and later) and zero otherwise. +// +// If this function returns one, clients retain multiple sessions and use each +// only once. This prevents passive observers from correlating connections with +// 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 +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_is_resumable(const SSL_SESSION *session); + +// SSL_SESSION_has_ticket returns one if |session| has a ticket and zero +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_has_ticket(const SSL_SESSION *session); + +// SSL_SESSION_get0_ticket sets |*out_ticket| and |*out_len| to |session|'s +// ticket, or NULL and zero if it does not have one. |out_ticket| may be NULL +// if only the ticket length is needed. +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. +// +// Session caching allows connections to be established more efficiently based +// on saved parameters from a previous connection, called a session (see +// |SSL_SESSION|). The client offers a saved session, using an opaque identifier +// from a previous connection. The server may accept the session, if it has the +// parameters available. Otherwise, it will decline and continue with a full +// handshake. +// +// This requires both the client and the server to retain session state. A +// client does so with a stateful session cache. A server may do the same or, if +// supported by both sides, statelessly using session tickets. For more +// information on the latter, see the next section. +// +// For a server, the library implements a built-in internal session cache as an +// in-memory hash table. Servers may also use |SSL_CTX_sess_set_get_cb| and +// |SSL_CTX_sess_set_new_cb| to implement a custom external session cache. In +// particular, this may be used to share a session cache between multiple +// servers in a large deployment. An external cache may be used in addition to +// or instead of the internal one. Use |SSL_CTX_set_session_cache_mode| to +// toggle the internal cache. +// +// For a client, the only option is an external session cache. Clients may use +// |SSL_CTX_sess_set_new_cb| to register a callback for when new sessions are +// available. These may be cached and, in subsequent compatible connections, +// configured with |SSL_set_session|. +// +// Note that offering or accepting a session short-circuits certificate +// verification and most parameter negotiation. Resuming sessions across +// different contexts may result in security failures and surprising +// behavior. For a typical client, this means sessions for different hosts must +// be cached under different keys. A client that connects to the same host with, +// e.g., different cipher suite settings or client certificates should also use +// separate session caches between those contexts. Servers should also partition +// session caches between SNI hosts with |SSL_CTX_set_session_id_context|. +// +// Note also, in TLS 1.2 and earlier, offering sessions allows passive observers +// to correlate different client connections. TLS 1.3 and later fix this, +// provided clients use sessions at most once. Session caches are managed by the +// caller in BoringSSL, so this must be implemented externally. See +// |SSL_SESSION_should_be_single_use| for details. + +// SSL_SESS_CACHE_OFF disables all session caching. +#define SSL_SESS_CACHE_OFF 0x0000 + +// SSL_SESS_CACHE_CLIENT enables session caching for a client. The internal +// cache is never used on a client, so this only enables the callbacks. +#define SSL_SESS_CACHE_CLIENT 0x0001 + +// SSL_SESS_CACHE_SERVER enables session caching for a server. +#define SSL_SESS_CACHE_SERVER 0x0002 + +// SSL_SESS_CACHE_BOTH enables session caching for both client and server. +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER) + +// SSL_SESS_CACHE_NO_AUTO_CLEAR disables automatically calling +// |SSL_CTX_flush_sessions| every 255 connections. +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 + +// SSL_SESS_CACHE_NO_INTERNAL_LOOKUP, on a server, disables looking up a session +// from the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 + +// SSL_SESS_CACHE_NO_INTERNAL_STORE, on a server, disables storing sessions in +// the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 + +// SSL_SESS_CACHE_NO_INTERNAL, on a server, disables the internal session +// cache. +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) + +// SSL_CTX_set_session_cache_mode sets the session cache mode bits for |ctx| to +// |mode|. It returns the previous value. +OPENSSL_EXPORT int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_session_cache_mode returns the session cache mode bits for +// |ctx| +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|. 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); + +// SSL_DEFAULT_SESSION_TIMEOUT is the default lifetime, in seconds, of a +// session in TLS 1.2 or earlier. This is how long we are willing to use the +// secret to encrypt traffic without fresh key material. +#define SSL_DEFAULT_SESSION_TIMEOUT (2 * 60 * 60) + +// SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT is the default lifetime, in seconds, of a +// session for TLS 1.3 psk_dhe_ke. This is how long we are willing to use the +// secret as an authenticator. +#define SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT (2 * 24 * 60 * 60) + +// SSL_DEFAULT_SESSION_AUTH_TIMEOUT is the default non-renewable lifetime, in +// seconds, of a TLS 1.3 session. This is how long we are willing to trust the +// signature in the initial handshake. +#define SSL_DEFAULT_SESSION_AUTH_TIMEOUT (7 * 24 * 60 * 60) + +// SSL_CTX_set_timeout sets the lifetime, in seconds, of TLS 1.2 (or earlier) +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT uint32_t SSL_CTX_set_timeout(SSL_CTX *ctx, uint32_t timeout); + +// SSL_CTX_set_session_psk_dhe_timeout sets the lifetime, in seconds, of TLS 1.3 +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, + uint32_t timeout); + +// SSL_CTX_get_timeout returns the lifetime, in seconds, of TLS 1.2 (or earlier) +// 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 +// connection without a matching session ID context. +// +// For a server, if |SSL_VERIFY_PEER| is enabled, it is an error to not set a +// session ID context. +OPENSSL_EXPORT int SSL_CTX_set_session_id_context(SSL_CTX *ctx, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_set_session_id_context sets |ssl|'s session ID context to |sid_ctx|. It +// returns one on success and zero on error. See also +// |SSL_CTX_set_session_id_context|. +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. It returns NULL on error. +OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, + size_t *out_len); + +// SSL_SESSION_CACHE_MAX_SIZE_DEFAULT is the default maximum size of a session +// cache. +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024 * 20) + +// SSL_CTX_sess_set_cache_size sets the maximum size of |ctx|'s internal session +// cache to |size|. It returns the previous value. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, + unsigned long size); + +// SSL_CTX_sess_get_cache_size returns the maximum size of |ctx|'s internal +// session cache. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx); + +// SSL_CTX_sess_number returns the number of sessions in |ctx|'s internal +// session cache. +OPENSSL_EXPORT size_t SSL_CTX_sess_number(const SSL_CTX *ctx); + +// SSL_CTX_add_session inserts |session| into |ctx|'s internal session cache. It +// returns one on success and zero on error or if |session| is already in the +// cache. The caller retains its reference to |session|. +OPENSSL_EXPORT int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_remove_session removes |session| from |ctx|'s internal session cache. +// It returns one on success and zero if |session| was not in the cache. +OPENSSL_EXPORT int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_flush_sessions removes all sessions from |ctx| which have expired as +// of time |time|. If |time| is zero, all sessions are removed. +OPENSSL_EXPORT void SSL_CTX_flush_sessions(SSL_CTX *ctx, uint64_t time); + +// SSL_CTX_sess_set_new_cb sets the callback to be called when a new session is +// established and ready to be cached. If the session cache is disabled (the +// appropriate one of |SSL_SESS_CACHE_CLIENT| or |SSL_SESS_CACHE_SERVER| is +// unset), the callback is not called. +// +// The callback is passed a reference to |session|. It returns one if it takes +// ownership (and then calls |SSL_SESSION_free| when done) and zero otherwise. A +// consumer which places |session| into an in-memory cache will likely return +// one, with the cache calling |SSL_SESSION_free|. A consumer which serializes +// |session| with |SSL_SESSION_to_bytes| may not need to retain |session| and +// will likely return zero. Returning one is equivalent to calling +// |SSL_SESSION_up_ref| and then returning zero. +// +// Note: For a client, the callback may be called on abbreviated handshakes if a +// ticket is renewed. Further, it may not be called until some time after +// |SSL_do_handshake| or |SSL_connect| completes if False Start is enabled. Thus +// it's recommended to use this callback over calling |SSL_get_session| on +// handshake completion. +OPENSSL_EXPORT void SSL_CTX_sess_set_new_cb( + SSL_CTX *ctx, int (*new_session_cb)(SSL *ssl, SSL_SESSION *session)); + +// SSL_CTX_sess_get_new_cb returns the callback set by +// |SSL_CTX_sess_set_new_cb|. +OPENSSL_EXPORT int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))( + SSL *ssl, SSL_SESSION *session); + +// SSL_CTX_sess_set_remove_cb sets a callback which is called when a session is +// removed from the internal session cache. +// +// TODO(davidben): What is the point of this callback? It seems useless since it +// only fires on sessions in the internal cache. +OPENSSL_EXPORT void SSL_CTX_sess_set_remove_cb( + SSL_CTX *ctx, + void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *session)); + +// SSL_CTX_sess_get_remove_cb returns the callback set by +// |SSL_CTX_sess_set_remove_cb|. +OPENSSL_EXPORT void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))( + SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_sess_set_get_cb sets a callback to look up a session by ID for a +// server. The callback is passed the session ID and should return a matching +// |SSL_SESSION| or NULL if not found. It should set |*out_copy| to zero and +// return a new reference to the session. This callback is not used for a +// client. +// +// For historical reasons, if |*out_copy| is set to one (default), the SSL +// library will take a new reference to the returned |SSL_SESSION|, expecting +// the callback to return a non-owning pointer. This is not recommended. If +// |ctx| and thus the callback is used on multiple threads, the session may be +// removed and invalidated before the SSL library calls |SSL_SESSION_up_ref|, +// whereas the callback may synchronize internally. +// +// To look up a session asynchronously, the callback may return +// |SSL_magic_pending_session_ptr|. See the documentation for that function and +// |SSL_ERROR_PENDING_SESSION|. +// +// If the internal session cache is enabled, the callback is only consulted if +// the internal cache does not return a match. +OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( + SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *id, + int id_len, int *out_copy)); + +// SSL_CTX_sess_get_get_cb returns the callback set by +// |SSL_CTX_sess_set_get_cb|. +OPENSSL_EXPORT SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))( + SSL *ssl, const uint8_t *id, int id_len, int *out_copy); + +// SSL_magic_pending_session_ptr returns a magic |SSL_SESSION|* which indicates +// that the session isn't currently unavailable. |SSL_get_error| will then +// return |SSL_ERROR_PENDING_SESSION| and the handshake can be retried later +// when the lookup has completed. +OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); + + +// Session tickets. +// +// Session tickets, from RFC 5077, allow session resumption without server-side +// state. The server maintains a secret ticket key and sends the client opaque +// encrypted session parameters, called a ticket. When offering the session, the +// client sends the ticket which the server decrypts to recover session state. +// Session tickets are enabled by default but may be disabled with +// |SSL_OP_NO_TICKET|. +// +// 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| 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 +// encryption and authentication. +// 3) One can configure an |SSL_TICKET_AEAD_METHOD| to have more control +// and the option of asynchronous decryption. +// +// An attacker that compromises a server's session ticket key can impersonate +// the server and, prior to TLS 1.3, retroactively decrypt all application +// traffic from sessions using that ticket key. Thus ticket keys must be +// regularly rotated for forward secrecy. Note the default key is rotated +// automatically once every 48 hours but manually configured keys are not. + +// SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL is the interval with which the +// default session ticket encryption key is rotated, if in use. If any +// non-default ticket encryption mechanism is configured, automatic rotation is +// disabled. +#define SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL (2 * 24 * 60 * 60) + +// SSL_CTX_get_tlsext_ticket_keys writes |ctx|'s session ticket key material to +// |len| bytes of |out|. It returns one on success and zero if |len| is not +// 48. If |out| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, + size_t len); + +// SSL_CTX_set_tlsext_ticket_keys sets |ctx|'s session ticket key material to +// |len| bytes of |in|. It returns one on success and zero if |len| is not +// 48. If |in| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, + size_t len); + +// SSL_TICKET_KEY_NAME_LEN is the length of the key name prefix of a session +// ticket. +#define SSL_TICKET_KEY_NAME_LEN 16 + +// SSL_CTX_set_tlsext_ticket_key_cb sets the ticket callback to |callback| and +// returns one. |callback| will be called when encrypting a new ticket and when +// decrypting a ticket from the client. +// +// In both modes, |ctx| and |hmac_ctx| will already have been initialized with +// |EVP_CIPHER_CTX_init| and |HMAC_CTX_init|, respectively. |callback| +// configures |hmac_ctx| with an HMAC digest and key, and configures |ctx| +// for encryption or decryption, based on the mode. +// +// When encrypting a new ticket, |encrypt| will be one. It writes a public +// 16-byte key name to |key_name| and a fresh IV to |iv|. The output IV length +// must match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns 1 on success and -1 on error. +// +// When decrypting a ticket, |encrypt| will be zero. |key_name| will point to a +// 16-byte key name and |iv| points to an IV. The length of the IV consumed must +// match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns -1 to abort the handshake, 0 if decrypting the ticket +// failed, and 1 or 2 on success. If it returns 2, the ticket will be renewed. +// This may be used to re-key the ticket. +// +// WARNING: |callback| wildly breaks the usual return value convention and is +// called in two different modes. +OPENSSL_EXPORT 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)); + +// 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 BORINGSSL_ENUM_INT { + // ssl_ticket_aead_success indicates that the ticket was successfully + // decrypted. + ssl_ticket_aead_success, + // ssl_ticket_aead_retry indicates that the operation could not be + // immediately completed and must be reattempted, via |open|, at a later + // point. + ssl_ticket_aead_retry, + // ssl_ticket_aead_ignore_ticket indicates that the ticket should be ignored + // (i.e. is corrupt or otherwise undecryptable). + ssl_ticket_aead_ignore_ticket, + // ssl_ticket_aead_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_ticket_aead_error, +}; + +// ssl_ticket_aead_method_st (aka |SSL_TICKET_AEAD_METHOD|) contains methods +// for encrypting and decrypting session tickets. +struct ssl_ticket_aead_method_st { + // max_overhead returns the maximum number of bytes of overhead that |seal| + // may add. + size_t (*max_overhead)(SSL *ssl); + + // seal encrypts and authenticates |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes to |out|, and puts the number of bytes written in + // |*out_len|. The |in| and |out| buffers may be equal but will not otherwise + // alias. It returns one on success or zero on error. + int (*seal)(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, + const uint8_t *in, size_t in_len); + + // open authenticates and decrypts |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes of plaintext to |out|, and puts the number of bytes + // written in |*out_len|. The |in| and |out| buffers may be equal but will + // not otherwise alias. See |ssl_ticket_aead_result_t| for details of the + // return values. In the case that a retry is indicated, the caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in another call to |open|. + enum ssl_ticket_aead_result_t (*open)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out_len, const uint8_t *in, + size_t in_len); +}; + +// SSL_CTX_set_ticket_aead_method configures a custom ticket AEAD method table +// on |ctx|. |aead_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_ticket_aead_method( + SSL_CTX *ctx, const SSL_TICKET_AEAD_METHOD *aead_method); + + +// Elliptic curve Diffie-Hellman. +// +// Cipher suites using an ECDHE key exchange perform Diffie-Hellman over an +// elliptic curve negotiated by both endpoints. See RFC 4492. Only named curves +// are supported. ECDHE is always enabled, but the curve preferences may be +// configured with these functions. +// +// Note that TLS 1.3 renames these from curves to groups. For consistency, we +// currently use the TLS 1.2 name in the API. + +// SSL_CTX_set1_curves sets the preferred curves for |ctx| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, + size_t curves_len); + +// SSL_set1_curves sets the preferred curves for |ssl| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_set1_curves(SSL *ssl, const int *curves, + size_t curves_len); + +// SSL_CTX_set1_curves_list sets the preferred curves for |ctx| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves); + +// SSL_set1_curves_list sets the preferred curves for |ssl| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); + +// SSL_CURVE_* define TLS curve IDs. +#define SSL_CURVE_SECP224R1 21 +#define SSL_CURVE_SECP256R1 23 +#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. +// +// TODO(davidben): This API currently does not work correctly if there is a +// renegotiation in progress. Fix this. +OPENSSL_EXPORT uint16_t SSL_get_curve_id(const SSL *ssl); + +// SSL_get_curve_name returns a human-readable name for the curve specified by +// the given TLS curve id, or NULL if the curve is unknown. +OPENSSL_EXPORT const char *SSL_get_curve_name(uint16_t curve_id); + + +// Certificate verification. +// +// SSL may authenticate either endpoint with an X.509 certificate. Typically +// this is used to authenticate the server to the client. These functions +// configure certificate verification. +// +// WARNING: By default, certificate verification errors on a client are not +// fatal. See |SSL_VERIFY_NONE| This may be configured with +// |SSL_CTX_set_verify|. +// +// By default clients are anonymous but a server may request a certificate from +// the client by setting |SSL_VERIFY_PEER|. +// +// Many of these functions use OpenSSL's legacy X.509 stack which is +// underdocumented and deprecated, but the replacement isn't ready yet. For +// now, consumers may use the existing stack or bypass it by performing +// certificate verification externally. This may be done with +// |SSL_CTX_set_cert_verify_callback| or by extracting the chain with +// |SSL_get_peer_cert_chain| after the handshake. In the future, functions will +// be added to use the SSL stack without dependency on any part of the legacy +// X.509 and ASN.1 stack. +// +// To augment certificate verification, a client may also enable OCSP stapling +// (RFC 6066) and Certificate Transparency (RFC 6962) extensions. + +// SSL_VERIFY_NONE, on a client, verifies the server certificate but does not +// make errors fatal. The result may be checked with |SSL_get_verify_result|. On +// a server it does not request a client certificate. This is the default. +#define SSL_VERIFY_NONE 0x00 + +// SSL_VERIFY_PEER, on a client, makes server certificate errors fatal. On a +// server it requests a client certificate and makes errors fatal. However, +// anonymous clients are still allowed. See +// |SSL_VERIFY_FAIL_IF_NO_PEER_CERT|. +#define SSL_VERIFY_PEER 0x01 + +// SSL_VERIFY_FAIL_IF_NO_PEER_CERT configures a server to reject connections if +// the client declines to send a certificate. This flag must be used together +// with |SSL_VERIFY_PEER|, otherwise it won't work. +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 + +// SSL_VERIFY_PEER_IF_NO_OBC configures a server to request a client certificate +// if and only if Channel ID is not negotiated. +#define SSL_VERIFY_PEER_IF_NO_OBC 0x04 + +// SSL_CTX_set_verify configures certificate verification behavior. |mode| is +// one of the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is +// used to customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_verify( + SSL_CTX *ctx, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); + +// SSL_set_verify configures certificate verification behavior. |mode| is one of +// the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is used to +// customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, + int (*callback)(int ok, + X509_STORE_CTX *store_ctx)); + +enum ssl_verify_result_t BORINGSSL_ENUM_INT { + ssl_verify_ok, + ssl_verify_invalid, + ssl_verify_retry, +}; + +// SSL_CTX_set_custom_verify configures certificate verification. |mode| is one +// of the |SSL_VERIFY_*| values defined above. |callback| performs the +// certificate verification. +// +// The callback may call |SSL_get0_peer_certificates| for the certificate chain +// to validate. The callback should return |ssl_verify_ok| if the certificate is +// valid. If the certificate is invalid, the callback should return +// |ssl_verify_invalid| and optionally set |*out_alert| to an alert to send to +// the peer. Some useful alerts include |SSL_AD_CERTIFICATE_EXPIRED|, +// |SSL_AD_CERTIFICATE_REVOKED|, |SSL_AD_UNKNOWN_CA|, |SSL_AD_BAD_CERTIFICATE|, +// |SSL_AD_CERTIFICATE_UNKNOWN|, and |SSL_AD_INTERNAL_ERROR|. See RFC 5246 +// section 7.2.2 for their precise meanings. If unspecified, +// |SSL_AD_CERTIFICATE_UNKNOWN| will be sent by default. +// +// To verify a certificate asynchronously, the callback may return +// |ssl_verify_retry|. The handshake will then pause with |SSL_get_error| +// returning |SSL_ERROR_WANT_CERTIFICATE_VERIFY|. +OPENSSL_EXPORT void SSL_CTX_set_custom_verify( + SSL_CTX *ctx, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_set_custom_verify behaves like |SSL_CTX_set_custom_verify| but configures +// an individual |SSL|. +OPENSSL_EXPORT void SSL_set_custom_verify( + SSL *ssl, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_CTX_get_verify_mode returns |ctx|'s verify mode, set by +// |SSL_CTX_set_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|. 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 +// |SSL_CTX_set_verify|. +OPENSSL_EXPORT int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_get_verify_callback returns the callback set by |SSL_CTX_set_verify| or +// |SSL_set_verify|. +OPENSSL_EXPORT int (*SSL_get_verify_callback(const SSL *ssl))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_CTX_set_verify_depth sets the maximum depth of a certificate chain +// accepted in verification. This number does not include the leaf, so a depth +// of 1 allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); + +// SSL_set_verify_depth sets the maximum depth of a certificate chain accepted +// in verification. This number does not include the leaf, so a depth of 1 +// allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_set_verify_depth(SSL *ssl, int depth); + +// SSL_CTX_get_verify_depth returns the maximum depth of a certificate accepted +// in verification. +OPENSSL_EXPORT int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); + +// SSL_get_verify_depth returns the maximum depth of a certificate accepted in +// verification. +OPENSSL_EXPORT int SSL_get_verify_depth(const SSL *ssl); + +// SSL_CTX_set1_param sets verification parameters from |param|. It returns one +// on success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_CTX_set1_param(SSL_CTX *ctx, + const X509_VERIFY_PARAM *param); + +// SSL_set1_param sets verification parameters from |param|. It returns one on +// success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_set1_param(SSL *ssl, + const X509_VERIFY_PARAM *param); + +// SSL_CTX_get0_param returns |ctx|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); + +// SSL_get0_param returns |ssl|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); + +// SSL_CTX_set_purpose sets |ctx|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose); + +// SSL_set_purpose sets |ssl|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_purpose(SSL *ssl, int purpose); + +// SSL_CTX_set_trust sets |ctx|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_trust(SSL_CTX *ctx, int trust); + +// SSL_set_trust sets |ssl|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_trust(SSL *ssl, int trust); + +// SSL_CTX_set_cert_store sets |ctx|'s certificate store to |store|. It takes +// ownership of |store|. The store is used for certificate verification. +// +// The store is also used for the auto-chaining feature, but this is deprecated. +// See also |SSL_MODE_NO_AUTO_CHAIN|. +OPENSSL_EXPORT void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); + +// SSL_CTX_get_cert_store returns |ctx|'s certificate store. +OPENSSL_EXPORT X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); + +// SSL_CTX_set_default_verify_paths loads the OpenSSL system-default trust +// anchors into |ctx|'s store. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); + +// SSL_CTX_load_verify_locations loads trust anchors into |ctx|'s store from +// |ca_file| and |ca_dir|, either of which may be NULL. If |ca_file| is passed, +// it is opened and PEM-encoded CA certificates are read. If |ca_dir| is passed, +// it is treated as a directory in OpenSSL's hashed directory format. It returns +// one on success and zero on failure. +// +// See +// https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html +// for documentation on the directory format. +OPENSSL_EXPORT int SSL_CTX_load_verify_locations(SSL_CTX *ctx, + const char *ca_file, + const char *ca_dir); + +// SSL_get_verify_result returns the result of certificate verification. It is +// either |X509_V_OK| or a |X509_V_ERR_*| value. +OPENSSL_EXPORT long SSL_get_verify_result(const SSL *ssl); + +// SSL_alert_from_verify_result returns the SSL alert code, such as +// |SSL_AD_CERTIFICATE_EXPIRED|, that corresponds to an |X509_V_ERR_*| value. +// The return value is always an alert, even when |result| is |X509_V_OK|. +OPENSSL_EXPORT int SSL_alert_from_verify_result(long result); + +// SSL_get_ex_data_X509_STORE_CTX_idx returns the ex_data index used to look up +// the |SSL| associated with an |X509_STORE_CTX| in the verify callback. +OPENSSL_EXPORT int SSL_get_ex_data_X509_STORE_CTX_idx(void); + +// SSL_CTX_set_cert_verify_callback sets a custom callback to be called on +// certificate verification rather than |X509_verify_cert|. |store_ctx| contains +// the verification parameters. The callback should return one on success and +// zero on fatal error. It may use |X509_STORE_CTX_set_error| to set a +// verification result. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| to recover the +// |SSL| object from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_cert_verify_callback( + SSL_CTX *ctx, int (*callback)(X509_STORE_CTX *store_ctx, void *arg), + void *arg); + +// SSL_enable_signed_cert_timestamps causes |ssl| (which must be the client end +// of a connection) to request SCTs from the server. See +// https://tools.ietf.org/html/rfc6962. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_enable_signed_cert_timestamps(SSL *ssl); + +// SSL_CTX_enable_signed_cert_timestamps enables SCT requests on all client SSL +// objects created from |ctx|. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx); + +// SSL_enable_ocsp_stapling causes |ssl| (which must be the client end of a +// connection) to request a stapled OCSP response from the server. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_enable_ocsp_stapling(SSL *ssl); + +// SSL_CTX_enable_ocsp_stapling enables OCSP stapling on all client SSL objects +// created from |ctx|. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx); + +// SSL_CTX_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL_CTX|. +OPENSSL_EXPORT int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_CTX_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +OPENSSL_EXPORT int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL|. +OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); + +// SSL_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +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. 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 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|. +OPENSSL_EXPORT int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + + +// Client certificate CA list. +// +// When requesting a client certificate, a server may advertise a list of +// certificate authorities which are accepted. These functions may be used to +// configure this list. + +// SSL_set_client_CA_list sets |ssl|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_set_client_CA_list(SSL *ssl, + STACK_OF(X509_NAME) *name_list); + +// SSL_CTX_set_client_CA_list sets |ctx|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, + STACK_OF(X509_NAME) *name_list); + +// SSL_set0_client_CAs sets |ssl|'s client certificate CA list to |name_list|, +// which should contain DER-encoded distinguished names (RFC 5280). It takes +// ownership of |name_list|. +OPENSSL_EXPORT void SSL_set0_client_CAs(SSL *ssl, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_CTX_set0_client_CAs sets |ctx|'s client certificate CA list to +// |name_list|, which should contain DER-encoded distinguished names (RFC 5280). +// It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_get_client_CA_list returns |ssl|'s client certificate CA list. If |ssl| +// has not been configured as a client, this is the list configured by +// |SSL_CTX_set_client_CA_list|. +// +// If configured as a client, it returns the client certificate CA list sent by +// the server. In this mode, the behavior is undefined except 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. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); + +// SSL_get0_server_requested_CAs returns the CAs sent by a server to guide a +// client in certificate selection. They are a series of DER-encoded X.509 +// names. This function may only be called during a callback set by +// |SSL_CTX_set_cert_cb| or when the handshake is paused because of it. +// +// 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 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) * + SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); + +// SSL_add_client_CA appends |x509|'s subject to the client certificate CA list. +// It returns one on success or zero on error. The caller retains ownership of +// |x509|. +OPENSSL_EXPORT int SSL_add_client_CA(SSL *ssl, X509 *x509); + +// SSL_CTX_add_client_CA appends |x509|'s subject to the client certificate CA +// list. It returns one on success or zero on error. The caller retains +// ownership of |x509|. +OPENSSL_EXPORT int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509); + +// SSL_load_client_CA_file opens |file| and reads PEM-encoded certificates from +// it. It returns a newly-allocated stack of the certificate subjects or NULL +// on error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); + +// SSL_dup_CA_list makes a deep copy of |list|. It returns the new list on +// success or NULL on allocation error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *list); + +// SSL_add_file_cert_subjects_to_stack behaves like |SSL_load_client_CA_file| +// but appends the result to |out|. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *file); + + +// Server name indication. +// +// The server_name extension (RFC 3546) allows the client to advertise the name +// of the server it is connecting to. This is used in virtual hosting +// deployments to select one of a several certificates on a single IP. Only the +// host_name name type is supported. + +#define TLSEXT_NAMETYPE_host_name 0 + +// SSL_set_tlsext_host_name, for a client, configures |ssl| to advertise |name| +// in the server_name extension. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_tlsext_host_name(SSL *ssl, const char *name); + +// SSL_get_servername, for a server, returns the hostname supplied by the +// client or NULL if there was none. The |type| argument must be +// |TLSEXT_NAMETYPE_host_name|. +OPENSSL_EXPORT const char *SSL_get_servername(const SSL *ssl, const int type); + +// SSL_get_servername_type, for a server, returns |TLSEXT_NAMETYPE_host_name| +// if the client sent a hostname and -1 otherwise. +OPENSSL_EXPORT int SSL_get_servername_type(const SSL *ssl); + +// SSL_CTX_set_tlsext_servername_callback configures |callback| to be called on +// the server after ClientHello extensions have been parsed and returns one. +// The callback may use |SSL_get_servername| to examine the server_name +// extension and returns a |SSL_TLSEXT_ERR_*| value. The value of |arg| may be +// set by calling |SSL_CTX_set_tlsext_servername_arg|. +// +// If the callback returns |SSL_TLSEXT_ERR_NOACK|, the server_name extension is +// not acknowledged in the ServerHello. If the return value is +// |SSL_TLSEXT_ERR_ALERT_FATAL|, then |*out_alert| is the alert to send, +// defaulting to |SSL_AD_UNRECOGNIZED_NAME|. |SSL_TLSEXT_ERR_ALERT_WARNING| is +// ignored and treated as |SSL_TLSEXT_ERR_OK|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_callback( + SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)); + +// SSL_CTX_set_tlsext_servername_arg sets the argument to the servername +// callback and returns one. See |SSL_CTX_set_tlsext_servername_callback|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg); + +// SSL_TLSEXT_ERR_* are values returned by some extension-related callbacks. +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +// SSL_set_SSL_CTX changes |ssl|'s |SSL_CTX|. |ssl| will use the +// certificate-related settings from |ctx|, and |SSL_get_SSL_CTX| will report +// |ctx|. This function may be used during the callbacks registered by +// |SSL_CTX_set_select_certificate_cb|, +// |SSL_CTX_set_tlsext_servername_callback|, and |SSL_CTX_set_cert_cb| or when +// the handshake is paused from them. It is typically used to switch +// certificates based on SNI. +// +// Note the session cache and related settings will continue to use the initial +// |SSL_CTX|. Callers should use |SSL_CTX_set_session_id_context| to partition +// the session cache between different domains. +// +// TODO(davidben): Should other settings change after this call? +OPENSSL_EXPORT SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx); + + +// Application-layer protocol negotiation. +// +// The ALPN extension (RFC 7301) allows negotiating different application-layer +// protocols over a single port. This is used, for example, to negotiate +// HTTP/2. + +// SSL_CTX_set_alpn_protos sets the client ALPN protocol list on |ctx| to +// |protos|. |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, + unsigned protos_len); + +// SSL_set_alpn_protos sets the client ALPN protocol list on |ssl| to |protos|. +// |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, + unsigned protos_len); + +// SSL_CTX_set_alpn_select_cb sets a callback function on |ctx| that is called +// during ClientHello processing in order to select an ALPN protocol from the +// client's list of offered protocols. Configuring this callback enables ALPN on +// a server. +// +// The callback is passed a wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings) ALPN protocol list in |in|. It should set |*out| and +// |*out_len| to the selected protocol and return |SSL_TLSEXT_ERR_OK| on +// success. It does not pass ownership of the buffer. Otherwise, it should +// return |SSL_TLSEXT_ERR_NOACK|. Other |SSL_TLSEXT_ERR_*| values are +// unimplemented and will be treated as |SSL_TLSEXT_ERR_NOACK|. +// +// The cipher suite is selected before negotiating ALPN. The callback may use +// |SSL_get_pending_cipher| to query the cipher suite. +OPENSSL_EXPORT 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); + +// SSL_get0_alpn_selected gets the selected ALPN protocol (if any) from |ssl|. +// On return it sets |*out_data| to point to |*out_len| bytes of protocol name +// (not including the leading length-prefix byte). If the server didn't respond +// with a negotiated protocol then |*out_len| will be zero. +OPENSSL_EXPORT void SSL_get0_alpn_selected(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_CTX_set_allow_unknown_alpn_protos configures client connections on |ctx| +// to allow unknown ALPN protocols from the server. Otherwise, by default, the +// client will require that the protocol be advertised in +// |SSL_CTX_set_alpn_protos|. +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 +// and deprecated in favor of it. + +// SSL_CTX_set_next_protos_advertised_cb sets a callback that is called when a +// TLS server needs a list of supported protocols for Next Protocol +// Negotiation. The returned list must be in wire format. The list is returned +// by setting |*out| to point to it and |*out_len| to its length. This memory +// will not be modified, but one should assume that |ssl| keeps a reference to +// it. +// +// The callback should return |SSL_TLSEXT_ERR_OK| if it wishes to advertise. +// Otherwise, no such extension will be included in the ServerHello. +OPENSSL_EXPORT 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); + +// SSL_CTX_set_next_proto_select_cb sets a callback that is called when a client +// needs to select a protocol from the server's provided list. |*out| must be +// set to point to the selected protocol (which may be within |in|). The length +// of the protocol name must be written into |*out_len|. The server's advertised +// protocols are provided in |in| and |in_len|. The callback can assume that +// |in| is syntactically valid. +// +// The client must select a protocol. It is fatal to the connection if this +// callback returns a value other than |SSL_TLSEXT_ERR_OK|. +// +// Configuring this callback enables NPN on a client. +OPENSSL_EXPORT 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); + +// SSL_get0_next_proto_negotiated sets |*out_data| and |*out_len| to point to +// the client's requested protocol for this connection. If the client didn't +// request any protocol, then |*out_data| is set to NULL. +// +// Note that the client can request any protocol it chooses. The value returned +// from this function need not be a member of the list of supported protocols +// provided by the server. +OPENSSL_EXPORT void SSL_get0_next_proto_negotiated(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_select_next_proto implements the standard protocol selection. It is +// expected that this function is called from the callback set by +// |SSL_CTX_set_next_proto_select_cb|. +// +// |peer| and |supported| must be vectors of 8-bit, length-prefixed byte strings +// containing the peer and locally-configured protocols, respectively. The +// length byte itself is not included in the length. A byte string of length 0 +// is invalid. No byte string may be truncated. |supported| is assumed to be +// non-empty. +// +// This function finds the first protocol in |peer| which is also in +// |supported|. If one was found, it sets |*out| and |*out_len| to point to it +// and returns |OPENSSL_NPN_NEGOTIATED|. Otherwise, it returns +// |OPENSSL_NPN_NO_OVERLAP| and sets |*out| and |*out_len| to the first +// supported protocol. +OPENSSL_EXPORT 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); + +#define OPENSSL_NPN_UNSUPPORTED 0 +#define OPENSSL_NPN_NEGOTIATED 1 +#define OPENSSL_NPN_NO_OVERLAP 2 + + +// Channel ID. +// +// See draft-balfanz-tls-channelid-01. + +// SSL_CTX_set_tls_channel_id_enabled configures whether connections associated +// with |ctx| should enable Channel ID. +OPENSSL_EXPORT void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, + int enabled); + +// SSL_set_tls_channel_id_enabled configures whether |ssl| should enable Channel +// ID. +OPENSSL_EXPORT void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled); + +// SSL_CTX_set1_tls_channel_id configures a TLS client to send a TLS Channel ID +// to compatible servers. |private_key| must be a P-256 EC key. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, + EVP_PKEY *private_key); + +// SSL_set1_tls_channel_id configures a TLS client to send a TLS Channel ID to +// compatible servers. |private_key| must be a P-256 EC key. It returns one on +// success and zero on error. +OPENSSL_EXPORT int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key); + +// SSL_get_tls_channel_id gets the client's TLS Channel ID from a server |SSL*| +// and copies up to the first |max_out| bytes into |out|. The Channel ID +// consists of the client's P-256 public key as an (x,y) pair where each is a +// 32-byte, big-endian field element. It returns 0 if the client didn't offer a +// Channel ID and the length of the complete Channel ID otherwise. +OPENSSL_EXPORT size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_CTX_set_channel_id_cb sets a callback to be called when a TLS Channel ID +// is requested. The callback may set |*out_pkey| to a key, passing a reference +// to the caller. If none is returned, the handshake will pause and +// |SSL_get_error| will return |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +// +// See also |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +OPENSSL_EXPORT void SSL_CTX_set_channel_id_cb( + SSL_CTX *ctx, void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey)); + +// SSL_CTX_get_channel_id_cb returns the callback set by +// |SSL_CTX_set_channel_id_cb|. +OPENSSL_EXPORT void (*SSL_CTX_get_channel_id_cb(SSL_CTX *ctx))( + SSL *ssl, EVP_PKEY **out_pkey); + + +// Token Binding. +// +// See draft-ietf-tokbind-protocol-16. + +// SSL_set_token_binding_params sets |params| as the Token Binding Key +// parameters (section 3 of draft-ietf-tokbind-protocol-16) to negotiate on the +// connection. If this function is not called, or if |len| is 0, then this +// endpoint will not attempt to negotiate Token Binding. |params| are provided +// in preference order, with the more preferred parameters at the beginning of +// the list. This function returns 1 on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, + size_t len); + +// SSL_is_token_binding_negotiated returns 1 if Token Binding was negotiated +// on this connection and 0 otherwise. On a server, it is possible for this +// function to return 1 when the client's view of the connection is that Token +// Binding was not negotiated. This occurs when the server indicates a version +// of Token Binding less than the client's minimum version. +OPENSSL_EXPORT int SSL_is_token_binding_negotiated(const SSL *ssl); + +// SSL_get_negotiated_token_binding_param returns the TokenBindingKeyParameters +// enum value that was negotiated. It is only valid to call this function if +// SSL_is_token_binding_negotiated returned 1, otherwise this function returns +// an undefined value. +OPENSSL_EXPORT uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl); + + +// DTLS-SRTP. +// +// See RFC 5764. + +// srtp_protection_profile_st (aka |SRTP_PROTECTION_PROFILE|) is an SRTP +// profile for use with the use_srtp extension. +struct srtp_protection_profile_st { + const char *name; + unsigned long id; +} /* SRTP_PROTECTION_PROFILE */; + +DEFINE_CONST_STACK_OF(SRTP_PROTECTION_PROFILE) + +// SRTP_* define constants for SRTP profiles. +#define SRTP_AES128_CM_SHA1_80 0x0001 +#define SRTP_AES128_CM_SHA1_32 0x0002 +#define SRTP_AES128_F8_SHA1_80 0x0003 +#define SRTP_AES128_F8_SHA1_32 0x0004 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 + +// SSL_CTX_set_srtp_profiles enables SRTP for all SSL objects created from +// |ctx|. |profile| contains a colon-separated list of profile names. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_srtp_profiles enables SRTP for |ssl|. |profile| contains a +// colon-separated list of profile names. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set_srtp_profiles(SSL *ssl, const char *profiles); + +// SSL_get_srtp_profiles returns the SRTP profiles supported by |ssl|. +OPENSSL_EXPORT STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles( + SSL *ssl); + +// SSL_get_selected_srtp_profile returns the selected SRTP profile, or NULL if +// SRTP was not negotiated. +OPENSSL_EXPORT const SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile( + SSL *ssl); + + +// Pre-shared keys. +// +// Connections may be configured with PSK (Pre-Shared Key) cipher suites. These +// authenticate using out-of-band pre-shared keys rather than certificates. See +// RFC 4279. +// +// This implementation uses NUL-terminated C strings for identities and identity +// hints, so values with a NUL character are not supported. (RFC 4279 does not +// specify the format of an identity.) + +// PSK_MAX_IDENTITY_LEN is the maximum supported length of a PSK identity, +// excluding the NUL terminator. +#define PSK_MAX_IDENTITY_LEN 128 + +// PSK_MAX_PSK_LEN is the maximum supported length of a pre-shared key. +#define PSK_MAX_PSK_LEN 256 + +// SSL_CTX_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. +// +// The callback is passed the identity hint in |hint| or NULL if none was +// provided. It should select a PSK identity and write the identity and the +// corresponding PSK to |identity| and |psk|, respectively. The identity is +// written as a NUL-terminated C string of length (excluding the NUL terminator) +// at most |max_identity_len|. The PSK's length must be at most |max_psk_len|. +// The callback returns the length of the PSK or 0 if no suitable identity was +// found. +OPENSSL_EXPORT 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)); + +// SSL_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. See also |SSL_CTX_set_psk_client_callback|. +OPENSSL_EXPORT 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_CTX_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. +// +// The callback is passed the identity in |identity|. It should write a PSK of +// length at most |max_psk_len| to |psk| and return the number of bytes written +// or zero if the PSK identity is unknown. +OPENSSL_EXPORT void SSL_CTX_set_psk_server_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. See also |SSL_CTX_set_psk_server_callback|. +OPENSSL_EXPORT void SSL_set_psk_server_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_CTX_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, + const char *identity_hint); + +// SSL_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_use_psk_identity_hint(SSL *ssl, + const char *identity_hint); + +// SSL_get_psk_identity_hint returns the PSK identity hint advertised for |ssl| +// or NULL if there is none. +OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); + +// SSL_get_psk_identity, after the handshake completes, returns the PSK identity +// that was negotiated by |ssl| or NULL if PSK was not used. +OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); + + +// 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 +// transport parameters. draft-ietf-quic-transport (section 7.4) defines the +// contents of that extension (a TransportParameters struct) and describes how +// to handle it and its semantic meaning. +// +// BoringSSL handles this extension as an opaque byte string. The caller is +// responsible for serializing and parsing it. + +// SSL_set_quic_transport_params configures |ssl| to send |params| (of length +// |params_len|) in the quic_transport_parameters extension in either the +// ClientHello or EncryptedExtensions handshake message. This extension will +// only be sent if the TLS version is at least 1.3, and for a server, only if +// the client sent the extension. The buffer pointed to by |params| only need be +// valid for the duration of the call to this function. This function returns 1 +// on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_quic_transport_params(SSL *ssl, + const uint8_t *params, + size_t params_len); + +// SSL_get_peer_quic_transport_params provides the caller with the value of the +// quic_transport_parameters extension sent by the peer. A pointer to the buffer +// containing the TransportParameters will be put in |*out_params|, and its +// length in |*params_len|. This buffer will be valid for the lifetime of the +// |SSL|. If no params were received from the peer, |*out_params_len| will be 0. +OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + 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 +// implemented. It may cause interoperability or security failures when used. +// +// Early data, or 0-RTT, is a feature in TLS 1.3 which allows clients to send +// data on the first flight during a resumption handshake. This can save a +// round-trip in some application protocols. +// +// 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 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 +// be used to send half-RTT data. |SSL_read| will consume early data and +// transition to 1-RTT data as appropriate. Prior to the transition, +// |SSL_in_init| will report the handshake is still in progress. Callers may use +// it or |SSL_in_early_data| to defer or reject requests as needed. +// +// Early data as a client is more complex. If the offered session (see +// |SSL_set_session|) is 0-RTT-capable, the handshake will return after sending +// the ClientHello. The predicted peer certificates and ALPN protocol will be +// available via the usual APIs. |SSL_write| will write early data, up to the +// session's limit. Writes past this limit and |SSL_read| will complete the +// handshake before continuing. Callers may also call |SSL_do_handshake| again +// to complete the handshake sooner. +// +// If the server accepts early data, the handshake will succeed. |SSL_read| and +// |SSL_write| will then act as in a 1-RTT handshake. The peer certificates and +// ALPN protocol will be as predicted and need not be re-queried. +// +// If the server rejects early data, |SSL_do_handshake| (and thus |SSL_read| and +// |SSL_write|) will then fail with |SSL_get_error| returning +// |SSL_ERROR_EARLY_DATA_REJECTED|. The caller should treat this as a connection +// error and most likely perform a high-level retry. Note the server may still +// have processed the early data due to attacker replays. +// +// To then continue the handshake on the original connection, use +// |SSL_reset_early_data_reject|. The connection will then behave as one which +// had not yet completed the handshake. This allows a faster retry than making a +// fresh connection. |SSL_do_handshake| will complete the full handshake, +// possibly resulting in different peer certificates, ALPN protocol, and other +// properties. The caller must disregard any values from before the reset and +// query again. +// +// 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|. +OPENSSL_EXPORT void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled); + +// SSL_set_early_data_enabled sets whether early data is allowed to be used +// with resumptions using |ssl|. See |SSL_CTX_set_early_data_enabled| for more +// information. +OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); + +// SSL_in_early_data returns one if |ssl| has a pending handshake that has +// progressed enough to send or receive early data. Clients may call |SSL_write| +// to send early data, but |SSL_read| will complete the handshake before +// accepting application data. Servers may call |SSL_read| to read early data +// 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); + +// SSL_reset_early_data_reject resets |ssl| after an early data reject. All +// 0-RTT state is discarded, including any pending |SSL_write| calls. The caller +// should treat |ssl| as a logically fresh connection, usually by driving the +// handshake to completion using |SSL_do_handshake|. +// +// It is an error to call this function on an |SSL| object that is not signaling +// |SSL_ERROR_EARLY_DATA_REJECTED|. +OPENSSL_EXPORT void SSL_reset_early_data_reject(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); + +// 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 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 +// value corresponds to an alert description. Consumers may add or subtract +// |SSL_AD_REASON_OFFSET| to convert between them. +// +// make_errors.go reserves error codes above 1000 for manually-assigned errors. +// This value must be kept in sync with reservedReasonCode in make_errors.h +#define SSL_AD_REASON_OFFSET 1000 + +// 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 +#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED +#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 // 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 +#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED +#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN +#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER +#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA +#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED +#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR +#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR +#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION +#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION +#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY +#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR +#define SSL_AD_INAPPROPRIATE_FALLBACK SSL3_AD_INAPPROPRIATE_FALLBACK +#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED +#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION +#define SSL_AD_MISSING_EXTENSION TLS1_AD_MISSING_EXTENSION +#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION +#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE +#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE \ + TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE +#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE +#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY +#define SSL_AD_CERTIFICATE_REQUIRED TLS1_AD_CERTIFICATE_REQUIRED + +// SSL_alert_type_string_long returns a string description of |value| as an +// alert type (warning or fatal). +OPENSSL_EXPORT const char *SSL_alert_type_string_long(int value); + +// SSL_alert_desc_string_long returns a string description of |value| as an +// alert description or "unknown" if unknown. +OPENSSL_EXPORT const char *SSL_alert_desc_string_long(int value); + +// SSL_send_fatal_alert sends a fatal alert over |ssl| of the specified type, +// which should be one of the |SSL_AD_*| constants. It returns one on success +// and <= 0 on error. The caller should pass the return value into +// |SSL_get_error| to determine how to proceed. Once this function has been +// called, future calls to |SSL_write| will fail. +// +// If retrying a failed operation due to |SSL_ERROR_WANT_WRITE|, subsequent +// calls must use the same |alert| parameter. +OPENSSL_EXPORT int SSL_send_fatal_alert(SSL *ssl, uint8_t alert); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int SSL_set_ex_data(SSL *ssl, int idx, void *data); +OPENSSL_EXPORT void *SSL_get_ex_data(const SSL *ssl, int idx); +OPENSSL_EXPORT int SSL_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 SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, + void *data); +OPENSSL_EXPORT void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, + int idx); +OPENSSL_EXPORT int SSL_SESSION_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 SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data); +OPENSSL_EXPORT void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); +OPENSSL_EXPORT 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); + + +// Low-level record-layer state. + +// 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 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, + const uint8_t **out_write_iv, + size_t *out_iv_len); + +// SSL_get_key_block_len returns the length of |ssl|'s key block. +OPENSSL_EXPORT size_t SSL_get_key_block_len(const SSL *ssl); + +// SSL_generate_key_block generates |out_len| bytes of key material for |ssl|'s +// current connection state. +OPENSSL_EXPORT int SSL_generate_key_block(const SSL *ssl, uint8_t *out, + size_t out_len); + +// SSL_get_read_sequence returns, in TLS, the expected sequence number of the +// next incoming record in the current epoch. In DTLS, it returns the maximum +// sequence number received in the current epoch and includes the epoch number +// in the two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_read_sequence(const SSL *ssl); + +// SSL_get_write_sequence returns the sequence number of the next outgoing +// record in the current epoch. In DTLS, it includes the epoch number in the +// two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); + + +// Obscure functions. + +// 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. +// |write_p| is one for outgoing messages and zero for incoming messages. +// +// For each record header, |cb| is called with |version| = 0 and |content_type| +// = |SSL3_RT_HEADER|. The |len| bytes from |buf| contain the header. Note that +// this does not include the record body. If the record is sealed, the length +// in the header is the length of the ciphertext. +// +// For each handshake message, ChangeCipherSpec, and alert, |version| is the +// protocol version and |content_type| is the corresponding record type. The +// |len| bytes from |buf| contain the handshake message, one-byte +// ChangeCipherSpec body, and two-byte alert, respectively. +// +// For a V2ClientHello, |version| is |SSL2_VERSION|, |content_type| is zero, and +// the |len| bytes from |buf| contain the V2ClientHello structure. +OPENSSL_EXPORT 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)); + +// SSL_CTX_set_msg_callback_arg sets the |arg| parameter of the message +// callback. +OPENSSL_EXPORT void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); + +// SSL_set_msg_callback installs |cb| as the message callback of |ssl|. See +// |SSL_CTX_set_msg_callback| for when this callback is called. +OPENSSL_EXPORT 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_set_msg_callback_arg sets the |arg| parameter of the message callback. +OPENSSL_EXPORT void SSL_set_msg_callback_arg(SSL *ssl, void *arg); + +// SSL_CTX_set_keylog_callback configures a callback to log key material. This +// is intended for debugging use with tools like Wireshark. The |cb| function +// should log |line| followed by a newline, synchronizing with any concurrent +// access to the log. +// +// The format is described in +// https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format. +OPENSSL_EXPORT void SSL_CTX_set_keylog_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, const char *line)); + +// SSL_CTX_get_keylog_callback returns the callback configured by +// |SSL_CTX_set_keylog_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( + const SSL *ssl, const char *line); + +// SSL_CTX_set_current_time_cb configures a callback to retrieve the current +// time, which should be set in |*out_clock|. This can be used for testing +// purposes; for example, a callback can be configured that returns a time +// set explicitly by the test. The |ssl| pointer passed to |cb| is always null. +OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); + +// 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 +// renegotiation attempts by a server. If |ssl| is a server, peer-initiated +// renegotiations are *always* rejected and this function does nothing. +// +// The renegotiation mode defaults to |ssl_renegotiate_never|, but may be set +// at any point in a connection's lifetime. Set it to |ssl_renegotiate_once| to +// allow one renegotiation, |ssl_renegotiate_freely| to allow all +// renegotiations or |ssl_renegotiate_ignore| to ignore HelloRequest messages. +// 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); + +// SSL_total_renegotiations returns the total number of renegotiation handshakes +// performed by |ssl|. This includes the pending renegotiation, if any. +OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); + +// 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) + +// SSL_CTX_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ctx|. +OPENSSL_EXPORT size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx); + +// SSL_CTX_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, + size_t max_cert_list); + +// SSL_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ssl|. +OPENSSL_EXPORT size_t SSL_get_max_cert_list(const SSL *ssl); + +// SSL_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list); + +// SSL_CTX_set_max_send_fragment sets the maximum length, in bytes, of records +// sent by |ctx|. Beyond this length, handshake messages and application data +// will be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, + size_t max_send_fragment); + +// SSL_set_max_send_fragment sets the maximum length, in bytes, of records sent +// by |ssl|. Beyond this length, handshake messages and application data will +// be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_set_max_send_fragment(SSL *ssl, + size_t max_send_fragment); + +// ssl_early_callback_ctx (aka |SSL_CLIENT_HELLO|) is passed to certain +// callbacks that are called very early on during the server handshake. At this +// point, much of the SSL* hasn't been filled out and only the ClientHello can +// be depended on. +typedef struct ssl_early_callback_ctx { + SSL *ssl; + const uint8_t *client_hello; + size_t client_hello_len; + uint16_t version; + const uint8_t *random; + size_t random_len; + const uint8_t *session_id; + size_t session_id_len; + const uint8_t *cipher_suites; + size_t cipher_suites_len; + const uint8_t *compression_methods; + size_t compression_methods_len; + const uint8_t *extensions; + size_t extensions_len; +} SSL_CLIENT_HELLO; + +// ssl_select_cert_result_t enumerates the possible results from selecting a +// certificate with |select_certificate_cb|. +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, + // ssl_select_cert_retry indicates that the operation could not be + // immediately completed and must be reattempted at a later point. + ssl_select_cert_retry = 0, + // ssl_select_cert_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_select_cert_error = -1, +}; + +// SSL_early_callback_ctx_extension_get searches the extensions in +// |client_hello| for an extension of the given type. If not found, it returns +// zero. Otherwise it sets |out_data| to point to the extension contents (not +// including the type and length bytes), sets |out_len| to the length of the +// extension contents and returns one. +OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( + const SSL_CLIENT_HELLO *client_hello, uint16_t extension_type, + const uint8_t **out_data, size_t *out_len); + +// SSL_CTX_set_select_certificate_cb sets a callback that is called before most +// ClientHello processing and before the decision whether to resume a session +// is made. The callback may inspect the ClientHello and configure the +// connection. See |ssl_select_cert_result_t| for details of the return values. +// +// In the case that a retry is indicated, |SSL_get_error| will return +// |SSL_ERROR_PENDING_CERTIFICATE| and the caller should arrange for the +// 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( + SSL_CTX *ctx, + enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)); + +// SSL_CTX_set_dos_protection_cb sets a callback that is called once the +// resumption decision for a ClientHello has been made. It can return one to +// allow the handshake to continue or zero to cause the handshake to abort. +OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( + SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); + +// 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. +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 +#define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +// SSL_CTX_set_info_callback configures a callback to be run when various +// events occur during a connection's lifetime. The |type| argument determines +// the type of event and the meaning of the |value| argument. Callbacks must +// ignore unexpected |type| values. +// +// |SSL_CB_READ_ALERT| is signaled for each alert received, warning or fatal. +// The |value| argument is a 16-bit value where the alert level (either +// |SSL3_AL_WARNING| or |SSL3_AL_FATAL|) is in the most-significant eight bits +// and the alert type (one of |SSL_AD_*|) is in the least-significant eight. +// +// |SSL_CB_WRITE_ALERT| is signaled for each alert sent. The |value| argument +// is constructed as with |SSL_CB_READ_ALERT|. +// +// |SSL_CB_HANDSHAKE_START| is signaled when a handshake begins. The |value| +// argument is always one. +// +// |SSL_CB_HANDSHAKE_DONE| is signaled when a handshake completes successfully. +// The |value| argument is always one. If a handshake False Starts, this event +// may be used to determine when the Finished message is received. +// +// The following event types expose implementation details of the handshake +// state machine. Consuming them is deprecated. +// +// |SSL_CB_ACCEPT_LOOP| (respectively, |SSL_CB_CONNECT_LOOP|) is signaled when +// a server (respectively, client) handshake progresses. The |value| argument +// is always one. +// +// |SSL_CB_ACCEPT_EXIT| (respectively, |SSL_CB_CONNECT_EXIT|) is signaled when +// a server (respectively, client) handshake completes, fails, or is paused. +// The |value| argument is one if the handshake succeeded and <= 0 +// otherwise. +OPENSSL_EXPORT void SSL_CTX_set_info_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_CTX_get_info_callback returns the callback set by +// |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, + int type, + int value); + +// SSL_set_info_callback configures a callback to be run at various events +// during a connection's lifetime. See |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void SSL_set_info_callback( + SSL *ssl, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_get_info_callback returns the callback set by |SSL_set_info_callback|. +OPENSSL_EXPORT void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, + int type, + int value); + +// SSL_state_string_long returns the current state of the handshake state +// machine as a string. This may be useful for debugging and logging. +OPENSSL_EXPORT const char *SSL_state_string_long(const SSL *ssl); + +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + +// SSL_get_shutdown returns a bitmask with a subset of |SSL_SENT_SHUTDOWN| and +// |SSL_RECEIVED_SHUTDOWN| to query whether close_notify was sent or received, +// respectively. +OPENSSL_EXPORT int SSL_get_shutdown(const SSL *ssl); + +// SSL_get_peer_signature_algorithm returns the signature algorithm used by the +// peer. If not applicable, it returns zero. +OPENSSL_EXPORT uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl); + +// SSL_get_client_random writes up to |max_out| bytes of the most recent +// handshake's client_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the client_random. +OPENSSL_EXPORT size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_server_random writes up to |max_out| bytes of the most recent +// handshake's server_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the server_random. +OPENSSL_EXPORT size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_pending_cipher returns the cipher suite for the current handshake or +// NULL if one has not been negotiated yet or there is no pending handshake. +OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); + +// SSL_set_retain_only_sha256_of_client_certs, on a server, sets whether 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 |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); + +// SSL_CTX_set_retain_only_sha256_of_client_certs, on a server, sets whether +// 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 |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); + +// SSL_CTX_set_grease_enabled configures whether sockets on |ctx| should enable +// GREASE. See draft-davidben-tls-grease-01. +OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); + +// SSL_max_seal_overhead returns the maximum overhead, in bytes, of sealing a +// record with |ssl|. +OPENSSL_EXPORT size_t SSL_max_seal_overhead(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_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. + +// SSL_library_init calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int SSL_library_init(void); + +// SSL_CIPHER_description writes a description of |cipher| into |buf| and +// returns |buf|. If |buf| is NULL, it returns a newly allocated string, to be +// freed with |OPENSSL_free|, or NULL on error. +// +// The description includes a trailing newline and has the form: +// AES128-SHA Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1 +// +// Consider |SSL_CIPHER_standard_name| or |SSL_CIPHER_get_name| instead. +OPENSSL_EXPORT const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, + char *buf, int len); + +// SSL_CIPHER_get_version returns the string "TLSv1/SSLv3". +OPENSSL_EXPORT const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_rfc_name returns a newly-allocated string containing the +// result of |SSL_CIPHER_standard_name| or NULL on error. The caller is +// responsible for calling |OPENSSL_free| on the result. +// +// Use |SSL_CIPHER_standard_name| instead. +OPENSSL_EXPORT char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher); + +typedef void COMP_METHOD; +typedef struct ssl_comp_st SSL_COMP; + +// SSL_COMP_get_compression_methods returns NULL. +OPENSSL_EXPORT STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + +// SSL_COMP_add_compression_method returns one. +OPENSSL_EXPORT int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); + +// SSL_COMP_get_name returns NULL. +OPENSSL_EXPORT const char *SSL_COMP_get_name(const COMP_METHOD *comp); + +// SSL_COMP_get0_name returns the |name| member of |comp|. +OPENSSL_EXPORT const char *SSL_COMP_get0_name(const SSL_COMP *comp); + +// SSL_COMP_get_id returns the |id| member of |comp|. +OPENSSL_EXPORT int SSL_COMP_get_id(const SSL_COMP *comp); + +// SSL_COMP_free_compression_methods does nothing. +OPENSSL_EXPORT void SSL_COMP_free_compression_methods(void); + +// SSLv23_method calls |TLS_method|. +OPENSSL_EXPORT const SSL_METHOD *SSLv23_method(void); + +// These version-specific methods behave exactly like |TLS_method| and +// |DTLS_method| except they also call |SSL_CTX_set_min_proto_version| and +// |SSL_CTX_set_max_proto_version| to lock connections to that protocol +// version. +OPENSSL_EXPORT const SSL_METHOD *TLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_method(void); + +// These client- and server-specific methods call their corresponding generic +// methods. +OPENSSL_EXPORT const SSL_METHOD *TLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_client_method(void); + +// SSL_clear resets |ssl| to allow another connection and returns one on success +// or zero on failure. It returns most configuration state but releases memory +// associated with the current connection. +// +// Free |ssl| and create a new one instead. +OPENSSL_EXPORT int SSL_clear(SSL *ssl); + +// SSL_CTX_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_rsa_callback( + SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_set_tmp_rsa_callback(SSL *ssl, + RSA *(*cb)(SSL *ssl, int is_export, + int keylength)); + +// SSL_CTX_sess_connect returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_cb_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_misses returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_misses(const SSL_CTX *ctx); + +// SSL_CTX_sess_timeouts returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_timeouts(const SSL_CTX *ctx); + +// SSL_CTX_sess_cache_full returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cache_full(const SSL_CTX *ctx); + +// SSL_cutthrough_complete calls |SSL_in_false_start|. +OPENSSL_EXPORT int SSL_cutthrough_complete(const SSL *ssl); + +// SSL_num_renegotiations calls |SSL_total_renegotiations|. +OPENSSL_EXPORT int SSL_num_renegotiations(const SSL *ssl); + +// SSL_CTX_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx); + +// SSL_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_need_tmp_RSA(const SSL *ssl); + +// SSL_CTX_set_tmp_rsa returns one. +OPENSSL_EXPORT int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa); + +// SSL_set_tmp_rsa returns one. +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 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 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); + +// SSL_get_shared_ciphers writes an empty string to |buf| and returns a +// 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 + +// i2d_SSL_SESSION serializes |in| to the bytes pointed to by |*pp|. On success, +// it returns the number of bytes written and advances |*pp| by that many bytes. +// On failure, it returns -1. If |pp| is NULL, no bytes are written and only the +// length is returned. +// +// Use |SSL_SESSION_to_bytes| instead. +OPENSSL_EXPORT int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp); + +// d2i_SSL_SESSION parses a serialized session from the |length| bytes pointed +// to by |*pp|. It returns the new |SSL_SESSION| and advances |*pp| by the +// number of bytes consumed on success and NULL on failure. The caller takes +// ownership of the new session and must call |SSL_SESSION_free| when done. +// +// If |a| is non-NULL, |*a| is released and set the new |SSL_SESSION|. +// +// Use |SSL_SESSION_from_bytes| instead. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const uint8_t **pp, + long length); + +// i2d_SSL_SESSION_bio serializes |session| and writes the result to |bio|. It +// returns the number of bytes written on success and <= 0 on error. +OPENSSL_EXPORT int i2d_SSL_SESSION_bio(BIO *bio, const SSL_SESSION *session); + +// d2i_SSL_SESSION_bio reads a serialized |SSL_SESSION| from |bio| and returns a +// newly-allocated |SSL_SESSION| or NULL on error. If |out| is not NULL, it also +// frees |*out| and sets |*out| to the new |SSL_SESSION|. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **out); + +// ERR_load_SSL_strings does nothing. +OPENSSL_EXPORT void ERR_load_SSL_strings(void); + +// SSL_load_error_strings does nothing. +OPENSSL_EXPORT void SSL_load_error_strings(void); + +// SSL_CTX_set_tlsext_use_srtp calls |SSL_CTX_set_srtp_profiles|. It returns +// zero on success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_CTX_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_tlsext_use_srtp calls |SSL_set_srtp_profiles|. It returns zero on +// success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); + +// SSL_get_current_compression returns NULL. +OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); + +// SSL_get_current_expansion returns NULL. +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); + +// SSL_CTX_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); + +// SSL_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_set_tmp_dh(SSL *ssl, const DH *dh); + +// SSL_CTX_set_tmp_dh_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_dh_callback( + SSL_CTX *ctx, DH *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_dh_callback does nothing. +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)) +#define SSL_SESSION_set_app_data(s, a) \ + (SSL_SESSION_set_ex_data(s, 0, (char *)(a))) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s, 0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx, 0)) +#define SSL_CTX_set_app_data(ctx, arg) \ + (SSL_CTX_set_ex_data(ctx, 0, (char *)(arg))) + +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() + +#define SSL_get_cipher(ssl) SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_bits(ssl, out_alg_bits) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), out_alg_bits) +#define SSL_get_cipher_version(ssl) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_name(ssl) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_time(session) SSL_SESSION_get_time(session) +#define SSL_set_time(session, time) SSL_SESSION_set_time((session), (time)) +#define SSL_get_timeout(session) SSL_SESSION_get_timeout(session) +#define SSL_set_timeout(session, timeout) \ + SSL_SESSION_set_timeout((session), (timeout)) + +struct ssl_comp_st { + int id; + const char *name; + char *method; +}; + +DEFINE_STACK_OF(SSL_COMP) + +// The following flags do nothing and are included only to make it easier to +// compile code with BoringSSL. +#define SSL_MODE_AUTO_RETRY 0 +#define SSL_MODE_RELEASE_BUFFERS 0 +#define SSL_MODE_SEND_CLIENTHELLO_TIME 0 +#define SSL_MODE_SEND_SERVERHELLO_TIME 0 +#define SSL_OP_ALL 0 +#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0 +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0 +#define SSL_OP_EPHEMERAL_RSA 0 +#define SSL_OP_LEGACY_SERVER_CONNECT 0 +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0 +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0 +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0 +#define SSL_OP_NETSCAPE_CA_DN_BUG 0 +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0 +#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 +#define SSL_OP_SINGLE_ECDH_USE 0 +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0 +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0 +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0 +#define SSL_OP_TLS_D5_BUG 0 +#define SSL_OP_TLS_ROLLBACK_BUG 0 +#define SSL_VERIFY_CLIENT_ONCE 0 + +// SSL_cache_hit calls |SSL_session_reused|. +OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); + +// SSL_get_default_timeout returns |SSL_DEFAULT_SESSION_TIMEOUT|. +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 "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 +// |SSL_get_ciphers| or NULL if out of range. Use |SSL_get_ciphers| instead. +OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); + +// SSL_CTX_set_client_cert_cb sets a callback which is called on the client if +// the server requests a client certificate and none is configured. On success, +// the callback should return one and set |*out_x509| to |*out_pkey| to a leaf +// certificate and private key, respectively, passing ownership. It should +// return zero to send no certificate and -1 to fail or pause the handshake. If +// the handshake is paused, |SSL_get_error| will return +// |SSL_ERROR_WANT_X509_LOOKUP|. +// +// The callback may call |SSL_get0_certificate_types| and +// |SSL_get_client_CA_list| for information on the server's certificate request. +// +// Use |SSL_CTX_set_cert_cb| instead. Configuring intermediate certificates with +// this function is confusing. This callback may not be registered concurrently +// with |SSL_CTX_set_cert_cb| or |SSL_set_cert_cb|. +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 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. +OPENSSL_EXPORT int SSL_want(const SSL *ssl); + +#define SSL_want_read(ssl) (SSL_want(ssl) == SSL_READING) +#define SSL_want_write(ssl) (SSL_want(ssl) == SSL_WRITING) + + // 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 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 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, + size_t count); + +// SSL_alert_type_string returns "!". Use |SSL_alert_type_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_type_string(int value); + +// SSL_alert_desc_string returns "!!". Use |SSL_alert_desc_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_desc_string(int value); + +// SSL_state_string returns "!!!!!!". Use |SSL_state_string_long| for a more +// intelligible string. +OPENSSL_EXPORT const char *SSL_state_string(const SSL *ssl); + +// SSL_TXT_* expand to strings. +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" +#define SSL_TXT_FIPS "FIPS" +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHE "kDHE" +#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_kECDHE "kECDHE" +#define SSL_TXT_kEECDH "kEECDH" +#define SSL_TXT_kPSK "kPSK" +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aECDSA "aECDSA" +#define SSL_TXT_aPSK "aPSK" +#define SSL_TXT_DH "DH" +#define SSL_TXT_DHE "DHE" +#define SSL_TXT_EDH "EDH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_ECDH "ECDH" +#define SSL_TXT_ECDHE "ECDHE" +#define SSL_TXT_EECDH "EECDH" +#define SSL_TXT_ECDSA "ECDSA" +#define SSL_TXT_PSK "PSK" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_AES128 "AES128" +#define SSL_TXT_AES256 "AES256" +#define SSL_TXT_AES "AES" +#define SSL_TXT_AES_GCM "AESGCM" +#define SSL_TXT_CHACHA20 "CHACHA20" +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" +#define SSL_TXT_SHA256 "SHA256" +#define SSL_TXT_SHA384 "SHA384" +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_TLSV1_1 "TLSv1.1" +#define SSL_TXT_TLSV1_2 "TLSv1.2" +#define SSL_TXT_TLSV1_3 "TLSv1.3" +#define SSL_TXT_ALL "ALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +typedef struct ssl_conf_ctx_st SSL_CONF_CTX; + +// SSL_state returns |SSL_ST_INIT| if a handshake is in progress and |SSL_ST_OK| +// otherwise. +// +// Use |SSL_is_init| instead. +OPENSSL_EXPORT int SSL_state(const SSL *ssl); + +#define SSL_get_state(ssl) SSL_state(ssl) + +// SSL_set_shutdown causes |ssl| to behave as if the shutdown bitmask (see +// |SSL_get_shutdown|) were |mode|. This may be used to skip sending or +// receiving close_notify in |SSL_shutdown| by causing the implementation to +// believe the events already happened. +// +// It is an error to use |SSL_set_shutdown| to unset a bit that has already been +// set. Doing so will trigger an |assert| in debug builds and otherwise be +// ignored. +// +// Use |SSL_CTX_set_quiet_shutdown| instead. +OPENSSL_EXPORT void SSL_set_shutdown(SSL *ssl, int mode); + +// SSL_CTX_set_tmp_ecdh calls |SSL_CTX_set1_curves| with a one-element list +// containing |ec_key|'s curve. +OPENSSL_EXPORT int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key); + +// SSL_set_tmp_ecdh calls |SSL_set1_curves| with a one-element list containing +// |ec_key|'s curve. +OPENSSL_EXPORT int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key); + +// SSL_add_dir_cert_subjects_to_stack lists files in directory |dir|. It calls +// |SSL_add_file_cert_subjects_to_stack| on each file and returns one on success +// or zero on error. This function is only available from the libdecrepit +// library. +OPENSSL_EXPORT int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *dir); + +// SSL_set_verify_result calls |abort| unless |result| is |X509_V_OK|. +// +// TODO(davidben): Remove this function once it has been removed from +// netty-tcnative. +OPENSSL_EXPORT void SSL_set_verify_result(SSL *ssl, long result); + +// SSL_CTX_enable_tls_channel_id calls |SSL_CTX_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx); + +// SSL_enable_tls_channel_id calls |SSL_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_enable_tls_channel_id(SSL *ssl); + +// BIO_f_ssl returns a |BIO_METHOD| that can wrap an |SSL*| in a |BIO*|. Note +// that this has quite different behaviour from the version in OpenSSL (notably +// that it doesn't try to auto renegotiate). +// +// IMPORTANT: if you are not curl, don't use this. +OPENSSL_EXPORT const BIO_METHOD *BIO_f_ssl(void); + +// BIO_set_ssl sets |ssl| as the underlying connection for |bio|, which must +// have been created using |BIO_f_ssl|. If |take_owership| is true, |bio| will +// call |SSL_free| on |ssl| when closed. It returns one on success or something +// other than one on error. +OPENSSL_EXPORT long BIO_set_ssl(BIO *bio, SSL *ssl, int take_owership); + +// SSL_CTX_set_ecdh_auto returns one. +#define SSL_CTX_set_ecdh_auto(ctx, onoff) 1 + +// SSL_set_ecdh_auto returns one. +#define SSL_set_ecdh_auto(ssl, onoff) 1 + +// SSL_get_session returns a non-owning pointer to |ssl|'s session. For +// historical reasons, which session it returns depends on |ssl|'s state. +// +// Prior to the start of the initial handshake, it returns the session the +// caller set with |SSL_set_session|. After the initial handshake has finished +// and if no additional handshakes are in progress, it returns the currently +// active session. Its behavior is undefined while a handshake is in progress. +// +// If trying to add new sessions to an external session cache, use +// |SSL_CTX_sess_set_new_cb| instead. In particular, using the callback is +// required as of TLS 1.3. For compatibility, this function will return an +// unresumable session which may be cached, but will never be resumed. +// +// If querying properties of the connection, use APIs on the |SSL| object. +OPENSSL_EXPORT SSL_SESSION *SSL_get_session(const SSL *ssl); + +// SSL_get0_session is an alias for |SSL_get_session|. +#define SSL_get0_session SSL_get_session + +// SSL_get1_session acts like |SSL_get_session| but returns a new reference to +// the session. +OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); + +#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_SSL_DEFAULT 0 + +// OPENSSL_init_ssl calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, + const OPENSSL_INIT_SETTINGS *settings); + +// 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 + +// 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. +// +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); + +// 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); + +// 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); + +// 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__) + + +// 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. +// +// Although using either the CTRL values or their wrapper macros in #ifdefs is +// still supported, the CTRL values may not be passed to |SSL_ctrl| and +// |SSL_CTX_ctrl|. Call the functions (previously wrapper macros) instead. +// +// See PORTING.md in the BoringSSL source tree for a table of corresponding +// functions. +// https://boringssl.googlesource.com/boringssl/+/master/PORTING.md#Replacements-for-values + +#define DTLS_CTRL_GET_TIMEOUT doesnt_exist +#define DTLS_CTRL_HANDLE_TIMEOUT doesnt_exist +#define SSL_CTRL_CHAIN doesnt_exist +#define SSL_CTRL_CHAIN_CERT doesnt_exist +#define SSL_CTRL_CHANNEL_ID doesnt_exist +#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_CLEAR_MODE doesnt_exist +#define SSL_CTRL_CLEAR_OPTIONS doesnt_exist +#define SSL_CTRL_EXTRA_CHAIN_CERT doesnt_exist +#define SSL_CTRL_GET_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_CHANNEL_ID doesnt_exist +#define SSL_CTRL_GET_CLIENT_CERT_TYPES doesnt_exist +#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_MAX_CERT_LIST doesnt_exist +#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 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS doesnt_exist +#define SSL_CTRL_MODE doesnt_exist +#define SSL_CTRL_NEED_TMP_RSA doesnt_exist +#define SSL_CTRL_OPTIONS doesnt_exist +#define SSL_CTRL_SESS_NUMBER doesnt_exist +#define SSL_CTRL_SET_CURVES doesnt_exist +#define SSL_CTRL_SET_CURVES_LIST doesnt_exist +#define SSL_CTRL_SET_ECDH_AUTO doesnt_exist +#define SSL_CTRL_SET_MAX_CERT_LIST doesnt_exist +#define SSL_CTRL_SET_MAX_SEND_FRAGMENT doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK_ARG doesnt_exist +#define SSL_CTRL_SET_MTU doesnt_exist +#define SSL_CTRL_SET_READ_AHEAD doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_MODE doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_SIZE doesnt_exist +#define SSL_CTRL_SET_TLSEXT_HOSTNAME doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB doesnt_exist +#define SSL_CTRL_SET_TMP_DH doesnt_exist +#define SSL_CTRL_SET_TMP_DH_CB doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH_CB doesnt_exist +#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 + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +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, + kDiscard, + kIncompleteRecord, + kAlertCloseNotify, + kError, +}; + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// OpenRecord decrypts the first complete SSL record from |in| in-place, sets +// |out| to the decrypted application data, and |out_record_len| to the length +// of the encrypted record. Returns: +// - kOK if an application-data record was successfully decrypted and verified. +// - kDiscard if a record was sucessfully processed, but should be discarded. +// - kIncompleteRecord if |in| did not contain a complete record. +// - kAlertCloseNotify if a record was successfully processed but is a +// close_notify alert. +// - kError if an error occurred or the record is invalid. |*out_alert| will be +// set to an alert to emit, or zero if no alert should be emitted. +OPENSSL_EXPORT OpenRecordResult OpenRecord(SSL *ssl, Span *out, + size_t *out_record_len, + uint8_t *out_alert, + Span in); + +OPENSSL_EXPORT size_t SealRecordPrefixLen(const SSL *ssl, size_t plaintext_len); + +// SealRecordSuffixLen returns the length of the suffix written by |SealRecord|. +// +// |plaintext_len| must be equal to the size of the plaintext passed to +// |SealRecord|. +// +// |plaintext_len| must not exceed |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The returned +// suffix length will not exceed |SSL3_RT_MAX_ENCRYPTED_OVERHEAD|. +OPENSSL_EXPORT size_t SealRecordSuffixLen(const SSL *ssl, size_t plaintext_len); + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// SealRecord encrypts the cleartext of |in| and scatters the resulting TLS +// application data record between |out_prefix|, |out|, and |out_suffix|. It +// returns true on success or false if an error occurred. +// +// The length of |out_prefix| must equal |SealRecordPrefixLen|. The length of +// |out| must equal the length of |in|, which must not exceed +// |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The length of |out_suffix| must equal +// |SealRecordSuffixLen|. +// +// If enabled, |SealRecord| may perform TLS 1.0 CBC 1/n-1 record splitting. +// |SealRecordPrefixLen| accounts for the required overhead if that is the case. +// +// |out| may equal |in| to encrypt in-place but may not otherwise alias. +// |out_prefix| and |out_suffix| may not alias anything. +OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, + Span out, Span out_suffix, + Span in); + + +// *** EXPERIMENTAL β€” DO NOT USE WITHOUT CHECKING *** +// +// Split handshakes. +// +// Split handshakes allows the handshake part of a TLS connection to be +// performed in a different process (or on a different machine) than the data +// exchange. This only applies to servers. +// +// In the first part of a split handshake, an |SSL| (where the |SSL_CTX| has +// been configured with |SSL_CTX_set_handoff_mode|) is used normally. Once the +// ClientHello message has been received, the handshake will stop and +// |SSL_get_error| will indicate |SSL_ERROR_HANDOFF|. At this point (and only +// at this point), |SSL_serialize_handoff| can be called to write the β€œhandoff” +// 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|, 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 +// as normal. +// +// 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 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 +// fatal. +// WARNING: The handback data contains sensitive key material and must be +// protected. +// WARNING: Some calls on the final |SSL| will not work. Just as an example, +// calls like |SSL_get0_session_id_context| and |SSL_get_privatekey| won't +// work because the certificate used for handshaking isn't available. +// WARNING: |SSL_apply_handoff| may trigger β€œmsg” callback calls. + +OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); +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); + +// 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++ + +#endif // !defined(BORINGSSL_NO_CXX) + +#endif + +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 101 +#define SSL_R_BAD_ALERT 102 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 104 +#define SSL_R_BAD_DH_P_LENGTH 105 +#define SSL_R_BAD_DIGEST_LENGTH 106 +#define SSL_R_BAD_ECC_CERT 107 +#define SSL_R_BAD_ECPOINT 108 +#define SSL_R_BAD_HANDSHAKE_RECORD 109 +#define SSL_R_BAD_HELLO_REQUEST 110 +#define SSL_R_BAD_LENGTH 111 +#define SSL_R_BAD_PACKET_LENGTH 112 +#define SSL_R_BAD_RSA_ENCRYPT 113 +#define SSL_R_BAD_SIGNATURE 114 +#define SSL_R_BAD_SRTP_MKI_VALUE 115 +#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 116 +#define SSL_R_BAD_SSL_FILETYPE 117 +#define SSL_R_BAD_WRITE_RETRY 118 +#define SSL_R_BIO_NOT_SET 119 +#define SSL_R_BN_LIB 120 +#define SSL_R_BUFFER_TOO_SMALL 121 +#define SSL_R_CA_DN_LENGTH_MISMATCH 122 +#define SSL_R_CA_DN_TOO_LONG 123 +#define SSL_R_CCS_RECEIVED_EARLY 124 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 125 +#define SSL_R_CERT_CB_ERROR 126 +#define SSL_R_CERT_LENGTH_MISMATCH 127 +#define SSL_R_CHANNEL_ID_NOT_P256 128 +#define SSL_R_CHANNEL_ID_SIGNATURE_INVALID 129 +#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 130 +#define SSL_R_CLIENTHELLO_PARSE_FAILED 131 +#define SSL_R_CLIENTHELLO_TLSEXT 132 +#define SSL_R_CONNECTION_REJECTED 133 +#define SSL_R_CONNECTION_TYPE_NOT_SET 134 +#define SSL_R_CUSTOM_EXTENSION_ERROR 135 +#define SSL_R_DATA_LENGTH_TOO_LONG 136 +#define SSL_R_DECODE_ERROR 137 +#define SSL_R_DECRYPTION_FAILED 138 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 139 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 140 +#define SSL_R_DH_P_TOO_LONG 141 +#define SSL_R_DIGEST_CHECK_FAILED 142 +#define SSL_R_DTLS_MESSAGE_TOO_BIG 143 +#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 144 +#define SSL_R_EMS_STATE_INCONSISTENT 145 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 146 +#define SSL_R_ERROR_ADDING_EXTENSION 147 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 148 +#define SSL_R_ERROR_PARSING_EXTENSION 149 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 150 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 151 +#define SSL_R_FRAGMENT_MISMATCH 152 +#define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 153 +#define SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO 154 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_INAPPROPRIATE_FALLBACK 157 +#define SSL_R_INVALID_COMMAND 158 +#define SSL_R_INVALID_MESSAGE 159 +#define SSL_R_INVALID_SSL_SESSION 160 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 161 +#define SSL_R_LENGTH_MISMATCH 162 +#define SSL_R_MISSING_EXTENSION 164 +#define SSL_R_MISSING_RSA_CERTIFICATE 165 +#define SSL_R_MISSING_TMP_DH_KEY 166 +#define SSL_R_MISSING_TMP_ECDH_KEY 167 +#define SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS 168 +#define SSL_R_MTU_TOO_SMALL 169 +#define SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN 170 +#define SSL_R_NESTED_GROUP 171 +#define SSL_R_NO_CERTIFICATES_RETURNED 172 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 173 +#define SSL_R_NO_CERTIFICATE_SET 174 +#define SSL_R_NO_CIPHERS_AVAILABLE 175 +#define SSL_R_NO_CIPHERS_PASSED 176 +#define SSL_R_NO_CIPHER_MATCH 177 +#define SSL_R_NO_COMPRESSION_SPECIFIED 178 +#define SSL_R_NO_METHOD_SPECIFIED 179 +#define SSL_R_NO_P256_SUPPORT 180 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 181 +#define SSL_R_NO_RENEGOTIATION 182 +#define SSL_R_NO_REQUIRED_DIGEST 183 +#define SSL_R_NO_SHARED_CIPHER 184 +#define SSL_R_NULL_SSL_CTX 185 +#define SSL_R_NULL_SSL_METHOD_PASSED 186 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 187 +#define SSL_R_OLD_SESSION_VERSION_NOT_RETURNED 188 +#define SSL_R_OUTPUT_ALIASES_INPUT 189 +#define SSL_R_PARSE_TLSEXT 190 +#define SSL_R_PATH_TOO_LONG 191 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 192 +#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 193 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 194 +#define SSL_R_PSK_IDENTITY_NOT_FOUND 195 +#define SSL_R_PSK_NO_CLIENT_CB 196 +#define SSL_R_PSK_NO_SERVER_CB 197 +#define SSL_R_READ_TIMEOUT_EXPIRED 198 +#define SSL_R_RECORD_LENGTH_MISMATCH 199 +#define SSL_R_RECORD_TOO_LARGE 200 +#define SSL_R_RENEGOTIATION_ENCODING_ERR 201 +#define SSL_R_RENEGOTIATION_MISMATCH 202 +#define SSL_R_REQUIRED_CIPHER_MISSING 203 +#define SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION 204 +#define SSL_R_RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION 205 +#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 206 +#define SSL_R_SERVERHELLO_TLSEXT 207 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 208 +#define SSL_R_SESSION_MAY_NOT_BE_CREATED 209 +#define SSL_R_SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER 210 +#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 211 +#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 212 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 213 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 214 +#define SSL_R_SSL_HANDSHAKE_FAILURE 215 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 216 +#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 217 +#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 218 +#define SSL_R_TOO_MANY_EMPTY_FRAGMENTS 219 +#define SSL_R_TOO_MANY_WARNING_ALERTS 220 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 221 +#define SSL_R_UNEXPECTED_EXTENSION 222 +#define SSL_R_UNEXPECTED_MESSAGE 223 +#define SSL_R_UNEXPECTED_OPERATOR_IN_GROUP 224 +#define SSL_R_UNEXPECTED_RECORD 225 +#define SSL_R_UNINITIALIZED 226 +#define SSL_R_UNKNOWN_ALERT_TYPE 227 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 228 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 229 +#define SSL_R_UNKNOWN_CIPHER_TYPE 230 +#define SSL_R_UNKNOWN_DIGEST 231 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 232 +#define SSL_R_UNKNOWN_PROTOCOL 233 +#define SSL_R_UNKNOWN_SSL_VERSION 234 +#define SSL_R_UNKNOWN_STATE 235 +#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 236 +#define SSL_R_UNSUPPORTED_CIPHER 237 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 238 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 239 +#define SSL_R_UNSUPPORTED_PROTOCOL 240 +#define SSL_R_WRONG_CERTIFICATE_TYPE 241 +#define SSL_R_WRONG_CIPHER_RETURNED 242 +#define SSL_R_WRONG_CURVE 243 +#define SSL_R_WRONG_MESSAGE_TYPE 244 +#define SSL_R_WRONG_SIGNATURE_TYPE 245 +#define SSL_R_WRONG_SSL_VERSION 246 +#define SSL_R_WRONG_VERSION_NUMBER 247 +#define SSL_R_X509_LIB 248 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 249 +#define SSL_R_SHUTDOWN_WHILE_IN_INIT 250 +#define SSL_R_INVALID_OUTER_RECORD_TYPE 251 +#define SSL_R_UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY 252 +#define SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS 253 +#define SSL_R_DOWNGRADE_DETECTED 254 +#define SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE 255 +#define SSL_R_INVALID_COMPRESSION_LIST 256 +#define SSL_R_DUPLICATE_EXTENSION 257 +#define SSL_R_MISSING_KEY_SHARE 258 +#define SSL_R_INVALID_ALPN_PROTOCOL 259 +#define SSL_R_TOO_MANY_KEY_UPDATES 260 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 261 +#define SSL_R_NO_CIPHERS_SPECIFIED 262 +#define SSL_R_RENEGOTIATION_EMS_MISMATCH 263 +#define SSL_R_DUPLICATE_KEY_SHARE 264 +#define SSL_R_NO_GROUPS_SPECIFIED 265 +#define SSL_R_NO_SHARED_GROUP 266 +#define SSL_R_PRE_SHARED_KEY_MUST_BE_LAST 267 +#define SSL_R_OLD_SESSION_PRF_HASH_MISMATCH 268 +#define SSL_R_INVALID_SCT_LIST 269 +#define SSL_R_TOO_MUCH_SKIPPED_EARLY_DATA 270 +#define SSL_R_PSK_IDENTITY_BINDER_COUNT_MISMATCH 271 +#define SSL_R_CANNOT_PARSE_LEAF_CERT 272 +#define SSL_R_SERVER_CERT_CHANGED 273 +#define SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH 274 +#define SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD 275 +#define SSL_R_TICKET_ENCRYPTION_FAILED 276 +#define SSL_R_ALPN_MISMATCH_ON_EARLY_DATA 277 +#define SSL_R_WRONG_VERSION_ON_EARLY_DATA 278 +#define SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA 279 +#define SSL_R_NO_SUPPORTED_VERSIONS_ENABLED 280 +#define SSL_R_APPLICATION_DATA_INSTEAD_OF_HANDSHAKE 281 +#define SSL_R_EMPTY_HELLO_RETRY_REQUEST 282 +#define SSL_R_EARLY_DATA_NOT_IN_USE 283 +#define SSL_R_HANDSHAKE_NOT_COMPLETE 284 +#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 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 +#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 +#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 +#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 +#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 +#define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 +#define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 + +#endif // OPENSSL_HEADER_SSL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back new file mode 100644 index 0000000..858ccfa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back @@ -0,0 +1,5035 @@ +/* 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_H +#define OPENSSL_HEADER_SSL_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(OPENSSL_WINDOWS) +#include +#endif + +// NGINX needs this #include. Consider revisiting this after NGINX 1.14.0 has +// been out for a year or so (assuming that they fix it in that release.) See +// https://boringssl-review.googlesource.com/c/boringssl/+/21664. +#include + +// Forward-declare struct timeval. On Windows, it is defined in winsock2.h and +// Windows headers define too many macros to be included in public headers. +// However, only a forward declaration is needed. +struct timeval; + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SSL implementation. + + +// SSL contexts. +// +// |SSL_CTX| objects manage shared state and configuration between multiple TLS +// or DTLS connections. Whether the connections are TLS or DTLS is selected by +// an |SSL_METHOD| on creation. +// +// |SSL_CTX| are reference-counted and may be shared by connections across +// 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 connections. +OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); + +// DTLS_method is the |SSL_METHOD| used for DTLS connections. +OPENSSL_EXPORT const SSL_METHOD *DTLS_method(void); + +// TLS_with_buffers_method is like |TLS_method|, but avoids all use of +// crypto/x509. All client connections created with |TLS_with_buffers_method| +// will fail unless a certificate verifier is installed with +// |SSL_set_custom_verify| or |SSL_CTX_set_custom_verify|. +OPENSSL_EXPORT const SSL_METHOD *TLS_with_buffers_method(void); + +// DTLS_with_buffers_method is like |DTLS_method|, but avoids all use of +// crypto/x509. +OPENSSL_EXPORT const SSL_METHOD *DTLS_with_buffers_method(void); + +// SSL_CTX_new returns a newly-allocated |SSL_CTX| with default settings or NULL +// on error. +OPENSSL_EXPORT SSL_CTX *SSL_CTX_new(const SSL_METHOD *method); + +// SSL_CTX_up_ref increments the reference count of |ctx|. It returns one. +OPENSSL_EXPORT int SSL_CTX_up_ref(SSL_CTX *ctx); + +// SSL_CTX_free releases memory associated with |ctx|. +OPENSSL_EXPORT void SSL_CTX_free(SSL_CTX *ctx); + + +// SSL connections. +// +// An |SSL| object represents a single TLS or DTLS connection. Although the +// shared |SSL_CTX| is thread-safe, an |SSL| is not thread-safe and may only be +// used on one thread at a time. + +// SSL_new returns a newly-allocated |SSL| using |ctx| or NULL on error. The new +// connection inherits settings from |ctx| at the time of creation. Settings may +// also be individually configured on the connection. +// +// On creation, an |SSL| is not configured to be either a client or server. Call +// |SSL_set_connect_state| or |SSL_set_accept_state| to set this. +OPENSSL_EXPORT SSL *SSL_new(SSL_CTX *ctx); + +// SSL_free releases memory associated with |ssl|. +OPENSSL_EXPORT void SSL_free(SSL *ssl); + +// SSL_get_SSL_CTX returns the |SSL_CTX| associated with |ssl|. If +// |SSL_set_SSL_CTX| is called, it returns the new |SSL_CTX|, not the initial +// one. +OPENSSL_EXPORT SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); + +// SSL_set_connect_state configures |ssl| to be a client. +OPENSSL_EXPORT void SSL_set_connect_state(SSL *ssl); + +// SSL_set_accept_state configures |ssl| to be a server. +OPENSSL_EXPORT void SSL_set_accept_state(SSL *ssl); + +// SSL_is_server returns one if |ssl| is configured as a server and zero +// otherwise. +OPENSSL_EXPORT int SSL_is_server(const SSL *ssl); + +// SSL_is_dtls returns one if |ssl| is a DTLS connection and zero otherwise. +OPENSSL_EXPORT int SSL_is_dtls(const SSL *ssl); + +// SSL_set_bio configures |ssl| to read from |rbio| and write to |wbio|. |ssl| +// takes ownership of the two |BIO|s. If |rbio| and |wbio| are the same, |ssl| +// only takes ownership of one reference. +// +// In DTLS, |rbio| must be non-blocking to properly handle timeouts and +// retransmits. +// +// If |rbio| is the same as the currently configured |BIO| for reading, that +// side is left untouched and is not freed. +// +// If |wbio| is the same as the currently configured |BIO| for writing AND |ssl| +// is not currently configured to read from and write to the same |BIO|, that +// side is left untouched and is not freed. This asymmetry is present for +// historical reasons. +// +// Due to the very complex historical behavior of this function, calling this +// function if |ssl| already has |BIO|s configured is deprecated. Prefer +// |SSL_set0_rbio| and |SSL_set0_wbio| instead. +OPENSSL_EXPORT void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); + +// SSL_set0_rbio configures |ssl| to write to |rbio|. It takes ownership of +// |rbio|. +// +// Note that, although this function and |SSL_set0_wbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_rbio(SSL *ssl, BIO *rbio); + +// SSL_set0_wbio configures |ssl| to write to |wbio|. It takes ownership of +// |wbio|. +// +// Note that, although this function and |SSL_set0_rbio| may be called on the +// same |BIO|, each call takes a reference. Use |BIO_up_ref| to balance this. +OPENSSL_EXPORT void SSL_set0_wbio(SSL *ssl, BIO *wbio); + +// SSL_get_rbio returns the |BIO| that |ssl| reads from. +OPENSSL_EXPORT BIO *SSL_get_rbio(const SSL *ssl); + +// SSL_get_wbio returns the |BIO| that |ssl| writes to. +OPENSSL_EXPORT BIO *SSL_get_wbio(const SSL *ssl); + +// SSL_get_fd calls |SSL_get_rfd|. +OPENSSL_EXPORT int SSL_get_fd(const SSL *ssl); + +// SSL_get_rfd returns the file descriptor that |ssl| is configured to read +// from. If |ssl|'s read |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_rfd(const SSL *ssl); + +// SSL_get_wfd returns the file descriptor that |ssl| is configured to write +// to. If |ssl|'s write |BIO| is not configured or doesn't wrap a file +// descriptor then it returns -1. +// +// Note: On Windows, this may return either a file descriptor or a socket (cast +// to int), depending on whether |ssl| was configured with a file descriptor or +// socket |BIO|. +OPENSSL_EXPORT int SSL_get_wfd(const SSL *ssl); + +// SSL_set_fd configures |ssl| to read from and write to |fd|. It returns one +// on success and zero on allocation error. The caller retains ownership of +// |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_fd(SSL *ssl, int fd); + +// SSL_set_rfd configures |ssl| to read from |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_rfd(SSL *ssl, int fd); + +// SSL_set_wfd configures |ssl| to write to |fd|. It returns one on success and +// zero on allocation error. The caller retains ownership of |fd|. +// +// On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs. +OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd); + +// SSL_do_handshake continues the current handshake. If there is none or the +// handshake has completed or False Started, it returns one. Otherwise, it +// returns <= 0. The caller should pass the value into |SSL_get_error| to +// determine how to proceed. +// +// In DTLS, the caller must drive retransmissions. Whenever |SSL_get_error| +// signals |SSL_ERROR_WANT_READ|, use |DTLSv1_get_timeout| to determine the +// current timeout. If it expires before the next retry, call +// |DTLSv1_handle_timeout|. Note that DTLS handshake retransmissions use fresh +// sequence numbers, so it is not sufficient to replay packets at the transport. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_do_handshake(SSL *ssl); + +// SSL_connect configures |ssl| as a client, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_connect(SSL *ssl); + +// SSL_accept configures |ssl| as a server, if unconfigured, and calls +// |SSL_do_handshake|. +OPENSSL_EXPORT int SSL_accept(SSL *ssl); + +// SSL_read reads up to |num| bytes from |ssl| into |buf|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes read. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_read(SSL *ssl, void *buf, int num); + +// SSL_peek behaves like |SSL_read| but does not consume any bytes returned. +OPENSSL_EXPORT int SSL_peek(SSL *ssl, void *buf, int num); + +// SSL_pending returns the number of bytes available in |ssl|. It does not read +// from the transport. +OPENSSL_EXPORT int SSL_pending(const SSL *ssl); + +// SSL_write writes up to |num| bytes from |buf| into |ssl|. It implicitly runs +// any pending handshakes, including renegotiations when enabled. On success, it +// returns the number of bytes written. Otherwise, it returns <= 0. The caller +// should pass the value into |SSL_get_error| to determine how to proceed. +// +// In TLS, a non-blocking |SSL_write| differs from non-blocking |write| in that +// a failed |SSL_write| still commits to the data passed in. When retrying, the +// caller must supply the original write buffer (or a larger one containing the +// original as a prefix). By default, retries will fail if they also do not +// reuse the same |buf| pointer. This may be relaxed with +// |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER|, but the buffer contents still must be +// unchanged. +// +// By default, in TLS, |SSL_write| will not return success until all |num| bytes +// are written. This may be relaxed with |SSL_MODE_ENABLE_PARTIAL_WRITE|. It +// allows |SSL_write| to complete with a partial result when only part of the +// input was written in a single record. +// +// In DTLS, neither |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER| and +// |SSL_MODE_ENABLE_PARTIAL_WRITE| do anything. The caller may retry with a +// different buffer freely. A single call to |SSL_write| only ever writes a +// single record in a single packet, so |num| must be at most +// |SSL3_RT_MAX_PLAIN_LENGTH|. +// +// TODO(davidben): Ensure 0 is only returned on transport EOF. +// https://crbug.com/466303. +OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); + +// 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. +// +// 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 +// enabled, |SSL_shutdown| will not send a close_notify alert or wait for one +// from the peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ctx|. +OPENSSL_EXPORT int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); + +// SSL_set_quiet_shutdown sets quiet shutdown on |ssl| to |mode|. If enabled, +// |SSL_shutdown| will not send a close_notify alert or wait for one from the +// peer. It will instead synchronously return one. +OPENSSL_EXPORT void SSL_set_quiet_shutdown(SSL *ssl, int mode); + +// SSL_get_quiet_shutdown returns whether quiet shutdown is enabled for +// |ssl|. +OPENSSL_EXPORT int SSL_get_quiet_shutdown(const SSL *ssl); + +// SSL_get_error returns a |SSL_ERROR_*| value for the most recent operation on +// |ssl|. It should be called after an operation failed to determine whether the +// error was fatal and, if not, when to retry. +OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); + +// SSL_ERROR_NONE indicates the operation succeeded. +#define SSL_ERROR_NONE 0 + +// SSL_ERROR_SSL indicates the operation failed within the library. The caller +// may inspect the error queue for more information. +#define SSL_ERROR_SSL 1 + +// SSL_ERROR_WANT_READ indicates the operation failed attempting to read from +// the transport. The caller may retry the operation when the transport is ready +// for reading. +// +// If signaled by a DTLS handshake, the caller must also call +// |DTLSv1_get_timeout| and |DTLSv1_handle_timeout| as appropriate. See +// |SSL_do_handshake|. +#define SSL_ERROR_WANT_READ 2 + +// SSL_ERROR_WANT_WRITE indicates the operation failed attempting to write to +// the transport. The caller may retry the operation when the transport is ready +// for writing. +#define SSL_ERROR_WANT_WRITE 3 + +// SSL_ERROR_WANT_X509_LOOKUP indicates the operation failed in calling the +// |cert_cb| or |client_cert_cb|. The caller may retry the operation when the +// callback is ready to return a certificate or one has been configured +// externally. +// +// See also |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb|. +#define SSL_ERROR_WANT_X509_LOOKUP 4 + +// SSL_ERROR_SYSCALL indicates the operation failed externally to the library. +// The caller should consult the system-specific error mechanism. This is +// typically |errno| but may be something custom if using a custom |BIO|. It +// may also be signaled if the transport returned EOF, in which case the +// operation's return value will be zero. +#define SSL_ERROR_SYSCALL 5 + +// SSL_ERROR_ZERO_RETURN indicates the operation failed because the connection +// was cleanly shut down with a close_notify alert. +#define SSL_ERROR_ZERO_RETURN 6 + +// SSL_ERROR_WANT_CONNECT indicates the operation failed attempting to connect +// the transport (the |BIO| signaled |BIO_RR_CONNECT|). The caller may retry the +// operation when the transport is ready. +#define SSL_ERROR_WANT_CONNECT 7 + +// SSL_ERROR_WANT_ACCEPT indicates the operation failed attempting to accept a +// connection from the transport (the |BIO| signaled |BIO_RR_ACCEPT|). The +// caller may retry the operation when the transport is ready. +// +// TODO(davidben): Remove this. It's used by accept BIOs which are bizarre. +#define SSL_ERROR_WANT_ACCEPT 8 + +// SSL_ERROR_WANT_CHANNEL_ID_LOOKUP indicates the operation failed looking up +// the Channel ID key. The caller may retry the operation when |channel_id_cb| +// is ready to return a key or one has been configured with +// |SSL_set1_tls_channel_id|. +// +// See also |SSL_CTX_set_channel_id_cb|. +#define SSL_ERROR_WANT_CHANNEL_ID_LOOKUP 9 + +// SSL_ERROR_PENDING_SESSION indicates the operation failed because the session +// lookup callback indicated the session was unavailable. The caller may retry +// the operation when lookup has completed. +// +// See also |SSL_CTX_sess_set_get_cb| and |SSL_magic_pending_session_ptr|. +#define SSL_ERROR_PENDING_SESSION 11 + +// SSL_ERROR_PENDING_CERTIFICATE indicates the operation failed because the +// early callback indicated certificate lookup was incomplete. The caller may +// retry the operation when lookup has completed. +// +// See also |SSL_CTX_set_select_certificate_cb|. +#define SSL_ERROR_PENDING_CERTIFICATE 12 + +// SSL_ERROR_WANT_PRIVATE_KEY_OPERATION indicates the operation failed because +// a private key operation was unfinished. The caller may retry the operation +// when the private key operation is complete. +// +// See also |SSL_set_private_key_method| and +// |SSL_CTX_set_private_key_method|. +#define SSL_ERROR_WANT_PRIVATE_KEY_OPERATION 13 + +// SSL_ERROR_PENDING_TICKET indicates that a ticket decryption is pending. The +// caller may retry the operation when the decryption is ready. +// +// See also |SSL_CTX_set_ticket_aead_method|. +#define SSL_ERROR_PENDING_TICKET 14 + +// SSL_ERROR_EARLY_DATA_REJECTED indicates that early data was rejected. The +// caller should treat this as a connection failure and retry any operations +// associated with the rejected early data. |SSL_reset_early_data_reject| may be +// used to reuse the underlying connection for the retry. +#define SSL_ERROR_EARLY_DATA_REJECTED 15 + +// SSL_ERROR_WANT_CERTIFICATE_VERIFY indicates the operation failed because +// certificate verification was incomplete. The caller may retry the operation +// when certificate verification is complete. +// +// See also |SSL_CTX_set_custom_verify|. +#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. +OPENSSL_EXPORT int SSL_set_mtu(SSL *ssl, unsigned mtu); + +// DTLSv1_set_initial_timeout_duration sets the initial duration for a DTLS +// handshake timeout. +// +// This duration overrides the default of 1 second, which is the strong +// recommendation of RFC 6347 (see section 4.2.4.1). However, there may exist +// situations where a shorter timeout would be beneficial, such as for +// time-sensitive applications. +OPENSSL_EXPORT void DTLSv1_set_initial_timeout_duration(SSL *ssl, + unsigned duration_ms); + +// DTLSv1_get_timeout queries the next DTLS handshake timeout. If there is a +// timeout in progress, it sets |*out| to the time remaining and returns one. +// Otherwise, it returns zero. +// +// When the timeout expires, call |DTLSv1_handle_timeout| to handle the +// retransmit behavior. +// +// NOTE: This function must be queried again whenever the handshake state +// machine changes, including when |DTLSv1_handle_timeout| is called. +OPENSSL_EXPORT int DTLSv1_get_timeout(const SSL *ssl, struct timeval *out); + +// DTLSv1_handle_timeout is called when a DTLS handshake timeout expires. If no +// timeout had expired, it returns 0. Otherwise, it retransmits the previous +// flight of handshake messages and returns 1. If too many timeouts had expired +// without progress or an error occurs, it returns -1. +// +// The caller's external timer should be compatible with the one |ssl| queries +// within some fudge factor. Otherwise, the call will be a no-op, but +// |DTLSv1_get_timeout| will return an updated timeout. +// +// If the function returns -1, checking if |SSL_get_error| returns +// |SSL_ERROR_WANT_WRITE| may be used to determine if the retransmit failed due +// to a non-fatal error at the write |BIO|. However, the operation may not be +// retried until the next timeout fires. +// +// WARNING: This function breaks the usual return value convention. +// +// TODO(davidben): This |SSL_ERROR_WANT_WRITE| behavior is kind of bizarre. +OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); + + +// Protocol versions. + +#define DTLS1_VERSION_MAJOR 0xfe +#define SSL3_VERSION_MAJOR 0x03 + +#define SSL3_VERSION 0x0300 +#define TLS1_VERSION 0x0301 +#define TLS1_1_VERSION 0x0302 +#define TLS1_2_VERSION 0x0303 +#define TLS1_3_VERSION 0x0304 + +#define DTLS1_VERSION 0xfeff +#define DTLS1_2_VERSION 0xfefd + +// 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. +OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, + uint16_t version); + +// SSL_CTX_set_max_proto_version sets the maximum protocol version for |ctx| to +// |version|. If |version| is zero, the default maximum version is used. It +// returns one on success and zero if |version| is invalid. +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. +OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); + +// SSL_set_max_proto_version sets the maximum protocol version for |ssl| to +// |version|. If |version| is zero, the default maximum version is used. It +// 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. +OPENSSL_EXPORT int SSL_version(const SSL *ssl); + + +// Options. +// +// Options configure protocol behavior. + +// SSL_OP_NO_QUERY_MTU, in DTLS, disables querying the MTU from the underlying +// |BIO|. Instead, the MTU is configured with |SSL_set_mtu|. +#define SSL_OP_NO_QUERY_MTU 0x00001000L + +// SSL_OP_NO_TICKET disables session ticket support (RFC 5077). +#define SSL_OP_NO_TICKET 0x00004000L + +// SSL_OP_CIPHER_SERVER_PREFERENCE configures servers to select ciphers and +// ECDHE curves according to the server's preferences instead of the +// client's. +#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L + +// 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_TLSv1 0x04000000L +#define SSL_OP_NO_TLSv1_2 0x08000000L +#define SSL_OP_NO_TLSv1_1 0x10000000L +#define SSL_OP_NO_TLSv1_3 0x20000000L +#define SSL_OP_NO_DTLSv1 SSL_OP_NO_TLSv1 +#define SSL_OP_NO_DTLSv1_2 SSL_OP_NO_TLSv1_2 + +// SSL_CTX_set_options enables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_clear_options disables all options set in |options| (which should be +// one or more of the |SSL_OP_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options); + +// SSL_CTX_get_options returns a bitmask of |SSL_OP_*| values that represent all +// the options enabled for |ctx|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_options(const SSL_CTX *ctx); + +// SSL_set_options enables all options set in |options| (which should be one or +// more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_set_options(SSL *ssl, uint32_t options); + +// SSL_clear_options disables all options set in |options| (which should be one +// or more of the |SSL_OP_*| values, ORed together) in |ssl|. It returns a +// bitmask representing the resulting enabled options. +OPENSSL_EXPORT uint32_t SSL_clear_options(SSL *ssl, uint32_t options); + +// SSL_get_options returns a bitmask of |SSL_OP_*| values that represent all the +// options enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); + + +// Modes. +// +// Modes configure API behavior. + +// SSL_MODE_ENABLE_PARTIAL_WRITE, in TLS, allows |SSL_write| to complete with a +// partial result when the only part of the input was written in a single +// record. In DTLS, it does nothing. +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L + +// SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, in TLS, allows retrying an incomplete +// |SSL_write| with a different buffer. However, |SSL_write| still assumes the +// buffer contents are unchanged. This is not the default to avoid the +// misconception that non-blocking |SSL_write| behaves like non-blocking +// |write|. In DTLS, it does nothing. +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L + +// SSL_MODE_NO_AUTO_CHAIN disables automatically building a certificate chain +// before sending certificates to the peer. This flag is set (and the feature +// disabled) by default. +// TODO(davidben): Remove this behavior. https://crbug.com/boringssl/42. +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L + +// SSL_MODE_ENABLE_FALSE_START allows clients to send application data before +// receipt of ChangeCipherSpec and Finished. This mode enables full handshakes +// to 'complete' in one RTT. See RFC 7918. +// +// When False Start is enabled, |SSL_do_handshake| may succeed before the +// handshake has completely finished. |SSL_write| will function at this point, +// and |SSL_read| will transparently wait for the final handshake leg before +// returning application data. To determine if False Start occurred or when the +// handshake is completely finished, see |SSL_in_false_start|, |SSL_in_init|, +// 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 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 +// fail with SSL_R_SESSION_MAY_NOT_BE_CREATED. This can be used to enforce that +// session resumption is used for a given SSL*. +#define SSL_MODE_NO_SESSION_CREATION 0x00000200L + +// SSL_MODE_SEND_FALLBACK_SCSV sends TLS_FALLBACK_SCSV in the ClientHello. +// To be set only by applications that reconnect with a downgraded protocol +// version; see RFC 7507 for details. +// +// DO NOT ENABLE THIS if your application attempts a normal handshake. Only use +// this in explicit fallback retries, following the guidance in RFC 7507. +#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000400L + +// SSL_CTX_set_mode enables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_clear_mode disables all modes set in |mode| (which should be one or +// more of the |SSL_MODE_*| values, ORed together) in |ctx|. It returns a +// bitmask representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode); + +// SSL_CTX_get_mode returns a bitmask of |SSL_MODE_*| values that represent all +// the modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx); + +// SSL_set_mode enables all modes set in |mode| (which should be one or more of +// the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_set_mode(SSL *ssl, uint32_t mode); + +// SSL_clear_mode disables all modes set in |mode| (which should be one or more +// of the |SSL_MODE_*| values, ORed together) in |ssl|. It returns a bitmask +// representing the resulting enabled modes. +OPENSSL_EXPORT uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode); + +// SSL_get_mode returns a bitmask of |SSL_MODE_*| values that represent all the +// modes enabled for |ssl|. +OPENSSL_EXPORT uint32_t SSL_get_mode(const SSL *ssl); + +// SSL_CTX_set0_buffer_pool sets a |CRYPTO_BUFFER_POOL| that will be used to +// store certificates. This can allow multiple connections to share +// certificates and thus save memory. +// +// The SSL_CTX does not take ownership of |pool| and the caller must ensure +// that |pool| outlives |ctx| and all objects linked to it, including |SSL|, +// |X509| and |SSL_SESSION| objects. Basically, don't ever free |pool|. +OPENSSL_EXPORT void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, + CRYPTO_BUFFER_POOL *pool); + + +// Configuring certificates and private keys. +// +// These functions configure the connection's leaf certificate, private key, and +// certificate chain. The certificate chain is ordered leaf to root (as sent on +// the wire) but does not include the leaf. Both client and server certificates +// use these functions. +// +// Certificates and keys may be configured before the handshake or dynamically +// in the early callback and certificate callback. + +// SSL_CTX_use_certificate sets |ctx|'s leaf certificate to |x509|. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x509); + +// SSL_use_certificate sets |ssl|'s leaf certificate to |x509|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_use_certificate(SSL *ssl, X509 *x509); + +// SSL_CTX_use_PrivateKey sets |ctx|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); + +// SSL_use_PrivateKey sets |ssl|'s private key to |pkey|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); + +// SSL_CTX_set0_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_CTX_set1_chain sets |ctx|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); + +// SSL_set0_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. On success, it returns one and takes ownership of |chain|. +// Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_set1_chain sets |ssl|'s certificate chain, excluding the leaf, to +// |chain|. It returns one on success and zero on failure. The caller retains +// ownership of |chain| and may release it freely. +OPENSSL_EXPORT int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain); + +// SSL_CTX_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On +// success, it returns one and takes ownership of |x509|. Otherwise, it returns +// zero. +OPENSSL_EXPORT int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_CTX_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It +// returns one on success and zero on failure. The caller retains ownership of +// |x509| and may release it freely. +OPENSSL_EXPORT int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add0_chain_cert appends |x509| to |ctx|'s certificate chain. On success, +// it returns one and takes ownership of |x509|. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_add0_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_add_extra_chain_cert calls |SSL_CTX_add0_chain_cert|. +OPENSSL_EXPORT int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + +// SSL_add1_chain_cert appends |x509| to |ctx|'s certificate chain. It returns +// one on success and zero on failure. The caller retains ownership of |x509| +// and may release it freely. +OPENSSL_EXPORT int SSL_add1_chain_cert(SSL *ssl, X509 *x509); + +// SSL_CTX_clear_chain_certs clears |ctx|'s certificate chain and returns +// one. +OPENSSL_EXPORT int SSL_CTX_clear_chain_certs(SSL_CTX *ctx); + +// SSL_CTX_clear_extra_chain_certs calls |SSL_CTX_clear_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); + +// SSL_clear_chain_certs clears |ssl|'s certificate chain and returns one. +OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); + +// SSL_CTX_set_cert_cb sets a callback that is called to select a certificate. +// The callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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_CTX_set_cert_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, void *arg), + void *arg); + +// SSL_set_cert_cb sets a callback that is called to select a certificate. The +// callback returns one on success, zero on internal error, and a negative +// number on failure or to pause the handshake. If the handshake is paused, +// |SSL_get_error| will return |SSL_ERROR_WANT_X509_LOOKUP|. +// +// 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. 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(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); + +// SSL_CTX_check_private_key returns one if the certificate and private key +// configured in |ctx| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_check_private_key(const SSL_CTX *ctx); + +// SSL_check_private_key returns one if the certificate and private key +// configured in |ssl| are consistent and zero otherwise. +OPENSSL_EXPORT int SSL_check_private_key(const SSL *ssl); + +// SSL_CTX_get0_certificate returns |ctx|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); + +// SSL_get_certificate returns |ssl|'s leaf certificate. +OPENSSL_EXPORT X509 *SSL_get_certificate(const SSL *ssl); + +// SSL_CTX_get0_privatekey returns |ctx|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); + +// SSL_get_privatekey returns |ssl|'s private key. +OPENSSL_EXPORT EVP_PKEY *SSL_get_privatekey(const SSL *ssl); + +// SSL_CTX_get0_chain_certs sets |*out_chain| to |ctx|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_CTX_get_extra_chain_certs calls |SSL_CTX_get0_chain_certs|. +OPENSSL_EXPORT int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain); + +// SSL_get0_chain_certs sets |*out_chain| to |ssl|'s certificate chain and +// returns one. +OPENSSL_EXPORT int SSL_get0_chain_certs(const SSL *ssl, + STACK_OF(X509) **out_chain); + +// SSL_CTX_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request it. The |list| argument must +// contain one or more SCT structures serialised as a SignedCertificateTimestamp +// List (see https://tools.ietf.org/html/rfc6962#section-3.3) – i.e. each SCT +// is prefixed by a big-endian, uint16 length and the concatenation of one or +// more such prefixed SCTs are themselves also prefixed by a uint16 length. It +// returns one on success and zero on error. The caller retains ownership of +// |list|. +OPENSSL_EXPORT int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_set_signed_cert_timestamp_list sets the list of signed certificate +// timestamps that is sent to clients that request is. The same format as the +// one used for |SSL_CTX_set_signed_cert_timestamp_list| applies. The caller +// retains ownership of |list|. +OPENSSL_EXPORT int SSL_set_signed_cert_timestamp_list(SSL *ctx, + const uint8_t *list, + size_t list_len); + +// SSL_CTX_set_ocsp_response sets the OCSP response that is sent to clients +// which request it. It returns one on success and zero on error. The caller +// retains ownership of |response|. +OPENSSL_EXPORT int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, + const uint8_t *response, + size_t response_len); + +// SSL_set_ocsp_response sets the OCSP response that is sent to clients which +// request it. It returns one on success and zero on error. The caller retains +// ownership of |response|. +OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, + const uint8_t *response, + size_t response_len); + +// SSL_SIGN_* are signature algorithm values as defined in TLS 1.3. +#define SSL_SIGN_RSA_PKCS1_SHA1 0x0201 +#define SSL_SIGN_RSA_PKCS1_SHA256 0x0401 +#define SSL_SIGN_RSA_PKCS1_SHA384 0x0501 +#define SSL_SIGN_RSA_PKCS1_SHA512 0x0601 +#define SSL_SIGN_ECDSA_SHA1 0x0203 +#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_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 +// specify raw RSASSA-PKCS1-v1_5 with an MD5/SHA-1 concatenation, as used in TLS +// before TLS 1.2. +#define SSL_SIGN_RSA_PKCS1_MD5_SHA1 0xff01 + +// SSL_get_signature_algorithm_name returns a human-readable name for |sigalg|, +// or NULL if unknown. If |include_curve| is one, the curve for ECDSA algorithms +// is included as in TLS 1.3. Otherwise, it is excluded as in TLS 1.2. +OPENSSL_EXPORT const char *SSL_get_signature_algorithm_name(uint16_t sigalg, + int include_curve); + +// SSL_get_signature_algorithm_key_type returns the key type associated with +// |sigalg| as an |EVP_PKEY_*| constant or |EVP_PKEY_NONE| if unknown. +OPENSSL_EXPORT int SSL_get_signature_algorithm_key_type(uint16_t sigalg); + +// SSL_get_signature_algorithm_digest returns the digest function associated +// with |sigalg| or |NULL| if |sigalg| has no prehash (Ed25519) or is unknown. +OPENSSL_EXPORT const EVP_MD *SSL_get_signature_algorithm_digest( + uint16_t sigalg); + +// SSL_is_signature_algorithm_rsa_pss returns one if |sigalg| is an RSA-PSS +// signature algorithm and zero otherwise. +OPENSSL_EXPORT int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg); + +// SSL_CTX_set_signing_algorithm_prefs configures |ctx| to use |prefs| as the +// preference list when signing with |ctx|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + +// SSL_set_signing_algorithm_prefs configures |ssl| to use |prefs| as the +// preference list when signing with |ssl|'s private key. It returns one on +// success and zero on error. |prefs| should not include the internal-only value +// |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. +OPENSSL_EXPORT int SSL_set_signing_algorithm_prefs(SSL *ssl, + const uint16_t *prefs, + size_t num_prefs); + + +// Certificate and private key convenience functions. + +// SSL_CTX_set_chain_and_key sets the certificate chain and private key for a +// TLS client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_set_chain_and_key sets the certificate chain and private key for a TLS +// client or server. References to the given |CRYPTO_BUFFER| and |EVP_PKEY| +// objects are added as needed. Exactly one of |privkey| or |privkey_method| +// may be non-NULL. Returns one on success and zero on error. +OPENSSL_EXPORT 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); + +// SSL_CTX_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one +// on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); + +// SSL_use_RSAPrivateKey sets |ctx|'s private key to |rsa|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); + +// The following functions configure certificates or private keys but take as +// input DER-encoded structures. They return one on success and zero on +// failure. + +OPENSSL_EXPORT int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, + const uint8_t *der); +OPENSSL_EXPORT int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, + const uint8_t *der, size_t der_len); + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, + const uint8_t *der, + size_t der_len); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, + size_t der_len); + +// The following functions configure certificates or private keys but take as +// input files to read from. They return one on success and zero on failure. The +// |type| parameter is one of the |SSL_FILETYPE_*| values and determines whether +// the file's contents are read as PEM or DER. + +#define SSL_FILETYPE_PEM 1 +#define SSL_FILETYPE_ASN1 2 + +OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, + const char *file, + int type); +OPENSSL_EXPORT int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_certificate_file(SSL *ssl, const char *file, + int type); + +OPENSSL_EXPORT int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, + int type); +OPENSSL_EXPORT int SSL_use_PrivateKey_file(SSL *ssl, const char *file, + int type); + +// SSL_CTX_use_certificate_chain_file configures certificates for |ctx|. It +// reads the contents of |file| as a PEM-encoded leaf certificate followed +// optionally by the certificate chain to send to the peer. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, + const char *file); + +// SSL_CTX_set_default_passwd_cb sets the password callback for PEM-based +// convenience functions called on |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, + pem_password_cb *cb); + +// SSL_CTX_get_default_passwd_cb returns the callback set by +// |SSL_CTX_set_default_passwd_cb|. +OPENSSL_EXPORT pem_password_cb *SSL_CTX_get_default_passwd_cb( + const SSL_CTX *ctx); + +// SSL_CTX_set_default_passwd_cb_userdata sets the userdata parameter for +// |ctx|'s password callback. +OPENSSL_EXPORT void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, + void *data); + +// SSL_CTX_get_default_passwd_cb_userdata returns the userdata parameter set by +// |SSL_CTX_set_default_passwd_cb_userdata|. +OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); + + +// Custom private keys. + +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { + ssl_private_key_success, + ssl_private_key_retry, + ssl_private_key_failure, +}; + +// ssl_private_key_method_st (aka |SSL_PRIVATE_KEY_METHOD|) describes private +// key hooks. This is used to off-load signing operations to a custom, +// potentially asynchronous, backend. Metadata about the key such as the type +// and size are parsed out of the certificate. +struct ssl_private_key_method_st { + // sign signs the message |in| in using the specified signature algorithm. On + // success, it returns |ssl_private_key_success| and writes at most |max_out| + // bytes of signature data to |out| and sets |*out_len| to the number of bytes + // written. On failure, it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. |sign| should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed. This will result in a call to |complete|. + // + // |signature_algorithm| is one of the |SSL_SIGN_*| values, as defined in TLS + // 1.3. Note that, in TLS 1.2, ECDSA algorithms do not require that curve + // sizes match hash sizes, so the curve portion of |SSL_SIGN_ECDSA_*| values + // must be ignored. BoringSSL will internally handle the curve matching logic + // where appropriate. + // + // It is an error to call |sign| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*sign)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out, + uint16_t signature_algorithm, + const uint8_t *in, size_t in_len); + + // decrypt decrypts |in_len| bytes of encrypted data from |in|. On success it + // returns |ssl_private_key_success|, writes at most |max_out| bytes of + // decrypted data to |out| and sets |*out_len| to the actual number of bytes + // written. On failure it returns |ssl_private_key_failure|. If the operation + // has not completed, it returns |ssl_private_key_retry|. The caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in a call to |complete|. This + // function only works with RSA keys and should perform a raw RSA decryption + // operation with no padding. + // + // It is an error to call |decrypt| while another private key operation is in + // progress on |ssl|. + enum ssl_private_key_result_t (*decrypt)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + + // complete completes a pending operation. If the operation has completed, it + // returns |ssl_private_key_success| and writes the result to |out| as in + // |sign|. Otherwise, it returns |ssl_private_key_failure| on failure and + // |ssl_private_key_retry| if the operation is still in progress. + // + // |complete| may be called arbitrarily many times before completion, but it + // is an error to call |complete| if there is no pending operation in progress + // on |ssl|. + enum ssl_private_key_result_t (*complete)(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); +}; + +// SSL_set_private_key_method configures a custom private key on |ssl|. +// |key_method| must remain valid for the lifetime of |ssl|. +OPENSSL_EXPORT void SSL_set_private_key_method( + SSL *ssl, const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_CTX_set_private_key_method configures a custom private key on |ctx|. +// |key_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_private_key_method( + SSL_CTX *ctx, const SSL_PRIVATE_KEY_METHOD *key_method); + + +// Cipher suites. +// +// |SSL_CIPHER| objects represent cipher suites. + +DEFINE_CONST_STACK_OF(SSL_CIPHER) + +// SSL_get_cipher_by_value returns the structure representing a TLS cipher +// suite based on its assigned number, or NULL if unknown. See +// 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 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); + +// SSL_CIPHER_is_block_cipher returns one if |cipher| is a block cipher. +OPENSSL_EXPORT int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_cipher_nid returns the NID for |cipher|'s bulk +// cipher. Possible values are |NID_aes_128_gcm|, |NID_aes_256_gcm|, +// |NID_chacha20_poly1305|, |NID_aes_128_cbc|, |NID_aes_256_cbc|, and +// |NID_des_ede3_cbc|. +OPENSSL_EXPORT int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_digest_nid returns the NID for |cipher|'s HMAC if it is a +// legacy cipher suite. For modern AEAD-based ciphers (see +// |SSL_CIPHER_is_aead|), it returns |NID_undef|. +// +// Note this function only returns the legacy HMAC digest, not the PRF hash. +OPENSSL_EXPORT int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_kx_nid returns the NID for |cipher|'s key exchange. This may +// be |NID_kx_rsa|, |NID_kx_ecdhe|, or |NID_kx_psk| for TLS 1.2. In TLS 1.3, +// cipher suites do not specify the key exchange, so this function returns +// |NID_kx_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_auth_nid returns the NID for |cipher|'s authentication +// type. This may be |NID_auth_rsa|, |NID_auth_ecdsa|, or |NID_auth_psk| for TLS +// 1.2. In TLS 1.3, cipher suites do not specify authentication, so this +// function returns |NID_auth_any|. +OPENSSL_EXPORT int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_prf_nid retuns the NID for |cipher|'s PRF hash. If |cipher| is +// a pre-TLS-1.2 cipher, it returns |NID_md5_sha1| but note these ciphers use +// SHA-256 in TLS 1.2. Other return values may be treated uniformly in all +// applicable versions. +OPENSSL_EXPORT int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_min_version returns the minimum protocol version required +// for |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_max_version returns the maximum protocol version that +// supports |cipher|. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_standard_name returns the standard IETF name for |cipher|. For +// example, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256". +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". 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 +// method used by |cipher|. For example, "ECDHE_ECDSA". TLS 1.3 AEAD-only +// ciphers return the string "GENERIC". +OPENSSL_EXPORT const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_bits returns the strength, in bits, of |cipher|. If +// |out_alg_bits| is not NULL, it writes the number of bits consumed by the +// symmetric algorithm to |*out_alg_bits|. +OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, + int *out_alg_bits); + + +// Cipher suite configuration. +// +// OpenSSL uses a mini-language to configure cipher suites. The language +// maintains an ordered list of enabled ciphers, along with an ordered list of +// disabled but available ciphers. Initially, all ciphers are disabled with a +// default ordering. The cipher string is then interpreted as a sequence of +// directives, separated by colons, each of which modifies this state. +// +// Most directives consist of a one character or empty opcode followed by a +// selector which matches a subset of available ciphers. +// +// Available opcodes are: +// +// The empty opcode enables and appends all matching disabled ciphers to the +// end of the enabled list. The newly appended ciphers are ordered relative to +// each other matching their order in the disabled list. +// +// |-| disables all matching enabled ciphers and prepends them to the disabled +// list, with relative order from the enabled list preserved. This means the +// most recently disabled ciphers get highest preference relative to other +// disabled ciphers if re-enabled. +// +// |+| moves all matching enabled ciphers to the end of the enabled list, with +// relative order preserved. +// +// |!| deletes all matching ciphers, enabled or not, from either list. Deleted +// ciphers will not matched by future operations. +// +// A selector may be a specific cipher (using either the standard or OpenSSL +// name for the cipher) or one or more rules separated by |+|. The final +// selector matches the intersection of each rule. For instance, |AESGCM+aECDSA| +// matches ECDSA-authenticated AES-GCM ciphers. +// +// Available cipher rules are: +// +// |ALL| matches all ciphers. +// +// |kRSA|, |kDHE|, |kECDHE|, and |kPSK| match ciphers using plain RSA, DHE, +// ECDHE, and plain PSK key exchanges, respectively. Note that ECDHE_PSK is +// matched by |kECDHE| and not |kPSK|. +// +// |aRSA|, |aECDSA|, and |aPSK| match ciphers authenticated by RSA, ECDSA, and +// a pre-shared key, respectively. +// +// |RSA|, |DHE|, |ECDHE|, |PSK|, |ECDSA|, and |PSK| are aliases for the +// corresponding |k*| or |a*| cipher rule. |RSA| is an alias for |kRSA|, not +// |aRSA|. +// +// |3DES|, |AES128|, |AES256|, |AES|, |AESGCM|, |CHACHA20| match ciphers +// whose bulk cipher use the corresponding encryption scheme. Note that +// |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. +// +// |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. +// +// Deprecated cipher rules: +// +// |kEDH|, |EDH|, |kEECDH|, and |EECDH| are legacy aliases for |kDHE|, |DHE|, +// |kECDHE|, and |ECDHE|, respectively. +// +// |HIGH| is an alias for |ALL|. +// +// |FIPS| is an alias for |HIGH|. +// +// |SSLv3| and |TLSv1| match ciphers available in TLS 1.1 or earlier. +// |TLSv1_2| matches ciphers new in TLS 1.2. This is confusing and should not +// be used. +// +// Unknown rules are silently ignored by legacy APIs, and rejected by APIs with +// "strict" in the name, which should be preferred. Cipher lists can be long +// and it's easy to commit typos. Strict functions will also reject the use of +// spaces, semi-colons and commas as alternative separators. +// +// The special |@STRENGTH| directive will sort all enabled ciphers by strength. +// +// The |DEFAULT| directive, when appearing at the front of the string, expands +// to the default ordering of available ciphers. +// +// If configuring a server, one may also configure equal-preference groups to +// partially respect the client's preferences when +// |SSL_OP_CIPHER_SERVER_PREFERENCE| is enabled. Ciphers in an equal-preference +// group have equal priority and use the client order. This may be used to +// enforce that AEADs are preferred but select AES-GCM vs. ChaCha20-Poly1305 +// based on client preferences. An equal-preference is specified with square +// brackets, combining multiple selectors separated by |. For example: +// +// [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. +// +// TLS 1.3 ciphers do not participate in this mechanism and instead have a +// built-in preference order. Functions to set cipher lists do not affect TLS +// 1.3, and functions to query the cipher list do not include TLS 1.3 +// ciphers. + +// SSL_DEFAULT_CIPHER_LIST is the default cipher suite configuration. It is +// substituted when a cipher string starts with 'DEFAULT'. +#define SSL_DEFAULT_CIPHER_LIST "ALL" + +// SSL_CTX_set_strict_cipher_list configures the cipher list for |ctx|, +// evaluating |str| as a cipher string and returning error if |str| contains +// anything meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, + const char *str); + +// SSL_CTX_set_cipher_list configures the cipher list for |ctx|, evaluating +// |str| as a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_CTX_set_strict_cipher_list|. This function tolerates +// garbage inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); + +// SSL_set_strict_cipher_list configures the cipher list for |ssl|, evaluating +// |str| as a cipher string and returning error if |str| contains anything +// meaningless. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_set_strict_cipher_list(SSL *ssl, const char *str); + +// SSL_set_cipher_list configures the cipher list for |ssl|, evaluating |str| as +// a cipher string. It returns one on success and zero on failure. +// +// Prefer to use |SSL_set_strict_cipher_list|. This function tolerates garbage +// inputs, unless an empty cipher list results. +OPENSSL_EXPORT int SSL_set_cipher_list(SSL *ssl, const char *str); + +// SSL_CTX_get_ciphers returns the cipher list for |ctx|, in order of +// preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); + +// SSL_CTX_cipher_in_group returns one if the |i|th cipher (see +// |SSL_CTX_get_ciphers|) is in the same equipreference group as the one +// following it and zero otherwise. +OPENSSL_EXPORT int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i); + +// SSL_get_ciphers returns the cipher list for |ssl|, in order of preference. +OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl); + + +// Connection information. + +// SSL_is_init_finished returns one if |ssl| has completed its initial handshake +// and has no pending handshake. It returns zero otherwise. +OPENSSL_EXPORT int SSL_is_init_finished(const SSL *ssl); + +// SSL_in_init returns one if |ssl| has a pending handshake and zero +// otherwise. +OPENSSL_EXPORT int SSL_in_init(const SSL *ssl); + +// SSL_in_false_start returns one if |ssl| has a pending handshake that is in +// False Start. |SSL_write| may be called at this point without waiting for the +// peer, but |SSL_read| will complete the handshake before accepting application +// data. +// +// See also |SSL_MODE_ENABLE_FALSE_START|. +OPENSSL_EXPORT int SSL_in_false_start(const SSL *ssl); + +// SSL_get_peer_certificate returns the peer's leaf certificate or NULL if the +// peer did not use certificates. The caller must call |X509_free| on the +// result to release it. +OPENSSL_EXPORT X509 *SSL_get_peer_certificate(const SSL *ssl); + +// SSL_get_peer_cert_chain returns the peer's certificate chain or NULL if +// unavailable or 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. +// +// WARNING: This function behaves differently between client and server. If +// |ssl| is a server, the returned chain does not include the leaf certificate. +// If a client, it does. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); + +// SSL_get_peer_full_cert_chain returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the same as |SSL_get_peer_cert_chain| except that this function +// always returns the full chain, i.e. the first element of the return value +// (if any) will be the leaf certificate. In constrast, +// |SSL_get_peer_cert_chain| returns only the intermediate certificates if the +// |ssl| is a server. +OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); + +// SSL_get0_peer_certificates returns the peer's certificate chain, or NULL if +// unavailable or 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. +// +// This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. +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 +// |*out_len| bytes of SCT information from the server. This is only valid if +// |ssl| is a client. 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_get0_signed_cert_timestamp_list(const SSL *ssl, + const uint8_t **out, + size_t *out_len); + +// SSL_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_get0_ocsp_response(const SSL *ssl, const uint8_t **out, + size_t *out_len); + +// SSL_get_tls_unique writes at most |max_out| bytes of the tls-unique value +// for |ssl| to |out| and sets |*out_len| to the number of bytes written. It +// returns one on success or zero on error. In general |max_out| should be at +// least 12. +// +// This function will always fail if the initial handshake has not completed. +// The tls-unique value will change after a renegotiation but, since +// renegotiations can be initiated by the server at any point, the higher-level +// protocol must either leave them disabled or define states in which the +// tls-unique value can be read. +// +// The tls-unique value is defined by +// https://tools.ietf.org/html/rfc5929#section-3.1. Due to a weakness in the +// TLS protocol, tls-unique is broken for resumed connections unless the +// Extended Master Secret extension is negotiated. Thus this function will +// return zero if |ssl| performed session resumption unless EMS was used when +// negotiating the original session. +OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out); + +// SSL_get_extms_support returns one if the Extended Master Secret extension or +// TLS 1.3 was negotiated. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); + +// 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 +// and zero otherwise. +// +// TODO(davidben): Hammer down the semantics of this API while a handshake, +// initial or renego, is in progress. +OPENSSL_EXPORT int SSL_session_reused(const SSL *ssl); + +// SSL_get_secure_renegotiation_support returns one if the peer supports secure +// renegotiation (RFC 5746) or TLS 1.3. Otherwise, it returns zero. +OPENSSL_EXPORT int SSL_get_secure_renegotiation_support(const SSL *ssl); + +// SSL_export_keying_material exports a value derived from the master secret, as +// specified in RFC 5705. It writes |out_len| bytes to |out| given a label and +// optional context. (Since a zero length context is allowed, the |use_context| +// flag controls whether a context is included.) +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT 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); + + +// Sessions. +// +// An |SSL_SESSION| represents an SSL session that may be resumed in an +// abbreviated handshake. It is reference-counted and immutable. Once +// established, an |SSL_SESSION| may be shared by multiple |SSL| objects on +// different threads and must not be modified. + +DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + +// SSL_SESSION_new returns a newly-allocated blank |SSL_SESSION| or NULL on +// error. This may be useful when writing tests but should otherwise not be +// used. +OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_new(const SSL_CTX *ctx); + +// SSL_SESSION_up_ref increments the reference count of |session| and returns +// one. +OPENSSL_EXPORT int SSL_SESSION_up_ref(SSL_SESSION *session); + +// SSL_SESSION_free decrements the reference count of |session|. If it reaches +// zero, all data referenced by |session| and |session| itself are released. +OPENSSL_EXPORT void SSL_SESSION_free(SSL_SESSION *session); + +// SSL_SESSION_to_bytes serializes |in| into a newly allocated buffer and sets +// |*out_data| to that buffer and |*out_len| to its length. The caller takes +// ownership of the buffer and must call |OPENSSL_free| when done. It returns +// one on success and zero on error. +OPENSSL_EXPORT int SSL_SESSION_to_bytes(const SSL_SESSION *in, + uint8_t **out_data, size_t *out_len); + +// SSL_SESSION_to_bytes_for_ticket serializes |in|, but excludes the session +// identification information, namely the session ID and ticket. +OPENSSL_EXPORT int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, + uint8_t **out_data, + size_t *out_len); + +// SSL_SESSION_from_bytes parses |in_len| bytes from |in| as an SSL_SESSION. It +// returns a newly-allocated |SSL_SESSION| on success or NULL on error. +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 "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| +// was established at. +OPENSSL_EXPORT uint16_t +SSL_SESSION_get_protocol_version(const SSL_SESSION *session); + +// SSL_SESSION_set_protocol_version sets |session|'s TLS or DTLS version to +// |version|. This may be useful when writing tests but should otherwise not be +// used. It returns one on success and zero on error. +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); + +// SSL_SESSION_get_timeout returns the lifetime of |session| in seconds. +OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer returns the peer leaf certificate stored in +// |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. +OPENSSL_EXPORT size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, + uint8_t *out, size_t max_out); + +// SSL_SESSION_set_time sets |session|'s creation time to |time| and returns +// |time|. This function may be useful in writing tests but otherwise should not +// be used. +OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, + uint64_t time); + +// SSL_SESSION_set_timeout sets |session|'s timeout to |timeout| and returns +// one. This function may be useful in writing tests but otherwise should not +// be used. +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 +// should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_SESSION_should_be_single_use returns one if |session| should be +// single-use (TLS 1.3 and later) and zero otherwise. +// +// If this function returns one, clients retain multiple sessions and use each +// only once. This prevents passive observers from correlating connections with +// 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 +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_is_resumable(const SSL_SESSION *session); + +// SSL_SESSION_has_ticket returns one if |session| has a ticket and zero +// otherwise. +OPENSSL_EXPORT int SSL_SESSION_has_ticket(const SSL_SESSION *session); + +// SSL_SESSION_get0_ticket sets |*out_ticket| and |*out_len| to |session|'s +// ticket, or NULL and zero if it does not have one. |out_ticket| may be NULL +// if only the ticket length is needed. +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. +// +// Session caching allows connections to be established more efficiently based +// on saved parameters from a previous connection, called a session (see +// |SSL_SESSION|). The client offers a saved session, using an opaque identifier +// from a previous connection. The server may accept the session, if it has the +// parameters available. Otherwise, it will decline and continue with a full +// handshake. +// +// This requires both the client and the server to retain session state. A +// client does so with a stateful session cache. A server may do the same or, if +// supported by both sides, statelessly using session tickets. For more +// information on the latter, see the next section. +// +// For a server, the library implements a built-in internal session cache as an +// in-memory hash table. Servers may also use |SSL_CTX_sess_set_get_cb| and +// |SSL_CTX_sess_set_new_cb| to implement a custom external session cache. In +// particular, this may be used to share a session cache between multiple +// servers in a large deployment. An external cache may be used in addition to +// or instead of the internal one. Use |SSL_CTX_set_session_cache_mode| to +// toggle the internal cache. +// +// For a client, the only option is an external session cache. Clients may use +// |SSL_CTX_sess_set_new_cb| to register a callback for when new sessions are +// available. These may be cached and, in subsequent compatible connections, +// configured with |SSL_set_session|. +// +// Note that offering or accepting a session short-circuits certificate +// verification and most parameter negotiation. Resuming sessions across +// different contexts may result in security failures and surprising +// behavior. For a typical client, this means sessions for different hosts must +// be cached under different keys. A client that connects to the same host with, +// e.g., different cipher suite settings or client certificates should also use +// separate session caches between those contexts. Servers should also partition +// session caches between SNI hosts with |SSL_CTX_set_session_id_context|. +// +// Note also, in TLS 1.2 and earlier, offering sessions allows passive observers +// to correlate different client connections. TLS 1.3 and later fix this, +// provided clients use sessions at most once. Session caches are managed by the +// caller in BoringSSL, so this must be implemented externally. See +// |SSL_SESSION_should_be_single_use| for details. + +// SSL_SESS_CACHE_OFF disables all session caching. +#define SSL_SESS_CACHE_OFF 0x0000 + +// SSL_SESS_CACHE_CLIENT enables session caching for a client. The internal +// cache is never used on a client, so this only enables the callbacks. +#define SSL_SESS_CACHE_CLIENT 0x0001 + +// SSL_SESS_CACHE_SERVER enables session caching for a server. +#define SSL_SESS_CACHE_SERVER 0x0002 + +// SSL_SESS_CACHE_BOTH enables session caching for both client and server. +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER) + +// SSL_SESS_CACHE_NO_AUTO_CLEAR disables automatically calling +// |SSL_CTX_flush_sessions| every 255 connections. +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 + +// SSL_SESS_CACHE_NO_INTERNAL_LOOKUP, on a server, disables looking up a session +// from the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 + +// SSL_SESS_CACHE_NO_INTERNAL_STORE, on a server, disables storing sessions in +// the internal session cache. +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 + +// SSL_SESS_CACHE_NO_INTERNAL, on a server, disables the internal session +// cache. +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) + +// SSL_CTX_set_session_cache_mode sets the session cache mode bits for |ctx| to +// |mode|. It returns the previous value. +OPENSSL_EXPORT int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode); + +// SSL_CTX_get_session_cache_mode returns the session cache mode bits for +// |ctx| +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|. 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); + +// SSL_DEFAULT_SESSION_TIMEOUT is the default lifetime, in seconds, of a +// session in TLS 1.2 or earlier. This is how long we are willing to use the +// secret to encrypt traffic without fresh key material. +#define SSL_DEFAULT_SESSION_TIMEOUT (2 * 60 * 60) + +// SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT is the default lifetime, in seconds, of a +// session for TLS 1.3 psk_dhe_ke. This is how long we are willing to use the +// secret as an authenticator. +#define SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT (2 * 24 * 60 * 60) + +// SSL_DEFAULT_SESSION_AUTH_TIMEOUT is the default non-renewable lifetime, in +// seconds, of a TLS 1.3 session. This is how long we are willing to trust the +// signature in the initial handshake. +#define SSL_DEFAULT_SESSION_AUTH_TIMEOUT (7 * 24 * 60 * 60) + +// SSL_CTX_set_timeout sets the lifetime, in seconds, of TLS 1.2 (or earlier) +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT uint32_t SSL_CTX_set_timeout(SSL_CTX *ctx, uint32_t timeout); + +// SSL_CTX_set_session_psk_dhe_timeout sets the lifetime, in seconds, of TLS 1.3 +// sessions created in |ctx| to |timeout|. +OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, + uint32_t timeout); + +// SSL_CTX_get_timeout returns the lifetime, in seconds, of TLS 1.2 (or earlier) +// 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 +// connection without a matching session ID context. +// +// For a server, if |SSL_VERIFY_PEER| is enabled, it is an error to not set a +// session ID context. +OPENSSL_EXPORT int SSL_CTX_set_session_id_context(SSL_CTX *ctx, + const uint8_t *sid_ctx, + size_t sid_ctx_len); + +// SSL_set_session_id_context sets |ssl|'s session ID context to |sid_ctx|. It +// returns one on success and zero on error. See also +// |SSL_CTX_set_session_id_context|. +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. It returns NULL on error. +OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, + size_t *out_len); + +// SSL_SESSION_CACHE_MAX_SIZE_DEFAULT is the default maximum size of a session +// cache. +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024 * 20) + +// SSL_CTX_sess_set_cache_size sets the maximum size of |ctx|'s internal session +// cache to |size|. It returns the previous value. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, + unsigned long size); + +// SSL_CTX_sess_get_cache_size returns the maximum size of |ctx|'s internal +// session cache. +OPENSSL_EXPORT unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx); + +// SSL_CTX_sess_number returns the number of sessions in |ctx|'s internal +// session cache. +OPENSSL_EXPORT size_t SSL_CTX_sess_number(const SSL_CTX *ctx); + +// SSL_CTX_add_session inserts |session| into |ctx|'s internal session cache. It +// returns one on success and zero on error or if |session| is already in the +// cache. The caller retains its reference to |session|. +OPENSSL_EXPORT int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_remove_session removes |session| from |ctx|'s internal session cache. +// It returns one on success and zero if |session| was not in the cache. +OPENSSL_EXPORT int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_flush_sessions removes all sessions from |ctx| which have expired as +// of time |time|. If |time| is zero, all sessions are removed. +OPENSSL_EXPORT void SSL_CTX_flush_sessions(SSL_CTX *ctx, uint64_t time); + +// SSL_CTX_sess_set_new_cb sets the callback to be called when a new session is +// established and ready to be cached. If the session cache is disabled (the +// appropriate one of |SSL_SESS_CACHE_CLIENT| or |SSL_SESS_CACHE_SERVER| is +// unset), the callback is not called. +// +// The callback is passed a reference to |session|. It returns one if it takes +// ownership (and then calls |SSL_SESSION_free| when done) and zero otherwise. A +// consumer which places |session| into an in-memory cache will likely return +// one, with the cache calling |SSL_SESSION_free|. A consumer which serializes +// |session| with |SSL_SESSION_to_bytes| may not need to retain |session| and +// will likely return zero. Returning one is equivalent to calling +// |SSL_SESSION_up_ref| and then returning zero. +// +// Note: For a client, the callback may be called on abbreviated handshakes if a +// ticket is renewed. Further, it may not be called until some time after +// |SSL_do_handshake| or |SSL_connect| completes if False Start is enabled. Thus +// it's recommended to use this callback over calling |SSL_get_session| on +// handshake completion. +OPENSSL_EXPORT void SSL_CTX_sess_set_new_cb( + SSL_CTX *ctx, int (*new_session_cb)(SSL *ssl, SSL_SESSION *session)); + +// SSL_CTX_sess_get_new_cb returns the callback set by +// |SSL_CTX_sess_set_new_cb|. +OPENSSL_EXPORT int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))( + SSL *ssl, SSL_SESSION *session); + +// SSL_CTX_sess_set_remove_cb sets a callback which is called when a session is +// removed from the internal session cache. +// +// TODO(davidben): What is the point of this callback? It seems useless since it +// only fires on sessions in the internal cache. +OPENSSL_EXPORT void SSL_CTX_sess_set_remove_cb( + SSL_CTX *ctx, + void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *session)); + +// SSL_CTX_sess_get_remove_cb returns the callback set by +// |SSL_CTX_sess_set_remove_cb|. +OPENSSL_EXPORT void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))( + SSL_CTX *ctx, SSL_SESSION *session); + +// SSL_CTX_sess_set_get_cb sets a callback to look up a session by ID for a +// server. The callback is passed the session ID and should return a matching +// |SSL_SESSION| or NULL if not found. It should set |*out_copy| to zero and +// return a new reference to the session. This callback is not used for a +// client. +// +// For historical reasons, if |*out_copy| is set to one (default), the SSL +// library will take a new reference to the returned |SSL_SESSION|, expecting +// the callback to return a non-owning pointer. This is not recommended. If +// |ctx| and thus the callback is used on multiple threads, the session may be +// removed and invalidated before the SSL library calls |SSL_SESSION_up_ref|, +// whereas the callback may synchronize internally. +// +// To look up a session asynchronously, the callback may return +// |SSL_magic_pending_session_ptr|. See the documentation for that function and +// |SSL_ERROR_PENDING_SESSION|. +// +// If the internal session cache is enabled, the callback is only consulted if +// the internal cache does not return a match. +OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( + SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *id, + int id_len, int *out_copy)); + +// SSL_CTX_sess_get_get_cb returns the callback set by +// |SSL_CTX_sess_set_get_cb|. +OPENSSL_EXPORT SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))( + SSL *ssl, const uint8_t *id, int id_len, int *out_copy); + +// SSL_magic_pending_session_ptr returns a magic |SSL_SESSION|* which indicates +// that the session isn't currently unavailable. |SSL_get_error| will then +// return |SSL_ERROR_PENDING_SESSION| and the handshake can be retried later +// when the lookup has completed. +OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); + + +// Session tickets. +// +// Session tickets, from RFC 5077, allow session resumption without server-side +// state. The server maintains a secret ticket key and sends the client opaque +// encrypted session parameters, called a ticket. When offering the session, the +// client sends the ticket which the server decrypts to recover session state. +// Session tickets are enabled by default but may be disabled with +// |SSL_OP_NO_TICKET|. +// +// 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| 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 +// encryption and authentication. +// 3) One can configure an |SSL_TICKET_AEAD_METHOD| to have more control +// and the option of asynchronous decryption. +// +// An attacker that compromises a server's session ticket key can impersonate +// the server and, prior to TLS 1.3, retroactively decrypt all application +// traffic from sessions using that ticket key. Thus ticket keys must be +// regularly rotated for forward secrecy. Note the default key is rotated +// automatically once every 48 hours but manually configured keys are not. + +// SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL is the interval with which the +// default session ticket encryption key is rotated, if in use. If any +// non-default ticket encryption mechanism is configured, automatic rotation is +// disabled. +#define SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL (2 * 24 * 60 * 60) + +// SSL_CTX_get_tlsext_ticket_keys writes |ctx|'s session ticket key material to +// |len| bytes of |out|. It returns one on success and zero if |len| is not +// 48. If |out| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, + size_t len); + +// SSL_CTX_set_tlsext_ticket_keys sets |ctx|'s session ticket key material to +// |len| bytes of |in|. It returns one on success and zero if |len| is not +// 48. If |in| is NULL, it returns 48 instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, + size_t len); + +// SSL_TICKET_KEY_NAME_LEN is the length of the key name prefix of a session +// ticket. +#define SSL_TICKET_KEY_NAME_LEN 16 + +// SSL_CTX_set_tlsext_ticket_key_cb sets the ticket callback to |callback| and +// returns one. |callback| will be called when encrypting a new ticket and when +// decrypting a ticket from the client. +// +// In both modes, |ctx| and |hmac_ctx| will already have been initialized with +// |EVP_CIPHER_CTX_init| and |HMAC_CTX_init|, respectively. |callback| +// configures |hmac_ctx| with an HMAC digest and key, and configures |ctx| +// for encryption or decryption, based on the mode. +// +// When encrypting a new ticket, |encrypt| will be one. It writes a public +// 16-byte key name to |key_name| and a fresh IV to |iv|. The output IV length +// must match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns 1 on success and -1 on error. +// +// When decrypting a ticket, |encrypt| will be zero. |key_name| will point to a +// 16-byte key name and |iv| points to an IV. The length of the IV consumed must +// match |EVP_CIPHER_CTX_iv_length| of the cipher selected. In this mode, +// |callback| returns -1 to abort the handshake, 0 if decrypting the ticket +// failed, and 1 or 2 on success. If it returns 2, the ticket will be renewed. +// This may be used to re-key the ticket. +// +// WARNING: |callback| wildly breaks the usual return value convention and is +// called in two different modes. +OPENSSL_EXPORT 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)); + +// 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 BORINGSSL_ENUM_INT { + // ssl_ticket_aead_success indicates that the ticket was successfully + // decrypted. + ssl_ticket_aead_success, + // ssl_ticket_aead_retry indicates that the operation could not be + // immediately completed and must be reattempted, via |open|, at a later + // point. + ssl_ticket_aead_retry, + // ssl_ticket_aead_ignore_ticket indicates that the ticket should be ignored + // (i.e. is corrupt or otherwise undecryptable). + ssl_ticket_aead_ignore_ticket, + // ssl_ticket_aead_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_ticket_aead_error, +}; + +// ssl_ticket_aead_method_st (aka |SSL_TICKET_AEAD_METHOD|) contains methods +// for encrypting and decrypting session tickets. +struct ssl_ticket_aead_method_st { + // max_overhead returns the maximum number of bytes of overhead that |seal| + // may add. + size_t (*max_overhead)(SSL *ssl); + + // seal encrypts and authenticates |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes to |out|, and puts the number of bytes written in + // |*out_len|. The |in| and |out| buffers may be equal but will not otherwise + // alias. It returns one on success or zero on error. + int (*seal)(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, + const uint8_t *in, size_t in_len); + + // open authenticates and decrypts |in_len| bytes from |in|, writes, at most, + // |max_out_len| bytes of plaintext to |out|, and puts the number of bytes + // written in |*out_len|. The |in| and |out| buffers may be equal but will + // not otherwise alias. See |ssl_ticket_aead_result_t| for details of the + // return values. In the case that a retry is indicated, the caller should + // arrange for the high-level operation on |ssl| to be retried when the + // operation is completed, which will result in another call to |open|. + enum ssl_ticket_aead_result_t (*open)(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out_len, const uint8_t *in, + size_t in_len); +}; + +// SSL_CTX_set_ticket_aead_method configures a custom ticket AEAD method table +// on |ctx|. |aead_method| must remain valid for the lifetime of |ctx|. +OPENSSL_EXPORT void SSL_CTX_set_ticket_aead_method( + SSL_CTX *ctx, const SSL_TICKET_AEAD_METHOD *aead_method); + + +// Elliptic curve Diffie-Hellman. +// +// Cipher suites using an ECDHE key exchange perform Diffie-Hellman over an +// elliptic curve negotiated by both endpoints. See RFC 4492. Only named curves +// are supported. ECDHE is always enabled, but the curve preferences may be +// configured with these functions. +// +// Note that TLS 1.3 renames these from curves to groups. For consistency, we +// currently use the TLS 1.2 name in the API. + +// SSL_CTX_set1_curves sets the preferred curves for |ctx| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, + size_t curves_len); + +// SSL_set1_curves sets the preferred curves for |ssl| to be |curves|. Each +// element of |curves| should be a curve nid. It returns one on success and +// zero on failure. +// +// Note that this API uses nid values from nid.h and not the |SSL_CURVE_*| +// values defined below. +OPENSSL_EXPORT int SSL_set1_curves(SSL *ssl, const int *curves, + size_t curves_len); + +// SSL_CTX_set1_curves_list sets the preferred curves for |ctx| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves); + +// SSL_set1_curves_list sets the preferred curves for |ssl| to be the +// colon-separated list |curves|. Each element of |curves| should be a curve +// name (e.g. P-256, X25519, ...). It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); + +// SSL_CURVE_* define TLS curve IDs. +#define SSL_CURVE_SECP224R1 21 +#define SSL_CURVE_SECP256R1 23 +#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. +// +// TODO(davidben): This API currently does not work correctly if there is a +// renegotiation in progress. Fix this. +OPENSSL_EXPORT uint16_t SSL_get_curve_id(const SSL *ssl); + +// SSL_get_curve_name returns a human-readable name for the curve specified by +// the given TLS curve id, or NULL if the curve is unknown. +OPENSSL_EXPORT const char *SSL_get_curve_name(uint16_t curve_id); + + +// Certificate verification. +// +// SSL may authenticate either endpoint with an X.509 certificate. Typically +// this is used to authenticate the server to the client. These functions +// configure certificate verification. +// +// WARNING: By default, certificate verification errors on a client are not +// fatal. See |SSL_VERIFY_NONE| This may be configured with +// |SSL_CTX_set_verify|. +// +// By default clients are anonymous but a server may request a certificate from +// the client by setting |SSL_VERIFY_PEER|. +// +// Many of these functions use OpenSSL's legacy X.509 stack which is +// underdocumented and deprecated, but the replacement isn't ready yet. For +// now, consumers may use the existing stack or bypass it by performing +// certificate verification externally. This may be done with +// |SSL_CTX_set_cert_verify_callback| or by extracting the chain with +// |SSL_get_peer_cert_chain| after the handshake. In the future, functions will +// be added to use the SSL stack without dependency on any part of the legacy +// X.509 and ASN.1 stack. +// +// To augment certificate verification, a client may also enable OCSP stapling +// (RFC 6066) and Certificate Transparency (RFC 6962) extensions. + +// SSL_VERIFY_NONE, on a client, verifies the server certificate but does not +// make errors fatal. The result may be checked with |SSL_get_verify_result|. On +// a server it does not request a client certificate. This is the default. +#define SSL_VERIFY_NONE 0x00 + +// SSL_VERIFY_PEER, on a client, makes server certificate errors fatal. On a +// server it requests a client certificate and makes errors fatal. However, +// anonymous clients are still allowed. See +// |SSL_VERIFY_FAIL_IF_NO_PEER_CERT|. +#define SSL_VERIFY_PEER 0x01 + +// SSL_VERIFY_FAIL_IF_NO_PEER_CERT configures a server to reject connections if +// the client declines to send a certificate. This flag must be used together +// with |SSL_VERIFY_PEER|, otherwise it won't work. +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 + +// SSL_VERIFY_PEER_IF_NO_OBC configures a server to request a client certificate +// if and only if Channel ID is not negotiated. +#define SSL_VERIFY_PEER_IF_NO_OBC 0x04 + +// SSL_CTX_set_verify configures certificate verification behavior. |mode| is +// one of the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is +// used to customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_verify( + SSL_CTX *ctx, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); + +// SSL_set_verify configures certificate verification behavior. |mode| is one of +// the |SSL_VERIFY_*| values defined above. |callback|, if not NULL, is used to +// customize certificate verification. See the behavior of +// |X509_STORE_CTX_set_verify_cb|. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| with +// |X509_STORE_CTX_get_ex_data| to look up the |SSL| from |store_ctx|. +OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, + int (*callback)(int ok, + X509_STORE_CTX *store_ctx)); + +enum ssl_verify_result_t BORINGSSL_ENUM_INT { + ssl_verify_ok, + ssl_verify_invalid, + ssl_verify_retry, +}; + +// SSL_CTX_set_custom_verify configures certificate verification. |mode| is one +// of the |SSL_VERIFY_*| values defined above. |callback| performs the +// certificate verification. +// +// The callback may call |SSL_get0_peer_certificates| for the certificate chain +// to validate. The callback should return |ssl_verify_ok| if the certificate is +// valid. If the certificate is invalid, the callback should return +// |ssl_verify_invalid| and optionally set |*out_alert| to an alert to send to +// the peer. Some useful alerts include |SSL_AD_CERTIFICATE_EXPIRED|, +// |SSL_AD_CERTIFICATE_REVOKED|, |SSL_AD_UNKNOWN_CA|, |SSL_AD_BAD_CERTIFICATE|, +// |SSL_AD_CERTIFICATE_UNKNOWN|, and |SSL_AD_INTERNAL_ERROR|. See RFC 5246 +// section 7.2.2 for their precise meanings. If unspecified, +// |SSL_AD_CERTIFICATE_UNKNOWN| will be sent by default. +// +// To verify a certificate asynchronously, the callback may return +// |ssl_verify_retry|. The handshake will then pause with |SSL_get_error| +// returning |SSL_ERROR_WANT_CERTIFICATE_VERIFY|. +OPENSSL_EXPORT void SSL_CTX_set_custom_verify( + SSL_CTX *ctx, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_set_custom_verify behaves like |SSL_CTX_set_custom_verify| but configures +// an individual |SSL|. +OPENSSL_EXPORT void SSL_set_custom_verify( + SSL *ssl, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)); + +// SSL_CTX_get_verify_mode returns |ctx|'s verify mode, set by +// |SSL_CTX_set_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|. 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 +// |SSL_CTX_set_verify|. +OPENSSL_EXPORT int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_get_verify_callback returns the callback set by |SSL_CTX_set_verify| or +// |SSL_set_verify|. +OPENSSL_EXPORT int (*SSL_get_verify_callback(const SSL *ssl))( + int ok, X509_STORE_CTX *store_ctx); + +// SSL_CTX_set_verify_depth sets the maximum depth of a certificate chain +// accepted in verification. This number does not include the leaf, so a depth +// of 1 allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); + +// SSL_set_verify_depth sets the maximum depth of a certificate chain accepted +// in verification. This number does not include the leaf, so a depth of 1 +// allows the leaf and one CA certificate. +OPENSSL_EXPORT void SSL_set_verify_depth(SSL *ssl, int depth); + +// SSL_CTX_get_verify_depth returns the maximum depth of a certificate accepted +// in verification. +OPENSSL_EXPORT int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); + +// SSL_get_verify_depth returns the maximum depth of a certificate accepted in +// verification. +OPENSSL_EXPORT int SSL_get_verify_depth(const SSL *ssl); + +// SSL_CTX_set1_param sets verification parameters from |param|. It returns one +// on success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_CTX_set1_param(SSL_CTX *ctx, + const X509_VERIFY_PARAM *param); + +// SSL_set1_param sets verification parameters from |param|. It returns one on +// success and zero on failure. The caller retains ownership of |param|. +OPENSSL_EXPORT int SSL_set1_param(SSL *ssl, + const X509_VERIFY_PARAM *param); + +// SSL_CTX_get0_param returns |ctx|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); + +// SSL_get0_param returns |ssl|'s |X509_VERIFY_PARAM| for certificate +// verification. The caller must not release the returned pointer but may call +// functions on it to configure it. +OPENSSL_EXPORT X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); + +// SSL_CTX_set_purpose sets |ctx|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose); + +// SSL_set_purpose sets |ssl|'s |X509_VERIFY_PARAM|'s 'purpose' parameter to +// |purpose|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_purpose(SSL *ssl, int purpose); + +// SSL_CTX_set_trust sets |ctx|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_trust(SSL_CTX *ctx, int trust); + +// SSL_set_trust sets |ssl|'s |X509_VERIFY_PARAM|'s 'trust' parameter to +// |trust|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_trust(SSL *ssl, int trust); + +// SSL_CTX_set_cert_store sets |ctx|'s certificate store to |store|. It takes +// ownership of |store|. The store is used for certificate verification. +// +// The store is also used for the auto-chaining feature, but this is deprecated. +// See also |SSL_MODE_NO_AUTO_CHAIN|. +OPENSSL_EXPORT void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); + +// SSL_CTX_get_cert_store returns |ctx|'s certificate store. +OPENSSL_EXPORT X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); + +// SSL_CTX_set_default_verify_paths loads the OpenSSL system-default trust +// anchors into |ctx|'s store. It returns one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); + +// SSL_CTX_load_verify_locations loads trust anchors into |ctx|'s store from +// |ca_file| and |ca_dir|, either of which may be NULL. If |ca_file| is passed, +// it is opened and PEM-encoded CA certificates are read. If |ca_dir| is passed, +// it is treated as a directory in OpenSSL's hashed directory format. It returns +// one on success and zero on failure. +// +// See +// https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html +// for documentation on the directory format. +OPENSSL_EXPORT int SSL_CTX_load_verify_locations(SSL_CTX *ctx, + const char *ca_file, + const char *ca_dir); + +// SSL_get_verify_result returns the result of certificate verification. It is +// either |X509_V_OK| or a |X509_V_ERR_*| value. +OPENSSL_EXPORT long SSL_get_verify_result(const SSL *ssl); + +// SSL_alert_from_verify_result returns the SSL alert code, such as +// |SSL_AD_CERTIFICATE_EXPIRED|, that corresponds to an |X509_V_ERR_*| value. +// The return value is always an alert, even when |result| is |X509_V_OK|. +OPENSSL_EXPORT int SSL_alert_from_verify_result(long result); + +// SSL_get_ex_data_X509_STORE_CTX_idx returns the ex_data index used to look up +// the |SSL| associated with an |X509_STORE_CTX| in the verify callback. +OPENSSL_EXPORT int SSL_get_ex_data_X509_STORE_CTX_idx(void); + +// SSL_CTX_set_cert_verify_callback sets a custom callback to be called on +// certificate verification rather than |X509_verify_cert|. |store_ctx| contains +// the verification parameters. The callback should return one on success and +// zero on fatal error. It may use |X509_STORE_CTX_set_error| to set a +// verification result. +// +// The callback may use |SSL_get_ex_data_X509_STORE_CTX_idx| to recover the +// |SSL| object from |store_ctx|. +OPENSSL_EXPORT void SSL_CTX_set_cert_verify_callback( + SSL_CTX *ctx, int (*callback)(X509_STORE_CTX *store_ctx, void *arg), + void *arg); + +// SSL_enable_signed_cert_timestamps causes |ssl| (which must be the client end +// of a connection) to request SCTs from the server. See +// https://tools.ietf.org/html/rfc6962. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_enable_signed_cert_timestamps(SSL *ssl); + +// SSL_CTX_enable_signed_cert_timestamps enables SCT requests on all client SSL +// objects created from |ctx|. +// +// Call |SSL_get0_signed_cert_timestamp_list| to recover the SCT after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx); + +// SSL_enable_ocsp_stapling causes |ssl| (which must be the client end of a +// connection) to request a stapled OCSP response from the server. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_enable_ocsp_stapling(SSL *ssl); + +// SSL_CTX_enable_ocsp_stapling enables OCSP stapling on all client SSL objects +// created from |ctx|. +// +// Call |SSL_get0_ocsp_response| to recover the OCSP response after the +// handshake. +OPENSSL_EXPORT void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx); + +// SSL_CTX_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL_CTX|. +OPENSSL_EXPORT int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_CTX_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +OPENSSL_EXPORT int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, + X509_STORE *store); + +// SSL_set0_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. Ownership of +// |store| is transferred to the |SSL|. +OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); + +// SSL_set1_verify_cert_store sets an |X509_STORE| that will be used +// exclusively for certificate verification and returns one. An additional +// reference to |store| will be taken. +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. 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 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|. +OPENSSL_EXPORT int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, + const uint16_t *prefs, + size_t num_prefs); + + +// Client certificate CA list. +// +// When requesting a client certificate, a server may advertise a list of +// certificate authorities which are accepted. These functions may be used to +// configure this list. + +// SSL_set_client_CA_list sets |ssl|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_set_client_CA_list(SSL *ssl, + STACK_OF(X509_NAME) *name_list); + +// SSL_CTX_set_client_CA_list sets |ctx|'s client certificate CA list to +// |name_list|. It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, + STACK_OF(X509_NAME) *name_list); + +// SSL_set0_client_CAs sets |ssl|'s client certificate CA list to |name_list|, +// which should contain DER-encoded distinguished names (RFC 5280). It takes +// ownership of |name_list|. +OPENSSL_EXPORT void SSL_set0_client_CAs(SSL *ssl, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_CTX_set0_client_CAs sets |ctx|'s client certificate CA list to +// |name_list|, which should contain DER-encoded distinguished names (RFC 5280). +// It takes ownership of |name_list|. +OPENSSL_EXPORT void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, + STACK_OF(CRYPTO_BUFFER) *name_list); + +// SSL_get_client_CA_list returns |ssl|'s client certificate CA list. If |ssl| +// has not been configured as a client, this is the list configured by +// |SSL_CTX_set_client_CA_list|. +// +// If configured as a client, it returns the client certificate CA list sent by +// the server. In this mode, the behavior is undefined except 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. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); + +// SSL_get0_server_requested_CAs returns the CAs sent by a server to guide a +// client in certificate selection. They are a series of DER-encoded X.509 +// names. This function may only be called during a callback set by +// |SSL_CTX_set_cert_cb| or when the handshake is paused because of it. +// +// 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 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) * + SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); + +// SSL_add_client_CA appends |x509|'s subject to the client certificate CA list. +// It returns one on success or zero on error. The caller retains ownership of +// |x509|. +OPENSSL_EXPORT int SSL_add_client_CA(SSL *ssl, X509 *x509); + +// SSL_CTX_add_client_CA appends |x509|'s subject to the client certificate CA +// list. It returns one on success or zero on error. The caller retains +// ownership of |x509|. +OPENSSL_EXPORT int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509); + +// SSL_load_client_CA_file opens |file| and reads PEM-encoded certificates from +// it. It returns a newly-allocated stack of the certificate subjects or NULL +// on error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); + +// SSL_dup_CA_list makes a deep copy of |list|. It returns the new list on +// success or NULL on allocation error. +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *list); + +// SSL_add_file_cert_subjects_to_stack behaves like |SSL_load_client_CA_file| +// but appends the result to |out|. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *file); + + +// Server name indication. +// +// The server_name extension (RFC 3546) allows the client to advertise the name +// of the server it is connecting to. This is used in virtual hosting +// deployments to select one of a several certificates on a single IP. Only the +// host_name name type is supported. + +#define TLSEXT_NAMETYPE_host_name 0 + +// SSL_set_tlsext_host_name, for a client, configures |ssl| to advertise |name| +// in the server_name extension. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_tlsext_host_name(SSL *ssl, const char *name); + +// SSL_get_servername, for a server, returns the hostname supplied by the +// client or NULL if there was none. The |type| argument must be +// |TLSEXT_NAMETYPE_host_name|. +OPENSSL_EXPORT const char *SSL_get_servername(const SSL *ssl, const int type); + +// SSL_get_servername_type, for a server, returns |TLSEXT_NAMETYPE_host_name| +// if the client sent a hostname and -1 otherwise. +OPENSSL_EXPORT int SSL_get_servername_type(const SSL *ssl); + +// SSL_CTX_set_tlsext_servername_callback configures |callback| to be called on +// the server after ClientHello extensions have been parsed and returns one. +// The callback may use |SSL_get_servername| to examine the server_name +// extension and returns a |SSL_TLSEXT_ERR_*| value. The value of |arg| may be +// set by calling |SSL_CTX_set_tlsext_servername_arg|. +// +// If the callback returns |SSL_TLSEXT_ERR_NOACK|, the server_name extension is +// not acknowledged in the ServerHello. If the return value is +// |SSL_TLSEXT_ERR_ALERT_FATAL|, then |*out_alert| is the alert to send, +// defaulting to |SSL_AD_UNRECOGNIZED_NAME|. |SSL_TLSEXT_ERR_ALERT_WARNING| is +// ignored and treated as |SSL_TLSEXT_ERR_OK|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_callback( + SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)); + +// SSL_CTX_set_tlsext_servername_arg sets the argument to the servername +// callback and returns one. See |SSL_CTX_set_tlsext_servername_callback|. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg); + +// SSL_TLSEXT_ERR_* are values returned by some extension-related callbacks. +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +// SSL_set_SSL_CTX changes |ssl|'s |SSL_CTX|. |ssl| will use the +// certificate-related settings from |ctx|, and |SSL_get_SSL_CTX| will report +// |ctx|. This function may be used during the callbacks registered by +// |SSL_CTX_set_select_certificate_cb|, +// |SSL_CTX_set_tlsext_servername_callback|, and |SSL_CTX_set_cert_cb| or when +// the handshake is paused from them. It is typically used to switch +// certificates based on SNI. +// +// Note the session cache and related settings will continue to use the initial +// |SSL_CTX|. Callers should use |SSL_CTX_set_session_id_context| to partition +// the session cache between different domains. +// +// TODO(davidben): Should other settings change after this call? +OPENSSL_EXPORT SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx); + + +// Application-layer protocol negotiation. +// +// The ALPN extension (RFC 7301) allows negotiating different application-layer +// protocols over a single port. This is used, for example, to negotiate +// HTTP/2. + +// SSL_CTX_set_alpn_protos sets the client ALPN protocol list on |ctx| to +// |protos|. |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, + unsigned protos_len); + +// SSL_set_alpn_protos sets the client ALPN protocol list on |ssl| to |protos|. +// |protos| must be in wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings). It returns zero on success and one on failure. +// Configuring this list enables ALPN on a client. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. +OPENSSL_EXPORT int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, + unsigned protos_len); + +// SSL_CTX_set_alpn_select_cb sets a callback function on |ctx| that is called +// during ClientHello processing in order to select an ALPN protocol from the +// client's list of offered protocols. Configuring this callback enables ALPN on +// a server. +// +// The callback is passed a wire-format (i.e. a series of non-empty, 8-bit +// length-prefixed strings) ALPN protocol list in |in|. It should set |*out| and +// |*out_len| to the selected protocol and return |SSL_TLSEXT_ERR_OK| on +// success. It does not pass ownership of the buffer. Otherwise, it should +// return |SSL_TLSEXT_ERR_NOACK|. Other |SSL_TLSEXT_ERR_*| values are +// unimplemented and will be treated as |SSL_TLSEXT_ERR_NOACK|. +// +// The cipher suite is selected before negotiating ALPN. The callback may use +// |SSL_get_pending_cipher| to query the cipher suite. +OPENSSL_EXPORT 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); + +// SSL_get0_alpn_selected gets the selected ALPN protocol (if any) from |ssl|. +// On return it sets |*out_data| to point to |*out_len| bytes of protocol name +// (not including the leading length-prefix byte). If the server didn't respond +// with a negotiated protocol then |*out_len| will be zero. +OPENSSL_EXPORT void SSL_get0_alpn_selected(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_CTX_set_allow_unknown_alpn_protos configures client connections on |ctx| +// to allow unknown ALPN protocols from the server. Otherwise, by default, the +// client will require that the protocol be advertised in +// |SSL_CTX_set_alpn_protos|. +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 +// and deprecated in favor of it. + +// SSL_CTX_set_next_protos_advertised_cb sets a callback that is called when a +// TLS server needs a list of supported protocols for Next Protocol +// Negotiation. The returned list must be in wire format. The list is returned +// by setting |*out| to point to it and |*out_len| to its length. This memory +// will not be modified, but one should assume that |ssl| keeps a reference to +// it. +// +// The callback should return |SSL_TLSEXT_ERR_OK| if it wishes to advertise. +// Otherwise, no such extension will be included in the ServerHello. +OPENSSL_EXPORT 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); + +// SSL_CTX_set_next_proto_select_cb sets a callback that is called when a client +// needs to select a protocol from the server's provided list. |*out| must be +// set to point to the selected protocol (which may be within |in|). The length +// of the protocol name must be written into |*out_len|. The server's advertised +// protocols are provided in |in| and |in_len|. The callback can assume that +// |in| is syntactically valid. +// +// The client must select a protocol. It is fatal to the connection if this +// callback returns a value other than |SSL_TLSEXT_ERR_OK|. +// +// Configuring this callback enables NPN on a client. +OPENSSL_EXPORT 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); + +// SSL_get0_next_proto_negotiated sets |*out_data| and |*out_len| to point to +// the client's requested protocol for this connection. If the client didn't +// request any protocol, then |*out_data| is set to NULL. +// +// Note that the client can request any protocol it chooses. The value returned +// from this function need not be a member of the list of supported protocols +// provided by the server. +OPENSSL_EXPORT void SSL_get0_next_proto_negotiated(const SSL *ssl, + const uint8_t **out_data, + unsigned *out_len); + +// SSL_select_next_proto implements the standard protocol selection. It is +// expected that this function is called from the callback set by +// |SSL_CTX_set_next_proto_select_cb|. +// +// |peer| and |supported| must be vectors of 8-bit, length-prefixed byte strings +// containing the peer and locally-configured protocols, respectively. The +// length byte itself is not included in the length. A byte string of length 0 +// is invalid. No byte string may be truncated. |supported| is assumed to be +// non-empty. +// +// This function finds the first protocol in |peer| which is also in +// |supported|. If one was found, it sets |*out| and |*out_len| to point to it +// and returns |OPENSSL_NPN_NEGOTIATED|. Otherwise, it returns +// |OPENSSL_NPN_NO_OVERLAP| and sets |*out| and |*out_len| to the first +// supported protocol. +OPENSSL_EXPORT 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); + +#define OPENSSL_NPN_UNSUPPORTED 0 +#define OPENSSL_NPN_NEGOTIATED 1 +#define OPENSSL_NPN_NO_OVERLAP 2 + + +// Channel ID. +// +// See draft-balfanz-tls-channelid-01. + +// SSL_CTX_set_tls_channel_id_enabled configures whether connections associated +// with |ctx| should enable Channel ID. +OPENSSL_EXPORT void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, + int enabled); + +// SSL_set_tls_channel_id_enabled configures whether |ssl| should enable Channel +// ID. +OPENSSL_EXPORT void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled); + +// SSL_CTX_set1_tls_channel_id configures a TLS client to send a TLS Channel ID +// to compatible servers. |private_key| must be a P-256 EC key. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, + EVP_PKEY *private_key); + +// SSL_set1_tls_channel_id configures a TLS client to send a TLS Channel ID to +// compatible servers. |private_key| must be a P-256 EC key. It returns one on +// success and zero on error. +OPENSSL_EXPORT int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key); + +// SSL_get_tls_channel_id gets the client's TLS Channel ID from a server |SSL*| +// and copies up to the first |max_out| bytes into |out|. The Channel ID +// consists of the client's P-256 public key as an (x,y) pair where each is a +// 32-byte, big-endian field element. It returns 0 if the client didn't offer a +// Channel ID and the length of the complete Channel ID otherwise. +OPENSSL_EXPORT size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_CTX_set_channel_id_cb sets a callback to be called when a TLS Channel ID +// is requested. The callback may set |*out_pkey| to a key, passing a reference +// to the caller. If none is returned, the handshake will pause and +// |SSL_get_error| will return |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +// +// See also |SSL_ERROR_WANT_CHANNEL_ID_LOOKUP|. +OPENSSL_EXPORT void SSL_CTX_set_channel_id_cb( + SSL_CTX *ctx, void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey)); + +// SSL_CTX_get_channel_id_cb returns the callback set by +// |SSL_CTX_set_channel_id_cb|. +OPENSSL_EXPORT void (*SSL_CTX_get_channel_id_cb(SSL_CTX *ctx))( + SSL *ssl, EVP_PKEY **out_pkey); + + +// Token Binding. +// +// See draft-ietf-tokbind-protocol-16. + +// SSL_set_token_binding_params sets |params| as the Token Binding Key +// parameters (section 3 of draft-ietf-tokbind-protocol-16) to negotiate on the +// connection. If this function is not called, or if |len| is 0, then this +// endpoint will not attempt to negotiate Token Binding. |params| are provided +// in preference order, with the more preferred parameters at the beginning of +// the list. This function returns 1 on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, + size_t len); + +// SSL_is_token_binding_negotiated returns 1 if Token Binding was negotiated +// on this connection and 0 otherwise. On a server, it is possible for this +// function to return 1 when the client's view of the connection is that Token +// Binding was not negotiated. This occurs when the server indicates a version +// of Token Binding less than the client's minimum version. +OPENSSL_EXPORT int SSL_is_token_binding_negotiated(const SSL *ssl); + +// SSL_get_negotiated_token_binding_param returns the TokenBindingKeyParameters +// enum value that was negotiated. It is only valid to call this function if +// SSL_is_token_binding_negotiated returned 1, otherwise this function returns +// an undefined value. +OPENSSL_EXPORT uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl); + + +// DTLS-SRTP. +// +// See RFC 5764. + +// srtp_protection_profile_st (aka |SRTP_PROTECTION_PROFILE|) is an SRTP +// profile for use with the use_srtp extension. +struct srtp_protection_profile_st { + const char *name; + unsigned long id; +} /* SRTP_PROTECTION_PROFILE */; + +DEFINE_CONST_STACK_OF(SRTP_PROTECTION_PROFILE) + +// SRTP_* define constants for SRTP profiles. +#define SRTP_AES128_CM_SHA1_80 0x0001 +#define SRTP_AES128_CM_SHA1_32 0x0002 +#define SRTP_AES128_F8_SHA1_80 0x0003 +#define SRTP_AES128_F8_SHA1_32 0x0004 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 + +// SSL_CTX_set_srtp_profiles enables SRTP for all SSL objects created from +// |ctx|. |profile| contains a colon-separated list of profile names. It returns +// one on success and zero on failure. +OPENSSL_EXPORT int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_srtp_profiles enables SRTP for |ssl|. |profile| contains a +// colon-separated list of profile names. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int SSL_set_srtp_profiles(SSL *ssl, const char *profiles); + +// SSL_get_srtp_profiles returns the SRTP profiles supported by |ssl|. +OPENSSL_EXPORT STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles( + SSL *ssl); + +// SSL_get_selected_srtp_profile returns the selected SRTP profile, or NULL if +// SRTP was not negotiated. +OPENSSL_EXPORT const SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile( + SSL *ssl); + + +// Pre-shared keys. +// +// Connections may be configured with PSK (Pre-Shared Key) cipher suites. These +// authenticate using out-of-band pre-shared keys rather than certificates. See +// RFC 4279. +// +// This implementation uses NUL-terminated C strings for identities and identity +// hints, so values with a NUL character are not supported. (RFC 4279 does not +// specify the format of an identity.) + +// PSK_MAX_IDENTITY_LEN is the maximum supported length of a PSK identity, +// excluding the NUL terminator. +#define PSK_MAX_IDENTITY_LEN 128 + +// PSK_MAX_PSK_LEN is the maximum supported length of a pre-shared key. +#define PSK_MAX_PSK_LEN 256 + +// SSL_CTX_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. +// +// The callback is passed the identity hint in |hint| or NULL if none was +// provided. It should select a PSK identity and write the identity and the +// corresponding PSK to |identity| and |psk|, respectively. The identity is +// written as a NUL-terminated C string of length (excluding the NUL terminator) +// at most |max_identity_len|. The PSK's length must be at most |max_psk_len|. +// The callback returns the length of the PSK or 0 if no suitable identity was +// found. +OPENSSL_EXPORT 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)); + +// SSL_set_psk_client_callback sets the callback to be called when PSK is +// negotiated on the client. This callback must be set to enable PSK cipher +// suites on the client. See also |SSL_CTX_set_psk_client_callback|. +OPENSSL_EXPORT 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_CTX_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. +// +// The callback is passed the identity in |identity|. It should write a PSK of +// length at most |max_psk_len| to |psk| and return the number of bytes written +// or zero if the PSK identity is unknown. +OPENSSL_EXPORT void SSL_CTX_set_psk_server_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_set_psk_server_callback sets the callback to be called when PSK is +// negotiated on the server. This callback must be set to enable PSK cipher +// suites on the server. See also |SSL_CTX_set_psk_server_callback|. +OPENSSL_EXPORT void SSL_set_psk_server_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)); + +// SSL_CTX_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, + const char *identity_hint); + +// SSL_use_psk_identity_hint configures server connections to advertise an +// identity hint of |identity_hint|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int SSL_use_psk_identity_hint(SSL *ssl, + const char *identity_hint); + +// SSL_get_psk_identity_hint returns the PSK identity hint advertised for |ssl| +// or NULL if there is none. +OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); + +// SSL_get_psk_identity, after the handshake completes, returns the PSK identity +// that was negotiated by |ssl| or NULL if PSK was not used. +OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); + + +// 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 +// transport parameters. draft-ietf-quic-transport (section 7.4) defines the +// contents of that extension (a TransportParameters struct) and describes how +// to handle it and its semantic meaning. +// +// BoringSSL handles this extension as an opaque byte string. The caller is +// responsible for serializing and parsing it. + +// SSL_set_quic_transport_params configures |ssl| to send |params| (of length +// |params_len|) in the quic_transport_parameters extension in either the +// ClientHello or EncryptedExtensions handshake message. This extension will +// only be sent if the TLS version is at least 1.3, and for a server, only if +// the client sent the extension. The buffer pointed to by |params| only need be +// valid for the duration of the call to this function. This function returns 1 +// on success and 0 on failure. +OPENSSL_EXPORT int SSL_set_quic_transport_params(SSL *ssl, + const uint8_t *params, + size_t params_len); + +// SSL_get_peer_quic_transport_params provides the caller with the value of the +// quic_transport_parameters extension sent by the peer. A pointer to the buffer +// containing the TransportParameters will be put in |*out_params|, and its +// length in |*params_len|. This buffer will be valid for the lifetime of the +// |SSL|. If no params were received from the peer, |*out_params_len| will be 0. +OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + 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 +// implemented. It may cause interoperability or security failures when used. +// +// Early data, or 0-RTT, is a feature in TLS 1.3 which allows clients to send +// data on the first flight during a resumption handshake. This can save a +// round-trip in some application protocols. +// +// 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 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 +// be used to send half-RTT data. |SSL_read| will consume early data and +// transition to 1-RTT data as appropriate. Prior to the transition, +// |SSL_in_init| will report the handshake is still in progress. Callers may use +// it or |SSL_in_early_data| to defer or reject requests as needed. +// +// Early data as a client is more complex. If the offered session (see +// |SSL_set_session|) is 0-RTT-capable, the handshake will return after sending +// the ClientHello. The predicted peer certificates and ALPN protocol will be +// available via the usual APIs. |SSL_write| will write early data, up to the +// session's limit. Writes past this limit and |SSL_read| will complete the +// handshake before continuing. Callers may also call |SSL_do_handshake| again +// to complete the handshake sooner. +// +// If the server accepts early data, the handshake will succeed. |SSL_read| and +// |SSL_write| will then act as in a 1-RTT handshake. The peer certificates and +// ALPN protocol will be as predicted and need not be re-queried. +// +// If the server rejects early data, |SSL_do_handshake| (and thus |SSL_read| and +// |SSL_write|) will then fail with |SSL_get_error| returning +// |SSL_ERROR_EARLY_DATA_REJECTED|. The caller should treat this as a connection +// error and most likely perform a high-level retry. Note the server may still +// have processed the early data due to attacker replays. +// +// To then continue the handshake on the original connection, use +// |SSL_reset_early_data_reject|. The connection will then behave as one which +// had not yet completed the handshake. This allows a faster retry than making a +// fresh connection. |SSL_do_handshake| will complete the full handshake, +// possibly resulting in different peer certificates, ALPN protocol, and other +// properties. The caller must disregard any values from before the reset and +// query again. +// +// 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|. +OPENSSL_EXPORT void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled); + +// SSL_set_early_data_enabled sets whether early data is allowed to be used +// with resumptions using |ssl|. See |SSL_CTX_set_early_data_enabled| for more +// information. +OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); + +// SSL_in_early_data returns one if |ssl| has a pending handshake that has +// progressed enough to send or receive early data. Clients may call |SSL_write| +// to send early data, but |SSL_read| will complete the handshake before +// accepting application data. Servers may call |SSL_read| to read early data +// 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); + +// SSL_reset_early_data_reject resets |ssl| after an early data reject. All +// 0-RTT state is discarded, including any pending |SSL_write| calls. The caller +// should treat |ssl| as a logically fresh connection, usually by driving the +// handshake to completion using |SSL_do_handshake|. +// +// It is an error to call this function on an |SSL| object that is not signaling +// |SSL_ERROR_EARLY_DATA_REJECTED|. +OPENSSL_EXPORT void SSL_reset_early_data_reject(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); + +// 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 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 +// value corresponds to an alert description. Consumers may add or subtract +// |SSL_AD_REASON_OFFSET| to convert between them. +// +// make_errors.go reserves error codes above 1000 for manually-assigned errors. +// This value must be kept in sync with reservedReasonCode in make_errors.h +#define SSL_AD_REASON_OFFSET 1000 + +// 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 +#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED +#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 // 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 +#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED +#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN +#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER +#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA +#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED +#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR +#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR +#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION +#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION +#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY +#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR +#define SSL_AD_INAPPROPRIATE_FALLBACK SSL3_AD_INAPPROPRIATE_FALLBACK +#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED +#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION +#define SSL_AD_MISSING_EXTENSION TLS1_AD_MISSING_EXTENSION +#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION +#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE +#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE \ + TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE +#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE +#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY +#define SSL_AD_CERTIFICATE_REQUIRED TLS1_AD_CERTIFICATE_REQUIRED + +// SSL_alert_type_string_long returns a string description of |value| as an +// alert type (warning or fatal). +OPENSSL_EXPORT const char *SSL_alert_type_string_long(int value); + +// SSL_alert_desc_string_long returns a string description of |value| as an +// alert description or "unknown" if unknown. +OPENSSL_EXPORT const char *SSL_alert_desc_string_long(int value); + +// SSL_send_fatal_alert sends a fatal alert over |ssl| of the specified type, +// which should be one of the |SSL_AD_*| constants. It returns one on success +// and <= 0 on error. The caller should pass the return value into +// |SSL_get_error| to determine how to proceed. Once this function has been +// called, future calls to |SSL_write| will fail. +// +// If retrying a failed operation due to |SSL_ERROR_WANT_WRITE|, subsequent +// calls must use the same |alert| parameter. +OPENSSL_EXPORT int SSL_send_fatal_alert(SSL *ssl, uint8_t alert); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int SSL_set_ex_data(SSL *ssl, int idx, void *data); +OPENSSL_EXPORT void *SSL_get_ex_data(const SSL *ssl, int idx); +OPENSSL_EXPORT int SSL_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 SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, + void *data); +OPENSSL_EXPORT void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, + int idx); +OPENSSL_EXPORT int SSL_SESSION_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 SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data); +OPENSSL_EXPORT void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); +OPENSSL_EXPORT 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); + + +// Low-level record-layer state. + +// 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 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, + const uint8_t **out_write_iv, + size_t *out_iv_len); + +// SSL_get_key_block_len returns the length of |ssl|'s key block. +OPENSSL_EXPORT size_t SSL_get_key_block_len(const SSL *ssl); + +// SSL_generate_key_block generates |out_len| bytes of key material for |ssl|'s +// current connection state. +OPENSSL_EXPORT int SSL_generate_key_block(const SSL *ssl, uint8_t *out, + size_t out_len); + +// SSL_get_read_sequence returns, in TLS, the expected sequence number of the +// next incoming record in the current epoch. In DTLS, it returns the maximum +// sequence number received in the current epoch and includes the epoch number +// in the two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_read_sequence(const SSL *ssl); + +// SSL_get_write_sequence returns the sequence number of the next outgoing +// record in the current epoch. In DTLS, it includes the epoch number in the +// two most significant bytes. +OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); + + +// Obscure functions. + +// 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. +// |write_p| is one for outgoing messages and zero for incoming messages. +// +// For each record header, |cb| is called with |version| = 0 and |content_type| +// = |SSL3_RT_HEADER|. The |len| bytes from |buf| contain the header. Note that +// this does not include the record body. If the record is sealed, the length +// in the header is the length of the ciphertext. +// +// For each handshake message, ChangeCipherSpec, and alert, |version| is the +// protocol version and |content_type| is the corresponding record type. The +// |len| bytes from |buf| contain the handshake message, one-byte +// ChangeCipherSpec body, and two-byte alert, respectively. +// +// For a V2ClientHello, |version| is |SSL2_VERSION|, |content_type| is zero, and +// the |len| bytes from |buf| contain the V2ClientHello structure. +OPENSSL_EXPORT 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)); + +// SSL_CTX_set_msg_callback_arg sets the |arg| parameter of the message +// callback. +OPENSSL_EXPORT void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); + +// SSL_set_msg_callback installs |cb| as the message callback of |ssl|. See +// |SSL_CTX_set_msg_callback| for when this callback is called. +OPENSSL_EXPORT 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_set_msg_callback_arg sets the |arg| parameter of the message callback. +OPENSSL_EXPORT void SSL_set_msg_callback_arg(SSL *ssl, void *arg); + +// SSL_CTX_set_keylog_callback configures a callback to log key material. This +// is intended for debugging use with tools like Wireshark. The |cb| function +// should log |line| followed by a newline, synchronizing with any concurrent +// access to the log. +// +// The format is described in +// https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format. +OPENSSL_EXPORT void SSL_CTX_set_keylog_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, const char *line)); + +// SSL_CTX_get_keylog_callback returns the callback configured by +// |SSL_CTX_set_keylog_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( + const SSL *ssl, const char *line); + +// SSL_CTX_set_current_time_cb configures a callback to retrieve the current +// time, which should be set in |*out_clock|. This can be used for testing +// purposes; for example, a callback can be configured that returns a time +// set explicitly by the test. The |ssl| pointer passed to |cb| is always null. +OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); + +// 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 +// renegotiation attempts by a server. If |ssl| is a server, peer-initiated +// renegotiations are *always* rejected and this function does nothing. +// +// The renegotiation mode defaults to |ssl_renegotiate_never|, but may be set +// at any point in a connection's lifetime. Set it to |ssl_renegotiate_once| to +// allow one renegotiation, |ssl_renegotiate_freely| to allow all +// renegotiations or |ssl_renegotiate_ignore| to ignore HelloRequest messages. +// 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); + +// SSL_total_renegotiations returns the total number of renegotiation handshakes +// performed by |ssl|. This includes the pending renegotiation, if any. +OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); + +// 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) + +// SSL_CTX_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ctx|. +OPENSSL_EXPORT size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx); + +// SSL_CTX_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, + size_t max_cert_list); + +// SSL_get_max_cert_list returns the maximum length, in bytes, of a peer +// certificate chain accepted by |ssl|. +OPENSSL_EXPORT size_t SSL_get_max_cert_list(const SSL *ssl); + +// SSL_set_max_cert_list sets the maximum length, in bytes, of a peer +// certificate chain to |max_cert_list|. This affects how much memory may be +// consumed during the handshake. +OPENSSL_EXPORT void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list); + +// SSL_CTX_set_max_send_fragment sets the maximum length, in bytes, of records +// sent by |ctx|. Beyond this length, handshake messages and application data +// will be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, + size_t max_send_fragment); + +// SSL_set_max_send_fragment sets the maximum length, in bytes, of records sent +// by |ssl|. Beyond this length, handshake messages and application data will +// be split into multiple records. It returns one on success or zero on +// error. +OPENSSL_EXPORT int SSL_set_max_send_fragment(SSL *ssl, + size_t max_send_fragment); + +// ssl_early_callback_ctx (aka |SSL_CLIENT_HELLO|) is passed to certain +// callbacks that are called very early on during the server handshake. At this +// point, much of the SSL* hasn't been filled out and only the ClientHello can +// be depended on. +typedef struct ssl_early_callback_ctx { + SSL *ssl; + const uint8_t *client_hello; + size_t client_hello_len; + uint16_t version; + const uint8_t *random; + size_t random_len; + const uint8_t *session_id; + size_t session_id_len; + const uint8_t *cipher_suites; + size_t cipher_suites_len; + const uint8_t *compression_methods; + size_t compression_methods_len; + const uint8_t *extensions; + size_t extensions_len; +} SSL_CLIENT_HELLO; + +// ssl_select_cert_result_t enumerates the possible results from selecting a +// certificate with |select_certificate_cb|. +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, + // ssl_select_cert_retry indicates that the operation could not be + // immediately completed and must be reattempted at a later point. + ssl_select_cert_retry = 0, + // ssl_select_cert_error indicates that a fatal error occured and the + // handshake should be terminated. + ssl_select_cert_error = -1, +}; + +// SSL_early_callback_ctx_extension_get searches the extensions in +// |client_hello| for an extension of the given type. If not found, it returns +// zero. Otherwise it sets |out_data| to point to the extension contents (not +// including the type and length bytes), sets |out_len| to the length of the +// extension contents and returns one. +OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( + const SSL_CLIENT_HELLO *client_hello, uint16_t extension_type, + const uint8_t **out_data, size_t *out_len); + +// SSL_CTX_set_select_certificate_cb sets a callback that is called before most +// ClientHello processing and before the decision whether to resume a session +// is made. The callback may inspect the ClientHello and configure the +// connection. See |ssl_select_cert_result_t| for details of the return values. +// +// In the case that a retry is indicated, |SSL_get_error| will return +// |SSL_ERROR_PENDING_CERTIFICATE| and the caller should arrange for the +// 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( + SSL_CTX *ctx, + enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)); + +// SSL_CTX_set_dos_protection_cb sets a callback that is called once the +// resumption decision for a ClientHello has been made. It can return one to +// allow the handshake to continue or zero to cause the handshake to abort. +OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( + SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); + +// 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. +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 +#define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +// SSL_CTX_set_info_callback configures a callback to be run when various +// events occur during a connection's lifetime. The |type| argument determines +// the type of event and the meaning of the |value| argument. Callbacks must +// ignore unexpected |type| values. +// +// |SSL_CB_READ_ALERT| is signaled for each alert received, warning or fatal. +// The |value| argument is a 16-bit value where the alert level (either +// |SSL3_AL_WARNING| or |SSL3_AL_FATAL|) is in the most-significant eight bits +// and the alert type (one of |SSL_AD_*|) is in the least-significant eight. +// +// |SSL_CB_WRITE_ALERT| is signaled for each alert sent. The |value| argument +// is constructed as with |SSL_CB_READ_ALERT|. +// +// |SSL_CB_HANDSHAKE_START| is signaled when a handshake begins. The |value| +// argument is always one. +// +// |SSL_CB_HANDSHAKE_DONE| is signaled when a handshake completes successfully. +// The |value| argument is always one. If a handshake False Starts, this event +// may be used to determine when the Finished message is received. +// +// The following event types expose implementation details of the handshake +// state machine. Consuming them is deprecated. +// +// |SSL_CB_ACCEPT_LOOP| (respectively, |SSL_CB_CONNECT_LOOP|) is signaled when +// a server (respectively, client) handshake progresses. The |value| argument +// is always one. +// +// |SSL_CB_ACCEPT_EXIT| (respectively, |SSL_CB_CONNECT_EXIT|) is signaled when +// a server (respectively, client) handshake completes, fails, or is paused. +// The |value| argument is one if the handshake succeeded and <= 0 +// otherwise. +OPENSSL_EXPORT void SSL_CTX_set_info_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_CTX_get_info_callback returns the callback set by +// |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, + int type, + int value); + +// SSL_set_info_callback configures a callback to be run at various events +// during a connection's lifetime. See |SSL_CTX_set_info_callback|. +OPENSSL_EXPORT void SSL_set_info_callback( + SSL *ssl, void (*cb)(const SSL *ssl, int type, int value)); + +// SSL_get_info_callback returns the callback set by |SSL_set_info_callback|. +OPENSSL_EXPORT void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, + int type, + int value); + +// SSL_state_string_long returns the current state of the handshake state +// machine as a string. This may be useful for debugging and logging. +OPENSSL_EXPORT const char *SSL_state_string_long(const SSL *ssl); + +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + +// SSL_get_shutdown returns a bitmask with a subset of |SSL_SENT_SHUTDOWN| and +// |SSL_RECEIVED_SHUTDOWN| to query whether close_notify was sent or received, +// respectively. +OPENSSL_EXPORT int SSL_get_shutdown(const SSL *ssl); + +// SSL_get_peer_signature_algorithm returns the signature algorithm used by the +// peer. If not applicable, it returns zero. +OPENSSL_EXPORT uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl); + +// SSL_get_client_random writes up to |max_out| bytes of the most recent +// handshake's client_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the client_random. +OPENSSL_EXPORT size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_server_random writes up to |max_out| bytes of the most recent +// handshake's server_random to |out| and returns the number of bytes written. +// If |max_out| is zero, it returns the size of the server_random. +OPENSSL_EXPORT size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, + size_t max_out); + +// SSL_get_pending_cipher returns the cipher suite for the current handshake or +// NULL if one has not been negotiated yet or there is no pending handshake. +OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); + +// SSL_set_retain_only_sha256_of_client_certs, on a server, sets whether 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 |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); + +// SSL_CTX_set_retain_only_sha256_of_client_certs, on a server, sets whether +// 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 |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); + +// SSL_CTX_set_grease_enabled configures whether sockets on |ctx| should enable +// GREASE. See draft-davidben-tls-grease-01. +OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); + +// SSL_max_seal_overhead returns the maximum overhead, in bytes, of sealing a +// record with |ssl|. +OPENSSL_EXPORT size_t SSL_max_seal_overhead(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_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. + +// SSL_library_init calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int SSL_library_init(void); + +// SSL_CIPHER_description writes a description of |cipher| into |buf| and +// returns |buf|. If |buf| is NULL, it returns a newly allocated string, to be +// freed with |OPENSSL_free|, or NULL on error. +// +// The description includes a trailing newline and has the form: +// AES128-SHA Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1 +// +// Consider |SSL_CIPHER_standard_name| or |SSL_CIPHER_get_name| instead. +OPENSSL_EXPORT const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, + char *buf, int len); + +// SSL_CIPHER_get_version returns the string "TLSv1/SSLv3". +OPENSSL_EXPORT const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); + +// SSL_CIPHER_get_rfc_name returns a newly-allocated string containing the +// result of |SSL_CIPHER_standard_name| or NULL on error. The caller is +// responsible for calling |OPENSSL_free| on the result. +// +// Use |SSL_CIPHER_standard_name| instead. +OPENSSL_EXPORT char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher); + +typedef void COMP_METHOD; +typedef struct ssl_comp_st SSL_COMP; + +// SSL_COMP_get_compression_methods returns NULL. +OPENSSL_EXPORT STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + +// SSL_COMP_add_compression_method returns one. +OPENSSL_EXPORT int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); + +// SSL_COMP_get_name returns NULL. +OPENSSL_EXPORT const char *SSL_COMP_get_name(const COMP_METHOD *comp); + +// SSL_COMP_get0_name returns the |name| member of |comp|. +OPENSSL_EXPORT const char *SSL_COMP_get0_name(const SSL_COMP *comp); + +// SSL_COMP_get_id returns the |id| member of |comp|. +OPENSSL_EXPORT int SSL_COMP_get_id(const SSL_COMP *comp); + +// SSL_COMP_free_compression_methods does nothing. +OPENSSL_EXPORT void SSL_COMP_free_compression_methods(void); + +// SSLv23_method calls |TLS_method|. +OPENSSL_EXPORT const SSL_METHOD *SSLv23_method(void); + +// These version-specific methods behave exactly like |TLS_method| and +// |DTLS_method| except they also call |SSL_CTX_set_min_proto_version| and +// |SSL_CTX_set_max_proto_version| to lock connections to that protocol +// version. +OPENSSL_EXPORT const SSL_METHOD *TLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_method(void); + +// These client- and server-specific methods call their corresponding generic +// methods. +OPENSSL_EXPORT const SSL_METHOD *TLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *SSLv23_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *TLSv1_2_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLS_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_client_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_server_method(void); +OPENSSL_EXPORT const SSL_METHOD *DTLSv1_2_client_method(void); + +// SSL_clear resets |ssl| to allow another connection and returns one on success +// or zero on failure. It returns most configuration state but releases memory +// associated with the current connection. +// +// Free |ssl| and create a new one instead. +OPENSSL_EXPORT int SSL_clear(SSL *ssl); + +// SSL_CTX_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_rsa_callback( + SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_rsa_callback does nothing. +OPENSSL_EXPORT void SSL_set_tmp_rsa_callback(SSL *ssl, + RSA *(*cb)(SSL *ssl, int is_export, + int keylength)); + +// SSL_CTX_sess_connect returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_connect_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_renegotiate returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx); + +// SSL_CTX_sess_accept_good returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_accept_good(const SSL_CTX *ctx); + +// SSL_CTX_sess_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_cb_hits returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx); + +// SSL_CTX_sess_misses returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_misses(const SSL_CTX *ctx); + +// SSL_CTX_sess_timeouts returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_timeouts(const SSL_CTX *ctx); + +// SSL_CTX_sess_cache_full returns zero. +OPENSSL_EXPORT int SSL_CTX_sess_cache_full(const SSL_CTX *ctx); + +// SSL_cutthrough_complete calls |SSL_in_false_start|. +OPENSSL_EXPORT int SSL_cutthrough_complete(const SSL *ssl); + +// SSL_num_renegotiations calls |SSL_total_renegotiations|. +OPENSSL_EXPORT int SSL_num_renegotiations(const SSL *ssl); + +// SSL_CTX_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx); + +// SSL_need_tmp_RSA returns zero. +OPENSSL_EXPORT int SSL_need_tmp_RSA(const SSL *ssl); + +// SSL_CTX_set_tmp_rsa returns one. +OPENSSL_EXPORT int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa); + +// SSL_set_tmp_rsa returns one. +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 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 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); + +// SSL_get_shared_ciphers writes an empty string to |buf| and returns a +// 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 + +// i2d_SSL_SESSION serializes |in| to the bytes pointed to by |*pp|. On success, +// it returns the number of bytes written and advances |*pp| by that many bytes. +// On failure, it returns -1. If |pp| is NULL, no bytes are written and only the +// length is returned. +// +// Use |SSL_SESSION_to_bytes| instead. +OPENSSL_EXPORT int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp); + +// d2i_SSL_SESSION parses a serialized session from the |length| bytes pointed +// to by |*pp|. It returns the new |SSL_SESSION| and advances |*pp| by the +// number of bytes consumed on success and NULL on failure. The caller takes +// ownership of the new session and must call |SSL_SESSION_free| when done. +// +// If |a| is non-NULL, |*a| is released and set the new |SSL_SESSION|. +// +// Use |SSL_SESSION_from_bytes| instead. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const uint8_t **pp, + long length); + +// i2d_SSL_SESSION_bio serializes |session| and writes the result to |bio|. It +// returns the number of bytes written on success and <= 0 on error. +OPENSSL_EXPORT int i2d_SSL_SESSION_bio(BIO *bio, const SSL_SESSION *session); + +// d2i_SSL_SESSION_bio reads a serialized |SSL_SESSION| from |bio| and returns a +// newly-allocated |SSL_SESSION| or NULL on error. If |out| is not NULL, it also +// frees |*out| and sets |*out| to the new |SSL_SESSION|. +OPENSSL_EXPORT SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **out); + +// ERR_load_SSL_strings does nothing. +OPENSSL_EXPORT void ERR_load_SSL_strings(void); + +// SSL_load_error_strings does nothing. +OPENSSL_EXPORT void SSL_load_error_strings(void); + +// SSL_CTX_set_tlsext_use_srtp calls |SSL_CTX_set_srtp_profiles|. It returns +// zero on success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_CTX_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, + const char *profiles); + +// SSL_set_tlsext_use_srtp calls |SSL_set_srtp_profiles|. It returns zero on +// success and one on failure. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |SSL_set_srtp_profiles| instead. +OPENSSL_EXPORT int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); + +// SSL_get_current_compression returns NULL. +OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); + +// SSL_get_current_expansion returns NULL. +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); + +// SSL_CTX_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); + +// SSL_set_tmp_dh returns 1. +OPENSSL_EXPORT int SSL_set_tmp_dh(SSL *ssl, const DH *dh); + +// SSL_CTX_set_tmp_dh_callback does nothing. +OPENSSL_EXPORT void SSL_CTX_set_tmp_dh_callback( + SSL_CTX *ctx, DH *(*cb)(SSL *ssl, int is_export, int keylength)); + +// SSL_set_tmp_dh_callback does nothing. +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)) +#define SSL_SESSION_set_app_data(s, a) \ + (SSL_SESSION_set_ex_data(s, 0, (char *)(a))) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s, 0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx, 0)) +#define SSL_CTX_set_app_data(ctx, arg) \ + (SSL_CTX_set_ex_data(ctx, 0, (char *)(arg))) + +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() + +#define SSL_get_cipher(ssl) SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_bits(ssl, out_alg_bits) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), out_alg_bits) +#define SSL_get_cipher_version(ssl) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)) +#define SSL_get_cipher_name(ssl) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) +#define SSL_get_time(session) SSL_SESSION_get_time(session) +#define SSL_set_time(session, time) SSL_SESSION_set_time((session), (time)) +#define SSL_get_timeout(session) SSL_SESSION_get_timeout(session) +#define SSL_set_timeout(session, timeout) \ + SSL_SESSION_set_timeout((session), (timeout)) + +struct ssl_comp_st { + int id; + const char *name; + char *method; +}; + +DEFINE_STACK_OF(SSL_COMP) + +// The following flags do nothing and are included only to make it easier to +// compile code with BoringSSL. +#define SSL_MODE_AUTO_RETRY 0 +#define SSL_MODE_RELEASE_BUFFERS 0 +#define SSL_MODE_SEND_CLIENTHELLO_TIME 0 +#define SSL_MODE_SEND_SERVERHELLO_TIME 0 +#define SSL_OP_ALL 0 +#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0 +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0 +#define SSL_OP_EPHEMERAL_RSA 0 +#define SSL_OP_LEGACY_SERVER_CONNECT 0 +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0 +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0 +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0 +#define SSL_OP_NETSCAPE_CA_DN_BUG 0 +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0 +#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 +#define SSL_OP_SINGLE_ECDH_USE 0 +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0 +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0 +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0 +#define SSL_OP_TLS_D5_BUG 0 +#define SSL_OP_TLS_ROLLBACK_BUG 0 +#define SSL_VERIFY_CLIENT_ONCE 0 + +// SSL_cache_hit calls |SSL_session_reused|. +OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); + +// SSL_get_default_timeout returns |SSL_DEFAULT_SESSION_TIMEOUT|. +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 "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 +// |SSL_get_ciphers| or NULL if out of range. Use |SSL_get_ciphers| instead. +OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); + +// SSL_CTX_set_client_cert_cb sets a callback which is called on the client if +// the server requests a client certificate and none is configured. On success, +// the callback should return one and set |*out_x509| to |*out_pkey| to a leaf +// certificate and private key, respectively, passing ownership. It should +// return zero to send no certificate and -1 to fail or pause the handshake. If +// the handshake is paused, |SSL_get_error| will return +// |SSL_ERROR_WANT_X509_LOOKUP|. +// +// The callback may call |SSL_get0_certificate_types| and +// |SSL_get_client_CA_list| for information on the server's certificate request. +// +// Use |SSL_CTX_set_cert_cb| instead. Configuring intermediate certificates with +// this function is confusing. This callback may not be registered concurrently +// with |SSL_CTX_set_cert_cb| or |SSL_set_cert_cb|. +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 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. +OPENSSL_EXPORT int SSL_want(const SSL *ssl); + +#define SSL_want_read(ssl) (SSL_want(ssl) == SSL_READING) +#define SSL_want_write(ssl) (SSL_want(ssl) == SSL_WRITING) + + // 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 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 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, + size_t count); + +// SSL_alert_type_string returns "!". Use |SSL_alert_type_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_type_string(int value); + +// SSL_alert_desc_string returns "!!". Use |SSL_alert_desc_string_long| +// instead. +OPENSSL_EXPORT const char *SSL_alert_desc_string(int value); + +// SSL_state_string returns "!!!!!!". Use |SSL_state_string_long| for a more +// intelligible string. +OPENSSL_EXPORT const char *SSL_state_string(const SSL *ssl); + +// SSL_TXT_* expand to strings. +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" +#define SSL_TXT_FIPS "FIPS" +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHE "kDHE" +#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_kECDHE "kECDHE" +#define SSL_TXT_kEECDH "kEECDH" +#define SSL_TXT_kPSK "kPSK" +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aECDSA "aECDSA" +#define SSL_TXT_aPSK "aPSK" +#define SSL_TXT_DH "DH" +#define SSL_TXT_DHE "DHE" +#define SSL_TXT_EDH "EDH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_ECDH "ECDH" +#define SSL_TXT_ECDHE "ECDHE" +#define SSL_TXT_EECDH "EECDH" +#define SSL_TXT_ECDSA "ECDSA" +#define SSL_TXT_PSK "PSK" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_AES128 "AES128" +#define SSL_TXT_AES256 "AES256" +#define SSL_TXT_AES "AES" +#define SSL_TXT_AES_GCM "AESGCM" +#define SSL_TXT_CHACHA20 "CHACHA20" +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" +#define SSL_TXT_SHA256 "SHA256" +#define SSL_TXT_SHA384 "SHA384" +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_TLSV1_1 "TLSv1.1" +#define SSL_TXT_TLSV1_2 "TLSv1.2" +#define SSL_TXT_TLSV1_3 "TLSv1.3" +#define SSL_TXT_ALL "ALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +typedef struct ssl_conf_ctx_st SSL_CONF_CTX; + +// SSL_state returns |SSL_ST_INIT| if a handshake is in progress and |SSL_ST_OK| +// otherwise. +// +// Use |SSL_is_init| instead. +OPENSSL_EXPORT int SSL_state(const SSL *ssl); + +#define SSL_get_state(ssl) SSL_state(ssl) + +// SSL_set_shutdown causes |ssl| to behave as if the shutdown bitmask (see +// |SSL_get_shutdown|) were |mode|. This may be used to skip sending or +// receiving close_notify in |SSL_shutdown| by causing the implementation to +// believe the events already happened. +// +// It is an error to use |SSL_set_shutdown| to unset a bit that has already been +// set. Doing so will trigger an |assert| in debug builds and otherwise be +// ignored. +// +// Use |SSL_CTX_set_quiet_shutdown| instead. +OPENSSL_EXPORT void SSL_set_shutdown(SSL *ssl, int mode); + +// SSL_CTX_set_tmp_ecdh calls |SSL_CTX_set1_curves| with a one-element list +// containing |ec_key|'s curve. +OPENSSL_EXPORT int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key); + +// SSL_set_tmp_ecdh calls |SSL_set1_curves| with a one-element list containing +// |ec_key|'s curve. +OPENSSL_EXPORT int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key); + +// SSL_add_dir_cert_subjects_to_stack lists files in directory |dir|. It calls +// |SSL_add_file_cert_subjects_to_stack| on each file and returns one on success +// or zero on error. This function is only available from the libdecrepit +// library. +OPENSSL_EXPORT int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, + const char *dir); + +// SSL_set_verify_result calls |abort| unless |result| is |X509_V_OK|. +// +// TODO(davidben): Remove this function once it has been removed from +// netty-tcnative. +OPENSSL_EXPORT void SSL_set_verify_result(SSL *ssl, long result); + +// SSL_CTX_enable_tls_channel_id calls |SSL_CTX_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx); + +// SSL_enable_tls_channel_id calls |SSL_set_tls_channel_id_enabled|. +OPENSSL_EXPORT int SSL_enable_tls_channel_id(SSL *ssl); + +// BIO_f_ssl returns a |BIO_METHOD| that can wrap an |SSL*| in a |BIO*|. Note +// that this has quite different behaviour from the version in OpenSSL (notably +// that it doesn't try to auto renegotiate). +// +// IMPORTANT: if you are not curl, don't use this. +OPENSSL_EXPORT const BIO_METHOD *BIO_f_ssl(void); + +// BIO_set_ssl sets |ssl| as the underlying connection for |bio|, which must +// have been created using |BIO_f_ssl|. If |take_owership| is true, |bio| will +// call |SSL_free| on |ssl| when closed. It returns one on success or something +// other than one on error. +OPENSSL_EXPORT long BIO_set_ssl(BIO *bio, SSL *ssl, int take_owership); + +// SSL_CTX_set_ecdh_auto returns one. +#define SSL_CTX_set_ecdh_auto(ctx, onoff) 1 + +// SSL_set_ecdh_auto returns one. +#define SSL_set_ecdh_auto(ssl, onoff) 1 + +// SSL_get_session returns a non-owning pointer to |ssl|'s session. For +// historical reasons, which session it returns depends on |ssl|'s state. +// +// Prior to the start of the initial handshake, it returns the session the +// caller set with |SSL_set_session|. After the initial handshake has finished +// and if no additional handshakes are in progress, it returns the currently +// active session. Its behavior is undefined while a handshake is in progress. +// +// If trying to add new sessions to an external session cache, use +// |SSL_CTX_sess_set_new_cb| instead. In particular, using the callback is +// required as of TLS 1.3. For compatibility, this function will return an +// unresumable session which may be cached, but will never be resumed. +// +// If querying properties of the connection, use APIs on the |SSL| object. +OPENSSL_EXPORT SSL_SESSION *SSL_get_session(const SSL *ssl); + +// SSL_get0_session is an alias for |SSL_get_session|. +#define SSL_get0_session SSL_get_session + +// SSL_get1_session acts like |SSL_get_session| but returns a new reference to +// the session. +OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); + +#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_LOAD_SSL_STRINGS 0 +#define OPENSSL_INIT_SSL_DEFAULT 0 + +// OPENSSL_init_ssl calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, + const OPENSSL_INIT_SETTINGS *settings); + +// 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 + +// 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. +// +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); + +// 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); + +// 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); + +// 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__) + + +// 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. +// +// Although using either the CTRL values or their wrapper macros in #ifdefs is +// still supported, the CTRL values may not be passed to |SSL_ctrl| and +// |SSL_CTX_ctrl|. Call the functions (previously wrapper macros) instead. +// +// See PORTING.md in the BoringSSL source tree for a table of corresponding +// functions. +// https://boringssl.googlesource.com/boringssl/+/master/PORTING.md#Replacements-for-values + +#define DTLS_CTRL_GET_TIMEOUT doesnt_exist +#define DTLS_CTRL_HANDLE_TIMEOUT doesnt_exist +#define SSL_CTRL_CHAIN doesnt_exist +#define SSL_CTRL_CHAIN_CERT doesnt_exist +#define SSL_CTRL_CHANNEL_ID doesnt_exist +#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_CLEAR_MODE doesnt_exist +#define SSL_CTRL_CLEAR_OPTIONS doesnt_exist +#define SSL_CTRL_EXTRA_CHAIN_CERT doesnt_exist +#define SSL_CTRL_GET_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_CHANNEL_ID doesnt_exist +#define SSL_CTRL_GET_CLIENT_CERT_TYPES doesnt_exist +#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS doesnt_exist +#define SSL_CTRL_GET_MAX_CERT_LIST doesnt_exist +#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 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS doesnt_exist +#define SSL_CTRL_MODE doesnt_exist +#define SSL_CTRL_NEED_TMP_RSA doesnt_exist +#define SSL_CTRL_OPTIONS doesnt_exist +#define SSL_CTRL_SESS_NUMBER doesnt_exist +#define SSL_CTRL_SET_CURVES doesnt_exist +#define SSL_CTRL_SET_CURVES_LIST doesnt_exist +#define SSL_CTRL_SET_ECDH_AUTO doesnt_exist +#define SSL_CTRL_SET_MAX_CERT_LIST doesnt_exist +#define SSL_CTRL_SET_MAX_SEND_FRAGMENT doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK doesnt_exist +#define SSL_CTRL_SET_MSG_CALLBACK_ARG doesnt_exist +#define SSL_CTRL_SET_MTU doesnt_exist +#define SSL_CTRL_SET_READ_AHEAD doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_MODE doesnt_exist +#define SSL_CTRL_SET_SESS_CACHE_SIZE doesnt_exist +#define SSL_CTRL_SET_TLSEXT_HOSTNAME doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG doesnt_exist +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS doesnt_exist +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB doesnt_exist +#define SSL_CTRL_SET_TMP_DH doesnt_exist +#define SSL_CTRL_SET_TMP_DH_CB doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH doesnt_exist +#define SSL_CTRL_SET_TMP_ECDH_CB doesnt_exist +#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) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +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, + kDiscard, + kIncompleteRecord, + kAlertCloseNotify, + kError, +}; + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// OpenRecord decrypts the first complete SSL record from |in| in-place, sets +// |out| to the decrypted application data, and |out_record_len| to the length +// of the encrypted record. Returns: +// - kOK if an application-data record was successfully decrypted and verified. +// - kDiscard if a record was sucessfully processed, but should be discarded. +// - kIncompleteRecord if |in| did not contain a complete record. +// - kAlertCloseNotify if a record was successfully processed but is a +// close_notify alert. +// - kError if an error occurred or the record is invalid. |*out_alert| will be +// set to an alert to emit, or zero if no alert should be emitted. +OPENSSL_EXPORT OpenRecordResult OpenRecord(SSL *ssl, Span *out, + size_t *out_record_len, + uint8_t *out_alert, + Span in); + +OPENSSL_EXPORT size_t SealRecordPrefixLen(const SSL *ssl, size_t plaintext_len); + +// SealRecordSuffixLen returns the length of the suffix written by |SealRecord|. +// +// |plaintext_len| must be equal to the size of the plaintext passed to +// |SealRecord|. +// +// |plaintext_len| must not exceed |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The returned +// suffix length will not exceed |SSL3_RT_MAX_ENCRYPTED_OVERHEAD|. +OPENSSL_EXPORT size_t SealRecordSuffixLen(const SSL *ssl, size_t plaintext_len); + +// *** EXPERIMENTAL -- DO NOT USE *** +// +// SealRecord encrypts the cleartext of |in| and scatters the resulting TLS +// application data record between |out_prefix|, |out|, and |out_suffix|. It +// returns true on success or false if an error occurred. +// +// The length of |out_prefix| must equal |SealRecordPrefixLen|. The length of +// |out| must equal the length of |in|, which must not exceed +// |SSL3_RT_MAX_PLAINTEXT_LENGTH|. The length of |out_suffix| must equal +// |SealRecordSuffixLen|. +// +// If enabled, |SealRecord| may perform TLS 1.0 CBC 1/n-1 record splitting. +// |SealRecordPrefixLen| accounts for the required overhead if that is the case. +// +// |out| may equal |in| to encrypt in-place but may not otherwise alias. +// |out_prefix| and |out_suffix| may not alias anything. +OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, + Span out, Span out_suffix, + Span in); + + +// *** EXPERIMENTAL β€” DO NOT USE WITHOUT CHECKING *** +// +// Split handshakes. +// +// Split handshakes allows the handshake part of a TLS connection to be +// performed in a different process (or on a different machine) than the data +// exchange. This only applies to servers. +// +// In the first part of a split handshake, an |SSL| (where the |SSL_CTX| has +// been configured with |SSL_CTX_set_handoff_mode|) is used normally. Once the +// ClientHello message has been received, the handshake will stop and +// |SSL_get_error| will indicate |SSL_ERROR_HANDOFF|. At this point (and only +// at this point), |SSL_serialize_handoff| can be called to write the β€œhandoff” +// 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|, 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 +// as normal. +// +// 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 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 +// fatal. +// WARNING: The handback data contains sensitive key material and must be +// protected. +// WARNING: Some calls on the final |SSL| will not work. Just as an example, +// calls like |SSL_get0_session_id_context| and |SSL_get_privatekey| won't +// work because the certificate used for handshaking isn't available. +// WARNING: |SSL_apply_handoff| may trigger β€œmsg” callback calls. + +OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); +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); + +// 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++ + +#endif // !defined(BORINGSSL_NO_CXX) + +#endif + +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 101 +#define SSL_R_BAD_ALERT 102 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 104 +#define SSL_R_BAD_DH_P_LENGTH 105 +#define SSL_R_BAD_DIGEST_LENGTH 106 +#define SSL_R_BAD_ECC_CERT 107 +#define SSL_R_BAD_ECPOINT 108 +#define SSL_R_BAD_HANDSHAKE_RECORD 109 +#define SSL_R_BAD_HELLO_REQUEST 110 +#define SSL_R_BAD_LENGTH 111 +#define SSL_R_BAD_PACKET_LENGTH 112 +#define SSL_R_BAD_RSA_ENCRYPT 113 +#define SSL_R_BAD_SIGNATURE 114 +#define SSL_R_BAD_SRTP_MKI_VALUE 115 +#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 116 +#define SSL_R_BAD_SSL_FILETYPE 117 +#define SSL_R_BAD_WRITE_RETRY 118 +#define SSL_R_BIO_NOT_SET 119 +#define SSL_R_BN_LIB 120 +#define SSL_R_BUFFER_TOO_SMALL 121 +#define SSL_R_CA_DN_LENGTH_MISMATCH 122 +#define SSL_R_CA_DN_TOO_LONG 123 +#define SSL_R_CCS_RECEIVED_EARLY 124 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 125 +#define SSL_R_CERT_CB_ERROR 126 +#define SSL_R_CERT_LENGTH_MISMATCH 127 +#define SSL_R_CHANNEL_ID_NOT_P256 128 +#define SSL_R_CHANNEL_ID_SIGNATURE_INVALID 129 +#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 130 +#define SSL_R_CLIENTHELLO_PARSE_FAILED 131 +#define SSL_R_CLIENTHELLO_TLSEXT 132 +#define SSL_R_CONNECTION_REJECTED 133 +#define SSL_R_CONNECTION_TYPE_NOT_SET 134 +#define SSL_R_CUSTOM_EXTENSION_ERROR 135 +#define SSL_R_DATA_LENGTH_TOO_LONG 136 +#define SSL_R_DECODE_ERROR 137 +#define SSL_R_DECRYPTION_FAILED 138 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 139 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 140 +#define SSL_R_DH_P_TOO_LONG 141 +#define SSL_R_DIGEST_CHECK_FAILED 142 +#define SSL_R_DTLS_MESSAGE_TOO_BIG 143 +#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 144 +#define SSL_R_EMS_STATE_INCONSISTENT 145 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 146 +#define SSL_R_ERROR_ADDING_EXTENSION 147 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 148 +#define SSL_R_ERROR_PARSING_EXTENSION 149 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 150 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 151 +#define SSL_R_FRAGMENT_MISMATCH 152 +#define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 153 +#define SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO 154 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_INAPPROPRIATE_FALLBACK 157 +#define SSL_R_INVALID_COMMAND 158 +#define SSL_R_INVALID_MESSAGE 159 +#define SSL_R_INVALID_SSL_SESSION 160 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 161 +#define SSL_R_LENGTH_MISMATCH 162 +#define SSL_R_MISSING_EXTENSION 164 +#define SSL_R_MISSING_RSA_CERTIFICATE 165 +#define SSL_R_MISSING_TMP_DH_KEY 166 +#define SSL_R_MISSING_TMP_ECDH_KEY 167 +#define SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS 168 +#define SSL_R_MTU_TOO_SMALL 169 +#define SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN 170 +#define SSL_R_NESTED_GROUP 171 +#define SSL_R_NO_CERTIFICATES_RETURNED 172 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 173 +#define SSL_R_NO_CERTIFICATE_SET 174 +#define SSL_R_NO_CIPHERS_AVAILABLE 175 +#define SSL_R_NO_CIPHERS_PASSED 176 +#define SSL_R_NO_CIPHER_MATCH 177 +#define SSL_R_NO_COMPRESSION_SPECIFIED 178 +#define SSL_R_NO_METHOD_SPECIFIED 179 +#define SSL_R_NO_P256_SUPPORT 180 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 181 +#define SSL_R_NO_RENEGOTIATION 182 +#define SSL_R_NO_REQUIRED_DIGEST 183 +#define SSL_R_NO_SHARED_CIPHER 184 +#define SSL_R_NULL_SSL_CTX 185 +#define SSL_R_NULL_SSL_METHOD_PASSED 186 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 187 +#define SSL_R_OLD_SESSION_VERSION_NOT_RETURNED 188 +#define SSL_R_OUTPUT_ALIASES_INPUT 189 +#define SSL_R_PARSE_TLSEXT 190 +#define SSL_R_PATH_TOO_LONG 191 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 192 +#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 193 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 194 +#define SSL_R_PSK_IDENTITY_NOT_FOUND 195 +#define SSL_R_PSK_NO_CLIENT_CB 196 +#define SSL_R_PSK_NO_SERVER_CB 197 +#define SSL_R_READ_TIMEOUT_EXPIRED 198 +#define SSL_R_RECORD_LENGTH_MISMATCH 199 +#define SSL_R_RECORD_TOO_LARGE 200 +#define SSL_R_RENEGOTIATION_ENCODING_ERR 201 +#define SSL_R_RENEGOTIATION_MISMATCH 202 +#define SSL_R_REQUIRED_CIPHER_MISSING 203 +#define SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION 204 +#define SSL_R_RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION 205 +#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 206 +#define SSL_R_SERVERHELLO_TLSEXT 207 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 208 +#define SSL_R_SESSION_MAY_NOT_BE_CREATED 209 +#define SSL_R_SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER 210 +#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 211 +#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 212 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 213 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 214 +#define SSL_R_SSL_HANDSHAKE_FAILURE 215 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 216 +#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 217 +#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 218 +#define SSL_R_TOO_MANY_EMPTY_FRAGMENTS 219 +#define SSL_R_TOO_MANY_WARNING_ALERTS 220 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 221 +#define SSL_R_UNEXPECTED_EXTENSION 222 +#define SSL_R_UNEXPECTED_MESSAGE 223 +#define SSL_R_UNEXPECTED_OPERATOR_IN_GROUP 224 +#define SSL_R_UNEXPECTED_RECORD 225 +#define SSL_R_UNINITIALIZED 226 +#define SSL_R_UNKNOWN_ALERT_TYPE 227 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 228 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 229 +#define SSL_R_UNKNOWN_CIPHER_TYPE 230 +#define SSL_R_UNKNOWN_DIGEST 231 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 232 +#define SSL_R_UNKNOWN_PROTOCOL 233 +#define SSL_R_UNKNOWN_SSL_VERSION 234 +#define SSL_R_UNKNOWN_STATE 235 +#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 236 +#define SSL_R_UNSUPPORTED_CIPHER 237 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 238 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 239 +#define SSL_R_UNSUPPORTED_PROTOCOL 240 +#define SSL_R_WRONG_CERTIFICATE_TYPE 241 +#define SSL_R_WRONG_CIPHER_RETURNED 242 +#define SSL_R_WRONG_CURVE 243 +#define SSL_R_WRONG_MESSAGE_TYPE 244 +#define SSL_R_WRONG_SIGNATURE_TYPE 245 +#define SSL_R_WRONG_SSL_VERSION 246 +#define SSL_R_WRONG_VERSION_NUMBER 247 +#define SSL_R_X509_LIB 248 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 249 +#define SSL_R_SHUTDOWN_WHILE_IN_INIT 250 +#define SSL_R_INVALID_OUTER_RECORD_TYPE 251 +#define SSL_R_UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY 252 +#define SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS 253 +#define SSL_R_DOWNGRADE_DETECTED 254 +#define SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE 255 +#define SSL_R_INVALID_COMPRESSION_LIST 256 +#define SSL_R_DUPLICATE_EXTENSION 257 +#define SSL_R_MISSING_KEY_SHARE 258 +#define SSL_R_INVALID_ALPN_PROTOCOL 259 +#define SSL_R_TOO_MANY_KEY_UPDATES 260 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 261 +#define SSL_R_NO_CIPHERS_SPECIFIED 262 +#define SSL_R_RENEGOTIATION_EMS_MISMATCH 263 +#define SSL_R_DUPLICATE_KEY_SHARE 264 +#define SSL_R_NO_GROUPS_SPECIFIED 265 +#define SSL_R_NO_SHARED_GROUP 266 +#define SSL_R_PRE_SHARED_KEY_MUST_BE_LAST 267 +#define SSL_R_OLD_SESSION_PRF_HASH_MISMATCH 268 +#define SSL_R_INVALID_SCT_LIST 269 +#define SSL_R_TOO_MUCH_SKIPPED_EARLY_DATA 270 +#define SSL_R_PSK_IDENTITY_BINDER_COUNT_MISMATCH 271 +#define SSL_R_CANNOT_PARSE_LEAF_CERT 272 +#define SSL_R_SERVER_CERT_CHANGED 273 +#define SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH 274 +#define SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD 275 +#define SSL_R_TICKET_ENCRYPTION_FAILED 276 +#define SSL_R_ALPN_MISMATCH_ON_EARLY_DATA 277 +#define SSL_R_WRONG_VERSION_ON_EARLY_DATA 278 +#define SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA 279 +#define SSL_R_NO_SUPPORTED_VERSIONS_ENABLED 280 +#define SSL_R_APPLICATION_DATA_INSTEAD_OF_HANDSHAKE 281 +#define SSL_R_EMPTY_HELLO_RETRY_REQUEST 282 +#define SSL_R_EARLY_DATA_NOT_IN_USE 283 +#define SSL_R_HANDSHAKE_NOT_COMPLETE 284 +#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 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 +#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 +#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 +#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 +#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 +#define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 +#define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 + +#endif // OPENSSL_HEADER_SSL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h new file mode 100644 index 0000000..0bd562e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.back new file mode 100644 index 0000000..e3910f0 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_back new file mode 100644 index 0000000..e3910f0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h new file mode 100644 index 0000000..61c212c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.back new file mode 100644 index 0000000..04e942c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.grpc_back new file mode 100644 index 0000000..04e942c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h new file mode 100644 index 0000000..cafd14b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.back new file mode 100644 index 0000000..91706fe --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_back new file mode 100644 index 0000000..91706fe --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h new file mode 100644 index 0000000..0377670 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.back new file mode 100644 index 0000000..8b61d5a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_back new file mode 100644 index 0000000..8b61d5a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h new file mode 100644 index 0000000..fdbadea --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.back new file mode 100644 index 0000000..c267938 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_back new file mode 100644 index 0000000..c267938 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h new file mode 100644 index 0000000..b61d902 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.back new file mode 100644 index 0000000..b61d902 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.grpc_back new file mode 100644 index 0000000..b61d902 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h new file mode 100644 index 0000000..fb22f83 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.back new file mode 100644 index 0000000..ee3eccc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_back new file mode 100644 index 0000000..ee3eccc --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h new file mode 100644 index 0000000..1ac4dae --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.back new file mode 100644 index 0000000..f262334 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_back new file mode 100644 index 0000000..f262334 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h new file mode 100644 index 0000000..cb67972 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h @@ -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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.back new file mode 100644 index 0000000..b5db715 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_back new file mode 100644 index 0000000..b5db715 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc new file mode 100644 index 0000000..4cb6146 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc @@ -0,0 +1,179 @@ +/* + * Copyright 1995-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 + + +static SSL *get_ssl(BIO *bio) { + return reinterpret_cast(bio->ptr); +} + +static int ssl_read(BIO *bio, char *out, int outl) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + BIO_clear_retry_flags(bio); + + const int ret = SSL_read(ssl, out, outl); + + switch (SSL_get_error(ssl, ret)) { + case SSL_ERROR_WANT_READ: + BIO_set_retry_read(bio); + break; + + case SSL_ERROR_WANT_WRITE: + BIO_set_retry_write(bio); + break; + + case SSL_ERROR_WANT_ACCEPT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_ACCEPT; + break; + + case SSL_ERROR_WANT_CONNECT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_CONNECT; + break; + + case SSL_ERROR_NONE: + case SSL_ERROR_SYSCALL: + case SSL_ERROR_SSL: + case SSL_ERROR_ZERO_RETURN: + default: + break; + } + + return ret; +} + +static int ssl_write(BIO *bio, const char *out, int outl) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + BIO_clear_retry_flags(bio); + + const int ret = SSL_write(ssl, out, outl); + + switch (SSL_get_error(ssl, ret)) { + case SSL_ERROR_WANT_WRITE: + BIO_set_retry_write(bio); + break; + + case SSL_ERROR_WANT_READ: + BIO_set_retry_read(bio); + break; + + case SSL_ERROR_WANT_CONNECT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_CONNECT; + break; + + case SSL_ERROR_NONE: + case SSL_ERROR_SYSCALL: + case SSL_ERROR_SSL: + default: + break; + } + + return ret; +} + +static long ssl_ctrl(BIO *bio, int cmd, long num, void *ptr) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL && cmd != BIO_C_SET_SSL) { + return 0; + } + + switch (cmd) { + case BIO_C_SET_SSL: + bio->shutdown = num; + bio->ptr = ptr; + bio->init = 1; + return 1; + + case BIO_CTRL_GET_CLOSE: + return bio->shutdown; + + case BIO_CTRL_SET_CLOSE: + bio->shutdown = num; + return 1; + + case BIO_CTRL_WPENDING: + return BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr); + + case BIO_CTRL_PENDING: + return SSL_pending(ssl); + + case BIO_CTRL_FLUSH: { + BIO_clear_retry_flags(bio); + long ret = BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr); + BIO_copy_next_retry(bio); + return ret; + } + + case BIO_CTRL_PUSH: + case BIO_CTRL_POP: + case BIO_CTRL_DUP: + return -1; + + default: + return BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr); + } +} + +static int ssl_new(BIO *bio) { + return 1; +} + +static int ssl_free(BIO *bio) { + SSL *ssl = get_ssl(bio); + + if (ssl == NULL) { + return 1; + } + + SSL_shutdown(ssl); + if (bio->shutdown) { + SSL_free(ssl); + } + + return 1; +} + +static long ssl_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + switch (cmd) { + case BIO_CTRL_SET_CALLBACK: + return -1; + + default: + return BIO_callback_ctrl(SSL_get_rbio(ssl), cmd, fp); + } +} + +static const BIO_METHOD ssl_method = { + BIO_TYPE_SSL, "SSL", ssl_write, ssl_read, NULL, + NULL, ssl_ctrl, ssl_new, ssl_free, ssl_callback_ctrl, +}; + +const BIO_METHOD *BIO_f_ssl(void) { return &ssl_method; } + +long BIO_set_ssl(BIO *bio, SSL *ssl, int take_owership) { + return BIO_ctrl(bio, BIO_C_SET_SSL, take_owership, ssl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc.grpc_back new file mode 100644 index 0000000..61afee5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc.grpc_back @@ -0,0 +1,179 @@ +/* + * Copyright 1995-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 + + +static SSL *get_ssl(BIO *bio) { + return reinterpret_cast(bio->ptr); +} + +static int ssl_read(BIO *bio, char *out, int outl) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + BIO_clear_retry_flags(bio); + + const int ret = SSL_read(ssl, out, outl); + + switch (SSL_get_error(ssl, ret)) { + case SSL_ERROR_WANT_READ: + BIO_set_retry_read(bio); + break; + + case SSL_ERROR_WANT_WRITE: + BIO_set_retry_write(bio); + break; + + case SSL_ERROR_WANT_ACCEPT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_ACCEPT; + break; + + case SSL_ERROR_WANT_CONNECT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_CONNECT; + break; + + case SSL_ERROR_NONE: + case SSL_ERROR_SYSCALL: + case SSL_ERROR_SSL: + case SSL_ERROR_ZERO_RETURN: + default: + break; + } + + return ret; +} + +static int ssl_write(BIO *bio, const char *out, int outl) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + BIO_clear_retry_flags(bio); + + const int ret = SSL_write(ssl, out, outl); + + switch (SSL_get_error(ssl, ret)) { + case SSL_ERROR_WANT_WRITE: + BIO_set_retry_write(bio); + break; + + case SSL_ERROR_WANT_READ: + BIO_set_retry_read(bio); + break; + + case SSL_ERROR_WANT_CONNECT: + BIO_set_retry_special(bio); + bio->retry_reason = BIO_RR_CONNECT; + break; + + case SSL_ERROR_NONE: + case SSL_ERROR_SYSCALL: + case SSL_ERROR_SSL: + default: + break; + } + + return ret; +} + +static long ssl_ctrl(BIO *bio, int cmd, long num, void *ptr) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL && cmd != BIO_C_SET_SSL) { + return 0; + } + + switch (cmd) { + case BIO_C_SET_SSL: + bio->shutdown = num; + bio->ptr = ptr; + bio->init = 1; + return 1; + + case BIO_CTRL_GET_CLOSE: + return bio->shutdown; + + case BIO_CTRL_SET_CLOSE: + bio->shutdown = num; + return 1; + + case BIO_CTRL_WPENDING: + return BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr); + + case BIO_CTRL_PENDING: + return SSL_pending(ssl); + + case BIO_CTRL_FLUSH: { + BIO_clear_retry_flags(bio); + long ret = BIO_ctrl(SSL_get_wbio(ssl), cmd, num, ptr); + BIO_copy_next_retry(bio); + return ret; + } + + case BIO_CTRL_PUSH: + case BIO_CTRL_POP: + case BIO_CTRL_DUP: + return -1; + + default: + return BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr); + } +} + +static int ssl_new(BIO *bio) { + return 1; +} + +static int ssl_free(BIO *bio) { + SSL *ssl = get_ssl(bio); + + if (ssl == NULL) { + return 1; + } + + SSL_shutdown(ssl); + if (bio->shutdown) { + SSL_free(ssl); + } + + return 1; +} + +static long ssl_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) { + SSL *ssl = get_ssl(bio); + if (ssl == NULL) { + return 0; + } + + switch (cmd) { + case BIO_CTRL_SET_CALLBACK: + return -1; + + default: + return BIO_callback_ctrl(SSL_get_rbio(ssl), cmd, fp); + } +} + +static const BIO_METHOD ssl_method = { + BIO_TYPE_SSL, "SSL", ssl_write, ssl_read, NULL, + NULL, ssl_ctrl, ssl_new, ssl_free, ssl_callback_ctrl, +}; + +const BIO_METHOD *BIO_f_ssl(void) { return &ssl_method; } + +long BIO_set_ssl(BIO *bio, SSL *ssl, int take_owership) { + return BIO_ctrl(bio, BIO_C_SET_SSL, take_owership, ssl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc new file mode 100644 index 0000000..9994db0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc @@ -0,0 +1,841 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * 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 (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 "../crypto/internal.h" +#include "internal.h" + + +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 +// protocol's overhead rather than, say, what's needed to hold a minimally-sized +// handshake fragment plus protocol overhead. + +// kMinMTU is the minimum acceptable MTU value. +static const unsigned int kMinMTU = 256 - 28; + +// kDefaultMTU is the default MTU value to use if neither the user nor +// the underlying BIO supplies one. +static const unsigned int kDefaultMTU = 1500 - 28; + + +// Receiving handshake messages. + +hm_fragment::~hm_fragment() { + OPENSSL_free(data); + OPENSSL_free(reassembly); +} + +static UniquePtr dtls1_hm_fragment_new( + const struct hm_header_st *msg_hdr) { + ScopedCBB cbb; + UniquePtr frag = MakeUnique(); + if (!frag) { + return nullptr; + } + frag->type = msg_hdr->type; + frag->seq = msg_hdr->seq; + frag->msg_len = msg_hdr->msg_len; + + // Allocate space for the reassembled message and fill in the header. + frag->data = + (uint8_t *)OPENSSL_malloc(DTLS1_HM_HEADER_LENGTH + msg_hdr->msg_len); + if (frag->data == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || + !CBB_add_u8(cbb.get(), msg_hdr->type) || + !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || + !CBB_add_u16(cbb.get(), msg_hdr->seq) || + !CBB_add_u24(cbb.get(), 0 /* frag_off */) || + !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || + !CBB_finish(cbb.get(), NULL, NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + // If the handshake message is empty, |frag->reassembly| is NULL. + if (msg_hdr->msg_len > 0) { + // Initialize reassembly bitmask. + if (msg_hdr->msg_len + 7 < msg_hdr->msg_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return nullptr; + } + size_t bitmask_len = (msg_hdr->msg_len + 7) / 8; + frag->reassembly = (uint8_t *)OPENSSL_malloc(bitmask_len); + if (frag->reassembly == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + OPENSSL_memset(frag->reassembly, 0, bitmask_len); + } + + return frag; +} + +// bit_range returns a |uint8_t| with bits |start|, inclusive, to |end|, +// exclusive, set. +static uint8_t bit_range(size_t start, size_t end) { + return (uint8_t)(~((1u << start) - 1) & ((1u << end) - 1)); +} + +// dtls1_hm_fragment_mark marks bytes |start|, inclusive, to |end|, exclusive, +// as received in |frag|. If |frag| becomes complete, it clears +// |frag->reassembly|. The range must be within the bounds of |frag|'s message +// and |frag->reassembly| must not be NULL. +static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start, + size_t end) { + size_t msg_len = frag->msg_len; + + if (frag->reassembly == NULL || start > end || end > msg_len) { + assert(0); + return; + } + // A zero-length message will never have a pending reassembly. + assert(msg_len > 0); + + if (start == end) { + return; + } + + if ((start >> 3) == (end >> 3)) { + frag->reassembly[start >> 3] |= bit_range(start & 7, end & 7); + } else { + frag->reassembly[start >> 3] |= bit_range(start & 7, 8); + for (size_t i = (start >> 3) + 1; i < (end >> 3); i++) { + frag->reassembly[i] = 0xff; + } + if ((end & 7) != 0) { + frag->reassembly[end >> 3] |= bit_range(0, end & 7); + } + } + + // Check if the fragment is complete. + for (size_t i = 0; i < (msg_len >> 3); i++) { + if (frag->reassembly[i] != 0xff) { + return; + } + } + if ((msg_len & 7) != 0 && + frag->reassembly[msg_len >> 3] != bit_range(0, msg_len & 7)) { + return; + } + + OPENSSL_free(frag->reassembly); + frag->reassembly = NULL; +} + +// dtls1_is_current_message_complete returns whether the current handshake +// message is complete. +static bool dtls1_is_current_message_complete(const SSL *ssl) { + size_t idx = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + return frag != NULL && frag->reassembly == NULL; +} + +// dtls1_get_incoming_message returns the incoming message corresponding to +// |msg_hdr|. If none exists, it creates a new one and inserts it in the +// queue. Otherwise, it checks |msg_hdr| is consistent with the existing one. It +// returns NULL on failure. The caller does not take ownership of the result. +static hm_fragment *dtls1_get_incoming_message( + SSL *ssl, uint8_t *out_alert, const struct hm_header_st *msg_hdr) { + if (msg_hdr->seq < ssl->d1->handshake_read_seq || + msg_hdr->seq - ssl->d1->handshake_read_seq >= SSL_MAX_HANDSHAKE_FLIGHT) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return NULL; + } + + size_t idx = msg_hdr->seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + if (frag != NULL) { + assert(frag->seq == msg_hdr->seq); + // The new fragment must be compatible with the previous fragments from this + // message. + if (frag->type != msg_hdr->type || + frag->msg_len != msg_hdr->msg_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_FRAGMENT_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return NULL; + } + return frag; + } + + // This is the first fragment from this message. + ssl->d1->incoming_messages[idx] = dtls1_hm_fragment_new(msg_hdr); + if (!ssl->d1->incoming_messages[idx]) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return NULL; + } + return ssl->d1->incoming_messages[idx].get(); +} + +ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + uint8_t type; + Span record; + auto ret = dtls_open_record(ssl, &type, &record, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + switch (type) { + case SSL3_RT_APPLICATION_DATA: + // Unencrypted application data records are always illegal. + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + // Out-of-order application data may be received between ChangeCipherSpec + // and finished. Discard it. + return ssl_open_record_discard; + + case SSL3_RT_CHANGE_CIPHER_SPEC: + // We do not support renegotiation, so encrypted ChangeCipherSpec records + // are illegal. + if (!ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (record.size() != 1u || record[0] != SSL3_MT_CCS) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + // Flag the ChangeCipherSpec for later. + ssl->d1->has_change_cipher_spec = true; + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_CHANGE_CIPHER_SPEC, + record); + return ssl_open_record_success; + + case SSL3_RT_HANDSHAKE: + // Break out to main processing. + break; + + default: + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + CBS cbs; + CBS_init(&cbs, record.data(), record.size()); + while (CBS_len(&cbs) > 0) { + // Read a handshake fragment. + struct hm_header_st msg_hdr; + CBS body; + if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HANDSHAKE_RECORD); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + const size_t frag_off = msg_hdr.frag_off; + const size_t frag_len = msg_hdr.frag_len; + const size_t msg_len = msg_hdr.msg_len; + if (frag_off > msg_len || frag_off + frag_len < frag_off || + frag_off + frag_len > msg_len || + msg_len > ssl_max_handshake_message_len(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + // The encrypted epoch in DTLS has only one handshake message. + if (ssl->d1->r_epoch == 1 && msg_hdr.seq != ssl->d1->handshake_read_seq) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (msg_hdr.seq < ssl->d1->handshake_read_seq || + msg_hdr.seq > + (unsigned)ssl->d1->handshake_read_seq + SSL_MAX_HANDSHAKE_FLIGHT) { + // Ignore fragments from the past, or ones too far in the future. + continue; + } + + hm_fragment *frag = dtls1_get_incoming_message(ssl, out_alert, &msg_hdr); + if (frag == NULL) { + return ssl_open_record_error; + } + assert(frag->msg_len == msg_len); + + if (frag->reassembly == NULL) { + // The message is already assembled. + continue; + } + assert(msg_len > 0); + + // Copy the body into the fragment. + OPENSSL_memcpy(frag->data + DTLS1_HM_HEADER_LENGTH + frag_off, + CBS_data(&body), CBS_len(&body)); + dtls1_hm_fragment_mark(frag, frag_off, frag_off + frag_len); + } + + return ssl_open_record_success; +} + +bool dtls1_get_message(const SSL *ssl, SSLMessage *out) { + if (!dtls1_is_current_message_complete(ssl)) { + return false; + } + + size_t idx = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + out->type = frag->type; + CBS_init(&out->body, frag->data + DTLS1_HM_HEADER_LENGTH, frag->msg_len); + CBS_init(&out->raw, frag->data, DTLS1_HM_HEADER_LENGTH + frag->msg_len); + out->is_v2_hello = false; + if (!ssl->s3->has_message) { + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HANDSHAKE, out->raw); + ssl->s3->has_message = true; + } + return true; +} + +void dtls1_next_message(SSL *ssl) { + assert(ssl->s3->has_message); + assert(dtls1_is_current_message_complete(ssl)); + size_t index = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + ssl->d1->incoming_messages[index].reset(); + ssl->d1->handshake_read_seq++; + ssl->s3->has_message = false; + // If we previously sent a flight, mark it as having a reply, so + // |on_handshake_complete| can manage post-handshake retransmission. + if (ssl->d1->outgoing_messages_complete) { + ssl->d1->flight_has_reply = true; + } +} + +bool dtls_has_unprocessed_handshake_data(const SSL *ssl) { + if (ssl->d1->has_change_cipher_spec) { + return true; + } + + size_t current = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + for (size_t i = 0; i < SSL_MAX_HANDSHAKE_FLIGHT; i++) { + // Skip the current message. + if (ssl->s3->has_message && i == current) { + assert(dtls1_is_current_message_complete(ssl)); + continue; + } + if (ssl->d1->incoming_messages[i] != nullptr) { + return true; + } + } + return false; +} + +bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, + CBS *out_body) { + OPENSSL_memset(out_hdr, 0x00, sizeof(struct hm_header_st)); + + if (!CBS_get_u8(cbs, &out_hdr->type) || + !CBS_get_u24(cbs, &out_hdr->msg_len) || + !CBS_get_u16(cbs, &out_hdr->seq) || + !CBS_get_u24(cbs, &out_hdr->frag_off) || + !CBS_get_u24(cbs, &out_hdr->frag_len) || + !CBS_get_bytes(cbs, out_body, out_hdr->frag_len)) { + return false; + } + + return true; +} + +ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + if (!ssl->d1->has_change_cipher_spec) { + // dtls1_open_handshake processes both handshake and ChangeCipherSpec. + auto ret = dtls1_open_handshake(ssl, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + } + if (ssl->d1->has_change_cipher_spec) { + ssl->d1->has_change_cipher_spec = false; + return ssl_open_record_success; + } + return ssl_open_record_discard; +} + + +// Sending handshake messages. + +void DTLS_OUTGOING_MESSAGE::Clear() { + OPENSSL_free(data); + data = nullptr; +} + +void dtls_clear_outgoing_messages(SSL *ssl) { + for (size_t i = 0; i < ssl->d1->outgoing_messages_len; i++) { + ssl->d1->outgoing_messages[i].Clear(); + } + ssl->d1->outgoing_messages_len = 0; + ssl->d1->outgoing_written = 0; + ssl->d1->outgoing_offset = 0; + ssl->d1->outgoing_messages_complete = false; + ssl->d1->flight_has_reply = false; +} + +bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { + // Pick a modest size hint to save most of the |realloc| calls. + if (!CBB_init(cbb, 64) || + !CBB_add_u8(cbb, type) || + !CBB_add_u24(cbb, 0 /* length (filled in later) */) || + !CBB_add_u16(cbb, ssl->d1->handshake_write_seq) || + !CBB_add_u24(cbb, 0 /* offset */) || + !CBB_add_u24_length_prefixed(cbb, body)) { + return false; + } + + return true; +} + +bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { + if (!CBBFinishArray(cbb, out_msg) || + out_msg->size() < DTLS1_HM_HEADER_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + // Fix up the header. Copy the fragment length into the total message + // length. + OPENSSL_memcpy(out_msg->data() + 1, + out_msg->data() + DTLS1_HM_HEADER_LENGTH - 3, 3); + return true; +} + +// ssl_size_t_greater_than_32_bits returns whether |v| exceeds the bounds of a +// 32-bit value. The obvious thing doesn't work because, in some 32-bit build +// configurations, the compiler warns that the test is always false and breaks +// the build. +static bool ssl_size_t_greater_than_32_bits(size_t v) { +#if defined(OPENSSL_64_BIT) + return v > 0xffffffff; +#elif defined(OPENSSL_32_BIT) + return false; +#else +#error "Building for neither 32- nor 64-bits." +#endif +} + +// add_outgoing adds a new handshake message or ChangeCipherSpec to the current +// outgoing flight. It returns true on success and false on error. +static bool add_outgoing(SSL *ssl, bool is_ccs, Array data) { + if (ssl->d1->outgoing_messages_complete) { + // If we've begun writing a new flight, we received the peer flight. Discard + // the timer and the our flight. + dtls1_stop_timer(ssl); + dtls_clear_outgoing_messages(ssl); + } + + static_assert(SSL_MAX_HANDSHAKE_FLIGHT < + (1 << 8 * sizeof(ssl->d1->outgoing_messages_len)), + "outgoing_messages_len is too small"); + if (ssl->d1->outgoing_messages_len >= SSL_MAX_HANDSHAKE_FLIGHT || + ssl_size_t_greater_than_32_bits(data.size())) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (!is_ccs) { + // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript + // on hs. + if (ssl->s3->hs != NULL && + !ssl->s3->hs->transcript.Update(data)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + ssl->d1->handshake_write_seq++; + } + + DTLS_OUTGOING_MESSAGE *msg = + &ssl->d1->outgoing_messages[ssl->d1->outgoing_messages_len]; + size_t len; + data.Release(&msg->data, &len); + msg->len = len; + msg->epoch = ssl->d1->w_epoch; + msg->is_ccs = is_ccs; + + ssl->d1->outgoing_messages_len++; + return true; +} + +bool dtls1_add_message(SSL *ssl, Array data) { + return add_outgoing(ssl, false /* handshake */, std::move(data)); +} + +bool dtls1_add_change_cipher_spec(SSL *ssl) { + return add_outgoing(ssl, true /* ChangeCipherSpec */, Array()); +} + +// dtls1_update_mtu updates the current MTU from the BIO, ensuring it is above +// the minimum. +static void dtls1_update_mtu(SSL *ssl) { + // TODO(davidben): No consumer implements |BIO_CTRL_DGRAM_SET_MTU| and the + // only |BIO_CTRL_DGRAM_QUERY_MTU| implementation could use + // |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.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.get(), BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); + } + } + + // The MTU should be above the minimum now. + assert(ssl->d1->mtu >= dtls1_min_mtu()); +} + +enum seal_result_t { + seal_error, + seal_no_progress, + seal_partial, + seal_success, +}; + +// seal_next_message seals |msg|, which must be the next message, to |out|. If +// progress was made, it returns |seal_partial| or |seal_success| and sets +// |*out_len| to the number of bytes written. +static enum seal_result_t seal_next_message(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out, + const DTLS_OUTGOING_MESSAGE *msg) { + assert(ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len); + assert(msg == &ssl->d1->outgoing_messages[ssl->d1->outgoing_written]); + + enum dtls1_use_epoch_t use_epoch = dtls1_use_current_epoch; + if (ssl->d1->w_epoch >= 1 && msg->epoch == ssl->d1->w_epoch - 1) { + use_epoch = dtls1_use_previous_epoch; + } else if (msg->epoch != ssl->d1->w_epoch) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + size_t overhead = dtls_max_seal_overhead(ssl, use_epoch); + size_t prefix = dtls_seal_prefix_len(ssl, use_epoch); + + if (msg->is_ccs) { + // Check there is room for the ChangeCipherSpec. + static const uint8_t kChangeCipherSpec[1] = {SSL3_MT_CCS}; + if (max_out < sizeof(kChangeCipherSpec) + overhead) { + return seal_no_progress; + } + + if (!dtls_seal_record(ssl, out, out_len, max_out, + SSL3_RT_CHANGE_CIPHER_SPEC, kChangeCipherSpec, + sizeof(kChangeCipherSpec), use_epoch)) { + return seal_error; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_CHANGE_CIPHER_SPEC, + kChangeCipherSpec); + return seal_success; + } + + // DTLS messages are serialized as a single fragment in |msg|. + CBS cbs, body; + struct hm_header_st hdr; + CBS_init(&cbs, msg->data, msg->len); + if (!dtls1_parse_fragment(&cbs, &hdr, &body) || + hdr.frag_off != 0 || + hdr.frag_len != CBS_len(&body) || + hdr.msg_len != CBS_len(&body) || + !CBS_skip(&body, ssl->d1->outgoing_offset) || + CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + // Determine how much progress can be made. + if (max_out < DTLS1_HM_HEADER_LENGTH + 1 + overhead || max_out < prefix) { + return seal_no_progress; + } + size_t todo = CBS_len(&body); + if (todo > max_out - DTLS1_HM_HEADER_LENGTH - overhead) { + todo = max_out - DTLS1_HM_HEADER_LENGTH - overhead; + } + + // Assemble a fragment, to be sealed in-place. + ScopedCBB cbb; + uint8_t *frag = out + prefix; + size_t max_frag = max_out - prefix, frag_len; + if (!CBB_init_fixed(cbb.get(), frag, max_frag) || + !CBB_add_u8(cbb.get(), hdr.type) || + !CBB_add_u24(cbb.get(), hdr.msg_len) || + !CBB_add_u16(cbb.get(), hdr.seq) || + !CBB_add_u24(cbb.get(), ssl->d1->outgoing_offset) || + !CBB_add_u24(cbb.get(), todo) || + !CBB_add_bytes(cbb.get(), CBS_data(&body), todo) || + !CBB_finish(cbb.get(), NULL, &frag_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, + MakeSpan(frag, frag_len)); + + if (!dtls_seal_record(ssl, out, out_len, max_out, SSL3_RT_HANDSHAKE, + out + prefix, frag_len, use_epoch)) { + return seal_error; + } + + if (todo == CBS_len(&body)) { + // The next message is complete. + ssl->d1->outgoing_offset = 0; + return seal_success; + } + + ssl->d1->outgoing_offset += todo; + return seal_partial; +} + +// seal_next_packet writes as much of the next flight as possible to |out| and +// advances |ssl->d1->outgoing_written| and |ssl->d1->outgoing_offset| as +// appropriate. +static bool seal_next_packet(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out) { + bool made_progress = false; + size_t total = 0; + assert(ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len); + for (; ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len; + ssl->d1->outgoing_written++) { + const DTLS_OUTGOING_MESSAGE *msg = + &ssl->d1->outgoing_messages[ssl->d1->outgoing_written]; + size_t len; + enum seal_result_t ret = seal_next_message(ssl, out, &len, max_out, msg); + switch (ret) { + case seal_error: + return false; + + case seal_no_progress: + goto packet_full; + + case seal_partial: + case seal_success: + out += len; + max_out -= len; + total += len; + made_progress = true; + + if (ret == seal_partial) { + goto packet_full; + } + break; + } + } + +packet_full: + // The MTU was too small to make any progress. + if (!made_progress) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MTU_TOO_SMALL); + return false; + } + + *out_len = total; + return true; +} + +static int send_flight(SSL *ssl) { + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + dtls1_update_mtu(ssl); + + int ret = -1; + uint8_t *packet = (uint8_t *)OPENSSL_malloc(ssl->d1->mtu); + if (packet == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + while (ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len) { + uint8_t old_written = ssl->d1->outgoing_written; + uint32_t old_offset = ssl->d1->outgoing_offset; + + size_t packet_len; + if (!seal_next_packet(ssl, packet, &packet_len, ssl->d1->mtu)) { + goto err; + } + + 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_ERROR_WANT_WRITE; + ret = bio_ret; + goto err; + } + } + + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + goto err; + } + + ret = 1; + +err: + OPENSSL_free(packet); + return ret; +} + +int dtls1_flush_flight(SSL *ssl) { + ssl->d1->outgoing_messages_complete = true; + // Start the retransmission timer for the next flight (if any). + dtls1_start_timer(ssl); + return send_flight(ssl); +} + +int dtls1_retransmit_outgoing_messages(SSL *ssl) { + // Rewind to the start of the flight and write it again. + // + // TODO(davidben): This does not allow retransmits to be resumed on + // non-blocking write. + ssl->d1->outgoing_written = 0; + ssl->d1->outgoing_offset = 0; + + return send_flight(ssl); +} + +unsigned int dtls1_min_mtu(void) { + return kMinMTU; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back new file mode 100644 index 0000000..2b652d1 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back @@ -0,0 +1,841 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * 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 (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 "../crypto/internal.h" +#include "internal.h" + + +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 +// protocol's overhead rather than, say, what's needed to hold a minimally-sized +// handshake fragment plus protocol overhead. + +// kMinMTU is the minimum acceptable MTU value. +static const unsigned int kMinMTU = 256 - 28; + +// kDefaultMTU is the default MTU value to use if neither the user nor +// the underlying BIO supplies one. +static const unsigned int kDefaultMTU = 1500 - 28; + + +// Receiving handshake messages. + +hm_fragment::~hm_fragment() { + OPENSSL_free(data); + OPENSSL_free(reassembly); +} + +static UniquePtr dtls1_hm_fragment_new( + const struct hm_header_st *msg_hdr) { + ScopedCBB cbb; + UniquePtr frag = MakeUnique(); + if (!frag) { + return nullptr; + } + frag->type = msg_hdr->type; + frag->seq = msg_hdr->seq; + frag->msg_len = msg_hdr->msg_len; + + // Allocate space for the reassembled message and fill in the header. + frag->data = + (uint8_t *)OPENSSL_malloc(DTLS1_HM_HEADER_LENGTH + msg_hdr->msg_len); + if (frag->data == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || + !CBB_add_u8(cbb.get(), msg_hdr->type) || + !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || + !CBB_add_u16(cbb.get(), msg_hdr->seq) || + !CBB_add_u24(cbb.get(), 0 /* frag_off */) || + !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || + !CBB_finish(cbb.get(), NULL, NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + // If the handshake message is empty, |frag->reassembly| is NULL. + if (msg_hdr->msg_len > 0) { + // Initialize reassembly bitmask. + if (msg_hdr->msg_len + 7 < msg_hdr->msg_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return nullptr; + } + size_t bitmask_len = (msg_hdr->msg_len + 7) / 8; + frag->reassembly = (uint8_t *)OPENSSL_malloc(bitmask_len); + if (frag->reassembly == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + OPENSSL_memset(frag->reassembly, 0, bitmask_len); + } + + return frag; +} + +// bit_range returns a |uint8_t| with bits |start|, inclusive, to |end|, +// exclusive, set. +static uint8_t bit_range(size_t start, size_t end) { + return (uint8_t)(~((1u << start) - 1) & ((1u << end) - 1)); +} + +// dtls1_hm_fragment_mark marks bytes |start|, inclusive, to |end|, exclusive, +// as received in |frag|. If |frag| becomes complete, it clears +// |frag->reassembly|. The range must be within the bounds of |frag|'s message +// and |frag->reassembly| must not be NULL. +static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start, + size_t end) { + size_t msg_len = frag->msg_len; + + if (frag->reassembly == NULL || start > end || end > msg_len) { + assert(0); + return; + } + // A zero-length message will never have a pending reassembly. + assert(msg_len > 0); + + if (start == end) { + return; + } + + if ((start >> 3) == (end >> 3)) { + frag->reassembly[start >> 3] |= bit_range(start & 7, end & 7); + } else { + frag->reassembly[start >> 3] |= bit_range(start & 7, 8); + for (size_t i = (start >> 3) + 1; i < (end >> 3); i++) { + frag->reassembly[i] = 0xff; + } + if ((end & 7) != 0) { + frag->reassembly[end >> 3] |= bit_range(0, end & 7); + } + } + + // Check if the fragment is complete. + for (size_t i = 0; i < (msg_len >> 3); i++) { + if (frag->reassembly[i] != 0xff) { + return; + } + } + if ((msg_len & 7) != 0 && + frag->reassembly[msg_len >> 3] != bit_range(0, msg_len & 7)) { + return; + } + + OPENSSL_free(frag->reassembly); + frag->reassembly = NULL; +} + +// dtls1_is_current_message_complete returns whether the current handshake +// message is complete. +static bool dtls1_is_current_message_complete(const SSL *ssl) { + size_t idx = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + return frag != NULL && frag->reassembly == NULL; +} + +// dtls1_get_incoming_message returns the incoming message corresponding to +// |msg_hdr|. If none exists, it creates a new one and inserts it in the +// queue. Otherwise, it checks |msg_hdr| is consistent with the existing one. It +// returns NULL on failure. The caller does not take ownership of the result. +static hm_fragment *dtls1_get_incoming_message( + SSL *ssl, uint8_t *out_alert, const struct hm_header_st *msg_hdr) { + if (msg_hdr->seq < ssl->d1->handshake_read_seq || + msg_hdr->seq - ssl->d1->handshake_read_seq >= SSL_MAX_HANDSHAKE_FLIGHT) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return NULL; + } + + size_t idx = msg_hdr->seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + if (frag != NULL) { + assert(frag->seq == msg_hdr->seq); + // The new fragment must be compatible with the previous fragments from this + // message. + if (frag->type != msg_hdr->type || + frag->msg_len != msg_hdr->msg_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_FRAGMENT_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return NULL; + } + return frag; + } + + // This is the first fragment from this message. + ssl->d1->incoming_messages[idx] = dtls1_hm_fragment_new(msg_hdr); + if (!ssl->d1->incoming_messages[idx]) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return NULL; + } + return ssl->d1->incoming_messages[idx].get(); +} + +ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + uint8_t type; + Span record; + auto ret = dtls_open_record(ssl, &type, &record, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + switch (type) { + case SSL3_RT_APPLICATION_DATA: + // Unencrypted application data records are always illegal. + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + // Out-of-order application data may be received between ChangeCipherSpec + // and finished. Discard it. + return ssl_open_record_discard; + + case SSL3_RT_CHANGE_CIPHER_SPEC: + // We do not support renegotiation, so encrypted ChangeCipherSpec records + // are illegal. + if (!ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (record.size() != 1u || record[0] != SSL3_MT_CCS) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + // Flag the ChangeCipherSpec for later. + ssl->d1->has_change_cipher_spec = true; + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_CHANGE_CIPHER_SPEC, + record); + return ssl_open_record_success; + + case SSL3_RT_HANDSHAKE: + // Break out to main processing. + break; + + default: + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + CBS cbs; + CBS_init(&cbs, record.data(), record.size()); + while (CBS_len(&cbs) > 0) { + // Read a handshake fragment. + struct hm_header_st msg_hdr; + CBS body; + if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HANDSHAKE_RECORD); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + const size_t frag_off = msg_hdr.frag_off; + const size_t frag_len = msg_hdr.frag_len; + const size_t msg_len = msg_hdr.msg_len; + if (frag_off > msg_len || frag_off + frag_len < frag_off || + frag_off + frag_len > msg_len || + msg_len > ssl_max_handshake_message_len(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + // The encrypted epoch in DTLS has only one handshake message. + if (ssl->d1->r_epoch == 1 && msg_hdr.seq != ssl->d1->handshake_read_seq) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (msg_hdr.seq < ssl->d1->handshake_read_seq || + msg_hdr.seq > + (unsigned)ssl->d1->handshake_read_seq + SSL_MAX_HANDSHAKE_FLIGHT) { + // Ignore fragments from the past, or ones too far in the future. + continue; + } + + hm_fragment *frag = dtls1_get_incoming_message(ssl, out_alert, &msg_hdr); + if (frag == NULL) { + return ssl_open_record_error; + } + assert(frag->msg_len == msg_len); + + if (frag->reassembly == NULL) { + // The message is already assembled. + continue; + } + assert(msg_len > 0); + + // Copy the body into the fragment. + OPENSSL_memcpy(frag->data + DTLS1_HM_HEADER_LENGTH + frag_off, + CBS_data(&body), CBS_len(&body)); + dtls1_hm_fragment_mark(frag, frag_off, frag_off + frag_len); + } + + return ssl_open_record_success; +} + +bool dtls1_get_message(const SSL *ssl, SSLMessage *out) { + if (!dtls1_is_current_message_complete(ssl)) { + return false; + } + + size_t idx = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); + out->type = frag->type; + CBS_init(&out->body, frag->data + DTLS1_HM_HEADER_LENGTH, frag->msg_len); + CBS_init(&out->raw, frag->data, DTLS1_HM_HEADER_LENGTH + frag->msg_len); + out->is_v2_hello = false; + if (!ssl->s3->has_message) { + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HANDSHAKE, out->raw); + ssl->s3->has_message = true; + } + return true; +} + +void dtls1_next_message(SSL *ssl) { + assert(ssl->s3->has_message); + assert(dtls1_is_current_message_complete(ssl)); + size_t index = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + ssl->d1->incoming_messages[index].reset(); + ssl->d1->handshake_read_seq++; + ssl->s3->has_message = false; + // If we previously sent a flight, mark it as having a reply, so + // |on_handshake_complete| can manage post-handshake retransmission. + if (ssl->d1->outgoing_messages_complete) { + ssl->d1->flight_has_reply = true; + } +} + +bool dtls_has_unprocessed_handshake_data(const SSL *ssl) { + if (ssl->d1->has_change_cipher_spec) { + return true; + } + + size_t current = ssl->d1->handshake_read_seq % SSL_MAX_HANDSHAKE_FLIGHT; + for (size_t i = 0; i < SSL_MAX_HANDSHAKE_FLIGHT; i++) { + // Skip the current message. + if (ssl->s3->has_message && i == current) { + assert(dtls1_is_current_message_complete(ssl)); + continue; + } + if (ssl->d1->incoming_messages[i] != nullptr) { + return true; + } + } + return false; +} + +bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, + CBS *out_body) { + OPENSSL_memset(out_hdr, 0x00, sizeof(struct hm_header_st)); + + if (!CBS_get_u8(cbs, &out_hdr->type) || + !CBS_get_u24(cbs, &out_hdr->msg_len) || + !CBS_get_u16(cbs, &out_hdr->seq) || + !CBS_get_u24(cbs, &out_hdr->frag_off) || + !CBS_get_u24(cbs, &out_hdr->frag_len) || + !CBS_get_bytes(cbs, out_body, out_hdr->frag_len)) { + return false; + } + + return true; +} + +ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + if (!ssl->d1->has_change_cipher_spec) { + // dtls1_open_handshake processes both handshake and ChangeCipherSpec. + auto ret = dtls1_open_handshake(ssl, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + } + if (ssl->d1->has_change_cipher_spec) { + ssl->d1->has_change_cipher_spec = false; + return ssl_open_record_success; + } + return ssl_open_record_discard; +} + + +// Sending handshake messages. + +void DTLS_OUTGOING_MESSAGE::Clear() { + OPENSSL_free(data); + data = nullptr; +} + +void dtls_clear_outgoing_messages(SSL *ssl) { + for (size_t i = 0; i < ssl->d1->outgoing_messages_len; i++) { + ssl->d1->outgoing_messages[i].Clear(); + } + ssl->d1->outgoing_messages_len = 0; + ssl->d1->outgoing_written = 0; + ssl->d1->outgoing_offset = 0; + ssl->d1->outgoing_messages_complete = false; + ssl->d1->flight_has_reply = false; +} + +bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { + // Pick a modest size hint to save most of the |realloc| calls. + if (!CBB_init(cbb, 64) || + !CBB_add_u8(cbb, type) || + !CBB_add_u24(cbb, 0 /* length (filled in later) */) || + !CBB_add_u16(cbb, ssl->d1->handshake_write_seq) || + !CBB_add_u24(cbb, 0 /* offset */) || + !CBB_add_u24_length_prefixed(cbb, body)) { + return false; + } + + return true; +} + +bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { + if (!CBBFinishArray(cbb, out_msg) || + out_msg->size() < DTLS1_HM_HEADER_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + // Fix up the header. Copy the fragment length into the total message + // length. + OPENSSL_memcpy(out_msg->data() + 1, + out_msg->data() + DTLS1_HM_HEADER_LENGTH - 3, 3); + return true; +} + +// ssl_size_t_greater_than_32_bits returns whether |v| exceeds the bounds of a +// 32-bit value. The obvious thing doesn't work because, in some 32-bit build +// configurations, the compiler warns that the test is always false and breaks +// the build. +static bool ssl_size_t_greater_than_32_bits(size_t v) { +#if defined(OPENSSL_64_BIT) + return v > 0xffffffff; +#elif defined(OPENSSL_32_BIT) + return false; +#else +#error "Building for neither 32- nor 64-bits." +#endif +} + +// add_outgoing adds a new handshake message or ChangeCipherSpec to the current +// outgoing flight. It returns true on success and false on error. +static bool add_outgoing(SSL *ssl, bool is_ccs, Array data) { + if (ssl->d1->outgoing_messages_complete) { + // If we've begun writing a new flight, we received the peer flight. Discard + // the timer and the our flight. + dtls1_stop_timer(ssl); + dtls_clear_outgoing_messages(ssl); + } + + static_assert(SSL_MAX_HANDSHAKE_FLIGHT < + (1 << 8 * sizeof(ssl->d1->outgoing_messages_len)), + "outgoing_messages_len is too small"); + if (ssl->d1->outgoing_messages_len >= SSL_MAX_HANDSHAKE_FLIGHT || + ssl_size_t_greater_than_32_bits(data.size())) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (!is_ccs) { + // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript + // on hs. + if (ssl->s3->hs != NULL && + !ssl->s3->hs->transcript.Update(data)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + ssl->d1->handshake_write_seq++; + } + + DTLS_OUTGOING_MESSAGE *msg = + &ssl->d1->outgoing_messages[ssl->d1->outgoing_messages_len]; + size_t len; + data.Release(&msg->data, &len); + msg->len = len; + msg->epoch = ssl->d1->w_epoch; + msg->is_ccs = is_ccs; + + ssl->d1->outgoing_messages_len++; + return true; +} + +bool dtls1_add_message(SSL *ssl, Array data) { + return add_outgoing(ssl, false /* handshake */, std::move(data)); +} + +bool dtls1_add_change_cipher_spec(SSL *ssl) { + return add_outgoing(ssl, true /* ChangeCipherSpec */, Array()); +} + +// dtls1_update_mtu updates the current MTU from the BIO, ensuring it is above +// the minimum. +static void dtls1_update_mtu(SSL *ssl) { + // TODO(davidben): No consumer implements |BIO_CTRL_DGRAM_SET_MTU| and the + // only |BIO_CTRL_DGRAM_QUERY_MTU| implementation could use + // |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.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.get(), BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); + } + } + + // The MTU should be above the minimum now. + assert(ssl->d1->mtu >= dtls1_min_mtu()); +} + +enum seal_result_t { + seal_error, + seal_no_progress, + seal_partial, + seal_success, +}; + +// seal_next_message seals |msg|, which must be the next message, to |out|. If +// progress was made, it returns |seal_partial| or |seal_success| and sets +// |*out_len| to the number of bytes written. +static enum seal_result_t seal_next_message(SSL *ssl, uint8_t *out, + size_t *out_len, size_t max_out, + const DTLS_OUTGOING_MESSAGE *msg) { + assert(ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len); + assert(msg == &ssl->d1->outgoing_messages[ssl->d1->outgoing_written]); + + enum dtls1_use_epoch_t use_epoch = dtls1_use_current_epoch; + if (ssl->d1->w_epoch >= 1 && msg->epoch == ssl->d1->w_epoch - 1) { + use_epoch = dtls1_use_previous_epoch; + } else if (msg->epoch != ssl->d1->w_epoch) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + size_t overhead = dtls_max_seal_overhead(ssl, use_epoch); + size_t prefix = dtls_seal_prefix_len(ssl, use_epoch); + + if (msg->is_ccs) { + // Check there is room for the ChangeCipherSpec. + static const uint8_t kChangeCipherSpec[1] = {SSL3_MT_CCS}; + if (max_out < sizeof(kChangeCipherSpec) + overhead) { + return seal_no_progress; + } + + if (!dtls_seal_record(ssl, out, out_len, max_out, + SSL3_RT_CHANGE_CIPHER_SPEC, kChangeCipherSpec, + sizeof(kChangeCipherSpec), use_epoch)) { + return seal_error; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_CHANGE_CIPHER_SPEC, + kChangeCipherSpec); + return seal_success; + } + + // DTLS messages are serialized as a single fragment in |msg|. + CBS cbs, body; + struct hm_header_st hdr; + CBS_init(&cbs, msg->data, msg->len); + if (!dtls1_parse_fragment(&cbs, &hdr, &body) || + hdr.frag_off != 0 || + hdr.frag_len != CBS_len(&body) || + hdr.msg_len != CBS_len(&body) || + !CBS_skip(&body, ssl->d1->outgoing_offset) || + CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + // Determine how much progress can be made. + if (max_out < DTLS1_HM_HEADER_LENGTH + 1 + overhead || max_out < prefix) { + return seal_no_progress; + } + size_t todo = CBS_len(&body); + if (todo > max_out - DTLS1_HM_HEADER_LENGTH - overhead) { + todo = max_out - DTLS1_HM_HEADER_LENGTH - overhead; + } + + // Assemble a fragment, to be sealed in-place. + ScopedCBB cbb; + uint8_t *frag = out + prefix; + size_t max_frag = max_out - prefix, frag_len; + if (!CBB_init_fixed(cbb.get(), frag, max_frag) || + !CBB_add_u8(cbb.get(), hdr.type) || + !CBB_add_u24(cbb.get(), hdr.msg_len) || + !CBB_add_u16(cbb.get(), hdr.seq) || + !CBB_add_u24(cbb.get(), ssl->d1->outgoing_offset) || + !CBB_add_u24(cbb.get(), todo) || + !CBB_add_bytes(cbb.get(), CBS_data(&body), todo) || + !CBB_finish(cbb.get(), NULL, &frag_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return seal_error; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, + MakeSpan(frag, frag_len)); + + if (!dtls_seal_record(ssl, out, out_len, max_out, SSL3_RT_HANDSHAKE, + out + prefix, frag_len, use_epoch)) { + return seal_error; + } + + if (todo == CBS_len(&body)) { + // The next message is complete. + ssl->d1->outgoing_offset = 0; + return seal_success; + } + + ssl->d1->outgoing_offset += todo; + return seal_partial; +} + +// seal_next_packet writes as much of the next flight as possible to |out| and +// advances |ssl->d1->outgoing_written| and |ssl->d1->outgoing_offset| as +// appropriate. +static bool seal_next_packet(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out) { + bool made_progress = false; + size_t total = 0; + assert(ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len); + for (; ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len; + ssl->d1->outgoing_written++) { + const DTLS_OUTGOING_MESSAGE *msg = + &ssl->d1->outgoing_messages[ssl->d1->outgoing_written]; + size_t len; + enum seal_result_t ret = seal_next_message(ssl, out, &len, max_out, msg); + switch (ret) { + case seal_error: + return false; + + case seal_no_progress: + goto packet_full; + + case seal_partial: + case seal_success: + out += len; + max_out -= len; + total += len; + made_progress = true; + + if (ret == seal_partial) { + goto packet_full; + } + break; + } + } + +packet_full: + // The MTU was too small to make any progress. + if (!made_progress) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MTU_TOO_SMALL); + return false; + } + + *out_len = total; + return true; +} + +static int send_flight(SSL *ssl) { + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + dtls1_update_mtu(ssl); + + int ret = -1; + uint8_t *packet = (uint8_t *)OPENSSL_malloc(ssl->d1->mtu); + if (packet == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + while (ssl->d1->outgoing_written < ssl->d1->outgoing_messages_len) { + uint8_t old_written = ssl->d1->outgoing_written; + uint32_t old_offset = ssl->d1->outgoing_offset; + + size_t packet_len; + if (!seal_next_packet(ssl, packet, &packet_len, ssl->d1->mtu)) { + goto err; + } + + 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_ERROR_WANT_WRITE; + ret = bio_ret; + goto err; + } + } + + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + goto err; + } + + ret = 1; + +err: + OPENSSL_free(packet); + return ret; +} + +int dtls1_flush_flight(SSL *ssl) { + ssl->d1->outgoing_messages_complete = true; + // Start the retransmission timer for the next flight (if any). + dtls1_start_timer(ssl); + return send_flight(ssl); +} + +int dtls1_retransmit_outgoing_messages(SSL *ssl) { + // Rewind to the start of the flight and write it again. + // + // TODO(davidben): This does not allow retransmits to be resumed on + // non-blocking write. + ssl->d1->outgoing_written = 0; + ssl->d1->outgoing_offset = 0; + + return send_flight(ssl); +} + +unsigned int dtls1_min_mtu(void) { + return kMinMTU; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc new file mode 100644 index 0000000..1180153 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc @@ -0,0 +1,268 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// DTLS1_MTU_TIMEOUTS is the maximum number of timeouts to expire +// before starting to decrease the MTU. +#define DTLS1_MTU_TIMEOUTS 2 + +// DTLS1_MAX_TIMEOUTS is the maximum number of timeouts to expire +// before failing the DTLS handshake. +#define DTLS1_MAX_TIMEOUTS 12 + +DTLS1_STATE::DTLS1_STATE() + : has_change_cipher_spec(false), + outgoing_messages_complete(false), + flight_has_reply(false) {} + +DTLS1_STATE::~DTLS1_STATE() {} + +bool dtls1_new(SSL *ssl) { + if (!ssl3_new(ssl)) { + return false; + } + UniquePtr d1 = MakeUnique(); + if (!d1) { + ssl3_free(ssl); + return false; + } + + ssl->d1 = d1.release(); + + // Set the version to the highest supported version. + // + // TODO(davidben): Move this field into |s3|, have it store the normalized + // protocol version, and implement this pre-negotiation quirk in |SSL_version| + // at the API boundary rather than in internal state. + ssl->version = DTLS1_2_VERSION; + return true; +} + +void dtls1_free(SSL *ssl) { + ssl3_free(ssl); + + if (ssl == NULL) { + return; + } + + Delete(ssl->d1); + ssl->d1 = NULL; +} + +void dtls1_start_timer(SSL *ssl) { + // If timer is not set, initialize duration (by default, 1 second) + if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { + ssl->d1->timeout_duration_ms = ssl->initial_timeout_duration_ms; + } + + // Set timeout to current time + ssl_get_current_time(ssl, &ssl->d1->next_timeout); + + // Add duration to current time + ssl->d1->next_timeout.tv_sec += ssl->d1->timeout_duration_ms / 1000; + ssl->d1->next_timeout.tv_usec += (ssl->d1->timeout_duration_ms % 1000) * 1000; + if (ssl->d1->next_timeout.tv_usec >= 1000000) { + ssl->d1->next_timeout.tv_sec++; + ssl->d1->next_timeout.tv_usec -= 1000000; + } +} + +bool dtls1_is_timer_expired(SSL *ssl) { + struct timeval timeleft; + + // Get time left until timeout, return false if no timer running + if (!DTLSv1_get_timeout(ssl, &timeleft)) { + return false; + } + + // Return false if timer is not expired yet + if (timeleft.tv_sec > 0 || timeleft.tv_usec > 0) { + return false; + } + + // Timer expired, so return true + return true; +} + +static void dtls1_double_timeout(SSL *ssl) { + ssl->d1->timeout_duration_ms *= 2; + if (ssl->d1->timeout_duration_ms > 60000) { + ssl->d1->timeout_duration_ms = 60000; + } +} + +void dtls1_stop_timer(SSL *ssl) { + ssl->d1->num_timeouts = 0; + OPENSSL_memset(&ssl->d1->next_timeout, 0, sizeof(ssl->d1->next_timeout)); + ssl->d1->timeout_duration_ms = ssl->initial_timeout_duration_ms; +} + +bool dtls1_check_timeout_num(SSL *ssl) { + ssl->d1->num_timeouts++; + + // 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.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; + } + } + + if (ssl->d1->num_timeouts > DTLS1_MAX_TIMEOUTS) { + // fail the connection, enough alerts have been sent + OPENSSL_PUT_ERROR(SSL, SSL_R_READ_TIMEOUT_EXPIRED); + return false; + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +void DTLSv1_set_initial_timeout_duration(SSL *ssl, unsigned int duration_ms) { + ssl->initial_timeout_duration_ms = duration_ms; +} + +int DTLSv1_get_timeout(const SSL *ssl, struct timeval *out) { + if (!SSL_is_dtls(ssl)) { + return 0; + } + + // If no timeout is set, just return 0. + if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { + return 0; + } + + struct OPENSSL_timeval timenow; + ssl_get_current_time(ssl, &timenow); + + // If timer already expired, set remaining time to 0. + if (ssl->d1->next_timeout.tv_sec < timenow.tv_sec || + (ssl->d1->next_timeout.tv_sec == timenow.tv_sec && + ssl->d1->next_timeout.tv_usec <= timenow.tv_usec)) { + OPENSSL_memset(out, 0, sizeof(*out)); + return 1; + } + + // Calculate time left until timer expires. + struct OPENSSL_timeval ret; + OPENSSL_memcpy(&ret, &ssl->d1->next_timeout, sizeof(ret)); + ret.tv_sec -= timenow.tv_sec; + if (ret.tv_usec >= timenow.tv_usec) { + ret.tv_usec -= timenow.tv_usec; + } else { + ret.tv_usec = 1000000 + ret.tv_usec - timenow.tv_usec; + ret.tv_sec--; + } + + // If remaining time is less than 15 ms, set it to 0 to prevent issues + // because of small divergences with socket timeouts. + if (ret.tv_sec == 0 && ret.tv_usec < 15000) { + OPENSSL_memset(&ret, 0, sizeof(ret)); + } + + // Clamp the result in case of overflow. + if (ret.tv_sec > INT_MAX) { + assert(0); + out->tv_sec = INT_MAX; + } else { + out->tv_sec = ret.tv_sec; + } + + out->tv_usec = ret.tv_usec; + return 1; +} + +int DTLSv1_handle_timeout(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (!SSL_is_dtls(ssl)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return -1; + } + + // If no timer is expired, don't do anything. + if (!dtls1_is_timer_expired(ssl)) { + return 0; + } + + if (!dtls1_check_timeout_num(ssl)) { + return -1; + } + + dtls1_double_timeout(ssl); + dtls1_start_timer(ssl); + return dtls1_retransmit_outgoing_messages(ssl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back new file mode 100644 index 0000000..0e0b211 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back @@ -0,0 +1,268 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// DTLS1_MTU_TIMEOUTS is the maximum number of timeouts to expire +// before starting to decrease the MTU. +#define DTLS1_MTU_TIMEOUTS 2 + +// DTLS1_MAX_TIMEOUTS is the maximum number of timeouts to expire +// before failing the DTLS handshake. +#define DTLS1_MAX_TIMEOUTS 12 + +DTLS1_STATE::DTLS1_STATE() + : has_change_cipher_spec(false), + outgoing_messages_complete(false), + flight_has_reply(false) {} + +DTLS1_STATE::~DTLS1_STATE() {} + +bool dtls1_new(SSL *ssl) { + if (!ssl3_new(ssl)) { + return false; + } + UniquePtr d1 = MakeUnique(); + if (!d1) { + ssl3_free(ssl); + return false; + } + + ssl->d1 = d1.release(); + + // Set the version to the highest supported version. + // + // TODO(davidben): Move this field into |s3|, have it store the normalized + // protocol version, and implement this pre-negotiation quirk in |SSL_version| + // at the API boundary rather than in internal state. + ssl->version = DTLS1_2_VERSION; + return true; +} + +void dtls1_free(SSL *ssl) { + ssl3_free(ssl); + + if (ssl == NULL) { + return; + } + + Delete(ssl->d1); + ssl->d1 = NULL; +} + +void dtls1_start_timer(SSL *ssl) { + // If timer is not set, initialize duration (by default, 1 second) + if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { + ssl->d1->timeout_duration_ms = ssl->initial_timeout_duration_ms; + } + + // Set timeout to current time + ssl_get_current_time(ssl, &ssl->d1->next_timeout); + + // Add duration to current time + ssl->d1->next_timeout.tv_sec += ssl->d1->timeout_duration_ms / 1000; + ssl->d1->next_timeout.tv_usec += (ssl->d1->timeout_duration_ms % 1000) * 1000; + if (ssl->d1->next_timeout.tv_usec >= 1000000) { + ssl->d1->next_timeout.tv_sec++; + ssl->d1->next_timeout.tv_usec -= 1000000; + } +} + +bool dtls1_is_timer_expired(SSL *ssl) { + struct timeval timeleft; + + // Get time left until timeout, return false if no timer running + if (!DTLSv1_get_timeout(ssl, &timeleft)) { + return false; + } + + // Return false if timer is not expired yet + if (timeleft.tv_sec > 0 || timeleft.tv_usec > 0) { + return false; + } + + // Timer expired, so return true + return true; +} + +static void dtls1_double_timeout(SSL *ssl) { + ssl->d1->timeout_duration_ms *= 2; + if (ssl->d1->timeout_duration_ms > 60000) { + ssl->d1->timeout_duration_ms = 60000; + } +} + +void dtls1_stop_timer(SSL *ssl) { + ssl->d1->num_timeouts = 0; + OPENSSL_memset(&ssl->d1->next_timeout, 0, sizeof(ssl->d1->next_timeout)); + ssl->d1->timeout_duration_ms = ssl->initial_timeout_duration_ms; +} + +bool dtls1_check_timeout_num(SSL *ssl) { + ssl->d1->num_timeouts++; + + // 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.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; + } + } + + if (ssl->d1->num_timeouts > DTLS1_MAX_TIMEOUTS) { + // fail the connection, enough alerts have been sent + OPENSSL_PUT_ERROR(SSL, SSL_R_READ_TIMEOUT_EXPIRED); + return false; + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +void DTLSv1_set_initial_timeout_duration(SSL *ssl, unsigned int duration_ms) { + ssl->initial_timeout_duration_ms = duration_ms; +} + +int DTLSv1_get_timeout(const SSL *ssl, struct timeval *out) { + if (!SSL_is_dtls(ssl)) { + return 0; + } + + // If no timeout is set, just return 0. + if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { + return 0; + } + + struct OPENSSL_timeval timenow; + ssl_get_current_time(ssl, &timenow); + + // If timer already expired, set remaining time to 0. + if (ssl->d1->next_timeout.tv_sec < timenow.tv_sec || + (ssl->d1->next_timeout.tv_sec == timenow.tv_sec && + ssl->d1->next_timeout.tv_usec <= timenow.tv_usec)) { + OPENSSL_memset(out, 0, sizeof(*out)); + return 1; + } + + // Calculate time left until timer expires. + struct OPENSSL_timeval ret; + OPENSSL_memcpy(&ret, &ssl->d1->next_timeout, sizeof(ret)); + ret.tv_sec -= timenow.tv_sec; + if (ret.tv_usec >= timenow.tv_usec) { + ret.tv_usec -= timenow.tv_usec; + } else { + ret.tv_usec = 1000000 + ret.tv_usec - timenow.tv_usec; + ret.tv_sec--; + } + + // If remaining time is less than 15 ms, set it to 0 to prevent issues + // because of small divergences with socket timeouts. + if (ret.tv_sec == 0 && ret.tv_usec < 15000) { + OPENSSL_memset(&ret, 0, sizeof(ret)); + } + + // Clamp the result in case of overflow. + if (ret.tv_sec > INT_MAX) { + assert(0); + out->tv_sec = INT_MAX; + } else { + out->tv_sec = ret.tv_sec; + } + + out->tv_usec = ret.tv_usec; + return 1; +} + +int DTLSv1_handle_timeout(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (!SSL_is_dtls(ssl)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return -1; + } + + // If no timer is expired, don't do anything. + if (!dtls1_is_timer_expired(ssl)) { + return 0; + } + + if (!dtls1_check_timeout_num(ssl)) { + return -1; + } + + dtls1_double_timeout(ssl); + dtls1_start_timer(ssl); + return dtls1_retransmit_outgoing_messages(ssl); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc new file mode 100644 index 0000000..a34e951 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc @@ -0,0 +1,273 @@ +/* DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. */ +/* ==================================================================== + * 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 (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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + assert(!SSL_in_init(ssl)); + + uint8_t type; + Span record; + auto ret = dtls_open_record(ssl, &type, &record, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + if (type == SSL3_RT_HANDSHAKE) { + // Parse the first fragment header to determine if this is a pre-CCS or + // post-CCS handshake record. DTLS resets handshake message numbers on each + // handshake, so renegotiations and retransmissions are ambiguous. + CBS cbs, body; + struct hm_header_st msg_hdr; + CBS_init(&cbs, record.data(), record.size()); + if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HANDSHAKE_RECORD); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + if (msg_hdr.type == SSL3_MT_FINISHED && + msg_hdr.seq == ssl->d1->handshake_read_seq - 1) { + if (msg_hdr.frag_off == 0) { + // Retransmit our last flight of messages. If the peer sends the second + // Finished, they may not have received ours. Only do this for the + // first fragment, in case the Finished was fragmented. + if (!dtls1_check_timeout_num(ssl)) { + *out_alert = 0; // TODO(davidben): Send an alert? + return ssl_open_record_error; + } + + dtls1_retransmit_outgoing_messages(ssl); + } + return ssl_open_record_discard; + } + + // Otherwise, this is a pre-CCS handshake message from an unsupported + // renegotiation attempt. Fall through to the error path. + } + + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (record.empty()) { + return ssl_open_record_discard; + } + + *out = record; + return ssl_open_record_success; +} + +int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, + int len) { + assert(!SSL_in_init(ssl)); + *out_needs_handshake = false; + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + if (len > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DTLS_MESSAGE_TOO_BIG); + return -1; + } + + if (len < 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_LENGTH); + return -1; + } + + if (len == 0) { + return 0; + } + + int ret = dtls1_write_record(ssl, SSL3_RT_APPLICATION_DATA, in, (size_t)len, + dtls1_use_current_epoch); + if (ret <= 0) { + return ret; + } + return len; +} + +int dtls1_write_record(SSL *ssl, int type, const uint8_t *in, size_t len, + enum dtls1_use_epoch_t use_epoch) { + SSLBuffer *buf = &ssl->s3->write_buffer; + assert(len <= SSL3_RT_MAX_PLAIN_LENGTH); + // There should never be a pending write buffer in DTLS. One can't write half + // a datagram, so the write buffer is always dropped in + // |ssl_write_buffer_flush|. + assert(buf->empty()); + + if (len > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + size_t ciphertext_len; + if (!buf->EnsureCap(ssl_seal_align_prefix_len(ssl), + len + SSL_max_seal_overhead(ssl)) || + !dtls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, + buf->remaining().size(), type, in, len, use_epoch)) { + buf->Clear(); + return -1; + } + buf->DidWrite(ciphertext_len); + + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + return ret; + } + return 1; +} + +int dtls1_dispatch_alert(SSL *ssl) { + int ret = dtls1_write_record(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2, + dtls1_use_current_epoch); + if (ret <= 0) { + return ret; + } + 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.get()); + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); + + int alert = (ssl->s3->send_alert[0] << 8) | ssl->s3->send_alert[1]; + ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, alert); + + return 1; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back new file mode 100644 index 0000000..b9b0ef9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back @@ -0,0 +1,273 @@ +/* DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. */ +/* ==================================================================== + * 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 (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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + assert(!SSL_in_init(ssl)); + + uint8_t type; + Span record; + auto ret = dtls_open_record(ssl, &type, &record, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + if (type == SSL3_RT_HANDSHAKE) { + // Parse the first fragment header to determine if this is a pre-CCS or + // post-CCS handshake record. DTLS resets handshake message numbers on each + // handshake, so renegotiations and retransmissions are ambiguous. + CBS cbs, body; + struct hm_header_st msg_hdr; + CBS_init(&cbs, record.data(), record.size()); + if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HANDSHAKE_RECORD); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + if (msg_hdr.type == SSL3_MT_FINISHED && + msg_hdr.seq == ssl->d1->handshake_read_seq - 1) { + if (msg_hdr.frag_off == 0) { + // Retransmit our last flight of messages. If the peer sends the second + // Finished, they may not have received ours. Only do this for the + // first fragment, in case the Finished was fragmented. + if (!dtls1_check_timeout_num(ssl)) { + *out_alert = 0; // TODO(davidben): Send an alert? + return ssl_open_record_error; + } + + dtls1_retransmit_outgoing_messages(ssl); + } + return ssl_open_record_discard; + } + + // Otherwise, this is a pre-CCS handshake message from an unsupported + // renegotiation attempt. Fall through to the error path. + } + + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (record.empty()) { + return ssl_open_record_discard; + } + + *out = record; + return ssl_open_record_success; +} + +int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, + int len) { + assert(!SSL_in_init(ssl)); + *out_needs_handshake = false; + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + if (len > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DTLS_MESSAGE_TOO_BIG); + return -1; + } + + if (len < 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_LENGTH); + return -1; + } + + if (len == 0) { + return 0; + } + + int ret = dtls1_write_record(ssl, SSL3_RT_APPLICATION_DATA, in, (size_t)len, + dtls1_use_current_epoch); + if (ret <= 0) { + return ret; + } + return len; +} + +int dtls1_write_record(SSL *ssl, int type, const uint8_t *in, size_t len, + enum dtls1_use_epoch_t use_epoch) { + SSLBuffer *buf = &ssl->s3->write_buffer; + assert(len <= SSL3_RT_MAX_PLAIN_LENGTH); + // There should never be a pending write buffer in DTLS. One can't write half + // a datagram, so the write buffer is always dropped in + // |ssl_write_buffer_flush|. + assert(buf->empty()); + + if (len > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + size_t ciphertext_len; + if (!buf->EnsureCap(ssl_seal_align_prefix_len(ssl), + len + SSL_max_seal_overhead(ssl)) || + !dtls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, + buf->remaining().size(), type, in, len, use_epoch)) { + buf->Clear(); + return -1; + } + buf->DidWrite(ciphertext_len); + + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + return ret; + } + return 1; +} + +int dtls1_dispatch_alert(SSL *ssl) { + int ret = dtls1_write_record(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2, + dtls1_use_current_epoch); + if (ret <= 0) { + return ret; + } + 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.get()); + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); + + int alert = (ssl->s3->send_alert[0] << 8) | ssl->s3->send_alert[1]; + ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, alert); + + return 1; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc new file mode 100644 index 0000000..2f55289 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc @@ -0,0 +1,232 @@ +/* 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). + * + */ +/* + DTLS code by Eric Rescorla + + Copyright (C) 2006, Network Resonance, Inc. + Copyright (C) 2011, RTFM, Inc. +*/ + +#include + +#include + +#include +#include + +#include "internal.h" + + +using namespace bssl; + +static const SRTP_PROTECTION_PROFILE kSRTPProfiles[] = { + { + "SRTP_AES128_CM_SHA1_80", SRTP_AES128_CM_SHA1_80, + }, + { + "SRTP_AES128_CM_SHA1_32", SRTP_AES128_CM_SHA1_32, + }, + { + "SRTP_AEAD_AES_128_GCM", SRTP_AEAD_AES_128_GCM, + }, + { + "SRTP_AEAD_AES_256_GCM", SRTP_AEAD_AES_256_GCM, + }, + {0, 0}, +}; + +static int find_profile_by_name(const char *profile_name, + const SRTP_PROTECTION_PROFILE **pptr, + size_t len) { + const SRTP_PROTECTION_PROFILE *p = kSRTPProfiles; + while (p->name) { + if (len == strlen(p->name) && !strncmp(p->name, profile_name, len)) { + *pptr = p; + return 1; + } + + p++; + } + + return 0; +} + +static int ssl_ctx_make_profiles( + const char *profiles_string, + UniquePtr *out) { + UniquePtr profiles( + sk_SRTP_PROTECTION_PROFILE_new_null()); + if (profiles == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES); + return 0; + } + + const char *col; + const char *ptr = profiles_string; + do { + col = strchr(ptr, ':'); + + const SRTP_PROTECTION_PROFILE *profile; + if (!find_profile_by_name(ptr, &profile, + col ? (size_t)(col - ptr) : strlen(ptr))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE); + return 0; + } + + if (!sk_SRTP_PROTECTION_PROFILE_push(profiles.get(), profile)) { + return 0; + } + + if (col) { + ptr = col + 1; + } + } while (col); + + *out = std::move(profiles); + return 1; +} + +int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, const char *profiles) { + return ssl_ctx_make_profiles(profiles, &ctx->srtp_profiles); +} + +int SSL_set_srtp_profiles(SSL *ssl, const char *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 == nullptr) { + return nullptr; + } + + if (ssl->config == nullptr) { + assert(0); + return nullptr; + } + + 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->s3->srtp_profile; +} + +int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles) { + // This API inverts its return value. + return !SSL_CTX_set_srtp_profiles(ctx, profiles); +} + +int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles) { + // This API inverts its return value. + return !SSL_set_srtp_profiles(ssl, profiles); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back new file mode 100644 index 0000000..96d7d51 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back @@ -0,0 +1,232 @@ +/* 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). + * + */ +/* + DTLS code by Eric Rescorla + + Copyright (C) 2006, Network Resonance, Inc. + Copyright (C) 2011, RTFM, Inc. +*/ + +#include + +#include + +#include +#include + +#include "internal.h" + + +using namespace bssl; + +static const SRTP_PROTECTION_PROFILE kSRTPProfiles[] = { + { + "SRTP_AES128_CM_SHA1_80", SRTP_AES128_CM_SHA1_80, + }, + { + "SRTP_AES128_CM_SHA1_32", SRTP_AES128_CM_SHA1_32, + }, + { + "SRTP_AEAD_AES_128_GCM", SRTP_AEAD_AES_128_GCM, + }, + { + "SRTP_AEAD_AES_256_GCM", SRTP_AEAD_AES_256_GCM, + }, + {0, 0}, +}; + +static int find_profile_by_name(const char *profile_name, + const SRTP_PROTECTION_PROFILE **pptr, + size_t len) { + const SRTP_PROTECTION_PROFILE *p = kSRTPProfiles; + while (p->name) { + if (len == strlen(p->name) && !strncmp(p->name, profile_name, len)) { + *pptr = p; + return 1; + } + + p++; + } + + return 0; +} + +static int ssl_ctx_make_profiles( + const char *profiles_string, + UniquePtr *out) { + UniquePtr profiles( + sk_SRTP_PROTECTION_PROFILE_new_null()); + if (profiles == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES); + return 0; + } + + const char *col; + const char *ptr = profiles_string; + do { + col = strchr(ptr, ':'); + + const SRTP_PROTECTION_PROFILE *profile; + if (!find_profile_by_name(ptr, &profile, + col ? (size_t)(col - ptr) : strlen(ptr))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE); + return 0; + } + + if (!sk_SRTP_PROTECTION_PROFILE_push(profiles.get(), profile)) { + return 0; + } + + if (col) { + ptr = col + 1; + } + } while (col); + + *out = std::move(profiles); + return 1; +} + +int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, const char *profiles) { + return ssl_ctx_make_profiles(profiles, &ctx->srtp_profiles); +} + +int SSL_set_srtp_profiles(SSL *ssl, const char *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 == nullptr) { + return nullptr; + } + + if (ssl->config == nullptr) { + assert(0); + return nullptr; + } + + 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->s3->srtp_profile; +} + +int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles) { + // This API inverts its return value. + return !SSL_CTX_set_srtp_profiles(ctx, profiles); +} + +int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles) { + // This API inverts its return value. + return !SSL_set_srtp_profiles(ssl, profiles); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc new file mode 100644 index 0000000..c97e1ca --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc @@ -0,0 +1,191 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-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 "../crypto/internal.h" +#include "internal.h" + + +using namespace bssl; + +static void dtls1_on_handshake_complete(SSL *ssl) { + // Stop the reply timer left by the last flight we sent. + dtls1_stop_timer(ssl); + // If the final flight had a reply, we know the peer has received it. If not, + // we must leave the flight around for post-handshake retransmission. + if (ssl->d1->flight_has_reply) { + dtls_clear_outgoing_messages(ssl); + } +} + +static bool dtls1_set_read_state(SSL *ssl, UniquePtr aead_ctx) { + // Cipher changes are forbidden if the current epoch has leftover data. + if (dtls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + ssl->d1->r_epoch++; + OPENSSL_memset(&ssl->d1->bitmap, 0, sizeof(ssl->d1->bitmap)); + OPENSSL_memset(ssl->s3->read_sequence, 0, sizeof(ssl->s3->read_sequence)); + + ssl->s3->aead_read_ctx = std::move(aead_ctx); + return true; +} + +static bool dtls1_set_write_state(SSL *ssl, + UniquePtr aead_ctx) { + ssl->d1->w_epoch++; + OPENSSL_memcpy(ssl->d1->last_write_sequence, ssl->s3->write_sequence, + sizeof(ssl->s3->write_sequence)); + OPENSSL_memset(ssl->s3->write_sequence, 0, sizeof(ssl->s3->write_sequence)); + + ssl->d1->last_aead_write_ctx = std::move(ssl->s3->aead_write_ctx); + ssl->s3->aead_write_ctx = std::move(aead_ctx); + return true; +} + +static const SSL_PROTOCOL_METHOD kDTLSProtocolMethod = { + true /* is_dtls */, + dtls1_new, + dtls1_free, + dtls1_get_message, + dtls1_next_message, + dtls1_open_handshake, + dtls1_open_change_cipher_spec, + dtls1_open_app_data, + dtls1_write_app_data, + dtls1_dispatch_alert, + dtls1_init_message, + dtls1_finish_message, + dtls1_add_message, + dtls1_add_change_cipher_spec, + dtls1_flush_flight, + dtls1_on_handshake_complete, + dtls1_set_read_state, + dtls1_set_write_state, +}; + +const SSL_METHOD *DTLS_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *DTLS_with_buffers_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kDTLSProtocolMethod, + &ssl_noop_x509_method, + }; + return &kMethod; +} + +// Legacy version-locked methods. + +const SSL_METHOD *DTLSv1_2_method(void) { + static const SSL_METHOD kMethod = { + DTLS1_2_VERSION, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *DTLSv1_method(void) { + static const SSL_METHOD kMethod = { + DTLS1_VERSION, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +// Legacy side-specific methods. + +const SSL_METHOD *DTLSv1_2_server_method(void) { + return DTLSv1_2_method(); +} + +const SSL_METHOD *DTLSv1_server_method(void) { + return DTLSv1_method(); +} + +const SSL_METHOD *DTLSv1_2_client_method(void) { + return DTLSv1_2_method(); +} + +const SSL_METHOD *DTLSv1_client_method(void) { + return DTLSv1_method(); +} + +const SSL_METHOD *DTLS_server_method(void) { + return DTLS_method(); +} + +const SSL_METHOD *DTLS_client_method(void) { + return DTLS_method(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back new file mode 100644 index 0000000..0ce7c1f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back @@ -0,0 +1,191 @@ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-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 "../crypto/internal.h" +#include "internal.h" + + +using namespace bssl; + +static void dtls1_on_handshake_complete(SSL *ssl) { + // Stop the reply timer left by the last flight we sent. + dtls1_stop_timer(ssl); + // If the final flight had a reply, we know the peer has received it. If not, + // we must leave the flight around for post-handshake retransmission. + if (ssl->d1->flight_has_reply) { + dtls_clear_outgoing_messages(ssl); + } +} + +static bool dtls1_set_read_state(SSL *ssl, UniquePtr aead_ctx) { + // Cipher changes are forbidden if the current epoch has leftover data. + if (dtls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + ssl->d1->r_epoch++; + OPENSSL_memset(&ssl->d1->bitmap, 0, sizeof(ssl->d1->bitmap)); + OPENSSL_memset(ssl->s3->read_sequence, 0, sizeof(ssl->s3->read_sequence)); + + ssl->s3->aead_read_ctx = std::move(aead_ctx); + return true; +} + +static bool dtls1_set_write_state(SSL *ssl, + UniquePtr aead_ctx) { + ssl->d1->w_epoch++; + OPENSSL_memcpy(ssl->d1->last_write_sequence, ssl->s3->write_sequence, + sizeof(ssl->s3->write_sequence)); + OPENSSL_memset(ssl->s3->write_sequence, 0, sizeof(ssl->s3->write_sequence)); + + ssl->d1->last_aead_write_ctx = std::move(ssl->s3->aead_write_ctx); + ssl->s3->aead_write_ctx = std::move(aead_ctx); + return true; +} + +static const SSL_PROTOCOL_METHOD kDTLSProtocolMethod = { + true /* is_dtls */, + dtls1_new, + dtls1_free, + dtls1_get_message, + dtls1_next_message, + dtls1_open_handshake, + dtls1_open_change_cipher_spec, + dtls1_open_app_data, + dtls1_write_app_data, + dtls1_dispatch_alert, + dtls1_init_message, + dtls1_finish_message, + dtls1_add_message, + dtls1_add_change_cipher_spec, + dtls1_flush_flight, + dtls1_on_handshake_complete, + dtls1_set_read_state, + dtls1_set_write_state, +}; + +const SSL_METHOD *DTLS_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *DTLS_with_buffers_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kDTLSProtocolMethod, + &ssl_noop_x509_method, + }; + return &kMethod; +} + +// Legacy version-locked methods. + +const SSL_METHOD *DTLSv1_2_method(void) { + static const SSL_METHOD kMethod = { + DTLS1_2_VERSION, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *DTLSv1_method(void) { + static const SSL_METHOD kMethod = { + DTLS1_VERSION, + &kDTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +// Legacy side-specific methods. + +const SSL_METHOD *DTLSv1_2_server_method(void) { + return DTLSv1_2_method(); +} + +const SSL_METHOD *DTLSv1_server_method(void) { + return DTLSv1_method(); +} + +const SSL_METHOD *DTLSv1_2_client_method(void) { + return DTLSv1_2_method(); +} + +const SSL_METHOD *DTLSv1_client_method(void) { + return DTLSv1_method(); +} + +const SSL_METHOD *DTLS_server_method(void) { + return DTLS_method(); +} + +const SSL_METHOD *DTLS_client_method(void) { + return DTLS_method(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc new file mode 100644 index 0000000..ed77082 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc @@ -0,0 +1,353 @@ +/* DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. */ +/* ==================================================================== + * 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 (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 "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +// to_u64_be treats |in| as a 8-byte big-endian integer and returns the value as +// a |uint64_t|. +static uint64_t to_u64_be(const uint8_t in[8]) { + uint64_t ret = 0; + unsigned i; + for (i = 0; i < 8; i++) { + ret <<= 8; + ret |= in[i]; + } + return ret; +} + +// dtls1_bitmap_should_discard returns one if |seq_num| has been seen in +// |bitmap| or is stale. Otherwise it returns zero. +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 false; + } + uint64_t idx = bitmap->max_seq_num - seq_num_u; + return idx >= kWindowSize || (bitmap->map & (((uint64_t)1) << idx)); +} + +// dtls1_bitmap_record updates |bitmap| to record receipt of sequence number +// |seq_num|. It slides the window forward if needed. It is an error to call +// this function on a stale sequence number. +static void dtls1_bitmap_record(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); + // Shift the window if necessary. + if (seq_num_u > bitmap->max_seq_num) { + uint64_t shift = seq_num_u - bitmap->max_seq_num; + if (shift >= kWindowSize) { + bitmap->map = 0; + } else { + bitmap->map <<= shift; + } + bitmap->max_seq_num = seq_num_u; + } + + uint64_t idx = bitmap->max_seq_num - seq_num_u; + if (idx < kWindowSize) { + bitmap->map |= ((uint64_t)1) << idx; + } +} + +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) { + *out_consumed = 0; + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return ssl_open_record_close_notify; + } + + if (in.empty()) { + return ssl_open_record_partial; + } + + CBS cbs = CBS(in); + + // Decode the record. + uint8_t type; + uint16_t version; + uint8_t sequence[8]; + CBS body; + if (!CBS_get_u8(&cbs, &type) || + !CBS_get_u16(&cbs, &version) || + !CBS_copy_bytes(&cbs, sequence, 8) || + !CBS_get_u16_length_prefixed(&cbs, &body) || + CBS_len(&body) > SSL3_RT_MAX_ENCRYPTED_LENGTH) { + // The record header was incomplete or malformed. Drop the entire packet. + *out_consumed = in.size(); + return ssl_open_record_discard; + } + + bool version_ok; + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + // Only check the first byte. Enforcing beyond that can prevent decoding + // version negotiation failure alerts. + version_ok = (version >> 8) == DTLS1_VERSION_MAJOR; + } else { + version_ok = version == ssl->s3->aead_read_ctx->RecordVersion(); + } + + if (!version_ok) { + // The record header was incomplete or malformed. Drop the entire packet. + *out_consumed = in.size(); + return ssl_open_record_discard; + } + + 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 || + dtls1_bitmap_should_discard(&ssl->d1->bitmap, sequence)) { + // Drop this record. It's from the wrong epoch or is a replay. Note that if + // |epoch| is the next epoch, the record could be buffered for later. For + // simplicity, drop it and expect retransmit to handle it later; DTLS must + // handle packet loss anyway. + *out_consumed = in.size() - CBS_len(&cbs); + return ssl_open_record_discard; + } + + // discard the body in-place. + if (!ssl->s3->aead_read_ctx->Open( + 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 + // entire packet as it must not have come from the peer. + // + // TODO(davidben): This doesn't distinguish malloc failures from encryption + // failures. + ERR_clear_error(); + *out_consumed = in.size() - CBS_len(&cbs); + return ssl_open_record_discard; + } + *out_consumed = in.size() - CBS_len(&cbs); + + // Check the plaintext length. + if (out->size() > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + dtls1_bitmap_record(&ssl->d1->bitmap, sequence); + + // TODO(davidben): Limit the number of empty records as in TLS? This is only + // useful if we also limit discarded packets. + + if (type == SSL3_RT_ALERT) { + return ssl_process_alert(ssl, out_alert, *out); + } + + ssl->s3->warning_alert_count = 0; + + *out_type = type; + return ssl_open_record_success; +} + +static const SSLAEADContext *get_write_aead(const SSL *ssl, + enum dtls1_use_epoch_t use_epoch) { + if (use_epoch == dtls1_use_previous_epoch) { + assert(ssl->d1->w_epoch >= 1); + return ssl->d1->last_aead_write_ctx.get(); + } + + return ssl->s3->aead_write_ctx.get(); +} + +size_t dtls_max_seal_overhead(const SSL *ssl, + enum dtls1_use_epoch_t use_epoch) { + return DTLS1_RT_HEADER_LENGTH + get_write_aead(ssl, use_epoch)->MaxOverhead(); +} + +size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch) { + return DTLS1_RT_HEADER_LENGTH + + get_write_aead(ssl, use_epoch)->ExplicitNonceLen(); +} + +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 false; + } + + // Determine the parameters for the current epoch. + uint16_t epoch = ssl->d1->w_epoch; + SSLAEADContext *aead = ssl->s3->aead_write_ctx.get(); + uint8_t *seq = ssl->s3->write_sequence; + if (use_epoch == dtls1_use_previous_epoch) { + assert(ssl->d1->w_epoch >= 1); + epoch = ssl->d1->w_epoch - 1; + aead = ssl->d1->last_aead_write_ctx.get(); + seq = ssl->d1->last_write_sequence; + } + + if (max_out < DTLS1_RT_HEADER_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + + out[0] = type; + + uint16_t record_version = ssl->s3->aead_write_ctx->RecordVersion(); + out[1] = record_version >> 8; + out[2] = record_version & 0xff; + + out[3] = epoch >> 8; + out[4] = epoch & 0xff; + OPENSSL_memcpy(&out[5], &seq[2], 6); + + size_t ciphertext_len; + 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); + + 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); + + *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back new file mode 100644 index 0000000..992fb52 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back @@ -0,0 +1,353 @@ +/* DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. */ +/* ==================================================================== + * 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 (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 "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +// to_u64_be treats |in| as a 8-byte big-endian integer and returns the value as +// a |uint64_t|. +static uint64_t to_u64_be(const uint8_t in[8]) { + uint64_t ret = 0; + unsigned i; + for (i = 0; i < 8; i++) { + ret <<= 8; + ret |= in[i]; + } + return ret; +} + +// dtls1_bitmap_should_discard returns one if |seq_num| has been seen in +// |bitmap| or is stale. Otherwise it returns zero. +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 false; + } + uint64_t idx = bitmap->max_seq_num - seq_num_u; + return idx >= kWindowSize || (bitmap->map & (((uint64_t)1) << idx)); +} + +// dtls1_bitmap_record updates |bitmap| to record receipt of sequence number +// |seq_num|. It slides the window forward if needed. It is an error to call +// this function on a stale sequence number. +static void dtls1_bitmap_record(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); + // Shift the window if necessary. + if (seq_num_u > bitmap->max_seq_num) { + uint64_t shift = seq_num_u - bitmap->max_seq_num; + if (shift >= kWindowSize) { + bitmap->map = 0; + } else { + bitmap->map <<= shift; + } + bitmap->max_seq_num = seq_num_u; + } + + uint64_t idx = bitmap->max_seq_num - seq_num_u; + if (idx < kWindowSize) { + bitmap->map |= ((uint64_t)1) << idx; + } +} + +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) { + *out_consumed = 0; + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return ssl_open_record_close_notify; + } + + if (in.empty()) { + return ssl_open_record_partial; + } + + CBS cbs = CBS(in); + + // Decode the record. + uint8_t type; + uint16_t version; + uint8_t sequence[8]; + CBS body; + if (!CBS_get_u8(&cbs, &type) || + !CBS_get_u16(&cbs, &version) || + !CBS_copy_bytes(&cbs, sequence, 8) || + !CBS_get_u16_length_prefixed(&cbs, &body) || + CBS_len(&body) > SSL3_RT_MAX_ENCRYPTED_LENGTH) { + // The record header was incomplete or malformed. Drop the entire packet. + *out_consumed = in.size(); + return ssl_open_record_discard; + } + + bool version_ok; + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + // Only check the first byte. Enforcing beyond that can prevent decoding + // version negotiation failure alerts. + version_ok = (version >> 8) == DTLS1_VERSION_MAJOR; + } else { + version_ok = version == ssl->s3->aead_read_ctx->RecordVersion(); + } + + if (!version_ok) { + // The record header was incomplete or malformed. Drop the entire packet. + *out_consumed = in.size(); + return ssl_open_record_discard; + } + + 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 || + dtls1_bitmap_should_discard(&ssl->d1->bitmap, sequence)) { + // Drop this record. It's from the wrong epoch or is a replay. Note that if + // |epoch| is the next epoch, the record could be buffered for later. For + // simplicity, drop it and expect retransmit to handle it later; DTLS must + // handle packet loss anyway. + *out_consumed = in.size() - CBS_len(&cbs); + return ssl_open_record_discard; + } + + // discard the body in-place. + if (!ssl->s3->aead_read_ctx->Open( + 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 + // entire packet as it must not have come from the peer. + // + // TODO(davidben): This doesn't distinguish malloc failures from encryption + // failures. + ERR_clear_error(); + *out_consumed = in.size() - CBS_len(&cbs); + return ssl_open_record_discard; + } + *out_consumed = in.size() - CBS_len(&cbs); + + // Check the plaintext length. + if (out->size() > SSL3_RT_MAX_PLAIN_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + dtls1_bitmap_record(&ssl->d1->bitmap, sequence); + + // TODO(davidben): Limit the number of empty records as in TLS? This is only + // useful if we also limit discarded packets. + + if (type == SSL3_RT_ALERT) { + return ssl_process_alert(ssl, out_alert, *out); + } + + ssl->s3->warning_alert_count = 0; + + *out_type = type; + return ssl_open_record_success; +} + +static const SSLAEADContext *get_write_aead(const SSL *ssl, + enum dtls1_use_epoch_t use_epoch) { + if (use_epoch == dtls1_use_previous_epoch) { + assert(ssl->d1->w_epoch >= 1); + return ssl->d1->last_aead_write_ctx.get(); + } + + return ssl->s3->aead_write_ctx.get(); +} + +size_t dtls_max_seal_overhead(const SSL *ssl, + enum dtls1_use_epoch_t use_epoch) { + return DTLS1_RT_HEADER_LENGTH + get_write_aead(ssl, use_epoch)->MaxOverhead(); +} + +size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch) { + return DTLS1_RT_HEADER_LENGTH + + get_write_aead(ssl, use_epoch)->ExplicitNonceLen(); +} + +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 false; + } + + // Determine the parameters for the current epoch. + uint16_t epoch = ssl->d1->w_epoch; + SSLAEADContext *aead = ssl->s3->aead_write_ctx.get(); + uint8_t *seq = ssl->s3->write_sequence; + if (use_epoch == dtls1_use_previous_epoch) { + assert(ssl->d1->w_epoch >= 1); + epoch = ssl->d1->w_epoch - 1; + aead = ssl->d1->last_aead_write_ctx.get(); + seq = ssl->d1->last_write_sequence; + } + + if (max_out < DTLS1_RT_HEADER_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + + out[0] = type; + + uint16_t record_version = ssl->s3->aead_write_ctx->RecordVersion(); + out[1] = record_version >> 8; + out[2] = record_version & 0xff; + + out[3] = epoch >> 8; + out[4] = epoch & 0xff; + OPENSSL_memcpy(&out[5], &seq[2], 6); + + size_t ciphertext_len; + 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); + + 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); + + *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handoff.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handoff.cc new file mode 100644 index 0000000..6881d0f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handoff.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handoff.cc.grpc_back new file mode 100644 index 0000000..a9c08fe --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc new file mode 100644 index 0000000..24d761f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc @@ -0,0 +1,692 @@ +/* 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. */ + +#include + +#include + +#include + +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) + : ssl(ssl_arg), + scts_requested(false), + needs_psk_binder(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), + early_data_offered(false), + can_early_read(false), + can_early_write(false), + next_proto_neg_seen(false), + ticket_expected(false), + extended_master_secret(false), + pending_private_key_op(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()) { + return nullptr; + } + hs->config = ssl->config.get(); + if (!hs->config) { + assert(hs->config); + return nullptr; + } + return hs; +} + +bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type) { + if (msg.type != type) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ERR_add_error_dataf("got type %d, wanted type %d", msg.type, type); + return false; + } + + return true; +} + +bool ssl_add_message_cbb(SSL *ssl, CBB *cbb) { + Array msg; + if (!ssl->method->finish_message(ssl, cbb, &msg) || + !ssl->method->add_message(ssl, std::move(msg))) { + return false; + } + + return true; +} + +size_t ssl_max_handshake_message_len(const SSL *ssl) { + // kMaxMessageLen is the default maximum message size for handshakes which do + // not accept peer certificate chains. + static const size_t kMaxMessageLen = 16384; + + if (SSL_in_init(ssl)) { + 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; + } + return kMaxMessageLen; + } + + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + // In TLS 1.2 and below, the largest acceptable post-handshake message is + // a HelloRequest. + return 0; + } + + if (ssl->server) { + // The largest acceptable post-handshake message for a server is a + // KeyUpdate. We will never initiate post-handshake auth. + return 1; + } + + // Clients must accept NewSessionTicket, so allow the default size. + return kMaxMessageLen; +} + +bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg) { + // V2ClientHello messages are pre-hashed. + if (msg.is_v2_hello) { + return true; + } + + return hs->transcript.Update(msg.raw); +} + +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) { + // Reset everything. + for (size_t i = 0; i < num_ext_types; i++) { + *ext_types[i].out_present = 0; + CBS_init(ext_types[i].out_data, NULL, 0); + } + + CBS copy = *cbs; + while (CBS_len(©) != 0) { + uint16_t type; + CBS data; + if (!CBS_get_u16(©, &type) || + !CBS_get_u16_length_prefixed(©, &data)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return 0; + } + + const SSL_EXTENSION_TYPE *ext_type = NULL; + for (size_t i = 0; i < num_ext_types; i++) { + if (type == ext_types[i].type) { + ext_type = &ext_types[i]; + break; + } + } + + if (ext_type == NULL) { + if (ignore_unknown) { + continue; + } + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return 0; + } + + // Duplicate ext_types are forbidden. + if (*ext_type->out_present) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_EXTENSION); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return 0; + } + + *ext_type->out_present = 1; + *ext_type->out_data = data; + } + + return 1; +} + +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(); + if (prev_session != NULL) { + // If renegotiating, the server must not change the server certificate. See + // https://mitls.org/pages/attacks/3SHAKE. We never resume on renegotiation, + // 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.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.get()); + i++) { + const CRYPTO_BUFFER *old_cert = + sk_CRYPTO_BUFFER_value(prev_session->certs.get(), i); + const CRYPTO_BUFFER *new_cert = + 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), + CRYPTO_BUFFER_len(old_cert)) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_CERT_CHANGED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_verify_invalid; + } + } + + // The certificate is identical, so we may skip re-verifying the + // certificate. Since we only authenticated the previous one, copy other + // authentication from the established session and ignore what was newly + // received. + 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 (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 (hs->config->verify_mode == SSL_VERIFY_NONE) { + ERR_clear_error(); + ret = ssl_verify_ok; + } + hs->new_session->verify_result = X509_V_ERR_APPLICATION_VERIFICATION; + break; + case ssl_verify_retry: + break; + } + } else { + ret = ssl->ctx->x509_method->session_verify_cert_chain( + hs->new_session.get(), hs, &alert) + ? ssl_verify_ok + : ssl_verify_invalid; + } + + if (ret == ssl_verify_invalid) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_VERIFY_FAILED); + 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; +} + +uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, + enum ssl_grease_index_t index) { + // Draw entropy for all GREASE values at once. This avoids calling + // |RAND_bytes| repeatedly and makes the values consistent within a + // connection. The latter is so the second ClientHello matches after + // HelloRetryRequest and so supported_groups and key_shares are consistent. + if (!hs->grease_seeded) { + RAND_bytes(hs->grease_seed, sizeof(hs->grease_seed)); + hs->grease_seeded = true; + } + + // This generates a random value of the form 0xΟ‰aΟ‰a, for all 0 ≀ Ο‰ < 16. + uint16_t ret = hs->grease_seed[index]; + ret = (ret & 0xf0) | 0x0a; + ret |= ret << 8; + return ret; +} + +enum ssl_hs_wait_t ssl_get_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)) { + return ssl_hs_error; + } + + // Snapshot the finished hash before incorporating the new message. + uint8_t finished[EVP_MAX_MD_SIZE]; + size_t finished_len; + if (!hs->transcript.GetFinishedMAC(finished, &finished_len, + SSL_get_session(ssl), !ssl->server) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + int finished_ok = CBS_mem_equal(&msg.body, finished, finished_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 ssl_hs_error; + } + + // Copy the Finished so we can use it for renegotiation checks. + 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; + } + + ssl->method->next_message(ssl); + return ssl_hs_ok; +} + +bool ssl_send_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + const SSL_SESSION *session = SSL_get_session(ssl); + + uint8_t finished[EVP_MAX_MD_SIZE]; + size_t finished_len; + if (!hs->transcript.GetFinishedMAC(finished, &finished_len, session, + ssl->server)) { + return 0; + } + + // Log the master secret, if logging is enabled. + 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 (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; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || + !CBB_add_bytes(&body, finished, finished_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} + +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs) { + ScopedCBB cbb; + CBB body; + 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; + } + + return true; +} + +int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { + SSL *const ssl = hs->ssl; + for (;;) { + // Resolve the operation the handshake was waiting on. + switch (hs->wait) { + case ssl_hs_error: + ERR_restore_state(hs->error.get()); + return -1; + + case ssl_hs_flush: { + int ret = ssl->method->flush_flight(ssl); + if (ret <= 0) { + return ret; + } + break; + } + + 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; + if (hs->wait == ssl_hs_read_change_cipher_spec) { + ret = ssl_open_change_cipher_spec(ssl, &consumed, &alert, + ssl->s3->read_buffer.span()); + } else { + ret = ssl_open_handshake(ssl, &consumed, &alert, + ssl->s3->read_buffer.span()); + } + if (ret == ssl_open_record_error && + hs->wait == ssl_hs_read_server_hello) { + uint32_t err = ERR_peek_error(); + if (ERR_GET_LIB(err) == ERR_LIB_SSL && + ERR_GET_REASON(err) == SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE) { + // Add a dedicated error code to the queue for a handshake_failure + // alert in response to ClientHello. This matches NSS's client + // behavior and gives a better error on a (probable) failure to + // negotiate initial parameters. Note: this error code comes after + // the original one. + // + // See https://crbug.com/446505. + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO); + } + } + bool retry; + int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); + if (bio_ret <= 0) { + return bio_ret; + } + if (retry) { + continue; + } + ssl->s3->read_buffer.DiscardConsumed(); + break; + } + + case ssl_hs_read_end_of_early_data: { + if (ssl->s3->hs->can_early_read) { + // While we are processing early data, the handshake returns early. + *out_early_return = true; + return 1; + } + hs->wait = ssl_hs_ok; + break; + } + + case ssl_hs_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_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_ERROR_WANT_X509_LOOKUP; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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_ERROR_WANT_PRIVATE_KEY_OPERATION; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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_ERROR_PENDING_TICKET; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_certificate_verify: + ssl->s3->rwstate = SSL_ERROR_WANT_CERTIFICATE_VERIFY; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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; + + case ssl_hs_early_return: + *out_early_return = true; + hs->wait = ssl_hs_ok; + return 1; + + case ssl_hs_ok: + break; + } + + // Run the state machine again. + hs->wait = ssl->do_handshake(hs); + if (hs->wait == ssl_hs_error) { + hs->error.reset(ERR_save_state()); + return -1; + } + if (hs->wait == ssl_hs_ok) { + // The handshake has completed. + *out_early_return = false; + return 1; + } + + // Otherwise, loop to the beginning and resolve what was blocking the + // handshake. + } +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back new file mode 100644 index 0000000..33efc81 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back @@ -0,0 +1,692 @@ +/* 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. */ + +#include + +#include + +#include + +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) + : ssl(ssl_arg), + scts_requested(false), + needs_psk_binder(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), + early_data_offered(false), + can_early_read(false), + can_early_write(false), + next_proto_neg_seen(false), + ticket_expected(false), + extended_master_secret(false), + pending_private_key_op(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()) { + return nullptr; + } + hs->config = ssl->config.get(); + if (!hs->config) { + assert(hs->config); + return nullptr; + } + return hs; +} + +bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type) { + if (msg.type != type) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ERR_add_error_dataf("got type %d, wanted type %d", msg.type, type); + return false; + } + + return true; +} + +bool ssl_add_message_cbb(SSL *ssl, CBB *cbb) { + Array msg; + if (!ssl->method->finish_message(ssl, cbb, &msg) || + !ssl->method->add_message(ssl, std::move(msg))) { + return false; + } + + return true; +} + +size_t ssl_max_handshake_message_len(const SSL *ssl) { + // kMaxMessageLen is the default maximum message size for handshakes which do + // not accept peer certificate chains. + static const size_t kMaxMessageLen = 16384; + + if (SSL_in_init(ssl)) { + 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; + } + return kMaxMessageLen; + } + + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + // In TLS 1.2 and below, the largest acceptable post-handshake message is + // a HelloRequest. + return 0; + } + + if (ssl->server) { + // The largest acceptable post-handshake message for a server is a + // KeyUpdate. We will never initiate post-handshake auth. + return 1; + } + + // Clients must accept NewSessionTicket, so allow the default size. + return kMaxMessageLen; +} + +bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg) { + // V2ClientHello messages are pre-hashed. + if (msg.is_v2_hello) { + return true; + } + + return hs->transcript.Update(msg.raw); +} + +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) { + // Reset everything. + for (size_t i = 0; i < num_ext_types; i++) { + *ext_types[i].out_present = 0; + CBS_init(ext_types[i].out_data, NULL, 0); + } + + CBS copy = *cbs; + while (CBS_len(©) != 0) { + uint16_t type; + CBS data; + if (!CBS_get_u16(©, &type) || + !CBS_get_u16_length_prefixed(©, &data)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return 0; + } + + const SSL_EXTENSION_TYPE *ext_type = NULL; + for (size_t i = 0; i < num_ext_types; i++) { + if (type == ext_types[i].type) { + ext_type = &ext_types[i]; + break; + } + } + + if (ext_type == NULL) { + if (ignore_unknown) { + continue; + } + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return 0; + } + + // Duplicate ext_types are forbidden. + if (*ext_type->out_present) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_EXTENSION); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return 0; + } + + *ext_type->out_present = 1; + *ext_type->out_data = data; + } + + return 1; +} + +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(); + if (prev_session != NULL) { + // If renegotiating, the server must not change the server certificate. See + // https://mitls.org/pages/attacks/3SHAKE. We never resume on renegotiation, + // 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.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.get()); + i++) { + const CRYPTO_BUFFER *old_cert = + sk_CRYPTO_BUFFER_value(prev_session->certs.get(), i); + const CRYPTO_BUFFER *new_cert = + 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), + CRYPTO_BUFFER_len(old_cert)) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_CERT_CHANGED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_verify_invalid; + } + } + + // The certificate is identical, so we may skip re-verifying the + // certificate. Since we only authenticated the previous one, copy other + // authentication from the established session and ignore what was newly + // received. + 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 (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 (hs->config->verify_mode == SSL_VERIFY_NONE) { + ERR_clear_error(); + ret = ssl_verify_ok; + } + hs->new_session->verify_result = X509_V_ERR_APPLICATION_VERIFICATION; + break; + case ssl_verify_retry: + break; + } + } else { + ret = ssl->ctx->x509_method->session_verify_cert_chain( + hs->new_session.get(), hs, &alert) + ? ssl_verify_ok + : ssl_verify_invalid; + } + + if (ret == ssl_verify_invalid) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_VERIFY_FAILED); + 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; +} + +uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, + enum ssl_grease_index_t index) { + // Draw entropy for all GREASE values at once. This avoids calling + // |RAND_bytes| repeatedly and makes the values consistent within a + // connection. The latter is so the second ClientHello matches after + // HelloRetryRequest and so supported_groups and key_shares are consistent. + if (!hs->grease_seeded) { + RAND_bytes(hs->grease_seed, sizeof(hs->grease_seed)); + hs->grease_seeded = true; + } + + // This generates a random value of the form 0xΟ‰aΟ‰a, for all 0 ≀ Ο‰ < 16. + uint16_t ret = hs->grease_seed[index]; + ret = (ret & 0xf0) | 0x0a; + ret |= ret << 8; + return ret; +} + +enum ssl_hs_wait_t ssl_get_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)) { + return ssl_hs_error; + } + + // Snapshot the finished hash before incorporating the new message. + uint8_t finished[EVP_MAX_MD_SIZE]; + size_t finished_len; + if (!hs->transcript.GetFinishedMAC(finished, &finished_len, + SSL_get_session(ssl), !ssl->server) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + int finished_ok = CBS_mem_equal(&msg.body, finished, finished_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 ssl_hs_error; + } + + // Copy the Finished so we can use it for renegotiation checks. + 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; + } + + ssl->method->next_message(ssl); + return ssl_hs_ok; +} + +bool ssl_send_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + const SSL_SESSION *session = SSL_get_session(ssl); + + uint8_t finished[EVP_MAX_MD_SIZE]; + size_t finished_len; + if (!hs->transcript.GetFinishedMAC(finished, &finished_len, session, + ssl->server)) { + return 0; + } + + // Log the master secret, if logging is enabled. + 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 (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; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || + !CBB_add_bytes(&body, finished, finished_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} + +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs) { + ScopedCBB cbb; + CBB body; + 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; + } + + return true; +} + +int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { + SSL *const ssl = hs->ssl; + for (;;) { + // Resolve the operation the handshake was waiting on. + switch (hs->wait) { + case ssl_hs_error: + ERR_restore_state(hs->error.get()); + return -1; + + case ssl_hs_flush: { + int ret = ssl->method->flush_flight(ssl); + if (ret <= 0) { + return ret; + } + break; + } + + 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; + if (hs->wait == ssl_hs_read_change_cipher_spec) { + ret = ssl_open_change_cipher_spec(ssl, &consumed, &alert, + ssl->s3->read_buffer.span()); + } else { + ret = ssl_open_handshake(ssl, &consumed, &alert, + ssl->s3->read_buffer.span()); + } + if (ret == ssl_open_record_error && + hs->wait == ssl_hs_read_server_hello) { + uint32_t err = ERR_peek_error(); + if (ERR_GET_LIB(err) == ERR_LIB_SSL && + ERR_GET_REASON(err) == SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE) { + // Add a dedicated error code to the queue for a handshake_failure + // alert in response to ClientHello. This matches NSS's client + // behavior and gives a better error on a (probable) failure to + // negotiate initial parameters. Note: this error code comes after + // the original one. + // + // See https://crbug.com/446505. + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO); + } + } + bool retry; + int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); + if (bio_ret <= 0) { + return bio_ret; + } + if (retry) { + continue; + } + ssl->s3->read_buffer.DiscardConsumed(); + break; + } + + case ssl_hs_read_end_of_early_data: { + if (ssl->s3->hs->can_early_read) { + // While we are processing early data, the handshake returns early. + *out_early_return = true; + return 1; + } + hs->wait = ssl_hs_ok; + break; + } + + case ssl_hs_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_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_ERROR_WANT_X509_LOOKUP; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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_ERROR_WANT_PRIVATE_KEY_OPERATION; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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_ERROR_PENDING_TICKET; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_certificate_verify: + ssl->s3->rwstate = SSL_ERROR_WANT_CERTIFICATE_VERIFY; + hs->wait = ssl_hs_ok; + return -1; + + case ssl_hs_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; + + case ssl_hs_early_return: + *out_early_return = true; + hs->wait = ssl_hs_ok; + return 1; + + case ssl_hs_ok: + break; + } + + // Run the state machine again. + hs->wait = ssl->do_handshake(hs); + if (hs->wait == ssl_hs_error) { + hs->error.reset(ERR_save_state()); + return -1; + } + if (hs->wait == ssl_hs_ok) { + // The handshake has completed. + *out_early_return = false; + return 1; + } + + // Otherwise, loop to the beginning and resolve what was blocking the + // handshake. + } +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc new file mode 100644 index 0000000..6ced6b4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc @@ -0,0 +1,1882 @@ +/* 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. + * + * 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. + */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +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, + state_send_client_certificate, + state_send_client_key_exchange, + state_send_client_certificate_verify, + state_send_client_finished, + state_finish_flight, + state_read_session_ticket, + state_process_change_cipher_spec, + state_read_server_finished, + state_finish_client_handshake, + state_done, +}; + +// ssl_get_client_disabled sets |*out_mask_a| and |*out_mask_k| to masks of +// disabled algorithms. +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 (hs->config->psk_client_callback == NULL) { + *out_mask_a |= SSL_aPSK; + *out_mask_k |= SSL_kPSK; + } +} + +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(hs, &mask_a, &mask_k); + + CBB child; + if (!CBB_add_u16_length_prefixed(out, &child)) { + 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 false; + } + + // Add TLS 1.3 ciphers. Order ChaCha20-Poly1305 relative to AES-GCM based on + // hardware support. + if (hs->max_version >= TLS1_3_VERSION) { + if (!EVP_has_aes_hardware() && + !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + 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 false; + } + if (EVP_has_aes_hardware() && + !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + return false; + } + } + + if (hs->min_version < TLS1_3_VERSION) { + bool any_enabled = false; + for (const SSL_CIPHER *cipher : SSL_get_ciphers(ssl)) { + // Skip disabled ciphers + if ((cipher->algorithm_mkey & mask_k) || + (cipher->algorithm_auth & mask_a)) { + continue; + } + if (SSL_CIPHER_get_min_version(cipher) > hs->max_version || + SSL_CIPHER_get_max_version(cipher) < hs->min_version) { + continue; + } + any_enabled = true; + if (!CBB_add_u16(&child, ssl_cipher_get_value(cipher))) { + 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 false; + } + } + + if (ssl->mode & SSL_MODE_SEND_FALLBACK_SCSV) { + if (!CBB_add_u16(&child, SSL3_CK_FALLBACK_SCSV & 0xffff)) { + return false; + } + } + + return CBB_flush(out); +} + +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 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 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 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 false; + } + } + + size_t header_len = + SSL_is_dtls(ssl) ? DTLS1_HM_HEADER_LENGTH : SSL3_HM_HEADER_LENGTH; + if (!ssl_write_client_cipher_list(hs, &body) || + !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 false; + } + + Array msg; + if (!ssl->method->finish_message(ssl, cbb.get(), &msg)) { + 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, MakeSpan(msg))) { + return false; + } + + return ssl->method->add_message(ssl, std::move(msg)); +} + +static bool parse_supported_versions(SSL_HANDSHAKE *hs, uint16_t *version, + const CBS *in) { + // If the outer version is not TLS 1.2, or there is no extensions block, use + // the outer version. + if (*version != TLS1_2_VERSION || CBS_len(in) == 0) { + return true; + } + + SSL *const ssl = hs->ssl; + CBS copy = *in, extensions; + if (!CBS_get_u16_length_prefixed(©, &extensions) || + CBS_len(©) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + bool have_supported_versions; + CBS supported_versions; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* ignore unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + // Override the outer version with the extension, if present. + if (have_supported_versions && + (!CBS_get_u16(&supported_versions, version) || + CBS_len(&supported_versions) != 0)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + return true; +} + +static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ssl_do_info_callback(ssl, SSL_CB_HANDSHAKE_START, 1); + // |session_reused| must be reset in case this is a renegotiation. + ssl->s3->session_reused = false; + + // Freeze the version range. + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { + return ssl_hs_error; + } + + // 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. + if (SSL_is_dtls(hs->ssl)) { + hs->client_version = + hs->max_version >= TLS1_2_VERSION ? DTLS1_2_VERSION : DTLS1_VERSION; + } else { + hs->client_version = + hs->max_version >= TLS1_2_VERSION ? TLS1_2_VERSION : hs->max_version; + } + + // If the configured session has expired or was created at a disabled + // version, drop it. + if (ssl->session != NULL) { + if (ssl->session->is_server || + !ssl_supports_version(hs, ssl->session->ssl_version) || + (ssl->session->session_id_length == 0 && + ssl->session->ticket.empty()) || + ssl->session->not_resumable || + !ssl_session_is_time_valid(ssl, ssl->session.get())) { + ssl_set_session(ssl, NULL); + } + } + + if (!RAND_bytes(ssl->s3->client_random, sizeof(ssl->s3->client_random))) { + return ssl_hs_error; + } + + if (ssl->session != nullptr && + !ssl->s3->initial_handshake_complete && + ssl->session->session_id_length > 0) { + hs->session_id_len = ssl->session->session_id_length; + 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; + } + } + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->state = state_enter_early_data; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_enter_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (SSL_is_dtls(ssl)) { + hs->state = state_read_hello_verify_request; + return ssl_hs_ok; + } + + if (!hs->early_data_offered) { + hs->state = state_read_server_hello; + return ssl_hs_ok; + } + + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->session->ssl_version); + if (!ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + 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; + hs->can_early_write = true; + hs->state = state_read_server_hello; + return ssl_hs_early_return; +} + +static enum ssl_hs_wait_t do_read_hello_verify_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + assert(SSL_is_dtls(ssl)); + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != DTLS1_MT_HELLO_VERIFY_REQUEST) { + hs->state = state_read_server_hello; + return ssl_hs_ok; + } + + CBS hello_verify_request = msg.body, cookie; + uint16_t server_version; + if (!CBS_get_u16(&hello_verify_request, &server_version) || + !CBS_get_u8_length_prefixed(&hello_verify_request, &cookie) || + CBS_len(&cookie) > sizeof(ssl->d1->cookie) || + CBS_len(&hello_verify_request) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + OPENSSL_memcpy(ssl->d1->cookie, CBS_data(&cookie), CBS_len(&cookie)); + ssl->d1->cookie_len = CBS_len(&cookie); + + ssl->method->next_message(ssl); + + // DTLS resets the handshake buffer after HelloVerifyRequest. + if (!hs->transcript.Init()) { + return ssl_hs_error; + } + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->state = state_read_server_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_server_hello; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS server_hello = msg.body, server_random, session_id; + uint16_t server_version, cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&server_hello, &server_version) || + !CBS_get_bytes(&server_hello, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&server_hello, &session_id) || + CBS_len(&session_id) > SSL3_SESSION_ID_SIZE || + !CBS_get_u16(&server_hello, &cipher_suite) || + !CBS_get_u8(&server_hello, &compression_method)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Use the supported_versions extension if applicable. + if (!parse_supported_versions(hs, &server_version, &server_hello)) { + return ssl_hs_error; + } + + if (!ssl_supports_version(hs, server_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); + return ssl_hs_error; + } + + assert(ssl->s3->have_version == ssl->s3->initial_handshake_complete); + if (!ssl->s3->have_version) { + ssl->version = server_version; + // At this point, the connection's version is known and ssl->version is + // fixed. Begin enforcing the record-layer version. + ssl->s3->have_version = true; + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + } else if (server_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); + return ssl_hs_error; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + hs->state = state_tls13; + return ssl_hs_ok; + } + + // Clear some TLS 1.3 state that no longer needs to be retained. + 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 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); + return ssl_hs_error; + } + + // Copy over the server random. + OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), + SSL3_RANDOM_SIZE); + + // Enforce the TLS 1.3 anti-downgrade feature. + if (!ssl->s3->initial_handshake_complete && + 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 != nullptr && + ssl->session->session_id_length != 0 && + CBS_mem_equal(&session_id, ssl->session->session_id, + ssl->session->session_id_length)) { + ssl->s3->session_reused = true; + } else { + // The server may also have echoed back the TLS 1.3 compatibility mode + // session ID. As we know this is not a session the server knows about, any + // server resuming it is in error. Reject the first connection + // deterministicly, rather than installing an invalid session into the + // session cache. https://crbug.com/796910 + if (hs->session_id_len != 0 && + CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_ECHOED_INVALID_SESSION_ID); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // The session wasn't resumed. Create a fresh SSL_SESSION to + // fill out. + ssl_set_session(ssl, NULL); + if (!ssl_get_new_session(hs, 0 /* client */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + // Note: session_id could be empty. + hs->new_session->session_id_length = CBS_len(&session_id); + OPENSSL_memcpy(hs->new_session->session_id, CBS_data(&session_id), + CBS_len(&session_id)); + } + + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + if (cipher == NULL) { + // unknown cipher + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // The cipher must be allowed in the selected version and enabled. + uint32_t 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) || + !sk_SSL_CIPHER_find(SSL_get_ciphers(ssl), NULL, 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; + } + + if (ssl->session != NULL) { + if (ssl->session->ssl_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_VERSION_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + if (ssl->session->cipher != cipher) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + } else { + hs->new_session->cipher = cipher; + } + hs->new_cipher = cipher; + + // Now that the cipher is known, initialize the handshake hash and hash the + // ServerHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !ssl_hash_message(hs, msg)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // If doing a full handshake, the server may request a client certificate + // which requires hashing the handshake transcript. Otherwise, the handshake + // buffer may be released. + if (ssl->session != NULL || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->transcript.FreeBuffer(); + } + + // Only the NULL compression algorithm is supported. + if (compression_method != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // TLS extensions + if (!ssl_parse_serverhello_tlsext(hs, &server_hello)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + + // There should be nothing left over in the record. + if (CBS_len(&server_hello) != 0) { + // wrong packet length + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (ssl->session != NULL && + hs->extended_master_secret != ssl->session->extended_master_secret) { + if (ssl->session->extended_master_secret) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION); + } + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + 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); + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + + if (ssl->session != NULL) { + 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; + } + + hs->state = state_read_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_tls13(SSL_HANDSHAKE *hs) { + enum ssl_hs_wait_t wait = tls13_client_handshake(hs); + if (wait == ssl_hs_ok) { + hs->state = state_finish_client_handshake; + return ssl_hs_ok; + } + + return wait; +} + +static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_certificate_status; + 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_CERTIFICATE) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS body = msg.body; + uint8_t alert = SSL_AD_DECODE_ERROR; + 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; + } + + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!ssl_check_leaf_certificate( + hs, hs->peer_pubkey.get(), + 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; + } + + ssl->method->next_message(ssl); + + hs->state = state_read_certificate_status; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_certificate_status(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!hs->certificate_status_expected) { + hs->state = state_verify_server_certificate; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != SSL3_MT_CERTIFICATE_STATUS) { + // A server may send status_request in ServerHello and then change its mind + // about sending CertificateStatus. + hs->state = state_verify_server_certificate; + return ssl_hs_ok; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS certificate_status = msg.body, ocsp_response; + uint8_t status_type; + if (!CBS_get_u8(&certificate_status, &status_type) || + status_type != TLSEXT_STATUSTYPE_ocsp || + !CBS_get_u24_length_prefixed(&certificate_status, &ocsp_response) || + CBS_len(&ocsp_response) == 0 || + CBS_len(&certificate_status) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + 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; + } + + ssl->method->next_message(ssl); + + hs->state = state_verify_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_verify_server_certificate(SSL_HANDSHAKE *hs) { + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_server_key_exchange; + return ssl_hs_ok; + } + + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_verify_server_certificate; + return ssl_hs_certificate_verify; + } + + hs->state = state_read_server_key_exchange; + 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; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != SSL3_MT_SERVER_KEY_EXCHANGE) { + // Some ciphers (pure PSK) have an optional ServerKeyExchange message. + if (ssl_cipher_requires_server_key_exchange(hs->new_cipher)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + hs->state = state_read_certificate_request; + return ssl_hs_ok; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + uint32_t alg_k = hs->new_cipher->algorithm_mkey; + uint32_t alg_a = hs->new_cipher->algorithm_auth; + CBS server_key_exchange = msg.body; + if (alg_a & SSL_aPSK) { + CBS psk_identity_hint; + + // Each of the PSK key exchanges begins with a psk_identity_hint. + if (!CBS_get_u16_length_prefixed(&server_key_exchange, + &psk_identity_hint)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Store the PSK identity hint for the ClientKeyExchange. Assume that the + // maximum length of a PSK identity hint can be as long as the maximum + // length of a PSK identity. Also do not allow NULL characters; identities + // are saved as C strings. + // + // TODO(davidben): Should invalid hints be ignored? It's a hint rather than + // a specific identity. + if (CBS_len(&psk_identity_hint) > PSK_MAX_IDENTITY_LEN || + CBS_contains_zero_byte(&psk_identity_hint)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // Save non-empty identity hints as a C string. Empty identity hints we + // treat as missing. 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. + char *raw = nullptr; + if (CBS_len(&psk_identity_hint) != 0 && + !CBS_strdup(&psk_identity_hint, &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->peer_psk_identity_hint.reset(raw); + } + + if (alg_k & SSL_kECDHE) { + // Parse the server parameters. + uint8_t group_type; + uint16_t group_id; + CBS point; + if (!CBS_get_u8(&server_key_exchange, &group_type) || + group_type != NAMED_CURVE_TYPE || + !CBS_get_u16(&server_key_exchange, &group_id) || + !CBS_get_u8_length_prefixed(&server_key_exchange, &point)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + hs->new_session->group_id = group_id; + + // Ensure the group is consistent with preferences. + 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_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || + !hs->peer_key.CopyFrom(point)) { + return ssl_hs_error; + } + } else if (!(alg_k & SSL_kPSK)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + // At this point, |server_key_exchange| contains the signature, if any, while + // |msg.body| contains the entire message. From that, derive a CBS containing + // just the parameter. + CBS parameter; + CBS_init(¶meter, CBS_data(&msg.body), + CBS_len(&msg.body) - CBS_len(&server_key_exchange)); + + // ServerKeyExchange should be signed by the server's public key. + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + uint16_t signature_algorithm = 0; + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + if (!CBS_get_u16(&server_key_exchange, &signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + 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 ssl_hs_error; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + } else if (!tls1_get_legacy_signature_algorithm(&signature_algorithm, + hs->peer_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_CERTIFICATE); + return ssl_hs_error; + } + + // The last field in |server_key_exchange| is the signature. + CBS signature; + if (!CBS_get_u16_length_prefixed(&server_key_exchange, &signature) || + CBS_len(&server_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; + } + + ScopedCBB transcript; + Array transcript_data; + if (!CBB_init(transcript.get(), + 2 * SSL3_RANDOM_SIZE + CBS_len(¶meter)) || + !CBB_add_bytes(transcript.get(), ssl->s3->client_random, + SSL3_RANDOM_SIZE) || + !CBB_add_bytes(transcript.get(), ssl->s3->server_random, + SSL3_RANDOM_SIZE) || + !CBB_add_bytes(transcript.get(), CBS_data(¶meter), + CBS_len(¶meter)) || + !CBBFinishArray(transcript.get(), &transcript_data)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + 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); + return ssl_hs_error; + } + } else { + // PSK ciphers are the only supported certificate-less ciphers. + assert(alg_a == SSL_aPSK); + + if (CBS_len(&server_key_exchange) > 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXTRA_DATA_IN_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + } + + ssl->method->next_message(ssl); + hs->state = state_read_certificate_request; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_server_hello_done; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type == SSL3_MT_SERVER_HELLO_DONE) { + // If we get here we don't need the handshake buffer as we won't be doing + // client auth. + hs->transcript.FreeBuffer(); + hs->state = state_read_server_hello_done; + return ssl_hs_ok; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_REQUEST) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // Get the certificate types. + CBS body = msg.body, certificate_types; + if (!CBS_get_u8_length_prefixed(&body, &certificate_types)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (!hs->certificate_types.CopyFrom(certificate_types)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + CBS supported_signature_algorithms; + if (!CBS_get_u16_length_prefixed(&body, &supported_signature_algorithms) || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + UniquePtr ca_names = + ssl_parse_client_CA_list(ssl, &alert, &body); + if (!ca_names) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (CBS_len(&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; + } + + hs->cert_request = true; + hs->ca_names = std::move(ca_names); + ssl->ctx->x509_method->hs_flush_cached_ca_names(hs); + + ssl->method->next_message(ssl); + hs->state = state_read_server_hello_done; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_hello_done(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_SERVER_HELLO_DONE) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // ServerHelloDone is empty. + 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); + hs->state = state_send_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // The peer didn't request a certificate. + if (!hs->cert_request) { + hs->state = state_send_client_key_exchange; + return ssl_hs_ok; + } + + // Call cert_cb to update the certificate. + 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); + return ssl_hs_error; + } + if (rv < 0) { + hs->state = state_send_client_certificate; + return ssl_hs_x509_lookup; + } + } + + if (!ssl_has_certificate(hs)) { + // Without a client certificate, the handshake buffer may be released. + hs->transcript.FreeBuffer(); + } + + if (!ssl_on_certificate_selected(hs) || + !ssl_output_cert_chain(hs)) { + return ssl_hs_error; + } + + + hs->state = state_send_client_key_exchange; + return ssl_hs_ok; +} + +static_assert(sizeof(size_t) >= sizeof(unsigned), + "size_t is smaller than unsigned"); + +static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CLIENT_KEY_EXCHANGE)) { + return ssl_hs_error; + } + + 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 (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 = 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); + return ssl_hs_error; + } + assert(psk_len <= PSK_MAX_PSK_LEN); + + 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; + } + + // Write out psk_identity. + CBB child; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, (const uint8_t *)identity, + OPENSSL_strnlen(identity, sizeof(identity))) || + !CBB_flush(&body)) { + return ssl_hs_error; + } + } + + // Depending on the key exchange method, compute |pms|. + if (alg_k & SSL_kRSA) { + if (!pms.Init(SSL_MAX_MASTER_KEY_LENGTH)) { + return ssl_hs_error; + } + + RSA *rsa = EVP_PKEY_get0_RSA(hs->peer_pubkey.get()); + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + pms[0] = hs->client_version >> 8; + pms[1] = hs->client_version & 0xff; + if (!RAND_bytes(&pms[2], SSL_MAX_MASTER_KEY_LENGTH - 2)) { + return ssl_hs_error; + } + + CBB enc_pms; + uint8_t *ptr; + 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_flush(&body)) { + return ssl_hs_error; + } + } else if (alg_k & SSL_kECDHE) { + // Generate a keypair and serialize the public half. + CBB child; + if (!CBB_add_u8_length_prefixed(&body, &child)) { + return ssl_hs_error; + } + + // Compute the premaster. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!hs->key_shares[0]->Accept(&child, &pms, &alert, hs->peer_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + if (!CBB_flush(&body)) { + return ssl_hs_error; + } + + // The key exchange state may now be discarded. + 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 + // the pre-shared key. + if (!pms.Init(psk_len)) { + return ssl_hs_error; + } + OPENSSL_memset(pms.data(), 0, pms.size()); + } else { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + // For a PSK cipher suite, other_secret is combined with the pre-shared + // key. + if (alg_a & SSL_aPSK) { + ScopedCBB pms_cbb; + CBB child; + if (!CBB_init(pms_cbb.get(), 2 + psk_len + 2 + pms.size()) || + !CBB_add_u16_length_prefixed(pms_cbb.get(), &child) || + !CBB_add_bytes(&child, pms.data(), pms.size()) || + !CBB_add_u16_length_prefixed(pms_cbb.get(), &child) || + !CBB_add_bytes(&child, psk, psk_len) || + !CBBFinishArray(pms_cbb.get(), &pms)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_hs_error; + } + } + + // The message must be added to the finished hash before calculating the + // master secret. + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + hs->new_session->master_key_length = + tls1_generate_master_secret(hs, hs->new_session->master_key, pms); + if (hs->new_session->master_key_length == 0) { + return ssl_hs_error; + } + hs->new_session->extended_master_secret = hs->extended_master_secret; + + hs->state = state_send_client_certificate_verify; + return ssl_hs_ok; +} + +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(hs)) { + hs->state = state_send_client_finished; + return ssl_hs_ok; + } + + assert(ssl_has_private_key(hs)); + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_VERIFY)) { + return ssl_hs_error; + } + + 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) { + // Write out the digest type in TLS 1.2. + if (!CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + // Set aside space for the signature. + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *ptr; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &ptr, max_sig_len)) { + return ssl_hs_error; + } + + size_t sig_len = max_sig_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; + 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) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + // The handshake buffer is no longer necessary. + hs->transcript.FreeBuffer(); + + hs->state = state_send_client_finished; + return ssl_hs_ok; +} + +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->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { + return ssl_hs_error; + } + + if (hs->config->channel_id_private == NULL) { + hs->state = state_send_client_finished; + return ssl_hs_channel_id_lookup; + } + } + + if (!ssl->method->add_change_cipher_spec(ssl) || + !tls1_change_cipher_state(hs, evp_aead_seal)) { + return ssl_hs_error; + } + + if (hs->next_proto_neg_seen) { + static const uint8_t kZero[32] = {0}; + size_t padding_len = + 32 - ((ssl->s3->next_proto_negotiated.size() + 2) % 32); + + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_NEXT_PROTO) || + !CBB_add_u8_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, ssl->s3->next_proto_negotiated.data(), + ssl->s3->next_proto_negotiated.size()) || + !CBB_add_u8_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, kZero, padding_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (ssl->s3->channel_id_valid) { + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || + !tls1_write_channel_id(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (!ssl_send_finished(hs)) { + return ssl_hs_error; + } + + hs->state = state_finish_flight; + return ssl_hs_flush; +} + +static bool can_false_start(const SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // 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 || + 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 tightened? + if (!ssl->ctx->false_start_allowed_without_alpn && + ssl->s3->alpn_selected.empty() && + ssl->s3->next_proto_negotiated.empty()) { + return false; + } + + return true; +} + +static enum ssl_hs_wait_t do_finish_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->session != NULL) { + hs->state = state_finish_client_handshake; + return ssl_hs_ok; + } + + // This is a full handshake. If it involves ChannelID, then record the + // handshake hashes at this point in the session so that any resumption of + // this session with ChannelID can sign those hashes. + if (!tls1_record_handshake_hashes_for_channel_id(hs)) { + return ssl_hs_error; + } + + hs->state = state_read_session_ticket; + + if ((SSL_get_mode(ssl) & SSL_MODE_ENABLE_FALSE_START) && + can_false_start(hs) && + // No False Start on renegotiation (would complicate the state machine). + !ssl->s3->initial_handshake_complete) { + hs->in_false_start = true; + hs->can_early_write = true; + return ssl_hs_early_return; + } + + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!hs->ticket_expected) { + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_NEW_SESSION_TICKET) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS new_session_ticket = msg.body, ticket; + 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); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (CBS_len(&ticket) == 0) { + // RFC 5077 allows a server to change its mind and send no ticket after + // negotiating the extension. The value of |ticket_expected| is checked in + // |ssl_update_cache| so is cleared here to avoid an unnecessary update. + hs->ticket_expected = false; + ssl->method->next_message(ssl); + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; + } + + SSL_SESSION *session = hs->new_session.get(); + UniquePtr renewed_session; + if (ssl->session != NULL) { + // The server is sending a new ticket for an existing session. Sessions are + // immutable once established, so duplicate all but the ticket of the + // existing session. + renewed_session = + 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); + return ssl_hs_error; + } + session = renewed_session.get(); + } + + // |ticket_lifetime_hint| is measured from when the ticket was issued. + ssl_session_rebase_time(ssl, session); + + if (!session->ticket.CopyFrom(ticket)) { + return ssl_hs_error; + } + session->ticket_lifetime_hint = ticket_lifetime_hint; + + // 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 = false; + ssl->session = std::move(renewed_session); + } + + ssl->method->next_message(ssl); + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; +} + +static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { + if (!tls1_change_cipher_state(hs, evp_aead_open)) { + return ssl_hs_error; + } + + hs->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; + enum ssl_hs_wait_t wait = ssl_get_finished(hs); + if (wait != ssl_hs_ok) { + return wait; + } + + if (ssl->session != NULL) { + hs->state = state_send_client_finished; + return ssl_hs_ok; + } + + hs->state = state_finish_client_handshake; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ssl->method->on_handshake_complete(ssl); + + if (ssl->session != NULL) { + 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 + // have taken a reference to the temporary session. + ssl->s3->established_session = + SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_DUP_ALL); + if (!ssl->s3->established_session) { + return ssl_hs_error; + } + // Renegotiations do not participate in session resumption. + if (!ssl->s3->initial_handshake_complete) { + ssl->s3->established_session->not_resumable = false; + } + + hs->new_session.reset(); + } + + hs->handshake_finalized = true; + ssl->s3->initial_handshake_complete = true; + ssl_update_cache(hs, SSL_SESS_CACHE_CLIENT); + + hs->state = state_done; + return ssl_hs_ok; +} + +enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { + while (hs->state != state_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum ssl_client_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state_start_connect: + ret = do_start_connect(hs); + break; + 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; + case state_read_server_hello: + ret = do_read_server_hello(hs); + break; + case state_tls13: + ret = do_tls13(hs); + break; + case state_read_server_certificate: + ret = do_read_server_certificate(hs); + break; + case state_read_certificate_status: + ret = do_read_certificate_status(hs); + break; + 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; + case state_read_certificate_request: + ret = do_read_certificate_request(hs); + break; + case state_read_server_hello_done: + ret = do_read_server_hello_done(hs); + break; + case state_send_client_certificate: + ret = do_send_client_certificate(hs); + break; + case state_send_client_key_exchange: + ret = do_send_client_key_exchange(hs); + break; + case state_send_client_certificate_verify: + ret = do_send_client_certificate_verify(hs); + break; + case state_send_client_finished: + ret = do_send_client_finished(hs); + break; + case state_finish_flight: + ret = do_finish_flight(hs); + break; + case state_read_session_ticket: + ret = do_read_session_ticket(hs); + break; + case state_process_change_cipher_spec: + ret = do_process_change_cipher_spec(hs); + break; + case state_read_server_finished: + ret = do_read_server_finished(hs); + break; + case state_finish_client_handshake: + ret = do_finish_client_handshake(hs); + break; + case state_done: + ret = ssl_hs_ok; + break; + } + + if (hs->state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_CONNECT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_DONE, 1); + return ssl_hs_ok; +} + +const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { + enum ssl_client_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state_start_connect: + 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: + return "TLS client read_server_hello"; + case state_tls13: + return tls13_client_handshake_state(hs); + case state_read_server_certificate: + return "TLS client read_server_certificate"; + case state_read_certificate_status: + 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: + return "TLS client read_certificate_request"; + case state_read_server_hello_done: + return "TLS client read_server_hello_done"; + case state_send_client_certificate: + return "TLS client send_client_certificate"; + case state_send_client_key_exchange: + return "TLS client send_client_key_exchange"; + case state_send_client_certificate_verify: + return "TLS client send_client_certificate_verify"; + case state_send_client_finished: + return "TLS client send_client_finished"; + case state_finish_flight: + return "TLS client finish_flight"; + case state_read_session_ticket: + return "TLS client read_session_ticket"; + case state_process_change_cipher_spec: + return "TLS client process_change_cipher_spec"; + case state_read_server_finished: + return "TLS client read_server_finished"; + case state_finish_client_handshake: + return "TLS client finish_client_handshake"; + case state_done: + return "TLS client done"; + } + + return "TLS client unknown"; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back new file mode 100644 index 0000000..4041fe9 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back @@ -0,0 +1,1882 @@ +/* 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. + * + * 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. + */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +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, + state_send_client_certificate, + state_send_client_key_exchange, + state_send_client_certificate_verify, + state_send_client_finished, + state_finish_flight, + state_read_session_ticket, + state_process_change_cipher_spec, + state_read_server_finished, + state_finish_client_handshake, + state_done, +}; + +// ssl_get_client_disabled sets |*out_mask_a| and |*out_mask_k| to masks of +// disabled algorithms. +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 (hs->config->psk_client_callback == NULL) { + *out_mask_a |= SSL_aPSK; + *out_mask_k |= SSL_kPSK; + } +} + +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(hs, &mask_a, &mask_k); + + CBB child; + if (!CBB_add_u16_length_prefixed(out, &child)) { + 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 false; + } + + // Add TLS 1.3 ciphers. Order ChaCha20-Poly1305 relative to AES-GCM based on + // hardware support. + if (hs->max_version >= TLS1_3_VERSION) { + if (!EVP_has_aes_hardware() && + !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + 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 false; + } + if (EVP_has_aes_hardware() && + !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + return false; + } + } + + if (hs->min_version < TLS1_3_VERSION) { + bool any_enabled = false; + for (const SSL_CIPHER *cipher : SSL_get_ciphers(ssl)) { + // Skip disabled ciphers + if ((cipher->algorithm_mkey & mask_k) || + (cipher->algorithm_auth & mask_a)) { + continue; + } + if (SSL_CIPHER_get_min_version(cipher) > hs->max_version || + SSL_CIPHER_get_max_version(cipher) < hs->min_version) { + continue; + } + any_enabled = true; + if (!CBB_add_u16(&child, ssl_cipher_get_value(cipher))) { + 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 false; + } + } + + if (ssl->mode & SSL_MODE_SEND_FALLBACK_SCSV) { + if (!CBB_add_u16(&child, SSL3_CK_FALLBACK_SCSV & 0xffff)) { + return false; + } + } + + return CBB_flush(out); +} + +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 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 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 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 false; + } + } + + size_t header_len = + SSL_is_dtls(ssl) ? DTLS1_HM_HEADER_LENGTH : SSL3_HM_HEADER_LENGTH; + if (!ssl_write_client_cipher_list(hs, &body) || + !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 false; + } + + Array msg; + if (!ssl->method->finish_message(ssl, cbb.get(), &msg)) { + 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, MakeSpan(msg))) { + return false; + } + + return ssl->method->add_message(ssl, std::move(msg)); +} + +static bool parse_supported_versions(SSL_HANDSHAKE *hs, uint16_t *version, + const CBS *in) { + // If the outer version is not TLS 1.2, or there is no extensions block, use + // the outer version. + if (*version != TLS1_2_VERSION || CBS_len(in) == 0) { + return true; + } + + SSL *const ssl = hs->ssl; + CBS copy = *in, extensions; + if (!CBS_get_u16_length_prefixed(©, &extensions) || + CBS_len(©) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + bool have_supported_versions; + CBS supported_versions; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* ignore unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + // Override the outer version with the extension, if present. + if (have_supported_versions && + (!CBS_get_u16(&supported_versions, version) || + CBS_len(&supported_versions) != 0)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + return true; +} + +static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ssl_do_info_callback(ssl, SSL_CB_HANDSHAKE_START, 1); + // |session_reused| must be reset in case this is a renegotiation. + ssl->s3->session_reused = false; + + // Freeze the version range. + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { + return ssl_hs_error; + } + + // 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. + if (SSL_is_dtls(hs->ssl)) { + hs->client_version = + hs->max_version >= TLS1_2_VERSION ? DTLS1_2_VERSION : DTLS1_VERSION; + } else { + hs->client_version = + hs->max_version >= TLS1_2_VERSION ? TLS1_2_VERSION : hs->max_version; + } + + // If the configured session has expired or was created at a disabled + // version, drop it. + if (ssl->session != NULL) { + if (ssl->session->is_server || + !ssl_supports_version(hs, ssl->session->ssl_version) || + (ssl->session->session_id_length == 0 && + ssl->session->ticket.empty()) || + ssl->session->not_resumable || + !ssl_session_is_time_valid(ssl, ssl->session.get())) { + ssl_set_session(ssl, NULL); + } + } + + if (!RAND_bytes(ssl->s3->client_random, sizeof(ssl->s3->client_random))) { + return ssl_hs_error; + } + + if (ssl->session != nullptr && + !ssl->s3->initial_handshake_complete && + ssl->session->session_id_length > 0) { + hs->session_id_len = ssl->session->session_id_length; + 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; + } + } + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->state = state_enter_early_data; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_enter_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (SSL_is_dtls(ssl)) { + hs->state = state_read_hello_verify_request; + return ssl_hs_ok; + } + + if (!hs->early_data_offered) { + hs->state = state_read_server_hello; + return ssl_hs_ok; + } + + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->session->ssl_version); + if (!ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + 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; + hs->can_early_write = true; + hs->state = state_read_server_hello; + return ssl_hs_early_return; +} + +static enum ssl_hs_wait_t do_read_hello_verify_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + assert(SSL_is_dtls(ssl)); + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != DTLS1_MT_HELLO_VERIFY_REQUEST) { + hs->state = state_read_server_hello; + return ssl_hs_ok; + } + + CBS hello_verify_request = msg.body, cookie; + uint16_t server_version; + if (!CBS_get_u16(&hello_verify_request, &server_version) || + !CBS_get_u8_length_prefixed(&hello_verify_request, &cookie) || + CBS_len(&cookie) > sizeof(ssl->d1->cookie) || + CBS_len(&hello_verify_request) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + OPENSSL_memcpy(ssl->d1->cookie, CBS_data(&cookie), CBS_len(&cookie)); + ssl->d1->cookie_len = CBS_len(&cookie); + + ssl->method->next_message(ssl); + + // DTLS resets the handshake buffer after HelloVerifyRequest. + if (!hs->transcript.Init()) { + return ssl_hs_error; + } + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->state = state_read_server_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_server_hello; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS server_hello = msg.body, server_random, session_id; + uint16_t server_version, cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&server_hello, &server_version) || + !CBS_get_bytes(&server_hello, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&server_hello, &session_id) || + CBS_len(&session_id) > SSL3_SESSION_ID_SIZE || + !CBS_get_u16(&server_hello, &cipher_suite) || + !CBS_get_u8(&server_hello, &compression_method)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Use the supported_versions extension if applicable. + if (!parse_supported_versions(hs, &server_version, &server_hello)) { + return ssl_hs_error; + } + + if (!ssl_supports_version(hs, server_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); + return ssl_hs_error; + } + + assert(ssl->s3->have_version == ssl->s3->initial_handshake_complete); + if (!ssl->s3->have_version) { + ssl->version = server_version; + // At this point, the connection's version is known and ssl->version is + // fixed. Begin enforcing the record-layer version. + ssl->s3->have_version = true; + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + } else if (server_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); + return ssl_hs_error; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + hs->state = state_tls13; + return ssl_hs_ok; + } + + // Clear some TLS 1.3 state that no longer needs to be retained. + 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 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); + return ssl_hs_error; + } + + // Copy over the server random. + OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), + SSL3_RANDOM_SIZE); + + // Enforce the TLS 1.3 anti-downgrade feature. + if (!ssl->s3->initial_handshake_complete && + 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 != nullptr && + ssl->session->session_id_length != 0 && + CBS_mem_equal(&session_id, ssl->session->session_id, + ssl->session->session_id_length)) { + ssl->s3->session_reused = true; + } else { + // The server may also have echoed back the TLS 1.3 compatibility mode + // session ID. As we know this is not a session the server knows about, any + // server resuming it is in error. Reject the first connection + // deterministicly, rather than installing an invalid session into the + // session cache. https://crbug.com/796910 + if (hs->session_id_len != 0 && + CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_ECHOED_INVALID_SESSION_ID); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // The session wasn't resumed. Create a fresh SSL_SESSION to + // fill out. + ssl_set_session(ssl, NULL); + if (!ssl_get_new_session(hs, 0 /* client */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + // Note: session_id could be empty. + hs->new_session->session_id_length = CBS_len(&session_id); + OPENSSL_memcpy(hs->new_session->session_id, CBS_data(&session_id), + CBS_len(&session_id)); + } + + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + if (cipher == NULL) { + // unknown cipher + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // The cipher must be allowed in the selected version and enabled. + uint32_t 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) || + !sk_SSL_CIPHER_find(SSL_get_ciphers(ssl), NULL, 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; + } + + if (ssl->session != NULL) { + if (ssl->session->ssl_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_VERSION_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + if (ssl->session->cipher != cipher) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + } else { + hs->new_session->cipher = cipher; + } + hs->new_cipher = cipher; + + // Now that the cipher is known, initialize the handshake hash and hash the + // ServerHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !ssl_hash_message(hs, msg)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // If doing a full handshake, the server may request a client certificate + // which requires hashing the handshake transcript. Otherwise, the handshake + // buffer may be released. + if (ssl->session != NULL || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->transcript.FreeBuffer(); + } + + // Only the NULL compression algorithm is supported. + if (compression_method != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // TLS extensions + if (!ssl_parse_serverhello_tlsext(hs, &server_hello)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + + // There should be nothing left over in the record. + if (CBS_len(&server_hello) != 0) { + // wrong packet length + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (ssl->session != NULL && + hs->extended_master_secret != ssl->session->extended_master_secret) { + if (ssl->session->extended_master_secret) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION); + } + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + 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); + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + + if (ssl->session != NULL) { + 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; + } + + hs->state = state_read_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_tls13(SSL_HANDSHAKE *hs) { + enum ssl_hs_wait_t wait = tls13_client_handshake(hs); + if (wait == ssl_hs_ok) { + hs->state = state_finish_client_handshake; + return ssl_hs_ok; + } + + return wait; +} + +static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_certificate_status; + 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_CERTIFICATE) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS body = msg.body; + uint8_t alert = SSL_AD_DECODE_ERROR; + 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; + } + + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!ssl_check_leaf_certificate( + hs, hs->peer_pubkey.get(), + 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; + } + + ssl->method->next_message(ssl); + + hs->state = state_read_certificate_status; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_certificate_status(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!hs->certificate_status_expected) { + hs->state = state_verify_server_certificate; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != SSL3_MT_CERTIFICATE_STATUS) { + // A server may send status_request in ServerHello and then change its mind + // about sending CertificateStatus. + hs->state = state_verify_server_certificate; + return ssl_hs_ok; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS certificate_status = msg.body, ocsp_response; + uint8_t status_type; + if (!CBS_get_u8(&certificate_status, &status_type) || + status_type != TLSEXT_STATUSTYPE_ocsp || + !CBS_get_u24_length_prefixed(&certificate_status, &ocsp_response) || + CBS_len(&ocsp_response) == 0 || + CBS_len(&certificate_status) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + 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; + } + + ssl->method->next_message(ssl); + + hs->state = state_verify_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_verify_server_certificate(SSL_HANDSHAKE *hs) { + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_server_key_exchange; + return ssl_hs_ok; + } + + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_verify_server_certificate; + return ssl_hs_certificate_verify; + } + + hs->state = state_read_server_key_exchange; + 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; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type != SSL3_MT_SERVER_KEY_EXCHANGE) { + // Some ciphers (pure PSK) have an optional ServerKeyExchange message. + if (ssl_cipher_requires_server_key_exchange(hs->new_cipher)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + hs->state = state_read_certificate_request; + return ssl_hs_ok; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + uint32_t alg_k = hs->new_cipher->algorithm_mkey; + uint32_t alg_a = hs->new_cipher->algorithm_auth; + CBS server_key_exchange = msg.body; + if (alg_a & SSL_aPSK) { + CBS psk_identity_hint; + + // Each of the PSK key exchanges begins with a psk_identity_hint. + if (!CBS_get_u16_length_prefixed(&server_key_exchange, + &psk_identity_hint)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Store the PSK identity hint for the ClientKeyExchange. Assume that the + // maximum length of a PSK identity hint can be as long as the maximum + // length of a PSK identity. Also do not allow NULL characters; identities + // are saved as C strings. + // + // TODO(davidben): Should invalid hints be ignored? It's a hint rather than + // a specific identity. + if (CBS_len(&psk_identity_hint) > PSK_MAX_IDENTITY_LEN || + CBS_contains_zero_byte(&psk_identity_hint)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // Save non-empty identity hints as a C string. Empty identity hints we + // treat as missing. 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. + char *raw = nullptr; + if (CBS_len(&psk_identity_hint) != 0 && + !CBS_strdup(&psk_identity_hint, &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->peer_psk_identity_hint.reset(raw); + } + + if (alg_k & SSL_kECDHE) { + // Parse the server parameters. + uint8_t group_type; + uint16_t group_id; + CBS point; + if (!CBS_get_u8(&server_key_exchange, &group_type) || + group_type != NAMED_CURVE_TYPE || + !CBS_get_u16(&server_key_exchange, &group_id) || + !CBS_get_u8_length_prefixed(&server_key_exchange, &point)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + hs->new_session->group_id = group_id; + + // Ensure the group is consistent with preferences. + 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_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || + !hs->peer_key.CopyFrom(point)) { + return ssl_hs_error; + } + } else if (!(alg_k & SSL_kPSK)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + // At this point, |server_key_exchange| contains the signature, if any, while + // |msg.body| contains the entire message. From that, derive a CBS containing + // just the parameter. + CBS parameter; + CBS_init(¶meter, CBS_data(&msg.body), + CBS_len(&msg.body) - CBS_len(&server_key_exchange)); + + // ServerKeyExchange should be signed by the server's public key. + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + uint16_t signature_algorithm = 0; + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + if (!CBS_get_u16(&server_key_exchange, &signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + 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 ssl_hs_error; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + } else if (!tls1_get_legacy_signature_algorithm(&signature_algorithm, + hs->peer_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_CERTIFICATE); + return ssl_hs_error; + } + + // The last field in |server_key_exchange| is the signature. + CBS signature; + if (!CBS_get_u16_length_prefixed(&server_key_exchange, &signature) || + CBS_len(&server_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; + } + + ScopedCBB transcript; + Array transcript_data; + if (!CBB_init(transcript.get(), + 2 * SSL3_RANDOM_SIZE + CBS_len(¶meter)) || + !CBB_add_bytes(transcript.get(), ssl->s3->client_random, + SSL3_RANDOM_SIZE) || + !CBB_add_bytes(transcript.get(), ssl->s3->server_random, + SSL3_RANDOM_SIZE) || + !CBB_add_bytes(transcript.get(), CBS_data(¶meter), + CBS_len(¶meter)) || + !CBBFinishArray(transcript.get(), &transcript_data)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + 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); + return ssl_hs_error; + } + } else { + // PSK ciphers are the only supported certificate-less ciphers. + assert(alg_a == SSL_aPSK); + + if (CBS_len(&server_key_exchange) > 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXTRA_DATA_IN_MESSAGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + } + + ssl->method->next_message(ssl); + hs->state = state_read_certificate_request; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_read_server_hello_done; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (msg.type == SSL3_MT_SERVER_HELLO_DONE) { + // If we get here we don't need the handshake buffer as we won't be doing + // client auth. + hs->transcript.FreeBuffer(); + hs->state = state_read_server_hello_done; + return ssl_hs_ok; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_REQUEST) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // Get the certificate types. + CBS body = msg.body, certificate_types; + if (!CBS_get_u8_length_prefixed(&body, &certificate_types)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (!hs->certificate_types.CopyFrom(certificate_types)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + CBS supported_signature_algorithms; + if (!CBS_get_u16_length_prefixed(&body, &supported_signature_algorithms) || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + UniquePtr ca_names = + ssl_parse_client_CA_list(ssl, &alert, &body); + if (!ca_names) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (CBS_len(&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; + } + + hs->cert_request = true; + hs->ca_names = std::move(ca_names); + ssl->ctx->x509_method->hs_flush_cached_ca_names(hs); + + ssl->method->next_message(ssl); + hs->state = state_read_server_hello_done; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_hello_done(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_SERVER_HELLO_DONE) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // ServerHelloDone is empty. + 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); + hs->state = state_send_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // The peer didn't request a certificate. + if (!hs->cert_request) { + hs->state = state_send_client_key_exchange; + return ssl_hs_ok; + } + + // Call cert_cb to update the certificate. + 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); + return ssl_hs_error; + } + if (rv < 0) { + hs->state = state_send_client_certificate; + return ssl_hs_x509_lookup; + } + } + + if (!ssl_has_certificate(hs)) { + // Without a client certificate, the handshake buffer may be released. + hs->transcript.FreeBuffer(); + } + + if (!ssl_on_certificate_selected(hs) || + !ssl_output_cert_chain(hs)) { + return ssl_hs_error; + } + + + hs->state = state_send_client_key_exchange; + return ssl_hs_ok; +} + +static_assert(sizeof(size_t) >= sizeof(unsigned), + "size_t is smaller than unsigned"); + +static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CLIENT_KEY_EXCHANGE)) { + return ssl_hs_error; + } + + 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 (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 = 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); + return ssl_hs_error; + } + assert(psk_len <= PSK_MAX_PSK_LEN); + + 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; + } + + // Write out psk_identity. + CBB child; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, (const uint8_t *)identity, + OPENSSL_strnlen(identity, sizeof(identity))) || + !CBB_flush(&body)) { + return ssl_hs_error; + } + } + + // Depending on the key exchange method, compute |pms|. + if (alg_k & SSL_kRSA) { + if (!pms.Init(SSL_MAX_MASTER_KEY_LENGTH)) { + return ssl_hs_error; + } + + RSA *rsa = EVP_PKEY_get0_RSA(hs->peer_pubkey.get()); + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + pms[0] = hs->client_version >> 8; + pms[1] = hs->client_version & 0xff; + if (!RAND_bytes(&pms[2], SSL_MAX_MASTER_KEY_LENGTH - 2)) { + return ssl_hs_error; + } + + CBB enc_pms; + uint8_t *ptr; + 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_flush(&body)) { + return ssl_hs_error; + } + } else if (alg_k & SSL_kECDHE) { + // Generate a keypair and serialize the public half. + CBB child; + if (!CBB_add_u8_length_prefixed(&body, &child)) { + return ssl_hs_error; + } + + // Compute the premaster. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!hs->key_shares[0]->Accept(&child, &pms, &alert, hs->peer_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + if (!CBB_flush(&body)) { + return ssl_hs_error; + } + + // The key exchange state may now be discarded. + 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 + // the pre-shared key. + if (!pms.Init(psk_len)) { + return ssl_hs_error; + } + OPENSSL_memset(pms.data(), 0, pms.size()); + } else { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + // For a PSK cipher suite, other_secret is combined with the pre-shared + // key. + if (alg_a & SSL_aPSK) { + ScopedCBB pms_cbb; + CBB child; + if (!CBB_init(pms_cbb.get(), 2 + psk_len + 2 + pms.size()) || + !CBB_add_u16_length_prefixed(pms_cbb.get(), &child) || + !CBB_add_bytes(&child, pms.data(), pms.size()) || + !CBB_add_u16_length_prefixed(pms_cbb.get(), &child) || + !CBB_add_bytes(&child, psk, psk_len) || + !CBBFinishArray(pms_cbb.get(), &pms)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_hs_error; + } + } + + // The message must be added to the finished hash before calculating the + // master secret. + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + hs->new_session->master_key_length = + tls1_generate_master_secret(hs, hs->new_session->master_key, pms); + if (hs->new_session->master_key_length == 0) { + return ssl_hs_error; + } + hs->new_session->extended_master_secret = hs->extended_master_secret; + + hs->state = state_send_client_certificate_verify; + return ssl_hs_ok; +} + +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(hs)) { + hs->state = state_send_client_finished; + return ssl_hs_ok; + } + + assert(ssl_has_private_key(hs)); + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_VERIFY)) { + return ssl_hs_error; + } + + 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) { + // Write out the digest type in TLS 1.2. + if (!CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + // Set aside space for the signature. + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *ptr; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &ptr, max_sig_len)) { + return ssl_hs_error; + } + + size_t sig_len = max_sig_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; + 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) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + // The handshake buffer is no longer necessary. + hs->transcript.FreeBuffer(); + + hs->state = state_send_client_finished; + return ssl_hs_ok; +} + +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->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { + return ssl_hs_error; + } + + if (hs->config->channel_id_private == NULL) { + hs->state = state_send_client_finished; + return ssl_hs_channel_id_lookup; + } + } + + if (!ssl->method->add_change_cipher_spec(ssl) || + !tls1_change_cipher_state(hs, evp_aead_seal)) { + return ssl_hs_error; + } + + if (hs->next_proto_neg_seen) { + static const uint8_t kZero[32] = {0}; + size_t padding_len = + 32 - ((ssl->s3->next_proto_negotiated.size() + 2) % 32); + + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_NEXT_PROTO) || + !CBB_add_u8_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, ssl->s3->next_proto_negotiated.data(), + ssl->s3->next_proto_negotiated.size()) || + !CBB_add_u8_length_prefixed(&body, &child) || + !CBB_add_bytes(&child, kZero, padding_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (ssl->s3->channel_id_valid) { + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || + !tls1_write_channel_id(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (!ssl_send_finished(hs)) { + return ssl_hs_error; + } + + hs->state = state_finish_flight; + return ssl_hs_flush; +} + +static bool can_false_start(const SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // 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 || + 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 tightened? + if (!ssl->ctx->false_start_allowed_without_alpn && + ssl->s3->alpn_selected.empty() && + ssl->s3->next_proto_negotiated.empty()) { + return false; + } + + return true; +} + +static enum ssl_hs_wait_t do_finish_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->session != NULL) { + hs->state = state_finish_client_handshake; + return ssl_hs_ok; + } + + // This is a full handshake. If it involves ChannelID, then record the + // handshake hashes at this point in the session so that any resumption of + // this session with ChannelID can sign those hashes. + if (!tls1_record_handshake_hashes_for_channel_id(hs)) { + return ssl_hs_error; + } + + hs->state = state_read_session_ticket; + + if ((SSL_get_mode(ssl) & SSL_MODE_ENABLE_FALSE_START) && + can_false_start(hs) && + // No False Start on renegotiation (would complicate the state machine). + !ssl->s3->initial_handshake_complete) { + hs->in_false_start = true; + hs->can_early_write = true; + return ssl_hs_early_return; + } + + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (!hs->ticket_expected) { + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_NEW_SESSION_TICKET) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS new_session_ticket = msg.body, ticket; + 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); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (CBS_len(&ticket) == 0) { + // RFC 5077 allows a server to change its mind and send no ticket after + // negotiating the extension. The value of |ticket_expected| is checked in + // |ssl_update_cache| so is cleared here to avoid an unnecessary update. + hs->ticket_expected = false; + ssl->method->next_message(ssl); + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; + } + + SSL_SESSION *session = hs->new_session.get(); + UniquePtr renewed_session; + if (ssl->session != NULL) { + // The server is sending a new ticket for an existing session. Sessions are + // immutable once established, so duplicate all but the ticket of the + // existing session. + renewed_session = + 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); + return ssl_hs_error; + } + session = renewed_session.get(); + } + + // |ticket_lifetime_hint| is measured from when the ticket was issued. + ssl_session_rebase_time(ssl, session); + + if (!session->ticket.CopyFrom(ticket)) { + return ssl_hs_error; + } + session->ticket_lifetime_hint = ticket_lifetime_hint; + + // 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 = false; + ssl->session = std::move(renewed_session); + } + + ssl->method->next_message(ssl); + hs->state = state_process_change_cipher_spec; + return ssl_hs_read_change_cipher_spec; +} + +static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { + if (!tls1_change_cipher_state(hs, evp_aead_open)) { + return ssl_hs_error; + } + + hs->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; + enum ssl_hs_wait_t wait = ssl_get_finished(hs); + if (wait != ssl_hs_ok) { + return wait; + } + + if (ssl->session != NULL) { + hs->state = state_send_client_finished; + return ssl_hs_ok; + } + + hs->state = state_finish_client_handshake; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ssl->method->on_handshake_complete(ssl); + + if (ssl->session != NULL) { + 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 + // have taken a reference to the temporary session. + ssl->s3->established_session = + SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_DUP_ALL); + if (!ssl->s3->established_session) { + return ssl_hs_error; + } + // Renegotiations do not participate in session resumption. + if (!ssl->s3->initial_handshake_complete) { + ssl->s3->established_session->not_resumable = false; + } + + hs->new_session.reset(); + } + + hs->handshake_finalized = true; + ssl->s3->initial_handshake_complete = true; + ssl_update_cache(hs, SSL_SESS_CACHE_CLIENT); + + hs->state = state_done; + return ssl_hs_ok; +} + +enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { + while (hs->state != state_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum ssl_client_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state_start_connect: + ret = do_start_connect(hs); + break; + 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; + case state_read_server_hello: + ret = do_read_server_hello(hs); + break; + case state_tls13: + ret = do_tls13(hs); + break; + case state_read_server_certificate: + ret = do_read_server_certificate(hs); + break; + case state_read_certificate_status: + ret = do_read_certificate_status(hs); + break; + 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; + case state_read_certificate_request: + ret = do_read_certificate_request(hs); + break; + case state_read_server_hello_done: + ret = do_read_server_hello_done(hs); + break; + case state_send_client_certificate: + ret = do_send_client_certificate(hs); + break; + case state_send_client_key_exchange: + ret = do_send_client_key_exchange(hs); + break; + case state_send_client_certificate_verify: + ret = do_send_client_certificate_verify(hs); + break; + case state_send_client_finished: + ret = do_send_client_finished(hs); + break; + case state_finish_flight: + ret = do_finish_flight(hs); + break; + case state_read_session_ticket: + ret = do_read_session_ticket(hs); + break; + case state_process_change_cipher_spec: + ret = do_process_change_cipher_spec(hs); + break; + case state_read_server_finished: + ret = do_read_server_finished(hs); + break; + case state_finish_client_handshake: + ret = do_finish_client_handshake(hs); + break; + case state_done: + ret = ssl_hs_ok; + break; + } + + if (hs->state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_CONNECT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_DONE, 1); + return ssl_hs_ok; +} + +const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { + enum ssl_client_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state_start_connect: + 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: + return "TLS client read_server_hello"; + case state_tls13: + return tls13_client_handshake_state(hs); + case state_read_server_certificate: + return "TLS client read_server_certificate"; + case state_read_certificate_status: + 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: + return "TLS client read_certificate_request"; + case state_read_server_hello_done: + return "TLS client read_server_hello_done"; + case state_send_client_certificate: + return "TLS client send_client_certificate"; + case state_send_client_key_exchange: + return "TLS client send_client_key_exchange"; + case state_send_client_certificate_verify: + return "TLS client send_client_certificate_verify"; + case state_send_client_finished: + return "TLS client send_client_finished"; + case state_finish_flight: + return "TLS client finish_flight"; + case state_read_session_ticket: + return "TLS client read_session_ticket"; + case state_process_change_cipher_spec: + return "TLS client process_change_cipher_spec"; + case state_read_server_finished: + return "TLS client read_server_finished"; + case state_finish_client_handshake: + return "TLS client finish_client_handshake"; + case state_done: + return "TLS client done"; + } + + return "TLS client unknown"; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc new file mode 100644 index 0000000..a1ae311 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc @@ -0,0 +1,1797 @@ +/* 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. + * + * 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. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +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); + + while (CBS_len(&cipher_suites) > 0) { + uint16_t got_id; + if (!CBS_get_u16(&cipher_suites, &got_id)) { + return false; + } + + if (got_id == id) { + return true; + } + } + + return false; +} + +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; + if (ssl_client_hello_get_extension(client_hello, &supported_versions, + TLSEXT_TYPE_supported_versions)) { + if (!CBS_get_u8_length_prefixed(&supported_versions, &versions) || + CBS_len(&supported_versions) != 0 || + CBS_len(&versions) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + } else { + // Convert the ClientHello version to an equivalent supported_versions + // extension. + static const uint8_t kTLSVersions[] = { + 0x03, 0x03, // TLS 1.2 + 0x03, 0x02, // TLS 1.1 + 0x03, 0x01, // TLS 1 + }; + + static const uint8_t kDTLSVersions[] = { + 0xfe, 0xfd, // DTLS 1.2 + 0xfe, 0xff, // DTLS 1.0 + }; + + size_t versions_len = 0; + if (SSL_is_dtls(ssl)) { + if (client_hello->version <= DTLS1_2_VERSION) { + versions_len = 4; + } else if (client_hello->version <= DTLS1_VERSION) { + versions_len = 2; + } + CBS_init(&versions, kDTLSVersions + sizeof(kDTLSVersions) - versions_len, + versions_len); + } else { + if (client_hello->version >= TLS1_2_VERSION) { + versions_len = 6; + } else if (client_hello->version >= TLS1_1_VERSION) { + versions_len = 4; + } else if (client_hello->version >= TLS1_VERSION) { + versions_len = 2; + } + CBS_init(&versions, kTLSVersions + sizeof(kTLSVersions) - versions_len, + versions_len); + } + } + + if (!ssl_negotiate_version(hs, out_alert, &ssl->version, &versions)) { + return false; + } + + // At this point, the connection's version is known and |ssl->version| is + // fixed. Begin enforcing the record-layer version. + ssl->s3->have_version = true; + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + + // Handle FALLBACK_SCSV. + if (ssl_client_cipher_list_contains_cipher(client_hello, + SSL3_CK_FALLBACK_SCSV & 0xffff) && + ssl_protocol_version(ssl) < hs->max_version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INAPPROPRIATE_FALLBACK); + *out_alert = SSL3_AD_INAPPROPRIATE_FALLBACK; + return false; + } + + return true; +} + +static UniquePtr ssl_parse_client_cipher_list( + const SSL_CLIENT_HELLO *client_hello) { + CBS cipher_suites; + CBS_init(&cipher_suites, client_hello->cipher_suites, + client_hello->cipher_suites_len); + + UniquePtr sk(sk_SSL_CIPHER_new_null()); + if (!sk) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + while (CBS_len(&cipher_suites) > 0) { + uint16_t cipher_suite; + + if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); + return nullptr; + } + + const SSL_CIPHER *c = SSL_get_cipher_by_value(cipher_suite); + if (c != NULL && !sk_SSL_CIPHER_push(sk.get(), c)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + return sk; +} + +// ssl_get_compatible_server_ciphers determines the key exchange and +// authentication cipher suite masks compatible with the server configuration +// and current ClientHello parameters of |hs|. It sets |*out_mask_k| to the key +// exchange mask and |*out_mask_a| to the authentication mask. +static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, + uint32_t *out_mask_k, + uint32_t *out_mask_a) { + uint32_t mask_k = 0; + uint32_t mask_a = 0; + + 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; + } + } + + // Check for a shared group to consider ECDHE ciphers. + uint16_t unused; + if (tls1_get_shared_group(hs, &unused)) { + mask_k |= SSL_kECDHE; + } + + // PSK requires a server callback. + if (hs->config->psk_server_callback != NULL) { + mask_k |= SSL_kPSK; + mask_a |= SSL_aPSK; + } + + *out_mask_k = mask_k; + *out_mask_a = mask_a; +} + +static const SSL_CIPHER *ssl3_choose_cipher( + SSL_HANDSHAKE *hs, const SSL_CLIENT_HELLO *client_hello, + const SSLCipherPreferenceList *server_pref) { + SSL *const ssl = hs->ssl; + 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 |SSLCipherPreferenceList| + // struct. + 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; + + UniquePtr client_pref = + ssl_parse_client_cipher_list(client_hello); + if (!client_pref) { + return nullptr; + } + + if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { + 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.get(); + } + + uint32_t mask_k, mask_a; + ssl_get_compatible_server_ciphers(hs, &mask_k, &mask_a); + + for (size_t i = 0; i < sk_SSL_CIPHER_num(prio); i++) { + const SSL_CIPHER *c = sk_SSL_CIPHER_value(prio, i); + + size_t cipher_index; + if (// Check if the cipher is supported for the current version. + SSL_CIPHER_get_min_version(c) <= ssl_protocol_version(ssl) && + ssl_protocol_version(ssl) <= SSL_CIPHER_get_max_version(c) && + // Check the cipher is supported for the server configuration. + (c->algorithm_mkey & mask_k) && + (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]) { + // 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) { + group_min = cipher_index; + } + } else { + if (group_min != -1 && (size_t)group_min < cipher_index) { + cipher_index = group_min; + } + return sk_SSL_CIPHER_value(allow, cipher_index); + } + } + + 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); + } + } + + return nullptr; +} + +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 = 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; + + 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_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + 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)) { + case ssl_select_cert_retry: + return ssl_hs_certificate_selection_pending; + + case ssl_select_cert_error: + // Connection rejected. + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + + default: + /* fallthrough */; + } + } + + // Freeze the version range after the early callback. + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { + return ssl_hs_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; + } + + hs->client_version = client_hello.version; + if (client_hello.random_len != SSL3_RANDOM_SIZE) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + OPENSSL_memcpy(ssl->s3->client_random, client_hello.random, + client_hello.random_len); + + // Only null compression is supported. TLS 1.3 further requires the peer + // advertise no other compression. + if (OPENSSL_memchr(client_hello.compression_methods, 0, + client_hello.compression_methods_len) == NULL || + (ssl_protocol_version(ssl) >= TLS1_3_VERSION && + client_hello.compression_methods_len != 1)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMPRESSION_LIST); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // TLS extensions. + if (!ssl_parse_clienthello_tlsext(hs, &client_hello)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + + hs->state = state12_select_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // Call |cert_cb| to update server certificates if required. + 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); + return ssl_hs_error; + } + if (rv < 0) { + return ssl_hs_x509_lookup; + } + } + + if (!ssl_on_certificate_selected(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 = 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; + } + + // Negotiate the cipher suite. This must be done after |cert_cb| so the + // certificate is finalized. + 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 = 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 = state12_finish_server_handshake; + return ssl_hs_ok; + } + + return wait; +} + +static enum ssl_hs_wait_t do_select_parameters(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)) { + return ssl_hs_error; + } + + // Determine whether we are doing session resumption. + UniquePtr session; + bool tickets_supported = false, renew_ticket = false; + enum ssl_hs_wait_t wait = ssl_get_prev_session( + hs, &session, &tickets_supported, &renew_ticket, &client_hello); + if (wait != ssl_hs_ok) { + return wait; + } + + if (session) { + if (session->extended_master_secret && !hs->extended_master_secret) { + // A ClientHello without EMS that attempts to resume a session with EMS + // is fatal to the connection. + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + if (!ssl_session_is_resumable(hs, session.get()) || + // If the client offers the EMS extension, but the previous session + // didn't use it, then negotiate a new session. + hs->extended_master_secret != session->extended_master_secret) { + session.reset(); + } + } + + if (session) { + // Use the old session. + hs->ticket_expected = renew_ticket; + ssl->session = std::move(session); + ssl->s3->session_reused = true; + } else { + hs->ticket_expected = tickets_supported; + ssl_set_session(ssl, NULL); + if (!ssl_get_new_session(hs, 1 /* server */)) { + return ssl_hs_error; + } + + // Clear the session ID if we want the session to be single-use. + if (!(ssl->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)) { + hs->new_session->session_id_length = 0; + } + } + + 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; + } + + if (ssl->session == NULL) { + hs->new_session->cipher = hs->new_cipher; + + // 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; + } + // CertificateRequest may only be sent in certificate-based ciphers. + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->cert_request = false; + } + + 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; + } + } + + // 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; + } + + // Now that all parameters are known, initialize the handshake hash and hash + // the ClientHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !ssl_hash_message(hs, msg)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // 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 = 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->channel_id_valid && + (hs->new_cipher->algorithm_mkey & SSL_kECDHE) == 0) { + ssl->s3->channel_id_valid = false; + } + + // If this is a resumption and the original handshake didn't support + // ChannelID then we didn't record the original handshake hashes in the + // session and so cannot resume with ChannelIDs. + if (ssl->session != NULL && + ssl->session->original_handshake_hash_len == 0) { + ssl->s3->channel_id_valid = false; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + ssl->s3->server_random[0] = now.tv_sec >> 24; + ssl->s3->server_random[1] = now.tv_sec >> 16; + ssl->s3->server_random[2] = now.tv_sec >> 8; + ssl->s3->server_random[3] = now.tv_sec; + if (!RAND_bytes(ssl->s3->server_random + 4, SSL3_RANDOM_SIZE - 4)) { + return ssl_hs_error; + } + + // 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 != nullptr) { + session = ssl->session.get(); + } + + ScopedCBB cbb; + CBB body, session_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, ssl->version) || + !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, session->session_id, + session->session_id_length) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0 /* no compression */) || + !ssl_add_serverhello_tlsext(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl->session != NULL) { + hs->state = state12_send_server_finished; + } else { + hs->state = state12_send_server_certificate; + } + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ScopedCBB cbb; + + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + if (!ssl_has_certificate(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); + return ssl_hs_error; + } + + if (!ssl_output_cert_chain(hs)) { + return ssl_hs_error; + } + + if (hs->certificate_status_expected) { + CBB body, ocsp_response; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + 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(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; + } + } + } + + // Assemble ServerKeyExchange parameters if needed. + 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) && 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; + if (!CBB_init(cbb.get(), SSL3_RANDOM_SIZE * 2 + 128) || + !CBB_add_bytes(cbb.get(), ssl->s3->client_random, SSL3_RANDOM_SIZE) || + !CBB_add_bytes(cbb.get(), ssl->s3->server_random, SSL3_RANDOM_SIZE)) { + return ssl_hs_error; + } + + // PSK ciphers begin with an identity hint. + if (alg_a & SSL_aPSK) { + 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 *)hs->config->psk_identity_hint.get(), + len)) { + return ssl_hs_error; + } + } + + if (alg_k & SSL_kECDHE) { + // Determine the group to use. + uint16_t group_id; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + hs->new_session->group_id = group_id; + + // Set up ECDH, generate a key, and emit the public half. + 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_shares[0]->Offer(&child)) { + return ssl_hs_error; + } + } else { + assert(alg_k & SSL_kPSK); + } + + if (!CBBFinishArray(cbb.get(), &hs->server_params)) { + return ssl_hs_error; + } + } + + hs->state = state12_send_server_key_exchange; + return ssl_hs_ok; +} + +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 = state12_send_server_hello_done; + return ssl_hs_ok; + } + + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_SERVER_KEY_EXCHANGE) || + // |hs->server_params| contains a prefix for signing. + hs->server_params.size() < 2 * SSL3_RANDOM_SIZE || + !CBB_add_bytes(&body, hs->server_params.data() + 2 * SSL3_RANDOM_SIZE, + hs->server_params.size() - 2 * SSL3_RANDOM_SIZE)) { + return ssl_hs_error; + } + + // Add a signature. + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + if (!ssl_has_private_key(hs)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // 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) { + if (!CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + // Add space for the signature. + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *ptr; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &ptr, max_sig_len)) { + return ssl_hs_error; + } + + size_t sig_len; + switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, + signature_algorithm, hs->server_params)) { + case ssl_private_key_success: + if (!CBB_did_write(&child, sig_len)) { + return ssl_hs_error; + } + break; + case ssl_private_key_failure: + return ssl_hs_error; + case ssl_private_key_retry: + return ssl_hs_private_key_operation; + } + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + hs->server_params.Reset(); + + hs->state = state12_send_server_hello_done; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ScopedCBB cbb; + CBB body; + + if (hs->cert_request) { + CBB cert_types, sigalgs_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_REQUEST) || + !CBB_add_u8_length_prefixed(&body, &cert_types) || + !CBB_add_u8(&cert_types, SSL3_CT_RSA_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(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_SERVER_HELLO_DONE) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + 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 = state12_verify_client_certificate; + 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_CERTIFICATE)) { + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS certificate_msg = msg.body; + uint8_t alert = SSL_AD_DECODE_ERROR; + 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 + : nullptr, + &certificate_msg, ssl->ctx->pool)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (CBS_len(&certificate_msg) != 0 || + !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 ssl_hs_error; + } + + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + // No client certificate so the handshake buffer may be discarded. + hs->transcript.FreeBuffer(); + + 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); + 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; + } 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 = 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.get()) > 0) { + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + return ssl_hs_certificate_verify; + } + } + + hs->state = state12_read_client_key_exchange; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_key_exchange(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_KEY_EXCHANGE)) { + return ssl_hs_error; + } + + CBS client_key_exchange = msg.body; + uint32_t alg_k = hs->new_cipher->algorithm_mkey; + uint32_t alg_a = hs->new_cipher->algorithm_auth; + + // If using a PSK key exchange, parse the PSK identity. + if (alg_a & SSL_aPSK) { + CBS psk_identity; + + // If using PSK, the ClientKeyExchange contains a psk_identity. If PSK, + // then this is the only field in the message. + if (!CBS_get_u16_length_prefixed(&client_key_exchange, &psk_identity) || + ((alg_k & SSL_kPSK) && 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; + } + + if (CBS_len(&psk_identity) > PSK_MAX_IDENTITY_LEN || + CBS_contains_zero_byte(&psk_identity)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + 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 (!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. + Array decrypt_buf; + if (!decrypt_buf.Init(EVP_PKEY_size(hs->local_pubkey.get()))) { + return ssl_hs_error; + } + + // Decrypt with no padding. PKCS#1 padding will be removed as part of the + // timing-sensitive code below. + size_t decrypt_len; + switch (ssl_private_key_decrypt(hs, decrypt_buf.data(), &decrypt_len, + decrypt_buf.size(), + encrypted_premaster_secret)) { + case ssl_private_key_success: + break; + case ssl_private_key_failure: + return ssl_hs_error; + case ssl_private_key_retry: + return ssl_hs_private_key_operation; + } + + if (decrypt_len != decrypt_buf.size()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + 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) || + !RAND_bytes(premaster_secret.data(), premaster_secret.size())) { + return ssl_hs_error; + } + + // The smallest padded premaster is 11 bytes of overhead. Small keys are + // publicly invalid. + if (decrypt_len < 11 + premaster_secret.size()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return ssl_hs_error; + } + + // Check the padding. See RFC 3447, section 7.2.2. + size_t padding_len = decrypt_len - premaster_secret.size(); + uint8_t good = constant_time_eq_int_8(decrypt_buf[0], 0) & + constant_time_eq_int_8(decrypt_buf[1], 2); + for (size_t i = 2; i < padding_len - 1; i++) { + good &= ~constant_time_is_zero_8(decrypt_buf[i]); + } + good &= constant_time_is_zero_8(decrypt_buf[padding_len - 1]); + + // The premaster secret must begin with |client_version|. This too must be + // checked in constant time (http://eprint.iacr.org/2003/052/). + good &= constant_time_eq_8(decrypt_buf[padding_len], + (unsigned)(hs->client_version >> 8)); + good &= constant_time_eq_8(decrypt_buf[padding_len + 1], + (unsigned)(hs->client_version & 0xff)); + + // Select, in constant time, either the decrypted premaster or the random + // premaster based on |good|. + for (size_t i = 0; i < premaster_secret.size(); i++) { + premaster_secret[i] = constant_time_select_8( + good, decrypt_buf[padding_len + i], premaster_secret[i]); + } + } else if (alg_k & SSL_kECDHE) { + // Parse the ClientKeyExchange. + CBS peer_key; + if (!CBS_get_u8_length_prefixed(&client_key_exchange, &peer_key) || + 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; + } + + // Compute the premaster. + uint8_t alert = SSL_AD_DECODE_ERROR; + 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_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); + return ssl_hs_error; + } + + // For a PSK cipher suite, the actual pre-master secret is combined with the + // pre-shared key. + if (alg_a & SSL_aPSK) { + 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; + } + + // Look up the key for the identity. + uint8_t psk[PSK_MAX_PSK_LEN]; + 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); + return ssl_hs_error; + } else if (psk_len == 0) { + // PSK related to the given identity not found. + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNKNOWN_PSK_IDENTITY); + return ssl_hs_error; + } + + if (alg_k & SSL_kPSK) { + // In plain PSK, other_secret is a block of 0s with the same length as the + // pre-shared key. + if (!premaster_secret.Init(psk_len)) { + return ssl_hs_error; + } + OPENSSL_memset(premaster_secret.data(), 0, premaster_secret.size()); + } + + ScopedCBB new_premaster; + CBB child; + if (!CBB_init(new_premaster.get(), + 2 + psk_len + 2 + premaster_secret.size()) || + !CBB_add_u16_length_prefixed(new_premaster.get(), &child) || + !CBB_add_bytes(&child, premaster_secret.data(), + premaster_secret.size()) || + !CBB_add_u16_length_prefixed(new_premaster.get(), &child) || + !CBB_add_bytes(&child, psk, psk_len) || + !CBBFinishArray(new_premaster.get(), &premaster_secret)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_hs_error; + } + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // Compute the master secret. + hs->new_session->master_key_length = tls1_generate_master_secret( + hs, hs->new_session->master_key, premaster_secret); + if (hs->new_session->master_key_length == 0) { + 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 = state12_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; + + // Only RSA and ECDSA client certificates are supported, so a + // CertificateVerify is required if and only if there's a client certificate. + if (!hs->peer_pubkey) { + hs->transcript.FreeBuffer(); + hs->state = state12_read_change_cipher_spec; + 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_CERTIFICATE_VERIFY)) { + return ssl_hs_error; + } + + CBS certificate_verify = msg.body, signature; + + // Determine the signature algorithm. + uint16_t signature_algorithm = 0; + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + if (!CBS_get_u16(&certificate_verify, &signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + 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 ssl_hs_error; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + } else if (!tls1_get_legacy_signature_algorithm(&signature_algorithm, + hs->peer_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_CERTIFICATE); + return ssl_hs_error; + } + + // Parse and verify the signature. + if (!CBS_get_u16_length_prefixed(&certificate_verify, &signature) || + CBS_len(&certificate_verify) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + 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; + } + + // The handshake buffer is no longer necessary, and we may hash the current + // message. + hs->transcript.FreeBuffer(); + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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) { + 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; +} + +static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { + if (!tls1_change_cipher_state(hs, evp_aead_open)) { + return ssl_hs_error; + } + + hs->state = state12_read_next_proto; + return ssl_hs_ok; +} + +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 = state12_read_channel_id; + 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_NEXT_PROTO) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS next_protocol = msg.body, selected_protocol, padding; + if (!CBS_get_u8_length_prefixed(&next_protocol, &selected_protocol) || + !CBS_get_u8_length_prefixed(&next_protocol, &padding) || + CBS_len(&next_protocol) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!ssl->s3->next_proto_negotiated.CopyFrom(selected_protocol)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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->channel_id_valid) { + hs->state = state12_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->state = state12_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; + enum ssl_hs_wait_t wait = ssl_get_finished(hs); + if (wait != ssl_hs_ok) { + return wait; + } + + if (ssl->session != NULL) { + hs->state = state12_finish_server_handshake; + } else { + 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->channel_id_valid && + !tls1_record_handshake_hashes_for_channel_id(hs)) { + return ssl_hs_error; + } + + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (hs->ticket_expected) { + const SSL_SESSION *session; + UniquePtr session_copy; + if (ssl->session == NULL) { + // Fix the timeout to measure from the ticket issuance time. + ssl_session_rebase_time(ssl, hs->new_session.get()); + session = hs->new_session.get(); + } else { + // We are renewing an existing session. Duplicate the session to adjust + // the timeout. + session_copy = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); + if (!session_copy) { + return ssl_hs_error; + } + + ssl_session_rebase_time(ssl, session_copy.get()); + session = session_copy.get(); + } + + ScopedCBB cbb; + CBB body, ticket; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_NEW_SESSION_TICKET) || + !CBB_add_u32(&body, session->timeout) || + !CBB_add_u16_length_prefixed(&body, &ticket) || + !ssl_encrypt_ticket(hs, &ticket, session) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + if (!ssl->method->add_change_cipher_spec(ssl) || + !tls1_change_cipher_state(hs, evp_aead_seal) || + !ssl_send_finished(hs)) { + return ssl_hs_error; + } + + if (ssl->session != NULL) { + hs->state = state12_read_change_cipher_spec; + } else { + hs->state = state12_finish_server_handshake; + } + return ssl_hs_flush; +} + +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 && + 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->s3->established_session = UpRef(ssl->session); + } else { + ssl->s3->established_session = std::move(hs->new_session); + 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 = state12_done; + return ssl_hs_ok; +} + +enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { + while (hs->state != state12_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum tls12_server_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state12_start_accept: + ret = do_start_accept(hs); + break; + case state12_read_client_hello: + ret = do_read_client_hello(hs); + break; + case state12_select_certificate: + ret = do_select_certificate(hs); + break; + case state12_tls13: + ret = do_tls13(hs); + break; + case state12_select_parameters: + ret = do_select_parameters(hs); + break; + case state12_send_server_hello: + ret = do_send_server_hello(hs); + break; + case state12_send_server_certificate: + ret = do_send_server_certificate(hs); + break; + case state12_send_server_key_exchange: + ret = do_send_server_key_exchange(hs); + break; + case state12_send_server_hello_done: + ret = do_send_server_hello_done(hs); + break; + case state12_read_client_certificate: + ret = do_read_client_certificate(hs); + break; + case state12_verify_client_certificate: + ret = do_verify_client_certificate(hs); + break; + case state12_read_client_key_exchange: + ret = do_read_client_key_exchange(hs); + break; + case state12_read_client_certificate_verify: + ret = do_read_client_certificate_verify(hs); + break; + case state12_read_change_cipher_spec: + ret = do_read_change_cipher_spec(hs); + break; + case state12_process_change_cipher_spec: + ret = do_process_change_cipher_spec(hs); + break; + case state12_read_next_proto: + ret = do_read_next_proto(hs); + break; + case state12_read_channel_id: + ret = do_read_channel_id(hs); + break; + case state12_read_client_finished: + ret = do_read_client_finished(hs); + break; + case state12_send_server_finished: + ret = do_send_server_finished(hs); + break; + case state12_finish_server_handshake: + ret = do_finish_server_handshake(hs); + break; + case state12_done: + ret = ssl_hs_ok; + break; + } + + if (hs->state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_DONE, 1); + return ssl_hs_ok; +} + +const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs) { + enum tls12_server_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state12_start_accept: + return "TLS server start_accept"; + case state12_read_client_hello: + return "TLS server read_client_hello"; + case state12_select_certificate: + return "TLS server select_certificate"; + case state12_tls13: + return tls13_server_handshake_state(hs); + case state12_select_parameters: + return "TLS server select_parameters"; + case state12_send_server_hello: + return "TLS server send_server_hello"; + case state12_send_server_certificate: + return "TLS server send_server_certificate"; + case state12_send_server_key_exchange: + return "TLS server send_server_key_exchange"; + case state12_send_server_hello_done: + return "TLS server send_server_hello_done"; + case state12_read_client_certificate: + return "TLS server read_client_certificate"; + case state12_verify_client_certificate: + return "TLS server verify_client_certificate"; + case state12_read_client_key_exchange: + return "TLS server read_client_key_exchange"; + case state12_read_client_certificate_verify: + return "TLS server read_client_certificate_verify"; + case state12_read_change_cipher_spec: + return "TLS server read_change_cipher_spec"; + case state12_process_change_cipher_spec: + return "TLS server process_change_cipher_spec"; + case state12_read_next_proto: + return "TLS server read_next_proto"; + case state12_read_channel_id: + return "TLS server read_channel_id"; + case state12_read_client_finished: + return "TLS server read_client_finished"; + case state12_send_server_finished: + return "TLS server send_server_finished"; + case state12_finish_server_handshake: + return "TLS server finish_server_handshake"; + case state12_done: + return "TLS server done"; + } + + return "TLS server unknown"; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back new file mode 100644 index 0000000..dfe14bf --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back @@ -0,0 +1,1797 @@ +/* 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. + * + * 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. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +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); + + while (CBS_len(&cipher_suites) > 0) { + uint16_t got_id; + if (!CBS_get_u16(&cipher_suites, &got_id)) { + return false; + } + + if (got_id == id) { + return true; + } + } + + return false; +} + +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; + if (ssl_client_hello_get_extension(client_hello, &supported_versions, + TLSEXT_TYPE_supported_versions)) { + if (!CBS_get_u8_length_prefixed(&supported_versions, &versions) || + CBS_len(&supported_versions) != 0 || + CBS_len(&versions) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + } else { + // Convert the ClientHello version to an equivalent supported_versions + // extension. + static const uint8_t kTLSVersions[] = { + 0x03, 0x03, // TLS 1.2 + 0x03, 0x02, // TLS 1.1 + 0x03, 0x01, // TLS 1 + }; + + static const uint8_t kDTLSVersions[] = { + 0xfe, 0xfd, // DTLS 1.2 + 0xfe, 0xff, // DTLS 1.0 + }; + + size_t versions_len = 0; + if (SSL_is_dtls(ssl)) { + if (client_hello->version <= DTLS1_2_VERSION) { + versions_len = 4; + } else if (client_hello->version <= DTLS1_VERSION) { + versions_len = 2; + } + CBS_init(&versions, kDTLSVersions + sizeof(kDTLSVersions) - versions_len, + versions_len); + } else { + if (client_hello->version >= TLS1_2_VERSION) { + versions_len = 6; + } else if (client_hello->version >= TLS1_1_VERSION) { + versions_len = 4; + } else if (client_hello->version >= TLS1_VERSION) { + versions_len = 2; + } + CBS_init(&versions, kTLSVersions + sizeof(kTLSVersions) - versions_len, + versions_len); + } + } + + if (!ssl_negotiate_version(hs, out_alert, &ssl->version, &versions)) { + return false; + } + + // At this point, the connection's version is known and |ssl->version| is + // fixed. Begin enforcing the record-layer version. + ssl->s3->have_version = true; + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + + // Handle FALLBACK_SCSV. + if (ssl_client_cipher_list_contains_cipher(client_hello, + SSL3_CK_FALLBACK_SCSV & 0xffff) && + ssl_protocol_version(ssl) < hs->max_version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INAPPROPRIATE_FALLBACK); + *out_alert = SSL3_AD_INAPPROPRIATE_FALLBACK; + return false; + } + + return true; +} + +static UniquePtr ssl_parse_client_cipher_list( + const SSL_CLIENT_HELLO *client_hello) { + CBS cipher_suites; + CBS_init(&cipher_suites, client_hello->cipher_suites, + client_hello->cipher_suites_len); + + UniquePtr sk(sk_SSL_CIPHER_new_null()); + if (!sk) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + while (CBS_len(&cipher_suites) > 0) { + uint16_t cipher_suite; + + if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); + return nullptr; + } + + const SSL_CIPHER *c = SSL_get_cipher_by_value(cipher_suite); + if (c != NULL && !sk_SSL_CIPHER_push(sk.get(), c)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + return sk; +} + +// ssl_get_compatible_server_ciphers determines the key exchange and +// authentication cipher suite masks compatible with the server configuration +// and current ClientHello parameters of |hs|. It sets |*out_mask_k| to the key +// exchange mask and |*out_mask_a| to the authentication mask. +static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, + uint32_t *out_mask_k, + uint32_t *out_mask_a) { + uint32_t mask_k = 0; + uint32_t mask_a = 0; + + 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; + } + } + + // Check for a shared group to consider ECDHE ciphers. + uint16_t unused; + if (tls1_get_shared_group(hs, &unused)) { + mask_k |= SSL_kECDHE; + } + + // PSK requires a server callback. + if (hs->config->psk_server_callback != NULL) { + mask_k |= SSL_kPSK; + mask_a |= SSL_aPSK; + } + + *out_mask_k = mask_k; + *out_mask_a = mask_a; +} + +static const SSL_CIPHER *ssl3_choose_cipher( + SSL_HANDSHAKE *hs, const SSL_CLIENT_HELLO *client_hello, + const SSLCipherPreferenceList *server_pref) { + SSL *const ssl = hs->ssl; + 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 |SSLCipherPreferenceList| + // struct. + 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; + + UniquePtr client_pref = + ssl_parse_client_cipher_list(client_hello); + if (!client_pref) { + return nullptr; + } + + if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { + 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.get(); + } + + uint32_t mask_k, mask_a; + ssl_get_compatible_server_ciphers(hs, &mask_k, &mask_a); + + for (size_t i = 0; i < sk_SSL_CIPHER_num(prio); i++) { + const SSL_CIPHER *c = sk_SSL_CIPHER_value(prio, i); + + size_t cipher_index; + if (// Check if the cipher is supported for the current version. + SSL_CIPHER_get_min_version(c) <= ssl_protocol_version(ssl) && + ssl_protocol_version(ssl) <= SSL_CIPHER_get_max_version(c) && + // Check the cipher is supported for the server configuration. + (c->algorithm_mkey & mask_k) && + (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]) { + // 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) { + group_min = cipher_index; + } + } else { + if (group_min != -1 && (size_t)group_min < cipher_index) { + cipher_index = group_min; + } + return sk_SSL_CIPHER_value(allow, cipher_index); + } + } + + 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); + } + } + + return nullptr; +} + +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 = 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; + + 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_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + 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)) { + case ssl_select_cert_retry: + return ssl_hs_certificate_selection_pending; + + case ssl_select_cert_error: + // Connection rejected. + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + + default: + /* fallthrough */; + } + } + + // Freeze the version range after the early callback. + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { + return ssl_hs_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; + } + + hs->client_version = client_hello.version; + if (client_hello.random_len != SSL3_RANDOM_SIZE) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + OPENSSL_memcpy(ssl->s3->client_random, client_hello.random, + client_hello.random_len); + + // Only null compression is supported. TLS 1.3 further requires the peer + // advertise no other compression. + if (OPENSSL_memchr(client_hello.compression_methods, 0, + client_hello.compression_methods_len) == NULL || + (ssl_protocol_version(ssl) >= TLS1_3_VERSION && + client_hello.compression_methods_len != 1)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMPRESSION_LIST); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // TLS extensions. + if (!ssl_parse_clienthello_tlsext(hs, &client_hello)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + + hs->state = state12_select_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // Call |cert_cb| to update server certificates if required. + 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); + return ssl_hs_error; + } + if (rv < 0) { + return ssl_hs_x509_lookup; + } + } + + if (!ssl_on_certificate_selected(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 = 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; + } + + // Negotiate the cipher suite. This must be done after |cert_cb| so the + // certificate is finalized. + 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 = 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 = state12_finish_server_handshake; + return ssl_hs_ok; + } + + return wait; +} + +static enum ssl_hs_wait_t do_select_parameters(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)) { + return ssl_hs_error; + } + + // Determine whether we are doing session resumption. + UniquePtr session; + bool tickets_supported = false, renew_ticket = false; + enum ssl_hs_wait_t wait = ssl_get_prev_session( + hs, &session, &tickets_supported, &renew_ticket, &client_hello); + if (wait != ssl_hs_ok) { + return wait; + } + + if (session) { + if (session->extended_master_secret && !hs->extended_master_secret) { + // A ClientHello without EMS that attempts to resume a session with EMS + // is fatal to the connection. + OPENSSL_PUT_ERROR(SSL, SSL_R_RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + if (!ssl_session_is_resumable(hs, session.get()) || + // If the client offers the EMS extension, but the previous session + // didn't use it, then negotiate a new session. + hs->extended_master_secret != session->extended_master_secret) { + session.reset(); + } + } + + if (session) { + // Use the old session. + hs->ticket_expected = renew_ticket; + ssl->session = std::move(session); + ssl->s3->session_reused = true; + } else { + hs->ticket_expected = tickets_supported; + ssl_set_session(ssl, NULL); + if (!ssl_get_new_session(hs, 1 /* server */)) { + return ssl_hs_error; + } + + // Clear the session ID if we want the session to be single-use. + if (!(ssl->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)) { + hs->new_session->session_id_length = 0; + } + } + + 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; + } + + if (ssl->session == NULL) { + hs->new_session->cipher = hs->new_cipher; + + // 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; + } + // CertificateRequest may only be sent in certificate-based ciphers. + if (!ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->cert_request = false; + } + + 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; + } + } + + // 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; + } + + // Now that all parameters are known, initialize the handshake hash and hash + // the ClientHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !ssl_hash_message(hs, msg)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // 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 = 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->channel_id_valid && + (hs->new_cipher->algorithm_mkey & SSL_kECDHE) == 0) { + ssl->s3->channel_id_valid = false; + } + + // If this is a resumption and the original handshake didn't support + // ChannelID then we didn't record the original handshake hashes in the + // session and so cannot resume with ChannelIDs. + if (ssl->session != NULL && + ssl->session->original_handshake_hash_len == 0) { + ssl->s3->channel_id_valid = false; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + ssl->s3->server_random[0] = now.tv_sec >> 24; + ssl->s3->server_random[1] = now.tv_sec >> 16; + ssl->s3->server_random[2] = now.tv_sec >> 8; + ssl->s3->server_random[3] = now.tv_sec; + if (!RAND_bytes(ssl->s3->server_random + 4, SSL3_RANDOM_SIZE - 4)) { + return ssl_hs_error; + } + + // 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 != nullptr) { + session = ssl->session.get(); + } + + ScopedCBB cbb; + CBB body, session_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, ssl->version) || + !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, session->session_id, + session->session_id_length) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0 /* no compression */) || + !ssl_add_serverhello_tlsext(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl->session != NULL) { + hs->state = state12_send_server_finished; + } else { + hs->state = state12_send_server_certificate; + } + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ScopedCBB cbb; + + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + if (!ssl_has_certificate(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); + return ssl_hs_error; + } + + if (!ssl_output_cert_chain(hs)) { + return ssl_hs_error; + } + + if (hs->certificate_status_expected) { + CBB body, ocsp_response; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + 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(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; + } + } + } + + // Assemble ServerKeyExchange parameters if needed. + 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) && 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; + if (!CBB_init(cbb.get(), SSL3_RANDOM_SIZE * 2 + 128) || + !CBB_add_bytes(cbb.get(), ssl->s3->client_random, SSL3_RANDOM_SIZE) || + !CBB_add_bytes(cbb.get(), ssl->s3->server_random, SSL3_RANDOM_SIZE)) { + return ssl_hs_error; + } + + // PSK ciphers begin with an identity hint. + if (alg_a & SSL_aPSK) { + 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 *)hs->config->psk_identity_hint.get(), + len)) { + return ssl_hs_error; + } + } + + if (alg_k & SSL_kECDHE) { + // Determine the group to use. + uint16_t group_id; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + hs->new_session->group_id = group_id; + + // Set up ECDH, generate a key, and emit the public half. + 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_shares[0]->Offer(&child)) { + return ssl_hs_error; + } + } else { + assert(alg_k & SSL_kPSK); + } + + if (!CBBFinishArray(cbb.get(), &hs->server_params)) { + return ssl_hs_error; + } + } + + hs->state = state12_send_server_key_exchange; + return ssl_hs_ok; +} + +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 = state12_send_server_hello_done; + return ssl_hs_ok; + } + + ScopedCBB cbb; + CBB body, child; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_SERVER_KEY_EXCHANGE) || + // |hs->server_params| contains a prefix for signing. + hs->server_params.size() < 2 * SSL3_RANDOM_SIZE || + !CBB_add_bytes(&body, hs->server_params.data() + 2 * SSL3_RANDOM_SIZE, + hs->server_params.size() - 2 * SSL3_RANDOM_SIZE)) { + return ssl_hs_error; + } + + // Add a signature. + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + if (!ssl_has_private_key(hs)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + // 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) { + if (!CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + // Add space for the signature. + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *ptr; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &ptr, max_sig_len)) { + return ssl_hs_error; + } + + size_t sig_len; + switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, + signature_algorithm, hs->server_params)) { + case ssl_private_key_success: + if (!CBB_did_write(&child, sig_len)) { + return ssl_hs_error; + } + break; + case ssl_private_key_failure: + return ssl_hs_error; + case ssl_private_key_retry: + return ssl_hs_private_key_operation; + } + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + hs->server_params.Reset(); + + hs->state = state12_send_server_hello_done; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + ScopedCBB cbb; + CBB body; + + if (hs->cert_request) { + CBB cert_types, sigalgs_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_REQUEST) || + !CBB_add_u8_length_prefixed(&body, &cert_types) || + !CBB_add_u8(&cert_types, SSL3_CT_RSA_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(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_SERVER_HELLO_DONE) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + 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 = state12_verify_client_certificate; + 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_CERTIFICATE)) { + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS certificate_msg = msg.body; + uint8_t alert = SSL_AD_DECODE_ERROR; + 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 + : nullptr, + &certificate_msg, ssl->ctx->pool)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (CBS_len(&certificate_msg) != 0 || + !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 ssl_hs_error; + } + + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + // No client certificate so the handshake buffer may be discarded. + hs->transcript.FreeBuffer(); + + 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); + 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; + } 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 = 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.get()) > 0) { + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + return ssl_hs_certificate_verify; + } + } + + hs->state = state12_read_client_key_exchange; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_key_exchange(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_KEY_EXCHANGE)) { + return ssl_hs_error; + } + + CBS client_key_exchange = msg.body; + uint32_t alg_k = hs->new_cipher->algorithm_mkey; + uint32_t alg_a = hs->new_cipher->algorithm_auth; + + // If using a PSK key exchange, parse the PSK identity. + if (alg_a & SSL_aPSK) { + CBS psk_identity; + + // If using PSK, the ClientKeyExchange contains a psk_identity. If PSK, + // then this is the only field in the message. + if (!CBS_get_u16_length_prefixed(&client_key_exchange, &psk_identity) || + ((alg_k & SSL_kPSK) && 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; + } + + if (CBS_len(&psk_identity) > PSK_MAX_IDENTITY_LEN || + CBS_contains_zero_byte(&psk_identity)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + 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 (!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. + Array decrypt_buf; + if (!decrypt_buf.Init(EVP_PKEY_size(hs->local_pubkey.get()))) { + return ssl_hs_error; + } + + // Decrypt with no padding. PKCS#1 padding will be removed as part of the + // timing-sensitive code below. + size_t decrypt_len; + switch (ssl_private_key_decrypt(hs, decrypt_buf.data(), &decrypt_len, + decrypt_buf.size(), + encrypted_premaster_secret)) { + case ssl_private_key_success: + break; + case ssl_private_key_failure: + return ssl_hs_error; + case ssl_private_key_retry: + return ssl_hs_private_key_operation; + } + + if (decrypt_len != decrypt_buf.size()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + 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) || + !RAND_bytes(premaster_secret.data(), premaster_secret.size())) { + return ssl_hs_error; + } + + // The smallest padded premaster is 11 bytes of overhead. Small keys are + // publicly invalid. + if (decrypt_len < 11 + premaster_secret.size()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return ssl_hs_error; + } + + // Check the padding. See RFC 3447, section 7.2.2. + size_t padding_len = decrypt_len - premaster_secret.size(); + uint8_t good = constant_time_eq_int_8(decrypt_buf[0], 0) & + constant_time_eq_int_8(decrypt_buf[1], 2); + for (size_t i = 2; i < padding_len - 1; i++) { + good &= ~constant_time_is_zero_8(decrypt_buf[i]); + } + good &= constant_time_is_zero_8(decrypt_buf[padding_len - 1]); + + // The premaster secret must begin with |client_version|. This too must be + // checked in constant time (http://eprint.iacr.org/2003/052/). + good &= constant_time_eq_8(decrypt_buf[padding_len], + (unsigned)(hs->client_version >> 8)); + good &= constant_time_eq_8(decrypt_buf[padding_len + 1], + (unsigned)(hs->client_version & 0xff)); + + // Select, in constant time, either the decrypted premaster or the random + // premaster based on |good|. + for (size_t i = 0; i < premaster_secret.size(); i++) { + premaster_secret[i] = constant_time_select_8( + good, decrypt_buf[padding_len + i], premaster_secret[i]); + } + } else if (alg_k & SSL_kECDHE) { + // Parse the ClientKeyExchange. + CBS peer_key; + if (!CBS_get_u8_length_prefixed(&client_key_exchange, &peer_key) || + 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; + } + + // Compute the premaster. + uint8_t alert = SSL_AD_DECODE_ERROR; + 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_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); + return ssl_hs_error; + } + + // For a PSK cipher suite, the actual pre-master secret is combined with the + // pre-shared key. + if (alg_a & SSL_aPSK) { + 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; + } + + // Look up the key for the identity. + uint8_t psk[PSK_MAX_PSK_LEN]; + 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); + return ssl_hs_error; + } else if (psk_len == 0) { + // PSK related to the given identity not found. + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNKNOWN_PSK_IDENTITY); + return ssl_hs_error; + } + + if (alg_k & SSL_kPSK) { + // In plain PSK, other_secret is a block of 0s with the same length as the + // pre-shared key. + if (!premaster_secret.Init(psk_len)) { + return ssl_hs_error; + } + OPENSSL_memset(premaster_secret.data(), 0, premaster_secret.size()); + } + + ScopedCBB new_premaster; + CBB child; + if (!CBB_init(new_premaster.get(), + 2 + psk_len + 2 + premaster_secret.size()) || + !CBB_add_u16_length_prefixed(new_premaster.get(), &child) || + !CBB_add_bytes(&child, premaster_secret.data(), + premaster_secret.size()) || + !CBB_add_u16_length_prefixed(new_premaster.get(), &child) || + !CBB_add_bytes(&child, psk, psk_len) || + !CBBFinishArray(new_premaster.get(), &premaster_secret)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_hs_error; + } + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + // Compute the master secret. + hs->new_session->master_key_length = tls1_generate_master_secret( + hs, hs->new_session->master_key, premaster_secret); + if (hs->new_session->master_key_length == 0) { + 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 = state12_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; + + // Only RSA and ECDSA client certificates are supported, so a + // CertificateVerify is required if and only if there's a client certificate. + if (!hs->peer_pubkey) { + hs->transcript.FreeBuffer(); + hs->state = state12_read_change_cipher_spec; + 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_CERTIFICATE_VERIFY)) { + return ssl_hs_error; + } + + CBS certificate_verify = msg.body, signature; + + // Determine the signature algorithm. + uint16_t signature_algorithm = 0; + if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { + if (!CBS_get_u16(&certificate_verify, &signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + 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 ssl_hs_error; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + } else if (!tls1_get_legacy_signature_algorithm(&signature_algorithm, + hs->peer_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_CERTIFICATE); + return ssl_hs_error; + } + + // Parse and verify the signature. + if (!CBS_get_u16_length_prefixed(&certificate_verify, &signature) || + CBS_len(&certificate_verify) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + 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; + } + + // The handshake buffer is no longer necessary, and we may hash the current + // message. + hs->transcript.FreeBuffer(); + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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) { + 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; +} + +static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { + if (!tls1_change_cipher_state(hs, evp_aead_open)) { + return ssl_hs_error; + } + + hs->state = state12_read_next_proto; + return ssl_hs_ok; +} + +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 = state12_read_channel_id; + 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_NEXT_PROTO) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + CBS next_protocol = msg.body, selected_protocol, padding; + if (!CBS_get_u8_length_prefixed(&next_protocol, &selected_protocol) || + !CBS_get_u8_length_prefixed(&next_protocol, &padding) || + CBS_len(&next_protocol) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!ssl->s3->next_proto_negotiated.CopyFrom(selected_protocol)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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->channel_id_valid) { + hs->state = state12_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->state = state12_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; + enum ssl_hs_wait_t wait = ssl_get_finished(hs); + if (wait != ssl_hs_ok) { + return wait; + } + + if (ssl->session != NULL) { + hs->state = state12_finish_server_handshake; + } else { + 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->channel_id_valid && + !tls1_record_handshake_hashes_for_channel_id(hs)) { + return ssl_hs_error; + } + + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (hs->ticket_expected) { + const SSL_SESSION *session; + UniquePtr session_copy; + if (ssl->session == NULL) { + // Fix the timeout to measure from the ticket issuance time. + ssl_session_rebase_time(ssl, hs->new_session.get()); + session = hs->new_session.get(); + } else { + // We are renewing an existing session. Duplicate the session to adjust + // the timeout. + session_copy = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); + if (!session_copy) { + return ssl_hs_error; + } + + ssl_session_rebase_time(ssl, session_copy.get()); + session = session_copy.get(); + } + + ScopedCBB cbb; + CBB body, ticket; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_NEW_SESSION_TICKET) || + !CBB_add_u32(&body, session->timeout) || + !CBB_add_u16_length_prefixed(&body, &ticket) || + !ssl_encrypt_ticket(hs, &ticket, session) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + if (!ssl->method->add_change_cipher_spec(ssl) || + !tls1_change_cipher_state(hs, evp_aead_seal) || + !ssl_send_finished(hs)) { + return ssl_hs_error; + } + + if (ssl->session != NULL) { + hs->state = state12_read_change_cipher_spec; + } else { + hs->state = state12_finish_server_handshake; + } + return ssl_hs_flush; +} + +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 && + 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->s3->established_session = UpRef(ssl->session); + } else { + ssl->s3->established_session = std::move(hs->new_session); + 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 = state12_done; + return ssl_hs_ok; +} + +enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { + while (hs->state != state12_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum tls12_server_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state12_start_accept: + ret = do_start_accept(hs); + break; + case state12_read_client_hello: + ret = do_read_client_hello(hs); + break; + case state12_select_certificate: + ret = do_select_certificate(hs); + break; + case state12_tls13: + ret = do_tls13(hs); + break; + case state12_select_parameters: + ret = do_select_parameters(hs); + break; + case state12_send_server_hello: + ret = do_send_server_hello(hs); + break; + case state12_send_server_certificate: + ret = do_send_server_certificate(hs); + break; + case state12_send_server_key_exchange: + ret = do_send_server_key_exchange(hs); + break; + case state12_send_server_hello_done: + ret = do_send_server_hello_done(hs); + break; + case state12_read_client_certificate: + ret = do_read_client_certificate(hs); + break; + case state12_verify_client_certificate: + ret = do_verify_client_certificate(hs); + break; + case state12_read_client_key_exchange: + ret = do_read_client_key_exchange(hs); + break; + case state12_read_client_certificate_verify: + ret = do_read_client_certificate_verify(hs); + break; + case state12_read_change_cipher_spec: + ret = do_read_change_cipher_spec(hs); + break; + case state12_process_change_cipher_spec: + ret = do_process_change_cipher_spec(hs); + break; + case state12_read_next_proto: + ret = do_read_next_proto(hs); + break; + case state12_read_channel_id: + ret = do_read_channel_id(hs); + break; + case state12_read_client_finished: + ret = do_read_client_finished(hs); + break; + case state12_send_server_finished: + ret = do_send_server_finished(hs); + break; + case state12_finish_server_handshake: + ret = do_finish_server_handshake(hs); + break; + case state12_done: + ret = ssl_hs_ok; + break; + } + + if (hs->state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_DONE, 1); + return ssl_hs_ok; +} + +const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs) { + enum tls12_server_hs_state_t state = + static_cast(hs->state); + switch (state) { + case state12_start_accept: + return "TLS server start_accept"; + case state12_read_client_hello: + return "TLS server read_client_hello"; + case state12_select_certificate: + return "TLS server select_certificate"; + case state12_tls13: + return tls13_server_handshake_state(hs); + case state12_select_parameters: + return "TLS server select_parameters"; + case state12_send_server_hello: + return "TLS server send_server_hello"; + case state12_send_server_certificate: + return "TLS server send_server_certificate"; + case state12_send_server_key_exchange: + return "TLS server send_server_key_exchange"; + case state12_send_server_hello_done: + return "TLS server send_server_hello_done"; + case state12_read_client_certificate: + return "TLS server read_client_certificate"; + case state12_verify_client_certificate: + return "TLS server verify_client_certificate"; + case state12_read_client_key_exchange: + return "TLS server read_client_key_exchange"; + case state12_read_client_certificate_verify: + return "TLS server read_client_certificate_verify"; + case state12_read_change_cipher_spec: + return "TLS server read_change_cipher_spec"; + case state12_process_change_cipher_spec: + return "TLS server process_change_cipher_spec"; + case state12_read_next_proto: + return "TLS server read_next_proto"; + case state12_read_channel_id: + return "TLS server read_channel_id"; + case state12_read_client_finished: + return "TLS server read_client_finished"; + case state12_send_server_finished: + return "TLS server send_server_finished"; + case state12_finish_server_handshake: + return "TLS server finish_server_handshake"; + case state12_done: + return "TLS server done"; + } + + return "TLS server unknown"; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/internal.h new file mode 100644 index 0000000..5bb3a37 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/internal.h.grpc_back new file mode 100644 index 0000000..bf4dd2f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc new file mode 100644 index 0000000..4f97461 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc @@ -0,0 +1,724 @@ +/* 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. */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +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); + + if (ssl->s3->pending_flight == nullptr) { + ssl->s3->pending_flight.reset(BUF_MEM_new()); + if (ssl->s3->pending_flight == nullptr) { + return false; + } + } + + size_t max_out = in.size() + SSL_max_seal_overhead(ssl); + size_t new_cap = ssl->s3->pending_flight->length + max_out; + if (max_out < in.size() || new_cap < max_out) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + + size_t len; + if (!BUF_MEM_reserve(ssl->s3->pending_flight.get(), new_cap) || + !tls_seal_record(ssl, + (uint8_t *)ssl->s3->pending_flight->data + + ssl->s3->pending_flight->length, + &len, max_out, type, in.data(), in.size())) { + return false; + } + + ssl->s3->pending_flight->length += len; + return true; +} + +bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { + // Pick a modest size hint to save most of the |realloc| calls. + if (!CBB_init(cbb, 64) || + !CBB_add_u8(cbb, type) || + !CBB_add_u24_length_prefixed(cbb, body)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + CBB_cleanup(cbb); + return false; + } + + return true; +} + +bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { + return CBBFinishArray(cbb, out_msg); +} + +bool ssl3_add_message(SSL *ssl, Array msg) { + // 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; + 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; + } + + 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; + } + } + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, msg); + // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript on + // hs. + if (ssl->s3->hs != NULL && + !ssl->s3->hs->transcript.Update(msg)) { + return false; + } + 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 (!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; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_CHANGE_CIPHER_SPEC, + kChangeCipherSpec); + return true; +} + +int ssl3_flush_flight(SSL *ssl) { + if (!tls_flush_pending_hs_data(ssl)) { + return -1; + } + + 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; + } + } + + if (ssl->s3->pending_flight == nullptr) { + return 1; + } + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + static_assert(INT_MAX <= 0xffffffff, "int is larger than 32 bits"); + if (ssl->s3->pending_flight->length > INT_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + // If there is pending data in the write buffer, it must be flushed out before + // any new data in pending_flight. + if (!ssl->s3->write_buffer.empty()) { + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return ret; + } + } + + // Write the pending flight. + while (ssl->s3->pending_flight_offset < ssl->s3->pending_flight->length) { + int ret = BIO_write( + 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_ERROR_WANT_WRITE; + return ret; + } + + ssl->s3->pending_flight_offset += ret; + } + + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return -1; + } + + ssl->s3->pending_flight.reset(); + ssl->s3->pending_flight_offset = 0; + return 1; +} + +static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, + Span in) { + *out_consumed = 0; + assert(in.size() >= SSL3_RT_HEADER_LENGTH); + // Determine the length of the V2ClientHello. + size_t msg_length = ((in[0] & 0x7f) << 8) | in[1]; + if (msg_length > (1024 * 4)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return ssl_open_record_error; + } + if (msg_length < SSL3_RT_HEADER_LENGTH - 2) { + // Reject lengths that are too short early. We have already read + // |SSL3_RT_HEADER_LENGTH| bytes, so we should not attempt to process an + // (invalid) V2ClientHello which would be shorter than that. + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_LENGTH_MISMATCH); + return ssl_open_record_error; + } + + // Ask for the remainder of the V2ClientHello. + if (in.size() < 2 + msg_length) { + *out_consumed = 2 + msg_length; + return ssl_open_record_partial; + } + + CBS v2_client_hello = CBS(ssl->s3->read_buffer.span().subspan(2, msg_length)); + // The V2ClientHello without the length is incorporated into the handshake + // hash. This is only ever called at the start of the handshake, so hs is + // guaranteed to be non-NULL. + if (!ssl->s3->hs->transcript.Update(v2_client_hello)) { + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, 0 /* V2ClientHello */, + v2_client_hello); + + uint8_t msg_type; + uint16_t version, cipher_spec_length, session_id_length, challenge_length; + CBS cipher_specs, session_id, challenge; + if (!CBS_get_u8(&v2_client_hello, &msg_type) || + !CBS_get_u16(&v2_client_hello, &version) || + !CBS_get_u16(&v2_client_hello, &cipher_spec_length) || + !CBS_get_u16(&v2_client_hello, &session_id_length) || + !CBS_get_u16(&v2_client_hello, &challenge_length) || + !CBS_get_bytes(&v2_client_hello, &cipher_specs, cipher_spec_length) || + !CBS_get_bytes(&v2_client_hello, &session_id, session_id_length) || + !CBS_get_bytes(&v2_client_hello, &challenge, challenge_length) || + CBS_len(&v2_client_hello) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_open_record_error; + } + + // msg_type has already been checked. + assert(msg_type == SSL2_MT_CLIENT_HELLO); + + // The client_random is the V2ClientHello challenge. Truncate or left-pad with + // zeros as needed. + size_t rand_len = CBS_len(&challenge); + if (rand_len > SSL3_RANDOM_SIZE) { + rand_len = SSL3_RANDOM_SIZE; + } + uint8_t random[SSL3_RANDOM_SIZE]; + OPENSSL_memset(random, 0, SSL3_RANDOM_SIZE); + OPENSSL_memcpy(random + (SSL3_RANDOM_SIZE - rand_len), CBS_data(&challenge), + rand_len); + + // 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 */ + + CBS_len(&cipher_specs) / 3 * 2 + + 1 /* compression length */ + 1 /* compression */; + ScopedCBB client_hello; + CBB hello_body, cipher_suites; + 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) || + !CBB_add_u24_length_prefixed(client_hello.get(), &hello_body) || + !CBB_add_u16(&hello_body, version) || + !CBB_add_bytes(&hello_body, random, SSL3_RANDOM_SIZE) || + // No session id. + !CBB_add_u8(&hello_body, 0) || + !CBB_add_u16_length_prefixed(&hello_body, &cipher_suites)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_open_record_error; + } + + // Copy the cipher suites. + while (CBS_len(&cipher_specs) > 0) { + uint32_t cipher_spec; + if (!CBS_get_u24(&cipher_specs, &cipher_spec)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_open_record_error; + } + + // Skip SSLv2 ciphers. + if ((cipher_spec & 0xff0000) != 0) { + continue; + } + if (!CBB_add_u16(&cipher_suites, cipher_spec)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_open_record_error; + } + } + + // Add the null compression scheme and finish. + if (!CBB_add_u8(&hello_body, 1) || + !CBB_add_u8(&hello_body, 0) || + !CBB_finish(client_hello.get(), NULL, &ssl->s3->hs_buf->length)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_open_record_error; + } + + *out_consumed = 2 + msg_length; + ssl->s3->is_v2_hello = true; + return ssl_open_record_success; +} + +static bool parse_message(const SSL *ssl, SSLMessage *out, + size_t *out_bytes_needed) { + if (!ssl->s3->hs_buf) { + *out_bytes_needed = 4; + return false; + } + + CBS cbs; + uint32_t len; + CBS_init(&cbs, reinterpret_cast(ssl->s3->hs_buf->data), + ssl->s3->hs_buf->length); + if (!CBS_get_u8(&cbs, &out->type) || + !CBS_get_u24(&cbs, &len)) { + *out_bytes_needed = 4; + return false; + } + + if (!CBS_get_bytes(&cbs, &out->body, len)) { + *out_bytes_needed = 4 + len; + return false; + } + + CBS_init(&out->raw, reinterpret_cast(ssl->s3->hs_buf->data), + 4 + len); + out->is_v2_hello = ssl->s3->is_v2_hello; + return true; +} + +bool ssl3_get_message(const SSL *ssl, SSLMessage *out) { + size_t unused; + if (!parse_message(ssl, out, &unused)) { + return false; + } + if (!ssl->s3->has_message) { + if (!out->is_v2_hello) { + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HANDSHAKE, out->raw); + } + ssl->s3->has_message = true; + } + return true; +} + +bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert) { + // If there is a complete message, the caller must have consumed it first. + SSLMessage msg; + size_t bytes_needed; + if (parse_message(ssl, &msg, &bytes_needed)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + // Enforce the limit so the peer cannot force us to buffer 16MB. + if (bytes_needed > 4 + ssl_max_handshake_message_len(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +bool tls_has_unprocessed_handshake_data(const SSL *ssl) { + size_t msg_len = 0; + if (ssl->s3->has_message) { + SSLMessage msg; + size_t unused; + if (parse_message(ssl, &msg, &unused)) { + msg_len = CBS_len(&msg.raw); + } + } + + return ssl->s3->hs_buf && ssl->s3->hs_buf->length > msg_len; +} + +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()); + } + 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 + // sufficient to detect a V2ClientHello and ensures that we never read + // beyond the first record. + if (in.size() < SSL3_RT_HEADER_LENGTH) { + *out_consumed = SSL3_RT_HEADER_LENGTH; + return ssl_open_record_partial; + } + + // Some dedicated error codes for protocol mixups should the application + // wish to interpret them differently. (These do not overlap with + // ClientHello or V2ClientHello.) + const char *str = reinterpret_cast(in.data()); + if (strncmp("GET ", str, 4) == 0 || + strncmp("POST ", str, 5) == 0 || + strncmp("HEAD ", str, 5) == 0 || + strncmp("PUT ", str, 4) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HTTP_REQUEST); + *out_alert = 0; + return ssl_open_record_error; + } + if (strncmp("CONNE", str, 5) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HTTPS_PROXY_REQUEST); + *out_alert = 0; + return ssl_open_record_error; + } + + // Check for a V2ClientHello. + if ((in[0] & 0x80) != 0 && in[2] == SSL2_MT_CLIENT_HELLO && + in[3] == SSL3_VERSION_MAJOR) { + auto ret = read_v2_client_hello(ssl, out_consumed, in); + if (ret == ssl_open_record_error) { + *out_alert = 0; + } else if (ret == ssl_open_record_success) { + ssl->s3->v2_hello_done = true; + } + return ret; + } + + ssl->s3->v2_hello_done = true; + } + + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + // WatchGuard's TLS 1.3 interference bug is very distinctive: they drop the + // ServerHello and send the remaining encrypted application data records + // as-is. This manifests as an application data record when we expect + // handshake. Report a dedicated error code for this case. + if (!ssl->server && type == SSL3_RT_APPLICATION_DATA && + ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_APPLICATION_DATA_INSTEAD_OF_HANDSHAKE); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (type != SSL3_RT_HANDSHAKE) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + // Append the entire handshake record to the buffer. + if (!tls_append_handshake_data(ssl, body)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + + return ssl_open_record_success; +} + +void ssl3_next_message(SSL *ssl) { + SSLMessage msg; + if (!ssl3_get_message(ssl, &msg) || + !ssl->s3->hs_buf || + ssl->s3->hs_buf->length < CBS_len(&msg.raw)) { + assert(0); + return; + } + + OPENSSL_memmove(ssl->s3->hs_buf->data, + ssl->s3->hs_buf->data + CBS_len(&msg.raw), + ssl->s3->hs_buf->length - CBS_len(&msg.raw)); + ssl->s3->hs_buf->length -= CBS_len(&msg.raw); + ssl->s3->is_v2_hello = false; + ssl->s3->has_message = false; + + // Post-handshake messages are rare, so release the buffer after every + // message. During the handshake, |on_handshake_complete| will release it. + if (!SSL_in_init(ssl) && ssl->s3->hs_buf->length == 0) { + ssl->s3->hs_buf.reset(); + } +} + +// 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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back new file mode 100644 index 0000000..1ec596a --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back @@ -0,0 +1,724 @@ +/* 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. */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +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); + + if (ssl->s3->pending_flight == nullptr) { + ssl->s3->pending_flight.reset(BUF_MEM_new()); + if (ssl->s3->pending_flight == nullptr) { + return false; + } + } + + size_t max_out = in.size() + SSL_max_seal_overhead(ssl); + size_t new_cap = ssl->s3->pending_flight->length + max_out; + if (max_out < in.size() || new_cap < max_out) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + + size_t len; + if (!BUF_MEM_reserve(ssl->s3->pending_flight.get(), new_cap) || + !tls_seal_record(ssl, + (uint8_t *)ssl->s3->pending_flight->data + + ssl->s3->pending_flight->length, + &len, max_out, type, in.data(), in.size())) { + return false; + } + + ssl->s3->pending_flight->length += len; + return true; +} + +bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { + // Pick a modest size hint to save most of the |realloc| calls. + if (!CBB_init(cbb, 64) || + !CBB_add_u8(cbb, type) || + !CBB_add_u24_length_prefixed(cbb, body)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + CBB_cleanup(cbb); + return false; + } + + return true; +} + +bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { + return CBBFinishArray(cbb, out_msg); +} + +bool ssl3_add_message(SSL *ssl, Array msg) { + // 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; + 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; + } + + 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; + } + } + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, msg); + // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript on + // hs. + if (ssl->s3->hs != NULL && + !ssl->s3->hs->transcript.Update(msg)) { + return false; + } + 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 (!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; + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_CHANGE_CIPHER_SPEC, + kChangeCipherSpec); + return true; +} + +int ssl3_flush_flight(SSL *ssl) { + if (!tls_flush_pending_hs_data(ssl)) { + return -1; + } + + 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; + } + } + + if (ssl->s3->pending_flight == nullptr) { + return 1; + } + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + static_assert(INT_MAX <= 0xffffffff, "int is larger than 32 bits"); + if (ssl->s3->pending_flight->length > INT_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + // If there is pending data in the write buffer, it must be flushed out before + // any new data in pending_flight. + if (!ssl->s3->write_buffer.empty()) { + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return ret; + } + } + + // Write the pending flight. + while (ssl->s3->pending_flight_offset < ssl->s3->pending_flight->length) { + int ret = BIO_write( + 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_ERROR_WANT_WRITE; + return ret; + } + + ssl->s3->pending_flight_offset += ret; + } + + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return -1; + } + + ssl->s3->pending_flight.reset(); + ssl->s3->pending_flight_offset = 0; + return 1; +} + +static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, + Span in) { + *out_consumed = 0; + assert(in.size() >= SSL3_RT_HEADER_LENGTH); + // Determine the length of the V2ClientHello. + size_t msg_length = ((in[0] & 0x7f) << 8) | in[1]; + if (msg_length > (1024 * 4)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return ssl_open_record_error; + } + if (msg_length < SSL3_RT_HEADER_LENGTH - 2) { + // Reject lengths that are too short early. We have already read + // |SSL3_RT_HEADER_LENGTH| bytes, so we should not attempt to process an + // (invalid) V2ClientHello which would be shorter than that. + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_LENGTH_MISMATCH); + return ssl_open_record_error; + } + + // Ask for the remainder of the V2ClientHello. + if (in.size() < 2 + msg_length) { + *out_consumed = 2 + msg_length; + return ssl_open_record_partial; + } + + CBS v2_client_hello = CBS(ssl->s3->read_buffer.span().subspan(2, msg_length)); + // The V2ClientHello without the length is incorporated into the handshake + // hash. This is only ever called at the start of the handshake, so hs is + // guaranteed to be non-NULL. + if (!ssl->s3->hs->transcript.Update(v2_client_hello)) { + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, 0 /* V2ClientHello */, + v2_client_hello); + + uint8_t msg_type; + uint16_t version, cipher_spec_length, session_id_length, challenge_length; + CBS cipher_specs, session_id, challenge; + if (!CBS_get_u8(&v2_client_hello, &msg_type) || + !CBS_get_u16(&v2_client_hello, &version) || + !CBS_get_u16(&v2_client_hello, &cipher_spec_length) || + !CBS_get_u16(&v2_client_hello, &session_id_length) || + !CBS_get_u16(&v2_client_hello, &challenge_length) || + !CBS_get_bytes(&v2_client_hello, &cipher_specs, cipher_spec_length) || + !CBS_get_bytes(&v2_client_hello, &session_id, session_id_length) || + !CBS_get_bytes(&v2_client_hello, &challenge, challenge_length) || + CBS_len(&v2_client_hello) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_open_record_error; + } + + // msg_type has already been checked. + assert(msg_type == SSL2_MT_CLIENT_HELLO); + + // The client_random is the V2ClientHello challenge. Truncate or left-pad with + // zeros as needed. + size_t rand_len = CBS_len(&challenge); + if (rand_len > SSL3_RANDOM_SIZE) { + rand_len = SSL3_RANDOM_SIZE; + } + uint8_t random[SSL3_RANDOM_SIZE]; + OPENSSL_memset(random, 0, SSL3_RANDOM_SIZE); + OPENSSL_memcpy(random + (SSL3_RANDOM_SIZE - rand_len), CBS_data(&challenge), + rand_len); + + // 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 */ + + CBS_len(&cipher_specs) / 3 * 2 + + 1 /* compression length */ + 1 /* compression */; + ScopedCBB client_hello; + CBB hello_body, cipher_suites; + 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) || + !CBB_add_u24_length_prefixed(client_hello.get(), &hello_body) || + !CBB_add_u16(&hello_body, version) || + !CBB_add_bytes(&hello_body, random, SSL3_RANDOM_SIZE) || + // No session id. + !CBB_add_u8(&hello_body, 0) || + !CBB_add_u16_length_prefixed(&hello_body, &cipher_suites)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return ssl_open_record_error; + } + + // Copy the cipher suites. + while (CBS_len(&cipher_specs) > 0) { + uint32_t cipher_spec; + if (!CBS_get_u24(&cipher_specs, &cipher_spec)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_open_record_error; + } + + // Skip SSLv2 ciphers. + if ((cipher_spec & 0xff0000) != 0) { + continue; + } + if (!CBB_add_u16(&cipher_suites, cipher_spec)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_open_record_error; + } + } + + // Add the null compression scheme and finish. + if (!CBB_add_u8(&hello_body, 1) || + !CBB_add_u8(&hello_body, 0) || + !CBB_finish(client_hello.get(), NULL, &ssl->s3->hs_buf->length)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_open_record_error; + } + + *out_consumed = 2 + msg_length; + ssl->s3->is_v2_hello = true; + return ssl_open_record_success; +} + +static bool parse_message(const SSL *ssl, SSLMessage *out, + size_t *out_bytes_needed) { + if (!ssl->s3->hs_buf) { + *out_bytes_needed = 4; + return false; + } + + CBS cbs; + uint32_t len; + CBS_init(&cbs, reinterpret_cast(ssl->s3->hs_buf->data), + ssl->s3->hs_buf->length); + if (!CBS_get_u8(&cbs, &out->type) || + !CBS_get_u24(&cbs, &len)) { + *out_bytes_needed = 4; + return false; + } + + if (!CBS_get_bytes(&cbs, &out->body, len)) { + *out_bytes_needed = 4 + len; + return false; + } + + CBS_init(&out->raw, reinterpret_cast(ssl->s3->hs_buf->data), + 4 + len); + out->is_v2_hello = ssl->s3->is_v2_hello; + return true; +} + +bool ssl3_get_message(const SSL *ssl, SSLMessage *out) { + size_t unused; + if (!parse_message(ssl, out, &unused)) { + return false; + } + if (!ssl->s3->has_message) { + if (!out->is_v2_hello) { + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HANDSHAKE, out->raw); + } + ssl->s3->has_message = true; + } + return true; +} + +bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert) { + // If there is a complete message, the caller must have consumed it first. + SSLMessage msg; + size_t bytes_needed; + if (parse_message(ssl, &msg, &bytes_needed)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + // Enforce the limit so the peer cannot force us to buffer 16MB. + if (bytes_needed > 4 + ssl_max_handshake_message_len(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +bool tls_has_unprocessed_handshake_data(const SSL *ssl) { + size_t msg_len = 0; + if (ssl->s3->has_message) { + SSLMessage msg; + size_t unused; + if (parse_message(ssl, &msg, &unused)) { + msg_len = CBS_len(&msg.raw); + } + } + + return ssl->s3->hs_buf && ssl->s3->hs_buf->length > msg_len; +} + +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()); + } + 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 + // sufficient to detect a V2ClientHello and ensures that we never read + // beyond the first record. + if (in.size() < SSL3_RT_HEADER_LENGTH) { + *out_consumed = SSL3_RT_HEADER_LENGTH; + return ssl_open_record_partial; + } + + // Some dedicated error codes for protocol mixups should the application + // wish to interpret them differently. (These do not overlap with + // ClientHello or V2ClientHello.) + const char *str = reinterpret_cast(in.data()); + if (strncmp("GET ", str, 4) == 0 || + strncmp("POST ", str, 5) == 0 || + strncmp("HEAD ", str, 5) == 0 || + strncmp("PUT ", str, 4) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HTTP_REQUEST); + *out_alert = 0; + return ssl_open_record_error; + } + if (strncmp("CONNE", str, 5) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HTTPS_PROXY_REQUEST); + *out_alert = 0; + return ssl_open_record_error; + } + + // Check for a V2ClientHello. + if ((in[0] & 0x80) != 0 && in[2] == SSL2_MT_CLIENT_HELLO && + in[3] == SSL3_VERSION_MAJOR) { + auto ret = read_v2_client_hello(ssl, out_consumed, in); + if (ret == ssl_open_record_error) { + *out_alert = 0; + } else if (ret == ssl_open_record_success) { + ssl->s3->v2_hello_done = true; + } + return ret; + } + + ssl->s3->v2_hello_done = true; + } + + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + // WatchGuard's TLS 1.3 interference bug is very distinctive: they drop the + // ServerHello and send the remaining encrypted application data records + // as-is. This manifests as an application data record when we expect + // handshake. Report a dedicated error code for this case. + if (!ssl->server && type == SSL3_RT_APPLICATION_DATA && + ssl->s3->aead_read_ctx->is_null_cipher()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_APPLICATION_DATA_INSTEAD_OF_HANDSHAKE); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (type != SSL3_RT_HANDSHAKE) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + // Append the entire handshake record to the buffer. + if (!tls_append_handshake_data(ssl, body)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + + return ssl_open_record_success; +} + +void ssl3_next_message(SSL *ssl) { + SSLMessage msg; + if (!ssl3_get_message(ssl, &msg) || + !ssl->s3->hs_buf || + ssl->s3->hs_buf->length < CBS_len(&msg.raw)) { + assert(0); + return; + } + + OPENSSL_memmove(ssl->s3->hs_buf->data, + ssl->s3->hs_buf->data + CBS_len(&msg.raw), + ssl->s3->hs_buf->length - CBS_len(&msg.raw)); + ssl->s3->hs_buf->length -= CBS_len(&msg.raw); + ssl->s3->is_v2_hello = false; + ssl->s3->has_message = false; + + // Post-handshake messages are rare, so release the buffer after every + // message. During the handshake, |on_handshake_complete| will release it. + if (!SSL_in_init(ssl) && ssl->s3->hs_buf->length == 0) { + ssl->s3->hs_buf.reset(); + } +} + +// 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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc new file mode 100644 index 0000000..531f9a5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc @@ -0,0 +1,221 @@ +/* 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. + * + * 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. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSL3_STATE::SSL3_STATE() + : skip_early_data(false), + have_version(false), + v2_hello_done(false), + is_v2_hello(false), + has_message(false), + initial_handshake_complete(false), + session_reused(false), + delegated_credential_used(false), + send_connection_binding(false), + channel_id_valid(false), + key_update_pending(false), + wpend_pending(false), + early_data_accepted(false), + tls13_downgrade(false), + token_binding_negotiated(false), + alert_dispatch(false), + renegotiate_pending(false), + used_hello_retry_request(false) {} + +SSL3_STATE::~SSL3_STATE() {} + +bool ssl3_new(SSL *ssl) { + UniquePtr s3 = MakeUnique(); + if (!s3) { + return false; + } + + s3->aead_read_ctx = SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + s3->aead_write_ctx = SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + s3->hs = ssl_handshake_new(ssl); + if (!s3->aead_read_ctx || !s3->aead_write_ctx || !s3->hs) { + return false; + } + + ssl->s3 = s3.release(); + + // Set the version to the highest supported version. + // + // TODO(davidben): Move this field into |s3|, have it store the normalized + // protocol version, and implement this pre-negotiation quirk in |SSL_version| + // at the API boundary rather than in internal state. + ssl->version = TLS1_2_VERSION; + return true; +} + +void ssl3_free(SSL *ssl) { + if (ssl == NULL || ssl->s3 == NULL) { + return; + } + + Delete(ssl->s3); + ssl->s3 = NULL; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back new file mode 100644 index 0000000..978b108 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back @@ -0,0 +1,221 @@ +/* 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. + * + * 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. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSL3_STATE::SSL3_STATE() + : skip_early_data(false), + have_version(false), + v2_hello_done(false), + is_v2_hello(false), + has_message(false), + initial_handshake_complete(false), + session_reused(false), + delegated_credential_used(false), + send_connection_binding(false), + channel_id_valid(false), + key_update_pending(false), + wpend_pending(false), + early_data_accepted(false), + tls13_downgrade(false), + token_binding_negotiated(false), + alert_dispatch(false), + renegotiate_pending(false), + used_hello_retry_request(false) {} + +SSL3_STATE::~SSL3_STATE() {} + +bool ssl3_new(SSL *ssl) { + UniquePtr s3 = MakeUnique(); + if (!s3) { + return false; + } + + s3->aead_read_ctx = SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + s3->aead_write_ctx = SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + s3->hs = ssl_handshake_new(ssl); + if (!s3->aead_read_ctx || !s3->aead_write_ctx || !s3->hs) { + return false; + } + + ssl->s3 = s3.release(); + + // Set the version to the highest supported version. + // + // TODO(davidben): Move this field into |s3|, have it store the normalized + // protocol version, and implement this pre-negotiation quirk in |SSL_version| + // at the API boundary rather than in internal state. + ssl->version = TLS1_2_VERSION; + return true; +} + +void ssl3_free(SSL *ssl) { + if (ssl == NULL || ssl->s3 == NULL) { + return; + } + + Delete(ssl->s3); + ssl->s3 = NULL; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc new file mode 100644 index 0000000..19652ae --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc @@ -0,0 +1,458 @@ +/* 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../crypto/err/internal.h" +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len); + +int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, + int len) { + assert(ssl_can_write(ssl)); + assert(!ssl->s3->aead_write_ctx->is_null_cipher()); + + *out_needs_handshake = false; + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + unsigned tot, n, nw; + + assert(ssl->s3->wnum <= INT_MAX); + tot = ssl->s3->wnum; + ssl->s3->wnum = 0; + + // Ensure that if we end up with a smaller value of data to write out than + // the the original len from a write which didn't complete for non-blocking + // I/O and also somehow ended up avoiding the check for this in + // ssl3_write_pending/SSL_R_BAD_WRITE_RETRY as it must never be possible to + // end up with (len-tot) as a large number that will then promptly send + // beyond the end of the users buffer ... so we trap and report the error in + // a way the user will notice. + if (len < 0 || (size_t)len < tot) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_LENGTH); + return -1; + } + + const int is_early_data_write = + !ssl->server && SSL_in_early_data(ssl) && ssl->s3->hs->can_early_write; + + n = len - tot; + 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 (max == 0) { + ssl->s3->wnum = tot; + ssl->s3->hs->can_early_write = false; + *out_needs_handshake = true; + return -1; + } + } + + if (n > max) { + nw = max; + } else { + nw = n; + } + + int ret = do_ssl3_write(ssl, SSL3_RT_APPLICATION_DATA, &in[tot], nw); + if (ret <= 0) { + ssl->s3->wnum = tot; + return ret; + } + + if (is_early_data_write) { + ssl->s3->hs->early_data_written += ret; + } + + if (ret == (int)n || (ssl->mode & SSL_MODE_ENABLE_PARTIAL_WRITE)) { + return tot + ret; + } + + n -= ret; + tot += ret; + } +} + +static int ssl3_write_pending(SSL *ssl, int type, const uint8_t *in, + unsigned int len) { + if (ssl->s3->wpend_tot > (int)len || + (!(ssl->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER) && + ssl->s3->wpend_buf != in) || + ssl->s3->wpend_type != type) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_WRITE_RETRY); + return -1; + } + + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + return ret; + } + ssl->s3->wpend_pending = false; + return ssl->s3->wpend_ret; +} + +// do_ssl3_write writes an SSL record of the given type. +static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { + // If there is still data from the previous record, flush it. + if (ssl->s3->wpend_pending) { + return ssl3_write_pending(ssl, type, in, len); + } + + SSLBuffer *buf = &ssl->s3->write_buffer; + if (len > SSL3_RT_MAX_PLAIN_LENGTH || buf->size() > 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + if (!tls_flush_pending_hs_data(ssl)) { + return -1; + } + + size_t flight_len = 0; + if (ssl->s3->pending_flight != nullptr) { + flight_len = + ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset; + } + + 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; + } + + if (!buf->EnsureCap(flight_len + ssl_seal_align_prefix_len(ssl), max_out)) { + return -1; + } + + // Add any unflushed handshake data as a prefix. This may be a KeyUpdate + // acknowledgment or 0-RTT key change messages. |pending_flight| must be clear + // when data is added to |write_buffer| or it will be written in the wrong + // order. + if (ssl->s3->pending_flight != nullptr) { + OPENSSL_memcpy( + buf->remaining().data(), + ssl->s3->pending_flight->data + ssl->s3->pending_flight_offset, + flight_len); + ssl->s3->pending_flight.reset(); + ssl->s3->pending_flight_offset = 0; + buf->DidWrite(flight_len); + } + + 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); + } + + // Now that we've made progress on the connection, uncork KeyUpdate + // acknowledgments. + ssl->s3->key_update_pending = false; + + // Memorize arguments so that ssl3_write_pending can detect bad write retries + // later. + ssl->s3->wpend_tot = len; + ssl->s3->wpend_buf = in; + ssl->s3->wpend_type = type; + ssl->s3->wpend_ret = len; + ssl->s3->wpend_pending = true; + + // We now just need to write the buffer. + return ssl3_write_pending(ssl, type, in, len); +} + +ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + assert(ssl_can_read(ssl)); + assert(!ssl->s3->aead_read_ctx->is_null_cipher()); + + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + const bool is_early_data_read = ssl->server && SSL_in_early_data(ssl); + + if (type == SSL3_RT_HANDSHAKE) { + // Post-handshake data prior to TLS 1.3 is always renegotiation, which we + // never accept as a server. Otherwise |ssl3_get_message| will send + // |SSL_R_EXCESSIVE_MESSAGE_SIZE|. + if (ssl->server && ssl_protocol_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + *out_alert = SSL_AD_NO_RENEGOTIATION; + return ssl_open_record_error; + } + + if (!tls_append_handshake_data(ssl, body)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (is_early_data_read) { + if (body.size() > kMaxEarlyDataAccepted - ssl->s3->hs->early_data_read) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MUCH_READ_EARLY_DATA); + *out_alert = SSL3_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + ssl->s3->hs->early_data_read += body.size(); + } + + if (body.empty()) { + return ssl_open_record_discard; + } + + *out = body; + return ssl_open_record_success; +} + +ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + if (type != SSL3_RT_CHANGE_CIPHER_SPEC) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (body.size() != 1 || body[0] != SSL3_MT_CCS) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_CHANGE_CIPHER_SPEC, body); + return ssl_open_record_success; +} + +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); + return -1; + } + + if (level == SSL3_AL_WARNING && desc == SSL_AD_CLOSE_NOTIFY) { + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + } else { + assert(level == SSL3_AL_FATAL); + assert(desc != SSL_AD_CLOSE_NOTIFY); + ssl->s3->write_shutdown = ssl_shutdown_error; + } + + ssl->s3->alert_dispatch = true; + ssl->s3->send_alert[0] = level; + ssl->s3->send_alert[1] = desc; + if (ssl->s3->write_buffer.empty()) { + // Nothing is being written out, so the alert may be dispatched + // immediately. + return ssl->method->dispatch_alert(ssl); + } + + // The alert will be dispatched later. + return -1; +} + +int ssl3_dispatch_alert(SSL *ssl) { + 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 = false; + + // If the alert is fatal, flush the BIO now. + if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { + BIO_flush(ssl->wbio.get()); + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); + + int alert = (ssl->s3->send_alert[0] << 8) | ssl->s3->send_alert[1]; + ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, alert); + + return 1; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back new file mode 100644 index 0000000..2fcc2a5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back @@ -0,0 +1,458 @@ +/* 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). */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../crypto/err/internal.h" +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len); + +int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, + int len) { + assert(ssl_can_write(ssl)); + assert(!ssl->s3->aead_write_ctx->is_null_cipher()); + + *out_needs_handshake = false; + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + unsigned tot, n, nw; + + assert(ssl->s3->wnum <= INT_MAX); + tot = ssl->s3->wnum; + ssl->s3->wnum = 0; + + // Ensure that if we end up with a smaller value of data to write out than + // the the original len from a write which didn't complete for non-blocking + // I/O and also somehow ended up avoiding the check for this in + // ssl3_write_pending/SSL_R_BAD_WRITE_RETRY as it must never be possible to + // end up with (len-tot) as a large number that will then promptly send + // beyond the end of the users buffer ... so we trap and report the error in + // a way the user will notice. + if (len < 0 || (size_t)len < tot) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_LENGTH); + return -1; + } + + const int is_early_data_write = + !ssl->server && SSL_in_early_data(ssl) && ssl->s3->hs->can_early_write; + + n = len - tot; + 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 (max == 0) { + ssl->s3->wnum = tot; + ssl->s3->hs->can_early_write = false; + *out_needs_handshake = true; + return -1; + } + } + + if (n > max) { + nw = max; + } else { + nw = n; + } + + int ret = do_ssl3_write(ssl, SSL3_RT_APPLICATION_DATA, &in[tot], nw); + if (ret <= 0) { + ssl->s3->wnum = tot; + return ret; + } + + if (is_early_data_write) { + ssl->s3->hs->early_data_written += ret; + } + + if (ret == (int)n || (ssl->mode & SSL_MODE_ENABLE_PARTIAL_WRITE)) { + return tot + ret; + } + + n -= ret; + tot += ret; + } +} + +static int ssl3_write_pending(SSL *ssl, int type, const uint8_t *in, + unsigned int len) { + if (ssl->s3->wpend_tot > (int)len || + (!(ssl->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER) && + ssl->s3->wpend_buf != in) || + ssl->s3->wpend_type != type) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_WRITE_RETRY); + return -1; + } + + int ret = ssl_write_buffer_flush(ssl); + if (ret <= 0) { + return ret; + } + ssl->s3->wpend_pending = false; + return ssl->s3->wpend_ret; +} + +// do_ssl3_write writes an SSL record of the given type. +static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { + // If there is still data from the previous record, flush it. + if (ssl->s3->wpend_pending) { + return ssl3_write_pending(ssl, type, in, len); + } + + SSLBuffer *buf = &ssl->s3->write_buffer; + if (len > SSL3_RT_MAX_PLAIN_LENGTH || buf->size() > 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + if (!tls_flush_pending_hs_data(ssl)) { + return -1; + } + + size_t flight_len = 0; + if (ssl->s3->pending_flight != nullptr) { + flight_len = + ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset; + } + + 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; + } + + if (!buf->EnsureCap(flight_len + ssl_seal_align_prefix_len(ssl), max_out)) { + return -1; + } + + // Add any unflushed handshake data as a prefix. This may be a KeyUpdate + // acknowledgment or 0-RTT key change messages. |pending_flight| must be clear + // when data is added to |write_buffer| or it will be written in the wrong + // order. + if (ssl->s3->pending_flight != nullptr) { + OPENSSL_memcpy( + buf->remaining().data(), + ssl->s3->pending_flight->data + ssl->s3->pending_flight_offset, + flight_len); + ssl->s3->pending_flight.reset(); + ssl->s3->pending_flight_offset = 0; + buf->DidWrite(flight_len); + } + + 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); + } + + // Now that we've made progress on the connection, uncork KeyUpdate + // acknowledgments. + ssl->s3->key_update_pending = false; + + // Memorize arguments so that ssl3_write_pending can detect bad write retries + // later. + ssl->s3->wpend_tot = len; + ssl->s3->wpend_buf = in; + ssl->s3->wpend_type = type; + ssl->s3->wpend_ret = len; + ssl->s3->wpend_pending = true; + + // We now just need to write the buffer. + return ssl3_write_pending(ssl, type, in, len); +} + +ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + assert(ssl_can_read(ssl)); + assert(!ssl->s3->aead_read_ctx->is_null_cipher()); + + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + const bool is_early_data_read = ssl->server && SSL_in_early_data(ssl); + + if (type == SSL3_RT_HANDSHAKE) { + // Post-handshake data prior to TLS 1.3 is always renegotiation, which we + // never accept as a server. Otherwise |ssl3_get_message| will send + // |SSL_R_EXCESSIVE_MESSAGE_SIZE|. + if (ssl->server && ssl_protocol_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + *out_alert = SSL_AD_NO_RENEGOTIATION; + return ssl_open_record_error; + } + + if (!tls_append_handshake_data(ssl, body)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (is_early_data_read) { + if (body.size() > kMaxEarlyDataAccepted - ssl->s3->hs->early_data_read) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MUCH_READ_EARLY_DATA); + *out_alert = SSL3_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + ssl->s3->hs->early_data_read += body.size(); + } + + if (body.empty()) { + return ssl_open_record_discard; + } + + *out = body; + return ssl_open_record_success; +} + +ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + uint8_t type; + Span body; + auto ret = tls_open_record(ssl, &type, &body, out_consumed, out_alert, in); + if (ret != ssl_open_record_success) { + return ret; + } + + if (type != SSL3_RT_CHANGE_CIPHER_SPEC) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + if (body.size() != 1 || body[0] != SSL3_MT_CCS) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_CHANGE_CIPHER_SPEC, body); + return ssl_open_record_success; +} + +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); + return -1; + } + + if (level == SSL3_AL_WARNING && desc == SSL_AD_CLOSE_NOTIFY) { + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + } else { + assert(level == SSL3_AL_FATAL); + assert(desc != SSL_AD_CLOSE_NOTIFY); + ssl->s3->write_shutdown = ssl_shutdown_error; + } + + ssl->s3->alert_dispatch = true; + ssl->s3->send_alert[0] = level; + ssl->s3->send_alert[1] = desc; + if (ssl->s3->write_buffer.empty()) { + // Nothing is being written out, so the alert may be dispatched + // immediately. + return ssl->method->dispatch_alert(ssl); + } + + // The alert will be dispatched later. + return -1; +} + +int ssl3_dispatch_alert(SSL *ssl) { + 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 = false; + + // If the alert is fatal, flush the BIO now. + if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { + BIO_flush(ssl->wbio.get()); + } + + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); + + int alert = (ssl->s3->send_alert[0] << 8) | ssl->s3->send_alert[1]; + ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, alert); + + return 1; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc new file mode 100644 index 0000000..33d7e1b --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc @@ -0,0 +1,432 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) +#define FUZZER_MODE true +#else +#define FUZZER_MODE false +#endif + +BSSL_NAMESPACE_BEGIN + +SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, + const SSL_CIPHER *cipher_arg) + : cipher_(cipher_arg), + version_(version_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), + ad_is_header_(false) { + OPENSSL_memset(fixed_nonce_, 0, sizeof(fixed_nonce_)); +} + +SSLAEADContext::~SSLAEADContext() {} + +UniquePtr SSLAEADContext::CreateNullCipher(bool is_dtls) { + return MakeUnique(0 /* version */, is_dtls, + nullptr /* cipher */); +} + +UniquePtr SSLAEADContext::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) { + const EVP_AEAD *aead; + uint16_t protocol_version; + size_t expected_mac_key_len, expected_fixed_iv_len; + if (!ssl_protocol_version_from_wire(&protocol_version, version) || + !ssl_cipher_get_evp_aead(&aead, &expected_mac_key_len, + &expected_fixed_iv_len, cipher, protocol_version, + is_dtls) || + // Ensure the caller returned correct key sizes. + expected_fixed_iv_len != fixed_iv.size() || + expected_mac_key_len != mac_key.size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + + uint8_t merged_key[EVP_AEAD_MAX_KEY_LENGTH]; + if (!mac_key.empty()) { + // This is a "stateful" AEAD (for compatibility with pre-AEAD cipher + // suites). + if (mac_key.size() + enc_key.size() + fixed_iv.size() > + sizeof(merged_key)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + OPENSSL_memcpy(merged_key, mac_key.data(), mac_key.size()); + OPENSSL_memcpy(merged_key + mac_key.size(), enc_key.data(), enc_key.size()); + OPENSSL_memcpy(merged_key + mac_key.size() + enc_key.size(), + fixed_iv.data(), fixed_iv.size()); + enc_key = MakeConstSpan(merged_key, + enc_key.size() + mac_key.size() + fixed_iv.size()); + } + + UniquePtr aead_ctx = + MakeUnique(version, is_dtls, cipher); + if (!aead_ctx) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + assert(aead_ctx->ProtocolVersion() == protocol_version); + + if (!EVP_AEAD_CTX_init_with_direction( + aead_ctx->ctx_.get(), aead, enc_key.data(), enc_key.size(), + EVP_AEAD_DEFAULT_TAG_LENGTH, direction)) { + return nullptr; + } + + assert(EVP_AEAD_nonce_length(aead) <= EVP_AEAD_MAX_NONCE_LENGTH); + static_assert(EVP_AEAD_MAX_NONCE_LENGTH < 256, + "variable_nonce_len doesn't fit in uint8_t"); + aead_ctx->variable_nonce_len_ = (uint8_t)EVP_AEAD_nonce_length(aead); + if (mac_key.empty()) { + assert(fixed_iv.size() <= sizeof(aead_ctx->fixed_nonce_)); + OPENSSL_memcpy(aead_ctx->fixed_nonce_, fixed_iv.data(), fixed_iv.size()); + aead_ctx->fixed_nonce_len_ = fixed_iv.size(); + + if (cipher->algorithm_enc & SSL_CHACHA20POLY1305) { + // The fixed nonce into the actual nonce (the sequence number). + aead_ctx->xor_fixed_nonce_ = true; + aead_ctx->variable_nonce_len_ = 8; + } else { + // The fixed IV is prepended to the nonce. + assert(fixed_iv.size() <= aead_ctx->variable_nonce_len_); + aead_ctx->variable_nonce_len_ -= fixed_iv.size(); + } + + // AES-GCM uses an explicit nonce. + if (cipher->algorithm_enc & (SSL_AES128GCM | SSL_AES256GCM)) { + aead_ctx->variable_nonce_included_in_record_ = true; + } + + // The TLS 1.3 construction XORs the fixed nonce into the sequence number + // and omits the additional data. + if (protocol_version >= TLS1_3_VERSION) { + aead_ctx->xor_fixed_nonce_ = true; + aead_ctx->variable_nonce_len_ = 8; + aead_ctx->variable_nonce_included_in_record_ = false; + aead_ctx->ad_is_header_ = true; + assert(fixed_iv.size() >= aead_ctx->variable_nonce_len_); + } + } else { + assert(protocol_version < TLS1_3_VERSION); + aead_ctx->variable_nonce_included_in_record_ = true; + aead_ctx->random_variable_nonce_ = true; + aead_ctx->omit_length_in_ad_ = true; + } + + 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; + } +} + +uint16_t SSLAEADContext::ProtocolVersion() const { + uint16_t protocol_version; + if(!ssl_protocol_version_from_wire(&protocol_version, version_)) { + assert(false); + return 0; + } + return protocol_version; +} + +uint16_t SSLAEADContext::RecordVersion() const { + if (version_ == 0) { + assert(is_null_cipher()); + return is_dtls_ ? DTLS1_VERSION : TLS1_VERSION; + } + + if (ProtocolVersion() <= TLS1_2_VERSION) { + return version_; + } + + return TLS1_2_VERSION; +} + +size_t SSLAEADContext::ExplicitNonceLen() const { + if (!FUZZER_MODE && variable_nonce_included_in_record_) { + return variable_nonce_len_; + } + return 0; +} + +bool SSLAEADContext::SuffixLen(size_t *out_suffix_len, const size_t in_len, + const size_t extra_in_len) const { + if (is_null_cipher() || FUZZER_MODE) { + *out_suffix_len = extra_in_len; + return true; + } + return !!EVP_AEAD_CTX_tag_len(ctx_.get(), out_suffix_len, 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 + ? 0 + : EVP_AEAD_max_overhead(EVP_AEAD_CTX_aead(ctx_.get()))); +} + +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(storage, seqnum, 8); + size_t len = 8; + storage[len++] = type; + storage[len++] = static_cast((record_version >> 8)); + storage[len++] = static_cast(record_version); + if (!omit_length_in_ad_) { + storage[len++] = static_cast((plaintext_len >> 8)); + storage[len++] = static_cast(plaintext_len); + } + return MakeConstSpan(storage, len); +} + +bool SSLAEADContext::Open(Span *out, uint8_t type, + uint16_t record_version, const uint8_t seqnum[8], + Span header, Span in) { + if (is_null_cipher() || FUZZER_MODE) { + // Handle the initial NULL cipher. + *out = in; + return true; + } + + // TLS 1.2 AEADs include the length in the AD and are assumed to have fixed + // overhead. Otherwise the parameter is unused. + size_t plaintext_len = 0; + if (!omit_length_in_ad_) { + size_t overhead = MaxOverhead(); + if (in.size() < overhead) { + // Publicly invalid. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_PACKET_LENGTH); + return false; + } + plaintext_len = in.size() - overhead; + } + + 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]; + size_t nonce_len = 0; + + // Prepend the fixed nonce, or left-pad with zeros if XORing. + if (xor_fixed_nonce_) { + nonce_len = fixed_nonce_len_ - variable_nonce_len_; + OPENSSL_memset(nonce, 0, nonce_len); + } else { + OPENSSL_memcpy(nonce, fixed_nonce_, fixed_nonce_len_); + nonce_len += fixed_nonce_len_; + } + + // Add the variable nonce. + if (variable_nonce_included_in_record_) { + if (in.size() < variable_nonce_len_) { + // Publicly invalid. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_PACKET_LENGTH); + return false; + } + OPENSSL_memcpy(nonce + nonce_len, in.data(), variable_nonce_len_); + in = in.subspan(variable_nonce_len_); + } else { + assert(variable_nonce_len_ == 8); + OPENSSL_memcpy(nonce + nonce_len, seqnum, variable_nonce_len_); + } + nonce_len += variable_nonce_len_; + + // XOR the fixed nonce, if necessary. + if (xor_fixed_nonce_) { + assert(nonce_len == fixed_nonce_len_); + for (size_t i = 0; i < fixed_nonce_len_; i++) { + nonce[i] ^= fixed_nonce_[i]; + } + } + + // 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.data(), + ad.size())) { + return false; + } + *out = in.subspan(0, len); + return true; +} + +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], + 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(); + size_t suffix_len; + if (!SuffixLen(&suffix_len, in_len, extra_in_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; + } + if ((in != out && buffers_alias(in, in_len, out, in_len)) || + buffers_alias(in, in_len, out_prefix, prefix_len) || + buffers_alias(in, in_len, out_suffix, suffix_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); + return false; + } + + if (is_null_cipher() || FUZZER_MODE) { + // Handle the initial NULL cipher. + OPENSSL_memmove(out, in, in_len); + OPENSSL_memmove(out_suffix, extra_in, extra_in_len); + return true; + } + + 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]; + size_t nonce_len = 0; + + // Prepend the fixed nonce, or left-pad with zeros if XORing. + if (xor_fixed_nonce_) { + nonce_len = fixed_nonce_len_ - variable_nonce_len_; + OPENSSL_memset(nonce, 0, nonce_len); + } else { + OPENSSL_memcpy(nonce, fixed_nonce_, fixed_nonce_len_); + nonce_len += fixed_nonce_len_; + } + + // Select the variable nonce. + if (random_variable_nonce_) { + assert(variable_nonce_included_in_record_); + if (!RAND_bytes(nonce + nonce_len, variable_nonce_len_)) { + return false; + } + } else { + // When sending we use the sequence number as the variable part of the + // nonce. + assert(variable_nonce_len_ == 8); + OPENSSL_memcpy(nonce + nonce_len, seqnum, variable_nonce_len_); + } + nonce_len += variable_nonce_len_; + + // Emit the variable nonce if included in the record. + if (variable_nonce_included_in_record_) { + assert(!xor_fixed_nonce_); + if (buffers_alias(in, in_len, out_prefix, variable_nonce_len_)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); + return false; + } + OPENSSL_memcpy(out_prefix, nonce + fixed_nonce_len_, + variable_nonce_len_); + } + + // XOR the fixed nonce, if necessary. + if (xor_fixed_nonce_) { + assert(nonce_len == fixed_nonce_len_); + for (size_t i = 0; i < fixed_nonce_len_; i++) { + nonce[i] ^= fixed_nonce_[i]; + } + } + + 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.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], 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; + } + if (in_len + prefix_len < in_len || + in_len + prefix_len + suffix_len < in_len + prefix_len) { + OPENSSL_PUT_ERROR(CIPHER, SSL_R_RECORD_TOO_LARGE); + return false; + } + if (in_len + prefix_len + suffix_len > max_out_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + + if (!SealScatter(out, out + prefix_len, out + prefix_len + in_len, type, + record_version, seqnum, header, in, in_len, 0, 0)) { + return false; + } + *out_len = prefix_len + in_len + suffix_len; + return true; +} + +bool SSLAEADContext::GetIV(const uint8_t **out_iv, size_t *out_iv_len) const { + return !is_null_cipher() && + EVP_AEAD_CTX_get_iv(ctx_.get(), out_iv, out_iv_len); +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back new file mode 100644 index 0000000..0bad266 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back @@ -0,0 +1,432 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) +#define FUZZER_MODE true +#else +#define FUZZER_MODE false +#endif + +BSSL_NAMESPACE_BEGIN + +SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, + const SSL_CIPHER *cipher_arg) + : cipher_(cipher_arg), + version_(version_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), + ad_is_header_(false) { + OPENSSL_memset(fixed_nonce_, 0, sizeof(fixed_nonce_)); +} + +SSLAEADContext::~SSLAEADContext() {} + +UniquePtr SSLAEADContext::CreateNullCipher(bool is_dtls) { + return MakeUnique(0 /* version */, is_dtls, + nullptr /* cipher */); +} + +UniquePtr SSLAEADContext::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) { + const EVP_AEAD *aead; + uint16_t protocol_version; + size_t expected_mac_key_len, expected_fixed_iv_len; + if (!ssl_protocol_version_from_wire(&protocol_version, version) || + !ssl_cipher_get_evp_aead(&aead, &expected_mac_key_len, + &expected_fixed_iv_len, cipher, protocol_version, + is_dtls) || + // Ensure the caller returned correct key sizes. + expected_fixed_iv_len != fixed_iv.size() || + expected_mac_key_len != mac_key.size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + + uint8_t merged_key[EVP_AEAD_MAX_KEY_LENGTH]; + if (!mac_key.empty()) { + // This is a "stateful" AEAD (for compatibility with pre-AEAD cipher + // suites). + if (mac_key.size() + enc_key.size() + fixed_iv.size() > + sizeof(merged_key)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + OPENSSL_memcpy(merged_key, mac_key.data(), mac_key.size()); + OPENSSL_memcpy(merged_key + mac_key.size(), enc_key.data(), enc_key.size()); + OPENSSL_memcpy(merged_key + mac_key.size() + enc_key.size(), + fixed_iv.data(), fixed_iv.size()); + enc_key = MakeConstSpan(merged_key, + enc_key.size() + mac_key.size() + fixed_iv.size()); + } + + UniquePtr aead_ctx = + MakeUnique(version, is_dtls, cipher); + if (!aead_ctx) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + assert(aead_ctx->ProtocolVersion() == protocol_version); + + if (!EVP_AEAD_CTX_init_with_direction( + aead_ctx->ctx_.get(), aead, enc_key.data(), enc_key.size(), + EVP_AEAD_DEFAULT_TAG_LENGTH, direction)) { + return nullptr; + } + + assert(EVP_AEAD_nonce_length(aead) <= EVP_AEAD_MAX_NONCE_LENGTH); + static_assert(EVP_AEAD_MAX_NONCE_LENGTH < 256, + "variable_nonce_len doesn't fit in uint8_t"); + aead_ctx->variable_nonce_len_ = (uint8_t)EVP_AEAD_nonce_length(aead); + if (mac_key.empty()) { + assert(fixed_iv.size() <= sizeof(aead_ctx->fixed_nonce_)); + OPENSSL_memcpy(aead_ctx->fixed_nonce_, fixed_iv.data(), fixed_iv.size()); + aead_ctx->fixed_nonce_len_ = fixed_iv.size(); + + if (cipher->algorithm_enc & SSL_CHACHA20POLY1305) { + // The fixed nonce into the actual nonce (the sequence number). + aead_ctx->xor_fixed_nonce_ = true; + aead_ctx->variable_nonce_len_ = 8; + } else { + // The fixed IV is prepended to the nonce. + assert(fixed_iv.size() <= aead_ctx->variable_nonce_len_); + aead_ctx->variable_nonce_len_ -= fixed_iv.size(); + } + + // AES-GCM uses an explicit nonce. + if (cipher->algorithm_enc & (SSL_AES128GCM | SSL_AES256GCM)) { + aead_ctx->variable_nonce_included_in_record_ = true; + } + + // The TLS 1.3 construction XORs the fixed nonce into the sequence number + // and omits the additional data. + if (protocol_version >= TLS1_3_VERSION) { + aead_ctx->xor_fixed_nonce_ = true; + aead_ctx->variable_nonce_len_ = 8; + aead_ctx->variable_nonce_included_in_record_ = false; + aead_ctx->ad_is_header_ = true; + assert(fixed_iv.size() >= aead_ctx->variable_nonce_len_); + } + } else { + assert(protocol_version < TLS1_3_VERSION); + aead_ctx->variable_nonce_included_in_record_ = true; + aead_ctx->random_variable_nonce_ = true; + aead_ctx->omit_length_in_ad_ = true; + } + + 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; + } +} + +uint16_t SSLAEADContext::ProtocolVersion() const { + uint16_t protocol_version; + if(!ssl_protocol_version_from_wire(&protocol_version, version_)) { + assert(false); + return 0; + } + return protocol_version; +} + +uint16_t SSLAEADContext::RecordVersion() const { + if (version_ == 0) { + assert(is_null_cipher()); + return is_dtls_ ? DTLS1_VERSION : TLS1_VERSION; + } + + if (ProtocolVersion() <= TLS1_2_VERSION) { + return version_; + } + + return TLS1_2_VERSION; +} + +size_t SSLAEADContext::ExplicitNonceLen() const { + if (!FUZZER_MODE && variable_nonce_included_in_record_) { + return variable_nonce_len_; + } + return 0; +} + +bool SSLAEADContext::SuffixLen(size_t *out_suffix_len, const size_t in_len, + const size_t extra_in_len) const { + if (is_null_cipher() || FUZZER_MODE) { + *out_suffix_len = extra_in_len; + return true; + } + return !!EVP_AEAD_CTX_tag_len(ctx_.get(), out_suffix_len, 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 + ? 0 + : EVP_AEAD_max_overhead(EVP_AEAD_CTX_aead(ctx_.get()))); +} + +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(storage, seqnum, 8); + size_t len = 8; + storage[len++] = type; + storage[len++] = static_cast((record_version >> 8)); + storage[len++] = static_cast(record_version); + if (!omit_length_in_ad_) { + storage[len++] = static_cast((plaintext_len >> 8)); + storage[len++] = static_cast(plaintext_len); + } + return MakeConstSpan(storage, len); +} + +bool SSLAEADContext::Open(Span *out, uint8_t type, + uint16_t record_version, const uint8_t seqnum[8], + Span header, Span in) { + if (is_null_cipher() || FUZZER_MODE) { + // Handle the initial NULL cipher. + *out = in; + return true; + } + + // TLS 1.2 AEADs include the length in the AD and are assumed to have fixed + // overhead. Otherwise the parameter is unused. + size_t plaintext_len = 0; + if (!omit_length_in_ad_) { + size_t overhead = MaxOverhead(); + if (in.size() < overhead) { + // Publicly invalid. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_PACKET_LENGTH); + return false; + } + plaintext_len = in.size() - overhead; + } + + 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]; + size_t nonce_len = 0; + + // Prepend the fixed nonce, or left-pad with zeros if XORing. + if (xor_fixed_nonce_) { + nonce_len = fixed_nonce_len_ - variable_nonce_len_; + OPENSSL_memset(nonce, 0, nonce_len); + } else { + OPENSSL_memcpy(nonce, fixed_nonce_, fixed_nonce_len_); + nonce_len += fixed_nonce_len_; + } + + // Add the variable nonce. + if (variable_nonce_included_in_record_) { + if (in.size() < variable_nonce_len_) { + // Publicly invalid. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_PACKET_LENGTH); + return false; + } + OPENSSL_memcpy(nonce + nonce_len, in.data(), variable_nonce_len_); + in = in.subspan(variable_nonce_len_); + } else { + assert(variable_nonce_len_ == 8); + OPENSSL_memcpy(nonce + nonce_len, seqnum, variable_nonce_len_); + } + nonce_len += variable_nonce_len_; + + // XOR the fixed nonce, if necessary. + if (xor_fixed_nonce_) { + assert(nonce_len == fixed_nonce_len_); + for (size_t i = 0; i < fixed_nonce_len_; i++) { + nonce[i] ^= fixed_nonce_[i]; + } + } + + // 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.data(), + ad.size())) { + return false; + } + *out = in.subspan(0, len); + return true; +} + +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], + 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(); + size_t suffix_len; + if (!SuffixLen(&suffix_len, in_len, extra_in_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; + } + if ((in != out && buffers_alias(in, in_len, out, in_len)) || + buffers_alias(in, in_len, out_prefix, prefix_len) || + buffers_alias(in, in_len, out_suffix, suffix_len)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); + return false; + } + + if (is_null_cipher() || FUZZER_MODE) { + // Handle the initial NULL cipher. + OPENSSL_memmove(out, in, in_len); + OPENSSL_memmove(out_suffix, extra_in, extra_in_len); + return true; + } + + 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]; + size_t nonce_len = 0; + + // Prepend the fixed nonce, or left-pad with zeros if XORing. + if (xor_fixed_nonce_) { + nonce_len = fixed_nonce_len_ - variable_nonce_len_; + OPENSSL_memset(nonce, 0, nonce_len); + } else { + OPENSSL_memcpy(nonce, fixed_nonce_, fixed_nonce_len_); + nonce_len += fixed_nonce_len_; + } + + // Select the variable nonce. + if (random_variable_nonce_) { + assert(variable_nonce_included_in_record_); + if (!RAND_bytes(nonce + nonce_len, variable_nonce_len_)) { + return false; + } + } else { + // When sending we use the sequence number as the variable part of the + // nonce. + assert(variable_nonce_len_ == 8); + OPENSSL_memcpy(nonce + nonce_len, seqnum, variable_nonce_len_); + } + nonce_len += variable_nonce_len_; + + // Emit the variable nonce if included in the record. + if (variable_nonce_included_in_record_) { + assert(!xor_fixed_nonce_); + if (buffers_alias(in, in_len, out_prefix, variable_nonce_len_)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); + return false; + } + OPENSSL_memcpy(out_prefix, nonce + fixed_nonce_len_, + variable_nonce_len_); + } + + // XOR the fixed nonce, if necessary. + if (xor_fixed_nonce_) { + assert(nonce_len == fixed_nonce_len_); + for (size_t i = 0; i < fixed_nonce_len_; i++) { + nonce[i] ^= fixed_nonce_[i]; + } + } + + 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.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], 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; + } + if (in_len + prefix_len < in_len || + in_len + prefix_len + suffix_len < in_len + prefix_len) { + OPENSSL_PUT_ERROR(CIPHER, SSL_R_RECORD_TOO_LARGE); + return false; + } + if (in_len + prefix_len + suffix_len > max_out_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + + if (!SealScatter(out, out + prefix_len, out + prefix_len + in_len, type, + record_version, seqnum, header, in, in_len, 0, 0)) { + return false; + } + *out_len = prefix_len + in_len + suffix_len; + return true; +} + +bool SSLAEADContext::GetIV(const uint8_t **out_iv, size_t *out_iv_len) const { + return !is_null_cipher() && + EVP_AEAD_CTX_get_iv(ctx_.get(), out_iv, out_iv_len); +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc new file mode 100644 index 0000000..3aa124f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc @@ -0,0 +1,827 @@ +/* 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 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// An SSL_SESSION is serialized as the following ASN.1 structure: +// +// SSLSession ::= SEQUENCE { +// version INTEGER (1), -- session structure version +// sslVersion INTEGER, -- protocol version number +// cipher OCTET STRING, -- two bytes long +// sessionID OCTET STRING, +// masterKey OCTET STRING, +// time [1] INTEGER, -- seconds since UNIX epoch +// timeout [2] INTEGER, -- in seconds +// peer [3] Certificate OPTIONAL, +// sessionIDContext [4] OCTET STRING OPTIONAL, +// verifyResult [5] INTEGER OPTIONAL, -- one of X509_V_* codes +// pskIdentity [8] OCTET STRING OPTIONAL, +// ticketLifetimeHint [9] INTEGER OPTIONAL, -- client-only +// ticket [10] OCTET STRING OPTIONAL, -- client-only +// peerSHA256 [13] OCTET STRING OPTIONAL, +// originalHandshakeHash [14] OCTET STRING OPTIONAL, +// signedCertTimestampList [15] OCTET STRING OPTIONAL, +// -- contents of SCT extension +// ocspResponse [16] OCTET STRING OPTIONAL, +// -- stapled OCSP response from the server +// extendedMasterSecret [17] BOOLEAN OPTIONAL, +// groupID [18] INTEGER OPTIONAL, +// certChain [19] SEQUENCE OF Certificate OPTIONAL, +// ticketAgeAdd [21] OCTET STRING OPTIONAL, +// isServer [22] BOOLEAN DEFAULT TRUE, +// peerSignatureAlgorithm [23] INTEGER OPTIONAL, +// ticketMaxEarlyData [24] INTEGER OPTIONAL, +// authTimeout [25] INTEGER OPTIONAL, -- defaults to timeout +// earlyALPN [26] OCTET STRING OPTIONAL, +// } +// +// Note: historically this serialization has included other optional +// fields. Their presence is currently treated as a parse error, except for +// hostName, which is ignored. +// +// keyArg [0] IMPLICIT OCTET STRING OPTIONAL, +// hostName [6] OCTET STRING OPTIONAL, +// pskIdentityHint [7] OCTET STRING OPTIONAL, +// compressionMethod [11] OCTET STRING OPTIONAL, +// srpUsername [12] OCTET STRING OPTIONAL, +// ticketFlags [20] INTEGER OPTIONAL, + +static const unsigned kVersion = 1; + +static const unsigned kTimeTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1; +static const unsigned kTimeoutTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2; +static const unsigned kPeerTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3; +static const unsigned kSessionIDContextTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 4; +static const unsigned kVerifyResultTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 5; +static const unsigned kHostNameTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 6; +static const unsigned kPSKIdentityTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 8; +static const unsigned kTicketLifetimeHintTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 9; +static const unsigned kTicketTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 10; +static const unsigned kPeerSHA256Tag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 13; +static const unsigned kOriginalHandshakeHashTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 14; +static const unsigned kSignedCertTimestampListTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 15; +static const unsigned kOCSPResponseTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 16; +static const unsigned kExtendedMasterSecretTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 17; +static const unsigned kGroupIDTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 18; +static const unsigned kCertChainTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 19; +static const unsigned kTicketAgeAddTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 21; +static const unsigned kIsServerTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 22; +static const unsigned kPeerSignatureAlgorithmTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 23; +static const unsigned kTicketMaxEarlyDataTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 24; +static const unsigned kAuthTimeoutTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 25; +static const unsigned kEarlyALPNTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 26; + +static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, + int for_ticket) { + if (in == NULL || in->cipher == NULL) { + return 0; + } + + CBB session, child, child2; + if (!CBB_add_asn1(cbb, &session, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&session, kVersion) || + !CBB_add_asn1_uint64(&session, in->ssl_version) || + !CBB_add_asn1(&session, &child, CBS_ASN1_OCTETSTRING) || + !CBB_add_u16(&child, (uint16_t)(in->cipher->id & 0xffff)) || + // The session ID is irrelevant for a session ticket. + !CBB_add_asn1_octet_string(&session, in->session_id, + for_ticket ? 0 : in->session_id_length) || + !CBB_add_asn1_octet_string(&session, in->master_key, + in->master_key_length) || + !CBB_add_asn1(&session, &child, kTimeTag) || + !CBB_add_asn1_uint64(&child, in->time) || + !CBB_add_asn1(&session, &child, kTimeoutTag) || + !CBB_add_asn1_uint64(&child, in->timeout)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The peer certificate is only serialized if the SHA-256 isn't + // serialized instead. + 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))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + // Although it is OPTIONAL and usually empty, OpenSSL has + // historically always encoded the sid_ctx. + if (!CBB_add_asn1(&session, &child, kSessionIDContextTag) || + !CBB_add_asn1_octet_string(&child, in->sid_ctx, in->sid_ctx_length)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->verify_result != X509_V_OK) { + if (!CBB_add_asn1(&session, &child, kVerifyResultTag) || + !CBB_add_asn1_uint64(&child, in->verify_result)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->psk_identity) { + if (!CBB_add_asn1(&session, &child, kPSKIdentityTag) || + !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->ticket_lifetime_hint > 0) { + if (!CBB_add_asn1(&session, &child, kTicketLifetimeHintTag) || + !CBB_add_asn1_uint64(&child, in->ticket_lifetime_hint)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (!in->ticket.empty() && !for_ticket) { + if (!CBB_add_asn1(&session, &child, kTicketTag) || + !CBB_add_asn1_octet_string(&child, in->ticket.data(), + in->ticket.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->peer_sha256_valid) { + if (!CBB_add_asn1(&session, &child, kPeerSHA256Tag) || + !CBB_add_asn1_octet_string(&child, in->peer_sha256, + sizeof(in->peer_sha256))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->original_handshake_hash_len > 0) { + if (!CBB_add_asn1(&session, &child, kOriginalHandshakeHashTag) || + !CBB_add_asn1_octet_string(&child, in->original_handshake_hash, + in->original_handshake_hash_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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.get()), + CRYPTO_BUFFER_len(in->signed_cert_timestamp_list.get()))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->ocsp_response != nullptr) { + if (!CBB_add_asn1(&session, &child, kOCSPResponseTag) || + !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; + } + } + + if (in->extended_master_secret) { + if (!CBB_add_asn1(&session, &child, kExtendedMasterSecretTag) || + !CBB_add_asn1_bool(&child, true)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->group_id > 0 && + (!CBB_add_asn1(&session, &child, kGroupIDTag) || + !CBB_add_asn1_uint64(&child, in->group_id))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The certificate chain is only serialized if the leaf's SHA-256 isn't + // serialized instead. + if (in->certs != NULL && + !in->peer_sha256_valid && + 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.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); + return 0; + } + } + } + + if (in->ticket_age_add_valid) { + if (!CBB_add_asn1(&session, &child, kTicketAgeAddTag) || + !CBB_add_asn1(&child, &child2, CBS_ASN1_OCTETSTRING) || + !CBB_add_u32(&child2, in->ticket_age_add)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (!in->is_server) { + if (!CBB_add_asn1(&session, &child, kIsServerTag) || + !CBB_add_asn1_bool(&child, false)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->peer_signature_algorithm != 0 && + (!CBB_add_asn1(&session, &child, kPeerSignatureAlgorithmTag) || + !CBB_add_asn1_uint64(&child, in->peer_signature_algorithm))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->ticket_max_early_data != 0 && + (!CBB_add_asn1(&session, &child, kTicketMaxEarlyDataTag) || + !CBB_add_asn1_uint64(&child, in->ticket_max_early_data))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->timeout != in->auth_timeout && + (!CBB_add_asn1(&session, &child, kAuthTimeoutTag) || + !CBB_add_asn1_uint64(&child, in->auth_timeout))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!in->early_alpn.empty()) { + if (!CBB_add_asn1(&session, &child, kEarlyALPNTag) || + !CBB_add_asn1_octet_string(&child, in->early_alpn.data(), + in->early_alpn.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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|. 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + if (present) { + if (CBS_contains_zero_byte(&value)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + char *raw = nullptr; + if (!CBS_strdup(&value, &raw)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + out->reset(raw); + } else { + out->reset(); + } + return 1; +} + +// 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 false; + } + return out->CopyFrom(value); +} + +static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, + UniquePtr *out, + unsigned tag, + CRYPTO_BUFFER_POOL *pool) { + if (!CBS_peek_asn1_tag(cbs, tag)) { + return 1; + } + + CBS child, value; + if (!CBS_get_asn1(cbs, &child, tag) || + !CBS_get_asn1(&child, &value, CBS_ASN1_OCTETSTRING) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + out->reset(CRYPTO_BUFFER_new_from_CBS(&value, pool)); + if (*out == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} + +// SSL_SESSION_parse_bounded_octet_string parses an optional ASN.1 OCTET STRING +// explicitly tagged with |tag| of size at most |max_out|. +static int SSL_SESSION_parse_bounded_octet_string( + CBS *cbs, uint8_t *out, uint8_t *out_len, uint8_t max_out, unsigned tag) { + CBS value; + if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag) || + CBS_len(&value) > max_out) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + OPENSSL_memcpy(out, CBS_data(&value), CBS_len(&value)); + *out_len = (uint8_t)CBS_len(&value); + return 1; +} + +static int SSL_SESSION_parse_long(CBS *cbs, long *out, unsigned tag, + long default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (long)value; + return 1; +} + +static int SSL_SESSION_parse_u32(CBS *cbs, uint32_t *out, unsigned tag, + uint32_t default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > 0xffffffff) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (uint32_t)value; + return 1; +} + +static int SSL_SESSION_parse_u16(CBS *cbs, uint16_t *out, unsigned tag, + uint16_t default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > 0xffff) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (uint16_t)value; + return 1; +} + +UniquePtr SSL_SESSION_parse(CBS *cbs, + const SSL_X509_METHOD *x509_method, + CRYPTO_BUFFER_POOL *pool) { + UniquePtr ret = ssl_session_new(x509_method); + if (!ret) { + return nullptr; + } + + CBS session; + uint64_t version, ssl_version; + uint16_t unused; + if (!CBS_get_asn1(cbs, &session, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&session, &version) || + version != kVersion || + !CBS_get_asn1_uint64(&session, &ssl_version) || + // Require sessions have versions valid in either TLS or DTLS. The session + // will not be used by the handshake if not applicable, but, for + // simplicity, never parse a session that does not pass + // |ssl_protocol_version_from_wire|. + ssl_version > UINT16_MAX || + !ssl_protocol_version_from_wire(&unused, ssl_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->ssl_version = ssl_version; + + CBS cipher; + uint16_t cipher_value; + if (!CBS_get_asn1(&session, &cipher, CBS_ASN1_OCTETSTRING) || + !CBS_get_u16(&cipher, &cipher_value) || + CBS_len(&cipher) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->cipher = SSL_get_cipher_by_value(cipher_value); + if (ret->cipher == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_CIPHER); + return nullptr; + } + + CBS session_id, master_key; + if (!CBS_get_asn1(&session, &session_id, CBS_ASN1_OCTETSTRING) || + CBS_len(&session_id) > SSL3_MAX_SSL_SESSION_ID_LENGTH || + !CBS_get_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING) || + CBS_len(&master_key) > SSL_MAX_MASTER_KEY_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + OPENSSL_memcpy(ret->session_id, CBS_data(&session_id), CBS_len(&session_id)); + ret->session_id_length = CBS_len(&session_id); + OPENSSL_memcpy(ret->master_key, CBS_data(&master_key), CBS_len(&master_key)); + ret->master_key_length = CBS_len(&master_key); + + CBS child; + uint64_t timeout; + if (!CBS_get_asn1(&session, &child, kTimeTag) || + !CBS_get_asn1_uint64(&child, &ret->time) || + !CBS_get_asn1(&session, &child, kTimeoutTag) || + !CBS_get_asn1_uint64(&child, &timeout) || + timeout > UINT32_MAX) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + ret->timeout = (uint32_t)timeout; + + CBS peer; + int has_peer; + if (!CBS_get_optional_asn1(&session, &peer, &has_peer, kPeerTag) || + (has_peer && CBS_len(&peer) == 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + // |peer| is processed with the certificate chain. + + if (!SSL_SESSION_parse_bounded_octet_string( + &session, ret->sid_ctx, &ret->sid_ctx_length, sizeof(ret->sid_ctx), + kSessionIDContextTag) || + !SSL_SESSION_parse_long(&session, &ret->verify_result, kVerifyResultTag, + X509_V_OK)) { + return nullptr; + } + + // Skip the historical hostName field. + CBS unused_hostname; + if (!CBS_get_optional_asn1(&session, &unused_hostname, nullptr, + kHostNameTag)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + if (!SSL_SESSION_parse_string(&session, &ret->psk_identity, + kPSKIdentityTag) || + !SSL_SESSION_parse_u32(&session, &ret->ticket_lifetime_hint, + kTicketLifetimeHintTag, 0) || + !SSL_SESSION_parse_octet_string(&session, &ret->ticket, kTicketTag)) { + return nullptr; + } + + if (CBS_peek_asn1_tag(&session, kPeerSHA256Tag)) { + CBS peer_sha256; + if (!CBS_get_asn1(&session, &child, kPeerSHA256Tag) || + !CBS_get_asn1(&child, &peer_sha256, CBS_ASN1_OCTETSTRING) || + CBS_len(&peer_sha256) != sizeof(ret->peer_sha256) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + OPENSSL_memcpy(ret->peer_sha256, CBS_data(&peer_sha256), + sizeof(ret->peer_sha256)); + ret->peer_sha256_valid = 1; + } else { + ret->peer_sha256_valid = 0; + } + + if (!SSL_SESSION_parse_bounded_octet_string( + &session, ret->original_handshake_hash, + &ret->original_handshake_hash_len, + sizeof(ret->original_handshake_hash), kOriginalHandshakeHashTag) || + !SSL_SESSION_parse_crypto_buffer(&session, + &ret->signed_cert_timestamp_list, + kSignedCertTimestampListTag, pool) || + !SSL_SESSION_parse_crypto_buffer(&session, &ret->ocsp_response, + kOCSPResponseTag, pool)) { + return nullptr; + } + + int extended_master_secret; + if (!CBS_get_optional_asn1_bool(&session, &extended_master_secret, + kExtendedMasterSecretTag, + 0 /* default to false */)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->extended_master_secret = !!extended_master_secret; + + if (!SSL_SESSION_parse_u16(&session, &ret->group_id, kGroupIDTag, 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + CBS cert_chain; + CBS_init(&cert_chain, NULL, 0); + int has_cert_chain; + if (!CBS_get_optional_asn1(&session, &cert_chain, &has_cert_chain, + kCertChainTag) || + (has_cert_chain && CBS_len(&cert_chain) == 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + if (has_cert_chain && !has_peer) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + if (has_peer || has_cert_chain) { + ret->certs.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->certs == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + if (has_peer) { + UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&peer, pool)); + if (!buffer || + !PushToStack(ret->certs.get(), std::move(buffer))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + while (CBS_len(&cert_chain) > 0) { + CBS cert; + if (!CBS_get_any_asn1_element(&cert_chain, &cert, NULL, NULL) || + CBS_len(&cert) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + 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; + } + } + } + + CBS age_add; + int age_add_present; + if (!CBS_get_optional_asn1_octet_string(&session, &age_add, &age_add_present, + kTicketAgeAddTag) || + (age_add_present && + !CBS_get_u32(&age_add, &ret->ticket_age_add)) || + CBS_len(&age_add) != 0) { + return nullptr; + } + ret->ticket_age_add_valid = age_add_present != 0; + + int is_server; + if (!CBS_get_optional_asn1_bool(&session, &is_server, kIsServerTag, + 1 /* default to true */)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + /* TODO: in time we can include |is_server| for servers too, then we can + enforce that client and server sessions are never mixed up. */ + + ret->is_server = is_server; + + if (!SSL_SESSION_parse_u16(&session, &ret->peer_signature_algorithm, + kPeerSignatureAlgorithmTag, 0) || + !SSL_SESSION_parse_u32(&session, &ret->ticket_max_early_data, + kTicketMaxEarlyDataTag, 0) || + !SSL_SESSION_parse_u32(&session, &ret->auth_timeout, kAuthTimeoutTag, + ret->timeout) || + !SSL_SESSION_parse_octet_string(&session, &ret->early_alpn, + 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; +} + +int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb) { + return SSL_SESSION_to_bytes_full(in, cbb, 0); +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_SESSION_to_bytes(const SSL_SESSION *in, uint8_t **out_data, + size_t *out_len) { + if (in->not_resumable) { + // If the caller has an unresumable session, e.g. if |SSL_get_session| were + // called on a TLS 1.3 or False Started connection, serialize with a + // placeholder value so it is not accidentally deserialized into a resumable + // one. + static const char kNotResumableSession[] = "NOT RESUMABLE"; + + *out_len = strlen(kNotResumableSession); + *out_data = (uint8_t *)OPENSSL_memdup(kNotResumableSession, *out_len); + if (*out_data == NULL) { + return 0; + } + + return 1; + } + + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 256) || + !SSL_SESSION_to_bytes_full(in, cbb.get(), 0) || + !CBB_finish(cbb.get(), out_data, out_len)) { + return 0; + } + + return 1; +} + +int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, uint8_t **out_data, + size_t *out_len) { + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 256) || + !SSL_SESSION_to_bytes_full(in, cbb.get(), 1) || + !CBB_finish(cbb.get(), out_data, out_len)) { + return 0; + } + + return 1; +} + +int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp) { + uint8_t *out; + size_t len; + + if (!SSL_SESSION_to_bytes(in, &out, &len)) { + return -1; + } + + if (len > INT_MAX) { + OPENSSL_free(out); + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return -1; + } + + if (pp) { + OPENSSL_memcpy(*pp, out, len); + *pp += len; + } + OPENSSL_free(out); + + return len; +} + +SSL_SESSION *SSL_SESSION_from_bytes(const uint8_t *in, size_t in_len, + const SSL_CTX *ctx) { + CBS cbs; + CBS_init(&cbs, in, in_len); + UniquePtr ret = + SSL_SESSION_parse(&cbs, ctx->x509_method, ctx->pool); + if (!ret) { + return NULL; + } + if (CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return NULL; + } + return ret.release(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back new file mode 100644 index 0000000..ea02cf4 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back @@ -0,0 +1,827 @@ +/* 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 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// An SSL_SESSION is serialized as the following ASN.1 structure: +// +// SSLSession ::= SEQUENCE { +// version INTEGER (1), -- session structure version +// sslVersion INTEGER, -- protocol version number +// cipher OCTET STRING, -- two bytes long +// sessionID OCTET STRING, +// masterKey OCTET STRING, +// time [1] INTEGER, -- seconds since UNIX epoch +// timeout [2] INTEGER, -- in seconds +// peer [3] Certificate OPTIONAL, +// sessionIDContext [4] OCTET STRING OPTIONAL, +// verifyResult [5] INTEGER OPTIONAL, -- one of X509_V_* codes +// pskIdentity [8] OCTET STRING OPTIONAL, +// ticketLifetimeHint [9] INTEGER OPTIONAL, -- client-only +// ticket [10] OCTET STRING OPTIONAL, -- client-only +// peerSHA256 [13] OCTET STRING OPTIONAL, +// originalHandshakeHash [14] OCTET STRING OPTIONAL, +// signedCertTimestampList [15] OCTET STRING OPTIONAL, +// -- contents of SCT extension +// ocspResponse [16] OCTET STRING OPTIONAL, +// -- stapled OCSP response from the server +// extendedMasterSecret [17] BOOLEAN OPTIONAL, +// groupID [18] INTEGER OPTIONAL, +// certChain [19] SEQUENCE OF Certificate OPTIONAL, +// ticketAgeAdd [21] OCTET STRING OPTIONAL, +// isServer [22] BOOLEAN DEFAULT TRUE, +// peerSignatureAlgorithm [23] INTEGER OPTIONAL, +// ticketMaxEarlyData [24] INTEGER OPTIONAL, +// authTimeout [25] INTEGER OPTIONAL, -- defaults to timeout +// earlyALPN [26] OCTET STRING OPTIONAL, +// } +// +// Note: historically this serialization has included other optional +// fields. Their presence is currently treated as a parse error, except for +// hostName, which is ignored. +// +// keyArg [0] IMPLICIT OCTET STRING OPTIONAL, +// hostName [6] OCTET STRING OPTIONAL, +// pskIdentityHint [7] OCTET STRING OPTIONAL, +// compressionMethod [11] OCTET STRING OPTIONAL, +// srpUsername [12] OCTET STRING OPTIONAL, +// ticketFlags [20] INTEGER OPTIONAL, + +static const unsigned kVersion = 1; + +static const unsigned kTimeTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1; +static const unsigned kTimeoutTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2; +static const unsigned kPeerTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3; +static const unsigned kSessionIDContextTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 4; +static const unsigned kVerifyResultTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 5; +static const unsigned kHostNameTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 6; +static const unsigned kPSKIdentityTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 8; +static const unsigned kTicketLifetimeHintTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 9; +static const unsigned kTicketTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 10; +static const unsigned kPeerSHA256Tag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 13; +static const unsigned kOriginalHandshakeHashTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 14; +static const unsigned kSignedCertTimestampListTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 15; +static const unsigned kOCSPResponseTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 16; +static const unsigned kExtendedMasterSecretTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 17; +static const unsigned kGroupIDTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 18; +static const unsigned kCertChainTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 19; +static const unsigned kTicketAgeAddTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 21; +static const unsigned kIsServerTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 22; +static const unsigned kPeerSignatureAlgorithmTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 23; +static const unsigned kTicketMaxEarlyDataTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 24; +static const unsigned kAuthTimeoutTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 25; +static const unsigned kEarlyALPNTag = + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 26; + +static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, + int for_ticket) { + if (in == NULL || in->cipher == NULL) { + return 0; + } + + CBB session, child, child2; + if (!CBB_add_asn1(cbb, &session, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&session, kVersion) || + !CBB_add_asn1_uint64(&session, in->ssl_version) || + !CBB_add_asn1(&session, &child, CBS_ASN1_OCTETSTRING) || + !CBB_add_u16(&child, (uint16_t)(in->cipher->id & 0xffff)) || + // The session ID is irrelevant for a session ticket. + !CBB_add_asn1_octet_string(&session, in->session_id, + for_ticket ? 0 : in->session_id_length) || + !CBB_add_asn1_octet_string(&session, in->master_key, + in->master_key_length) || + !CBB_add_asn1(&session, &child, kTimeTag) || + !CBB_add_asn1_uint64(&child, in->time) || + !CBB_add_asn1(&session, &child, kTimeoutTag) || + !CBB_add_asn1_uint64(&child, in->timeout)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The peer certificate is only serialized if the SHA-256 isn't + // serialized instead. + 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))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + // Although it is OPTIONAL and usually empty, OpenSSL has + // historically always encoded the sid_ctx. + if (!CBB_add_asn1(&session, &child, kSessionIDContextTag) || + !CBB_add_asn1_octet_string(&child, in->sid_ctx, in->sid_ctx_length)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->verify_result != X509_V_OK) { + if (!CBB_add_asn1(&session, &child, kVerifyResultTag) || + !CBB_add_asn1_uint64(&child, in->verify_result)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->psk_identity) { + if (!CBB_add_asn1(&session, &child, kPSKIdentityTag) || + !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->ticket_lifetime_hint > 0) { + if (!CBB_add_asn1(&session, &child, kTicketLifetimeHintTag) || + !CBB_add_asn1_uint64(&child, in->ticket_lifetime_hint)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (!in->ticket.empty() && !for_ticket) { + if (!CBB_add_asn1(&session, &child, kTicketTag) || + !CBB_add_asn1_octet_string(&child, in->ticket.data(), + in->ticket.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->peer_sha256_valid) { + if (!CBB_add_asn1(&session, &child, kPeerSHA256Tag) || + !CBB_add_asn1_octet_string(&child, in->peer_sha256, + sizeof(in->peer_sha256))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->original_handshake_hash_len > 0) { + if (!CBB_add_asn1(&session, &child, kOriginalHandshakeHashTag) || + !CBB_add_asn1_octet_string(&child, in->original_handshake_hash, + in->original_handshake_hash_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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.get()), + CRYPTO_BUFFER_len(in->signed_cert_timestamp_list.get()))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->ocsp_response != nullptr) { + if (!CBB_add_asn1(&session, &child, kOCSPResponseTag) || + !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; + } + } + + if (in->extended_master_secret) { + if (!CBB_add_asn1(&session, &child, kExtendedMasterSecretTag) || + !CBB_add_asn1_bool(&child, true)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->group_id > 0 && + (!CBB_add_asn1(&session, &child, kGroupIDTag) || + !CBB_add_asn1_uint64(&child, in->group_id))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The certificate chain is only serialized if the leaf's SHA-256 isn't + // serialized instead. + if (in->certs != NULL && + !in->peer_sha256_valid && + 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.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); + return 0; + } + } + } + + if (in->ticket_age_add_valid) { + if (!CBB_add_asn1(&session, &child, kTicketAgeAddTag) || + !CBB_add_asn1(&child, &child2, CBS_ASN1_OCTETSTRING) || + !CBB_add_u32(&child2, in->ticket_age_add)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (!in->is_server) { + if (!CBB_add_asn1(&session, &child, kIsServerTag) || + !CBB_add_asn1_bool(&child, false)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + if (in->peer_signature_algorithm != 0 && + (!CBB_add_asn1(&session, &child, kPeerSignatureAlgorithmTag) || + !CBB_add_asn1_uint64(&child, in->peer_signature_algorithm))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->ticket_max_early_data != 0 && + (!CBB_add_asn1(&session, &child, kTicketMaxEarlyDataTag) || + !CBB_add_asn1_uint64(&child, in->ticket_max_early_data))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (in->timeout != in->auth_timeout && + (!CBB_add_asn1(&session, &child, kAuthTimeoutTag) || + !CBB_add_asn1_uint64(&child, in->auth_timeout))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!in->early_alpn.empty()) { + if (!CBB_add_asn1(&session, &child, kEarlyALPNTag) || + !CBB_add_asn1_octet_string(&child, in->early_alpn.data(), + in->early_alpn.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + } + + 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|. 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + if (present) { + if (CBS_contains_zero_byte(&value)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + char *raw = nullptr; + if (!CBS_strdup(&value, &raw)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + out->reset(raw); + } else { + out->reset(); + } + return 1; +} + +// 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 false; + } + return out->CopyFrom(value); +} + +static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, + UniquePtr *out, + unsigned tag, + CRYPTO_BUFFER_POOL *pool) { + if (!CBS_peek_asn1_tag(cbs, tag)) { + return 1; + } + + CBS child, value; + if (!CBS_get_asn1(cbs, &child, tag) || + !CBS_get_asn1(&child, &value, CBS_ASN1_OCTETSTRING) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + out->reset(CRYPTO_BUFFER_new_from_CBS(&value, pool)); + if (*out == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} + +// SSL_SESSION_parse_bounded_octet_string parses an optional ASN.1 OCTET STRING +// explicitly tagged with |tag| of size at most |max_out|. +static int SSL_SESSION_parse_bounded_octet_string( + CBS *cbs, uint8_t *out, uint8_t *out_len, uint8_t max_out, unsigned tag) { + CBS value; + if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag) || + CBS_len(&value) > max_out) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + OPENSSL_memcpy(out, CBS_data(&value), CBS_len(&value)); + *out_len = (uint8_t)CBS_len(&value); + return 1; +} + +static int SSL_SESSION_parse_long(CBS *cbs, long *out, unsigned tag, + long default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (long)value; + return 1; +} + +static int SSL_SESSION_parse_u32(CBS *cbs, uint32_t *out, unsigned tag, + uint32_t default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > 0xffffffff) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (uint32_t)value; + return 1; +} + +static int SSL_SESSION_parse_u16(CBS *cbs, uint16_t *out, unsigned tag, + uint16_t default_value) { + uint64_t value; + if (!CBS_get_optional_asn1_uint64(cbs, &value, tag, + (uint64_t)default_value) || + value > 0xffff) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return 0; + } + *out = (uint16_t)value; + return 1; +} + +UniquePtr SSL_SESSION_parse(CBS *cbs, + const SSL_X509_METHOD *x509_method, + CRYPTO_BUFFER_POOL *pool) { + UniquePtr ret = ssl_session_new(x509_method); + if (!ret) { + return nullptr; + } + + CBS session; + uint64_t version, ssl_version; + uint16_t unused; + if (!CBS_get_asn1(cbs, &session, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&session, &version) || + version != kVersion || + !CBS_get_asn1_uint64(&session, &ssl_version) || + // Require sessions have versions valid in either TLS or DTLS. The session + // will not be used by the handshake if not applicable, but, for + // simplicity, never parse a session that does not pass + // |ssl_protocol_version_from_wire|. + ssl_version > UINT16_MAX || + !ssl_protocol_version_from_wire(&unused, ssl_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->ssl_version = ssl_version; + + CBS cipher; + uint16_t cipher_value; + if (!CBS_get_asn1(&session, &cipher, CBS_ASN1_OCTETSTRING) || + !CBS_get_u16(&cipher, &cipher_value) || + CBS_len(&cipher) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->cipher = SSL_get_cipher_by_value(cipher_value); + if (ret->cipher == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_CIPHER); + return nullptr; + } + + CBS session_id, master_key; + if (!CBS_get_asn1(&session, &session_id, CBS_ASN1_OCTETSTRING) || + CBS_len(&session_id) > SSL3_MAX_SSL_SESSION_ID_LENGTH || + !CBS_get_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING) || + CBS_len(&master_key) > SSL_MAX_MASTER_KEY_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + OPENSSL_memcpy(ret->session_id, CBS_data(&session_id), CBS_len(&session_id)); + ret->session_id_length = CBS_len(&session_id); + OPENSSL_memcpy(ret->master_key, CBS_data(&master_key), CBS_len(&master_key)); + ret->master_key_length = CBS_len(&master_key); + + CBS child; + uint64_t timeout; + if (!CBS_get_asn1(&session, &child, kTimeTag) || + !CBS_get_asn1_uint64(&child, &ret->time) || + !CBS_get_asn1(&session, &child, kTimeoutTag) || + !CBS_get_asn1_uint64(&child, &timeout) || + timeout > UINT32_MAX) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + ret->timeout = (uint32_t)timeout; + + CBS peer; + int has_peer; + if (!CBS_get_optional_asn1(&session, &peer, &has_peer, kPeerTag) || + (has_peer && CBS_len(&peer) == 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + // |peer| is processed with the certificate chain. + + if (!SSL_SESSION_parse_bounded_octet_string( + &session, ret->sid_ctx, &ret->sid_ctx_length, sizeof(ret->sid_ctx), + kSessionIDContextTag) || + !SSL_SESSION_parse_long(&session, &ret->verify_result, kVerifyResultTag, + X509_V_OK)) { + return nullptr; + } + + // Skip the historical hostName field. + CBS unused_hostname; + if (!CBS_get_optional_asn1(&session, &unused_hostname, nullptr, + kHostNameTag)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + if (!SSL_SESSION_parse_string(&session, &ret->psk_identity, + kPSKIdentityTag) || + !SSL_SESSION_parse_u32(&session, &ret->ticket_lifetime_hint, + kTicketLifetimeHintTag, 0) || + !SSL_SESSION_parse_octet_string(&session, &ret->ticket, kTicketTag)) { + return nullptr; + } + + if (CBS_peek_asn1_tag(&session, kPeerSHA256Tag)) { + CBS peer_sha256; + if (!CBS_get_asn1(&session, &child, kPeerSHA256Tag) || + !CBS_get_asn1(&child, &peer_sha256, CBS_ASN1_OCTETSTRING) || + CBS_len(&peer_sha256) != sizeof(ret->peer_sha256) || + CBS_len(&child) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + OPENSSL_memcpy(ret->peer_sha256, CBS_data(&peer_sha256), + sizeof(ret->peer_sha256)); + ret->peer_sha256_valid = 1; + } else { + ret->peer_sha256_valid = 0; + } + + if (!SSL_SESSION_parse_bounded_octet_string( + &session, ret->original_handshake_hash, + &ret->original_handshake_hash_len, + sizeof(ret->original_handshake_hash), kOriginalHandshakeHashTag) || + !SSL_SESSION_parse_crypto_buffer(&session, + &ret->signed_cert_timestamp_list, + kSignedCertTimestampListTag, pool) || + !SSL_SESSION_parse_crypto_buffer(&session, &ret->ocsp_response, + kOCSPResponseTag, pool)) { + return nullptr; + } + + int extended_master_secret; + if (!CBS_get_optional_asn1_bool(&session, &extended_master_secret, + kExtendedMasterSecretTag, + 0 /* default to false */)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + ret->extended_master_secret = !!extended_master_secret; + + if (!SSL_SESSION_parse_u16(&session, &ret->group_id, kGroupIDTag, 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + CBS cert_chain; + CBS_init(&cert_chain, NULL, 0); + int has_cert_chain; + if (!CBS_get_optional_asn1(&session, &cert_chain, &has_cert_chain, + kCertChainTag) || + (has_cert_chain && CBS_len(&cert_chain) == 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + if (has_cert_chain && !has_peer) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + if (has_peer || has_cert_chain) { + ret->certs.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->certs == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + if (has_peer) { + UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&peer, pool)); + if (!buffer || + !PushToStack(ret->certs.get(), std::move(buffer))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + while (CBS_len(&cert_chain) > 0) { + CBS cert; + if (!CBS_get_any_asn1_element(&cert_chain, &cert, NULL, NULL) || + CBS_len(&cert) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + + 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; + } + } + } + + CBS age_add; + int age_add_present; + if (!CBS_get_optional_asn1_octet_string(&session, &age_add, &age_add_present, + kTicketAgeAddTag) || + (age_add_present && + !CBS_get_u32(&age_add, &ret->ticket_age_add)) || + CBS_len(&age_add) != 0) { + return nullptr; + } + ret->ticket_age_add_valid = age_add_present != 0; + + int is_server; + if (!CBS_get_optional_asn1_bool(&session, &is_server, kIsServerTag, + 1 /* default to true */)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + /* TODO: in time we can include |is_server| for servers too, then we can + enforce that client and server sessions are never mixed up. */ + + ret->is_server = is_server; + + if (!SSL_SESSION_parse_u16(&session, &ret->peer_signature_algorithm, + kPeerSignatureAlgorithmTag, 0) || + !SSL_SESSION_parse_u32(&session, &ret->ticket_max_early_data, + kTicketMaxEarlyDataTag, 0) || + !SSL_SESSION_parse_u32(&session, &ret->auth_timeout, kAuthTimeoutTag, + ret->timeout) || + !SSL_SESSION_parse_octet_string(&session, &ret->early_alpn, + 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; +} + +int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb) { + return SSL_SESSION_to_bytes_full(in, cbb, 0); +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_SESSION_to_bytes(const SSL_SESSION *in, uint8_t **out_data, + size_t *out_len) { + if (in->not_resumable) { + // If the caller has an unresumable session, e.g. if |SSL_get_session| were + // called on a TLS 1.3 or False Started connection, serialize with a + // placeholder value so it is not accidentally deserialized into a resumable + // one. + static const char kNotResumableSession[] = "NOT RESUMABLE"; + + *out_len = strlen(kNotResumableSession); + *out_data = (uint8_t *)OPENSSL_memdup(kNotResumableSession, *out_len); + if (*out_data == NULL) { + return 0; + } + + return 1; + } + + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 256) || + !SSL_SESSION_to_bytes_full(in, cbb.get(), 0) || + !CBB_finish(cbb.get(), out_data, out_len)) { + return 0; + } + + return 1; +} + +int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, uint8_t **out_data, + size_t *out_len) { + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 256) || + !SSL_SESSION_to_bytes_full(in, cbb.get(), 1) || + !CBB_finish(cbb.get(), out_data, out_len)) { + return 0; + } + + return 1; +} + +int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp) { + uint8_t *out; + size_t len; + + if (!SSL_SESSION_to_bytes(in, &out, &len)) { + return -1; + } + + if (len > INT_MAX) { + OPENSSL_free(out); + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return -1; + } + + if (pp) { + OPENSSL_memcpy(*pp, out, len); + *pp += len; + } + OPENSSL_free(out); + + return len; +} + +SSL_SESSION *SSL_SESSION_from_bytes(const uint8_t *in, size_t in_len, + const SSL_CTX *ctx) { + CBS cbs; + CBS_init(&cbs, in, in_len); + UniquePtr ret = + SSL_SESSION_parse(&cbs, ctx->x509_method, ctx->pool); + if (!ret) { + return NULL; + } + if (CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return NULL; + } + return ret.release(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc new file mode 100644 index 0000000..bff1dfa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc @@ -0,0 +1,306 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// BIO uses int instead of size_t. No lengths will exceed uint16_t, so this will +// not overflow. +static_assert(0xffff <= INT_MAX, "uint16_t does not fit in int"); + +static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0, + "SSL3_ALIGN_PAYLOAD must be a power of 2"); + +void SSLBuffer::Clear() { + if (buf_allocated_) { + free(buf_); // Allocated with malloc(). + } + buf_ = nullptr; + buf_allocated_ = false; + offset_ = 0; + size_ = 0; + cap_ = 0; +} + +bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { + if (new_cap > 0xffff) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (cap_ >= new_cap) { + return true; + } + + 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); + } + + // 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_allocated_) { + free(buf_); // Allocated with malloc(). + } + + buf_ = new_buf; + buf_allocated_ = new_buf_allocated; + offset_ = new_offset; + cap_ = new_cap; + return true; +} + +void SSLBuffer::DidWrite(size_t new_size) { + if (new_size > cap() - size()) { + abort(); + } + size_ += new_size; +} + +void SSLBuffer::Consume(size_t len) { + if (len > size_) { + abort(); + } + offset_ += (uint16_t)len; + size_ -= (uint16_t)len; + cap_ -= (uint16_t)len; +} + +void SSLBuffer::DiscardConsumed() { + if (size_ == 0) { + Clear(); + } +} + +static int dtls_read_buffer_next_packet(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->read_buffer; + + if (!buf->empty()) { + // It is an error to call |dtls_read_buffer_extend| when the read buffer is + // not empty. + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + // Read a single packet from |ssl->rbio|. |buf->cap()| must fit in an int. + int ret = + BIO_read(ssl->rbio.get(), buf->data(), static_cast(buf->cap())); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return ret; + } + buf->DidWrite(static_cast(ret)); + return 1; +} + +static int tls_read_buffer_extend_to(SSL *ssl, size_t len) { + SSLBuffer *buf = &ssl->s3->read_buffer; + + if (len > buf->cap()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return -1; + } + + // Read until the target length is reached. + 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.get(), buf->data() + buf->size(), + static_cast(len - buf->size())); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return ret; + } + buf->DidWrite(static_cast(ret)); + } + + return 1; +} + +int ssl_read_buffer_extend_to(SSL *ssl, size_t len) { + // |ssl_read_buffer_extend_to| implicitly discards any consumed data. + ssl->s3->read_buffer.DiscardConsumed(); + + if (SSL_is_dtls(ssl)) { + static_assert( + DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH <= 0xffff, + "DTLS read buffer is too large"); + + // The |len| parameter is ignored in DTLS. + len = DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; + } + + if (!ssl->s3->read_buffer.EnsureCap(ssl_record_prefix_len(ssl), len)) { + return -1; + } + + if (ssl->rbio == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); + return -1; + } + + int ret; + if (SSL_is_dtls(ssl)) { + // |len| is ignored for a datagram transport. + ret = dtls_read_buffer_next_packet(ssl); + } else { + ret = tls_read_buffer_extend_to(ssl, len); + } + + if (ret <= 0) { + // If the buffer was empty originally and remained empty after attempting to + // extend it, release the buffer until the next attempt. + ssl->s3->read_buffer.DiscardConsumed(); + } + return ret; +} + +int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, + size_t consumed, uint8_t alert) { + *out_retry = false; + if (ret != ssl_open_record_partial) { + ssl->s3->read_buffer.Consume(consumed); + } + if (ret != ssl_open_record_success) { + // Nothing was returned to the caller, so discard anything marked consumed. + ssl->s3->read_buffer.DiscardConsumed(); + } + switch (ret) { + case ssl_open_record_success: + return 1; + + case ssl_open_record_partial: { + int read_ret = ssl_read_buffer_extend_to(ssl, consumed); + if (read_ret <= 0) { + return read_ret; + } + *out_retry = true; + return 1; + } + + case ssl_open_record_discard: + *out_retry = true; + return 1; + + case ssl_open_record_close_notify: + return 0; + + case ssl_open_record_error: + if (alert != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + } + return -1; + } + assert(0); + return -1; +} + + +static_assert(SSL3_RT_HEADER_LENGTH * 2 + + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD * 2 + + SSL3_RT_MAX_PLAIN_LENGTH <= + 0xffff, + "maximum TLS write buffer is too large"); + +static_assert(DTLS1_RT_HEADER_LENGTH + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + + SSL3_RT_MAX_PLAIN_LENGTH <= + 0xffff, + "maximum DTLS write buffer is too large"); + +static int tls_write_buffer_flush(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->write_buffer; + + while (!buf->empty()) { + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return ret; + } + buf->Consume(static_cast(ret)); + } + buf->Clear(); + return 1; +} + +static int dtls_write_buffer_flush(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->write_buffer; + if (buf->empty()) { + return 1; + } + + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); + if (ret <= 0) { + 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. + buf->Clear(); + return ret; + } + buf->Clear(); + return 1; +} + +int ssl_write_buffer_flush(SSL *ssl) { + if (ssl->wbio == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); + return -1; + } + + if (SSL_is_dtls(ssl)) { + return dtls_write_buffer_flush(ssl); + } else { + return tls_write_buffer_flush(ssl); + } +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back new file mode 100644 index 0000000..d73055f --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back @@ -0,0 +1,306 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// BIO uses int instead of size_t. No lengths will exceed uint16_t, so this will +// not overflow. +static_assert(0xffff <= INT_MAX, "uint16_t does not fit in int"); + +static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0, + "SSL3_ALIGN_PAYLOAD must be a power of 2"); + +void SSLBuffer::Clear() { + if (buf_allocated_) { + free(buf_); // Allocated with malloc(). + } + buf_ = nullptr; + buf_allocated_ = false; + offset_ = 0; + size_ = 0; + cap_ = 0; +} + +bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { + if (new_cap > 0xffff) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (cap_ >= new_cap) { + return true; + } + + 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); + } + + // 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_allocated_) { + free(buf_); // Allocated with malloc(). + } + + buf_ = new_buf; + buf_allocated_ = new_buf_allocated; + offset_ = new_offset; + cap_ = new_cap; + return true; +} + +void SSLBuffer::DidWrite(size_t new_size) { + if (new_size > cap() - size()) { + abort(); + } + size_ += new_size; +} + +void SSLBuffer::Consume(size_t len) { + if (len > size_) { + abort(); + } + offset_ += (uint16_t)len; + size_ -= (uint16_t)len; + cap_ -= (uint16_t)len; +} + +void SSLBuffer::DiscardConsumed() { + if (size_ == 0) { + Clear(); + } +} + +static int dtls_read_buffer_next_packet(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->read_buffer; + + if (!buf->empty()) { + // It is an error to call |dtls_read_buffer_extend| when the read buffer is + // not empty. + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return -1; + } + + // Read a single packet from |ssl->rbio|. |buf->cap()| must fit in an int. + int ret = + BIO_read(ssl->rbio.get(), buf->data(), static_cast(buf->cap())); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return ret; + } + buf->DidWrite(static_cast(ret)); + return 1; +} + +static int tls_read_buffer_extend_to(SSL *ssl, size_t len) { + SSLBuffer *buf = &ssl->s3->read_buffer; + + if (len > buf->cap()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return -1; + } + + // Read until the target length is reached. + 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.get(), buf->data() + buf->size(), + static_cast(len - buf->size())); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return ret; + } + buf->DidWrite(static_cast(ret)); + } + + return 1; +} + +int ssl_read_buffer_extend_to(SSL *ssl, size_t len) { + // |ssl_read_buffer_extend_to| implicitly discards any consumed data. + ssl->s3->read_buffer.DiscardConsumed(); + + if (SSL_is_dtls(ssl)) { + static_assert( + DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH <= 0xffff, + "DTLS read buffer is too large"); + + // The |len| parameter is ignored in DTLS. + len = DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH; + } + + if (!ssl->s3->read_buffer.EnsureCap(ssl_record_prefix_len(ssl), len)) { + return -1; + } + + if (ssl->rbio == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); + return -1; + } + + int ret; + if (SSL_is_dtls(ssl)) { + // |len| is ignored for a datagram transport. + ret = dtls_read_buffer_next_packet(ssl); + } else { + ret = tls_read_buffer_extend_to(ssl, len); + } + + if (ret <= 0) { + // If the buffer was empty originally and remained empty after attempting to + // extend it, release the buffer until the next attempt. + ssl->s3->read_buffer.DiscardConsumed(); + } + return ret; +} + +int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, + size_t consumed, uint8_t alert) { + *out_retry = false; + if (ret != ssl_open_record_partial) { + ssl->s3->read_buffer.Consume(consumed); + } + if (ret != ssl_open_record_success) { + // Nothing was returned to the caller, so discard anything marked consumed. + ssl->s3->read_buffer.DiscardConsumed(); + } + switch (ret) { + case ssl_open_record_success: + return 1; + + case ssl_open_record_partial: { + int read_ret = ssl_read_buffer_extend_to(ssl, consumed); + if (read_ret <= 0) { + return read_ret; + } + *out_retry = true; + return 1; + } + + case ssl_open_record_discard: + *out_retry = true; + return 1; + + case ssl_open_record_close_notify: + return 0; + + case ssl_open_record_error: + if (alert != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + } + return -1; + } + assert(0); + return -1; +} + + +static_assert(SSL3_RT_HEADER_LENGTH * 2 + + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD * 2 + + SSL3_RT_MAX_PLAIN_LENGTH <= + 0xffff, + "maximum TLS write buffer is too large"); + +static_assert(DTLS1_RT_HEADER_LENGTH + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + + SSL3_RT_MAX_PLAIN_LENGTH <= + 0xffff, + "maximum DTLS write buffer is too large"); + +static int tls_write_buffer_flush(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->write_buffer; + + while (!buf->empty()) { + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); + if (ret <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; + return ret; + } + buf->Consume(static_cast(ret)); + } + buf->Clear(); + return 1; +} + +static int dtls_write_buffer_flush(SSL *ssl) { + SSLBuffer *buf = &ssl->s3->write_buffer; + if (buf->empty()) { + return 1; + } + + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); + if (ret <= 0) { + 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. + buf->Clear(); + return ret; + } + buf->Clear(); + return 1; +} + +int ssl_write_buffer_flush(SSL *ssl) { + if (ssl->wbio == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); + return -1; + } + + if (SSL_is_dtls(ssl)) { + return dtls_write_buffer_flush(ssl); + } else { + return tls_write_buffer_flush(ssl); + } +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc new file mode 100644 index 0000000..6c9ae50 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc.grpc_back new file mode 100644 index 0000000..4f80382 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc new file mode 100644 index 0000000..46f328e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc @@ -0,0 +1,1718 @@ +/* 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 "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +static constexpr SSL_CIPHER kCiphers[] = { + // The RSA ciphers + // Cipher 02 + { + SSL3_TXT_RSA_NULL_SHA, + "TLS_RSA_WITH_NULL_SHA", + SSL3_CK_RSA_NULL_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_eNULL, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 0A + { + SSL3_TXT_RSA_DES_192_CBC3_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + SSL3_CK_RSA_DES_192_CBC3_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_3DES, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + + // New AES ciphersuites + + // Cipher 2F + { + TLS1_TXT_RSA_WITH_AES_128_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA", + TLS1_CK_RSA_WITH_AES_128_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 35 + { + TLS1_TXT_RSA_WITH_AES_256_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA", + TLS1_CK_RSA_WITH_AES_256_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // PSK cipher suites. + + // Cipher 8C + { + TLS1_TXT_PSK_WITH_AES_128_CBC_SHA, + "TLS_PSK_WITH_AES_128_CBC_SHA", + TLS1_CK_PSK_WITH_AES_128_CBC_SHA, + SSL_kPSK, + SSL_aPSK, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 8D + { + TLS1_TXT_PSK_WITH_AES_256_CBC_SHA, + "TLS_PSK_WITH_AES_256_CBC_SHA", + TLS1_CK_PSK_WITH_AES_256_CBC_SHA, + SSL_kPSK, + SSL_aPSK, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // GCM ciphersuites from RFC5288 + + // Cipher 9C + { + TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_RSA_WITH_AES_128_GCM_SHA256, + SSL_kRSA, + SSL_aRSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher 9D + { + TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384, + "TLS_RSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_RSA_WITH_AES_256_GCM_SHA384, + SSL_kRSA, + SSL_aRSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // TLS 1.3 suites. + + // Cipher 1301 + { + TLS1_TXT_AES_128_GCM_SHA256, + "TLS_AES_128_GCM_SHA256", + TLS1_CK_AES_128_GCM_SHA256, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher 1302 + { + TLS1_TXT_AES_256_GCM_SHA384, + "TLS_AES_256_GCM_SHA384", + TLS1_CK_AES_256_GCM_SHA384, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // Cipher 1303 + { + TLS1_TXT_CHACHA20_POLY1305_SHA256, + "TLS_CHACHA20_POLY1305_SHA256", + TLS1_CK_CHACHA20_POLY1305_SHA256, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C009 + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C00A + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C013 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aRSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C014 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aRSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // GCM based TLS v1.2 ciphersuites from RFC5289 + + // Cipher C02B + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C02C + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // Cipher C02F + { + TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + SSL_kECDHE, + SSL_aRSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C030 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + SSL_kECDHE, + SSL_aRSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // ECDHE-PSK cipher suites. + + // Cipher C035 + { + TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aPSK, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C036 + { + TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aPSK, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // ChaCha20-Poly1305 cipher suites. + + // Cipher CCA8 + { + TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aRSA, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher CCA9 + { + TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aECDSA, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher CCAB + { + TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aPSK, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + +}; + +Span AllCiphers() { + return MakeConstSpan(kCiphers, OPENSSL_ARRAY_SIZE(kCiphers)); +} + +#define CIPHER_ADD 1 +#define CIPHER_KILL 2 +#define CIPHER_DEL 3 +#define CIPHER_ORD 4 +#define CIPHER_SPECIAL 5 + +typedef struct cipher_order_st { + const SSL_CIPHER *cipher; + bool active; + bool in_group; + struct cipher_order_st *next, *prev; +} CIPHER_ORDER; + +typedef struct cipher_alias_st { + // name is the name of the cipher alias. + const char *name; + + // The following fields are bitmasks for the corresponding fields on + // |SSL_CIPHER|. A cipher matches a cipher alias iff, for each bitmask, the + // bit corresponding to the cipher's value is set to 1. If any bitmask is + // all zeroes, the alias matches nothing. Use |~0u| for the default value. + uint32_t algorithm_mkey; + uint32_t algorithm_auth; + uint32_t algorithm_enc; + uint32_t algorithm_mac; + + // min_version, if non-zero, matches all ciphers which were added in that + // particular protocol version. + uint16_t min_version; +} CIPHER_ALIAS; + +static const CIPHER_ALIAS kCipherAliases[] = { + // "ALL" doesn't include eNULL. It must be explicitly enabled. + {"ALL", ~0u, ~0u, ~0u, ~0u, 0}, + + // The "COMPLEMENTOFDEFAULT" rule is omitted. It matches nothing. + + // key exchange aliases + // (some of those using only a single bit here combine + // multiple key exchange algs according to the RFCs. + {"kRSA", SSL_kRSA, ~0u, ~0u, ~0u, 0}, + + {"kECDHE", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"kEECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"ECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + + {"kPSK", SSL_kPSK, ~0u, ~0u, ~0u, 0}, + + // server authentication aliases + {"aRSA", ~0u, SSL_aRSA, ~0u, ~0u, 0}, + {"aECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0}, + {"ECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0}, + {"aPSK", ~0u, SSL_aPSK, ~0u, ~0u, 0}, + + // aliases combining key exchange and server authentication + {"ECDHE", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"EECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"RSA", SSL_kRSA, SSL_aRSA, ~0u, ~0u, 0}, + {"PSK", SSL_kPSK, SSL_aPSK, ~0u, ~0u, 0}, + + // symmetric encryption aliases + {"3DES", ~0u, ~0u, SSL_3DES, ~0u, 0}, + {"AES128", ~0u, ~0u, SSL_AES128 | SSL_AES128GCM, ~0u, 0}, + {"AES256", ~0u, ~0u, SSL_AES256 | SSL_AES256GCM, ~0u, 0}, + {"AES", ~0u, ~0u, SSL_AES, ~0u, 0}, + {"AESGCM", ~0u, ~0u, SSL_AES128GCM | SSL_AES256GCM, ~0u, 0}, + {"CHACHA20", ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0}, + + // MAC aliases + {"SHA1", ~0u, ~0u, ~0u, SSL_SHA1, 0}, + {"SHA", ~0u, ~0u, ~0u, SSL_SHA1, 0}, + + // Legacy protocol minimum version aliases. "TLSv1" is intentionally the + // same as "SSLv3". + {"SSLv3", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION}, + {"TLSv1", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION}, + {"TLSv1.2", ~0u, ~0u, ~0u, ~0u, TLS1_2_VERSION}, + + // 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); + +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) { + *out_aead = NULL; + *out_mac_secret_len = 0; + *out_fixed_iv_len = 0; + + 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) { + 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) { + 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(); + *out_fixed_iv_len = 12; + } else { + return false; + } + + // In TLS 1.3, the iv_len is equal to the AEAD nonce length whereas the code + // above computes the TLS 1.2 construction. + if (version >= TLS1_3_VERSION) { + *out_fixed_iv_len = EVP_AEAD_nonce_length(*out_aead); + } + } else if (cipher->algorithm_mac == SSL_SHA1) { + if (cipher->algorithm_enc == SSL_eNULL) { + *out_aead = EVP_aead_null_sha1_tls(); + } else if (cipher->algorithm_enc == SSL_3DES) { + 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 == 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 == TLS1_VERSION) { + *out_aead = EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(); + *out_fixed_iv_len = 16; + } else { + *out_aead = EVP_aead_aes_256_cbc_sha1_tls(); + } + } else { + return false; + } + + *out_mac_secret_len = SHA_DIGEST_LENGTH; + } else { + return false; + } + + return true; +} + +const EVP_MD *ssl_get_handshake_digest(uint16_t version, + const SSL_CIPHER *cipher) { + switch (cipher->algorithm_prf) { + case SSL_HANDSHAKE_MAC_DEFAULT: + return version >= TLS1_2_VERSION ? EVP_sha256() : EVP_md5_sha1(); + case SSL_HANDSHAKE_MAC_SHA256: + return EVP_sha256(); + case SSL_HANDSHAKE_MAC_SHA384: + return EVP_sha384(); + default: + assert(0); + return NULL; + } +} + +static bool is_cipher_list_separator(char c, bool is_strict) { + if (c == ':') { + return true; + } + return !is_strict && (c == ' ' || c == ';' || c == ','); +} + +// rule_equals returns whether the NUL-terminated string |rule| is equal to the +// |buf_len| bytes at |buf|. +static bool rule_equals(const char *rule, const char *buf, size_t buf_len) { + // |strncmp| alone only checks that |buf| is a prefix of |rule|. + return strncmp(rule, buf, buf_len) == 0 && rule[buf_len] == '\0'; +} + +static void ll_append_tail(CIPHER_ORDER **head, CIPHER_ORDER *curr, + CIPHER_ORDER **tail) { + if (curr == *tail) { + return; + } + if (curr == *head) { + *head = curr->next; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + (*tail)->next = curr; + curr->prev = *tail; + curr->next = NULL; + *tail = curr; +} + +static void ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr, + CIPHER_ORDER **tail) { + if (curr == *head) { + return; + } + if (curr == *tail) { + *tail = curr->prev; + } + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + (*head)->prev = curr; + curr->next = *head; + curr->prev = NULL; + *head = curr; +} + +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. + if (cipher.algorithm_mkey != SSL_kGENERIC) { + co_list[co_list_num].cipher = &cipher; + co_list[co_list_num].next = NULL; + co_list[co_list_num].prev = NULL; + co_list[co_list_num].active = false; + co_list[co_list_num].in_group = false; + co_list_num++; + } + } + + // Prepare linked list from list entries. + if (co_list_num > 0) { + co_list[0].prev = NULL; + + if (co_list_num > 1) { + co_list[0].next = &co_list[1]; + + for (size_t i = 1; i < co_list_num - 1; i++) { + co_list[i].prev = &co_list[i - 1]; + co_list[i].next = &co_list[i + 1]; + } + + co_list[co_list_num - 1].prev = &co_list[co_list_num - 2]; + } + + co_list[co_list_num - 1].next = NULL; + + *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 +// parameters in the linked list from |*head_p| to |*tail_p|. It writes the new +// head and tail of the list to |*head_p| and |*tail_p|, respectively. +// +// - If |cipher_id| is non-zero, only that cipher is selected. +// - Otherwise, if |strength_bits| is non-negative, it selects ciphers +// of that strength. +// - Otherwise, it selects ciphers that match each bitmasks in |alg_*| and +// |min_version|. +static void ssl_cipher_apply_rule( + uint32_t cipher_id, uint32_t alg_mkey, uint32_t alg_auth, + uint32_t alg_enc, uint32_t alg_mac, uint16_t min_version, int rule, + int strength_bits, bool in_group, CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p) { + CIPHER_ORDER *head, *tail, *curr, *next, *last; + const SSL_CIPHER *cp; + bool reverse = false; + + if (cipher_id == 0 && strength_bits == -1 && min_version == 0 && + (alg_mkey == 0 || alg_auth == 0 || alg_enc == 0 || alg_mac == 0)) { + // The rule matches nothing, so bail early. + return; + } + + if (rule == CIPHER_DEL) { + // needed to maintain sorting between currently deleted ciphers + reverse = true; + } + + head = *head_p; + tail = *tail_p; + + if (reverse) { + next = tail; + last = head; + } else { + next = head; + last = tail; + } + + curr = NULL; + for (;;) { + if (curr == last) { + break; + } + + curr = next; + if (curr == NULL) { + break; + } + + next = reverse ? curr->prev : curr->next; + cp = curr->cipher; + + // Selection criteria is either a specific cipher, the value of + // |strength_bits|, or the algorithms used. + if (cipher_id != 0) { + if (cipher_id != cp->id) { + continue; + } + } else if (strength_bits >= 0) { + if (strength_bits != SSL_CIPHER_get_bits(cp, NULL)) { + continue; + } + } else { + if (!(alg_mkey & cp->algorithm_mkey) || + !(alg_auth & cp->algorithm_auth) || + !(alg_enc & cp->algorithm_enc) || + !(alg_mac & cp->algorithm_mac) || + (min_version != 0 && SSL_CIPHER_get_min_version(cp) != min_version) || + // The NULL cipher must be selected explicitly. + cp->algorithm_enc == SSL_eNULL) { + continue; + } + } + + // add the cipher if it has not been added yet. + if (rule == CIPHER_ADD) { + // reverse == false + if (!curr->active) { + ll_append_tail(&head, curr, &tail); + curr->active = true; + curr->in_group = in_group; + } + } + + // Move the added cipher to this location + else if (rule == CIPHER_ORD) { + // reverse == false + if (curr->active) { + ll_append_tail(&head, curr, &tail); + curr->in_group = false; + } + } else if (rule == CIPHER_DEL) { + // reverse == true + if (curr->active) { + // most recently deleted ciphersuites get best positions + // for any future CIPHER_ADD (note that the CIPHER_DEL loop + // works in reverse to maintain the order) + ll_append_head(&head, curr, &tail); + curr->active = false; + curr->in_group = false; + } + } else if (rule == CIPHER_KILL) { + // reverse == false + if (head == curr) { + head = curr->next; + } else { + curr->prev->next = curr->next; + } + + if (tail == curr) { + tail = curr->prev; + } + curr->active = false; + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + curr->next = NULL; + curr->prev = NULL; + } + } + + *head_p = head; + *tail_p = tail; +} + +static bool ssl_cipher_strength_sort(CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p) { + // This routine sorts the ciphers with descending strength. The sorting must + // keep the pre-sorted sequence, so we apply the normal sorting routine as + // '+' movement to the end of the list. + int max_strength_bits = 0; + CIPHER_ORDER *curr = *head_p; + while (curr != NULL) { + if (curr->active && + SSL_CIPHER_get_bits(curr->cipher, NULL) > max_strength_bits) { + max_strength_bits = SSL_CIPHER_get_bits(curr->cipher, NULL); + } + curr = curr->next; + } + + Array number_uses; + if (!number_uses.Init(max_strength_bits + 1)) { + return false; + } + OPENSSL_memset(number_uses.data(), 0, (max_strength_bits + 1) * sizeof(int)); + + // Now find the strength_bits values actually used. + curr = *head_p; + while (curr != NULL) { + if (curr->active) { + number_uses[SSL_CIPHER_get_bits(curr->cipher, NULL)]++; + } + curr = curr->next; + } + + // Go through the list of used strength_bits values in descending order. + for (int i = max_strength_bits; i >= 0; i--) { + if (number_uses[i] > 0) { + ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, CIPHER_ORD, i, false, head_p, + tail_p); + } + } + + return true; +} + +static bool ssl_cipher_process_rulestr(const char *rule_str, + CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p, bool strict) { + uint32_t alg_mkey, alg_auth, alg_enc, alg_mac; + uint16_t min_version; + const char *l, *buf; + int rule; + bool multi, skip_rule, in_group = false, has_group = false; + size_t j, buf_len; + uint32_t cipher_id; + char ch; + + l = rule_str; + for (;;) { + ch = *l; + + if (ch == '\0') { + break; // done + } + + if (in_group) { + if (ch == ']') { + if (*tail_p) { + (*tail_p)->in_group = false; + } + in_group = false; + l++; + continue; + } + + if (ch == '|') { + rule = CIPHER_ADD; + l++; + continue; + } else if (!(ch >= 'a' && ch <= 'z') && !(ch >= 'A' && ch <= 'Z') && + !(ch >= '0' && ch <= '9')) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_OPERATOR_IN_GROUP); + return false; + } else { + rule = CIPHER_ADD; + } + } else if (ch == '-') { + rule = CIPHER_DEL; + l++; + } else if (ch == '+') { + rule = CIPHER_ORD; + l++; + } else if (ch == '!') { + rule = CIPHER_KILL; + l++; + } else if (ch == '@') { + rule = CIPHER_SPECIAL; + l++; + } else if (ch == '[') { + assert(!in_group); + in_group = true; + has_group = true; + l++; + continue; + } else { + rule = CIPHER_ADD; + } + + // If preference groups are enabled, the only legal operator is +. + // Otherwise the in_group bits will get mixed up. + if (has_group && rule != CIPHER_ADD) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS); + return false; + } + + if (is_cipher_list_separator(ch, strict)) { + l++; + continue; + } + + multi = false; + cipher_id = 0; + alg_mkey = ~0u; + alg_auth = ~0u; + alg_enc = ~0u; + alg_mac = ~0u; + min_version = 0; + skip_rule = false; + + for (;;) { + ch = *l; + buf = l; + buf_len = 0; + while ((ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'z') || ch == '-' || ch == '.' || ch == '_') { + ch = *(++l); + buf_len++; + } + + if (buf_len == 0) { + // We hit something we cannot deal with, it is no command or separator + // nor alphanumeric, so we call this an error. + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + + if (rule == CIPHER_SPECIAL) { + break; + } + + // Look for a matching exact cipher. These aren't allowed in multipart + // rules. + if (!multi && ch != '+') { + 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)) { + cipher_id = cipher->id; + break; + } + } + } + if (cipher_id == 0) { + // If not an exact cipher, look for a matching cipher alias. + for (j = 0; j < kCipherAliasesLen; j++) { + if (rule_equals(kCipherAliases[j].name, buf, buf_len)) { + alg_mkey &= kCipherAliases[j].algorithm_mkey; + alg_auth &= kCipherAliases[j].algorithm_auth; + alg_enc &= kCipherAliases[j].algorithm_enc; + alg_mac &= kCipherAliases[j].algorithm_mac; + + if (min_version != 0 && + min_version != kCipherAliases[j].min_version) { + skip_rule = true; + } else { + min_version = kCipherAliases[j].min_version; + } + break; + } + } + if (j == kCipherAliasesLen) { + skip_rule = true; + if (strict) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + } + } + + // Check for a multipart rule. + if (ch != '+') { + break; + } + l++; + multi = true; + } + + // Ok, we have the rule, now apply it. + if (rule == CIPHER_SPECIAL) { + if (buf_len != 8 || strncmp(buf, "STRENGTH", 8) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + if (!ssl_cipher_strength_sort(head_p, tail_p)) { + return false; + } + + // We do not support any "multi" options together with "@", so throw away + // the rest of the command, if any left, until end or ':' is found. + while (*l != '\0' && !is_cipher_list_separator(*l, strict)) { + l++; + } + } else if (!skip_rule) { + ssl_cipher_apply_rule(cipher_id, alg_mkey, alg_auth, alg_enc, alg_mac, + min_version, rule, -1, in_group, head_p, tail_p); + } + } + + if (in_group) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + + return true; +} + +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; + } + + // 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. + Array co_list; + CIPHER_ORDER *head = nullptr, *tail = nullptr; + if (!ssl_cipher_collect_ciphers(&co_list, &head, &tail)) { + return false; + } + + // Now arrange all ciphers by preference: + // TODO(davidben): Compute this order once and copy it. + + // Everything else being equal, prefer ECDHE_ECDSA and ECDHE_RSA over other + // key exchange mechanisms + ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, ~0u, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, SSL_kECDHE, ~0u, ~0u, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_DEL, -1, false, &head, + &tail); + + // Order the bulk ciphers. First the preferred AEAD ciphers. We prefer + // CHACHA20 unless there is hardware support for fast and constant-time + // AES_GCM. Of the two CHACHA20 variants, the new one is preferred over the + // old one. + if (EVP_has_aes_hardware()) { + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0, CIPHER_ADD, + -1, false, &head, &tail); + } else { + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0, CIPHER_ADD, + -1, false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + } + + // Then the legacy non-AEAD ciphers: AES_128_CBC, AES_256_CBC, + // 3DES_EDE_CBC_SHA. + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_3DES, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + + // Temporarily enable everything else for sorting + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_ADD, -1, false, &head, + &tail); + + // Move ciphers without forward secrecy to the end. + ssl_cipher_apply_rule(0, (SSL_kRSA | SSL_kPSK), ~0u, ~0u, ~0u, 0, CIPHER_ORD, + -1, false, &head, &tail); + + // Now disable everything (maintaining the ordering!) + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_DEL, -1, false, &head, + &tail); + + // If the rule_string begins with DEFAULT, apply the default rule before + // using the (possibly available) additional rules. + const char *rule_p = rule_str; + if (strncmp(rule_str, "DEFAULT", 7) == 0) { + if (!ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, + strict)) { + return false; + } + rule_p += 7; + if (*rule_p == ':') { + rule_p++; + } + } + + if (*rule_p != '\0' && + !ssl_cipher_process_rulestr(rule_p, &head, &tail, strict)) { + return false; + } + + // Allocate new "cipherstack" for the result, return with error + // if we cannot get one. + 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). + 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.get(), curr->cipher)) { + return false; + } + in_group_flags[num_in_group_flags++] = curr->in_group; + } + } + + 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 = 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.get()) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHER_MATCH); + return false; + } + + return true; +} + +uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher) { + uint32_t id = cipher->id; + // All OpenSSL cipher IDs are prefaced with 0x03. Historically this referred + // to SSLv2 vs SSLv3. + assert((id & 0xff000000) == 0x03000000); + return id & 0xffff; +} + +uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key) { + switch (EVP_PKEY_id(key)) { + case EVP_PKEY_RSA: + return SSL_aRSA; + case EVP_PKEY_EC: + case EVP_PKEY_ED25519: + // Ed25519 keys in TLS 1.2 repurpose the ECDSA ciphers. + return SSL_aECDSA; + default: + return 0; + } +} + +bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher) { + return (cipher->algorithm_auth & SSL_aCERT) != 0; +} + +bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher) { + // Ephemeral Diffie-Hellman key exchanges require a ServerKeyExchange. It is + // optional or omitted in all others. + return (cipher->algorithm_mkey & SSL_kECDHE) != 0; +} + +size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher) { + size_t block_size; + switch (cipher->algorithm_enc) { + case SSL_3DES: + block_size = 8; + break; + case SSL_AES128: + case SSL_AES256: + block_size = 16; + break; + default: + return 0; + } + + // All supported TLS 1.0 ciphers use SHA-1. + assert(cipher->algorithm_mac == SSL_SHA1); + size_t ret = 1 + SHA_DIGEST_LENGTH; + ret += block_size - (ret % block_size); + return ret; +} + +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, 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; +} + +int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_enc) { + case SSL_eNULL: + return NID_undef; + case SSL_3DES: + return NID_des_ede3_cbc; + case SSL_AES128: + return NID_aes_128_cbc; + case SSL_AES256: + return NID_aes_256_cbc; + case SSL_AES128GCM: + return NID_aes_128_gcm; + case SSL_AES256GCM: + return NID_aes_256_gcm; + case SSL_CHACHA20POLY1305: + return NID_chacha20_poly1305; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_mac) { + case SSL_AEAD: + return NID_undef; + case SSL_SHA1: + return NID_sha1; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_mkey) { + case SSL_kRSA: + return NID_kx_rsa; + case SSL_kECDHE: + return NID_kx_ecdhe; + case SSL_kPSK: + return NID_kx_psk; + case SSL_kGENERIC: + return NID_kx_any; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_auth) { + case SSL_aRSA: + return NID_auth_rsa; + case SSL_aECDSA: + return NID_auth_ecdsa; + case SSL_aPSK: + return NID_auth_psk; + case SSL_aGENERIC: + return NID_auth_any; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_prf) { + case SSL_HANDSHAKE_MAC_DEFAULT: + return NID_md5_sha1; + case SSL_HANDSHAKE_MAC_SHA256: + return NID_sha256; + case SSL_HANDSHAKE_MAC_SHA384: + return NID_sha384; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher) { + return (cipher->algorithm_enc & SSL_eNULL) == 0 && + cipher->algorithm_mac != SSL_AEAD; +} + +uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher) { + if (cipher->algorithm_mkey == SSL_kGENERIC || + cipher->algorithm_auth == SSL_aGENERIC) { + return TLS1_3_VERSION; + } + + if (cipher->algorithm_prf != SSL_HANDSHAKE_MAC_DEFAULT) { + // Cipher suites before TLS 1.2 use the default PRF, while all those added + // afterwards specify a particular hash. + return TLS1_2_VERSION; + } + return SSL3_VERSION; +} + +uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher) { + if (cipher->algorithm_mkey == SSL_kGENERIC || + cipher->algorithm_auth == SSL_aGENERIC) { + return TLS1_3_VERSION; + } + return TLS1_2_VERSION; +} + +// return the actual cipher being used +const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher) { + if (cipher != NULL) { + return cipher->name; + } + + return "(NONE)"; +} + +const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher) { + return cipher->standard_name; +} + +const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher) { + if (cipher == NULL) { + return ""; + } + + switch (cipher->algorithm_mkey) { + case SSL_kRSA: + return "RSA"; + + case SSL_kECDHE: + switch (cipher->algorithm_auth) { + case SSL_aECDSA: + return "ECDHE_ECDSA"; + case SSL_aRSA: + return "ECDHE_RSA"; + case SSL_aPSK: + return "ECDHE_PSK"; + default: + assert(0); + return "UNKNOWN"; + } + + case SSL_kPSK: + assert(cipher->algorithm_auth == SSL_aPSK); + return "PSK"; + + case SSL_kGENERIC: + assert(cipher->algorithm_auth == SSL_aGENERIC); + return "GENERIC"; + + default: + assert(0); + return "UNKNOWN"; + } +} + +char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher) { + if (cipher == NULL) { + return NULL; + } + + return OPENSSL_strdup(SSL_CIPHER_standard_name(cipher)); +} + +int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *out_alg_bits) { + if (cipher == NULL) { + return 0; + } + + int alg_bits, strength_bits; + switch (cipher->algorithm_enc) { + case SSL_AES128: + case SSL_AES128GCM: + alg_bits = 128; + strength_bits = 128; + break; + + case SSL_AES256: + case SSL_AES256GCM: + case SSL_CHACHA20POLY1305: + alg_bits = 256; + strength_bits = 256; + break; + + case SSL_3DES: + alg_bits = 168; + strength_bits = 112; + break; + + case SSL_eNULL: + alg_bits = 0; + strength_bits = 0; + break; + + default: + assert(0); + alg_bits = 0; + strength_bits = 0; + } + + if (out_alg_bits != NULL) { + *out_alg_bits = alg_bits; + } + return strength_bits; +} + +const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, + int len) { + const char *kx, *au, *enc, *mac; + uint32_t alg_mkey, alg_auth, alg_enc, alg_mac; + + alg_mkey = cipher->algorithm_mkey; + alg_auth = cipher->algorithm_auth; + alg_enc = cipher->algorithm_enc; + alg_mac = cipher->algorithm_mac; + + switch (alg_mkey) { + case SSL_kRSA: + kx = "RSA"; + break; + + case SSL_kECDHE: + kx = "ECDH"; + break; + + case SSL_kPSK: + kx = "PSK"; + break; + + case SSL_kGENERIC: + kx = "GENERIC"; + break; + + default: + kx = "unknown"; + } + + switch (alg_auth) { + case SSL_aRSA: + au = "RSA"; + break; + + case SSL_aECDSA: + au = "ECDSA"; + break; + + case SSL_aPSK: + au = "PSK"; + break; + + case SSL_aGENERIC: + au = "GENERIC"; + break; + + default: + au = "unknown"; + break; + } + + switch (alg_enc) { + case SSL_3DES: + enc = "3DES(168)"; + break; + + case SSL_AES128: + enc = "AES(128)"; + break; + + case SSL_AES256: + enc = "AES(256)"; + break; + + case SSL_AES128GCM: + enc = "AESGCM(128)"; + break; + + case SSL_AES256GCM: + enc = "AESGCM(256)"; + break; + + case SSL_CHACHA20POLY1305: + enc = "ChaCha20-Poly1305"; + break; + + case SSL_eNULL: + enc="None"; + break; + + default: + enc = "unknown"; + break; + } + + switch (alg_mac) { + case SSL_SHA1: + mac = "SHA1"; + break; + + case SSL_AEAD: + mac = "AEAD"; + break; + + default: + mac = "unknown"; + break; + } + + if (buf == NULL) { + len = 128; + buf = (char *)OPENSSL_malloc(len); + if (buf == NULL) { + return NULL; + } + } else if (len < 128) { + return "Buffer too small"; + } + + BIO_snprintf(buf, len, "%-23s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s\n", + cipher->name, kx, au, enc, mac); + return buf; +} + +const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher) { + return "TLSv1/SSLv3"; +} + +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void) { return NULL; } + +int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) { return 1; } + +const char *SSL_COMP_get_name(const COMP_METHOD *comp) { return NULL; } + +const char *SSL_COMP_get0_name(const SSL_COMP *comp) { return comp->name; } + +int SSL_COMP_get_id(const SSL_COMP *comp) { return comp->id; } + +void SSL_COMP_free_compression_methods(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back new file mode 100644 index 0000000..c421292 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back @@ -0,0 +1,1718 @@ +/* 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 "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +static constexpr SSL_CIPHER kCiphers[] = { + // The RSA ciphers + // Cipher 02 + { + SSL3_TXT_RSA_NULL_SHA, + "TLS_RSA_WITH_NULL_SHA", + SSL3_CK_RSA_NULL_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_eNULL, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 0A + { + SSL3_TXT_RSA_DES_192_CBC3_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + SSL3_CK_RSA_DES_192_CBC3_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_3DES, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + + // New AES ciphersuites + + // Cipher 2F + { + TLS1_TXT_RSA_WITH_AES_128_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA", + TLS1_CK_RSA_WITH_AES_128_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 35 + { + TLS1_TXT_RSA_WITH_AES_256_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA", + TLS1_CK_RSA_WITH_AES_256_SHA, + SSL_kRSA, + SSL_aRSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // PSK cipher suites. + + // Cipher 8C + { + TLS1_TXT_PSK_WITH_AES_128_CBC_SHA, + "TLS_PSK_WITH_AES_128_CBC_SHA", + TLS1_CK_PSK_WITH_AES_128_CBC_SHA, + SSL_kPSK, + SSL_aPSK, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher 8D + { + TLS1_TXT_PSK_WITH_AES_256_CBC_SHA, + "TLS_PSK_WITH_AES_256_CBC_SHA", + TLS1_CK_PSK_WITH_AES_256_CBC_SHA, + SSL_kPSK, + SSL_aPSK, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // GCM ciphersuites from RFC5288 + + // Cipher 9C + { + TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_RSA_WITH_AES_128_GCM_SHA256, + SSL_kRSA, + SSL_aRSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher 9D + { + TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384, + "TLS_RSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_RSA_WITH_AES_256_GCM_SHA384, + SSL_kRSA, + SSL_aRSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // TLS 1.3 suites. + + // Cipher 1301 + { + TLS1_TXT_AES_128_GCM_SHA256, + "TLS_AES_128_GCM_SHA256", + TLS1_CK_AES_128_GCM_SHA256, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher 1302 + { + TLS1_TXT_AES_256_GCM_SHA384, + "TLS_AES_256_GCM_SHA384", + TLS1_CK_AES_256_GCM_SHA384, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // Cipher 1303 + { + TLS1_TXT_CHACHA20_POLY1305_SHA256, + "TLS_CHACHA20_POLY1305_SHA256", + TLS1_CK_CHACHA20_POLY1305_SHA256, + SSL_kGENERIC, + SSL_aGENERIC, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C009 + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C00A + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C013 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aRSA, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C014 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aRSA, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // GCM based TLS v1.2 ciphersuites from RFC5289 + + // Cipher C02B + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C02C + { + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // Cipher C02F + { + TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + SSL_kECDHE, + SSL_aRSA, + SSL_AES128GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher C030 + { + TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + SSL_kECDHE, + SSL_aRSA, + SSL_AES256GCM, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA384, + }, + + // ECDHE-PSK cipher suites. + + // Cipher C035 + { + TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", + TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA, + SSL_kECDHE, + SSL_aPSK, + SSL_AES128, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // Cipher C036 + { + TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", + TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA, + SSL_kECDHE, + SSL_aPSK, + SSL_AES256, + SSL_SHA1, + SSL_HANDSHAKE_MAC_DEFAULT, + }, + + // ChaCha20-Poly1305 cipher suites. + + // Cipher CCA8 + { + TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aRSA, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher CCA9 + { + TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aECDSA, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + + // Cipher CCAB + { + TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256", + TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256, + SSL_kECDHE, + SSL_aPSK, + SSL_CHACHA20POLY1305, + SSL_AEAD, + SSL_HANDSHAKE_MAC_SHA256, + }, + +}; + +Span AllCiphers() { + return MakeConstSpan(kCiphers, OPENSSL_ARRAY_SIZE(kCiphers)); +} + +#define CIPHER_ADD 1 +#define CIPHER_KILL 2 +#define CIPHER_DEL 3 +#define CIPHER_ORD 4 +#define CIPHER_SPECIAL 5 + +typedef struct cipher_order_st { + const SSL_CIPHER *cipher; + bool active; + bool in_group; + struct cipher_order_st *next, *prev; +} CIPHER_ORDER; + +typedef struct cipher_alias_st { + // name is the name of the cipher alias. + const char *name; + + // The following fields are bitmasks for the corresponding fields on + // |SSL_CIPHER|. A cipher matches a cipher alias iff, for each bitmask, the + // bit corresponding to the cipher's value is set to 1. If any bitmask is + // all zeroes, the alias matches nothing. Use |~0u| for the default value. + uint32_t algorithm_mkey; + uint32_t algorithm_auth; + uint32_t algorithm_enc; + uint32_t algorithm_mac; + + // min_version, if non-zero, matches all ciphers which were added in that + // particular protocol version. + uint16_t min_version; +} CIPHER_ALIAS; + +static const CIPHER_ALIAS kCipherAliases[] = { + // "ALL" doesn't include eNULL. It must be explicitly enabled. + {"ALL", ~0u, ~0u, ~0u, ~0u, 0}, + + // The "COMPLEMENTOFDEFAULT" rule is omitted. It matches nothing. + + // key exchange aliases + // (some of those using only a single bit here combine + // multiple key exchange algs according to the RFCs. + {"kRSA", SSL_kRSA, ~0u, ~0u, ~0u, 0}, + + {"kECDHE", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"kEECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"ECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + + {"kPSK", SSL_kPSK, ~0u, ~0u, ~0u, 0}, + + // server authentication aliases + {"aRSA", ~0u, SSL_aRSA, ~0u, ~0u, 0}, + {"aECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0}, + {"ECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0}, + {"aPSK", ~0u, SSL_aPSK, ~0u, ~0u, 0}, + + // aliases combining key exchange and server authentication + {"ECDHE", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"EECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0}, + {"RSA", SSL_kRSA, SSL_aRSA, ~0u, ~0u, 0}, + {"PSK", SSL_kPSK, SSL_aPSK, ~0u, ~0u, 0}, + + // symmetric encryption aliases + {"3DES", ~0u, ~0u, SSL_3DES, ~0u, 0}, + {"AES128", ~0u, ~0u, SSL_AES128 | SSL_AES128GCM, ~0u, 0}, + {"AES256", ~0u, ~0u, SSL_AES256 | SSL_AES256GCM, ~0u, 0}, + {"AES", ~0u, ~0u, SSL_AES, ~0u, 0}, + {"AESGCM", ~0u, ~0u, SSL_AES128GCM | SSL_AES256GCM, ~0u, 0}, + {"CHACHA20", ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0}, + + // MAC aliases + {"SHA1", ~0u, ~0u, ~0u, SSL_SHA1, 0}, + {"SHA", ~0u, ~0u, ~0u, SSL_SHA1, 0}, + + // Legacy protocol minimum version aliases. "TLSv1" is intentionally the + // same as "SSLv3". + {"SSLv3", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION}, + {"TLSv1", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION}, + {"TLSv1.2", ~0u, ~0u, ~0u, ~0u, TLS1_2_VERSION}, + + // 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); + +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) { + *out_aead = NULL; + *out_mac_secret_len = 0; + *out_fixed_iv_len = 0; + + 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) { + 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) { + 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(); + *out_fixed_iv_len = 12; + } else { + return false; + } + + // In TLS 1.3, the iv_len is equal to the AEAD nonce length whereas the code + // above computes the TLS 1.2 construction. + if (version >= TLS1_3_VERSION) { + *out_fixed_iv_len = EVP_AEAD_nonce_length(*out_aead); + } + } else if (cipher->algorithm_mac == SSL_SHA1) { + if (cipher->algorithm_enc == SSL_eNULL) { + *out_aead = EVP_aead_null_sha1_tls(); + } else if (cipher->algorithm_enc == SSL_3DES) { + 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 == 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 == TLS1_VERSION) { + *out_aead = EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(); + *out_fixed_iv_len = 16; + } else { + *out_aead = EVP_aead_aes_256_cbc_sha1_tls(); + } + } else { + return false; + } + + *out_mac_secret_len = SHA_DIGEST_LENGTH; + } else { + return false; + } + + return true; +} + +const EVP_MD *ssl_get_handshake_digest(uint16_t version, + const SSL_CIPHER *cipher) { + switch (cipher->algorithm_prf) { + case SSL_HANDSHAKE_MAC_DEFAULT: + return version >= TLS1_2_VERSION ? EVP_sha256() : EVP_md5_sha1(); + case SSL_HANDSHAKE_MAC_SHA256: + return EVP_sha256(); + case SSL_HANDSHAKE_MAC_SHA384: + return EVP_sha384(); + default: + assert(0); + return NULL; + } +} + +static bool is_cipher_list_separator(char c, bool is_strict) { + if (c == ':') { + return true; + } + return !is_strict && (c == ' ' || c == ';' || c == ','); +} + +// rule_equals returns whether the NUL-terminated string |rule| is equal to the +// |buf_len| bytes at |buf|. +static bool rule_equals(const char *rule, const char *buf, size_t buf_len) { + // |strncmp| alone only checks that |buf| is a prefix of |rule|. + return strncmp(rule, buf, buf_len) == 0 && rule[buf_len] == '\0'; +} + +static void ll_append_tail(CIPHER_ORDER **head, CIPHER_ORDER *curr, + CIPHER_ORDER **tail) { + if (curr == *tail) { + return; + } + if (curr == *head) { + *head = curr->next; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + (*tail)->next = curr; + curr->prev = *tail; + curr->next = NULL; + *tail = curr; +} + +static void ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr, + CIPHER_ORDER **tail) { + if (curr == *head) { + return; + } + if (curr == *tail) { + *tail = curr->prev; + } + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + (*head)->prev = curr; + curr->next = *head; + curr->prev = NULL; + *head = curr; +} + +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. + if (cipher.algorithm_mkey != SSL_kGENERIC) { + co_list[co_list_num].cipher = &cipher; + co_list[co_list_num].next = NULL; + co_list[co_list_num].prev = NULL; + co_list[co_list_num].active = false; + co_list[co_list_num].in_group = false; + co_list_num++; + } + } + + // Prepare linked list from list entries. + if (co_list_num > 0) { + co_list[0].prev = NULL; + + if (co_list_num > 1) { + co_list[0].next = &co_list[1]; + + for (size_t i = 1; i < co_list_num - 1; i++) { + co_list[i].prev = &co_list[i - 1]; + co_list[i].next = &co_list[i + 1]; + } + + co_list[co_list_num - 1].prev = &co_list[co_list_num - 2]; + } + + co_list[co_list_num - 1].next = NULL; + + *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 +// parameters in the linked list from |*head_p| to |*tail_p|. It writes the new +// head and tail of the list to |*head_p| and |*tail_p|, respectively. +// +// - If |cipher_id| is non-zero, only that cipher is selected. +// - Otherwise, if |strength_bits| is non-negative, it selects ciphers +// of that strength. +// - Otherwise, it selects ciphers that match each bitmasks in |alg_*| and +// |min_version|. +static void ssl_cipher_apply_rule( + uint32_t cipher_id, uint32_t alg_mkey, uint32_t alg_auth, + uint32_t alg_enc, uint32_t alg_mac, uint16_t min_version, int rule, + int strength_bits, bool in_group, CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p) { + CIPHER_ORDER *head, *tail, *curr, *next, *last; + const SSL_CIPHER *cp; + bool reverse = false; + + if (cipher_id == 0 && strength_bits == -1 && min_version == 0 && + (alg_mkey == 0 || alg_auth == 0 || alg_enc == 0 || alg_mac == 0)) { + // The rule matches nothing, so bail early. + return; + } + + if (rule == CIPHER_DEL) { + // needed to maintain sorting between currently deleted ciphers + reverse = true; + } + + head = *head_p; + tail = *tail_p; + + if (reverse) { + next = tail; + last = head; + } else { + next = head; + last = tail; + } + + curr = NULL; + for (;;) { + if (curr == last) { + break; + } + + curr = next; + if (curr == NULL) { + break; + } + + next = reverse ? curr->prev : curr->next; + cp = curr->cipher; + + // Selection criteria is either a specific cipher, the value of + // |strength_bits|, or the algorithms used. + if (cipher_id != 0) { + if (cipher_id != cp->id) { + continue; + } + } else if (strength_bits >= 0) { + if (strength_bits != SSL_CIPHER_get_bits(cp, NULL)) { + continue; + } + } else { + if (!(alg_mkey & cp->algorithm_mkey) || + !(alg_auth & cp->algorithm_auth) || + !(alg_enc & cp->algorithm_enc) || + !(alg_mac & cp->algorithm_mac) || + (min_version != 0 && SSL_CIPHER_get_min_version(cp) != min_version) || + // The NULL cipher must be selected explicitly. + cp->algorithm_enc == SSL_eNULL) { + continue; + } + } + + // add the cipher if it has not been added yet. + if (rule == CIPHER_ADD) { + // reverse == false + if (!curr->active) { + ll_append_tail(&head, curr, &tail); + curr->active = true; + curr->in_group = in_group; + } + } + + // Move the added cipher to this location + else if (rule == CIPHER_ORD) { + // reverse == false + if (curr->active) { + ll_append_tail(&head, curr, &tail); + curr->in_group = false; + } + } else if (rule == CIPHER_DEL) { + // reverse == true + if (curr->active) { + // most recently deleted ciphersuites get best positions + // for any future CIPHER_ADD (note that the CIPHER_DEL loop + // works in reverse to maintain the order) + ll_append_head(&head, curr, &tail); + curr->active = false; + curr->in_group = false; + } + } else if (rule == CIPHER_KILL) { + // reverse == false + if (head == curr) { + head = curr->next; + } else { + curr->prev->next = curr->next; + } + + if (tail == curr) { + tail = curr->prev; + } + curr->active = false; + if (curr->next != NULL) { + curr->next->prev = curr->prev; + } + if (curr->prev != NULL) { + curr->prev->next = curr->next; + } + curr->next = NULL; + curr->prev = NULL; + } + } + + *head_p = head; + *tail_p = tail; +} + +static bool ssl_cipher_strength_sort(CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p) { + // This routine sorts the ciphers with descending strength. The sorting must + // keep the pre-sorted sequence, so we apply the normal sorting routine as + // '+' movement to the end of the list. + int max_strength_bits = 0; + CIPHER_ORDER *curr = *head_p; + while (curr != NULL) { + if (curr->active && + SSL_CIPHER_get_bits(curr->cipher, NULL) > max_strength_bits) { + max_strength_bits = SSL_CIPHER_get_bits(curr->cipher, NULL); + } + curr = curr->next; + } + + Array number_uses; + if (!number_uses.Init(max_strength_bits + 1)) { + return false; + } + OPENSSL_memset(number_uses.data(), 0, (max_strength_bits + 1) * sizeof(int)); + + // Now find the strength_bits values actually used. + curr = *head_p; + while (curr != NULL) { + if (curr->active) { + number_uses[SSL_CIPHER_get_bits(curr->cipher, NULL)]++; + } + curr = curr->next; + } + + // Go through the list of used strength_bits values in descending order. + for (int i = max_strength_bits; i >= 0; i--) { + if (number_uses[i] > 0) { + ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, CIPHER_ORD, i, false, head_p, + tail_p); + } + } + + return true; +} + +static bool ssl_cipher_process_rulestr(const char *rule_str, + CIPHER_ORDER **head_p, + CIPHER_ORDER **tail_p, bool strict) { + uint32_t alg_mkey, alg_auth, alg_enc, alg_mac; + uint16_t min_version; + const char *l, *buf; + int rule; + bool multi, skip_rule, in_group = false, has_group = false; + size_t j, buf_len; + uint32_t cipher_id; + char ch; + + l = rule_str; + for (;;) { + ch = *l; + + if (ch == '\0') { + break; // done + } + + if (in_group) { + if (ch == ']') { + if (*tail_p) { + (*tail_p)->in_group = false; + } + in_group = false; + l++; + continue; + } + + if (ch == '|') { + rule = CIPHER_ADD; + l++; + continue; + } else if (!(ch >= 'a' && ch <= 'z') && !(ch >= 'A' && ch <= 'Z') && + !(ch >= '0' && ch <= '9')) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_OPERATOR_IN_GROUP); + return false; + } else { + rule = CIPHER_ADD; + } + } else if (ch == '-') { + rule = CIPHER_DEL; + l++; + } else if (ch == '+') { + rule = CIPHER_ORD; + l++; + } else if (ch == '!') { + rule = CIPHER_KILL; + l++; + } else if (ch == '@') { + rule = CIPHER_SPECIAL; + l++; + } else if (ch == '[') { + assert(!in_group); + in_group = true; + has_group = true; + l++; + continue; + } else { + rule = CIPHER_ADD; + } + + // If preference groups are enabled, the only legal operator is +. + // Otherwise the in_group bits will get mixed up. + if (has_group && rule != CIPHER_ADD) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS); + return false; + } + + if (is_cipher_list_separator(ch, strict)) { + l++; + continue; + } + + multi = false; + cipher_id = 0; + alg_mkey = ~0u; + alg_auth = ~0u; + alg_enc = ~0u; + alg_mac = ~0u; + min_version = 0; + skip_rule = false; + + for (;;) { + ch = *l; + buf = l; + buf_len = 0; + while ((ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'z') || ch == '-' || ch == '.' || ch == '_') { + ch = *(++l); + buf_len++; + } + + if (buf_len == 0) { + // We hit something we cannot deal with, it is no command or separator + // nor alphanumeric, so we call this an error. + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + + if (rule == CIPHER_SPECIAL) { + break; + } + + // Look for a matching exact cipher. These aren't allowed in multipart + // rules. + if (!multi && ch != '+') { + 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)) { + cipher_id = cipher->id; + break; + } + } + } + if (cipher_id == 0) { + // If not an exact cipher, look for a matching cipher alias. + for (j = 0; j < kCipherAliasesLen; j++) { + if (rule_equals(kCipherAliases[j].name, buf, buf_len)) { + alg_mkey &= kCipherAliases[j].algorithm_mkey; + alg_auth &= kCipherAliases[j].algorithm_auth; + alg_enc &= kCipherAliases[j].algorithm_enc; + alg_mac &= kCipherAliases[j].algorithm_mac; + + if (min_version != 0 && + min_version != kCipherAliases[j].min_version) { + skip_rule = true; + } else { + min_version = kCipherAliases[j].min_version; + } + break; + } + } + if (j == kCipherAliasesLen) { + skip_rule = true; + if (strict) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + } + } + + // Check for a multipart rule. + if (ch != '+') { + break; + } + l++; + multi = true; + } + + // Ok, we have the rule, now apply it. + if (rule == CIPHER_SPECIAL) { + if (buf_len != 8 || strncmp(buf, "STRENGTH", 8) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + if (!ssl_cipher_strength_sort(head_p, tail_p)) { + return false; + } + + // We do not support any "multi" options together with "@", so throw away + // the rest of the command, if any left, until end or ':' is found. + while (*l != '\0' && !is_cipher_list_separator(*l, strict)) { + l++; + } + } else if (!skip_rule) { + ssl_cipher_apply_rule(cipher_id, alg_mkey, alg_auth, alg_enc, alg_mac, + min_version, rule, -1, in_group, head_p, tail_p); + } + } + + if (in_group) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_COMMAND); + return false; + } + + return true; +} + +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; + } + + // 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. + Array co_list; + CIPHER_ORDER *head = nullptr, *tail = nullptr; + if (!ssl_cipher_collect_ciphers(&co_list, &head, &tail)) { + return false; + } + + // Now arrange all ciphers by preference: + // TODO(davidben): Compute this order once and copy it. + + // Everything else being equal, prefer ECDHE_ECDSA and ECDHE_RSA over other + // key exchange mechanisms + ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, ~0u, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, SSL_kECDHE, ~0u, ~0u, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_DEL, -1, false, &head, + &tail); + + // Order the bulk ciphers. First the preferred AEAD ciphers. We prefer + // CHACHA20 unless there is hardware support for fast and constant-time + // AES_GCM. Of the two CHACHA20 variants, the new one is preferred over the + // old one. + if (EVP_has_aes_hardware()) { + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0, CIPHER_ADD, + -1, false, &head, &tail); + } else { + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0, CIPHER_ADD, + -1, false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256GCM, ~0u, 0, CIPHER_ADD, -1, + false, &head, &tail); + } + + // Then the legacy non-AEAD ciphers: AES_128_CBC, AES_256_CBC, + // 3DES_EDE_CBC_SHA. + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES128, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_AES256, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + ssl_cipher_apply_rule(0, ~0u, ~0u, SSL_3DES, ~0u, 0, CIPHER_ADD, -1, false, + &head, &tail); + + // Temporarily enable everything else for sorting + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_ADD, -1, false, &head, + &tail); + + // Move ciphers without forward secrecy to the end. + ssl_cipher_apply_rule(0, (SSL_kRSA | SSL_kPSK), ~0u, ~0u, ~0u, 0, CIPHER_ORD, + -1, false, &head, &tail); + + // Now disable everything (maintaining the ordering!) + ssl_cipher_apply_rule(0, ~0u, ~0u, ~0u, ~0u, 0, CIPHER_DEL, -1, false, &head, + &tail); + + // If the rule_string begins with DEFAULT, apply the default rule before + // using the (possibly available) additional rules. + const char *rule_p = rule_str; + if (strncmp(rule_str, "DEFAULT", 7) == 0) { + if (!ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, + strict)) { + return false; + } + rule_p += 7; + if (*rule_p == ':') { + rule_p++; + } + } + + if (*rule_p != '\0' && + !ssl_cipher_process_rulestr(rule_p, &head, &tail, strict)) { + return false; + } + + // Allocate new "cipherstack" for the result, return with error + // if we cannot get one. + 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). + 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.get(), curr->cipher)) { + return false; + } + in_group_flags[num_in_group_flags++] = curr->in_group; + } + } + + 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 = 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.get()) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHER_MATCH); + return false; + } + + return true; +} + +uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher) { + uint32_t id = cipher->id; + // All OpenSSL cipher IDs are prefaced with 0x03. Historically this referred + // to SSLv2 vs SSLv3. + assert((id & 0xff000000) == 0x03000000); + return id & 0xffff; +} + +uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key) { + switch (EVP_PKEY_id(key)) { + case EVP_PKEY_RSA: + return SSL_aRSA; + case EVP_PKEY_EC: + case EVP_PKEY_ED25519: + // Ed25519 keys in TLS 1.2 repurpose the ECDSA ciphers. + return SSL_aECDSA; + default: + return 0; + } +} + +bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher) { + return (cipher->algorithm_auth & SSL_aCERT) != 0; +} + +bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher) { + // Ephemeral Diffie-Hellman key exchanges require a ServerKeyExchange. It is + // optional or omitted in all others. + return (cipher->algorithm_mkey & SSL_kECDHE) != 0; +} + +size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher) { + size_t block_size; + switch (cipher->algorithm_enc) { + case SSL_3DES: + block_size = 8; + break; + case SSL_AES128: + case SSL_AES256: + block_size = 16; + break; + default: + return 0; + } + + // All supported TLS 1.0 ciphers use SHA-1. + assert(cipher->algorithm_mac == SSL_SHA1); + size_t ret = 1 + SHA_DIGEST_LENGTH; + ret += block_size - (ret % block_size); + return ret; +} + +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, 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; +} + +int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_enc) { + case SSL_eNULL: + return NID_undef; + case SSL_3DES: + return NID_des_ede3_cbc; + case SSL_AES128: + return NID_aes_128_cbc; + case SSL_AES256: + return NID_aes_256_cbc; + case SSL_AES128GCM: + return NID_aes_128_gcm; + case SSL_AES256GCM: + return NID_aes_256_gcm; + case SSL_CHACHA20POLY1305: + return NID_chacha20_poly1305; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_mac) { + case SSL_AEAD: + return NID_undef; + case SSL_SHA1: + return NID_sha1; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_mkey) { + case SSL_kRSA: + return NID_kx_rsa; + case SSL_kECDHE: + return NID_kx_ecdhe; + case SSL_kPSK: + return NID_kx_psk; + case SSL_kGENERIC: + return NID_kx_any; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_auth) { + case SSL_aRSA: + return NID_auth_rsa; + case SSL_aECDSA: + return NID_auth_ecdsa; + case SSL_aPSK: + return NID_auth_psk; + case SSL_aGENERIC: + return NID_auth_any; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *cipher) { + switch (cipher->algorithm_prf) { + case SSL_HANDSHAKE_MAC_DEFAULT: + return NID_md5_sha1; + case SSL_HANDSHAKE_MAC_SHA256: + return NID_sha256; + case SSL_HANDSHAKE_MAC_SHA384: + return NID_sha384; + } + assert(0); + return NID_undef; +} + +int SSL_CIPHER_is_block_cipher(const SSL_CIPHER *cipher) { + return (cipher->algorithm_enc & SSL_eNULL) == 0 && + cipher->algorithm_mac != SSL_AEAD; +} + +uint16_t SSL_CIPHER_get_min_version(const SSL_CIPHER *cipher) { + if (cipher->algorithm_mkey == SSL_kGENERIC || + cipher->algorithm_auth == SSL_aGENERIC) { + return TLS1_3_VERSION; + } + + if (cipher->algorithm_prf != SSL_HANDSHAKE_MAC_DEFAULT) { + // Cipher suites before TLS 1.2 use the default PRF, while all those added + // afterwards specify a particular hash. + return TLS1_2_VERSION; + } + return SSL3_VERSION; +} + +uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher) { + if (cipher->algorithm_mkey == SSL_kGENERIC || + cipher->algorithm_auth == SSL_aGENERIC) { + return TLS1_3_VERSION; + } + return TLS1_2_VERSION; +} + +// return the actual cipher being used +const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher) { + if (cipher != NULL) { + return cipher->name; + } + + return "(NONE)"; +} + +const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher) { + return cipher->standard_name; +} + +const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher) { + if (cipher == NULL) { + return ""; + } + + switch (cipher->algorithm_mkey) { + case SSL_kRSA: + return "RSA"; + + case SSL_kECDHE: + switch (cipher->algorithm_auth) { + case SSL_aECDSA: + return "ECDHE_ECDSA"; + case SSL_aRSA: + return "ECDHE_RSA"; + case SSL_aPSK: + return "ECDHE_PSK"; + default: + assert(0); + return "UNKNOWN"; + } + + case SSL_kPSK: + assert(cipher->algorithm_auth == SSL_aPSK); + return "PSK"; + + case SSL_kGENERIC: + assert(cipher->algorithm_auth == SSL_aGENERIC); + return "GENERIC"; + + default: + assert(0); + return "UNKNOWN"; + } +} + +char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher) { + if (cipher == NULL) { + return NULL; + } + + return OPENSSL_strdup(SSL_CIPHER_standard_name(cipher)); +} + +int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *out_alg_bits) { + if (cipher == NULL) { + return 0; + } + + int alg_bits, strength_bits; + switch (cipher->algorithm_enc) { + case SSL_AES128: + case SSL_AES128GCM: + alg_bits = 128; + strength_bits = 128; + break; + + case SSL_AES256: + case SSL_AES256GCM: + case SSL_CHACHA20POLY1305: + alg_bits = 256; + strength_bits = 256; + break; + + case SSL_3DES: + alg_bits = 168; + strength_bits = 112; + break; + + case SSL_eNULL: + alg_bits = 0; + strength_bits = 0; + break; + + default: + assert(0); + alg_bits = 0; + strength_bits = 0; + } + + if (out_alg_bits != NULL) { + *out_alg_bits = alg_bits; + } + return strength_bits; +} + +const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, + int len) { + const char *kx, *au, *enc, *mac; + uint32_t alg_mkey, alg_auth, alg_enc, alg_mac; + + alg_mkey = cipher->algorithm_mkey; + alg_auth = cipher->algorithm_auth; + alg_enc = cipher->algorithm_enc; + alg_mac = cipher->algorithm_mac; + + switch (alg_mkey) { + case SSL_kRSA: + kx = "RSA"; + break; + + case SSL_kECDHE: + kx = "ECDH"; + break; + + case SSL_kPSK: + kx = "PSK"; + break; + + case SSL_kGENERIC: + kx = "GENERIC"; + break; + + default: + kx = "unknown"; + } + + switch (alg_auth) { + case SSL_aRSA: + au = "RSA"; + break; + + case SSL_aECDSA: + au = "ECDSA"; + break; + + case SSL_aPSK: + au = "PSK"; + break; + + case SSL_aGENERIC: + au = "GENERIC"; + break; + + default: + au = "unknown"; + break; + } + + switch (alg_enc) { + case SSL_3DES: + enc = "3DES(168)"; + break; + + case SSL_AES128: + enc = "AES(128)"; + break; + + case SSL_AES256: + enc = "AES(256)"; + break; + + case SSL_AES128GCM: + enc = "AESGCM(128)"; + break; + + case SSL_AES256GCM: + enc = "AESGCM(256)"; + break; + + case SSL_CHACHA20POLY1305: + enc = "ChaCha20-Poly1305"; + break; + + case SSL_eNULL: + enc="None"; + break; + + default: + enc = "unknown"; + break; + } + + switch (alg_mac) { + case SSL_SHA1: + mac = "SHA1"; + break; + + case SSL_AEAD: + mac = "AEAD"; + break; + + default: + mac = "unknown"; + break; + } + + if (buf == NULL) { + len = 128; + buf = (char *)OPENSSL_malloc(len); + if (buf == NULL) { + return NULL; + } + } else if (len < 128) { + return "Buffer too small"; + } + + BIO_snprintf(buf, len, "%-23s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s\n", + cipher->name, kx, au, enc, mac); + return buf; +} + +const char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher) { + return "TLSv1/SSLv3"; +} + +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void) { return NULL; } + +int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) { return 1; } + +const char *SSL_COMP_get_name(const COMP_METHOD *comp) { return NULL; } + +const char *SSL_COMP_get0_name(const SSL_COMP *comp) { return comp->name; } + +int SSL_COMP_get_id(const SSL_COMP *comp) { return comp->id; } + +void SSL_COMP_free_compression_methods(void) {} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc new file mode 100644 index 0000000..1656fb2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc @@ -0,0 +1,585 @@ +/* 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). + * + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" + + +static int xname_cmp(const X509_NAME **a, const X509_NAME **b) { + return X509_NAME_cmp(*a, *b); +} + +// TODO(davidben): Is there any reason this doesn't call +// |SSL_add_file_cert_subjects_to_stack|? +STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) { + BIO *in; + X509 *x = NULL; + X509_NAME *xn = NULL; + STACK_OF(X509_NAME) *ret = NULL, *sk; + + sk = sk_X509_NAME_new(xname_cmp); + in = BIO_new(BIO_s_file()); + + if (sk == NULL || in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!BIO_read_filename(in, file)) { + goto err; + } + + for (;;) { + if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL) { + break; + } + if (ret == NULL) { + ret = sk_X509_NAME_new_null(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + } + xn = X509_get_subject_name(x); + if (xn == NULL) { + goto err; + } + + // Check for duplicates. + sk_X509_NAME_sort(sk); + if (sk_X509_NAME_find(sk, NULL, xn)) { + continue; + } + + xn = X509_NAME_dup(xn); + if (xn == NULL || + !sk_X509_NAME_push(sk /* non-owning */, xn) || + !sk_X509_NAME_push(ret /* owning */, xn)) { + X509_NAME_free(xn); + goto err; + } + } + + if (0) { + err: + sk_X509_NAME_pop_free(ret, X509_NAME_free); + ret = NULL; + } + + sk_X509_NAME_free(sk); + BIO_free(in); + X509_free(x); + if (ret != NULL) { + ERR_clear_error(); + } + return ret; +} + +int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, + const char *file) { + BIO *in; + X509 *x = NULL; + X509_NAME *xn = NULL; + int ret = 0; + int (*oldcmp)(const X509_NAME **a, const X509_NAME **b); + + oldcmp = sk_X509_NAME_set_cmp_func(stack, xname_cmp); + in = BIO_new(BIO_s_file()); + + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!BIO_read_filename(in, file)) { + goto err; + } + + for (;;) { + if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL) { + break; + } + xn = X509_get_subject_name(x); + if (xn == NULL) { + goto err; + } + + // Check for duplicates. + sk_X509_NAME_sort(stack); + if (sk_X509_NAME_find(stack, NULL, xn)) { + continue; + } + + xn = X509_NAME_dup(xn); + if (xn == NULL || + !sk_X509_NAME_push(stack, xn)) { + X509_NAME_free(xn); + goto err; + } + } + + ERR_clear_error(); + ret = 1; + +err: + BIO_free(in); + X509_free(x); + + (void) sk_X509_NAME_set_cmp_func(stack, oldcmp); + + return ret; +} + +int SSL_use_certificate_file(SSL *ssl, const char *file, int type) { + int reason_code; + BIO *in; + int ret = 0; + X509 *x = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + x = d2i_X509_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + x = PEM_read_bio_X509(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + + ret = SSL_use_certificate(ssl, x); + +end: + X509_free(x); + BIO_free(in); + + return ret; +} + +int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + RSA *rsa = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + rsa = d2i_RSAPrivateKey_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + rsa = + PEM_read_bio_RSAPrivateKey(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_use_RSAPrivateKey(ssl, rsa); + RSA_free(rsa); + +end: + BIO_free(in); + return ret; +} + +int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + EVP_PKEY *pkey = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + pkey = PEM_read_bio_PrivateKey(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in, NULL); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_use_PrivateKey(ssl, pkey); + EVP_PKEY_free(pkey); + +end: + BIO_free(in); + return ret; +} + +int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code; + BIO *in; + int ret = 0; + X509 *x = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + x = d2i_X509_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + x = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + + ret = SSL_CTX_use_certificate(ctx, x); + +end: + X509_free(x); + BIO_free(in); + return ret; +} + +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + RSA *rsa = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + rsa = d2i_RSAPrivateKey_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa); + RSA_free(rsa); + +end: + BIO_free(in); + return ret; +} + +int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + EVP_PKEY *pkey = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + pkey = PEM_read_bio_PrivateKey(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in, NULL); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_CTX_use_PrivateKey(ctx, pkey); + EVP_PKEY_free(pkey); + +end: + BIO_free(in); + return ret; +} + +// Read a file that contains our certificate in "PEM" format, possibly followed +// by a sequence of CA certificates that should be sent to the peer in the +// Certificate message. +int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) { + BIO *in; + int ret = 0; + X509 *x = NULL; + + ERR_clear_error(); // clear error stack for SSL_CTX_use_certificate() + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + x = PEM_read_bio_X509_AUX(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PEM_LIB); + goto end; + } + + ret = SSL_CTX_use_certificate(ctx, x); + + if (ERR_peek_error() != 0) { + ret = 0; // Key/certificate mismatch doesn't imply ret==0 ... + } + + if (ret) { + // If we could set up our certificate, now proceed to the CA + // certificates. + X509 *ca; + int r; + uint32_t err; + + SSL_CTX_clear_chain_certs(ctx); + + while ((ca = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata)) != + NULL) { + r = SSL_CTX_add0_chain_cert(ctx, ca); + if (!r) { + X509_free(ca); + ret = 0; + goto end; + } + // Note that we must not free r if it was successfully added to the chain + // (while we must free the main certificate, since its reference count is + // increased by SSL_CTX_use_certificate). + } + + // When the while loop ends, it's usually just EOF. + err = ERR_peek_last_error(); + if (ERR_GET_LIB(err) == ERR_LIB_PEM && + ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + } else { + ret = 0; // some real error + } + } + +end: + X509_free(x); + BIO_free(in); + return ret; +} + +void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb) { + ctx->default_passwd_callback = cb; +} + +pem_password_cb *SSL_CTX_get_default_passwd_cb(const SSL_CTX *ctx) { + return ctx->default_passwd_callback; +} + +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *data) { + ctx->default_passwd_callback_userdata = data; +} + +void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx) { + return ctx->default_passwd_callback_userdata; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back new file mode 100644 index 0000000..ca4b0be --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back @@ -0,0 +1,585 @@ +/* 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). + * + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" + + +static int xname_cmp(const X509_NAME **a, const X509_NAME **b) { + return X509_NAME_cmp(*a, *b); +} + +// TODO(davidben): Is there any reason this doesn't call +// |SSL_add_file_cert_subjects_to_stack|? +STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) { + BIO *in; + X509 *x = NULL; + X509_NAME *xn = NULL; + STACK_OF(X509_NAME) *ret = NULL, *sk; + + sk = sk_X509_NAME_new(xname_cmp); + in = BIO_new(BIO_s_file()); + + if (sk == NULL || in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!BIO_read_filename(in, file)) { + goto err; + } + + for (;;) { + if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL) { + break; + } + if (ret == NULL) { + ret = sk_X509_NAME_new_null(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + } + xn = X509_get_subject_name(x); + if (xn == NULL) { + goto err; + } + + // Check for duplicates. + sk_X509_NAME_sort(sk); + if (sk_X509_NAME_find(sk, NULL, xn)) { + continue; + } + + xn = X509_NAME_dup(xn); + if (xn == NULL || + !sk_X509_NAME_push(sk /* non-owning */, xn) || + !sk_X509_NAME_push(ret /* owning */, xn)) { + X509_NAME_free(xn); + goto err; + } + } + + if (0) { + err: + sk_X509_NAME_pop_free(ret, X509_NAME_free); + ret = NULL; + } + + sk_X509_NAME_free(sk); + BIO_free(in); + X509_free(x); + if (ret != NULL) { + ERR_clear_error(); + } + return ret; +} + +int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, + const char *file) { + BIO *in; + X509 *x = NULL; + X509_NAME *xn = NULL; + int ret = 0; + int (*oldcmp)(const X509_NAME **a, const X509_NAME **b); + + oldcmp = sk_X509_NAME_set_cmp_func(stack, xname_cmp); + in = BIO_new(BIO_s_file()); + + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + goto err; + } + + if (!BIO_read_filename(in, file)) { + goto err; + } + + for (;;) { + if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL) { + break; + } + xn = X509_get_subject_name(x); + if (xn == NULL) { + goto err; + } + + // Check for duplicates. + sk_X509_NAME_sort(stack); + if (sk_X509_NAME_find(stack, NULL, xn)) { + continue; + } + + xn = X509_NAME_dup(xn); + if (xn == NULL || + !sk_X509_NAME_push(stack, xn)) { + X509_NAME_free(xn); + goto err; + } + } + + ERR_clear_error(); + ret = 1; + +err: + BIO_free(in); + X509_free(x); + + (void) sk_X509_NAME_set_cmp_func(stack, oldcmp); + + return ret; +} + +int SSL_use_certificate_file(SSL *ssl, const char *file, int type) { + int reason_code; + BIO *in; + int ret = 0; + X509 *x = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + x = d2i_X509_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + x = PEM_read_bio_X509(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + + ret = SSL_use_certificate(ssl, x); + +end: + X509_free(x); + BIO_free(in); + + return ret; +} + +int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + RSA *rsa = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + rsa = d2i_RSAPrivateKey_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + rsa = + PEM_read_bio_RSAPrivateKey(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_use_RSAPrivateKey(ssl, rsa); + RSA_free(rsa); + +end: + BIO_free(in); + return ret; +} + +int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + EVP_PKEY *pkey = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + pkey = PEM_read_bio_PrivateKey(in, NULL, ssl->ctx->default_passwd_callback, + ssl->ctx->default_passwd_callback_userdata); + } else if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in, NULL); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_use_PrivateKey(ssl, pkey); + EVP_PKEY_free(pkey); + +end: + BIO_free(in); + return ret; +} + +int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code; + BIO *in; + int ret = 0; + X509 *x = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + x = d2i_X509_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + x = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + + ret = SSL_CTX_use_certificate(ctx, x); + +end: + X509_free(x); + BIO_free(in); + return ret; +} + +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + RSA *rsa = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + rsa = d2i_RSAPrivateKey_bio(in, NULL); + } else if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa); + RSA_free(rsa); + +end: + BIO_free(in); + return ret; +} + +int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) { + int reason_code, ret = 0; + BIO *in; + EVP_PKEY *pkey = NULL; + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + if (type == SSL_FILETYPE_PEM) { + reason_code = ERR_R_PEM_LIB; + pkey = PEM_read_bio_PrivateKey(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + } else if (type == SSL_FILETYPE_ASN1) { + reason_code = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in, NULL); + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SSL_FILETYPE); + goto end; + } + + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, reason_code); + goto end; + } + ret = SSL_CTX_use_PrivateKey(ctx, pkey); + EVP_PKEY_free(pkey); + +end: + BIO_free(in); + return ret; +} + +// Read a file that contains our certificate in "PEM" format, possibly followed +// by a sequence of CA certificates that should be sent to the peer in the +// Certificate message. +int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) { + BIO *in; + int ret = 0; + X509 *x = NULL; + + ERR_clear_error(); // clear error stack for SSL_CTX_use_certificate() + + in = BIO_new(BIO_s_file()); + if (in == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + goto end; + } + + if (BIO_read_filename(in, file) <= 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); + goto end; + } + + x = PEM_read_bio_X509_AUX(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata); + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PEM_LIB); + goto end; + } + + ret = SSL_CTX_use_certificate(ctx, x); + + if (ERR_peek_error() != 0) { + ret = 0; // Key/certificate mismatch doesn't imply ret==0 ... + } + + if (ret) { + // If we could set up our certificate, now proceed to the CA + // certificates. + X509 *ca; + int r; + uint32_t err; + + SSL_CTX_clear_chain_certs(ctx); + + while ((ca = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata)) != + NULL) { + r = SSL_CTX_add0_chain_cert(ctx, ca); + if (!r) { + X509_free(ca); + ret = 0; + goto end; + } + // Note that we must not free r if it was successfully added to the chain + // (while we must free the main certificate, since its reference count is + // increased by SSL_CTX_use_certificate). + } + + // When the while loop ends, it's usually just EOF. + err = ERR_peek_last_error(); + if (ERR_GET_LIB(err) == ERR_LIB_PEM && + ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + } else { + ret = 0; // some real error + } + } + +end: + X509_free(x); + BIO_free(in); + return ret; +} + +void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb) { + ctx->default_passwd_callback = cb; +} + +pem_password_cb *SSL_CTX_get_default_passwd_cb(const SSL_CTX *ctx) { + return ctx->default_passwd_callback; +} + +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *data) { + ctx->default_passwd_callback_userdata = data; +} + +void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx) { + return ctx->default_passwd_callback_userdata; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc new file mode 100644 index 0000000..059e856 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc.grpc_back new file mode 100644 index 0000000..6cac3cf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc new file mode 100644 index 0000000..86f3a54 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc.grpc_back new file mode 100644 index 0000000..4764000 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc new file mode 100644 index 0000000..f2936bb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc.grpc_back new file mode 100644 index 0000000..23f8d12 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc new file mode 100644 index 0000000..eb77327 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc @@ -0,0 +1,1274 @@ +/* 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 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" + + +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 +// that it needs to asynchronously fetch session information. +static const char g_pending_session_magic = 0; + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; + +static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *session); +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) { + 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; + } + + 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) { + UniquePtr new_session = ssl_session_new(session->x509_method); + if (!new_session) { + return nullptr; + } + + new_session->is_server = session->is_server; + new_session->ssl_version = session->ssl_version; + new_session->sid_ctx_length = session->sid_ctx_length; + OPENSSL_memcpy(new_session->sid_ctx, session->sid_ctx, session->sid_ctx_length); + + // Copy the key material. + new_session->master_key_length = session->master_key_length; + OPENSSL_memcpy(new_session->master_key, session->master_key, + session->master_key_length); + new_session->cipher = session->cipher; + + // Copy authentication state. + 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 != 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; + } + } + + if (!session->x509_method->session_dup(new_session.get(), session)) { + return nullptr; + } + + new_session->verify_result = session->verify_result; + + 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); + new_session->peer_sha256_valid = session->peer_sha256_valid; + + new_session->peer_signature_algorithm = session->peer_signature_algorithm; + + new_session->timeout = session->timeout; + new_session->auth_timeout = session->auth_timeout; + new_session->time = session->time; + + // Copy non-authentication connection properties. + if (dup_flags & SSL_SESSION_INCLUDE_NONAUTH) { + new_session->session_id_length = session->session_id_length; + OPENSSL_memcpy(new_session->session_id, session->session_id, + session->session_id_length); + + new_session->group_id = session->group_id; + + OPENSSL_memcpy(new_session->original_handshake_hash, + session->original_handshake_hash, + session->original_handshake_hash_len); + new_session->original_handshake_hash_len = + session->original_handshake_hash_len; + 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 (!new_session->early_alpn.CopyFrom(session->early_alpn)) { + return nullptr; + } + } + + // Copy the ticket. + 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 = true; + return new_session; +} + +void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session) { + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // To avoid overflows and underflows, if we've gone back in time, update the + // time, but mark the session expired. + if (session->time > now.tv_sec) { + session->time = now.tv_sec; + session->timeout = 0; + session->auth_timeout = 0; + return; + } + + // Adjust the session time and timeouts. If the session has already expired, + // clamp the timeouts at zero. + uint64_t delta = now.tv_sec - session->time; + session->time = now.tv_sec; + if (session->timeout < delta) { + session->timeout = 0; + } else { + session->timeout -= delta; + } + if (session->auth_timeout < delta) { + session->auth_timeout = 0; + } else { + session->auth_timeout -= delta; + } +} + +void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, + uint32_t timeout) { + // Rebase the timestamp relative to the current time so |timeout| is measured + // correctly. + ssl_session_rebase_time(ssl, session); + + if (session->timeout > timeout) { + return; + } + + session->timeout = timeout; + if (session->timeout > session->auth_timeout) { + session->timeout = session->auth_timeout; + } +} + +uint16_t ssl_session_protocol_version(const SSL_SESSION *session) { + uint16_t ret; + if (!ssl_protocol_version_from_wire(&ret, session->ssl_version)) { + // An |SSL_SESSION| will never have an invalid version. This is enforced by + // the parser. + assert(0); + return 0; + } + + return ret; +} + +const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session) { + return ssl_get_handshake_digest(ssl_session_protocol_version(session), + session->cipher); +} + +int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server) { + SSL *const ssl = hs->ssl; + if (ssl->mode & SSL_MODE_NO_SESSION_CREATION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SESSION_MAY_NOT_BE_CREATED); + return 0; + } + + UniquePtr session = ssl_session_new(ssl->ctx->x509_method); + if (session == NULL) { + return 0; + } + + session->is_server = is_server; + session->ssl_version = ssl->version; + + // Fill in the time from the |SSL_CTX|'s clock. + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + session->time = now.tv_sec; + + uint16_t version = ssl_protocol_version(ssl); + if (version >= TLS1_3_VERSION) { + // TLS 1.3 uses tickets as authenticators, so we are willing to use them for + // longer. + session->timeout = ssl->session_ctx->session_psk_dhe_timeout; + session->auth_timeout = SSL_DEFAULT_SESSION_AUTH_TIMEOUT; + } else { + // TLS 1.2 resumption does not incorporate new key material, so we use a + // much shorter timeout. + session->timeout = ssl->session_ctx->session_timeout; + session->auth_timeout = ssl->session_ctx->session_timeout; + } + + if (is_server) { + if (hs->ticket_expected || version >= TLS1_3_VERSION) { + // Don't set session IDs for sessions resumed with tickets. This will keep + // them out of the session cache. + session->session_id_length = 0; + } else { + session->session_id_length = SSL3_SSL_SESSION_ID_LENGTH; + if (!RAND_bytes(session->session_id, session->session_id_length)) { + return 0; + } + } + } else { + session->session_id_length = 0; + } + + 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, 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 = true; + session->verify_result = X509_V_ERR_INVALID_CALL; + + hs->new_session = std::move(session); + ssl_set_session(ssl, NULL); + return 1; +} + +int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx) { + OPENSSL_timeval now; + ssl_ctx_get_current_time(ctx, &now); + { + // 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->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->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(); + if (!new_key) { + return 0; + } + 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 dropped below. + ctx->ticket_key_current->next_rotation_tv_sec += + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + ctx->ticket_key_prev = std::move(ctx->ticket_key_current); + } + ctx->ticket_key_current = std::move(new_key); + } + + // Drop an expired prev key. + 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_HANDSHAKE *hs, CBB *out, + const uint8_t *session_buf, + size_t session_len) { + ScopedEVP_CIPHER_CTX ctx; + ScopedHMAC_CTX hctx; + + // If the session is too long, emit a dummy value rather than abort the + // connection. + static const size_t kMaxTicketOverhead = + 16 + EVP_MAX_IV_LENGTH + EVP_MAX_BLOCK_LENGTH + EVP_MAX_MD_SIZE; + if (session_len > 0xffff - kMaxTicketOverhead) { + static const char kTicketPlaceholder[] = "TICKET TOO LARGE"; + return CBB_add_bytes(out, (const uint8_t *)kTicketPlaceholder, + strlen(kTicketPlaceholder)); + } + + // Initialize HMAC and cipher contexts. If callback present it does all the + // work otherwise use generated values from parent ctx. + SSL_CTX *tctx = hs->ssl->session_ctx.get(); + uint8_t iv[EVP_MAX_IV_LENGTH]; + uint8_t key_name[16]; + 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 { + // Rotate ticket key if necessary. + if (!ssl_ctx_rotate_ticket_encryption_key(tctx)) { + return 0; + } + MutexReadLock lock(&tctx->lock); + if (!RAND_bytes(iv, 16) || + !EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_cbc(), NULL, + 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->ticket_key_current->name, 16); + } + + uint8_t *ptr; + if (!CBB_add_bytes(out, key_name, 16) || + !CBB_add_bytes(out, iv, EVP_CIPHER_CTX_iv_length(ctx.get())) || + !CBB_reserve(out, &ptr, session_len + EVP_MAX_BLOCK_LENGTH)) { + return 0; + } + + size_t total = 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + OPENSSL_memcpy(ptr, session_buf, session_len); + total = session_len; +#else + int len; + if (!EVP_EncryptUpdate(ctx.get(), ptr + total, &len, session_buf, session_len)) { + return 0; + } + total += len; + if (!EVP_EncryptFinal_ex(ctx.get(), ptr + total, &len)) { + return 0; + } + total += len; +#endif + if (!CBB_did_write(out, total)) { + return 0; + } + + unsigned hlen; + if (!HMAC_Update(hctx.get(), CBB_data(out), CBB_len(out)) || + !CBB_reserve(out, &ptr, EVP_MAX_MD_SIZE) || + !HMAC_Final(hctx.get(), ptr, &hlen) || + !CBB_did_write(out, hlen)) { + return 0; + } + + return 1; +} + +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; + if (max_out < max_overhead) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + uint8_t *ptr; + if (!CBB_reserve(out, &ptr, max_out)) { + return 0; + } + + size_t out_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; + } + + if (!CBB_did_write(out, out_len)) { + return 0; + } + + return 1; +} + +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; + if (!SSL_SESSION_to_bytes_for_ticket(session, &session_buf, &session_len)) { + return -1; + } + + int ret = 0; + 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(hs, out, session_buf, session_len); + } + + OPENSSL_free(session_buf); + return ret; +} + +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session) { + if (session == NULL) { + return 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) { + if (session == NULL) { + return 0; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // Reject tickets from the future to avoid underflow. + if (now.tv_sec < session->time) { + return 0; + } + + return session->timeout > now.tv_sec - session->time; +} + +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(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. */ + 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.get()) == 0 && + !session->peer_sha256_valid) || + session->peer_sha256_valid == + 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_HANDSHAKE *hs, UniquePtr *out_session, + Span session_id) { + SSL *const ssl = hs->ssl; + out_session->reset(); + + if (session_id.empty() || session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { + return ssl_hs_ok; + } + + UniquePtr session; + // Try the internal cache, if it exists. + if (!(ssl->session_ctx->session_cache_mode & + SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { + 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); + // |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) { + int copy = 1; + session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), + session_id.size(), ©)); + if (!session) { + return ssl_hs_ok; + } + + if (session.get() == SSL_magic_pending_session_ptr()) { + session.release(); // This pointer is not actually owned. + return ssl_hs_pending_session; + } + + // Increment reference count now if the session callback asks us to do so + // (note that if the session structures returned by the callback are shared + // between threads, it must handle the reference count itself [i.e. copy == + // 0], or things won't be thread-safe). + if (copy) { + SSL_SESSION_up_ref(session.get()); + } + + // 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.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.get(), session.get()); + session.reset(); + } + + *out_session = std::move(session); + return ssl_hs_ok; +} + +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(hs->ssl->server); + UniquePtr session; + bool renew_ticket = false; + + // If tickets are disabled, always behave as if no tickets are present. + CBS ticket; + const bool tickets_supported = + !(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: + assert(!session); + break; + case ssl_ticket_aead_error: + return ssl_hs_error; + case ssl_ticket_aead_retry: + return ssl_hs_pending_ticket; + } + } 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( + hs, &session, + MakeConstSpan(client_hello->session_id, client_hello->session_id_len)); + if (lookup_ret != ssl_hs_ok) { + return lookup_ret; + } + } + + *out_session = std::move(session); + *out_tickets_supported = tickets_supported; + *out_renew_ticket = renew_ticket; + return ssl_hs_ok; +} + +static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock) { + int ret = 0; + + if (session != NULL && session->session_id_length != 0) { + if (lock) { + CRYPTO_MUTEX_lock_write(&ctx->lock); + } + SSL_SESSION *found_session = lh_SSL_SESSION_retrieve(ctx->sessions, + session); + if (found_session == session) { + ret = 1; + found_session = lh_SSL_SESSION_delete(ctx->sessions, session); + SSL_SESSION_list_remove(ctx, session); + } + + if (lock) { + CRYPTO_MUTEX_unlock_write(&ctx->lock); + } + + if (ret) { + if (ctx->remove_session_cb != NULL) { + ctx->remove_session_cb(ctx, found_session); + } + SSL_SESSION_free(found_session); + } + } + + return ret; +} + +void ssl_set_session(SSL *ssl, SSL_SESSION *session) { + if (ssl->session.get() == session) { + return; + } + + ssl->session = UpRef(session); +} + +// locked by SSL_CTX in the calling function +static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *session) { + if (session->next == NULL || session->prev == NULL) { + return; + } + + if (session->next == (SSL_SESSION *)&ctx->session_cache_tail) { + // last element in list + if (session->prev == (SSL_SESSION *)&ctx->session_cache_head) { + // only one element in list + ctx->session_cache_head = NULL; + ctx->session_cache_tail = NULL; + } else { + ctx->session_cache_tail = session->prev; + session->prev->next = (SSL_SESSION *)&(ctx->session_cache_tail); + } + } else { + if (session->prev == (SSL_SESSION *)&ctx->session_cache_head) { + // first element in list + ctx->session_cache_head = session->next; + session->next->prev = (SSL_SESSION *)&(ctx->session_cache_head); + } else { // middle of list + session->next->prev = session->prev; + session->prev->next = session->next; + } + } + session->prev = session->next = NULL; +} + +static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session) { + if (session->next != NULL && session->prev != NULL) { + SSL_SESSION_list_remove(ctx, session); + } + + if (ctx->session_cache_head == NULL) { + ctx->session_cache_head = session; + ctx->session_cache_tail = session; + session->prev = (SSL_SESSION *)&(ctx->session_cache_head); + session->next = (SSL_SESSION *)&(ctx->session_cache_tail); + } else { + session->next = ctx->session_cache_head; + session->next->prev = session; + session->prev = (SSL_SESSION *)&(ctx->session_cache_head); + ctx->session_cache_head = session; + } +} + +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(); +} + +int SSL_SESSION_up_ref(SSL_SESSION *session) { + CRYPTO_refcount_inc(&session->references); + return 1; +} + +void SSL_SESSION_free(SSL_SESSION *session) { + if (session == NULL || + !CRYPTO_refcount_dec_and_test_zero(&session->references)) { + return; + } + + session->~ssl_session_st(); + OPENSSL_free(session); +} + +const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, + unsigned *out_len) { + if (out_len != NULL) { + *out_len = session->session_id_length; + } + 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; +} + +uint64_t SSL_SESSION_get_time(const SSL_SESSION *session) { + if (session == NULL) { + // NULL should crash, but silently accept it here for compatibility. + return 0; + } + return session->time; +} + +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. + if (max_out == 0) { + return (size_t)session->master_key_length; + } + if (max_out > (size_t)session->master_key_length) { + max_out = (size_t)session->master_key_length; + } + OPENSSL_memcpy(out, session->master_key, max_out); + return max_out; +} + +uint64_t SSL_SESSION_set_time(SSL_SESSION *session, uint64_t time) { + if (session == NULL) { + return 0; + } + + session->time = time; + return time; +} + +uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout) { + if (session == NULL) { + return 0; + } + + session->timeout = timeout; + session->auth_timeout = 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); + return 0; + } + + static_assert(sizeof(session->sid_ctx) < 256, "sid_ctx_len does not fit"); + session->sid_ctx_length = (uint8_t)sid_ctx_len; + OPENSSL_memcpy(session->sid_ctx, sid_ctx, sid_ctx_len); + + return 1; +} + +int SSL_SESSION_should_be_single_use(const SSL_SESSION *session) { + return ssl_session_protocol_version(session) >= TLS1_3_VERSION; +} + +int SSL_SESSION_is_resumable(const SSL_SESSION *session) { + return !session->not_resumable; +} + +int SSL_SESSION_has_ticket(const SSL_SESSION *session) { + 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->ticket.data(); + } + *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->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) { + return (SSL_SESSION *)&g_pending_session_magic; +} + +SSL_SESSION *SSL_get_session(const SSL *ssl) { + // Once the handshake completes we return the established session. Otherwise + // we return the intermediate session, either |session| (for resumption) or + // |new_session| if doing a full handshake. + if (!SSL_in_init(ssl)) { + return ssl->s3->established_session.get(); + } + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs->early_session) { + return hs->early_session.get(); + } + if (hs->new_session) { + return hs->new_session.get(); + } + return ssl->session.get(); +} + +SSL_SESSION *SSL_get1_session(SSL *ssl) { + SSL_SESSION *ret = SSL_get_session(ssl); + if (ret != NULL) { + SSL_SESSION_up_ref(ret); + } + return ret; +} + +int SSL_SESSION_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, void *arg) { + return CRYPTO_set_ex_data(&session->ex_data, idx, arg); +} + +void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, int idx) { + return CRYPTO_get_ex_data(&session->ex_data, 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. + UniquePtr owned_session = UpRef(session); + + SSL_SESSION *old_session; + MutexWriteLock lock(&ctx->lock); + if (!lh_SSL_SESSION_insert(ctx->sessions, &old_session, session)) { + return 0; + } + // |ctx->sessions| took ownership of |session| and gave us back a reference to + // |old_session|. (|old_session| may be the same as |session|, in which case + // we traded identical references with |ctx->sessions|.) + owned_session.release(); + owned_session.reset(old_session); + + if (old_session != NULL) { + if (old_session == session) { + // |session| was already in the cache. There are no linked list pointers + // to update. + return 0; + } + + // There was a session ID collision. |old_session| was replaced with + // |session| in the hash table, so |old_session| must be removed from the + // linked list to match. + SSL_SESSION_list_remove(ctx, old_session); + } + + SSL_SESSION_list_add(ctx, session); + + // Enforce any cache size limits. + if (SSL_CTX_sess_get_cache_size(ctx) > 0) { + while (lh_SSL_SESSION_num_items(ctx->sessions) > + SSL_CTX_sess_get_cache_size(ctx)) { + if (!remove_session_lock(ctx, ctx->session_cache_tail, 0)) { + break; + } + } + } + + return 1; +} + +int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session) { + return remove_session_lock(ctx, session, 1); +} + +int SSL_set_session(SSL *ssl, SSL_SESSION *session) { + // SSL_set_session may only be called before the handshake has started. + if (ssl->s3->initial_handshake_complete || + ssl->s3->hs == NULL || + ssl->s3->hs->state != 0) { + abort(); + } + + ssl_set_session(ssl, session); + return 1; +} + +uint32_t SSL_CTX_set_timeout(SSL_CTX *ctx, uint32_t timeout) { + if (ctx == NULL) { + return 0; + } + + // Historically, zero was treated as |SSL_DEFAULT_SESSION_TIMEOUT|. + if (timeout == 0) { + timeout = SSL_DEFAULT_SESSION_TIMEOUT; + } + + uint32_t old_timeout = ctx->session_timeout; + ctx->session_timeout = timeout; + return old_timeout; +} + +uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx) { + if (ctx == NULL) { + return 0; + } + + return ctx->session_timeout; +} + +void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, uint32_t timeout) { + ctx->session_psk_dhe_timeout = timeout; +} + +typedef struct timeout_param_st { + SSL_CTX *ctx; + uint64_t time; + LHASH_OF(SSL_SESSION) *cache; +} TIMEOUT_PARAM; + +static void timeout_doall_arg(SSL_SESSION *session, void *void_param) { + TIMEOUT_PARAM *param = reinterpret_cast(void_param); + + if (param->time == 0 || + session->time + session->timeout < session->time || + param->time > (session->time + session->timeout)) { + // The reason we don't call SSL_CTX_remove_session() is to + // save on locking overhead + (void) lh_SSL_SESSION_delete(param->cache, session); + SSL_SESSION_list_remove(param->ctx, session); + if (param->ctx->remove_session_cb != NULL) { + param->ctx->remove_session_cb(param->ctx, session); + } + SSL_SESSION_free(session); + } +} + +void SSL_CTX_flush_sessions(SSL_CTX *ctx, uint64_t time) { + TIMEOUT_PARAM tp; + + tp.ctx = ctx; + tp.cache = ctx->sessions; + if (tp.cache == NULL) { + return; + } + tp.time = time; + MutexWriteLock lock(&ctx->lock); + lh_SSL_SESSION_doall_arg(tp.cache, timeout_doall_arg, &tp); +} + +void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, SSL_SESSION *session)) { + ctx->new_session_cb = cb; +} + +int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(SSL *ssl, SSL_SESSION *session) { + return ctx->new_session_cb; +} + +void SSL_CTX_sess_set_remove_cb( + SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *session)) { + ctx->remove_session_cb = cb; +} + +void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(SSL_CTX *ctx, + SSL_SESSION *session) { + return ctx->remove_session_cb; +} + +void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, + SSL_SESSION *(*cb)(SSL *ssl, const uint8_t *id, + int id_len, int *out_copy)) { + ctx->get_session_cb = cb; +} + +SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, + const uint8_t *id, + int id_len, + int *out_copy) { + return ctx->get_session_cb; +} + +void SSL_CTX_set_info_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)) { + ctx->info_callback = cb; +} + +void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type, + int value) { + return ctx->info_callback; +} + +void SSL_CTX_set_channel_id_cb(SSL_CTX *ctx, + void (*cb)(SSL *ssl, EVP_PKEY **pkey)) { + ctx->channel_id_cb = cb; +} + +void (*SSL_CTX_get_channel_id_cb(SSL_CTX *ctx))(SSL *ssl, EVP_PKEY **pkey) { + return ctx->channel_id_cb; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back new file mode 100644 index 0000000..77d3f4c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back @@ -0,0 +1,1274 @@ +/* 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 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" + + +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 +// that it needs to asynchronously fetch session information. +static const char g_pending_session_magic = 0; + +static CRYPTO_EX_DATA_CLASS g_ex_data_class = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; + +static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *session); +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) { + 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; + } + + 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) { + UniquePtr new_session = ssl_session_new(session->x509_method); + if (!new_session) { + return nullptr; + } + + new_session->is_server = session->is_server; + new_session->ssl_version = session->ssl_version; + new_session->sid_ctx_length = session->sid_ctx_length; + OPENSSL_memcpy(new_session->sid_ctx, session->sid_ctx, session->sid_ctx_length); + + // Copy the key material. + new_session->master_key_length = session->master_key_length; + OPENSSL_memcpy(new_session->master_key, session->master_key, + session->master_key_length); + new_session->cipher = session->cipher; + + // Copy authentication state. + 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 != 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; + } + } + + if (!session->x509_method->session_dup(new_session.get(), session)) { + return nullptr; + } + + new_session->verify_result = session->verify_result; + + 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); + new_session->peer_sha256_valid = session->peer_sha256_valid; + + new_session->peer_signature_algorithm = session->peer_signature_algorithm; + + new_session->timeout = session->timeout; + new_session->auth_timeout = session->auth_timeout; + new_session->time = session->time; + + // Copy non-authentication connection properties. + if (dup_flags & SSL_SESSION_INCLUDE_NONAUTH) { + new_session->session_id_length = session->session_id_length; + OPENSSL_memcpy(new_session->session_id, session->session_id, + session->session_id_length); + + new_session->group_id = session->group_id; + + OPENSSL_memcpy(new_session->original_handshake_hash, + session->original_handshake_hash, + session->original_handshake_hash_len); + new_session->original_handshake_hash_len = + session->original_handshake_hash_len; + 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 (!new_session->early_alpn.CopyFrom(session->early_alpn)) { + return nullptr; + } + } + + // Copy the ticket. + 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 = true; + return new_session; +} + +void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session) { + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // To avoid overflows and underflows, if we've gone back in time, update the + // time, but mark the session expired. + if (session->time > now.tv_sec) { + session->time = now.tv_sec; + session->timeout = 0; + session->auth_timeout = 0; + return; + } + + // Adjust the session time and timeouts. If the session has already expired, + // clamp the timeouts at zero. + uint64_t delta = now.tv_sec - session->time; + session->time = now.tv_sec; + if (session->timeout < delta) { + session->timeout = 0; + } else { + session->timeout -= delta; + } + if (session->auth_timeout < delta) { + session->auth_timeout = 0; + } else { + session->auth_timeout -= delta; + } +} + +void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, + uint32_t timeout) { + // Rebase the timestamp relative to the current time so |timeout| is measured + // correctly. + ssl_session_rebase_time(ssl, session); + + if (session->timeout > timeout) { + return; + } + + session->timeout = timeout; + if (session->timeout > session->auth_timeout) { + session->timeout = session->auth_timeout; + } +} + +uint16_t ssl_session_protocol_version(const SSL_SESSION *session) { + uint16_t ret; + if (!ssl_protocol_version_from_wire(&ret, session->ssl_version)) { + // An |SSL_SESSION| will never have an invalid version. This is enforced by + // the parser. + assert(0); + return 0; + } + + return ret; +} + +const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session) { + return ssl_get_handshake_digest(ssl_session_protocol_version(session), + session->cipher); +} + +int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server) { + SSL *const ssl = hs->ssl; + if (ssl->mode & SSL_MODE_NO_SESSION_CREATION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SESSION_MAY_NOT_BE_CREATED); + return 0; + } + + UniquePtr session = ssl_session_new(ssl->ctx->x509_method); + if (session == NULL) { + return 0; + } + + session->is_server = is_server; + session->ssl_version = ssl->version; + + // Fill in the time from the |SSL_CTX|'s clock. + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + session->time = now.tv_sec; + + uint16_t version = ssl_protocol_version(ssl); + if (version >= TLS1_3_VERSION) { + // TLS 1.3 uses tickets as authenticators, so we are willing to use them for + // longer. + session->timeout = ssl->session_ctx->session_psk_dhe_timeout; + session->auth_timeout = SSL_DEFAULT_SESSION_AUTH_TIMEOUT; + } else { + // TLS 1.2 resumption does not incorporate new key material, so we use a + // much shorter timeout. + session->timeout = ssl->session_ctx->session_timeout; + session->auth_timeout = ssl->session_ctx->session_timeout; + } + + if (is_server) { + if (hs->ticket_expected || version >= TLS1_3_VERSION) { + // Don't set session IDs for sessions resumed with tickets. This will keep + // them out of the session cache. + session->session_id_length = 0; + } else { + session->session_id_length = SSL3_SSL_SESSION_ID_LENGTH; + if (!RAND_bytes(session->session_id, session->session_id_length)) { + return 0; + } + } + } else { + session->session_id_length = 0; + } + + 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, 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 = true; + session->verify_result = X509_V_ERR_INVALID_CALL; + + hs->new_session = std::move(session); + ssl_set_session(ssl, NULL); + return 1; +} + +int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx) { + OPENSSL_timeval now; + ssl_ctx_get_current_time(ctx, &now); + { + // 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->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->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(); + if (!new_key) { + return 0; + } + 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 dropped below. + ctx->ticket_key_current->next_rotation_tv_sec += + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + ctx->ticket_key_prev = std::move(ctx->ticket_key_current); + } + ctx->ticket_key_current = std::move(new_key); + } + + // Drop an expired prev key. + 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_HANDSHAKE *hs, CBB *out, + const uint8_t *session_buf, + size_t session_len) { + ScopedEVP_CIPHER_CTX ctx; + ScopedHMAC_CTX hctx; + + // If the session is too long, emit a dummy value rather than abort the + // connection. + static const size_t kMaxTicketOverhead = + 16 + EVP_MAX_IV_LENGTH + EVP_MAX_BLOCK_LENGTH + EVP_MAX_MD_SIZE; + if (session_len > 0xffff - kMaxTicketOverhead) { + static const char kTicketPlaceholder[] = "TICKET TOO LARGE"; + return CBB_add_bytes(out, (const uint8_t *)kTicketPlaceholder, + strlen(kTicketPlaceholder)); + } + + // Initialize HMAC and cipher contexts. If callback present it does all the + // work otherwise use generated values from parent ctx. + SSL_CTX *tctx = hs->ssl->session_ctx.get(); + uint8_t iv[EVP_MAX_IV_LENGTH]; + uint8_t key_name[16]; + 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 { + // Rotate ticket key if necessary. + if (!ssl_ctx_rotate_ticket_encryption_key(tctx)) { + return 0; + } + MutexReadLock lock(&tctx->lock); + if (!RAND_bytes(iv, 16) || + !EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_cbc(), NULL, + 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->ticket_key_current->name, 16); + } + + uint8_t *ptr; + if (!CBB_add_bytes(out, key_name, 16) || + !CBB_add_bytes(out, iv, EVP_CIPHER_CTX_iv_length(ctx.get())) || + !CBB_reserve(out, &ptr, session_len + EVP_MAX_BLOCK_LENGTH)) { + return 0; + } + + size_t total = 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + OPENSSL_memcpy(ptr, session_buf, session_len); + total = session_len; +#else + int len; + if (!EVP_EncryptUpdate(ctx.get(), ptr + total, &len, session_buf, session_len)) { + return 0; + } + total += len; + if (!EVP_EncryptFinal_ex(ctx.get(), ptr + total, &len)) { + return 0; + } + total += len; +#endif + if (!CBB_did_write(out, total)) { + return 0; + } + + unsigned hlen; + if (!HMAC_Update(hctx.get(), CBB_data(out), CBB_len(out)) || + !CBB_reserve(out, &ptr, EVP_MAX_MD_SIZE) || + !HMAC_Final(hctx.get(), ptr, &hlen) || + !CBB_did_write(out, hlen)) { + return 0; + } + + return 1; +} + +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; + if (max_out < max_overhead) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + uint8_t *ptr; + if (!CBB_reserve(out, &ptr, max_out)) { + return 0; + } + + size_t out_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; + } + + if (!CBB_did_write(out, out_len)) { + return 0; + } + + return 1; +} + +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; + if (!SSL_SESSION_to_bytes_for_ticket(session, &session_buf, &session_len)) { + return -1; + } + + int ret = 0; + 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(hs, out, session_buf, session_len); + } + + OPENSSL_free(session_buf); + return ret; +} + +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session) { + if (session == NULL) { + return 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) { + if (session == NULL) { + return 0; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // Reject tickets from the future to avoid underflow. + if (now.tv_sec < session->time) { + return 0; + } + + return session->timeout > now.tv_sec - session->time; +} + +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(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. */ + 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.get()) == 0 && + !session->peer_sha256_valid) || + session->peer_sha256_valid == + 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_HANDSHAKE *hs, UniquePtr *out_session, + Span session_id) { + SSL *const ssl = hs->ssl; + out_session->reset(); + + if (session_id.empty() || session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { + return ssl_hs_ok; + } + + UniquePtr session; + // Try the internal cache, if it exists. + if (!(ssl->session_ctx->session_cache_mode & + SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { + 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); + // |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) { + int copy = 1; + session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), + session_id.size(), ©)); + if (!session) { + return ssl_hs_ok; + } + + if (session.get() == SSL_magic_pending_session_ptr()) { + session.release(); // This pointer is not actually owned. + return ssl_hs_pending_session; + } + + // Increment reference count now if the session callback asks us to do so + // (note that if the session structures returned by the callback are shared + // between threads, it must handle the reference count itself [i.e. copy == + // 0], or things won't be thread-safe). + if (copy) { + SSL_SESSION_up_ref(session.get()); + } + + // 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.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.get(), session.get()); + session.reset(); + } + + *out_session = std::move(session); + return ssl_hs_ok; +} + +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(hs->ssl->server); + UniquePtr session; + bool renew_ticket = false; + + // If tickets are disabled, always behave as if no tickets are present. + CBS ticket; + const bool tickets_supported = + !(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: + assert(!session); + break; + case ssl_ticket_aead_error: + return ssl_hs_error; + case ssl_ticket_aead_retry: + return ssl_hs_pending_ticket; + } + } 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( + hs, &session, + MakeConstSpan(client_hello->session_id, client_hello->session_id_len)); + if (lookup_ret != ssl_hs_ok) { + return lookup_ret; + } + } + + *out_session = std::move(session); + *out_tickets_supported = tickets_supported; + *out_renew_ticket = renew_ticket; + return ssl_hs_ok; +} + +static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock) { + int ret = 0; + + if (session != NULL && session->session_id_length != 0) { + if (lock) { + CRYPTO_MUTEX_lock_write(&ctx->lock); + } + SSL_SESSION *found_session = lh_SSL_SESSION_retrieve(ctx->sessions, + session); + if (found_session == session) { + ret = 1; + found_session = lh_SSL_SESSION_delete(ctx->sessions, session); + SSL_SESSION_list_remove(ctx, session); + } + + if (lock) { + CRYPTO_MUTEX_unlock_write(&ctx->lock); + } + + if (ret) { + if (ctx->remove_session_cb != NULL) { + ctx->remove_session_cb(ctx, found_session); + } + SSL_SESSION_free(found_session); + } + } + + return ret; +} + +void ssl_set_session(SSL *ssl, SSL_SESSION *session) { + if (ssl->session.get() == session) { + return; + } + + ssl->session = UpRef(session); +} + +// locked by SSL_CTX in the calling function +static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *session) { + if (session->next == NULL || session->prev == NULL) { + return; + } + + if (session->next == (SSL_SESSION *)&ctx->session_cache_tail) { + // last element in list + if (session->prev == (SSL_SESSION *)&ctx->session_cache_head) { + // only one element in list + ctx->session_cache_head = NULL; + ctx->session_cache_tail = NULL; + } else { + ctx->session_cache_tail = session->prev; + session->prev->next = (SSL_SESSION *)&(ctx->session_cache_tail); + } + } else { + if (session->prev == (SSL_SESSION *)&ctx->session_cache_head) { + // first element in list + ctx->session_cache_head = session->next; + session->next->prev = (SSL_SESSION *)&(ctx->session_cache_head); + } else { // middle of list + session->next->prev = session->prev; + session->prev->next = session->next; + } + } + session->prev = session->next = NULL; +} + +static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session) { + if (session->next != NULL && session->prev != NULL) { + SSL_SESSION_list_remove(ctx, session); + } + + if (ctx->session_cache_head == NULL) { + ctx->session_cache_head = session; + ctx->session_cache_tail = session; + session->prev = (SSL_SESSION *)&(ctx->session_cache_head); + session->next = (SSL_SESSION *)&(ctx->session_cache_tail); + } else { + session->next = ctx->session_cache_head; + session->next->prev = session; + session->prev = (SSL_SESSION *)&(ctx->session_cache_head); + ctx->session_cache_head = session; + } +} + +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(); +} + +int SSL_SESSION_up_ref(SSL_SESSION *session) { + CRYPTO_refcount_inc(&session->references); + return 1; +} + +void SSL_SESSION_free(SSL_SESSION *session) { + if (session == NULL || + !CRYPTO_refcount_dec_and_test_zero(&session->references)) { + return; + } + + session->~ssl_session_st(); + OPENSSL_free(session); +} + +const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, + unsigned *out_len) { + if (out_len != NULL) { + *out_len = session->session_id_length; + } + 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; +} + +uint64_t SSL_SESSION_get_time(const SSL_SESSION *session) { + if (session == NULL) { + // NULL should crash, but silently accept it here for compatibility. + return 0; + } + return session->time; +} + +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. + if (max_out == 0) { + return (size_t)session->master_key_length; + } + if (max_out > (size_t)session->master_key_length) { + max_out = (size_t)session->master_key_length; + } + OPENSSL_memcpy(out, session->master_key, max_out); + return max_out; +} + +uint64_t SSL_SESSION_set_time(SSL_SESSION *session, uint64_t time) { + if (session == NULL) { + return 0; + } + + session->time = time; + return time; +} + +uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout) { + if (session == NULL) { + return 0; + } + + session->timeout = timeout; + session->auth_timeout = 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)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); + return 0; + } + + static_assert(sizeof(session->sid_ctx) < 256, "sid_ctx_len does not fit"); + session->sid_ctx_length = (uint8_t)sid_ctx_len; + OPENSSL_memcpy(session->sid_ctx, sid_ctx, sid_ctx_len); + + return 1; +} + +int SSL_SESSION_should_be_single_use(const SSL_SESSION *session) { + return ssl_session_protocol_version(session) >= TLS1_3_VERSION; +} + +int SSL_SESSION_is_resumable(const SSL_SESSION *session) { + return !session->not_resumable; +} + +int SSL_SESSION_has_ticket(const SSL_SESSION *session) { + 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->ticket.data(); + } + *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->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) { + return (SSL_SESSION *)&g_pending_session_magic; +} + +SSL_SESSION *SSL_get_session(const SSL *ssl) { + // Once the handshake completes we return the established session. Otherwise + // we return the intermediate session, either |session| (for resumption) or + // |new_session| if doing a full handshake. + if (!SSL_in_init(ssl)) { + return ssl->s3->established_session.get(); + } + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs->early_session) { + return hs->early_session.get(); + } + if (hs->new_session) { + return hs->new_session.get(); + } + return ssl->session.get(); +} + +SSL_SESSION *SSL_get1_session(SSL *ssl) { + SSL_SESSION *ret = SSL_get_session(ssl); + if (ret != NULL) { + SSL_SESSION_up_ref(ret); + } + return ret; +} + +int SSL_SESSION_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, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, void *arg) { + return CRYPTO_set_ex_data(&session->ex_data, idx, arg); +} + +void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, int idx) { + return CRYPTO_get_ex_data(&session->ex_data, 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. + UniquePtr owned_session = UpRef(session); + + SSL_SESSION *old_session; + MutexWriteLock lock(&ctx->lock); + if (!lh_SSL_SESSION_insert(ctx->sessions, &old_session, session)) { + return 0; + } + // |ctx->sessions| took ownership of |session| and gave us back a reference to + // |old_session|. (|old_session| may be the same as |session|, in which case + // we traded identical references with |ctx->sessions|.) + owned_session.release(); + owned_session.reset(old_session); + + if (old_session != NULL) { + if (old_session == session) { + // |session| was already in the cache. There are no linked list pointers + // to update. + return 0; + } + + // There was a session ID collision. |old_session| was replaced with + // |session| in the hash table, so |old_session| must be removed from the + // linked list to match. + SSL_SESSION_list_remove(ctx, old_session); + } + + SSL_SESSION_list_add(ctx, session); + + // Enforce any cache size limits. + if (SSL_CTX_sess_get_cache_size(ctx) > 0) { + while (lh_SSL_SESSION_num_items(ctx->sessions) > + SSL_CTX_sess_get_cache_size(ctx)) { + if (!remove_session_lock(ctx, ctx->session_cache_tail, 0)) { + break; + } + } + } + + return 1; +} + +int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session) { + return remove_session_lock(ctx, session, 1); +} + +int SSL_set_session(SSL *ssl, SSL_SESSION *session) { + // SSL_set_session may only be called before the handshake has started. + if (ssl->s3->initial_handshake_complete || + ssl->s3->hs == NULL || + ssl->s3->hs->state != 0) { + abort(); + } + + ssl_set_session(ssl, session); + return 1; +} + +uint32_t SSL_CTX_set_timeout(SSL_CTX *ctx, uint32_t timeout) { + if (ctx == NULL) { + return 0; + } + + // Historically, zero was treated as |SSL_DEFAULT_SESSION_TIMEOUT|. + if (timeout == 0) { + timeout = SSL_DEFAULT_SESSION_TIMEOUT; + } + + uint32_t old_timeout = ctx->session_timeout; + ctx->session_timeout = timeout; + return old_timeout; +} + +uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx) { + if (ctx == NULL) { + return 0; + } + + return ctx->session_timeout; +} + +void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, uint32_t timeout) { + ctx->session_psk_dhe_timeout = timeout; +} + +typedef struct timeout_param_st { + SSL_CTX *ctx; + uint64_t time; + LHASH_OF(SSL_SESSION) *cache; +} TIMEOUT_PARAM; + +static void timeout_doall_arg(SSL_SESSION *session, void *void_param) { + TIMEOUT_PARAM *param = reinterpret_cast(void_param); + + if (param->time == 0 || + session->time + session->timeout < session->time || + param->time > (session->time + session->timeout)) { + // The reason we don't call SSL_CTX_remove_session() is to + // save on locking overhead + (void) lh_SSL_SESSION_delete(param->cache, session); + SSL_SESSION_list_remove(param->ctx, session); + if (param->ctx->remove_session_cb != NULL) { + param->ctx->remove_session_cb(param->ctx, session); + } + SSL_SESSION_free(session); + } +} + +void SSL_CTX_flush_sessions(SSL_CTX *ctx, uint64_t time) { + TIMEOUT_PARAM tp; + + tp.ctx = ctx; + tp.cache = ctx->sessions; + if (tp.cache == NULL) { + return; + } + tp.time = time; + MutexWriteLock lock(&ctx->lock); + lh_SSL_SESSION_doall_arg(tp.cache, timeout_doall_arg, &tp); +} + +void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, SSL_SESSION *session)) { + ctx->new_session_cb = cb; +} + +int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(SSL *ssl, SSL_SESSION *session) { + return ctx->new_session_cb; +} + +void SSL_CTX_sess_set_remove_cb( + SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *session)) { + ctx->remove_session_cb = cb; +} + +void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(SSL_CTX *ctx, + SSL_SESSION *session) { + return ctx->remove_session_cb; +} + +void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, + SSL_SESSION *(*cb)(SSL *ssl, const uint8_t *id, + int id_len, int *out_copy)) { + ctx->get_session_cb = cb; +} + +SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, + const uint8_t *id, + int id_len, + int *out_copy) { + return ctx->get_session_cb; +} + +void SSL_CTX_set_info_callback( + SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)) { + ctx->info_callback = cb; +} + +void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type, + int value) { + return ctx->info_callback; +} + +void SSL_CTX_set_channel_id_cb(SSL_CTX *ctx, + void (*cb)(SSL *ssl, EVP_PKEY **pkey)) { + ctx->channel_id_cb = cb; +} + +void (*SSL_CTX_get_channel_id_cb(SSL_CTX *ctx))(SSL *ssl, EVP_PKEY **pkey) { + return ctx->channel_id_cb; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc new file mode 100644 index 0000000..26cfa80 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc @@ -0,0 +1,224 @@ +/* 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 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 "internal.h" + + +const char *SSL_state_string_long(const SSL *ssl) { + if (ssl->s3->hs == nullptr) { + return "SSL negotiation finished successfully"; + } + + return ssl->server ? ssl_server_handshake_state(ssl->s3->hs.get()) + : ssl_client_handshake_state(ssl->s3->hs.get()); +} + +const char *SSL_state_string(const SSL *ssl) { + return "!!!!!!"; +} + +const char *SSL_alert_type_string_long(int value) { + value >>= 8; + if (value == SSL3_AL_WARNING) { + return "warning"; + } else if (value == SSL3_AL_FATAL) { + return "fatal"; + } + + return "unknown"; +} + +const char *SSL_alert_type_string(int value) { + return "!"; +} + +const char *SSL_alert_desc_string(int value) { + return "!!"; +} + +const char *SSL_alert_desc_string_long(int value) { + switch (value & 0xff) { + case SSL3_AD_CLOSE_NOTIFY: + return "close notify"; + + case SSL3_AD_UNEXPECTED_MESSAGE: + return "unexpected_message"; + + case SSL3_AD_BAD_RECORD_MAC: + return "bad record mac"; + + case SSL3_AD_DECOMPRESSION_FAILURE: + return "decompression failure"; + + case SSL3_AD_HANDSHAKE_FAILURE: + return "handshake failure"; + + case SSL3_AD_NO_CERTIFICATE: + return "no certificate"; + + case SSL3_AD_BAD_CERTIFICATE: + return "bad certificate"; + + case SSL3_AD_UNSUPPORTED_CERTIFICATE: + return "unsupported certificate"; + + case SSL3_AD_CERTIFICATE_REVOKED: + return "certificate revoked"; + + case SSL3_AD_CERTIFICATE_EXPIRED: + return "certificate expired"; + + case SSL3_AD_CERTIFICATE_UNKNOWN: + return "certificate unknown"; + + case SSL3_AD_ILLEGAL_PARAMETER: + return "illegal parameter"; + + case TLS1_AD_DECRYPTION_FAILED: + return "decryption failed"; + + case TLS1_AD_RECORD_OVERFLOW: + return "record overflow"; + + case TLS1_AD_UNKNOWN_CA: + return "unknown CA"; + + case TLS1_AD_ACCESS_DENIED: + return "access denied"; + + case TLS1_AD_DECODE_ERROR: + return "decode error"; + + case TLS1_AD_DECRYPT_ERROR: + return "decrypt error"; + + case TLS1_AD_EXPORT_RESTRICTION: + return "export restriction"; + + case TLS1_AD_PROTOCOL_VERSION: + return "protocol version"; + + case TLS1_AD_INSUFFICIENT_SECURITY: + return "insufficient security"; + + case TLS1_AD_INTERNAL_ERROR: + return "internal error"; + + case SSL3_AD_INAPPROPRIATE_FALLBACK: + return "inappropriate fallback"; + + case TLS1_AD_USER_CANCELLED: + return "user canceled"; + + case TLS1_AD_NO_RENEGOTIATION: + return "no renegotiation"; + + case TLS1_AD_UNSUPPORTED_EXTENSION: + return "unsupported extension"; + + case TLS1_AD_CERTIFICATE_UNOBTAINABLE: + return "certificate unobtainable"; + + case TLS1_AD_UNRECOGNIZED_NAME: + return "unrecognized name"; + + case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE: + return "bad certificate status response"; + + case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE: + return "bad certificate hash value"; + + case TLS1_AD_UNKNOWN_PSK_IDENTITY: + return "unknown PSK identity"; + + case TLS1_AD_CERTIFICATE_REQUIRED: + return "certificate required"; + + default: + return "unknown"; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc.grpc_back new file mode 100644 index 0000000..e1677f0 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc.grpc_back @@ -0,0 +1,224 @@ +/* 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 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 "internal.h" + + +const char *SSL_state_string_long(const SSL *ssl) { + if (ssl->s3->hs == nullptr) { + return "SSL negotiation finished successfully"; + } + + return ssl->server ? ssl_server_handshake_state(ssl->s3->hs.get()) + : ssl_client_handshake_state(ssl->s3->hs.get()); +} + +const char *SSL_state_string(const SSL *ssl) { + return "!!!!!!"; +} + +const char *SSL_alert_type_string_long(int value) { + value >>= 8; + if (value == SSL3_AL_WARNING) { + return "warning"; + } else if (value == SSL3_AL_FATAL) { + return "fatal"; + } + + return "unknown"; +} + +const char *SSL_alert_type_string(int value) { + return "!"; +} + +const char *SSL_alert_desc_string(int value) { + return "!!"; +} + +const char *SSL_alert_desc_string_long(int value) { + switch (value & 0xff) { + case SSL3_AD_CLOSE_NOTIFY: + return "close notify"; + + case SSL3_AD_UNEXPECTED_MESSAGE: + return "unexpected_message"; + + case SSL3_AD_BAD_RECORD_MAC: + return "bad record mac"; + + case SSL3_AD_DECOMPRESSION_FAILURE: + return "decompression failure"; + + case SSL3_AD_HANDSHAKE_FAILURE: + return "handshake failure"; + + case SSL3_AD_NO_CERTIFICATE: + return "no certificate"; + + case SSL3_AD_BAD_CERTIFICATE: + return "bad certificate"; + + case SSL3_AD_UNSUPPORTED_CERTIFICATE: + return "unsupported certificate"; + + case SSL3_AD_CERTIFICATE_REVOKED: + return "certificate revoked"; + + case SSL3_AD_CERTIFICATE_EXPIRED: + return "certificate expired"; + + case SSL3_AD_CERTIFICATE_UNKNOWN: + return "certificate unknown"; + + case SSL3_AD_ILLEGAL_PARAMETER: + return "illegal parameter"; + + case TLS1_AD_DECRYPTION_FAILED: + return "decryption failed"; + + case TLS1_AD_RECORD_OVERFLOW: + return "record overflow"; + + case TLS1_AD_UNKNOWN_CA: + return "unknown CA"; + + case TLS1_AD_ACCESS_DENIED: + return "access denied"; + + case TLS1_AD_DECODE_ERROR: + return "decode error"; + + case TLS1_AD_DECRYPT_ERROR: + return "decrypt error"; + + case TLS1_AD_EXPORT_RESTRICTION: + return "export restriction"; + + case TLS1_AD_PROTOCOL_VERSION: + return "protocol version"; + + case TLS1_AD_INSUFFICIENT_SECURITY: + return "insufficient security"; + + case TLS1_AD_INTERNAL_ERROR: + return "internal error"; + + case SSL3_AD_INAPPROPRIATE_FALLBACK: + return "inappropriate fallback"; + + case TLS1_AD_USER_CANCELLED: + return "user canceled"; + + case TLS1_AD_NO_RENEGOTIATION: + return "no renegotiation"; + + case TLS1_AD_UNSUPPORTED_EXTENSION: + return "unsupported extension"; + + case TLS1_AD_CERTIFICATE_UNOBTAINABLE: + return "certificate unobtainable"; + + case TLS1_AD_UNRECOGNIZED_NAME: + return "unrecognized name"; + + case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE: + return "bad certificate status response"; + + case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE: + return "bad certificate hash value"; + + case TLS1_AD_UNKNOWN_PSK_IDENTITY: + return "unknown PSK identity"; + + case TLS1_AD_CERTIFICATE_REQUIRED: + return "certificate required"; + + default: + return "unknown"; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc new file mode 100644 index 0000000..e5e3fff --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc.grpc_back new file mode 100644 index 0000000..c1cef2b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc new file mode 100644 index 0000000..a4b064e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc.grpc_back new file mode 100644 index 0000000..d95aeb3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc new file mode 100644 index 0000000..c353bc6 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc @@ -0,0 +1,1358 @@ +/* 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" + + +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 +// will likely misbehave and possibly crash or leak memory. +static void check_ssl_x509_method(const SSL *ssl) { + assert(ssl == NULL || ssl->ctx->x509_method == &ssl_crypto_x509_method); +} + +// check_ssl_ctx_x509_method acts like |check_ssl_x509_method|, but for an +// |SSL_CTX|. +static void check_ssl_ctx_x509_method(const SSL_CTX *ctx) { + assert(ctx == NULL || ctx->x509_method == &ssl_crypto_x509_method); +} + +// x509_to_buffer returns a |CRYPTO_BUFFER| that contains the serialised +// contents of |x509|. +static UniquePtr x509_to_buffer(X509 *x509) { + uint8_t *buf = NULL; + int cert_len = i2d_X509(x509, &buf); + if (cert_len <= 0) { + return 0; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(buf, cert_len, NULL)); + OPENSSL_free(buf); + + return buffer; +} + +// new_leafless_chain returns a fresh stack of buffers set to {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; +} + +// ssl_cert_set_chain sets elements 1.. of |cert->chain| to the serialised +// 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 bool ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { + UniquePtr new_chain; + + if (cert->chain != nullptr) { + new_chain.reset(sk_CRYPTO_BUFFER_new_null()); + if (!new_chain) { + return false; + } + + // |leaf| might be NULL if it's a β€œleafless” chain. + 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 = new_leafless_chain(); + if (!new_chain) { + return false; + } + } + + UniquePtr buffer = x509_to_buffer(x509); + if (!buffer || + !PushToStack(new_chain.get(), std::move(buffer))) { + return false; + } + } + + 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 = nullptr; +} + +static void ssl_crypto_x509_cert_flush_cached_chain(CERT *cert) { + sk_X509_pop_free(cert->x509_chain, X509_free); + cert->x509_chain = nullptr; +} + +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); + 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 true; +} + +static void ssl_crypto_x509_cert_clear(CERT *cert) { + ssl_crypto_x509_cert_flush_cached_leaf(cert); + ssl_crypto_x509_cert_flush_cached_chain(cert); + + X509_free(cert->x509_stash); + cert->x509_stash = nullptr; +} + +static void ssl_crypto_x509_cert_free(CERT *cert) { + ssl_crypto_x509_cert_clear(cert); + X509_STORE_free(cert->verify_store); +} + +static void ssl_crypto_x509_cert_dup(CERT *new_cert, const CERT *cert) { + if (cert->verify_store != nullptr) { + X509_STORE_up_ref(cert->verify_store); + new_cert->verify_store = cert->verify_store; + } +} + +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 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; + } + } + } + + 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 false; + } + if (leaf == nullptr) { + 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 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 = chain_without_leaf.release(); + + X509_free(sess->x509_peer); + sess->x509_peer = leaf.release(); + return true; +} + +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 == 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 true; +} + +static void ssl_crypto_x509_session_clear(SSL_SESSION *session) { + X509_free(session->x509_peer); + session->x509_peer = nullptr; + sk_X509_pop_free(session->x509_chain, X509_free); + session->x509_chain = nullptr; + sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); + session->x509_chain_without_leaf = nullptr; +} + +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 == nullptr || sk_X509_num(cert_chain) == 0) { + return false; + } + + 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) || + !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 false; + } + + 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 != nullptr) { + verify_ret = + ssl_ctx->app_verify_callback(ctx.get(), ssl_ctx->app_verify_arg); + } else { + verify_ret = X509_verify_cert(ctx.get()); + } + + session->verify_result = ctx->error; + + // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. + if (verify_ret <= 0 && hs->config->verify_mode != SSL_VERIFY_NONE) { + *out_alert = SSL_alert_from_verify_result(ctx->error); + return false; + } + + ERR_clear_error(); + 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 = nullptr; +} + +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(hs->config->param, hs->ssl->ctx->param); + return true; +} + +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_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 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 ((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(hs->config->cert->chain.get(), 0))); + if (!leaf) { + OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); + return false; + } + + ScopedX509_STORE_CTX ctx; + if (!X509_STORE_CTX_init(ctx.get(), hs->ssl->ctx->cert_store, leaf.get(), + NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); + return false; + } + + // Attempt to build a chain, ignoring the result. + X509_verify_cert(ctx.get()); + ERR_clear_error(); + + // Remove the leaf from the generated chain. + X509_free(sk_X509_shift(ctx->chain)); + + if (!ssl_cert_set_chain(hs->config->cert.get(), ctx->chain)) { + return false; + } + + ssl_crypto_x509_cert_flush_cached_chain(hs->config->cert.get()); + + 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 = nullptr; +} + +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 != nullptr && ctx->param != nullptr); +} + +static void ssl_crypto_x509_ssl_ctx_free(SSL_CTX *ctx) { + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(ctx); + X509_VERIFY_PARAM_free(ctx->param); + X509_STORE_free(ctx->cert_store); +} + +const SSL_X509_METHOD ssl_crypto_x509_method = { + ssl_crypto_x509_check_client_CA_list, + ssl_crypto_x509_cert_clear, + ssl_crypto_x509_cert_free, + ssl_crypto_x509_cert_dup, + ssl_crypto_x509_cert_flush_cached_chain, + ssl_crypto_x509_cert_flush_cached_leaf, + ssl_crypto_x509_session_cache_objects, + ssl_crypto_x509_session_dup, + ssl_crypto_x509_session_clear, + ssl_crypto_x509_session_verify_cert_chain, + ssl_crypto_x509_hs_flush_cached_ca_names, + ssl_crypto_x509_ssl_new, + 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, + ssl_crypto_x509_ssl_ctx_free, + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA, +}; + +BSSL_NAMESPACE_END + +using namespace bssl; + +X509 *SSL_get_peer_certificate(const SSL *ssl) { + check_ssl_x509_method(ssl); + if (ssl == NULL) { + return NULL; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL || session->x509_peer == NULL) { + return NULL; + } + X509_up_ref(session->x509_peer); + return session->x509_peer; +} + +STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl) { + check_ssl_x509_method(ssl); + if (ssl == nullptr) { + return nullptr; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == nullptr) { + return nullptr; + } + + // OpenSSL historically didn't include the leaf certificate in the returned + // certificate chain, but only for servers. + return ssl->server ? session->x509_chain_without_leaf : session->x509_chain; +} + +STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl) { + check_ssl_x509_method(ssl); + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + + return session->x509_chain; +} + +int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); +} + +int SSL_set_purpose(SSL *ssl, int purpose) { + check_ssl_x509_method(ssl); + 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) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set_trust(ctx->param, trust); +} + +int SSL_set_trust(SSL *ssl, int trust) { + check_ssl_x509_method(ssl); + 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) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set1(ctx->param, param); +} + +int SSL_set1_param(SSL *ssl, const X509_VERIFY_PARAM *param) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set1(ssl->config->param, param); +} + +X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->param; +} + +X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl) { + check_ssl_x509_method(ssl); + 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); + 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); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->verify_callback; +} + +int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->verify_mode; +} + +int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_get_depth(ctx->param); +} + +int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( + int ok, X509_STORE_CTX *store_ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->default_verify_callback; +} + +void SSL_set_verify(SSL *ssl, int mode, + int (*callback)(int ok, X509_STORE_CTX *store_ctx)) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; + if (callback != NULL) { + ssl->config->verify_callback = callback; + } +} + +void SSL_set_verify_depth(SSL *ssl, int depth) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return; + } + X509_VERIFY_PARAM_set_depth(ssl->config->param, depth); +} + +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, + int (*cb)(X509_STORE_CTX *store_ctx, + void *arg), + void *arg) { + check_ssl_ctx_x509_method(ctx); + ctx->app_verify_callback = cb; + ctx->app_verify_arg = arg; +} + +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, + int (*cb)(int, X509_STORE_CTX *)) { + check_ssl_ctx_x509_method(ctx); + ctx->verify_mode = mode; + ctx->default_verify_callback = cb; +} + +void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth) { + check_ssl_ctx_x509_method(ctx); + X509_VERIFY_PARAM_set_depth(ctx->param, depth); +} + +int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return X509_STORE_set_default_paths(ctx->cert_store); +} + +int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *ca_file, + const char *ca_dir) { + check_ssl_ctx_x509_method(ctx); + return X509_STORE_load_locations(ctx->cert_store, ca_file, ca_dir); +} + +void SSL_set_verify_result(SSL *ssl, long result) { + check_ssl_x509_method(ssl); + if (result != X509_V_OK) { + abort(); + } +} + +long SSL_get_verify_result(const SSL *ssl) { + check_ssl_x509_method(ssl); + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return X509_V_ERR_INVALID_CALL; + } + return session->verify_result; +} + +X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->cert_store; +} + +void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + X509_STORE_free(ctx->cert_store); + ctx->cert_store = store; +} + +static int ssl_use_certificate(CERT *cert, X509 *x) { + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr buffer = x509_to_buffer(x); + if (!buffer) { + return 0; + } + + return ssl_set_cert(cert, std::move(buffer)); +} + +int SSL_use_certificate(SSL *ssl, X509 *x) { + check_ssl_x509_method(ssl); + 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.get(), x); +} + +// ssl_cert_cache_leaf_cert sets |cert->x509_leaf|, if currently NULL, from the +// first element of |cert->chain|. +static int ssl_cert_cache_leaf_cert(CERT *cert) { + assert(cert->x509_method); + + if (cert->x509_leaf != NULL || + cert->chain == NULL) { + return 1; + } + + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + if (!leaf) { + return 1; + } + + cert->x509_leaf = X509_parse_from_buffer(leaf); + return cert->x509_leaf != NULL; +} + +static X509 *ssl_cert_get0_leaf(CERT *cert) { + if (cert->x509_leaf == NULL && + !ssl_cert_cache_leaf_cert(cert)) { + return NULL; + } + + return cert->x509_leaf; +} + +X509 *SSL_get_certificate(const SSL *ssl) { + check_ssl_x509_method(ssl); + 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.get()); +} + +static int ssl_cert_set0_chain(CERT *cert, STACK_OF(X509) *chain) { + if (!ssl_cert_set_chain(cert, chain)) { + return 0; + } + + sk_X509_pop_free(chain, X509_free); + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_set1_chain(CERT *cert, STACK_OF(X509) *chain) { + if (!ssl_cert_set_chain(cert, chain)) { + return 0; + } + + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_append_cert(CERT *cert, X509 *x509) { + assert(cert->x509_method); + + UniquePtr buffer = x509_to_buffer(x509); + if (!buffer) { + return 0; + } + + if (cert->chain != NULL) { + return PushToStack(cert->chain.get(), std::move(buffer)); + } + + cert->chain = new_leafless_chain(); + if (!cert->chain || + !PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); + return 0; + } + + return 1; +} + +static int ssl_cert_add0_chain_cert(CERT *cert, X509 *x509) { + if (!ssl_cert_append_cert(cert, x509)) { + return 0; + } + + X509_free(cert->x509_stash); + cert->x509_stash = x509; + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_add1_chain_cert(CERT *cert, X509 *x509) { + if (!ssl_cert_append_cert(cert, x509)) { + return 0; + } + + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +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.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.get(), chain); +} + +int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain) { + check_ssl_x509_method(ssl); + 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); + 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.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.get(), x509); +} + +int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_add0_chain_cert(ctx, x509); +} + +int SSL_add0_chain_cert(SSL *ssl, X509 *x509) { + check_ssl_x509_method(ssl); + 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); + 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) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_set0_chain(ctx, NULL); +} + +int SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_clear_chain_certs(ctx); +} + +int SSL_clear_chain_certs(SSL *ssl) { + check_ssl_x509_method(ssl); + return SSL_set0_chain(ssl, NULL); +} + +// ssl_cert_cache_chain_certs fills in |cert->x509_chain| from elements 1.. of +// |cert->chain|. +static int ssl_cert_cache_chain_certs(CERT *cert) { + assert(cert->x509_method); + + if (cert->x509_chain != nullptr || + cert->chain == nullptr || + sk_CRYPTO_BUFFER_num(cert->chain.get()) < 2) { + return 1; + } + + UniquePtr chain(sk_X509_new_null()); + if (!chain) { + return 0; + } + + 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))) { + return 0; + } + } + + cert->x509_chain = chain.release(); + return 1; +} + +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.get())) { + *out_chain = NULL; + return 0; + } + + *out_chain = ctx->cert->x509_chain; + return 1; +} + +int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain) { + return SSL_CTX_get0_chain_certs(ctx, out_chain); +} + +int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain) { + check_ssl_x509_method(ssl); + 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->config->cert->x509_chain; + return 1; +} + +SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **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) { + 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) + +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const uint8_t **pp, long length) { + if (length < 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *pp, length); + + UniquePtr ret = SSL_SESSION_parse(&cbs, &ssl_crypto_x509_method, + NULL /* no buffer pool */); + if (!ret) { + return NULL; + } + + if (a) { + SSL_SESSION_free(*a); + *a = ret.get(); + } + *pp = CBS_data(&cbs); + return ret.release(); +} + +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(UniquePtr *ca_list, + const STACK_OF(X509_NAME) *name_list, + CRYPTO_BUFFER_POOL *pool) { + UniquePtr buffers(sk_CRYPTO_BUFFER_new_null()); + if (!buffers) { + return; + } + + for (X509_NAME *name : name_list) { + uint8_t *outp = NULL; + int len = i2d_X509_NAME(name, &outp); + if (len < 0) { + return; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(outp, len, pool)); + OPENSSL_free(outp); + if (!buffer || + !PushToStack(buffers.get(), std::move(buffer))) { + return; + } + } + + *ca_list = std::move(buffers); +} + +void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list) { + check_ssl_x509_method(ssl); + 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); +} + +void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list) { + check_ssl_ctx_x509_method(ctx); + ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); + set_client_CA_list(&ctx->client_CA, name_list, ctx->pool); + sk_X509_NAME_pop_free(name_list, X509_NAME_free); +} + +static STACK_OF(X509_NAME) * + buffer_names_to_x509(const STACK_OF(CRYPTO_BUFFER) *names, + STACK_OF(X509_NAME) **cached) { + if (names == NULL) { + return NULL; + } + + if (*cached != NULL) { + return *cached; + } + + UniquePtr new_cache(sk_X509_NAME_new_null()); + if (!new_cache) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (const CRYPTO_BUFFER *buffer : names) { + const uint8_t *inp = CRYPTO_BUFFER_data(buffer); + UniquePtr name( + d2i_X509_NAME(nullptr, &inp, CRYPTO_BUFFER_len(buffer))); + if (!name || + inp != CRYPTO_BUFFER_data(buffer) + CRYPTO_BUFFER_len(buffer) || + !PushToStack(new_cache.get(), std::move(name))) { + return NULL; + } + } + + *cached = new_cache.release(); + return *cached; +} + +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 + // |SSL_set_connect_state|. If |do_handshake| is NULL, |ssl| is in an + // indeterminate mode and |ssl->server| is unset. + if (ssl->do_handshake != NULL && !ssl->server) { + if (ssl->s3->hs != NULL) { + return buffer_names_to_x509(ssl->s3->hs->ca_names.get(), + &ssl->s3->hs->cached_x509_ca_names); + } + + return NULL; + } + + if (ssl->config->client_CA != NULL) { + return buffer_names_to_x509( + ssl->config->client_CA.get(), + (STACK_OF(X509_NAME) **)&ssl->config->cached_x509_client_CA); + } + return SSL_CTX_get_client_CA_list(ssl->ctx.get()); +} + +STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + // This is a logically const operation that may be called on multiple threads, + // 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.get(), + const_cast(&ctx->cached_x509_client_CA)); +} + +static int add_client_CA(UniquePtr *names, X509 *x509, + CRYPTO_BUFFER_POOL *pool) { + if (x509 == NULL) { + return 0; + } + + uint8_t *outp = NULL; + int len = i2d_X509_NAME(X509_get_subject_name(x509), &outp); + if (len < 0) { + return 0; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(outp, len, pool)); + OPENSSL_free(outp); + if (!buffer) { + return 0; + } + + int alloced = 0; + if (*names == nullptr) { + names->reset(sk_CRYPTO_BUFFER_new_null()); + alloced = 1; + + if (*names == NULL) { + return 0; + } + } + + if (!PushToStack(names->get(), std::move(buffer))) { + if (alloced) { + names->reset(); + } + return 0; + } + + return 1; +} + +int SSL_add_client_CA(SSL *ssl, X509 *x509) { + check_ssl_x509_method(ssl); + 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->config.get()); + return 1; +} + +int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509) { + check_ssl_ctx_x509_method(ctx); + if (!add_client_CA(&ctx->client_CA, x509, ctx->pool)) { + return 0; + } + + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(ctx); + return 1; +} + +static int do_client_cert_cb(SSL *ssl, void *arg) { + // 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; + } + + X509 *x509 = NULL; + EVP_PKEY *pkey = NULL; + int ret = ssl->ctx->client_cert_cb(ssl, &x509, &pkey); + if (ret < 0) { + return -1; + } + UniquePtr free_x509(x509); + UniquePtr free_pkey(pkey); + + if (ret != 0) { + if (!SSL_use_certificate(ssl, x509) || + !SSL_use_PrivateKey(ssl, pkey)) { + return 0; + } + } + + return 1; +} + +void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, + X509 **out_x509, + EVP_PKEY **out_pkey)) { + check_ssl_ctx_x509_method(ctx); + // Emulate the old client certificate callback with the new one. + SSL_CTX_set_cert_cb(ctx, do_client_cert_cb, NULL); + ctx->client_cert_cb = cb; +} + +static int set_cert_store(X509_STORE **store_ptr, X509_STORE *new_store, + int take_ref) { + X509_STORE_free(*store_ptr); + *store_ptr = new_store; + + if (new_store != NULL && take_ref) { + X509_STORE_up_ref(new_store); + } + + return 1; +} + +int SSL_get_ex_data_X509_STORE_CTX_idx(void) { + // The ex_data index to go from |X509_STORE_CTX| to |SSL| always uses the + // reserved app_data slot. Before ex_data was introduced, app_data was used. + // Avoid breaking any software which assumes |X509_STORE_CTX_get_app_data| + // works. + return 0; +} + +int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + return set_cert_store(&ctx->cert->verify_store, store, 0); +} + +int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + return set_cert_store(&ctx->cert->verify_store, store, 1); +} + +int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store) { + check_ssl_x509_method(ssl); + 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); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 1); +} + +int SSL_alert_from_verify_result(long result) { + switch (result) { + case X509_V_ERR_CERT_CHAIN_TOO_LONG: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_INVALID_CA: + case X509_V_ERR_PATH_LENGTH_EXCEEDED: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + return SSL_AD_UNKNOWN_CA; + + case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: + case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: + case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + case X509_V_ERR_CERT_UNTRUSTED: + case X509_V_ERR_CERT_REJECTED: + case X509_V_ERR_HOSTNAME_MISMATCH: + case X509_V_ERR_EMAIL_MISMATCH: + case X509_V_ERR_IP_ADDRESS_MISMATCH: + return SSL_AD_BAD_CERTIFICATE; + + case X509_V_ERR_CERT_SIGNATURE_FAILURE: + case X509_V_ERR_CRL_SIGNATURE_FAILURE: + return SSL_AD_DECRYPT_ERROR; + + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + case X509_V_ERR_CRL_NOT_YET_VALID: + return SSL_AD_CERTIFICATE_EXPIRED; + + case X509_V_ERR_CERT_REVOKED: + return SSL_AD_CERTIFICATE_REVOKED; + + case X509_V_ERR_UNSPECIFIED: + case X509_V_ERR_OUT_OF_MEM: + case X509_V_ERR_INVALID_CALL: + case X509_V_ERR_STORE_LOOKUP: + return SSL_AD_INTERNAL_ERROR; + + case X509_V_ERR_APPLICATION_VERIFICATION: + return SSL_AD_HANDSHAKE_FAILURE; + + case X509_V_ERR_INVALID_PURPOSE: + return SSL_AD_UNSUPPORTED_CERTIFICATE; + + default: + return SSL_AD_CERTIFICATE_UNKNOWN; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back new file mode 100644 index 0000000..cda7611 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back @@ -0,0 +1,1358 @@ +/* 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" + + +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 +// will likely misbehave and possibly crash or leak memory. +static void check_ssl_x509_method(const SSL *ssl) { + assert(ssl == NULL || ssl->ctx->x509_method == &ssl_crypto_x509_method); +} + +// check_ssl_ctx_x509_method acts like |check_ssl_x509_method|, but for an +// |SSL_CTX|. +static void check_ssl_ctx_x509_method(const SSL_CTX *ctx) { + assert(ctx == NULL || ctx->x509_method == &ssl_crypto_x509_method); +} + +// x509_to_buffer returns a |CRYPTO_BUFFER| that contains the serialised +// contents of |x509|. +static UniquePtr x509_to_buffer(X509 *x509) { + uint8_t *buf = NULL; + int cert_len = i2d_X509(x509, &buf); + if (cert_len <= 0) { + return 0; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(buf, cert_len, NULL)); + OPENSSL_free(buf); + + return buffer; +} + +// new_leafless_chain returns a fresh stack of buffers set to {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; +} + +// ssl_cert_set_chain sets elements 1.. of |cert->chain| to the serialised +// 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 bool ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { + UniquePtr new_chain; + + if (cert->chain != nullptr) { + new_chain.reset(sk_CRYPTO_BUFFER_new_null()); + if (!new_chain) { + return false; + } + + // |leaf| might be NULL if it's a β€œleafless” chain. + 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 = new_leafless_chain(); + if (!new_chain) { + return false; + } + } + + UniquePtr buffer = x509_to_buffer(x509); + if (!buffer || + !PushToStack(new_chain.get(), std::move(buffer))) { + return false; + } + } + + 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 = nullptr; +} + +static void ssl_crypto_x509_cert_flush_cached_chain(CERT *cert) { + sk_X509_pop_free(cert->x509_chain, X509_free); + cert->x509_chain = nullptr; +} + +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); + 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 true; +} + +static void ssl_crypto_x509_cert_clear(CERT *cert) { + ssl_crypto_x509_cert_flush_cached_leaf(cert); + ssl_crypto_x509_cert_flush_cached_chain(cert); + + X509_free(cert->x509_stash); + cert->x509_stash = nullptr; +} + +static void ssl_crypto_x509_cert_free(CERT *cert) { + ssl_crypto_x509_cert_clear(cert); + X509_STORE_free(cert->verify_store); +} + +static void ssl_crypto_x509_cert_dup(CERT *new_cert, const CERT *cert) { + if (cert->verify_store != nullptr) { + X509_STORE_up_ref(cert->verify_store); + new_cert->verify_store = cert->verify_store; + } +} + +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 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; + } + } + } + + 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 false; + } + if (leaf == nullptr) { + 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 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 = chain_without_leaf.release(); + + X509_free(sess->x509_peer); + sess->x509_peer = leaf.release(); + return true; +} + +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 == 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 true; +} + +static void ssl_crypto_x509_session_clear(SSL_SESSION *session) { + X509_free(session->x509_peer); + session->x509_peer = nullptr; + sk_X509_pop_free(session->x509_chain, X509_free); + session->x509_chain = nullptr; + sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); + session->x509_chain_without_leaf = nullptr; +} + +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 == nullptr || sk_X509_num(cert_chain) == 0) { + return false; + } + + 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) || + !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 false; + } + + 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 != nullptr) { + verify_ret = + ssl_ctx->app_verify_callback(ctx.get(), ssl_ctx->app_verify_arg); + } else { + verify_ret = X509_verify_cert(ctx.get()); + } + + session->verify_result = ctx->error; + + // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. + if (verify_ret <= 0 && hs->config->verify_mode != SSL_VERIFY_NONE) { + *out_alert = SSL_alert_from_verify_result(ctx->error); + return false; + } + + ERR_clear_error(); + 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 = nullptr; +} + +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(hs->config->param, hs->ssl->ctx->param); + return true; +} + +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_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 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 ((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(hs->config->cert->chain.get(), 0))); + if (!leaf) { + OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); + return false; + } + + ScopedX509_STORE_CTX ctx; + if (!X509_STORE_CTX_init(ctx.get(), hs->ssl->ctx->cert_store, leaf.get(), + NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); + return false; + } + + // Attempt to build a chain, ignoring the result. + X509_verify_cert(ctx.get()); + ERR_clear_error(); + + // Remove the leaf from the generated chain. + X509_free(sk_X509_shift(ctx->chain)); + + if (!ssl_cert_set_chain(hs->config->cert.get(), ctx->chain)) { + return false; + } + + ssl_crypto_x509_cert_flush_cached_chain(hs->config->cert.get()); + + 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 = nullptr; +} + +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 != nullptr && ctx->param != nullptr); +} + +static void ssl_crypto_x509_ssl_ctx_free(SSL_CTX *ctx) { + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(ctx); + X509_VERIFY_PARAM_free(ctx->param); + X509_STORE_free(ctx->cert_store); +} + +const SSL_X509_METHOD ssl_crypto_x509_method = { + ssl_crypto_x509_check_client_CA_list, + ssl_crypto_x509_cert_clear, + ssl_crypto_x509_cert_free, + ssl_crypto_x509_cert_dup, + ssl_crypto_x509_cert_flush_cached_chain, + ssl_crypto_x509_cert_flush_cached_leaf, + ssl_crypto_x509_session_cache_objects, + ssl_crypto_x509_session_dup, + ssl_crypto_x509_session_clear, + ssl_crypto_x509_session_verify_cert_chain, + ssl_crypto_x509_hs_flush_cached_ca_names, + ssl_crypto_x509_ssl_new, + 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, + ssl_crypto_x509_ssl_ctx_free, + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA, +}; + +BSSL_NAMESPACE_END + +using namespace bssl; + +X509 *SSL_get_peer_certificate(const SSL *ssl) { + check_ssl_x509_method(ssl); + if (ssl == NULL) { + return NULL; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL || session->x509_peer == NULL) { + return NULL; + } + X509_up_ref(session->x509_peer); + return session->x509_peer; +} + +STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl) { + check_ssl_x509_method(ssl); + if (ssl == nullptr) { + return nullptr; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == nullptr) { + return nullptr; + } + + // OpenSSL historically didn't include the leaf certificate in the returned + // certificate chain, but only for servers. + return ssl->server ? session->x509_chain_without_leaf : session->x509_chain; +} + +STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl) { + check_ssl_x509_method(ssl); + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + + return session->x509_chain; +} + +int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); +} + +int SSL_set_purpose(SSL *ssl, int purpose) { + check_ssl_x509_method(ssl); + 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) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set_trust(ctx->param, trust); +} + +int SSL_set_trust(SSL *ssl, int trust) { + check_ssl_x509_method(ssl); + 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) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_set1(ctx->param, param); +} + +int SSL_set1_param(SSL *ssl, const X509_VERIFY_PARAM *param) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set1(ssl->config->param, param); +} + +X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->param; +} + +X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl) { + check_ssl_x509_method(ssl); + 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); + 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); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->verify_callback; +} + +int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->verify_mode; +} + +int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return X509_VERIFY_PARAM_get_depth(ctx->param); +} + +int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( + int ok, X509_STORE_CTX *store_ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->default_verify_callback; +} + +void SSL_set_verify(SSL *ssl, int mode, + int (*callback)(int ok, X509_STORE_CTX *store_ctx)) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; + if (callback != NULL) { + ssl->config->verify_callback = callback; + } +} + +void SSL_set_verify_depth(SSL *ssl, int depth) { + check_ssl_x509_method(ssl); + if (!ssl->config) { + return; + } + X509_VERIFY_PARAM_set_depth(ssl->config->param, depth); +} + +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, + int (*cb)(X509_STORE_CTX *store_ctx, + void *arg), + void *arg) { + check_ssl_ctx_x509_method(ctx); + ctx->app_verify_callback = cb; + ctx->app_verify_arg = arg; +} + +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, + int (*cb)(int, X509_STORE_CTX *)) { + check_ssl_ctx_x509_method(ctx); + ctx->verify_mode = mode; + ctx->default_verify_callback = cb; +} + +void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth) { + check_ssl_ctx_x509_method(ctx); + X509_VERIFY_PARAM_set_depth(ctx->param, depth); +} + +int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return X509_STORE_set_default_paths(ctx->cert_store); +} + +int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *ca_file, + const char *ca_dir) { + check_ssl_ctx_x509_method(ctx); + return X509_STORE_load_locations(ctx->cert_store, ca_file, ca_dir); +} + +void SSL_set_verify_result(SSL *ssl, long result) { + check_ssl_x509_method(ssl); + if (result != X509_V_OK) { + abort(); + } +} + +long SSL_get_verify_result(const SSL *ssl) { + check_ssl_x509_method(ssl); + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return X509_V_ERR_INVALID_CALL; + } + return session->verify_result; +} + +X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return ctx->cert_store; +} + +void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + X509_STORE_free(ctx->cert_store); + ctx->cert_store = store; +} + +static int ssl_use_certificate(CERT *cert, X509 *x) { + if (x == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr buffer = x509_to_buffer(x); + if (!buffer) { + return 0; + } + + return ssl_set_cert(cert, std::move(buffer)); +} + +int SSL_use_certificate(SSL *ssl, X509 *x) { + check_ssl_x509_method(ssl); + 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.get(), x); +} + +// ssl_cert_cache_leaf_cert sets |cert->x509_leaf|, if currently NULL, from the +// first element of |cert->chain|. +static int ssl_cert_cache_leaf_cert(CERT *cert) { + assert(cert->x509_method); + + if (cert->x509_leaf != NULL || + cert->chain == NULL) { + return 1; + } + + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + if (!leaf) { + return 1; + } + + cert->x509_leaf = X509_parse_from_buffer(leaf); + return cert->x509_leaf != NULL; +} + +static X509 *ssl_cert_get0_leaf(CERT *cert) { + if (cert->x509_leaf == NULL && + !ssl_cert_cache_leaf_cert(cert)) { + return NULL; + } + + return cert->x509_leaf; +} + +X509 *SSL_get_certificate(const SSL *ssl) { + check_ssl_x509_method(ssl); + 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.get()); +} + +static int ssl_cert_set0_chain(CERT *cert, STACK_OF(X509) *chain) { + if (!ssl_cert_set_chain(cert, chain)) { + return 0; + } + + sk_X509_pop_free(chain, X509_free); + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_set1_chain(CERT *cert, STACK_OF(X509) *chain) { + if (!ssl_cert_set_chain(cert, chain)) { + return 0; + } + + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_append_cert(CERT *cert, X509 *x509) { + assert(cert->x509_method); + + UniquePtr buffer = x509_to_buffer(x509); + if (!buffer) { + return 0; + } + + if (cert->chain != NULL) { + return PushToStack(cert->chain.get(), std::move(buffer)); + } + + cert->chain = new_leafless_chain(); + if (!cert->chain || + !PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); + return 0; + } + + return 1; +} + +static int ssl_cert_add0_chain_cert(CERT *cert, X509 *x509) { + if (!ssl_cert_append_cert(cert, x509)) { + return 0; + } + + X509_free(cert->x509_stash); + cert->x509_stash = x509; + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +static int ssl_cert_add1_chain_cert(CERT *cert, X509 *x509) { + if (!ssl_cert_append_cert(cert, x509)) { + return 0; + } + + ssl_crypto_x509_cert_flush_cached_chain(cert); + return 1; +} + +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.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.get(), chain); +} + +int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain) { + check_ssl_x509_method(ssl); + 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); + 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.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.get(), x509); +} + +int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_add0_chain_cert(ctx, x509); +} + +int SSL_add0_chain_cert(SSL *ssl, X509 *x509) { + check_ssl_x509_method(ssl); + 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); + 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) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_set0_chain(ctx, NULL); +} + +int SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + return SSL_CTX_clear_chain_certs(ctx); +} + +int SSL_clear_chain_certs(SSL *ssl) { + check_ssl_x509_method(ssl); + return SSL_set0_chain(ssl, NULL); +} + +// ssl_cert_cache_chain_certs fills in |cert->x509_chain| from elements 1.. of +// |cert->chain|. +static int ssl_cert_cache_chain_certs(CERT *cert) { + assert(cert->x509_method); + + if (cert->x509_chain != nullptr || + cert->chain == nullptr || + sk_CRYPTO_BUFFER_num(cert->chain.get()) < 2) { + return 1; + } + + UniquePtr chain(sk_X509_new_null()); + if (!chain) { + return 0; + } + + 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))) { + return 0; + } + } + + cert->x509_chain = chain.release(); + return 1; +} + +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.get())) { + *out_chain = NULL; + return 0; + } + + *out_chain = ctx->cert->x509_chain; + return 1; +} + +int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, + STACK_OF(X509) **out_chain) { + return SSL_CTX_get0_chain_certs(ctx, out_chain); +} + +int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain) { + check_ssl_x509_method(ssl); + 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->config->cert->x509_chain; + return 1; +} + +SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **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) { + 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) + +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const uint8_t **pp, long length) { + if (length < 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *pp, length); + + UniquePtr ret = SSL_SESSION_parse(&cbs, &ssl_crypto_x509_method, + NULL /* no buffer pool */); + if (!ret) { + return NULL; + } + + if (a) { + SSL_SESSION_free(*a); + *a = ret.get(); + } + *pp = CBS_data(&cbs); + return ret.release(); +} + +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(UniquePtr *ca_list, + const STACK_OF(X509_NAME) *name_list, + CRYPTO_BUFFER_POOL *pool) { + UniquePtr buffers(sk_CRYPTO_BUFFER_new_null()); + if (!buffers) { + return; + } + + for (X509_NAME *name : name_list) { + uint8_t *outp = NULL; + int len = i2d_X509_NAME(name, &outp); + if (len < 0) { + return; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(outp, len, pool)); + OPENSSL_free(outp); + if (!buffer || + !PushToStack(buffers.get(), std::move(buffer))) { + return; + } + } + + *ca_list = std::move(buffers); +} + +void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list) { + check_ssl_x509_method(ssl); + 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); +} + +void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list) { + check_ssl_ctx_x509_method(ctx); + ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); + set_client_CA_list(&ctx->client_CA, name_list, ctx->pool); + sk_X509_NAME_pop_free(name_list, X509_NAME_free); +} + +static STACK_OF(X509_NAME) * + buffer_names_to_x509(const STACK_OF(CRYPTO_BUFFER) *names, + STACK_OF(X509_NAME) **cached) { + if (names == NULL) { + return NULL; + } + + if (*cached != NULL) { + return *cached; + } + + UniquePtr new_cache(sk_X509_NAME_new_null()); + if (!new_cache) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return NULL; + } + + for (const CRYPTO_BUFFER *buffer : names) { + const uint8_t *inp = CRYPTO_BUFFER_data(buffer); + UniquePtr name( + d2i_X509_NAME(nullptr, &inp, CRYPTO_BUFFER_len(buffer))); + if (!name || + inp != CRYPTO_BUFFER_data(buffer) + CRYPTO_BUFFER_len(buffer) || + !PushToStack(new_cache.get(), std::move(name))) { + return NULL; + } + } + + *cached = new_cache.release(); + return *cached; +} + +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 + // |SSL_set_connect_state|. If |do_handshake| is NULL, |ssl| is in an + // indeterminate mode and |ssl->server| is unset. + if (ssl->do_handshake != NULL && !ssl->server) { + if (ssl->s3->hs != NULL) { + return buffer_names_to_x509(ssl->s3->hs->ca_names.get(), + &ssl->s3->hs->cached_x509_ca_names); + } + + return NULL; + } + + if (ssl->config->client_CA != NULL) { + return buffer_names_to_x509( + ssl->config->client_CA.get(), + (STACK_OF(X509_NAME) **)&ssl->config->cached_x509_client_CA); + } + return SSL_CTX_get_client_CA_list(ssl->ctx.get()); +} + +STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { + check_ssl_ctx_x509_method(ctx); + // This is a logically const operation that may be called on multiple threads, + // 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.get(), + const_cast(&ctx->cached_x509_client_CA)); +} + +static int add_client_CA(UniquePtr *names, X509 *x509, + CRYPTO_BUFFER_POOL *pool) { + if (x509 == NULL) { + return 0; + } + + uint8_t *outp = NULL; + int len = i2d_X509_NAME(X509_get_subject_name(x509), &outp); + if (len < 0) { + return 0; + } + + UniquePtr buffer(CRYPTO_BUFFER_new(outp, len, pool)); + OPENSSL_free(outp); + if (!buffer) { + return 0; + } + + int alloced = 0; + if (*names == nullptr) { + names->reset(sk_CRYPTO_BUFFER_new_null()); + alloced = 1; + + if (*names == NULL) { + return 0; + } + } + + if (!PushToStack(names->get(), std::move(buffer))) { + if (alloced) { + names->reset(); + } + return 0; + } + + return 1; +} + +int SSL_add_client_CA(SSL *ssl, X509 *x509) { + check_ssl_x509_method(ssl); + 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->config.get()); + return 1; +} + +int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509) { + check_ssl_ctx_x509_method(ctx); + if (!add_client_CA(&ctx->client_CA, x509, ctx->pool)) { + return 0; + } + + ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(ctx); + return 1; +} + +static int do_client_cert_cb(SSL *ssl, void *arg) { + // 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; + } + + X509 *x509 = NULL; + EVP_PKEY *pkey = NULL; + int ret = ssl->ctx->client_cert_cb(ssl, &x509, &pkey); + if (ret < 0) { + return -1; + } + UniquePtr free_x509(x509); + UniquePtr free_pkey(pkey); + + if (ret != 0) { + if (!SSL_use_certificate(ssl, x509) || + !SSL_use_PrivateKey(ssl, pkey)) { + return 0; + } + } + + return 1; +} + +void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, + X509 **out_x509, + EVP_PKEY **out_pkey)) { + check_ssl_ctx_x509_method(ctx); + // Emulate the old client certificate callback with the new one. + SSL_CTX_set_cert_cb(ctx, do_client_cert_cb, NULL); + ctx->client_cert_cb = cb; +} + +static int set_cert_store(X509_STORE **store_ptr, X509_STORE *new_store, + int take_ref) { + X509_STORE_free(*store_ptr); + *store_ptr = new_store; + + if (new_store != NULL && take_ref) { + X509_STORE_up_ref(new_store); + } + + return 1; +} + +int SSL_get_ex_data_X509_STORE_CTX_idx(void) { + // The ex_data index to go from |X509_STORE_CTX| to |SSL| always uses the + // reserved app_data slot. Before ex_data was introduced, app_data was used. + // Avoid breaking any software which assumes |X509_STORE_CTX_get_app_data| + // works. + return 0; +} + +int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + return set_cert_store(&ctx->cert->verify_store, store, 0); +} + +int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { + check_ssl_ctx_x509_method(ctx); + return set_cert_store(&ctx->cert->verify_store, store, 1); +} + +int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store) { + check_ssl_x509_method(ssl); + 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); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 1); +} + +int SSL_alert_from_verify_result(long result) { + switch (result) { + case X509_V_ERR_CERT_CHAIN_TOO_LONG: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_INVALID_CA: + case X509_V_ERR_PATH_LENGTH_EXCEEDED: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + return SSL_AD_UNKNOWN_CA; + + case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: + case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: + case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + case X509_V_ERR_CERT_UNTRUSTED: + case X509_V_ERR_CERT_REJECTED: + case X509_V_ERR_HOSTNAME_MISMATCH: + case X509_V_ERR_EMAIL_MISMATCH: + case X509_V_ERR_IP_ADDRESS_MISMATCH: + return SSL_AD_BAD_CERTIFICATE; + + case X509_V_ERR_CERT_SIGNATURE_FAILURE: + case X509_V_ERR_CRL_SIGNATURE_FAILURE: + return SSL_AD_DECRYPT_ERROR; + + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + case X509_V_ERR_CRL_NOT_YET_VALID: + return SSL_AD_CERTIFICATE_EXPIRED; + + case X509_V_ERR_CERT_REVOKED: + return SSL_AD_CERTIFICATE_REVOKED; + + case X509_V_ERR_UNSPECIFIED: + case X509_V_ERR_OUT_OF_MEM: + case X509_V_ERR_INVALID_CALL: + case X509_V_ERR_STORE_LOOKUP: + return SSL_AD_INTERNAL_ERROR; + + case X509_V_ERR_APPLICATION_VERIFICATION: + return SSL_AD_HANDSHAKE_FAILURE; + + case X509_V_ERR_INVALID_PURPOSE: + return SSL_AD_UNSUPPORTED_CERTIFICATE; + + default: + return SSL_AD_CERTIFICATE_UNKNOWN; + } +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc new file mode 100644 index 0000000..7f8c3b7 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc @@ -0,0 +1,361 @@ +/* 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 + +#include "../crypto/fipsmodule/tls/internal.h" +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool tls1_prf(const EVP_MD *digest, Span out, + Span secret, Span label, + Span seed1, Span seed2) { + return 1 == CRYPTO_tls1_prf(digest, out.data(), out.size(), secret.data(), + secret.size(), label.data(), label.size(), + seed1.data(), seed1.size(), seed2.data(), + seed2.size()); +} + +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) { + const EVP_AEAD *aead = NULL; + if (!ssl_cipher_get_evp_aead(&aead, out_mac_secret_len, out_iv_len, cipher, + ssl_protocol_version(ssl), SSL_is_dtls(ssl))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); + return false; + } + + *out_key_len = EVP_AEAD_key_length(aead); + if (*out_mac_secret_len > 0) { + // For "stateful" AEADs (i.e. compatibility with pre-AEAD cipher suites) the + // key length reported by |EVP_AEAD_key_length| will include the MAC key + // bytes and initial implicit IV. + if (*out_key_len < *out_mac_secret_len + *out_iv_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + *out_key_len -= *out_mac_secret_len + *out_iv_len; + } + + return true; +} + +int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, + Array *key_block_cache, + const SSL_CIPHER *cipher, + Span iv_override) { + size_t mac_secret_len, key_len, iv_len; + if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &iv_len, cipher)) { + return 0; + } + + // Ensure that |key_block_cache| is set up. + const size_t key_block_size = 2 * (mac_secret_len + key_len + iv_len); + if (key_block_cache->empty()) { + if (!key_block_cache->Init(key_block_size) || + !SSL_generate_key_block(ssl, key_block_cache->data(), key_block_size)) { + return 0; + } + } + assert(key_block_cache->size() == key_block_size); + + Span key_block = *key_block_cache; + Span mac_secret, key, iv; + if (direction == (ssl->server ? evp_aead_open : evp_aead_seal)) { + // Use the client write (server read) keys. + mac_secret = key_block.subspan(0, mac_secret_len); + key = key_block.subspan(2 * mac_secret_len, key_len); + iv = key_block.subspan(2 * mac_secret_len + 2 * key_len, iv_len); + } else { + // Use the server write (client read) keys. + mac_secret = key_block.subspan(mac_secret_len, mac_secret_len); + key = key_block.subspan(2 * mac_secret_len + key_len, key_len); + iv = key_block.subspan(2 * mac_secret_len + 2 * key_len + iv_len, iv_len); + } + + if (!iv_override.empty()) { + if (iv_override.size() != iv_len) { + return 0; + } + iv = iv_override; + } + + UniquePtr aead_ctx = SSLAEADContext::Create( + direction, ssl->version, SSL_is_dtls(ssl), cipher, key, mac_secret, iv); + if (!aead_ctx) { + return 0; + } + + if (direction == evp_aead_open) { + return ssl->method->set_read_state(ssl, std::move(aead_ctx)); + } + + return ssl->method->set_write_state(ssl, std::move(aead_ctx)); +} + +int tls1_change_cipher_state(SSL_HANDSHAKE *hs, + evp_aead_direction_t direction) { + return tls1_configure_aead(hs->ssl, direction, &hs->key_block, + hs->new_cipher, {}); +} + +int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, + Span premaster) { + static const char kMasterSecretLabel[] = "master secret"; + static const char kExtendedMasterSecretLabel[] = "extended master secret"; + + const SSL *ssl = hs->ssl; + auto out_span = MakeSpan(out, SSL3_MASTER_SECRET_SIZE); + if (hs->extended_master_secret) { + auto label = MakeConstSpan(kExtendedMasterSecretLabel, + sizeof(kExtendedMasterSecretLabel) - 1); + uint8_t digests[EVP_MAX_MD_SIZE]; + size_t digests_len; + if (!hs->transcript.GetHash(digests, &digests_len) || + !tls1_prf(hs->transcript.Digest(), out_span, premaster, label, + MakeConstSpan(digests, digests_len), {})) { + return 0; + } + } else { + auto label = + MakeConstSpan(kMasterSecretLabel, sizeof(kMasterSecretLabel) - 1); + 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; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +size_t SSL_get_key_block_len(const SSL *ssl) { + size_t mac_secret_len, key_len, fixed_iv_len; + if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &fixed_iv_len, + SSL_get_current_cipher(ssl))) { + ERR_clear_error(); + return 0; + } + + return 2 * (mac_secret_len + key_len + fixed_iv_len); +} + +int SSL_generate_key_block(const SSL *ssl, uint8_t *out, size_t out_len) { + const SSL_SESSION *session = SSL_get_session(ssl); + auto out_span = MakeSpan(out, out_len); + auto master_key = + MakeConstSpan(session->master_key, session->master_key_length); + static const char kLabel[] = "key expansion"; + auto label = MakeConstSpan(kLabel, sizeof(kLabel) - 1); + + 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); +} + +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) { + // 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) && + !SSL_in_false_start(ssl) && + !(SSL_is_server(ssl) && SSL_in_early_data(ssl))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return 0; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + if (!use_context) { + context = nullptr; + context_len = 0; + } + return tls13_export_keying_material( + ssl, MakeSpan(out, out_len), + MakeConstSpan(ssl->s3->exporter_secret, ssl->s3->exporter_secret_len), + MakeConstSpan(label, label_len), MakeConstSpan(context, context_len)); + } + + size_t seed_len = 2 * SSL3_RANDOM_SIZE; + if (use_context) { + if (context_len >= 1u << 16) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + seed_len += 2 + context_len; + } + Array seed; + if (!seed.Init(seed_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(seed.data(), ssl->s3->client_random, SSL3_RANDOM_SIZE); + OPENSSL_memcpy(seed.data() + SSL3_RANDOM_SIZE, ssl->s3->server_random, + SSL3_RANDOM_SIZE); + if (use_context) { + seed[2 * SSL3_RANDOM_SIZE] = static_cast(context_len >> 8); + seed[2 * SSL3_RANDOM_SIZE + 1] = static_cast(context_len); + OPENSSL_memcpy(seed.data() + 2 * SSL3_RANDOM_SIZE + 2, context, context_len); + } + + const SSL_SESSION *session = SSL_get_session(ssl); + const EVP_MD *digest = ssl_session_get_digest(session); + return tls1_prf( + digest, MakeSpan(out, out_len), + MakeConstSpan(session->master_key, session->master_key_length), + MakeConstSpan(label, label_len), seed, {}); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back new file mode 100644 index 0000000..4c2fffb --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back @@ -0,0 +1,361 @@ +/* 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 + +#include "../crypto/fipsmodule/tls/internal.h" +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool tls1_prf(const EVP_MD *digest, Span out, + Span secret, Span label, + Span seed1, Span seed2) { + return 1 == CRYPTO_tls1_prf(digest, out.data(), out.size(), secret.data(), + secret.size(), label.data(), label.size(), + seed1.data(), seed1.size(), seed2.data(), + seed2.size()); +} + +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) { + const EVP_AEAD *aead = NULL; + if (!ssl_cipher_get_evp_aead(&aead, out_mac_secret_len, out_iv_len, cipher, + ssl_protocol_version(ssl), SSL_is_dtls(ssl))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); + return false; + } + + *out_key_len = EVP_AEAD_key_length(aead); + if (*out_mac_secret_len > 0) { + // For "stateful" AEADs (i.e. compatibility with pre-AEAD cipher suites) the + // key length reported by |EVP_AEAD_key_length| will include the MAC key + // bytes and initial implicit IV. + if (*out_key_len < *out_mac_secret_len + *out_iv_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + *out_key_len -= *out_mac_secret_len + *out_iv_len; + } + + return true; +} + +int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, + Array *key_block_cache, + const SSL_CIPHER *cipher, + Span iv_override) { + size_t mac_secret_len, key_len, iv_len; + if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &iv_len, cipher)) { + return 0; + } + + // Ensure that |key_block_cache| is set up. + const size_t key_block_size = 2 * (mac_secret_len + key_len + iv_len); + if (key_block_cache->empty()) { + if (!key_block_cache->Init(key_block_size) || + !SSL_generate_key_block(ssl, key_block_cache->data(), key_block_size)) { + return 0; + } + } + assert(key_block_cache->size() == key_block_size); + + Span key_block = *key_block_cache; + Span mac_secret, key, iv; + if (direction == (ssl->server ? evp_aead_open : evp_aead_seal)) { + // Use the client write (server read) keys. + mac_secret = key_block.subspan(0, mac_secret_len); + key = key_block.subspan(2 * mac_secret_len, key_len); + iv = key_block.subspan(2 * mac_secret_len + 2 * key_len, iv_len); + } else { + // Use the server write (client read) keys. + mac_secret = key_block.subspan(mac_secret_len, mac_secret_len); + key = key_block.subspan(2 * mac_secret_len + key_len, key_len); + iv = key_block.subspan(2 * mac_secret_len + 2 * key_len + iv_len, iv_len); + } + + if (!iv_override.empty()) { + if (iv_override.size() != iv_len) { + return 0; + } + iv = iv_override; + } + + UniquePtr aead_ctx = SSLAEADContext::Create( + direction, ssl->version, SSL_is_dtls(ssl), cipher, key, mac_secret, iv); + if (!aead_ctx) { + return 0; + } + + if (direction == evp_aead_open) { + return ssl->method->set_read_state(ssl, std::move(aead_ctx)); + } + + return ssl->method->set_write_state(ssl, std::move(aead_ctx)); +} + +int tls1_change_cipher_state(SSL_HANDSHAKE *hs, + evp_aead_direction_t direction) { + return tls1_configure_aead(hs->ssl, direction, &hs->key_block, + hs->new_cipher, {}); +} + +int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, + Span premaster) { + static const char kMasterSecretLabel[] = "master secret"; + static const char kExtendedMasterSecretLabel[] = "extended master secret"; + + const SSL *ssl = hs->ssl; + auto out_span = MakeSpan(out, SSL3_MASTER_SECRET_SIZE); + if (hs->extended_master_secret) { + auto label = MakeConstSpan(kExtendedMasterSecretLabel, + sizeof(kExtendedMasterSecretLabel) - 1); + uint8_t digests[EVP_MAX_MD_SIZE]; + size_t digests_len; + if (!hs->transcript.GetHash(digests, &digests_len) || + !tls1_prf(hs->transcript.Digest(), out_span, premaster, label, + MakeConstSpan(digests, digests_len), {})) { + return 0; + } + } else { + auto label = + MakeConstSpan(kMasterSecretLabel, sizeof(kMasterSecretLabel) - 1); + 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; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +size_t SSL_get_key_block_len(const SSL *ssl) { + size_t mac_secret_len, key_len, fixed_iv_len; + if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &fixed_iv_len, + SSL_get_current_cipher(ssl))) { + ERR_clear_error(); + return 0; + } + + return 2 * (mac_secret_len + key_len + fixed_iv_len); +} + +int SSL_generate_key_block(const SSL *ssl, uint8_t *out, size_t out_len) { + const SSL_SESSION *session = SSL_get_session(ssl); + auto out_span = MakeSpan(out, out_len); + auto master_key = + MakeConstSpan(session->master_key, session->master_key_length); + static const char kLabel[] = "key expansion"; + auto label = MakeConstSpan(kLabel, sizeof(kLabel) - 1); + + 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); +} + +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) { + // 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) && + !SSL_in_false_start(ssl) && + !(SSL_is_server(ssl) && SSL_in_early_data(ssl))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return 0; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + if (!use_context) { + context = nullptr; + context_len = 0; + } + return tls13_export_keying_material( + ssl, MakeSpan(out, out_len), + MakeConstSpan(ssl->s3->exporter_secret, ssl->s3->exporter_secret_len), + MakeConstSpan(label, label_len), MakeConstSpan(context, context_len)); + } + + size_t seed_len = 2 * SSL3_RANDOM_SIZE; + if (use_context) { + if (context_len >= 1u << 16) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + seed_len += 2 + context_len; + } + Array seed; + if (!seed.Init(seed_len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(seed.data(), ssl->s3->client_random, SSL3_RANDOM_SIZE); + OPENSSL_memcpy(seed.data() + SSL3_RANDOM_SIZE, ssl->s3->server_random, + SSL3_RANDOM_SIZE); + if (use_context) { + seed[2 * SSL3_RANDOM_SIZE] = static_cast(context_len >> 8); + seed[2 * SSL3_RANDOM_SIZE + 1] = static_cast(context_len); + OPENSSL_memcpy(seed.data() + 2 * SSL3_RANDOM_SIZE + 2, context, context_len); + } + + const SSL_SESSION *session = SSL_get_session(ssl); + const EVP_MD *digest = ssl_session_get_digest(session); + return tls1_prf( + digest, MakeSpan(out, out_len), + MakeConstSpan(session->master_key, session->master_key_length), + MakeConstSpan(label, label_len), seed, {}); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc new file mode 100644 index 0000000..013acaa --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc @@ -0,0 +1,3876 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +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); + uint16_t u2 = *((const uint16_t *)p2); + if (u1 < u2) { + return -1; + } else if (u1 > u2) { + return 1; + } else { + return 0; + } +} + +// Per http://tools.ietf.org/html/rfc5246#section-7.4.1.4, there may not be +// 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 bool tls1_check_duplicate_extensions(const CBS *cbs) { + // First pass: count the extensions. + size_t num_extensions = 0; + CBS extensions = *cbs; + while (CBS_len(&extensions) > 0) { + uint16_t type; + CBS extension; + + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + return false; + } + + num_extensions++; + } + + if (num_extensions == 0) { + return true; + } + + Array extension_types; + if (!extension_types.Init(num_extensions)) { + return false; + } + + // Second pass: gather the extension types. + extensions = *cbs; + for (size_t i = 0; i < extension_types.size(); i++) { + CBS extension; + + if (!CBS_get_u16(&extensions, &extension_types[i]) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + // This should not happen. + return false; + } + } + assert(CBS_len(&extensions) == 0); + + // Sort the extensions and make sure there are no duplicates. + qsort(extension_types.data(), extension_types.size(), sizeof(uint16_t), + compare_uint16_t); + for (size_t i = 1; i < num_extensions; i++) { + if (extension_types[i - 1] == extension_types[i]) { + return false; + } + } + + return true; +} + +static bool is_post_quantum_group(uint16_t id) { + return id == SSL_CURVE_CECPQ2; +} + +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg) { + OPENSSL_memset(out, 0, sizeof(*out)); + out->ssl = const_cast(ssl); + out->client_hello = CBS_data(&msg.body); + out->client_hello_len = CBS_len(&msg.body); + + CBS client_hello, random, session_id; + CBS_init(&client_hello, out->client_hello, out->client_hello_len); + if (!CBS_get_u16(&client_hello, &out->version) || + !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 false; + } + + out->random = CBS_data(&random); + out->random_len = CBS_len(&random); + out->session_id = CBS_data(&session_id); + out->session_id_len = CBS_len(&session_id); + + // Skip past DTLS cookie + if (SSL_is_dtls(out->ssl)) { + CBS cookie; + if (!CBS_get_u8_length_prefixed(&client_hello, &cookie) || + CBS_len(&cookie) > DTLS1_COOKIE_LENGTH) { + return false; + } + } + + CBS cipher_suites, compression_methods; + if (!CBS_get_u16_length_prefixed(&client_hello, &cipher_suites) || + 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 false; + } + + out->cipher_suites = CBS_data(&cipher_suites); + out->cipher_suites_len = CBS_len(&cipher_suites); + out->compression_methods = CBS_data(&compression_methods); + out->compression_methods_len = CBS_len(&compression_methods); + + // If the ClientHello ends here then it's valid, but doesn't have any + // extensions. + if (CBS_len(&client_hello) == 0) { + out->extensions = NULL; + out->extensions_len = 0; + return true; + } + + // Extract extensions and check it is valid. + CBS extensions; + if (!CBS_get_u16_length_prefixed(&client_hello, &extensions) || + !tls1_check_duplicate_extensions(&extensions) || + CBS_len(&client_hello) != 0) { + return false; + } + + out->extensions = CBS_data(&extensions); + out->extensions_len = CBS_len(&extensions); + + return true; +} + +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) { + // Decode the next extension. + uint16_t type; + CBS extension; + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + return false; + } + + if (type == extension_type) { + *out = extension; + return true; + } + } + + return false; +} + +static const uint16_t kDefaultGroups[] = { + SSL_CURVE_X25519, + SSL_CURVE_SECP256R1, + SSL_CURVE_SECP384R1, +}; + +Span tls1_get_grouplist(const SSL_HANDSHAKE *hs) { + if (!hs->config->supported_group_list.empty()) { + return hs->config->supported_group_list; + } + return Span(kDefaultGroups); +} + +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { + SSL *const ssl = hs->ssl; + assert(ssl->server); + + // Clients are not required to send a supported_groups extension. In this + // case, the server is free to pick any group it likes. See RFC 4492, + // section 4, paragraph 3. + // + // However, in the interests of compatibility, we will skip ECDH if the + // client didn't send an extension because we can't be sure that they'll + // support our favoured group. Thus we do not special-case an emtpy + // |peer_supported_group_list|. + + Span groups = tls1_get_grouplist(hs); + Span pref, supp; + if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { + pref = groups; + supp = hs->peer_supported_group_list; + } else { + pref = hs->peer_supported_group_list; + supp = groups; + } + + for (uint16_t pref_group : pref) { + for (uint16_t supp_group : supp) { + 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 true; + } + } + } + + return false; +} + +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 < curves.size(); i++) { + if (!ssl_nid_to_group_id(&group_ids[i], curves[i])) { + return false; + } + } + + *out_group_ids = std::move(group_ids); + return true; +} + +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); + + Array group_ids; + if (!group_ids.Init(count)) { + return false; + } + + size_t i = 0; + ptr = curves; + do { + col = strchr(ptr, ':'); + if (!ssl_name_to_group_id(&group_ids[i++], ptr, + col ? (size_t)(col - ptr) : strlen(ptr))) { + return false; + } + if (col) { + ptr = col + 1; + } + } while (col); + + assert(i == count); + *out_group_ids = std::move(group_ids); + return true; +} + +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 true; + } + } + + return false; +} + +// kVerifySignatureAlgorithms is the default list of accepted signature +// algorithms for verifying. +static const uint16_t kVerifySignatureAlgorithms[] = { + // List our preferred algorithms first. + SSL_SIGN_ED25519, + SSL_SIGN_ECDSA_SECP256R1_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_RSAE_SHA384, + SSL_SIGN_RSA_PKCS1_SHA384, + + 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. +static const uint16_t kSignSignatureAlgorithms[] = { + // List our preferred algorithms first. + SSL_SIGN_ED25519, + SSL_SIGN_ECDSA_SECP256R1_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_RSAE_SHA384, + SSL_SIGN_RSA_PKCS1_SHA384, + + SSL_SIGN_ECDSA_SECP521R1_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, + SSL_SIGN_RSA_PKCS1_SHA512, + + // If the peer supports nothing else, sign with SHA-1. + SSL_SIGN_ECDSA_SHA1, + SSL_SIGN_RSA_PKCS1_SHA1, +}; + +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; + } + + 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) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t verify_sigalg; + while (list.Next(&verify_sigalg)) { + if (verify_sigalg == sigalg) { + return true; + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +// tls_extension represents a TLS extension that is handled internally. The +// |init| function is called for each handshake, before any other functions of +// the extension. Then the add and parse callbacks are called as needed. +// +// The parse callbacks receive a |CBS| that contains the contents of the +// extension (i.e. not including the type and length bytes). If an extension is +// not received then the parse callbacks will be called with a NULL CBS so that +// they can do any processing needed to handle the absence of an extension. +// +// The add callbacks receive a |CBB| to which the extension can be appended but +// the function is responsible for appending the type and length bytes too. +// +// All callbacks return true for success and false for error. If a parse +// function returns zero then a fatal alert with value |*out_alert| will be +// sent. If |*out_alert| isn't set, then a |decode_error| alert will be sent. +struct tls_extension { + uint16_t value; + void (*init)(SSL_HANDSHAKE *hs); + + bool (*add_clienthello)(SSL_HANDSHAKE *hs, CBB *out); + bool (*parse_serverhello)(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents); + + bool (*parse_clienthello)(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents); + bool (*add_serverhello)(SSL_HANDSHAKE *hs, CBB *out); +}; + +static bool forbid_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents != NULL) { + // Servers MUST NOT send this extension. + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + return false; + } + + return true; +} + +static bool ignore_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // This extension from the client is handled elsewhere. + return true; +} + +static bool dont_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + return true; +} + +// Server name indication (SNI). +// +// https://tools.ietf.org/html/rfc6066#section-3. + +static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->hostname == nullptr) { + return true; + } + + CBB contents, server_name_list, name; + if (!CBB_add_u16(out, TLSEXT_TYPE_server_name) || + !CBB_add_u16_length_prefixed(out, &contents) || + !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->hostname.get(), + strlen(ssl->hostname.get())) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_sni_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // The server may acknowledge SNI with an empty extension. We check the syntax + // but otherwise ignore this signal. + return contents == NULL || CBS_len(contents) == 0; +} + +static bool ext_sni_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // SNI has already been parsed earlier in the handshake. See |extract_sni|. + return true; +} + +static bool ext_sni_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (hs->ssl->s3->session_reused || + !hs->should_ack_sni) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_server_name) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Renegotiation indication. +// +// https://tools.ietf.org/html/rfc5746 + +static bool ext_ri_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // Renegotiation indication is not necessary in TLS 1.3. + if (hs->min_version >= TLS1_3_VERSION) { + return true; + } + + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_client_finished_len != 0)); + + CBB contents, prev_finished; + if (!CBB_add_u16(out, TLSEXT_TYPE_renegotiate) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &prev_finished) || + !CBB_add_bytes(&prev_finished, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ri_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents != NULL && ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // Servers may not switch between omitting the extension and supporting it. + // See RFC 5746, sections 3.5 and 4.2. + if (ssl->s3->initial_handshake_complete && + (contents != NULL) != ssl->s3->send_connection_binding) { + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + return false; + } + + if (contents == NULL) { + // Strictly speaking, if we want to avoid an attack we should *always* see + // RI even on initial ServerHello because the client doesn't see any + // renegotiation during an attack. However this would mean we could not + // connect to any server which doesn't support RI. + // + // OpenSSL has |SSL_OP_LEGACY_SERVER_CONNECT| to control this, but in + // practical terms every client sets it so it's just assumed here. + return true; + } + + const size_t expected_len = ssl->s3->previous_client_finished_len + + ssl->s3->previous_server_finished_len; + + // Check for logic errors + assert(!expected_len || ssl->s3->previous_client_finished_len); + assert(!expected_len || ssl->s3->previous_server_finished_len); + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_client_finished_len != 0)); + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_server_finished_len != 0)); + + // Parse out the extension contents. + CBS renegotiated_connection; + if (!CBS_get_u8_length_prefixed(contents, &renegotiated_connection) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_ENCODING_ERR); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // Check that the extension matches. + if (CBS_len(&renegotiated_connection) != expected_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + const uint8_t *d = CBS_data(&renegotiated_connection); + bool ok = CRYPTO_memcmp(d, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; +#endif + if (!ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + d += ssl->s3->previous_client_finished_len; + + ok = CRYPTO_memcmp(d, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; +#endif + if (!ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + ssl->s3->send_connection_binding = true; + + return true; +} + +static bool ext_ri_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + // Renegotiation isn't supported as a server so this function should never be + // called after the initial handshake. + assert(!ssl->s3->initial_handshake_complete); + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents == NULL) { + return true; + } + + CBS renegotiated_connection; + if (!CBS_get_u8_length_prefixed(contents, &renegotiated_connection) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_ENCODING_ERR); + return false; + } + + // Check that the extension matches. We do not support renegotiation as a + // server, so this must be empty. + if (CBS_len(&renegotiated_connection) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + ssl->s3->send_connection_binding = true; + + return true; +} + +static bool ext_ri_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // Renegotiation isn't supported as a server so this function should never be + // called after the initial handshake. + assert(!ssl->s3->initial_handshake_complete); + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_renegotiate) || + !CBB_add_u16(out, 1 /* length */) || + !CBB_add_u8(out, 0 /* empty renegotiation info */)) { + return false; + } + + return true; +} + + +// Extended Master Secret. +// +// https://tools.ietf.org/html/rfc7627 + +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) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_extended_master_secret) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + + if (contents != NULL) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || + CBS_len(contents) != 0) { + return false; + } + + hs->extended_master_secret = true; + } + + // Whether EMS is negotiated may not change on renegotiation. + if (ssl->s3->established_session != nullptr && + hs->extended_master_secret != + !!ssl->s3->established_session->extended_master_secret) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_EMS_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +static bool ext_ems_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents == NULL) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + hs->extended_master_secret = true; + return true; +} + +static bool ext_ems_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->extended_master_secret) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_extended_master_secret) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Session tickets. +// +// https://tools.ietf.org/html/rfc5077 + +static bool ext_ticket_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // TLS 1.3 uses a different ticket extension. + if (hs->min_version >= TLS1_3_VERSION || + SSL_get_options(ssl) & SSL_OP_NO_TICKET) { + return true; + } + + 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 != nullptr && + !ssl->session->ticket.empty() && + // Don't send TLS 1.3 session tickets in the ticket extension. + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + ticket = ssl->session->ticket; + } + + CBB ticket_cbb; + if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || + !CBB_add_u16_length_prefixed(out, &ticket_cbb) || + !CBB_add_bytes(&ticket_cbb, ticket.data(), ticket.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ticket_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // If |SSL_OP_NO_TICKET| is set then no extension will have been sent and + // this function should never be called, even if the server tries to send the + // extension. + assert((SSL_get_options(ssl) & SSL_OP_NO_TICKET) == 0); + + if (CBS_len(contents) != 0) { + return false; + } + + hs->ticket_expected = true; + return true; +} + +static bool ext_ticket_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ticket_expected) { + return true; + } + + // If |SSL_OP_NO_TICKET| is set, |ticket_expected| should never be true. + assert((SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) == 0); + + if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Signature Algorithms. +// +// https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + +static bool ext_sigalgs_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->max_version < TLS1_2_VERSION) { + return true; + } + + CBB contents, sigalgs_cbb; + if (!CBB_add_u16(out, TLSEXT_TYPE_signature_algorithms) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &sigalgs_cbb) || + !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + hs->peer_sigalgs.Reset(); + if (contents == NULL) { + return true; + } + + CBS supported_signature_algorithms; + if (!CBS_get_u16_length_prefixed(contents, &supported_signature_algorithms) || + CBS_len(contents) != 0 || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + return false; + } + + return true; +} + + +// OCSP Stapling. +// +// https://tools.ietf.org/html/rfc6066#section-8 + +static bool ext_ocsp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->config->ocsp_stapling_enabled) { + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_status_request) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || + !CBB_add_u16(&contents, 0 /* empty responder ID list */) || + !CBB_add_u16(&contents, 0 /* empty request extensions */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ocsp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // TLS 1.3 OCSP responses are included in the Certificate extensions. + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // OCSP stapling is forbidden on non-certificate ciphers. + if (CBS_len(contents) != 0 || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + return false; + } + + // Note this does not check for resumption in TLS 1.2. Sending + // status_request here does not make sense, but OpenSSL does so and the + // specification does not say anything. Tolerate it but ignore it. + + hs->certificate_status_expected = true; + return true; +} + +static bool ext_ocsp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + uint8_t status_type; + if (!CBS_get_u8(contents, &status_type)) { + return false; + } + + // We cannot decide whether OCSP stapling will occur yet because the correct + // SSL_CTX might not have been selected. + hs->ocsp_stapling_requested = status_type == TLSEXT_STATUSTYPE_ocsp; + + return true; +} + +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 || hs->config->cert->ocsp_response == NULL || + ssl->s3->session_reused || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + return true; + } + + hs->certificate_status_expected = true; + + return CBB_add_u16(out, TLSEXT_TYPE_status_request) && + CBB_add_u16(out, 0 /* length */); +} + + +// Next protocol negotiation. +// +// https://htmlpreview.github.io/?https://github.com/agl/technotes/blob/master/nextprotoneg.html + +static bool ext_npn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->initial_handshake_complete || + ssl->ctx->next_proto_select_cb == NULL || + SSL_is_dtls(ssl)) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_next_proto_neg) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_npn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // If any of these are false then we should never have sent the NPN + // extension in the ClientHello and thus this function should never have been + // called. + assert(!ssl->s3->initial_handshake_complete); + assert(!SSL_is_dtls(ssl)); + assert(ssl->ctx->next_proto_select_cb != NULL); + + if (!ssl->s3->alpn_selected.empty()) { + // NPN and ALPN may not be negotiated in the same connection. + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN); + return false; + } + + const uint8_t *const orig_contents = CBS_data(contents); + const size_t orig_len = CBS_len(contents); + + while (CBS_len(contents) != 0) { + CBS proto; + if (!CBS_get_u8_length_prefixed(contents, &proto) || + CBS_len(&proto) == 0) { + return false; + } + } + + uint8_t *selected; + uint8_t selected_len; + if (ssl->ctx->next_proto_select_cb( + ssl, &selected, &selected_len, orig_contents, orig_len, + ssl->ctx->next_proto_select_cb_arg) != SSL_TLSEXT_ERR_OK || + !ssl->s3->next_proto_negotiated.CopyFrom( + MakeConstSpan(selected, selected_len))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + hs->next_proto_neg_seen = true; + return true; +} + +static bool ext_npn_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents != NULL && CBS_len(contents) != 0) { + return false; + } + + if (contents == NULL || + ssl->s3->initial_handshake_complete || + ssl->ctx->next_protos_advertised_cb == NULL || + SSL_is_dtls(ssl)) { + return true; + } + + hs->next_proto_neg_seen = true; + return true; +} + +static bool ext_npn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // |next_proto_neg_seen| might have been cleared when an ALPN extension was + // parsed. + if (!hs->next_proto_neg_seen) { + return true; + } + + const uint8_t *npa; + unsigned npa_len; + + if (ssl->ctx->next_protos_advertised_cb( + ssl, &npa, &npa_len, ssl->ctx->next_protos_advertised_cb_arg) != + SSL_TLSEXT_ERR_OK) { + hs->next_proto_neg_seen = false; + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_next_proto_neg) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_bytes(&contents, npa, npa_len) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Signed certificate timestamps. +// +// https://tools.ietf.org/html/rfc6962#section-3.3.1 + +static bool ext_sct_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->config->signed_cert_timestamps_enabled) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_certificate_timestamp) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // TLS 1.3 SCTs are included in the Certificate extensions. + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // 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(hs->config->signed_cert_timestamps_enabled); + + if (!ssl_is_sct_list_valid(contents)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Session resumption uses the original session information. The extension + // should not be sent on resumption, but RFC 6962 did not make it a + // requirement, so tolerate this. + // + // TODO(davidben): Enforce this anyway. + if (!ssl->s3->session_reused) { + 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; + } + } + + return true; +} + +static bool ext_sct_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + hs->scts_requested = true; + return true; +} + +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 || + hs->config->cert->signed_cert_timestamp_list == NULL) { + return true; + } + + CBB contents; + return CBB_add_u16(out, TLSEXT_TYPE_certificate_timestamp) && + CBB_add_u16_length_prefixed(out, &contents) && + CBB_add_bytes( + &contents, + 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); +} + + +// Application-level Protocol Negotiation. +// +// https://tools.ietf.org/html/rfc7301 + +static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->config->alpn_client_proto_list.empty() || + ssl->s3->initial_handshake_complete) { + return true; + } + + CBB contents, proto_list; + 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, hs->config->alpn_client_proto_list.data(), + hs->config->alpn_client_proto_list.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + assert(!ssl->s3->initial_handshake_complete); + 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. + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN); + return false; + } + + // The extension data consists of a ProtocolNameList which must have + // exactly one ProtocolName. Each of these is length-prefixed. + CBS protocol_name_list, protocol_name; + if (!CBS_get_u16_length_prefixed(contents, &protocol_name_list) || + CBS_len(contents) != 0 || + !CBS_get_u8_length_prefixed(&protocol_name_list, &protocol_name) || + // Empty protocol names are forbidden. + CBS_len(&protocol_name) == 0 || + CBS_len(&protocol_name_list) != 0) { + return false; + } + + 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; + } + + if (!ssl->s3->alpn_selected.CopyFrom(protocol_name)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + return true; +} + +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, + Span protocol) { + if (hs->config->alpn_client_proto_list.empty()) { + return false; + } + + 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 = + 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)) { + return false; + } + + if (client_protocol_name == protocol) { + return true; + } + } + + return false; +} + +bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + CBS contents; + if (ssl->ctx->alpn_select_cb == NULL || + !ssl_client_hello_get_extension( + client_hello, &contents, + TLSEXT_TYPE_application_layer_protocol_negotiation)) { + // Ignore ALPN if not configured or no extension was supplied. + return true; + } + + // ALPN takes precedence over NPN. + hs->next_proto_neg_seen = false; + + CBS protocol_name_list; + if (!CBS_get_u16_length_prefixed(&contents, &protocol_name_list) || + CBS_len(&contents) != 0 || + CBS_len(&protocol_name_list) < 2) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Validate the protocol list. + CBS protocol_name_list_copy = protocol_name_list; + while (CBS_len(&protocol_name_list_copy) > 0) { + CBS protocol_name; + + if (!CBS_get_u8_length_prefixed(&protocol_name_list_copy, &protocol_name) || + // Empty protocol names are forbidden. + CBS_len(&protocol_name) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + } + + const uint8_t *selected; + uint8_t selected_len; + if (ssl->ctx->alpn_select_cb( + 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; + return false; + } + } + + return true; +} + +static bool ext_alpn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->alpn_selected.empty()) { + return true; + } + + CBB contents, proto_list, proto; + 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_u8_length_prefixed(&proto_list, &proto) || + !CBB_add_bytes(&proto, ssl->s3->alpn_selected.data(), + ssl->s3->alpn_selected.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Channel ID. +// +// https://tools.ietf.org/html/draft-balfanz-tls-channelid-01 + +static void ext_channel_id_init(SSL_HANDSHAKE *hs) { + 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 (!hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_channel_id) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_channel_id_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + assert(!SSL_is_dtls(ssl)); + assert(hs->config->channel_id_enabled); + + if (CBS_len(contents) != 0) { + return false; + } + + ssl->s3->channel_id_valid = true; + return true; +} + +static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL || !hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + 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->channel_id_valid) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_channel_id) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Secure Real-time Transport Protocol (SRTP) extension. +// +// https://tools.ietf.org/html/rfc5764 + + +static void ext_srtp_init(SSL_HANDSHAKE *hs) { + hs->ssl->s3->srtp_profile = NULL; +} + +static bool ext_srtp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + STACK_OF(SRTP_PROTECTION_PROFILE) *profiles = SSL_get_srtp_profiles(ssl); + if (profiles == NULL || + sk_SRTP_PROTECTION_PROFILE_num(profiles) == 0) { + return true; + } + + CBB contents, profile_ids; + if (!CBB_add_u16(out, TLSEXT_TYPE_srtp) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &profile_ids)) { + return false; + } + + for (const SRTP_PROTECTION_PROFILE *profile : profiles) { + if (!CBB_add_u16(&profile_ids, profile->id)) { + return false; + } + } + + if (!CBB_add_u8(&contents, 0 /* empty use_mki value */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_srtp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // The extension consists of a u16-prefixed profile ID list containing a + // single uint16_t profile ID, then followed by a u8-prefixed srtp_mki field. + // + // See https://tools.ietf.org/html/rfc5764#section-4.1.1 + CBS profile_ids, srtp_mki; + uint16_t profile_id; + if (!CBS_get_u16_length_prefixed(contents, &profile_ids) || + !CBS_get_u16(&profile_ids, &profile_id) || + CBS_len(&profile_ids) != 0 || + !CBS_get_u8_length_prefixed(contents, &srtp_mki) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + return false; + } + + if (CBS_len(&srtp_mki) != 0) { + // Must be no MKI, since we never offer one. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_MKI_VALUE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + STACK_OF(SRTP_PROTECTION_PROFILE) *profiles = SSL_get_srtp_profiles(ssl); + + // Check to see if the server gave us something we support (and presumably + // offered). + for (const SRTP_PROTECTION_PROFILE *profile : profiles) { + if (profile->id == profile_id) { + ssl->s3->srtp_profile = profile; + return true; + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + CBS profile_ids, srtp_mki; + if (!CBS_get_u16_length_prefixed(contents, &profile_ids) || + CBS_len(&profile_ids) < 2 || + !CBS_get_u8_length_prefixed(contents, &srtp_mki) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + return false; + } + // Discard the MKI value for now. + + const STACK_OF(SRTP_PROTECTION_PROFILE) *server_profiles = + SSL_get_srtp_profiles(ssl); + + // Pick the server's most preferred profile. + for (const SRTP_PROTECTION_PROFILE *server_profile : server_profiles) { + CBS profile_ids_tmp; + CBS_init(&profile_ids_tmp, CBS_data(&profile_ids), CBS_len(&profile_ids)); + + while (CBS_len(&profile_ids_tmp) > 0) { + uint16_t profile_id; + if (!CBS_get_u16(&profile_ids_tmp, &profile_id)) { + return false; + } + + if (server_profile->id == profile_id) { + ssl->s3->srtp_profile = server_profile; + return true; + } + } + } + + return true; +} + +static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->srtp_profile == NULL) { + return true; + } + + CBB contents, profile_ids; + 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->s3->srtp_profile->id) || + !CBB_add_u8(&contents, 0 /* empty MKI */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// EC point formats. +// +// https://tools.ietf.org/html/rfc4492#section-5.1.2 + +static bool ext_ec_point_add_extension(SSL_HANDSHAKE *hs, CBB *out) { + CBB contents, formats; + if (!CBB_add_u16(out, TLSEXT_TYPE_ec_point_formats) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &formats) || + !CBB_add_u8(&formats, TLSEXT_ECPOINTFORMAT_uncompressed) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ec_point_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + // The point format extension is unnecessary in TLS 1.3. + if (hs->min_version >= TLS1_3_VERSION) { + return true; + } + + return ext_ec_point_add_extension(hs, out); +} + +static bool ext_ec_point_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return false; + } + + CBS ec_point_format_list; + if (!CBS_get_u8_length_prefixed(contents, &ec_point_format_list) || + CBS_len(contents) != 0) { + return false; + } + + // Per RFC 4492, section 5.1.2, implementations MUST support the uncompressed + // point format. + if (OPENSSL_memchr(CBS_data(&ec_point_format_list), + TLSEXT_ECPOINTFORMAT_uncompressed, + CBS_len(&ec_point_format_list)) == NULL) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +static bool ext_ec_point_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return true; + } + + return ext_ec_point_parse_serverhello(hs, out_alert, contents); +} + +static bool ext_ec_point_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + const uint32_t alg_k = hs->new_cipher->algorithm_mkey; + const uint32_t alg_a = hs->new_cipher->algorithm_auth; + const bool using_ecc = (alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA); + + if (!using_ecc) { + return true; + } + + return ext_ec_point_add_extension(hs, out); +} + + +// Pre Shared Key +// +// 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 == 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.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 == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + return true; + } + + // 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; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + uint32_t ticket_age = 1000 * (now.tv_sec - ssl->session->time); + uint32_t obfuscated_ticket_age = ticket_age + ssl->session->ticket_age_add; + + // 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.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->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) || + !CBB_add_bytes(&binder, zero_binder, binder_len)) { + return false; + } + + hs->needs_psk_binder = true; + return CBB_flush(out); +} + +bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + uint16_t psk_id; + if (!CBS_get_u16(contents, &psk_id) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // We only advertise one PSK identity, so the only legal index is zero. + if (psk_id != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); + *out_alert = SSL_AD_UNKNOWN_PSK_IDENTITY; + return false; + } + + return true; +} + +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) { + // 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) || + !CBS_get_u16_length_prefixed(&identities, out_ticket) || + !CBS_get_u32(&identities, out_obfuscated_ticket_age) || + !CBS_get_u16_length_prefixed(contents, &binders) || + CBS_len(&binders) == 0 || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + *out_binders = binders; + + // Check the syntax of the remaining identities, but do not process them. + size_t num_identities = 1; + while (CBS_len(&identities) != 0) { + CBS unused_ticket; + uint32_t unused_obfuscated_ticket_age; + if (!CBS_get_u16_length_prefixed(&identities, &unused_ticket) || + !CBS_get_u32(&identities, &unused_obfuscated_ticket_age)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + num_identities++; + } + + // Check the syntax of the binders. The value will be checked later if + // resuming. + size_t num_binders = 0; + while (CBS_len(&binders) != 0) { + CBS binder; + if (!CBS_get_u8_length_prefixed(&binders, &binder)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + num_binders++; + } + + if (num_identities != num_binders) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_BINDER_COUNT_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ssl->s3->session_reused) { + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_pre_shared_key) || + !CBB_add_u16_length_prefixed(out, &contents) || + // We only consider the first identity for resumption + !CBB_add_u16(&contents, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Pre-Shared Key Exchange Modes +// +// https://tools.ietf.org/html/rfc8446#section-4.2.9 + +static bool ext_psk_key_exchange_modes_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + if (hs->max_version < TLS1_3_VERSION) { + return true; + } + + CBB contents, ke_modes; + if (!CBB_add_u16(out, TLSEXT_TYPE_psk_key_exchange_modes) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &ke_modes) || + !CBB_add_u8(&ke_modes, SSL_PSK_DHE_KE)) { + return false; + } + + return CBB_flush(out); +} + +static bool ext_psk_key_exchange_modes_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + CBS ke_modes; + if (!CBS_get_u8_length_prefixed(contents, &ke_modes) || + CBS_len(&ke_modes) == 0 || + CBS_len(contents) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // We only support tickets with PSK_DHE_KE. + hs->accept_psk_mode = OPENSSL_memchr(CBS_data(&ke_modes), SSL_PSK_DHE_KE, + CBS_len(&ke_modes)) != NULL; + + return true; +} + + +// Early Data Indication +// +// 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; + // 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) || + !CBB_add_u16(out, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, + 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; + } + + if (!ssl->s3->session_reused) { + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + return false; + } + + ssl->s3->early_data_reason = ssl_early_data_accepted; + ssl->s3->early_data_accepted = true; + return true; +} + +static bool ext_early_data_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL || + ssl_protocol_version(ssl) < TLS1_3_VERSION) { + return true; + } + + if (CBS_len(contents) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + hs->early_data_offered = true; + return true; +} + +static bool ext_early_data_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ssl->s3->early_data_accepted) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_early_data) || + !CBB_add_u16(out, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Key Share +// +// 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; + if (hs->max_version < TLS1_3_VERSION) { + return true; + } + + CBB contents, kse_bytes; + if (!CBB_add_u16(out, TLSEXT_TYPE_key_share) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &kse_bytes)) { + return false; + } + + uint16_t group_id = hs->retry_group; + 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 && + !CBB_add_bytes(&kse_bytes, hs->key_share_bytes.data(), + hs->key_share_bytes.size())) { + return false; + } + hs->key_share_bytes.Reset(); + if (group_id == 0) { + return CBB_flush(out); + } + } else { + // Add a fake group. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + (!CBB_add_u16(&kse_bytes, + ssl_get_grease_value(hs, ssl_grease_group)) || + !CBB_add_u16(&kse_bytes, 1 /* length */) || + !CBB_add_u8(&kse_bytes, 0 /* one byte key share */))) { + return false; + } + + // Predict the most preferred group. + 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); + } + } + + CBB key_exchange; + 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_shares[0]->Offer(&key_exchange) || + !CBB_flush(&kse_bytes)) { + return false; + } + + 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; + } + + return CBB_flush(out); +} + +bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, + Array *out_secret, + uint8_t *out_alert, CBS *contents) { + CBS peer_key; + uint16_t group_id; + if (!CBS_get_u16(contents, &group_id) || + !CBS_get_u16_length_prefixed(contents, &peer_key) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + 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 (!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_shares[0].reset(); + hs->key_shares[1].reset(); + return true; +} + +bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, + Array *out_secret, + uint8_t *out_alert, CBS *contents) { + uint16_t group_id; + CBS key_shares; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_GROUP); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + if (!CBS_get_u16_length_prefixed(contents, &key_shares) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + // Find the corresponding key share. + CBS peer_key; + CBS_init(&peer_key, NULL, 0); + while (CBS_len(&key_shares) > 0) { + uint16_t id; + CBS peer_key_tmp; + if (!CBS_get_u16(&key_shares, &id) || + !CBS_get_u16_length_prefixed(&key_shares, &peer_key_tmp) || + CBS_len(&peer_key_tmp) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (id == group_id) { + if (CBS_len(&peer_key) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_KEY_SHARE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + peer_key = peer_key_tmp; + // Continue parsing the structure to keep peers honest. + } + } + + if (CBS_len(&peer_key) == 0) { + *out_found = false; + out_secret->Reset(); + return true; + } + + // Compute the DH secret. + Array secret; + ScopedCBB public_key; + UniquePtr key_share = SSLKeyShare::Create(group_id); + if (!key_share || + !CBB_init(public_key.get(), 32) || + !key_share->Accept(public_key.get(), &secret, out_alert, peer_key) || + !CBBFinishArray(public_key.get(), &hs->ecdh_public_key)) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + *out_secret = std::move(secret); + *out_found = true; + return true; +} + +bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + uint16_t group_id; + CBB kse_bytes, public_key; + if (!tls1_get_shared_group(hs, &group_id) || + !CBB_add_u16(out, TLSEXT_TYPE_key_share) || + !CBB_add_u16_length_prefixed(out, &kse_bytes) || + !CBB_add_u16(&kse_bytes, group_id) || + !CBB_add_u16_length_prefixed(&kse_bytes, &public_key) || + !CBB_add_bytes(&public_key, hs->ecdh_public_key.data(), + hs->ecdh_public_key.size()) || + !CBB_flush(out)) { + return false; + } + + hs->ecdh_public_key.Reset(); + + hs->new_session->group_id = group_id; + return true; +} + + +// Supported Versions +// +// 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; + if (hs->max_version <= TLS1_2_VERSION) { + return true; + } + + CBB contents, versions; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &versions)) { + return false; + } + + // Add a fake version. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + !CBB_add_u16(&versions, ssl_get_grease_value(hs, ssl_grease_version))) { + return false; + } + + if (!ssl_add_supported_versions(hs, &versions) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Cookie +// +// 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()) { + return true; + } + + CBB contents, cookie; + if (!CBB_add_u16(out, TLSEXT_TYPE_cookie) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &cookie) || + !CBB_add_bytes(&cookie, hs->cookie.data(), hs->cookie.size()) || + !CBB_flush(out)) { + return false; + } + + // The cookie is no longer needed in memory. + hs->cookie.Reset(); + return true; +} + + +// Supported Groups +// +// 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; + CBB contents, groups_bytes; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_groups) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &groups_bytes)) { + return false; + } + + // Add a fake group. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + !CBB_add_u16(&groups_bytes, + ssl_get_grease_value(hs, ssl_grease_group))) { + return false; + } + + 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; + } + } + + return CBB_flush(out); +} + +static bool ext_supported_groups_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + // This extension is not expected to be echoed by servers in TLS 1.2, but some + // BigIP servers send it nonetheless, so do not enforce this. + return true; +} + +static bool parse_u16_array(const CBS *cbs, Array *out) { + CBS copy = *cbs; + if ((CBS_len(©) & 1) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + Array ret; + if (!ret.Init(CBS_len(©) / 2)) { + return false; + } + for (size_t i = 0; i < ret.size(); i++) { + if (!CBS_get_u16(©, &ret[i])) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + assert(CBS_len(©) == 0); + *out = std::move(ret); + return 1; +} + +static bool ext_supported_groups_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + CBS supported_group_list; + if (!CBS_get_u16_length_prefixed(contents, &supported_group_list) || + CBS_len(&supported_group_list) == 0 || + CBS_len(contents) != 0 || + !parse_u16_array(&supported_group_list, &hs->peer_supported_group_list)) { + return false; + } + + return true; +} + +// Token Binding +// +// https://tools.ietf.org/html/draft-ietf-tokbind-negotiation-10 + +// The Token Binding version number currently matches the draft number of +// draft-ietf-tokbind-protocol, and when published as an RFC it will be 0x0100. +// Since there are no wire changes to the protocol from draft 13 through the +// current draft (16), this implementation supports all versions in that range. +static uint16_t kTokenBindingMaxVersion = 16; +static uint16_t kTokenBindingMinVersion = 13; + +static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->config->token_binding_params.empty() || SSL_is_dtls(ssl)) { + return true; + } + + CBB contents, params; + if (!CBB_add_u16(out, TLSEXT_TYPE_token_binding) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16(&contents, kTokenBindingMaxVersion) || + !CBB_add_u8_length_prefixed(&contents, ¶ms) || + !CBB_add_bytes(¶ms, hs->config->token_binding_params.data(), + hs->config->token_binding_params.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr) { + return true; + } + + CBS params_list; + uint16_t version; + uint8_t param; + if (!CBS_get_u16(contents, &version) || + !CBS_get_u8_length_prefixed(contents, ¶ms_list) || + !CBS_get_u8(¶ms_list, ¶m) || + CBS_len(¶ms_list) > 0 || + CBS_len(contents) > 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // The server-negotiated version must be less than or equal to our version. + if (version > kTokenBindingMaxVersion) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // If the server-selected version is less than what we support, then Token + // Binding wasn't negotiated (but the extension was parsed successfully). + if (version < kTokenBindingMinVersion) { + return 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; + } + } + + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +// select_tb_param looks for the first token binding param in +// |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_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) { + hs->ssl->s3->negotiated_token_binding_param = tb_param; + return true; + } + } + } + return false; +} + +static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr || hs->config->token_binding_params.empty()) { + return true; + } + + CBS params; + uint16_t version; + if (!CBS_get_u16(contents, &version) || + !CBS_get_u8_length_prefixed(contents, ¶ms) || + CBS_len(¶ms) == 0 || + CBS_len(contents) > 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // If the client-selected version is less than what we support, then Token + // Binding wasn't negotiated (but the extension was parsed successfully). + if (version < kTokenBindingMinVersion) { + return true; + } + + // If the client-selected version is higher than we support, use our max + // version. Otherwise, use the client's version. + hs->negotiated_token_binding_version = + std::min(version, kTokenBindingMaxVersion); + if (!select_tb_param(hs, params)) { + return 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->s3->token_binding_negotiated) { + return true; + } + + CBB contents, params; + if (!CBB_add_u16(out, TLSEXT_TYPE_token_binding) || + !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->s3->negotiated_token_binding_param) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +// QUIC Transport Parameters + +static bool ext_quic_transport_params_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + 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, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || + !CBB_flush(out)) { + return false; + } + return true; +} + +static bool ext_quic_transport_params_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr) { + return true; + } + // QUIC requires TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return false; + } + + return ssl->s3->peer_quic_transport_params.CopyFrom(*contents); +} + +static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (!contents || hs->config->quic_transport_params.empty()) { + return true; + } + // Ignore the extension before TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + return true; + } + + return ssl->s3->peer_quic_transport_params.CopyFrom(*contents); +} + +static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, + CBB *out) { + 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, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || + !CBB_flush(out)) { + return false; + } + + 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_server_name, + NULL, + ext_sni_add_clienthello, + ext_sni_parse_serverhello, + ext_sni_parse_clienthello, + ext_sni_add_serverhello, + }, + { + TLSEXT_TYPE_extended_master_secret, + NULL, + ext_ems_add_clienthello, + ext_ems_parse_serverhello, + 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, + ext_ticket_add_clienthello, + ext_ticket_parse_serverhello, + // Ticket extension client parsing is handled in ssl_session.c + ignore_parse_clienthello, + ext_ticket_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_status_request, + NULL, + ext_ocsp_add_clienthello, + ext_ocsp_parse_serverhello, + 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, + ext_npn_add_clienthello, + ext_npn_parse_serverhello, + ext_npn_parse_clienthello, + ext_npn_add_serverhello, + }, + { + TLSEXT_TYPE_certificate_timestamp, + NULL, + ext_sct_add_clienthello, + ext_sct_parse_serverhello, + ext_sct_parse_clienthello, + ext_sct_add_serverhello, + }, + { + TLSEXT_TYPE_channel_id, + ext_channel_id_init, + ext_channel_id_add_clienthello, + ext_channel_id_parse_serverhello, + ext_channel_id_parse_clienthello, + ext_channel_id_add_serverhello, + }, + { + TLSEXT_TYPE_srtp, + ext_srtp_init, + ext_srtp_add_clienthello, + ext_srtp_parse_serverhello, + ext_srtp_parse_clienthello, + ext_srtp_add_serverhello, + }, + { + TLSEXT_TYPE_key_share, + NULL, + ext_key_share_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_psk_key_exchange_modes, + NULL, + ext_psk_key_exchange_modes_add_clienthello, + forbid_parse_serverhello, + ext_psk_key_exchange_modes_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_early_data, + NULL, + ext_early_data_add_clienthello, + ext_early_data_parse_serverhello, + ext_early_data_parse_clienthello, + ext_early_data_add_serverhello, + }, + { + TLSEXT_TYPE_supported_versions, + NULL, + ext_supported_versions_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_cookie, + NULL, + ext_cookie_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_quic_transport_parameters, + NULL, + ext_quic_transport_params_add_clienthello, + ext_quic_transport_params_parse_serverhello, + ext_quic_transport_params_parse_clienthello, + ext_quic_transport_params_add_serverhello, + }, + { + TLSEXT_TYPE_token_binding, + NULL, + ext_token_binding_add_clienthello, + ext_token_binding_parse_serverhello, + 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)) + +static_assert(kNumExtensions <= + sizeof(((SSL_HANDSHAKE *)NULL)->extensions.sent) * 8, + "too many extensions for sent bitset"); +static_assert(kNumExtensions <= + sizeof(((SSL_HANDSHAKE *)NULL)->extensions.received) * 8, + "too many extensions for received bitset"); + +static const struct tls_extension *tls_extension_find(uint32_t *out_index, + uint16_t value) { + unsigned i; + for (i = 0; i < kNumExtensions; i++) { + if (kExtensions[i].value == value) { + *out_index = i; + return &kExtensions[i]; + } + } + + return NULL; +} + +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, + size_t header_len) { + SSL *const ssl = hs->ssl; + CBB extensions; + if (!CBB_add_u16_length_prefixed(out, &extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + 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; + + for (size_t i = 0; i < kNumExtensions; i++) { + if (kExtensions[i].init != NULL) { + kExtensions[i].init(hs); + } + } + + uint16_t grease_ext1 = 0; + if (ssl->ctx->grease_enabled) { + // Add a fake empty extension. See draft-davidben-tls-grease-01. + grease_ext1 = ssl_get_grease_value(hs, ssl_grease_extension1); + if (!CBB_add_u16(&extensions, grease_ext1) || + !CBB_add_u16(&extensions, 0 /* zero length */)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + 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 false; + } + + const size_t bytes_written = CBB_len(&extensions) - len_before; + if (bytes_written != 0) { + hs->extensions.sent |= (1u << i); + } + // 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) { + // Add a fake non-empty extension. See draft-davidben-tls-grease-01. + uint16_t grease_ext2 = ssl_get_grease_value(hs, ssl_grease_extension2); + + // The two fake extensions must not have the same value. GREASE values are + // of the form 0x1a1a, 0x2a2a, 0x3a3a, etc., so XOR to generate a different + // one. + if (grease_ext1 == grease_ext2) { + grease_ext2 ^= 0x1010; + } + + if (!CBB_add_u16(&extensions, grease_ext2) || + !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 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) { + // 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 + // https://crbug.com/363583. + if (padding_len >= 4 + 1) { + padding_len -= 4; + } 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 false; + } + + OPENSSL_memset(padding_bytes, 0, padding_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 false; + } + + // Discard empty extensions blocks. + if (CBB_len(&extensions) == 0) { + CBB_discard_child(out); + } + + return CBB_flush(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)) { + goto err; + } + + for (unsigned i = 0; i < kNumExtensions; i++) { + if (!(hs->extensions.received & (1u << i))) { + // Don't send extensions that were not received. + continue; + } + + if (!kExtensions[i].add_serverhello(hs, &extensions)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + goto err; + } + } + + // Discard empty extensions blocks before TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION && + CBB_len(&extensions) == 0) { + CBB_discard_child(out); + } + + return CBB_flush(out); + +err: + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; +} + +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); + } + } + + hs->extensions.received = 0; + CBS extensions; + CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); + while (CBS_len(&extensions) != 0) { + uint16_t type; + CBS extension; + + // Decode the next extension. + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + unsigned ext_index; + const struct tls_extension *const ext = + tls_extension_find(&ext_index, type); + if (ext == NULL) { + continue; + } + + hs->extensions.received |= (1u << ext_index); + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ext->parse_clienthello(hs, &alert, &extension)) { + *out_alert = alert; + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + return false; + } + } + + for (size_t i = 0; i < kNumExtensions; i++) { + if (hs->extensions.received & (1u << i)) { + continue; + } + + CBS *contents = NULL, fake_contents; + static const uint8_t kFakeRenegotiateExtension[] = {0}; + if (kExtensions[i].value == TLSEXT_TYPE_renegotiate && + ssl_client_cipher_list_contains_cipher(client_hello, + SSL3_CK_SCSV & 0xffff)) { + // The renegotiation SCSV was received so pretend that we received a + // renegotiation extension. + CBS_init(&fake_contents, kFakeRenegotiateExtension, + sizeof(kFakeRenegotiateExtension)); + contents = &fake_contents; + hs->extensions.received |= (1u << i); + } + + // Extension wasn't observed so call the callback with a NULL + // parameter. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!kExtensions[i].parse_clienthello(hs, &alert, contents)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + *out_alert = alert; + return false; + } + } + + return true; +} + +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)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + if (!ssl_check_clienthello_tlsext(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_TLSEXT); + return false; + } + + return true; +} + +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 true; + } + + // Decode the extensions block and check it is valid. + CBS extensions; + if (!CBS_get_u16_length_prefixed(cbs, &extensions) || + !tls1_check_duplicate_extensions(&extensions)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + uint32_t received = 0; + while (CBS_len(&extensions) != 0) { + uint16_t type; + CBS extension; + + // Decode the next extension. + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + unsigned ext_index; + const struct tls_extension *const ext = + tls_extension_find(&ext_index, type); + + if (ext == NULL) { + 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))) { + // 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 false; + } + + received |= (1u << ext_index); + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ext->parse_serverhello(hs, &alert, &extension)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + *out_alert = alert; + return false; + } + } + + for (size_t i = 0; i < kNumExtensions; i++) { + if (!(received & (1u << i))) { + // Extension wasn't observed so call the callback with a NULL + // parameter. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!kExtensions[i].parse_serverhello(hs, &alert, NULL)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + *out_alert = alert; + return false; + } + } + } + + return true; +} + +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + 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 false; + } + + int ret = SSL_TLSEXT_ERR_NOACK; + int al = SSL_AD_UNRECOGNIZED_NAME; + + 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 false; + + case SSL_TLSEXT_ERR_NOACK: + hs->should_ack_sni = false; + return true; + + default: + return true; + } +} + +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)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + return true; +} + +static enum ssl_ticket_aead_result_t decrypt_ticket_with_cipher_ctx( + 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.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; + } + // 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); + 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 = true; +#endif + if (!mac_ok) { + return ssl_ticket_aead_ignore_ticket; + } + + // Decrypt the session data. + 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; + } +#else + 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.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.Shrink(static_cast(len1) + len2); +#endif + + *out = std::move(plaintext); + return ssl_ticket_aead_success; +} + +static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( + 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; + 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) { + return ssl_ticket_aead_ignore_ticket; + } else if (cb_ret == 2) { + *out_renew_ticket = true; + } else { + assert(cb_ret == 1); + } + 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_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 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; + } + if (!HMAC_Init_ex(hmac_ctx.get(), key->hmac_key, sizeof(key->hmac_key), + tlsext_tick_md(), NULL) || + !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, cipher_ctx.get(), hmac_ctx.get(), + ticket); +} + +static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_method( + 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 = + 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; + } + + plaintext.Shrink(plaintext_len); + *out = std::move(plaintext); + return ssl_ticket_aead_success; +} + +enum ssl_ticket_aead_result_t ssl_process_ticket( + 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(hs->ssl) & SSL_OP_NO_TICKET) || + session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { + return ssl_ticket_aead_ignore_ticket; + } + + Array plaintext; + enum ssl_ticket_aead_result_t result; + 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 |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 (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(hs, &plaintext, ticket); + } + } + + if (result != ssl_ticket_aead_success) { + return result; + } + + // Decode the session. + 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; + } + + // Copy the client's session ID into the new session, to denote the ticket has + // been accepted. + 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; +} + +bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *in_sigalgs) { + // Extension ignored for inappropriate versions + if (ssl_protocol_version(hs->ssl) < TLS1_2_VERSION) { + return true; + } + + // 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) { + switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + *out = SSL_SIGN_RSA_PKCS1_MD5_SHA1; + return true; + case EVP_PKEY_EC: + *out = SSL_SIGN_ECDSA_SHA1; + return true; + default: + return false; + } +} + +bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { + SSL *const ssl = hs->ssl; + 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. + if (ssl_protocol_version(ssl) < TLS1_2_VERSION) { + if (!tls1_get_legacy_signature_algorithm(out, hs->local_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS); + return false; + } + return true; + } + + Span sigalgs = kSignSignatureAlgorithms; + 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 = 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 + // negotiated. + if (sigalg == SSL_SIGN_RSA_PKCS1_MD5_SHA1 || + !ssl_private_key_supports_signature_algorithm(hs, sigalg)) { + continue; + } + + for (uint16_t peer_sigalg : peer_sigalgs) { + if (sigalg == peer_sigalg) { + *out = sigalg; + return true; + } + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS); + return false; +} + +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. + uint16_t extension_type; + CBS channel_id = msg.body, extension; + if (!CBS_get_u16(&channel_id, &extension_type) || + !CBS_get_u16_length_prefixed(&channel_id, &extension) || + CBS_len(&channel_id) != 0 || + extension_type != TLSEXT_TYPE_channel_id || + 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 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 false; + } + + UniquePtr sig(ECDSA_SIG_new()); + UniquePtr x(BN_new()), y(BN_new()); + if (!sig || !x || !y) { + return false; + } + + const uint8_t *p = CBS_data(&extension); + if (BN_bin2bn(p + 0, 32, x.get()) == NULL || + 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 false; + } + + UniquePtr key(EC_KEY_new()); + UniquePtr point(EC_POINT_new(p256.get())); + if (!key || !point || + !EC_POINT_set_affine_coordinates_GFp(p256.get(), point.get(), x.get(), + y.get(), nullptr) || + !EC_KEY_set_group(key.get(), p256.get()) || + !EC_KEY_set_public_key(key.get(), point.get())) { + return false; + } + + uint8_t digest[EVP_MAX_MD_SIZE]; + size_t digest_len; + if (!tls1_channel_id_hash(hs, digest, &digest_len)) { + return false; + } + + bool sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + 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->channel_id_valid = false; + return false; + } + + OPENSSL_memcpy(ssl->s3->channel_id, p, 64); + return true; +} + +bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { + 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(hs->config->channel_id_private.get()); + if (ec_key == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + UniquePtr x(BN_new()), y(BN_new()); + if (!x || !y || + !EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ec_key), + EC_KEY_get0_public_key(ec_key), + x.get(), y.get(), nullptr)) { + return false; + } + + UniquePtr sig(ECDSA_do_sign(digest, digest_len, ec_key)); + if (!sig) { + return false; + } + + CBB child; + if (!CBB_add_u16(cbb, TLSEXT_TYPE_channel_id) || + !CBB_add_u16_length_prefixed(cbb, &child) || + !BN_bn2cbb_padded(&child, 32, x.get()) || + !BN_bn2cbb_padded(&child, 32, y.get()) || + !BN_bn2cbb_padded(&child, 32, sig->r) || + !BN_bn2cbb_padded(&child, 32, sig->s) || + !CBB_flush(cbb)) { + return false; + } + + return true; +} + +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 false; + } + SHA256(msg.data(), msg.size(), out); + *out_len = SHA256_DIGEST_LENGTH; + return true; + } + + SHA256_CTX ctx; + + SHA256_Init(&ctx); + static const char kClientIDMagic[] = "TLS Channel ID signature"; + SHA256_Update(&ctx, kClientIDMagic, sizeof(kClientIDMagic)); + + if (ssl->session != NULL) { + static const char kResumptionMagic[] = "Resumption"; + SHA256_Update(&ctx, kResumptionMagic, sizeof(kResumptionMagic)); + if (ssl->session->original_handshake_hash_len == 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + SHA256_Update(&ctx, ssl->session->original_handshake_hash, + ssl->session->original_handshake_hash_len); + } + + uint8_t hs_hash[EVP_MAX_MD_SIZE]; + size_t hs_hash_len; + if (!hs->transcript.GetHash(hs_hash, &hs_hash_len)) { + return false; + } + SHA256_Update(&ctx, hs_hash, (size_t)hs_hash_len); + SHA256_Final(out, &ctx); + *out_len = SHA256_DIGEST_LENGTH; + return true; +} + +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 false; + } + + static_assert( + sizeof(hs->new_session->original_handshake_hash) == EVP_MAX_MD_SIZE, + "original_handshake_hash is too small"); + + size_t digest_len; + if (!hs->transcript.GetHash(hs->new_session->original_handshake_hash, + &digest_len)) { + 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 true; +} + +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; + hs->ssl->ctx->channel_id_cb(hs->ssl, &key); + if (key == NULL) { + // The caller should try again later. + return true; + } + + UniquePtr free_key(key); + return SSL_set1_tls_channel_id(hs->ssl, key); +} + +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. + CBS copy = *contents; + CBS sct_list; + if (!CBS_get_u16_length_prefixed(©, &sct_list) || + CBS_len(©) != 0 || + CBS_len(&sct_list) == 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 false; + } + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_early_callback_ctx_extension_get(const SSL_CLIENT_HELLO *client_hello, + uint16_t extension_type, + const uint8_t **out_data, + size_t *out_len) { + CBS cbs; + if (!ssl_client_hello_get_extension(client_hello, &cbs, extension_type)) { + return 0; + } + + *out_data = CBS_data(&cbs); + *out_len = CBS_len(&cbs); + return 1; +} + +void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled) { + ctx->ed25519_enabled = !!enabled; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back new file mode 100644 index 0000000..7958b5c --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back @@ -0,0 +1,3876 @@ +/* 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). */ + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +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); + uint16_t u2 = *((const uint16_t *)p2); + if (u1 < u2) { + return -1; + } else if (u1 > u2) { + return 1; + } else { + return 0; + } +} + +// Per http://tools.ietf.org/html/rfc5246#section-7.4.1.4, there may not be +// 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 bool tls1_check_duplicate_extensions(const CBS *cbs) { + // First pass: count the extensions. + size_t num_extensions = 0; + CBS extensions = *cbs; + while (CBS_len(&extensions) > 0) { + uint16_t type; + CBS extension; + + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + return false; + } + + num_extensions++; + } + + if (num_extensions == 0) { + return true; + } + + Array extension_types; + if (!extension_types.Init(num_extensions)) { + return false; + } + + // Second pass: gather the extension types. + extensions = *cbs; + for (size_t i = 0; i < extension_types.size(); i++) { + CBS extension; + + if (!CBS_get_u16(&extensions, &extension_types[i]) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + // This should not happen. + return false; + } + } + assert(CBS_len(&extensions) == 0); + + // Sort the extensions and make sure there are no duplicates. + qsort(extension_types.data(), extension_types.size(), sizeof(uint16_t), + compare_uint16_t); + for (size_t i = 1; i < num_extensions; i++) { + if (extension_types[i - 1] == extension_types[i]) { + return false; + } + } + + return true; +} + +static bool is_post_quantum_group(uint16_t id) { + return id == SSL_CURVE_CECPQ2; +} + +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg) { + OPENSSL_memset(out, 0, sizeof(*out)); + out->ssl = const_cast(ssl); + out->client_hello = CBS_data(&msg.body); + out->client_hello_len = CBS_len(&msg.body); + + CBS client_hello, random, session_id; + CBS_init(&client_hello, out->client_hello, out->client_hello_len); + if (!CBS_get_u16(&client_hello, &out->version) || + !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 false; + } + + out->random = CBS_data(&random); + out->random_len = CBS_len(&random); + out->session_id = CBS_data(&session_id); + out->session_id_len = CBS_len(&session_id); + + // Skip past DTLS cookie + if (SSL_is_dtls(out->ssl)) { + CBS cookie; + if (!CBS_get_u8_length_prefixed(&client_hello, &cookie) || + CBS_len(&cookie) > DTLS1_COOKIE_LENGTH) { + return false; + } + } + + CBS cipher_suites, compression_methods; + if (!CBS_get_u16_length_prefixed(&client_hello, &cipher_suites) || + 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 false; + } + + out->cipher_suites = CBS_data(&cipher_suites); + out->cipher_suites_len = CBS_len(&cipher_suites); + out->compression_methods = CBS_data(&compression_methods); + out->compression_methods_len = CBS_len(&compression_methods); + + // If the ClientHello ends here then it's valid, but doesn't have any + // extensions. + if (CBS_len(&client_hello) == 0) { + out->extensions = NULL; + out->extensions_len = 0; + return true; + } + + // Extract extensions and check it is valid. + CBS extensions; + if (!CBS_get_u16_length_prefixed(&client_hello, &extensions) || + !tls1_check_duplicate_extensions(&extensions) || + CBS_len(&client_hello) != 0) { + return false; + } + + out->extensions = CBS_data(&extensions); + out->extensions_len = CBS_len(&extensions); + + return true; +} + +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) { + // Decode the next extension. + uint16_t type; + CBS extension; + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + return false; + } + + if (type == extension_type) { + *out = extension; + return true; + } + } + + return false; +} + +static const uint16_t kDefaultGroups[] = { + SSL_CURVE_X25519, + SSL_CURVE_SECP256R1, + SSL_CURVE_SECP384R1, +}; + +Span tls1_get_grouplist(const SSL_HANDSHAKE *hs) { + if (!hs->config->supported_group_list.empty()) { + return hs->config->supported_group_list; + } + return Span(kDefaultGroups); +} + +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { + SSL *const ssl = hs->ssl; + assert(ssl->server); + + // Clients are not required to send a supported_groups extension. In this + // case, the server is free to pick any group it likes. See RFC 4492, + // section 4, paragraph 3. + // + // However, in the interests of compatibility, we will skip ECDH if the + // client didn't send an extension because we can't be sure that they'll + // support our favoured group. Thus we do not special-case an emtpy + // |peer_supported_group_list|. + + Span groups = tls1_get_grouplist(hs); + Span pref, supp; + if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { + pref = groups; + supp = hs->peer_supported_group_list; + } else { + pref = hs->peer_supported_group_list; + supp = groups; + } + + for (uint16_t pref_group : pref) { + for (uint16_t supp_group : supp) { + 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 true; + } + } + } + + return false; +} + +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 < curves.size(); i++) { + if (!ssl_nid_to_group_id(&group_ids[i], curves[i])) { + return false; + } + } + + *out_group_ids = std::move(group_ids); + return true; +} + +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); + + Array group_ids; + if (!group_ids.Init(count)) { + return false; + } + + size_t i = 0; + ptr = curves; + do { + col = strchr(ptr, ':'); + if (!ssl_name_to_group_id(&group_ids[i++], ptr, + col ? (size_t)(col - ptr) : strlen(ptr))) { + return false; + } + if (col) { + ptr = col + 1; + } + } while (col); + + assert(i == count); + *out_group_ids = std::move(group_ids); + return true; +} + +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 true; + } + } + + return false; +} + +// kVerifySignatureAlgorithms is the default list of accepted signature +// algorithms for verifying. +static const uint16_t kVerifySignatureAlgorithms[] = { + // List our preferred algorithms first. + SSL_SIGN_ED25519, + SSL_SIGN_ECDSA_SECP256R1_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_RSAE_SHA384, + SSL_SIGN_RSA_PKCS1_SHA384, + + 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. +static const uint16_t kSignSignatureAlgorithms[] = { + // List our preferred algorithms first. + SSL_SIGN_ED25519, + SSL_SIGN_ECDSA_SECP256R1_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_RSAE_SHA384, + SSL_SIGN_RSA_PKCS1_SHA384, + + SSL_SIGN_ECDSA_SECP521R1_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, + SSL_SIGN_RSA_PKCS1_SHA512, + + // If the peer supports nothing else, sign with SHA-1. + SSL_SIGN_ECDSA_SHA1, + SSL_SIGN_RSA_PKCS1_SHA1, +}; + +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; + } + + 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) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t verify_sigalg; + while (list.Next(&verify_sigalg)) { + if (verify_sigalg == sigalg) { + return true; + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +// tls_extension represents a TLS extension that is handled internally. The +// |init| function is called for each handshake, before any other functions of +// the extension. Then the add and parse callbacks are called as needed. +// +// The parse callbacks receive a |CBS| that contains the contents of the +// extension (i.e. not including the type and length bytes). If an extension is +// not received then the parse callbacks will be called with a NULL CBS so that +// they can do any processing needed to handle the absence of an extension. +// +// The add callbacks receive a |CBB| to which the extension can be appended but +// the function is responsible for appending the type and length bytes too. +// +// All callbacks return true for success and false for error. If a parse +// function returns zero then a fatal alert with value |*out_alert| will be +// sent. If |*out_alert| isn't set, then a |decode_error| alert will be sent. +struct tls_extension { + uint16_t value; + void (*init)(SSL_HANDSHAKE *hs); + + bool (*add_clienthello)(SSL_HANDSHAKE *hs, CBB *out); + bool (*parse_serverhello)(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents); + + bool (*parse_clienthello)(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents); + bool (*add_serverhello)(SSL_HANDSHAKE *hs, CBB *out); +}; + +static bool forbid_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents != NULL) { + // Servers MUST NOT send this extension. + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + return false; + } + + return true; +} + +static bool ignore_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // This extension from the client is handled elsewhere. + return true; +} + +static bool dont_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + return true; +} + +// Server name indication (SNI). +// +// https://tools.ietf.org/html/rfc6066#section-3. + +static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->hostname == nullptr) { + return true; + } + + CBB contents, server_name_list, name; + if (!CBB_add_u16(out, TLSEXT_TYPE_server_name) || + !CBB_add_u16_length_prefixed(out, &contents) || + !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->hostname.get(), + strlen(ssl->hostname.get())) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_sni_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // The server may acknowledge SNI with an empty extension. We check the syntax + // but otherwise ignore this signal. + return contents == NULL || CBS_len(contents) == 0; +} + +static bool ext_sni_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + // SNI has already been parsed earlier in the handshake. See |extract_sni|. + return true; +} + +static bool ext_sni_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (hs->ssl->s3->session_reused || + !hs->should_ack_sni) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_server_name) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Renegotiation indication. +// +// https://tools.ietf.org/html/rfc5746 + +static bool ext_ri_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // Renegotiation indication is not necessary in TLS 1.3. + if (hs->min_version >= TLS1_3_VERSION) { + return true; + } + + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_client_finished_len != 0)); + + CBB contents, prev_finished; + if (!CBB_add_u16(out, TLSEXT_TYPE_renegotiate) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &prev_finished) || + !CBB_add_bytes(&prev_finished, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ri_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents != NULL && ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // Servers may not switch between omitting the extension and supporting it. + // See RFC 5746, sections 3.5 and 4.2. + if (ssl->s3->initial_handshake_complete && + (contents != NULL) != ssl->s3->send_connection_binding) { + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + return false; + } + + if (contents == NULL) { + // Strictly speaking, if we want to avoid an attack we should *always* see + // RI even on initial ServerHello because the client doesn't see any + // renegotiation during an attack. However this would mean we could not + // connect to any server which doesn't support RI. + // + // OpenSSL has |SSL_OP_LEGACY_SERVER_CONNECT| to control this, but in + // practical terms every client sets it so it's just assumed here. + return true; + } + + const size_t expected_len = ssl->s3->previous_client_finished_len + + ssl->s3->previous_server_finished_len; + + // Check for logic errors + assert(!expected_len || ssl->s3->previous_client_finished_len); + assert(!expected_len || ssl->s3->previous_server_finished_len); + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_client_finished_len != 0)); + assert(ssl->s3->initial_handshake_complete == + (ssl->s3->previous_server_finished_len != 0)); + + // Parse out the extension contents. + CBS renegotiated_connection; + if (!CBS_get_u8_length_prefixed(contents, &renegotiated_connection) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_ENCODING_ERR); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // Check that the extension matches. + if (CBS_len(&renegotiated_connection) != expected_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + const uint8_t *d = CBS_data(&renegotiated_connection); + bool ok = CRYPTO_memcmp(d, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; +#endif + if (!ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + d += ssl->s3->previous_client_finished_len; + + ok = CRYPTO_memcmp(d, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; +#endif + if (!ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + ssl->s3->send_connection_binding = true; + + return true; +} + +static bool ext_ri_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + // Renegotiation isn't supported as a server so this function should never be + // called after the initial handshake. + assert(!ssl->s3->initial_handshake_complete); + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents == NULL) { + return true; + } + + CBS renegotiated_connection; + if (!CBS_get_u8_length_prefixed(contents, &renegotiated_connection) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_ENCODING_ERR); + return false; + } + + // Check that the extension matches. We do not support renegotiation as a + // server, so this must be empty. + if (CBS_len(&renegotiated_connection) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_MISMATCH); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + ssl->s3->send_connection_binding = true; + + return true; +} + +static bool ext_ri_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // Renegotiation isn't supported as a server so this function should never be + // called after the initial handshake. + assert(!ssl->s3->initial_handshake_complete); + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_renegotiate) || + !CBB_add_u16(out, 1 /* length */) || + !CBB_add_u8(out, 0 /* empty renegotiation info */)) { + return false; + } + + return true; +} + + +// Extended Master Secret. +// +// https://tools.ietf.org/html/rfc7627 + +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) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_extended_master_secret) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + + if (contents != NULL) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || + CBS_len(contents) != 0) { + return false; + } + + hs->extended_master_secret = true; + } + + // Whether EMS is negotiated may not change on renegotiation. + if (ssl->s3->established_session != nullptr && + hs->extended_master_secret != + !!ssl->s3->established_session->extended_master_secret) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RENEGOTIATION_EMS_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +static bool ext_ems_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents == NULL) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + hs->extended_master_secret = true; + return true; +} + +static bool ext_ems_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->extended_master_secret) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_extended_master_secret) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Session tickets. +// +// https://tools.ietf.org/html/rfc5077 + +static bool ext_ticket_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // TLS 1.3 uses a different ticket extension. + if (hs->min_version >= TLS1_3_VERSION || + SSL_get_options(ssl) & SSL_OP_NO_TICKET) { + return true; + } + + 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 != nullptr && + !ssl->session->ticket.empty() && + // Don't send TLS 1.3 session tickets in the ticket extension. + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + ticket = ssl->session->ticket; + } + + CBB ticket_cbb; + if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || + !CBB_add_u16_length_prefixed(out, &ticket_cbb) || + !CBB_add_bytes(&ticket_cbb, ticket.data(), ticket.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ticket_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // If |SSL_OP_NO_TICKET| is set then no extension will have been sent and + // this function should never be called, even if the server tries to send the + // extension. + assert((SSL_get_options(ssl) & SSL_OP_NO_TICKET) == 0); + + if (CBS_len(contents) != 0) { + return false; + } + + hs->ticket_expected = true; + return true; +} + +static bool ext_ticket_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ticket_expected) { + return true; + } + + // If |SSL_OP_NO_TICKET| is set, |ticket_expected| should never be true. + assert((SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) == 0); + + if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Signature Algorithms. +// +// https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + +static bool ext_sigalgs_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->max_version < TLS1_2_VERSION) { + return true; + } + + CBB contents, sigalgs_cbb; + if (!CBB_add_u16(out, TLSEXT_TYPE_signature_algorithms) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &sigalgs_cbb) || + !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + hs->peer_sigalgs.Reset(); + if (contents == NULL) { + return true; + } + + CBS supported_signature_algorithms; + if (!CBS_get_u16_length_prefixed(contents, &supported_signature_algorithms) || + CBS_len(contents) != 0 || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + return false; + } + + return true; +} + + +// OCSP Stapling. +// +// https://tools.ietf.org/html/rfc6066#section-8 + +static bool ext_ocsp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->config->ocsp_stapling_enabled) { + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_status_request) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || + !CBB_add_u16(&contents, 0 /* empty responder ID list */) || + !CBB_add_u16(&contents, 0 /* empty request extensions */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ocsp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // TLS 1.3 OCSP responses are included in the Certificate extensions. + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // OCSP stapling is forbidden on non-certificate ciphers. + if (CBS_len(contents) != 0 || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + return false; + } + + // Note this does not check for resumption in TLS 1.2. Sending + // status_request here does not make sense, but OpenSSL does so and the + // specification does not say anything. Tolerate it but ignore it. + + hs->certificate_status_expected = true; + return true; +} + +static bool ext_ocsp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + uint8_t status_type; + if (!CBS_get_u8(contents, &status_type)) { + return false; + } + + // We cannot decide whether OCSP stapling will occur yet because the correct + // SSL_CTX might not have been selected. + hs->ocsp_stapling_requested = status_type == TLSEXT_STATUSTYPE_ocsp; + + return true; +} + +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 || hs->config->cert->ocsp_response == NULL || + ssl->s3->session_reused || + !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + return true; + } + + hs->certificate_status_expected = true; + + return CBB_add_u16(out, TLSEXT_TYPE_status_request) && + CBB_add_u16(out, 0 /* length */); +} + + +// Next protocol negotiation. +// +// https://htmlpreview.github.io/?https://github.com/agl/technotes/blob/master/nextprotoneg.html + +static bool ext_npn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->initial_handshake_complete || + ssl->ctx->next_proto_select_cb == NULL || + SSL_is_dtls(ssl)) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_next_proto_neg) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_npn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // If any of these are false then we should never have sent the NPN + // extension in the ClientHello and thus this function should never have been + // called. + assert(!ssl->s3->initial_handshake_complete); + assert(!SSL_is_dtls(ssl)); + assert(ssl->ctx->next_proto_select_cb != NULL); + + if (!ssl->s3->alpn_selected.empty()) { + // NPN and ALPN may not be negotiated in the same connection. + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN); + return false; + } + + const uint8_t *const orig_contents = CBS_data(contents); + const size_t orig_len = CBS_len(contents); + + while (CBS_len(contents) != 0) { + CBS proto; + if (!CBS_get_u8_length_prefixed(contents, &proto) || + CBS_len(&proto) == 0) { + return false; + } + } + + uint8_t *selected; + uint8_t selected_len; + if (ssl->ctx->next_proto_select_cb( + ssl, &selected, &selected_len, orig_contents, orig_len, + ssl->ctx->next_proto_select_cb_arg) != SSL_TLSEXT_ERR_OK || + !ssl->s3->next_proto_negotiated.CopyFrom( + MakeConstSpan(selected, selected_len))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + hs->next_proto_neg_seen = true; + return true; +} + +static bool ext_npn_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + if (contents != NULL && CBS_len(contents) != 0) { + return false; + } + + if (contents == NULL || + ssl->s3->initial_handshake_complete || + ssl->ctx->next_protos_advertised_cb == NULL || + SSL_is_dtls(ssl)) { + return true; + } + + hs->next_proto_neg_seen = true; + return true; +} + +static bool ext_npn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + // |next_proto_neg_seen| might have been cleared when an ALPN extension was + // parsed. + if (!hs->next_proto_neg_seen) { + return true; + } + + const uint8_t *npa; + unsigned npa_len; + + if (ssl->ctx->next_protos_advertised_cb( + ssl, &npa, &npa_len, ssl->ctx->next_protos_advertised_cb_arg) != + SSL_TLSEXT_ERR_OK) { + hs->next_proto_neg_seen = false; + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_next_proto_neg) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_bytes(&contents, npa, npa_len) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Signed certificate timestamps. +// +// https://tools.ietf.org/html/rfc6962#section-3.3.1 + +static bool ext_sct_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->config->signed_cert_timestamps_enabled) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_certificate_timestamp) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // TLS 1.3 SCTs are included in the Certificate extensions. + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // 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(hs->config->signed_cert_timestamps_enabled); + + if (!ssl_is_sct_list_valid(contents)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Session resumption uses the original session information. The extension + // should not be sent on resumption, but RFC 6962 did not make it a + // requirement, so tolerate this. + // + // TODO(davidben): Enforce this anyway. + if (!ssl->s3->session_reused) { + 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; + } + } + + return true; +} + +static bool ext_sct_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + hs->scts_requested = true; + return true; +} + +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 || + hs->config->cert->signed_cert_timestamp_list == NULL) { + return true; + } + + CBB contents; + return CBB_add_u16(out, TLSEXT_TYPE_certificate_timestamp) && + CBB_add_u16_length_prefixed(out, &contents) && + CBB_add_bytes( + &contents, + 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); +} + + +// Application-level Protocol Negotiation. +// +// https://tools.ietf.org/html/rfc7301 + +static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->config->alpn_client_proto_list.empty() || + ssl->s3->initial_handshake_complete) { + return true; + } + + CBB contents, proto_list; + 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, hs->config->alpn_client_proto_list.data(), + hs->config->alpn_client_proto_list.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + assert(!ssl->s3->initial_handshake_complete); + 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. + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_BOTH_NPN_AND_ALPN); + return false; + } + + // The extension data consists of a ProtocolNameList which must have + // exactly one ProtocolName. Each of these is length-prefixed. + CBS protocol_name_list, protocol_name; + if (!CBS_get_u16_length_prefixed(contents, &protocol_name_list) || + CBS_len(contents) != 0 || + !CBS_get_u8_length_prefixed(&protocol_name_list, &protocol_name) || + // Empty protocol names are forbidden. + CBS_len(&protocol_name) == 0 || + CBS_len(&protocol_name_list) != 0) { + return false; + } + + 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; + } + + if (!ssl->s3->alpn_selected.CopyFrom(protocol_name)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + + return true; +} + +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, + Span protocol) { + if (hs->config->alpn_client_proto_list.empty()) { + return false; + } + + 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 = + 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)) { + return false; + } + + if (client_protocol_name == protocol) { + return true; + } + } + + return false; +} + +bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + CBS contents; + if (ssl->ctx->alpn_select_cb == NULL || + !ssl_client_hello_get_extension( + client_hello, &contents, + TLSEXT_TYPE_application_layer_protocol_negotiation)) { + // Ignore ALPN if not configured or no extension was supplied. + return true; + } + + // ALPN takes precedence over NPN. + hs->next_proto_neg_seen = false; + + CBS protocol_name_list; + if (!CBS_get_u16_length_prefixed(&contents, &protocol_name_list) || + CBS_len(&contents) != 0 || + CBS_len(&protocol_name_list) < 2) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Validate the protocol list. + CBS protocol_name_list_copy = protocol_name_list; + while (CBS_len(&protocol_name_list_copy) > 0) { + CBS protocol_name; + + if (!CBS_get_u8_length_prefixed(&protocol_name_list_copy, &protocol_name) || + // Empty protocol names are forbidden. + CBS_len(&protocol_name) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + } + + const uint8_t *selected; + uint8_t selected_len; + if (ssl->ctx->alpn_select_cb( + 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; + return false; + } + } + + return true; +} + +static bool ext_alpn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->alpn_selected.empty()) { + return true; + } + + CBB contents, proto_list, proto; + 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_u8_length_prefixed(&proto_list, &proto) || + !CBB_add_bytes(&proto, ssl->s3->alpn_selected.data(), + ssl->s3->alpn_selected.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Channel ID. +// +// https://tools.ietf.org/html/draft-balfanz-tls-channelid-01 + +static void ext_channel_id_init(SSL_HANDSHAKE *hs) { + 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 (!hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_channel_id) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + +static bool ext_channel_id_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + assert(!SSL_is_dtls(ssl)); + assert(hs->config->channel_id_enabled); + + if (CBS_len(contents) != 0) { + return false; + } + + ssl->s3->channel_id_valid = true; + return true; +} + +static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL || !hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { + return true; + } + + if (CBS_len(contents) != 0) { + return false; + } + + 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->channel_id_valid) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_channel_id) || + !CBB_add_u16(out, 0 /* length */)) { + return false; + } + + return true; +} + + +// Secure Real-time Transport Protocol (SRTP) extension. +// +// https://tools.ietf.org/html/rfc5764 + + +static void ext_srtp_init(SSL_HANDSHAKE *hs) { + hs->ssl->s3->srtp_profile = NULL; +} + +static bool ext_srtp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + STACK_OF(SRTP_PROTECTION_PROFILE) *profiles = SSL_get_srtp_profiles(ssl); + if (profiles == NULL || + sk_SRTP_PROTECTION_PROFILE_num(profiles) == 0) { + return true; + } + + CBB contents, profile_ids; + if (!CBB_add_u16(out, TLSEXT_TYPE_srtp) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &profile_ids)) { + return false; + } + + for (const SRTP_PROTECTION_PROFILE *profile : profiles) { + if (!CBB_add_u16(&profile_ids, profile->id)) { + return false; + } + } + + if (!CBB_add_u8(&contents, 0 /* empty use_mki value */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_srtp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + // The extension consists of a u16-prefixed profile ID list containing a + // single uint16_t profile ID, then followed by a u8-prefixed srtp_mki field. + // + // See https://tools.ietf.org/html/rfc5764#section-4.1.1 + CBS profile_ids, srtp_mki; + uint16_t profile_id; + if (!CBS_get_u16_length_prefixed(contents, &profile_ids) || + !CBS_get_u16(&profile_ids, &profile_id) || + CBS_len(&profile_ids) != 0 || + !CBS_get_u8_length_prefixed(contents, &srtp_mki) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + return false; + } + + if (CBS_len(&srtp_mki) != 0) { + // Must be no MKI, since we never offer one. + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_MKI_VALUE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + STACK_OF(SRTP_PROTECTION_PROFILE) *profiles = SSL_get_srtp_profiles(ssl); + + // Check to see if the server gave us something we support (and presumably + // offered). + for (const SRTP_PROTECTION_PROFILE *profile : profiles) { + if (profile->id == profile_id) { + ssl->s3->srtp_profile = profile; + return true; + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL) { + return true; + } + + CBS profile_ids, srtp_mki; + if (!CBS_get_u16_length_prefixed(contents, &profile_ids) || + CBS_len(&profile_ids) < 2 || + !CBS_get_u8_length_prefixed(contents, &srtp_mki) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + return false; + } + // Discard the MKI value for now. + + const STACK_OF(SRTP_PROTECTION_PROFILE) *server_profiles = + SSL_get_srtp_profiles(ssl); + + // Pick the server's most preferred profile. + for (const SRTP_PROTECTION_PROFILE *server_profile : server_profiles) { + CBS profile_ids_tmp; + CBS_init(&profile_ids_tmp, CBS_data(&profile_ids), CBS_len(&profile_ids)); + + while (CBS_len(&profile_ids_tmp) > 0) { + uint16_t profile_id; + if (!CBS_get_u16(&profile_ids_tmp, &profile_id)) { + return false; + } + + if (server_profile->id == profile_id) { + ssl->s3->srtp_profile = server_profile; + return true; + } + } + } + + return true; +} + +static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl->s3->srtp_profile == NULL) { + return true; + } + + CBB contents, profile_ids; + 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->s3->srtp_profile->id) || + !CBB_add_u8(&contents, 0 /* empty MKI */) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// EC point formats. +// +// https://tools.ietf.org/html/rfc4492#section-5.1.2 + +static bool ext_ec_point_add_extension(SSL_HANDSHAKE *hs, CBB *out) { + CBB contents, formats; + if (!CBB_add_u16(out, TLSEXT_TYPE_ec_point_formats) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &formats) || + !CBB_add_u8(&formats, TLSEXT_ECPOINTFORMAT_uncompressed) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_ec_point_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + // The point format extension is unnecessary in TLS 1.3. + if (hs->min_version >= TLS1_3_VERSION) { + return true; + } + + return ext_ec_point_add_extension(hs, out); +} + +static bool ext_ec_point_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return false; + } + + CBS ec_point_format_list; + if (!CBS_get_u8_length_prefixed(contents, &ec_point_format_list) || + CBS_len(contents) != 0) { + return false; + } + + // Per RFC 4492, section 5.1.2, implementations MUST support the uncompressed + // point format. + if (OPENSSL_memchr(CBS_data(&ec_point_format_list), + TLSEXT_ECPOINTFORMAT_uncompressed, + CBS_len(&ec_point_format_list)) == NULL) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +static bool ext_ec_point_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, + CBS *contents) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + return true; + } + + return ext_ec_point_parse_serverhello(hs, out_alert, contents); +} + +static bool ext_ec_point_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return true; + } + + const uint32_t alg_k = hs->new_cipher->algorithm_mkey; + const uint32_t alg_a = hs->new_cipher->algorithm_auth; + const bool using_ecc = (alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA); + + if (!using_ecc) { + return true; + } + + return ext_ec_point_add_extension(hs, out); +} + + +// Pre Shared Key +// +// 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 == 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.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 == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + return true; + } + + // 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; + } + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + uint32_t ticket_age = 1000 * (now.tv_sec - ssl->session->time); + uint32_t obfuscated_ticket_age = ticket_age + ssl->session->ticket_age_add; + + // 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.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->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) || + !CBB_add_bytes(&binder, zero_binder, binder_len)) { + return false; + } + + hs->needs_psk_binder = true; + return CBB_flush(out); +} + +bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + uint16_t psk_id; + if (!CBS_get_u16(contents, &psk_id) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // We only advertise one PSK identity, so the only legal index is zero. + if (psk_id != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); + *out_alert = SSL_AD_UNKNOWN_PSK_IDENTITY; + return false; + } + + return true; +} + +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) { + // 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) || + !CBS_get_u16_length_prefixed(&identities, out_ticket) || + !CBS_get_u32(&identities, out_obfuscated_ticket_age) || + !CBS_get_u16_length_prefixed(contents, &binders) || + CBS_len(&binders) == 0 || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + *out_binders = binders; + + // Check the syntax of the remaining identities, but do not process them. + size_t num_identities = 1; + while (CBS_len(&identities) != 0) { + CBS unused_ticket; + uint32_t unused_obfuscated_ticket_age; + if (!CBS_get_u16_length_prefixed(&identities, &unused_ticket) || + !CBS_get_u32(&identities, &unused_obfuscated_ticket_age)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + num_identities++; + } + + // Check the syntax of the binders. The value will be checked later if + // resuming. + size_t num_binders = 0; + while (CBS_len(&binders) != 0) { + CBS binder; + if (!CBS_get_u8_length_prefixed(&binders, &binder)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + num_binders++; + } + + if (num_identities != num_binders) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_BINDER_COUNT_MISMATCH); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + return true; +} + +bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ssl->s3->session_reused) { + return true; + } + + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_pre_shared_key) || + !CBB_add_u16_length_prefixed(out, &contents) || + // We only consider the first identity for resumption + !CBB_add_u16(&contents, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Pre-Shared Key Exchange Modes +// +// https://tools.ietf.org/html/rfc8446#section-4.2.9 + +static bool ext_psk_key_exchange_modes_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + if (hs->max_version < TLS1_3_VERSION) { + return true; + } + + CBB contents, ke_modes; + if (!CBB_add_u16(out, TLSEXT_TYPE_psk_key_exchange_modes) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &ke_modes) || + !CBB_add_u8(&ke_modes, SSL_PSK_DHE_KE)) { + return false; + } + + return CBB_flush(out); +} + +static bool ext_psk_key_exchange_modes_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + CBS ke_modes; + if (!CBS_get_u8_length_prefixed(contents, &ke_modes) || + CBS_len(&ke_modes) == 0 || + CBS_len(contents) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // We only support tickets with PSK_DHE_KE. + hs->accept_psk_mode = OPENSSL_memchr(CBS_data(&ke_modes), SSL_PSK_DHE_KE, + CBS_len(&ke_modes)) != NULL; + + return true; +} + + +// Early Data Indication +// +// 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; + // 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) || + !CBB_add_u16(out, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, + 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; + } + + if (!ssl->s3->session_reused) { + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + return false; + } + + ssl->s3->early_data_reason = ssl_early_data_accepted; + ssl->s3->early_data_accepted = true; + return true; +} + +static bool ext_early_data_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == NULL || + ssl_protocol_version(ssl) < TLS1_3_VERSION) { + return true; + } + + if (CBS_len(contents) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + hs->early_data_offered = true; + return true; +} + +static bool ext_early_data_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + if (!hs->ssl->s3->early_data_accepted) { + return true; + } + + if (!CBB_add_u16(out, TLSEXT_TYPE_early_data) || + !CBB_add_u16(out, 0) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Key Share +// +// 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; + if (hs->max_version < TLS1_3_VERSION) { + return true; + } + + CBB contents, kse_bytes; + if (!CBB_add_u16(out, TLSEXT_TYPE_key_share) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &kse_bytes)) { + return false; + } + + uint16_t group_id = hs->retry_group; + 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 && + !CBB_add_bytes(&kse_bytes, hs->key_share_bytes.data(), + hs->key_share_bytes.size())) { + return false; + } + hs->key_share_bytes.Reset(); + if (group_id == 0) { + return CBB_flush(out); + } + } else { + // Add a fake group. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + (!CBB_add_u16(&kse_bytes, + ssl_get_grease_value(hs, ssl_grease_group)) || + !CBB_add_u16(&kse_bytes, 1 /* length */) || + !CBB_add_u8(&kse_bytes, 0 /* one byte key share */))) { + return false; + } + + // Predict the most preferred group. + 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); + } + } + + CBB key_exchange; + 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_shares[0]->Offer(&key_exchange) || + !CBB_flush(&kse_bytes)) { + return false; + } + + 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; + } + + return CBB_flush(out); +} + +bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, + Array *out_secret, + uint8_t *out_alert, CBS *contents) { + CBS peer_key; + uint16_t group_id; + if (!CBS_get_u16(contents, &group_id) || + !CBS_get_u16_length_prefixed(contents, &peer_key) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + 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 (!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_shares[0].reset(); + hs->key_shares[1].reset(); + return true; +} + +bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, + Array *out_secret, + uint8_t *out_alert, CBS *contents) { + uint16_t group_id; + CBS key_shares; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_GROUP); + *out_alert = SSL_AD_HANDSHAKE_FAILURE; + return false; + } + + if (!CBS_get_u16_length_prefixed(contents, &key_shares) || + CBS_len(contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + // Find the corresponding key share. + CBS peer_key; + CBS_init(&peer_key, NULL, 0); + while (CBS_len(&key_shares) > 0) { + uint16_t id; + CBS peer_key_tmp; + if (!CBS_get_u16(&key_shares, &id) || + !CBS_get_u16_length_prefixed(&key_shares, &peer_key_tmp) || + CBS_len(&peer_key_tmp) == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (id == group_id) { + if (CBS_len(&peer_key) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_KEY_SHARE); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + peer_key = peer_key_tmp; + // Continue parsing the structure to keep peers honest. + } + } + + if (CBS_len(&peer_key) == 0) { + *out_found = false; + out_secret->Reset(); + return true; + } + + // Compute the DH secret. + Array secret; + ScopedCBB public_key; + UniquePtr key_share = SSLKeyShare::Create(group_id); + if (!key_share || + !CBB_init(public_key.get(), 32) || + !key_share->Accept(public_key.get(), &secret, out_alert, peer_key) || + !CBBFinishArray(public_key.get(), &hs->ecdh_public_key)) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + *out_secret = std::move(secret); + *out_found = true; + return true; +} + +bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + uint16_t group_id; + CBB kse_bytes, public_key; + if (!tls1_get_shared_group(hs, &group_id) || + !CBB_add_u16(out, TLSEXT_TYPE_key_share) || + !CBB_add_u16_length_prefixed(out, &kse_bytes) || + !CBB_add_u16(&kse_bytes, group_id) || + !CBB_add_u16_length_prefixed(&kse_bytes, &public_key) || + !CBB_add_bytes(&public_key, hs->ecdh_public_key.data(), + hs->ecdh_public_key.size()) || + !CBB_flush(out)) { + return false; + } + + hs->ecdh_public_key.Reset(); + + hs->new_session->group_id = group_id; + return true; +} + + +// Supported Versions +// +// 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; + if (hs->max_version <= TLS1_2_VERSION) { + return true; + } + + CBB contents, versions; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &versions)) { + return false; + } + + // Add a fake version. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + !CBB_add_u16(&versions, ssl_get_grease_value(hs, ssl_grease_version))) { + return false; + } + + if (!ssl_add_supported_versions(hs, &versions) || + !CBB_flush(out)) { + return false; + } + + return true; +} + + +// Cookie +// +// 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()) { + return true; + } + + CBB contents, cookie; + if (!CBB_add_u16(out, TLSEXT_TYPE_cookie) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &cookie) || + !CBB_add_bytes(&cookie, hs->cookie.data(), hs->cookie.size()) || + !CBB_flush(out)) { + return false; + } + + // The cookie is no longer needed in memory. + hs->cookie.Reset(); + return true; +} + + +// Supported Groups +// +// 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; + CBB contents, groups_bytes; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_groups) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16_length_prefixed(&contents, &groups_bytes)) { + return false; + } + + // Add a fake group. See draft-davidben-tls-grease-01. + if (ssl->ctx->grease_enabled && + !CBB_add_u16(&groups_bytes, + ssl_get_grease_value(hs, ssl_grease_group))) { + return false; + } + + 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; + } + } + + return CBB_flush(out); +} + +static bool ext_supported_groups_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + // This extension is not expected to be echoed by servers in TLS 1.2, but some + // BigIP servers send it nonetheless, so do not enforce this. + return true; +} + +static bool parse_u16_array(const CBS *cbs, Array *out) { + CBS copy = *cbs; + if ((CBS_len(©) & 1) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + Array ret; + if (!ret.Init(CBS_len(©) / 2)) { + return false; + } + for (size_t i = 0; i < ret.size(); i++) { + if (!CBS_get_u16(©, &ret[i])) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + assert(CBS_len(©) == 0); + *out = std::move(ret); + return 1; +} + +static bool ext_supported_groups_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == NULL) { + return true; + } + + CBS supported_group_list; + if (!CBS_get_u16_length_prefixed(contents, &supported_group_list) || + CBS_len(&supported_group_list) == 0 || + CBS_len(contents) != 0 || + !parse_u16_array(&supported_group_list, &hs->peer_supported_group_list)) { + return false; + } + + return true; +} + +// Token Binding +// +// https://tools.ietf.org/html/draft-ietf-tokbind-negotiation-10 + +// The Token Binding version number currently matches the draft number of +// draft-ietf-tokbind-protocol, and when published as an RFC it will be 0x0100. +// Since there are no wire changes to the protocol from draft 13 through the +// current draft (16), this implementation supports all versions in that range. +static uint16_t kTokenBindingMaxVersion = 16; +static uint16_t kTokenBindingMinVersion = 13; + +static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + SSL *const ssl = hs->ssl; + if (hs->config->token_binding_params.empty() || SSL_is_dtls(ssl)) { + return true; + } + + CBB contents, params; + if (!CBB_add_u16(out, TLSEXT_TYPE_token_binding) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16(&contents, kTokenBindingMaxVersion) || + !CBB_add_u8_length_prefixed(&contents, ¶ms) || + !CBB_add_bytes(¶ms, hs->config->token_binding_params.data(), + hs->config->token_binding_params.size()) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr) { + return true; + } + + CBS params_list; + uint16_t version; + uint8_t param; + if (!CBS_get_u16(contents, &version) || + !CBS_get_u8_length_prefixed(contents, ¶ms_list) || + !CBS_get_u8(¶ms_list, ¶m) || + CBS_len(¶ms_list) > 0 || + CBS_len(contents) > 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // The server-negotiated version must be less than or equal to our version. + if (version > kTokenBindingMaxVersion) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + + // If the server-selected version is less than what we support, then Token + // Binding wasn't negotiated (but the extension was parsed successfully). + if (version < kTokenBindingMinVersion) { + return 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; + } + } + + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; +} + +// select_tb_param looks for the first token binding param in +// |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_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) { + hs->ssl->s3->negotiated_token_binding_param = tb_param; + return true; + } + } + } + return false; +} + +static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr || hs->config->token_binding_params.empty()) { + return true; + } + + CBS params; + uint16_t version; + if (!CBS_get_u16(contents, &version) || + !CBS_get_u8_length_prefixed(contents, ¶ms) || + CBS_len(¶ms) == 0 || + CBS_len(contents) > 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // If the client-selected version is less than what we support, then Token + // Binding wasn't negotiated (but the extension was parsed successfully). + if (version < kTokenBindingMinVersion) { + return true; + } + + // If the client-selected version is higher than we support, use our max + // version. Otherwise, use the client's version. + hs->negotiated_token_binding_version = + std::min(version, kTokenBindingMaxVersion); + if (!select_tb_param(hs, params)) { + return 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->s3->token_binding_negotiated) { + return true; + } + + CBB contents, params; + if (!CBB_add_u16(out, TLSEXT_TYPE_token_binding) || + !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->s3->negotiated_token_binding_param) || + !CBB_flush(out)) { + return false; + } + + return true; +} + +// QUIC Transport Parameters + +static bool ext_quic_transport_params_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + 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, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || + !CBB_flush(out)) { + return false; + } + return true; +} + +static bool ext_quic_transport_params_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (contents == nullptr) { + return true; + } + // QUIC requires TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return false; + } + + return ssl->s3->peer_quic_transport_params.CopyFrom(*contents); +} + +static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + SSL *const ssl = hs->ssl; + if (!contents || hs->config->quic_transport_params.empty()) { + return true; + } + // Ignore the extension before TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + return true; + } + + return ssl->s3->peer_quic_transport_params.CopyFrom(*contents); +} + +static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, + CBB *out) { + 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, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || + !CBB_flush(out)) { + return false; + } + + 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_server_name, + NULL, + ext_sni_add_clienthello, + ext_sni_parse_serverhello, + ext_sni_parse_clienthello, + ext_sni_add_serverhello, + }, + { + TLSEXT_TYPE_extended_master_secret, + NULL, + ext_ems_add_clienthello, + ext_ems_parse_serverhello, + 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, + ext_ticket_add_clienthello, + ext_ticket_parse_serverhello, + // Ticket extension client parsing is handled in ssl_session.c + ignore_parse_clienthello, + ext_ticket_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_status_request, + NULL, + ext_ocsp_add_clienthello, + ext_ocsp_parse_serverhello, + 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, + ext_npn_add_clienthello, + ext_npn_parse_serverhello, + ext_npn_parse_clienthello, + ext_npn_add_serverhello, + }, + { + TLSEXT_TYPE_certificate_timestamp, + NULL, + ext_sct_add_clienthello, + ext_sct_parse_serverhello, + ext_sct_parse_clienthello, + ext_sct_add_serverhello, + }, + { + TLSEXT_TYPE_channel_id, + ext_channel_id_init, + ext_channel_id_add_clienthello, + ext_channel_id_parse_serverhello, + ext_channel_id_parse_clienthello, + ext_channel_id_add_serverhello, + }, + { + TLSEXT_TYPE_srtp, + ext_srtp_init, + ext_srtp_add_clienthello, + ext_srtp_parse_serverhello, + ext_srtp_parse_clienthello, + ext_srtp_add_serverhello, + }, + { + TLSEXT_TYPE_key_share, + NULL, + ext_key_share_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_psk_key_exchange_modes, + NULL, + ext_psk_key_exchange_modes_add_clienthello, + forbid_parse_serverhello, + ext_psk_key_exchange_modes_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_early_data, + NULL, + ext_early_data_add_clienthello, + ext_early_data_parse_serverhello, + ext_early_data_parse_clienthello, + ext_early_data_add_serverhello, + }, + { + TLSEXT_TYPE_supported_versions, + NULL, + ext_supported_versions_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_cookie, + NULL, + ext_cookie_add_clienthello, + forbid_parse_serverhello, + ignore_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_quic_transport_parameters, + NULL, + ext_quic_transport_params_add_clienthello, + ext_quic_transport_params_parse_serverhello, + ext_quic_transport_params_parse_clienthello, + ext_quic_transport_params_add_serverhello, + }, + { + TLSEXT_TYPE_token_binding, + NULL, + ext_token_binding_add_clienthello, + ext_token_binding_parse_serverhello, + 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)) + +static_assert(kNumExtensions <= + sizeof(((SSL_HANDSHAKE *)NULL)->extensions.sent) * 8, + "too many extensions for sent bitset"); +static_assert(kNumExtensions <= + sizeof(((SSL_HANDSHAKE *)NULL)->extensions.received) * 8, + "too many extensions for received bitset"); + +static const struct tls_extension *tls_extension_find(uint32_t *out_index, + uint16_t value) { + unsigned i; + for (i = 0; i < kNumExtensions; i++) { + if (kExtensions[i].value == value) { + *out_index = i; + return &kExtensions[i]; + } + } + + return NULL; +} + +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, + size_t header_len) { + SSL *const ssl = hs->ssl; + CBB extensions; + if (!CBB_add_u16_length_prefixed(out, &extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + 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; + + for (size_t i = 0; i < kNumExtensions; i++) { + if (kExtensions[i].init != NULL) { + kExtensions[i].init(hs); + } + } + + uint16_t grease_ext1 = 0; + if (ssl->ctx->grease_enabled) { + // Add a fake empty extension. See draft-davidben-tls-grease-01. + grease_ext1 = ssl_get_grease_value(hs, ssl_grease_extension1); + if (!CBB_add_u16(&extensions, grease_ext1) || + !CBB_add_u16(&extensions, 0 /* zero length */)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + 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 false; + } + + const size_t bytes_written = CBB_len(&extensions) - len_before; + if (bytes_written != 0) { + hs->extensions.sent |= (1u << i); + } + // 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) { + // Add a fake non-empty extension. See draft-davidben-tls-grease-01. + uint16_t grease_ext2 = ssl_get_grease_value(hs, ssl_grease_extension2); + + // The two fake extensions must not have the same value. GREASE values are + // of the form 0x1a1a, 0x2a2a, 0x3a3a, etc., so XOR to generate a different + // one. + if (grease_ext1 == grease_ext2) { + grease_ext2 ^= 0x1010; + } + + if (!CBB_add_u16(&extensions, grease_ext2) || + !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 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) { + // 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 + // https://crbug.com/363583. + if (padding_len >= 4 + 1) { + padding_len -= 4; + } 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 false; + } + + OPENSSL_memset(padding_bytes, 0, padding_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 false; + } + + // Discard empty extensions blocks. + if (CBB_len(&extensions) == 0) { + CBB_discard_child(out); + } + + return CBB_flush(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)) { + goto err; + } + + for (unsigned i = 0; i < kNumExtensions; i++) { + if (!(hs->extensions.received & (1u << i))) { + // Don't send extensions that were not received. + continue; + } + + if (!kExtensions[i].add_serverhello(hs, &extensions)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + goto err; + } + } + + // Discard empty extensions blocks before TLS 1.3. + if (ssl_protocol_version(ssl) < TLS1_3_VERSION && + CBB_len(&extensions) == 0) { + CBB_discard_child(out); + } + + return CBB_flush(out); + +err: + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; +} + +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); + } + } + + hs->extensions.received = 0; + CBS extensions; + CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); + while (CBS_len(&extensions) != 0) { + uint16_t type; + CBS extension; + + // Decode the next extension. + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + unsigned ext_index; + const struct tls_extension *const ext = + tls_extension_find(&ext_index, type); + if (ext == NULL) { + continue; + } + + hs->extensions.received |= (1u << ext_index); + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ext->parse_clienthello(hs, &alert, &extension)) { + *out_alert = alert; + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + return false; + } + } + + for (size_t i = 0; i < kNumExtensions; i++) { + if (hs->extensions.received & (1u << i)) { + continue; + } + + CBS *contents = NULL, fake_contents; + static const uint8_t kFakeRenegotiateExtension[] = {0}; + if (kExtensions[i].value == TLSEXT_TYPE_renegotiate && + ssl_client_cipher_list_contains_cipher(client_hello, + SSL3_CK_SCSV & 0xffff)) { + // The renegotiation SCSV was received so pretend that we received a + // renegotiation extension. + CBS_init(&fake_contents, kFakeRenegotiateExtension, + sizeof(kFakeRenegotiateExtension)); + contents = &fake_contents; + hs->extensions.received |= (1u << i); + } + + // Extension wasn't observed so call the callback with a NULL + // parameter. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!kExtensions[i].parse_clienthello(hs, &alert, contents)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + *out_alert = alert; + return false; + } + } + + return true; +} + +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)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + if (!ssl_check_clienthello_tlsext(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_TLSEXT); + return false; + } + + return true; +} + +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 true; + } + + // Decode the extensions block and check it is valid. + CBS extensions; + if (!CBS_get_u16_length_prefixed(cbs, &extensions) || + !tls1_check_duplicate_extensions(&extensions)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + uint32_t received = 0; + while (CBS_len(&extensions) != 0) { + uint16_t type; + CBS extension; + + // Decode the next extension. + if (!CBS_get_u16(&extensions, &type) || + !CBS_get_u16_length_prefixed(&extensions, &extension)) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + unsigned ext_index; + const struct tls_extension *const ext = + tls_extension_find(&ext_index, type); + + if (ext == NULL) { + 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))) { + // 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 false; + } + + received |= (1u << ext_index); + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ext->parse_serverhello(hs, &alert, &extension)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + *out_alert = alert; + return false; + } + } + + for (size_t i = 0; i < kNumExtensions; i++) { + if (!(received & (1u << i))) { + // Extension wasn't observed so call the callback with a NULL + // parameter. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!kExtensions[i].parse_serverhello(hs, &alert, NULL)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); + *out_alert = alert; + return false; + } + } + } + + return true; +} + +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + 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 false; + } + + int ret = SSL_TLSEXT_ERR_NOACK; + int al = SSL_AD_UNRECOGNIZED_NAME; + + 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 false; + + case SSL_TLSEXT_ERR_NOACK: + hs->should_ack_sni = false; + return true; + + default: + return true; + } +} + +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)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + return true; +} + +static enum ssl_ticket_aead_result_t decrypt_ticket_with_cipher_ctx( + 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.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; + } + // 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); + 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 = true; +#endif + if (!mac_ok) { + return ssl_ticket_aead_ignore_ticket; + } + + // Decrypt the session data. + 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; + } +#else + 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.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.Shrink(static_cast(len1) + len2); +#endif + + *out = std::move(plaintext); + return ssl_ticket_aead_success; +} + +static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( + 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; + 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) { + return ssl_ticket_aead_ignore_ticket; + } else if (cb_ret == 2) { + *out_renew_ticket = true; + } else { + assert(cb_ret == 1); + } + 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_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 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; + } + if (!HMAC_Init_ex(hmac_ctx.get(), key->hmac_key, sizeof(key->hmac_key), + tlsext_tick_md(), NULL) || + !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, cipher_ctx.get(), hmac_ctx.get(), + ticket); +} + +static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_method( + 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 = + 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; + } + + plaintext.Shrink(plaintext_len); + *out = std::move(plaintext); + return ssl_ticket_aead_success; +} + +enum ssl_ticket_aead_result_t ssl_process_ticket( + 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(hs->ssl) & SSL_OP_NO_TICKET) || + session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { + return ssl_ticket_aead_ignore_ticket; + } + + Array plaintext; + enum ssl_ticket_aead_result_t result; + 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 |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 (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(hs, &plaintext, ticket); + } + } + + if (result != ssl_ticket_aead_success) { + return result; + } + + // Decode the session. + 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; + } + + // Copy the client's session ID into the new session, to denote the ticket has + // been accepted. + 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; +} + +bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *in_sigalgs) { + // Extension ignored for inappropriate versions + if (ssl_protocol_version(hs->ssl) < TLS1_2_VERSION) { + return true; + } + + // 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) { + switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + *out = SSL_SIGN_RSA_PKCS1_MD5_SHA1; + return true; + case EVP_PKEY_EC: + *out = SSL_SIGN_ECDSA_SHA1; + return true; + default: + return false; + } +} + +bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { + SSL *const ssl = hs->ssl; + 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. + if (ssl_protocol_version(ssl) < TLS1_2_VERSION) { + if (!tls1_get_legacy_signature_algorithm(out, hs->local_pubkey.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS); + return false; + } + return true; + } + + Span sigalgs = kSignSignatureAlgorithms; + 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 = 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 + // negotiated. + if (sigalg == SSL_SIGN_RSA_PKCS1_MD5_SHA1 || + !ssl_private_key_supports_signature_algorithm(hs, sigalg)) { + continue; + } + + for (uint16_t peer_sigalg : peer_sigalgs) { + if (sigalg == peer_sigalg) { + *out = sigalg; + return true; + } + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_COMMON_SIGNATURE_ALGORITHMS); + return false; +} + +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. + uint16_t extension_type; + CBS channel_id = msg.body, extension; + if (!CBS_get_u16(&channel_id, &extension_type) || + !CBS_get_u16_length_prefixed(&channel_id, &extension) || + CBS_len(&channel_id) != 0 || + extension_type != TLSEXT_TYPE_channel_id || + 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 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 false; + } + + UniquePtr sig(ECDSA_SIG_new()); + UniquePtr x(BN_new()), y(BN_new()); + if (!sig || !x || !y) { + return false; + } + + const uint8_t *p = CBS_data(&extension); + if (BN_bin2bn(p + 0, 32, x.get()) == NULL || + 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 false; + } + + UniquePtr key(EC_KEY_new()); + UniquePtr point(EC_POINT_new(p256.get())); + if (!key || !point || + !EC_POINT_set_affine_coordinates_GFp(p256.get(), point.get(), x.get(), + y.get(), nullptr) || + !EC_KEY_set_group(key.get(), p256.get()) || + !EC_KEY_set_public_key(key.get(), point.get())) { + return false; + } + + uint8_t digest[EVP_MAX_MD_SIZE]; + size_t digest_len; + if (!tls1_channel_id_hash(hs, digest, &digest_len)) { + return false; + } + + bool sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + 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->channel_id_valid = false; + return false; + } + + OPENSSL_memcpy(ssl->s3->channel_id, p, 64); + return true; +} + +bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { + 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(hs->config->channel_id_private.get()); + if (ec_key == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + UniquePtr x(BN_new()), y(BN_new()); + if (!x || !y || + !EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ec_key), + EC_KEY_get0_public_key(ec_key), + x.get(), y.get(), nullptr)) { + return false; + } + + UniquePtr sig(ECDSA_do_sign(digest, digest_len, ec_key)); + if (!sig) { + return false; + } + + CBB child; + if (!CBB_add_u16(cbb, TLSEXT_TYPE_channel_id) || + !CBB_add_u16_length_prefixed(cbb, &child) || + !BN_bn2cbb_padded(&child, 32, x.get()) || + !BN_bn2cbb_padded(&child, 32, y.get()) || + !BN_bn2cbb_padded(&child, 32, sig->r) || + !BN_bn2cbb_padded(&child, 32, sig->s) || + !CBB_flush(cbb)) { + return false; + } + + return true; +} + +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 false; + } + SHA256(msg.data(), msg.size(), out); + *out_len = SHA256_DIGEST_LENGTH; + return true; + } + + SHA256_CTX ctx; + + SHA256_Init(&ctx); + static const char kClientIDMagic[] = "TLS Channel ID signature"; + SHA256_Update(&ctx, kClientIDMagic, sizeof(kClientIDMagic)); + + if (ssl->session != NULL) { + static const char kResumptionMagic[] = "Resumption"; + SHA256_Update(&ctx, kResumptionMagic, sizeof(kResumptionMagic)); + if (ssl->session->original_handshake_hash_len == 0) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + SHA256_Update(&ctx, ssl->session->original_handshake_hash, + ssl->session->original_handshake_hash_len); + } + + uint8_t hs_hash[EVP_MAX_MD_SIZE]; + size_t hs_hash_len; + if (!hs->transcript.GetHash(hs_hash, &hs_hash_len)) { + return false; + } + SHA256_Update(&ctx, hs_hash, (size_t)hs_hash_len); + SHA256_Final(out, &ctx); + *out_len = SHA256_DIGEST_LENGTH; + return true; +} + +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 false; + } + + static_assert( + sizeof(hs->new_session->original_handshake_hash) == EVP_MAX_MD_SIZE, + "original_handshake_hash is too small"); + + size_t digest_len; + if (!hs->transcript.GetHash(hs->new_session->original_handshake_hash, + &digest_len)) { + 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 true; +} + +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; + hs->ssl->ctx->channel_id_cb(hs->ssl, &key); + if (key == NULL) { + // The caller should try again later. + return true; + } + + UniquePtr free_key(key); + return SSL_set1_tls_channel_id(hs->ssl, key); +} + +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. + CBS copy = *contents; + CBS sct_list; + if (!CBS_get_u16_length_prefixed(©, &sct_list) || + CBS_len(©) != 0 || + CBS_len(&sct_list) == 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 false; + } + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_early_callback_ctx_extension_get(const SSL_CLIENT_HELLO *client_hello, + uint16_t extension_type, + const uint8_t **out_data, + size_t *out_len) { + CBS cbs; + if (!ssl_client_hello_get_extension(client_hello, &cbs, extension_type)) { + return 0; + } + + *out_data = CBS_data(&cbs); + *out_len = CBS_len(&cbs); + return 1; +} + +void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled) { + ctx->ed25519_enabled = !!enabled; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h new file mode 100644 index 0000000..80ad222 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h @@ -0,0 +1,8 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +#define REDMASK51 0x0007FFFFFFFFFFFF diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h.grpc_back new file mode 100644 index 0000000..80ad222 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h.grpc_back @@ -0,0 +1,8 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +#define REDMASK51 0x0007FFFFFFFFFFFF diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc new file mode 100644 index 0000000..237664d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc.grpc_back new file mode 100644 index 0000000..18bdef2 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc new file mode 100644 index 0000000..b1e0de2 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc @@ -0,0 +1,946 @@ +/* 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 + +enum client_hs_state_t { + state_read_hello_retry_request = 0, + state_send_second_client_hello, + state_read_server_hello, + state_read_encrypted_extensions, + 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, + state_send_client_certificate_verify, + state_complete_second_flight, + state_done, +}; + +static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; + +static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + assert(ssl->s3->have_version); + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // Queue up a ChangeCipherSpec for whenever we next send something. This + // will be before the second ClientHello. If we offered early data, this was + // already done. + if (!hs->early_data_offered && + !ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS body = msg.body, extensions, server_random, session_id; + uint16_t server_version, cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&body, &server_version) || + !CBS_get_bytes(&body, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&body, &session_id) || + !CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len) || + !CBS_get_u16(&body, &cipher_suite) || + !CBS_get_u8(&body, &compression_method) || + compression_method != 0 || + !CBS_get_u16_length_prefixed(&body, &extensions) || + CBS_len(&extensions) == 0 || + CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!CBS_mem_equal(&server_random, kHelloRetryRequest, SSL3_RANDOM_SIZE)) { + hs->tls13_state = state_read_server_hello; + return ssl_hs_ok; + } + + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + // Check if the cipher is a TLS 1.3 cipher. + if (cipher == NULL || + SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || + SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + hs->new_cipher = cipher; + + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !hs->transcript.UpdateForHelloRetryRequest()) { + return ssl_hs_error; + } + + + bool have_cookie, have_key_share, have_supported_versions; + CBS cookie, key_share, supported_versions; + SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_key_share, &have_key_share, &key_share}, + {TLSEXT_TYPE_cookie, &have_cookie, &cookie}, + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + 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 ssl_hs_error; + } + + if (!have_cookie && !have_key_share) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EMPTY_HELLO_RETRY_REQUEST); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + if (have_cookie) { + CBS cookie_value; + if (!CBS_get_u16_length_prefixed(&cookie, &cookie_value) || + CBS_len(&cookie_value) == 0 || + CBS_len(&cookie) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!hs->cookie.CopyFrom(cookie_value)) { + return ssl_hs_error; + } + } + + if (have_key_share) { + uint16_t group_id; + if (!CBS_get_u16(&key_share, &group_id) || CBS_len(&key_share) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // The group must be supported. + 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 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_shares[0].reset(); + hs->key_shares[1].reset(); + hs->retry_group = group_id; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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; +} + +static enum ssl_hs_wait_t do_send_second_client_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + // Restore the null cipher. We may have switched due to 0-RTT. + bssl::UniquePtr null_ctx = + SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + if (!null_ctx || + !ssl->method->set_write_state(ssl, std::move(null_ctx))) { + return ssl_hs_error; + } + + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state_read_server_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_server_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_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS body = msg.body, server_random, session_id, extensions; + uint16_t server_version; + uint16_t cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&body, &server_version) || + !CBS_get_bytes(&body, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&body, &session_id) || + !CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len) || + !CBS_get_u16(&body, &cipher_suite) || + !CBS_get_u8(&body, &compression_method) || + compression_method != 0 || + !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 ssl_hs_error; + } + + if (server_version != TLS1_2_VERSION) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_NUMBER); + return ssl_hs_error; + } + + // Forbid a second HelloRetryRequest. + if (CBS_mem_equal(&server_random, kHelloRetryRequest, SSL3_RANDOM_SIZE)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), + SSL3_RANDOM_SIZE); + + // Check if the cipher is a TLS 1.3 cipher. + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + if (cipher == nullptr || + SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || + SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // Check that the cipher matches the one in the HelloRetryRequest. + 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; + } + + // Parse out the extensions. + bool have_key_share = false, have_pre_shared_key = false, + have_supported_versions = false; + CBS key_share, pre_shared_key, supported_versions; + SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_key_share, &have_key_share, &key_share}, + {TLSEXT_TYPE_pre_shared_key, &have_pre_shared_key, &pre_shared_key}, + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + 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 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) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return ssl_hs_error; + } + + if (!ssl_ext_pre_shared_key_parse_serverhello(hs, &alert, + &pre_shared_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (ssl->session->ssl_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_VERSION_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + if (ssl->session->cipher->algorithm_prf != cipher->algorithm_prf) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_PRF_HASH_MISMATCH); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + ssl->s3->session_reused = true; + // Only authentication information carries over in TLS 1.3. + 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; + } + ssl_set_session(ssl, NULL); + + // 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); + } else if (!ssl_get_new_session(hs, 0)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + hs->new_session->cipher = cipher; + hs->new_cipher = cipher; + + size_t hash_len = + EVP_MD_size(ssl_get_handshake_digest(ssl_protocol_version(ssl), 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 (!have_key_share) { + // We do not support psk_ke and thus always require a key share. + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); + return ssl_hs_error; + } + + // Resolve ECDHE and incorporate it into the secret. + Array dhe_secret; + alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_key_share_parse_serverhello(hs, &dhe_secret, &alert, + &key_share)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (!tls13_advance_key_schedule(hs, dhe_secret) || + !ssl_hash_message(hs, msg) || + !tls13_derive_handshake_secrets(hs) || + !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, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_encrypted_extensions; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_encrypted_extensions(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_ENCRYPTED_EXTENSIONS)) { + return ssl_hs_error; + } + + CBS body = msg.body; + if (!ssl_parse_serverhello_tlsext(hs, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + if (CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Store the 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->s3->early_data_accepted) { + if (hs->early_session->cipher != hs->new_session->cipher || + 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->channel_id_valid || ssl->s3->token_binding_negotiated) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA); + return ssl_hs_error; + } + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_certificate_request; + if (hs->in_early_data && !ssl->s3->early_data_accepted) { + return ssl_hs_early_data_rejected; + } + return ssl_hs_ok; +} + +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; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // CertificateRequest is optional. + if (msg.type != SSL3_MT_CERTIFICATE_REQUEST) { + hs->tls13_state = state_read_server_certificate; + return ssl_hs_ok; + } + + + bool have_sigalgs = false, have_ca = false; + CBS sigalgs, ca; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_signature_algorithms, &have_sigalgs, &sigalgs}, + {TLSEXT_TYPE_certificate_authorities, &have_ca, &ca}, + }; + + CBS body = msg.body, context, extensions, supported_signature_algorithms; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!CBS_get_u8_length_prefixed(&body, &context) || + // The request context is always empty during the handshake. + CBS_len(&context) != 0 || + !CBS_get_u16_length_prefixed(&body, &extensions) || + CBS_len(&body) != 0 || + !ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* accept unknown */) || + (have_ca && CBS_len(&ca) == 0) || + !have_sigalgs || + !CBS_get_u16_length_prefixed(&sigalgs, + &supported_signature_algorithms) || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (have_ca) { + hs->ca_names = ssl_parse_client_CA_list(ssl, &alert, &ca); + if (!hs->ca_names) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + } else { + hs->ca_names.reset(sk_CRYPTO_BUFFER_new_null()); + if (!hs->ca_names) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + hs->cert_request = true; + ssl->ctx->x509_method->hs_flush_cached_ca_names(hs); + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + 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; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_server_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_certificate_verify( + SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + 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_server_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_server_finished; + 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; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || + !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, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || + !tls13_derive_application_secrets(hs)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_send_end_of_early_data; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_end_of_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (ssl->s3->early_data_accepted) { + hs->can_early_write = false; + // 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, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + } + + hs->tls13_state = state_send_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // The peer didn't request a certificate. + if (!hs->cert_request) { + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + } + + // Call cert_cb to update the certificate. + 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); + return ssl_hs_error; + } + if (rv < 0) { + hs->tls13_state = state_send_client_certificate; + return ssl_hs_x509_lookup; + } + } + + if (!ssl_on_certificate_selected(hs) || + !tls13_add_certificate(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state_send_client_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { + // Don't send CertificateVerify if there is no certificate. + if (!ssl_has_certificate(hs)) { + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + } + + switch (tls13_add_certificate_verify(hs)) { + case ssl_private_key_success: + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + + case ssl_private_key_retry: + hs->tls13_state = state_send_client_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_complete_second_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // Send a Channel ID assertion if necessary. + 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 (hs->config->channel_id_private == NULL) { + return ssl_hs_channel_id_lookup; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || + !tls1_write_channel_id(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + // Send a Finished message. + if (!tls13_add_finished(hs)) { + return ssl_hs_error; + } + + // Derive the final keys and enable them. + 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; + } + + hs->tls13_state = state_done; + return ssl_hs_flush; +} + +enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs) { + while (hs->tls13_state != state_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum client_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state_read_hello_retry_request: + ret = do_read_hello_retry_request(hs); + break; + case state_send_second_client_hello: + ret = do_send_second_client_hello(hs); + break; + case state_read_server_hello: + ret = do_read_server_hello(hs); + break; + case state_read_encrypted_extensions: + ret = do_read_encrypted_extensions(hs); + break; + case state_read_certificate_request: + ret = do_read_certificate_request(hs); + break; + case state_read_server_certificate: + ret = do_read_server_certificate(hs); + break; + 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; + case state_send_end_of_early_data: + ret = do_send_end_of_early_data(hs); + break; + case state_send_client_certificate: + ret = do_send_client_certificate(hs); + break; + case state_send_client_certificate_verify: + ret = do_send_client_certificate_verify(hs); + break; + case state_complete_second_flight: + ret = do_complete_second_flight(hs); + break; + case state_done: + ret = ssl_hs_ok; + break; + } + + if (hs->tls13_state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_CONNECT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + return ssl_hs_ok; +} + +const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { + enum client_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state_read_hello_retry_request: + return "TLS 1.3 client read_hello_retry_request"; + case state_send_second_client_hello: + return "TLS 1.3 client send_second_client_hello"; + case state_read_server_hello: + return "TLS 1.3 client read_server_hello"; + case state_read_encrypted_extensions: + return "TLS 1.3 client read_encrypted_extensions"; + case state_read_certificate_request: + return "TLS 1.3 client read_certificate_request"; + case state_read_server_certificate: + 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: + return "TLS 1.3 client send_end_of_early_data"; + case state_send_client_certificate: + return "TLS 1.3 client send_client_certificate"; + case state_send_client_certificate_verify: + return "TLS 1.3 client send_client_certificate_verify"; + case state_complete_second_flight: + return "TLS 1.3 client complete_second_flight"; + case state_done: + return "TLS 1.3 client done"; + } + + return "TLS 1.3 client unknown"; +} + +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 true; + } + + UniquePtr session = SSL_SESSION_dup( + ssl->s3->established_session.get(), SSL_SESSION_INCLUDE_NONAUTH); + if (!session) { + return false; + } + + ssl_session_rebase_time(ssl, session.get()); + + uint32_t server_timeout; + CBS body = msg.body, ticket_nonce, ticket, extensions; + if (!CBS_get_u32(&body, &server_timeout) || + !CBS_get_u32(&body, &session->ticket_age_add) || + !CBS_get_u8_length_prefixed(&body, &ticket_nonce) || + !CBS_get_u16_length_prefixed(&body, &ticket) || + !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 false; + } + + // Cap the renewable lifetime by the server advertised value. This avoids + // wasting bandwidth on 0-RTT when we know the server will reject it. + if (session->timeout > server_timeout) { + session->timeout = server_timeout; + } + + if (!tls13_derive_session_psk(session.get(), ticket_nonce)) { + return false; + } + + // Parse out the extensions. + bool have_early_data = false; + CBS early_data; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_early_data, &have_early_data, &early_data}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* ignore unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + 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 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; + } + } + + // 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->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 true; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back new file mode 100644 index 0000000..8bb3339 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back @@ -0,0 +1,946 @@ +/* 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 + +enum client_hs_state_t { + state_read_hello_retry_request = 0, + state_send_second_client_hello, + state_read_server_hello, + state_read_encrypted_extensions, + 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, + state_send_client_certificate_verify, + state_complete_second_flight, + state_done, +}; + +static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; + +static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + assert(ssl->s3->have_version); + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // Queue up a ChangeCipherSpec for whenever we next send something. This + // will be before the second ClientHello. If we offered early data, this was + // already done. + if (!hs->early_data_offered && + !ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS body = msg.body, extensions, server_random, session_id; + uint16_t server_version, cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&body, &server_version) || + !CBS_get_bytes(&body, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&body, &session_id) || + !CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len) || + !CBS_get_u16(&body, &cipher_suite) || + !CBS_get_u8(&body, &compression_method) || + compression_method != 0 || + !CBS_get_u16_length_prefixed(&body, &extensions) || + CBS_len(&extensions) == 0 || + CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!CBS_mem_equal(&server_random, kHelloRetryRequest, SSL3_RANDOM_SIZE)) { + hs->tls13_state = state_read_server_hello; + return ssl_hs_ok; + } + + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + // Check if the cipher is a TLS 1.3 cipher. + if (cipher == NULL || + SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || + SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + hs->new_cipher = cipher; + + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !hs->transcript.UpdateForHelloRetryRequest()) { + return ssl_hs_error; + } + + + bool have_cookie, have_key_share, have_supported_versions; + CBS cookie, key_share, supported_versions; + SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_key_share, &have_key_share, &key_share}, + {TLSEXT_TYPE_cookie, &have_cookie, &cookie}, + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + 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 ssl_hs_error; + } + + if (!have_cookie && !have_key_share) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EMPTY_HELLO_RETRY_REQUEST); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + if (have_cookie) { + CBS cookie_value; + if (!CBS_get_u16_length_prefixed(&cookie, &cookie_value) || + CBS_len(&cookie_value) == 0 || + CBS_len(&cookie) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + if (!hs->cookie.CopyFrom(cookie_value)) { + return ssl_hs_error; + } + } + + if (have_key_share) { + uint16_t group_id; + if (!CBS_get_u16(&key_share, &group_id) || CBS_len(&key_share) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // The group must be supported. + 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 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_shares[0].reset(); + hs->key_shares[1].reset(); + hs->retry_group = group_id; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + 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; +} + +static enum ssl_hs_wait_t do_send_second_client_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + // Restore the null cipher. We may have switched due to 0-RTT. + bssl::UniquePtr null_ctx = + SSLAEADContext::CreateNullCipher(SSL_is_dtls(ssl)); + if (!null_ctx || + !ssl->method->set_write_state(ssl, std::move(null_ctx))) { + return ssl_hs_error; + } + + ssl->s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + + if (!ssl_write_client_hello(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state_read_server_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_server_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_SERVER_HELLO)) { + return ssl_hs_error; + } + + CBS body = msg.body, server_random, session_id, extensions; + uint16_t server_version; + uint16_t cipher_suite; + uint8_t compression_method; + if (!CBS_get_u16(&body, &server_version) || + !CBS_get_bytes(&body, &server_random, SSL3_RANDOM_SIZE) || + !CBS_get_u8_length_prefixed(&body, &session_id) || + !CBS_mem_equal(&session_id, hs->session_id, hs->session_id_len) || + !CBS_get_u16(&body, &cipher_suite) || + !CBS_get_u8(&body, &compression_method) || + compression_method != 0 || + !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 ssl_hs_error; + } + + if (server_version != TLS1_2_VERSION) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_NUMBER); + return ssl_hs_error; + } + + // Forbid a second HelloRetryRequest. + if (CBS_mem_equal(&server_random, kHelloRetryRequest, SSL3_RANDOM_SIZE)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + return ssl_hs_error; + } + + OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), + SSL3_RANDOM_SIZE); + + // Check if the cipher is a TLS 1.3 cipher. + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(cipher_suite); + if (cipher == nullptr || + SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || + SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + // Check that the cipher matches the one in the HelloRetryRequest. + 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; + } + + // Parse out the extensions. + bool have_key_share = false, have_pre_shared_key = false, + have_supported_versions = false; + CBS key_share, pre_shared_key, supported_versions; + SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_key_share, &have_key_share, &key_share}, + {TLSEXT_TYPE_pre_shared_key, &have_pre_shared_key, &pre_shared_key}, + {TLSEXT_TYPE_supported_versions, &have_supported_versions, + &supported_versions}, + }; + + 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 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) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return ssl_hs_error; + } + + if (!ssl_ext_pre_shared_key_parse_serverhello(hs, &alert, + &pre_shared_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (ssl->session->ssl_version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_VERSION_NOT_RETURNED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + if (ssl->session->cipher->algorithm_prf != cipher->algorithm_prf) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OLD_SESSION_PRF_HASH_MISMATCH); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + 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); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + ssl->s3->session_reused = true; + // Only authentication information carries over in TLS 1.3. + 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; + } + ssl_set_session(ssl, NULL); + + // 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); + } else if (!ssl_get_new_session(hs, 0)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + hs->new_session->cipher = cipher; + hs->new_cipher = cipher; + + size_t hash_len = + EVP_MD_size(ssl_get_handshake_digest(ssl_protocol_version(ssl), 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 (!have_key_share) { + // We do not support psk_ke and thus always require a key share. + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); + return ssl_hs_error; + } + + // Resolve ECDHE and incorporate it into the secret. + Array dhe_secret; + alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_key_share_parse_serverhello(hs, &dhe_secret, &alert, + &key_share)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + if (!tls13_advance_key_schedule(hs, dhe_secret) || + !ssl_hash_message(hs, msg) || + !tls13_derive_handshake_secrets(hs) || + !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, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_encrypted_extensions; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_encrypted_extensions(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_ENCRYPTED_EXTENSIONS)) { + return ssl_hs_error; + } + + CBS body = msg.body; + if (!ssl_parse_serverhello_tlsext(hs, &body)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PARSE_TLSEXT); + return ssl_hs_error; + } + if (CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // Store the 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->s3->early_data_accepted) { + if (hs->early_session->cipher != hs->new_session->cipher || + 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->channel_id_valid || ssl->s3->token_binding_negotiated) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA); + return ssl_hs_error; + } + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_certificate_request; + if (hs->in_early_data && !ssl->s3->early_data_accepted) { + return ssl_hs_early_data_rejected; + } + return ssl_hs_ok; +} + +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; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + // CertificateRequest is optional. + if (msg.type != SSL3_MT_CERTIFICATE_REQUEST) { + hs->tls13_state = state_read_server_certificate; + return ssl_hs_ok; + } + + + bool have_sigalgs = false, have_ca = false; + CBS sigalgs, ca; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_signature_algorithms, &have_sigalgs, &sigalgs}, + {TLSEXT_TYPE_certificate_authorities, &have_ca, &ca}, + }; + + CBS body = msg.body, context, extensions, supported_signature_algorithms; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!CBS_get_u8_length_prefixed(&body, &context) || + // The request context is always empty during the handshake. + CBS_len(&context) != 0 || + !CBS_get_u16_length_prefixed(&body, &extensions) || + CBS_len(&body) != 0 || + !ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* accept unknown */) || + (have_ca && CBS_len(&ca) == 0) || + !have_sigalgs || + !CBS_get_u16_length_prefixed(&sigalgs, + &supported_signature_algorithms) || + !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + + if (have_ca) { + hs->ca_names = ssl_parse_client_CA_list(ssl, &alert, &ca); + if (!hs->ca_names) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + } else { + hs->ca_names.reset(sk_CRYPTO_BUFFER_new_null()); + if (!hs->ca_names) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + + hs->cert_request = true; + ssl->ctx->x509_method->hs_flush_cached_ca_names(hs); + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + 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; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_read_server_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_server_certificate_verify( + SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + 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_server_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_server_finished; + 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; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || + !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, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || + !tls13_derive_application_secrets(hs)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state_send_end_of_early_data; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_end_of_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + if (ssl->s3->early_data_accepted) { + hs->can_early_write = false; + // 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, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + } + + hs->tls13_state = state_send_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // The peer didn't request a certificate. + if (!hs->cert_request) { + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + } + + // Call cert_cb to update the certificate. + 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); + return ssl_hs_error; + } + if (rv < 0) { + hs->tls13_state = state_send_client_certificate; + return ssl_hs_x509_lookup; + } + } + + if (!ssl_on_certificate_selected(hs) || + !tls13_add_certificate(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state_send_client_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { + // Don't send CertificateVerify if there is no certificate. + if (!ssl_has_certificate(hs)) { + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + } + + switch (tls13_add_certificate_verify(hs)) { + case ssl_private_key_success: + hs->tls13_state = state_complete_second_flight; + return ssl_hs_ok; + + case ssl_private_key_retry: + hs->tls13_state = state_send_client_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_complete_second_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // Send a Channel ID assertion if necessary. + 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 (hs->config->channel_id_private == NULL) { + return ssl_hs_channel_id_lookup; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || + !tls1_write_channel_id(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + // Send a Finished message. + if (!tls13_add_finished(hs)) { + return ssl_hs_error; + } + + // Derive the final keys and enable them. + 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; + } + + hs->tls13_state = state_done; + return ssl_hs_flush; +} + +enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs) { + while (hs->tls13_state != state_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum client_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state_read_hello_retry_request: + ret = do_read_hello_retry_request(hs); + break; + case state_send_second_client_hello: + ret = do_send_second_client_hello(hs); + break; + case state_read_server_hello: + ret = do_read_server_hello(hs); + break; + case state_read_encrypted_extensions: + ret = do_read_encrypted_extensions(hs); + break; + case state_read_certificate_request: + ret = do_read_certificate_request(hs); + break; + case state_read_server_certificate: + ret = do_read_server_certificate(hs); + break; + 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; + case state_send_end_of_early_data: + ret = do_send_end_of_early_data(hs); + break; + case state_send_client_certificate: + ret = do_send_client_certificate(hs); + break; + case state_send_client_certificate_verify: + ret = do_send_client_certificate_verify(hs); + break; + case state_complete_second_flight: + ret = do_complete_second_flight(hs); + break; + case state_done: + ret = ssl_hs_ok; + break; + } + + if (hs->tls13_state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_CONNECT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + return ssl_hs_ok; +} + +const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { + enum client_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state_read_hello_retry_request: + return "TLS 1.3 client read_hello_retry_request"; + case state_send_second_client_hello: + return "TLS 1.3 client send_second_client_hello"; + case state_read_server_hello: + return "TLS 1.3 client read_server_hello"; + case state_read_encrypted_extensions: + return "TLS 1.3 client read_encrypted_extensions"; + case state_read_certificate_request: + return "TLS 1.3 client read_certificate_request"; + case state_read_server_certificate: + 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: + return "TLS 1.3 client send_end_of_early_data"; + case state_send_client_certificate: + return "TLS 1.3 client send_client_certificate"; + case state_send_client_certificate_verify: + return "TLS 1.3 client send_client_certificate_verify"; + case state_complete_second_flight: + return "TLS 1.3 client complete_second_flight"; + case state_done: + return "TLS 1.3 client done"; + } + + return "TLS 1.3 client unknown"; +} + +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 true; + } + + UniquePtr session = SSL_SESSION_dup( + ssl->s3->established_session.get(), SSL_SESSION_INCLUDE_NONAUTH); + if (!session) { + return false; + } + + ssl_session_rebase_time(ssl, session.get()); + + uint32_t server_timeout; + CBS body = msg.body, ticket_nonce, ticket, extensions; + if (!CBS_get_u32(&body, &server_timeout) || + !CBS_get_u32(&body, &session->ticket_age_add) || + !CBS_get_u8_length_prefixed(&body, &ticket_nonce) || + !CBS_get_u16_length_prefixed(&body, &ticket) || + !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 false; + } + + // Cap the renewable lifetime by the server advertised value. This avoids + // wasting bandwidth on 0-RTT when we know the server will reject it. + if (session->timeout > server_timeout) { + session->timeout = server_timeout; + } + + if (!tls13_derive_session_psk(session.get(), ticket_nonce)) { + return false; + } + + // Parse out the extensions. + bool have_early_data = false; + CBS early_data; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_early_data, &have_early_data, &early_data}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 1 /* ignore unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + 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 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; + } + } + + // 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->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 true; +} + +BSSL_NAMESPACE_END diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc new file mode 100644 index 0000000..6b161d3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc.grpc_back new file mode 100644 index 0000000..1f6ff64 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc new file mode 100644 index 0000000..68c092c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc.grpc_back new file mode 100644 index 0000000..c6c496e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc new file mode 100644 index 0000000..15f1d3e --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc @@ -0,0 +1,279 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static void ssl3_on_handshake_complete(SSL *ssl) { + // The handshake should have released its final message. + assert(!ssl->s3->has_message); + + // During the handshake, |hs_buf| is retained. Release if it there is no + // excess in it. There may be excess left if there server sent Finished and + // HelloRequest in the same record. + // + // TODO(davidben): SChannel does not support this. Reject this case. + if (ssl->s3->hs_buf && ssl->s3->hs_buf->length == 0) { + ssl->s3->hs_buf.reset(); + } +} + +static bool ssl3_set_read_state(SSL *ssl, UniquePtr aead_ctx) { + // Cipher changes are forbidden if the current epoch has leftover data. + if (tls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + OPENSSL_memset(ssl->s3->read_sequence, 0, sizeof(ssl->s3->read_sequence)); + ssl->s3->aead_read_ctx = std::move(aead_ctx); + return true; +} + +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; +} + +static const SSL_PROTOCOL_METHOD kTLSProtocolMethod = { + false /* is_dtls */, + ssl3_new, + ssl3_free, + ssl3_get_message, + ssl3_next_message, + ssl3_open_handshake, + ssl3_open_change_cipher_spec, + ssl3_open_app_data, + ssl3_write_app_data, + ssl3_dispatch_alert, + ssl3_init_message, + ssl3_finish_message, + ssl3_add_message, + ssl3_add_change_cipher_spec, + ssl3_flush_flight, + ssl3_on_handshake_complete, + ssl3_set_read_state, + ssl3_set_write_state, +}; + +static bool ssl_noop_x509_check_client_CA_names( + STACK_OF(CRYPTO_BUFFER) *names) { + return true; +} + +static void ssl_noop_x509_clear(CERT *cert) {} +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 bool ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { + return true; +} +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 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 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 = { + ssl_noop_x509_check_client_CA_names, + ssl_noop_x509_clear, + ssl_noop_x509_free, + ssl_noop_x509_dup, + ssl_noop_x509_flush_cached_chain, + ssl_noop_x509_flush_cached_leaf, + ssl_noop_x509_session_cache_objects, + ssl_noop_x509_session_dup, + ssl_noop_x509_session_clear, + ssl_noop_x509_session_verify_cert_chain, + ssl_noop_x509_hs_flush_cached_ca_names, + ssl_noop_x509_ssl_new, + 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, + ssl_noop_x509_ssl_ctx_free, + ssl_noop_x509_ssl_ctx_flush_cached_client_CA, +}; + +BSSL_NAMESPACE_END + +using namespace bssl; + +const SSL_METHOD *TLS_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *SSLv23_method(void) { + return TLS_method(); +} + +const SSL_METHOD *TLS_with_buffers_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kTLSProtocolMethod, + &ssl_noop_x509_method, + }; + return &kMethod; +} + +// Legacy version-locked methods. + +const SSL_METHOD *TLSv1_2_method(void) { + static const SSL_METHOD kMethod = { + TLS1_2_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *TLSv1_1_method(void) { + static const SSL_METHOD kMethod = { + TLS1_1_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *TLSv1_method(void) { + static const SSL_METHOD kMethod = { + TLS1_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +// Legacy side-specific methods. + +const SSL_METHOD *TLSv1_2_server_method(void) { + return TLSv1_2_method(); +} + +const SSL_METHOD *TLSv1_1_server_method(void) { + return TLSv1_1_method(); +} + +const SSL_METHOD *TLSv1_server_method(void) { + return TLSv1_method(); +} + +const SSL_METHOD *TLSv1_2_client_method(void) { + return TLSv1_2_method(); +} + +const SSL_METHOD *TLSv1_1_client_method(void) { + return TLSv1_1_method(); +} + +const SSL_METHOD *TLSv1_client_method(void) { + return TLSv1_method(); +} + +const SSL_METHOD *SSLv23_server_method(void) { + return SSLv23_method(); +} + +const SSL_METHOD *SSLv23_client_method(void) { + return SSLv23_method(); +} + +const SSL_METHOD *TLS_server_method(void) { + return TLS_method(); +} + +const SSL_METHOD *TLS_client_method(void) { + return TLS_method(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back new file mode 100644 index 0000000..a642e75 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back @@ -0,0 +1,279 @@ +/* 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 "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static void ssl3_on_handshake_complete(SSL *ssl) { + // The handshake should have released its final message. + assert(!ssl->s3->has_message); + + // During the handshake, |hs_buf| is retained. Release if it there is no + // excess in it. There may be excess left if there server sent Finished and + // HelloRequest in the same record. + // + // TODO(davidben): SChannel does not support this. Reject this case. + if (ssl->s3->hs_buf && ssl->s3->hs_buf->length == 0) { + ssl->s3->hs_buf.reset(); + } +} + +static bool ssl3_set_read_state(SSL *ssl, UniquePtr aead_ctx) { + // Cipher changes are forbidden if the current epoch has leftover data. + if (tls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFERED_MESSAGES_ON_CIPHER_CHANGE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + OPENSSL_memset(ssl->s3->read_sequence, 0, sizeof(ssl->s3->read_sequence)); + ssl->s3->aead_read_ctx = std::move(aead_ctx); + return true; +} + +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; +} + +static const SSL_PROTOCOL_METHOD kTLSProtocolMethod = { + false /* is_dtls */, + ssl3_new, + ssl3_free, + ssl3_get_message, + ssl3_next_message, + ssl3_open_handshake, + ssl3_open_change_cipher_spec, + ssl3_open_app_data, + ssl3_write_app_data, + ssl3_dispatch_alert, + ssl3_init_message, + ssl3_finish_message, + ssl3_add_message, + ssl3_add_change_cipher_spec, + ssl3_flush_flight, + ssl3_on_handshake_complete, + ssl3_set_read_state, + ssl3_set_write_state, +}; + +static bool ssl_noop_x509_check_client_CA_names( + STACK_OF(CRYPTO_BUFFER) *names) { + return true; +} + +static void ssl_noop_x509_clear(CERT *cert) {} +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 bool ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { + return true; +} +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 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 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 = { + ssl_noop_x509_check_client_CA_names, + ssl_noop_x509_clear, + ssl_noop_x509_free, + ssl_noop_x509_dup, + ssl_noop_x509_flush_cached_chain, + ssl_noop_x509_flush_cached_leaf, + ssl_noop_x509_session_cache_objects, + ssl_noop_x509_session_dup, + ssl_noop_x509_session_clear, + ssl_noop_x509_session_verify_cert_chain, + ssl_noop_x509_hs_flush_cached_ca_names, + ssl_noop_x509_ssl_new, + 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, + ssl_noop_x509_ssl_ctx_free, + ssl_noop_x509_ssl_ctx_flush_cached_client_CA, +}; + +BSSL_NAMESPACE_END + +using namespace bssl; + +const SSL_METHOD *TLS_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *SSLv23_method(void) { + return TLS_method(); +} + +const SSL_METHOD *TLS_with_buffers_method(void) { + static const SSL_METHOD kMethod = { + 0, + &kTLSProtocolMethod, + &ssl_noop_x509_method, + }; + return &kMethod; +} + +// Legacy version-locked methods. + +const SSL_METHOD *TLSv1_2_method(void) { + static const SSL_METHOD kMethod = { + TLS1_2_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *TLSv1_1_method(void) { + static const SSL_METHOD kMethod = { + TLS1_1_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +const SSL_METHOD *TLSv1_method(void) { + static const SSL_METHOD kMethod = { + TLS1_VERSION, + &kTLSProtocolMethod, + &ssl_crypto_x509_method, + }; + return &kMethod; +} + +// Legacy side-specific methods. + +const SSL_METHOD *TLSv1_2_server_method(void) { + return TLSv1_2_method(); +} + +const SSL_METHOD *TLSv1_1_server_method(void) { + return TLSv1_1_method(); +} + +const SSL_METHOD *TLSv1_server_method(void) { + return TLSv1_method(); +} + +const SSL_METHOD *TLSv1_2_client_method(void) { + return TLSv1_2_method(); +} + +const SSL_METHOD *TLSv1_1_client_method(void) { + return TLSv1_1_method(); +} + +const SSL_METHOD *TLSv1_client_method(void) { + return TLSv1_method(); +} + +const SSL_METHOD *SSLv23_server_method(void) { + return SSLv23_method(); +} + +const SSL_METHOD *SSLv23_client_method(void) { + return SSLv23_method(); +} + +const SSL_METHOD *TLS_server_method(void) { + return TLS_method(); +} + +const SSL_METHOD *TLS_client_method(void) { + return TLS_method(); +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc new file mode 100644 index 0000000..9c81022 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc @@ -0,0 +1,703 @@ +/* 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). */ + +#include + +#include +#include + +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +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 +// faster rate than we can process and cause record processing to loop +// forever. +static const uint8_t kMaxEmptyRecords = 32; + +// kMaxEarlyDataSkipped is the maximum number of rejected early data bytes that +// will be skipped. Without this limit an attacker could send records at a +// faster rate than we can process and cause trial decryption to loop forever. +// This value should be slightly above kMaxEarlyDataAccepted, which is measured +// in plaintext. +static const size_t kMaxEarlyDataSkipped = 16384; + +// kMaxWarningAlerts is the number of consecutive warning alerts that will be +// processed. +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 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 false; +#endif +} + +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 true; + } + } + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; +} + +size_t ssl_record_prefix_len(const SSL *ssl) { + size_t header_len; + if (SSL_is_dtls(ssl)) { + header_len = DTLS1_RT_HEADER_LENGTH; + } else { + header_len = SSL3_RT_HEADER_LENGTH; + } + + return header_len + ssl->s3->aead_read_ctx->ExplicitNonceLen(); +} + +size_t ssl_seal_align_prefix_len(const SSL *ssl) { + if (SSL_is_dtls(ssl)) { + return DTLS1_RT_HEADER_LENGTH + ssl->s3->aead_write_ctx->ExplicitNonceLen(); + } + + size_t ret = + SSL3_RT_HEADER_LENGTH + ssl->s3->aead_write_ctx->ExplicitNonceLen(); + if (ssl_needs_record_splitting(ssl)) { + ret += SSL3_RT_HEADER_LENGTH; + ret += ssl_cipher_get_record_split_len(ssl->s3->aead_write_ctx->cipher()); + } + return ret; +} + +static ssl_open_record_t skip_early_data(SSL *ssl, uint8_t *out_alert, + size_t consumed) { + ssl->s3->early_data_skipped += consumed; + if (ssl->s3->early_data_skipped < consumed) { + ssl->s3->early_data_skipped = kMaxEarlyDataSkipped + 1; + } + + if (ssl->s3->early_data_skipped > kMaxEarlyDataSkipped) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MUCH_SKIPPED_EARLY_DATA); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + return ssl_open_record_discard; +} + +ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, + Span *out, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return ssl_open_record_close_notify; + } + + // If there is an unprocessed handshake message or we are already buffering + // too much, stop before decrypting another handshake record. + if (!tls_can_accept_handshake_data(ssl, out_alert)) { + return ssl_open_record_error; + } + + CBS cbs = CBS(in); + + // Decode the record header. + uint8_t type; + uint16_t version, ciphertext_len; + if (!CBS_get_u8(&cbs, &type) || + !CBS_get_u16(&cbs, &version) || + !CBS_get_u16(&cbs, &ciphertext_len)) { + *out_consumed = SSL3_RT_HEADER_LENGTH; + return ssl_open_record_partial; + } + + bool version_ok; + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + // Only check the first byte. Enforcing beyond that can prevent decoding + // version negotiation failure alerts. + version_ok = (version >> 8) == SSL3_VERSION_MAJOR; + } else { + version_ok = version == ssl->s3->aead_read_ctx->RecordVersion(); + } + + if (!version_ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_NUMBER); + *out_alert = SSL_AD_PROTOCOL_VERSION; + return ssl_open_record_error; + } + + // Check the ciphertext length. + if (ciphertext_len > SSL3_RT_MAX_ENCRYPTED_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + // Extract the body. + CBS body; + if (!CBS_get_bytes(&cbs, &body, ciphertext_len)) { + *out_consumed = SSL3_RT_HEADER_LENGTH + (size_t)ciphertext_len; + return ssl_open_record_partial; + } + + 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); + + if (ssl->s3->have_version && + ssl_protocol_version(ssl) >= TLS1_3_VERSION && + SSL_in_init(ssl) && + type == SSL3_RT_CHANGE_CIPHER_SPEC && + ciphertext_len == 1 && + CBS_data(&body)[0] == 1) { + ssl->s3->empty_record_count++; + if (ssl->s3->empty_record_count > kMaxEmptyRecords) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_EMPTY_FRAGMENTS); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + // Skip early data received when expecting a second ClientHello if we rejected + // 0RTT. + if (ssl->s3->skip_early_data && + ssl->s3->aead_read_ctx->is_null_cipher() && + type == SSL3_RT_APPLICATION_DATA) { + return skip_early_data(ssl, out_alert, *out_consumed); + } + + // Decrypt the body in-place. + if (!ssl->s3->aead_read_ctx->Open( + 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(); + return skip_early_data(ssl, out_alert, *out_consumed); + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); + *out_alert = SSL_AD_BAD_RECORD_MAC; + return ssl_open_record_error; + } + + ssl->s3->skip_early_data = false; + + if (!ssl_record_sequence_update(ssl->s3->read_sequence, 8)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + + // TLS 1.3 hides the record type inside the encrypted data. + bool has_padding = + !ssl->s3->aead_read_ctx->is_null_cipher() && + ssl->s3->aead_read_ctx->ProtocolVersion() >= TLS1_3_VERSION; + + // If there is padding, the plaintext limit includes the padding, but includes + // extra room for the inner content type. + size_t plaintext_limit = + has_padding ? SSL3_RT_MAX_PLAIN_LENGTH + 1 : SSL3_RT_MAX_PLAIN_LENGTH; + if (out->size() > plaintext_limit) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + if (has_padding) { + // The outer record type is always application_data. + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_OUTER_RECORD_TYPE); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + do { + if (out->empty()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); + *out_alert = SSL_AD_DECRYPT_ERROR; + return ssl_open_record_error; + } + type = out->back(); + *out = out->subspan(0, out->size() - 1); + } while (type == 0); + } + + // Limit the number of consecutive empty records. + if (out->empty()) { + ssl->s3->empty_record_count++; + if (ssl->s3->empty_record_count > kMaxEmptyRecords) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_EMPTY_FRAGMENTS); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + // Apart from the limit, empty records are returned up to the caller. This + // allows the caller to reject records of the wrong type. + } else { + ssl->s3->empty_record_count = 0; + } + + if (type == SSL3_RT_ALERT) { + return ssl_process_alert(ssl, out_alert, *out); + } + + // Handshake messages may not interleave with any other record type. + if (type != SSL3_RT_HANDSHAKE && + tls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + ssl->s3->warning_alert_count = 0; + + *out_type = type; + return ssl_open_record_success; +} + +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 (!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, 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 false; + } + + assert(in == out || !buffers_alias(in, in_len, out, in_len)); + assert(!buffers_alias(in, in_len, out_prefix, ssl_record_prefix_len(ssl))); + assert(!buffers_alias(in, in_len, out_suffix, suffix_len)); + + if (extra_in_len) { + out_prefix[0] = SSL3_RT_APPLICATION_DATA; + } else { + out_prefix[0] = type; + } + + 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 (!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 false; + } + + 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 ret = SSL3_RT_HEADER_LENGTH; + if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && + ssl_needs_record_splitting(ssl)) { + // In the case of record splitting, the 1-byte record (of the 1/n-1 split) + // will be placed in the prefix, as will four of the five bytes of the + // record header for the main record. The final byte will replace the first + // byte of the plaintext that was used in the small record. + ret += ssl_cipher_get_record_split_len(ssl->s3->aead_write_ctx->cipher()); + ret += SSL3_RT_HEADER_LENGTH - 1; + } else { + ret += ssl->s3->aead_write_ctx->ExplicitNonceLen(); + } + return ret; +} + +static bool tls_seal_scatter_suffix_len(const SSL *ssl, size_t *out_suffix_len, + uint8_t type, size_t in_len) { + size_t extra_in_len = 0; + if (!ssl->s3->aead_write_ctx->is_null_cipher() && + ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + // TLS 1.3 adds an extra byte for encrypted record type. + extra_in_len = 1; + } + if (type == SSL3_RT_APPLICATION_DATA && // clang-format off + in_len > 1 && + ssl_needs_record_splitting(ssl)) { + // With record splitting enabled, the first byte gets sealed into a separate + // record which is written into the prefix. + in_len -= 1; + } + return ssl->s3->aead_write_ctx->SuffixLen(out_suffix_len, in_len, extra_in_len); +} + +// tls_seal_scatter_record seals a new record of type |type| and body |in| and +// splits it between |out_prefix|, |out|, and |out_suffix|. Exactly +// |tls_seal_scatter_prefix_len| bytes are written to |out_prefix|, |in_len| +// bytes to |out|, and |tls_seal_scatter_suffix_len| bytes to |out_suffix|. It +// 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 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 && + ssl_needs_record_splitting(ssl)) { + assert(ssl->s3->aead_write_ctx->ExplicitNonceLen() == 0); + const size_t prefix_len = SSL3_RT_HEADER_LENGTH; + + // Write the 1-byte fragment into |out_prefix|. + uint8_t *split_body = out_prefix + prefix_len; + uint8_t *split_suffix = split_body + 1; + + if (!do_seal_record(ssl, out_prefix, split_body, split_suffix, type, in, + 1)) { + return false; + } + + size_t split_record_suffix_len; + if (!ssl->s3->aead_write_ctx->SuffixLen(&split_record_suffix_len, 1, 0)) { + assert(false); + 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( + ssl->s3->aead_write_ctx->cipher()) == + split_record_len); + + // Write the n-1-byte fragment. The header gets split between |out_prefix| + // (header[:-1]) and |out| (header[-1:]). + 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 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 true; + } + + return do_seal_record(ssl, out_prefix, out, out_suffix, type, in, 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 false; + } + + const size_t prefix_len = tls_seal_scatter_prefix_len(ssl, type, in_len); + size_t suffix_len; + if (!tls_seal_scatter_suffix_len(ssl, &suffix_len, type, in_len)) { + return false; + } + 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 false; + } + if (max_out_len < in_len + prefix_len + suffix_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + 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 false; + } + + *out_len = prefix_len + in_len + suffix_len; + return true; +} + +enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, + Span in) { + // Alerts records may not contain fragmented or multiple alerts. + if (in.size() != 2) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ALERT); + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_ALERT, in); + + const uint8_t alert_level = in[0]; + const uint8_t alert_descr = in[1]; + + uint16_t alert = (alert_level << 8) | alert_descr; + ssl_do_info_callback(ssl, SSL_CB_READ_ALERT, alert); + + if (alert_level == SSL3_AL_WARNING) { + if (alert_descr == SSL_AD_CLOSE_NOTIFY) { + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + return ssl_open_record_close_notify; + } + + // 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 && + 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; + } + + ssl->s3->warning_alert_count++; + if (ssl->s3->warning_alert_count > kMaxWarningAlerts) { + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_WARNING_ALERTS); + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + if (alert_level == SSL3_AL_FATAL) { + OPENSSL_PUT_ERROR(SSL, SSL_AD_REASON_OFFSET + alert_descr); + ERR_add_error_dataf("SSL alert number %d", alert_descr); + *out_alert = 0; // No alert to send back to the peer. + return ssl_open_record_error; + } + + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_ALERT_TYPE); + return ssl_open_record_error; +} + +OpenRecordResult OpenRecord(SSL *ssl, Span *out, + size_t *out_record_len, uint8_t *out_alert, + const Span in) { + // This API is a work in progress and currently only works for TLS 1.2 servers + // and below. + if (SSL_in_init(ssl) || + SSL_is_dtls(ssl) || + ssl_protocol_version(ssl) > TLS1_2_VERSION) { + assert(false); + *out_alert = SSL_AD_INTERNAL_ERROR; + return OpenRecordResult::kError; + } + + Span plaintext; + uint8_t type = 0; + const ssl_open_record_t result = tls_open_record( + ssl, &type, &plaintext, out_record_len, out_alert, in); + + switch (result) { + case ssl_open_record_success: + if (type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_ALERT) { + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return OpenRecordResult::kError; + } + *out = plaintext; + return OpenRecordResult::kOK; + case ssl_open_record_discard: + return OpenRecordResult::kDiscard; + case ssl_open_record_partial: + return OpenRecordResult::kIncompleteRecord; + case ssl_open_record_close_notify: + return OpenRecordResult::kAlertCloseNotify; + case ssl_open_record_error: + return OpenRecordResult::kError; + } + assert(false); + return OpenRecordResult::kError; +} + +size_t SealRecordPrefixLen(const SSL *ssl, const size_t record_len) { + return tls_seal_scatter_prefix_len(ssl, SSL3_RT_APPLICATION_DATA, record_len); +} + +size_t SealRecordSuffixLen(const SSL *ssl, const size_t plaintext_len) { + assert(plaintext_len <= SSL3_RT_MAX_PLAIN_LENGTH); + size_t suffix_len; + if (!tls_seal_scatter_suffix_len(ssl, &suffix_len, SSL3_RT_APPLICATION_DATA, + plaintext_len)) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + assert(suffix_len <= SSL3_RT_MAX_ENCRYPTED_OVERHEAD); + return suffix_len; +} + +bool SealRecord(SSL *ssl, const Span out_prefix, + const Span out, Span out_suffix, + const Span in) { + // This API is a work in progress and currently only works for TLS 1.2 servers + // and below. + if (SSL_in_init(ssl) || + SSL_is_dtls(ssl) || + ssl_protocol_version(ssl) > TLS1_2_VERSION) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (out_prefix.size() != SealRecordPrefixLen(ssl, in.size()) || + out.size() != in.size() || + out_suffix.size() != SealRecordSuffixLen(ssl, in.size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + return tls_seal_scatter_record(ssl, out_prefix.data(), out.data(), + out_suffix.data(), SSL3_RT_APPLICATION_DATA, + in.data(), in.size()); +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +size_t SSL_max_seal_overhead(const SSL *ssl) { + if (SSL_is_dtls(ssl)) { + return dtls_max_seal_overhead(ssl, dtls1_use_current_epoch); + } + + size_t ret = SSL3_RT_HEADER_LENGTH; + ret += ssl->s3->aead_write_ctx->MaxOverhead(); + // TLS 1.3 needs an extra byte for the encrypted record type. + if (!ssl->s3->aead_write_ctx->is_null_cipher() && + ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + ret += 1; + } + if (ssl_needs_record_splitting(ssl)) { + ret *= 2; + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back new file mode 100644 index 0000000..464c5c5 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back @@ -0,0 +1,703 @@ +/* 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). */ + +#include + +#include +#include + +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +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 +// faster rate than we can process and cause record processing to loop +// forever. +static const uint8_t kMaxEmptyRecords = 32; + +// kMaxEarlyDataSkipped is the maximum number of rejected early data bytes that +// will be skipped. Without this limit an attacker could send records at a +// faster rate than we can process and cause trial decryption to loop forever. +// This value should be slightly above kMaxEarlyDataAccepted, which is measured +// in plaintext. +static const size_t kMaxEarlyDataSkipped = 16384; + +// kMaxWarningAlerts is the number of consecutive warning alerts that will be +// processed. +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 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 false; +#endif +} + +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 true; + } + } + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; +} + +size_t ssl_record_prefix_len(const SSL *ssl) { + size_t header_len; + if (SSL_is_dtls(ssl)) { + header_len = DTLS1_RT_HEADER_LENGTH; + } else { + header_len = SSL3_RT_HEADER_LENGTH; + } + + return header_len + ssl->s3->aead_read_ctx->ExplicitNonceLen(); +} + +size_t ssl_seal_align_prefix_len(const SSL *ssl) { + if (SSL_is_dtls(ssl)) { + return DTLS1_RT_HEADER_LENGTH + ssl->s3->aead_write_ctx->ExplicitNonceLen(); + } + + size_t ret = + SSL3_RT_HEADER_LENGTH + ssl->s3->aead_write_ctx->ExplicitNonceLen(); + if (ssl_needs_record_splitting(ssl)) { + ret += SSL3_RT_HEADER_LENGTH; + ret += ssl_cipher_get_record_split_len(ssl->s3->aead_write_ctx->cipher()); + } + return ret; +} + +static ssl_open_record_t skip_early_data(SSL *ssl, uint8_t *out_alert, + size_t consumed) { + ssl->s3->early_data_skipped += consumed; + if (ssl->s3->early_data_skipped < consumed) { + ssl->s3->early_data_skipped = kMaxEarlyDataSkipped + 1; + } + + if (ssl->s3->early_data_skipped > kMaxEarlyDataSkipped) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MUCH_SKIPPED_EARLY_DATA); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + return ssl_open_record_discard; +} + +ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, + Span *out, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return ssl_open_record_close_notify; + } + + // If there is an unprocessed handshake message or we are already buffering + // too much, stop before decrypting another handshake record. + if (!tls_can_accept_handshake_data(ssl, out_alert)) { + return ssl_open_record_error; + } + + CBS cbs = CBS(in); + + // Decode the record header. + uint8_t type; + uint16_t version, ciphertext_len; + if (!CBS_get_u8(&cbs, &type) || + !CBS_get_u16(&cbs, &version) || + !CBS_get_u16(&cbs, &ciphertext_len)) { + *out_consumed = SSL3_RT_HEADER_LENGTH; + return ssl_open_record_partial; + } + + bool version_ok; + if (ssl->s3->aead_read_ctx->is_null_cipher()) { + // Only check the first byte. Enforcing beyond that can prevent decoding + // version negotiation failure alerts. + version_ok = (version >> 8) == SSL3_VERSION_MAJOR; + } else { + version_ok = version == ssl->s3->aead_read_ctx->RecordVersion(); + } + + if (!version_ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_NUMBER); + *out_alert = SSL_AD_PROTOCOL_VERSION; + return ssl_open_record_error; + } + + // Check the ciphertext length. + if (ciphertext_len > SSL3_RT_MAX_ENCRYPTED_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + // Extract the body. + CBS body; + if (!CBS_get_bytes(&cbs, &body, ciphertext_len)) { + *out_consumed = SSL3_RT_HEADER_LENGTH + (size_t)ciphertext_len; + return ssl_open_record_partial; + } + + 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); + + if (ssl->s3->have_version && + ssl_protocol_version(ssl) >= TLS1_3_VERSION && + SSL_in_init(ssl) && + type == SSL3_RT_CHANGE_CIPHER_SPEC && + ciphertext_len == 1 && + CBS_data(&body)[0] == 1) { + ssl->s3->empty_record_count++; + if (ssl->s3->empty_record_count > kMaxEmptyRecords) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_EMPTY_FRAGMENTS); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + // Skip early data received when expecting a second ClientHello if we rejected + // 0RTT. + if (ssl->s3->skip_early_data && + ssl->s3->aead_read_ctx->is_null_cipher() && + type == SSL3_RT_APPLICATION_DATA) { + return skip_early_data(ssl, out_alert, *out_consumed); + } + + // Decrypt the body in-place. + if (!ssl->s3->aead_read_ctx->Open( + 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(); + return skip_early_data(ssl, out_alert, *out_consumed); + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); + *out_alert = SSL_AD_BAD_RECORD_MAC; + return ssl_open_record_error; + } + + ssl->s3->skip_early_data = false; + + if (!ssl_record_sequence_update(ssl->s3->read_sequence, 8)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return ssl_open_record_error; + } + + // TLS 1.3 hides the record type inside the encrypted data. + bool has_padding = + !ssl->s3->aead_read_ctx->is_null_cipher() && + ssl->s3->aead_read_ctx->ProtocolVersion() >= TLS1_3_VERSION; + + // If there is padding, the plaintext limit includes the padding, but includes + // extra room for the inner content type. + size_t plaintext_limit = + has_padding ? SSL3_RT_MAX_PLAIN_LENGTH + 1 : SSL3_RT_MAX_PLAIN_LENGTH; + if (out->size() > plaintext_limit) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + *out_alert = SSL_AD_RECORD_OVERFLOW; + return ssl_open_record_error; + } + + if (has_padding) { + // The outer record type is always application_data. + if (type != SSL3_RT_APPLICATION_DATA) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_OUTER_RECORD_TYPE); + *out_alert = SSL_AD_DECODE_ERROR; + return ssl_open_record_error; + } + + do { + if (out->empty()) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); + *out_alert = SSL_AD_DECRYPT_ERROR; + return ssl_open_record_error; + } + type = out->back(); + *out = out->subspan(0, out->size() - 1); + } while (type == 0); + } + + // Limit the number of consecutive empty records. + if (out->empty()) { + ssl->s3->empty_record_count++; + if (ssl->s3->empty_record_count > kMaxEmptyRecords) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_EMPTY_FRAGMENTS); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + // Apart from the limit, empty records are returned up to the caller. This + // allows the caller to reject records of the wrong type. + } else { + ssl->s3->empty_record_count = 0; + } + + if (type == SSL3_RT_ALERT) { + return ssl_process_alert(ssl, out_alert, *out); + } + + // Handshake messages may not interleave with any other record type. + if (type != SSL3_RT_HANDSHAKE && + tls_has_unprocessed_handshake_data(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD); + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return ssl_open_record_error; + } + + ssl->s3->warning_alert_count = 0; + + *out_type = type; + return ssl_open_record_success; +} + +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 (!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, 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 false; + } + + assert(in == out || !buffers_alias(in, in_len, out, in_len)); + assert(!buffers_alias(in, in_len, out_prefix, ssl_record_prefix_len(ssl))); + assert(!buffers_alias(in, in_len, out_suffix, suffix_len)); + + if (extra_in_len) { + out_prefix[0] = SSL3_RT_APPLICATION_DATA; + } else { + out_prefix[0] = type; + } + + 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 (!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 false; + } + + 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 ret = SSL3_RT_HEADER_LENGTH; + if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && + ssl_needs_record_splitting(ssl)) { + // In the case of record splitting, the 1-byte record (of the 1/n-1 split) + // will be placed in the prefix, as will four of the five bytes of the + // record header for the main record. The final byte will replace the first + // byte of the plaintext that was used in the small record. + ret += ssl_cipher_get_record_split_len(ssl->s3->aead_write_ctx->cipher()); + ret += SSL3_RT_HEADER_LENGTH - 1; + } else { + ret += ssl->s3->aead_write_ctx->ExplicitNonceLen(); + } + return ret; +} + +static bool tls_seal_scatter_suffix_len(const SSL *ssl, size_t *out_suffix_len, + uint8_t type, size_t in_len) { + size_t extra_in_len = 0; + if (!ssl->s3->aead_write_ctx->is_null_cipher() && + ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + // TLS 1.3 adds an extra byte for encrypted record type. + extra_in_len = 1; + } + if (type == SSL3_RT_APPLICATION_DATA && // clang-format off + in_len > 1 && + ssl_needs_record_splitting(ssl)) { + // With record splitting enabled, the first byte gets sealed into a separate + // record which is written into the prefix. + in_len -= 1; + } + return ssl->s3->aead_write_ctx->SuffixLen(out_suffix_len, in_len, extra_in_len); +} + +// tls_seal_scatter_record seals a new record of type |type| and body |in| and +// splits it between |out_prefix|, |out|, and |out_suffix|. Exactly +// |tls_seal_scatter_prefix_len| bytes are written to |out_prefix|, |in_len| +// bytes to |out|, and |tls_seal_scatter_suffix_len| bytes to |out_suffix|. It +// 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 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 && + ssl_needs_record_splitting(ssl)) { + assert(ssl->s3->aead_write_ctx->ExplicitNonceLen() == 0); + const size_t prefix_len = SSL3_RT_HEADER_LENGTH; + + // Write the 1-byte fragment into |out_prefix|. + uint8_t *split_body = out_prefix + prefix_len; + uint8_t *split_suffix = split_body + 1; + + if (!do_seal_record(ssl, out_prefix, split_body, split_suffix, type, in, + 1)) { + return false; + } + + size_t split_record_suffix_len; + if (!ssl->s3->aead_write_ctx->SuffixLen(&split_record_suffix_len, 1, 0)) { + assert(false); + 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( + ssl->s3->aead_write_ctx->cipher()) == + split_record_len); + + // Write the n-1-byte fragment. The header gets split between |out_prefix| + // (header[:-1]) and |out| (header[-1:]). + 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 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 true; + } + + return do_seal_record(ssl, out_prefix, out, out_suffix, type, in, 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 false; + } + + const size_t prefix_len = tls_seal_scatter_prefix_len(ssl, type, in_len); + size_t suffix_len; + if (!tls_seal_scatter_suffix_len(ssl, &suffix_len, type, in_len)) { + return false; + } + 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 false; + } + if (max_out_len < in_len + prefix_len + suffix_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + 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 false; + } + + *out_len = prefix_len + in_len + suffix_len; + return true; +} + +enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, + Span in) { + // Alerts records may not contain fragmented or multiple alerts. + if (in.size() != 2) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ALERT); + return ssl_open_record_error; + } + + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_ALERT, in); + + const uint8_t alert_level = in[0]; + const uint8_t alert_descr = in[1]; + + uint16_t alert = (alert_level << 8) | alert_descr; + ssl_do_info_callback(ssl, SSL_CB_READ_ALERT, alert); + + if (alert_level == SSL3_AL_WARNING) { + if (alert_descr == SSL_AD_CLOSE_NOTIFY) { + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + return ssl_open_record_close_notify; + } + + // 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 && + 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; + } + + ssl->s3->warning_alert_count++; + if (ssl->s3->warning_alert_count > kMaxWarningAlerts) { + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_WARNING_ALERTS); + return ssl_open_record_error; + } + return ssl_open_record_discard; + } + + if (alert_level == SSL3_AL_FATAL) { + OPENSSL_PUT_ERROR(SSL, SSL_AD_REASON_OFFSET + alert_descr); + ERR_add_error_dataf("SSL alert number %d", alert_descr); + *out_alert = 0; // No alert to send back to the peer. + return ssl_open_record_error; + } + + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_ALERT_TYPE); + return ssl_open_record_error; +} + +OpenRecordResult OpenRecord(SSL *ssl, Span *out, + size_t *out_record_len, uint8_t *out_alert, + const Span in) { + // This API is a work in progress and currently only works for TLS 1.2 servers + // and below. + if (SSL_in_init(ssl) || + SSL_is_dtls(ssl) || + ssl_protocol_version(ssl) > TLS1_2_VERSION) { + assert(false); + *out_alert = SSL_AD_INTERNAL_ERROR; + return OpenRecordResult::kError; + } + + Span plaintext; + uint8_t type = 0; + const ssl_open_record_t result = tls_open_record( + ssl, &type, &plaintext, out_record_len, out_alert, in); + + switch (result) { + case ssl_open_record_success: + if (type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_ALERT) { + *out_alert = SSL_AD_UNEXPECTED_MESSAGE; + return OpenRecordResult::kError; + } + *out = plaintext; + return OpenRecordResult::kOK; + case ssl_open_record_discard: + return OpenRecordResult::kDiscard; + case ssl_open_record_partial: + return OpenRecordResult::kIncompleteRecord; + case ssl_open_record_close_notify: + return OpenRecordResult::kAlertCloseNotify; + case ssl_open_record_error: + return OpenRecordResult::kError; + } + assert(false); + return OpenRecordResult::kError; +} + +size_t SealRecordPrefixLen(const SSL *ssl, const size_t record_len) { + return tls_seal_scatter_prefix_len(ssl, SSL3_RT_APPLICATION_DATA, record_len); +} + +size_t SealRecordSuffixLen(const SSL *ssl, const size_t plaintext_len) { + assert(plaintext_len <= SSL3_RT_MAX_PLAIN_LENGTH); + size_t suffix_len; + if (!tls_seal_scatter_suffix_len(ssl, &suffix_len, SSL3_RT_APPLICATION_DATA, + plaintext_len)) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + assert(suffix_len <= SSL3_RT_MAX_ENCRYPTED_OVERHEAD); + return suffix_len; +} + +bool SealRecord(SSL *ssl, const Span out_prefix, + const Span out, Span out_suffix, + const Span in) { + // This API is a work in progress and currently only works for TLS 1.2 servers + // and below. + if (SSL_in_init(ssl) || + SSL_is_dtls(ssl) || + ssl_protocol_version(ssl) > TLS1_2_VERSION) { + assert(false); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (out_prefix.size() != SealRecordPrefixLen(ssl, in.size()) || + out.size() != in.size() || + out_suffix.size() != SealRecordSuffixLen(ssl, in.size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); + return false; + } + return tls_seal_scatter_record(ssl, out_prefix.data(), out.data(), + out_suffix.data(), SSL3_RT_APPLICATION_DATA, + in.data(), in.size()); +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +size_t SSL_max_seal_overhead(const SSL *ssl) { + if (SSL_is_dtls(ssl)) { + return dtls_max_seal_overhead(ssl, dtls1_use_current_epoch); + } + + size_t ret = SSL3_RT_HEADER_LENGTH; + ret += ssl->s3->aead_write_ctx->MaxOverhead(); + // TLS 1.3 needs an extra byte for the encrypted record type. + if (!ssl->s3->aead_write_ctx->is_null_cipher() && + ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + ret += 1; + } + if (ssl_needs_record_splitting(ssl)) { + ret *= 2; + } + return ret; +} diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c new file mode 100644 index 0000000..1fc617d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c.grpc_back new file mode 100644 index 0000000..564becb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h new file mode 100644 index 0000000..5377242 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h.grpc_back new file mode 100644 index 0000000..5377242 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h new file mode 100644 index 0000000..7c31ff9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h.grpc_back new file mode 100644 index 0000000..7c31ff9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h new file mode 100644 index 0000000..c293e95 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h @@ -0,0 +1,7880 @@ +// 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. + +// This file is generated from +// ./make_curve25519_tables.py > curve25519_tables.h + + +static const fe d = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 929955233495203, 466365720129213, 1662059464998953, 2033849074728123, + 1442794654840575 +#else + 56195235, 13857412, 51736253, 6949390, 114729, 24766616, 60832955, 30306712, + 48412415, 21499315 +#endif +}}; + +static const fe sqrtm1 = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1718705420411056, 234908883556509, 2233514472574048, 2117202627021982, + 765476049583133 +#else + 34513072, 25610706, 9377949, 3500415, 12389472, 33281959, 41962654, + 31548777, 326685, 11406482 +#endif +}}; + +static const fe d2 = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1859910466990425, 932731440258426, 1072319116312658, 1815898335770999, + 633789495995903 +#else + 45281625, 27714825, 36363642, 13898781, 229458, 15978800, 54557047, + 27058993, 29715967, 9444199 +#endif +}}; + +#if defined(OPENSSL_SMALL) + +// This block of code replaces the standard base-point table with a much smaller +// one. The standard table is 30,720 bytes while this one is just 960. +// +// This table contains 15 pairs of group elements, (x, y), where each field +// element is serialised with |fe_tobytes|. If |i| is the index of the group +// element then consider i+1 as a four-bit number: (iβ‚€, i₁, iβ‚‚, i₃) (where iβ‚€ +// is the most significant bit). The value of the group element is then: +// (iβ‚€Γ—2^192 + i₁×2^128 + iβ‚‚Γ—2^64 + i₃)G, where G is the generator. +static const uint8_t k25519SmallPrecomp[15 * 2 * 32] = { + 0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, 0xb2, 0xa7, 0x25, 0x95, + 0x60, 0xc7, 0x2c, 0x69, 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0, + 0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21, 0x58, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x02, 0xa2, 0xed, 0xf4, 0x8f, 0x6b, 0x0b, 0x3e, + 0xeb, 0x35, 0x1a, 0xd5, 0x7e, 0xdb, 0x78, 0x00, 0x96, 0x8a, 0xa0, 0xb4, + 0xcf, 0x60, 0x4b, 0xd4, 0xd5, 0xf9, 0x2d, 0xbf, 0x88, 0xbd, 0x22, 0x62, + 0x13, 0x53, 0xe4, 0x82, 0x57, 0xfa, 0x1e, 0x8f, 0x06, 0x2b, 0x90, 0xba, + 0x08, 0xb6, 0x10, 0x54, 0x4f, 0x7c, 0x1b, 0x26, 0xed, 0xda, 0x6b, 0xdd, + 0x25, 0xd0, 0x4e, 0xea, 0x42, 0xbb, 0x25, 0x03, 0xa2, 0xfb, 0xcc, 0x61, + 0x67, 0x06, 0x70, 0x1a, 0xc4, 0x78, 0x3a, 0xff, 0x32, 0x62, 0xdd, 0x2c, + 0xab, 0x50, 0x19, 0x3b, 0xf2, 0x9b, 0x7d, 0xb8, 0xfd, 0x4f, 0x29, 0x9c, + 0xa7, 0x91, 0xba, 0x0e, 0x46, 0x5e, 0x51, 0xfe, 0x1d, 0xbf, 0xe5, 0xe5, + 0x9b, 0x95, 0x0d, 0x67, 0xf8, 0xd1, 0xb5, 0x5a, 0xa1, 0x93, 0x2c, 0xc3, + 0xde, 0x0e, 0x97, 0x85, 0x2d, 0x7f, 0xea, 0xab, 0x3e, 0x47, 0x30, 0x18, + 0x24, 0xe8, 0xb7, 0x60, 0xae, 0x47, 0x80, 0xfc, 0xe5, 0x23, 0xe7, 0xc2, + 0xc9, 0x85, 0xe6, 0x98, 0xa0, 0x29, 0x4e, 0xe1, 0x84, 0x39, 0x2d, 0x95, + 0x2c, 0xf3, 0x45, 0x3c, 0xff, 0xaf, 0x27, 0x4c, 0x6b, 0xa6, 0xf5, 0x4b, + 0x11, 0xbd, 0xba, 0x5b, 0x9e, 0xc4, 0xa4, 0x51, 0x1e, 0xbe, 0xd0, 0x90, + 0x3a, 0x9c, 0xc2, 0x26, 0xb6, 0x1e, 0xf1, 0x95, 0x7d, 0xc8, 0x6d, 0x52, + 0xe6, 0x99, 0x2c, 0x5f, 0x9a, 0x96, 0x0c, 0x68, 0x29, 0xfd, 0xe2, 0xfb, + 0xe6, 0xbc, 0xec, 0x31, 0x08, 0xec, 0xe6, 0xb0, 0x53, 0x60, 0xc3, 0x8c, + 0xbe, 0xc1, 0xb3, 0x8a, 0x8f, 0xe4, 0x88, 0x2b, 0x55, 0xe5, 0x64, 0x6e, + 0x9b, 0xd0, 0xaf, 0x7b, 0x64, 0x2a, 0x35, 0x25, 0x10, 0x52, 0xc5, 0x9e, + 0x58, 0x11, 0x39, 0x36, 0x45, 0x51, 0xb8, 0x39, 0x93, 0xfc, 0x9d, 0x6a, + 0xbe, 0x58, 0xcb, 0xa4, 0x0f, 0x51, 0x3c, 0x38, 0x05, 0xca, 0xab, 0x43, + 0x63, 0x0e, 0xf3, 0x8b, 0x41, 0xa6, 0xf8, 0x9b, 0x53, 0x70, 0x80, 0x53, + 0x86, 0x5e, 0x8f, 0xe3, 0xc3, 0x0d, 0x18, 0xc8, 0x4b, 0x34, 0x1f, 0xd8, + 0x1d, 0xbc, 0xf2, 0x6d, 0x34, 0x3a, 0xbe, 0xdf, 0xd9, 0xf6, 0xf3, 0x89, + 0xa1, 0xe1, 0x94, 0x9f, 0x5d, 0x4c, 0x5d, 0xe9, 0xa1, 0x49, 0x92, 0xef, + 0x0e, 0x53, 0x81, 0x89, 0x58, 0x87, 0xa6, 0x37, 0xf1, 0xdd, 0x62, 0x60, + 0x63, 0x5a, 0x9d, 0x1b, 0x8c, 0xc6, 0x7d, 0x52, 0xea, 0x70, 0x09, 0x6a, + 0xe1, 0x32, 0xf3, 0x73, 0x21, 0x1f, 0x07, 0x7b, 0x7c, 0x9b, 0x49, 0xd8, + 0xc0, 0xf3, 0x25, 0x72, 0x6f, 0x9d, 0xed, 0x31, 0x67, 0x36, 0x36, 0x54, + 0x40, 0x92, 0x71, 0xe6, 0x11, 0x28, 0x11, 0xad, 0x93, 0x32, 0x85, 0x7b, + 0x3e, 0xb7, 0x3b, 0x49, 0x13, 0x1c, 0x07, 0xb0, 0x2e, 0x93, 0xaa, 0xfd, + 0xfd, 0x28, 0x47, 0x3d, 0x8d, 0xd2, 0xda, 0xc7, 0x44, 0xd6, 0x7a, 0xdb, + 0x26, 0x7d, 0x1d, 0xb8, 0xe1, 0xde, 0x9d, 0x7a, 0x7d, 0x17, 0x7e, 0x1c, + 0x37, 0x04, 0x8d, 0x2d, 0x7c, 0x5e, 0x18, 0x38, 0x1e, 0xaf, 0xc7, 0x1b, + 0x33, 0x48, 0x31, 0x00, 0x59, 0xf6, 0xf2, 0xca, 0x0f, 0x27, 0x1b, 0x63, + 0x12, 0x7e, 0x02, 0x1d, 0x49, 0xc0, 0x5d, 0x79, 0x87, 0xef, 0x5e, 0x7a, + 0x2f, 0x1f, 0x66, 0x55, 0xd8, 0x09, 0xd9, 0x61, 0x38, 0x68, 0xb0, 0x07, + 0xa3, 0xfc, 0xcc, 0x85, 0x10, 0x7f, 0x4c, 0x65, 0x65, 0xb3, 0xfa, 0xfa, + 0xa5, 0x53, 0x6f, 0xdb, 0x74, 0x4c, 0x56, 0x46, 0x03, 0xe2, 0xd5, 0x7a, + 0x29, 0x1c, 0xc6, 0x02, 0xbc, 0x59, 0xf2, 0x04, 0x75, 0x63, 0xc0, 0x84, + 0x2f, 0x60, 0x1c, 0x67, 0x76, 0xfd, 0x63, 0x86, 0xf3, 0xfa, 0xbf, 0xdc, + 0xd2, 0x2d, 0x90, 0x91, 0xbd, 0x33, 0xa9, 0xe5, 0x66, 0x0c, 0xda, 0x42, + 0x27, 0xca, 0xf4, 0x66, 0xc2, 0xec, 0x92, 0x14, 0x57, 0x06, 0x63, 0xd0, + 0x4d, 0x15, 0x06, 0xeb, 0x69, 0x58, 0x4f, 0x77, 0xc5, 0x8b, 0xc7, 0xf0, + 0x8e, 0xed, 0x64, 0xa0, 0xb3, 0x3c, 0x66, 0x71, 0xc6, 0x2d, 0xda, 0x0a, + 0x0d, 0xfe, 0x70, 0x27, 0x64, 0xf8, 0x27, 0xfa, 0xf6, 0x5f, 0x30, 0xa5, + 0x0d, 0x6c, 0xda, 0xf2, 0x62, 0x5e, 0x78, 0x47, 0xd3, 0x66, 0x00, 0x1c, + 0xfd, 0x56, 0x1f, 0x5d, 0x3f, 0x6f, 0xf4, 0x4c, 0xd8, 0xfd, 0x0e, 0x27, + 0xc9, 0x5c, 0x2b, 0xbc, 0xc0, 0xa4, 0xe7, 0x23, 0x29, 0x02, 0x9f, 0x31, + 0xd6, 0xe9, 0xd7, 0x96, 0xf4, 0xe0, 0x5e, 0x0b, 0x0e, 0x13, 0xee, 0x3c, + 0x09, 0xed, 0xf2, 0x3d, 0x76, 0x91, 0xc3, 0xa4, 0x97, 0xae, 0xd4, 0x87, + 0xd0, 0x5d, 0xf6, 0x18, 0x47, 0x1f, 0x1d, 0x67, 0xf2, 0xcf, 0x63, 0xa0, + 0x91, 0x27, 0xf8, 0x93, 0x45, 0x75, 0x23, 0x3f, 0xd1, 0xf1, 0xad, 0x23, + 0xdd, 0x64, 0x93, 0x96, 0x41, 0x70, 0x7f, 0xf7, 0xf5, 0xa9, 0x89, 0xa2, + 0x34, 0xb0, 0x8d, 0x1b, 0xae, 0x19, 0x15, 0x49, 0x58, 0x23, 0x6d, 0x87, + 0x15, 0x4f, 0x81, 0x76, 0xfb, 0x23, 0xb5, 0xea, 0xcf, 0xac, 0x54, 0x8d, + 0x4e, 0x42, 0x2f, 0xeb, 0x0f, 0x63, 0xdb, 0x68, 0x37, 0xa8, 0xcf, 0x8b, + 0xab, 0xf5, 0xa4, 0x6e, 0x96, 0x2a, 0xb2, 0xd6, 0xbe, 0x9e, 0xbd, 0x0d, + 0xb4, 0x42, 0xa9, 0xcf, 0x01, 0x83, 0x8a, 0x17, 0x47, 0x76, 0xc4, 0xc6, + 0x83, 0x04, 0x95, 0x0b, 0xfc, 0x11, 0xc9, 0x62, 0xb8, 0x0c, 0x76, 0x84, + 0xd9, 0xb9, 0x37, 0xfa, 0xfc, 0x7c, 0xc2, 0x6d, 0x58, 0x3e, 0xb3, 0x04, + 0xbb, 0x8c, 0x8f, 0x48, 0xbc, 0x91, 0x27, 0xcc, 0xf9, 0xb7, 0x22, 0x19, + 0x83, 0x2e, 0x09, 0xb5, 0x72, 0xd9, 0x54, 0x1c, 0x4d, 0xa1, 0xea, 0x0b, + 0xf1, 0xc6, 0x08, 0x72, 0x46, 0x87, 0x7a, 0x6e, 0x80, 0x56, 0x0a, 0x8a, + 0xc0, 0xdd, 0x11, 0x6b, 0xd6, 0xdd, 0x47, 0xdf, 0x10, 0xd9, 0xd8, 0xea, + 0x7c, 0xb0, 0x8f, 0x03, 0x00, 0x2e, 0xc1, 0x8f, 0x44, 0xa8, 0xd3, 0x30, + 0x06, 0x89, 0xa2, 0xf9, 0x34, 0xad, 0xdc, 0x03, 0x85, 0xed, 0x51, 0xa7, + 0x82, 0x9c, 0xe7, 0x5d, 0x52, 0x93, 0x0c, 0x32, 0x9a, 0x5b, 0xe1, 0xaa, + 0xca, 0xb8, 0x02, 0x6d, 0x3a, 0xd4, 0xb1, 0x3a, 0xf0, 0x5f, 0xbe, 0xb5, + 0x0d, 0x10, 0x6b, 0x38, 0x32, 0xac, 0x76, 0x80, 0xbd, 0xca, 0x94, 0x71, + 0x7a, 0xf2, 0xc9, 0x35, 0x2a, 0xde, 0x9f, 0x42, 0x49, 0x18, 0x01, 0xab, + 0xbc, 0xef, 0x7c, 0x64, 0x3f, 0x58, 0x3d, 0x92, 0x59, 0xdb, 0x13, 0xdb, + 0x58, 0x6e, 0x0a, 0xe0, 0xb7, 0x91, 0x4a, 0x08, 0x20, 0xd6, 0x2e, 0x3c, + 0x45, 0xc9, 0x8b, 0x17, 0x79, 0xe7, 0xc7, 0x90, 0x99, 0x3a, 0x18, 0x25, +}; + +#else + +// k25519Precomp[i][j] = (j+1)*256^i*B +static const ge_precomp k25519Precomp[32][8] = { + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288382639258501, 245678601348599, 269427782077623, + 1462984067271730, 137412439391563 +#else + 25967493, 19198397, 29566455, 3660896, 54414519, 4014786, + 27544626, 21800161, 61029707, 2047604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 62697248952638, 204681361388450, 631292143396476, + 338455783676468, 1213667448819585 +#else + 54563134, 934261, 64385954, 3049989, 66381436, 9406985, + 12720692, 5043384, 19500929, 18085054 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301289933810280, 1259582250014073, 1422107436869536, + 796239922652654, 1953934009299142 +#else + 58370664, 4489569, 9688441, 18769238, 10184608, 21191052, + 29287918, 11864899, 42594502, 29115885 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1380971894829527, 790832306631236, 2067202295274102, + 1995808275510000, 1566530869037010 +#else + 54292951, 20578084, 45527620, 11784319, 41753206, 30803714, + 55390960, 29739860, 66750418, 23343128 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 463307831301544, 432984605774163, 1610641361907204, + 750899048855000, 1894842303421586 +#else + 45405608, 6903824, 27185491, 6451973, 37531140, 24000426, + 51492312, 11189267, 40279186, 28235350 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 748439484463711, 1033211726465151, 1396005112841647, + 1611506220286469, 1972177495910992 +#else + 26966623, 11152617, 32442495, 15396054, 14353839, 20802097, + 63980037, 24013313, 51636816, 29387734 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1601611775252272, 1720807796594148, 1132070835939856, + 1260455018889551, 2147779492816911 +#else + 15636272, 23865875, 24204772, 25642034, 616976, 16869170, + 27787599, 18782243, 28944399, 32004408 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 316559037616741, 2177824224946892, 1459442586438991, + 1461528397712656, 751590696113597 +#else + 16568933, 4717097, 55552716, 32452109, 15682895, 21747389, + 16354576, 21778470, 7689661, 11199574 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850748884277385, 1200145853858453, 1068094770532492, + 672251375690438, 1586055907191707 +#else + 30464137, 27578307, 55329429, 17883566, 23220364, 15915852, + 7512774, 10017326, 49359771, 23634074 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 934282339813791, 1846903124198670, 1172395437954843, + 1007037127761661, 1830588347719256 +#else + 50071967, 13921891, 10945806, 27521001, 27105051, 17470053, + 38182653, 15006022, 3284568, 27277892 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1694390458783935, 1735906047636159, 705069562067493, + 648033061693059, 696214010414170 +#else + 23599295, 25248385, 55915199, 25867015, 13236773, 10506355, + 7464579, 9656445, 13059162, 10374397 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121406372216585, 192876649532226, 190294192191717, + 1994165897297032, 2245000007398739 +#else + 7798537, 16710257, 3033922, 2874086, 28997861, 2835604, + 32406664, 29715387, 66467155, 33453106 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 769950342298419, 132954430919746, 844085933195555, + 974092374476333, 726076285546016 +#else + 10861363, 11473154, 27284546, 1981175, 37044515, 12577860, + 32867885, 14515107, 51670560, 10819379 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 425251763115706, 608463272472562, 442562545713235, + 837766094556764, 374555092627893 +#else + 4708026, 6336745, 20377586, 9066809, 55836755, 6594695, + 41455196, 12483687, 54440373, 5581305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1086255230780037, 274979815921559, 1960002765731872, + 929474102396301, 1190409889297339 +#else + 19563141, 16186464, 37722007, 4097518, 10237984, 29206317, + 28542349, 13850243, 43430843, 17738489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1388594989461809, 316767091099457, 394298842192982, + 1230079486801005, 1440737038838979 +#else + 51736881, 20691677, 32573249, 4720197, 40672342, 5875510, + 47920237, 18329612, 57289923, 21468654 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 7380825640100, 146210432690483, 304903576448906, + 1198869323871120, 997689833219095 +#else + 58559652, 109982, 15149363, 2178705, 22900618, 4543417, 3044240, + 17864545, 1762327, 14866737 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1181317918772081, 114573476638901, 262805072233344, + 265712217171332, 294181933805782 +#else + 48909169, 17603008, 56635573, 1707277, 49922944, 3916100, + 38872452, 3959420, 27914454, 4383652 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665000864555967, 2065379846933859, 370231110385876, + 350988370788628, 1233371373142985 +#else + 5153727, 9909285, 1723747, 30776558, 30523604, 5516873, + 19480852, 5230134, 43156425, 18378665 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2019367628972465, 676711900706637, 110710997811333, + 1108646842542025, 517791959672113 +#else + 36839857, 30090922, 7665485, 10083793, 28475525, 1649722, + 20654025, 16520125, 30598449, 7715701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 965130719900578, 247011430587952, 526356006571389, + 91986625355052, 2157223321444601 +#else + 28881826, 14381568, 9657904, 3680757, 46927229, 7843315, + 35708204, 1370707, 29794553, 32145132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2068619540119183, 1966274918058806, 957728544705549, + 729906502578991, 159834893065166 +#else + 14499471, 30824833, 33917750, 29299779, 28494861, 14271267, + 30290735, 10876454, 33954766, 2381725 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2073601412052185, 31021124762708, 264500969797082, + 248034690651703, 1030252227928288 +#else + 59913433, 30899068, 52378708, 462250, 39384538, 3941371, + 60872247, 3696004, 34808032, 15351954 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 551790716293402, 1989538725166328, 801169423371717, + 2052451893578887, 678432056995012 +#else + 27431194, 8222322, 16448760, 29646437, 48401861, 11938354, + 34147463, 30583916, 29551812, 10109425 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1368953770187805, 790347636712921, 437508475667162, + 2142576377050580, 1932081720066286 +#else + 53451805, 20399000, 35825113, 11777097, 21447386, 6519384, + 64730580, 31926875, 10092782, 28790261 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 953638594433374, 1092333936795051, 1419774766716690, + 805677984380077, 859228993502513 +#else + 27939166, 14210322, 4677035, 16277044, 44144402, 21156292, + 34600109, 12005537, 49298737, 12803509 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1200766035879111, 20142053207432, 1465634435977050, + 1645256912097844, 295121984874596 +#else + 17228999, 17892808, 65875336, 300139, 65883994, 21839654, + 30364212, 24516238, 18016356, 4397660 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1735718747031557, 1248237894295956, 1204753118328107, + 976066523550493, 65943769534592 +#else + 56150021, 25864224, 4776340, 18600194, 27850027, 17952220, + 40489757, 14544524, 49631360, 982638 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1060098822528990, 1586825862073490, 212301317240126, + 1975302711403555, 666724059764335 +#else + 29253598, 15796703, 64244882, 23645547, 10057022, 3163536, + 7332899, 29434304, 46061167, 9934962 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1091990273418756, 1572899409348578, 80968014455247, + 306009358661350, 1520450739132526 +#else + 5793284, 16271923, 42977250, 23438027, 29188559, 1206517, + 52360934, 4559894, 36984942, 22656481 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1480517209436112, 1511153322193952, 1244343858991172, + 304788150493241, 369136856496443 +#else + 39464912, 22061425, 16282656, 22517939, 28414020, 18542168, + 24191033, 4541697, 53770555, 5500567 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2151330273626164, 762045184746182, 1688074332551515, + 823046109005759, 907602769079491 +#else + 12650548, 32057319, 9052870, 11355358, 49428827, 25154267, + 49678271, 12264342, 10874051, 13524335 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2047386910586836, 168470092900250, 1552838872594810, + 340951180073789, 360819374702533 +#else + 25556948, 30508442, 714650, 2510400, 23394682, 23139102, + 33119037, 5080568, 44580805, 5376627 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1982622644432056, 2014393600336956, 128909208804214, + 1617792623929191, 105294281913815 +#else + 41020600, 29543379, 50095164, 30016803, 60382070, 1920896, + 44787559, 24106988, 4535767, 1569007 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 980234343912898, 1712256739246056, 588935272190264, + 204298813091998, 841798321043288 +#else + 64853442, 14606629, 45416424, 25514613, 28430648, 8775819, + 36614302, 3044289, 31848280, 12543772 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 197561292938973, 454817274782871, 1963754960082318, + 2113372252160468, 971377527342673 +#else + 45080285, 2943892, 35251351, 6777305, 13784462, 29262229, + 39731668, 31491700, 7718481, 14474653 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 164699448829328, 3127451757672, 1199504971548753, + 1766155447043652, 1899238924683527 +#else + 2385296, 2454213, 44477544, 46602, 62670929, 17874016, 656964, + 26317767, 24316167, 28300865 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 732262946680281, 1674412764227063, 2182456405662809, + 1350894754474250, 558458873295247 +#else + 13741529, 10911568, 33875447, 24950694, 46931033, 32521134, + 33040650, 20129900, 46379407, 8321685 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2103305098582922, 1960809151316468, 715134605001343, + 1454892949167181, 40827143824949 +#else + 21060490, 31341688, 15712756, 29218333, 1639039, 10656336, + 23845965, 21679594, 57124405, 608371 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1239289043050212, 1744654158124578, 758702410031698, + 1796762995074688, 1603056663766 +#else + 53436132, 18466845, 56219170, 25997372, 61071954, 11305546, + 1123968, 26773855, 27229398, 23887 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2232056027107988, 987343914584615, 2115594492994461, + 1819598072792159, 1119305654014850 +#else + 43864724, 33260226, 55364135, 14712570, 37643165, 31524814, + 12797023, 27114124, 65475458, 16678953 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 320153677847348, 939613871605645, 641883205761567, + 1930009789398224, 329165806634126 +#else + 37608244, 4770661, 51054477, 14001337, 7830047, 9564805, + 65600720, 28759386, 49939598, 4904952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 980930490474130, 1242488692177893, 1251446316964684, + 1086618677993530, 1961430968465772 +#else + 24059538, 14617003, 19037157, 18514524, 19766092, 18648003, + 5169210, 16191880, 2128236, 29227599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 276821765317453, 1536835591188030, 1305212741412361, + 61473904210175, 2051377036983058 +#else + 50127693, 4124965, 58568254, 22900634, 30336521, 19449185, + 37302527, 916032, 60226322, 30567899 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 833449923882501, 1750270368490475, 1123347002068295, + 185477424765687, 278090826653186 +#else + 44477957, 12419371, 59974635, 26081060, 50629959, 16739174, + 285431, 2763829, 15736322, 4143876 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 794524995833413, 1849907304548286, 53348672473145, + 1272368559505217, 1147304168324779 +#else + 2379333, 11839345, 62998462, 27565766, 11274297, 794957, 212801, + 18959769, 23527083, 17096164 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1504846112759364, 1203096289004681, 562139421471418, + 274333017451844, 1284344053775441 +#else + 33431108, 22423954, 49269897, 17927531, 8909498, 8376530, + 34483524, 4087880, 51919953, 19138217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 483048732424432, 2116063063343382, 30120189902313, + 292451576741007, 1156379271702225 +#else + 1767664, 7197987, 53903638, 31531796, 54017513, 448825, 5799055, + 4357868, 62334673, 17231393 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 928372153029038, 2147692869914564, 1455665844462196, + 1986737809425946, 185207050258089 +#else + 6721966, 13833823, 43585476, 32003117, 26354292, 21691111, + 23365146, 29604700, 7390889, 2759800 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 137732961814206, 706670923917341, 1387038086865771, + 1965643813686352, 1384777115696347 +#else + 4409022, 2052381, 23373853, 10530217, 7676779, 20668478, + 21302352, 29290375, 1244379, 20634787 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 481144981981577, 2053319313589856, 2065402289827512, + 617954271490316, 1106602634668125 +#else + 62687625, 7169618, 4982368, 30596842, 30256824, 30776892, + 14086412, 9208236, 15886429, 16489664 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 696298019648792, 893299659040895, 1148636718636009, + 26734077349617, 2203955659340681 +#else + 1996056, 10375649, 14346367, 13311202, 60234729, 17116020, + 53415665, 398368, 36502409, 32841498 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 657390353372855, 998499966885562, 991893336905797, + 810470207106761, 343139804608786 +#else + 41801399, 9795879, 64331450, 14878808, 33577029, 14780362, + 13348553, 12076947, 36272402, 5113181 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 791736669492960, 934767652997115, 824656780392914, + 1759463253018643, 361530362383518 +#else + 49338080, 11797795, 31950843, 13929123, 41220562, 12288343, + 36767763, 26218045, 13847710, 5387222 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022541353055597, 2094700262587466, 1551008075025686, + 242785517418164, 695985404963562 +#else + 48526701, 30138214, 17824842, 31213466, 22744342, 23111821, + 8763060, 3617786, 47508202, 10370990 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287487199965223, 2215311941380308, 1552928390931986, + 1664859529680196, 1125004975265243 +#else + 20246567, 19185054, 22358228, 33010720, 18507282, 23140436, + 14554436, 24808340, 32232923, 16763880 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 677434665154918, 989582503122485, 1817429540898386, + 1052904935475344, 1143826298169798 +#else + 9648486, 10094563, 26416693, 14745928, 36734546, 27081810, + 11094160, 15689506, 3140038, 17044340 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 367266328308408, 318431188922404, 695629353755355, + 634085657580832, 24581612564426 +#else + 50948792, 5472694, 31895588, 4744994, 8823515, 10365685, + 39884064, 9448612, 38334410, 366294 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 773360688841258, 1815381330538070, 363773437667376, + 539629987070205, 783280434248437 +#else + 19153450, 11523972, 56012374, 27051289, 42461232, 5420646, + 28344573, 8041113, 719605, 11671788 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 180820816194166, 168937968377394, 748416242794470, + 1227281252254508, 1567587861004268 +#else + 8678006, 2694440, 60300850, 2517371, 4964326, 11152271, + 51675948, 18287915, 27000812, 23358879 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 478775558583645, 2062896624554807, 699391259285399, + 358099408427873, 1277310261461761 +#else + 51950941, 7134311, 8639287, 30739555, 59873175, 10421741, + 564065, 5336097, 6750977, 19033406 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1984740906540026, 1079164179400229, 1056021349262661, + 1659958556483663, 1088529069025527 +#else + 11836410, 29574944, 26297893, 16080799, 23455045, 15735944, + 1695823, 24735310, 8169719, 16220347 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 580736401511151, 1842931091388998, 1177201471228238, + 2075460256527244, 1301133425678027 +#else + 48993007, 8653646, 17578566, 27461813, 59083086, 17541668, + 55964556, 30926767, 61118155, 19388398 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1515728832059182, 1575261009617579, 1510246567196186, + 191078022609704, 116661716289141 +#else + 43800366, 22586119, 15213227, 23473218, 36255258, 22504427, + 27884328, 2847284, 2655861, 1738395 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295295738269652, 1714742313707026, 545583042462581, + 2034411676262552, 1513248090013606 +#else + 39571412, 19301410, 41772562, 25551651, 57738101, 8129820, + 21651608, 30315096, 48021414, 22549153 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 230710545179830, 30821514358353, 760704303452229, + 390668103790604, 573437871383156 +#else + 1533110, 3437855, 23735889, 459276, 29970501, 11335377, + 26030092, 5821408, 10478196, 8544890 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1169380107545646, 263167233745614, 2022901299054448, + 819900753251120, 2023898464874585 +#else + 32173102, 17425121, 24896206, 3921497, 22579056, 30143578, + 19270448, 12217473, 17789017, 30158437 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102254323485823, 1570832666216754, 34696906544624, + 1993213739807337, 70638552271463 +#else + 36555903, 31326030, 51530034, 23407230, 13243888, 517024, + 15479401, 29701199, 30460519, 1052596 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 894132856735058, 548675863558441, 845349339503395, + 1942269668326667, 1615682209874691 +#else + 55493970, 13323617, 32618793, 8175907, 51878691, 12596686, + 27491595, 28942073, 3179267, 24075541 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287670217537834, 1222355136884920, 1846481788678694, + 1150426571265110, 1613523400722047 +#else + 31947050, 19187781, 62468280, 18214510, 51982886, 27514722, + 52352086, 17142691, 19072639, 24043372 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 793388516527298, 1315457083650035, 1972286999342417, + 1901825953052455, 338269477222410 +#else + 11685058, 11822410, 3158003, 19601838, 33402193, 29389366, + 5977895, 28339415, 473098, 5040608 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 550201530671806, 778605267108140, 2063911101902983, + 115500557286349, 2041641272971022 +#else + 46817982, 8198641, 39698732, 11602122, 1290375, 30754672, + 28326861, 1721092, 47550222, 30422825 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 717255318455100, 519313764361315, 2080406977303708, + 541981206705521, 774328150311600 +#else + 7881532, 10687937, 7578723, 7738378, 48157852, 31000479, + 21820785, 8076149, 39240368, 11538388 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 261715221532238, 1795354330069993, 1496878026850283, + 499739720521052, 389031152673770 +#else + 47173198, 3899860, 18283497, 26752864, 51380203, 22305220, + 8754524, 7446702, 61432810, 5797015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1997217696294013, 1717306351628065, 1684313917746180, + 1644426076011410, 1857378133465451 +#else + 55813245, 29760862, 51326753, 25589858, 12708868, 25098233, + 2014098, 24503858, 64739691, 27677090 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1475434724792648, 76931896285979, 1116729029771667, + 2002544139318042, 725547833803938 +#else + 44636488, 21985690, 39426843, 1146374, 18956691, 16640559, + 1192730, 29840233, 15123618, 10811505 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022306639183567, 726296063571875, 315345054448644, + 1058733329149221, 1448201136060677 +#else + 14352079, 30134717, 48166819, 10822654, 32750596, 4699007, + 67038501, 15776355, 38222085, 21579878 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1710065158525665, 1895094923036397, 123988286168546, + 1145519900776355, 1607510767693874 +#else + 38867681, 25481956, 62129901, 28239114, 29416930, 1847569, + 46454691, 17069576, 4714546, 23953777 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 561605375422540, 1071733543815037, 131496498800990, + 1946868434569999, 828138133964203 +#else + 15200332, 8368572, 19679101, 15970074, 35236190, 1959450, + 24611599, 29010600, 55362987, 12340219 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1548495173745801, 442310529226540, 998072547000384, + 553054358385281, 644824326376171 +#else + 12876937, 23074376, 33134380, 6590940, 60801088, 14872439, + 9613953, 8241152, 15370987, 9608631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1445526537029440, 2225519789662536, 914628859347385, + 1064754194555068, 1660295614401091 +#else + 62965568, 21540023, 8446280, 33162829, 4407737, 13629032, + 59383996, 15866073, 38898243, 24740332 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1199690223111956, 24028135822341, 66638289244341, + 57626156285975, 565093967979607 +#else + 26660628, 17876777, 8393733, 358047, 59707573, 992987, 43204631, + 858696, 20571223, 8420556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 876926774220824, 554618976488214, 1012056309841565, + 839961821554611, 1414499340307677 +#else + 14620696, 13067227, 51661590, 8264466, 14106269, 15080814, + 33531827, 12516406, 45534429, 21077682 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 703047626104145, 1266841406201770, 165556500219173, + 486991595001879, 1011325891650656 +#else + 236881, 10476226, 57258, 18877408, 6472997, 2466984, 17258519, + 7256740, 8791136, 15069930 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1622861044480487, 1156394801573634, 1869132565415504, + 327103985777730, 2095342781472284 +#else + 1276391, 24182514, 22949634, 17231625, 43615824, 27852245, + 14711874, 4874229, 36445724, 31223040 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 334886927423922, 489511099221528, 129160865966726, + 1720809113143481, 619700195649254 +#else + 5855666, 4990204, 53397016, 7294283, 59304582, 1924646, + 65685689, 25642053, 34039526, 9234252 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1646545795166119, 1758370782583567, 714746174550637, + 1472693650165135, 898994790308209 +#else + 20590503, 24535444, 31529743, 26201766, 64402029, 10650547, + 31559055, 21944845, 18979185, 13396066 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 333403773039279, 295772542452938, 1693106465353610, + 912330357530760, 471235657950362 +#else + 24474287, 4968103, 22267082, 4407354, 24063882, 25229252, + 48291976, 13594781, 33514650, 7021958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1811196219982022, 1068969825533602, 289602974833439, + 1988956043611592, 863562343398367 +#else + 55541958, 26988926, 45743778, 15928891, 40950559, 4315420, + 41160136, 29637754, 45628383, 12868081 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 906282429780072, 2108672665779781, 432396390473936, + 150625823801893, 1708930497638539 +#else + 38473832, 13504660, 19988037, 31421671, 21078224, 6443208, + 45662757, 2244499, 54653067, 25465048 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 925664675702328, 21416848568684, 1831436641861340, + 601157008940113, 371818055044496 +#else + 36513336, 13793478, 61256044, 319135, 41385692, 27290532, + 33086545, 8957937, 51875216, 5540520 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1479786007267725, 1738881859066675, 68646196476567, + 2146507056100328, 1247662817535471 +#else + 55478669, 22050529, 58989363, 25911358, 2620055, 1022908, + 43398120, 31985447, 50980335, 18591624 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 52035296774456, 939969390708103, 312023458773250, + 59873523517659, 1231345905848899 +#else + 23152952, 775386, 27395463, 14006635, 57407746, 4649511, + 1689819, 892185, 55595587, 18348483 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 643355106415761, 290186807495774, 2013561737429023, + 319648069511546, 393736678496162 +#else + 9770129, 9586738, 26496094, 4324120, 1556511, 30004408, + 27453818, 4763127, 47929250, 5867133 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 129358342392716, 1932811617704777, 1176749390799681, + 398040349861790, 1170779668090425 +#else + 34343820, 1927589, 31726409, 28801137, 23962433, 17534932, + 27846558, 5931263, 37359161, 17445976 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2051980782668029, 121859921510665, 2048329875753063, + 1235229850149665, 519062146124755 +#else + 27461885, 30576896, 22380809, 1815854, 44075111, 30522493, + 7283489, 18406359, 47582163, 7734628 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1608170971973096, 415809060360428, 1350468408164766, + 2038620059057678, 1026904485989112 +#else + 59098600, 23963614, 55988460, 6196037, 29344158, 20123547, + 7585294, 30377806, 18549496, 15302069 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1837656083115103, 1510134048812070, 906263674192061, + 1821064197805734, 565375124676301 +#else + 34450527, 27383209, 59436070, 22502750, 6258877, 13504381, + 10458790, 27135971, 58236621, 8424745 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 578027192365650, 2034800251375322, 2128954087207123, + 478816193810521, 2196171989962750 +#else + 24687186, 8613276, 36441818, 30320886, 1863891, 31723888, + 19206233, 7134917, 55824382, 32725512 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1633188840273139, 852787172373708, 1548762607215796, + 1266275218902681, 1107218203325133 +#else + 11334899, 24336410, 8025292, 12707519, 17523892, 23078361, + 10243737, 18868971, 62042829, 16498836 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 462189358480054, 1784816734159228, 1611334301651368, + 1303938263943540, 707589560319424 +#else + 8911542, 6887158, 57524604, 26595841, 11145640, 24010752, + 17303924, 19430194, 6536640, 10543906 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1038829280972848, 38176604650029, 753193246598573, + 1136076426528122, 595709990562434 +#else + 38162480, 15479762, 49642029, 568875, 65611181, 11223453, + 64439674, 16928857, 39873154, 8876770 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1408451820859834, 2194984964010833, 2198361797561729, + 1061962440055713, 1645147963442934 +#else + 41365946, 20987567, 51458897, 32707824, 34082177, 32758143, + 33627041, 15824473, 66504438, 24514614 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 4701053362120, 1647641066302348, 1047553002242085, + 1923635013395977, 206970314902065 +#else + 10330056, 70051, 7957388, 24551765, 9764901, 15609756, 27698697, + 28664395, 1657393, 3084098 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1750479161778571, 1362553355169293, 1891721260220598, + 966109370862782, 1024913988299801 +#else + 10477963, 26084172, 12119565, 20303627, 29016246, 28188843, + 31280318, 14396151, 36875289, 15272408 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 212699049131723, 1117950018299775, 1873945661751056, + 1403802921984058, 130896082652698 +#else + 54820555, 3169462, 28813183, 16658753, 25116432, 27923966, + 41934906, 20918293, 42094106, 1950503 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 636808533673210, 1262201711667560, 390951380330599, + 1663420692697294, 561951321757406 +#else + 40928506, 9489186, 11053416, 18808271, 36055143, 5825629, + 58724558, 24786899, 15341278, 8373727 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 520731594438141, 1446301499955692, 273753264629267, + 1565101517999256, 1019411827004672 +#else + 28685821, 7759505, 52730348, 21551571, 35137043, 4079241, + 298136, 23321830, 64230656, 15190419 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 926527492029409, 1191853477411379, 734233225181171, + 184038887541270, 1790426146325343 +#else + 34175969, 13806335, 52771379, 17760000, 43104243, 10940927, + 8669718, 2742393, 41075551, 26679428 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1464651961852572, 1483737295721717, 1519450561335517, + 1161429831763785, 405914998179977 +#else + 65528476, 21825014, 41129205, 22109408, 49696989, 22641577, + 9291593, 17306653, 54954121, 6048604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996126634382301, 796204125879525, 127517800546509, + 344155944689303, 615279846169038 +#else + 36803549, 14843443, 1539301, 11864366, 20201677, 1900163, + 13934231, 5128323, 11213262, 9168384 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 738724080975276, 2188666632415296, 1961313708559162, + 1506545807547587, 1151301638969740 +#else + 40828332, 11007846, 19408960, 32613674, 48515898, 29225851, + 62020803, 22449281, 20470156, 17155731 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622917337413835, 1218989177089035, 1284857712846592, + 970502061709359, 351025208117090 +#else + 43972811, 9282191, 14855179, 18164354, 59746048, 19145871, + 44324911, 14461607, 14042978, 5230683 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2067814584765580, 1677855129927492, 2086109782475197, + 235286517313238, 1416314046739645 +#else + 29969548, 30812838, 50396996, 25001989, 9175485, 31085458, + 21556950, 3506042, 61174973, 21104723 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 586844262630358, 307444381952195, 458399356043426, + 602068024507062, 1028548203415243 +#else + 63964118, 8744660, 19704003, 4581278, 46678178, 6830682, + 45824694, 8971512, 38569675, 15326562 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 678489922928203, 2016657584724032, 90977383049628, + 1026831907234582, 615271492942522 +#else + 47644235, 10110287, 49846336, 30050539, 43608476, 1355668, + 51585814, 15300987, 46594746, 9168259 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301225714012278, 1094837270268560, 1202288391010439, + 644352775178361, 1647055902137983 +#else + 61755510, 4488612, 43305616, 16314346, 7780487, 17915493, + 38160505, 9601604, 33087103, 24543045 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1210746697896478, 1416608304244708, 686487477217856, + 1245131191434135, 1051238336855737 +#else + 47665694, 18041531, 46311396, 21109108, 37284416, 10229460, + 39664535, 18553900, 61111993, 15664671 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1135604073198207, 1683322080485474, 769147804376683, + 2086688130589414, 900445683120379 +#else + 23294591, 16921819, 44458082, 25083453, 27844203, 11461195, + 13099750, 31094076, 18151675, 13417686 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1971518477615628, 401909519527336, 448627091057375, + 1409486868273821, 1214789035034363 +#else + 42385932, 29377914, 35958184, 5988918, 40250079, 6685064, + 1661597, 21002991, 15271675, 18101767 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1364039144731711, 1897497433586190, 2203097701135459, + 145461396811251, 1349844460790699 +#else + 11433023, 20325767, 8239630, 28274915, 65123427, 32828713, + 48410099, 2167543, 60187563, 20114249 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1045230323257973, 818206601145807, 630513189076103, + 1672046528998132, 807204017562437 +#else + 35672693, 15575145, 30436815, 12192228, 44645511, 9395378, + 57191156, 24915434, 12215109, 12028277 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 439961968385997, 386362664488986, 1382706320807688, + 309894000125359, 2207801346498567 +#else + 14098381, 6555944, 23007258, 5757252, 51681032, 20603929, + 30123439, 4617780, 50208775, 32898803 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1229004686397588, 920643968530863, 123975893911178, + 681423993215777, 1400559197080973 +#else + 63082644, 18313596, 11893167, 13718664, 52299402, 1847384, + 51288865, 10154008, 23973261, 20869958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2003766096898049, 170074059235165, 1141124258967971, + 1485419893480973, 1573762821028725 +#else + 40577025, 29858441, 65199965, 2534300, 35238307, 17004076, + 18341389, 22134481, 32013173, 23450893 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 729905708611432, 1270323270673202, 123353058984288, + 426460209632942, 2195574535456672 +#else + 41629544, 10876442, 55337778, 18929291, 54739296, 1838103, + 21911214, 6354752, 4425632, 32716610 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1271140255321235, 2044363183174497, 52125387634689, + 1445120246694705, 942541986339084 +#else + 56675475, 18941465, 22229857, 30463385, 53917697, 776728, + 49693489, 21533969, 4725004, 14044970 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1761608437466135, 583360847526804, 1586706389685493, + 2157056599579261, 1170692369685772 +#else + 19268631, 26250011, 1555348, 8692754, 45634805, 23643767, + 6347389, 32142648, 47586572, 17444675 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 871476219910823, 1878769545097794, 2241832391238412, + 548957640601001, 690047440233174 +#else + 42244775, 12986007, 56209986, 27995847, 55796492, 33405905, + 19541417, 8180106, 9282262, 10282508 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 297194732135507, 1366347803776820, 1301185512245601, + 561849853336294, 1533554921345731 +#else + 40903763, 4428546, 58447668, 20360168, 4098401, 19389175, + 15522534, 8372215, 5542595, 22851749 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 999628998628371, 1132836708493400, 2084741674517453, + 469343353015612, 678782988708035 +#else + 56546323, 14895632, 26814552, 16880582, 49628109, 31065071, + 64326972, 6993760, 49014979, 10114654 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2189427607417022, 699801937082607, 412764402319267, + 1478091893643349, 2244675696854460 +#else + 47001790, 32625013, 31422703, 10427861, 59998115, 6150668, + 38017109, 22025285, 25953724, 33448274 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1712292055966563, 204413590624874, 1405738637332841, + 408981300829763, 861082219276721 +#else + 62874467, 25515139, 57989738, 3045999, 2101609, 20947138, + 19390019, 6094296, 63793585, 12831124 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 508561155940631, 966928475686665, 2236717801150132, + 424543858577297, 2089272956986143 +#else + 51110167, 7578151, 5310217, 14408357, 33560244, 33329692, + 31575953, 6326196, 7381791, 31132593 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 221245220129925, 1156020201681217, 491145634799213, + 542422431960839, 828100817819207 +#else + 46206085, 3296810, 24736065, 17226043, 18374253, 7318640, + 6295303, 8082724, 51746375, 12339663 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 153756971240384, 1299874139923977, 393099165260502, + 1058234455773022, 996989038681183 +#else + 27724736, 2291157, 6088201, 19369634, 1792726, 5857634, + 13848414, 15768922, 25091167, 14856294 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 559086812798481, 573177704212711, 1629737083816402, + 1399819713462595, 1646954378266038 +#else + 48242193, 8331042, 24373479, 8541013, 66406866, 24284974, + 12927299, 20858939, 44926390, 24541532 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1887963056288059, 228507035730124, 1468368348640282, + 930557653420194, 613513962454686 +#else + 55685435, 28132841, 11632844, 3405020, 30536730, 21880393, + 39848098, 13866389, 30146206, 9142070 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1224529808187553, 1577022856702685, 2206946542980843, + 625883007765001, 279930793512158 +#else + 3924129, 18246916, 53291741, 23499471, 12291819, 32886066, + 39406089, 9326383, 58871006, 4171293 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1076287717051609, 1114455570543035, 187297059715481, + 250446884292121, 1885187512550540 +#else + 51186905, 16037936, 6713787, 16606682, 45496729, 2790943, + 26396185, 3731949, 345228, 28091483 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 902497362940219, 76749815795675, 1657927525633846, + 1420238379745202, 1340321636548352 +#else + 45781307, 13448258, 25284571, 1143661, 20614966, 24705045, + 2031538, 21163201, 50855680, 19972348 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1129576631190784, 1281994010027327, 996844254743018, + 257876363489249, 1150850742055018 +#else + 31016192, 16832003, 26371391, 19103199, 62081514, 14854136, + 17477601, 3842657, 28012650, 17149012 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 628740660038789, 1943038498527841, 467786347793886, + 1093341428303375, 235413859513003 +#else + 62033029, 9368965, 58546785, 28953529, 51858910, 6970559, + 57918991, 16292056, 58241707, 3507939 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 237425418909360, 469614029179605, 1512389769174935, + 1241726368345357, 441602891065214 +#else + 29439664, 3537914, 23333589, 6997794, 49553303, 22536363, + 51899661, 18503164, 57943934, 6580395 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1736417953058555, 726531315520508, 1833335034432527, + 1629442561574747, 624418919286085 +#else + 54923003, 25874643, 16438268, 10826160, 58412047, 27318820, + 17860443, 24280586, 65013061, 9304566 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1960754663920689, 497040957888962, 1909832851283095, + 1271432136996826, 2219780368020940 +#else + 20714545, 29217521, 29088194, 7406487, 11426967, 28458727, + 14792666, 18945815, 5289420, 33077305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1537037379417136, 1358865369268262, 2130838645654099, + 828733687040705, 1999987652890901 +#else + 50443312, 22903641, 60948518, 20248671, 9192019, 31751970, + 17271489, 12349094, 26939669, 29802138 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 629042105241814, 1098854999137608, 887281544569320, + 1423102019874777, 7911258951561 +#else + 54218966, 9373457, 31595848, 16374215, 21471720, 13221525, + 39825369, 21205872, 63410057, 117886 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1811562332665373, 1501882019007673, 2213763501088999, + 359573079719636, 36370565049116 +#else + 22263325, 26994382, 3984569, 22379786, 51994855, 32987646, + 28311252, 5358056, 43789084, 541963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 218907117361280, 1209298913016966, 1944312619096112, + 1130690631451061, 1342327389191701 +#else + 16259200, 3261970, 2309254, 18019958, 50223152, 28972515, + 24134069, 16848603, 53771797, 20002236 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1369976867854704, 1396479602419169, 1765656654398856, + 2203659200586299, 998327836117241 +#else + 9378160, 20414246, 44262881, 20809167, 28198280, 26310334, + 64709179, 32837080, 690425, 14876244 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2230701885562825, 1348173180338974, 2172856128624598, + 1426538746123771, 444193481326151 +#else + 24977353, 33240048, 58884894, 20089345, 28432342, 32378079, + 54040059, 21257083, 44727879, 6618998 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 784210426627951, 918204562375674, 1284546780452985, + 1324534636134684, 1872449409642708 +#else + 65570671, 11685645, 12944378, 13682314, 42719353, 19141238, + 8044828, 19737104, 32239828, 27901670 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 319638829540294, 596282656808406, 2037902696412608, + 1557219121643918, 341938082688094 +#else + 48505798, 4762989, 66182614, 8885303, 38696384, 30367116, + 9781646, 23204373, 32779358, 5095274 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1901860206695915, 2004489122065736, 1625847061568236, + 973529743399879, 2075287685312905 +#else + 34100715, 28339925, 34843976, 29869215, 9460460, 24227009, + 42507207, 14506723, 21639561, 30924196 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1371853944110545, 1042332820512553, 1949855697918254, + 1791195775521505, 37487364849293 +#else + 50707921, 20442216, 25239337, 15531969, 3987758, 29055114, + 65819361, 26690896, 17874573, 558605 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 687200189577855, 1082536651125675, 644224940871546, + 340923196057951, 343581346747396 +#else + 53508735, 10240080, 9171883, 16131053, 46239610, 9599699, + 33499487, 5080151, 2085892, 5119761 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2082717129583892, 27829425539422, 145655066671970, + 1690527209845512, 1865260509673478 +#else + 44903700, 31034903, 50727262, 414690, 42089314, 2170429, + 30634760, 25190818, 35108870, 27794547 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1059729620568824, 2163709103470266, 1440302280256872, + 1769143160546397, 869830310425069 +#else + 60263160, 15791201, 8550074, 32241778, 29928808, 21462176, + 27534429, 26362287, 44757485, 12961481 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1609516219779025, 777277757338817, 2101121130363987, + 550762194946473, 1905542338659364 +#else + 42616785, 23983660, 10368193, 11582341, 43711571, 31309144, + 16533929, 8206996, 36914212, 28394793 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2024821921041576, 426948675450149, 595133284085473, + 471860860885970, 600321679413000 +#else + 55987368, 30172197, 2307365, 6362031, 66973409, 8868176, + 50273234, 7031274, 7589640, 8945490 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 598474602406721, 1468128276358244, 1191923149557635, + 1501376424093216, 1281662691293476 +#else + 34956097, 8917966, 6661220, 21876816, 65916803, 17761038, + 7251488, 22372252, 24099108, 19098262 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1721138489890707, 1264336102277790, 433064545421287, + 1359988423149466, 1561871293409447 +#else + 5019539, 25646962, 4244126, 18840076, 40175591, 6453164, + 47990682, 20265406, 60876967, 23273695 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 719520245587143, 393380711632345, 132350400863381, + 1543271270810729, 1819543295798660 +#else + 10853575, 10721687, 26480089, 5861829, 44113045, 1972174, + 65242217, 22996533, 63745412, 27113307 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 396397949784152, 1811354474471839, 1362679985304303, + 2117033964846756, 498041172552279 +#else + 50106456, 5906789, 221599, 26991285, 7828207, 20305514, + 24362660, 31546264, 53242455, 7421391 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1812471844975748, 1856491995543149, 126579494584102, + 1036244859282620, 1975108050082550 +#else + 8139908, 27007935, 32257645, 27663886, 30375718, 1886181, + 45933756, 15441251, 28826358, 29431403 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 650623932407995, 1137551288410575, 2125223403615539, + 1725658013221271, 2134892965117796 +#else + 6267067, 9695052, 7709135, 16950835, 34239795, 31668296, + 14795159, 25714308, 13746020, 31812384 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 522584000310195, 1241762481390450, 1743702789495384, + 2227404127826575, 1686746002148897 +#else + 28584883, 7787108, 60375922, 18503702, 22846040, 25983196, + 63926927, 33190907, 4771361, 25134474 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 427904865186312, 1703211129693455, 1585368107547509, + 1436984488744336, 761188534613978 +#else + 24949256, 6376279, 39642383, 25379823, 48462709, 23623825, + 33543568, 21412737, 3569626, 11342593 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 318101947455002, 248138407995851, 1481904195303927, + 309278454311197, 1258516760217879 +#else + 26514970, 4740088, 27912651, 3697550, 19331575, 22082093, + 6809885, 4608608, 7325975, 18753361 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1275068538599310, 513726919533379, 349926553492294, + 688428871968420, 1702400196000666 +#else + 55490446, 19000001, 42787651, 7655127, 65739590, 5214311, + 39708324, 10258389, 49462170, 25367739 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1061864036265233, 961611260325381, 321859632700838, + 1045600629959517, 1985130202504038 +#else + 11431185, 15823007, 26570245, 14329124, 18029990, 4796082, + 35662685, 15580663, 9280358, 29580745 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1558816436882417, 1962896332636523, 1337709822062152, + 1501413830776938, 294436165831932 +#else + 66948081, 23228174, 44253547, 29249434, 46247496, 19933429, + 34297962, 22372809, 51563772, 4387440 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 818359826554971, 1862173000996177, 626821592884859, + 573655738872376, 1749691246745455 +#else + 46309467, 12194511, 3937617, 27748540, 39954043, 9340369, + 42594872, 8548136, 20617071, 26072431 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1988022651432119, 1082111498586040, 1834020786104821, + 1454826876423687, 692929915223122 +#else + 66170039, 29623845, 58394552, 16124717, 24603125, 27329039, + 53333511, 21678609, 24345682, 10325460 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2146513703733331, 584788900394667, 464965657279958, + 2183973639356127, 238371159456790 +#else + 47253587, 31985546, 44906155, 8714033, 14007766, 6928528, + 16318175, 32543743, 4766742, 3552007 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1129007025494441, 2197883144413266, 265142755578169, + 971864464758890, 1983715884903702 +#else + 45357481, 16823515, 1351762, 32751011, 63099193, 3950934, + 3217514, 14481909, 10988822, 29559670 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1291366624493075, 381456718189114, 1711482489312444, + 1815233647702022, 892279782992467 +#else + 15564307, 19242862, 3101242, 5684148, 30446780, 25503076, + 12677126, 27049089, 58813011, 13296004 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 444548969917454, 1452286453853356, 2113731441506810, + 645188273895859, 810317625309512 +#else + 57666574, 6624295, 36809900, 21640754, 62437882, 31497052, + 31521203, 9614054, 37108040, 12074673 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2242724082797924, 1373354730327868, 1006520110883049, + 2147330369940688, 1151816104883620 +#else + 4771172, 33419193, 14290748, 20464580, 27992297, 14998318, + 65694928, 31997715, 29832612, 17163397 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1745720200383796, 1911723143175317, 2056329390702074, + 355227174309849, 879232794371100 +#else + 7064884, 26013258, 47946901, 28486894, 48217594, 30641695, + 25825241, 5293297, 39986204, 13101589 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 163723479936298, 115424889803150, 1156016391581227, + 1894942220753364, 1970549419986329 +#else + 64810282, 2439669, 59642254, 1719964, 39841323, 17225986, + 32512468, 28236839, 36752793, 29363474 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 681981452362484, 267208874112496, 1374683991933094, + 638600984916117, 646178654558546 +#else + 37102324, 10162315, 33928688, 3981722, 50626726, 20484387, + 14413973, 9515896, 19568978, 9628812 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 13378654854251, 106237307029567, 1944412051589651, + 1841976767925457, 230702819835573 +#else + 33053803, 199357, 15894591, 1583059, 27380243, 28973997, + 49269969, 27447592, 60817077, 3437739 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 260683893467075, 854060306077237, 913639551980112, + 4704576840123, 280254810808712 +#else + 48129987, 3884492, 19469877, 12726490, 15913552, 13614290, + 44147131, 70103, 7463304, 4176122 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 715374893080287, 1173334812210491, 1806524662079626, + 1894596008000979, 398905715033393 +#else + 39984863, 10659916, 11482427, 17484051, 12771466, 26919315, + 34389459, 28231680, 24216881, 5944158 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 500026409727661, 1596431288195371, 1420380351989370, + 985211561521489, 392444930785633 +#else + 8894125, 7450974, 64444715, 23788679, 39028346, 21165316, + 19345745, 14680796, 11632993, 5847885 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2096421546958141, 1922523000950363, 789831022876840, + 427295144688779, 320923973161730 +#else + 26942781, 31239115, 9129563, 28647825, 26024104, 11769399, + 55590027, 6367193, 57381634, 4782139 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1927770723575450, 1485792977512719, 1850996108474547, + 551696031508956, 2126047405475647 +#else + 19916442, 28726022, 44198159, 22140040, 25606323, 27581991, + 33253852, 8220911, 6358847, 31680575 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2112099158080148, 742570803909715, 6484558077432, + 1951119898618916, 93090382703416 +#else + 801428, 31472730, 16569427, 11065167, 29875704, 96627, 7908388, + 29073952, 53570360, 1387154 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 383905201636970, 859946997631870, 855623867637644, + 1017125780577795, 794250831877809 +#else + 19646058, 5720633, 55692158, 12814208, 11607948, 12749789, + 14147075, 15156355, 45242033, 11835259 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 77571826285752, 999304298101753, 487841111777762, + 1038031143212339, 339066367948762 +#else + 19299512, 1155910, 28703737, 14890794, 2925026, 7269399, + 26121523, 15467869, 40548314, 5052482 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 674994775520533, 266035846330789, 826951213393478, + 1405007746162285, 1781791018620876 +#else + 64091413, 10058205, 1980837, 3964243, 22160966, 12322533, + 60677741, 20936246, 12228556, 26550755 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1001412661522686, 348196197067298, 1666614366723946, + 888424995032760, 580747687801357 +#else + 32944382, 14922211, 44263970, 5188527, 21913450, 24834489, + 4001464, 13238564, 60994061, 8653814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1939560076207777, 1409892634407635, 552574736069277, + 383854338280405, 190706709864139 +#else + 22865569, 28901697, 27603667, 21009037, 14348957, 8234005, + 24808405, 5719875, 28483275, 2841751 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2177087163428741, 1439255351721944, 1208070840382793, + 2230616362004769, 1396886392021913 +#else + 50687877, 32441126, 66781144, 21446575, 21886281, 18001658, + 65220897, 33238773, 19932057, 20815229 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 676962063230039, 1880275537148808, 2046721011602706, + 888463247083003, 1318301552024067 +#else + 55452759, 10087520, 58243976, 28018288, 47830290, 30498519, + 3999227, 13239134, 62331395, 19644223 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1466980508178206, 617045217998949, 652303580573628, + 757303753529064, 207583137376902 +#else + 1382174, 21859713, 17266789, 9194690, 53784508, 9720080, + 20403944, 11284705, 53095046, 3093229 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1511056752906902, 105403126891277, 493434892772846, + 1091943425335976, 1802717338077427 +#else + 16650902, 22516500, 66044685, 1570628, 58779118, 7352752, + 66806440, 16271224, 43059443, 26862581 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1853982405405128, 1878664056251147, 1528011020803992, + 1019626468153565, 1128438412189035 +#else + 45197768, 27626490, 62497547, 27994275, 35364760, 22769138, + 24123613, 15193618, 45456747, 16815042 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1963939888391106, 293456433791664, 697897559513649, + 985882796904380, 796244541237972 +#else + 57172930, 29264984, 41829040, 4372841, 2087473, 10399484, + 31870908, 14690798, 17361620, 11864968 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 416770998629779, 389655552427054, 1314476859406756, + 1749382513022778, 1161905598739491 +#else + 55801235, 6210371, 13206574, 5806320, 38091172, 19587231, + 54777658, 26067830, 41530403, 17313742 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1428358296490651, 1027115282420478, 304840698058337, + 441410174026628, 1819358356278573 +#else + 14668443, 21284197, 26039038, 15305210, 25515617, 4542480, + 10453892, 6577524, 9145645, 27110552 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 204943430200135, 1554861433819175, 216426658514651, + 264149070665950, 2047097371738319 +#else + 5974855, 3053895, 57675815, 23169240, 35243739, 3225008, + 59136222, 3936127, 61456591, 30504127 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1934415182909034, 1393285083565062, 516409331772960, + 1157690734993892, 121039666594268 +#else + 30625386, 28825032, 41552902, 20761565, 46624288, 7695098, + 17097188, 17250936, 39109084, 1803631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 662035583584445, 286736105093098, 1131773000510616, + 818494214211439, 472943792054479 +#else + 63555773, 9865098, 61880298, 4272700, 61435032, 16864731, + 14911343, 12196514, 45703375, 7047411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665784778135882, 1893179629898606, 808313193813106, + 276797254706413, 1563426179676396 +#else + 20093258, 9920966, 55970670, 28210574, 13161586, 12044805, + 34252013, 4124600, 34765036, 23296865 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 945205108984232, 526277562959295, 1324180513733566, + 1666970227868664, 153547609289173 +#else + 46320040, 14084653, 53577151, 7842146, 19119038, 19731827, + 4752376, 24839792, 45429205, 2288037 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2031433403516252, 203996615228162, 170487168837083, + 981513604791390, 843573964916831 +#else + 40289628, 30270716, 29965058, 3039786, 52635099, 2540456, + 29457502, 14625692, 42289247, 12570231 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1476570093962618, 838514669399805, 1857930577281364, + 2017007352225784, 317085545220047 +#else + 66045306, 22002608, 16920317, 12494842, 1278292, 27685323, + 45948920, 30055751, 55134159, 4724942 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1461557121912842, 1600674043318359, 2157134900399597, + 1670641601940616, 127765583803283 +#else + 17960970, 21778898, 62967895, 23851901, 58232301, 32143814, + 54201480, 24894499, 37532563, 1903855 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1293543509393474, 2143624609202546, 1058361566797508, + 214097127393994, 946888515472729 +#else + 23134274, 19275300, 56426866, 31942495, 20684484, 15770816, + 54119114, 3190295, 26955097, 14109738 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 357067959932916, 1290876214345711, 521245575443703, + 1494975468601005, 800942377643885 +#else + 15308788, 5320727, 36995055, 19235554, 22902007, 7767164, + 29425325, 22276870, 31960941, 11934971 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 566116659100033, 820247422481740, 994464017954148, + 327157611686365, 92591318111744 +#else + 39713153, 8435795, 4109644, 12222639, 42480996, 14818668, + 20638173, 4875028, 10491392, 1379718 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 617256647603209, 1652107761099439, 1857213046645471, + 1085597175214970, 817432759830522 +#else + 53949449, 9197840, 3875503, 24618324, 65725151, 27674630, + 33518458, 16176658, 21432314, 12180697 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 771808161440705, 1323510426395069, 680497615846440, + 851580615547985, 1320806384849017 +#else + 55321537, 11500837, 13787581, 19721842, 44678184, 10140204, + 1465425, 12689540, 56807545, 19681548 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1219260086131915, 647169006596815, 79601124759706, + 2161724213426748, 404861897060198 +#else + 5414091, 18168391, 46101199, 9643569, 12834970, 1186149, + 64485948, 32212200, 26128230, 6032912 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1327968293887866, 1335500852943256, 1401587164534264, + 558137311952440, 1551360549268902 +#else + 40771450, 19788269, 32496024, 19900513, 17847800, 20885276, + 3604024, 8316894, 41233830, 23117073 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 417621685193956, 1429953819744454, 396157358457099, + 1940470778873255, 214000046234152 +#else + 3296484, 6223048, 24680646, 21307972, 44056843, 5903204, + 58246567, 28915267, 12376616, 3188849 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1268047918491973, 2172375426948536, 1533916099229249, + 1761293575457130, 1590622667026765 +#else + 29190469, 18895386, 27549112, 32370916, 3520065, 22857131, + 32049514, 26245319, 50999629, 23702124 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1627072914981959, 2211603081280073, 1912369601616504, + 1191770436221309, 2187309757525860 +#else + 52364359, 24245275, 735817, 32955454, 46701176, 28496527, + 25246077, 17758763, 18640740, 32593455 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1149147819689533, 378692712667677, 828475842424202, + 2218619146419342, 70688125792186 +#else + 60180029, 17123636, 10361373, 5642961, 4910474, 12345252, + 35470478, 33060001, 10530746, 1053335 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1299739417079761, 1438616663452759, 1536729078504412, + 2053896748919838, 1008421032591246 +#else + 37842897, 19367626, 53570647, 21437058, 47651804, 22899047, + 35646494, 30605446, 24018830, 15026644 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2040723824657366, 399555637875075, 632543375452995, + 872649937008051, 1235394727030233 +#else + 44516310, 30409154, 64819587, 5953842, 53668675, 9425630, + 25310643, 13003497, 64794073, 18408815 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2211311599327900, 2139787259888175, 938706616835350, + 12609661139114, 2081897930719789 +#else + 39688860, 32951110, 59064879, 31885314, 41016598, 13987818, + 39811242, 187898, 43942445, 31022696 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1324994503390450, 336982330582631, 1183998925654177, + 1091654665913274, 48727673971319 +#else + 45364466, 19743956, 1844839, 5021428, 56674465, 17642958, + 9716666, 16266922, 62038647, 726098 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1845522914617879, 1222198248335542, 150841072760134, + 1927029069940982, 1189913404498011 +#else + 29370903, 27500434, 7334070, 18212173, 9385286, 2247707, + 53446902, 28714970, 30007387, 17731091 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1079559557592645, 2215338383666441, 1903569501302605, + 49033973033940, 305703433934152 +#else + 66172485, 16086690, 23751945, 33011114, 65941325, 28365395, + 9137108, 730663, 9835848, 4555336 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 94653405416909, 1386121349852999, 1062130477891762, + 36553947479274, 833669648948846 +#else + 43732429, 1410445, 44855111, 20654817, 30867634, 15826977, + 17693930, 544696, 55123566, 12422645 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1432015813136298, 440364795295369, 1395647062821501, + 1976874522764578, 934452372723352 +#else + 31117226, 21338698, 53606025, 6561946, 57231997, 20796761, + 61990178, 29457725, 29120152, 13924425 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1296625309219774, 2068273464883862, 1858621048097805, + 1492281814208508, 2235868981918946 +#else + 49707966, 19321222, 19675798, 30819676, 56101901, 27695611, + 57724924, 22236731, 7240930, 33317044 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1490330266465570, 1858795661361448, 1436241134969763, + 294573218899647, 1208140011028933 +#else + 35747106, 22207651, 52101416, 27698213, 44655523, 21401660, + 1222335, 4389483, 3293637, 18002689 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1282462923712748, 741885683986255, 2027754642827561, + 518989529541027, 1826610009555945 +#else + 50424044, 19110186, 11038543, 11054958, 53307689, 30215898, + 42789283, 7733546, 12796905, 27218610 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1525827120027511, 723686461809551, 1597702369236987, + 244802101764964, 1502833890372311 +#else + 58349431, 22736595, 41689999, 10783768, 36493307, 23807620, + 38855524, 3647835, 3222231, 22393970 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 113622036244513, 1233740067745854, 674109952278496, + 2114345180342965, 166764512856263 +#else + 18606113, 1693100, 41660478, 18384159, 4112352, 10045021, + 23603893, 31506198, 59558087, 2484984 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2041668749310338, 2184405322203901, 1633400637611036, + 2110682505536899, 2048144390084644 +#else + 9255298, 30423235, 54952701, 32550175, 13098012, 24339566, + 16377219, 31451620, 47306788, 30519729 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 503058759232932, 760293024620937, 2027152777219493, + 666858468148475, 1539184379870952 +#else + 44379556, 7496159, 61366665, 11329248, 19991973, 30206930, + 35390715, 9936965, 37011176, 22935634 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1916168475367211, 915626432541343, 883217071712575, + 363427871374304, 1976029821251593 +#else + 21878571, 28553135, 4338335, 13643897, 64071999, 13160959, + 19708896, 5415497, 59748361, 29445138 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 678039535434506, 570587290189340, 1605302676614120, + 2147762562875701, 1706063797091704 +#else + 27736842, 10103576, 12500508, 8502413, 63695848, 23920873, + 10436917, 32004156, 43449720, 25422331 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1439489648586438, 2194580753290951, 832380563557396, + 561521973970522, 584497280718389 +#else + 19492550, 21450067, 37426887, 32701801, 63900692, 12403436, + 30066266, 8367329, 13243957, 8709688 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 187989455492609, 681223515948275, 1933493571072456, + 1872921007304880, 488162364135671 +#else + 12015105, 2801261, 28198131, 10151021, 24818120, 28811299, + 55914672, 27908697, 5150967, 7274186 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1413466089534451, 410844090765630, 1397263346404072, + 408227143123410, 1594561803147811 +#else + 2831347, 21062286, 1478974, 6122054, 23825128, 20820846, + 31097298, 6083058, 31021603, 23760822 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102170800973153, 719462588665004, 1479649438510153, + 1097529543970028, 1302363283777685 +#else + 64578913, 31324785, 445612, 10720828, 53259337, 22048494, + 43601132, 16354464, 15067285, 19406725 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 942065717847195, 1069313679352961, 2007341951411051, + 70973416446291, 1419433790163706 +#else + 7840923, 14037873, 33744001, 15934015, 66380651, 29911725, + 21403987, 1057586, 47729402, 21151211 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1146565545556377, 1661971299445212, 406681704748893, + 564452436406089, 1109109865829139 +#else + 915865, 17085158, 15608284, 24765302, 42751837, 6060029, + 49737545, 8410996, 59888403, 16527024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2214421081775077, 1165671861210569, 1890453018796184, + 3556249878661, 442116172656317 +#else + 32922597, 32997445, 20336073, 17369864, 10903704, 28169945, + 16957573, 52992, 23834301, 6588044 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 753830546620811, 1666955059895019, 1530775289309243, + 1119987029104146, 2164156153857580 +#else + 32752011, 11232950, 3381995, 24839566, 22652987, 22810329, + 17159698, 16689107, 46794284, 32248439 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 615171919212796, 1523849404854568, 854560460547503, + 2067097370290715, 1765325848586042 +#else + 62419196, 9166775, 41398568, 22707125, 11576751, 12733943, + 7924251, 30802151, 1976122, 26305405 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1094538949313667, 1796592198908825, 870221004284388, + 2025558921863561, 1699010892802384 +#else + 21251203, 16309901, 64125849, 26771309, 30810596, 12967303, + 156041, 30183180, 12331344, 25317235 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1951351290725195, 1916457206844795, 198025184438026, + 1909076887557595, 1938542290318919 +#else + 8651595, 29077400, 51023227, 28557437, 13002506, 2950805, + 29054427, 28447462, 10008135, 28886531 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1014323197538413, 869150639940606, 1756009942696599, + 1334952557375672, 1544945379082874 +#else + 31486061, 15114593, 52847614, 12951353, 14369431, 26166587, + 16347320, 19892343, 8684154, 23021480 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 764055910920305, 1603590757375439, 146805246592357, + 1843313433854297, 954279890114939 +#else + 19443825, 11385320, 24468943, 23895364, 43189605, 2187568, + 40845657, 27467510, 31316347, 14219878 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 80113526615750, 764536758732259, 1055139345100233, + 469252651759390, 617897512431515 +#else + 38514374, 1193784, 32245219, 11392485, 31092169, 15722801, + 27146014, 6992409, 29126555, 9207390 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 74497112547268, 740094153192149, 1745254631717581, + 727713886503130, 1283034364416928 +#else + 32382916, 1110093, 18477781, 11028262, 39697101, 26006320, + 62128346, 10843781, 59151264, 19118701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 525892105991110, 1723776830270342, 1476444848991936, + 573789489857760, 133864092632978 +#else + 2814918, 7836403, 27519878, 25686276, 46214848, 22000742, + 45614304, 8550129, 28346258, 1994730 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 542611720192581, 1986812262899321, 1162535242465837, + 481498966143464, 544600533583622 +#else + 47530565, 8085544, 53108345, 29605809, 2785837, 17323125, + 47591912, 7174893, 22628102, 8115180 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 64123227344372, 1239927720647794, 1360722983445904, + 222610813654661, 62429487187991 +#else + 36703732, 955510, 55975026, 18476362, 34661776, 20276352, + 41457285, 3317159, 57165847, 930271 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1793193323953132, 91096687857833, 70945970938921, + 2158587638946380, 1537042406482111 +#else + 51805164, 26720662, 28856489, 1357446, 23421993, 1057177, + 24091212, 32165462, 44343487, 22903716 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1895854577604609, 1394895708949416, 1728548428495944, + 1140864900240149, 563645333603061 +#else + 44357633, 28250434, 54201256, 20785565, 51297352, 25757378, + 52269845, 17000211, 65241845, 8398969 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 141358280486863, 91435889572504, 1087208572552643, + 1829599652522921, 1193307020643647 +#else + 35139535, 2106402, 62372504, 1362500, 12813763, 16200670, + 22981545, 27263159, 18009407, 17781660 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1611230858525381, 950720175540785, 499589887488610, + 2001656988495019, 88977313255908 +#else + 49887941, 24009210, 39324209, 14166834, 29815394, 7444469, + 29551787, 29827013, 19288548, 1325865 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1189080501479658, 2184348804772597, 1040818725742319, + 2018318290311834, 1712060030915354 +#else + 15100138, 17718680, 43184885, 32549333, 40658671, 15509407, + 12376730, 30075286, 33166106, 25511682 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 873966876953756, 1090638350350440, 1708559325189137, + 672344594801910, 1320437969700239 +#else + 20909212, 13023121, 57899112, 16251777, 61330449, 25459517, + 12412150, 10018715, 2213263, 19676059 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1508590048271766, 1131769479776094, 101550868699323, + 428297785557897, 561791648661744 +#else + 32529814, 22479743, 30361438, 16864679, 57972923, 1513225, + 22922121, 6382134, 61341936, 8371347 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 756417570499462, 237882279232602, 2136263418594016, + 1701968045454886, 703713185137472 +#else + 9923462, 11271500, 12616794, 3544722, 37110496, 31832805, + 12891686, 25361300, 40665920, 10486143 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1781187809325462, 1697624151492346, 1381393690939988, + 175194132284669, 1483054666415238 +#else + 44511638, 26541766, 8587002, 25296571, 4084308, 20584370, + 361725, 2610596, 43187334, 22099236 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2175517777364616, 708781536456029, 955668231122942, + 1967557500069555, 2021208005604118 +#else + 5408392, 32417741, 62139741, 10561667, 24145918, 14240566, + 31319731, 29318891, 19985174, 30118346 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115135966606887, 224217372950782, 915967306279222, + 593866251291540, 561747094208006 +#else + 53114407, 16616820, 14549246, 3341099, 32155958, 13648976, + 49531796, 8849296, 65030, 8370684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1443163092879439, 391875531646162, 2180847134654632, + 464538543018753, 1594098196837178 +#else + 58787919, 21504805, 31204562, 5839400, 46481576, 32497154, + 47665921, 6922163, 12743482, 23753914 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 850858855888869, 319436476624586, 327807784938441, + 740785849558761, 17128415486016 +#else + 64747493, 12678784, 28815050, 4759974, 43215817, 4884716, + 23783145, 11038569, 18800704, 255233 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2132756334090067, 536247820155645, 48907151276867, + 608473197600695, 1261689545022784 +#else + 61839187, 31780545, 13957885, 7990715, 23132995, 728773, + 13393847, 9066957, 19258688, 18800639 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1525176236978354, 974205476721062, 293436255662638, + 148269621098039, 137961998433963 +#else + 64172210, 22726896, 56676774, 14516792, 63468078, 4372540, + 35173943, 2209389, 65584811, 2055793 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121075518299410, 2071745529082111, 1265567917414828, + 1648196578317805, 496232102750820 +#else + 580882, 16705327, 5468415, 30871414, 36182444, 18858431, + 59905517, 24560042, 37087844, 7394434 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 122321229299801, 1022922077493685, 2001275453369484, + 2017441881607947, 993205880778002 +#else + 23838809, 1822728, 51370421, 15242726, 8318092, 29821328, + 45436683, 30062226, 62287122, 14799920 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 654925550560074, 1168810995576858, 575655959430926, + 905758704861388, 496774564663534 +#else + 13345610, 9759151, 3371034, 17416641, 16353038, 8577942, + 31129804, 13496856, 58052846, 7402517 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1954109525779738, 2117022646152485, 338102630417180, + 1194140505732026, 107881734943492 +#else + 2286874, 29118501, 47066405, 31546095, 53412636, 5038121, + 11006906, 17794080, 8205060, 1607563 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1714785840001267, 2036500018681589, 1876380234251966, + 2056717182974196, 1645855254384642 +#else + 14414067, 25552300, 3331829, 30346215, 22249150, 27960244, + 18364660, 30647474, 30019586, 24525154 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 106431476499341, 62482972120563, 1513446655109411, + 807258751769522, 538491469114 +#else + 39420813, 1585952, 56333811, 931068, 37988643, 22552112, + 52698034, 12029092, 9944378, 8024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2002850762893643, 1243624520538135, 1486040410574605, + 2184752338181213, 378495998083531 +#else + 4368715, 29844802, 29874199, 18531449, 46878477, 22143727, + 50994269, 32555346, 58966475, 5640029 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 922510868424903, 1089502620807680, 402544072617374, + 1131446598479839, 1290278588136533 +#else + 10299591, 13746483, 11661824, 16234854, 7630238, 5998374, + 9809887, 16859868, 15219797, 19226649 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1867998812076769, 715425053580701, 39968586461416, + 2173068014586163, 653822651801304 +#else + 27425505, 27835351, 3055005, 10660664, 23458024, 595578, + 51710259, 32381236, 48766680, 9742716 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 162892278589453, 182585796682149, 75093073137630, + 497037941226502, 133871727117371 +#else + 6744077, 2427284, 26042789, 2720740, 66260958, 1118973, + 32324614, 7406442, 12420155, 1994844 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1914596576579670, 1608999621851578, 1987629837704609, + 1519655314857977, 1819193753409464 +#else + 14012502, 28529712, 48724410, 23975962, 40623521, 29617992, + 54075385, 22644628, 24319928, 27108099 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1949315551096831, 1069003344994464, 1939165033499916, + 1548227205730856, 1933767655861407 +#else + 16412671, 29047065, 10772640, 15929391, 50040076, 28895810, + 10555944, 23070383, 37006495, 28815383 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1730519386931635, 1393284965610134, 1597143735726030, + 416032382447158, 1429665248828629 +#else + 22397363, 25786748, 57815702, 20761563, 17166286, 23799296, + 39775798, 6199365, 21880021, 21303672 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 360275475604565, 547835731063078, 215360904187529, + 596646739879007, 332709650425085 +#else + 62825557, 5368522, 35991846, 8163388, 36785801, 3209127, + 16557151, 8890729, 8840445, 4957760 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47602113726801, 1522314509708010, 437706261372925, + 814035330438027, 335930650933545 +#else + 51661137, 709326, 60189418, 22684253, 37330941, 6522331, + 45388683, 12130071, 52312361, 5005756 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1291597595523886, 1058020588994081, 402837842324045, + 1363323695882781, 2105763393033193 +#else + 64994094, 19246303, 23019041, 15765735, 41839181, 6002751, + 10183197, 20315106, 50713577, 31378319 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 109521982566564, 1715257748585139, 1112231216891516, + 2046641005101484, 134249157157013 +#else + 48083108, 1632004, 13466291, 25559332, 43468412, 16573536, + 35094956, 30497327, 22208661, 2000468 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2156991030936798, 2227544497153325, 1869050094431622, + 754875860479115, 1754242344267058 +#else + 3065054, 32141671, 41510189, 33192999, 49425798, 27851016, + 58944651, 11248526, 63417650, 26140247 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1846089562873800, 98894784984326, 1412430299204844, + 171351226625762, 1100604760929008 +#else + 10379208, 27508878, 8877318, 1473647, 37817580, 21046851, + 16690914, 2553332, 63976176, 16400288 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 84172382130492, 499710970700046, 425749630620778, + 1762872794206857, 612842602127960 +#else + 15716668, 1254266, 48636174, 7446273, 58659946, 6344163, + 45011593, 26268851, 26894936, 9132066 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 868309334532756, 1703010512741873, 1952690008738057, + 4325269926064, 2071083554962116 +#else + 24158868, 12938817, 11085297, 25376834, 39045385, 29097348, + 36532400, 64451, 60291780, 30861549 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 523094549451158, 401938899487815, 1407690589076010, + 2022387426254453, 158660516411257 +#else + 13488534, 7794716, 22236231, 5989356, 25426474, 20976224, + 2350709, 30135921, 62420857, 2364225 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 612867287630009, 448212612103814, 571629077419196, + 1466796750919376, 1728478129663858 +#else + 16335033, 9132434, 25640582, 6678888, 1725628, 8517937, + 55301840, 21856974, 15445874, 25756331 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1723848973783452, 2208822520534681, 1718748322776940, + 1974268454121942, 1194212502258141 +#else + 29004188, 25687351, 28661401, 32914020, 54314860, 25611345, + 31863254, 29418892, 66830813, 17795152 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1254114807944608, 977770684047110, 2010756238954993, + 1783628927194099, 1525962994408256 +#else + 60986784, 18687766, 38493958, 14569918, 56250865, 29962602, + 10343411, 26578142, 37280576, 22738620 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 232464058235826, 1948628555342434, 1835348780427694, + 1031609499437291, 64472106918373 +#else + 27081650, 3463984, 14099042, 29036828, 1616302, 27348828, + 29542635, 15372179, 17293797, 960709 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 767338676040683, 754089548318405, 1523192045639075, + 435746025122062, 512692508440385 +#else + 20263915, 11434237, 61343429, 11236809, 13505955, 22697330, + 50997518, 6493121, 47724353, 7639713 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1255955808701983, 1700487367990941, 1166401238800299, + 1175121994891534, 1190934801395380 +#else + 64278047, 18715199, 25403037, 25339236, 58791851, 17380732, + 18006286, 17510682, 29994676, 17746311 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 349144008168292, 1337012557669162, 1475912332999108, + 1321618454900458, 47611291904320 +#else + 9769828, 5202651, 42951466, 19923039, 39057860, 21992807, + 42495722, 19693649, 35924288, 709463 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 877519947135419, 2172838026132651, 272304391224129, + 1655143327559984, 886229406429814 +#else + 12286395, 13076066, 45333675, 32377809, 42105665, 4057651, + 35090736, 24663557, 16102006, 13205847 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 375806028254706, 214463229793940, 572906353144089, + 572168269875638, 697556386112979 +#else + 13733362, 5599946, 10557076, 3195751, 61550873, 8536969, + 41568694, 8525971, 10151379, 10394400 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1168827102357844, 823864273033637, 2071538752104697, + 788062026895924, 599578340743362 +#else + 4024660, 17416881, 22436261, 12276534, 58009849, 30868332, + 19698228, 11743039, 33806530, 8934413 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1948116082078088, 2054898304487796, 2204939184983900, + 210526805152138, 786593586607626 +#else + 51229064, 29029191, 58528116, 30620370, 14634844, 32856154, + 57659786, 3137093, 55571978, 11721157 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1915320147894736, 156481169009469, 655050471180417, + 592917090415421, 2165897438660879 +#else + 17555920, 28540494, 8268605, 2331751, 44370049, 9761012, + 9319229, 8835153, 57903375, 32274386 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1726336468579724, 1119932070398949, 1929199510967666, + 33918788322959, 1836837863503150 +#else + 66647436, 25724417, 20614117, 16688288, 59594098, 28747312, + 22300303, 505429, 6108462, 27371017 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 829996854845988, 217061778005138, 1686565909803640, + 1346948817219846, 1723823550730181 +#else + 62038564, 12367916, 36445330, 3234472, 32617080, 25131790, + 29880582, 20071101, 40210373, 25686972 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 384301494966394, 687038900403062, 2211195391021739, + 254684538421383, 1245698430589680 +#else + 35133562, 5726538, 26934134, 10237677, 63935147, 32949378, + 24199303, 3795095, 7592688, 18562353 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1247567493562688, 1978182094455847, 183871474792955, + 806570235643435, 288461518067916 +#else + 21594432, 18590204, 17466407, 29477210, 32537083, 2739898, + 6407723, 12018833, 38852812, 4298411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1449077384734201, 38285445457996, 2136537659177832, + 2146493000841573, 725161151123125 +#else + 46458361, 21592935, 39872588, 570497, 3767144, 31836892, + 13891941, 31985238, 13717173, 10805743 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1201928866368855, 800415690605445, 1703146756828343, + 997278587541744, 1858284414104014 +#else + 52432215, 17910135, 15287173, 11927123, 24177847, 25378864, + 66312432, 14860608, 40169934, 27690595 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 356468809648877, 782373916933152, 1718002439402870, + 1392222252219254, 663171266061951 +#else + 12962541, 5311799, 57048096, 11658279, 18855286, 25600231, + 13286262, 20745728, 62727807, 9882021 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 759628738230460, 1012693474275852, 353780233086498, + 246080061387552, 2030378857679162 +#else + 18512060, 11319350, 46985740, 15090308, 18818594, 5271736, + 44380960, 3666878, 43141434, 30255002 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2040672435071076, 888593182036908, 1298443657189359, + 1804780278521327, 354070726137060 +#else + 60319844, 30408388, 16192428, 13241070, 15898607, 19348318, + 57023983, 26893321, 64705764, 5276064 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1894938527423184, 1463213041477277, 474410505497651, + 247294963033299, 877975941029128 +#else + 30169808, 28236784, 26306205, 21803573, 27814963, 7069267, + 7152851, 3684982, 1449224, 13082861 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 207937160991127, 12966911039119, 820997788283092, + 1010440472205286, 1701372890140810 +#else + 10342807, 3098505, 2119311, 193222, 25702612, 12233820, + 23697382, 15056736, 46092426, 25352431 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 218882774543183, 533427444716285, 1233243976733245, + 435054256891319, 1509568989549904 +#else + 33958735, 3261607, 22745853, 7948688, 19370557, 18376767, + 40936887, 6482813, 56808784, 22494330 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1888838535711826, 1052177758340622, 1213553803324135, + 169182009127332, 463374268115872 +#else + 32869458, 28145887, 25609742, 15678670, 56421095, 18083360, + 26112420, 2521008, 44444576, 6904814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 299137589460312, 1594371588983567, 868058494039073, + 257771590636681, 1805012993142921 +#else + 29506904, 4457497, 3377935, 23757988, 36598817, 12935079, + 1561737, 3841096, 38105225, 26896789 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1806842755664364, 2098896946025095, 1356630998422878, + 1458279806348064, 347755825962072 +#else + 10340844, 26924055, 48452231, 31276001, 12621150, 20215377, + 30878496, 21730062, 41524312, 5181965 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1402334161391744, 1560083671046299, 1008585416617747, + 1147797150908892, 1420416683642459 +#else + 25940096, 20896407, 17324187, 23247058, 58437395, 15029093, + 24396252, 17103510, 64786011, 21165857 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665506704253369, 273770475169863, 799236974202630, + 848328990077558, 1811448782807931 +#else + 45343161, 9916822, 65808455, 4079497, 66080518, 11909558, + 1782390, 12641087, 20603771, 26992690 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1468412523962641, 771866649897997, 1931766110147832, + 799561180078482, 524837559150077 +#else + 48226577, 21881051, 24849421, 11501709, 13161720, 28785558, + 1925522, 11914390, 4662781, 7820689 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2223212657821850, 630416247363666, 2144451165500328, + 816911130947791, 1024351058410032 +#else + 12241050, 33128450, 8132690, 9393934, 32846760, 31954812, + 29749455, 12172924, 16136752, 15264020 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1266603897524861, 156378408858100, 1275649024228779, + 447738405888420, 253186462063095 +#else + 56758909, 18873868, 58896884, 2330219, 49446315, 19008651, + 10658212, 6671822, 19012087, 3772772 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022215964509735, 136144366993649, 1800716593296582, + 1193970603800203, 871675847064218 +#else + 3753511, 30133366, 10617073, 2028709, 14841030, 26832768, + 28718731, 17791548, 20527770, 12988982 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1862751661970328, 851596246739884, 1519315554814041, + 1542798466547449, 1417975335901520 +#else + 52286360, 27757162, 63400876, 12689772, 66209881, 22639565, + 42925817, 22989488, 3299664, 21129479 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1228168094547481, 334133883362894, 587567568420081, + 433612590281181, 603390400373205 +#else + 50331161, 18301130, 57466446, 4978982, 3308785, 8755439, + 6943197, 6461331, 41525717, 8991217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 121893973206505, 1843345804916664, 1703118377384911, + 497810164760654, 101150811654673 +#else + 49882601, 1816361, 65435576, 27467992, 31783887, 25378441, + 34160718, 7417949, 36866577, 1507264 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 458346255946468, 290909935619344, 1452768413850679, + 550922875254215, 1537286854336538 +#else + 29692644, 6829891, 56610064, 4334895, 20945975, 21647936, + 38221255, 8209390, 14606362, 22907359 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 584322311184395, 380661238802118, 114839394528060, + 655082270500073, 2111856026034852 +#else + 63627275, 8707080, 32188102, 5672294, 22096700, 1711240, + 34088169, 9761486, 4170404, 31469107 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996965581008991, 2148998626477022, 1012273164934654, + 1073876063914522, 1688031788934939 +#else + 55521375, 14855944, 62981086, 32022574, 40459774, 15084045, + 22186522, 16002000, 52832027, 25153633 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 923487018849600, 2085106799623355, 528082801620136, + 1606206360876188, 735907091712524 +#else + 62297408, 13761028, 35404987, 31070512, 63796392, 7869046, + 59995292, 23934339, 13240844, 10965870 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1697697887804317, 1335343703828273, 831288615207040, + 949416685250051, 288760277392022 +#else + 59366301, 25297669, 52340529, 19898171, 43876480, 12387165, + 4498947, 14147411, 29514390, 4302863 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1419122478109648, 1325574567803701, 602393874111094, + 2107893372601700, 1314159682671307 +#else + 53695440, 21146572, 20757301, 19752600, 14785142, 8976368, + 62047588, 31410058, 17846987, 19582505 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2201150872731804, 2180241023425241, 97663456423163, + 1633405770247824, 848945042443986 +#else + 64864412, 32799703, 62511833, 32488122, 60861691, 1455298, + 45461136, 24339642, 61886162, 12650266 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1173339555550611, 818605084277583, 47521504364289, + 924108720564965, 735423405754506 +#else + 57202067, 17484121, 21134159, 12198166, 40044289, 708125, + 387813, 13770293, 47974538, 10958662 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 830104860549448, 1886653193241086, 1600929509383773, + 1475051275443631, 286679780900937 +#else + 22470984, 12369526, 23446014, 28113323, 45588061, 23855708, + 55336367, 21979976, 42025033, 4271861 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1577111294832995, 1030899169768747, 144900916293530, + 1964672592979567, 568390100955250 +#else + 41939299, 23500789, 47199531, 15361594, 61124506, 2159191, + 75375, 29275903, 34582642, 8469672 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 278388655910247, 487143369099838, 927762205508727, + 181017540174210, 1616886700741287 +#else + 15854951, 4148314, 58214974, 7259001, 11666551, 13824734, + 36577666, 2697371, 24154791, 24093489 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1191033906638969, 940823957346562, 1606870843663445, + 861684761499847, 658674867251089 +#else + 15446137, 17747788, 29759746, 14019369, 30811221, 23944241, + 35526855, 12840103, 24913809, 9815020 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1875032594195546, 1427106132796197, 724736390962158, + 901860512044740, 635268497268760 +#else + 62399578, 27940162, 35267365, 21265538, 52665326, 10799413, + 58005188, 13438768, 18735128, 9466238 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622869792298357, 1903919278950367, 1922588621661629, + 1520574711600434, 1087100760174640 +#else + 11933045, 9281483, 5081055, 28370608, 64480701, 28648802, + 59381042, 22658328, 44380208, 16199063 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 25465949416618, 1693639527318811, 1526153382657203, + 125943137857169, 145276964043999 +#else + 14576810, 379472, 40322331, 25237195, 37682355, 22741457, + 67006097, 1876698, 30801119, 2164795 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 214739857969358, 920212862967915, 1939901550972269, + 1211862791775221, 85097515720120 +#else + 15995086, 3199873, 13672555, 13712240, 47730029, 28906785, + 54027253, 18058162, 53616056, 1268051 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2006245852772938, 734762734836159, 254642929763427, + 1406213292755966, 239303749517686 +#else + 56818250, 29895392, 63822271, 10948817, 23037027, 3794475, + 63638526, 20954210, 50053494, 3565903 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1619678837192149, 1919424032779215, 1357391272956794, + 1525634040073113, 1310226789796241 +#else + 29210069, 24135095, 61189071, 28601646, 10834810, 20226706, + 50596761, 22733718, 39946641, 19523900 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1040763709762123, 1704449869235352, 605263070456329, + 1998838089036355, 1312142911487502 +#else + 53946955, 15508587, 16663704, 25398282, 38758921, 9019122, + 37925443, 29785008, 2244110, 19552453 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1996723311435669, 1844342766567060, 985455700466044, + 1165924681400960, 311508689870129 +#else + 61955989, 29753495, 57802388, 27482848, 16243068, 14684434, + 41435776, 17373631, 13491505, 4641841 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 43173156290518, 2202883069785309, 1137787467085917, + 1733636061944606, 1394992037553852 +#else + 10813398, 643330, 47920349, 32825515, 30292061, 16954354, + 27548446, 25833190, 14476988, 20787001 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 670078326344559, 555655025059356, 471959386282438, + 2141455487356409, 849015953823125 +#else + 10292079, 9984945, 6481436, 8279905, 59857350, 7032742, + 27282937, 31910173, 39196053, 12651323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2197214573372804, 794254097241315, 1030190060513737, + 267632515541902, 2040478049202624 +#else + 35923332, 32741048, 22271203, 11835308, 10201545, 15351028, + 17099662, 3988035, 21721536, 30405492 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1812516004670529, 1609256702920783, 1706897079364493, + 258549904773295, 996051247540686 +#else + 10202177, 27008593, 35735631, 23979793, 34958221, 25434748, + 54202543, 3852693, 13216206, 14842320 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1540374301420584, 1764656898914615, 1810104162020396, + 923808779163088, 664390074196579 +#else + 51293224, 22953365, 60569911, 26295436, 60124204, 26972653, + 35608016, 13765823, 39674467, 9900183 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1323460699404750, 1262690757880991, 871777133477900, + 1060078894988977, 1712236889662886 +#else + 14465486, 19721101, 34974879, 18815558, 39665676, 12990491, + 33046193, 15796406, 60056998, 25514317 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1696163952057966, 1391710137550823, 608793846867416, + 1034391509472039, 1780770894075012 +#else + 30924398, 25274812, 6359015, 20738097, 16508376, 9071735, + 41620263, 15413634, 9524356, 26535554 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1367603834210841, 2131988646583224, 890353773628144, + 1908908219165595, 270836895252891 +#else + 12274201, 20378885, 32627640, 31769106, 6736624, 13267305, + 5237659, 28444949, 15663515, 4035784 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 597536315471731, 40375058742586, 1942256403956049, + 1185484645495932, 312666282024145 +#else + 64157555, 8903984, 17349946, 601635, 50676049, 28941875, + 53376124, 17665097, 44850385, 4659090 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1919411405316294, 1234508526402192, 1066863051997083, + 1008444703737597, 1348810787701552 +#else + 50192582, 28601458, 36715152, 18395610, 20774811, 15897498, + 5736189, 15026997, 64930608, 20098846 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102881477513865, 1570274565945361, 1573617900503708, + 18662635732583, 2232324307922098 +#else + 58249865, 31335375, 28571665, 23398914, 66634396, 23448733, + 63307367, 278094, 23440562, 33264224 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1853931367696942, 8107973870707, 350214504129299, + 775206934582587, 1752317649166792 +#else + 10226222, 27625730, 15139955, 120818, 52241171, 5218602, + 32937275, 11551483, 50536904, 26111567 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1417148368003523, 721357181628282, 505725498207811, + 373232277872983, 261634707184480 +#else + 17932739, 21117156, 43069306, 10749059, 11316803, 7535897, + 22503767, 5561594, 63462240, 3898660 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2186733281493267, 2250694917008620, 1014829812957440, + 479998161452389, 83566193876474 +#else + 7749907, 32584865, 50769132, 33537967, 42090752, 15122142, + 65535333, 7152529, 21831162, 1245233 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1268116367301224, 560157088142809, 802626839600444, + 2210189936605713, 1129993785579988 +#else + 26958440, 18896406, 4314585, 8346991, 61431100, 11960071, + 34519569, 32934396, 36706772, 16838219 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 615183387352312, 917611676109240, 878893615973325, + 978940963313282, 938686890583575 +#else + 54942968, 9166946, 33491384, 13673479, 29787085, 13096535, + 6280834, 14587357, 44770839, 13987524 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 522024729211672, 1045059315315808, 1892245413707790, + 1907891107684253, 2059998109500714 +#else + 42758936, 7778774, 21116000, 15572597, 62275598, 28196653, + 62807965, 28429792, 59639082, 30696363 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1799679152208884, 912132775900387, 25967768040979, + 432130448590461, 274568990261996 +#else + 9681908, 26817309, 35157219, 13591837, 60225043, 386949, + 31622781, 6439245, 52527852, 4091396 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 98698809797682, 2144627600856209, 1907959298569602, + 811491302610148, 1262481774981493 +#else + 58682418, 1470726, 38999185, 31957441, 3978626, 28430809, + 47486180, 12092162, 29077877, 18812444 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1791451399743152, 1713538728337276, 118349997257490, + 1882306388849954, 158235232210248 +#else + 5269168, 26694706, 53878652, 25533716, 25932562, 1763552, + 61502754, 28048550, 47091016, 2357888 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1217809823321928, 2173947284933160, 1986927836272325, + 1388114931125539, 12686131160169 +#else + 32264008, 18146780, 61721128, 32394338, 65017541, 29607531, + 23104803, 20684524, 5727337, 189038 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1650875518872272, 1136263858253897, 1732115601395988, + 734312880662190, 1252904681142109 +#else + 14609104, 24599962, 61108297, 16931650, 52531476, 25810533, + 40363694, 10942114, 41219933, 18669734 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 372986456113865, 525430915458171, 2116279931702135, + 501422713587815, 1907002872974925 +#else + 20513481, 5557931, 51504251, 7829530, 26413943, 31535028, + 45729895, 7471780, 13913677, 28416557 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 803147181835288, 868941437997146, 316299302989663, + 943495589630550, 571224287904572 +#else + 41534488, 11967825, 29233242, 12948236, 60354399, 4713226, + 58167894, 14059179, 12878652, 8511905 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 227742695588364, 1776969298667369, 628602552821802, + 457210915378118, 2041906378111140 +#else + 41452044, 3393630, 64153449, 26478905, 64858154, 9366907, + 36885446, 6812973, 5568676, 30426776 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 815000523470260, 913085688728307, 1052060118271173, + 1345536665214223, 541623413135555 +#else + 11630004, 12144454, 2116339, 13606037, 27378885, 15676917, + 49700111, 20050058, 52713667, 8070817 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1580216071604333, 1877997504342444, 857147161260913, + 703522726778478, 2182763974211603 +#else + 27117677, 23547054, 35826092, 27984343, 1127281, 12772488, + 37262958, 10483305, 55556115, 32525717 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1870080310923419, 71988220958492, 1783225432016732, + 615915287105016, 1035570475990230 +#else + 10637467, 27866368, 5674780, 1072708, 40765276, 26572129, + 65424888, 9177852, 39615702, 15431202 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 730987750830150, 857613889540280, 1083813157271766, + 1002817255970169, 1719228484436074 +#else + 20525126, 10892566, 54366392, 12779442, 37615830, 16150074, + 38868345, 14943141, 52052074, 25618500 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 377616581647602, 1581980403078513, 804044118130621, + 2034382823044191, 643844048472185 +#else + 37084402, 5626925, 66557297, 23573344, 753597, 11981191, + 25244767, 30314666, 63752313, 9594023 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 176957326463017, 1573744060478586, 528642225008045, + 1816109618372371, 1515140189765006 +#else + 43356201, 2636869, 61944954, 23450613, 585133, 7877383, + 11345683, 27062142, 13352334, 22577348 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1888911448245718, 1387110895611080, 1924503794066429, + 1731539523700949, 2230378382645454 +#else + 65177046, 28146973, 3304648, 20669563, 17015805, 28677341, + 37325013, 25801949, 53893326, 33235227 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 443392177002051, 233793396845137, 2199506622312416, + 1011858706515937, 974676837063129 +#else + 20239939, 6607058, 6203985, 3483793, 48721888, 32775202, + 46385121, 15077869, 44358105, 14523816 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1846351103143623, 1949984838808427, 671247021915253, + 1946756846184401, 1929296930380217 +#else + 27406023, 27512775, 27423595, 29057038, 4996213, 10002360, + 38266833, 29008937, 36936121, 28748764 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 849646212452002, 1410198775302919, 73767886183695, + 1641663456615812, 762256272452411 +#else + 11374242, 12660715, 17861383, 21013599, 10935567, 1099227, + 53222788, 24462691, 39381819, 11358503 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 692017667358279, 723305578826727, 1638042139863265, + 748219305990306, 334589200523901 +#else + 54378055, 10311866, 1510375, 10778093, 64989409, 24408729, + 32676002, 11149336, 40985213, 4985767 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 22893968530686, 2235758574399251, 1661465835630252, + 925707319443452, 1203475116966621 +#else + 48012542, 341146, 60911379, 33315398, 15756972, 24757770, + 66125820, 13794113, 47694557, 17933176 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 801299035785166, 1733292596726131, 1664508947088596, + 467749120991922, 1647498584535623 +#else + 6490062, 11940286, 25495923, 25828072, 8668372, 24803116, + 3367602, 6970005, 65417799, 24549641 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 903105258014366, 427141894933047, 561187017169777, + 1884330244401954, 1914145708422219 +#else + 1656478, 13457317, 15370807, 6364910, 13605745, 8362338, + 47934242, 28078708, 50312267, 28522993 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1344191060517578, 1960935031767890, 1518838929955259, + 1781502350597190, 1564784025565682 +#else + 44835530, 20030007, 67044178, 29220208, 48503227, 22632463, + 46537798, 26546453, 67009010, 23317098 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 673723351748086, 1979969272514923, 1175287312495508, + 1187589090978666, 1881897672213940 +#else + 17747446, 10039260, 19368299, 29503841, 46478228, 17513145, + 31992682, 17696456, 37848500, 28042460 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1917185587363432, 1098342571752737, 5935801044414, + 2000527662351839, 1538640296181569 +#else + 31932008, 28568291, 47496481, 16366579, 22023614, 88450, + 11371999, 29810185, 4882241, 22927527 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2495540013192, 678856913479236, 224998292422872, + 219635787698590, 1972465269000940 +#else + 29796488, 37186, 19818052, 10115756, 55279832, 3352735, + 18551198, 3272828, 61917932, 29392022 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 271413961212179, 1353052061471651, 344711291283483, + 2014925838520662, 2006221033113941 +#else + 12501267, 4044383, 58495907, 20162046, 34678811, 5136598, + 47878486, 30024734, 330069, 29895023 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 194583029968109, 514316781467765, 829677956235672, + 1676415686873082, 810104584395840 +#else + 6384877, 2899513, 17807477, 7663917, 64749976, 12363164, + 25366522, 24980540, 66837568, 12071498 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1980510813313589, 1948645276483975, 152063780665900, + 129968026417582, 256984195613935 +#else + 58743349, 29511910, 25133447, 29037077, 60897836, 2265926, + 34339246, 1936674, 61949167, 3829362 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1860190562533102, 1936576191345085, 461100292705964, + 1811043097042830, 957486749306835 +#else + 28425966, 27718999, 66531773, 28857233, 52891308, 6870929, + 7921550, 26986645, 26333139, 14267664 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 796664815624365, 1543160838872951, 1500897791837765, + 1667315977988401, 599303877030711 +#else + 56041645, 11871230, 27385719, 22994888, 62522949, 22365119, + 10004785, 24844944, 45347639, 8930323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1151480509533204, 2136010406720455, 738796060240027, + 319298003765044, 1150614464349587 +#else + 45911060, 17158396, 25654215, 31829035, 12282011, 11008919, + 1541940, 4757911, 40617363, 17145491 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1731069268103150, 735642447616087, 1364750481334268, + 417232839982871, 927108269127661 +#else + 13537262, 25794942, 46504023, 10961926, 61186044, 20336366, + 53952279, 6217253, 51165165, 13814989 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1017222050227968, 1987716148359, 2234319589635701, + 621282683093392, 2132553131763026 +#else + 49686272, 15157789, 18705543, 29619, 24409717, 33293956, + 27361680, 9257833, 65152338, 31777517 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1567828528453324, 1017807205202360, 565295260895298, + 829541698429100, 307243822276582 +#else + 42063564, 23362465, 15366584, 15166509, 54003778, 8423555, + 37937324, 12361134, 48422886, 4578289 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 249079270936248, 1501514259790706, 947909724204848, + 944551802437487, 552658763982480 +#else + 24579768, 3711570, 1342322, 22374306, 40103728, 14124955, + 44564335, 14074918, 21964432, 8235257 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2089966982947227, 1854140343916181, 2151980759220007, + 2139781292261749, 158070445864917 +#else + 60580251, 31142934, 9442965, 27628844, 12025639, 32067012, + 64127349, 31885225, 13006805, 2355433 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1338766321464554, 1906702607371284, 1519569445519894, + 115384726262267, 1393058953390992 +#else + 50803946, 19949172, 60476436, 28412082, 16974358, 22643349, + 27202043, 1719366, 1141648, 20758196 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1364621558265400, 1512388234908357, 1926731583198686, + 2041482526432505, 920401122333774 +#else + 54244920, 20334445, 58790597, 22536340, 60298718, 28710537, + 13475065, 30420460, 32674894, 13715045 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1884844597333588, 601480070269079, 620203503079537, + 1079527400117915, 1202076693132015 +#else + 11423316, 28086373, 32344215, 8962751, 24989809, 9241752, + 53843611, 16086211, 38367983, 17912338 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 840922919763324, 727955812569642, 1303406629750194, + 522898432152867, 294161410441865 +#else + 65699196, 12530727, 60740138, 10847386, 19531186, 19422272, + 55399715, 7791793, 39862921, 4383346 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 353760790835310, 1598361541848743, 1122905698202299, + 1922533590158905, 419107700666580 +#else + 38137966, 5271446, 65842855, 23817442, 54653627, 16732598, + 62246457, 28647982, 27193556, 6245191 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 359856369838236, 180914355488683, 861726472646627, + 218807937262986, 575626773232501 +#else + 51914908, 5362277, 65324971, 2695833, 4960227, 12840725, + 23061898, 3260492, 22510453, 8577507 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 755467689082474, 909202735047934, 730078068932500, + 936309075711518, 2007798262842972 +#else + 54476394, 11257345, 34415870, 13548176, 66387860, 10879010, + 31168030, 13952092, 37537372, 29918525 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1609384177904073, 362745185608627, 1335318541768201, + 800965770436248, 547877979267412 +#else + 3877321, 23981693, 32416691, 5405324, 56104457, 19897796, + 3759768, 11935320, 5611860, 8164018 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 984339177776787, 815727786505884, 1645154585713747, + 1659074964378553, 1686601651984156 +#else + 50833043, 14667796, 15906460, 12155291, 44997715, 24514713, + 32003001, 24722143, 5773084, 25132323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1697863093781930, 599794399429786, 1104556219769607, + 830560774794755, 12812858601017 +#else + 43320746, 25300131, 1950874, 8937633, 18686727, 16459170, + 66203139, 12376319, 31632953, 190926 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1168737550514982, 897832437380552, 463140296333799, + 302564600022547, 2008360505135501 +#else + 42515238, 17415546, 58684872, 13378745, 14162407, 6901328, + 58820115, 4508563, 41767309, 29926903 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1856930662813910, 678090852002597, 1920179140755167, + 1259527833759868, 55540971895511 +#else + 8884438, 27670423, 6023973, 10104341, 60227295, 28612898, + 18722940, 18768427, 65436375, 827624 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1158643631044921, 476554103621892, 178447851439725, + 1305025542653569, 103433927680625 +#else + 34388281, 17265135, 34605316, 7101209, 13354605, 2659080, + 65308289, 19446395, 42230385, 1541285 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2176793111709008, 1576725716350391, 2009350167273523, + 2012390194631546, 2125297410909580 +#else + 2901328, 32436745, 3880375, 23495044, 49487923, 29941650, + 45306746, 29986950, 20456844, 31669399 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 825403285195098, 2144208587560784, 1925552004644643, + 1915177840006985, 1015952128947864 +#else + 27019610, 12299467, 53450576, 31951197, 54247203, 28692960, + 47568713, 28538373, 29439640, 15138866 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1807108316634472, 1534392066433717, 347342975407218, + 1153820745616376, 7375003497471 +#else + 21536104, 26928012, 34661045, 22864223, 44700786, 5175813, + 61688824, 17193268, 7779327, 109896 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 983061001799725, 431211889901241, 2201903782961093, + 817393911064341, 2214616493042167 +#else + 30279725, 14648750, 59063993, 6425557, 13639621, 32810923, + 28698389, 12180118, 23177719, 33000357 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 228567918409756, 865093958780220, 358083886450556, + 159617889659320, 1360637926292598 +#else + 26572828, 3405927, 35407164, 12890904, 47843196, 5335865, + 60615096, 2378491, 4439158, 20275085 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 234147501399755, 2229469128637390, 2175289352258889, + 1397401514549353, 1885288963089922 +#else + 44392139, 3489069, 57883598, 33221678, 18875721, 32414337, + 14819433, 20822905, 49391106, 28092994 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1111762412951562, 252849572507389, 1048714233823341, + 146111095601446, 1237505378776770 +#else + 62052362, 16566550, 15953661, 3767752, 56672365, 15627059, + 66287910, 2177224, 8550082, 18440267 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1113790697840279, 1051167139966244, 1045930658550944, + 2011366241542643, 1686166824620755 +#else + 48635543, 16596774, 66727204, 15663610, 22860960, 15585581, + 39264755, 29971692, 43848403, 25125843 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1054097349305049, 1872495070333352, 182121071220717, + 1064378906787311, 100273572924182 +#else + 34628313, 15707274, 58902952, 27902350, 29464557, 2713815, + 44383727, 15860481, 45206294, 1494192 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1306410853171605, 1627717417672447, 50983221088417, + 1109249951172250, 870201789081392 +#else + 47546773, 19467038, 41524991, 24254879, 13127841, 759709, + 21923482, 16529112, 8742704, 12967017 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 104233794644221, 1548919791188248, 2224541913267306, + 2054909377116478, 1043803389015153 +#else + 38643965, 1553204, 32536856, 23080703, 42417258, 33148257, + 58194238, 30620535, 37205105, 15553882 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 216762189468802, 707284285441622, 190678557969733, + 973969342604308, 1403009538434867 +#else + 21877890, 3230008, 9881174, 10539357, 62311749, 2841331, + 11543572, 14513274, 19375923, 20906471 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1279024291038477, 344776835218310, 273722096017199, + 1834200436811442, 634517197663804 +#else + 8832269, 19058947, 13253510, 5137575, 5037871, 4078777, + 24880818, 27331716, 2862652, 9455043 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 343805853118335, 1302216857414201, 566872543223541, + 2051138939539004, 321428858384280 +#else + 29306751, 5123106, 20245049, 19404543, 9592565, 8447059, + 65031740, 30564351, 15511448, 4789663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 470067171324852, 1618629234173951, 2000092177515639, + 7307679772789, 1117521120249968 +#else + 46429108, 7004546, 8824831, 24119455, 63063159, 29803695, + 61354101, 108892, 23513200, 16652362 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 278151578291475, 1810282338562947, 1771599529530998, + 1383659409671631, 685373414471841 +#else + 33852691, 4144781, 62632835, 26975308, 10770038, 26398890, + 60458447, 20618131, 48789665, 10212859 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 577009397403102, 1791440261786291, 2177643735971638, + 174546149911960, 1412505077782326 +#else + 2756062, 8598110, 7383731, 26694540, 22312758, 32449420, + 21179800, 2600940, 57120566, 21047965 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 893719721537457, 1201282458018197, 1522349501711173, + 58011597740583, 1130406465887139 +#else + 42463153, 13317461, 36659605, 17900503, 21365573, 22684775, + 11344423, 864440, 64609187, 16844368 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 412607348255453, 1280455764199780, 2233277987330768, + 14180080401665, 331584698417165 +#else + 40676061, 6148328, 49924452, 19080277, 18782928, 33278435, + 44547329, 211299, 2719757, 4940997 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 262483770854550, 990511055108216, 526885552771698, + 571664396646158, 354086190278723 +#else + 65784982, 3911312, 60160120, 14759764, 37081714, 7851206, + 21690126, 8518463, 26699843, 5276295 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1820352417585487, 24495617171480, 1547899057533253, + 10041836186225, 480457105094042 +#else + 53958991, 27125364, 9396248, 365013, 24703301, 23065493, + 1321585, 149635, 51656090, 7159368 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2023310314989233, 637905337525881, 2106474638900687, + 557820711084072, 1687858215057826 +#else + 9987761, 30149673, 17507961, 9505530, 9731535, 31388918, + 22356008, 8312176, 22477218, 25151047 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1144168702609745, 604444390410187, 1544541121756138, + 1925315550126027, 626401428894002 +#else + 18155857, 17049442, 19744715, 9006923, 15154154, 23015456, + 24256459, 28689437, 44560690, 9334108 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1922168257351784, 2018674099908659, 1776454117494445, + 956539191509034, 36031129147635 +#else + 2986088, 28642539, 10776627, 30080588, 10620589, 26471229, + 45695018, 14253544, 44521715, 536905 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 544644538748041, 1039872944430374, 876750409130610, + 710657711326551, 1216952687484972 +#else + 4377737, 8115836, 24567078, 15495314, 11625074, 13064599, + 7390551, 10589625, 10838060, 18134008 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 58242421545916, 2035812695641843, 2118491866122923, + 1191684463816273, 46921517454099 +#else + 47766460, 867879, 9277171, 30335973, 52677291, 31567988, + 19295825, 17757482, 6378259, 699185 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 272268252444639, 1374166457774292, 2230115177009552, + 1053149803909880, 1354288411641016 +#else + 7895007, 4057113, 60027092, 20476675, 49222032, 33231305, + 66392824, 15693154, 62063800, 20180469 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1857910905368338, 1754729879288912, 885945464109877, + 1516096106802166, 1602902393369811 +#else + 59371282, 27685029, 52542544, 26147512, 11385653, 13201616, + 31730678, 22591592, 63190227, 23885106 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1193437069800958, 901107149704790, 999672920611411, + 477584824802207, 364239578697845 +#else + 10188286, 17783598, 59772502, 13427542, 22223443, 14896287, + 30743455, 7116568, 45322357, 5427592 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 886299989548838, 1538292895758047, 1590564179491896, + 1944527126709657, 837344427345298 +#else + 696102, 13206899, 27047647, 22922350, 15285304, 23701253, + 10798489, 28975712, 19236242, 12477404 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 754558365378305, 1712186480903618, 1703656826337531, + 750310918489786, 518996040250900 +#else + 55879425, 11243795, 50054594, 25513566, 66320635, 25386464, + 63211194, 11180503, 43939348, 7733643 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1309847803895382, 1462151862813074, 211370866671570, + 1544595152703681, 1027691798954090 +#else + 17800790, 19518253, 40108434, 21787760, 23887826, 3149671, + 23466177, 23016261, 10322026, 15313801 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 803217563745370, 1884799722343599, 1357706345069218, + 2244955901722095, 730869460037413 +#else + 26246234, 11968874, 32263343, 28085704, 6830754, 20231401, + 51314159, 33452449, 42659621, 10890803 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 689299471295966, 1831210565161071, 1375187341585438, + 1106284977546171, 1893781834054269 +#else + 35743198, 10271362, 54448239, 27287163, 16690206, 20491888, + 52126651, 16484930, 25180797, 28219548 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 696351368613042, 1494385251239250, 738037133616932, + 636385507851544, 927483222611406 +#else + 66522290, 10376443, 34522450, 22268075, 19801892, 10997610, + 2276632, 9482883, 316878, 13820577 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1949114198209333, 1104419699537997, 783495707664463, + 1747473107602770, 2002634765788641 +#else + 57226037, 29044064, 64993357, 16457135, 56008783, 11674995, + 30756178, 26039378, 30696929, 29841583 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1607325776830197, 530883941415333, 1451089452727895, + 1581691157083423, 496100432831154 +#else + 32988917, 23951020, 12499365, 7910787, 56491607, 21622917, + 59766047, 23569034, 34759346, 7392472 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1068900648804224, 2006891997072550, 1134049269345549, + 1638760646180091, 2055396084625778 +#else + 58253184, 15927860, 9866406, 29905021, 64711949, 16898650, + 36699387, 24419436, 25112946, 30627788 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2222475519314561, 1870703901472013, 1884051508440561, + 1344072275216753, 1318025677799069 +#else + 64604801, 33117465, 25621773, 27875660, 15085041, 28074555, + 42223985, 20028237, 5537437, 19640113 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 155711679280656, 681100400509288, 389811735211209, + 2135723811340709, 408733211204125 +#else + 55883280, 2320284, 57524584, 10149186, 33664201, 5808647, + 52232613, 31824764, 31234589, 6090599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 7813206966729, 194444201427550, 2071405409526507, + 1065605076176312, 1645486789731291 +#else + 57475529, 116425, 26083934, 2897444, 60744427, 30866345, 609720, + 15878753, 60138459, 24519663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 16625790644959, 1647648827778410, 1579910185572704, + 436452271048548, 121070048451050 +#else + 39351007, 247743, 51914090, 24551880, 23288160, 23542496, + 43239268, 6503645, 20650474, 1804084 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1037263028552531, 568385780377829, 297953104144430, + 1558584511931211, 2238221839292471 +#else + 39519059, 15456423, 8972517, 8469608, 15640622, 4439847, + 3121995, 23224719, 27842615, 33352104 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 190565267697443, 672855706028058, 338796554369226, + 337687268493904, 853246848691734 +#else + 51801891, 2839643, 22530074, 10026331, 4602058, 5048462, + 28248656, 5031932, 55733782, 12714368 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1763863028400139, 766498079432444, 1321118624818005, + 69494294452268, 858786744165651 +#else + 20807691, 26283607, 29286140, 11421711, 39232341, 19686201, + 45881388, 1035545, 47375635, 12796919 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1292056768563024, 1456632109855638, 1100631247050184, + 1386133165675321, 1232898350193752 +#else + 12076880, 19253146, 58323862, 21705509, 42096072, 16400683, + 49517369, 20654993, 3480664, 18371617 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 366253102478259, 525676242508811, 1449610995265438, + 1183300845322183, 185960306491545 +#else + 34747315, 5457596, 28548107, 7833186, 7303070, 21600887, + 42745799, 17632556, 33734809, 2771024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 28315355815982, 460422265558930, 1799675876678724, + 1969256312504498, 1051823843138725 +#else + 45719598, 421931, 26597266, 6860826, 22486084, 26817260, + 49971378, 29344205, 42556581, 15673396 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 156914999361983, 1606148405719949, 1665208410108430, + 317643278692271, 1383783705665320 +#else + 46924223, 2338215, 19788685, 23933476, 63107598, 24813538, + 46837679, 4733253, 3727144, 20619984 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 54684536365732, 2210010038536222, 1194984798155308, + 535239027773705, 1516355079301361 +#else + 6120100, 814863, 55314462, 32931715, 6812204, 17806661, 2019593, + 7975683, 31123697, 22595451 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1484387703771650, 198537510937949, 2186282186359116, + 617687444857508, 647477376402122 +#else + 30069250, 22119100, 30434653, 2958439, 18399564, 32578143, + 12296868, 9204260, 50676426, 9648164 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2147715541830533, 500032538445817, 646380016884826, + 352227855331122, 1488268620408052 +#else + 32705413, 32003455, 30705657, 7451065, 55303258, 9631812, + 3305266, 5248604, 41100532, 22176930 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 159386186465542, 1877626593362941, 618737197060512, + 1026674284330807, 1158121760792685 +#else + 17219846, 2375039, 35537917, 27978816, 47649184, 9219902, + 294711, 15298639, 2662509, 17257359 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1744544377739822, 1964054180355661, 1685781755873170, + 2169740670377448, 1286112621104591 +#else + 65935918, 25995736, 62742093, 29266687, 45762450, 25120105, + 32087528, 32331655, 32247247, 19164571 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 81977249784993, 1667943117713086, 1668983819634866, + 1605016835177615, 1353960708075544 +#else + 14312609, 1221556, 17395390, 24854289, 62163122, 24869796, + 38911119, 23916614, 51081240, 20175586 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1602253788689063, 439542044889886, 2220348297664483, + 657877410752869, 157451572512238 +#else + 65680039, 23875441, 57873182, 6549686, 59725795, 33085767, + 23046501, 9803137, 17597934, 2346211 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1029287186166717, 65860128430192, 525298368814832, + 1491902500801986, 1461064796385400 +#else + 18510781, 15337574, 26171504, 981392, 44867312, 7827555, + 43617730, 22231079, 3059832, 21771562 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 408216988729246, 2121095722306989, 913562102267595, + 1879708920318308, 241061448436731 +#else + 10141598, 6082907, 17829293, 31606789, 9830091, 13613136, + 41552228, 28009845, 33606651, 3592095 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1185483484383269, 1356339572588553, 584932367316448, + 102132779946470, 1792922621116791 +#else + 33114149, 17665080, 40583177, 20211034, 33076704, 8716171, + 1151462, 1521897, 66126199, 26716628 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1966196870701923, 2230044620318636, 1425982460745905, + 261167817826569, 46517743394330 +#else + 34169699, 29298616, 23947180, 33230254, 34035889, 21248794, + 50471177, 3891703, 26353178, 693168 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 107077591595359, 884959942172345, 27306869797400, + 2224911448949390, 964352058245223 +#else + 30374239, 1595580, 50224825, 13186930, 4600344, 406904, 9585294, + 33153764, 31375463, 14369965 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1730194207717538, 431790042319772, 1831515233279467, + 1372080552768581, 1074513929381760 +#else + 52738210, 25781902, 1510300, 6434173, 48324075, 27291703, + 32732229, 20445593, 17901440, 16011505 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1450880638731607, 1019861580989005, 1229729455116861, + 1174945729836143, 826083146840706 +#else + 18171223, 21619806, 54608461, 15197121, 56070717, 18324396, + 47936623, 17508055, 8764034, 12309598 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1899935429242705, 1602068751520477, 940583196550370, + 82431069053859, 1540863155745696 +#else + 5975889, 28311244, 47649501, 23872684, 55567586, 14015781, + 43443107, 1228318, 17544096, 22960650 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2136688454840028, 2099509000964294, 1690800495246475, + 1217643678575476, 828720645084218 +#else + 5811932, 31839139, 3442886, 31285122, 48741515, 25194890, + 49064820, 18144304, 61543482, 12348899 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 765548025667841, 462473984016099, 998061409979798, + 546353034089527, 2212508972466858 +#else + 35709185, 11407554, 25755363, 6891399, 63851926, 14872273, + 42259511, 8141294, 56476330, 32968952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 46575283771160, 892570971573071, 1281983193144090, + 1491520128287375, 75847005908304 +#else + 54433560, 694025, 62032719, 13300343, 14015258, 19103038, + 57410191, 22225381, 30944592, 1130208 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1801436127943107, 1734436817907890, 1268728090345068, + 167003097070711, 2233597765834956 +#else + 8247747, 26843490, 40546482, 25845122, 52706924, 18905521, + 4652151, 2488540, 23550156, 33283200 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1997562060465113, 1048700225534011, 7615603985628, + 1855310849546841, 2242557647635213 +#else + 17294297, 29765994, 7026747, 15626851, 22990044, 113481, + 2267737, 27646286, 66700045, 33416712 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1161017320376250, 492624580169043, 2169815802355237, + 976496781732542, 1770879511019629 +#else + 16091066, 17300506, 18599251, 7340678, 2137637, 32332775, + 63744702, 14550935, 3260525, 26388161 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1357044908364776, 729130645262438, 1762469072918979, + 1365633616878458, 181282906404941 +#else + 62198760, 20221544, 18550886, 10864893, 50649539, 26262835, + 44079994, 20349526, 54360141, 2701325 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1080413443139865, 1155205815510486, 1848782073549786, + 622566975152580, 124965574467971 +#else + 58534169, 16099414, 4629974, 17213908, 46322650, 27548999, + 57090500, 9276970, 11329923, 1862132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1184526762066993, 247622751762817, 692129017206356, + 820018689412496, 2188697339828085 +#else + 14763057, 17650824, 36190593, 3689866, 3511892, 10313526, + 45157776, 12219230, 58070901, 32614131 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2020536369003019, 202261491735136, 1053169669150884, + 2056531979272544, 778165514694311 +#else + 8894987, 30108338, 6150752, 3013931, 301220, 15693451, 35127648, + 30644714, 51670695, 11595569 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 237404399610207, 1308324858405118, 1229680749538400, + 720131409105291, 1958958863624906 +#else + 15214943, 3537601, 40870142, 19495559, 4418656, 18323671, + 13947275, 10730794, 53619402, 29190761 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 515583508038846, 17656978857189, 1717918437373989, + 1568052070792483, 46975803123923 +#else + 64570558, 7682792, 32759013, 263109, 37124133, 25598979, + 44776739, 23365796, 977107, 699994 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 281527309158085, 36970532401524, 866906920877543, + 2222282602952734, 1289598729589882 +#else + 54642373, 4195083, 57897332, 550903, 51543527, 12917919, + 19118110, 33114591, 36574330, 19216518 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1278207464902042, 494742455008756, 1262082121427081, + 1577236621659884, 1888786707293291 +#else + 31788442, 19046775, 4799988, 7372237, 8808585, 18806489, + 9408236, 23502657, 12493931, 28145115 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 353042527954210, 1830056151907359, 1111731275799225, + 174960955838824, 404312815582675 +#else + 41428258, 5260743, 47873055, 27269961, 63412921, 16566086, + 27218280, 2607121, 29375955, 6024730 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2064251142068628, 1666421603389706, 1419271365315441, + 468767774902855, 191535130366583 +#else + 842132, 30759739, 62345482, 24831616, 26332017, 21148791, + 11831879, 6985184, 57168503, 2854095 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1716987058588002, 1859366439773457, 1767194234188234, + 64476199777924, 1117233614485261 +#else + 62261602, 25585100, 2516241, 27706719, 9695690, 26333246, + 16512644, 960770, 12121869, 16648078 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 984292135520292, 135138246951259, 2220652137473167, + 1722843421165029, 190482558012909 +#else + 51890212, 14667095, 53772635, 2013716, 30598287, 33090295, + 35603941, 25672367, 20237805, 2838411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 298845952651262, 1166086588952562, 1179896526238434, + 1347812759398693, 1412945390096208 +#else + 47820798, 4453151, 15298546, 17376044, 22115042, 17581828, + 12544293, 20083975, 1068880, 21054527 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143239552672925, 906436640714209, 2177000572812152, + 2075299936108548, 325186347798433 +#else + 57549981, 17035596, 33238497, 13506958, 30505848, 32439836, + 58621956, 30924378, 12521377, 4845654 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 721024854374772, 684487861263316, 1373438744094159, + 2193186935276995, 1387043709851261 +#else + 38910324, 10744107, 64150484, 10199663, 7759311, 20465832, + 3409347, 32681032, 60626557, 20668561 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 418098668140962, 715065997721283, 1471916138376055, + 2168570337288357, 937812682637044 +#else + 43547042, 6230155, 46726851, 10655313, 43068279, 21933259, + 10477733, 32314216, 63995636, 13974497 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1043584187226485, 2143395746619356, 2209558562919611, + 482427979307092, 847556718384018 +#else + 12966261, 15550616, 35069916, 31939085, 21025979, 32924988, + 5642324, 7188737, 18895762, 12629579 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1248731221520759, 1465200936117687, 540803492710140, + 52978634680892, 261434490176109 +#else + 14741879, 18607545, 22177207, 21833195, 1279740, 8058600, + 11758140, 789443, 32195181, 3895677 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1057329623869501, 620334067429122, 461700859268034, + 2012481616501857, 297268569108938 +#else + 10758205, 15755439, 62598914, 9243697, 62229442, 6879878, + 64904289, 29988312, 58126794, 4429646 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1055352180870759, 1553151421852298, 1510903185371259, + 1470458349428097, 1226259419062731 +#else + 64654951, 15725972, 46672522, 23143759, 61304955, 22514211, + 59972993, 21911536, 18047435, 18272689 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1492988790301668, 790326625573331, 1190107028409745, + 1389394752159193, 1620408196604194 +#else + 41935844, 22247266, 29759955, 11776784, 44846481, 17733976, + 10993113, 20703595, 49488162, 24145963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47000654413729, 1004754424173864, 1868044813557703, + 173236934059409, 588771199737015 +#else + 21987233, 700364, 42603816, 14972007, 59334599, 27836036, + 32155025, 2581431, 37149879, 8773374 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 30498470091663, 1082245510489825, 576771653181956, + 806509986132686, 1317634017056939 +#else + 41540495, 454462, 53896929, 16126714, 25240068, 8594567, + 20656846, 12017935, 59234475, 19634276 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 420308055751555, 1493354863316002, 165206721528088, + 1884845694919786, 2065456951573059 +#else + 6028163, 6263078, 36097058, 22252721, 66289944, 2461771, + 35267690, 28086389, 65387075, 30777706 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115636332012334, 1854340990964155, 83792697369514, + 1972177451994021, 457455116057587 +#else + 54829870, 16624276, 987579, 27631834, 32908202, 1248608, + 7719845, 29387734, 28408819, 6816612 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1698968457310898, 1435137169051090, 1083661677032510, + 938363267483709, 340103887207182 +#else + 56750770, 25316602, 19549650, 21385210, 22082622, 16147817, + 20613181, 13982702, 56769294, 5067942 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1995325341336574, 911500251774648, 164010755403692, + 855378419194762, 1573601397528842 +#else + 36602878, 29732664, 12074680, 13582412, 47230892, 2443950, + 47389578, 12746131, 5331210, 23448488 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 241719380661528, 310028521317150, 1215881323380194, + 1408214976493624, 2141142156467363 +#else + 30528792, 3601899, 65151774, 4619784, 39747042, 18118043, + 24180792, 20984038, 27679907, 31905504 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1315157046163473, 727368447885818, 1363466668108618, + 1668921439990361, 1398483384337907 +#else + 9402385, 19597367, 32834042, 10838634, 40528714, 20317236, + 26653273, 24868867, 22611443, 20839026 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 75029678299646, 1015388206460473, 1849729037055212, + 1939814616452984, 444404230394954 +#else + 22190590, 1118029, 22736441, 15130463, 36648172, 27563110, + 19189624, 28905490, 4854858, 6622139 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2053597130993710, 2024431685856332, 2233550957004860, + 2012407275509545, 872546993104440 +#else + 58798126, 30600981, 58846284, 30166382, 56707132, 33282502, + 13424425, 29987205, 26404408, 13001963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1217269667678610, 599909351968693, 1390077048548598, + 1471879360694802, 739586172317596 +#else + 35867026, 18138731, 64114613, 8939345, 11562230, 20713762, + 41044498, 21932711, 51703708, 11020692 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1718318639380794, 1560510726633958, 904462881159922, + 1418028351780052, 94404349451937 +#else + 1866042, 25604943, 59210214, 23253421, 12483314, 13477547, + 3175636, 21130269, 28761761, 1406734 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2132502667405250, 214379346175414, 1502748313768060, + 1960071701057800, 1353971822643138 +#else + 66660290, 31776765, 13018550, 3194501, 57528444, 22392694, + 24760584, 29207344, 25577410, 20175752 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 319394212043702, 2127459436033571, 717646691535162, + 663366796076914, 318459064945314 +#else + 42818486, 4759344, 66418211, 31701615, 2066746, 10693769, + 37513074, 9884935, 57739938, 4745409 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 405989424923593, 1960452633787083, 667349034401665, + 1492674260767112, 1451061489880787 +#else + 57967561, 6049713, 47577803, 29213020, 35848065, 9944275, + 51646856, 22242579, 10931923, 21622501 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 947085906234007, 323284730494107, 1485778563977200, + 728576821512394, 901584347702286 +#else + 50547351, 14112679, 59096219, 4817317, 59068400, 22139825, + 44255434, 10856640, 46638094, 13434653 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1575783124125742, 2126210792434375, 1569430791264065, + 1402582372904727, 1891780248341114 +#else + 22759470, 23480998, 50342599, 31683009, 13637441, 23386341, + 1765143, 20900106, 28445306, 28189722 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 838432205560695, 1997703511451664, 1018791879907867, + 1662001808174331, 78328132957753 +#else + 29875063, 12493613, 2795536, 29768102, 1710619, 15181182, + 56913147, 24765756, 9074233, 1167180 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 739152638255629, 2074935399403557, 505483666745895, + 1611883356514088, 628654635394878 +#else + 40903181, 11014232, 57266213, 30918946, 40200743, 7532293, + 48391976, 24018933, 3843902, 9367684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1822054032121349, 643057948186973, 7306757352712, + 577249257962099, 284735863382083 +#else + 56139269, 27150720, 9591133, 9582310, 11349256, 108879, + 16235123, 8601684, 66969667, 4242894 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1366558556363930, 1448606567552086, 1478881020944768, + 165803179355898, 1115718458123498 +#else + 22092954, 20363309, 65066070, 21585919, 32186752, 22037044, + 60534522, 2470659, 39691498, 16625500 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 204146226972102, 1630511199034723, 2215235214174763, + 174665910283542, 956127674017216 +#else + 56051142, 3042015, 13770083, 24296510, 584235, 33009577, + 59338006, 2602724, 39757248, 14247412 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1562934578796716, 1070893489712745, 11324610642270, + 958989751581897, 2172552325473805 +#else + 6314156, 23289540, 34336361, 15957556, 56951134, 168749, + 58490057, 14290060, 27108877, 32373552 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1770564423056027, 735523631664565, 1326060113795289, + 1509650369341127, 65892421582684 +#else + 58522267, 26383465, 13241781, 10960156, 34117849, 19759835, + 33547975, 22495543, 39960412, 981873 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 623682558650637, 1337866509471512, 990313350206649, + 1314236615762469, 1164772974270275 +#else + 22833421, 9293594, 34459416, 19935764, 57971897, 14756818, + 44180005, 19583651, 56629059, 17356469 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 223256821462517, 723690150104139, 1000261663630601, + 933280913953265, 254872671543046 +#else + 59340277, 3326785, 38997067, 10783823, 19178761, 14905060, + 22680049, 13906969, 51175174, 3797898 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1969087237026041, 624795725447124, 1335555107635969, + 2069986355593023, 1712100149341902 +#else + 21721337, 29341686, 54902740, 9310181, 63226625, 19901321, + 23740223, 30845200, 20491982, 25512280 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1236103475266979, 1837885883267218, 1026072585230455, + 1025865513954973, 1801964901432134 +#else + 9209251, 18419377, 53852306, 27386633, 66377847, 15289672, + 25947805, 15286587, 30997318, 26851369 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115241013365517, 1712251818829143, 2148864332502771, + 2096001471438138, 2235017246626125 +#else + 7392013, 16618386, 23946583, 25514540, 53843699, 32020573, + 52911418, 31232855, 17649997, 33304352 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1299268198601632, 2047148477845621, 2165648650132450, + 1612539282026145, 514197911628890 +#else + 57807776, 19360604, 30609525, 30504889, 41933794, 32270679, + 51867297, 24028707, 64875610, 7662145 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 118352772338543, 1067608711804704, 1434796676193498, + 1683240170548391, 230866769907437 +#else + 49550191, 1763593, 33994528, 15908609, 37067994, 21380136, + 7335079, 25082233, 63934189, 3440182 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850689576796636, 1601590730430274, 1139674615958142, + 1954384401440257, 76039205311 +#else + 47219164, 27577423, 42997570, 23865561, 10799742, 16982475, + 40449, 29122597, 4862399, 1133 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1723387471374172, 997301467038410, 533927635123657, + 20928644693965, 1756575222802513 +#else + 34252636, 25680474, 61686474, 14860949, 50789833, 7956141, + 7258061, 311861, 36513873, 26175010 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2146711623855116, 503278928021499, 625853062251406, + 1109121378393107, 1033853809911861 +#else + 63335436, 31988495, 28985339, 7499440, 24445838, 9325937, + 29727763, 16527196, 18278453, 15405622 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 571005965509422, 2005213373292546, 1016697270349626, + 56607856974274, 914438579435146 +#else + 62726958, 8508651, 47210498, 29880007, 61124410, 15149969, + 53795266, 843522, 45233802, 13626196 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346698876211176, 2076651707527589, 1084761571110205, + 265334478828406, 1068954492309671 +#else + 2281448, 20067377, 56193445, 30944521, 1879357, 16164207, + 56324982, 3953791, 13340839, 15928663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1769967932677654, 1695893319756416, 1151863389675920, + 1781042784397689, 400287774418285 +#else + 31727126, 26374577, 48671360, 25270779, 2875792, 17164102, + 41838969, 26539605, 43656557, 5964752 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1851867764003121, 403841933237558, 820549523771987, + 761292590207581, 1743735048551143 +#else + 4100401, 27594980, 49929526, 6017713, 48403027, 12227140, + 40424029, 11344143, 2538215, 25983677 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 410915148140008, 2107072311871739, 1004367461876503, + 99684895396761, 1180818713503224 +#else + 57675240, 6123112, 11159803, 31397824, 30016279, 14966241, + 46633881, 1485420, 66479608, 17595569 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 285945406881439, 648174397347453, 1098403762631981, + 1366547441102991, 1505876883139217 +#else + 40304287, 4260918, 11851389, 9658551, 35091757, 16367491, + 46903439, 20363143, 11659921, 22439314 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 672095903120153, 1675918957959872, 636236529315028, + 1569297300327696, 2164144194785875 +#else + 26180377, 10015009, 36264640, 24973138, 5418196, 9480663, + 2231568, 23384352, 33100371, 32248261 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1902708175321798, 1035343530915438, 1178560808893263, + 301095684058146, 1280977479761118 +#else + 15121094, 28352561, 56718958, 15427820, 39598927, 17561924, + 21670946, 4486675, 61177054, 19088051 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1615357281742403, 404257611616381, 2160201349780978, + 1160947379188955, 1578038619549541 +#else + 16166467, 24070699, 56004733, 6023907, 35182066, 32189508, + 2340059, 17299464, 56373093, 23514607 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013087639791217, 822734930507457, 1785668418619014, + 1668650702946164, 389450875221715 +#else + 28042865, 29997343, 54982337, 12259705, 63391366, 26608532, + 6766452, 24864833, 18036435, 5803270 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 453918449698368, 106406819929001, 2072540975937135, + 308588860670238, 1304394580755385 +#else + 66291264, 6763911, 11803561, 1585585, 10958447, 30883267, + 23855390, 4598332, 60949433, 19436993 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295082798350326, 2091844511495996, 1851348972587817, + 3375039684596, 789440738712837 +#else + 36077558, 19298237, 17332028, 31170912, 31312681, 27587249, + 696308, 50292, 47013125, 11763583 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2083069137186154, 848523102004566, 993982213589257, + 1405313299916317, 1532824818698468 +#else + 66514282, 31040148, 34874710, 12643979, 12650761, 14811489, + 665117, 20940800, 47335652, 22840869 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1495961298852430, 1397203457344779, 1774950217066942, + 139302743555696, 66603584342787 +#else + 30464590, 22291560, 62981387, 20819953, 19835326, 26448819, + 42712688, 2075772, 50088707, 992470 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1782411379088302, 1096724939964781, 27593390721418, + 542241850291353, 1540337798439873 +#else + 18357166, 26559999, 7766381, 16342475, 37783946, 411173, + 14578841, 8080033, 55534529, 22952821 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 693543956581437, 171507720360750, 1557908942697227, + 1074697073443438, 1104093109037196 +#else + 19598397, 10334610, 12555054, 2555664, 18821899, 23214652, + 21873262, 16014234, 26224780, 16452269 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 345288228393419, 1099643569747172, 134881908403743, + 1740551994106740, 248212179299770 +#else + 36884939, 5145195, 5944548, 16385966, 3976735, 2009897, + 55731060, 25936245, 46575034, 3698649 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 231429562203065, 1526290236421172, 2021375064026423, + 1520954495658041, 806337791525116 +#else + 14187449, 3448569, 56472628, 22743496, 44444983, 30120835, + 7268409, 22663988, 27394300, 12015369 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1079623667189886, 872403650198613, 766894200588288, + 2163700860774109, 2023464507911816 +#else + 19695742, 16087646, 28032085, 12999827, 6817792, 11427614, + 20244189, 32241655, 53849736, 30151970 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 854645372543796, 1936406001954827, 151460662541253, + 825325739271555, 1554306377287556 +#else + 30860084, 12735208, 65220619, 28854697, 50133957, 2256939, + 58942851, 12298311, 58558340, 23160969 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1497138821904622, 1044820250515590, 1742593886423484, + 1237204112746837, 849047450816987 +#else + 61389038, 22309106, 65198214, 15569034, 26642876, 25966672, + 61319509, 18435777, 62132699, 12651792 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 667962773375330, 1897271816877105, 1399712621683474, + 1143302161683099, 2081798441209593 +#else + 64260450, 9953420, 11531313, 28271553, 26895122, 20857343, + 53990043, 17036529, 9768697, 31021214 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 127147851567005, 1936114012888110, 1704424366552046, + 856674880716312, 716603621335359 +#else + 42389405, 1894650, 66821166, 28850346, 15348718, 25397902, + 32767512, 12765450, 4940095, 10678226 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1072409664800960, 2146937497077528, 1508780108920651, + 935767602384853, 1112800433544068 +#else + 18860224, 15980149, 48121624, 31991861, 40875851, 22482575, + 59264981, 13944023, 42736516, 16582018 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 333549023751292, 280219272863308, 2104176666454852, + 1036466864875785, 536135186520207 +#else + 51604604, 4970267, 37215820, 4175592, 46115652, 31354675, + 55404809, 15444559, 56105103, 7989036 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 373666279883137, 146457241530109, 304116267127857, + 416088749147715, 1258577131183391 +#else + 31490433, 5568061, 64696061, 2182382, 34772017, 4531685, + 35030595, 6200205, 47422751, 18754260 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1186115062588401, 2251609796968486, 1098944457878953, + 1153112761201374, 1791625503417267 +#else + 49800177, 17674491, 35586086, 33551600, 34221481, 16375548, + 8680158, 17182719, 28550067, 26697300 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1870078460219737, 2129630962183380, 852283639691142, + 292865602592851, 401904317342226 +#else + 38981977, 27866340, 16837844, 31733974, 60258182, 12700015, + 37068883, 4364037, 1155602, 5988841 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1361070124828035, 815664541425524, 1026798897364671, + 1951790935390647, 555874891834790 +#else + 21890435, 20281525, 54484852, 12154348, 59276991, 15300495, + 23148983, 29083951, 24618406, 8283181 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1546301003424277, 459094500062839, 1097668518375311, + 1780297770129643, 720763293687608 +#else + 33972757, 23041680, 9975415, 6841041, 35549071, 16356535, + 3070187, 26528504, 1466168, 10740210 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1212405311403990, 1536693382542438, 61028431067459, + 1863929423417129, 1223219538638038 +#else + 65599446, 18066246, 53605478, 22898515, 32799043, 909394, + 53169961, 27774712, 34944214, 18227391 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1294303766540260, 1183557465955093, 882271357233093, + 63854569425375, 2213283684565087 +#else + 3960804, 19286629, 39082773, 17636380, 47704005, 13146867, + 15567327, 951507, 63848543, 32980496 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 339050984211414, 601386726509773, 413735232134068, + 966191255137228, 1839475899458159 +#else + 24740822, 5052253, 37014733, 8961360, 25877428, 6165135, + 42740684, 14397371, 59728495, 27410326 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 235605972169408, 2174055643032978, 1538335001838863, + 1281866796917192, 1815940222628465 +#else + 38220480, 3510802, 39005586, 32395953, 55870735, 22922977, + 51667400, 19101303, 65483377, 27059617 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1632352921721536, 1833328609514701, 2092779091951987, + 1923956201873226, 2210068022482919 +#else + 793280, 24323954, 8836301, 27318725, 39747955, 31184838, + 33152842, 28669181, 57202663, 32932579 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 35271216625062, 1712350667021807, 983664255668860, + 98571260373038, 1232645608559836 +#else + 5666214, 525582, 20782575, 25516013, 42570364, 14657739, + 16099374, 1468826, 60937436, 18367850 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1998172393429622, 1798947921427073, 784387737563581, + 1589352214827263, 1589861734168180 +#else + 62249590, 29775088, 64191105, 26806412, 7778749, 11688288, + 36704511, 23683193, 65549940, 23690785 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1733739258725305, 31715717059538, 201969945218860, + 992093044556990, 1194308773174556 +#else + 10896313, 25834728, 824274, 472601, 47648556, 3009586, 25248958, + 14783338, 36527388, 17796587 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 846415389605137, 746163495539180, 829658752826080, + 592067705956946, 957242537821393 +#else + 10566929, 12612572, 35164652, 11118702, 54475488, 12362878, + 21752402, 8822496, 24003793, 14264025 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1758148849754419, 619249044817679, 168089007997045, + 1371497636330523, 1867101418880350 +#else + 27713843, 26198459, 56100623, 9227529, 27050101, 2504721, + 23886875, 20436907, 13958494, 27821979 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 326633984209635, 261759506071016, 1700682323676193, + 1577907266349064, 1217647663383016 +#else + 43627235, 4867225, 39861736, 3900520, 29838369, 25342141, + 35219464, 23512650, 7340520, 18144364 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1714182387328607, 1477856482074168, 574895689942184, + 2159118410227270, 1555532449716575 +#else + 4646495, 25543308, 44342840, 22021777, 23184552, 8566613, + 31366726, 32173371, 52042079, 23179239 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 853828206885131, 998498946036955, 1835887550391235, + 207627336608048, 258363815956050 +#else + 49838347, 12723031, 50115803, 14878793, 21619651, 27356856, + 27584816, 3093888, 58265170, 3849920 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 141141474651677, 1236728744905256, 643101419899887, + 1646615130509173, 1208239602291765 +#else + 58043933, 2103171, 25561640, 18428694, 61869039, 9582957, + 32477045, 24536477, 5002293, 18004173 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1501663228068911, 1354879465566912, 1444432675498247, + 897812463852601, 855062598754348 +#else + 55051311, 22376525, 21115584, 20189277, 8808711, 21523724, + 16489529, 13378448, 41263148, 12741425 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 714380763546606, 1032824444965790, 1774073483745338, + 1063840874947367, 1738680636537158 +#else + 61162478, 10645102, 36197278, 15390283, 63821882, 26435754, + 24306471, 15852464, 28834118, 25908360 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1640635546696252, 633168953192112, 2212651044092396, + 30590958583852, 368515260889378 +#else + 49773116, 24447374, 42577584, 9434952, 58636780, 32971069, + 54018092, 455840, 20461858, 5491305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1171650314802029, 1567085444565577, 1453660792008405, + 757914533009261, 1619511342778196 +#else + 13669229, 17458950, 54626889, 23351392, 52539093, 21661233, + 42112877, 11293806, 38520660, 24132599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 420958967093237, 971103481109486, 2169549185607107, + 1301191633558497, 1661514101014240 +#else + 28497909, 6272777, 34085870, 14470569, 8906179, 32328802, + 18504673, 19389266, 29867744, 24758489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 907123651818302, 1332556122804146, 1824055253424487, + 1367614217442959, 1982558335973172 +#else + 50901822, 13517195, 39309234, 19856633, 24009063, 27180541, + 60741263, 20379039, 22853428, 29542421 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121533090144639, 1021251337022187, 110469995947421, + 1511059774758394, 2110035908131662 +#else + 24191359, 16712145, 53177067, 15217830, 14542237, 1646131, + 18603514, 22516545, 12876622, 31441985 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 303213233384524, 2061932261128138, 352862124777736, + 40828818670255, 249879468482660 +#else + 17902668, 4518229, 66697162, 30725184, 26878216, 5258055, + 54248111, 608396, 16031844, 3723494 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 856559257852200, 508517664949010, 1378193767894916, + 1723459126947129, 1962275756614521 +#else + 38476072, 12763727, 46662418, 7577503, 33001348, 20536687, + 17558841, 25681542, 23896953, 29240187 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1445691340537320, 40614383122127, 402104303144865, + 485134269878232, 1659439323587426 +#else + 47103464, 21542479, 31520463, 605201, 2543521, 5991821, + 64163800, 7229063, 57189218, 24727572 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 20057458979482, 1183363722525800, 2140003847237215, + 2053873950687614, 2112017736174909 +#else + 28816026, 298879, 38943848, 17633493, 19000927, 31888542, + 54428030, 30605106, 49057085, 31471516 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2228654250927986, 1483591363415267, 1368661293910956, + 1076511285177291, 526650682059608 +#else + 16000882, 33209536, 3493091, 22107234, 37604268, 20394642, + 12577739, 16041268, 47393624, 7847706 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 709481497028540, 531682216165724, 316963769431931, + 1814315888453765, 258560242424104 +#else + 10151868, 10572098, 27312476, 7922682, 14825339, 4723128, + 34252933, 27035413, 57088296, 3852847 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1053447823660455, 1955135194248683, 1010900954918985, + 1182614026976701, 1240051576966610 +#else + 55678375, 15697595, 45987307, 29133784, 5386313, 15063598, + 16514493, 17622322, 29330898, 18478208 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1957943897155497, 1788667368028035, 137692910029106, + 1039519607062, 826404763313028 +#else + 41609129, 29175637, 51885955, 26653220, 16615730, 2051784, + 3303702, 15490, 39560068, 12314390 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1848942433095597, 1582009882530495, 1849292741020143, + 1068498323302788, 2001402229799484 +#else + 15683501, 27551389, 18109119, 23573784, 15337967, 27556609, + 50391428, 15921865, 16103996, 29823217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1528282417624269, 2142492439828191, 2179662545816034, + 362568973150328, 1591374675250271 +#else + 43939021, 22773182, 13588191, 31925625, 63310306, 32479502, + 47835256, 5402698, 37293151, 23713330 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 160026679434388, 232341189218716, 2149181472355545, + 598041771119831, 183859001910173 +#else + 23190676, 2384583, 34394524, 3462153, 37205209, 32025299, + 55842007, 8911516, 41903005, 2739712 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013278155187349, 662660471354454, 793981225706267, + 411706605985744, 804490933124791 +#else + 21374101, 30000182, 33584214, 9874410, 15377179, 11831242, + 33578960, 6134906, 4931255, 11987849 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2051892037280204, 488391251096321, 2230187337030708, + 930221970662692, 679002758255210 +#else + 67101132, 30575573, 50885377, 7277596, 105524, 33232381, + 35628324, 13861387, 37032554, 10117929 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1530723630438670, 875873929577927, 341560134269988, + 449903119530753, 1055551308214179 +#else + 37607694, 22809559, 40945095, 13051538, 41483300, 5089642, + 60783361, 6704078, 12890019, 15728940 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1461835919309432, 1955256480136428, 180866187813063, + 1551979252664528, 557743861963950 +#else + 45136504, 21783052, 66157804, 29135591, 14704839, 2695116, + 903376, 23126293, 12885166, 8311031 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 359179641731115, 1324915145732949, 902828372691474, + 294254275669987, 1887036027752957 +#else + 49592363, 5352193, 10384213, 19742774, 7506450, 13453191, + 26423267, 4384730, 1888765, 28119028 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2043271609454323, 2038225437857464, 1317528426475850, + 1398989128982787, 2027639881006861 +#else + 41291507, 30447119, 53614264, 30371925, 30896458, 19632703, + 34857219, 20846562, 47644429, 30214188 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2072902725256516, 312132452743412, 309930885642209, + 996244312618453, 1590501300352303 +#else + 43500868, 30888657, 66582772, 4651135, 5765089, 4618330, + 6092245, 14845197, 17151279, 23700316 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1397254305160710, 695734355138021, 2233992044438756, + 1776180593969996, 1085588199351115 +#else + 42278406, 20820711, 51942885, 10367249, 37577956, 33289075, + 22825804, 26467153, 50242379, 16176524 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 440567051331029, 254894786356681, 493869224930222, + 1556322069683366, 1567456540319218 +#else + 43525589, 6564960, 20063689, 3798228, 62368686, 7359224, + 2006182, 23191006, 38362610, 23356922 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1950722461391320, 1907845598854797, 1822757481635527, + 2121567704750244, 73811931471221 +#else + 56482264, 29068029, 53788301, 28429114, 3432135, 27161203, + 23632036, 31613822, 32808309, 1099883 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 387139307395758, 2058036430315676, 1220915649965325, + 1794832055328951, 1230009312169328 +#else + 15030958, 5768825, 39657628, 30667132, 60681485, 18193060, + 51830967, 26745081, 2051440, 18328567 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1765973779329517, 659344059446977, 19821901606666, + 1301928341311214, 1116266004075885 +#else + 63746541, 26315059, 7517889, 9824992, 23555850, 295369, 5148398, + 19400244, 44422509, 16633659 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1127572801181483, 1224743760571696, 1276219889847274, + 1529738721702581, 1589819666871853 +#else + 4577067, 16802144, 13249840, 18250104, 19958762, 19017158, + 18559669, 22794883, 8402477, 23690159 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2181229378964934, 2190885205260020, 1511536077659137, + 1246504208580490, 668883326494241 +#else + 38702534, 32502850, 40318708, 32646733, 49896449, 22523642, + 9453450, 18574360, 17983009, 9967138 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 437866655573314, 669026411194768, 81896997980338, + 523874406393178, 245052060935236 +#else + 41346370, 6524721, 26585488, 9969270, 24709298, 1220360, + 65430874, 7806336, 17507396, 3651560 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1975438052228868, 1071801519999806, 594652299224319, + 1877697652668809, 1489635366987285 +#else + 56688388, 29436320, 14584638, 15971087, 51340543, 8861009, + 26556809, 27979875, 48555541, 22197296 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 958592545673770, 233048016518599, 851568750216589, + 567703851596087, 1740300006094761 +#else + 2839082, 14284142, 4029895, 3472686, 14402957, 12689363, + 40466743, 8459446, 61503401, 25932490 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2014540178270324, 192672779514432, 213877182641530, + 2194819933853411, 1716422829364835 +#else + 62269556, 30018987, 9744960, 2871048, 25113978, 3187018, + 41998051, 32705365, 17258083, 25576693 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1540769606609725, 2148289943846077, 1597804156127445, + 1230603716683868, 815423458809453 +#else + 18164541, 22959256, 49953981, 32012014, 19237077, 23809137, + 23357532, 18337424, 26908269, 12150756 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1738560251245018, 1779576754536888, 1783765347671392, + 1880170990446751, 1088225159617541 +#else + 36843994, 25906566, 5112248, 26517760, 65609056, 26580174, + 43167, 28016731, 34806789, 16215818 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 659303913929492, 1956447718227573, 1830568515922666, + 841069049744408, 1669607124206368 +#else + 60209940, 9824393, 54804085, 29153342, 35711722, 27277596, + 32574488, 12532905, 59605792, 24879084 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143465490433355, 1532194726196059, 1093276745494697, + 481041706116088, 2121405433561163 +#else + 39765323, 17038963, 39957339, 22831480, 946345, 16291093, + 254968, 7168080, 21676107, 31611404 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1686424298744462, 1451806974487153, 266296068846582, + 1834686947542675, 1720762336132256 +#else + 21260942, 25129680, 50276977, 21633609, 43430902, 3968120, + 63456915, 27338965, 63552672, 25641356 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 889217026388959, 1043290623284660, 856125087551909, + 1669272323124636, 1603340330827879 +#else + 16544735, 13250366, 50304436, 15546241, 62525861, 12757257, + 64646556, 24874095, 48201831, 23891632 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1206396181488998, 333158148435054, 1402633492821422, + 1120091191722026, 1945474114550509 +#else + 64693606, 17976703, 18312302, 4964443, 51836334, 20900867, + 26820650, 16690659, 25459437, 28989823 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 766720088232571, 1512222781191002, 1189719893490790, + 2091302129467914, 2141418006894941 +#else + 41964155, 11425019, 28423002, 22533875, 60963942, 17728207, + 9142794, 31162830, 60676445, 31909614 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 419663647306612, 1998875112167987, 1426599870253707, + 1154928355379510, 486538532138187 +#else + 44004212, 6253475, 16964147, 29785560, 41994891, 21257994, + 39651638, 17209773, 6335691, 7249989 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 938160078005954, 1421776319053174, 1941643234741774, + 180002183320818, 1414380336750546 +#else + 36775618, 13979674, 7503222, 21186118, 55152142, 28932738, + 36836594, 2682241, 25993170, 21075909 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 398001940109652, 1577721237663248, 1012748649830402, + 1540516006905144, 1011684812884559 +#else + 4364628, 5930691, 32304656, 23509878, 59054082, 15091130, + 22857016, 22955477, 31820367, 15075278 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1653276489969630, 6081825167624, 1921777941170836, + 1604139841794531, 861211053640641 +#else + 31879134, 24635739, 17258760, 90626, 59067028, 28636722, + 24162787, 23903546, 49138625, 12833044 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996661541407379, 1455877387952927, 744312806857277, + 139213896196746, 1000282908547789 +#else + 19073683, 14851414, 42705695, 21694263, 7625277, 11091125, + 47489674, 2074448, 57694925, 14905376 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1450817495603008, 1476865707053229, 1030490562252053, + 620966950353376, 1744760161539058 +#else + 24483648, 21618865, 64589997, 22007013, 65555733, 15355505, + 41826784, 9253128, 27628530, 25998952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 559728410002599, 37056661641185, 2038622963352006, + 1637244893271723, 1026565352238948 +#else + 17597607, 8340603, 19355617, 552187, 26198470, 30377849, + 4593323, 24396850, 52997988, 15297015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 962165956135846, 1116599660248791, 182090178006815, + 1455605467021751, 196053588803284 +#else + 510886, 14337390, 35323607, 16638631, 6328095, 2713355, + 46891447, 21690211, 8683220, 2921426 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 796863823080135, 1897365583584155, 420466939481601, + 2165972651724672, 932177357788289 +#else + 18606791, 11874196, 27155355, 28272950, 43077121, 6265445, + 41930624, 32275507, 4674689, 13890525 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 877047233620632, 1375632631944375, 643773611882121, + 660022738847877, 19353932331831 +#else + 13609624, 13069022, 39736503, 20498523, 24360585, 9592974, + 14977157, 9835105, 4389687, 288396 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2216943882299338, 394841323190322, 2222656898319671, + 558186553950529, 1077236877025190 +#else + 9922506, 33035038, 13613106, 5883594, 48350519, 33120168, + 54804801, 8317627, 23388070, 16052080 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 801118384953213, 1914330175515892, 574541023311511, + 1471123787903705, 1526158900256288 +#else + 12719997, 11937594, 35138804, 28525742, 26900119, 8561328, + 46953177, 21921452, 52354592, 22741539 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 949617889087234, 2207116611267331, 912920039141287, + 501158539198789, 62362560771472 +#else + 15961858, 14150409, 26716931, 32888600, 44314535, 13603568, + 11829573, 7467844, 38286736, 929274 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1474518386765335, 1760793622169197, 1157399790472736, + 1622864308058898, 165428294422792 +#else + 11038231, 21972036, 39798381, 26237869, 56610336, 17246600, + 43629330, 24182562, 45715720, 2465073 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1961673048027128, 102619413083113, 1051982726768458, + 1603657989805485, 1941613251499678 +#else + 20017144, 29231206, 27915241, 1529148, 12396362, 15675764, + 13817261, 23896366, 2463390, 28932292 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1401939116319266, 335306339903072, 72046196085786, + 862423201496006, 850518754531384 +#else + 50749986, 20890520, 55043680, 4996453, 65852442, 1073571, + 9583558, 12851107, 4003896, 12673717 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1234706593321979, 1083343891215917, 898273974314935, + 1640859118399498, 157578398571149 +#else + 65377275, 18398561, 63845933, 16143081, 19294135, 13385325, + 14741514, 24450706, 7903885, 2348101 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143483057726416, 1992614991758919, 674268662140796, + 1773370048077526, 674318359920189 +#else + 24536016, 17039225, 12715591, 29692277, 1511292, 10047386, + 63266518, 26425272, 38731325, 10048126 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1835401379538542, 173900035308392, 818247630716732, + 1762100412152786, 1021506399448291 +#else + 54486638, 27349611, 30718824, 2591312, 56491836, 12192839, + 18873298, 26257342, 34811107, 15221631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1506632088156630, 2127481795522179, 513812919490255, + 140643715928370, 442476620300318 +#else + 40630742, 22450567, 11546243, 31701949, 9180879, 7656409, + 45764914, 2095754, 29769758, 6593415 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2056683376856736, 219094741662735, 2193541883188309, + 1841182310235800, 556477468664293 +#else + 35114656, 30646970, 4176911, 3264766, 12538965, 32686321, + 26312344, 27435754, 30958053, 8292160 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1315019427910827, 1049075855992603, 2066573052986543, + 266904467185534, 2040482348591520 +#else + 31429803, 19595316, 29173531, 15632448, 12174511, 30794338, + 32808830, 3977186, 26143136, 30405556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 94096246544434, 922482381166992, 24517828745563, + 2139430508542503, 2097139044231004 +#else + 22648882, 1402143, 44308880, 13746058, 7936347, 365344, + 58440231, 31879998, 63350620, 31249806 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 537697207950515, 1399352016347350, 1563663552106345, + 2148749520888918, 549922092988516 +#else + 51616947, 8012312, 64594134, 20851969, 43143017, 23300402, + 65496150, 32018862, 50444388, 8194477 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1747985413252434, 680511052635695, 1809559829982725, + 594274250930054, 201673170745982 +#else + 27338066, 26047012, 59694639, 10140404, 48082437, 26964542, + 27277190, 8855376, 28572286, 3005164 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 323583936109569, 1973572998577657, 1192219029966558, + 79354804385273, 1374043025560347 +#else + 26287105, 4821776, 25476601, 29408529, 63344350, 17765447, + 49100281, 1182478, 41014043, 20474836 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 213277331329947, 416202017849623, 1950535221091783, + 1313441578103244, 2171386783823658 +#else + 59937691, 3178079, 23970071, 6201893, 49913287, 29065239, + 45232588, 19571804, 32208682, 32356184 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 189088804229831, 993969372859110, 895870121536987, + 1547301535298256, 1477373024911350 +#else + 50451143, 2817642, 56822502, 14811297, 6024667, 13349505, + 39793360, 23056589, 39436278, 22014573 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1620578418245010, 541035331188469, 2235785724453865, + 2154865809088198, 1974627268751826 +#else + 15941010, 24148500, 45741813, 8062054, 31876073, 33315803, + 51830470, 32110002, 15397330, 29424239 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346805451740245, 1350981335690626, 942744349501813, + 2155094562545502, 1012483751693409 +#else + 8934485, 20068965, 43822466, 20131190, 34662773, 14047985, + 31170398, 32113411, 39603297, 15087183 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2107080134091762, 1132567062788208, 1824935377687210, + 769194804343737, 1857941799971888 +#else + 48751602, 31397940, 24524912, 16876564, 15520426, 27193656, + 51606457, 11461895, 16788528, 27685490 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1074666112436467, 249279386739593, 1174337926625354, + 1559013532006480, 1472287775519121 +#else + 65161459, 16013772, 21750665, 3714552, 49707082, 17498998, + 63338576, 23231111, 31322513, 21938797 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1872620123779532, 1892932666768992, 1921559078394978, + 1270573311796160, 1438913646755037 +#else + 21426636, 27904214, 53460576, 28206894, 38296674, 28633461, + 48833472, 18933017, 13040861, 21441484 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 837390187648199, 1012253300223599, 989780015893987, + 1351393287739814, 328627746545550 +#else + 11293895, 12478086, 39972463, 15083749, 37801443, 14748871, + 14555558, 20137329, 1613710, 4896935 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1028328827183114, 1711043289969857, 1350832470374933, + 1923164689604327, 1495656368846911 +#else + 41213962, 15323293, 58619073, 25496531, 25967125, 20128972, + 2825959, 28657387, 43137087, 22287016 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1900828492104143, 430212361082163, 687437570852799, + 832514536673512, 1685641495940794 +#else + 51184079, 28324551, 49665331, 6410663, 3622847, 10243618, + 20615400, 12405433, 43355834, 25118015 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 842632847936398, 605670026766216, 290836444839585, + 163210774892356, 2213815011799645 +#else + 60017550, 12556207, 46917512, 9025186, 50036385, 4333800, + 4378436, 2432030, 23097949, 32988414 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1176336383453996, 1725477294339771, 12700622672454, + 678015708818208, 162724078519879 +#else + 4565804, 17528778, 20084411, 25711615, 1724998, 189254, + 24767264, 10103221, 48596551, 2424777 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1448049969043497, 1789411762943521, 385587766217753, + 90201620913498, 832999441066823 +#else + 366633, 21577626, 8173089, 26664313, 30788633, 5745705, + 59940186, 1344108, 63466311, 12412658 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 516086333293313, 2240508292484616, 1351669528166508, + 1223255565316488, 750235824427138 +#else + 43107073, 7690285, 14929416, 33386175, 34898028, 20141445, + 24162696, 18227928, 63967362, 11179384 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1263624896582495, 1102602401673328, 526302183714372, + 2152015839128799, 1483839308490010 +#else + 18289503, 18829478, 8056944, 16430056, 45379140, 7842513, + 61107423, 32067534, 48424218, 22110928 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 442991718646863, 1599275157036458, 1925389027579192, + 899514691371390, 350263251085160 +#else + 476239, 6601091, 60956074, 23831056, 17503544, 28690532, + 27672958, 13403813, 11052904, 5219329 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1689713572022143, 593854559254373, 978095044791970, + 1985127338729499, 1676069120347625 +#else + 20678527, 25178694, 34436965, 8849122, 62099106, 14574751, + 31186971, 29580702, 9014761, 24975376 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1557207018622683, 340631692799603, 1477725909476187, + 614735951619419, 2033237123746766 +#else + 53464795, 23204192, 51146355, 5075807, 65594203, 22019831, + 34006363, 9160279, 8473550, 30297594 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 968764929340557, 1225534776710944, 662967304013036, + 1155521416178595, 791142883466590 +#else + 24900749, 14435722, 17209120, 18261891, 44516588, 9878982, + 59419555, 17218610, 42540382, 11788947 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1487081286167458, 993039441814934, 1792378982844640, + 698652444999874, 2153908693179754 +#else + 63990690, 22159237, 53306774, 14797440, 9652448, 26708528, + 47071426, 10410732, 42540394, 32095740 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1123181311102823, 685575944875442, 507605465509927, + 1412590462117473, 568017325228626 +#else + 51449703, 16736705, 44641714, 10215877, 58011687, 7563910, + 11871841, 21049238, 48595538, 8464117 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 560258797465417, 2193971151466401, 1824086900849026, + 579056363542056, 1690063960036441 +#else + 43708233, 8348506, 52522913, 32692717, 63158658, 27181012, + 14325288, 8628612, 33313881, 25183915 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1918407319222416, 353767553059963, 1930426334528099, + 1564816146005724, 1861342381708096 +#else + 46921872, 28586496, 22367355, 5271547, 66011747, 28765593, + 42303196, 23317577, 58168128, 27736162 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2131325168777276, 1176636658428908, 1756922641512981, + 1390243617176012, 1966325177038383 +#else + 60160060, 31759219, 34483180, 17533252, 32635413, 26180187, + 15989196, 20716244, 28358191, 29300528 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2063958120364491, 2140267332393533, 699896251574968, + 273268351312140, 375580724713232 +#else + 43547083, 30755372, 34757181, 31892468, 57961144, 10429266, + 50471180, 4072015, 61757200, 5596588 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2024297515263178, 416959329722687, 1079014235017302, + 171612225573183, 1031677520051053 +#else + 38872266, 30164383, 12312895, 6213178, 3117142, 16078565, + 29266239, 2557221, 1768301, 15373193 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2033900009388450, 1744902869870788, 2190580087917640, + 1949474984254121, 231049754293748 +#else + 59865506, 30307471, 62515396, 26001078, 66980936, 32642186, + 66017961, 29049440, 42448372, 3442909 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 343868674606581, 550155864008088, 1450580864229630, + 481603765195050, 896972360018042 +#else + 36898293, 5124042, 14181784, 8197961, 18964734, 21615339, + 22597930, 7176455, 48523386, 13365929 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2151139328380127, 314745882084928, 59756825775204, + 1676664391494651, 2048348075599360 +#else + 59231455, 32054473, 8324672, 4690079, 6261860, 890446, 24538107, + 24984246, 57419264, 30522764 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1528930066340597, 1605003907059576, 1055061081337675, + 1458319101947665, 1234195845213142 +#else + 25008885, 22782833, 62803832, 23916421, 16265035, 15721635, + 683793, 21730648, 15723478, 18390951 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 830430507734812, 1780282976102377, 1425386760709037, + 362399353095425, 2168861579799910 +#else + 57448220, 12374378, 40101865, 26528283, 59384749, 21239917, + 11879681, 5400171, 519526, 32318556 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1155762232730333, 980662895504006, 2053766700883521, + 490966214077606, 510405877041357 +#else + 22258397, 17222199, 59239046, 14613015, 44588609, 30603508, + 46754982, 7315966, 16648397, 7605640 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1683750316716132, 652278688286128, 1221798761193539, + 1897360681476669, 319658166027343 +#else + 59027556, 25089834, 58885552, 9719709, 19259459, 18206220, + 23994941, 28272877, 57640015, 4763277 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 618808732869972, 72755186759744, 2060379135624181, + 1730731526741822, 48862757828238 +#else + 45409620, 9220968, 51378240, 1084136, 41632757, 30702041, + 31088446, 25789909, 55752334, 728111 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1463171970593505, 1143040711767452, 614590986558883, + 1409210575145591, 1882816996436803 +#else + 26047201, 21802961, 60208540, 17032633, 24092067, 9158119, + 62835319, 20998873, 37743427, 28056159 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2230133264691131, 563950955091024, 2042915975426398, + 827314356293472, 672028980152815 +#else + 17510331, 33231575, 5854288, 8403524, 17133918, 30441820, + 38997856, 12327944, 10750447, 10014012 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 264204366029760, 1654686424479449, 2185050199932931, + 2207056159091748, 506015669043634 +#else + 56796096, 3936951, 9156313, 24656749, 16498691, 32559785, + 39627812, 32887699, 3424690, 7540221 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1784446333136569, 1973746527984364, 334856327359575, + 1156769775884610, 1023950124675478 +#else + 30322361, 26590322, 11361004, 29411115, 7433303, 4989748, + 60037442, 17237212, 57864598, 15258045 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2065270940578383, 31477096270353, 306421879113491, + 181958643936686, 1907105536686083 +#else + 13054543, 30774935, 19155473, 469045, 54626067, 4566041, + 5631406, 2711395, 1062915, 28418087 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1496516440779464, 1748485652986458, 872778352227340, + 818358834654919, 97932669284220 +#else + 47868616, 22299832, 37599834, 26054466, 61273100, 13005410, + 61042375, 12194496, 32960380, 1459310 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 471636015770351, 672455402793577, 1804995246884103, + 1842309243470804, 1501862504981682 +#else + 19852015, 7027924, 23669353, 10020366, 8586503, 26896525, + 394196, 27452547, 18638002, 22379495 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1013216974933691, 538921919682598, 1915776722521558, + 1742822441583877, 1886550687916656 +#else + 31395515, 15098109, 26581030, 8030562, 50580950, 28547297, + 9012485, 25970078, 60465776, 28111795 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2094270000643336, 303971879192276, 40801275554748, + 649448917027930, 1818544418535447 +#else + 57916680, 31207054, 65111764, 4529533, 25766844, 607986, + 67095642, 9677542, 34813975, 27098423 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2241737709499165, 549397817447461, 838180519319392, + 1725686958520781, 1705639080897747 +#else + 64664349, 33404494, 29348901, 8186665, 1873760, 12489863, + 36174285, 25714739, 59256019, 25416002 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1216074541925116, 50120933933509, 1565829004133810, + 721728156134580, 349206064666188 +#else + 51872508, 18120922, 7766469, 746860, 26346930, 23332670, + 39775412, 10754587, 57677388, 5203575 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 948617110470858, 346222547451945, 1126511960599975, + 1759386906004538, 493053284802266 +#else + 31834314, 14135496, 66338857, 5159117, 20917671, 16786336, + 59640890, 26216907, 31809242, 7347066 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1454933046815146, 874696014266362, 1467170975468588, + 1432316382418897, 2111710746366763 +#else + 57502122, 21680191, 20414458, 13033986, 13716524, 21862551, + 19797969, 21343177, 15192875, 31466942 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2105387117364450, 1996463405126433, 1303008614294500, + 851908115948209, 1353742049788635 +#else + 54445282, 31372712, 1168161, 29749623, 26747876, 19416341, + 10609329, 12694420, 33473243, 20172328 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 750300956351719, 1487736556065813, 15158817002104, + 1511998221598392, 971739901354129 +#else + 33184999, 11180355, 15832085, 22169002, 65475192, 225883, + 15089336, 22530529, 60973201, 14480052 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1874648163531693, 2124487685930551, 1810030029384882, + 918400043048335, 586348627300650 +#else + 31308717, 27934434, 31030839, 31657333, 15674546, 26971549, + 5496207, 13685227, 27595050, 8737275 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1235084464747900, 1166111146432082, 1745394857881591, + 1405516473883040, 4463504151617 +#else + 46790012, 18404192, 10933842, 17376410, 8335351, 26008410, + 36100512, 20943827, 26498113, 66511 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1663810156463827, 327797390285791, 1341846161759410, + 1964121122800605, 1747470312055380 +#else + 22644435, 24792703, 50437087, 4884561, 64003250, 19995065, + 30540765, 29267685, 53781076, 26039336 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 660005247548233, 2071860029952887, 1358748199950107, + 911703252219107, 1014379923023831 +#else + 39091017, 9834844, 18617207, 30873120, 63706907, 20246925, + 8205539, 13585437, 49981399, 15115438 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2206641276178231, 1690587809721504, 1600173622825126, + 2156096097634421, 1106822408548216 +#else + 23711543, 32881517, 31206560, 25191721, 6164646, 23844445, + 33572981, 32128335, 8236920, 16492939 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1344788193552206, 1949552134239140, 1735915881729557, + 675891104100469, 1834220014427292 +#else + 43198286, 20038905, 40809380, 29050590, 25005589, 25867162, + 19574901, 10071562, 6708380, 27332008 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1920949492387964, 158885288387530, 70308263664033, + 626038464897817, 1468081726101009 +#else + 2101372, 28624378, 19702730, 2367575, 51681697, 1047674, + 5301017, 9328700, 29955601, 21876122 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622221042073383, 1210146474039168, 1742246422343683, + 1403839361379025, 417189490895736 +#else + 3096359, 9271816, 45488000, 18032587, 52260867, 25961494, + 41216721, 20918836, 57191288, 6216607 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 22727256592983, 168471543384997, 1324340989803650, + 1839310709638189, 504999476432775 +#else + 34493015, 338662, 41913253, 2510421, 37895298, 19734218, + 24822829, 27407865, 40341383, 7525078 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1313240518756327, 1721896294296942, 52263574587266, + 2065069734239232, 804910473424630 +#else + 44042215, 19568808, 16133486, 25658254, 63719298, 778787, + 66198528, 30771936, 47722230, 11994100 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1337466662091884, 1287645354669772, 2018019646776184, + 652181229374245, 898011753211715 +#else + 21691500, 19929806, 66467532, 19187410, 3285880, 30070836, + 42044197, 9718257, 59631427, 13381417 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1969792547910734, 779969968247557, 2011350094423418, + 1823964252907487, 1058949448296945 +#else + 18445390, 29352196, 14979845, 11622458, 65381754, 29971451, + 23111647, 27179185, 28535281, 15779576 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 207343737062002, 1118176942430253, 758894594548164, + 806764629546266, 1157700123092949 +#else + 30098034, 3089662, 57874477, 16662134, 45801924, 11308410, + 53040410, 12021729, 9955285, 17251076 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1273565321399022, 1638509681964574, 759235866488935, + 666015124346707, 897983460943405 +#else + 9734894, 18977602, 59635230, 24415696, 2060391, 11313496, + 48682835, 9924398, 20194861, 13380996 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1717263794012298, 1059601762860786, 1837819172257618, + 1054130665797229, 680893204263559 +#else + 40730762, 25589224, 44941042, 15789296, 49053522, 27385639, + 65123949, 15707770, 26342023, 10146099 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2237039662793603, 2249022333361206, 2058613546633703, + 149454094845279, 2215176649164582 +#else + 41091971, 33334488, 21339190, 33513044, 19745255, 30675732, + 37471583, 2227039, 21612326, 33008704 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 79472182719605, 1851130257050174, 1825744808933107, + 821667333481068, 781795293511946 +#else + 54031477, 1184227, 23562814, 27583990, 46757619, 27205717, + 25764460, 12243797, 46252298, 11649657 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 755822026485370, 152464789723500, 1178207602290608, + 410307889503239, 156581253571278 +#else + 57077370, 11262625, 27384172, 2271902, 26947504, 17556661, + 39943, 6114064, 33514190, 2333242 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1418185496130297, 484520167728613, 1646737281442950, + 1401487684670265, 1349185550126961 +#else + 45675257, 21132610, 8119781, 7219913, 45278342, 24538297, + 60429113, 20883793, 24350577, 20104431 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1495380034400429, 325049476417173, 46346894893933, + 1553408840354856, 828980101835683 +#else + 62992557, 22282898, 43222677, 4843614, 37020525, 690622, + 35572776, 23147595, 8317859, 12352766 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1280337889310282, 2070832742866672, 1640940617225222, + 2098284908289951, 450929509534434 +#else + 18200138, 19078521, 34021104, 30857812, 43406342, 24451920, + 43556767, 31266881, 20712162, 6719373 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 407703353998781, 126572141483652, 286039827513621, + 1999255076709338, 2030511179441770 +#else + 26656189, 6075253, 59250308, 1886071, 38764821, 4262325, + 11117530, 29791222, 26224234, 30256974 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1254958221100483, 1153235960999843, 942907704968834, + 637105404087392, 1149293270147267 +#else + 49939907, 18700334, 63713187, 17184554, 47154818, 14050419, + 21728352, 9493610, 18620611, 17125804 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 894249020470196, 400291701616810, 406878712230981, + 1599128793487393, 1145868722604026 +#else + 53785524, 13325348, 11432106, 5964811, 18609221, 6062965, + 61839393, 23828875, 36407290, 17074774 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1497955250203334, 110116344653260, 1128535642171976, + 1900106496009660, 129792717460909 +#else + 43248326, 22321272, 26961356, 1640861, 34695752, 16816491, + 12248508, 28313793, 13735341, 1934062 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 452487513298665, 1352120549024569, 1173495883910956, + 1999111705922009, 367328130454226 +#else + 25089769, 6742589, 17081145, 20148166, 21909292, 17486451, + 51972569, 29789085, 45830866, 5473615 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1717539401269642, 1475188995688487, 891921989653942, + 836824441505699, 1885988485608364 +#else + 31883658, 25593331, 1083431, 21982029, 22828470, 13290673, + 59983779, 12469655, 29111212, 28103418 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1241784121422547, 187337051947583, 1118481812236193, + 428747751936362, 30358898927325 +#else + 24244947, 18504025, 40845887, 2791539, 52111265, 16666677, + 24367466, 6388839, 56813277, 452382 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022432361201842, 1088816090685051, 1977843398539868, + 1854834215890724, 564238862029357 +#else + 41468082, 30136590, 5217915, 16224624, 19987036, 29472163, + 42872612, 27639183, 15766061, 8407814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 938868489100585, 1100285072929025, 1017806255688848, + 1957262154788833, 152787950560442 +#else + 46701865, 13990230, 15495425, 16395525, 5377168, 15166495, + 58191841, 29165478, 59040954, 2276717 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 867319417678923, 620471962942542, 226032203305716, + 342001443957629, 1761675818237336 +#else + 30157899, 12924066, 49396814, 9245752, 19895028, 3368142, + 43281277, 5096218, 22740376, 26251015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295072362439987, 931227904689414, 1355731432641687, + 922235735834035, 892227229410209 +#else + 2041139, 19298082, 7783686, 13876377, 41161879, 20201972, + 24051123, 13742383, 51471265, 13295221 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1680989767906154, 535362787031440, 2136691276706570, + 1942228485381244, 1267350086882274 +#else + 33338218, 25048699, 12532112, 7977527, 9106186, 31839181, + 49388668, 28941459, 62657506, 18884987 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 366018233770527, 432660629755596, 126409707644535, + 1973842949591662, 645627343442376 +#else + 47063583, 5454096, 52762316, 6447145, 28862071, 1883651, + 64639598, 29412551, 7770568, 9620597 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 535509430575217, 546885533737322, 1524675609547799, + 2138095752851703, 1260738089896827 +#else + 23208049, 7979712, 33071466, 8149229, 1758231, 22719437, + 30945527, 31860109, 33606523, 18786461 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1159906385590467, 2198530004321610, 714559485023225, + 81880727882151, 1484020820037082 +#else + 1439939, 17283952, 66028874, 32760649, 4625401, 10647766, + 62065063, 1220117, 30494170, 22113633 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1377485731340769, 2046328105512000, 1802058637158797, + 62146136768173, 1356993908853901 +#else + 62071265, 20526136, 64138304, 30492664, 15640973, 26852766, + 40369837, 926049, 65424525, 20220784 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013612215646735, 1830770575920375, 536135310219832, + 609272325580394, 270684344495013 +#else + 13908495, 30005160, 30919927, 27280607, 45587000, 7989038, + 9021034, 9078865, 3353509, 4033511 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1237542585982777, 2228682050256790, 1385281931622824, + 593183794882890, 493654978552689 +#else + 37445433, 18440821, 32259990, 33209950, 24295848, 20642309, + 23161162, 8839127, 27485041, 7356032 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47341488007760, 1891414891220257, 983894663308928, + 176161768286818, 1126261115179708 +#else + 9661008, 705443, 11980065, 28184278, 65480320, 14661172, + 60762722, 2625014, 28431036, 16782598 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1694030170963455, 502038567066200, 1691160065225467, + 949628319562187, 275110186693066 +#else + 43269631, 25243016, 41163352, 7480957, 49427195, 25200248, + 44562891, 14150564, 15970762, 4099461 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1124515748676336, 1661673816593408, 1499640319059718, + 1584929449166988, 558148594103306 +#else + 29262576, 16756590, 26350592, 24760869, 8529670, 22346382, + 13617292, 23617289, 11465738, 8317062 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1784525599998356, 1619698033617383, 2097300287550715, + 258265458103756, 1905684794832758 +#else + 41615764, 26591503, 32500199, 24135381, 44070139, 31252209, + 14898636, 3848455, 20969334, 28396916 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288941072872766, 931787902039402, 190731008859042, + 2006859954667190, 1005931482221702 +#else + 46724414, 19206718, 48772458, 13884721, 34069410, 2842113, + 45498038, 29904543, 11177094, 14989547 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1465551264822703, 152905080555927, 680334307368453, + 173227184634745, 666407097159852 +#else + 42612143, 21838415, 16959895, 2278463, 12066309, 10137771, + 13515641, 2581286, 38621356, 9930239 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2111017076203943, 1378760485794347, 1248583954016456, + 1352289194864422, 1895180776543896 +#else + 49357223, 31456605, 16544299, 20545132, 51194056, 18605350, + 18345766, 20150679, 16291480, 28240394 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 171348223915638, 662766099800389, 462338943760497, + 466917763340314, 656911292869115 +#else + 33879670, 2553287, 32678213, 9875984, 8534129, 6889387, + 57432090, 6957616, 4368891, 9788741 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 488623681976577, 866497561541722, 1708105560937768, + 1673781214218839, 1506146329818807 +#else + 16660737, 7281060, 56278106, 12911819, 20108584, 25452756, + 45386327, 24941283, 16250551, 22443329 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 160425464456957, 950394373239689, 430497123340934, + 711676555398832, 320964687779005 +#else + 47343357, 2390525, 50557833, 14161979, 1905286, 6414907, + 4689584, 10604807, 36918461, 4782746 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 988979367990485, 1359729327576302, 1301834257246029, + 294141160829308, 29348272277475 +#else + 65754325, 14736940, 59741422, 20261545, 7710541, 19398842, + 57127292, 4383044, 22546403, 437323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1434382743317910, 100082049942065, 221102347892623, + 186982837860588, 1305765053501834 +#else + 31665558, 21373968, 50922033, 1491338, 48740239, 3294681, + 27343084, 2786261, 36475274, 19457415 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2205916462268190, 499863829790820, 961960554686616, + 158062762756985, 1841471168298305 +#else + 52641566, 32870716, 33734756, 7448551, 19294360, 14334329, + 47418233, 2355318, 47824193, 27440058 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1191737341426592, 1847042034978363, 1382213545049056, + 1039952395710448, 788812858896859 +#else + 15121312, 17758270, 6377019, 27523071, 56310752, 20596586, + 18952176, 15496498, 37728731, 11754227 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346965964571152, 1291881610839830, 2142916164336056, + 786821641205979, 1571709146321039 +#else + 64471568, 20071356, 8488726, 19250536, 12728760, 31931939, + 7141595, 11724556, 22761615, 23420291 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 787164375951248, 202869205373189, 1356590421032140, + 1431233331032510, 786341368775957 +#else + 16918416, 11729663, 49025285, 3022986, 36093132, 20214772, + 38367678, 21327038, 32851221, 11717399 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 492448143532951, 304105152670757, 1761767168301056, + 233782684697790, 1981295323106089 +#else + 11166615, 7338049, 60386341, 4531519, 37640192, 26252376, + 31474878, 3483633, 65915689, 29523600 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665807507761866, 1343384868355425, 895831046139653, + 439338948736892, 1986828765695105 +#else + 66923210, 9921304, 31456609, 20017994, 55095045, 13348922, + 33142652, 6546660, 47123585, 29606055 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 756096210874553, 1721699973539149, 258765301727885, + 1390588532210645, 1212530909934781 +#else + 34648249, 11266711, 55911757, 25655328, 31703693, 3855903, + 58571733, 20721383, 36336829, 18068118 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 852891097972275, 1816988871354562, 1543772755726524, + 1174710635522444, 202129090724628 +#else + 49102387, 12709067, 3991746, 27075244, 45617340, 23004006, + 35973516, 17504552, 10928916, 3011958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1205281565824323, 22430498399418, 992947814485516, + 1392458699738672, 688441466734558 +#else + 60151107, 17960094, 31696058, 334240, 29576716, 14796075, + 36277808, 20749251, 18008030, 10258577 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1050627428414972, 1955849529137135, 2171162376368357, + 91745868298214, 447733118757826 +#else + 44660220, 15655568, 7018479, 29144429, 36794597, 32352840, + 65255398, 1367119, 25127874, 6671743 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287181461435438, 622722465530711, 880952150571872, + 741035693459198, 311565274989772 +#else + 29701166, 19180498, 56230743, 9279287, 67091296, 13127209, + 21382910, 11042292, 25838796, 4642684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1003649078149734, 545233927396469, 1849786171789880, + 1318943684880434, 280345687170552 +#else + 46678630, 14955536, 42982517, 8124618, 61739576, 27563961, + 30468146, 19653792, 18423288, 4177476 +#endif + }}, + }, + }, +}; + +#endif // OPENSSL_SMALL + +// Bi[i] = (2*i+1)*B +static const ge_precomp Bi[8] = { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288382639258501, 245678601348599, 269427782077623, + 1462984067271730, 137412439391563 +#else + 25967493, 19198397, 29566455, 3660896, 54414519, 4014786, 27544626, + 21800161, 61029707, 2047604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 62697248952638, 204681361388450, 631292143396476, 338455783676468, + 1213667448819585 +#else + 54563134, 934261, 64385954, 3049989, 66381436, 9406985, 12720692, + 5043384, 19500929, 18085054 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301289933810280, 1259582250014073, 1422107436869536, + 796239922652654, 1953934009299142 +#else + 58370664, 4489569, 9688441, 18769238, 10184608, 21191052, 29287918, + 11864899, 42594502, 29115885 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1601611775252272, 1720807796594148, 1132070835939856, + 1260455018889551, 2147779492816911 +#else + 15636272, 23865875, 24204772, 25642034, 616976, 16869170, 27787599, + 18782243, 28944399, 32004408 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 316559037616741, 2177824224946892, 1459442586438991, + 1461528397712656, 751590696113597 +#else + 16568933, 4717097, 55552716, 32452109, 15682895, 21747389, 16354576, + 21778470, 7689661, 11199574 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850748884277385, 1200145853858453, 1068094770532492, + 672251375690438, 1586055907191707 +#else + 30464137, 27578307, 55329429, 17883566, 23220364, 15915852, 7512774, + 10017326, 49359771, 23634074 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 769950342298419, 132954430919746, 844085933195555, 974092374476333, + 726076285546016 +#else + 10861363, 11473154, 27284546, 1981175, 37044515, 12577860, 32867885, + 14515107, 51670560, 10819379 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 425251763115706, 608463272472562, 442562545713235, 837766094556764, + 374555092627893 +#else + 4708026, 6336745, 20377586, 9066809, 55836755, 6594695, 41455196, + 12483687, 54440373, 5581305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1086255230780037, 274979815921559, 1960002765731872, + 929474102396301, 1190409889297339 +#else + 19563141, 16186464, 37722007, 4097518, 10237984, 29206317, 28542349, + 13850243, 43430843, 17738489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665000864555967, 2065379846933859, 370231110385876, 350988370788628, + 1233371373142985 +#else + 5153727, 9909285, 1723747, 30776558, 30523604, 5516873, 19480852, + 5230134, 43156425, 18378665 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2019367628972465, 676711900706637, 110710997811333, + 1108646842542025, 517791959672113 +#else + 36839857, 30090922, 7665485, 10083793, 28475525, 1649722, 20654025, + 16520125, 30598449, 7715701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 965130719900578, 247011430587952, 526356006571389, 91986625355052, + 2157223321444601 +#else + 28881826, 14381568, 9657904, 3680757, 46927229, 7843315, 35708204, + 1370707, 29794553, 32145132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1802695059465007, 1664899123557221, 593559490740857, + 2160434469266659, 927570450755031 +#else + 44589871, 26862249, 14201701, 24808930, 43598457, 8844725, 18474211, + 32192982, 54046167, 13821876 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1725674970513508, 1933645953859181, 1542344539275782, + 1767788773573747, 1297447965928905 +#else + 60653668, 25714560, 3374701, 28813570, 40010246, 22982724, 31655027, + 26342105, 18853321, 19333481 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1381809363726107, 1430341051343062, 2061843536018959, + 1551778050872521, 2036394857967624 +#else + 4566811, 20590564, 38133974, 21313742, 59506191, 30723862, 58594505, + 23123294, 2207752, 30344648 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1970894096313054, 528066325833207, 1619374932191227, + 2207306624415883, 1169170329061080 +#else + 41954014, 29368610, 29681143, 7868801, 60254203, 24130566, 54671499, + 32891431, 35997400, 17421995 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2070390218572616, 1458919061857835, 624171843017421, + 1055332792707765, 433987520732508 +#else + 25576264, 30851218, 7349803, 21739588, 16472781, 9300885, 3844789, + 15725684, 171356, 6466918 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 893653801273833, 1168026499324677, 1242553501121234, + 1306366254304474, 1086752658510815 +#else + 23103977, 13316479, 9739013, 17404951, 817874, 18515490, 8965338, + 19466374, 36393951, 16193876 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 213454002618221, 939771523987438, 1159882208056014, 317388369627517, + 621213314200687 +#else + 33587053, 3180712, 64714734, 14003686, 50205390, 17283591, 17238397, + 4729455, 49034351, 9256799 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1971678598905747, 338026507889165, 762398079972271, 655096486107477, + 42299032696322 +#else + 41926547, 29380300, 32336397, 5036987, 45872047, 11360616, 22616405, + 9761698, 47281666, 630304 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 177130678690680, 1754759263300204, 1864311296286618, + 1180675631479880, 1292726903152791 +#else + 53388152, 2639452, 42871404, 26147950, 9494426, 27780403, 60554312, + 17593437, 64659607, 19263131 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1913163449625248, 460779200291993, 2193883288642314, + 1008900146920800, 1721983679009502 +#else + 63957664, 28508356, 9282713, 6866145, 35201802, 32691408, 48168288, + 15033783, 25105118, 25659556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1070401523076875, 1272492007800961, 1910153608563310, + 2075579521696771, 1191169788841221 +#else + 42782475, 15950225, 35307649, 18961608, 55446126, 28463506, 1573891, + 30928545, 2198789, 17749813 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 692896803108118, 500174642072499, 2068223309439677, + 1162190621851337, 1426986007309901 +#else + 64009494, 10324966, 64867251, 7453182, 61661885, 30818928, 53296841, + 17317989, 34647629, 21263748 +#endif + }}, + }, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h.grpc_back new file mode 100644 index 0000000..c293e95 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h.grpc_back @@ -0,0 +1,7880 @@ +// 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. + +// This file is generated from +// ./make_curve25519_tables.py > curve25519_tables.h + + +static const fe d = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 929955233495203, 466365720129213, 1662059464998953, 2033849074728123, + 1442794654840575 +#else + 56195235, 13857412, 51736253, 6949390, 114729, 24766616, 60832955, 30306712, + 48412415, 21499315 +#endif +}}; + +static const fe sqrtm1 = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1718705420411056, 234908883556509, 2233514472574048, 2117202627021982, + 765476049583133 +#else + 34513072, 25610706, 9377949, 3500415, 12389472, 33281959, 41962654, + 31548777, 326685, 11406482 +#endif +}}; + +static const fe d2 = {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1859910466990425, 932731440258426, 1072319116312658, 1815898335770999, + 633789495995903 +#else + 45281625, 27714825, 36363642, 13898781, 229458, 15978800, 54557047, + 27058993, 29715967, 9444199 +#endif +}}; + +#if defined(OPENSSL_SMALL) + +// This block of code replaces the standard base-point table with a much smaller +// one. The standard table is 30,720 bytes while this one is just 960. +// +// This table contains 15 pairs of group elements, (x, y), where each field +// element is serialised with |fe_tobytes|. If |i| is the index of the group +// element then consider i+1 as a four-bit number: (iβ‚€, i₁, iβ‚‚, i₃) (where iβ‚€ +// is the most significant bit). The value of the group element is then: +// (iβ‚€Γ—2^192 + i₁×2^128 + iβ‚‚Γ—2^64 + i₃)G, where G is the generator. +static const uint8_t k25519SmallPrecomp[15 * 2 * 32] = { + 0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, 0xb2, 0xa7, 0x25, 0x95, + 0x60, 0xc7, 0x2c, 0x69, 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0, + 0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21, 0x58, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x02, 0xa2, 0xed, 0xf4, 0x8f, 0x6b, 0x0b, 0x3e, + 0xeb, 0x35, 0x1a, 0xd5, 0x7e, 0xdb, 0x78, 0x00, 0x96, 0x8a, 0xa0, 0xb4, + 0xcf, 0x60, 0x4b, 0xd4, 0xd5, 0xf9, 0x2d, 0xbf, 0x88, 0xbd, 0x22, 0x62, + 0x13, 0x53, 0xe4, 0x82, 0x57, 0xfa, 0x1e, 0x8f, 0x06, 0x2b, 0x90, 0xba, + 0x08, 0xb6, 0x10, 0x54, 0x4f, 0x7c, 0x1b, 0x26, 0xed, 0xda, 0x6b, 0xdd, + 0x25, 0xd0, 0x4e, 0xea, 0x42, 0xbb, 0x25, 0x03, 0xa2, 0xfb, 0xcc, 0x61, + 0x67, 0x06, 0x70, 0x1a, 0xc4, 0x78, 0x3a, 0xff, 0x32, 0x62, 0xdd, 0x2c, + 0xab, 0x50, 0x19, 0x3b, 0xf2, 0x9b, 0x7d, 0xb8, 0xfd, 0x4f, 0x29, 0x9c, + 0xa7, 0x91, 0xba, 0x0e, 0x46, 0x5e, 0x51, 0xfe, 0x1d, 0xbf, 0xe5, 0xe5, + 0x9b, 0x95, 0x0d, 0x67, 0xf8, 0xd1, 0xb5, 0x5a, 0xa1, 0x93, 0x2c, 0xc3, + 0xde, 0x0e, 0x97, 0x85, 0x2d, 0x7f, 0xea, 0xab, 0x3e, 0x47, 0x30, 0x18, + 0x24, 0xe8, 0xb7, 0x60, 0xae, 0x47, 0x80, 0xfc, 0xe5, 0x23, 0xe7, 0xc2, + 0xc9, 0x85, 0xe6, 0x98, 0xa0, 0x29, 0x4e, 0xe1, 0x84, 0x39, 0x2d, 0x95, + 0x2c, 0xf3, 0x45, 0x3c, 0xff, 0xaf, 0x27, 0x4c, 0x6b, 0xa6, 0xf5, 0x4b, + 0x11, 0xbd, 0xba, 0x5b, 0x9e, 0xc4, 0xa4, 0x51, 0x1e, 0xbe, 0xd0, 0x90, + 0x3a, 0x9c, 0xc2, 0x26, 0xb6, 0x1e, 0xf1, 0x95, 0x7d, 0xc8, 0x6d, 0x52, + 0xe6, 0x99, 0x2c, 0x5f, 0x9a, 0x96, 0x0c, 0x68, 0x29, 0xfd, 0xe2, 0xfb, + 0xe6, 0xbc, 0xec, 0x31, 0x08, 0xec, 0xe6, 0xb0, 0x53, 0x60, 0xc3, 0x8c, + 0xbe, 0xc1, 0xb3, 0x8a, 0x8f, 0xe4, 0x88, 0x2b, 0x55, 0xe5, 0x64, 0x6e, + 0x9b, 0xd0, 0xaf, 0x7b, 0x64, 0x2a, 0x35, 0x25, 0x10, 0x52, 0xc5, 0x9e, + 0x58, 0x11, 0x39, 0x36, 0x45, 0x51, 0xb8, 0x39, 0x93, 0xfc, 0x9d, 0x6a, + 0xbe, 0x58, 0xcb, 0xa4, 0x0f, 0x51, 0x3c, 0x38, 0x05, 0xca, 0xab, 0x43, + 0x63, 0x0e, 0xf3, 0x8b, 0x41, 0xa6, 0xf8, 0x9b, 0x53, 0x70, 0x80, 0x53, + 0x86, 0x5e, 0x8f, 0xe3, 0xc3, 0x0d, 0x18, 0xc8, 0x4b, 0x34, 0x1f, 0xd8, + 0x1d, 0xbc, 0xf2, 0x6d, 0x34, 0x3a, 0xbe, 0xdf, 0xd9, 0xf6, 0xf3, 0x89, + 0xa1, 0xe1, 0x94, 0x9f, 0x5d, 0x4c, 0x5d, 0xe9, 0xa1, 0x49, 0x92, 0xef, + 0x0e, 0x53, 0x81, 0x89, 0x58, 0x87, 0xa6, 0x37, 0xf1, 0xdd, 0x62, 0x60, + 0x63, 0x5a, 0x9d, 0x1b, 0x8c, 0xc6, 0x7d, 0x52, 0xea, 0x70, 0x09, 0x6a, + 0xe1, 0x32, 0xf3, 0x73, 0x21, 0x1f, 0x07, 0x7b, 0x7c, 0x9b, 0x49, 0xd8, + 0xc0, 0xf3, 0x25, 0x72, 0x6f, 0x9d, 0xed, 0x31, 0x67, 0x36, 0x36, 0x54, + 0x40, 0x92, 0x71, 0xe6, 0x11, 0x28, 0x11, 0xad, 0x93, 0x32, 0x85, 0x7b, + 0x3e, 0xb7, 0x3b, 0x49, 0x13, 0x1c, 0x07, 0xb0, 0x2e, 0x93, 0xaa, 0xfd, + 0xfd, 0x28, 0x47, 0x3d, 0x8d, 0xd2, 0xda, 0xc7, 0x44, 0xd6, 0x7a, 0xdb, + 0x26, 0x7d, 0x1d, 0xb8, 0xe1, 0xde, 0x9d, 0x7a, 0x7d, 0x17, 0x7e, 0x1c, + 0x37, 0x04, 0x8d, 0x2d, 0x7c, 0x5e, 0x18, 0x38, 0x1e, 0xaf, 0xc7, 0x1b, + 0x33, 0x48, 0x31, 0x00, 0x59, 0xf6, 0xf2, 0xca, 0x0f, 0x27, 0x1b, 0x63, + 0x12, 0x7e, 0x02, 0x1d, 0x49, 0xc0, 0x5d, 0x79, 0x87, 0xef, 0x5e, 0x7a, + 0x2f, 0x1f, 0x66, 0x55, 0xd8, 0x09, 0xd9, 0x61, 0x38, 0x68, 0xb0, 0x07, + 0xa3, 0xfc, 0xcc, 0x85, 0x10, 0x7f, 0x4c, 0x65, 0x65, 0xb3, 0xfa, 0xfa, + 0xa5, 0x53, 0x6f, 0xdb, 0x74, 0x4c, 0x56, 0x46, 0x03, 0xe2, 0xd5, 0x7a, + 0x29, 0x1c, 0xc6, 0x02, 0xbc, 0x59, 0xf2, 0x04, 0x75, 0x63, 0xc0, 0x84, + 0x2f, 0x60, 0x1c, 0x67, 0x76, 0xfd, 0x63, 0x86, 0xf3, 0xfa, 0xbf, 0xdc, + 0xd2, 0x2d, 0x90, 0x91, 0xbd, 0x33, 0xa9, 0xe5, 0x66, 0x0c, 0xda, 0x42, + 0x27, 0xca, 0xf4, 0x66, 0xc2, 0xec, 0x92, 0x14, 0x57, 0x06, 0x63, 0xd0, + 0x4d, 0x15, 0x06, 0xeb, 0x69, 0x58, 0x4f, 0x77, 0xc5, 0x8b, 0xc7, 0xf0, + 0x8e, 0xed, 0x64, 0xa0, 0xb3, 0x3c, 0x66, 0x71, 0xc6, 0x2d, 0xda, 0x0a, + 0x0d, 0xfe, 0x70, 0x27, 0x64, 0xf8, 0x27, 0xfa, 0xf6, 0x5f, 0x30, 0xa5, + 0x0d, 0x6c, 0xda, 0xf2, 0x62, 0x5e, 0x78, 0x47, 0xd3, 0x66, 0x00, 0x1c, + 0xfd, 0x56, 0x1f, 0x5d, 0x3f, 0x6f, 0xf4, 0x4c, 0xd8, 0xfd, 0x0e, 0x27, + 0xc9, 0x5c, 0x2b, 0xbc, 0xc0, 0xa4, 0xe7, 0x23, 0x29, 0x02, 0x9f, 0x31, + 0xd6, 0xe9, 0xd7, 0x96, 0xf4, 0xe0, 0x5e, 0x0b, 0x0e, 0x13, 0xee, 0x3c, + 0x09, 0xed, 0xf2, 0x3d, 0x76, 0x91, 0xc3, 0xa4, 0x97, 0xae, 0xd4, 0x87, + 0xd0, 0x5d, 0xf6, 0x18, 0x47, 0x1f, 0x1d, 0x67, 0xf2, 0xcf, 0x63, 0xa0, + 0x91, 0x27, 0xf8, 0x93, 0x45, 0x75, 0x23, 0x3f, 0xd1, 0xf1, 0xad, 0x23, + 0xdd, 0x64, 0x93, 0x96, 0x41, 0x70, 0x7f, 0xf7, 0xf5, 0xa9, 0x89, 0xa2, + 0x34, 0xb0, 0x8d, 0x1b, 0xae, 0x19, 0x15, 0x49, 0x58, 0x23, 0x6d, 0x87, + 0x15, 0x4f, 0x81, 0x76, 0xfb, 0x23, 0xb5, 0xea, 0xcf, 0xac, 0x54, 0x8d, + 0x4e, 0x42, 0x2f, 0xeb, 0x0f, 0x63, 0xdb, 0x68, 0x37, 0xa8, 0xcf, 0x8b, + 0xab, 0xf5, 0xa4, 0x6e, 0x96, 0x2a, 0xb2, 0xd6, 0xbe, 0x9e, 0xbd, 0x0d, + 0xb4, 0x42, 0xa9, 0xcf, 0x01, 0x83, 0x8a, 0x17, 0x47, 0x76, 0xc4, 0xc6, + 0x83, 0x04, 0x95, 0x0b, 0xfc, 0x11, 0xc9, 0x62, 0xb8, 0x0c, 0x76, 0x84, + 0xd9, 0xb9, 0x37, 0xfa, 0xfc, 0x7c, 0xc2, 0x6d, 0x58, 0x3e, 0xb3, 0x04, + 0xbb, 0x8c, 0x8f, 0x48, 0xbc, 0x91, 0x27, 0xcc, 0xf9, 0xb7, 0x22, 0x19, + 0x83, 0x2e, 0x09, 0xb5, 0x72, 0xd9, 0x54, 0x1c, 0x4d, 0xa1, 0xea, 0x0b, + 0xf1, 0xc6, 0x08, 0x72, 0x46, 0x87, 0x7a, 0x6e, 0x80, 0x56, 0x0a, 0x8a, + 0xc0, 0xdd, 0x11, 0x6b, 0xd6, 0xdd, 0x47, 0xdf, 0x10, 0xd9, 0xd8, 0xea, + 0x7c, 0xb0, 0x8f, 0x03, 0x00, 0x2e, 0xc1, 0x8f, 0x44, 0xa8, 0xd3, 0x30, + 0x06, 0x89, 0xa2, 0xf9, 0x34, 0xad, 0xdc, 0x03, 0x85, 0xed, 0x51, 0xa7, + 0x82, 0x9c, 0xe7, 0x5d, 0x52, 0x93, 0x0c, 0x32, 0x9a, 0x5b, 0xe1, 0xaa, + 0xca, 0xb8, 0x02, 0x6d, 0x3a, 0xd4, 0xb1, 0x3a, 0xf0, 0x5f, 0xbe, 0xb5, + 0x0d, 0x10, 0x6b, 0x38, 0x32, 0xac, 0x76, 0x80, 0xbd, 0xca, 0x94, 0x71, + 0x7a, 0xf2, 0xc9, 0x35, 0x2a, 0xde, 0x9f, 0x42, 0x49, 0x18, 0x01, 0xab, + 0xbc, 0xef, 0x7c, 0x64, 0x3f, 0x58, 0x3d, 0x92, 0x59, 0xdb, 0x13, 0xdb, + 0x58, 0x6e, 0x0a, 0xe0, 0xb7, 0x91, 0x4a, 0x08, 0x20, 0xd6, 0x2e, 0x3c, + 0x45, 0xc9, 0x8b, 0x17, 0x79, 0xe7, 0xc7, 0x90, 0x99, 0x3a, 0x18, 0x25, +}; + +#else + +// k25519Precomp[i][j] = (j+1)*256^i*B +static const ge_precomp k25519Precomp[32][8] = { + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288382639258501, 245678601348599, 269427782077623, + 1462984067271730, 137412439391563 +#else + 25967493, 19198397, 29566455, 3660896, 54414519, 4014786, + 27544626, 21800161, 61029707, 2047604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 62697248952638, 204681361388450, 631292143396476, + 338455783676468, 1213667448819585 +#else + 54563134, 934261, 64385954, 3049989, 66381436, 9406985, + 12720692, 5043384, 19500929, 18085054 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301289933810280, 1259582250014073, 1422107436869536, + 796239922652654, 1953934009299142 +#else + 58370664, 4489569, 9688441, 18769238, 10184608, 21191052, + 29287918, 11864899, 42594502, 29115885 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1380971894829527, 790832306631236, 2067202295274102, + 1995808275510000, 1566530869037010 +#else + 54292951, 20578084, 45527620, 11784319, 41753206, 30803714, + 55390960, 29739860, 66750418, 23343128 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 463307831301544, 432984605774163, 1610641361907204, + 750899048855000, 1894842303421586 +#else + 45405608, 6903824, 27185491, 6451973, 37531140, 24000426, + 51492312, 11189267, 40279186, 28235350 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 748439484463711, 1033211726465151, 1396005112841647, + 1611506220286469, 1972177495910992 +#else + 26966623, 11152617, 32442495, 15396054, 14353839, 20802097, + 63980037, 24013313, 51636816, 29387734 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1601611775252272, 1720807796594148, 1132070835939856, + 1260455018889551, 2147779492816911 +#else + 15636272, 23865875, 24204772, 25642034, 616976, 16869170, + 27787599, 18782243, 28944399, 32004408 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 316559037616741, 2177824224946892, 1459442586438991, + 1461528397712656, 751590696113597 +#else + 16568933, 4717097, 55552716, 32452109, 15682895, 21747389, + 16354576, 21778470, 7689661, 11199574 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850748884277385, 1200145853858453, 1068094770532492, + 672251375690438, 1586055907191707 +#else + 30464137, 27578307, 55329429, 17883566, 23220364, 15915852, + 7512774, 10017326, 49359771, 23634074 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 934282339813791, 1846903124198670, 1172395437954843, + 1007037127761661, 1830588347719256 +#else + 50071967, 13921891, 10945806, 27521001, 27105051, 17470053, + 38182653, 15006022, 3284568, 27277892 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1694390458783935, 1735906047636159, 705069562067493, + 648033061693059, 696214010414170 +#else + 23599295, 25248385, 55915199, 25867015, 13236773, 10506355, + 7464579, 9656445, 13059162, 10374397 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121406372216585, 192876649532226, 190294192191717, + 1994165897297032, 2245000007398739 +#else + 7798537, 16710257, 3033922, 2874086, 28997861, 2835604, + 32406664, 29715387, 66467155, 33453106 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 769950342298419, 132954430919746, 844085933195555, + 974092374476333, 726076285546016 +#else + 10861363, 11473154, 27284546, 1981175, 37044515, 12577860, + 32867885, 14515107, 51670560, 10819379 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 425251763115706, 608463272472562, 442562545713235, + 837766094556764, 374555092627893 +#else + 4708026, 6336745, 20377586, 9066809, 55836755, 6594695, + 41455196, 12483687, 54440373, 5581305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1086255230780037, 274979815921559, 1960002765731872, + 929474102396301, 1190409889297339 +#else + 19563141, 16186464, 37722007, 4097518, 10237984, 29206317, + 28542349, 13850243, 43430843, 17738489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1388594989461809, 316767091099457, 394298842192982, + 1230079486801005, 1440737038838979 +#else + 51736881, 20691677, 32573249, 4720197, 40672342, 5875510, + 47920237, 18329612, 57289923, 21468654 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 7380825640100, 146210432690483, 304903576448906, + 1198869323871120, 997689833219095 +#else + 58559652, 109982, 15149363, 2178705, 22900618, 4543417, 3044240, + 17864545, 1762327, 14866737 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1181317918772081, 114573476638901, 262805072233344, + 265712217171332, 294181933805782 +#else + 48909169, 17603008, 56635573, 1707277, 49922944, 3916100, + 38872452, 3959420, 27914454, 4383652 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665000864555967, 2065379846933859, 370231110385876, + 350988370788628, 1233371373142985 +#else + 5153727, 9909285, 1723747, 30776558, 30523604, 5516873, + 19480852, 5230134, 43156425, 18378665 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2019367628972465, 676711900706637, 110710997811333, + 1108646842542025, 517791959672113 +#else + 36839857, 30090922, 7665485, 10083793, 28475525, 1649722, + 20654025, 16520125, 30598449, 7715701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 965130719900578, 247011430587952, 526356006571389, + 91986625355052, 2157223321444601 +#else + 28881826, 14381568, 9657904, 3680757, 46927229, 7843315, + 35708204, 1370707, 29794553, 32145132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2068619540119183, 1966274918058806, 957728544705549, + 729906502578991, 159834893065166 +#else + 14499471, 30824833, 33917750, 29299779, 28494861, 14271267, + 30290735, 10876454, 33954766, 2381725 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2073601412052185, 31021124762708, 264500969797082, + 248034690651703, 1030252227928288 +#else + 59913433, 30899068, 52378708, 462250, 39384538, 3941371, + 60872247, 3696004, 34808032, 15351954 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 551790716293402, 1989538725166328, 801169423371717, + 2052451893578887, 678432056995012 +#else + 27431194, 8222322, 16448760, 29646437, 48401861, 11938354, + 34147463, 30583916, 29551812, 10109425 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1368953770187805, 790347636712921, 437508475667162, + 2142576377050580, 1932081720066286 +#else + 53451805, 20399000, 35825113, 11777097, 21447386, 6519384, + 64730580, 31926875, 10092782, 28790261 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 953638594433374, 1092333936795051, 1419774766716690, + 805677984380077, 859228993502513 +#else + 27939166, 14210322, 4677035, 16277044, 44144402, 21156292, + 34600109, 12005537, 49298737, 12803509 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1200766035879111, 20142053207432, 1465634435977050, + 1645256912097844, 295121984874596 +#else + 17228999, 17892808, 65875336, 300139, 65883994, 21839654, + 30364212, 24516238, 18016356, 4397660 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1735718747031557, 1248237894295956, 1204753118328107, + 976066523550493, 65943769534592 +#else + 56150021, 25864224, 4776340, 18600194, 27850027, 17952220, + 40489757, 14544524, 49631360, 982638 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1060098822528990, 1586825862073490, 212301317240126, + 1975302711403555, 666724059764335 +#else + 29253598, 15796703, 64244882, 23645547, 10057022, 3163536, + 7332899, 29434304, 46061167, 9934962 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1091990273418756, 1572899409348578, 80968014455247, + 306009358661350, 1520450739132526 +#else + 5793284, 16271923, 42977250, 23438027, 29188559, 1206517, + 52360934, 4559894, 36984942, 22656481 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1480517209436112, 1511153322193952, 1244343858991172, + 304788150493241, 369136856496443 +#else + 39464912, 22061425, 16282656, 22517939, 28414020, 18542168, + 24191033, 4541697, 53770555, 5500567 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2151330273626164, 762045184746182, 1688074332551515, + 823046109005759, 907602769079491 +#else + 12650548, 32057319, 9052870, 11355358, 49428827, 25154267, + 49678271, 12264342, 10874051, 13524335 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2047386910586836, 168470092900250, 1552838872594810, + 340951180073789, 360819374702533 +#else + 25556948, 30508442, 714650, 2510400, 23394682, 23139102, + 33119037, 5080568, 44580805, 5376627 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1982622644432056, 2014393600336956, 128909208804214, + 1617792623929191, 105294281913815 +#else + 41020600, 29543379, 50095164, 30016803, 60382070, 1920896, + 44787559, 24106988, 4535767, 1569007 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 980234343912898, 1712256739246056, 588935272190264, + 204298813091998, 841798321043288 +#else + 64853442, 14606629, 45416424, 25514613, 28430648, 8775819, + 36614302, 3044289, 31848280, 12543772 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 197561292938973, 454817274782871, 1963754960082318, + 2113372252160468, 971377527342673 +#else + 45080285, 2943892, 35251351, 6777305, 13784462, 29262229, + 39731668, 31491700, 7718481, 14474653 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 164699448829328, 3127451757672, 1199504971548753, + 1766155447043652, 1899238924683527 +#else + 2385296, 2454213, 44477544, 46602, 62670929, 17874016, 656964, + 26317767, 24316167, 28300865 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 732262946680281, 1674412764227063, 2182456405662809, + 1350894754474250, 558458873295247 +#else + 13741529, 10911568, 33875447, 24950694, 46931033, 32521134, + 33040650, 20129900, 46379407, 8321685 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2103305098582922, 1960809151316468, 715134605001343, + 1454892949167181, 40827143824949 +#else + 21060490, 31341688, 15712756, 29218333, 1639039, 10656336, + 23845965, 21679594, 57124405, 608371 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1239289043050212, 1744654158124578, 758702410031698, + 1796762995074688, 1603056663766 +#else + 53436132, 18466845, 56219170, 25997372, 61071954, 11305546, + 1123968, 26773855, 27229398, 23887 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2232056027107988, 987343914584615, 2115594492994461, + 1819598072792159, 1119305654014850 +#else + 43864724, 33260226, 55364135, 14712570, 37643165, 31524814, + 12797023, 27114124, 65475458, 16678953 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 320153677847348, 939613871605645, 641883205761567, + 1930009789398224, 329165806634126 +#else + 37608244, 4770661, 51054477, 14001337, 7830047, 9564805, + 65600720, 28759386, 49939598, 4904952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 980930490474130, 1242488692177893, 1251446316964684, + 1086618677993530, 1961430968465772 +#else + 24059538, 14617003, 19037157, 18514524, 19766092, 18648003, + 5169210, 16191880, 2128236, 29227599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 276821765317453, 1536835591188030, 1305212741412361, + 61473904210175, 2051377036983058 +#else + 50127693, 4124965, 58568254, 22900634, 30336521, 19449185, + 37302527, 916032, 60226322, 30567899 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 833449923882501, 1750270368490475, 1123347002068295, + 185477424765687, 278090826653186 +#else + 44477957, 12419371, 59974635, 26081060, 50629959, 16739174, + 285431, 2763829, 15736322, 4143876 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 794524995833413, 1849907304548286, 53348672473145, + 1272368559505217, 1147304168324779 +#else + 2379333, 11839345, 62998462, 27565766, 11274297, 794957, 212801, + 18959769, 23527083, 17096164 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1504846112759364, 1203096289004681, 562139421471418, + 274333017451844, 1284344053775441 +#else + 33431108, 22423954, 49269897, 17927531, 8909498, 8376530, + 34483524, 4087880, 51919953, 19138217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 483048732424432, 2116063063343382, 30120189902313, + 292451576741007, 1156379271702225 +#else + 1767664, 7197987, 53903638, 31531796, 54017513, 448825, 5799055, + 4357868, 62334673, 17231393 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 928372153029038, 2147692869914564, 1455665844462196, + 1986737809425946, 185207050258089 +#else + 6721966, 13833823, 43585476, 32003117, 26354292, 21691111, + 23365146, 29604700, 7390889, 2759800 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 137732961814206, 706670923917341, 1387038086865771, + 1965643813686352, 1384777115696347 +#else + 4409022, 2052381, 23373853, 10530217, 7676779, 20668478, + 21302352, 29290375, 1244379, 20634787 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 481144981981577, 2053319313589856, 2065402289827512, + 617954271490316, 1106602634668125 +#else + 62687625, 7169618, 4982368, 30596842, 30256824, 30776892, + 14086412, 9208236, 15886429, 16489664 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 696298019648792, 893299659040895, 1148636718636009, + 26734077349617, 2203955659340681 +#else + 1996056, 10375649, 14346367, 13311202, 60234729, 17116020, + 53415665, 398368, 36502409, 32841498 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 657390353372855, 998499966885562, 991893336905797, + 810470207106761, 343139804608786 +#else + 41801399, 9795879, 64331450, 14878808, 33577029, 14780362, + 13348553, 12076947, 36272402, 5113181 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 791736669492960, 934767652997115, 824656780392914, + 1759463253018643, 361530362383518 +#else + 49338080, 11797795, 31950843, 13929123, 41220562, 12288343, + 36767763, 26218045, 13847710, 5387222 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022541353055597, 2094700262587466, 1551008075025686, + 242785517418164, 695985404963562 +#else + 48526701, 30138214, 17824842, 31213466, 22744342, 23111821, + 8763060, 3617786, 47508202, 10370990 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287487199965223, 2215311941380308, 1552928390931986, + 1664859529680196, 1125004975265243 +#else + 20246567, 19185054, 22358228, 33010720, 18507282, 23140436, + 14554436, 24808340, 32232923, 16763880 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 677434665154918, 989582503122485, 1817429540898386, + 1052904935475344, 1143826298169798 +#else + 9648486, 10094563, 26416693, 14745928, 36734546, 27081810, + 11094160, 15689506, 3140038, 17044340 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 367266328308408, 318431188922404, 695629353755355, + 634085657580832, 24581612564426 +#else + 50948792, 5472694, 31895588, 4744994, 8823515, 10365685, + 39884064, 9448612, 38334410, 366294 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 773360688841258, 1815381330538070, 363773437667376, + 539629987070205, 783280434248437 +#else + 19153450, 11523972, 56012374, 27051289, 42461232, 5420646, + 28344573, 8041113, 719605, 11671788 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 180820816194166, 168937968377394, 748416242794470, + 1227281252254508, 1567587861004268 +#else + 8678006, 2694440, 60300850, 2517371, 4964326, 11152271, + 51675948, 18287915, 27000812, 23358879 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 478775558583645, 2062896624554807, 699391259285399, + 358099408427873, 1277310261461761 +#else + 51950941, 7134311, 8639287, 30739555, 59873175, 10421741, + 564065, 5336097, 6750977, 19033406 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1984740906540026, 1079164179400229, 1056021349262661, + 1659958556483663, 1088529069025527 +#else + 11836410, 29574944, 26297893, 16080799, 23455045, 15735944, + 1695823, 24735310, 8169719, 16220347 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 580736401511151, 1842931091388998, 1177201471228238, + 2075460256527244, 1301133425678027 +#else + 48993007, 8653646, 17578566, 27461813, 59083086, 17541668, + 55964556, 30926767, 61118155, 19388398 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1515728832059182, 1575261009617579, 1510246567196186, + 191078022609704, 116661716289141 +#else + 43800366, 22586119, 15213227, 23473218, 36255258, 22504427, + 27884328, 2847284, 2655861, 1738395 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295295738269652, 1714742313707026, 545583042462581, + 2034411676262552, 1513248090013606 +#else + 39571412, 19301410, 41772562, 25551651, 57738101, 8129820, + 21651608, 30315096, 48021414, 22549153 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 230710545179830, 30821514358353, 760704303452229, + 390668103790604, 573437871383156 +#else + 1533110, 3437855, 23735889, 459276, 29970501, 11335377, + 26030092, 5821408, 10478196, 8544890 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1169380107545646, 263167233745614, 2022901299054448, + 819900753251120, 2023898464874585 +#else + 32173102, 17425121, 24896206, 3921497, 22579056, 30143578, + 19270448, 12217473, 17789017, 30158437 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102254323485823, 1570832666216754, 34696906544624, + 1993213739807337, 70638552271463 +#else + 36555903, 31326030, 51530034, 23407230, 13243888, 517024, + 15479401, 29701199, 30460519, 1052596 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 894132856735058, 548675863558441, 845349339503395, + 1942269668326667, 1615682209874691 +#else + 55493970, 13323617, 32618793, 8175907, 51878691, 12596686, + 27491595, 28942073, 3179267, 24075541 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287670217537834, 1222355136884920, 1846481788678694, + 1150426571265110, 1613523400722047 +#else + 31947050, 19187781, 62468280, 18214510, 51982886, 27514722, + 52352086, 17142691, 19072639, 24043372 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 793388516527298, 1315457083650035, 1972286999342417, + 1901825953052455, 338269477222410 +#else + 11685058, 11822410, 3158003, 19601838, 33402193, 29389366, + 5977895, 28339415, 473098, 5040608 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 550201530671806, 778605267108140, 2063911101902983, + 115500557286349, 2041641272971022 +#else + 46817982, 8198641, 39698732, 11602122, 1290375, 30754672, + 28326861, 1721092, 47550222, 30422825 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 717255318455100, 519313764361315, 2080406977303708, + 541981206705521, 774328150311600 +#else + 7881532, 10687937, 7578723, 7738378, 48157852, 31000479, + 21820785, 8076149, 39240368, 11538388 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 261715221532238, 1795354330069993, 1496878026850283, + 499739720521052, 389031152673770 +#else + 47173198, 3899860, 18283497, 26752864, 51380203, 22305220, + 8754524, 7446702, 61432810, 5797015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1997217696294013, 1717306351628065, 1684313917746180, + 1644426076011410, 1857378133465451 +#else + 55813245, 29760862, 51326753, 25589858, 12708868, 25098233, + 2014098, 24503858, 64739691, 27677090 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1475434724792648, 76931896285979, 1116729029771667, + 2002544139318042, 725547833803938 +#else + 44636488, 21985690, 39426843, 1146374, 18956691, 16640559, + 1192730, 29840233, 15123618, 10811505 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022306639183567, 726296063571875, 315345054448644, + 1058733329149221, 1448201136060677 +#else + 14352079, 30134717, 48166819, 10822654, 32750596, 4699007, + 67038501, 15776355, 38222085, 21579878 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1710065158525665, 1895094923036397, 123988286168546, + 1145519900776355, 1607510767693874 +#else + 38867681, 25481956, 62129901, 28239114, 29416930, 1847569, + 46454691, 17069576, 4714546, 23953777 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 561605375422540, 1071733543815037, 131496498800990, + 1946868434569999, 828138133964203 +#else + 15200332, 8368572, 19679101, 15970074, 35236190, 1959450, + 24611599, 29010600, 55362987, 12340219 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1548495173745801, 442310529226540, 998072547000384, + 553054358385281, 644824326376171 +#else + 12876937, 23074376, 33134380, 6590940, 60801088, 14872439, + 9613953, 8241152, 15370987, 9608631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1445526537029440, 2225519789662536, 914628859347385, + 1064754194555068, 1660295614401091 +#else + 62965568, 21540023, 8446280, 33162829, 4407737, 13629032, + 59383996, 15866073, 38898243, 24740332 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1199690223111956, 24028135822341, 66638289244341, + 57626156285975, 565093967979607 +#else + 26660628, 17876777, 8393733, 358047, 59707573, 992987, 43204631, + 858696, 20571223, 8420556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 876926774220824, 554618976488214, 1012056309841565, + 839961821554611, 1414499340307677 +#else + 14620696, 13067227, 51661590, 8264466, 14106269, 15080814, + 33531827, 12516406, 45534429, 21077682 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 703047626104145, 1266841406201770, 165556500219173, + 486991595001879, 1011325891650656 +#else + 236881, 10476226, 57258, 18877408, 6472997, 2466984, 17258519, + 7256740, 8791136, 15069930 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1622861044480487, 1156394801573634, 1869132565415504, + 327103985777730, 2095342781472284 +#else + 1276391, 24182514, 22949634, 17231625, 43615824, 27852245, + 14711874, 4874229, 36445724, 31223040 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 334886927423922, 489511099221528, 129160865966726, + 1720809113143481, 619700195649254 +#else + 5855666, 4990204, 53397016, 7294283, 59304582, 1924646, + 65685689, 25642053, 34039526, 9234252 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1646545795166119, 1758370782583567, 714746174550637, + 1472693650165135, 898994790308209 +#else + 20590503, 24535444, 31529743, 26201766, 64402029, 10650547, + 31559055, 21944845, 18979185, 13396066 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 333403773039279, 295772542452938, 1693106465353610, + 912330357530760, 471235657950362 +#else + 24474287, 4968103, 22267082, 4407354, 24063882, 25229252, + 48291976, 13594781, 33514650, 7021958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1811196219982022, 1068969825533602, 289602974833439, + 1988956043611592, 863562343398367 +#else + 55541958, 26988926, 45743778, 15928891, 40950559, 4315420, + 41160136, 29637754, 45628383, 12868081 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 906282429780072, 2108672665779781, 432396390473936, + 150625823801893, 1708930497638539 +#else + 38473832, 13504660, 19988037, 31421671, 21078224, 6443208, + 45662757, 2244499, 54653067, 25465048 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 925664675702328, 21416848568684, 1831436641861340, + 601157008940113, 371818055044496 +#else + 36513336, 13793478, 61256044, 319135, 41385692, 27290532, + 33086545, 8957937, 51875216, 5540520 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1479786007267725, 1738881859066675, 68646196476567, + 2146507056100328, 1247662817535471 +#else + 55478669, 22050529, 58989363, 25911358, 2620055, 1022908, + 43398120, 31985447, 50980335, 18591624 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 52035296774456, 939969390708103, 312023458773250, + 59873523517659, 1231345905848899 +#else + 23152952, 775386, 27395463, 14006635, 57407746, 4649511, + 1689819, 892185, 55595587, 18348483 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 643355106415761, 290186807495774, 2013561737429023, + 319648069511546, 393736678496162 +#else + 9770129, 9586738, 26496094, 4324120, 1556511, 30004408, + 27453818, 4763127, 47929250, 5867133 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 129358342392716, 1932811617704777, 1176749390799681, + 398040349861790, 1170779668090425 +#else + 34343820, 1927589, 31726409, 28801137, 23962433, 17534932, + 27846558, 5931263, 37359161, 17445976 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2051980782668029, 121859921510665, 2048329875753063, + 1235229850149665, 519062146124755 +#else + 27461885, 30576896, 22380809, 1815854, 44075111, 30522493, + 7283489, 18406359, 47582163, 7734628 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1608170971973096, 415809060360428, 1350468408164766, + 2038620059057678, 1026904485989112 +#else + 59098600, 23963614, 55988460, 6196037, 29344158, 20123547, + 7585294, 30377806, 18549496, 15302069 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1837656083115103, 1510134048812070, 906263674192061, + 1821064197805734, 565375124676301 +#else + 34450527, 27383209, 59436070, 22502750, 6258877, 13504381, + 10458790, 27135971, 58236621, 8424745 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 578027192365650, 2034800251375322, 2128954087207123, + 478816193810521, 2196171989962750 +#else + 24687186, 8613276, 36441818, 30320886, 1863891, 31723888, + 19206233, 7134917, 55824382, 32725512 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1633188840273139, 852787172373708, 1548762607215796, + 1266275218902681, 1107218203325133 +#else + 11334899, 24336410, 8025292, 12707519, 17523892, 23078361, + 10243737, 18868971, 62042829, 16498836 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 462189358480054, 1784816734159228, 1611334301651368, + 1303938263943540, 707589560319424 +#else + 8911542, 6887158, 57524604, 26595841, 11145640, 24010752, + 17303924, 19430194, 6536640, 10543906 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1038829280972848, 38176604650029, 753193246598573, + 1136076426528122, 595709990562434 +#else + 38162480, 15479762, 49642029, 568875, 65611181, 11223453, + 64439674, 16928857, 39873154, 8876770 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1408451820859834, 2194984964010833, 2198361797561729, + 1061962440055713, 1645147963442934 +#else + 41365946, 20987567, 51458897, 32707824, 34082177, 32758143, + 33627041, 15824473, 66504438, 24514614 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 4701053362120, 1647641066302348, 1047553002242085, + 1923635013395977, 206970314902065 +#else + 10330056, 70051, 7957388, 24551765, 9764901, 15609756, 27698697, + 28664395, 1657393, 3084098 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1750479161778571, 1362553355169293, 1891721260220598, + 966109370862782, 1024913988299801 +#else + 10477963, 26084172, 12119565, 20303627, 29016246, 28188843, + 31280318, 14396151, 36875289, 15272408 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 212699049131723, 1117950018299775, 1873945661751056, + 1403802921984058, 130896082652698 +#else + 54820555, 3169462, 28813183, 16658753, 25116432, 27923966, + 41934906, 20918293, 42094106, 1950503 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 636808533673210, 1262201711667560, 390951380330599, + 1663420692697294, 561951321757406 +#else + 40928506, 9489186, 11053416, 18808271, 36055143, 5825629, + 58724558, 24786899, 15341278, 8373727 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 520731594438141, 1446301499955692, 273753264629267, + 1565101517999256, 1019411827004672 +#else + 28685821, 7759505, 52730348, 21551571, 35137043, 4079241, + 298136, 23321830, 64230656, 15190419 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 926527492029409, 1191853477411379, 734233225181171, + 184038887541270, 1790426146325343 +#else + 34175969, 13806335, 52771379, 17760000, 43104243, 10940927, + 8669718, 2742393, 41075551, 26679428 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1464651961852572, 1483737295721717, 1519450561335517, + 1161429831763785, 405914998179977 +#else + 65528476, 21825014, 41129205, 22109408, 49696989, 22641577, + 9291593, 17306653, 54954121, 6048604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996126634382301, 796204125879525, 127517800546509, + 344155944689303, 615279846169038 +#else + 36803549, 14843443, 1539301, 11864366, 20201677, 1900163, + 13934231, 5128323, 11213262, 9168384 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 738724080975276, 2188666632415296, 1961313708559162, + 1506545807547587, 1151301638969740 +#else + 40828332, 11007846, 19408960, 32613674, 48515898, 29225851, + 62020803, 22449281, 20470156, 17155731 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622917337413835, 1218989177089035, 1284857712846592, + 970502061709359, 351025208117090 +#else + 43972811, 9282191, 14855179, 18164354, 59746048, 19145871, + 44324911, 14461607, 14042978, 5230683 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2067814584765580, 1677855129927492, 2086109782475197, + 235286517313238, 1416314046739645 +#else + 29969548, 30812838, 50396996, 25001989, 9175485, 31085458, + 21556950, 3506042, 61174973, 21104723 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 586844262630358, 307444381952195, 458399356043426, + 602068024507062, 1028548203415243 +#else + 63964118, 8744660, 19704003, 4581278, 46678178, 6830682, + 45824694, 8971512, 38569675, 15326562 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 678489922928203, 2016657584724032, 90977383049628, + 1026831907234582, 615271492942522 +#else + 47644235, 10110287, 49846336, 30050539, 43608476, 1355668, + 51585814, 15300987, 46594746, 9168259 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301225714012278, 1094837270268560, 1202288391010439, + 644352775178361, 1647055902137983 +#else + 61755510, 4488612, 43305616, 16314346, 7780487, 17915493, + 38160505, 9601604, 33087103, 24543045 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1210746697896478, 1416608304244708, 686487477217856, + 1245131191434135, 1051238336855737 +#else + 47665694, 18041531, 46311396, 21109108, 37284416, 10229460, + 39664535, 18553900, 61111993, 15664671 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1135604073198207, 1683322080485474, 769147804376683, + 2086688130589414, 900445683120379 +#else + 23294591, 16921819, 44458082, 25083453, 27844203, 11461195, + 13099750, 31094076, 18151675, 13417686 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1971518477615628, 401909519527336, 448627091057375, + 1409486868273821, 1214789035034363 +#else + 42385932, 29377914, 35958184, 5988918, 40250079, 6685064, + 1661597, 21002991, 15271675, 18101767 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1364039144731711, 1897497433586190, 2203097701135459, + 145461396811251, 1349844460790699 +#else + 11433023, 20325767, 8239630, 28274915, 65123427, 32828713, + 48410099, 2167543, 60187563, 20114249 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1045230323257973, 818206601145807, 630513189076103, + 1672046528998132, 807204017562437 +#else + 35672693, 15575145, 30436815, 12192228, 44645511, 9395378, + 57191156, 24915434, 12215109, 12028277 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 439961968385997, 386362664488986, 1382706320807688, + 309894000125359, 2207801346498567 +#else + 14098381, 6555944, 23007258, 5757252, 51681032, 20603929, + 30123439, 4617780, 50208775, 32898803 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1229004686397588, 920643968530863, 123975893911178, + 681423993215777, 1400559197080973 +#else + 63082644, 18313596, 11893167, 13718664, 52299402, 1847384, + 51288865, 10154008, 23973261, 20869958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2003766096898049, 170074059235165, 1141124258967971, + 1485419893480973, 1573762821028725 +#else + 40577025, 29858441, 65199965, 2534300, 35238307, 17004076, + 18341389, 22134481, 32013173, 23450893 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 729905708611432, 1270323270673202, 123353058984288, + 426460209632942, 2195574535456672 +#else + 41629544, 10876442, 55337778, 18929291, 54739296, 1838103, + 21911214, 6354752, 4425632, 32716610 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1271140255321235, 2044363183174497, 52125387634689, + 1445120246694705, 942541986339084 +#else + 56675475, 18941465, 22229857, 30463385, 53917697, 776728, + 49693489, 21533969, 4725004, 14044970 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1761608437466135, 583360847526804, 1586706389685493, + 2157056599579261, 1170692369685772 +#else + 19268631, 26250011, 1555348, 8692754, 45634805, 23643767, + 6347389, 32142648, 47586572, 17444675 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 871476219910823, 1878769545097794, 2241832391238412, + 548957640601001, 690047440233174 +#else + 42244775, 12986007, 56209986, 27995847, 55796492, 33405905, + 19541417, 8180106, 9282262, 10282508 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 297194732135507, 1366347803776820, 1301185512245601, + 561849853336294, 1533554921345731 +#else + 40903763, 4428546, 58447668, 20360168, 4098401, 19389175, + 15522534, 8372215, 5542595, 22851749 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 999628998628371, 1132836708493400, 2084741674517453, + 469343353015612, 678782988708035 +#else + 56546323, 14895632, 26814552, 16880582, 49628109, 31065071, + 64326972, 6993760, 49014979, 10114654 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2189427607417022, 699801937082607, 412764402319267, + 1478091893643349, 2244675696854460 +#else + 47001790, 32625013, 31422703, 10427861, 59998115, 6150668, + 38017109, 22025285, 25953724, 33448274 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1712292055966563, 204413590624874, 1405738637332841, + 408981300829763, 861082219276721 +#else + 62874467, 25515139, 57989738, 3045999, 2101609, 20947138, + 19390019, 6094296, 63793585, 12831124 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 508561155940631, 966928475686665, 2236717801150132, + 424543858577297, 2089272956986143 +#else + 51110167, 7578151, 5310217, 14408357, 33560244, 33329692, + 31575953, 6326196, 7381791, 31132593 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 221245220129925, 1156020201681217, 491145634799213, + 542422431960839, 828100817819207 +#else + 46206085, 3296810, 24736065, 17226043, 18374253, 7318640, + 6295303, 8082724, 51746375, 12339663 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 153756971240384, 1299874139923977, 393099165260502, + 1058234455773022, 996989038681183 +#else + 27724736, 2291157, 6088201, 19369634, 1792726, 5857634, + 13848414, 15768922, 25091167, 14856294 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 559086812798481, 573177704212711, 1629737083816402, + 1399819713462595, 1646954378266038 +#else + 48242193, 8331042, 24373479, 8541013, 66406866, 24284974, + 12927299, 20858939, 44926390, 24541532 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1887963056288059, 228507035730124, 1468368348640282, + 930557653420194, 613513962454686 +#else + 55685435, 28132841, 11632844, 3405020, 30536730, 21880393, + 39848098, 13866389, 30146206, 9142070 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1224529808187553, 1577022856702685, 2206946542980843, + 625883007765001, 279930793512158 +#else + 3924129, 18246916, 53291741, 23499471, 12291819, 32886066, + 39406089, 9326383, 58871006, 4171293 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1076287717051609, 1114455570543035, 187297059715481, + 250446884292121, 1885187512550540 +#else + 51186905, 16037936, 6713787, 16606682, 45496729, 2790943, + 26396185, 3731949, 345228, 28091483 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 902497362940219, 76749815795675, 1657927525633846, + 1420238379745202, 1340321636548352 +#else + 45781307, 13448258, 25284571, 1143661, 20614966, 24705045, + 2031538, 21163201, 50855680, 19972348 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1129576631190784, 1281994010027327, 996844254743018, + 257876363489249, 1150850742055018 +#else + 31016192, 16832003, 26371391, 19103199, 62081514, 14854136, + 17477601, 3842657, 28012650, 17149012 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 628740660038789, 1943038498527841, 467786347793886, + 1093341428303375, 235413859513003 +#else + 62033029, 9368965, 58546785, 28953529, 51858910, 6970559, + 57918991, 16292056, 58241707, 3507939 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 237425418909360, 469614029179605, 1512389769174935, + 1241726368345357, 441602891065214 +#else + 29439664, 3537914, 23333589, 6997794, 49553303, 22536363, + 51899661, 18503164, 57943934, 6580395 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1736417953058555, 726531315520508, 1833335034432527, + 1629442561574747, 624418919286085 +#else + 54923003, 25874643, 16438268, 10826160, 58412047, 27318820, + 17860443, 24280586, 65013061, 9304566 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1960754663920689, 497040957888962, 1909832851283095, + 1271432136996826, 2219780368020940 +#else + 20714545, 29217521, 29088194, 7406487, 11426967, 28458727, + 14792666, 18945815, 5289420, 33077305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1537037379417136, 1358865369268262, 2130838645654099, + 828733687040705, 1999987652890901 +#else + 50443312, 22903641, 60948518, 20248671, 9192019, 31751970, + 17271489, 12349094, 26939669, 29802138 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 629042105241814, 1098854999137608, 887281544569320, + 1423102019874777, 7911258951561 +#else + 54218966, 9373457, 31595848, 16374215, 21471720, 13221525, + 39825369, 21205872, 63410057, 117886 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1811562332665373, 1501882019007673, 2213763501088999, + 359573079719636, 36370565049116 +#else + 22263325, 26994382, 3984569, 22379786, 51994855, 32987646, + 28311252, 5358056, 43789084, 541963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 218907117361280, 1209298913016966, 1944312619096112, + 1130690631451061, 1342327389191701 +#else + 16259200, 3261970, 2309254, 18019958, 50223152, 28972515, + 24134069, 16848603, 53771797, 20002236 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1369976867854704, 1396479602419169, 1765656654398856, + 2203659200586299, 998327836117241 +#else + 9378160, 20414246, 44262881, 20809167, 28198280, 26310334, + 64709179, 32837080, 690425, 14876244 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2230701885562825, 1348173180338974, 2172856128624598, + 1426538746123771, 444193481326151 +#else + 24977353, 33240048, 58884894, 20089345, 28432342, 32378079, + 54040059, 21257083, 44727879, 6618998 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 784210426627951, 918204562375674, 1284546780452985, + 1324534636134684, 1872449409642708 +#else + 65570671, 11685645, 12944378, 13682314, 42719353, 19141238, + 8044828, 19737104, 32239828, 27901670 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 319638829540294, 596282656808406, 2037902696412608, + 1557219121643918, 341938082688094 +#else + 48505798, 4762989, 66182614, 8885303, 38696384, 30367116, + 9781646, 23204373, 32779358, 5095274 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1901860206695915, 2004489122065736, 1625847061568236, + 973529743399879, 2075287685312905 +#else + 34100715, 28339925, 34843976, 29869215, 9460460, 24227009, + 42507207, 14506723, 21639561, 30924196 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1371853944110545, 1042332820512553, 1949855697918254, + 1791195775521505, 37487364849293 +#else + 50707921, 20442216, 25239337, 15531969, 3987758, 29055114, + 65819361, 26690896, 17874573, 558605 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 687200189577855, 1082536651125675, 644224940871546, + 340923196057951, 343581346747396 +#else + 53508735, 10240080, 9171883, 16131053, 46239610, 9599699, + 33499487, 5080151, 2085892, 5119761 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2082717129583892, 27829425539422, 145655066671970, + 1690527209845512, 1865260509673478 +#else + 44903700, 31034903, 50727262, 414690, 42089314, 2170429, + 30634760, 25190818, 35108870, 27794547 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1059729620568824, 2163709103470266, 1440302280256872, + 1769143160546397, 869830310425069 +#else + 60263160, 15791201, 8550074, 32241778, 29928808, 21462176, + 27534429, 26362287, 44757485, 12961481 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1609516219779025, 777277757338817, 2101121130363987, + 550762194946473, 1905542338659364 +#else + 42616785, 23983660, 10368193, 11582341, 43711571, 31309144, + 16533929, 8206996, 36914212, 28394793 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2024821921041576, 426948675450149, 595133284085473, + 471860860885970, 600321679413000 +#else + 55987368, 30172197, 2307365, 6362031, 66973409, 8868176, + 50273234, 7031274, 7589640, 8945490 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 598474602406721, 1468128276358244, 1191923149557635, + 1501376424093216, 1281662691293476 +#else + 34956097, 8917966, 6661220, 21876816, 65916803, 17761038, + 7251488, 22372252, 24099108, 19098262 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1721138489890707, 1264336102277790, 433064545421287, + 1359988423149466, 1561871293409447 +#else + 5019539, 25646962, 4244126, 18840076, 40175591, 6453164, + 47990682, 20265406, 60876967, 23273695 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 719520245587143, 393380711632345, 132350400863381, + 1543271270810729, 1819543295798660 +#else + 10853575, 10721687, 26480089, 5861829, 44113045, 1972174, + 65242217, 22996533, 63745412, 27113307 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 396397949784152, 1811354474471839, 1362679985304303, + 2117033964846756, 498041172552279 +#else + 50106456, 5906789, 221599, 26991285, 7828207, 20305514, + 24362660, 31546264, 53242455, 7421391 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1812471844975748, 1856491995543149, 126579494584102, + 1036244859282620, 1975108050082550 +#else + 8139908, 27007935, 32257645, 27663886, 30375718, 1886181, + 45933756, 15441251, 28826358, 29431403 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 650623932407995, 1137551288410575, 2125223403615539, + 1725658013221271, 2134892965117796 +#else + 6267067, 9695052, 7709135, 16950835, 34239795, 31668296, + 14795159, 25714308, 13746020, 31812384 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 522584000310195, 1241762481390450, 1743702789495384, + 2227404127826575, 1686746002148897 +#else + 28584883, 7787108, 60375922, 18503702, 22846040, 25983196, + 63926927, 33190907, 4771361, 25134474 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 427904865186312, 1703211129693455, 1585368107547509, + 1436984488744336, 761188534613978 +#else + 24949256, 6376279, 39642383, 25379823, 48462709, 23623825, + 33543568, 21412737, 3569626, 11342593 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 318101947455002, 248138407995851, 1481904195303927, + 309278454311197, 1258516760217879 +#else + 26514970, 4740088, 27912651, 3697550, 19331575, 22082093, + 6809885, 4608608, 7325975, 18753361 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1275068538599310, 513726919533379, 349926553492294, + 688428871968420, 1702400196000666 +#else + 55490446, 19000001, 42787651, 7655127, 65739590, 5214311, + 39708324, 10258389, 49462170, 25367739 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1061864036265233, 961611260325381, 321859632700838, + 1045600629959517, 1985130202504038 +#else + 11431185, 15823007, 26570245, 14329124, 18029990, 4796082, + 35662685, 15580663, 9280358, 29580745 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1558816436882417, 1962896332636523, 1337709822062152, + 1501413830776938, 294436165831932 +#else + 66948081, 23228174, 44253547, 29249434, 46247496, 19933429, + 34297962, 22372809, 51563772, 4387440 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 818359826554971, 1862173000996177, 626821592884859, + 573655738872376, 1749691246745455 +#else + 46309467, 12194511, 3937617, 27748540, 39954043, 9340369, + 42594872, 8548136, 20617071, 26072431 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1988022651432119, 1082111498586040, 1834020786104821, + 1454826876423687, 692929915223122 +#else + 66170039, 29623845, 58394552, 16124717, 24603125, 27329039, + 53333511, 21678609, 24345682, 10325460 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2146513703733331, 584788900394667, 464965657279958, + 2183973639356127, 238371159456790 +#else + 47253587, 31985546, 44906155, 8714033, 14007766, 6928528, + 16318175, 32543743, 4766742, 3552007 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1129007025494441, 2197883144413266, 265142755578169, + 971864464758890, 1983715884903702 +#else + 45357481, 16823515, 1351762, 32751011, 63099193, 3950934, + 3217514, 14481909, 10988822, 29559670 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1291366624493075, 381456718189114, 1711482489312444, + 1815233647702022, 892279782992467 +#else + 15564307, 19242862, 3101242, 5684148, 30446780, 25503076, + 12677126, 27049089, 58813011, 13296004 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 444548969917454, 1452286453853356, 2113731441506810, + 645188273895859, 810317625309512 +#else + 57666574, 6624295, 36809900, 21640754, 62437882, 31497052, + 31521203, 9614054, 37108040, 12074673 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2242724082797924, 1373354730327868, 1006520110883049, + 2147330369940688, 1151816104883620 +#else + 4771172, 33419193, 14290748, 20464580, 27992297, 14998318, + 65694928, 31997715, 29832612, 17163397 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1745720200383796, 1911723143175317, 2056329390702074, + 355227174309849, 879232794371100 +#else + 7064884, 26013258, 47946901, 28486894, 48217594, 30641695, + 25825241, 5293297, 39986204, 13101589 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 163723479936298, 115424889803150, 1156016391581227, + 1894942220753364, 1970549419986329 +#else + 64810282, 2439669, 59642254, 1719964, 39841323, 17225986, + 32512468, 28236839, 36752793, 29363474 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 681981452362484, 267208874112496, 1374683991933094, + 638600984916117, 646178654558546 +#else + 37102324, 10162315, 33928688, 3981722, 50626726, 20484387, + 14413973, 9515896, 19568978, 9628812 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 13378654854251, 106237307029567, 1944412051589651, + 1841976767925457, 230702819835573 +#else + 33053803, 199357, 15894591, 1583059, 27380243, 28973997, + 49269969, 27447592, 60817077, 3437739 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 260683893467075, 854060306077237, 913639551980112, + 4704576840123, 280254810808712 +#else + 48129987, 3884492, 19469877, 12726490, 15913552, 13614290, + 44147131, 70103, 7463304, 4176122 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 715374893080287, 1173334812210491, 1806524662079626, + 1894596008000979, 398905715033393 +#else + 39984863, 10659916, 11482427, 17484051, 12771466, 26919315, + 34389459, 28231680, 24216881, 5944158 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 500026409727661, 1596431288195371, 1420380351989370, + 985211561521489, 392444930785633 +#else + 8894125, 7450974, 64444715, 23788679, 39028346, 21165316, + 19345745, 14680796, 11632993, 5847885 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2096421546958141, 1922523000950363, 789831022876840, + 427295144688779, 320923973161730 +#else + 26942781, 31239115, 9129563, 28647825, 26024104, 11769399, + 55590027, 6367193, 57381634, 4782139 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1927770723575450, 1485792977512719, 1850996108474547, + 551696031508956, 2126047405475647 +#else + 19916442, 28726022, 44198159, 22140040, 25606323, 27581991, + 33253852, 8220911, 6358847, 31680575 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2112099158080148, 742570803909715, 6484558077432, + 1951119898618916, 93090382703416 +#else + 801428, 31472730, 16569427, 11065167, 29875704, 96627, 7908388, + 29073952, 53570360, 1387154 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 383905201636970, 859946997631870, 855623867637644, + 1017125780577795, 794250831877809 +#else + 19646058, 5720633, 55692158, 12814208, 11607948, 12749789, + 14147075, 15156355, 45242033, 11835259 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 77571826285752, 999304298101753, 487841111777762, + 1038031143212339, 339066367948762 +#else + 19299512, 1155910, 28703737, 14890794, 2925026, 7269399, + 26121523, 15467869, 40548314, 5052482 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 674994775520533, 266035846330789, 826951213393478, + 1405007746162285, 1781791018620876 +#else + 64091413, 10058205, 1980837, 3964243, 22160966, 12322533, + 60677741, 20936246, 12228556, 26550755 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1001412661522686, 348196197067298, 1666614366723946, + 888424995032760, 580747687801357 +#else + 32944382, 14922211, 44263970, 5188527, 21913450, 24834489, + 4001464, 13238564, 60994061, 8653814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1939560076207777, 1409892634407635, 552574736069277, + 383854338280405, 190706709864139 +#else + 22865569, 28901697, 27603667, 21009037, 14348957, 8234005, + 24808405, 5719875, 28483275, 2841751 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2177087163428741, 1439255351721944, 1208070840382793, + 2230616362004769, 1396886392021913 +#else + 50687877, 32441126, 66781144, 21446575, 21886281, 18001658, + 65220897, 33238773, 19932057, 20815229 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 676962063230039, 1880275537148808, 2046721011602706, + 888463247083003, 1318301552024067 +#else + 55452759, 10087520, 58243976, 28018288, 47830290, 30498519, + 3999227, 13239134, 62331395, 19644223 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1466980508178206, 617045217998949, 652303580573628, + 757303753529064, 207583137376902 +#else + 1382174, 21859713, 17266789, 9194690, 53784508, 9720080, + 20403944, 11284705, 53095046, 3093229 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1511056752906902, 105403126891277, 493434892772846, + 1091943425335976, 1802717338077427 +#else + 16650902, 22516500, 66044685, 1570628, 58779118, 7352752, + 66806440, 16271224, 43059443, 26862581 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1853982405405128, 1878664056251147, 1528011020803992, + 1019626468153565, 1128438412189035 +#else + 45197768, 27626490, 62497547, 27994275, 35364760, 22769138, + 24123613, 15193618, 45456747, 16815042 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1963939888391106, 293456433791664, 697897559513649, + 985882796904380, 796244541237972 +#else + 57172930, 29264984, 41829040, 4372841, 2087473, 10399484, + 31870908, 14690798, 17361620, 11864968 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 416770998629779, 389655552427054, 1314476859406756, + 1749382513022778, 1161905598739491 +#else + 55801235, 6210371, 13206574, 5806320, 38091172, 19587231, + 54777658, 26067830, 41530403, 17313742 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1428358296490651, 1027115282420478, 304840698058337, + 441410174026628, 1819358356278573 +#else + 14668443, 21284197, 26039038, 15305210, 25515617, 4542480, + 10453892, 6577524, 9145645, 27110552 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 204943430200135, 1554861433819175, 216426658514651, + 264149070665950, 2047097371738319 +#else + 5974855, 3053895, 57675815, 23169240, 35243739, 3225008, + 59136222, 3936127, 61456591, 30504127 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1934415182909034, 1393285083565062, 516409331772960, + 1157690734993892, 121039666594268 +#else + 30625386, 28825032, 41552902, 20761565, 46624288, 7695098, + 17097188, 17250936, 39109084, 1803631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 662035583584445, 286736105093098, 1131773000510616, + 818494214211439, 472943792054479 +#else + 63555773, 9865098, 61880298, 4272700, 61435032, 16864731, + 14911343, 12196514, 45703375, 7047411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665784778135882, 1893179629898606, 808313193813106, + 276797254706413, 1563426179676396 +#else + 20093258, 9920966, 55970670, 28210574, 13161586, 12044805, + 34252013, 4124600, 34765036, 23296865 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 945205108984232, 526277562959295, 1324180513733566, + 1666970227868664, 153547609289173 +#else + 46320040, 14084653, 53577151, 7842146, 19119038, 19731827, + 4752376, 24839792, 45429205, 2288037 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2031433403516252, 203996615228162, 170487168837083, + 981513604791390, 843573964916831 +#else + 40289628, 30270716, 29965058, 3039786, 52635099, 2540456, + 29457502, 14625692, 42289247, 12570231 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1476570093962618, 838514669399805, 1857930577281364, + 2017007352225784, 317085545220047 +#else + 66045306, 22002608, 16920317, 12494842, 1278292, 27685323, + 45948920, 30055751, 55134159, 4724942 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1461557121912842, 1600674043318359, 2157134900399597, + 1670641601940616, 127765583803283 +#else + 17960970, 21778898, 62967895, 23851901, 58232301, 32143814, + 54201480, 24894499, 37532563, 1903855 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1293543509393474, 2143624609202546, 1058361566797508, + 214097127393994, 946888515472729 +#else + 23134274, 19275300, 56426866, 31942495, 20684484, 15770816, + 54119114, 3190295, 26955097, 14109738 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 357067959932916, 1290876214345711, 521245575443703, + 1494975468601005, 800942377643885 +#else + 15308788, 5320727, 36995055, 19235554, 22902007, 7767164, + 29425325, 22276870, 31960941, 11934971 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 566116659100033, 820247422481740, 994464017954148, + 327157611686365, 92591318111744 +#else + 39713153, 8435795, 4109644, 12222639, 42480996, 14818668, + 20638173, 4875028, 10491392, 1379718 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 617256647603209, 1652107761099439, 1857213046645471, + 1085597175214970, 817432759830522 +#else + 53949449, 9197840, 3875503, 24618324, 65725151, 27674630, + 33518458, 16176658, 21432314, 12180697 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 771808161440705, 1323510426395069, 680497615846440, + 851580615547985, 1320806384849017 +#else + 55321537, 11500837, 13787581, 19721842, 44678184, 10140204, + 1465425, 12689540, 56807545, 19681548 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1219260086131915, 647169006596815, 79601124759706, + 2161724213426748, 404861897060198 +#else + 5414091, 18168391, 46101199, 9643569, 12834970, 1186149, + 64485948, 32212200, 26128230, 6032912 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1327968293887866, 1335500852943256, 1401587164534264, + 558137311952440, 1551360549268902 +#else + 40771450, 19788269, 32496024, 19900513, 17847800, 20885276, + 3604024, 8316894, 41233830, 23117073 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 417621685193956, 1429953819744454, 396157358457099, + 1940470778873255, 214000046234152 +#else + 3296484, 6223048, 24680646, 21307972, 44056843, 5903204, + 58246567, 28915267, 12376616, 3188849 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1268047918491973, 2172375426948536, 1533916099229249, + 1761293575457130, 1590622667026765 +#else + 29190469, 18895386, 27549112, 32370916, 3520065, 22857131, + 32049514, 26245319, 50999629, 23702124 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1627072914981959, 2211603081280073, 1912369601616504, + 1191770436221309, 2187309757525860 +#else + 52364359, 24245275, 735817, 32955454, 46701176, 28496527, + 25246077, 17758763, 18640740, 32593455 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1149147819689533, 378692712667677, 828475842424202, + 2218619146419342, 70688125792186 +#else + 60180029, 17123636, 10361373, 5642961, 4910474, 12345252, + 35470478, 33060001, 10530746, 1053335 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1299739417079761, 1438616663452759, 1536729078504412, + 2053896748919838, 1008421032591246 +#else + 37842897, 19367626, 53570647, 21437058, 47651804, 22899047, + 35646494, 30605446, 24018830, 15026644 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2040723824657366, 399555637875075, 632543375452995, + 872649937008051, 1235394727030233 +#else + 44516310, 30409154, 64819587, 5953842, 53668675, 9425630, + 25310643, 13003497, 64794073, 18408815 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2211311599327900, 2139787259888175, 938706616835350, + 12609661139114, 2081897930719789 +#else + 39688860, 32951110, 59064879, 31885314, 41016598, 13987818, + 39811242, 187898, 43942445, 31022696 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1324994503390450, 336982330582631, 1183998925654177, + 1091654665913274, 48727673971319 +#else + 45364466, 19743956, 1844839, 5021428, 56674465, 17642958, + 9716666, 16266922, 62038647, 726098 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1845522914617879, 1222198248335542, 150841072760134, + 1927029069940982, 1189913404498011 +#else + 29370903, 27500434, 7334070, 18212173, 9385286, 2247707, + 53446902, 28714970, 30007387, 17731091 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1079559557592645, 2215338383666441, 1903569501302605, + 49033973033940, 305703433934152 +#else + 66172485, 16086690, 23751945, 33011114, 65941325, 28365395, + 9137108, 730663, 9835848, 4555336 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 94653405416909, 1386121349852999, 1062130477891762, + 36553947479274, 833669648948846 +#else + 43732429, 1410445, 44855111, 20654817, 30867634, 15826977, + 17693930, 544696, 55123566, 12422645 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1432015813136298, 440364795295369, 1395647062821501, + 1976874522764578, 934452372723352 +#else + 31117226, 21338698, 53606025, 6561946, 57231997, 20796761, + 61990178, 29457725, 29120152, 13924425 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1296625309219774, 2068273464883862, 1858621048097805, + 1492281814208508, 2235868981918946 +#else + 49707966, 19321222, 19675798, 30819676, 56101901, 27695611, + 57724924, 22236731, 7240930, 33317044 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1490330266465570, 1858795661361448, 1436241134969763, + 294573218899647, 1208140011028933 +#else + 35747106, 22207651, 52101416, 27698213, 44655523, 21401660, + 1222335, 4389483, 3293637, 18002689 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1282462923712748, 741885683986255, 2027754642827561, + 518989529541027, 1826610009555945 +#else + 50424044, 19110186, 11038543, 11054958, 53307689, 30215898, + 42789283, 7733546, 12796905, 27218610 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1525827120027511, 723686461809551, 1597702369236987, + 244802101764964, 1502833890372311 +#else + 58349431, 22736595, 41689999, 10783768, 36493307, 23807620, + 38855524, 3647835, 3222231, 22393970 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 113622036244513, 1233740067745854, 674109952278496, + 2114345180342965, 166764512856263 +#else + 18606113, 1693100, 41660478, 18384159, 4112352, 10045021, + 23603893, 31506198, 59558087, 2484984 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2041668749310338, 2184405322203901, 1633400637611036, + 2110682505536899, 2048144390084644 +#else + 9255298, 30423235, 54952701, 32550175, 13098012, 24339566, + 16377219, 31451620, 47306788, 30519729 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 503058759232932, 760293024620937, 2027152777219493, + 666858468148475, 1539184379870952 +#else + 44379556, 7496159, 61366665, 11329248, 19991973, 30206930, + 35390715, 9936965, 37011176, 22935634 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1916168475367211, 915626432541343, 883217071712575, + 363427871374304, 1976029821251593 +#else + 21878571, 28553135, 4338335, 13643897, 64071999, 13160959, + 19708896, 5415497, 59748361, 29445138 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 678039535434506, 570587290189340, 1605302676614120, + 2147762562875701, 1706063797091704 +#else + 27736842, 10103576, 12500508, 8502413, 63695848, 23920873, + 10436917, 32004156, 43449720, 25422331 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1439489648586438, 2194580753290951, 832380563557396, + 561521973970522, 584497280718389 +#else + 19492550, 21450067, 37426887, 32701801, 63900692, 12403436, + 30066266, 8367329, 13243957, 8709688 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 187989455492609, 681223515948275, 1933493571072456, + 1872921007304880, 488162364135671 +#else + 12015105, 2801261, 28198131, 10151021, 24818120, 28811299, + 55914672, 27908697, 5150967, 7274186 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1413466089534451, 410844090765630, 1397263346404072, + 408227143123410, 1594561803147811 +#else + 2831347, 21062286, 1478974, 6122054, 23825128, 20820846, + 31097298, 6083058, 31021603, 23760822 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102170800973153, 719462588665004, 1479649438510153, + 1097529543970028, 1302363283777685 +#else + 64578913, 31324785, 445612, 10720828, 53259337, 22048494, + 43601132, 16354464, 15067285, 19406725 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 942065717847195, 1069313679352961, 2007341951411051, + 70973416446291, 1419433790163706 +#else + 7840923, 14037873, 33744001, 15934015, 66380651, 29911725, + 21403987, 1057586, 47729402, 21151211 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1146565545556377, 1661971299445212, 406681704748893, + 564452436406089, 1109109865829139 +#else + 915865, 17085158, 15608284, 24765302, 42751837, 6060029, + 49737545, 8410996, 59888403, 16527024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2214421081775077, 1165671861210569, 1890453018796184, + 3556249878661, 442116172656317 +#else + 32922597, 32997445, 20336073, 17369864, 10903704, 28169945, + 16957573, 52992, 23834301, 6588044 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 753830546620811, 1666955059895019, 1530775289309243, + 1119987029104146, 2164156153857580 +#else + 32752011, 11232950, 3381995, 24839566, 22652987, 22810329, + 17159698, 16689107, 46794284, 32248439 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 615171919212796, 1523849404854568, 854560460547503, + 2067097370290715, 1765325848586042 +#else + 62419196, 9166775, 41398568, 22707125, 11576751, 12733943, + 7924251, 30802151, 1976122, 26305405 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1094538949313667, 1796592198908825, 870221004284388, + 2025558921863561, 1699010892802384 +#else + 21251203, 16309901, 64125849, 26771309, 30810596, 12967303, + 156041, 30183180, 12331344, 25317235 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1951351290725195, 1916457206844795, 198025184438026, + 1909076887557595, 1938542290318919 +#else + 8651595, 29077400, 51023227, 28557437, 13002506, 2950805, + 29054427, 28447462, 10008135, 28886531 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1014323197538413, 869150639940606, 1756009942696599, + 1334952557375672, 1544945379082874 +#else + 31486061, 15114593, 52847614, 12951353, 14369431, 26166587, + 16347320, 19892343, 8684154, 23021480 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 764055910920305, 1603590757375439, 146805246592357, + 1843313433854297, 954279890114939 +#else + 19443825, 11385320, 24468943, 23895364, 43189605, 2187568, + 40845657, 27467510, 31316347, 14219878 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 80113526615750, 764536758732259, 1055139345100233, + 469252651759390, 617897512431515 +#else + 38514374, 1193784, 32245219, 11392485, 31092169, 15722801, + 27146014, 6992409, 29126555, 9207390 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 74497112547268, 740094153192149, 1745254631717581, + 727713886503130, 1283034364416928 +#else + 32382916, 1110093, 18477781, 11028262, 39697101, 26006320, + 62128346, 10843781, 59151264, 19118701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 525892105991110, 1723776830270342, 1476444848991936, + 573789489857760, 133864092632978 +#else + 2814918, 7836403, 27519878, 25686276, 46214848, 22000742, + 45614304, 8550129, 28346258, 1994730 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 542611720192581, 1986812262899321, 1162535242465837, + 481498966143464, 544600533583622 +#else + 47530565, 8085544, 53108345, 29605809, 2785837, 17323125, + 47591912, 7174893, 22628102, 8115180 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 64123227344372, 1239927720647794, 1360722983445904, + 222610813654661, 62429487187991 +#else + 36703732, 955510, 55975026, 18476362, 34661776, 20276352, + 41457285, 3317159, 57165847, 930271 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1793193323953132, 91096687857833, 70945970938921, + 2158587638946380, 1537042406482111 +#else + 51805164, 26720662, 28856489, 1357446, 23421993, 1057177, + 24091212, 32165462, 44343487, 22903716 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1895854577604609, 1394895708949416, 1728548428495944, + 1140864900240149, 563645333603061 +#else + 44357633, 28250434, 54201256, 20785565, 51297352, 25757378, + 52269845, 17000211, 65241845, 8398969 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 141358280486863, 91435889572504, 1087208572552643, + 1829599652522921, 1193307020643647 +#else + 35139535, 2106402, 62372504, 1362500, 12813763, 16200670, + 22981545, 27263159, 18009407, 17781660 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1611230858525381, 950720175540785, 499589887488610, + 2001656988495019, 88977313255908 +#else + 49887941, 24009210, 39324209, 14166834, 29815394, 7444469, + 29551787, 29827013, 19288548, 1325865 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1189080501479658, 2184348804772597, 1040818725742319, + 2018318290311834, 1712060030915354 +#else + 15100138, 17718680, 43184885, 32549333, 40658671, 15509407, + 12376730, 30075286, 33166106, 25511682 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 873966876953756, 1090638350350440, 1708559325189137, + 672344594801910, 1320437969700239 +#else + 20909212, 13023121, 57899112, 16251777, 61330449, 25459517, + 12412150, 10018715, 2213263, 19676059 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1508590048271766, 1131769479776094, 101550868699323, + 428297785557897, 561791648661744 +#else + 32529814, 22479743, 30361438, 16864679, 57972923, 1513225, + 22922121, 6382134, 61341936, 8371347 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 756417570499462, 237882279232602, 2136263418594016, + 1701968045454886, 703713185137472 +#else + 9923462, 11271500, 12616794, 3544722, 37110496, 31832805, + 12891686, 25361300, 40665920, 10486143 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1781187809325462, 1697624151492346, 1381393690939988, + 175194132284669, 1483054666415238 +#else + 44511638, 26541766, 8587002, 25296571, 4084308, 20584370, + 361725, 2610596, 43187334, 22099236 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2175517777364616, 708781536456029, 955668231122942, + 1967557500069555, 2021208005604118 +#else + 5408392, 32417741, 62139741, 10561667, 24145918, 14240566, + 31319731, 29318891, 19985174, 30118346 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115135966606887, 224217372950782, 915967306279222, + 593866251291540, 561747094208006 +#else + 53114407, 16616820, 14549246, 3341099, 32155958, 13648976, + 49531796, 8849296, 65030, 8370684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1443163092879439, 391875531646162, 2180847134654632, + 464538543018753, 1594098196837178 +#else + 58787919, 21504805, 31204562, 5839400, 46481576, 32497154, + 47665921, 6922163, 12743482, 23753914 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 850858855888869, 319436476624586, 327807784938441, + 740785849558761, 17128415486016 +#else + 64747493, 12678784, 28815050, 4759974, 43215817, 4884716, + 23783145, 11038569, 18800704, 255233 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2132756334090067, 536247820155645, 48907151276867, + 608473197600695, 1261689545022784 +#else + 61839187, 31780545, 13957885, 7990715, 23132995, 728773, + 13393847, 9066957, 19258688, 18800639 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1525176236978354, 974205476721062, 293436255662638, + 148269621098039, 137961998433963 +#else + 64172210, 22726896, 56676774, 14516792, 63468078, 4372540, + 35173943, 2209389, 65584811, 2055793 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121075518299410, 2071745529082111, 1265567917414828, + 1648196578317805, 496232102750820 +#else + 580882, 16705327, 5468415, 30871414, 36182444, 18858431, + 59905517, 24560042, 37087844, 7394434 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 122321229299801, 1022922077493685, 2001275453369484, + 2017441881607947, 993205880778002 +#else + 23838809, 1822728, 51370421, 15242726, 8318092, 29821328, + 45436683, 30062226, 62287122, 14799920 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 654925550560074, 1168810995576858, 575655959430926, + 905758704861388, 496774564663534 +#else + 13345610, 9759151, 3371034, 17416641, 16353038, 8577942, + 31129804, 13496856, 58052846, 7402517 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1954109525779738, 2117022646152485, 338102630417180, + 1194140505732026, 107881734943492 +#else + 2286874, 29118501, 47066405, 31546095, 53412636, 5038121, + 11006906, 17794080, 8205060, 1607563 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1714785840001267, 2036500018681589, 1876380234251966, + 2056717182974196, 1645855254384642 +#else + 14414067, 25552300, 3331829, 30346215, 22249150, 27960244, + 18364660, 30647474, 30019586, 24525154 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 106431476499341, 62482972120563, 1513446655109411, + 807258751769522, 538491469114 +#else + 39420813, 1585952, 56333811, 931068, 37988643, 22552112, + 52698034, 12029092, 9944378, 8024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2002850762893643, 1243624520538135, 1486040410574605, + 2184752338181213, 378495998083531 +#else + 4368715, 29844802, 29874199, 18531449, 46878477, 22143727, + 50994269, 32555346, 58966475, 5640029 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 922510868424903, 1089502620807680, 402544072617374, + 1131446598479839, 1290278588136533 +#else + 10299591, 13746483, 11661824, 16234854, 7630238, 5998374, + 9809887, 16859868, 15219797, 19226649 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1867998812076769, 715425053580701, 39968586461416, + 2173068014586163, 653822651801304 +#else + 27425505, 27835351, 3055005, 10660664, 23458024, 595578, + 51710259, 32381236, 48766680, 9742716 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 162892278589453, 182585796682149, 75093073137630, + 497037941226502, 133871727117371 +#else + 6744077, 2427284, 26042789, 2720740, 66260958, 1118973, + 32324614, 7406442, 12420155, 1994844 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1914596576579670, 1608999621851578, 1987629837704609, + 1519655314857977, 1819193753409464 +#else + 14012502, 28529712, 48724410, 23975962, 40623521, 29617992, + 54075385, 22644628, 24319928, 27108099 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1949315551096831, 1069003344994464, 1939165033499916, + 1548227205730856, 1933767655861407 +#else + 16412671, 29047065, 10772640, 15929391, 50040076, 28895810, + 10555944, 23070383, 37006495, 28815383 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1730519386931635, 1393284965610134, 1597143735726030, + 416032382447158, 1429665248828629 +#else + 22397363, 25786748, 57815702, 20761563, 17166286, 23799296, + 39775798, 6199365, 21880021, 21303672 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 360275475604565, 547835731063078, 215360904187529, + 596646739879007, 332709650425085 +#else + 62825557, 5368522, 35991846, 8163388, 36785801, 3209127, + 16557151, 8890729, 8840445, 4957760 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47602113726801, 1522314509708010, 437706261372925, + 814035330438027, 335930650933545 +#else + 51661137, 709326, 60189418, 22684253, 37330941, 6522331, + 45388683, 12130071, 52312361, 5005756 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1291597595523886, 1058020588994081, 402837842324045, + 1363323695882781, 2105763393033193 +#else + 64994094, 19246303, 23019041, 15765735, 41839181, 6002751, + 10183197, 20315106, 50713577, 31378319 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 109521982566564, 1715257748585139, 1112231216891516, + 2046641005101484, 134249157157013 +#else + 48083108, 1632004, 13466291, 25559332, 43468412, 16573536, + 35094956, 30497327, 22208661, 2000468 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2156991030936798, 2227544497153325, 1869050094431622, + 754875860479115, 1754242344267058 +#else + 3065054, 32141671, 41510189, 33192999, 49425798, 27851016, + 58944651, 11248526, 63417650, 26140247 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1846089562873800, 98894784984326, 1412430299204844, + 171351226625762, 1100604760929008 +#else + 10379208, 27508878, 8877318, 1473647, 37817580, 21046851, + 16690914, 2553332, 63976176, 16400288 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 84172382130492, 499710970700046, 425749630620778, + 1762872794206857, 612842602127960 +#else + 15716668, 1254266, 48636174, 7446273, 58659946, 6344163, + 45011593, 26268851, 26894936, 9132066 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 868309334532756, 1703010512741873, 1952690008738057, + 4325269926064, 2071083554962116 +#else + 24158868, 12938817, 11085297, 25376834, 39045385, 29097348, + 36532400, 64451, 60291780, 30861549 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 523094549451158, 401938899487815, 1407690589076010, + 2022387426254453, 158660516411257 +#else + 13488534, 7794716, 22236231, 5989356, 25426474, 20976224, + 2350709, 30135921, 62420857, 2364225 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 612867287630009, 448212612103814, 571629077419196, + 1466796750919376, 1728478129663858 +#else + 16335033, 9132434, 25640582, 6678888, 1725628, 8517937, + 55301840, 21856974, 15445874, 25756331 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1723848973783452, 2208822520534681, 1718748322776940, + 1974268454121942, 1194212502258141 +#else + 29004188, 25687351, 28661401, 32914020, 54314860, 25611345, + 31863254, 29418892, 66830813, 17795152 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1254114807944608, 977770684047110, 2010756238954993, + 1783628927194099, 1525962994408256 +#else + 60986784, 18687766, 38493958, 14569918, 56250865, 29962602, + 10343411, 26578142, 37280576, 22738620 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 232464058235826, 1948628555342434, 1835348780427694, + 1031609499437291, 64472106918373 +#else + 27081650, 3463984, 14099042, 29036828, 1616302, 27348828, + 29542635, 15372179, 17293797, 960709 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 767338676040683, 754089548318405, 1523192045639075, + 435746025122062, 512692508440385 +#else + 20263915, 11434237, 61343429, 11236809, 13505955, 22697330, + 50997518, 6493121, 47724353, 7639713 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1255955808701983, 1700487367990941, 1166401238800299, + 1175121994891534, 1190934801395380 +#else + 64278047, 18715199, 25403037, 25339236, 58791851, 17380732, + 18006286, 17510682, 29994676, 17746311 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 349144008168292, 1337012557669162, 1475912332999108, + 1321618454900458, 47611291904320 +#else + 9769828, 5202651, 42951466, 19923039, 39057860, 21992807, + 42495722, 19693649, 35924288, 709463 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 877519947135419, 2172838026132651, 272304391224129, + 1655143327559984, 886229406429814 +#else + 12286395, 13076066, 45333675, 32377809, 42105665, 4057651, + 35090736, 24663557, 16102006, 13205847 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 375806028254706, 214463229793940, 572906353144089, + 572168269875638, 697556386112979 +#else + 13733362, 5599946, 10557076, 3195751, 61550873, 8536969, + 41568694, 8525971, 10151379, 10394400 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1168827102357844, 823864273033637, 2071538752104697, + 788062026895924, 599578340743362 +#else + 4024660, 17416881, 22436261, 12276534, 58009849, 30868332, + 19698228, 11743039, 33806530, 8934413 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1948116082078088, 2054898304487796, 2204939184983900, + 210526805152138, 786593586607626 +#else + 51229064, 29029191, 58528116, 30620370, 14634844, 32856154, + 57659786, 3137093, 55571978, 11721157 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1915320147894736, 156481169009469, 655050471180417, + 592917090415421, 2165897438660879 +#else + 17555920, 28540494, 8268605, 2331751, 44370049, 9761012, + 9319229, 8835153, 57903375, 32274386 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1726336468579724, 1119932070398949, 1929199510967666, + 33918788322959, 1836837863503150 +#else + 66647436, 25724417, 20614117, 16688288, 59594098, 28747312, + 22300303, 505429, 6108462, 27371017 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 829996854845988, 217061778005138, 1686565909803640, + 1346948817219846, 1723823550730181 +#else + 62038564, 12367916, 36445330, 3234472, 32617080, 25131790, + 29880582, 20071101, 40210373, 25686972 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 384301494966394, 687038900403062, 2211195391021739, + 254684538421383, 1245698430589680 +#else + 35133562, 5726538, 26934134, 10237677, 63935147, 32949378, + 24199303, 3795095, 7592688, 18562353 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1247567493562688, 1978182094455847, 183871474792955, + 806570235643435, 288461518067916 +#else + 21594432, 18590204, 17466407, 29477210, 32537083, 2739898, + 6407723, 12018833, 38852812, 4298411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1449077384734201, 38285445457996, 2136537659177832, + 2146493000841573, 725161151123125 +#else + 46458361, 21592935, 39872588, 570497, 3767144, 31836892, + 13891941, 31985238, 13717173, 10805743 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1201928866368855, 800415690605445, 1703146756828343, + 997278587541744, 1858284414104014 +#else + 52432215, 17910135, 15287173, 11927123, 24177847, 25378864, + 66312432, 14860608, 40169934, 27690595 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 356468809648877, 782373916933152, 1718002439402870, + 1392222252219254, 663171266061951 +#else + 12962541, 5311799, 57048096, 11658279, 18855286, 25600231, + 13286262, 20745728, 62727807, 9882021 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 759628738230460, 1012693474275852, 353780233086498, + 246080061387552, 2030378857679162 +#else + 18512060, 11319350, 46985740, 15090308, 18818594, 5271736, + 44380960, 3666878, 43141434, 30255002 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2040672435071076, 888593182036908, 1298443657189359, + 1804780278521327, 354070726137060 +#else + 60319844, 30408388, 16192428, 13241070, 15898607, 19348318, + 57023983, 26893321, 64705764, 5276064 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1894938527423184, 1463213041477277, 474410505497651, + 247294963033299, 877975941029128 +#else + 30169808, 28236784, 26306205, 21803573, 27814963, 7069267, + 7152851, 3684982, 1449224, 13082861 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 207937160991127, 12966911039119, 820997788283092, + 1010440472205286, 1701372890140810 +#else + 10342807, 3098505, 2119311, 193222, 25702612, 12233820, + 23697382, 15056736, 46092426, 25352431 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 218882774543183, 533427444716285, 1233243976733245, + 435054256891319, 1509568989549904 +#else + 33958735, 3261607, 22745853, 7948688, 19370557, 18376767, + 40936887, 6482813, 56808784, 22494330 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1888838535711826, 1052177758340622, 1213553803324135, + 169182009127332, 463374268115872 +#else + 32869458, 28145887, 25609742, 15678670, 56421095, 18083360, + 26112420, 2521008, 44444576, 6904814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 299137589460312, 1594371588983567, 868058494039073, + 257771590636681, 1805012993142921 +#else + 29506904, 4457497, 3377935, 23757988, 36598817, 12935079, + 1561737, 3841096, 38105225, 26896789 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1806842755664364, 2098896946025095, 1356630998422878, + 1458279806348064, 347755825962072 +#else + 10340844, 26924055, 48452231, 31276001, 12621150, 20215377, + 30878496, 21730062, 41524312, 5181965 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1402334161391744, 1560083671046299, 1008585416617747, + 1147797150908892, 1420416683642459 +#else + 25940096, 20896407, 17324187, 23247058, 58437395, 15029093, + 24396252, 17103510, 64786011, 21165857 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665506704253369, 273770475169863, 799236974202630, + 848328990077558, 1811448782807931 +#else + 45343161, 9916822, 65808455, 4079497, 66080518, 11909558, + 1782390, 12641087, 20603771, 26992690 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1468412523962641, 771866649897997, 1931766110147832, + 799561180078482, 524837559150077 +#else + 48226577, 21881051, 24849421, 11501709, 13161720, 28785558, + 1925522, 11914390, 4662781, 7820689 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2223212657821850, 630416247363666, 2144451165500328, + 816911130947791, 1024351058410032 +#else + 12241050, 33128450, 8132690, 9393934, 32846760, 31954812, + 29749455, 12172924, 16136752, 15264020 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1266603897524861, 156378408858100, 1275649024228779, + 447738405888420, 253186462063095 +#else + 56758909, 18873868, 58896884, 2330219, 49446315, 19008651, + 10658212, 6671822, 19012087, 3772772 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022215964509735, 136144366993649, 1800716593296582, + 1193970603800203, 871675847064218 +#else + 3753511, 30133366, 10617073, 2028709, 14841030, 26832768, + 28718731, 17791548, 20527770, 12988982 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1862751661970328, 851596246739884, 1519315554814041, + 1542798466547449, 1417975335901520 +#else + 52286360, 27757162, 63400876, 12689772, 66209881, 22639565, + 42925817, 22989488, 3299664, 21129479 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1228168094547481, 334133883362894, 587567568420081, + 433612590281181, 603390400373205 +#else + 50331161, 18301130, 57466446, 4978982, 3308785, 8755439, + 6943197, 6461331, 41525717, 8991217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 121893973206505, 1843345804916664, 1703118377384911, + 497810164760654, 101150811654673 +#else + 49882601, 1816361, 65435576, 27467992, 31783887, 25378441, + 34160718, 7417949, 36866577, 1507264 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 458346255946468, 290909935619344, 1452768413850679, + 550922875254215, 1537286854336538 +#else + 29692644, 6829891, 56610064, 4334895, 20945975, 21647936, + 38221255, 8209390, 14606362, 22907359 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 584322311184395, 380661238802118, 114839394528060, + 655082270500073, 2111856026034852 +#else + 63627275, 8707080, 32188102, 5672294, 22096700, 1711240, + 34088169, 9761486, 4170404, 31469107 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996965581008991, 2148998626477022, 1012273164934654, + 1073876063914522, 1688031788934939 +#else + 55521375, 14855944, 62981086, 32022574, 40459774, 15084045, + 22186522, 16002000, 52832027, 25153633 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 923487018849600, 2085106799623355, 528082801620136, + 1606206360876188, 735907091712524 +#else + 62297408, 13761028, 35404987, 31070512, 63796392, 7869046, + 59995292, 23934339, 13240844, 10965870 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1697697887804317, 1335343703828273, 831288615207040, + 949416685250051, 288760277392022 +#else + 59366301, 25297669, 52340529, 19898171, 43876480, 12387165, + 4498947, 14147411, 29514390, 4302863 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1419122478109648, 1325574567803701, 602393874111094, + 2107893372601700, 1314159682671307 +#else + 53695440, 21146572, 20757301, 19752600, 14785142, 8976368, + 62047588, 31410058, 17846987, 19582505 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2201150872731804, 2180241023425241, 97663456423163, + 1633405770247824, 848945042443986 +#else + 64864412, 32799703, 62511833, 32488122, 60861691, 1455298, + 45461136, 24339642, 61886162, 12650266 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1173339555550611, 818605084277583, 47521504364289, + 924108720564965, 735423405754506 +#else + 57202067, 17484121, 21134159, 12198166, 40044289, 708125, + 387813, 13770293, 47974538, 10958662 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 830104860549448, 1886653193241086, 1600929509383773, + 1475051275443631, 286679780900937 +#else + 22470984, 12369526, 23446014, 28113323, 45588061, 23855708, + 55336367, 21979976, 42025033, 4271861 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1577111294832995, 1030899169768747, 144900916293530, + 1964672592979567, 568390100955250 +#else + 41939299, 23500789, 47199531, 15361594, 61124506, 2159191, + 75375, 29275903, 34582642, 8469672 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 278388655910247, 487143369099838, 927762205508727, + 181017540174210, 1616886700741287 +#else + 15854951, 4148314, 58214974, 7259001, 11666551, 13824734, + 36577666, 2697371, 24154791, 24093489 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1191033906638969, 940823957346562, 1606870843663445, + 861684761499847, 658674867251089 +#else + 15446137, 17747788, 29759746, 14019369, 30811221, 23944241, + 35526855, 12840103, 24913809, 9815020 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1875032594195546, 1427106132796197, 724736390962158, + 901860512044740, 635268497268760 +#else + 62399578, 27940162, 35267365, 21265538, 52665326, 10799413, + 58005188, 13438768, 18735128, 9466238 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622869792298357, 1903919278950367, 1922588621661629, + 1520574711600434, 1087100760174640 +#else + 11933045, 9281483, 5081055, 28370608, 64480701, 28648802, + 59381042, 22658328, 44380208, 16199063 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 25465949416618, 1693639527318811, 1526153382657203, + 125943137857169, 145276964043999 +#else + 14576810, 379472, 40322331, 25237195, 37682355, 22741457, + 67006097, 1876698, 30801119, 2164795 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 214739857969358, 920212862967915, 1939901550972269, + 1211862791775221, 85097515720120 +#else + 15995086, 3199873, 13672555, 13712240, 47730029, 28906785, + 54027253, 18058162, 53616056, 1268051 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2006245852772938, 734762734836159, 254642929763427, + 1406213292755966, 239303749517686 +#else + 56818250, 29895392, 63822271, 10948817, 23037027, 3794475, + 63638526, 20954210, 50053494, 3565903 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1619678837192149, 1919424032779215, 1357391272956794, + 1525634040073113, 1310226789796241 +#else + 29210069, 24135095, 61189071, 28601646, 10834810, 20226706, + 50596761, 22733718, 39946641, 19523900 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1040763709762123, 1704449869235352, 605263070456329, + 1998838089036355, 1312142911487502 +#else + 53946955, 15508587, 16663704, 25398282, 38758921, 9019122, + 37925443, 29785008, 2244110, 19552453 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1996723311435669, 1844342766567060, 985455700466044, + 1165924681400960, 311508689870129 +#else + 61955989, 29753495, 57802388, 27482848, 16243068, 14684434, + 41435776, 17373631, 13491505, 4641841 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 43173156290518, 2202883069785309, 1137787467085917, + 1733636061944606, 1394992037553852 +#else + 10813398, 643330, 47920349, 32825515, 30292061, 16954354, + 27548446, 25833190, 14476988, 20787001 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 670078326344559, 555655025059356, 471959386282438, + 2141455487356409, 849015953823125 +#else + 10292079, 9984945, 6481436, 8279905, 59857350, 7032742, + 27282937, 31910173, 39196053, 12651323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2197214573372804, 794254097241315, 1030190060513737, + 267632515541902, 2040478049202624 +#else + 35923332, 32741048, 22271203, 11835308, 10201545, 15351028, + 17099662, 3988035, 21721536, 30405492 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1812516004670529, 1609256702920783, 1706897079364493, + 258549904773295, 996051247540686 +#else + 10202177, 27008593, 35735631, 23979793, 34958221, 25434748, + 54202543, 3852693, 13216206, 14842320 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1540374301420584, 1764656898914615, 1810104162020396, + 923808779163088, 664390074196579 +#else + 51293224, 22953365, 60569911, 26295436, 60124204, 26972653, + 35608016, 13765823, 39674467, 9900183 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1323460699404750, 1262690757880991, 871777133477900, + 1060078894988977, 1712236889662886 +#else + 14465486, 19721101, 34974879, 18815558, 39665676, 12990491, + 33046193, 15796406, 60056998, 25514317 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1696163952057966, 1391710137550823, 608793846867416, + 1034391509472039, 1780770894075012 +#else + 30924398, 25274812, 6359015, 20738097, 16508376, 9071735, + 41620263, 15413634, 9524356, 26535554 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1367603834210841, 2131988646583224, 890353773628144, + 1908908219165595, 270836895252891 +#else + 12274201, 20378885, 32627640, 31769106, 6736624, 13267305, + 5237659, 28444949, 15663515, 4035784 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 597536315471731, 40375058742586, 1942256403956049, + 1185484645495932, 312666282024145 +#else + 64157555, 8903984, 17349946, 601635, 50676049, 28941875, + 53376124, 17665097, 44850385, 4659090 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1919411405316294, 1234508526402192, 1066863051997083, + 1008444703737597, 1348810787701552 +#else + 50192582, 28601458, 36715152, 18395610, 20774811, 15897498, + 5736189, 15026997, 64930608, 20098846 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2102881477513865, 1570274565945361, 1573617900503708, + 18662635732583, 2232324307922098 +#else + 58249865, 31335375, 28571665, 23398914, 66634396, 23448733, + 63307367, 278094, 23440562, 33264224 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1853931367696942, 8107973870707, 350214504129299, + 775206934582587, 1752317649166792 +#else + 10226222, 27625730, 15139955, 120818, 52241171, 5218602, + 32937275, 11551483, 50536904, 26111567 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1417148368003523, 721357181628282, 505725498207811, + 373232277872983, 261634707184480 +#else + 17932739, 21117156, 43069306, 10749059, 11316803, 7535897, + 22503767, 5561594, 63462240, 3898660 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2186733281493267, 2250694917008620, 1014829812957440, + 479998161452389, 83566193876474 +#else + 7749907, 32584865, 50769132, 33537967, 42090752, 15122142, + 65535333, 7152529, 21831162, 1245233 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1268116367301224, 560157088142809, 802626839600444, + 2210189936605713, 1129993785579988 +#else + 26958440, 18896406, 4314585, 8346991, 61431100, 11960071, + 34519569, 32934396, 36706772, 16838219 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 615183387352312, 917611676109240, 878893615973325, + 978940963313282, 938686890583575 +#else + 54942968, 9166946, 33491384, 13673479, 29787085, 13096535, + 6280834, 14587357, 44770839, 13987524 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 522024729211672, 1045059315315808, 1892245413707790, + 1907891107684253, 2059998109500714 +#else + 42758936, 7778774, 21116000, 15572597, 62275598, 28196653, + 62807965, 28429792, 59639082, 30696363 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1799679152208884, 912132775900387, 25967768040979, + 432130448590461, 274568990261996 +#else + 9681908, 26817309, 35157219, 13591837, 60225043, 386949, + 31622781, 6439245, 52527852, 4091396 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 98698809797682, 2144627600856209, 1907959298569602, + 811491302610148, 1262481774981493 +#else + 58682418, 1470726, 38999185, 31957441, 3978626, 28430809, + 47486180, 12092162, 29077877, 18812444 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1791451399743152, 1713538728337276, 118349997257490, + 1882306388849954, 158235232210248 +#else + 5269168, 26694706, 53878652, 25533716, 25932562, 1763552, + 61502754, 28048550, 47091016, 2357888 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1217809823321928, 2173947284933160, 1986927836272325, + 1388114931125539, 12686131160169 +#else + 32264008, 18146780, 61721128, 32394338, 65017541, 29607531, + 23104803, 20684524, 5727337, 189038 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1650875518872272, 1136263858253897, 1732115601395988, + 734312880662190, 1252904681142109 +#else + 14609104, 24599962, 61108297, 16931650, 52531476, 25810533, + 40363694, 10942114, 41219933, 18669734 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 372986456113865, 525430915458171, 2116279931702135, + 501422713587815, 1907002872974925 +#else + 20513481, 5557931, 51504251, 7829530, 26413943, 31535028, + 45729895, 7471780, 13913677, 28416557 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 803147181835288, 868941437997146, 316299302989663, + 943495589630550, 571224287904572 +#else + 41534488, 11967825, 29233242, 12948236, 60354399, 4713226, + 58167894, 14059179, 12878652, 8511905 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 227742695588364, 1776969298667369, 628602552821802, + 457210915378118, 2041906378111140 +#else + 41452044, 3393630, 64153449, 26478905, 64858154, 9366907, + 36885446, 6812973, 5568676, 30426776 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 815000523470260, 913085688728307, 1052060118271173, + 1345536665214223, 541623413135555 +#else + 11630004, 12144454, 2116339, 13606037, 27378885, 15676917, + 49700111, 20050058, 52713667, 8070817 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1580216071604333, 1877997504342444, 857147161260913, + 703522726778478, 2182763974211603 +#else + 27117677, 23547054, 35826092, 27984343, 1127281, 12772488, + 37262958, 10483305, 55556115, 32525717 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1870080310923419, 71988220958492, 1783225432016732, + 615915287105016, 1035570475990230 +#else + 10637467, 27866368, 5674780, 1072708, 40765276, 26572129, + 65424888, 9177852, 39615702, 15431202 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 730987750830150, 857613889540280, 1083813157271766, + 1002817255970169, 1719228484436074 +#else + 20525126, 10892566, 54366392, 12779442, 37615830, 16150074, + 38868345, 14943141, 52052074, 25618500 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 377616581647602, 1581980403078513, 804044118130621, + 2034382823044191, 643844048472185 +#else + 37084402, 5626925, 66557297, 23573344, 753597, 11981191, + 25244767, 30314666, 63752313, 9594023 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 176957326463017, 1573744060478586, 528642225008045, + 1816109618372371, 1515140189765006 +#else + 43356201, 2636869, 61944954, 23450613, 585133, 7877383, + 11345683, 27062142, 13352334, 22577348 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1888911448245718, 1387110895611080, 1924503794066429, + 1731539523700949, 2230378382645454 +#else + 65177046, 28146973, 3304648, 20669563, 17015805, 28677341, + 37325013, 25801949, 53893326, 33235227 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 443392177002051, 233793396845137, 2199506622312416, + 1011858706515937, 974676837063129 +#else + 20239939, 6607058, 6203985, 3483793, 48721888, 32775202, + 46385121, 15077869, 44358105, 14523816 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1846351103143623, 1949984838808427, 671247021915253, + 1946756846184401, 1929296930380217 +#else + 27406023, 27512775, 27423595, 29057038, 4996213, 10002360, + 38266833, 29008937, 36936121, 28748764 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 849646212452002, 1410198775302919, 73767886183695, + 1641663456615812, 762256272452411 +#else + 11374242, 12660715, 17861383, 21013599, 10935567, 1099227, + 53222788, 24462691, 39381819, 11358503 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 692017667358279, 723305578826727, 1638042139863265, + 748219305990306, 334589200523901 +#else + 54378055, 10311866, 1510375, 10778093, 64989409, 24408729, + 32676002, 11149336, 40985213, 4985767 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 22893968530686, 2235758574399251, 1661465835630252, + 925707319443452, 1203475116966621 +#else + 48012542, 341146, 60911379, 33315398, 15756972, 24757770, + 66125820, 13794113, 47694557, 17933176 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 801299035785166, 1733292596726131, 1664508947088596, + 467749120991922, 1647498584535623 +#else + 6490062, 11940286, 25495923, 25828072, 8668372, 24803116, + 3367602, 6970005, 65417799, 24549641 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 903105258014366, 427141894933047, 561187017169777, + 1884330244401954, 1914145708422219 +#else + 1656478, 13457317, 15370807, 6364910, 13605745, 8362338, + 47934242, 28078708, 50312267, 28522993 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1344191060517578, 1960935031767890, 1518838929955259, + 1781502350597190, 1564784025565682 +#else + 44835530, 20030007, 67044178, 29220208, 48503227, 22632463, + 46537798, 26546453, 67009010, 23317098 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 673723351748086, 1979969272514923, 1175287312495508, + 1187589090978666, 1881897672213940 +#else + 17747446, 10039260, 19368299, 29503841, 46478228, 17513145, + 31992682, 17696456, 37848500, 28042460 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1917185587363432, 1098342571752737, 5935801044414, + 2000527662351839, 1538640296181569 +#else + 31932008, 28568291, 47496481, 16366579, 22023614, 88450, + 11371999, 29810185, 4882241, 22927527 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2495540013192, 678856913479236, 224998292422872, + 219635787698590, 1972465269000940 +#else + 29796488, 37186, 19818052, 10115756, 55279832, 3352735, + 18551198, 3272828, 61917932, 29392022 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 271413961212179, 1353052061471651, 344711291283483, + 2014925838520662, 2006221033113941 +#else + 12501267, 4044383, 58495907, 20162046, 34678811, 5136598, + 47878486, 30024734, 330069, 29895023 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 194583029968109, 514316781467765, 829677956235672, + 1676415686873082, 810104584395840 +#else + 6384877, 2899513, 17807477, 7663917, 64749976, 12363164, + 25366522, 24980540, 66837568, 12071498 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1980510813313589, 1948645276483975, 152063780665900, + 129968026417582, 256984195613935 +#else + 58743349, 29511910, 25133447, 29037077, 60897836, 2265926, + 34339246, 1936674, 61949167, 3829362 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1860190562533102, 1936576191345085, 461100292705964, + 1811043097042830, 957486749306835 +#else + 28425966, 27718999, 66531773, 28857233, 52891308, 6870929, + 7921550, 26986645, 26333139, 14267664 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 796664815624365, 1543160838872951, 1500897791837765, + 1667315977988401, 599303877030711 +#else + 56041645, 11871230, 27385719, 22994888, 62522949, 22365119, + 10004785, 24844944, 45347639, 8930323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1151480509533204, 2136010406720455, 738796060240027, + 319298003765044, 1150614464349587 +#else + 45911060, 17158396, 25654215, 31829035, 12282011, 11008919, + 1541940, 4757911, 40617363, 17145491 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1731069268103150, 735642447616087, 1364750481334268, + 417232839982871, 927108269127661 +#else + 13537262, 25794942, 46504023, 10961926, 61186044, 20336366, + 53952279, 6217253, 51165165, 13814989 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1017222050227968, 1987716148359, 2234319589635701, + 621282683093392, 2132553131763026 +#else + 49686272, 15157789, 18705543, 29619, 24409717, 33293956, + 27361680, 9257833, 65152338, 31777517 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1567828528453324, 1017807205202360, 565295260895298, + 829541698429100, 307243822276582 +#else + 42063564, 23362465, 15366584, 15166509, 54003778, 8423555, + 37937324, 12361134, 48422886, 4578289 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 249079270936248, 1501514259790706, 947909724204848, + 944551802437487, 552658763982480 +#else + 24579768, 3711570, 1342322, 22374306, 40103728, 14124955, + 44564335, 14074918, 21964432, 8235257 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2089966982947227, 1854140343916181, 2151980759220007, + 2139781292261749, 158070445864917 +#else + 60580251, 31142934, 9442965, 27628844, 12025639, 32067012, + 64127349, 31885225, 13006805, 2355433 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1338766321464554, 1906702607371284, 1519569445519894, + 115384726262267, 1393058953390992 +#else + 50803946, 19949172, 60476436, 28412082, 16974358, 22643349, + 27202043, 1719366, 1141648, 20758196 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1364621558265400, 1512388234908357, 1926731583198686, + 2041482526432505, 920401122333774 +#else + 54244920, 20334445, 58790597, 22536340, 60298718, 28710537, + 13475065, 30420460, 32674894, 13715045 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1884844597333588, 601480070269079, 620203503079537, + 1079527400117915, 1202076693132015 +#else + 11423316, 28086373, 32344215, 8962751, 24989809, 9241752, + 53843611, 16086211, 38367983, 17912338 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 840922919763324, 727955812569642, 1303406629750194, + 522898432152867, 294161410441865 +#else + 65699196, 12530727, 60740138, 10847386, 19531186, 19422272, + 55399715, 7791793, 39862921, 4383346 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 353760790835310, 1598361541848743, 1122905698202299, + 1922533590158905, 419107700666580 +#else + 38137966, 5271446, 65842855, 23817442, 54653627, 16732598, + 62246457, 28647982, 27193556, 6245191 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 359856369838236, 180914355488683, 861726472646627, + 218807937262986, 575626773232501 +#else + 51914908, 5362277, 65324971, 2695833, 4960227, 12840725, + 23061898, 3260492, 22510453, 8577507 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 755467689082474, 909202735047934, 730078068932500, + 936309075711518, 2007798262842972 +#else + 54476394, 11257345, 34415870, 13548176, 66387860, 10879010, + 31168030, 13952092, 37537372, 29918525 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1609384177904073, 362745185608627, 1335318541768201, + 800965770436248, 547877979267412 +#else + 3877321, 23981693, 32416691, 5405324, 56104457, 19897796, + 3759768, 11935320, 5611860, 8164018 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 984339177776787, 815727786505884, 1645154585713747, + 1659074964378553, 1686601651984156 +#else + 50833043, 14667796, 15906460, 12155291, 44997715, 24514713, + 32003001, 24722143, 5773084, 25132323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1697863093781930, 599794399429786, 1104556219769607, + 830560774794755, 12812858601017 +#else + 43320746, 25300131, 1950874, 8937633, 18686727, 16459170, + 66203139, 12376319, 31632953, 190926 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1168737550514982, 897832437380552, 463140296333799, + 302564600022547, 2008360505135501 +#else + 42515238, 17415546, 58684872, 13378745, 14162407, 6901328, + 58820115, 4508563, 41767309, 29926903 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1856930662813910, 678090852002597, 1920179140755167, + 1259527833759868, 55540971895511 +#else + 8884438, 27670423, 6023973, 10104341, 60227295, 28612898, + 18722940, 18768427, 65436375, 827624 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1158643631044921, 476554103621892, 178447851439725, + 1305025542653569, 103433927680625 +#else + 34388281, 17265135, 34605316, 7101209, 13354605, 2659080, + 65308289, 19446395, 42230385, 1541285 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2176793111709008, 1576725716350391, 2009350167273523, + 2012390194631546, 2125297410909580 +#else + 2901328, 32436745, 3880375, 23495044, 49487923, 29941650, + 45306746, 29986950, 20456844, 31669399 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 825403285195098, 2144208587560784, 1925552004644643, + 1915177840006985, 1015952128947864 +#else + 27019610, 12299467, 53450576, 31951197, 54247203, 28692960, + 47568713, 28538373, 29439640, 15138866 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1807108316634472, 1534392066433717, 347342975407218, + 1153820745616376, 7375003497471 +#else + 21536104, 26928012, 34661045, 22864223, 44700786, 5175813, + 61688824, 17193268, 7779327, 109896 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 983061001799725, 431211889901241, 2201903782961093, + 817393911064341, 2214616493042167 +#else + 30279725, 14648750, 59063993, 6425557, 13639621, 32810923, + 28698389, 12180118, 23177719, 33000357 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 228567918409756, 865093958780220, 358083886450556, + 159617889659320, 1360637926292598 +#else + 26572828, 3405927, 35407164, 12890904, 47843196, 5335865, + 60615096, 2378491, 4439158, 20275085 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 234147501399755, 2229469128637390, 2175289352258889, + 1397401514549353, 1885288963089922 +#else + 44392139, 3489069, 57883598, 33221678, 18875721, 32414337, + 14819433, 20822905, 49391106, 28092994 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1111762412951562, 252849572507389, 1048714233823341, + 146111095601446, 1237505378776770 +#else + 62052362, 16566550, 15953661, 3767752, 56672365, 15627059, + 66287910, 2177224, 8550082, 18440267 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1113790697840279, 1051167139966244, 1045930658550944, + 2011366241542643, 1686166824620755 +#else + 48635543, 16596774, 66727204, 15663610, 22860960, 15585581, + 39264755, 29971692, 43848403, 25125843 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1054097349305049, 1872495070333352, 182121071220717, + 1064378906787311, 100273572924182 +#else + 34628313, 15707274, 58902952, 27902350, 29464557, 2713815, + 44383727, 15860481, 45206294, 1494192 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1306410853171605, 1627717417672447, 50983221088417, + 1109249951172250, 870201789081392 +#else + 47546773, 19467038, 41524991, 24254879, 13127841, 759709, + 21923482, 16529112, 8742704, 12967017 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 104233794644221, 1548919791188248, 2224541913267306, + 2054909377116478, 1043803389015153 +#else + 38643965, 1553204, 32536856, 23080703, 42417258, 33148257, + 58194238, 30620535, 37205105, 15553882 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 216762189468802, 707284285441622, 190678557969733, + 973969342604308, 1403009538434867 +#else + 21877890, 3230008, 9881174, 10539357, 62311749, 2841331, + 11543572, 14513274, 19375923, 20906471 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1279024291038477, 344776835218310, 273722096017199, + 1834200436811442, 634517197663804 +#else + 8832269, 19058947, 13253510, 5137575, 5037871, 4078777, + 24880818, 27331716, 2862652, 9455043 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 343805853118335, 1302216857414201, 566872543223541, + 2051138939539004, 321428858384280 +#else + 29306751, 5123106, 20245049, 19404543, 9592565, 8447059, + 65031740, 30564351, 15511448, 4789663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 470067171324852, 1618629234173951, 2000092177515639, + 7307679772789, 1117521120249968 +#else + 46429108, 7004546, 8824831, 24119455, 63063159, 29803695, + 61354101, 108892, 23513200, 16652362 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 278151578291475, 1810282338562947, 1771599529530998, + 1383659409671631, 685373414471841 +#else + 33852691, 4144781, 62632835, 26975308, 10770038, 26398890, + 60458447, 20618131, 48789665, 10212859 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 577009397403102, 1791440261786291, 2177643735971638, + 174546149911960, 1412505077782326 +#else + 2756062, 8598110, 7383731, 26694540, 22312758, 32449420, + 21179800, 2600940, 57120566, 21047965 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 893719721537457, 1201282458018197, 1522349501711173, + 58011597740583, 1130406465887139 +#else + 42463153, 13317461, 36659605, 17900503, 21365573, 22684775, + 11344423, 864440, 64609187, 16844368 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 412607348255453, 1280455764199780, 2233277987330768, + 14180080401665, 331584698417165 +#else + 40676061, 6148328, 49924452, 19080277, 18782928, 33278435, + 44547329, 211299, 2719757, 4940997 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 262483770854550, 990511055108216, 526885552771698, + 571664396646158, 354086190278723 +#else + 65784982, 3911312, 60160120, 14759764, 37081714, 7851206, + 21690126, 8518463, 26699843, 5276295 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1820352417585487, 24495617171480, 1547899057533253, + 10041836186225, 480457105094042 +#else + 53958991, 27125364, 9396248, 365013, 24703301, 23065493, + 1321585, 149635, 51656090, 7159368 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2023310314989233, 637905337525881, 2106474638900687, + 557820711084072, 1687858215057826 +#else + 9987761, 30149673, 17507961, 9505530, 9731535, 31388918, + 22356008, 8312176, 22477218, 25151047 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1144168702609745, 604444390410187, 1544541121756138, + 1925315550126027, 626401428894002 +#else + 18155857, 17049442, 19744715, 9006923, 15154154, 23015456, + 24256459, 28689437, 44560690, 9334108 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1922168257351784, 2018674099908659, 1776454117494445, + 956539191509034, 36031129147635 +#else + 2986088, 28642539, 10776627, 30080588, 10620589, 26471229, + 45695018, 14253544, 44521715, 536905 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 544644538748041, 1039872944430374, 876750409130610, + 710657711326551, 1216952687484972 +#else + 4377737, 8115836, 24567078, 15495314, 11625074, 13064599, + 7390551, 10589625, 10838060, 18134008 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 58242421545916, 2035812695641843, 2118491866122923, + 1191684463816273, 46921517454099 +#else + 47766460, 867879, 9277171, 30335973, 52677291, 31567988, + 19295825, 17757482, 6378259, 699185 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 272268252444639, 1374166457774292, 2230115177009552, + 1053149803909880, 1354288411641016 +#else + 7895007, 4057113, 60027092, 20476675, 49222032, 33231305, + 66392824, 15693154, 62063800, 20180469 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1857910905368338, 1754729879288912, 885945464109877, + 1516096106802166, 1602902393369811 +#else + 59371282, 27685029, 52542544, 26147512, 11385653, 13201616, + 31730678, 22591592, 63190227, 23885106 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1193437069800958, 901107149704790, 999672920611411, + 477584824802207, 364239578697845 +#else + 10188286, 17783598, 59772502, 13427542, 22223443, 14896287, + 30743455, 7116568, 45322357, 5427592 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 886299989548838, 1538292895758047, 1590564179491896, + 1944527126709657, 837344427345298 +#else + 696102, 13206899, 27047647, 22922350, 15285304, 23701253, + 10798489, 28975712, 19236242, 12477404 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 754558365378305, 1712186480903618, 1703656826337531, + 750310918489786, 518996040250900 +#else + 55879425, 11243795, 50054594, 25513566, 66320635, 25386464, + 63211194, 11180503, 43939348, 7733643 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1309847803895382, 1462151862813074, 211370866671570, + 1544595152703681, 1027691798954090 +#else + 17800790, 19518253, 40108434, 21787760, 23887826, 3149671, + 23466177, 23016261, 10322026, 15313801 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 803217563745370, 1884799722343599, 1357706345069218, + 2244955901722095, 730869460037413 +#else + 26246234, 11968874, 32263343, 28085704, 6830754, 20231401, + 51314159, 33452449, 42659621, 10890803 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 689299471295966, 1831210565161071, 1375187341585438, + 1106284977546171, 1893781834054269 +#else + 35743198, 10271362, 54448239, 27287163, 16690206, 20491888, + 52126651, 16484930, 25180797, 28219548 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 696351368613042, 1494385251239250, 738037133616932, + 636385507851544, 927483222611406 +#else + 66522290, 10376443, 34522450, 22268075, 19801892, 10997610, + 2276632, 9482883, 316878, 13820577 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1949114198209333, 1104419699537997, 783495707664463, + 1747473107602770, 2002634765788641 +#else + 57226037, 29044064, 64993357, 16457135, 56008783, 11674995, + 30756178, 26039378, 30696929, 29841583 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1607325776830197, 530883941415333, 1451089452727895, + 1581691157083423, 496100432831154 +#else + 32988917, 23951020, 12499365, 7910787, 56491607, 21622917, + 59766047, 23569034, 34759346, 7392472 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1068900648804224, 2006891997072550, 1134049269345549, + 1638760646180091, 2055396084625778 +#else + 58253184, 15927860, 9866406, 29905021, 64711949, 16898650, + 36699387, 24419436, 25112946, 30627788 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2222475519314561, 1870703901472013, 1884051508440561, + 1344072275216753, 1318025677799069 +#else + 64604801, 33117465, 25621773, 27875660, 15085041, 28074555, + 42223985, 20028237, 5537437, 19640113 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 155711679280656, 681100400509288, 389811735211209, + 2135723811340709, 408733211204125 +#else + 55883280, 2320284, 57524584, 10149186, 33664201, 5808647, + 52232613, 31824764, 31234589, 6090599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 7813206966729, 194444201427550, 2071405409526507, + 1065605076176312, 1645486789731291 +#else + 57475529, 116425, 26083934, 2897444, 60744427, 30866345, 609720, + 15878753, 60138459, 24519663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 16625790644959, 1647648827778410, 1579910185572704, + 436452271048548, 121070048451050 +#else + 39351007, 247743, 51914090, 24551880, 23288160, 23542496, + 43239268, 6503645, 20650474, 1804084 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1037263028552531, 568385780377829, 297953104144430, + 1558584511931211, 2238221839292471 +#else + 39519059, 15456423, 8972517, 8469608, 15640622, 4439847, + 3121995, 23224719, 27842615, 33352104 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 190565267697443, 672855706028058, 338796554369226, + 337687268493904, 853246848691734 +#else + 51801891, 2839643, 22530074, 10026331, 4602058, 5048462, + 28248656, 5031932, 55733782, 12714368 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1763863028400139, 766498079432444, 1321118624818005, + 69494294452268, 858786744165651 +#else + 20807691, 26283607, 29286140, 11421711, 39232341, 19686201, + 45881388, 1035545, 47375635, 12796919 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1292056768563024, 1456632109855638, 1100631247050184, + 1386133165675321, 1232898350193752 +#else + 12076880, 19253146, 58323862, 21705509, 42096072, 16400683, + 49517369, 20654993, 3480664, 18371617 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 366253102478259, 525676242508811, 1449610995265438, + 1183300845322183, 185960306491545 +#else + 34747315, 5457596, 28548107, 7833186, 7303070, 21600887, + 42745799, 17632556, 33734809, 2771024 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 28315355815982, 460422265558930, 1799675876678724, + 1969256312504498, 1051823843138725 +#else + 45719598, 421931, 26597266, 6860826, 22486084, 26817260, + 49971378, 29344205, 42556581, 15673396 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 156914999361983, 1606148405719949, 1665208410108430, + 317643278692271, 1383783705665320 +#else + 46924223, 2338215, 19788685, 23933476, 63107598, 24813538, + 46837679, 4733253, 3727144, 20619984 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 54684536365732, 2210010038536222, 1194984798155308, + 535239027773705, 1516355079301361 +#else + 6120100, 814863, 55314462, 32931715, 6812204, 17806661, 2019593, + 7975683, 31123697, 22595451 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1484387703771650, 198537510937949, 2186282186359116, + 617687444857508, 647477376402122 +#else + 30069250, 22119100, 30434653, 2958439, 18399564, 32578143, + 12296868, 9204260, 50676426, 9648164 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2147715541830533, 500032538445817, 646380016884826, + 352227855331122, 1488268620408052 +#else + 32705413, 32003455, 30705657, 7451065, 55303258, 9631812, + 3305266, 5248604, 41100532, 22176930 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 159386186465542, 1877626593362941, 618737197060512, + 1026674284330807, 1158121760792685 +#else + 17219846, 2375039, 35537917, 27978816, 47649184, 9219902, + 294711, 15298639, 2662509, 17257359 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1744544377739822, 1964054180355661, 1685781755873170, + 2169740670377448, 1286112621104591 +#else + 65935918, 25995736, 62742093, 29266687, 45762450, 25120105, + 32087528, 32331655, 32247247, 19164571 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 81977249784993, 1667943117713086, 1668983819634866, + 1605016835177615, 1353960708075544 +#else + 14312609, 1221556, 17395390, 24854289, 62163122, 24869796, + 38911119, 23916614, 51081240, 20175586 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1602253788689063, 439542044889886, 2220348297664483, + 657877410752869, 157451572512238 +#else + 65680039, 23875441, 57873182, 6549686, 59725795, 33085767, + 23046501, 9803137, 17597934, 2346211 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1029287186166717, 65860128430192, 525298368814832, + 1491902500801986, 1461064796385400 +#else + 18510781, 15337574, 26171504, 981392, 44867312, 7827555, + 43617730, 22231079, 3059832, 21771562 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 408216988729246, 2121095722306989, 913562102267595, + 1879708920318308, 241061448436731 +#else + 10141598, 6082907, 17829293, 31606789, 9830091, 13613136, + 41552228, 28009845, 33606651, 3592095 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1185483484383269, 1356339572588553, 584932367316448, + 102132779946470, 1792922621116791 +#else + 33114149, 17665080, 40583177, 20211034, 33076704, 8716171, + 1151462, 1521897, 66126199, 26716628 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1966196870701923, 2230044620318636, 1425982460745905, + 261167817826569, 46517743394330 +#else + 34169699, 29298616, 23947180, 33230254, 34035889, 21248794, + 50471177, 3891703, 26353178, 693168 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 107077591595359, 884959942172345, 27306869797400, + 2224911448949390, 964352058245223 +#else + 30374239, 1595580, 50224825, 13186930, 4600344, 406904, 9585294, + 33153764, 31375463, 14369965 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1730194207717538, 431790042319772, 1831515233279467, + 1372080552768581, 1074513929381760 +#else + 52738210, 25781902, 1510300, 6434173, 48324075, 27291703, + 32732229, 20445593, 17901440, 16011505 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1450880638731607, 1019861580989005, 1229729455116861, + 1174945729836143, 826083146840706 +#else + 18171223, 21619806, 54608461, 15197121, 56070717, 18324396, + 47936623, 17508055, 8764034, 12309598 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1899935429242705, 1602068751520477, 940583196550370, + 82431069053859, 1540863155745696 +#else + 5975889, 28311244, 47649501, 23872684, 55567586, 14015781, + 43443107, 1228318, 17544096, 22960650 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2136688454840028, 2099509000964294, 1690800495246475, + 1217643678575476, 828720645084218 +#else + 5811932, 31839139, 3442886, 31285122, 48741515, 25194890, + 49064820, 18144304, 61543482, 12348899 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 765548025667841, 462473984016099, 998061409979798, + 546353034089527, 2212508972466858 +#else + 35709185, 11407554, 25755363, 6891399, 63851926, 14872273, + 42259511, 8141294, 56476330, 32968952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 46575283771160, 892570971573071, 1281983193144090, + 1491520128287375, 75847005908304 +#else + 54433560, 694025, 62032719, 13300343, 14015258, 19103038, + 57410191, 22225381, 30944592, 1130208 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1801436127943107, 1734436817907890, 1268728090345068, + 167003097070711, 2233597765834956 +#else + 8247747, 26843490, 40546482, 25845122, 52706924, 18905521, + 4652151, 2488540, 23550156, 33283200 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1997562060465113, 1048700225534011, 7615603985628, + 1855310849546841, 2242557647635213 +#else + 17294297, 29765994, 7026747, 15626851, 22990044, 113481, + 2267737, 27646286, 66700045, 33416712 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1161017320376250, 492624580169043, 2169815802355237, + 976496781732542, 1770879511019629 +#else + 16091066, 17300506, 18599251, 7340678, 2137637, 32332775, + 63744702, 14550935, 3260525, 26388161 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1357044908364776, 729130645262438, 1762469072918979, + 1365633616878458, 181282906404941 +#else + 62198760, 20221544, 18550886, 10864893, 50649539, 26262835, + 44079994, 20349526, 54360141, 2701325 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1080413443139865, 1155205815510486, 1848782073549786, + 622566975152580, 124965574467971 +#else + 58534169, 16099414, 4629974, 17213908, 46322650, 27548999, + 57090500, 9276970, 11329923, 1862132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1184526762066993, 247622751762817, 692129017206356, + 820018689412496, 2188697339828085 +#else + 14763057, 17650824, 36190593, 3689866, 3511892, 10313526, + 45157776, 12219230, 58070901, 32614131 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2020536369003019, 202261491735136, 1053169669150884, + 2056531979272544, 778165514694311 +#else + 8894987, 30108338, 6150752, 3013931, 301220, 15693451, 35127648, + 30644714, 51670695, 11595569 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 237404399610207, 1308324858405118, 1229680749538400, + 720131409105291, 1958958863624906 +#else + 15214943, 3537601, 40870142, 19495559, 4418656, 18323671, + 13947275, 10730794, 53619402, 29190761 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 515583508038846, 17656978857189, 1717918437373989, + 1568052070792483, 46975803123923 +#else + 64570558, 7682792, 32759013, 263109, 37124133, 25598979, + 44776739, 23365796, 977107, 699994 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 281527309158085, 36970532401524, 866906920877543, + 2222282602952734, 1289598729589882 +#else + 54642373, 4195083, 57897332, 550903, 51543527, 12917919, + 19118110, 33114591, 36574330, 19216518 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1278207464902042, 494742455008756, 1262082121427081, + 1577236621659884, 1888786707293291 +#else + 31788442, 19046775, 4799988, 7372237, 8808585, 18806489, + 9408236, 23502657, 12493931, 28145115 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 353042527954210, 1830056151907359, 1111731275799225, + 174960955838824, 404312815582675 +#else + 41428258, 5260743, 47873055, 27269961, 63412921, 16566086, + 27218280, 2607121, 29375955, 6024730 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2064251142068628, 1666421603389706, 1419271365315441, + 468767774902855, 191535130366583 +#else + 842132, 30759739, 62345482, 24831616, 26332017, 21148791, + 11831879, 6985184, 57168503, 2854095 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1716987058588002, 1859366439773457, 1767194234188234, + 64476199777924, 1117233614485261 +#else + 62261602, 25585100, 2516241, 27706719, 9695690, 26333246, + 16512644, 960770, 12121869, 16648078 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 984292135520292, 135138246951259, 2220652137473167, + 1722843421165029, 190482558012909 +#else + 51890212, 14667095, 53772635, 2013716, 30598287, 33090295, + 35603941, 25672367, 20237805, 2838411 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 298845952651262, 1166086588952562, 1179896526238434, + 1347812759398693, 1412945390096208 +#else + 47820798, 4453151, 15298546, 17376044, 22115042, 17581828, + 12544293, 20083975, 1068880, 21054527 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143239552672925, 906436640714209, 2177000572812152, + 2075299936108548, 325186347798433 +#else + 57549981, 17035596, 33238497, 13506958, 30505848, 32439836, + 58621956, 30924378, 12521377, 4845654 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 721024854374772, 684487861263316, 1373438744094159, + 2193186935276995, 1387043709851261 +#else + 38910324, 10744107, 64150484, 10199663, 7759311, 20465832, + 3409347, 32681032, 60626557, 20668561 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 418098668140962, 715065997721283, 1471916138376055, + 2168570337288357, 937812682637044 +#else + 43547042, 6230155, 46726851, 10655313, 43068279, 21933259, + 10477733, 32314216, 63995636, 13974497 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1043584187226485, 2143395746619356, 2209558562919611, + 482427979307092, 847556718384018 +#else + 12966261, 15550616, 35069916, 31939085, 21025979, 32924988, + 5642324, 7188737, 18895762, 12629579 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1248731221520759, 1465200936117687, 540803492710140, + 52978634680892, 261434490176109 +#else + 14741879, 18607545, 22177207, 21833195, 1279740, 8058600, + 11758140, 789443, 32195181, 3895677 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1057329623869501, 620334067429122, 461700859268034, + 2012481616501857, 297268569108938 +#else + 10758205, 15755439, 62598914, 9243697, 62229442, 6879878, + 64904289, 29988312, 58126794, 4429646 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1055352180870759, 1553151421852298, 1510903185371259, + 1470458349428097, 1226259419062731 +#else + 64654951, 15725972, 46672522, 23143759, 61304955, 22514211, + 59972993, 21911536, 18047435, 18272689 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1492988790301668, 790326625573331, 1190107028409745, + 1389394752159193, 1620408196604194 +#else + 41935844, 22247266, 29759955, 11776784, 44846481, 17733976, + 10993113, 20703595, 49488162, 24145963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47000654413729, 1004754424173864, 1868044813557703, + 173236934059409, 588771199737015 +#else + 21987233, 700364, 42603816, 14972007, 59334599, 27836036, + 32155025, 2581431, 37149879, 8773374 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 30498470091663, 1082245510489825, 576771653181956, + 806509986132686, 1317634017056939 +#else + 41540495, 454462, 53896929, 16126714, 25240068, 8594567, + 20656846, 12017935, 59234475, 19634276 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 420308055751555, 1493354863316002, 165206721528088, + 1884845694919786, 2065456951573059 +#else + 6028163, 6263078, 36097058, 22252721, 66289944, 2461771, + 35267690, 28086389, 65387075, 30777706 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115636332012334, 1854340990964155, 83792697369514, + 1972177451994021, 457455116057587 +#else + 54829870, 16624276, 987579, 27631834, 32908202, 1248608, + 7719845, 29387734, 28408819, 6816612 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1698968457310898, 1435137169051090, 1083661677032510, + 938363267483709, 340103887207182 +#else + 56750770, 25316602, 19549650, 21385210, 22082622, 16147817, + 20613181, 13982702, 56769294, 5067942 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1995325341336574, 911500251774648, 164010755403692, + 855378419194762, 1573601397528842 +#else + 36602878, 29732664, 12074680, 13582412, 47230892, 2443950, + 47389578, 12746131, 5331210, 23448488 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 241719380661528, 310028521317150, 1215881323380194, + 1408214976493624, 2141142156467363 +#else + 30528792, 3601899, 65151774, 4619784, 39747042, 18118043, + 24180792, 20984038, 27679907, 31905504 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1315157046163473, 727368447885818, 1363466668108618, + 1668921439990361, 1398483384337907 +#else + 9402385, 19597367, 32834042, 10838634, 40528714, 20317236, + 26653273, 24868867, 22611443, 20839026 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 75029678299646, 1015388206460473, 1849729037055212, + 1939814616452984, 444404230394954 +#else + 22190590, 1118029, 22736441, 15130463, 36648172, 27563110, + 19189624, 28905490, 4854858, 6622139 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2053597130993710, 2024431685856332, 2233550957004860, + 2012407275509545, 872546993104440 +#else + 58798126, 30600981, 58846284, 30166382, 56707132, 33282502, + 13424425, 29987205, 26404408, 13001963 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1217269667678610, 599909351968693, 1390077048548598, + 1471879360694802, 739586172317596 +#else + 35867026, 18138731, 64114613, 8939345, 11562230, 20713762, + 41044498, 21932711, 51703708, 11020692 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1718318639380794, 1560510726633958, 904462881159922, + 1418028351780052, 94404349451937 +#else + 1866042, 25604943, 59210214, 23253421, 12483314, 13477547, + 3175636, 21130269, 28761761, 1406734 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2132502667405250, 214379346175414, 1502748313768060, + 1960071701057800, 1353971822643138 +#else + 66660290, 31776765, 13018550, 3194501, 57528444, 22392694, + 24760584, 29207344, 25577410, 20175752 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 319394212043702, 2127459436033571, 717646691535162, + 663366796076914, 318459064945314 +#else + 42818486, 4759344, 66418211, 31701615, 2066746, 10693769, + 37513074, 9884935, 57739938, 4745409 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 405989424923593, 1960452633787083, 667349034401665, + 1492674260767112, 1451061489880787 +#else + 57967561, 6049713, 47577803, 29213020, 35848065, 9944275, + 51646856, 22242579, 10931923, 21622501 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 947085906234007, 323284730494107, 1485778563977200, + 728576821512394, 901584347702286 +#else + 50547351, 14112679, 59096219, 4817317, 59068400, 22139825, + 44255434, 10856640, 46638094, 13434653 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1575783124125742, 2126210792434375, 1569430791264065, + 1402582372904727, 1891780248341114 +#else + 22759470, 23480998, 50342599, 31683009, 13637441, 23386341, + 1765143, 20900106, 28445306, 28189722 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 838432205560695, 1997703511451664, 1018791879907867, + 1662001808174331, 78328132957753 +#else + 29875063, 12493613, 2795536, 29768102, 1710619, 15181182, + 56913147, 24765756, 9074233, 1167180 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 739152638255629, 2074935399403557, 505483666745895, + 1611883356514088, 628654635394878 +#else + 40903181, 11014232, 57266213, 30918946, 40200743, 7532293, + 48391976, 24018933, 3843902, 9367684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1822054032121349, 643057948186973, 7306757352712, + 577249257962099, 284735863382083 +#else + 56139269, 27150720, 9591133, 9582310, 11349256, 108879, + 16235123, 8601684, 66969667, 4242894 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1366558556363930, 1448606567552086, 1478881020944768, + 165803179355898, 1115718458123498 +#else + 22092954, 20363309, 65066070, 21585919, 32186752, 22037044, + 60534522, 2470659, 39691498, 16625500 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 204146226972102, 1630511199034723, 2215235214174763, + 174665910283542, 956127674017216 +#else + 56051142, 3042015, 13770083, 24296510, 584235, 33009577, + 59338006, 2602724, 39757248, 14247412 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1562934578796716, 1070893489712745, 11324610642270, + 958989751581897, 2172552325473805 +#else + 6314156, 23289540, 34336361, 15957556, 56951134, 168749, + 58490057, 14290060, 27108877, 32373552 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1770564423056027, 735523631664565, 1326060113795289, + 1509650369341127, 65892421582684 +#else + 58522267, 26383465, 13241781, 10960156, 34117849, 19759835, + 33547975, 22495543, 39960412, 981873 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 623682558650637, 1337866509471512, 990313350206649, + 1314236615762469, 1164772974270275 +#else + 22833421, 9293594, 34459416, 19935764, 57971897, 14756818, + 44180005, 19583651, 56629059, 17356469 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 223256821462517, 723690150104139, 1000261663630601, + 933280913953265, 254872671543046 +#else + 59340277, 3326785, 38997067, 10783823, 19178761, 14905060, + 22680049, 13906969, 51175174, 3797898 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1969087237026041, 624795725447124, 1335555107635969, + 2069986355593023, 1712100149341902 +#else + 21721337, 29341686, 54902740, 9310181, 63226625, 19901321, + 23740223, 30845200, 20491982, 25512280 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1236103475266979, 1837885883267218, 1026072585230455, + 1025865513954973, 1801964901432134 +#else + 9209251, 18419377, 53852306, 27386633, 66377847, 15289672, + 25947805, 15286587, 30997318, 26851369 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1115241013365517, 1712251818829143, 2148864332502771, + 2096001471438138, 2235017246626125 +#else + 7392013, 16618386, 23946583, 25514540, 53843699, 32020573, + 52911418, 31232855, 17649997, 33304352 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1299268198601632, 2047148477845621, 2165648650132450, + 1612539282026145, 514197911628890 +#else + 57807776, 19360604, 30609525, 30504889, 41933794, 32270679, + 51867297, 24028707, 64875610, 7662145 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 118352772338543, 1067608711804704, 1434796676193498, + 1683240170548391, 230866769907437 +#else + 49550191, 1763593, 33994528, 15908609, 37067994, 21380136, + 7335079, 25082233, 63934189, 3440182 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850689576796636, 1601590730430274, 1139674615958142, + 1954384401440257, 76039205311 +#else + 47219164, 27577423, 42997570, 23865561, 10799742, 16982475, + 40449, 29122597, 4862399, 1133 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1723387471374172, 997301467038410, 533927635123657, + 20928644693965, 1756575222802513 +#else + 34252636, 25680474, 61686474, 14860949, 50789833, 7956141, + 7258061, 311861, 36513873, 26175010 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2146711623855116, 503278928021499, 625853062251406, + 1109121378393107, 1033853809911861 +#else + 63335436, 31988495, 28985339, 7499440, 24445838, 9325937, + 29727763, 16527196, 18278453, 15405622 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 571005965509422, 2005213373292546, 1016697270349626, + 56607856974274, 914438579435146 +#else + 62726958, 8508651, 47210498, 29880007, 61124410, 15149969, + 53795266, 843522, 45233802, 13626196 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346698876211176, 2076651707527589, 1084761571110205, + 265334478828406, 1068954492309671 +#else + 2281448, 20067377, 56193445, 30944521, 1879357, 16164207, + 56324982, 3953791, 13340839, 15928663 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1769967932677654, 1695893319756416, 1151863389675920, + 1781042784397689, 400287774418285 +#else + 31727126, 26374577, 48671360, 25270779, 2875792, 17164102, + 41838969, 26539605, 43656557, 5964752 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1851867764003121, 403841933237558, 820549523771987, + 761292590207581, 1743735048551143 +#else + 4100401, 27594980, 49929526, 6017713, 48403027, 12227140, + 40424029, 11344143, 2538215, 25983677 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 410915148140008, 2107072311871739, 1004367461876503, + 99684895396761, 1180818713503224 +#else + 57675240, 6123112, 11159803, 31397824, 30016279, 14966241, + 46633881, 1485420, 66479608, 17595569 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 285945406881439, 648174397347453, 1098403762631981, + 1366547441102991, 1505876883139217 +#else + 40304287, 4260918, 11851389, 9658551, 35091757, 16367491, + 46903439, 20363143, 11659921, 22439314 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 672095903120153, 1675918957959872, 636236529315028, + 1569297300327696, 2164144194785875 +#else + 26180377, 10015009, 36264640, 24973138, 5418196, 9480663, + 2231568, 23384352, 33100371, 32248261 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1902708175321798, 1035343530915438, 1178560808893263, + 301095684058146, 1280977479761118 +#else + 15121094, 28352561, 56718958, 15427820, 39598927, 17561924, + 21670946, 4486675, 61177054, 19088051 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1615357281742403, 404257611616381, 2160201349780978, + 1160947379188955, 1578038619549541 +#else + 16166467, 24070699, 56004733, 6023907, 35182066, 32189508, + 2340059, 17299464, 56373093, 23514607 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013087639791217, 822734930507457, 1785668418619014, + 1668650702946164, 389450875221715 +#else + 28042865, 29997343, 54982337, 12259705, 63391366, 26608532, + 6766452, 24864833, 18036435, 5803270 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 453918449698368, 106406819929001, 2072540975937135, + 308588860670238, 1304394580755385 +#else + 66291264, 6763911, 11803561, 1585585, 10958447, 30883267, + 23855390, 4598332, 60949433, 19436993 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295082798350326, 2091844511495996, 1851348972587817, + 3375039684596, 789440738712837 +#else + 36077558, 19298237, 17332028, 31170912, 31312681, 27587249, + 696308, 50292, 47013125, 11763583 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2083069137186154, 848523102004566, 993982213589257, + 1405313299916317, 1532824818698468 +#else + 66514282, 31040148, 34874710, 12643979, 12650761, 14811489, + 665117, 20940800, 47335652, 22840869 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1495961298852430, 1397203457344779, 1774950217066942, + 139302743555696, 66603584342787 +#else + 30464590, 22291560, 62981387, 20819953, 19835326, 26448819, + 42712688, 2075772, 50088707, 992470 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1782411379088302, 1096724939964781, 27593390721418, + 542241850291353, 1540337798439873 +#else + 18357166, 26559999, 7766381, 16342475, 37783946, 411173, + 14578841, 8080033, 55534529, 22952821 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 693543956581437, 171507720360750, 1557908942697227, + 1074697073443438, 1104093109037196 +#else + 19598397, 10334610, 12555054, 2555664, 18821899, 23214652, + 21873262, 16014234, 26224780, 16452269 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 345288228393419, 1099643569747172, 134881908403743, + 1740551994106740, 248212179299770 +#else + 36884939, 5145195, 5944548, 16385966, 3976735, 2009897, + 55731060, 25936245, 46575034, 3698649 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 231429562203065, 1526290236421172, 2021375064026423, + 1520954495658041, 806337791525116 +#else + 14187449, 3448569, 56472628, 22743496, 44444983, 30120835, + 7268409, 22663988, 27394300, 12015369 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1079623667189886, 872403650198613, 766894200588288, + 2163700860774109, 2023464507911816 +#else + 19695742, 16087646, 28032085, 12999827, 6817792, 11427614, + 20244189, 32241655, 53849736, 30151970 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 854645372543796, 1936406001954827, 151460662541253, + 825325739271555, 1554306377287556 +#else + 30860084, 12735208, 65220619, 28854697, 50133957, 2256939, + 58942851, 12298311, 58558340, 23160969 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1497138821904622, 1044820250515590, 1742593886423484, + 1237204112746837, 849047450816987 +#else + 61389038, 22309106, 65198214, 15569034, 26642876, 25966672, + 61319509, 18435777, 62132699, 12651792 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 667962773375330, 1897271816877105, 1399712621683474, + 1143302161683099, 2081798441209593 +#else + 64260450, 9953420, 11531313, 28271553, 26895122, 20857343, + 53990043, 17036529, 9768697, 31021214 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 127147851567005, 1936114012888110, 1704424366552046, + 856674880716312, 716603621335359 +#else + 42389405, 1894650, 66821166, 28850346, 15348718, 25397902, + 32767512, 12765450, 4940095, 10678226 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1072409664800960, 2146937497077528, 1508780108920651, + 935767602384853, 1112800433544068 +#else + 18860224, 15980149, 48121624, 31991861, 40875851, 22482575, + 59264981, 13944023, 42736516, 16582018 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 333549023751292, 280219272863308, 2104176666454852, + 1036466864875785, 536135186520207 +#else + 51604604, 4970267, 37215820, 4175592, 46115652, 31354675, + 55404809, 15444559, 56105103, 7989036 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 373666279883137, 146457241530109, 304116267127857, + 416088749147715, 1258577131183391 +#else + 31490433, 5568061, 64696061, 2182382, 34772017, 4531685, + 35030595, 6200205, 47422751, 18754260 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1186115062588401, 2251609796968486, 1098944457878953, + 1153112761201374, 1791625503417267 +#else + 49800177, 17674491, 35586086, 33551600, 34221481, 16375548, + 8680158, 17182719, 28550067, 26697300 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1870078460219737, 2129630962183380, 852283639691142, + 292865602592851, 401904317342226 +#else + 38981977, 27866340, 16837844, 31733974, 60258182, 12700015, + 37068883, 4364037, 1155602, 5988841 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1361070124828035, 815664541425524, 1026798897364671, + 1951790935390647, 555874891834790 +#else + 21890435, 20281525, 54484852, 12154348, 59276991, 15300495, + 23148983, 29083951, 24618406, 8283181 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1546301003424277, 459094500062839, 1097668518375311, + 1780297770129643, 720763293687608 +#else + 33972757, 23041680, 9975415, 6841041, 35549071, 16356535, + 3070187, 26528504, 1466168, 10740210 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1212405311403990, 1536693382542438, 61028431067459, + 1863929423417129, 1223219538638038 +#else + 65599446, 18066246, 53605478, 22898515, 32799043, 909394, + 53169961, 27774712, 34944214, 18227391 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1294303766540260, 1183557465955093, 882271357233093, + 63854569425375, 2213283684565087 +#else + 3960804, 19286629, 39082773, 17636380, 47704005, 13146867, + 15567327, 951507, 63848543, 32980496 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 339050984211414, 601386726509773, 413735232134068, + 966191255137228, 1839475899458159 +#else + 24740822, 5052253, 37014733, 8961360, 25877428, 6165135, + 42740684, 14397371, 59728495, 27410326 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 235605972169408, 2174055643032978, 1538335001838863, + 1281866796917192, 1815940222628465 +#else + 38220480, 3510802, 39005586, 32395953, 55870735, 22922977, + 51667400, 19101303, 65483377, 27059617 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1632352921721536, 1833328609514701, 2092779091951987, + 1923956201873226, 2210068022482919 +#else + 793280, 24323954, 8836301, 27318725, 39747955, 31184838, + 33152842, 28669181, 57202663, 32932579 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 35271216625062, 1712350667021807, 983664255668860, + 98571260373038, 1232645608559836 +#else + 5666214, 525582, 20782575, 25516013, 42570364, 14657739, + 16099374, 1468826, 60937436, 18367850 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1998172393429622, 1798947921427073, 784387737563581, + 1589352214827263, 1589861734168180 +#else + 62249590, 29775088, 64191105, 26806412, 7778749, 11688288, + 36704511, 23683193, 65549940, 23690785 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1733739258725305, 31715717059538, 201969945218860, + 992093044556990, 1194308773174556 +#else + 10896313, 25834728, 824274, 472601, 47648556, 3009586, 25248958, + 14783338, 36527388, 17796587 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 846415389605137, 746163495539180, 829658752826080, + 592067705956946, 957242537821393 +#else + 10566929, 12612572, 35164652, 11118702, 54475488, 12362878, + 21752402, 8822496, 24003793, 14264025 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1758148849754419, 619249044817679, 168089007997045, + 1371497636330523, 1867101418880350 +#else + 27713843, 26198459, 56100623, 9227529, 27050101, 2504721, + 23886875, 20436907, 13958494, 27821979 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 326633984209635, 261759506071016, 1700682323676193, + 1577907266349064, 1217647663383016 +#else + 43627235, 4867225, 39861736, 3900520, 29838369, 25342141, + 35219464, 23512650, 7340520, 18144364 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1714182387328607, 1477856482074168, 574895689942184, + 2159118410227270, 1555532449716575 +#else + 4646495, 25543308, 44342840, 22021777, 23184552, 8566613, + 31366726, 32173371, 52042079, 23179239 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 853828206885131, 998498946036955, 1835887550391235, + 207627336608048, 258363815956050 +#else + 49838347, 12723031, 50115803, 14878793, 21619651, 27356856, + 27584816, 3093888, 58265170, 3849920 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 141141474651677, 1236728744905256, 643101419899887, + 1646615130509173, 1208239602291765 +#else + 58043933, 2103171, 25561640, 18428694, 61869039, 9582957, + 32477045, 24536477, 5002293, 18004173 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1501663228068911, 1354879465566912, 1444432675498247, + 897812463852601, 855062598754348 +#else + 55051311, 22376525, 21115584, 20189277, 8808711, 21523724, + 16489529, 13378448, 41263148, 12741425 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 714380763546606, 1032824444965790, 1774073483745338, + 1063840874947367, 1738680636537158 +#else + 61162478, 10645102, 36197278, 15390283, 63821882, 26435754, + 24306471, 15852464, 28834118, 25908360 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1640635546696252, 633168953192112, 2212651044092396, + 30590958583852, 368515260889378 +#else + 49773116, 24447374, 42577584, 9434952, 58636780, 32971069, + 54018092, 455840, 20461858, 5491305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1171650314802029, 1567085444565577, 1453660792008405, + 757914533009261, 1619511342778196 +#else + 13669229, 17458950, 54626889, 23351392, 52539093, 21661233, + 42112877, 11293806, 38520660, 24132599 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 420958967093237, 971103481109486, 2169549185607107, + 1301191633558497, 1661514101014240 +#else + 28497909, 6272777, 34085870, 14470569, 8906179, 32328802, + 18504673, 19389266, 29867744, 24758489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 907123651818302, 1332556122804146, 1824055253424487, + 1367614217442959, 1982558335973172 +#else + 50901822, 13517195, 39309234, 19856633, 24009063, 27180541, + 60741263, 20379039, 22853428, 29542421 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1121533090144639, 1021251337022187, 110469995947421, + 1511059774758394, 2110035908131662 +#else + 24191359, 16712145, 53177067, 15217830, 14542237, 1646131, + 18603514, 22516545, 12876622, 31441985 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 303213233384524, 2061932261128138, 352862124777736, + 40828818670255, 249879468482660 +#else + 17902668, 4518229, 66697162, 30725184, 26878216, 5258055, + 54248111, 608396, 16031844, 3723494 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 856559257852200, 508517664949010, 1378193767894916, + 1723459126947129, 1962275756614521 +#else + 38476072, 12763727, 46662418, 7577503, 33001348, 20536687, + 17558841, 25681542, 23896953, 29240187 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1445691340537320, 40614383122127, 402104303144865, + 485134269878232, 1659439323587426 +#else + 47103464, 21542479, 31520463, 605201, 2543521, 5991821, + 64163800, 7229063, 57189218, 24727572 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 20057458979482, 1183363722525800, 2140003847237215, + 2053873950687614, 2112017736174909 +#else + 28816026, 298879, 38943848, 17633493, 19000927, 31888542, + 54428030, 30605106, 49057085, 31471516 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2228654250927986, 1483591363415267, 1368661293910956, + 1076511285177291, 526650682059608 +#else + 16000882, 33209536, 3493091, 22107234, 37604268, 20394642, + 12577739, 16041268, 47393624, 7847706 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 709481497028540, 531682216165724, 316963769431931, + 1814315888453765, 258560242424104 +#else + 10151868, 10572098, 27312476, 7922682, 14825339, 4723128, + 34252933, 27035413, 57088296, 3852847 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1053447823660455, 1955135194248683, 1010900954918985, + 1182614026976701, 1240051576966610 +#else + 55678375, 15697595, 45987307, 29133784, 5386313, 15063598, + 16514493, 17622322, 29330898, 18478208 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1957943897155497, 1788667368028035, 137692910029106, + 1039519607062, 826404763313028 +#else + 41609129, 29175637, 51885955, 26653220, 16615730, 2051784, + 3303702, 15490, 39560068, 12314390 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1848942433095597, 1582009882530495, 1849292741020143, + 1068498323302788, 2001402229799484 +#else + 15683501, 27551389, 18109119, 23573784, 15337967, 27556609, + 50391428, 15921865, 16103996, 29823217 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1528282417624269, 2142492439828191, 2179662545816034, + 362568973150328, 1591374675250271 +#else + 43939021, 22773182, 13588191, 31925625, 63310306, 32479502, + 47835256, 5402698, 37293151, 23713330 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 160026679434388, 232341189218716, 2149181472355545, + 598041771119831, 183859001910173 +#else + 23190676, 2384583, 34394524, 3462153, 37205209, 32025299, + 55842007, 8911516, 41903005, 2739712 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013278155187349, 662660471354454, 793981225706267, + 411706605985744, 804490933124791 +#else + 21374101, 30000182, 33584214, 9874410, 15377179, 11831242, + 33578960, 6134906, 4931255, 11987849 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2051892037280204, 488391251096321, 2230187337030708, + 930221970662692, 679002758255210 +#else + 67101132, 30575573, 50885377, 7277596, 105524, 33232381, + 35628324, 13861387, 37032554, 10117929 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1530723630438670, 875873929577927, 341560134269988, + 449903119530753, 1055551308214179 +#else + 37607694, 22809559, 40945095, 13051538, 41483300, 5089642, + 60783361, 6704078, 12890019, 15728940 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1461835919309432, 1955256480136428, 180866187813063, + 1551979252664528, 557743861963950 +#else + 45136504, 21783052, 66157804, 29135591, 14704839, 2695116, + 903376, 23126293, 12885166, 8311031 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 359179641731115, 1324915145732949, 902828372691474, + 294254275669987, 1887036027752957 +#else + 49592363, 5352193, 10384213, 19742774, 7506450, 13453191, + 26423267, 4384730, 1888765, 28119028 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2043271609454323, 2038225437857464, 1317528426475850, + 1398989128982787, 2027639881006861 +#else + 41291507, 30447119, 53614264, 30371925, 30896458, 19632703, + 34857219, 20846562, 47644429, 30214188 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2072902725256516, 312132452743412, 309930885642209, + 996244312618453, 1590501300352303 +#else + 43500868, 30888657, 66582772, 4651135, 5765089, 4618330, + 6092245, 14845197, 17151279, 23700316 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1397254305160710, 695734355138021, 2233992044438756, + 1776180593969996, 1085588199351115 +#else + 42278406, 20820711, 51942885, 10367249, 37577956, 33289075, + 22825804, 26467153, 50242379, 16176524 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 440567051331029, 254894786356681, 493869224930222, + 1556322069683366, 1567456540319218 +#else + 43525589, 6564960, 20063689, 3798228, 62368686, 7359224, + 2006182, 23191006, 38362610, 23356922 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1950722461391320, 1907845598854797, 1822757481635527, + 2121567704750244, 73811931471221 +#else + 56482264, 29068029, 53788301, 28429114, 3432135, 27161203, + 23632036, 31613822, 32808309, 1099883 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 387139307395758, 2058036430315676, 1220915649965325, + 1794832055328951, 1230009312169328 +#else + 15030958, 5768825, 39657628, 30667132, 60681485, 18193060, + 51830967, 26745081, 2051440, 18328567 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1765973779329517, 659344059446977, 19821901606666, + 1301928341311214, 1116266004075885 +#else + 63746541, 26315059, 7517889, 9824992, 23555850, 295369, 5148398, + 19400244, 44422509, 16633659 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1127572801181483, 1224743760571696, 1276219889847274, + 1529738721702581, 1589819666871853 +#else + 4577067, 16802144, 13249840, 18250104, 19958762, 19017158, + 18559669, 22794883, 8402477, 23690159 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2181229378964934, 2190885205260020, 1511536077659137, + 1246504208580490, 668883326494241 +#else + 38702534, 32502850, 40318708, 32646733, 49896449, 22523642, + 9453450, 18574360, 17983009, 9967138 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 437866655573314, 669026411194768, 81896997980338, + 523874406393178, 245052060935236 +#else + 41346370, 6524721, 26585488, 9969270, 24709298, 1220360, + 65430874, 7806336, 17507396, 3651560 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1975438052228868, 1071801519999806, 594652299224319, + 1877697652668809, 1489635366987285 +#else + 56688388, 29436320, 14584638, 15971087, 51340543, 8861009, + 26556809, 27979875, 48555541, 22197296 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 958592545673770, 233048016518599, 851568750216589, + 567703851596087, 1740300006094761 +#else + 2839082, 14284142, 4029895, 3472686, 14402957, 12689363, + 40466743, 8459446, 61503401, 25932490 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2014540178270324, 192672779514432, 213877182641530, + 2194819933853411, 1716422829364835 +#else + 62269556, 30018987, 9744960, 2871048, 25113978, 3187018, + 41998051, 32705365, 17258083, 25576693 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1540769606609725, 2148289943846077, 1597804156127445, + 1230603716683868, 815423458809453 +#else + 18164541, 22959256, 49953981, 32012014, 19237077, 23809137, + 23357532, 18337424, 26908269, 12150756 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1738560251245018, 1779576754536888, 1783765347671392, + 1880170990446751, 1088225159617541 +#else + 36843994, 25906566, 5112248, 26517760, 65609056, 26580174, + 43167, 28016731, 34806789, 16215818 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 659303913929492, 1956447718227573, 1830568515922666, + 841069049744408, 1669607124206368 +#else + 60209940, 9824393, 54804085, 29153342, 35711722, 27277596, + 32574488, 12532905, 59605792, 24879084 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143465490433355, 1532194726196059, 1093276745494697, + 481041706116088, 2121405433561163 +#else + 39765323, 17038963, 39957339, 22831480, 946345, 16291093, + 254968, 7168080, 21676107, 31611404 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1686424298744462, 1451806974487153, 266296068846582, + 1834686947542675, 1720762336132256 +#else + 21260942, 25129680, 50276977, 21633609, 43430902, 3968120, + 63456915, 27338965, 63552672, 25641356 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 889217026388959, 1043290623284660, 856125087551909, + 1669272323124636, 1603340330827879 +#else + 16544735, 13250366, 50304436, 15546241, 62525861, 12757257, + 64646556, 24874095, 48201831, 23891632 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1206396181488998, 333158148435054, 1402633492821422, + 1120091191722026, 1945474114550509 +#else + 64693606, 17976703, 18312302, 4964443, 51836334, 20900867, + 26820650, 16690659, 25459437, 28989823 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 766720088232571, 1512222781191002, 1189719893490790, + 2091302129467914, 2141418006894941 +#else + 41964155, 11425019, 28423002, 22533875, 60963942, 17728207, + 9142794, 31162830, 60676445, 31909614 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 419663647306612, 1998875112167987, 1426599870253707, + 1154928355379510, 486538532138187 +#else + 44004212, 6253475, 16964147, 29785560, 41994891, 21257994, + 39651638, 17209773, 6335691, 7249989 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 938160078005954, 1421776319053174, 1941643234741774, + 180002183320818, 1414380336750546 +#else + 36775618, 13979674, 7503222, 21186118, 55152142, 28932738, + 36836594, 2682241, 25993170, 21075909 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 398001940109652, 1577721237663248, 1012748649830402, + 1540516006905144, 1011684812884559 +#else + 4364628, 5930691, 32304656, 23509878, 59054082, 15091130, + 22857016, 22955477, 31820367, 15075278 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1653276489969630, 6081825167624, 1921777941170836, + 1604139841794531, 861211053640641 +#else + 31879134, 24635739, 17258760, 90626, 59067028, 28636722, + 24162787, 23903546, 49138625, 12833044 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 996661541407379, 1455877387952927, 744312806857277, + 139213896196746, 1000282908547789 +#else + 19073683, 14851414, 42705695, 21694263, 7625277, 11091125, + 47489674, 2074448, 57694925, 14905376 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1450817495603008, 1476865707053229, 1030490562252053, + 620966950353376, 1744760161539058 +#else + 24483648, 21618865, 64589997, 22007013, 65555733, 15355505, + 41826784, 9253128, 27628530, 25998952 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 559728410002599, 37056661641185, 2038622963352006, + 1637244893271723, 1026565352238948 +#else + 17597607, 8340603, 19355617, 552187, 26198470, 30377849, + 4593323, 24396850, 52997988, 15297015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 962165956135846, 1116599660248791, 182090178006815, + 1455605467021751, 196053588803284 +#else + 510886, 14337390, 35323607, 16638631, 6328095, 2713355, + 46891447, 21690211, 8683220, 2921426 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 796863823080135, 1897365583584155, 420466939481601, + 2165972651724672, 932177357788289 +#else + 18606791, 11874196, 27155355, 28272950, 43077121, 6265445, + 41930624, 32275507, 4674689, 13890525 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 877047233620632, 1375632631944375, 643773611882121, + 660022738847877, 19353932331831 +#else + 13609624, 13069022, 39736503, 20498523, 24360585, 9592974, + 14977157, 9835105, 4389687, 288396 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2216943882299338, 394841323190322, 2222656898319671, + 558186553950529, 1077236877025190 +#else + 9922506, 33035038, 13613106, 5883594, 48350519, 33120168, + 54804801, 8317627, 23388070, 16052080 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 801118384953213, 1914330175515892, 574541023311511, + 1471123787903705, 1526158900256288 +#else + 12719997, 11937594, 35138804, 28525742, 26900119, 8561328, + 46953177, 21921452, 52354592, 22741539 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 949617889087234, 2207116611267331, 912920039141287, + 501158539198789, 62362560771472 +#else + 15961858, 14150409, 26716931, 32888600, 44314535, 13603568, + 11829573, 7467844, 38286736, 929274 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1474518386765335, 1760793622169197, 1157399790472736, + 1622864308058898, 165428294422792 +#else + 11038231, 21972036, 39798381, 26237869, 56610336, 17246600, + 43629330, 24182562, 45715720, 2465073 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1961673048027128, 102619413083113, 1051982726768458, + 1603657989805485, 1941613251499678 +#else + 20017144, 29231206, 27915241, 1529148, 12396362, 15675764, + 13817261, 23896366, 2463390, 28932292 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1401939116319266, 335306339903072, 72046196085786, + 862423201496006, 850518754531384 +#else + 50749986, 20890520, 55043680, 4996453, 65852442, 1073571, + 9583558, 12851107, 4003896, 12673717 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1234706593321979, 1083343891215917, 898273974314935, + 1640859118399498, 157578398571149 +#else + 65377275, 18398561, 63845933, 16143081, 19294135, 13385325, + 14741514, 24450706, 7903885, 2348101 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1143483057726416, 1992614991758919, 674268662140796, + 1773370048077526, 674318359920189 +#else + 24536016, 17039225, 12715591, 29692277, 1511292, 10047386, + 63266518, 26425272, 38731325, 10048126 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1835401379538542, 173900035308392, 818247630716732, + 1762100412152786, 1021506399448291 +#else + 54486638, 27349611, 30718824, 2591312, 56491836, 12192839, + 18873298, 26257342, 34811107, 15221631 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1506632088156630, 2127481795522179, 513812919490255, + 140643715928370, 442476620300318 +#else + 40630742, 22450567, 11546243, 31701949, 9180879, 7656409, + 45764914, 2095754, 29769758, 6593415 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2056683376856736, 219094741662735, 2193541883188309, + 1841182310235800, 556477468664293 +#else + 35114656, 30646970, 4176911, 3264766, 12538965, 32686321, + 26312344, 27435754, 30958053, 8292160 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1315019427910827, 1049075855992603, 2066573052986543, + 266904467185534, 2040482348591520 +#else + 31429803, 19595316, 29173531, 15632448, 12174511, 30794338, + 32808830, 3977186, 26143136, 30405556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 94096246544434, 922482381166992, 24517828745563, + 2139430508542503, 2097139044231004 +#else + 22648882, 1402143, 44308880, 13746058, 7936347, 365344, + 58440231, 31879998, 63350620, 31249806 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 537697207950515, 1399352016347350, 1563663552106345, + 2148749520888918, 549922092988516 +#else + 51616947, 8012312, 64594134, 20851969, 43143017, 23300402, + 65496150, 32018862, 50444388, 8194477 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1747985413252434, 680511052635695, 1809559829982725, + 594274250930054, 201673170745982 +#else + 27338066, 26047012, 59694639, 10140404, 48082437, 26964542, + 27277190, 8855376, 28572286, 3005164 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 323583936109569, 1973572998577657, 1192219029966558, + 79354804385273, 1374043025560347 +#else + 26287105, 4821776, 25476601, 29408529, 63344350, 17765447, + 49100281, 1182478, 41014043, 20474836 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 213277331329947, 416202017849623, 1950535221091783, + 1313441578103244, 2171386783823658 +#else + 59937691, 3178079, 23970071, 6201893, 49913287, 29065239, + 45232588, 19571804, 32208682, 32356184 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 189088804229831, 993969372859110, 895870121536987, + 1547301535298256, 1477373024911350 +#else + 50451143, 2817642, 56822502, 14811297, 6024667, 13349505, + 39793360, 23056589, 39436278, 22014573 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1620578418245010, 541035331188469, 2235785724453865, + 2154865809088198, 1974627268751826 +#else + 15941010, 24148500, 45741813, 8062054, 31876073, 33315803, + 51830470, 32110002, 15397330, 29424239 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346805451740245, 1350981335690626, 942744349501813, + 2155094562545502, 1012483751693409 +#else + 8934485, 20068965, 43822466, 20131190, 34662773, 14047985, + 31170398, 32113411, 39603297, 15087183 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2107080134091762, 1132567062788208, 1824935377687210, + 769194804343737, 1857941799971888 +#else + 48751602, 31397940, 24524912, 16876564, 15520426, 27193656, + 51606457, 11461895, 16788528, 27685490 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1074666112436467, 249279386739593, 1174337926625354, + 1559013532006480, 1472287775519121 +#else + 65161459, 16013772, 21750665, 3714552, 49707082, 17498998, + 63338576, 23231111, 31322513, 21938797 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1872620123779532, 1892932666768992, 1921559078394978, + 1270573311796160, 1438913646755037 +#else + 21426636, 27904214, 53460576, 28206894, 38296674, 28633461, + 48833472, 18933017, 13040861, 21441484 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 837390187648199, 1012253300223599, 989780015893987, + 1351393287739814, 328627746545550 +#else + 11293895, 12478086, 39972463, 15083749, 37801443, 14748871, + 14555558, 20137329, 1613710, 4896935 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1028328827183114, 1711043289969857, 1350832470374933, + 1923164689604327, 1495656368846911 +#else + 41213962, 15323293, 58619073, 25496531, 25967125, 20128972, + 2825959, 28657387, 43137087, 22287016 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1900828492104143, 430212361082163, 687437570852799, + 832514536673512, 1685641495940794 +#else + 51184079, 28324551, 49665331, 6410663, 3622847, 10243618, + 20615400, 12405433, 43355834, 25118015 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 842632847936398, 605670026766216, 290836444839585, + 163210774892356, 2213815011799645 +#else + 60017550, 12556207, 46917512, 9025186, 50036385, 4333800, + 4378436, 2432030, 23097949, 32988414 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1176336383453996, 1725477294339771, 12700622672454, + 678015708818208, 162724078519879 +#else + 4565804, 17528778, 20084411, 25711615, 1724998, 189254, + 24767264, 10103221, 48596551, 2424777 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1448049969043497, 1789411762943521, 385587766217753, + 90201620913498, 832999441066823 +#else + 366633, 21577626, 8173089, 26664313, 30788633, 5745705, + 59940186, 1344108, 63466311, 12412658 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 516086333293313, 2240508292484616, 1351669528166508, + 1223255565316488, 750235824427138 +#else + 43107073, 7690285, 14929416, 33386175, 34898028, 20141445, + 24162696, 18227928, 63967362, 11179384 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1263624896582495, 1102602401673328, 526302183714372, + 2152015839128799, 1483839308490010 +#else + 18289503, 18829478, 8056944, 16430056, 45379140, 7842513, + 61107423, 32067534, 48424218, 22110928 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 442991718646863, 1599275157036458, 1925389027579192, + 899514691371390, 350263251085160 +#else + 476239, 6601091, 60956074, 23831056, 17503544, 28690532, + 27672958, 13403813, 11052904, 5219329 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1689713572022143, 593854559254373, 978095044791970, + 1985127338729499, 1676069120347625 +#else + 20678527, 25178694, 34436965, 8849122, 62099106, 14574751, + 31186971, 29580702, 9014761, 24975376 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1557207018622683, 340631692799603, 1477725909476187, + 614735951619419, 2033237123746766 +#else + 53464795, 23204192, 51146355, 5075807, 65594203, 22019831, + 34006363, 9160279, 8473550, 30297594 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 968764929340557, 1225534776710944, 662967304013036, + 1155521416178595, 791142883466590 +#else + 24900749, 14435722, 17209120, 18261891, 44516588, 9878982, + 59419555, 17218610, 42540382, 11788947 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1487081286167458, 993039441814934, 1792378982844640, + 698652444999874, 2153908693179754 +#else + 63990690, 22159237, 53306774, 14797440, 9652448, 26708528, + 47071426, 10410732, 42540394, 32095740 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1123181311102823, 685575944875442, 507605465509927, + 1412590462117473, 568017325228626 +#else + 51449703, 16736705, 44641714, 10215877, 58011687, 7563910, + 11871841, 21049238, 48595538, 8464117 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 560258797465417, 2193971151466401, 1824086900849026, + 579056363542056, 1690063960036441 +#else + 43708233, 8348506, 52522913, 32692717, 63158658, 27181012, + 14325288, 8628612, 33313881, 25183915 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1918407319222416, 353767553059963, 1930426334528099, + 1564816146005724, 1861342381708096 +#else + 46921872, 28586496, 22367355, 5271547, 66011747, 28765593, + 42303196, 23317577, 58168128, 27736162 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2131325168777276, 1176636658428908, 1756922641512981, + 1390243617176012, 1966325177038383 +#else + 60160060, 31759219, 34483180, 17533252, 32635413, 26180187, + 15989196, 20716244, 28358191, 29300528 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2063958120364491, 2140267332393533, 699896251574968, + 273268351312140, 375580724713232 +#else + 43547083, 30755372, 34757181, 31892468, 57961144, 10429266, + 50471180, 4072015, 61757200, 5596588 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2024297515263178, 416959329722687, 1079014235017302, + 171612225573183, 1031677520051053 +#else + 38872266, 30164383, 12312895, 6213178, 3117142, 16078565, + 29266239, 2557221, 1768301, 15373193 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2033900009388450, 1744902869870788, 2190580087917640, + 1949474984254121, 231049754293748 +#else + 59865506, 30307471, 62515396, 26001078, 66980936, 32642186, + 66017961, 29049440, 42448372, 3442909 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 343868674606581, 550155864008088, 1450580864229630, + 481603765195050, 896972360018042 +#else + 36898293, 5124042, 14181784, 8197961, 18964734, 21615339, + 22597930, 7176455, 48523386, 13365929 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2151139328380127, 314745882084928, 59756825775204, + 1676664391494651, 2048348075599360 +#else + 59231455, 32054473, 8324672, 4690079, 6261860, 890446, 24538107, + 24984246, 57419264, 30522764 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1528930066340597, 1605003907059576, 1055061081337675, + 1458319101947665, 1234195845213142 +#else + 25008885, 22782833, 62803832, 23916421, 16265035, 15721635, + 683793, 21730648, 15723478, 18390951 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 830430507734812, 1780282976102377, 1425386760709037, + 362399353095425, 2168861579799910 +#else + 57448220, 12374378, 40101865, 26528283, 59384749, 21239917, + 11879681, 5400171, 519526, 32318556 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1155762232730333, 980662895504006, 2053766700883521, + 490966214077606, 510405877041357 +#else + 22258397, 17222199, 59239046, 14613015, 44588609, 30603508, + 46754982, 7315966, 16648397, 7605640 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1683750316716132, 652278688286128, 1221798761193539, + 1897360681476669, 319658166027343 +#else + 59027556, 25089834, 58885552, 9719709, 19259459, 18206220, + 23994941, 28272877, 57640015, 4763277 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 618808732869972, 72755186759744, 2060379135624181, + 1730731526741822, 48862757828238 +#else + 45409620, 9220968, 51378240, 1084136, 41632757, 30702041, + 31088446, 25789909, 55752334, 728111 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1463171970593505, 1143040711767452, 614590986558883, + 1409210575145591, 1882816996436803 +#else + 26047201, 21802961, 60208540, 17032633, 24092067, 9158119, + 62835319, 20998873, 37743427, 28056159 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2230133264691131, 563950955091024, 2042915975426398, + 827314356293472, 672028980152815 +#else + 17510331, 33231575, 5854288, 8403524, 17133918, 30441820, + 38997856, 12327944, 10750447, 10014012 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 264204366029760, 1654686424479449, 2185050199932931, + 2207056159091748, 506015669043634 +#else + 56796096, 3936951, 9156313, 24656749, 16498691, 32559785, + 39627812, 32887699, 3424690, 7540221 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1784446333136569, 1973746527984364, 334856327359575, + 1156769775884610, 1023950124675478 +#else + 30322361, 26590322, 11361004, 29411115, 7433303, 4989748, + 60037442, 17237212, 57864598, 15258045 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2065270940578383, 31477096270353, 306421879113491, + 181958643936686, 1907105536686083 +#else + 13054543, 30774935, 19155473, 469045, 54626067, 4566041, + 5631406, 2711395, 1062915, 28418087 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1496516440779464, 1748485652986458, 872778352227340, + 818358834654919, 97932669284220 +#else + 47868616, 22299832, 37599834, 26054466, 61273100, 13005410, + 61042375, 12194496, 32960380, 1459310 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 471636015770351, 672455402793577, 1804995246884103, + 1842309243470804, 1501862504981682 +#else + 19852015, 7027924, 23669353, 10020366, 8586503, 26896525, + 394196, 27452547, 18638002, 22379495 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1013216974933691, 538921919682598, 1915776722521558, + 1742822441583877, 1886550687916656 +#else + 31395515, 15098109, 26581030, 8030562, 50580950, 28547297, + 9012485, 25970078, 60465776, 28111795 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2094270000643336, 303971879192276, 40801275554748, + 649448917027930, 1818544418535447 +#else + 57916680, 31207054, 65111764, 4529533, 25766844, 607986, + 67095642, 9677542, 34813975, 27098423 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2241737709499165, 549397817447461, 838180519319392, + 1725686958520781, 1705639080897747 +#else + 64664349, 33404494, 29348901, 8186665, 1873760, 12489863, + 36174285, 25714739, 59256019, 25416002 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1216074541925116, 50120933933509, 1565829004133810, + 721728156134580, 349206064666188 +#else + 51872508, 18120922, 7766469, 746860, 26346930, 23332670, + 39775412, 10754587, 57677388, 5203575 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 948617110470858, 346222547451945, 1126511960599975, + 1759386906004538, 493053284802266 +#else + 31834314, 14135496, 66338857, 5159117, 20917671, 16786336, + 59640890, 26216907, 31809242, 7347066 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1454933046815146, 874696014266362, 1467170975468588, + 1432316382418897, 2111710746366763 +#else + 57502122, 21680191, 20414458, 13033986, 13716524, 21862551, + 19797969, 21343177, 15192875, 31466942 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2105387117364450, 1996463405126433, 1303008614294500, + 851908115948209, 1353742049788635 +#else + 54445282, 31372712, 1168161, 29749623, 26747876, 19416341, + 10609329, 12694420, 33473243, 20172328 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 750300956351719, 1487736556065813, 15158817002104, + 1511998221598392, 971739901354129 +#else + 33184999, 11180355, 15832085, 22169002, 65475192, 225883, + 15089336, 22530529, 60973201, 14480052 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1874648163531693, 2124487685930551, 1810030029384882, + 918400043048335, 586348627300650 +#else + 31308717, 27934434, 31030839, 31657333, 15674546, 26971549, + 5496207, 13685227, 27595050, 8737275 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1235084464747900, 1166111146432082, 1745394857881591, + 1405516473883040, 4463504151617 +#else + 46790012, 18404192, 10933842, 17376410, 8335351, 26008410, + 36100512, 20943827, 26498113, 66511 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1663810156463827, 327797390285791, 1341846161759410, + 1964121122800605, 1747470312055380 +#else + 22644435, 24792703, 50437087, 4884561, 64003250, 19995065, + 30540765, 29267685, 53781076, 26039336 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 660005247548233, 2071860029952887, 1358748199950107, + 911703252219107, 1014379923023831 +#else + 39091017, 9834844, 18617207, 30873120, 63706907, 20246925, + 8205539, 13585437, 49981399, 15115438 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2206641276178231, 1690587809721504, 1600173622825126, + 2156096097634421, 1106822408548216 +#else + 23711543, 32881517, 31206560, 25191721, 6164646, 23844445, + 33572981, 32128335, 8236920, 16492939 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1344788193552206, 1949552134239140, 1735915881729557, + 675891104100469, 1834220014427292 +#else + 43198286, 20038905, 40809380, 29050590, 25005589, 25867162, + 19574901, 10071562, 6708380, 27332008 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1920949492387964, 158885288387530, 70308263664033, + 626038464897817, 1468081726101009 +#else + 2101372, 28624378, 19702730, 2367575, 51681697, 1047674, + 5301017, 9328700, 29955601, 21876122 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 622221042073383, 1210146474039168, 1742246422343683, + 1403839361379025, 417189490895736 +#else + 3096359, 9271816, 45488000, 18032587, 52260867, 25961494, + 41216721, 20918836, 57191288, 6216607 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 22727256592983, 168471543384997, 1324340989803650, + 1839310709638189, 504999476432775 +#else + 34493015, 338662, 41913253, 2510421, 37895298, 19734218, + 24822829, 27407865, 40341383, 7525078 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1313240518756327, 1721896294296942, 52263574587266, + 2065069734239232, 804910473424630 +#else + 44042215, 19568808, 16133486, 25658254, 63719298, 778787, + 66198528, 30771936, 47722230, 11994100 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1337466662091884, 1287645354669772, 2018019646776184, + 652181229374245, 898011753211715 +#else + 21691500, 19929806, 66467532, 19187410, 3285880, 30070836, + 42044197, 9718257, 59631427, 13381417 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1969792547910734, 779969968247557, 2011350094423418, + 1823964252907487, 1058949448296945 +#else + 18445390, 29352196, 14979845, 11622458, 65381754, 29971451, + 23111647, 27179185, 28535281, 15779576 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 207343737062002, 1118176942430253, 758894594548164, + 806764629546266, 1157700123092949 +#else + 30098034, 3089662, 57874477, 16662134, 45801924, 11308410, + 53040410, 12021729, 9955285, 17251076 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1273565321399022, 1638509681964574, 759235866488935, + 666015124346707, 897983460943405 +#else + 9734894, 18977602, 59635230, 24415696, 2060391, 11313496, + 48682835, 9924398, 20194861, 13380996 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1717263794012298, 1059601762860786, 1837819172257618, + 1054130665797229, 680893204263559 +#else + 40730762, 25589224, 44941042, 15789296, 49053522, 27385639, + 65123949, 15707770, 26342023, 10146099 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2237039662793603, 2249022333361206, 2058613546633703, + 149454094845279, 2215176649164582 +#else + 41091971, 33334488, 21339190, 33513044, 19745255, 30675732, + 37471583, 2227039, 21612326, 33008704 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 79472182719605, 1851130257050174, 1825744808933107, + 821667333481068, 781795293511946 +#else + 54031477, 1184227, 23562814, 27583990, 46757619, 27205717, + 25764460, 12243797, 46252298, 11649657 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 755822026485370, 152464789723500, 1178207602290608, + 410307889503239, 156581253571278 +#else + 57077370, 11262625, 27384172, 2271902, 26947504, 17556661, + 39943, 6114064, 33514190, 2333242 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1418185496130297, 484520167728613, 1646737281442950, + 1401487684670265, 1349185550126961 +#else + 45675257, 21132610, 8119781, 7219913, 45278342, 24538297, + 60429113, 20883793, 24350577, 20104431 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1495380034400429, 325049476417173, 46346894893933, + 1553408840354856, 828980101835683 +#else + 62992557, 22282898, 43222677, 4843614, 37020525, 690622, + 35572776, 23147595, 8317859, 12352766 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1280337889310282, 2070832742866672, 1640940617225222, + 2098284908289951, 450929509534434 +#else + 18200138, 19078521, 34021104, 30857812, 43406342, 24451920, + 43556767, 31266881, 20712162, 6719373 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 407703353998781, 126572141483652, 286039827513621, + 1999255076709338, 2030511179441770 +#else + 26656189, 6075253, 59250308, 1886071, 38764821, 4262325, + 11117530, 29791222, 26224234, 30256974 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1254958221100483, 1153235960999843, 942907704968834, + 637105404087392, 1149293270147267 +#else + 49939907, 18700334, 63713187, 17184554, 47154818, 14050419, + 21728352, 9493610, 18620611, 17125804 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 894249020470196, 400291701616810, 406878712230981, + 1599128793487393, 1145868722604026 +#else + 53785524, 13325348, 11432106, 5964811, 18609221, 6062965, + 61839393, 23828875, 36407290, 17074774 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1497955250203334, 110116344653260, 1128535642171976, + 1900106496009660, 129792717460909 +#else + 43248326, 22321272, 26961356, 1640861, 34695752, 16816491, + 12248508, 28313793, 13735341, 1934062 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 452487513298665, 1352120549024569, 1173495883910956, + 1999111705922009, 367328130454226 +#else + 25089769, 6742589, 17081145, 20148166, 21909292, 17486451, + 51972569, 29789085, 45830866, 5473615 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1717539401269642, 1475188995688487, 891921989653942, + 836824441505699, 1885988485608364 +#else + 31883658, 25593331, 1083431, 21982029, 22828470, 13290673, + 59983779, 12469655, 29111212, 28103418 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1241784121422547, 187337051947583, 1118481812236193, + 428747751936362, 30358898927325 +#else + 24244947, 18504025, 40845887, 2791539, 52111265, 16666677, + 24367466, 6388839, 56813277, 452382 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2022432361201842, 1088816090685051, 1977843398539868, + 1854834215890724, 564238862029357 +#else + 41468082, 30136590, 5217915, 16224624, 19987036, 29472163, + 42872612, 27639183, 15766061, 8407814 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 938868489100585, 1100285072929025, 1017806255688848, + 1957262154788833, 152787950560442 +#else + 46701865, 13990230, 15495425, 16395525, 5377168, 15166495, + 58191841, 29165478, 59040954, 2276717 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 867319417678923, 620471962942542, 226032203305716, + 342001443957629, 1761675818237336 +#else + 30157899, 12924066, 49396814, 9245752, 19895028, 3368142, + 43281277, 5096218, 22740376, 26251015 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1295072362439987, 931227904689414, 1355731432641687, + 922235735834035, 892227229410209 +#else + 2041139, 19298082, 7783686, 13876377, 41161879, 20201972, + 24051123, 13742383, 51471265, 13295221 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1680989767906154, 535362787031440, 2136691276706570, + 1942228485381244, 1267350086882274 +#else + 33338218, 25048699, 12532112, 7977527, 9106186, 31839181, + 49388668, 28941459, 62657506, 18884987 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 366018233770527, 432660629755596, 126409707644535, + 1973842949591662, 645627343442376 +#else + 47063583, 5454096, 52762316, 6447145, 28862071, 1883651, + 64639598, 29412551, 7770568, 9620597 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 535509430575217, 546885533737322, 1524675609547799, + 2138095752851703, 1260738089896827 +#else + 23208049, 7979712, 33071466, 8149229, 1758231, 22719437, + 30945527, 31860109, 33606523, 18786461 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1159906385590467, 2198530004321610, 714559485023225, + 81880727882151, 1484020820037082 +#else + 1439939, 17283952, 66028874, 32760649, 4625401, 10647766, + 62065063, 1220117, 30494170, 22113633 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1377485731340769, 2046328105512000, 1802058637158797, + 62146136768173, 1356993908853901 +#else + 62071265, 20526136, 64138304, 30492664, 15640973, 26852766, + 40369837, 926049, 65424525, 20220784 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2013612215646735, 1830770575920375, 536135310219832, + 609272325580394, 270684344495013 +#else + 13908495, 30005160, 30919927, 27280607, 45587000, 7989038, + 9021034, 9078865, 3353509, 4033511 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1237542585982777, 2228682050256790, 1385281931622824, + 593183794882890, 493654978552689 +#else + 37445433, 18440821, 32259990, 33209950, 24295848, 20642309, + 23161162, 8839127, 27485041, 7356032 +#endif + }}, + }, + }, + { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 47341488007760, 1891414891220257, 983894663308928, + 176161768286818, 1126261115179708 +#else + 9661008, 705443, 11980065, 28184278, 65480320, 14661172, + 60762722, 2625014, 28431036, 16782598 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1694030170963455, 502038567066200, 1691160065225467, + 949628319562187, 275110186693066 +#else + 43269631, 25243016, 41163352, 7480957, 49427195, 25200248, + 44562891, 14150564, 15970762, 4099461 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1124515748676336, 1661673816593408, 1499640319059718, + 1584929449166988, 558148594103306 +#else + 29262576, 16756590, 26350592, 24760869, 8529670, 22346382, + 13617292, 23617289, 11465738, 8317062 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1784525599998356, 1619698033617383, 2097300287550715, + 258265458103756, 1905684794832758 +#else + 41615764, 26591503, 32500199, 24135381, 44070139, 31252209, + 14898636, 3848455, 20969334, 28396916 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288941072872766, 931787902039402, 190731008859042, + 2006859954667190, 1005931482221702 +#else + 46724414, 19206718, 48772458, 13884721, 34069410, 2842113, + 45498038, 29904543, 11177094, 14989547 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1465551264822703, 152905080555927, 680334307368453, + 173227184634745, 666407097159852 +#else + 42612143, 21838415, 16959895, 2278463, 12066309, 10137771, + 13515641, 2581286, 38621356, 9930239 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2111017076203943, 1378760485794347, 1248583954016456, + 1352289194864422, 1895180776543896 +#else + 49357223, 31456605, 16544299, 20545132, 51194056, 18605350, + 18345766, 20150679, 16291480, 28240394 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 171348223915638, 662766099800389, 462338943760497, + 466917763340314, 656911292869115 +#else + 33879670, 2553287, 32678213, 9875984, 8534129, 6889387, + 57432090, 6957616, 4368891, 9788741 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 488623681976577, 866497561541722, 1708105560937768, + 1673781214218839, 1506146329818807 +#else + 16660737, 7281060, 56278106, 12911819, 20108584, 25452756, + 45386327, 24941283, 16250551, 22443329 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 160425464456957, 950394373239689, 430497123340934, + 711676555398832, 320964687779005 +#else + 47343357, 2390525, 50557833, 14161979, 1905286, 6414907, + 4689584, 10604807, 36918461, 4782746 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 988979367990485, 1359729327576302, 1301834257246029, + 294141160829308, 29348272277475 +#else + 65754325, 14736940, 59741422, 20261545, 7710541, 19398842, + 57127292, 4383044, 22546403, 437323 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1434382743317910, 100082049942065, 221102347892623, + 186982837860588, 1305765053501834 +#else + 31665558, 21373968, 50922033, 1491338, 48740239, 3294681, + 27343084, 2786261, 36475274, 19457415 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2205916462268190, 499863829790820, 961960554686616, + 158062762756985, 1841471168298305 +#else + 52641566, 32870716, 33734756, 7448551, 19294360, 14334329, + 47418233, 2355318, 47824193, 27440058 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1191737341426592, 1847042034978363, 1382213545049056, + 1039952395710448, 788812858896859 +#else + 15121312, 17758270, 6377019, 27523071, 56310752, 20596586, + 18952176, 15496498, 37728731, 11754227 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1346965964571152, 1291881610839830, 2142916164336056, + 786821641205979, 1571709146321039 +#else + 64471568, 20071356, 8488726, 19250536, 12728760, 31931939, + 7141595, 11724556, 22761615, 23420291 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 787164375951248, 202869205373189, 1356590421032140, + 1431233331032510, 786341368775957 +#else + 16918416, 11729663, 49025285, 3022986, 36093132, 20214772, + 38367678, 21327038, 32851221, 11717399 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 492448143532951, 304105152670757, 1761767168301056, + 233782684697790, 1981295323106089 +#else + 11166615, 7338049, 60386341, 4531519, 37640192, 26252376, + 31474878, 3483633, 65915689, 29523600 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665807507761866, 1343384868355425, 895831046139653, + 439338948736892, 1986828765695105 +#else + 66923210, 9921304, 31456609, 20017994, 55095045, 13348922, + 33142652, 6546660, 47123585, 29606055 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 756096210874553, 1721699973539149, 258765301727885, + 1390588532210645, 1212530909934781 +#else + 34648249, 11266711, 55911757, 25655328, 31703693, 3855903, + 58571733, 20721383, 36336829, 18068118 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 852891097972275, 1816988871354562, 1543772755726524, + 1174710635522444, 202129090724628 +#else + 49102387, 12709067, 3991746, 27075244, 45617340, 23004006, + 35973516, 17504552, 10928916, 3011958 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1205281565824323, 22430498399418, 992947814485516, + 1392458699738672, 688441466734558 +#else + 60151107, 17960094, 31696058, 334240, 29576716, 14796075, + 36277808, 20749251, 18008030, 10258577 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1050627428414972, 1955849529137135, 2171162376368357, + 91745868298214, 447733118757826 +#else + 44660220, 15655568, 7018479, 29144429, 36794597, 32352840, + 65255398, 1367119, 25127874, 6671743 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1287181461435438, 622722465530711, 880952150571872, + 741035693459198, 311565274989772 +#else + 29701166, 19180498, 56230743, 9279287, 67091296, 13127209, + 21382910, 11042292, 25838796, 4642684 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1003649078149734, 545233927396469, 1849786171789880, + 1318943684880434, 280345687170552 +#else + 46678630, 14955536, 42982517, 8124618, 61739576, 27563961, + 30468146, 19653792, 18423288, 4177476 +#endif + }}, + }, + }, +}; + +#endif // OPENSSL_SMALL + +// Bi[i] = (2*i+1)*B +static const ge_precomp Bi[8] = { + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1288382639258501, 245678601348599, 269427782077623, + 1462984067271730, 137412439391563 +#else + 25967493, 19198397, 29566455, 3660896, 54414519, 4014786, 27544626, + 21800161, 61029707, 2047604 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 62697248952638, 204681361388450, 631292143396476, 338455783676468, + 1213667448819585 +#else + 54563134, 934261, 64385954, 3049989, 66381436, 9406985, 12720692, + 5043384, 19500929, 18085054 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 301289933810280, 1259582250014073, 1422107436869536, + 796239922652654, 1953934009299142 +#else + 58370664, 4489569, 9688441, 18769238, 10184608, 21191052, 29287918, + 11864899, 42594502, 29115885 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1601611775252272, 1720807796594148, 1132070835939856, + 1260455018889551, 2147779492816911 +#else + 15636272, 23865875, 24204772, 25642034, 616976, 16869170, 27787599, + 18782243, 28944399, 32004408 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 316559037616741, 2177824224946892, 1459442586438991, + 1461528397712656, 751590696113597 +#else + 16568933, 4717097, 55552716, 32452109, 15682895, 21747389, 16354576, + 21778470, 7689661, 11199574 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1850748884277385, 1200145853858453, 1068094770532492, + 672251375690438, 1586055907191707 +#else + 30464137, 27578307, 55329429, 17883566, 23220364, 15915852, 7512774, + 10017326, 49359771, 23634074 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 769950342298419, 132954430919746, 844085933195555, 974092374476333, + 726076285546016 +#else + 10861363, 11473154, 27284546, 1981175, 37044515, 12577860, 32867885, + 14515107, 51670560, 10819379 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 425251763115706, 608463272472562, 442562545713235, 837766094556764, + 374555092627893 +#else + 4708026, 6336745, 20377586, 9066809, 55836755, 6594695, 41455196, + 12483687, 54440373, 5581305 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1086255230780037, 274979815921559, 1960002765731872, + 929474102396301, 1190409889297339 +#else + 19563141, 16186464, 37722007, 4097518, 10237984, 29206317, 28542349, + 13850243, 43430843, 17738489 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 665000864555967, 2065379846933859, 370231110385876, 350988370788628, + 1233371373142985 +#else + 5153727, 9909285, 1723747, 30776558, 30523604, 5516873, 19480852, + 5230134, 43156425, 18378665 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2019367628972465, 676711900706637, 110710997811333, + 1108646842542025, 517791959672113 +#else + 36839857, 30090922, 7665485, 10083793, 28475525, 1649722, 20654025, + 16520125, 30598449, 7715701 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 965130719900578, 247011430587952, 526356006571389, 91986625355052, + 2157223321444601 +#else + 28881826, 14381568, 9657904, 3680757, 46927229, 7843315, 35708204, + 1370707, 29794553, 32145132 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1802695059465007, 1664899123557221, 593559490740857, + 2160434469266659, 927570450755031 +#else + 44589871, 26862249, 14201701, 24808930, 43598457, 8844725, 18474211, + 32192982, 54046167, 13821876 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1725674970513508, 1933645953859181, 1542344539275782, + 1767788773573747, 1297447965928905 +#else + 60653668, 25714560, 3374701, 28813570, 40010246, 22982724, 31655027, + 26342105, 18853321, 19333481 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1381809363726107, 1430341051343062, 2061843536018959, + 1551778050872521, 2036394857967624 +#else + 4566811, 20590564, 38133974, 21313742, 59506191, 30723862, 58594505, + 23123294, 2207752, 30344648 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1970894096313054, 528066325833207, 1619374932191227, + 2207306624415883, 1169170329061080 +#else + 41954014, 29368610, 29681143, 7868801, 60254203, 24130566, 54671499, + 32891431, 35997400, 17421995 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 2070390218572616, 1458919061857835, 624171843017421, + 1055332792707765, 433987520732508 +#else + 25576264, 30851218, 7349803, 21739588, 16472781, 9300885, 3844789, + 15725684, 171356, 6466918 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 893653801273833, 1168026499324677, 1242553501121234, + 1306366254304474, 1086752658510815 +#else + 23103977, 13316479, 9739013, 17404951, 817874, 18515490, 8965338, + 19466374, 36393951, 16193876 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 213454002618221, 939771523987438, 1159882208056014, 317388369627517, + 621213314200687 +#else + 33587053, 3180712, 64714734, 14003686, 50205390, 17283591, 17238397, + 4729455, 49034351, 9256799 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1971678598905747, 338026507889165, 762398079972271, 655096486107477, + 42299032696322 +#else + 41926547, 29380300, 32336397, 5036987, 45872047, 11360616, 22616405, + 9761698, 47281666, 630304 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 177130678690680, 1754759263300204, 1864311296286618, + 1180675631479880, 1292726903152791 +#else + 53388152, 2639452, 42871404, 26147950, 9494426, 27780403, 60554312, + 17593437, 64659607, 19263131 +#endif + }}, + }, + { + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1913163449625248, 460779200291993, 2193883288642314, + 1008900146920800, 1721983679009502 +#else + 63957664, 28508356, 9282713, 6866145, 35201802, 32691408, 48168288, + 15033783, 25105118, 25659556 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 1070401523076875, 1272492007800961, 1910153608563310, + 2075579521696771, 1191169788841221 +#else + 42782475, 15950225, 35307649, 18961608, 55446126, 28463506, 1573891, + 30928545, 2198789, 17749813 +#endif + }}, + {{ +#if defined(BORINGSSL_CURVE25519_64BIT) + 692896803108118, 500174642072499, 2068223309439677, + 1162190621851337, 1426986007309901 +#else + 64009494, 10324966, 64867251, 7453182, 61661885, 30818928, 53296841, + 17317989, 34647629, 21263748 +#endif + }}, + }, +}; diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h new file mode 100644 index 0000000..6160dd3 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h @@ -0,0 +1,154 @@ +// 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. + +#ifndef OPENSSL_HEADER_CURVE25519_INTERNAL_H +#define OPENSSL_HEADER_CURVE25519_INTERNAL_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include + +#include "../../crypto/internal.h" + + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) +#define BORINGSSL_X25519_NEON + +// x25519_NEON is defined in asm/x25519-arm.S. +void x25519_NEON(uint8_t out[32], const uint8_t scalar[32], + const uint8_t point[32]); +#endif + +#if defined(BORINGSSL_HAS_UINT128) +#define BORINGSSL_CURVE25519_64BIT +#endif + +#if defined(BORINGSSL_CURVE25519_64BIT) +// fe means field element. Here the field is \Z/(2^255-19). An element t, +// entries t[0]...t[4], represents the integer t[0]+2^51 t[1]+2^102 t[2]+2^153 +// t[3]+2^204 t[4]. +// fe limbs are bounded by 1.125*2^51. +// Multiplication and carrying produce fe from fe_loose. +typedef struct fe { uint64_t v[5]; } fe; + +// fe_loose limbs are bounded by 3.375*2^51. +// Addition and subtraction produce fe_loose from (fe, fe). +typedef struct fe_loose { uint64_t v[5]; } fe_loose; +#else +// fe means field element. Here the field is \Z/(2^255-19). An element t, +// entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 +// t[3]+2^102 t[4]+...+2^230 t[9]. +// fe limbs are bounded by 1.125*2^26,1.125*2^25,1.125*2^26,1.125*2^25,etc. +// Multiplication and carrying produce fe from fe_loose. +typedef struct fe { uint32_t v[10]; } fe; + +// fe_loose limbs are bounded by 3.375*2^26,3.375*2^25,3.375*2^26,3.375*2^25,etc. +// Addition and subtraction produce fe_loose from (fe, fe). +typedef struct fe_loose { uint32_t v[10]; } fe_loose; +#endif + +// ge means group element. +// +// Here the group is the set of pairs (x,y) of field elements (see fe.h) +// satisfying -x^2 + y^2 = 1 + d x^2y^2 +// where d = -121665/121666. +// +// Representations: +// ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z +// ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT +// ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T +// ge_precomp (Duif): (y+x,y-x,2dxy) + +typedef struct { + fe X; + fe Y; + fe Z; +} ge_p2; + +typedef struct { + fe X; + fe Y; + fe Z; + fe T; +} ge_p3; + +typedef struct { + fe_loose X; + fe_loose Y; + fe_loose Z; + fe_loose T; +} ge_p1p1; + +typedef struct { + fe_loose yplusx; + fe_loose yminusx; + fe_loose xy2d; +} ge_precomp; + +typedef struct { + fe_loose YplusX; + fe_loose YminusX; + fe_loose Z; + fe_loose T2d; +} ge_cached; + +void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h); +int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s); +void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p); +void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p); +void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p); +void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void x25519_ge_scalarmult_small_precomp( + ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]); +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]); +void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A); +void x25519_sc_reduce(uint8_t s[64]); + +enum spake2_state_t { + spake2_state_init = 0, + spake2_state_msg_generated, + spake2_state_key_generated, +}; + +struct spake2_ctx_st { + uint8_t private_key[32]; + uint8_t my_msg[32]; + uint8_t password_scalar[32]; + uint8_t password_hash[64]; + uint8_t *my_name; + size_t my_name_len; + uint8_t *their_name; + size_t their_name_len; + enum spake2_role_t my_role; + enum spake2_state_t state; + char disable_password_scalar_hack; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CURVE25519_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h.grpc_back new file mode 100644 index 0000000..be3e265 --- /dev/null +++ b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h.grpc_back @@ -0,0 +1,154 @@ +// 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. + +#ifndef OPENSSL_HEADER_CURVE25519_INTERNAL_H +#define OPENSSL_HEADER_CURVE25519_INTERNAL_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include + +#include "../../crypto/internal.h" + + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) +#define BORINGSSL_X25519_NEON + +// x25519_NEON is defined in asm/x25519-arm.S. +void x25519_NEON(uint8_t out[32], const uint8_t scalar[32], + const uint8_t point[32]); +#endif + +#if defined(BORINGSSL_HAS_UINT128) +#define BORINGSSL_CURVE25519_64BIT +#endif + +#if defined(BORINGSSL_CURVE25519_64BIT) +// fe means field element. Here the field is \Z/(2^255-19). An element t, +// entries t[0]...t[4], represents the integer t[0]+2^51 t[1]+2^102 t[2]+2^153 +// t[3]+2^204 t[4]. +// fe limbs are bounded by 1.125*2^51. +// Multiplication and carrying produce fe from fe_loose. +typedef struct fe { uint64_t v[5]; } fe; + +// fe_loose limbs are bounded by 3.375*2^51. +// Addition and subtraction produce fe_loose from (fe, fe). +typedef struct fe_loose { uint64_t v[5]; } fe_loose; +#else +// fe means field element. Here the field is \Z/(2^255-19). An element t, +// entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 +// t[3]+2^102 t[4]+...+2^230 t[9]. +// fe limbs are bounded by 1.125*2^26,1.125*2^25,1.125*2^26,1.125*2^25,etc. +// Multiplication and carrying produce fe from fe_loose. +typedef struct fe { uint32_t v[10]; } fe; + +// fe_loose limbs are bounded by 3.375*2^26,3.375*2^25,3.375*2^26,3.375*2^25,etc. +// Addition and subtraction produce fe_loose from (fe, fe). +typedef struct fe_loose { uint32_t v[10]; } fe_loose; +#endif + +// ge means group element. +// +// Here the group is the set of pairs (x,y) of field elements (see fe.h) +// satisfying -x^2 + y^2 = 1 + d x^2y^2 +// where d = -121665/121666. +// +// Representations: +// ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z +// ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT +// ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T +// ge_precomp (Duif): (y+x,y-x,2dxy) + +typedef struct { + fe X; + fe Y; + fe Z; +} ge_p2; + +typedef struct { + fe X; + fe Y; + fe Z; + fe T; +} ge_p3; + +typedef struct { + fe_loose X; + fe_loose Y; + fe_loose Z; + fe_loose T; +} ge_p1p1; + +typedef struct { + fe_loose yplusx; + fe_loose yminusx; + fe_loose xy2d; +} ge_precomp; + +typedef struct { + fe_loose YplusX; + fe_loose YminusX; + fe_loose Z; + fe_loose T2d; +} ge_cached; + +void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h); +int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s); +void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p); +void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p); +void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p); +void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void x25519_ge_scalarmult_small_precomp( + ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]); +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]); +void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A); +void x25519_sc_reduce(uint8_t s[64]); + +enum spake2_state_t { + spake2_state_init = 0, + spake2_state_msg_generated, + spake2_state_key_generated, +}; + +struct spake2_ctx_st { + uint8_t private_key[32]; + uint8_t my_msg[32]; + uint8_t password_scalar[32]; + uint8_t password_hash[64]; + uint8_t *my_name; + size_t my_name_len; + uint8_t *their_name; + size_t their_name_len; + enum spake2_role_t my_role; + enum spake2_state_t state; + char disable_password_scalar_hack; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CURVE25519_INTERNAL_H diff --git a/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c new file mode 100644 index 0000000..26ff9ce --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c.grpc_back new file mode 100644 index 0000000..23ec71f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h new file mode 100644 index 0000000..638eb5d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h.grpc_back new file mode 100644 index 0000000..638eb5d --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h new file mode 100644 index 0000000..7d97e0a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h.grpc_back b/SaraAttended/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h.grpc_back new file mode 100644 index 0000000..7d97e0a --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/Firebase/CoreOnly/Sources/Firebase.h b/SaraAttended/Pods/Firebase/CoreOnly/Sources/Firebase.h new file mode 100755 index 0000000..3d6ac97 --- /dev/null +++ b/SaraAttended/Pods/Firebase/CoreOnly/Sources/Firebase.h @@ -0,0 +1,81 @@ +// 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 + +#if !defined(__has_include) + #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ + import the headers individually." +#else + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + +#endif // defined(__has_include) diff --git a/SaraAttended/Pods/Firebase/CoreOnly/Sources/module.modulemap b/SaraAttended/Pods/Firebase/CoreOnly/Sources/module.modulemap new file mode 100755 index 0000000..3685b54 --- /dev/null +++ b/SaraAttended/Pods/Firebase/CoreOnly/Sources/module.modulemap @@ -0,0 +1,4 @@ +module Firebase { + export * + header "Firebase.h" +} \ No newline at end of file diff --git a/SaraAttended/Pods/Firebase/LICENSE b/SaraAttended/Pods/Firebase/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/Firebase/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/Firebase/README.md b/SaraAttended/Pods/Firebase/README.md new file mode 100644 index 0000000..7be298d --- /dev/null +++ b/SaraAttended/Pods/Firebase/README.md @@ -0,0 +1,319 @@ +[![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-appcheck-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-cocoapods-integration-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-core-diagnostics-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-google-utilities-badge]][gh-actions] +[![Actions Status][gh-google-utilities-components-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-mlmodeldownloader-badge]][gh-actions] +[![Actions Status][gh-performance-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] + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics +and FirebaseML. + +Firebase is an app development platform with tools to help you build, grow and +monetize your app. More information about Firebase can be found on the +[official Firebase website](https://firebase.google.com). + +## Installation + +See the subsections below for details about the different installation methods. +1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager](SwiftPackageManager.md) +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). + +### Swift Package Manager + +Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be +found at [SwiftPackageManager.md](SwiftPackageManager.md). + +### Installing from GitHub + +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: +```ruby +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: + +```ruby +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). + +### 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 12.2 (or later) + +CocoaPods is still the canonical way to develop, but much of the repo now supports +development with Swift Package Manager. + +### CocoaPods + +Install + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +```ruby +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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Swift Package Manager +* To enable test schemes: `./scripts/setup_spm_tests.sh` +* `open Package.swift` or double click `Package.swift` in Finder. +* Xcode will open the project + * Choose a scheme for a library to build or test suite to run + * Choose a target platform by selecting the run destination along with the scheme + +### 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/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### 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 a valid +`GoogleService-Info.plist` file. 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 add it to the Xcode project. + +### Coverage Report Generation + +See [scripts/code_coverage_report/README.md](scripts/code_coverage_report/README.md). + +## 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](FirebaseAuth/Tests/Sample/README.md) for instructions about +building and running the FirebaseAuth pod along with various samples and tests. + +### Firebase Database + +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 Performance Monitoring +If you're doing specific Firebase Performance Monitoring development, see +[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK +and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about +integrating Performance with the dev test App. + +### Firebase Storage + +To run the Storage Integration tests, follow the instructions in +[FIRStorageIntegrationTests.m](FirebaseStorage/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. + +## Building with Firebase on Apple platforms + +Firebase 8.9.0 introduces official beta support for macOS, Catalyst, and tvOS. watchOS continues +to be community supported. Thanks to community contributions for many of the multi-platform PRs. + +At this time, most of Firebase's products are available across Apple platforms. There are still +a few gaps, especially on watchOS. For details about the current support matrix, see +[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform) +in Firebase's documentation. + +### watchOS +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and +work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample). + +Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit +test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected +on watchOS. If you encounter this, please +[file an issue](https://github.com/firebase/firebase-ios-sdk/issues). + +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 watchOS. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. + +#### Additional Crashlytics Notes +* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are +not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded) + +## Combine +Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine +framework. This module is currently under development, and not yet supported for use in production +environments. Fore more details, please refer to the [docs](FirebaseCombineSwift/README.md). + +## Roadmap + +See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source +plans and directions. + +## Contributing + +See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase +Apple SDK. + +## License + +The contents of this repository are 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/). + +[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-appcheck-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/app_check/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-cocoapods-integration-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/cocoapods-integration/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-core-diagnostics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core-diagnostics/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-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg +[gh-google-utilities-components-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities-components/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-mlmodeldownloader-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/mlmodeldownloader/badge.svg +[gh-performance-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/performance/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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.h new file mode 100644 index 0000000..6429ac7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.h @@ -0,0 +1,56 @@ +/* + * 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 + +/// Values stored in analyticsEnabledState. Never alter these constants since they must match with +/// values persisted to disk. +typedef NS_ENUM(int64_t, FIRAnalyticsEnabledState) { + // 0 is the default value for keys not found stored in persisted config, so it cannot represent + // kFIRAnalyticsEnabledStateSetNo. It must represent kFIRAnalyticsEnabledStateNotSet. + kFIRAnalyticsEnabledStateNotSet = 0, + kFIRAnalyticsEnabledStateSetYes = 1, + kFIRAnalyticsEnabledStateSetNo = 2, +}; + +/// The user defaults key for the persisted measurementEnabledState value. FIRAPersistedConfig reads +/// measurementEnabledState using this same key. +static NSString *const kFIRAPersistedConfigMeasurementEnabledStateKey = + @"/google/measurement/measurement_enabled_state"; + +static NSString *const kFIRAnalyticsConfigurationSetEnabledNotification = + @"FIRAnalyticsConfigurationSetEnabledNotification"; +static NSString *const kFIRAnalyticsConfigurationSetMinimumSessionIntervalNotification = + @"FIRAnalyticsConfigurationSetMinimumSessionIntervalNotification"; +static NSString *const kFIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification = + @"FIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification"; + +@interface FIRAnalyticsConfiguration : NSObject + +/// Returns the shared instance of FIRAnalyticsConfiguration. ++ (FIRAnalyticsConfiguration *)sharedInstance; + +// Sets whether analytics collection is enabled for this app on this device. This setting is +// persisted across app sessions. By default it is enabled. +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; + +/// Sets whether analytics collection is enabled for this app on this device, and a flag to persist +/// the value or not. The setting should not be persisted if being set by the global data collection +/// flag. +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled + persistSetting:(BOOL)shouldPersist; + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m new file mode 100644 index 0000000..07c786c --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m @@ -0,0 +1,62 @@ +// 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 "FirebaseCore/Sources/FIRAnalyticsConfiguration.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" +@implementation FIRAnalyticsConfiguration +#pragma clang diagnostic pop + ++ (FIRAnalyticsConfiguration *)sharedInstance { + static FIRAnalyticsConfiguration *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[FIRAnalyticsConfiguration alloc] init]; + }); + return sharedInstance; +} + +- (void)postNotificationName:(NSString *)name value:(id)value { + if (!name.length || !value) { + return; + } + [[NSNotificationCenter defaultCenter] postNotificationName:name + object:self + userInfo:@{name : value}]; +} + +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled { + [self setAnalyticsCollectionEnabled:analyticsCollectionEnabled persistSetting:YES]; +} + +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled + persistSetting:(BOOL)shouldPersist { + // Persist the measurementEnabledState. Use FIRAnalyticsEnabledState values instead of YES/NO. + FIRAnalyticsEnabledState analyticsEnabledState = + analyticsCollectionEnabled ? kFIRAnalyticsEnabledStateSetYes : kFIRAnalyticsEnabledStateSetNo; + if (shouldPersist) { + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + [userDefaults setObject:@(analyticsEnabledState) + forKey:kFIRAPersistedConfigMeasurementEnabledStateKey]; + [userDefaults synchronize]; + } + + [self postNotificationName:kFIRAnalyticsConfigurationSetEnabledNotification + value:@(analyticsCollectionEnabled)]; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m new file mode 100644 index 0000000..05660ac --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m @@ -0,0 +1,856 @@ +// 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 + +#if __has_include() +#import +#endif + +#if __has_include() +#import +#endif + +#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/FIRFirebaseUserAgent.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 "FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h" + +#import + +#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. +NSString *const kFIRServiceAdMob; +NSString *const kFIRServiceAuth; +NSString *const kFIRServiceAuthUI; +NSString *const kFIRServiceCrash; +NSString *const kFIRServiceDatabase; +NSString *const kFIRServiceDynamicLinks; +NSString *const kFIRServiceFirestore; +NSString *const kFIRServiceFunctions; +NSString *const kFIRServiceInstanceID; +NSString *const kFIRServiceInvites; +NSString *const kFIRServiceMessaging; +NSString *const kFIRServiceMeasurement; +NSString *const kFIRServicePerformance; +NSString *const kFIRServiceRemoteConfig; +NSString *const kFIRServiceStorage; +NSString *const kGGLServiceAnalytics; +NSString *const kGGLServiceSignIn; + +NSString *const kFIRDefaultAppName = @"__FIRAPP_DEFAULT"; +NSString *const kFIRAppReadyToConfigureSDKNotification = @"FIRAppReadyToConfigureSDKNotification"; +NSString *const kFIRAppDeleteNotification = @"FIRAppDeleteNotification"; +NSString *const kFIRAppIsDefaultAppKey = @"FIRAppIsDefaultAppKey"; +NSString *const kFIRAppNameKey = @"FIRAppNameKey"; +NSString *const kFIRGoogleAppIDKey = @"FIRGoogleAppIDKey"; + +NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat = + @"/google/firebase/global_data_collection_enabled:%@"; +NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey = + @"FirebaseDataCollectionDefaultEnabled"; + +NSString *const kFIRAppDiagnosticsConfigurationTypeKey = @"ConfigType"; +NSString *const kFIRAppDiagnosticsErrorKey = @"Error"; +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 = + @"FIRAuthStateDidChangeInternalNotification"; +NSString *const FIRAuthStateDidChangeInternalNotificationAppKey = + @"FIRAuthStateDidChangeInternalNotificationAppKey"; +NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey = + @"FIRAuthStateDidChangeInternalNotificationTokenKey"; +NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey = + @"FIRAuthStateDidChangeInternalNotificationUIDKey"; + +/** + * Error domain for exceptions and NSError construction. + */ +NSString *const kFirebaseCoreErrorDomain = @"com.firebase.core"; + +/** The NSUserDefaults suite name for FirebaseCore, for those storage locations that use it. */ +NSString *const kFirebaseCoreDefaultsSuiteName = @"com.firebase.core"; + +/** + * The URL to download plist files. + */ +static NSString *const kPlistURL = @"https://console.firebase.google.com/"; + +/** + * An array of all classes that registered as `FIRCoreConfigurable` in order to receive lifecycle + * events from Core. + */ +static NSMutableArray> *sRegisteredAsConfigurable; + +@interface FIRApp () + +#ifdef DEBUG +@property(nonatomic) BOOL alreadyOutputDataCollectionFlag; +#endif // DEBUG + +@end + +@implementation FIRApp + +// This is necessary since our custom getter prevents `_options` from being created. +@synthesize options = _options; + +static NSMutableDictionary *sAllApps; +static FIRApp *sDefaultApp; + ++ (void)configure { + FIROptions *options = [FIROptions defaultOptions]; + if (!options) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"`FirebaseApp.configure()` could not find " + @"a valid GoogleService-Info.plist in your project. Please download one " + @"from %@.", + kPlistURL]; + } + [FIRApp configureWithOptions:options]; +} + ++ (void)configureWithOptions:(FIROptions *)options { + if (!options) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"Options is nil. Please pass a valid options."]; + } + [FIRApp configureWithName:kFIRDefaultAppName options:options]; +} + ++ (NSCharacterSet *)applicationNameAllowedCharacters { + static NSCharacterSet *applicationNameAllowedCharacters; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSMutableCharacterSet *allowedNameCharacters = [NSMutableCharacterSet alphanumericCharacterSet]; + [allowedNameCharacters addCharactersInString:@"-_"]; + applicationNameAllowedCharacters = [allowedNameCharacters copy]; + }); + return applicationNameAllowedCharacters; +} + ++ (void)configureWithName:(NSString *)name options:(FIROptions *)options { + if (!name || !options) { + [NSException raise:kFirebaseCoreErrorDomain format:@"Neither name nor options can be nil."]; + } + if (name.length == 0) { + [NSException raise:kFirebaseCoreErrorDomain format:@"Name cannot be empty."]; + } + + if ([name isEqualToString:kFIRDefaultAppName]) { + if (sDefaultApp) { + // 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."); + } else { + // Validate the app name and ensure it hasn't been configured already. + NSCharacterSet *nameCharacters = [NSCharacterSet characterSetWithCharactersInString:name]; + + if (![[self applicationNameAllowedCharacters] isSupersetOfSet:nameCharacters]) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"App name can only contain alphanumeric, " + @"hyphen (-), and underscore (_) characters"]; + } + + @synchronized(self) { + if (sAllApps && sAllApps[name]) { + // The app already exists. Handle a duplicate `configure` call and return. + [self appWasConfiguredTwice:sAllApps[name] usingOptions:options]; + return; + } + } + + FIRLogDebug(kFIRLoggerCore, @"I-COR000002", @"Configuring app named %@", name); + } + + @synchronized(self) { + FIRApp *app = [[FIRApp alloc] initInstanceWithName:name options:options]; + if (app.isDefaultApp) { + sDefaultApp = app; + } + + [FIRApp addAppToAppDictionary:app]; + + // The FIRApp instance is ready to go, `sDefaultApp` is assigned, other SDKs are now ready to be + // instantiated. + [app.container instantiateEagerComponents]; + [FIRApp sendNotificationsToSDKs:app]; + } +} + +/// 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; + } + FIRLogError(kFIRLoggerCore, @"I-COR000003", + @"The default Firebase app has not yet been " + @"configured. Add `FirebaseApp.configure()` to your " + @"application initialization. This can be done in " + @"in the App Delegate's application(_:didFinishLaunchingWithOptions:)` " + @"(or the `@main` struct's initializer in SwiftUI). " + @"Read more: https://goo.gl/ctyzm8."); + return nil; +} + ++ (FIRApp *)appNamed:(NSString *)name { + @synchronized(self) { + if (sAllApps) { + FIRApp *app = sAllApps[name]; + if (app) { + return app; + } + } + FIRLogError(kFIRLoggerCore, @"I-COR000004", @"App with name %@ does not exist.", name); + return nil; + } +} + ++ (NSDictionary *)allApps { + @synchronized(self) { + if (!sAllApps) { + FIRLogError(kFIRLoggerCore, @"I-COR000005", @"No app has been configured yet."); + } + return [sAllApps copy]; + } +} + +// Public only for tests ++ (void)resetApps { + @synchronized(self) { + sDefaultApp = nil; + [sAllApps removeAllObjects]; + sAllApps = nil; + [[self userAgent] reset]; + } +} + +- (void)deleteApp:(FIRAppVoidBoolCallback)completion { + @synchronized([self class]) { + 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]; + + [sAllApps removeObjectForKey:self.name]; + [self clearDataCollectionSwitchFromUserDefaults]; + if ([self.name isEqualToString:kFIRDefaultAppName]) { + sDefaultApp = nil; + } + NSDictionary *appInfoDict = @{kFIRAppNameKey : self.name}; + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppDeleteNotification + object:[self class] + userInfo:appInfoDict]; + completion(YES); + } else { + FIRLogError(kFIRLoggerCore, @"I-COR000007", @"App does not exist."); + completion(NO); + } + } +} + ++ (void)addAppToAppDictionary:(FIRApp *)app { + if (!sAllApps) { + sAllApps = [NSMutableDictionary dictionary]; + } + if ([app configureCore]) { + sAllApps[app.name] = app; + } else { + [NSException raise:kFirebaseCoreErrorDomain + format:@"Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in " + @"GoogleService-Info.plist or set in the customized options."]; + } +} + +- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options { + self = [super init]; + if (self) { + _name = [name copy]; + _options = [options copy]; + _options.editingLocked = YES; + _isDefaultApp = [name isEqualToString:kFIRDefaultAppName]; + _container = [[FIRComponentContainer alloc] initWithApp:self]; + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (BOOL)configureCore { + [self checkExpectedBundleID]; + if (![self isAppIDValid]) { + return NO; + } + + // Initialize the Analytics once there is a valid options under default app. Analytics should + // always initialize first by itself before the other SDKs. + if ([self.name isEqualToString:kFIRDefaultAppName]) { + Class firAnalyticsClass = NSClassFromString(@"FIRAnalytics"); + if (firAnalyticsClass) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + SEL startWithConfigurationSelector = @selector(startWithConfiguration:options:); +#pragma clang diagnostic pop + if ([firAnalyticsClass respondsToSelector:startWithConfigurationSelector]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [firAnalyticsClass performSelector:startWithConfigurationSelector + withObject:[FIRConfiguration sharedInstance].analyticsConfiguration + withObject:_options]; +#pragma clang diagnostic pop + } + } + } + + [self subscribeForAppDidBecomeActiveNotifications]; + + return YES; +} + +- (FIROptions *)options { + return [_options copy]; +} + +- (void)setDataCollectionDefaultEnabled:(BOOL)dataCollectionDefaultEnabled { +#ifdef DEBUG + FIRLogDebug(kFIRLoggerCore, @"I-COR000034", @"Explicitly %@ data collection flag.", + dataCollectionDefaultEnabled ? @"enabled" : @"disabled"); + self.alreadyOutputDataCollectionFlag = YES; +#endif // DEBUG + + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, self.name]; + [[NSUserDefaults standardUserDefaults] setBool:dataCollectionDefaultEnabled forKey:key]; + + // Core also controls the FirebaseAnalytics flag, so check if the Analytics flags are set + // within FIROptions and change the Analytics value if necessary. Analytics only works with the + // default app, so return if this isn't the default app. + if (!self.isDefaultApp) { + return; + } + + // Check if the Analytics flag is explicitly set. If so, no further actions are necessary. + if ([self.options isAnalyticsCollectionExplicitlySet]) { + return; + } + + // The Analytics flag has not been explicitly set, so update with the value being set. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [[FIRAnalyticsConfiguration sharedInstance] + setAnalyticsCollectionEnabled:dataCollectionDefaultEnabled + persistSetting:NO]; +#pragma clang diagnostic pop +} + +- (BOOL)isDataCollectionDefaultEnabled { + // Check if it's been manually set before in code, and use that as the higher priority value. + NSNumber *defaultsObject = [[self class] readDataCollectionSwitchFromUserDefaultsForApp:self]; + if (defaultsObject != nil) { +#ifdef DEBUG + if (!self.alreadyOutputDataCollectionFlag) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000031", @"Data Collection flag is %@ in user defaults.", + [defaultsObject boolValue] ? @"enabled" : @"disabled"); + self.alreadyOutputDataCollectionFlag = YES; + } +#endif // DEBUG + return [defaultsObject boolValue]; + } + + // Read the Info.plist to see if the flag is set. If it's not set, it should default to `YES`. + // As per the implementation of `readDataCollectionSwitchFromPlist`, it's a cached value and has + // no performance impact calling multiple times. + NSNumber *collectionEnabledPlistValue = [[self class] readDataCollectionSwitchFromPlist]; + if (collectionEnabledPlistValue != nil) { +#ifdef DEBUG + if (!self.alreadyOutputDataCollectionFlag) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000032", @"Data Collection flag is %@ in plist.", + [collectionEnabledPlistValue boolValue] ? @"enabled" : @"disabled"); + self.alreadyOutputDataCollectionFlag = YES; + } +#endif // DEBUG + return [collectionEnabledPlistValue boolValue]; + } + +#ifdef DEBUG + if (!self.alreadyOutputDataCollectionFlag) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000033", @"Data Collection flag is not set."); + self.alreadyOutputDataCollectionFlag = YES; + } +#endif // DEBUG + return YES; +} + +#pragma mark - private + ++ (void)sendNotificationsToSDKs:(FIRApp *)app { + // TODO: Remove this notification once all SDKs are registered with `FIRCoreConfigurable`. + NSNumber *isDefaultApp = [NSNumber numberWithBool:app.isDefaultApp]; + NSDictionary *appInfoDict = @{ + kFIRAppNameKey : app.name, + kFIRAppIsDefaultAppKey : isDefaultApp, + kFIRGoogleAppIDKey : app.options.googleAppID + }; + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppReadyToConfigureSDKNotification + object:self + userInfo:appInfoDict]; + + // This is the new way of sending information to SDKs. + // TODO: Do we want this on a background thread, maybe? + @synchronized(self) { + for (Class library in sRegisteredAsConfigurable) { + [library configureWithApp:app]; + } + } +} + ++ (NSError *)errorForMissingOptions { + NSDictionary *errorDict = @{ + NSLocalizedDescriptionKey : + @"Unable to parse GoogleService-Info.plist in order to configure services.", + NSLocalizedRecoverySuggestionErrorKey : + @"Check formatting and location of GoogleService-Info.plist." + }; + return [NSError errorWithDomain:kFirebaseCoreErrorDomain code:-100 userInfo:errorDict]; +} + ++ (NSError *)errorForInvalidAppID { + NSDictionary *errorDict = @{ + NSLocalizedDescriptionKey : @"Unable to validate Google App ID", + NSLocalizedRecoverySuggestionErrorKey : + @"Check formatting and location of GoogleService-Info.plist or GoogleAppID set in the " + @"customized options." + }; + return [NSError errorWithDomain:kFirebaseCoreErrorDomain code:-101 userInfo:errorDict]; +} + ++ (BOOL)isDefaultAppConfigured { + return (sDefaultApp != nil); +} + ++ (void)registerLibrary:(nonnull NSString *)name withVersion:(nonnull NSString *)version { + // Create the set of characters which aren't allowed, only if this feature is used. + NSMutableCharacterSet *allowedSet = [NSMutableCharacterSet alphanumericCharacterSet]; + [allowedSet addCharactersInString:@"-_."]; + NSCharacterSet *disallowedSet = [allowedSet invertedSet]; + // Make sure the library name and version strings do not contain unexpected characters, and + // add the name/version pair to the dictionary. + if ([name rangeOfCharacterFromSet:disallowedSet].location == NSNotFound && + [version rangeOfCharacterFromSet:disallowedSet].location == NSNotFound) { + [[self userAgent] setValue:version forComponent:name]; + } else { + FIRLogError(kFIRLoggerCore, @"I-COR000027", + @"The library name (%@) or version number (%@) contain invalid characters. " + @"Only alphanumeric, dash, underscore and period characters are allowed.", + name, version); + } +} + ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name { + [self registerInternalLibrary:library withName:name withVersion:FIRFirebaseVersion()]; +} + ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name + withVersion:(nonnull NSString *)version { + // This is called at +load time, keep the work to a minimum. + + // Ensure the class given conforms to the proper protocol. + if (![(Class)library conformsToProtocol:@protocol(FIRLibrary)] || + ![(Class)library respondsToSelector:@selector(componentsToRegister)]) { + [NSException raise:NSInvalidArgumentException + format:@"Class %@ attempted to register components, but it does not conform to " + @"`FIRLibrary or provide a `componentsToRegister:` method.", + library]; + } + + [FIRComponentContainer registerAsComponentRegistrant:library]; + if ([(Class)library respondsToSelector:@selector(configureWithApp:)]) { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sRegisteredAsConfigurable = [[NSMutableArray alloc] init]; + }); + @synchronized(self) { + [sRegisteredAsConfigurable addObject:library]; + } + } + [self registerLibrary:name withVersion:version]; +} + ++ (FIRFirebaseUserAgent *)userAgent { + static dispatch_once_t onceToken; + static FIRFirebaseUserAgent *_userAgent; + dispatch_once(&onceToken, ^{ + _userAgent = [[FIRFirebaseUserAgent alloc] init]; + [_userAgent setValue:FIRFirebaseVersion() forComponent:@"fire-ios"]; + }); + return _userAgent; +} + ++ (NSString *)firebaseUserAgent { + return [[self userAgent] firebaseUserAgent]; +} + +- (void)checkExpectedBundleID { + NSArray *bundles = [FIRBundleUtil relevantBundles]; + NSString *expectedBundleID = [self expectedBundleID]; + // The checking is only done when the bundle ID is provided in the serviceInfo dictionary for + // backward compatibility. + if (expectedBundleID != nil && ![FIRBundleUtil hasBundleIdentifierPrefix:expectedBundleID + inBundles:bundles]) { + FIRLogError(kFIRLoggerCore, @"I-COR000008", + @"The project's Bundle ID is inconsistent with " + @"either the Bundle ID in '%@.%@', or the Bundle ID in the options if you are " + @"using a customized options. To ensure that everything can be configured " + @"correctly, you may need to make the Bundle IDs consistent. To continue with this " + @"plist file, you may change your app's bundle identifier to '%@'. Or you can " + @"download a new configuration file that matches your bundle identifier from %@ " + @"and replace the current one.", + kServiceInfoFileName, kServiceInfoFileType, expectedBundleID, kPlistURL); + } +} + +#pragma mark - private - App ID Validation + +/** + * Validates the format and fingerprint of the app ID contained in GOOGLE_APP_ID in the plist file. + * This is the main method for validating app ID. + * + * @return YES if the app ID fulfills the expected format and fingerprint, NO otherwise. + */ +- (BOOL)isAppIDValid { + NSString *appID = _options.googleAppID; + BOOL isValid = [FIRApp validateAppID:appID]; + if (!isValid) { + NSString *expectedBundleID = [self expectedBundleID]; + FIRLogError(kFIRLoggerCore, @"I-COR000009", + @"The GOOGLE_APP_ID either in the plist file " + @"'%@.%@' or the one set in the customized options is invalid. If you are using " + @"the plist file, use the iOS version of bundle identifier to download the file, " + @"and do not manually edit the GOOGLE_APP_ID. You may change your app's bundle " + @"identifier to '%@'. Or you can download a new configuration file that matches " + @"your bundle identifier from %@ and replace the current one.", + kServiceInfoFileName, kServiceInfoFileType, expectedBundleID, kPlistURL); + }; + return isValid; +} + ++ (BOOL)validateAppID:(NSString *)appID { + // Failing validation only occurs when we are sure we are looking at a V2 app ID and it does not + // have a valid fingerprint, otherwise we just warn about the potential issue. + if (!appID.length) { + return NO; + } + + NSScanner *stringScanner = [NSScanner scannerWithString:appID]; + stringScanner.charactersToBeSkipped = nil; + + NSString *appIDVersion; + if (![stringScanner scanCharactersFromSet:[NSCharacterSet decimalDigitCharacterSet] + intoString:&appIDVersion]) { + return NO; + } + + if (![stringScanner scanString:@":" intoString:NULL]) { + // appIDVersion must be separated by ":" + return NO; + } + + NSArray *knownVersions = @[ @"1" ]; + if (![knownVersions containsObject:appIDVersion]) { + // Permit unknown yet properly formatted app ID versions. + FIRLogInfo(kFIRLoggerCore, @"I-COR000010", @"Unknown GOOGLE_APP_ID version: %@", appIDVersion); + return YES; + } + + if (![self validateAppIDFormat:appID withVersion:appIDVersion]) { + return NO; + } + + if (![self validateAppIDFingerprint:appID withVersion:appIDVersion]) { + return NO; + } + + return YES; +} + ++ (NSString *)actualBundleID { + return [[NSBundle mainBundle] bundleIdentifier]; +} + +/** + * Validates that the format of the app ID string is what is expected based on the supplied version. + * The version must end in ":". + * + * For v1 app ids the format is expected to be + * '::ios:'. + * + * This method does not verify that the contents of the app id are correct, just that they fulfill + * the expected format. + * + * @param appID Contents of GOOGLE_APP_ID from the plist file. + * @param version Indicates what version of the app id format this string should be. + * @return YES if provided string fufills the expected format, NO otherwise. + */ ++ (BOOL)validateAppIDFormat:(NSString *)appID withVersion:(NSString *)version { + if (!appID.length || !version.length) { + return NO; + } + + NSScanner *stringScanner = [NSScanner scannerWithString:appID]; + stringScanner.charactersToBeSkipped = nil; + + // Skip version part + // '**::ios:' + if (![stringScanner scanString:version intoString:NULL]) { + // The version part is missing or mismatched + return NO; + } + + // Validate version part (see part between '*' symbols below) + // '*:*:ios:' + if (![stringScanner scanString:@":" intoString:NULL]) { + // appIDVersion must be separated by ":" + return NO; + } + + // Validate version part (see part between '*' symbols below) + // ':**:ios:'. + NSInteger projectNumber = NSNotFound; + if (![stringScanner scanInteger:&projectNumber]) { + // NO project number found. + return NO; + } + + // Validate version part (see part between '*' symbols below) + // ':*:*ios:'. + if (![stringScanner scanString:@":" intoString:NULL]) { + // The project number must be separated by ":" + return NO; + } + + // Validate version part (see part between '*' symbols below) + // '::*ios*:'. + NSString *platform; + if (![stringScanner scanUpToString:@":" intoString:&platform]) { + return NO; + } + + if (![platform isEqualToString:@"ios"]) { + // The platform must be @"ios" + return NO; + } + + // Validate version part (see part between '*' symbols below) + // '::ios*:*'. + if (![stringScanner scanString:@":" intoString:NULL]) { + // The platform must be separated by ":" + return NO; + } + + // Validate version part (see part between '*' symbols below) + // '::ios:**'. + unsigned long long fingerprint = NSNotFound; + if (![stringScanner scanHexLongLong:&fingerprint]) { + // Fingerprint part is missing + return NO; + } + + if (!stringScanner.isAtEnd) { + // There are not allowed characters in the fingerprint part + return NO; + } + + return YES; +} + +/** + * Validates that the fingerprint of the app ID string is what is expected based on the supplied + * version. + * + * Note that the v1 hash algorithm is not permitted on the client and cannot be fully validated. + * + * @param appID Contents of GOOGLE_APP_ID from the plist file. + * @param version Indicates what version of the app id format this string should be. + * @return YES if provided string fufills the expected fingerprint and the version is known, NO + * otherwise. + */ ++ (BOOL)validateAppIDFingerprint:(NSString *)appID withVersion:(NSString *)version { + // Extract the supplied fingerprint from the supplied app ID. + // This assumes the app ID format is the same for all known versions below. If the app ID format + // changes in future versions, the tokenizing of the app ID format will need to take into account + // the version of the app ID. + NSArray *components = [appID componentsSeparatedByString:@":"]; + if (components.count != 4) { + return NO; + } + + NSString *suppliedFingerprintString = components[3]; + if (!suppliedFingerprintString.length) { + return NO; + } + + uint64_t suppliedFingerprint; + NSScanner *scanner = [NSScanner scannerWithString:suppliedFingerprintString]; + if (![scanner scanHexLongLong:&suppliedFingerprint]) { + return NO; + } + + if ([version isEqual:@"1"]) { + // The v1 hash algorithm is not permitted on the client so the actual hash cannot be validated. + return YES; + } + + // Unknown version. + return NO; +} + +- (NSString *)expectedBundleID { + return _options.bundleID; +} + +// end App ID validation + +#pragma mark - Reading From Plist & User Defaults + +/** + * Clears the data collection switch from the standard NSUserDefaults for easier testing and + * readability. + */ +- (void)clearDataCollectionSwitchFromUserDefaults { + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, self.name]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; +} + +/** + * Reads the data collection switch from the standard NSUserDefaults for easier testing and + * readability. + */ ++ (nullable NSNumber *)readDataCollectionSwitchFromUserDefaultsForApp:(FIRApp *)app { + // Read the object in user defaults, and only return if it's an NSNumber. + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, app.name]; + id collectionEnabledDefaultsObject = [[NSUserDefaults standardUserDefaults] objectForKey:key]; + if ([collectionEnabledDefaultsObject isKindOfClass:[NSNumber class]]) { + return collectionEnabledDefaultsObject; + } + + return nil; +} + +/** + * Reads the data collection switch from the Info.plist for easier testing and readability. Will + * only read once from the plist and return the cached value. + */ ++ (nullable NSNumber *)readDataCollectionSwitchFromPlist { + static NSNumber *collectionEnabledPlistObject; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // Read the data from the `Info.plist`, only assign it if it's there and an NSNumber. + id plistValue = [[NSBundle mainBundle] + objectForInfoDictionaryKey:kFIRGlobalAppDataCollectionEnabledPlistKey]; + if (plistValue && [plistValue isKindOfClass:[NSNumber class]]) { + collectionEnabledPlistObject = (NSNumber *)plistValue; + } + }); + + return collectionEnabledPlistObject; +} + +#pragma mark - App Life Cycle + +- (void)subscribeForAppDidBecomeActiveNotifications { +#if TARGET_OS_IOS || TARGET_OS_TV + NSNotificationName notificationName = UIApplicationDidBecomeActiveNotification; +#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 { + [self logCoreTelemetryIfEnabled]; +} + +- (void)logCoreTelemetryIfEnabled { + if ([self isDataCollectionDefaultEnabled]) { + dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{ + [FIRCoreDiagnosticsConnector logCoreTelemetryWithOptions:[self options]]; + }); + } +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.h new file mode 100644 index 0000000..3fc69c6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.h @@ -0,0 +1,49 @@ +/* + * 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 + +// TODO: Remove this once Auth moves over to Core's instance registration system. +/** @class FIRAppAssociationRegistration + @brief Manages object associations as a singleton-dependent: At most one object is + registered for any given host/key pair, and the object shall be created on-the-fly when + asked for. + */ +@interface FIRAppAssociationRegistration : NSObject + +/** @fn registeredObjectWithHost:key:creationBlock: + @brief Retrieves the registered object with a particular host and key. + @param host The host object. + @param key The key to specify the registered object on the host. + @param creationBlock The block to return the object to be registered if not already. + The block is executed immediately before this method returns if it is executed at all. + It can also be executed multiple times across different method invocations if previous + execution of the block returns @c nil. + @return The registered object for the host/key pair, or @c nil if no object is registered + and @c creationBlock returns @c nil. + @remarks The method is thread-safe but non-reentrant in the sense that attempting to call this + method again within the @c creationBlock with the same host/key pair raises an exception. + The registered object is retained by the host. + */ ++ (nullable ObjectType)registeredObjectWithHost:(id)host + key:(NSString *)key + creationBlock:(ObjectType _Nullable (^)(void))creationBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m new file mode 100644 index 0000000..f3f812c --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m @@ -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 "FirebaseCore/Sources/FIRAppAssociationRegistration.h" + +#import + +@implementation FIRAppAssociationRegistration + ++ (nullable id)registeredObjectWithHost:(id)host + key:(NSString *)key + creationBlock:(id _Nullable (^)(void))creationBlock { + @synchronized(self) { + SEL dictKey = @selector(registeredObjectWithHost:key:creationBlock:); + NSMutableDictionary *objectsByKey = objc_getAssociatedObject(host, dictKey); + if (!objectsByKey) { + objectsByKey = [[NSMutableDictionary alloc] init]; + objc_setAssociatedObject(host, dictKey, objectsByKey, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + id obj = objectsByKey[key]; + NSValue *creationBlockBeingCalled = [NSValue valueWithPointer:dictKey]; + if (obj) { + if ([creationBlockBeingCalled isEqual:obj]) { + [NSException raise:@"Reentering registeredObjectWithHost:key:creationBlock: not allowed" + format:@"host: %@ key: %@", host, key]; + } + return obj; + } + objectsByKey[key] = creationBlockBeingCalled; + obj = creationBlock(); + objectsByKey[key] = obj; + return obj; + } +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.h new file mode 100644 index 0000000..d9475dd --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.h @@ -0,0 +1,53 @@ +/* + * 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 + +/** + * This class provides utilities for accessing resources in bundles. + */ +@interface FIRBundleUtil : NSObject + +/** + * Finds all relevant bundles, starting with [NSBundle mainBundle]. + */ ++ (NSArray *)relevantBundles; + +/** + * Reads the options dictionary from one of the provided bundles. + * + * @param resourceName The resource name, e.g. @"GoogleService-Info". + * @param fileType The file type (extension), e.g. @"plist". + * @param bundles The bundles to expect, in priority order. See also + * +[FIRBundleUtil relevantBundles]. + */ ++ (NSString *)optionsDictionaryPathWithResourceName:(NSString *)resourceName + andFileType:(NSString *)fileType + inBundles:(NSArray *)bundles; + +/** + * Finds URL schemes defined in all relevant bundles, starting with those from + * [NSBundle mainBundle]. + */ ++ (NSArray *)relevantURLSchemes; + +/** + * Checks if any of the given bundles have a matching bundle identifier prefix (removing extension + * suffixes). + */ ++ (BOOL)hasBundleIdentifierPrefix:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles; + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m new file mode 100644 index 0000000..de2c295 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m @@ -0,0 +1,79 @@ +// 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 "FirebaseCore/Sources/FIRBundleUtil.h" + +#import + +@implementation FIRBundleUtil + ++ (NSArray *)relevantBundles { + return @[ [NSBundle mainBundle], [NSBundle bundleForClass:[self class]] ]; +} + ++ (NSString *)optionsDictionaryPathWithResourceName:(NSString *)resourceName + andFileType:(NSString *)fileType + inBundles:(NSArray *)bundles { + // Loop through all bundles to find the config dict. + for (NSBundle *bundle in bundles) { + NSString *path = [bundle pathForResource:resourceName ofType:fileType]; + // Use the first one we find. + if (path) { + return path; + } + } + return nil; +} + ++ (NSArray *)relevantURLSchemes { + NSMutableArray *result = [[NSMutableArray alloc] init]; + for (NSBundle *bundle in [[self class] relevantBundles]) { + NSArray *urlTypes = [bundle objectForInfoDictionaryKey:@"CFBundleURLTypes"]; + for (NSDictionary *urlType in urlTypes) { + [result addObjectsFromArray:urlType[@"CFBundleURLSchemes"]]; + } + } + return result; +} + ++ (BOOL)hasBundleIdentifierPrefix:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles { + for (NSBundle *bundle in bundles) { + 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; +} + ++ (NSString *)bundleIdentifierByRemovingLastPartFrom:(NSString *)bundleIdentifier { + NSString *bundleIDComponentsSeparator = @"."; + + NSMutableArray *bundleIDComponents = + [[bundleIdentifier componentsSeparatedByString:bundleIDComponentsSeparator] mutableCopy]; + [bundleIDComponents removeLastObject]; + + return [bundleIDComponents componentsJoinedByString:bundleIDComponentsSeparator]; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m new file mode 100644 index 0000000..9c1fbed --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m @@ -0,0 +1,65 @@ +/* + * 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 "FirebaseCore/Sources/Private/FIRComponent.h" + +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRDependency.h" + +@interface FIRComponent () + +- (instancetype)initWithProtocol:(Protocol *)protocol + instantiationTiming:(FIRInstantiationTiming)instantiationTiming + dependencies:(NSArray *)dependencies + creationBlock:(FIRComponentCreationBlock)creationBlock; + +@end + +@implementation FIRComponent + ++ (instancetype)componentWithProtocol:(Protocol *)protocol + creationBlock:(FIRComponentCreationBlock)creationBlock { + return [[FIRComponent alloc] initWithProtocol:protocol + instantiationTiming:FIRInstantiationTimingLazy + dependencies:@[] + creationBlock:creationBlock]; +} + ++ (instancetype)componentWithProtocol:(Protocol *)protocol + instantiationTiming:(FIRInstantiationTiming)instantiationTiming + dependencies:(NSArray *)dependencies + creationBlock:(FIRComponentCreationBlock)creationBlock { + return [[FIRComponent alloc] initWithProtocol:protocol + instantiationTiming:instantiationTiming + dependencies:dependencies + creationBlock:creationBlock]; +} + +- (instancetype)initWithProtocol:(Protocol *)protocol + instantiationTiming:(FIRInstantiationTiming)instantiationTiming + dependencies:(NSArray *)dependencies + creationBlock:(FIRComponentCreationBlock)creationBlock { + self = [super init]; + if (self) { + _protocol = protocol; + _instantiationTiming = instantiationTiming; + _dependencies = [dependencies copy]; + _creationBlock = creationBlock; + } + return self; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m new file mode 100644 index 0000000..bbe8878 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m @@ -0,0 +1,214 @@ +/* + * 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 "FirebaseCore/Sources/Private/FIRComponentContainer.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` +/// of the protocol. +@property(nonatomic, strong) NSMutableDictionary *components; + +/// Cached instances of components that requested to be cached. +@property(nonatomic, strong) NSMutableDictionary *cachedInstances; + +/// Protocols of components that have requested to be eagerly instantiated. +@property(nonatomic, strong, nullable) NSMutableArray *eagerProtocolsToInstantiate; + +@end + +@implementation FIRComponentContainer + +// Collection of all classes that register to provide components. +static NSMutableSet *sFIRComponentRegistrants; + +#pragma mark - Public Registration + ++ (void)registerAsComponentRegistrant:(Class)klass { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sFIRComponentRegistrants = [[NSMutableSet alloc] init]; + }); + + [self registerAsComponentRegistrant:klass inSet:sFIRComponentRegistrants]; +} + ++ (void)registerAsComponentRegistrant:(Class)klass + inSet:(NSMutableSet *)allRegistrants { + [allRegistrants addObject:klass]; +} + +#pragma mark - Internal Initialization + +- (instancetype)initWithApp:(FIRApp *)app { + return [self initWithApp:app registrants:sFIRComponentRegistrants]; +} + +- (instancetype)initWithApp:(FIRApp *)app registrants:(NSMutableSet *)allRegistrants { + self = [super init]; + if (self) { + _app = app; + _cachedInstances = [NSMutableDictionary dictionary]; + _components = [NSMutableDictionary dictionary]; + + [self populateComponentsFromRegisteredClasses:allRegistrants forApp:app]; + } + return self; +} + +- (void)populateComponentsFromRegisteredClasses:(NSSet *)classes forApp:(FIRApp *)app { + // Keep track of any components that need to eagerly instantiate after all components are added. + self.eagerProtocolsToInstantiate = [[NSMutableArray alloc] init]; + + // Loop through the verified component registrants and populate the components array. + for (Class klass in classes) { + // Loop through all the components being registered and store them as appropriate. + // Classes which do not provide functionality should use a dummy FIRComponentRegistrant + // protocol. + for (FIRComponent *component in [klass componentsToRegister]) { + // Check if the component has been registered before, and error out if so. + NSString *protocolName = NSStringFromProtocol(component.protocol); + if (self.components[protocolName]) { + FIRLogError(kFIRLoggerCore, @"I-COR000029", + @"Attempted to register protocol %@, but it already has an implementation.", + protocolName); + continue; + } + + // Store the creation block for later usage. + self.components[protocolName] = component.creationBlock; + + // Queue any protocols that should be eagerly instantiated. Don't instantiate them yet + // because they could depend on other components that haven't been added to the components + // array yet. + BOOL shouldInstantiateEager = + (component.instantiationTiming == FIRInstantiationTimingAlwaysEager); + BOOL shouldInstantiateDefaultEager = + (component.instantiationTiming == FIRInstantiationTimingEagerInDefaultApp && + [app isDefaultApp]); + if (shouldInstantiateEager || shouldInstantiateDefaultEager) { + [self.eagerProtocolsToInstantiate addObject:component.protocol]; + } + } + } +} + +#pragma mark - Instance Creation + +- (void)instantiateEagerComponents { + // After all components are registered, instantiate the ones that are requesting eager + // instantiation. + @synchronized(self) { + for (Protocol *protocol in self.eagerProtocolsToInstantiate) { + // Get an instance for the protocol, which will instantiate it since it couldn't have been + // cached yet. Ignore the instance coming back since we don't need it. + __unused id unusedInstance = [self instanceForProtocol:protocol]; + } + + // All eager instantiation is complete, clear the stored property now. + self.eagerProtocolsToInstantiate = nil; + } +} + +/// Instantiate an instance of a class that conforms to the specified protocol. +/// This will: +/// - Call the block to create an instance if possible, +/// - Validate that the instance returned conforms to the protocol it claims to, +/// - Cache the instance if the block requests it +/// +/// Note that this method assumes the caller already has @sychronized on self. +- (nullable id)instantiateInstanceForProtocol:(Protocol *)protocol + withBlock:(FIRComponentCreationBlock)creationBlock { + if (!creationBlock) { + return nil; + } + + // Create an instance using the creation block. + BOOL shouldCache = NO; + id instance = creationBlock(self, &shouldCache); + if (!instance) { + return nil; + } + + // An instance was created, validate that it conforms to the protocol it claims to. + NSString *protocolName = NSStringFromProtocol(protocol); + if (![instance conformsToProtocol:protocol]) { + FIRLogError(kFIRLoggerCore, @"I-COR000030", + @"An instance conforming to %@ was requested, but the instance provided does not " + @"conform to the protocol", + protocolName); + } + + // The instance is ready to be returned, but check if it should be cached first before returning. + if (shouldCache) { + self.cachedInstances[protocolName] = instance; + } + + return instance; +} + +#pragma mark - Internal Retrieval + +- (nullable id)instanceForProtocol:(Protocol *)protocol { + // Check if there is a cached instance, and return it if so. + NSString *protocolName = NSStringFromProtocol(protocol); + + id cachedInstance; + @synchronized(self) { + cachedInstance = self.cachedInstances[protocolName]; + if (!cachedInstance) { + // Use the creation block to instantiate an instance and return it. + FIRComponentCreationBlock creationBlock = self.components[protocolName]; + cachedInstance = [self instantiateInstanceForProtocol:protocol withBlock:creationBlock]; + } + } + return cachedInstance; +} + +#pragma mark - Lifecycle + +- (void)removeAllCachedInstances { + @synchronized(self) { + // Loop through the cache and notify each instance that is a maintainer to clean up after + // itself. + for (id instance in self.cachedInstances.allValues) { + if ([instance conformsToProtocol:@protocol(FIRComponentLifecycleMaintainer)] && + [instance respondsToSelector:@selector(appWillBeDeleted:)]) { + [instance appWillBeDeleted:self.app]; + } + } + + // Empty the cache. + [self.cachedInstances removeAllObjects]; + } +} + +- (void)removeAllComponents { + @synchronized(self) { + [self.components removeAllObjects]; + } +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h new file mode 100644 index 0000000..7e76413 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h @@ -0,0 +1,49 @@ +/* + * 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 "FirebaseCore/Sources/Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" + +@class FIRApp; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRComponentContainer (Private) + +/// 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 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. +- (void)instantiateEagerComponents; + +/// 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; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m new file mode 100644 index 0000000..9051336 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m @@ -0,0 +1,28 @@ +/* + * 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 "FirebaseCore/Sources/Private/FIRComponentType.h" + +#import "FirebaseCore/Sources/FIRComponentContainerInternal.h" + +@implementation FIRComponentType + ++ (id)instanceForProtocol:(Protocol *)protocol inContainer:(FIRComponentContainer *)container { + // Forward the call to the container. + return [container instanceForProtocol:protocol]; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m new file mode 100644 index 0000000..83b3248 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m @@ -0,0 +1,46 @@ +// 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 "FirebaseCore/Sources/FIRConfigurationInternal.h" + +#import "FirebaseCore/Sources/FIRAnalyticsConfiguration.h" + +extern void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel); + +@implementation FIRConfiguration + ++ (instancetype)sharedInstance { + static FIRConfiguration *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[FIRConfiguration alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _analyticsConfiguration = [FIRAnalyticsConfiguration sharedInstance]; + } + return self; +} + +- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel { + NSAssert(loggerLevel <= FIRLoggerLevelMax && loggerLevel >= FIRLoggerLevelMin, + @"Invalid logger level, %ld", (long)loggerLevel); + FIRSetLoggerLevel(loggerLevel); +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h new file mode 100644 index 0000000..9361e73 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h @@ -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. + */ + +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h" + +@class FIRAnalyticsConfiguration; + +@interface FIRConfiguration () + +/** + * The configuration class for Firebase Analytics. This should be removed once the logic for + * enabling and disabling Analytics is moved to Analytics. + */ +@property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m new file mode 100644 index 0000000..db54936 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.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/FIRCoreDiagnosticsConnector.h" + +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h" + +#import "FirebaseCore/Sources/Public/FirebaseCore/FIROptions.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; + +@implementation FIRCoreDiagnosticsConnector + ++ (void)initialize { + if (!FIRCoreDiagnosticsImplementation) { + FIRCoreDiagnosticsImplementation = NSClassFromString(@"FIRCoreDiagnostics"); + if (FIRCoreDiagnosticsImplementation) { + NSAssert([FIRCoreDiagnosticsImplementation + conformsToProtocol:@protocol(FIRCoreDiagnosticsInterop)], + @"If FIRCoreDiagnostics is implemented, it must conform to the interop protocol."); + NSAssert( + [FIRCoreDiagnosticsImplementation respondsToSelector:@selector(sendDiagnosticsData:)], + @"If FIRCoreDiagnostics is implemented, it must implement +sendDiagnosticsData."); + } + } +} + ++ (void)logCoreTelemetryWithOptions:(FIROptions *)options { + if (FIRCoreDiagnosticsImplementation) { + FIRDiagnosticsData *diagnosticsData = [[FIRDiagnosticsData alloc] init]; + [diagnosticsData insertValue:@(YES) forKey:kFIRCDIsDataCollectionDefaultEnabledKey]; + [diagnosticsData insertValue:[FIRApp firebaseUserAgent] forKey:kFIRCDFirebaseUserAgentKey]; + [diagnosticsData insertValue:@(FIRConfigTypeCore) forKey:kFIRCDConfigurationTypeKey]; + [diagnosticsData insertValue:options.googleAppID forKey:kFIRCDGoogleAppIDKey]; + [diagnosticsData insertValue:options.bundleID forKey:kFIRCDBundleIDKey]; + [diagnosticsData insertValue:@(options.usingOptionsFromDefaultPlist) + forKey:kFIRCDUsingOptionsFromDefaultPlistKey]; + [diagnosticsData insertValue:options.libraryVersionID forKey:kFIRCDLibraryVersionIDKey]; + [FIRCoreDiagnosticsImplementation sendDiagnosticsData:diagnosticsData]; + } +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m new file mode 100644 index 0000000..e1e2578 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m @@ -0,0 +1,44 @@ +/* + * 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 "FirebaseCore/Sources/Private/FIRDependency.h" + +@interface FIRDependency () + +- (instancetype)initWithProtocol:(Protocol *)protocol isRequired:(BOOL)required; + +@end + +@implementation FIRDependency + ++ (instancetype)dependencyWithProtocol:(Protocol *)protocol { + return [[self alloc] initWithProtocol:protocol isRequired:YES]; +} + ++ (instancetype)dependencyWithProtocol:(Protocol *)protocol isRequired:(BOOL)required { + return [[self alloc] initWithProtocol:protocol isRequired:required]; +} + +- (instancetype)initWithProtocol:(Protocol *)protocol isRequired:(BOOL)required { + self = [super init]; + if (self) { + _protocol = protocol; + _isRequired = required; + } + return self; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.h new file mode 100644 index 0000000..5b5ff8a --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.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 + +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Implements the FIRCoreDiagnosticsData protocol to log diagnostics data. */ +@interface FIRDiagnosticsData : NSObject + +/** Inserts values into the diagnosticObjects dictionary if the value isn't nil. + * + * @param value The value to insert if it's not nil. + * @param key The key to associate it with. + */ +- (void)insertValue:(nullable id)value forKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m new file mode 100644 index 0000000..0beed25 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m @@ -0,0 +1,66 @@ +/* + * 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/FIRDiagnosticsData.h" + +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h" + +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" + +@implementation FIRDiagnosticsData { + /** Backing ivar for the diagnosticObjects property. */ + NSMutableDictionary *_diagnosticObjects; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _diagnosticObjects = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)insertValue:(nullable id)value forKey:(NSString *)key { + if (key) { + _diagnosticObjects[key] = value; + } +} + +#pragma mark - FIRCoreDiagnosticsData + +- (NSDictionary *)diagnosticObjects { + if (!_diagnosticObjects[kFIRCDllAppsCountKey]) { + _diagnosticObjects[kFIRCDllAppsCountKey] = @([FIRApp allApps].count); + } + if (!_diagnosticObjects[kFIRCDIsDataCollectionDefaultEnabledKey]) { + _diagnosticObjects[kFIRCDIsDataCollectionDefaultEnabledKey] = + @([[FIRApp defaultApp] isDataCollectionDefaultEnabled]); + } + if (!_diagnosticObjects[kFIRCDFirebaseUserAgentKey]) { + _diagnosticObjects[kFIRCDFirebaseUserAgentKey] = [FIRApp firebaseUserAgent]; + } + return _diagnosticObjects; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +- (void)setDiagnosticObjects:(NSDictionary *)diagnosticObjects { + NSAssert(NO, @"Please use -insertValue:forKey:"); +} +#pragma clang diagnostic pop + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.h new file mode 100644 index 0000000..ffb11fb --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.h @@ -0,0 +1,36 @@ +/* + * 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 + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFirebaseUserAgent : NSObject + +/** Returns the firebase user agent which consists of environment part and the components added via + * `setValue:forComponent` method. */ +- (NSString *)firebaseUserAgent; + +/** Sets value associated with the specified component. If value is `nil` then the component is + * removed. */ +- (void)setValue:(nullable NSString *)value forComponent:(NSString *)componentName; + +/** Resets manually added components. */ +- (void)reset; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.m new file mode 100644 index 0000000..04e7566 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.m @@ -0,0 +1,107 @@ +/* + * 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 "FirebaseCore/Sources/FIRFirebaseUserAgent.h" + +#import + +@interface FIRFirebaseUserAgent () + +@property(nonatomic, readonly) NSMutableDictionary *valuesByComponent; +@property(nonatomic, readonly) NSDictionary *environmentComponents; +@property(nonatomic, readonly) NSString *firebaseUserAgent; + +@end + +@implementation FIRFirebaseUserAgent + +@synthesize firebaseUserAgent = _firebaseUserAgent; +@synthesize environmentComponents = _environmentComponents; + +- (instancetype)init { + self = [super init]; + if (self) { + _valuesByComponent = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (NSString *)firebaseUserAgent { + @synchronized(self) { + if (_firebaseUserAgent == nil) { + NSMutableDictionary *allComponents = + [self.valuesByComponent mutableCopy]; + [allComponents setValuesForKeysWithDictionary:self.environmentComponents]; + + __block NSMutableArray *components = + [[NSMutableArray alloc] initWithCapacity:self.valuesByComponent.count]; + [allComponents enumerateKeysAndObjectsUsingBlock:^( + NSString *_Nonnull name, NSString *_Nonnull value, BOOL *_Nonnull stop) { + [components addObject:[NSString stringWithFormat:@"%@/%@", name, value]]; + }]; + [components sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; + _firebaseUserAgent = [components componentsJoinedByString:@" "]; + } + return _firebaseUserAgent; + } +} + +- (void)setValue:(nullable NSString *)value forComponent:(NSString *)componentName { + @synchronized(self) { + self.valuesByComponent[componentName] = value; + // Reset cached user agent string. + _firebaseUserAgent = nil; + } +} + +- (void)reset { + @synchronized(self) { + // Reset components. + _valuesByComponent = [[[self class] environmentComponents] mutableCopy]; + // Reset cached user agent string. + _firebaseUserAgent = nil; + } +} + +#pragma mark - Environment components + +- (NSDictionary *)environmentComponents { + if (_environmentComponents == nil) { + _environmentComponents = [[self class] environmentComponents]; + } + return _environmentComponents; +} + ++ (NSDictionary *)environmentComponents { + NSMutableDictionary *components = [NSMutableDictionary dictionary]; + + NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; + NSString *xcodeVersion = info[@"DTXcodeBuild"]; + NSString *appleSdkVersion = info[@"DTSDKBuild"]; + NSString *isFromAppstoreFlagValue = [GULAppEnvironmentUtil isFromAppStore] ? @"true" : @"false"; + + components[@"apple-platform"] = [GULAppEnvironmentUtil applePlatform]; + components[@"apple-sdk"] = appleSdkVersion; + components[@"appstore"] = isFromAppstoreFlagValue; + components[@"deploy"] = [GULAppEnvironmentUtil deploymentType]; + components[@"device"] = [GULAppEnvironmentUtil deviceModel]; + components[@"os-version"] = [GULAppEnvironmentUtil systemVersion]; + components[@"xcode"] = xcodeVersion; + + return [components copy]; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m new file mode 100644 index 0000000..ef6b363 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m @@ -0,0 +1,72 @@ +// 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 +#import +#import +#import +#import "FirebaseCore/Sources/Private/FIRAppInternal.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 kHeartbeatStorageName = @"HEARTBEAT_INFO_STORAGE"; + id dataStorage; +#if TARGET_OS_TV + NSUserDefaults *defaults = + [[NSUserDefaults alloc] initWithSuiteName:kFirebaseCoreDefaultsSuiteName]; + dataStorage = + [[GULHeartbeatDateStorageUserDefaults alloc] initWithDefaults:defaults + key:kHeartbeatStorageName]; +#else + dataStorage = [[GULHeartbeatDateStorage alloc] initWithFileName:kHeartbeatStorageName]; +#endif + 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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m new file mode 100644 index 0000000..6707a96 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m @@ -0,0 +1,174 @@ +// 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 "FirebaseCore/Sources/Private/FIRLogger.h" + +#import +#import +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h" + +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h" + +FIRLoggerService kFIRLoggerCore = @"[Firebase/Core]"; + +// All the FIRLoggerService definitions should be migrated to clients. Do not add new ones! +FIRLoggerService kFIRLoggerAnalytics = @"[Firebase/Analytics]"; +FIRLoggerService kFIRLoggerCrash = @"[Firebase/Crash]"; +FIRLoggerService kFIRLoggerRemoteConfig = @"[Firebase/RemoteConfig]"; + +/// Arguments passed on launch. +NSString *const kFIRDisableDebugModeApplicationArgument = @"-FIRDebugDisabled"; +NSString *const kFIREnableDebugModeApplicationArgument = @"-FIRDebugEnabled"; +NSString *const kFIRLoggerForceSDTERRApplicationArgument = @"-FIRLoggerForceSTDERR"; + +/// Key for the debug mode bit in NSUserDefaults. +NSString *const kFIRPersistedDebugModeKey = @"/google/firebase/debug_mode"; + +/// NSUserDefaults that should be used to store and read variables. If nil, `standardUserDefaults` +/// will be used. +static NSUserDefaults *sFIRLoggerUserDefaults; + +static dispatch_once_t sFIRLoggerOnceToken; + +// The sFIRAnalyticsDebugMode flag is here to support the -FIRDebugEnabled/-FIRDebugDisabled +// flags used by Analytics. Users who use those flags expect Analytics to log verbosely, +// while the rest of Firebase logs at the default level. This flag is introduced to support +// that behavior. +static BOOL sFIRAnalyticsDebugMode; + +#ifdef DEBUG +/// The regex pattern for the message code. +static NSString *const kMessageCodePattern = @"^I-[A-Z]{3}[0-9]{6}$"; +static NSRegularExpression *sMessageCodeRegex; +#endif + +void FIRLoggerInitializeASL(void) { + dispatch_once(&sFIRLoggerOnceToken, ^{ + // Register Firebase Version with GULLogger. + GULLoggerRegisterVersion(FIRFirebaseVersion()); + + // Override the aslOptions to ASL_OPT_STDERR if the override argument is passed in. + NSArray *arguments = [NSProcessInfo processInfo].arguments; + BOOL overrideSTDERR = [arguments containsObject:kFIRLoggerForceSDTERRApplicationArgument]; + + // Use the standard NSUserDefaults if it hasn't been explicitly set. + if (sFIRLoggerUserDefaults == nil) { + sFIRLoggerUserDefaults = [NSUserDefaults standardUserDefaults]; + } + + BOOL forceDebugMode = NO; + BOOL debugMode = [sFIRLoggerUserDefaults boolForKey:kFIRPersistedDebugModeKey]; + if ([arguments containsObject:kFIRDisableDebugModeApplicationArgument]) { // Default mode + [sFIRLoggerUserDefaults removeObjectForKey:kFIRPersistedDebugModeKey]; + } else if ([arguments containsObject:kFIREnableDebugModeApplicationArgument] || + debugMode) { // Debug mode + [sFIRLoggerUserDefaults setBool:YES forKey:kFIRPersistedDebugModeKey]; + forceDebugMode = YES; + } + GULLoggerInitializeASL(); + if (overrideSTDERR) { + GULLoggerEnableSTDERR(); + } + if (forceDebugMode) { + GULLoggerForceDebug(); + } + }); +} + +__attribute__((no_sanitize("thread"))) void FIRSetAnalyticsDebugMode(BOOL analyticsDebugMode) { + sFIRAnalyticsDebugMode = analyticsDebugMode; +} + +void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel) { + FIRLoggerInitializeASL(); + GULSetLoggerLevel((GULLoggerLevel)loggerLevel); +} + +#ifdef DEBUG +void FIRResetLogger(void) { + extern void GULResetLogger(void); + sFIRLoggerOnceToken = 0; + [sFIRLoggerUserDefaults removeObjectForKey:kFIRPersistedDebugModeKey]; + sFIRLoggerUserDefaults = nil; + GULResetLogger(); +} + +void FIRSetLoggerUserDefaults(NSUserDefaults *defaults) { + sFIRLoggerUserDefaults = defaults; +} +#endif + +/** + * Check if the level is high enough to be loggable. + * + * Analytics can override the log level with an intentional race condition. + * Add the attribute to get a clean thread sanitizer run. + */ +__attribute__((no_sanitize("thread"))) BOOL FIRIsLoggableLevel(FIRLoggerLevel loggerLevel, + BOOL analyticsComponent) { + FIRLoggerInitializeASL(); + if (sFIRAnalyticsDebugMode && analyticsComponent) { + return YES; + } + return GULIsLoggableLevel((GULLoggerLevel)loggerLevel); +} + +void FIRLogBasic(FIRLoggerLevel level, + FIRLoggerService service, + NSString *messageCode, + NSString *message, + va_list args_ptr) { + FIRLoggerInitializeASL(); + GULLogBasic((GULLoggerLevel)level, service, + sFIRAnalyticsDebugMode && [kFIRLoggerAnalytics isEqualToString:service], messageCode, + message, args_ptr); +} + +/** + * Generates the logging functions using macros. + * + * Calling FIRLogError(kFIRLoggerCore, @"I-COR000001", @"Configure %@ failed.", @"blah") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [Firebase/Core][I-COR000001] Configure blah failed. + * Calling FIRLogDebug(kFIRLoggerCore, @"I-COR000001", @"Configure succeed.") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [Firebase/Core][I-COR000001] Configure succeed. + */ +#define FIR_LOGGING_FUNCTION(level) \ + void FIRLog##level(FIRLoggerService service, NSString *messageCode, NSString *message, ...) { \ + va_list args_ptr; \ + va_start(args_ptr, message); \ + FIRLogBasic(FIRLoggerLevel##level, service, messageCode, message, args_ptr); \ + va_end(args_ptr); \ + } + +FIR_LOGGING_FUNCTION(Error) +FIR_LOGGING_FUNCTION(Warning) +FIR_LOGGING_FUNCTION(Notice) +FIR_LOGGING_FUNCTION(Info) +FIR_LOGGING_FUNCTION(Debug) + +#undef FIR_MAKE_LOGGER + +#pragma mark - FIRLoggerWrapper + +@implementation FIRLoggerWrapper + ++ (void)logWithLevel:(FIRLoggerLevel)level + withService:(FIRLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args { + FIRLogBasic(level, service, messageCode, message, args); +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m new file mode 100644 index 0000000..e66b4e6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m @@ -0,0 +1,498 @@ +// 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 "FirebaseCore/Sources/FIRBundleUtil.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h" + +// Keys for the strings in the plist file. +NSString *const kFIRAPIKey = @"API_KEY"; +NSString *const kFIRTrackingID = @"TRACKING_ID"; +NSString *const kFIRGoogleAppID = @"GOOGLE_APP_ID"; +NSString *const kFIRClientID = @"CLIENT_ID"; +NSString *const kFIRGCMSenderID = @"GCM_SENDER_ID"; +NSString *const kFIRAndroidClientID = @"ANDROID_CLIENT_ID"; +NSString *const kFIRDatabaseURL = @"DATABASE_URL"; +NSString *const kFIRStorageBucket = @"STORAGE_BUCKET"; +// The key to locate the expected bundle identifier in the plist file. +NSString *const kFIRBundleID = @"BUNDLE_ID"; +// The key to locate the project identifier in the plist file. +NSString *const kFIRProjectID = @"PROJECT_ID"; + +NSString *const kFIRIsMeasurementEnabled = @"IS_MEASUREMENT_ENABLED"; +NSString *const kFIRIsAnalyticsCollectionEnabled = @"FIREBASE_ANALYTICS_COLLECTION_ENABLED"; +NSString *const kFIRIsAnalyticsCollectionDeactivated = @"FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED"; + +NSString *const kFIRIsAnalyticsEnabled = @"IS_ANALYTICS_ENABLED"; +NSString *const kFIRIsSignInEnabled = @"IS_SIGNIN_ENABLED"; + +// Library version ID formatted like: +// @"5" // Major version (one or more digits) +// @"04" // Minor version (exactly 2 digits) +// @"01" // Build number (exactly 2 digits) +// @"000"; // Fixed "000" +NSString *kFIRLibraryVersionID; + +// Plist file name. +NSString *const kServiceInfoFileName = @"GoogleService-Info"; +// Plist file type. +NSString *const kServiceInfoFileType = @"plist"; + +// Exception raised from attempting to modify a FIROptions after it's been copied to a FIRApp. +NSString *const kFIRExceptionBadModification = + @"Attempted to modify options after it's set on FIRApp. Please modify all properties before " + @"initializing FIRApp."; + +@interface FIROptions () + +/** + * This property maintains the actual configuration key-value pairs. + */ +@property(nonatomic, readwrite) NSMutableDictionary *optionsDictionary; + +/** + * Calls `analyticsOptionsDictionaryWithInfoDictionary:` using [NSBundle mainBundle].infoDictionary. + * It combines analytics options from both the infoDictionary and the GoogleService-Info.plist. + * Values which are present in the main plist override values from the GoogleService-Info.plist. + */ +@property(nonatomic, readonly) NSDictionary *analyticsOptionsDictionary; + +/** + * Combination of analytics options from both the infoDictionary and the GoogleService-Info.plist. + * Values which are present in the infoDictionary override values from the GoogleService-Info.plist. + */ +- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary; + +/** + * Throw exception if editing is locked when attempting to modify an option. + */ +- (void)checkEditingLocked; + +@end + +@implementation FIROptions { + /// Backing variable for self.analyticsOptionsDictionary. + NSDictionary *_analyticsOptionsDictionary; +} + +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 { + dispatch_once(&sDefaultOptionsOnceToken, ^{ + NSDictionary *defaultOptionsDictionary = [self defaultOptionsDictionary]; + if (defaultOptionsDictionary != nil) { + sDefaultOptions = + [[FIROptions alloc] initInternalWithOptionsDictionary:defaultOptionsDictionary]; + } + }); + + return sDefaultOptions; +} + +#pragma mark - Private class methods + ++ (NSDictionary *)defaultOptionsDictionary { + 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; +} + +// Returns the path of the plist file with a given file name. ++ (NSString *)plistFilePathWithName:(NSString *)fileName { + NSArray *bundles = [FIRBundleUtil relevantBundles]; + NSString *plistFilePath = + [FIRBundleUtil optionsDictionaryPathWithResourceName:fileName + andFileType:kServiceInfoFileType + inBundles:bundles]; + if (plistFilePath == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000012", @"Could not locate configuration file: '%@.%@'.", + fileName, kServiceInfoFileType); + } + return plistFilePath; +} + ++ (void)resetDefaultOptions { + sDefaultOptions = nil; + sDefaultOptionsDictionary = nil; + sDefaultOptionsOnceToken = 0; + sDefaultOptionsDictionaryOnceToken = 0; +} + +#pragma mark - Private instance methods + +- (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)optionsDictionary { + self = [super init]; + if (self) { + _optionsDictionary = [optionsDictionary mutableCopy]; + _usingOptionsFromDefaultPlist = YES; + } + return self; +} + +- (id)copyWithZone:(NSZone *)zone { + FIROptions *newOptions = [(FIROptions *)[[self class] allocWithZone:zone] + initInternalWithOptionsDictionary:self.optionsDictionary]; + if (newOptions) { + newOptions.deepLinkURLScheme = self.deepLinkURLScheme; + newOptions.appGroupID = self.appGroupID; + newOptions.editingLocked = self.isEditingLocked; + newOptions.usingOptionsFromDefaultPlist = self.usingOptionsFromDefaultPlist; + } + return newOptions; +} + +#pragma mark - Public instance methods + +- (instancetype)init { + // Unavailable. + [self doesNotRecognizeSelector:_cmd]; + return nil; +} + +- (instancetype)initWithContentsOfFile:(NSString *)plistPath { + self = [super init]; + if (self) { + if (plistPath == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000013", @"The plist file path is nil."); + return nil; + } + _optionsDictionary = [[NSDictionary dictionaryWithContentsOfFile:plistPath] mutableCopy]; + if (_optionsDictionary == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000014", + @"The configuration file at %@ does not exist or " + @"is not a well-formed plist file.", + plistPath); + return nil; + } + // TODO: Do we want to validate the dictionary here? It says we do that already in + // the public header. + } + return self; +} + +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID GCMSenderID:(NSString *)GCMSenderID { + self = [super init]; + if (self) { + NSMutableDictionary *mutableOptionsDict = [NSMutableDictionary dictionary]; + [mutableOptionsDict setValue:googleAppID forKey:kFIRGoogleAppID]; + [mutableOptionsDict setValue:GCMSenderID forKey:kFIRGCMSenderID]; + [mutableOptionsDict setValue:[[NSBundle mainBundle] bundleIdentifier] forKey:kFIRBundleID]; + self.optionsDictionary = mutableOptionsDict; + } + return self; +} + +- (NSString *)APIKey { + return self.optionsDictionary[kFIRAPIKey]; +} + +- (void)checkEditingLocked { + if (self.isEditingLocked) { + [NSException raise:kFirebaseCoreErrorDomain format:kFIRExceptionBadModification]; + } +} + +- (void)setAPIKey:(NSString *)APIKey { + [self checkEditingLocked]; + _optionsDictionary[kFIRAPIKey] = [APIKey copy]; +} + +- (NSString *)clientID { + return self.optionsDictionary[kFIRClientID]; +} + +- (void)setClientID:(NSString *)clientID { + [self checkEditingLocked]; + _optionsDictionary[kFIRClientID] = [clientID copy]; +} + +- (NSString *)trackingID { + return self.optionsDictionary[kFIRTrackingID]; +} + +- (void)setTrackingID:(NSString *)trackingID { + [self checkEditingLocked]; + _optionsDictionary[kFIRTrackingID] = [trackingID copy]; +} + +- (NSString *)GCMSenderID { + return self.optionsDictionary[kFIRGCMSenderID]; +} + +- (void)setGCMSenderID:(NSString *)GCMSenderID { + [self checkEditingLocked]; + _optionsDictionary[kFIRGCMSenderID] = [GCMSenderID copy]; +} + +- (NSString *)projectID { + return self.optionsDictionary[kFIRProjectID]; +} + +- (void)setProjectID:(NSString *)projectID { + [self checkEditingLocked]; + _optionsDictionary[kFIRProjectID] = [projectID copy]; +} + +- (NSString *)androidClientID { + return self.optionsDictionary[kFIRAndroidClientID]; +} + +- (void)setAndroidClientID:(NSString *)androidClientID { + [self checkEditingLocked]; + _optionsDictionary[kFIRAndroidClientID] = [androidClientID copy]; +} + +- (NSString *)googleAppID { + return self.optionsDictionary[kFIRGoogleAppID]; +} + +- (void)setGoogleAppID:(NSString *)googleAppID { + [self checkEditingLocked]; + _optionsDictionary[kFIRGoogleAppID] = [googleAppID copy]; +} + +- (NSString *)libraryVersionID { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // The unit tests are set up to catch anything that does not properly convert. + NSString *version = FIRFirebaseVersion(); + NSArray *components = [version componentsSeparatedByString:@"."]; + NSString *major = [components objectAtIndex:0]; + NSString *minor = [NSString stringWithFormat:@"%02d", [[components objectAtIndex:1] intValue]]; + NSString *patch = [NSString stringWithFormat:@"%02d", [[components objectAtIndex:2] intValue]]; + kFIRLibraryVersionID = [NSString stringWithFormat:@"%@%@%@000", major, minor, patch]; + }); + return kFIRLibraryVersionID; +} + +- (void)setLibraryVersionID:(NSString *)libraryVersionID { + _optionsDictionary[kFIRLibraryVersionID] = [libraryVersionID copy]; +} + +- (NSString *)databaseURL { + return self.optionsDictionary[kFIRDatabaseURL]; +} + +- (void)setDatabaseURL:(NSString *)databaseURL { + [self checkEditingLocked]; + + _optionsDictionary[kFIRDatabaseURL] = [databaseURL copy]; +} + +- (NSString *)storageBucket { + return self.optionsDictionary[kFIRStorageBucket]; +} + +- (void)setStorageBucket:(NSString *)storageBucket { + [self checkEditingLocked]; + _optionsDictionary[kFIRStorageBucket] = [storageBucket copy]; +} + +- (void)setDeepLinkURLScheme:(NSString *)deepLinkURLScheme { + [self checkEditingLocked]; + _deepLinkURLScheme = [deepLinkURLScheme copy]; +} + +- (NSString *)bundleID { + return self.optionsDictionary[kFIRBundleID]; +} + +- (void)setBundleID:(NSString *)bundleID { + [self checkEditingLocked]; + _optionsDictionary[kFIRBundleID] = [bundleID copy]; +} + +- (void)setAppGroupID:(NSString *)appGroupID { + [self checkEditingLocked]; + _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 { + if (_analyticsOptionsDictionary == nil) { + NSMutableDictionary *tempAnalyticsOptions = [[NSMutableDictionary alloc] init]; + NSArray *measurementKeys = @[ + kFIRIsMeasurementEnabled, kFIRIsAnalyticsCollectionEnabled, + kFIRIsAnalyticsCollectionDeactivated + ]; + for (NSString *key in measurementKeys) { + id value = infoDictionary[key] ?: self.optionsDictionary[key] ?: nil; + if (!value) { + continue; + } + tempAnalyticsOptions[key] = value; + } + _analyticsOptionsDictionary = tempAnalyticsOptions; + } + return _analyticsOptionsDictionary; +} + +- (NSDictionary *)analyticsOptionsDictionary { + return [self analyticsOptionsDictionaryWithInfoDictionary:[NSBundle mainBundle].infoDictionary]; +} + +/** + * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in + * GoogleService-Info.plist. This uses the old plist flag IS_MEASUREMENT_ENABLED, which should still + * be supported. + */ +- (BOOL)isMeasurementEnabled { + if (self.isAnalyticsCollectionDeactivated) { + return NO; + } + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsMeasurementEnabled]; + if (value == nil) { + // TODO: This could probably be cleaned up since FIROptions shouldn't know about FIRApp or have + // to check if it's the default app. The FIROptions instance can't be modified after + // `+configure` is called, so it's not a good place to copy it either in case the flag is + // changed at runtime. + + // If no values are set for Analytics, fall back to the global collection switch in FIRApp. + // Analytics only supports the default FIRApp, so check that first. + if (![FIRApp isDefaultAppConfigured]) { + return NO; + } + + // Fall back to the default app's collection switch when the key is not in the dictionary. + return [FIRApp defaultApp].isDataCollectionDefaultEnabled; + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsCollectionExplicitlySet { + // If it's de-activated, it classifies as explicity set. If not, it's not a good enough indication + // that the developer wants FirebaseAnalytics enabled so continue checking. + if (self.isAnalyticsCollectionDeactivated) { + return YES; + } + + // Check if the current Analytics flag is set. + id collectionEnabledObject = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionEnabled]; + if (collectionEnabledObject && [collectionEnabledObject isKindOfClass:[NSNumber class]]) { + // It doesn't matter what the value is, it's explicitly set. + return YES; + } + + // Check if the old measurement flag is set. + id measurementEnabledObject = self.analyticsOptionsDictionary[kFIRIsMeasurementEnabled]; + if (measurementEnabledObject && [measurementEnabledObject isKindOfClass:[NSNumber class]]) { + // It doesn't matter what the value is, it's explicitly set. + return YES; + } + + // No flags are set to explicitly enable or disable FirebaseAnalytics. + return NO; +} + +- (BOOL)isAnalyticsCollectionEnabled { + if (self.isAnalyticsCollectionDeactivated) { + return NO; + } + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionEnabled]; + if (value == nil) { + return self.isMeasurementEnabled; // Fall back to older plist flag. + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsCollectionDeactivated { + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionDeactivated]; + if (value == nil) { + return NO; // Analytics Collection is not deactivated when the key is not in the dictionary. + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsEnabled { + return [self.optionsDictionary[kFIRIsAnalyticsEnabled] boolValue]; +} + +- (BOOL)isSignInEnabled { + return [self.optionsDictionary[kFIRIsSignInEnabled] boolValue]; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.m b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.m new file mode 100644 index 0000000..f458a3a --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.m @@ -0,0 +1,32 @@ +/* + * 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 "FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h" + +#ifndef Firebase_VERSION +#error "Firebase_VERSION is not defined: add -DFirebase_VERSION=... to the build invocation" +#endif + +// The following two macros supply the incantation so that the C +// preprocessor does not try to parse the version as a floating +// point number. See +// https://www.guyrutenberg.com/2008/12/20/expanding-macros-into-string-constants-in-c/ +#define STR(x) STR_EXPAND(x) +#define STR_EXPAND(x) #x + +NSString* FIRFirebaseVersion(void) { + return @STR(Firebase_VERSION); +} diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h new file mode 100644 index 0000000..6c7d723 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h @@ -0,0 +1,153 @@ +/* + * 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 + +@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; +extern NSString *const kFirebaseCoreErrorDomain; + +/** The NSUserDefaults suite name for FirebaseCore, for those storage locations that use it. */ +extern NSString *const kFirebaseCoreDefaultsSuiteName; + +/** + * 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; + +/** @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; + +/** + * 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 to be reported for analytics. + * + * @param library Optional parameter for component registration. + * @param name Name of the library. + */ ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name; + +/** + * Registers a given internal library with the given version number to be reported for + * analytics. This should only be used for non-Firebase libraries that have their own versioning + * scheme. + * + * @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; + +/** + * 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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponent.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponent.h new file mode 100644 index 0000000..cb51ee7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h new file mode 100644 index 0000000..af18a93 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h @@ -0,0 +1,41 @@ +/* + * 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 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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentType.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentType.h new file mode 100644 index 0000000..6f2aca7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h new file mode 100644 index 0000000..76c0c05 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRDependency.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRDependency.h new file mode 100644 index 0000000..46e9b7e --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h new file mode 100644 index 0000000..9f94256 --- /dev/null +++ b/SaraAttended/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 required 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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h new file mode 100644 index 0000000..9575e94 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h @@ -0,0 +1,44 @@ +/* + * 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 + +@class FIRApp; +@class FIRComponent; + +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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLogger.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLogger.h new file mode 100644 index 0000000..b6242ff --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLogger.h @@ -0,0 +1,146 @@ +/* + * 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 kFIRLoggerAnalytics; +extern FIRLoggerService kFIRLoggerCrash; +extern FIRLoggerService kFIRLoggerCore; +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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIROptionsInternal.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIROptionsInternal.h new file mode 100644 index 0000000..8efc5fc --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIROptionsInternal.h @@ -0,0 +1,115 @@ +/* + * 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 + NS_DESIGNATED_INITIALIZER; + +/** + * 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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h new file mode 100644 index 0000000..88d012b --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h @@ -0,0 +1,28 @@ +// 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/FIRComponentType.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/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h new file mode 100644 index 0000000..f5578c6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h @@ -0,0 +1,127 @@ +/* + * 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 + +@class FIROptions; + +NS_ASSUME_NONNULL_BEGIN + +/** A block that takes a BOOL and has no return value. */ +typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback); + +/** + * The entry point of Firebase SDKs. + * + * Initialize and configure FIRApp using +[FIRApp configure] + * or other customized ways as shown below. + * + * The logging system has two modes: default mode and debug mode. In default mode, only logs with + * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent + * to device. The log levels that Firebase uses are consistent with the ASL log levels. + * + * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this + * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, + * further executions of the application will also be in debug mode. In order to return to default + * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. + * + * It is also possible to change the default logging level in code by calling setLoggerLevel: on + * the FIRConfiguration interface. + */ +NS_SWIFT_NAME(FirebaseApp) +@interface FIRApp : NSObject + +/** + * 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 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 should be + * called from the main thread. + * + * @param options The Firebase application options used to configure the service. + */ ++ (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:)); + +/** + * Configures a Firebase app with the given name and options. Raises an exception if any + * 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. + * @param options The Firebase application options used to configure the services. + */ +// clang-format off ++ (void)configureWithName:(NSString *)name + options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:)); +// clang-format on + +/** + * Returns the default app, or nil if the default app does not exist. + */ ++ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app()); + +/** + * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. + * This method is thread safe. + */ ++ (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:)); + +/** + * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This + * method is thread safe. + */ +@property(class, readonly, nullable) NSDictionary *allApps; + +/** + * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for + * future use. This method is thread safe. + */ +- (void)deleteApp:(FIRAppVoidBoolCallback)completion; + +/** + * FIRApp instances should not be initialized directly. Call +[FIRApp configure], + * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. + */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Gets the name of this app. + */ +@property(nonatomic, copy, readonly) NSString *name; + +/** + * Gets a copy of the options for this app. These are non-modifiable. + */ +@property(nonatomic, copy, readonly) FIROptions *options; + +/** + * Gets or sets whether automatic data collection is enabled for all products. Defaults to `YES` + * unless `FirebaseDataCollectionDefaultEnabled` is set to `NO` in your app's Info.plist. This value + * is persisted across runs of the app so that it can be set once when users have consented to + * collection. + */ +@property(nonatomic, readwrite, getter=isDataCollectionDefaultEnabled) + BOOL dataCollectionDefaultEnabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h new file mode 100644 index 0000000..2b8e678 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h @@ -0,0 +1,45 @@ +/* + * 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 "FIRLoggerLevel.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * This interface provides global level properties that the developer can tweak. + */ +NS_SWIFT_NAME(FirebaseConfiguration) +@interface FIRConfiguration : NSObject + +/** Returns the shared configuration object. */ +@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance NS_SWIFT_NAME(shared); + +/** + * Sets the logging level for internal Firebase logging. Firebase will only log messages + * that are logged at or below loggerLevel. The messages are logged both to the Xcode + * console and to the device's log. Note that if an app is running from AppStore, it will + * never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose) + * setting. + * + * @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice. + */ +- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h new file mode 100644 index 0000000..dca3aa0 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Note that importing GULLoggerLevel.h will lead to a non-modular header +// import error. + +/** + * The log levels used by internal logging. + */ +typedef NS_ENUM(NSInteger, FIRLoggerLevel) { + /** Error level, matches ASL_LEVEL_ERR. */ + FIRLoggerLevelError = 3, + /** Warning level, matches ASL_LEVEL_WARNING. */ + FIRLoggerLevelWarning = 4, + /** Notice level, matches ASL_LEVEL_NOTICE. */ + FIRLoggerLevelNotice = 5, + /** Info level, matches ASL_LEVEL_INFO. */ + FIRLoggerLevelInfo = 6, + /** Debug level, matches ASL_LEVEL_DEBUG. */ + FIRLoggerLevelDebug = 7, + /** Minimum log level. */ + FIRLoggerLevelMin = FIRLoggerLevelError, + /** Maximum log level. */ + FIRLoggerLevelMax = FIRLoggerLevelDebug +} NS_SWIFT_NAME(FirebaseLoggerLevel); diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h new file mode 100644 index 0000000..afabbf1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h @@ -0,0 +1,126 @@ +/* + * 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 + +/** + * This class provides constant fields of Google APIs. + */ +NS_SWIFT_NAME(FirebaseOptions) +@interface FIROptions : NSObject + +/** + * Returns the default options. The first time this is called it synchronously reads + * GoogleService-Info.plist from disk. + */ ++ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions()); + +/** + * An iOS API key used for authenticating requests from your app, e.g. + * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. + */ +@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey); + +/** + * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set + * manually or in a plist. + */ +@property(nonatomic, copy) NSString *bundleID; + +/** + * The OAuth2 client ID for iOS application used to authenticate Google users, for example + * @"12345.apps.googleusercontent.com", used for signing in with Google. + */ +@property(nonatomic, copy, nullable) NSString *clientID; + +/** + * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. + */ +@property(nonatomic, copy, nullable) NSString *trackingID; + +/** + * The Project Number from the Google Developer's console, for example @"012345678901", used to + * configure Google Cloud Messaging. + */ +@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID); + +/** + * The Project ID from the Firebase console, for example @"abc-xyz-123". + */ +@property(nonatomic, copy, nullable) NSString *projectID; + +/** + * The Android client ID used in Google AppInvite when an iOS app has its Android version, for + * example @"12345.apps.googleusercontent.com". + */ +@property(nonatomic, copy, nullable) NSString *androidClientID; + +/** + * The Google App ID that is used to uniquely identify an instance of an app. + */ +@property(nonatomic, copy) NSString *googleAppID; + +/** + * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". + */ +@property(nonatomic, copy, nullable) NSString *databaseURL; + +/** + * The URL scheme used to set up Durable Deep Link service. + */ +@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; + +/** + * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". + */ +@property(nonatomic, copy, nullable) NSString *storageBucket; + +/** + * The App Group identifier to share data between the application and the application extensions. + * The App Group must be configured in the application and on the Apple Developer Portal. Default + * value `nil`. + */ +@property(nonatomic, copy, nullable) NSString *appGroupID; + +/** + * Initializes a customized instance of FIROptions from the file at the given plist file path. This + * will read the file synchronously from disk. + * For example, + * NSString *filePath = + * [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; + * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; + * Returns nil if the plist file does not exist or is invalid. + */ +- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a customized instance of FIROptions with required fields. Use the mutable properties + * to modify fields for configuring specific services. + */ +// clang-format off +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID + GCMSenderID:(NSString *)GCMSenderID + NS_SWIFT_NAME(init(googleAppID:gcmSenderID:)) NS_DESIGNATED_INITIALIZER; +// clang-format on + +/** Unavailable. Please use `init(contentsOfFile:)` or `init(googleAppID:gcmSenderID:)` instead. */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h new file mode 100644 index 0000000..651edaf --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h @@ -0,0 +1,25 @@ +/* + * 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 + +NS_ASSUME_NONNULL_BEGIN + +/** Returns the current version of Firebase. */ +NS_SWIFT_NAME(FirebaseVersion()) +NSString* FIRFirebaseVersion(void); + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h new file mode 100644 index 0000000..680d604 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h @@ -0,0 +1,21 @@ +/* + * 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 "FIRApp.h" +#import "FIRConfiguration.h" +#import "FIRLoggerLevel.h" +#import "FIROptions.h" +#import "FIRVersion.h" diff --git a/SaraAttended/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h b/SaraAttended/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h new file mode 100644 index 0000000..69c4072 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h b/SaraAttended/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h new file mode 100644 index 0000000..2b0eb71 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/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/SaraAttended/Pods/FirebaseCore/LICENSE b/SaraAttended/Pods/FirebaseCore/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/FirebaseCore/README.md b/SaraAttended/Pods/FirebaseCore/README.md new file mode 100644 index 0000000..7be298d --- /dev/null +++ b/SaraAttended/Pods/FirebaseCore/README.md @@ -0,0 +1,319 @@ +[![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-appcheck-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-cocoapods-integration-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-core-diagnostics-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-google-utilities-badge]][gh-actions] +[![Actions Status][gh-google-utilities-components-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-mlmodeldownloader-badge]][gh-actions] +[![Actions Status][gh-performance-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] + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics +and FirebaseML. + +Firebase is an app development platform with tools to help you build, grow and +monetize your app. More information about Firebase can be found on the +[official Firebase website](https://firebase.google.com). + +## Installation + +See the subsections below for details about the different installation methods. +1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager](SwiftPackageManager.md) +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). + +### Swift Package Manager + +Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be +found at [SwiftPackageManager.md](SwiftPackageManager.md). + +### Installing from GitHub + +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: +```ruby +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: + +```ruby +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). + +### 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 12.2 (or later) + +CocoaPods is still the canonical way to develop, but much of the repo now supports +development with Swift Package Manager. + +### CocoaPods + +Install + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +```ruby +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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Swift Package Manager +* To enable test schemes: `./scripts/setup_spm_tests.sh` +* `open Package.swift` or double click `Package.swift` in Finder. +* Xcode will open the project + * Choose a scheme for a library to build or test suite to run + * Choose a target platform by selecting the run destination along with the scheme + +### 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/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### 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 a valid +`GoogleService-Info.plist` file. 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 add it to the Xcode project. + +### Coverage Report Generation + +See [scripts/code_coverage_report/README.md](scripts/code_coverage_report/README.md). + +## 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](FirebaseAuth/Tests/Sample/README.md) for instructions about +building and running the FirebaseAuth pod along with various samples and tests. + +### Firebase Database + +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 Performance Monitoring +If you're doing specific Firebase Performance Monitoring development, see +[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK +and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about +integrating Performance with the dev test App. + +### Firebase Storage + +To run the Storage Integration tests, follow the instructions in +[FIRStorageIntegrationTests.m](FirebaseStorage/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. + +## Building with Firebase on Apple platforms + +Firebase 8.9.0 introduces official beta support for macOS, Catalyst, and tvOS. watchOS continues +to be community supported. Thanks to community contributions for many of the multi-platform PRs. + +At this time, most of Firebase's products are available across Apple platforms. There are still +a few gaps, especially on watchOS. For details about the current support matrix, see +[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform) +in Firebase's documentation. + +### watchOS +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and +work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample). + +Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit +test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected +on watchOS. If you encounter this, please +[file an issue](https://github.com/firebase/firebase-ios-sdk/issues). + +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 watchOS. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. + +#### Additional Crashlytics Notes +* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are +not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded) + +## Combine +Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine +framework. This module is currently under development, and not yet supported for use in production +environments. Fore more details, please refer to the [docs](FirebaseCombineSwift/README.md). + +## Roadmap + +See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source +plans and directions. + +## Contributing + +See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase +Apple SDK. + +## License + +The contents of this repository are 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/). + +[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-appcheck-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/app_check/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-cocoapods-integration-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/cocoapods-integration/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-core-diagnostics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core-diagnostics/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-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg +[gh-google-utilities-components-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities-components/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-mlmodeldownloader-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/mlmodeldownloader/badge.svg +[gh-performance-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/performance/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/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m new file mode 100644 index 0000000..c06da7f --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m @@ -0,0 +1,551 @@ +/* + * 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 +#include + +#import + +#import +#import +#import + +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h" +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h" + +#import +#import +#import + +#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]"; + +#ifdef FIREBASE_BUILD_ZIP_FILE +static BOOL kUsingZipFile = YES; +#else // FIREBASE_BUILD_ZIP_FILE +static BOOL kUsingZipFile = NO; +#endif // FIREBASE_BUILD_ZIP_FILE + +#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 +#else +#define kDeploymentType logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_COCOAPODS +#endif + +static NSString *const kFIRServiceMLModelInterpreter = @"MLModelInterpreter"; + +static NSString *const kFIRServiceAdMob = @"AdMob"; +static NSString *const kFIRServiceAuth = @"Auth"; +static NSString *const kFIRServiceAuthUI = @"AuthUI"; +static NSString *const kFIRServiceCrash = @"Crash"; +static NSString *const kFIRServiceDatabase = @"Database"; +static NSString *const kFIRServiceDynamicLinks = @"DynamicLinks"; +static NSString *const kFIRServiceFirestore = @"Firestore"; +static NSString *const kFIRServiceFunctions = @"Functions"; +static NSString *const kFIRServiceIAM = @"InAppMessaging"; +static NSString *const kFIRServiceInstanceID = @"InstanceID"; +static NSString *const kFIRServiceInvites = @"Invites"; +static NSString *const kFIRServiceMessaging = @"Messaging"; +static NSString *const kFIRServiceMeasurement = @"Measurement"; +static NSString *const kFIRServicePerformance = @"Performance"; +static NSString *const kFIRServiceRemoteConfig = @"RemoteConfig"; +static NSString *const kFIRServiceStorage = @"Storage"; +static NSString *const kGGLServiceAnalytics = @"Analytics"; +static NSString *const kGGLServiceSignIn = @"SignIn"; +static NSString *const kFIRAppDiagnosticsConfigurationTypeKey = + @"FIRAppDiagnosticsConfigurationTypeKey"; +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. + */ +NSString *const kFIRCoreDiagnosticsHeartbeatDateFileName = @"FIREBASE_DIAGNOSTICS_HEARTBEAT_DATE"; + +/** + * @note This should implement the GDTCOREventDataObject protocol, but can't because of + * weak-linking. + */ +@interface FIRCoreDiagnosticsLog : NSObject + +/** The config that will be converted to proto bytes. */ +@property(nonatomic) logs_proto_mobilesdk_ios_ICoreConfiguration config; + +@end + +@implementation FIRCoreDiagnosticsLog + +- (instancetype)initWithConfig:(logs_proto_mobilesdk_ios_ICoreConfiguration)config { + self = [super init]; + if (self) { + _config = config; + } + return self; +} + +// Provided and required by the GDTCOREventDataObject protocol. +- (NSData *)transportBytes { + pb_ostream_t sizestream = PB_OSTREAM_SIZING; + + // Encode 1 time to determine the size. + if (!pb_encode(&sizestream, logs_proto_mobilesdk_ios_ICoreConfiguration_fields, &_config)) { + GDTCORLogError(GDTCORMCETransportBytesError, @"Error in nanopb encoding for size: %s", + PB_GET_ERROR(&sizestream)); + } + + // 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", + PB_GET_ERROR(&ostream)); + } + CFDataSetLength(dataRef, ostream.bytes_written); + + return CFBridgingRelease(dataRef); +} + +- (void)dealloc { + pb_release(logs_proto_mobilesdk_ios_ICoreConfiguration_fields, &_config); +} + +@end + +NS_ASSUME_NONNULL_BEGIN + +/** This class produces a protobuf containing diagnostics and usage data to be logged. */ +@interface FIRCoreDiagnostics : NSObject + +/** The queue on which all diagnostics collection will occur. */ +@property(nonatomic, readonly) dispatch_queue_t diagnosticsQueue; + +/** The transport object used to send data. */ +@property(nonatomic, readonly) GDTCORTransport *transport; + +/** The storage to store the date of the last sent heartbeat. */ +@property(nonatomic, readonly) GULHeartbeatDateStorage *heartbeatDateStorage; + +@end + +NS_ASSUME_NONNULL_END + +@implementation FIRCoreDiagnostics + ++ (instancetype)sharedInstance { + static FIRCoreDiagnostics *sharedInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[FIRCoreDiagnostics alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + GDTCORTransport *transport = [[GDTCORTransport alloc] initWithMappingID:@"137" + transformers:nil + target:kGDTCORTargetFLL]; + + GULHeartbeatDateStorage *dateStorage = + [[GULHeartbeatDateStorage alloc] initWithFileName:kFIRCoreDiagnosticsHeartbeatDateFileName]; + + return [self initWithTransport:transport heartbeatDateStorage:dateStorage]; +} + +/** Initializer for unit tests. + * + * @param transport A `GDTCORTransport` instance which that be used to send event. + * @param heartbeatDateStorage An instanse of date storage to track heartbeat sending. + * @return Returns the initialized `FIRCoreDiagnostics` instance. + */ +- (instancetype)initWithTransport:(GDTCORTransport *)transport + heartbeatDateStorage:(GULHeartbeatDateStorage *)heartbeatDateStorage { + self = [super init]; + if (self) { + _diagnosticsQueue = + dispatch_queue_create("com.google.FIRCoreDiagnostics", DISPATCH_QUEUE_SERIAL); + _transport = transport; + _heartbeatDateStorage = heartbeatDateStorage; + } + return self; +} + +#pragma mark - nanopb helper functions + +/** 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. + */ +pb_bytes_array_t *FIREncodeString(NSString *string) { + NSData *stringBytes = [string dataUsingEncoding:NSUTF8StringEncoding]; + return FIREncodeData(stringBytes); +} + +/** 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 *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. + * + * @param serviceString The SDK service string to convert. + * @return The representative nanopb enum. + */ +logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType FIRMapFromServiceStringToTypeEnum( + NSString *serviceString) { + static NSDictionary *serviceStringToTypeEnum; + if (serviceStringToTypeEnum == nil) { + serviceStringToTypeEnum = @{ + kFIRServiceAdMob : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ADMOB), + kFIRServiceMessaging : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MESSAGING), + kFIRServiceMeasurement : + @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MEASUREMENT), + kFIRServiceRemoteConfig : + @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_REMOTE_CONFIG), + kFIRServiceDatabase : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_DATABASE), + kFIRServiceDynamicLinks : + @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_DYNAMIC_LINKS), + kFIRServiceAuth : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_AUTH), + kFIRServiceAuthUI : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_AUTH_UI), + kFIRServiceFirestore : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_FIRESTORE), + kFIRServiceFunctions : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_FUNCTIONS), + kFIRServicePerformance : + @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_PERFORMANCE), + kFIRServiceStorage : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_STORAGE), + kFIRServiceMLModelInterpreter : + @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_MODEL_INTERPRETER), + kGGLServiceAnalytics : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ANALYTICS), + kGGLServiceSignIn : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_SIGN_IN), + kFIRServiceIAM : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_IN_APP_MESSAGING), + }; + } + if (serviceStringToTypeEnum[serviceString] != nil) { + return (int32_t)serviceStringToTypeEnum[serviceString].longLongValue; + } + return logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_UNKNOWN_SDK_SERVICE; +} + +#pragma mark - Proto population functions + +/** Populates the given proto with data related to an SDK logDiagnostics call from the + * diagnosticObjects dictionary. + * + * @param config The proto to populate + * @param diagnosticObjects The dictionary of diagnostics objects. + */ +void FIRPopulateProtoWithInfoFromUserInfoParams(logs_proto_mobilesdk_ios_ICoreConfiguration *config, + NSDictionary *diagnosticObjects) { + NSNumber *configurationType = diagnosticObjects[kFIRCDConfigurationTypeKey]; + if (configurationType != nil) { + switch (configurationType.integerValue) { + case logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_CORE: + config->configuration_type = + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_CORE; + config->has_configuration_type = 1; + break; + case logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_SDK: + config->configuration_type = + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_SDK; + config->has_configuration_type = 1; + break; + default: + break; + } + } + + NSString *sdkName = diagnosticObjects[kFIRCDSdkNameKey]; + if (sdkName) { + config->sdk_name = FIRMapFromServiceStringToTypeEnum(sdkName); + config->has_sdk_name = 1; + } + + NSString *version = diagnosticObjects[kFIRCDSdkVersionKey]; + if (version) { + config->sdk_version = FIREncodeString(version); + } +} + +/** Populates the given proto with data from the calling FIRApp using the given + * diagnosticObjects dictionary. + * + * @param config The proto to populate + * @param diagnosticObjects The dictionary of diagnostics objects. + */ +void FIRPopulateProtoWithCommonInfoFromApp(logs_proto_mobilesdk_ios_ICoreConfiguration *config, + NSDictionary *diagnosticObjects) { + config->pod_name = logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_FIREBASE; + config->has_pod_name = 1; + + if (!diagnosticObjects[kFIRCDllAppsCountKey]) { + GDTCORLogError(GDTCORMCEGeneralError, @"%@", + @"App count is a required value in the data dict."); + } + config->app_count = (int32_t)[diagnosticObjects[kFIRCDllAppsCountKey] integerValue]; + config->has_app_count = 1; + + NSString *googleAppID = diagnosticObjects[kFIRCDGoogleAppIDKey]; + if (googleAppID.length) { + config->app_id = FIREncodeString(googleAppID); + } + + NSString *bundleID = diagnosticObjects[kFIRCDBundleIDKey]; + if (bundleID.length) { + config->bundle_id = FIREncodeString(bundleID); + } + + NSString *firebaseUserAgent = diagnosticObjects[kFIRCDFirebaseUserAgentKey]; + if (firebaseUserAgent.length) { + config->platform_info = FIREncodeString(firebaseUserAgent); + } + + NSNumber *usingOptionsFromDefaultPlist = diagnosticObjects[kFIRCDUsingOptionsFromDefaultPlistKey]; + if (usingOptionsFromDefaultPlist != nil) { + config->use_default_app = [usingOptionsFromDefaultPlist boolValue]; + config->has_use_default_app = 1; + } + + NSString *libraryVersionID = diagnosticObjects[kFIRCDLibraryVersionIDKey]; + if (libraryVersionID) { + config->icore_version = FIREncodeString(libraryVersionID); + } + + NSString *deviceModel = [GULAppEnvironmentUtil deviceModel]; + if (deviceModel.length) { + config->device_model = FIREncodeString(deviceModel); + } + + NSString *osVersion = [GULAppEnvironmentUtil systemVersion]; + if (osVersion.length) { + config->os_version = FIREncodeString(osVersion); + } + + config->using_zip_file = kUsingZipFile; + config->has_using_zip_file = 1; + config->deployment_type = kDeploymentType; + config->has_deployment_type = 1; + config->deployed_in_app_store = [GULAppEnvironmentUtil isFromAppStore]; + config->has_deployed_in_app_store = 1; +} + +/** Populates the given proto with installed services data. + * + * @param config The proto to populate + */ +void FIRPopulateProtoWithInstalledServices(logs_proto_mobilesdk_ios_ICoreConfiguration *config) { + NSMutableArray *sdkServiceInstalledArray = [NSMutableArray array]; + + // AdMob + if (NSClassFromString(@"GADBannerView") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceAdMob))]; + } + // CloudMessaging + if (NSClassFromString(@"FIRMessaging") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMessaging))]; + } + // RemoteConfig + if (NSClassFromString(@"FIRRemoteConfig") != nil) { + [sdkServiceInstalledArray + addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceRemoteConfig))]; + } + // Measurement/Analtyics + if (NSClassFromString(@"FIRAnalytics") != nil) { + [sdkServiceInstalledArray + addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMeasurement))]; + } + // ML Model Interpreter + if (NSClassFromString(@"FIRCustomModelInterpreter") != nil) { + [sdkServiceInstalledArray + addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLModelInterpreter))]; + } + // Database + if (NSClassFromString(@"FIRDatabase") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceDatabase))]; + } + // DynamicDeepLink + if (NSClassFromString(@"FIRDynamicLinks") != nil) { + [sdkServiceInstalledArray + addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceDynamicLinks))]; + } + // Auth + if (NSClassFromString(@"FIRAuth") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceAuth))]; + } + // AuthUI + if (NSClassFromString(@"FUIAuth") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceAuthUI))]; + } + // Firestore + if (NSClassFromString(@"FIRFirestore") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceFirestore))]; + } + // Functions + if (NSClassFromString(@"FIRFunctions") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceFunctions))]; + } + // Performance + if (NSClassFromString(@"FIRPerformance") != nil) { + [sdkServiceInstalledArray + addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServicePerformance))]; + } + // Storage + if (NSClassFromString(@"FIRStorage") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceStorage))]; + } + // SignIn via Google pod + if (NSClassFromString(@"GIDSignIn") != nil && NSClassFromString(@"GGLContext") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kGGLServiceSignIn))]; + } + // Analytics via Google pod + if (NSClassFromString(@"GAI") != nil && NSClassFromString(@"GGLContext") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kGGLServiceAnalytics))]; + } + + // In-App Messaging + if (NSClassFromString(@"FIRInAppMessaging") != nil) { + [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceIAM))]; + } + + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType *servicesInstalled = + 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 = + (int32_t)typeEnum.integerValue; + servicesInstalled[i] = serviceType; + } + + config->sdk_service_installed = servicesInstalled; + config->sdk_service_installed_count = (int32_t)sdkServiceInstalledArray.count; +} + +/** Populates the proto with Info.plist values. + * + * @param config The proto to populate. + */ +void FIRPopulateProtoWithInfoPlistValues(logs_proto_mobilesdk_ios_ICoreConfiguration *config) { + NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; + + NSString *xcodeVersion = info[@"DTXcodeBuild"] ?: @""; + NSString *sdkVersion = info[@"DTSDKBuild"] ?: @""; + NSString *combinedVersions = [NSString stringWithFormat:@"%@-%@", xcodeVersion, sdkVersion]; + config->apple_framework_version = FIREncodeString(combinedVersions); + + NSString *minVersion = info[@"MinimumOSVersion"]; + if (minVersion) { + config->min_supported_ios_version = FIREncodeString(minVersion); + } + + // Apps can turn off swizzling in the Info.plist, check if they've explicitly set the value and + // report it. It's enabled by default. + NSNumber *appDelegateSwizzledNum = info[@"FirebaseAppDelegateProxyEnabled"]; + BOOL appDelegateSwizzled = YES; + if ([appDelegateSwizzledNum isKindOfClass:[NSNumber class]]) { + appDelegateSwizzled = [appDelegateSwizzledNum boolValue]; + } + config->swizzling_enabled = appDelegateSwizzled; + config->has_swizzling_enabled = 1; +} + +#pragma mark - FIRCoreDiagnosticsInterop + ++ (void)sendDiagnosticsData:(nonnull id)diagnosticsData { + FIRCoreDiagnostics *diagnostics = [FIRCoreDiagnostics sharedInstance]; + [diagnostics sendDiagnosticsData:diagnosticsData]; +} + +- (void)sendDiagnosticsData:(nonnull id)diagnosticsData { + dispatch_async(self.diagnosticsQueue, ^{ + NSDictionary *diagnosticObjects = diagnosticsData.diagnosticObjects; + NSNumber *isDataCollectionDefaultEnabled = + diagnosticObjects[kFIRCDIsDataCollectionDefaultEnabledKey]; + if (isDataCollectionDefaultEnabled && ![isDataCollectionDefaultEnabled boolValue]) { + return; + } + + // Create the proto. + logs_proto_mobilesdk_ios_ICoreConfiguration icore_config = + logs_proto_mobilesdk_ios_ICoreConfiguration_init_default; + + icore_config.using_gdt = 1; + icore_config.has_using_gdt = 1; + + // Populate the proto with information. + FIRPopulateProtoWithInfoFromUserInfoParams(&icore_config, diagnosticObjects); + FIRPopulateProtoWithCommonInfoFromApp(&icore_config, diagnosticObjects); + FIRPopulateProtoWithInstalledServices(&icore_config); + FIRPopulateProtoWithInfoPlistValues(&icore_config); + [self setHeartbeatFlagIfNeededToConfig:&icore_config]; + + // This log object is capable of converting the proto to bytes. + FIRCoreDiagnosticsLog *log = [[FIRCoreDiagnosticsLog alloc] initWithConfig:icore_config]; + + // Send the log as a telemetry event. + GDTCOREvent *event = [self.transport eventForTransport]; + event.dataObject = (id)log; + [self.transport sendTelemetryEvent:event]; + }); +} + +#pragma mark - Heartbeat + +- (void)setHeartbeatFlagIfNeededToConfig:(logs_proto_mobilesdk_ios_ICoreConfiguration *)config { + // Check if need to send a heartbeat. + NSDate *currentDate = [NSDate 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]) { + return; + } + } + + // Update heartbeat sent date. + [self.heartbeatDateStorage setHearbeatDate:currentDate forTag:kFIRCoreDiagnosticsHeartbeatTag]; + // Set the flag. + config->sdk_name = logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ICORE; + config->has_sdk_name = 1; +} + +- (BOOL)isDate:(NSDate *)date1 inSameDayOrBeforeThan:(NSDate *)date2 { + return [[NSCalendar currentCalendar] isDate:date1 inSameDayAsDate:date2] || + [date1 compare:date2] == NSOrderedAscending; +} + +@end diff --git a/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c new file mode 100644 index 0000000..2a9a622 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c @@ -0,0 +1,60 @@ +/* + * 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.7 */ + +#include "firebasecore.nanopb.h" + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + + +const pb_field_t logs_proto_mobilesdk_ios_ICoreConfiguration_fields[22] = { + PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, logs_proto_mobilesdk_ios_ICoreConfiguration, configuration_type, configuration_type, 0), + PB_FIELD( 7, UENUM , REPEATED, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, sdk_service_installed, configuration_type, 0), + PB_FIELD( 9, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, device_model, sdk_service_installed, 0), + PB_FIELD( 10, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, app_id, device_model, 0), + PB_FIELD( 12, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, bundle_id, app_id, 0), + PB_FIELD( 16, UENUM , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, pod_name, bundle_id, 0), + PB_FIELD( 18, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, icore_version, pod_name, 0), + PB_FIELD( 19, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, sdk_version, icore_version, 0), + PB_FIELD( 20, UENUM , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, sdk_name, sdk_version, 0), + PB_FIELD( 21, INT32 , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, app_count, sdk_name, 0), + PB_FIELD( 22, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, os_version, app_count, 0), + PB_FIELD( 24, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, min_supported_ios_version, os_version, 0), + PB_FIELD( 25, BOOL , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, use_default_app, min_supported_ios_version, 0), + PB_FIELD( 26, BOOL , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, deployed_in_app_store, use_default_app, 0), + PB_FIELD( 27, INT32 , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, dynamic_framework_count, deployed_in_app_store, 0), + PB_FIELD( 28, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, apple_framework_version, dynamic_framework_count, 0), + PB_FIELD( 29, BOOL , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, using_zip_file, apple_framework_version, 0), + PB_FIELD( 30, UENUM , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, deployment_type, using_zip_file, 0), + PB_FIELD( 31, BYTES , OPTIONAL, POINTER , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, platform_info, deployment_type, 0), + PB_FIELD( 33, BOOL , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, swizzling_enabled, platform_info, 0), + PB_FIELD( 36, BOOL , OPTIONAL, STATIC , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, using_gdt, swizzling_enabled, 0), + PB_LAST_FIELD +}; + + + + + + + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h new file mode 100644 index 0000000..ac92211 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h @@ -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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.7 */ + +#ifndef PB_LOGS_PROTO_MOBILESDK_IOS_FIREBASECORE_NANOPB_H_INCLUDED +#define PB_LOGS_PROTO_MOBILESDK_IOS_FIREBASECORE_NANOPB_H_INCLUDED +#include + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType { + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_UNKNOWN_CONFIGURATION_TYPE = 0, + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_CORE = 1, + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_SDK = 2 +} logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType; +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_MIN logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_UNKNOWN_CONFIGURATION_TYPE +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_MAX logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_SDK +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_ARRAYSIZE ((logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType)(logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_SDK+1)) + +typedef enum _logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType { + logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_UNKNOWN_BUILD_TYPE = 0, + logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_INTERNAL = 1, + logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_EAP = 2, + logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_PROD = 3 +} logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType; +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_MIN logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_UNKNOWN_BUILD_TYPE +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_MAX logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_PROD +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_ARRAYSIZE ((logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType)(logs_proto_mobilesdk_ios_ICoreConfiguration_BuildType_PROD+1)) + +typedef enum _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType { + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_UNKNOWN_SDK_SERVICE = 0, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ICORE = 1, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ADMOB = 2, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_APP_INVITE = 3, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_SIGN_IN = 5, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_GCM = 6, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MAPS = 7, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_SCION = 8, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ANALYTICS = 9, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_APP_INDEXING = 10, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_CONFIG = 11, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_DURABLE_DEEP_LINKS = 12, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_CRASH = 13, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_AUTH = 14, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_DATABASE = 15, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_STORAGE = 16, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MESSAGING = 17, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MEASUREMENT = 18, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_REMOTE_CONFIG = 19, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_DYNAMIC_LINKS = 20, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_INVITES = 21, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_AUTH_UI = 22, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_FIRESTORE = 23, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_PERFORMANCE = 24, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_FACE = 26, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_BARCODE = 27, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_TEXT = 28, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_LABEL = 29, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_MODEL_INTERPRETER = 30, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_IN_APP_MESSAGING = 31, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_FUNCTIONS = 32, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_NATURAL_LANGUAGE = 33, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_AUTOML = 34, + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_OBJECT_DETECTION = 35 +} logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType; +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MIN logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_UNKNOWN_SDK_SERVICE +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MAX logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_OBJECT_DETECTION +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ARRAYSIZE ((logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType)(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_OBJECT_DETECTION+1)) + +typedef enum _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName { + logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_UNKNOWN_POD_NAME = 0, + logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_GOOGLE = 1, + logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_FIREBASE = 2 +} logs_proto_mobilesdk_ios_ICoreConfiguration_PodName; +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_MIN logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_UNKNOWN_POD_NAME +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_MAX logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_FIREBASE +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_ARRAYSIZE ((logs_proto_mobilesdk_ios_ICoreConfiguration_PodName)(logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_FIREBASE+1)) + +typedef enum _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType { + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_UNKNOWN = 0, + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_COCOAPODS = 1, + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_ZIP_FILE = 2, + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_CARTHAGE = 3, + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_SPM = 4 +} logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType; +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_MIN logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_UNKNOWN +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_MAX logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_SPM +#define _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_ARRAYSIZE ((logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType)(logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_SPM+1)) + +/* Struct definitions */ +typedef struct _logs_proto_mobilesdk_ios_ICoreConfiguration { + bool has_configuration_type; + logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType configuration_type; + pb_size_t sdk_service_installed_count; + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType *sdk_service_installed; + pb_bytes_array_t *device_model; + pb_bytes_array_t *app_id; + pb_bytes_array_t *bundle_id; + bool has_pod_name; + logs_proto_mobilesdk_ios_ICoreConfiguration_PodName pod_name; + pb_bytes_array_t *icore_version; + pb_bytes_array_t *sdk_version; + bool has_sdk_name; + logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType sdk_name; + bool has_app_count; + int32_t app_count; + pb_bytes_array_t *os_version; + pb_bytes_array_t *min_supported_ios_version; + bool has_use_default_app; + bool use_default_app; + bool has_deployed_in_app_store; + bool deployed_in_app_store; + bool has_dynamic_framework_count; + int32_t dynamic_framework_count; + pb_bytes_array_t *apple_framework_version; + bool has_using_zip_file; + bool using_zip_file; + bool has_deployment_type; + logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType deployment_type; + pb_bytes_array_t *platform_info; + bool has_swizzling_enabled; + bool swizzling_enabled; + bool has_using_gdt; + bool using_gdt; +/* @@protoc_insertion_point(struct:logs_proto_mobilesdk_ios_ICoreConfiguration) */ +} logs_proto_mobilesdk_ios_ICoreConfiguration; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define logs_proto_mobilesdk_ios_ICoreConfiguration_init_default {false, _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_MIN, 0, NULL, NULL, NULL, NULL, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_MIN, NULL, NULL, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MIN, false, 0, NULL, NULL, false, 0, false, 0, false, 0, NULL, false, 0, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_MIN, NULL, false, 0, false, 0} +#define logs_proto_mobilesdk_ios_ICoreConfiguration_init_zero {false, _logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_MIN, 0, NULL, NULL, NULL, NULL, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_PodName_MIN, NULL, NULL, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_MIN, false, 0, NULL, NULL, false, 0, false, 0, false, 0, NULL, false, 0, false, _logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_MIN, NULL, false, 0, false, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define logs_proto_mobilesdk_ios_ICoreConfiguration_pod_name_tag 16 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_configuration_type_tag 1 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_icore_version_tag 18 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_sdk_version_tag 19 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_sdk_service_installed_tag 7 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_sdk_name_tag 20 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_device_model_tag 9 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_os_version_tag 22 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_app_id_tag 10 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_bundle_id_tag 12 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_min_supported_ios_version_tag 24 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_use_default_app_tag 25 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_app_count_tag 21 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_deployed_in_app_store_tag 26 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_dynamic_framework_count_tag 27 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_apple_framework_version_tag 28 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_using_zip_file_tag 29 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_deployment_type_tag 30 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_platform_info_tag 31 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_swizzling_enabled_tag 33 +#define logs_proto_mobilesdk_ios_ICoreConfiguration_using_gdt_tag 36 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t logs_proto_mobilesdk_ios_ICoreConfiguration_fields[22]; + +/* Maximum encoded size of messages (where known) */ +/* logs_proto_mobilesdk_ios_ICoreConfiguration_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define FIREBASECORE_MESSAGES \ + + +#endif + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnostics.h b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnostics.h new file mode 100644 index 0000000..5076d6b --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnostics.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/SaraAttended/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h b/SaraAttended/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h new file mode 100644 index 0000000..69c4072 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h b/SaraAttended/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h new file mode 100644 index 0000000..2b0eb71 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseCoreDiagnostics/LICENSE b/SaraAttended/Pods/FirebaseCoreDiagnostics/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/FirebaseCoreDiagnostics/README.md b/SaraAttended/Pods/FirebaseCoreDiagnostics/README.md new file mode 100644 index 0000000..7be298d --- /dev/null +++ b/SaraAttended/Pods/FirebaseCoreDiagnostics/README.md @@ -0,0 +1,319 @@ +[![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-appcheck-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-cocoapods-integration-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-core-diagnostics-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-google-utilities-badge]][gh-actions] +[![Actions Status][gh-google-utilities-components-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-mlmodeldownloader-badge]][gh-actions] +[![Actions Status][gh-performance-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] + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics +and FirebaseML. + +Firebase is an app development platform with tools to help you build, grow and +monetize your app. More information about Firebase can be found on the +[official Firebase website](https://firebase.google.com). + +## Installation + +See the subsections below for details about the different installation methods. +1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager](SwiftPackageManager.md) +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). + +### Swift Package Manager + +Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be +found at [SwiftPackageManager.md](SwiftPackageManager.md). + +### Installing from GitHub + +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: +```ruby +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: + +```ruby +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). + +### 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 12.2 (or later) + +CocoaPods is still the canonical way to develop, but much of the repo now supports +development with Swift Package Manager. + +### CocoaPods + +Install + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +```ruby +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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Swift Package Manager +* To enable test schemes: `./scripts/setup_spm_tests.sh` +* `open Package.swift` or double click `Package.swift` in Finder. +* Xcode will open the project + * Choose a scheme for a library to build or test suite to run + * Choose a target platform by selecting the run destination along with the scheme + +### 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/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### 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 a valid +`GoogleService-Info.plist` file. 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 add it to the Xcode project. + +### Coverage Report Generation + +See [scripts/code_coverage_report/README.md](scripts/code_coverage_report/README.md). + +## 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](FirebaseAuth/Tests/Sample/README.md) for instructions about +building and running the FirebaseAuth pod along with various samples and tests. + +### Firebase Database + +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 Performance Monitoring +If you're doing specific Firebase Performance Monitoring development, see +[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK +and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about +integrating Performance with the dev test App. + +### Firebase Storage + +To run the Storage Integration tests, follow the instructions in +[FIRStorageIntegrationTests.m](FirebaseStorage/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. + +## Building with Firebase on Apple platforms + +Firebase 8.9.0 introduces official beta support for macOS, Catalyst, and tvOS. watchOS continues +to be community supported. Thanks to community contributions for many of the multi-platform PRs. + +At this time, most of Firebase's products are available across Apple platforms. There are still +a few gaps, especially on watchOS. For details about the current support matrix, see +[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform) +in Firebase's documentation. + +### watchOS +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and +work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample). + +Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit +test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected +on watchOS. If you encounter this, please +[file an issue](https://github.com/firebase/firebase-ios-sdk/issues). + +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 watchOS. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. + +#### Additional Crashlytics Notes +* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are +not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded) + +## Combine +Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine +framework. This module is currently under development, and not yet supported for use in production +environments. Fore more details, please refer to the [docs](FirebaseCombineSwift/README.md). + +## Roadmap + +See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source +plans and directions. + +## Contributing + +See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase +Apple SDK. + +## License + +The contents of this repository are 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/). + +[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-appcheck-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/app_check/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-cocoapods-integration-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/cocoapods-integration/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-core-diagnostics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core-diagnostics/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-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg +[gh-google-utilities-components-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities-components/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-mlmodeldownloader-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/mlmodeldownloader/badge.svg +[gh-performance-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/performance/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/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h new file mode 100644 index 0000000..834b740 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h @@ -0,0 +1,48 @@ +/* + * 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 + +@protocol FIRAppCheckTokenResultInterop; + +NS_ASSUME_NONNULL_BEGIN + +NS_SWIFT_NAME(AppCheckTokenHandlerInterop) +typedef void (^FIRAppCheckTokenHandlerInterop)(id tokenResult); + +@protocol FIRAppCheckInterop + +/// Retrieve a cached or generate a new FAA Token. If forcingRefresh == YES always generates a new +/// token and updates the cache. +- (void)getTokenForcingRefresh:(BOOL)forcingRefresh + completion:(FIRAppCheckTokenHandlerInterop)handler + NS_SWIFT_NAME(getToken(forcingRefresh:completion:)); + +/// A notification with the specified name is sent to the default notification center +/// (`NotificationCenter.default`) each time a Firebase app check token is refreshed. +/// The user info dictionary contains `-[self notificationTokenKey]` and +/// `-[self notificationAppNameKey]` keys. +- (NSString *)tokenDidChangeNotificationName; + +/// `userInfo` key for the FAC token in a notification for `tokenDidChangeNotificationName`. +- (NSString *)notificationTokenKey; +/// `userInfo` key for the `FirebaseApp.name` in a notification for +/// `tokenDidChangeNotificationName`. +- (NSString *)notificationAppNameKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckTokenResultInterop.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckTokenResultInterop.h new file mode 100644 index 0000000..cb86a1b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseAppCheck/Sources/Interop/FIRAppCheckTokenResultInterop.h @@ -0,0 +1,32 @@ +/* + * 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 + +NS_ASSUME_NONNULL_BEGIN + +@protocol FIRAppCheckTokenResultInterop + +/// App Check token in the case of success or a dummy token in the case of a failure. +/// In general, the value of the token should always be set to the request header. +@property(nonatomic, readonly) NSString *token; + +/// A token fetch error in the case of a failure or `nil` in the case of success. +@property(nonatomic, readonly, nullable) NSError *error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h new file mode 100644 index 0000000..6c7d723 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h @@ -0,0 +1,153 @@ +/* + * 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 + +@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; +extern NSString *const kFirebaseCoreErrorDomain; + +/** The NSUserDefaults suite name for FirebaseCore, for those storage locations that use it. */ +extern NSString *const kFirebaseCoreDefaultsSuiteName; + +/** + * 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; + +/** @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; + +/** + * 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 to be reported for analytics. + * + * @param library Optional parameter for component registration. + * @param name Name of the library. + */ ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name; + +/** + * Registers a given internal library with the given version number to be reported for + * analytics. This should only be used for non-Firebase libraries that have their own versioning + * scheme. + * + * @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; + +/** + * 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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponent.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponent.h new file mode 100644 index 0000000..cb51ee7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h new file mode 100644 index 0000000..af18a93 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h @@ -0,0 +1,41 @@ +/* + * 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 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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentType.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentType.h new file mode 100644 index 0000000..6f2aca7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h new file mode 100644 index 0000000..76c0c05 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRDependency.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRDependency.h new file mode 100644 index 0000000..46e9b7e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h new file mode 100644 index 0000000..9f94256 --- /dev/null +++ b/SaraAttended/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 required 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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h new file mode 100644 index 0000000..9575e94 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h @@ -0,0 +1,44 @@ +/* + * 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 + +@class FIRApp; +@class FIRComponent; + +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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h new file mode 100644 index 0000000..b6242ff --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h @@ -0,0 +1,146 @@ +/* + * 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 kFIRLoggerAnalytics; +extern FIRLoggerService kFIRLoggerCrash; +extern FIRLoggerService kFIRLoggerCore; +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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h new file mode 100644 index 0000000..8efc5fc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h @@ -0,0 +1,115 @@ +/* + * 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 + NS_DESIGNATED_INITIALIZER; + +/** + * 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/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h new file mode 100644 index 0000000..88d012b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h @@ -0,0 +1,28 @@ +// 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/FIRComponentType.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/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.cc new file mode 100644 index 0000000..fdde2fc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.cc @@ -0,0 +1,217 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#include "bundle.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. +#endif + + + +const pb_field_t firestore_BundledQuery_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_BundledQuery, parent, parent, 0), + PB_ANONYMOUS_ONEOF_FIELD(query_type, 2, MESSAGE , ONEOF, STATIC , OTHER, firestore_BundledQuery, structured_query, parent, &google_firestore_v1_StructuredQuery_fields), + PB_FIELD( 3, UENUM , SINGULAR, STATIC , OTHER, firestore_BundledQuery, limit_type, structured_query, 0), + PB_LAST_FIELD +}; + +const pb_field_t firestore_NamedQuery_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_NamedQuery, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_NamedQuery, bundled_query, name, &firestore_BundledQuery_fields), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, firestore_NamedQuery, read_time, bundled_query, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t firestore_BundledDocumentMetadata_fields[5] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_BundledDocumentMetadata, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_BundledDocumentMetadata, read_time, name, &google_protobuf_Timestamp_fields), + PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, firestore_BundledDocumentMetadata, exists, read_time, 0), + PB_FIELD( 4, BYTES , REPEATED, POINTER , OTHER, firestore_BundledDocumentMetadata, queries, exists, 0), + PB_LAST_FIELD +}; + +const pb_field_t firestore_BundleMetadata_fields[6] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_BundleMetadata, id, id, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_BundleMetadata, create_time, id, &google_protobuf_Timestamp_fields), + PB_FIELD( 3, UINT32 , SINGULAR, STATIC , OTHER, firestore_BundleMetadata, version, create_time, 0), + PB_FIELD( 4, UINT32 , SINGULAR, STATIC , OTHER, firestore_BundleMetadata, total_documents, version, 0), + PB_FIELD( 5, UINT64 , SINGULAR, STATIC , OTHER, firestore_BundleMetadata, total_bytes, total_documents, 0), + PB_LAST_FIELD +}; + +const pb_field_t firestore_BundleElement_fields[5] = { + PB_ANONYMOUS_ONEOF_FIELD(element_type, 1, MESSAGE , ONEOF, STATIC , FIRST, firestore_BundleElement, metadata, metadata, &firestore_BundleMetadata_fields), + PB_ANONYMOUS_ONEOF_FIELD(element_type, 2, MESSAGE , ONEOF, STATIC , UNION, firestore_BundleElement, named_query, named_query, &firestore_NamedQuery_fields), + PB_ANONYMOUS_ONEOF_FIELD(element_type, 3, MESSAGE , ONEOF, STATIC , UNION, firestore_BundleElement, document_metadata, document_metadata, &firestore_BundledDocumentMetadata_fields), + PB_ANONYMOUS_ONEOF_FIELD(element_type, 4, MESSAGE , ONEOF, STATIC , UNION, firestore_BundleElement, document, document, &google_firestore_v1_Document_fields), + PB_LAST_FIELD +}; + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(firestore_BundledQuery, structured_query) < 65536 && pb_membersize(firestore_NamedQuery, bundled_query) < 65536 && pb_membersize(firestore_NamedQuery, read_time) < 65536 && pb_membersize(firestore_BundledDocumentMetadata, read_time) < 65536 && pb_membersize(firestore_BundleMetadata, create_time) < 65536 && pb_membersize(firestore_BundleElement, metadata) < 65536 && pb_membersize(firestore_BundleElement, named_query) < 65536 && pb_membersize(firestore_BundleElement, document_metadata) < 65536 && pb_membersize(firestore_BundleElement, document) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_BundledQuery_firestore_NamedQuery_firestore_BundledDocumentMetadata_firestore_BundleMetadata_firestore_BundleElement) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(firestore_BundledQuery, structured_query) < 256 && pb_membersize(firestore_NamedQuery, bundled_query) < 256 && pb_membersize(firestore_NamedQuery, read_time) < 256 && pb_membersize(firestore_BundledDocumentMetadata, read_time) < 256 && pb_membersize(firestore_BundleMetadata, create_time) < 256 && pb_membersize(firestore_BundleElement, metadata) < 256 && pb_membersize(firestore_BundleElement, named_query) < 256 && pb_membersize(firestore_BundleElement, document_metadata) < 256 && pb_membersize(firestore_BundleElement, document) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_BundledQuery_firestore_NamedQuery_firestore_BundledDocumentMetadata_firestore_BundleMetadata_firestore_BundleElement) +#endif + + +const char* EnumToString( + firestore_BundledQuery_LimitType value) { + switch (value) { + case firestore_BundledQuery_LimitType_FIRST: + return "FIRST"; + case firestore_BundledQuery_LimitType_LAST: + return "LAST"; + } + return ""; +} + +std::string firestore_BundledQuery::ToString(int indent) const { + std::string header = PrintHeader(indent, "BundledQuery", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + switch (which_query_type) { + case firestore_BundledQuery_structured_query_tag: + result += PrintMessageField("structured_query ", + structured_query, indent + 1, true); + break; + } + result += PrintEnumField("limit_type: ", limit_type, 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_NamedQuery::ToString(int indent) const { + std::string header = PrintHeader(indent, "NamedQuery", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("bundled_query ", + bundled_query, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_BundledDocumentMetadata::ToString(int indent) const { + std::string header = PrintHeader(indent, "BundledDocumentMetadata", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + result += PrintPrimitiveField("exists: ", exists, indent + 1, false); + for (pb_size_t i = 0; i != queries_count; ++i) { + result += PrintPrimitiveField("queries: ", + queries[i], indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_BundleMetadata::ToString(int indent) const { + std::string header = PrintHeader(indent, "BundleMetadata", this); + std::string result; + + result += PrintPrimitiveField("id: ", id, indent + 1, false); + result += PrintMessageField("create_time ", + create_time, indent + 1, false); + result += PrintPrimitiveField("version: ", version, indent + 1, false); + result += PrintPrimitiveField("total_documents: ", + total_documents, indent + 1, false); + result += PrintPrimitiveField("total_bytes: ", + total_bytes, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_BundleElement::ToString(int indent) const { + std::string header = PrintHeader(indent, "BundleElement", this); + std::string result; + + switch (which_element_type) { + case firestore_BundleElement_metadata_tag: + result += PrintMessageField("metadata ", metadata, indent + 1, true); + break; + case firestore_BundleElement_named_query_tag: + result += PrintMessageField("named_query ", + named_query, indent + 1, true); + break; + case firestore_BundleElement_document_metadata_tag: + result += PrintMessageField("document_metadata ", + document_metadata, indent + 1, true); + break; + case firestore_BundleElement_document_tag: + result += PrintMessageField("document ", document, 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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.h new file mode 100644 index 0000000..b9dfb72 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/bundle.nanopb.h @@ -0,0 +1,170 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_FIRESTORE_BUNDLE_NANOPB_H_INCLUDED +#define PB_FIRESTORE_BUNDLE_NANOPB_H_INCLUDED +#include + +#include "google/firestore/v1/document.nanopb.h" + +#include "google/firestore/v1/query.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _firestore_BundledQuery_LimitType { + firestore_BundledQuery_LimitType_FIRST = 0, + firestore_BundledQuery_LimitType_LAST = 1 +} firestore_BundledQuery_LimitType; +#define _firestore_BundledQuery_LimitType_MIN firestore_BundledQuery_LimitType_FIRST +#define _firestore_BundledQuery_LimitType_MAX firestore_BundledQuery_LimitType_LAST +#define _firestore_BundledQuery_LimitType_ARRAYSIZE ((firestore_BundledQuery_LimitType)(firestore_BundledQuery_LimitType_LAST+1)) + +/* Struct definitions */ +typedef struct _firestore_BundleMetadata { + pb_bytes_array_t *id; + google_protobuf_Timestamp create_time; + uint32_t version; + uint32_t total_documents; + uint64_t total_bytes; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:firestore_BundleMetadata) */ +} firestore_BundleMetadata; + +typedef struct _firestore_BundledDocumentMetadata { + pb_bytes_array_t *name; + google_protobuf_Timestamp read_time; + bool exists; + pb_size_t queries_count; + pb_bytes_array_t **queries; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:firestore_BundledDocumentMetadata) */ +} firestore_BundledDocumentMetadata; + +typedef struct _firestore_BundledQuery { + pb_bytes_array_t *parent; + pb_size_t which_query_type; + union { + google_firestore_v1_StructuredQuery structured_query; + }; + firestore_BundledQuery_LimitType limit_type; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:firestore_BundledQuery) */ +} firestore_BundledQuery; + +typedef struct _firestore_NamedQuery { + pb_bytes_array_t *name; + firestore_BundledQuery bundled_query; + google_protobuf_Timestamp read_time; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:firestore_NamedQuery) */ +} firestore_NamedQuery; + +typedef struct _firestore_BundleElement { + pb_size_t which_element_type; + union { + firestore_BundleMetadata metadata; + firestore_NamedQuery named_query; + firestore_BundledDocumentMetadata document_metadata; + google_firestore_v1_Document document; + }; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:firestore_BundleElement) */ +} firestore_BundleElement; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define firestore_BundledQuery_init_default {NULL, 0, {google_firestore_v1_StructuredQuery_init_default}, _firestore_BundledQuery_LimitType_MIN} +#define firestore_NamedQuery_init_default {NULL, firestore_BundledQuery_init_default, google_protobuf_Timestamp_init_default} +#define firestore_BundledDocumentMetadata_init_default {NULL, google_protobuf_Timestamp_init_default, 0, 0, NULL} +#define firestore_BundleMetadata_init_default {NULL, google_protobuf_Timestamp_init_default, 0, 0, 0} +#define firestore_BundleElement_init_default {0, {firestore_BundleMetadata_init_default}} +#define firestore_BundledQuery_init_zero {NULL, 0, {google_firestore_v1_StructuredQuery_init_zero}, _firestore_BundledQuery_LimitType_MIN} +#define firestore_NamedQuery_init_zero {NULL, firestore_BundledQuery_init_zero, google_protobuf_Timestamp_init_zero} +#define firestore_BundledDocumentMetadata_init_zero {NULL, google_protobuf_Timestamp_init_zero, 0, 0, NULL} +#define firestore_BundleMetadata_init_zero {NULL, google_protobuf_Timestamp_init_zero, 0, 0, 0} +#define firestore_BundleElement_init_zero {0, {firestore_BundleMetadata_init_zero}} + +/* Field tags (for use in manual encoding/decoding) */ +#define firestore_BundleMetadata_id_tag 1 +#define firestore_BundleMetadata_create_time_tag 2 +#define firestore_BundleMetadata_version_tag 3 +#define firestore_BundleMetadata_total_documents_tag 4 +#define firestore_BundleMetadata_total_bytes_tag 5 +#define firestore_BundledDocumentMetadata_name_tag 1 +#define firestore_BundledDocumentMetadata_read_time_tag 2 +#define firestore_BundledDocumentMetadata_exists_tag 3 +#define firestore_BundledDocumentMetadata_queries_tag 4 +#define firestore_BundledQuery_structured_query_tag 2 +#define firestore_BundledQuery_parent_tag 1 +#define firestore_BundledQuery_limit_type_tag 3 +#define firestore_NamedQuery_name_tag 1 +#define firestore_NamedQuery_bundled_query_tag 2 +#define firestore_NamedQuery_read_time_tag 3 +#define firestore_BundleElement_metadata_tag 1 +#define firestore_BundleElement_named_query_tag 2 +#define firestore_BundleElement_document_metadata_tag 3 +#define firestore_BundleElement_document_tag 4 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t firestore_BundledQuery_fields[4]; +extern const pb_field_t firestore_NamedQuery_fields[4]; +extern const pb_field_t firestore_BundledDocumentMetadata_fields[5]; +extern const pb_field_t firestore_BundleMetadata_fields[6]; +extern const pb_field_t firestore_BundleElement_fields[5]; + +/* Maximum encoded size of messages (where known) */ +/* firestore_BundledQuery_size depends on runtime parameters */ +/* firestore_NamedQuery_size depends on runtime parameters */ +/* firestore_BundledDocumentMetadata_size depends on runtime parameters */ +/* firestore_BundleMetadata_size depends on runtime parameters */ +/* firestore_BundleElement_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define BUNDLE_MESSAGES \ + + +#endif + +const char* EnumToString(firestore_BundledQuery_LimitType value); +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc new file mode 100644 index 0000000..93b0b9c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc @@ -0,0 +1,139 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t firestore_client_NoDocument_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_client_NoDocument, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_NoDocument, read_time, name, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t firestore_client_UnknownDocument_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, firestore_client_UnknownDocument, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_UnknownDocument, version, name, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t firestore_client_MaybeDocument_fields[5] = { + PB_ANONYMOUS_ONEOF_FIELD(document_type, 1, MESSAGE , ONEOF, STATIC , FIRST, firestore_client_MaybeDocument, no_document, no_document, &firestore_client_NoDocument_fields), + PB_ANONYMOUS_ONEOF_FIELD(document_type, 2, MESSAGE , ONEOF, STATIC , UNION, firestore_client_MaybeDocument, document, document, &google_firestore_v1_Document_fields), + PB_ANONYMOUS_ONEOF_FIELD(document_type, 3, MESSAGE , ONEOF, STATIC , UNION, firestore_client_MaybeDocument, unknown_document, unknown_document, &firestore_client_UnknownDocument_fields), + PB_FIELD( 4, BOOL , SINGULAR, STATIC , OTHER, firestore_client_MaybeDocument, has_committed_mutations, unknown_document, 0), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * 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_NoDocument, read_time) < 65536 && pb_membersize(firestore_client_UnknownDocument, version) < 65536 && pb_membersize(firestore_client_MaybeDocument, no_document) < 65536 && pb_membersize(firestore_client_MaybeDocument, document) < 65536 && pb_membersize(firestore_client_MaybeDocument, unknown_document) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_NoDocument_firestore_client_UnknownDocument_firestore_client_MaybeDocument) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(firestore_client_NoDocument, read_time) < 256 && pb_membersize(firestore_client_UnknownDocument, version) < 256 && pb_membersize(firestore_client_MaybeDocument, no_document) < 256 && pb_membersize(firestore_client_MaybeDocument, document) < 256 && pb_membersize(firestore_client_MaybeDocument, unknown_document) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_NoDocument_firestore_client_UnknownDocument_firestore_client_MaybeDocument) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h new file mode 100644 index 0000000..85dcc18 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h @@ -0,0 +1,112 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_FIRESTORE_CLIENT_MAYBE_DOCUMENT_NANOPB_H_INCLUDED +#define PB_FIRESTORE_CLIENT_MAYBE_DOCUMENT_NANOPB_H_INCLUDED +#include + +#include "google/firestore/v1/document.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +typedef struct _firestore_client_MaybeDocument { + pb_size_t which_document_type; + union { + firestore_client_NoDocument no_document; + google_firestore_v1_Document document; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define firestore_client_NoDocument_init_default {NULL, google_protobuf_Timestamp_init_default} +#define firestore_client_UnknownDocument_init_default {NULL, google_protobuf_Timestamp_init_default} +#define firestore_client_MaybeDocument_init_default {0, {firestore_client_NoDocument_init_default}, 0} +#define firestore_client_NoDocument_init_zero {NULL, google_protobuf_Timestamp_init_zero} +#define firestore_client_UnknownDocument_init_zero {NULL, google_protobuf_Timestamp_init_zero} +#define firestore_client_MaybeDocument_init_zero {0, {firestore_client_NoDocument_init_zero}, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define firestore_client_NoDocument_name_tag 1 +#define firestore_client_NoDocument_read_time_tag 2 +#define firestore_client_UnknownDocument_name_tag 1 +#define firestore_client_UnknownDocument_version_tag 2 +#define firestore_client_MaybeDocument_no_document_tag 1 +#define firestore_client_MaybeDocument_document_tag 2 +#define firestore_client_MaybeDocument_unknown_document_tag 3 +#define firestore_client_MaybeDocument_has_committed_mutations_tag 4 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t firestore_client_NoDocument_fields[3]; +extern const pb_field_t firestore_client_UnknownDocument_fields[3]; +extern const pb_field_t firestore_client_MaybeDocument_fields[5]; + +/* Maximum encoded size of messages (where known) */ +/* firestore_client_NoDocument_size depends on runtime parameters */ +/* firestore_client_UnknownDocument_size depends on runtime parameters */ +/* firestore_client_MaybeDocument_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define MAYBE_DOCUMENT_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc new file mode 100644 index 0000000..da55504 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc @@ -0,0 +1,119 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t firestore_client_MutationQueue_fields[3] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_MutationQueue, last_acknowledged_batch_id, last_acknowledged_batch_id, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, firestore_client_MutationQueue, last_stream_token, last_acknowledged_batch_id, 0), + PB_LAST_FIELD +}; + +const pb_field_t firestore_client_WriteBatch_fields[5] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_WriteBatch, batch_id, batch_id, 0), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, firestore_client_WriteBatch, writes, batch_id, &google_firestore_v1_Write_fields), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_WriteBatch, local_write_time, writes, &google_protobuf_Timestamp_fields), + PB_FIELD( 4, MESSAGE , REPEATED, POINTER , OTHER, firestore_client_WriteBatch, base_writes, local_write_time, &google_firestore_v1_Write_fields), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * 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_WriteBatch, local_write_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_MutationQueue_firestore_client_WriteBatch) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(firestore_client_WriteBatch, local_write_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_MutationQueue_firestore_client_WriteBatch) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h new file mode 100644 index 0000000..bac07f4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h @@ -0,0 +1,97 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_FIRESTORE_CLIENT_MUTATION_NANOPB_H_INCLUDED +#define PB_FIRESTORE_CLIENT_MUTATION_NANOPB_H_INCLUDED +#include + +#include "google/firestore/v1/write.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +typedef struct _firestore_client_WriteBatch { + int32_t batch_id; + pb_size_t writes_count; + struct _google_firestore_v1_Write *writes; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define firestore_client_MutationQueue_init_default {0, NULL} +#define firestore_client_WriteBatch_init_default {0, 0, NULL, google_protobuf_Timestamp_init_default, 0, NULL} +#define firestore_client_MutationQueue_init_zero {0, NULL} +#define firestore_client_WriteBatch_init_zero {0, 0, NULL, google_protobuf_Timestamp_init_zero, 0, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define firestore_client_MutationQueue_last_acknowledged_batch_id_tag 1 +#define firestore_client_MutationQueue_last_stream_token_tag 2 +#define firestore_client_WriteBatch_batch_id_tag 1 +#define firestore_client_WriteBatch_writes_tag 2 +#define firestore_client_WriteBatch_local_write_time_tag 3 +#define firestore_client_WriteBatch_base_writes_tag 4 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t firestore_client_MutationQueue_fields[3]; +extern const pb_field_t firestore_client_WriteBatch_fields[5]; + +/* Maximum encoded size of messages (where known) */ +/* firestore_client_MutationQueue_size depends on runtime parameters */ +/* firestore_client_WriteBatch_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define MUTATION_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc new file mode 100644 index 0000000..0c1cbb6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc @@ -0,0 +1,130 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +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 +}; + +const pb_field_t firestore_client_TargetGlobal_fields[5] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_TargetGlobal, highest_target_id, highest_target_id, 0), + PB_FIELD( 2, INT64 , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, highest_listen_sequence_number, highest_target_id, 0), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, last_remote_snapshot_version, highest_listen_sequence_number, &google_protobuf_Timestamp_fields), + PB_FIELD( 4, INT32 , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, target_count, last_remote_snapshot_version, 0), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * 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_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) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * 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_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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h new file mode 100644 index 0000000..c2d4e50 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h @@ -0,0 +1,108 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_FIRESTORE_CLIENT_TARGET_NANOPB_H_INCLUDED +#define PB_FIRESTORE_CLIENT_TARGET_NANOPB_H_INCLUDED +#include + +#include "google/firestore/v1/firestore.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +typedef struct _firestore_client_Target { + int32_t target_id; + google_protobuf_Timestamp snapshot_version; + pb_bytes_array_t *resume_token; + int64_t last_listen_sequence_number; + pb_size_t which_target_type; + union { + 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; + +typedef struct _firestore_client_TargetGlobal { + int32_t highest_target_id; + 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}, 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}, 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) */ +#define firestore_client_Target_query_tag 5 +#define firestore_client_Target_documents_tag 6 +#define firestore_client_Target_target_id_tag 1 +#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[8]; +extern const pb_field_t firestore_client_TargetGlobal_fields[5]; + +/* Maximum encoded size of messages (where known) */ +/* firestore_client_Target_size depends on runtime parameters */ +#define firestore_client_TargetGlobal_size 57 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define TARGET_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc new file mode 100644 index 0000000..bf529c7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +#error Field descriptor for google_api_http_struct.http is too large. Define PB_FIELD_32BIT to fix this. +#endif + + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h new file mode 100644 index 0000000..d7a8512 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h @@ -0,0 +1,46 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_API_ANNOTATIONS_NANOPB_H_INCLUDED +#define PB_GOOGLE_API_ANNOTATIONS_NANOPB_H_INCLUDED +#include + +#include "google/api/http.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Extensions */ +/* Extension field google_api_http was skipped because only "optional" + type of extension fields is currently supported. */ + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc new file mode 100644 index 0000000..004c4df --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc @@ -0,0 +1,168 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_api_Http_fields[3] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_api_Http, rules, rules, &google_api_HttpRule_fields), + PB_FIELD( 2, BOOL , SINGULAR, STATIC , OTHER, google_api_Http, fully_decode_reserved_expansion, rules, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_api_HttpRule_fields[10] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_HttpRule, selector, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 2, BYTES , ONEOF, POINTER , OTHER, google_api_HttpRule, get, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 3, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, put, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 4, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, post, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 5, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, delete_, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 6, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, patch, selector, 0), + PB_ANONYMOUS_ONEOF_FIELD(pattern, 8, MESSAGE , ONEOF, STATIC , UNION, google_api_HttpRule, custom, selector, &google_api_CustomHttpPattern_fields), + PB_FIELD( 7, BYTES , SINGULAR, POINTER , OTHER, google_api_HttpRule, body, custom, 0), + PB_FIELD( 11, MESSAGE , REPEATED, POINTER , OTHER, google_api_HttpRule, additional_bindings, body, &google_api_HttpRule_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_api_CustomHttpPattern_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_CustomHttpPattern, kind, kind, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_api_CustomHttpPattern, path, kind, 0), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_api_HttpRule, custom) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_api_Http_google_api_HttpRule_google_api_CustomHttpPattern) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_api_HttpRule, custom) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_api_Http_google_api_HttpRule_google_api_CustomHttpPattern) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h new file mode 100644 index 0000000..594c51f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h @@ -0,0 +1,120 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_API_HTTP_NANOPB_H_INCLUDED +#define PB_GOOGLE_API_HTTP_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +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; + +typedef struct _google_api_HttpRule { + pb_bytes_array_t *selector; + pb_size_t which_pattern; + union { + pb_bytes_array_t *get; + pb_bytes_array_t *put; + pb_bytes_array_t *post; + pb_bytes_array_t *delete_; + pb_bytes_array_t *patch; + google_api_CustomHttpPattern custom; + }; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_api_Http_init_default {0, NULL, 0} +#define google_api_HttpRule_init_default {NULL, 0, {NULL}, NULL, 0, NULL} +#define google_api_CustomHttpPattern_init_default {NULL, NULL} +#define google_api_Http_init_zero {0, NULL, 0} +#define google_api_HttpRule_init_zero {NULL, 0, {NULL}, NULL, 0, NULL} +#define google_api_CustomHttpPattern_init_zero {NULL, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_api_CustomHttpPattern_kind_tag 1 +#define google_api_CustomHttpPattern_path_tag 2 +#define google_api_Http_rules_tag 1 +#define google_api_Http_fully_decode_reserved_expansion_tag 2 +#define google_api_HttpRule_get_tag 2 +#define google_api_HttpRule_put_tag 3 +#define google_api_HttpRule_post_tag 4 +#define google_api_HttpRule_delete_tag 5 +#define google_api_HttpRule_patch_tag 6 +#define google_api_HttpRule_custom_tag 8 +#define google_api_HttpRule_selector_tag 1 +#define google_api_HttpRule_body_tag 7 +#define google_api_HttpRule_additional_bindings_tag 11 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_api_Http_fields[3]; +extern const pb_field_t google_api_HttpRule_fields[10]; +extern const pb_field_t google_api_CustomHttpPattern_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_api_Http_size depends on runtime parameters */ +/* google_api_HttpRule_size depends on runtime parameters */ +/* google_api_CustomHttpPattern_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define HTTP_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc new file mode 100644 index 0000000..39b36a6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc @@ -0,0 +1,194 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_firestore_v1_DocumentMask_fields[2] = { + PB_FIELD( 1, BYTES , REPEATED, POINTER , FIRST, google_firestore_v1_DocumentMask, field_paths, field_paths, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Precondition_fields[3] = { + PB_ANONYMOUS_ONEOF_FIELD(condition_type, 1, BOOL , ONEOF, STATIC , FIRST, google_firestore_v1_Precondition, exists, exists, 0), + PB_ANONYMOUS_ONEOF_FIELD(condition_type, 2, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Precondition, update_time, update_time, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_TransactionOptions_fields[3] = { + PB_ANONYMOUS_ONEOF_FIELD(mode, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_TransactionOptions, read_only, read_only, &google_firestore_v1_TransactionOptions_ReadOnly_fields), + PB_ANONYMOUS_ONEOF_FIELD(mode, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_TransactionOptions, read_write, read_write, &google_firestore_v1_TransactionOptions_ReadWrite_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_TransactionOptions_ReadWrite_fields[2] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_TransactionOptions_ReadWrite, retry_transaction, retry_transaction, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_TransactionOptions_ReadOnly_fields[2] = { + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_TransactionOptions_ReadOnly, read_time, read_time, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Precondition, update_time) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions, read_only) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions, read_write) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions_ReadOnly, read_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_DocumentMask_google_firestore_v1_Precondition_google_firestore_v1_TransactionOptions_google_firestore_v1_TransactionOptions_ReadWrite_google_firestore_v1_TransactionOptions_ReadOnly) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Precondition, update_time) < 256 && pb_membersize(google_firestore_v1_TransactionOptions, read_only) < 256 && pb_membersize(google_firestore_v1_TransactionOptions, read_write) < 256 && pb_membersize(google_firestore_v1_TransactionOptions_ReadOnly, read_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_DocumentMask_google_firestore_v1_Precondition_google_firestore_v1_TransactionOptions_google_firestore_v1_TransactionOptions_ReadWrite_google_firestore_v1_TransactionOptions_ReadOnly) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h new file mode 100644 index 0000000..9a9cea3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h @@ -0,0 +1,137 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_FIRESTORE_V1_COMMON_NANOPB_H_INCLUDED +#define PB_GOOGLE_FIRESTORE_V1_COMMON_NANOPB_H_INCLUDED +#include + +#include "google/api/annotations.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +typedef struct _google_firestore_v1_Precondition { + pb_size_t which_condition_type; + union { + 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; + +typedef struct _google_firestore_v1_TransactionOptions_ReadOnly { + pb_size_t which_consistency_selector; + 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; + +typedef struct _google_firestore_v1_TransactionOptions { + pb_size_t which_mode; + union { + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_firestore_v1_DocumentMask_init_default {0, NULL} +#define google_firestore_v1_Precondition_init_default {0, {0}} +#define google_firestore_v1_TransactionOptions_init_default {0, {google_firestore_v1_TransactionOptions_ReadOnly_init_default}} +#define google_firestore_v1_TransactionOptions_ReadWrite_init_default {NULL} +#define google_firestore_v1_TransactionOptions_ReadOnly_init_default {0, {google_protobuf_Timestamp_init_default}} +#define google_firestore_v1_DocumentMask_init_zero {0, NULL} +#define google_firestore_v1_Precondition_init_zero {0, {0}} +#define google_firestore_v1_TransactionOptions_init_zero {0, {google_firestore_v1_TransactionOptions_ReadOnly_init_zero}} +#define google_firestore_v1_TransactionOptions_ReadWrite_init_zero {NULL} +#define google_firestore_v1_TransactionOptions_ReadOnly_init_zero {0, {google_protobuf_Timestamp_init_zero}} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_firestore_v1_DocumentMask_field_paths_tag 1 +#define google_firestore_v1_TransactionOptions_ReadWrite_retry_transaction_tag 1 +#define google_firestore_v1_Precondition_exists_tag 1 +#define google_firestore_v1_Precondition_update_time_tag 2 +#define google_firestore_v1_TransactionOptions_ReadOnly_read_time_tag 2 +#define google_firestore_v1_TransactionOptions_read_only_tag 2 +#define google_firestore_v1_TransactionOptions_read_write_tag 3 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_firestore_v1_DocumentMask_fields[2]; +extern const pb_field_t google_firestore_v1_Precondition_fields[3]; +extern const pb_field_t google_firestore_v1_TransactionOptions_fields[3]; +extern const pb_field_t google_firestore_v1_TransactionOptions_ReadWrite_fields[2]; +extern const pb_field_t google_firestore_v1_TransactionOptions_ReadOnly_fields[2]; + +/* Maximum encoded size of messages (where known) */ +/* google_firestore_v1_DocumentMask_size depends on runtime parameters */ +#define google_firestore_v1_Precondition_size 24 +/* google_firestore_v1_TransactionOptions_size depends on runtime parameters */ +/* google_firestore_v1_TransactionOptions_ReadWrite_size depends on runtime parameters */ +#define google_firestore_v1_TransactionOptions_ReadOnly_size 24 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define COMMON_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc new file mode 100644 index 0000000..41dee0a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc @@ -0,0 +1,252 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_firestore_v1_Document_fields[5] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_Document, name, name, 0), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_Document, fields, name, &google_firestore_v1_Document_FieldsEntry_fields), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_Document, create_time, fields, &google_protobuf_Timestamp_fields), + PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_Document, update_time, create_time, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Document_FieldsEntry_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_Document_FieldsEntry, key, key, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_Document_FieldsEntry, value, key, &google_firestore_v1_Value_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Value_fields[12] = { + PB_ANONYMOUS_ONEOF_FIELD(value_type, 1, BOOL , ONEOF, STATIC , FIRST, google_firestore_v1_Value, boolean_value, boolean_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 2, INT64 , ONEOF, STATIC , UNION, google_firestore_v1_Value, integer_value, integer_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 3, DOUBLE , ONEOF, STATIC , UNION, google_firestore_v1_Value, double_value, double_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 5, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_Value, reference_value, reference_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 6, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Value, map_value, map_value, &google_firestore_v1_MapValue_fields), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 8, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Value, geo_point_value, geo_point_value, &google_type_LatLng_fields), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 9, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Value, array_value, array_value, &google_firestore_v1_ArrayValue_fields), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 10, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Value, timestamp_value, timestamp_value, &google_protobuf_Timestamp_fields), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 11, UENUM , ONEOF, STATIC , UNION, google_firestore_v1_Value, null_value, null_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 17, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_Value, string_value, string_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(value_type, 18, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_Value, bytes_value, bytes_value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ArrayValue_fields[2] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_ArrayValue, values, values, &google_firestore_v1_Value_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_MapValue_fields[2] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_MapValue, fields, fields, &google_firestore_v1_MapValue_FieldsEntry_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_MapValue_FieldsEntry_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_MapValue_FieldsEntry, key, key, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_MapValue_FieldsEntry, value, key, &google_firestore_v1_Value_fields), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Document, create_time) < 65536 && pb_membersize(google_firestore_v1_Document, update_time) < 65536 && pb_membersize(google_firestore_v1_Document_FieldsEntry, value) < 65536 && pb_membersize(google_firestore_v1_Value, map_value) < 65536 && pb_membersize(google_firestore_v1_Value, geo_point_value) < 65536 && pb_membersize(google_firestore_v1_Value, array_value) < 65536 && pb_membersize(google_firestore_v1_Value, timestamp_value) < 65536 && pb_membersize(google_firestore_v1_MapValue_FieldsEntry, value) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_Document_google_firestore_v1_Document_FieldsEntry_google_firestore_v1_Value_google_firestore_v1_ArrayValue_google_firestore_v1_MapValue_google_firestore_v1_MapValue_FieldsEntry) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Document, create_time) < 256 && pb_membersize(google_firestore_v1_Document, update_time) < 256 && pb_membersize(google_firestore_v1_Document_FieldsEntry, value) < 256 && pb_membersize(google_firestore_v1_Value, map_value) < 256 && pb_membersize(google_firestore_v1_Value, geo_point_value) < 256 && pb_membersize(google_firestore_v1_Value, array_value) < 256 && pb_membersize(google_firestore_v1_Value, timestamp_value) < 256 && pb_membersize(google_firestore_v1_MapValue_FieldsEntry, value) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_Document_google_firestore_v1_Document_FieldsEntry_google_firestore_v1_Value_google_firestore_v1_ArrayValue_google_firestore_v1_MapValue_google_firestore_v1_MapValue_FieldsEntry) +#endif + + +/* On some platforms (such as AVR), double is really float. + * These are not directly supported by nanopb, but see example_avr_double. + * To get rid of this error, remove any double fields from your .proto. + */ +PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h new file mode 100644 index 0000000..b06264f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h @@ -0,0 +1,176 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_FIRESTORE_V1_DOCUMENT_NANOPB_H_INCLUDED +#define PB_GOOGLE_FIRESTORE_V1_DOCUMENT_NANOPB_H_INCLUDED +#include + +#include "google/api/annotations.nanopb.h" + +#include "google/protobuf/struct.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include "google/type/latlng.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +typedef struct _google_firestore_v1_Document { + pb_bytes_array_t *name; + pb_size_t fields_count; + struct _google_firestore_v1_Document_FieldsEntry *fields; + 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; + +typedef struct _google_firestore_v1_Value { + pb_size_t which_value_type; + union { + bool boolean_value; + int64_t integer_value; + double double_value; + pb_bytes_array_t *reference_value; + google_firestore_v1_MapValue map_value; + google_type_LatLng geo_point_value; + google_firestore_v1_ArrayValue array_value; + google_protobuf_Timestamp timestamp_value; + google_protobuf_NullValue null_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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_firestore_v1_Document_init_default {NULL, 0, NULL, google_protobuf_Timestamp_init_default, false, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_Document_FieldsEntry_init_default {NULL, google_firestore_v1_Value_init_default} +#define google_firestore_v1_Value_init_default {0, {0}} +#define google_firestore_v1_ArrayValue_init_default {0, NULL} +#define google_firestore_v1_MapValue_init_default {0, NULL} +#define google_firestore_v1_MapValue_FieldsEntry_init_default {NULL, google_firestore_v1_Value_init_default} +#define google_firestore_v1_Document_init_zero {NULL, 0, NULL, google_protobuf_Timestamp_init_zero, false, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_Document_FieldsEntry_init_zero {NULL, google_firestore_v1_Value_init_zero} +#define google_firestore_v1_Value_init_zero {0, {0}} +#define google_firestore_v1_ArrayValue_init_zero {0, NULL} +#define google_firestore_v1_MapValue_init_zero {0, NULL} +#define google_firestore_v1_MapValue_FieldsEntry_init_zero {NULL, google_firestore_v1_Value_init_zero} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_firestore_v1_ArrayValue_values_tag 1 +#define google_firestore_v1_MapValue_fields_tag 1 +#define google_firestore_v1_Document_name_tag 1 +#define google_firestore_v1_Document_fields_tag 2 +#define google_firestore_v1_Document_create_time_tag 3 +#define google_firestore_v1_Document_update_time_tag 4 +#define google_firestore_v1_Value_boolean_value_tag 1 +#define google_firestore_v1_Value_integer_value_tag 2 +#define google_firestore_v1_Value_double_value_tag 3 +#define google_firestore_v1_Value_reference_value_tag 5 +#define google_firestore_v1_Value_map_value_tag 6 +#define google_firestore_v1_Value_geo_point_value_tag 8 +#define google_firestore_v1_Value_array_value_tag 9 +#define google_firestore_v1_Value_timestamp_value_tag 10 +#define google_firestore_v1_Value_null_value_tag 11 +#define google_firestore_v1_Value_string_value_tag 17 +#define google_firestore_v1_Value_bytes_value_tag 18 +#define google_firestore_v1_Document_FieldsEntry_key_tag 1 +#define google_firestore_v1_Document_FieldsEntry_value_tag 2 +#define google_firestore_v1_MapValue_FieldsEntry_key_tag 1 +#define google_firestore_v1_MapValue_FieldsEntry_value_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_firestore_v1_Document_fields[5]; +extern const pb_field_t google_firestore_v1_Document_FieldsEntry_fields[3]; +extern const pb_field_t google_firestore_v1_Value_fields[12]; +extern const pb_field_t google_firestore_v1_ArrayValue_fields[2]; +extern const pb_field_t google_firestore_v1_MapValue_fields[2]; +extern const pb_field_t google_firestore_v1_MapValue_FieldsEntry_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_firestore_v1_Document_size depends on runtime parameters */ +/* google_firestore_v1_Document_FieldsEntry_size depends on runtime parameters */ +/* google_firestore_v1_Value_size depends on runtime parameters */ +/* google_firestore_v1_ArrayValue_size depends on runtime parameters */ +/* google_firestore_v1_MapValue_size depends on runtime parameters */ +/* google_firestore_v1_MapValue_FieldsEntry_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define DOCUMENT_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc new file mode 100644 index 0000000..9b16307 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc @@ -0,0 +1,849 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_firestore_v1_GetDocumentRequest_fields[5] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_GetDocumentRequest, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_GetDocumentRequest, mask, name, &google_firestore_v1_DocumentMask_fields), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 3, BYTES , ONEOF, POINTER , OTHER, google_firestore_v1_GetDocumentRequest, transaction, mask, 0), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 5, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_GetDocumentRequest, read_time, mask, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListDocumentsRequest_fields[10] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_ListDocumentsRequest, parent, parent, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListDocumentsRequest, collection_id, parent, 0), + PB_FIELD( 3, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_ListDocumentsRequest, page_size, collection_id, 0), + PB_FIELD( 4, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListDocumentsRequest, page_token, page_size, 0), + PB_FIELD( 6, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListDocumentsRequest, order_by, page_token, 0), + PB_FIELD( 7, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_ListDocumentsRequest, mask, order_by, &google_firestore_v1_DocumentMask_fields), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 8, BYTES , ONEOF, POINTER , OTHER, google_firestore_v1_ListDocumentsRequest, transaction, mask, 0), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 10, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_ListDocumentsRequest, read_time, mask, &google_protobuf_Timestamp_fields), + PB_FIELD( 12, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_ListDocumentsRequest, show_missing, read_time, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListDocumentsResponse_fields[3] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_ListDocumentsResponse, documents, documents, &google_firestore_v1_Document_fields), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListDocumentsResponse, next_page_token, documents, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_CreateDocumentRequest_fields[6] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_CreateDocumentRequest, parent, parent, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_CreateDocumentRequest, collection_id, parent, 0), + PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_CreateDocumentRequest, document_id, collection_id, 0), + PB_FIELD( 4, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_CreateDocumentRequest, document, document_id, &google_firestore_v1_Document_fields), + PB_FIELD( 5, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_CreateDocumentRequest, mask, document, &google_firestore_v1_DocumentMask_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_UpdateDocumentRequest_fields[5] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_UpdateDocumentRequest, document, document, &google_firestore_v1_Document_fields), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_UpdateDocumentRequest, update_mask, document, &google_firestore_v1_DocumentMask_fields), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_UpdateDocumentRequest, mask, update_mask, &google_firestore_v1_DocumentMask_fields), + PB_FIELD( 4, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_UpdateDocumentRequest, current_document, mask, &google_firestore_v1_Precondition_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DeleteDocumentRequest_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_DeleteDocumentRequest, name, name, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_DeleteDocumentRequest, current_document, name, &google_firestore_v1_Precondition_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_BatchGetDocumentsRequest_fields[7] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_BatchGetDocumentsRequest, database, database, 0), + PB_FIELD( 2, BYTES , REPEATED, POINTER , OTHER, google_firestore_v1_BatchGetDocumentsRequest, documents, database, 0), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_BatchGetDocumentsRequest, mask, documents, &google_firestore_v1_DocumentMask_fields), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 4, BYTES , ONEOF, POINTER , OTHER, google_firestore_v1_BatchGetDocumentsRequest, transaction, mask, 0), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 5, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_BatchGetDocumentsRequest, new_transaction, mask, &google_firestore_v1_TransactionOptions_fields), + PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 7, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_BatchGetDocumentsRequest, read_time, mask, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_BatchGetDocumentsResponse_fields[5] = { + PB_ANONYMOUS_ONEOF_FIELD(result, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_BatchGetDocumentsResponse, found, found, &google_firestore_v1_Document_fields), + PB_ANONYMOUS_ONEOF_FIELD(result, 2, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_BatchGetDocumentsResponse, missing, missing, 0), + PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_BatchGetDocumentsResponse, transaction, missing, 0), + PB_FIELD( 4, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_BatchGetDocumentsResponse, read_time, transaction, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_BeginTransactionRequest_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_BeginTransactionRequest, database, database, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_BeginTransactionRequest, options, database, &google_firestore_v1_TransactionOptions_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_BeginTransactionResponse_fields[2] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_BeginTransactionResponse, transaction, transaction, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_CommitRequest_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_CommitRequest, database, database, 0), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_CommitRequest, writes, database, &google_firestore_v1_Write_fields), + PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_CommitRequest, transaction, writes, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_CommitResponse_fields[3] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_CommitResponse, write_results, write_results, &google_firestore_v1_WriteResult_fields), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_CommitResponse, commit_time, write_results, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_RollbackRequest_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_RollbackRequest, database, database, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_RollbackRequest, transaction, database, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_RunQueryRequest_fields[6] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_RunQueryRequest, parent, parent, 0), + PB_ONEOF_FIELD(query_type, 2, MESSAGE , ONEOF, STATIC , OTHER, google_firestore_v1_RunQueryRequest, structured_query, parent, &google_firestore_v1_StructuredQuery_fields), + PB_ONEOF_FIELD(consistency_selector, 5, BYTES , ONEOF, POINTER , OTHER, google_firestore_v1_RunQueryRequest, transaction, query_type.structured_query, 0), + PB_ONEOF_FIELD(consistency_selector, 6, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_RunQueryRequest, new_transaction, query_type.structured_query, &google_firestore_v1_TransactionOptions_fields), + PB_ONEOF_FIELD(consistency_selector, 7, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_RunQueryRequest, read_time, query_type.structured_query, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_RunQueryResponse_fields[5] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_RunQueryResponse, document, document, &google_firestore_v1_Document_fields), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_RunQueryResponse, transaction, document, 0), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_RunQueryResponse, read_time, transaction, &google_protobuf_Timestamp_fields), + PB_FIELD( 4, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_RunQueryResponse, skipped_results, read_time, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_WriteRequest_fields[6] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_WriteRequest, database, database, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_WriteRequest, stream_id, database, 0), + PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_WriteRequest, writes, stream_id, &google_firestore_v1_Write_fields), + PB_FIELD( 4, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_WriteRequest, stream_token, writes, 0), + PB_FIELD( 5, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_WriteRequest, labels, stream_token, &google_firestore_v1_WriteRequest_LabelsEntry_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_WriteRequest_LabelsEntry_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_WriteRequest_LabelsEntry, key, key, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_WriteRequest_LabelsEntry, value, key, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_WriteResponse_fields[5] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_WriteResponse, stream_id, stream_id, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_WriteResponse, stream_token, stream_id, 0), + PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_WriteResponse, write_results, stream_token, &google_firestore_v1_WriteResult_fields), + PB_FIELD( 4, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_WriteResponse, commit_time, write_results, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListenRequest_fields[5] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_ListenRequest, database, database, 0), + PB_ANONYMOUS_ONEOF_FIELD(target_change, 2, MESSAGE , ONEOF, STATIC , OTHER, google_firestore_v1_ListenRequest, add_target, database, &google_firestore_v1_Target_fields), + PB_ANONYMOUS_ONEOF_FIELD(target_change, 3, INT32 , ONEOF, STATIC , UNION, google_firestore_v1_ListenRequest, remove_target, database, 0), + PB_FIELD( 4, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_ListenRequest, labels, remove_target, &google_firestore_v1_ListenRequest_LabelsEntry_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListenRequest_LabelsEntry_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_ListenRequest_LabelsEntry, key, key, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListenRequest_LabelsEntry, value, key, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListenResponse_fields[6] = { + PB_ANONYMOUS_ONEOF_FIELD(response_type, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_ListenResponse, target_change, target_change, &google_firestore_v1_TargetChange_fields), + PB_ANONYMOUS_ONEOF_FIELD(response_type, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_ListenResponse, document_change, document_change, &google_firestore_v1_DocumentChange_fields), + PB_ANONYMOUS_ONEOF_FIELD(response_type, 4, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_ListenResponse, document_delete, document_delete, &google_firestore_v1_DocumentDelete_fields), + PB_ANONYMOUS_ONEOF_FIELD(response_type, 5, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_ListenResponse, filter, filter, &google_firestore_v1_ExistenceFilter_fields), + PB_ANONYMOUS_ONEOF_FIELD(response_type, 6, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_ListenResponse, document_remove, document_remove, &google_firestore_v1_DocumentRemove_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Target_fields[7] = { + PB_ONEOF_FIELD(target_type, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_Target, query, query, &google_firestore_v1_Target_QueryTarget_fields), + PB_ONEOF_FIELD(target_type, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Target, documents, documents, &google_firestore_v1_Target_DocumentsTarget_fields), + PB_ONEOF_FIELD(resume_type, 4, BYTES , ONEOF, POINTER , OTHER, google_firestore_v1_Target, resume_token, target_type.documents, 0), + PB_ONEOF_FIELD(resume_type, 11, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Target, read_time, target_type.documents, &google_protobuf_Timestamp_fields), + PB_FIELD( 5, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_Target, target_id, resume_type.read_time, 0), + PB_FIELD( 6, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_Target, once, target_id, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Target_DocumentsTarget_fields[2] = { + PB_FIELD( 2, BYTES , REPEATED, POINTER , FIRST, google_firestore_v1_Target_DocumentsTarget, documents, documents, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Target_QueryTarget_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_Target_QueryTarget, parent, parent, 0), + PB_ANONYMOUS_ONEOF_FIELD(query_type, 2, MESSAGE , ONEOF, STATIC , OTHER, google_firestore_v1_Target_QueryTarget, structured_query, parent, &google_firestore_v1_StructuredQuery_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_TargetChange_fields[6] = { + PB_FIELD( 1, UENUM , SINGULAR, STATIC , FIRST, google_firestore_v1_TargetChange, target_change_type, target_change_type, 0), + PB_FIELD( 2, INT32 , REPEATED, POINTER , OTHER, google_firestore_v1_TargetChange, target_ids, target_change_type, 0), + PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_TargetChange, cause, target_ids, &google_rpc_Status_fields), + PB_FIELD( 4, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_TargetChange, resume_token, cause, 0), + PB_FIELD( 6, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_TargetChange, read_time, resume_token, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListCollectionIdsRequest_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_ListCollectionIdsRequest, parent, parent, 0), + PB_FIELD( 2, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_ListCollectionIdsRequest, page_size, parent, 0), + PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListCollectionIdsRequest, page_token, page_size, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ListCollectionIdsResponse_fields[3] = { + PB_FIELD( 1, BYTES , REPEATED, POINTER , FIRST, google_firestore_v1_ListCollectionIdsResponse, collection_ids, collection_ids, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_ListCollectionIdsResponse, next_page_token, collection_ids, 0), + PB_LAST_FIELD +}; + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_GetDocumentRequest, read_time) < 65536 && pb_membersize(google_firestore_v1_GetDocumentRequest, mask) < 65536 && pb_membersize(google_firestore_v1_ListDocumentsRequest, read_time) < 65536 && pb_membersize(google_firestore_v1_ListDocumentsRequest, mask) < 65536 && pb_membersize(google_firestore_v1_CreateDocumentRequest, document) < 65536 && pb_membersize(google_firestore_v1_CreateDocumentRequest, mask) < 65536 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, document) < 65536 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, update_mask) < 65536 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, mask) < 65536 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, current_document) < 65536 && pb_membersize(google_firestore_v1_DeleteDocumentRequest, current_document) < 65536 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, new_transaction) < 65536 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, read_time) < 65536 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, mask) < 65536 && pb_membersize(google_firestore_v1_BatchGetDocumentsResponse, found) < 65536 && pb_membersize(google_firestore_v1_BatchGetDocumentsResponse, read_time) < 65536 && pb_membersize(google_firestore_v1_BeginTransactionRequest, options) < 65536 && pb_membersize(google_firestore_v1_CommitResponse, commit_time) < 65536 && pb_membersize(google_firestore_v1_RunQueryRequest, query_type.structured_query) < 65536 && pb_membersize(google_firestore_v1_RunQueryRequest, consistency_selector.new_transaction) < 65536 && pb_membersize(google_firestore_v1_RunQueryRequest, consistency_selector.read_time) < 65536 && pb_membersize(google_firestore_v1_RunQueryResponse, document) < 65536 && pb_membersize(google_firestore_v1_RunQueryResponse, read_time) < 65536 && pb_membersize(google_firestore_v1_WriteResponse, commit_time) < 65536 && pb_membersize(google_firestore_v1_ListenRequest, add_target) < 65536 && pb_membersize(google_firestore_v1_ListenResponse, target_change) < 65536 && pb_membersize(google_firestore_v1_ListenResponse, document_change) < 65536 && pb_membersize(google_firestore_v1_ListenResponse, document_delete) < 65536 && pb_membersize(google_firestore_v1_ListenResponse, filter) < 65536 && pb_membersize(google_firestore_v1_ListenResponse, document_remove) < 65536 && pb_membersize(google_firestore_v1_Target, target_type.query) < 65536 && pb_membersize(google_firestore_v1_Target, target_type.documents) < 65536 && pb_membersize(google_firestore_v1_Target, resume_type.read_time) < 65536 && pb_membersize(google_firestore_v1_Target_QueryTarget, structured_query) < 65536 && pb_membersize(google_firestore_v1_TargetChange, cause) < 65536 && pb_membersize(google_firestore_v1_TargetChange, read_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_GetDocumentRequest_google_firestore_v1_ListDocumentsRequest_google_firestore_v1_ListDocumentsResponse_google_firestore_v1_CreateDocumentRequest_google_firestore_v1_UpdateDocumentRequest_google_firestore_v1_DeleteDocumentRequest_google_firestore_v1_BatchGetDocumentsRequest_google_firestore_v1_BatchGetDocumentsResponse_google_firestore_v1_BeginTransactionRequest_google_firestore_v1_BeginTransactionResponse_google_firestore_v1_CommitRequest_google_firestore_v1_CommitResponse_google_firestore_v1_RollbackRequest_google_firestore_v1_RunQueryRequest_google_firestore_v1_RunQueryResponse_google_firestore_v1_WriteRequest_google_firestore_v1_WriteRequest_LabelsEntry_google_firestore_v1_WriteResponse_google_firestore_v1_ListenRequest_google_firestore_v1_ListenRequest_LabelsEntry_google_firestore_v1_ListenResponse_google_firestore_v1_Target_google_firestore_v1_Target_DocumentsTarget_google_firestore_v1_Target_QueryTarget_google_firestore_v1_TargetChange_google_firestore_v1_ListCollectionIdsRequest_google_firestore_v1_ListCollectionIdsResponse) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_GetDocumentRequest, read_time) < 256 && pb_membersize(google_firestore_v1_GetDocumentRequest, mask) < 256 && pb_membersize(google_firestore_v1_ListDocumentsRequest, read_time) < 256 && pb_membersize(google_firestore_v1_ListDocumentsRequest, mask) < 256 && pb_membersize(google_firestore_v1_CreateDocumentRequest, document) < 256 && pb_membersize(google_firestore_v1_CreateDocumentRequest, mask) < 256 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, document) < 256 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, update_mask) < 256 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, mask) < 256 && pb_membersize(google_firestore_v1_UpdateDocumentRequest, current_document) < 256 && pb_membersize(google_firestore_v1_DeleteDocumentRequest, current_document) < 256 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, new_transaction) < 256 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, read_time) < 256 && pb_membersize(google_firestore_v1_BatchGetDocumentsRequest, mask) < 256 && pb_membersize(google_firestore_v1_BatchGetDocumentsResponse, found) < 256 && pb_membersize(google_firestore_v1_BatchGetDocumentsResponse, read_time) < 256 && pb_membersize(google_firestore_v1_BeginTransactionRequest, options) < 256 && pb_membersize(google_firestore_v1_CommitResponse, commit_time) < 256 && pb_membersize(google_firestore_v1_RunQueryRequest, query_type.structured_query) < 256 && pb_membersize(google_firestore_v1_RunQueryRequest, consistency_selector.new_transaction) < 256 && pb_membersize(google_firestore_v1_RunQueryRequest, consistency_selector.read_time) < 256 && pb_membersize(google_firestore_v1_RunQueryResponse, document) < 256 && pb_membersize(google_firestore_v1_RunQueryResponse, read_time) < 256 && pb_membersize(google_firestore_v1_WriteResponse, commit_time) < 256 && pb_membersize(google_firestore_v1_ListenRequest, add_target) < 256 && pb_membersize(google_firestore_v1_ListenResponse, target_change) < 256 && pb_membersize(google_firestore_v1_ListenResponse, document_change) < 256 && pb_membersize(google_firestore_v1_ListenResponse, document_delete) < 256 && pb_membersize(google_firestore_v1_ListenResponse, filter) < 256 && pb_membersize(google_firestore_v1_ListenResponse, document_remove) < 256 && pb_membersize(google_firestore_v1_Target, target_type.query) < 256 && pb_membersize(google_firestore_v1_Target, target_type.documents) < 256 && pb_membersize(google_firestore_v1_Target, resume_type.read_time) < 256 && pb_membersize(google_firestore_v1_Target_QueryTarget, structured_query) < 256 && pb_membersize(google_firestore_v1_TargetChange, cause) < 256 && pb_membersize(google_firestore_v1_TargetChange, read_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_GetDocumentRequest_google_firestore_v1_ListDocumentsRequest_google_firestore_v1_ListDocumentsResponse_google_firestore_v1_CreateDocumentRequest_google_firestore_v1_UpdateDocumentRequest_google_firestore_v1_DeleteDocumentRequest_google_firestore_v1_BatchGetDocumentsRequest_google_firestore_v1_BatchGetDocumentsResponse_google_firestore_v1_BeginTransactionRequest_google_firestore_v1_BeginTransactionResponse_google_firestore_v1_CommitRequest_google_firestore_v1_CommitResponse_google_firestore_v1_RollbackRequest_google_firestore_v1_RunQueryRequest_google_firestore_v1_RunQueryResponse_google_firestore_v1_WriteRequest_google_firestore_v1_WriteRequest_LabelsEntry_google_firestore_v1_WriteResponse_google_firestore_v1_ListenRequest_google_firestore_v1_ListenRequest_LabelsEntry_google_firestore_v1_ListenResponse_google_firestore_v1_Target_google_firestore_v1_Target_DocumentsTarget_google_firestore_v1_Target_QueryTarget_google_firestore_v1_TargetChange_google_firestore_v1_ListCollectionIdsRequest_google_firestore_v1_ListCollectionIdsResponse) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h new file mode 100644 index 0000000..d80c82d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h @@ -0,0 +1,596 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_FIRESTORE_V1_FIRESTORE_NANOPB_H_INCLUDED +#define PB_GOOGLE_FIRESTORE_V1_FIRESTORE_NANOPB_H_INCLUDED +#include + +#include "google/api/annotations.nanopb.h" + +#include "google/firestore/v1/common.nanopb.h" + +#include "google/firestore/v1/document.nanopb.h" + +#include "google/firestore/v1/query.nanopb.h" + +#include "google/firestore/v1/write.nanopb.h" + +#include "google/protobuf/empty.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include "google/rpc/status.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _google_firestore_v1_TargetChange_TargetChangeType { + google_firestore_v1_TargetChange_TargetChangeType_NO_CHANGE = 0, + google_firestore_v1_TargetChange_TargetChangeType_ADD = 1, + google_firestore_v1_TargetChange_TargetChangeType_REMOVE = 2, + google_firestore_v1_TargetChange_TargetChangeType_CURRENT = 3, + google_firestore_v1_TargetChange_TargetChangeType_RESET = 4 +} google_firestore_v1_TargetChange_TargetChangeType; +#define _google_firestore_v1_TargetChange_TargetChangeType_MIN google_firestore_v1_TargetChange_TargetChangeType_NO_CHANGE +#define _google_firestore_v1_TargetChange_TargetChangeType_MAX google_firestore_v1_TargetChange_TargetChangeType_RESET +#define _google_firestore_v1_TargetChange_TargetChangeType_ARRAYSIZE ((google_firestore_v1_TargetChange_TargetChangeType)(google_firestore_v1_TargetChange_TargetChangeType_RESET+1)) + +/* 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; + +typedef struct _google_firestore_v1_CommitRequest { + pb_bytes_array_t *database; + 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; + +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; + +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; + +typedef struct _google_firestore_v1_WriteRequest { + pb_bytes_array_t *database; + pb_bytes_array_t *stream_id; + pb_size_t writes_count; + struct _google_firestore_v1_Write *writes; + 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; + +typedef struct _google_firestore_v1_BatchGetDocumentsRequest { + pb_bytes_array_t *database; + pb_size_t documents_count; + pb_bytes_array_t **documents; + google_firestore_v1_DocumentMask mask; + pb_size_t which_consistency_selector; + union { + pb_bytes_array_t *transaction; + 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; + +typedef struct _google_firestore_v1_BatchGetDocumentsResponse { + pb_size_t which_result; + union { + google_firestore_v1_Document found; + pb_bytes_array_t *missing; + }; + 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; + +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; + +typedef struct _google_firestore_v1_CreateDocumentRequest { + pb_bytes_array_t *parent; + pb_bytes_array_t *collection_id; + 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; + +typedef struct _google_firestore_v1_GetDocumentRequest { + pb_bytes_array_t *name; + google_firestore_v1_DocumentMask mask; + pb_size_t which_consistency_selector; + union { + 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; + +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; + +typedef struct _google_firestore_v1_ListDocumentsRequest { + pb_bytes_array_t *parent; + pb_bytes_array_t *collection_id; + int32_t page_size; + pb_bytes_array_t *page_token; + pb_bytes_array_t *order_by; + google_firestore_v1_DocumentMask mask; + pb_size_t which_consistency_selector; + union { + pb_bytes_array_t *transaction; + 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; + +typedef struct _google_firestore_v1_RunQueryRequest { + pb_bytes_array_t *parent; + pb_size_t which_query_type; + union { + google_firestore_v1_StructuredQuery structured_query; + } query_type; + pb_size_t which_consistency_selector; + union { + pb_bytes_array_t *transaction; + 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; + +typedef struct _google_firestore_v1_RunQueryResponse { + google_firestore_v1_Document document; + 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; + +typedef struct _google_firestore_v1_TargetChange { + google_firestore_v1_TargetChange_TargetChangeType target_change_type; + pb_size_t target_ids_count; + int32_t *target_ids; + bool has_cause; + 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; + +typedef struct _google_firestore_v1_Target_QueryTarget { + pb_bytes_array_t *parent; + pb_size_t which_query_type; + 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; + +typedef struct _google_firestore_v1_UpdateDocumentRequest { + google_firestore_v1_Document document; + 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; + +typedef struct _google_firestore_v1_WriteResponse { + pb_bytes_array_t *stream_id; + pb_bytes_array_t *stream_token; + 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; + +typedef struct _google_firestore_v1_ListenResponse { + pb_size_t which_response_type; + union { + google_firestore_v1_TargetChange target_change; + google_firestore_v1_DocumentChange document_change; + google_firestore_v1_DocumentDelete document_delete; + 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; + +typedef struct _google_firestore_v1_Target { + pb_size_t which_target_type; + union { + google_firestore_v1_Target_QueryTarget query; + google_firestore_v1_Target_DocumentsTarget documents; + } target_type; + pb_size_t which_resume_type; + union { + pb_bytes_array_t *resume_token; + google_protobuf_Timestamp read_time; + } 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; + +typedef struct _google_firestore_v1_ListenRequest { + pb_bytes_array_t *database; + pb_size_t which_target_change; + union { + google_firestore_v1_Target add_target; + int32_t remove_target; + }; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_firestore_v1_GetDocumentRequest_init_default {NULL, google_firestore_v1_DocumentMask_init_default, 0, {NULL}} +#define google_firestore_v1_ListDocumentsRequest_init_default {NULL, NULL, 0, NULL, NULL, google_firestore_v1_DocumentMask_init_default, 0, {NULL}, 0} +#define google_firestore_v1_ListDocumentsResponse_init_default {0, NULL, NULL} +#define google_firestore_v1_CreateDocumentRequest_init_default {NULL, NULL, NULL, google_firestore_v1_Document_init_default, google_firestore_v1_DocumentMask_init_default} +#define google_firestore_v1_UpdateDocumentRequest_init_default {google_firestore_v1_Document_init_default, google_firestore_v1_DocumentMask_init_default, google_firestore_v1_DocumentMask_init_default, google_firestore_v1_Precondition_init_default} +#define google_firestore_v1_DeleteDocumentRequest_init_default {NULL, google_firestore_v1_Precondition_init_default} +#define google_firestore_v1_BatchGetDocumentsRequest_init_default {NULL, 0, NULL, google_firestore_v1_DocumentMask_init_default, 0, {NULL}} +#define google_firestore_v1_BatchGetDocumentsResponse_init_default {0, {google_firestore_v1_Document_init_default}, NULL, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_BeginTransactionRequest_init_default {NULL, google_firestore_v1_TransactionOptions_init_default} +#define google_firestore_v1_BeginTransactionResponse_init_default {NULL} +#define google_firestore_v1_CommitRequest_init_default {NULL, 0, NULL, NULL} +#define google_firestore_v1_CommitResponse_init_default {0, NULL, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_RollbackRequest_init_default {NULL, NULL} +#define google_firestore_v1_RunQueryRequest_init_default {NULL, 0, {google_firestore_v1_StructuredQuery_init_default}, 0, {NULL}} +#define google_firestore_v1_RunQueryResponse_init_default {google_firestore_v1_Document_init_default, NULL, google_protobuf_Timestamp_init_default, 0} +#define google_firestore_v1_WriteRequest_init_default {NULL, NULL, 0, NULL, NULL, 0, NULL} +#define google_firestore_v1_WriteRequest_LabelsEntry_init_default {NULL, NULL} +#define google_firestore_v1_WriteResponse_init_default {NULL, NULL, 0, NULL, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_ListenRequest_init_default {NULL, 0, {google_firestore_v1_Target_init_default}, 0, NULL} +#define google_firestore_v1_ListenRequest_LabelsEntry_init_default {NULL, NULL} +#define google_firestore_v1_ListenResponse_init_default {0, {google_firestore_v1_TargetChange_init_default}} +#define google_firestore_v1_Target_init_default {0, {google_firestore_v1_Target_QueryTarget_init_default}, 0, {NULL}, 0, 0} +#define google_firestore_v1_Target_DocumentsTarget_init_default {0, NULL} +#define google_firestore_v1_Target_QueryTarget_init_default {NULL, 0, {google_firestore_v1_StructuredQuery_init_default}} +#define google_firestore_v1_TargetChange_init_default {_google_firestore_v1_TargetChange_TargetChangeType_MIN, 0, NULL, false, google_rpc_Status_init_default, NULL, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_ListCollectionIdsRequest_init_default {NULL, 0, NULL} +#define google_firestore_v1_ListCollectionIdsResponse_init_default {0, NULL, NULL} +#define google_firestore_v1_GetDocumentRequest_init_zero {NULL, google_firestore_v1_DocumentMask_init_zero, 0, {NULL}} +#define google_firestore_v1_ListDocumentsRequest_init_zero {NULL, NULL, 0, NULL, NULL, google_firestore_v1_DocumentMask_init_zero, 0, {NULL}, 0} +#define google_firestore_v1_ListDocumentsResponse_init_zero {0, NULL, NULL} +#define google_firestore_v1_CreateDocumentRequest_init_zero {NULL, NULL, NULL, google_firestore_v1_Document_init_zero, google_firestore_v1_DocumentMask_init_zero} +#define google_firestore_v1_UpdateDocumentRequest_init_zero {google_firestore_v1_Document_init_zero, google_firestore_v1_DocumentMask_init_zero, google_firestore_v1_DocumentMask_init_zero, google_firestore_v1_Precondition_init_zero} +#define google_firestore_v1_DeleteDocumentRequest_init_zero {NULL, google_firestore_v1_Precondition_init_zero} +#define google_firestore_v1_BatchGetDocumentsRequest_init_zero {NULL, 0, NULL, google_firestore_v1_DocumentMask_init_zero, 0, {NULL}} +#define google_firestore_v1_BatchGetDocumentsResponse_init_zero {0, {google_firestore_v1_Document_init_zero}, NULL, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_BeginTransactionRequest_init_zero {NULL, google_firestore_v1_TransactionOptions_init_zero} +#define google_firestore_v1_BeginTransactionResponse_init_zero {NULL} +#define google_firestore_v1_CommitRequest_init_zero {NULL, 0, NULL, NULL} +#define google_firestore_v1_CommitResponse_init_zero {0, NULL, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_RollbackRequest_init_zero {NULL, NULL} +#define google_firestore_v1_RunQueryRequest_init_zero {NULL, 0, {google_firestore_v1_StructuredQuery_init_zero}, 0, {NULL}} +#define google_firestore_v1_RunQueryResponse_init_zero {google_firestore_v1_Document_init_zero, NULL, google_protobuf_Timestamp_init_zero, 0} +#define google_firestore_v1_WriteRequest_init_zero {NULL, NULL, 0, NULL, NULL, 0, NULL} +#define google_firestore_v1_WriteRequest_LabelsEntry_init_zero {NULL, NULL} +#define google_firestore_v1_WriteResponse_init_zero {NULL, NULL, 0, NULL, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_ListenRequest_init_zero {NULL, 0, {google_firestore_v1_Target_init_zero}, 0, NULL} +#define google_firestore_v1_ListenRequest_LabelsEntry_init_zero {NULL, NULL} +#define google_firestore_v1_ListenResponse_init_zero {0, {google_firestore_v1_TargetChange_init_zero}} +#define google_firestore_v1_Target_init_zero {0, {google_firestore_v1_Target_QueryTarget_init_zero}, 0, {NULL}, 0, 0} +#define google_firestore_v1_Target_DocumentsTarget_init_zero {0, NULL} +#define google_firestore_v1_Target_QueryTarget_init_zero {NULL, 0, {google_firestore_v1_StructuredQuery_init_zero}} +#define google_firestore_v1_TargetChange_init_zero {_google_firestore_v1_TargetChange_TargetChangeType_MIN, 0, NULL, false, google_rpc_Status_init_zero, NULL, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_ListCollectionIdsRequest_init_zero {NULL, 0, NULL} +#define google_firestore_v1_ListCollectionIdsResponse_init_zero {0, NULL, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_firestore_v1_BeginTransactionResponse_transaction_tag 1 +#define google_firestore_v1_CommitRequest_database_tag 1 +#define google_firestore_v1_CommitRequest_writes_tag 2 +#define google_firestore_v1_CommitRequest_transaction_tag 3 +#define google_firestore_v1_ListCollectionIdsResponse_collection_ids_tag 1 +#define google_firestore_v1_ListCollectionIdsResponse_next_page_token_tag 2 +#define google_firestore_v1_ListDocumentsResponse_documents_tag 1 +#define google_firestore_v1_ListDocumentsResponse_next_page_token_tag 2 +#define google_firestore_v1_ListenRequest_LabelsEntry_key_tag 1 +#define google_firestore_v1_ListenRequest_LabelsEntry_value_tag 2 +#define google_firestore_v1_RollbackRequest_database_tag 1 +#define google_firestore_v1_RollbackRequest_transaction_tag 2 +#define google_firestore_v1_Target_DocumentsTarget_documents_tag 2 +#define google_firestore_v1_WriteRequest_database_tag 1 +#define google_firestore_v1_WriteRequest_stream_id_tag 2 +#define google_firestore_v1_WriteRequest_writes_tag 3 +#define google_firestore_v1_WriteRequest_stream_token_tag 4 +#define google_firestore_v1_WriteRequest_labels_tag 5 +#define google_firestore_v1_WriteRequest_LabelsEntry_key_tag 1 +#define google_firestore_v1_WriteRequest_LabelsEntry_value_tag 2 +#define google_firestore_v1_BatchGetDocumentsRequest_transaction_tag 4 +#define google_firestore_v1_BatchGetDocumentsRequest_new_transaction_tag 5 +#define google_firestore_v1_BatchGetDocumentsRequest_read_time_tag 7 +#define google_firestore_v1_BatchGetDocumentsRequest_database_tag 1 +#define google_firestore_v1_BatchGetDocumentsRequest_documents_tag 2 +#define google_firestore_v1_BatchGetDocumentsRequest_mask_tag 3 +#define google_firestore_v1_BatchGetDocumentsResponse_found_tag 1 +#define google_firestore_v1_BatchGetDocumentsResponse_missing_tag 2 +#define google_firestore_v1_BatchGetDocumentsResponse_transaction_tag 3 +#define google_firestore_v1_BatchGetDocumentsResponse_read_time_tag 4 +#define google_firestore_v1_BeginTransactionRequest_database_tag 1 +#define google_firestore_v1_BeginTransactionRequest_options_tag 2 +#define google_firestore_v1_CommitResponse_write_results_tag 1 +#define google_firestore_v1_CommitResponse_commit_time_tag 2 +#define google_firestore_v1_CreateDocumentRequest_parent_tag 1 +#define google_firestore_v1_CreateDocumentRequest_collection_id_tag 2 +#define google_firestore_v1_CreateDocumentRequest_document_id_tag 3 +#define google_firestore_v1_CreateDocumentRequest_document_tag 4 +#define google_firestore_v1_CreateDocumentRequest_mask_tag 5 +#define google_firestore_v1_DeleteDocumentRequest_name_tag 1 +#define google_firestore_v1_DeleteDocumentRequest_current_document_tag 2 +#define google_firestore_v1_GetDocumentRequest_transaction_tag 3 +#define google_firestore_v1_GetDocumentRequest_read_time_tag 5 +#define google_firestore_v1_GetDocumentRequest_name_tag 1 +#define google_firestore_v1_GetDocumentRequest_mask_tag 2 +#define google_firestore_v1_ListCollectionIdsRequest_parent_tag 1 +#define google_firestore_v1_ListCollectionIdsRequest_page_size_tag 2 +#define google_firestore_v1_ListCollectionIdsRequest_page_token_tag 3 +#define google_firestore_v1_ListDocumentsRequest_transaction_tag 8 +#define google_firestore_v1_ListDocumentsRequest_read_time_tag 10 +#define google_firestore_v1_ListDocumentsRequest_parent_tag 1 +#define google_firestore_v1_ListDocumentsRequest_collection_id_tag 2 +#define google_firestore_v1_ListDocumentsRequest_page_size_tag 3 +#define google_firestore_v1_ListDocumentsRequest_page_token_tag 4 +#define google_firestore_v1_ListDocumentsRequest_order_by_tag 6 +#define google_firestore_v1_ListDocumentsRequest_mask_tag 7 +#define google_firestore_v1_ListDocumentsRequest_show_missing_tag 12 +#define google_firestore_v1_RunQueryRequest_structured_query_tag 2 +#define google_firestore_v1_RunQueryRequest_transaction_tag 5 +#define google_firestore_v1_RunQueryRequest_new_transaction_tag 6 +#define google_firestore_v1_RunQueryRequest_read_time_tag 7 +#define google_firestore_v1_RunQueryRequest_parent_tag 1 +#define google_firestore_v1_RunQueryResponse_transaction_tag 2 +#define google_firestore_v1_RunQueryResponse_document_tag 1 +#define google_firestore_v1_RunQueryResponse_read_time_tag 3 +#define google_firestore_v1_RunQueryResponse_skipped_results_tag 4 +#define google_firestore_v1_TargetChange_target_change_type_tag 1 +#define google_firestore_v1_TargetChange_target_ids_tag 2 +#define google_firestore_v1_TargetChange_cause_tag 3 +#define google_firestore_v1_TargetChange_resume_token_tag 4 +#define google_firestore_v1_TargetChange_read_time_tag 6 +#define google_firestore_v1_Target_QueryTarget_structured_query_tag 2 +#define google_firestore_v1_Target_QueryTarget_parent_tag 1 +#define google_firestore_v1_UpdateDocumentRequest_document_tag 1 +#define google_firestore_v1_UpdateDocumentRequest_update_mask_tag 2 +#define google_firestore_v1_UpdateDocumentRequest_mask_tag 3 +#define google_firestore_v1_UpdateDocumentRequest_current_document_tag 4 +#define google_firestore_v1_WriteResponse_stream_id_tag 1 +#define google_firestore_v1_WriteResponse_stream_token_tag 2 +#define google_firestore_v1_WriteResponse_write_results_tag 3 +#define google_firestore_v1_WriteResponse_commit_time_tag 4 +#define google_firestore_v1_ListenResponse_target_change_tag 2 +#define google_firestore_v1_ListenResponse_document_change_tag 3 +#define google_firestore_v1_ListenResponse_document_delete_tag 4 +#define google_firestore_v1_ListenResponse_filter_tag 5 +#define google_firestore_v1_ListenResponse_document_remove_tag 6 +#define google_firestore_v1_Target_query_tag 2 +#define google_firestore_v1_Target_documents_tag 3 +#define google_firestore_v1_Target_resume_token_tag 4 +#define google_firestore_v1_Target_read_time_tag 11 +#define google_firestore_v1_Target_target_id_tag 5 +#define google_firestore_v1_Target_once_tag 6 +#define google_firestore_v1_ListenRequest_add_target_tag 2 +#define google_firestore_v1_ListenRequest_remove_target_tag 3 +#define google_firestore_v1_ListenRequest_database_tag 1 +#define google_firestore_v1_ListenRequest_labels_tag 4 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_firestore_v1_GetDocumentRequest_fields[5]; +extern const pb_field_t google_firestore_v1_ListDocumentsRequest_fields[10]; +extern const pb_field_t google_firestore_v1_ListDocumentsResponse_fields[3]; +extern const pb_field_t google_firestore_v1_CreateDocumentRequest_fields[6]; +extern const pb_field_t google_firestore_v1_UpdateDocumentRequest_fields[5]; +extern const pb_field_t google_firestore_v1_DeleteDocumentRequest_fields[3]; +extern const pb_field_t google_firestore_v1_BatchGetDocumentsRequest_fields[7]; +extern const pb_field_t google_firestore_v1_BatchGetDocumentsResponse_fields[5]; +extern const pb_field_t google_firestore_v1_BeginTransactionRequest_fields[3]; +extern const pb_field_t google_firestore_v1_BeginTransactionResponse_fields[2]; +extern const pb_field_t google_firestore_v1_CommitRequest_fields[4]; +extern const pb_field_t google_firestore_v1_CommitResponse_fields[3]; +extern const pb_field_t google_firestore_v1_RollbackRequest_fields[3]; +extern const pb_field_t google_firestore_v1_RunQueryRequest_fields[6]; +extern const pb_field_t google_firestore_v1_RunQueryResponse_fields[5]; +extern const pb_field_t google_firestore_v1_WriteRequest_fields[6]; +extern const pb_field_t google_firestore_v1_WriteRequest_LabelsEntry_fields[3]; +extern const pb_field_t google_firestore_v1_WriteResponse_fields[5]; +extern const pb_field_t google_firestore_v1_ListenRequest_fields[5]; +extern const pb_field_t google_firestore_v1_ListenRequest_LabelsEntry_fields[3]; +extern const pb_field_t google_firestore_v1_ListenResponse_fields[6]; +extern const pb_field_t google_firestore_v1_Target_fields[7]; +extern const pb_field_t google_firestore_v1_Target_DocumentsTarget_fields[2]; +extern const pb_field_t google_firestore_v1_Target_QueryTarget_fields[3]; +extern const pb_field_t google_firestore_v1_TargetChange_fields[6]; +extern const pb_field_t google_firestore_v1_ListCollectionIdsRequest_fields[4]; +extern const pb_field_t google_firestore_v1_ListCollectionIdsResponse_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_firestore_v1_GetDocumentRequest_size depends on runtime parameters */ +/* google_firestore_v1_ListDocumentsRequest_size depends on runtime parameters */ +/* google_firestore_v1_ListDocumentsResponse_size depends on runtime parameters */ +/* google_firestore_v1_CreateDocumentRequest_size depends on runtime parameters */ +#define google_firestore_v1_UpdateDocumentRequest_size (44 + google_firestore_v1_Document_size + google_firestore_v1_DocumentMask_size + google_firestore_v1_DocumentMask_size) +/* google_firestore_v1_DeleteDocumentRequest_size depends on runtime parameters */ +/* google_firestore_v1_BatchGetDocumentsRequest_size depends on runtime parameters */ +/* google_firestore_v1_BatchGetDocumentsResponse_size depends on runtime parameters */ +/* google_firestore_v1_BeginTransactionRequest_size depends on runtime parameters */ +/* google_firestore_v1_BeginTransactionResponse_size depends on runtime parameters */ +/* google_firestore_v1_CommitRequest_size depends on runtime parameters */ +/* google_firestore_v1_CommitResponse_size depends on runtime parameters */ +/* google_firestore_v1_RollbackRequest_size depends on runtime parameters */ +/* google_firestore_v1_RunQueryRequest_size depends on runtime parameters */ +/* google_firestore_v1_RunQueryResponse_size depends on runtime parameters */ +/* google_firestore_v1_WriteRequest_size depends on runtime parameters */ +/* google_firestore_v1_WriteRequest_LabelsEntry_size depends on runtime parameters */ +/* google_firestore_v1_WriteResponse_size depends on runtime parameters */ +/* google_firestore_v1_ListenRequest_size depends on runtime parameters */ +/* google_firestore_v1_ListenRequest_LabelsEntry_size depends on runtime parameters */ +/* google_firestore_v1_ListenResponse_size depends on runtime parameters */ +/* google_firestore_v1_Target_size depends on runtime parameters */ +/* google_firestore_v1_Target_DocumentsTarget_size depends on runtime parameters */ +/* google_firestore_v1_Target_QueryTarget_size depends on runtime parameters */ +/* google_firestore_v1_TargetChange_size depends on runtime parameters */ +/* google_firestore_v1_ListCollectionIdsRequest_size depends on runtime parameters */ +/* google_firestore_v1_ListCollectionIdsResponse_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define FIRESTORE_MESSAGES \ + + +#endif + +const char* EnumToString( + google_firestore_v1_TargetChange_TargetChangeType value); +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc new file mode 100644 index 0000000..0e40a97 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc @@ -0,0 +1,390 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_firestore_v1_StructuredQuery_fields[9] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery, select, select, &google_firestore_v1_StructuredQuery_Projection_fields), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery, from, select, &google_firestore_v1_StructuredQuery_CollectionSelector_fields), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, where, from, &google_firestore_v1_StructuredQuery_Filter_fields), + PB_FIELD( 4, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery, order_by, where, &google_firestore_v1_StructuredQuery_Order_fields), + PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_StructuredQuery, limit, order_by, &google_protobuf_Int32Value_fields), + PB_FIELD( 6, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, offset, limit, 0), + PB_FIELD( 7, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, start_at, offset, &google_firestore_v1_Cursor_fields), + PB_FIELD( 8, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, end_at, start_at, &google_firestore_v1_Cursor_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_CollectionSelector_fields[3] = { + PB_FIELD( 2, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_StructuredQuery_CollectionSelector, collection_id, collection_id, 0), + PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_CollectionSelector, all_descendants, collection_id, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_Filter_fields[4] = { + PB_ANONYMOUS_ONEOF_FIELD(filter_type, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_StructuredQuery_Filter, composite_filter, composite_filter, &google_firestore_v1_StructuredQuery_CompositeFilter_fields), + PB_ANONYMOUS_ONEOF_FIELD(filter_type, 2, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredQuery_Filter, field_filter, field_filter, &google_firestore_v1_StructuredQuery_FieldFilter_fields), + PB_ANONYMOUS_ONEOF_FIELD(filter_type, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredQuery_Filter, unary_filter, unary_filter, &google_firestore_v1_StructuredQuery_UnaryFilter_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_CompositeFilter_fields[3] = { + PB_FIELD( 1, UENUM , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_CompositeFilter, op, op, 0), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery_CompositeFilter, filters, op, &google_firestore_v1_StructuredQuery_Filter_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_FieldFilter_fields[4] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_FieldFilter, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields), + PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_FieldFilter, op, field, 0), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_FieldFilter, value, op, &google_firestore_v1_Value_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_UnaryFilter_fields[3] = { + PB_FIELD( 1, UENUM , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_UnaryFilter, op, op, 0), + PB_ANONYMOUS_ONEOF_FIELD(operand_type, 2, MESSAGE , ONEOF, STATIC , OTHER, google_firestore_v1_StructuredQuery_UnaryFilter, field, op, &google_firestore_v1_StructuredQuery_FieldReference_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_Order_fields[3] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_Order, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields), + PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_Order, direction, field, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_FieldReference_fields[2] = { + PB_FIELD( 2, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_StructuredQuery_FieldReference, field_path, field_path, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_StructuredQuery_Projection_fields[2] = { + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_StructuredQuery_Projection, fields, fields, &google_firestore_v1_StructuredQuery_FieldReference_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_Cursor_fields[3] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_Cursor, values, values, &google_firestore_v1_Value_fields), + PB_FIELD( 2, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_Cursor, before, values, 0), + PB_LAST_FIELD +}; + + + + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_StructuredQuery, select) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, where) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, start_at) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, end_at) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, limit) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, composite_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, field_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, unary_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, field) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, value) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_UnaryFilter, field) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Order, field) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_StructuredQuery_google_firestore_v1_StructuredQuery_CollectionSelector_google_firestore_v1_StructuredQuery_Filter_google_firestore_v1_StructuredQuery_CompositeFilter_google_firestore_v1_StructuredQuery_FieldFilter_google_firestore_v1_StructuredQuery_UnaryFilter_google_firestore_v1_StructuredQuery_Order_google_firestore_v1_StructuredQuery_FieldReference_google_firestore_v1_StructuredQuery_Projection_google_firestore_v1_Cursor) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_StructuredQuery, select) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, where) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, start_at) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, end_at) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, limit) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, composite_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, field_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, unary_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, field) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, value) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_UnaryFilter, field) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Order, field) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_StructuredQuery_google_firestore_v1_StructuredQuery_CollectionSelector_google_firestore_v1_StructuredQuery_Filter_google_firestore_v1_StructuredQuery_CompositeFilter_google_firestore_v1_StructuredQuery_FieldFilter_google_firestore_v1_StructuredQuery_UnaryFilter_google_firestore_v1_StructuredQuery_Order_google_firestore_v1_StructuredQuery_FieldReference_google_firestore_v1_StructuredQuery_Projection_google_firestore_v1_Cursor) +#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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h new file mode 100644 index 0000000..825257f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h @@ -0,0 +1,282 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_FIRESTORE_V1_QUERY_NANOPB_H_INCLUDED +#define PB_GOOGLE_FIRESTORE_V1_QUERY_NANOPB_H_INCLUDED +#include + +#include "google/api/annotations.nanopb.h" + +#include "google/firestore/v1/document.nanopb.h" + +#include "google/protobuf/wrappers.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _google_firestore_v1_StructuredQuery_Direction { + google_firestore_v1_StructuredQuery_Direction_DIRECTION_UNSPECIFIED = 0, + google_firestore_v1_StructuredQuery_Direction_ASCENDING = 1, + google_firestore_v1_StructuredQuery_Direction_DESCENDING = 2 +} google_firestore_v1_StructuredQuery_Direction; +#define _google_firestore_v1_StructuredQuery_Direction_MIN google_firestore_v1_StructuredQuery_Direction_DIRECTION_UNSPECIFIED +#define _google_firestore_v1_StructuredQuery_Direction_MAX google_firestore_v1_StructuredQuery_Direction_DESCENDING +#define _google_firestore_v1_StructuredQuery_Direction_ARRAYSIZE ((google_firestore_v1_StructuredQuery_Direction)(google_firestore_v1_StructuredQuery_Direction_DESCENDING+1)) + +typedef enum _google_firestore_v1_StructuredQuery_CompositeFilter_Operator { + google_firestore_v1_StructuredQuery_CompositeFilter_Operator_OPERATOR_UNSPECIFIED = 0, + google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND = 1 +} google_firestore_v1_StructuredQuery_CompositeFilter_Operator; +#define _google_firestore_v1_StructuredQuery_CompositeFilter_Operator_MIN google_firestore_v1_StructuredQuery_CompositeFilter_Operator_OPERATOR_UNSPECIFIED +#define _google_firestore_v1_StructuredQuery_CompositeFilter_Operator_MAX google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND +#define _google_firestore_v1_StructuredQuery_CompositeFilter_Operator_ARRAYSIZE ((google_firestore_v1_StructuredQuery_CompositeFilter_Operator)(google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND+1)) + +typedef enum _google_firestore_v1_StructuredQuery_FieldFilter_Operator { + google_firestore_v1_StructuredQuery_FieldFilter_Operator_OPERATOR_UNSPECIFIED = 0, + google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN = 1, + google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN_OR_EQUAL = 2, + 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_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_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_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_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; + +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; + +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; + +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; + +typedef struct _google_firestore_v1_StructuredQuery_UnaryFilter { + google_firestore_v1_StructuredQuery_UnaryFilter_Operator op; + pb_size_t which_operand_type; + 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; + +typedef struct _google_firestore_v1_StructuredQuery_Filter { + pb_size_t which_filter_type; + union { + google_firestore_v1_StructuredQuery_CompositeFilter composite_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; + +typedef struct _google_firestore_v1_StructuredQuery { + google_firestore_v1_StructuredQuery_Projection select; + pb_size_t from_count; + struct _google_firestore_v1_StructuredQuery_CollectionSelector *from; + google_firestore_v1_StructuredQuery_Filter where; + pb_size_t order_by_count; + struct _google_firestore_v1_StructuredQuery_Order *order_by; + bool has_limit; + google_protobuf_Int32Value limit; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_firestore_v1_StructuredQuery_init_default {google_firestore_v1_StructuredQuery_Projection_init_default, 0, NULL, google_firestore_v1_StructuredQuery_Filter_init_default, 0, NULL, false, google_protobuf_Int32Value_init_default, 0, google_firestore_v1_Cursor_init_default, google_firestore_v1_Cursor_init_default} +#define google_firestore_v1_StructuredQuery_CollectionSelector_init_default {NULL, 0} +#define google_firestore_v1_StructuredQuery_Filter_init_default {0, {google_firestore_v1_StructuredQuery_CompositeFilter_init_default}} +#define google_firestore_v1_StructuredQuery_CompositeFilter_init_default {_google_firestore_v1_StructuredQuery_CompositeFilter_Operator_MIN, 0, NULL} +#define google_firestore_v1_StructuredQuery_FieldFilter_init_default {google_firestore_v1_StructuredQuery_FieldReference_init_default, _google_firestore_v1_StructuredQuery_FieldFilter_Operator_MIN, google_firestore_v1_Value_init_default} +#define google_firestore_v1_StructuredQuery_UnaryFilter_init_default {_google_firestore_v1_StructuredQuery_UnaryFilter_Operator_MIN, 0, {google_firestore_v1_StructuredQuery_FieldReference_init_default}} +#define google_firestore_v1_StructuredQuery_Order_init_default {google_firestore_v1_StructuredQuery_FieldReference_init_default, _google_firestore_v1_StructuredQuery_Direction_MIN} +#define google_firestore_v1_StructuredQuery_FieldReference_init_default {NULL} +#define google_firestore_v1_StructuredQuery_Projection_init_default {0, NULL} +#define google_firestore_v1_Cursor_init_default {0, NULL, 0} +#define google_firestore_v1_StructuredQuery_init_zero {google_firestore_v1_StructuredQuery_Projection_init_zero, 0, NULL, google_firestore_v1_StructuredQuery_Filter_init_zero, 0, NULL, false, google_protobuf_Int32Value_init_zero, 0, google_firestore_v1_Cursor_init_zero, google_firestore_v1_Cursor_init_zero} +#define google_firestore_v1_StructuredQuery_CollectionSelector_init_zero {NULL, 0} +#define google_firestore_v1_StructuredQuery_Filter_init_zero {0, {google_firestore_v1_StructuredQuery_CompositeFilter_init_zero}} +#define google_firestore_v1_StructuredQuery_CompositeFilter_init_zero {_google_firestore_v1_StructuredQuery_CompositeFilter_Operator_MIN, 0, NULL} +#define google_firestore_v1_StructuredQuery_FieldFilter_init_zero {google_firestore_v1_StructuredQuery_FieldReference_init_zero, _google_firestore_v1_StructuredQuery_FieldFilter_Operator_MIN, google_firestore_v1_Value_init_zero} +#define google_firestore_v1_StructuredQuery_UnaryFilter_init_zero {_google_firestore_v1_StructuredQuery_UnaryFilter_Operator_MIN, 0, {google_firestore_v1_StructuredQuery_FieldReference_init_zero}} +#define google_firestore_v1_StructuredQuery_Order_init_zero {google_firestore_v1_StructuredQuery_FieldReference_init_zero, _google_firestore_v1_StructuredQuery_Direction_MIN} +#define google_firestore_v1_StructuredQuery_FieldReference_init_zero {NULL} +#define google_firestore_v1_StructuredQuery_Projection_init_zero {0, NULL} +#define google_firestore_v1_Cursor_init_zero {0, NULL, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_firestore_v1_StructuredQuery_FieldReference_field_path_tag 2 +#define google_firestore_v1_StructuredQuery_Projection_fields_tag 2 +#define google_firestore_v1_Cursor_values_tag 1 +#define google_firestore_v1_Cursor_before_tag 2 +#define google_firestore_v1_StructuredQuery_CollectionSelector_collection_id_tag 2 +#define google_firestore_v1_StructuredQuery_CollectionSelector_all_descendants_tag 3 +#define google_firestore_v1_StructuredQuery_CompositeFilter_op_tag 1 +#define google_firestore_v1_StructuredQuery_CompositeFilter_filters_tag 2 +#define google_firestore_v1_StructuredQuery_FieldFilter_field_tag 1 +#define google_firestore_v1_StructuredQuery_FieldFilter_op_tag 2 +#define google_firestore_v1_StructuredQuery_FieldFilter_value_tag 3 +#define google_firestore_v1_StructuredQuery_Order_field_tag 1 +#define google_firestore_v1_StructuredQuery_Order_direction_tag 2 +#define google_firestore_v1_StructuredQuery_UnaryFilter_field_tag 2 +#define google_firestore_v1_StructuredQuery_UnaryFilter_op_tag 1 +#define google_firestore_v1_StructuredQuery_Filter_composite_filter_tag 1 +#define google_firestore_v1_StructuredQuery_Filter_field_filter_tag 2 +#define google_firestore_v1_StructuredQuery_Filter_unary_filter_tag 3 +#define google_firestore_v1_StructuredQuery_select_tag 1 +#define google_firestore_v1_StructuredQuery_from_tag 2 +#define google_firestore_v1_StructuredQuery_where_tag 3 +#define google_firestore_v1_StructuredQuery_order_by_tag 4 +#define google_firestore_v1_StructuredQuery_start_at_tag 7 +#define google_firestore_v1_StructuredQuery_end_at_tag 8 +#define google_firestore_v1_StructuredQuery_offset_tag 6 +#define google_firestore_v1_StructuredQuery_limit_tag 5 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_firestore_v1_StructuredQuery_fields[9]; +extern const pb_field_t google_firestore_v1_StructuredQuery_CollectionSelector_fields[3]; +extern const pb_field_t google_firestore_v1_StructuredQuery_Filter_fields[4]; +extern const pb_field_t google_firestore_v1_StructuredQuery_CompositeFilter_fields[3]; +extern const pb_field_t google_firestore_v1_StructuredQuery_FieldFilter_fields[4]; +extern const pb_field_t google_firestore_v1_StructuredQuery_UnaryFilter_fields[3]; +extern const pb_field_t google_firestore_v1_StructuredQuery_Order_fields[3]; +extern const pb_field_t google_firestore_v1_StructuredQuery_FieldReference_fields[2]; +extern const pb_field_t google_firestore_v1_StructuredQuery_Projection_fields[2]; +extern const pb_field_t google_firestore_v1_Cursor_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_firestore_v1_StructuredQuery_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_CollectionSelector_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_Filter_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_CompositeFilter_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_FieldFilter_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_UnaryFilter_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_Order_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_FieldReference_size depends on runtime parameters */ +/* google_firestore_v1_StructuredQuery_Projection_size depends on runtime parameters */ +/* google_firestore_v1_Cursor_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define QUERY_MESSAGES \ + + +#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 + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc new file mode 100644 index 0000000..a1a628a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc @@ -0,0 +1,317 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_firestore_v1_Write_fields[8] = { + 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), + PB_FIELD( 7, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_Write, update_transforms, current_document, &google_firestore_v1_DocumentTransform_FieldTransform_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DocumentTransform_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_DocumentTransform, document, document, 0), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_DocumentTransform, field_transforms, document, &google_firestore_v1_DocumentTransform_FieldTransform_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DocumentTransform_FieldTransform_fields[8] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_DocumentTransform_FieldTransform, field_path, field_path, 0), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 2, UENUM , ONEOF, STATIC , OTHER, google_firestore_v1_DocumentTransform_FieldTransform, set_to_server_value, field_path, 0), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_DocumentTransform_FieldTransform, increment, field_path, &google_firestore_v1_Value_fields), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 4, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_DocumentTransform_FieldTransform, maximum, field_path, &google_firestore_v1_Value_fields), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 5, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_DocumentTransform_FieldTransform, minimum, field_path, &google_firestore_v1_Value_fields), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 6, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_DocumentTransform_FieldTransform, append_missing_elements, field_path, &google_firestore_v1_ArrayValue_fields), + PB_ANONYMOUS_ONEOF_FIELD(transform_type, 7, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_DocumentTransform_FieldTransform, remove_all_from_array, field_path, &google_firestore_v1_ArrayValue_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_WriteResult_fields[3] = { + PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, google_firestore_v1_WriteResult, update_time, update_time, &google_protobuf_Timestamp_fields), + PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_WriteResult, transform_results, update_time, &google_firestore_v1_Value_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DocumentChange_fields[4] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_DocumentChange, document, document, &google_firestore_v1_Document_fields), + PB_FIELD( 5, INT32 , REPEATED, POINTER , OTHER, google_firestore_v1_DocumentChange, target_ids, document, 0), + PB_FIELD( 6, INT32 , REPEATED, POINTER , OTHER, google_firestore_v1_DocumentChange, removed_target_ids, target_ids, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DocumentDelete_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_DocumentDelete, document, document, 0), + PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_DocumentDelete, read_time, document, &google_protobuf_Timestamp_fields), + PB_FIELD( 6, INT32 , REPEATED, POINTER , OTHER, google_firestore_v1_DocumentDelete, removed_target_ids, read_time, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_DocumentRemove_fields[4] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_DocumentRemove, document, document, 0), + PB_FIELD( 2, INT32 , REPEATED, POINTER , OTHER, google_firestore_v1_DocumentRemove, removed_target_ids, document, 0), + PB_FIELD( 4, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_DocumentRemove, read_time, removed_target_ids, &google_protobuf_Timestamp_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_firestore_v1_ExistenceFilter_fields[3] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, google_firestore_v1_ExistenceFilter, target_id, target_id, 0), + PB_FIELD( 2, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_ExistenceFilter, count, target_id, 0), + PB_LAST_FIELD +}; + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Write, update) < 65536 && pb_membersize(google_firestore_v1_Write, transform) < 65536 && pb_membersize(google_firestore_v1_Write, update_mask) < 65536 && pb_membersize(google_firestore_v1_Write, current_document) < 65536 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, increment) < 65536 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, maximum) < 65536 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, minimum) < 65536 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, append_missing_elements) < 65536 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, remove_all_from_array) < 65536 && pb_membersize(google_firestore_v1_WriteResult, update_time) < 65536 && pb_membersize(google_firestore_v1_DocumentChange, document) < 65536 && pb_membersize(google_firestore_v1_DocumentDelete, read_time) < 65536 && pb_membersize(google_firestore_v1_DocumentRemove, read_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_Write_google_firestore_v1_DocumentTransform_google_firestore_v1_DocumentTransform_FieldTransform_google_firestore_v1_WriteResult_google_firestore_v1_DocumentChange_google_firestore_v1_DocumentDelete_google_firestore_v1_DocumentRemove_google_firestore_v1_ExistenceFilter) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Write, update) < 256 && pb_membersize(google_firestore_v1_Write, transform) < 256 && pb_membersize(google_firestore_v1_Write, update_mask) < 256 && pb_membersize(google_firestore_v1_Write, current_document) < 256 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, increment) < 256 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, maximum) < 256 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, minimum) < 256 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, append_missing_elements) < 256 && pb_membersize(google_firestore_v1_DocumentTransform_FieldTransform, remove_all_from_array) < 256 && pb_membersize(google_firestore_v1_WriteResult, update_time) < 256 && pb_membersize(google_firestore_v1_DocumentChange, document) < 256 && pb_membersize(google_firestore_v1_DocumentDelete, read_time) < 256 && pb_membersize(google_firestore_v1_DocumentRemove, read_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_Write_google_firestore_v1_DocumentTransform_google_firestore_v1_DocumentTransform_FieldTransform_google_firestore_v1_WriteResult_google_firestore_v1_DocumentChange_google_firestore_v1_DocumentDelete_google_firestore_v1_DocumentRemove_google_firestore_v1_ExistenceFilter) +#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); + } + for (pb_size_t i = 0; i != update_transforms_count; ++i) { + result += PrintMessageField("update_transforms ", + update_transforms[i], 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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h new file mode 100644 index 0000000..a287f51 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h @@ -0,0 +1,233 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_FIRESTORE_V1_WRITE_NANOPB_H_INCLUDED +#define PB_GOOGLE_FIRESTORE_V1_WRITE_NANOPB_H_INCLUDED +#include + +#include "google/api/annotations.nanopb.h" + +#include "google/firestore/v1/common.nanopb.h" + +#include "google/firestore/v1/document.nanopb.h" + +#include "google/protobuf/timestamp.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _google_firestore_v1_DocumentTransform_FieldTransform_ServerValue { + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_SERVER_VALUE_UNSPECIFIED = 0, + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME = 1 +} google_firestore_v1_DocumentTransform_FieldTransform_ServerValue; +#define _google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_MIN google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_SERVER_VALUE_UNSPECIFIED +#define _google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_MAX google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME +#define _google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_ARRAYSIZE ((google_firestore_v1_DocumentTransform_FieldTransform_ServerValue)(google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME+1)) + +/* Struct definitions */ +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; + +typedef struct _google_firestore_v1_DocumentChange { + google_firestore_v1_Document document; + pb_size_t target_ids_count; + 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; + +typedef struct _google_firestore_v1_DocumentDelete { + pb_bytes_array_t *document; + bool has_read_time; + 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; + +typedef struct _google_firestore_v1_DocumentRemove { + pb_bytes_array_t *document; + 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; + +typedef struct _google_firestore_v1_DocumentTransform_FieldTransform { + pb_bytes_array_t *field_path; + pb_size_t which_transform_type; + union { + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue set_to_server_value; + google_firestore_v1_Value increment; + google_firestore_v1_Value maximum; + google_firestore_v1_Value minimum; + 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; + +typedef struct _google_firestore_v1_Write { + pb_size_t which_operation; + 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; + pb_size_t update_transforms_count; + struct _google_firestore_v1_DocumentTransform_FieldTransform *update_transforms; + + std::string ToString(int indent = 0) const; +/* @@protoc_insertion_point(struct:google_firestore_v1_Write) */ +} google_firestore_v1_Write; + +typedef struct _google_firestore_v1_WriteResult { + bool has_update_time; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_firestore_v1_Write_init_default {0, {google_firestore_v1_Document_init_default}, false, google_firestore_v1_DocumentMask_init_default, false, google_firestore_v1_Precondition_init_default, 0, NULL} +#define google_firestore_v1_DocumentTransform_init_default {NULL, 0, NULL} +#define google_firestore_v1_DocumentTransform_FieldTransform_init_default {NULL, 0, {_google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_MIN}} +#define google_firestore_v1_WriteResult_init_default {false, google_protobuf_Timestamp_init_default, 0, NULL} +#define google_firestore_v1_DocumentChange_init_default {google_firestore_v1_Document_init_default, 0, NULL, 0, NULL} +#define google_firestore_v1_DocumentDelete_init_default {NULL, false, google_protobuf_Timestamp_init_default, 0, NULL} +#define google_firestore_v1_DocumentRemove_init_default {NULL, 0, NULL, google_protobuf_Timestamp_init_default} +#define google_firestore_v1_ExistenceFilter_init_default {0, 0} +#define google_firestore_v1_Write_init_zero {0, {google_firestore_v1_Document_init_zero}, false, google_firestore_v1_DocumentMask_init_zero, false, google_firestore_v1_Precondition_init_zero, 0, NULL} +#define google_firestore_v1_DocumentTransform_init_zero {NULL, 0, NULL} +#define google_firestore_v1_DocumentTransform_FieldTransform_init_zero {NULL, 0, {_google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_MIN}} +#define google_firestore_v1_WriteResult_init_zero {false, google_protobuf_Timestamp_init_zero, 0, NULL} +#define google_firestore_v1_DocumentChange_init_zero {google_firestore_v1_Document_init_zero, 0, NULL, 0, NULL} +#define google_firestore_v1_DocumentDelete_init_zero {NULL, false, google_protobuf_Timestamp_init_zero, 0, NULL} +#define google_firestore_v1_DocumentRemove_init_zero {NULL, 0, NULL, google_protobuf_Timestamp_init_zero} +#define google_firestore_v1_ExistenceFilter_init_zero {0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_firestore_v1_DocumentTransform_document_tag 1 +#define google_firestore_v1_DocumentTransform_field_transforms_tag 2 +#define google_firestore_v1_DocumentChange_document_tag 1 +#define google_firestore_v1_DocumentChange_target_ids_tag 5 +#define google_firestore_v1_DocumentChange_removed_target_ids_tag 6 +#define google_firestore_v1_DocumentDelete_document_tag 1 +#define google_firestore_v1_DocumentDelete_removed_target_ids_tag 6 +#define google_firestore_v1_DocumentDelete_read_time_tag 4 +#define google_firestore_v1_DocumentRemove_document_tag 1 +#define google_firestore_v1_DocumentRemove_removed_target_ids_tag 2 +#define google_firestore_v1_DocumentRemove_read_time_tag 4 +#define google_firestore_v1_DocumentTransform_FieldTransform_set_to_server_value_tag 2 +#define google_firestore_v1_DocumentTransform_FieldTransform_increment_tag 3 +#define google_firestore_v1_DocumentTransform_FieldTransform_maximum_tag 4 +#define google_firestore_v1_DocumentTransform_FieldTransform_minimum_tag 5 +#define google_firestore_v1_DocumentTransform_FieldTransform_append_missing_elements_tag 6 +#define google_firestore_v1_DocumentTransform_FieldTransform_remove_all_from_array_tag 7 +#define google_firestore_v1_DocumentTransform_FieldTransform_field_path_tag 1 +#define google_firestore_v1_ExistenceFilter_target_id_tag 1 +#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_update_transforms_tag 7 +#define google_firestore_v1_Write_current_document_tag 4 +#define google_firestore_v1_WriteResult_update_time_tag 1 +#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[8]; +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]; +extern const pb_field_t google_firestore_v1_DocumentChange_fields[4]; +extern const pb_field_t google_firestore_v1_DocumentDelete_fields[4]; +extern const pb_field_t google_firestore_v1_DocumentRemove_fields[4]; +extern const pb_field_t google_firestore_v1_ExistenceFilter_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_firestore_v1_Write_size depends on runtime parameters */ +/* google_firestore_v1_DocumentTransform_size depends on runtime parameters */ +/* google_firestore_v1_DocumentTransform_FieldTransform_size depends on runtime parameters */ +/* google_firestore_v1_WriteResult_size depends on runtime parameters */ +/* google_firestore_v1_DocumentChange_size depends on runtime parameters */ +/* google_firestore_v1_DocumentDelete_size depends on runtime parameters */ +/* google_firestore_v1_DocumentRemove_size depends on runtime parameters */ +#define google_firestore_v1_ExistenceFilter_size 22 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define WRITE_MESSAGES \ + + +#endif + +const char* EnumToString( + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue value); +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc new file mode 100644 index 0000000..53d2ef3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_protobuf_Any_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_protobuf_Any, type_url, type_url, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_protobuf_Any, value, type_url, 0), + PB_LAST_FIELD +}; + + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h new file mode 100644 index 0000000..9864f12 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h @@ -0,0 +1,73 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_PROTOBUF_ANY_NANOPB_H_INCLUDED +#define PB_GOOGLE_PROTOBUF_ANY_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_protobuf_Any_init_default {NULL, NULL} +#define google_protobuf_Any_init_zero {NULL, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_protobuf_Any_type_url_tag 1 +#define google_protobuf_Any_value_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_protobuf_Any_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* google_protobuf_Any_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define ANY_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc new file mode 100644 index 0000000..4ac0085 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_protobuf_Empty_fields[1] = { + PB_LAST_FIELD +}; + + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h new file mode 100644 index 0000000..1f39ae7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h @@ -0,0 +1,70 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_PROTOBUF_EMPTY_NANOPB_H_INCLUDED +#define PB_GOOGLE_PROTOBUF_EMPTY_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_protobuf_Empty_init_default {0} +#define google_protobuf_Empty_init_zero {0} + +/* Field tags (for use in manual encoding/decoding) */ + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_protobuf_Empty_fields[1]; + +/* Maximum encoded size of messages (where known) */ +#define google_protobuf_Empty_size 0 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define EMPTY_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc new file mode 100644 index 0000000..f1d04ba --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc @@ -0,0 +1,194 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_protobuf_Struct_fields[2] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_protobuf_Struct, fields, fields, &google_protobuf_Struct_FieldsEntry_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_Struct_FieldsEntry_fields[3] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_protobuf_Struct_FieldsEntry, key, key, 0), + PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_protobuf_Struct_FieldsEntry, value, key, &google_protobuf_Value_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_Value_fields[7] = { + PB_ANONYMOUS_ONEOF_FIELD(kind, 1, UENUM , ONEOF, STATIC , FIRST, google_protobuf_Value, null_value, null_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(kind, 2, DOUBLE , ONEOF, STATIC , UNION, google_protobuf_Value, number_value, number_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(kind, 3, BYTES , ONEOF, POINTER , UNION, google_protobuf_Value, string_value, string_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(kind, 4, BOOL , ONEOF, STATIC , UNION, google_protobuf_Value, bool_value, bool_value, 0), + PB_ANONYMOUS_ONEOF_FIELD(kind, 5, MESSAGE , ONEOF, STATIC , UNION, google_protobuf_Value, struct_value, struct_value, &google_protobuf_Struct_fields), + PB_ANONYMOUS_ONEOF_FIELD(kind, 6, MESSAGE , ONEOF, STATIC , UNION, google_protobuf_Value, list_value, list_value, &google_protobuf_ListValue_fields), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_ListValue_fields[2] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_protobuf_ListValue, values, values, &google_protobuf_Value_fields), + PB_LAST_FIELD +}; + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_protobuf_Struct_FieldsEntry, value) < 65536 && pb_membersize(google_protobuf_Value, struct_value) < 65536 && pb_membersize(google_protobuf_Value, list_value) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_protobuf_Struct_google_protobuf_Struct_FieldsEntry_google_protobuf_Value_google_protobuf_ListValue) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(google_protobuf_Struct_FieldsEntry, value) < 256 && pb_membersize(google_protobuf_Value, struct_value) < 256 && pb_membersize(google_protobuf_Value, list_value) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_protobuf_Struct_google_protobuf_Struct_FieldsEntry_google_protobuf_Value_google_protobuf_ListValue) +#endif + + +/* On some platforms (such as AVR), double is really float. + * These are not directly supported by nanopb, but see example_avr_double. + * To get rid of this error, remove any double fields from your .proto. + */ +PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h new file mode 100644 index 0000000..4874fb1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h @@ -0,0 +1,133 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_PROTOBUF_STRUCT_NANOPB_H_INCLUDED +#define PB_GOOGLE_PROTOBUF_STRUCT_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _google_protobuf_NullValue { + google_protobuf_NullValue_NULL_VALUE = 0 +} google_protobuf_NullValue; +#define _google_protobuf_NullValue_MIN google_protobuf_NullValue_NULL_VALUE +#define _google_protobuf_NullValue_MAX google_protobuf_NullValue_NULL_VALUE +#define _google_protobuf_NullValue_ARRAYSIZE ((google_protobuf_NullValue)(google_protobuf_NullValue_NULL_VALUE+1)) + +/* Struct definitions */ +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; + +typedef struct _google_protobuf_Value { + pb_size_t which_kind; + union { + google_protobuf_NullValue null_value; + double number_value; + pb_bytes_array_t *string_value; + bool bool_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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_protobuf_Struct_init_default {0, NULL} +#define google_protobuf_Struct_FieldsEntry_init_default {NULL, google_protobuf_Value_init_default} +#define google_protobuf_Value_init_default {0, {_google_protobuf_NullValue_MIN}} +#define google_protobuf_ListValue_init_default {0, NULL} +#define google_protobuf_Struct_init_zero {0, NULL} +#define google_protobuf_Struct_FieldsEntry_init_zero {NULL, google_protobuf_Value_init_zero} +#define google_protobuf_Value_init_zero {0, {_google_protobuf_NullValue_MIN}} +#define google_protobuf_ListValue_init_zero {0, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_protobuf_ListValue_values_tag 1 +#define google_protobuf_Struct_fields_tag 1 +#define google_protobuf_Value_null_value_tag 1 +#define google_protobuf_Value_number_value_tag 2 +#define google_protobuf_Value_string_value_tag 3 +#define google_protobuf_Value_bool_value_tag 4 +#define google_protobuf_Value_struct_value_tag 5 +#define google_protobuf_Value_list_value_tag 6 +#define google_protobuf_Struct_FieldsEntry_key_tag 1 +#define google_protobuf_Struct_FieldsEntry_value_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_protobuf_Struct_fields[2]; +extern const pb_field_t google_protobuf_Struct_FieldsEntry_fields[3]; +extern const pb_field_t google_protobuf_Value_fields[7]; +extern const pb_field_t google_protobuf_ListValue_fields[2]; + +/* Maximum encoded size of messages (where known) */ +/* google_protobuf_Struct_size depends on runtime parameters */ +/* google_protobuf_Struct_FieldsEntry_size depends on runtime parameters */ +/* google_protobuf_Value_size depends on runtime parameters */ +/* google_protobuf_ListValue_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define STRUCT_MESSAGES \ + + +#endif + +const char* EnumToString(google_protobuf_NullValue value); +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc new file mode 100644 index 0000000..8479028 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_protobuf_Timestamp_fields[3] = { + PB_FIELD( 1, INT64 , SINGULAR, STATIC , FIRST, google_protobuf_Timestamp, seconds, seconds, 0), + PB_FIELD( 2, INT32 , SINGULAR, STATIC , OTHER, google_protobuf_Timestamp, nanos, seconds, 0), + PB_LAST_FIELD +}; + + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h new file mode 100644 index 0000000..d1f9b18 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h @@ -0,0 +1,73 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED +#define PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_protobuf_Timestamp_init_default {0, 0} +#define google_protobuf_Timestamp_init_zero {0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_protobuf_Timestamp_seconds_tag 1 +#define google_protobuf_Timestamp_nanos_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_protobuf_Timestamp_fields[3]; + +/* Maximum encoded size of messages (where known) */ +#define google_protobuf_Timestamp_size 22 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define TIMESTAMP_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc new file mode 100644 index 0000000..be6db79 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc @@ -0,0 +1,230 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_protobuf_DoubleValue_fields[2] = { + PB_FIELD( 1, DOUBLE , SINGULAR, STATIC , FIRST, google_protobuf_DoubleValue, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_FloatValue_fields[2] = { + PB_FIELD( 1, FLOAT , SINGULAR, STATIC , FIRST, google_protobuf_FloatValue, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_Int64Value_fields[2] = { + PB_FIELD( 1, INT64 , SINGULAR, STATIC , FIRST, google_protobuf_Int64Value, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_UInt64Value_fields[2] = { + PB_FIELD( 1, UINT64 , SINGULAR, STATIC , FIRST, google_protobuf_UInt64Value, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_Int32Value_fields[2] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, google_protobuf_Int32Value, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_UInt32Value_fields[2] = { + PB_FIELD( 1, UINT32 , SINGULAR, STATIC , FIRST, google_protobuf_UInt32Value, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_BoolValue_fields[2] = { + PB_FIELD( 1, BOOL , SINGULAR, STATIC , FIRST, google_protobuf_BoolValue, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_StringValue_fields[2] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_protobuf_StringValue, value, value, 0), + PB_LAST_FIELD +}; + +const pb_field_t google_protobuf_BytesValue_fields[2] = { + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_protobuf_BytesValue, value, value, 0), + PB_LAST_FIELD +}; + + +/* On some platforms (such as AVR), double is really float. + * These are not directly supported by nanopb, but see example_avr_double. + * To get rid of this error, remove any double fields from your .proto. + */ +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h new file mode 100644 index 0000000..55d2252 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h @@ -0,0 +1,167 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_PROTOBUF_WRAPPERS_NANOPB_H_INCLUDED +#define PB_GOOGLE_PROTOBUF_WRAPPERS_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_protobuf_DoubleValue_init_default {0} +#define google_protobuf_FloatValue_init_default {0} +#define google_protobuf_Int64Value_init_default {0} +#define google_protobuf_UInt64Value_init_default {0} +#define google_protobuf_Int32Value_init_default {0} +#define google_protobuf_UInt32Value_init_default {0} +#define google_protobuf_BoolValue_init_default {0} +#define google_protobuf_StringValue_init_default {NULL} +#define google_protobuf_BytesValue_init_default {NULL} +#define google_protobuf_DoubleValue_init_zero {0} +#define google_protobuf_FloatValue_init_zero {0} +#define google_protobuf_Int64Value_init_zero {0} +#define google_protobuf_UInt64Value_init_zero {0} +#define google_protobuf_Int32Value_init_zero {0} +#define google_protobuf_UInt32Value_init_zero {0} +#define google_protobuf_BoolValue_init_zero {0} +#define google_protobuf_StringValue_init_zero {NULL} +#define google_protobuf_BytesValue_init_zero {NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_protobuf_BytesValue_value_tag 1 +#define google_protobuf_StringValue_value_tag 1 +#define google_protobuf_BoolValue_value_tag 1 +#define google_protobuf_DoubleValue_value_tag 1 +#define google_protobuf_FloatValue_value_tag 1 +#define google_protobuf_Int32Value_value_tag 1 +#define google_protobuf_Int64Value_value_tag 1 +#define google_protobuf_UInt32Value_value_tag 1 +#define google_protobuf_UInt64Value_value_tag 1 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_protobuf_DoubleValue_fields[2]; +extern const pb_field_t google_protobuf_FloatValue_fields[2]; +extern const pb_field_t google_protobuf_Int64Value_fields[2]; +extern const pb_field_t google_protobuf_UInt64Value_fields[2]; +extern const pb_field_t google_protobuf_Int32Value_fields[2]; +extern const pb_field_t google_protobuf_UInt32Value_fields[2]; +extern const pb_field_t google_protobuf_BoolValue_fields[2]; +extern const pb_field_t google_protobuf_StringValue_fields[2]; +extern const pb_field_t google_protobuf_BytesValue_fields[2]; + +/* Maximum encoded size of messages (where known) */ +#define google_protobuf_DoubleValue_size 9 +#define google_protobuf_FloatValue_size 5 +#define google_protobuf_Int64Value_size 11 +#define google_protobuf_UInt64Value_size 11 +#define google_protobuf_Int32Value_size 11 +#define google_protobuf_UInt32Value_size 6 +#define google_protobuf_BoolValue_size 2 +/* google_protobuf_StringValue_size depends on runtime parameters */ +/* google_protobuf_BytesValue_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define WRAPPERS_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc new file mode 100644 index 0000000..de1bbbf --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc @@ -0,0 +1,70 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_rpc_Status_fields[4] = { + PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, google_rpc_Status, code, code, 0), + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_rpc_Status, message, code, 0), + PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_rpc_Status, details, message, &google_protobuf_Any_fields), + PB_LAST_FIELD +}; + + +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h new file mode 100644 index 0000000..42237e8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h @@ -0,0 +1,78 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_RPC_STATUS_NANOPB_H_INCLUDED +#define PB_GOOGLE_RPC_STATUS_NANOPB_H_INCLUDED +#include + +#include "google/protobuf/any.nanopb.h" + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +typedef struct _google_rpc_Status { + int32_t code; + 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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_rpc_Status_init_default {0, NULL, 0, NULL} +#define google_rpc_Status_init_zero {0, NULL, 0, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_rpc_Status_code_tag 1 +#define google_rpc_Status_message_tag 2 +#define google_rpc_Status_details_tag 3 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_rpc_Status_fields[4]; + +/* Maximum encoded size of messages (where known) */ +/* google_rpc_Status_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define STATUS_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc new file mode 100644 index 0000000..8be0f98 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc @@ -0,0 +1,72 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.8 */ + +#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. +#endif + + + +const pb_field_t google_type_LatLng_fields[3] = { + PB_FIELD( 1, DOUBLE , SINGULAR, STATIC , FIRST, google_type_LatLng, latitude, latitude, 0), + PB_FIELD( 2, DOUBLE , SINGULAR, STATIC , OTHER, google_type_LatLng, longitude, latitude, 0), + PB_LAST_FIELD +}; + + +/* On some platforms (such as AVR), double is really float. + * These are not directly supported by nanopb, but see example_avr_double. + * To get rid of this error, remove any double fields from your .proto. + */ +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 + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h new file mode 100644 index 0000000..52d7b13 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h @@ -0,0 +1,73 @@ +/* + * Copyright 2021 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.8 */ + +#ifndef PB_GOOGLE_TYPE_LATLNG_NANOPB_H_INCLUDED +#define PB_GOOGLE_TYPE_LATLNG_NANOPB_H_INCLUDED +#include + +#include + +namespace firebase { +namespace firestore { + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Struct definitions */ +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; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define google_type_LatLng_init_default {0, 0} +#define google_type_LatLng_init_zero {0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define google_type_LatLng_latitude_tag 1 +#define google_type_LatLng_longitude_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t google_type_LatLng_fields[3]; + +/* Maximum encoded size of messages (where known) */ +#define google_type_LatLng_size 18 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define LATLNG_MESSAGES \ + + +#endif + +} // namespace firestore +} // namespace firebase + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h new file mode 100644 index 0000000..71ac98d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h @@ -0,0 +1,48 @@ +/* + * 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 "FIRCollectionReference.h" + +#include + +#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; + +NS_ASSUME_NONNULL_BEGIN + +/** Internal FIRCollectionReference API we don't want exposed in our public header files. */ +@interface FIRCollectionReference (/* Init */) + +- (instancetype)initWithReference:(api::CollectionReference &&)reference NS_DESIGNATED_INITIALIZER; + +// Mark the super class designated initializer unavailable. +- (instancetype)initWithQuery:(api::Query &&)query NS_UNAVAILABLE; + +- (instancetype)initWithPath:(model::ResourcePath)path + firestore:(std::shared_ptr)firestore; +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm new file mode 100644 index 0000000..7be769e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm @@ -0,0 +1,135 @@ +/* + * 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 "FIRCollectionReference.h" + +#include + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FSTUserDataReader.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" + +using firebase::firestore::api::CollectionReference; +using firebase::firestore::api::DocumentReference; +using firebase::firestore::core::ParsedSetData; +using firebase::firestore::model::ResourcePath; +using firebase::firestore::util::MakeCallback; +using firebase::firestore::util::MakeNSString; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; + +NS_ASSUME_NONNULL_BEGIN + +@implementation FIRCollectionReference + +- (instancetype)initWithReference:(CollectionReference &&)reference { + return [super initWithQuery:std::move(reference)]; +} + +- (instancetype)initWithPath:(ResourcePath)path + firestore:(std::shared_ptr)firestore { + CollectionReference ref(std::move(path), std::move(firestore)); + return [self initWithReference:std::move(ref)]; +} + +// Override the designated initializer from the super class. +- (instancetype)initWithQuery:(__unused api::Query &&)query { + HARD_FAIL("Use FIRCollectionReference initWithPath: initializer."); +} + +// NSObject Methods +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + if (![[other class] isEqual:[self class]]) return NO; + + return [self isEqualToReference:other]; +} + +- (BOOL)isEqualToReference:(nullable FIRCollectionReference *)otherReference { + if (self == otherReference) return YES; + if (otherReference == nil) return NO; + return self.reference == otherReference.reference; +} + +- (NSUInteger)hash { + return self.reference.Hash(); +} + +- (const CollectionReference &)reference { + // TODO(wilhuff): Use some alternate method for doing this. + // + // Casting from Query& to CollectionReference& when the value is actually a + // Query violates aliasing rules and is technically undefined behavior. + // Nevertheless this works on Clang so this is good enough for now. + return static_cast(self.apiQuery); +} + +- (NSString *)collectionID { + return MakeNSString(self.reference.collection_id()); +} + +- (FIRDocumentReference *_Nullable)parent { + absl::optional parent = self.reference.parent(); + if (!parent) { + return nil; + } + return [[FIRDocumentReference alloc] initWithReference:std::move(*parent)]; +} + +- (NSString *)path { + return MakeNSString(self.reference.path()); +} + +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath { + if (!documentPath) { + ThrowInvalidArgument("Document path cannot be nil."); + } + if (!documentPath.length) { + ThrowInvalidArgument("Document path cannot be empty."); + } + DocumentReference child = self.reference.Document(MakeString(documentPath)); + return [[FIRDocumentReference alloc] initWithReference:std::move(child)]; +} + +- (FIRDocumentReference *)addDocumentWithData:(NSDictionary *)data { + return [self addDocumentWithData:data completion:nil]; +} + +- (FIRDocumentReference *)addDocumentWithData:(NSDictionary *)data + completion: + (nullable void (^)(NSError *_Nullable error))completion { + ParsedSetData parsed = [self.firestore.dataReader parsedSetData:data]; + DocumentReference docRef = + self.reference.AddDocument(std::move(parsed), MakeCallback(completion)); + return [[FIRDocumentReference alloc] initWithReference:std::move(docRef)]; +} + +- (FIRDocumentReference *)documentWithAutoID { + return [[FIRDocumentReference alloc] initWithReference:self.reference.Document()]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h new file mode 100644 index 0000000..4314629 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h @@ -0,0 +1,34 @@ +/* + * 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 "FIRDocumentChange.h" + +#import + +#include "Firestore/core/src/api/document_change.h" + +namespace api = firebase::firestore::api; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRDocumentChange (/* Init */) + +- (instancetype)initWithDocumentChange:(api::DocumentChange &&)documentChange + NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm new file mode 100644 index 0000000..72c4289 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm @@ -0,0 +1,90 @@ +/* + * 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/API/FIRDocumentChange+Internal.h" + +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" + +#include "Firestore/core/src/api/document_change.h" +#include "Firestore/core/src/util/hard_assert.h" + +using firebase::firestore::api::DocumentChange; + +NS_ASSUME_NONNULL_BEGIN + +namespace { + +/** + * Converts from C++ document change indexes to Objective-C document change + * indexes. Objective-C's NSNotFound is signed NSIntegerMax, not unsigned -1. + */ +constexpr NSUInteger MakeIndex(size_t index) { + return index == DocumentChange::npos ? NSNotFound : index; +} + +} // namespace + +@implementation FIRDocumentChange { + DocumentChange _documentChange; +} + +- (instancetype)initWithDocumentChange:(DocumentChange &&)documentChange { + if (self = [super init]) { + _documentChange = std::move(documentChange); + } + return self; +} + +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + if (![other isKindOfClass:[FIRDocumentChange class]]) return NO; + + FIRDocumentChange *change = (FIRDocumentChange *)other; + return _documentChange == change->_documentChange; +} + +- (NSUInteger)hash { + return _documentChange.Hash(); +} + +- (FIRDocumentChangeType)type { + switch (_documentChange.type()) { + case DocumentChange::Type::Added: + return FIRDocumentChangeTypeAdded; + case DocumentChange::Type::Modified: + return FIRDocumentChangeTypeModified; + case DocumentChange::Type::Removed: + return FIRDocumentChangeTypeRemoved; + } + + HARD_FAIL("Unknown DocumentChange::Type: %s", _documentChange.type()); +} + +- (FIRQueryDocumentSnapshot *)document { + return [[FIRQueryDocumentSnapshot alloc] initWithSnapshot:_documentChange.document()]; +} + +- (NSUInteger)oldIndex { + return MakeIndex(_documentChange.old_index()); +} + +- (NSUInteger)newIndex { + return MakeIndex(_documentChange.new_index()); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h new file mode 100644 index 0000000..b417a3a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h @@ -0,0 +1,56 @@ +/* + * 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 "FIRDocumentReference.h" + +#include + +#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; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRDocumentReference (/* Init */) + +- (instancetype)initWithReference:(api::DocumentReference &&)reference NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithPath:(model::ResourcePath)path + firestore:(std::shared_ptr)firestore; + +- (instancetype)initWithKey:(model::DocumentKey)key + firestore:(std::shared_ptr)firestore; + +@end + +/** Internal FIRDocumentReference API we don't want exposed in our public header files. */ +@interface FIRDocumentReference (Internal) + +- (const api::DocumentReference &)internalReference; +- (const model::DocumentKey &)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm new file mode 100644 index 0000000..b6af3ac --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm @@ -0,0 +1,262 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "FIRDocumentReference+Internal.h" + +#include +#include + +#import "FIRFirestoreErrors.h" +#import "Firestore/Source/API/FIRCollectionReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRFirestoreSource+Internal.h" +#import "Firestore/Source/API/FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FSTUserDataReader.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" + +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::core::EventListener; +using firebase::firestore::core::ListenOptions; +using firebase::firestore::core::ParsedSetData; +using firebase::firestore::core::ParsedUpdateData; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::ResourcePath; +using firebase::firestore::util::MakeCallback; +using firebase::firestore::util::MakeNSString; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::StatusOr; +using firebase::firestore::util::StatusOr; +using firebase::firestore::util::StatusOrCallback; +using firebase::firestore::util::ThrowInvalidArgument; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - FIRDocumentReference + +@implementation FIRDocumentReference { + DocumentReference _documentReference; +} + +- (instancetype)initWithReference:(DocumentReference &&)reference { + if (self = [super init]) { + _documentReference = std::move(reference); + } + return self; +} + +- (instancetype)initWithPath:(ResourcePath)path firestore:(std::shared_ptr)firestore { + if (path.size() % 2 != 0) { + ThrowInvalidArgument("Invalid document reference. Document references must have an even " + "number of segments, but %s has %s", + path.CanonicalString(), path.size()); + } + return [self initWithKey:DocumentKey{std::move(path)} firestore:firestore]; +} + +- (instancetype)initWithKey:(DocumentKey)key firestore:(std::shared_ptr)firestore { + DocumentReference delegate{std::move(key), firestore}; + return [self initWithReference:std::move(delegate)]; +} + +#pragma mark - NSObject Methods + +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + if (![[other class] isEqual:[self class]]) return NO; + + return _documentReference == static_cast(other)->_documentReference; +} + +- (NSUInteger)hash { + return _documentReference.Hash(); +} + +#pragma mark - Public Methods + +@dynamic firestore; + +- (FIRFirestore *)firestore { + return [FIRFirestore recoverFromFirestore:_documentReference.firestore()]; +} + +- (NSString *)documentID { + return MakeNSString(_documentReference.document_id()); +} + +- (FIRCollectionReference *)parent { + return [[FIRCollectionReference alloc] initWithReference:_documentReference.Parent()]; +} + +- (NSString *)path { + return MakeNSString(_documentReference.Path()); +} + +- (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath { + if (!collectionPath) { + ThrowInvalidArgument("Collection path cannot be nil."); + } + if (!collectionPath.length) { + ThrowInvalidArgument("Collection path cannot be empty."); + } + + CollectionReference child = _documentReference.GetCollectionReference(MakeString(collectionPath)); + return [[FIRCollectionReference alloc] initWithReference:std::move(child)]; +} + +- (void)setData:(NSDictionary *)documentData { + [self setData:documentData merge:NO completion:nil]; +} + +- (void)setData:(NSDictionary *)documentData merge:(BOOL)merge { + [self setData:documentData merge:merge completion:nil]; +} + +- (void)setData:(NSDictionary *)documentData + mergeFields:(NSArray *)mergeFields { + [self setData:documentData mergeFields:mergeFields completion:nil]; +} + +- (void)setData:(NSDictionary *)documentData + completion:(nullable void (^)(NSError *_Nullable error))completion { + [self setData:documentData merge:NO completion:completion]; +} + +- (void)setData:(NSDictionary *)documentData + merge:(BOOL)merge + completion:(nullable void (^)(NSError *_Nullable error))completion { + auto dataReader = self.firestore.dataReader; + ParsedSetData parsed = merge ? [dataReader parsedMergeData:documentData fieldMask:nil] + : [dataReader parsedSetData:documentData]; + _documentReference.SetData(std::move(parsed), MakeCallback(completion)); +} + +- (void)setData:(NSDictionary *)documentData + mergeFields:(NSArray *)mergeFields + completion:(nullable void (^)(NSError *_Nullable error))completion { + ParsedSetData parsed = [self.firestore.dataReader parsedMergeData:documentData + fieldMask:mergeFields]; + _documentReference.SetData(std::move(parsed), MakeCallback(completion)); +} + +- (void)updateData:(NSDictionary *)fields { + [self updateData:fields completion:nil]; +} + +- (void)updateData:(NSDictionary *)fields + completion:(nullable void (^)(NSError *_Nullable error))completion { + ParsedUpdateData parsed = [self.firestore.dataReader parsedUpdateData:fields]; + _documentReference.UpdateData(std::move(parsed), MakeCallback(completion)); +} + +- (void)deleteDocument { + [self deleteDocumentWithCompletion:nil]; +} + +- (void)deleteDocumentWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + _documentReference.DeleteDocument(MakeCallback(completion)); +} + +- (void)getDocumentWithCompletion:(FIRDocumentSnapshotBlock)completion { + _documentReference.GetDocument(Source::Default, [self wrapDocumentSnapshotBlock:completion]); +} + +- (void)getDocumentWithSource:(FIRFirestoreSource)source + completion:(FIRDocumentSnapshotBlock)completion { + _documentReference.GetDocument(MakeSource(source), [self wrapDocumentSnapshotBlock:completion]); +} + +- (id)addSnapshotListener:(FIRDocumentSnapshotBlock)listener { + return [self addSnapshotListenerWithIncludeMetadataChanges:NO listener:listener]; +} + +- (id) + addSnapshotListenerWithIncludeMetadataChanges:(BOOL)includeMetadataChanges + listener:(FIRDocumentSnapshotBlock)listener { + ListenOptions options = ListenOptions::FromIncludeMetadataChanges(includeMetadataChanges); + return [self addSnapshotListenerInternalWithOptions:options listener:listener]; +} + +- (id)addSnapshotListenerInternalWithOptions:(ListenOptions)internalOptions + listener:(FIRDocumentSnapshotBlock) + listener { + std::unique_ptr result = _documentReference.AddSnapshotListener( + std::move(internalOptions), [self wrapDocumentSnapshotBlock:listener]); + return [[FSTListenerRegistration alloc] initWithRegistration:std::move(result)]; +} + +- (DocumentSnapshotListener)wrapDocumentSnapshotBlock:(FIRDocumentSnapshotBlock)block { + class Converter : public EventListener { + public: + explicit Converter(FIRDocumentSnapshotBlock block) : block_(block) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (maybe_snapshot.ok()) { + FIRDocumentSnapshot *result = + [[FIRDocumentSnapshot alloc] initWithSnapshot:std::move(maybe_snapshot).ValueOrDie()]; + block_(result, nil); + } else { + block_(nil, MakeNSError(maybe_snapshot.status())); + } + } + + private: + FIRDocumentSnapshotBlock block_; + }; + return absl::make_unique(block); +} + +@end + +#pragma mark - FIRDocumentReference (Internal) + +@implementation FIRDocumentReference (Internal) + +- (const api::DocumentReference &)internalReference { + return _documentReference; +} + +- (const DocumentKey &)key { + return _documentReference.key(); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h new file mode 100644 index 0000000..103f5cc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h @@ -0,0 +1,55 @@ +/* + * 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 "FIRDocumentSnapshot.h" + +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/model/model_fwd.h" + +@class FIRFirestore; + +namespace api = firebase::firestore::api; +namespace model = firebase::firestore::model; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRDocumentSnapshot (/* Init */) + +- (instancetype)initWithSnapshot:(api::DocumentSnapshot &&)snapshot NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithFirestore:(FIRFirestore *)firestore + documentKey:(model::DocumentKey)documentKey + document:(const absl::optional &)document + metadata:(api::SnapshotMetadata)metadata; + +- (instancetype)initWithFirestore:(FIRFirestore *)firestore + documentKey:(model::DocumentKey)documentKey + document:(const absl::optional &)document + fromCache:(bool)fromCache + hasPendingWrites:(bool)hasPendingWrites; + +@end + +/** Internal FIRDocumentSnapshot API we don't want exposed in our public header files. */ +@interface FIRDocumentSnapshot (Internal) + +- (const absl::optional &)internalDocument; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm new file mode 100644 index 0000000..50ca5b3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm @@ -0,0 +1,211 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "FIRDocumentSnapshot+Internal.h" + +#include +#include + +#include "Firestore/core/src/util/warnings.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRGeoPoint+Internal.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" +#import "Firestore/Source/API/FIRTimestamp+Internal.h" +#import "Firestore/Source/API/FSTUserDataWriter.h" +#import "Firestore/Source/API/converters.h" + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.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/nanopb/nanopb_util.h" +#include "Firestore/core/src/remote/serializer.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" + +using firebase::firestore::google_firestore_v1_Value; +using firebase::firestore::api::DocumentSnapshot; +using firebase::firestore::api::Firestore; +using firebase::firestore::api::MakeFIRGeoPoint; +using firebase::firestore::api::MakeFIRTimestamp; +using firebase::firestore::api::SnapshotMetadata; +using firebase::firestore::model::DatabaseId; +using firebase::firestore::model::Document; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::FieldPath; +using firebase::firestore::model::ObjectValue; +using firebase::firestore::remote::Serializer; +using firebase::firestore::nanopb::MakeNSData; +using firebase::firestore::util::MakeNSString; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; +using firebase::firestore::google_firestore_v1_Value; + +NS_ASSUME_NONNULL_BEGIN + +@implementation FIRDocumentSnapshot { + DocumentSnapshot _snapshot; + + std::unique_ptr _serializer; + FIRSnapshotMetadata *_cachedMetadata; +} + +- (instancetype)initWithSnapshot:(DocumentSnapshot &&)snapshot { + if (self = [super init]) { + _snapshot = std::move(snapshot); + _serializer.reset(new Serializer(_snapshot.firestore()->database_id())); + } + return self; +} + +- (instancetype)initWithFirestore:(FIRFirestore *)firestore + documentKey:(DocumentKey)documentKey + document:(const absl::optional &)document + metadata:(SnapshotMetadata)metadata { + DocumentSnapshot wrapped; + if (document.has_value()) { + wrapped = + DocumentSnapshot::FromDocument(firestore.wrapped, document.value(), std::move(metadata)); + } else { + wrapped = DocumentSnapshot::FromNoDocument(firestore.wrapped, std::move(documentKey), + std::move(metadata)); + } + _serializer.reset(new Serializer(firestore.databaseID)); + return [self initWithSnapshot:std::move(wrapped)]; +} + +- (instancetype)initWithFirestore:(FIRFirestore *)firestore + documentKey:(DocumentKey)documentKey + document:(const absl::optional &)document + fromCache:(bool)fromCache + hasPendingWrites:(bool)hasPendingWrites { + return [self initWithFirestore:firestore + documentKey:std::move(documentKey) + document:document + metadata:SnapshotMetadata(hasPendingWrites, fromCache)]; +} + +// NSObject Methods +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + // self class could be FIRDocumentSnapshot or subtype. So we compare with base type explicitly. + if (![other isKindOfClass:[FIRDocumentSnapshot class]]) return NO; + + return _snapshot == static_cast(other)->_snapshot; +} + +- (NSUInteger)hash { + return _snapshot.Hash(); +} + +@dynamic exists; + +- (BOOL)exists { + return _snapshot.exists(); +} + +- (const absl::optional &)internalDocument { + return _snapshot.internal_document(); +} + +- (FIRDocumentReference *)reference { + return [[FIRDocumentReference alloc] initWithReference:_snapshot.CreateReference()]; +} + +- (NSString *)documentID { + return MakeNSString(_snapshot.document_id()); +} + +@dynamic metadata; + +- (FIRSnapshotMetadata *)metadata { + if (!_cachedMetadata) { + _cachedMetadata = [[FIRSnapshotMetadata alloc] initWithMetadata:_snapshot.metadata()]; + } + return _cachedMetadata; +} + +- (nullable NSDictionary *)data { + return [self dataWithServerTimestampBehavior:FIRServerTimestampBehaviorNone]; +} + +- (nullable NSDictionary *)dataWithServerTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior { + absl::optional data = _snapshot.GetValue(FieldPath::EmptyPath()); + if (!data) return nil; + + FSTUserDataWriter *dataWriter = + [[FSTUserDataWriter alloc] initWithFirestore:_snapshot.firestore() + serverTimestampBehavior:serverTimestampBehavior]; + return [dataWriter convertedValue:*data]; +} + +- (nullable id)valueForField:(id)field { + return [self valueForField:field serverTimestampBehavior:FIRServerTimestampBehaviorNone]; +} + +- (nullable id)valueForField:(id)field + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { + FieldPath fieldPath; + if ([field isKindOfClass:[NSString class]]) { + fieldPath = FieldPath::FromDotSeparatedString(MakeString(field)); + } else if ([field isKindOfClass:[FIRFieldPath class]]) { + fieldPath = ((FIRFieldPath *)field).internalValue; + } else { + ThrowInvalidArgument("Subscript key must be an NSString or FIRFieldPath."); + } + absl::optional fieldValue = _snapshot.GetValue(fieldPath); + if (!fieldValue) return nil; + FSTUserDataWriter *dataWriter = + [[FSTUserDataWriter alloc] initWithFirestore:_snapshot.firestore() + serverTimestampBehavior:serverTimestampBehavior]; + return [dataWriter convertedValue:*fieldValue]; +} + +- (nullable id)objectForKeyedSubscript:(id)key { + return [self valueForField:key]; +} + +@end + +@implementation FIRQueryDocumentSnapshot + +- (NSDictionary *)data { + NSDictionary *data = [super data]; + HARD_ASSERT(data, "Document in a QueryDocumentSnapshot should exist"); + return data; +} + +- (NSDictionary *)dataWithServerTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior { + NSDictionary *data = + [super dataWithServerTimestampBehavior:serverTimestampBehavior]; + HARD_ASSERT(data, "Document in a QueryDocumentSnapshot should exist"); + return data; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h new file mode 100644 index 0000000..019ac9a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h @@ -0,0 +1,41 @@ +/* + * 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 "FIRFieldPath.h" + +#include "Firestore/core/src/model/model_fwd.h" + +namespace model = firebase::firestore::model; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFieldPath () + +/** Internal field path representation */ +- (const model::FieldPath &)internalValue; + +- (instancetype)initPrivate:(model::FieldPath)path NS_DESIGNATED_INITIALIZER; + +@end + +/** Internal FIRFieldPath API we don't want exposed in our public header files. */ +@interface FIRFieldPath (Internal) + ++ (instancetype)pathWithDotSeparatedString:(NSString *)path; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm new file mode 100644 index 0000000..279a8fd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm @@ -0,0 +1,102 @@ +/* + * 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 "FIRFieldPath.h" + +#include +#include +#include +#include + +#import "Firestore/Source/API/FIRFieldPath+Internal.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" + +using firebase::firestore::model::FieldPath; +using firebase::firestore::util::Hash; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFieldPath () { + /** Internal field path representation */ + firebase::firestore::model::FieldPath _internalValue; +} + +@end + +@implementation FIRFieldPath + +- (instancetype)initWithFields:(NSArray *)fieldNames { + if (fieldNames.count == 0) { + ThrowInvalidArgument("Invalid field path. Provided names must not be empty."); + } + + std::vector converted; + converted.reserve(fieldNames.count); + for (NSString *fieldName in fieldNames) { + converted.emplace_back(MakeString(fieldName)); + } + + return [self initPrivate:FieldPath::FromSegments(std::move(converted))]; +} + ++ (instancetype)documentID { + return [[FIRFieldPath alloc] initPrivate:FieldPath::KeyFieldPath()]; +} + +- (instancetype)initPrivate:(FieldPath)fieldPath { + if (self = [super init]) { + _internalValue = std::move(fieldPath); + } + return self; +} + ++ (instancetype)pathWithDotSeparatedString:(NSString *)path { + return [[FIRFieldPath alloc] initPrivate:FieldPath::FromDotSeparatedString(MakeString(path))]; +} + +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { + return [[[self class] alloc] initPrivate:_internalValue]; +} + +- (BOOL)isEqual:(nullable id)object { + if (self == object) { + return YES; + } + + if (![object isKindOfClass:[FIRFieldPath class]]) { + return NO; + } + + return _internalValue == ((FIRFieldPath *)object)->_internalValue; +} + +- (NSUInteger)hash { + return Hash(_internalValue); +} + +- (const firebase::firestore::model::FieldPath &)internalValue { + return _internalValue; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue+Internal.h new file mode 100644 index 0000000..7e0193d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue+Internal.h @@ -0,0 +1,63 @@ +/* + * 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 "FIRFieldValue.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFieldValue (Internal) +/** + * The method name (e.g. "FieldValue.delete()") that was used to create this FIRFieldValue + * instance, for use in error messages, etc. + */ +@property(nonatomic, strong, readonly) NSString *methodName; +@end + +/** + * FIRFieldValue class for field deletes. Exposed internally so code can do isKindOfClass checks on + * it. + */ +@interface FSTDeleteFieldValue : FIRFieldValue +- (instancetype)init NS_UNAVAILABLE; +@end + +/** + * FIRFieldValue class for server timestamps. Exposed internally so code can do isKindOfClass checks + * on it. + */ +@interface FSTServerTimestampFieldValue : FIRFieldValue +- (instancetype)init NS_UNAVAILABLE; +@end + +/** FIRFieldValue class for array unions. */ +@interface FSTArrayUnionFieldValue : FIRFieldValue +- (instancetype)init NS_UNAVAILABLE; +@property(strong, nonatomic, readonly) NSArray *elements; +@end + +/** FIRFieldValue class for array removes. */ +@interface FSTArrayRemoveFieldValue : FIRFieldValue +- (instancetype)init NS_UNAVAILABLE; +@property(strong, nonatomic, readonly) NSArray *elements; +@end + +/** FIRFieldValue class for number increments. */ +@interface FSTNumericIncrementFieldValue : FIRFieldValue +- (instancetype)init NS_UNAVAILABLE; +@property(strong, nonatomic, readonly) NSNumber *operand; +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue.mm new file mode 100644 index 0000000..dccf735 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldValue.mm @@ -0,0 +1,181 @@ +/* + * 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/API/FIRFieldValue+Internal.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFieldValue () +- (instancetype)initPrivate NS_DESIGNATED_INITIALIZER; +@end + +#pragma mark - FSTDeleteFieldValue + +@interface FSTDeleteFieldValue () +/** Returns a single shared instance of the class. */ ++ (instancetype)deleteFieldValue; +@end + +@implementation FSTDeleteFieldValue + +- (instancetype)initPrivate { + self = [super initPrivate]; + return self; +} + ++ (instancetype)deleteFieldValue { + static FSTDeleteFieldValue *sharedInstance = nil; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + sharedInstance = [[FSTDeleteFieldValue alloc] initPrivate]; + }); + return sharedInstance; +} + +- (NSString *)methodName { + return @"FieldValue.delete()"; +} + +@end + +#pragma mark - FSTServerTimestampFieldValue + +@interface FSTServerTimestampFieldValue () +/** Returns a single shared instance of the class. */ ++ (instancetype)serverTimestampFieldValue; +@end + +@implementation FSTServerTimestampFieldValue + +- (instancetype)initPrivate { + self = [super initPrivate]; + return self; +} + ++ (instancetype)serverTimestampFieldValue { + static FSTServerTimestampFieldValue *sharedInstance = nil; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + sharedInstance = [[FSTServerTimestampFieldValue alloc] initPrivate]; + }); + return sharedInstance; +} + +- (NSString *)methodName { + return @"FieldValue.serverTimestamp()"; +} + +@end + +#pragma mark - FSTArrayUnionFieldValue + +@interface FSTArrayUnionFieldValue () +- (instancetype)initWithElements:(NSArray *)elements; +@end + +@implementation FSTArrayUnionFieldValue +- (instancetype)initWithElements:(NSArray *)elements { + if (self = [super initPrivate]) { + _elements = elements; + } + return self; +} + +- (NSString *)methodName { + return @"FieldValue.arrayUnion()"; +} + +@end + +#pragma mark - FSTArrayRemoveFieldValue + +@interface FSTArrayRemoveFieldValue () +- (instancetype)initWithElements:(NSArray *)elements; +@end + +@implementation FSTArrayRemoveFieldValue +- (instancetype)initWithElements:(NSArray *)elements { + if (self = [super initPrivate]) { + _elements = elements; + } + return self; +} + +- (NSString *)methodName { + return @"FieldValue.arrayRemove()"; +} + +@end + +#pragma mark - FSTNumericIncrementFieldValue + +/* FieldValue class for increment() transforms. */ +@interface FSTNumericIncrementFieldValue () +- (instancetype)initWithOperand:(NSNumber *)operand; +@end + +@implementation FSTNumericIncrementFieldValue +- (instancetype)initWithOperand:(NSNumber *)operand { + if (self = [super initPrivate]) { + _operand = operand; + } + return self; +} + +- (NSString *)methodName { + return @"FieldValue.increment()"; +} + +@end + +#pragma mark - FIRFieldValue + +@implementation FIRFieldValue + +- (instancetype)initPrivate { + self = [super init]; + return self; +} + ++ (instancetype)fieldValueForDelete { + return [FSTDeleteFieldValue deleteFieldValue]; +} + ++ (instancetype)fieldValueForServerTimestamp { + return [FSTServerTimestampFieldValue serverTimestampFieldValue]; +} + ++ (instancetype)fieldValueForArrayUnion:(NSArray *)elements { + return [[FSTArrayUnionFieldValue alloc] initWithElements:elements]; +} + ++ (instancetype)fieldValueForArrayRemove:(NSArray *)elements { + return [[FSTArrayRemoveFieldValue alloc] initWithElements:elements]; +} + ++ (instancetype)fieldValueForDoubleIncrement:(double)d { + return [[FSTNumericIncrementFieldValue alloc] initWithOperand:@(d)]; +} + ++ (instancetype)fieldValueForIntegerIncrement:(int64_t)l { + return [[FSTNumericIncrementFieldValue alloc] initWithOperand:@(l)]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h new file mode 100644 index 0000000..54db12d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h @@ -0,0 +1,89 @@ +/* + * 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 "FIRFirestore.h" + +#include +#include + +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/credentials/credentials_provider.h" +#include "Firestore/core/src/util/async_queue.h" + +@class FIRApp; +@class FSTFirestoreClient; +@class FSTUserDataReader; + +namespace firebase { +namespace firestore { +namespace remote { +class FirebaseMetadataProvider; +} // namespace remote +} // namespace firestore +} // namespace firebase + +namespace api = firebase::firestore::api; +namespace credentials = firebase::firestore::credentials; +namespace model = firebase::firestore::model; +namespace remote = firebase::firestore::remote; + +NS_ASSUME_NONNULL_BEGIN + +/** Provides a registry management interface for FIRFirestore instances. */ +@protocol FSTFirestoreInstanceRegistry + +/** Removes the FIRFirestore instance with given database name from registry. */ +- (void)removeInstanceWithDatabase:(NSString *)database; + +@end + +@interface FIRFirestore (/* Init */) + +/** + * Initializes a Firestore object with all the required parameters directly. This exists so that + * tests can create FIRFirestore objects without needing FIRApp. + */ +- (instancetype)initWithDatabaseID:(model::DatabaseId)databaseID + persistenceKey:(std::string)persistenceKey + authCredentialsProvider: + (std::shared_ptr)authCredentialsProvider + appCheckCredentialsProvider: + (std::shared_ptr)appCheckCredentialsProvider + workerQueue: + (std::shared_ptr)workerQueue + firebaseMetadataProvider: + (std::unique_ptr)firebaseMetadataProvider + firebaseApp:(FIRApp *)app + instanceRegistry:(nullable id)registry; +@end + +/** Internal FIRFirestore API we don't want exposed in our public header files. */ +@interface FIRFirestore (Internal) + ++ (FIRFirestore *)recoverFromFirestore:(std::shared_ptr)firestore; + +- (void)terminateInternalWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +- (const std::shared_ptr &)workerQueue; + +@property(nonatomic, assign, readonly) std::shared_ptr wrapped; + +@property(nonatomic, assign, readonly) const model::DatabaseId &databaseID; +@property(nonatomic, strong, readonly) FSTUserDataReader *dataReader; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm new file mode 100644 index 0000000..7e6563e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm @@ -0,0 +1,495 @@ +/* + * 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 "FIRFirestore+Internal.h" + +#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/FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FIRLoadBundleTask+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FIRTransaction+Internal.h" +#import "Firestore/Source/API/FIRWriteBatch+Internal.h" +#import "Firestore/Source/API/FSTFirestoreComponent.h" +#import "Firestore/Source/API/FSTUserDataReader.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/core/database_info.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/credentials/credentials_provider.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/remote/firebase_metadata_provider.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/byte_stream_apple.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" +#include "absl/memory/memory.h" + +using firebase::firestore::api::DocumentReference; +using firebase::firestore::api::Firestore; +using firebase::firestore::api::ListenerRegistration; +using firebase::firestore::core::EventListener; +using firebase::firestore::credentials::AuthCredentialsProvider; +using firebase::firestore::model::DatabaseId; +using firebase::firestore::remote::FirebaseMetadataProvider; +using firebase::firestore::util::AsyncQueue; +using firebase::firestore::util::ByteStreamApple; +using firebase::firestore::util::Empty; +using firebase::firestore::util::Executor; +using firebase::firestore::util::ExecutorLibdispatch; +using firebase::firestore::util::LogSetLevel; +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 firebase::firestore::util::kLogLevelDebug; +using firebase::firestore::util::kLogLevelNotice; + +using UserUpdateBlock = id _Nullable (^)(FIRTransaction *, NSError **); +using UserTransactionCompletion = void (^)(id _Nullable, NSError *_Nullable); + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - FIRFirestore + +@interface FIRFirestore () + +@property(nonatomic, strong, readonly) FSTUserDataReader *dataReader; + +@end + +@implementation FIRFirestore { + std::shared_ptr _firestore; + FIRFirestoreSettings *_settings; + __weak id _registry; +} + ++ (void)initialize { + if (self == [FIRFirestore class]) { + SetThrowHandler(ObjcThrowHandler); + Firestore::SetClientLanguage("gl-objc/"); + } +} + ++ (instancetype)firestore { + FIRApp *app = [FIRApp defaultApp]; + if (!app) { + ThrowIllegalState("Failed to get FirebaseApp instance. Please call FirebaseApp.configure() " + "before using Firestore"); + } + return [self firestoreForApp:app database:MakeNSString(DatabaseId::kDefault)]; +} + ++ (instancetype)firestoreForApp:(FIRApp *)app { + return [self firestoreForApp:app database:MakeNSString(DatabaseId::kDefault)]; +} + +// TODO(b/62410906): make this public ++ (instancetype)firestoreForApp:(FIRApp *)app database:(NSString *)database { + if (!app) { + ThrowInvalidArgument("FirebaseApp instance may not be nil. Use FirebaseApp.app() if you'd like " + "to use the default FirebaseApp instance."); + } + if (!database) { + ThrowInvalidArgument("Database identifier may not be nil. Use '%s' if you want the default " + "database", + DatabaseId::kDefault); + } + + id provider = + FIR_COMPONENT(FSTFirestoreMultiDBProvider, app.container); + return [provider firestoreForDatabase:database]; +} + +- (instancetype)initWithDatabaseID:(model::DatabaseId)databaseID + persistenceKey:(std::string)persistenceKey + authCredentialsProvider: + (std::shared_ptr)authCredentialsProvider + appCheckCredentialsProvider: + (std::shared_ptr)appCheckCredentialsProvider + workerQueue:(std::shared_ptr)workerQueue + firebaseMetadataProvider: + (std::unique_ptr)firebaseMetadataProvider + firebaseApp:(FIRApp *)app + instanceRegistry:(nullable id)registry { + if (self = [super init]) { + _firestore = std::make_shared( + std::move(databaseID), std::move(persistenceKey), std::move(authCredentialsProvider), + std::move(appCheckCredentialsProvider), std::move(workerQueue), + std::move(firebaseMetadataProvider), (__bridge void *)self); + + _app = app; + _registry = registry; + + FSTPreConverterBlock block = ^id _Nullable(id _Nullable input) { + if ([input isKindOfClass:[FIRDocumentReference class]]) { + auto documentReference = (FIRDocumentReference *)input; + return [[FSTDocumentKeyReference alloc] initWithKey:documentReference.key + databaseID:documentReference.firestore.databaseID]; + } else { + return input; + } + }; + + _dataReader = [[FSTUserDataReader alloc] initWithDatabaseID:_firestore->database_id() + preConverter:block]; + // Use the property setter so the default settings get plumbed into _firestoreClient. + self.settings = [[FIRFirestoreSettings alloc] init]; + } + return self; +} + +- (FIRFirestoreSettings *)settings { + // Disallow mutation of our internal settings + return [_settings copy]; +} + +- (void)setSettings:(FIRFirestoreSettings *)settings { + if (![settings isEqual:_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 = + Executor::CreateSerial("com.google.firebase.firestore.user"); +#endif // HAVE_LIBDISPATCH + + _firestore->set_user_executor(std::move(user_executor)); + } +} + +- (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath { + if (!collectionPath) { + ThrowInvalidArgument("Collection path cannot be nil."); + } + if (!collectionPath.length) { + ThrowInvalidArgument("Collection path cannot be empty."); + } + if ([collectionPath containsString:@"//"]) { + ThrowInvalidArgument("Invalid path (%s). Paths must not contain // in them.", collectionPath); + } + + return [[FIRCollectionReference alloc] + initWithReference:_firestore->GetCollection(MakeString(collectionPath))]; +} + +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath { + if (!documentPath) { + ThrowInvalidArgument("Document path cannot be nil."); + } + if (!documentPath.length) { + ThrowInvalidArgument("Document path cannot be empty."); + } + if ([documentPath containsString:@"//"]) { + ThrowInvalidArgument("Invalid path (%s). Paths must not contain // in them.", documentPath); + } + + DocumentReference documentReference = _firestore->GetDocument(MakeString(documentPath)); + return [[FIRDocumentReference alloc] initWithReference:std::move(documentReference)]; +} + +- (FIRQuery *)collectionGroupWithID:(NSString *)collectionID { + if (!collectionID) { + ThrowInvalidArgument("Collection ID cannot be nil."); + } + if (!collectionID.length) { + ThrowInvalidArgument("Collection ID cannot be empty."); + } + if ([collectionID containsString:@"/"]) { + ThrowInvalidArgument("Invalid collection ID (%s). Collection IDs must not contain / in them.", + collectionID); + } + + auto query = _firestore->GetCollectionGroup(MakeString(collectionID)); + return [[FIRQuery alloc] initWithQuery:std::move(query) firestore:_firestore]; +} + +- (FIRWriteBatch *)batch { + return [FIRWriteBatch writeBatchWithDataReader:self.dataReader writeBatch:_firestore->GetBatch()]; +} + +- (void)runTransactionWithBlock:(UserUpdateBlock)updateBlock + dispatchQueue:(dispatch_queue_t)queue + completion:(UserTransactionCompletion)completion { + if (!updateBlock) { + ThrowInvalidArgument("Transaction block cannot be nil."); + } + if (!completion) { + 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 a TransactionResult for tunneling through the internals of the + // system. + auto internalUpdateBlock = [result_capture]( + std::shared_ptr internalTransaction, + core::TransactionResultCallback internalCallback) { + result_capture->RunUpdateBlock(internalTransaction, internalCallback); + }; + + // 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 = [result_capture](const Status &status) { + result_capture->HandleFinalStatus(status); + }; + + _firestore->RunTransaction(std::move(internalUpdateBlock), std::move(objcTranslator)); +} + +- (void)runTransactionWithBlock:(id _Nullable (^)(FIRTransaction *, NSError **error))updateBlock + completion: + (void (^)(id _Nullable result, NSError *_Nullable error))completion { + static dispatch_queue_t transactionDispatchQueue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + transactionDispatchQueue = dispatch_queue_create("com.google.firebase.firestore.transaction", + DISPATCH_QUEUE_CONCURRENT); + }); + [self runTransactionWithBlock:updateBlock + dispatchQueue:transactionDispatchQueue + completion:completion]; +} + ++ (void)enableLogging:(BOOL)logging { + LogSetLevel(logging ? kLogLevelDebug : kLogLevelNotice); +} + +- (void)useEmulatorWithHost:(NSString *)host port:(NSInteger)port { + if (!host.length) { + ThrowInvalidArgument("Host cannot be nil or empty."); + } + if (!_settings.isUsingDefaultHost) { + LOG_WARN("Overriding previously-set host value: %@", _settings.host); + } + // Use a new settings so the new settings are automatically plumbed + // to the underlying Firestore objects. + NSString *settingsHost = [NSString stringWithFormat:@"%@:%li", host, (long)port]; + FIRFirestoreSettings *newSettings = [_settings copy]; + newSettings.host = settingsHost; + self.settings = newSettings; +} + +- (void)enableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + _firestore->EnableNetwork(MakeCallback(completion)); +} + +- (void)disableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable))completion { + _firestore->DisableNetwork(MakeCallback(completion)); +} + +- (void)clearPersistenceWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + _firestore->ClearPersistence(MakeCallback(completion)); +} + +- (void)waitForPendingWritesWithCompletion:(void (^)(NSError *_Nullable error))completion { + _firestore->WaitForPendingWrites(MakeCallback(completion)); +} + +- (void)terminateWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + id strongRegistry = _registry; + if (strongRegistry) { + [strongRegistry + 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 &) { listener(); }); + std::unique_ptr result = + _firestore->AddSnapshotsInSyncListener(std::move(eventListener)); + return [[FSTListenerRegistration alloc] initWithRegistration:std::move(result)]; +} + +- (FIRLoadBundleTask *)loadBundle:(nonnull NSData *)bundleData { + auto stream = absl::make_unique([[NSInputStream alloc] initWithData:bundleData]); + return [self loadBundleStream:[[NSInputStream alloc] initWithData:bundleData] completion:nil]; +} + +- (FIRLoadBundleTask *)loadBundle:(NSData *)bundleData + completion:(nullable void (^)(FIRLoadBundleTaskProgress *_Nullable progress, + NSError *_Nullable error))completion { + return [self loadBundleStream:[[NSInputStream alloc] initWithData:bundleData] + completion:completion]; +} + +- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream { + return [self loadBundleStream:bundleStream completion:nil]; +} + +- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream + completion: + (nullable void (^)(FIRLoadBundleTaskProgress *_Nullable progress, + NSError *_Nullable error))completion { + auto stream = absl::make_unique(bundleStream); + std::shared_ptr task = _firestore->LoadBundle(std::move(stream)); + auto callback = [completion](api::LoadBundleTaskProgress progress) { + if (!completion) { + return; + } + + // Ignoring `kInProgress` because we are setting up for completion callback. + if (progress.state() == api::LoadBundleTaskState::kSuccess) { + completion([[FIRLoadBundleTaskProgress alloc] initWithInternal:progress], nil); + } else if (progress.state() == api::LoadBundleTaskState::kError) { + NSError *error = nil; + if (!progress.error_status().ok()) { + LOG_WARN("Progress set to Error, but error_status() is ok()"); + error = MakeNSError(firebase::firestore::Error::kErrorUnknown, + "Loading bundle failed with unknown error"); + } else { + error = MakeNSError(progress.error_status()); + } + completion([[FIRLoadBundleTaskProgress alloc] initWithInternal:progress], error); + } + }; + + task->SetLastObserver(callback); + return [[FIRLoadBundleTask alloc] initWithTask:task]; +} + +- (void)getQueryNamed:(NSString *)name completion:(void (^)(FIRQuery *_Nullable query))completion { + auto firestore = _firestore; + auto callback = [completion, firestore](core::Query query, bool found) { + if (!completion) { + return; + } + + if (found) { + FIRQuery *firQuery = [[FIRQuery alloc] initWithQuery:std::move(query) firestore:firestore]; + completion(firQuery); + } else { + completion(nil); + } + }; + _firestore->GetNamedQuery(MakeString(name), callback); +} + +@end + +@implementation FIRFirestore (Internal) + +- (std::shared_ptr)wrapped { + return _firestore; +} + +- (const std::shared_ptr &)workerQueue { + return _firestore->worker_queue(); +} + +- (const DatabaseId &)databaseID { + return _firestore->database_id(); +} + ++ (FIRFirestore *)recoverFromFirestore:(std::shared_ptr)firestore { + return (__bridge FIRFirestore *)firestore->extension(); +} + +- (void)terminateInternalWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + _firestore->Terminate(MakeCallback(completion)); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h new file mode 100644 index 0000000..f83ab75 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.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 "FIRFirestoreSettings.h" + +#import + +#include "Firestore/core/src/api/settings.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRFirestoreSettings (Internal) + +/** Returns whether or not the host has been set to a non-default value. */ +@property(nonatomic, readonly) BOOL isUsingDefaultHost; + +/** Converts this FIRFirestoreSettings instance into an api::Settings object. */ +- (firebase::firestore::api::Settings)internalSettings; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm new file mode 100644 index 0000000..acab01a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm @@ -0,0 +1,127 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "FIRFirestoreSettings.h" + +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/string_apple.h" +#include "absl/base/attributes.h" +#include "absl/memory/memory.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace api = firebase::firestore::api; +using api::Settings; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; + +// Public constant +ABSL_CONST_INIT extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited = + Settings::CacheSizeUnlimited; + +@implementation FIRFirestoreSettings + +- (instancetype)init { + if (self = [super init]) { + _host = [NSString stringWithUTF8String:Settings::DefaultHost]; + _sslEnabled = Settings::DefaultSslEnabled; + _dispatchQueue = dispatch_get_main_queue(); + _persistenceEnabled = Settings::DefaultPersistenceEnabled; + _cacheSizeBytes = Settings::DefaultCacheSizeBytes; + } + return self; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } else if (![other isKindOfClass:[FIRFirestoreSettings class]]) { + return NO; + } + + FIRFirestoreSettings *otherSettings = (FIRFirestoreSettings *)other; + return [self.host isEqual:otherSettings.host] && + self.isSSLEnabled == otherSettings.isSSLEnabled && + self.dispatchQueue == otherSettings.dispatchQueue && + self.isPersistenceEnabled == otherSettings.isPersistenceEnabled && + self.cacheSizeBytes == otherSettings.cacheSizeBytes; +} + +- (NSUInteger)hash { + NSUInteger result = [self.host hash]; + result = 31 * result + (self.isSSLEnabled ? 1231 : 1237); + // Ignore the dispatchQueue to avoid having to deal with sizeof(dispatch_queue_t). + result = 31 * result + (self.isPersistenceEnabled ? 1231 : 1237); + result = 31 * result + (NSUInteger)self.cacheSizeBytes; + return result; +} + +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { + FIRFirestoreSettings *copy = [[FIRFirestoreSettings alloc] init]; + copy.host = _host; + copy.sslEnabled = _sslEnabled; + copy.dispatchQueue = _dispatchQueue; + copy.persistenceEnabled = _persistenceEnabled; + copy.cacheSizeBytes = _cacheSizeBytes; + return copy; +} + +- (void)setHost:(NSString *)host { + if (!host) { + ThrowInvalidArgument("Host setting may not be nil. You should generally just use the default " + "value (which is %s)", + Settings::DefaultHost); + } + _host = [host mutableCopy]; +} + +- (void)setDispatchQueue:(dispatch_queue_t)dispatchQueue { + if (!dispatchQueue) { + ThrowInvalidArgument( + "Dispatch queue setting may not be nil. Create a new dispatch queue with " + "dispatch_queue_create(\"com.example.MyQueue\", NULL) or just use the default (which is " + "the main queue, returned from dispatch_get_main_queue())"); + } + _dispatchQueue = dispatchQueue; +} + +- (void)setCacheSizeBytes:(int64_t)cacheSizeBytes { + if (cacheSizeBytes != kFIRFirestoreCacheSizeUnlimited && + cacheSizeBytes < Settings::MinimumCacheSizeBytes) { + ThrowInvalidArgument("Cache size must be set to at least %s bytes", + Settings::MinimumCacheSizeBytes); + } + _cacheSizeBytes = cacheSizeBytes; +} + +- (BOOL)isUsingDefaultHost { + NSString *defaultHost = [NSString stringWithUTF8String:Settings::DefaultHost]; + return [self.host isEqualToString:defaultHost]; +} + +- (Settings)internalSettings { + Settings settings; + settings.set_host(MakeString(_host)); + settings.set_ssl_enabled(_sslEnabled); + settings.set_persistence_enabled(_persistenceEnabled); + settings.set_cache_size_bytes(_cacheSizeBytes); + return settings; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h new file mode 100644 index 0000000..3cf08c0 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h @@ -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. + */ + +#import "FIRFirestoreSource.h" + +namespace firebase { +namespace firestore { +namespace api { + +enum class Source; + +Source MakeSource(FIRFirestoreSource source); + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm new file mode 100644 index 0000000..c43b32d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm @@ -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. + */ + +#import "Firestore/Source/API/FIRFirestoreSource+Internal.h" + +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace api { + +Source MakeSource(FIRFirestoreSource source) { + switch (source) { + case FIRFirestoreSourceDefault: + return Source::Default; + case FIRFirestoreSourceServer: + return Source::Server; + case FIRFirestoreSourceCache: + return Source::Cache; + } + + UNREACHABLE(); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.h new file mode 100644 index 0000000..ca1a166 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.h @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** Version for Firestore. */ + +#import + +/** Version string for the Firebase Firestore SDK. */ +FOUNDATION_EXPORT const char *const FIRFirestoreVersionString; diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.mm new file mode 100644 index 0000000..94d9103 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreVersion.mm @@ -0,0 +1,25 @@ +/* + * 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/API/FIRFirestoreVersion.h" + +#include "Firestore/core/include/firebase/firestore/firestore_version.h" + +using firebase::firestore::kFirestoreVersionString; + +// Because `kFirestoreVersionString` is subject to constant initialization, this +// is not affected by static initialization order fiasco. +extern "C" const char *const FIRFirestoreVersionString = kFirestoreVersionString; diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint+Internal.h new file mode 100644 index 0000000..4fe0f57 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint+Internal.h @@ -0,0 +1,28 @@ +/* + * 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 "FIRGeoPoint.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Internal FIRGeoPoint API we don't want exposed in our public header files. */ +@interface FIRGeoPoint (Internal) + +- (NSComparisonResult)compare:(FIRGeoPoint *)other; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm new file mode 100644 index 0000000..8a64d96 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm @@ -0,0 +1,93 @@ +/* + * 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/API/FIRGeoPoint+Internal.h" + +#include "Firestore/core/include/firebase/firestore/geo_point.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/exception.h" + +using firebase::firestore::util::ThrowInvalidArgument; +using firebase::firestore::util::DoubleBitwiseEquals; +using firebase::firestore::util::DoubleBitwiseHash; +using firebase::firestore::util::WrapCompare; + +NS_ASSUME_NONNULL_BEGIN + +@implementation FIRGeoPoint + +- (instancetype)initWithLatitude:(double)latitude longitude:(double)longitude { + if (self = [super init]) { + if (latitude < -90 || latitude > 90 || !isfinite(latitude)) { + ThrowInvalidArgument("GeoPoint requires a latitude value in the range of [-90, 90], " + "but was %s", + latitude); + } + if (longitude < -180 || longitude > 180 || !isfinite(longitude)) { + ThrowInvalidArgument("GeoPoint requires a longitude value in the range of [-180, 180], " + "but was %s", + longitude); + } + + _latitude = latitude; + _longitude = longitude; + } + return self; +} + +#pragma mark - NSObject methods + +- (NSString *)description { + return [NSString stringWithFormat:@"", self.latitude, self.longitude]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[FIRGeoPoint class]]) { + return NO; + } + FIRGeoPoint *otherGeoPoint = (FIRGeoPoint *)other; + return DoubleBitwiseEquals(self.latitude, otherGeoPoint.latitude) && + DoubleBitwiseEquals(self.longitude, otherGeoPoint.longitude); +} + +- (NSUInteger)hash { + return 31 * DoubleBitwiseHash(self.latitude) + DoubleBitwiseHash(self.longitude); +} + +/** Implements NSCopying without actually copying because geopoints are immutable. */ +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { + return self; +} + +@end + +@implementation FIRGeoPoint (Internal) + +- (NSComparisonResult)compare:(FIRGeoPoint *)other { + NSComparisonResult result = WrapCompare(self.latitude, other.latitude); + if (result != NSOrderedSame) { + return result; + } else { + return WrapCompare(self.longitude, other.longitude); + } +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h new file mode 100644 index 0000000..cd6436d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h @@ -0,0 +1,34 @@ +/* + * 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 + +#import "FIRListenerRegistration.h" + +#include "Firestore/core/src/api/listener_registration.h" + +namespace api = firebase::firestore::api; + +NS_ASSUME_NONNULL_BEGIN + +/** Private implementation of the FIRListenerRegistration protocol. */ +@interface FSTListenerRegistration : NSObject + +- (instancetype)initWithRegistration:(std::unique_ptr)registration; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration.mm new file mode 100644 index 0000000..82b09d2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration.mm @@ -0,0 +1,38 @@ +/* + * 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/API/FIRListenerRegistration+Internal.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation FSTListenerRegistration { + std::unique_ptr _registration; +} + +- (instancetype)initWithRegistration:(std::unique_ptr)registration { + if (self = [super init]) { + _registration = std::move(registration); + } + return self; +} + +- (void)remove { + _registration->Remove(); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask+Internal.h new file mode 100644 index 0000000..42a9a43 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask+Internal.h @@ -0,0 +1,39 @@ +/* + * Copyright 2021 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 + +#import "FIRLoadBundleTask.h" + +#include "Firestore/core/src/api/load_bundle_task.h" + +namespace api = firebase::firestore::api; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRLoadBundleTaskProgress (Internal) + +- (instancetype)initWithInternal:(api::LoadBundleTaskProgress)progress; + +@end + +/** Private implementation of the FIRListenerRegistration protocol. */ +@interface FIRLoadBundleTask (Internal) + +- (instancetype)initWithTask:(std::shared_ptr)task; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm new file mode 100644 index 0000000..c7ea7c5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRLoadBundleTask.mm @@ -0,0 +1,108 @@ +/* + * Copyright 2021 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 "FIRLoadBundleTask.h" + +#include + +#import "Firestore/Source/API/FIRLoadBundleTask+Internal.h" + +#include "Firestore/core/src/api/load_bundle_task.h" +#include "Firestore/core/src/util/exception.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace { + +using firebase::firestore::util::ThrowInvalidArgument; + +} // namespace + +@implementation FIRLoadBundleTaskProgress { +} + +- (instancetype)initWithInternal:(api::LoadBundleTaskProgress)progress { + if (self = [super init]) { + _bytesLoaded = (NSInteger)progress.bytes_loaded(); + _documentsLoaded = progress.documents_loaded(); + _totalBytes = (NSInteger)progress.total_bytes(); + _totalDocuments = progress.total_documents(); + + switch (progress.state()) { + case api::LoadBundleTaskState::kInProgress: + _state = FIRLoadBundleTaskStateInProgress; + break; + case api::LoadBundleTaskState::kSuccess: + _state = FIRLoadBundleTaskStateSuccess; + break; + case api::LoadBundleTaskState::kError: + _state = FIRLoadBundleTaskStateError; + break; + } + } + return self; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } else if (![other isKindOfClass:[FIRLoadBundleTaskProgress class]]) { + return NO; + } + + FIRLoadBundleTaskProgress *otherProgress = (FIRLoadBundleTaskProgress *)other; + return self.documentsLoaded == otherProgress.documentsLoaded && + self.totalDocuments == otherProgress.totalDocuments && + self.bytesLoaded == otherProgress.bytesLoaded && + self.totalBytes == otherProgress.totalBytes && self.state == otherProgress.state; +} + +@end + +@implementation FIRLoadBundleTask { + std::shared_ptr _task; +} + +- (instancetype)initWithTask:(std::shared_ptr)task { + if (self = [super init]) { + _task = std::move(task); + } + return self; +} + +- (FIRLoadBundleObserverHandle)addObserver:(void (^)(FIRLoadBundleTaskProgress *progress))observer { + if (!observer) { + ThrowInvalidArgument("Handler cannot be nil"); + } + + api::LoadBundleTask::ProgressObserver core_observer = + [observer](api::LoadBundleTaskProgress internal_progress) { + observer([[FIRLoadBundleTaskProgress alloc] initWithInternal:internal_progress]); + }; + return (FIRLoadBundleObserverHandle)_task->Observe(std::move(core_observer)); +} + +- (void)removeObserverWithHandle:(FIRLoadBundleObserverHandle)handle { + _task->RemoveObserver(handle); +} + +- (void)removeAllObservers { + _task->RemoveAllObservers(); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h new file mode 100644 index 0000000..05fe19c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.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 "FIRQuery.h" + +#include + +#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; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRQuery (/* Init */) + +- (instancetype)initWithQuery:(api::Query &&)query NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithQuery:(core::Query)query + firestore:(std::shared_ptr)firestore; + +@end + +/** Internal FIRQuery API we don't want exposed in our public header files. */ +@interface FIRQuery (Internal) + +- (const core::Query &)query; + +- (const api::Query &)apiQuery; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm new file mode 100644 index 0000000..b1aac72 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm @@ -0,0 +1,655 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "FIRQuery.h" + +#include +#include +#include + +#import "FIRDocumentReference.h" +#import "FIRFirestoreErrors.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFieldValue+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRFirestoreSource+Internal.h" +#import "Firestore/Source/API/FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FIRQuerySnapshot+Internal.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" +#import "Firestore/Source/API/FSTUserDataReader.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/resource_path.h" +#include "Firestore/core/src/model/server_timestamp_util.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/nanopb_util.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" +#include "absl/strings/match.h" + +namespace nanopb = firebase::firestore::nanopb; +using firebase::firestore::api::Firestore; +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::core::AsyncEventListener; +using firebase::firestore::core::Bound; +using firebase::firestore::core::Direction; +using firebase::firestore::core::EventListener; +using firebase::firestore::core::Filter; +using firebase::firestore::core::ListenOptions; +using firebase::firestore::core::OrderBy; +using firebase::firestore::core::OrderByList; +using firebase::firestore::core::QueryListener; +using firebase::firestore::core::ViewSnapshot; +using firebase::firestore::google_firestore_v1_ArrayValue; +using firebase::firestore::google_firestore_v1_Value; +using firebase::firestore::google_firestore_v1_Value_fields; +using firebase::firestore::model::DatabaseId; +using firebase::firestore::model::DeepClone; +using firebase::firestore::model::Document; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::FieldPath; +using firebase::firestore::model::GetTypeOrder; +using firebase::firestore::model::IsServerTimestamp; +using firebase::firestore::model::RefValue; +using firebase::firestore::model::ResourcePath; +using firebase::firestore::model::TypeOrder; +using firebase::firestore::nanopb::CheckedSize; +using firebase::firestore::nanopb::MakeArray; +using firebase::firestore::nanopb::MakeString; +using firebase::firestore::nanopb::Message; +using firebase::firestore::nanopb::SharedMessage; +using firebase::firestore::nanopb::MakeSharedMessage; +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(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 { + Query _query; +} + +#pragma mark - Constructor Methods + +- (instancetype)initWithQuery:(Query &&)query { + if (self = [super init]) { + _query = std::move(query); + } + return self; +} + +- (instancetype)initWithQuery:(core::Query)query firestore:(std::shared_ptr)firestore { + return [self initWithQuery:Query{std::move(query), std::move(firestore)}]; +} + +#pragma mark - NSObject Methods + +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + if (![[other class] isEqual:[self class]]) return NO; + + auto otherQuery = static_cast(other); + return _query == otherQuery->_query; +} + +- (NSUInteger)hash { + return _query.Hash(); +} + +#pragma mark - Public Methods + +- (FIRFirestore *)firestore { + return [FIRFirestore recoverFromFirestore:_query.firestore()]; +} + +- (void)getDocumentsWithCompletion:(void (^)(FIRQuerySnapshot *_Nullable snapshot, + NSError *_Nullable error))completion { + _query.GetDocuments(Source::Default, [self wrapQuerySnapshotBlock:completion]); +} + +- (void)getDocumentsWithSource:(FIRFirestoreSource)publicSource + completion:(void (^)(FIRQuerySnapshot *_Nullable snapshot, + NSError *_Nullable error))completion { + Source source = api::MakeSource(publicSource); + _query.GetDocuments(source, [self wrapQuerySnapshotBlock:completion]); +} + +- (id)addSnapshotListener:(FIRQuerySnapshotBlock)listener { + return [self addSnapshotListenerWithIncludeMetadataChanges:NO listener:listener]; +} + +- (id) + addSnapshotListenerWithIncludeMetadataChanges:(BOOL)includeMetadataChanges + listener:(FIRQuerySnapshotBlock)listener { + auto options = ListenOptions::FromIncludeMetadataChanges(includeMetadataChanges); + return [self addSnapshotListenerInternalWithOptions:options listener:listener]; +} + +- (id)addSnapshotListenerInternalWithOptions:(ListenOptions)internalOptions + listener: + (FIRQuerySnapshotBlock)listener { + std::shared_ptr firestore = self.firestore.wrapped; + const core::Query &query = self.query; + + // Convert from ViewSnapshots to QuerySnapshots. + auto view_listener = EventListener::Create( + [listener, firestore, query](StatusOr maybe_snapshot) { + if (!maybe_snapshot.status().ok()) { + listener(nil, MakeNSError(maybe_snapshot.status())); + return; + } + + ViewSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); + SnapshotMetadata metadata(snapshot.has_pending_writes(), snapshot.from_cache()); + + listener([[FIRQuerySnapshot alloc] initWithFirestore:firestore + originalQuery:query + snapshot:std::move(snapshot) + metadata:std::move(metadata)], + nil); + }); + + // 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(query, internalOptions, async_listener); + + return [[FSTListenerRegistration alloc] + initWithRegistration:absl::make_unique(firestore->client(), + std::move(async_listener), + std::move(query_listener))]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field isEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::Equal field:field value:value]; +} + +- (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]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isLessThan:(id)value { + return [self queryWithFilterOperator:Filter::Operator::LessThan + path:path.internalValue + value:value]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field isLessThanOrEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::LessThanOrEqual field:field value:value]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isLessThanOrEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::LessThanOrEqual + path:path.internalValue + value:value]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field isGreaterThan:(id)value { + return [self queryWithFilterOperator:Filter::Operator::GreaterThan field:field value:value]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isGreaterThan:(id)value { + return [self queryWithFilterOperator:Filter::Operator::GreaterThan + path:path.internalValue + value:value]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field arrayContains:(id)value { + return [self queryWithFilterOperator:Filter::Operator::ArrayContains field:field value:value]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path arrayContains:(id)value { + return [self queryWithFilterOperator:Filter::Operator::ArrayContains + path:path.internalValue + value:value]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field isGreaterThanOrEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::GreaterThanOrEqual + field:field + value:value]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isGreaterThanOrEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::GreaterThanOrEqual + path:path.internalValue + 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) { + ThrowInvalidArgument("Invalid query. Predicate cannot have an aggregate modifier."); + } + NSString *path; + id value = nil; + if ([comparison.leftExpression expressionType] == NSKeyPathExpressionType && + [comparison.rightExpression expressionType] == NSConstantValueExpressionType) { + path = comparison.leftExpression.keyPath; + value = comparison.rightExpression.constantValue; + switch (comparison.predicateOperatorType) { + case NSEqualToPredicateOperatorType: + return [self queryWhereField:path isEqualTo:value]; + case NSLessThanPredicateOperatorType: + return [self queryWhereField:path isLessThan:value]; + case NSLessThanOrEqualToPredicateOperatorType: + return [self queryWhereField:path isLessThanOrEqualTo:value]; + case NSGreaterThanPredicateOperatorType: + return [self queryWhereField:path isGreaterThan:value]; + case NSGreaterThanOrEqualToPredicateOperatorType: + return [self queryWhereField:path isGreaterThanOrEqualTo:value]; + case NSNotEqualToPredicateOperatorType: + return [self queryWhereField:path isNotEqualTo:value]; + case NSContainsPredicateOperatorType: + return [self queryWhereField:path arrayContains:value]; + case NSInPredicateOperatorType: + return [self queryWhereField:path in:value]; + default:; // Fallback below to throw assertion. + } + } else if ([comparison.leftExpression expressionType] == NSConstantValueExpressionType && + [comparison.rightExpression expressionType] == NSKeyPathExpressionType) { + path = comparison.rightExpression.keyPath; + value = comparison.leftExpression.constantValue; + switch (comparison.predicateOperatorType) { + case NSEqualToPredicateOperatorType: + return [self queryWhereField:path isEqualTo:value]; + case NSLessThanPredicateOperatorType: + return [self queryWhereField:path isGreaterThan:value]; + case NSLessThanOrEqualToPredicateOperatorType: + return [self queryWhereField:path isGreaterThanOrEqualTo:value]; + case NSGreaterThanPredicateOperatorType: + return [self queryWhereField:path isLessThan:value]; + case NSGreaterThanOrEqualToPredicateOperatorType: + return [self queryWhereField:path isLessThanOrEqualTo:value]; + case NSNotEqualToPredicateOperatorType: + return [self queryWhereField:path isNotEqualTo:value]; + case NSContainsPredicateOperatorType: + return [self queryWhereField:path arrayContains:value]; + case NSInPredicateOperatorType: + return [self queryWhereField:path in:value]; + default:; // Fallback below to throw assertion. + } + } else { + ThrowInvalidArgument( + "Invalid query. Predicate comparisons must include a key path and a constant."); + } + // Fallback cases of unsupported comparison operator. + switch (comparison.predicateOperatorType) { + case NSCustomSelectorPredicateOperatorType: + ThrowInvalidArgument("Invalid query. Custom predicate filters are not supported."); + break; + default: + ThrowInvalidArgument("Invalid query. Operator type %s is not supported.", + comparison.predicateOperatorType); + } +} + +- (FIRQuery *)queryFilteredUsingCompoundPredicate:(NSPredicate *)predicate { + NSCompoundPredicate *compound = (NSCompoundPredicate *)predicate; + if (compound.compoundPredicateType != NSAndPredicateType || compound.subpredicates.count == 0) { + ThrowInvalidArgument("Invalid query. Only compound queries using AND are supported."); + } + FIRQuery *query = self; + for (NSPredicate *pred in compound.subpredicates) { + query = [query queryFilteredUsingPredicate:pred]; + } + return query; +} + +- (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate { + if ([predicate isKindOfClass:[NSComparisonPredicate class]]) { + return [self queryFilteredUsingComparisonPredicate:predicate]; + } else if ([predicate isKindOfClass:[NSCompoundPredicate class]]) { + return [self queryFilteredUsingCompoundPredicate:predicate]; + } 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 { + ThrowInvalidArgument("Invalid query. Expect comparison or compound of comparison predicate. " + "Please use predicateWithFormat to create predicates."); + } +} + +- (FIRQuery *)queryOrderedByField:(NSString *)field { + return [self queryOrderedByField:field descending:NO]; +} + +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)fieldPath { + return [self queryOrderedByFieldPath:fieldPath descending:NO]; +} + +- (FIRQuery *)queryOrderedByField:(NSString *)field descending:(BOOL)descending { + return [self queryOrderedByFieldPath:MakeFieldPath(field) + direction:Direction::FromDescending(descending)]; +} + +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)fieldPath descending:(BOOL)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 { + return Wrap(_query.LimitToFirst(SaturatedLimitValue(limit))); +} + +- (FIRQuery *)queryLimitedToLast:(NSInteger)limit { + return Wrap(_query.LimitToLast(SaturatedLimitValue(limit))); +} + +- (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)snapshot { + Bound bound = [self boundFromSnapshot:snapshot isBefore:YES]; + return Wrap(_query.StartAt(std::move(bound))); +} + +- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues { + Bound bound = [self boundFromFieldValues:fieldValues isBefore:YES]; + return Wrap(_query.StartAt(std::move(bound))); +} + +- (FIRQuery *)queryStartingAfterDocument:(FIRDocumentSnapshot *)snapshot { + Bound bound = [self boundFromSnapshot:snapshot isBefore:NO]; + return Wrap(_query.StartAt(std::move(bound))); +} + +- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues { + Bound bound = [self boundFromFieldValues:fieldValues isBefore:NO]; + return Wrap(_query.StartAt(std::move(bound))); +} + +- (FIRQuery *)queryEndingBeforeDocument:(FIRDocumentSnapshot *)snapshot { + Bound bound = [self boundFromSnapshot:snapshot isBefore:YES]; + return Wrap(_query.EndAt(std::move(bound))); +} + +- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues { + Bound bound = [self boundFromFieldValues:fieldValues isBefore:YES]; + return Wrap(_query.EndAt(std::move(bound))); +} + +- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)snapshot { + Bound bound = [self boundFromSnapshot:snapshot isBefore:NO]; + return Wrap(_query.EndAt(std::move(bound))); +} + +- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues { + Bound bound = [self boundFromFieldValues:fieldValues isBefore:NO]; + return Wrap(_query.EndAt(std::move(bound))); +} + +#pragma mark - Private Methods + +- (Message)parsedQueryValue:(id)value { + return [self.firestore.dataReader parsedQueryValue:value]; +} + +- (Message)parsedQueryValue:(id)value allowArrays:(bool)allowArrays { + return [self.firestore.dataReader parsedQueryValue:value allowArrays:allowArrays]; +} + +- (QuerySnapshotListener)wrapQuerySnapshotBlock:(FIRQuerySnapshotBlock)block { + class Converter : public EventListener { + public: + explicit Converter(FIRQuerySnapshotBlock block) : block_(block) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (maybe_snapshot.ok()) { + FIRQuerySnapshot *result = + [[FIRQuerySnapshot alloc] initWithSnapshot:std::move(maybe_snapshot).ValueOrDie()]; + block_(result, nil); + } else { + block_(nil, MakeNSError(maybe_snapshot.status())); + } + } + + private: + FIRQuerySnapshotBlock block_; + }; + + return absl::make_unique(block); +} + +/** Private helper for all of the queryWhereField: methods. */ +- (FIRQuery *)queryWithFilterOperator:(Filter::Operator)filterOperator + field:(NSString *)field + value:(id)value { + return [self queryWithFilterOperator:filterOperator path:MakeFieldPath(field) value:value]; +} + +- (FIRQuery *)queryWithFilterOperator:(Filter::Operator)filterOperator + path:(const FieldPath &)fieldPath + value:(id)value { + Message 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)); +} + +/** + * Create a Bound from a query given the document. + * + * Note that the Bound will always include the key of the document and the position will be + * unambiguous. + * + * Will throw if the document does not contain all fields of the order by of + * the query or if any of the fields in the order by are an uncommitted server + * timestamp. + */ +- (Bound)boundFromSnapshot:(FIRDocumentSnapshot *)snapshot isBefore:(BOOL)isBefore { + if (![snapshot exists]) { + ThrowInvalidArgument("Invalid query. You are trying to start or end a query using a document " + "that doesn't exist."); + } + const Document &document = *snapshot.internalDocument; + const DatabaseId &databaseID = self.firestore.databaseID; + const OrderByList &order_bys = self.query.order_bys(); + + SharedMessage components{{}}; + components->values_count = CheckedSize(order_bys.size()); + components->values = MakeArray(components->values_count); + + // Because people expect to continue/end a query at the exact document provided, we need to + // use the implicit sort order rather than the explicit sort order, because it's guaranteed to + // contain the document key. That way the position becomes unambiguous and the query + // continues/ends exactly at the provided document. Without the key (by using the explicit sort + // orders), multiple documents could match the position, yielding duplicate results. + for (size_t i = 0; i < order_bys.size(); ++i) { + if (order_bys[i].field() == FieldPath::KeyFieldPath()) { + components->values[i] = *RefValue(databaseID, document->key()).release(); + } else { + absl::optional value = document->field(order_bys[i].field()); + + if (value) { + if (IsServerTimestamp(*value)) { + ThrowInvalidArgument( + "Invalid query. You are trying to start or end a query using a document for which " + "the field '%s' is an uncommitted server timestamp. (Since the value of this field " + "is unknown, you cannot start/end a query with it.)", + order_bys[i].field().CanonicalString()); + } else { + components->values[i] = *DeepClone(*value).release(); + } + } else { + ThrowInvalidArgument( + "Invalid query. You are trying to start or end a query using a document for which the " + "field '%s' (used as the order by) does not exist.", + order_bys[i].field().CanonicalString()); + } + } + } + return Bound::FromValue(std::move(components), isBefore); +} + +/** Converts a list of field values to an Bound. */ +- (Bound)boundFromFieldValues:(NSArray *)fieldValues isBefore:(BOOL)isBefore { + // Use explicit sort order because it has to match the query the user made + const OrderByList &explicitSortOrders = self.query.explicit_order_bys(); + if (fieldValues.count > explicitSortOrders.size()) { + ThrowInvalidArgument("Invalid query. You are trying to start or end a query using more values " + "than were specified in the order by."); + } + + SharedMessage components{{}}; + components->values_count = CheckedSize(fieldValues.count); + components->values = MakeArray(components->values_count); + for (NSUInteger idx = 0, max = fieldValues.count; idx < max; ++idx) { + id rawValue = fieldValues[idx]; + const OrderBy &sortOrder = explicitSortOrders[idx]; + + Message fieldValue{[self parsedQueryValue:rawValue]}; + if (sortOrder.field().IsKeyFieldPath()) { + if (GetTypeOrder(*fieldValue) != TypeOrder::kString) { + ThrowInvalidArgument("Invalid query. Expected a string for the document ID."); + } + + std::string documentID = MakeString(fieldValue->string_value); + if (!self.query.IsCollectionGroupQuery() && absl::StrContains(documentID, "/")) { + ThrowInvalidArgument("Invalid query. When querying a collection and ordering by document " + "ID, you must pass a plain document ID, but '%s' contains a slash.", + documentID); + } + ResourcePath path = self.query.path().Append(ResourcePath::FromString(documentID)); + if (!DocumentKey::IsDocumentKey(path)) { + ThrowInvalidArgument("Invalid query. When querying a collection group and ordering by " + "document ID, you must pass a value that results in a valid document " + "path, but '%s' is not because it contains an odd number of segments.", + path.CanonicalString()); + } + DocumentKey key{path}; + components->values[idx] = *RefValue(self.firestore.databaseID, key).release(); + } else { + components->values[idx] = *fieldValue.release(); + } + } + + return Bound::FromValue(std::move(components), isBefore); +} + +@end + +@implementation FIRQuery (Internal) + +- (const core::Query &)query { + return _query.query(); +} + +- (const api::Query &)apiQuery { + return _query; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h new file mode 100644 index 0000000..104a679 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h @@ -0,0 +1,44 @@ +/* + * 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 "FIRQuerySnapshot.h" + +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" + +@class FIRFirestore; +@class FIRSnapshotMetadata; + +namespace api = firebase::firestore::api; +namespace core = firebase::firestore::core; + +NS_ASSUME_NONNULL_BEGIN + +/** Internal FIRQuerySnapshot API we don't want exposed in our public header files. */ +@interface FIRQuerySnapshot (/* Init */) + +- (instancetype)initWithSnapshot:(api::QuerySnapshot &&)snapshot NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithFirestore:(std::shared_ptr)firestore + originalQuery:(core::Query)query + snapshot:(core::ViewSnapshot &&)snapshot + metadata:(api::SnapshotMetadata)metadata; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm new file mode 100644 index 0000000..18e2a58 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm @@ -0,0 +1,143 @@ +/* + * 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 + +#import "Firestore/Source/API/FIRQuerySnapshot+Internal.h" + +#import "FIRSnapshotMetadata.h" +#import "Firestore/Source/API/FIRDocumentChange+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.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::core::ViewSnapshot; +using firebase::firestore::util::DelayedConstructor; + +NS_ASSUME_NONNULL_BEGIN + +@implementation FIRQuerySnapshot { + DelayedConstructor _snapshot; + + FIRSnapshotMetadata *_cached_metadata; + + // Cached value of the documents property. + NSArray *_documents; + + // Cached value of the documentChanges property. + NSArray *_documentChanges; + BOOL _documentChangesIncludeMetadataChanges; +} + +- (instancetype)initWithSnapshot:(QuerySnapshot &&)snapshot { + if (self = [super init]) { + _snapshot.Init(std::move(snapshot)); + } + return self; +} + +- (instancetype)initWithFirestore:(std::shared_ptr)firestore + originalQuery:(core::Query)query + snapshot:(ViewSnapshot &&)snapshot + metadata:(SnapshotMetadata)metadata { + QuerySnapshot wrapped(firestore, std::move(query), std::move(snapshot), std::move(metadata)); + return [self initWithSnapshot:std::move(wrapped)]; +} + +// NSObject Methods +- (BOOL)isEqual:(nullable id)other { + if (![other isKindOfClass:[FIRQuerySnapshot class]]) return NO; + + FIRQuerySnapshot *otherSnapshot = other; + return *_snapshot == *(otherSnapshot->_snapshot); +} + +- (NSUInteger)hash { + return _snapshot->Hash(); +} + +- (FIRQuery *)query { + return [[FIRQuery alloc] initWithQuery:_snapshot->query()]; +} + +- (FIRSnapshotMetadata *)metadata { + if (!_cached_metadata) { + _cached_metadata = [[FIRSnapshotMetadata alloc] initWithMetadata:_snapshot->metadata()]; + } + return _cached_metadata; +} + +@dynamic empty; + +- (BOOL)isEmpty { + return _snapshot->empty(); +} + +// This property is exposed as an NSInteger instead of an NSUInteger since (as of Xcode 8.1) +// Swift bridges NSUInteger as UInt, and we want to avoid forcing Swift users to cast their ints +// where we can. See cr/146959032 for additional context. +- (NSInteger)count { + return static_cast(_snapshot->size()); +} + +- (NSArray *)documents { + if (!_documents) { + NSMutableArray *result = [NSMutableArray array]; + _snapshot->ForEachDocument([&result](DocumentSnapshot snapshot) { + [result addObject:[[FIRQueryDocumentSnapshot alloc] initWithSnapshot:std::move(snapshot)]]; + }); + + _documents = result; + } + return _documents; +} + +- (NSArray *)documentChanges { + return [self documentChangesWithIncludeMetadataChanges:NO]; +} + +- (NSArray *)documentChangesWithIncludeMetadataChanges: + (BOOL)includeMetadataChanges { + if (!_documentChanges || _documentChangesIncludeMetadataChanges != includeMetadataChanges) { + NSMutableArray *documentChanges = [NSMutableArray array]; + _snapshot->ForEachChange( + static_cast(includeMetadataChanges), [&documentChanges](DocumentChange change) { + [documentChanges + addObject:[[FIRDocumentChange alloc] initWithDocumentChange:std::move(change)]]; + }); + + _documentChanges = documentChanges; + _documentChangesIncludeMetadataChanges = includeMetadataChanges; + } + return _documentChanges; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h new file mode 100644 index 0000000..e38971d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h @@ -0,0 +1,35 @@ +/* + * 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 "FIRSnapshotMetadata.h" + +#import + +#include "Firestore/core/src/api/snapshot_metadata.h" + +namespace api = firebase::firestore::api; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRSnapshotMetadata (/* Init */) + +- (instancetype)initWithMetadata:(api::SnapshotMetadata)metadata NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithPendingWrites:(bool)pendingWrites fromCache:(bool)fromCache; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm new file mode 100644 index 0000000..5bfd384 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm @@ -0,0 +1,66 @@ +/* + * 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 "FIRSnapshotMetadata.h" + +#include + +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" + +#include "Firestore/core/src/api/snapshot_metadata.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation FIRSnapshotMetadata { + api::SnapshotMetadata _metadata; +} + +- (instancetype)initWithMetadata:(api::SnapshotMetadata)metadata { + if (self = [super init]) { + _metadata = std::move(metadata); + } + return self; +} + +- (instancetype)initWithPendingWrites:(bool)pendingWrites fromCache:(bool)fromCache { + api::SnapshotMetadata wrapped(pendingWrites, fromCache); + return [self initWithMetadata:std::move(wrapped)]; +} + +// NSObject Methods +- (BOOL)isEqual:(nullable id)other { + if (other == self) return YES; + if (![other isKindOfClass:[FIRSnapshotMetadata class]]) return NO; + + FIRSnapshotMetadata *otherMetadata = other; + return _metadata == otherMetadata->_metadata; +} + +- (NSUInteger)hash { + return _metadata.Hash(); +} + +- (BOOL)hasPendingWrites { + return _metadata.pending_writes(); +} + +- (BOOL)isFromCache { + return _metadata.from_cache(); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp+Internal.h new file mode 100644 index 0000000..48e38b2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp+Internal.h @@ -0,0 +1,35 @@ +/* + * 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 "FIRTimestamp.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Internal FIRTimestamp API we don't want exposed in our public header files. */ +@interface FIRTimestamp (Internal) + +/** + * Converts the given date to an ISO 8601 timestamp string, useful for rendering in JSON. + * + * ISO 8601 dates times in UTC look like this: "1912-04-14T23:40:00.000000000Z". + * + * @see http://www.ecma-international.org/ecma-262/6.0/#sec-date-time-string-format + */ +- (NSString *)ISO8601String; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m new file mode 100644 index 0000000..195a5cf --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m @@ -0,0 +1,152 @@ +/* + * 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/API/FIRTimestamp+Internal.h" + +NS_ASSUME_NONNULL_BEGIN + +static const int kNanosPerSecond = 1000000000; + +@implementation FIRTimestamp (Internal) + +#pragma mark - Internal public methods + +- (NSString *)ISO8601String { + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss"; + formatter.timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; + NSDate *secondsDate = [NSDate dateWithTimeIntervalSince1970:self.seconds]; + NSString *secondsString = [formatter stringFromDate:secondsDate]; + if (secondsString.length != 19) { + [NSException raise:@"Invalid ISO string" format:@"Invalid ISO string: %@", secondsString]; + } + + NSString *nanosString = [NSString stringWithFormat:@"%09d", self.nanoseconds]; + return [NSString stringWithFormat:@"%@.%@Z", secondsString, nanosString]; +} + +@end + +@implementation FIRTimestamp + +#pragma mark - Constructors + ++ (instancetype)timestampWithDate:(NSDate *)date { + double secondsDouble; + double fraction = modf(date.timeIntervalSince1970, &secondsDouble); + // GCP Timestamps always have non-negative nanos. + if (fraction < 0) { + fraction += 1.0; + secondsDouble -= 1.0; + } + int64_t seconds = (int64_t)secondsDouble; + int32_t nanos = (int32_t)(fraction * kNanosPerSecond); + return [[FIRTimestamp alloc] initWithSeconds:seconds nanoseconds:nanos]; +} + ++ (instancetype)timestampWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds { + return [[FIRTimestamp alloc] initWithSeconds:seconds nanoseconds:nanoseconds]; +} + ++ (instancetype)timestamp { + return [FIRTimestamp timestampWithDate:[NSDate date]]; +} + +- (instancetype)initWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds { + self = [super init]; + if (self) { + if (nanoseconds < 0) { + [NSException raise:@"Invalid timestamp" + format:@"Timestamp nanoseconds out of range: %d", nanoseconds]; + } + if (nanoseconds >= 1e9) { + [NSException raise:@"Invalid timestamp" + format:@"Timestamp nanoseconds out of range: %d", nanoseconds]; + } + // Midnight at the beginning of 1/1/1 is the earliest timestamp supported. + if (seconds < -62135596800L) { + [NSException raise:@"Invalid timestamp" + format:@"Timestamp seconds out of range: %lld", seconds]; + } + // This will break in the year 10,000. + if (seconds >= 253402300800L) { + [NSException raise:@"Invalid timestamp" + format:@"Timestamp seconds out of range: %lld", seconds]; + } + + _seconds = seconds; + _nanoseconds = nanoseconds; + } + return self; +} + +#pragma mark - NSObject methods + +- (BOOL)isEqual:(id)object { + if (self == object) { + return YES; + } + if (![object isKindOfClass:[FIRTimestamp class]]) { + return NO; + } + return [self isEqualToTimestamp:(FIRTimestamp *)object]; +} + +- (NSUInteger)hash { + return (NSUInteger)((self.seconds >> 32) ^ self.seconds ^ self.nanoseconds); +} + +- (NSString *)description { + return [NSString stringWithFormat:@"", self.seconds, + self.nanoseconds]; +} + +/** Implements NSCopying without actually copying because timestamps are immutable. */ +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { + return self; +} + +#pragma mark - Public methods + +- (NSDate *)dateValue { + NSTimeInterval interval = (NSTimeInterval)self.seconds + ((NSTimeInterval)self.nanoseconds) / 1e9; + return [NSDate dateWithTimeIntervalSince1970:interval]; +} + +- (NSComparisonResult)compare:(FIRTimestamp *)other { + if (self.seconds < other.seconds) { + return NSOrderedAscending; + } else if (self.seconds > other.seconds) { + return NSOrderedDescending; + } + + if (self.nanoseconds < other.nanoseconds) { + return NSOrderedAscending; + } else if (self.nanoseconds > other.nanoseconds) { + return NSOrderedDescending; + } + return NSOrderedSame; +} + +#pragma mark - Private methods + +- (BOOL)isEqualToTimestamp:(FIRTimestamp *)other { + return [self compare:other] == NSOrderedSame; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h new file mode 100644 index 0000000..93c7944 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h @@ -0,0 +1,36 @@ +/* + * 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 "FIRTransaction.h" + +#include + +#include "Firestore/core/src/core/transaction.h" + +@class FIRFirestore; + +namespace core = firebase::firestore::core; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRTransaction (Internal) + ++ (instancetype)transactionWithInternalTransaction:(std::shared_ptr)transaction + firestore:(FIRFirestore *)firestore; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm new file mode 100644 index 0000000..42b4203 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm @@ -0,0 +1,185 @@ +/* + * 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 "FIRTransaction.h" + +#include +#include +#include + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRTransaction+Internal.h" +#import "Firestore/Source/API/FSTUserDataReader.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::core::ParsedSetData; +using firebase::firestore::core::ParsedUpdateData; +using firebase::firestore::core::Transaction; +using firebase::firestore::model::Document; +using firebase::firestore::util::MakeNSError; +using firebase::firestore::util::StatusOr; +using firebase::firestore::util::ThrowInvalidArgument; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - FIRTransaction + +@interface FIRTransaction () + +- (instancetype)initWithTransaction:(std::shared_ptr)transaction + firestore:(FIRFirestore *)firestore NS_DESIGNATED_INITIALIZER; + +@property(nonatomic, strong, readonly) FIRFirestore *firestore; +@end + +@implementation FIRTransaction (Internal) + ++ (instancetype)transactionWithInternalTransaction:(std::shared_ptr)transaction + firestore:(FIRFirestore *)firestore { + return [[FIRTransaction alloc] initWithTransaction:std::move(transaction) firestore:firestore]; +} + +@end + +@implementation FIRTransaction { + std::shared_ptr _internalTransaction; +} + +- (instancetype)initWithTransaction:(std::shared_ptr)transaction + firestore:(FIRFirestore *)firestore { + self = [super init]; + if (self) { + _internalTransaction = std::move(transaction); + _firestore = firestore; + } + return self; +} + +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document { + return [self setData:data forDocument:document merge:NO]; +} + +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + merge:(BOOL)merge { + [self validateReference:document]; + ParsedSetData parsed = merge ? [self.firestore.dataReader parsedMergeData:data fieldMask:nil] + : [self.firestore.dataReader parsedSetData:data]; + _internalTransaction->Set(document.key, std::move(parsed)); + return self; +} + +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + mergeFields:(NSArray *)mergeFields { + [self validateReference:document]; + ParsedSetData parsed = [self.firestore.dataReader parsedMergeData:data fieldMask:mergeFields]; + _internalTransaction->Set(document.key, std::move(parsed)); + return self; +} + +- (FIRTransaction *)updateData:(NSDictionary *)fields + forDocument:(FIRDocumentReference *)document { + [self validateReference:document]; + ParsedUpdateData parsed = [self.firestore.dataReader parsedUpdateData:fields]; + _internalTransaction->Update(document.key, std::move(parsed)); + return self; +} + +- (FIRTransaction *)deleteDocument:(FIRDocumentReference *)document { + [self validateReference:document]; + _internalTransaction->Delete(document.key); + return self; +} + +- (void)getDocument:(FIRDocumentReference *)document + completion:(void (^)(FIRDocumentSnapshot *_Nullable document, + NSError *_Nullable error))completion { + [self validateReference:document]; + _internalTransaction->Lookup( + {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 Document &internalDoc = documents.front(); + if (internalDoc->is_found_document()) { + FIRDocumentSnapshot *doc = + [[FIRDocumentSnapshot alloc] initWithFirestore:self.firestore + documentKey:internalDoc->key() + document:internalDoc + fromCache:false + hasPendingWrites:false]; + completion(doc, nil); + } else if (internalDoc->is_no_document()) { + FIRDocumentSnapshot *doc = [[FIRDocumentSnapshot alloc] initWithFirestore:self.firestore + documentKey:document.key + document:absl::nullopt + fromCache:false + hasPendingWrites:false]; + completion(doc, nil); + } else { + HARD_FAIL("BatchGetDocumentsRequest returned unexpected document type: %s", + internalDoc.ToString()); + } + }); +} + +- (FIRDocumentSnapshot *_Nullable)getDocument:(FIRDocumentReference *)document + error:(NSError *__autoreleasing *)error { + [self validateReference:document]; + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + __block FIRDocumentSnapshot *result; + // We have to explicitly assign the innerError into a local to cause it to retain correctly. + __block NSError *outerError = nil; + [self getDocument:document + completion:^(FIRDocumentSnapshot *_Nullable snapshot, NSError *_Nullable innerError) { + result = snapshot; + outerError = innerError; + dispatch_semaphore_signal(semaphore); + }]; + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + if (error) { + *error = outerError; + } + return result; +} + +- (void)validateReference:(FIRDocumentReference *)reference { + if (reference.firestore != self.firestore) { + ThrowInvalidArgument("Provided document reference is from a different Cloud Firestore " + "instance."); + } +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h new file mode 100644 index 0000000..54329f5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h @@ -0,0 +1,36 @@ +/* + * 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 "FIRWriteBatch.h" + +#import + +#include "Firestore/core/src/api/write_batch.h" + +@class FSTUserDataReader; + +namespace api = firebase::firestore::api; + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRWriteBatch (Internal) + ++ (instancetype)writeBatchWithDataReader:(FSTUserDataReader *)dataReader + writeBatch:(api::WriteBatch &&)writeBatch; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm new file mode 100644 index 0000000..ecf55c6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm @@ -0,0 +1,116 @@ +/* + * 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/API/FIRWriteBatch+Internal.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FSTUserDataReader.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" + +using firebase::firestore::core::ParsedSetData; +using firebase::firestore::core::ParsedUpdateData; +using firebase::firestore::util::DelayedConstructor; +using firebase::firestore::util::MakeCallback; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - FIRWriteBatch + +@interface FIRWriteBatch () + +- (instancetype)initWithDataReader:(FSTUserDataReader *)dataReader + writeBatch:(api::WriteBatch &&)writeBatch NS_DESIGNATED_INITIALIZER; + +@property(nonatomic, strong, readonly) FSTUserDataReader *dataReader; + +@end + +@implementation FIRWriteBatch (Internal) + ++ (instancetype)writeBatchWithDataReader:(FSTUserDataReader *)dataReader + writeBatch:(api::WriteBatch &&)writeBatch { + return [[FIRWriteBatch alloc] initWithDataReader:dataReader writeBatch:std::move(writeBatch)]; +} + +@end + +@implementation FIRWriteBatch { + DelayedConstructor _writeBatch; +} + +- (instancetype)initWithDataReader:(FSTUserDataReader *)dataReader + writeBatch:(api::WriteBatch &&)writeBatch { + self = [super init]; + if (self) { + _dataReader = dataReader; + _writeBatch.Init(std::move(writeBatch)); + } + return self; +} + +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document { + return [self setData:data forDocument:document merge:NO]; +} + +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + merge:(BOOL)merge { + ParsedSetData parsed = merge ? [self.dataReader parsedMergeData:data fieldMask:nil] + : [self.dataReader parsedSetData:data]; + _writeBatch->SetData(document.internalReference, std::move(parsed)); + + return self; +} + +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + mergeFields:(NSArray *)mergeFields { + ParsedSetData parsed = [self.dataReader parsedMergeData:data fieldMask:mergeFields]; + _writeBatch->SetData(document.internalReference, std::move(parsed)); + + return self; +} + +- (FIRWriteBatch *)updateData:(NSDictionary *)fields + forDocument:(FIRDocumentReference *)document { + ParsedUpdateData parsed = [self.dataReader parsedUpdateData:fields]; + _writeBatch->UpdateData(document.internalReference, std::move(parsed)); + + return self; +} + +- (FIRWriteBatch *)deleteDocument:(FIRDocumentReference *)document { + _writeBatch->DeleteData(document.internalReference); + + return self; +} + +- (void)commit { + [self commitWithCompletion:nil]; +} + +- (void)commitWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { + _writeBatch->Commit(MakeCallback(completion)); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.h new file mode 100644 index 0000000..74504ca --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.h @@ -0,0 +1,61 @@ +/* + * 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 "Firestore/Source/API/FIRFirestore+Internal.h" + +@class FIRApp; +@class FIRFirestore; + +NS_ASSUME_NONNULL_BEGIN + +/// Provides and creates instances of Firestore based on a specific key. Used in the interop +/// registration process to keep track of instances for `FIRApp` instances. +@protocol FSTFirestoreMultiDBProvider + +/// Cached instances of Firestore objects. +@property(nonatomic, strong) NSMutableDictionary *instances; + +/// Default method for retrieving a Firestore instance, or creating one if it doesn't exist. +- (FIRFirestore *)firestoreForDatabase:(NSString *)database; + +@end + +/// A concrete implementation for FSTInstanceProvider to create Firestore instances and register +/// with Core's component system. +@interface FSTFirestoreComponent + : NSObject + +/// The FIRApp that instances will be set up with. +@property(nonatomic, weak, readonly) FIRApp *app; + +/// Cached instances of Firestore objects. +@property(nonatomic, strong) NSMutableDictionary *instances; + +/// Default method for retrieving a Firestore instance, or creating one if it doesn't exist. +- (FIRFirestore *)firestoreForDatabase:(NSString *)database; + +- (void)removeInstanceWithDatabase:(NSString *)database; + +/// Default initializer. +- (instancetype)initWithApp:(FIRApp *)app NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm new file mode 100644 index 0000000..430072e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm @@ -0,0 +1,174 @@ +/* + * 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 "Firestore/Source/API/FSTFirestoreComponent.h" + +#include +#include +#include + +#import "FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h" +#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/api/firestore.h" +#include "Firestore/core/src/credentials/credentials_provider.h" +#include "Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.h" +#include "Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.h" +#include "Firestore/core/src/remote/firebase_metadata_provider.h" +#include "Firestore/core/src/remote/firebase_metadata_provider_apple.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" + +using firebase::firestore::credentials::CredentialsProvider; +using firebase::firestore::credentials::FirebaseAppCheckCredentialsProvider; +using firebase::firestore::credentials::FirebaseAuthCredentialsProvider; +using firebase::firestore::remote::FirebaseMetadataProviderApple; +using firebase::firestore::util::AsyncQueue; +using firebase::firestore::util::Executor; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; + +NS_ASSUME_NONNULL_BEGIN + +@interface FSTFirestoreComponent () +@end + +@implementation FSTFirestoreComponent + +// Explicitly @synthesize because instances is part of the FSTInstanceProvider protocol. +@synthesize instances = _instances; + +#pragma mark - Initialization + +- (instancetype)initWithApp:(FIRApp *)app { + self = [super init]; + if (self) { + _instances = [[NSMutableDictionary alloc] init]; + + HARD_ASSERT(app, "Cannot initialize Firestore with a nil FIRApp."); + _app = app; + } + return self; +} + +- (NSString *)keyForDatabase:(NSString *)database { + return [NSString stringWithFormat:@"%@|%@", self.app.name, database]; +} + +#pragma mark - FSTInstanceProvider Conformance + +- (FIRFirestore *)firestoreForDatabase:(NSString *)database { + if (!database) { + ThrowInvalidArgument("Database identifier may not be nil."); + } + + NSString *projectID = self.app.options.projectID; + if (!projectID) { + ThrowInvalidArgument("FIROptions.projectID must be set to a valid project ID."); + } + + NSString *key = [self keyForDatabase:database]; + + // Get the component from the container. + @synchronized(self.instances) { + FIRFirestore *firestore = _instances[key]; + if (!firestore) { + std::string queue_name{"com.google.firebase.firestore"}; + if (!self.app.isDefaultApp) { + absl::StrAppend(&queue_name, ".", MakeString(self.app.name)); + } + + auto executor = Executor::CreateSerial(queue_name.c_str()); + auto workerQueue = AsyncQueue::Create(std::move(executor)); + + id auth = FIR_COMPONENT(FIRAuthInterop, self.app.container); + id app_check = FIR_COMPONENT(FIRAppCheckInterop, self.app.container); + auto authCredentialsProvider = + std::make_shared(self.app, auth); + auto appCheckCredentialsProvider = + std::make_shared(self.app, app_check); + + auto firebaseMetadataProvider = absl::make_unique(self.app); + + model::DatabaseId databaseID{MakeString(projectID), MakeString(database)}; + std::string persistenceKey = MakeString(self.app.name); + firestore = [[FIRFirestore alloc] initWithDatabaseID:std::move(databaseID) + persistenceKey:std::move(persistenceKey) + authCredentialsProvider:std::move(authCredentialsProvider) + appCheckCredentialsProvider:std::move(appCheckCredentialsProvider) + workerQueue:std::move(workerQueue) + firebaseMetadataProvider:std::move(firebaseMetadataProvider) + firebaseApp:self.app + instanceRegistry:self]; + _instances[key] = firestore; + } + return firestore; + } +} + +- (void)removeInstanceWithDatabase:(NSString *)database { + @synchronized(_instances) { + NSString *key = [self keyForDatabase:database]; + [_instances removeObjectForKey:key]; + } +} + +#pragma mark - FIRComponentLifecycleMaintainer + +- (void)appWillBeDeleted:(__unused FIRApp *)app { + NSDictionary *instances; + @synchronized(_instances) { + instances = [_instances copy]; + [_instances removeAllObjects]; + } + for (NSString *key in instances) { + [instances[key] terminateInternalWithCompletion:nil]; + } +} + +#pragma mark - Object Lifecycle + ++ (void)load { + [FIRApp registerInternalLibrary:(Class)self withName:@"fire-fst"]; +} + +#pragma mark - Interoperability + ++ (NSArray *)componentsToRegister { + FIRDependency *auth = [FIRDependency dependencyWithProtocol:@protocol(FIRAuthInterop) + isRequired:NO]; + FIRComponent *firestoreProvider = [FIRComponent + componentWithProtocol:@protocol(FSTFirestoreMultiDBProvider) + instantiationTiming:FIRInstantiationTimingLazy + dependencies:@[ auth ] + creationBlock:^id _Nullable(FIRComponentContainer *container, BOOL *isCacheable) { + FSTFirestoreComponent *multiDBComponent = + [[FSTFirestoreComponent alloc] initWithApp:container.app]; + *isCacheable = YES; + return multiDBComponent; + }]; + return @[ firestoreProvider ]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.h new file mode 100644 index 0000000..f348ff7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.h @@ -0,0 +1,95 @@ +/* + * Copyright 2021 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 + +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.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" +#include "Firestore/core/src/nanopb/message.h" + +@class FIRTimestamp; + +namespace core = firebase::firestore::core; +namespace model = firebase::firestore::model; +namespace nanopb = firebase::firestore::nanopb; + +NS_ASSUME_NONNULL_BEGIN + +/** + * An internal representation of FIRDocumentReference, representing a key in a specific database. + * This is necessary because keys assume a database from context (usually the current one). + * FSTDocumentKeyReference binds a key to a specific databaseID. + * + * TODO(b/64160088): Make DocumentKey aware of the specific databaseID it is tied to. + */ +@interface FSTDocumentKeyReference : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithKey:(model::DocumentKey)key + databaseID:(model::DatabaseId)databaseID NS_DESIGNATED_INITIALIZER; + +- (const model::DocumentKey &)key; + +@property(nonatomic, assign, readonly) const model::DatabaseId &databaseID; + +@end + +/** + * An interface that allows arbitrary pre-converting of user data. + * + * Returns the converted value (can return back the input to act as a no-op). + */ +typedef id _Nullable (^FSTPreConverterBlock)(id _Nullable); + +/** + * Helper for parsing raw user input (provided via the API) into internal model classes. + */ +@interface FSTUserDataReader : NSObject + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithDatabaseID:(model::DatabaseId)databaseID + preConverter:(FSTPreConverterBlock)preConverter NS_DESIGNATED_INITIALIZER; + +/** Parse document data from a non-merge setData call.*/ +- (core::ParsedSetData)parsedSetData:(id)input; + +/** Parse document data from a setData call with `merge:YES`. */ +- (core::ParsedSetData)parsedMergeData:(id)input fieldMask:(nullable NSArray *)fieldMask; + +/** Parse update data from an updateData call. */ +- (core::ParsedUpdateData)parsedUpdateData:(id)input; + +/** Parse a "query value" (e.g. value in a where filter or a value in a cursor bound). */ +- (nanopb::Message)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). + */ +- (nanopb::Message)parsedQueryValue:(id)input + allowArrays: + (bool)allowArrays; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.mm new file mode 100644 index 0000000..af4baf6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataReader.mm @@ -0,0 +1,627 @@ +/* + * 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/API/FSTUserDataReader.h" + +#include +#include +#include +#include +#include + +#import "FIRGeoPoint.h" +#import "FIRTimestamp.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFieldValue+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRGeoPoint+Internal.h" +#import "Firestore/Source/API/converters.h" +#import "Firestore/core/include/firebase/firestore/geo_point.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/object_value.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/remote/serializer.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/read_context.h" +#include "Firestore/core/src/util/string_apple.h" + +#include "absl/memory/memory.h" +#include "absl/strings/match.h" +#include "absl/types/optional.h" + +namespace nanopb = firebase::firestore::nanopb; +using firebase::Timestamp; +using firebase::TimestampInternal; +using firebase::firestore::GeoPoint; +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; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::FieldMask; +using firebase::firestore::model::FieldPath; +using firebase::firestore::model::FieldTransform; +using firebase::firestore::model::NullValue; +using firebase::firestore::model::NumericIncrementTransform; +using firebase::firestore::model::ObjectValue; +using firebase::firestore::model::ResourcePath; +using firebase::firestore::model::ServerTimestampTransform; +using firebase::firestore::model::TransformOperation; +using firebase::firestore::nanopb::CheckedSize; +using firebase::firestore::nanopb::Message; +using firebase::firestore::remote::Serializer; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; +using firebase::firestore::util::ReadContext; +using firebase::firestore::google_firestore_v1_Value; +using firebase::firestore::google_firestore_v1_MapValue; +using firebase::firestore::google_firestore_v1_ArrayValue; +using firebase::firestore::google_protobuf_NullValue_NULL_VALUE; +using firebase::firestore::google_firestore_v1_MapValue_FieldsEntry; +using firebase::firestore::google_type_LatLng; +using firebase::firestore::google_protobuf_Timestamp; +using nanopb::StringReader; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - FSTDocumentKeyReference + +@implementation FSTDocumentKeyReference { + DocumentKey _key; + DatabaseId _databaseID; +} + +- (instancetype)initWithKey:(DocumentKey)key databaseID:(DatabaseId)databaseID { + self = [super init]; + if (self) { + _key = std::move(key); + _databaseID = std::move(databaseID); + } + return self; +} + +- (const model::DocumentKey &)key { + return _key; +} + +- (const model::DatabaseId &)databaseID { + return _databaseID; +} + +@end + +#pragma mark - FSTUserDataReader + +@interface FSTUserDataReader () +@property(strong, nonatomic, readonly) FSTPreConverterBlock preConverter; +@end + +@implementation FSTUserDataReader { + DatabaseId _databaseID; +} + +- (instancetype)initWithDatabaseID:(DatabaseId)databaseID + preConverter:(FSTPreConverterBlock)preConverter { + self = [super init]; + if (self) { + _databaseID = std::move(databaseID); + _preConverter = preConverter; + } + return self; +} + +- (ParsedSetData)parsedSetData:(id)input { + // NOTE: The public API is typed as NSDictionary but we type 'input' as 'id' since we can't trust + // Obj-C to verify the type for us. + if (![input isKindOfClass:[NSDictionary class]]) { + ThrowInvalidArgument("Data to be written must be an NSDictionary."); + } + + ParseAccumulator accumulator{UserDataSource::Set}; + auto updateData = [self parseData:input context:accumulator.RootContext()]; + HARD_ASSERT(updateData.has_value(), "Parsed data should not be nil."); + + return std::move(accumulator).SetData(ObjectValue{std::move(*updateData)}); +} + +- (ParsedSetData)parsedMergeData:(id)input fieldMask:(nullable NSArray *)fieldMask { + // NOTE: The public API is typed as NSDictionary but we type 'input' as 'id' since we can't trust + // Obj-C to verify the type for us. + if (![input isKindOfClass:[NSDictionary class]]) { + ThrowInvalidArgument("Data to be written must be an NSDictionary."); + } + + ParseAccumulator accumulator{UserDataSource::MergeSet}; + + auto updateData = [self parseData:input context:accumulator.RootContext()]; + HARD_ASSERT(updateData.has_value(), "Parsed data should not be nil."); + + ObjectValue updateObject{std::move(*updateData)}; + + if (fieldMask) { + std::set validatedFieldPaths; + for (id fieldPath in fieldMask) { + FieldPath path; + + if ([fieldPath isKindOfClass:[NSString class]]) { + path = FieldPath::FromDotSeparatedString(MakeString(fieldPath)); + } else if ([fieldPath isKindOfClass:[FIRFieldPath class]]) { + path = static_cast(fieldPath).internalValue; + } else { + ThrowInvalidArgument("All elements in mergeFields: must be NSStrings or FIRFieldPaths."); + } + + // Verify that all elements specified in the field mask are part of the parsed context. + if (!accumulator.Contains(path)) { + ThrowInvalidArgument( + "Field '%s' is specified in your field mask but missing from your input data.", + path.CanonicalString()); + } + + validatedFieldPaths.insert(path); + } + + return std::move(accumulator) + .MergeData(std::move(updateObject), FieldMask{std::move(validatedFieldPaths)}); + + } else { + return std::move(accumulator).MergeData(std::move(updateObject)); + } +} + +- (ParsedUpdateData)parsedUpdateData:(id)input { + // NOTE: The public API is typed as NSDictionary but we type 'input' as 'id' since we can't trust + // Obj-C to verify the type for us. + if (![input isKindOfClass:[NSDictionary class]]) { + ThrowInvalidArgument("Data to be written must be an NSDictionary."); + } + + NSDictionary *dict = input; + + ParseAccumulator accumulator{UserDataSource::Update}; + __block ParseContext context = accumulator.RootContext(); + __block ObjectValue updateData; + + [dict enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *) { + FieldPath path; + + if ([key isKindOfClass:[NSString class]]) { + path = FieldPath::FromDotSeparatedString(MakeString(key)); + } else if ([key isKindOfClass:[FIRFieldPath class]]) { + path = ((FIRFieldPath *)key).internalValue; + } else { + ThrowInvalidArgument("Dictionary keys in updateData: must be NSStrings or FIRFieldPaths."); + } + + value = self.preConverter(value); + if ([value isKindOfClass:[FSTDeleteFieldValue class]]) { + // Add it to the field mask, but don't add anything to updateData. + context.AddToFieldMask(std::move(path)); + } else { + auto parsedValue = [self parseData:value context:context.ChildContext(path)]; + if (parsedValue) { + context.AddToFieldMask(path); + updateData.Set(path, std::move(*parsedValue)); + } + } + }]; + + return std::move(accumulator).UpdateData(std::move(updateData)); +} + +- (Message)parsedQueryValue:(id)input { + return [self parsedQueryValue:input allowArrays:false]; +} + +- (Message)parsedQueryValue:(id)input allowArrays:(bool)allowArrays { + ParseAccumulator accumulator{allowArrays ? UserDataSource::ArrayArgument + : UserDataSource::Argument}; + + auto parsed = [self parseData:input context:accumulator.RootContext()]; + HARD_ASSERT(parsed, "Parsed data should not be nil."); + HARD_ASSERT(accumulator.field_transforms().empty(), + "Field transforms should have been disallowed."); + return std::move(*parsed); +} + +/** + * Internal helper for parsing user data. + * + * @param input Data to be parsed. + * @param context A context object representing the current path being parsed, the source of the + * data being parsed, etc. + * + * @return The parsed value, or nil if the value was a FieldValue sentinel that should not be + * included in the resulting parsed data. + */ +- (absl::optional>)parseData:(id)input + context:(ParseContext &&)context { + input = self.preConverter(input); + if ([input isKindOfClass:[NSDictionary class]]) { + return [self parseDictionary:(NSDictionary *)input context:std::move(context)]; + + } else if ([input isKindOfClass:[FIRFieldValue class]]) { + // FieldValues usually parse into transforms (except FieldValue.delete()) in which case we + // do not want to include this field in our parsed data (as doing so will overwrite the field + // directly prior to the transform trying to transform it). So we don't call appendToFieldMask + // and we return nil as our parsing result. + [self parseSentinelFieldValue:(FIRFieldValue *)input context:std::move(context)]; + return absl::nullopt; + + } else { + // If context path is unset we are already inside an array and we don't support field mask paths + // more granular than the top-level array. + if (context.path()) { + context.AddToFieldMask(*context.path()); + } + + if ([input isKindOfClass:[NSArray class]]) { + // TODO(b/34871131): Include the path containing the array in the error message. + // 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)]; + } else { + return [self parseScalarValue:input context:std::move(context)]; + } + } +} + +- (Message)parseDictionary:(NSDictionary *)dict + context:(ParseContext &&)context { + __block Message result; + result->which_value_type = google_firestore_v1_Value_map_value_tag; + result->map_value = {}; + + if (dict.count == 0) { + const FieldPath *path = context.path(); + if (path && !path->empty()) { + context.AddToFieldMask(*path); + } + } else { + // Compute the final size of the fields array, which contains an entry for + // all fields that are not FieldValue sentinels + __block pb_size_t count = 0; + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *, id value, BOOL *) { + if (![value isKindOfClass:[FIRFieldValue class]]) { + ++count; + } + }]; + + result->map_value.fields_count = count; + result->map_value.fields = nanopb::MakeArray(count); + + __block pb_size_t index = 0; + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *) { + auto parsedValue = [self parseData:value context:context.ChildContext(MakeString(key))]; + if (parsedValue) { + result->map_value.fields[index].key = nanopb::MakeBytesArray(MakeString(key)); + result->map_value.fields[index].value = *parsedValue->release(); + ++index; + } + }]; + } + + return std::move(result); +} + +- (Message)parseArray:(NSArray *)array + context:(ParseContext &&)context { + __block Message result; + result->which_value_type = google_firestore_v1_Value_array_value_tag; + result->array_value.values_count = CheckedSize([array count]); + result->array_value.values = + nanopb::MakeArray(result->array_value.values_count); + + [array enumerateObjectsUsingBlock:^(id entry, NSUInteger idx, BOOL *) { + auto parsedEntry = [self parseData:entry context:context.ChildContext(idx)]; + if (!parsedEntry) { + // Just include nulls in the array for fields being replaced with a sentinel. + parsedEntry = NullValue(); + } + result->array_value.values[idx] = *parsedEntry->release(); + }]; + + return std::move(result); +} + +/** + * "Parses" the provided FIRFieldValue, adding any necessary transforms to + * context.fieldTransforms. + */ +- (void)parseSentinelFieldValue:(FIRFieldValue *)fieldValue context:(ParseContext &&)context { + // Sentinels are only supported with writes, and not within arrays. + if (!context.write()) { + ThrowInvalidArgument("%s can only be used with updateData() and setData()%s", + fieldValue.methodName, context.FieldDescription()); + } + if (!context.path()) { + ThrowInvalidArgument("%s is not currently supported inside arrays", fieldValue.methodName); + } + + if ([fieldValue isKindOfClass:[FSTDeleteFieldValue class]]) { + if (context.data_source() == UserDataSource::MergeSet) { + // No transform to add for a delete, but we need to add it to our fieldMask so it gets + // deleted. + context.AddToFieldMask(*context.path()); + + } else if (context.data_source() == UserDataSource::Update) { + HARD_ASSERT(!context.path()->empty(), + "FieldValue.delete() at the top level should have already been handled."); + ThrowInvalidArgument("FieldValue.delete() can only appear at the top level of your " + "update data%s", + context.FieldDescription()); + } else { + // We shouldn't encounter delete sentinels for queries or non-merge setData calls. + ThrowInvalidArgument( + "FieldValue.delete() can only be used with updateData() and setData() with merge:true%s", + context.FieldDescription()); + } + + } else if ([fieldValue isKindOfClass:[FSTServerTimestampFieldValue class]]) { + context.AddToFieldTransforms(*context.path(), ServerTimestampTransform()); + + } else if ([fieldValue isKindOfClass:[FSTArrayUnionFieldValue class]]) { + auto parsedElements = + [self parseArrayTransformElements:((FSTArrayUnionFieldValue *)fieldValue).elements]; + ArrayTransform arrayUnion(TransformOperation::Type::ArrayUnion, std::move(parsedElements)); + context.AddToFieldTransforms(*context.path(), std::move(arrayUnion)); + + } else if ([fieldValue isKindOfClass:[FSTArrayRemoveFieldValue class]]) { + auto parsedElements = + [self parseArrayTransformElements:((FSTArrayRemoveFieldValue *)fieldValue).elements]; + ArrayTransform arrayRemove(TransformOperation::Type::ArrayRemove, std::move(parsedElements)); + context.AddToFieldTransforms(*context.path(), std::move(arrayRemove)); + + } else if ([fieldValue isKindOfClass:[FSTNumericIncrementFieldValue class]]) { + auto *numericIncrementFieldValue = (FSTNumericIncrementFieldValue *)fieldValue; + auto operand = [self parsedQueryValue:numericIncrementFieldValue.operand]; + NumericIncrementTransform numeric_increment(std::move(operand)); + + context.AddToFieldTransforms(*context.path(), std::move(numeric_increment)); + + } else { + HARD_FAIL("Unknown FIRFieldValue type: %s", NSStringFromClass([fieldValue class])); + } +} + +/** + * Helper to parse a scalar value (i.e. not an NSDictionary, NSArray, or FIRFieldValue). + * + * Note that it handles all NSNumber values that are encodable as int64_t or doubles + * (depending on the underlying type of the NSNumber). Unsigned integer values are handled though + * any value outside what is representable by int64_t (a signed 64-bit value) will throw an + * exception. + * + * @return The parsed value. + */ +- (Message)parseScalarValue:(nullable id)input + context:(ParseContext &&)context { + if (!input || [input isMemberOfClass:[NSNull class]]) { + return NullValue(); + + } else if ([input isKindOfClass:[NSNumber class]]) { + // Recover the underlying type of the number, using the method described here: + // http://stackoverflow.com/questions/2518761/get-type-of-nsnumber + const char *cType = [input objCType]; + + // Type Encoding values taken from + // https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/ + // Articles/ocrtTypeEncodings.html + switch (cType[0]) { + case 'q': + return [self encodeInteger:[input longLongValue]]; + + case 'i': // Falls through. + case 's': // Falls through. + case 'l': // Falls through. + case 'I': // Falls through. + case 'S': + // Coerce integer values that aren't long long. Allow unsigned integer types that are + // guaranteed small enough to skip a length check. + return [self encodeInteger:[input longLongValue]]; + + case 'L': // Falls through. + case 'Q': + // Unsigned integers that could be too large. Note that the 'L' (long) case is handled here + // because when compiled for LP64, unsigned long is 64 bits and could overflow int64_t. + { + unsigned long long extended = [input unsignedLongLongValue]; + + if (extended > LLONG_MAX) { + ThrowInvalidArgument("NSNumber (%s) is too large%s", [input unsignedLongLongValue], + context.FieldDescription()); + + } else { + return [self encodeInteger:static_cast(extended)]; + } + } + + case 'f': + return [self encodeDouble:[input doubleValue]]; + + case 'd': + // Double values are already the right type, so just reuse the existing boxed double. + // + // Note that NSNumber already performs NaN normalization to a single shared instance + // so there's no need to treat NaN specially here. + return [self encodeDouble:[input doubleValue]]; + + case 'B': // Falls through. + case 'c': // Falls through. + case 'C': + // Boolean values are weird. + // + // On arm64, objCType of a BOOL-valued NSNumber will be "c", even though @encode(BOOL) + // returns "B". "c" is the same as @encode(signed char). Unfortunately this means that + // legitimate usage of signed chars is impossible, but this should be rare. + // + // Additionally, for consistency, map unsigned chars to bools in the same way. + return [self encodeBoolean:[input boolValue]]; + + default: + // All documented codes should be handled above, so this shouldn't happen. + HARD_FAIL("Unknown NSNumber objCType %s on %s", cType, input); + } + + } else if ([input isKindOfClass:[NSString class]]) { + std::string inputString = MakeString(input); + return [self encodeStringValue:inputString]; + + } else if ([input isKindOfClass:[NSDate class]]) { + NSDate *inputDate = input; + return [self encodeTimestampValue:api::MakeTimestamp(inputDate)]; + + } else if ([input isKindOfClass:[FIRTimestamp class]]) { + FIRTimestamp *inputTimestamp = input; + Timestamp timestamp = TimestampInternal::Truncate(api::MakeTimestamp(inputTimestamp)); + return [self encodeTimestampValue:timestamp]; + + } else if ([input isKindOfClass:[FIRGeoPoint class]]) { + return [self encodeGeoPoint:api::MakeGeoPoint(input)]; + } else if ([input isKindOfClass:[NSData class]]) { + NSData *inputData = input; + return [self encodeBlob:(nanopb::MakeByteString(inputData))]; + + } else if ([input isKindOfClass:[FSTDocumentKeyReference class]]) { + FSTDocumentKeyReference *reference = input; + if (reference.databaseID != _databaseID) { + const DatabaseId &other = reference.databaseID; + ThrowInvalidArgument( + "Document Reference is for database %s/%s but should be for database %s/%s%s", + other.project_id(), other.database_id(), _databaseID.project_id(), + _databaseID.database_id(), context.FieldDescription()); + } + return [self encodeReference:_databaseID key:reference.key]; + + } else { + ThrowInvalidArgument("Unsupported type: %s%s", NSStringFromClass([input class]), + context.FieldDescription()); + } +} + +- (Message)encodeBoolean:(bool)value { + Message result; + result->which_value_type = google_firestore_v1_Value_boolean_value_tag; + result->boolean_value = value; + return result; +} + +- (Message)encodeInteger:(int64_t)value { + Message result; + result->which_value_type = google_firestore_v1_Value_integer_value_tag; + result->integer_value = value; + return result; +} + +- (Message)encodeDouble:(double)value { + Message result; + result->which_value_type = google_firestore_v1_Value_double_value_tag; + result->double_value = value; + return result; +} + +- (Message)encodeTimestampValue:(Timestamp)value { + Message result; + result->which_value_type = google_firestore_v1_Value_timestamp_value_tag; + result->timestamp_value.seconds = value.seconds(); + result->timestamp_value.nanos = value.nanoseconds(); + return result; +} + +- (Message)encodeStringValue:(const std::string &)value { + Message result; + result->which_value_type = google_firestore_v1_Value_string_value_tag; + result->string_value = nanopb::MakeBytesArray(value); + return result; +} + +- (Message)encodeBlob:(const nanopb::ByteString &)value { + Message result; + result->which_value_type = google_firestore_v1_Value_bytes_value_tag; + // Copy the blob so that pb_release can do the right thing. + result->bytes_value = nanopb::CopyBytesArray(value.get()); + return result; +} + +- (Message)encodeReference:(const DatabaseId &)databaseId + key:(const DocumentKey &)key { + HARD_ASSERT(_databaseID == databaseId, "Database %s cannot encode reference from %s", + _databaseID.ToString(), databaseId.ToString()); + + std::string referenceName = ResourcePath({"projects", databaseId.project_id(), "databases", + databaseId.database_id(), "documents", key.ToString()}) + .CanonicalString(); + + Message result; + result->which_value_type = google_firestore_v1_Value_reference_value_tag; + result->reference_value = nanopb::MakeBytesArray(referenceName); + return result; +} + +- (Message)encodeGeoPoint:(const GeoPoint &)value { + Message result; + result->which_value_type = google_firestore_v1_Value_geo_point_value_tag; + result->geo_point_value.latitude = value.latitude(); + result->geo_point_value.longitude = value.longitude(); + return result; +} + +- (Message)parseArrayTransformElements:(NSArray *)elements { + ParseAccumulator accumulator{UserDataSource::Argument}; + + Message array_value; + array_value->values_count = CheckedSize(elements.count); + array_value->values = nanopb::MakeArray(array_value->values_count); + + for (NSUInteger i = 0; i < elements.count; i++) { + id element = elements[i]; + // Although array transforms are used with writes, the actual elements being unioned or removed + // are not considered writes since they cannot contain any FieldValue sentinels, etc. + ParseContext context = accumulator.RootContext(); + + auto parsedElement = [self parseData:element context:context.ChildContext(i)]; + HARD_ASSERT(parsedElement && accumulator.field_transforms().empty(), + "Failed to properly parse array transform element: %s", element); + array_value->values[i] = *parsedElement->release(); + } + return array_value; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.h new file mode 100644 index 0000000..2f0f3d6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.h @@ -0,0 +1,40 @@ +/* + * Copyright 2021 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 + +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#include "Firestore/core/src/api/api_fwd.h" + +namespace api = firebase::firestore::api; + +/** + * Converts Firestore's internal types to the API types that we expose to the + * user. + */ +@interface FSTUserDataWriter : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithFirestore:(std::shared_ptr)firestore + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior; + +- (id)convertedValue:(const firebase::firestore::google_firestore_v1_Value&)value; + +@end diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.mm new file mode 100644 index 0000000..c92cd3b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataWriter.mm @@ -0,0 +1,166 @@ +// Copyright 2021 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/Source/API/FSTUserDataWriter.h" + +#import +#import +#import + +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/Source/API/FIRDocumentReference+Internal.h" +#include "Firestore/Source/API/converters.h" +#include "Firestore/core/include/firebase/firestore/geo_point.h" +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/server_timestamp_util.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/string_apple.h" + +@class FIRTimestamp; + +namespace api = firebase::firestore::api; +namespace model = firebase::firestore::model; +namespace nanopb = firebase::firestore::nanopb; + +using api::MakeFIRDocumentReference; +using api::MakeFIRGeoPoint; +using api::MakeFIRTimestamp; +using firebase::firestore::GeoPoint; +using firebase::firestore::google_firestore_v1_ArrayValue; +using firebase::firestore::google_firestore_v1_MapValue; +using firebase::firestore::google_firestore_v1_Value; +using firebase::firestore::google_protobuf_Timestamp; +using firebase::firestore::util::MakeNSString; +using model::DatabaseId; +using model::DocumentKey; +using model::GetLocalWriteTime; +using model::GetPreviousValue; +using model::GetTypeOrder; +using model::TypeOrder; +using nanopb::MakeByteString; +using nanopb::MakeBytesArray; +using nanopb::MakeNSData; +using nanopb::MakeString; +using nanopb::MakeStringView; + +NS_ASSUME_NONNULL_BEGIN + +@implementation FSTUserDataWriter { + std::shared_ptr _firestore; + FIRServerTimestampBehavior _serverTimestampBehavior; +} + +- (instancetype)initWithFirestore:(std::shared_ptr)firestore + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { + self = [super init]; + if (self) { + _firestore = std::move(firestore); + _serverTimestampBehavior = serverTimestampBehavior; + } + return self; +} + +- (id)convertedValue:(const google_firestore_v1_Value &)value { + switch (GetTypeOrder(value)) { + case TypeOrder::kMap: + return [self convertedObject:value.map_value]; + case TypeOrder::kArray: + return [self convertedArray:value.array_value]; + case TypeOrder::kReference: + return [self convertedReference:value]; + case TypeOrder::kTimestamp: + return [self convertedTimestamp:value.timestamp_value]; + case TypeOrder::kServerTimestamp: + return [self convertedServerTimestamp:value]; + case TypeOrder::kNull: + return [NSNull null]; + case TypeOrder::kBoolean: + return value.boolean_value ? @YES : @NO; + case TypeOrder::kNumber: + return value.which_value_type == google_firestore_v1_Value_integer_value_tag + ? @(value.integer_value) + : @(value.double_value); + case TypeOrder::kString: + return MakeNSString(MakeStringView(value.string_value)); + case TypeOrder::kBlob: + return MakeNSData(value.bytes_value); + case TypeOrder::kGeoPoint: + return MakeFIRGeoPoint( + GeoPoint(value.geo_point_value.latitude, value.geo_point_value.longitude)); + } + + UNREACHABLE(); +} + +- (NSDictionary *)convertedObject:(const google_firestore_v1_MapValue &)mapValue { + NSMutableDictionary *result = [NSMutableDictionary dictionary]; + for (pb_size_t i = 0; i < mapValue.fields_count; ++i) { + absl::string_view key = MakeStringView(mapValue.fields[i].key); + const google_firestore_v1_Value &value = mapValue.fields[i].value; + result[MakeNSString(key)] = [self convertedValue:value]; + } + return result; +} + +- (NSArray *)convertedArray:(const google_firestore_v1_ArrayValue &)arrayValue { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:arrayValue.values_count]; + for (pb_size_t i = 0; i < arrayValue.values_count; ++i) { + [result addObject:[self convertedValue:arrayValue.values[i]]]; + } + return result; +} + +- (id)convertedServerTimestamp:(const google_firestore_v1_Value &)serverTimestampValue { + switch (_serverTimestampBehavior) { + case FIRServerTimestampBehavior::FIRServerTimestampBehaviorNone: + return [NSNull null]; + case FIRServerTimestampBehavior::FIRServerTimestampBehaviorEstimate: + return [self convertedTimestamp:GetLocalWriteTime(serverTimestampValue)]; + case FIRServerTimestampBehavior::FIRServerTimestampBehaviorPrevious: { + auto previous_value = GetPreviousValue(serverTimestampValue); + return previous_value ? [self convertedValue:*previous_value] : [NSNull null]; + } + } + + UNREACHABLE(); +} + +- (FIRTimestamp *)convertedTimestamp:(const google_protobuf_Timestamp &)value { + return MakeFIRTimestamp(firebase::Timestamp{value.seconds, value.nanos}); +} + +- (FIRDocumentReference *)convertedReference:(const google_firestore_v1_Value &)value { + std::string ref = MakeString(value.reference_value); + DatabaseId databaseID = DatabaseId::FromName(ref); + DocumentKey key = DocumentKey::FromName(ref); + if (databaseID != _firestore->database_id()) { + LOG_WARN("Document reference is for a different database (%s/%s) which " + "is not supported. It will be treated as a reference within the current database " + "(%s/%s) instead.", + databaseID.project_id(), databaseID.database_id(), databaseID.project_id(), + databaseID.database_id()); + } + return MakeFIRDocumentReference(key, _firestore); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.h new file mode 100644 index 0000000..f5d0e45 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.h @@ -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. + */ + +#ifndef FIRESTORE_SOURCE_API_CONVERTERS_H_ +#define FIRESTORE_SOURCE_API_CONVERTERS_H_ + +#if !defined(__OBJC__) +#error "This header only supports Objective-C++" +#endif // !defined(__OBJC__) + +#import + +#include + +@class FIRGeoPoint; +@class FIRTimestamp; +@class FIRDocumentReference; + +NS_ASSUME_NONNULL_BEGIN + +namespace firebase { + +class Timestamp; + +namespace firestore { + +class GeoPoint; + +namespace model { +class DocumentKey; +} + +namespace api { + +class Firestore; + +/** Converts a user-supplied FIRGeoPoint to the equivalent C++ GeoPoint. */ +GeoPoint MakeGeoPoint(FIRGeoPoint* geo_point); + +/** Converts a C++ GeoPoint to the equivalent Objective-C FIRGeoPoint. */ +FIRGeoPoint* MakeFIRGeoPoint(const GeoPoint& geo_point); + +/** Converts a user-supplied FIRTimestamp to the equivalent C++ Timestamp. */ +Timestamp MakeTimestamp(FIRTimestamp* timestamp); +Timestamp MakeTimestamp(NSDate* date); + +FIRTimestamp* MakeFIRTimestamp(const Timestamp& timestamp); + +FIRDocumentReference* MakeFIRDocumentReference(const model::DocumentKey& document_key, + std::shared_ptr firestore); + +} // namespace api +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END + +#endif // FIRESTORE_SOURCE_API_CONVERTERS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.mm new file mode 100644 index 0000000..251d3e5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/API/converters.mm @@ -0,0 +1,68 @@ +/* + * 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/Source/API/converters.h" + +#include + +#import "FIRGeoPoint.h" +#import "FIRTimestamp.h" + +#include "Firestore/Source/API/FIRDocumentReference+Internal.h" +#include "Firestore/core/include/firebase/firestore/geo_point.h" +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/model/document_key.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace firebase { +namespace firestore { +namespace api { + +GeoPoint MakeGeoPoint(FIRGeoPoint* geo_point) { + return GeoPoint(geo_point.latitude, geo_point.longitude); +} + +FIRGeoPoint* MakeFIRGeoPoint(const GeoPoint& geo_point) { + return [[FIRGeoPoint alloc] initWithLatitude:geo_point.latitude() + longitude:geo_point.longitude()]; +} + +Timestamp MakeTimestamp(FIRTimestamp* timestamp) { + return Timestamp(timestamp.seconds, timestamp.nanoseconds); +} + +Timestamp MakeTimestamp(NSDate* date) { + FIRTimestamp* timestamp = [FIRTimestamp timestampWithDate:date]; + return MakeTimestamp(timestamp); +} + +FIRTimestamp* MakeFIRTimestamp(const Timestamp& timestamp) { + return [[FIRTimestamp alloc] initWithSeconds:timestamp.seconds() + nanoseconds:timestamp.nanoseconds()]; +} + +FIRDocumentReference* MakeFIRDocumentReference(const model::DocumentKey& key, + std::shared_ptr firestore) { + return [[FIRDocumentReference alloc] initWithKey:key firestore:std::move(firestore)]; +} + +} // namespace api +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h new file mode 100644 index 0000000..6623f51 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h @@ -0,0 +1,100 @@ +/* + * 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 "FIRQuery.h" + +NS_ASSUME_NONNULL_BEGIN + +@class FIRDocumentReference; + +/** + * A `FIRCollectionReference` object can be used for adding documents, getting document references, + * and querying for documents (using the methods inherited from `FIRQuery`). + */ +NS_SWIFT_NAME(CollectionReference) +@interface FIRCollectionReference : FIRQuery + +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRCollectionReference cannot be created directly."))); + +/** ID of the referenced collection. */ +@property(nonatomic, strong, readonly) NSString *collectionID; + +/** + * For subcollections, `parent` returns the containing `FIRDocumentReference`. For root + * collections, nil is returned. + */ +@property(nonatomic, strong, nullable, readonly) FIRDocumentReference *parent; + +/** + * A string containing the slash-separated path to this this `FIRCollectionReference` (relative to + * the root of the database). + */ +@property(nonatomic, strong, readonly) NSString *path; + +/** + * Returns a FIRDocumentReference pointing to a new document with an auto-generated ID. + * + * @return A FIRDocumentReference pointing to a new document with an auto-generated ID. + */ +- (FIRDocumentReference *)documentWithAutoID NS_SWIFT_NAME(document()); + +/** + * Gets a `FIRDocumentReference` referring to the document at the specified path, relative to this + * collection's own path. + * + * @param documentPath The slash-separated relative path of the document for which to get a + * `FIRDocumentReference`. + * + * @return The `FIRDocumentReference` for the specified document path. + */ +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); + +/** + * Adds a new document to this collection with the specified data, assigning it a document ID + * automatically. + * + * @param data An `NSDictionary` containing the data for the new document. + * + * @return A `FIRDocumentReference` pointing to the newly created document. + */ +- (FIRDocumentReference *)addDocumentWithData:(NSDictionary *)data + NS_SWIFT_NAME(addDocument(data:)); + +/** + * Adds a new document to this collection with the specified data, assigning it a document ID + * automatically. + * + * @param data An `NSDictionary` containing the data for the new document. + * @param completion A block to execute once the document has been successfully written to + * the server. This block will not be called while the client is offline, though local + * changes will be visible immediately. + * + * @return A `FIRDocumentReference` pointing to the newly created document. + */ +// clang-format off +// clang-format breaks the NS_SWIFT_NAME attribute +- (FIRDocumentReference *)addDocumentWithData:(NSDictionary *)data + completion: + (nullable void (^)(NSError *_Nullable error))completion + NS_SWIFT_NAME(addDocument(data:completion:)); +// clang-format on + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h new file mode 100644 index 0000000..1acff35 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h @@ -0,0 +1,74 @@ +/* + * 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 + +@class FIRQueryDocumentSnapshot; + +#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 +{ + /** Indicates a new document was added to the set of documents matching the query. */ + FIRDocumentChangeTypeAdded, + /** Indicates a document within the query was modified. */ + FIRDocumentChangeTypeModified, + /** + * Indicates a document within the query was removed (either deleted or no longer matches + * the query. + */ + FIRDocumentChangeTypeRemoved +} NS_SWIFT_NAME(DocumentChangeType); + +/** + * A `FIRDocumentChange` represents a change to the documents matching a query. It contains the + * document affected and the type of change that occurred (added, modified, or removed). + */ +NS_SWIFT_NAME(DocumentChange) +@interface FIRDocumentChange : NSObject + +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRDocumentChange cannot be created directly."))); + +/** The type of change that occurred (added, modified, or removed). */ +@property(nonatomic, readonly) FIRDocumentChangeType type; + +/** The document affected by this change. */ +@property(nonatomic, strong, readonly) FIRQueryDocumentSnapshot *document; + +/** + * The index of the changed document in the result set immediately prior to this FIRDocumentChange + * (i.e. supposing that all prior FIRDocumentChange objects have been applied). NSNotFound for + * FIRDocumentChangeTypeAdded events. + */ +@property(nonatomic, readonly) NSUInteger oldIndex; + +/** + * The index of the changed document in the result set immediately after this FIRDocumentChange + * (i.e. supposing that all prior FIRDocumentChange objects and the current FIRDocumentChange object + * have been applied). NSNotFound for FIRDocumentChangeTypeRemoved events. + */ +@property(nonatomic, readonly) NSUInteger newIndex; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h new file mode 100644 index 0000000..6afba82 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h @@ -0,0 +1,264 @@ +/* + * 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 FIRCollectionReference; +@class FIRDocumentSnapshot; +@class FIRFirestore; + +NS_ASSUME_NONNULL_BEGIN + +/** + * A block type used to handle snapshot updates. + */ +typedef void (^FIRDocumentSnapshotBlock)(FIRDocumentSnapshot *_Nullable snapshot, + NSError *_Nullable error); + +/** + * A `FIRDocumentReference` refers to a document location in a Firestore database and can be + * used to write, read, or listen to the location. The document at the referenced location + * may or may not exist. A `FIRDocumentReference` can also be used to create a + * `FIRCollectionReference` to a subcollection. + */ +NS_SWIFT_NAME(DocumentReference) +@interface FIRDocumentReference : NSObject + +/** :nodoc: */ +- (instancetype)init + __attribute__((unavailable("FIRDocumentReference cannot be created directly."))); + +/** The ID of the document referred to. */ +@property(nonatomic, strong, readonly) NSString *documentID; + +/** A reference to the collection to which this `DocumentReference` belongs. */ +@property(nonatomic, strong, readonly) FIRCollectionReference *parent; + +/** The `FIRFirestore` for the Firestore database (useful for performing transactions, etc.). */ +@property(nonatomic, strong, readonly) FIRFirestore *firestore; + +/** + * A string representing the path of the referenced document (relative to the root of the + * database). + */ +@property(nonatomic, strong, readonly) NSString *path; + +/** + * Gets a `FIRCollectionReference` referring to the collection at the specified + * path, relative to this document. + * + * @param collectionPath The slash-separated relative path of the collection for which to get a + * `FIRCollectionReference`. + * + * @return The `FIRCollectionReference` at the specified _collectionPath_. + */ +- (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath + NS_SWIFT_NAME(collection(_:)); + +#pragma mark - Writing Data + +/** + * Writes to the document referred to by `FIRDocumentReference`. If the document doesn't yet exist, + * this method creates it and then sets the data. If the document exists, this method overwrites + * the document data with the new values. + * + * @param documentData An `NSDictionary` that contains the fields and data to write to the + * document. + */ +- (void)setData:(NSDictionary *)documentData; + +/** + * Writes to the document referred to by this DocumentReference. If the document does not yet + * exist, it will be created. If you pass `merge:YES`, the provided data will be merged into + * any existing document. + * + * @param documentData An `NSDictionary` that contains the fields and data to write to the + * document. + * @param merge Whether to merge the provided data into any existing document. + */ +- (void)setData:(NSDictionary *)documentData merge:(BOOL)merge; + +/** + * Writes to the document referred to by `document` and only replace the fields + * specified under `mergeFields`. Any field that is not specified in `mergeFields` + * is ignored and remains untouched. If the document doesn't yet exist, + * this method creates it and then sets the data. + * + * It is an error to include a field in `mergeFields` that does not have a corresponding + * value in the `data` dictionary. + * + * @param documentData An `NSDictionary` containing the fields that make up the document + * to be written. + * @param mergeFields An `NSArray` that contains a list of `NSString` or `FIRFieldPath` elements + * specifying which fields to merge. Fields can contain dots to reference nested fields within + * the document. + */ +- (void)setData:(NSDictionary *)documentData mergeFields:(NSArray *)mergeFields; + +/** + * Overwrites the document referred to by this `FIRDocumentReference`. If no document exists, it + * is created. If a document already exists, it is overwritten. + * + * @param documentData An `NSDictionary` containing the fields that make up the document + * to be written. + * @param completion A block to execute once the document has been successfully written to the + * server. This block will not be called while the client is offline, though local + * changes will be visible immediately. + */ +- (void)setData:(NSDictionary *)documentData + completion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Writes to the document referred to by this DocumentReference. If the document does not yet + * exist, it will be created. If you pass `merge:YES`, the provided data will be merged into + * any existing document. + * + * @param documentData An `NSDictionary` containing the fields that make up the document + * to be written. + * @param merge Whether to merge the provided data into any existing document. + * @param completion A block to execute once the document has been successfully written to the + * server. This block will not be called while the client is offline, though local + * changes will be visible immediately. + */ +- (void)setData:(NSDictionary *)documentData + merge:(BOOL)merge + completion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Writes to the document referred to by `document` and only replace the fields + * specified under `mergeFields`. Any field that is not specified in `mergeFields` + * is ignored and remains untouched. If the document doesn't yet exist, + * this method creates it and then sets the data. + * + * It is an error to include a field in `mergeFields` that does not have a corresponding + * value in the `data` dictionary. + * + * @param documentData An `NSDictionary` containing the fields that make up the document + * to be written. + * @param mergeFields An `NSArray` that contains a list of `NSString` or `FIRFieldPath` elements + * specifying which fields to merge. Fields can contain dots to reference nested fields within + * the document. + * @param completion A block to execute once the document has been successfully written to the + * server. This block will not be called while the client is offline, though local + * changes will be visible immediately. + */ +- (void)setData:(NSDictionary *)documentData + mergeFields:(NSArray *)mergeFields + completion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Updates fields in the document referred to by this `FIRDocumentReference`. + * If the document does not exist, the update fails (specify a completion block to be notified). + * + * @param fields An `NSDictionary` containing the fields (expressed as an `NSString` or + * `FIRFieldPath`) and values with which to update the document. + */ +- (void)updateData:(NSDictionary *)fields; + +/** + * Updates fields in the document referred to by this `FIRDocumentReference`. If the document + * does not exist, the update fails and the specified completion block receives an error. + * + * @param fields An `NSDictionary` containing the fields (expressed as an `NSString` or + * `FIRFieldPath`) and values with which to update the document. + * @param completion A block to execute when the update is complete. If the update is successful the + * error parameter will be nil, otherwise it will give an indication of how the update failed. + * This block will only execute when the client is online and the commit has completed against + * the server. The completion handler will not be called when the device is offline, though + * local changes will be visible immediately. + */ +- (void)updateData:(NSDictionary *)fields + completion:(nullable void (^)(NSError *_Nullable error))completion; + +// NOTE: this is named 'deleteDocument' because 'delete' is a keyword in Objective-C++. +/** Deletes the document referred to by this `FIRDocumentReference`. */ +// clang-format off +- (void)deleteDocument NS_SWIFT_NAME(delete()); +// clang-format on + +/** + * Deletes the document referred to by this `FIRDocumentReference`. + * + * @param completion A block to execute once the document has been successfully written to the + * server. This block will not be called while the client is offline, though local + * changes will be visible immediately. + */ +// clang-format off +- (void)deleteDocumentWithCompletion:(nullable void (^)(NSError *_Nullable error))completion + NS_SWIFT_NAME(delete(completion:)); +// clang-format on + +#pragma mark - Retrieving Data + +/** + * Reads the document referenced by this `FIRDocumentReference`. + * + * 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 + * `getDocument(source:completion:)` method to change this behavior. + * + * @param completion a block to execute once the document has been successfully read. + */ +- (void)getDocumentWithCompletion:(FIRDocumentSnapshotBlock)completion + NS_SWIFT_NAME(getDocument(completion:)); + +/** + * Reads the document referenced by this `FIRDocumentReference`. + * + * @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 document has been successfully read. + */ +// clang-format off +- (void)getDocumentWithSource:(FIRFirestoreSource)source + completion:(FIRDocumentSnapshotBlock)completion + NS_SWIFT_NAME(getDocument(source:completion:)); +// clang-format on + +/** + * Attaches a listener for DocumentSnapshot events. + * + * @param listener The listener to attach. + * + * @return A FIRListenerRegistration that can be used to remove this listener. + */ +- (id)addSnapshotListener:(FIRDocumentSnapshotBlock)listener + NS_SWIFT_NAME(addSnapshotListener(_:)); + +/** + * Attaches a listener for DocumentSnapshot 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:(FIRDocumentSnapshotBlock)listener + NS_SWIFT_NAME(addSnapshotListener(includeMetadataChanges:listener:)); +// clang-format on + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h new file mode 100644 index 0000000..5d9fd31 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h @@ -0,0 +1,180 @@ +/* + * 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 + +@class FIRDocumentReference; +@class FIRSnapshotMetadata; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Controls the return value for server timestamps that have not yet been set to + * their final value. + */ +typedef NS_ENUM(NSInteger, FIRServerTimestampBehavior) { + /** + * Return `NSNull` for `FieldValue.serverTimestamp()` fields that have not yet + * been set to their final value. + */ + FIRServerTimestampBehaviorNone, + + /** + * Return a local estimates for `FieldValue.serverTimestamp()` + * fields that have not yet been set to their final value. This estimate will + * likely differ from the final value and may cause these pending values to + * change once the server result becomes available. + */ + FIRServerTimestampBehaviorEstimate, + + /** + * Return the previous value for `FieldValue.serverTimestamp()` fields that + * have not yet been set to their final value. + */ + FIRServerTimestampBehaviorPrevious +} NS_SWIFT_NAME(ServerTimestampBehavior); + +/** + * A `FIRDocumentSnapshot` contains data read from a document in your Firestore database. The data + * can be extracted with the `data` property or by using subscript syntax to access a specific + * field. + * + * For a `FIRDocumentSnapshot` that points to a non-existing document, any data access will return + * `nil`. You can use the `exists` property to explicitly verify a documents existence. + */ +NS_SWIFT_NAME(DocumentSnapshot) +@interface FIRDocumentSnapshot : NSObject + +/** :nodoc: */ +- (instancetype)init + __attribute__((unavailable("FIRDocumentSnapshot cannot be created directly."))); + +/** True if the document exists. */ +@property(nonatomic, assign, readonly) BOOL exists; + +/** A `FIRDocumentReference` to the document location. */ +@property(nonatomic, strong, readonly) FIRDocumentReference *reference; + +/** The ID of the document for which this `FIRDocumentSnapshot` contains data. */ +@property(nonatomic, copy, readonly) NSString *documentID; + +/** Metadata about this snapshot concerning its source and if it has local modifications. */ +@property(nonatomic, strong, readonly) FIRSnapshotMetadata *metadata; + +/** + * Retrieves all fields in the document as an `NSDictionary`. Returns `nil` if the document doesn't + * exist. + * + * Server-provided timestamps that have not yet been set to their final value will be returned as + * `NSNull`. You can use `dataWithServerTimestampBehavior()` to configure this behavior. + * + * @return An `NSDictionary` containing all fields in the document or `nil` if the document doesn't + * exist. + */ +- (nullable NSDictionary *)data; + +/** + * Retrieves all fields in the document as a `Dictionary`. Returns `nil` if the document doesn't + * exist. + * + * @param serverTimestampBehavior Configures how server timestamps that have not yet been set to + * their final value are returned from the snapshot. + * @return A `Dictionary` containing all fields in the document or `nil` if the document doesn't + * exist. + */ +- (nullable NSDictionary *)dataWithServerTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior; + +/** + * Retrieves a specific field from the document. Returns `nil` if the document or the field doesn't + * exist. + * + * The timestamps that have not yet been set to their final value will be returned as `NSNull`. The + * can use `get(_:serverTimestampBehavior:)` to configure this behavior. + * + * @param field The field to retrieve. + * @return The value contained in the field or `nil` if the document or field doesn't exist. + */ +- (nullable id)valueForField:(id)field NS_SWIFT_NAME(get(_:)); + +/** + * Retrieves a specific field from the document. Returns `nil` if the document or the field doesn't + * exist. + * + * The timestamps that have not yet been set to their final value will be returned as `NSNull`. The + * can use `get(_:serverTimestampBehavior:)` to configure this behavior. + * + * @param field The field to retrieve. + * @param serverTimestampBehavior Configures how server timestamps that have not yet been set to + * their final value are returned from the snapshot. + * @return The value contained in the field or `nil` if the document or field doesn't exist. + */ +// clang-format off +- (nullable id)valueForField:(id)field + serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior + NS_SWIFT_NAME(get(_:serverTimestampBehavior:)); +// clang-format on + +/** + * Retrieves a specific field from the document. + * + * @param key The field to retrieve. + * + * @return The value contained in the field or `nil` if the document or field doesn't exist. + */ +- (nullable id)objectForKeyedSubscript:(id)key; + +@end + +/** + * A `FIRQueryDocumentSnapshot` contains data read from a document in your Firestore database as + * part of a query. The document is guaranteed to exist and its data can be extracted with the + * `data` property or by using subscript syntax to access a specific field. + * + * A `FIRQueryDocumentSnapshot` offers the same API surface as a `FIRDocumentSnapshot`. As + * deleted documents are not returned from queries, its `exists` property will always be true and + * `data:` will never return `nil`. + */ +NS_SWIFT_NAME(QueryDocumentSnapshot) +@interface FIRQueryDocumentSnapshot : FIRDocumentSnapshot + +/** :nodoc: */ +- (instancetype)init + __attribute__((unavailable("FIRQueryDocumentSnapshot cannot be created directly."))); + +/** + * Retrieves all fields in the document as an `NSDictionary`. + * + * Server-provided timestamps that have not yet been set to their final value will be returned as + * `NSNull`. You can use `dataWithServerTimestampBehavior()` to configure this behavior. + * + * @return An `NSDictionary` containing all fields in the document. + */ +- (NSDictionary *)data; + +/** + * Retrieves all fields in the document as a `Dictionary`. + * + * @param serverTimestampBehavior Configures how server timestamps that have not yet been set to + * their final value are returned from the snapshot. + * @return A `Dictionary` containing all fields in the document. + */ +- (NSDictionary *)dataWithServerTimestampBehavior: + (FIRServerTimestampBehavior)serverTimestampBehavior; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h new file mode 100644 index 0000000..9f64fbd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h @@ -0,0 +1,49 @@ +/* + * 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 `FieldPath` refers to a field in a document. The path may consist of a single field name + * (referring to a top level field in the document), or a list of field names (referring to a nested + * field in the document). + */ +NS_SWIFT_NAME(FieldPath) +@interface FIRFieldPath : NSObject + +/** :nodoc: */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Creates a `FieldPath` from the provided field names. If more than one field name is provided, the + * path will point to a nested field in a document. + * + * @param fieldNames A list of field names. + * @return A `FieldPath` that points to a field location in a document. + */ +- (instancetype)initWithFields:(NSArray *)fieldNames NS_SWIFT_NAME(init(_:)); + +/** + * A special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to + * sort or filter by the document ID. + */ ++ (instancetype)documentID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h new file mode 100644 index 0000000..24d1007 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h @@ -0,0 +1,95 @@ +/* + * 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 + +/** + * Sentinel values that can be used when writing document fields with setData() or updateData(). + */ +NS_SWIFT_NAME(FieldValue) +@interface FIRFieldValue : NSObject + +/** :nodoc: */ +- (instancetype)init NS_UNAVAILABLE; + +/** Used with updateData() to mark a field for deletion. */ +// clang-format off ++ (instancetype)fieldValueForDelete NS_SWIFT_NAME(delete()); +// clang-format on + +/** + * Used with setData() or updateData() to include a server-generated timestamp in the written + * data. + */ ++ (instancetype)fieldValueForServerTimestamp NS_SWIFT_NAME(serverTimestamp()); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * union the given elements with any array value that already exists on the server. Each + * specified element that doesn't already exist in the array will be added to the end. If the + * field being modified is not already an array it will be overwritten with an array containing + * exactly the specified elements. + * + * @param elements The elements to union into the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayUnion:(NSArray *)elements NS_SWIFT_NAME(arrayUnion(_:)); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * remove the given elements from any array value that already exists on the server. All + * instances of each element specified will be removed from the array. If the field being + * modified is not already an array it will be overwritten with an empty array. + * + * @param elements The elements to remove from the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayRemove:(NSArray *)elements NS_SWIFT_NAME(arrayRemove(_:)); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * increment the field's current value by the given value. + * + * If the current value is an integer or a double, both the current and the given value will be + * interpreted as doubles and all arithmetic will follow IEEE 754 semantics. Otherwise, the + * transformation will set the field to the given value. + * + * @param d The double value to increment by. + * @return The FieldValue sentinel for use in a call to setData() or update(). + */ ++ (instancetype)fieldValueForDoubleIncrement:(double)d NS_SWIFT_NAME(increment(_:)); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * increment the field's current value by the given value. + * + * If the current field value is an integer, possible integer overflows are resolved to LONG_MAX or + * LONG_MIN. If the current field value is a double, both values will be interpreted as doubles and + * the arithmetic will follow IEEE 754 semantics. + * + * If 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. + * + * @param l The integer value to increment by. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForIntegerIncrement:(int64_t)l NS_SWIFT_NAME(increment(_:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h new file mode 100644 index 0000000..8ec30aa --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h @@ -0,0 +1,330 @@ +/* + * 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 "FIRListenerRegistration.h" + +@class FIRApp; +@class FIRCollectionReference; +@class FIRDocumentReference; +@class FIRFirestoreSettings; +@class FIRLoadBundleTask; +@class FIRLoadBundleTaskProgress; +@class FIRQuery; +@class FIRTransaction; +@class FIRWriteBatch; + +NS_ASSUME_NONNULL_BEGIN + +/** + * `FIRFirestore` represents a Firestore Database and is the entry point for all Firestore + * operations. + */ +NS_SWIFT_NAME(Firestore) +@interface FIRFirestore : NSObject + +#pragma mark - Initializing +/** :nodoc: */ +- (instancetype)init __attribute__((unavailable("Use a static constructor method."))); + +/** + * Creates, caches, and returns a `FIRFirestore` using the default `FIRApp`. Each subsequent + * invocation returns the same `FIRFirestore` object. + * + * @return The `FIRFirestore` instance. + */ ++ (instancetype)firestore NS_SWIFT_NAME(firestore()); + +/** + * Creates, caches, and returns a `FIRFirestore` object for the specified _app_. Each subsequent + * invocation returns the same `FIRFirestore` object. + * + * @param app The `FIRApp` instance to use for authentication and as a source of the Google Cloud + * Project ID for your Firestore Database. If you want the default instance, you should explicitly + * set it to `[FIRApp defaultApp]`. + * + * @return The `FIRFirestore` instance. + */ ++ (instancetype)firestoreForApp:(FIRApp *)app NS_SWIFT_NAME(firestore(app:)); + +/** + * Custom settings used to configure this `FIRFirestore` object. + */ +@property(nonatomic, copy) FIRFirestoreSettings *settings; + +/** + * The Firebase App associated with this Firestore instance. + */ +@property(strong, nonatomic, readonly) FIRApp *app; + +#pragma mark - Collections and Documents + +/** + * Gets a `FIRCollectionReference` referring to the collection at the specified path within the + * database. + * + * @param collectionPath The slash-separated path of the collection for which to get a + * `FIRCollectionReference`. + * + * @return The `FIRCollectionReference` at the specified _collectionPath_. + */ +- (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath + NS_SWIFT_NAME(collection(_:)); + +/** + * Gets a `FIRDocumentReference` referring to the document at the specified path within the + * database. + * + * @param documentPath The slash-separated path of the document for which to get a + * `FIRDocumentReference`. + * + * @return The `FIRDocumentReference` for the specified _documentPath_. + */ +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); + +#pragma mark - Collection Group Queries + +/** + * Creates and returns a new `Query` that includes all documents in the database that are contained + * in a collection or subcollection with the given collectionID. + * + * @param collectionID Identifies the collections to query over. Every collection or subcollection + * with this ID as the last segment of its path will be included. Cannot contain a slash. + * @return The created `Query`. + */ +- (FIRQuery *)collectionGroupWithID:(NSString *)collectionID NS_SWIFT_NAME(collectionGroup(_:)); + +#pragma mark - Transactions and Write Batches + +/** + * Executes the given updateBlock and then attempts to commit the changes applied within an atomic + * transaction. + * + * The maximum number of writes allowed in a single transaction is 500, but note that each usage of + * `FieldValue.serverTimestamp()`, `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a transaction counts as an additional write. + * + * In the updateBlock, a set of reads and writes can be performed atomically using the + * `FIRTransaction` object passed to the block. After the updateBlock is run, Firestore will attempt + * to apply the changes to the server. If any of the data read has been modified outside of this + * transaction since being read, then the transaction will be retried by executing the updateBlock + * again. If the transaction still fails after 5 retries, then the transaction will fail. + * + * Since the updateBlock may be executed multiple times, it should avoiding doing anything that + * would cause side effects. + * + * Any value maybe be returned from the updateBlock. If the transaction is successfully committed, + * then the completion block will be passed that value. The updateBlock also has an `NSError` out + * parameter. If this is set, then the transaction will not attempt to commit, and the given error + * will be passed to the completion block. + * + * The `FIRTransaction` object passed to the updateBlock contains methods for accessing documents + * and collections. Unlike other firestore access, data accessed with the transaction will not + * reflect local changes that have not been committed. For this reason, it is required that all + * reads are performed before any writes. Transactions must be performed while online. Otherwise, + * reads will fail, the final commit will fail, and the completion block will return an error. + * + * @param updateBlock The block to execute within the transaction context. + * @param completion The block to call with the result or error of the transaction. This + * block will run even if the client is offline, unless the process is killed. + */ +- (void)runTransactionWithBlock:(id _Nullable (^)(FIRTransaction *, NSError **))updateBlock + completion:(void (^)(id _Nullable result, NSError *_Nullable error))completion; + +/** + * Creates a write batch, used for performing multiple writes as a single + * atomic operation. + * + * The maximum number of writes allowed in a single batch is 500, but note that each usage of + * `FieldValue.serverTimestamp()`, `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or + * `FieldValue.increment()` inside a batch counts as an additional write. + + * Unlike transactions, write batches are persisted offline and therefore are preferable when you + * don't need to condition your writes on read data. + */ +- (FIRWriteBatch *)batch; + +#pragma mark - Logging + +/** Enables or disables logging from the Firestore client. */ ++ (void)enableLogging:(BOOL)logging; + +#pragma mark - Network + +/** + * Configures Firestore to connect to an emulated host instead of the default remote backend. After + * Firestore has been used (i.e. a document reference has been instantiated), this value cannot be + * changed. + */ +- (void)useEmulatorWithHost:(NSString *)host port:(NSInteger)port; + +/** + * Re-enables usage of the network by this Firestore instance after a prior call to + * `disableNetworkWithCompletion`. Completion block, if provided, will be called once network uasge + * has been enabled. + */ +- (void)enableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Disables usage of the network by this Firestore instance. It can be re-enabled by via + * `enableNetworkWithCompletion`. While the network is disabled, any snapshot listeners or get calls + * will return results from cache and any write operations will be queued until the network is + * restored. The completion block, if provided, will be called once network usage has been disabled. + */ +- (void)disableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Clears the persistent storage. This includes pending writes and cached documents. + * + * Must be called while the firestore instance is not started (after the app is shutdown or when + * the app is first initialized). On startup, this method must be called before other methods + * (other than `FIRFirestore.settings`). If the firestore instance is still running, the function + * will complete with an error code of `FailedPrecondition`. + * + * Note: `clearPersistence(completion:)` is primarily intended to help write reliable tests that + * use Firestore. It uses the most efficient mechanism possible for dropping existing data but + * does not attempt to securely overwrite or otherwise make cached data unrecoverable. For + * applications that are sensitive to the disclosure of cache data in between user sessions we + * strongly recommend not to enable persistence in the first place. + */ +- (void)clearPersistenceWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Waits until all currently pending writes for the active user have been acknowledged by the + * backend. + * + * The completion block is called immediately without error if there are no outstanding writes. + * Otherwise, the completion block is called when all previously issued writes (including those + * written in a previous app session) have been acknowledged by the backend. The completion + * block does not wait for writes that were added after the method is called. If you + * wish to wait for additional writes, you have to call `waitForPendingWritesWithCompletion` + * again. + * + * Any outstanding `waitForPendingWritesWithCompletion` completion blocks are called with an + * error during user change. + */ +- (void)waitForPendingWritesWithCompletion:(void (^)(NSError *_Nullable error))completion; + +/** + * 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. + * + * @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(_:)); + +#pragma mark - Terminating + +/** + * Terminates this `FIRFirestore` instance. + * + * 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. + * + * 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. + * + * 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. + */ +- (void)terminateWithCompletion:(nullable void (^)(NSError *_Nullable error))completion + NS_SWIFT_NAME(terminate(completion:)); + +#pragma mark - Bundles + +/** + * Loads a Firestore bundle into the local cache. + * + * @param bundleData Data from the bundle to be loaded. + * @return A `FIRLoadBundleTask` (`LoadBundleTask` in Swift) which allows registered observers + * to receive progress updates and completion or error events. + */ +- (FIRLoadBundleTask *)loadBundle:(NSData *)bundleData NS_SWIFT_NAME(loadBundle(_:)); + +/** + * Loads a Firestore bundle into the local cache. + * + * @param bundleData Data from the bundle to be loaded. + * @param completion A block to execute when loading is in a final state. The `error` parameter + * will be set if the block is invoked due to an error. If observers are registered to the + * `FIRLoadBundleTask`, this block will be called after all observers are notified. + * @return A `FIRLoadBundleTask` (`LoadBundleTask` in Swift) which allows registered observers + * to receive progress updates and completion or error events. + */ +- (FIRLoadBundleTask *)loadBundle:(NSData *)bundleData + completion:(nullable void (^)(FIRLoadBundleTaskProgress *_Nullable progress, + NSError *_Nullable error))completion + NS_SWIFT_NAME(loadBundle(_:completion:)); + +/** + * Loads a Firestore bundle into the local cache. + * + * @param bundleStream An input stream from which the bundle can be read. + * @return A `FIRLoadBundleTask` (`LoadBundleTask` in Swift) which allows registered observers + * to receive progress updates and completion or error events. + */ +- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream + NS_SWIFT_NAME(loadBundle(_:)); + +/** + * Loads a Firestore bundle into the local cache. + * + * @param bundleStream An input stream from which the bundle can be read. + * @param completion A block to execute when the loading is in a final state. The `error` parameter + * of the block will be set if it is due to an error. If observers are registered to the returning + * `FIRLoadBundleTask`, this block will be called after all observers are notified. + * @return A `FIRLoadBundleTask` (`LoadBundleTask` in Swift), which allow registering observers + * to receive progress updates, and completion or error events. + */ +- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream + completion: + (nullable void (^)(FIRLoadBundleTaskProgress *_Nullable progress, + NSError *_Nullable error))completion + NS_SWIFT_NAME(loadBundle(_:completion:)); + +/** + * Reads a `FIRQuery` (`Query` in Swift) from the local cache, identified by the given name. + * + * Named queries are packaged into bundles on the server side (along with the resulting documents) + * and loaded into local cache using `loadBundle`. Once in the local cache, you can use this method + * to extract a query by name. + * + * @param completion A block to execute with the query read from the local cache. If no query can be + * found, its parameter will be `nil`. + */ +- (void)getQueryNamed:(NSString *)name + completion:(void (^)(FIRQuery *_Nullable query))completion + NS_SWIFT_NAME(getQuery(named:completion:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.h new file mode 100644 index 0000000..968391c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.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. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** The Cloud Firestore error domain. */ +FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain NS_SWIFT_NAME(FirestoreErrorDomain); + +/** Error codes used by Cloud Firestore. */ +typedef NS_ENUM(NSInteger, FIRFirestoreErrorCode) { + /** + * The operation completed successfully. NSError objects will never have a code with this value. + */ + FIRFirestoreErrorCodeOK = 0, + + /** The operation was cancelled (typically by the caller). */ + FIRFirestoreErrorCodeCancelled = 1, + + /** Unknown error or an error from a different error domain. */ + FIRFirestoreErrorCodeUnknown = 2, + + /** + * Client specified an invalid argument. Note that this differs from FailedPrecondition. + * InvalidArgument indicates arguments that are problematic regardless of the state of the + * system (e.g., an invalid field name). + */ + FIRFirestoreErrorCodeInvalidArgument = 3, + + /** + * Deadline expired before operation could complete. For operations that change the state of the + * system, this error may be returned even if the operation has completed successfully. For + * example, a successful response from a server could have been delayed long enough for the + * deadline to expire. + */ + FIRFirestoreErrorCodeDeadlineExceeded = 4, + + /** Some requested document was not found. */ + FIRFirestoreErrorCodeNotFound = 5, + + /** Some document that we attempted to create already exists. */ + FIRFirestoreErrorCodeAlreadyExists = 6, + + /** The caller does not have permission to execute the specified operation. */ + FIRFirestoreErrorCodePermissionDenied = 7, + + /** + * Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system + * is out of space. + */ + FIRFirestoreErrorCodeResourceExhausted = 8, + + /** + * Operation was rejected because the system is not in a state required for the operation's + * execution. + */ + FIRFirestoreErrorCodeFailedPrecondition = 9, + + /** + * The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. + */ + FIRFirestoreErrorCodeAborted = 10, + + /** Operation was attempted past the valid range. */ + FIRFirestoreErrorCodeOutOfRange = 11, + + /** Operation is not implemented or not supported/enabled. */ + FIRFirestoreErrorCodeUnimplemented = 12, + + /** + * Internal errors. Means some invariants expected by underlying system has been broken. If you + * see one of these errors, something is very broken. + */ + FIRFirestoreErrorCodeInternal = 13, + + /** + * The service is currently unavailable. This is a most likely a transient condition and may be + * corrected by retrying with a backoff. + */ + FIRFirestoreErrorCodeUnavailable = 14, + + /** Unrecoverable data loss or corruption. */ + FIRFirestoreErrorCodeDataLoss = 15, + + /** The request does not have valid authentication credentials for the operation. */ + FIRFirestoreErrorCodeUnauthenticated = 16 +} NS_SWIFT_NAME(FirestoreErrorCode); + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h new file mode 100644 index 0000000..6d96921 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h @@ -0,0 +1,62 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +/** Used to set on-disk cache size to unlimited. Garbage collection will not run. */ +FOUNDATION_EXTERN const int64_t + kFIRFirestoreCacheSizeUnlimited NS_SWIFT_NAME(FirestoreCacheSizeUnlimited); + +/** Settings used to configure a `FIRFirestore` instance. */ +NS_SWIFT_NAME(FirestoreSettings) +@interface FIRFirestoreSettings : NSObject + +/** + * Creates and returns an empty `FIRFirestoreSettings` object. + * + * @return The created `FIRFirestoreSettings` object. + */ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** The hostname to connect to. */ +@property(nonatomic, copy) NSString *host; + +/** Whether to use SSL when connecting. */ +@property(nonatomic, getter=isSSLEnabled) BOOL sslEnabled; + +/** + * A dispatch queue to be used to execute all completion handlers and event handlers. By default, + * the main queue is used. + */ +@property(nonatomic, strong) dispatch_queue_t dispatchQueue; + +/** Set to false to disable local persistent storage. */ +@property(nonatomic, getter=isPersistenceEnabled) BOOL persistenceEnabled; + +/** + * Sets the cache size threshold above which the SDK will attempt to collect least-recently-used + * documents. The size is not a guarantee that the cache will stay below that size, only that if + * the cache exceeds the given size, cleanup will be attempted. Cannot be set lower than 1MB. + * + * Set to kFIRFirestoreCacheSizeUnlimited to disable garbage collection entirely. + */ +@property(nonatomic, assign) int64_t cacheSizeBytes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h new file mode 100644 index 0000000..16a65cc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h @@ -0,0 +1,53 @@ +/* + * 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 + +/** + * An enum that configures the behavior of `DocumentReference.getDocument()` and + * `Query.getDocuments()`. By providing a source enum the `getDocument[s]` + * methods can be configured to fetch results only from the server, only from + * the local cache, or attempt to fetch results from the server and fall back to + * the cache (which is the default). + */ +typedef NS_ENUM(NSUInteger, FIRFirestoreSource) { + + /** + * Causes Firestore to try to retrieve an up-to-date (server-retrieved) + * snapshot, but fall back to returning cached data if the server can't be + * reached. + */ + FIRFirestoreSourceDefault, + + /** + * Causes Firestore to avoid the cache, generating an error if the server + * cannot be reached. Note that the cache will still be updated if the + * server request succeeds. Also note that latency-compensation still takes + * effect, so any pending write operations will be visible in the returned + * data (merged into the server-provided data). + */ + FIRFirestoreSourceServer, + + /** + * Causes Firestore to immediately return a value from the cache, ignoring + * the server completely (implying that the returned value may be stale with + * respect to the value on the server). If there is no data in the cache to + * satisfy the `getDocument[s]` call, `DocumentReference.getDocument()` will + * return an error and `QuerySnapshot.getDocuments()` will return an empty + * `QuerySnapshot` with no documents. + */ + FIRFirestoreSourceCache +} NS_SWIFT_NAME(FirestoreSource); diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h new file mode 100644 index 0000000..4454225 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h @@ -0,0 +1,54 @@ +/* + * 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 + +/** + * An immutable object representing a geographical point in Firestore. The point is represented as + * a latitude/longitude pair. + * + * Latitude values are in the range of [-90, 90]. + * Longitude values are in the range of [-180, 180]. + */ +NS_SWIFT_NAME(GeoPoint) +@interface FIRGeoPoint : NSObject + +/** :nodoc: */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Creates a `GeoPoint` from the provided latitude and longitude degrees. + * @param latitude The latitude as number between -90 and 90. + * @param longitude The longitude as number between -180 and 180. + */ +- (instancetype)initWithLatitude:(double)latitude + longitude:(double)longitude NS_DESIGNATED_INITIALIZER; + +/** + * The point's latitude. Must be a value between -90 and 90 (inclusive). + */ +@property(nonatomic, readonly) double latitude; + +/** + * The point's longitude. Must be a value between -180 and 180 (inclusive). + */ +@property(nonatomic, readonly) double longitude; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h new file mode 100644 index 0000000..c3a16cd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h @@ -0,0 +1,33 @@ +/* + * 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 + +/** Represents a listener that can be removed by calling remove. */ +NS_SWIFT_NAME(ListenerRegistration) +@protocol FIRListenerRegistration + +/** + * Removes the listener being tracked by this FIRListenerRegistration. After the initial call, + * subsequent calls have no effect. + */ +- (void)remove; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRLoadBundleTask.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRLoadBundleTask.h new file mode 100644 index 0000000..b2fee2e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRLoadBundleTask.h @@ -0,0 +1,92 @@ +/* + * Copyright 2021 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 + +NS_ASSUME_NONNULL_BEGIN + +/** + * Represents the state of bundle loading tasks. + * + * Both `FIRLoadBundleTaskStateError` and `FIRLoadBundleTaskStateSuccess` are final states: task + * will be in either aborted or completed state and there will be no more updates after they are + * reported. + */ +typedef NS_ENUM(NSInteger, FIRLoadBundleTaskState) { + + FIRLoadBundleTaskStateError, + + FIRLoadBundleTaskStateInProgress, + + FIRLoadBundleTaskStateSuccess, + +} NS_SWIFT_NAME(LoadBundleTaskState); + +/** Represents a progress update or a final state from loading bundles. */ +NS_SWIFT_NAME(LoadBundleTaskProgress) +@interface FIRLoadBundleTaskProgress : NSObject + +/** How many documents have been loaded. */ +@property(readonly, nonatomic) NSInteger documentsLoaded; + +/** The total number of documents in the bundle. 0 if the bundle failed to parse. */ +@property(readonly, nonatomic) NSInteger totalDocuments; + +/** How many bytes have been loaded. */ +@property(readonly, nonatomic) NSInteger bytesLoaded; + +/** The total number of bytes in the bundle. 0 if the bundle failed to parse. */ +@property(readonly, nonatomic) NSInteger totalBytes; + +/** The current state of `FIRLoadBundleTask` (`LoadBundleTask` in Swift). */ +@property(readonly, nonatomic) FIRLoadBundleTaskState state; + +@end + +/** A handle associated with registered observers that can be used to remove them. */ +typedef NSInteger FIRLoadBundleObserverHandle NS_SWIFT_NAME(LoadBundleObserverHandle); + +/** + * Represents the task of loading a Firestore bundle. Observers can be registered with this task to + * observe the bundle loading progress, as well as task completion and error events. + */ +NS_SWIFT_NAME(LoadBundleTask) +@interface FIRLoadBundleTask : NSObject + +/** + * Registers an observer to observe the progress updates, completion or error events. + * + * @return A handle to the registered observer which can be used to remove the observer once it is + * no longer needed. + */ +- (FIRLoadBundleObserverHandle)addObserver:(void (^)(FIRLoadBundleTaskProgress *progress))observer + NS_SWIFT_NAME(addObserver(_:)); + +/** + * Removes a registered observer associated with the given handle. If no observer can be found, this + * will be a no-op. + */ +- (void)removeObserverWithHandle:(FIRLoadBundleObserverHandle)handle + NS_SWIFT_NAME(removeObserverWith(handle:)); + +/** + * Removes all registered observers for this task. + */ +- (void)removeAllObservers NS_SWIFT_NAME(removeAllObservers()); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h new file mode 100644 index 0000000..5144df2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h @@ -0,0 +1,545 @@ +/* + * 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/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h new file mode 100644 index 0000000..268598f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h @@ -0,0 +1,73 @@ +/* + * 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 + +@class FIRDocumentChange; +@class FIRQuery; +@class FIRQueryDocumentSnapshot; +@class FIRSnapshotMetadata; + +/** + * A `FIRQuerySnapshot` contains zero or more `FIRDocumentSnapshot` objects. It can be enumerated + * using "for ... in documentSet.documents" and its size can be inspected with `isEmpty` and + * `count`. + */ +NS_SWIFT_NAME(QuerySnapshot) +@interface FIRQuerySnapshot : NSObject + +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRQuerySnapshot cannot be created directly."))); + +/** + * The query on which you called `getDocuments` or listened to in order to get this + * `FIRQuerySnapshot`. + */ +@property(nonatomic, strong, readonly) FIRQuery *query; + +/** Metadata about this snapshot, concerning its source and if it has local modifications. */ +@property(nonatomic, strong, readonly) FIRSnapshotMetadata *metadata; + +/** Indicates whether this `FIRQuerySnapshot` is empty (contains no documents). */ +@property(nonatomic, readonly, getter=isEmpty) BOOL empty; + +/** The count of documents in this `FIRQuerySnapshot`. */ +@property(nonatomic, readonly) NSInteger count; + +/** An Array of the `FIRDocumentSnapshots` that make up this document set. */ +@property(nonatomic, strong, readonly) NSArray *documents; + +/** + * An array of the documents that changed since the last snapshot. If this is the first snapshot, + * all documents will be in the list as Added changes. + */ +@property(nonatomic, strong, readonly) NSArray *documentChanges; + +/** + * Returns an array of the documents that changed since the last snapshot. If this is the first + * snapshot, all documents will be in the list as Added changes. + * + * @param includeMetadataChanges Whether metadata-only changes (i.e. only + * `FIRDocumentSnapshot.metadata` changed) should be included. + */ +- (NSArray *)documentChangesWithIncludeMetadataChanges: + (BOOL)includeMetadataChanges NS_SWIFT_NAME(documentChanges(includeMetadataChanges:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h new file mode 100644 index 0000000..043d819 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h @@ -0,0 +1,46 @@ +/* + * 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 + +/** Metadata about a snapshot, describing the state of the snapshot. */ +NS_SWIFT_NAME(SnapshotMetadata) +@interface FIRSnapshotMetadata : NSObject + +/** :nodoc: */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Returns YES if the snapshot contains the result of local writes (e.g. set() or update() calls) + * that have not yet been committed to the backend. If your listener has opted into metadata updates + * (via `includeMetadataChanges:YES`) you will receive another snapshot with `hasPendingWrites` + * equal to NO once the writes have been committed to the backend. + */ +@property(nonatomic, assign, readonly, getter=hasPendingWrites) BOOL pendingWrites; + +/** + * Returns YES if the snapshot was created from cached data rather than guaranteed up-to-date server + * data. If your listener has opted into metadata updates (via `includeMetadataChanges:YES`) you + * will receive another snapshot with `isFromCache` equal to NO once the client has received + * up-to-date data from the backend. + */ +@property(nonatomic, assign, readonly, getter=isFromCache) BOOL fromCache; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h new file mode 100644 index 0000000..967d47c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h @@ -0,0 +1,89 @@ +/* + * 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 Timestamp represents a point in time independent of any time zone or calendar, represented as + * seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using + * the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It + * is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no + * leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * + * @see https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto for the + * reference timestamp definition. + */ +NS_SWIFT_NAME(Timestamp) +@interface FIRTimestamp : NSObject + +/** :nodoc: */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Creates a new timestamp. + * + * @param seconds the number of seconds since epoch. + * @param nanoseconds the number of nanoseconds after the seconds. + */ +- (instancetype)initWithSeconds:(int64_t)seconds + nanoseconds:(int32_t)nanoseconds NS_DESIGNATED_INITIALIZER; + +/** + * Creates a new timestamp. + * + * @param seconds the number of seconds since epoch. + * @param nanoseconds the number of nanoseconds after the seconds. + */ ++ (instancetype)timestampWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds; + +/** Creates a new timestamp from the given date. */ ++ (instancetype)timestampWithDate:(NSDate *)date; + +/** Creates a new timestamp with the current date / time. */ ++ (instancetype)timestamp; + +/** Returns a new NSDate corresponding to this timestamp. This may lose precision. */ +- (NSDate *)dateValue; + +/** + * Returns the result of comparing the receiver with another timestamp. + * @param other the other timestamp to compare. + * @return NSOrderedAscending if `other` is chronologically following self, + * NSOrderedDescending if `other` is chronologically preceding self, + * NSOrderedSame otherwise. + */ +- (NSComparisonResult)compare:(FIRTimestamp *)other; + +/** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + * Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. + */ +@property(nonatomic, assign, readonly) int64_t seconds; + +/** + * Non-negative fractions of a second at nanosecond resolution. Negative second values with + * fractions must still have non-negative nanos values that count forward in time. + * Must be from 0 to 999,999,999 inclusive. + */ +@property(nonatomic, assign, readonly) int32_t nanoseconds; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h new file mode 100644 index 0000000..ede0fb9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h @@ -0,0 +1,127 @@ +/* + * 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 + +@class FIRDocumentReference; +@class FIRDocumentSnapshot; + +/** + * `FIRTransaction` provides methods to read and write data within a transaction. + * + * @see FIRFirestore#transaction:completion: + */ +NS_SWIFT_NAME(Transaction) +@interface FIRTransaction : NSObject + +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRTransaction cannot be created directly."))); + +/** + * Writes to the document referred to by `document`. If the document doesn't yet exist, + * this method creates it and then sets the data. If the document exists, this method overwrites + * the document data with the new values. + * + * @param data An `NSDictionary` that contains the fields and data to write to the document. + * @param document A reference to the document whose data should be overwritten. + * @return This `FIRTransaction` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + NS_SWIFT_NAME(setData(_:forDocument:)); +// clang-format on + +/** + * Writes to the document referred to by `document`. If the document doesn't yet exist, + * this method creates it and then sets the data. If you pass `merge:YES`, the provided data will be + * merged into any existing document. + * + * @param data An `NSDictionary` that contains the fields and data to write to the document. + * @param document A reference to the document whose data should be overwritten. + * @param merge Whether to merge the provided data into any existing document. + * @return This `FIRTransaction` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + merge:(BOOL)merge + NS_SWIFT_NAME(setData(_:forDocument:merge:)); +// clang-format on + +/** + * Writes to the document referred to by `document` and only replace the fields + * specified under `mergeFields`. Any field that is not specified in `mergeFields` + * is ignored and remains untouched. If the document doesn't yet exist, + * this method creates it and then sets the data. + * + * It is an error to include a field in `mergeFields` that does not have a corresponding + * value in the `data` dictionary. + * + * @param data An `NSDictionary` containing the fields that make up the document + * to be written. + * @param document A reference to the document whose data should be overwritten. + * @param mergeFields An `NSArray` that contains a list of `NSString` or `FIRFieldPath` elements + * specifying which fields to merge. Fields can contain dots to reference nested fields within + * the document. + * @return This `FIRTransaction` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRTransaction *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + mergeFields:(NSArray *)mergeFields + NS_SWIFT_NAME(setData(_:forDocument:mergeFields:)); +// clang-format on + +/** + * Updates fields in the document referred to by `document`. + * If the document does not exist, the transaction will fail. + * + * @param fields An `NSDictionary` containing the fields (expressed as an `NSString` or + * `FIRFieldPath`) and values with which to update the document. + * @param document A reference to the document whose data should be updated. + * @return This `FIRTransaction` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRTransaction *)updateData:(NSDictionary *)fields + forDocument:(FIRDocumentReference *)document + NS_SWIFT_NAME(updateData(_:forDocument:)); +// clang-format on + +/** + * Deletes the document referred to by `document`. + * + * @param document A reference to the document that should be deleted. + * @return This `FIRTransaction` instance. Used for chaining method calls. + */ +- (FIRTransaction *)deleteDocument:(FIRDocumentReference *)document + NS_SWIFT_NAME(deleteDocument(_:)); + +/** + * Reads the document referenced by `document`. + * + * @param document A reference to the document to be read. + * @param error An out parameter to capture an error, if one occurred. + */ +- (FIRDocumentSnapshot *_Nullable)getDocument:(FIRDocumentReference *)document + error:(NSError *__autoreleasing *)error + NS_SWIFT_NAME(getDocument(_:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h new file mode 100644 index 0000000..22d1b16 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h @@ -0,0 +1,135 @@ +/* + * 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 + +@class FIRDocumentReference; + +/** + * A write batch is used to perform multiple writes as a single atomic unit. + * + * A WriteBatch object can be acquired by calling [FIRFirestore batch]. It provides methods for + * adding writes to the write batch. None of the writes will be committed (or visible locally) + * until [FIRWriteBatch commit] is called. + * + * Unlike transactions, write batches are persisted offline and therefore are preferable when you + * don't need to condition your writes on read data. + */ +NS_SWIFT_NAME(WriteBatch) +@interface FIRWriteBatch : NSObject + +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRWriteBatch cannot be created directly."))); + +/** + * Writes to the document referred to by `document`. If the document doesn't yet exist, + * this method creates it and then sets the data. If the document exists, this method overwrites + * the document data with the new values. + * + * @param data An `NSDictionary` that contains the fields and data to write to the document. + * @param document A reference to the document whose data should be overwritten. + * @return This `FIRWriteBatch` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document NS_SWIFT_NAME(setData(_:forDocument:)); +// clang-format on + +/** + * Writes to the document referred to by `document`. If the document doesn't yet exist, + * this method creates it and then sets the data. If you pass `merge:YES`, the provided data will be + * merged into any existing document. + * + * @param data An `NSDictionary` that contains the fields and data to write to the document. + * @param document A reference to the document whose data should be overwritten. + * @param merge Whether to merge the provided data into any existing document. + * @return This `FIRWriteBatch` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + merge:(BOOL)merge + NS_SWIFT_NAME(setData(_:forDocument:merge:)); +// clang-format on + +/** + * Writes to the document referred to by `document` and only replace the fields + * specified under `mergeFields`. Any field that is not specified in `mergeFields` + * is ignored and remains untouched. If the document doesn't yet exist, + * this method creates it and then sets the data. + * + * It is an error to include a field in `mergeFields` that does not have a corresponding + * value in the `data` dictionary. + * + * @param data An `NSDictionary` that contains the fields and data to write to the document. + * @param document A reference to the document whose data should be overwritten. + * @param mergeFields An `NSArray` that contains a list of `NSString` or `FIRFieldPath` elements + * specifying which fields to merge. Fields can contain dots to reference nested fields within + * the document. + * @return This `FIRWriteBatch` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRWriteBatch *)setData:(NSDictionary *)data + forDocument:(FIRDocumentReference *)document + mergeFields:(NSArray *)mergeFields + NS_SWIFT_NAME(setData(_:forDocument:mergeFields:)); +// clang-format on + +/** + * Updates fields in the document referred to by `document`. + * If document does not exist, the write batch will fail. + * + * @param fields An `NSDictionary` containing the fields (expressed as an `NSString` or + * `FIRFieldPath`) and values with which to update the document. + * @param document A reference to the document whose data should be updated. + * @return This `FIRWriteBatch` instance. Used for chaining method calls. + */ +// clang-format off +- (FIRWriteBatch *)updateData:(NSDictionary *)fields + forDocument:(FIRDocumentReference *)document + NS_SWIFT_NAME(updateData(_:forDocument:)); +// clang-format on + +/** + * Deletes the document referred to by `document`. + * + * @param document A reference to the document that should be deleted. + * @return This `FIRWriteBatch` instance. Used for chaining method calls. + */ +- (FIRWriteBatch *)deleteDocument:(FIRDocumentReference *)document + NS_SWIFT_NAME(deleteDocument(_:)); + +/** + * Commits all of the writes in this write batch as a single atomic unit. + */ +- (void)commit; + +/** + * Commits all of the writes in this write batch as a single atomic unit. + * + * @param completion A block to be called once all of the writes in the batch have been + * successfully written to the backend as an atomic unit. This block will only execute + * when the client is online and the commit has completed against the server. The + * completion handler will not be called when the device is offline, though local + * changes will be visible immediately. + */ +- (void)commitWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h new file mode 100644 index 0000000..02edf17 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h @@ -0,0 +1,34 @@ +/* + * 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 "FIRCollectionReference.h" +#import "FIRDocumentChange.h" +#import "FIRDocumentReference.h" +#import "FIRDocumentSnapshot.h" +#import "FIRFieldPath.h" +#import "FIRFieldValue.h" +#import "FIRFirestore.h" +#import "FIRFirestoreErrors.h" +#import "FIRFirestoreSettings.h" +#import "FIRGeoPoint.h" +#import "FIRListenerRegistration.h" +#import "FIRLoadBundleTask.h" +#import "FIRQuery.h" +#import "FIRQuerySnapshot.h" +#import "FIRSnapshotMetadata.h" +#import "FIRTimestamp.h" +#import "FIRTransaction.h" +#import "FIRWriteBatch.h" diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h new file mode 100644 index 0000000..6af214a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h @@ -0,0 +1,116 @@ +/* + * 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_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_ERRORS_H_ +#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_ERRORS_H_ + +namespace firebase { +namespace firestore { + +/** + * Error codes used by Cloud Firestore. + * + * The codes are in sync across Firestore SDKs on various platforms. + */ +enum Error { + /** The operation completed successfully. */ + // Note: NSError objects will never have a code with this value. + kErrorOk = 0, + + kErrorNone = 0, + + /** The operation was cancelled (typically by the caller). */ + kErrorCancelled = 1, + + /** Unknown error or an error from a different error domain. */ + kErrorUnknown = 2, + + /** + * Client specified an invalid argument. Note that this differs from + * FailedPrecondition. InvalidArgument indicates arguments that are + * problematic regardless of the state of the system (e.g., an invalid field + * name). + */ + kErrorInvalidArgument = 3, + + /** + * Deadline expired before operation could complete. For operations that + * change the state of the system, this error may be returned even if the + * operation has completed successfully. For example, a successful response + * from a server could have been delayed long enough for the deadline to + * expire. + */ + kErrorDeadlineExceeded = 4, + + /** Some requested document was not found. */ + kErrorNotFound = 5, + + /** Some document that we attempted to create already exists. */ + kErrorAlreadyExists = 6, + + /** The caller does not have permission to execute the specified operation. */ + kErrorPermissionDenied = 7, + + /** + * Some resource has been exhausted, perhaps a per-user quota, or perhaps the + * entire file system is out of space. + */ + kErrorResourceExhausted = 8, + + /** + * Operation was rejected because the system is not in a state required for + * the operation's execution. + */ + kErrorFailedPrecondition = 9, + + /** + * The operation was aborted, typically due to a concurrency issue like + * transaction aborts, etc. + */ + kErrorAborted = 10, + + /** Operation was attempted past the valid range. */ + kErrorOutOfRange = 11, + + /** Operation is not implemented or not supported/enabled. */ + 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. + */ + kErrorInternal = 13, + + /** + * The service is currently unavailable. This is a most likely a transient + * condition and may be corrected by retrying with a backoff. + */ + kErrorUnavailable = 14, + + /** Unrecoverable data loss or corruption. */ + kErrorDataLoss = 15, + + /** + * The request does not have valid authentication credentials for the + * operation. + */ + kErrorUnauthenticated = 16 +}; + +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_ERRORS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h new file mode 100644 index 0000000..627ead9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h @@ -0,0 +1,29 @@ +/* + * 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_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_VERSION_H_ +#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_VERSION_H_ + +namespace firebase { +namespace firestore { + +/** Version string for the Firebase Firestore SDK. */ +extern const char* const kFirestoreVersionString; + +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_VERSION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/geo_point.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/geo_point.h new file mode 100644 index 0000000..ac56e74 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/geo_point.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_ +#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_ + +#include +#include + +namespace firebase { +namespace firestore { + +/** + * An immutable object representing a geographical point in Firestore. The point + * is represented as a latitude/longitude pair. + * + * Latitude values are in the range of [-90, 90]. + * Longitude values are in the range of [-180, 180]. + */ +class GeoPoint { + public: + /** Creates a `GeoPoint` with both latitude and longitude set to 0. */ + GeoPoint() = default; + + /** + * Creates a `GeoPoint` from the provided latitude and longitude values. + * + * @param latitude The latitude as number of degrees between -90 and 90. + * @param longitude The longitude as number of degrees between -180 and 180. + */ + GeoPoint(double latitude, double longitude); + + /** Copy constructor, `GeoPoint` is trivially copyable. */ + GeoPoint(const GeoPoint& other) = default; + + /** Move constructor, equivalent to copying. */ + GeoPoint(GeoPoint&& other) = default; + + /** Copy assignment operator, `GeoPoint` is trivially copyable. */ + GeoPoint& operator=(const GeoPoint& other) = default; + + /** Move assignment operator, equivalent to copying. */ + GeoPoint& operator=(GeoPoint&& other) = default; + + /** Returns the latitude value of this `GeoPoint`. */ + double latitude() const { + return latitude_; + } + + /** Returns the latitude value of this `GeoPoint`. */ + double longitude() const { + return longitude_; + } + + /** + * Returns a string representation of this `GeoPoint` for logging/debugging + * purposes. + * + * @note: the exact string representation is unspecified and subject to + * change; don't rely on the format of the string. + */ + std::string ToString() const; + + /** + * Outputs the string representation of this `GeoPoint` to the given stream. + * + * @see `ToString()` for comments on the representation format. + */ + friend std::ostream& operator<<(std::ostream& out, const GeoPoint& geo_point); + + private: + double latitude_ = 0.0; + double longitude_ = 0.0; +}; + +/** Checks whether `lhs` and `rhs` are in ascending order. */ +bool operator<(const GeoPoint& lhs, const GeoPoint& rhs); + +/** Checks whether `lhs` and `rhs` are in descending order. */ +inline bool operator>(const GeoPoint& lhs, const GeoPoint& rhs) { + return rhs < lhs; +} + +/** Checks whether `lhs` and `rhs` are in non-ascending order. */ +inline bool operator>=(const GeoPoint& lhs, const GeoPoint& rhs) { + return !(lhs < rhs); +} + +/** Checks whether `lhs` and `rhs` are in non-descending order. */ +inline bool operator<=(const GeoPoint& lhs, const GeoPoint& rhs) { + return !(lhs > rhs); +} + +/** Checks `lhs` and `rhs` for inequality. */ +inline bool operator!=(const GeoPoint& lhs, const GeoPoint& rhs) { + return lhs < rhs || lhs > rhs; +} + +/** Checks `lhs` and `rhs` for equality. */ +inline bool operator==(const GeoPoint& lhs, const GeoPoint& rhs) { + return !(lhs != rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h new file mode 100644 index 0000000..e806bb8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h @@ -0,0 +1,252 @@ +/* + * 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_INCLUDE_FIREBASE_FIRESTORE_TIMESTAMP_H_ +#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_TIMESTAMP_H_ + +#include +#include +#include +#include + +#if !defined(_STLPORT_VERSION) +#include // NOLINT(build/c++11) +#endif // !defined(_STLPORT_VERSION) + +namespace firebase { + +/** + * A Timestamp represents a point in time independent of any time zone or + * calendar, represented as seconds and fractions of seconds at nanosecond + * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian + * Calendar which extends the Gregorian calendar backwards to year one. It is + * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are + * "smeared" so that no leap second table is needed for interpretation. Range is + * from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * + * @see + * https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto + */ +class Timestamp { + public: + /** + * Creates a new timestamp representing the epoch (with seconds and + * nanoseconds set to 0). + */ + Timestamp() = default; + + /** + * Creates a new timestamp. + * + * @param seconds The number of seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive; otherwise, assertion failure will be + * triggered. + * @param nanoseconds The non-negative fractions of a second at nanosecond + * resolution. Negative second values with fractions must still have + * non-negative nanoseconds values that count forward in time. Must be + * from 0 to 999,999,999 inclusive; otherwise, assertion failure will be + * triggered. + */ + Timestamp(int64_t seconds, int32_t nanoseconds); + + /** Copy constructor, `Timestamp` is trivially copyable. */ + Timestamp(const Timestamp& other) = default; + + /** Move constructor, equivalent to copying. */ + Timestamp(Timestamp&& other) = default; + + /** Copy assignment operator, `Timestamp` is trivially copyable. */ + Timestamp& operator=(const Timestamp& other) = default; + + /** Move assignment operator, equivalent to copying. */ + Timestamp& operator=(Timestamp&& other) = default; + + /** + * Creates a new timestamp with the current date. + * + * The precision is up to nanoseconds, depending on the system clock. + * + * @return a new timestamp representing the current date. + */ + static Timestamp Now(); + + /** + * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + */ + int64_t seconds() const { + return seconds_; + } + + /** + * The non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions still have non-negative nanoseconds values + * that count forward in time. + */ + int32_t nanoseconds() const { + return nanoseconds_; + } + + /** + * Converts `time_t` to a `Timestamp`. + * + * @param seconds_since_unix_epoch + * @parblock + * The number of seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Can be negative to represent dates before the + * epoch. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z + * inclusive; otherwise, assertion failure will be triggered. + * + * Note that while the epoch of `time_t` is unspecified, it's usually Unix + * epoch. If this assumption is broken, this function will produce + * incorrect results. + * @endparblock + * + * @return a new timestamp with the given number of seconds and zero + * nanoseconds. + */ + static Timestamp FromTimeT(time_t seconds_since_unix_epoch); + +#if !defined(_STLPORT_VERSION) + /** + * Converts `std::chrono::time_point` to a `Timestamp`. + * + * @param time_point + * @parblock + * The time point with system clock's epoch, which is + * presumed to be Unix epoch 1970-01-01T00:00:00Z. Can be negative to + * represent dates before the epoch. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive; otherwise, assertion failure will be + * triggered. + * + * Note that while the epoch of `std::chrono::system_clock` is + * unspecified, it's usually Unix epoch. If this assumption is broken, + * this constructor will produce incorrect results. + * @endparblock + */ + static Timestamp FromTimePoint( + std::chrono::time_point time_point); + + /** + * Converts this `Timestamp` to a `time_point`. + * + * Important: if overflow would occur, the returned value will be the maximum + * or minimum value that `Duration` can hold. Note in particular that `long + * long` is insufficient to hold the full range of `Timestamp` values with + * nanosecond precision (which is why `Duration` defaults to `microseconds`). + */ + template + std::chrono::time_point ToTimePoint() const; +#endif // !defined(_STLPORT_VERSION) + + /** + * Returns a string representation of this `Timestamp` for logging/debugging + * purposes. + * + * @note: the exact string representation is unspecified and subject to + * change; don't rely on the format of the string. + */ + std::string ToString() const; + + /** + * Outputs the string representation of this `Timestamp` to the given stream. + * + * @see `ToString()` for comments on the representation format. + */ + friend std::ostream& operator<<(std::ostream& out, + const Timestamp& timestamp); + + private: + // Checks that the number of seconds is within the supported date range, and + // that nanoseconds satisfy 0 <= ns <= 1second. + void ValidateBounds() const; + + int64_t seconds_ = 0; + int32_t nanoseconds_ = 0; +}; + +/** Checks whether `lhs` and `rhs` are in ascending order. */ +inline bool operator<(const Timestamp& lhs, const Timestamp& rhs) { + return lhs.seconds() < rhs.seconds() || + (lhs.seconds() == rhs.seconds() && + lhs.nanoseconds() < rhs.nanoseconds()); +} + +/** Checks whether `lhs` and `rhs` are in descending order. */ +inline bool operator>(const Timestamp& lhs, const Timestamp& rhs) { + return rhs < lhs; +} + +/** Checks whether `lhs` and `rhs` are in non-ascending order. */ +inline bool operator>=(const Timestamp& lhs, const Timestamp& rhs) { + return !(lhs < rhs); +} + +/** Checks whether `lhs` and `rhs` are in non-descending order. */ +inline bool operator<=(const Timestamp& lhs, const Timestamp& rhs) { + return !(lhs > rhs); +} + +/** Checks `lhs` and `rhs` for inequality. */ +inline bool operator!=(const Timestamp& lhs, const Timestamp& rhs) { + return lhs < rhs || lhs > rhs; +} + +/** Checks `lhs` and `rhs` for equality. */ +inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) { + return !(lhs != 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; + using TimePoint = chr::time_point; + + // Saturate on overflow + const auto max_seconds = chr::duration_cast(Duration::max()); + if (seconds_ > 0 && max_seconds.count() <= seconds_) { + return TimePoint{Duration::max()}; + } + const auto min_seconds = chr::duration_cast(Duration::min()); + if (seconds_ < 0 && min_seconds.count() >= seconds_) { + return TimePoint{Duration::min()}; + } + + const auto seconds = chr::duration_cast(chr::seconds(seconds_)); + const auto nanoseconds = + chr::duration_cast(chr::nanoseconds(nanoseconds_)); + return TimePoint{seconds + nanoseconds}; +} + +#pragma pop_macro("max") +#pragma pop_macro("min") + +#endif // !defined(_STLPORT_VERSION) + +} // namespace firebase + +#endif // FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_TIMESTAMP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h new file mode 100644 index 0000000..51aea75 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h @@ -0,0 +1,62 @@ +/* + * 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 +#include + +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace core { +template +class EventListener; +class Query; +} // 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>; + +using QueryCallback = std::function; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_API_FWD_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc new file mode 100644 index 0000000..a6d8f73 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc @@ -0,0 +1,104 @@ +/* + * 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/collection_reference.h" + +#include + +#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 { +namespace api { +namespace { + +using core::Query; +using model::DocumentKey; +using model::ResourcePath; +using util::ThrowInvalidArgument; + +Query MakeQuery(model::ResourcePath path) { + if (path.size() % 2 != 1) { + ThrowInvalidArgument( + "Invalid collection reference. Collection references " + "must have an odd number of segments, but %s has %s", + path.CanonicalString(), path.size()); + } + + return Query(std::move(path)); +} + +} // namespace + +CollectionReference::CollectionReference(model::ResourcePath path, + std::shared_ptr firestore) + : Query(MakeQuery(std::move(path)), std::move(firestore)) { +} + +bool operator==(const CollectionReference& lhs, + const CollectionReference& rhs) { + return lhs.firestore() == rhs.firestore() && lhs.query() == rhs.query(); +} + +size_t CollectionReference::Hash() const { + return util::Hash(firestore().get(), query()); +} + +const std::string& CollectionReference::collection_id() const { + return query().path().last_segment(); +} + +absl::optional CollectionReference::parent() const { + ResourcePath parent_path = query().path().PopLast(); + if (parent_path.empty()) { + return absl::nullopt; + } else { + return DocumentReference(DocumentKey(std::move(parent_path)), firestore()); + } +} + +std::string CollectionReference::path() const { + return query().path().CanonicalString(); +} + +DocumentReference CollectionReference::Document( + 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()); +} + +DocumentReference CollectionReference::AddDocument( + core::ParsedSetData&& data, util::StatusCallback callback) const { + DocumentReference doc_ref = Document(); + doc_ref.SetData(std::move(data), std::move(callback)); + return doc_ref; +} + +DocumentReference CollectionReference::Document() const { + DocumentKey key(query().path().Append(util::CreateAutoId())); + return DocumentReference(std::move(key), firestore()); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h new file mode 100644 index 0000000..9116817 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h @@ -0,0 +1,104 @@ +/* + * 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_COLLECTION_REFERENCE_H_ +#define FIRESTORE_CORE_SRC_API_COLLECTION_REFERENCE_H_ + +#include +#include + +#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 model { +class ResourcePath; +} // namespace model + +namespace api { + +/** + * A `CollectionReference` object can be used for adding documents, getting + * document references, and querying for documents (using the methods inherited + * from `Query`). + */ +class CollectionReference : public Query { + public: + CollectionReference() = default; + CollectionReference(model::ResourcePath path, + std::shared_ptr firestore); + + /** ID of the referenced collection. */ + const std::string& collection_id() const; + + /** + * For subcollections, `parent` returns the containing `DocumentReference`. + * For root collections, nullopt is returned. + */ + absl::optional parent() const; + + /** + * A string containing the slash-separated path to this `CollectionReference` + * (relative to the root of the database). + */ + std::string path() const; + + /** + * Returns a `DocumentReference` pointing to a new document with an + * auto-generated ID. + */ + DocumentReference Document() const; + + /** + * Gets a `DocumentReference` referring to the document at the specified path, + * relative to this collection's own path. + * + * @param document_path The slash-separated relative path of the document for + * which to get a `DocumentReference`. + * + * @return The `DocumentReference` for the specified document path. + */ + DocumentReference Document(const std::string& document_path) const; + + /** + * Add a new document to this collection with the specified data, assigning it + * a document ID automatically. + * + * @param data A `ParsedSetData` containing the data for the new document. + * @param callback A callback to execute once the document has been + * successfully written to the server. This callback will not be called + * while the client is offline, though local changes will be visible + * immediately. + * + * @return A `DocumentReference` pointing to the newly created document. + */ + DocumentReference AddDocument(core::ParsedSetData&& data, + util::StatusCallback callback) const; + + size_t Hash() const; +}; + +bool operator==(const CollectionReference& lhs, const CollectionReference& rhs); + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_COLLECTION_REFERENCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc new file mode 100644 index 0000000..fa749d3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc @@ -0,0 +1,37 @@ +/* + * 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/document_change.h" + +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace api { + +size_t DocumentChange::Hash() const { + return util::Hash(type_, document_, old_index_, new_index_); +} + +bool operator==(const DocumentChange& lhs, const DocumentChange& rhs) { + return lhs.type() == rhs.type() && lhs.document() == rhs.document() && + lhs.old_index() == rhs.old_index() && + lhs.new_index() == rhs.new_index(); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h new file mode 100644 index 0000000..2c7981e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h @@ -0,0 +1,86 @@ +/* + * 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_DOCUMENT_CHANGE_H_ +#define FIRESTORE_CORE_SRC_API_DOCUMENT_CHANGE_H_ + +#include +#include + +#include "Firestore/core/src/api/document_snapshot.h" + +namespace firebase { +namespace firestore { +namespace api { + +class DocumentChange { + public: + enum class Type { Added, Modified, Removed }; + + DocumentChange() = default; + DocumentChange(Type type, + DocumentSnapshot document, + size_t old_index, + size_t new_index) + : type_(type), + document_(std::move(document)), + old_index_(old_index), + new_index_(new_index) { + } + + size_t Hash() const; + + Type type() const { + return type_; + } + + DocumentSnapshot document() const { + return document_; + } + + size_t old_index() const { + return old_index_; + } + + size_t new_index() const { + return new_index_; + } + + const std::shared_ptr& firestore() const { + return document_.firestore(); + } + + /** + * A sentinel return value for old_index() and new_index() indicating that + * there's no relevant index to return because the document was newly added + * or removed respectively. + */ + static constexpr size_t npos = static_cast(-1); + + private: + Type type_; + DocumentSnapshot document_; + size_t old_index_; + size_t new_index_; +}; + +bool operator==(const DocumentChange& lhs, const DocumentChange& rhs); + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_DOCUMENT_CHANGE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc new file mode 100644 index 0000000..706ef82 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc @@ -0,0 +1,255 @@ +/* + * 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/firestore_exceptions.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) { + util::ThrowInvalidArgument( + "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).ToMutation(key(), Precondition::None())}, + std::move(callback)); +} + +void DocumentReference::UpdateData(core::ParsedUpdateData&& update_data, + util::StatusCallback callback) { + firestore_->client()->WriteMutations( + {std::move(update_data).ToMutation(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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.h new file mode 100644 index 0000000..41a6edc --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc new file mode 100644 index 0000000..ee1eb68 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc @@ -0,0 +1,100 @@ +/* + * 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/document_snapshot.h" + +#include + +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace api { + +using model::Document; +using model::DocumentKey; +using model::FieldPath; +using model::ObjectValue; + +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), std::move(key), absl::nullopt, + std::move(metadata)}; +} + +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)} { +} + +size_t DocumentSnapshot::Hash() const { + return util::Hash(firestore_.get(), internal_key_, internal_document_, + metadata_); +} + +bool DocumentSnapshot::exists() const { + return internal_document_.has_value(); +} + +const absl::optional& DocumentSnapshot::internal_document() const { + return internal_document_; +} + +DocumentReference DocumentSnapshot::CreateReference() const { + return DocumentReference{internal_key_, firestore_}; +} + +const std::string& DocumentSnapshot::document_id() const { + return internal_key_.path().last_segment(); +} + +absl::optional DocumentSnapshot::GetValue( + const FieldPath& field_path) const { + return internal_document_ ? (*internal_document_)->field(field_path) + : absl::nullopt; +} + +bool operator==(const DocumentSnapshot& lhs, const DocumentSnapshot& rhs) { + return lhs.firestore_ == rhs.firestore_ && + lhs.internal_key_ == rhs.internal_key_ && + lhs.exists() == rhs.exists() && + (lhs.exists() ? lhs.internal_document_->get().data() == + rhs.internal_document_->get().data() + : true) && + lhs.metadata_ == rhs.metadata_; +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.h new file mode 100644 index 0000000..f1e4ef2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/document_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_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 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc new file mode 100644 index 0000000..04d9429 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc @@ -0,0 +1,278 @@ +/* + * 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/credentials/empty_credentials_provider.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/firebase_metadata_provider.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 core::AsyncEventListener; +using core::DatabaseInfo; +using core::FirestoreClient; +using credentials::AuthCredentialsProvider; +using credentials::EmptyAppCheckCredentialsProvider; +using local::LevelDbPersistence; +using model::ResourcePath; +using remote::FirebaseMetadataProvider; +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 + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr worker_queue, + std::unique_ptr firebase_metadata_provider, + void* extension) + : database_id_{std::move(database_id)}, + app_check_credentials_provider_{ + std::move(app_check_credentials_provider)}, + auth_credentials_provider_{std::move(auth_credentials_provider)}, + persistence_key_{std::move(persistence_key)}, + worker_queue_{std::move(worker_queue)}, + firebase_metadata_provider_{std::move(firebase_metadata_provider)}, + extension_{extension} { +} + +Firestore::Firestore( + model::DatabaseId database_id, + std::string persistence_key, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr worker_queue, + std::unique_ptr firebase_metadata_provider, + void* extension) + : Firestore(std::move(database_id), + std::move(persistence_key), + std::move(auth_credentials_provider), + std::make_shared(), + std::move(worker_queue), + std::move(firebase_metadata_provider), + 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_) { + util::ThrowIllegalState( + "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."); + } + if (!settings.ssl_enabled() && settings.host() == Settings::DefaultHost) { + util::ThrowIllegalState( + "You can't set the 'sslEnabled' setting to false unless you also set a " + "non-default 'host'."); + } + + 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(auth_credentials_provider_), + std::move(app_check_credentials_provider_), user_executor_, + worker_queue_, std::move(firebase_metadata_provider_)); + } +} + +DatabaseInfo Firestore::MakeDatabaseInfo() const { + return DatabaseInfo(database_id_, persistence_key_, settings_.host(), + settings_.ssl_enabled()); +} + +std::shared_ptr Firestore::LoadBundle( + std::unique_ptr bundle_data) { + EnsureClientConfigured(); + + auto task = std::make_shared(user_executor_); + client_->LoadBundle(std::move(bundle_data), task); + + return task; +} + +void Firestore::GetNamedQuery(const std::string& name, + api::QueryCallback callback) { + EnsureClientConfigured(); + client_->GetNamedQuery(name, std::move(callback)); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h new file mode 100644 index 0000000..2c678a3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h @@ -0,0 +1,156 @@ +/* + * 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/load_bundle_task.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/credentials/credentials_fwd.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/util/byte_stream.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { + +namespace remote { +class FirebaseMetadataProvider; +} // namespace remote + +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 + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr worker_queue, + std::unique_ptr + firebase_metadata_provider, + void* extension); + + // TODO(appcheck): Remove this constructor once we changed the C++ SDK + // to call the new constructor. + Firestore(model::DatabaseId database_id, + std::string persistence_key, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr worker_queue, + std::unique_ptr + firebase_metadata_provider, + 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); + + std::shared_ptr LoadBundle( + std::unique_ptr bundle_data); + void GetNamedQuery(const std::string& name, api::QueryCallback 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 + app_check_credentials_provider_; + std::shared_ptr + auth_credentials_provider_; + std::string persistence_key_; + + std::shared_ptr user_executor_; + std::shared_ptr worker_queue_; + + std::unique_ptr firebase_metadata_provider_; + + void* extension_ = nullptr; + + Settings settings_; + + mutable std::mutex mutex_; + + std::shared_ptr client_; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_FIRESTORE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h new file mode 100644 index 0000000..c30d0d5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h @@ -0,0 +1,62 @@ +/* + * 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_LISTENER_REGISTRATION_H_ +#define FIRESTORE_CORE_SRC_API_LISTENER_REGISTRATION_H_ + +namespace firebase { +namespace firestore { + +namespace core { +class FirestoreClient; +} // namespace core + +namespace api { + +/** + * An internal handle that encapsulates a user's ability to request that we + * stop listening to a listener. When a user calls Remove(), + * ListenerRegistration will synchronously mute the listener and then send a + * request to the FirestoreClient to actually unlisten. + * + * ListenerRegistration will not automatically stop listening if it is + * destroyed. We allow users to fire and forget listens if they never want to + * stop them. + * + * Getting shutdown code right is tricky so ListenerRegistration is very + * forgiving. It will tolerate: + * + * * Multiple calls to Remove(), + * * calls to Remove() after we send an error, + * * calls to Remove() even after deleting the App in which the listener was + * started. + */ +class ListenerRegistration { + public: + virtual ~ListenerRegistration() = default; + + /** + * Removes the listener being tracked in this ListenerRegistration. After + * the initial call, subsequent calls have no effect. + */ + virtual void Remove() = 0; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_LISTENER_REGISTRATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.cc new file mode 100644 index 0000000..08c6a82 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.cc @@ -0,0 +1,121 @@ +/* + * Copyright 2021 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/load_bundle_task.h" + +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/util/autoid.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace api { + +LoadBundleTask::~LoadBundleTask() { + // NOTE: this is needed because users might call to modify some fields from + // user callback thread. With this lock guard, we could be destroying the + // instance while those calls are still in flight. + std::lock_guard lock(mutex_); +} + +LoadBundleTask::LoadBundleHandle LoadBundleTask::Observe( + ProgressObserver observer) { + std::lock_guard lock(mutex_); + + auto handle = next_handle_++; + observers_.push_back({handle, std::move(observer)}); + + return handle; +} + +LoadBundleTask::LoadBundleHandle LoadBundleTask::SetLastObserver( + ProgressObserver observer) { + std::lock_guard lock(mutex_); + + auto handle = next_handle_++; + last_observer_ = {handle, std::move(observer)}; + + return handle; +} + +void LoadBundleTask::RemoveObserver(const LoadBundleHandle& handle) { + std::lock_guard lock(mutex_); + + auto found = absl::c_find_if( + observers_, [&](const HandleObservers::value_type& observer) { + return observer.first == handle; + }); + if (found != observers_.end()) { + observers_.erase(found); + } + + if (last_observer_.has_value() && last_observer_.value().first == handle) { + last_observer_ = absl::nullopt; + } +} + +void LoadBundleTask::RemoveAllObservers() { + std::lock_guard lock(mutex_); + + observers_.clear(); + last_observer_ = absl::nullopt; +} + +void LoadBundleTask::SetSuccess(LoadBundleTaskProgress success_progress) { + HARD_ASSERT(success_progress.state() == LoadBundleTaskState::kSuccess, + "Calling SetSuccess() with a state that is not 'Success'"); + std::lock_guard lock(mutex_); + + progress_snapshot_ = success_progress; + NotifyObservers(); +} + +void LoadBundleTask::SetError(const util::Status& status) { + std::lock_guard lock(mutex_); + + progress_snapshot_.set_state(LoadBundleTaskState::kError); + progress_snapshot_.set_error_status(status); + + NotifyObservers(); +} + +void LoadBundleTask::UpdateProgress(LoadBundleTaskProgress progress) { + std::lock_guard lock(mutex_); + + progress_snapshot_ = progress; + NotifyObservers(); +} + +void LoadBundleTask::NotifyObservers() { + for (const auto& entry : observers_) { + const auto& observer = entry.second; + const auto& progress = progress_snapshot_; + user_executor_->Execute([observer, progress] { observer(progress); }); + } + + if (last_observer_.has_value()) { + const auto& observer = last_observer_.value().second; + const auto& progress = progress_snapshot_; + user_executor_->Execute([observer, progress] { observer(progress); }); + } +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.h new file mode 100644 index 0000000..9573a5a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/load_bundle_task.h @@ -0,0 +1,236 @@ +/* + * Copyright 2021 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_LOAD_BUNDLE_TASK_H_ +#define FIRESTORE_CORE_SRC_API_LOAD_BUNDLE_TASK_H_ + +#include +#include +#include +#include // NOLINT(build/c++11) +#include +#include +#include + +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/status.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace api { + +/** + * Represents the state of bundle loading tasks. + * + * Both `kSuccess` and `kError` are final states: task will abort + * or complete and there will be no more updates after they are reported. + */ +enum class LoadBundleTaskState { kError, kInProgress, kSuccess }; + +/** Represents a progress update or a final state from loading bundles. */ +class LoadBundleTaskProgress { + public: + LoadBundleTaskProgress() = default; + LoadBundleTaskProgress(uint32_t documents_loaded, + uint32_t total_documents, + uint64_t bytes_loaded, + uint64_t total_bytes, + LoadBundleTaskState state) + : documents_loaded_(documents_loaded), + total_documents_(total_documents), + bytes_loaded_(bytes_loaded), + total_bytes_(total_bytes), + state_(state) { + } + + LoadBundleTaskProgress(uint32_t documents_loaded, + uint32_t total_documents, + uint64_t bytes_loaded, + uint64_t total_bytes, + LoadBundleTaskState state, + const util::Status& error_status) + : documents_loaded_(documents_loaded), + total_documents_(total_documents), + bytes_loaded_(bytes_loaded), + total_bytes_(total_bytes), + state_(state), + error_status_(error_status) { + } + + /** Returns how many documents have been loaded. */ + uint32_t documents_loaded() const { + return documents_loaded_; + } + + /** + * Returns the total number of documents in the bundle. Returns 0 if the + * bundle failed to parse. + */ + uint32_t total_documents() const { + return total_documents_; + } + + /** Returns how many bytes have been loaded. */ + uint64_t bytes_loaded() const { + return bytes_loaded_; + } + + /** + * Returns the total number of bytes in the bundle. Returns 0 if the bundle + * failed to parse. + */ + uint64_t total_bytes() const { + return total_bytes_; + } + + /** Returns the current state of the task. */ + LoadBundleTaskState state() const { + return state_; + } + + void set_state(LoadBundleTaskState state) { + state_ = state; + } + + const util::Status& error_status() const { + return error_status_; + } + + void set_error_status(const util::Status& error_status) { + error_status_.Update(error_status); + } + + private: + uint32_t documents_loaded_ = 0; + uint32_t total_documents_ = 0; + uint64_t bytes_loaded_ = 0; + uint64_t total_bytes_ = 0; + + LoadBundleTaskState state_ = LoadBundleTaskState::kInProgress; + util::Status error_status_; +}; + +inline bool operator==(const LoadBundleTaskProgress lhs, + const LoadBundleTaskProgress& rhs) { + return lhs.state() == rhs.state() && + lhs.bytes_loaded() == rhs.bytes_loaded() && + lhs.documents_loaded() == rhs.documents_loaded() && + lhs.total_bytes() == rhs.total_bytes() && + lhs.total_documents() == rhs.total_documents() && + lhs.error_status() == rhs.error_status(); +} + +inline bool operator!=(const LoadBundleTaskProgress lhs, + const LoadBundleTaskProgress& rhs) { + return !(lhs == rhs); +} + +/** + * Represents the task of loading a Firestore bundle. It provides progress of + * bundle loading, as well as task completion and error events. + */ +class LoadBundleTask { + public: + /** A handle used to look up and remove observer from the task. */ + using LoadBundleHandle = int64_t; + + /** Observer type that is called by the task when there is an update. */ + using ProgressObserver = std::function; + + explicit LoadBundleTask(std::shared_ptr user_executor) + : user_executor_(std::move(user_executor)) { + } + + // This class cannot be copied or moved, because it holds a mutex. + LoadBundleTask(const LoadBundleTask& other) = delete; + LoadBundleTask& operator=(LoadBundleTask& other) = delete; + + ~LoadBundleTask(); + + /** + * Instructs the task to notify the specified observer when there is a + * progress update. + * + * @return A handle that can be used to remove the callback from this task. + */ + LoadBundleHandle Observe(ProgressObserver observer); + + /** + * Instructs the task to notify the specified observer when there is a + * progress update. + * + * For a given progress update, this observer is guaranteed to be called + * after all other observers. Calling `SetLastObserver` a second time will + * override the observer registered the first time. + * + * @return A handle that can be used to remove the callback from this task. + */ + LoadBundleHandle SetLastObserver(ProgressObserver observer); + + /** + * Removes the observer associated with the given handle, does nothing if the + * callback cannot be found. + */ + void RemoveObserver(const LoadBundleHandle& handle); + + /** Removes all observers. */ + void RemoveAllObservers(); + + /** + * Notifies observers with a `Success` progress. + */ + void SetSuccess(LoadBundleTaskProgress success_progress); + + /** + * Notifies observers with a error progress, by changing the last progress + * this instance has been with an `Error` state. + */ + void SetError(const util::Status& status); + + /** Notifies observers with a `InProgress` progress. */ + void UpdateProgress(LoadBundleTaskProgress progress); + + private: + /** Holds the `LoadBundleHandle` to `ProgressObserver` mapping. */ + using HandleObservers = + std::vector>; + + /** Notifies all observers with current `progress_snapshot_`. */ + void NotifyObservers(); + + LoadBundleHandle next_handle_ = 1; + + /** The executor to run all observers when notified. */ + std::shared_ptr user_executor_; + + /** Guard to all internal state mutation. */ + mutable std::mutex mutex_; + + /** A vector holds observers. */ + HandleObservers observers_; + + /** Observer guaranteed to be called the last. */ + absl::optional> last_observer_; + + /** The last progress update. */ + LoadBundleTaskProgress progress_snapshot_; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_LOAD_BUNDLE_TASK_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc new file mode 100644 index 0000000..7323284 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc @@ -0,0 +1,481 @@ +/* + * 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/resource_path.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/exception.h" +#include "absl/algorithm/container.h" +#include "absl/strings/match.h" +#include "absl/types/span.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::GetTypeOrder; +using model::IsArray; +using model::RefValue; +using model::ResourcePath; +using model::TypeOrder; +using nanopb::MakeSharedMessage; +using nanopb::Message; +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(const FieldPath& field_path, + Operator op, + nanopb::SharedMessage 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(*value, op); + // TODO(mutabledocuments): See if we can remove this copy and modify the + // input values directly. + auto references = MakeSharedMessage({}); + references->which_value_type = google_firestore_v1_Value_array_value_tag; + nanopb::SetRepeatedField( + &references->array_value.values, + &references->array_value.values_count, + absl::Span( + value->array_value.values, value->array_value.values_count), + [&](const google_firestore_v1_Value& value) { + return *ParseExpectedReferenceValue(value, type_describer) + .release(); + }); + value = std::move(references); + } else { + value = ParseExpectedReferenceValue(*value, type_describer); + } + } else { + if (IsDisjunctiveOperator(op)) { + ValidateDisjunctiveFilterElements(*value, op); + } + } + + FieldFilter filter = FieldFilter::Create(field_path, op, std::move(value)); + ValidateNewFilter(filter); + + return Wrap(query_.AddingFilter(std::move(filter))); +} + +Query Query::OrderBy(FieldPath field_path, bool descending) const { + return OrderBy(std::move(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 google_firestore_v1_Value& value, Operator op) const { + HARD_ASSERT( + IsArray(value), + "A FieldValue of Array type is required for disjunctive filters."); + if (value.array_value.values_count == 0) { + ThrowInvalidArgument( + "Invalid Query. A non-empty array is required for '%s'" + " filters.", + Describe(op)); + } + if (value.array_value.values_count > 10) { + ThrowInvalidArgument( + "Invalid Query. '%s' filters support a maximum of 10" + " elements in the value array.", + Describe(op)); + } +} + +Message Query::ParseExpectedReferenceValue( + const google_firestore_v1_Value& value, + const std::function& type_describer) const { + if (GetTypeOrder(value) == TypeOrder::kString) { + std::string document_key = nanopb::MakeString(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() && + absl::StrContains(document_key, "/")) { + 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 RefValue(firestore_->database_id(), DocumentKey{path}); + } else if (GetTypeOrder(value) == TypeOrder::kReference) { + return model::DeepClone(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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h new file mode 100644 index 0000000..54f7d16 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h @@ -0,0 +1,212 @@ +/* + * 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_CORE_H_ +#define FIRESTORE_CORE_SRC_API_QUERY_CORE_H_ + +#include +#include +#include + +#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" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { + +namespace model { +class FieldValue; +} // namespace model + +namespace api { + +/** + * A `Query` refers to a Firestore Query which you can read or listen to. You + * can also construct refined `Query` objects by adding filters and ordering. + */ +class Query { + public: + Query() = default; + + Query(core::Query query, std::shared_ptr firestore); + + size_t Hash() const; + + const std::shared_ptr& firestore() const { + return firestore_; + } + + const core::Query& query() const { + return query_; + } + + /** + * 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 callback a callback to execute once the documents have been + * successfully read. + */ + void GetDocuments(Source source, QuerySnapshotListener&& callback); + + /** + * Attaches a listener for QuerySnapshot events. + * + * @param options Whether metadata-only changes (i.e. only + * `DocumentSnapshot::metadata()` changed) should trigger snapshot events. + * @param listener The listener to attach. + * + * @return A ListenerRegistration that can be used to remove this listener. + */ + std::unique_ptr AddSnapshotListener( + core::ListenOptions options, QuerySnapshotListener&& listener); + + /** + * Creates and returns a new `Query` with the additional filter that documents + * must contain the specified field and the value must be equal to the + * specified value. + * + * @param field_path The name of the field to compare. + * @param op The operator to apply. + * @param value The value against which to compare the field. + * @param type_describer A function that will produce a description of the + * type of field_value. + * + * @return The created `Query`. + */ + Query Filter(const model::FieldPath& field_path, + core::Filter::Operator op, + nanopb::SharedMessage value, + const std::function& type_describer) const; + + /** + * Creates and returns a new `Query` that's additionally sorted by the + * specified field. + * + * @param field_path The field to sort by. + * @param descending If true, sorts descending instead of ascending. + * + * @return The created `Query`. + */ + Query OrderBy(model::FieldPath field_path, bool descending) const; + + /** + * Creates and returns a new `Query` that's additionally sorted by the + * specified field. + * + * @param field_path The field to sort by. + * @param direction The direction in which to sort. + * + * @return The created `Query`. + */ + Query OrderBy(model::FieldPath field_path, core::Direction direction) const; + + /** + * 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 LimitToLast(int32_t limit) const; + + /** + * Creates and returns a new `Query` that starts at the given bound. The + * starting position is relative to the order of the query. The bound must + * contain all of the fields provided in the orderBy of this query. + * + * @param bound The bound of the query to start at. + * + * @return The created `Query`. + */ + Query StartAt(core::Bound bound) const; + + /** + * Creates and returns a new `Query` that ends at the given bound. The ending + * position is relative to the order of the query. The bound must contain all + * of the fields provided in the orderBy of this query. + * + * @param bound The bound of the query to end at. + * + * @return The created `Query`. + */ + Query EndAt(core::Bound bound) const; + + /** + * Creates a new `Query` with the given internal query. + */ + Query Wrap(core::Query chained_query) const { + return Query(std::move(chained_query), firestore_); + } + + private: + void ValidateNewFilter(const core::Filter& filter) 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. + */ + void ValidateDisjunctiveFilterElements(const google_firestore_v1_Value& value, + core::Filter::Operator op) const; + + /** + * Parses the given FieldValue into a Reference, throwing appropriate errors + * if the value is anything other than a Reference or String, or if the string + * is malformed. + */ + nanopb::Message ParseExpectedReferenceValue( + const google_firestore_v1_Value& value, + const std::function& type_describer) const; + + std::string Describe(core::Filter::Operator op) const; + + std::shared_ptr firestore_; + core::Query query_; +}; + +bool operator==(const Query& lhs, const Query& rhs); + +inline bool operator!=(const Query& lhs, const Query& rhs) { + return !(lhs == rhs); +} + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_QUERY_CORE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.cc new file mode 100644 index 0000000..1be5b81 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.h new file mode 100644 index 0000000..0e69fac --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc new file mode 100644 index 0000000..e24d0fc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc @@ -0,0 +1,172 @@ +/* + * 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_snapshot.h" + +#include + +#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 { +namespace firestore { +namespace api { + +using api::Firestore; +using core::DocumentViewChange; +using core::ViewSnapshot; +using model::Document; +using model::DocumentComparator; +using model::DocumentSet; +using util::ThrowInvalidArgument; + +QuerySnapshot::QuerySnapshot(std::shared_ptr firestore, + core::Query query, + core::ViewSnapshot&& snapshot, + SnapshotMetadata metadata) + : firestore_(std::move(firestore)), + internal_query_(std::move(query)), + snapshot_(std::move(snapshot)), + metadata_(std::move(metadata)) { +} + +Query QuerySnapshot::query() const { + return Query(internal_query_, firestore_); +} + +const core::Query& QuerySnapshot::internal_query() const { + return internal_query_; +} + +bool operator==(const QuerySnapshot& lhs, const QuerySnapshot& rhs) { + return lhs.firestore_ == rhs.firestore_ && + lhs.internal_query_ == rhs.internal_query_ && + lhs.snapshot_ == rhs.snapshot_ && lhs.metadata_ == rhs.metadata_; +} + +size_t QuerySnapshot::Hash() const { + return util::Hash(firestore_.get(), internal_query_, snapshot_, metadata_); +} + +void QuerySnapshot::ForEachDocument( + const std::function& callback) const { + DocumentSet document_set = snapshot_.documents(); + bool from_cache = metadata_.from_cache(); + + for (const Document& document : document_set) { + bool has_pending_writes = + snapshot_.mutated_keys().contains(document->key()); + auto snap = DocumentSnapshot::FromDocument( + firestore_, document, SnapshotMetadata(has_pending_writes, from_cache)); + callback(std::move(snap)); + } +} + +static DocumentChange::Type DocumentChangeTypeForChange( + const DocumentViewChange& change) { + switch (change.type()) { + case DocumentViewChange::Type::Added: + return DocumentChange::Type::Added; + case DocumentViewChange::Type::Modified: + case DocumentViewChange::Type::Metadata: + return DocumentChange::Type::Modified; + case DocumentViewChange::Type::Removed: + return DocumentChange::Type::Removed; + } + + HARD_FAIL("Unknown DocumentViewChange::Type: %s", change.type()); +} + +void QuerySnapshot::ForEachChange( + bool include_metadata_changes, + const std::function& callback) const { + if (include_metadata_changes && snapshot_.excludes_metadata_changes()) { + ThrowInvalidArgument( + "To include metadata changes with your document " + "changes, you must call " + "addSnapshotListener(includeMetadataChanges:true)."); + } + + if (snapshot_.old_documents().empty()) { + // Special case the first snapshot because index calculation is easy and + // fast. Also all changes on the first snapshot are adds so there are also + // no metadata-only changes to filter out. + DocumentComparator doc_comparator = snapshot_.query().Comparator(); + absl::optional last_document; + size_t index = 0; + for (const DocumentViewChange& change : snapshot_.document_changes()) { + const Document& doc = change.document(); + SnapshotMetadata metadata( + /*pending_writes=*/snapshot_.mutated_keys().contains(doc->key()), + /*from_cache=*/snapshot_.from_cache()); + auto document = + DocumentSnapshot::FromDocument(firestore_, doc, std::move(metadata)); + + HARD_ASSERT(change.type() == DocumentViewChange::Type::Added, + "Invalid event type for first snapshot"); + HARD_ASSERT(!last_document || util::Ascending(doc_comparator.Compare( + *last_document, change.document())), + "Got added events in wrong order"); + + callback(DocumentChange(DocumentChange::Type::Added, std::move(document), + DocumentChange::npos, index++)); + last_document = doc; + } + + } else { + // A DocumentSet that is updated incrementally as changes are applied to use + // to lookup the index of a document. + DocumentSet index_tracker = snapshot_.old_documents(); + for (const DocumentViewChange& change : snapshot_.document_changes()) { + if (!include_metadata_changes && + change.type() == DocumentViewChange::Type::Metadata) { + continue; + } + + const Document& doc = change.document(); + SnapshotMetadata metadata( + /*pending_writes=*/snapshot_.mutated_keys().contains(doc->key()), + /*from_cache=*/snapshot_.from_cache()); + auto document = DocumentSnapshot::FromDocument(firestore_, doc, metadata); + + size_t old_index = DocumentChange::npos; + size_t new_index = DocumentChange::npos; + if (change.type() != DocumentViewChange::Type::Added) { + old_index = index_tracker.IndexOf(change.document()->key()); + HARD_ASSERT(old_index != DocumentSet::npos, + "Index for document not found"); + index_tracker = index_tracker.erase(change.document()->key()); + } + if (change.type() != DocumentViewChange::Type::Removed) { + index_tracker = index_tracker.insert(change.document()); + new_index = index_tracker.IndexOf(change.document()->key()); + } + + DocumentChange::Type type = DocumentChangeTypeForChange(change); + callback(DocumentChange(type, std::move(document), old_index, new_index)); + } + } +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.h new file mode 100644 index 0000000..af38f12 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc new file mode 100644 index 0000000..2037b58 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc @@ -0,0 +1,44 @@ +/* + * 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/settings.h" + +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace api { + +constexpr const char* Settings::DefaultHost; +constexpr bool Settings::DefaultSslEnabled; +constexpr bool Settings::DefaultPersistenceEnabled; +constexpr int64_t Settings::DefaultCacheSizeBytes; +constexpr int64_t Settings::MinimumCacheSizeBytes; + +size_t Settings::Hash() const { + return util::Hash(host_, ssl_enabled_, persistence_enabled_, + cache_size_bytes_); +} + +bool operator==(const Settings& lhs, const Settings& rhs) { + return lhs.host_ == rhs.host_ && lhs.ssl_enabled_ == rhs.ssl_enabled_ && + lhs.persistence_enabled_ == rhs.persistence_enabled_ && + lhs.cache_size_bytes_ == rhs.cache_size_bytes_; +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.h new file mode 100644 index 0000000..6e9fe1f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/settings.h @@ -0,0 +1,92 @@ + +/* + * 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_SETTINGS_H_ +#define FIRESTORE_CORE_SRC_API_SETTINGS_H_ + +#include + +namespace firebase { +namespace firestore { +namespace api { + +/** + * Represents settings associated with a FirestoreClient. + * + * PORTING NOTE: We exclude the user callback std::executor in order to avoid + * ownership complexity. + */ +class Settings { + public: + // 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; + static constexpr int64_t MinimumCacheSizeBytes = 1 * 1024 * 1024; + static constexpr int64_t CacheSizeUnlimited = -1; + + Settings() = default; + + void set_host(const std::string& value) { + host_ = value; + } + const std::string& host() const { + return host_; + } + + void set_ssl_enabled(bool value) { + ssl_enabled_ = value; + } + bool ssl_enabled() const { + return ssl_enabled_; + } + + void set_persistence_enabled(bool value) { + persistence_enabled_ = value; + } + bool persistence_enabled() const { + return persistence_enabled_; + } + + void set_cache_size_bytes(int64_t value) { + cache_size_bytes_ = value; + } + int64_t cache_size_bytes() const { + return cache_size_bytes_; + } + bool gc_enabled() const { + return cache_size_bytes_ != CacheSizeUnlimited; + } + + friend bool operator==(const Settings& lhs, const Settings& rhs); + + size_t Hash() const; + + private: + std::string host_ = DefaultHost; + bool ssl_enabled_ = DefaultSslEnabled; + bool persistence_enabled_ = DefaultPersistenceEnabled; + int64_t cache_size_bytes_ = DefaultCacheSizeBytes; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_SETTINGS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc new file mode 100644 index 0000000..a380a33 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc @@ -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. + */ + +#include "Firestore/core/src/api/snapshot_metadata.h" + +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace api { + +bool operator==(const SnapshotMetadata& lhs, const SnapshotMetadata& rhs) { + return lhs.pending_writes_ == rhs.pending_writes_ && + lhs.from_cache_ == rhs.from_cache_; +} + +size_t SnapshotMetadata::Hash() const { + return util::Hash(pending_writes_, from_cache_); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.h new file mode 100644 index 0000000..9965436 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.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_SNAPSHOT_METADATA_H_ +#define FIRESTORE_CORE_SRC_API_SNAPSHOT_METADATA_H_ + +#include + +namespace firebase { +namespace firestore { +namespace api { + +/** Metadata about a snapshot, describing the state of the snapshot. */ +class SnapshotMetadata { + public: + SnapshotMetadata() = default; + SnapshotMetadata(bool pending_writes, bool from_cache) + : pending_writes_(pending_writes), from_cache_(from_cache) { + } + + /** + * Returns true if the snapshot contains the result of local writes (e.g. + * set() or update() calls) that have not yet been committed to the backend. + */ + bool pending_writes() const { + return pending_writes_; + } + + /** + * Returns true if the snapshot was created from cached data rather than + * guaranteed up-to-date server data. + */ + bool from_cache() const { + return from_cache_; + } + + friend bool operator==(const SnapshotMetadata& lhs, + const SnapshotMetadata& rhs); + + size_t Hash() const; + + private: + bool pending_writes_ = false; + bool from_cache_ = false; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_SNAPSHOT_METADATA_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.cc new file mode 100644 index 0000000..debe56b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h new file mode 100644 index 0000000..7c9131b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h @@ -0,0 +1,59 @@ +/* + * 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_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ +#define FIRESTORE_CORE_SRC_API_SNAPSHOTS_IN_SYNC_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 the snapshots-in-sync listener. When a user calls Remove(), + * SnapshotsInSyncListenerRegistration will synchronously mute the listener and + * then send a request to actually unlisten. + */ +class SnapshotsInSyncListenerRegistration : public ListenerRegistration { + public: + SnapshotsInSyncListenerRegistration( + std::shared_ptr client, + std::shared_ptr> async_listener); + + /** + * Removes the listener being tracked by this FIRListenerRegistration. After + * the initial call, subsequent calls have no effect. + */ + 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_; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/source.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/source.h new file mode 100644 index 0000000..3c3c0c2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/source.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. + */ + +#ifndef FIRESTORE_CORE_SRC_API_SOURCE_H_ +#define FIRESTORE_CORE_SRC_API_SOURCE_H_ + +namespace firebase { +namespace firestore { +namespace api { + +/** + * An enum that configures the behavior of `DocumentReference.GetDocument()` and + * `Query.GetDocuments()`. By providing a source enum the `GetDocument[s]` + * methods can be configured to fetch results only from the server, only from + * the local cache, or attempt to fetch results from the server and fall back to + * the cache (which is the default). + * + * See `FIRFirestoreSource` for more details. + */ +enum class Source { Default, Server, Cache }; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_SOURCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc new file mode 100644 index 0000000..2ff4829 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc @@ -0,0 +1,89 @@ +/* + * 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::Precondition; +using util::ThrowIllegalState; +using util::ThrowInvalidArgument; + +void WriteBatch::SetData(const DocumentReference& reference, + core::ParsedSetData&& set_data) { + VerifyNotCommitted(); + ValidateReference(reference); + + mutations_.push_back(std::move(set_data).ToMutation( + reference.key(), model::Precondition::None())); +} + +void WriteBatch::UpdateData(const DocumentReference& reference, + core::ParsedUpdateData&& update_data) { + VerifyNotCommitted(); + ValidateReference(reference); + + mutations_.push_back( + std::move(update_data) + .ToMutation(reference.key(), model::Precondition::Exists(true))); +} + +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 Cloud Firestore " + "instance."); + } +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.h new file mode 100644 index 0000000..8f7397e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_callback.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_callback.h new file mode 100644 index 0000000..2ce01de --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_callback.h @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_CALLBACK_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_CALLBACK_H_ + +#include + +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Interface implemented by components that can apply changes from a bundle to + * local storage. + */ +class BundleCallback { + public: + virtual ~BundleCallback() = default; + + /** + * Applies the documents from a bundle to the "ground-state" (remote) + * documents. + * + * Local documents are re-calculated if there are remaining mutations in the + * queue. + */ + virtual model::DocumentMap ApplyBundledDocuments( + const model::MutableDocumentMap& documents, + const std::string& bundle_id) = 0; + + /** Saves the given NamedQuery to local persistence. */ + virtual void SaveNamedQuery(const NamedQuery& query, + const model::DocumentKeySet& keys) = 0; + + /** Saves the given BundleMetadata to local persistence. */ + virtual void SaveBundle(const BundleMetadata& metadata) = 0; +}; + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_CALLBACK_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_document.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_document.h new file mode 100644 index 0000000..338b3e6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_document.h @@ -0,0 +1,67 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_DOCUMENT_H_ + +#include + +#include "Firestore/core/src/bundle/bundle_element.h" +#include "Firestore/core/src/model/mutable_document.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** Represents a document that was saved to a bundle. */ +class BundleDocument : public BundleElement { + public: + BundleDocument() = default; + + explicit BundleDocument(model::MutableDocument document) + : document_(std::move(document)) { + } + + Type element_type() const override { + return Type::Document; + } + + /** Returns the key for this document. */ + const model::DocumentKey& key() const { + return document_.key(); + } + + /** Returns the document. */ + const model::MutableDocument& document() const { + return document_; + } + + private: + model::MutableDocument document_; +}; + +inline bool operator==(const BundleDocument& lhs, const BundleDocument& rhs) { + return lhs.document() == rhs.document(); +} + +inline bool operator!=(const BundleDocument& lhs, const BundleDocument& rhs) { + return !(lhs == rhs); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_DOCUMENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_element.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_element.h new file mode 100644 index 0000000..5c4ddf4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_element.h @@ -0,0 +1,39 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_ELEMENT_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_ELEMENT_H_ + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Abstract class to give all elements from bundles a common type. + */ +class BundleElement { + public: + enum class Type { Metadata, NamedQuery, DocumentMetadata, Document }; + + virtual ~BundleElement() = default; + + virtual Type element_type() const = 0; +}; + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_ELEMENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.cc new file mode 100644 index 0000000..5f56ddc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.cc @@ -0,0 +1,164 @@ +/* + * Copyright 2021 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/bundle/bundle_loader.h" + +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/api/load_bundle_task.h" +#include "Firestore/core/src/bundle/bundle_document.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/model_fwd.h" +#include "Firestore/core/src/model/mutable_document.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +using firestore::Error; +using firestore::api::LoadBundleTaskProgress; +using firestore::api::LoadBundleTaskState; +using model::DocumentKeySet; +using model::DocumentMap; +using model::MutableDocument; +using util::Status; +using util::StatusOr; + +Status BundleLoader::AddElementInternal(const BundleElement& element) { + HARD_ASSERT(element.element_type() != BundleElement::Type::Metadata, + "Unexpected bundle metadata element."); + + switch (element.element_type()) { + case BundleElement::Type::NamedQuery: { + queries_.push_back(static_cast(element)); + break; + } + + case BundleElement::Type::DocumentMetadata: { + const auto& document_metadata = + static_cast(element); + current_document_ = document_metadata.key(); + documents_metadata_.emplace(document_metadata.key(), document_metadata); + + if (!document_metadata.exists()) { + documents_ = documents_.insert( + document_metadata.key(), + MutableDocument::NoDocument(document_metadata.key(), + document_metadata.read_time())); + current_document_ = absl::nullopt; + } + break; + } + + case BundleElement::Type::Document: { + const auto& document = static_cast(element); + if (!current_document_.has_value() || + document.key() != current_document_.value()) { + return {Status( + Error::kErrorInvalidArgument, + "The document being added does not match the stored metadata.")}; + } + + documents_ = documents_.insert(document.key(), document.document()); + current_document_ = absl::nullopt; + break; + } + + default: + // It is impossible to reach here, because Type::Metadata is checked at + // the beginning of the method. + UNREACHABLE(); + } + + return Status::OK(); +} + +StatusOr> BundleLoader::AddElement( + std::unique_ptr element_ptr, uint64_t byte_size) { + HARD_ASSERT(element_ptr->element_type() != BundleElement::Type::Metadata, + "Unexpected bundle metadata element."); + + auto before_count = documents_.size(); + + auto result = AddElementInternal(*element_ptr); + if (!result.ok()) { + return result; + } + + bytes_loaded_ += byte_size; + + // Document has only been partially loaded, no progress to report. + if (before_count == documents_.size()) { + return {absl::nullopt}; + } + + LoadBundleTaskProgress progress{ + documents_.size(), metadata_.total_documents(), bytes_loaded_, + metadata_.total_bytes(), LoadBundleTaskState::kInProgress}; + return {absl::make_optional(std::move(progress))}; +} + +StatusOr BundleLoader::ApplyChanges() { + if (current_document_ != absl::nullopt) { + return StatusOr( + Status(Error::kErrorInvalidArgument, + "Bundled documents end with a document metadata " + "element instead of a document.")); + } + if (metadata_.total_documents() != documents_.size()) { + return StatusOr( + Status(Error::kErrorInvalidArgument, + "Loaded documents count is not the same as in metadata.")); + } + + auto changes = + callback_->ApplyBundledDocuments(documents_, metadata_.bundle_id()); + auto query_document_map = GetQueryDocumentMapping(); + for (const auto& named_query : queries_) { + const auto& matching_keys = query_document_map[named_query.query_name()]; + callback_->SaveNamedQuery(named_query, matching_keys); + } + + callback_->SaveBundle(metadata_); + + return changes; +} + +std::unordered_map +BundleLoader::GetQueryDocumentMapping() { + std::unordered_map result; + for (const auto& named_query : queries_) { + result.emplace(named_query.query_name(), DocumentKeySet{}); + } + + for (const auto& doc_metadata : documents_metadata_) { + const auto& metadata = doc_metadata.second; + for (const auto& query : doc_metadata.second.queries()) { + auto inserted = result[query].insert(metadata.key()); + result[query] = std::move(inserted); + } + } + + return result; +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.h new file mode 100644 index 0000000..9a0bb02 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_loader.h @@ -0,0 +1,109 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_LOADER_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_LOADER_H_ + +#include +#include +#include +#include +#include +#include + +#include "Firestore/core/src/api/load_bundle_task.h" +#include "Firestore/core/src/bundle/bundle_callback.h" +#include "Firestore/core/src/bundle/bundle_element.h" +#include "Firestore/core/src/bundle/bundled_document_metadata.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +inline api::LoadBundleTaskProgress SuccessProgress( + const bundle::BundleMetadata& metadata) { + return {metadata.total_documents(), metadata.total_documents(), + metadata.total_bytes(), metadata.total_bytes(), + api::LoadBundleTaskState::kSuccess}; +} + +inline api::LoadBundleTaskProgress InitialProgress( + const bundle::BundleMetadata& metadata) { + return {0, metadata.total_documents(), 0, metadata.total_bytes(), + api::LoadBundleTaskState::kInProgress}; +} + +class BundleLoader { + public: + using AddElementResult = + util::StatusOr>; + + BundleLoader(BundleCallback* callback, BundleMetadata metadata) + : callback_(callback), metadata_(std::move(metadata)) { + } + + /** + * Adds an element from the bundle to the loader. + * + * @return a new progress if adding the element leads to a new progress, + * otherwise returns `nullopt`. If an error occurred, returns a not `ok()` + * status. + */ + AddElementResult AddElement(std::unique_ptr element, + uint64_t byte_size); + + /** + * Applies the loaded documents and queries to local store. Returns the + * document view changes. If an error occurred, returns a not `ok()` status. + */ + util::StatusOr ApplyChanges(); + + private: + /** + * @return A map whose keys are the query names in the loading bundle, and + * values are matching document keys. + */ + std::unordered_map + GetQueryDocumentMapping(); + + /** + * Adds the given BundleElement to the internal containers, depending on the + * element type. + */ + util::Status AddElementInternal(const BundleElement& element); + + BundleCallback* callback_ = nullptr; + BundleMetadata metadata_; + std::vector queries_; + std::unordered_map + documents_metadata_; + model::MutableDocumentMap documents_; + + uint64_t bytes_loaded_ = 0; + absl::optional current_document_; +}; + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_LOADER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_metadata.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_metadata.h new file mode 100644 index 0000000..0cf27f0 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_metadata.h @@ -0,0 +1,118 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_METADATA_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_METADATA_H_ + +#include +#include +#include + +#include "Firestore/core/src/bundle/bundle_element.h" +#include "Firestore/core/src/model/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Represents Firestore bundle metadata saved by the SDK in its local storage. + */ +class BundleMetadata : public BundleElement { + public: + BundleMetadata() = default; + + BundleMetadata(std::string bundle_id, + int version, + model::SnapshotVersion create_time) + : bundle_id_(std::move(bundle_id)), + version_(version), + create_time_(create_time) { + } + + BundleMetadata(std::string bundle_id, + int version, + model::SnapshotVersion create_time, + uint32_t total_documents, + uint64_t total_bytes) + : bundle_id_(std::move(bundle_id)), + version_(version), + create_time_(create_time), + total_documents_(total_documents), + total_bytes_(total_bytes) { + } + + Type element_type() const override { + return Type::Metadata; + } + + /** + * @return The ID of the bundle. It is used together with `create_time()` to + * determine if a bundle has been loaded by the SDK. + */ + const std::string& bundle_id() const { + return bundle_id_; + } + + /** + * @return The schema version of the bundle. + */ + uint32_t version() const { + return version_; + } + + /** + * @return The snapshot version of the bundle when created by the server SDKs. + */ + model::SnapshotVersion create_time() const { + return create_time_; + } + + /** @return The number of documents in the bundle. */ + uint32_t total_documents() const { + return total_documents_; + } + + /** @return The number of bytes of the bundle. */ + uint64_t total_bytes() const { + return total_bytes_; + } + + private: + std::string bundle_id_; + uint32_t version_ = 0; + model::SnapshotVersion create_time_; + + uint32_t total_documents_ = 0; + uint64_t total_bytes_ = 0; +}; + +inline bool operator==(const BundleMetadata& lhs, const BundleMetadata& rhs) { + return lhs.bundle_id() == rhs.bundle_id() && lhs.version() == rhs.version() && + lhs.create_time() == rhs.create_time() && + lhs.total_documents() == rhs.total_documents() && + lhs.total_bytes() == rhs.total_bytes(); +} + +inline bool operator!=(const BundleMetadata& lhs, const BundleMetadata& rhs) { + return !(lhs == rhs); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_METADATA_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.cc new file mode 100644 index 0000000..2f087aa --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.cc @@ -0,0 +1,171 @@ +/* + * Copyright 2021 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/bundle/bundle_reader.h" + +#include + +#include "absl/memory/memory.h" +#include "absl/strings/numbers.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +using nlohmann::json; +using util::ByteStream; +using util::StreamReadResult; + +namespace { + +json Parse(absl::string_view s) { + return json::parse(s.begin(), s.end(), /*callback=*/nullptr, + /*allow_exceptions=*/false); +} + +} // namespace + +BundleReader::BundleReader(BundleSerializer serializer, + std::unique_ptr input) + : serializer_(std::move(serializer)), input_(std::move(input)) { +} + +BundleMetadata BundleReader::GetBundleMetadata() { + if (metadata_loaded_) { + return metadata_; + } + + std::unique_ptr element = ReadNextElement(); + if (!element || element->element_type() != BundleElement::Type::Metadata) { + Fail("Failed to get bundle metadata"); + return {}; + } + + metadata_loaded_ = true; + metadata_ = static_cast(*element); + return metadata_; +} + +std::unique_ptr BundleReader::GetNextElement() { + // Makes sure metadata is read before proceeding. The metadata element is the + // first element in the bundle stream. + GetBundleMetadata(); + return ReadNextElement(); +} + +std::unique_ptr BundleReader::ReadNextElement() { + auto length_prefix = ReadLengthPrefix(); + if (!length_prefix.has_value()) { + return nullptr; + } + + size_t prefix_value = 0; + auto ok = absl::SimpleAtoi(length_prefix.value(), &prefix_value); + if (!ok) { + Fail("Prefix string is not a valid number"); + return nullptr; + } + + buffer_.clear(); + ReadJsonToBuffer(prefix_value); + if (!reader_status_.ok()) { + return nullptr; + } + + // metadata's size does not count in `bytes_read_`. + if (metadata_loaded_) { + bytes_read_ += length_prefix.value().size() + buffer_.size(); + } + auto result = DecodeBundleElementFromBuffer(); + reader_status_.Update(json_reader_.status()); + + return result; +} + +absl::optional BundleReader::ReadLengthPrefix() { + // length string of size 16 indicates an element about 1PB, which is + // impossible for valid bundles. + StreamReadResult result = input_->ReadUntil('{', 16); + if (!result.ok()) { + reader_status_.Update(result.status()); + return absl::nullopt; + } + + // Underlying stream is closed, and there happens to be no more data to + // process. + if (result.eof() && result.ValueOrDie().empty()) { + return absl::nullopt; + } + + return absl::make_optional(std::move(result).ValueOrDie()); +} + +void BundleReader::ReadJsonToBuffer(size_t required_size) { + if (!reader_status_.ok()) { + return; + } + while (buffer_.size() < required_size) { + // Read at most 1024 bytes every time, to avoid allocating a huge buffer + // when corruption leads to large `required_size`. + auto size = std::min(1024ul, required_size - buffer_.size()); + StreamReadResult result = input_->Read(size); + if (!result.ok()) { + reader_status_.Update(result.status()); + return; + } + bool eof = result.eof(); + buffer_.append(std::move(result).ValueOrDie()); + if (eof) { + break; + } + } + + if (buffer_.size() < required_size) { + Fail("Available input string is smaller than what length prefix indicates"); + } +} + +std::unique_ptr BundleReader::DecodeBundleElementFromBuffer() { + auto json_object = Parse(buffer_); + if (json_object.is_discarded()) { + Fail("Failed to parse string into json"); + return nullptr; + } + + if (json_object.contains("metadata")) { + return absl::make_unique(serializer_.DecodeBundleMetadata( + json_reader_, json_object.at("metadata"))); + } else if (json_object.contains("namedQuery")) { + auto q = serializer_.DecodeNamedQuery(json_reader_, + json_object.at("namedQuery")); + return absl::make_unique(std::move(q)); + } else if (json_object.contains("documentMetadata")) { + return absl::make_unique( + serializer_.DecodeDocumentMetadata(json_reader_, + json_object.at("documentMetadata"))); + } else if (json_object.contains("document")) { + return absl::make_unique( + serializer_.DecodeDocument(json_reader_, json_object.at("document"))); + } else { + Fail("Unrecognized BundleElement"); + return nullptr; + } +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.h new file mode 100644 index 0000000..81a9d7d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_reader.h @@ -0,0 +1,134 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_READER_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_READER_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/bundle_serializer.h" +#include "Firestore/core/src/util/byte_stream.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Reads the length-prefixed JSON stream for Bundles. + * + * The class takes a bundle stream and presents abstractions to read bundled + * elements out of the underlying content. + */ +class BundleReader { + public: + BundleReader(BundleSerializer serializer, + std::unique_ptr input); + + /** + * Returns the metadata element from the bundle. + * + * Caches the result when first called, and returns the cached result in the + * following calls. + */ + BundleMetadata GetBundleMetadata(); + + /** + * Returns the next element from the bundle. Metadata elements can be accessed + * by `GetBundleMetadata`, they are not returned from this method. + * + * When there is no more element to return, a `nullptr` is returned. Check + * `reader_status()` to see if it is due to the completion of bundle (status + * will be `ok()`), or an error. + */ + std::unique_ptr GetNextElement(); + + /** Returns whether this instance is in good state. */ + const util::Status& reader_status() const { + return reader_status_; + } + + /** Sets this instance to a failed state. */ + void Fail(std::string msg) { + reader_status_.Update(util::Status(Error::kErrorDataLoss, std::move(msg))); + } + + /** How many bytes have we read from the bundle. */ + int64_t bytes_read() const { + return bytes_read_; + } + + private: + /** + * Reads from the head of internal buffer, pulls more data from underlying + * stream until a complete element is found (including the prefixed length and + * the JSON string). + * + * Once a complete element is read, it is dropped from internal buffer. + * + * Returns either the bundled element, or null if we have reached the end of + * the stream. + */ + std::unique_ptr ReadNextElement(); + + /** + * Reads the length prefix string from bundle stream. Returns `nullopt` when + * at the end of stream. + * + * The string representing a length prefix is whatever string we have from + * the `input_` until the next character is a "{" (start of JSON element). + * So calling this a second time will return an empty string. + */ + absl::optional ReadLengthPrefix(); + + /** + * Reads `required_size` number of chars from stream into internal `buffer_`. + */ + void ReadJsonToBuffer(size_t required_size); + + /** + * Decodes internal `buffer_` into a `BundleElement`, returned as a unique_ptr + * pointing to the element. Returns nullptr if fails. + * + * Note this method will leave `buffer_` unchanged. + */ + std::unique_ptr DecodeBundleElementFromBuffer(); + + BundleSerializer serializer_; + JsonReader json_reader_; + + // Input stream holding bundle data. + std::unique_ptr input_; + + // Cached bundle metadata. + BundleMetadata metadata_; + bool metadata_loaded_ = false; + + // Internal buffer, cleared every time a complete element is parsed from this. + std::string buffer_; + + util::Status reader_status_; + int64_t bytes_read_ = 0; +}; + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_READER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.cc new file mode 100644 index 0000000..6a64f21 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.cc @@ -0,0 +1,812 @@ +/* + * Copyright 2021 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 Requiredd by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/bundle/bundle_serializer.h" + +#include +#include + +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/direction.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/order_by.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/value_util.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/timestamp_internal.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" +#include "Firestore/core/src/util/string_util.h" +#include "absl/strings/escaping.h" +#include "absl/strings/numbers.h" +#include "absl/time/time.h" + +namespace firebase { +namespace firestore { +namespace bundle { +namespace { + +using absl::Time; +using core::Bound; +using core::Direction; +using core::FieldFilter; +using core::Filter; +using core::FilterList; +using core::LimitType; +using core::OrderBy; +using core::OrderByList; +using core::Target; +using model::Document; +using model::DocumentKey; +using model::FieldPath; +using model::MutableDocument; +using model::NaNValue; +using model::NullValue; +using model::ObjectValue; +using model::ResourcePath; +using model::SnapshotVersion; +using nanopb::ByteString; +using nanopb::MakeSharedMessage; +using nanopb::Message; +using nanopb::SetRepeatedField; +using nanopb::SharedMessage; +using nlohmann::json; +using util::StatusOr; +using util::StringFormat; + +template +const std::vector& EmptyVector() { + static auto* empty = new std::vector; + return *empty; +} + +Timestamp DecodeTimestamp(JsonReader& reader, const json& version) { + StatusOr decoded; + if (version.is_string()) { + Time time; + std::string err; + bool ok = absl::ParseTime( + absl::RFC3339_full, version.get_ref(), &time, &err); + if (ok) { + decoded = TimestampInternal::FromUntrustedTime(time); + } else { + reader.Fail("Parsing timestamp failed with error: " + err); + return {}; + } + } else { + decoded = TimestampInternal::FromUntrustedSecondsAndNanos( + reader.RequiredInt("seconds", version), + reader.RequiredInt("nanos", version)); + } + + if (!decoded.ok()) { + reader.Fail( + "Failed to decode json into valid protobuf Timestamp with error '%s'", + decoded.status().error_message()); + return {}; + } + return decoded.ConsumeValueOrDie(); +} + +SnapshotVersion DecodeSnapshotVersion(JsonReader& reader, const json& version) { + return SnapshotVersion(DecodeTimestamp(reader, version)); +} + +void VerifyStructuredQuery(JsonReader& reader, const json& query) { + if (!query.is_object()) { + reader.Fail("'structuredQuery' is not an object as expected."); + return; + } + if (query.contains("select")) { + reader.Fail( + "Queries with 'select' statements are not supported in bundles"); + return; + } + if (!query.contains("from")) { + reader.Fail("Query does not have a 'from' collection"); + return; + } + if (query.contains("offset")) { + reader.Fail("Queries with 'offset' are not supported in bundles"); + return; + } +} + +/** + * Decodes a json object into the given `parent` and `group` reference. + * + * Specifically, if the given `from_json` is for a collection group query, its + * collection id will be decoded into `group`; otherwise, the collection id will + * be appended to `parent`. + */ +void DecodeCollectionSource(JsonReader& reader, + const json& from_json, + ResourcePath& parent, + std::string& group) { + const auto& from = from_json.get_ref&>(); + if (from.size() != 1) { + reader.Fail( + "Only queries with a single 'from' clause are supported by the SDK"); + return; + } + const auto& collection_selector = from.at(0); + const auto& collection_id = + reader.RequiredString("collectionId", collection_selector); + bool all_descendants = + reader.OptionalBool("allDescendants", collection_selector); + + if (all_descendants) { + group = collection_id; + } else { + parent = parent.Append(collection_id); + } +} + +FieldPath DecodeFieldReference(JsonReader& reader, const json& field) { + if (!field.is_object()) { + reader.Fail("'field' should be an json object, but it is not"); + return {}; + } + + const auto& field_path = reader.RequiredString("fieldPath", field); + auto result = FieldPath::FromServerFormat(field_path); + + if (!result.ok()) { + reader.set_status(result.status()); + return {}; + } else { + return result.ConsumeValueOrDie(); + } +} + +Filter::Operator DecodeFieldFilterOperator(JsonReader& reader, + const std::string& op) { + if (op == "LESS_THAN") { + return Filter::Operator::LessThan; + } else if (op == "LESS_THAN_OR_EQUAL") { + return Filter::Operator::LessThanOrEqual; + } else if (op == "EQUAL") { + return Filter::Operator::Equal; + } else if (op == "NOT_EQUAL") { + return Filter::Operator::NotEqual; + } else if (op == "GREATER_THAN") { + return Filter::Operator::GreaterThan; + } else if (op == "GREATER_THAN_OR_EQUAL") { + return Filter::Operator::GreaterThanOrEqual; + } else if (op == "ARRAY_CONTAINS") { + return Filter::Operator::ArrayContains; + } else if (op == "IN") { + return Filter::Operator::In; + } else if (op == "ARRAY_CONTAINS_ANY") { + return Filter::Operator::ArrayContainsAny; + } else if (op == "NOT_IN") { + return Filter::Operator::NotIn; + } else { + reader.Fail("Operator in filter is not valid: " + op); + // We have to return something. + return Filter::Operator::Equal; + } +} + +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. + return FieldFilter::Create({}, {}, + MakeSharedMessage(google_firestore_v1_Value{})); +} + +Filter DecodeUnaryFilter(JsonReader& reader, const json& filter) { + FieldPath path = + DecodeFieldReference(reader, reader.RequiredObject("field", filter)); + std::string op = reader.RequiredString("op", filter); + + // Return early if !ok(), because `FieldFilter::Create` will abort with + // invalid inputs. + if (!reader.ok()) { + return InvalidFilter(); + } + + if (op == "IS_NAN") { + return FieldFilter::Create(path, Filter::Operator::Equal, NaNValue()); + } else if (op == "IS_NULL") { + return FieldFilter::Create(path, Filter::Operator::Equal, NullValue()); + } else if (op == "IS_NOT_NAN") { + return FieldFilter::Create(path, Filter::Operator::NotEqual, NaNValue()); + } else if (op == "IS_NOT_NULL") { + return FieldFilter::Create(path, Filter::Operator::NotEqual, NullValue()); + } + + reader.Fail("Unexpected unary filter operator: " + op); + return InvalidFilter(); +} + +OrderByList DecodeOrderBy(JsonReader& reader, const json& query) { + OrderByList result; + std::vector default_order_by; + for (const auto& order_by : + reader.OptionalArray("orderBy", query, default_order_by)) { + FieldPath path = + DecodeFieldReference(reader, reader.RequiredObject("field", order_by)); + + std::string direction_string = + reader.OptionalString("direction", order_by, "ASCENDING"); + if (direction_string != "DESCENDING" && direction_string != "ASCENDING") { + reader.Fail("'direction' value is invalid: " + direction_string); + return {}; + } + + Direction direction = direction_string == "ASCENDING" + ? Direction::Ascending + : Direction::Descending; + + result = result.push_back(OrderBy(std::move(path), direction)); + } + + return result; +} + +int32_t DecodeLimit(JsonReader& reader, const json& query) { + int32_t limit = Target::kNoLimit; + if (query.contains("limit")) { + const auto& limit_object = query.at("limit"); + // "limit" can be encoded as integer or "{"value": integer}". + if (limit_object.is_number_integer()) { + return limit_object.get(); + } else if (limit_object.is_object()) { + if (limit_object.at("value").is_number_integer()) { + return limit_object.at("value").get(); + } + } + reader.Fail("'limit' is not encoded as a valid integer"); + return limit; + } + + return limit; +} + +LimitType DecodeLimitType(JsonReader& reader, const json& query) { + std::string limit_type = reader.OptionalString("limitType", query, "FIRST"); + + if (limit_type == "FIRST") { + return LimitType::First; + } else if (limit_type == "LAST") { + return LimitType::Last; + } else { + reader.Fail("'limitType' is not encoded as a recognizable value"); + return LimitType::None; + } +} + +google_type_LatLng DecodeGeoPointValue(JsonReader& reader, + const json& geo_json) { + google_type_LatLng result{}; + result.latitude = reader.OptionalDouble("latitude", geo_json, 0.0); + result.longitude = reader.OptionalDouble("longitude", geo_json, 0.0); + return result; +} + +pb_bytes_array_t* DecodeBytesValue(JsonReader& reader, + const std::string& bytes_string) { + std::string decoded; + if (!absl::Base64Unescape(bytes_string, &decoded)) { + reader.Fail("Failed to decode bytesValue string into binary form"); + return {}; + } + return nanopb::MakeBytesArray(decoded); +} + +} // namespace + +// Mark: JsonReader + +const std::string& JsonReader::RequiredString(const char* name, + const json& json_object) { + if (json_object.contains(name)) { + const json& child = json_object.at(name); + if (child.is_string()) { + return child.get_ref(); + } + } + + Fail("'%s' is missing or is not a string", name); + return util::EmptyString(); +} + +const std::string& JsonReader::OptionalString( + const char* name, + const json& json_object, + const std::string& default_value) { + if (json_object.contains(name)) { + const json& child = json_object.at(name); + if (child.is_string()) { + return child.get_ref(); + } + } + + return default_value; +} + +const std::vector& JsonReader::RequiredArray(const char* name, + const json& json_object) { + if (json_object.contains(name)) { + const json& child = json_object.at(name); + if (child.is_array()) { + return child.get_ref&>(); + } + } + + Fail("'%s' is missing or is not an array", name); + return EmptyVector(); +} + +const std::vector& JsonReader::OptionalArray( + const char* name, + const json& json_object, + const std::vector& default_value) { + if (!json_object.contains(name)) { + return default_value; + } + + const json& child = json_object.at(name); + if (child.is_array()) { + return child.get_ref&>(); + } else { + Fail("'%s' is not an array", name); + return EmptyVector(); + } +} + +bool JsonReader::OptionalBool(const char* name, + const json& json_object, + bool default_value) { + return (json_object.contains(name) && json_object.at(name).is_boolean() && + json_object.at(name).get()) || + default_value; +} + +const nlohmann::json& JsonReader::RequiredObject(const char* child_name, + const json& json_object) { + if (!json_object.contains(child_name)) { + Fail("Missing child '%s'", child_name); + return json_object; + } + return json_object.at(child_name); +} + +double JsonReader::RequiredDouble(const char* name, const json& json_object) { + if (json_object.contains(name)) { + double result = DecodeDouble(json_object.at(name)); + if (ok()) { + return result; + } + } + + Fail("'%s' is missing or is not a double", name); + return 0.0; +} + +double JsonReader::OptionalDouble(const char* name, + const json& json_object, + double default_value) { + if (json_object.contains(name)) { + double result = DecodeDouble(json_object.at(name)); + if (ok()) { + return result; + } + } + + return default_value; +} + +double JsonReader::DecodeDouble(const nlohmann::json& value) { + if (value.is_number()) { + return value.get(); + } + + double result = 0; + if (value.is_string()) { + const auto& s = value.get_ref(); + auto ok = absl::SimpleAtod(s, &result); + if (!ok) { + Fail("Failed to parse into double: " + s); + } + } + return result; +} + +template +IntType ParseInt(const json& value, JsonReader& reader) { + if (value.is_number_integer()) { + return value.get(); + } + + IntType result = 0; + if (value.is_string()) { + const auto& s = value.get_ref(); + auto ok = absl::SimpleAtoi(s, &result); + if (!ok) { + reader.Fail("Failed to parse into integer: " + s); + return 0; + } + + return result; + } + + reader.Fail("Only integer and string can be parsed into int type"); + return 0; +} + +template +IntType JsonReader::RequiredInt(const char* name, const json& json_object) { + if (!json_object.contains(name)) { + Fail("'%s' is missing or is not a double", name); + return 0; + } + + const json& value = json_object.at(name); + return ParseInt(value, *this); +} + +template +IntType JsonReader::OptionalInt(const char* name, + const json& json_object, + IntType default_value) { + if (!json_object.contains(name)) { + return default_value; + } + + const json& value = json_object.at(name); + return ParseInt(value, *this); +} + +// Mark: BundleSerializer + +BundleMetadata BundleSerializer::DecodeBundleMetadata( + JsonReader& reader, const json& metadata) const { + return BundleMetadata( + reader.RequiredString("id", metadata), + reader.RequiredInt("version", metadata), + DecodeSnapshotVersion(reader, + reader.RequiredObject("createTime", metadata)), + reader.OptionalInt("totalDocuments", metadata, 0), + reader.OptionalInt("totalBytes", metadata, 0)); +} + +NamedQuery BundleSerializer::DecodeNamedQuery(JsonReader& reader, + const json& named_query) const { + return NamedQuery( + reader.RequiredString("name", named_query), + DecodeBundledQuery(reader, + reader.RequiredObject("bundledQuery", named_query)), + DecodeSnapshotVersion(reader, + reader.RequiredObject("readTime", named_query))); +} + +BundledQuery BundleSerializer::DecodeBundledQuery( + JsonReader& reader, const nlohmann::json& query) const { + const json& structured_query = + reader.RequiredObject("structuredQuery", query); + VerifyStructuredQuery(reader, structured_query); + if (!reader.ok()) { + return {}; + } + + ResourcePath parent = + DecodeName(reader, reader.RequiredObject("parent", query)); + std::string collection_group_string; + DecodeCollectionSource(reader, structured_query.at("from"), parent, + collection_group_string); + std::shared_ptr collection_group; + if (!collection_group_string.empty()) { + collection_group = std::make_shared(collection_group_string); + } + + auto filters = DecodeWhere(reader, structured_query); + auto order_bys = DecodeOrderBy(reader, structured_query); + + auto start_at_bound = DecodeBound(reader, structured_query, "startAt"); + absl::optional start_at; + if (start_at_bound.position()->values_count > 0) { + start_at = std::move(start_at_bound); + } + + auto end_at_bound = DecodeBound(reader, structured_query, "endAt"); + absl::optional end_at; + if (end_at_bound.position()->values_count > 0) { + end_at = std::move(end_at_bound); + } + + int32_t limit = DecodeLimit(reader, structured_query); + LimitType limit_type = DecodeLimitType(reader, query); + + return BundledQuery(Target(std::move(parent), std::move(collection_group), + std::move(filters), std::move(order_bys), limit, + std::move(start_at), std::move(end_at)), + limit_type); +} + +ResourcePath BundleSerializer::DecodeName(JsonReader& reader, + const json& document_name) const { + if (!document_name.is_string()) { + reader.Fail("Document name is not a string."); + return {}; + } + auto path = + ResourcePath::FromString(document_name.get_ref()); + if (!rpc_serializer_.IsLocalResourceName(path)) { + reader.Fail("Resource name is not valid for current instance: " + + path.CanonicalString()); + return {}; + } + return path.PopFirst(5); +} + +FilterList BundleSerializer::DecodeWhere(JsonReader& reader, + const json& query) const { + // Absent 'where' is a valid case. + if (!query.contains("where")) { + return {}; + } + + const auto& where = query.at("where"); + if (!where.is_object()) { + reader.Fail("Query's 'where' clause is not a json object."); + return {}; + } + + FilterList result; + if (where.contains("compositeFilter")) { + return DecodeCompositeFilter(reader, where.at("compositeFilter")); + } else if (where.contains("fieldFilter")) { + return result.push_back(DecodeFieldFilter(reader, where.at("fieldFilter"))); + } else if (where.contains("unaryFilter")) { + return result.push_back(DecodeUnaryFilter(reader, where.at("unaryFilter"))); + } else { + reader.Fail("'where' does not have valid filter"); + return {}; + } +} + +Filter BundleSerializer::DecodeFieldFilter(JsonReader& reader, + const json& filter) const { + FieldPath path = + DecodeFieldReference(reader, reader.RequiredObject("field", filter)); + + const auto& op_string = reader.RequiredString("op", filter); + auto op = DecodeFieldFilterOperator(reader, op_string); + + Message value = + DecodeValue(reader, reader.RequiredObject("value", filter)); + + // Return early if !ok(), because `FieldFilter::Create` will abort with + // invalid inputs. + if (!reader.ok()) { + return InvalidFilter(); + } + + return FieldFilter::Create(path, op, std::move(value)); +} + +FilterList BundleSerializer::DecodeCompositeFilter(JsonReader& reader, + const json& filter) const { + if (reader.RequiredString("op", filter) != "AND") { + reader.Fail("The SDK only supports composite filters of type 'AND'"); + return {}; + } + + auto filters = reader.RequiredArray("filters", filter); + FilterList result; + for (const auto& f : filters) { + result = result.push_back( + DecodeFieldFilter(reader, reader.RequiredObject("fieldFilter", f))); + if (!reader.ok()) { + return {}; + } + } + + return result; +} + +Bound BundleSerializer::DecodeBound(JsonReader& reader, + const json& query, + const char* bound_name) const { + Bound default_bound = Bound::FromValue( + MakeSharedMessage({}), false); + if (!query.contains(bound_name)) { + return default_bound; + } + + const json& bound_json = reader.RequiredObject(bound_name, query); + std::vector values = reader.RequiredArray("values", bound_json); + bool before = reader.OptionalBool("before", bound_json); + + auto positions = MakeSharedMessage({}); + SetRepeatedField( + &positions->values, &positions->values_count, values, + [&](const json& j) { return *DecodeValue(reader, j).release(); }); + return Bound::FromValue(std::move(positions), before); +} + +Message BundleSerializer::DecodeValue( + JsonReader& reader, const json& value) const { + if (!value.is_object()) { + reader.Fail("'value' is not encoded as JSON object"); + return {}; + } + + Message result; + if (value.contains("nullValue")) { + result->which_value_type = google_firestore_v1_Value_null_value_tag; + result->null_value = {}; + } else if (value.contains("booleanValue")) { + result->which_value_type = google_firestore_v1_Value_boolean_value_tag; + auto val = value.at("booleanValue"); + if (!val.is_boolean()) { + reader.Fail("'booleanValue' is not encoded as a valid boolean"); + return {}; + } + result->boolean_value = val.get(); + } else if (value.contains("integerValue")) { + result->which_value_type = google_firestore_v1_Value_integer_value_tag; + result->integer_value = reader.RequiredInt("integerValue", value); + } else if (value.contains("doubleValue")) { + result->which_value_type = google_firestore_v1_Value_double_value_tag; + result->double_value = reader.RequiredDouble("doubleValue", value); + } else if (value.contains("timestampValue")) { + auto val = DecodeTimestamp(reader, value.at("timestampValue")); + result->which_value_type = google_firestore_v1_Value_timestamp_value_tag; + result->timestamp_value.seconds = val.seconds(); + result->timestamp_value.nanos = val.nanoseconds(); + } else if (value.contains("stringValue")) { + result->which_value_type = google_firestore_v1_Value_string_value_tag; + result->string_value = + nanopb::MakeBytesArray(reader.RequiredString("stringValue", value)); + } else if (value.contains("bytesValue")) { + result->which_value_type = google_firestore_v1_Value_bytes_value_tag; + result->bytes_value = + DecodeBytesValue(reader, reader.RequiredString("bytesValue", value)); + } else if (value.contains("referenceValue")) { + result->which_value_type = google_firestore_v1_Value_reference_value_tag; + result->reference_value = DecodeReferenceValue( + reader, reader.RequiredString("referenceValue", value)); + } else if (value.contains("geoPointValue")) { + result->which_value_type = google_firestore_v1_Value_geo_point_value_tag; + result->geo_point_value = + DecodeGeoPointValue(reader, value.at("geoPointValue")); + } else if (value.contains("arrayValue")) { + result->which_value_type = google_firestore_v1_Value_array_value_tag; + result->array_value = + *DecodeArrayValue(reader, value.at("arrayValue")).release(); + } else if (value.contains("mapValue")) { + result->which_value_type = google_firestore_v1_Value_map_value_tag; + result->map_value = *DecodeMapValue(reader, value.at("mapValue")).release(); + } else { + reader.Fail("Failed to decode value, no type is recognized"); + return {}; + } + return result; +} + +Message BundleSerializer::DecodeMapValue( + JsonReader& reader, const json& map_json) const { + if (!map_json.is_object() || !map_json.contains("fields")) { + reader.Fail("mapValue is not a valid map"); + return {}; + } + const auto& fields = map_json.at("fields"); + if (!fields.is_object()) { + reader.Fail("mapValue's 'field' is not a valid map"); + return {}; + } + + // Fill the map array. Note that we can't use SetRepeatedField here since the + // JSON map doesn't currently work with SetRepeatedField. + Message map_value; + map_value->fields_count = nanopb::CheckedSize(fields.size()); + map_value->fields = + nanopb::MakeArray( + map_value->fields_count); + pb_size_t i = 0; + for (const auto& entry : fields.items()) { + map_value->fields[i] = {nanopb::MakeBytesArray(entry.key()), + *DecodeValue(reader, entry.value()).release()}; + ++i; + } + return map_value; +} + +Message BundleSerializer::DecodeArrayValue( + JsonReader& reader, const json& array_json) const { + const auto& values = reader.RequiredArray("values", array_json); + + Message array_value; + SetRepeatedField( + &array_value->values, &array_value->values_count, values, + [&](const json& j) { return *DecodeValue(reader, j).release(); }); + return array_value; +} + +pb_bytes_array_t* BundleSerializer::DecodeReferenceValue( + JsonReader& reader, const std::string& ref_string) const { + if (reader.ok() && !rpc_serializer_.IsLocalDocumentKey(ref_string)) { + reader.Fail( + StringFormat("Tried to deserialize an invalid key: %s", ref_string)); + } + + return nanopb::MakeBytesArray(ref_string); +} + +BundledDocumentMetadata BundleSerializer::DecodeDocumentMetadata( + JsonReader& reader, const json& document_metadata) const { + ResourcePath path = + DecodeName(reader, reader.RequiredObject("name", document_metadata)); + // Return early if !ok(), `DocumentKey` aborts with invalid inputs. + if (!reader.ok()) { + return {}; + } + DocumentKey key = DocumentKey(path); + + SnapshotVersion read_time = DecodeSnapshotVersion( + reader, reader.RequiredObject("readTime", document_metadata)); + + bool exists = reader.OptionalBool("exists", document_metadata); + + std::vector queries; + std::vector default_queries; + for (const json& query : + reader.OptionalArray("queries", document_metadata, default_queries)) { + if (!query.is_string()) { + reader.Fail("Query name should be encoded as string"); + return {}; + } + + queries.push_back(query.get()); + } + + return BundledDocumentMetadata(std::move(key), read_time, exists, + std::move(queries)); +} + +BundleDocument BundleSerializer::DecodeDocument(JsonReader& reader, + const json& document) const { + ResourcePath path = + DecodeName(reader, reader.RequiredObject("name", document)); + // Return early if !ok(), `DocumentKey` aborts with invalid inputs. + if (!reader.ok()) { + return {}; + } + DocumentKey key = DocumentKey(path); + + SnapshotVersion update_time = DecodeSnapshotVersion( + reader, reader.RequiredObject("updateTime", document)); + + auto map_value = DecodeMapValue(reader, document); + + return BundleDocument(MutableDocument::FoundDocument( + std::move(key), update_time, + ObjectValue::FromMapValue(std::move(map_value)))); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.h new file mode 100644 index 0000000..d4ae533 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundle_serializer.h @@ -0,0 +1,139 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLE_SERIALIZER_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_SERIALIZER_H_ + +#include +#include +#include + +#include "Firestore/core/src/bundle/bundle_document.h" +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/bundled_document_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/remote/serializer.h" +#include "Firestore/core/src/util/read_context.h" +#include "Firestore/third_party/nlohmann_json/json.hpp" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Provides the ability to report failure cases by inheriting `ReadContext`, and + * checks and reads json object into specified types. + * + * `Required*` methods check the existence of the given name and compatibility + * of its value (can it be read into the given type?). They fail the reader if + * any of the checks fail, otherwise return the read value. + * + * `Optional*` methods check the existence of the given name, and return a + * specified default value if the name does not exist. They then check + * compatibility of its value, fail the reader if that check fails, or return + * the read value if it succeeds. + */ +class JsonReader : public util::ReadContext { + public: + const std::string& RequiredString(const char* name, + const nlohmann::json& json_object); + const std::string& OptionalString(const char* name, + const nlohmann::json& json_object, + const std::string& default_value); + + const std::vector& RequiredArray( + const char* name, const nlohmann::json& json_object); + const std::vector& OptionalArray( + const char* name, + const nlohmann::json& json_object, + const std::vector& default_value); + const nlohmann::json& RequiredObject(const char* child_name, + const nlohmann::json& json_object); + + double RequiredDouble(const char* name, const nlohmann::json& json_object); + double OptionalDouble(const char* name, + const nlohmann::json& json_object, + double default_value = 0); + + template + IntType RequiredInt(const char* name, const nlohmann::json& json_object); + + template + IntType OptionalInt(const char* name, + const nlohmann::json& json_object, + IntType default_value); + + static bool OptionalBool(const char* name, + const nlohmann::json& json_object, + bool default_value = false); + + private: + double DecodeDouble(const nlohmann::json& value); +}; + +/** A JSON serializer to deserialize Firestore Bundles. */ +class BundleSerializer { + public: + explicit BundleSerializer(remote::Serializer serializer) + : rpc_serializer_(std::move(serializer)) { + } + BundleMetadata DecodeBundleMetadata(JsonReader& reader, + const nlohmann::json& metadata) const; + + NamedQuery DecodeNamedQuery(JsonReader& reader, + const nlohmann::json& named_query) const; + + BundledDocumentMetadata DecodeDocumentMetadata( + JsonReader& reader, const nlohmann::json& document_metadata) const; + + BundleDocument DecodeDocument(JsonReader& reader, + const nlohmann::json& document) const; + + private: + BundledQuery DecodeBundledQuery(JsonReader& reader, + const nlohmann::json& query) const; + core::FilterList DecodeWhere(JsonReader& reader, + const nlohmann::json& query) const; + core::Filter DecodeFieldFilter(JsonReader& reader, + const nlohmann::json& filter) const; + core::FilterList DecodeCompositeFilter(JsonReader& reader, + const nlohmann::json& filter) const; + nanopb::Message DecodeValue( + JsonReader& reader, const nlohmann::json& value) const; + core::Bound DecodeBound(JsonReader& reader, + const nlohmann::json& query, + const char* bound_name) const; + model::ResourcePath DecodeName(JsonReader& reader, + const nlohmann::json& name) const; + nanopb::Message DecodeArrayValue( + JsonReader& reader, const nlohmann::json& array_json) const; + nanopb::Message DecodeMapValue( + JsonReader& reader, const nlohmann::json& map_json) const; + pb_bytes_array_t* DecodeReferenceValue(JsonReader& reader, + const std::string& ref_string) const; + + remote::Serializer rpc_serializer_; +}; + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLE_SERIALIZER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_document_metadata.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_document_metadata.h new file mode 100644 index 0000000..a50c976 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_document_metadata.h @@ -0,0 +1,95 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLED_DOCUMENT_METADATA_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLED_DOCUMENT_METADATA_H_ + +#include +#include +#include + +#include "Firestore/core/src/bundle/bundle_element.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** Metadata describing a Firestore document saved in the bundle. */ +class BundledDocumentMetadata : public BundleElement { + public: + BundledDocumentMetadata() = default; + + BundledDocumentMetadata(model::DocumentKey key, + model::SnapshotVersion read_time, + bool exists, + std::vector queries) + : key_(std::move(key)), + read_time_(read_time), + exists_(exists), + queries_(std::move(queries)) { + } + + Type element_type() const override { + return Type::DocumentMetadata; + } + + /** Returns the document key of a bundled document. */ + const model::DocumentKey& key() const { + return key_; + } + + /** Returns the snapshot version of the document data bundled. */ + const model::SnapshotVersion& read_time() const { + return read_time_; + } + + /** Returns whether the document exists. */ + bool exists() const { + return exists_; + } + + /** + * Returns the names of the queries in this bundle that this document matches + * to. + */ + const std::vector& queries() const { + return queries_; + } + + private: + model::DocumentKey key_; + model::SnapshotVersion read_time_; + bool exists_ = false; + std::vector queries_; +}; + +inline bool operator==(const BundledDocumentMetadata& lhs, + const BundledDocumentMetadata& rhs) { + return lhs.key() == rhs.key() && lhs.exists() == rhs.exists() && + lhs.read_time() == rhs.read_time() && lhs.queries() == rhs.queries(); +} + +inline bool operator!=(const BundledDocumentMetadata& lhs, + const BundledDocumentMetadata& rhs) { + return !(lhs == rhs); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLED_DOCUMENT_METADATA_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_query.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_query.h new file mode 100644 index 0000000..af2296d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/bundled_query.h @@ -0,0 +1,72 @@ +/* + * Copyright 2021 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_BUNDLE_BUNDLED_QUERY_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_BUNDLED_QUERY_H_ + +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/target.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * A bundled query represents a query target and its limit type. + */ +class BundledQuery { + public: + BundledQuery() = default; + + BundledQuery(core::Target target, core::LimitType limit_type) + : target_(std::move(target)), limit_type_(limit_type) { + } + + /** + * @return The target that represents the user-issued query when building + * bundles. Client side transformations are not performed for client-specific + * features: order by constraints are not inverted for limit to last queries, + * for example. + */ + const core::Target& target() const { + return target_; + } + + /** @return The user provided limit type. */ + core::LimitType limit_type() const { + return limit_type_; + } + + private: + core::Target target_; + core::LimitType limit_type_; +}; + +inline bool operator==(const BundledQuery& lhs, const BundledQuery& rhs) { + return lhs.target() == rhs.target() && lhs.limit_type() == rhs.limit_type(); +} + +inline bool operator!=(const BundledQuery& lhs, const BundledQuery& rhs) { + return !(lhs == rhs); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_BUNDLED_QUERY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/named_query.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/named_query.h new file mode 100644 index 0000000..93b796e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/bundle/named_query.h @@ -0,0 +1,91 @@ +/* + * Copyright 2021 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_BUNDLE_NAMED_QUERY_H_ +#define FIRESTORE_CORE_SRC_BUNDLE_NAMED_QUERY_H_ + +#include +#include + +#include "Firestore/core/src/bundle/bundle_element.h" +#include "Firestore/core/src/bundle/bundled_query.h" +#include "Firestore/core/src/model/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace bundle { + +/** + * Represents a named query saved by the SDK in its local storage. + */ +class NamedQuery : public BundleElement { + public: + NamedQuery() = default; + + NamedQuery(std::string query_name, + BundledQuery bundled_query, + model::SnapshotVersion read_time) + : query_name_(std::move(query_name)), + bundled_query_(std::move(bundled_query)), + read_time_(read_time) { + } + + Type element_type() const override { + return Type::NamedQuery; + } + + /** + * @return The name of the query. + */ + const std::string& query_name() const { + return query_name_; + } + + /** + * @return The underlying query associated with the given name. + */ + const BundledQuery& bundled_query() const { + return bundled_query_; + } + + /** + * @return The time at which the results for this query were read. + */ + model::SnapshotVersion read_time() const { + return read_time_; + } + + private: + std::string query_name_; + BundledQuery bundled_query_; + model::SnapshotVersion read_time_; +}; + +inline bool operator==(const NamedQuery& lhs, const NamedQuery& rhs) { + return lhs.query_name() == rhs.query_name() && + lhs.read_time() == rhs.read_time() && + lhs.bundled_query() == rhs.bundled_query(); +} + +inline bool operator!=(const NamedQuery& lhs, const NamedQuery& rhs) { + return !(lhs == rhs); +} + +} // namespace bundle +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_BUNDLE_NAMED_QUERY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc new file mode 100644 index 0000000..bb57b7d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc @@ -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. + */ + +#include "Firestore/core/src/core/array_contains_any_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Contains; +using model::Document; +using model::FieldPath; +using model::IsArray; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class ArrayContainsAnyFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep( + std::move(field), Operator::ArrayContainsAny, std::move(value)) { + HARD_ASSERT(IsArray(this->value()), + "ArrayContainsAnyFilter expects an ArrayValue"); + } + + Type type() const override { + return Type::kArrayContainsAnyFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +ArrayContainsAnyFilter::ArrayContainsAnyFilter( + const model::FieldPath& field, + SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool ArrayContainsAnyFilter::Rep::Matches(const Document& doc) const { + const google_firestore_v1_ArrayValue& array_value = value().array_value; + absl::optional maybe_lhs = doc->field(field()); + if (!maybe_lhs) return false; + + const google_firestore_v1_Value& lhs = *maybe_lhs; + if (!IsArray(lhs)) return false; + + for (pb_size_t i = 0; i < lhs.array_value.values_count; ++i) { + if (Contains(array_value, lhs.array_value.values[i])) { + return true; + } + } + return false; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h new file mode 100644 index 0000000..8367523 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h @@ -0,0 +1,54 @@ +/* + * 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/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/nanopb/message.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: + /** Creates a new array-contains-any filter. Takes ownership of `value`. */ + ArrayContainsAnyFilter( + const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc new file mode 100644 index 0000000..d0609d8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc @@ -0,0 +1,70 @@ +/* + * 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/array_contains_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/value_util.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Contains; +using model::Document; +using model::FieldPath; +using model::IsArray; +using nanopb::SharedMessage; +using Operator = Filter::Operator; + +class ArrayContainsFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep( + std::move(field), Operator::ArrayContains, std::move(value)) { + } + + Type type() const override { + return Type::kArrayContainsFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +ArrayContainsFilter::ArrayContainsFilter( + const model::FieldPath& field, + SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool ArrayContainsFilter::Rep::Matches(const Document& doc) const { + absl::optional maybe_lhs = doc->field(field()); + if (!maybe_lhs) return false; + + const google_firestore_v1_Value& lhs = *maybe_lhs; + if (!IsArray(lhs)) return false; + + const google_firestore_v1_ArrayValue& contents = lhs.array_value; + return Contains(contents, value()); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h new file mode 100644 index 0000000..5f50287 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h @@ -0,0 +1,53 @@ +/* + * 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/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/nanopb/message.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: + /** Creates a new array-contains filter. Takes ownership of `value`. */ + ArrayContainsFilter(const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc new file mode 100644 index 0000000..d39d868 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc @@ -0,0 +1,116 @@ +/* + * 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/bound.h" + +#include + +#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/model/document_key.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/to_string.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Compare; +using model::DocumentKey; +using model::FieldPath; +using model::GetTypeOrder; +using model::TypeOrder; +using nanopb::SharedMessage; +using util::ComparisonResult; + +Bound Bound::FromValue(SharedMessage position, + bool is_before) { + model::SortFields(*position); + return Bound(std::move(position), is_before); +} + +bool Bound::SortsBeforeDocument(const OrderByList& order_by, + const model::Document& document) const { + HARD_ASSERT(position_->values_count <= order_by.size(), + "Bound has more components than the provided order by."); + + ComparisonResult result = ComparisonResult::Same; + for (size_t idx = 0; idx < position_->values_count; ++idx) { + const google_firestore_v1_Value& field_value = position_->values[idx]; + const OrderBy& ordering_component = order_by[idx]; + + ComparisonResult comparison; + if (ordering_component.field() == FieldPath::KeyFieldPath()) { + HARD_ASSERT( + GetTypeOrder(field_value) == TypeOrder ::kReference, + "Bound has a non-key value where the key path is being used %s", + field_value.ToString()); + auto key = DocumentKey::FromName( + nanopb::MakeString(field_value.reference_value)); + comparison = key.CompareTo(document->key()); + + } else { + absl::optional doc_value = + document->field(ordering_component.field()); + HARD_ASSERT( + doc_value.has_value(), + "Field should exist since document matched the orderBy already."); + comparison = Compare(field_value, *doc_value); + } + + comparison = ordering_component.direction().ApplyTo(comparison); + if (!util::Same(comparison)) { + result = comparison; + break; + } + } + + return before_ ? result <= ComparisonResult::Same + : result < ComparisonResult::Same; +} + +std::string Bound::CanonicalId() const { + std::string result = before_ ? "b:" : "a:"; + for (pb_size_t i = 0; i < position_->values_count; ++i) { + result.append(model::CanonicalId(position_->values[i])); + } + return result; +} + +std::string Bound::ToString() const { + return util::StringFormat("Bound(position=%s, before=%s)", + model::CanonicalId(*position_), + util::ToString(before_)); +} + +std::ostream& operator<<(std::ostream& os, const Bound& bound) { + return os << bound.ToString(); +} + +bool operator==(const Bound& lhs, const Bound& rhs) { + return *lhs.position() == *rhs.position() && lhs.before() == rhs.before(); +} + +size_t Bound::Hash() const { + return util::Hash(model::CanonicalId(*position_), before_); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.h new file mode 100644 index 0000000..ca5f36a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/bound.h @@ -0,0 +1,109 @@ +/* + * 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_BOUND_H_ +#define FIRESTORE_CORE_SRC_CORE_BOUND_H_ + +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * Bound represents the starting or ending position in query results. + * + * The bound is specified with components representing a position in the results + * and whether it's just before or just after the position (relative to whatever + * the query order is). + * + * The position represents a logical index position for a query. It's a prefix + * of values for the (potentially implicit) order by clauses of a query. + * + * Bound provides a function to determine whether a document comes before or + * after a bound. This is influenced by whether the position is just before or + * just after the provided values. + */ +class Bound { + public: + /** + * Creates a new bound. + * + * @param position The position relative to the sort order. + * @param is_before Whether this bound is just before or just after the + * position. + */ + static Bound FromValue( + nanopb::SharedMessage position, + bool is_before); + + /** + * The index position of this bound represented as an array of field values. + */ + const nanopb::SharedMessage position() const { + return position_; + } + + /** Whether this bound is just before or just after the provided position */ + bool before() const { + return before_; + } + + /** + * Returns true if the given document comes before this bound using the + * provided sort order. + */ + bool SortsBeforeDocument(const OrderByList& order_by, + const model::Document& document) const; + + std::string CanonicalId() const; + + std::string ToString() const; + + size_t Hash() const; + + private: + Bound(nanopb::SharedMessage position, + bool is_before) + : position_{std::move(position)}, before_(is_before) { + } + + nanopb::SharedMessage position_; + bool before_; +}; + +std::ostream& operator<<(std::ostream& os, const Bound& bound); + +bool operator==(const Bound& lhs, const Bound& rhs); + +inline bool operator!=(const Bound& lhs, const Bound& rhs) { + return !(lhs == rhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_BOUND_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/core_fwd.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/core_fwd.h new file mode 100644 index 0000000..99919c5 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc new file mode 100644 index 0000000..744e798 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc @@ -0,0 +1,37 @@ +/* + * 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/database_info.h" + +#include + +namespace firebase { +namespace firestore { +namespace core { + +DatabaseInfo::DatabaseInfo(model::DatabaseId database_id, + std::string persistence_key, + std::string host, + bool ssl_enabled) + : database_id_{std::move(database_id)}, + persistence_key_{std::move(persistence_key)}, + host_{std::move(host)}, + ssl_enabled_{ssl_enabled} { +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.h new file mode 100644 index 0000000..d80a5f2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.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_CORE_DATABASE_INFO_H_ +#define FIRESTORE_CORE_SRC_CORE_DATABASE_INFO_H_ + +#include + +#include "Firestore/core/src/model/database_id.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** DatabaseInfo contains data about the database. */ +class DatabaseInfo { + public: + /** + * Creates a new DatabaseInfo. + * + * @param database_id The project/database to use. + * @param persistence_key A unique identifier for this Firestore's local + * storage. Usually derived from -[FIRApp appName]. + * @param host The hostname of the Firestore backend. + * @param ssl_enabled Whether to use SSL when connecting. + */ + DatabaseInfo(model::DatabaseId database_id, + std::string persistence_key, + std::string host, + bool ssl_enabled); + + DatabaseInfo() = default; + + const model::DatabaseId& database_id() const { + return database_id_; + } + + const std::string& persistence_key() const { + return persistence_key_; + } + + const std::string& host() const { + return host_; + } + + bool ssl_enabled() const { + return ssl_enabled_; + } + + private: + model::DatabaseId database_id_; + std::string persistence_key_; + std::string host_; + bool ssl_enabled_ = false; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_DATABASE_INFO_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc new file mode 100644 index 0000000..cf1e41c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc @@ -0,0 +1,46 @@ +/* + * 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/direction.h" + +#include + +namespace firebase { +namespace firestore { +namespace core { + +const Direction Direction::Ascending(Direction::AscendingModifier); +const Direction Direction::Descending(Direction::DescendingModifier); + +std::string Direction::CanonicalId() const { + return comparison_modifier_ == AscendingModifier ? "asc" : "desc"; +} + +util::ComparisonResult Direction::ApplyTo(util::ComparisonResult result) const { + if (comparison_modifier_ == AscendingModifier) { + return result; + } else { + return util::ReverseOrder(result); + } +} + +std::ostream& operator<<(std::ostream& os, const Direction& direction) { + return os << direction.CanonicalId(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.h new file mode 100644 index 0000000..de47fad --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/direction.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ +#define FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ + +#include +#include + +#include "Firestore/core/src/util/comparison.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** Interface used for all query orderings. All Directions are immutable. */ +class Direction { + public: + ABSL_CONST_INIT static const Direction Ascending; + ABSL_CONST_INIT static const Direction Descending; + + /** + * Creates a Direction from a boolean. This is useful only because the + * public Objective-C API uses it. + */ + static const Direction& FromDescending(bool descending) { + return descending ? Descending : Ascending; + } + + Direction() = default; + + /** + * Changes the direction of the given ComparisonResult if the direction is + * Descending. + */ + util::ComparisonResult ApplyTo(util::ComparisonResult) const; + + int comparison_modifier() const { + return comparison_modifier_; + } + + std::string CanonicalId() const; + + private: + enum { + AscendingModifier = 1, + DescendingModifier = -1, + }; + + constexpr explicit Direction(int comparison_modifier) + : comparison_modifier_(comparison_modifier) { + } + int comparison_modifier_ = AscendingModifier; +}; + +std::ostream& operator<<(std::ostream& os, const Direction& direction); + +inline bool operator==(const Direction& lhs, const Direction& rhs) { + return lhs.comparison_modifier() == rhs.comparison_modifier(); +} + +inline bool operator!=(const Direction& lhs, const Direction& rhs) { + return !(lhs == rhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h new file mode 100644 index 0000000..a8edd48 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h @@ -0,0 +1,155 @@ +/* + * 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_EVENT_LISTENER_H_ +#define FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_ + +#include +#include // NOLINT(build/c++11) +#include + +#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 { +namespace firestore { +namespace core { + +/** + * A general interface for listening to events internally. + */ +template +class EventListener { + public: + static std::unique_ptr> Create( + util::StatusOrCallback callback); + + virtual ~EventListener() = default; + + /** + * OnEvent will be called with the new value or the error if an error + * occurred. + * + * @param maybe_value The value of the event or the error. + */ + virtual void OnEvent(util::StatusOr maybe_value) = 0; +}; + +/** + * A wrapper around another EventListener that dispatches events asynchronously. + */ +template +class AsyncEventListener + : public EventListener, + public std::enable_shared_from_this> { + public: + using DelegateListener = std::unique_ptr>; + + AsyncEventListener(const std::shared_ptr& executor, + DelegateListener&& delegate) + : executor_(executor), delegate_(std::move(delegate)) { + } + + static std::shared_ptr> Create( + std::shared_ptr executor, DelegateListener&& delegate); + + static std::shared_ptr> Create( + std::shared_ptr executor, EventListener&& delegate) { + return Create(executor, + absl::make_unique(std::move(delegate))); + } + + void OnEvent(util::StatusOr maybe_value) override; + + /** + * Synchronously mutes the listener and raises no further events. This method + * is thread safe and can be called from any queue. + */ + void Mute(); + + private: + // 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_; +}; + +template +std::unique_ptr> EventListener::Create( + util::StatusOrCallback callback) { + class CallbackEventListener : public EventListener { + public: + explicit CallbackEventListener(util::StatusOrCallback&& callback) + : callback_(std::move(callback)) { + } + + void OnEvent(util::StatusOr maybe_value) override { + callback_(std::move(maybe_value)); + } + + private: + util::StatusOrCallback callback_; + }; + + return absl::make_unique(std::move(callback)); +} + +template +std::shared_ptr> AsyncEventListener::Create( + std::shared_ptr executor, DelegateListener&& delegate) { + return std::make_shared>(executor, std::move(delegate)); +} + +template +void AsyncEventListener::Mute() { + std::lock_guard lock(mutex_); + muted_ = true; +} + +template +void AsyncEventListener::OnEvent(util::StatusOr maybe_value) { + // Retain a strong reference to this. If the EventManager is sending an error + // it will immediately clear its strong reference to this after posting the + // event. The strong reference here allows the AsyncEventListener to survive + // until the executor gets around to calling. + 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)); + } + }); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.cc new file mode 100644 index 0000000..283a834 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.h new file mode 100644 index 0000000..ba4f2ee --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.cc new file mode 100644 index 0000000..8129bf2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.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/core/field_filter.h" + +#include +#include + +#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/model/value_util.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" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Compare; +using model::FieldPath; +using model::GetTypeOrder; +using model::IsArray; +using model::TypeOrder; +using nanopb::SharedMessage; +using util::ComparisonResult; + +namespace { + +const char* CanonicalName(Filter::Operator op) { + switch (op) { + case Filter::Operator::LessThan: + return "<"; + case Filter::Operator::LessThanOrEqual: + return "<="; + case Filter::Operator::Equal: + return "=="; + case Filter::Operator::NotEqual: + return "!="; + case Filter::Operator::GreaterThanOrEqual: + return ">="; + case Filter::Operator::GreaterThan: + return ">"; + case Filter::Operator::ArrayContains: + // The canonical name for this is array_contains for compatibility with + // existing entries in `query_targets` stored on user devices. This cannot + // be changed without causing users to lose their associated resume + // tokens. + return "array_contains"; + case Filter::Operator::In: + return "in"; + case Filter::Operator::ArrayContainsAny: + return "array-contains-any"; + case Filter::Operator::NotIn: + return "not-in"; + } + + UNREACHABLE(); +} + +} // namespace + +FieldFilter FieldFilter::Create( + const FieldPath& path, + Operator op, + SharedMessage value_rhs) { + google_firestore_v1_Value& value = *value_rhs; + model::SortFields(value); + if (path.IsKeyFieldPath()) { + if (op == Filter::Operator::In) { + return KeyFieldInFilter(path, std::move(value_rhs)); + } else if (op == Filter::Operator::NotIn) { + return KeyFieldNotInFilter(path, std::move(value_rhs)); + } else { + HARD_ASSERT(!IsArrayOperator(op), + "%s queries don't make sense on document keys.", + CanonicalName(op)); + return KeyFieldFilter(path, op, std::move(value_rhs)); + } + } else if (op == Operator::ArrayContains) { + return ArrayContainsFilter(path, std::move(value_rhs)); + + } else if (op == Operator::In) { + return InFilter(path, std::move(value_rhs)); + } else if (op == Operator::ArrayContainsAny) { + return ArrayContainsAnyFilter(path, std::move(value_rhs)); + } else if (op == Operator::NotIn) { + return NotInFilter(path, std::move(value_rhs)); + } else { + Rep filter(path, op, value_rhs); + return FieldFilter(std::make_shared(std::move(filter))); + } +} + +FieldFilter::FieldFilter(const Filter& other) : Filter(other) { + HARD_ASSERT(IsAFieldFilter()); +} + +FieldFilter::FieldFilter(std::shared_ptr rep) + : Filter(std::move(rep)) { +} + +FieldFilter::Rep::Rep(FieldPath field, + Operator op, + SharedMessage value_rhs) + : field_(std::move(field)), op_(op), value_rhs_(std::move(value_rhs)) { +} + +bool FieldFilter::Rep::IsInequality() const { + return op_ == Operator::LessThan || op_ == Operator::LessThanOrEqual || + op_ == Operator::GreaterThan || op_ == Operator::GreaterThanOrEqual || + op_ == Operator::NotEqual || op_ == Operator::NotIn; +} + +bool FieldFilter::Rep::Matches(const model::Document& doc) const { + absl::optional maybe_lhs = doc->field(field_); + if (!maybe_lhs) return false; + + const google_firestore_v1_Value& lhs = *maybe_lhs; + + // Types do not have to match in NotEqual filters. + if (op_ == Operator::NotEqual) { + return MatchesComparison(Compare(lhs, *value_rhs_)); + } + + // Only compare types with matching backend order (such as double and int). + return GetTypeOrder(lhs) == GetTypeOrder(*value_rhs_) && + MatchesComparison(Compare(lhs, *value_rhs_)); +} + +bool FieldFilter::Rep::MatchesComparison(ComparisonResult comparison) const { + switch (op_) { + case Operator::LessThan: + return comparison == ComparisonResult::Ascending; + case Operator::LessThanOrEqual: + return comparison == ComparisonResult::Ascending || + comparison == ComparisonResult::Same; + case Operator::Equal: + return comparison == ComparisonResult::Same; + case Operator::GreaterThanOrEqual: + return comparison == ComparisonResult::Descending || + 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_); + } +} + +std::string FieldFilter::Rep::CanonicalId() const { + return absl::StrCat(field_.CanonicalString(), CanonicalName(op_), + model::CanonicalId(*value_rhs_)); +} + +std::string FieldFilter::Rep::ToString() const { + return util::StringFormat("%s %s %s", field_.CanonicalString(), + CanonicalName(op_), + model::CanonicalId(*value_rhs_)); +} + +size_t FieldFilter::Rep::Hash() const { + return util::Hash(field_, op_, model::CanonicalId(*value_rhs_)); +} + +bool FieldFilter::Rep::Equals(const Filter::Rep& other) const { + if (type() != other.type()) return false; + + const auto& other_rep = static_cast(other); + return op_ == other_rep.op_ && field_ == other_rep.field_ && + *value_rhs_ == *other_rep.value_rhs_; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h new file mode 100644 index 0000000..027f8b6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h @@ -0,0 +1,144 @@ +/* + * 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_FIELD_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_FIELD_FILTER_H_ + +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { + +namespace model { +class Document; +} // namespace model + +namespace core { + +/** + * FieldFilter is a document filter constraint on a query with a single + * relation operator. + */ +class FieldFilter : public Filter { + public: + /** + * Creates a Filter instance for the provided path, operator, and value. + */ + static FieldFilter Create( + const model::FieldPath& path, + Operator op, + nanopb::SharedMessage value_rhs); + + explicit FieldFilter(const Filter& other); + + const model::FieldPath& field() const { + return field_filter_rep().field_; + } + + Operator op() const { + return field_filter_rep().op_; + } + + const google_firestore_v1_Value& value() const { + return *(field_filter_rep().value_rhs_); + } + + protected: + class Rep : public Filter::Rep { + public: + Type type() const override { + return Type::kFieldFilter; + } + + bool IsAFieldFilter() const override { + return true; + } + + bool IsInequality() const override; + + const model::FieldPath& field() const override { + return field_; + } + + Operator op() const { + return op_; + } + + const google_firestore_v1_Value& value() const { + return *value_rhs_; + } + + bool Matches(const model::Document& doc) const override; + + std::string CanonicalId() const override; + + std::string ToString() const override; + + size_t Hash() const override; + + protected: + /** + * Creates a new filter that compares fields and values. Only intended to be + * called from Filter::Create(). + * + * The FieldFilter takes ownership of `value_rhs`. + * + * @param field A path to a field in the document to filter on. The LHS of + * the expression. + * @param op The binary operator to apply. + * @param value_rhs A constant value to compare `field` to. The RHS of the + * expression. + */ + Rep(model::FieldPath field, + Operator op, + nanopb::SharedMessage value_rhs); + + bool MatchesComparison(util::ComparisonResult comparison) const; + + private: + friend class FieldFilter; + + bool Equals(const Filter::Rep& other) const override; + + /** The left hand side of the relation. A path into a document field. */ + model::FieldPath field_; + + /** The type of equality/inequality operator to use in the relation. */ + Operator op_; + + /** The right hand side of the relation. A constant value to compare to. */ + nanopb::SharedMessage value_rhs_; + }; + + explicit FieldFilter(std::shared_ptr rep); + + private: + const Rep& field_filter_rep() const { + return static_cast(rep()); + } +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_FIELD_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc new file mode 100644 index 0000000..e180a8c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc @@ -0,0 +1,37 @@ +/* + * 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/filter.h" + +#include + +namespace firebase { +namespace firestore { +namespace core { + +bool operator==(const Filter& lhs, const Filter& rhs) { + return lhs.rep_ == nullptr + ? rhs.rep_ == nullptr + : (rhs.rep_ != nullptr && lhs.rep_->Equals(*rhs.rep_)); +} + +std::ostream& operator<<(std::ostream& os, const Filter& filter) { + return os << filter.ToString(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.h new file mode 100644 index 0000000..0061464 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/filter.h @@ -0,0 +1,171 @@ +/* + * 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_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_FILTER_H_ + +#include +#include +#include + +#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. */ +class Filter { + public: + /** + * Operator is a value relation operator that can be used to filter documents. + * It is similar to NSPredicateOperatorType, but only has operators supported + * by Firestore. + */ + enum class Operator { + LessThan, + LessThanOrEqual, + Equal, + NotEqual, + GreaterThanOrEqual, + GreaterThan, + ArrayContains, + In, + ArrayContainsAny, + NotIn, + }; + + // For lack of RTTI, all subclasses must identify themselves so that + // comparisons properly take type into account. + enum class Type { + kArrayContainsAnyFilter, + kArrayContainsFilter, + kFieldFilter, + kInFilter, + kNotInFilter, + kKeyFieldFilter, + kKeyFieldInFilter, + kKeyFieldNotInFilter, + }; + + Type type() const { + return rep_->type(); + } + + /** + * Returns true if this instance is FieldFilter or any derived class. + * Equivalent to `instanceof FieldFilter` on other platforms. + * + * Note this is different than checking `type() == Type::kFieldFilter` which + * is only true if the type is exactly FieldFilter. + */ + bool IsAFieldFilter() const { + return rep_->IsAFieldFilter(); + } + + bool IsInequality() const { + return rep_->IsInequality(); + } + + /** Returns the field the Filter operates over. */ + const model::FieldPath& field() const { + return rep_->field(); + } + + /** Returns true if a document matches the filter. */ + bool Matches(const model::Document& doc) const { + return rep_->Matches(doc); + } + + /** A unique ID identifying the filter; used when serializing queries. */ + std::string CanonicalId() const { + return rep_->CanonicalId(); + } + + /** A debug description of the Filter. */ + std::string ToString() const { + return rep_->ToString(); + } + + size_t Hash() const { + return rep_->Hash(); + } + + friend bool operator==(const Filter& lhs, const Filter& rhs); + + protected: + class Rep { + public: + virtual ~Rep() = default; + + virtual Type type() const = 0; + + virtual bool IsAFieldFilter() const { + return false; + } + + virtual bool IsInequality() const { + return false; + } + + /** Returns the field the Filter operates over. */ + virtual const model::FieldPath& field() const = 0; + + /** Returns true if a document matches the filter. */ + virtual bool Matches(const model::Document& doc) const = 0; + + /** A unique ID identifying the filter; used when serializing queries. */ + virtual std::string CanonicalId() const = 0; + + virtual bool Equals(const Rep& other) const = 0; + + virtual size_t Hash() const = 0; + + /** A debug description of the Filter. */ + virtual std::string ToString() const = 0; + }; + + explicit Filter(std::shared_ptr rep) : rep_(rep) { + } + + const Rep& rep() const { + return *rep_; + } + + private: + std::shared_ptr rep_; +}; + +inline bool operator!=(const Filter& lhs, const Filter& rhs) { + return !(lhs == rhs); +} + +/** A list of Filters, as used in Queries and elsewhere. */ +using FilterList = immutable::AppendOnlyList; + +std::ostream& operator<<(std::ostream& os, const Filter& filter); + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc new file mode 100644 index 0000000..79952e4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc @@ -0,0 +1,572 @@ +/* + * 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 +#include // NOLINT(build/c++11) +#include +#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/bundle/bundle_reader.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/credentials/credentials_provider.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_engine.h" +#include "Firestore/core/src/local/query_result.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document.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/firebase_metadata_provider.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::QuerySnapshot; +using api::QuerySnapshotListener; +using api::Settings; +using api::SnapshotMetadata; +using credentials::AuthCredentialsProvider; +using credentials::User; +using firestore::Error; +using local::LevelDbOpener; +using local::LocalStore; +using local::LruParams; +using local::MemoryPersistence; +using local::QueryEngine; +using local::QueryResult; +using model::Document; +using model::DocumentKeySet; +using model::DocumentMap; +using model::Mutation; +using model::OnlineState; +using remote::ConnectivityMonitor; +using remote::Datastore; +using remote::FirebaseMetadataProvider; +using remote::RemoteStore; +using remote::Serializer; +using util::AsyncQueue; +using util::Empty; +using util::Executor; +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 + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue, + std::unique_ptr firebase_metadata_provider) { + // Have to use `new` because `make_shared` cannot access private constructor. + std::shared_ptr shared_client(new FirestoreClient( + database_info, std::move(auth_credentials_provider), + std::move(app_check_credentials_provider), std::move(user_executor), + std::move(worker_queue), std::move(firebase_metadata_provider))); + + 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->app_check_credentials_provider_->SetCredentialChangeListener( + [](std::string) { + // Register an empty credentials change listener to activate token + // refresh. + }); + shared_client->auth_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 + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue, + std::unique_ptr firebase_metadata_provider) + : database_info_(database_info), + app_check_credentials_provider_( + std::move(app_check_credentials_provider)), + auth_credentials_provider_(std::move(auth_credentials_provider)), + worker_queue_(std::move(worker_queue)), + user_executor_(std::move(user_executor)), + firebase_metadata_provider_(std::move(firebase_metadata_provider)) { +} + +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_, auth_credentials_provider_, + app_check_credentials_provider_, connectivity_monitor_.get(), + firebase_metadata_provider_.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; + + app_check_credentials_provider_->SetCredentialChangeListener(nullptr); + app_check_credentials_provider_.reset(); + + auth_credentials_provider_->SetCredentialChangeListener(nullptr); + auth_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] { + Document document = local_store_->ReadDocument(doc.key()); + StatusOr maybe_snapshot; + + if (document->is_found_document()) { + maybe_snapshot = DocumentSnapshot::FromDocument( + doc.firestore(), document, + SnapshotMetadata{document->has_local_mutations(), + /*from_cache=*/true}); + } else if (document->is_no_document()) { + maybe_snapshot = DocumentSnapshot::FromNoDocument( + doc.firestore(), doc.key(), + SnapshotMetadata{/*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()); + 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); + }); +} + +void FirestoreClient::LoadBundle( + std::unique_ptr bundle_data, + std::shared_ptr result_task) { + VerifyNotTerminated(); + + bundle::BundleSerializer bundle_serializer( + remote::Serializer(database_info_.database_id())); + auto reader = std::make_shared( + std::move(bundle_serializer), std::move(bundle_data)); + worker_queue_->Enqueue([this, reader, result_task] { + sync_engine_->LoadBundle(std::move(reader), std::move(result_task)); + }); +} + +void FirestoreClient::GetNamedQuery(const std::string& name, + api::QueryCallback callback) { + VerifyNotTerminated(); + + // Dispatch the result back onto the user dispatch queue. + auto async_callback = + [this, callback](const absl::optional& named_query) { + if (callback) { + if (named_query.has_value()) { + const Target& target = named_query.value().bundled_query().target(); + Query query(target.path(), target.collection_group(), + target.filters(), target.order_bys(), target.limit(), + named_query.value().bundled_query().limit_type(), + target.start_at(), target.end_at()); + user_executor_->Execute([query, callback] { + callback(std::move(query), /*found=*/true); + }); + } else { + user_executor_->Execute( + [callback] { callback(Query(), /*found=*/false); }); + } + } + }; + + worker_queue_->Enqueue([this, name, async_callback] { + async_callback(local_store_->GetNamedQuery(name)); + }); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h new file mode 100644 index 0000000..51db9f9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h @@ -0,0 +1,245 @@ +/* + * 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_FIRESTORE_CLIENT_H_ +#define FIRESTORE_CORE_SRC_CORE_FIRESTORE_CLIENT_H_ + +#include +#include +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/api/load_bundle_task.h" +#include "Firestore/core/src/bundle/bundle_serializer.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/credentials/credentials_fwd.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/byte_stream.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 LocalStore; +class LruDelegate; +class Persistence; +class QueryEngine; +} // namespace local + +namespace model { +class Mutation; +} // namespace model + +namespace remote { +class ConnectivityMonitor; +class FirebaseMetadataProvider; +class RemoteStore; +} // namespace remote + +namespace core { + +/** + * FirestoreClient is a top-level class that constructs and owns all of the + * pieces of the client SDK architecture. + */ +class FirestoreClient : public std::enable_shared_from_this { + public: + /** + * Creates a fully initialized `FirestoreClient`. + * + * PORTING NOTE: We use factory function instead of public constructor + * because `FirestoreClient` is supposed to be managed by shared_ptr, and + * it is invalid to call `shared_from_this()` from constructors. + * The factory function enforces that `FirestoreClient` has to be managed + * by a shared pointer. + */ + static std::shared_ptr Create( + const DatabaseInfo& database_info, + const api::Settings& settings, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue, + std::unique_ptr + firebase_metadata_provider); + + ~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 TerminateAsync(util::StatusCallback callback); + + /** + * Passes a callback that is triggered when all the pending writes at the + * time when this method is called received server acknowledgement. + * An acknowledgement can be either acceptance or rejections. + */ + void WaitForPendingWrites(util::StatusCallback callback); + + /** Disables the network connection. Pending operations will not complete. */ + void DisableNetwork(util::StatusCallback callback); + + /** Enables the network connection and requeues all pending operations. */ + void EnableNetwork(util::StatusCallback callback); + + /** Starts listening to a query. */ + std::shared_ptr ListenToQuery( + Query query, + ListenOptions options, + ViewSnapshotSharedListener&& listener); + + /** Stops listening to a query previously listened to. */ + void RemoveListener(const std::shared_ptr& listener); + + /** + * Retrieves a document from the cache via the indicated callback. If the doc + * doesn't exist, an error will be sent to the callback. + */ + void GetDocumentFromLocalCache(const api::DocumentReference& doc, + api::DocumentSnapshotListener&& callback); + + /** + * Retrieves a (possibly empty) set of documents from the cache via the + * indicated callback. + */ + void GetDocumentsFromLocalCache(const api::Query& query, + api::QuerySnapshotListener&& callback); + + /** + * Write mutations. callback will be notified when it's written to the + * backend. + */ + void WriteMutations(std::vector&& mutations, + util::StatusCallback callback); + + /** + * Tries to execute the transaction in update_callback up to retries times. + */ + void Transaction(int retries, + TransactionUpdateCallback update_callback, + TransactionResultCallback result_callback); + + /** + * Adds a listener to be called when a snapshots-in-sync event fires. + */ + void AddSnapshotsInSyncListener( + const std::shared_ptr>& listener); + + /** + * Removes a specific listener for snapshots-in-sync events. + */ + void RemoveSnapshotsInSyncListener( + const std::shared_ptr>& listener); + + /** The database ID of the DatabaseInfo this client was initialized with. */ + const model::DatabaseId& database_id() const { + return database_info_.database_id(); + } + + /** + * Dispatch queue for user callbacks / events. This will often be the "Main + * Dispatch Queue" of the app but the developer can configure it to a + * different queue if they so choose. + */ + const std::shared_ptr& user_executor() const { + return user_executor_; + } + + void LoadBundle(std::unique_ptr bundle_data, + std::shared_ptr result_task); + + void GetNamedQuery(const std::string& name, api::QueryCallback callback); + + /** For usage in this class and testing only. */ + const std::shared_ptr& worker_queue() const { + return worker_queue_; + } + bool is_terminated() const; + + private: + FirestoreClient(const DatabaseInfo& database_info, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue, + std::unique_ptr + firebase_metadata_provider); + + void Initialize(const credentials::User& user, const api::Settings& settings); + + void VerifyNotTerminated(); + + void TerminateInternal(); + + void ScheduleLruGarbageCollection(); + + DatabaseInfo database_info_; + std::shared_ptr + app_check_credentials_provider_; + std::shared_ptr + auth_credentials_provider_; + /** + * Async queue responsible for all of our internal processing. When we get + * incoming work from the user (via public API) or the network (incoming gRPC + * messages), we should always dispatch onto this queue. This ensures our + * internal data structures are never accessed from multiple threads + * simultaneously. + */ + std::shared_ptr worker_queue_; + std::shared_ptr user_executor_; + + std::unique_ptr firebase_metadata_provider_; + + 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_; + + std::chrono::milliseconds initial_gc_delay_ = std::chrono::minutes(1); + std::chrono::milliseconds regular_gc_delay_ = std::chrono::minutes(5); + bool gc_has_run_ = false; + bool credentials_initialized_ = false; + local::LruDelegate* _Nullable lru_delegate_; + util::DelayedOperation lru_callback_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_FIRESTORE_CLIENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc new file mode 100644 index 0000000..642afcc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc @@ -0,0 +1,67 @@ +/* + * 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/in_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Contains; +using model::Document; +using model::FieldPath; +using model::IsArray; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class InFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep(std::move(field), Operator::In, std::move(value)) { + HARD_ASSERT(IsArray(this->value()), "InFilter expects an ArrayValue"); + } + + Type type() const override { + return Type::kInFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +InFilter::InFilter(const FieldPath& field, + SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool InFilter::Rep::Matches(const Document& doc) const { + const google_firestore_v1_ArrayValue& array_value = value().array_value; + absl::optional maybe_lhs = doc->field(field()); + if (!maybe_lhs) return false; + return Contains(array_value, *maybe_lhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.h new file mode 100644 index 0000000..e8daf23 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/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_IN_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_IN_FILTER_H_ + +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { + +namespace model { +class FieldPath; +} // namespace model + +namespace core { + +/** + * A Filter that implements the IN operator. + */ +class InFilter : public FieldFilter { + public: + /** Creates a new 'in' filter. Takes ownership of `value`. */ + InFilter(const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_IN_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.cc new file mode 100644 index 0000000..ea96890 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.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/core/key_field_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::FieldPath; +using model::GetTypeOrder; +using model::TypeOrder; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class KeyFieldFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, + Operator op, + SharedMessage value) + : FieldFilter::Rep(std::move(field), op, std::move(value)) { + HARD_ASSERT(GetTypeOrder(this->value()) == TypeOrder::kReference, + "KeyFieldFilter expects a ReferenceValue"); + key_ = DocumentKey::FromName( + nanopb::MakeString(this->value().reference_value)); + } + + Type type() const override { + return Type::kKeyFieldFilter; + } + + bool Matches(const model::Document& doc) const override; + + private: + DocumentKey key_; +}; + +KeyFieldFilter::KeyFieldFilter(const FieldPath& field, + Operator op, + SharedMessage value) + : FieldFilter(std::make_shared(field, op, std::move(value))) { +} + +bool KeyFieldFilter::Rep::Matches(const Document& doc) const { + return MatchesComparison(doc->key().CompareTo(key_)); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h new file mode 100644 index 0000000..ae8d1b6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h @@ -0,0 +1,48 @@ +/* + * 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_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_KEY_FIELD_FILTER_H_ + +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that matches on key fields (i.e. '__name__'). + */ +class KeyFieldFilter : public FieldFilter { + public: + /** Creates a new document key filter. Takes ownership of `value`. */ + KeyFieldFilter(const model::FieldPath& field, + core::Filter::Operator op, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc new file mode 100644 index 0000000..e759039 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc @@ -0,0 +1,88 @@ +/* + * 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 "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::DocumentKeyHash; +using model::FieldPath; +using model::GetTypeOrder; +using model::IsArray; +using model::TypeOrder; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class KeyFieldInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep(std::move(field), Operator::In, std::move(value)) { + keys_ = ExtractDocumentKeysFromValue(this->value()); + } + + Type type() const override { + return Type::kKeyFieldInFilter; + } + + bool Matches(const model::Document& doc) const override; + + private: + std::unordered_set keys_; +}; + +KeyFieldInFilter::KeyFieldInFilter( + const FieldPath& field, SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool KeyFieldInFilter::Rep::Matches(const Document& doc) const { + return keys_.find(doc->key()) != keys_.end(); +} + +std::unordered_set +KeyFieldInFilter::ExtractDocumentKeysFromValue( + const google_firestore_v1_Value& value) { + HARD_ASSERT(IsArray(value), + "Comparing on key with In/NotIn, but the value was not an Array"); + std::unordered_set keys; + const google_firestore_v1_ArrayValue& array_value = value.array_value; + for (pb_size_t i = 0; i < array_value.values_count; ++i) { + HARD_ASSERT(GetTypeOrder(array_value.values[i]) == TypeOrder::kReference, + "Comparing on key with In/NotIn, but an array value was not" + " a Reference"); + keys.insert(DocumentKey::FromName( + nanopb::MakeString(array_value.values[i].reference_value))); + } + return keys; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h new file mode 100644 index 0000000..1f83047 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h @@ -0,0 +1,55 @@ +/* + * 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 + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that matches on an array of key fields. + */ +class KeyFieldInFilter : public FieldFilter { + public: + /** Creates a new document keys filter. Takes ownership of `value`. */ + KeyFieldInFilter(const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; + + static std::unordered_set + ExtractDocumentKeysFromValue(const google_firestore_v1_Value& value); + + friend class KeyFieldNotInFilter; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_IN_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc new file mode 100644 index 0000000..5c25bad --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc @@ -0,0 +1,68 @@ +/* + * 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 + +#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::DocumentKeyHash; +using model::FieldPath; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class KeyFieldNotInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { + keys_ = KeyFieldInFilter::ExtractDocumentKeysFromValue(this->value()); + } + + Type type() const override { + return Type::kKeyFieldInFilter; + } + + bool Matches(const model::Document& doc) const override; + + private: + std::unordered_set keys_; +}; + +KeyFieldNotInFilter::KeyFieldNotInFilter( + const FieldPath& field, SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool KeyFieldNotInFilter::Rep::Matches(const Document& doc) const { + return keys_.find(doc->key()) == keys_.end(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h new file mode 100644 index 0000000..51ce440 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h @@ -0,0 +1,48 @@ +/* + * 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/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that matches on key fields not present within an array. + */ +class KeyFieldNotInFilter : public FieldFilter { + public: + /** Creates a new document keys not-in filter. Takes ownership of `value`. */ + KeyFieldNotInFilter(const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_NOT_IN_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h new file mode 100644 index 0000000..cf76d87 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h @@ -0,0 +1,91 @@ +/* + * 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_LISTEN_OPTIONS_H_ +#define FIRESTORE_CORE_SRC_CORE_LISTEN_OPTIONS_H_ + +namespace firebase { +namespace firestore { +namespace core { + +class ListenOptions { + public: + ListenOptions() = default; + + /** + * Creates a new ListenOptions. + * + * @param include_query_metadata_changes Raise events when only metadata of + * the query changes. + * @param include_document_metadata_changes Raise events when only metadata of + * documents changes. + * @param wait_for_sync_when_online Wait for a sync with the server when + * online, but still raise events while offline + */ + ListenOptions(bool include_query_metadata_changes, + bool include_document_metadata_changes, + bool wait_for_sync_when_online) + : include_query_metadata_changes_(include_query_metadata_changes), + include_document_metadata_changes_(include_document_metadata_changes), + wait_for_sync_when_online_(wait_for_sync_when_online) { + } + + /** + * Creates a default ListenOptions, with metadata changes and + * wait_for_sync_when_online disabled. + */ + static ListenOptions DefaultOptions() { + return ListenOptions( + /*include_query_metadata_changes=*/false, + /*include_document_metadata_changes=*/false, + /*wait_for_sync_when_online=*/false); + } + + /** + * Creates a ListenOptions which optionally includes both query and document + * metadata changes. + */ + static ListenOptions FromIncludeMetadataChanges( + bool include_metadata_changes) { + return ListenOptions( + /*include_query_metadata_changes=*/include_metadata_changes, + /*include_document_metadata_changes=*/include_metadata_changes, + /*wait_for_sync_when_online=*/false); + } + + bool include_query_metadata_changes() const { + return include_query_metadata_changes_; + } + + bool include_document_metadata_changes() const { + return include_document_metadata_changes_; + } + + bool wait_for_sync_when_online() const { + return wait_for_sync_when_online_; + } + + private: + bool include_query_metadata_changes_ = false; + bool include_document_metadata_changes_ = false; + bool wait_for_sync_when_online_ = false; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_LISTEN_OPTIONS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc new file mode 100644 index 0000000..612e6bc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc @@ -0,0 +1,70 @@ +/* + * 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 "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Contains; +using model::Document; +using model::FieldPath; +using model::IsArray; +using model::NullValue; +using nanopb::SharedMessage; + +using Operator = Filter::Operator; + +class NotInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, SharedMessage value) + : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { + HARD_ASSERT(IsArray(this->value()), "NotInFilter expects an ArrayValue"); + } + + Type type() const override { + return Type::kNotInFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +NotInFilter::NotInFilter(const FieldPath& field, + SharedMessage value) + : FieldFilter(std::make_shared(field, std::move(value))) { +} + +bool NotInFilter::Rep::Matches(const Document& doc) const { + const google_firestore_v1_ArrayValue& array_value = value().array_value; + if (Contains(array_value, *NullValue())) { + return false; + } + absl::optional maybe_lhs = doc->field(field()); + return maybe_lhs && !Contains(array_value, *maybe_lhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h new file mode 100644 index 0000000..723b63b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h @@ -0,0 +1,48 @@ +/* + * 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/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that implements the not-in operator. + */ +class NotInFilter : public FieldFilter { + public: + /** Creates a new not-in filter. Takes ownership of `value`. */ + NotInFilter(const model::FieldPath& field, + nanopb::SharedMessage value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_NOT_IN_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/operator.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/operator.h new file mode 100644 index 0000000..eac8239 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc new file mode 100644 index 0000000..cb0e4d6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc @@ -0,0 +1,69 @@ +/* + * 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/order_by.h" + +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::FieldPath; +using util::ComparisonResult; + +ComparisonResult OrderBy::Compare(const Document& lhs, + const Document& rhs) const { + ComparisonResult result; + if (field_ == FieldPath::KeyFieldPath()) { + result = lhs->key().CompareTo(rhs->key()); + } else { + absl::optional value1 = lhs->field(field_); + absl::optional value2 = rhs->field(field_); + HARD_ASSERT(value1.has_value() && value2.has_value(), + "Trying to compare documents on fields that don't exist."); + result = model::Compare(*value1, *value2); + } + + return direction_.ApplyTo(result); +} + +std::string OrderBy::CanonicalId() const { + return absl::StrCat(field_.CanonicalString(), direction_.CanonicalId()); +} + +std::string OrderBy::ToString() const { + return util::StringFormat("OrderBy(path=%s, dir=%s)", + field_.CanonicalString(), direction_.CanonicalId()); +} + +std::ostream& operator<<(std::ostream& os, const OrderBy& order) { + return os << order.ToString(); +} + +bool operator==(const OrderBy& lhs, const OrderBy& rhs) { + return lhs.field() == rhs.field() && lhs.direction() == rhs.direction(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h new file mode 100644 index 0000000..9a7af49 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ +#define FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ + +#include +#include +#include +#include + +#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. */ +class OrderBy { + public: + static std::shared_ptr Create(model::FieldPath field, + Direction direction) { + return std::make_shared(std::move(field), direction); + } + + OrderBy() = default; + + /** Creates a new sort order with the given field and direction. */ + OrderBy(model::FieldPath field, Direction direction) + : field_(std::move(field)), direction_(direction) { + } + + /** The field by which to sort. */ + const model::FieldPath& field() const { + return field_; + } + + /** The direction of the sort. */ + const Direction& direction() const { + return direction_; + } + + bool ascending() const { + return direction_ == Direction::Ascending; + } + + /** + * Compares two documents based on the field and direction of this sort + * order. + */ + util::ComparisonResult Compare(const model::Document& lhs, + const model::Document& rhs) const; + + /** A unique ID identifying the filter; used when serializing queries. */ + std::string CanonicalId() const; + + std::string ToString() const; + + private: + model::FieldPath field_; + Direction direction_; +}; + +/** A list of OrderBys, as used in Queries and elsewhere. */ +using OrderByList = immutable::AppendOnlyList; + +std::ostream& operator<<(std::ostream& os, const OrderBy& order); + +bool operator==(const OrderBy& lhs, const OrderBy& rhs); + +inline bool operator!=(const OrderBy& lhs, const OrderBy& rhs) { + return !(lhs == rhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc new file mode 100644 index 0000000..5254440 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc @@ -0,0 +1,358 @@ +/* + * 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::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::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 doc->is_found_document() && 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_ + ? absl::optional{Bound::FromValue( + end_at_->position(), !end_at_->before())} + : absl::nullopt; + auto new_end_at = start_at_ + ? absl::optional{Bound::FromValue( + start_at_->position(), !start_at_->before())} + : absl::nullopt; + + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query.h new file mode 100644 index 0000000..0d27f8c --- /dev/null +++ b/SaraAttended/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, + absl::optional start_at, + absl::optional 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 absl::optional& start_at() const { + return start_at_; + } + + const absl::optional& 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; + + absl::optional start_at_; + absl::optional 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc new file mode 100644 index 0000000..7f10ae3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc @@ -0,0 +1,188 @@ +/* + * 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/query_listener.h" + +#include +#include + +#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 { +namespace firestore { +namespace core { + +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, + ViewSnapshotSharedListener&& listener) + : query_(std::move(query)), + options_(std::move(options)), + listener_(std::move(listener)) { +} + +bool QueryListener::OnViewSnapshot(ViewSnapshot snapshot) { + HARD_ASSERT( + !snapshot.document_changes().empty() || snapshot.sync_state_changed(), + "We got a new snapshot with no changes?"); + bool raised_event = false; + if (!options_.include_document_metadata_changes()) { + // Remove the metadata-only changes. + std::vector changes; + for (const DocumentViewChange& change : snapshot.document_changes()) { + if (change.type() != DocumentViewChange::Type::Metadata) { + changes.push_back(change); + } + } + + snapshot = ViewSnapshot{snapshot.query(), + snapshot.documents(), + snapshot.old_documents(), + std::move(changes), + snapshot.mutated_keys(), + snapshot.from_cache(), + snapshot.sync_state_changed(), + /*excludes_metadata_changes=*/true}; + } + + if (!raised_initial_event_) { + if (ShouldRaiseInitialEvent(snapshot, online_state_)) { + RaiseInitialEvent(snapshot); + raised_event = true; + } + } else if (ShouldRaiseEvent(snapshot)) { + listener_->OnEvent(snapshot); + raised_event = true; + } + + snapshot_ = std::move(snapshot); + return raised_event; +} + +void QueryListener::OnError(Status error) { + listener_->OnEvent(std::move(error)); +} + +/** + * Returns whether a snaphsot was raised. + */ +bool QueryListener::OnOnlineStateChanged(OnlineState online_state) { + online_state_ = online_state; + bool raised_event = false; + if (snapshot_.has_value() && !raised_initial_event_ && + ShouldRaiseInitialEvent(snapshot_.value(), online_state)) { + RaiseInitialEvent(snapshot_.value()); + raised_event = true; + } + return raised_event; +} + +bool QueryListener::ShouldRaiseInitialEvent(const ViewSnapshot& snapshot, + OnlineState online_state) const { + HARD_ASSERT(!raised_initial_event_, + "Determining whether to raise initial event, but already had " + "first event."); + + // Always raise the first event when we're synced + if (!snapshot.from_cache()) { + return true; + } + + // NOTE: We consider OnlineState::Unknown as online (it should become Offline + // or Online if we wait long enough). + bool maybe_online = online_state != OnlineState::Offline; + + // Don't raise the event if we're online, aren't synced yet (checked + // above) and are waiting for a sync. + if (options_.wait_for_sync_when_online() && maybe_online) { + HARD_ASSERT(snapshot.from_cache(), + "Waiting for sync, but snapshot is not from cache."); + return false; + } + + // Raise data from cache if we have any documents or we are offline + return !snapshot.documents().empty() || online_state == OnlineState::Offline; +} + +bool QueryListener::ShouldRaiseEvent(const ViewSnapshot& snapshot) const { + // We don't need to handle include_document_metadata_changes() here because + // the Metadata only changes have already been stripped out if needed. At this + // point the only changes we will see are the ones we should propagate. + if (!snapshot.document_changes().empty()) { + return true; + } + + bool has_pending_writes_changed = + snapshot_.has_value() && + snapshot_.value().has_pending_writes() != snapshot.has_pending_writes(); + if (snapshot.sync_state_changed() || has_pending_writes_changed) { + return options_.include_query_metadata_changes(); + } + + // Generally we should have hit one of the cases above, but it's possible to + // get here if there were only metadata document changes and they got stripped + // out. + return false; +} + +void QueryListener::RaiseInitialEvent(const ViewSnapshot& snapshot) { + HARD_ASSERT(!raised_initial_event_, + "Trying to raise initial events for second time"); + + ViewSnapshot modified_snapshot = ViewSnapshot::FromInitialDocuments( + snapshot.query(), snapshot.documents(), snapshot.mutated_keys(), + snapshot.from_cache(), snapshot.excludes_metadata_changes()); + raised_initial_event_ = true; + listener_->OnEvent(std::move(modified_snapshot)); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.h new file mode 100644 index 0000000..eec5ada --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc new file mode 100644 index 0000000..e7405f9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc @@ -0,0 +1,658 @@ +/* + * 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/bundle/bundle_element.h" +#include "Firestore/core/src/bundle/bundle_loader.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_set.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/mutation_batch_result.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace core { + +namespace { + +using bundle::BundleElement; +using bundle::BundleLoader; +using bundle::InitialProgress; +using bundle::SuccessProgress; +using credentials::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::DocumentUpdateMap; +using model::kBatchIdUnknown; +using model::ListenSequenceNumber; +using model::MutableDocument; +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 && + absl::StrContains(error.error_message(), "requires an index")); + bool no_permission = (error.code() == Error::kErrorPermissionDenied); + return missing_index || no_permission; +} + +} // namespace + +SyncEngine::SyncEngine(LocalStore* local_store, + remote::RemoteStore* remote_store, + const credentials::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()); + 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), + queries.end()); + + 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 credentials::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. + DocumentMap 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. + } + } + + DocumentMap 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. + MutableDocument doc = + MutableDocument::NoDocument(limbo_key, SnapshotVersion::None()); + + // 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; + 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( + 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()); + + DocumentMap changes = local_store_->AcknowledgeBatch(batch_result); + EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); +} + +void SyncEngine::HandleRejectedWrite( + firebase::firestore::model::BatchId batch_id, Status error) { + AssertCallbackExists("HandleRejectedWrite"); + + DocumentMap 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 DocumentMap& 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(), + 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() && + enqueued_limbo_resolutions_.push_back(key)) { + LOG_DEBUG("New document in limbo: %s", key.ToString()); + 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) { + enqueued_limbo_resolutions_.remove(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(); +} + +absl::optional SyncEngine::ReadIntoLoader( + const bundle::BundleMetadata& metadata, + bundle::BundleReader& reader, + api::LoadBundleTask& result_task) { + BundleLoader loader(local_store_, metadata); + int64_t current_bytes_read = 0; + // Breaks when either error happened, or when there is no more element to + // read. + while (true) { + auto element = reader.GetNextElement(); + if (!reader.reader_status().ok()) { + LOG_WARN("Failed to GetNextElement() from bundle with error %s", + reader.reader_status().error_message()); + result_task.SetError(reader.reader_status()); + return absl::nullopt; + } + + // No more elements from reader. + if (element == nullptr) { + break; + } + + int64_t old_bytes_read = current_bytes_read; + current_bytes_read = reader.bytes_read(); + auto maybe_progress = loader.AddElement( + std::move(element), current_bytes_read - old_bytes_read); + if (!maybe_progress.ok()) { + LOG_WARN("Failed to AddElement() to bundle loader with error %s", + maybe_progress.status().error_message()); + result_task.SetError(maybe_progress.status()); + return absl::nullopt; + } + + if (maybe_progress.ValueOrDie().has_value()) { + result_task.UpdateProgress(maybe_progress.ConsumeValueOrDie().value()); + } + } + + return loader; +} + +void SyncEngine::LoadBundle(std::shared_ptr reader, + std::shared_ptr result_task) { + auto bundle_metadata = reader->GetBundleMetadata(); + if (!reader->reader_status().ok()) { + LOG_WARN("Failed to GetBundleMetadata() for bundle with error %s", + reader->reader_status().error_message()); + result_task->SetError(reader->reader_status()); + return; + } + + bool has_newer_bundle = local_store_->HasNewerBundle(bundle_metadata); + if (has_newer_bundle) { + result_task->SetSuccess(SuccessProgress(bundle_metadata)); + return; + } + + result_task->UpdateProgress(InitialProgress(bundle_metadata)); + auto maybe_loader = ReadIntoLoader(bundle_metadata, *reader, *result_task); + if (!maybe_loader.has_value()) { + // `ReadIntoLoader` would call `result_task.SetError` should there be an + // error, so we do not need set it here. + return; + } + + util::StatusOr changes = maybe_loader.value().ApplyChanges(); + if (!changes.ok()) { + LOG_WARN("Failed to ApplyChanges() for bundle elements with error %s", + changes.status().error_message()); + result_task->SetError(changes.status()); + return; + } + + EmitNewSnapshotsAndNotifyLocalStore(changes.ConsumeValueOrDie(), + absl::nullopt); + + result_task->SetSuccess(SuccessProgress(bundle_metadata)); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h new file mode 100644 index 0000000..c02685c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h @@ -0,0 +1,338 @@ +/* + * 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/api/load_bundle_task.h" +#include "Firestore/core/src/bundle/bundle_loader.h" +#include "Firestore/core/src/bundle/bundle_reader.h" +#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/random_access_queue.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 credentials::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 credentials::User& user); + + // Implements `RemoteStoreCallback` + void ApplyRemoteEvent(const remote::RemoteEvent& remote_event) override; + void HandleRejectedListen(model::TargetId target_id, + util::Status error) override; + void HandleSuccessfulWrite(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; + + void LoadBundle(std::shared_ptr reader, + std::shared_ptr result_task); + + // For tests only + std::map + GetActiveLimboDocumentResolutions() const { + // Return defensive copy + return active_limbo_targets_by_key_; + } + + // For tests only + std::vector GetEnqueuedLimboDocumentResolutions() const { + return enqueued_limbo_resolutions_.elements(); + } + + 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::DocumentMap& 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); + + absl::optional ReadIntoLoader( + const bundle::BundleMetadata& metadata, + bundle::BundleReader& reader, + api::LoadBundleTask& result_task); + + /** 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; + + credentials::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, + credentials::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. + */ + util::RandomAccessQueue + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine_callback.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine_callback.h new file mode 100644 index 0000000..64b2ba7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc new file mode 100644 index 0000000..7fa3dfa --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc @@ -0,0 +1,105 @@ +/* + * 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; + +// 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() && lhs.start_at() == rhs.start_at() && + lhs.end_at() == rhs.end_at(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.h new file mode 100644 index 0000000..fc8154a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target.h @@ -0,0 +1,160 @@ +/* + * 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" +#include "Firestore/core/src/remote/serializer.h" + +namespace firebase { +namespace firestore { +namespace bundle { +class BundleSerializer; +} +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 absl::optional& start_at() const { + return start_at_; + } + + const absl::optional& 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 only accessible by `Query` and `Serializer`. + * 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, + absl::optional start_at, + absl::optional 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; + friend class remote::Serializer; + friend class bundle::BundleSerializer; + + model::ResourcePath path_; + std::shared_ptr collection_group_; + FilterList filters_; + OrderByList order_bys_; + int32_t limit_ = kNoLimit; + absl::optional start_at_; + absl::optional 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc new file mode 100644 index 0000000..08ee7f5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc @@ -0,0 +1,48 @@ +/* + * 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/core/target_id_generator.h" + +#include "Firestore/core/src/util/hard_assert.h" + +using firebase::firestore::model::TargetId; + +namespace firebase { +namespace firestore { +namespace core { + +TargetIdGenerator::TargetIdGenerator(TargetIdGeneratorId generator_id, + TargetId seed) + : generator_id_(generator_id) { + seek(seed); +} + +void TargetIdGenerator::seek(TargetId target_id) { + const TargetId generator = static_cast(generator_id_); + HARD_ASSERT((target_id & generator) == generator, + "Cannot supply target ID from different generator ID"); + next_id_ = target_id; +} + +TargetId TargetIdGenerator::NextId() { + int next_id = next_id_; + next_id_ += 1 << kReservedBits; + return next_id; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h new file mode 100644 index 0000000..7dbef89 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h @@ -0,0 +1,95 @@ +/* + * 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_CORE_TARGET_ID_GENERATOR_H_ +#define FIRESTORE_CORE_SRC_CORE_TARGET_ID_GENERATOR_H_ + +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** The set of all valid generators. */ +enum class TargetIdGeneratorId { TargetCache = 0, SyncEngine = 1 }; + +/** + * Generates monotonically increasing target IDs for sending targets to the + * watch stream. + * + * The client constructs two generators, one for the query cache (via + * `QueryCacheTargetIdGenerator(int after)`), and one for limbo documents (via + * `SyncEngineTargetIdGenerator()`). These two generators produce + * non-overlapping IDs (by using even and odd IDs respectively). + * + * By separating the target ID space, the query cache can generate target IDs + * that persist across client restarts, while sync engine can independently + * generate in-memory target IDs that are transient and can be reused after a + * restart. + * + * Not thread-safe. + */ +// TODO(mrschmidt): Explore removing this class in favor of generating these IDs +// directly in SyncEngine and LocalStore. +class TargetIdGenerator { + public: + TargetIdGenerator() = default; + + /** + * 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 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; + } + + /** + * Creates and returns the TargetIdGenerator for the sync engine. + * + * @return An instance of TargetIdGenerator. + */ + static TargetIdGenerator SyncEngineTargetIdGenerator() { + // Sync engine assigns target IDs for limbo document detection. + return TargetIdGenerator(TargetIdGeneratorId::SyncEngine, 1); + } + + TargetIdGeneratorId generator_id() { + return generator_id_; + } + + model::TargetId NextId(); + + private: + TargetIdGenerator(TargetIdGeneratorId generator_id, model::TargetId seed); + void seek(model::TargetId target_id); + + TargetIdGeneratorId generator_id_ = TargetIdGeneratorId::TargetCache; + model::TargetId next_id_ = 0; + + static const int kReservedBits = 1; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_TARGET_ID_GENERATOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc new file mode 100644 index 0000000..6222bd3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc @@ -0,0 +1,253 @@ +/* + * 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 + +#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/document.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::Document; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::DocumentKeyHash; +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(std::shared_ptr datastore) + : datastore_{datastore} { +} + +Status Transaction::RecordVersion(const Document& doc) { + SnapshotVersion doc_version; + + if (doc->is_found_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.ToString()); + } + + 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; + } + + std::shared_ptr datastore = datastore_.lock(); + if (!datastore) { + callback(Status(Error::kErrorFailedPrecondition, + "The client has already been terminated.")); + 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 Document& 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).ToMutation(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).ToMutation(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; + + std::shared_ptr datastore = datastore_.lock(); + if (!datastore) { + callback(Status(Error::kErrorFailedPrecondition, + "The client has already been terminated.")); + return; + } + + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h new file mode 100644 index 0000000..6cd1a27 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h @@ -0,0 +1,176 @@ +/* + * 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_H_ +#define FIRESTORE_CORE_SRC_CORE_TRANSACTION_H_ + +#include +#include +#include +#include +#include + +#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 model { +class Precondition; +class Document; +} // namespace model + +namespace remote { +class Datastore; +} // namespace remote + +namespace core { + +class ParsedSetData; +class ParsedUpdateData; + +class Transaction { + public: + using LookupCallback = + std::function>&)>; + + Transaction() = default; + explicit Transaction(std::shared_ptr datastore); + + /** + * Takes a set of keys and asynchronously attempts to fetch all the documents + * from the backend, ignoring any local changes. + */ + void Lookup(const std::vector& keys, + LookupCallback&& callback); + + /** + * Stores mutation for the given key and set data, to be committed when + * `Commit` is called. + */ + void Set(const model::DocumentKey& key, ParsedSetData&& data); + + /** + * Stores mutations for the given key and update data, to be committed when + * `Commit` is called. + */ + void Update(const model::DocumentKey& key, ParsedUpdateData&& data); + + /** + * Stores a delete mutation for the given key, to be committed when `Commit` + * is called. + */ + void Delete(const model::DocumentKey& key); + + /** + * Attempts to commit the mutations set on this transaction. Invokes the given + * callback when finished. Once this is called, no other mutations or + * commits are allowed on the transaction. + */ + void Commit(util::StatusCallback&& callback); + + /** + * Marks the transaction as permanently failed, so the transaction will not + * retry. + */ + void MarkPermanentlyFailed(); + + /** + * Checks if the transaction is permanently failed. + */ + bool IsPermanentlyFailed() const; + + private: + /** + * Every time a document is read, this should be called to record its version. + * If we read two different versions of the same document, this will return an + * error. When the transaction is committed, the versions recorded will be set + * as preconditions on the writes sent to the backend. + */ + util::Status RecordVersion(const model::Document& doc); + + /** Stores mutations to be written when `Commit` is called. */ + void WriteMutations(std::vector&& mutations); + + /** + * Returns version of this doc when it was read in this transaction as a + * precondition, or no precondition if it was not read. + */ + model::Precondition CreatePrecondition(const model::DocumentKey& key); + + /** + * Returns the precondition for a document if the operation is an update. Will + * return a failed status if an error occurred. + */ + util::StatusOr CreateUpdatePrecondition( + const model::DocumentKey& key); + + void EnsureCommitNotCalled(); + + absl::optional GetVersion( + const model::DocumentKey& key) const; + + std::weak_ptr datastore_; + + std::vector mutations_; + bool committed_ = false; + bool permanent_error_ = false; + + /** + * A deferred usage error that occurred previously in this transaction that + * will cause the transaction to fail once it actually commits. + */ + util::Status last_write_error_; + + /** + * Set of documents that have been written in the transaction. + * + * When there's more than one write to the same key in a transaction, any + * writes after the first are handled differently. + */ + std::unordered_set written_docs_; + + std::unordered_map + read_versions_; +}; + +using TransactionResultCallback = util::StatusCallback; + +/** + * TransactionUpdateCallback is a block that wraps a user's transaction update + * block internally. + * + * The update block will be called with two parameters: + * * The transaction: an object with methods for performing reads and writes + * within the transaction. + * * The callback: to be called by the block once the user's code is finished. + */ +using TransactionUpdateCallback = std::function, TransactionResultCallback)>; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_TRANSACTION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.cc new file mode 100644 index 0000000..6ce1b10 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.cc @@ -0,0 +1,110 @@ +/* + * 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_runner.h" + +#include + +#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 attempted before failing. */ +constexpr int kMaxAttemptsCount = 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}, + attempts_remaining_{kMaxAttemptsCount} { +} + +void TransactionRunner::Run() { + queue_->VerifyIsCurrentQueue(); + attempts_remaining_ -= 1; + + 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 (attempts_remaining_ > 0 && IsRetryableTransactionError(status) && + !transaction->IsPermanentlyFailed()) { + Run(); + } else { + result_callback_(std::move(status)); + } +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.h new file mode 100644 index 0000000..7e3501a --- /dev/null +++ b/SaraAttended/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 status); + + 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 attempts_remaining_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_TRANSACTION_RUNNER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc new file mode 100644 index 0000000..0a2a771 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc @@ -0,0 +1,257 @@ +/* + * 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/user_data.h" + +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.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_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 model::DocumentKey; +using model::FieldMask; +using model::FieldPath; +using model::FieldTransform; +using model::Mutation; +using model::ObjectValue; +using model::PatchMutation; +using model::Precondition; +using model::SetMutation; +using model::TransformOperation; +using util::ThrowInvalidArgument; + +// MARK: - ParseAccumulator + +ParseContext ParseAccumulator::RootContext() { + return ParseContext{ + this, absl::make_unique(FieldPath::EmptyPath()), false}; +} + +bool ParseAccumulator::Contains(const FieldPath& field_path) const { + for (const FieldPath& field : field_mask_) { + if (field_path.IsPrefixOf(field)) { + return true; + } + } + + for (const FieldTransform& field_transform : field_transforms_) { + if (field_path.IsPrefixOf(field_transform.path())) { + return true; + } + } + + return false; +} + +void ParseAccumulator::AddToFieldMask(FieldPath field_path) { + field_mask_.insert(std::move(field_path)); +} + +void ParseAccumulator::AddToFieldTransforms( + FieldPath field_path, TransformOperation transform_operation) { + // TODO(mrschmidt): Validate that the paths are unique + field_transforms_.emplace_back(std::move(field_path), + std::move(transform_operation)); +} + +ParsedSetData ParseAccumulator::MergeData(ObjectValue data) && { + return ParsedSetData{std::move(data), FieldMask{std::move(field_mask_)}, + std::move(field_transforms_)}; +} + +ParsedSetData ParseAccumulator::MergeData(ObjectValue data, + model::FieldMask user_field_mask) && { + std::vector covered_field_transforms; + + for (FieldTransform& field_transform : field_transforms_) { + if (user_field_mask.covers(field_transform.path())) { + covered_field_transforms.push_back(std::move(field_transform)); + } + } + + return ParsedSetData{std::move(data), std::move(user_field_mask), + std::move(covered_field_transforms)}; +} + +ParsedSetData ParseAccumulator::SetData(ObjectValue data) && { + return ParsedSetData{std::move(data), std::move(field_transforms_)}; +} + +ParsedUpdateData ParseAccumulator::UpdateData(ObjectValue data) && { + return ParsedUpdateData{std::move(data), FieldMask{std::move(field_mask_)}, + std::move(field_transforms_)}; +} + +// MARK: - ParseContext + +namespace { + +const char* RESERVED_FIELD_DESIGNATOR = "__"; + +} // namespace + +ParseContext ParseContext::ChildContext(const std::string& field_name) { + std::unique_ptr path; + if (path_) { + path = absl::make_unique(path_->Append(field_name)); + } + + ParseContext context{accumulator_, std::move(path), false}; + context.ValidatePathSegment(field_name); + return context; +} + +ParseContext ParseContext::ChildContext(const FieldPath& field_path) { + std::unique_ptr path; + if (path_) { + path = absl::make_unique(path_->Append(field_path)); + } + + ParseContext context{accumulator_, std::move(path), false}; + context.ValidatePath(); + return context; +} + +ParseContext ParseContext::ChildContext(size_t array_index) { + // TODO(b/34871131): We don't support array paths right now; make path null. + (void)array_index; + return {accumulator_, /* path= */ nullptr, /* array_element= */ true}; +} + +/** + * Returns a string that can be appended to error messages indicating what field + * caused the error. + */ +std::string ParseContext::FieldDescription() const { + // TODO(b/34871131): Remove nullptr check once we have proper paths for fields + // within arrays. + if (!path_ || path_->empty()) { + return ""; + } else { + return util::StringFormat(" (found in field %s)", path_->CanonicalString()); + } +} + +bool ParseContext::write() const { + switch (accumulator_->data_source()) { + case UserDataSource::Set: // Falls through. + case UserDataSource::MergeSet: // Falls through. + case UserDataSource::Update: + return true; + case UserDataSource::Argument: + case UserDataSource::ArrayArgument: + return false; + default: + ThrowInvalidArgument("Unexpected case for UserDataSource: %s", + accumulator_->data_source()); + } +} + +void ParseContext::ValidatePath() const { + // TODO(b/34871131): Remove nullptr check once we have proper paths for fields + // within arrays. + if (!path_) { + return; + } + for (const std::string& segment : *path_) { + ValidatePathSegment(segment); + } +} + +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( + "Invalid data. Document fields cannot begin and end with \"%s\"%s", + RESERVED_FIELD_DESIGNATOR, FieldDescription()); + } +} + +void ParseContext::AddToFieldMask(FieldPath field_path) { + accumulator_->AddToFieldMask(std::move(field_path)); +} + +void ParseContext::AddToFieldTransforms( + FieldPath field_path, TransformOperation transform_operation) { + accumulator_->AddToFieldTransforms(std::move(field_path), + std::move(transform_operation)); +} + +// MARK: - ParsedSetData + +ParsedSetData::ParsedSetData(ObjectValue data, + std::vector field_transforms) + : data_{std::move(data)}, + field_transforms_{std::move(field_transforms)}, + patch_{false} { +} + +ParsedSetData::ParsedSetData(ObjectValue data, + FieldMask field_mask, + std::vector field_transforms) + : data_{std::move(data)}, + field_mask_{std::move(field_mask)}, + field_transforms_{std::move(field_transforms)}, + patch_{true} { +} + +Mutation ParsedSetData::ToMutation(const DocumentKey& key, + const Precondition& precondition) && { + if (patch_) { + return PatchMutation(key, std::move(data_), std::move(field_mask_), + precondition, std::move(field_transforms_)); + } else { + return SetMutation(key, std::move(data_), precondition, + std::move(field_transforms_)); + } +} + +// MARK: - ParsedUpdateData + +ParsedUpdateData::ParsedUpdateData( + ObjectValue data, + model::FieldMask field_mask, + std::vector field_transforms) + : data_{std::move(data)}, + field_mask_{std::move(field_mask)}, + field_transforms_{std::move(field_transforms)} { +} + +Mutation ParsedUpdateData::ToMutation(const DocumentKey& key, + const Precondition& precondition) && { + return PatchMutation(key, std::move(data_), std::move(field_mask_), + precondition, std::move(field_transforms_)); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h new file mode 100644 index 0000000..eb20250 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h @@ -0,0 +1,338 @@ +/* + * 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_USER_DATA_H_ +#define FIRESTORE_CORE_SRC_CORE_USER_DATA_H_ + +#include +#include +#include +#include +#include + +#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/object_value.h" + +namespace firebase { +namespace firestore { +namespace model { + +class Precondition; +class Mutation; +class DocumentKey; + +} // namespace model + +namespace core { + +class ParseContext; +class ParsedSetData; +class ParsedUpdateData; + +/** + * Represents what type of API method provided the data being parsed; useful for + * determining which error conditions apply during parsing and providing better + * error messages. + */ +enum class UserDataSource { + /** The data comes from a regular Set operation, without merge. */ + Set, + /** The data comes from a Set operation with merge enabled. */ + MergeSet, + /** The data comes from an Update operation. */ + Update, + /** + * Indicates the source is a where clause, cursor bound, array union element, + * etc. In particular, this will result in ParseContext.write() returning + * false. + */ + Argument, + /** + * Indicates that the source is an Argument that may directly contain nested + * arrays (e.g. the operand of a `in` query). + */ + ArrayArgument +}; + +/** + * Accumulates the side-effect results of parsing user input. These include: + * + * * The field mask naming all the fields that have values. + * * The transform operations that must be applied in the batch to implement + * server-generated behavior. In the wire protocol these are encoded + * separately from the Value. + */ +class ParseAccumulator { + public: + /** + * @param data_source Indicates what kind of API method this data came from. + */ + explicit ParseAccumulator(UserDataSource data_source) + : data_source_{data_source} { + } + + /** + * What type of API method provided the data being parsed; useful for + * determining which error conditions apply during parsing and providing + * better error messages. + */ + UserDataSource data_source() const { + return data_source_; + } + + /** + * Returns the current list of transforms. + */ + const std::vector& field_transforms() const { + return field_transforms_; + } + + /** + * Returns a new ParseContext representing the root of a user document. + */ + ParseContext RootContext(); + + /** + * Returns `true` if the given `field_path` was encountered in the current + * document. + */ + bool Contains(const model::FieldPath& field_path) const; + + /** + * Adds the given `field_path` to the accumulated FieldMask. + */ + void AddToFieldMask(model::FieldPath field_path); + + /** + * Adds a transformation for the given field path. + */ + void AddToFieldTransforms(model::FieldPath field_path, + model::TransformOperation transform_operation); + + /** + * Wraps the given `data` along with any accumulated field mask and transforms + * into a ParsedSetData representing a user-issued merge. + * + * @return ParsedSetData that has consumed the contents of this + * ParseAccumulator. + */ + ParsedSetData MergeData(model::ObjectValue data) &&; + + /** + * Wraps the given `data` and `user_field_mask` along with any accumulated + * transforms that are covered by the given field mask into a ParsedSetData + * that represents a user-issued merge. + * + * @param data The converted user data. + * @param user_field_mask The user-supplied field mask that masks out any + * changes that have been accumulated so far. + * + * @return ParsedSetData that has consumed the contents of this + * ParseAccumulator. The field mask in the result will be the user_field_mask + * and only transforms that are covered by the mask will be included. + */ + ParsedSetData MergeData(model::ObjectValue data, + model::FieldMask user_field_mask) &&; + + /** + * Wraps the given `data` along with any accumulated transforms into a + * ParsedSetData that represents a user-issued Set. + * + * @return ParsedSetData that has consumed the contents of this + * ParseAccumulator. + */ + ParsedSetData SetData(model::ObjectValue data) &&; + + /** + * Wraps the given `data` along with any accumulated field mask and transforms + * into a ParsedUpdateData that represents a user-issued Update. + * + * @return ParsedSetData that has consumed the contents of this + * ParseAccumulator. + */ + ParsedUpdateData UpdateData(model::ObjectValue data) &&; + + private: + friend class ParseContext; + + UserDataSource data_source_; + + // field_mask_ and field_transforms_ are shared across all active context + // objects to accumulate the result. All ChildContext objects append their + // results here. + std::set field_mask_; + std::vector field_transforms_; +}; + +/** + * A "context" object that wraps a ParseAccumulator and refers to a specific + * location in a user-supplied document. Instances are created and passed around + * while traversing user data during parsing in order to conveniently accumulate + * data in the ParseAccumulator. + */ +class ParseContext { + public: + /** + * Initializes a ParseContext with the given source and path. + * + * @param path A path within the object being parsed. This could be an empty + * path (in which case the context represents the root of the data being + * parsed), or a nonempty path (indicating the context represents a nested + * location within the data). + * + * TODO(b/34871131): We don't support array paths right now, so path can be + * nullptr to indicate the context represents any location within an array (in + * which case certain features will not work and errors will be somewhat + * compromised). + */ + ParseContext(ParseAccumulator* accumulator, + std::unique_ptr path, + bool array_element) + : accumulator_{accumulator}, + path_{std::move(path)}, + array_element_{array_element} { + } + + /** Whether or not this context corresponds to an element of an array. */ + bool array_element() const { + return array_element_; + } + + /** + * What type of API method provided the data being parsed; useful for + * determining which error conditions apply during parsing and providing + * better error messages. + */ + UserDataSource data_source() const { + return accumulator_->data_source_; + } + + const model::FieldPath* path() const { + return path_.get(); + } + + /** + * Returns true for the non-query parse contexts (Set, MergeSet and Update). + */ + bool write() const; + + std::string FieldDescription() const; + + // Helpers to get a ParseContext for a child field. + ParseContext ChildContext(const std::string& field_name); + ParseContext ChildContext(const model::FieldPath& field_path); + ParseContext ChildContext(size_t array_index); + + void AddToFieldMask(model::FieldPath field_path); + + void AddToFieldTransforms(model::FieldPath field_path, + model::TransformOperation transform_operation); + + private: + void ValidatePath() const; + void ValidatePathSegment(absl::string_view segment) const; + + ParseAccumulator* accumulator_; // Non owning + + /** The current path being parsed. */ + // TODO(b/34871131): path should never be nullptr, but we don't support array + // paths right now. + std::unique_ptr path_; + + bool array_element_ = false; +}; + +/** The result of parsing document data (e.g. for a SetData call). */ +class ParsedSetData { + public: + ParsedSetData(model::ObjectValue data, + std::vector field_transforms); + ParsedSetData(model::ObjectValue data, + model::FieldMask field_mask, + std::vector field_transforms); + + /** + * Converts the parsed document data into 1 or 2 mutations (depending on + * whether there are any field transforms) using the specified document key + * and precondition. + * + * This method consumes the values stored in the ParsedSetData + */ + model::Mutation ToMutation(const model::DocumentKey& key, + const model::Precondition& precondition) &&; + + const model::ObjectValue& data() const { + return data_; + } + + const model::FieldMask& fieldMask() const { + return field_mask_; + } + + const std::vector& field_transforms() const { + return field_transforms_; + } + + private: + model::ObjectValue data_; + model::FieldMask field_mask_; + std::vector field_transforms_; + bool patch_; +}; + +/** The result of parsing "update" data (i.e. for an UpdateData call). */ +class ParsedUpdateData { + public: + ParsedUpdateData(model::ObjectValue data, + model::FieldMask field_mask, + std::vector field_transforms); + + const model::ObjectValue& data() const { + return data_; + } + + const model::FieldMask& fieldMask() const { + return field_mask_; + } + + const std::vector& field_transforms() const { + return field_transforms_; + } + + /** + * Converts the parsed update data into 1 or 2 mutations (depending on whether + * there are any field transforms) using the specified document key and + * precondition. + * + * This method consumes the values stored in the ParsedUpdateData + */ + model::Mutation ToMutation(const model::DocumentKey& key, + const model::Precondition& precondition) &&; + + private: + model::ObjectValue data_; + // The field mask does not include document transforms. + model::FieldMask field_mask_; + std::vector field_transforms_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_USER_DATA_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.cc new file mode 100644 index 0000000..c80adf5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.cc @@ -0,0 +1,399 @@ +/* + * 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/view.h" + +#include + +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/model/document_set.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::DocumentSet; +using model::OnlineState; +using remote::TargetChange; +using util::ComparisonResult; + +// MARK: - LimboDocumentChange + +LimboDocumentChange::LimboDocumentChange( + firebase::firestore::core::LimboDocumentChange::Type type, + firebase::firestore::model::DocumentKey key) + : type_(type), key_(std::move(key)) { +} + +bool operator==(const LimboDocumentChange& lhs, + const LimboDocumentChange& rhs) { + return lhs.type() == rhs.type() && lhs.key() == rhs.key(); +} + +// MARK: - ViewDocumentChanges + +ViewDocumentChanges::ViewDocumentChanges(model::DocumentSet new_documents, + DocumentViewChangeSet changes, + model::DocumentKeySet mutated_keys, + bool needs_refill) + : document_set_(std::move(new_documents)), + change_set_(std::move(changes)), + mutated_keys_(std::move(mutated_keys)), + needs_refill_(needs_refill) { +} + +// MARK: - View + +namespace { + +int GetDocumentViewChangeTypePosition(DocumentViewChange::Type change_type) { + switch (change_type) { + case DocumentViewChange::Type::Removed: + return 0; + case DocumentViewChange::Type::Added: + return 1; + case DocumentViewChange::Type::Modified: + return 2; + case DocumentViewChange::Type::Metadata: + // A metadata change is converted to a modified change at the public API + // layer. Since we sort by document key and then change type, metadata and + // modified changes must be sorted equivalently. + return 2; + } + HARD_FAIL("Unknown DocumentViewChange::Type %s", change_type); +} + +} // namespace + +View::View(Query query, DocumentKeySet remote_documents) + : query_(std::move(query)), + document_set_(query_.Comparator()), + synced_documents_(std::move(remote_documents)) { +} + +ComparisonResult View::Compare(const Document& lhs, const Document& rhs) const { + return document_set_.comparator().Compare(lhs, rhs); +} + +ViewDocumentChanges View::ComputeDocumentChanges( + const DocumentMap& doc_changes, + const absl::optional& previous_changes) const { + DocumentViewChangeSet change_set; + if (previous_changes) { + change_set = previous_changes->change_set(); + } + DocumentSet old_document_set = + previous_changes ? previous_changes->document_set() : document_set_; + + DocumentKeySet new_mutated_keys = + previous_changes ? previous_changes->mutated_keys() : mutated_keys_; + DocumentKeySet old_mutated_keys = mutated_keys_; + DocumentSet new_document_set = old_document_set; + bool needs_refill = false; + + // Track the last doc in a (full) limit. This is necessary, because some + // update (a delete, or an update moving a doc past the old limit) might mean + // there is some other document in the local cache that either should come (1) + // between the old last limit doc and the new last document, in the case of + // updates, or (2) after the new last document, in the case of deletes. So we + // keep this doc at the old limit to compare the updates to. + // + // 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_.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; + + absl::optional old_doc = old_document_set.GetDocument(key); + absl::optional new_doc = query_.Matches(kv.second) + ? absl::optional{kv.second} + : absl::nullopt; + + bool old_doc_had_pending_mutations = + old_doc && old_mutated_keys.contains(key); + + // We only consider committed mutations for documents that were mutated + // during the lifetime of the view. + bool new_doc_has_pending_mutations = + new_doc && ((*new_doc)->has_local_mutations() || + (old_mutated_keys.contains(key) && + (*new_doc)->has_committed_mutations())); + + bool change_applied = false; + // Calculate change + if (old_doc && new_doc) { + bool docs_equal = (*old_doc)->value() == (*new_doc)->value(); + if (!docs_equal) { + if (!ShouldWaitForSyncedDocument(*new_doc, *old_doc)) { + change_set.AddChange( + DocumentViewChange{*new_doc, DocumentViewChange::Type::Modified}); + change_applied = true; + + 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. + needs_refill = true; + } + } + } else if (old_doc_had_pending_mutations != + new_doc_has_pending_mutations) { + change_set.AddChange( + DocumentViewChange{*new_doc, DocumentViewChange::Type::Metadata}); + change_applied = true; + } + + } else if (!old_doc && new_doc) { + change_set.AddChange( + DocumentViewChange{*new_doc, DocumentViewChange::Type::Added}); + change_applied = true; + } else if (old_doc && !new_doc) { + change_set.AddChange( + DocumentViewChange{*old_doc, DocumentViewChange::Type::Removed}); + change_applied = true; + + 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. + needs_refill = true; + } + } + + if (change_applied) { + if (new_doc) { + new_document_set = new_document_set.insert(new_doc); + if ((*new_doc)->has_local_mutations()) { + new_mutated_keys = new_mutated_keys.insert(key); + } else { + new_mutated_keys = new_mutated_keys.erase(key); + } + } else { + new_document_set = new_document_set.erase(key); + new_mutated_keys = new_mutated_keys.erase(key); + } + } + } + + // 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}); + } + } + } + + HARD_ASSERT(!needs_refill || !previous_changes, + "View was refilled using docs that themselves needed refilling."); + + return ViewDocumentChanges(std::move(new_document_set), std::move(change_set), + new_mutated_keys, needs_refill); +} + +bool View::ShouldWaitForSyncedDocument(const Document& new_doc, + const Document& old_doc) const { + // We suppress the initial change event for documents that were modified as + // part of a write acknowledgment (e.g. when the value of a server transform + // is applied) as Watch will send us the same document again. By suppressing + // the event, we only raise two user visible events (one with + // `has_pending_writes` and the final state of the document) instead of three + // (one with `has_pending_writes`, the modified document with + // `has_pending_writes` and the final state of the document). + return (old_doc->has_local_mutations() && + new_doc->has_committed_mutations() && + !new_doc->has_local_mutations()); +} + +ViewChange View::ApplyChanges(const ViewDocumentChanges& doc_changes) { + return ApplyChanges(doc_changes, {}); +} + +ViewChange View::ApplyChanges( + const ViewDocumentChanges& doc_changes, + const absl::optional& target_change) { + HARD_ASSERT(!doc_changes.needs_refill(), + "Cannot apply changes that need a refill"); + + DocumentSet old_documents = document_set_; + document_set_ = doc_changes.document_set(); + mutated_keys_ = doc_changes.mutated_keys(); + + // Sort changes based on type and query comparator. + std::vector changes = + doc_changes.change_set().GetChanges(); + std::sort( + changes.begin(), changes.end(), + [this](const DocumentViewChange& lhs, const DocumentViewChange& rhs) { + int pos1 = GetDocumentViewChangeTypePosition(lhs.type()); + int pos2 = GetDocumentViewChangeTypePosition(rhs.type()); + if (pos1 != pos2) { + return pos1 < pos2; + } + return util::Ascending(Compare(lhs.document(), rhs.document())); + }); + + ApplyTargetChange(target_change); + std::vector limbo_changes = UpdateLimboDocuments(); + bool synced = limbo_documents_.empty() && current_; + SyncState new_sync_state = synced ? SyncState::Synced : SyncState::Local; + bool sync_state_changed = new_sync_state != sync_state_; + sync_state_ = new_sync_state; + + if (changes.empty() && !sync_state_changed) { + // No changes. + return ViewChange(absl::nullopt, std::move(limbo_changes)); + } else { + ViewSnapshot snapshot{query_, + doc_changes.document_set(), + old_documents, + std::move(changes), + doc_changes.mutated_keys(), + /*from_cache=*/new_sync_state == SyncState::Local, + sync_state_changed, + /*excludes_metadata_changes=*/false}; + + return ViewChange(std::move(snapshot), std::move(limbo_changes)); + } +} + +ViewChange View::ApplyOnlineStateChange(OnlineState online_state) { + if (current_ && online_state == OnlineState::Offline) { + // If we're offline, set `current_` to false and then call ApplyChanges to + // refresh our sync state and generate a ViewChange as appropriate. We are + // guaranteed to get a new `TargetChange` that sets `current_` back to true + // once the client is back online. + current_ = false; + return ApplyChanges( + ViewDocumentChanges(document_set_, DocumentViewChangeSet{}, + mutated_keys_, /* needs_refill= */ false)); + } else { + // No effect, just return a no-op ViewChange. + return ViewChange(absl::nullopt, {}); + } +} + +// MARK: Private Methods + +/** Returns whether the doc for the given key should be in limbo. */ +bool View::ShouldBeInLimbo(const DocumentKey& key) const { + // If the remote end says it's part of this query, it's not in limbo. + if (synced_documents_.contains(key)) { + return false; + } + // The local store doesn't think it's a result, so it shouldn't be in limbo. + if (!document_set_.ContainsKey(key)) { + return false; + } + // If there are local changes to the doc, they might explain why the server + // doesn't know that it's part of the query. So don't put it in limbo. + // TODO(klimt): Ideally, we would only consider changes that might actually + // affect this specific query. + if ((*document_set_.GetDocument(key))->has_local_mutations()) { + return false; + } + // Everything else is in limbo. + return true; +} + +/** + * Updates synced_documents_ and current based on the given change. + */ +void View::ApplyTargetChange( + const absl::optional& maybe_target_change) { + if (maybe_target_change.has_value()) { + const TargetChange& target_change = maybe_target_change.value(); + + for (const DocumentKey& key : target_change.added_documents()) { + synced_documents_ = synced_documents_.insert(key); + } + for (const DocumentKey& key : target_change.modified_documents()) { + HARD_ASSERT(synced_documents_.find(key) != synced_documents_.end(), + "Modified document %s not found in view.", key.ToString()); + } + for (const DocumentKey& key : target_change.removed_documents()) { + synced_documents_ = synced_documents_.erase(key); + } + + current_ = target_change.current(); + } +} + +/** Updates limbo_documents_ and returns any changes as LimboDocumentChanges. */ +std::vector View::UpdateLimboDocuments() { + // We can only determine limbo documents when we're in-sync with the server. + if (!current_) { + return {}; + } + + // TODO(klimt): Do this incrementally so that it's not quadratic when updating + // many documents. + DocumentKeySet old_limbo_documents = std::move(limbo_documents_); + limbo_documents_ = DocumentKeySet{}; + for (const Document& doc : document_set_) { + if (ShouldBeInLimbo(doc->key())) { + limbo_documents_ = limbo_documents_.insert(doc->key()); + } + } + + // Diff the new limbo docs with the old limbo docs. + std::vector changes; + changes.reserve(old_limbo_documents.size() + limbo_documents_.size()); + + for (const DocumentKey& key : old_limbo_documents) { + if (!limbo_documents_.contains(key)) { + changes.push_back(LimboDocumentChange::Removed(key)); + } + } + for (const DocumentKey& key : limbo_documents_) { + if (!old_limbo_documents.contains(key)) { + changes.push_back(LimboDocumentChange::Added(key)); + } + } + return changes; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.h new file mode 100644 index 0000000..b3cdbce --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view.h @@ -0,0 +1,237 @@ +/* + * 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_VIEW_H_ +#define FIRESTORE_CORE_SRC_CORE_VIEW_H_ + +#include +#include + +#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 { +namespace core { + +/** A change to a particular document wrt whether it is in "limbo". */ +class LimboDocumentChange { + public: + enum class Type { + Added, + Removed, + }; + + static LimboDocumentChange Added(model::DocumentKey key) { + return {Type::Added, std::move(key)}; + } + + static LimboDocumentChange Removed(model::DocumentKey key) { + return {Type::Removed, std::move(key)}; + } + + LimboDocumentChange(Type type, model::DocumentKey key); + + Type type() const { + return type_; + } + + const model::DocumentKey& key() const { + return key_; + } + + friend bool operator==(const LimboDocumentChange& lhs, + const LimboDocumentChange& rhs); + + private: + Type type_; + model::DocumentKey key_; +}; + +/** The result of applying a set of doc changes to a view. */ +class ViewDocumentChanges { + public: + ViewDocumentChanges(model::DocumentSet new_documents, + DocumentViewChangeSet changes, + model::DocumentKeySet mutated_keys, + bool needs_refill); + + /** The new set of docs that should be in the view. */ + const model::DocumentSet& document_set() const { + return document_set_; + } + + /** The diff of these docs with the previous set of docs. */ + const core::DocumentViewChangeSet& change_set() const { + return change_set_; + } + + const model::DocumentKeySet& mutated_keys() const { + return mutated_keys_; + } + + /** + * Whether the set of documents passed in was not sufficient to calculate the + * new state of the view and there needs to be another pass based on the local + * cache. + */ + bool needs_refill() const { + return needs_refill_; + } + + private: + model::DocumentSet document_set_; + core::DocumentViewChangeSet change_set_; + model::DocumentKeySet mutated_keys_; + bool needs_refill_ = false; +}; + +/** A set of changes to a view. */ +class ViewChange { + public: + ViewChange(absl::optional snapshot, + std::vector limbo_changes) + : snapshot_(std::move(snapshot)), + limbo_changes_(std::move(limbo_changes)) { + } + + const absl::optional snapshot() const& { + return snapshot_; + } + + absl::optional&& snapshot() && { + return std::move(snapshot_); + } + + const std::vector limbo_changes() const { + return limbo_changes_; + } + + private: + absl::optional snapshot_; + std::vector limbo_changes_; +}; + +/** + * View is responsible for computing the final merged truth of what docs are in + * a query. It gets notified of local and remote changes to docs, and applies + * the query filters and limits to determine the most correct possible results. + */ +class View { + public: + View(Query query, model::DocumentKeySet remote_documents); + + /** + * The set of remote documents that the server has told us belongs to the + * target associated with this view. + */ + const model::DocumentKeySet& synced_documents() const { + return synced_documents_; + } + + /** + * Iterates over a set of doc changes, applies the query limit, and computes + * what the new results should be, what the changes were, and whether we may + * need to go back to the local cache for more results. Does not make any + * changes to the view. + * + * @param doc_changes The doc changes to apply to this view. + * @param previous_changes If this is being called with a refill, then start + * with this set of docs and changes instead of the current view. + * @return a new set of docs, changes, and refill flag. + */ + core::ViewDocumentChanges ComputeDocumentChanges( + const model::DocumentMap& doc_changes, + const absl::optional& previous_changes = + absl::nullopt) const; + + /** + * Updates the view with the given ViewDocumentChanges. + * + * @param doc_changes The set of changes to make to the view's docs. + * @return A new ViewChange with the given docs, changes, and sync state. + */ + ViewChange ApplyChanges(const core::ViewDocumentChanges& doc_changes); + + /** + * Updates the view with the given ViewDocumentChanges and updates limbo docs + * and sync state from the given (optional) target change. + * + * @param doc_changes The set of changes to make to the view's docs. + * @param target_change A target change to apply for computing limbo docs and + * sync state. + * @return A new ViewChange with the given docs, changes, and sync state. + */ + ViewChange ApplyChanges( + const core::ViewDocumentChanges& doc_changes, + const absl::optional& target_change); + + /** + * Applies an OnlineState change to the view, potentially generating an + * ViewChange if the view's sync_state_ changes as a result. + */ + 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; + + bool ShouldBeInLimbo(const model::DocumentKey& key) const; + + bool ShouldWaitForSyncedDocument(const model::Document& new_doc, + const model::Document& old_doc) const; + + void ApplyTargetChange( + const absl::optional& maybe_target_change); + + std::vector UpdateLimboDocuments(); + + Query query_; + + model::DocumentSet document_set_; + + /** Documents included in the remote target. */ + model::DocumentKeySet synced_documents_; + + /** Documents in the view but not in the remote target */ + model::DocumentKeySet limbo_documents_; + + /** Document Keys that have local changes. */ + model::DocumentKeySet mutated_keys_; + + SyncState sync_state_ = SyncState::None; + + /** + * A flag whether the view is current with the backend. A view is considered + * current after it has seen the current flag from the backend and did not + * lose consistency within the watch stream (e.g. because of an existence + * filter mismatch). + */ + bool current_ = false; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_VIEW_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc new file mode 100644 index 0000000..4a1aa49 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc @@ -0,0 +1,219 @@ +/* + * 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/view_snapshot.h" + +#include + +#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 { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentSet; +using util::StringFormat; + +// DocumentViewChange + +DocumentViewChange::DocumentViewChange(Document document, Type type) + : document_{std::move(document)}, type_{type} { +} + +const Document& DocumentViewChange::document() const { + return document_; +} + +std::string DocumentViewChange::ToString() const { + return StringFormat("", + util::ToString(document()), type()); +} + +size_t DocumentViewChange::Hash() const { + return util::Hash(document(), type()); +} + +bool operator==(const DocumentViewChange& lhs, const DocumentViewChange& rhs) { + return lhs.document() == rhs.document() && lhs.type() == rhs.type(); +} + +// DocumentViewChangeSet + +void DocumentViewChangeSet::AddChange(DocumentViewChange&& change) { + const DocumentKey& key = change.document()->key(); + auto old_change_iter = change_map_.find(key); + if (old_change_iter == change_map_.end()) { + change_map_ = change_map_.insert(key, change); + return; + } + + const DocumentViewChange& old = old_change_iter->second; + DocumentViewChange::Type old_type = old.type(); + DocumentViewChange::Type new_type = change.type(); + + // Merge the new change with the existing change. + if (new_type != DocumentViewChange::Type::Added && + old_type == DocumentViewChange::Type::Metadata) { + change_map_ = change_map_.insert(key, change); + + } else if (new_type == DocumentViewChange::Type::Metadata && + old_type != DocumentViewChange::Type::Removed) { + DocumentViewChange new_change{change.document(), old_type}; + change_map_ = change_map_.insert(key, new_change); + + } else if (new_type == DocumentViewChange::Type::Modified && + old_type == DocumentViewChange::Type::Modified) { + DocumentViewChange new_change{change.document(), + DocumentViewChange::Type::Modified}; + change_map_ = change_map_.insert(key, new_change); + + } else if (new_type == DocumentViewChange::Type::Modified && + old_type == DocumentViewChange::Type::Added) { + DocumentViewChange new_change{change.document(), + DocumentViewChange::Type::Added}; + change_map_ = change_map_.insert(key, new_change); + + } else if (new_type == DocumentViewChange::Type::Removed && + old_type == DocumentViewChange::Type::Added) { + change_map_ = change_map_.erase(key); + + } else if (new_type == DocumentViewChange::Type::Removed && + old_type == DocumentViewChange::Type::Modified) { + DocumentViewChange new_change{old.document(), + DocumentViewChange::Type::Removed}; + change_map_ = change_map_.insert(key, new_change); + + } else if (new_type == DocumentViewChange::Type::Added && + old_type == DocumentViewChange::Type::Removed) { + DocumentViewChange new_change{change.document(), + DocumentViewChange::Type::Modified}; + change_map_ = change_map_.insert(key, new_change); + + } else { + // This includes these cases, which don't make sense: + // Added -> Added + // Removed -> Removed + // Modified -> Added + // Removed -> Modified + // Metadata -> Added + // Removed -> Metadata + HARD_FAIL("Unsupported combination of changes: %s after %s", new_type, + old_type); + } +} + +std::vector DocumentViewChangeSet::GetChanges() const { + std::vector changes; + for (const auto& kv : change_map_) { + const DocumentViewChange& change = kv.second; + changes.push_back(change); + } + return changes; +} + +std::string DocumentViewChangeSet::ToString() const { + return util::ToString(change_map_); +} + +// ViewSnapshot + +ViewSnapshot::ViewSnapshot(Query query, + DocumentSet documents, + DocumentSet old_documents, + std::vector document_changes, + model::DocumentKeySet mutated_keys, + bool from_cache, + bool sync_state_changed, + bool excludes_metadata_changes) + : query_{std::move(query)}, + documents_{std::move(documents)}, + old_documents_{std::move(old_documents)}, + document_changes_{std::move(document_changes)}, + mutated_keys_{std::move(mutated_keys)}, + from_cache_{from_cache}, + sync_state_changed_{sync_state_changed}, + excludes_metadata_changes_{excludes_metadata_changes} { +} + +ViewSnapshot ViewSnapshot::FromInitialDocuments( + Query query, + DocumentSet documents, + DocumentKeySet mutated_keys, + bool from_cache, + bool excludes_metadata_changes) { + std::vector view_changes; + for (const Document& doc : documents) { + view_changes.emplace_back(doc, DocumentViewChange::Type::Added); + } + + DocumentSet old_documents(query.Comparator()); + return ViewSnapshot{std::move(query), + documents, + old_documents, + std::move(view_changes), + std::move(mutated_keys), + from_cache, + /*sync_state_changed=*/true, + excludes_metadata_changes}; +} + +const Query& ViewSnapshot::query() const { + return query_; +} + +std::string ViewSnapshot::ToString() const { + return StringFormat( + "", + query_.ToString(), documents_.ToString(), old_documents_.ToString(), + util::ToString(document_changes()), from_cache(), mutated_keys().size(), + sync_state_changed(), excludes_metadata_changes()); +} + +std::ostream& operator<<(std::ostream& out, const ViewSnapshot& value) { + return out << value.ToString(); +} + +size_t ViewSnapshot::Hash() const { + // Note: We are omitting `mutated_keys_` from the hash, since we don't have a + // straightforward way to compute its hash value. Since `ViewSnapshot` is + // currently not stored in any dictionaries, this has no side effects. + + return util::Hash(query(), documents(), old_documents(), document_changes(), + from_cache(), sync_state_changed(), + excludes_metadata_changes()); +} + +bool operator==(const ViewSnapshot& lhs, const ViewSnapshot& rhs) { + return lhs.query() == rhs.query() && lhs.documents() == rhs.documents() && + lhs.old_documents() == rhs.old_documents() && + lhs.document_changes() == rhs.document_changes() && + lhs.from_cache() == rhs.from_cache() && + lhs.mutated_keys() == rhs.mutated_keys() && + lhs.sync_state_changed() == rhs.sync_state_changed() && + lhs.excludes_metadata_changes() == rhs.excludes_metadata_changes(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h new file mode 100644 index 0000000..2d6fe05 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h @@ -0,0 +1,188 @@ +/* + * 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_VIEW_SNAPSHOT_H_ +#define FIRESTORE_CORE_SRC_CORE_VIEW_SNAPSHOT_H_ + +#include +#include +#include +#include +#include +#include + +#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 { +namespace core { + +/** A change to a single document's state within a view. */ +class DocumentViewChange { + public: + /** + * The types of changes that can happen to a document with respect to a view. + * NOTE: We sort document changes by their type, so the ordering of this enum + * is significant. + */ + enum class Type { Removed = 0, Added, Modified, Metadata }; + + DocumentViewChange() = default; + + DocumentViewChange(model::Document document, Type type); + + const model::Document& document() const; + DocumentViewChange::Type type() const { + return type_; + } + + std::string ToString() const; + size_t Hash() const; + + private: + model::Document document_; + Type type_{}; +}; + +bool operator==(const DocumentViewChange& lhs, const DocumentViewChange& rhs); + +/** + * The possible states a document can be in w.r.t syncing from local storage to + * the backend. + */ +enum class SyncState { None = 0, Local, Synced }; + +/** + * A set of changes to docs in a query, merging duplicate events for the same + * doc. + */ +class DocumentViewChangeSet { + public: + /** Takes a new change and applies it to the set. */ + void AddChange(DocumentViewChange&& change); + + /** Returns the set of all changes tracked in this set. */ + std::vector GetChanges() const; + + std::string ToString() const; + + private: + /** The set of all changes tracked so far, with redundant changes merged. */ + immutable::SortedMap change_map_; +}; + +/** + * A view snapshot is an immutable capture of the results of a query and the + * changes to them. + */ +class ViewSnapshot { + public: + ViewSnapshot(Query query, + model::DocumentSet documents, + model::DocumentSet old_documents, + std::vector document_changes, + model::DocumentKeySet mutated_keys, + bool from_cache, + bool sync_state_changed, + bool excludes_metadata_changes); + + /** + * Returns a view snapshot as if all documents in the snapshot were + * added. + */ + static ViewSnapshot FromInitialDocuments(Query query, + model::DocumentSet documents, + model::DocumentKeySet mutated_keys, + bool from_cache, + bool excludes_metadata_changes); + + /** The query this view is tracking the results for. */ + const Query& query() const; + + /** The documents currently known to be results of the query. */ + const model::DocumentSet& documents() const { + return documents_; + } + + /** The documents of the last snapshot. */ + const model::DocumentSet& old_documents() const { + return old_documents_; + } + + /** The set of changes that have been applied to the documents. */ + const std::vector& document_changes() const { + return document_changes_; + } + + /** Whether any document in the snapshot was served from the local cache. */ + bool from_cache() const { + return from_cache_; + } + + /** Whether any document in the snapshot has pending local writes. */ + bool has_pending_writes() const { + return !mutated_keys_.empty(); + } + + /** Whether the sync state changed as part of this snapshot. */ + bool sync_state_changed() const { + return sync_state_changed_; + } + + /** Whether this snapshot has been filtered to not include metadata changes */ + bool excludes_metadata_changes() const { + return excludes_metadata_changes_; + } + + /** The document in this snapshot that have unconfirmed writes. */ + model::DocumentKeySet mutated_keys() const { + return mutated_keys_; + } + + std::string ToString() const; + friend std::ostream& operator<<(std::ostream& out, const ViewSnapshot& value); + size_t Hash() const; + + private: + Query query_; + + model::DocumentSet documents_; + model::DocumentSet old_documents_; + std::vector document_changes_; + model::DocumentKeySet mutated_keys_; + + bool from_cache_ = false; + bool sync_state_changed_ = false; + 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_CORE_VIEW_SNAPSHOT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.cc new file mode 100644 index 0000000..fedec46 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.cc @@ -0,0 +1,46 @@ +/* + * 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/credentials/auth_token.h" + +#include + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +AuthToken::AuthToken() : token_{}, user_{User::Unauthenticated()} { +} + +AuthToken::AuthToken(std::string token, User user) + : token_{std::move(token)}, user_{std::move(user)} { +} + +const std::string& AuthToken::token() const { + HARD_ASSERT(user_.is_authenticated()); + return token_; +} + +const AuthToken& AuthToken::Unauthenticated() { + static const AuthToken kUnauthenticatedToken{}; + return kUnauthenticatedToken; +} + +} // namespace credentials +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.h new file mode 100644 index 0000000..2d5f5ee --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/auth_token.h @@ -0,0 +1,76 @@ +/* + * 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_CREDENTIALS_AUTH_TOKEN_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_AUTH_TOKEN_H_ + +#include + +#include "Firestore/core/src/credentials/user.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +/** + * The current User and the authentication token provided by the underlying + * authentication mechanism. This is the result of calling + * CredentialsProvider::GetToken(). + * + * ## Portability notes: no TokenType on iOS + * + * The TypeScript client supports 1st party Oauth tokens (for the Firebase + * Console to auth as the developer) and OAuth2 tokens for the node.js sdk to + * auth with a service account. We don't have plans to support either case on + * mobile so there's no TokenType here. + */ +// TODO(zxu123): Make this support token-type for desktop workflow. +class AuthToken { + public: + AuthToken(); + + AuthToken(std::string token, User user); + + /** The actual raw token. */ + const std::string& token() const; + + /** + * The user with which the token is associated (used for persisting user + * state on disk, etc.). + */ + const User& user() const { + return user_; + } + + /** + * Returns a token for an unauthenticated user. + * + * ## Portability notes: An unauthenticated token is the equivalent of + * nil/null in the iOS/TypeScript token implementation. We use a reference + * instead of a pointer for Token instances in the C++ migration. + */ + static const AuthToken& Unauthenticated(); + + private: + std::string token_; + User user_; +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_AUTH_TOKEN_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_fwd.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_fwd.h new file mode 100644 index 0000000..1b63427 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_fwd.h @@ -0,0 +1,48 @@ +/* + * Copyright 2021 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_CREDENTIALS_CREDENTIALS_FWD_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_CREDENTIALS_FWD_H_ + +#include + +namespace firebase { +namespace firestore { +namespace credentials { + +class AuthToken; + +template +class CredentialsProvider; + +template +class EmptyCredentialsProvider; + +class User; + +using AuthCredentialsProvider = CredentialsProvider; +using AppCheckCredentialsProvider = + CredentialsProvider; + +using EmptyAuthCredentialsProvider = EmptyCredentialsProvider; +using EmptyAppCheckCredentialsProvider = + EmptyCredentialsProvider; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_CREDENTIALS_FWD_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_provider.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_provider.h new file mode 100644 index 0000000..2c5afc2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/credentials_provider.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. + */ + +#ifndef FIRESTORE_CORE_SRC_CREDENTIALS_CREDENTIALS_PROVIDER_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_CREDENTIALS_PROVIDER_H_ + +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/credentials/auth_token.h" +#include "Firestore/core/src/credentials/user.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +// `TokenErrorListener` is a listener that gets a token or an error. +template +using TokenListener = std::function)>; + +// Listener notified with a credential change. +template +using CredentialChangeListener = std::function; + +/** + * Provides methods for getting the uid and token for the current user and + * listen for changes. + */ +template +class CredentialsProvider { + public: + CredentialsProvider() : change_listener_(nullptr) { + } + + virtual ~CredentialsProvider() = default; + + /** Requests token for the current user. */ + virtual void GetToken(TokenListener completion) = 0; + + /** + * Marks the last retrieved token as invalid, making the next `GetToken` + * request force refresh the token. + */ + virtual void InvalidateToken() { + force_refresh_ = true; + } + + /** + * Sets the listener to be notified of credential changes (sign-in / + * sign-out, token changes). It is immediately called once with the initial + * user. + * + * Call with nullptr to remove previous listener. + */ + virtual void SetCredentialChangeListener( + CredentialChangeListener change_listener) = 0; + + protected: + /** + * A listener to be notified of credential changes (sign-in / sign-out, token + * changes). It is immediately called once with the initial user. + * + * Note that this block will be called back on an arbitrary thread that is not + * the normal Firestore worker thread. + */ + CredentialChangeListener change_listener_; + + bool force_refresh_ = false; +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_CREDENTIALS_PROVIDER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/empty_credentials_provider.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/empty_credentials_provider.h new file mode 100644 index 0000000..5b38511 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/empty_credentials_provider.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_CREDENTIALS_EMPTY_CREDENTIALS_PROVIDER_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_EMPTY_CREDENTIALS_PROVIDER_H_ + +#include "Firestore/core/src/credentials/credentials_provider.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +/** `EmptyCredentialsProvider` always yields an empty token. */ +template +class EmptyCredentialsProvider + : public CredentialsProvider { + public: + void GetToken(TokenListener completion) override { + if (completion) { + // Unauthenticated token will force the GRPC fallback to use default + // settings. + completion(TokenType{}); + } + } + + void SetCredentialChangeListener( + CredentialChangeListener change_listener) override { + if (change_listener) { + change_listener(ValueType{}); + } + } +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_EMPTY_CREDENTIALS_PROVIDER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.h new file mode 100644 index 0000000..9e3b7f7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.h @@ -0,0 +1,84 @@ +/* + * Copyright 2021 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_CREDENTIALS_FIREBASE_APP_CHECK_CREDENTIALS_PROVIDER_APPLE_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_FIREBASE_APP_CHECK_CREDENTIALS_PROVIDER_APPLE_H_ + +#if !defined(__OBJC__) +#error "This header only supports Objective-C++." +#endif // !defined(__OBJC__) + +#import + +#include +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/credentials/credentials_provider.h" + +@class FIRApp; +@protocol FIRAppCheckInterop; + +namespace firebase { +namespace firestore { +namespace credentials { + +class FirebaseAppCheckCredentialsProvider + : public CredentialsProvider { + public: + FirebaseAppCheckCredentialsProvider(FIRApp* app, + id app_check); + + ~FirebaseAppCheckCredentialsProvider() override; + + void GetToken(TokenListener completion) override; + + void SetCredentialChangeListener( + CredentialChangeListener change_listener) override; + + private: + /** + * Most contents of the FirebaseAppCheckCredentialsProvider are kept in this + * Contents object and pointed to with a shared pointer. Callbacks + * registered with FirebaseAppCheck use weak pointers to the Contents to + * avoid races between notifications arriving and C++ object destruction. + */ + struct Contents { + Contents(FIRApp* app, id app_check) + : app(app), app_check(app_check) { + } + + const FIRApp* app; + const id app_check; + std::string current_token; + std::mutex mutex; + }; + + /** + * Handle used to stop receiving auth changes once CredentialChangeListener is + * removed. + */ + id app_check_listener_handle_; + + std::shared_ptr contents_; +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_FIREBASE_APP_CHECK_CREDENTIALS_PROVIDER_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.mm new file mode 100644 index 0000000..32ac5ac --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.mm @@ -0,0 +1,123 @@ +/* + * Copyright 2021 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/credentials/firebase_app_check_credentials_provider_apple.h" + +#import "FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h" +#import "FirebaseAppCheck/Sources/Interop/FIRAppCheckTokenResultInterop.h" +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" + +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +FirebaseAppCheckCredentialsProvider::FirebaseAppCheckCredentialsProvider( + FIRApp* app, id app_check) { + contents_ = std::make_shared(app, app_check); + + if (app_check == nil) { + return; + } + + std::weak_ptr weak_contents = contents_; + app_check_listener_handle_ = [[NSNotificationCenter defaultCenter] + addObserverForName:[app_check tokenDidChangeNotificationName] + object:nil + queue:nil + usingBlock:^(NSNotification* notification) { + std::shared_ptr contents = weak_contents.lock(); + if (!contents) { + return; + } + + std::unique_lock lock(contents->mutex); + NSDictionary* user_info = notification.userInfo; + + // ensure we're only notifying for the current app. + NSString* notified_app_name = + user_info[[app_check notificationAppNameKey]]; + if (![[contents->app name] isEqual:notified_app_name]) { + return; + } + + NSString* app_check_token = + user_info[[app_check notificationTokenKey]]; + contents_->current_token = util::MakeString(app_check_token); + CredentialChangeListener listener = + change_listener_; + if (change_listener_) { + change_listener_(contents_->current_token); + } + }]; +} + +FirebaseAppCheckCredentialsProvider::~FirebaseAppCheckCredentialsProvider() { + if (app_check_listener_handle_) { + [[NSNotificationCenter defaultCenter] + removeObserver:app_check_listener_handle_]; + } +} + +void FirebaseAppCheckCredentialsProvider::GetToken( + TokenListener completion) { + std::weak_ptr weak_contents = contents_; + if (contents_->app_check) { + void (^get_token_callback)(id) = + ^(id result) { + if (result.error != nil) { + LOG_WARN("AppCheck failed: '%s'", + util::MakeString(result.error.localizedDescription)); + } + completion(util::MakeString(result.token)); // Always return token + }; + + // Retrieve a cached or generate a new FAC Token. If forcingRefresh == YES + // always generates a new token and updates the cache. + [contents_->app_check getTokenForcingRefresh:force_refresh_ + completion:get_token_callback]; + } else { + // If there's no AppCheck provider, call back immediately with a nil token. + completion(std::string{""}); + } + force_refresh_ = false; +} + +void FirebaseAppCheckCredentialsProvider::SetCredentialChangeListener( + CredentialChangeListener change_listener) { + std::unique_lock lock(contents_->mutex); + if (change_listener) { + HARD_ASSERT(!change_listener_, "set change_listener twice!"); + // Fire initial event. + change_listener(contents_->current_token); + } else { + HARD_ASSERT(change_listener_, "change_listener removed without being set!"); + if (app_check_listener_handle_) { + [[NSNotificationCenter defaultCenter] + removeObserver:app_check_listener_handle_]; + app_check_listener_handle_ = nil; + } + } + + change_listener_ = change_listener; +} + +} // namespace credentials +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.h new file mode 100644 index 0000000..1425b46 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_CREDENTIALS_FIREBASE_AUTH_CREDENTIALS_PROVIDER_APPLE_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_FIREBASE_AUTH_CREDENTIALS_PROVIDER_APPLE_H_ + +#if !defined(__OBJC__) +#error "This header only supports Objective-C++." +#endif // !defined(__OBJC__) + +#import + +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/credentials/credentials_provider.h" +#include "Firestore/core/src/credentials/user.h" +#include "absl/strings/string_view.h" + +@class FIRApp; +@protocol FIRAuthInterop; + +namespace firebase { +namespace firestore { +namespace credentials { + +/** + * `FirebaseCredentialsProvider` uses Firebase Auth via `FIRApp` to get an auth + * token. + * + * NOTE: To simplify the implementation, it requires that you call + * `SetCredentialChangeListener()` with a non-nullptr value no more than once + * and don't call `GetToken()` after setting it to `nullptr`. + * + * This class must be implemented in a thread-safe manner since it is accessed + * from the thread backing our internal worker queue and the callbacks from + * FIRAuth will be executed on an arbitrary different thread. + * + * For non-Apple desktop build, this is right now just a stub. + */ +class FirebaseAuthCredentialsProvider + : public CredentialsProvider { + public: + // TODO(zxu123): Provide a ctor to accept the C++ Firebase Games App, which + // deals all platforms. Right now, only works for FIRApp*. + /** + * Initializes a new FirebaseCredentialsProvider. + * + * @param app The Firebase app instance associated with the credentials + * received. + * @param auth The auth instance from which to get credentials. + */ + explicit FirebaseAuthCredentialsProvider(FIRApp* app, + id auth); + + ~FirebaseAuthCredentialsProvider() override; + + void GetToken(TokenListener completion) override; + + void SetCredentialChangeListener( + CredentialChangeListener change_listener) override; + + private: + /** + * Most contents of the FirebaseCredentialProvider are kept in this + * Contents object and pointed to with a shared pointer. Callbacks + * registered with FirebaseAuth use weak pointers to the Contents to + * avoid races between notifications arriving and C++ object destruction. + */ + struct Contents { + Contents(FIRApp* app, id auth, User&& user) + : app(app), auth(auth), current_user(std::move(user)) { + } + + const FIRApp* app; + + const id auth; + + /** + * The current user as reported to us via our AuthStateDidChangeListener. + */ + User current_user; + + /** + * Counter used to detect if the token changed while a GetToken() request + * was outstanding. + */ + int token_counter = 0; + + std::mutex mutex; + }; + + /** + * Handle used to stop receiving auth changes once CredentialChangeListener is + * removed. + */ + id auth_listener_handle_; + + std::shared_ptr contents_; +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_FIREBASE_AUTH_CREDENTIALS_PROVIDER_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.mm new file mode 100644 index 0000000..7e39056 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.mm @@ -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/credentials/firebase_auth_credentials_provider_apple.h" + +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" +#import "Interop/Auth/Public/FIRAuthInterop.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 { +namespace credentials { + +FirebaseAuthCredentialsProvider::FirebaseAuthCredentialsProvider( + FIRApp* app, id auth) { + contents_ = + std::make_shared(app, auth, User::FromUid([auth getUserID])); + std::weak_ptr weak_contents = contents_; + + auth_listener_handle_ = [[NSNotificationCenter defaultCenter] + addObserverForName:FIRAuthStateDidChangeInternalNotification + object:nil + queue:nil + usingBlock:^(NSNotification* notification) { + std::shared_ptr contents = weak_contents.lock(); + if (!contents) { + return; + } + + std::unique_lock lock(contents->mutex); + NSDictionary* user_info = notification.userInfo; + + // ensure we're only notifying for the current app. + FIRApp* notified_app = + user_info[FIRAuthStateDidChangeInternalNotificationAppKey]; + if (![contents->app isEqual:notified_app]) { + return; + } + + NSString* user_id = + user_info[FIRAuthStateDidChangeInternalNotificationUIDKey]; + contents->current_user = User::FromUid(user_id); + contents->token_counter++; + CredentialChangeListener listener = change_listener_; + if (listener) { + listener(contents->current_user); + } + }]; +} + +FirebaseAuthCredentialsProvider::~FirebaseAuthCredentialsProvider() { + if (auth_listener_handle_) { + [[NSNotificationCenter defaultCenter] removeObserver:auth_listener_handle_]; + } +} + +void FirebaseAuthCredentialsProvider::GetToken( + TokenListener completion) { + HARD_ASSERT(auth_listener_handle_, + "GetToken cannot be called after listener removed."); + + // 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; + + std::weak_ptr weak_contents = contents_; + void (^get_token_callback)(NSString*, NSError*) = + ^(NSString* _Nullable token, NSError* _Nullable error) { + std::shared_ptr contents = weak_contents.lock(); + if (!contents) { + return; + } + + std::unique_lock lock(contents->mutex); + if (initial_token_counter != contents->token_counter) { + // 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). + LOG_DEBUG("GetToken aborted due to token change."); + return GetToken(completion); + } else { + if (error == nil) { + if (token != nil) { + completion( + AuthToken{util::MakeString(token), contents->current_user}); + } else { + completion(AuthToken::Unauthenticated()); + } + } else { + Error error_code = Error::kErrorUnknown; + if (error.domain == FIRFirestoreErrorDomain) { + error_code = static_cast(error.code); + } + completion(util::Status( + error_code, util::MakeString(error.localizedDescription))); + } + } + }; + + // TODO(wilhuff): Need a better abstraction over a missing auth provider. + if (contents_->auth) { + [contents_->auth getTokenForcingRefresh:force_refresh_ + withCallback:get_token_callback]; + } else { + // If there's no Auth provider, call back immediately with a nil + // (unauthenticated) token. + get_token_callback(nil, nil); + } + force_refresh_ = false; +} + +void FirebaseAuthCredentialsProvider::SetCredentialChangeListener( + CredentialChangeListener change_listener) { + std::unique_lock lock(contents_->mutex); + if (change_listener) { + HARD_ASSERT(!change_listener_, "set change_listener twice!"); + // Fire initial event. + 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_ = change_listener; +} + +} // namespace credentials +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.cc new file mode 100644 index 0000000..b9909e4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.cc @@ -0,0 +1,41 @@ +/* + * 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/credentials/user.h" + +#include + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +User::User() : is_authenticated_{false} { +} + +User::User(std::string uid) : uid_{std::move(uid)}, is_authenticated_{true} { + HARD_ASSERT(!uid_.empty()); +} + +const User& User::Unauthenticated() { + static const User* kUnauthenticated = new User(); + return *kUnauthenticated; +} + +} // namespace credentials +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.h new file mode 100644 index 0000000..20e2481 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/credentials/user.h @@ -0,0 +1,103 @@ +/* + * 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_CREDENTIALS_USER_H_ +#define FIRESTORE_CORE_SRC_CREDENTIALS_USER_H_ + +#if defined(__OBJC__) +#import +#include "Firestore/core/src/util/string_apple.h" +#endif // defined(__OBJC__) + +#include + +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +/** + * Simple wrapper around a nullable UID. Mostly exists to make code more + * readable and for compatibility with other clients where map keys cannot be + * null. + */ +class User { + public: + /** Construct an unauthenticated user. */ + User(); + + /** Construct an authenticated user with the given UID. */ + explicit User(std::string uid); + + const std::string& uid() const { + return uid_; + } + + // PORTING NOTE: Here use more clear naming is_authenticated() instead of + // is_unauthenticated(). + bool is_authenticated() const { + return is_authenticated_; + } + + /** Returns an unauthenticated instance. */ + static const User& Unauthenticated(); + +#if defined(__OBJC__) + /** + * Returns an authenticated user if uid is non-nil, otherwise an + * unauthenticated user. + */ + static User FromUid(NSString* _Nullable uid) { + if (uid == nil) { + return Unauthenticated(); + } else { + return User{util::MakeString(uid)}; + } + } +#endif // defined(__OBJC__) + + User& operator=(const User& other) = default; + + friend bool operator==(const User& lhs, const User& rhs); + + private: + std::string uid_; + bool is_authenticated_; +}; + +inline bool operator==(const User& lhs, const User& rhs) { + return lhs.is_authenticated_ == rhs.is_authenticated_ && + (!lhs.is_authenticated_ || lhs.uid_ == rhs.uid_); +} + +inline bool operator!=(const User& lhs, const User& rhs) { + return !(lhs == rhs); +} + +// Specializations of std::hash is prohibited. We define a hash function to be +// passed through manually. +struct HashUser { + inline int64_t operator()(const User& user) const { + return std::hash{}(user.uid()); + } +}; + +} // namespace credentials +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CREDENTIALS_USER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/firestore_version.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/firestore_version.cc new file mode 100644 index 0000000..57c4f08 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/firestore_version.cc @@ -0,0 +1,37 @@ +/* + * 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/include/firebase/firestore/firestore_version.h" + +#ifndef FIRFirestore_VERSION +#error \ + "FIRFirestore_VERSION is not defined: add -DFIRFirestore_VERSION=... to the build invocation" // NOLINT(whitespace/line_length) +#endif + +namespace firebase { +namespace firestore { + +// The following two macros supply the incantation so that the C +// preprocessor does not try to parse the version as a floating +// point number. See +// https://www.guyrutenberg.com/2008/12/20/expanding-macros-into-string-constants-in-c/ +#define STR(x) STR_EXPAND(x) +#define STR_EXPAND(x) #x + +const char* const kFirestoreVersionString = STR(FIRFirestore_VERSION); + +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc new file mode 100644 index 0000000..1d379d3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc @@ -0,0 +1,54 @@ +/* + * 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/include/firebase/firestore/geo_point.h" + +#include +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { + +GeoPoint::GeoPoint(double latitude, double longitude) + : latitude_(latitude), longitude_(longitude) { + HARD_ASSERT(!std::isnan(latitude) && -90 <= latitude && latitude <= 90, + "Latitude must be in the range of [-90, 90]"); + HARD_ASSERT(!std::isnan(longitude) && -180 <= longitude && longitude <= 180, + "Latitude must be in the range of [-180, 180]"); +} + +std::string GeoPoint::ToString() const { + return absl::StrCat("GeoPoint(latitude=", latitude_, + ", longitude=", longitude_, ")"); +} + +std::ostream& operator<<(std::ostream& out, const GeoPoint& geo_point) { + return out << geo_point.ToString(); +} + +bool operator<(const GeoPoint& lhs, const GeoPoint& rhs) { + if (lhs.latitude() == rhs.latitude()) { + return lhs.longitude() < rhs.longitude(); + } else { + return lhs.latitude() < rhs.latitude(); + } +} + +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h new file mode 100644 index 0000000..9120426 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h @@ -0,0 +1,253 @@ +/* + * 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_IMMUTABLE_APPEND_ONLY_LIST_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_APPEND_ONLY_LIST_H_ + +#include +#include +#include +#include +#include + +#include "absl/algorithm/container.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace immutable { + +/** + * An immutable list, optimized for appending. + * + * Each `push_back` creates a new instance and does not modify any that come + * before. If `push_back` is called on the last such instance, it will share + * the backing vector with the prior instance (though the prior instance will + * not perceive any change). + * + * This "chaining" behavior is what makes AppendOnlyList efficient, but it only + * applies when applied to the last link in the chain. When applied any instance + * that is not at the end, most operations will copy instead of chaining. + * + * Iterators over an AppendOnlyList are never invalidated. + */ +template +class AppendOnlyList { + public: + using iterator = const T*; + using const_iterator = const T*; + using value_type = T; + + AppendOnlyList() = default; + + AppendOnlyList(std::initializer_list initializer_list) + : contents_(std::make_shared>(initializer_list)), + size_(initializer_list.size()) { + } + + /** + * Returns a new AppendOnlyList that has reserved the given capacity in its + * backing vector, without actually lengthening the chain. + * + * This has a similar effect to std::vector::reserve, except that *this is + * not actually modified. Successive `push_back` operations until `size()` + * is equal to `capacity` are guaranteed to be O(1). + * + * Note that if this instance is not the end of the chain, then this forces + * a copy. + */ + ABSL_MUST_USE_RESULT AppendOnlyList reserve(size_t capacity) const { + if (capacity <= size_) { + return *this; + } + + // Create a the underlying vector with capacity reserved, but return the + // result with the current size. Reserving does not actually append anything + // to the underlying vector so size() shouldn't change. + std::shared_ptr> new_contents = PrepareForAppend(capacity); + return AppendOnlyList(std::move(new_contents), size_); + } + + /** + * Creates a new AppendOnlyList with the given value appended to the end. + * + * Each `push_back` creates a new instance and appears not to modify any that + * come. If `push_back` is called on the last instance in a chain, it will + * share the backing vector with the prior instance. + * + * If `push_back` is called when this instance isn't the last instance in the + * chain, it will make a copy of all preceding elements in the chain and + * return a new chain suitable for further chained `push_back` operations. + */ + ABSL_MUST_USE_RESULT AppendOnlyList push_back(const T& value) const { + size_t new_size = size_ + 1; + std::shared_ptr> new_contents = PrepareForAppend(new_size); + + new_contents->push_back(value); + return AppendOnlyList(std::move(new_contents), new_size); + } + + /** + * Creates a new AppendOnlyList with the given value appended to the end. + * + * @see `push_back(const T&)` for detailed discussion. + */ + ABSL_MUST_USE_RESULT AppendOnlyList push_back(T&& value) const { + size_t new_size = size_ + 1; + std::shared_ptr> new_contents = PrepareForAppend(new_size); + + new_contents->push_back(std::move(value)); + return AppendOnlyList(std::move(new_contents), new_size); + } + + /** + * Creates a new AppendOnlyList constructing a new value appended to the end. + * + * @see `push_back(const T&)` for detailed discussion. + */ + template + ABSL_MUST_USE_RESULT AppendOnlyList emplace_back(Args&&... args) const { + size_t new_size = size_ + 1; + std::shared_ptr> new_contents = PrepareForAppend(new_size); + + new_contents->emplace_back(std::forward(args)...); + return AppendOnlyList(std::move(new_contents), new_size); + } + + /** + * Creates a new AppendOnlyList with the final link in the chain removed. + * + * Note that the element isn't actually removed from the backing vector and + * it still constitutes the end of the chain. This means that any `push_back` + * on the resulting AppendOnlyList will result in a full copy. + * + * Calling pop_back() on an empty AppendOnlyList returns an empty + * AppendOnlyList. + */ + ABSL_MUST_USE_RESULT AppendOnlyList pop_back() const { + if (size_ <= 1) { + return AppendOnlyList(nullptr, 0); + } + + return AppendOnlyList(contents_, size_ - 1); + } + + size_t size() const { + return size_; + } + + size_t capacity() const { + return contents_ ? contents_->capacity() : 0; + } + + bool empty() const { + return size_ == 0; + } + + /** + * Returns an iterator to the beginning of the list. Iterators are never + * invalidated (so long as the container itself is valid). + */ + const_iterator begin() const { + if (size_ == 0) { + return nullptr; + } else { + return contents_->data(); + } + } + + /** + * Returns an iterator that points to one past the end of the list. Iterators + * are never invalidated (so long as the container itself is valid). + */ + const_iterator end() const { + if (size_ == 0) { + return nullptr; + } else { + return contents_->data() + size_; + } + } + + /** + * Returns the first element of the list. Only valid when the list is not + * empty. + */ + const T& front() const { + return *begin(); + } + + /** + * Returns the last element of the list. Only valid when the list is not + * empty. + */ + const T& back() const { + return *(end() - 1); + } + + const T& operator[](size_t pos) const { + return (*contents_)[pos]; + } + + friend bool operator==(const AppendOnlyList& lhs, const AppendOnlyList& rhs) { + return absl::c_equal(lhs, rhs); + } + + friend bool operator!=(const AppendOnlyList& lhs, const AppendOnlyList& rhs) { + return !(lhs == rhs); + } + + private: + AppendOnlyList(std::shared_ptr> contents, size_t size) + : contents_(std::move(contents)), size_(size) { + } + + std::shared_ptr> PrepareForAppend(size_t new_size) const { + if (contents_ && size_ == contents_->size() && + new_size <= contents_->capacity()) { + // If there's an existing vector, this instance points to the end, and + // can already accommodate what's required, there's nothing to do. + return contents_; + } + + size_t min_capacity = new_size; + if (contents_) { + // if contents_->capacity() * 2 overflows, min_capacity will be larger. + min_capacity = std::max(min_capacity, contents_->capacity() * 2); + } + + // min_capacity will be larger than the existing contents of this list so + // reserve that capacity copying in the current values. Copying from this + // and then reserving would cause two allocations, the first for exactly + // the current size and then another for min_capacity. + auto new_contents = std::make_shared>(); + new_contents->reserve(min_capacity); + new_contents->insert(new_contents->begin(), begin(), end()); + return new_contents; + } + + // A shared vector. Sequential push_back operations will share the vector. May + // be nullptr when size_ == 0, but is not required to be null. + std::shared_ptr> contents_; + + // size_ is not shared. + size_t size_ = 0; +}; + +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_APPEND_ONLY_LIST_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h new file mode 100644 index 0000000..f019a38 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h @@ -0,0 +1,364 @@ +/* + * 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_ARRAY_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_ARRAY_SORTED_MAP_H_ + +#include +#include +#include +#include +#include +#include +#include + +#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 { +namespace immutable { +namespace impl { + +/** + * A bounded-size array that allocates its contents directly in itself. This + * saves a heap allocation when compared with std::vector (though std::vector + * can resize itself while FixedArray cannot). + * + * Unlike std::array, FixedArray keeps track of its size and grows up to the + * fixed_size limit. Inserting more elements than fixed_size will trigger an + * assertion failure. + * + * ArraySortedMap does not actually contain its array: it contains a shared_ptr + * to a FixedArray. + * + * @tparam T The type of an element in the array. + */ +template +class FixedArray { + public: + using size_type = SortedMapBase::size_type; + using array_type = std::array; + using iterator = typename array_type::iterator; + using const_iterator = typename array_type::const_iterator; + + FixedArray() { + } + + template + FixedArray(SourceIterator src_begin, SourceIterator src_end) { + append(src_begin, src_end); + } + + /** + * Appends to this array, copying from the given src_begin up to but not + * including the src_end. + */ + template + void append(SourceIterator src_begin, SourceIterator src_end) { + auto appending = static_cast(src_end - src_begin); + auto new_size = size_ + appending; + HARD_ASSERT(new_size <= SortedMapBase::kFixedSize); + + std::copy(src_begin, src_end, end()); + size_ = new_size; + } + + /** + * Appends a single value to the array. + */ + void append(T&& value) { + size_type new_size = size_ + 1; + HARD_ASSERT(new_size <= SortedMapBase::kFixedSize); + + *end() = std::move(value); + size_ = new_size; + } + + const_iterator begin() const { + return contents_.begin(); + } + + const_iterator end() const { + return begin() + size_; + } + + size_type size() const { + return size_; + } + + private: + iterator begin() { + return contents_.begin(); + } + + iterator end() { + return begin() + size_; + } + + array_type contents_; + size_type size_ = 0; +}; + +/** + * ArraySortedMap is a value type containing a map. It is immutable, but has + * methods to efficiently create new maps that are mutations of it. + */ +template > +class ArraySortedMap : public SortedMapBase { + public: + /** + * The type of the entries stored in the map. + */ + using value_type = std::pair; + + /** + * The type of the fixed-size array containing entries of value_type. + */ + using array_type = FixedArray; + using const_iterator = typename array_type::const_iterator; + using const_key_iterator = util::iterator_first; + + using array_pointer = std::shared_ptr; + + /** + * Creates an empty ArraySortedMap. + */ + explicit ArraySortedMap(const C& comparator = C()) + : array_{EmptyArray()}, comparator_{comparator} { + } + + /** + * Creates an ArraySortedMap containing the given entries. + */ + ArraySortedMap(std::initializer_list entries, + const C& comparator = C()) + : array_{SortedArray(entries, comparator)}, comparator_{comparator} { + } + + /** Returns true if the map contains no elements. */ + bool empty() const { + return size() == 0; + } + + /** Returns the number of items in this map. */ + size_type size() const { + return array_->size(); + } + + const C& comparator() const { + return comparator_; + } + + /** + * Creates a new map identical to this one, but with a key-value pair added or + * updated. + * + * @param key The key to insert/update. + * @param value The value to associate with the key. + * @return A new dictionary with the added/updated value. + */ + ArraySortedMap insert(const K& key, const V& value) const { + const_iterator current_end = end(); + const_iterator pos = lower_bound(key); + bool replacing_entry = false; + + if (pos != current_end) { + // lower_bound found an entry where pos->first >= pair.first. Reversing + // the argument order here tests pair.first < pos->first. + auto cmp = comparator_.Compare(key, pos->first); + replacing_entry = cmp == util::ComparisonResult::Same; + if (replacing_entry && value == pos->second) { + return *this; + } + } + + // Copy the segment before the found position. If not found, this is + // everything. + auto copy = std::make_shared(begin(), pos); + + // Copy the value to be inserted. + copy->append({key, value}); + + if (replacing_entry) { + // Skip the thing at pos because it compares the same as the pair above. + copy->append(pos + 1, current_end); + } else { + copy->append(pos, current_end); + } + return wrap(copy); + } + + /** + * Creates a new map identical to this one, but with a key removed from it. + * + * @param key The key to remove. + * @return A new dictionary without that value. + */ + ArraySortedMap erase(const K& key) const { + const_iterator current_end = end(); + const_iterator pos = find(key); + if (pos == current_end) { + return *this; + } else if (size() <= 1) { + // If the key was found and it's the last entry, removing it would make + // the result empty. + return wrap(EmptyArray()); + } else { + auto copy = std::make_shared(begin(), pos); + copy->append(pos + 1, current_end); + return wrap(copy); + } + } + + bool contains(const K& key) const { + return find(key) != end(); + } + + /** + * Finds a value in the map. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key, or end() if + * not found. + */ + const_iterator find(const K& key) const { + return std::find_if(begin(), end(), [&](const std::pair& kv) { + return util::Same(comparator_.Compare(key, kv.first)); + }); + } + + /** + * Finds the index of the given key in the map. + * + * @param key The key to look up. + * @return The index of the entry containing the key, or npos if not found. + */ + size_type find_index(const K& key) const { + auto found = find(key); + return found == end() ? npos : static_cast(found - begin()); + } + + /** + * Finds the first entry in the map containing a key greater than or equal + * to the given key. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key or the next + * largest key. Can return end() if all keys in the map are less than the + * requested key. + */ + const_iterator lower_bound(const K& key) const { + return std::lower_bound( + begin(), end(), key, [&](const std::pair& el, const K& key) { + return util::Ascending(comparator_.Compare(el.first, key)); + }); + } + + const_iterator min() const { + return begin(); + } + + const_iterator max() const { + if (empty()) { + return end(); + } + + return end() - 1; + } + + /** + * Returns an iterator pointing to the first entry in the map. If there are + * no entries in the map, begin() == end(). + */ + const_iterator begin() const { + return array_->begin(); + } + + /** + * Returns an iterator pointing past the last entry in the map. + */ + const_iterator end() const { + return array_->end(); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted. + */ + const util::range keys() const { + return KeysView(*this); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted that are greater than or equal to the given key. + */ + const util::range keys_from(const K& key) const { + return KeysViewFrom(*this, key); + } + + /** + * Returns a view of this SortedMap 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 keys_in(const K& start_key, + const K& end_key) const { + return impl::KeysViewIn(*this, start_key, end_key, comparator()); + } + + private: + static array_pointer EmptyArray() { + static const array_pointer* kEmptyArray = [] { + auto array = new array_type(); + return new std::shared_ptr(array); + }(); + return *kEmptyArray; + } + + static array_pointer SortedArray(std::initializer_list entries, + const C& comparator) { + std::vector sorted{entries.begin(), entries.end()}; + std::sort( + sorted.begin(), sorted.end(), + [&comparator](const value_type& lhs, const value_type& rhs) { + return util::Ascending(comparator.Compare(lhs.first, rhs.first)); + }); + return std::make_shared(sorted.begin(), sorted.end()); + } + + ArraySortedMap(const array_pointer& array, const C& comparator) noexcept + : array_{array}, comparator_{comparator} { + } + + ArraySortedMap wrap(const array_pointer& array) const noexcept { + return ArraySortedMap{array, comparator_}; + } + + array_pointer array_; + C comparator_; +}; + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_ARRAY_SORTED_MAP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h new file mode 100644 index 0000000..fad8510 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h @@ -0,0 +1,87 @@ +/* + * 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_IMMUTABLE_KEYS_VIEW_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_KEYS_VIEW_H_ + +#include + +#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 { +namespace immutable { +namespace impl { + +template +using KeysRange = util::range>; + +template +KeysRange MakeKeysRange(Iterator begin, Iterator end) { + auto keys_begin = util::make_iterator_first(begin); + auto keys_end = util::make_iterator_first(end); + return util::make_range(keys_begin, keys_end); +} + +/** + * Returns a view of the keys of the given key-value range. + */ +template +auto KeysView(const Range& range) -> KeysRange { + return MakeKeysRange(std::begin(range), std::end(range)); +} + +template +auto KeysViewFrom(const Range& range, const K& key) + -> KeysRange { + auto keys_begin = util::make_iterator_first(range.lower_bound(key)); + auto keys_end = util::make_iterator_first(std::end(range)); + return util::make_range(keys_begin, keys_end); +} + +/** + * Returns a view of keys of the given key-value range that are greater than or + * equal to the given start_key and less than the given end_key. + * + * If `end_key` is less than or equal to `start_key`, creates empty range. + */ +template +auto KeysViewIn(const Range& range, + const K& start_key, + const K& end_key, + const C& comparator) + -> KeysRange { + // Forward iterators can't ever reach the end if the end is behind the start: + // they just keep incrementing until address space runs out. Adjust the range + // accordingly. + bool empty_range = !util::Ascending(comparator.Compare(start_key, end_key)); + if (empty_range) { + return MakeKeysRange(std::end(range), std::end(range)); + } + + auto range_begin = range.lower_bound(start_key); + auto range_end = range.lower_bound(end_key); + return MakeKeysRange(std::move(range_begin), std::move(range_end)); +} + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_KEYS_VIEW_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h new file mode 100644 index 0000000..fdcb82b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h @@ -0,0 +1,467 @@ +/* + * 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_IMMUTABLE_LLRB_NODE_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_H_ + +#include +#include + +#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 { +namespace immutable { +namespace impl { + +/** + * A Color of a tree node in a red-black tree. + */ +enum Color : unsigned int { + Black, + Red, +}; + +/** + * LlrbNode is a node in a TreeSortedMap. + */ +template +class LlrbNode : public SortedMapBase { + public: + using first_type = K; + using second_type = V; + + /** + * The type of the entries stored in the map. + */ + using value_type = std::pair; + using const_iterator = LlrbNodeIterator>; + + /** + * Constructs an empty node. + */ + LlrbNode() : LlrbNode{EmptyRep()} { + } + + /** Returns true if this is an empty node--a leaf node in the tree. */ + bool empty() const { + return size() == 0; + } + + /** Returns the number of elements at this node or beneath it in the tree. */ + size_type size() const { + return rep_->size_; + } + + /** Returns true if this node is red (as opposed to black). */ + bool red() const { + return static_cast(rep_->color_); + } + + const value_type& entry() const { + return rep_->entry_; + } + const K& key() const { + return entry().first; + } + const V& value() const { + return entry().second; + } + Color color() const { + return static_cast(rep_->color_); + } + const LlrbNode& left() const { + return rep_->left_; + } + const LlrbNode& right() const { + return rep_->right_; + } + + /** Returns a tree node with the given key-value pair set/updated. */ + template + LlrbNode insert(const K& key, + const V& value, + const Comparator& comparator) const; + + template + LlrbNode erase(const K& key, const Comparator& comparator) const; + + const LlrbNode& min() const { + const LlrbNode* node = this; + while (!node->left().empty()) { + node = &node->left(); + } + return *node; + } + + const LlrbNode& max() const { + const LlrbNode* node = this; + while (!node->right().empty()) { + node = &node->right(); + } + return *node; + } + + private: + struct Rep { + Rep(value_type&& entry, + size_type color, + size_type size, + LlrbNode left, + LlrbNode right) + : entry_{std::move(entry)}, + color_{color}, + size_{size}, + left_{std::move(left)}, + right_{std::move(right)} { + } + + Rep(value_type&& entry, size_type color, LlrbNode left, LlrbNode right) + : entry_{std::move(entry)}, + color_{color}, + size_{left.size() + 1 + right.size()}, + left_{std::move(left)}, + right_{std::move(right)} { + } + + value_type entry_; + + // Store the color in the high bit of the size to save memory. + size_type color_ : 1; + size_type size_ : 31; + + LlrbNode left_; + LlrbNode right_; + }; + + explicit LlrbNode(Rep rep) : rep_{std::make_shared(std::move(rep))} { + } + + explicit LlrbNode(const std::shared_ptr& rep) : rep_{rep} { + } + + explicit LlrbNode(std::shared_ptr&& rep) : rep_{std::move(rep)} { + } + + /** + * Returns a shared Empty node, to cut down on allocations in the base case. + */ + static const std::shared_ptr& EmptyRep() { + static const std::shared_ptr* empty_rep = [] { + auto rep = new Rep{std::pair{}, Color::Black, + /* size= */ 0u, LlrbNode{nullptr}, LlrbNode{nullptr}}; + auto empty = new std::shared_ptr{rep}; + + // Set up the empty Rep such that you can traverse infinitely down left + // and right links. + (*empty)->left_.rep_ = *empty; + (*empty)->right_.rep_ = *empty; + return empty; + }(); + return *empty_rep; + } + + /** + * Creates a new copy of this node, duplicating the Rep but without + * duplicating the left_ and right_ children. + */ + LlrbNode Clone() const { + return LlrbNode{*rep_}; + } + + void set_size(size_type size) { + rep_->size_ = size; + } + + void set_entry(const value_type& entry) { + rep_->entry_ = entry; + } + void set_entry(value_type&& entry) { + rep_->entry_ = std::move(entry); + } + void set_value(const V& value) { + rep_->entry_.second = value; + } + void set_color(size_type color) { + rep_->color_ = color; + } + void set_left(const LlrbNode& left) { + rep_->left_ = left; + } + void set_left(LlrbNode&& left) { + rep_->left_ = std::move(left); + } + void set_right(const LlrbNode& right) { + rep_->right_ = right; + } + void set_right(LlrbNode&& right) { + rep_->right_ = std::move(right); + } + + template + LlrbNode InnerInsert(const K& key, + const V& value, + const Comparator& comparator) const; + + template + LlrbNode InnerErase(const K& key, const Comparator& comparator) const; + + void FixUp(); + void FixRootColor(); + + void RotateLeft(); + void RotateRight(); + void FlipColor(); + + void RemoveMin(); + void MoveRedLeft(); + void MoveRedRight(); + + size_type OppositeColor() const noexcept { + return rep_->color_ == Color::Red ? Color::Black : Color::Red; + } + + std::shared_ptr rep_; +}; + +template +template +LlrbNode LlrbNode::insert(const K& key, + const V& value, + const Comparator& comparator) const { + LlrbNode root = InnerInsert(key, value, comparator); + root.FixRootColor(); + return root; +} + +template +template +LlrbNode LlrbNode::InnerInsert(const K& key, + const V& value, + const Comparator& comparator) const { + if (empty()) { + return LlrbNode{Rep{{key, value}, Color::Red, LlrbNode{}, LlrbNode{}}}; + } + + // Inserting is going to result in a copy but we can save some allocations by + // creating the copy once and fixing that up, rather than copying and + // re-copying the result. + LlrbNode result = Clone(); + + const K& this_key = this->key(); + util::ComparisonResult cmp = comparator.Compare(this_key, key); + if (cmp == util::ComparisonResult::Descending) { + result.set_left(result.left().InnerInsert(key, value, comparator)); + result.FixUp(); + + } else if (cmp == util::ComparisonResult::Ascending) { + result.set_right(result.right().InnerInsert(key, value, comparator)); + result.FixUp(); + + } else { + // keys are equal so update the value. + result.set_value(value); + } + return result; +} + +template +template +LlrbNode LlrbNode::erase(const K& key, + const Comparator& comparator) const { + LlrbNode root = InnerErase(key, comparator); + root.FixRootColor(); + return root; +} + +template +template +LlrbNode LlrbNode::InnerErase(const K& key, + const Comparator& comparator) const { + if (empty()) { + // Empty node already frozen + return LlrbNode{}; + } + + LlrbNode n = Clone(); + + if (util::Ascending(comparator.Compare(key, n.key()))) { + if (!n.left().empty() && !n.left().red() && !n.left().left().red()) { + n.MoveRedLeft(); + } + n.set_left(n.left().InnerErase(key, comparator)); + + } else { + if (n.left().red()) { + n.RotateRight(); + } + + if (!n.right().empty() && !n.right().red() && !n.right().left().red()) { + n.MoveRedRight(); + } + + if (util::Same(comparator.Compare(key, n.key()))) { + if (n.right().empty()) { + return LlrbNode{}; + + } else { + // Move the minimum node from the right subtree in place of this node. + LlrbNode smallest = n.right().min(); + LlrbNode new_right = n.right().Clone(); + new_right.RemoveMin(); + + n.set_entry(smallest.entry()); + n.set_right(std::move(new_right)); + } + } else { + n.set_right(n.right().InnerErase(key, comparator)); + } + } + n.FixUp(); + return n; +} + +template +void LlrbNode::FixUp() { + set_size(left().size() + 1 + right().size()); + + if (right().red() && !left().red()) { + RotateLeft(); + } + if (left().red() && left().left().red()) { + RotateRight(); + } + if (left().red() && right().red()) { + FlipColor(); + } +} + +/** + * Fixes the root node so its color is always black. + * + * This change is safe because a red `root` must be a new root: + * * If the key is not found, InnerErase returns an existing root, but + * existing roots will already be black (by the invariant). + * * If the key is found, InnerErase returns a new root, which is safe to + * modify. + */ +template +void LlrbNode::FixRootColor() { + if (red()) { + rep_->color_ = Color::Black; + } +} + +template +void LlrbNode::RemoveMin() { + // If the left node is empty then the right node must be empty (because the + // tree is left-leaning) and this node must be the minimum. + if (left().empty()) { + *this = LlrbNode{}; + return; + } + + if (!left().red() && !left().left().red()) { + MoveRedLeft(); + } + + LlrbNode new_left = left().Clone(); + new_left.RemoveMin(); + set_left(std::move(new_left)); + FixUp(); +} + +template +void LlrbNode::MoveRedLeft() { + FlipColor(); + if (right().left().red()) { + LlrbNode new_right = right().Clone(); + new_right.RotateRight(); + set_right(std::move(new_right)); + RotateLeft(); + FlipColor(); + } +} + +template +void LlrbNode::MoveRedRight() { + FlipColor(); + if (left().left().red()) { + RotateRight(); + FlipColor(); + } +} + +/* Rotates left: + * + * X R + * / \ / \ + * L R => X RR + * / \ / \ + * RL RR L RL + */ +template +void LlrbNode::RotateLeft() { + LlrbNode new_left{ + Rep{std::move(rep_->entry_), Color::Red, left(), right().left()}}; + + // size_ and color remain unchanged after a rotation. + set_entry(right().entry()); + set_left(std::move(new_left)); + set_right(right().right()); +} + +/* Rotates right: + * + * X L + * / \ / \ + * L R => LL X + * / \ / \ + * LL LR LR R + */ +template +void LlrbNode::RotateRight() { + LlrbNode new_right{ + Rep{std::move(rep_->entry_), Color::Red, left().right(), right()}}; + + // size_ remains unchanged after a rotation. Preserve color too. + set_entry(left().entry()); + set_left(left().left()); + set_right(std::move(new_right)); +} + +template +void LlrbNode::FlipColor() { + LlrbNode new_left = left().Clone(); + new_left.set_color(left().OppositeColor()); + + LlrbNode new_right = right().Clone(); + new_right.set_color(right().OppositeColor()); + + // Preserve contents_ and size_ + set_color(OppositeColor()); + set_left(std::move(new_left)); + set_right(std::move(new_right)); +} + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h new file mode 100644 index 0000000..170ff9c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h @@ -0,0 +1,215 @@ +/* + * 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_IMMUTABLE_LLRB_NODE_ITERATOR_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_ITERATOR_H_ + +#include +#include +#include + +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace immutable { +namespace impl { + +/** + * A forward iterator for traversing LlrbNodes. LlrbNodes represent the nodes + * in a tree implementing a sorted map so iterating with LlrbNodeIterator is + * an in-order traversal of the map. + * + * ## Complexity + * + * LlrbNode is an immutable tree, where mutations create new trees without + * invalidating any of the old instances. This means the tree cannot contain + * parent pointers and thus this iterator implementation must keep an explicit + * stack. + * + * For an underlying tree of size `n`: + * + * * LlrbNodeIterator uses `O(lg(n))` memory for its stack, and + * * incrementing an iterator is an `O(lg(n))` operation. + * + * ## Invalidation and Comparison + * + * LlrbNodeIterators compare based on the identity of the nodes themselves, + * not based on the values of the keys in the nodes. When adding and removing + * the same key and iterator obtained before and after will not compare equal. + * + * LlrbNodeIterators are not invalidated in any conventional sense because + * mutations of the underlying tree create new trees. Together this means that + * any given version of the tree can be iterated over from the same iterator + * repeatedly, but a "mutable view" of the tree kept by replacing the pointer + * to the root is effectively invalidated on each mutation. + * + * Note: LlrbNodeIterator does not extend the lifetime of its underlying tree. + */ +template +class LlrbNodeIterator { + public: + using node_type = N; + using key_type = typename node_type::first_type; + + using stack_type = std::stack; + + using iterator_category = std::forward_iterator_tag; + using value_type = typename node_type::value_type; + + using pointer = typename node_type::value_type const*; + using reference = typename node_type::value_type const&; + using difference_type = std::ptrdiff_t; + + explicit LlrbNodeIterator(stack_type&& stack) : stack_(std::move(stack)) { + } + + /** + * Constructs an iterator starting at the first node in the iteration + * sequence of the tree represented by the given root node (i.e. it points at + * the left-most node). + */ + static LlrbNodeIterator Begin(const node_type* root) { + stack_type stack; + AccumulateLeft(root, &stack); + return LlrbNodeIterator{std::move(stack)}; + } + + /** + * Constructs an iterator pointing at the end of the iteration sequence of the + * tree pointed to by the given node (i.e. one past the right-most node) + */ + static LlrbNodeIterator End() { + return LlrbNodeIterator{stack_type{}}; + } + + // Default constructor to conform to the requirements of ForwardIterator + LlrbNodeIterator() { + } + + /** + * Constructs an iterator pointing to the first node whose key is not less + * than the given key. If the key is in the tree then the lower bound will be + * the node containing the key. If the key is not in the tree, the lower bound + * will the first node greater than the key. If all nodes in the tree are less + * than the given key, returns an equivalent to `End()`. + */ + template + static LlrbNodeIterator LowerBound(const node_type* root, + const key_type& key, + const C& comparator) { + stack_type stack; + + const node_type* node = root; + while (!node->empty()) { + util::ComparisonResult cmp = comparator.Compare(key, node->key()); + if (cmp == util::ComparisonResult::Same) { + // Found exactly what we're looking for so we're done. + stack.push(node); + return LlrbNodeIterator{std::move(stack)}; + + } else if (cmp == util::ComparisonResult::Ascending) { + // key < node.key (for the forward direction) + stack.push(node); + node = &node->left(); + } else { + // key > node.key (for the forward direction). Don't put this in the + // stack because we don't need to revisit it in the iteration order. + node = &node->right(); + } + } + + return LlrbNodeIterator{std::move(stack)}; + } + + /** + * Returns true if this iterator points at the end of the iteration sequence. + */ + bool is_end() const { + return stack_.empty(); + } + + /** + * Returns the address of the entry in the node that this iterator points to. + * This can only be called if `end()` is false. + */ + pointer get() const { + HARD_ASSERT(!is_end()); + return &(stack_.top()->entry()); + } + + reference operator*() const { + return *get(); + } + + pointer operator->() const { + return get(); + } + + LlrbNodeIterator& operator++() { + HARD_ASSERT(!is_end()); + + // Pop the stack, moving the currently pointed to node to the parent. + const node_type* node = stack_.top(); + stack_.pop(); + + // If the popped node has a right subtree that has to precede the parent in + // the iteration order so push those on. + node = &node->right(); + AccumulateLeft(node, &stack_); + + return *this; + } + + LlrbNodeIterator operator++(int /*unused*/) { + LlrbNodeIterator result = *this; + ++*this; + return result; + } + + friend bool operator==(const LlrbNodeIterator& a, const LlrbNodeIterator& b) { + if (a.is_end()) { + return b.is_end(); + } else if (b.is_end()) { + return false; + } else { + const key_type& left_key = a.get()->first; + const key_type& right_key = b.get()->first; + return left_key == right_key; + } + } + + bool operator!=(const LlrbNodeIterator& b) const { + return !(*this == b); + } + + private: + static void AccumulateLeft(const node_type* node, stack_type* stack) { + for (; !node->empty(); node = &node->left()) { + stack->push(node); + } + } + + stack_type stack_; +}; + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_ITERATOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc new file mode 100644 index 0000000..0350172 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc @@ -0,0 +1,29 @@ +/* + * 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/immutable/sorted_container.h" + +namespace firebase { +namespace firestore { +namespace immutable { + +// Define external storage for constants: +constexpr SortedContainer::size_type SortedContainer::npos; +constexpr SortedMapBase::size_type SortedMapBase::kFixedSize; + +} // namespace immutable +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.h new file mode 100644 index 0000000..f2cf1d7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.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_IMMUTABLE_SORTED_CONTAINER_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_CONTAINER_H_ + +#include + +namespace firebase { +namespace firestore { +namespace immutable { + +/** + * A base class for implementing immutable sorted containers, containing types + * and constants that don't depend upon the template parameters to the main + * class. + * + * Note that this exists as a base class rather than as just a namespace in + * order to make it possible for users of the SortedMap classes to avoid needing + * to declare storage for each instantiation of the template. + */ +class SortedContainer { + public: + /** + * The type of size() methods on immutable collections. Note: + * * This is not size_t specifically to save space in the TreeSortedMap + * implementation. + * * This remains unsigned for straightforward casting to size_t. + */ + using size_type = uint32_t; + + /** + * A sentinel return value that indicates not found. Functionally similar to + * std::string::npos. + */ + static constexpr size_type npos = static_cast(-1); +}; + +/** + * A base class for implementing sorted maps, containing types and constants + * that don't depend upon the template parameters to the main class. + * + * Note that this exists as a base class rather than as just a namespace in + * order to make it possible for users of the SortedMap classes to avoid needing + * to declare storage for each instantiation of the template. + */ +class SortedMapBase : public SortedContainer { + public: + /** + * The maximum size of an ArraySortedMap. + * + * This is the size threshold where we use a tree backed sorted map instead of + * an array backed sorted map. This is a more or less arbitrary chosen value, + * that was chosen to be large enough to fit most of object kind of Firebase + * data, but small enough to not notice degradation in performance for + * inserting and lookups. Feel free to empirically determine this constant, + * but don't expect much gain in real world performance. + */ + static constexpr size_type kFixedSize = 25; +}; + +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_CONTAINER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h new file mode 100644 index 0000000..7cf0a5b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h @@ -0,0 +1,394 @@ +/* + * 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_IMMUTABLE_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_H_ + +#include + +#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" + +namespace firebase { +namespace firestore { +namespace immutable { + +/** + * SortedMap is a value type containing a map. It is immutable, but + * has methods to efficiently create new maps that are mutations of it. + */ +template > +class SortedMap : public SortedMapBase { + public: + using key_type = K; + using mapped_type = V; + /** The type of the entries stored in the map. */ + using value_type = std::pair; + using array_type = impl::ArraySortedMap; + using tree_type = impl::TreeSortedMap; + + using const_iterator = impl::SortedMapIterator< + value_type, + typename impl::FixedArray::const_iterator, + typename impl::LlrbNode::const_iterator>; + + using const_key_iterator = util::iterator_first; + + /** + * Creates an empty SortedMap. + */ + explicit SortedMap(const C& comparator = {}) + : SortedMap{array_type{comparator}} { + } + + /** + * Creates an SortedMap containing the given entries. + */ + SortedMap(std::initializer_list entries, + const C& comparator = {}) { + if (entries.size() <= kFixedSize) { + tag_ = Tag::Array; + new (&array_) array_type{entries, comparator}; + } else { + new (&tree_) tree_type{tree_type::Create(entries, comparator)}; + } + } + + SortedMap(const SortedMap& other) : tag_{other.tag_} { + switch (tag_) { + case Tag::Array: + new (&array_) array_type{other.array_}; + break; + case Tag::Tree: + new (&tree_) tree_type{other.tree_}; + break; + } + } + + SortedMap(SortedMap&& other) noexcept : tag_{other.tag_} { + switch (tag_) { + case Tag::Array: + new (&array_) array_type{std::move(other.array_)}; + break; + case Tag::Tree: + new (&tree_) tree_type{std::move(other.tree_)}; + break; + } + } + + ~SortedMap() { + switch (tag_) { + case Tag::Array: + array_.~ArraySortedMap(); + break; + case Tag::Tree: + tree_.~TreeSortedMap(); + break; + } + } + + SortedMap& operator=(const SortedMap& other) { + if (tag_ == other.tag_) { + switch (tag_) { + case Tag::Array: + array_ = other.array_; + break; + case Tag::Tree: + tree_ = other.tree_; + break; + } + } else { + this->~SortedMap(); + new (this) SortedMap{other}; + } + return *this; + } + + SortedMap& operator=(SortedMap&& other) noexcept { + if (tag_ == other.tag_) { + switch (tag_) { + case Tag::Array: + array_ = std::move(other.array_); + break; + case Tag::Tree: + tree_ = std::move(other.tree_); + break; + } + } else { + this->~SortedMap(); + new (this) SortedMap{std::move(other)}; + } + return *this; + } + + /** Returns true if the map contains no elements. */ + bool empty() const { + switch (tag_) { + case Tag::Array: + return array_.empty(); + case Tag::Tree: + return tree_.empty(); + } + UNREACHABLE(); + } + + /** Returns the number of items in this map. */ + size_type size() const { + switch (tag_) { + case Tag::Array: + return array_.size(); + case Tag::Tree: + return tree_.size(); + } + UNREACHABLE(); + } + + const C& comparator() const { + switch (tag_) { + case Tag::Array: + return array_.comparator(); + case Tag::Tree: + return tree_.comparator(); + } + UNREACHABLE(); + } + + /** + * Creates a new map identical to this one, but with a key-value pair added or + * updated. + * + * @param key The key to insert/update. + * @param value The value to associate with the key. + * @return A new dictionary with the added/updated value. + */ + ABSL_MUST_USE_RESULT SortedMap insert(const K& key, const V& value) const { + switch (tag_) { + case Tag::Array: + if (array_.size() >= kFixedSize) { + // Strictly speaking this conversion is more eager than it needs to + // be since we could be replacing an existing key. However, the + // benefit of using the array for small maps doesn't really depend on + // exactly where this cut-off happens and just unconditionally + // converting if the next insertion could overflow keeps things + // simpler. + tree_type tree = tree_type::Create(array_, comparator()); + return SortedMap{tree.insert(key, value)}; + } else { + return SortedMap{array_.insert(key, value)}; + } + case Tag::Tree: + return SortedMap{tree_.insert(key, value)}; + } + UNREACHABLE(); + } + + /** + * Creates a new map identical to this one, but with a key removed from it. + * + * @param key The key to remove. + * @return A new map without that value. + */ + ABSL_MUST_USE_RESULT SortedMap erase(const K& key) const { + switch (tag_) { + case Tag::Array: + return SortedMap{array_.erase(key)}; + case Tag::Tree: + tree_type result = tree_.erase(key); + if (result.empty()) { + // Flip back to the array representation for empty arrays. + return SortedMap{comparator()}; + } + return SortedMap{std::move(result)}; + } + UNREACHABLE(); + } + + bool contains(const K& key) const { + switch (tag_) { + case Tag::Array: + return array_.contains(key); + case Tag::Tree: + return tree_.contains(key); + } + UNREACHABLE(); + } + + /** + * Finds a value in the map. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key, or end() if + * not found. + */ + const_iterator find(const K& key) const { + switch (tag_) { + case Tag::Array: + return const_iterator(array_.find(key)); + case Tag::Tree: + return const_iterator{tree_.find(key)}; + } + UNREACHABLE(); + } + + /** + * Finds the index of the given key in the map. + * + * @param key The key to look up. + * @return The index of the entry containing the key, or npos if not found. + */ + size_type find_index(const K& key) const { + switch (tag_) { + case Tag::Array: + return array_.find_index(key); + case Tag::Tree: + return tree_.find_index(key); + } + UNREACHABLE(); + } + + absl::optional get(const K& key) const { + auto found = find(key); + if (found != end()) { + return found->second; + } else { + return absl::nullopt; + } + } + + /** + * Finds the first entry in the map containing a key greater than or equal + * to the given key. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key or the next + * largest key. Can return end() if all keys in the map are less than the + * requested key. + */ + const_iterator lower_bound(const K& key) const { + switch (tag_) { + case Tag::Array: + return const_iterator(array_.lower_bound(key)); + case Tag::Tree: + return const_iterator{tree_.lower_bound(key)}; + } + UNREACHABLE(); + } + + const_iterator min() const { + switch (tag_) { + case Tag::Array: + return const_iterator(array_.min()); + case Tag::Tree: + return const_iterator{tree_.min()}; + } + UNREACHABLE(); + } + + const_iterator max() const { + switch (tag_) { + case Tag::Array: + return const_iterator(array_.max()); + case Tag::Tree: + return const_iterator{tree_.max()}; + } + UNREACHABLE(); + } + + /** + * Returns an iterator pointing to the first entry in the map. If there are + * no entries in the map, begin() == end(). + */ + const_iterator begin() const { + switch (tag_) { + case Tag::Array: + return const_iterator{array_.begin()}; + case Tag::Tree: + return const_iterator{tree_.begin()}; + } + UNREACHABLE(); + } + + /** + * Returns an iterator pointing past the last entry in the map. + */ + const_iterator end() const { + switch (tag_) { + case Tag::Array: + return const_iterator{array_.end()}; + case Tag::Tree: + return const_iterator{tree_.end()}; + } + UNREACHABLE(); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted. + */ + const util::range keys() const { + return impl::KeysView(*this); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted that are greater than or equal to the given key. + */ + const util::range keys_from(const K& key) const { + return impl::KeysViewFrom(*this, key); + } + + /** + * Returns a view of this SortedMap 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 keys_in(const K& start_key, + const K& end_key) const { + return impl::KeysViewIn(*this, start_key, end_key, comparator()); + } + + private: + explicit SortedMap(array_type&& array) + : tag_{Tag::Array}, array_{std::move(array)} { + } + + explicit SortedMap(tree_type&& tree) + : tag_{Tag::Tree}, tree_{std::move(tree)} { + } + + enum class Tag { + Array, + Tree, + }; + + Tag tag_; + union { + array_type array_; + tree_type tree_; + }; +}; + +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h new file mode 100644 index 0000000..e565150 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h @@ -0,0 +1,194 @@ +/* + * 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_IMMUTABLE_SORTED_MAP_ITERATOR_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_ITERATOR_H_ + +#include + +#include "Firestore/core/src/immutable/array_sorted_map.h" +#include "Firestore/core/src/immutable/tree_sorted_map.h" + +namespace firebase { +namespace firestore { +namespace immutable { +namespace impl { + +template +class SortedMapIterator { + public: + using iterator_category = std::forward_iterator_tag; + using value_type = V; + using pointer = const value_type*; + using reference = const value_type&; + using difference_type = std::ptrdiff_t; + + public: + // Default constructor to conform to the requirements of ForwardIterator + SortedMapIterator() : tag_{Tag::Array}, array_iter_{} { + } + + explicit SortedMapIterator(ArrayIter&& delegate) + : tag_{Tag::Array}, array_iter_{std::move(delegate)} { + } + + explicit SortedMapIterator(TreeIter&& delegate) + : tag_{Tag::Tree}, tree_iter_{std::move(delegate)} { + } + + SortedMapIterator(const SortedMapIterator& other) : tag_(other.tag_) { + switch (tag_) { + case Tag::Array: + new (&array_iter_) ArrayIter{other.array_iter_}; + break; + case Tag::Tree: + new (&tree_iter_) TreeIter{other.tree_iter_}; + break; + } + } + + SortedMapIterator(SortedMapIterator&& other) noexcept : tag_(other.tag_) { + switch (tag_) { + case Tag::Array: + new (&array_iter_) ArrayIter{std::move(other.array_iter_)}; + break; + case Tag::Tree: + new (&tree_iter_) TreeIter{std::move(other.tree_iter_)}; + break; + } + } + + ~SortedMapIterator() { + switch (tag_) { + case Tag::Array: + array_iter_.~ArrayIter(); + break; + case Tag::Tree: + tree_iter_.~TreeIter(); + break; + } + } + + SortedMapIterator& operator=(const SortedMapIterator& other) { + if (tag_ == other.tag_) { + switch (tag_) { + case Tag::Array: + array_iter_ = other.array_iter_; + break; + case Tag::Tree: + tree_iter_ = other.tree_iter_; + break; + } + } else { + this->~SortedMapIterator(); + new (this) SortedMapIterator(other); + } + return *this; + } + + SortedMapIterator& operator=(SortedMapIterator&& other) noexcept { + if (tag_ == other.tag_) { + switch (tag_) { + case Tag::Array: + array_iter_ = std::move(other.array_iter_); + break; + case Tag::Tree: + tree_iter_ = std::move(other.tree_iter_); + break; + } + } else { + this->~SortedMapIterator(); + new (this) SortedMapIterator(std::move(other)); + } + return *this; + } + + pointer get() const { + switch (tag_) { + case Tag::Array: + // std::array::iterator is not guaranteed to be a bare pointer but will + // be a RandomAccessIterator which does have operator*(). + return &*array_iter_; + case Tag::Tree: + return tree_iter_.get(); + } + UNREACHABLE(); + } + + reference operator*() const { + return *get(); + } + + pointer operator->() const { + return get(); + } + + SortedMapIterator& operator++() { + switch (tag_) { + case Tag::Array: + ++array_iter_; + break; + case Tag::Tree: + ++tree_iter_; + break; + } + return *this; + } + + SortedMapIterator operator++(int /*unused*/) { + SortedMapIterator result = *this; + ++*this; + return result; + } + + friend bool operator==(const SortedMapIterator& a, + const SortedMapIterator& b) { + if (a.tag_ != b.tag_) { + return false; + } + + switch (a.tag_) { + case Tag::Array: + return a.array_iter_ == b.array_iter_; + case Tag::Tree: + return a.tree_iter_ == b.tree_iter_; + } + UNREACHABLE(); + } + + bool operator!=(const SortedMapIterator& b) const { + return !(*this == b); + } + + private: + enum class Tag { + Array, + Tree, + }; + + Tag tag_; + union { + ArrayIter array_iter_; + TreeIter tree_iter_; + }; +}; + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_ITERATOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_set.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_set.h new file mode 100644 index 0000000..31950be --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h new file mode 100644 index 0000000..0cabc1f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h @@ -0,0 +1,269 @@ +/* + * 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_IMMUTABLE_TREE_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_TREE_SORTED_MAP_H_ + +#include +#include +#include +#include +#include + +#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 { +namespace immutable { +namespace impl { + +/** + * TreeSortedMap is a value type containing a map. It is immutable, but has + * methods to efficiently create new maps that are mutations of it. + */ +template > +class TreeSortedMap : public SortedMapBase, private util::CompressedMember { + using ComparatorMember = util::CompressedMember; + + public: + /** + * The type of the entries stored in the map. + */ + using value_type = std::pair; + + /** + * The type of the node containing entries of value_type. + */ + using node_type = LlrbNode; + using const_iterator = typename node_type::const_iterator; + using const_key_iterator = util::iterator_first; + + /** + * Creates an empty TreeSortedMap. + */ + explicit TreeSortedMap(const C& comparator = {}) + : ComparatorMember{comparator} { + } + + /** + * Creates a TreeSortedMap from a range of pairs to insert. + */ + template + static TreeSortedMap Create(const Range& range, const C& comparator) { + node_type node; + for (auto&& element : range) { + node = node.insert(element.first, element.second, comparator); + } + return TreeSortedMap{std::move(node), comparator}; + } + + /** Returns true if the map contains no elements. */ + bool empty() const { + return root_.empty(); + } + + /** Returns the number of items in this map. */ + size_type size() const { + return root_.size(); + } + + const node_type& root() const { + return root_; + } + + const C& comparator() const { + return ComparatorMember::get(); + } + + /** + * Creates a new map identical to this one, but with a key-value pair added or + * updated. + * + * @param key The key to insert/update. + * @param value The value to associate with the key. + * @return A new dictionary with the added/updated value. + */ + TreeSortedMap insert(const K& key, const V& value) const { + const C& comparator = this->comparator(); + return TreeSortedMap{root_.insert(key, value, comparator), comparator}; + } + + /** + * Creates a new map identical to this one, but with a key removed from it. + * + * @param key The key to remove. + * @return A new map without that value. + */ + TreeSortedMap erase(const K& key) const { + const C& comparator = this->comparator(); + return TreeSortedMap{root_.erase(key, comparator), comparator}; + } + + bool contains(const K& key) const { + // Inline the tree traversal here to avoid building up the stack required + // to construct a full iterator. + const C& comparator = this->comparator(); + const node_type* node = &root(); + while (!node->empty()) { + util::ComparisonResult cmp = comparator.Compare(key, node->key()); + if (cmp == util::ComparisonResult::Same) { + return true; + } else if (cmp == util::ComparisonResult::Ascending) { + node = &node->left(); + } else { + node = &node->right(); + } + } + return false; + } + + /** + * Finds a value in the map. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key, or end() if + * not found. + */ + const_iterator find(const K& key) const { + const_iterator found = lower_bound(key); + if (!found.is_end() && + util::Same(this->comparator().Compare(key, found->first))) { + return found; + } else { + return end(); + } + } + + /** + * Finds the index of the given key in the map. + * + * @param key The key to look up. + * @return The index of the entry containing the key, or npos if not found. + */ + size_type find_index(const K& key) const { + const C& comparator = this->comparator(); + + size_type pruned_nodes = 0; + const node_type* node = &root_; + while (!node->empty()) { + util::ComparisonResult cmp = comparator.Compare(key, node->key()); + if (cmp == util::ComparisonResult::Same) { + return pruned_nodes + node->left().size(); + + } else if (cmp == util::ComparisonResult::Ascending) { + node = &node->left(); + + } else if (cmp == util::ComparisonResult::Descending) { + pruned_nodes += node->left().size() + 1; + node = &node->right(); + } + } + return npos; + } + + /** + * Finds the first entry in the map containing a key greater than or equal + * to the given key. + * + * @param key The key to look up. + * @return An iterator pointing to the entry containing the key or the next + * largest key. Can return end() if all keys in the map are less than the + * requested key. + */ + const_iterator lower_bound(const K& key) const { + return const_iterator::LowerBound(&root_, key, this->comparator()); + } + + const_iterator min() const { + return begin(); + } + + const_iterator max() const { + if (empty()) { + return end(); + } + + const node_type& max_node = root_.max(); + typename const_iterator::stack_type stack; + stack.push(&max_node); + return const_iterator{std::move(stack)}; + } + + /** + * Returns a forward iterator pointing to the first entry in the map. If there + * are no entries in the map, begin() == end(). + * + * See LlrbNodeIterator for details + */ + const_iterator begin() const { + return const_iterator::Begin(&root_); + } + + /** + * Returns an iterator pointing past the last entry in the map. + */ + const_iterator end() const { + return const_iterator::End(); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted. + */ + const util::range keys() const { + return KeysView(*this); + } + + /** + * Returns a view of this SortedMap containing just the keys that have been + * inserted that are greater than or equal to the given key. + */ + const util::range keys_from(const K& key) const { + return KeysViewFrom(*this, key); + } + + /** + * Returns a view of this SortedMap 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 keys_in(const K& start_key, + const K& end_key) const { + return impl::KeysViewIn(*this, start_key, end_key, this->comparator()); + } + + private: + TreeSortedMap(node_type&& root, const C& comparator) noexcept + : ComparatorMember{comparator}, root_{std::move(root)} { + } + + TreeSortedMap Wrap(node_type&& root) noexcept { + return TreeSortedMap{std::move(root), this->comparator()}; + } + + node_type root_; +}; + +} // namespace impl +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_TREE_SORTED_MAP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/bundle_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/bundle_cache.h new file mode 100644 index 0000000..dba3956 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/bundle_cache.h @@ -0,0 +1,77 @@ +/* + * Copyright 2021 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_BUNDLE_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_BUNDLE_CACHE_H_ + +#include + +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace bundle { + +class BundleMetadata; +class NamedQuery; + +} // namespace bundle + +namespace local { + +/** + * Provides methods to save and read Firestore bundles. + */ +class BundleCache { + public: + virtual ~BundleCache() = default; + + /** + * Gets the saved metadata for a given bundle id. + * + * @return The `Bundle` corresponding to the given bundle id, or nullopt if + * no bundles are found for the given id. + */ + virtual absl::optional GetBundleMetadata( + const std::string& bundle_id) const = 0; + + /** + * Saves the metadata for a bundle into local storage, using its id as the + * persistent key. + */ + virtual void SaveBundleMetadata(const bundle::BundleMetadata& metadata) = 0; + + /** + * Gets a saved `NamedQuery` for the given query name. + * + * @return The `NamedQuery` corresponding to the given query name, or nullopt + * if no queries are found for the given name. + */ + virtual absl::optional GetNamedQuery( + const std::string& query_name) const = 0; + + /** + * Saves a `NamedQuery` from a bundle, using its name as the persistent key. + */ + virtual void SaveNamedQuery(const bundle::NamedQuery& query) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_BUNDLE_CACHE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc new file mode 100644 index 0000000..e5430c2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc @@ -0,0 +1,68 @@ +/* + * 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/document_key_reference.h" + +#include +#include + +#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 { +namespace local { + +using model::DocumentKey; +using util::ComparisonResult; + +bool operator==(const DocumentKeyReference& lhs, + const DocumentKeyReference& rhs) { + return lhs.key_ == rhs.key_ && lhs.ref_id_ == rhs.ref_id_; +} + +size_t DocumentKeyReference::Hash() const { + return util::Hash(key_.ToString(), ref_id_); +} + +std::string DocumentKeyReference::ToString() const { + return util::StringFormat("", + key_.ToString(), ref_id_); +} + +/** Sorts document references by key then ID. */ +ComparisonResult DocumentKeyReference::ByKey::Compare( + const DocumentKeyReference& lhs, const DocumentKeyReference& rhs) const { + ComparisonResult result = util::Compare(lhs.key_, rhs.key_); + if (!util::Same(result)) return result; + + return util::Compare(lhs.ref_id_, rhs.ref_id_); +} + +/** Sorts document references by ID then key. */ +ComparisonResult DocumentKeyReference::ById::Compare( + const DocumentKeyReference& lhs, const DocumentKeyReference& rhs) const { + ComparisonResult result = util::Compare(lhs.ref_id_, rhs.ref_id_); + if (!util::Same(result)) return result; + + return util::Compare(lhs.key_, rhs.key_); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h new file mode 100644 index 0000000..71bba7a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h @@ -0,0 +1,97 @@ +/* + * 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_DOCUMENT_KEY_REFERENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_DOCUMENT_KEY_REFERENCE_H_ + +#include +#include + +#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 { +namespace local { + +/** + * An immutable value used to keep track of an association between some + * referencing target or batch and a document key that the target or batch + * references. + * + * A reference can be from either listen targets (identified by their TargetId) + * or mutation batches (identified by their BatchId). See GarbageCollector + * for more details. + * + * Not to be confused with FIRDocumentReference. + */ +class DocumentKeyReference { + public: + DocumentKeyReference() { + } + + /** Initializes the document reference with the given key and Id. */ + DocumentKeyReference(model::DocumentKey key, int32_t ref_id) + : key_{std::move(key)}, ref_id_{ref_id} { + } + + /** The document key that's the target of this reference. */ + const model::DocumentKey& key() const { + return key_; + } + + /** + * 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.) + */ + int32_t ref_id() const { + return ref_id_; + } + + friend bool operator==(const DocumentKeyReference& lhs, + const DocumentKeyReference& rhs); + + size_t Hash() const; + + std::string ToString() const; + + /** Sorts document references by key then Id. */ + struct ByKey { + util::ComparisonResult Compare(const DocumentKeyReference& lhs, + const DocumentKeyReference& rhs) const; + }; + + /** Sorts document references by Id then key. */ + struct ById { + util::ComparisonResult Compare(const DocumentKeyReference& lhs, + const DocumentKeyReference& rhs) const; + }; + + private: + model::DocumentKey key_; + + // PORTING NOTE: this is `id` on other platforms but that's a reserved word in + // Objective-C++. + int32_t ref_id_ = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_DOCUMENT_KEY_REFERENCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h new file mode 100644 index 0000000..c0fe940 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h @@ -0,0 +1,67 @@ +/* + * 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_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_INDEX_MANAGER_H_ + +#include +#include + +namespace firebase { +namespace firestore { + +namespace model { +class ResourcePath; +} // namespace model + +namespace local { + +/** + * Represents a set of indexes that are used to execute queries efficiently. + * + * Currently the only index is a [collection id] => [parent path] index, used + * to execute Collection Group queries. + */ +class IndexManager { + public: + virtual ~IndexManager() = default; + + /** + * 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(). + * + * NOTE: Currently we don't remove index entries. If this ends up being an + * issue we can devise some sort of GC strategy. + */ + virtual void AddToCollectionParentIndex( + const model::ResourcePath& collection_path) = 0; + + /** + * 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). + */ + virtual std::vector GetCollectionParents( + const std::string& collection_id) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_INDEX_MANAGER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.cc new file mode 100644 index 0000000..9af2737 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.cc @@ -0,0 +1,104 @@ +/* + * Copyright 2021 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_bundle_cache.h" + +#include + +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace local { + +using bundle::BundleMetadata; +using bundle::NamedQuery; +using nanopb::Message; +using nanopb::StringReader; + +LevelDbBundleCache::LevelDbBundleCache(LevelDbPersistence* db, + LocalSerializer* serializer) + : db_(NOT_NULL(db)), serializer_(NOT_NULL(serializer)) { +} + +absl::optional LevelDbBundleCache::GetBundleMetadata( + const std::string& bundle_id) const { + auto key = LevelDbBundleKey::Key(bundle_id); + std::string encoded; + auto done = db_->current_transaction()->Get(key, &encoded); + + if (!done.ok()) { + return absl::nullopt; + } + + nanopb::StringReader reader{encoded}; + auto message = Message::TryParse(&reader); + if (!reader.ok()) { + HARD_FAIL("BundleMetadata proto failed to parse: %s", + reader.status().ToString()); + } + + BundleMetadata bundle = serializer_->DecodeBundle(&reader, *message); + if (!reader.ok()) { + HARD_FAIL("BundleMetadata proto failed to decode: %s", + reader.status().ToString()); + } + return absl::make_optional(std::move(bundle)); +} + +void LevelDbBundleCache::SaveBundleMetadata(const BundleMetadata& metadata) { + auto key = LevelDbBundleKey::Key(metadata.bundle_id()); + db_->current_transaction()->Put(key, serializer_->EncodeBundle(metadata)); +} + +absl::optional LevelDbBundleCache::GetNamedQuery( + const std::string& query_name) const { + auto key = LevelDbNamedQueryKey::Key(query_name); + std::string encoded; + auto done = db_->current_transaction()->Get(key, &encoded); + + if (!done.ok()) { + return absl::nullopt; + } + + nanopb::StringReader reader{encoded}; + auto message = Message::TryParse(&reader); + if (!reader.ok()) { + HARD_FAIL("NamedQuery proto failed to parse: %s", + reader.status().ToString()); + } + + auto named_query = serializer_->DecodeNamedQuery(&reader, *message); + if (!reader.ok()) { + HARD_FAIL("NamedQuery proto failed to decode: %s", + reader.status().ToString()); + } + return absl::make_optional(std::move(named_query)); +} + +void LevelDbBundleCache::SaveNamedQuery(const NamedQuery& query) { + auto key = LevelDbNamedQueryKey::Key(query.query_name()); + db_->current_transaction()->Put(key, serializer_->EncodeNamedQuery(query)); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.h new file mode 100644 index 0000000..dabe5b3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_bundle_cache.h @@ -0,0 +1,60 @@ +/* + * Copyright 2021 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_BUNDLE_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_BUNDLE_CACHE_H_ + +#include + +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#include "Firestore/core/src/local/bundle_cache.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbPersistence; +class LocalSerializer; + +class LevelDbBundleCache : public BundleCache { + public: + /** Creates a new bundle cache in the given LevelDB. */ + LevelDbBundleCache(LevelDbPersistence* db, LocalSerializer* serializer); + + absl::optional GetBundleMetadata( + const std::string& bundle_id) const override; + + void SaveBundleMetadata(const bundle::BundleMetadata& metadata) override; + + absl::optional GetNamedQuery( + const std::string& query_name) const override; + + void SaveNamedQuery(const bundle::NamedQuery& query) override; + + private: + // The LevelDbBundleCache is owned by LevelDbPersistence. + LevelDbPersistence* db_ = nullptr; + // Owned by LevelDbPersistence. + LocalSerializer* serializer_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_BUNDLE_CACHE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc new file mode 100644 index 0000000..9cbf11e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.h new file mode 100644 index 0000000..233b8dd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.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_LOCAL_LEVELDB_INDEX_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_INDEX_MANAGER_H_ + +#include +#include + +#include "Firestore/core/src/local/index_manager.h" +#include "Firestore/core/src/local/memory_index_manager.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbPersistence; + +/** A persisted implementation of IndexManager. */ +class LevelDbIndexManager : public IndexManager { + public: + explicit LevelDbIndexManager(LevelDbPersistence* db); + + void AddToCollectionParentIndex( + const model::ResourcePath& collection_path) override; + + std::vector GetCollectionParents( + const std::string& collection_id) override; + + private: + // The LevelDbIndexManager is owned by LevelDbPersistence. + LevelDbPersistence* db_; + + /** + * An in-memory copy of the index entries we've already written since the SDK + * launched. Used to avoid re-writing the same entry repeatedly. + * + * This is *NOT* a complete cache of what's in persistence and so can never + * be used to satisfy reads. + */ + MemoryCollectionParentIndex collection_parents_cache_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_INDEX_MANAGER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc new file mode 100644 index 0000000..a5f25e5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc @@ -0,0 +1,1099 @@ +/* + * 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_key.h" + +#include +#include + +#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" + +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::ResourcePath; +using firebase::firestore::util::OrderedCode; + +namespace firebase { +namespace firestore { +namespace local { + +namespace { + +const char* kVersionGlobalTable = "version"; +const char* kMutationsTable = "mutation"; +const char* kDocumentMutationsTable = "document_mutation"; +const char* kMutationQueuesTable = "mutation_queue"; +const char* kTargetGlobalTable = "target_global"; +const char* kTargetsTable = "target"; +const char* kQueryTargetsTable = "query_target"; +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"; +const char* kBundlesTable = "bundles"; +const char* kNamedQueriesTable = "named_queries"; + +/** + * Labels for the components of keys. These serve to make keys self-describing. + * + * These are intended to sort similarly to keys in the server storage format. + * + * Note that the server writes component labels using the equivalent to + * OrderedCode::WriteSignedNumDecreasing. This means that despite the higher + * numeric value, a terminator sorts before a path segment. In order to avoid + * needing the WriteSignedNumDecreasing code just for these values, this enum's + * values are in the reverse order to the server side. + * + * Most server-side values don't apply here. For example, the server embeds + * projects, databases, namespaces and similar values in its entity keys where + * the clients just open a different leveldb. Similarly, many of these values + * don't apply to the server since the server is backed by spanner which + * natively has concepts of tables and indexes. Where there's overlap, a comment + * denotes the server value from the storage_format_internal.proto. + */ +enum ComponentLabel { + /** + * A terminator is the final component of a key. All complete keys have a + * terminator and a key is known to be a key prefix if it doesn't have a + * terminator. + */ + Terminator = 0, // TERMINATOR_COMPONENT = 63, server-side + + /** + * A table name component names the logical table to which the key belongs. + */ + TableName = 5, + + /** A component containing the batch Id of a mutation. */ + BatchId = 10, + + /** A component containing the canonical Id of a query. */ + CanonicalId = 11, + + /** A component containing the target Id of a query. */ + TargetId = 12, + + /** A component containing a user Id. */ + UserId = 13, + + /** + * A component containing a standalone collection ID (e.g. as used by the + * collection_parent table, but not for collection IDs within paths). + */ + 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 component containing a Firestore bundle id. */ + BundleId = 17, + + /** A component containing the name of a named query. */ + QueryName = 18, + + /** + * A path segment describes just a single segment in a resource path. Path + * segments that occur sequentially in a key represent successive segments in + * a single path. + * + * This value must be greater than ComponentLabel::Terminator to ensure that + * longer paths sort after paths that are prefixes of them. + * + * This value must also be larger than other separators so that path suffixes + * sort after other key components. + */ + PathSegment = 62, // PATH = 60, server-side + + /** + * The maximum value that can be encoded by WriteSignedNumIncreasing in a + * single byte. + */ + Unknown = 63, +}; + +/** + * A helper for reading through the string form of a LevelDB key, as written + * by Writer. + */ +class Reader { + public: + explicit Reader(leveldb::Slice src) : src_(src), ok_(true) { + } + + explicit Reader(absl::string_view src) : Reader{MakeSlice(src)} { + } + + /** Returns true if the Reader has encountered no errors. */ + bool ok() const { + return ok_; + } + + /** Returns true if the Reader has no more bytes to read. */ + bool empty() const { + return !ok_ || src_.empty(); + } + + /** + * Parses the components of the key and returns a string description of them. + */ + std::string Describe(); + + void ReadTableNameMatching(const char* expected_table_name) { + if (!ReadLabeledStringMatching(ComponentLabel::TableName, + expected_table_name)) { + Fail(); + } + } + + model::BatchId ReadBatchId() { + return ReadLabeledInt32(ComponentLabel::BatchId); + } + + std::string ReadCanonicalId() { + return ReadLabeledString(ComponentLabel::CanonicalId); + } + + model::TargetId ReadTargetId() { + return ReadLabeledInt32(ComponentLabel::TargetId); + } + + std::string ReadUserId() { + return ReadLabeledString(ComponentLabel::UserId); + } + + std::string ReadCollectionId() { + return ReadLabeledString(ComponentLabel::CollectionId); + } + + std::string ReadDocumentId() { + return ReadLabeledString(ComponentLabel::DocumentId); + } + + std::string ReadBundleId() { + return ReadLabeledString(ComponentLabel::BundleId); + } + + std::string ReadQueryName() { + return ReadLabeledString(ComponentLabel::QueryName); + } + + /** + * 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). + * All matched path segments are assembled into a ResourcePath. + */ + ResourcePath ReadResourcePath(); + + /** + * Reads component labels and strings from the key until it finds a component + * label other than ComponentLabel::PathSegment (or the key is exhausted). + * All matched path segments are assembled into a ResourcePath and wrapped in + * a DocumentKey. + * + * If the read is unsuccessful or the document key is invalid, returns a + * default DocumentKey and fails the Reader. + * + * Otherwise returns the decoded DocumentKey and the Reader advances to the + * next unread byte. + */ + DocumentKey ReadDocumentKey(); + + /** + * Reads a terminator component from the key. + * + * If the read is unsuccessful or the component wasn't a Terminator, fails + * the Reader. + * + * Otherwise the Reader advances to the next unread byte (which for valid + * keys should make the Reader empty). + */ + void ReadTerminator() { + if (!ReadComponentLabelMatching(ComponentLabel::Terminator)) { + Fail(); + } + } + + private: + /** OrderedCode::ReadSignedNumIncreasing adapted to leveldb::Slice. */ + int64_t ReadSignedNumIncreasing() { + if (ok_) { + int64_t result = 0; + absl::string_view tmp = MakeStringView(src_); + if (OrderedCode::ReadSignedNumIncreasing(&tmp, &result)) { + src_ = MakeSlice(tmp); + return result; + } + } + + Fail(); + return 0; + } + + /** OrderedCode::ReadString adapted to leveldb::Slice. */ + std::string ReadString() { + if (ok_) { + std::string result; + absl::string_view tmp = MakeStringView(src_); + if (OrderedCode::ReadString(&tmp, &result)) { + src_ = MakeSlice(tmp); + return result; + } + } + + Fail(); + return ""; + } + + /** + * Reads a component label from the key. + * + * If the read is unsuccessful, returns ComponentLabel::Unknown and fails the + * Reader. + * + * Otherwise, returns the ComponentLabel and advances the Reader to the next + * unread byte. + */ + ComponentLabel ReadComponentLabel() { + if (ok_) { + int64_t raw_result = ReadSignedNumIncreasing(); + if (ok_ && raw_result >= ComponentLabel::Terminator && + raw_result <= ComponentLabel::Unknown) { + return static_cast(raw_result); + } + } + + Fail(); + return ComponentLabel::Unknown; + } + + /** + * Reads a component label from the key. + * + * If the read is unsuccessful, returns false, and fails the Reader. + * + * Otherwise returns whether or not the component label is equal to the + * `expected_label` and advances the Reader to the next unread byte. + */ + ABSL_MUST_USE_RESULT + bool ReadComponentLabelMatching(ComponentLabel expected_label) { + if (ok_) { + int64_t raw_result = ReadSignedNumIncreasing(); + if (ok_) { + // Note: mismatch of a component label is not necessarily a failure. + // It's treated as a potential branch point within the parser. + return raw_result == expected_label; + } + } + + Fail(); + return false; + } + + /** + * Reads a signed number from the key and verifies that the value fits in a + * 32-bit integer. + * + * If the read is unsuccessful or the number was out of range, returns 0 and + * fails the Reader. + * + * Otherwise, returns the number and advances the Reader to the next unread + * byte. + */ + int32_t ReadInt32() { + if (ok_) { + int64_t raw_result = ReadSignedNumIncreasing(); + if (ok_ && raw_result >= INT32_MIN && raw_result <= INT32_MAX) { + return static_cast(raw_result); + } + } + + Fail(); + return 0; + } + + /** + * Reads a component label and signed number from the key and verifies that + * the label matches the expected_label and the value fits in a 32-bit + * integer. + * + * If the read is unsuccessful, the label didn't match, or the number was out + * of range, returns 0 and fails the Reader. + * + * Otherwise, returns the number and advances the Reader to the next unread + * byte. + */ + int32_t ReadLabeledInt32(ComponentLabel expected_label) { + if (!ReadComponentLabelMatching(expected_label)) { + Fail(); + } + 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. + * + * If the read is unsuccessful or the label didn't match, returns an empty + * string and fails the Reader. + * + * Otherwise, returns the string and advances the Reader to the next unread + * byte. + */ + std::string ReadLabeledString(ComponentLabel expected_label) { + if (!ReadComponentLabelMatching(expected_label)) { + Fail(); + } + return ReadString(); + } + + /** + * Reads a component label and a string from the key and verifies that the + * label matches the expected_label and the string matches the + * expected_value. + * + * If the read is unsuccessful or the label wasn't a string, returns false + * and fails the Reader. + * + * Otherwise returns whether or not the string that was read was equal to the + * expected value and advances the reader to the next unread byte. + */ + ABSL_MUST_USE_RESULT + bool ReadLabeledStringMatching(ComponentLabel expected_label, + const char* expected_value) { + std::string value = ReadLabeledString(expected_label); + if (ok_) { + // Value mismatch does not constitute a failure: + return value == expected_value; + } + + Fail(); + return false; + } + + /** + * Fails the Reader. All subsequent read operations will exit early if + * possible. Return values from any method will be defaults, as if those + * methods had failed themselves. + */ + void Fail() { + ok_ = false; + } + + leveldb::Slice src_; + bool ok_; +}; + +ResourcePath Reader::ReadResourcePath() { + std::vector path_segments; + while (!empty()) { + // Advance a temporary slice to avoid advancing contents into the next key + // component which may not be a path segment. + leveldb::Slice saved_position = src_; + if (!ReadComponentLabelMatching(ComponentLabel::PathSegment)) { + src_ = saved_position; + break; + } + + std::string segment = ReadString(); + if (!ok_) break; + + path_segments.push_back(std::move(segment)); + } + + return ResourcePath{std::move(path_segments)}; +} + +DocumentKey Reader::ReadDocumentKey() { + ResourcePath path = ReadResourcePath(); + + // Avoid assertion failures in DocumentKey if path is invalid. + if (ok_ && !path.empty() && DocumentKey::IsDocumentKey(path)) { + return DocumentKey{std::move(path)}; + } + + Fail(); + 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. + */ +std::string InvalidKey(leveldb::Slice key) { + std::string result; + absl::Base64Escape(MakeStringView(key), &result); + return result; +} + +std::string Reader::Describe() { + leveldb::Slice original = src_; + + bool is_terminated = false; + + std::string description; + absl::StrAppend(&description, "["); + + while (!empty()) { + leveldb::Slice saved_source = src_; + + ComponentLabel label = ReadComponentLabel(); + if (!ok_) { + break; + } + if (label == ComponentLabel::Terminator) { + is_terminated = true; + break; + } + + // Reset the reader since all the different read routines expect to see the + // separator first + src_ = saved_source; + + if (label == ComponentLabel::PathSegment) { + ResourcePath resource_path = ReadResourcePath(); + if (ok_) { + absl::StrAppend(&description, + " path=", resource_path.CanonicalString()); + } + + } else if (label == ComponentLabel::TableName) { + std::string table = ReadLabeledString(ComponentLabel::TableName); + if (ok_) { + absl::StrAppend(&description, table, ":"); + } + + } else if (label == ComponentLabel::BatchId) { + model::BatchId batch_id = ReadBatchId(); + if (ok_) { + absl::StrAppend(&description, " batch_id=", batch_id); + } + + } else if (label == ComponentLabel::CanonicalId) { + std::string canonical_id = ReadCanonicalId(); + if (ok_) { + absl::StrAppend(&description, " canonical_id=", canonical_id); + } + + } else if (label == ComponentLabel::TargetId) { + model::TargetId target_id = ReadTargetId(); + if (ok_) { + absl::StrAppend(&description, " target_id=", target_id); + } + + } else if (label == ComponentLabel::UserId) { + std::string user_id = ReadUserId(); + if (ok_) { + absl::StrAppend(&description, " user_id=", user_id); + } + + } else if (label == ComponentLabel::CollectionId) { + std::string collection_id = ReadCollectionId(); + if (ok_) { + 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 if (label == ComponentLabel::BundleId) { + std::string bundle_id = ReadBundleId(); + if (ok_) { + absl::StrAppend(&description, " bundle_id=", bundle_id); + } + } else if (label == ComponentLabel::QueryName) { + std::string query_name = ReadQueryName(); + if (ok_) { + absl::StrAppend(&description, " query_name=", query_name); + } + } else { + absl::StrAppend(&description, " unknown label=", static_cast(label)); + Fail(); + } + } + + if (!ok_ || !empty()) { + absl::StrAppend(&description, " invalid key=<", InvalidKey(original), ">"); + + } else if (!is_terminated) { + absl::StrAppend(&description, " incomplete key"); + } + + absl::StrAppend(&description, "]"); + return description; +} + +class Writer { + public: + std::string result() const { + return dest_; + } + + void WriteTerminator() { + OrderedCode::WriteSignedNumIncreasing(&dest_, ComponentLabel::Terminator); + } + + void WriteTableName(const char* table_name) { + WriteLabeledString(ComponentLabel::TableName, table_name); + } + + void WriteBatchId(model::BatchId batch_id) { + WriteLabeledInt32(ComponentLabel::BatchId, batch_id); + } + + void WriteCanonicalId(absl::string_view canonical_id) { + WriteLabeledString(ComponentLabel::CanonicalId, canonical_id); + } + + void WriteTargetId(model::TargetId target_id) { + WriteLabeledInt32(ComponentLabel::TargetId, target_id); + } + + void WriteUserId(absl::string_view user_id) { + WriteLabeledString(ComponentLabel::UserId, user_id); + } + + void WriteCollectionId(absl::string_view collection_id) { + 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()); + } + + void WriteBundleId(absl::string_view bundle_id) { + WriteLabeledString(ComponentLabel::BundleId, bundle_id); + } + + void WriteQueryName(absl::string_view query_name) { + WriteLabeledString(ComponentLabel::QueryName, query_name); + } + + /** + * For each segment in the given resource path writes a + * ComponentLabel::PathSegment component label and a string containing the + * path segment. + */ + void WriteResourcePath(const ResourcePath& path) { + for (const auto& segment : path) { + WriteComponentLabel(ComponentLabel::PathSegment); + OrderedCode::WriteString(&dest_, segment); + } + } + + private: + /** Writes a component label to the given key destination. */ + void WriteComponentLabel(ComponentLabel label) { + OrderedCode::WriteSignedNumIncreasing(&dest_, label); + } + + /** + * Writes a component label and a signed integer to the given key destination. + */ + void WriteLabeledInt32(ComponentLabel label, int32_t value) { + WriteComponentLabel(label); + OrderedCode::WriteSignedNumIncreasing(&dest_, value); + } + + /** + * Writes a component label and an encoded string to the given key + * destination. + */ + void WriteLabeledString(ComponentLabel label, absl::string_view value) { + WriteComponentLabel(label); + OrderedCode::WriteString(&dest_, value); + } + + std::string dest_; +}; + +} // namespace + +std::string DescribeKey(leveldb::Slice key) { + Reader reader{key}; + return reader.Describe(); +} + +std::string DescribeKey(absl::string_view key) { + return DescribeKey(MakeSlice(key)); +} + +std::string DescribeKey(const std::string& key) { + return DescribeKey(leveldb::Slice{key}); +} + +std::string DescribeKey(const char* key) { + return DescribeKey(leveldb::Slice{key}); +} + +std::string LevelDbVersionKey::Key() { + Writer writer; + writer.WriteTableName(kVersionGlobalTable); + writer.WriteTerminator(); + return writer.result(); +} + +std::string LevelDbMutationKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kMutationsTable); + return writer.result(); +} + +std::string LevelDbMutationKey::KeyPrefix(absl::string_view user_id) { + Writer writer; + writer.WriteTableName(kMutationsTable); + writer.WriteUserId(user_id); + return writer.result(); +} + +std::string LevelDbMutationKey::Key(absl::string_view user_id, + model::BatchId batch_id) { + Writer writer; + writer.WriteTableName(kMutationsTable); + writer.WriteUserId(user_id); + writer.WriteBatchId(batch_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbMutationKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kMutationsTable); + user_id_ = reader.ReadUserId(); + batch_id_ = reader.ReadBatchId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbDocumentMutationKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kDocumentMutationsTable); + return writer.result(); +} + +std::string LevelDbDocumentMutationKey::KeyPrefix(absl::string_view user_id) { + Writer writer; + writer.WriteTableName(kDocumentMutationsTable); + writer.WriteUserId(user_id); + return writer.result(); +} + +std::string LevelDbDocumentMutationKey::KeyPrefix( + absl::string_view user_id, const ResourcePath& resource_path) { + Writer writer; + writer.WriteTableName(kDocumentMutationsTable); + writer.WriteUserId(user_id); + writer.WriteResourcePath(resource_path); + return writer.result(); +} + +std::string LevelDbDocumentMutationKey::Key(absl::string_view user_id, + const DocumentKey& document_key, + model::BatchId batch_id) { + Writer writer; + writer.WriteTableName(kDocumentMutationsTable); + writer.WriteUserId(user_id); + writer.WriteResourcePath(document_key.path()); + writer.WriteBatchId(batch_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbDocumentMutationKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kDocumentMutationsTable); + user_id_ = reader.ReadUserId(); + document_key_ = reader.ReadDocumentKey(); + batch_id_ = reader.ReadBatchId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbMutationQueueKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kMutationQueuesTable); + return writer.result(); +} + +std::string LevelDbMutationQueueKey::Key(absl::string_view user_id) { + Writer writer; + writer.WriteTableName(kMutationQueuesTable); + writer.WriteUserId(user_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbMutationQueueKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kMutationQueuesTable); + user_id_ = reader.ReadUserId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbTargetGlobalKey::Key() { + Writer writer; + writer.WriteTableName(kTargetGlobalTable); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbTargetGlobalKey::Decode(leveldb::Slice key) { + Reader reader{key}; + reader.ReadTableNameMatching(kTargetGlobalTable); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbTargetKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kTargetsTable); + return writer.result(); +} + +std::string LevelDbTargetKey::Key(model::TargetId target_id) { + Writer writer; + writer.WriteTableName(kTargetsTable); + writer.WriteTargetId(target_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbTargetKey::Decode(leveldb::Slice key) { + Reader reader{key}; + reader.ReadTableNameMatching(kTargetsTable); + target_id_ = reader.ReadTargetId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbQueryTargetKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kQueryTargetsTable); + return writer.result(); +} + +std::string LevelDbQueryTargetKey::KeyPrefix(absl::string_view canonical_id) { + Writer writer; + writer.WriteTableName(kQueryTargetsTable); + writer.WriteCanonicalId(canonical_id); + return writer.result(); +} + +std::string LevelDbQueryTargetKey::Key(absl::string_view canonical_id, + model::TargetId target_id) { + Writer writer; + writer.WriteTableName(kQueryTargetsTable); + writer.WriteCanonicalId(canonical_id); + writer.WriteTargetId(target_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbQueryTargetKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kQueryTargetsTable); + canonical_id_ = reader.ReadCanonicalId(); + target_id_ = reader.ReadTargetId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbTargetDocumentKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kTargetDocumentsTable); + return writer.result(); +} + +std::string LevelDbTargetDocumentKey::KeyPrefix(model::TargetId target_id) { + Writer writer; + writer.WriteTableName(kTargetDocumentsTable); + writer.WriteTargetId(target_id); + return writer.result(); +} + +std::string LevelDbTargetDocumentKey::Key(model::TargetId target_id, + const DocumentKey& document_key) { + Writer writer; + writer.WriteTableName(kTargetDocumentsTable); + writer.WriteTargetId(target_id); + writer.WriteResourcePath(document_key.path()); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbTargetDocumentKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kTargetDocumentsTable); + target_id_ = reader.ReadTargetId(); + document_key_ = reader.ReadDocumentKey(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbDocumentTargetKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kDocumentTargetsTable); + return writer.result(); +} + +std::string LevelDbDocumentTargetKey::KeyPrefix( + const ResourcePath& resource_path) { + Writer writer; + writer.WriteTableName(kDocumentTargetsTable); + writer.WriteResourcePath(resource_path); + return writer.result(); +} + +std::string LevelDbDocumentTargetKey::Key(const DocumentKey& document_key, + model::TargetId target_id) { + Writer writer; + writer.WriteTableName(kDocumentTargetsTable); + writer.WriteResourcePath(document_key.path()); + writer.WriteTargetId(target_id); + writer.WriteTerminator(); + return writer.result(); +} + +std::string LevelDbDocumentTargetKey::SentinelKey( + const DocumentKey& document_key) { + return Key(document_key, kInvalidTargetId); +} + +std::string LevelDbDocumentTargetKey::EncodeSentinelValue( + model::ListenSequenceNumber sequence_number) { + std::string encoded; + OrderedCode::WriteSignedNumIncreasing(&encoded, sequence_number); + return encoded; +} + +model::ListenSequenceNumber LevelDbDocumentTargetKey::DecodeSentinelValue( + absl::string_view slice) { + model::ListenSequenceNumber decoded; + if (!OrderedCode::ReadSignedNumIncreasing(&slice, &decoded)) { + HARD_FAIL("Failed to read sequence number from a sentinel row"); + } + return decoded; +} + +bool LevelDbDocumentTargetKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kDocumentTargetsTable); + document_key_ = reader.ReadDocumentKey(); + target_id_ = reader.ReadTargetId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbRemoteDocumentKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kRemoteDocumentsTable); + return writer.result(); +} + +std::string LevelDbRemoteDocumentKey::KeyPrefix( + const ResourcePath& resource_path) { + Writer writer; + writer.WriteTableName(kRemoteDocumentsTable); + writer.WriteResourcePath(resource_path); + return writer.result(); +} + +std::string LevelDbRemoteDocumentKey::Key(const DocumentKey& key) { + Writer writer; + writer.WriteTableName(kRemoteDocumentsTable); + writer.WriteResourcePath(key.path()); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbRemoteDocumentKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kRemoteDocumentsTable); + document_key_ = reader.ReadDocumentKey(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbCollectionParentKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kCollectionParentsTable); + return writer.result(); +} + +std::string LevelDbCollectionParentKey::KeyPrefix( + absl::string_view collection_id) { + Writer writer; + writer.WriteTableName(kCollectionParentsTable); + writer.WriteCollectionId(collection_id); + return writer.result(); +} + +std::string LevelDbCollectionParentKey::Key(absl::string_view collection_id, + const ResourcePath& parent) { + Writer writer; + writer.WriteTableName(kCollectionParentsTable); + writer.WriteCollectionId(collection_id); + writer.WriteResourcePath(parent); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbCollectionParentKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kCollectionParentsTable); + collection_id_ = reader.ReadCollectionId(); + parent_ = reader.ReadResourcePath(); + reader.ReadTerminator(); + 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(); +} + +std::string LevelDbBundleKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kBundlesTable); + return writer.result(); +} + +std::string LevelDbBundleKey::Key(absl::string_view bundle_id) { + Writer writer; + writer.WriteTableName(kBundlesTable); + writer.WriteBundleId(bundle_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbBundleKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kBundlesTable); + bundle_id_ = reader.ReadBundleId(); + reader.ReadTerminator(); + return reader.ok(); +} + +std::string LevelDbNamedQueryKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kNamedQueriesTable); + return writer.result(); +} + +std::string LevelDbNamedQueryKey::Key(absl::string_view query_name) { + Writer writer; + writer.WriteTableName(kNamedQueriesTable); + writer.WriteQueryName(query_name); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbNamedQueryKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kNamedQueriesTable); + name_ = reader.ReadQueryName(); + reader.ReadTerminator(); + return reader.ok(); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h new file mode 100644 index 0000000..ffe9274 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h @@ -0,0 +1,720 @@ +/* + * 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_KEY_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_KEY_H_ + +#include + +#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" + +namespace firebase { +namespace firestore { +namespace local { + +// Utilities for encoding and decoding LevelDB row keys and key prefixes. +// +// LevelDB keys are strings, so all the routines in here operate on strings to +// be able to produce and consume leveldb APIs directly. +// +// All leveldb logical tables should have their keys structures described in +// this file. +// +// mutations: +// - table_name: string = "mutation" +// - user_id: string +// - batch_id: model::BatchId +// +// document_mutations: +// - table_name: string = "document_mutation" +// - user_id: string +// - path: ResourcePath +// - batch_id: model::BatchId +// +// mutation_queues: +// - table_name: string = "mutation_queue" +// - user_id: string +// +// targets: +// - table_name: string = "target" +// - target_id: model::TargetId +// +// target_globals: +// - table_name: string = "target_global" +// +// query_targets: +// - table_name: string = "query_target" +// - canonical_id: string +// - target_id: model::TargetId +// +// target_documents: +// - table_name: string = "target_document" +// - target_id: model::TargetId +// - path: ResourcePath +// +// document_targets: +// - table_name: string = "document_target" +// - path: ResourcePath +// - target_id: model::TargetId +// +// remote_documents: +// - table_name: string = "remote_document" +// - path: ResourcePath +// +// collection_parents: +// - 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 +// +// bundles: +// - table_name: string = "bundles" +// - bundle_id: string +// +// named_queries: +// - table_name: string = "named_queries" +// - name: string + +/** + * Parses the given key and returns a human readable description of its + * contents, suitable for error messages and logging. + */ +std::string DescribeKey(leveldb::Slice key); +std::string DescribeKey(absl::string_view key); +std::string DescribeKey(const std::string& key); +std::string DescribeKey(const char* key); + +/** A key to a singleton row storing the version of the schema. */ +class LevelDbVersionKey { + public: + /** + * Returns the key pointing to the singleton row storing the schema version. + */ + static std::string Key(); +}; + +/** A key in the mutations table. */ +class LevelDbMutationKey { + public: + /** + * Creates a key prefix that points just before the first key in the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key prefix that points just before the first key for the given + * user_id. + */ + static std::string KeyPrefix(absl::string_view user_id); + + /** Creates a complete key that points to a specific user_id and batch_id. */ + static std::string Key(absl::string_view user_id, model::BatchId batch_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 user that owns the mutation batches. */ + const std::string& user_id() const { + return user_id_; + } + + /** The batch_id of the batch. */ + model::BatchId batch_id() const { + return batch_id_; + } + + private: + std::string user_id_; + model::BatchId batch_id_ = model::kBatchIdUnknown; +}; + +/** + * A key in the document mutations index, which stores the batches in which + * documents are mutated. + */ +class LevelDbDocumentMutationKey { + public: + /** + * Creates a key prefix that points just before the first key in the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key prefix that points just before the first key for the given + * user_id. + */ + static std::string KeyPrefix(absl::string_view user_id); + + /** + * Creates a key prefix that points just before the first key for the user_id + * and resource path. + * + * Note that this uses a ResourcePath rather than an DocumentKey in order to + * allow prefix scans over a collection. However a naive scan over those + * results isn't useful since it would match both immediate children of the + * collection and any subcollections. + */ + static std::string KeyPrefix(absl::string_view user_id, + const model::ResourcePath& resource_path); + + /** + * Creates a complete key that points to a specific user_id, document key, + * and batch_id. + */ + static std::string Key(absl::string_view user_id, + const model::DocumentKey& document_key, + model::BatchId batch_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 user that owns the mutation batches. */ + const std::string& user_id() const { + return user_id_; + } + + /** The path to the document, as encoded in the key. */ + const model::DocumentKey& document_key() const { + return document_key_; + } + + /** The batch_id in which the document participates. */ + model::BatchId batch_id() const { + return batch_id_; + } + + private: + std::string user_id_; + model::DocumentKey document_key_; + model::BatchId batch_id_ = model::kBatchIdUnknown; +}; + +/** + * A key in the mutation_queues table. + * + * Note that where `mutation_queues` table contains one row about each queue, + * the `mutations` table contains the actual mutation batches themselves. + */ +class LevelDbMutationQueueKey { + public: + /** + * Creates a key prefix that points just before the first key in the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a complete key that points to a specific mutation queue entry for + * the given user_id. + */ + static std::string Key(absl::string_view user_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); + + const std::string& user_id() const { + return user_id_; + } + + private: + // Deliberately uninitialized: will be assigned in Decode + std::string user_id_; +}; + +/** + * A key in the target globals table, a record of global values across all + * targets. + */ +class LevelDbTargetGlobalKey { + public: + /** Creates a key that points to the single target global row. */ + static std::string Key(); + + /** + * Decodes the contents of a target global key, essentially just verifying + * that the key has the correct table name. + */ + ABSL_MUST_USE_RESULT + bool Decode(leveldb::Slice key); +}; + +/** A key in the targets table. */ +class LevelDbTargetKey { + public: + /** + * Creates a key prefix that points just before the first key in the table. + */ + static std::string KeyPrefix(); + + /** Creates a complete key that points to a specific target, by target_id. */ + static std::string Key(model::TargetId target_id); + + /** + * Decodes the contents of a target 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(leveldb::Slice key); + + model::TargetId target_id() { + return target_id_; + } + + private: + model::TargetId target_id_ = 0; +}; + +/** + * A key in the query targets table, an index of canonical_ids to the targets + * they may match. This is not a unique mapping because canonical_id does not + * promise a unique name for all possible queries. + */ +class LevelDbQueryTargetKey { + public: + /** + * Creates a key that contains just the query targets table prefix and points + * just before the first key. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the first query-target association for a + * canonical_id. + */ + static std::string KeyPrefix(absl::string_view canonical_id); + + /** Creates a key that points to a specific query-target entry. */ + static std::string Key(absl::string_view canonical_id, + model::TargetId target_id); + + /** + * Decodes the contents of a query target 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 canonical_id derived from the query. */ + const std::string& canonical_id() const { + return canonical_id_; + } + + /** The target_id identifying a target. */ + model::TargetId target_id() const { + return target_id_; + } + + private: + // Deliberately uninitialized: will be assigned in Decode + std::string canonical_id_; + model::TargetId target_id_ = 0; +}; + +/** + * A key in the target documents table, an index of target_ids to the documents + * they contain. + */ +class LevelDbTargetDocumentKey { + public: + /** + * Creates a key that contains just the target documents table prefix and + * points just before the first key. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the first target-document association for a + * target_id. + */ + static std::string KeyPrefix(model::TargetId target_id); + + /** Creates a key that points to a specific target-document entry. */ + static std::string Key(model::TargetId target_id, + const model::DocumentKey& document_key); + + /** + * Decodes the contents of a target document 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 target_id identifying a target. */ + model::TargetId target_id() { + return target_id_; + } + + /** The path to the document, as encoded in the key. */ + const model::DocumentKey& document_key() { + return document_key_; + } + + private: + // Deliberately uninitialized: will be assigned in Decode + model::TargetId target_id_ = 0; + model::DocumentKey document_key_; +}; + +/** + * A key in the document targets table, an index from documents to the targets + * that contain them. + */ +class LevelDbDocumentTargetKey { + public: + /** + * Creates a key that contains just the document targets table prefix and + * points just before the first key. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the first document-target association for + * document. + */ + static std::string KeyPrefix(const model::ResourcePath& resource_path); + + /** Creates a key that points to a specific document-target entry. */ + static std::string Key(const model::DocumentKey& document_key, + model::TargetId target_id); + + /** + * Creates a key that points to the sentinel row for the given document: a + * document-target entry with a special, invalid target_id. + */ + static std::string SentinelKey(const model::DocumentKey& document_key); + + /** + * Given a sequence number, encodes it for storage in a sentinel row. + */ + static std::string EncodeSentinelValue( + model::ListenSequenceNumber sequence_number); + + /** + * Given an encoded sentinel row, return the sequence number. + */ + static model::ListenSequenceNumber DecodeSentinelValue( + absl::string_view slice); + + /** + * Decodes the contents of a document target 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 target_id identifying a target. */ + model::TargetId target_id() const { + return target_id_; + } + + /** + * Returns true if the target_id in this row is a sentintel target ID. + */ + bool IsSentinel() { + return target_id_ == kInvalidTargetId; + } + + /** The path to the document, as encoded in the key. */ + const model::DocumentKey& document_key() const { + return document_key_; + } + + private: + // Used for sentinel row for a document in the document target index. No + // target has the ID 0, and it will sort first in the list of targets for a + // document. + static constexpr model::TargetId kInvalidTargetId = 0; + + // Deliberately uninitialized: will be assigned in Decode + model::TargetId target_id_; + model::DocumentKey document_key_; +}; + +/** A key in the remote documents table. */ +class LevelDbRemoteDocumentKey { + public: + /** + * Creates a key that contains just the remote documents table prefix and + * points just before the first remote document key. + */ + static std::string KeyPrefix(); + + /** + * Creates a complete key that points to a specific document. The document_key + * must have an even number of path segments. + */ + static std::string Key(const model::DocumentKey& document_key); + + /** + * Creates a key prefix that contains a part of a document path. Odd numbers + * of segments create a collection key prefix, while an even number of + * segments create a document key prefix. Note that a document key prefix will + * match the document itself and any documents that exist in its + * subcollections. + */ + static std::string KeyPrefix(const model::ResourcePath& resource_path); + + /** + * Decodes the contents of a remote document key, storing the decoded values + * in this instance. This can only decode complete document paths (i.e. the + * result of Key()). + * + * @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 path to the document, as encoded in the key. */ + const model::DocumentKey& document_key() const { + return document_key_; + } + + private: + // Deliberately uninitialized: will be assigned in Decode + model::DocumentKey document_key_; +}; + +/** + * A key in the collection parents index, which stores an association between a + * Collection ID (e.g. 'messages') to a parent path (e.g. '/chats/123') that + * contains it as a (sub)collection. This is used to efficiently find all + * collections to query when performing a Collection Group query. Note that the + * parent path will be an empty path in the case of root-level collections. + */ +class LevelDbCollectionParentKey { + public: + /** + * Creates a key prefix that points just before the first key in the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key prefix that points just before the first key for the given + * collection_id. + */ + static std::string KeyPrefix(absl::string_view collection_id); + + /** + * Creates a complete key that points to a specific collection_id and parent. + */ + static std::string Key(absl::string_view collection_id, + const model::ResourcePath& parent); + + /** + * 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_id, as encoded in the key. */ + const std::string& collection_id() const { + return collection_id_; + } + + /** The parent path, as encoded in the key. */ + const model::ResourcePath& parent() const { + return parent_; + } + + private: + // Deliberately uninitialized: will be assigned in Decode + std::string collection_id_; + 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_; +}; + +/** + * A key in the bundles table, storing the bundle Id for each entry. + */ +class LevelDbBundleKey { + public: + /** + * Creates a key prefix that points just before the first key of the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the key for the given bundle id. + */ + static std::string Key(absl::string_view bundle_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 bundle ID for this entry. */ + const std::string& bundle_id() const { + return bundle_id_; + } + + private: + std::string bundle_id_; +}; + +/** + * A key in the named_queries table, storing the query name for each entry. + */ +class LevelDbNamedQueryKey { + public: + /** + * Creates a key prefix that points just before the first key of the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the key for the given query name. + */ + static std::string Key(absl::string_view query_name); + + /** + * 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 query name for this entry. */ + const std::string& name() const { + return name_; + } + + private: + std::string name_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_KEY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc new file mode 100644 index 0000000..81c36e4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc @@ -0,0 +1,194 @@ +/* + * 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(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::EnumerateTargetSequenceNumbers( + const SequenceNumberCallback& callback) { + db_->target_cache()->EnumerateSequenceNumbers(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 static_cast( + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h new file mode 100644 index 0000000..df6d4de --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h @@ -0,0 +1,102 @@ +/* + * 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_LRU_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ + +#include + +#include "Firestore/core/src/local/lru_garbage_collector.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbPersistence; +class ListenSequence; + +class LevelDbLruReferenceDelegate : public LruDelegate { + public: + LevelDbLruReferenceDelegate(LevelDbPersistence* persistence, + LruParams lru_params); + + ~LevelDbLruReferenceDelegate(); + + void Start(); + + // MARK: ReferenceDelegate methods + + model::ListenSequenceNumber current_sequence_number() const override; + + void AddInMemoryPins(ReferenceSet* set) override; + + 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::TargetData& target_data) override; + + void UpdateLimboDocument(const model::DocumentKey& key) override; + + void OnTransactionStarted(absl::string_view label) override; + void OnTransactionCommitted() override; + + // MARK: LruDelegate methods + + LruGarbageCollector* garbage_collector() override; + + util::StatusOr CalculateByteSize() override; + size_t GetSequenceNumberCount() override; + + void EnumerateTargetSequenceNumbers( + const SequenceNumberCallback& callback) override; + void EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) override; + + int RemoveOrphanedDocuments(model::ListenSequenceNumber upper_bound) override; + int RemoveTargets(model::ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries) override; + + private: + bool IsPinned(const model::DocumentKey& key); + + bool MutationQueuesContainKey(const model::DocumentKey& key); + + void RemoveSentinel(const model::DocumentKey& key); + void WriteSentinel(const model::DocumentKey& key); + + std::unique_ptr gc_; + + // Persistence instances are owned by FirestoreClient + LevelDbPersistence* db_; + + // Additional references are owned by LocalStore + ReferenceSet* additional_references_; + + // This needs to be a pointer because initialization is delayed until after + // we read from the target cache. + std::unique_ptr listen_sequence_; + + // The current sequence number for the currently active transaction. If no + // transaction is active, resets back to kListenSequenceNumberInvalid. + model::ListenSequenceNumber current_sequence_number_ = + kListenSequenceNumberInvalid; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc new file mode 100644 index 0000000..69c28b1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc @@ -0,0 +1,445 @@ +/* + * 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_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/local/leveldb_key.h" +#include "Firestore/core/src/local/memory_index_manager.h" +#include "Firestore/core/src/local/target_data.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 "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using leveldb::Status; +using model::DocumentKey; +using model::ResourcePath; +using nanopb::Message; +using nanopb::StringReader; + +/** + * Schema version for the iOS client. + * + * Note that tables aren't a concept in LevelDB. They exist in our schema as + * just prefixes on keys. This means tables don't need to be created but they + * also can't easily be dropped and re-created. + * + * Migrations: + * * Migration 1 used to ensure the target_global row existed, without + * clearing it. No longer required because migration 3 unconditionally + * clears it. + * * Migration 2 used to ensure that the target_global row had a correct count + * of targets. No longer required because migration 3 deletes them all. + * * Migration 3 deletes the entire query cache to deal with cache corruption + * related to limbo resolution. Addresses + * https://github.com/firebase/firebase-ios-sdk/issues/1548. + * * Migration 4 ensures that every document in the remote document cache + * has a sentinel row with a sequence number. + * * Migration 5 drops held write acks. + * * Migration 6 populates the collection_parents index. + * * Migration 7 rewrites query_targets canonical ids in new format. + */ +const LevelDbMigrations::SchemaVersion kSchemaVersion = 7; + +/** + * Save the given version number as the current version of the schema of the + * database. + * @param version The version to save + * @param transaction The transaction in which to save the new version number + */ +void SaveVersion(LevelDbMigrations::SchemaVersion version, + LevelDbTransaction* transaction) { + std::string key = LevelDbVersionKey::Key(); + std::string version_string = std::to_string(version); + transaction->Put(key, version_string); +} + +void DeleteEverythingWithPrefix(const std::string& prefix, leveldb::DB* db) { + bool more_deletes = true; + while (more_deletes) { + LevelDbTransaction transaction(db, "Delete everything with prefix"); + auto it = transaction.NewIterator(); + + more_deletes = false; + for (it->Seek(prefix); it->Valid() && absl::StartsWith(it->key(), prefix); + it->Next()) { + if (transaction.changed_keys() >= 1000) { + more_deletes = true; + break; + } + transaction.Delete(it->key()); + } + + transaction.Commit(); + } +} + +/** Migration 3. */ +void ClearQueryCache(leveldb::DB* db) { + DeleteEverythingWithPrefix(LevelDbTargetKey::KeyPrefix(), db); + DeleteEverythingWithPrefix(LevelDbDocumentTargetKey::KeyPrefix(), db); + DeleteEverythingWithPrefix(LevelDbTargetDocumentKey::KeyPrefix(), db); + DeleteEverythingWithPrefix(LevelDbQueryTargetKey::KeyPrefix(), db); + + LevelDbTransaction transaction(db, "Drop query cache"); + + // Reset the target global entry too (to reset the target count). + firestore_client_TargetGlobal target_global{}; + + nanopb::StringWriter writer; + writer.Write(firestore_client_TargetGlobal_fields, &target_global); + transaction.Put(LevelDbTargetGlobalKey::Key(), writer.Release()); + + SaveVersion(3, &transaction); + transaction.Commit(); +} + +/** + * Removes document associations for the given user's mutation queue for + * any mutation with a `batch_id` less than or equal to + * `last_acknowledged_batch_id`. + */ +void RemoveMutationDocuments(LevelDbTransaction* transaction, + absl::string_view user_id, + int32_t last_acknowledged_batch_id) { + LevelDbDocumentMutationKey doc_key; + std::string prefix = LevelDbDocumentMutationKey::KeyPrefix(user_id); + + auto it = transaction->NewIterator(); + it->Seek(prefix); + for (; it->Valid() && absl::StartsWith(it->key(), prefix); it->Next()) { + HARD_ASSERT(doc_key.Decode(it->key()), + "Failed to decode document mutation key"); + if (doc_key.batch_id() <= last_acknowledged_batch_id) { + transaction->Delete(it->key()); + } + } +} + +/** + * Removes mutation batches for the given user with a `batch_id` less than + * or equal to `last_acknowledged_batch_id` + */ +void RemoveMutationBatches(LevelDbTransaction* transaction, + absl::string_view user_id, + int32_t last_acknowledged_batch_id) { + std::string mutations_key = LevelDbMutationKey::KeyPrefix(user_id); + std::string last_key = + LevelDbMutationKey::Key(user_id, last_acknowledged_batch_id); + auto it = transaction->NewIterator(); + it->Seek(mutations_key); + for (; it->Valid() && it->key() <= last_key; it->Next()) { + transaction->Delete(it->key()); + } +} + +/** Migration 5. */ +void RemoveAcknowledgedMutations(leveldb::DB* db) { + LevelDbTransaction transaction(db, "remove acknowledged mutations"); + std::string mutation_queue_start = LevelDbMutationQueueKey::KeyPrefix(); + + LevelDbMutationQueueKey key; + + auto it = transaction.NewIterator(); + it->Seek(mutation_queue_start); + for (; it->Valid() && absl::StartsWith(it->key(), mutation_queue_start); + it->Next()) { + HARD_ASSERT(key.Decode(it->key()), "Failed to decode mutation queue key"); + 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); + RemoveMutationDocuments(&transaction, key.user_id(), + mutation_queue->last_acknowledged_batch_id); + } + + SaveVersion(5, &transaction); + transaction.Commit(); +} + +/** + * Reads the highest sequence number from the target global row. + */ +model::ListenSequenceNumber GetHighestSequenceNumber( + LevelDbTransaction* transaction) { + std::string bytes; + transaction->Get(LevelDbTargetGlobalKey::Key(), &bytes); + + StringReader reader(bytes); + auto target_global = + Message::TryParse(&reader); + return target_global->highest_listen_sequence_number; +} + +/** + * Given a document key, ensure it has a sentinel row. If it doesn't have one, + * add it with the given value. + */ +void EnsureSentinelRow(LevelDbTransaction* transaction, + const model::DocumentKey& key, + const std::string& sentinel_value) { + std::string sentinel_key = LevelDbDocumentTargetKey::SentinelKey(key); + std::string unused_value; + if (transaction->Get(sentinel_key, &unused_value).IsNotFound()) { + transaction->Put(sentinel_key, sentinel_value); + } +} + +/** + * Migration 4. + * + * Ensure each document in the remote document table has a corresponding + * sentinel row in the document target index. + */ +void EnsureSentinelRows(leveldb::DB* db) { + LevelDbTransaction transaction(db, "Ensure sentinel rows"); + + // Get the value we'll use for anything that's missing a row. + model::ListenSequenceNumber sequence_number = + GetHighestSequenceNumber(&transaction); + std::string sentinel_value = + LevelDbDocumentTargetKey::EncodeSentinelValue(sequence_number); + + std::string documents_prefix = LevelDbRemoteDocumentKey::KeyPrefix(); + auto it = transaction.NewIterator(); + it->Seek(documents_prefix); + LevelDbRemoteDocumentKey document_key; + for (; it->Valid() && absl::StartsWith(it->key(), documents_prefix); + it->Next()) { + HARD_ASSERT(document_key.Decode(it->key()), + "Failed to decode document key"); + EnsureSentinelRow(&transaction, document_key.document_key(), + sentinel_value); + } + SaveVersion(4, &transaction); + transaction.Commit(); +} + +// Helper to add an index entry iff we haven't already written it (as determined +// by the provided cache). +void EnsureCollectionParentRow(LevelDbTransaction* transaction, + MemoryCollectionParentIndex* cache, + const DocumentKey& key) { + const ResourcePath& collection_path = key.path().PopLast(); + if (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; + transaction->Put(key, empty_buffer); + } +} + +/** + * Migration 6. + * + * Creates appropriate LevelDbCollectionParentKey rows for all collections + * of documents in the remote document cache and mutation queue. + */ +void EnsureCollectionParentsIndex(leveldb::DB* db) { + LevelDbTransaction transaction(db, "Ensure Collection Parents Index"); + + MemoryCollectionParentIndex cache; + + // Index existing remote documents. + std::string documents_prefix = LevelDbRemoteDocumentKey::KeyPrefix(); + auto it = transaction.NewIterator(); + it->Seek(documents_prefix); + LevelDbRemoteDocumentKey document_key; + for (; it->Valid() && absl::StartsWith(it->key(), documents_prefix); + it->Next()) { + HARD_ASSERT(document_key.Decode(it->key()), + "Failed to decode document key"); + + EnsureCollectionParentRow(&transaction, &cache, + document_key.document_key()); + } + + // Index existing mutations. + std::string mutations_prefix = LevelDbDocumentMutationKey::KeyPrefix(); + it = transaction.NewIterator(); + it->Seek(mutations_prefix); + LevelDbDocumentMutationKey key; + for (; it->Valid() && absl::StartsWith(it->key(), mutations_prefix); + it->Next()) { + HARD_ASSERT(key.Decode(it->key()), + "Failed to decode document-mutation key"); + + EnsureCollectionParentRow(&transaction, &cache, key.document_key()); + } + + SaveVersion(6, &transaction); + transaction.Commit(); +} + +/** + * Returns a `TargetData` by reading the `targets` table, using the given key + * for `query_targets` as a foreign key. + */ +util::StatusOr ReadTargetData( + const LevelDbQueryTargetKey& query_target_key, + const LocalSerializer& serializer, + LevelDbTransaction& transaction) { + auto target_it = transaction.NewIterator(); + const auto& target_key = LevelDbTargetKey::Key(query_target_key.target_id()); + target_it->Seek(target_key); + if (!target_it->Valid()) { + return util::Status( + kErrorNotFound, + util::StringFormat( + "Dangling query-target reference found: seeking %s found %s", + DescribeKey(target_key), DescribeKey(target_it))); + } + + StringReader reader{target_it->value()}; + auto message = Message::TryParse(&reader); + if (!reader.ok()) { + return util::Status(kErrorDataLoss, + util::StringFormat("Target proto failed to parse: %s", + reader.status().ToString())); + } + auto target_data = serializer.DecodeTargetData(&reader, *message); + if (!reader.ok()) { + return util::Status( + kErrorDataLoss, + util::StringFormat("Target failed to parse: %s, message: %s", + reader.status().ToString(), message.ToString())); + } + + return target_data; +} + +/** + * Migration 7. + * + * Rewrites targets canonical IDs with new format. + */ +void RewriteTargetsCanonicalIds(leveldb::DB* db, + const LocalSerializer& serializer) { + LevelDbTransaction transaction(db, "Rewrite Targets Canonical Ids"); + + std::string query_targets_prefix = LevelDbQueryTargetKey::KeyPrefix(); + auto it = transaction.NewIterator(); + it->Seek(query_targets_prefix); + LevelDbQueryTargetKey query_target_key; + for (; it->Valid() && absl::StartsWith(it->key(), query_targets_prefix); + it->Next()) { + HARD_ASSERT(query_target_key.Decode(it->key()), + "Failed to decode query_targets key"); + + util::StatusOr target_data = + ReadTargetData(query_target_key, serializer, transaction); + if (!target_data.ok()) { + LOG_WARN("Reading target data failed: %s", + target_data.status().error_message()); + continue; + } + + auto new_key = LevelDbQueryTargetKey::Key( + target_data.ValueOrDie().target().CanonicalId(), + target_data.ValueOrDie().target_id()); + + transaction.Delete(it->key()); + std::string empty_buffer; + transaction.Put(new_key, empty_buffer); + } + + SaveVersion(7, &transaction); + transaction.Commit(); +} + +} // namespace + +LevelDbMigrations::SchemaVersion LevelDbMigrations::ReadSchemaVersion( + leveldb::DB* db) { + LevelDbTransaction transaction(db, "Read schema version"); + std::string key = LevelDbVersionKey::Key(); + std::string version_string; + Status status = transaction.Get(key, &version_string); + if (status.IsNotFound()) { + return 0; + } else { + HARD_ASSERT(status.ok(), + "Failed to read version string from LevelDB, error: '%s'", + status.ToString()); + return stoi(version_string); + } +} + +void LevelDbMigrations::RunMigrations(leveldb::DB* db, + const LocalSerializer& serializer) { + RunMigrations(db, kSchemaVersion, serializer); +} + +void LevelDbMigrations::RunMigrations(leveldb::DB* db, + SchemaVersion to_version, + const LocalSerializer& serializer) { + SchemaVersion from_version = ReadSchemaVersion(db); + // If this is a downgrade, just save the downgrade version so we can + // detect it when we go to upgrade again, allowing us to rerun the + // data migrations. + if (from_version > to_version) { + LevelDbTransaction transaction(db, "Save downgrade version"); + SaveVersion(to_version, &transaction); + transaction.Commit(); + return; + } + + // This must run unconditionally because schema migrations were added to iOS + // after the first release. There may be clients that have never run any + // migrations that have existing targets. + if (from_version < 3 && to_version >= 3) { + ClearQueryCache(db); + } + + if (from_version < 4 && to_version >= 4) { + EnsureSentinelRows(db); + } + + if (from_version < 5 && to_version >= 5) { + RemoveAcknowledgedMutations(db); + } + + if (from_version < 6 && to_version >= 6) { + EnsureCollectionParentsIndex(db); + } + + if (from_version < 7 && to_version >= 7) { + RewriteTargetsCanonicalIds(db, serializer); + } +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h new file mode 100644 index 0000000..69b688e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h @@ -0,0 +1,58 @@ +/* + * 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_MIGRATIONS_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MIGRATIONS_H_ + +#include + +#include "Firestore/core/src/local/leveldb_transaction.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "leveldb/db.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbMigrations { + public: + using SchemaVersion = int32_t; + + /** + * Returns the current version of the schema for the given database + */ + static SchemaVersion ReadSchemaVersion(leveldb::DB* db); + + /** + * Runs any migrations needed to bring the given database up to the current + * schema version + */ + static void RunMigrations(leveldb::DB* db, const LocalSerializer& serializer); + + /** + * Runs any migrations needed to bring the given database up to the given + * schema version + */ + static void RunMigrations(leveldb::DB* db, + SchemaVersion version, + const LocalSerializer& serializer); +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MIGRATIONS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.cc new file mode 100644 index 0000000..f45f333 --- /dev/null +++ b/SaraAttended/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 core::Query; +using credentials::User; +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.h new file mode 100644 index 0000000..0f95c2e --- /dev/null +++ b/SaraAttended/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 credentials { +class User; +} // namespace credentials + +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 credentials::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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.cc new file mode 100644 index 0000000..d7d679b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.h new file mode 100644 index 0000000..0516523 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc new file mode 100644 index 0000000..6df368f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc @@ -0,0 +1,280 @@ +/* + * 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/core/database_info.h" +#include "Firestore/core/src/credentials/user.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 credentials::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(), serializer); + + 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); + bundle_cache_ = absl::make_unique(this, &serializer_); + + // 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; + + auto max_signed_value = + static_cast(std::numeric_limits::max()); + if (count < old_count || count > max_signed_value) { + 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 credentials::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(); +} + +LevelDbBundleCache* LevelDbPersistence::bundle_cache() { + return bundle_cache_.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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h new file mode 100644 index 0000000..c93bd95 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h @@ -0,0 +1,138 @@ +/* + * 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/credentials/user.h" +#include "Firestore/core/src/local/leveldb_bundle_cache.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; + + LevelDbBundleCache* bundle_cache() override; + + LevelDbMutationQueue* GetMutationQueueForUser( + const credentials::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 bundle_cache_; + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc new file mode 100644 index 0000000..ce15c5f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc @@ -0,0 +1,290 @@ +/* + * 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/mutable_document.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::DocumentKey; +using model::DocumentKeySet; +using model::MutableDocument; +using model::MutableDocumentMap; +using model::ResourcePath; +using model::SnapshotVersion; +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 MutableDocument& 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); +} + +MutableDocument 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 MutableDocument::InvalidDocument(key); + } else if (status.ok()) { + return DecodeMaybeDocument(value, key); + } else { + HARD_FAIL("Fetch document for key (%s) failed with status: %s", + key.ToString(), status.ToString()); + } +} + +MutableDocumentMap 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, MutableDocument::InvalidDocument(key))); + } else { + const std::string& contents = it->value(); + tasks.Execute([this, &results, &key, contents] { + results.Insert(std::make_pair(key, DecodeMaybeDocument(contents, key))); + }); + } + } + + tasks.AwaitAll(); + + MutableDocumentMap map; + for (const auto& entry : results.Result()) { + map = map.insert(entry.first, entry.second); + } + return map; +} + +MutableDocumentMap LevelDbRemoteDocumentCache::GetAllExisting( + const DocumentKeySet& keys) { + MutableDocumentMap docs = LevelDbRemoteDocumentCache::GetAll(keys); + MutableDocumentMap result; + for (const auto& kv : docs) { + const DocumentKey& key = kv.first; + auto& document = kv.second; + if (document.is_found_document()) { + result = result.insert(key, document); + } + } + + return result; +} + +MutableDocumentMap 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] { + MutableDocument document = DecodeMaybeDocument(contents, document_key); + if (document.is_found_document()) { + results.Insert(document); + } + }); + } + + tasks.AwaitAll(); + + MutableDocumentMap map; + for (const MutableDocument& doc : results.Result()) { + map = map.insert(doc.key(), doc); + } + return map; + } +} + +MutableDocument LevelDbRemoteDocumentCache::DecodeMaybeDocument( + absl::string_view encoded, const DocumentKey& key) { + StringReader reader{encoded}; + + auto message = Message::TryParse(&reader); + MutableDocument 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h new file mode 100644 index 0000000..980ccb8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h @@ -0,0 +1,80 @@ +/* + * 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::MutableDocument& document, + const model::SnapshotVersion& read_time) override; + void Remove(const model::DocumentKey& key) override; + + model::MutableDocument Get(const model::DocumentKey& key) override; + model::MutableDocumentMap GetAll(const model::DocumentKeySet& keys) override; + model::MutableDocumentMap 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::MutableDocumentMap GetAllExisting(const model::DocumentKeySet& keys); + + model::MutableDocument 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc new file mode 100644 index 0000000..2635be8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc @@ -0,0 +1,452 @@ +/* + * 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 + +#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/log.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::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(); + + RemoveMatchingKeysForTarget(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) { + LOG_WARN( + "Dangling query-target reference found: " + "%s points to %s; seeking there found %s", + DescribeKey(index_iterator), DescribeKey(target_key), + DescribeKey(target_iterator)); + continue; + } + + // 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::EnumerateSequenceNumbers( + const SequenceNumberCallback& 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()) { + StringReader reader{it->value()}; + auto target_proto = DecodeTargetProto(&reader); + callback(target_proto->last_listen_sequence_number); + } +} + +size_t LevelDbTargetCache::RemoveTargets( + ListenSequenceNumber upper_bound, + const std::unordered_map& live_targets) { + std::string target_prefix = LevelDbTargetKey::KeyPrefix(); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(target_prefix); + + std::unordered_set removed_targets; + + // In https://github.com/firebase/firebase-ios-sdk/issues/6721, a customer + // reports that their client crashes when deserializing an invalid Target + // during an LRU run. Instead of deserializing the value into a full Target + // model, we only convert it into the underlying Protobuf message. + for (; it->Valid() && absl::StartsWith(it->key(), target_prefix); + it->Next()) { + StringReader reader{it->value()}; + auto target_proto = DecodeTargetProto(&reader); + if (target_proto->last_listen_sequence_number <= upper_bound && + live_targets.find(target_proto->target_id) == live_targets.end()) { + TargetId target_id = target_proto->target_id; + + // Remove the DocumentKey to TargetId mapping + RemoveMatchingKeysForTarget(target_id); + // Remove the TargetId to Target mapping + db_->current_transaction()->Delete(it->key()); + + removed_targets.insert(target_id); + } + } + + // Remove the CanonicalId to TargetId mapping + RemoveQueryTargetKeyForTargets(removed_targets); + + metadata_->target_count -= removed_targets.size(); + SaveMetadata(); + + return removed_targets.size(); +} + +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::RemoveMatchingKeysForTarget(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)); + } +} + +void LevelDbTargetCache::RemoveQueryTargetKeyForTargets( + const std::unordered_set& target_ids) { + std::string index_prefix = LevelDbQueryTargetKey::KeyPrefix(); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + LevelDbQueryTargetKey row_key; + for (; index_iterator->Valid(); index_iterator->Next()) { + if (!row_key.Decode(index_iterator->key())) { + break; + } + + if (target_ids.find(row_key.target_id()) != target_ids.end()) { + db_->current_transaction()->Delete(index_iterator->key()); + } + } +} + +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_); +} + +nanopb::Message LevelDbTargetCache::DecodeTargetProto( + nanopb::Reader* reader) { + auto message = Message::TryParse(reader); + if (!reader->ok()) { + HARD_FAIL("Target proto failed to parse: %s", reader->status().ToString()); + } + return message; +} + +TargetData LevelDbTargetCache::DecodeTarget(absl::string_view encoded) { + StringReader reader{encoded}; + auto message = DecodeTargetProto(&reader); + auto result = serializer_->DecodeTargetData(&reader, *message); + if (!reader.ok()) { + HARD_FAIL("Target failed to parse: %s, message: %s", + reader.status().ToString(), message.ToString()); + } + + return result; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h new file mode 100644 index 0000000..a6e8935 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h @@ -0,0 +1,162 @@ +/* + * 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 + +#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 EnumerateSequenceNumbers( + const SequenceNumberCallback& callback) override; + + size_t 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 document keys in the query results of the given target ID. */ + void RemoveMatchingKeysForTarget(model::TargetId target_id) override; + + 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. */ + nanopb::Message DecodeTargetProto( + nanopb::Reader* reader); + + /** + * 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); + + /** Removes the given targets from the query to target mapping. */ + void RemoveQueryTargetKeyForTargets( + const std::unordered_set& target_id); + + // 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc new file mode 100644 index 0000000..6110061 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc @@ -0,0 +1,244 @@ +/* + * 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_transaction.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" + +using leveldb::DB; +using leveldb::ReadOptions; +using leveldb::Slice; +using leveldb::Status; +using leveldb::WriteBatch; +using leveldb::WriteOptions; + +namespace firebase { +namespace firestore { +namespace local { + +LevelDbTransaction::Iterator::Iterator(LevelDbTransaction* txn) + : db_iter_(txn->db_->NewIterator(txn->read_options_)), + last_version_(txn->version_), + txn_(txn), + mutations_iter_(txn->mutations_.begin()), + current_(), + is_mutation_(false), + // Iterator doesn't really point to anything yet, so is + // invalid + is_valid_(false) { +} + +void LevelDbTransaction::Iterator::UpdateCurrent() { + bool mutation_is_valid = mutations_iter_ != txn_->mutations_.end(); + is_valid_ = mutation_is_valid || db_iter_->Valid(); + + if (is_valid_) { + if (!mutation_is_valid) { + is_mutation_ = false; + } else if (!db_iter_->Valid()) { + is_mutation_ = true; + } else { + // Both iterators are valid. If the leveldb key is equal to or greater + // than the current mutation key, we are looking at a mutation next. It's + // either sooner in the iteration or directly shadowing the underlying + // committed value in leveldb. + is_mutation_ = db_iter_->key().compare(mutations_iter_->first) >= 0; + } + if (is_mutation_) { + current_ = *mutations_iter_; + } else { + current_ = {db_iter_->key().ToString(), db_iter_->value().ToString()}; + } + } +} + +void LevelDbTransaction::Iterator::Seek(const std::string& key) { + db_iter_->Seek(key); + HARD_ASSERT(db_iter_->status().ok(), "leveldb iterator reported an error: %s", + db_iter_->status().ToString()); + for (; db_iter_->Valid() && IsDeleted(db_iter_->key()); db_iter_->Next()) { + } + HARD_ASSERT(db_iter_->status().ok(), "leveldb iterator reported an error: %s", + db_iter_->status().ToString()); + mutations_iter_ = txn_->mutations_.lower_bound(key); + UpdateCurrent(); + last_version_ = txn_->version_; +} + +const std::string& LevelDbTransaction::Iterator::key() const { + HARD_ASSERT(Valid(), "key() called on invalid iterator"); + return current_.first; +} + +const std::string& LevelDbTransaction::Iterator::value() const { + HARD_ASSERT(Valid(), "value() called on invalid iterator"); + return current_.second; +} + +bool LevelDbTransaction::Iterator::IsDeleted(leveldb::Slice slice) { + return txn_->deletions_.find(slice.ToString()) != txn_->deletions_.end(); +} + +bool LevelDbTransaction::Iterator::SyncToTransaction() { + if (last_version_ < txn_->version_) { + // Intentionally copying here since Seek() may update current_. We need the + // copy to do the comparison below. + const std::string current_key = current_.first; + Seek(current_key); + // If we advanced, we don't need to advance again. + return is_valid_ && current_.first > current_key; + } else { + return false; + } +} + +void LevelDbTransaction::Iterator::AdvanceLDB() { + do { + db_iter_->Next(); + } while (db_iter_->Valid() && IsDeleted(db_iter_->key())); + HARD_ASSERT(db_iter_->status().ok(), "leveldb iterator reported an error: %s", + db_iter_->status().ToString()); +} + +void LevelDbTransaction::Iterator::Next() { + HARD_ASSERT(Valid(), "Next() called on invalid iterator"); + bool advanced = SyncToTransaction(); + if (!advanced && is_valid_) { + if (is_mutation_) { + // A mutation might be shadowing leveldb. If so, advance both. + if (db_iter_->Valid() && db_iter_->key() == mutations_iter_->first) { + AdvanceLDB(); + } + ++mutations_iter_; + } else { + AdvanceLDB(); + } + UpdateCurrent(); + } +} + +LevelDbTransaction::LevelDbTransaction(DB* db, + absl::string_view label, + const ReadOptions& read_options, + const WriteOptions& write_options) + : db_(NOT_NULL(db)), + read_options_(read_options), + write_options_(write_options), + label_(label) { +} + +const ReadOptions& LevelDbTransaction::DefaultReadOptions() { + // ReadOptions is trivial so it does not need to be heap-allocated. + static ReadOptions options = [] { + ReadOptions read_options; + read_options.verify_checksums = true; + return read_options; + }(); + return options; +} + +const WriteOptions& LevelDbTransaction::DefaultWriteOptions() { + // WriteOptions is trivial so it does not need to be heap-allocated. + static WriteOptions options; + return options; +} + +void LevelDbTransaction::Put(std::string key, std::string value) { + deletions_.erase(key); + mutations_[std::move(key)] = std::move(value); + version_++; +} + +std::unique_ptr +LevelDbTransaction::NewIterator() { + return absl::make_unique(this); +} + +Status LevelDbTransaction::Get(absl::string_view key, std::string* value) { + std::string key_string(key); + if (deletions_.find(key_string) != deletions_.end()) { + return Status::NotFound(key_string + " is not present in the transaction"); + } else { + Mutations::iterator iter{mutations_.find(key_string)}; + if (iter != mutations_.end()) { + *value = iter->second; + return Status::OK(); + } else { + return db_->Get(read_options_, key_string, value); + } + } +} + +void LevelDbTransaction::Delete(absl::string_view key) { + std::string to_delete(key); + deletions_.insert(to_delete); + mutations_.erase(to_delete); + version_++; +} + +void LevelDbTransaction::Commit() { + WriteBatch batch; + for (const auto& deletion : deletions_) { + batch.Delete(deletion); + } + + for (const auto& entry : mutations_) { + batch.Put(entry.first, entry.second); + } + + LOG_DEBUG("Committing transaction: %s", ToString()); + + Status status = db_->Write(write_options_, &batch); + HARD_ASSERT(status.ok(), "Failed to commit transaction:\n%s\n Failed: %s", + ToString(), status.ToString()); +} + +std::string LevelDbTransaction::ToString() { + std::string dest = absl::StrCat(""); + return dest; +} + +std::string DescribeKey( + const std::unique_ptr& iterator) { + if (iterator->Valid()) { + return DescribeKey(iterator->key()); + } else { + return "the end of the table"; + } +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h new file mode 100644 index 0000000..4cf0ecd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h @@ -0,0 +1,216 @@ +/* + * 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_TRANSACTION_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TRANSACTION_H_ + +#include +#include +#include +#include +#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" + +namespace firebase { +namespace firestore { +namespace local { + +/** + * LevelDBTransaction tracks pending changes to entries in leveldb, including + * deletions. It also provides an Iterator to traverse a merged view of pending + * changes and committed values. + */ +class LevelDbTransaction { + using Deletions = std::set; + using Mutations = std::map; + + public: + /** + * Iterator iterates over a merged view of pending changes from the + * transaction and any unchanged values in the underlying leveldb instance. + */ + class Iterator { + public: + explicit Iterator(LevelDbTransaction* txn); + + /** + * Returns true if this iterator points to an entry + */ + bool Valid() const { + return is_valid_; + } + + /** + * Seeks this iterator to the first key equal to or greater than the given + * key + */ + void Seek(const std::string& key); + + /** + * Advances the iterator to the next entry + */ + void Next(); + + /** + * Returns the key of the current entry + */ + const std::string& key() const; + + /** + * Returns the value of the current entry + */ + const std::string& value() const; + + private: + /** + * Advances to the next non-deleted key in leveldb. + */ + void AdvanceLDB(); + + /** + * Returns true if the given slice matches a key present in the deletions_ + * set. + */ + bool IsDeleted(leveldb::Slice slice); + + /** + * Syncs with the underlying transaction. If the transaction has been + * updated, the mutation iterator may need to be reset. Returns true if this + * resulted in moving to a new underlying entry (i.e. the entry represented + * by current_ was deleted). + */ + bool SyncToTransaction(); + + /** + * Given the current state of the internal iterators, set is_valid_, + * is_mutation_, and current_. + */ + void UpdateCurrent(); + + std::unique_ptr db_iter_; + + // The last observed version of the underlying transaction + int32_t last_version_; + // The underlying transaction. + LevelDbTransaction* txn_; + Mutations::iterator mutations_iter_; + // We save the current key and value so that once an iterator is Valid(), it + // remains so at least until the next call to Seek() or Next(), even if the + // underlying data is deleted. + std::pair current_; + // True if current_ represents an entry in the mutations_ map, rather than + // committed data. + bool is_mutation_; + // True if the iterator pointed to a valid entry the last time Next() or + // Seek() was called. + bool is_valid_; + }; + + explicit LevelDbTransaction( + leveldb::DB* db, + absl::string_view label, + const leveldb::ReadOptions& read_options = DefaultReadOptions(), + const leveldb::WriteOptions& write_options = DefaultWriteOptions()); + + LevelDbTransaction(const LevelDbTransaction& other) = delete; + + LevelDbTransaction& operator=(const LevelDbTransaction& other) = delete; + + /** + * Returns a default set of ReadOptions + */ + static const leveldb::ReadOptions& DefaultReadOptions(); + + /** + * Returns a default set of WriteOptions + */ + static const leveldb::WriteOptions& DefaultWriteOptions(); + + size_t changed_keys() const { + return mutations_.size() + deletions_.size(); + } + + /** + * Remove the database entry (if any) for "key". It is not an error if "key" + * did not exist in the database. + */ + void Delete(absl::string_view key); + + /** + * 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 + * doesn't exist in leveldb, or it is scheduled for deletion in this + * transaction, `Status::NotFound` is returned. + */ + leveldb::Status Get(absl::string_view key, std::string* value); + + /** + * Returns a new Iterator over the pending changes in this transaction, merged + * with the existing values already in leveldb. + */ + std::unique_ptr NewIterator(); + + /** + * Commits the transaction. All pending changes are written. The transaction + * should not be used after calling this method. + */ + void Commit(); + + std::string ToString(); + + private: + leveldb::DB* db_ = nullptr; + Mutations mutations_; + Deletions deletions_; + leveldb::ReadOptions read_options_; + leveldb::WriteOptions write_options_; + int32_t version_ = 0; + std::string label_; +}; + +/** + * Returns a description of the current key if the iterator is Valid, otherwise + * the string "the end of the table." + */ +std::string DescribeKey( + const std::unique_ptr& iterator); + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TRANSACTION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc new file mode 100644 index 0000000..5176418 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc @@ -0,0 +1,49 @@ +/* + * 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_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h new file mode 100644 index 0000000..7bddd54 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h @@ -0,0 +1,48 @@ +/* + * 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_UTIL_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_UTIL_H_ + +#include + +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/strings/string_view.h" +#include "leveldb/slice.h" +#include "leveldb/status.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** Creates a Slice from a string_view. */ +inline leveldb::Slice MakeSlice(absl::string_view view) { + return leveldb::Slice{view.data(), view.size()}; +} + +/** Creates a string_view from a Slice. */ +inline absl::string_view MakeStringView(leveldb::Slice slice) { + return absl::string_view{slice.data(), slice.size()}; +} + +/** Converts the given LevelDB status to a Firestore status. */ +util::Status ConvertStatus(const leveldb::Status& status); + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_UTIL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.h new file mode 100644 index 0000000..71cd550 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.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_LOCAL_LISTEN_SEQUENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LISTEN_SEQUENCE_H_ + +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** + * ListenSequence is a monotonic sequence. It is initialized with a minimum + * value to exceed. All subsequent calls to next will return increasing values. + */ +class ListenSequence { + public: + explicit ListenSequence(model::ListenSequenceNumber starting_after) + : previous_sequence_number_(starting_after) { + } + + model::ListenSequenceNumber Next() { + previous_sequence_number_++; + return previous_sequence_number_; + } + + private: + model::ListenSequenceNumber previous_sequence_number_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LISTEN_SEQUENCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc new file mode 100644 index 0000000..ba1f0ca --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc @@ -0,0 +1,219 @@ +/* + * 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 + +#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/mutable_document.h" +#include "Firestore/core/src/model/mutation_batch.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::MutableDocument; +using model::MutableDocumentMap; +using model::Mutation; +using model::MutationBatch; +using model::ResourcePath; +using model::SnapshotVersion; + +const Document LocalDocumentsView::GetDocument(const DocumentKey& key) { + std::vector batches = + mutation_queue_->AllMutationBatchesAffectingDocumentKey(key); + return GetDocument(key, batches); +} + +Document LocalDocumentsView::GetDocument( + const DocumentKey& key, const std::vector& batches) { + MutableDocument document = remote_document_cache_->Get(key); + for (const MutationBatch& batch : batches) { + batch.ApplyToLocalDocument(document); + } + return Document{std::move(document)}; +} + +DocumentMap LocalDocumentsView::ApplyLocalMutationsToDocuments( + MutableDocumentMap& docs, const std::vector& batches) { + DocumentMap results; + for (const auto& kv : docs) { + MutableDocument local_view = kv.second; + for (const MutationBatch& batch : batches) { + batch.ApplyToLocalDocument(local_view); + } + results = results.insert(kv.first, std::move(local_view)); + } + return results; +} + +DocumentMap LocalDocumentsView::GetDocuments(const DocumentKeySet& keys) { + MutableDocumentMap docs = remote_document_cache_->GetAll(keys); + return GetLocalViewOfDocuments(std::move(docs)); +} + +DocumentMap LocalDocumentsView::GetLocalViewOfDocuments( + MutableDocumentMap docs) { + DocumentKeySet all_keys; + for (const auto& kv : docs) { + all_keys = all_keys.insert(kv.first); + } + std::vector batches = + mutation_queue_->AllMutationBatchesAffectingDocumentKeys(all_keys); + return ApplyLocalMutationsToDocuments(docs, batches); +} + +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. + Document doc = GetDocument(DocumentKey{doc_path}); + if (doc->is_found_document()) { + result = result.insert(doc->key(), 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) { + 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) { + MutableDocumentMap remote_documents = + remote_document_cache_->GetMatching(query, since_read_time); + // Get locally persisted mutation batches. + std::vector matching_batches = + mutation_queue_->AllMutationBatchesAffectingQuery(query); + + remote_documents = + AddMissingBaseDocuments(matching_batches, std::move(remote_documents)); + + 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 document = remote_documents.get(key); + if (!document) { + // Create invalid document to apply mutations on top of + document = MutableDocument::InvalidDocument(key); + } + + mutation.ApplyToLocalView(*document, batch.local_write_time()); + remote_documents = remote_documents.insert(key, *document); + } + } + + // 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 results; + for (const auto& kv : remote_documents) { + const DocumentKey& key = kv.first; + if (query.Matches(kv.second)) { + results = results.insert(key, kv.second); + } + } + + return results; +} + +MutableDocumentMap LocalDocumentsView::AddMissingBaseDocuments( + const std::vector& matching_batches, + MutableDocumentMap 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.contains(key)) { + missing_doc_keys = missing_doc_keys.insert(key); + } + } + } + + MutableDocumentMap merged_docs = existing_docs; + MutableDocumentMap missing_docs = + remote_document_cache_->GetAll(missing_doc_keys); + for (const auto& kv : missing_docs) { + const MutableDocument document = kv.second; + if (document.is_found_document()) { + existing_docs = existing_docs.insert(kv.first, document); + } + } + + return existing_docs; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h new file mode 100644 index 0000000..1bcbea8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h @@ -0,0 +1,153 @@ +/* + * 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 model { +class Document; +} // namespace model + +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. + */ + const model::Document 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::DocumentMap 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::DocumentMap GetLocalViewOfDocuments( + model::MutableDocumentMap 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. */ + model::Document 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`. + */ + static model::DocumentMap ApplyLocalMutationsToDocuments( + model::MutableDocumentMap& 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::MutableDocumentMap AddMissingBaseDocuments( + const std::vector& matching_batches, + model::MutableDocumentMap 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc new file mode 100644 index 0000000..770c5d9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc @@ -0,0 +1,458 @@ +/* + * 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/local_serializer.h" + +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/firestore/bundle.nanopb.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/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/snapshot_version.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" +#include "absl/types/span.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using bundle::BundledQuery; +using bundle::BundleMetadata; +using bundle::NamedQuery; +using core::Target; +using model::DeepClone; +using model::FieldTransform; +using model::MutableDocument; +using model::Mutation; +using model::MutationBatch; +using model::ObjectValue; +using model::SnapshotVersion; +using nanopb::ByteString; +using nanopb::CheckedSize; +using nanopb::CopyBytesArray; +using nanopb::MakeArray; +using nanopb::Message; +using nanopb::Reader; +using nanopb::ReleaseFieldOwnership; +using nanopb::SafeReadBoolean; +using nanopb::SetRepeatedField; +using nanopb::Writer; +using util::Status; +using util::StringFormat; + +} // namespace + +Message LocalSerializer::EncodeMaybeDocument( + const MutableDocument& document) const { + Message result; + + if (document.is_found_document()) { + result->which_document_type = firestore_client_MaybeDocument_document_tag; + result->document = EncodeDocument(document); + result->has_committed_mutations = document.has_committed_mutations(); + return result; + } else if (document.is_no_document()) { + result->which_document_type = + firestore_client_MaybeDocument_no_document_tag; + result->no_document = EncodeNoDocument(document); + result->has_committed_mutations = document.has_committed_mutations(); + return result; + } else if (document.is_unknown_document()) { + result->which_document_type = + firestore_client_MaybeDocument_unknown_document_tag; + result->unknown_document = EncodeUnknownDocument(document); + result->has_committed_mutations = true; + return result; + } else { + HARD_FAIL("Unknown document type %s", document.ToString()); + } + + UNREACHABLE(); +} + +MutableDocument LocalSerializer::DecodeMaybeDocument( + Reader* reader, 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 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 MutableDocument& doc) const { + google_firestore_v1_Document result{}; + + result.name = rpc_serializer_.EncodeKey(doc.key()); + + // Encode Document.fields (unless it's empty) + google_firestore_v1_MapValue fields_map = doc.value().map_value; + SetRepeatedField( + &result.fields, &result.fields_count, + absl::Span( + fields_map.fields, fields_map.fields_count), + [](const google_firestore_v1_MapValue_FieldsEntry& map_entry) { + // TODO(mrschmidt): Figure out how to remove this copy + return google_firestore_v1_Document_FieldsEntry{ + nanopb::CopyBytesArray(map_entry.key), + *DeepClone(map_entry.value).release()}; + }); + + 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; +} + +MutableDocument LocalSerializer::DecodeDocument( + Reader* reader, + google_firestore_v1_Document& proto, + bool has_committed_mutations) const { + ObjectValue fields = + ObjectValue::FromFieldsEntry(proto.fields, proto.fields_count); + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader->context(), proto.update_time); + + MutableDocument document = MutableDocument::FoundDocument( + rpc_serializer_.DecodeKey(reader->context(), proto.name), version, + std::move(fields)); + if (has_committed_mutations) { + document.SetHasCommittedMutations(); + } + return document; +} + +firestore_client_NoDocument LocalSerializer::EncodeNoDocument( + const MutableDocument& 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; +} + +MutableDocument LocalSerializer::DecodeNoDocument( + Reader* reader, + const firestore_client_NoDocument& proto, + bool has_committed_mutations) const { + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader->context(), proto.read_time); + + MutableDocument document = MutableDocument::NoDocument( + rpc_serializer_.DecodeKey(reader->context(), proto.name), version); + if (has_committed_mutations) { + document.SetHasCommittedMutations(); + } + return document; +} + +firestore_client_UnknownDocument LocalSerializer::EncodeUnknownDocument( + const MutableDocument& 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; +} + +MutableDocument LocalSerializer::DecodeUnknownDocument( + Reader* reader, const firestore_client_UnknownDocument& proto) const { + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader->context(), proto.version); + + return MutableDocument::UnknownDocument( + rpc_serializer_.DecodeKey(reader->context(), 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, 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->context(), proto.snapshot_version); + SnapshotVersion last_limbo_free_snapshot_version = + rpc_serializer_.DecodeVersion(reader->context(), + 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->context(), proto.query); + break; + + case firestore_client_Target_documents_tag: + target = rpc_serializer_.DecodeDocumentsTarget(reader->context(), + 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, firestore_client_WriteBatch& proto) const { + int batch_id = proto.batch_id; + Timestamp local_write_time = rpc_serializer_.DecodeTimestamp( + reader->context(), 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->context(), proto.base_writes[i])); + } + + std::vector mutations; + + // Squash old transform mutations into existing patch of set mutations. The + // replacement of representing `transforms` with `update_transforms` on the + // SDK means that old `transform` mutations stored in LevelDB need to be + // updated to `update_transforms`. + // TODO(b/174608374): Remove this code once we perform a schema migration. + for (size_t i = 0; i < proto.writes_count; ++i) { + google_firestore_v1_Write current_mutation = proto.writes[i]; + bool has_transform = i + 1 < proto.writes_count && + proto.writes[i + 1].which_operation == + google_firestore_v1_Write_transform_tag; + if (has_transform) { + google_firestore_v1_Write& transform_mutation = proto.writes[i + 1]; + HARD_ASSERT( + proto.writes[i].which_operation == + google_firestore_v1_Write_update_tag, + "TransformMutation should be preceded by a patch or set mutation"); + google_firestore_v1_Write new_mutation{current_mutation}; + new_mutation.update_transforms_count = + transform_mutation.transform.field_transforms_count; + new_mutation.update_transforms = + transform_mutation.transform.field_transforms; + // Prevent double-freeing of the write's fields. The fields are now owned + // by the mutation. + transform_mutation.transform.field_transforms_count = 0; + transform_mutation.transform.field_transforms = nullptr; + mutations.push_back( + rpc_serializer_.DecodeMutation(reader->context(), new_mutation)); + ++i; + } else { + mutations.push_back( + rpc_serializer_.DecodeMutation(reader->context(), current_mutation)); + } + } + + 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->context(), proto); +} + +Message LocalSerializer::EncodeBundle( + const BundleMetadata& metadata) const { + Message result; + + // Note: only fields intended to be stored get encoded here, `total_documents` + // and `total_bytes` are skipped for example, they are not useful once the + // bundle has been parsed and loaded. + result->id = rpc_serializer_.EncodeString(metadata.bundle_id()); + result->version = metadata.version(); + result->create_time = EncodeVersion(metadata.create_time()); + return result; +} + +BundleMetadata LocalSerializer::DecodeBundle( + Reader* reader, const firestore_BundleMetadata& proto) const { + return BundleMetadata(rpc_serializer_.DecodeString(proto.id), proto.version, + DecodeVersion(reader, proto.create_time)); +} + +Message LocalSerializer::EncodeNamedQuery( + const NamedQuery& query) const { + Message result; + + result->name = rpc_serializer_.EncodeString(query.query_name()); + result->read_time = EncodeVersion(query.read_time()); + result->bundled_query = EncodeBundledQuery(query.bundled_query()); + + return result; +} + +NamedQuery LocalSerializer::DecodeNamedQuery( + nanopb::Reader* reader, firestore_NamedQuery& proto) const { + return NamedQuery(rpc_serializer_.DecodeString(proto.name), + DecodeBundledQuery(reader, proto.bundled_query), + DecodeVersion(reader, proto.read_time)); +} + +firestore_BundledQuery LocalSerializer::EncodeBundledQuery( + const BundledQuery& query) const { + firestore_BundledQuery result{}; + + result.limit_type = query.limit_type() == core::LimitType::First + ? _firestore_BundledQuery_LimitType:: + firestore_BundledQuery_LimitType_FIRST + : _firestore_BundledQuery_LimitType:: + firestore_BundledQuery_LimitType_LAST; + + auto query_target = rpc_serializer_.EncodeQueryTarget(query.target()); + result.parent = query_target.parent; + result.which_query_type = firestore_BundledQuery_structured_query_tag; + result.structured_query = query_target.structured_query; + + return result; +} + +BundledQuery LocalSerializer::DecodeBundledQuery( + nanopb::Reader* reader, firestore_BundledQuery& query) const { + // The QueryTarget oneof only has a single valid value. + if (query.which_query_type != firestore_BundledQuery_structured_query_tag) { + reader->Fail( + StringFormat("Unknown bundled query_type: %s", query.which_query_type)); + return BundledQuery(); + } + + auto limit_type = query.limit_type == + _firestore_BundledQuery_LimitType:: + firestore_BundledQuery_LimitType_FIRST + ? core::LimitType::First + : core::LimitType::Last; + return BundledQuery( + rpc_serializer_.DecodeStructuredQuery(reader->context(), query.parent, + query.structured_query), + limit_type); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h new file mode 100644 index 0000000..2a7396e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h @@ -0,0 +1,190 @@ +/* + * 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_BundleMetadata firestore_BundleMetadata; +typedef struct _firestore_BundledQuery firestore_BundledQuery; +typedef struct _firestore_NamedQuery firestore_NamedQuery; +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 bundle { + +class BundleMetadata; +class BundledQuery; +class NamedQuery; + +} // namespace bundle + +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::MutableDocument& maybe_doc) const; + + /** + * @brief Decodes nanopb proto representing a MaybeDocument proto to the + * equivalent model. + * Modifies the provided proto to release ownership of any Value messages. + */ + model::MutableDocument DecodeMaybeDocument( + nanopb::Reader* reader, 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. + * Modifies the provided proto to release ownership of any Value messages. + */ + TargetData DecodeTargetData(nanopb::Reader* reader, + 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. + * Modifies the provided proto to release ownership of any Value messages. + */ + model::MutationBatch DecodeMutationBatch( + nanopb::Reader* reader, 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; + + nanopb::Message EncodeBundle( + const bundle::BundleMetadata& metadata) const; + bundle::BundleMetadata DecodeBundle( + nanopb::Reader* reader, const firestore_BundleMetadata& proto) const; + + nanopb::Message EncodeNamedQuery( + const bundle::NamedQuery& query) const; + + /** + * Decodes the named query. Modifies the provided proto to release ownership + * of any Value messages. + */ + bundle::NamedQuery DecodeNamedQuery(nanopb::Reader* reader, + firestore_NamedQuery& 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::MutableDocument& doc) const; + + model::MutableDocument DecodeDocument(nanopb::Reader* reader, + google_firestore_v1_Document& proto, + bool has_committed_mutations) const; + + firestore_client_NoDocument EncodeNoDocument( + const model::MutableDocument& no_doc) const; + + model::MutableDocument DecodeNoDocument( + nanopb::Reader* reader, + const firestore_client_NoDocument& proto, + bool has_committed_mutations) const; + + firestore_client_UnknownDocument EncodeUnknownDocument( + const model::MutableDocument& unknown_doc) const; + model::MutableDocument DecodeUnknownDocument( + nanopb::Reader* reader, + const firestore_client_UnknownDocument& proto) const; + + firestore_BundledQuery EncodeBundledQuery( + const bundle::BundledQuery& query) const; + bundle::BundledQuery DecodeBundledQuery(nanopb::Reader* reader, + firestore_BundledQuery& query) const; + + remote::Serializer rpc_serializer_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_SERIALIZER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc new file mode 100644 index 0000000..9a7c2c0 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc @@ -0,0 +1,641 @@ +/* + * 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/local_store.h" + +#include +#include + +#include "Firestore/core/src/local/bundle_cache.h" +#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/mutable_document.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 core::Query; +using core::Target; +using core::TargetIdGenerator; +using credentials::User; +using model::BatchId; +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::DocumentUpdateMap; +using model::DocumentVersionMap; +using model::ListenSequenceNumber; +using model::MutableDocument; +using model::MutableDocumentMap; +using model::Mutation; +using model::MutationBatch; +using model::MutationBatchResult; +using model::ObjectValue; +using model::PatchMutation; +using model::Precondition; +using model::ResourcePath; +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()), + bundle_cache_(persistence->bundle_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(); }); +} + +DocumentMap 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. + DocumentMap 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.ExtractTransformBaseValue(*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 + model::FieldMask mask = base_value->ToFieldMask(); + base_mutations.push_back(PatchMutation(mutation.key(), + std::move(*base_value), mask, + Precondition::Exists(true))); + } + } + + MutationBatch batch = mutation_queue_->AddMutationBatch( + local_write_time, std::move(base_mutations), std::move(mutations)); + batch.ApplyToLocalDocumentSet(existing_documents); + return LocalWriteResult{batch.batch_id(), std::move(existing_documents)}; + }); +} + +DocumentMap 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) { + MutableDocument doc = remote_document_cache_->Get(doc_key); + + 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.version() < ack_version) { + batch.ApplyToRemoteDocument(doc, batch_result); + if (doc.is_valid_document()) { + remote_document_cache_->Add(doc, batch_result.commit_version()); + } + } + } + + mutation_queue_->RemoveMutationBatch(batch); +} + +DocumentMap 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::DocumentMap 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 previously + // 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); + } + } + } + + const DocumentKeySet& limbo_documents = + remote_event.limbo_document_changes(); + for (const auto& kv : remote_event.document_updates()) { + // If this was a limbo resolution, make sure we mark when it was accessed. + if (limbo_documents.contains(kv.first)) { + persistence_->reference_delegate()->UpdateLimboDocument(kv.first); + } + } + + auto changed_docs = PopulateDocumentChanges( + remote_event.document_updates(), DocumentVersionMap(), + remote_event.snapshot_version()); + + // 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); + }); +} + +const Document 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_); + }); +} + +bool LocalStore::HasNewerBundle(const bundle::BundleMetadata& metadata) { + return persistence_->Run("Has newer bundle", [&] { + absl::optional cached_metadata = + bundle_cache_->GetBundleMetadata(metadata.bundle_id()); + return cached_metadata.has_value() && + cached_metadata->create_time() >= metadata.create_time(); + }); +} + +void LocalStore::SaveBundle(const bundle::BundleMetadata& metadata) { + return persistence_->Run( + "Save bundle", [&] { bundle_cache_->SaveBundleMetadata(metadata); }); +} + +DocumentMap LocalStore::ApplyBundledDocuments( + const MutableDocumentMap& bundled_documents, const std::string& bundle_id) { + // Allocates a target to hold all document keys from the bundle, such that + // they will not get garbage collected right away. + TargetData umbrella_target = AllocateTarget(NewUmbrellaTarget(bundle_id)); + return persistence_->Run("Apply bundle documents", [&] { + DocumentKeySet keys; + DocumentUpdateMap document_updates; + DocumentVersionMap versions; + + for (const auto& kv : bundled_documents) { + const DocumentKey& key = kv.first; + const auto& doc = kv.second; + if (doc.is_found_document()) { + keys = keys.insert(key); + } + document_updates.emplace(key, doc); + versions.emplace(key, doc.version()); + } + + target_cache_->RemoveMatchingKeysForTarget(umbrella_target.target_id()); + target_cache_->AddMatchingKeys(keys, umbrella_target.target_id()); + + auto changed_docs = PopulateDocumentChanges(document_updates, versions, + SnapshotVersion::None()); + return local_documents_->GetLocalViewOfDocuments(changed_docs); + }); +} + +void LocalStore::SaveNamedQuery(const bundle::NamedQuery& query, + const model::DocumentKeySet& keys) { + // Allocate a target for the named query such that it can be resumed from + // associated read time if users use it to listen. NOTE: this also means if no + // corresponding target exists, the new target will remain active and will not + // get collected, unless users happen to unlisten the query. + TargetData existing = AllocateTarget(query.bundled_query().target()); + int target_id = existing.target_id(); + + return persistence_->Run("Save named query", [&] { + // Only update the matching documents if it is newer than what the SDK + // already has. + if (query.read_time() > existing.snapshot_version()) { + // Update existing target data because the query from the bundle is newer. + TargetData new_target_data = + existing.WithResumeToken(nanopb::ByteString(), query.read_time()); + + target_cache_->UpdateTarget(new_target_data); + target_data_by_target_.emplace(target_id, std::move(new_target_data)); + target_cache_->RemoveMatchingKeysForTarget(target_id); + target_cache_->AddMatchingKeys(keys, target_id); + } + + bundle_cache_->SaveNamedQuery(query); + }); +} + +absl::optional LocalStore::GetNamedQuery( + const std::string& query) { + return persistence_->Run("Get named query", + [&] { return bundle_cache_->GetNamedQuery(query); }); +} + +Target LocalStore::NewUmbrellaTarget(const std::string& bundle_id) { + // It is OK that the path used for the query is not valid, because this will + // not be read and queried. + return Query(ResourcePath::FromString("__bundle__/docs/" + bundle_id)) + .ToTarget(); +} + +MutableDocumentMap LocalStore::PopulateDocumentChanges( + const DocumentUpdateMap& documents, + const DocumentVersionMap& document_versions, + const SnapshotVersion& global_version) { + MutableDocumentMap changed_docs; + + DocumentKeySet updated_keys; + for (const auto& kv : documents) { + 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. + MutableDocumentMap existing_docs = + remote_document_cache_->GetAll(updated_keys); + + for (const auto& kv : documents) { + const DocumentKey& key = kv.first; + const MutableDocument& doc = kv.second; + MutableDocument existing_doc = *existing_docs.get(key); + auto search_version = document_versions.find(key); + const SnapshotVersion& read_time = search_version != document_versions.end() + ? search_version->second + : global_version; + + // 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.is_no_document() && 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.is_valid_document() || + doc.version() > existing_doc.version() || + (doc.version() == existing_doc.version() && + existing_doc.has_pending_writes())) { + HARD_ASSERT(read_time != SnapshotVersion::None(), + "Cannot add a document when the remote version is zero"); + remote_document_cache_->Add(doc, read_time); + changed_docs = changed_docs.insert(key, doc); + } else { + LOG_DEBUG( + "LocalStore Ignoring outdated update for %s. " + "Current version: %s Remote version: %s", + key.ToString(), existing_doc.version().ToString(), + doc.version().ToString()); + } + } + return changed_docs; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h new file mode 100644 index 0000000..0266a87 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h @@ -0,0 +1,376 @@ +/* + * 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 + +#include "Firestore/core/src/bundle/bundle_callback.h" +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#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/document.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace credentials { +class User; +} // namespace credentials + +namespace core { +class Query; +} // namespace core + +namespace remote { +class RemoteEvent; +class TargetChange; +} // namespace remote + +namespace local { + +class BundleCache; +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 bundle::BundleCallback { + public: + LocalStore(Persistence* persistence, + QueryEngine* query_engine, + const credentials::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::DocumentMap HandleUserChange(const credentials::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 an invalid + * document if not found. + */ + const model::Document 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::DocumentMap 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::DocumentMap 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::DocumentMap 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); + + /** + * Returns whether the given bundle has already been loaded and its create + * time is newer or equal to the currently loading bundle. + */ + bool HasNewerBundle(const bundle::BundleMetadata& metadata); + + /** Saves the given `BundleMetadata` to local persistence. */ + void SaveBundle(const bundle::BundleMetadata& metadata) override; + + /** + * Applies the documents from a bundle to the "ground-state" (remote) + * documents. + * + * Local documents are re-calculated if there are remaining mutations in the + * queue. + */ + model::DocumentMap ApplyBundledDocuments( + const model::MutableDocumentMap& documents, + const std::string& bundle_id) override; + + /** Saves the given `NamedQuery` to local persistence. */ + void SaveNamedQuery(const bundle::NamedQuery& query, + const model::DocumentKeySet& keys) override; + + /** + * Returns the NameQuery associated with query_name or `nullopt` if not found. + */ + absl::optional GetNamedQuery( + const std::string& query_name); + + 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& target); + + /** + * Creates a new target using the given bundle name, which will be used to + * hold the keys of all documents from the bundle in query-document mappings. + * This ensures that the loaded documents do not get garbage collected right + * away. + */ + static core::Target NewUmbrellaTarget(const std::string& bundle_id); + + /** + * Populates the remote document cache with documents from backend or a + * bundle. Returns the document changes resulting from applying those + * documents. + * + * Note: this function will use `document_versions` if it is defined. When it + * is not defined, it resorts to `global_version`. + * + * @param documents Documents to be applied. + * @param document_versions A DocumentKey-to-SnapshotVersion map if documents + * have their own read time. + * @param global_version A SnapshotVersion representing the read time if all + * documents have the same read time. + */ + model::MutableDocumentMap PopulateDocumentChanges( + const model::DocumentUpdateMap& documents, + const model::DocumentVersionMap& document_versions, + const model::SnapshotVersion& global_version); + + /** 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; + + /** Holds information about the bundles loaded into the SDK. */ + BundleCache* bundle_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc new file mode 100644 index 0000000..39051b4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc @@ -0,0 +1,57 @@ +/* + * 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_view_changes.h" + +#include "Firestore/core/src/core/view_snapshot.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::DocumentViewChange; +using core::ViewSnapshot; +using model::DocumentKeySet; +using model::TargetId; + +LocalViewChanges LocalViewChanges::FromViewSnapshot( + const core::ViewSnapshot& snapshot, model::TargetId target_id) { + DocumentKeySet added_keys; + DocumentKeySet removed_keys; + + for (const DocumentViewChange& doc_change : snapshot.document_changes()) { + switch (doc_change.type()) { + case DocumentViewChange::Type::Added: + added_keys = added_keys.insert(doc_change.document()->key()); + break; + + case DocumentViewChange::Type::Removed: + removed_keys = removed_keys.insert(doc_change.document()->key()); + break; + + default: + // Do nothing. + break; + } + } + + return LocalViewChanges(target_id, snapshot.from_cache(), + std::move(added_keys), std::move(removed_keys)); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h new file mode 100644 index 0000000..73d1b89 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h @@ -0,0 +1,81 @@ +/* + * 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_VIEW_CHANGES_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_VIEW_CHANGES_H_ + +#include + +#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 { +namespace local { + +/** + * Represents changes applying to the local view of a given query, including + * what documents are currently in view and out of view. + * + * Example usage: these changes are sent to the LocalStore by the View (via the + * SyncEngine) and are used to pin / unpin documents as appropriate. + */ +class LocalViewChanges { + public: + static LocalViewChanges FromViewSnapshot(const core::ViewSnapshot& snapshot, + 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)) { + } + + /** The batch ID of the local write. */ + model::TargetId target_id() const { + 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_; + } + + const model::DocumentKeySet& removed_keys() const { + return removed_keys_; + } + + private: + model::TargetId target_id_ = 0; + bool from_cache_ = false; + model::DocumentKeySet added_keys_; + model::DocumentKeySet removed_keys_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_VIEW_CHANGES_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h new file mode 100644 index 0000000..0adf510 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h @@ -0,0 +1,57 @@ +/* + * 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_WRITE_RESULT_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_WRITE_RESULT_H_ + +#include + +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** The result of a write to the local store. */ +class LocalWriteResult { + public: + LocalWriteResult(model::BatchId batch_id, model::DocumentMap&& changes) + : batch_id_(batch_id), changes_(std::move(changes)) { + } + + LocalWriteResult() = default; + + /** The batch ID of the local write. */ + model::BatchId batch_id() const { + return batch_id_; + } + + /** The document changes resulting from the local write. */ + const model::DocumentMap& changes() const { + return changes_; + } + + private: + model::BatchId batch_id_; + model::DocumentMap changes_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_WRITE_RESULT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc new file mode 100644 index 0000000..03f191f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc @@ -0,0 +1,225 @@ +/* + * 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/lru_garbage_collector.h" + +#include // NOLINT(build/c++11) +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/timestamp.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 api::Settings; +using model::DocumentKey; +using model::ListenSequenceNumber; +using model::TargetId; +using util::StatusOr; + +using Millis = std::chrono::milliseconds; + +static Millis::rep MillisecondsBetween(const Timestamp& start, + const Timestamp& end) { + return std::chrono::duration_cast(end.ToTimePoint() - + start.ToTimePoint()) + .count(); +} + +/** + * RollingSequenceNumberBuffer tracks the nth sequence number in a series. + * Sequence numbers may be added out of order. + */ +class RollingSequenceNumberBuffer { + public: + explicit RollingSequenceNumberBuffer(size_t max_elements) + : queue_(std::priority_queue()), + max_elements_(max_elements) { + } + + RollingSequenceNumberBuffer(const RollingSequenceNumberBuffer& other) = + delete; + + void AddElement(ListenSequenceNumber sequence_number) { + if (queue_.size() < max_elements_) { + queue_.push(sequence_number); + } else { + ListenSequenceNumber highest_value = queue_.top(); + if (sequence_number < highest_value) { + queue_.pop(); + queue_.push(sequence_number); + } + } + } + + ListenSequenceNumber max_value() const { + return queue_.top(); + } + + size_t size() const { + return queue_.size(); + } + + private: + std::priority_queue queue_; + const size_t max_elements_; +}; + +} // namespace + +const ListenSequenceNumber kListenSequenceNumberInvalid = -1; + +LruParams LruParams::Default() { + return LruParams{100 * 1024 * 1024, 10, 1000}; +} + +LruParams LruParams::Disabled() { + return LruParams{api::Settings::CacheSizeUnlimited, 0, 0}; +} + +LruParams LruParams::WithCacheSize(int64_t cache_size) { + LruParams params = Default(); + params.min_bytes_threshold = cache_size; + return params; +} + +LruGarbageCollector::LruGarbageCollector(LruDelegate* delegate, + LruParams params) + : 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(); + } + + 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( + "Garbage collection skipped; Cache size %s is lower than threshold %s", + current_size, params_.min_bytes_threshold); + return LruResults::DidNotRun(); + } + + LOG_DEBUG("Running garbage collection on cache of size: %s", current_size); + return RunGarbageCollection(live_targets); +} + +LruResults LruGarbageCollector::RunGarbageCollection( + const LiveQueryMap& live_targets) { + Timestamp start = Timestamp::Now(); + + // Cap at the configured max + int sequence_numbers = QueryCountForPercentile(params_.percentile_to_collect); + if (sequence_numbers > params_.maximum_sequence_numbers_to_collect) { + sequence_numbers = params_.maximum_sequence_numbers_to_collect; + } + Timestamp counted_targets = Timestamp::Now(); + + ListenSequenceNumber upper_bound = + SequenceNumberForQueryCount(sequence_numbers); + Timestamp found_upper_bound = Timestamp::Now(); + + int num_targets_removed = RemoveTargets(upper_bound, live_targets); + Timestamp removed_targets = Timestamp::Now(); + + int num_documents_removed = RemoveOrphanedDocuments(upper_bound); + Timestamp removed_documents = Timestamp::Now(); + + std::string desc = "LRU Garbage Collection:\n"; + absl::StrAppend(&desc, "\tCounted targets in ", + MillisecondsBetween(start, counted_targets), "ms\n"); + absl::StrAppend(&desc, "\tDetermined least recently used ", sequence_numbers, + " sequence numbers in ", + MillisecondsBetween(counted_targets, found_upper_bound), + "ms\n"); + absl::StrAppend(&desc, "\tRemoved ", num_targets_removed, " targets in ", + MillisecondsBetween(found_upper_bound, removed_targets), + "ms\n"); + absl::StrAppend(&desc, "\tRemoved ", num_documents_removed, " documents in ", + MillisecondsBetween(removed_targets, removed_documents), + "ms\n"); + absl::StrAppend(&desc, "Total duration: ", + MillisecondsBetween(start, removed_documents), "ms"); + LOG_DEBUG(desc.c_str()); + + return LruResults{/* did_run= */ true, sequence_numbers, num_targets_removed, + num_documents_removed}; +} + +int LruGarbageCollector::QueryCountForPercentile(int percentile) { + size_t total_count = delegate_->GetSequenceNumberCount(); + return static_cast((percentile / 100.0f) * total_count); +} + +ListenSequenceNumber LruGarbageCollector::SequenceNumberForQueryCount( + int query_count) { + if (query_count == 0) { + return kListenSequenceNumberInvalid; + } + + RollingSequenceNumberBuffer buffer(query_count); + + delegate_->EnumerateTargetSequenceNumbers( + [&buffer](ListenSequenceNumber sequence_number) { + buffer.AddElement(sequence_number); + }); + + delegate_->EnumerateOrphanedDocuments( + [&buffer](const DocumentKey&, ListenSequenceNumber sequence_number) { + buffer.AddElement(sequence_number); + }); + + return buffer.max_value(); +} + +int LruGarbageCollector::RemoveTargets(ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries) { + return delegate_->RemoveTargets(sequence_number, live_queries); +} + +int LruGarbageCollector::RemoveOrphanedDocuments( + ListenSequenceNumber sequence_number) { + return delegate_->RemoveOrphanedDocuments(sequence_number); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h new file mode 100644 index 0000000..0809c14 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h @@ -0,0 +1,163 @@ +/* + * 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_LRU_GARBAGE_COLLECTOR_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LRU_GARBAGE_COLLECTOR_H_ + +#include + +#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; + +struct LruParams { + static LruParams Default(); + + static LruParams Disabled(); + + static LruParams WithCacheSize(int64_t cache_size); + + int64_t min_bytes_threshold; + int percentile_to_collect; + int maximum_sequence_numbers_to_collect; +}; + +struct LruResults { + static LruResults DidNotRun() { + return LruResults{/* did_run= */ false, 0, 0, 0}; + } + + bool did_run; + int sequence_numbers_collected; + int targets_removed; + int documents_removed; +}; + +using LiveQueryMap = std::unordered_map; + +/** + * Persistence layers intending to use LRU Garbage collection should implement + * this interface. This interface defines the operations that the LRU garbage + * collector needs from the persistence layer. + */ +class LruDelegate : public ReferenceDelegate { + public: + virtual ~LruDelegate() = default; + + /** Access to the underlying LRU Garbage collector instance. */ + virtual LruGarbageCollector* garbage_collector() = 0; + + virtual util::StatusOr CalculateByteSize() = 0; + + /** Returns the number of targets and orphaned documents cached. */ + virtual size_t GetSequenceNumberCount() = 0; + + /** + * Enumerates the sequence numbers of all the targets that the delegate is + * aware of. This is typically all sequence numbers in an TargetCache. + */ + virtual void EnumerateTargetSequenceNumbers( + const SequenceNumberCallback& callback) = 0; + + /** + * Enumerates all of the outstanding mutations. + */ + virtual void EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) = 0; + + /** + * Removes all unreferenced documents from the cache that have a sequence + * number less than or equal to the given sequence number. Returns the number + * of documents removed. + */ + virtual int RemoveOrphanedDocuments( + model::ListenSequenceNumber sequence_number) = 0; + + /** + * Removes all targets that are not currently being listened to and have a + * sequence number less than or equal to the given sequence number. Returns + * the number of targets removed. + */ + virtual int RemoveTargets(model::ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries) = 0; +}; + +/** + * LruGarbageCollector defines the LRU algorithm used to clean up old documents + * and targets. It is persistence-agnostic, as long as proper delegate is + * provided. + */ +class LruGarbageCollector { + public: + LruGarbageCollector(LruDelegate* delegate, LruParams params); + + util::StatusOr CalculateByteSize() const; + + /** + * Given a target percentile, return the number of queries that make up that + * percentage of the queries that are cached. For instance, if 20 queries are + * cached, and the percentile is 40, the result will be 8. + */ + int QueryCountForPercentile(int percentile); + + /** + * Given a number of queries n, return the nth sequence number in the cache. + */ + model::ListenSequenceNumber SequenceNumberForQueryCount(int query_count); + + /** + * Removes queries that are not currently live (as indicated by presence in + * the live_queries map) and have a sequence number less than or equal to the + * given sequence number. + */ + int RemoveTargets(model::ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries); + + /** + * Removes all unreferenced documents from the cache that have a sequence + * number less than or equal to the given sequence number. Returns the number + * of documents removed. + */ + int RemoveOrphanedDocuments(model::ListenSequenceNumber sequence_number); + + local::LruResults Collect(const LiveQueryMap& live_targets); + + private: + LruResults RunGarbageCollection(const LiveQueryMap& live_targets); + + // Delegate owns the LruGarbageCollector; this is a back pointer. + LruDelegate* delegate_; + + LruParams params_ = LruParams::Default(); +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LRU_GARBAGE_COLLECTOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.cc new file mode 100644 index 0000000..6637afb --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.cc @@ -0,0 +1,56 @@ +/* + * Copyright 2021 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/memory_bundle_cache.h" + +#include + +namespace firebase { +namespace firestore { +namespace local { + +using bundle::BundleMetadata; +using bundle::NamedQuery; + +absl::optional MemoryBundleCache::GetBundleMetadata( + const std::string& bundle_id) const { + auto got = bundles_.find(bundle_id); + if (got == bundles_.end()) { + return absl::nullopt; + } + return absl::make_optional(got->second); +} + +void MemoryBundleCache::SaveBundleMetadata(const BundleMetadata& metadata) { + bundles_[metadata.bundle_id()] = metadata; +} + +absl::optional MemoryBundleCache::GetNamedQuery( + const std::string& query_name) const { + auto got = named_queries_.find(query_name); + if (got == named_queries_.end()) { + return absl::nullopt; + } + return absl::make_optional(got->second); +} + +void MemoryBundleCache::SaveNamedQuery(const NamedQuery& query) { + named_queries_[query.query_name()] = query; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.h new file mode 100644 index 0000000..2d9e999 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_bundle_cache.h @@ -0,0 +1,53 @@ +/* + * Copyright 2021 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_BUNDLE_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_BUNDLE_CACHE_H_ + +#include +#include + +#include "Firestore/core/src/bundle/bundle_metadata.h" +#include "Firestore/core/src/bundle/named_query.h" +#include "Firestore/core/src/local/bundle_cache.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace local { + +class MemoryBundleCache : public BundleCache { + public: + absl::optional GetBundleMetadata( + const std::string& bundle_id) const override; + + void SaveBundleMetadata(const bundle::BundleMetadata& metadata) override; + + absl::optional GetNamedQuery( + const std::string& query_name) const override; + + void SaveNamedQuery(const bundle::NamedQuery& query) override; + + private: + std::unordered_map bundles_; + std::unordered_map named_queries_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_BUNDLE_CACHE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.cc new file mode 100644 index 0000000..6134689 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.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_eager_reference_delegate.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 { +namespace local { + +using model::DocumentKey; +using model::ListenSequenceNumber; + +MemoryEagerReferenceDelegate::MemoryEagerReferenceDelegate( + MemoryPersistence* persistence) + : persistence_(persistence) { +} + +ListenSequenceNumber MemoryEagerReferenceDelegate::current_sequence_number() + const { + return kListenSequenceNumberInvalid; +} + +void MemoryEagerReferenceDelegate::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 MemoryEagerReferenceDelegate::RemoveTarget(const TargetData& target_data) { + for (const DocumentKey& doc_key : + persistence_->target_cache()->GetMatchingKeys(target_data.target_id())) { + orphaned_->insert(doc_key); + } + persistence_->target_cache()->RemoveTarget(target_data); +} + +void MemoryEagerReferenceDelegate::AddReference(const DocumentKey& key) { + orphaned_->erase(key); +} + +void MemoryEagerReferenceDelegate::RemoveReference(const DocumentKey& key) { + orphaned_->insert(key); +} + +void MemoryEagerReferenceDelegate::RemoveMutationReference( + const DocumentKey& key) { + orphaned_->insert(key); +} + +bool MemoryEagerReferenceDelegate::IsReferenced(const DocumentKey& key) const { + if (persistence_->target_cache()->Contains(key)) { + return true; + } + if (MutationQueuesContainKey(key)) { + return true; + } + if (additional_references_ && additional_references_->ContainsKey(key)) { + return true; + } + return false; +} + +void MemoryEagerReferenceDelegate::UpdateLimboDocument(const DocumentKey& key) { + if (IsReferenced(key)) { + orphaned_->erase(key); + } else { + orphaned_->insert(key); + } +} + +void MemoryEagerReferenceDelegate::OnTransactionStarted(absl::string_view) { + // Constructs the unordered map, in place, with no arguments. + orphaned_.emplace(); +} + +void MemoryEagerReferenceDelegate::OnTransactionCommitted() { + for (const auto& key : *orphaned_) { + if (!IsReferenced(key)) { + persistence_->remote_document_cache()->Remove(key); + } + } + orphaned_.reset(); +} + +bool MemoryEagerReferenceDelegate::MutationQueuesContainKey( + const DocumentKey& key) const { + const auto& queues = persistence_->mutation_queues(); + for (const auto& entry : queues) { + if (entry.second->ContainsKey(key)) { + return true; + } + } + return false; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h new file mode 100644 index 0000000..105ada3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h @@ -0,0 +1,73 @@ +/* + * 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_MEMORY_EAGER_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ + +#include +#include + +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/model/document_key.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace local { + +class MemoryPersistence; + +/** + * Provides the eager GC implementation for memory persistence. + */ +class MemoryEagerReferenceDelegate : public ReferenceDelegate { + public: + explicit MemoryEagerReferenceDelegate(MemoryPersistence* persistence); + + model::ListenSequenceNumber current_sequence_number() const override; + + void AddInMemoryPins(ReferenceSet* set) override; + + void AddReference(const model::DocumentKey& key) override; + void RemoveReference(const model::DocumentKey& key) override; + void RemoveMutationReference(const model::DocumentKey& key) override; + void RemoveTarget(const TargetData& target_data) override; + + void UpdateLimboDocument(const model::DocumentKey& key) override; + + void OnTransactionStarted(absl::string_view label) override; + void OnTransactionCommitted() override; + + private: + bool IsReferenced(const model::DocumentKey& key) const; + + bool MutationQueuesContainKey(const model::DocumentKey& key) const; + + absl::optional> + orphaned_; + + // This instance is owned by MemoryPersistence. + MemoryPersistence* persistence_ = nullptr; + + // The ReferenceSet is owned by LocalStore. + ReferenceSet* additional_references_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc new file mode 100644 index 0000000..d8ec923 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc @@ -0,0 +1,67 @@ +/* + * 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_index_manager.h" + +#include +#include +#include +#include + +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace local { + +using model::ResourcePath; + +bool MemoryCollectionParentIndex::Add(const ResourcePath& collection_path) { + HARD_ASSERT(collection_path.size() % 2 == 1, "Expected a collection path."); + + std::string collection_id = collection_path.last_segment(); + ResourcePath parent_path = collection_path.PopLast(); + std::set& existing_parents = index_[collection_id]; + bool inserted = existing_parents.insert(parent_path).second; + return inserted; +} + +std::vector MemoryCollectionParentIndex::GetEntries( + const std::string& collection_id) const { + std::vector result; + auto found = index_.find(collection_id); + if (found != index_.end()) { + const std::set& parent_paths = found->second; + std::copy(parent_paths.begin(), parent_paths.end(), + std::back_inserter(result)); + } + return result; +} + +void MemoryIndexManager::AddToCollectionParentIndex( + const ResourcePath& collection_path) { + collection_parents_index_.Add(collection_path); +} + +std::vector MemoryIndexManager::GetCollectionParents( + const std::string& collection_id) { + return collection_parents_index_.GetEntries(collection_id); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h new file mode 100644 index 0000000..f3f7bef --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h @@ -0,0 +1,65 @@ +/* + * 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_MEMORY_INDEX_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_INDEX_MANAGER_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/local/index_manager.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** + * Internal implementation of the collection-parent index. Also used for + * in-memory caching by LevelDbIndexManager and initial index population during + * schema migration. + */ +class MemoryCollectionParentIndex { + public: + // Returns false if the entry already existed. + bool Add(const model::ResourcePath& collection_path); + + std::vector GetEntries( + const std::string& collection_id) const; + + private: + std::unordered_map> index_; +}; + +/** An in-memory implementation of IndexManager. */ +class MemoryIndexManager : public IndexManager { + public: + void AddToCollectionParentIndex( + const model::ResourcePath& collection_path) override; + + std::vector GetCollectionParents( + const std::string& collection_id) override; + + private: + MemoryCollectionParentIndex collection_parents_index_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_INDEX_MANAGER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc new file mode 100644 index 0000000..f39d44c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc @@ -0,0 +1,194 @@ +/* + * 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_lru_reference_delegate.h" + +#include + +#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 { +namespace local { + +using model::DocumentKey; +using model::ListenSequenceNumber; +using util::StatusOr; + +MemoryLruReferenceDelegate::MemoryLruReferenceDelegate( + MemoryPersistence* persistence, + LruParams lru_params, + std::unique_ptr sizer) + : persistence_(persistence), + sizer_(std::move(sizer)), + gc_(this, lru_params) { + // Theoretically this is always 0, since this is all in-memory... + ListenSequenceNumber highest_sequence_number = + persistence_->target_cache()->highest_listen_sequence_number(); + listen_sequence_ = absl::make_unique(highest_sequence_number); +} + +LruGarbageCollector* MemoryLruReferenceDelegate::garbage_collector() { + return &gc_; +} + +ListenSequenceNumber MemoryLruReferenceDelegate::current_sequence_number() + const { + HARD_ASSERT(current_sequence_number_ != kListenSequenceNumberInvalid, + "Asking for a sequence number outside of a transaction"); + return current_sequence_number_; +} + +void MemoryLruReferenceDelegate::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 MemoryLruReferenceDelegate::RemoveTarget(const TargetData& target_data) { + TargetData updated = target_data.WithSequenceNumber(current_sequence_number_); + persistence_->target_cache()->UpdateTarget(updated); +} + +void MemoryLruReferenceDelegate::UpdateLimboDocument( + const model::DocumentKey& key) { + sequence_numbers_[key] = current_sequence_number_; +} + +void MemoryLruReferenceDelegate::OnTransactionStarted(absl::string_view) { + current_sequence_number_ = listen_sequence_->Next(); +} + +void MemoryLruReferenceDelegate::OnTransactionCommitted() { + current_sequence_number_ = kListenSequenceNumberInvalid; +} + +void MemoryLruReferenceDelegate::EnumerateTargetSequenceNumbers( + const SequenceNumberCallback& callback) { + return persistence_->target_cache()->EnumerateSequenceNumbers(callback); +} + +void MemoryLruReferenceDelegate::EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) { + for (const auto& entry : sequence_numbers_) { + const DocumentKey& key = entry.first; + ListenSequenceNumber sequence_number = entry.second; + // Pass in the exact sequence number as the upper bound so we know it won't + // be pinned by being too recent. + if (!IsPinnedAtSequenceNumber(sequence_number, key)) { + callback(key, sequence_number); + } + } +} + +size_t MemoryLruReferenceDelegate::GetSequenceNumberCount() { + size_t total_count = persistence_->target_cache()->size(); + EnumerateOrphanedDocuments( + [&total_count](const DocumentKey&, ListenSequenceNumber) { + total_count++; + }); + return total_count; +} + +int MemoryLruReferenceDelegate::RemoveTargets( + model::ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries) { + return static_cast(persistence_->target_cache()->RemoveTargets( + sequence_number, live_queries)); +} + +int MemoryLruReferenceDelegate::RemoveOrphanedDocuments( + model::ListenSequenceNumber upper_bound) { + std::vector removed = + persistence_->remote_document_cache()->RemoveOrphanedDocuments( + this, upper_bound); + for (const auto& key : removed) { + sequence_numbers_.erase(key); + } + return static_cast(removed.size()); +} + +void MemoryLruReferenceDelegate::AddReference(const DocumentKey& key) { + sequence_numbers_[key] = current_sequence_number_; +} + +void MemoryLruReferenceDelegate::RemoveReference(const DocumentKey& key) { + sequence_numbers_[key] = current_sequence_number_; +} + +bool MemoryLruReferenceDelegate::MutationQueuesContainKey( + const DocumentKey& key) const { + const auto& queues = persistence_->mutation_queues(); + for (const auto& entry : queues) { + if (entry.second->ContainsKey(key)) { + return true; + } + } + return false; +} + +void MemoryLruReferenceDelegate::RemoveMutationReference( + const DocumentKey& key) { + sequence_numbers_[key] = current_sequence_number_; +} + +bool MemoryLruReferenceDelegate::IsPinnedAtSequenceNumber( + ListenSequenceNumber upper_bound, const DocumentKey& key) const { + if (MutationQueuesContainKey(key)) { + return true; + } + if (additional_references_ && additional_references_->ContainsKey(key)) { + return true; + } + if (persistence_->target_cache()->Contains(key)) { + return true; + } + + auto it = sequence_numbers_.find(key); + if (it != sequence_numbers_.end() && it->second > upper_bound) { + return true; + } + return false; +} + +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_->target_cache()->CalculateByteSize(*sizer_); + count += persistence_->remote_document_cache()->CalculateByteSize(*sizer_); + const auto& queues = persistence_->mutation_queues(); + for (const auto& entry : queues) { + count += entry.second->CalculateByteSize(*sizer_); + } + return count; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h new file mode 100644 index 0000000..04b96be --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h @@ -0,0 +1,114 @@ +/* + * 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_MEMORY_LRU_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ + +#include +#include +#include + +#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 { +namespace local { + +class ListenSequence; +class MemoryPersistence; +class Sizer; + +/** + * Provides the LRU GC implementation for memory persistence. + */ +class MemoryLruReferenceDelegate : public LruDelegate { + public: + MemoryLruReferenceDelegate(MemoryPersistence* persistence, + LruParams lru_params, + std::unique_ptr sizer); + + bool IsPinnedAtSequenceNumber(model::ListenSequenceNumber upper_bound, + const model::DocumentKey& key) const; + + // MARK: ReferenceDelegate overrides + + model::ListenSequenceNumber current_sequence_number() const override; + + void AddInMemoryPins(ReferenceSet* set) override; + + void AddReference(const model::DocumentKey& key) override; + void RemoveReference(const model::DocumentKey& key) override; + void RemoveMutationReference(const model::DocumentKey& key) override; + void RemoveTarget(const TargetData& target_data) override; + + void UpdateLimboDocument(const model::DocumentKey& key) override; + + void OnTransactionStarted(absl::string_view label) override; + void OnTransactionCommitted() override; + + // MARK: LruDelegate overrides + + LruGarbageCollector* garbage_collector() override; + + util::StatusOr CalculateByteSize() override; + size_t GetSequenceNumberCount() override; + + void EnumerateTargetSequenceNumbers( + const SequenceNumberCallback& callback) override; + void EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) override; + + int RemoveOrphanedDocuments(model::ListenSequenceNumber upper_bound) override; + int RemoveTargets(model::ListenSequenceNumber sequence_number, + const LiveQueryMap& live_queries) override; + + private: + bool MutationQueuesContainKey(const model::DocumentKey& key) const; + + // This instance is owned by MemoryPersistence. + MemoryPersistence* persistence_ = nullptr; + + std::unique_ptr sizer_; + + LruGarbageCollector gc_; + + // Tracks sequence numbers of when documents are used. Equivalent to sentinel + // rows in the leveldb implementation. + std::unordered_map + sequence_numbers_; + + // This ReferenceSet is owned by LocalStore. + ReferenceSet* additional_references_ = nullptr; + + // This needs to be a pointer because initialization is delayed until after + // we read from the target cache. + std::unique_ptr listen_sequence_; + + // The current sequence number for the currently active transaction. If no + // transaction is active, resets back to kListenSequenceNumberInvalid. + model::ListenSequenceNumber current_sequence_number_ = + kListenSequenceNumberInvalid; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.cc new file mode 100644 index 0000000..165a435 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h new file mode 100644 index 0000000..1b3f84b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h @@ -0,0 +1,149 @@ +/* + * 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_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/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 { +namespace local { + +class MemoryPersistence; +class Sizer; + +class MemoryMutationQueue : public MutationQueue { + public: + explicit MemoryMutationQueue(MemoryPersistence* persistence); + + 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 { + return queue_; + } + + 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; + + bool ContainsKey(const model::DocumentKey& key); + + int64_t CalculateByteSize(const Sizer& sizer); + + nanopb::ByteString GetLastStreamToken() override; + void SetLastStreamToken(nanopb::ByteString token) override; + + private: + using DocumentKeyReferenceSet = + immutable::SortedSet; + + std::vector AllMutationBatchesWithIds( + const std::set& batch_ids); + + /** + * Finds the index of the given batch_id in the mutation queue. This operation + * is O(1). + * + * @return The computed index of the batch with the given BatchID, based on + * the state of the queue. Note this index can negative if the requested + * BatchID has already been removed from the queue or past the end of the + * queue if the BatchID is larger than the last added batch. + */ + int IndexOfBatchId(model::BatchId batch_id); + + // This instance is owned by MemoryPersistence. + MemoryPersistence* persistence_; + + /** + * A FIFO queue of all mutations to apply to the backend. Mutations are added + * to the end of the queue as they're written, and removed from the front of + * the queue as the mutations become visible or are rejected. + * + * When successfully applied, mutations must be acknowledged by the write + * stream and made visible on the watch stream. It's possible for the watch + * stream to fall behind in which case the batches at the head of the queue + * will be acknowledged but held until the watch stream sees the changes. + * + * If a batch is rejected while there are held write acknowledgements at the + * head of the queue the rejected batch is converted to a tombstone: its + * mutations are removed but the batch remains in the queue. This maintains a + * simple consecutive ordering of batches in the queue. + * + * Once the held write acknowledgements become visible they are removed from + * the head of the queue along with any tombstones that follow. + */ + std::vector queue_; + + /** + * The next value to use when assigning sequential IDs to each mutation + * batch. + */ + model::BatchId next_batch_id_ = 1; + + /** + * The last received stream token from the server, used to acknowledge which + * responses the client has processed. Stream tokens are opaque checkpoint + * markers whose only real value is their inclusion in the next request. + */ + nanopb::ByteString last_stream_token_; + + /** An ordered mapping between documents and the mutation batch IDs. */ + DocumentKeyReferenceSet batches_by_document_key_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_MUTATION_QUEUE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc new file mode 100644 index 0000000..2e6db17 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc @@ -0,0 +1,122 @@ +/* + * 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/credentials/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 credentials::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_; +} + +MemoryBundleCache* MemoryPersistence::bundle_cache() { + return &bundle_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h new file mode 100644 index 0000000..c8955a7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h @@ -0,0 +1,131 @@ +/* + * 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_MEMORY_PERSISTENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_PERSISTENCE_H_ + +#include +#include +#include +#include +#include + +#include "Firestore/core/src/credentials/user.h" +#include "Firestore/core/src/local/memory_bundle_cache.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 { +namespace local { + +struct LruParams; +class MemoryIndexManager; +class MemoryMutationQueue; +class MemoryRemoteDocumentCache; +class MemoryTargetCache; +class MutationQueue; +class TargetCache; +class ReferenceDelegate; +class RemoteDocumentCache; +class Sizer; + +/** + * An in-memory implementation of the Persistence interface. Values are stored + * only in RAM and are never persisted to any durable storage. + */ +class MemoryPersistence : public Persistence { + public: + using MutationQueues = + std::unordered_map, + credentials::HashUser>; + + static std::unique_ptr WithEagerGarbageCollector(); + + static std::unique_ptr WithLruGarbageCollector( + LruParams params, std::unique_ptr sizer); + + ~MemoryPersistence() override; + + const MutationQueues& mutation_queues() const { + return mutation_queues_; + } + + // MARK: Persistence overrides + + model::ListenSequenceNumber current_sequence_number() const override; + + void Shutdown() override; + + MemoryMutationQueue* GetMutationQueueForUser( + const credentials::User& user) override; + + MemoryTargetCache* target_cache() override; + + MemoryBundleCache* bundle_cache() override; + + MemoryRemoteDocumentCache* remote_document_cache() override; + + MemoryIndexManager* index_manager() override; + + ReferenceDelegate* reference_delegate() override; + + protected: + void RunInternal(absl::string_view label, + std::function block) override; + + private: + MemoryPersistence(); + + void set_reference_delegate(std::unique_ptr delegate); + + MutationQueues mutation_queues_; + + /** + * 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 + * a new LocalStore wrapping this Persistence instance and this will make + * the in-memory persistence layer behave as if it were actually persisting + * values. + */ + MemoryTargetCache target_cache_; + + /** + * The RemoteDocumentCache representing the persisted cache of remote + * documents. + */ + MemoryRemoteDocumentCache remote_document_cache_; + + MemoryIndexManager index_manager_; + + MemoryBundleCache bundle_cache_; + + std::unique_ptr reference_delegate_; + + bool started_ = false; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_PERSISTENCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc new file mode 100644 index 0000000..2df5d47 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc @@ -0,0 +1,140 @@ +/* + * 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.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::ListenSequenceNumber; +using model::MutableDocument; +using model::MutableDocumentMap; +using model::SnapshotVersion; + +MemoryRemoteDocumentCache::MemoryRemoteDocumentCache( + MemoryPersistence* persistence) { + persistence_ = persistence; +} + +void MemoryRemoteDocumentCache::Add(const MutableDocument& document, + const model::SnapshotVersion& read_time) { + // Note: We create an explicit copy to prevent further modifications. + 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); +} + +MutableDocument MemoryRemoteDocumentCache::Get(const DocumentKey& key) { + const auto& entry = docs_.get(key); + // Note: We create an explicit copy to prevent modifications of the backing + // data. + return entry ? entry->first.Clone() : MutableDocument::InvalidDocument(key); +} + +MutableDocumentMap MemoryRemoteDocumentCache::GetAll( + const DocumentKeySet& keys) { + MutableDocumentMap 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; +} + +MutableDocumentMap MemoryRemoteDocumentCache::GetMatching( + const Query& query, const SnapshotVersion& since_read_time) { + HARD_ASSERT( + !query.IsCollectionGroupQuery(), + "CollectionGroup queries should be handled in LocalDocumentsView"); + + MutableDocumentMap 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 MutableDocument& document = it->second.first; + if (!document.is_found_document()) { + continue; + } + + const SnapshotVersion& read_time = it->second.second; + if (read_time <= since_read_time) { + continue; + } + + if (!query.Matches(document)) { + continue; + } + + // Note: We create an explicit copy to prevent modifications or the backing + // data. + results = results.insert(key, document.Clone()); + } + 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 MutableDocument& document = kv.second.first; + count += sizer.CalculateByteSize(document); + } + return count; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h new file mode 100644 index 0000000..15cdb9c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h @@ -0,0 +1,73 @@ +/* + * 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/model_fwd.h" +#include "Firestore/core/src/model/mutable_document.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::MutableDocument& document, + const model::SnapshotVersion& read_time) override; + void Remove(const model::DocumentKey& key) override; + + model::MutableDocument Get(const model::DocumentKey& key) override; + model::MutableDocumentMap GetAll(const model::DocumentKeySet& keys) override; + model::MutableDocumentMap 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< + model::DocumentKey, + std::pair> + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc new file mode 100644 index 0000000..49b1e69 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc @@ -0,0 +1,146 @@ +/* + * 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::EnumerateSequenceNumbers( + const SequenceNumberCallback& callback) { + for (const auto& kv : targets_) { + callback(kv.second.sequence_number()); + } +} + +size_t 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 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); +} + +void MemoryTargetCache::RemoveMatchingKeysForTarget(model::TargetId target_id) { + references_.RemoveReferences(target_id); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h new file mode 100644 index 0000000..0c33b8a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h @@ -0,0 +1,116 @@ +/* + * 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 EnumerateSequenceNumbers( + const SequenceNumberCallback& callback) override; + + size_t 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; + + void RemoveMatchingKeysForTarget(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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h new file mode 100644 index 0000000..00bcd1b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h @@ -0,0 +1,177 @@ +/* + * 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_MUTATION_QUEUE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MUTATION_QUEUE_H_ + +#include + +#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() = default; + + /** + * Starts the mutation queue, performing any initial reads that might be + * required to establish invariants, etc. + */ + virtual void Start() = 0; + + /** Returns true if this queue contains no mutation batches. */ + virtual bool IsEmpty() = 0; + + /** Acknowledges the given batch. */ + virtual void AcknowledgeBatch(const model::MutationBatch& batch, + const nanopb::ByteString& stream_token) = 0; + + /** + * Creates a new mutation batch and adds it to this mutation queue. + * + * @param local_write_time The original write time of this mutation. + * @param base_mutations Mutations that are used to populate the base values + * when this mutation is applied locally. These mutations are used to locally + * overwrite values that are persisted in the remote document cache. + * @param mutations The user-provided mutations in this mutation batch. + */ + virtual model::MutationBatch AddMutationBatch( + const Timestamp& local_write_time, + std::vector&& base_mutations, + std::vector&& mutations) = 0; + + /** + * Removes the given mutation batch from the queue. This is useful in two + * circumstances: + * + * + Removing applied mutations from the head of the queue + * + Removing rejected mutations from anywhere in the queue + */ + virtual void RemoveMutationBatch(const model::MutationBatch& batch) = 0; + + /** Gets all mutation batches in the mutation queue. */ + // TODO(mikelehen): PERF: Current consumer only needs mutated keys; if we can + // provide that cheaply, we should replace this. + virtual std::vector AllMutationBatches() = 0; + + /** + * Finds all mutation batches that could @em possibly affect the given + * document keys. Not all mutations in a batch will necessarily affect each + * key, so when looping through the batches you'll need to check that the + * mutation itself matches the key. + * + * Note that because of this requirement implementations are free to return + * mutation batches that don't contain any of the given document keys at all + * if it's convenient. + */ + // TODO(mcg): This should really return an iterator + virtual std::vector + AllMutationBatchesAffectingDocumentKeys( + const model::DocumentKeySet& document_keys) = 0; + + /** + * Finds all mutation batches that could @em possibly affect the given + * document key. Not all mutations in a batch will necessarily affect the + * document key, so when looping through the batch you'll need to check that + * the mutation itself matches the key. + * + * Note that because of this requirement implementations are free to return + * mutation batches that don't contain the document key at all if it's + * convenient. + */ + // TODO(mcg): This should really return an iterator + virtual std::vector + AllMutationBatchesAffectingDocumentKey(const model::DocumentKey& key) = 0; + + /** + * Finds all mutation batches that could affect the results for the given + * query. Not all mutations in a batch will necessarily affect the query, so + * when looping through the batch you'll need to check that the mutation + * itself matches the query. + * + * Note that because of this requirement implementations are free to return + * mutation batches that don't match the query at all if it's convenient. + * + * NOTE: A PatchMutation does not need to include all fields in the query + * filter criteria in order to be a match (but any fields it does contain do + * need to match). + */ + // TODO(mikelehen): This should perhaps return an iterator, though I'm not + // sure we can avoid loading them all in memory. + virtual std::vector AllMutationBatchesAffectingQuery( + const core::Query& query) = 0; + + /** Loads the mutation batch with the given batch_id. */ + virtual absl::optional LookupMutationBatch( + model::BatchId batch_id) = 0; + + /** + * Gets the first unacknowledged mutation batch after the passed in batch_id + * in the mutation queue or nil if empty. + * + * @param batch_id The batch to search after, or kBatchIdUnknown for the first + * mutation in the queue. + * + * @return the next mutation or nil if there wasn't one. + */ + virtual absl::optional NextMutationBatchAfterBatchId( + model::BatchId batch_id) = 0; + + /** + * Gets the largest (latest) batch id in mutation queue for the current user + * that is pending server response, returns `kBatchIdUnknown` if the queue + * is empty. + * + * @return the largest batch id in the mutation queue that is not + * acknowledged. + */ + virtual model::BatchId GetHighestUnacknowledgedBatchId() = 0; + + /** + * Performs a consistency check, examining the mutation queue for any leaks, + * if possible. + */ + virtual void PerformConsistencyCheck() = 0; + + /** Returns the current stream token for this mutation queue. */ + virtual nanopb::ByteString GetLastStreamToken() = 0; + + /** Sets the stream token for this mutation queue. */ + virtual void SetLastStreamToken(nanopb::ByteString stream_token) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MUTATION_QUEUE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h new file mode 100644 index 0000000..464876a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h @@ -0,0 +1,169 @@ +/* + * 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_PERSISTENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_PERSISTENCE_H_ + +#include +#include + +#include "Firestore/core/src/model/types.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace credentials { + +class User; + +} // namespace credentials + +namespace local { + +class BundleCache; +class IndexManager; +class MutationQueue; +class ReferenceDelegate; +class RemoteDocumentCache; +class TargetCache; + +/** + * Persistence is the lowest-level shared interface to data storage in + * Firestore. + * + * Persistence creates MutationQueue and RemoteDocumentCache instances backed + * by some underlying storage mechanism (which might be in-memory or LevelDB). + * + * Persistence also exposes an API to run transactions against the backing + * store. All read and write operations must be wrapped in a transaction. + * Implementations of Persistence only need to guarantee that writes made + * against the transaction are not made to durable storage until the transaction + * commits. Since memory-only storage components do not alter durable storage, + * they are free to ignore the transaction. + * + * This contract is enough to allow the LocalStore to be written independently + * of whether or not the stored state actually is durably persisted. If a user + * enables persistent storage, writes are grouped together to avoid inconsistent + * state that could cause crashes. + * + * Concretely, when persistent storage is enabled, the durable versions of + * MutationQueue, RemoteDocumentCache, and others (the mutators) will group + * their writes in a transaction. Once the local store has completed one logical + * operation, it commits the transaction. + * + * When persistent storage is disabled, the non-durable versions of the mutators + * ignore the transaction. This short-cut is allowed because memory-only storage + * leaves no state so it cannot be inconsistent. + * + * This simplifies the implementations of the mutators and allows memory-only + * implementations to supplement the durable ones without requiring any special + * dual-store implementation of Persistence. The cost is that LocalStore needs + * to be slightly careful about the order of its reads and writes in order to + * avoid relying on being able to read back uncommitted writes. + */ +class Persistence { + public: + virtual ~Persistence() = default; + + virtual model::ListenSequenceNumber current_sequence_number() const = 0; + + /** Releases any resources held during eager shutdown. */ + virtual void Shutdown() = 0; + + /** + * Returns a MutationQueue representing the persisted mutations for the given + * user. + * + * Note: The implementation is free to return the same instance every time + * this is called for a given user. In particular, the memory-backed + * implementation does this to emulate the persisted implementation to the + * extent possible (e.g. in the case of UID switching from sally=>jack=>sally, + * sally's mutation queue will be preserved). + */ + virtual MutationQueue* GetMutationQueueForUser( + const credentials::User& user) = 0; + + /** Returns a TargetCache representing the persisted cache of queries. */ + virtual TargetCache* target_cache() = 0; + + /** + * Returns a BundleCache representing the persisted cache of loaded bundles. + */ + virtual BundleCache* bundle_cache() = 0; + + /** + * Returns a RemoteDocumentCache representing the persisted cache of remote + * documents. + */ + virtual RemoteDocumentCache* remote_document_cache() = 0; + + /** Returns an IndexManager that manages our persisted query indexes. */ + virtual IndexManager* index_manager() = 0; + + /** + * This property provides access to hooks around the document reference + * lifecycle. + */ + virtual ReferenceDelegate* reference_delegate() = 0; + + /** + * Accepts a function and runs it within a transaction. When called, a + * transaction will be started before a block is run, and committed after the + * block has executed. + * + * @param label A semi-unique name for the transaction, for logging. + * @param block A void-returning function to be executed within the + * transaction. + */ + template + auto Run(absl::string_view label, F block) -> + typename std::enable_if::value, + void>::type { + RunInternal(label, std::forward(block)); + } + + /** + * Accepts a function and runs it within a transaction. When called, a + * transaction will be started before a block is run, and committed after the + * block has executed. + * + * @param label A semi-unique name for the transaction, for logging. + * @param block A function to be executed within the transaction whose return + * value will be the result of the transaction. The type of the return + * value must be default constructible and copy- or move-assignable. + * @return The value returned from the invocation of `block`. + */ + template + auto Run(absl::string_view label, F block) -> + typename std::enable_if::value, + decltype(block())>::type { + decltype(block()) result; + + RunInternal(label, [&]() mutable { result = block(); }); + + return result; + } + + private: + virtual void RunInternal(absl::string_view label, + std::function block) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_PERSISTENCE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc new file mode 100644 index 0000000..5550d7a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc @@ -0,0 +1,55 @@ +/* + * 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/mutable_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::MutableDocument; + +ProtoSizer::ProtoSizer(LocalSerializer serializer) + : serializer_(std::move(serializer)) { +} + +int64_t ProtoSizer::CalculateByteSize(const MutableDocument& 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.h new file mode 100644 index 0000000..7b01eee --- /dev/null +++ b/SaraAttended/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::MutableDocument& 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.cc new file mode 100644 index 0000000..a45a298 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.cc @@ -0,0 +1,147 @@ +/* + * 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/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/mutable_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 model::Document; +using model::DocumentKeySet; +using model::DocumentMap; +using model::DocumentSet; +using model::MutableDocument; +using model::SnapshotVersion; + +DocumentMap QueryEngine::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 key-based + // lookups. 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); + } + + DocumentMap 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 QueryEngine::ApplyQuery(const Query& query, + const DocumentMap& 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 Document& doc = document_entry.second; + if (doc->is_found_document()) { + if (query.Matches(doc)) { + query_results = query_results.insert(doc); + } + } + } + return query_results; +} + +bool QueryEngine::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 QueryEngine::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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h new file mode 100644 index 0000000..5b23466 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h @@ -0,0 +1,102 @@ +/* + * 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_QUERY_ENGINE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_QUERY_ENGINE_H_ + +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { + +namespace core { +class Query; +enum class LimitType; +} // namespace core + +namespace local { + +class LocalDocumentsView; + +/** + * A query engine that takes advantage of the target document mapping in the + * TargetCache. Query execution is optimizes 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 + * query processing falls back to full scans. 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 QueryEngine { + public: + virtual ~QueryEngine() = default; + + /** + * Sets the document view to query against. + * + * The caller owns the LocalDocumentView and must ensure that it outlives the + * QueryEngine. + */ + virtual void SetLocalDocumentsView(LocalDocumentsView* local_documents) { + local_documents_view_ = local_documents; + } + + /** Returns all local documents matching the specified query. */ + model::DocumentMap GetDocumentsMatchingQuery( + const core::Query& query, + const model::SnapshotVersion& last_limbo_free_snapshot_version, + const model::DocumentKeySet& remote_keys); + + private: + /** Applies the query filter and sorting to the provided documents. */ + model::DocumentSet ApplyQuery(const core::Query& query, + const model::DocumentMap& 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_QUERY_ENGINE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_result.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/query_result.h new file mode 100644 index 0000000..bd879f3 --- /dev/null +++ b/SaraAttended/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/model_fwd.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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h new file mode 100644 index 0000000..3716bf4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h @@ -0,0 +1,124 @@ +/* + * 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_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_REFERENCE_DELEGATE_H_ + +#include "Firestore/core/src/model/types.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace model { + +class DocumentKey; + +} // namespace model + +namespace local { + +class ReferenceSet; +class TargetData; + +/** + * A ReferenceDelegate instance handles all of the hooks into the + * document-reference lifecycle. This includes being added to a target, being + * removed from a target, being subject to mutation, and being mutated by the + * user. + * + * Different implementations may do different things with each of these events. + * Not every implementation needs to do something with every lifecycle hook. + * + * Implementations that care about sequence numbers are responsible for + * generating them and making them available. + */ +class ReferenceDelegate { + public: + virtual ~ReferenceDelegate() = default; + + virtual model::ListenSequenceNumber current_sequence_number() const = 0; + + /** + * Registers a ReferenceSet of documents that should be considered + * 'referenced' and not eligible for removal during garbage collection. + */ + virtual void AddInMemoryPins(ReferenceSet* set) = 0; + + /** + * Notifies the delegate that the given document was added to a target. + */ + virtual void AddReference(const model::DocumentKey& key) = 0; + + /** + * Notifies the delegate that the given document was removed from a target. + */ + virtual void RemoveReference(const model::DocumentKey& key) = 0; + + /** + * Notifies the delegate that a document is no longer being mutated by the + * user. + */ + virtual void RemoveMutationReference(const model::DocumentKey& key) = 0; + + /** + * Notifies the delegate that a target was removed. + */ + virtual void RemoveTarget(const local::TargetData& target_data) = 0; + + /** + * Notifies the delegate that a limbo document was updated. + */ + virtual void UpdateLimboDocument(const model::DocumentKey& key) = 0; + + /** + * Lifecycle hook that notifies the delegate that a transaction has started. + */ + virtual void OnTransactionStarted(absl::string_view label) = 0; + + /** + * Lifecycle hook that notifies the delegate that a transaction has committed. + */ + virtual void OnTransactionCommitted() = 0; +}; + +/** + * Calls `OnTransactionStarted` in its constructor and then ensures that + * `OnTransactionCommitted` is called at the close of any block in which it is + * declared. + */ +struct TransactionGuard { + TransactionGuard(ReferenceDelegate* reference_delegate, + absl::string_view label) + : reference_delegate_(reference_delegate) { + reference_delegate_->OnTransactionStarted(label); + } + + ~TransactionGuard() { + reference_delegate_->OnTransactionCommitted(); + } + + TransactionGuard(const TransactionGuard&) = delete; + TransactionGuard& operator=(const TransactionGuard&) = delete; + + private: + ReferenceDelegate* reference_delegate_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_REFERENCE_DELEGATE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc new file mode 100644 index 0000000..166c1b6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc @@ -0,0 +1,102 @@ +/* + * 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/reference_set.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 { +namespace local { + +using model::DocumentKey; +using model::DocumentKeySet; + +void ReferenceSet::AddReference(const DocumentKey& key, int id) { + DocumentKeyReference reference{key, id}; + by_key_ = by_key_.insert(reference); + by_id_ = by_id_.insert(reference); +} + +void ReferenceSet::AddReferences(const DocumentKeySet& keys, int id) { + for (const DocumentKey& key : keys) { + AddReference(key, id); + } +} + +void ReferenceSet::RemoveReference(const DocumentKey& key, int id) { + RemoveReference(DocumentKeyReference{key, id}); +} + +void ReferenceSet::RemoveReferences( + const firebase::firestore::model::DocumentKeySet& keys, int id) { + for (const DocumentKey& key : keys) { + RemoveReference(key, id); + } +} + +DocumentKeySet ReferenceSet::RemoveReferences(int id) { + DocumentKeyReference start{DocumentKey::Empty(), id}; + DocumentKeyReference end{DocumentKey::Empty(), id + 1}; + + DocumentKeySet removed{}; + + auto initial = by_id_; + for (const auto& reference : initial.values_in(start, end)) { + RemoveReference(reference); + removed = removed.insert(reference.key()); + } + return removed; +} + +void ReferenceSet::RemoveAllReferences() { + auto initial = by_key_; + for (const DocumentKeyReference& reference : initial) { + RemoveReference(reference); + } +} + +void ReferenceSet::RemoveReference(const DocumentKeyReference& reference) { + by_key_ = by_key_.erase(reference); + by_id_ = by_id_.erase(reference); +} + +DocumentKeySet ReferenceSet::ReferencedKeys(int id) { + DocumentKeyReference start{DocumentKey::Empty(), id}; + DocumentKeyReference end{DocumentKey::Empty(), id + 1}; + + DocumentKeySet keys; + for (const auto& reference : by_id_.values_in(start, end)) { + keys = keys.insert(reference.key()); + } + return keys; +} + +bool ReferenceSet::ContainsKey(const DocumentKey& key) { + // Create a reference with a zero ID as the start position to find any + // document reference with this key. + DocumentKeyReference start{key, 0}; + + auto range = by_key_.values_from(start); + auto begin = range.begin(); + return begin != range.end() && begin->key() == key; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h new file mode 100644 index 0000000..8c130db --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h @@ -0,0 +1,94 @@ +/* + * 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_REFERENCE_SET_H_ +#define FIRESTORE_CORE_SRC_LOCAL_REFERENCE_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 { +namespace local { + +/** + * A collection of references to a document from some kind of numbered entity + * (either a TargetId or BatchId). As references are added to or removed from + * the set corresponding events are emitted to a registered garbage collector. + * + * Each reference is represented by a DocumentKeyReference object. Each of them + * contains enough information to uniquely identify the reference. They are all + * stored primarily in a set sorted by key. A document is considered garbage if + * there's no references in that set (this can be efficiently checked thanks to + * sorting by key). + * + * ReferenceSet also keeps a secondary set that contains references sorted by + * Id. This one is used to efficiently implement removal of all references by + * some TargetId. + */ +class ReferenceSet { + public: + /** Returns true if the reference set contains no references. */ + bool empty() const { + return by_key_.empty(); + } + + size_t size() const { + return by_key_.size(); + } + + /** Adds a reference to the given document key for the given Id. */ + void AddReference(const model::DocumentKey& key, int id); + + /** Add references to the given document keys for the given Id. */ + void AddReferences(const model::DocumentKeySet& keys, int id); + + /** Removes a reference to the given document key for the given Id. */ + void RemoveReference(const model::DocumentKey& key, int id); + + /** Removes references to the given document keys for the given Id. */ + void RemoveReferences(const model::DocumentKeySet& keys, int id); + + /** Clears all references with a given ID. Calls -removeReferenceToKey: for + * each key removed. */ + model::DocumentKeySet RemoveReferences(int id); + + /** Clears all references for all IDs. */ + void RemoveAllReferences(); + + /** Returns all of the document keys that have had references added for the + * given ID. */ + model::DocumentKeySet ReferencedKeys(int id); + + /** + * Checks to see if there are any references to a document with the given key. + */ + bool ContainsKey(const model::DocumentKey& key); + + private: + void RemoveReference(const DocumentKeyReference& reference); + + immutable::SortedSet + by_key_; + immutable::SortedSet by_id_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_REFERENCE_SET_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h new file mode 100644 index 0000000..1aa6605 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h @@ -0,0 +1,99 @@ +/* + * 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_REMOTE_DOCUMENT_CACHE_H_ +#define 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 { + +/** + * Represents cached documents received from the remote backend. + * + * The cache is keyed by DocumentKey and entries in the cache are MaybeDocument + * instances, meaning we can cache both Document instances (an actual document + * with data) as well as DeletedDocument instances (indicating that the document + * is known to not exist). + */ +class RemoteDocumentCache { + public: + virtual ~RemoteDocumentCache() = default; + + /** + * Adds or replaces an entry in the cache. + * + * The cache key is extracted from `document.key`. If there is already a cache + * 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::MutableDocument& 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; + + /** + * Looks up an entry in the cache. + * + * @param key The key of the entry to look up. + * @return The cached Document or DeletedDocument entry, or nullopt if we + * have nothing cached. + */ + virtual model::MutableDocument Get(const model::DocumentKey& key) = 0; + + /** + * Looks up a set of entries in the cache. + * + * @param keys The keys of the entries to look up. + * @return The cached Document or NoDocument entries indexed by key. If an + * entry is not cached, the corresponding key will be mapped to a null value. + */ + virtual model::MutableDocumentMap GetAll( + const model::DocumentKeySet& keys) = 0; + + /** + * Executes a query against the cached Document entries + * + * Implementations may return extra documents if convenient. The results + * should be re-filtered by the consumer before presenting them to the user. + * + * 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::MutableDocumentMap GetMatching( + const core::Query& query, + const model::SnapshotVersion& since_read_time) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_REMOTE_DOCUMENT_CACHE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h new file mode 100644 index 0000000..68d2729 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h @@ -0,0 +1,65 @@ +/* + * 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_SIZER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_SIZER_H_ + +#include + +namespace firebase { +namespace firestore { +namespace model { + +class MutableDocument; +class MutationBatch; + +} // namespace model + +namespace local { + +class TargetData; + +/** + * Estimates the stored size of documents and queries. + */ +class Sizer { + public: + virtual ~Sizer() = default; + + /** + * Calculates the size of the given maybe_doc in bytes. Note that even + * NoDocuments have an associated size. + */ + virtual int64_t CalculateByteSize( + const model::MutableDocument& maybe_doc) const = 0; + + /** + * Calculates the size of the given mutation_batch in bytes. + */ + virtual int64_t CalculateByteSize( + const model::MutationBatch& batch) const = 0; + + /** + * Calculates the size of the given target_data in bytes. + */ + virtual int64_t CalculateByteSize(const TargetData& target_data) const = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_SIZER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h new file mode 100644 index 0000000..08afe46 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h @@ -0,0 +1,168 @@ +/* + * 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 SequenceNumberCallback = 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; + + /** Enumerates all sequence numbers in the TargetCache. */ + virtual void EnumerateSequenceNumbers( + const SequenceNumberCallback& callback) = 0; + + /** + * Removes all target by sequence number up to (and including) the given + * sequence number. Targets in `live_targets` are ignored. + * + * @param upper_bound The upper bound for last target's sequence number + * (inclusive). + * @param live_targets Targets to ignore. + * @return The number of targets removed. + */ + virtual size_t 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; + + /** Removes all document keys in the query results of the given target ID. */ + virtual void RemoveMatchingKeysForTarget(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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc new file mode 100644 index 0000000..e5759d8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc @@ -0,0 +1,146 @@ +/* + * 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/target_data.h" + +#include +#include +#include + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using core::Target; +using model::ListenSequenceNumber; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; + +// MARK: - QueryPurpose + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.h new file mode 100644 index 0000000..5206145 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/base_path.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/base_path.h new file mode 100644 index 0000000..3d604f6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/base_path.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_MODEL_BASE_PATH_H_ +#define FIRESTORE_CORE_SRC_MODEL_BASE_PATH_H_ + +#include +#include +#include +#include +#include +#include + +#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 impl { + +/** + * BasePath represents a path sequence in the Firestore database. It is composed + * of an ordered sequence of string segments. + * + * BasePath is reassignable and movable. Apart from those, all other mutating + * operations return new independent instances. + * + * ## Subclassing Notes + * + * BasePath is strictly meant as a base class for concrete implementations. It + * doesn't contain a single virtual method, can't be instantiated, and should + * never be used in any polymorphic way. BasePath is templated to allow static + * factory methods to return objects of the derived class (the expected + * inheritance would use CRTP: struct Derived : BasePath). + */ +template +class BasePath { + protected: + using SegmentsT = std::vector; + + public: + using const_iterator = SegmentsT::const_iterator; + + /** Returns i-th segment of the path. */ + const std::string& operator[](const size_t i) const { + HARD_ASSERT(i < segments_.size(), "index %s out of range", i); + return segments_[i]; + } + + /** Returns the first segment of the path. */ + const std::string& first_segment() const { + HARD_ASSERT(!empty(), "Cannot call first_segment on empty path"); + return segments_[0]; + } + /** Returns the last segment of the path. */ + const std::string& last_segment() const { + HARD_ASSERT(!empty(), "Cannot call last_segment on empty path"); + return segments_[size() - 1]; + } + + size_t size() const { + return segments_.size(); + } + bool empty() const { + return segments_.empty(); + } + + const_iterator begin() const { + return segments_.begin(); + } + const_iterator end() const { + return segments_.end(); + } + + /** + * Returns a new path which is the result of concatenating this path with an + * additional segment. + */ + T Append(const std::string& segment) const { + auto appended = segments_; + appended.push_back(segment); + return T{std::move(appended)}; + } + T Append(std::string&& segment) const { + auto appended = segments_; + appended.push_back(std::move(segment)); + return T{std::move(appended)}; + } + + /** + * Returns a new path which is the result of concatenating this path with an + * another path. + */ + T Append(const T& path) const { + auto appended = segments_; + appended.insert(appended.end(), path.begin(), path.end()); + return T{std::move(appended)}; + } + + /** + * Returns a new path which is the result of omitting the first n segments of + * this path. + */ + T PopFirst(const size_t n = 1) const { + HARD_ASSERT(n <= size(), "Cannot call PopFirst(%s) on path of length %s", n, + size()); + return T{begin() + n, end()}; + } + + /** + * Returns a new path which is the result of omitting the last segment of + * this path. + */ + T PopLast() const { + HARD_ASSERT(!empty(), "Cannot call PopLast() on empty path"); + return T{begin(), end() - 1}; + } + + /** + * Returns true if this path is a prefix of the given path. + * + * Empty path is a prefix of any path. Any path is a prefix of itself. + */ + bool IsPrefixOf(const T& rhs) const { + return size() <= rhs.size() && std::equal(begin(), end(), rhs.begin()); + } + + /** + * Returns true if the given argument is a direct child of this path. + * + * Empty path is a parent of any path that consists of a single segment. + */ + bool IsImmediateParentOf(const T& potential_child) const { + return size() + 1 == potential_child.size() && + std::equal(begin(), end(), potential_child.begin()); + } + + util::ComparisonResult CompareTo(const T& rhs) const { + return util::CompareContainer(segments_, rhs.segments_); + } + + friend bool operator==(const BasePath& lhs, const BasePath& rhs) { + return lhs.segments_ == rhs.segments_; + } + + size_t Hash() const { + return util::Hash(segments_); + } + + protected: + BasePath() = default; + template + BasePath(const IterT begin, const IterT end) : segments_{begin, end} { + } + BasePath(std::initializer_list list) : segments_{list} { + } + explicit BasePath(SegmentsT&& segments) : segments_{std::move(segments)} { + } + + private: + SegmentsT segments_; +}; + +} // namespace impl +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_BASE_PATH_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc new file mode 100644 index 0000000..63022d5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc @@ -0,0 +1,69 @@ +/* + * 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/database_id.h" + +#include + +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace model { + +constexpr const char* DatabaseId::kDefault; + +DatabaseId::DatabaseId(std::string project_id, std::string database_id) { + HARD_ASSERT(!project_id.empty()); + HARD_ASSERT(!database_id.empty()); + + rep_ = std::make_shared(std::move(project_id), std::move(database_id)); +} + +DatabaseId DatabaseId::FromName(const std::string& name) { + auto resource_name = ResourcePath::FromString(name); + HARD_ASSERT(resource_name.size() > 3 && resource_name[0] == "projects" && + resource_name[2] == "databases", + "Tried to parse an invalid resource name: %s", name); + return DatabaseId{resource_name[1], resource_name[3]}; +} + +util::ComparisonResult DatabaseId::CompareTo( + const firebase::firestore::model::DatabaseId& rhs) const { + util::ComparisonResult cmp = util::Compare(project_id(), rhs.project_id()); + if (!util::Same(cmp)) return cmp; + + return util::Compare(database_id(), rhs.database_id()); +} + +std::string DatabaseId::ToString() const { + return absl::StrCat("DatabaseId(", project_id(), ":", database_id(), ")"); +} + +std::ostream& operator<<(std::ostream& out, const DatabaseId& database_id) { + return out << database_id.ToString(); +} + +size_t DatabaseId::Hash() const { + return util::Hash(project_id(), database_id()); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h new file mode 100644 index 0000000..2765117 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h @@ -0,0 +1,93 @@ +/* + * 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_DATABASE_ID_H_ +#define FIRESTORE_CORE_SRC_MODEL_DATABASE_ID_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/util/comparison.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** A DatabaseId represents a particular database in the Firestore. */ +class DatabaseId : public util::Comparable { + public: + /** The default name for "unset" database ID in resource names. */ + static constexpr const char* kDefault = "(default)"; + + // TODO(wilhuff): Remove this after FieldValue rewrite. + DatabaseId() = default; + + /** + * Creates and returns a new DatabaseId. + * + * @param project_id The project for the database. + * @param database_id The database in the project to use. + */ + explicit DatabaseId(std::string project_id, + std::string database_id = kDefault); + + /** Returns a DatabaseId from a fully qualified resource name. */ + static DatabaseId FromName(const std::string& name); + + const std::string& project_id() const { + return rep_->project_id; + } + + const std::string& database_id() const { + return rep_->database_id; + } + + /** Whether this is the default database of the project. */ + bool IsDefaultDatabase() const { + return rep_->database_id == kDefault; + } + + util::ComparisonResult CompareTo(const DatabaseId& rhs) const; + + std::string ToString() const; + friend std::ostream& operator<<(std::ostream& out, + const DatabaseId& database_id); + + size_t Hash() const; + + private: + // DocumentIds are copied into every ReferenceValue we create so hide the + // actual values behind a shared_ptr to make copying cheaper. + struct Rep { + Rep(std::string&& project_id, std::string&& database_id) + : project_id{std::move(project_id)}, + database_id{std::move(database_id)} { + } + std::string project_id; + std::string database_id; + }; + + std::shared_ptr rep_; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DATABASE_ID_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc new file mode 100644 index 0000000..6716ffb --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc @@ -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/model/delete_mutation.h" + +#include +#include + +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace model { + +static_assert( + sizeof(Mutation) == sizeof(DeleteMutation), + "DeleteMutation may not have additional members (everything goes in Rep)"); + +DeleteMutation::DeleteMutation(DocumentKey key, Precondition precondition) + : Mutation(std::make_shared(std::move(key), std::move(precondition))) { +} + +DeleteMutation::DeleteMutation(const Mutation& mutation) : Mutation(mutation) { + HARD_ASSERT(type() == Type::Delete); +} + +void DeleteMutation::Rep::ApplyToRemoteDocument( + MutableDocument& document, const MutationResult& mutation_result) const { + VerifyKeyMatches(document); + + HARD_ASSERT(mutation_result.transform_results()->values_count == 0, + "Transform results received by DeleteMutation."); + + // Unlike ApplyToLocalView, if we're applying a mutation to a remote document + // the server has accepted the mutation so the precondition must have held. + + // We store the deleted document at the commit version of the delete. Any + // document version that the server sends us before the delete was applied is + // discarded. + document.ConvertToNoDocument(mutation_result.version()) + .SetHasCommittedMutations(); +} + +void DeleteMutation::Rep::ApplyToLocalView(MutableDocument& document, + const Timestamp&) const { + VerifyKeyMatches(document); + + if (precondition().IsValidFor(document)) { + document.ConvertToNoDocument(SnapshotVersion::None()); + } +} + +std::string DeleteMutation::Rep::ToString() const { + return absl::StrCat("DeleteMutation(key=", key().ToString(), + ", precondition=", precondition().ToString(), ")"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h new file mode 100644 index 0000000..a4fc3b5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h @@ -0,0 +1,72 @@ +/* + * 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; + } + + void ApplyToRemoteDocument( + MutableDocument& document, + const MutationResult& mutation_result) const override; + + void ApplyToLocalView(MutableDocument& document, + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.cc new file mode 100644 index 0000000..9f74aa5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.cc @@ -0,0 +1,31 @@ +/* + * 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.h" + +#include + +namespace firebase { +namespace firestore { +namespace model { + +std::ostream& operator<<(std::ostream& os, const Document& doc) { + return os << doc.ToString(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.h new file mode 100644 index 0000000..ce4d12f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document.h @@ -0,0 +1,73 @@ +/* + * 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_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_H_ + +#include +#include +#include + +#include "Firestore/core/src/model/mutable_document.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** Represents an immutable document in Firestore. */ +class Document { + public: + Document(MutableDocument document) // NOLINT(runtime/explicit) + : document_{std::move(document)} { + } + + Document() = default; + + const MutableDocument& get() const { + return document_; + } + + const MutableDocument* operator->() const { + return &document_; + } + + size_t Hash() const { + return document_.Hash(); + } + + std::string ToString() const { + return document_.ToString(); + } + + private: + MutableDocument document_; +}; + +inline bool operator==(const Document& lhs, const Document& rhs) { + return lhs.get() == rhs.get(); +} + +inline bool operator!=(const Document& lhs, const Document& rhs) { + return !(lhs == rhs); +} + +std::ostream& operator<<(std::ostream& os, const Document& doc); + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc new file mode 100644 index 0000000..a8da934 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc @@ -0,0 +1,121 @@ +/* + * 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/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::FromString(path)}; +} + +DocumentKey DocumentKey::FromSegments(std::initializer_list list) { + return DocumentKey{ResourcePath{list}}; +} + +DocumentKey DocumentKey::FromName(const std::string& name) { + auto resource_name = ResourcePath::FromString(name); + HARD_ASSERT(resource_name.size() > 4 && resource_name[0] == "projects" && + resource_name[2] == "databases" && + resource_name[4] == "documents", + "Tried to parse an invalid key: %s", name); + return DocumentKey{resource_name.PopFirst(5)}; +} + +const DocumentKey& DocumentKey::Empty() { + static const DocumentKey* empty = new DocumentKey(); + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h new file mode 100644 index 0000000..2b17cb7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h @@ -0,0 +1,116 @@ +/* + * 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 + +#include "absl/strings/string_view.h" + +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 DocumentKey from a fully qualified resource name. */ + static DocumentKey FromName(const std::string& name); + + /** 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key_set.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_key_set.h new file mode 100644 index 0000000..ab07bb9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc new file mode 100644 index 0000000..18c4d77 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc @@ -0,0 +1,120 @@ +/* + * 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/model/document_set.h" + +#include +#include + +#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 { +namespace firestore { +namespace model { +namespace { + +inline absl::optional none() { + return absl::optional{}; +} + +} // namespace + +DocumentComparator DocumentComparator::ByKey() { + return DocumentComparator([](const Document& lhs, const Document& rhs) { + return util::Compare(lhs->key(), rhs->key()); + }); +} + +DocumentSet::DocumentSet(DocumentComparator&& comparator) + : index_{}, sorted_set_{std::move(comparator)} { +} + +bool operator==(const DocumentSet& lhs, const DocumentSet& rhs) { + return absl::c_equal(lhs.sorted_set_, rhs.sorted_set_); +} + +std::string DocumentSet::ToString() const { + return util::ToString(sorted_set_); +} + +std::ostream& operator<<(std::ostream& os, const DocumentSet& set) { + return os << set.ToString(); +} + +size_t DocumentSet::Hash() const { + return util::Hash(sorted_set_); +} + +bool DocumentSet::ContainsKey(const DocumentKey& key) const { + return index_.find(key) != index_.end(); +} + +absl::optional DocumentSet::GetDocument( + const DocumentKey& key) const { + auto found = index_.find(key); + return found != index_.end() ? Document(found->second) : none(); +} + +absl::optional DocumentSet::GetFirstDocument() const { + auto result = sorted_set_.min(); + return result != sorted_set_.end() ? *result : none(); +} + +absl::optional DocumentSet::GetLastDocument() const { + auto result = sorted_set_.max(); + return result != sorted_set_.end() ? *result : none(); +} + +size_t DocumentSet::IndexOf(const DocumentKey& key) const { + absl::optional doc = GetDocument(key); + return doc ? sorted_set_.find_index(*doc) : npos; +} + +DocumentSet DocumentSet::insert( + const absl::optional& document) const { + // TODO(mcg): look into making document non-optional. + if (!document) { + return *this; + } + + // Remove any prior mapping of the document's key before adding, preventing + // the sorted_set_ from accumulating values that aren't in the index. + const DocumentKey& key = (*document)->key(); + DocumentSet removed = erase(key); + + DocumentMap index = removed.index_.insert(key, *document); + SetType set = removed.sorted_set_.insert(*document); + return {std::move(index), std::move(set)}; +} + +DocumentSet DocumentSet::erase(const DocumentKey& key) const { + absl::optional doc = GetDocument(key); + if (!doc) { + return *this; + } + + DocumentMap index = index_.erase(key); + SetType set = sorted_set_.erase(*doc); + return {std::move(index), std::move(set)}; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h new file mode 100644 index 0000000..ba204de --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h @@ -0,0 +1,164 @@ +/* + * 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_MODEL_DOCUMENT_SET_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_SET_H_ + +#include +#include +#include +#include +#include + +#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/model_fwd.h" +#include "Firestore/core/src/util/comparison.h" + +namespace firebase { +namespace firestore { +namespace model { + +class DocumentComparator : public util::FunctionComparator { + public: + using FunctionComparator::FunctionComparator; + + static DocumentComparator ByKey(); + + // TODO(wilhuff): Remove this using statement + // This exists to put these two overloads on equal footing. Once the overload + // below is gone, this using statement can be removed as well. + using FunctionComparator::Compare; +}; + +/** + * DocumentSet is an immutable (copy-on-write) collection that holds documents + * in order specified by the provided comparator. We always add a document key + * comparator on top of what is provided to guarantee document equality based on + * the key. + */ +class DocumentSet : public immutable::SortedContainer { + public: + /** + * The type of the main collection of documents in an DocumentSet. + * @see sorted_set_. + */ + using SetType = immutable::SortedSet; + + // STL container types + using value_type = Document; + using const_iterator = SetType::const_iterator; + + /** + * Creates a new, empty DocumentSet sorted by the given comparator, then by + * keys. + */ + explicit DocumentSet(DocumentComparator&& comparator); + + size_t size() const { + return index_.size(); + } + + /** Returns true if the dictionary contains no elements. */ + bool empty() const { + return index_.empty(); + } + + /** Returns true if this set contains a document with the given key. */ + bool ContainsKey(const DocumentKey& key) const; + + const DocumentComparator& comparator() const { + return sorted_set_.comparator(); + } + + SetType::const_iterator begin() const { + return sorted_set_.begin(); + } + SetType::const_iterator end() const { + return sorted_set_.end(); + } + + /** + * Returns the document from this set with the given key if it exists or nil + * if it doesn't. + */ + absl::optional GetDocument(const DocumentKey& key) const; + + /** + * Returns the first document in the set according to its built in ordering, + * or nil if the set is empty. + */ + absl::optional GetFirstDocument() const; + + /** + * Returns the last document in the set according to its built in ordering, or + * nil if the set is empty. + */ + absl::optional GetLastDocument() const; + + /** + * Returns the index of the document with the provided key in the document + * set. Returns `npos` if the key is not present. + */ + size_t IndexOf(const DocumentKey& key) const; + + /** Returns a new DocumentSet that contains the given document. */ + DocumentSet insert(const absl::optional& document) const; + + /** + * Returns a new DocumentSet that excludes any document associated with + * the given key. + */ + DocumentSet erase(const DocumentKey& key) const; + + friend bool operator==(const DocumentSet& lhs, const DocumentSet& rhs); + + std::string ToString() const; + friend std::ostream& operator<<(std::ostream& os, const DocumentSet& set); + + size_t Hash() const; + + private: + DocumentSet(DocumentMap&& index, SetType&& sorted_set) + : index_(std::move(index)), sorted_set_(std::move(sorted_set)) { + } + + /** + * An index of the documents in the DocumentSet, indexed by document key. + * The index exists to guarantee the uniqueness of document keys in the set + * and to allow lookup and removal of documents by key. + */ + DocumentMap index_; + + /** + * The main collection of documents in the DocumentSet. The documents are + * ordered by a comparator supplied from a query. The SetType collection + * exists in addition to the index to allow ordered traversal of the + * DocumentSet. + */ + SetType sorted_set_; +}; + +inline bool operator!=(const DocumentSet& lhs, const DocumentSet& rhs) { + return !(lhs == rhs); +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_SET_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc new file mode 100644 index 0000000..f2a6df8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc @@ -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. + */ + +#include "Firestore/core/src/model/field_mask.h" + +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace model { + +bool FieldMask::covers(const FieldPath& field_path) const { + for (const FieldPath& field_mask_path : fields_) { + if (field_mask_path.IsPrefixOf(field_path)) { + return true; + } + } + + return false; +} + +std::string FieldMask::ToString() const { + // Ideally, one should use a string builder. Since this is only non-critical + // code for logging and debugging, the logic is kept simple here. + std::string result("{ "); + for (const FieldPath& field : fields_) { + result += field.CanonicalString() + " "; + } + return result + "}"; +} + +size_t FieldMask::Hash() const { + return util::Hash(fields_); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.h new file mode 100644 index 0000000..f46db2b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.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_MODEL_FIELD_MASK_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_MASK_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/model/field_path.h" + +namespace firebase { +namespace firestore { +namespace model { + +class ObjectValue; + +/** + * Provides a set of fields that can be used to partially patch a document. + * FieldMask is used in conjunction with FieldValue of Object type. + * + * Examples: + * foo - Overwrites foo entirely with the provided value. If foo is not + * present in the companion FieldValue, the field is deleted. + * foo.bar - Overwrites only the field bar of the object foo. If foo is not an + * object, foo is replaced with an object containing bar. + */ +class FieldMask { + public: + using const_iterator = std::set::const_iterator; + + FieldMask() = default; + + 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)} { + } + + const_iterator begin() const { + return fields_.begin(); + } + const_iterator end() const { + return fields_.end(); + } + + size_t size() const { + return fields_.size(); + } + + /** + * 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& field_path) const; + + std::string ToString() const; + + size_t Hash() const; + + friend bool operator==(const FieldMask& lhs, const FieldMask& rhs); + + private: + std::set fields_; +}; + +inline bool operator==(const FieldMask& lhs, const FieldMask& rhs) { + return lhs.fields_ == rhs.fields_; +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_MASK_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc new file mode 100644 index 0000000..cdabb50 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc @@ -0,0 +1,234 @@ +/* + * 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/model/field_path.h" + +#include +#include + +#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" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" +#include "absl/strings/str_split.h" + +namespace firebase { +namespace firestore { +namespace model { +namespace { + +using util::Status; +using util::StatusOr; +using util::StringFormat; +using util::ThrowInvalidArgument; + +/** + * True if the string could be used as a segment in a field path without + * escaping. Valid identifies follow the regex [a-zA-Z_][a-zA-Z0-9_]* + */ +bool IsValidIdentifier(const std::string& segment) { + if (segment.empty()) { + return false; + } + + // Note: strictly speaking, only digits are guaranteed by the Standard to + // be a contiguous range, while alphabetic characters may have gaps. Ignoring + // this peculiarity, because it doesn't affect the platforms that Firestore + // supports. + const unsigned char first = segment.front(); + if (first != '_' && (first < 'a' || first > 'z') && + (first < 'A' || first > 'Z')) { + return false; + } + for (size_t i = 1; i != segment.size(); ++i) { + const unsigned char c = segment[i]; + if (c != '_' && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && + (c < '0' || c > '9')) { + return false; + } + } + + return true; +} + +/** A custom formatter to be used with absl::StrJoin(). */ +struct JoinEscaped { + static std::string escaped_segment(const std::string& segment) { + auto escaped = absl::StrReplaceAll(segment, {{"\\", "\\\\"}, {"`", "\\`"}}); + const bool needs_escaping = !IsValidIdentifier(escaped); + if (needs_escaping) { + escaped.insert(escaped.begin(), '`'); + escaped.push_back('`'); + } + return escaped; + } + + template + void operator()(T* out, const std::string& segment) { + out->append(escaped_segment(segment)); + } +}; + +} // namespace + +constexpr const char* FieldPath::kDocumentKeyPath; + +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 '~', '*', '/', '[', " + "or ']'", + path); + } + + SegmentsT segments = + absl::StrSplit(path, '.', [path](absl::string_view segment) { + if (segment.empty()) { + ThrowInvalidArgument( + "Invalid field path (%s). Paths must not be empty, begin with " + "'.', end with '.', or contain '..'", + path); + } + return true; + }); + + return FieldPath(std::move(segments)); +} + +StatusOr FieldPath::FromServerFormat(const std::string& path) { + return FromServerFormatView(path); +} + +StatusOr FieldPath::FromServerFormatView(absl::string_view path) { + SegmentsT segments; + std::string segment; + segment.reserve(path.size()); + + Status status; + + const auto finish_segment = [&segments, &segment, &path] { + if (segment.empty()) { + return Status{ + Error::kErrorInvalidArgument, + StringFormat( + "Invalid field path (%s). Paths must not be empty, begin with " + "'.', end with '.', or contain '..'", + path)}; + } + // Move operation will clear segment, but capacity will remain the same + // (not, strictly speaking, required by the standard, but true in practice). + segments.push_back(std::move(segment)); + return Status::OK(); + }; + + // Inside backticks, dots are treated literally. + bool inside_backticks = false; + size_t i = 0; + while (i < path.size()) { + const char c = path[i]; + // std::string (and string_view) may contain embedded nulls. For full + // compatibility with Objective C behavior, finish upon encountering the + // first terminating null. + if (c == '\0') { + break; + } + + switch (c) { + case '.': + if (!inside_backticks) { + status = finish_segment(); + } else { + segment += c; + } + break; + + case '`': + inside_backticks = !inside_backticks; + break; + + case '\\': + if (i + 1 == path.size()) { + status = + Status{Error::kErrorInvalidArgument, + StringFormat( + "Trailing escape characters not allowed in %s", path)}; + } else { + ++i; + segment += path[i]; + } + break; + + default: + segment += c; + break; + } + ++i; + + if (!status.ok()) return status; + } + + status = finish_segment(); + if (!status.ok()) return status; + + if (inside_backticks) { + return Status{Error::kErrorInvalidArgument, + StringFormat("Unterminated ` in path %s", path)}; + } + + return FieldPath{std::move(segments)}; +} + +const FieldPath& FieldPath::EmptyPath() { + static const FieldPath empty_path; + return empty_path; +} + +const FieldPath& FieldPath::KeyFieldPath() { + static const FieldPath key_field_path{FieldPath::kDocumentKeyPath}; + return key_field_path; +} + +bool FieldPath::IsKeyFieldPath() const { + return size() == 1 && first_segment() == FieldPath::kDocumentKeyPath; +} + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h new file mode 100644 index 0000000..cd65a7b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ + +#include +#include +#include + +#include "Firestore/core/src/model/base_path.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { + +namespace remote { +class Serializer; +} // namespace remote + +namespace model { + +/** + * A dot-separated path for navigating sub-objects within a document. + * + * Immutable; all instances are fully independent. + */ +class FieldPath : public impl::BasePath, + public util::Comparable { + public: + /** The field path string that represents the document's key. */ + static constexpr const char* kDocumentKeyPath = "__name__"; + + // Note: Xcode 8.2 requires explicit specification of the constructor. + FieldPath() : impl::BasePath() { + } + + /** Constructs the path from segments. */ + template + FieldPath(const IterT begin, const IterT end) : BasePath{begin, end} { + } + FieldPath(std::initializer_list list) : BasePath{list} { + } + explicit FieldPath(SegmentsT&& segments) : BasePath{std::move(segments)} { + } + + /** + * Creates and returns a new path from a dot-separated field-path string, + * where path segments are separated by a dot ".". + * + * PORTING NOTE: We define this on the model class to avoid having a tiny + * api::FieldPath wrapper class. + */ + 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. + */ + static FieldPath FromSegments(SegmentsT&& segments) { + ValidateSegments(segments); + FieldPath path(std::move(segments)); + return path; + } + + /** + * Creates and returns a new path from the server formatted field-path string, + * where path segments are separated by a dot "." and optionally encoded using + * backticks. + */ + static util::StatusOr FromServerFormat(const std::string& path); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + static util::StatusOr 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(); + + /** 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); +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc new file mode 100644 index 0000000..a71a29d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc @@ -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. + */ + +#include "Firestore/core/src/model/field_transform.h" + +#include +#include + +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace model { + +FieldTransform::FieldTransform(FieldPath path, + TransformOperation transformation) noexcept + : path_{std::move(path)}, transformation_{std::move(transformation)} { +} + +bool FieldTransform::operator==(const FieldTransform& other) const { + return path_ == other.path_ && transformation_ == other.transformation_; +} + +size_t FieldTransform::Hash() const { + return util::Hash(path_, transformation_); +} + +std::string FieldTransform::ToString() const { + return absl::StrCat("FieldTransform(path=", path_.CanonicalString(), + "transformation=", transformation_.ToString(), ")"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.h new file mode 100644 index 0000000..a58f16a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.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_MODEL_FIELD_TRANSFORM_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_TRANSFORM_H_ + +#include + +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/transform_operation.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** A field path and the TransformOperation to perform upon it. */ +class FieldTransform { + public: + FieldTransform(FieldPath path, TransformOperation transformation) noexcept; + + const FieldPath& path() const { + return path_; + } + + const TransformOperation& transformation() const { + return transformation_; + } + + bool operator==(const FieldTransform& other) const; + + size_t Hash() const; + + std::string ToString() const; + + private: + FieldPath path_; + TransformOperation transformation_; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_TRANSFORM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h new file mode 100644 index 0000000..c59713c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h @@ -0,0 +1,118 @@ +/* + * 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 + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#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 nanopb { + +template +class Message; + +} // namespace nanopb + +namespace model { + +class DatabaseId; +class DeleteMutation; +class Document; +class MutableDocument; +class DocumentComparator; +class DocumentKey; +class DocumentSet; +class FieldMask; +class FieldPath; +class FieldTransform; +class MutableDocument; +class Mutation; +class MutationBatch; +class MutationBatchResult; +class MutationResult; +class ObjectValue; +class PatchMutation; +class Precondition; +class SetMutation; +class SnapshotVersion; +class TransformOperation; +class VerifyMutation; + +enum class OnlineState; + +struct DocumentKeyHash; + +using BatchId = int32_t; +using ListenSequenceNumber = int64_t; +using TargetId = int32_t; + +using DocumentKeySet = + immutable::SortedSet>; + +using MutableDocumentMap = immutable:: + SortedMap>; + +using DocumentMap = + immutable::SortedMap>; + +using DocumentVersionMap = + std::unordered_map; + +using DocumentUpdateMap = + std::unordered_map; + +// A map of FieldPaths to transforms. Sorted so it can be used in +// ObjectValue::SetAll, which makes it more efficient as it processes field +// maps one layer at a time. +using TransformMap = + std::map>>; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MODEL_FWD_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.cc new file mode 100644 index 0000000..7b1b905 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.cc @@ -0,0 +1,159 @@ +/* + * Copyright 2021 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/mutable_document.h" + +#include +#include + +#include "Firestore/core/src/model/value_util.h" + +namespace firebase { +namespace firestore { +namespace model { + +MutableDocument MutableDocument::InvalidDocument(DocumentKey document_key) { + return {std::move(document_key), DocumentType::kInvalid, + SnapshotVersion::None(), std::make_shared(), + DocumentState::kSynced}; +} + +MutableDocument MutableDocument::FoundDocument(DocumentKey document_key, + const SnapshotVersion& version, + ObjectValue value) { + return std::move(InvalidDocument(std::move(document_key)) + .ConvertToFoundDocument(version, std::move(value))); +} + +MutableDocument MutableDocument::NoDocument(DocumentKey document_key, + const SnapshotVersion& version) { + return std::move( + InvalidDocument(std::move(document_key)).ConvertToNoDocument(version)); +} + +MutableDocument MutableDocument::UnknownDocument( + const DocumentKey& document_key, const SnapshotVersion& version) { + return std::move( + InvalidDocument(document_key).ConvertToUnknownDocument(version)); +} + +MutableDocument& MutableDocument::ConvertToFoundDocument( + const SnapshotVersion& version, ObjectValue value) { + version_ = version; + document_type_ = DocumentType::kFoundDocument; + value_ = std::make_shared(std::move(value)); + document_state_ = DocumentState::kSynced; + return *this; +} + +MutableDocument& MutableDocument::ConvertToFoundDocument( + const SnapshotVersion& version) { + version_ = version; + document_type_ = DocumentType::kFoundDocument; + document_state_ = DocumentState::kSynced; + return *this; +} + +MutableDocument& MutableDocument::ConvertToNoDocument( + const SnapshotVersion& version) { + version_ = version; + document_type_ = DocumentType::kNoDocument; + value_ = std::make_shared(); + document_state_ = DocumentState::kSynced; + return *this; +} + +MutableDocument& MutableDocument::ConvertToUnknownDocument( + const SnapshotVersion& version) { + version_ = version; + document_type_ = DocumentType::kUnknownDocument; + value_ = std::make_shared(); + document_state_ = DocumentState::kHasCommittedMutations; + return *this; +} + +MutableDocument& MutableDocument::SetHasCommittedMutations() { + document_state_ = DocumentState::kHasCommittedMutations; + return *this; +} + +MutableDocument& MutableDocument::SetHasLocalMutations() { + document_state_ = DocumentState::kHasLocalMutations; + return *this; +} + +MutableDocument MutableDocument::Clone() const { + return MutableDocument( + key_, document_type_, version_, + std::make_shared(DeepClone(value_->Get())), document_state_); +} + +size_t MutableDocument::Hash() const { + return key_.Hash(); +} + +std::string MutableDocument::ToString() const { + std::stringstream stream; + stream << "MutableDocument(key=" << key_ << ", type=" << document_type_ + << ", version=" << version_ << ", value=" << *value_ + << ", state=" << document_state_; + return stream.str(); +} + +bool operator==(const MutableDocument& lhs, const MutableDocument& rhs) { + return lhs.key_ == rhs.key_ && lhs.document_type_ == rhs.document_type_ && + lhs.version_ == rhs.version_ && + lhs.document_state_ == rhs.document_state_ && + *lhs.value_ == *rhs.value_; +} + +std::ostream& operator<<(std::ostream& os, const MutableDocument& doc) { + return os << doc.ToString(); +} + +std::ostream& operator<<(std::ostream& os, + MutableDocument::DocumentState state) { + switch (state) { + case MutableDocument::DocumentState::kHasCommittedMutations: + return os << "kHasCommittedMutations"; + case MutableDocument::DocumentState::kHasLocalMutations: + return os << "kHasLocalMutations"; + case MutableDocument::DocumentState::kSynced: + return os << "kSynced"; + } + + UNREACHABLE(); +} + +std::ostream& operator<<(std::ostream& os, + MutableDocument::DocumentType state) { + switch (state) { + case MutableDocument::DocumentType::kInvalid: + return os << "kInvalid"; + case MutableDocument::DocumentType::kFoundDocument: + return os << "kFoundDocument"; + case MutableDocument::DocumentType::kNoDocument: + return os << "kNoDocument"; + case MutableDocument::DocumentType::kUnknownDocument: + return os << "kUnknownDocument"; + } + + UNREACHABLE(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.h new file mode 100644 index 0000000..f28f8d7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutable_document.h @@ -0,0 +1,246 @@ +/* + * Copyright 2021 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_MUTABLE_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTABLE_DOCUMENT_H_ + +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/object_value.h" +#include "Firestore/core/src/model/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** + * Represents a document in Firestore with a key, version, data and whether it + * has local mutations applied to it. + * + * Documents can transition between states via `ConvertToFoundDocument()`, + * `ConvertToNoDocument()` and `ConvertToUnknownDocument()`. If a document does + * not transition to one of these states even after all mutations have been + * applied, `is_valid_document()` returns false and the document should be + * removed from all views. + */ +class MutableDocument { + private: + enum class DocumentType { + /** + * Represents the initial state of a MutableDocument when only the document + * key is known. Invalid documents transition to other states as mutations + * are applied. If a document remains invalid after applying mutations, it + * should be discarded. + */ + kInvalid, + /** + * Represents a document in Firestore with a key, version, data and whether + * the data has local mutations applied to it. + */ + kFoundDocument, + /** Represents that no documents exists for the key at the given version. */ + kNoDocument, + /** + * Represents an existing document whose data is unknown (e.g. a document + * that was updated without a known base document). + */ + kUnknownDocument + }; + + /** Describes the `hasPendingWrites` state of a document. */ + enum class DocumentState { + /** + * Local mutations applied via the mutation queue. Document is potentially + * inconsistent. + */ + kHasLocalMutations, + /** + * Mutations applied based on a write acknowledgment. Document is + * potentially inconsistent. + */ + kHasCommittedMutations, + /** No mutations applied. Document was sent to us by Watch. */ + kSynced + }; + + public: + MutableDocument() = default; + + /** + * Creates a document with no known version or data. This document can serve + * as a base document for mutations. + */ + static MutableDocument InvalidDocument(DocumentKey document_key); + + /** + * Creates a new document that is known to exist with the given data at the + * given version. + */ + static MutableDocument FoundDocument(DocumentKey document_key, + const SnapshotVersion& version, + ObjectValue value); + + /** Creates a new document that is known to not exisr at the given version. */ + static MutableDocument NoDocument(DocumentKey document_key, + const SnapshotVersion& version); + + /** + * Creates a new document that is known to exist at the given version but + * whose data is not known (e.g. a document that was updated without a known + * base document). + */ + static MutableDocument UnknownDocument(const DocumentKey& document_key, + const SnapshotVersion& version); + + /** + * Changes the document type to indicate that it exists and that its version + * and data are known. + */ + MutableDocument& ConvertToFoundDocument(const SnapshotVersion& version, + ObjectValue value); + + /** + * Changes the document type to indicate that it exists and that its version + * and data are known. + */ + MutableDocument& ConvertToFoundDocument(const SnapshotVersion& version); + + /** + * Changes the document type to indicate that it doesn't exist at the given + * version. + */ + MutableDocument& ConvertToNoDocument(const SnapshotVersion& version); + + /** + * Changes the document type to indicate that it exists at a given version but + * that its data is not known (e.g. a document that was updated without a + * known base document). + */ + MutableDocument& ConvertToUnknownDocument(const SnapshotVersion& version); + + MutableDocument& SetHasCommittedMutations(); + + MutableDocument& SetHasLocalMutations(); + + /** Creates a new document with a copy of the document's data and state. */ + MutableDocument Clone() const; + + const DocumentKey& key() const { + return key_; + } + + const SnapshotVersion& version() const { + return version_; + } + + bool has_local_mutations() const { + return document_state_ == DocumentState::kHasLocalMutations; + } + + bool has_committed_mutations() const { + return document_state_ == DocumentState::kHasCommittedMutations; + } + + bool has_pending_writes() const { + return has_local_mutations() || has_committed_mutations(); + } + + google_firestore_v1_Value value() const { + return value_->Get(); + } + + ObjectValue& data() const { + return *value_; + } + + /** + * Returns the value at the given path or absl::nullopt. If the path is empty, + * an identical copy of the FieldValue is returned. + * + * @param field_path the path to search. + * @return The value at the path or absl::nullopt if it doesn't exist. + */ + absl::optional field( + const FieldPath& field_path) const { + return value_->Get(field_path); + } + + bool is_valid_document() const { + return document_type_ != DocumentType ::kInvalid; + } + + bool is_found_document() const { + return document_type_ == DocumentType ::kFoundDocument; + } + + bool is_no_document() const { + return document_type_ == DocumentType ::kNoDocument; + } + + bool is_unknown_document() const { + return document_type_ == DocumentType ::kUnknownDocument; + } + + size_t Hash() const; + + std::string ToString() const; + + friend bool operator==(const MutableDocument& lhs, + const MutableDocument& rhs); + + friend std::ostream& operator<<(std::ostream& os, DocumentState state); + friend std::ostream& operator<<(std::ostream& os, DocumentType type); + + private: + MutableDocument(DocumentKey key, + DocumentType document_type, + SnapshotVersion version, + std::shared_ptr value, + DocumentState document_state) + : key_{std::move(key)}, + document_type_{document_type}, + version_{version}, + value_{std::move(value)}, + document_state_{document_state} { + } + + DocumentKey key_; + DocumentType document_type_ = DocumentType::kInvalid; + SnapshotVersion version_; + // Using a shared pointer to ObjectValue makes MutableDocument copy-assignable + // without having to manually create a deep clone of its Protobuf contents. + std::shared_ptr value_ = std::make_shared(); + DocumentState document_state_ = DocumentState::kSynced; +}; + +bool operator==(const MutableDocument& lhs, const MutableDocument& rhs); + +std::ostream& operator<<(std::ostream& os, const MutableDocument& doc); + +inline bool operator!=(const MutableDocument& lhs, const MutableDocument& rhs) { + return !(lhs == rhs); +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MUTABLE_DOCUMENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc new file mode 100644 index 0000000..5f8ff96 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc @@ -0,0 +1,169 @@ +/* + * 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/mutation.h" + +#include +#include +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/object_value.h" +#include "Firestore/core/src/nanopb/message.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 { +namespace firestore { +namespace model { + +using nanopb::Message; + +std::string MutationResult::ToString() const { + return absl::StrCat( + "MutationResult(version=", version_.ToString(), + ", transform_results=", util::ToString(transform_results_), ")"); +} + +std::ostream& operator<<(std::ostream& os, const MutationResult& result) { + return os << result.ToString(); +} + +bool operator==(const MutationResult& lhs, const MutationResult& rhs) { + return lhs.version() == rhs.version() && + *lhs.transform_results_ == *rhs.transform_results_; +} + +void Mutation::ApplyToRemoteDocument( + MutableDocument& document, const MutationResult& mutation_result) const { + return rep().ApplyToRemoteDocument(document, mutation_result); +} + +void Mutation::ApplyToLocalView(MutableDocument& document, + const Timestamp& local_write_time) const { + return rep().ApplyToLocalView(document, local_write_time); +} + +absl::optional Mutation::Rep::ExtractTransformBaseValue( + const Document& document) const { + absl::optional base_object; + + for (const FieldTransform& transform : field_transforms_) { + auto existing_value = document->field(transform.path()); + auto coerced_value = + transform.transformation().ComputeBaseValue(existing_value); + if (coerced_value) { + if (!base_object) { + base_object = ObjectValue{}; + } + base_object->Set(transform.path(), std::move(*coerced_value)); + } + } + + return base_object; +} + +Mutation::Rep::Rep(DocumentKey&& key, Precondition&& precondition) + : key_(std::move(key)), + precondition_(std::move(precondition)), + field_transforms_(std::vector()) { +} + +Mutation::Rep::Rep(DocumentKey&& key, + Precondition&& precondition, + std::vector&& field_transforms) + : key_(std::move(key)), + precondition_(std::move(precondition)), + field_transforms_(std::move(field_transforms)) { +} + +bool Mutation::Rep::Equals(const Mutation::Rep& other) const { + return type() == other.type() && key_ == other.key_ && + precondition_ == other.precondition_ && + field_transforms_ == other.field_transforms_; +} + +void Mutation::Rep::VerifyKeyMatches(const MutableDocument& document) const { + HARD_ASSERT(document.key() == key(), + "Can only apply a mutation to a document with the same key"); +} + +SnapshotVersion Mutation::Rep::GetPostMutationVersion( + const MutableDocument& document) { + if (document.is_found_document()) { + return document.version(); + } else { + return SnapshotVersion::None(); + } +} + +TransformMap Mutation::Rep::ServerTransformResults( + const ObjectValue& previous_data, + const Message& server_transform_results) + const { + TransformMap transform_results; + HARD_ASSERT( + field_transforms_.size() == server_transform_results->values_count, + "server transform result size (%s) should match field transforms " + "size (%s)", + server_transform_results->values_count, field_transforms_.size()); + + for (size_t i = 0; i < server_transform_results->values_count; ++i) { + const FieldTransform& field_transform = field_transforms_[i]; + const TransformOperation& transform = field_transform.transformation(); + const auto& previous_value = previous_data.Get(field_transform.path()); + Message transformed_value = + transform.ApplyToRemoteDocument( + previous_value, DeepClone(server_transform_results->values[i])); + transform_results[field_transform.path()] = std::move(transformed_value); + } + return transform_results; +} + +TransformMap Mutation::Rep::LocalTransformResults( + const ObjectValue& previous_data, const Timestamp& local_write_time) const { + TransformMap transform_results; + for (const FieldTransform& field_transform : field_transforms_) { + const TransformOperation& transform = field_transform.transformation(); + const auto& previous_value = previous_data.Get(field_transform.path()); + Message transformed_value = + transform.ApplyToLocalView(previous_value, local_write_time); + transform_results[field_transform.path()] = std::move(transformed_value); + } + return transform_results; +} + +bool operator==(const Mutation& lhs, const Mutation& rhs) { + return lhs.rep_ == nullptr + ? rhs.rep_ == nullptr + : (rhs.rep_ != nullptr && lhs.rep_->Equals(*rhs.rep_)); +} + +size_t Mutation::Rep::Hash() const { + return util::Hash(type(), key(), precondition(), field_transforms()); +} + +std::ostream& operator<<(std::ostream& os, const Mutation& mutation) { + return os << mutation.ToString(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h new file mode 100644 index 0000000..c644f8f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h @@ -0,0 +1,350 @@ +/* + * 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_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_H_ + +#include +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_transform.h" +#include "Firestore/core/src/model/object_value.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/nanopb/message.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace model { + +class Document; +class MutableDocument; + +/** + * The result of applying a mutation to the server. This is a model of the + * WriteResult proto message. + * + * Note that MutationResult does not name which document was mutated. The + * association is implied positionally: for each entry in the array of + * Mutations, there's a corresponding entry in the array of MutationResults. + */ +class MutationResult { + public: + /** Takes ownership of `transform_results`. */ + MutationResult( + SnapshotVersion version, + nanopb::Message transform_results) + : version_(version), transform_results_{std::move(transform_results)} { + } + + MutationResult(MutationResult&& other) noexcept + : version_{other.version_}, + transform_results_{std::move(other.transform_results_)} { + } + + /** + * The version at which the mutation was committed. + * + * - For most operations, this is the update_time in the WriteResult. + * - For deletes, it is the commit_time of the WriteResponse (because + * deletes are not stored and have no update_time). + * + * Note that these versions can be different: No-op writes will not change + * the update_time even though the commit_time advances. + */ + const SnapshotVersion& version() const { + return version_; + } + + /** + * The resulting fields returned from the backend after a TransformMutation + * has been committed. Contains one FieldValue for each FieldTransform that + * was in the mutation. + * + * Will be nullopt if the mutation was not a TransformMutation. + */ + const nanopb::Message& transform_results() + const { + return transform_results_; + } + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, + const MutationResult& result); + + friend bool operator==(const MutationResult& lhs, const MutationResult& rhs); + + private: + SnapshotVersion version_; + nanopb::Message transform_results_; +}; + +/** + * Represents a Mutation of a document. Different subclasses of Mutation will + * perform different kinds of changes to a base document. For example, a + * SetMutation replaces the value of a document and a DeleteMutation deletes a + * document. + * + * In addition to the value of the document mutations also operate on the + * version. For local mutations (mutations that haven't been committed yet), we + * preserve the existing version for Set and Patch mutations. For + * local deletes, we reset the version to 0. + * + * Here's the expected transition table. + * + * MUTATION APPLIED TO RESULTS IN + * SetMutation Document(v3) Document(v3) + * SetMutation NoDocument(v3) Document(v0) + * SetMutation null Document(v0) + * PatchMutation Document(v3) Document(v3) + * PatchMutation NoDocument(v3) NoDocument(v3) + * PatchMutation null null + * DeleteMutation Document(v3) NoDocument(v0) + * DeleteMutation NoDocument(v3) NoDocument(v0) + * DeleteMutation null NoDocument(v0) + * + * For acknowledged mutations, we use the update_time of the WriteResponse as + * the resulting version for Set and Patch mutations. As deletes have no + * explicit update time, we use the commit_time of the WriteResponse for + * acknowledged deletes. + * + * If a mutation is acknowledged by the backend but fails the precondition + * check locally, we return an `UnknownDocument` and rely on Watch to send us + * the updated version. + * + * Field transforms are used only with Patch and Set Mutations. We use the + * `updateTransforms` field to store transforms, rather than the `transforms` + * message. + * + * Note: Mutation and its subclasses are specially designed to avoid slicing. + * You can assign a subclass of Mutation to an instance of Mutation and the + * full value is preserved, unsliced. Each subclass declares an explicit + * constructor that can recover the derived type. This means that code like + * this will work: + * + * SetMutation set(...); + * Mutation mutation = set; + * SetMutation recovered(mutation); + * + * The final line results in an explicit check that will fail if the type of + * the underlying data is not actually Type::Set. + */ +class Mutation { + public: + /** + * Represents the mutation type. This is used in place of dynamic_cast. + */ + enum class Type { Set, Patch, Delete, Verify }; + + /** Creates an invalid mutation. */ + Mutation() = default; + + /** + * Returns true if the given mutation is a valid instance. Default constructed + * and moved-from Mutations are not valid. + */ + bool is_valid() const { + return rep_ != nullptr; + } + + /** The runtime type of this mutation. */ + Type type() const { + return rep().type(); + } + + const DocumentKey& key() const { + return rep().key(); + } + const Precondition& precondition() const { + return rep().precondition(); + } + + const std::vector& field_transforms() const { + return rep().field_transforms(); + } + + /** + * Applies this mutation to the given Document for the purposes of computing + * the committed state of the document after the server has acknowledged that + * this mutation has been successfully committed. + * + * If the input document doesn't match the expected state (e.g. it is invalid + * or outdated), the document state may transition to unknown. + * + * @param document The document to mutate. + * @param mutation_result The backend's response of successfully applying the + * mutation. + */ + void ApplyToRemoteDocument(MutableDocument& document, + const MutationResult& mutation_result) const; + + /** + * Estimates the latency compensated view of this mutation applied to the + * given MaybeDocument. + * + * Unlike ApplyToRemoteDocument, this method is used before the mutation has + * been committed and so it's possible that the mutation is operating on a + * locally non-existent document and may produce a non-existent document. + * + * @param document The document to mutate. + * @param local_write_time A timestamp indicating the local write time of the + * batch this mutation is a part of. + */ + void ApplyToLocalView(MutableDocument& document, + const Timestamp& local_write_time) const; + + /** + * If this mutation is not idempotent, returns the base value to persist with + * this mutation. If a base value is returned, the mutation is always + * applied to this base value, even if document has already been updated. + * + * The base value is a sparse object that consists of only the document + * fields for which this mutation contains a non-idempotent transformation + * (e.g. a numeric increment). The provided value guarantees consistent + * behavior for non-idempotent transforms and allow us to return the same + * latency-compensated value even if the backend has already applied the + * mutation. The base value is empty for idempotent mutations, as they can be + * re-played even if the backend has already applied them. + * + * @return a base value to store along with the mutation, or empty for + * idempotent mutations. + */ + absl::optional ExtractTransformBaseValue( + const Document& document) const { + return rep_->ExtractTransformBaseValue(document); + } + + friend bool operator==(const Mutation& lhs, const Mutation& rhs); + + size_t Hash() const { + return rep().Hash(); + } + + std::string ToString() const { + return rep_ ? rep().ToString() : "(invalid)"; + } + + friend std::ostream& operator<<(std::ostream& os, const Mutation& mutation); + + protected: + class Rep { + public: + Rep(DocumentKey&& key, Precondition&& precondition); + + Rep(DocumentKey&& key, + Precondition&& precondition, + std::vector&& field_transforms); + + virtual ~Rep() = default; + + virtual Type type() const = 0; + + const DocumentKey& key() const { + return key_; + } + + const Precondition& precondition() const { + return precondition_; + } + + const std::vector& field_transforms() const { + return field_transforms_; + } + + virtual void ApplyToRemoteDocument( + MutableDocument& document, + const MutationResult& mutation_result) const = 0; + + virtual void ApplyToLocalView(MutableDocument& document, + const Timestamp& local_write_time) const = 0; + + virtual absl::optional ExtractTransformBaseValue( + const Document& document) const; + + /** + * Creates a map of "transform results" (a transform result is a field + * value representing the result of applying a transform) for use after a + * mutation containing transforms has been acknowledged by the server. + * + * @param previous_data The state of the data before applying this mutation. + * @param server_transform_results The transform results received by the + * server. + * @return A map of fields to transform results. + */ + TransformMap ServerTransformResults( + const ObjectValue& previous_data, + const nanopb::Message& + server_transform_results) const; + + /** + * Creates a map of "transform results" (a transform result is a field + * value representing the result of applying a transform) for use when + * applying a transform locally. + * + * @param previous_data The state of the data before applying this mutation. + * @param local_write_time The local time of the mutation (used to generate + * ServerTimestampValues). + * @return A map of fields to transform results. + */ + TransformMap LocalTransformResults(const ObjectValue& previous_data, + const Timestamp& local_write_time) const; + + virtual bool Equals(const Rep& other) const; + + virtual size_t Hash() const; + + virtual std::string ToString() const = 0; + + protected: + void VerifyKeyMatches(const MutableDocument& document) const; + + static SnapshotVersion GetPostMutationVersion( + const MutableDocument& document); + + private: + DocumentKey key_; + Precondition precondition_; + std::vector field_transforms_; + }; + + explicit Mutation(std::shared_ptr&& rep) : rep_(std::move(rep)) { + } + + const Rep& rep() const { + return *NOT_NULL(rep_); + } + + private: + std::shared_ptr rep_; +}; + +inline bool operator!=(const Mutation& lhs, const Mutation& rhs) { + return !(lhs == rhs); +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc new file mode 100644 index 0000000..fbf691f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc @@ -0,0 +1,125 @@ +/* + * 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/model/mutation_batch.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/mutable_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 { +namespace model { + +MutationBatch::MutationBatch(int batch_id, + Timestamp local_write_time, + std::vector base_mutations, + std::vector mutations) + : batch_id_(batch_id), + local_write_time_(std::move(local_write_time)), + base_mutations_(std::move(base_mutations)), + mutations_(std::move(mutations)) { + HARD_ASSERT(!mutations_.empty(), "Cannot create an empty mutation batch"); +} + +void MutationBatch::ApplyToRemoteDocument( + MutableDocument& document, + const MutationBatchResult& mutation_batch_result) const { + const auto& mutation_results = mutation_batch_result.mutation_results(); + HARD_ASSERT(mutation_results.size() == mutations_.size(), + "Mismatch between mutations length (%s) and results length (%s)", + mutations_.size(), mutation_results.size()); + + for (size_t i = 0; i < mutations_.size(); i++) { + const Mutation& mutation = mutations_[i]; + if (mutation.key() == document.key()) { + mutation.ApplyToRemoteDocument(document, mutation_results[i]); + } + } +} + +void MutationBatch::ApplyToLocalDocument(MutableDocument& document) const { + // First, apply the base state. This allows us to apply non-idempotent + // transform against a consistent set of values. + for (const Mutation& mutation : base_mutations_) { + if (mutation.key() == document.key()) { + mutation.ApplyToLocalView(document, local_write_time_); + } + } + + // Second, apply all user-provided mutations. + for (const Mutation& mutation : mutations_) { + if (mutation.key() == document.key()) { + mutation.ApplyToLocalView(document, local_write_time_); + } + } +} + +void MutationBatch::ApplyToLocalDocumentSet(DocumentMap& document_map) const { + // TODO(mrschmidt): This implementation is O(n^2). If we iterate through the + // mutations first (as done in `applyToLocalDocument:documentKey:`), we can + // reduce the complexity to O(n). + + for (const Mutation& mutation : mutations_) { + const DocumentKey& key = mutation.key(); + + auto it = document_map.find(key); + HARD_ASSERT(it != document_map.end(), "document for key %s not found", + key.ToString()); + // TODO(mutabledocuments): This method should take a map of MutableDocuments + // and we should remove this cast. + auto& document = const_cast(it->second.get()); + ApplyToLocalDocument(document); + if (!document.is_valid_document()) { + document.ConvertToNoDocument(SnapshotVersion::None()); + } + } +} + +DocumentKeySet MutationBatch::keys() const { + DocumentKeySet set; + for (const Mutation& mutation : mutations_) { + set = set.insert(mutation.key()); + } + return set; +} + +bool operator==(const MutationBatch& lhs, const MutationBatch& rhs) { + return lhs.batch_id() == rhs.batch_id() && + lhs.local_write_time() == rhs.local_write_time() && + lhs.base_mutations() == rhs.base_mutations() && + lhs.mutations() == rhs.mutations(); +} + +std::string MutationBatch::ToString() const { + return absl::StrCat("MutationBatch(id=", batch_id_, + ", local_write_time=", local_write_time_.ToString(), + ", mutations=", util::ToString(mutations_), ")"); +} + +std::ostream& operator<<(std::ostream& os, const MutationBatch& batch) { + return os << batch.ToString(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h new file mode 100644 index 0000000..f71879e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h @@ -0,0 +1,144 @@ +/* + * 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_MUTATION_BATCH_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_H_ + +#include +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/timestamp.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 MutableDocument; + +/** + * A BatchID that was searched for and not found or a batch ID value known to + * be before all known batches. + * + * BatchId values from the local store are non-negative so this value is before + * all batches. + */ +constexpr BatchId kBatchIdUnknown = -1; + +/** + * 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 + * immediately. When a batch is a tombstone it has no mutations. + */ +class MutationBatch { + public: + MutationBatch(int batch_id, + Timestamp local_write_time, + std::vector base_mutations, + std::vector mutations); + + /** The unique ID of this mutation batch. */ + int batch_id() const { + return batch_id_; + } + + /** + * Returns the local time at which the mutation batch was created / written; + * used to assign local times to server timestamps, etc. + */ + const Timestamp& local_write_time() const { + return local_write_time_; + } + + /** + * Mutations that are used to populate the base values when this mutation is + * applied locally. This can be used to locally overwrite values that are + * persisted in the remote document cache. Base mutations are never sent to + * the backend. + */ + const std::vector& base_mutations() const { + return base_mutations_; + } + + /** + * The user-provided mutations in this mutation batch. User-provided + * mutations are applied both locally and remotely on the backend. + */ + const std::vector& mutations() const { + return mutations_; + } + + /** + * Applies all the mutations in this MutationBatch to the specified document + * to create a new remote document. + * + * @param document The document to which to apply mutations. + * @param mutation_batch_result The result of applying the MutationBatch to + * the backend. + */ + void ApplyToRemoteDocument( + MutableDocument& document, + const MutationBatchResult& mutation_batch_result) const; + + /** + * Estimates the latency compensated view of all the mutations in this batch + * applied to the given MaybeDocument. + * + * Unlike ApplyToRemoteDocument, this method is used before the mutation has + * been committed and so it's possible that the mutation is operating on a + * locally non-existent document and may produce a non-existent document. + * + * @param document The document to which to apply mutations. + */ + void ApplyToLocalDocument(MutableDocument& document) const; + + /** + * Computes the local view for all provided documents given the mutations in + * this batch. + */ + void ApplyToLocalDocumentSet(DocumentMap& document_map) const; + + /** + * Returns the set of unique keys referenced by all mutations in the batch. + */ + DocumentKeySet keys() const; + + friend bool operator==(const MutationBatch& lhs, const MutationBatch& rhs); + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, const MutationBatch& batch); + + private: + int batch_id_; + Timestamp local_write_time_; + std::vector base_mutations_; + std::vector mutations_; +}; + +inline bool operator!=(const MutationBatch& lhs, const MutationBatch& rhs) { + return !(lhs == rhs); +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc new file mode 100644 index 0000000..ef34dac --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc @@ -0,0 +1,72 @@ +/* + * 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/model/mutation_batch_result.h" + +#include +#include + +#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 { +namespace firestore { +namespace model { + +MutationBatchResult::MutationBatchResult( + MutationBatch batch, + model::SnapshotVersion commit_version, + std::vector mutation_results, + nanopb::ByteString stream_token) + : batch_(std::move(batch)), + commit_version_(commit_version), + mutation_results_(std::move(mutation_results)), + stream_token_(std::move(stream_token)) { + HARD_ASSERT(batch_.mutations().size() == mutation_results_.size(), + "Number of mutations sent %s must equal results received %s", + batch_.mutations().size(), mutation_results_.size()); + + const auto& mutations = batch_.mutations(); + for (size_t i = 0; i < mutations.size(); i++) { + absl::optional version = mutation_results_[i].version(); + if (!version) { + // Deletes don't have a version, so we substitute the commit_version + // of the entire batch. + version = commit_version_; + } + + const DocumentKey& key = mutations[i].key(); + doc_versions_[key] = *version; + } +} + +std::string MutationBatchResult::ToString() const { + return absl::StrCat("MutationBatchResult(batch=", batch_.ToString(), + ", commit_version=", commit_version_.ToString(), + ", mutation_results=", util::ToString(mutation_results_), + ", stream_token=", util::ToString(stream_token_), ")"); +} + +std::ostream& operator<<(std::ostream& os, const MutationBatchResult& result) { + return os << result.ToString(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h new file mode 100644 index 0000000..2598e4f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h @@ -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. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ + +#include +#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/mutation_batch.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" + +namespace firebase { +namespace firestore { +namespace model { + +using DocumentVersionMap = + std::unordered_map; + +/** + * The result of applying a mutation batch to the backend. + * + * Note that unlike most classes in firebase::firestore::model, this class is + * just a grouping of result values and is not optimized for copying. + */ +class MutationBatchResult { + public: + /** + * Creates a new MutationBatchResult for the given batch and results. There + * must be one result for each mutation in the batch. This constructor caches + * a document=>version mapping (as doc_versions()). + */ + MutationBatchResult(MutationBatch batch, + SnapshotVersion commit_version, + std::vector mutation_results, + nanopb::ByteString stream_token); + + const MutationBatch& batch() const { + return batch_; + } + + const SnapshotVersion& commit_version() const { + return commit_version_; + } + + const std::vector& mutation_results() const { + return mutation_results_; + } + + const nanopb::ByteString& stream_token() const { + return stream_token_; + } + + const DocumentVersionMap& doc_versions() const { + return doc_versions_; + } + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, + const MutationBatchResult& result); + + private: + MutationBatch batch_; + SnapshotVersion commit_version_; + std::vector mutation_results_; + nanopb::ByteString stream_token_; + DocumentVersionMap doc_versions_; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.cc new file mode 100644 index 0000000..479e0ee --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.cc @@ -0,0 +1,383 @@ +/* + * Copyright 2021 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/object_value.h" + +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/nanopb/fields_array.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/types/span.h" + +namespace firebase { +namespace firestore { +namespace model { + +namespace { + +using nanopb::CheckedSize; +using nanopb::FreeFieldsArray; +using nanopb::FreeNanopbMessage; +using nanopb::MakeArray; +using nanopb::MakeBytesArray; +using nanopb::MakeString; +using nanopb::MakeStringView; +using nanopb::Message; +using nanopb::ReleaseFieldOwnership; +using nanopb::SetRepeatedField; + +struct MapEntryKeyCompare { + bool operator()(const google_firestore_v1_MapValue_FieldsEntry& entry, + absl::string_view segment) const { + return nanopb::MakeStringView(entry.key) < segment; + } + bool operator()(absl::string_view segment, + const google_firestore_v1_MapValue_FieldsEntry& entry) const { + return segment < nanopb::MakeStringView(entry.key); + } +}; + +/** + * Finds an entry by key in the provided map value. Returns `nullptr` if the + * entry does not exist. + */ +google_firestore_v1_MapValue_FieldsEntry* FindEntry( + const google_firestore_v1_Value& value, absl::string_view segment) { + if (!IsMap(value)) { + return nullptr; + } + const google_firestore_v1_MapValue& map_value = value.map_value; + + // MapValues in iOS are always stored in sorted order. + auto found = std::equal_range(map_value.fields, + map_value.fields + map_value.fields_count, + segment, MapEntryKeyCompare()); + + if (found.first == found.second) { + return nullptr; + } + + return found.first; +} + +size_t CalculateSizeOfUnion( + const google_firestore_v1_MapValue& map_value, + const std::map>& upserts, + const std::set& deletes) { + // Compute the size of the map after applying all mutations. The final size is + // the number of existing entries, plus the number of new entries + // minus the number of deleted entries. + return upserts.size() + + std::count_if( + map_value.fields, map_value.fields + map_value.fields_count, + [&](const google_firestore_v1_MapValue_FieldsEntry& entry) { + std::string field = MakeString(entry.key); + // Don't count if entry is deleted or if it is a replacement + // rather than an insert. + return deletes.find(field) == deletes.end() && + upserts.find(field) == upserts.end(); + }); +} + +/** + * Modifies `parent_map` by adding, replacing or deleting the specified + * entries. + */ +void ApplyChanges( + google_firestore_v1_MapValue* parent, + std::map> upserts, + std::set deletes) { + // TODO(mrschmidt): Consider using `absl::btree_map` and `absl::btree_set` for + // potentially better performance. + auto source_count = parent->fields_count; + auto* source_fields = parent->fields; + + size_t target_count = CalculateSizeOfUnion(*parent, upserts, deletes); + auto* target_fields = MakeArray( + CheckedSize(target_count)); + + auto delete_it = deletes.begin(); + auto upsert_it = upserts.begin(); + + // Merge the existing data with the deletes and updates + pb_size_t source_index = 0, target_index = 0; + while (target_index < target_count) { + auto& target_entry = target_fields[target_index]; + + if (source_index < source_count) { + auto& source_entry = source_fields[source_index]; + std::string source_key = MakeString(source_entry.key); + + // Check if the source key is deleted + if (delete_it != deletes.end() && *delete_it == source_key) { + FreeFieldsArray(&source_entry); + + ++delete_it; + ++source_index; + continue; + } + + // Check if the source key is updated by the next upsert + if (upsert_it != upserts.end() && upsert_it->first == source_key) { + FreeFieldsArray(&source_entry.value); + + target_entry.key = source_entry.key; + target_entry.value = *(upsert_it->second.release()); + SortFields(target_entry.value); + + ++upsert_it; + ++source_index; + ++target_index; + continue; + } + + // Check if the source key comes before the next upsert + if (upsert_it == upserts.end() || upsert_it->first > source_key) { + target_entry = source_entry; + + ++source_index; + ++target_index; + continue; + } + } + + // Otherwise, insert the next upsert. + target_entry.key = MakeBytesArray(upsert_it->first); + target_entry.value = *(upsert_it->second.release()); + SortFields(target_entry.value); + + ++upsert_it; + ++target_index; + } + + // Delete any remaining fields in the original map. This only includes fields + // that were deleted. + for (; source_index < source_count; ++source_index) { + FreeFieldsArray(&source_fields[source_index]); + } + + free(parent->fields); + parent->fields = target_fields; + parent->fields_count = CheckedSize(target_count); +} + +} // namespace + +ObjectValue::ObjectValue() { + value_->which_value_type = google_firestore_v1_Value_map_value_tag; + value_->map_value = {}; +} + +ObjectValue::ObjectValue(Message value) + : value_(std::move(value)) { + HARD_ASSERT(value_ && IsMap(*value_), + "ObjectValues should be backed by a MapValue"); + SortFields(*value_); +} + +ObjectValue::ObjectValue(const ObjectValue& other) + : value_(DeepClone(*other.value_)) { +} + +ObjectValue ObjectValue::FromMapValue( + Message map_value) { + Message value; + value->which_value_type = google_firestore_v1_Value_map_value_tag; + value->map_value = *map_value.release(); + return ObjectValue{std::move(value)}; +} + +ObjectValue ObjectValue::FromFieldsEntry( + google_firestore_v1_Document_FieldsEntry* fields_entry, pb_size_t count) { + Message value; + value->which_value_type = google_firestore_v1_Value_map_value_tag; + SetRepeatedField( + &value->map_value.fields, &value->map_value.fields_count, + absl::Span(fields_entry, count), + [](const google_firestore_v1_Document_FieldsEntry& entry) { + return google_firestore_v1_MapValue_FieldsEntry{entry.key, entry.value}; + }); + // Prevent double-freeing of the document's fields. The fields are now owned + // by ObjectValue. + ReleaseFieldOwnership(fields_entry, count); + return ObjectValue{std::move(value)}; +} + +FieldMask ObjectValue::ToFieldMask() const { + return ExtractFieldMask(value_->map_value); +} + +FieldMask ObjectValue::ExtractFieldMask( + const google_firestore_v1_MapValue& value) const { + std::set fields; + + for (size_t i = 0; i < value.fields_count; ++i) { + const google_firestore_v1_MapValue_FieldsEntry& entry = value.fields[i]; + FieldPath current_path{MakeString(entry.key)}; + + if (!IsMap(entry.value)) { + fields.insert(std::move(current_path)); + continue; + } + + // Recursively extract the nested map + FieldMask nested_mask = ExtractFieldMask(entry.value.map_value); + if (nested_mask.begin() == nested_mask.end()) { + // Preserve the empty map by adding it to the FieldMask + fields.insert(std::move(current_path)); + } else { + for (const FieldPath& nested_path : nested_mask) { + fields.insert(current_path.Append(nested_path)); + } + } + } + + return FieldMask(std::move(fields)); +} + +absl::optional ObjectValue::Get( + const FieldPath& path) const { + if (path.empty()) { + return *value_; + } + + google_firestore_v1_Value nested_value = *value_; + for (const std::string& segment : path) { + google_firestore_v1_MapValue_FieldsEntry* entry = + FindEntry(nested_value, segment); + if (!entry) return absl::nullopt; + nested_value = entry->value; + } + return nested_value; +} + +google_firestore_v1_Value ObjectValue::Get() const { + return *value_; +} + +void ObjectValue::Set(const FieldPath& path, + Message value) { + HARD_ASSERT(!path.empty(), "Cannot set field for empty path on ObjectValue"); + + google_firestore_v1_MapValue* parent_map = ParentMap(path.PopLast()); + + std::map> upserts; + upserts[path.last_segment()] = std::move(value); + + ApplyChanges(parent_map, std::move(upserts), /*deletes=*/{}); +} + +void ObjectValue::SetAll(TransformMap data) { + FieldPath parent; + + std::map> upserts; + std::set deletes; + + for (auto& it : data) { + const FieldPath& path = it.first; + absl::optional> value = + std::move(it.second); + + if (!parent.IsImmediateParentOf(path)) { + // Insert the accumulated changes at this parent location + google_firestore_v1_MapValue* parent_map = ParentMap(parent); + ApplyChanges(parent_map, std::move(upserts), std::move(deletes)); + upserts.clear(); + deletes.clear(); + parent = path.PopLast(); + } + + if (value) { + upserts[path.last_segment()] = std::move(*value); + } else { + deletes.insert(path.last_segment()); + } + } + + google_firestore_v1_MapValue* parent_map = ParentMap(parent); + ApplyChanges(parent_map, std::move(upserts), std::move(deletes)); +} + +void ObjectValue::Delete(const FieldPath& path) { + HARD_ASSERT(!path.empty(), "Cannot delete field with empty path"); + + google_firestore_v1_Value* nested_value = value_.get(); + for (const std::string& segment : path.PopLast()) { + auto* entry = FindEntry(*nested_value, segment); + // If the entry is not found, exit early. There is nothing to delete. + if (!entry) return; + nested_value = &entry->value; + } + + // We can only delete a leaf entry if its parent is a map. + if (IsMap(*nested_value)) { + std::set deletes{path.last_segment()}; + ApplyChanges(&nested_value->map_value, /*upserts=*/{}, deletes); + } +} + +std::string ObjectValue::ToString() const { + return CanonicalId(*value_); +} + +size_t ObjectValue::Hash() const { + return util::Hash(CanonicalId(*value_)); +} + +google_firestore_v1_MapValue* ObjectValue::ParentMap(const FieldPath& path) { + google_firestore_v1_Value* parent = value_.get(); + + // Find a or create a parent map entry for `path`. + for (const std::string& segment : path) { + google_firestore_v1_MapValue_FieldsEntry* entry = + FindEntry(*parent, segment); + + if (entry) { + if (entry->value.which_value_type != + google_firestore_v1_Value_map_value_tag) { + // Since the element is not a map value, free all existing data and + // change it to a map type. + FreeFieldsArray(&entry->value); + entry->value.which_value_type = google_firestore_v1_Value_map_value_tag; + entry->value.map_value = {}; + } + + parent = &entry->value; + } else { + // Create a new map value for the current segment. + Message new_entry; + new_entry->which_value_type = google_firestore_v1_Value_map_value_tag; + new_entry->map_value = {}; + + std::map> upserts; + upserts[segment] = std::move(new_entry); + ApplyChanges(&parent->map_value, std::move(upserts), /*deletes=*/{}); + + parent = &(FindEntry(*parent, segment)->value); + } + } + + return &parent->map_value; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.h new file mode 100644 index 0000000..45f505a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/object_value.h @@ -0,0 +1,151 @@ +/* + * Copyright 2021 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_OBJECT_VALUE_H_ +#define FIRESTORE_CORE_SRC_MODEL_OBJECT_VALUE_H_ + +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace model { + +/** A structured object value stored in Firestore. */ +class ObjectValue { + public: + ObjectValue(); + + /** Creates a new ObjectValue */ + explicit ObjectValue(nanopb::Message value); + + ObjectValue(ObjectValue&& other) noexcept = default; + ObjectValue& operator=(ObjectValue&& other) noexcept = default; + ObjectValue(const ObjectValue& other); + + ObjectValue& operator=(const ObjectValue&) = delete; + + /** + * Creates a new ObjectValue that is backed by the given `map_value`. + * ObjectValue takes on ownership of the data. + */ + static ObjectValue FromMapValue( + nanopb::Message map_value); + + /** + * Creates a new ObjectValue that is backed by the provided document fields. + * ObjectValue takes on ownership of the data and zeroes out the pointers in + * `fields_entry`. This allows the callsite to destruct the Document proto + * without affecting the fields data. + */ + static ObjectValue FromFieldsEntry( + google_firestore_v1_Document_FieldsEntry* fields_entry, pb_size_t count); + + /** Recursively extracts the FieldPaths that are set in this ObjectValue. */ + FieldMask ToFieldMask() const; + + /** + * Returns the value at the given path or null. + * + * @param path the path to search + * @return The value at the path or null if it doesn't exist. + */ + absl::optional Get(const FieldPath& path) const; + + /** + * Returns the ObjectValue in its Protobuf representation. + */ + google_firestore_v1_Value Get() const; + + /** + * Sets the field to the provided value. + * + * @param path The field path to set. The path must not be empty. + * @param value The value to set. + */ + void Set(const FieldPath& path, + nanopb::Message value); + + /** + * Sets the provided fields to the provided values. Fields set to `nullopt` + * are deleted. + * + * Takes ownership of data. + * + * @param data A map of fields to values (or nullopt for deletes) + */ + void SetAll(TransformMap data); + + /** + * Removes the field at the specified path. If there is no field at the + * specified path, nothing is changed. + * + * @param path The field path to remove. The path must not be empty. + */ + void Delete(const FieldPath& path); + + std::string ToString() const; + + size_t Hash() const; + + friend bool operator==(const ObjectValue& lhs, const ObjectValue& rhs); + friend std::ostream& operator<<(std::ostream& out, + const ObjectValue& object_value); + + private: + /** Returns the field mask for the provided map value. */ + FieldMask ExtractFieldMask(const google_firestore_v1_MapValue& value) const; + + /** + * Returns the map that contains the leaf element of `path`. If the parent + * entry does not yet exist, or if it is not a map, a new map will be created. + */ + google_firestore_v1_MapValue* ParentMap(const FieldPath& path); + + nanopb::Message value_; +}; + +inline bool operator==(const ObjectValue& lhs, const ObjectValue& rhs) { + return *lhs.value_ == *rhs.value_; +} + +inline bool operator!=(const ObjectValue& lhs, const ObjectValue& rhs) { + return !(lhs == rhs); +} + +inline std::ostream& operator<<(std::ostream& out, + const ObjectValue& object_value) { + return out << "ObjectValue(" << *object_value.value_ << ")"; +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_OBJECT_VALUE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc new file mode 100644 index 0000000..537367c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc @@ -0,0 +1,149 @@ +/* + * 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/model/patch_mutation.h" + +#include +#include + +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" + +namespace firebase { +namespace firestore { +namespace model { + +using nanopb::Message; + +static_assert( + sizeof(Mutation) == sizeof(PatchMutation), + "PatchMutation may not have additional members (everything goes in Rep)"); + +PatchMutation::PatchMutation(DocumentKey key, + ObjectValue value, + FieldMask mask, + Precondition precondition, + std::vector field_transforms) + : Mutation(std::make_shared(std::move(key), + std::move(value), + std::move(mask), + std::move(precondition), + std::move(field_transforms))) { +} + +PatchMutation::PatchMutation(const Mutation& mutation) : Mutation(mutation) { + HARD_ASSERT(type() == Type::Patch); +} + +PatchMutation::PatchMutation(DocumentKey key, + ObjectValue value, + FieldMask mask, + Precondition precondition) + : Mutation(std::make_shared(std::move(key), + std::move(value), + std::move(mask), + std::move(precondition), + std::vector())) { +} + +PatchMutation::Rep::Rep(DocumentKey&& key, + ObjectValue&& value, + FieldMask&& mask, + Precondition&& precondition, + std::vector&& field_transforms) + : Mutation::Rep( + std::move(key), std::move(precondition), std::move(field_transforms)), + value_(std::move(value)), + mask_(std::move(mask)) { +} + +void PatchMutation::Rep::ApplyToRemoteDocument( + MutableDocument& document, const MutationResult& mutation_result) const { + VerifyKeyMatches(document); + + if (!precondition().IsValidFor(document)) { + // Since the mutation was not rejected, we know that the precondition + // matched on the backend. We therefore must not have the expected version + // of the document in our cache and return an UnknownDocument with the known + // update_time. + document.ConvertToUnknownDocument(mutation_result.version()); + return; + } + + ObjectValue& data = document.data(); + auto transform_results = + ServerTransformResults(data, mutation_result.transform_results()); + data.SetAll(GetPatch()); + data.SetAll(std::move(transform_results)); + document.ConvertToFoundDocument(mutation_result.version()) + .SetHasCommittedMutations(); +} + +void PatchMutation::Rep::ApplyToLocalView( + MutableDocument& document, const Timestamp& local_write_time) const { + VerifyKeyMatches(document); + + if (!precondition().IsValidFor(document)) { + return; + } + + ObjectValue& data = document.data(); + auto transform_results = LocalTransformResults(data, local_write_time); + data.SetAll(GetPatch()); + data.SetAll(std::move(transform_results)); + document.ConvertToFoundDocument(GetPostMutationVersion(document)) + .SetHasLocalMutations(); +} + +TransformMap PatchMutation::Rep::GetPatch() const { + TransformMap result; + for (const FieldPath& path : mask_) { + if (!path.empty()) { + auto value = value_.Get(path); + if (value) { + result[path] = DeepClone(*value); + } else { + result[path] = absl::nullopt; + } + } + } + return result; +} + +bool PatchMutation::Rep::Equals(const Mutation::Rep& other) const { + if (!Mutation::Rep::Equals(other)) return false; + + const auto& other_rep = static_cast(other); + return value_ == other_rep.value_ && mask_ == other_rep.mask_; +} + +size_t PatchMutation::Rep::Hash() const { + return util::Hash(Mutation::Rep::Hash(), mask_, value_); +} + +std::string PatchMutation::Rep::ToString() const { + return absl::StrCat("PatchMutation(key=", key().ToString(), + ", precondition=", precondition().ToString(), + ", value=", value().ToString(), + ", mask=", mask().ToString(), + ", transforms=", util::ToString(field_transforms()), ")"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h new file mode 100644 index 0000000..4b34cd2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h @@ -0,0 +1,138 @@ +/* + * 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_PATCH_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_PATCH_MUTATION_H_ + +#include +#include +#include +#include +#include + +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** + * A mutation that modifies fields of the document at the given key with the + * given values. The values are applied through a field mask: + * + * - When a field is in both the mask and the values, the corresponding field is + * updated. + * - When a field is in neither the mask nor the values, the corresponding field + * is unmodified. + * - When a field is in the mask but not in the values, the corresponding field + * is deleted. + * - When a field is not in the mask but is in the values, the values map is + * ignored. + */ +class PatchMutation : public Mutation { + public: + PatchMutation(DocumentKey key, + ObjectValue value, + FieldMask mask, + Precondition precondition); + + PatchMutation(DocumentKey key, + ObjectValue value, + FieldMask mask, + Precondition precondition, + std::vector field_transforms); + + /** + * Casts a Mutation to a PatchMutation. This is a checked operation that will + * assert if the type of the Mutation isn't actually Type::Patch. + */ + explicit PatchMutation(const Mutation& mutation); + + /** Creates an invalid PatchMutation instance. */ + PatchMutation() = default; + + /** + * Returns the fields and associated values to use when patching the document. + */ + const ObjectValue& value() const { + return patch_rep().value(); + } + + /** + * Returns the mask to apply to value(), where only fields that are in both + * the field_mask and the value will be updated. + */ + const FieldMask& mask() const { + return patch_rep().mask(); + } + + private: + class Rep : public Mutation::Rep { + public: + Rep(DocumentKey&& key, + ObjectValue&& value, + FieldMask&& mask, + Precondition&& precondition, + std::vector&& field_transforms); + + Type type() const override { + return Type::Patch; + } + + const ObjectValue& value() const { + return value_; + } + + const FieldMask& mask() const { + return mask_; + } + + /** + * Returns this patch mutation as a list of field paths to values (or + * nullopt for deletes). + */ + TransformMap GetPatch() const; + + void ApplyToRemoteDocument( + MutableDocument& document, + const MutationResult& mutation_result) const override; + + void ApplyToLocalView(MutableDocument& document, + const Timestamp& local_write_time) const override; + + bool Equals(const Mutation::Rep& other) const override; + + size_t Hash() const override; + + std::string ToString() const override; + + private: + ObjectValue value_; + FieldMask mask_; + }; + + const Rep& patch_rep() const { + return static_cast(rep()); + } +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_PATCH_MUTATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc new file mode 100644 index 0000000..cacf788 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc @@ -0,0 +1,81 @@ +/* + * 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/precondition.h" + +#include "Firestore/core/src/model/mutable_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 { +namespace firestore { +namespace model { + +Precondition::Precondition(Type type, SnapshotVersion update_time, bool exists) + : type_(type), update_time_(std::move(update_time)), exists_(exists) { +} + +/* static */ +Precondition Precondition::Exists(bool exists) { + return Precondition{Type::Exists, SnapshotVersion::None(), exists}; +} + +/* static */ +Precondition Precondition::UpdateTime(SnapshotVersion update_time) { + // update_time could be SnapshotVersion::None() in particular for locally + // deleted documents. + return Precondition{Type::UpdateTime, std::move(update_time), false}; +} + +/* static */ +Precondition Precondition::None() { + return Precondition{Type::None, SnapshotVersion::None(), false}; +} + +bool Precondition::IsValidFor(const MutableDocument& document) const { + switch (type_) { + case Type::UpdateTime: + return document.is_found_document() && document.version() == update_time_; + case Type::Exists: + return exists_ == document.is_found_document(); + case Type::None: + return true; + } + UNREACHABLE(); +} + +size_t Precondition::Hash() const { + return util::Hash(update_time_, exists_, type_); +} + +std::string Precondition::ToString() const { + switch (type_) { + case Type::None: + return "Precondition()"; + case Type::Exists: + return absl::StrCat("Precondition(exists=", exists_, ")"); + case Type::UpdateTime: + return absl::StrCat("Precondition(update_time=", update_time_.ToString(), + ")"); + } + UNREACHABLE(); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.h new file mode 100644 index 0000000..0f58a89 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.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_PRECONDITION_H_ +#define FIRESTORE_CORE_SRC_MODEL_PRECONDITION_H_ + +#include +#include + +#include "Firestore/core/src/model/snapshot_version.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace model { + +class MutableDocument; + +/** + * Encodes a precondition for a mutation. This follows the model that the + * backend accepts with the special case of an explicit "empty" precondition + * (meaning no precondition). + */ +class Precondition { + public: + enum class Type { + None, + Exists, + UpdateTime, + }; + + /** Creates a new Precondition with an exists flag. */ + static Precondition Exists(bool exists); + + /** Creates a new Precondition based on a time the document exists at. */ + static Precondition UpdateTime(SnapshotVersion update_time); + + /** Returns a precondition representing no precondition. */ + static Precondition None(); + + /** + * Default constructor which is equivalent to Precondition::None(). Prefer + * calling Precondition::None for readability. + */ + Precondition() = default; + + /** + * Returns true if the precondition is valid for the given document (and the + * document is available). + */ + bool IsValidFor(const MutableDocument& document) const; + + Type type() const { + return type_; + } + + /** Returns whether this Precondition represents no precondition. */ + bool is_none() const { + return type_ == Type::None; + } + + const SnapshotVersion& update_time() const { + return update_time_; + } + + bool exists() const { + return exists_; + } + + bool operator==(const Precondition& other) const { + return type_ == other.type_ && update_time_ == other.update_time_ && + exists_ == other.exists_; + } + + size_t Hash() const; + + std::string ToString() const; + + private: + Precondition(Type type, SnapshotVersion update_time, bool exists); + + // The actual time of this precondition. + Type type_ = Type::None; + + // 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 + // exists. + bool exists_ = false; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_PRECONDITION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc new file mode 100644 index 0000000..a6549b7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc @@ -0,0 +1,63 @@ +/* + * 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/resource_path.h" + +#include +#include +#include + +#include "Firestore/core/src/util/exception.h" +#include "absl/strings/match.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_split.h" + +namespace firebase { +namespace firestore { +namespace model { + +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). + + if (absl::StrContains(path, "//")) { + util::ThrowInvalidArgument( + "Invalid path (%s). Paths must not contain // in them.", path); + } + + // SkipEmpty because we may still have an empty segment at the beginning or + // end if they had a leading or trailing slash (which we allow). + std::vector segments = + absl::StrSplit(path, '/', absl::SkipEmpty()); + return ResourcePath{std::move(segments)}; +} + +std::string ResourcePath::CanonicalString() const { + // 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). + + return absl::StrJoin(begin(), end(), "/"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.h new file mode 100644 index 0000000..ff098e8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.cc new file mode 100644 index 0000000..d723fcb --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.cc @@ -0,0 +1,123 @@ +/* + * Copyright 2021 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/server_timestamp_util.h" + +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace model { + +using nanopb::Message; + +const char kTypeKey[] = "__type__"; +const char kLocalWriteTimeKey[] = "__local_write_time__"; +const char kPreviousValueKey[] = "__previous_value__"; +const char kServerTimestampSentinel[] = "server_timestamp"; + +Message EncodeServerTimestamp( + const Timestamp& local_write_time, + absl::optional previous_value) { + pb_size_t count = previous_value ? 3 : 2; + + Message result; + result->which_value_type = google_firestore_v1_Value_map_value_tag; + result->map_value.fields_count = count; + result->map_value.fields = + nanopb::MakeArray(count); + + auto* field = result->map_value.fields; + field->key = nanopb::MakeBytesArray(kTypeKey); + field->value.which_value_type = google_firestore_v1_Value_string_value_tag; + field->value.string_value = nanopb::MakeBytesArray(kServerTimestampSentinel); + + ++field; + field->key = nanopb::MakeBytesArray(kLocalWriteTimeKey); + field->value.which_value_type = google_firestore_v1_Value_timestamp_value_tag; + field->value.timestamp_value.seconds = local_write_time.seconds(); + field->value.timestamp_value.nanos = local_write_time.nanoseconds(); + + if (previous_value) { + ++field; + field->key = nanopb::MakeBytesArray(kPreviousValueKey); + field->value = *DeepClone(*previous_value).release(); + } + + return result; +} + +bool IsServerTimestamp(const google_firestore_v1_Value& value) { + if (!IsMap(value)) { + return false; + } + + if (value.map_value.fields_count > 3) { + return false; + } + + for (size_t i = 0; i < value.map_value.fields_count; ++i) { + const auto& field = value.map_value.fields[i]; + absl::string_view key = nanopb::MakeStringView(field.key); + if (key == kTypeKey) { + return field.value.which_value_type == + google_firestore_v1_Value_string_value_tag && + nanopb::MakeStringView(field.value.string_value) == + kServerTimestampSentinel; + } + } + + return false; +} + +google_protobuf_Timestamp GetLocalWriteTime( + const firebase::firestore::google_firestore_v1_Value& value) { + for (size_t i = 0; i < value.map_value.fields_count; ++i) { + const auto& field = value.map_value.fields[i]; + absl::string_view key = nanopb::MakeStringView(field.key); + if (key == kLocalWriteTimeKey && + field.value.which_value_type == + google_firestore_v1_Value_timestamp_value_tag) { + return field.value.timestamp_value; + } + } + + HARD_FAIL("LocalWriteTime not found"); +} + +absl::optional GetPreviousValue( + const google_firestore_v1_Value& value) { + for (size_t i = 0; i < value.map_value.fields_count; ++i) { + const auto& field = value.map_value.fields[i]; + absl::string_view key = nanopb::MakeStringView(field.key); + if (key == kPreviousValueKey) { + if (IsServerTimestamp(field.value)) { + return GetPreviousValue(field.value); + } else { + return field.value; + } + } + } + + return absl::nullopt; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.h new file mode 100644 index 0000000..6fe8073 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/server_timestamp_util.h @@ -0,0 +1,61 @@ +/* + * Copyright 2021 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_SERVER_TIMESTAMP_UTIL_H_ +#define FIRESTORE_CORE_SRC_MODEL_SERVER_TIMESTAMP_UTIL_H_ + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/nanopb/message.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace model { + +// Utility methods to handle ServerTimestamps, which are stored using special +// sentinel fields in MapValues. + +/** Encodes the backing data for a server timestamp in a Value proto. */ +nanopb::Message EncodeServerTimestamp( + const Timestamp& local_write_time, + absl::optional previous_value); +/** + * Returns whether the provided value is a field map that contains the + * sentinel values of a ServerTimestamp. + */ +bool IsServerTimestamp(const google_firestore_v1_Value& value); + +/** + * Returns the local time at which the timestamp was written to the document. + */ +google_protobuf_Timestamp GetLocalWriteTime( + const google_firestore_v1_Value& value); + +/** + * Returns the value of the field before this ServerTimestamp was set. + * + * Preserving the previous values allows the user to display the last resolved + * value until the backend responds with the timestamp. + */ +absl::optional GetPreviousValue( + const google_firestore_v1_Value& value); + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_SERVER_TIMESTAMP_UTIL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc new file mode 100644 index 0000000..ba54681 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc @@ -0,0 +1,122 @@ +/* + * 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/model/set_mutation.h" + +#include +#include + +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/value_util.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/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace model { + +static_assert( + sizeof(Mutation) == sizeof(SetMutation), + "SetMutation may not have additional members (everything goes in Rep)"); + +SetMutation::SetMutation(DocumentKey key, + ObjectValue value, + Precondition precondition, + std::vector field_transforms) + : Mutation(std::make_shared(std::move(key), + std::move(value), + std::move(precondition), + std::move(field_transforms))) { +} + +SetMutation::SetMutation(const Mutation& mutation) : Mutation(mutation) { + HARD_ASSERT(type() == Type::Set); +} + +SetMutation::SetMutation(DocumentKey key, + ObjectValue value, + Precondition precondition) + : Mutation(std::make_shared(std::move(key), + std::move(value), + std::move(precondition), + std::vector())) { +} + +SetMutation::Rep::Rep(DocumentKey&& key, + ObjectValue&& value, + Precondition&& precondition, + std::vector&& field_transforms) + : Mutation::Rep( + std::move(key), std::move(precondition), std::move(field_transforms)), + value_(std::move(value)) { +} + +void SetMutation::Rep::ApplyToRemoteDocument( + MutableDocument& document, const MutationResult& mutation_result) const { + VerifyKeyMatches(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. + auto transform_results = ServerTransformResults( + document.data(), mutation_result.transform_results()); + ObjectValue new_data{DeepClone(value_.Get())}; + new_data.SetAll(std::move(transform_results)); + document + .ConvertToFoundDocument(mutation_result.version(), std::move(new_data)) + .SetHasCommittedMutations(); +} + +void SetMutation::Rep::ApplyToLocalView( + MutableDocument& document, const Timestamp& local_write_time) const { + VerifyKeyMatches(document); + + if (!precondition().IsValidFor(document)) { + return; + } + + auto transform_results = + LocalTransformResults(document.data(), local_write_time); + ObjectValue new_data{DeepClone(value_.Get())}; + new_data.SetAll(std::move(transform_results)); + document + .ConvertToFoundDocument(GetPostMutationVersion(document), + std::move(new_data)) + .SetHasLocalMutations(); +} + +bool SetMutation::Rep::Equals(const Mutation::Rep& other) const { + if (!Mutation::Rep::Equals(other)) return false; + + const auto& other_rep = static_cast(other); + return value_ == other_rep.value_; +} + +size_t SetMutation::Rep::Hash() const { + return util::Hash(Mutation::Rep::Hash(), value_); +} + +std::string SetMutation::Rep::ToString() const { + return absl::StrCat("SetMutation(key=", key().ToString(), + ", precondition=", precondition().ToString(), + ", value=", value().ToString(), + ", transforms=", util::ToString(field_transforms()), ")"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h new file mode 100644 index 0000000..b876f7b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h @@ -0,0 +1,102 @@ +/* + * 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_SET_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_SET_MUTATION_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/object_value.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** + * A mutation that creates or replaces the document at the given key with the + * object value contents. + */ +class SetMutation : public Mutation { + public: + SetMutation(DocumentKey key, ObjectValue value, Precondition precondition); + + SetMutation(DocumentKey key, + ObjectValue value, + Precondition precondition, + std::vector field_transforms); + + /** + * Casts a Mutation to a SetMutation. This is a checked operation that will + * assert if the type of the Mutation isn't actually Type::Set. + */ + explicit SetMutation(const Mutation& mutation); + + /** Creates an invalid SetMutation instance. */ + SetMutation() = default; + + /** Returns the object value to use when setting the document. */ + const ObjectValue& value() const { + return set_rep().value(); + } + + private: + class Rep : public Mutation::Rep { + public: + Rep(DocumentKey&& key, + ObjectValue&& value, + Precondition&& precondition, + std::vector&& field_transforms); + + Type type() const override { + return Type::Set; + } + + const ObjectValue& value() const { + return value_; + } + + void ApplyToRemoteDocument( + MutableDocument& document, + const MutationResult& mutation_result) const override; + + void ApplyToLocalView(MutableDocument& document, + const Timestamp& local_write_time) const override; + + bool Equals(const Mutation::Rep& other) const override; + + size_t Hash() const override; + + std::string ToString() const override; + + private: + ObjectValue value_; + }; + + const Rep& set_rep() const { + return static_cast(rep()); + } +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_SET_MUTATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.cc new file mode 100644 index 0000000..d7535f6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.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/model/snapshot_version.h" + +#include + +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace model { + +SnapshotVersion::SnapshotVersion(const Timestamp& timestamp) + : timestamp_(timestamp) { +} + +const SnapshotVersion& SnapshotVersion::None() { + static const SnapshotVersion kNone(Timestamp{}); + return kNone; +} + +util::ComparisonResult SnapshotVersion::CompareTo( + const SnapshotVersion& rhs) const { + return util::Compare(timestamp(), rhs.timestamp()); +} + +size_t SnapshotVersion::Hash() const { + return util::Hash(timestamp_.seconds(), timestamp_.nanoseconds()); +} + +std::string SnapshotVersion::ToString() const { + return timestamp_.ToString(); +} + +std::ostream& operator<<(std::ostream& os, const SnapshotVersion& version) { + return os << version.timestamp_; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h new file mode 100644 index 0000000..0bf8892 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h @@ -0,0 +1,68 @@ +/* + * 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_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/util/comparison.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** + * A version of a document in Firestore. This corresponds to the version + * timestamp, such as update_time or read_time. + */ +class SnapshotVersion : public util::Comparable { + public: + /** + * Creates a default SnapshotVersion equivalent to SnapshotVersion::None(). + * Prefer SnapshotVersion::None() for readability. + */ + SnapshotVersion() = default; + + explicit SnapshotVersion(const Timestamp& timestamp); + + const Timestamp& timestamp() const { + return timestamp_; + } + + /** Creates a new version that is smaller than all other versions. */ + static const SnapshotVersion& None(); + + util::ComparisonResult CompareTo(const SnapshotVersion& rhs) const; + + size_t Hash() const; + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, + const SnapshotVersion& version); + + private: + Timestamp timestamp_; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_SNAPSHOT_VERSION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc new file mode 100644 index 0000000..1f016fc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc @@ -0,0 +1,438 @@ +/* + * 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/model/transform_operation.h" + +#include +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/model/server_timestamp_util.h" +#include "Firestore/core/src/model/value_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/comparison.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" + +namespace firebase { +namespace firestore { +namespace model { + +using nanopb::Message; +using Type = TransformOperation::Type; + +// MARK: - TransformOperation + +TransformOperation::TransformOperation(std::shared_ptr rep) + : rep_(std::move(rep)) { +} + +/** Returns whether the two are equal. */ +bool operator==(const TransformOperation& lhs, const TransformOperation& rhs) { + return lhs.rep_ == nullptr + ? rhs.rep_ == nullptr + : (rhs.rep_ != nullptr && lhs.rep_->Equals(*rhs.rep_)); +} + +std::ostream& operator<<(std::ostream& os, const TransformOperation& op) { + return os << op.ToString(); +} + +// MARK: - ServerTimestampTransform + +static_assert(sizeof(TransformOperation) == sizeof(ServerTimestampTransform), + "No additional members allowed (everything must go in Rep)"); + +class ServerTimestampTransform::Rep : public TransformOperation::Rep { + public: + Type type() const override { + return Type::ServerTimestamp; + } + + Message ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp& local_write_time) const override { + return EncodeServerTimestamp(local_write_time, previous_value); + } + + Message ApplyToRemoteDocument( + const absl::optional&, + Message transform_result) const override { + return transform_result; + } + + absl::optional> ComputeBaseValue( + const absl::optional&) const override { + // Server timestamps are idempotent and don't require a base value. + return absl::nullopt; + } + + bool Equals(const TransformOperation::Rep& other) const override { + // All ServerTimestampTransform objects are equal. + return other.type() == Type::ServerTimestamp; + } + + size_t Hash() const override { + // An arbitrary number, since all instances are equal. + return 37; + } + + std::string ToString() const override { + return "ServerTimestamp"; + } +}; + +ServerTimestampTransform::ServerTimestampTransform() + : TransformOperation(std::make_shared()) { +} + +// MARK: - ArrayTransform + +static_assert(sizeof(TransformOperation) == sizeof(ArrayTransform), + "No additional members allowed (everything must go in Rep)"); + +/** + * Transforms an array via a union or remove operation (for convenience, we use + * this class for both Type::ArrayUnion and Type::ArrayRemove). + */ +class ArrayTransform::Rep : public TransformOperation::Rep { + public: + Rep(Type type, Message elements) + : type_(type), elements_{std::move(elements)} { + } + + Type type() const override { + return type_; + } + + Message ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp&) const override { + return Apply(previous_value); + } + + Message ApplyToRemoteDocument( + const absl::optional& previous_value, + Message) const override { + // The server just sends null as the transform result for array operations, + // so we have to calculate a result the same as we do for local + // applications. + return Apply(previous_value); + } + + absl::optional> ComputeBaseValue( + const absl::optional&) const override { + // Array transforms are idempotent and don't require a base value. + return absl::nullopt; + } + + google_firestore_v1_ArrayValue elements() const { + return *elements_; + } + + bool Equals(const TransformOperation::Rep& other) const override; + + size_t Hash() const override; + + std::string ToString() const override; + + private: + friend class ArrayTransform; + + /** + * Inspects the provided value, returning a copy of the internal array if it's + * of type Array and an empty array if it's nil or any other type of + * google_firestore_v1_Value. + */ + Message CoercedFieldValueArray( + const absl::optional& value) const; + + Message Apply( + const absl::optional& previous_value) const; + + Type type_; + nanopb::Message elements_; +}; + +namespace { + +constexpr bool IsArrayTransform(Type type) { + return type == Type::ArrayUnion || type == Type::ArrayRemove; +} + +} // namespace + +ArrayTransform::ArrayTransform(Type type, + Message elements) + : TransformOperation( + std::make_shared(type, std::move(elements))) { + HARD_ASSERT(IsArrayTransform(type), "Expected array transform type; got %s", + type); +} + +ArrayTransform::ArrayTransform(const TransformOperation& op) + : TransformOperation(op) { + HARD_ASSERT(IsArrayTransform(op.type()), + "Expected array transform type; got %s", op.type()); +} + +google_firestore_v1_ArrayValue ArrayTransform::elements() const { + return *(array_rep().elements_); +} + +const ArrayTransform::Rep& ArrayTransform::array_rep() const { + return static_cast(rep()); +} + +bool ArrayTransform::Rep::Equals(const TransformOperation::Rep& other) const { + if (other.type() != type()) { + return false; + } + auto& other_rep = static_cast(other); + if (other_rep.elements_->values_count != elements_->values_count) { + return false; + } + for (pb_size_t i = 0; i < elements_->values_count; i++) { + if (other_rep.elements_->values[i] != elements_->values[i]) { + return false; + } + } + return true; +} + +size_t ArrayTransform::Rep::Hash() const { + size_t result = 37; + result = 31 * result + (type() == Type::ArrayUnion ? 1231 : 1237); + for (size_t i = 0; i < elements_->values_count; i++) { + result = 31 * result + + std::hash()(CanonicalId(elements_->values[i])); + } + return result; +} + +std::string ArrayTransform::Rep::ToString() const { + const char* name = type_ == Type::ArrayUnion ? "ArrayUnion" : "ArrayRemove"; + return absl::StrCat(name, "(", CanonicalId(*elements_), ")"); +} + +Message +ArrayTransform::Rep::CoercedFieldValueArray( + const absl::optional& value) const { + if (IsArray(value)) { + return DeepClone(value->array_value); + } else { + // coerce to empty array. + return {}; + } +} + +Message ArrayTransform::Rep::Apply( + const absl::optional& previous_value) const { + Message array_value = + CoercedFieldValueArray(previous_value); + if (type_ == Type::ArrayUnion) { + // Gather the list of elements that have to be added. + std::vector> new_elements; + for (pb_size_t i = 0; i < elements_->values_count; ++i) { + const google_firestore_v1_Value& new_element = elements_->values[i]; + if (!Contains(*array_value, new_element) && + !std::any_of(new_elements.begin(), new_elements.end(), + [&](const Message& value) { + return *value == new_element; + })) { + new_elements.push_back(DeepClone(new_element)); + } + } + + // Append the elements to the end of the list + size_t new_size = array_value->values_count + new_elements.size(); + array_value->values = nanopb::ResizeArray( + array_value->values, new_size); + for (auto& element : new_elements) { + array_value->values[array_value->values_count] = *element.release(); + ++array_value->values_count; + } + } else { + HARD_ASSERT(type_ == Type::ArrayRemove); + pb_size_t new_index = 0; + for (pb_size_t old_index = 0; old_index < array_value->values_count; + ++old_index) { + if (Contains(*elements_, array_value->values[old_index])) { + nanopb::FreeFieldsArray(&array_value->values[old_index]); + } else { + array_value->values[new_index] = array_value->values[old_index]; + ++new_index; + } + } + array_value->values_count = new_index; + } + + Message result; + result->which_value_type = google_firestore_v1_Value_array_value_tag; + result->array_value = *array_value.release(); + return result; +} + +// MARK: - NumericIncrementTransform + +static_assert(sizeof(TransformOperation) == sizeof(NumericIncrementTransform), + "No additional members allowed (everything must go in Rep)"); + +class NumericIncrementTransform::Rep : public TransformOperation::Rep { + public: + explicit Rep(Message operand) + : operand_(std::move(operand)) { + } + + Type type() const override { + return Type::Increment; + } + + Message ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp& local_write_time) const override; + + Message ApplyToRemoteDocument( + const absl::optional&, + Message transform_result) const override { + return transform_result; + } + + absl::optional> ComputeBaseValue( + const absl::optional& previous_value) + const override; + + double OperandAsDouble() const; + + bool Equals(const TransformOperation::Rep& other) const override; + + size_t Hash() const override { + return std::hash()(CanonicalId(*operand_)); + } + + std::string ToString() const override { + return absl::StrCat("NumericIncrement(", operand_->ToString(), ")"); + } + + private: + friend class NumericIncrementTransform; + + Message operand_{}; +}; + +NumericIncrementTransform::NumericIncrementTransform( + Message operand) + : TransformOperation(std::make_shared(std::move(operand))) { + HARD_ASSERT(IsNumber(this->operand())); +} + +NumericIncrementTransform::NumericIncrementTransform( + const TransformOperation& op) + : TransformOperation(op) { + HARD_ASSERT(op.type() == Type::Increment, "Expected increment type; got %s", + op.type()); +} + +const google_firestore_v1_Value& NumericIncrementTransform::operand() const { + return *static_cast(rep()).operand_; +} + +namespace { + +/** + * Implements saturating integer addition. Overflows are resolved to + * LONG_MAX/LONG_MIN. + */ +int64_t SafeIncrement(int64_t x, int64_t y) { + if (x > 0 && y > LONG_MAX - x) { + return LONG_MAX; + } + + if (x < 0 && y < LONG_MIN - x) { + return LONG_MIN; + } + + return x + y; +} + +} // namespace + +double NumericIncrementTransform::Rep::OperandAsDouble() const { + if (IsDouble(*operand_)) { + return operand_->double_value; + } else if (IsInteger(*operand_)) { + return static_cast(operand_->integer_value); + } else { + HARD_FAIL("Expected 'operand' to be of numeric type, but was %s (type %s)", + CanonicalId(*operand_), GetTypeOrder(*operand_)); + } +} + +Message +NumericIncrementTransform::Rep::ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp& /* local_write_time */) const { + auto base_value = ComputeBaseValue(previous_value); + Message result; + + // Return an integer value only if the previous value and the operand is an + // integer. + if (IsInteger(**base_value) && IsInteger(*operand_)) { + result->which_value_type = google_firestore_v1_Value_integer_value_tag; + result->integer_value = + SafeIncrement((*base_value)->integer_value, operand_->integer_value); + } else if (IsInteger(**base_value)) { + result->which_value_type = google_firestore_v1_Value_double_value_tag; + result->double_value = (*base_value)->integer_value + OperandAsDouble(); + } else { + HARD_ASSERT(IsDouble(**base_value), "'base_value' is not of numeric type"); + result->which_value_type = google_firestore_v1_Value_double_value_tag; + result->double_value = (*base_value)->double_value + OperandAsDouble(); + } + + return result; +} + +absl::optional> +NumericIncrementTransform::Rep::ComputeBaseValue( + const absl::optional& previous_value) const { + if (IsNumber(previous_value)) { + return DeepClone(*previous_value); + } + + Message zero_value; + zero_value->which_value_type = google_firestore_v1_Value_integer_value_tag; + zero_value->integer_value = 0; + return zero_value; +} + +bool NumericIncrementTransform::Rep::Equals( + const TransformOperation::Rep& other) const { + if (other.type() != type()) { + return false; + } + + return *operand_ == + *static_cast(other).operand_; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h new file mode 100644 index 0000000..8041144 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h @@ -0,0 +1,235 @@ +/* + * 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_TRANSFORM_OPERATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_TRANSFORM_OPERATION_H_ + +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/types/optional.h" + +namespace firebase { + +class Timestamp; + +namespace firestore { +namespace model { + +/** + * Represents a field transform on a mutation. + * + * Note: TransformOperation and its subclasses are specially designed to avoid + * slicing. You can assign a subclass of TransformOperation to an instance of + * TransformOperation and the full value is preserved, unsliced. Each subclass + * declares an explicit constructor that can recover the derived type. This + * means that code like this will work: + * + * ArrayTransform array_transform(...); + * TransformOperation transform = array_transform; + * ArrayTransform recovered(transform); + * + * The final line results in an explicit check that will fail if the type of + * the underlying data is not actually an ArrayTransform. + */ +class TransformOperation { + public: + /** All the different kinds to TransformOperation. */ + enum class Type { + ServerTimestamp, + ArrayUnion, + ArrayRemove, + Increment, + }; + + TransformOperation() = default; + + /** Returns the actual type. */ + Type type() const { + return rep().type(); + } + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class Mutation; + + /** + * Computes the local transform result against the provided `previous_value`, + * optionally using the provided local_write_time. + */ + nanopb::Message ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp& local_write_time) const { + return rep().ApplyToLocalView(previous_value, local_write_time); + } + + /** + * Computes a final transform result after the transform has been acknowledged + * by the server, potentially using the server-provided transform_result. + */ + nanopb::Message ApplyToRemoteDocument( + const absl::optional& previous_value, + nanopb::Message transform_result) const { + return rep().ApplyToRemoteDocument(previous_value, + std::move(transform_result)); + } + + /** + * If this transform operation is not idempotent, returns the base value to + * persist for this transform operation. If a base value is returned, the + * transform operation is always applied to this base value, even if document + * has already been updated. + * + * Base values provide consistent behavior for non-idempotent transforms and + * allow us to return the same latency-compensated value even if the backend + * has already applied the transform operation. The base value is empty for + * idempotent transforms, as they can be re-played even if the backend has + * already applied them. + * + * @return a base value to store along with the mutation, or empty for + * idempotent transforms. + */ + absl::optional> ComputeBaseValue( + const absl::optional& previous_value) const { + return rep().ComputeBaseValue(previous_value); + } + + public: + /** Returns whether the two are equal. */ + friend bool operator==(const TransformOperation& lhs, + const TransformOperation& rhs); + + size_t Hash() const { + return rep().Hash(); + } + + std::string ToString() const { + return rep_ ? rep().ToString() : "(invalid)"; + } + + friend std::ostream& operator<<(std::ostream& os, + const TransformOperation& op); + + protected: + class Rep { + public: + virtual ~Rep() = default; + + virtual Type type() const = 0; + + virtual nanopb::Message ApplyToLocalView( + const absl::optional& previous_value, + const Timestamp& local_write_time) const = 0; + + virtual nanopb::Message ApplyToRemoteDocument( + const absl::optional& previous_value, + nanopb::Message transform_result) const = 0; + + virtual absl::optional> + ComputeBaseValue(const absl::optional& + previous_value) const = 0; + + virtual bool Equals(const TransformOperation::Rep& other) const = 0; + + virtual size_t Hash() const = 0; + + virtual std::string ToString() const = 0; + }; + + explicit TransformOperation(std::shared_ptr rep); + + const Rep& rep() const { + return *NOT_NULL(rep_); + } + + private: + std::shared_ptr rep_; +}; + +/** Transforms a value into a server-generated timestamp. */ +class ServerTimestampTransform : public TransformOperation { + public: + ServerTimestampTransform(); + + private: + class Rep; +}; + +/** + * Transforms an array via a union or remove operation (for convenience, we use + * this class for both `Type::ArrayUnion` and `Type::ArrayRemove`). + */ +class ArrayTransform : public TransformOperation { + public: + ArrayTransform(Type type, + nanopb::Message array_value); + + /** + * Casts a TransformOperation to an ArrayTransform. This is a checked + * operation that will assert if the type of the TransformOperation isn't + * actually `Type::ArrayUnion` or `Type::ArrayRemove`. + */ + explicit ArrayTransform(const TransformOperation& op); + + google_firestore_v1_ArrayValue elements() const; + + private: + class Rep; + + const Rep& array_rep() const; +}; + +/** + * Implements the backend semantics for locally computed NUMERIC_ADD (increment) + * transforms. Converts all field values to longs or doubles and resolves + * overflows to LONG_MAX/LONG_MIN. + */ +class NumericIncrementTransform : public TransformOperation { + public: + explicit NumericIncrementTransform( + nanopb::Message operand); + + /** + * Casts a TransformOperation to a NumericIncrementTransform. This is a + * checked operation that will assert if the type of the TransformOperation + * isn't actually Type::Increment. + */ + explicit NumericIncrementTransform(const TransformOperation& op); + + const google_firestore_v1_Value& operand() const; + + private: + class Rep; +}; + +/** Returns whether the two are not equal. */ +inline bool operator!=(const TransformOperation& lhs, + const TransformOperation& rhs) { + return !(lhs == rhs); +} + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_TRANSFORM_OPERATION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/types.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/types.h new file mode 100644 index 0000000..5f70c9b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/types.h @@ -0,0 +1,80 @@ +/* + * 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_TYPES_H_ +#define FIRESTORE_CORE_SRC_MODEL_TYPES_H_ + +#include + +namespace firebase { +namespace firestore { +namespace model { + +/** + * BatchId is a locally assigned identifier for a batch of mutations that have + * been applied by the user but have not yet been fully committed at the server. + */ +using BatchId = int32_t; + +/** + * A sequence number that's incremented on each "interesting" action in the + * local store that establishes the order in which items can be garbage + * collected. + */ +using ListenSequenceNumber = int64_t; + +/** + * TargetId is a stable numeric identifier assigned for a specific query + * applied. + */ +using TargetId = int32_t; + +/** + * Describes the online state of the Firestore client. Note that this does not + * 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.from_cache() to true). + */ +enum class OnlineState { + /** + * The Firestore client is in an unknown online state. This means the client + * is either not actively trying to establish a connection or it is currently + * trying to establish a connection, but it has not succeeded or failed yet. + * Higher-level components should not operate in offline mode. + */ + Unknown, + + /** + * The client is connected and the connections are healthy. This state is + * reached after a successful connection and there has been at least one + * successful message received from the backends. + */ + Online, + + /** + * The client is either trying to establish a connection but failing, or it + * has been explicitly marked offline via a call to `DisableNetwork`. + * Higher-level components should operate in offline mode. + */ + Offline +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_TYPES_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.cc new file mode 100644 index 0000000..70659b7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.cc @@ -0,0 +1,598 @@ +/* + * Copyright 2021 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/value_util.h" + +#include +#include +#include +#include +#include + +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/server_timestamp_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/escaping.h" +#include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_split.h" + +namespace firebase { +namespace firestore { +namespace model { + +using nanopb::Message; +using util::ComparisonResult; + +TypeOrder GetTypeOrder(const google_firestore_v1_Value& value) { + switch (value.which_value_type) { + case google_firestore_v1_Value_null_value_tag: + return TypeOrder::kNull; + + case google_firestore_v1_Value_boolean_value_tag: + return TypeOrder::kBoolean; + + case google_firestore_v1_Value_integer_value_tag: + case google_firestore_v1_Value_double_value_tag: + return TypeOrder::kNumber; + + case google_firestore_v1_Value_timestamp_value_tag: + return TypeOrder::kTimestamp; + + case google_firestore_v1_Value_string_value_tag: + return TypeOrder::kString; + + case google_firestore_v1_Value_bytes_value_tag: + return TypeOrder::kBlob; + + case google_firestore_v1_Value_reference_value_tag: + return TypeOrder::kReference; + + case google_firestore_v1_Value_geo_point_value_tag: + return TypeOrder::kGeoPoint; + + case google_firestore_v1_Value_array_value_tag: + return TypeOrder::kArray; + + case google_firestore_v1_Value_map_value_tag: { + if (IsServerTimestamp(value)) { + return TypeOrder::kServerTimestamp; + } + return TypeOrder::kMap; + } + + default: + HARD_FAIL("Invalid type value: %s", value.which_value_type); + } +} + +void SortFields(google_firestore_v1_ArrayValue& value) { + for (pb_size_t i = 0; i < value.values_count; ++i) { + SortFields(value.values[i]); + } +} + +void SortFields(google_firestore_v1_Value& value) { + if (IsMap(value)) { + google_firestore_v1_MapValue& map_value = value.map_value; + std::sort(map_value.fields, map_value.fields + map_value.fields_count, + [](const google_firestore_v1_MapValue_FieldsEntry& lhs, + const google_firestore_v1_MapValue_FieldsEntry& rhs) { + return nanopb::MakeStringView(lhs.key) < + nanopb::MakeStringView(rhs.key); + }); + + for (pb_size_t i = 0; i < map_value.fields_count; ++i) { + SortFields(map_value.fields[i].value); + } + } else if (IsArray(value)) { + SortFields(value.array_value); + } +} + +ComparisonResult CompareNumbers(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + if (left.which_value_type == google_firestore_v1_Value_double_value_tag) { + double left_double = left.double_value; + if (right.which_value_type == google_firestore_v1_Value_double_value_tag) { + return util::Compare(left_double, right.double_value); + } else { + return util::CompareMixedNumber(left_double, right.integer_value); + } + } else { + int64_t left_long = left.integer_value; + if (right.which_value_type == google_firestore_v1_Value_integer_value_tag) { + return util::Compare(left_long, right.integer_value); + } else { + return util::ReverseOrder( + util::CompareMixedNumber(right.double_value, left_long)); + } + } +} + +ComparisonResult CompareTimestamps(const google_protobuf_Timestamp& left, + const google_protobuf_Timestamp& right) { + ComparisonResult cmp = util::Compare(left.seconds, right.seconds); + if (cmp != ComparisonResult::Same) { + return cmp; + } + return util::Compare(left.nanos, right.nanos); +} + +ComparisonResult CompareStrings(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + absl::string_view left_string = nanopb::MakeStringView(left.string_value); + absl::string_view right_string = nanopb::MakeStringView(right.string_value); + return util::Compare(left_string, right_string); +} + +ComparisonResult CompareBlobs(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + if (left.bytes_value && right.bytes_value) { + size_t size = std::min(left.bytes_value->size, right.bytes_value->size); + int cmp = + std::memcmp(left.bytes_value->bytes, right.bytes_value->bytes, size); + return cmp != 0 + ? util::ComparisonResultFromInt(cmp) + : util::Compare(left.bytes_value->size, right.bytes_value->size); + } else { + // An empty blob is represented by a nullptr (or an empty byte array) + return util::Compare( + !(left.bytes_value == nullptr || left.bytes_value->size == 0), + !(right.bytes_value == nullptr || right.bytes_value->size == 0)); + } +} + +ComparisonResult CompareReferences(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + std::vector left_segments = absl::StrSplit( + nanopb::MakeStringView(left.reference_value), '/', absl::SkipEmpty()); + std::vector right_segments = absl::StrSplit( + nanopb::MakeStringView(right.reference_value), '/', absl::SkipEmpty()); + + size_t min_length = std::min(left_segments.size(), right_segments.size()); + for (size_t i = 0; i < min_length; ++i) { + ComparisonResult cmp = util::Compare(left_segments[i], right_segments[i]); + if (cmp != ComparisonResult::Same) { + return cmp; + } + } + return util::Compare(left_segments.size(), right_segments.size()); +} + +ComparisonResult CompareGeoPoints(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + ComparisonResult cmp = util::Compare(left.geo_point_value.latitude, + right.geo_point_value.latitude); + if (cmp != ComparisonResult::Same) { + return cmp; + } + return util::Compare(left.geo_point_value.longitude, + right.geo_point_value.longitude); +} + +ComparisonResult CompareArrays(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + int min_length = + std::min(left.array_value.values_count, right.array_value.values_count); + for (int i = 0; i < min_length; ++i) { + ComparisonResult cmp = + Compare(left.array_value.values[i], right.array_value.values[i]); + if (cmp != ComparisonResult::Same) { + return cmp; + } + } + return util::Compare(left.array_value.values_count, + right.array_value.values_count); +} + +ComparisonResult CompareObjects(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + google_firestore_v1_MapValue left_map = left.map_value; + google_firestore_v1_MapValue right_map = right.map_value; + + // Porting Note: MapValues in iOS are always kept in sorted order. We + // therefore do no need to sort them before comparing. + for (pb_size_t i = 0; i < left_map.fields_count && i < right_map.fields_count; + ++i) { + ComparisonResult key_cmp = + util::Compare(nanopb::MakeStringView(left_map.fields[i].key), + nanopb::MakeStringView(right_map.fields[i].key)); + if (key_cmp != ComparisonResult::Same) { + return key_cmp; + } + + ComparisonResult value_cmp = + Compare(left_map.fields[i].value, right.map_value.fields[i].value); + if (value_cmp != ComparisonResult::Same) { + return value_cmp; + } + } + + return util::Compare(left_map.fields_count, right_map.fields_count); +} + +ComparisonResult Compare(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + TypeOrder left_type = GetTypeOrder(left); + TypeOrder right_type = GetTypeOrder(right); + + if (left_type != right_type) { + return util::Compare(left_type, right_type); + } + + switch (left_type) { + case TypeOrder::kNull: + return ComparisonResult::Same; + + case TypeOrder::kBoolean: + return util::Compare(left.boolean_value, right.boolean_value); + + case TypeOrder::kNumber: + return CompareNumbers(left, right); + + case TypeOrder::kTimestamp: + return CompareTimestamps(left.timestamp_value, right.timestamp_value); + + case TypeOrder::kServerTimestamp: + return CompareTimestamps(GetLocalWriteTime(left), + GetLocalWriteTime(right)); + + case TypeOrder::kString: + return CompareStrings(left, right); + + case TypeOrder::kBlob: + return CompareBlobs(left, right); + + case TypeOrder::kReference: + return CompareReferences(left, right); + + case TypeOrder::kGeoPoint: + return CompareGeoPoints(left, right); + + case TypeOrder::kArray: + return CompareArrays(left, right); + + case TypeOrder::kMap: + return CompareObjects(left, right); + + default: + HARD_FAIL("Invalid type value: %s", left_type); + } +} + +bool NumberEquals(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right) { + if (left.which_value_type == google_firestore_v1_Value_integer_value_tag && + right.which_value_type == google_firestore_v1_Value_integer_value_tag) { + return left.integer_value == right.integer_value; + } else if (left.which_value_type == + google_firestore_v1_Value_double_value_tag && + right.which_value_type == + google_firestore_v1_Value_double_value_tag) { + return util::DoubleBitwiseEquals(left.double_value, right.double_value); + } + return false; +} + +bool ArrayEquals(const google_firestore_v1_ArrayValue& left, + const google_firestore_v1_ArrayValue& right) { + if (left.values_count != right.values_count) { + return false; + } + + for (size_t i = 0; i < left.values_count; ++i) { + if (left.values[i] != right.values[i]) { + return false; + } + } + + return true; +} + +bool ObjectEquals(const google_firestore_v1_MapValue& left, + const google_firestore_v1_MapValue& right) { + if (left.fields_count != right.fields_count) { + return false; + } + + // Porting Note: MapValues in iOS are always kept in sorted order. We + // therefore do no need to sort them before comparing. + for (size_t i = 0; i < right.fields_count; ++i) { + if (nanopb::MakeStringView(left.fields[i].key) != + nanopb::MakeStringView(right.fields[i].key)) { + return false; + } + + if (left.fields[i].value != right.fields[i].value) { + return false; + } + } + + return true; +} + +bool Equals(const google_firestore_v1_Value& lhs, + const google_firestore_v1_Value& rhs) { + TypeOrder left_type = GetTypeOrder(lhs); + TypeOrder right_type = GetTypeOrder(rhs); + if (left_type != right_type) { + return false; + } + + switch (left_type) { + case TypeOrder::kNull: + return true; + + case TypeOrder::kBoolean: + return lhs.boolean_value == rhs.boolean_value; + + case TypeOrder::kNumber: + return NumberEquals(lhs, rhs); + + case TypeOrder::kTimestamp: + return lhs.timestamp_value.seconds == rhs.timestamp_value.seconds && + lhs.timestamp_value.nanos == rhs.timestamp_value.nanos; + + case TypeOrder::kServerTimestamp: { + const auto& left_ts = GetLocalWriteTime(lhs); + const auto& right_ts = GetLocalWriteTime(rhs); + return left_ts.seconds == right_ts.seconds && + left_ts.nanos == right_ts.nanos; + } + + case TypeOrder::kString: + return nanopb::MakeStringView(lhs.string_value) == + nanopb::MakeStringView(rhs.string_value); + + case TypeOrder::kBlob: + return CompareBlobs(lhs, rhs) == ComparisonResult::Same; + + case TypeOrder::kReference: + return nanopb::MakeStringView(lhs.reference_value) == + nanopb::MakeStringView(rhs.reference_value); + + case TypeOrder::kGeoPoint: + return lhs.geo_point_value.latitude == rhs.geo_point_value.latitude && + lhs.geo_point_value.longitude == rhs.geo_point_value.longitude; + + case TypeOrder::kArray: + return ArrayEquals(lhs.array_value, rhs.array_value); + + case TypeOrder::kMap: + return ObjectEquals(lhs.map_value, rhs.map_value); + + default: + HARD_FAIL("Invalid type value: %s", left_type); + } +} + +bool Equals(const google_firestore_v1_ArrayValue& lhs, + const google_firestore_v1_ArrayValue& rhs) { + return ArrayEquals(lhs, rhs); +} + +std::string CanonifyTimestamp(const google_firestore_v1_Value& value) { + return absl::StrFormat("time(%d,%d)", value.timestamp_value.seconds, + value.timestamp_value.nanos); +} + +std::string CanonifyBlob(const google_firestore_v1_Value& value) { + return absl::BytesToHexString(nanopb::MakeStringView(value.bytes_value)); +} + +std::string CanonifyReference(const google_firestore_v1_Value& value) { + std::vector segments = absl::StrSplit( + nanopb::MakeStringView(value.reference_value), '/', absl::SkipEmpty()); + HARD_ASSERT(segments.size() >= 5, + "Reference values should have at least 5 components"); + return absl::StrJoin(segments.begin() + 5, segments.end(), "/"); +} + +std::string CanonifyGeoPoint(const google_firestore_v1_Value& value) { + return absl::StrFormat("geo(%.1f,%.1f)", value.geo_point_value.latitude, + value.geo_point_value.longitude); +} + +std::string CanonifyArray(const google_firestore_v1_ArrayValue& array_value) { + std::string result = "["; + for (size_t i = 0; i < array_value.values_count; ++i) { + absl::StrAppend(&result, CanonicalId(array_value.values[i])); + if (i != array_value.values_count - 1) { + absl::StrAppend(&result, ","); + } + } + result += "]"; + return result; +} + +std::string CanonifyObject(const google_firestore_v1_Value& value) { + pb_size_t fields_count = value.map_value.fields_count; + const auto& fields = value.map_value.fields; + + // Porting Note: MapValues in iOS are always kept in sorted order. We + // therefore do no need to sort them before generating the canonical ID. + std::string result = "{"; + for (pb_size_t i = 0; i < fields_count; ++i) { + absl::StrAppend(&result, nanopb::MakeStringView(fields[i].key), ":", + CanonicalId(fields[i].value)); + if (i != fields_count - 1) { + absl::StrAppend(&result, ","); + } + } + result += "}"; + + return result; +} + +std::string CanonicalId(const google_firestore_v1_Value& value) { + switch (value.which_value_type) { + case google_firestore_v1_Value_null_value_tag: + return "null"; + + case google_firestore_v1_Value_boolean_value_tag: + return value.boolean_value ? "true" : "false"; + + case google_firestore_v1_Value_integer_value_tag: + return std::to_string(value.integer_value); + + case google_firestore_v1_Value_double_value_tag: + return absl::StrFormat("%.1f", value.double_value); + + case google_firestore_v1_Value_timestamp_value_tag: + return CanonifyTimestamp(value); + + case google_firestore_v1_Value_string_value_tag: + return nanopb::MakeString(value.string_value); + + case google_firestore_v1_Value_bytes_value_tag: + return CanonifyBlob(value); + + case google_firestore_v1_Value_reference_value_tag: + return CanonifyReference(value); + + case google_firestore_v1_Value_geo_point_value_tag: + return CanonifyGeoPoint(value); + + case google_firestore_v1_Value_array_value_tag: + return CanonifyArray(value.array_value); + + case google_firestore_v1_Value_map_value_tag: { + return CanonifyObject(value); + } + + default: + HARD_FAIL("Invalid type value: %s", value.which_value_type); + } +} + +std::string CanonicalId(const google_firestore_v1_ArrayValue& value) { + return CanonifyArray(value); +} + +bool Contains(google_firestore_v1_ArrayValue haystack, + google_firestore_v1_Value needle) { + for (pb_size_t i = 0; i < haystack.values_count; ++i) { + if (Equals(haystack.values[i], needle)) { + return true; + } + } + return false; +} + +Message NullValue() { + Message null_value; + null_value->which_value_type = google_firestore_v1_Value_null_value_tag; + null_value->null_value = {}; + return null_value; +} + +bool IsNullValue(const google_firestore_v1_Value& value) { + return value.which_value_type == google_firestore_v1_Value_null_value_tag; +} + +Message NaNValue() { + Message nan_value; + nan_value->which_value_type = google_firestore_v1_Value_double_value_tag; + nan_value->double_value = std::numeric_limits::quiet_NaN(); + return nan_value; +} + +bool IsNaNValue(const google_firestore_v1_Value& value) { + return value.which_value_type == google_firestore_v1_Value_double_value_tag && + std::isnan(value.double_value); +} + +Message RefValue( + const model::DatabaseId& database_id, + const model::DocumentKey& document_key) { + Message result; + result->which_value_type = google_firestore_v1_Value_reference_value_tag; + result->string_value = nanopb::MakeBytesArray(util::StringFormat( + "projects/%s/databases/%s/documents/%s", database_id.project_id(), + database_id.database_id(), document_key.ToString())); + return result; +} + +Message DeepClone( + const google_firestore_v1_Value& source) { + Message target{source}; + switch (source.which_value_type) { + case google_firestore_v1_Value_string_value_tag: + target->string_value = + source.string_value + ? nanopb::MakeBytesArray(source.string_value->bytes, + source.string_value->size) + : nullptr; + break; + + case google_firestore_v1_Value_reference_value_tag: + target->reference_value = nanopb::MakeBytesArray( + source.reference_value->bytes, source.reference_value->size); + break; + + case google_firestore_v1_Value_bytes_value_tag: + target->bytes_value = + source.bytes_value ? nanopb::MakeBytesArray(source.bytes_value->bytes, + source.bytes_value->size) + : nullptr; + break; + + case google_firestore_v1_Value_array_value_tag: + target->array_value.values_count = source.array_value.values_count; + target->array_value.values = nanopb::MakeArray( + source.array_value.values_count); + for (pb_size_t i = 0; i < source.array_value.values_count; ++i) { + target->array_value.values[i] = + *DeepClone(source.array_value.values[i]).release(); + } + break; + + case google_firestore_v1_Value_map_value_tag: + target->map_value.fields_count = source.map_value.fields_count; + target->map_value.fields = + nanopb::MakeArray( + source.map_value.fields_count); + for (pb_size_t i = 0; i < source.map_value.fields_count; ++i) { + target->map_value.fields[i].key = + nanopb::MakeBytesArray(source.map_value.fields[i].key->bytes, + source.map_value.fields[i].key->size); + target->map_value.fields[i].value = + *DeepClone(source.map_value.fields[i].value).release(); + } + break; + } + return target; +} + +Message DeepClone( + const google_firestore_v1_ArrayValue& source) { + Message target{source}; + target->values_count = source.values_count; + target->values = + nanopb::MakeArray(source.values_count); + for (pb_size_t i = 0; i < source.values_count; ++i) { + target->values[i] = *DeepClone(source.values[i]).release(); + } + return target; +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.h new file mode 100644 index 0000000..24328ab --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/value_util.h @@ -0,0 +1,175 @@ +/* + * Copyright 2021 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_VALUE_UTIL_H_ +#define FIRESTORE_CORE_SRC_MODEL_VALUE_UTIL_H_ + +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/nanopb/message.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace util { +enum class ComparisonResult; +} + +namespace model { + +class DocumentKey; +class DatabaseId; + +/** + * The order of types in Firestore. This order is based on the backend's + * ordering, but modified to support server timestamps. + */ +enum class TypeOrder { + kNull = 0, + kBoolean = 1, + kNumber = 2, + kTimestamp = 3, + kServerTimestamp = 4, + kString = 5, + kBlob = 6, + kReference = 7, + kGeoPoint = 8, + kArray = 9, + kMap = 10 +}; + +/** Returns the backend's type order of the given Value type. */ +TypeOrder GetTypeOrder(const google_firestore_v1_Value& value); + +/** Traverses a Value proto and sorts all MapValues by key. */ +void SortFields(google_firestore_v1_Value& value); + +/** Traverses an ArrayValue proto and sorts all MapValues by key. */ +void SortFields(google_firestore_v1_ArrayValue& value); + +util::ComparisonResult Compare(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right); + +bool Equals(const google_firestore_v1_Value& left, + const google_firestore_v1_Value& right); + +bool Equals(const google_firestore_v1_ArrayValue& left, + const google_firestore_v1_ArrayValue& right); + +/** + * Generates the canonical ID for the provided field value (as used in Target + * serialization). + */ +std::string CanonicalId(const google_firestore_v1_Value& value); + +/** + * Generates the canonical ID for the provided array value (as used in Target + * serialization). + */ +std::string CanonicalId(const google_firestore_v1_ArrayValue& value); + +/** Returns true if the array value contains the specified element. */ +bool Contains(google_firestore_v1_ArrayValue haystack, + google_firestore_v1_Value needle); + +/** Returns a null Protobuf value. */ +nanopb::Message NullValue(); + +/** Returns `true` if `value` is null in its Protobuf representation. */ +bool IsNullValue(const google_firestore_v1_Value& value); + +/** Returns `NaN` in its Protobuf representation. */ +nanopb::Message NaNValue(); + +/** Returns `true` if `value` is `NaN` in its Protobuf representation. */ +bool IsNaNValue(const google_firestore_v1_Value& value); + +/** Returns a Protobuf reference value representing the given location. */ +nanopb::Message RefValue( + const DatabaseId& database_id, const DocumentKey& document_key); + +/** Creates a copy of the contents of the Value proto. */ +nanopb::Message DeepClone( + const google_firestore_v1_Value& source); + +/** Creates a copy of the contents of the ArrayValue proto. */ +nanopb::Message DeepClone( + const google_firestore_v1_ArrayValue& source); + +/** Returns true if `value` is a INTEGER_VALUE. */ +inline bool IsInteger(const absl::optional& value) { + return value && + value->which_value_type == google_firestore_v1_Value_integer_value_tag; +} + +/** Returns true if `value` is a DOUBLE_VALUE. */ +inline bool IsDouble(const absl::optional& value) { + return value && + value->which_value_type == google_firestore_v1_Value_double_value_tag; +} + +/** Returns true if `value` is either a INTEGER_VALUE or a DOUBLE_VALUE. */ +inline bool IsNumber(const absl::optional& value) { + return IsInteger(value) || IsDouble(value); +} + +/** Returns true if `value` is an ARRAY_VALUE. */ +inline bool IsArray(const absl::optional& value) { + return value && + value->which_value_type == google_firestore_v1_Value_array_value_tag; +} + +/** Returns true if `value` is a MAP_VALUE. */ +inline bool IsMap(const absl::optional& value) { + return value && + value->which_value_type == google_firestore_v1_Value_map_value_tag; +} + +} // namespace model + +inline bool operator==(const google_firestore_v1_Value& lhs, + const google_firestore_v1_Value& rhs) { + return model::Equals(lhs, rhs); +} + +inline bool operator!=(const google_firestore_v1_Value& lhs, + const google_firestore_v1_Value& rhs) { + return !model::Equals(lhs, rhs); +} + +inline bool operator==(const google_firestore_v1_ArrayValue& lhs, + const google_firestore_v1_ArrayValue& rhs) { + return model::Equals(lhs, rhs); +} + +inline bool operator!=(const google_firestore_v1_ArrayValue& lhs, + const google_firestore_v1_ArrayValue& rhs) { + return !model::Equals(lhs, rhs); +} + +inline std::ostream& operator<<(std::ostream& out, + const google_firestore_v1_Value& value) { + return out << model::CanonicalId(value); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_VALUE_UTIL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc new file mode 100644 index 0000000..456e606 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc @@ -0,0 +1,58 @@ +/* + * 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/mutable_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); +} + +void VerifyMutation::Rep::ApplyToRemoteDocument(MutableDocument&, + const MutationResult&) const { + HARD_FAIL("VerifyMutation should only be used in Transactions."); +} + +void VerifyMutation::Rep::ApplyToLocalView(MutableDocument&, + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h new file mode 100644 index 0000000..778ba8f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h @@ -0,0 +1,84 @@ +/* + * 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/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 { + +class MutableDocument; + +/** + * 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; + } + + void ApplyToRemoteDocument( + MutableDocument& document, + const MutationResult& mutation_result) const override; + + void ApplyToLocalView(MutableDocument& document, + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc new file mode 100644 index 0000000..2d4d967 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc @@ -0,0 +1,125 @@ +/* + * 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/byte_string.h" + +#include +#include +#include +#include +#include +#include + +#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 { +namespace firestore { +namespace nanopb { + +ByteString::ByteString(const pb_bytes_array_t* bytes) { + if (bytes != nullptr) { + bytes_ = MakeBytesArray(bytes->bytes, bytes->size); + } +} + +ByteString::ByteString(const void* value, size_t size) + : bytes_(MakeBytesArray(value, size)) { +} + +ByteString::ByteString(absl::string_view value) + : ByteString(value.data(), value.size()) { +} + +ByteString::ByteString(std::initializer_list value) + : ByteString(value.begin(), value.size()) { +} + +ByteString::ByteString(const ByteString& other) + : ByteString(other.data(), other.size()) { +} + +ByteString::ByteString(ByteString&& other) noexcept { + 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}; +} + +const uint8_t* ByteString::data() const { + static const uint8_t kEmpty[] = ""; + return bytes_ ? bytes_->bytes : kEmpty; +} + +pb_bytes_array_t* ByteString::release() { + pb_bytes_array_t* result = bytes_; + bytes_ = nullptr; + return result; +} + +void swap(ByteString& lhs, ByteString& rhs) noexcept { + std::swap(lhs.bytes_, rhs.bytes_); +} + +util::ComparisonResult ByteString::CompareTo(const ByteString& rhs) const { + return util::Compare(MakeStringView(*this), MakeStringView(rhs)); +} + +size_t ByteString::Hash() const { + return util::Hash(util::make_range(begin(), end())); +} + +std::string ByteString::ToString() const { + return absl::CEscape(MakeStringView(*this)); +} + +std::ostream& operator<<(std::ostream& out, const ByteString& str) { + return out << str.ToString(); +} + +std::string ByteString::ToHexString() const { + std::string hex = absl::BytesToHexString(MakeStringView(*this)); + return absl::StrCat("<", hex, ">"); +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h new file mode 100644 index 0000000..a1f164d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h @@ -0,0 +1,168 @@ +/* + * 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_BYTE_STRING_H_ +#define FIRESTORE_CORE_SRC_NANOPB_BYTE_STRING_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#include "Firestore/core/src/util/comparison.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * An immutable string-like object backed by a nanopb byte array. `ByteString` + * owns its memory, has deep copy semantics, and creates a copy of any input + * given to its constructors. + * + * `ByteString` is similar in spirit to `com.google.protobuf.ByteString`. It + * serves mostly the same purpose: it's a holder of a byte array that's + * compatible with the proto marshaling layer. + * + * Unlike protobuf's `ByteString`, nanopb doesn't supply this class so this + * class additionally makes it possible to cheaply translate to and from raw + * `pb_bytes_array_t*` values. `ByteString` allows taking values directly from + * nanopb messages and avoids copying while doing so. + */ +class ByteString : public util::Comparable { + public: + ByteString() = default; + + /** + * Creates a new `ByteString` that copies the given bytes. + */ + explicit ByteString(const pb_bytes_array_t* bytes); + + /** + * Creates a new `ByteString` whose backing byte array is a copy of the given + * bytes. + */ + ByteString(const void* value, size_t size); + + /** + * Creates a new `ByteString` whose backing byte array is a copy of the given + * string_view. + */ + explicit ByteString(absl::string_view value); + + ByteString(std::initializer_list value); + + ByteString(const ByteString& other); + + ByteString(ByteString&& other) noexcept; + + ~ByteString(); + + ByteString& operator=(const ByteString& other); + ByteString& operator=(ByteString&& other) noexcept; + + friend void swap(ByteString& lhs, ByteString& rhs) noexcept; + + /** + * Creates a new `ByteString` that takes ownership of the given byte array. If + * taking from a nanopb-created message struct, the caller should null out + * the pointer there so that pb_release won't free the buffer that the + * returned `ByteString` now owns. + */ + static ByteString Take(pb_bytes_array_t* bytes); + + /** + * Returns a pointer to the character data backing this `ByteString`. The + * returned buffer is always non-null, even if the nanopb byte array is null. + */ + const uint8_t* data() const; + + size_t size() const { + return bytes_ ? bytes_->size : 0; + } + + bool empty() const { + return bytes_ == nullptr || bytes_->size == 0; + } + + const uint8_t* begin() const { + return data(); + } + + const uint8_t* end() const { + return data() + size(); + } + + /** + * Returns a const view of the raw underlying byte array pointer. + * + * This value may be null because nanopb (and protobuf generally) treat null + * and empty byte arrays as equivalent. + * + * For actually reading the data in the buffer, prefer `data()` and `size()` + * or `begin()` and `end()`, which handle this nullability for you. + */ + const pb_bytes_array_t* get() const { + return bytes_; + } + + /** + * Releases ownership of the backing byte array, and returns it to the caller. + * The backing byte array is set to null. + * + * This value may be null because nanopb (and protobuf generally) treat null + * and empty byte arrays as equivalent. Assigning a null value to a nanopb + * message field will be treated as empty. + */ + pb_bytes_array_t* release(); + + /** + * Performs a lexicographical comparison between this and the other bytes. + */ + util::ComparisonResult CompareTo(const ByteString& rhs) const; + + size_t Hash() const; + + // Interprets the value as an ASCII string; the way control characters are + // represented is implementation-defined. + std::string ToString() const; + friend std::ostream& operator<<(std::ostream& out, const ByteString& str); + + // Represents the value as hexadecimal values. + std::string ToHexString() const; + + private: + /** + * Private constructor directly assigns to bytes_. The extra integer tag + * helps disambiguate this constructor from the public constructor that takes + * `const pb_bytes_array_t*`. + */ + explicit ByteString(pb_bytes_array_t* bytes, int) : bytes_{bytes} { + } + + pb_bytes_array_t* bytes_ = nullptr; +}; + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_BYTE_STRING_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h new file mode 100644 index 0000000..15849d4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h @@ -0,0 +1,191 @@ +/* + * 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/bundle.nanopb.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_ArrayValue_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_MapValue_fields; +} + +template <> +inline const pb_field_t* +FieldsArray() { + return google_firestore_v1_MapValue_FieldsEntry_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 firestore_BundleMetadata_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_NamedQuery_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.cc new file mode 100644 index 0000000..aa9bd08 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.h new file mode 100644 index 0000000..24e7e42 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.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_NANOPB_MESSAGE_H_ +#define FIRESTORE_CORE_SRC_NANOPB_MESSAGE_H_ + +#include +#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; + + /** + * Creates a `Message` object that wraps `proto`. Takes ownership of `proto`. + */ + explicit Message(const T& proto) : owns_proto_(true), proto_(proto) { + } + + /** + * 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(); + } + + /** + * Returns false if the Message is not associated with a valid proto (for + * example, if it has been moved from). + */ + constexpr explicit operator bool() const noexcept { + return owns_proto_; + } + + 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 MakeMessage(const T& proto) { + return Message(proto); +} + +/** + * A wrapper of Message objects that facilitates shared ownership of Protobuf + * data. + */ +// TODO(mrschmidt): Add a template specialization +template +class SharedMessage { + public: + /** Creates a `SharedMessage` object that wraps `proto`. */ + SharedMessage(Message message) // NOLINT + : message_{std::make_shared>(*message.release())} { + } + + /** + * Returns a pointer to the underlying Nanopb proto. + */ + T* get() { + return message_->get(); + } + + /** + * Returns a pointer to the underlying Nanopb proto. + */ + const T* get() const { + return message_->get(); + } + + /** + * Returns a reference to the underlying Nanopb proto. + */ + T& operator*() { + return *get(); + } + + /** + * Returns a reference to the underlying Nanopb proto. + */ + const T& operator*() const { + return *get(); + } + + T* operator->() { + return get(); + } + + const T* operator->() const { + return get(); + } + + private: + std::shared_ptr> message_; +}; + +template +SharedMessage MakeSharedMessage(const T& proto) { + return SharedMessage(Message(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(); +} + +/** Free the dynamically-allocated memory for the fields array of type T. */ +template +void FreeFieldsArray(T* message) { + FreeNanopbMessage(FieldsArray(), message); +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_MESSAGE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc new file mode 100644 index 0000000..ec7c48b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc @@ -0,0 +1,83 @@ +/* + * 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/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; + return MakeBytesArray(buffer->bytes, buffer->size); +} + +pb_bytes_array_t* _Nullable MakeBytesArray(const void* _Nullable data, + size_t size) { + if (size == 0) return nullptr; + + pb_size_t pb_size = CheckedSize(size); + + // Allocate one extra byte for the null terminator that's not necessarily + // there in a string_view. As long as we're making a copy, might as well + // make a copy that won't overrun when used as a regular C string. This is + // essentially just to make debugging easier--actual user data can have + // embedded nulls so we shouldn't be using this as a C string under normal + // circumstances. + auto result = static_cast( + std::malloc(PB_BYTES_ARRAY_T_ALLOCSIZE(pb_size + 1))); + result->size = pb_size; + std::memcpy(result->bytes, data, pb_size); + result->bytes[pb_size] = '\0'; + + return result; +} + +std::string MakeString(const pb_bytes_array_t* _Nullable str) { + if (str == nullptr) return ""; + + auto bytes = reinterpret_cast(str->bytes); + auto size = static_cast(str->size); + return std::string{bytes, size}; +} + +absl::string_view MakeStringView(const pb_bytes_array_t* _Nullable str) { + if (str == nullptr) return absl::string_view(nullptr, 0); + + auto bytes = reinterpret_cast(str->bytes); + auto size = static_cast(str->size); + return absl::string_view{bytes, size}; +} + +absl::string_view MakeStringView(const ByteString& bytes) { + const char* str = reinterpret_cast(bytes.data()); + return absl::string_view{str, bytes.size()}; +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h new file mode 100644 index 0000000..6c55173 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h @@ -0,0 +1,195 @@ +/* + * 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 + +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/util/hard_assert.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))); +} + +template +T* _Nonnull ResizeArray(void* _Nonnull ptr, size_t count) { + return static_cast(realloc(ptr, CheckedSize(count) * sizeof(T))); +} + +/** + * Initializes a repeated field with a list of values. Applies `converter` to + * each value before assigning. + */ +template +void SetRepeatedField(T* _Nonnull* _Nonnull fields_array, + pb_size_t* _Nonnull fields_count, + Iterator first, + Iterator last, + const Func& converter) { + HARD_ASSERT(fields_array, "fields_array must be non-null"); + HARD_ASSERT(fields_count, "fields_count must be non-null"); + *fields_count = nanopb::CheckedSize(std::distance(first, last)); + *fields_array = nanopb::MakeArray(*fields_count); + auto* current = *fields_array; + while (first != last) { + *current = converter(*first); + ++current; + ++first; + } +} + +/** + * Initializes a repeated field with a list of values. Applies `converter` to + * each value before assigning. + */ +template +void SetRepeatedField(T* _Nonnull* _Nonnull fields_array, + pb_size_t* _Nonnull fields_count, + const Container& fields, + const Func& converter) { + return SetRepeatedField(fields_array, fields_count, fields.begin(), + fields.end(), converter); +} + +/** Initializes a repeated field with a list of values. */ +template +void SetRepeatedField(T* _Nonnull* _Nonnull fields_array, + pb_size_t* _Nonnull fields_count, + const Container& fields) { + return SetRepeatedField(fields_array, fields_count, fields, + [](const T& val) { return val; }); +} + +/** + * Zeroes out the memory of `fields`. This can be used if the contents of fields + * array were moved to another message that takes on ownership. + */ +template +void ReleaseFieldOwnership(T* _Nonnull fields, pb_size_t fields_count) { + for (pb_size_t i = 0; i < fields_count; ++i) { + fields[i] = {}; + } +} + +#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* _Nonnull MakeNSData(const pb_bytes_array_t* _Nullable data) { + return [[NSData alloc] initWithBytes:data->bytes length:data->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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc new file mode 100644 index 0000000..accab46 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc @@ -0,0 +1,81 @@ +/* + * 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/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.h new file mode 100644 index 0000000..43758d8 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc new file mode 100644 index 0000000..6cffd8f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc @@ -0,0 +1,49 @@ +/* + * 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 { + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h new file mode 100644 index 0000000..d82c5fd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h @@ -0,0 +1,149 @@ +/* + * 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/read_context.h" +#include "Firestore/core/src/util/status.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * 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)); + } + + util::ReadContext* context() { + return &context_; + } + + const util::ReadContext* context() const { + return &context_; + } + + void Fail(std::string description) { + context_.Fail(std::move(description)); + } + + private: + util::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 size); + + /** + * 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc new file mode 100644 index 0000000..0b26e9b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc @@ -0,0 +1,128 @@ +/* + * 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/nanopb/writer.h" + +#include +#include + +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace nanopb { +namespace { + +constexpr size_t kMinBufferSize = 4; + +bool AppendToBytesArray(pb_ostream_t* stream, + const pb_byte_t* buf, + size_t count) { + auto writer = static_cast(stream->state); + writer->Append(buf, count); + return true; +} + +} // namespace + +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_)); + } +} + +ByteStringWriter::ByteStringWriter() { + stream_.callback = AppendToBytesArray; + stream_.state = this; + stream_.max_size = SIZE_MAX; +} + +ByteStringWriter::~ByteStringWriter() { + std::free(buffer_); +} + +void ByteStringWriter::Append(const void* data, size_t size) { + if (size == 0) return; + + pb_size_t pb_size = CheckedSize(size); + size_t current_size = this->size(); + size_t min_capacity = current_size + pb_size; + HARD_ASSERT(min_capacity >= current_size); // Avoid overflow + + Reserve(min_capacity); + uint8_t* pos = this->pos(); + std::memcpy(pos, data, size); + buffer_->size += pb_size; +} + +void ByteStringWriter::Reserve(size_t min_capacity) { + // Bump the min_capacity up so that an explicit Reserve will trigger an + // allocation, making pos() guaranteed to be valid. + min_capacity = std::max(min_capacity, kMinBufferSize); + if (min_capacity <= capacity_) return; + + // If capacity * 2 overflows, min_capacity will be larger. + size_t desired = std::max(capacity_ * 2, min_capacity); + + if (buffer_) { + buffer_ = static_cast( + std::realloc(buffer_, PB_BYTES_ARRAY_T_ALLOCSIZE(desired))); + } else { + // initialize on the first allocation. + buffer_ = static_cast( + std::calloc(1, PB_BYTES_ARRAY_T_ALLOCSIZE(desired))); + } + + capacity_ = desired; +} + +void ByteStringWriter::SetSize(size_t size) { + HARD_ASSERT(buffer_ != nullptr && + size <= capacity_); // Should have reserved. + buffer_->size = CheckedSize(size); +} + +ByteString ByteStringWriter::Release() { + pb_bytes_array_t* pending = buffer_; + buffer_ = nullptr; + capacity_ = 0; + return ByteString::Take(pending); +} + +namespace { + +bool AppendToString(pb_ostream_t* stream, const pb_byte_t* buf, size_t count) { + auto str = static_cast(stream->state); + str->insert(str->end(), buf, buf + count); + return true; +} + +} // namespace + +StringWriter::StringWriter() { + stream_.callback = AppendToString; + stream_.state = &buffer_; + stream_.max_size = SIZE_MAX; +} + +std::string StringWriter::Release() { + return std::move(buffer_); +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h new file mode 100644 index 0000000..bfa29ce --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h new file mode 100644 index 0000000..268f960 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h @@ -0,0 +1,54 @@ +/* + * 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_OBJC_OBJC_TYPE_TRAITS_H_ +#define FIRESTORE_CORE_SRC_OBJC_OBJC_TYPE_TRAITS_H_ + +#if __OBJC__ + +#include // for id + +#include + +namespace firebase { +namespace firestore { +namespace objc { + +/** + * A type trait that identifies whether or not the given pointer points to an + * Objective-C object. + * + * is_objc_pointer::value == true + * is_objc_pointer*>::value == true + * + * // id is a dynamically typed pointer to an Objective-C object. + * is_objc_pointer::value == true + * + * // pointers to C++ classes are not Objective-C pointers. + * is_objc_pointer::value == false + * is_objc_pointer::value == false + * is_objc_pointer>::value == false + */ +template +using is_objc_pointer = std::is_convertible; + +} // namespace objc +} // namespace firestore +} // namespace firebase + +#endif // __OBJC__ + +#endif // FIRESTORE_CORE_SRC_OBJC_OBJC_TYPE_TRAITS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc new file mode 100644 index 0000000..2f35f08 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc @@ -0,0 +1,49 @@ +/* + * 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" + +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace remote { + +void ConnectivityMonitor::SetInitialStatus(NetworkStatus new_status) { + HARD_ASSERT(!status_.has_value(), + "SetInitialStatus should only be called once"); + status_ = new_status; +} + +void ConnectivityMonitor::MaybeInvokeCallbacks(NetworkStatus new_status) { + if (new_status == status_) { + return; + } + + InvokeCallbacks(new_status); +} + +void ConnectivityMonitor::InvokeCallbacks(NetworkStatus new_status) { + status_ = new_status; + for (auto& callback : callbacks_) { + callback(status_.value()); + } +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.h new file mode 100644 index 0000000..a77f105 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.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. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ +#define FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/util/async_queue.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * A base class for monitoring changes in network connectivity; it is expected + * that each platform will have its own system-dependent implementation. + */ +class ConnectivityMonitor { + public: + /** + * The set of network states is deliberately simplified -- we only care about + * states such that transition between them should break currently + * established connections. + */ + enum class NetworkStatus { + Unavailable, + Available, + AvailableViaCellular, + }; + + using Callback = std::function; + + /** Creates a platform-specific connectivity monitor. */ + static std::unique_ptr Create( + const std::shared_ptr& worker_queue); + + explicit ConnectivityMonitor( + const std::shared_ptr& worker_queue) + : worker_queue_{worker_queue} { + } + + virtual ~ConnectivityMonitor() = default; + + void AddCallback(Callback&& callback) { + callbacks_.push_back(std::move(callback)); + } + // TODO(varconst): RemoveCallback. + + protected: + // The status may be retrieved asynchronously. + void SetInitialStatus(NetworkStatus new_status); + + // 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_; + } + + private: + std::shared_ptr worker_queue_; + std::vector callbacks_; + absl::optional status_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor_apple.mm new file mode 100644 index 0000000..33d6b7e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc new file mode 100644 index 0000000..aca9f69 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc @@ -0,0 +1,389 @@ +/* + * 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/core/database_info.h" +#include "Firestore/core/src/credentials/auth_token.h" +#include "Firestore/core/src/credentials/credentials_provider.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document.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/firebase_metadata_provider.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 core::DatabaseInfo; +using credentials::AuthCredentialsProvider; +using credentials::AuthToken; +using model::DocumentKey; +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::GetAllowlistedHeadersAsString(call->GetResponseHeaders()); + LOG_DEBUG("RPC %s returned headers (allowlisted): %s", rpc_name, headers); + } +} + +} // namespace + +Datastore::Datastore( + const DatabaseInfo& database_info, + const std::shared_ptr& worker_queue, + std::shared_ptr auth_credentials, + std::shared_ptr + app_check_credentials, + ConnectivityMonitor* connectivity_monitor, + FirebaseMetadataProvider* firebase_metadata_provider) + : worker_queue_{NOT_NULL(worker_queue)}, + app_check_credentials_{std::move(app_check_credentials)}, + auth_credentials_{std::move(auth_credentials)}, + rpc_executor_{CreateExecutor()}, + connectivity_monitor_{connectivity_monitor}, + grpc_connection_{database_info, worker_queue, &grpc_queue_, + connectivity_monitor_, firebase_metadata_provider}, + 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_, auth_credentials_, app_check_credentials_, + datastore_serializer_.serializer(), &grpc_connection_, callback); +} + +std::shared_ptr Datastore::CreateWriteStream( + WriteStreamCallback* callback) { + return std::make_shared( + worker_queue_, auth_credentials_, app_check_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& auth_token, + const std::string& app_check_token) mutable { + if (!auth_token.ok()) { + callback(auth_token.status()); + return; + } + CommitMutationsWithCredentials(auth_token.ValueOrDie(), app_check_token, + mutations, std::move(callback)); + }); +} + +void Datastore::CommitMutationsWithCredentials( + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const std::vector& mutations, + CommitCallback&& callback) { + grpc::ByteBuffer message = + MakeByteBuffer(datastore_serializer_.EncodeCommitRequest(mutations)); + + std::unique_ptr call_owning = grpc_connection_.CreateUnaryCall( + kRpcNameCommit, auth_token, app_check_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& auth_token, + const std::string& app_check_token) mutable { + if (!auth_token.ok()) { + callback(auth_token.status()); + return; + } + LookupDocumentsWithCredentials(auth_token.ValueOrDie(), app_check_token, + keys, std::move(callback)); + }); +} + +void Datastore::LookupDocumentsWithCredentials( + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const std::vector& keys, + LookupCallback&& callback) { + grpc::ByteBuffer message = + MakeByteBuffer(datastore_serializer_.EncodeLookupRequest(keys)); + + std::unique_ptr call_owning = + grpc_connection_.CreateStreamingReader( + kRpcNameLookup, auth_token, app_check_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/AppCheck may outlive Firestore + std::weak_ptr weak_this{shared_from_this()}; + auto credentials = std::make_shared(); + + auto done = [weak_this, credentials, on_credentials]( + const absl::optional>& auth, + const absl::optional& app_check) { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + + std::lock_guard lock(credentials->mutex); + if (auth) { + credentials->auth = *auth; + credentials->auth_received = true; + } + + if (app_check) { + credentials->app_check = *app_check; + credentials->app_check_received = true; + } + + if (!credentials->auth_received || !credentials->app_check_received) { + return; + } + + const StatusOr& auth_token = credentials->auth; + const std::string& app_check_token = credentials->app_check; + + strong_this->worker_queue_->EnqueueRelaxed( + [weak_this, auth_token, app_check_token, on_credentials] { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + // In case this callback is invoked after Datastore has been shut + // down. + if (strong_this->is_shut_down_) { + return; + } + on_credentials(auth_token, app_check_token); + }); + }; + + auth_credentials_->GetToken( + [done](const StatusOr& auth) { done(auth, absl::nullopt); }); + + app_check_credentials_->GetToken( + [done](const StatusOr& app_check) { + done(absl::nullopt, app_check.ValueOrDie()); // AppCheck never fails + }); +} + +void Datastore::HandleCallStatus(const Status& status) { + if (status.code() == Error::kErrorUnauthenticated) { + auth_credentials_->InvalidateToken(); + app_check_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::GetAllowlistedHeadersAsString( + const GrpcCall::Metadata& headers) { + static auto* allowlist = new std::unordered_set{ + "date", "x-google-backends", "x-google-netmon-label", "x-google-service", + "x-google-gfe-request-trace"}; + + std::string result; + auto end = allowlist->end(); + for (const auto& kv : headers) { + if (allowlist->find(MakeString(kv.first)) != end) { + absl::StrAppend(&result, MakeStringView(kv.first), ": ", + MakeStringView(kv.second), "\n"); + } + } + return result; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h new file mode 100644 index 0000000..8ccfa95 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h @@ -0,0 +1,216 @@ +/* + * 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_DATASTORE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_DATASTORE_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/credentials/auth_token.h" +#include "Firestore/core/src/credentials/credentials_fwd.h" +#include "Firestore/core/src/credentials/credentials_provider.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" + +namespace firebase { +namespace firestore { + +namespace model { +class Document; +}; // namespace model + +namespace remote { + +class ConnectivityMonitor; +class FirebaseMetadataProvider; + +/** + * `Datastore` represents a proxy for the remote server, hiding details of the + * RPC layer. It: + * + * - Manages connections to the server + * - Authenticates to the server + * - Manages threading and keeps higher-level code running on the worker queue + * - Serializes internal model objects to and from protocol buffers + * + * `Datastore` is generally not responsible for understanding the higher-level + * protocol involved in actually making changes or reading data, and aside from + * the connections it manages is otherwise stateless. + * + * This class is only intended to be inherited from by test mocks. + */ +class Datastore : public std::enable_shared_from_this { + public: + using LookupCallback = + std::function>&)>; + using CommitCallback = std::function; + + Datastore( + const core::DatabaseInfo& database_info, + const std::shared_ptr& worker_queue, + std::shared_ptr auth_credentials, + std::shared_ptr + app_check_credentials, + ConnectivityMonitor* connectivity_monitor, + FirebaseMetadataProvider* firebase_metadata_provider); + + virtual ~Datastore() = default; + + /** Starts polling the gRPC completion queue. */ + void Start(); + /** Cancels any pending gRPC calls and drains the gRPC completion queue. */ + void Shutdown(); + + /** + * Creates a new `WatchStream` that is still unstarted but uses a common + * shared channel. + */ + virtual std::shared_ptr CreateWatchStream( + WatchStreamCallback* callback); + /** + * Creates a new `WriteStream` that is still unstarted but uses a common + * shared channel. + */ + virtual std::shared_ptr CreateWriteStream( + WriteStreamCallback* callback); + + void CommitMutations(const std::vector& mutations, + CommitCallback&& callback); + void LookupDocuments(const std::vector& keys, + LookupCallback&& callback); + + /** Returns true if the given error is a gRPC ABORTED error. */ + static bool IsAbortedError(const util::Status& error); + + /** + * Determines whether an error code represents a permanent error when received + * in response to a non-write operation. + * + * See `IsPermanentWriteError` for classifying write errors. + */ + static bool IsPermanentError(const util::Status& error); + + /** + * Determines whether an error code represents a permanent error when received + * in response to a write operation. + * + * Write operations must be handled specially because as of b/119437764, + * ABORTED errors on the write stream should be retried too (even though + * ABORTED errors are not generally retryable). + * + * Note that during the initial handshake on the write stream an ABORTED error + * signals that we should discard our stream token (i.e. it is permanent). + * This means a handshake error should be classified with `IsPermanentError`, + * above. + */ + static bool IsPermanentWriteError(const util::Status& error); + + static std::string GetAllowlistedHeadersAsString( + const GrpcCall::Metadata& headers); + + Datastore(const Datastore& other) = delete; + Datastore(Datastore&& other) = delete; + Datastore& operator=(const Datastore& other) = delete; + Datastore& operator=(Datastore&& other) = delete; + + protected: + /** Test-only method */ + grpc::CompletionQueue* grpc_queue() { + return &grpc_queue_; + } + /** Test-only method */ + GrpcCall* LastCall() { + return !active_calls_.empty() ? active_calls_.back().get() : nullptr; + } + + /** Test-only getter for mocking */ + GrpcConnection* grpc_connection() { + return &grpc_connection_; + } + + private: + struct CallCredentials { + mutable std::mutex mutex; + std::string app_check; + bool app_check_received = false; + util::StatusOr auth; + bool auth_received = false; + }; + + void PollGrpcQueue(); + + void CommitMutationsWithCredentials( + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const std::vector& mutations, + CommitCallback&& callback); + + void LookupDocumentsWithCredentials( + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const std::vector& keys, + LookupCallback&& callback); + void OnLookupDocumentsResponse( + const util::StatusOr>& result, + const LookupCallback& callback); + + using OnCredentials = std::function&, const std::string&)>; + void ResumeRpcWithCredentials(const OnCredentials& on_credentials); + + void HandleCallStatus(const util::Status& status); + + void RemoveGrpcCall(GrpcCall* to_remove); + + // In case Auth tries to invoke a callback after `Datastore` has been shut + // down. + bool is_shut_down_ = false; + + std::shared_ptr worker_queue_; + std::shared_ptr + app_check_credentials_; + std::shared_ptr auth_credentials_; + + // A separate executor dedicated to polling gRPC completion queue (which is + // shared for all spawned gRPC streams and calls). + std::unique_ptr rpc_executor_; + grpc::CompletionQueue grpc_queue_; + ConnectivityMonitor* connectivity_monitor_ = nullptr; + GrpcConnection grpc_connection_; + + std::vector> active_calls_; + DatastoreSerializer datastore_serializer_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_DATASTORE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h new file mode 100644 index 0000000..3f4019c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h @@ -0,0 +1,46 @@ +/* + * 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_EXISTENCE_FILTER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_EXISTENCE_FILTER_H_ + +namespace firebase { +namespace firestore { +namespace remote { + +class ExistenceFilter { + public: + ExistenceFilter() = default; + explicit ExistenceFilter(int count) : count_{count} { + } + + int count() const { + return count_; + } + + private: + int count_ = 0; +}; + +inline bool operator==(const ExistenceFilter& lhs, const ExistenceFilter& rhs) { + return lhs.count() == rhs.count(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_EXISTENCE_FILTER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc new file mode 100644 index 0000000..bb78c9d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc @@ -0,0 +1,135 @@ +/* + * 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/exponential_backoff.h" + +#include +#include +#include +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" + +namespace firebase { +namespace firestore { +namespace remote { +namespace { + +using firebase::firestore::util::AsyncQueue; +using firebase::firestore::util::TimerId; +using Milliseconds = util::AsyncQueue::Milliseconds; +namespace chr = std::chrono; + +/** + * Initial backoff time in milliseconds after an error. Set to 1s according to + * https://cloud.google.com/apis/design/errors. + */ +constexpr Milliseconds kDefaultBackoffInitialDelay = Milliseconds(1000); + +constexpr double kDefaultBackoffFactor = 1.5; + +/** Maximum backoff time in milliseconds. */ +constexpr Milliseconds kDefaultBackoffMaxDelay = Milliseconds(60 * 1000); + +} // namespace + +ExponentialBackoff::ExponentialBackoff(const std::shared_ptr& queue, + TimerId timer_id, + double backoff_factor, + Milliseconds initial_delay, + Milliseconds max_delay) + : queue_{queue}, + timer_id_{timer_id}, + backoff_factor_{backoff_factor}, + initial_delay_{initial_delay}, + max_delay_{max_delay}, + last_attempt_time_{chr::steady_clock::now()} { + HARD_ASSERT(queue, "Queue can't be null"); + + HARD_ASSERT(backoff_factor >= 1.0, "Backoff factor must be at least 1"); + + HARD_ASSERT(initial_delay.count() >= 0, "Delays must be non-negative"); + HARD_ASSERT(max_delay.count() >= 0, "Delays must be non-negative"); + HARD_ASSERT(initial_delay <= max_delay, + "Initial delay can't be greater than max delay"); +} + +ExponentialBackoff::ExponentialBackoff(const std::shared_ptr& queue, + TimerId timer_id) + : ExponentialBackoff(queue, + timer_id, + kDefaultBackoffFactor, + kDefaultBackoffInitialDelay, + kDefaultBackoffMaxDelay) { +} + +void ExponentialBackoff::BackoffAndRun(AsyncQueue::Operation&& operation) { + Cancel(); + + // First schedule the block using the current base (which may be 0 and should + // be honored as such). + Milliseconds desired_delay_with_jitter = current_base_ + GetDelayWithJitter(); + + Milliseconds delay_so_far = chr::duration_cast( + chr::steady_clock::now() - last_attempt_time_); + + // Guard against the backoff delay already being past. + auto remaining_delay = + std::max(Milliseconds::zero(), desired_delay_with_jitter - delay_so_far); + + if (current_base_.count() > 0) { + LOG_DEBUG( + "Backing off for %s ms " + "(base delay: %s ms, " + "delay with jitter: %s ms, " + "last attempt: %s ms ago)", + remaining_delay.count(), current_base_.count(), + desired_delay_with_jitter.count(), delay_so_far.count()); + } + + delayed_operation_ = + queue_->EnqueueAfterDelay(remaining_delay, timer_id_, [this, operation] { + last_attempt_time_ = chr::steady_clock::now(); + operation(); + }); + + // Apply backoff factor to determine next delay, but ensure it is within + // bounds. + current_base_ = ClampDelay( + chr::duration_cast(current_base_ * backoff_factor_)); +} + +Milliseconds ExponentialBackoff::GetDelayWithJitter() { + std::uniform_real_distribution distribution; + double random_double = distribution(secure_random_); + return chr::duration_cast((random_double - 0.5) * + current_base_); +} + +Milliseconds ExponentialBackoff::ClampDelay(Milliseconds delay) const { + if (delay < initial_delay_) { + return initial_delay_; + } + if (delay > max_delay_) { + return max_delay_; + } + return delay; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h new file mode 100644 index 0000000..5f628f4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h @@ -0,0 +1,123 @@ +/* + * 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_EXPONENTIAL_BACKOFF_H_ +#define FIRESTORE_CORE_SRC_REMOTE_EXPONENTIAL_BACKOFF_H_ + +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/secure_random.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * + * A helper for running delayed operations following an exponential backoff + * curve between attempts. + * + * The first attempt will be done immediately. After that, each retry will + * have a delay that is made up of a "base" delay which follows the + * exponential backoff curve, and a +/- <=50% "jitter" that is calculated and + * added to the base delay. This prevents clients from accidentally + * synchronizing their delays causing spikes of load to the backend. + * + */ +class ExponentialBackoff { + public: + /** + * @param queue The queue to run operations on. + * @param timer_id The id to use when scheduling backoff operations on the + * queue. + * @param backoff_factor The multiplier to use to determine the extended base + * delay after each attempt. + * @param initial_delay The initial delay (used as the base delay on the first + * retry attempt, that is, the second attempt). Note that jitter will + * still be applied, so the actual delay could be as little as + * `0.5*initial_delay`. + * @param max_delay The maximum base delay after which no further backoff is + * performed. Note that jitter will still be applied, so the actual delay + * could be as much as `1.5*max_delay`. + */ + ExponentialBackoff(const std::shared_ptr& queue, + util::TimerId timer_id, + double backoff_factor, + util::AsyncQueue::Milliseconds initial_delay, + util::AsyncQueue::Milliseconds max_delay); + + /** + * Instantiates the exponential backoff with the default values. + */ + ExponentialBackoff(const std::shared_ptr& queue, + util::TimerId timer_id); + + /** + * Resets the backoff delay. + * + * 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`. + */ + void Reset() { + current_base_ = Milliseconds{0}; + } + + /** + * Resets the backoff to the maximum delay (e.g. for use after + * a RESOURCE_EXHAUSTED error). + */ + void ResetToMax() { + current_base_ = max_delay_; + } + + /** + * Waits for `current_base` seconds (which may be zero), increases the delay + * and runs the specified operation. If there was a pending operation waiting + * to be run already, it will be canceled. + */ + void BackoffAndRun(util::AsyncQueue::Operation&& operation); + + /** Cancels any pending backoff operation scheduled via `BackoffAndRun`. */ + void Cancel() { + delayed_operation_.Cancel(); + } + + private: + using Milliseconds = util::AsyncQueue::Milliseconds; + // Returns a random value in the range [-current_base_/2, current_base_/2]. + Milliseconds GetDelayWithJitter(); + Milliseconds ClampDelay(Milliseconds delay) const; + + std::shared_ptr queue_; + const util::TimerId timer_id_; + util::DelayedOperation delayed_operation_; + + const double backoff_factor_; + Milliseconds current_base_{0}; + const Milliseconds initial_delay_; + const Milliseconds max_delay_; + util::SecureRandom secure_random_; + std::chrono::steady_clock::time_point last_attempt_time_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_EXPONENTIAL_BACKOFF_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.cc new file mode 100644 index 0000000..a2cc162 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.cc @@ -0,0 +1,32 @@ +/* + * 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/remote/firebase_metadata_provider.h" + +namespace firebase { +namespace firestore { +namespace remote { + +const char FirebaseMetadataProvider::kXFirebaseClientHeader[] = + "x-firebase-client"; +const char FirebaseMetadataProvider::kXFirebaseClientLogTypeHeader[] = + "x-firebase-client-log-type"; +const char FirebaseMetadataProvider::kXFirebaseGmpIdHeader[] = + "x-firebase-gmpid"; + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.h new file mode 100644 index 0000000..25f145f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider.h @@ -0,0 +1,51 @@ +/* + * 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_REMOTE_FIREBASE_METADATA_PROVIDER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_H_ + +#include + +#include "grpcpp/client_context.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * Wraps the platform-dependent functionality associated with Firebase platform + * logging. + */ +class FirebaseMetadataProvider { + public: + static const char kXFirebaseClientHeader[]; + static const char kXFirebaseClientLogTypeHeader[]; + static const char kXFirebaseGmpIdHeader[]; + + virtual ~FirebaseMetadataProvider() = default; + + /** + * Updates the given `context` with Firebase platform logging headers which + * will be sent along with the default headers to the backend. + */ + virtual void UpdateMetadata(grpc::ClientContext& context) = 0; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.h new file mode 100644 index 0000000..fdd4895 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.h @@ -0,0 +1,54 @@ +/* + * 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_REMOTE_FIREBASE_METADATA_PROVIDER_APPLE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_APPLE_H_ + +#if !defined(__OBJC__) +#error "This header only supports Objective-C++." +#endif // !defined(__OBJC__) + +#import + +#include + +#include "Firestore/core/src/remote/firebase_metadata_provider.h" + +NS_ASSUME_NONNULL_BEGIN + +@class FIRApp; + +namespace firebase { +namespace firestore { +namespace remote { + +class FirebaseMetadataProviderApple : public FirebaseMetadataProvider { + public: + explicit FirebaseMetadataProviderApple(FIRApp* app); + + void UpdateMetadata(grpc::ClientContext& context) override; + + private: + FIRApp* app_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END + +#endif // FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.mm new file mode 100644 index 0000000..23d78e9 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_apple.mm @@ -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. + */ + +#include "Firestore/core/src/remote/firebase_metadata_provider_apple.h" + +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRHeartbeatInfo.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" + +#include "Firestore/core/src/util/string_apple.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace firebase { +namespace firestore { +namespace remote { +namespace { + +using util::MakeString; + +std::string GetUserAgent() { + return MakeString([FIRApp firebaseUserAgent]); +} + +FIRHeartbeatInfoCode GetHeartbeat() { + return [FIRHeartbeatInfo heartbeatCodeForTag:@"fire-fst"]; +} + +std::string GetGmpAppId(FIRApp* app) { + return MakeString(app.options.googleAppID); +} + +} // namespace + +FirebaseMetadataProviderApple::FirebaseMetadataProviderApple(FIRApp* app) + : app_(app) { +} + +void FirebaseMetadataProviderApple::UpdateMetadata( + grpc::ClientContext& context) { + FIRHeartbeatInfoCode heartbeat = GetHeartbeat(); + // TODO(varconst): don't send any headers if the heartbeat is "none". This + // should only be changed once it's possible to notify the heartbeat that the + // previous attempt to send it has failed. + if (heartbeat != FIRHeartbeatInfoCodeNone) { + context.AddMetadata(kXFirebaseClientLogTypeHeader, + std::to_string(heartbeat)); + } + + context.AddMetadata(kXFirebaseClientHeader, GetUserAgent()); + + std::string gmp_app_id = GetGmpAppId(app_); + if (!gmp_app_id.empty()) { + context.AddMetadata(kXFirebaseGmpIdHeader, gmp_app_id); + } +} + +} // namespace remote +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.cc new file mode 100644 index 0000000..84ff1b2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.cc @@ -0,0 +1,32 @@ +/* + * 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/remote/firebase_metadata_provider_noop.h" + +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace remote { + +std::unique_ptr +CreateFirebaseMetadataProviderNoOp() { + return absl::make_unique(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.h new file mode 100644 index 0000000..13bc06a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/firebase_metadata_provider_noop.h @@ -0,0 +1,42 @@ +/* + * 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_REMOTE_FIREBASE_METADATA_PROVIDER_NOOP_H_ +#define FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_NOOP_H_ + +#include +#include + +#include "Firestore/core/src/remote/firebase_metadata_provider.h" + +namespace firebase { +namespace firestore { +namespace remote { + +class FirebaseMetadataProviderNoOp : public FirebaseMetadataProvider { + public: + void UpdateMetadata(grpc::ClientContext&) override { + } +}; + +std::unique_ptr +CreateFirebaseMetadataProviderNoOp(); + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_FIREBASE_METADATA_PROVIDER_NOOP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h new file mode 100644 index 0000000..b802076 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h @@ -0,0 +1,67 @@ +/* + * 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_CALL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_CALL_H_ + +#include + +#include "Firestore/core/src/util/status_fwd.h" +#include "grpcpp/client_context.h" +#include "grpcpp/support/string_ref.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * Contains operations common to all wrappers over gRPC calls. A wrapper is + * presumed to: + * - wrap an asynchronous gRPC call/stream; + * - provide some notification mechanism (such as observers or callbacks). + */ +class GrpcCall { + public: + using Metadata = std::multimap; + + virtual ~GrpcCall() = default; + + /** + * Returns the metadata received from the server. + * + * Can only be called after the first response has been received from the + * server. + */ + virtual Metadata GetResponseHeaders() const = 0; + + /** + * Finishes the call gracefully. Doesn't produce a notification to any + * callbacks or observers. + */ + virtual void FinishImmediately() = 0; + + /** Finishes the call with an error, notifying any callbacks and observers. */ + virtual void FinishAndNotify(const util::Status& status) = 0; + + /** For tests only */ + virtual grpc::ClientContext* context() = 0; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_CALL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.cc new file mode 100644 index 0000000..a945b9e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.h new file mode 100644 index 0000000..e69d4ff --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc new file mode 100644 index 0000000..253ad08 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc @@ -0,0 +1,414 @@ +/* + * 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/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/credentials/auth_token.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/remote/firebase_metadata_provider.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 { +namespace { + +using core::DatabaseInfo; +using credentials::AuthToken; +using model::DatabaseId; +using util::Filesystem; +using util::Path; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +const char* const kAppCheckHeader = "x-firebase-appcheck"; +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); +} + +class HostConfig { + using Guard = std::lock_guard; + + public: + void set_certificate_path(const Path& new_value) { + Guard guard(mutex_); + certificate_path_ = new_value; + } + Path certificate_path() const { + Guard guard(mutex_); + return certificate_path_; + } + void set_target_name(const std::string& new_value) { + Guard guard(mutex_); + target_name_ = new_value; + } + std::string target_name() const { + Guard guard(mutex_); + return target_name_; + } + void set_use_insecure_channel(bool new_value) { + Guard guard(mutex_); + use_insecure_channel_ = new_value; + } + bool use_insecure_channel() const { + Guard guard(mutex_); + return use_insecure_channel_; + } + + private: + mutable std::mutex mutex_; + 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.set_certificate_path(certificate_path); + host_config.set_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.set_use_insecure_channel(true); + } + + private: + ConfigByHost map_; + mutable std::mutex mutex_; +}; + +HostConfigMap& Config() { + static auto* config_by_host = new HostConfigMap(); + 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); + } + + std::string Get() const { + Guard guard(mutex_); + return value_; + } + + private: + std::string value_ = GetCppLanguageToken(); + mutable std::mutex mutex_; +}; + +ClientLanguageToken& LanguageToken() { + static auto* token = new ClientLanguageToken(); + 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, + FirebaseMetadataProvider* firebase_metadata_provider) + : database_info_{&database_info}, + worker_queue_{NOT_NULL(worker_queue)}, + grpc_queue_{NOT_NULL(grpc_queue)}, + connectivity_monitor_{NOT_NULL(connectivity_monitor)}, + firebase_metadata_provider_{NOT_NULL(firebase_metadata_provider)} { + 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 AuthToken& auth_token, const std::string& app_check_token) const { + auto context = absl::make_unique(); + + absl::string_view auth = auth_token.user().is_authenticated() + ? auth_token.token() + : absl::string_view{}; + if (auth.data()) { + context->AddMetadata(kAuthorizationHeader, absl::StrCat("Bearer ", auth)); + } + if (!app_check_token.empty()) { + context->AddMetadata(kAppCheckHeader, app_check_token); + } + + AddCloudApiHeader(*context); + firebase_metadata_provider_->UpdateMetadata(*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 AuthToken& auth_token, + const std::string& app_check_token, + GrpcStreamObserver* observer) { + EnsureActiveStub(); + + auto context = CreateContext(auth_token, app_check_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 AuthToken& auth_token, + const std::string& app_check_token, + const grpc::ByteBuffer& message) { + EnsureActiveStub(); + + auto context = CreateContext(auth_token, app_check_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 AuthToken& auth_token, + const std::string& app_check_token, + const grpc::ByteBuffer& message) { + EnsureActiveStub(); + + auto context = CreateContext(auth_token, app_check_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h new file mode 100644 index 0000000..495990d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h @@ -0,0 +1,137 @@ +/* + * 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_REMOTE_GRPC_CONNECTION_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_CONNECTION_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/credentials/auth_token.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() + +namespace firebase { +namespace firestore { +namespace remote { + +class FirebaseMetadataProvider; + +// PORTING NOTE: this class has limited resemblance to `GrpcConnection` in Web +// client. However, unlike Web client, it's not meant to hide different +// implementations of a `Connection` under a single interface. + +/** + * Creates and owns gRPC objects (channel and stub) necessary to produce a + * `GrpcStream`. + */ +class GrpcConnection { + public: + GrpcConnection(const core::DatabaseInfo& database_info, + const std::shared_ptr& worker_queue, + grpc::CompletionQueue* grpc_queue, + ConnectivityMonitor* connectivity_monitor, + FirebaseMetadataProvider* firebase_metadata_provider); + + void Shutdown(); + + /** + * Creates a stream to the given stream RPC endpoint. The resulting stream + * needs to be `Start`ed before it can be used. + */ + // PORTING NOTE: unlike Web client, the created stream is not open and has to + // be started manually. + std::unique_ptr CreateStream( + absl::string_view rpc_name, + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + GrpcStreamObserver* observer); + + std::unique_ptr CreateUnaryCall( + absl::string_view rpc_name, + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const grpc::ByteBuffer& message); + + std::unique_ptr CreateStreamingReader( + absl::string_view rpc_name, + const credentials::AuthToken& auth_token, + const std::string& app_check_token, + const grpc::ByteBuffer& message); + + 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. + */ + static void UseInsecureChannel(const std::string& host); + + /** + * For tests only: use a custom root certificate file and the given SSL + * target name for all connections. Call before creating any streams or calls. + */ + static void UseTestCertificate(const std::string& host, + const util::Path& certificate_path, + const std::string& target_name); + + private: + std::unique_ptr CreateContext( + const credentials::AuthToken& auth_token, + const std::string& app_check_token) const; + std::shared_ptr CreateChannel() const; + void EnsureActiveStub(); + + void RegisterConnectivityMonitor(); + + const core::DatabaseInfo* database_info_ = nullptr; + std::shared_ptr worker_queue_; + grpc::CompletionQueue* grpc_queue_ = nullptr; + + std::shared_ptr grpc_channel_; + std::unique_ptr grpc_stub_; + + ConnectivityMonitor* connectivity_monitor_ = nullptr; + std::vector active_calls_; + + FirebaseMetadataProvider* firebase_metadata_provider_ = nullptr; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_CONNECTION_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.cc new file mode 100644 index 0000000..1b3004e --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.h new file mode 100644 index 0000000..df9fae0 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.h new file mode 100644 index 0000000..3cc7db1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.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_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ + +#include + +#include "Firestore/core/src/util/path.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * Finds the file containing gRPC root certificates (how it is stored differs by + * platform) and returns its contents as a string. Will trigger assertion + * failure if the file cannot be found or open. + */ +std::string LoadGrpcRootCertificate(); + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc new file mode 100644 index 0000000..1c10eea --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.cc new file mode 100644 index 0000000..cc73bd7 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.h new file mode 100644 index 0000000..29cf7e4 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc new file mode 100644 index 0000000..638318b --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc @@ -0,0 +1,362 @@ +/* + * 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/remote/grpc_stream.h" + +#include // NOLINT(build/c++11) +#include // NOLINT(build/c++11) + +#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 { +namespace remote { + +using util::AsyncQueue; +using util::Status; +using Type = GrpcCompletion::Type; + +// When invoking an async gRPC method, `GrpcStream` will create a new +// `GrpcCompletion` and use it as a tag to put on the gRPC completion queue. +// `GrpcStream` does not have a reference to the gRPC completion queue (this +// allows using the same completion queue for all streams); it expects that some +// different class (in practice, `RemoteStore`) will poll the gRPC completion +// queue and `Complete` all `GrpcCompletion`s that come out of the queue. +// `GrpcCompletion::Complete` will invoke the callback given to it by this +// `GrpcStream`. In turn, `GrpcStream` will decide whether to notify its +// observer. +// +// `GrpcStream` owns the gRPC objects (such as `grpc::ClientContext`) that must +// be valid until all `GrpcCompletion`s issued by this stream come back from the +// gRPC completion queue. `GrpcCompletion`s contain an `std::promise` that is +// fulfilled once the completion is taken off the gRPC completion queue, and +// `GrpcCompletion::WaitUntilOffQueue` allows blocking on this. `GrpcStream` +// holds non-owning pointers to all the completions that it issued (and removes +// pointers to completions once they ran). `GrpcStream::Finish` and +// `GrpcStream::WriteAndFinish` block on `GrpcCompletion::WaitUntilOffQueue` for +// all the currently-pending completions, thus ensuring that the stream can be +// safely released (along with the gRPC objects the stream owns) after `Finish` +// or `WriteAndFinish` have completed. + +namespace internal { + +absl::optional BufferedWriter::EnqueueWrite( + grpc::ByteBuffer&& message, const grpc::WriteOptions& options) { + queue_.push({std::move(message), options}); + return TryStartWrite(); +} + +absl::optional BufferedWriter::TryStartWrite() { + if (queue_.empty() || has_active_write_) { + return absl::nullopt; + } + + has_active_write_ = true; + BufferedWrite message = std::move(queue_.front()); + queue_.pop(); + return {std::move(message)}; +} + +absl::optional BufferedWriter::DequeueNextWrite() { + has_active_write_ = false; + return TryStartWrite(); +} + +} // namespace internal + +using internal::BufferedWrite; + +GrpcStream::GrpcStream( + std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + GrpcStreamObserver* observer) + : context_{std::move(NOT_NULL(context))}, + call_{std::move(NOT_NULL(call))}, + worker_queue_{NOT_NULL(worker_queue)}, + grpc_connection_{NOT_NULL(grpc_connection)}, + observer_{NOT_NULL(observer)} { + grpc_connection_->Register(this); +} + +GrpcStream::~GrpcStream() { + LOG_DEBUG("GrpcStream('%s'): destroying stream", this); + HARD_ASSERT(completions_.empty(), + "GrpcStream is being destroyed without proper shutdown"); + MaybeUnregister(); +} + +void GrpcStream::Start() { + // Make starting a quick operation that avoids a roundtrip to the server by + // skipping the wait for initial server metadata (instead, it will be + // automatically coalesced with the first write operation). + context_->set_initial_metadata_corked(true); + // It's generally okay to pass a null pointer as a tag; in this case in + // particular, the tag will never come back from the completion queue (by + // design). + call_->StartCall(nullptr); + + if (observer_) { + // Start listening for new messages. + // Order is important here -- any call to observer can potentially end this + // stream's lifetime, so call `Read` before notifying. + Read(); + observer_->OnStreamStart(); + } +} + +void GrpcStream::Read() { + if (!observer_) { + return; + } + + auto completion = NewCompletion( + Type::Read, [this](const std::shared_ptr& completion) { + OnRead(*completion->message()); + }); + call_->Read(completion->message(), completion.get()); +} + +void GrpcStream::Write(grpc::ByteBuffer&& message) { + MaybeWrite(buffered_writer_.EnqueueWrite(std::move(message))); +} + +void GrpcStream::WriteLast(grpc::ByteBuffer&& message) { + grpc::WriteOptions options; + options.set_last_message(); + MaybeWrite(buffered_writer_.EnqueueWrite(std::move(message), options)); +} + +void GrpcStream::MaybeWrite(absl::optional maybe_write) { + if (!maybe_write) { + return; + } + + BufferedWrite write = std::move(maybe_write).value(); + auto completion = NewCompletion( + Type::Write, + [this](const std::shared_ptr&) { OnWrite(); }); + *completion->message() = write.message; + + call_->Write(*completion->message(), write.options, completion.get()); +} + +void GrpcStream::FinishImmediately() { + LOG_DEBUG("GrpcStream('%s'): finishing without notifying observers", this); + + Shutdown(); + UnsetObserver(); +} + +void GrpcStream::FinishAndNotify(const Status& status) { + LOG_DEBUG("GrpcStream('%s'): finishing and notifying observers", this); + + Shutdown(); + + if (observer_) { + // The call to observer could end this `GrpcStream`'s lifetime, so make + // a protective copy. + GrpcStreamObserver* observer = observer_; + UnsetObserver(); + observer->OnStreamFinish(status); + } +} + +void GrpcStream::Shutdown() { + LOG_DEBUG("GrpcStream('%s'): shutting down; completions: %s, is finished: %s", + this, completions_.size(), is_grpc_call_finished_); + + MaybeUnregister(); + + // If completions are empty but the call hasn't been finished, it means this + // stream has never started. Calling `Finish` on the underlying gRPC call is + // invalid if it wasn't started previously. + 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 cancelling + // the context to avoid overwriting the status captured during the + // `OnOperationFailed`. + + context_->TryCancel(); + FinishGrpcCall({}); + } + + // Drain the completions -- `Shutdown` guarantees to bring the stream into + // destructible state. Two possibilities here: + // - completions are empty -- nothing to block on; + // - the only completion is "finish" (whether enqueued by this function or + // previously) -- "finish" is a very fast operation. + FastFinishCompletionsBlocking(); +} + +void GrpcStream::MaybeUnregister() { + if (grpc_connection_) { + grpc_connection_->Unregister(this); + grpc_connection_ = nullptr; + } +} + +void GrpcStream::FinishGrpcCall(const OnSuccess& callback) { + LOG_DEBUG("GrpcStream('%s'): finishing the underlying call", this); + + HARD_ASSERT(!is_grpc_call_finished_, "FinishGrpcCall called twice"); + is_grpc_call_finished_ = true; + + // All completions issued by this call must be taken off the queue before + // finish operation can be enqueued. + FastFinishCompletionsBlocking(); + auto completion = NewCompletion(Type::Finish, callback); + call_->Finish(completion->status(), completion.get()); +} + +void GrpcStream::FastFinishCompletionsBlocking() { + LOG_DEBUG("GrpcStream('%s'): fast finishing %s completion(s)", this, + completions_.size()); + + // TODO(varconst): reset buffered_writer_? Should not be necessary, because it + // should never be called again after a call to Finish. + + 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 (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(); +} + +bool GrpcStream::WriteAndFinish(grpc::ByteBuffer&& message) { + bool did_last_write = false; + if (!is_grpc_call_finished_) { + did_last_write = TryLastWrite(std::move(message)); + } + FinishImmediately(); + return did_last_write; +} + +bool GrpcStream::TryLastWrite(grpc::ByteBuffer&& message) { + absl::optional maybe_write = + buffered_writer_.EnqueueWrite(std::move(message)); + // Only bother with the last write if there is no active write at the moment. + if (!maybe_write) { + return false; + } + + BufferedWrite last_write = std::move(maybe_write).value(); + auto completion = NewCompletion(Type::Write, {}); + *completion->message() = last_write.message; + 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 cancelling a gRPC call + // makes all pending operations come back from the queue quickly). + + auto status = completion->WaitUntilOffQueue(std::chrono::milliseconds(500)); + return status == std::future_status::ready; +} + +GrpcStream::Metadata GrpcStream::GetResponseHeaders() const { + return context_->GetServerInitialMetadata(); +} + +// Callbacks + +void GrpcStream::OnRead(const grpc::ByteBuffer& message) { + if (observer_) { + // Continue waiting for new messages indefinitely as long as there is an + // interested observer. + // Order is important here -- any call to observer can potentially end this + // stream's lifetime, so call `Read` before notifying. + Read(); + observer_->OnStreamRead(message); + } +} + +void GrpcStream::OnWrite() { + if (observer_) { + MaybeWrite(buffered_writer_.DequeueNextWrite()); + // Observer is not interested in this event. + } +} + +void GrpcStream::OnOperationFailed() { + if (is_grpc_call_finished_) { + // If a finish operation has been enqueued already (possibly by a previous + // failed operation), there's nothing to do. + return; + } + + FinishGrpcCall([this](const std::shared_ptr& completion) { + Status status = ConvertStatus(*completion->status()); + FinishAndNotify(status); + }); +} + +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); +} + +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 std::shared_ptr& completion) { + RemoveCompletion(completion); + + if (ok) { + if (on_success) { + on_success(completion); + } + } else { + // Use the same error-handling for all operations; all errors are + // unrecoverable. + LOG_DEBUG("GrpcStream('%s'): operation of type %s failed", this, + completion->type()); + OnOperationFailed(); + } + }; + + // For lifetime details, see `GrpcCompletion` class comment. + auto completion = + GrpcCompletion::Create(tag, worker_queue_, std::move(decorated)); + completions_.push_back(completion); + return completion; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h new file mode 100644 index 0000000..dfc656e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h @@ -0,0 +1,248 @@ +/* + * 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_REMOTE_GRPC_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_H_ + +#include +#include +#include +#include +#include +#include +#include + +#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() + +namespace firebase { +namespace firestore { +namespace remote { + +class GrpcConnection; +class GrpcStream; + +namespace internal { + +struct BufferedWrite { + grpc::ByteBuffer message; + grpc::WriteOptions options; +}; + +/** + * `BufferedWriter` accepts serialized protos ("writes") on its queue and + * writes them to the gRPC stream one by one. Only one write + * may be in progress ("active") at any given time. + * + * Writes are put on the queue using `EnqueueWrite`; if no other write is + * currently in progress, a write will be issued with the given proto + * immediately, otherwise, the proto will be "buffered" (put on the queue in + * this `BufferedWriter`). When a write becomes active, a `StreamWrite` + * operation is created with the proto and immediately executed; a write is + * active from the moment it is executed and until `DequeueNextWrite` is called + * on the `BufferedWriter`. `DequeueNextWrite` makes the next write active, if + * any. + * + * `BufferedWriter` does not store any of the operations it creates. + * + * This class exists to help Firestore streams adhere to the gRPC requirement + * that only one write operation may be active at any given time. + */ +class BufferedWriter { + public: + // Returns the newly-created write operation if the given `write` became + // active, null pointer otherwise. + absl::optional EnqueueWrite(grpc::ByteBuffer&& message, + const grpc::WriteOptions& options); + + absl::optional EnqueueWrite(grpc::ByteBuffer&& write) { + return EnqueueWrite(std::move(write), grpc::WriteOptions{}); + } + + // Returns the newly-created write operation if there was a next write in the + // queue, or nullptr if the queue was empty. + absl::optional DequeueNextWrite(); + + private: + absl::optional TryStartWrite(); + + std::queue queue_; + bool has_active_write_ = false; +}; + +} // namespace internal + +/** + * A gRPC bidirectional stream that notifies the given `observer` about stream + * events. + * + * The stream has to be explicitly opened (via `Start`) before it can be used. + * The stream is always listening for new messages from the server. The stream + * can be used to send messages to the server (via `Write`); messages are queued + * and sent out one by one. Both sent and received messages are raw bytes; + * serialization and deserialization are left to the caller. + * + * The observer will be notified about the following events: + * - stream has been started; + * - stream has received a new message from the server; + * - stream has been interrupted with an error. All errors are unrecoverable. + * + * Note that the stream will _not_ notify the observer about finish if the + * finish was initiated by the client. + * + * The stream is disposable; once it finishes, it cannot be restarted. + * + * This class is essentially a wrapper over + * `grpc::GenericClientAsyncReaderWriter`. See the source file for comments on + * implementation details. + */ +class GrpcStream : public GrpcCall { + public: + GrpcStream(std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + GrpcStreamObserver* observer); + ~GrpcStream() override; + + void Start(); + + // Can only be called once the stream has opened. + void Write(grpc::ByteBuffer&& message); + + /** + * Writes the given message and indicates to the server that no more write + * operations will be sent using this stream. It is invalid to call `Write` or + * `WriteLast` after `WriteLast` was called. + */ + void WriteLast(grpc::ByteBuffer&& message); + + // Does not produce a notification. Once this method is called, the stream can + // no longer be used. + // + // This is a blocking operation; blocking time is expected to be in the order + // of tens of milliseconds. + // + // Can be called on a stream before it opens. + void FinishImmediately() override; + + // Like `FinishImmediately`, but will notify the observer. + void FinishAndNotify(const util::Status& status) override; + + /** + * Writes the given message and finishes the stream as soon as this final + * write succeeds. The final write is done on a best-effort basis; the return + * value indicates whether the final write went through. + * + * This is a blocking operation; blocking time is expected to be in the order + * of tens of milliseconds. + * + * Can only be called once the stream has opened. + */ + bool WriteAndFinish(grpc::ByteBuffer&& message); + + bool IsFinished() const { + return observer_ == nullptr; + } + + /** + * Returns the metadata received from the server. + * + * Can only be called once the stream has opened. + */ + Metadata GetResponseHeaders() const override; + + /** For tests only */ + grpc::ClientContext* context() override { + return context_.get(); + } + + private: + void Read(); + void MaybeWrite(absl::optional maybe_write); + bool TryLastWrite(grpc::ByteBuffer&& message); + + void Shutdown(); + void UnsetObserver() { + observer_ = nullptr; + } + void MaybeUnregister(); + + void OnStart(); + void OnRead(const grpc::ByteBuffer& message); + void OnWrite(); + void OnOperationFailed(); + void RemoveCompletion(const std::shared_ptr& to_remove); + + using OnSuccess = std::function&)>; + std::shared_ptr NewCompletion(GrpcCompletion::Type tag, + const OnSuccess& on_success); + // 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 + // the current call either failed (`OnOperationFailed`) or canceled. + void FinishGrpcCall(const OnSuccess& callback); + + // Blocks until all the completions issued by this stream come out from the + // gRPC completion queue. Once they do, it is safe to delete this `GrpcStream` + // (thus releasing `grpc::ClientContext`). This function should only be called + // during the stream finish. + // + // Important: before calling this function, the caller must be sure that any + // pending completions on the gRPC completion queue will come back quickly + // (either because the call has failed, or because the call has been + // canceled). Otherwise, this function will block indefinitely. + void FastFinishCompletionsBlocking(); + + // gRPC requires the `context_` and `call_` objects to be valid until the last + // gRPC operation associated with this stream finishes. Note that + // `grpc::ClientContext` is _not_ reference-counted. + // + // Important: `call_` has to be destroyed before `context_`, so declaration + // order matters here. Despite the unique pointer, `call_` is actually + // a non-owning handle, and the memory it refers to (part of a gRPC memory + // arena) will be released once `context_` (which is owning) is released. + std::unique_ptr context_; + std::unique_ptr call_; + + std::shared_ptr worker_queue_; + GrpcConnection* grpc_connection_ = nullptr; + + GrpcStreamObserver* observer_ = nullptr; + internal::BufferedWriter buffered_writer_; + + std::vector> completions_; + + // gRPC asserts that a call is finished exactly once. + bool is_grpc_call_finished_ = false; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h new file mode 100644 index 0000000..b9283e1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h @@ -0,0 +1,44 @@ +/* + * 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_STREAM_OBSERVER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_OBSERVER_H_ + +#include "Firestore/core/src/util/status_fwd.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** Observer that gets notified of events on a gRPC stream. */ +class GrpcStreamObserver { + public: + virtual ~GrpcStreamObserver() = default; + + // Stream has been successfully established. + virtual void OnStreamStart() = 0; + // A message has been received from the server. + virtual void OnStreamRead(const grpc::ByteBuffer& message) = 0; + // Connection has been broken, perhaps by the server. + virtual void OnStreamFinish(const util::Status& status) = 0; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_OBSERVER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc new file mode 100644 index 0000000..49bff94 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc @@ -0,0 +1,86 @@ +/* + * 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_streaming_reader.h" + +#include + +#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 { +namespace remote { + +using util::AsyncQueue; +using util::Status; + +GrpcStreamingReader::GrpcStreamingReader( + std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + const grpc::ByteBuffer& request) + : stream_{absl::make_unique(std::move(context), + std::move(call), + worker_queue, + grpc_connection, + this)}, + request_{request} { +} + +void GrpcStreamingReader::Start(Callback&& callback) { + callback_ = std::move(callback); + stream_->Start(); +} + +void GrpcStreamingReader::FinishImmediately() { + stream_->FinishImmediately(); +} + +void GrpcStreamingReader::FinishAndNotify(const Status& status) { + stream_->FinishAndNotify(status); +} + +void GrpcStreamingReader::OnStreamStart() { + // It is important to indicate to the server that there will be no follow-up + // writes; otherwise, the call will never finish. + stream_->WriteLast(std::move(request_)); +} + +void GrpcStreamingReader::OnStreamRead(const grpc::ByteBuffer& message) { + // Accumulate responses + responses_.push_back(message); +} + +void GrpcStreamingReader::OnStreamFinish(const util::Status& status) { + HARD_ASSERT(callback_, + "Received an event from stream after callback was unset"); + // Invoking the callback may end this reader's lifetime. + auto callback = std::move(callback_); + if (status.ok()) { + callback(responses_); + } else { + callback(status); + } +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h new file mode 100644 index 0000000..f6774fd --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h @@ -0,0 +1,110 @@ +/* + * 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_REMOTE_GRPC_STREAMING_READER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAMING_READER_H_ + +#include +#include +#include +#include + +#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() + +namespace firebase { +namespace firestore { +namespace remote { + +class GrpcConnection; + +/** + * Sends a single request to the server, reads one or more streaming server + * responses, and invokes the given callback with the accumulated responses. + */ +class GrpcStreamingReader : public GrpcCall, public GrpcStreamObserver { + public: + using ResponsesT = std::vector; + using Callback = std::function&)>; + + GrpcStreamingReader( + std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + const grpc::ByteBuffer& request); + + /** + * Starts the call; the given `callback` will be invoked with the accumulated + * results of the call. If the call fails, the `callback` will be invoked with + * a non-ok status. + */ + void Start(Callback&& callback); + + /** + * If the call is in progress, attempts to cancel the call; otherwise, it's + * a no-op. Cancellation is done on best-effort basis; however: + * - the call is guaranteed to be finished when this function returns; + * - this function is blocking but should finish very fast (order of + * milliseconds). + * + * If this function succeeds in cancelling the call, the callback will not be + * invoked. + */ + void FinishImmediately() override; + + void FinishAndNotify(const util::Status& status) override; + + /** + * Returns the metadata received from the server. + * + * Can only be called once the `GrpcStreamingReader` has received the first + * message from the server. + */ + Metadata GetResponseHeaders() const override { + return stream_->GetResponseHeaders(); + } + + void OnStreamStart() override; + void OnStreamRead(const grpc::ByteBuffer& message) override; + void OnStreamFinish(const util::Status& status) override; + + /** For tests only */ + grpc::ClientContext* context() override { + return stream_->context(); + } + + private: + std::unique_ptr stream_; + grpc::ByteBuffer request_; + + Callback callback_; + ResponsesT responses_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAMING_READER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.cc new file mode 100644 index 0000000..007211e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.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 "Firestore/core/src/remote/grpc_unary_call.h" + +#include + +#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 { +namespace remote { + +using util::AsyncQueue; +using util::Status; +using Type = GrpcCompletion::Type; + +GrpcUnaryCall::GrpcUnaryCall( + std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + const grpc::ByteBuffer& request) + : context_{std::move(context)}, + call_{std::move(call)}, + request_{request}, + worker_queue_{worker_queue}, + grpc_connection_{grpc_connection} { + grpc_connection_->Register(this); +} + +GrpcUnaryCall::~GrpcUnaryCall() { + HARD_ASSERT(!finish_completion_, + "GrpcUnaryCall is being destroyed without proper shutdown"); + MaybeUnregister(); +} + +void GrpcUnaryCall::Start(Callback&& callback) { + callback_ = std::move(callback); + call_->StartCall(); + + // For lifetime details, see `GrpcCompletion` class comment. + finish_completion_ = GrpcCompletion::Create( + Type::Finish, worker_queue_, + [this](bool /*ignored_ok*/, + const std::shared_ptr& completion) { + // Ignoring ok, status should contain all the relevant information. + finish_completion_.reset(); + Shutdown(); + + auto callback = std::move(callback_); + if (completion->status()->ok()) { + callback(*completion->message()); + } else { + callback(ConvertStatus(*completion->status())); + } + // This `GrpcUnaryCall`'s lifetime might have been ended by the + // callback. + }); + + call_->Finish(finish_completion_->message(), finish_completion_->status(), + finish_completion_.get()); +} + +void GrpcUnaryCall::FinishImmediately() { + Shutdown(); +} + +void GrpcUnaryCall::FinishAndNotify(const util::Status& status) { + Shutdown(); + + auto callback = std::move(callback_); + callback(status); +} + +void GrpcUnaryCall::Shutdown() { + MaybeUnregister(); + if (!finish_completion_) { + // Nothing to cancel. + return; + } + + context_->TryCancel(); + + finish_completion_->Cancel(); + // This function blocks. + finish_completion_->WaitUntilOffQueue(); + finish_completion_.reset(); +} + +void GrpcUnaryCall::MaybeUnregister() { + if (grpc_connection_) { + grpc_connection_->Unregister(this); + grpc_connection_ = nullptr; + } +} + +GrpcCall::Metadata GrpcUnaryCall::GetResponseHeaders() const { + return context_->GetServerInitialMetadata(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.h new file mode 100644 index 0000000..b366935 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.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_REMOTE_GRPC_UNARY_CALL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_UNARY_CALL_H_ + +#include +#include +#include + +#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() + +namespace firebase { +namespace firestore { +namespace remote { + +class GrpcConnection; + +/** + * Sends a single request to the server and invokes the given callback with the + * server response. + */ +class GrpcUnaryCall : public GrpcCall { + public: + using Callback = std::function&)>; + + GrpcUnaryCall(std::unique_ptr context, + std::unique_ptr call, + const std::shared_ptr& worker_queue, + GrpcConnection* grpc_connection, + const grpc::ByteBuffer& request); + ~GrpcUnaryCall(); + + /** + * Starts the call; the given `callback` will be invoked with the result of + * the call. If the call fails, the `callback` will be invoked with a non-ok + * status. + */ + void Start(Callback&& callback); + + /** + * If the call is in progress, attempts to finish the call early, effectively + * cancelling it; otherwise, it's a no-op. Cancellation is done on best-effort + * basis; however: + * - the call is guaranteed to be finished when this function returns; + * - this function is blocking but should be done very fast (order of + * milliseconds). + * + * If this function succeeds in cancelling the call, the callback will not be + * invoked. + */ + void FinishImmediately() override; + + /** Like `Finish`, but always invokes the callback with the given `status`. */ + void FinishAndNotify(const util::Status& status) override; + + /** + * Returns the metadata received from the server. + * + * Can only be called once the `GrpcUnaryCall` has finished. + */ + Metadata GetResponseHeaders() const override; + + /** For tests only */ + grpc::ClientContext* context() override { + return context_.get(); + } + + private: + void Shutdown(); + void MaybeUnregister(); + + // See comments in `GrpcStream` on lifetime issues for gRPC objects. + std::unique_ptr context_; + std::unique_ptr call_; + // Stored to avoid lifetime issues with gRPC. + grpc::ByteBuffer request_; + + std::shared_ptr worker_queue_; + GrpcConnection* grpc_connection_ = nullptr; + + std::shared_ptr finish_completion_; + Callback callback_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_UNARY_CALL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc new file mode 100644 index 0000000..61ce123 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc @@ -0,0 +1,48 @@ +/* + * 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_util.h" + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using util::Status; + +Status ConvertStatus(const grpc::Status& from) { + if (from.ok()) { + return Status::OK(); + } + + grpc::StatusCode error_code = from.error_code(); + // Both `grpc::Status` and Firestore's `util::Status` use canonical error + // codes for Google APIs. The canonical codes define integer values, so this + // conversion should be safe. + // See + // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto + 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()}; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h new file mode 100644 index 0000000..0804361 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h @@ -0,0 +1,33 @@ +/* + * 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_UTIL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_ + +#include "Firestore/core/src/util/status_fwd.h" +#include "grpcpp/support/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +util::Status ConvertStatus(const grpc::Status& from); + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc new file mode 100644 index 0000000..ade2f0a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc @@ -0,0 +1,150 @@ +/* + * 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/remote/online_state_tracker.h" + +#include // NOLINT(build/c++11) + +#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 firebase { +namespace firestore { +namespace remote { +namespace { + +namespace chr = std::chrono; + +using model::OnlineState; +using util::AsyncQueue; +using util::Status; +using util::StringFormat; +using util::TimerId; + +// To deal with transient failures, we allow multiple stream attempts before +// giving up and transitioning from OnlineState Unknown to Offline. +// TODO(mikelehen): This used to be set to 2 as a mitigation for b/66228394. +// @jdimond thinks that bug is sufficiently fixed so that we can set this back +// to 1. If that works okay, we could potentially remove this logic entirely. +const int kMaxWatchStreamFailures = 1; + +// To deal with stream attempts that don't succeed or fail in a timely manner, +// we have a timeout for OnlineState to reach Online or Offline. If the timeout +// is reached, we transition to Offline rather than waiting indefinitely. +const AsyncQueue::Milliseconds kOnlineStateTimeout = chr::seconds(10); + +} // namespace + +void OnlineStateTracker::HandleWatchStreamStart() { + if (watch_stream_failures_ != 0) { + return; + } + + SetAndBroadcast(OnlineState::Unknown); + + HARD_ASSERT(!online_state_timer_, + "online_state_timer_ shouldn't be started yet"); + online_state_timer_ = worker_queue_->EnqueueAfterDelay( + kOnlineStateTimeout, TimerId::OnlineStateTimeout, [this] { + online_state_timer_ = {}; + + HARD_ASSERT(state_ == OnlineState::Unknown, + "Timer should be canceled if we transitioned to a " + "different state."); + LogClientOfflineWarningIfNecessary(StringFormat( + "Backend didn't respond within %s seconds.", + chr::duration_cast(kOnlineStateTimeout).count())); + SetAndBroadcast(OnlineState::Offline); + + // NOTE: `HandleWatchStreamFailure` will continue to increment + // `watch_stream_failures_` even though we are already marked `Offline` + // but this is non-harmful. + }); +} + +void OnlineStateTracker::HandleWatchStreamFailure(const Status& error) { + if (state_ == OnlineState::Online) { + SetAndBroadcast(OnlineState::Unknown); + + // To get to `OnlineState`::Online, `UpdateState` must have been called + // which would have reset our heuristics. + HARD_ASSERT(watch_stream_failures_ == 0, + "watch_stream_failures_ must be 0"); + HARD_ASSERT(!online_state_timer_, + "online_state_timer_ must not be set yet"); + } else { + ++watch_stream_failures_; + + if (watch_stream_failures_ >= kMaxWatchStreamFailures) { + ClearOnlineStateTimer(); + + LogClientOfflineWarningIfNecessary( + StringFormat("Connection failed %s times. Most recent error: %s", + kMaxWatchStreamFailures, error.error_message())); + + SetAndBroadcast(OnlineState::Offline); + } + } +} + +void OnlineStateTracker::UpdateState(OnlineState new_state) { + ClearOnlineStateTimer(); + watch_stream_failures_ = 0; + + if (new_state == OnlineState::Online) { + // We've connected to watch at least once. Don't warn the developer about + // being offline going forward. + should_warn_client_is_offline_ = false; + } + + SetAndBroadcast(new_state); +} + +void OnlineStateTracker::SetAndBroadcast(OnlineState new_state) { + if (new_state != state_) { + state_ = new_state; + online_state_handler_(new_state); + } +} + +void OnlineStateTracker::LogClientOfflineWarningIfNecessary( + const std::string& reason) { + std::string message = StringFormat( + "Could not reach Cloud Firestore backend. %s\n This " + "typically indicates that your device does not have a " + "healthy Internet connection at the moment. The client will " + "operate in offline mode until it is able to successfully " + "connect to the backend.", + reason); + + if (should_warn_client_is_offline_) { + LOG_WARN("%s", message); + should_warn_client_is_offline_ = false; + } else { + LOG_DEBUG("%s", message); + } +} + +void OnlineStateTracker::ClearOnlineStateTimer() { + online_state_timer_.Cancel(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h new file mode 100644 index 0000000..297f0ea --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h @@ -0,0 +1,126 @@ +/* + * 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_ONLINE_STATE_TRACKER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_ONLINE_STATE_TRACKER_H_ + +#include +#include +#include +#include + +#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 { +namespace remote { + +/** + * A component used by the `RemoteStore` to track the `OnlineState` (that is, + * whether or not the client as a whole should be considered to be online or + * offline), implementing the appropriate heuristics. + * + * In particular, when the client is trying to connect to the backend, we allow + * 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.). + */ +class OnlineStateTracker { + public: + OnlineStateTracker() = default; + + OnlineStateTracker( + const std::shared_ptr& worker_queue, + std::function online_state_handler) + : worker_queue_{worker_queue}, + online_state_handler_{online_state_handler} { + } + + /** + * Called by `RemoteStore` when a watch stream is started (including on + * each backoff attempt). + * + * If this is the first attempt, it sets the `OnlineState` to `Unknown` and + * starts the `online_state_timer_`. + */ + void HandleWatchStreamStart(); + + /** + * Called by `RemoteStore` when a watch stream fails. + * + * Updates our `OnlineState` as appropriate. The first failure moves us to + * `OnlineState::Unknown`. We then may allow multiple failures (based on + * `kMaxWatchStreamFailures`) before we actually transition to + * `OnlineState::Offline`. + */ + void HandleWatchStreamFailure(const util::Status& error); + + /** + * Explicitly sets the `OnlineState` to the specified state. + * + * Note that this resets the timers / failure counters, etc. used by our + * `Offline` heuristics, so it must not be used in place of + * `HandleWatchStreamStart` and `HandleWatchStreamFailure`. + */ + void UpdateState(model::OnlineState new_state); + + private: + void SetAndBroadcast(model::OnlineState new_state); + void LogClientOfflineWarningIfNecessary(const std::string& reason); + void ClearOnlineStateTimer(); + + /** The current `OnlineState`. */ + model::OnlineState state_ = model::OnlineState::Unknown; + + /** + * A count of consecutive failures to open the stream. If it reaches the + * maximum defined by `kMaxWatchStreamFailures`, we'll revert to + * `OnlineState::Offline`. + */ + int watch_stream_failures_ = 0; + + /** + * A timer that elapses after `kOnlineStateTimeout`, at which point we + * transition from `OnlineState` `Unknown` to `Offline` without waiting for + * the stream to actually fail (`kMaxWatchStreamFailures` times). + */ + util::DelayedOperation online_state_timer_; + + /** + * Whether the client should log a warning message if it fails to connect to + * the backend (initially true, cleared after a successful stream, or if we've + * logged the message already). + */ + bool should_warn_client_is_offline_ = true; + + /** + * The worker queue to use for running timers (and to call + * `online_state_handler_`). + */ + std::shared_ptr worker_queue_; + + /** A callback to be notified on `OnlineState` changes. */ + std::function online_state_handler_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_ONLINE_STATE_TRACKER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc new file mode 100644 index 0000000..f6f5d86 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc @@ -0,0 +1,424 @@ +/* + * 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_event.h" + +#include + +#include "Firestore/core/src/local/target_data.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using core::DocumentViewChange; +using core::Target; +using local::QueryPurpose; +using local::TargetData; +using model::DocumentKey; +using model::DocumentKeySet; +using model::MutableDocument; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; + +// TargetChange + +bool operator==(const TargetChange& lhs, const TargetChange& rhs) { + return lhs.resume_token() == rhs.resume_token() && + lhs.current() == rhs.current() && + lhs.added_documents() == rhs.added_documents() && + lhs.modified_documents() == rhs.modified_documents() && + lhs.removed_documents() == rhs.removed_documents(); +} + +// TargetState + +void TargetState::UpdateResumeToken(ByteString resume_token) { + if (!resume_token.empty()) { + has_pending_changes_ = true; + resume_token_ = std::move(resume_token); + } +} + +TargetChange TargetState::ToTargetChange() const { + DocumentKeySet added_documents; + DocumentKeySet modified_documents; + DocumentKeySet removed_documents; + + for (const auto& entry : document_changes_) { + const DocumentKey& document_key = entry.first; + DocumentViewChange::Type change_type = entry.second; + + switch (change_type) { + case DocumentViewChange::Type::Added: + added_documents = added_documents.insert(document_key); + break; + case DocumentViewChange::Type::Modified: + modified_documents = modified_documents.insert(document_key); + break; + case DocumentViewChange::Type::Removed: + removed_documents = removed_documents.insert(document_key); + break; + default: + HARD_FAIL("Encountered invalid change type: %s", change_type); + } + } + + return TargetChange{resume_token(), current(), std::move(added_documents), + std::move(modified_documents), + std::move(removed_documents)}; +} + +void TargetState::ClearPendingChanges() { + has_pending_changes_ = false; + document_changes_.clear(); +} + +void TargetState::RecordPendingTargetRequest() { + ++outstanding_responses_; +} + +void TargetState::RecordTargetResponse() { + --outstanding_responses_; +} + +void TargetState::MarkCurrent() { + has_pending_changes_ = true; + current_ = true; +} + +void TargetState::AddDocumentChange(const DocumentKey& document_key, + DocumentViewChange::Type type) { + has_pending_changes_ = true; + document_changes_[document_key] = type; +} + +void TargetState::RemoveDocumentChange(const DocumentKey& document_key) { + has_pending_changes_ = true; + document_changes_.erase(document_key); +} + +// WatchChangeAggregator + +WatchChangeAggregator::WatchChangeAggregator( + TargetMetadataProvider* target_metadata_provider) + : target_metadata_provider_{NOT_NULL(target_metadata_provider)} { +} + +void WatchChangeAggregator::HandleDocumentChange( + const DocumentWatchChange& document_change) { + for (TargetId target_id : document_change.updated_target_ids()) { + const auto& new_doc = document_change.new_document(); + if (new_doc && new_doc->is_found_document()) { + AddDocumentToTarget(target_id, *new_doc); + } else if (new_doc && new_doc->is_no_document()) { + RemoveDocumentFromTarget(target_id, document_change.document_key(), + document_change.new_document()); + } + } + + for (TargetId target_id : document_change.removed_target_ids()) { + RemoveDocumentFromTarget(target_id, document_change.document_key(), + document_change.new_document()); + } +} + +void WatchChangeAggregator::HandleTargetChange( + const WatchTargetChange& target_change) { + for (TargetId target_id : GetTargetIds(target_change)) { + TargetState& target_state = EnsureTargetState(target_id); + + switch (target_change.state()) { + case WatchTargetChangeState::NoChange: + if (IsActiveTarget(target_id)) { + target_state.UpdateResumeToken(target_change.resume_token()); + } + continue; + case WatchTargetChangeState::Added: + // We need to decrement the number of pending acks needed from watch for + // this target_id. + target_state.RecordTargetResponse(); + if (!target_state.IsPending()) { + // We have a freshly added target, so we need to reset any state that + // we had previously. This can happen e.g. when remove and add back a + // target for existence filter mismatches. + target_state.ClearPendingChanges(); + } + target_state.UpdateResumeToken(target_change.resume_token()); + continue; + case WatchTargetChangeState::Removed: + // 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); + } + HARD_ASSERT(target_change.cause().ok(), + "WatchChangeAggregator does not handle errored targets"); + continue; + case WatchTargetChangeState::Current: + if (IsActiveTarget(target_id)) { + target_state.MarkCurrent(); + target_state.UpdateResumeToken(target_change.resume_token()); + } + continue; + case WatchTargetChangeState::Reset: + if (IsActiveTarget(target_id)) { + // Reset the target and synthesizes removes for all existing + // documents. The backend will re-add any documents that still match + // the target before it sends the next global snapshot. + ResetTarget(target_id); + target_state.UpdateResumeToken(target_change.resume_token()); + } + continue; + } + HARD_FAIL("Unknown target watch change state: %s", target_change.state()); + } +} + +std::vector WatchChangeAggregator::GetTargetIds( + const WatchTargetChange& target_change) const { + if (!target_change.target_ids().empty()) { + return target_change.target_ids(); + } + + std::vector result; + for (const auto& entry : target_states_) { + if (IsActiveTarget(entry.first)) { + result.push_back(entry.first); + } + } + + return result; +} + +void WatchChangeAggregator::HandleExistenceFilter( + const ExistenceFilterWatchChange& existence_filter) { + TargetId target_id = existence_filter.target_id(); + int expected_count = existence_filter.filter().count(); + + 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 + // updates. Without applying this deleted document there might be + // another query that will raise this document as part of a snapshot + // until it is resolved, essentially exposing inconsistency between + // queries. + DocumentKey key{target.path()}; + RemoveDocumentFromTarget( + target_id, key, + MutableDocument::NoDocument(key, SnapshotVersion::None())); + } else { + HARD_ASSERT(expected_count == 1, + "Single document existence filter with count: %s", + expected_count); + } + } else { + int current_size = GetCurrentDocumentCountForTarget(target_id); + if (current_size != expected_count) { + // Existence filter mismatch: We reset the mapping and raise a new + // snapshot with `isFromCache:true`. + ResetTarget(target_id); + pending_target_resets_.insert(target_id); + } + } + } +} + +RemoteEvent WatchChangeAggregator::CreateRemoteEvent( + const SnapshotVersion& snapshot_version) { + std::unordered_map target_changes; + + for (auto& entry : target_states_) { + TargetId target_id = entry.first; + TargetState& target_state = entry.second; + + 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 + // SyncEngine::limbo_document_refs_. + DocumentKey key{target_data->target().path()}; + if (pending_document_updates_.find(key) == + pending_document_updates_.end() && + !TargetContainsDocument(target_id, key)) { + RemoveDocumentFromTarget( + target_id, key, + MutableDocument::NoDocument(key, snapshot_version)); + } + } + + if (target_state.HasPendingChanges()) { + target_changes[target_id] = target_state.ToTargetChange(); + target_state.ClearPendingChanges(); + } + } + } + + 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 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 target_data = + TargetDataForActiveTarget(target_id); + if (target_data && + target_data->purpose() != QueryPurpose::LimboResolution) { + is_only_limbo_target = false; + break; + } + } + + if (is_only_limbo_target) { + resolved_limbo_documents = resolved_limbo_documents.insert(entry.first); + } + } + + RemoteEvent remote_event{snapshot_version, std::move(target_changes), + std::move(pending_target_resets_), + std::move(pending_document_updates_), + std::move(resolved_limbo_documents)}; + + // Re-initialize the current state to ensure that we do not modify the + // generated `RemoteEvent`. + pending_document_updates_.clear(); + pending_document_target_mappings_.clear(); + pending_target_resets_.clear(); + + return remote_event; +} + +void WatchChangeAggregator::AddDocumentToTarget( + TargetId target_id, const MutableDocument& document) { + if (!IsActiveTarget(target_id)) { + return; + } + + DocumentViewChange::Type change_type = + TargetContainsDocument(target_id, document.key()) + ? DocumentViewChange::Type::Modified + : DocumentViewChange::Type::Added; + + TargetState& target_state = EnsureTargetState(target_id); + target_state.AddDocumentChange(document.key(), change_type); + + pending_document_updates_[document.key()] = document; + pending_document_target_mappings_[document.key()].insert(target_id); +} + +void WatchChangeAggregator::RemoveDocumentFromTarget( + TargetId target_id, + const DocumentKey& key, + const absl::optional& updated_document) { + if (!IsActiveTarget(target_id)) { + return; + } + + TargetState& target_state = EnsureTargetState(target_id); + if (TargetContainsDocument(target_id, key)) { + target_state.AddDocumentChange(key, DocumentViewChange::Type::Removed); + } else { + // The document may have entered and left the target before we raised a + // snapshot, so we can just ignore the change. + target_state.RemoveDocumentChange(key); + } + pending_document_target_mappings_[key].insert(target_id); + + if (updated_document) { + pending_document_updates_[key] = *updated_document; + } +} + +void WatchChangeAggregator::RemoveTarget(TargetId target_id) { + target_states_.erase(target_id); +} + +int WatchChangeAggregator::GetCurrentDocumentCountForTarget( + TargetId target_id) { + TargetState& target_state = EnsureTargetState(target_id); + TargetChange target_change = target_state.ToTargetChange(); + return target_metadata_provider_->GetRemoteKeysForTarget(target_id).size() + + target_change.added_documents().size() - + target_change.removed_documents().size(); +} + +void WatchChangeAggregator::RecordPendingTargetRequest(TargetId target_id) { + // For each request we get we need to record we need a response for it. + TargetState& target_state = EnsureTargetState(target_id); + target_state.RecordPendingTargetRequest(); +} + +TargetState& WatchChangeAggregator::EnsureTargetState(TargetId target_id) { + return target_states_[target_id]; +} + +bool WatchChangeAggregator::IsActiveTarget(TargetId target_id) const { + return TargetDataForActiveTarget(target_id) != absl::nullopt; +} + +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_->GetTargetDataForTarget(target_id); +} + +void WatchChangeAggregator::ResetTarget(TargetId target_id) { + auto current_target_state = target_states_.find(target_id); + HARD_ASSERT(current_target_state != target_states_.end() && + !(current_target_state->second.IsPending()), + "Should only reset active targets"); + + target_states_[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 existing_keys = + target_metadata_provider_->GetRemoteKeysForTarget(target_id); + + for (const DocumentKey& key : existing_keys) { + RemoveDocumentFromTarget(target_id, key, absl::nullopt); + } +} + +bool WatchChangeAggregator::TargetContainsDocument(TargetId target_id, + const DocumentKey& key) { + const DocumentKeySet& existing_keys = + target_metadata_provider_->GetRemoteKeysForTarget(target_id); + return existing_keys.contains(key); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h new file mode 100644 index 0000000..ef7943c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h @@ -0,0 +1,437 @@ +/* + * 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_REMOTE_EVENT_H_ +#define FIRESTORE_CORE_SRC_REMOTE_REMOTE_EVENT_H_ + +#include +#include +#include +#include +#include + +#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/mutable_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 { + +/** + * Interface implemented by `RemoteStore` to expose target metadata to the + * `WatchChangeAggregator`. + */ +class TargetMetadataProvider { + public: + virtual ~TargetMetadataProvider() = default; + + /** + * Returns the set of remote document keys for the given target ID as of the + * last raised snapshot. + */ + virtual model::DocumentKeySet GetRemoteKeysForTarget( + model::TargetId target_id) const = 0; + + /** + * Returns the TargetData for an active target ID or `nullopt` if this query + * has become inactive. + */ + virtual absl::optional GetTargetDataForTarget( + model::TargetId target_id) const = 0; +}; + +/** + * A `TargetChange` specifies the set of changes for a specific target as part + * of an `RemoteEvent`. These changes track which documents are added, + * modified or removed, as well as the target's resume token and whether the + * target is marked CURRENT. + * + * The actual changes *to* documents are not part of the `TargetChange` since + * documents may be part of multiple targets. + */ +class TargetChange { + public: + static TargetChange CreateSynthesizedTargetChange(bool current) { + return TargetChange(current); + } + + TargetChange() = default; + + TargetChange(nanopb::ByteString resume_token, + bool current, + model::DocumentKeySet added_documents, + model::DocumentKeySet modified_documents, + model::DocumentKeySet removed_documents) + : resume_token_{std::move(resume_token)}, + current_{current}, + added_documents_{std::move(added_documents)}, + modified_documents_{std::move(modified_documents)}, + removed_documents_{std::move(removed_documents)} { + } + + /** + * 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_; + } + + /** + * The "current" (synced) status of this target. Note that "current" has + * special meaning in the RPC protocol that implies that a target is both + * up-to-date and consistent with the rest of the watch stream. + */ + bool current() const { + return current_; + } + + /** + * The set of documents that were newly assigned to this target as part of + * this remote event. + */ + const model::DocumentKeySet& added_documents() const { + return added_documents_; + } + + /** + * The set of documents that were already assigned to this target but received + * an update during this remote event. + */ + const model::DocumentKeySet& modified_documents() const { + return modified_documents_; + } + + /** + * The set of documents that were removed from this target as part of this + * remote event. + */ + const model::DocumentKeySet& removed_documents() const { + return removed_documents_; + } + + private: + explicit TargetChange(bool current) : current_{current} { + } + + nanopb::ByteString resume_token_; + bool current_ = false; + model::DocumentKeySet added_documents_; + model::DocumentKeySet modified_documents_; + model::DocumentKeySet removed_documents_; +}; + +bool operator==(const TargetChange& lhs, const TargetChange& rhs); + +/** Tracks the internal state of a Watch target. */ +class TargetState { + public: + /** + * Whether this target has been marked 'current'. + * + * 'current' has special meaning in the RPC protocol: It implies that the + * Watch backend has sent us all changes up to the point at which the target + * was added and that the target is consistent with the rest of the watch + * stream. + */ + bool current() const { + return current_; + } + + /** The last resume token sent to us for this target. */ + const nanopb::ByteString& resume_token() const { + return resume_token_; + } + + /** Whether this target has pending target adds or target removes. */ + bool IsPending() const { + return outstanding_responses_ != 0; + } + + /** Whether we have modified any state that should trigger a snapshot. */ + bool HasPendingChanges() const { + return has_pending_changes_; + } + + /** + * Applies the resume token to the `TargetChange`, but only when it has a new + * value. Empty resume tokens are discarded. + */ + void UpdateResumeToken(nanopb::ByteString resume_token); + + /** + * Creates a target change from the current set of changes. + * + * To reset the document changes after raising this snapshot, call + * `ClearPendingChanges()`. + */ + TargetChange ToTargetChange() const; + + /** Resets the document changes and sets `HasPendingChanges` to false. */ + void ClearPendingChanges(); + + void AddDocumentChange(const model::DocumentKey& document_key, + core::DocumentViewChange::Type type); + void RemoveDocumentChange(const model::DocumentKey& document_key); + void RecordPendingTargetRequest(); + void RecordTargetResponse(); + void MarkCurrent(); + + private: + /** + * The number of outstanding responses (adds or removes) that we are waiting + * on. We only consider targets active that have no outstanding responses. + */ + int outstanding_responses_ = 0; + + /** + * Keeps track of the document changes since the last raised snapshot. + * + * These changes are continuously updated as we receive document updates and + * always reflect the current set of changes against the last issued snapshot. + */ + std::unordered_map + document_changes_; + + nanopb::ByteString resume_token_; + + bool current_ = false; + + /** + * Whether this target state should be included in the next snapshot. We + * initialize to true so that newly-added targets are included in the next + * RemoteEvent. + */ + bool has_pending_changes_ = true; +}; + +/** + * An event from the RemoteStore. It is split into `TargetChanges` (changes to + * the state or the set of documents in our watched targets) and + * `DocumentUpdates` (changes to the actual documents). + */ +class RemoteEvent { + public: + using TargetChangeMap = std::unordered_map; + using TargetSet = std::unordered_set; + + RemoteEvent(model::SnapshotVersion snapshot_version, + TargetChangeMap target_changes, + TargetSet target_mismatches, + model::DocumentUpdateMap document_updates, + model::DocumentKeySet limbo_document_changes) + : snapshot_version_{snapshot_version}, + target_changes_{std::move(target_changes)}, + target_mismatches_{std::move(target_mismatches)}, + document_updates_{std::move(document_updates)}, + limbo_document_changes_{std::move(limbo_document_changes)} { + } + + /** The snapshot version this event brings us up to. */ + const model::SnapshotVersion& snapshot_version() const { + return snapshot_version_; + } + + /** A map from target to changes to the target. See `TargetChange`. */ + const TargetChangeMap& target_changes() const { + return target_changes_; + } + + /** + * A set of targets that is known to be inconsistent. Listens for these + * targets should be re-established without resume tokens. + */ + const TargetSet& target_mismatches() const { + return target_mismatches_; + } + + /** + * A set of which documents have changed or been deleted, along with the doc's + * new values (if not deleted). + */ + const model::DocumentUpdateMap& document_updates() const { + return document_updates_; + } + + /** + * A set of which document updates are due only to limbo resolution targets. + */ + const model::DocumentKeySet& limbo_document_changes() const { + return limbo_document_changes_; + } + + private: + model::SnapshotVersion snapshot_version_; + TargetChangeMap target_changes_; + TargetSet target_mismatches_; + model::DocumentUpdateMap document_updates_; + model::DocumentKeySet limbo_document_changes_; +}; + +/** + * A helper class to accumulate watch changes into a `RemoteEvent` and other + * target information. + */ +class WatchChangeAggregator { + public: + explicit WatchChangeAggregator( + TargetMetadataProvider* target_metadata_provider); + + /** + * Processes and adds the `DocumentWatchChange` to the current set of changes. + */ + void HandleDocumentChange(const DocumentWatchChange& document_change); + + /** + * Processes and adds the `WatchTargetChange` to the current set of changes. + */ + void HandleTargetChange(const WatchTargetChange& target_change); + + /** + * Handles existence filters and synthesizes deletes for filter mismatches. + * Targets that are invalidated by filter mismatches are added to + * `pending_target_resets_`. + */ + void HandleExistenceFilter( + const ExistenceFilterWatchChange& existence_filter); + + /** + * Converts the current state into a remote event with the snapshot version + * taken from the initializer. Resets the accumulated changes before + * returning. + */ + RemoteEvent CreateRemoteEvent(const model::SnapshotVersion& snapshot_version); + + /** Removes the in-memory state for the provided target. */ + void RemoveTarget(model::TargetId target_id); + + /** + * Increment the number of acks needed from watch before we can consider the + * server to be 'in-sync' with the client's active targets. + */ + void RecordPendingTargetRequest(model::TargetId target_id); + + 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 + * currently active targets. + */ + std::vector GetTargetIds( + const WatchTargetChange& target_change) const; + + /** + * Adds the provided document to the internal list of document updates and its + * document key to the given target's mapping. + */ + void AddDocumentToTarget(model::TargetId target_id, + const model::MutableDocument& document); + + /** + * Removes the provided document from the target mapping. If the document no + * longer matches the target, but the document's state is still known (e.g. we + * know that the document was deleted or we received the change that caused + * the filter mismatch), the new document can be provided to update the remote + * document cache. + */ + void RemoveDocumentFromTarget( + model::TargetId target_id, + const model::DocumentKey& key, + const absl::optional& updated_document); + + /** + * Returns the current count of documents in the target. This includes both + * the number of documents that the LocalStore considers to be part of the + * target as well as any accumulated changes. + */ + int GetCurrentDocumentCountForTarget(model::TargetId target_id); + + // PORTING NOTE: this method exists only for consistency with other platforms; + // in C++, it's pretty much unnecessary. + TargetState& EnsureTargetState(model::TargetId target_id); + + /** + * Returns true if the given `target_id` is active. Active targets are those + * for which there are no pending requests to add a listen and are in the + * current list of targets the client cares about. + * + * Clients can repeatedly listen and stop listening to targets, so this check + * is useful in preventing race conditions for a target where events arrive + * but the server hasn't yet acknowledged the intended change in state. + */ + bool IsActiveTarget(model::TargetId target_id) const; + + /** + * 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 TargetDataForActiveTarget( + model::TargetId target_id) const; + + /** + * Resets the state of a Watch target to its initial state (e.g. sets + * 'current' to false, clears the resume token and removes its target mapping + * from all documents). + */ + void ResetTarget(model::TargetId target_id); + + /** Returns whether the local store considers the document to be part of the + * specified target. */ + bool TargetContainsDocument(model::TargetId target_id, + const model::DocumentKey& key); + + /** The internal state of all tracked targets. */ + std::unordered_map target_states_; + + /** Keeps track of the documents to update since the last raised snapshot. */ + model::DocumentUpdateMap pending_document_updates_; + + /** A mapping of document keys to their set of target IDs. */ + std::unordered_map, + model::DocumentKeyHash> + pending_document_target_mappings_; + + /** + * A list of targets with existence filter mismatches. These targets are known + * to be inconsistent and their listens needs to be re-established by + * `RemoteStore`. + */ + RemoteEvent::TargetSet pending_target_resets_; + + TargetMetadataProvider* target_metadata_provider_ = nullptr; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_REMOTE_EVENT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc new file mode 100644 index 0000000..1ceba45 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc @@ -0,0 +1,269 @@ +/* + * 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.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/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::Document; +using model::DocumentKey; +using model::Mutation; +using model::MutationResult; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; +using nanopb::MakeArray; +using nanopb::Message; +using nanopb::Reader; +using remote::ByteBufferReader; +using remote::Serializer; +using util::StatusOr; + +// 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, + google_firestore_v1_ListenResponse& response) const { + return serializer_.DecodeWatchChange(reader->context(), response); +} + +SnapshotVersion WatchStreamSerializer::DecodeSnapshotVersion( + nanopb::Reader* reader, + const google_firestore_v1_ListenResponse& response) const { + return serializer_.DecodeVersionFromListenResponse(reader->context(), + 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->context(), proto.commit_time); +} + +std::vector WriteStreamSerializer::DecodeMutationResults( + nanopb::Reader* reader, google_firestore_v1_WriteResponse& proto) const { + SnapshotVersion commit_version = DecodeCommitVersion(reader, proto); + if (!reader->ok()) { + return {}; + } + + 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->context(), 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); + + Document doc = serializer_.DecodeMaybeDocument(reader.context(), *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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h new file mode 100644 index 0000000..7d07480 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h @@ -0,0 +1,148 @@ +/* + * 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 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; + /** + * Decodes the listen response. Modifies the provided proto to release + * ownership of any Value messages. + */ + std::unique_ptr DecodeWatchChange( + nanopb::Reader* reader, + 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; + /** + * Decodes the write response. Modifies the provided proto to release + * ownership of any Value messages. + */ + std::vector DecodeMutationResults( + nanopb::Reader* reader, 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.cc new file mode 100644 index 0000000..53207c2 --- /dev/null +++ b/SaraAttended/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(std::move(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_); +} + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h new file mode 100644 index 0000000..56d5b2c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h @@ -0,0 +1,313 @@ +/* + * 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_REMOTE_REMOTE_STORE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_REMOTE_STORE_H_ + +#include +#include +#include + +#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 + * visible because of the snapshot version the remote event contains. + */ + virtual void ApplyRemoteEvent(const RemoteEvent& remote_event) = 0; + + /** + * Handles rejection of listen for the given target id. This can be triggered + * by the backend for any active target. + * + * @param target_id The target ID corresponding to a listen initiated via + * RemoteStore::Listen() + * @param error A description of the condition that has forced the rejection. + * Nearly always this will be an indication that the user is no longer + * authorized to see the data matching the target. + */ + virtual void HandleRejectedListen(model::TargetId target_id, + util::Status error) = 0; + + /** + * Applies the result of a successful write of a mutation batch to the sync + * engine, emitting snapshots in any views that the mutation applies to, and + * removing the batch from the mutation queue. + */ + virtual void HandleSuccessfulWrite( + model::MutationBatchResult batch_result) = 0; + + /** + * Rejects the batch, removing the batch from the mutation queue, recomputing + * the local view of any documents affected by the batch and then, emitting + * snapshots with the reverted value. + */ + virtual void HandleRejectedWrite(model::BatchId batch_id, + util::Status error) = 0; + + /** + * Applies an OnlineState change to the sync engine and notifies any views of + * the change. + */ + virtual void HandleOnlineStateChange(model::OnlineState online_state) = 0; + + /** + * Returns the set of remote document keys for the given target ID. This list + * includes the documents that were assigned to the target when we received + * the last snapshot. + */ + virtual model::DocumentKeySet GetRemoteKeys( + model::TargetId target_id) const = 0; +}; + +class RemoteStore : public TargetMetadataProvider, + public WatchStreamCallback, + public WriteStreamCallback { + public: + 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) { + sync_engine_ = sync_engine; + } + + /** + * Starts up the remote store, creating streams, restoring state from + * `LocalStore`, etc. + */ + void Start(); + + /** + * Shuts down the remote store, tearing down connections and otherwise + * cleaning up. + */ + void Shutdown(); + + /** + * Temporarily disables the network. The network can be re-enabled using + * 'EnableNetwork'. + */ + void DisableNetwork(); + + /** + * Re-enables the network. Only to be called as the counterpart to + * 'DisableNetwork'. + */ + void EnableNetwork(); + + bool CanUseNetwork() const; + + /** + * Tells the `RemoteStore` that the currently authenticated user has changed. + * + * In response the remote store tears down streams and clears up any tracked + * operations that should not persist across users. Restarts the streams if + * appropriate. + */ + void HandleCredentialChange(); + + /** + * 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. + * + * It is an error if the given target id is not being listened to. + */ + void StopListening(model::TargetId target_id); + + /** + * Attempts to fill our write pipeline with writes from the `LocalStore`. + * + * Called internally to bootstrap or refill the write pipeline and by + * `SyncEngine` whenever there are new mutations to process. + * + * Starts the write stream if necessary. + */ + void FillWritePipeline(); + + /** + * Queues additional writes to be sent to the write stream, sending them + * immediately if the write stream is established. + */ + void AddToWritePipeline(const model::MutationBatch& batch); + + /** Returns a new transaction backed by this remote store. */ + // TODO(c++14): return a plain value when it becomes possible to move + // `Transaction` into lambdas. + std::shared_ptr CreateTransaction(); + + model::DocumentKeySet GetRemoteKeysForTarget( + model::TargetId target_id) const override; + absl::optional GetTargetDataForTarget( + model::TargetId target_id) const override; + + void OnWatchStreamOpen() override; + void OnWatchStreamChange( + const WatchChange& change, + const model::SnapshotVersion& snapshot_version) override; + void OnWatchStreamClose(const util::Status& status) override; + + void OnWriteStreamOpen() override; + void OnWriteStreamHandshakeComplete() override; + void OnWriteStreamClose(const util::Status& status) override; + void OnWriteStreamMutationResult( + model::SnapshotVersion commit_version, + std::vector mutation_results) override; + + private: + void RestartNetwork(); + void DisableNetworkInternal(); + + void SendWatchRequest(const local::TargetData& target_data); + void SendUnwatchRequest(model::TargetId target_id); + + /** + * Takes a batch of changes from the `Datastore`, repackages them as a + * `RemoteEvent`, and passes that on to the `SyncEngine`. + */ + void RaiseWatchSnapshot(const model::SnapshotVersion& snapshot_version); + + /** Process a target error and passes the error along to `SyncEngine`. */ + void ProcessTargetError(const WatchTargetChange& change); + + /** + * Returns true if we can add to the write pipeline (i.e. it is not full and + * the network is enabled). + */ + bool CanAddToWritePipeline() const; + + void StartWriteStream(); + + /** + * Returns true if the network is enabled, the write stream has not yet been + * started and there are pending writes. + */ + bool ShouldStartWriteStream() const; + + void HandleHandshakeError(const util::Status& status); + void HandleWriteError(const util::Status& status); + + void StartWatchStream(); + + /** + * Returns true if the network is enabled, the watch stream has not yet been + * started and there are active watch targets. + */ + bool ShouldStartWatchStream() const; + + void CleanUpWatchStreamState(); + + RemoteStoreCallback* sync_engine_ = nullptr; + + /** + * The local store, used to fill the write pipeline with outbound mutations + * and resolve existence filter mismatches. + */ + local::LocalStore* local_store_ = nullptr; + + /** The client-side proxy for interacting with the backend. */ + std::shared_ptr datastore_; + + /** + * A mapping of watched targets that the client cares about tracking and the + * user has explicitly called a 'listen' for this target. + * + * These targets may or may not have been sent to or acknowledged by the + * server. On re-establishing the listen stream, these targets should be sent + * to the server. The targets removed with unlistens are removed eagerly + * without waiting for confirmation from the listen stream. + */ + 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. + */ + bool is_network_enabled_ = false; + + std::shared_ptr watch_stream_; + std::shared_ptr write_stream_; + std::unique_ptr watch_change_aggregator_; + + /** + * A list of up to `kMaxPendingWrites` writes that we have fetched from the + * `LocalStore` via `FillWritePipeline` and have or will send to the write + * stream. + * + * Whenever `write_pipeline_` is not empty, the `RemoteStore` will attempt to + * start or restart the write stream. When the stream is established, the + * writes in the pipeline will be sent in order. + * + * Writes remain in `write_pipeline_` until they are acknowledged by the + * backend and thus will automatically be re-sent if the stream is interrupted + * / restarted before they're acknowledged. + * + * Write responses from the backend are linked to their originating request + * purely based on order, and so we can just remove writes from the front of + * the `write_pipeline_` as we receive responses. + */ + std::vector write_pipeline_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_REMOTE_STORE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc new file mode 100644 index 0000000..a232c05 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc @@ -0,0 +1,1401 @@ +/* + * 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/serializer.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#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/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/field_path.h" +#include "Firestore/core/src/model/mutable_document.h" +#include "Firestore/core/src/model/patch_mutation.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/server_timestamp_util.h" +#include "Firestore/core/src/model/set_mutation.h" +#include "Firestore/core/src/model/value_util.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/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/algorithm/container.h" +#include "absl/types/span.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using core::Bound; +using core::CollectionGroupId; +using core::Direction; +using core::FieldFilter; +using core::Filter; +using core::FilterList; +using core::OrderBy; +using core::OrderByList; +using core::Query; +using core::Target; +using local::QueryPurpose; +using local::TargetData; +using model::ArrayTransform; +using model::DatabaseId; +using model::DeepClone; +using model::DeleteMutation; +using model::DocumentKey; +using model::EncodeServerTimestamp; +using model::FieldMask; +using model::FieldPath; +using model::FieldTransform; +using model::IsNaNValue; +using model::IsNullValue; +using model::MutableDocument; +using model::Mutation; +using model::MutationResult; +using model::NaNValue; +using model::NullValue; +using model::NumericIncrementTransform; +using model::ObjectValue; +using model::PatchMutation; +using model::Precondition; +using model::ResourcePath; +using model::ServerTimestampTransform; +using model::SetMutation; +using model::SnapshotVersion; +using model::TargetId; +using model::TransformOperation; +using model::VerifyMutation; +using nanopb::ByteString; +using nanopb::CheckedSize; +using nanopb::MakeArray; +using nanopb::MakeMessage; +using nanopb::MakeSharedMessage; +using nanopb::MakeStringView; +using nanopb::Message; +using nanopb::ReleaseFieldOwnership; +using nanopb::SafeReadBoolean; +using nanopb::SetRepeatedField; +using nanopb::SharedMessage; +using nanopb::Writer; +using remote::WatchChange; +using util::ReadContext; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +pb_bytes_array_t* Serializer::EncodeString(const std::string& str) { + return nanopb::MakeBytesArray(str); +} + +std::string Serializer::DecodeString(const pb_bytes_array_t* str) { + return nanopb::MakeString(str); +} + +namespace { + +/** + * Creates the prefix for a fully qualified resource path, without a local path + * on the end. + */ +ResourcePath DatabaseName(const DatabaseId& database_id) { + return ResourcePath{"projects", database_id.project_id(), "databases", + database_id.database_id()}; +} + +/** + * Validates that a path has a prefix that looks like a valid encoded + * database ID. + */ +bool IsValidResourceName(const ResourcePath& path) { + // Resource names have at least 4 components (project ID, database ID) + // and commonly the (root) resource type, e.g. documents + 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 along with a local + * path. + */ +ResourcePath ExtractLocalPathFromResourceName( + ReadContext* context, const ResourcePath& resource_name) { + if (resource_name.size() <= 4 || resource_name[4] != "documents") { + context->Fail(StringFormat("Tried to deserialize invalid key %s", + resource_name.CanonicalString())); + return ResourcePath{}; + } + return resource_name.PopFirst(5); +} + +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. + return FieldFilter::Create({}, {}, + MakeSharedMessage(google_firestore_v1_Value{})); +} + +FieldPath InvalidFieldPath() { + return FieldPath::EmptyPath(); +} + +} // namespace + +Serializer::Serializer(DatabaseId database_id) + : database_id_(std::move(database_id)) { +} + +pb_bytes_array_t* Serializer::EncodeDatabaseName() const { + return EncodeString(DatabaseName(database_id_).CanonicalString()); +} + +pb_bytes_array_t* Serializer::EncodeKey(const DocumentKey& key) const { + return EncodeResourceName(database_id_, key.path()); +} + +void Serializer::ValidateDocumentKeyPath( + ReadContext* context, const ResourcePath& resource_name) const { + if (resource_name.size() < 5) { + context->Fail( + StringFormat("Attempted to decode invalid key: '%s'. Should have at " + "least 5 segments.", + resource_name.CanonicalString())); + } else if (resource_name[1] != database_id_.project_id()) { + context->Fail( + StringFormat("Tried to deserialize key from different project. " + "Expected: '%s'. Found: '%s'. (Full key: '%s')", + database_id_.project_id(), resource_name[1], + resource_name.CanonicalString())); + } else if (resource_name[3] != database_id_.database_id()) { + context->Fail( + StringFormat("Tried to deserialize key from different database. " + "Expected: '%s'. Found: '%s'. (Full key: '%s')", + database_id_.database_id(), resource_name[3], + resource_name.CanonicalString())); + } +} + +DocumentKey Serializer::DecodeKey(ReadContext* context, + const pb_bytes_array_t* name) const { + ResourcePath resource_name = + DecodeResourceName(context, MakeStringView(name)); + ValidateDocumentKeyPath(context, resource_name); + + return DecodeKey(context, resource_name); +} + +DocumentKey Serializer::DecodeKey(ReadContext* context, + const ResourcePath& resource_name) const { + ResourcePath local_path = + ExtractLocalPathFromResourceName(context, resource_name); + + if (!DocumentKey::IsDocumentKey(local_path)) { + context->Fail(StringFormat("Invalid document key path: %s", + local_path.CanonicalString())); + } + + // Avoid assertion failures in DocumentKey if local_path is invalid. + if (!context->status().ok()) return DocumentKey{}; + return DocumentKey{std::move(local_path)}; +} + +pb_bytes_array_t* Serializer::EncodeQueryPath(const ResourcePath& path) const { + return EncodeResourceName(database_id_, path); +} + +ResourcePath Serializer::DecodeQueryPath(ReadContext* context, + absl::string_view name) const { + ResourcePath resource = DecodeResourceName(context, 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(context, 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(ReadContext* context, + absl::string_view encoded) const { + auto resource = ResourcePath::FromStringView(encoded); + if (!IsValidResourceName(resource)) { + context->Fail(StringFormat("Tried to deserialize an invalid key: %s", + resource.CanonicalString())); + } + return resource; +} + +google_firestore_v1_Document Serializer::EncodeDocument( + const DocumentKey& key, const ObjectValue& object_value) const { + google_firestore_v1_Document result{}; + + result.name = EncodeKey(key); + + // Encode Document.fields (unless it's empty) + const google_firestore_v1_MapValue& map_value = object_value.Get().map_value; + SetRepeatedField( + &result.fields, &result.fields_count, + absl::Span( + map_value.fields, map_value.fields_count), + [](const google_firestore_v1_MapValue_FieldsEntry& entry) { + // TODO(mrschmidt): Figure out how to remove this copy + return google_firestore_v1_Document_FieldsEntry{ + nanopb::MakeBytesArray(entry.key->bytes, entry.key->size), + *DeepClone(entry.value).release()}; + }); + + // Skip Document.create_time and Document.update_time, since they're + // output-only fields. + + return result; +} + +MutableDocument Serializer::DecodeMaybeDocument( + ReadContext* context, + google_firestore_v1_BatchGetDocumentsResponse& response) const { + switch (response.which_result) { + case google_firestore_v1_BatchGetDocumentsResponse_found_tag: + return DecodeFoundDocument(context, response); + case google_firestore_v1_BatchGetDocumentsResponse_missing_tag: + return DecodeMissingDocument(context, response); + default: + context->Fail( + StringFormat("Unknown result case: %s", response.which_result)); + return MutableDocument::InvalidDocument({}); + } + + UNREACHABLE(); +} + +MutableDocument Serializer::DecodeFoundDocument( + ReadContext* context, + google_firestore_v1_BatchGetDocumentsResponse& response) const { + HARD_ASSERT(response.which_result == + google_firestore_v1_BatchGetDocumentsResponse_found_tag, + "Tried to deserialize a found document from a missing document."); + + DocumentKey key = DecodeKey(context, response.found.name); + ObjectValue value = ObjectValue::FromFieldsEntry(response.found.fields, + response.found.fields_count); + SnapshotVersion version = DecodeVersion(context, response.found.update_time); + + if (version == SnapshotVersion::None()) { + context->Fail("Got a document response with no snapshot version"); + } + + return MutableDocument::FoundDocument(std::move(key), version, + std::move(value)); +} + +MutableDocument Serializer::DecodeMissingDocument( + ReadContext* context, + const google_firestore_v1_BatchGetDocumentsResponse& response) const { + HARD_ASSERT(response.which_result == + google_firestore_v1_BatchGetDocumentsResponse_missing_tag, + "Tried to deserialize a missing document from a found document."); + + DocumentKey key = DecodeKey(context, response.missing); + SnapshotVersion version = DecodeVersion(context, response.read_time); + + if (version == SnapshotVersion::None()) { + context->Fail("Got a no document response with no snapshot version"); + } + + return MutableDocument::NoDocument(std::move(key), version); +} + +google_firestore_v1_Write Serializer::EncodeMutation( + const Mutation& mutation) const { + HARD_ASSERT(mutation.is_valid(), "Invalid mutation encountered."); + google_firestore_v1_Write result{}; + + if (!mutation.precondition().is_none()) { + result.has_current_document = true; + result.current_document = EncodePrecondition(mutation.precondition()); + } + + SetRepeatedField(&result.update_transforms, &result.update_transforms_count, + mutation.field_transforms(), [&](const FieldTransform& t) { + return EncodeFieldTransform(t); + }); + + switch (mutation.type()) { + case Mutation::Type::Set: { + result.which_operation = google_firestore_v1_Write_update_tag; + result.update = EncodeDocument( + mutation.key(), static_cast(mutation).value()); + return result; + } + + case Mutation::Type::Patch: { + result.which_operation = google_firestore_v1_Write_update_tag; + auto patch_mutation = static_cast(mutation); + result.update = EncodeDocument(mutation.key(), patch_mutation.value()); + // Note: the fact that this field is set (even if the mask is empty) is + // what makes the backend treat this as a patch mutation, not a set + // mutation. + result.has_update_mask = true; + if (patch_mutation.mask().size() != 0) { + result.update_mask = EncodeFieldMask(patch_mutation.mask()); + } + return result; + } + + case Mutation::Type::Delete: { + result.which_operation = google_firestore_v1_Write_delete_tag; + 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(); +} + +Mutation Serializer::DecodeMutation(ReadContext* context, + google_firestore_v1_Write& mutation) const { + auto precondition = Precondition::None(); + if (mutation.has_current_document) { + precondition = DecodePrecondition(context, mutation.current_document); + } + + std::vector field_transforms; + for (size_t i = 0; i < mutation.update_transforms_count; i++) { + field_transforms.push_back( + DecodeFieldTransform(context, mutation.update_transforms[i])); + } + + switch (mutation.which_operation) { + case google_firestore_v1_Write_update_tag: { + DocumentKey key = DecodeKey(context, mutation.update.name); + ObjectValue value = ObjectValue::FromFieldsEntry( + mutation.update.fields, mutation.update.fields_count); + if (mutation.has_update_mask) { + FieldMask mask = DecodeFieldMask(context, mutation.update_mask); + return PatchMutation(std::move(key), std::move(value), std::move(mask), + std::move(precondition), + std::move(field_transforms)); + } else { + return SetMutation(std::move(key), std::move(value), + std::move(precondition), + std::move(field_transforms)); + } + } + + case google_firestore_v1_Write_delete_tag: + return DeleteMutation(DecodeKey(context, mutation.delete_), + std::move(precondition)); + + case google_firestore_v1_Write_verify_tag: { + return VerifyMutation(DecodeKey(context, mutation.verify), + std::move(precondition)); + } + + default: + context->Fail(StringFormat("Unknown mutation operation: %s", + mutation.which_operation)); + return {}; + } + + UNREACHABLE(); +} + +/* static */ +google_firestore_v1_Precondition Serializer::EncodePrecondition( + const Precondition& precondition) { + google_firestore_v1_Precondition result{}; + + switch (precondition.type()) { + case Precondition::Type::None: + HARD_FAIL("Can't serialize an empty precondition"); + + case Precondition::Type::UpdateTime: + result.which_condition_type = + google_firestore_v1_Precondition_update_time_tag; + result.update_time = EncodeVersion(precondition.update_time()); + return result; + + case Precondition::Type::Exists: + result.which_condition_type = google_firestore_v1_Precondition_exists_tag; + result.exists = precondition.exists(); + return result; + } + + UNREACHABLE(); +} + +/* static */ +Precondition Serializer::DecodePrecondition( + ReadContext* context, + const google_firestore_v1_Precondition& precondition) { + switch (precondition.which_condition_type) { + // 0 => type unset. nanopb doesn't provide a constant for this, so we use a + // raw integer. + case 0: + return Precondition::None(); + case google_firestore_v1_Precondition_exists_tag: { + // TODO(rsgowman): Refactor with other instance of bit_cast. + + // Due to the nanopb implementation, precondition.exists 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(precondition.exists); + return Precondition::Exists(bool_as_int != 0); + } + case google_firestore_v1_Precondition_update_time_tag: + return Precondition::UpdateTime( + DecodeVersion(context, precondition.update_time)); + } + + context->Fail(StringFormat("Unknown Precondition type: %s", + precondition.which_condition_type)); + return Precondition::None(); +} + +/* static */ +google_firestore_v1_DocumentMask Serializer::EncodeFieldMask( + const FieldMask& mask) { + google_firestore_v1_DocumentMask result{}; + SetRepeatedField( + &result.field_paths, &result.field_paths_count, mask, + [&](const FieldPath& path) { return EncodeFieldPath(path); }); + return result; +} + +/* static */ +FieldMask Serializer::DecodeFieldMask( + ReadContext* context, const google_firestore_v1_DocumentMask& mask) { + std::set fields; + for (size_t i = 0; i < mask.field_paths_count; i++) { + fields.insert(DecodeFieldPath(context, mask.field_paths[i])); + } + return FieldMask(std::move(fields)); +} + +google_firestore_v1_DocumentTransform_FieldTransform +Serializer::EncodeFieldTransform(const FieldTransform& field_transform) const { + using Type = TransformOperation::Type; + + google_firestore_v1_DocumentTransform_FieldTransform proto{}; + proto.field_path = EncodeFieldPath(field_transform.path()); + + switch (field_transform.transformation().type()) { + case Type::ServerTimestamp: + proto.which_transform_type = + google_firestore_v1_DocumentTransform_FieldTransform_set_to_server_value_tag; // NOLINT + proto.set_to_server_value = + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME; // NOLINT + return proto; + + case Type::ArrayUnion: + proto.which_transform_type = + google_firestore_v1_DocumentTransform_FieldTransform_append_missing_elements_tag; // NOLINT + // TODO(mrschmidt): Figure out how to remove this copy + proto.append_missing_elements = + *DeepClone( + ArrayTransform(field_transform.transformation()).elements()) + .release(); + return proto; + + case Type::ArrayRemove: + proto.which_transform_type = + google_firestore_v1_DocumentTransform_FieldTransform_remove_all_from_array_tag; // NOLINT + // TODO(mrschmidt): Figure out how to remove this copy + proto.remove_all_from_array = + *DeepClone( + ArrayTransform(field_transform.transformation()).elements()) + .release(); + return proto; + + case Type::Increment: { + proto.which_transform_type = + google_firestore_v1_DocumentTransform_FieldTransform_increment_tag; + const auto& increment = static_cast( + field_transform.transformation()); + proto.increment = increment.operand(); + return proto; + } + } + + UNREACHABLE(); +} + +FieldTransform Serializer::DecodeFieldTransform( + ReadContext* context, + google_firestore_v1_DocumentTransform_FieldTransform& proto) const { + FieldPath field = DecodeFieldPath(context, proto.field_path); + + switch (proto.which_transform_type) { + case google_firestore_v1_DocumentTransform_FieldTransform_set_to_server_value_tag: { // NOLINT + HARD_ASSERT( + proto.set_to_server_value == + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME, // NOLINT + "Unknown transform setToServerValue: %s", proto.set_to_server_value); + + return FieldTransform(std::move(field), ServerTimestampTransform()); + } + + case google_firestore_v1_DocumentTransform_FieldTransform_append_missing_elements_tag: { // NOLINT + FieldTransform field_transform( + std::move(field), + ArrayTransform(TransformOperation::Type::ArrayUnion, + MakeMessage(proto.append_missing_elements))); + // Release field ownership to prevent double-freeing. The values are now + // owned by the FieldTransform. + proto.append_missing_elements = {}; + return field_transform; + } + + case google_firestore_v1_DocumentTransform_FieldTransform_remove_all_from_array_tag: { // NOLINT + FieldTransform field_transform( + std::move(field), + ArrayTransform(TransformOperation::Type::ArrayRemove, + MakeMessage(proto.remove_all_from_array))); + // Release field ownership to prevent double-freeing. The values are now + // owned by the FieldTransform. + proto.append_missing_elements = {}; + return field_transform; + } + + case google_firestore_v1_DocumentTransform_FieldTransform_increment_tag: { + return FieldTransform( + std::move(field), + NumericIncrementTransform(MakeMessage(proto.increment))); + } + } + + UNREACHABLE(); +} + +google_firestore_v1_Target Serializer::EncodeTarget( + const TargetData& target_data) const { + google_firestore_v1_Target result{}; + const Target& target = target_data.target(); + + if (target.IsDocumentQuery()) { + result.which_target_type = google_firestore_v1_Target_documents_tag; + result.target_type.documents = EncodeDocumentsTarget(target); + } else { + result.which_target_type = google_firestore_v1_Target_query_tag; + result.target_type.query = EncodeQueryTarget(target); + } + + 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(target_data.resume_token().get()); + } + + return result; +} + +google_firestore_v1_Target_DocumentsTarget Serializer::EncodeDocumentsTarget( + 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(target.path()); + + return result; +} + +Target Serializer::DecodeDocumentsTarget( + ReadContext* context, + const google_firestore_v1_Target_DocumentsTarget& proto) const { + if (proto.documents_count != 1) { + context->Fail( + StringFormat("DocumentsTarget contained other than 1 document %s", + proto.documents_count)); + return {}; + } + + ResourcePath path = + DecodeQueryPath(context, DecodeString(proto.documents[0])); + return Query(std::move(path)).ToTarget(); +} + +google_firestore_v1_Target_QueryTarget Serializer::EncodeQueryTarget( + const core::Target& target) const { + google_firestore_v1_Target_QueryTarget result{}; + result.which_query_type = + google_firestore_v1_Target_QueryTarget_structured_query_tag; + + pb_size_t from_count = 1; + result.structured_query.from_count = from_count; + result.structured_query.from = + MakeArray( + from_count); + google_firestore_v1_StructuredQuery_CollectionSelector& from = + result.structured_query.from[0]; + + // Dissect the path into parent, collection_id and optional key filter. + 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(*target.collection_group()); + from.all_descendants = true; + + } else { + HARD_ASSERT(path.size() % 2 != 0, + "Document queries with filters are not supported."); + result.parent = EncodeQueryPath(path.PopLast()); + from.collection_id = EncodeString(path.last_segment()); + } + + // Encode the filters. + const auto& filters = target.filters(); + if (!filters.empty()) { + result.structured_query.where = EncodeFilters(filters); + } + + 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 (target.limit() != Target::kNoLimit) { + result.structured_query.has_limit = true; + result.structured_query.limit.value = target.limit(); + } + + if (target.start_at()) { + result.structured_query.start_at = EncodeBound(*target.start_at()); + } + + if (target.end_at()) { + result.structured_query.end_at = EncodeBound(*target.end_at()); + } + + return result; +} + +Target Serializer::DecodeStructuredQuery( + ReadContext* context, + pb_bytes_array_t* parent, + google_firestore_v1_StructuredQuery& query) const { + ResourcePath path = DecodeQueryPath(context, DecodeString(parent)); + + CollectionGroupId collection_group; + size_t from_count = query.from_count; + if (from_count > 0) { + if (from_count != 1) { + context->Fail( + "StructuredQuery.from with more than one collection is not " + "supported."); + return {}; + } + + google_firestore_v1_StructuredQuery_CollectionSelector& from = + query.from[0]; + auto collection_id = DecodeString(from.collection_id); + if (from.all_descendants) { + collection_group = std::make_shared(collection_id); + } else { + path = path.Append(collection_id); + } + } + + FilterList filter_by; + if (query.where.which_filter_type != 0) { + filter_by = DecodeFilters(context, query.where); + } + + OrderByList order_by; + if (query.order_by_count > 0) { + order_by = DecodeOrderBys(context, query.order_by, query.order_by_count); + } + + int32_t limit = Target::kNoLimit; + if (query.has_limit) { + limit = query.limit.value; + } + + absl::optional start_at; + if (query.start_at.values_count > 0) { + start_at = DecodeBound(query.start_at); + } + + absl::optional end_at; + if (query.end_at.values_count > 0) { + end_at = DecodeBound(query.end_at); + } + + return Target(std::move(path), std::move(collection_group), + std::move(filter_by), std::move(order_by), limit, + std::move(start_at), std::move(end_at)); +} + +Target Serializer::DecodeQueryTarget( + ReadContext* context, google_firestore_v1_Target_QueryTarget& query) const { + // The QueryTarget oneof only has a single valid value. + if (query.which_query_type != + google_firestore_v1_Target_QueryTarget_structured_query_tag) { + context->Fail( + StringFormat("Unknown query_type: %s", query.which_query_type)); + return {}; + } + + return DecodeStructuredQuery(context, query.parent, query.structured_query); +} + +google_firestore_v1_StructuredQuery_Filter Serializer::EncodeFilters( + const FilterList& filters) const { + google_firestore_v1_StructuredQuery_Filter result{}; + + auto is_field_filter = [](const Filter& f) { return f.IsAFieldFilter(); }; + size_t filters_count = absl::c_count_if(filters, is_field_filter); + if (filters_count == 1) { + auto first = absl::c_find_if(filters, is_field_filter); + // 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. + FieldFilter filter{*first}; + return EncodeSingularFilter(filter); + } + + result.which_filter_type = + google_firestore_v1_StructuredQuery_Filter_composite_filter_tag; + google_firestore_v1_StructuredQuery_CompositeFilter& composite = + result.composite_filter; + composite.op = + google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND; + + SetRepeatedField( + &composite.filters, &composite.filters_count, filters, + [&](const Filter& f) { return EncodeSingularFilter(FieldFilter{f}); }); + + return result; +} + +FilterList Serializer::DecodeFilters( + ReadContext* context, + google_firestore_v1_StructuredQuery_Filter& proto) const { + FilterList result; + + switch (proto.which_filter_type) { + case google_firestore_v1_StructuredQuery_Filter_composite_filter_tag: + return DecodeCompositeFilter(context, proto.composite_filter); + + case google_firestore_v1_StructuredQuery_Filter_unary_filter_tag: + return result.push_back(DecodeUnaryFilter(context, proto.unary_filter)); + + case google_firestore_v1_StructuredQuery_Filter_field_filter_tag: + return result.push_back(DecodeFieldFilter(context, proto.field_filter)); + + default: + context->Fail(StringFormat("Unrecognized Filter.which_filter_type %s", + proto.which_filter_type)); + return result; + } +} + +google_firestore_v1_StructuredQuery_Filter Serializer::EncodeSingularFilter( + const FieldFilter& filter) const { + google_firestore_v1_StructuredQuery_Filter result{}; + + bool is_unary = (filter.op() == Filter::Operator::Equal || + filter.op() == Filter::Operator::NotEqual) && + (IsNaNValue(filter.value()) || IsNullValue(filter.value())); + if (is_unary) { + 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()); + + bool is_equality = filter.op() == Filter::Operator::Equal; + if (IsNaNValue(filter.value())) { + result.unary_filter.op = + is_equality + ? google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN + : google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN; // NOLINT + + } else if (IsNullValue(filter.value())) { + result.unary_filter.op = + is_equality + ? google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL + : google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL; // NOLINT + + } else { + HARD_FAIL("Expected a unary filter"); + } + + return result; + } + + result.which_filter_type = + google_firestore_v1_StructuredQuery_Filter_field_filter_tag; + + result.field_filter.field.field_path = EncodeFieldPath(filter.field()); + result.field_filter.op = EncodeFieldFilterOperator(filter.op()); + // TODO(mrschmidt): Figure out how to remove this copy + result.field_filter.value = *DeepClone(filter.value()).release(); + + return result; +} + +Filter Serializer::DecodeFieldFilter( + ReadContext* context, + google_firestore_v1_StructuredQuery_FieldFilter& field_filter) const { + FieldPath field_path = + DecodeFieldPath(context, field_filter.field.field_path); + Filter::Operator op = DecodeFieldFilterOperator(context, field_filter.op); + Filter result = FieldFilter::Create(std::move(field_path), op, + MakeSharedMessage(field_filter.value)); + field_filter.value = {}; // Release field ownership + return result; +} + +Filter Serializer::DecodeUnaryFilter( + ReadContext* context, + const google_firestore_v1_StructuredQuery_UnaryFilter& unary) const { + HARD_ASSERT(unary.which_operand_type == + google_firestore_v1_StructuredQuery_UnaryFilter_field_tag, + "Unexpected UnaryFilter.which_operand_type: %s", + unary.which_operand_type); + + FieldPath field = DecodeFieldPath(context, unary.field.field_path); + + switch (unary.op) { + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL: + return FieldFilter::Create(field, Filter::Operator::Equal, NullValue()); + + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN: + return FieldFilter::Create(field, Filter::Operator::Equal, NaNValue()); + + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL: + return FieldFilter::Create(field, Filter::Operator::NotEqual, + NullValue()); + + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN: + return FieldFilter::Create(field, Filter::Operator::NotEqual, NaNValue()); + + default: + context->Fail(StringFormat("Unrecognized UnaryFilter.op %s", unary.op)); + return InvalidFilter(); + } +} + +FilterList Serializer::DecodeCompositeFilter( + ReadContext* context, + const google_firestore_v1_StructuredQuery_CompositeFilter& composite) + const { + if (composite.op != + google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND) { + context->Fail(StringFormat( + "Only AND-type composite filters are supported, got %s", composite.op)); + return FilterList{}; + } + + FilterList result; + result = result.reserve(composite.filters_count); + + for (pb_size_t i = 0; i != composite.filters_count; ++i) { + auto& filter = composite.filters[i]; + switch (filter.which_filter_type) { + case google_firestore_v1_StructuredQuery_Filter_composite_filter_tag: + context->Fail("Nested composite filters are not supported"); + return FilterList{}; + + case google_firestore_v1_StructuredQuery_Filter_unary_filter_tag: + result = + result.push_back(DecodeUnaryFilter(context, filter.unary_filter)); + break; + + case google_firestore_v1_StructuredQuery_Filter_field_filter_tag: + result = + result.push_back(DecodeFieldFilter(context, filter.field_filter)); + break; + + default: + context->Fail(StringFormat("Unrecognized Filter.which_filter_type %s", + filter.which_filter_type)); + return FilterList{}; + } + } + + return result; +} + +google_firestore_v1_StructuredQuery_FieldFilter_Operator +Serializer::EncodeFieldFilterOperator(Filter::Operator op) const { + switch (op) { + case Filter::Operator::LessThan: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN; + + case Filter::Operator::LessThanOrEqual: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN_OR_EQUAL; // NOLINT + + case Filter::Operator::GreaterThan: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN; // NOLINT + + case Filter::Operator::GreaterThanOrEqual: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN_OR_EQUAL; // NOLINT + + 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 + + case Filter::Operator::In: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_IN; + + 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); + } +} + +Filter::Operator Serializer::DecodeFieldFilterOperator( + ReadContext* context, + google_firestore_v1_StructuredQuery_FieldFilter_Operator op) const { + switch (op) { + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN: + return Filter::Operator::LessThan; + + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN_OR_EQUAL: // NOLINT + return Filter::Operator::LessThanOrEqual; + + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN: + return Filter::Operator::GreaterThan; + + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN_OR_EQUAL: // NOLINT + return Filter::Operator::GreaterThanOrEqual; + + 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; + + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_IN: + return Filter::Operator::In; + + 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: + context->Fail(StringFormat("Unhandled FieldFilter.op: %s", op)); + return Filter::Operator{}; + } +} + +google_firestore_v1_StructuredQuery_Order* Serializer::EncodeOrderBys( + const OrderByList& orders) const { + auto* result = MakeArray( + CheckedSize(orders.size())); + + int i = 0; + for (const OrderBy& order : orders) { + auto& encoded_order = result[i]; + + encoded_order.field.field_path = EncodeFieldPath(order.field()); + auto dir = order.ascending() + ? google_firestore_v1_StructuredQuery_Direction_ASCENDING + : google_firestore_v1_StructuredQuery_Direction_DESCENDING; + encoded_order.direction = dir; + + ++i; + } + + return result; +} + +OrderByList Serializer::DecodeOrderBys( + ReadContext* context, + google_firestore_v1_StructuredQuery_Order* order_bys, + pb_size_t size) const { + OrderByList result; + result = result.reserve(size); + + for (pb_size_t i = 0; i != size; ++i) { + result = result.push_back(DecodeOrderBy(context, order_bys[i])); + } + + return result; +} + +OrderBy Serializer::DecodeOrderBy( + ReadContext* context, + const google_firestore_v1_StructuredQuery_Order& order_by) const { + auto field_path = DecodeFieldPath(context, order_by.field.field_path); + + Direction direction; + switch (order_by.direction) { + case google_firestore_v1_StructuredQuery_Direction_ASCENDING: + direction = Direction::Ascending; + break; + + case google_firestore_v1_StructuredQuery_Direction_DESCENDING: + direction = Direction::Descending; + break; + + default: + context->Fail(StringFormat( + "Unrecognized google_firestore_v1_StructuredQuery_Direction %s", + order_by.direction)); + return OrderBy{}; + } + + return OrderBy(std::move(field_path), direction); +} + +google_firestore_v1_Cursor Serializer::EncodeBound(const Bound& bound) const { + google_firestore_v1_Cursor result{}; + result.before = bound.before(); + SetRepeatedField( + &result.values, &result.values_count, + absl::Span(bound.position()->values, + bound.position()->values_count), + [](const google_firestore_v1_Value& value) { + return *DeepClone(value).release(); + }); + return result; +} + +Bound Serializer::DecodeBound(google_firestore_v1_Cursor& cursor) const { + SharedMessage index_components{{}}; + SetRepeatedField(&index_components->values, &index_components->values_count, + absl::Span(cursor.values, + cursor.values_count)); + // Prevent double-freeing of the cursors's fields. The fields are now owned by + // the bound. + ReleaseFieldOwnership(cursor.values, cursor.values_count); + return Bound::FromValue(std::move(index_components), cursor.before); +} + +/* static */ +pb_bytes_array_t* Serializer::EncodeFieldPath(const FieldPath& field_path) { + return EncodeString(field_path.CanonicalString()); +} + +/* static */ +FieldPath Serializer::DecodeFieldPath(ReadContext* context, + const pb_bytes_array_t* field_path) { + absl::string_view str = MakeStringView(field_path); + StatusOr decoded_path = FieldPath::FromServerFormatView(str); + if (!decoded_path.ok()) { + context->set_status(decoded_path.status()); + return InvalidFieldPath(); + } + return decoded_path.ConsumeValueOrDie(); +} + +google_protobuf_Timestamp Serializer::EncodeVersion( + const SnapshotVersion& version) { + return EncodeTimestamp(version.timestamp()); +} + +google_protobuf_Timestamp Serializer::EncodeTimestamp( + const Timestamp& timestamp_value) { + google_protobuf_Timestamp result{}; + result.seconds = timestamp_value.seconds(); + result.nanos = timestamp_value.nanoseconds(); + return result; +} + +SnapshotVersion Serializer::DecodeVersion( + ReadContext* context, const google_protobuf_Timestamp& proto) { + return SnapshotVersion{DecodeTimestamp(context, proto)}; +} + +Timestamp Serializer::DecodeTimestamp( + ReadContext* context, const google_protobuf_Timestamp& timestamp_proto) { + auto decoded = TimestampInternal::FromUntrustedSecondsAndNanos( + timestamp_proto.seconds, timestamp_proto.nanos); + + if (!decoded.ok()) { + context->Fail( + "Failed to decode into valid protobuf Timestamp with error '%s'", + decoded.status().error_message()); + return {}; + } + return decoded.ConsumeValueOrDie(); +} + +MutationResult Serializer::DecodeMutationResult( + ReadContext* context, + google_firestore_v1_WriteResult& write_result, + const SnapshotVersion& commit_version) const { + // NOTE: Deletes don't have an update_time, use commit_version instead. + SnapshotVersion version = + write_result.has_update_time + ? DecodeVersion(context, write_result.update_time) + : commit_version; + + Message transform_results; + SetRepeatedField(&transform_results->values, &transform_results->values_count, + absl::Span( + write_result.transform_results, + write_result.transform_results_count)); + // Prevent double-freeing of the transform result. The fields are now owned by + // the mutation result. + ReleaseFieldOwnership(write_result.transform_results, + write_result.transform_results_count); + return MutationResult(version, std::move(transform_results)); +} + +std::vector +Serializer::EncodeListenRequestLabels(const TargetData& target_data) const { + std::vector result; + auto value = EncodeLabel(target_data.purpose()); + if (value.empty()) { + return result; + } + + result.push_back({/* key */ EncodeString("goog-listen-tags"), + /* value */ EncodeString(value)}); + + return result; +} + +std::string Serializer::EncodeLabel(QueryPurpose purpose) const { + switch (purpose) { + case QueryPurpose::Listen: + return ""; + case QueryPurpose::ExistenceFilterMismatch: + return "existence-filter-mismatch"; + case QueryPurpose::LimboResolution: + return "limbo-document"; + } + UNREACHABLE(); +} + +std::unique_ptr Serializer::DecodeWatchChange( + ReadContext* context, + google_firestore_v1_ListenResponse& watch_change) const { + switch (watch_change.which_response_type) { + case google_firestore_v1_ListenResponse_target_change_tag: + return DecodeTargetChange(context, watch_change.target_change); + + case google_firestore_v1_ListenResponse_document_change_tag: + return DecodeDocumentChange(context, watch_change.document_change); + + case google_firestore_v1_ListenResponse_document_delete_tag: + return DecodeDocumentDelete(context, watch_change.document_delete); + + case google_firestore_v1_ListenResponse_document_remove_tag: + return DecodeDocumentRemove(context, watch_change.document_remove); + + case google_firestore_v1_ListenResponse_filter_tag: + return DecodeExistenceFilterWatchChange(context, watch_change.filter); + } + + // 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. + context->Fail(StringFormat("Unknown WatchChange.response_type: %s", + watch_change.which_response_type)); + return {}; +} + +SnapshotVersion Serializer::DecodeVersionFromListenResponse( + ReadContext* context, + const google_firestore_v1_ListenResponse& listen_response) const { + // 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 (listen_response.which_response_type != + google_firestore_v1_ListenResponse_target_change_tag) { + return SnapshotVersion::None(); + } + if (listen_response.target_change.target_ids_count != 0) { + return SnapshotVersion::None(); + } + + return DecodeVersion(context, listen_response.target_change.read_time); +} + +std::unique_ptr Serializer::DecodeTargetChange( + ReadContext* context, + const google_firestore_v1_TargetChange& change) const { + WatchTargetChangeState state = + DecodeTargetChangeState(context, change.target_change_type); + std::vector target_ids(change.target_ids, + change.target_ids + change.target_ids_count); + ByteString resume_token(change.resume_token); + + util::Status cause; + if (change.has_cause) { + cause = util::Status{static_cast(change.cause.code), + DecodeString(change.cause.message)}; + } + + return absl::make_unique( + state, std::move(target_ids), std::move(resume_token), std::move(cause)); +} + +WatchTargetChangeState Serializer::DecodeTargetChangeState( + ReadContext*, + const google_firestore_v1_TargetChange_TargetChangeType state) { + switch (state) { + case google_firestore_v1_TargetChange_TargetChangeType_NO_CHANGE: + return WatchTargetChangeState::NoChange; + case google_firestore_v1_TargetChange_TargetChangeType_ADD: + return WatchTargetChangeState::Added; + case google_firestore_v1_TargetChange_TargetChangeType_REMOVE: + return WatchTargetChangeState::Removed; + case google_firestore_v1_TargetChange_TargetChangeType_CURRENT: + return WatchTargetChangeState::Current; + case google_firestore_v1_TargetChange_TargetChangeType_RESET: + return WatchTargetChangeState::Reset; + } + UNREACHABLE(); +} + +std::unique_ptr Serializer::DecodeDocumentChange( + ReadContext* context, google_firestore_v1_DocumentChange& change) const { + ObjectValue value = ObjectValue::FromFieldsEntry( + change.document.fields, change.document.fields_count); + DocumentKey key = DecodeKey(context, change.document.name); + + HARD_ASSERT(change.document.has_update_time, + "Got a document change with no snapshot version"); + SnapshotVersion version = DecodeVersion(context, change.document.update_time); + + // 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. + MutableDocument document = + MutableDocument::FoundDocument(key, version, std::move(value)); + + std::vector updated_target_ids( + change.target_ids, change.target_ids + change.target_ids_count); + std::vector removed_target_ids( + change.removed_target_ids, + change.removed_target_ids + change.removed_target_ids_count); + + return absl::make_unique( + std::move(updated_target_ids), std::move(removed_target_ids), + std::move(key), std::move(document)); +} + +std::unique_ptr Serializer::DecodeDocumentDelete( + ReadContext* context, + const google_firestore_v1_DocumentDelete& change) const { + DocumentKey key = DecodeKey(context, change.document); + // Note that version might be unset in which case we use + // SnapshotVersion::None(). + SnapshotVersion version = change.has_read_time + ? DecodeVersion(context, change.read_time) + : SnapshotVersion::None(); + MutableDocument document = MutableDocument::NoDocument(key, version); + + std::vector removed_target_ids( + change.removed_target_ids, + change.removed_target_ids + change.removed_target_ids_count); + + return absl::make_unique( + std::vector{}, std::move(removed_target_ids), std::move(key), + std::move(document)); +} + +std::unique_ptr Serializer::DecodeDocumentRemove( + ReadContext* context, + const google_firestore_v1_DocumentRemove& change) const { + DocumentKey key = DecodeKey(context, change.document); + std::vector removed_target_ids( + change.removed_target_ids, + change.removed_target_ids + change.removed_target_ids_count); + + return absl::make_unique(std::vector{}, + std::move(removed_target_ids), + std::move(key), absl::nullopt); +} + +std::unique_ptr Serializer::DecodeExistenceFilterWatchChange( + ReadContext*, const google_firestore_v1_ExistenceFilter& filter) const { + ExistenceFilter existence_filter{filter.count}; + return absl::make_unique(existence_filter, + filter.target_id); +} + +bool Serializer::IsLocalResourceName(const ResourcePath& path) const { + return IsValidResourceName(path) && path[1] == database_id_.project_id() && + path[3] == database_id_.database_id(); +} + +bool Serializer::IsLocalDocumentKey(absl::string_view path) const { + auto resource = ResourcePath::FromStringView(path); + return IsLocalResourceName(resource) && + DocumentKey::IsDocumentKey(resource.PopFirst(5)); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h new file mode 100644 index 0000000..5dd7350 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h @@ -0,0 +1,329 @@ +/* + * 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_SERIALIZER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_SERIALIZER_H_ + +#include + +#include +#include +#include +#include +#include + +#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/core/core_fwd.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "Firestore/core/src/remote/watch_change.h" +#include "Firestore/core/src/util/read_context.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/base/attributes.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { + +namespace local { +class LocalSerializer; +class TargetData; + +enum class QueryPurpose; +} // namespace local + +namespace remote { + +core::Target InvalidTarget(); + +/** + * @brief Converts internal model objects to their equivalent protocol buffer + * form, and protocol buffer objects to their equivalent bytes. + * + * Methods starting with "Encode" convert from a model object to a nanopb + * protocol buffer, and methods starting with "Decode" convert from a nanopb + * protocol buffer to a model object. + * + * 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. + * + * 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. + */ +class Serializer { + public: + /** + * @param database_id Must remain valid for the lifetime of this Serializer + * object. + */ + explicit Serializer(model::DatabaseId database_id); + + /** + * Encodes the string to nanopb bytes. + * + * This method allocates memory; the caller is responsible for freeing it. + * Typically, the returned value will be added to a pointer field within a + * nanopb proto struct. Calling pb_release() on the resulting struct will + * cause all proto fields to be freed. + */ + static pb_bytes_array_t* EncodeString(const std::string& str); + + /** + * Decodes the nanopb bytes to a std::string. If the input pointer is null, + * then this method will return an empty string. + */ + static std::string DecodeString(const pb_bytes_array_t* str); + + /** + * Returns the database ID, such as + * `projects/{project_id}/databases/{database_id}`. + */ + pb_bytes_array_t* EncodeDatabaseName() const; + + /** + * Encodes the given document key as a fully qualified name. This includes the + * DatabaseId associated with this Serializer and the key path. + */ + pb_bytes_array_t* EncodeKey( + const firebase::firestore::model::DocumentKey& key) const; + + /** + * Decodes the given document key from a fully qualified name. + */ + firebase::firestore::model::DocumentKey DecodeKey( + util::ReadContext* context, const pb_bytes_array_t* name) const; + + /** + * @brief Converts the Document (i.e. key/value) into bytes. + */ + google_firestore_v1_Document EncodeDocument( + const model::DocumentKey& key, const model::ObjectValue& value) const; + + /** + * @brief Converts from nanopb proto to the model Document format. + */ + model::MutableDocument DecodeMaybeDocument( + util::ReadContext* context, + google_firestore_v1_BatchGetDocumentsResponse& response) const; + + google_firestore_v1_Write EncodeMutation( + const model::Mutation& mutation) const; + model::Mutation DecodeMutation(util::ReadContext* context, + google_firestore_v1_Write& mutation) const; + + static google_firestore_v1_Precondition EncodePrecondition( + const model::Precondition& precondition); + static model::Precondition DecodePrecondition( + util::ReadContext* context, + const google_firestore_v1_Precondition& precondition); + + static google_firestore_v1_DocumentMask EncodeFieldMask( + const model::FieldMask& mask); + static model::FieldMask DecodeFieldMask( + util::ReadContext* context, const google_firestore_v1_DocumentMask& mask); + + google_firestore_v1_DocumentTransform_FieldTransform EncodeFieldTransform( + const model::FieldTransform& field_transform) const; + model::FieldTransform DecodeFieldTransform( + util::ReadContext* context, + google_firestore_v1_DocumentTransform_FieldTransform& proto) const; + + model::MutationResult DecodeMutationResult( + util::ReadContext* context, + google_firestore_v1_WriteResult& write_result, + const model::SnapshotVersion& commit_version) const; + + std::vector + EncodeListenRequestLabels(const local::TargetData& target_data) const; + + static pb_bytes_array_t* EncodeFieldPath(const model::FieldPath& field_path); + static model::FieldPath DecodeFieldPath(util::ReadContext* context, + const pb_bytes_array_t* field_path); + + static google_protobuf_Timestamp EncodeVersion( + const model::SnapshotVersion& version); + + static google_protobuf_Timestamp EncodeTimestamp( + const Timestamp& timestamp_value); + + static model::SnapshotVersion DecodeVersion( + util::ReadContext* context, const google_protobuf_Timestamp& proto); + + static Timestamp DecodeTimestamp( + util::ReadContext* context, + const google_protobuf_Timestamp& timestamp_proto); + + google_firestore_v1_Target EncodeTarget( + const local::TargetData& target_data) const; + google_firestore_v1_Target_DocumentsTarget EncodeDocumentsTarget( + const core::Target& target) const; + core::Target DecodeDocumentsTarget( + util::ReadContext* context, + const google_firestore_v1_Target_DocumentsTarget& proto) const; + google_firestore_v1_Target_QueryTarget EncodeQueryTarget( + const core::Target& target) const; + + /** + * Decodes the query target. Modifies the provided proto to release ownership + * of any Value messages. + */ + core::Target DecodeQueryTarget( + util::ReadContext* context, + google_firestore_v1_Target_QueryTarget& query) const; + + core::Target DecodeStructuredQuery( + util::ReadContext* context, + pb_bytes_array_t* parent, + google_firestore_v1_StructuredQuery& query) const; + + /** + * Decodes the watch change. Modifies the provided proto to release + * ownership of any Value messages. + */ + std::unique_ptr DecodeWatchChange( + util::ReadContext* context, + google_firestore_v1_ListenResponse& watch_change) const; + + model::SnapshotVersion DecodeVersionFromListenResponse( + util::ReadContext* context, + const google_firestore_v1_ListenResponse& listen_response) const; + + // Public for the sake of tests. + google_firestore_v1_StructuredQuery_Filter EncodeFilters( + const core::FilterList& filters) const; + + /** + * Decodes the structured query. Modifies the provided proto to release + * ownership of any Value messages. + */ + core::FilterList DecodeFilters( + util::ReadContext* context, + google_firestore_v1_StructuredQuery_Filter& proto) const; + + /** + * Encodes a database ID and resource path into the following form: + * /projects/$project_id/database/$database_id/documents/$path + * + * Does not verify that the database_id matches the current instance. + */ + pb_bytes_array_t* EncodeResourceName(const model::DatabaseId& database_id, + const model::ResourcePath& path) const; + + bool IsLocalResourceName(const model::ResourcePath& path) const; + + bool IsLocalDocumentKey(absl::string_view path) const; + + private: + model::MutableDocument DecodeFoundDocument( + util::ReadContext* context, + google_firestore_v1_BatchGetDocumentsResponse& response) const; + model::MutableDocument DecodeMissingDocument( + util::ReadContext* context, + const google_firestore_v1_BatchGetDocumentsResponse& response) const; + + pb_bytes_array_t* EncodeQueryPath(const model::ResourcePath& path) const; + model::ResourcePath DecodeQueryPath(util::ReadContext* context, + absl::string_view name) 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(util::ReadContext* context, + absl::string_view encoded) const; + + void ValidateDocumentKeyPath(util::ReadContext* context, + const model::ResourcePath& resource_name) const; + model::DocumentKey DecodeKey(util::ReadContext* context, + const model::ResourcePath& resource_name) const; + + std::string EncodeLabel(local::QueryPurpose purpose) const; + + google_firestore_v1_StructuredQuery_Filter EncodeSingularFilter( + const core::FieldFilter& filter) const; + core::Filter DecodeFieldFilter( + util::ReadContext* context, + google_firestore_v1_StructuredQuery_FieldFilter& field_filter) const; + core::Filter DecodeUnaryFilter( + util::ReadContext* context, + const google_firestore_v1_StructuredQuery_UnaryFilter& unary) const; + core::FilterList DecodeCompositeFilter( + util::ReadContext* context, + const google_firestore_v1_StructuredQuery_CompositeFilter& composite) + const; + + google_firestore_v1_StructuredQuery_FieldFilter_Operator + EncodeFieldFilterOperator(core::Filter::Operator op) const; + core::Filter::Operator DecodeFieldFilterOperator( + util::ReadContext* context, + google_firestore_v1_StructuredQuery_FieldFilter_Operator op) const; + + google_firestore_v1_StructuredQuery_Order* EncodeOrderBys( + const core::OrderByList& orders) const; + core::OrderByList DecodeOrderBys( + util::ReadContext* context, + google_firestore_v1_StructuredQuery_Order* order_bys, + pb_size_t size) const; + core::OrderBy DecodeOrderBy( + util::ReadContext* context, + const google_firestore_v1_StructuredQuery_Order& order_by) const; + + google_firestore_v1_Cursor EncodeBound(const core::Bound& bound) const; + core::Bound DecodeBound(google_firestore_v1_Cursor& cursor) const; + + std::unique_ptr DecodeTargetChange( + util::ReadContext* context, + const google_firestore_v1_TargetChange& change) const; + static remote::WatchTargetChangeState DecodeTargetChangeState( + util::ReadContext* context, + const google_firestore_v1_TargetChange_TargetChangeType state); + + std::unique_ptr DecodeDocumentChange( + util::ReadContext* context, + google_firestore_v1_DocumentChange& change) const; + std::unique_ptr DecodeDocumentDelete( + util::ReadContext* context, + const google_firestore_v1_DocumentDelete& change) const; + std::unique_ptr DecodeDocumentRemove( + util::ReadContext* context, + const google_firestore_v1_DocumentRemove& change) const; + std::unique_ptr DecodeExistenceFilterWatchChange( + util::ReadContext* context, + const google_firestore_v1_ExistenceFilter& filter) const; + + model::DatabaseId database_id_; + // TODO(varconst): Android caches the result of calling `EncodeDatabaseName` + // as well, consider implementing that. +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_SERIALIZER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc new file mode 100644 index 0000000..9de6643 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc @@ -0,0 +1,388 @@ +/* + * 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/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 { +namespace { + +using credentials::AuthToken; +using credentials::CredentialsProvider; +using credentials::User; +using util::AsyncQueue; +using util::LogIsDebugEnabled; +using util::Status; +using util::StatusOr; +using util::StringFormat; +using util::TimerId; + +using AuthCredentialsProvider = CredentialsProvider; + +/** + * 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)}; +/** The time a stream stays open until we consider it healthy. */ +const AsyncQueue::Milliseconds kHealthyTimeout{std::chrono::seconds(10)}; + +} // namespace + +Stream::Stream(const std::shared_ptr& worker_queue, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + GrpcConnection* grpc_connection, + TimerId backoff_timer_id, + TimerId idle_timer_id, + TimerId health_check_timer_id) + : backoff_{worker_queue, backoff_timer_id, kBackoffFactor, + kBackoffInitialDelay, kBackoffMaxDelay}, + app_check_credentials_provider_{ + std::move(app_check_credentials_provider)}, + auth_credentials_provider_{std::move(auth_credentials_provider)}, + worker_queue_{worker_queue}, + grpc_connection_{grpc_connection}, + idle_timer_id_{idle_timer_id}, + health_check_timer_id_{health_check_timer_id} { +} + +// Check state + +bool Stream::IsOpen() const { + EnsureOnQueue(); + return state_ == State::Open || state_ == State::Healthy; +} + +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/AppCheck may outlive the stream, so make sure it doesn't try to access + // a deleted object. + std::weak_ptr weak_this{shared_from_this()}; + auto credentials = std::make_shared(); + int initial_close_count = close_count_; + + auto done = [weak_this, credentials, initial_close_count]( + const absl::optional>& auth, + const absl::optional& app_check) { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + + std::lock_guard lock(credentials->mutex); + if (auth) { + credentials->auth = *auth; + credentials->auth_received = true; + } + if (app_check) { + credentials->app_check = *app_check; + credentials->app_check_received = true; + } + + if (!credentials->auth_received || !credentials->app_check_received) { + return; + } + + const StatusOr& auth_token = credentials->auth; + const std::string& app_check_token = credentials->app_check; + + strong_this->worker_queue_->EnqueueRelaxed( + [weak_this, auth_token, app_check_token, 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(auth_token, app_check_token); + }); + }; + + auth_credentials_provider_->GetToken( + [done](const StatusOr& auth) { done(auth, absl::nullopt); }); + + app_check_credentials_provider_->GetToken( + [done](const StatusOr& app_check) { + done(absl::nullopt, app_check.ValueOrDie()); // AppCheck never fails + }); +} + +void Stream::ResumeStartWithCredentials(const StatusOr& auth_token, + const std::string& app_check_token) { + EnsureOnQueue(); + + HARD_ASSERT(state_ == State::Starting, + "State should still be 'Starting' (was %s)", state_); + + if (!auth_token.ok()) { + OnStreamFinish(auth_token.status()); + return; + } + + grpc_stream_ = CreateGrpcStream(grpc_connection_, auth_token.ValueOrDie(), + app_check_token); + grpc_stream_->Start(); +} + +void Stream::OnStreamStart() { + EnsureOnQueue(); + + state_ = State::Open; + NotifyStreamOpen(); + + health_check_ = worker_queue_->EnqueueAfterDelay( + kHealthyTimeout, health_check_timer_id_, [this] { + { + if (IsOpen()) { + state_ = State::Healthy; + } + } + }); +} + +// 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 (allowlisted): %s", GetDebugDescription(), + Datastore::GetAllowlistedHeadersAsString( + 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(); + health_check_.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 && + state_ != State::Healthy) { + // "unauthenticated" error means the token was rejected. This should rarely + // happen since both Auth and AppCheck ensure a sufficient TTL when we + // request a token. If a user manually resets their system clock this can + // fail, however. In this case, we should get a kErrorUnauthenticated error + // before we received the first message and we need to invalidate the token + // to ensure that we fetch a new token. + auth_credentials_provider_->InvalidateToken(); + app_check_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h new file mode 100644 index 0000000..d9c4a64 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h @@ -0,0 +1,269 @@ +/* + * 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_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_STREAM_H_ + +#include +#include + +#include "Firestore/core/src/credentials/auth_token.h" +#include "Firestore/core/src/credentials/credentials_fwd.h" +#include "Firestore/core/src/credentials/credentials_provider.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" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * A `Stream` is an abstract base class that represents a bidirectional + * streaming connection to the Firestore backend. It's built on top of gRPC C++ + * library and adds several critical features for our clients: + * + * - Exponential backoff on failure (independent of the gRPC mechanism) + * - Authentication via CredentialsProvider + * - Dispatching all callbacks into the shared Firestore async queue + * - Closing idle streams after 60 seconds of inactivity + * + * Subclasses of `Stream`: + * + * - Implement serialization and deserialization of protocol buffers + * - Notify their delegate about stream open/read/error events + * - Create and finish the underlying gRPC streams. + * + * ## Starting and Stopping + * + * Streams are stateful and need to be `Start`ed before messages can + * be sent and received. A `Stream` can be started and stopped repeatedly. + * + * All public virtual methods exist only for the sake of tests; the methods that + * are expected to be implemented by "normal" derived classes are pure virtual + * and private. + */ +class Stream : public GrpcStreamObserver, + public std::enable_shared_from_this { + public: + /** + * `Stream` can be in one of 5 states (each described in detail below) + * shown in the following state transition diagram: + * + * Start() called auth & connection succeeded + * INITIAL ----------------> STARTING -----------------------------> OPEN + * ^ | | + * | | error occurred | + * | \-----------------------------v-----/ + * | | + * backoff | | + * elapsed | Start() called | + * \--- BACKOFF <---------------- ERROR + * + * [any state] --------------------------> INITIAL + * Stop() called or + * idle timer expired + */ + enum class State { + /** + * The stream is not yet running and there's no error condition. + * Calling `Start` will start the stream immediately without backoff. + * While in this state, `IsStarted` will return false. + */ + Initial, + + /** + * The stream is starting, either waiting for an auth token or for the + * stream to successfully open. While in this state, `IsStarted` will + * return true but `IsOpen` will return false. + */ + Starting, + + /** + * The stream is up and running. Requests and responses can flow + * freely. Both `IsStarted` and `IsOpen` will return true. + */ + Open, + + /** + * The stream is healthy and has been connected for more than 10 seconds. We + * therefore assume that the credentials we passed were valid. + * Both `IsStarted` and `IsOpen` will return true. + */ + Healthy, + + /** + * The stream encountered an error. The next start attempt will back off. + * While in this state, `IsStarted` will return false. + */ + Error, + + /** + * An in-between state after an error where the stream is waiting before + * re-starting. After waiting is complete, the stream will try to open. + * While in this state, `IsStarted` will return true but `IsOpen` will + * return false. + */ + Backoff + }; + + Stream(const std::shared_ptr& worker_queue, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + GrpcConnection* grpc_connection, + util::TimerId backoff_timer_id, + util::TimerId idle_timer_id, + util::TimerId health_check_timer_id); + + /** + * Starts the stream. Only allowed if `IsStarted` returns false. The stream is + * not immediately ready for use: `OnStreamStart` will be invoked when the + * stream is ready for outbound requests, at which point `IsOpen` will return + * true. + * + * When start returns, `IsStarted` will return true. + */ + virtual void Start(); + + /** + * Stops the stream. This call is idempotent and allowed regardless of the + * current `IsStarted` state. + * + * When stop returns, `IsStarted` and `IsOpen` will both return false. + */ + virtual void Stop(); + + /** + * Returns true if `Start` has been called and no error has occurred. True + * indicates the stream is open or in the process of opening (which + * encompasses respecting backoff, getting auth tokens, and starting the + * actual stream). Use `IsOpen` to determine if the stream is open and ready + * for outbound requests. + */ + virtual bool IsStarted() const; + + /** + * Returns true if the underlying stream is open (`OnStreamStart` has been + * called) and the stream is ready for outbound requests. + */ + virtual bool IsOpen() const; + + /** + * After an error, the stream will usually back off on the next attempt to + * start it. If the error warrants an immediate restart of the stream, the + * caller can use this to indicate that the stream should not back off. + * + * Each error will call `OnStreamClose`. That function can decide to + * cancel backoff if required. + */ + void InhibitBackoff(); + + /** + * Marks this stream as idle. If no further actions are performed on the + * stream for one minute, the stream will automatically close itself and + * notify the stream's `OnClose` handler with Status::OK. The stream will then + * be in a non-started state, requiring the caller to start the stream again + * before further use. + * + * Only streams that are in state 'Open' can be marked idle, as all other + * states imply pending network operations. + */ + void MarkIdle(); + + /** + * Marks the stream as active again, preventing auto-closing of the stream. + * Can be called from any state -- if the stream is not in state `Open`, this + * is a no-op. + */ + void CancelIdleCheck(); + + // `GrpcStreamObserver` interface -- do not use. + void OnStreamStart() override; + void OnStreamRead(const grpc::ByteBuffer& message) override; + void OnStreamFinish(const util::Status& status) override; + + protected: + // `Stream` expects all its methods to be called on the worker queue. + void EnsureOnQueue() const; + void Write(grpc::ByteBuffer&& message); + std::string GetDebugDescription() const; + + ExponentialBackoff backoff_; + + private: + struct CallCredentials { + mutable std::mutex mutex; + std::string app_check; + bool app_check_received = false; + util::StatusOr auth; + bool auth_received = false; + }; + + virtual std::unique_ptr CreateGrpcStream( + GrpcConnection* grpc_connection, + const credentials::AuthToken& auth_token, + const std::string& app_check_token) = 0; + virtual void TearDown(GrpcStream* stream) = 0; + virtual void NotifyStreamOpen() = 0; + virtual util::Status NotifyStreamResponse( + const grpc::ByteBuffer& message) = 0; + virtual void NotifyStreamClose(const util::Status& status) = 0; + // PORTING NOTE: C++ cannot rely on RTTI, unlike other platforms. + virtual std::string GetDebugName() const = 0; + + void Close(const util::Status& status); + void HandleErrorStatus(const util::Status& status); + + void RequestCredentials(); + void ResumeStartWithCredentials( + const util::StatusOr& auth_token, + const std::string& app_check_token); + void BackoffAndTryRestarting(); + + State state_ = State::Initial; + + std::unique_ptr grpc_stream_; + + std::shared_ptr + app_check_credentials_provider_; + std::shared_ptr + auth_credentials_provider_; + std::shared_ptr worker_queue_; + GrpcConnection* grpc_connection_ = nullptr; + + util::TimerId idle_timer_id_{}; + util::TimerId health_check_timer_id_{}; + util::DelayedOperation idleness_timer_; + util::DelayedOperation health_check_; + + // Used to prevent auth if the stream happens to be restarted before token is + // received. + int close_count_ = 0; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_STREAM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc new file mode 100644 index 0000000..90438c3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc @@ -0,0 +1,70 @@ +/* + * 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/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h new file mode 100644 index 0000000..ba2951c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h @@ -0,0 +1,219 @@ +/* + * 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_WATCH_CHANGE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_WATCH_CHANGE_H_ + +#include +#include + +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/mutable_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 { +namespace remote { + +/** + * `WatchChange` is the internal representation of the watcher API protocol + * buffers. This is an empty abstract class so that all the different kinds of + * changes can have a common base class. + */ +class WatchChange { + public: + // PORTING NOTE: `WatchChange` is expected to be downcast, but on C++ we can't + // rely on RTTI to be available. + enum class Type { + Document, + ExistenceFilter, + TargetChange, + }; + + virtual ~WatchChange() = default; + + virtual Type type() const = 0; +}; + +bool operator==(const WatchChange& lhs, const WatchChange& rhs); + +/** + * `DocumentWatchChange` represents a changed document and a list of target ids + * to which this change applies. + * + * If document has been deleted, a `DeletedDocument` will be provided. + */ +class DocumentWatchChange : public WatchChange { + public: + DocumentWatchChange(std::vector updated_target_ids, + std::vector removed_target_ids, + model::DocumentKey document_key, + absl::optional new_document) + : updated_target_ids_{std::move(updated_target_ids)}, + removed_target_ids_{std::move(removed_target_ids)}, + document_key_{std::move(document_key)}, + new_document_{std::move(new_document)} { + } + + Type type() const override { + return Type::Document; + } + + /** The new document applies to all of these targets. */ + const std::vector& updated_target_ids() const { + return updated_target_ids_; + } + + /** The new document is removed from all of these targets. */ + const std::vector& removed_target_ids() const { + return removed_target_ids_; + } + + /** + * The new document, or `DeletedDocument` if it was deleted. Is null if the + * document went out of view without the server sending a new document. + */ + const absl::optional& new_document() const { + return new_document_; + } + + /** The key of the document for this change. */ + const model::DocumentKey& document_key() const { + return document_key_; + } + + private: + std::vector updated_target_ids_; + std::vector removed_target_ids_; + model::DocumentKey document_key_; + absl::optional new_document_; +}; + +bool operator==(const DocumentWatchChange& lhs, const DocumentWatchChange& rhs); + +/** + * An `ExistenceFilterWatchChange` applies to the targets and is required to + * verify the current client state against expected state sent from the server. + */ +class ExistenceFilterWatchChange : public WatchChange { + public: + ExistenceFilterWatchChange(ExistenceFilter filter, model::TargetId target_id) + : filter_{filter}, target_id_{target_id} { + } + + Type type() const override { + return Type::ExistenceFilter; + } + + const ExistenceFilter& filter() const { + return filter_; + } + model::TargetId target_id() const { + return target_id_; + } + + private: + ExistenceFilter filter_; + model::TargetId target_id_; +}; + +bool operator==(const ExistenceFilterWatchChange& lhs, + const ExistenceFilterWatchChange& rhs); + +enum class WatchTargetChangeState { NoChange, Added, Removed, Current, Reset }; + +class WatchTargetChange : public WatchChange { + public: + WatchTargetChange(WatchTargetChangeState state, + std::vector target_ids) + : WatchTargetChange{state, std::move(target_ids), nanopb::ByteString(), + util::Status::OK()} { + } + + WatchTargetChange(WatchTargetChangeState state, + std::vector target_ids, + nanopb::ByteString resume_token) + : WatchTargetChange{state, std::move(target_ids), std::move(resume_token), + util::Status::OK()} { + } + + WatchTargetChange(WatchTargetChangeState state, + std::vector target_ids, + util::Status cause) + : WatchTargetChange{state, std::move(target_ids), nanopb::ByteString(), + cause} { + } + + WatchTargetChange(WatchTargetChangeState state, + std::vector target_ids, + nanopb::ByteString resume_token, + util::Status cause) + : state_{state}, + target_ids_{std::move(target_ids)}, + resume_token_{std::move(resume_token)}, + cause_{std::move(cause)} { + } + + Type type() const override { + return Type::TargetChange; + } + + /** What kind of change occurred to the watch target. */ + WatchTargetChangeState state() const { + return state_; + } + + /** The target IDs that were added/removed/set. */ + const std::vector& target_ids() const { + return target_ids_; + } + + /** + * 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_; + } + + /** + * An RPC error indicating why the watch failed. Only valid if + * WatchChangeState == Removed. + */ + const util::Status& cause() const { + return cause_; + } + + private: + WatchTargetChangeState state_; + std::vector target_ids_; + nanopb::ByteString resume_token_; + util::Status cause_; +}; + +bool operator==(const WatchTargetChange& lhs, const WatchTargetChange& rhs); + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_WATCH_CHANGE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc new file mode 100644 index 0000000..61f1585 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc @@ -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. + */ + +#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 credentials::AuthCredentialsProvider; +using credentials::AuthToken; +using local::TargetData; +using model::TargetId; +using remote::ByteBufferReader; +using util::AsyncQueue; +using util::Status; +using util::TimerId; + +WatchStream::WatchStream( + const std::shared_ptr& async_queue, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WatchStreamCallback* callback) + : Stream{async_queue, + std::move(auth_credentials_provider), + std::move(app_check_credentials_provider), + grpc_connection, + TimerId::ListenStreamConnectionBackoff, + TimerId::ListenStreamIdle, + TimerId::HealthCheckTimeout}, + 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 AuthToken& auth_token, + const std::string& app_check_token) { + return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Listen", + auth_token, app_check_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h new file mode 100644 index 0000000..66c3899 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h @@ -0,0 +1,134 @@ +/* + * 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 + auth_credentials_provider, + std::shared_ptr + app_check_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 credentials::AuthToken& auth_token, + const std::string& app_check_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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc new file mode 100644 index 0000000..d9b35da --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc @@ -0,0 +1,167 @@ +/* + * 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 credentials::AuthCredentialsProvider; +using credentials::AuthToken; +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 + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WriteStreamCallback* callback) + : Stream{async_queue, + std::move(auth_credentials_provider), + std::move(app_check_credentials_provider), + grpc_connection, + TimerId::WriteStreamConnectionBackoff, + TimerId::WriteStreamIdle, + TimerId::HealthCheckTimeout}, + 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 AuthToken& auth_token, + const std::string& app_check_token) { + return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Write", + auth_token, app_check_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, std::move(results)); + } + + return Status::OK(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.h new file mode 100644 index 0000000..cf01926 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.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. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_WRITE_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_WRITE_STREAM_H_ + +#include +#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/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 remote { + +class Serializer; + +class WriteStreamCallback { + public: + virtual ~WriteStreamCallback() = default; + + /** + * Called by the `WriteStream` when it is ready to accept outbound request + * messages. + */ + virtual void OnWriteStreamOpen() = 0; + + /** + * Called by the `WriteStream` upon a successful handshake response from the + * server, which is the receiver's cue to send any pending writes. + */ + virtual void OnWriteStreamHandshakeComplete() = 0; + + /** + * Called by the `WriteStream` upon receiving a StreamingWriteResponse from + * the server that contains mutation results. + */ + virtual void OnWriteStreamMutationResult( + model::SnapshotVersion commit_version, + std::vector results) = 0; + + /** + * Called when the `WriteStream`'s underlying 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 OnWriteStreamClose(const util::Status& status) = 0; +}; + +/** + * A Stream that implements the Write RPC. + * + * The Write RPC requires the caller to maintain special stream token + * state in-between calls, to help the server understand which responses the + * client has processed by the time the next request is made. Every response + * will contain a stream token; this value must be passed to the next + * request. + * + * After calling `Start` on this stream, the next request must be a handshake, + * containing whatever stream token is on hand. Once a response to this + * request is received, all pending mutations may be submitted. When + * submitting multiple batches of mutations at the same time, it's + * okay to use the same stream token for the calls to `WriteMutations`. + * + * This class is not intended as a base class; all virtual methods exist only + * for the sake of tests. + */ +class WriteStream : public Stream { + public: + WriteStream(const std::shared_ptr& async_queue, + std::shared_ptr + auth_credentials_provider, + std::shared_ptr + app_check_credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WriteStreamCallback* callback); + + 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 + * markers whose only real value is their inclusion in the next request. + * + * `WriteStream` manages propagating this value from responses to the + * next request. + */ + const nanopb::ByteString& last_stream_token() const; + + /** + * Tracks whether or not a handshake has been successfully exchanged and + * the stream is ready to accept mutations. + */ + bool handshake_complete() const { + return handshake_complete_; + } + + /** + * Sends an initial stream token to the server, performing the handshake + * required to make the StreamingWrite RPC work. + */ + virtual void WriteHandshake(); + + /** Sends a group of mutations to the Firestore backend to apply. */ + virtual void WriteMutations(const std::vector& mutations); + + protected: + // For tests only + void SetHandshakeComplete(bool value = true) { + handshake_complete_ = value; + } + + private: + std::unique_ptr CreateGrpcStream( + GrpcConnection* grpc_connection, + const credentials::AuthToken& auth_token, + const std::string& app_check_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 "WriteStream"; + } + + 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_REMOTE_WRITE_STREAM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc new file mode 100644 index 0000000..1b60605 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc @@ -0,0 +1,139 @@ +/* + * 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/include/firebase/firestore/timestamp.h" + +#include + +#if defined(__APPLE__) +#import +#elif defined(_STLPORT_VERSION) +#include +#endif + +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace { + +constexpr int32_t kNanosPerSecond = 1000 * 1000 * 1000; + +/** + * Creates a `Timestamp` from the given non-normalized inputs. + * + * Timestamp protos require `Timestamp` to always has a positive number of + * nanoseconds that is counting forward. For negative time, we need to adjust + * representations with negative nanoseconds. That is, make (negative seconds s1 + * + negative nanoseconds ns1) into (negative seconds s2 + positive nanoseconds + * ns2). Since nanosecond part is always less than 1 second in our + * representation, instead of starting at s1 and going back ns1 nanoseconds, + * start at (s1 minus one second) and go *forward* ns2 = (1 second + ns1, ns1 < + * 0) nanoseconds. + */ +Timestamp MakeNormalizedTimestamp(int64_t seconds, int64_t nanos) { + if (nanos < 0) { + // Note: if nanoseconds are negative, it must mean that seconds are + // non-positive, but the formula would still be valid, so no need to check. + seconds = seconds - 1; + nanos = kNanosPerSecond + nanos; + } + + HARD_ASSERT(nanos < kNanosPerSecond); + + return {seconds, static_cast(nanos)}; +} + +} // namespace + +Timestamp::Timestamp(int64_t seconds, int32_t nanoseconds) + : seconds_(seconds), nanoseconds_(nanoseconds) { + ValidateBounds(); +} + +Timestamp Timestamp::Now() { +#if defined(__APPLE__) + // Originally, FIRTimestamp used NSDate to get current time. This method + // preserves the lower accuracy of that method. + CFAbsoluteTime now = + CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970; + double seconds_double; + double fraction = modf(now, &seconds_double); + auto seconds = static_cast(seconds_double); + auto nanos = static_cast(fraction * kNanosPerSecond); + return MakeNormalizedTimestamp(seconds, nanos); + +#elif !defined(_STLPORT_VERSION) + // Use the standard library from C++11 if possible. + return FromTimePoint(std::chrono::system_clock::now()); +#else + // If is unavailable, use clock_gettime from POSIX, which supports + // up to nanosecond resolution. Note that it's a non-standard function + // contained in . + // + // Note: it's possible to check for availability of POSIX clock_gettime using + // macros (see "Availability" at https://linux.die.net/man/3/clock_gettime). + // However, the only platform where isn't available is Android with + // STLPort standard library, where clock_gettime is known to be available. + timespec now; + clock_gettime(CLOCK_REALTIME, &now); + return MakeNormalizedTimestamp(now.tv_sec, now.tv_nsec); +#endif // !defined(_STLPORT_VERSION) +} + +Timestamp Timestamp::FromTimeT(const time_t seconds_since_unix_epoch) { + return {seconds_since_unix_epoch, 0}; +} + +#if !defined(_STLPORT_VERSION) +Timestamp Timestamp::FromTimePoint( + const std::chrono::time_point time_point) { + namespace chr = std::chrono; + const auto epoch_time = time_point.time_since_epoch(); + auto seconds = chr::duration_cast>(epoch_time); + auto nanos = chr::duration_cast(epoch_time - seconds); + + Timestamp result = MakeNormalizedTimestamp(seconds.count(), nanos.count()); + result.ValidateBounds(); + return result; +} + +#endif // !defined(_STLPORT_VERSION) + +std::string Timestamp::ToString() const { + return absl::StrCat("Timestamp(seconds=", seconds_, + ", nanoseconds=", nanoseconds_, ")"); +} + +std::ostream& operator<<(std::ostream& out, const Timestamp& timestamp) { + return out << timestamp.ToString(); +} + +void Timestamp::ValidateBounds() const { + HARD_ASSERT(nanoseconds_ >= 0, "Timestamp nanoseconds out of range: %s", + nanoseconds_); + HARD_ASSERT(nanoseconds_ < kNanosPerSecond, + "Timestamp nanoseconds out of range: %s", nanoseconds_); + // Midnight at the beginning of 1/1/1 is the earliest timestamp Firestore + // supports. + HARD_ASSERT(seconds_ >= -62135596800L, "Timestamp seconds out of range: %s", + seconds_); + // This will break in the year 10,000. + HARD_ASSERT(seconds_ < 253402300800L, "Timestamp seconds out of range: %s", + seconds_); +} + +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc new file mode 100644 index 0000000..7b3514e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc @@ -0,0 +1,70 @@ +/* + * 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/timestamp_internal.h" + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/statusor.h" + +namespace util = firebase::firestore::util; + +namespace firebase { + +util::StatusOr TimestampInternal::FromUntrustedTime( + absl::Time time) { + // Note `ToUnixSeconds` rounds towards negative infinity, this makes the + // `nanos` calculated below always non-negative, meeting protobuf's + // requirement. + int64_t seconds = absl::ToUnixSeconds(time); + int32_t nanos = static_cast((time - absl::FromUnixSeconds(seconds)) / + absl::Nanoseconds(1)); + return FromUntrustedSecondsAndNanos(seconds, nanos); +} + +util::StatusOr TimestampInternal::FromUntrustedSecondsAndNanos( + int64_t seconds, int32_t nanos) { + // The Timestamp ctor will assert if we provide values outside the valid + // range. However, since we're decoding, a single corrupt byte could cause + // this to occur, so we'll verify the ranges before passing them in since we'd + // rather not abort in these situations. + if (seconds < Min().seconds()) { + return util::Status( + firestore::Error::kErrorInvalidArgument, + "Invalid message: timestamp beyond the earliest supported date"); + } else if (Max().seconds() < seconds) { + return util::Status( + firestore::Error::kErrorInvalidArgument, + "Invalid message: timestamp beyond the latest supported date"); + } else if (nanos < 0 || nanos > 999999999) { + return util::Status( + firestore::Error::kErrorInvalidArgument, + "Invalid message: timestamp nanos must be between 0 and 999999999"); + } + + return Timestamp(seconds, nanos); +} + +size_t TimestampInternal::Hash(const Timestamp& timestamp) { + return util::Hash(timestamp.seconds(), timestamp.nanoseconds()); +} + +Timestamp TimestampInternal::Truncate(const Timestamp& timestamp) { + int32_t truncated_nanos = timestamp.nanoseconds() / 1000 * 1000; + return Timestamp(timestamp.seconds(), truncated_nanos); +} + +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h new file mode 100644 index 0000000..ee50665 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h @@ -0,0 +1,64 @@ +/* + * 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_TIMESTAMP_INTERNAL_H_ +#define FIRESTORE_CORE_SRC_TIMESTAMP_INTERNAL_H_ + +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/time/time.h" + +namespace firebase { + +/** + * Details about the Timestamp class which are useful internally, but we don't + * want to expose publicly. + */ +class TimestampInternal { + public: + /** + * Represents the maximum allowable time that the Timestamp class handles, + * specifically 9999-12-31T23:59:59.999999999Z. + */ + static firebase::Timestamp Max() { + return {253402300800L - 1, 999999999}; + } + + /** + * Represents the minimum allowable time that the Timestamp class handles, + * specifically 0001-01-01T00:00:00Z. + */ + static firebase::Timestamp Min() { + return {-62135596800L, 0}; + } + + static firestore::util::StatusOr FromUntrustedTime( + absl::Time time); + static firestore::util::StatusOr + FromUntrustedSecondsAndNanos(int64_t seconds, int32_t nanos); + + static size_t Hash(const Timestamp& timestamp); + + /** + * Truncates the input timestamp to microsecond precision to match backend + * behavior. + */ + static Timestamp Truncate(const Timestamp& timestamp); +}; + +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_TIMESTAMP_INTERNAL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc new file mode 100644 index 0000000..275cf40 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc @@ -0,0 +1,198 @@ +/* + * 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_); + 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) { + std::lock_guard lock(mutex_); + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h new file mode 100644 index 0000000..f35d9f7 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h @@ -0,0 +1,248 @@ +/* + * 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 5 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. The health check is used to mark + * a stream healthy if it has not received an error during its initial setup. + */ + ListenStreamIdle, + ListenStreamConnectionBackoff, + WriteStreamIdle, + WriteStreamConnectionBackoff, + HealthCheckTimeout, + + /** + * 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc new file mode 100644 index 0000000..90948ab --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc @@ -0,0 +1,59 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/autoid.h" + +#include +#include + +#include "Firestore/core/src/util/secure_random.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +const int kAutoIdLength = 20; +const char kAutoIdAlphabet[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +SecureRandom& GetSharedRandom() { + static auto* shared_random = new SecureRandom(); + return *shared_random; +} + +} // namespace + +std::string CreateAutoId() { + std::string auto_id; + auto_id.reserve(kAutoIdLength); + + // -2 here because: + // * sizeof(kAutoIdAlphabet) includes the trailing null terminator + // * uniform_int_distribution is inclusive on both sizes + std::uniform_int_distribution letters(0, sizeof(kAutoIdAlphabet) - 2); + + SecureRandom& shared_random = GetSharedRandom(); + for (int i = 0; i < kAutoIdLength; i++) { + int rand_index = letters(shared_random); + auto_id.append(1, kAutoIdAlphabet[rand_index]); + } + return auto_id; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h new file mode 100644 index 0000000..d7b63d2 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h @@ -0,0 +1,33 @@ +/* + * 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_AUTOID_H_ +#define FIRESTORE_CORE_SRC_UTIL_AUTOID_H_ + +#include + +namespace firebase { +namespace firestore { +namespace util { + +// Generates a random ID suitable for use as a document ID. +std::string CreateAutoId(); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_AUTOID_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.cc new file mode 100644 index 0000000..d2b2bec --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.h new file mode 100644 index 0000000..1f26077 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc new file mode 100644 index 0000000..5c5e988 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc @@ -0,0 +1,43 @@ +/* + * 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/util/bits.h" + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace util { + +int Bits::Log2Floor_Portable(uint32_t n) { + if (n == 0) return -1; + int log = 0; + uint32_t value = n; + for (int i = 4; i >= 0; --i) { + int shift = (1 << i); + uint32_t x = value >> shift; + if (x != 0) { + value = x; + log += shift; + } + } + HARD_ASSERT(value == 1); + return log; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/bits.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/bits.h new file mode 100644 index 0000000..3346f62 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream.h new file mode 100644 index 0000000..5ed6ba6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream.h @@ -0,0 +1,104 @@ +/* + * Copyright 2021 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_BYTE_STREAM_H_ +#define FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_H_ + +#include +#include +#include + +#include "Firestore/core/src/util/statusor.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Represents results from read operations on a `ByteStream`. + */ +class StreamReadResult { + public: + StreamReadResult(StatusOr result, bool eof) + : result_(std::move(result)), eof_(eof) { + } + + /** Returns whether the `ByteStream` instance has reached to the end. */ + bool eof() const { + return eof_; + } + + /** Whether the read operation is successful. */ + bool ok() const { + return result_.ok(); + } + + const Status& status() const { + return result_.status(); + } + + const std::string& ValueOrDie() const& { + return result_.ValueOrDie(); + } + + std::string& ValueOrDie() & { + return result_.ValueOrDie(); + } + + const std::string&& ValueOrDie() const&& { + return std::move(result_).ValueOrDie(); + } + + std::string&& ValueOrDie() && { + return std::move(result_).ValueOrDie(); + } + + private: + StatusOr result_; + bool eof_ = false; +}; + +/** + * A class representing byte streams, providing interfaces for stream reading + * on top of potentially different stream implementations: NSInputStream, + * istream, etc. + */ +class ByteStream { + public: + virtual ~ByteStream() = default; + + /** + * Reads until either a specified (`delim`) character is encountered, or the + * `max_length` number of bytes has been read, or the end of stream has been + * reached. + * + * Note in the case when `delim` is encountered, the `delim` character is not + * read after this operation, and will be the first character for the next + * read operation. + */ + virtual StreamReadResult ReadUntil(char delim, size_t max_length) = 0; + + /** + * Reads until the `max_length` number of bytes has been read, or the end of + * stream has been reached. + */ + virtual StreamReadResult Read(size_t max_length) = 0; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.h new file mode 100644 index 0000000..04d734c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.h @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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_BYTE_STREAM_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_APPLE_H_ + +#if !defined(__OBJC__) +#error "This header only supports Objective-C++." +#endif // !defined(__OBJC__) + +#import + +#include +#include + +#include "Firestore/core/src/util/byte_stream.h" + +namespace firebase { +namespace firestore { +namespace util { + +class ByteStreamApple : public ByteStream { + public: + explicit ByteStreamApple(NSInputStream* input) : input_(input) { + if ([input_ streamStatus] == NSStreamStatusNotOpen) { + [input_ open]; + } + } + + StreamReadResult ReadUntil(char delim, size_t max_length) override; + StreamReadResult Read(size_t max_length) override; + + private: + StreamReadResult ConsumeBuffer(); + StreamReadResult ErrorResult(); + bool eof() const; + int32_t ReadToBuffer(size_t max_length); + + NSInputStream* input_ = nullptr; + std::string buffer_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.mm new file mode 100644 index 0000000..71ad080 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_apple.mm @@ -0,0 +1,122 @@ +/* + * Copyright 2021 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/byte_stream_apple.h" + +#include +#include +#include + +#include "Firestore/core/src/util/string_apple.h" +#include "Firestore/core/src/util/string_util.h" + +namespace firebase { +namespace firestore { +namespace util { + +StreamReadResult ByteStreamApple::ReadUntil(char delim, size_t max_length) { + size_t found_at = std::string::npos; + size_t last_pos = 0; + while (buffer_.size() < max_length) { + auto read = ReadToBuffer(max_length - buffer_.size()); + if (read < 0) { + return ErrorResult(); + } + + found_at = buffer_.find(delim, last_pos); + last_pos = buffer_.size(); + if (found_at != std::string::npos || read == 0) { + break; + } + } + + // Still not found, or the buffer happens to be of the sized as requested. + // Either way, return the whole `buffer_` and clear it. + if (found_at == std::string::npos && buffer_.size() == max_length) { + return ConsumeBuffer(); + } + + // Either we found the delim, or the buffer is already larger then requested, + // the result will be a substring here. + auto end_pos = std::min(max_length, found_at); + std::string result = buffer_.substr(0, end_pos); + buffer_.erase(0, end_pos); + StreamReadResult read_result(std::move(result), eof()); + return read_result; +} + +StreamReadResult ByteStreamApple::Read(size_t max_length) { + // Serve from buffer_ + if (buffer_.size() > max_length) { + std::string result = buffer_.substr(0, max_length); + buffer_.erase(0, max_length); + StreamReadResult read_result(std::move(result), eof()); + return read_result; + } + + auto read = ReadToBuffer(max_length - buffer_.size()); + if (read < 0) { + return ErrorResult(); + } + + return ConsumeBuffer(); +} + +int32_t ByteStreamApple::ReadToBuffer(size_t max_length) { + std::string result(max_length + 1, '\0'); + auto* data_ptr = reinterpret_cast(&result[0]); + NSInteger read = [input_ read:data_ptr maxLength:max_length]; + + if (read > 0) { + buffer_.append(result.substr(0, static_cast(read))); + } + + return static_cast(read); +} + +StreamReadResult ByteStreamApple::ConsumeBuffer() { + // NSInputStream does not have consistent behavior with streamStatus, we + // perform a "peek" operation here to match with C++ istream implementation, + // and make the behavior deterministic. + char peek_result = '\0'; + auto* data_ptr = reinterpret_cast(&peek_result); + NSInteger read = [input_ read:data_ptr maxLength:1]; + + bool is_eof = (read == 0); + StreamReadResult read_result(std::move(buffer_), is_eof); + + buffer_.clear(); + // If peek actually succeeds, append the read char. + if (read > 0) { + buffer_.push_back(peek_result); + } + return read_result; +} + +StreamReadResult ByteStreamApple::ErrorResult() { + return StreamReadResult( + Status::FromNSError(input_.streamError), + input_.streamStatus == NSStreamStatus::NSStreamStatusAtEnd); +} + +bool ByteStreamApple::eof() const { + return buffer_.empty() && + input_.streamStatus == NSStreamStatus::NSStreamStatusAtEnd; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.cc new file mode 100644 index 0000000..426a782 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2021 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/byte_stream_cpp.h" + +#include +#include + +#include "Firestore/core/src/util/statusor.h" + +namespace firebase { +namespace firestore { +namespace util { + +StreamReadResult ByteStreamCpp::ReadUntil(char delim, size_t max_length) { + // Fill `result` until a `{` is found. + std::string result(max_length + 1, '\0'); + input_->get(&result[0], max_length + 1, delim); + + return ToReadResult(result); +} + +StreamReadResult ByteStreamCpp::Read(size_t max_length) { + std::string result(max_length + 1, '\0'); + input_->read(&result[0], max_length); + + return ToReadResult(result); +} + +StreamReadResult ByteStreamCpp::ToReadResult(const std::string& result) { + if (input_->bad()) { + return StreamReadResult( + Status(Error::kErrorDataLoss, "Reading input stream failed with error"), + input_->eof()); + } + + // if fail() returns true while bad() returns false, it means less than + // expected characters are read, we can still continue until eof() is hit, + // so clearing failbit here. + if (input_->fail() && !input_->eof()) { + input_->clear(); + } + + // Saving the read count from reading `result`, because we are doing another + // read (peek) to determine if it is EOF yet. + auto result_read_count = input_->gcount(); + bool is_eof = input_->eof() || (input_->peek() == EOF); + return StreamReadResult( + StatusOr(result.substr(0, result_read_count)), is_eof); +} +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.h new file mode 100644 index 0000000..f746f7c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/byte_stream_cpp.h @@ -0,0 +1,53 @@ +/* + * Copyright 2021 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_BYTE_STREAM_CPP_H_ +#define FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_CPP_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/util/byte_stream.h" + +namespace firebase { +namespace firestore { +namespace util { + +class ByteStreamCpp : public ByteStream { + public: + explicit ByteStreamCpp(std::unique_ptr input) + : input_(std::move(input)) { + } + + StreamReadResult ReadUntil(char delim, size_t max_length) override; + StreamReadResult Read(size_t max_length) override; + + private: + /** + * Checks the states of `input_` and returns a `StreamReadResult` based on the + * states and the given `result` as the read result. + */ + StreamReadResult ToReadResult(const std::string& result); + + std::unique_ptr input_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_BYTE_STREAM_CPP_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc new file mode 100644 index 0000000..296d5c4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc @@ -0,0 +1,126 @@ +/* + * 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/comparison.h" + +#include +#include +#include +#include + +#include "absl/base/casts.h" + +namespace firebase { +namespace firestore { +namespace util { + +using std::isnan; + +ComparisonResult Comparator::Compare( + absl::string_view left, absl::string_view right) const { + return ComparisonResultFromInt(left.compare(right)); +} + +ComparisonResult Comparator::Compare( + const std::string& left, const std::string& right) const { + return ComparisonResultFromInt(left.compare(right)); +} + +ComparisonResult Comparator::Compare(double left, double right) const { + // NaN sorts equal to itself and before any other number. + if (left < right) { + return ComparisonResult::Ascending; + } else if (left > right) { + return ComparisonResult::Descending; + } else if (left == right) { + return ComparisonResult::Same; + } else { + // One or both left and right is NaN. + if (!isnan(right)) { + // Only left is NaN. + return ComparisonResult::Ascending; + } else if (!isnan(left)) { + // Only right is NaN. + return ComparisonResult::Descending; + } else { + // Both are NaN. + return ComparisonResult::Same; + } + } +} + +static constexpr double INT64_MIN_VALUE_AS_DOUBLE = + static_cast(std::numeric_limits::min()); + +static constexpr double INT64_MAX_VALUE_AS_DOUBLE = + static_cast(std::numeric_limits::max()); + +ComparisonResult CompareMixedNumber(double double_value, int64_t int64_value) { + // LLONG_MIN has an exact representation as double, so to check for a value + // outside the range representable by long, we have to check for strictly less + // than LLONG_MIN. Note that this also handles negative infinity. + if (double_value < INT64_MIN_VALUE_AS_DOUBLE) { + return ComparisonResult::Ascending; + } + + // LLONG_MAX has no exact representation as double (casting as we've done + // makes 2^63, which is larger than LLONG_MAX), so consider any value greater + // than or equal to the threshold to be out of range. This also handles + // positive infinity. + if (double_value >= INT64_MAX_VALUE_AS_DOUBLE) { + return ComparisonResult::Descending; + } + + // In Firestore NaN is defined to compare before all other numbers. + if (isnan(double_value)) { + return ComparisonResult::Ascending; + } + + auto double_as_int64 = static_cast(double_value); + ComparisonResult cmp = Compare(double_as_int64, int64_value); + if (cmp != ComparisonResult::Same) { + return cmp; + } + + // At this point the long representations are equal but this could be due to + // rounding. + auto int64_as_double = static_cast(int64_value); + return Compare(double_value, int64_as_double); +} + +/** Helper to normalize a double and then return the raw bits as a uint64_t. */ +uint64_t DoubleBits(double d) { + if (isnan(d)) { + d = NAN; + } + + return absl::bit_cast(d); +} + +bool DoubleBitwiseEquals(double left, double right) { + return DoubleBits(left) == DoubleBits(right); +} + +size_t DoubleBitwiseHash(double d) { + uint64_t bits = DoubleBits(d); + // Note that x ^ (x >> 32) works fine for both 32 and 64 bit definitions of + // size_t + return static_cast(bits) ^ static_cast(bits >> 32); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h new file mode 100644 index 0000000..01092e5 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h @@ -0,0 +1,386 @@ +/* + * 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_COMPARISON_H_ +#define FIRESTORE_CORE_SRC_UTIL_COMPARISON_H_ + +#if __OBJC__ +#import +#endif + +#include + +#include +#include +#include +#include +#include + +#include "absl/meta/type_traits.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * An enumeration describing the result of a three-way comparison among + * strongly-ordered values (i.e. where comparison between values always yields + * less-than, equal-to, or greater-than). + * + * This is equivalent to: + * + * * NSComparisonResult from the iOS/macOS Foundation framework. + * * std::strong_ordering from C++20 + * + * The values of the constants are specifically chosen so as to make casting + * between this type and NSComparisonResult possible. + */ +enum class ComparisonResult { + /** The left hand side was less than the right. */ + Ascending = -1, + + /** The left hand side was equal to the right. */ + Same = 0, + + /** The left hand side was greater than the right. */ + Descending = 1 +}; + +constexpr bool Ascending(ComparisonResult result) noexcept { + return result == ComparisonResult::Ascending; +} + +constexpr bool Same(ComparisonResult result) noexcept { + return result == ComparisonResult::Same; +} + +constexpr bool Descending(ComparisonResult result) noexcept { + return result == ComparisonResult::Descending; +} + +/** + * Creates a ComparisonResult from a typical integer return value, where + * 0 means "same", less than zero means "ascending", and greater than zero + * means "descending". + */ +constexpr ComparisonResult ComparisonResultFromInt(int value) { + // TODO(c++14): convert this to an if statement. + return value < 0 ? ComparisonResult::Ascending + : (value > 0 ? ComparisonResult::Descending + : ComparisonResult::Same); +} + +/** + * Returns the reverse order (i.e. Ascending => Descending) etc. + */ +constexpr ComparisonResult ReverseOrder(ComparisonResult result) { + return static_cast(-static_cast(result)); +} + +#if __OBJC__ +/** + * Returns true if the given ComparisonResult and NSComparisonResult have the + * same integer values (at compile time). + */ +constexpr bool EqualValue(ComparisonResult lhs, NSComparisonResult rhs) { + return static_cast(lhs) == static_cast(rhs); +} + +static_assert(EqualValue(ComparisonResult::Ascending, NSOrderedAscending), + "Ascending invalid"); +static_assert(EqualValue(ComparisonResult::Same, NSOrderedSame), + "Same invalid"); +static_assert(EqualValue(ComparisonResult::Descending, NSOrderedDescending), + "Descending invalid"); + +/** Converts NSComparisonResult to ComparisonResult. */ +constexpr ComparisonResult MakeComparisonResult(NSComparisonResult value) { + return static_cast(value); +} + +/** Converts ComparisonResult to NSComparisonResult. */ +constexpr NSComparisonResult MakeNSComparisonResult(ComparisonResult value) { + return static_cast(value); +} +#endif // __OBJC__ + +/** + * A generalized comparator for types in Firestore, with ordering defined + * according to Firestore's semantics. + * + * How a given type is compared depends on the type itself: + * + * - (Objective-C++-only) If T* is an Objective-C object pointer then + * invokes the `-compare:` member. Note that if T does not actually define + * `-compare:` this will fail. This is unconditional this way because no + * other alternative is valid for pointer types. + * + * - If T defines a `CompareTo(T) const` member function, then Compare will + * invoke `lhs.CompareTo(rhs)`. + * + * - Otherwise, invokes `DefaultCompare(lhs, rhs)`. + */ +template +struct Comparator; + +template +struct DefaultComparator { + ComparisonResult Compare(const T& left, const T& right) const { + if (left < right) { + return ComparisonResult::Ascending; + } else if (right < left) { + return ComparisonResult::Descending; + } else { + return ComparisonResult::Same; + } + } +}; + +/** Compares two strings. */ +template <> +struct Comparator { + ComparisonResult Compare(absl::string_view left, + absl::string_view right) const; +}; + +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; +}; + +/** Compares two bools: false < true. */ +template <> +struct Comparator : public DefaultComparator {}; + +/** Compares two int32_t. */ +template <> +struct Comparator : public DefaultComparator {}; + +/** Compares two int64_t. */ +template <> +struct Comparator : public DefaultComparator {}; + +/** Compares two doubles (using Firestore semantics for NaN). */ +template <> +struct Comparator { + ComparisonResult Compare(double left, double right) const; +}; + +/** + * Perform a three-way comparison between the left and right values using + * the appropriate Comparator for the values based on their type. + * + * Essentially a shortcut for Comparator().Compare(left, right), where + * Comparator is default constructible. + */ +template > +ComparisonResult Compare(const T& left, + const T& right, + const C& comparator = C()) { + return comparator.Compare(left, right); +} + +#if __OBJC__ +/** + * Performs a three-way comparison, identically to Compare, but converts the + * result to an NSComparisonResult. + * + * This function exists for interoperation with Objective-C++ and should + * eventually be removed. + */ +template +inline NSComparisonResult WrapCompare(const T& left, const T& right) { + return MakeNSComparisonResult(Compare(left, right)); +} +#endif // __OBJC__ + +namespace impl { + +/** + * Checks wither the type T has a `CompareTo` member. + */ +template > +struct has_compare_to : public std::false_type {}; + +template +struct has_compare_to< + T, + absl::void_t().CompareTo(std::declval()))>> + : public std::true_type {}; + +/** + * Implements ranked choice among overloads below. + */ +template +struct CompareChoice : CompareChoice {}; + +template <> +struct CompareChoice<2> {}; + +// Use a `CompareTo` member, if available +template ::value>> +ComparisonResult CompareImpl(const T& lhs, const T& rhs, CompareChoice<1>) { + return lhs.CompareTo(rhs); +} + +// Otherwise, fall back on less than. +template +ComparisonResult CompareImpl(const T& lhs, const T& rhs, CompareChoice<2>) { + DefaultComparator comparator; + return comparator.Compare(lhs, rhs); +} + +} // namespace impl + +template +struct Comparator { + ComparisonResult Compare(const T& lhs, const T& rhs) const { + return impl::CompareImpl(lhs, rhs, impl::CompareChoice<0>{}); + } +}; + +/** + * A Comparator whose behavior is defined by a std::function. + */ +template +class FunctionComparator { + public: + using ComparisonFunction = + std::function; + + explicit FunctionComparator(ComparisonFunction&& function) + : function_(std::move(function)) { + } + + ComparisonResult Compare(const T& lhs, const T& rhs) const { + return function_(lhs, rhs); + } + + private: + ComparisonFunction function_; +}; + +template +ComparisonResult CompareContainer(const T& lhs, const T& rhs) { + auto lhs_iter = lhs.begin(); + auto lhs_end = lhs.end(); + auto rhs_iter = rhs.begin(); + auto rhs_end = rhs.end(); + + while (lhs_iter != lhs_end && rhs_iter != rhs_end) { + ComparisonResult cmp = Compare(*lhs_iter, *rhs_iter); + if (!Same(cmp)) return cmp; + + ++lhs_iter; + ++rhs_iter; + } + + if (rhs_iter != rhs_end) return ComparisonResult::Ascending; + if (lhs_iter != lhs_end) return ComparisonResult::Descending; + return ComparisonResult::Same; +} + +/** Compares a double and an int64_t. */ +ComparisonResult CompareMixedNumber(double double_value, int64_t int64_value); + +/** Normalizes a double and then return the raw bits as a uint64_t. */ +uint64_t DoubleBits(double d); + +/** + * Compares the bitwise representation of two doubles, but normalizes NaN + * values. This is similar to what the backend and android clients do, including + * comparing -0.0 as not equal to 0.0. + */ +bool DoubleBitwiseEquals(double left, double right); + +/** + * Computes a bitwise hash of a double, but normalizes NaN values, suitable for + * use when using DoubleBitwiseEquals for equality. + */ +size_t DoubleBitwiseHash(double d); + +/** + * A mixin that defines all six relational operators for a type T in terms of a + * CompareTo() member. + * + * @tparam T The type that should get comparison operators. + */ +template +class Comparable { + public: + friend bool operator==(const T& lhs, const T& rhs) { + return Same(lhs.CompareTo(rhs)); + } + 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); + } +}; + +/** + * 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_UTIL_COMPARISON_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.h new file mode 100644 index 0000000..20bdad3 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.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_UTIL_COMPRESSED_MEMBER_H_ +#define FIRESTORE_CORE_SRC_UTIL_COMPRESSED_MEMBER_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +/** + * A numbered member of some other class that implements the empty + * base optimization. This makes it possible to hold a value of an + * empty type without using any space. + * + * Use by inheriting privately from CompressedMember. + */ +template ::value> +class CompressedMember : private T { + public: + CompressedMember() = default; + explicit CompressedMember(const T& t) : T(t) { + } + explicit CompressedMember(T&& t) : T(std::move(t)) { + } + + T& get() noexcept { + return *this; + } + const T& get() const noexcept { + return *this; + } +}; + +/** + * Specialization of CompressedMember for the case where the type T + * is non-empty. + */ +template +class CompressedMember { + public: + CompressedMember() = default; + explicit CompressedMember(const T& t) : value_(t) { + } + explicit CompressedMember(T&& t) : value_(std::move(t)) { + } + + T& get() noexcept { + return value_; + } + const T& get() const noexcept { + return value_; + } + + private: + T value_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_COMPRESSED_MEMBER_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/config.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/config.h new file mode 100644 index 0000000..a03227b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/defer.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/defer.h new file mode 100644 index 0000000..8782548 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h new file mode 100644 index 0000000..1a6240c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h @@ -0,0 +1,132 @@ +/* + * 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_DELAYED_CONSTRUCTOR_H_ +#define FIRESTORE_CORE_SRC_UTIL_DELAYED_CONSTRUCTOR_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +// DelayedConstructor is a wrapper around an object of type T that +// +// * stores the object of type T inline inside DelayedConstructor; +// * initially does not call T's constructor, leaving storage uninitialized; +// * calls the constructor when you call Init(); +// * provides access to the object of type T like a pointer via ->, *, and +// get(); and +// * calls T's destructor as usual. +// +// This is useful for embedding objects of type T inside Objective-C objects +// when T has no default constructor. +// +// Objective-C separates allocation from initialization which is different from +// the way C++ does it. A C++ object embedded in an Objective-C object is +// normally default constructed then assigned a value later. This doesn't work +// for classes that have no default constructor. +// +// DelayedConstructor does not count or otherwise check that Init is only +// called once. For best results call Init() from the Objective-C class's +// designated initializer. +// +// Note that DelayedConstructor makes no guarantees about the state of the +// storage backing it before Init() is called. However, Objective-C objects are +// zero filled during allocation, so as a member of an Objective-C object, the +// default state will be zero-filled. +// +// Normally this doesn't matter, but DelayedConstructor unconditionally invokes +// T's destructor, even if you don't call Init(). This may cause problems in +// Objective-C classes where the initializer is designed to return an instance +// other than self. It's best to avoid such instance switching techniques in +// combination with DelayedConstructor, but it is possible: either ensure that +// T's destructor handles the zero-filled case correctly, or call Init() before +// switching instances. +template +class DelayedConstructor { + public: + typedef T element_type; + + DelayedConstructor() = default; + + /** + * Forwards arguments to the T's constructor: calls T(args...). + * + * This overload is disabled when it might collide with copy/move. + */ + template ::type...), + void(DelayedConstructor)>::value, + int>::type = 0> + void Init(Ts&&... args) { + new (&space_.value) T(std::forward(args)...); + } + + /** + * Forwards copy and move construction for T. + */ + void Init(const T& x) { + new (&space_.value) T(x); + } + void Init(T&& x) { + new (&space_.value) T(std::move(x)); + } + + // No copying. + DelayedConstructor(const DelayedConstructor&) = delete; + DelayedConstructor& operator=(const DelayedConstructor&) = delete; + + // Pretend to be a smart pointer to T. + T& operator*() { + return *get(); + } + T* operator->() { + return get(); + } + T* get() { + return &space_.value; + } + const T& operator*() const { + return *get(); + } + const T* operator->() const { + return get(); + } + const T* get() const { + return &space_.value; + } + + private: + union Space { + /** Default constructor does nothing. */ + Space() { + } + ~Space() { + value.~T(); + } + char empty; + T value; + } space_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_DELAYED_CONSTRUCTOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/empty.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/empty.h new file mode 100644 index 0000000..825768c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/empty.h @@ -0,0 +1,37 @@ +/* + * 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_EMPTY_H_ +#define FIRESTORE_CORE_SRC_UTIL_EMPTY_H_ + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Used to represent an empty value. + */ +struct Empty { + friend bool operator==(Empty /* left */, Empty /* right */) { + return true; + } +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EMPTY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/equality.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/equality.h new file mode 100644 index 0000000..a068958 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/equality.h @@ -0,0 +1,40 @@ +/* + * 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_EQUALITY_H_ +#define FIRESTORE_CORE_SRC_UTIL_EQUALITY_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Checks if the values pointed to by two C++ pointers are equal. Two null + * pointers are also considered equal. + */ +template +bool Equals(const T& lhs, const T& rhs) { + return lhs == nullptr ? rhs == nullptr : rhs != nullptr && *lhs == *rhs; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EQUALITY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h new file mode 100644 index 0000000..82ccb0d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h @@ -0,0 +1,87 @@ +/* + * 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_ERROR_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_ERROR_APPLE_H_ + +// Everything in this header exists for compatibility with Objective-C. +#if __OBJC__ + +#import + +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/strings/string_view.h" + +NS_ASSUME_NONNULL_BEGIN + +// The Cloud Firestore error domain. Keep in sync with FIRFirestoreErrors.h. +// Exposed here to make it possible to build in CMake without bringing in the +// sources under Firestore/Source. +// clang-format off +// clang-format12 merges the next two lines. +FOUNDATION_EXPORT NSString* const FIRFirestoreErrorDomain + NS_SWIFT_NAME(FirestoreErrorDomain); +// clang-format on + +namespace firebase { +namespace firestore { +namespace util { + +// Translates a set of error_code and error_msg to an NSError. +NSError* MakeNSError(Error error_code, + const absl::string_view error_msg, + NSError* cause = nil); + +NSError* MakeNSError(const util::Status& status); + +Status MakeStatus(NSError* error); + +using VoidErrorBlock = void (^)(NSError* _Nullable error); + +util::StatusCallback MakeCallback(VoidErrorBlock _Nullable block); + +template +using VoidValueErrorBlock = void (^)(T _Nullable value, + NSError* _Nullable error); + +template +util::StatusOrCallback MakeCallback(VoidValueErrorBlock _Nullable block) { + if (block) { + return [block](StatusOr maybe_value) { + if (maybe_value.ok()) { + block(std::move(maybe_value).ValueOrDie(), nil); + } else { + block(nil, MakeNSError(std::move(maybe_value).status())); + } + }; + } else { + return [](StatusOr maybe_value) { (void)maybe_value; }; + } +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END + +#endif // __OBJC__ + +#endif // FIRESTORE_CORE_SRC_UTIL_ERROR_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm new file mode 100644 index 0000000..22aca38 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm @@ -0,0 +1,68 @@ +/* + * 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/error_apple.h" + +#include "Firestore/core/include/firebase/firestore/firestore_errors.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 +// FirebaseFirestore/Firestore/Source/Public/FIRFirestoreErrors.h +// NOLINTNEXTLINE: public constant +FOUNDATION_EXPORT NSString* const FIRFirestoreErrorDomain = + @"FIRFirestoreErrorDomain"; + +namespace firebase { +namespace firestore { +namespace util { + +// Translates a set of error_code and error_msg to an NSError. +NSError* MakeNSError(Error error_code, + absl::string_view error_msg, + NSError* cause) { + if (error_code == Error::kErrorOk) { + return nil; + } + + NSMutableDictionary* user_info = + [NSMutableDictionary dictionary]; + user_info[NSLocalizedDescriptionKey] = MakeNSString(error_msg); + if (cause) { + user_info[NSUnderlyingErrorKey] = cause; + } + + return [NSError errorWithDomain:FIRFirestoreErrorDomain + code:static_cast(error_code) + userInfo:user_info]; +} + +NSError* MakeNSError(const util::Status& status) { + return status.ToNSError(); +} + +util::StatusCallback MakeCallback(VoidErrorBlock _Nullable block) { + if (block) { + return [block](Status status) { block(MakeNSError(status)); }; + } else { + return [](Status status) { (void)status; }; + } +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc new file mode 100644 index 0000000..c6b39d0 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc @@ -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. + */ + +#include "Firestore/core/src/util/exception.h" + +#include +#include + +#include "Firestore/core/src/util/firestore_exceptions.h" +#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); + + // Always log the error -- it helps if there are any issues with the exception + // propagation mechanism and also makes sure the exception makes it into the + // log regardless of how it's handled. + LOG_ERROR("%s", what); + +#if ABSL_HAVE_EXCEPTIONS + switch (type) { + case ExceptionType::AssertionFailure: + throw FirestoreInternalError(what); + case ExceptionType::IllegalState: + // Omit descriptive text since the type already encodes the kind of error. + throw std::logic_error(message); + case ExceptionType::InvalidArgument: + // Omit descriptive text since the type already encodes the kind of error. + throw std::invalid_argument(message); + } +#else + 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h new file mode 100644 index 0000000..70c1a08 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h @@ -0,0 +1,118 @@ +/* + * 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_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/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * 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 handler 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 handler); + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.h new file mode 100644 index 0000000..1967e0c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.mm new file mode 100644 index 0000000..1f80eaa --- /dev/null +++ b/SaraAttended/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:@"%@: %@", ExceptionName(type), + MakeNSString(message)]; + std::terminate(); + } else { + @throw MakeException(type, message); // NOLINT + } +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor.h new file mode 100644 index 0000000..9f58f63 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.h new file mode 100644 index 0000000..1fe1dc9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm new file mode 100644 index 0000000..390cdba --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc new file mode 100644 index 0000000..1c85e5d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc @@ -0,0 +1,259 @@ +/* + * 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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.h new file mode 100644 index 0000000..bd411c3 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem.h new file mode 100644 index 0000000..1a1e25f --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_apple.mm new file mode 100644 index 0000000..5a6fdea --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_common.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_common.cc new file mode 100644 index 0000000..2b24bae --- /dev/null +++ b/SaraAttended/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 auto* filesystem = new 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& path) { + std::unique_ptr iter = DirectoryIterator::Create(path); + 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(path); +} + +#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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_posix.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_posix.cc new file mode 100644 index 0000000..cb6ed42 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/firestore_exceptions.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/firestore_exceptions.h new file mode 100644 index 0000000..dc70229 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/firestore_exceptions.h @@ -0,0 +1,94 @@ +/* + * 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_FIRESTORE_EXCEPTIONS_H_ +#define FIRESTORE_CORE_SRC_UTIL_FIRESTORE_EXCEPTIONS_H_ + +// Common C++ exception declarations across iOS and Android. These aren't a +// public API surface. +// +// See exception.h for how to throw exceptions in a platform-agnostic way. + +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" + +#if defined(__ANDROID__) +// Abseil does not support STLPort, so avoid their config.h here. +// +// TODO(b/163140650): Remove once the Firebase support floor moves to NDK R18. +// +// Meanwhile, NDK R16b (the current minimum) includes Clang 5.0.3 and GCC 4.9. +// While Clang supports `__cpp_exceptions` at that version, GCC does not. Both +// support `__EXCEPTIONS`. +#if __EXCEPTIONS +#define FIRESTORE_HAVE_EXCEPTIONS 1 +#endif + +#else // !defined(__ANDROID__) +// On any other supported platform, just take Abseil's word for it. +#include "absl/base/config.h" + +#if ABSL_HAVE_EXCEPTIONS +#define FIRESTORE_HAVE_EXCEPTIONS 1 +#endif +#endif // defined(__ANDROID__) + +namespace firebase { +namespace firestore { + +#if FIRESTORE_HAVE_EXCEPTIONS + +/** + * An exception thrown if Firestore encounters an unhandled error. + */ +class FirestoreException : public std::exception { + public: + FirestoreException(const std::string& message, Error code) + : message_(message), code_(code) { + } + + const char* what() const noexcept override { + return message_.c_str(); + } + + Error code() const { + return code_; + } + + private: + std::string message_; + Error code_; +}; + +/** + * An exception thrown if Firestore encounters an internal, unrecoverable error. + */ +class FirestoreInternalError : public FirestoreException { + public: + FirestoreInternalError(const std::string& message, + Error code = Error::kErrorInternal) + : FirestoreException(message, code) { + } +}; + +#endif // FIRESTORE_HAVE_EXCEPTIONS + +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_FIRESTORE_EXCEPTIONS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.cc new file mode 100644 index 0000000..4e28a55 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.h new file mode 100644 index 0000000..26941cd --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h new file mode 100644 index 0000000..36bd69f --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h @@ -0,0 +1,228 @@ +/* + * 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_HASHING_H_ +#define FIRESTORE_CORE_SRC_UTIL_HASHING_H_ + +#include +#include +#include +#include + +#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" + +namespace firebase { +namespace firestore { +namespace util { + +// This is a pretty terrible hash implementation for lack of a better one being +// readily available. It exists as a portability crutch between our existing +// Objective-C code where overriding `-isEqual:` also requires `-hash` and C++ +// where `operator==()` can be defined without defining a hash code. +// +// It's based on the recommendation in Effective Java, Item 9, wherein you +// implement composite hashes like so: +// +// size_t result = first_; +// result = 31 * result + second_; +// result = 31 * result + third_; +// // ... +// return result; +// +// This is the basis of this implementation because that's what the existing +// Objective-C code mostly does by hand. Using this implementation gets the +// same result by calling +// +// return util::Hash(first_, second_, /* ..., */ third_); +// +// TODO(wilhuff): Replace this with whatever Abseil releases. + +namespace impl { + +/** + * A type trait that identifies whether or not std::hash is available for a + * given type. + * + * This type should not be necessary since specialization failure on an + * expression like `decltype(std::hash{}(value)` should be enough to disable + * overloads that require `std::hash` to be defined but unfortunately some + * standard libraries ship with std::hash defined for all types that only + * fail later (e.g. via static_assert). One such implementation is the libc++ + * that ships with Xcode 8.3.3, which is a supported platform. + */ +template +struct has_std_hash { + // There may be other types for which std::hash is defined but they don't + // matter for our purposes. + enum { + value = std::is_arithmetic{} || std::is_pointer{} || + std::is_same{} + }; + + constexpr operator bool() const { + return value; + } +}; + +/** + * A type that's equivalent to size_t if std::hash is defined or a compile + * error otherwise. + * + * This is effectively just a safe implementation of + * `decltype(std::hash{}(std::declval()))`. + */ +template +using std_hash_type = + typename absl::enable_if_t::value, size_t>; + +/** + * Combines a hash_value with whatever accumulated state there is so far. + */ +constexpr size_t Combine(size_t state, size_t hash_value) { + return 31 * state + hash_value; +} + +/** + * Explicit ordering of hashers, allowing SFINAE without all the enable_if + * cruft. + * + * In order we try: + * * A Hash() member, if defined and the return type is an integral type + * * A `-hash` method, if dealing with an Objective-C class + * * A std::hash specialization, if available + * * A range-based specialization, valid if either of the above hold on the + * members of the range. + * + * Explicit ordering resolves the ambiguity of the case where a std::hash + * specialization is available, but the type is also a range for whose members + * std::hash is also available, e.g. with std::string. + * + * HashChoice is a recursive type, defined such that HashChoice<0> is the most + * specific type with HashChoice<1> and beyond being progressively less + * specific. This causes the compiler to prioritize the overloads with + * lower-numbered HashChoice types, allowing compilation to succeed even if + * multiple specializations match. + */ +template +struct HashChoice : HashChoice {}; + +template <> +struct HashChoice<5> {}; + +template +size_t InvokeHash(const K& value); + +/** + * Hashes the given value if it defines a Hash() member. + * + * @return The result of `value.Hash()`. + */ +template +auto RankedInvokeHash(const K& value, HashChoice<0>) -> decltype(value.Hash()) { + return value.Hash(); +} + +#if __OBJC__ + +/** + * Hashes the given value if it's of an Objective-C class (and thus defines + * `-hash`. + * + * @return The result of `[value hash]`, converted to `size_t`. + */ +template ::value>> +size_t RankedInvokeHash(const K& value, HashChoice<1>) { + return static_cast([value hash]); +} + +#endif + +/** + * Hashes the given value if it has a specialization of std::hash. + * + * @return The result of `std::hash{}(value)` + */ +template +std_hash_type RankedInvokeHash(const K& value, HashChoice<2>) { + return std::hash{}(value); +} + +/** + * Hashes the contents of the given range of values if the value_type of the + * range can be hashed. + */ +template +auto RankedInvokeHash(const Range& range, HashChoice<3>) + -> decltype(InvokeHash(*std::begin(range))) { + size_t result = 0; + size_t size = 0; + for (auto&& element : range) { + ++size; + size_t piece = InvokeHash(element); + result = Combine(result, piece); + } + size_t size_hash = InvokeHash(size); + result = Combine(result, size_hash); + return result; +} + +/** + * Hashes the contents of the given optional value, only if the underlying + * value can itself be hashed. + */ +template +auto RankedInvokeHash(const absl::optional& option, HashChoice<4>) + -> decltype(InvokeHash(*option)) { + return option ? InvokeHash(*option) : -1171; +} + +template ::value>> +size_t RankedInvokeHash(K value, HashChoice<5>) { + auto underlying = static_cast::type>(value); + return InvokeHash(underlying); +} + +template +size_t InvokeHash(const K& value) { + return RankedInvokeHash(value, HashChoice<0>{}); +} + +inline size_t HashInternal(size_t state) { + return state; +} + +template +size_t HashInternal(size_t state, const T& value, const Ts&... rest) { + state = Combine(state, InvokeHash(value)); + return HashInternal(state, rest...); +} + +} // namespace impl + +template +size_t Hash(const Ts&... values) { + return impl::HashInternal(0u, values...); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_HASHING_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h new file mode 100644 index 0000000..16a0224 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h @@ -0,0 +1,812 @@ +/* + * Copyright 2005, 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. + */ + +// Provides some iterator adaptors and views. + +#ifndef FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ +#define FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ + +#include +#include +#include + +#include "absl/base/port.h" +#include "absl/meta/type_traits.h" + +namespace firebase { +namespace firestore { +namespace util { + +namespace internal { + +// value == true if Iter prohibits modification of its pointees. +template +struct IsConstIter + : std::is_const::reference>::type> {}; + +template +struct AddConstIf : std::conditional {}; + +// SynthIterTraits propagates the constness of the 'BaseIter' iterator +// type to its own exported 'pointer' and 'reference' typedefs. +template +struct SynthIterTraits : std::iterator_traits { + private: + static constexpr bool kIterConst = IsConstIter::value; + + public: + using value_type = typename std::remove_cv::type; + using pointer = typename AddConstIf::type*; + using reference = typename AddConstIf::type&; +}; + +// PointeeSynthIterTraits is similar to SynthIterTraits, but the 'Ptr' +// parameter is a pointer-like type, and value_type is the pointee. +template +struct PointeeSynthIterTraits : std::iterator_traits { + private: + static constexpr bool kIterConst = IsConstIter::value; + + public: + using value_type = typename std::pointer_traits::element_type; + using pointer = typename AddConstIf::type*; + using reference = typename AddConstIf::type&; +}; + +// CRTP base class for generating iterator adaptors. +// 'Sub' is the derived type, and 'Policy' encodes +// all of the behavior for the adaptor. +// Policy requirements: +// - type 'underlying_iterator': the underlying iterator type. +// - type 'adapted_traits': the traits of the adaptor. +// - static 'Extract(underlying_iterator)': convert iterator to reference. +// +template +class IteratorAdaptorBase { + private: + // Everything needed from the Policy type is expressed in this section. + using Iterator = typename Policy::underlying_iterator; + using OutTraits = typename Policy::adapted_traits; + static typename OutTraits::reference Extract(const Iterator& it) { + return Policy::Extract(it); + } + + public: + using iterator_category = typename OutTraits::iterator_category; + using value_type = typename OutTraits::value_type; + using pointer = typename OutTraits::pointer; + using reference = typename OutTraits::reference; + using difference_type = typename OutTraits::difference_type; + + IteratorAdaptorBase() : it_() { + } + // NOLINTNEXTLINE(runtime/explicit) + IteratorAdaptorBase(Iterator it) : it_(it) { + } + + Sub& sub() { + return static_cast(*this); + } + const Sub& sub() const { + return static_cast(*this); + } + + const Iterator& base() const { + return it_; + } + + reference get() const { + return Extract(base()); + } + reference operator*() const { + return get(); + } + pointer operator->() const { + return &get(); + } + reference operator[](difference_type d) const { + return *(sub() + d); + } + + Sub& operator++() { + ++it_; + return sub(); + } + Sub& operator--() { + --it_; + return sub(); + } + Sub operator++(int /*unused*/) { + return it_++; + } + Sub operator--(int /*unused*/) { + return it_--; + } + + Sub& operator+=(difference_type d) { + it_ += d; + return sub(); + } + Sub& operator-=(difference_type d) { + it_ -= d; + return sub(); + } + + bool operator==(Sub b) const { + return base() == b.base(); + } + bool operator!=(Sub b) const { + return base() != b.base(); + } + // These shouldn't be necessary, as implicit conversion from 'Iterator' + // should be enough to make such comparisons work. + bool operator==(Iterator b) const { + return *this == Sub(b); + } + bool operator!=(Iterator b) const { + return *this != Sub(b); + } + + friend Sub operator+(Sub it, difference_type d) { + return it.base() + d; + } + friend Sub operator+(difference_type d, Sub it) { + return it + d; + } + friend Sub operator-(Sub it, difference_type d) { + return it.base() - d; + } + friend difference_type operator-(Sub a, Sub b) { + return a.base() - b.base(); + } + + friend bool operator<(Sub a, Sub b) { + return a.base() < b.base(); + } + friend bool operator>(Sub a, Sub b) { + return a.base() > b.base(); + } + friend bool operator<=(Sub a, Sub b) { + return a.base() <= b.base(); + } + friend bool operator>=(Sub a, Sub b) { + return a.base() >= b.base(); + } + + private: + Iterator it_; +}; + +template +struct FirstPolicy { + using underlying_iterator = It; + using adapted_traits = + SynthIterTraits::value_type::first_type>; + static typename adapted_traits::reference Extract( + const underlying_iterator& it) { + return it->first; + } +}; + +template +struct SecondPolicy { + using underlying_iterator = It; + using adapted_traits = + SynthIterTraits::value_type::second_type>; + static typename adapted_traits::reference Extract( + const underlying_iterator& it) { + return it->second; + } +}; + +template +struct SecondPtrPolicy { + using underlying_iterator = It; + using adapted_traits = + PointeeSynthIterTraits::value_type::second_type>; + static typename adapted_traits::reference Extract( + const underlying_iterator& it) { + return *it->second; + } +}; + +template +struct PtrPolicy { + using underlying_iterator = It; + using adapted_traits = PointeeSynthIterTraits< + underlying_iterator, + typename std::iterator_traits::value_type>; + static typename adapted_traits::reference Extract( + const underlying_iterator& it) { + return **it; + } +}; + +} // namespace internal + +// In both iterator adaptors, iterator_first<> and iterator_second<>, +// we build a new iterator based on a parameterized iterator type, "It". +// The value type, "Val" is determined by "It::value_type::first" or +// "It::value_type::second", respectively. + +// iterator_first<> adapts an iterator to return the first value of a pair. +// It is equivalent to calling it->first on every value. +// Example: +// +// hash_map values; +// values["foo"] = 1; +// values["bar"] = 2; +// for (iterator_first::iterator> x = values.begin(); +// x != values.end(); ++x) { +// printf("%s", x->c_str()); +// } +template +struct iterator_first + : internal::IteratorAdaptorBase, + internal::FirstPolicy> { + using Base = internal::IteratorAdaptorBase, + internal::FirstPolicy>; + iterator_first() { + } + iterator_first(It it) // NOLINT(runtime/explicit) + : Base(it) { + } + template + iterator_first(iterator_first o) // NOLINT(runtime/explicit) + : Base(o.base()) { + } +}; + +template +iterator_first make_iterator_first(It it) { + return iterator_first(it); +} + +// iterator_second<> adapts an iterator to return the second value of a pair. +// It is equivalent to calling it->second on every value. +// Example: +// +// hash_map values; +// values["foo"] = 1; +// values["bar"] = 2; +// for (iterator_second::iterator> x = values.begin(); +// x != values.end(); ++x) { +// int v = *x; +// printf("%d", v); +// } +template +struct iterator_second + : internal::IteratorAdaptorBase, + internal::SecondPolicy> { + using Base = internal::IteratorAdaptorBase, + internal::SecondPolicy>; + iterator_second() { + } + iterator_second(It it) // NOLINT(runtime/explicit) + : Base(it) { + } + template + iterator_second(iterator_second o) // NOLINT(runtime/explicit) + : Base(o.base()) { + } +}; + +template +iterator_second make_iterator_second(It it) { + return iterator_second(it); +} + +// iterator_second_ptr<> adapts an iterator to return the dereferenced second +// value of a pair. +// It is equivalent to calling *it->second on every value. +// The same result can be achieved by composition +// iterator_ptr > +// Can be used with maps where values are regular pointers or pointers wrapped +// into linked_ptr. This iterator adaptor can be used by classes to give their +// clients access to some of their internal data without exposing too much of +// it. +// +// Example: +// class MyClass { +// public: +// MyClass(const string& s); +// string DebugString() const; +// }; +// typedef hash_map > MyMap; +// typedef iterator_second_ptr MyMapValuesIterator; +// MyMap values; +// values["foo"].reset(new MyClass("foo")); +// values["bar"].reset(new MyClass("bar")); +// for (MyMapValuesIterator it = values.begin(); it != values.end(); ++it) { +// printf("%s", it->DebugString().c_str()); +// } +template +struct iterator_second_ptr + : internal::IteratorAdaptorBase, + internal::SecondPtrPolicy> { + using Base = internal::IteratorAdaptorBase, + internal::SecondPtrPolicy>; + iterator_second_ptr() { + } + iterator_second_ptr(It it) // NOLINT(runtime/explicit) + : Base(it) { + } + template + iterator_second_ptr(iterator_second_ptr o) // NOLINT(runtime/explicit) + : Base(o.base()) { + } +}; + +template +iterator_second_ptr make_iterator_second_ptr(It it) { + return iterator_second_ptr(it); +} + +// iterator_ptr<> adapts an iterator to return the dereferenced value. +// With this adaptor you can write *it instead of **it, or it->something instead +// of (*it)->something. +// Can be used with vectors and lists where values are regular pointers +// or pointers wrapped into linked_ptr. This iterator adaptor can be used by +// classes to give their clients access to some of their internal data without +// exposing too much of it. +// +// Example: +// class MyClass { +// public: +// MyClass(const string& s); +// string DebugString() const; +// }; +// typedef vector > MyVector; +// typedef iterator_ptr DereferencingIterator; +// MyVector values; +// values.push_back(make_linked_ptr(new MyClass("foo"))); +// values.push_back(make_linked_ptr(new MyClass("bar"))); +// for (DereferencingIterator it = values.begin(); it != values.end(); ++it) { +// printf("%s", it->DebugString().c_str()); +// } +// +// Without iterator_ptr you would have to do (*it)->DebugString() +template +struct iterator_ptr : internal::IteratorAdaptorBase, + internal::PtrPolicy> { + using Base = internal::IteratorAdaptorBase, + internal::PtrPolicy>; + iterator_ptr() { + } + iterator_ptr(It it) // NOLINT(runtime/explicit) + : Base(it) { + } + template + iterator_ptr(iterator_ptr o) // NOLINT(runtime/explicit) + : Base(o.base()) { + } +}; + +template +iterator_ptr make_iterator_ptr(It it) { + return iterator_ptr(it); +} + +namespace internal { + +// Template that uses SFINAE to inspect Container abilities: +// . Set has_size_type true, iff T::size_type is defined +// . Define size_type as T::size_type if defined, or size_t otherwise +template +struct container_traits { + private: + // Test for availability of C::size_type. + template + struct test_size_type : std::false_type {}; + template + struct test_size_type> + : std::true_type {}; + + // Conditional provisioning of a size_type which defaults to size_t. + template + struct size_type_def { + using type = typename U::size_type; + }; + template + struct size_type_def { + using type = size_t; + }; + + public: + // Determine whether C::size_type is available. + static const bool has_size_type = test_size_type::value; + + // Provide size_type as either C::size_type if available, or as size_t. + using size_type = typename size_type_def::type; +}; + +template +struct IterGenerator { + using container_type = C; + using iterator = typename C::iterator; + using const_iterator = typename C::const_iterator; + + static iterator begin(container_type& c) { // NOLINT(runtime/references) + return c.begin(); + } + static iterator end(container_type& c) { // NOLINT(runtime/references) + return c.end(); + } + static const_iterator begin(const container_type& c) { + return c.begin(); + } + static const_iterator end(const container_type& c) { + return c.end(); + } +}; + +template +struct ReversingIterGeneratorAdaptor { + using container_type = typename SubIterGenerator::container_type; + using iterator = std::reverse_iterator; + using const_iterator = + std::reverse_iterator; + + static iterator begin(container_type& c) { // NOLINT(runtime/references) + return iterator(SubIterGenerator::end(c)); + } + static iterator end(container_type& c) { // NOLINT(runtime/references) + return iterator(SubIterGenerator::begin(c)); + } + static const_iterator begin(const container_type& c) { + return const_iterator(SubIterGenerator::end(c)); + } + static const_iterator end(const container_type& c) { + return const_iterator(SubIterGenerator::begin(c)); + } +}; + +// C: the container type +// Iter: the type of mutable iterator to generate +// ConstIter: the type of constant iterator to generate +// IterGenerator: a policy type that returns native iterators from a C +template > +class iterator_view_helper { + public: + using container_type = C; + using iterator = Iter; + using const_iterator = ConstIter; + using value_type = typename std::iterator_traits::value_type; + using size_type = typename internal::container_traits::size_type; + + explicit iterator_view_helper( + container_type& c) // NOLINT(runtime/references) + : c_(&c) { + } + + iterator begin() { + return iterator(IterGenerator::begin(container())); + } + iterator end() { + return iterator(IterGenerator::end(container())); + } + const_iterator begin() const { + return const_iterator(IterGenerator::begin(container())); + } + const_iterator end() const { + return const_iterator(IterGenerator::end(container())); + } + const_iterator cbegin() const { + return begin(); + } + const_iterator cend() const { + return end(); + } + const container_type& container() const { + return *c_; + } + container_type& container() { + return *c_; + } + + bool empty() const { + return begin() == end(); + } + size_type size() const { + return c_->size(); + } + + private: + container_type* c_; +}; + +template > +class const_iterator_view_helper { + public: + using container_type = C; + using const_iterator = ConstIter; + using value_type = typename std::iterator_traits::value_type; + using size_type = typename internal::container_traits::size_type; + + explicit const_iterator_view_helper(const container_type& c) : c_(&c) { + } + + // Allow implicit conversion from the corresponding iterator_view_helper. + // Erring on the side of constness should be allowed. E.g.: + // MyMap m; + // key_view_type::type keys = key_view(m); // ok + // key_view_type::type const_keys = key_view(m); // ok + template + const_iterator_view_helper(const iterator_view_helper& v) + : c_(&v.container()) { + } + + const_iterator begin() const { + return const_iterator(IterGenerator::begin(container())); + } + const_iterator end() const { + return const_iterator(IterGenerator::end(container())); + } + const_iterator cbegin() const { + return begin(); + } + const_iterator cend() const { + return end(); + } + const container_type& container() const { + return *c_; + } + + bool empty() const { + return begin() == end(); + } + size_type size() const { + return c_->size(); + } + + private: + const container_type* c_; +}; + +} // namespace internal + +// Note: The views like value_view, key_view should be in gtl namespace. +// Currently there are lot of callers that reference the methods in the global +// namespace. +// +// Traits to provide a typedef abstraction for the return value +// of the key_view() and value_view() functions, such that +// they can be declared as: +// +// template key_view_t key_view(C& c); +// template value_view_t value_view(C& c); +// +// This abstraction allows callers of these functions to use readable +// type names, and allows the maintainers of iterator_adaptors.h to +// change the return types if needed without updating callers. + +template +struct key_view_type { + using type = internal::iterator_view_helper< + C, + iterator_first, + iterator_first>; +}; + +template +struct key_view_type { + using type = internal:: + const_iterator_view_helper>; +}; + +template +struct value_view_type { + using type = internal::iterator_view_helper< + C, + iterator_second, + iterator_second>; +}; + +template +struct value_view_type { + using type = internal::const_iterator_view_helper< + C, + iterator_second>; +}; + +// The key_view and value_view functions provide pretty ways to iterate either +// the keys or the values of a map using range based for loops. +// +// Example: +// hash_map my_map; +// ... +// for (string val : value_view(my_map)) { +// ... +// } +// +// Note: If you pass a temporary container to key_view or value_view, be careful +// that the temporary container outlives the wrapper view to avoid dangling +// references. +// This is fine: PublishAll(value_view(Make()); +// This is not: for (const auto& v : value_view(Make())) Publish(v); + +template +typename key_view_type::type key_view( + C& map) { // NOLINT(runtime/references) + return typename key_view_type::type(map); +} + +template +typename key_view_type::type key_view(const C& map) { + return typename key_view_type::type(map); +} + +template +typename value_view_type::type value_view( + C& map) { // NOLINT(runtime/references) + return typename value_view_type::type(map); +} + +template +typename value_view_type::type value_view(const C& map) { + return typename value_view_type::type(map); +} + +// Abstract container view that dereferences the pointer-like .second member +// of a container's std::pair elements, such as the elements of std::map +// or of std::vector>. +// +// Example: +// map elements; +// for (const string& element : deref_second_view(elements)) { +// ... +// } +// +// Note: If you pass a temporary container to deref_second_view, be careful that +// the temporary container outlives the deref_second_view to avoid dangling +// references. +// This is fine: PublishAll(deref_second_view(Make()); +// This is not: for (const auto& v : deref_second_view(Make())) { +// Publish(v); +// } + +template +struct deref_second_view_type { + using type = internal::iterator_view_helper< + C, + iterator_second_ptr, + iterator_second_ptr>; +}; + +template +struct deref_second_view_type { + using type = internal::const_iterator_view_helper< + C, + iterator_second_ptr>; +}; + +template +typename deref_second_view_type::type deref_second_view( + C& map) { // NOLINT(runtime/references) + return typename deref_second_view_type::type(map); +} + +template +typename deref_second_view_type::type deref_second_view(const C& map) { + return typename deref_second_view_type::type(map); +} + +// Abstract container view that dereferences pointer elements. +// +// Example: +// vector elements; +// for (const string& element : deref_view(elements)) { +// ... +// } +// +// Note: If you pass a temporary container to deref_view, be careful that the +// temporary container outlives the deref_view to avoid dangling references. +// This is fine: PublishAll(deref_view(Make()); +// This is not: for (const auto& v : deref_view(Make())) { Publish(v); } + +template +struct deref_view_type { + using type = + internal::iterator_view_helper, + iterator_ptr>; +}; + +template +struct deref_view_type { + using type = internal:: + const_iterator_view_helper>; +}; + +template +typename deref_view_type::type deref_view( + C& c) { // NOLINT(runtime/references) + return typename deref_view_type::type(c); +} + +template +typename deref_view_type::type deref_view(const C& c) { + return typename deref_view_type::type(c); +} + +// Abstract container view that iterates backwards. +// +// Example: +// vector elements; +// for (const string& element : reversed_view(elements)) { +// ... +// } +// +// Note: If you pass a temporary container to reversed_view_type, be careful +// that the temporary container outlives the reversed_view to avoid dangling +// references. This is fine: PublishAll(reversed_view(Make()); +// This is not: for (const auto& v : reversed_view(Make())) { Publish(v); } + +template +struct reversed_view_type { + private: + using policy = + internal::ReversingIterGeneratorAdaptor>; + + public: + using type = internal::iterator_view_helper; +}; + +template +struct reversed_view_type { + private: + using policy = + internal::ReversingIterGeneratorAdaptor>; + + public: + using type = internal:: + const_iterator_view_helper; +}; + +template +typename reversed_view_type::type reversed_view( + C& c) { // NOLINT(runtime/references) + return typename reversed_view_type::type(c); +} + +template +typename reversed_view_type::type reversed_view(const C& c) { + return typename reversed_view_type::type(c); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/log.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/log.h new file mode 100644 index 0000000..0681eaf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm new file mode 100644 index 0000000..006fabc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm @@ -0,0 +1,95 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/log.h" + +#if defined(__APPLE__) + +#import + +#include +#include + +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" + +#include "Firestore/core/src/util/string_apple.h" + +namespace firebase { +namespace firestore { +namespace util { + +namespace { + +const FIRLoggerService kFIRLoggerFirestore = @"[Firebase/Firestore]"; + +// Translates a C++ LogLevel to the equivalent Objective-C FIRLoggerLevel +FIRLoggerLevel ToFIRLoggerLevel(LogLevel level) { + switch (level) { + case kLogLevelDebug: + return FIRLoggerLevelDebug; + case kLogLevelNotice: + return FIRLoggerLevelNotice; + case kLogLevelWarning: + return FIRLoggerLevelWarning; + case kLogLevelError: + return FIRLoggerLevelError; + default: + // Unsupported log level. FIRSetLoggerLevel will deal with it. + return static_cast(-1); + } +} + +// Actually logs a message via FIRLogger. This must be a C varargs function +// so that we can call FIRLogBasic which takes a `va_list`. +void LogMessageV(LogLevel level, NSString* format, ...) { + va_list list; + va_start(list, format); + + FIRLogBasic(ToFIRLoggerLevel(level), kFIRLoggerFirestore, @"I-FST000001", + format, list); + + va_end(list); +} + +} // namespace + +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); +} + +void LogMessage(LogLevel level, const std::string& message) { + LogMessageV(level, @"%@", MakeNSString(message)); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(__APPLE__) diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h new file mode 100644 index 0000000..20ea9d8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h @@ -0,0 +1,44 @@ +/* + * 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_NULLABILITY_H_ +#define FIRESTORE_CORE_SRC_UTIL_NULLABILITY_H_ + +namespace firebase { +namespace firestore { +namespace util { + +// Define NS_ASSUME_NONNULL_BEGIN for straight C++ so that everything gets the +// correct nullability specifier. +#if !defined(NS_ASSUME_NONNULL_BEGIN) +#if __clang__ +#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") +#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") + +#else // !__clang__ +#define NS_ASSUME_NONNULL_BEGIN +#define NS_ASSUME_NONNULL_END +#define _Nonnull +#define _Nullable + +#endif // __clang__ +#endif // !defined(NS_ASSUME_NONNULL_BEGIN) + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_NULLABILITY_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc new file mode 100644 index 0000000..81a3f50 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc @@ -0,0 +1,624 @@ +/* + * 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/util/ordered_code.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" + +#if !defined(ABSL_IS_LITTLE_ENDIAN) && !defined(ABSL_IS_BIG_ENDIAN) +#error \ + "Unsupported byte order: Either ABSL_IS_BIG_ENDIAN or " \ + "ABSL_IS_LITTLE_ENDIAN must be defined" +#endif + +#define UNALIGNED_LOAD32 ABSL_INTERNAL_UNALIGNED_LOAD32 +#define UNALIGNED_LOAD64 ABSL_INTERNAL_UNALIGNED_LOAD64 +#define UNALIGNED_STORE32 ABSL_INTERNAL_UNALIGNED_STORE32 +#define UNALIGNED_STORE64 ABSL_INTERNAL_UNALIGNED_STORE64 + +// We encode a string in different ways depending on whether the item +// should be in lexicographically increasing or decreasing order. +// +// +// Lexicographically increasing order +// +// We want a string-to-string mapping F(x) such that for any two strings +// +// x < y => F(x) < F(y) +// +// In addition to the normal characters '\x00' through '\xff', we want to +// encode a few extra symbols in strings: +// +// Separator between items +// Infinite string +// +// Therefore we need an alphabet with at least 258 symbols. Each +// character '\1' through '\xfe' is mapped to itself. The other four are +// encoded into two-letter sequences starting with '\0' and '\xff': +// +// encoded as => \0\1 +// \0 encoded as => \0\xff +// \xff encoded as => \xff\x00 +// encoded as => \xff\xff +// +// The remaining two-letter sequences starting with '\0' and '\xff' are +// currently unused. +// +// F() is defined above. For any finite string x, F(x) is the +// the encodings of x's characters followed by the encoding for . The +// ordering of two finite strings is the same as the ordering of the +// respective characters at the first position where they differ, which in +// turn is the same as the ordering of the encodings of those two +// characters. Moreover, for every finite string x, F(x) < F(). + +namespace firebase { +namespace firestore { +namespace util { + +static const char kEscape1 = '\000'; +static const char kNullCharacter = '\xff'; // Combined with kEscape1 +static const char kSeparator = '\001'; // Combined with kEscape1 + +static const char kEscape2 = '\xff'; +static const char kInfinity = '\xff'; // Combined with kEscape2 +static const char kFFCharacter = '\000'; // Combined with kEscape2 + +static const char kEscape1_Separator[2] = {kEscape1, kSeparator}; + +/** Append to "*dest" the "len" bytes starting from "*src". */ +inline static void AppendBytes(std::string* dest, const char* src, size_t len) { + dest->append(src, len); +} + +inline static bool IsSpecialByte(char c) { + return ((unsigned char)(c + 1)) < 2; +} + +/** + * Returns 0 if one or more of the bytes in the specified uint32 value + * are the special values 0 or 255, and returns 4 otherwise. The + * result of this routine can be added to "p" to either advance past + * the next 4 bytes if they do not contain a special byte, or to + * remain on this set of four bytes if they contain the next special + * byte occurrence. + * + * REQUIRES: v_32 is the value of loading the next 4 bytes from "*p" (we + * pass in v_32 rather than loading it because in some cases, the client + * may already have the value in a register: "p" is just used for + * assertion checking). + */ +inline static int AdvanceIfNoSpecialBytes(uint32_t v_32, const char* p) { + HARD_ASSERT(UNALIGNED_LOAD32(p) == v_32); + // See comments in SkipToNextSpecialByte if you wish to + // understand this expression (which checks for the occurrence + // of the special byte values 0 or 255 in any of the bytes of v_32). + if ((v_32 - 0x01010101u) & ~(v_32 + 0x01010101u) & 0x80808080u) { + // Special byte is in p[0..3] + HARD_ASSERT(IsSpecialByte(p[0]) || IsSpecialByte(p[1]) || + IsSpecialByte(p[2]) || IsSpecialByte(p[3])); + return 0; + } else { + HARD_ASSERT(!IsSpecialByte(p[0])); + HARD_ASSERT(!IsSpecialByte(p[1])); + HARD_ASSERT(!IsSpecialByte(p[2])); + HARD_ASSERT(!IsSpecialByte(p[3])); + return 4; + } +} + +/** + * Return a pointer to the first byte in the range "[start..limit)" + * whose value is 0 or 255 (kEscape1 or kEscape2). If no such byte + * exists in the range, returns "limit". + */ +inline static const char* SkipToNextSpecialByte(const char* start, + const char* limit) { + // If these constants were ever changed, this routine needs to change + static_assert(kEscape1 == 0, "bit fiddling needs readjusting"); + static_assert((kEscape2 & 0xff) == 255, "bit fiddling needs readjusting"); + const char* p = start; + while (p + 8 <= limit) { + // Find out if any of the next 8 bytes are either 0 or 255 (our + // two characters that require special handling). We do this using + // the technique described in: + // + // http://graphics.stanford.edu/~seander/bithacks.html#HasLessInWord + // + // We use the test (x + 1) < 2 to check x = 0 or -1(255) + // + // If x is a byte value (0x00..0xff): + // (x - 0x01) & 0x80 is true only when x = 0x81..0xff, 0x00 + // ~(x + 0x01) & 0x80 is true only when x = 0x00..0x7e, 0xff + // The intersection of the above two sets is x = 0x00 or 0xff. + // We can ignore carry between bytes because only x = 0x00 or 0xff + // can cause carry in the expression -- and such x already makes the + // result value non-zero. + uint64_t v = UNALIGNED_LOAD64(p); + bool hasZeroOr255Byte = (v - 0x0101010101010101ull) & + ~(v + 0x0101010101010101ull) & + 0x8080808080808080ull; + if (!hasZeroOr255Byte) { + // No special values in the next 8 bytes + p += 8; + } else { +// We know the next 8 bytes have a special byte: find it +#ifdef ABSL_IS_LITTLE_ENDIAN + uint32_t v_32 = static_cast(v); // Low 32 bits of v +#else + uint32_t v_32 = UNALIGNED_LOAD32(p); +#endif + // Test 32 bits at once to see if special byte is in next 4 bytes + // or the following 4 bytes + p += AdvanceIfNoSpecialBytes(v_32, p); + if (IsSpecialByte(p[0])) return p; + if (IsSpecialByte(p[1])) return p + 1; + if (IsSpecialByte(p[2])) return p + 2; + HARD_ASSERT(IsSpecialByte(p[3])); // Last byte must be the special one + return p + 3; + } + } + if (p + 4 <= limit) { + uint32_t v_32 = UNALIGNED_LOAD32(p); + p += AdvanceIfNoSpecialBytes(v_32, p); + } + while (p < limit && !IsSpecialByte(*p)) { + p++; + } + return p; +} + +// Expose SkipToNextSpecialByte for testing purposes +const char* OrderedCode::TEST_SkipToNextSpecialByte(const char* start, + const char* limit) { + return SkipToNextSpecialByte(start, limit); +} + +/** + * Helper routine to encode "s" and append to "*dest", escaping special + * characters. + */ +inline static void EncodeStringFragment(std::string* dest, + absl::string_view s) { + const char* p = s.data(); + const char* limit = p + s.size(); + const char* copy_start = p; + while (true) { + p = SkipToNextSpecialByte(p, limit); + if (p >= limit) break; // No more special characters that need escaping + char c = *(p++); + HARD_ASSERT(IsSpecialByte(c)); + if (c == kEscape1) { + AppendBytes(dest, copy_start, static_cast(p - copy_start) - 1); + dest->push_back(kEscape1); + dest->push_back(kNullCharacter); + copy_start = p; + } else { + HARD_ASSERT(c == kEscape2); + AppendBytes(dest, copy_start, static_cast(p - copy_start) - 1); + dest->push_back(kEscape2); + dest->push_back(kFFCharacter); + copy_start = p; + } + } + if (p > copy_start) { + AppendBytes(dest, copy_start, static_cast(p - copy_start)); + } +} + +void OrderedCode::WriteString(std::string* dest, absl::string_view s) { + EncodeStringFragment(dest, s); + AppendBytes(dest, kEscape1_Separator, 2); +} + +/** + * Return number of bytes needed to encode the non-length portion + * of val in ordered coding. Returns number in range [0,8]. + */ +static inline unsigned int OrderedNumLength(uint64_t val) { + const int lg = Bits::Log2Floor64(val); // -1 if val==0 + return static_cast(lg + 1 + 7) / 8; +} + +/** + * Append n bytes from src to *dst. + * REQUIRES: n <= 9 + * REQUIRES: src[0..8] are readable bytes (even if n is smaller) + * + * If we use string::append() instead of this routine, it increases the + * runtime of WriteNumIncreasing from ~9ns to ~13ns. + */ +static inline void AppendUpto9(std::string* dst, + const char* src, + unsigned int n) { + dst->append(src, 9); // Fixed-length append + const size_t extra = 9 - n; // How many extra bytes we added + dst->erase(dst->size() - extra, extra); +} + +void OrderedCode::WriteNumIncreasing(std::string* dest, uint64_t val) { + // Values are encoded with a single byte length prefix, followed + // by the actual value in big-endian format with leading 0 bytes + // dropped. + + // 8 bytes for value plus one byte for length. In addition, we have + // 8 extra bytes at the end so that we can have a fixed-length append + // call on *dest. + char buf[17]; + + UNALIGNED_STORE64(buf + 1, + absl::ghtonll(val)); // buf[0] may be needed for length + const unsigned int length = OrderedNumLength(val); + char* start = buf + 9 - length - 1; + *start = static_cast(length); + AppendUpto9(dest, start, length + 1); +} + +inline static void WriteInfinityInternal(std::string* dest) { + // Make an array so that we can just do one string operation for performance + static const char buf[2] = {kEscape2, kInfinity}; + dest->append(buf, 2); +} + +void OrderedCode::WriteInfinity(std::string* dest) { + WriteInfinityInternal(dest); +} + +void OrderedCode::WriteTrailingString(std::string* dest, + absl::string_view str) { + dest->append(str.data(), str.size()); +} + +/** + * Parse the encoding of a string previously encoded with or without + * inversion. If parse succeeds, return true, consume encoding from + * "*src", and if result != NULL append the decoded string to "*result". + * Otherwise, return false and leave both undefined. + */ +inline static bool ReadStringInternal(absl::string_view* src, + std::string* result) { + const char* start = src->data(); + const char* string_limit = src->data() + src->size(); + + // We only scan up to "limit-2" since a valid string must end with + // a two character terminator: 'kEscape1 kSeparator' + const char* limit = string_limit - 1; + const char* copy_start = start; + while (true) { + start = SkipToNextSpecialByte(start, limit); + if (start >= limit) break; // No terminator sequence found + const char c = *(start++); + // If inversion is required, instead of inverting 'c', we invert the + // character constants to which 'c' is compared. We get the same + // behavior but save the runtime cost of inverting 'c'. + HARD_ASSERT(IsSpecialByte(c)); + if (c == kEscape1) { + if (result) { + AppendBytes(result, copy_start, + static_cast(start - copy_start) - 1); + } + // kEscape1 kSeparator ends component + // kEscape1 kNullCharacter represents '\0' + const char next = *(start++); + if (next == kSeparator) { + src->remove_prefix(static_cast(start - src->data())); + return true; + } else if (next == kNullCharacter) { + if (result) { + *result += '\0'; + } + } else { + return false; + } + copy_start = start; + } else { + HARD_ASSERT(c == kEscape2); + if (result) { + AppendBytes(result, copy_start, + static_cast(start - copy_start) - 1); + } + // kEscape2 kFFCharacter represents '\xff' + // kEscape2 kInfinity is an error + const char next = *(start++); + if (next == kFFCharacter) { + if (result) { + *result += '\xff'; + } + } else { + return false; + } + copy_start = start; + } + } + return false; +} + +bool OrderedCode::ReadString(absl::string_view* src, std::string* result) { + return ReadStringInternal(src, result); +} + +bool OrderedCode::ReadNumIncreasing(absl::string_view* src, uint64_t* result) { + if (src->empty()) { + return false; // Not enough bytes + } + + // Decode length byte + const size_t len = static_cast((*src)[0]); + + // If len > 0 and src is longer than 1, the first byte of "payload" + // must be non-zero (otherwise the encoding is not minimal). + // In opt mode, we don't enforce that encodings must be minimal. + HARD_ASSERT(0 == len || src->size() == 1 || (*src)[1] != '\0'); + + if (len + 1 > src->size() || len > 8) { + return false; // Not enough bytes or too many bytes + } + + if (result) { + uint64_t tmp = 0; + for (size_t i = 0; i < len; i++) { + tmp <<= 8; + tmp |= static_cast((*src)[1 + i]); + } + *result = tmp; + } + src->remove_prefix(len + 1); + return true; +} + +inline static bool ReadInfinityInternal(absl::string_view* src) { + if (src->size() >= 2 && ((*src)[0] == kEscape2) && ((*src)[1] == kInfinity)) { + src->remove_prefix(2); + return true; + } else { + return false; + } +} + +bool OrderedCode::ReadInfinity(absl::string_view* src) { + return ReadInfinityInternal(src); +} + +inline static bool ReadStringOrInfinityInternal(absl::string_view* src, + std::string* result, + bool* inf) { + if (ReadInfinityInternal(src)) { + if (inf) *inf = true; + return true; + } + + // We don't use ReadStringInternal here because that would inline + // the whole encoded string parsing code here. Depending on INVERT, only + // one of the following two calls will be generated at compile time. + bool success = OrderedCode::ReadString(src, result); + if (success) { + if (inf) *inf = false; + return true; + } else { + return false; + } +} + +bool OrderedCode::ReadStringOrInfinity(absl::string_view* src, + std::string* result, + bool* inf) { + return ReadStringOrInfinityInternal(src, result, inf); +} + +bool OrderedCode::ReadTrailingString(absl::string_view* src, + std::string* result) { + if (result) result->assign(src->data(), src->size()); + src->remove_prefix(src->size()); + return true; +} + +void OrderedCode::TEST_Corrupt(std::string* str, int k) { + int seen_seps = 0; + for (size_t i = 0; i < str->size() - 1; i++) { + if ((*str)[i] == kEscape1 && (*str)[i + 1] == kSeparator) { + seen_seps++; + if (seen_seps == k) { + (*str)[i + 1] = kSeparator + 1; + return; + } + } + } +} + +// Signed number encoding/decoding ///////////////////////////////////// +// +// The format is as follows: +// +// The first bit (the most significant bit of the first byte) +// represents the sign, 0 if the number is negative and +// 1 if the number is >= 0. +// +// Any unbroken sequence of successive bits with the same value as the sign +// bit, up to 9 (the 8th and 9th are the most significant bits of the next +// byte), are size bits that count the number of bytes after the first byte. +// That is, the total length is between 1 and 10 bytes. +// +// The value occupies the bits after the sign bit and the "size bits" +// till the end of the string, in network byte order. If the number +// is negative, the bits are in 2-complement. +// +// +// Example 1: number 0x424242 -> 4 byte big-endian hex string 0xf0424242: +// +// +---------------+---------------+---------------+---------------+ +// 1 1 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 +// +---------------+---------------+---------------+---------------+ +// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +// | | | | payload: the remaining bits after the sign and size bits +// | | | | and the delimiter bit, the value is 0x424242 +// | | | | +// | size bits: 3 successive bits with the same value as the sign bit +// | (followed by a delimiter bit with the opposite value) +// | mean that there are 3 bytes after the first byte, 4 total +// | +// sign bit: 1 means that the number is non-negative +// +// Example 2: negative number -0x800 -> 2 byte big-endian hex string 0x3800: +// +// +---------------+---------------+ +// 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 +// +---------------+---------------+ +// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +// | | payload: the remaining bits after the sign and size bits and the +// | | delimiter bit, 2-complement because of the negative sign, +// | | value is ~0x7ff, represents the value -0x800 +// | | +// | size bits: 1 bit with the same value as the sign bit +// | (followed by a delimiter bit with the opposite value) +// | means that there is 1 byte after the first byte, 2 total +// | +// sign bit: 0 means that the number is negative +// +// +// Compared with the simpler unsigned format used for uint64_t numbers, +// this format is more compact for small numbers, namely one byte encodes +// numbers in the range [-64,64), two bytes cover the range [-2^13,2^13), etc. +// In general, n bytes encode numbers in the range [-2^(n*7-1),2^(n*7-1)). +// (The cross-over point for compactness of representation is 8 bytes, +// where this format only covers the range [-2^55,2^55), +// whereas an encoding with sign bit and length in the first byte and +// payload in all following bytes would cover [-2^56,2^56).) + +static const int kMaxSigned64Length = 10; + +// This array maps encoding length to header bits in the first two bytes. +static const char kLengthToHeaderBits[1 + kMaxSigned64Length][2] = { + {0, 0}, {'\x80', 0}, {'\xc0', 0}, {'\xe0', 0}, + {'\xf0', 0}, {'\xf8', 0}, {'\xfc', 0}, {'\xfe', 0}, + {'\xff', 0}, {'\xff', '\x80'}, {'\xff', '\xc0'}}; + +// This array maps encoding lengths to the header bits that overlap with +// the payload and need fixing when reading. +static const uint64_t kLengthToMask[1 + kMaxSigned64Length] = { + 0ULL, + 0x80ULL, + 0xc000ULL, + 0xe00000ULL, + 0xf0000000ULL, + 0xf800000000ULL, + 0xfc0000000000ULL, + 0xfe000000000000ULL, + 0xff00000000000000ULL, + 0x8000000000000000ULL, + 0ULL}; + +// This array maps the number of bits in a number to the encoding +// length produced by WriteSignedNumIncreasing. +// For positive numbers, the number of bits is 1 plus the most significant +// bit position (the highest bit position in a positive int64_t is 63). +// For a negative number n, we count the bits in ~n. +// That is, length = kBitsToLength[Bits::Log2Floor64(n < 0 ? ~n : n) + 1]. +static const int8_t kBitsToLength[1 + 63] = { + 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, + 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10}; + +/** Calculates the encoding length in bytes of the signed number n. */ +static inline int SignedEncodingLength(int64_t n) { + return kBitsToLength[Bits::Log2Floor64( + static_cast(n < 0 ? ~n : n)) + + 1]; +} + +/** Slightly faster version for n > 0. */ +static inline int SignedEncodingLengthPositive(int64_t n) { + return kBitsToLength[Bits::Log2FloorNonZero64(static_cast(n)) + 1]; +} + +void OrderedCode::WriteSignedNumIncreasing(std::string* dest, int64_t val) { + const int64_t x = val < 0 ? ~val : val; + if (x < 64) { // fast path for encoding length == 1 + *dest += static_cast(kLengthToHeaderBits[1][0] ^ val); + return; + } + // buf = val in network byte order, sign extended to 10 bytes + const char sign_byte = val < 0 ? '\xff' : '\0'; + char buf[10] = { + sign_byte, + sign_byte, + }; + UNALIGNED_STORE64(buf + 2, absl::ghtonll(static_cast(val))); + + HARD_ASSERT(sizeof(buf) == kMaxSigned64Length, "max length size mismatch"); + const size_t len = static_cast(SignedEncodingLengthPositive(x)); + HARD_ASSERT(len >= 2); + char* const begin = buf + sizeof(buf) - len; + begin[0] ^= kLengthToHeaderBits[len][0]; + begin[1] ^= kLengthToHeaderBits[len][1]; // ok because len >= 2 + dest->append(begin, len); +} + +bool OrderedCode::ReadSignedNumIncreasing(absl::string_view* src, + int64_t* result) { + if (src->empty()) return false; + const uint64_t xor_mask = (!((*src)[0] & 0x80)) ? ~0ULL : 0ULL; + const unsigned char first_byte = static_cast( + static_cast((*src)[0]) ^ (xor_mask & 0xff)); + + // now calculate and test length, and set x to raw (unmasked) result + size_t len; + uint64_t x; + if (first_byte != 0xff) { + len = static_cast(7 - Bits::Log2FloorNonZero(first_byte ^ 0xff)); + if (src->size() < len) return false; + x = xor_mask; // sign extend using xor_mask + for (size_t i = 0; i < len; ++i) + x = (x << 8) | static_cast((*src)[i]); + } else { + len = 8; + if (src->size() < len) return false; + const unsigned char second_byte = static_cast( + static_cast((*src)[1]) ^ (xor_mask & 0xff)); + if (second_byte >= 0x80) { + if (second_byte < 0xc0) { + len = 9; + } else { + const unsigned char third_byte = static_cast( + static_cast((*src)[2]) ^ (xor_mask & 0xff)); + if (second_byte == 0xc0 && third_byte < 0x80) { + len = 10; + } else { + return false; // either len > 10 or len == 10 and #bits > 63 + } + } + if (src->size() < len) return false; + } + x = absl::gntohll(UNALIGNED_LOAD64(src->data() + len - 8)); + } + + x ^= kLengthToMask[len]; // remove spurious header bits + + HARD_ASSERT(len == static_cast( + SignedEncodingLength(static_cast(x)))); + + if (result) *result = static_cast(x); + src->remove_prefix(static_cast(len)); + return true; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h new file mode 100644 index 0000000..edadea8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h @@ -0,0 +1,129 @@ +/* + * 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. + */ + +// This module provides routines for encoding a sequence of typed +// entities into a string. The resulting strings can be +// lexicographically compared to yield the same comparison value that +// would have been generated if the encoded items had been compared +// one by one according to their type. +// +// More precisely, suppose: +// 1. string A is generated by encoding the sequence of items [A_1..A_n] +// 2. string B is generated by encoding the sequence of items [B_1..B_n] +// 3. The types match; i.e., for all i: A_i was encoded using +// the same routine as B_i +// Then: +// Comparing A vs. B lexicographically is the same as comparing +// the vectors [A_1..A_n] and [B_1..B_n] lexicographically. +// +// Furthermore, if n < m, the encoding of [A_1..A_n] is a strict prefix of +// [A_1..A_m] (unless m = n+1 and A_m is the empty string encoded with +// WriteTrailingString, in which case the encodings are equal). +// +// This module is often useful when generating multi-part sstable +// keys that have to be ordered in a particular fashion. + +#ifndef FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ +#define FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ + +#include + +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +class OrderedCode { + public: + // ------------------------------------------------------------------- + // Encoding routines: each one of the following routines append + // one item to "*dest". The Write(Signed)NumIncreasing() and + // Write(Signed)NumDecreasing() routines differ in whether the resulting + // encoding is ordered by increasing number or decreasing number. + // Similarly, WriteString() and WriteStringDecreasing() differ in whether + // the resulting encoding is ordered by the original string in + // lexicographically increasing or decreasing order. WriteString() + // is not called WriteStringIncreasing() for convenience and backward + // compatibility. + + static void WriteString(std::string* dest, absl::string_view str); + static void WriteNumIncreasing(std::string* dest, uint64_t val); + static void WriteSignedNumIncreasing(std::string* dest, int64_t val); + + /** + * Creates an encoding for the "infinite string", a value considered to + * be lexicographically after any real string. Note that in the case of + * WriteInfinityDecreasing(), this would come before any real string as + * the ordering puts lexicographically greater values first. + */ + static void WriteInfinity(std::string* dest); + + /** + * Special string append that can only be used at the tail end of + * an encoded string -- blindly appends "str" to "*dest". + */ + static void WriteTrailingString(std::string* dest, absl::string_view str); + + // ------------------------------------------------------------------- + // Decoding routines: these extract an item earlier encoded using + // the corresponding WriteXXX() routines above. The item is read + // from "*src"; "*src" is modified to point past the decoded item; + // and if "result" is non-NULL, "*result" is modified to contain the + // result. In case of string result, the decoded string is appended to + // "*result". Returns true if the next item was read successfully, false + // otherwise. + + static bool ReadString(absl::string_view* src, std::string* result); + static bool ReadNumIncreasing(absl::string_view* src, uint64_t* result); + static bool ReadSignedNumIncreasing(absl::string_view* src, int64_t* result); + + static bool ReadInfinity(absl::string_view* src); + static bool ReadTrailingString(absl::string_view* src, std::string* result); + + /** REQUIRES: next item was encoded by WriteInfinity() or WriteString(). */ + static bool ReadStringOrInfinity(absl::string_view* src, + std::string* result, + bool* inf); + + /** + * Helper for testing: corrupt "*str" by changing the kth item separator + * in the string. + */ + static void TEST_Corrupt(std::string* str, int k); + + /** + * Helper for testing. + * SkipToNextSpecialByte is an internal routine defined in the .cc file + * with the following semantics. Return a pointer to the first byte + * in the range "[start..limit)" whose value is 0 or 255. If no such + * byte exists in the range, returns "limit". + */ + static const char* TEST_SkipToNextSpecialByte(const char* start, + const char* limit); + + // Not an instantiable class, but the class exists to make it easy to + // use with a single using statement. + OrderedCode() = delete; + OrderedCode(const OrderedCode&) = delete; + OrderedCode& operator=(const OrderedCode&) = delete; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.cc new file mode 100644 index 0000000..6affbe1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.cc @@ -0,0 +1,249 @@ +/* + * 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/path.h" + +#include + +#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" + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +#if defined(_WIN32) +constexpr Path::char_type kPreferredSeparator = L'\\'; +#else +constexpr Path::char_type kPreferredSeparator = '/'; +#endif + +/** + * Returns the offset within the given path that skips the leading drive letter. + * If there is no drive letter, returns zero. + */ +size_t OffsetAfterDriveLetter(const Path::char_type* path, size_t size) { +#if defined(_WIN32) + if (size >= 2 && path[1] == L':') { + wchar_t drive_letter = path[0]; + if (drive_letter <= 0xFF && + absl::ascii_isalpha(static_cast(drive_letter))) { + return 2; + } + } + return 0; + +#else + (void)path; + (void)size; + return 0; +#endif // defined(_WIN32) +} + +/** Returns true if the given character is a pathname separator. */ +inline bool IsSeparator(Path::char_type c) { +#if defined(_WIN32) + return c == L'/' || c == L'\\'; +#else + return c == '/'; +#endif // defined(_WIN32) +} + +bool IsAbsolute(const Path::char_type* path, size_t size) { + size_t offset = OffsetAfterDriveLetter(path, size); + return size >= offset && IsSeparator(path[offset]); +} + +size_t LastNonSeparator(const Path::char_type* path, size_t size) { + if (size == 0) return Path::npos; + + for (size_t i = size; i-- > 0;) { + if (!IsSeparator(path[i])) { + return i; + } + } + return Path::npos; +} + +size_t LastSeparator(const Path::char_type* path, size_t size) { + if (size == 0) return Path::npos; + + for (size_t i = size; i-- > 0;) { + if (IsSeparator(path[i])) { + return i; + } + } + return Path::npos; +} + +#if defined(_WIN32) +Path::string_type CanonicalPath(const Path::string_type& path) { + if (path.empty()) { + return path; + } + + // Remove trailing separators, but take care not to remove the trailing slash + // in a root path name (which can have a drive letter). + std::wstring copy{path}; + size_t rel_path_begin = OffsetAfterDriveLetter(copy.c_str(), copy.size()); + if (rel_path_begin < copy.size() && IsSeparator(copy[rel_path_begin])) { + rel_path_begin += 1; + } + + size_t non_slash = LastNonSeparator(copy.c_str(), copy.size()); + if (non_slash != Path::npos) { + size_t last_slash = std::max(non_slash + 1, rel_path_begin); + copy.resize(last_slash); + } + + // Convert separators to canonical separators. + std::replace(copy.begin(), copy.end(), L'/', kPreferredSeparator); + + // Convert to lowercase. This relies on C++11 semantics of std::basic_string, + // namely that: + // * s.c_str(), s.data(), and &s[0] are all aliases for each other; + // * strings are always contiguous and null terminated; and + // * Accessing s[s.size()] is valid and is the null terminator. + errno_t error = _wcslwr_s(©[0], copy.size() + 1); + HARD_ASSERT(error == 0); + + return copy; +} + +#else +absl::string_view CanonicalPath(const Path::string_type& path) { + size_t non_slash = LastNonSeparator(path.c_str(), path.size()); + if (non_slash == Path::npos) { + return path; + } + + return absl::string_view{path.c_str(), non_slash + 1}; +} +#endif // defined(_WIN32) + +} // namespace + +constexpr size_t Path::npos; + +Path Path::FromUtf8(absl::string_view utf8_pathname) { +#if defined(_WIN32) + return Path{Utf8ToNative(utf8_pathname)}; + +#else + return Path{std::string{utf8_pathname}}; +#endif // defined(_WIN32) +} + +#if defined(_WIN32) +Path Path::FromUtf16(const wchar_t* path, size_t size) { + return Path{string_type{path, size}}; +} +#endif + +#if defined(_WIN32) +std::string Path::ToUtf8String() const { + return NativeToUtf8(pathname_); +} +#else +const std::string& Path::ToUtf8String() const { + return pathname_; +} +#endif // defined(_WIN32) + +Path Path::Basename() const { + size_t slash = LastSeparator(c_str(), size()); + if (slash == npos) { + // No path separator found => the whole string. + return *this; + } + + // Otherwise everything after the slash is the basename (even if empty string) + size_t start = slash + 1; + return Path{pathname_.substr(start)}; +} + +Path Path::Dirname() const { + size_t last_slash = LastSeparator(c_str(), size()); + if (last_slash == npos) { + // No path separator found => empty string. Conformance with POSIX would + // have us return "." here. + return {}; + } + + // Collapse runs of slashes. + size_t non_slash = LastNonSeparator(c_str(), last_slash); + if (non_slash == npos) { + // All characters preceding the last path separator are slashes + return Path{pathname_.substr(0, 1)}; + } + + // Otherwise everything up to the slash is the parent directory + last_slash = non_slash + 1; + return Path{pathname_.substr(0, last_slash)}; +} + +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); + return result; +} + +void Path::MutableAppendSegment(const char_type* path, size_t size) { + if (util::IsAbsolute(path, size)) { + pathname_.assign(path, size); + + } else { + size_t non_slash = LastNonSeparator(pathname_.c_str(), pathname_.size()); + if (non_slash != npos) { + pathname_.resize(non_slash + 1); + pathname_.push_back(kPreferredSeparator); + } + + // If path started with a slash we'd treat it as absolute above + pathname_.append(path, size); + } +} + +void Path::MutableAppendUtf8Segment(absl::string_view path) { +#if defined(_WIN32) + Path segment = Path::FromUtf8(path); + MutableAppendSegment(segment.c_str(), segment.size()); + +#else + MutableAppendSegment(path.data(), path.size()); +#endif +} + +bool operator==(const Path& lhs, const Path& rhs) { + return CanonicalPath(lhs.pathname_) == CanonicalPath(rhs.pathname_); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.h new file mode 100644 index 0000000..27fe690 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/path.h @@ -0,0 +1,227 @@ +/* + * 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_PATH_H_ +#define FIRESTORE_CORE_SRC_UTIL_PATH_H_ + +#include +#include + +#include "Firestore/core/src/util/string_apple.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * An immutable native pathname string. Paths can be absolute or relative. Paths + * internally maintain their filesystem-native encoding. + * + * The intent of the API is that high-level code generally just uses UTF-8- + * encoded string-literals or strings for the segments and constructs a + * filesystem-native Path using APIs like Path::JoinUtf8. + * + * Lower level code may need to construct derived Paths from values obtained + * from the filesystem that already are in the right encoding. + */ +class Path { + public: +#if defined(_WIN32) + using char_type = wchar_t; +#else + using char_type = char; +#endif + + using string_type = std::basic_string; + + static constexpr size_t npos = static_cast(-1); + + /** + * Creates a new Path from a UTF-8-encoded pathname. + */ + static Path FromUtf8(absl::string_view utf8_pathname); + +#if defined(_WIN32) + /** + * Creates a new Path from a UTF-16-encoded pathname. + */ + // absl::wstring_view does not exist :-(. + static Path FromUtf16(const wchar_t* begin, size_t size); +#endif + +#if defined(__OBJC__) + /** + * Creates a new Path from the given NSString pathname. + */ + static Path FromNSString(NSString* path) { + return FromUtf8(MakeString(path)); + } +#endif + + Path() = default; + + const string_type& native_value() const { + return pathname_; + } + + const char_type* c_str() const { + return pathname_.c_str(); + } + + bool empty() const { + return pathname_.empty(); + } + + size_t size() const { + return pathname_.size(); + } + +#if defined(_WIN32) + std::string ToUtf8String() const; +#else + const std::string& ToUtf8String() const; +#endif // defined(_WIN32) + +#if defined(__OBJC__) + NSString* ToNSString() const { + return MakeNSString(native_value()); + } +#endif + + /** + * Returns a new Path containing the unqualified trailing part of this path, + * e.g. "c" for "/a/b/c". + */ + Path Basename() const; + + /** + * Returns a new Path containing the parent directory of this path, e.g. + * "/a/b" for "/a/b/c". + * + * Note: + * * Trailing slashes are treated as a separator between an empty path + * segment and the dirname, so the Dirname of "/a/b/c/" is "/a/b/c". + * * Runs of more than one slash are treated as a single separator, so + * the Dirname of "/a/b//c" is "/a/b". + * * Paths are not canonicalized, so the Dirname of "/a//b//c" is "/a//b". + */ + Path Dirname() const; + + /** + * Returns true if this Path is an absolute 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))`. + */ + Path AppendUtf8(absl::string_view path) const; + Path AppendUtf8(const char* path, size_t size) const { + return AppendUtf8(absl::string_view{path, size}); + } + +#if defined(_WIN32) + Path AppendUtf16(const wchar_t* path, size_t size) const { + Path result{*this}; + result.MutableAppendSegment(path, size); + return result; + } +#endif + + /** + * Returns the paths separated by path separators. + * + * @param base If base is of type std::string&& the result is moved from this + * value. Otherwise the first argument is copied. + * @param paths The rest of the path segments. + */ + template + static Path JoinUtf8(P1&& base, const PA&... paths) { + Path result = Path::FromUtf8(base); + result.MutableAppendUtf8(paths...); + return result; + } + + friend bool operator==(const Path& lhs, const Path& rhs); + friend bool operator!=(const Path& lhs, const Path& rhs) { + return !(lhs == rhs); + } + + private: + explicit Path(string_type&& native_pathname) + : pathname_{std::move(native_pathname)} { + } + + /** + * If `path` is relative, appends it to `*this`. If `path` is absolute, + * replaces `*this`. + */ + template + void MutableAppend(const Path& path, const P&... rest) { + MutableAppendSegment(path.c_str(), path.size()); + MutableAppend(rest...); + } + void MutableAppend() { + // Recursive base case; nothing to do. + } + void MutableAppendSegment(const char_type* path, size_t size); + + /** + * If `path` is relative, appends it to `*this`. If `path` is absolute, + * replaces `*this`. + */ + template + void MutableAppendUtf8(const P1& path, const P&... rest) { + MutableAppendUtf8Segment(path); + MutableAppendUtf8(rest...); + } + void MutableAppendUtf8Segment(absl::string_view path); + void MutableAppendUtf8Segment(const Path& path) { + // Allow existing Paths to be passed to Path::JoinUtf8. + MutableAppendSegment(path.c_str(), path.size()); + } + void MutableAppendUtf8() { + // Recursive base case; nothing to do. + } + + /** + * Returns a copy of the given path. + * + * This non-public variant of FromUtf8 allows JoinUtf8 to take a Path as its + * first argument. + */ + static Path FromUtf8(const Path& path) { + return path; + } + + string_type pathname_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_PATH_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/random_access_queue.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/random_access_queue.h new file mode 100644 index 0000000..4ce5766 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/random_access_queue.h @@ -0,0 +1,270 @@ +/* + * Copyright 2021 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_RANDOM_ACCESS_QUEUE_H_ +#define FIRESTORE_CORE_SRC_UTIL_RANDOM_ACCESS_QUEUE_H_ + +#include +#include +#include + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * A queue that provides efficient removal of arbitrary elements. + * + * Another way to think of this class is an `unordered_set` that preserves + * insertion order and provides efficient access to the "front" element and + * removal of arbitrary elements. + * + * This class is implemented by maintaining two data structures: a queue that + * keeps track of insertion order and a set that provides efficient lookup. + * As a result, this class consumes roughly twice as much memory as a plain old + * queue and each mutating operation is roughly twice as slow as a plain old + * queue since each mutation must be performed on two data structures. However, + * these costs come at the benefit of being able to test for queue membership in + * constant time and remove queue elements in amortized constant time. + * + * The template argument `T` is the type of the elements to store in the queue. + * The remaining variadic template arguments are passed as the template + * arguments to `unordered_map`, allowing custom hashing and comparison + * functions to be specified. + */ +template +class RandomAccessQueue { + public: + RandomAccessQueue() = default; + + RandomAccessQueue(const RandomAccessQueue& other) { + PushBackAll(other); + } + + RandomAccessQueue(RandomAccessQueue&& other) = default; + + RandomAccessQueue& operator=(const RandomAccessQueue& other) { + queue_.clear(); + queue_entries_by_element_.clear(); + PushBackAll(other); + return *this; + } + + RandomAccessQueue& operator=(RandomAccessQueue&& other) = default; + + /** + * Adds an element to the back of this queue, if it is not already present. + * + * Returns `true` if the given element was *not* already present in this + * queue, and therefore was added to the back, or `false` if the given element + * *was* already present in this queue, and therefore no changes were made to + * this object. + * + * This method has average constant-time complexity. + */ + bool push_back(const T& element) { + // Put the element into the map if it is not already present. The `nullptr` + // will be replaced by a pointer to the object added to the queue when it is + // added below. + auto map_emplace_result = + queue_entries_by_element_.emplace(element, nullptr); + + // Return `false` and do nothing if the given element was already present. + if (!map_emplace_result.second) { + return false; + } + + // Add the element to the queue and update the pointer in the map. + queue_.emplace_back(element); + map_emplace_result.first->second = &queue_.back(); + + // Return `true` to indicate that the element was added to the queue. + return true; + } + + /** + * Returns the element at the front of the queue. + * + * The behavior of this method is undefined if the queue is empty. + * + * This method has constant-time complexity. + */ + const T& front() const { + const QueueEntry& entry = queue_.front(); + HARD_ASSERT( + !entry.removed(), + "The front element in the queue should not be marked as \"removed\""); + return entry.element(); + } + + /** + * Removes the element at the front of the queue. + * + * The behavior of this method is undefined if the queue is empty. + * + * This method has average constant-time complexity; however, it is O(n) in + * the worst case, where `n` is the number of previously-removed elements. + */ + void pop_front() { + const T& front_element = queue_.front().element(); + queue_entries_by_element_.erase(front_element); + queue_.pop_front(); + PruneLeadingQueueEntries(); + } + + /** + * Removes the given element from the queue, if it is present. + * + * Returns `true` if the given element was found in the queue and removed, or + * `false` if the given element was *not* found in the queue and therefore no + * changes were made to this object. + * + * This method has average constant-time complexity; however, it is O(n) in + * the worst case, where the front element is removed and `n` is the number of + * previously-removed elements. + */ + bool remove(const T& element) { + auto it = queue_entries_by_element_.find(element); + if (it == queue_entries_by_element_.end()) { + return false; + } + it->second->set_removed(); + queue_entries_by_element_.erase(it); + PruneLeadingQueueEntries(); + return true; + } + + /** + * Returns whether or not this queue is empty. + * + * This method has constant-time complexity. + */ + bool empty() const { + return queue_.empty(); + } + + /** + * Returns whether or not this queue contains the given element. + * + * This method has average constant-time complexity. + */ + bool contains(const T& element) const { + return queue_entries_by_element_.find(element) != + queue_entries_by_element_.end(); + } + + /** + * Returns the elements in the queue. + * + * The order of the elements in the returned `vector` is the insertion order + * of those elements in this queue. + */ + std::vector elements() const { + std::vector elements; + for (const QueueEntry& entry : queue_) { + if (!entry.removed()) { + elements.push_back(entry.element()); + } + } + return elements; + } + + private: + class QueueEntry { + public: + explicit QueueEntry(const T& element) : element_(element) { + } + const T& element() const { + return element_; + } + bool removed() const { + return removed_; + } + void set_removed() { + removed_ = true; + } + + private: + T element_; + bool removed_ = false; + }; + + /** + * Removes all "removed" queue entries from the front of the queue. + * + * This method is useful to maintain the invariant that the front of the queue + * *must* be an element whose `removed()` method returns `false`. + */ + void PruneLeadingQueueEntries() { + while (!queue_.empty() && queue_.front().removed()) { + queue_entries_by_element_.erase(queue_.front().element()); + queue_.pop_front(); + } + } + + /** + * Effectively calls `push_back()` on this object for each element in the + * given queue (but more efficiently than *actually* calling push_back() for + * each element). + */ + void PushBackAll(const RandomAccessQueue& other) { + for (const QueueEntry& entry : other.queue_) { + if (!entry.removed()) { + queue_.emplace_back(entry.element()); + queue_entries_by_element_.emplace(entry.element(), &queue_.back()); + } + } + } + + /** + * The queued elements. + * + * When an element is "removed" from a `RandomAccessQueue`, instead of + * actually removing it from this `deque`, which is an O(n) operation, the + * "removed" flag of the corresponding queue entry is set to `true`; when that + * entry eventually makes its way to the front of the queue, it will be + * discarded and ignored. + * + * The front entry of this `deque` *must* always be one whose `removed` flag + * is `false`. This allows the `front()` method to be implemented as a mere + * pass-through to the `front()` method of this object. + */ + std::deque queue_; + + /** + * Maps the elements to their queue entry in `queue_`. + * + * When an element is "removed" from a `RandomAccessQueue`, its entry in the + * queue is looked up in this `unordered_map` and its `set_removed()` method + * is called; then, the entry is removed from the `unordered_map`. This allows + * presence in this `RandomAccessQueue` to be implemented by testing for + * presence in this `unordered_map`. + * + * Note: Since `std::deque` preserves pointer stability, the values in this + * map are pointers directly into `queue_`; therefore, care must be taken to + * not use the values after they have been removed from `queue_`. + */ + std::unordered_map + queue_entries_by_element_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_RANDOM_ACCESS_QUEUE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/range.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/range.h new file mode 100644 index 0000000..87db48a --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/range.h @@ -0,0 +1,78 @@ +/* + * 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_RANGE_H_ +#define FIRESTORE_CORE_SRC_UTIL_RANGE_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Adapts a pair of iterators into a range suitable for use with range-based + * for loops. + */ +template +class range { + public: + using value_type = typename std::iterator_traits::value_type; + using iterator = Iterator; + using const_iterator = Iterator; + + /** + * Default range which constructs default begin and end pointers. For most + * implementations where the end pointer is a null pointer or some other + * default value, this ends up constructing the empty range. + */ + range() : begin_{}, end_{} { + } + + /** + * Creates a half-open range starting from begin up to, but not including end. + */ + range(iterator&& begin, iterator&& end) + : begin_{std::move(begin)}, end_{std::move(end)} { + } + + iterator begin() const { + return begin_; + } + + iterator end() const { + return end_; + } + + private: + Iterator begin_; + Iterator end_; +}; + +/** + * Creates ranges with type deduction. + */ +template +range make_range(Iterator begin, Iterator end) { + return range{std::move(begin), std::move(end)}; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_RANGE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/read_context.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/read_context.h new file mode 100644 index 0000000..6fa0059 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/read_context.h @@ -0,0 +1,74 @@ +/* + * Copyright 2021 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_READ_CONTEXT_H_ +#define FIRESTORE_CORE_SRC_UTIL_READ_CONTEXT_H_ + +#include +#include + +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * 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))); + } + + template + void Fail(const char* format, const FA&... args) { + Fail(StringFormat(format, args...)); + } + + private: + util::Status status_ = util::Status::OK(); +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_READ_CONTEXT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h new file mode 100644 index 0000000..215fafc --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h @@ -0,0 +1,55 @@ +/* + * 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_SANITIZERS_H_ +#define FIRESTORE_CORE_SRC_UTIL_SANITIZERS_H_ + +// Clang feature detection compiler extension +#if defined(__has_feature) +#define HAS_FEATURE(FEATURE) __has_feature(FEATURE) +#else +#define HAS_FEATURE(FEATURE) 0 +#endif + +// Auto-detect the presence of sanitizers. Abseil does not do this yet, and +// instead relies on users to pass e.g. -DADDRESS_SANITIZER on the command-line. + +// Clang and GCC 4.8 +#if !defined(ADDRESS_SANITIZER) +#if HAS_FEATURE(address_sanitizer) || \ + (defined(__GNUC__) && defined(__SANITIZE_ADDRESS__)) +#define ADDRESS_SANITIZER 1 +#endif +#endif // !defined(ADDRESS_SANITIZER) + +// Clang-only +#if !defined(MEMORY_SANITIZER) +#if HAS_FEATURE(memory_sanitizer) +#define MEMORY_SANITIZER 1 +#endif +#endif // !defined(MEMORY_SANITIZER) + +// Clang and GCC 4.8+ +#if !defined(THREAD_SANITIZER) +#if HAS_FEATURE(thread_sanitizer) || \ + (defined(__GNUC__) && defined(__SANITIZE_THREAD__)) +#define THREAD_SANITIZER 1 +#endif +#endif // !defined(THREAD_SANITIZER) + +// There doesn't appear to be a __has_feature check for ubsan. + +#endif // FIRESTORE_CORE_SRC_UTIL_SANITIZERS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.cc new file mode 100644 index 0000000..2a7a9bb --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.h new file mode 100644 index 0000000..2d9700b --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h new file mode 100644 index 0000000..9bb4d00 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h @@ -0,0 +1,74 @@ +/* + * 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_SECURE_RANDOM_H_ +#define FIRESTORE_CORE_SRC_UTIL_SECURE_RANDOM_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +// A "secure" pseudorandom number generator, suitable for generating +// unguessable identifiers. This exists because +// +// * std::mt19937 is blazing fast but its outputs can be guessed once enough +// previous outputs have been observed. +// * std::random_device isn't guaranteed to come from a secure PRNG or be +// fast. +// +// The implementation satisfies the C++11 UniformRandomBitGenerator concept and +// delegates to an implementation that generates high quality random values +// quickly with periodic reseeding. +class SecureRandom { + public: + // C++11 UniformRandomBitGenerator interface + using result_type = uint32_t; + + static constexpr result_type min() { + return std::numeric_limits::min(); + } + + static constexpr result_type max() { + return std::numeric_limits::max(); + } + + result_type operator()(); + + /** Returns a uniformly distributed pseudorandom integer in [0, n). */ + inline result_type Uniform(result_type n) { + // Divides the range into buckets of size n plus leftovers. + const result_type rem = (max() - min()) % n + min() + 1; + result_type rnd; + // Generates random number until the number falls into a bucket. + do { + rnd = (*this)(); + } while (rnd < rem); + return rnd % n; + } + + inline bool OneIn(result_type n) { + return Uniform(n) == 0; + } +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_SECURE_RANDOM_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc new file mode 100644 index 0000000..e8d2dc1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc @@ -0,0 +1,37 @@ +/* + * 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/util/secure_random.h" + +#include "Firestore/core/src/util/config.h" + +#if HAVE_ARC4RANDOM + +#include + +namespace firebase { +namespace firestore { +namespace util { + +SecureRandom::result_type SecureRandom::operator()() { + return arc4random(); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // HAVE_ARC4RANDOM diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.cc new file mode 100644 index 0000000..6048706 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.cc @@ -0,0 +1,197 @@ +/* + * 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. + */ + +#include "Firestore/core/src/util/status.h" + +#include +#include + +#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, 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) { + if (ok()) { + *this = new_status; + } +} + +Status& Status::CausedBy(const Status& cause) { + if (cause.ok() || this == &cause || cause.IsMovedFrom()) { + return *this; + } + + if (ok() || IsMovedFrom()) { + *this = cause; + return *this; + } + + std::string new_message = error_message(); + absl::StrAppend(&state_->msg, ": ", cause.error_message()); + + // If this Status has no accompanying PlatformError but the cause does, create + // a PlatformError for this Status ahead of time to preserve the causal chain + // that Status doesn't otherwise support. + if (state_->platform_error == nullptr && + cause.state_->platform_error != nullptr) { + state_->platform_error = + cause.state_->platform_error->WrapWith(code(), error_message()); + } + + return *this; +} + +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::kErrorInternal, std::move(message)); + } + state_->platform_error = std::move(error); + return *this; +} + +void Status::State::Deleter::operator()(const State* ptr) const { + if (ptr != State::MovedFromIndicator()) { + delete ptr; + } +} + +void Status::SetMovedFrom() { + // Set pointer value to `0x1` as the pointer is no longer useful. + state_ = State::StatePtr{State::MovedFromIndicator()}; +} + +void Status::SlowCopyFrom(const State* src) { + if (src == nullptr) { + state_ = nullptr; + } else { + state_ = State::MakePtr(*src); + } +} + +const std::string& Status::empty_string() { + static std::string* empty = new std::string; + return *empty; +} + +const std::string& Status::moved_from_message() { + static std::string* message = new std::string("Status accessed after move."); + return *message; +} + +std::string Status::ToString() const { + if (state_ == nullptr) { + return "OK"; + } else { + std::string result; + switch (code()) { + case Error::kErrorCancelled: + result = "Cancelled"; + break; + case Error::kErrorUnknown: + result = "Unknown"; + break; + case Error::kErrorInvalidArgument: + result = "Invalid argument"; + break; + case Error::kErrorDeadlineExceeded: + result = "Deadline exceeded"; + break; + case Error::kErrorNotFound: + result = "Not found"; + break; + case Error::kErrorAlreadyExists: + result = "Already exists"; + break; + case Error::kErrorPermissionDenied: + result = "Permission denied"; + break; + case Error::kErrorUnauthenticated: + result = "Unauthenticated"; + break; + case Error::kErrorResourceExhausted: + result = "Resource exhausted"; + break; + case Error::kErrorFailedPrecondition: + result = "Failed precondition"; + break; + case Error::kErrorAborted: + result = "Aborted"; + break; + case Error::kErrorOutOfRange: + result = "Out of range"; + break; + case Error::kErrorUnimplemented: + result = "Unimplemented"; + break; + case Error::kErrorInternal: + result = "Internal"; + break; + case Error::kErrorUnavailable: + result = "Unavailable"; + break; + case Error::kErrorDataLoss: + result = "Data loss"; + break; + default: + result = StringFormat("Unknown code(%s)", code()); + break; + } + result += ": "; + result += IsMovedFrom() ? moved_from_message() : state_->msg; + return result; + } +} + +std::ostream& operator<<(std::ostream& out, const Status& status) { + out << status.ToString(); + return out; +} + +void Status::IgnoreError() const { + // no-op +} + +std::string StatusCheckOpHelperOutOfLine(const Status& v, const char* msg) { + HARD_ASSERT(!v.ok()); + std::string r("Non-OK-status: "); + r += msg; + r += " status: "; + r += v.ToString(); + return r; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.h new file mode 100644 index 0000000..c07a4ad --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status.h @@ -0,0 +1,250 @@ +/* + * 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); + Status& operator=(const Status& s); + + /// Move the specified status. + Status(Status&& s) noexcept; + Status& 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 msg); + +#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& other) + : code(other.code), + msg(other.msg), + platform_error((other.platform_error == nullptr) + ? nullptr + : other.platform_error->Copy()) { +} + +inline Status::State::State(Error code, std::string&& msg) + : code(code), msg(std::move(msg)) { +} + +inline Status& 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()); + } + return *this; +} + +inline Status::Status(Status&& s) noexcept : state_(std::move(s.state_)) { + s.SetMovedFrom(); +} + +inline Status& Status::operator=(Status&& s) noexcept { + // Moving into self is a no-op. + if (this != &s) { + state_ = std::move(s.state_); + s.SetMovedFrom(); + } + return *this; +} + +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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm new file mode 100644 index 0000000..2fb9ef6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm @@ -0,0 +1,128 @@ +/* + * 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(__APPLE__) + +#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 { +namespace firestore { +namespace util { + +class UnderlyingNSError : public PlatformError { + public: + explicit UnderlyingNSError(NSError* error) : error_(error) { + } + + static std::unique_ptr Create(NSError* error) { + return absl::make_unique(error); + } + + static NSError* Recover( + const std::unique_ptr& platform_error) { + if (platform_error == nullptr) { + return nil; + } + + return static_cast(platform_error.get())->error(); + } + + std::unique_ptr Copy() override { + return absl::make_unique(error_); + } + + std::unique_ptr WrapWith(Error code, + std::string message) override { + NSError* chain = MakeNSError(code, message, error_); + return Create(chain); + } + + NSError* error() const { + return error_; + } + + private: + NSError* error_; +}; + +namespace { + +/** + * Converts a Firestore-generated NSError to the equivalent status. + */ +Status FromFirestoreNSError(NSError* error) { + auto error_code = static_cast(error.code); + HARD_ASSERT(error_code >= Error::kErrorCancelled && + error_code <= Error::kErrorUnauthenticated, + "Unknown error code"); + + auto original = UnderlyingNSError::Create(error); + + return Status(static_cast(error_code), + MakeString(error.localizedDescription)) + .WithPlatformError(std::move(original)); +} + +} // namespace + +Status Status::FromNSError(NSError* error) { + if (!error) { + return Status::OK(); + } + + if ([error.domain isEqual:FIRFirestoreErrorDomain]) { + return FromFirestoreNSError(error); + } + + auto original = UnderlyingNSError::Create(error); + + while (error) { + if ([error.domain isEqualToString:NSPOSIXErrorDomain]) { + auto error_code = static_cast(error.code); + auto description = MakeString(original->error().localizedDescription); + return FromErrno(error_code, description) + .WithPlatformError(std::move(original)); + } + + error = error.userInfo[NSUnderlyingErrorKey]; + } + + auto description = StringFormat("Unknown error: %s", original->error()); + return Status{Error::kErrorUnknown, description}.WithPlatformError( + std::move(original)); +} + +NSError* Status::ToNSError() const { + if (ok()) return nil; + // Early exit because `state_` is moved. + if (IsMovedFrom()) return MakeNSError(code(), error_message()); + + NSError* error = UnderlyingNSError::Recover(state_->platform_error); + if (error) return error; + + return MakeNSError(code(), error_message()); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(__APPLE__) diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_errno.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_errno.cc new file mode 100644 index 0000000..21f15aa --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.h new file mode 100644 index 0000000..3c9b38c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.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_STATUS_FWD_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUS_FWD_H_ + +#include + +namespace firebase { +namespace firestore { +namespace util { + +// Forward declarations for Status classes. + +class Status; + +using StatusCallback = std::function; + +template +class StatusOr; + +template +using StatusOrCallback = std::function)>; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STATUS_FWD_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_win.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/status_win.cc new file mode 100644 index 0000000..175bbcf --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc new file mode 100644 index 0000000..6b4f2da --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc @@ -0,0 +1,42 @@ +/* + * Copyright 2017, 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/statusor.h" + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace internal_statusor { + +void Helper::HandleInvalidStatusCtorArg(Status* status) { + const char* kMessage = + "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::kErrorInternal, kMessage); +} + +void Helper::Crash(const Status& status) { + HARD_FAIL("Attempting to fetch value instead of handling error %s", + status.ToString()); +} + +} // namespace internal_statusor +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h new file mode 100644 index 0000000..daf0627 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h @@ -0,0 +1,323 @@ +/* + * Copyright 2017, 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. + */ + +// StatusOr is the union of a Status object and a T +// object. StatusOr models the concept of an object that is either a +// usable value, or an error Status explaining why such a value is +// not present. To this end, StatusOr does not allow its Status +// value to be Status::OK. Furthermore, the value of a StatusOr +// must not be null. This is enforced by a debug check in most cases, +// but even when it is not, clients must not set the value to null. +// +// The primary use-case for StatusOr is as the return value of a +// function which may fail. +// +// Example client usage for a StatusOr, where T is not a pointer: +// +// StatusOr result = DoBigCalculationThatCouldFail(); +// if (result.ok()) { +// float answer = result.ValueOrDie(); +// printf("Big calculation yielded: %f", answer); +// } else { +// LOG(ERROR) << result.status(); +// } +// +// Example client usage for a StatusOr: +// +// StatusOr result = FooFactory::MakeNewFoo(arg); +// if (result.ok()) { +// std::unique_ptr foo(result.ValueOrDie()); +// foo->DoSomethingCool(); +// } else { +// LOG(ERROR) << result.status(); +// } +// +// Example client usage for a StatusOr>: +// +// StatusOr> result = FooFactory::MakeNewFoo(arg); +// if (result.ok()) { +// std::unique_ptr foo = std::move(result.ValueOrDie()); +// foo->DoSomethingCool(); +// } else { +// LOG(ERROR) << result.status(); +// } +// +// Example factory implementation returning StatusOr: +// +// StatusOr FooFactory::MakeNewFoo(int arg) { +// if (arg <= 0) { +// return Status(Error::kErrorInvalidArgument, +// "Arg must be positive"); +// } else { +// return new Foo(arg); +// } +// } +// +// Note that the assignment operators require that destroying the currently +// stored value cannot invalidate the argument; in other words, the argument +// cannot be an alias for the current value, or anything owned by the current +// value. + +#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/util/status.h" +#include "Firestore/core/src/util/statusor_internals.h" +#include "absl/base/attributes.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +template +class ABSL_MUST_USE_RESULT StatusOr + : private internal_statusor::StatusOrData, + private internal_statusor::TraitsBase< + std::is_copy_constructible::value, + std::is_move_constructible::value> { + template + friend class StatusOr; + + typedef internal_statusor::StatusOrData Base; + + public: + typedef T element_type; + + // Constructs a new StatusOr with FirebaseErrorCode::Unknown status. This is + // marked 'explicit' to try to catch cases like 'return {};', where people + // think StatusOr> will be initialized with an empty vector, + // instead of a FirebaseErrorCode::Unknown status. + explicit StatusOr(); // NOLINT: allow explicit zero-parameter ctor + + // StatusOr will be copy constructible/assignable if T is copy + // constructible. + StatusOr(const StatusOr&) = default; + StatusOr& operator=(const StatusOr&) = default; + + // StatusOr will be move constructible/assignable if T is move + // constructible. + StatusOr(StatusOr&&) = default; + StatusOr& operator=(StatusOr&&) = default; + + // Conversion copy/move constructor, T must be convertible from U. + // TODO(b/62186717): These should not participate in overload resolution if U + // is not convertible to T. + template + StatusOr(const StatusOr& other); + template + StatusOr(StatusOr&& other); + + // Conversion copy/move assignment operator, T must be convertible from U. + template + StatusOr& operator=(const StatusOr& other); + template + StatusOr& operator=(StatusOr&& other); + + // Constructs a new StatusOr with the given value. After calling this + // constructor, calls to ValueOrDie() will succeed, and calls to status() will + // return OK. + // + // NOTE: Not explicit - we want to use StatusOr as a return type + // so it is convenient and sensible to be able to do 'return T()' + // when the return type is StatusOr. + // + // REQUIRES: T is copy constructible. + StatusOr(const T& value); // NOLINT: allow non-explicit 1-param ctor + + // Constructs a new StatusOr with the given non-ok status. After calling + // this constructor, calls to ValueOrDie() will CHECK-fail. + // + // NOTE: Not explicit - we want to use StatusOr as a return + // value, so it is convenient and sensible to be able to do 'return + // Status()' when the return type is StatusOr. + // + // REQUIRES: !status.ok(). This requirement is DCHECKed. + // In optimized builds, passing Status::OK() here will have the effect + // of passing Error::kErrorInternal as a fallback. + StatusOr(const Status& status); // NOLINT: allow non-explicit 1-param ctor + StatusOr& operator=(const Status& status); + + // TODO(b/62186997): Add operator=(T) overloads. + + // Similar to the `const T&` overload. + // + // REQUIRES: T is move constructible. + StatusOr(T&& value); // NOLINT: allow non-explicit 1-param ctor + + // RValue versions of the operations declared above. + StatusOr(Status&& status); // NOLINT: allow non-explicit 1-param ctor + StatusOr& operator=(Status&& status); + + // Returns this->status().ok() + bool ok() const { + return this->status_.ok(); + } + + // Returns a reference to our status. If this contains a T, then + // returns Status::OK(). + const Status& status() const&; + Status status() &&; + + // Returns a reference to our current value, or CHECK-fails if !this->ok(). + // + // Note: for value types that are cheap to copy, prefer simple code: + // + // T value = statusor.ValueOrDie(); + // + // Otherwise, if the value type is expensive to copy, but can be left + // in the StatusOr, simply assign to a reference: + // + // T& value = statusor.ValueOrDie(); // or `const T&` + // + // Otherwise, if the value type supports an efficient move, it can be + // used as follows: + // + // T value = std::move(statusor).ValueOrDie(); + // + // The std::move on statusor instead of on the whole expression enables + // warnings about possible uses of the statusor object after the move. + // C++ style guide waiver for ref-qualified overloads granted in cl/143176389 + // See go/ref-qualifiers for more details on such overloads. + const T& ValueOrDie() const&; + T& ValueOrDie() &; + const T&& ValueOrDie() const&&; + T&& ValueOrDie() &&; + + T ConsumeValueOrDie() { + return std::move(ValueOrDie()); + } + + // 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; +}; + +//////////////////////////////////////////////////////////////////////////////// +// Implementation details for StatusOr + +template +StatusOr::StatusOr() : Base(Status(Error::kErrorUnknown, "")) { +} + +template +StatusOr::StatusOr(const T& value) : Base(value) { +} + +template +StatusOr::StatusOr(const Status& status) : Base(status) { +} + +template +StatusOr& StatusOr::operator=(const Status& status) { + this->Assign(status); + return *this; +} + +template +StatusOr::StatusOr(T&& value) : Base(std::move(value)) { +} + +template +StatusOr::StatusOr(Status&& status) : Base(std::move(status)) { +} + +template +StatusOr& StatusOr::operator=(Status&& status) { + this->Assign(std::move(status)); + return *this; +} + +template +template +inline StatusOr::StatusOr(const StatusOr& other) + : Base(static_cast::Base&>(other)) { +} + +template +template +inline StatusOr& StatusOr::operator=(const StatusOr& other) { + if (other.ok()) + this->Assign(other.ValueOrDie()); + else + this->Assign(other.status()); + return *this; +} + +template +template +inline StatusOr::StatusOr(StatusOr&& other) + : Base(static_cast::Base&&>(other)) { +} + +template +template +inline StatusOr& StatusOr::operator=(StatusOr&& other) { + if (other.ok()) { + this->Assign(std::move(other).ValueOrDie()); + } else { + this->Assign(std::move(other).status()); + } + return *this; +} + +template +const Status& StatusOr::status() const& { + return this->status_; +} +template +Status StatusOr::status() && { + return ok() ? Status::OK() : std::move(this->status_); +} + +template +const T& StatusOr::ValueOrDie() const& { + this->EnsureOk(); + return this->data_; +} + +template +T& StatusOr::ValueOrDie() & { + this->EnsureOk(); + return this->data_; +} + +template +const T&& StatusOr::ValueOrDie() const&& { + this->EnsureOk(); + return std::move(this->data_); +} + +template +T&& StatusOr::ValueOrDie() && { + this->EnsureOk(); + return std::move(this->data_); +} + +template +void StatusOr::IgnoreError() const { + // no-op +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STATUSOR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h new file mode 100644 index 0000000..e7c6fe6 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h @@ -0,0 +1,258 @@ +/* + * Copyright 2017, 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_STATUSOR_INTERNALS_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUSOR_INTERNALS_H_ + +#include + +#include "Firestore/core/src/util/status.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace internal_statusor { + +class Helper { + public: + // Move type-agnostic error handling to the .cc. + static void HandleInvalidStatusCtorArg(Status*); + ABSL_ATTRIBUTE_NORETURN static void Crash(const Status& status); +}; + +// Construct an instance of T in `p` through placement new, passing Args... to +// the constructor. +// This abstraction is here mostly for the gcc performance fix. +template +void PlacementNew(void* p, Args&&... args) { +#if defined(__GNUC__) && !defined(__clang__) + // Teach gcc that 'p' cannot be null, fixing code size issues. + if (p == nullptr) __builtin_unreachable(); +#endif + new (p) T(std::forward(args)...); +} + +// Helper base class to hold the data and all operations. +// We move all this to a base class to allow mixing with the appropriate +// TraitsBase specialization. +template +class StatusOrData { + template + friend class StatusOrData; + + public: + StatusOrData() = delete; + + StatusOrData(const StatusOrData& other) { + if (other.ok()) { + MakeValue(other.data_); + MakeStatus(); + } else { + MakeStatus(other.status_); + } + } + + StatusOrData(StatusOrData&& other) noexcept { + if (other.ok()) { + MakeValue(std::move(other.data_)); + MakeStatus(); + } else { + MakeStatus(std::move(other.status_)); + } + } + + template + StatusOrData(const StatusOrData& other) { + if (other.ok()) { + MakeValue(other.data_); + MakeStatus(); + } else { + MakeStatus(other.status_); + } + } + + template + StatusOrData(StatusOrData&& other) { + if (other.ok()) { + MakeValue(std::move(other.data_)); + MakeStatus(); + } else { + MakeStatus(std::move(other.status_)); + } + } + + explicit StatusOrData(const T& value) : data_(value) { + MakeStatus(); + } + explicit StatusOrData(T&& value) : data_(std::move(value)) { + MakeStatus(); + } + + explicit StatusOrData(const Status& status) : status_(status) { + EnsureNotOk(); + } + explicit StatusOrData(Status&& status) : status_(std::move(status)) { + EnsureNotOk(); + } + + StatusOrData& operator=(const StatusOrData& other) { + if (this == &other) return *this; + if (other.ok()) + Assign(other.data_); + else + Assign(other.status_); + return *this; + } + + StatusOrData& operator=(StatusOrData&& other) noexcept { + if (this == &other) return *this; + if (other.ok()) + Assign(std::move(other.data_)); + else + Assign(std::move(other.status_)); + return *this; + } + + ~StatusOrData() { + if (ok()) { + status_.~Status(); + data_.~T(); + } else { + status_.~Status(); + } + } + + void Assign(const T& value) { + if (ok()) { + data_.~T(); + MakeValue(value); + } else { + MakeValue(value); + status_ = Status::OK(); + } + } + + void Assign(T&& value) { + if (ok()) { + data_.~T(); + MakeValue(std::move(value)); + } else { + MakeValue(std::move(value)); + status_ = Status::OK(); + } + } + + void Assign(const Status& status) { + Clear(); + status_ = status; + EnsureNotOk(); + } + + void Assign(Status&& status) { + Clear(); + status_ = std::move(status); + EnsureNotOk(); + } + + bool ok() const { + return status_.ok(); + } + + protected: + // status_ will always be active after the constructor. + // We make it a union to be able to initialize exactly how we need without + // waste. + // Eg. in the copy constructor we use the default constructor of Status in + // the ok() path to avoid an extra Ref call. + union { + Status status_; + }; + + // data_ is active iff status_.ok()==true + struct Dummy {}; + union { + // When T is const, we need some non-const object we can cast to void* for + // the placement new. dummy_ is that object. + Dummy dummy_; + T data_; + }; + + void Clear() { + if (ok()) data_.~T(); + } + + void EnsureOk() const { + if (!ok()) Helper::Crash(status_); + } + + void EnsureNotOk() { + if (ok()) Helper::HandleInvalidStatusCtorArg(&status_); + } + + // Construct the value (ie. data_) through placement new with the passed + // argument. + template + void MakeValue(Arg&& arg) { + internal_statusor::PlacementNew(&dummy_, std::forward(arg)); + } + + // Construct the status (ie. status_) through placement new with the passed + // argument. + template + void MakeStatus(Args&&... args) { + internal_statusor::PlacementNew(&status_, + std::forward(args)...); + } +}; + +// Helper base class to allow implicitly deleted constructors and assignment +// operations in StatusOr. +// TraitsBase will explicitly delete what it can't support and StatusOr will +// inherit that behavior implicitly. +template +struct TraitsBase { + TraitsBase() = default; + TraitsBase(const TraitsBase&) = default; + TraitsBase(TraitsBase&&) = default; + TraitsBase& operator=(const TraitsBase&) = default; + TraitsBase& operator=(TraitsBase&&) = default; +}; + +template <> +struct TraitsBase { + TraitsBase() = default; + TraitsBase(const TraitsBase&) = delete; + TraitsBase(TraitsBase&&) = default; + TraitsBase& operator=(const TraitsBase&) = delete; + TraitsBase& operator=(TraitsBase&&) = default; +}; + +template <> +struct TraitsBase { + TraitsBase() = default; + TraitsBase(const TraitsBase&) = delete; + TraitsBase(TraitsBase&&) = delete; + TraitsBase& operator=(const TraitsBase&) = delete; + TraitsBase& operator=(TraitsBase&&) = delete; +}; + +} // namespace internal_statusor +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STATUSOR_INTERNALS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc new file mode 100644 index 0000000..e17a490 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc @@ -0,0 +1,91 @@ +/* + * 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. + */ + +// Implementation note: +// +// This is ported from //base/strerror.cc, with several local modifications: +// +// * Removed non-portable optimization around to use sys_errlist where +// available without warnings. +// * Added __attribute__((unused)) to compile with -Wno-unused-functions. +// * Conformed to style/lint rules. + +#include "Firestore/core/src/util/strerror.h" + +#include +#include + +#if defined(_WIN32) +#define HAVE_STRERROR_S 1 + +#elif defined(__GLIBC__) +#if (_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE +#define HAVE_POSIX_STRERROR_R 1 +#else +#define HAVE_GNU_STRERROR_R 1 +#endif + +#else +#define HAVE_POSIX_STRERROR_R 1 + +#endif + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +inline const char* StrErrorAdaptor(int errnum, char* buf, size_t buflen) { +#if HAVE_STRERROR_S + int rc = strerror_s(buf, buflen, errnum); + buf[buflen - 1] = '\0'; // guarantee NUL termination + + if (rc == 0 && strcmp(buf, "Unknown error") == 0) { + *buf = '\0'; + } + return buf; + +#elif HAVE_POSIX_STRERROR_R + if (strerror_r(errnum, buf, buflen)) { + *buf = '\0'; + } + return buf; + +#elif HAVE_GNU_STRERROR_R + return strerror_r(errnum, buf, buflen); + +#endif // HAVE_STRERROR_S +} + +} // namespace + +std::string StrError(int errnum) { + const int saved_errno = errno; + + char buf[100]; + const char* str = StrErrorAdaptor(errnum, buf, sizeof buf); + if (*str == '\0') { + snprintf(buf, sizeof buf, "Unknown error %d", errnum); + str = buf; + } + + errno = saved_errno; + return str; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h new file mode 100644 index 0000000..2e832e1 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h @@ -0,0 +1,36 @@ +/* + * 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_STRERROR_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRERROR_H_ + +#include + +namespace firebase { +namespace firestore { +namespace util { + +// A portable and thread-safe alternative to strerror(). +// Returns a human-readable string describing the given POSIX error +// code. If the error code is not translatable, the string will be +// "Unknown error nnn". errno will not be modified by this call. +std::string StrError(int errnum); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STRERROR_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc new file mode 100644 index 0000000..b55d9c4 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc @@ -0,0 +1,56 @@ +/* + * 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/string_apple.h" + +#if defined(__APPLE__) + +#include + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace util { + +std::string MakeString(CFStringRef str) { + CFIndex num_chars = CFStringGetLength(str); + if (num_chars == 0) { + return {}; + } + + // In the first pass figure the size required. The size does not include the + // null terminator. + CFRange range{0, num_chars}; + CFIndex num_bytes = 0; + CFIndex converted = CFStringGetBytes(str, range, kCFStringEncodingUTF8, 0u, + false, nullptr, 0, &num_bytes); + HARD_ASSERT(converted == num_chars); + + std::string result(static_cast(num_bytes), '\0'); + auto buffer = reinterpret_cast(&result[0]); + converted = CFStringGetBytes(str, range, kCFStringEncodingUTF8, 0u, false, + buffer, num_bytes, nullptr); + HARD_ASSERT(converted == num_chars); + + return result; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(__APPLE__) diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h new file mode 100644 index 0000000..11b8a9e --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h @@ -0,0 +1,105 @@ +/* + * 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_STRING_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_APPLE_H_ + +#if defined(__APPLE__) +#import + +#if defined(__OBJC__) +#import +#endif + +#include +#include + +#include "absl/strings/string_view.h" + +CF_ASSUME_NONNULL_BEGIN + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Returns a copy of the given CFString (or NSString) encoded in UTF-8. + */ +std::string MakeString(CFStringRef str); + +inline CFStringRef MakeCFString(absl::string_view contents) { + auto bytes = reinterpret_cast(contents.data()); + return CFStringCreateWithBytes(kCFAllocatorDefault, bytes, contents.size(), + kCFStringEncodingUTF8, false); +} + +/** + * CFRelease that safely ignores null values. + */ +inline void SafeCFRelease(CFTypeRef cf) { + if (cf) { + CFRelease(cf); + } +} + +#if defined(__OBJC__) + +// Translates a string_view string to the equivalent NSString by making a copy. +inline NSString* MakeNSString(absl::string_view str) { + return [[NSString alloc] + initWithBytes:const_cast(static_cast(str.data())) + length:str.length() + encoding:NSUTF8StringEncoding]; +} + +// Translates a nullable pointer to string to the equivalent NSString by making +// a copy. +inline NSString* _Nullable MakeNSString( + const std::shared_ptr& str) { + return str ? MakeNSString(*str) : nil; +} + +// Creates an absl::string_view wrapper for the contents of the given +// NSString. +inline absl::string_view MakeStringView(NSString* str) { + return absl::string_view( + [str UTF8String], [str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); +} + +// Creates a std::string wrapper for the contents of the given NSString. +inline std::string MakeString(NSString* str) { + CFStringRef cf_str = (__bridge CFStringRef)str; + return MakeString(cf_str); +} + +// Creates a nullable shared_ptr pointing to a string for the contents of the +// given NSString, or nullptr if it's nil. +inline std::shared_ptr MakeStringPtr( + NSString* _Nullable str) { + if (!str) return nullptr; + return std::make_shared(MakeString(str)); +} + +#endif // defined(__OBJC__) + +} // namespace util +} // namespace firestore +} // namespace firebase + +CF_ASSUME_NONNULL_END + +#endif // defined(__APPLE__) +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_APPLE_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc new file mode 100644 index 0000000..8eced03 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc @@ -0,0 +1,94 @@ +/* + * 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/string_format.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace internal { + +static const char* kMissing = ""; +static const char* kInvalid = ""; + +std::string StringFormatPieces( + const char* format, std::initializer_list pieces) { + std::string result; + + const char* format_iter = format; + const char* format_end = format + strlen(format); + + auto pieces_iter = pieces.begin(); + auto pieces_end = pieces.end(); + auto append_next_piece = [&](std::string* dest) { + if (pieces_iter == pieces_end) { + dest->append(kMissing); + } else { + // Pass a piece through + dest->append(pieces_iter->data(), pieces_iter->size()); + ++pieces_iter; + } + }; + + auto append_specifier = [&](char spec) { + switch (spec) { + case '%': + // Pass through literal %. + result.push_back('%'); + break; + + case 's': { + append_next_piece(&result); + break; + } + + default: + result.append(kInvalid); + break; + } + }; + + // Iterate through the format string, advancing `format_iter` as we go. + while (true) { + const char* percent_ptr = std::find(format_iter, format_end, '%'); + + // percent either points to the next format specifier or the end of the + // format string. Either is safe to append here: + result.append(format_iter, percent_ptr); + if (percent_ptr == format_end) { + // No further pieces to format + break; + } + + // Examine the specifier: + const char* spec_ptr = percent_ptr + 1; + if (spec_ptr == format_end) { + // Incomplete specifier, treat as a literal "%" and be done. + append_specifier('%'); + break; + } + append_specifier(*spec_ptr); + + format_iter = spec_ptr + 1; + } + + return result; +} + +} // namespace internal +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h new file mode 100644 index 0000000..e00857c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h @@ -0,0 +1,172 @@ +/* + * 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_STRING_FORMAT_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_FORMAT_H_ + +#include +#include +#include + +#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" + +namespace firebase { +namespace firestore { +namespace util { + +namespace internal { + +std::string StringFormatPieces(const char* format, + std::initializer_list pieces); + +/** + * Explicit ranking for formatting choices. Only useful as an implementation + * detail of `FormatArg`. + */ +template +struct FormatChoice : FormatChoice {}; + +template <> +struct FormatChoice<5> {}; + +} // namespace internal + +/** + * Acts as the main value parameter to StringFormat and related functions. + * + * Chooses a conversion to a text form in this order: + * * If the value is exactly of `bool` type (without implicit conversions) + * the text will be "true" or "false". + * * 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 hexadecimal + * formatting of the value as an unsigned integer. + * * Otherwise the value is interpreted as anything absl::AlphaNum accepts. + */ +class FormatArg : public absl::AlphaNum { + public: + template + FormatArg(T&& value) // NOLINT(runtime/explicit) + : FormatArg{std::forward(value), internal::FormatChoice<0>{}} { + } + + private: + /** + * Creates a FormatArg from a boolean value, representing the string + * "true" or "false". + * + * This overload only applies if the type of the argument is exactly `bool`. + * No implicit conversions to bool are accepted. + */ + template {}>::type> + FormatArg(T bool_value, internal::FormatChoice<0>) + : AlphaNum{bool_value ? "true" : "false"} { + } + +#if __OBJC__ + /** + * Creates a FormatArg from any pointer to an object derived from NSObject. + */ + template < + typename T, + typename = typename std::enable_if{}>::type> + FormatArg(T object, internal::FormatChoice<1>) + : AlphaNum{MakeStringView([object description])} { + } + + /** + * Creates a FormatArg from any Objective-C Class type. Objective-C Class + * types are a special struct that aren't of a type derived from NSObject. + */ + FormatArg(Class object, internal::FormatChoice<1>) + : AlphaNum{MakeStringView(NSStringFromClass(object))} { + } +#endif + + /** + * Creates a FormatArg from a character string literal. This is + * handled specially to avoid ambiguity with generic pointers, which are + * handled differently. + */ + FormatArg(std::nullptr_t, internal::FormatChoice<2>) : AlphaNum{"null"} { + } + + /** + * Creates a FormatArg from a character string literal. This is + * handled specially to avoid ambiguity with generic pointers, which are + * handled differently. + */ + FormatArg(const char* string_value, internal::FormatChoice<3>) + : AlphaNum{string_value == nullptr ? "null" : string_value} { + } + + /** + * Creates a FormatArg from an arbitrary pointer, represented as a + * hexadecimal integer literal. + */ + template + FormatArg(T* pointer_value, internal::FormatChoice<4>) + : AlphaNum{absl::Hex{reinterpret_cast(pointer_value)}} { + } + + /** + * As a final fallback, creates a FormatArg from any type of value that + * absl::AlphaNum accepts. + */ + template + FormatArg(T&& value, internal::FormatChoice<5>) + : AlphaNum{std::forward(value)} { + } +}; + +/** + * Formats a string using a simplified printf-like formatting mechanism that + * does not rely on C varargs. + * + * The following format specifiers are recognized: + * * "%%" - A literal "%" + * * "%s" - The next parameter is copied through + * + * Note: + * * If you pass fewer arguments than the format requires, StringFormat will + * insert "". + * * If you pass more arguments than the format requires, any excess arguments + * are ignored. + * * If you use an invalid format specifier, StringFormat will insert + * . + */ +template +std::string StringFormat(const char* format, const FA&... args) { + return internal::StringFormatPieces( + format, {static_cast(args).Piece()...}); +} + +inline std::string StringFormat() { + return {}; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_FORMAT_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc new file mode 100644 index 0000000..4440d81 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc @@ -0,0 +1,58 @@ +/* + * 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/util/string_util.h" + +namespace firebase { +namespace firestore { +namespace util { + +std::string PrefixSuccessor(absl::string_view prefix) { + // We can increment the last character in the string and be done + // unless that character is 255 (0xff), in which case we have to erase the + // last character and increment the previous character, unless that + // is 255, etc. If the string is empty or consists entirely of + // 255's, we just return the empty string. + std::string limit(prefix); + while (!limit.empty()) { + size_t index = limit.length() - 1; + if (limit[index] == '\xff') { // char literal avoids signed/unsigned. + limit.erase(index); + } else { + limit[index]++; + break; + } + } + return limit; +} + +std::string ImmediateSuccessor(absl::string_view s) { + // Return the input string, with an additional NUL byte appended. + std::string out; + out.reserve(s.size() + 1); + out.append(s.data(), s.size()); + out.push_back('\0'); + return out; +} + +const std::string& EmptyString() { + static auto* empty = new std::string; + return *empty; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h new file mode 100644 index 0000000..9646570 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h @@ -0,0 +1,77 @@ +/* + * 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); + +/** + * Returns an reference to a static empty string. + */ +const std::string& EmptyString(); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_UTIL_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc new file mode 100644 index 0000000..d5d9b03 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc @@ -0,0 +1,126 @@ +/* + * 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/string_win.h" + +#if defined(_WIN32) +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/memory/memory.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace util { + +std::wstring Utf8ToNative(absl::string_view input) { + int input_len = static_cast(input.size()); + + // MultiByteToWideChar considers a zero length to be an error, so special case + // the empty string. + if (input_len == 0) { + return L""; + } + + // The input string_view may contain embedded nulls and isn't necessarily null + // terminated so we must pass an explicit length to MultiByteToWideChar. This + // means the result is the number of wchar_t required to hold the result, + // excluding the null terminator. + int output_len = + ::MultiByteToWideChar(CP_UTF8, 0, input.data(), input_len, nullptr, 0); + if (output_len == 0) { + DWORD error = ::GetLastError(); + HARD_FAIL("Utf8ToNative failed with code %s: %s", error, + LastErrorMessage(error)); + } + HARD_ASSERT(output_len > 0); + + int output_terminated_len = output_len + 1; + std::wstring output(output_terminated_len, L'\0'); + int result = ::MultiByteToWideChar(CP_UTF8, 0, input.data(), input_len, + &output[0], output_len); + HARD_ASSERT(result > 0 && result < output_terminated_len && + output[output_len] == '\0'); + + output.resize(result); + return output; +} + +std::string NativeToUtf8(const std::wstring& input) { + return NativeToUtf8(input.c_str(), input.size()); +} + +std::string NativeToUtf8(const wchar_t* input, size_t input_size) { + int input_len = static_cast(input_size); + if (input_len == 0) { + return ""; + } + + // The input buffer may contain embedded nulls and isn't necessarily null + // terminated so we must pass an explicit length to WideCharToMultiByte. This + // means the result is the number of char required to hold the result, + // excluding the null terminator. + int output_len = ::WideCharToMultiByte(CP_UTF8, 0, input, input_len, nullptr, + 0, nullptr, nullptr); + if (output_len == 0) { + DWORD error = ::GetLastError(); + HARD_FAIL("NativeToUtf8 failed with code %s: %s", error, + LastErrorMessage(error)); + } + HARD_ASSERT(output_len > 0); + + int output_terminated_len = output_len + 1; + std::string output(output_terminated_len, '\0'); + int result = ::WideCharToMultiByte(CP_UTF8, 0, input, input_len, &output[0], + output_len, nullptr, nullptr); + HARD_ASSERT(result > 0 && result < output_terminated_len && + output[output_len] == '\0'); + + output.resize(result); + return output; +} + +std::string LastErrorMessage(DWORD last_error) { + // Preallocate a buffer sufficiently large to receive any message. Since we're + // not asking for inserts this is already way too big. + size_t size = 16 * 1024; + auto error_text = absl::make_unique(size); + + // output_len excludes the trailing null. + DWORD output_len = ::FormatMessageW( + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, + last_error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), error_text.get(), + static_cast(size), nullptr); + if (output_len == 0) { + DWORD format_error = ::GetLastError(); + return util::StringFormat( + "error %s; unknown error %s while getting error text", last_error, + format_error); + } + + std::string formatted = NativeToUtf8(error_text.get(), output_len); + if (absl::EndsWith(formatted, "\r\n")) { + formatted.resize(formatted.size() - 2); + } + return formatted; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(_WIN32) diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.h new file mode 100644 index 0000000..fa697ab --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.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_STRING_WIN_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_WIN_H_ + +#if defined(_WIN32) +#include + +#include + +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Converts a UTF-8-encoded string to the equivalent wide character form, + * suitable for use with Windows path-related functions. + */ +std::wstring Utf8ToNative(absl::string_view input); + +/** + * Converts a UTF-16-encoded filename to the equivalent in UTF-8, suitable for + * use in log messages or other non-path-related functions. + */ +std::string NativeToUtf8(const std::wstring& input); +std::string NativeToUtf8(const wchar_t* input, size_t length); + +/** + * Formats the given system error code from GetLastError() to a UTF-8 encoded + * string. + */ +std::string LastErrorMessage(DWORD last_error); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(_WIN32) +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_WIN_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/task.cc b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/task.cc new file mode 100644 index 0000000..66232d9 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/task.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/task.h new file mode 100644 index 0000000..ef86f29 --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h new file mode 100644 index 0000000..9ec456d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h @@ -0,0 +1,194 @@ +/* + * 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_TO_STRING_H_ +#define FIRESTORE_CORE_SRC_UTIL_TO_STRING_H_ + +#include +#include +#include +#include +#include + +#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" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Creates a human-readable description of the given `value`. The representation + * is loosely inspired by Python. + * + * The general idea is to create the description by using the most specific + * available function that creates a string representation of the class; for + * containers, do this recursively, adding some minimal container formatting to + * the output. + * + * Example: + * + * std::vector v{ + * DocumentKey({"foo/bar"}), + * DocumentKey({"this/that"}) + * }; + * assert(ToString(v) == "[foo/bar, this/that]"); + * + * std::map m{ + {1, "foo"}, + {2, "bar"} + * }; + * assert(ToString(m) == "{1: foo, 2: bar}"); + * + * The following algorithm is used: + * + * - if `value` defines a member function called `ToString`, the description is + * created by invoking the function; + * + * - (in Objective-C++ only) otherwise, if `value` is an Objective-C object, + * the description is created by calling `[value description]`and converting + * the result to an `std::string`; + * + * - otherwise, if `value` is an `std::string`, it's used as is; + * + * - otherwise, if `value` is an associative container (`std::map`, + * `std::unordered_map`, `f:f:immutable::SortedMap`, etc.), the description is + * of the form: + * + * {key1: value1, key2: value2} + * + * where the description of each key and value is created by running + * `ToString` recursively; + * + * - otherwise, if `value` is a container, the description is of the form: + * + * [element1, element2] + * + * where the description of each element is created by running `ToString` + * recursively; + * + * - otherwise, `std::to_string` is used as a fallback. If `std::to_string` is + * not defined for the class, a compilation error will be produced. + * + * Implementation notes: to rank different choices and avoid clashes (e.g., + * a type that is an associative container is also a (simple) container), tag + * dispatch is used. Each function in the chain either is tagged by + * `std::true_type` and can process the value, or is tagged by `std::false_type` + * and passes the value to the next function by the rank. When passing to the + * next function, some trait corresponding to the function is given in place of + * the tag; for example, `StringToString`, which can handle `std::string`s, is + * invoked with `std::is_same` as the tag. + */ +template +std::string ToString(const T& value); + +namespace impl { + +// Checks whether the given type `T` defines a member function `ToString` + +template > +struct has_to_string : std::false_type {}; + +template +struct has_to_string().ToString())>> + : std::true_type {}; + +template +struct ToStringChoice : ToStringChoice {}; + +template <> +struct ToStringChoice<6> {}; + +#if __OBJC__ + +// Objective-C class +template ::value>> +std::string ToStringImpl(T value, ToStringChoice<0>) { + return MakeString([value description]); +} + +#endif // __OBJC__ + +// Has `ToString` member function +template ::value>> +std::string ToStringImpl(const T& value, ToStringChoice<1>) { + return value.ToString(); +} + +// `std::string` +template ::value>> +std::string ToStringImpl(const T& value, ToStringChoice<2>) { + return value; +} + +// `absl::optional` +template , T>::value>> +std::string ToStringImpl(const T& maybe_value, ToStringChoice<3>) { + return maybe_value.has_value() ? ToString(maybe_value.value()) + : std::string{"nullopt"}; +} + +// Associative container +template ::value>> +std::string ToStringImpl(const T& value, ToStringChoice<4>) { + std::string contents = absl::StrJoin( + value, ", ", [](std::string* out, const typename T::value_type& kv) { + out->append(ToString(kv.first)); + out->append(": "); + out->append(ToString(kv.second)); + }); + return std::string{"{"} + contents + "}"; // NOLINT(whitespace/braces) +} + +// Container +template ::value>> +std::string ToStringImpl(const T& value, ToStringChoice<5>) { + std::string contents = absl::StrJoin( + value, ", ", [](std::string* out, const typename T::value_type& element) { + out->append(ToString(element)); + }); + return std::string{"["} + contents + "]"; // NOLINT(whitespace/braces) +} + +// Fallback +template +std::string ToStringImpl(const T& value, ToStringChoice<6>) { + FormatArg arg{value}; + return std::string{arg.data(), arg.data() + arg.size()}; +} + +} // namespace impl + +template +std::string ToString(const T& value) { + return impl::ToStringImpl(value, impl::ToStringChoice<0>{}); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_TO_STRING_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/type_traits.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/type_traits.h new file mode 100644 index 0000000..131256c --- /dev/null +++ b/SaraAttended/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/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h new file mode 100644 index 0000000..beb1def --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h @@ -0,0 +1,91 @@ +/* + * 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_WARNINGS_H_ +#define FIRESTORE_CORE_SRC_UTIL_WARNINGS_H_ + +/** + * Macros for suppressing various warnings. Use like this: + * + * SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() + * #include "header/that/has/warnings.h" + * SUPPRESS_END() + * + * SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() + * #include "header/that/uses/deprecated/stuff.h" + * SUPPRESS_END() + * + * SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() + * SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() + * #include "something/awful.h" + * SUPPRESS_END() + * SUPPRESS_END() + */ + +// Define some primitives used by the 'public' macros below. + +#if defined(__clang__) || defined(__GNUC__) +#define SUPPRESS_BEGIN_UNIMPLEMENTED_() _Pragma("GCC diagnostic push") + +#define SUPPRESS_BEGIN_(name) _Pragma("GCC diagnostic push") _Pragma(name) + +#define SUPPRESS_END() _Pragma("GCC diagnostic pop") + +#elif defined(_MSC_VER) +#define SUPPRESS_BEGIN_UNIMPLEMENTED_() __pragma(warning(push)) + +#define SUPPRESS_BEGIN_(name) \ + __pragma(warning(push)) __pragma(warning(disable : name)) + +#define SUPPRESS_END() __pragma(warning(pop)) + +#else +#define SUPPRESS_BEGIN_UNIMPLEMENTED_() +#define SUPPRESS_END() +#endif + +// 'Public' macros. + +// Ignore -Wcomma warnings in Clang +#if defined(__clang__) +#define SUPPRESS_COMMA_WARNINGS_BEGIN() \ + SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wcomma\"") +#else +#define SUPPRESS_COMMA_WARNINGS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() +#endif + +// Ignore -Wdocumentation warnings in Clang +#if defined(__clang__) +#define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() \ + SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wdocumentation\"") +#else +#define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() +#endif + +// Ignore the use of deprecated declarations. +#if defined(__clang__) || defined(__GNUC__) +#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() \ + SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif defined(_MSC_VER) +// MSVC compiler warnings can be found here: (Look at the navbar on the left +// and select the appropriate range): +// https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-by-compiler-version?view=vs-2017 +#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() SUPPRESS_BEGIN_(4995) +#else +#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() +#endif + +#endif // FIRESTORE_CORE_SRC_UTIL_WARNINGS_H_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Firestore/third_party/nlohmann_json/json.hpp b/SaraAttended/Pods/FirebaseFirestore/Firestore/third_party/nlohmann_json/json.hpp new file mode 100644 index 0000000..a70aaf8 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Firestore/third_party/nlohmann_json/json.hpp @@ -0,0 +1,25447 @@ +/* + __ _____ _____ _____ + __| | __| | | | JSON for Modern C++ +| | |__ | | | | | | version 3.9.1 +|_____|_____|_____|_|___| https://github.com/nlohmann/json + +Licensed under the MIT License . +SPDX-License-Identifier: MIT +Copyright (c) 2013-2019 Niels Lohmann . + +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. +*/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#define NLOHMANN_JSON_VERSION_MAJOR 3 +#define NLOHMANN_JSON_VERSION_MINOR 9 +#define NLOHMANN_JSON_VERSION_PATCH 1 + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#include // istream, ostream +#include // random_access_iterator_tag +#include // unique_ptr +#include // accumulate +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include + + +#include + +// #include + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include + + +#include // exception +#include // runtime_error +#include // to_string + +// #include + + +#include // size_t + +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // pair +// #include +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 13) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 13 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP \ +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +#if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 +#endif + +// disable float-equal warnings on GCC/clang +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdocumentation" +#endif + +// allow to disable exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow to override assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + + +namespace nlohmann +{ +namespace detail +{ +//////////////// +// exceptions // +//////////////// + +/*! +@brief general exception of the @ref basic_json class + +This class is an extension of `std::exception` objects with a member @a id for +exception ids. It is used as the base class for all exceptions thrown by the +@ref basic_json class. This class can hence be used as "wildcard" to catch +exceptions. + +Subclasses: +- @ref parse_error for exceptions indicating a parse error +- @ref invalid_iterator for exceptions indicating errors with iterators +- @ref type_error for exceptions indicating executing a member function with + a wrong type +- @ref out_of_range for exceptions indicating access out of the defined range +- @ref other_error for exceptions indicating other library errors + +@internal +@note To have nothrow-copy-constructible exceptions, we internally use + `std::runtime_error` which can cope with arbitrary-length error messages. + Intermediate strings are built with static functions and then passed to + the actual constructor. +@endinternal + +@liveexample{The following code shows how arbitrary library exceptions can be +caught.,exception} + +@since version 3.0.0 +*/ +class exception : public std::exception +{ + public: + /// returns the explanatory string + JSON_HEDLEY_RETURNS_NON_NULL + const char* what() const noexcept override + { + return m.what(); + } + + /// the id of the exception + const int id; + + protected: + JSON_HEDLEY_NON_NULL(3) + exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} + + static std::string name(const std::string& ename, int id_) + { + return "[json.exception." + ename + "." + std::to_string(id_) + "] "; + } + + private: + /// an exception object as storage for error messages + std::runtime_error m; +}; + +/*! +@brief exception indicating a parse error + +This exception is thrown by the library when a parse error occurs. Parse errors +can occur during the deserialization of JSON text, CBOR, MessagePack, as well +as when using JSON Patch. + +Member @a byte holds the byte index of the last read character in the input +file. + +Exceptions have ids 1xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. +json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. +json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. +json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. +json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. +json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. +json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. +json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. +json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. +json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. +json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. +json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. +json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). +json.exception.parse_error.115 | parse error at byte 5: syntax error while parsing UBJSON high-precision number: invalid number text: 1A | A UBJSON high-precision number could not be parsed. + +@note For an input with n bytes, 1 is the index of the first character and n+1 + is the index of the terminating null byte or the end of file. This also + holds true when reading a byte vector (CBOR or MessagePack). + +@liveexample{The following code shows how a `parse_error` exception can be +caught.,parse_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class parse_error : public exception +{ + public: + /*! + @brief create a parse error exception + @param[in] id_ the id of the exception + @param[in] pos the position where the error occurred (or with + chars_read_total=0 if the position cannot be + determined) + @param[in] what_arg the explanatory string + @return parse_error object + */ + static parse_error create(int id_, const position_t& pos, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + position_string(pos) + ": " + what_arg; + return parse_error(id_, pos.chars_read_total, w.c_str()); + } + + static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + + ": " + what_arg; + return parse_error(id_, byte_, w.c_str()); + } + + /*! + @brief byte index of the parse error + + The byte index of the last read character in the input file. + + @note For an input with n bytes, 1 is the index of the first character and + n+1 is the index of the terminating null byte or the end of file. + This also holds true when reading a byte vector (CBOR or MessagePack). + */ + const std::size_t byte; + + private: + parse_error(int id_, std::size_t byte_, const char* what_arg) + : exception(id_, what_arg), byte(byte_) {} + + static std::string position_string(const position_t& pos) + { + return " at line " + std::to_string(pos.lines_read + 1) + + ", column " + std::to_string(pos.chars_read_current_line); + } +}; + +/*! +@brief exception indicating errors with iterators + +This exception is thrown if iterators passed to a library function do not match +the expected semantics. + +Exceptions have ids 2xx. + +name / id | example message | description +----------------------------------- | --------------- | ------------------------- +json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. +json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. +json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. +json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. +json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. +json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. +json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. +json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. +json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. +json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). + +@liveexample{The following code shows how an `invalid_iterator` exception can be +caught.,invalid_iterator} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class invalid_iterator : public exception +{ + public: + static invalid_iterator create(int id_, const std::string& what_arg) + { + std::string w = exception::name("invalid_iterator", id_) + what_arg; + return invalid_iterator(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + invalid_iterator(int id_, const char* what_arg) + : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating executing a member function with a wrong type + +This exception is thrown in case of a type error; that is, a library function is +executed on a JSON value whose type does not match the expected semantics. + +Exceptions have ids 3xx. + +name / id | example message | description +----------------------------- | --------------- | ------------------------- +json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. +json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. +json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. +json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. +json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. +json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. +json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. +json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. +json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. +json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. +json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. +json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. +json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. +json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. +json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. +json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | +json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | + +@liveexample{The following code shows how a `type_error` exception can be +caught.,type_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class type_error : public exception +{ + public: + static type_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("type_error", id_) + what_arg; + return type_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating access out of the defined range + +This exception is thrown in case a library function is called on an input +parameter that exceeds the expected range, for instance in case of array +indices or nonexisting object keys. + +Exceptions have ids 4xx. + +name / id | example message | description +------------------------------- | --------------- | ------------------------- +json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. +json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. +json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. +json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. +json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. +json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. +json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. (until version 3.8.0) | +json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | +json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | + +@liveexample{The following code shows how an `out_of_range` exception can be +caught.,out_of_range} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class out_of_range : public exception +{ + public: + static out_of_range create(int id_, const std::string& what_arg) + { + std::string w = exception::name("out_of_range", id_) + what_arg; + return out_of_range(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating other library errors + +This exception is thrown in case of errors that cannot be classified with the +other exception types. + +Exceptions have ids 5xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range + +@liveexample{The following code shows how an `other_error` exception can be +caught.,other_error} + +@since version 3.0.0 +*/ +class other_error : public exception +{ + public: + static other_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("other_error", id_) + what_arg; + return other_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type + +namespace nlohmann +{ +namespace detail +{ +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +template +using uncvref_t = typename std::remove_cv::type>::type; + +// implementation of C++14 index_sequence and affiliates +// source: https://stackoverflow.com/a/32223343 +template +struct index_sequence +{ + using type = index_sequence; + using value_type = std::size_t; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +template +struct merge_and_renumber; + +template +struct merge_and_renumber, index_sequence> + : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; + +template +struct make_index_sequence + : merge_and_renumber < typename make_index_sequence < N / 2 >::type, + typename make_index_sequence < N - N / 2 >::type > {}; + +template<> struct make_index_sequence<0> : index_sequence<> {}; +template<> struct make_index_sequence<1> : index_sequence<0> {}; + +template +using index_sequence_for = make_index_sequence; + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static constexpr T value{}; +}; + +template +constexpr T static_const::value; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // numeric_limits +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include + + +#include // random_access_iterator_tag + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include + +// #include + + +// https://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; +} // namespace detail +} // namespace nlohmann + +// #include +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ +#define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + +#include // int64_t, uint64_t +#include // map +#include // allocator +#include // string +#include // vector + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ +/*! +@brief default JSONSerializer template argument + +This serializer ignores the template arguments and uses ADL +([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) +for serialization. +*/ +template +struct adl_serializer; + +template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector> +class basic_json; + +/*! +@brief JSON Pointer + +A JSON pointer defines a string syntax for identifying a specific value +within a JSON document. It can be used with functions `at` and +`operator[]`. Furthermore, JSON pointers are the base for JSON patches. + +@sa [RFC 6901](https://tools.ietf.org/html/rfc6901) + +@since version 2.0.0 +*/ +template +class json_pointer; + +/*! +@brief default JSON class + +This type is the default specialization of the @ref basic_json class which +uses the standard template types. + +@since version 1.0.0 +*/ +using json = basic_json<>; + +template +struct ordered_map; + +/*! +@brief ordered JSON class + +This type preserves the insertion order of object keys. + +@since version 3.9.0 +*/ +using ordered_json = basic_json; + +} // namespace nlohmann + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +namespace nlohmann +{ +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using iterator_t = typename T::iterator; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, + enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + + +/////////////////// +// is_ functions // +/////////////////// + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +// source: https://stackoverflow.com/a/37193089/4116453 + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + std::is_constructible::value && + std::is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (std::is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (std::is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type_impl : std::false_type {}; + +template +struct is_compatible_string_type_impl < + BasicJsonType, CompatibleStringType, + enable_if_t::value >> +{ + static constexpr auto value = + std::is_constructible::value; +}; + +template +struct is_compatible_string_type + : is_compatible_string_type_impl {}; + +template +struct is_constructible_string_type_impl : std::false_type {}; + +template +struct is_constructible_string_type_impl < + BasicJsonType, ConstructibleStringType, + enable_if_t::value >> +{ + static constexpr auto value = + std::is_constructible::value; +}; + +template +struct is_constructible_string_type + : is_constructible_string_type_impl {}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < is_detected::value&& + is_detected::value&& +// This is needed because json_reverse_iterator has a ::iterator type... +// Therefore it is detected as a CompatibleArrayType. +// The real fix would be to have an Iterable concept. + !is_iterator_traits < + iterator_traits>::value >> +{ + static constexpr bool value = + std::is_constructible::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + std::is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_detected::value&& +is_complete_type < +detected_t>::value >> +{ + static constexpr bool value = + // This is needed because json_reverse_iterator has a ::iterator type, + // furthermore, std::back_insert_iterator (and other iterators) have a + // base class `iterator`... Therefore it is detected as a + // ConstructibleArrayType. The real fix would be to have an Iterable + // concept. + !is_iterator_traits>::value && + + (std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, typename ConstructibleArrayType::value_type >::value); +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + std::is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B1 { }; +template +struct conjunction +: std::conditional, B1>::type {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +namespace nlohmann +{ +namespace detail +{ +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +} +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +template +void from_json(const BasicJsonType& j, typename std::nullptr_t& n) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_null())) + { + JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); + } + n = nullptr; +} + +// overloads for basic_json template parameters +template < typename BasicJsonType, typename ArithmeticType, + enable_if_t < std::is_arithmetic::value&& + !std::is_same::value, + int > = 0 > +void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast(j)) + { + case value_t::number_unsigned: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_integer: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_float: + { + val = static_cast(*j.template get_ptr()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_boolean())) + { + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); + } + b = *j.template get_ptr(); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + s = *j.template get_ptr(); +} + +template < + typename BasicJsonType, typename ConstructibleStringType, + enable_if_t < + is_constructible_string_type::value&& + !std::is_same::value, + int > = 0 > +void from_json(const BasicJsonType& j, ConstructibleStringType& s) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + + s = *j.template get_ptr(); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val) +{ + get_arithmetic_value(j, val); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val) +{ + get_arithmetic_value(j, val); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val) +{ + get_arithmetic_value(j, val); +} + +template::value, int> = 0> +void from_json(const BasicJsonType& j, EnumType& e) +{ + typename std::underlying_type::type val; + get_arithmetic_value(j, val); + e = static_cast(val); +} + +// forward_list doesn't have an insert method +template::value, int> = 0> +void from_json(const BasicJsonType& j, std::forward_list& l) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.clear(); + std::transform(j.rbegin(), j.rend(), + std::front_inserter(l), [](const BasicJsonType & i) + { + return i.template get(); + }); +} + +// valarray doesn't have an insert method +template::value, int> = 0> +void from_json(const BasicJsonType& j, std::valarray& l) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.resize(j.size()); + std::transform(j.begin(), j.end(), std::begin(l), + [](const BasicJsonType & elem) + { + return elem.template get(); + }); +} + +template +auto from_json(const BasicJsonType& j, T (&arr)[N]) +-> decltype(j.template get(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get(); + } +} + +template +void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/) +{ + arr = *j.template get_ptr(); +} + +template +auto from_json_array_impl(const BasicJsonType& j, std::array& arr, + priority_tag<2> /*unused*/) +-> decltype(j.template get(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get(); + } +} + +template +auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/) +-> decltype( + arr.reserve(std::declval()), + j.template get(), + void()) +{ + using std::end; + + ConstructibleArrayType ret; + ret.reserve(j.size()); + std::transform(j.begin(), j.end(), + std::inserter(ret, end(ret)), [](const BasicJsonType & i) + { + // get() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get(); + }); + arr = std::move(ret); +} + +template +void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, + priority_tag<0> /*unused*/) +{ + using std::end; + + ConstructibleArrayType ret; + std::transform( + j.begin(), j.end(), std::inserter(ret, end(ret)), + [](const BasicJsonType & i) + { + // get() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get(); + }); + arr = std::move(ret); +} + +template < typename BasicJsonType, typename ConstructibleArrayType, + enable_if_t < + is_constructible_array_type::value&& + !is_constructible_object_type::value&& + !is_constructible_string_type::value&& + !std::is_same::value&& + !is_basic_json::value, + int > = 0 > +auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) +-> decltype(from_json_array_impl(j, arr, priority_tag<3> {}), +j.template get(), +void()) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + + std::string(j.type_name()))); + } + + from_json_array_impl(j, arr, priority_tag<3> {}); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t& bin) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_binary())) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(j.type_name()))); + } + + bin = *j.template get_ptr(); +} + +template::value, int> = 0> +void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_object())) + { + JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); + } + + ConstructibleObjectType ret; + auto inner_object = j.template get_ptr(); + using value_type = typename ConstructibleObjectType::value_type; + std::transform( + inner_object->begin(), inner_object->end(), + std::inserter(ret, ret.begin()), + [](typename BasicJsonType::object_t::value_type const & p) + { + return value_type(p.first, p.second.template get()); + }); + obj = std::move(ret); +} + +// overload for arithmetic types, not chosen for basic_json template arguments +// (BooleanType, etc..); note: Is it really necessary to provide explicit +// overloads for boolean_t etc. in case of a custom BooleanType which is not +// an arithmetic type? +template < typename BasicJsonType, typename ArithmeticType, + enable_if_t < + std::is_arithmetic::value&& + !std::is_same::value&& + !std::is_same::value&& + !std::is_same::value&& + !std::is_same::value, + int > = 0 > +void from_json(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast(j)) + { + case value_t::number_unsigned: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_integer: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_float: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::boolean: + { + val = static_cast(*j.template get_ptr()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template +void from_json(const BasicJsonType& j, std::pair& p) +{ + p = {j.at(0).template get(), j.at(1).template get()}; +} + +template +void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_sequence /*unused*/) +{ + t = std::make_tuple(j.at(Idx).template get::type>()...); +} + +template +void from_json(const BasicJsonType& j, std::tuple& t) +{ + from_json_tuple_impl(j, t, index_sequence_for {}); +} + +template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator, + typename = enable_if_t < !std::is_constructible < + typename BasicJsonType::string_t, Key >::value >> +void from_json(const BasicJsonType& j, std::map& m) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(!p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get(), p.at(1).template get()); + } +} + +template < typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator, + typename = enable_if_t < !std::is_constructible < + typename BasicJsonType::string_t, Key >::value >> +void from_json(const BasicJsonType& j, std::unordered_map& m) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(!p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get(), p.at(1).template get()); + } +} + +struct from_json_fn +{ + template + auto operator()(const BasicJsonType& j, T& val) const + noexcept(noexcept(from_json(j, val))) + -> decltype(from_json(j, val), void()) + { + return from_json(j, val); + } +}; +} // namespace detail + +/// namespace to hold default `from_json` function +/// to see why this is required: +/// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html +namespace +{ +constexpr const auto& from_json = detail::static_const::value; +} // namespace +} // namespace nlohmann + +// #include + + +#include // copy +#include // begin, end +#include // string +#include // tuple, get +#include // is_same, is_constructible, is_floating_point, is_enum, underlying_type +#include // move, forward, declval, pair +#include // valarray +#include // vector + +// #include + + +#include // size_t +#include // input_iterator_tag +#include // string, to_string +#include // tuple_size, get, tuple_element + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +void int_to_string( string_type& target, std::size_t value ) +{ + // For ADL + using std::to_string; + target = to_string(value); +} +template class iteration_proxy_value +{ + public: + using difference_type = std::ptrdiff_t; + using value_type = iteration_proxy_value; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::input_iterator_tag; + using string_type = typename std::remove_cv< typename std::remove_reference().key() ) >::type >::type; + + private: + /// the iterator + IteratorType anchor; + /// an index for arrays (used to create key names) + std::size_t array_index = 0; + /// last stringified array index + mutable std::size_t array_index_last = 0; + /// a string representation of the array index + mutable string_type array_index_str = "0"; + /// an empty string (to return a reference for primitive values) + const string_type empty_str = ""; + + public: + explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {} + + /// dereference operator (needed for range-based for) + iteration_proxy_value& operator*() + { + return *this; + } + + /// increment operator (needed for range-based for) + iteration_proxy_value& operator++() + { + ++anchor; + ++array_index; + + return *this; + } + + /// equality operator (needed for InputIterator) + bool operator==(const iteration_proxy_value& o) const + { + return anchor == o.anchor; + } + + /// inequality operator (needed for range-based for) + bool operator!=(const iteration_proxy_value& o) const + { + return anchor != o.anchor; + } + + /// return key of the iterator + const string_type& key() const + { + JSON_ASSERT(anchor.m_object != nullptr); + + switch (anchor.m_object->type()) + { + // use integer array index as key + case value_t::array: + { + if (array_index != array_index_last) + { + int_to_string( array_index_str, array_index ); + array_index_last = array_index; + } + return array_index_str; + } + + // use key from the object + case value_t::object: + return anchor.key(); + + // use an empty key for all primitive types + default: + return empty_str; + } + } + + /// return value of the iterator + typename IteratorType::reference value() const + { + return anchor.value(); + } +}; + +/// proxy class for the items() function +template class iteration_proxy +{ + private: + /// the container to iterate + typename IteratorType::reference container; + + public: + /// construct iteration proxy from a container + explicit iteration_proxy(typename IteratorType::reference cont) noexcept + : container(cont) {} + + /// return iterator begin (needed for range-based for) + iteration_proxy_value begin() noexcept + { + return iteration_proxy_value(container.begin()); + } + + /// return iterator end (needed for range-based for) + iteration_proxy_value end() noexcept + { + return iteration_proxy_value(container.end()); + } +}; +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template = 0> +auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.key()) +{ + return i.key(); +} +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template = 0> +auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.value()) +{ + return i.value(); +} +} // namespace detail +} // namespace nlohmann + +// The Addition to the STD Namespace is required to add +// Structured Bindings Support to the iteration_proxy_value class +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +namespace std +{ +#if defined(__clang__) + // Fix: https://github.com/nlohmann/json/issues/1401 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmismatched-tags" +#endif +template +class tuple_size<::nlohmann::detail::iteration_proxy_value> + : public std::integral_constant {}; + +template +class tuple_element> +{ + public: + using type = decltype( + get(std::declval < + ::nlohmann::detail::iteration_proxy_value> ())); +}; +#if defined(__clang__) + #pragma clang diagnostic pop +#endif +} // namespace std + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +////////////////// +// constructors // +////////////////// + +template struct external_constructor; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept + { + j.m_type = value_t::boolean; + j.m_value = b; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s) + { + j.m_type = value_t::string; + j.m_value = s; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s) + { + j.m_type = value_t::string; + j.m_value = std::move(s); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleStringType, + enable_if_t < !std::is_same::value, + int > = 0 > + static void construct(BasicJsonType& j, const CompatibleStringType& str) + { + j.m_type = value_t::string; + j.m_value.string = j.template create(str); + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::binary_t value{b}; + j.m_value = value; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::binary_t value{std::move(b)}; + j.m_value = value; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept + { + j.m_type = value_t::number_float; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept + { + j.m_type = value_t::number_unsigned; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept + { + j.m_type = value_t::number_integer; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr) + { + j.m_type = value_t::array; + j.m_value = arr; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr) + { + j.m_type = value_t::array; + j.m_value = std::move(arr); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleArrayType, + enable_if_t < !std::is_same::value, + int > = 0 > + static void construct(BasicJsonType& j, const CompatibleArrayType& arr) + { + using std::begin; + using std::end; + j.m_type = value_t::array; + j.m_value.array = j.template create(begin(arr), end(arr)); + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, const std::vector& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->reserve(arr.size()); + for (const bool x : arr) + { + j.m_value.array->push_back(x); + } + j.assert_invariant(); + } + + template::value, int> = 0> + static void construct(BasicJsonType& j, const std::valarray& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->resize(arr.size()); + if (arr.size() > 0) + { + std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin()); + } + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj) + { + j.m_type = value_t::object; + j.m_value = obj; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj) + { + j.m_type = value_t::object; + j.m_value = std::move(obj); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleObjectType, + enable_if_t < !std::is_same::value, int > = 0 > + static void construct(BasicJsonType& j, const CompatibleObjectType& obj) + { + using std::begin; + using std::end; + + j.m_type = value_t::object; + j.m_value.object = j.template create(begin(obj), end(obj)); + j.assert_invariant(); + } +}; + +///////////// +// to_json // +///////////// + +template::value, int> = 0> +void to_json(BasicJsonType& j, T b) noexcept +{ + external_constructor::construct(j, b); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, const CompatibleString& s) +{ + external_constructor::construct(j, s); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s) +{ + external_constructor::construct(j, std::move(s)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, FloatType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, EnumType e) noexcept +{ + using underlying_type = typename std::underlying_type::type; + external_constructor::construct(j, static_cast(e)); +} + +template +void to_json(BasicJsonType& j, const std::vector& e) +{ + external_constructor::construct(j, e); +} + +template < typename BasicJsonType, typename CompatibleArrayType, + enable_if_t < is_compatible_array_type::value&& + !is_compatible_object_type::value&& + !is_compatible_string_type::value&& + !std::is_same::value&& + !is_basic_json::value, + int > = 0 > +void to_json(BasicJsonType& j, const CompatibleArrayType& arr) +{ + external_constructor::construct(j, arr); +} + +template +void to_json(BasicJsonType& j, const typename BasicJsonType::binary_t& bin) +{ + external_constructor::construct(j, bin); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, const std::valarray& arr) +{ + external_constructor::construct(j, std::move(arr)); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr) +{ + external_constructor::construct(j, std::move(arr)); +} + +template < typename BasicJsonType, typename CompatibleObjectType, + enable_if_t < is_compatible_object_type::value&& !is_basic_json::value, int > = 0 > +void to_json(BasicJsonType& j, const CompatibleObjectType& obj) +{ + external_constructor::construct(j, obj); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj) +{ + external_constructor::construct(j, std::move(obj)); +} + +template < + typename BasicJsonType, typename T, std::size_t N, + enable_if_t < !std::is_constructible::value, + int > = 0 > +void to_json(BasicJsonType& j, const T(&arr)[N]) +{ + external_constructor::construct(j, arr); +} + +template < typename BasicJsonType, typename T1, typename T2, enable_if_t < std::is_constructible::value&& std::is_constructible::value, int > = 0 > +void to_json(BasicJsonType& j, const std::pair& p) +{ + j = { p.first, p.second }; +} + +// for https://github.com/nlohmann/json/pull/1134 +template>::value, int> = 0> +void to_json(BasicJsonType& j, const T& b) +{ + j = { {b.key(), b.value()} }; +} + +template +void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence /*unused*/) +{ + j = { std::get(t)... }; +} + +template::value, int > = 0> +void to_json(BasicJsonType& j, const T& t) +{ + to_json_tuple_impl(j, t, make_index_sequence::value> {}); +} + +struct to_json_fn +{ + template + auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward(val)))) + -> decltype(to_json(j, std::forward(val)), void()) + { + return to_json(j, std::forward(val)); + } +}; +} // namespace detail + +/// namespace to hold default `to_json` function +namespace +{ +constexpr const auto& to_json = detail::static_const::value; +} // namespace +} // namespace nlohmann + + +namespace nlohmann +{ + +template +struct adl_serializer +{ + /*! + @brief convert a JSON value to any value type + + This function is usually called by the `get()` function of the + @ref basic_json class (either explicit or via conversion operators). + + @param[in] j JSON value to read from + @param[in,out] val value to write to + */ + template + static auto from_json(BasicJsonType&& j, ValueType& val) noexcept( + noexcept(::nlohmann::from_json(std::forward(j), val))) + -> decltype(::nlohmann::from_json(std::forward(j), val), void()) + { + ::nlohmann::from_json(std::forward(j), val); + } + + /*! + @brief convert any value type to a JSON value + + This function is usually called by the constructors of the @ref basic_json + class. + + @param[in,out] j JSON value to write to + @param[in] val value to read from + */ + template + static auto to_json(BasicJsonType& j, ValueType&& val) noexcept( + noexcept(::nlohmann::to_json(j, std::forward(val)))) + -> decltype(::nlohmann::to_json(j, std::forward(val)), void()) + { + ::nlohmann::to_json(j, std::forward(val)); + } +}; + +} // namespace nlohmann + +// #include + + +#include // uint8_t +#include // tie +#include // move + +namespace nlohmann +{ + +/*! +@brief an internal type for a backed binary type + +This type extends the template parameter @a BinaryType provided to `basic_json` +with a subtype used by BSON and MessagePack. This type exists so that the user +does not have to specify a type themselves with a specific naming scheme in +order to override the binary type. + +@tparam BinaryType container to store bytes (`std::vector` by + default) + +@since version 3.8.0 +*/ +template +class byte_container_with_subtype : public BinaryType +{ + public: + /// the type of the underlying container + using container_type = BinaryType; + + byte_container_with_subtype() noexcept(noexcept(container_type())) + : container_type() + {} + + byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b))) + : container_type(b) + {} + + byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b)))) + : container_type(std::move(b)) + {} + + byte_container_with_subtype(const container_type& b, std::uint8_t subtype) noexcept(noexcept(container_type(b))) + : container_type(b) + , m_subtype(subtype) + , m_has_subtype(true) + {} + + byte_container_with_subtype(container_type&& b, std::uint8_t subtype) noexcept(noexcept(container_type(std::move(b)))) + : container_type(std::move(b)) + , m_subtype(subtype) + , m_has_subtype(true) + {} + + bool operator==(const byte_container_with_subtype& rhs) const + { + return std::tie(static_cast(*this), m_subtype, m_has_subtype) == + std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype); + } + + bool operator!=(const byte_container_with_subtype& rhs) const + { + return !(rhs == *this); + } + + /*! + @brief sets the binary subtype + + Sets the binary subtype of the value, also flags a binary JSON value as + having a subtype, which has implications for serialization. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + void set_subtype(std::uint8_t subtype) noexcept + { + m_subtype = subtype; + m_has_subtype = true; + } + + /*! + @brief return the binary subtype + + Returns the numerical subtype of the value if it has a subtype. If it does + not have a subtype, this function will return size_t(-1) as a sentinel + value. + + @return the numerical subtype of the binary value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + constexpr std::uint8_t subtype() const noexcept + { + return m_subtype; + } + + /*! + @brief return whether the value has a subtype + + @return whether the value has a subtype + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + + @since version 3.8.0 + */ + constexpr bool has_subtype() const noexcept + { + return m_has_subtype; + } + + /*! + @brief clears the binary subtype + + Clears the binary subtype and flags the value as not having a subtype, which + has implications for serialization; for instance MessagePack will prefer the + bin family over the ext family. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + void clear_subtype() noexcept + { + m_subtype = 0; + m_has_subtype = false; + } + + private: + std::uint8_t m_subtype = 0; + bool m_has_subtype = false; +}; + +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + + +#include // size_t, uint8_t +#include // hash + +namespace nlohmann +{ +namespace detail +{ + +// boost::hash_combine +inline std::size_t combine(std::size_t seed, std::size_t h) noexcept +{ + seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U); + return seed; +} + +/*! +@brief hash a JSON value + +The hash function tries to rely on std::hash where possible. Furthermore, the +type of the JSON value is taken into account to have different hash values for +null, 0, 0U, and false, etc. + +@tparam BasicJsonType basic_json specialization +@param j JSON value to hash +@return hash value of j +*/ +template +std::size_t hash(const BasicJsonType& j) +{ + using string_t = typename BasicJsonType::string_t; + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + + const auto type = static_cast(j.type()); + switch (j.type()) + { + case BasicJsonType::value_t::null: + case BasicJsonType::value_t::discarded: + { + return combine(type, 0); + } + + case BasicJsonType::value_t::object: + { + auto seed = combine(type, j.size()); + for (const auto& element : j.items()) + { + const auto h = std::hash {}(element.key()); + seed = combine(seed, h); + seed = combine(seed, hash(element.value())); + } + return seed; + } + + case BasicJsonType::value_t::array: + { + auto seed = combine(type, j.size()); + for (const auto& element : j) + { + seed = combine(seed, hash(element)); + } + return seed; + } + + case BasicJsonType::value_t::string: + { + const auto h = std::hash {}(j.template get_ref()); + return combine(type, h); + } + + case BasicJsonType::value_t::boolean: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case BasicJsonType::value_t::number_integer: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::number_unsigned: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::number_float: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::binary: + { + auto seed = combine(type, j.get_binary().size()); + const auto h = std::hash {}(j.get_binary().has_subtype()); + seed = combine(seed, h); + seed = combine(seed, j.get_binary().subtype()); + for (const auto byte : j.get_binary()) + { + seed = combine(seed, std::hash {}(byte)); + } + return seed; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } +} + +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // generate_n +#include // array +#include // ldexp +#include // size_t +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // snprintf +#include // memcpy +#include // back_inserter +#include // numeric_limits +#include // char_traits, string +#include // make_pair, move + +// #include + +// #include + + +#include // array +#include // size_t +#include //FILE * +#include // strlen +#include // istream +#include // begin, end, iterator_traits, random_access_iterator_tag, distance, next +#include // shared_ptr, make_shared, addressof +#include // accumulate +#include // string, char_traits +#include // enable_if, is_base_of, is_pointer, is_integral, remove_pointer +#include // pair, declval + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/// the supported input formats +enum class input_format_t { json, cbor, msgpack, ubjson, bson }; + +//////////////////// +// input adapters // +//////////////////// + +/*! +Input adapter for stdio file access. This adapter read only 1 byte and do not use any + buffer. This adapter is a very low level adapter. +*/ +class file_input_adapter +{ + public: + using char_type = char; + + JSON_HEDLEY_NON_NULL(2) + explicit file_input_adapter(std::FILE* f) noexcept + : m_file(f) + {} + + // make class move-only + file_input_adapter(const file_input_adapter&) = delete; + file_input_adapter(file_input_adapter&&) = default; + file_input_adapter& operator=(const file_input_adapter&) = delete; + file_input_adapter& operator=(file_input_adapter&&) = delete; + + std::char_traits::int_type get_character() noexcept + { + return std::fgetc(m_file); + } + + private: + /// the file pointer to read from + std::FILE* m_file; +}; + + +/*! +Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at +beginning of input. Does not support changing the underlying std::streambuf +in mid-input. Maintains underlying std::istream and std::streambuf to support +subsequent use of standard std::istream operations to process any input +characters following those used in parsing the JSON input. Clears the +std::istream flags; any input errors (e.g., EOF) will be detected by the first +subsequent call for input from the std::istream. +*/ +class input_stream_adapter +{ + public: + using char_type = char; + + ~input_stream_adapter() + { + // clear stream flags; we use underlying streambuf I/O, do not + // maintain ifstream flags, except eof + if (is != nullptr) + { + is->clear(is->rdstate() & std::ios::eofbit); + } + } + + explicit input_stream_adapter(std::istream& i) + : is(&i), sb(i.rdbuf()) + {} + + // delete because of pointer members + input_stream_adapter(const input_stream_adapter&) = delete; + input_stream_adapter& operator=(input_stream_adapter&) = delete; + input_stream_adapter& operator=(input_stream_adapter&& rhs) = delete; + + input_stream_adapter(input_stream_adapter&& rhs) noexcept : is(rhs.is), sb(rhs.sb) + { + rhs.is = nullptr; + rhs.sb = nullptr; + } + + // std::istream/std::streambuf use std::char_traits::to_int_type, to + // ensure that std::char_traits::eof() and the character 0xFF do not + // end up as the same value, eg. 0xFFFFFFFF. + std::char_traits::int_type get_character() + { + auto res = sb->sbumpc(); + // set eof manually, as we don't use the istream interface. + if (JSON_HEDLEY_UNLIKELY(res == EOF)) + { + is->clear(is->rdstate() | std::ios::eofbit); + } + return res; + } + + private: + /// the associated input stream + std::istream* is = nullptr; + std::streambuf* sb = nullptr; +}; + +// General-purpose iterator-based adapter. It might not be as fast as +// theoretically possible for some containers, but it is extremely versatile. +template +class iterator_input_adapter +{ + public: + using char_type = typename std::iterator_traits::value_type; + + iterator_input_adapter(IteratorType first, IteratorType last) + : current(std::move(first)), end(std::move(last)) {} + + typename std::char_traits::int_type get_character() + { + if (JSON_HEDLEY_LIKELY(current != end)) + { + auto result = std::char_traits::to_int_type(*current); + std::advance(current, 1); + return result; + } + else + { + return std::char_traits::eof(); + } + } + + private: + IteratorType current; + IteratorType end; + + template + friend struct wide_string_input_helper; + + bool empty() const + { + return current == end; + } + +}; + + +template +struct wide_string_input_helper; + +template +struct wide_string_input_helper +{ + // UTF-32 + static void fill_buffer(BaseInputAdapter& input, + std::array::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (JSON_HEDLEY_UNLIKELY(input.empty())) + { + utf8_bytes[0] = std::char_traits::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = input.get_character(); + + // UTF-32 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast::int_type>(0xC0u | ((static_cast(wc) >> 6u) & 0x1Fu)); + utf8_bytes[1] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (wc <= 0xFFFF) + { + utf8_bytes[0] = static_cast::int_type>(0xE0u | ((static_cast(wc) >> 12u) & 0x0Fu)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 3; + } + else if (wc <= 0x10FFFF) + { + utf8_bytes[0] = static_cast::int_type>(0xF0u | ((static_cast(wc) >> 18u) & 0x07u)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + // unknown character + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } +}; + +template +struct wide_string_input_helper +{ + // UTF-16 + static void fill_buffer(BaseInputAdapter& input, + std::array::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (JSON_HEDLEY_UNLIKELY(input.empty())) + { + utf8_bytes[0] = std::char_traits::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = input.get_character(); + + // UTF-16 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast::int_type>(0xC0u | ((static_cast(wc) >> 6u))); + utf8_bytes[1] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (0xD800 > wc || wc >= 0xE000) + { + utf8_bytes[0] = static_cast::int_type>(0xE0u | ((static_cast(wc) >> 12u))); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 3; + } + else + { + if (JSON_HEDLEY_UNLIKELY(!input.empty())) + { + const auto wc2 = static_cast(input.get_character()); + const auto charcode = 0x10000u + (((static_cast(wc) & 0x3FFu) << 10u) | (wc2 & 0x3FFu)); + utf8_bytes[0] = static_cast::int_type>(0xF0u | (charcode >> 18u)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((charcode >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | ((charcode >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast::int_type>(0x80u | (charcode & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } + } +}; + +// Wraps another input apdater to convert wide character types into individual bytes. +template +class wide_string_input_adapter +{ + public: + using char_type = char; + + wide_string_input_adapter(BaseInputAdapter base) + : base_adapter(base) {} + + typename std::char_traits::int_type get_character() noexcept + { + // check if buffer needs to be filled + if (utf8_bytes_index == utf8_bytes_filled) + { + fill_buffer(); + + JSON_ASSERT(utf8_bytes_filled > 0); + JSON_ASSERT(utf8_bytes_index == 0); + } + + // use buffer + JSON_ASSERT(utf8_bytes_filled > 0); + JSON_ASSERT(utf8_bytes_index < utf8_bytes_filled); + return utf8_bytes[utf8_bytes_index++]; + } + + private: + BaseInputAdapter base_adapter; + + template + void fill_buffer() + { + wide_string_input_helper::fill_buffer(base_adapter, utf8_bytes, utf8_bytes_index, utf8_bytes_filled); + } + + /// a buffer for UTF-8 bytes + std::array::int_type, 4> utf8_bytes = {{0, 0, 0, 0}}; + + /// index to the utf8_codes array for the next valid byte + std::size_t utf8_bytes_index = 0; + /// number of valid bytes in the utf8_codes array + std::size_t utf8_bytes_filled = 0; +}; + + +template +struct iterator_input_adapter_factory +{ + using iterator_type = IteratorType; + using char_type = typename std::iterator_traits::value_type; + using adapter_type = iterator_input_adapter; + + static adapter_type create(IteratorType first, IteratorType last) + { + return adapter_type(std::move(first), std::move(last)); + } +}; + +template +struct is_iterator_of_multibyte +{ + using value_type = typename std::iterator_traits::value_type; + enum + { + value = sizeof(value_type) > 1 + }; +}; + +template +struct iterator_input_adapter_factory::value>> +{ + using iterator_type = IteratorType; + using char_type = typename std::iterator_traits::value_type; + using base_adapter_type = iterator_input_adapter; + using adapter_type = wide_string_input_adapter; + + static adapter_type create(IteratorType first, IteratorType last) + { + return adapter_type(base_adapter_type(std::move(first), std::move(last))); + } +}; + +// General purpose iterator-based input +template +typename iterator_input_adapter_factory::adapter_type input_adapter(IteratorType first, IteratorType last) +{ + using factory_type = iterator_input_adapter_factory; + return factory_type::create(first, last); +} + +// Convenience shorthand from container to iterator +template +auto input_adapter(const ContainerType& container) -> decltype(input_adapter(begin(container), end(container))) +{ + // Enable ADL + using std::begin; + using std::end; + + return input_adapter(begin(container), end(container)); +} + +// Special cases with fast paths +inline file_input_adapter input_adapter(std::FILE* file) +{ + return file_input_adapter(file); +} + +inline input_stream_adapter input_adapter(std::istream& stream) +{ + return input_stream_adapter(stream); +} + +inline input_stream_adapter input_adapter(std::istream&& stream) +{ + return input_stream_adapter(stream); +} + +using contiguous_bytes_input_adapter = decltype(input_adapter(std::declval(), std::declval())); + +// Null-delimited strings, and the like. +template < typename CharT, + typename std::enable_if < + std::is_pointer::value&& + !std::is_array::value&& + std::is_integral::type>::value&& + sizeof(typename std::remove_pointer::type) == 1, + int >::type = 0 > +contiguous_bytes_input_adapter input_adapter(CharT b) +{ + auto length = std::strlen(reinterpret_cast(b)); + const auto* ptr = reinterpret_cast(b); + return input_adapter(ptr, ptr + length); +} + +template +auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, array + N)) +{ + return input_adapter(array, array + N); +} + +// This class only handles inputs of input_buffer_adapter type. +// It's required so that expressions like {ptr, len} can be implicitely casted +// to the correct adapter. +class span_input_adapter +{ + public: + template < typename CharT, + typename std::enable_if < + std::is_pointer::value&& + std::is_integral::type>::value&& + sizeof(typename std::remove_pointer::type) == 1, + int >::type = 0 > + span_input_adapter(CharT b, std::size_t l) + : ia(reinterpret_cast(b), reinterpret_cast(b) + l) {} + + template::iterator_category, std::random_access_iterator_tag>::value, + int>::type = 0> + span_input_adapter(IteratorType first, IteratorType last) + : ia(input_adapter(first, last)) {} + + contiguous_bytes_input_adapter&& get() + { + return std::move(ia); + } + + private: + contiguous_bytes_input_adapter ia; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include +#include // string +#include // move +#include // vector + +// #include + +// #include + + +namespace nlohmann +{ + +/*! +@brief SAX interface + +This class describes the SAX interface used by @ref nlohmann::json::sax_parse. +Each function is called in different situations while the input is parsed. The +boolean return value informs the parser whether to continue processing the +input. +*/ +template +struct json_sax +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @brief a null value was read + @return whether parsing should proceed + */ + virtual bool null() = 0; + + /*! + @brief a boolean value was read + @param[in] val boolean value + @return whether parsing should proceed + */ + virtual bool boolean(bool val) = 0; + + /*! + @brief an integer number was read + @param[in] val integer value + @return whether parsing should proceed + */ + virtual bool number_integer(number_integer_t val) = 0; + + /*! + @brief an unsigned integer number was read + @param[in] val unsigned integer value + @return whether parsing should proceed + */ + virtual bool number_unsigned(number_unsigned_t val) = 0; + + /*! + @brief an floating-point number was read + @param[in] val floating-point value + @param[in] s raw token value + @return whether parsing should proceed + */ + virtual bool number_float(number_float_t val, const string_t& s) = 0; + + /*! + @brief a string was read + @param[in] val string value + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool string(string_t& val) = 0; + + /*! + @brief a binary string was read + @param[in] val binary value + @return whether parsing should proceed + @note It is safe to move the passed binary. + */ + virtual bool binary(binary_t& val) = 0; + + /*! + @brief the beginning of an object was read + @param[in] elements number of object elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_object(std::size_t elements) = 0; + + /*! + @brief an object key was read + @param[in] val object key + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool key(string_t& val) = 0; + + /*! + @brief the end of an object was read + @return whether parsing should proceed + */ + virtual bool end_object() = 0; + + /*! + @brief the beginning of an array was read + @param[in] elements number of array elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_array(std::size_t elements) = 0; + + /*! + @brief the end of an array was read + @return whether parsing should proceed + */ + virtual bool end_array() = 0; + + /*! + @brief a parse error occurred + @param[in] position the position in the input where the error occurs + @param[in] last_token the last read token + @param[in] ex an exception object describing the error + @return whether parsing should proceed (must return false) + */ + virtual bool parse_error(std::size_t position, + const std::string& last_token, + const detail::exception& ex) = 0; + + virtual ~json_sax() = default; +}; + + +namespace detail +{ +/*! +@brief SAX implementation to create a JSON value from SAX events + +This class implements the @ref json_sax interface and processes the SAX events +to create a JSON value which makes it basically a DOM parser. The structure or +hierarchy of the JSON value is managed by the stack `ref_stack` which contains +a pointer to the respective array or object for each recursion depth. + +After successful parsing, the value that is passed by reference to the +constructor contains the parsed value. + +@tparam BasicJsonType the JSON type +*/ +template +class json_sax_dom_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @param[in, out] r reference to a JSON value that is manipulated while + parsing + @param[in] allow_exceptions_ whether parse errors yield exceptions + */ + explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_exceptions_ = true) + : root(r), allow_exceptions(allow_exceptions_) + {} + + // make class move-only + json_sax_dom_parser(const json_sax_dom_parser&) = delete; + json_sax_dom_parser(json_sax_dom_parser&&) = default; + json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete; + json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default; + ~json_sax_dom_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_value(std::move(val)); + return true; + } + + bool start_object(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + // add null at given key and store the reference for later + object_element = &(ref_stack.back()->m_value.object->operator[](val)); + return true; + } + + bool end_object() + { + ref_stack.pop_back(); + return true; + } + + bool start_array(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + ref_stack.pop_back(); + return true; + } + + template + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const Exception& ex) + { + errored = true; + static_cast(ex); + if (allow_exceptions) + { + JSON_THROW(ex); + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + */ + template + JSON_HEDLEY_RETURNS_NON_NULL + BasicJsonType* handle_value(Value&& v) + { + if (ref_stack.empty()) + { + root = BasicJsonType(std::forward(v)); + return &root; + } + + JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); + + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->emplace_back(std::forward(v)); + return &(ref_stack.back()->m_value.array->back()); + } + + JSON_ASSERT(ref_stack.back()->is_object()); + JSON_ASSERT(object_element); + *object_element = BasicJsonType(std::forward(v)); + return object_element; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector ref_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; + +template +class json_sax_dom_callback_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using parser_callback_t = typename BasicJsonType::parser_callback_t; + using parse_event_t = typename BasicJsonType::parse_event_t; + + json_sax_dom_callback_parser(BasicJsonType& r, + const parser_callback_t cb, + const bool allow_exceptions_ = true) + : root(r), callback(cb), allow_exceptions(allow_exceptions_) + { + keep_stack.push_back(true); + } + + // make class move-only + json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = default; + json_sax_dom_callback_parser& operator=(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser& operator=(json_sax_dom_callback_parser&&) = default; + ~json_sax_dom_callback_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_value(std::move(val)); + return true; + } + + bool start_object(std::size_t len) + { + // check callback for object start + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::object_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::object, true); + ref_stack.push_back(val.second); + + // check object limit + if (ref_stack.back() && JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + BasicJsonType k = BasicJsonType(val); + + // check callback for key + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::key, k); + key_keep_stack.push_back(keep); + + // add discarded value at given key and store the reference for later + if (keep && ref_stack.back()) + { + object_element = &(ref_stack.back()->m_value.object->operator[](val) = discarded); + } + + return true; + } + + bool end_object() + { + if (ref_stack.back() && !callback(static_cast(ref_stack.size()) - 1, parse_event_t::object_end, *ref_stack.back())) + { + // discard object + *ref_stack.back() = discarded; + } + + JSON_ASSERT(!ref_stack.empty()); + JSON_ASSERT(!keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + if (!ref_stack.empty() && ref_stack.back() && ref_stack.back()->is_structured()) + { + // remove discarded value + for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it) + { + if (it->is_discarded()) + { + ref_stack.back()->erase(it); + break; + } + } + } + + return true; + } + + bool start_array(std::size_t len) + { + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::array_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::array, true); + ref_stack.push_back(val.second); + + // check array limit + if (ref_stack.back() && JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + bool keep = true; + + if (ref_stack.back()) + { + keep = callback(static_cast(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back()); + if (!keep) + { + // discard array + *ref_stack.back() = discarded; + } + } + + JSON_ASSERT(!ref_stack.empty()); + JSON_ASSERT(!keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + // remove discarded value + if (!keep && !ref_stack.empty() && ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->pop_back(); + } + + return true; + } + + template + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const Exception& ex) + { + errored = true; + static_cast(ex); + if (allow_exceptions) + { + JSON_THROW(ex); + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @param[in] v value to add to the JSON value we build during parsing + @param[in] skip_callback whether we should skip calling the callback + function; this is required after start_array() and + start_object() SAX events, because otherwise we would call the + callback function with an empty array or object, respectively. + + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + + @return pair of boolean (whether value should be kept) and pointer (to the + passed value in the ref_stack hierarchy; nullptr if not kept) + */ + template + std::pair handle_value(Value&& v, const bool skip_callback = false) + { + JSON_ASSERT(!keep_stack.empty()); + + // do not handle this value if we know it would be added to a discarded + // container + if (!keep_stack.back()) + { + return {false, nullptr}; + } + + // create value + auto value = BasicJsonType(std::forward(v)); + + // check callback + const bool keep = skip_callback || callback(static_cast(ref_stack.size()), parse_event_t::value, value); + + // do not handle this value if we just learnt it shall be discarded + if (!keep) + { + return {false, nullptr}; + } + + if (ref_stack.empty()) + { + root = std::move(value); + return {true, &root}; + } + + // skip this value if we already decided to skip the parent + // (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) + if (!ref_stack.back()) + { + return {false, nullptr}; + } + + // we now only expect arrays and objects + JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); + + // array + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->push_back(std::move(value)); + return {true, &(ref_stack.back()->m_value.array->back())}; + } + + // object + JSON_ASSERT(ref_stack.back()->is_object()); + // check if we should store an element for the current key + JSON_ASSERT(!key_keep_stack.empty()); + const bool store_element = key_keep_stack.back(); + key_keep_stack.pop_back(); + + if (!store_element) + { + return {false, nullptr}; + } + + JSON_ASSERT(object_element); + *object_element = std::move(value); + return {true, object_element}; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector ref_stack {}; + /// stack to manage which values to keep + std::vector keep_stack {}; + /// stack to manage which object keys to keep + std::vector key_keep_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// callback function + const parser_callback_t callback = nullptr; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; + /// a discarded value for the callback + BasicJsonType discarded = BasicJsonType::value_t::discarded; +}; + +template +class json_sax_acceptor +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + bool null() + { + return true; + } + + bool boolean(bool /*unused*/) + { + return true; + } + + bool number_integer(number_integer_t /*unused*/) + { + return true; + } + + bool number_unsigned(number_unsigned_t /*unused*/) + { + return true; + } + + bool number_float(number_float_t /*unused*/, const string_t& /*unused*/) + { + return true; + } + + bool string(string_t& /*unused*/) + { + return true; + } + + bool binary(binary_t& /*unused*/) + { + return true; + } + + bool start_object(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool key(string_t& /*unused*/) + { + return true; + } + + bool end_object() + { + return true; + } + + bool start_array(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool end_array() + { + return true; + } + + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& /*unused*/) + { + return false; + } +}; +} // namespace detail + +} // namespace nlohmann + +// #include + + +#include // array +#include // localeconv +#include // size_t +#include // snprintf +#include // strtof, strtod, strtold, strtoll, strtoull +#include // initializer_list +#include // char_traits, string +#include // move +#include // vector + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/////////// +// lexer // +/////////// + +template +class lexer_base +{ + public: + /// token types for the parser + enum class token_type + { + uninitialized, ///< indicating the scanner is uninitialized + literal_true, ///< the `true` literal + literal_false, ///< the `false` literal + literal_null, ///< the `null` literal + value_string, ///< a string -- use get_string() for actual value + value_unsigned, ///< an unsigned integer -- use get_number_unsigned() for actual value + value_integer, ///< a signed integer -- use get_number_integer() for actual value + value_float, ///< an floating point number -- use get_number_float() for actual value + begin_array, ///< the character for array begin `[` + begin_object, ///< the character for object begin `{` + end_array, ///< the character for array end `]` + end_object, ///< the character for object end `}` + name_separator, ///< the name separator `:` + value_separator, ///< the value separator `,` + parse_error, ///< indicating a parse error + end_of_input, ///< indicating the end of the input buffer + literal_or_value ///< a literal or the begin of a value (only for diagnostics) + }; + + /// return name of values of type token_type (only used for errors) + JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_CONST + static const char* token_type_name(const token_type t) noexcept + { + switch (t) + { + case token_type::uninitialized: + return ""; + case token_type::literal_true: + return "true literal"; + case token_type::literal_false: + return "false literal"; + case token_type::literal_null: + return "null literal"; + case token_type::value_string: + return "string literal"; + case token_type::value_unsigned: + case token_type::value_integer: + case token_type::value_float: + return "number literal"; + case token_type::begin_array: + return "'['"; + case token_type::begin_object: + return "'{'"; + case token_type::end_array: + return "']'"; + case token_type::end_object: + return "'}'"; + case token_type::name_separator: + return "':'"; + case token_type::value_separator: + return "','"; + case token_type::parse_error: + return ""; + case token_type::end_of_input: + return "end of input"; + case token_type::literal_or_value: + return "'[', '{', or a literal"; + // LCOV_EXCL_START + default: // catch non-enum values + return "unknown token"; + // LCOV_EXCL_STOP + } + } +}; +/*! +@brief lexical analysis + +This class organizes the lexical analysis during JSON deserialization. +*/ +template +class lexer : public lexer_base +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using char_type = typename InputAdapterType::char_type; + using char_int_type = typename std::char_traits::int_type; + + public: + using token_type = typename lexer_base::token_type; + + explicit lexer(InputAdapterType&& adapter, bool ignore_comments_ = false) + : ia(std::move(adapter)) + , ignore_comments(ignore_comments_) + , decimal_point_char(static_cast(get_decimal_point())) + {} + + // delete because of pointer members + lexer(const lexer&) = delete; + lexer(lexer&&) = default; + lexer& operator=(lexer&) = delete; + lexer& operator=(lexer&&) = default; + ~lexer() = default; + + private: + ///////////////////// + // locales + ///////////////////// + + /// return the locale-dependent decimal point + JSON_HEDLEY_PURE + static char get_decimal_point() noexcept + { + const auto* loc = localeconv(); + JSON_ASSERT(loc != nullptr); + return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point); + } + + ///////////////////// + // scan functions + ///////////////////// + + /*! + @brief get codepoint from 4 hex characters following `\u` + + For input "\u c1 c2 c3 c4" the codepoint is: + (c1 * 0x1000) + (c2 * 0x0100) + (c3 * 0x0010) + c4 + = (c1 << 12) + (c2 << 8) + (c3 << 4) + (c4 << 0) + + Furthermore, the possible characters '0'..'9', 'A'..'F', and 'a'..'f' + must be converted to the integers 0x0..0x9, 0xA..0xF, 0xA..0xF, resp. The + conversion is done by subtracting the offset (0x30, 0x37, and 0x57) + between the ASCII value of the character and the desired integer value. + + @return codepoint (0x0000..0xFFFF) or -1 in case of an error (e.g. EOF or + non-hex character) + */ + int get_codepoint() + { + // this function only makes sense after reading `\u` + JSON_ASSERT(current == 'u'); + int codepoint = 0; + + const auto factors = { 12u, 8u, 4u, 0u }; + for (const auto factor : factors) + { + get(); + + if (current >= '0' && current <= '9') + { + codepoint += static_cast((static_cast(current) - 0x30u) << factor); + } + else if (current >= 'A' && current <= 'F') + { + codepoint += static_cast((static_cast(current) - 0x37u) << factor); + } + else if (current >= 'a' && current <= 'f') + { + codepoint += static_cast((static_cast(current) - 0x57u) << factor); + } + else + { + return -1; + } + } + + JSON_ASSERT(0x0000 <= codepoint && codepoint <= 0xFFFF); + return codepoint; + } + + /*! + @brief check if the next byte(s) are inside a given range + + Adds the current byte and, for each passed range, reads a new byte and + checks if it is inside the range. If a violation was detected, set up an + error message and return false. Otherwise, return true. + + @param[in] ranges list of integers; interpreted as list of pairs of + inclusive lower and upper bound, respectively + + @pre The passed list @a ranges must have 2, 4, or 6 elements; that is, + 1, 2, or 3 pairs. This precondition is enforced by an assertion. + + @return true if and only if no range violation was detected + */ + bool next_byte_in_range(std::initializer_list ranges) + { + JSON_ASSERT(ranges.size() == 2 || ranges.size() == 4 || ranges.size() == 6); + add(current); + + for (auto range = ranges.begin(); range != ranges.end(); ++range) + { + get(); + if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range))) + { + add(current); + } + else + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return false; + } + } + + return true; + } + + /*! + @brief scan a string literal + + This function scans a string according to Sect. 7 of RFC 7159. While + scanning, bytes are escaped and copied into buffer token_buffer. Then the + function returns successfully, token_buffer is *not* null-terminated (as it + may contain \0 bytes), and token_buffer.size() is the number of bytes in the + string. + + @return token_type::value_string if string could be successfully scanned, + token_type::parse_error otherwise + + @note In case of errors, variable error_message contains a textual + description. + */ + token_type scan_string() + { + // reset token_buffer (ignore opening quote) + reset(); + + // we entered the function by reading an open quote + JSON_ASSERT(current == '\"'); + + while (true) + { + // get next character + switch (get()) + { + // end of file while parsing string + case std::char_traits::eof(): + { + error_message = "invalid string: missing closing quote"; + return token_type::parse_error; + } + + // closing quote + case '\"': + { + return token_type::value_string; + } + + // escapes + case '\\': + { + switch (get()) + { + // quotation mark + case '\"': + add('\"'); + break; + // reverse solidus + case '\\': + add('\\'); + break; + // solidus + case '/': + add('/'); + break; + // backspace + case 'b': + add('\b'); + break; + // form feed + case 'f': + add('\f'); + break; + // line feed + case 'n': + add('\n'); + break; + // carriage return + case 'r': + add('\r'); + break; + // tab + case 't': + add('\t'); + break; + + // unicode escapes + case 'u': + { + const int codepoint1 = get_codepoint(); + int codepoint = codepoint1; // start with codepoint1 + + if (JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if code point is a high surrogate + if (0xD800 <= codepoint1 && codepoint1 <= 0xDBFF) + { + // expect next \uxxxx entry + if (JSON_HEDLEY_LIKELY(get() == '\\' && get() == 'u')) + { + const int codepoint2 = get_codepoint(); + + if (JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if codepoint2 is a low surrogate + if (JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 && codepoint2 <= 0xDFFF)) + { + // overwrite codepoint + codepoint = static_cast( + // high surrogate occupies the most significant 22 bits + (static_cast(codepoint1) << 10u) + // low surrogate occupies the least significant 15 bits + + static_cast(codepoint2) + // there is still the 0xD800, 0xDC00 and 0x10000 noise + // in the result so we have to subtract with: + // (0xD800 << 10) + DC00 - 0x10000 = 0x35FDC00 + - 0x35FDC00u); + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 && codepoint1 <= 0xDFFF)) + { + error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; + return token_type::parse_error; + } + } + + // result of the above calculation yields a proper codepoint + JSON_ASSERT(0x00 <= codepoint && codepoint <= 0x10FFFF); + + // translate codepoint into bytes + if (codepoint < 0x80) + { + // 1-byte characters: 0xxxxxxx (ASCII) + add(static_cast(codepoint)); + } + else if (codepoint <= 0x7FF) + { + // 2-byte characters: 110xxxxx 10xxxxxx + add(static_cast(0xC0u | (static_cast(codepoint) >> 6u))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + else if (codepoint <= 0xFFFF) + { + // 3-byte characters: 1110xxxx 10xxxxxx 10xxxxxx + add(static_cast(0xE0u | (static_cast(codepoint) >> 12u))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 6u) & 0x3Fu))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + else + { + // 4-byte characters: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + add(static_cast(0xF0u | (static_cast(codepoint) >> 18u))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 12u) & 0x3Fu))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 6u) & 0x3Fu))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + + break; + } + + // other characters after escape + default: + error_message = "invalid string: forbidden character after backslash"; + return token_type::parse_error; + } + + break; + } + + // invalid control characters + case 0x00: + { + error_message = "invalid string: control character U+0000 (NUL) must be escaped to \\u0000"; + return token_type::parse_error; + } + + case 0x01: + { + error_message = "invalid string: control character U+0001 (SOH) must be escaped to \\u0001"; + return token_type::parse_error; + } + + case 0x02: + { + error_message = "invalid string: control character U+0002 (STX) must be escaped to \\u0002"; + return token_type::parse_error; + } + + case 0x03: + { + error_message = "invalid string: control character U+0003 (ETX) must be escaped to \\u0003"; + return token_type::parse_error; + } + + case 0x04: + { + error_message = "invalid string: control character U+0004 (EOT) must be escaped to \\u0004"; + return token_type::parse_error; + } + + case 0x05: + { + error_message = "invalid string: control character U+0005 (ENQ) must be escaped to \\u0005"; + return token_type::parse_error; + } + + case 0x06: + { + error_message = "invalid string: control character U+0006 (ACK) must be escaped to \\u0006"; + return token_type::parse_error; + } + + case 0x07: + { + error_message = "invalid string: control character U+0007 (BEL) must be escaped to \\u0007"; + return token_type::parse_error; + } + + case 0x08: + { + error_message = "invalid string: control character U+0008 (BS) must be escaped to \\u0008 or \\b"; + return token_type::parse_error; + } + + case 0x09: + { + error_message = "invalid string: control character U+0009 (HT) must be escaped to \\u0009 or \\t"; + return token_type::parse_error; + } + + case 0x0A: + { + error_message = "invalid string: control character U+000A (LF) must be escaped to \\u000A or \\n"; + return token_type::parse_error; + } + + case 0x0B: + { + error_message = "invalid string: control character U+000B (VT) must be escaped to \\u000B"; + return token_type::parse_error; + } + + case 0x0C: + { + error_message = "invalid string: control character U+000C (FF) must be escaped to \\u000C or \\f"; + return token_type::parse_error; + } + + case 0x0D: + { + error_message = "invalid string: control character U+000D (CR) must be escaped to \\u000D or \\r"; + return token_type::parse_error; + } + + case 0x0E: + { + error_message = "invalid string: control character U+000E (SO) must be escaped to \\u000E"; + return token_type::parse_error; + } + + case 0x0F: + { + error_message = "invalid string: control character U+000F (SI) must be escaped to \\u000F"; + return token_type::parse_error; + } + + case 0x10: + { + error_message = "invalid string: control character U+0010 (DLE) must be escaped to \\u0010"; + return token_type::parse_error; + } + + case 0x11: + { + error_message = "invalid string: control character U+0011 (DC1) must be escaped to \\u0011"; + return token_type::parse_error; + } + + case 0x12: + { + error_message = "invalid string: control character U+0012 (DC2) must be escaped to \\u0012"; + return token_type::parse_error; + } + + case 0x13: + { + error_message = "invalid string: control character U+0013 (DC3) must be escaped to \\u0013"; + return token_type::parse_error; + } + + case 0x14: + { + error_message = "invalid string: control character U+0014 (DC4) must be escaped to \\u0014"; + return token_type::parse_error; + } + + case 0x15: + { + error_message = "invalid string: control character U+0015 (NAK) must be escaped to \\u0015"; + return token_type::parse_error; + } + + case 0x16: + { + error_message = "invalid string: control character U+0016 (SYN) must be escaped to \\u0016"; + return token_type::parse_error; + } + + case 0x17: + { + error_message = "invalid string: control character U+0017 (ETB) must be escaped to \\u0017"; + return token_type::parse_error; + } + + case 0x18: + { + error_message = "invalid string: control character U+0018 (CAN) must be escaped to \\u0018"; + return token_type::parse_error; + } + + case 0x19: + { + error_message = "invalid string: control character U+0019 (EM) must be escaped to \\u0019"; + return token_type::parse_error; + } + + case 0x1A: + { + error_message = "invalid string: control character U+001A (SUB) must be escaped to \\u001A"; + return token_type::parse_error; + } + + case 0x1B: + { + error_message = "invalid string: control character U+001B (ESC) must be escaped to \\u001B"; + return token_type::parse_error; + } + + case 0x1C: + { + error_message = "invalid string: control character U+001C (FS) must be escaped to \\u001C"; + return token_type::parse_error; + } + + case 0x1D: + { + error_message = "invalid string: control character U+001D (GS) must be escaped to \\u001D"; + return token_type::parse_error; + } + + case 0x1E: + { + error_message = "invalid string: control character U+001E (RS) must be escaped to \\u001E"; + return token_type::parse_error; + } + + case 0x1F: + { + error_message = "invalid string: control character U+001F (US) must be escaped to \\u001F"; + return token_type::parse_error; + } + + // U+0020..U+007F (except U+0022 (quote) and U+005C (backspace)) + case 0x20: + case 0x21: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + { + add(current); + break; + } + + // U+0080..U+07FF: bytes C2..DF 80..BF + case 0xC2: + case 0xC3: + case 0xC4: + case 0xC5: + case 0xC6: + case 0xC7: + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD5: + case 0xD6: + case 0xD7: + case 0xD8: + case 0xD9: + case 0xDA: + case 0xDB: + case 0xDC: + case 0xDD: + case 0xDE: + case 0xDF: + { + if (JSON_HEDLEY_UNLIKELY(!next_byte_in_range({0x80, 0xBF}))) + { + return token_type::parse_error; + } + break; + } + + // U+0800..U+0FFF: bytes E0 A0..BF 80..BF + case 0xE0: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+1000..U+CFFF: bytes E1..EC 80..BF 80..BF + // U+E000..U+FFFF: bytes EE..EF 80..BF 80..BF + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xEE: + case 0xEF: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+D000..U+D7FF: bytes ED 80..9F 80..BF + case 0xED: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF + case 0xF0: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF + case 0xF1: + case 0xF2: + case 0xF3: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF + case 0xF4: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // remaining bytes (80..C1 and F5..FF) are ill-formed + default: + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return token_type::parse_error; + } + } + } + } + + /*! + * @brief scan a comment + * @return whether comment could be scanned successfully + */ + bool scan_comment() + { + switch (get()) + { + // single-line comments skip input until a newline or EOF is read + case '/': + { + while (true) + { + switch (get()) + { + case '\n': + case '\r': + case std::char_traits::eof(): + case '\0': + return true; + + default: + break; + } + } + } + + // multi-line comments skip input until */ is read + case '*': + { + while (true) + { + switch (get()) + { + case std::char_traits::eof(): + case '\0': + { + error_message = "invalid comment; missing closing '*/'"; + return false; + } + + case '*': + { + switch (get()) + { + case '/': + return true; + + default: + { + unget(); + continue; + } + } + } + + default: + continue; + } + } + } + + // unexpected character after reading '/' + default: + { + error_message = "invalid comment; expecting '/' or '*' after '/'"; + return false; + } + } + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(float& f, const char* str, char** endptr) noexcept + { + f = std::strtof(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(double& f, const char* str, char** endptr) noexcept + { + f = std::strtod(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(long double& f, const char* str, char** endptr) noexcept + { + f = std::strtold(str, endptr); + } + + /*! + @brief scan a number literal + + This function scans a string according to Sect. 6 of RFC 7159. + + The function is realized with a deterministic finite state machine derived + from the grammar described in RFC 7159. Starting in state "init", the + input is read and used to determined the next state. Only state "done" + accepts the number. State "error" is a trap state to model errors. In the + table below, "anything" means any character but the ones listed before. + + state | 0 | 1-9 | e E | + | - | . | anything + ---------|----------|----------|----------|---------|---------|----------|----------- + init | zero | any1 | [error] | [error] | minus | [error] | [error] + minus | zero | any1 | [error] | [error] | [error] | [error] | [error] + zero | done | done | exponent | done | done | decimal1 | done + any1 | any1 | any1 | exponent | done | done | decimal1 | done + decimal1 | decimal2 | decimal2 | [error] | [error] | [error] | [error] | [error] + decimal2 | decimal2 | decimal2 | exponent | done | done | done | done + exponent | any2 | any2 | [error] | sign | sign | [error] | [error] + sign | any2 | any2 | [error] | [error] | [error] | [error] | [error] + any2 | any2 | any2 | done | done | done | done | done + + The state machine is realized with one label per state (prefixed with + "scan_number_") and `goto` statements between them. The state machine + contains cycles, but any cycle can be left when EOF is read. Therefore, + the function is guaranteed to terminate. + + During scanning, the read bytes are stored in token_buffer. This string is + then converted to a signed integer, an unsigned integer, or a + floating-point number. + + @return token_type::value_unsigned, token_type::value_integer, or + token_type::value_float if number could be successfully scanned, + token_type::parse_error otherwise + + @note The scanner is independent of the current locale. Internally, the + locale's decimal point is used instead of `.` to work with the + locale-dependent converters. + */ + token_type scan_number() // lgtm [cpp/use-of-goto] + { + // reset token_buffer to store the number's bytes + reset(); + + // the type of the parsed number; initially set to unsigned; will be + // changed if minus sign, decimal point or exponent is read + token_type number_type = token_type::value_unsigned; + + // state (init): we just found out we need to scan a number + switch (current) + { + case '-': + { + add(current); + goto scan_number_minus; + } + + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + // all other characters are rejected outside scan_number() + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + +scan_number_minus: + // state: we just parsed a leading minus sign + number_type = token_type::value_integer; + switch (get()) + { + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + default: + { + error_message = "invalid number; expected digit after '-'"; + return token_type::parse_error; + } + } + +scan_number_zero: + // state: we just parse a zero (maybe with a leading minus sign) + switch (get()) + { + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_any1: + // state: we just parsed a number 0-9 (maybe with a leading minus sign) + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_decimal1: + // state: we just parsed a decimal point + number_type = token_type::value_float; + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + default: + { + error_message = "invalid number; expected digit after '.'"; + return token_type::parse_error; + } + } + +scan_number_decimal2: + // we just parsed at least one number after a decimal point + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_exponent: + // we just parsed an exponent + number_type = token_type::value_float; + switch (get()) + { + case '+': + case '-': + { + add(current); + goto scan_number_sign; + } + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = + "invalid number; expected '+', '-', or digit after exponent"; + return token_type::parse_error; + } + } + +scan_number_sign: + // we just parsed an exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = "invalid number; expected digit after exponent sign"; + return token_type::parse_error; + } + } + +scan_number_any2: + // we just parsed a number after the exponent or exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + goto scan_number_done; + } + +scan_number_done: + // unget the character after the number (we only read it to know that + // we are done scanning a number) + unget(); + + char* endptr = nullptr; + errno = 0; + + // try to parse integers first and fall back to floats + if (number_type == token_type::value_unsigned) + { + const auto x = std::strtoull(token_buffer.data(), &endptr, 10); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_unsigned = static_cast(x); + if (value_unsigned == x) + { + return token_type::value_unsigned; + } + } + } + else if (number_type == token_type::value_integer) + { + const auto x = std::strtoll(token_buffer.data(), &endptr, 10); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_integer = static_cast(x); + if (value_integer == x) + { + return token_type::value_integer; + } + } + } + + // this code is reached if we parse a floating-point number or if an + // integer conversion above failed + strtof(value_float, token_buffer.data(), &endptr); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + return token_type::value_float; + } + + /*! + @param[in] literal_text the literal text to expect + @param[in] length the length of the passed literal text + @param[in] return_type the token type to return on success + */ + JSON_HEDLEY_NON_NULL(2) + token_type scan_literal(const char_type* literal_text, const std::size_t length, + token_type return_type) + { + JSON_ASSERT(std::char_traits::to_char_type(current) == literal_text[0]); + for (std::size_t i = 1; i < length; ++i) + { + if (JSON_HEDLEY_UNLIKELY(std::char_traits::to_char_type(get()) != literal_text[i])) + { + error_message = "invalid literal"; + return token_type::parse_error; + } + } + return return_type; + } + + ///////////////////// + // input management + ///////////////////// + + /// reset token_buffer; current character is beginning of token + void reset() noexcept + { + token_buffer.clear(); + token_string.clear(); + token_string.push_back(std::char_traits::to_char_type(current)); + } + + /* + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a + `std::char_traits::eof()` in that case. Stores the scanned characters + for use in error messages. + + @return character read from the input + */ + char_int_type get() + { + ++position.chars_read_total; + ++position.chars_read_current_line; + + if (next_unget) + { + // just reset the next_unget variable and work with current + next_unget = false; + } + else + { + current = ia.get_character(); + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + { + token_string.push_back(std::char_traits::to_char_type(current)); + } + + if (current == '\n') + { + ++position.lines_read; + position.chars_read_current_line = 0; + } + + return current; + } + + /*! + @brief unget current character (read it again on next get) + + We implement unget by setting variable next_unget to true. The input is not + changed - we just simulate ungetting by modifying chars_read_total, + chars_read_current_line, and token_string. The next call to get() will + behave as if the unget character is read again. + */ + void unget() + { + next_unget = true; + + --position.chars_read_total; + + // in case we "unget" a newline, we have to also decrement the lines_read + if (position.chars_read_current_line == 0) + { + if (position.lines_read > 0) + { + --position.lines_read; + } + } + else + { + --position.chars_read_current_line; + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + { + JSON_ASSERT(!token_string.empty()); + token_string.pop_back(); + } + } + + /// add a character to token_buffer + void add(char_int_type c) + { + token_buffer.push_back(static_cast(c)); + } + + public: + ///////////////////// + // value getters + ///////////////////// + + /// return integer value + constexpr number_integer_t get_number_integer() const noexcept + { + return value_integer; + } + + /// return unsigned integer value + constexpr number_unsigned_t get_number_unsigned() const noexcept + { + return value_unsigned; + } + + /// return floating-point value + constexpr number_float_t get_number_float() const noexcept + { + return value_float; + } + + /// return current string value (implicitly resets the token; useful only once) + string_t& get_string() + { + return token_buffer; + } + + ///////////////////// + // diagnostics + ///////////////////// + + /// return position of last read token + constexpr position_t get_position() const noexcept + { + return position; + } + + /// return the last read token (for errors only). Will never contain EOF + /// (an arbitrary value that is not a valid char value, often -1), because + /// 255 may legitimately occur. May contain NUL, which should be escaped. + std::string get_token_string() const + { + // escape control characters + std::string result; + for (const auto c : token_string) + { + if (static_cast(c) <= '\x1F') + { + // escape control characters + std::array cs{{}}; + (std::snprintf)(cs.data(), cs.size(), "", static_cast(c)); + result += cs.data(); + } + else + { + // add character as is + result.push_back(static_cast(c)); + } + } + + return result; + } + + /// return syntax error message + JSON_HEDLEY_RETURNS_NON_NULL + constexpr const char* get_error_message() const noexcept + { + return error_message; + } + + ///////////////////// + // actual scanner + ///////////////////// + + /*! + @brief skip the UTF-8 byte order mark + @return true iff there is no BOM or the correct BOM has been skipped + */ + bool skip_bom() + { + if (get() == 0xEF) + { + // check if we completely parse the BOM + return get() == 0xBB && get() == 0xBF; + } + + // the first character is not the beginning of the BOM; unget it to + // process is later + unget(); + return true; + } + + void skip_whitespace() + { + do + { + get(); + } + while (current == ' ' || current == '\t' || current == '\n' || current == '\r'); + } + + token_type scan() + { + // initially, skip the BOM + if (position.chars_read_total == 0 && !skip_bom()) + { + error_message = "invalid BOM; must be 0xEF 0xBB 0xBF if given"; + return token_type::parse_error; + } + + // read next character and ignore whitespace + skip_whitespace(); + + // ignore comments + while (ignore_comments && current == '/') + { + if (!scan_comment()) + { + return token_type::parse_error; + } + + // skip following whitespace + skip_whitespace(); + } + + switch (current) + { + // structural characters + case '[': + return token_type::begin_array; + case ']': + return token_type::end_array; + case '{': + return token_type::begin_object; + case '}': + return token_type::end_object; + case ':': + return token_type::name_separator; + case ',': + return token_type::value_separator; + + // literals + case 't': + { + std::array true_literal = {{'t', 'r', 'u', 'e'}}; + return scan_literal(true_literal.data(), true_literal.size(), token_type::literal_true); + } + case 'f': + { + std::array false_literal = {{'f', 'a', 'l', 's', 'e'}}; + return scan_literal(false_literal.data(), false_literal.size(), token_type::literal_false); + } + case 'n': + { + std::array null_literal = {{'n', 'u', 'l', 'l'}}; + return scan_literal(null_literal.data(), null_literal.size(), token_type::literal_null); + } + + // string + case '\"': + return scan_string(); + + // number + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return scan_number(); + + // end of input (the null byte is needed when parsing from + // string literals) + case '\0': + case std::char_traits::eof(): + return token_type::end_of_input; + + // error + default: + error_message = "invalid literal"; + return token_type::parse_error; + } + } + + private: + /// input adapter + InputAdapterType ia; + + /// whether comments should be ignored (true) or signaled as errors (false) + const bool ignore_comments = false; + + /// the current character + char_int_type current = std::char_traits::eof(); + + /// whether the next get() call should just return current + bool next_unget = false; + + /// the start position of the current token + position_t position {}; + + /// raw input token string (for error messages) + std::vector token_string {}; + + /// buffer for variable-length tokens (numbers, strings) + string_t token_buffer {}; + + /// a description of occurred lexer errors + const char* error_message = ""; + + // number values + number_integer_t value_integer = 0; + number_unsigned_t value_unsigned = 0; + number_float_t value_float = 0; + + /// the decimal point + const char_int_type decimal_point_char = '.'; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // size_t +#include // declval +#include // string + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +using null_function_t = decltype(std::declval().null()); + +template +using boolean_function_t = + decltype(std::declval().boolean(std::declval())); + +template +using number_integer_function_t = + decltype(std::declval().number_integer(std::declval())); + +template +using number_unsigned_function_t = + decltype(std::declval().number_unsigned(std::declval())); + +template +using number_float_function_t = decltype(std::declval().number_float( + std::declval(), std::declval())); + +template +using string_function_t = + decltype(std::declval().string(std::declval())); + +template +using binary_function_t = + decltype(std::declval().binary(std::declval())); + +template +using start_object_function_t = + decltype(std::declval().start_object(std::declval())); + +template +using key_function_t = + decltype(std::declval().key(std::declval())); + +template +using end_object_function_t = decltype(std::declval().end_object()); + +template +using start_array_function_t = + decltype(std::declval().start_array(std::declval())); + +template +using end_array_function_t = decltype(std::declval().end_array()); + +template +using parse_error_function_t = decltype(std::declval().parse_error( + std::declval(), std::declval(), + std::declval())); + +template +struct is_sax +{ + private: + static_assert(is_basic_json::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using exception_t = typename BasicJsonType::exception; + + public: + static constexpr bool value = + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value; +}; + +template +struct is_sax_static_asserts +{ + private: + static_assert(is_basic_json::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using exception_t = typename BasicJsonType::exception; + + public: + static_assert(is_detected_exact::value, + "Missing/invalid function: bool null()"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool number_integer(number_integer_t)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool number_unsigned(number_unsigned_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool number_float(number_float_t, const string_t&)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool string(string_t&)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool binary(binary_t&)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool start_object(std::size_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool key(string_t&)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool end_object()"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool start_array(std::size_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool end_array()"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool parse_error(std::size_t, const " + "std::string&, const exception&)"); +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ + +/// how to treat CBOR tags +enum class cbor_tag_handler_t +{ + error, ///< throw a parse_error exception in case of a tag + ignore ///< ignore tags +}; + +/*! +@brief determine system byte order + +@return true if and only if system's byte order is little endian + +@note from https://stackoverflow.com/a/1001328/266378 +*/ +static inline bool little_endianess(int num = 1) noexcept +{ + return *reinterpret_cast(&num) == 1; +} + + +/////////////////// +// binary reader // +/////////////////// + +/*! +@brief deserialization of CBOR, MessagePack, and UBJSON values +*/ +template> +class binary_reader +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using json_sax_t = SAX; + using char_type = typename InputAdapterType::char_type; + using char_int_type = typename std::char_traits::int_type; + + public: + /*! + @brief create a binary reader + + @param[in] adapter input adapter to read from + */ + explicit binary_reader(InputAdapterType&& adapter) : ia(std::move(adapter)) + { + (void)detail::is_sax_static_asserts {}; + } + + // make class move-only + binary_reader(const binary_reader&) = delete; + binary_reader(binary_reader&&) = default; + binary_reader& operator=(const binary_reader&) = delete; + binary_reader& operator=(binary_reader&&) = default; + ~binary_reader() = default; + + /*! + @param[in] format the binary format to parse + @param[in] sax_ a SAX event processor + @param[in] strict whether to expect the input to be consumed completed + @param[in] tag_handler how to treat CBOR tags + + @return + */ + JSON_HEDLEY_NON_NULL(3) + bool sax_parse(const input_format_t format, + json_sax_t* sax_, + const bool strict = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + sax = sax_; + bool result = false; + + switch (format) + { + case input_format_t::bson: + result = parse_bson_internal(); + break; + + case input_format_t::cbor: + result = parse_cbor_internal(true, tag_handler); + break; + + case input_format_t::msgpack: + result = parse_msgpack_internal(); + break; + + case input_format_t::ubjson: + result = parse_ubjson_internal(); + break; + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + + // strict mode: next byte must be EOF + if (result && strict) + { + if (format == input_format_t::ubjson) + { + get_ignore_noop(); + } + else + { + get(); + } + + if (JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) + { + return sax->parse_error(chars_read, get_token_string(), + parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); + } + } + + return result; + } + + private: + ////////// + // BSON // + ////////// + + /*! + @brief Reads in a BSON-object and passes it to the SAX-parser. + @return whether a valid BSON-value was passed to the SAX parser + */ + bool parse_bson_internal() + { + std::int32_t document_size{}; + get_number(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_list(/*is_array*/false))) + { + return false; + } + + return sax->end_object(); + } + + /*! + @brief Parses a C-style string from the BSON input. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @return `true` if the \x00-byte indicating the end of the string was + encountered before the EOF; false` indicates an unexpected EOF. + */ + bool get_bson_cstr(string_t& result) + { + auto out = std::back_inserter(result); + while (true) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::bson, "cstring"))) + { + return false; + } + if (current == 0x00) + { + return true; + } + *out++ = static_cast(current); + } + } + + /*! + @brief Parses a zero-terminated string of length @a len from the BSON + input. + @param[in] len The length (including the zero-byte at the end) of the + string to be read. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 1 + @return `true` if the string was successfully parsed + */ + template + bool get_bson_string(const NumberType len, string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 1)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); + } + + return get_string(input_format_t::bson, len - static_cast(1), result) && get() != std::char_traits::eof(); + } + + /*! + @brief Parses a byte array input of length @a len from the BSON input. + @param[in] len The length of the byte array to be read. + @param[in, out] result A reference to the binary variable where the read + array is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 0 + @return `true` if the byte array was successfully parsed + */ + template + bool get_bson_binary(const NumberType len, binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 0)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "byte array length cannot be negative, is " + std::to_string(len), "binary"))); + } + + // All BSON binary values have a subtype + std::uint8_t subtype{}; + get_number(input_format_t::bson, subtype); + result.set_subtype(subtype); + + return get_binary(input_format_t::bson, len, result); + } + + /*! + @brief Read a BSON document element of the given @a element_type. + @param[in] element_type The BSON element type, c.f. http://bsonspec.org/spec.html + @param[in] element_type_parse_position The position in the input stream, + where the `element_type` was read. + @warning Not all BSON element types are supported yet. An unsupported + @a element_type will give rise to a parse_error.114: + Unsupported BSON record type 0x... + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_internal(const char_int_type element_type, + const std::size_t element_type_parse_position) + { + switch (element_type) + { + case 0x01: // double + { + double number{}; + return get_number(input_format_t::bson, number) && sax->number_float(static_cast(number), ""); + } + + case 0x02: // string + { + std::int32_t len{}; + string_t value; + return get_number(input_format_t::bson, len) && get_bson_string(len, value) && sax->string(value); + } + + case 0x03: // object + { + return parse_bson_internal(); + } + + case 0x04: // array + { + return parse_bson_array(); + } + + case 0x05: // binary + { + std::int32_t len{}; + binary_t value; + return get_number(input_format_t::bson, len) && get_bson_binary(len, value) && sax->binary(value); + } + + case 0x08: // boolean + { + return sax->boolean(get() != 0); + } + + case 0x0A: // null + { + return sax->null(); + } + + case 0x10: // int32 + { + std::int32_t value{}; + return get_number(input_format_t::bson, value) && sax->number_integer(value); + } + + case 0x12: // int64 + { + std::int64_t value{}; + return get_number(input_format_t::bson, value) && sax->number_integer(value); + } + + default: // anything else not supported (yet) + { + std::array cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast(element_type)); + return sax->parse_error(element_type_parse_position, std::string(cr.data()), parse_error::create(114, element_type_parse_position, "Unsupported BSON record type 0x" + std::string(cr.data()))); + } + } + } + + /*! + @brief Read a BSON element list (as specified in the BSON-spec) + + The same binary layout is used for objects and arrays, hence it must be + indicated with the argument @a is_array which one is expected + (true --> array, false --> object). + + @param[in] is_array Determines if the element list being read is to be + treated as an object (@a is_array == false), or as an + array (@a is_array == true). + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_list(const bool is_array) + { + string_t key; + + while (auto element_type = get()) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::bson, "element list"))) + { + return false; + } + + const std::size_t element_type_parse_position = chars_read; + if (JSON_HEDLEY_UNLIKELY(!get_bson_cstr(key))) + { + return false; + } + + if (!is_array && !sax->key(key)) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_internal(element_type, element_type_parse_position))) + { + return false; + } + + // get_bson_cstr only appends + key.clear(); + } + + return true; + } + + /*! + @brief Reads an array from the BSON input and passes it to the SAX-parser. + @return whether a valid BSON-array was passed to the SAX parser + */ + bool parse_bson_array() + { + std::int32_t document_size{}; + get_number(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_list(/*is_array*/true))) + { + return false; + } + + return sax->end_array(); + } + + ////////// + // CBOR // + ////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true) or whether the last read character should + be considered instead (false) + @param[in] tag_handler how CBOR tags should be treated + + @return whether a valid CBOR value was passed to the SAX parser + */ + bool parse_cbor_internal(const bool get_char, + const cbor_tag_handler_t tag_handler) + { + switch (get_char ? get() : current) + { + // EOF + case std::char_traits::eof(): + return unexpect_eof(input_format_t::cbor, "value"); + + // Integer 0x00..0x17 (0..23) + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return sax->number_unsigned(static_cast(current)); + + case 0x18: // Unsigned integer (one-byte uint8_t follows) + { + std::uint8_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x19: // Unsigned integer (two-byte uint16_t follows) + { + std::uint16_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x1A: // Unsigned integer (four-byte uint32_t follows) + { + std::uint32_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x1B: // Unsigned integer (eight-byte uint64_t follows) + { + std::uint64_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + // Negative integer -1-0x00..-1-0x17 (-1..-24) + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + return sax->number_integer(static_cast(0x20 - 1 - current)); + + case 0x38: // Negative integer (one-byte uint8_t follows) + { + std::uint8_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x39: // Negative integer -1-n (two-byte uint16_t follows) + { + std::uint16_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x3A: // Negative integer -1-n (four-byte uint32_t follows) + { + std::uint32_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x3B: // Negative integer -1-n (eight-byte uint64_t follows) + { + std::uint64_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) + - static_cast(number)); + } + + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: // Binary data (one-byte uint8_t for n follows) + case 0x59: // Binary data (two-byte uint16_t for n follow) + case 0x5A: // Binary data (four-byte uint32_t for n follow) + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + case 0x5F: // Binary data (indefinite length) + { + binary_t b; + return get_cbor_binary(b) && sax->binary(b); + } + + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + case 0x7F: // UTF-8 string (indefinite length) + { + string_t s; + return get_cbor_string(s) && sax->string(s); + } + + // array (0x00..0x17 data items follow) + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + return get_cbor_array(static_cast(static_cast(current) & 0x1Fu), tag_handler); + + case 0x98: // array (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x99: // array (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9A: // array (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9B: // array (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9F: // array (indefinite length) + return get_cbor_array(std::size_t(-1), tag_handler); + + // map (0x00..0x17 pairs of data items follow) + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + return get_cbor_object(static_cast(static_cast(current) & 0x1Fu), tag_handler); + + case 0xB8: // map (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xB9: // map (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBA: // map (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBB: // map (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBF: // map (indefinite length) + return get_cbor_object(std::size_t(-1), tag_handler); + + case 0xC6: // tagged item + case 0xC7: + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD8: // tagged item (1 bytes follow) + case 0xD9: // tagged item (2 bytes follow) + case 0xDA: // tagged item (4 bytes follow) + case 0xDB: // tagged item (8 bytes follow) + { + switch (tag_handler) + { + case cbor_tag_handler_t::error: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::cbor, "invalid byte: 0x" + last_token, "value"))); + } + + case cbor_tag_handler_t::ignore: + { + switch (current) + { + case 0xD8: + { + std::uint8_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xD9: + { + std::uint16_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xDA: + { + std::uint32_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xDB: + { + std::uint64_t len{}; + get_number(input_format_t::cbor, len); + break; + } + default: + break; + } + return parse_cbor_internal(true, tag_handler); + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + + case 0xF4: // false + return sax->boolean(false); + + case 0xF5: // true + return sax->boolean(true); + + case 0xF6: // null + return sax->null(); + + case 0xF9: // Half-Precision Float (two-byte IEEE 754) + { + const auto byte1_raw = get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + const auto byte2_raw = get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + + const auto byte1 = static_cast(byte1_raw); + const auto byte2 = static_cast(byte2_raw); + + // code from RFC 7049, Appendix D, Figure 3: + // As half-precision floating-point numbers were only added + // to IEEE 754 in 2008, today's programming platforms often + // still only have limited support for them. It is very + // easy to include at least decoding support for them even + // without such support. An example of a small decoder for + // half-precision floating-point numbers in the C language + // is shown in Fig. 3. + const auto half = static_cast((byte1 << 8u) + byte2); + const double val = [&half] + { + const int exp = (half >> 10u) & 0x1Fu; + const unsigned int mant = half & 0x3FFu; + JSON_ASSERT(0 <= exp&& exp <= 32); + JSON_ASSERT(mant <= 1024); + switch (exp) + { + case 0: + return std::ldexp(mant, -24); + case 31: + return (mant == 0) + ? std::numeric_limits::infinity() + : std::numeric_limits::quiet_NaN(); + default: + return std::ldexp(mant + 1024, exp - 25); + } + }(); + return sax->number_float((half & 0x8000u) != 0 + ? static_cast(-val) + : static_cast(val), ""); + } + + case 0xFA: // Single-Precision Float (four-byte IEEE 754) + { + float number{}; + return get_number(input_format_t::cbor, number) && sax->number_float(static_cast(number), ""); + } + + case 0xFB: // Double-Precision Float (eight-byte IEEE 754) + { + double number{}; + return get_number(input_format_t::cbor, number) && sax->number_float(static_cast(number), ""); + } + + default: // anything else (0xFF is handled inside the other types) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::cbor, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a CBOR string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + Additionally, CBOR's strings with indefinite lengths are supported. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_cbor_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "string"))) + { + return false; + } + + switch (current) + { + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + { + return get_string(input_format_t::cbor, static_cast(current) & 0x1Fu, result); + } + + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7F: // UTF-8 string (indefinite length) + { + while (get() != 0xFF) + { + string_t chunk; + if (!get_cbor_string(chunk)) + { + return false; + } + result.append(chunk); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a CBOR byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into the byte array. + Additionally, CBOR's byte arrays with indefinite lengths are supported. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_cbor_binary(binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "binary"))) + { + return false; + } + + switch (current) + { + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + { + return get_binary(input_format_t::cbor, static_cast(current) & 0x1Fu, result); + } + + case 0x58: // Binary data (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x59: // Binary data (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5A: // Binary data (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5F: // Binary data (indefinite length) + { + while (get() != 0xFF) + { + binary_t chunk; + if (!get_cbor_binary(chunk)) + { + return false; + } + result.insert(result.end(), chunk.begin(), chunk.end()); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x40-0x5B) or indefinite binary array type (0x5F); last byte: 0x" + last_token, "binary"))); + } + } + } + + /*! + @param[in] len the length of the array or std::size_t(-1) for an + array of indefinite size + @param[in] tag_handler how CBOR tags should be treated + @return whether array creation completed + */ + bool get_cbor_array(const std::size_t len, + const cbor_tag_handler_t tag_handler) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) + { + return false; + } + + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler))) + { + return false; + } + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object or std::size_t(-1) for an + object of indefinite size + @param[in] tag_handler how CBOR tags should be treated + @return whether object creation completed + */ + bool get_cbor_object(const std::size_t len, + const cbor_tag_handler_t tag_handler) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(len))) + { + return false; + } + + string_t key; + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + key.clear(); + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + key.clear(); + } + } + + return sax->end_object(); + } + + ///////////// + // MsgPack // + ///////////// + + /*! + @return whether a valid MessagePack value was passed to the SAX parser + */ + bool parse_msgpack_internal() + { + switch (get()) + { + // EOF + case std::char_traits::eof(): + return unexpect_eof(input_format_t::msgpack, "value"); + + // positive fixint + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5C: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + return sax->number_unsigned(static_cast(current)); + + // fixmap + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + return get_msgpack_object(static_cast(static_cast(current) & 0x0Fu)); + + // fixarray + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: + case 0x9B: + case 0x9C: + case 0x9D: + case 0x9E: + case 0x9F: + return get_msgpack_array(static_cast(static_cast(current) & 0x0Fu)); + + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + case 0xD9: // str 8 + case 0xDA: // str 16 + case 0xDB: // str 32 + { + string_t s; + return get_msgpack_string(s) && sax->string(s); + } + + case 0xC0: // nil + return sax->null(); + + case 0xC2: // false + return sax->boolean(false); + + case 0xC3: // true + return sax->boolean(true); + + case 0xC4: // bin 8 + case 0xC5: // bin 16 + case 0xC6: // bin 32 + case 0xC7: // ext 8 + case 0xC8: // ext 16 + case 0xC9: // ext 32 + case 0xD4: // fixext 1 + case 0xD5: // fixext 2 + case 0xD6: // fixext 4 + case 0xD7: // fixext 8 + case 0xD8: // fixext 16 + { + binary_t b; + return get_msgpack_binary(b) && sax->binary(b); + } + + case 0xCA: // float 32 + { + float number{}; + return get_number(input_format_t::msgpack, number) && sax->number_float(static_cast(number), ""); + } + + case 0xCB: // float 64 + { + double number{}; + return get_number(input_format_t::msgpack, number) && sax->number_float(static_cast(number), ""); + } + + case 0xCC: // uint 8 + { + std::uint8_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCD: // uint 16 + { + std::uint16_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCE: // uint 32 + { + std::uint32_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCF: // uint 64 + { + std::uint64_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xD0: // int 8 + { + std::int8_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD1: // int 16 + { + std::int16_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD2: // int 32 + { + std::int32_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD3: // int 64 + { + std::int64_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xDC: // array 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_array(static_cast(len)); + } + + case 0xDD: // array 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_array(static_cast(len)); + } + + case 0xDE: // map 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_object(static_cast(len)); + } + + case 0xDF: // map 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_object(static_cast(len)); + } + + // negative fixint + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xED: + case 0xEE: + case 0xEF: + case 0xF0: + case 0xF1: + case 0xF2: + case 0xF3: + case 0xF4: + case 0xF5: + case 0xF6: + case 0xF7: + case 0xF8: + case 0xF9: + case 0xFA: + case 0xFB: + case 0xFC: + case 0xFD: + case 0xFE: + case 0xFF: + return sax->number_integer(static_cast(current)); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::msgpack, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a MessagePack string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_msgpack_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string"))) + { + return false; + } + + switch (current) + { + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + { + return get_string(input_format_t::msgpack, static_cast(current) & 0x1Fu, result); + } + + case 0xD9: // str 8 + { + std::uint8_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + case 0xDA: // str 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + case 0xDB: // str 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::msgpack, "expected length specification (0xA0-0xBF, 0xD9-0xDB); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a MessagePack byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into a byte array. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_msgpack_binary(binary_t& result) + { + // helper function to set the subtype + auto assign_and_return_true = [&result](std::int8_t subtype) + { + result.set_subtype(static_cast(subtype)); + return true; + }; + + switch (current) + { + case 0xC4: // bin 8 + { + std::uint8_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC5: // bin 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC6: // bin 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC7: // ext 8 + { + std::uint8_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xC8: // ext 16 + { + std::uint16_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xC9: // ext 32 + { + std::uint32_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xD4: // fixext 1 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 1, result) && + assign_and_return_true(subtype); + } + + case 0xD5: // fixext 2 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 2, result) && + assign_and_return_true(subtype); + } + + case 0xD6: // fixext 4 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 4, result) && + assign_and_return_true(subtype); + } + + case 0xD7: // fixext 8 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 8, result) && + assign_and_return_true(subtype); + } + + case 0xD8: // fixext 16 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 16, result) && + assign_and_return_true(subtype); + } + + default: // LCOV_EXCL_LINE + return false; // LCOV_EXCL_LINE + } + } + + /*! + @param[in] len the length of the array + @return whether array creation completed + */ + bool get_msgpack_array(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) + { + return false; + } + + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_msgpack_internal())) + { + return false; + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object + @return whether object creation completed + */ + bool get_msgpack_object(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(len))) + { + return false; + } + + string_t key; + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!get_msgpack_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_msgpack_internal())) + { + return false; + } + key.clear(); + } + + return sax->end_object(); + } + + //////////// + // UBJSON // + //////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether a valid UBJSON value was passed to the SAX parser + */ + bool parse_ubjson_internal(const bool get_char = true) + { + return get_ubjson_value(get_char ? get_ignore_noop() : current); + } + + /*! + @brief reads a UBJSON string + + This function is either called after reading the 'S' byte explicitly + indicating a string, or in case of an object key where the 'S' byte can be + left out. + + @param[out] result created string + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether string creation completed + */ + bool get_ubjson_string(string_t& result, const bool get_char = true) + { + if (get_char) + { + get(); // TODO(niels): may we ignore N here? + } + + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + + switch (current) + { + case 'U': + { + std::uint8_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'i': + { + std::int8_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'I': + { + std::int16_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'l': + { + std::int32_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'L': + { + std::int64_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + default: + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L); last byte: 0x" + last_token, "string"))); + } + } + + /*! + @param[out] result determined size + @return whether size determination completed + */ + bool get_ubjson_size_value(std::size_t& result) + { + switch (get_ignore_noop()) + { + case 'U': + { + std::uint8_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'i': + { + std::int8_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'I': + { + std::int16_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'l': + { + std::int32_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'L': + { + std::int64_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L) after '#'; last byte: 0x" + last_token, "size"))); + } + } + } + + /*! + @brief determine the type and size for a container + + In the optimized UBJSON format, a type and a size can be provided to allow + for a more compact representation. + + @param[out] result pair of the size and the type + + @return whether pair creation completed + */ + bool get_ubjson_size_type(std::pair& result) + { + result.first = string_t::npos; // size + result.second = 0; // type + + get_ignore_noop(); + + if (current == '$') + { + result.second = get(); // must not ignore 'N', because 'N' maybe the type + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "type"))) + { + return false; + } + + get_ignore_noop(); + if (JSON_HEDLEY_UNLIKELY(current != '#')) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "expected '#' after type information; last byte: 0x" + last_token, "size"))); + } + + return get_ubjson_size_value(result.first); + } + + if (current == '#') + { + return get_ubjson_size_value(result.first); + } + + return true; + } + + /*! + @param prefix the previously read or set type prefix + @return whether value creation completed + */ + bool get_ubjson_value(const char_int_type prefix) + { + switch (prefix) + { + case std::char_traits::eof(): // EOF + return unexpect_eof(input_format_t::ubjson, "value"); + + case 'T': // true + return sax->boolean(true); + case 'F': // false + return sax->boolean(false); + + case 'Z': // null + return sax->null(); + + case 'U': + { + std::uint8_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_unsigned(number); + } + + case 'i': + { + std::int8_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'I': + { + std::int16_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'l': + { + std::int32_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'L': + { + std::int64_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'd': + { + float number{}; + return get_number(input_format_t::ubjson, number) && sax->number_float(static_cast(number), ""); + } + + case 'D': + { + double number{}; + return get_number(input_format_t::ubjson, number) && sax->number_float(static_cast(number), ""); + } + + case 'H': + { + return get_ubjson_high_precision_number(); + } + + case 'C': // char + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "char"))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(current > 127)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); + } + string_t s(1, static_cast(current)); + return sax->string(s); + } + + case 'S': // string + { + string_t s; + return get_ubjson_string(s) && sax->string(s); + } + + case '[': // array + return get_ubjson_array(); + + case '{': // object + return get_ubjson_object(); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @return whether array creation completed + */ + bool get_ubjson_array() + { + std::pair size_and_type; + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) + { + return false; + } + + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + if (size_and_type.second != 'N') + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) + { + return false; + } + } + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + while (current != ']') + { + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal(false))) + { + return false; + } + get_ignore_noop(); + } + } + + return sax->end_array(); + } + + /*! + @return whether object creation completed + */ + bool get_ubjson_object() + { + std::pair size_and_type; + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) + { + return false; + } + + string_t key; + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) + { + return false; + } + key.clear(); + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + key.clear(); + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + while (current != '}') + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key, false) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + get_ignore_noop(); + key.clear(); + } + } + + return sax->end_object(); + } + + // Note, no reader for UBJSON binary types is implemented because they do + // not exist + + bool get_ubjson_high_precision_number() + { + // get size of following number string + std::size_t size{}; + auto res = get_ubjson_size_value(size); + if (JSON_HEDLEY_UNLIKELY(!res)) + { + return res; + } + + // get number string + std::vector number_vector; + for (std::size_t i = 0; i < size; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "number"))) + { + return false; + } + number_vector.push_back(static_cast(current)); + } + + // parse number string + auto number_ia = detail::input_adapter(std::forward(number_vector)); + auto number_lexer = detail::lexer(std::move(number_ia), false); + const auto result_number = number_lexer.scan(); + const auto number_string = number_lexer.get_token_string(); + const auto result_remainder = number_lexer.scan(); + + using token_type = typename detail::lexer_base::token_type; + + if (JSON_HEDLEY_UNLIKELY(result_remainder != token_type::end_of_input)) + { + return sax->parse_error(chars_read, number_string, parse_error::create(115, chars_read, exception_message(input_format_t::ubjson, "invalid number text: " + number_lexer.get_token_string(), "high-precision number"))); + } + + switch (result_number) + { + case token_type::value_integer: + return sax->number_integer(number_lexer.get_number_integer()); + case token_type::value_unsigned: + return sax->number_unsigned(number_lexer.get_number_unsigned()); + case token_type::value_float: + return sax->number_float(number_lexer.get_number_float(), std::move(number_string)); + default: + return sax->parse_error(chars_read, number_string, parse_error::create(115, chars_read, exception_message(input_format_t::ubjson, "invalid number text: " + number_lexer.get_token_string(), "high-precision number"))); + } + } + + /////////////////////// + // Utility functions // + /////////////////////// + + /*! + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a -'ve valued + `std::char_traits::eof()` in that case. + + @return character read from the input + */ + char_int_type get() + { + ++chars_read; + return current = ia.get_character(); + } + + /*! + @return character read from the input after ignoring all 'N' entries + */ + char_int_type get_ignore_noop() + { + do + { + get(); + } + while (current == 'N'); + + return current; + } + + /* + @brief read a number from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[out] result number of type @a NumberType + + @return whether conversion completed + + @note This function needs to respect the system's endianess, because + bytes in CBOR, MessagePack, and UBJSON are stored in network order + (big endian) and therefore need reordering on little endian systems. + */ + template + bool get_number(const input_format_t format, NumberType& result) + { + // step 1: read input into array with system's byte order + std::array vec; + for (std::size_t i = 0; i < sizeof(NumberType); ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "number"))) + { + return false; + } + + // reverse byte order prior to conversion if necessary + if (is_little_endian != InputIsLittleEndian) + { + vec[sizeof(NumberType) - i - 1] = static_cast(current); + } + else + { + vec[i] = static_cast(current); // LCOV_EXCL_LINE + } + } + + // step 2: convert array into number of type T and return + std::memcpy(&result, vec.data(), sizeof(NumberType)); + return true; + } + + /*! + @brief create a string by reading characters from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of characters to read + @param[out] result string created by reading @a len bytes + + @return whether string creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of string memory. + */ + template + bool get_string(const input_format_t format, + const NumberType len, + string_t& result) + { + bool success = true; + for (NumberType i = 0; i < len; i++) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "string"))) + { + success = false; + break; + } + result.push_back(static_cast(current)); + }; + return success; + } + + /*! + @brief create a byte array by reading bytes from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of bytes to read + @param[out] result byte array created by reading @a len bytes + + @return whether byte array creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of memory. + */ + template + bool get_binary(const input_format_t format, + const NumberType len, + binary_t& result) + { + bool success = true; + for (NumberType i = 0; i < len; i++) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) + { + success = false; + break; + } + result.push_back(static_cast(current)); + } + return success; + } + + /*! + @param[in] format the current format (for diagnostics) + @param[in] context further context information (for diagnostics) + @return whether the last read character is not EOF + */ + JSON_HEDLEY_NON_NULL(3) + bool unexpect_eof(const input_format_t format, const char* context) const + { + if (JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) + { + return sax->parse_error(chars_read, "", + parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); + } + return true; + } + + /*! + @return a string representation of the last read byte + */ + std::string get_token_string() const + { + std::array cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast(current)); + return std::string{cr.data()}; + } + + /*! + @param[in] format the current format + @param[in] detail a detailed error message + @param[in] context further context information + @return a message string to use in the parse_error exceptions + */ + std::string exception_message(const input_format_t format, + const std::string& detail, + const std::string& context) const + { + std::string error_msg = "syntax error while parsing "; + + switch (format) + { + case input_format_t::cbor: + error_msg += "CBOR"; + break; + + case input_format_t::msgpack: + error_msg += "MessagePack"; + break; + + case input_format_t::ubjson: + error_msg += "UBJSON"; + break; + + case input_format_t::bson: + error_msg += "BSON"; + break; + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + + return error_msg + " " + context + ": " + detail; + } + + private: + /// input adapter + InputAdapterType ia; + + /// the current character + char_int_type current = std::char_traits::eof(); + + /// the number of characters read + std::size_t chars_read = 0; + + /// whether we can assume little endianess + const bool is_little_endian = little_endianess(); + + /// the SAX parser + json_sax_t* sax = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include // isfinite +#include // uint8_t +#include // function +#include // string +#include // move +#include // vector + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +//////////// +// parser // +//////////// + +enum class parse_event_t : uint8_t +{ + /// the parser read `{` and started to process a JSON object + object_start, + /// the parser read `}` and finished processing a JSON object + object_end, + /// the parser read `[` and started to process a JSON array + array_start, + /// the parser read `]` and finished processing a JSON array + array_end, + /// the parser read a key of a value in an object + key, + /// the parser finished reading a JSON value + value +}; + +template +using parser_callback_t = + std::function; + +/*! +@brief syntax analysis + +This class implements a recursive descent parser. +*/ +template +class parser +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using lexer_t = lexer; + using token_type = typename lexer_t::token_type; + + public: + /// a parser reading from an input adapter + explicit parser(InputAdapterType&& adapter, + const parser_callback_t cb = nullptr, + const bool allow_exceptions_ = true, + const bool skip_comments = false) + : callback(cb) + , m_lexer(std::move(adapter), skip_comments) + , allow_exceptions(allow_exceptions_) + { + // read first token + get_token(); + } + + /*! + @brief public parser interface + + @param[in] strict whether to expect the last token to be EOF + @param[in,out] result parsed JSON value + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + */ + void parse(const bool strict, BasicJsonType& result) + { + if (callback) + { + json_sax_dom_callback_parser sdp(result, callback, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict && (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + + // set top-level value to null if it was discarded by the callback + // function + if (result.is_discarded()) + { + result = nullptr; + } + } + else + { + json_sax_dom_parser sdp(result, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict && (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + } + } + + /*! + @brief public accept interface + + @param[in] strict whether to expect the last token to be EOF + @return whether the input is a proper JSON text + */ + bool accept(const bool strict = true) + { + json_sax_acceptor sax_acceptor; + return sax_parse(&sax_acceptor, strict); + } + + template + JSON_HEDLEY_NON_NULL(2) + bool sax_parse(SAX* sax, const bool strict = true) + { + (void)detail::is_sax_static_asserts {}; + const bool result = sax_parse_internal(sax); + + // strict mode: next byte must be EOF + if (result && strict && (get_token() != token_type::end_of_input)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + return result; + } + + private: + template + JSON_HEDLEY_NON_NULL(2) + bool sax_parse_internal(SAX* sax) + { + // stack to remember the hierarchy of structured values we are parsing + // true = array; false = object + std::vector states; + // value to avoid a goto (see comment where set to true) + bool skip_to_state_evaluation = false; + + while (true) + { + if (!skip_to_state_evaluation) + { + // invariant: get_token() was called before each iteration + switch (last_token) + { + case token_type::begin_object: + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + // closing } -> we are done + if (get_token() == token_type::end_object) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_object())) + { + return false; + } + break; + } + + // parse key + if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // remember we are now inside an object + states.push_back(false); + + // parse values + get_token(); + continue; + } + + case token_type::begin_array: + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + // closing ] -> we are done + if (get_token() == token_type::end_array) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_array())) + { + return false; + } + break; + } + + // remember we are now inside an array + states.push_back(true); + + // parse values (no need to call get_token) + continue; + } + + case token_type::value_float: + { + const auto res = m_lexer.get_number_float(); + + if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res))) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); + } + + if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string()))) + { + return false; + } + + break; + } + + case token_type::literal_false: + { + if (JSON_HEDLEY_UNLIKELY(!sax->boolean(false))) + { + return false; + } + break; + } + + case token_type::literal_null: + { + if (JSON_HEDLEY_UNLIKELY(!sax->null())) + { + return false; + } + break; + } + + case token_type::literal_true: + { + if (JSON_HEDLEY_UNLIKELY(!sax->boolean(true))) + { + return false; + } + break; + } + + case token_type::value_integer: + { + if (JSON_HEDLEY_UNLIKELY(!sax->number_integer(m_lexer.get_number_integer()))) + { + return false; + } + break; + } + + case token_type::value_string: + { + if (JSON_HEDLEY_UNLIKELY(!sax->string(m_lexer.get_string()))) + { + return false; + } + break; + } + + case token_type::value_unsigned: + { + if (JSON_HEDLEY_UNLIKELY(!sax->number_unsigned(m_lexer.get_number_unsigned()))) + { + return false; + } + break; + } + + case token_type::parse_error: + { + // using "uninitialized" to avoid "expected" message + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::uninitialized, "value"))); + } + + default: // the last token was unexpected + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::literal_or_value, "value"))); + } + } + } + else + { + skip_to_state_evaluation = false; + } + + // we reached this line after we successfully parsed a value + if (states.empty()) + { + // empty stack: we reached the end of the hierarchy: done + return true; + } + + if (states.back()) // array + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse a new value + get_token(); + continue; + } + + // closing ] + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_array())) + { + return false; + } + + // We are done with this array. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + JSON_ASSERT(!states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_array, "array"))); + } + else // object + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse key + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + + if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // parse values + get_token(); + continue; + } + + // closing } + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_object())) + { + return false; + } + + // We are done with this object. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + JSON_ASSERT(!states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_object, "object"))); + } + } + } + + /// get next token from lexer + token_type get_token() + { + return last_token = m_lexer.scan(); + } + + std::string exception_message(const token_type expected, const std::string& context) + { + std::string error_msg = "syntax error "; + + if (!context.empty()) + { + error_msg += "while parsing " + context + " "; + } + + error_msg += "- "; + + if (last_token == token_type::parse_error) + { + error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" + + m_lexer.get_token_string() + "'"; + } + else + { + error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token)); + } + + if (expected != token_type::uninitialized) + { + error_msg += "; expected " + std::string(lexer_t::token_type_name(expected)); + } + + return error_msg; + } + + private: + /// callback function + const parser_callback_t callback = nullptr; + /// the type of the last read token + token_type last_token = token_type::uninitialized; + /// the lexer + lexer_t m_lexer; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +// #include + + +#include // ptrdiff_t +#include // numeric_limits + +namespace nlohmann +{ +namespace detail +{ +/* +@brief an iterator for primitive JSON types + +This class models an iterator for primitive JSON types (boolean, number, +string). It's only purpose is to allow the iterator/const_iterator classes +to "iterate" over primitive values. Internally, the iterator is modeled by +a `difference_type` variable. Value begin_value (`0`) models the begin, +end_value (`1`) models past the end. +*/ +class primitive_iterator_t +{ + private: + using difference_type = std::ptrdiff_t; + static constexpr difference_type begin_value = 0; + static constexpr difference_type end_value = begin_value + 1; + + /// iterator as signed integer type + difference_type m_it = (std::numeric_limits::min)(); + + public: + constexpr difference_type get_value() const noexcept + { + return m_it; + } + + /// set iterator to a defined beginning + void set_begin() noexcept + { + m_it = begin_value; + } + + /// set iterator to a defined past the end + void set_end() noexcept + { + m_it = end_value; + } + + /// return whether the iterator can be dereferenced + constexpr bool is_begin() const noexcept + { + return m_it == begin_value; + } + + /// return whether the iterator is at end + constexpr bool is_end() const noexcept + { + return m_it == end_value; + } + + friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it == rhs.m_it; + } + + friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it < rhs.m_it; + } + + primitive_iterator_t operator+(difference_type n) noexcept + { + auto result = *this; + result += n; + return result; + } + + friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it - rhs.m_it; + } + + primitive_iterator_t& operator++() noexcept + { + ++m_it; + return *this; + } + + primitive_iterator_t const operator++(int) noexcept + { + auto result = *this; + ++m_it; + return result; + } + + primitive_iterator_t& operator--() noexcept + { + --m_it; + return *this; + } + + primitive_iterator_t const operator--(int) noexcept + { + auto result = *this; + --m_it; + return result; + } + + primitive_iterator_t& operator+=(difference_type n) noexcept + { + m_it += n; + return *this; + } + + primitive_iterator_t& operator-=(difference_type n) noexcept + { + m_it -= n; + return *this; + } +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/*! +@brief an iterator value + +@note This structure could easily be a union, but MSVC currently does not allow +unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. +*/ +template struct internal_iterator +{ + /// iterator for JSON objects + typename BasicJsonType::object_t::iterator object_iterator {}; + /// iterator for JSON arrays + typename BasicJsonType::array_t::iterator array_iterator {}; + /// generic iterator for all other types + primitive_iterator_t primitive_iterator {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next +#include // conditional, is_const, remove_const + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +// forward declare, to be able to friend it later on +template class iteration_proxy; +template class iteration_proxy_value; + +/*! +@brief a template for a bidirectional iterator for the @ref basic_json class +This class implements a both iterators (iterator and const_iterator) for the +@ref basic_json class. +@note An iterator is called *initialized* when a pointer to a JSON value has + been set (e.g., by a constructor or a copy assignment). If the iterator is + default-constructed, it is *uninitialized* and most methods are undefined. + **The library uses assertions to detect calls on uninitialized iterators.** +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +@since version 1.0.0, simplified in version 2.0.9, change to bidirectional + iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593) +*/ +template +class iter_impl +{ + /// allow basic_json to access private members + friend iter_impl::value, typename std::remove_const::type, const BasicJsonType>::type>; + friend BasicJsonType; + friend iteration_proxy; + friend iteration_proxy_value; + + using object_t = typename BasicJsonType::object_t; + using array_t = typename BasicJsonType::array_t; + // make sure BasicJsonType is basic_json or const basic_json + static_assert(is_basic_json::type>::value, + "iter_impl only accepts (const) basic_json"); + + public: + + /// The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. + /// The C++ Standard has never required user-defined iterators to derive from std::iterator. + /// A user-defined iterator should provide publicly accessible typedefs named + /// iterator_category, value_type, difference_type, pointer, and reference. + /// Note that value_type is required to be non-const, even for constant iterators. + using iterator_category = std::bidirectional_iterator_tag; + + /// the type of the values when the iterator is dereferenced + using value_type = typename BasicJsonType::value_type; + /// a type to represent differences between iterators + using difference_type = typename BasicJsonType::difference_type; + /// defines a pointer to the type iterated over (value_type) + using pointer = typename std::conditional::value, + typename BasicJsonType::const_pointer, + typename BasicJsonType::pointer>::type; + /// defines a reference to the type iterated over (value_type) + using reference = + typename std::conditional::value, + typename BasicJsonType::const_reference, + typename BasicJsonType::reference>::type; + + /// default constructor + iter_impl() = default; + + /*! + @brief constructor for a given JSON instance + @param[in] object pointer to a JSON object for this iterator + @pre object != nullptr + @post The iterator is initialized; i.e. `m_object != nullptr`. + */ + explicit iter_impl(pointer object) noexcept : m_object(object) + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = typename object_t::iterator(); + break; + } + + case value_t::array: + { + m_it.array_iterator = typename array_t::iterator(); + break; + } + + default: + { + m_it.primitive_iterator = primitive_iterator_t(); + break; + } + } + } + + /*! + @note The conventional copy constructor and copy assignment are implicitly + defined. Combined with the following converting constructor and + assignment, they support: (1) copy from iterator to iterator, (2) + copy from const iterator to const iterator, and (3) conversion from + iterator to const iterator. However conversion from const iterator + to iterator is not defined. + */ + + /*! + @brief const copy constructor + @param[in] other const iterator to copy from + @note This copy constructor had to be defined explicitly to circumvent a bug + occurring on msvc v19.0 compiler (VS 2015) debug build. For more + information refer to: https://github.com/nlohmann/json/issues/1608 + */ + iter_impl(const iter_impl& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + /*! + @brief converting constructor + @param[in] other non-const iterator to copy from + @note It is not checked whether @a other is initialized. + */ + iter_impl(const iter_impl::type>& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other non-const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl::type>& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + private: + /*! + @brief set the iterator to the first value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_begin() noexcept + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->begin(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->begin(); + break; + } + + case value_t::null: + { + // set to end so begin()==end() is true: null is empty + m_it.primitive_iterator.set_end(); + break; + } + + default: + { + m_it.primitive_iterator.set_begin(); + break; + } + } + } + + /*! + @brief set the iterator past the last value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_end() noexcept + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->end(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->end(); + break; + } + + default: + { + m_it.primitive_iterator.set_end(); + break; + } + } + } + + public: + /*! + @brief return a reference to the value pointed to by the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator*() const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + JSON_ASSERT(m_it.object_iterator != m_object->m_value.object->end()); + return m_it.object_iterator->second; + } + + case value_t::array: + { + JSON_ASSERT(m_it.array_iterator != m_object->m_value.array->end()); + return *m_it.array_iterator; + } + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief dereference the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + pointer operator->() const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + JSON_ASSERT(m_it.object_iterator != m_object->m_value.object->end()); + return &(m_it.object_iterator->second); + } + + case value_t::array: + { + JSON_ASSERT(m_it.array_iterator != m_object->m_value.array->end()); + return &*m_it.array_iterator; + } + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief post-increment (it++) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator++(int) + { + auto result = *this; + ++(*this); + return result; + } + + /*! + @brief pre-increment (++it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator++() + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, 1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, 1); + break; + } + + default: + { + ++m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief post-decrement (it--) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator--(int) + { + auto result = *this; + --(*this); + return result; + } + + /*! + @brief pre-decrement (--it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator--() + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, -1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, -1); + break; + } + + default: + { + --m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief comparison: equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator==(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + return (m_it.object_iterator == other.m_it.object_iterator); + + case value_t::array: + return (m_it.array_iterator == other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator == other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: not equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator!=(const iter_impl& other) const + { + return !operator==(other); + } + + /*! + @brief comparison: smaller + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(213, "cannot compare order of object iterators")); + + case value_t::array: + return (m_it.array_iterator < other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator < other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: less than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<=(const iter_impl& other) const + { + return !other.operator < (*this); + } + + /*! + @brief comparison: greater than + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>(const iter_impl& other) const + { + return !operator<=(other); + } + + /*! + @brief comparison: greater than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>=(const iter_impl& other) const + { + return !operator<(other); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator+=(difference_type i) + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + { + std::advance(m_it.array_iterator, i); + break; + } + + default: + { + m_it.primitive_iterator += i; + break; + } + } + + return *this; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator-=(difference_type i) + { + return operator+=(-i); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator+(difference_type i) const + { + auto result = *this; + result += i; + return result; + } + + /*! + @brief addition of distance and iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + friend iter_impl operator+(difference_type i, const iter_impl& it) + { + auto result = it; + result += i; + return result; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator-(difference_type i) const + { + auto result = *this; + result -= i; + return result; + } + + /*! + @brief return difference + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + difference_type operator-(const iter_impl& other) const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + return m_it.array_iterator - other.m_it.array_iterator; + + default: + return m_it.primitive_iterator - other.m_it.primitive_iterator; + } + } + + /*! + @brief access to successor + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator[](difference_type n) const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(208, "cannot use operator[] for object iterators")); + + case value_t::array: + return *std::next(m_it.array_iterator, n); + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief return the key of an object iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + const typename object_t::key_type& key() const + { + JSON_ASSERT(m_object != nullptr); + + if (JSON_HEDLEY_LIKELY(m_object->is_object())) + { + return m_it.object_iterator->first; + } + + JSON_THROW(invalid_iterator::create(207, "cannot use key() for non-object iterators")); + } + + /*! + @brief return the value of an iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference value() const + { + return operator*(); + } + + private: + /// associated JSON instance + pointer m_object = nullptr; + /// the actual iterator of the associated instance + internal_iterator::type> m_it {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // ptrdiff_t +#include // reverse_iterator +#include // declval + +namespace nlohmann +{ +namespace detail +{ +////////////////////// +// reverse_iterator // +////////////////////// + +/*! +@brief a template for a reverse iterator class + +@tparam Base the base iterator type to reverse. Valid types are @ref +iterator (to create @ref reverse_iterator) and @ref const_iterator (to +create @ref const_reverse_iterator). + +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +- [OutputIterator](https://en.cppreference.com/w/cpp/named_req/OutputIterator): + It is possible to write to the pointed-to element (only if @a Base is + @ref iterator). + +@since version 1.0.0 +*/ +template +class json_reverse_iterator : public std::reverse_iterator +{ + public: + using difference_type = std::ptrdiff_t; + /// shortcut to the reverse iterator adapter + using base_iterator = std::reverse_iterator; + /// the reference type for the pointed-to element + using reference = typename Base::reference; + + /// create reverse iterator from iterator + explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept + : base_iterator(it) {} + + /// create reverse iterator from base class + explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} + + /// post-increment (it++) + json_reverse_iterator const operator++(int) + { + return static_cast(base_iterator::operator++(1)); + } + + /// pre-increment (++it) + json_reverse_iterator& operator++() + { + return static_cast(base_iterator::operator++()); + } + + /// post-decrement (it--) + json_reverse_iterator const operator--(int) + { + return static_cast(base_iterator::operator--(1)); + } + + /// pre-decrement (--it) + json_reverse_iterator& operator--() + { + return static_cast(base_iterator::operator--()); + } + + /// add to iterator + json_reverse_iterator& operator+=(difference_type i) + { + return static_cast(base_iterator::operator+=(i)); + } + + /// add to iterator + json_reverse_iterator operator+(difference_type i) const + { + return static_cast(base_iterator::operator+(i)); + } + + /// subtract from iterator + json_reverse_iterator operator-(difference_type i) const + { + return static_cast(base_iterator::operator-(i)); + } + + /// return difference + difference_type operator-(const json_reverse_iterator& other) const + { + return base_iterator(*this) - base_iterator(other); + } + + /// access to successor + reference operator[](difference_type n) const + { + return *(this->operator+(n)); + } + + /// return the key of an object iterator + auto key() const -> decltype(std::declval().key()) + { + auto it = --this->base(); + return it.key(); + } + + /// return the value of an iterator + reference value() const + { + auto it = --this->base(); + return it.operator * (); + } +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // all_of +#include // isdigit +#include // max +#include // accumulate +#include // string +#include // move +#include // vector + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +template +class json_pointer +{ + // allow basic_json to access private members + NLOHMANN_BASIC_JSON_TPL_DECLARATION + friend class basic_json; + + public: + /*! + @brief create JSON pointer + + Create a JSON pointer according to the syntax described in + [Section 3 of RFC6901](https://tools.ietf.org/html/rfc6901#section-3). + + @param[in] s string representing the JSON pointer; if omitted, the empty + string is assumed which references the whole JSON value + + @throw parse_error.107 if the given JSON pointer @a s is nonempty and does + not begin with a slash (`/`); see example below + + @throw parse_error.108 if a tilde (`~`) in the given JSON pointer @a s is + not followed by `0` (representing `~`) or `1` (representing `/`); see + example below + + @liveexample{The example shows the construction several valid JSON pointers + as well as the exceptional behavior.,json_pointer} + + @since version 2.0.0 + */ + explicit json_pointer(const std::string& s = "") + : reference_tokens(split(s)) + {} + + /*! + @brief return a string representation of the JSON pointer + + @invariant For each JSON pointer `ptr`, it holds: + @code {.cpp} + ptr == json_pointer(ptr.to_string()); + @endcode + + @return a string representation of the JSON pointer + + @liveexample{The example shows the result of `to_string`.,json_pointer__to_string} + + @since version 2.0.0 + */ + std::string to_string() const + { + return std::accumulate(reference_tokens.begin(), reference_tokens.end(), + std::string{}, + [](const std::string & a, const std::string & b) + { + return a + "/" + escape(b); + }); + } + + /// @copydoc to_string() + operator std::string() const + { + return to_string(); + } + + /*! + @brief append another JSON pointer at the end of this JSON pointer + + @param[in] ptr JSON pointer to append + @return JSON pointer with @a ptr appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, const json_pointer&) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(const json_pointer& ptr) + { + reference_tokens.insert(reference_tokens.end(), + ptr.reference_tokens.begin(), + ptr.reference_tokens.end()); + return *this; + } + + /*! + @brief append an unescaped reference token at the end of this JSON pointer + + @param[in] token reference token to append + @return JSON pointer with @a token appended without escaping @a token + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, std::size_t) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::string token) + { + push_back(std::move(token)); + return *this; + } + + /*! + @brief append an array index at the end of this JSON pointer + + @param[in] array_idx array index to append + @return JSON pointer with @a array_idx appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/(const json_pointer&, std::string) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::size_t array_idx) + { + return *this /= std::to_string(array_idx); + } + + /*! + @brief create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer + + @param[in] lhs JSON pointer + @param[in] rhs JSON pointer + @return a new JSON pointer with @a rhs appended to @a lhs + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a lhs and @a rhs. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& lhs, + const json_pointer& rhs) + { + return json_pointer(lhs) /= rhs; + } + + /*! + @brief create a new JSON pointer by appending the unescaped token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] token reference token + @return a new JSON pointer with unescaped @a token appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::string token) + { + return json_pointer(ptr) /= std::move(token); + } + + /*! + @brief create a new JSON pointer by appending the array-index-token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] array_idx array index + @return a new JSON pointer with @a array_idx appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::size_t) to append an array index + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::size_t array_idx) + { + return json_pointer(ptr) /= array_idx; + } + + /*! + @brief returns the parent of this JSON pointer + + @return parent of this JSON pointer; in case this JSON pointer is the root, + the root itself is returned + + @complexity Linear in the length of the JSON pointer. + + @liveexample{The example shows the result of `parent_pointer` for different + JSON Pointers.,json_pointer__parent_pointer} + + @since version 3.6.0 + */ + json_pointer parent_pointer() const + { + if (empty()) + { + return *this; + } + + json_pointer res = *this; + res.pop_back(); + return res; + } + + /*! + @brief remove last reference token + + @pre not `empty()` + + @liveexample{The example shows the usage of `pop_back`.,json_pointer__pop_back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + void pop_back() + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + reference_tokens.pop_back(); + } + + /*! + @brief return last reference token + + @pre not `empty()` + @return last reference token + + @liveexample{The example shows the usage of `back`.,json_pointer__back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + const std::string& back() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + return reference_tokens.back(); + } + + /*! + @brief append an unescaped token at the end of the reference pointer + + @param[in] token token to add + + @complexity Amortized constant. + + @liveexample{The example shows the result of `push_back` for different + JSON Pointers.,json_pointer__push_back} + + @since version 3.6.0 + */ + void push_back(const std::string& token) + { + reference_tokens.push_back(token); + } + + /// @copydoc push_back(const std::string&) + void push_back(std::string&& token) + { + reference_tokens.push_back(std::move(token)); + } + + /*! + @brief return whether pointer points to the root document + + @return true iff the JSON pointer points to the root document + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example shows the result of `empty` for different JSON + Pointers.,json_pointer__empty} + + @since version 3.6.0 + */ + bool empty() const noexcept + { + return reference_tokens.empty(); + } + + private: + /*! + @param[in] s reference token to be converted into an array index + + @return integer representation of @a s + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index begins not with a digit + @throw out_of_range.404 if string @a s could not be converted to an integer + @throw out_of_range.410 if an array index exceeds size_type + */ + static typename BasicJsonType::size_type array_index(const std::string& s) + { + using size_type = typename BasicJsonType::size_type; + + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && s[0] == '0')) + { + JSON_THROW(detail::parse_error::create(106, 0, + "array index '" + s + + "' must not begin with '0'")); + } + + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && !(s[0] >= '1' && s[0] <= '9'))) + { + JSON_THROW(detail::parse_error::create(109, 0, "array index '" + s + "' is not a number")); + } + + std::size_t processed_chars = 0; + unsigned long long res = 0; + JSON_TRY + { + res = std::stoull(s, &processed_chars); + } + JSON_CATCH(std::out_of_range&) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + // check if the string was completely read + if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + // only triggered on special platforms (like 32bit), see also + // https://github.com/nlohmann/json/pull/2203 + if (res >= static_cast((std::numeric_limits::max)())) + { + JSON_THROW(detail::out_of_range::create(410, "array index " + s + " exceeds size_type")); // LCOV_EXCL_LINE + } + + return static_cast(res); + } + + json_pointer top() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + json_pointer result = *this; + result.reference_tokens = {reference_tokens[0]}; + return result; + } + + /*! + @brief create and return a reference to the pointed to value + + @complexity Linear in the number of reference tokens. + + @throw parse_error.109 if array index is not a number + @throw type_error.313 if value cannot be unflattened + */ + BasicJsonType& get_and_create(BasicJsonType& j) const + { + auto result = &j; + + // in case no reference tokens exist, return a reference to the JSON value + // j which will be overwritten by a primitive value + for (const auto& reference_token : reference_tokens) + { + switch (result->type()) + { + case detail::value_t::null: + { + if (reference_token == "0") + { + // start a new array if reference token is 0 + result = &result->operator[](0); + } + else + { + // start a new object otherwise + result = &result->operator[](reference_token); + } + break; + } + + case detail::value_t::object: + { + // create an entry in the object + result = &result->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + // create an entry in the array + result = &result->operator[](array_index(reference_token)); + break; + } + + /* + The following code is only reached if there exists a reference + token _and_ the current value is primitive. In this case, we have + an error situation, because primitive values may only occur as + single value; that is, with an empty list of reference tokens. + */ + default: + JSON_THROW(detail::type_error::create(313, "invalid value to unflatten")); + } + } + + return *result; + } + + /*! + @brief return a reference to the pointed to value + + @note This version does not throw if a value is not present, but tries to + create nested values instead. For instance, calling this function + with pointer `"/this/that"` on a null value is equivalent to calling + `operator[]("this").operator[]("that")` on that value, effectively + changing the null value to an object. + + @param[in] ptr a JSON value + + @return reference to the JSON value pointed to by the JSON pointer + + @complexity Linear in the length of the JSON pointer. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_unchecked(BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + // convert null values to arrays or objects before continuing + if (ptr->is_null()) + { + // check if reference token is a number + const bool nums = + std::all_of(reference_token.begin(), reference_token.end(), + [](const unsigned char x) + { + return std::isdigit(x); + }); + + // change value to array for numbers or "-" or to object otherwise + *ptr = (nums || reference_token == "-") + ? detail::value_t::array + : detail::value_t::object; + } + + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (reference_token == "-") + { + // explicitly treat "-" as index beyond the end + ptr = &ptr->operator[](ptr->m_value.array->size()); + } + else + { + // convert array index to number; unchecked access + ptr = &ptr->operator[](array_index(reference_token)); + } + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_checked(BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @brief return a const reference to the pointed to value + + @param[in] ptr a JSON value + + @return const reference to the JSON value pointed to by the JSON + pointer + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_unchecked(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" cannot be used for const access + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // use unchecked array access + ptr = &ptr->operator[](array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_checked(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + */ + bool contains(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + if (!ptr->contains(reference_token)) + { + // we did not find the key in the object + return false; + } + + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() == 1 && !("0" <= reference_token && reference_token <= "9"))) + { + // invalid char + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1)) + { + if (JSON_HEDLEY_UNLIKELY(!('1' <= reference_token[0] && reference_token[0] <= '9'))) + { + // first char should be between '1' and '9' + return false; + } + for (std::size_t i = 1; i < reference_token.size(); i++) + { + if (JSON_HEDLEY_UNLIKELY(!('0' <= reference_token[i] && reference_token[i] <= '9'))) + { + // other char should be between '0' and '9' + return false; + } + } + } + + const auto idx = array_index(reference_token); + if (idx >= ptr->size()) + { + // index out of range + return false; + } + + ptr = &ptr->operator[](idx); + break; + } + + default: + { + // we do not expect primitive values if there is still a + // reference token to process + return false; + } + } + } + + // no reference token left means we found a primitive value + return true; + } + + /*! + @brief split the string input to reference tokens + + @note This function is only called by the json_pointer constructor. + All exceptions below are documented there. + + @throw parse_error.107 if the pointer is not empty or begins with '/' + @throw parse_error.108 if character '~' is not followed by '0' or '1' + */ + static std::vector split(const std::string& reference_string) + { + std::vector result; + + // special case: empty reference string -> no reference tokens + if (reference_string.empty()) + { + return result; + } + + // check if nonempty reference string begins with slash + if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) + { + JSON_THROW(detail::parse_error::create(107, 1, + "JSON pointer must be empty or begin with '/' - was: '" + + reference_string + "'")); + } + + // extract the reference tokens: + // - slash: position of the last read slash (or end of string) + // - start: position after the previous slash + for ( + // search for the first slash after the first character + std::size_t slash = reference_string.find_first_of('/', 1), + // set the beginning of the first reference token + start = 1; + // we can stop if start == 0 (if slash == std::string::npos) + start != 0; + // set the beginning of the next reference token + // (will eventually be 0 if slash == std::string::npos) + start = (slash == std::string::npos) ? 0 : slash + 1, + // find next slash + slash = reference_string.find_first_of('/', start)) + { + // use the text between the beginning of the reference token + // (start) and the last slash (slash). + auto reference_token = reference_string.substr(start, slash - start); + + // check reference tokens are properly escaped + for (std::size_t pos = reference_token.find_first_of('~'); + pos != std::string::npos; + pos = reference_token.find_first_of('~', pos + 1)) + { + JSON_ASSERT(reference_token[pos] == '~'); + + // ~ must be followed by 0 or 1 + if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 || + (reference_token[pos + 1] != '0' && + reference_token[pos + 1] != '1'))) + { + JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); + } + } + + // finally, store the reference token + unescape(reference_token); + result.push_back(reference_token); + } + + return result; + } + + /*! + @brief replace all occurrences of a substring by another string + + @param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t + @param[in] f the substring to replace with @a t + @param[in] t the string to replace @a f + + @pre The search string @a f must not be empty. **This precondition is + enforced with an assertion.** + + @since version 2.0.0 + */ + static void replace_substring(std::string& s, const std::string& f, + const std::string& t) + { + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != std::string::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} + } + + /// escape "~" to "~0" and "/" to "~1" + static std::string escape(std::string s) + { + replace_substring(s, "~", "~0"); + replace_substring(s, "/", "~1"); + return s; + } + + /// unescape "~1" to tilde and "~0" to slash (order is important!) + static void unescape(std::string& s) + { + replace_substring(s, "~1", "/"); + replace_substring(s, "~0", "~"); + } + + /*! + @param[in] reference_string the reference string to the current value + @param[in] value the value to consider + @param[in,out] result the result object to insert values to + + @note Empty objects or arrays are flattened to `null`. + */ + static void flatten(const std::string& reference_string, + const BasicJsonType& value, + BasicJsonType& result) + { + switch (value.type()) + { + case detail::value_t::array: + { + if (value.m_value.array->empty()) + { + // flatten empty array as null + result[reference_string] = nullptr; + } + else + { + // iterate array and use index as reference string + for (std::size_t i = 0; i < value.m_value.array->size(); ++i) + { + flatten(reference_string + "/" + std::to_string(i), + value.m_value.array->operator[](i), result); + } + } + break; + } + + case detail::value_t::object: + { + if (value.m_value.object->empty()) + { + // flatten empty object as null + result[reference_string] = nullptr; + } + else + { + // iterate object and use keys as reference string + for (const auto& element : *value.m_value.object) + { + flatten(reference_string + "/" + escape(element.first), element.second, result); + } + } + break; + } + + default: + { + // add primitive value with its reference string + result[reference_string] = value; + break; + } + } + } + + /*! + @param[in] value flattened JSON + + @return unflattened JSON + + @throw parse_error.109 if array index is not a number + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + @throw type_error.313 if value cannot be unflattened + */ + static BasicJsonType + unflatten(const BasicJsonType& value) + { + if (JSON_HEDLEY_UNLIKELY(!value.is_object())) + { + JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); + } + + BasicJsonType result; + + // iterate the JSON object values + for (const auto& element : *value.m_value.object) + { + if (JSON_HEDLEY_UNLIKELY(!element.second.is_primitive())) + { + JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); + } + + // assign value to reference pointed to by JSON pointer; Note that if + // the JSON pointer is "" (i.e., points to the whole value), function + // get_and_create returns a reference to result itself. An assignment + // will then create a primitive value. + json_pointer(element.first).get_and_create(result) = element.second; + } + + return result; + } + + /*! + @brief compares two JSON pointers for equality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is equal to @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator==(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return lhs.reference_tokens == rhs.reference_tokens; + } + + /*! + @brief compares two JSON pointers for inequality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is not equal @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator!=(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return !(lhs == rhs); + } + + /// the reference tokens + std::vector reference_tokens; +}; +} // namespace nlohmann + +// #include + + +#include +#include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +class json_ref +{ + public: + using value_type = BasicJsonType; + + json_ref(value_type&& value) + : owned_value(std::move(value)) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + json_ref(const value_type& value) + : value_ref(const_cast(&value)) + , is_rvalue(false) + {} + + json_ref(std::initializer_list init) + : owned_value(init) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + template < + class... Args, + enable_if_t::value, int> = 0 > + json_ref(Args && ... args) + : owned_value(std::forward(args)...) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + // class should be movable only + json_ref(json_ref&&) = default; + json_ref(const json_ref&) = delete; + json_ref& operator=(const json_ref&) = delete; + json_ref& operator=(json_ref&&) = delete; + ~json_ref() = default; + + value_type moved_or_copied() const + { + if (is_rvalue) + { + return std::move(*value_ref); + } + return *value_ref; + } + + value_type const& operator*() const + { + return *static_cast(value_ref); + } + + value_type const* operator->() const + { + return static_cast(value_ref); + } + + private: + mutable value_type owned_value = nullptr; + value_type* value_ref = nullptr; + const bool is_rvalue = true; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + + +#include // reverse +#include // array +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // memcpy +#include // numeric_limits +#include // string +#include // isnan, isinf + +// #include + +// #include + +// #include + + +#include // copy +#include // size_t +#include // streamsize +#include // back_inserter +#include // shared_ptr, make_shared +#include // basic_ostream +#include // basic_string +#include // vector +// #include + + +namespace nlohmann +{ +namespace detail +{ +/// abstract output adapter interface +template struct output_adapter_protocol +{ + virtual void write_character(CharType c) = 0; + virtual void write_characters(const CharType* s, std::size_t length) = 0; + virtual ~output_adapter_protocol() = default; +}; + +/// a type to simplify interfaces +template +using output_adapter_t = std::shared_ptr>; + +/// output adapter for byte vectors +template +class output_vector_adapter : public output_adapter_protocol +{ + public: + explicit output_vector_adapter(std::vector& vec) noexcept + : v(vec) + {} + + void write_character(CharType c) override + { + v.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + std::copy(s, s + length, std::back_inserter(v)); + } + + private: + std::vector& v; +}; + +/// output adapter for output streams +template +class output_stream_adapter : public output_adapter_protocol +{ + public: + explicit output_stream_adapter(std::basic_ostream& s) noexcept + : stream(s) + {} + + void write_character(CharType c) override + { + stream.put(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + stream.write(s, static_cast(length)); + } + + private: + std::basic_ostream& stream; +}; + +/// output adapter for basic_string +template> +class output_string_adapter : public output_adapter_protocol +{ + public: + explicit output_string_adapter(StringType& s) noexcept + : str(s) + {} + + void write_character(CharType c) override + { + str.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + str.append(s, length); + } + + private: + StringType& str; +}; + +template> +class output_adapter +{ + public: + output_adapter(std::vector& vec) + : oa(std::make_shared>(vec)) {} + + output_adapter(std::basic_ostream& s) + : oa(std::make_shared>(s)) {} + + output_adapter(StringType& s) + : oa(std::make_shared>(s)) {} + + operator output_adapter_t() + { + return oa; + } + + private: + output_adapter_t oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// binary writer // +/////////////////// + +/*! +@brief serialization to CBOR and MessagePack values +*/ +template +class binary_writer +{ + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using number_float_t = typename BasicJsonType::number_float_t; + + public: + /*! + @brief create a binary writer + + @param[in] adapter output adapter to write to + */ + explicit binary_writer(output_adapter_t adapter) : oa(adapter) + { + JSON_ASSERT(oa); + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + { + write_bson_object(*j.m_value.object); + break; + } + + default: + { + JSON_THROW(type_error::create(317, "to serialize to BSON, top-level type must be object, but is " + std::string(j.type_name()))); + } + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_cbor(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: + { + oa->write_character(to_char_type(0xF6)); + break; + } + + case value_t::boolean: + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xF5) + : to_char_type(0xF4)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // CBOR does not differentiate between positive signed + // integers and unsigned integers. Therefore, we used the + // code from the value_t::number_unsigned case here. + if (j.m_value.number_integer <= 0x17) + { + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast(j.m_value.number_integer)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast(j.m_value.number_integer)); + } + } + else + { + // The conversions below encode the sign in the first + // byte, and the value is converted to a positive number. + const auto positive_number = -1 - j.m_value.number_integer; + if (j.m_value.number_integer >= -24) + { + write_number(static_cast(0x20 + positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x38)); + write_number(static_cast(positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x39)); + write_number(static_cast(positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x3A)); + write_number(static_cast(positive_number)); + } + else + { + oa->write_character(to_char_type(0x3B)); + write_number(static_cast(positive_number)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= 0x17) + { + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast(j.m_value.number_unsigned)); + } + break; + } + + case value_t::number_float: + { + if (std::isnan(j.m_value.number_float)) + { + // NaN is 0xf97e00 in CBOR + oa->write_character(to_char_type(0xF9)); + oa->write_character(to_char_type(0x7E)); + oa->write_character(to_char_type(0x00)); + } + else if (std::isinf(j.m_value.number_float)) + { + // Infinity is 0xf97c00, -Infinity is 0xf9fc00 + oa->write_character(to_char_type(0xf9)); + oa->write_character(j.m_value.number_float > 0 ? to_char_type(0x7C) : to_char_type(0xFC)); + oa->write_character(to_char_type(0x00)); + } + else + { + write_compact_float(j.m_value.number_float, detail::input_format_t::cbor); + } + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 0x17) + { + write_number(static_cast(0x60 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x78)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x79)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x7A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x7B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write the string + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 0x17) + { + write_number(static_cast(0x80 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x98)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x99)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x9A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x9B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_cbor(el); + } + break; + } + + case value_t::binary: + { + if (j.m_value.binary->has_subtype()) + { + write_number(static_cast(0xd8)); + write_number(j.m_value.binary->subtype()); + } + + // step 1: write control byte and the binary array size + const auto N = j.m_value.binary->size(); + if (N <= 0x17) + { + write_number(static_cast(0x40 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x58)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x59)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x5A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x5B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 0x17) + { + write_number(static_cast(0xA0 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xB8)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xB9)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xBA)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xBB)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_cbor(el.first); + write_cbor(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_msgpack(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: // nil + { + oa->write_character(to_char_type(0xC0)); + break; + } + + case value_t::boolean: // true and false + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xC3) + : to_char_type(0xC2)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // MessagePack does not differentiate between positive + // signed integers and unsigned integers. Therefore, we used + // the code from the value_t::number_unsigned case here. + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast(j.m_value.number_integer)); + } + } + else + { + if (j.m_value.number_integer >= -32) + { + // negative fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 8 + oa->write_character(to_char_type(0xD0)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 16 + oa->write_character(to_char_type(0xD1)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 32 + oa->write_character(to_char_type(0xD2)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 64 + oa->write_character(to_char_type(0xD3)); + write_number(static_cast(j.m_value.number_integer)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast(j.m_value.number_integer)); + } + break; + } + + case value_t::number_float: + { + write_compact_float(j.m_value.number_float, detail::input_format_t::msgpack); + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 31) + { + // fixstr + write_number(static_cast(0xA0 | N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 8 + oa->write_character(to_char_type(0xD9)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 16 + oa->write_character(to_char_type(0xDA)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 32 + oa->write_character(to_char_type(0xDB)); + write_number(static_cast(N)); + } + + // step 2: write the string + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 15) + { + // fixarray + write_number(static_cast(0x90 | N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // array 16 + oa->write_character(to_char_type(0xDC)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // array 32 + oa->write_character(to_char_type(0xDD)); + write_number(static_cast(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_msgpack(el); + } + break; + } + + case value_t::binary: + { + // step 0: determine if the binary type has a set subtype to + // determine whether or not to use the ext or fixext types + const bool use_ext = j.m_value.binary->has_subtype(); + + // step 1: write control byte and the byte string length + const auto N = j.m_value.binary->size(); + if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type{}; + bool fixed = true; + if (use_ext) + { + switch (N) + { + case 1: + output_type = 0xD4; // fixext 1 + break; + case 2: + output_type = 0xD5; // fixext 2 + break; + case 4: + output_type = 0xD6; // fixext 4 + break; + case 8: + output_type = 0xD7; // fixext 8 + break; + case 16: + output_type = 0xD8; // fixext 16 + break; + default: + output_type = 0xC7; // ext 8 + fixed = false; + break; + } + + } + else + { + output_type = 0xC4; // bin 8 + fixed = false; + } + + oa->write_character(to_char_type(output_type)); + if (!fixed) + { + write_number(static_cast(N)); + } + } + else if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type = use_ext + ? 0xC8 // ext 16 + : 0xC5; // bin 16 + + oa->write_character(to_char_type(output_type)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type = use_ext + ? 0xC9 // ext 32 + : 0xC6; // bin 32 + + oa->write_character(to_char_type(output_type)); + write_number(static_cast(N)); + } + + // step 1.5: if this is an ext type, write the subtype + if (use_ext) + { + write_number(static_cast(j.m_value.binary->subtype())); + } + + // step 2: write the byte string + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 15) + { + // fixmap + write_number(static_cast(0x80 | (N & 0xF))); + } + else if (N <= (std::numeric_limits::max)()) + { + // map 16 + oa->write_character(to_char_type(0xDE)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // map 32 + oa->write_character(to_char_type(0xDF)); + write_number(static_cast(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_msgpack(el.first); + write_msgpack(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + @param[in] use_count whether to use '#' prefixes (optimized format) + @param[in] use_type whether to use '$' prefixes (optimized format) + @param[in] add_prefix whether prefixes need to be used for this value + */ + void write_ubjson(const BasicJsonType& j, const bool use_count, + const bool use_type, const bool add_prefix = true) + { + switch (j.type()) + { + case value_t::null: + { + if (add_prefix) + { + oa->write_character(to_char_type('Z')); + } + break; + } + + case value_t::boolean: + { + if (add_prefix) + { + oa->write_character(j.m_value.boolean + ? to_char_type('T') + : to_char_type('F')); + } + break; + } + + case value_t::number_integer: + { + write_number_with_ubjson_prefix(j.m_value.number_integer, add_prefix); + break; + } + + case value_t::number_unsigned: + { + write_number_with_ubjson_prefix(j.m_value.number_unsigned, add_prefix); + break; + } + + case value_t::number_float: + { + write_number_with_ubjson_prefix(j.m_value.number_float, add_prefix); + break; + } + + case value_t::string: + { + if (add_prefix) + { + oa->write_character(to_char_type('S')); + } + write_number_with_ubjson_prefix(j.m_value.string->size(), true); + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + bool prefix_required = true; + if (use_type && !j.m_value.array->empty()) + { + JSON_ASSERT(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin() + 1, j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.array->size(), true); + } + + for (const auto& el : *j.m_value.array) + { + write_ubjson(el, use_count, use_type, prefix_required); + } + + if (!use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::binary: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + if (use_type && !j.m_value.binary->empty()) + { + JSON_ASSERT(use_count); + oa->write_character(to_char_type('$')); + oa->write_character('U'); + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.binary->size(), true); + } + + if (use_type) + { + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + j.m_value.binary->size()); + } + else + { + for (size_t i = 0; i < j.m_value.binary->size(); ++i) + { + oa->write_character(to_char_type('U')); + oa->write_character(j.m_value.binary->data()[i]); + } + } + + if (!use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::object: + { + if (add_prefix) + { + oa->write_character(to_char_type('{')); + } + + bool prefix_required = true; + if (use_type && !j.m_value.object->empty()) + { + JSON_ASSERT(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin(), j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.object->size(), true); + } + + for (const auto& el : *j.m_value.object) + { + write_number_with_ubjson_prefix(el.first.size(), true); + oa->write_characters( + reinterpret_cast(el.first.c_str()), + el.first.size()); + write_ubjson(el.second, use_count, use_type, prefix_required); + } + + if (!use_count) + { + oa->write_character(to_char_type('}')); + } + + break; + } + + default: + break; + } + } + + private: + ////////// + // BSON // + ////////// + + /*! + @return The size of a BSON document entry header, including the id marker + and the entry name size (and its null-terminator). + */ + static std::size_t calc_bson_entry_header_size(const string_t& name) + { + const auto it = name.find(static_cast(0)); + if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + { + JSON_THROW(out_of_range::create(409, + "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); + } + + return /*id*/ 1ul + name.size() + /*zero-terminator*/1u; + } + + /*! + @brief Writes the given @a element_type and @a name to the output adapter + */ + void write_bson_entry_header(const string_t& name, + const std::uint8_t element_type) + { + oa->write_character(to_char_type(element_type)); // boolean + oa->write_characters( + reinterpret_cast(name.c_str()), + name.size() + 1u); + } + + /*! + @brief Writes a BSON element with key @a name and boolean value @a value + */ + void write_bson_boolean(const string_t& name, + const bool value) + { + write_bson_entry_header(name, 0x08); + oa->write_character(value ? to_char_type(0x01) : to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and double value @a value + */ + void write_bson_double(const string_t& name, + const double value) + { + write_bson_entry_header(name, 0x01); + write_number(value); + } + + /*! + @return The size of the BSON-encoded string in @a value + */ + static std::size_t calc_bson_string_size(const string_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and string value @a value + */ + void write_bson_string(const string_t& name, + const string_t& value) + { + write_bson_entry_header(name, 0x02); + + write_number(static_cast(value.size() + 1ul)); + oa->write_characters( + reinterpret_cast(value.c_str()), + value.size() + 1); + } + + /*! + @brief Writes a BSON element with key @a name and null value + */ + void write_bson_null(const string_t& name) + { + write_bson_entry_header(name, 0x0A); + } + + /*! + @return The size of the BSON-encoded integer @a value + */ + static std::size_t calc_bson_integer_size(const std::int64_t value) + { + return (std::numeric_limits::min)() <= value && value <= (std::numeric_limits::max)() + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and integer @a value + */ + void write_bson_integer(const string_t& name, + const std::int64_t value) + { + if ((std::numeric_limits::min)() <= value && value <= (std::numeric_limits::max)()) + { + write_bson_entry_header(name, 0x10); // int32 + write_number(static_cast(value)); + } + else + { + write_bson_entry_header(name, 0x12); // int64 + write_number(static_cast(value)); + } + } + + /*! + @return The size of the BSON-encoded unsigned integer in @a j + */ + static constexpr std::size_t calc_bson_unsigned_size(const std::uint64_t value) noexcept + { + return (value <= static_cast((std::numeric_limits::max)())) + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and unsigned @a value + */ + void write_bson_unsigned(const string_t& name, + const std::uint64_t value) + { + if (value <= static_cast((std::numeric_limits::max)())) + { + write_bson_entry_header(name, 0x10 /* int32 */); + write_number(static_cast(value)); + } + else if (value <= static_cast((std::numeric_limits::max)())) + { + write_bson_entry_header(name, 0x12 /* int64 */); + write_number(static_cast(value)); + } + else + { + JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(value) + " cannot be represented by BSON as it does not fit int64")); + } + } + + /*! + @brief Writes a BSON element with key @a name and object @a value + */ + void write_bson_object_entry(const string_t& name, + const typename BasicJsonType::object_t& value) + { + write_bson_entry_header(name, 0x03); // object + write_bson_object(value); + } + + /*! + @return The size of the BSON-encoded array @a value + */ + static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value) + { + std::size_t array_index = 0ul; + + const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), std::size_t(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el) + { + return result + calc_bson_element_size(std::to_string(array_index++), el); + }); + + return sizeof(std::int32_t) + embedded_document_size + 1ul; + } + + /*! + @return The size of the BSON-encoded binary array @a value + */ + static std::size_t calc_bson_binary_size(const typename BasicJsonType::binary_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and array @a value + */ + void write_bson_array(const string_t& name, + const typename BasicJsonType::array_t& value) + { + write_bson_entry_header(name, 0x04); // array + write_number(static_cast(calc_bson_array_size(value))); + + std::size_t array_index = 0ul; + + for (const auto& el : value) + { + write_bson_element(std::to_string(array_index++), el); + } + + oa->write_character(to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and binary value @a value + */ + void write_bson_binary(const string_t& name, + const binary_t& value) + { + write_bson_entry_header(name, 0x05); + + write_number(static_cast(value.size())); + write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00)); + + oa->write_characters(reinterpret_cast(value.data()), value.size()); + } + + /*! + @brief Calculates the size necessary to serialize the JSON value @a j with its @a name + @return The calculated size for the BSON document entry for @a j with the given @a name. + */ + static std::size_t calc_bson_element_size(const string_t& name, + const BasicJsonType& j) + { + const auto header_size = calc_bson_entry_header_size(name); + switch (j.type()) + { + case value_t::object: + return header_size + calc_bson_object_size(*j.m_value.object); + + case value_t::array: + return header_size + calc_bson_array_size(*j.m_value.array); + + case value_t::binary: + return header_size + calc_bson_binary_size(*j.m_value.binary); + + case value_t::boolean: + return header_size + 1ul; + + case value_t::number_float: + return header_size + 8ul; + + case value_t::number_integer: + return header_size + calc_bson_integer_size(j.m_value.number_integer); + + case value_t::number_unsigned: + return header_size + calc_bson_unsigned_size(j.m_value.number_unsigned); + + case value_t::string: + return header_size + calc_bson_string_size(*j.m_value.string); + + case value_t::null: + return header_size + 0ul; + + // LCOV_EXCL_START + default: + JSON_ASSERT(false); + return 0ul; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Serializes the JSON value @a j to BSON and associates it with the + key @a name. + @param name The name to associate with the JSON entity @a j within the + current BSON document + @return The size of the BSON entry + */ + void write_bson_element(const string_t& name, + const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + return write_bson_object_entry(name, *j.m_value.object); + + case value_t::array: + return write_bson_array(name, *j.m_value.array); + + case value_t::binary: + return write_bson_binary(name, *j.m_value.binary); + + case value_t::boolean: + return write_bson_boolean(name, j.m_value.boolean); + + case value_t::number_float: + return write_bson_double(name, j.m_value.number_float); + + case value_t::number_integer: + return write_bson_integer(name, j.m_value.number_integer); + + case value_t::number_unsigned: + return write_bson_unsigned(name, j.m_value.number_unsigned); + + case value_t::string: + return write_bson_string(name, *j.m_value.string); + + case value_t::null: + return write_bson_null(name); + + // LCOV_EXCL_START + default: + JSON_ASSERT(false); + return; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Calculates the size of the BSON serialization of the given + JSON-object @a j. + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + static std::size_t calc_bson_object_size(const typename BasicJsonType::object_t& value) + { + std::size_t document_size = std::accumulate(value.begin(), value.end(), std::size_t(0), + [](size_t result, const typename BasicJsonType::object_t::value_type & el) + { + return result += calc_bson_element_size(el.first, el.second); + }); + + return sizeof(std::int32_t) + document_size + 1ul; + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson_object(const typename BasicJsonType::object_t& value) + { + write_number(static_cast(calc_bson_object_size(value))); + + for (const auto& el : value) + { + write_bson_element(el.first, el.second); + } + + oa->write_character(to_char_type(0x00)); + } + + ////////// + // CBOR // + ////////// + + static constexpr CharType get_cbor_float_prefix(float /*unused*/) + { + return to_char_type(0xFA); // Single-Precision Float + } + + static constexpr CharType get_cbor_float_prefix(double /*unused*/) + { + return to_char_type(0xFB); // Double-Precision Float + } + + ///////////// + // MsgPack // + ///////////// + + static constexpr CharType get_msgpack_float_prefix(float /*unused*/) + { + return to_char_type(0xCA); // float 32 + } + + static constexpr CharType get_msgpack_float_prefix(double /*unused*/) + { + return to_char_type(0xCB); // float 64 + } + + //////////// + // UBJSON // + //////////// + + // UBJSON: write number (floating point) + template::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (add_prefix) + { + oa->write_character(get_ubjson_float_prefix(n)); + } + write_number(n); + } + + // UBJSON: write number (unsigned integer) + template::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast(n)); + } + else if (n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast(n)); + } + else + { + if (add_prefix) + { + oa->write_character(to_char_type('H')); // high-precision number + } + + const auto number = BasicJsonType(n).dump(); + write_number_with_ubjson_prefix(number.size(), true); + for (std::size_t i = 0; i < number.size(); ++i) + { + oa->write_character(to_char_type(static_cast(number[i]))); + } + } + } + + // UBJSON: write number (signed integer) + template < typename NumberType, typename std::enable_if < + std::is_signed::value&& + !std::is_floating_point::value, int >::type = 0 > + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast(n)); + } + else if (static_cast((std::numeric_limits::min)()) <= n && n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast(n)); + } + // LCOV_EXCL_START + else + { + if (add_prefix) + { + oa->write_character(to_char_type('H')); // high-precision number + } + + const auto number = BasicJsonType(n).dump(); + write_number_with_ubjson_prefix(number.size(), true); + for (std::size_t i = 0; i < number.size(); ++i) + { + oa->write_character(to_char_type(static_cast(number[i]))); + } + } + // LCOV_EXCL_STOP + } + + /*! + @brief determine the type prefix of container values + */ + CharType ubjson_prefix(const BasicJsonType& j) const noexcept + { + switch (j.type()) + { + case value_t::null: + return 'Z'; + + case value_t::boolean: + return j.m_value.boolean ? 'T' : 'F'; + + case value_t::number_integer: + { + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'i'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'U'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'I'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'l'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'L'; + } + // anything else is treated as high-precision number + return 'H'; // LCOV_EXCL_LINE + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'i'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'U'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'I'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'l'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'L'; + } + // anything else is treated as high-precision number + return 'H'; // LCOV_EXCL_LINE + } + + case value_t::number_float: + return get_ubjson_float_prefix(j.m_value.number_float); + + case value_t::string: + return 'S'; + + case value_t::array: // fallthrough + case value_t::binary: + return '['; + + case value_t::object: + return '{'; + + default: // discarded values + return 'N'; + } + } + + static constexpr CharType get_ubjson_float_prefix(float /*unused*/) + { + return 'd'; // float 32 + } + + static constexpr CharType get_ubjson_float_prefix(double /*unused*/) + { + return 'D'; // float 64 + } + + /////////////////////// + // Utility functions // + /////////////////////// + + /* + @brief write a number to output input + @param[in] n number of type @a NumberType + @tparam NumberType the type of the number + @tparam OutputIsLittleEndian Set to true if output data is + required to be little endian + + @note This function needs to respect the system's endianess, because bytes + in CBOR, MessagePack, and UBJSON are stored in network order (big + endian) and therefore need reordering on little endian systems. + */ + template + void write_number(const NumberType n) + { + // step 1: write number to array of length NumberType + std::array vec; + std::memcpy(vec.data(), &n, sizeof(NumberType)); + + // step 2: write array to output (with possible reordering) + if (is_little_endian != OutputIsLittleEndian) + { + // reverse byte order prior to conversion if necessary + std::reverse(vec.begin(), vec.end()); + } + + oa->write_characters(vec.data(), sizeof(NumberType)); + } + + void write_compact_float(const number_float_t n, detail::input_format_t format) + { + if (static_cast(n) >= static_cast(std::numeric_limits::lowest()) && + static_cast(n) <= static_cast((std::numeric_limits::max)()) && + static_cast(static_cast(n)) == static_cast(n)) + { + oa->write_character(format == detail::input_format_t::cbor + ? get_cbor_float_prefix(static_cast(n)) + : get_msgpack_float_prefix(static_cast(n))); + write_number(static_cast(n)); + } + else + { + oa->write_character(format == detail::input_format_t::cbor + ? get_cbor_float_prefix(n) + : get_msgpack_float_prefix(n)); + write_number(n); + } + } + + public: + // The following to_char_type functions are implement the conversion + // between uint8_t and CharType. In case CharType is not unsigned, + // such a conversion is required to allow values greater than 128. + // See for a discussion. + template < typename C = CharType, + enable_if_t < std::is_signed::value && std::is_signed::value > * = nullptr > + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return *reinterpret_cast(&x); + } + + template < typename C = CharType, + enable_if_t < std::is_signed::value && std::is_unsigned::value > * = nullptr > + static CharType to_char_type(std::uint8_t x) noexcept + { + static_assert(sizeof(std::uint8_t) == sizeof(CharType), "size of CharType must be equal to std::uint8_t"); + static_assert(std::is_trivial::value, "CharType must be trivial"); + CharType result; + std::memcpy(&result, &x, sizeof(x)); + return result; + } + + template::value>* = nullptr> + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return x; + } + + template < typename InputCharType, typename C = CharType, + enable_if_t < + std::is_signed::value && + std::is_signed::value && + std::is_same::type>::value + > * = nullptr > + static constexpr CharType to_char_type(InputCharType x) noexcept + { + return x; + } + + private: + /// whether we can assume little endianess + const bool is_little_endian = little_endianess(); + + /// the output + output_adapter_t oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // reverse, remove, fill, find, none_of +#include // array +#include // localeconv, lconv +#include // labs, isfinite, isnan, signbit +#include // size_t, ptrdiff_t +#include // uint8_t +#include // snprintf +#include // numeric_limits +#include // string, char_traits +#include // is_same +#include // move + +// #include + + +#include // array +#include // signbit, isfinite +#include // intN_t, uintN_t +#include // memcpy, memmove +#include // numeric_limits +#include // conditional + +// #include + + +namespace nlohmann +{ +namespace detail +{ + +/*! +@brief implements the Grisu2 algorithm for binary to decimal floating-point +conversion. + +This implementation is a slightly modified version of the reference +implementation which may be obtained from +http://florian.loitsch.com/publications (bench.tar.gz). + +The code is distributed under the MIT license, Copyright (c) 2009 Florian Loitsch. + +For a detailed description of the algorithm see: + +[1] Loitsch, "Printing Floating-Point Numbers Quickly and Accurately with + Integers", Proceedings of the ACM SIGPLAN 2010 Conference on Programming + Language Design and Implementation, PLDI 2010 +[2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and Accurately", + Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language + Design and Implementation, PLDI 1996 +*/ +namespace dtoa_impl +{ + +template +Target reinterpret_bits(const Source source) +{ + static_assert(sizeof(Target) == sizeof(Source), "size mismatch"); + + Target target; + std::memcpy(&target, &source, sizeof(Source)); + return target; +} + +struct diyfp // f * 2^e +{ + static constexpr int kPrecision = 64; // = q + + std::uint64_t f = 0; + int e = 0; + + constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_) {} + + /*! + @brief returns x - y + @pre x.e == y.e and x.f >= y.f + */ + static diyfp sub(const diyfp& x, const diyfp& y) noexcept + { + JSON_ASSERT(x.e == y.e); + JSON_ASSERT(x.f >= y.f); + + return {x.f - y.f, x.e}; + } + + /*! + @brief returns x * y + @note The result is rounded. (Only the upper q bits are returned.) + */ + static diyfp mul(const diyfp& x, const diyfp& y) noexcept + { + static_assert(kPrecision == 64, "internal error"); + + // Computes: + // f = round((x.f * y.f) / 2^q) + // e = x.e + y.e + q + + // Emulate the 64-bit * 64-bit multiplication: + // + // p = u * v + // = (u_lo + 2^32 u_hi) (v_lo + 2^32 v_hi) + // = (u_lo v_lo ) + 2^32 ((u_lo v_hi ) + (u_hi v_lo )) + 2^64 (u_hi v_hi ) + // = (p0 ) + 2^32 ((p1 ) + (p2 )) + 2^64 (p3 ) + // = (p0_lo + 2^32 p0_hi) + 2^32 ((p1_lo + 2^32 p1_hi) + (p2_lo + 2^32 p2_hi)) + 2^64 (p3 ) + // = (p0_lo ) + 2^32 (p0_hi + p1_lo + p2_lo ) + 2^64 (p1_hi + p2_hi + p3) + // = (p0_lo ) + 2^32 (Q ) + 2^64 (H ) + // = (p0_lo ) + 2^32 (Q_lo + 2^32 Q_hi ) + 2^64 (H ) + // + // (Since Q might be larger than 2^32 - 1) + // + // = (p0_lo + 2^32 Q_lo) + 2^64 (Q_hi + H) + // + // (Q_hi + H does not overflow a 64-bit int) + // + // = p_lo + 2^64 p_hi + + const std::uint64_t u_lo = x.f & 0xFFFFFFFFu; + const std::uint64_t u_hi = x.f >> 32u; + const std::uint64_t v_lo = y.f & 0xFFFFFFFFu; + const std::uint64_t v_hi = y.f >> 32u; + + const std::uint64_t p0 = u_lo * v_lo; + const std::uint64_t p1 = u_lo * v_hi; + const std::uint64_t p2 = u_hi * v_lo; + const std::uint64_t p3 = u_hi * v_hi; + + const std::uint64_t p0_hi = p0 >> 32u; + const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu; + const std::uint64_t p1_hi = p1 >> 32u; + const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu; + const std::uint64_t p2_hi = p2 >> 32u; + + std::uint64_t Q = p0_hi + p1_lo + p2_lo; + + // The full product might now be computed as + // + // p_hi = p3 + p2_hi + p1_hi + (Q >> 32) + // p_lo = p0_lo + (Q << 32) + // + // But in this particular case here, the full p_lo is not required. + // Effectively we only need to add the highest bit in p_lo to p_hi (and + // Q_hi + 1 does not overflow). + + Q += std::uint64_t{1} << (64u - 32u - 1u); // round, ties up + + const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u); + + return {h, x.e + y.e + 64}; + } + + /*! + @brief normalize x such that the significand is >= 2^(q-1) + @pre x.f != 0 + */ + static diyfp normalize(diyfp x) noexcept + { + JSON_ASSERT(x.f != 0); + + while ((x.f >> 63u) == 0) + { + x.f <<= 1u; + x.e--; + } + + return x; + } + + /*! + @brief normalize x such that the result has the exponent E + @pre e >= x.e and the upper e - x.e bits of x.f must be zero. + */ + static diyfp normalize_to(const diyfp& x, const int target_exponent) noexcept + { + const int delta = x.e - target_exponent; + + JSON_ASSERT(delta >= 0); + JSON_ASSERT(((x.f << delta) >> delta) == x.f); + + return {x.f << delta, target_exponent}; + } +}; + +struct boundaries +{ + diyfp w; + diyfp minus; + diyfp plus; +}; + +/*! +Compute the (normalized) diyfp representing the input number 'value' and its +boundaries. + +@pre value must be finite and positive +*/ +template +boundaries compute_boundaries(FloatType value) +{ + JSON_ASSERT(std::isfinite(value)); + JSON_ASSERT(value > 0); + + // Convert the IEEE representation into a diyfp. + // + // If v is denormal: + // value = 0.F * 2^(1 - bias) = ( F) * 2^(1 - bias - (p-1)) + // If v is normalized: + // value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1)) + + static_assert(std::numeric_limits::is_iec559, + "internal error: dtoa_short requires an IEEE-754 floating-point implementation"); + + constexpr int kPrecision = std::numeric_limits::digits; // = p (includes the hidden bit) + constexpr int kBias = std::numeric_limits::max_exponent - 1 + (kPrecision - 1); + constexpr int kMinExp = 1 - kBias; + constexpr std::uint64_t kHiddenBit = std::uint64_t{1} << (kPrecision - 1); // = 2^(p-1) + + using bits_type = typename std::conditional::type; + + const std::uint64_t bits = reinterpret_bits(value); + const std::uint64_t E = bits >> (kPrecision - 1); + const std::uint64_t F = bits & (kHiddenBit - 1); + + const bool is_denormal = E == 0; + const diyfp v = is_denormal + ? diyfp(F, kMinExp) + : diyfp(F + kHiddenBit, static_cast(E) - kBias); + + // Compute the boundaries m- and m+ of the floating-point value + // v = f * 2^e. + // + // Determine v- and v+, the floating-point predecessor and successor if v, + // respectively. + // + // v- = v - 2^e if f != 2^(p-1) or e == e_min (A) + // = v - 2^(e-1) if f == 2^(p-1) and e > e_min (B) + // + // v+ = v + 2^e + // + // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_ + // between m- and m+ round to v, regardless of how the input rounding + // algorithm breaks ties. + // + // ---+-------------+-------------+-------------+-------------+--- (A) + // v- m- v m+ v+ + // + // -----------------+------+------+-------------+-------------+--- (B) + // v- m- v m+ v+ + + const bool lower_boundary_is_closer = F == 0 && E > 1; + const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1); + const diyfp m_minus = lower_boundary_is_closer + ? diyfp(4 * v.f - 1, v.e - 2) // (B) + : diyfp(2 * v.f - 1, v.e - 1); // (A) + + // Determine the normalized w+ = m+. + const diyfp w_plus = diyfp::normalize(m_plus); + + // Determine w- = m- such that e_(w-) = e_(w+). + const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e); + + return {diyfp::normalize(v), w_minus, w_plus}; +} + +// Given normalized diyfp w, Grisu needs to find a (normalized) cached +// power-of-ten c, such that the exponent of the product c * w = f * 2^e lies +// within a certain range [alpha, gamma] (Definition 3.2 from [1]) +// +// alpha <= e = e_c + e_w + q <= gamma +// +// or +// +// f_c * f_w * 2^alpha <= f_c 2^(e_c) * f_w 2^(e_w) * 2^q +// <= f_c * f_w * 2^gamma +// +// Since c and w are normalized, i.e. 2^(q-1) <= f < 2^q, this implies +// +// 2^(q-1) * 2^(q-1) * 2^alpha <= c * w * 2^q < 2^q * 2^q * 2^gamma +// +// or +// +// 2^(q - 2 + alpha) <= c * w < 2^(q + gamma) +// +// The choice of (alpha,gamma) determines the size of the table and the form of +// the digit generation procedure. Using (alpha,gamma)=(-60,-32) works out well +// in practice: +// +// The idea is to cut the number c * w = f * 2^e into two parts, which can be +// processed independently: An integral part p1, and a fractional part p2: +// +// f * 2^e = ( (f div 2^-e) * 2^-e + (f mod 2^-e) ) * 2^e +// = (f div 2^-e) + (f mod 2^-e) * 2^e +// = p1 + p2 * 2^e +// +// The conversion of p1 into decimal form requires a series of divisions and +// modulos by (a power of) 10. These operations are faster for 32-bit than for +// 64-bit integers, so p1 should ideally fit into a 32-bit integer. This can be +// achieved by choosing +// +// -e >= 32 or e <= -32 := gamma +// +// In order to convert the fractional part +// +// p2 * 2^e = p2 / 2^-e = d[-1] / 10^1 + d[-2] / 10^2 + ... +// +// into decimal form, the fraction is repeatedly multiplied by 10 and the digits +// d[-i] are extracted in order: +// +// (10 * p2) div 2^-e = d[-1] +// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... +// +// The multiplication by 10 must not overflow. It is sufficient to choose +// +// 10 * p2 < 16 * p2 = 2^4 * p2 <= 2^64. +// +// Since p2 = f mod 2^-e < 2^-e, +// +// -e <= 60 or e >= -60 := alpha + +constexpr int kAlpha = -60; +constexpr int kGamma = -32; + +struct cached_power // c = f * 2^e ~= 10^k +{ + std::uint64_t f; + int e; + int k; +}; + +/*! +For a normalized diyfp w = f * 2^e, this function returns a (normalized) cached +power-of-ten c = f_c * 2^e_c, such that the exponent of the product w * c +satisfies (Definition 3.2 from [1]) + + alpha <= e_c + e + q <= gamma. +*/ +inline cached_power get_cached_power_for_binary_exponent(int e) +{ + // Now + // + // alpha <= e_c + e + q <= gamma (1) + // ==> f_c * 2^alpha <= c * 2^e * 2^q + // + // and since the c's are normalized, 2^(q-1) <= f_c, + // + // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) + // ==> 2^(alpha - e - 1) <= c + // + // If c were an exact power of ten, i.e. c = 10^k, one may determine k as + // + // k = ceil( log_10( 2^(alpha - e - 1) ) ) + // = ceil( (alpha - e - 1) * log_10(2) ) + // + // From the paper: + // "In theory the result of the procedure could be wrong since c is rounded, + // and the computation itself is approximated [...]. In practice, however, + // this simple function is sufficient." + // + // For IEEE double precision floating-point numbers converted into + // normalized diyfp's w = f * 2^e, with q = 64, + // + // e >= -1022 (min IEEE exponent) + // -52 (p - 1) + // -52 (p - 1, possibly normalize denormal IEEE numbers) + // -11 (normalize the diyfp) + // = -1137 + // + // and + // + // e <= +1023 (max IEEE exponent) + // -52 (p - 1) + // -11 (normalize the diyfp) + // = 960 + // + // This binary exponent range [-1137,960] results in a decimal exponent + // range [-307,324]. One does not need to store a cached power for each + // k in this range. For each such k it suffices to find a cached power + // such that the exponent of the product lies in [alpha,gamma]. + // This implies that the difference of the decimal exponents of adjacent + // table entries must be less than or equal to + // + // floor( (gamma - alpha) * log_10(2) ) = 8. + // + // (A smaller distance gamma-alpha would require a larger table.) + + // NB: + // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. + + constexpr int kCachedPowersMinDecExp = -300; + constexpr int kCachedPowersDecStep = 8; + + static constexpr std::array kCachedPowers = + { + { + { 0xAB70FE17C79AC6CA, -1060, -300 }, + { 0xFF77B1FCBEBCDC4F, -1034, -292 }, + { 0xBE5691EF416BD60C, -1007, -284 }, + { 0x8DD01FAD907FFC3C, -980, -276 }, + { 0xD3515C2831559A83, -954, -268 }, + { 0x9D71AC8FADA6C9B5, -927, -260 }, + { 0xEA9C227723EE8BCB, -901, -252 }, + { 0xAECC49914078536D, -874, -244 }, + { 0x823C12795DB6CE57, -847, -236 }, + { 0xC21094364DFB5637, -821, -228 }, + { 0x9096EA6F3848984F, -794, -220 }, + { 0xD77485CB25823AC7, -768, -212 }, + { 0xA086CFCD97BF97F4, -741, -204 }, + { 0xEF340A98172AACE5, -715, -196 }, + { 0xB23867FB2A35B28E, -688, -188 }, + { 0x84C8D4DFD2C63F3B, -661, -180 }, + { 0xC5DD44271AD3CDBA, -635, -172 }, + { 0x936B9FCEBB25C996, -608, -164 }, + { 0xDBAC6C247D62A584, -582, -156 }, + { 0xA3AB66580D5FDAF6, -555, -148 }, + { 0xF3E2F893DEC3F126, -529, -140 }, + { 0xB5B5ADA8AAFF80B8, -502, -132 }, + { 0x87625F056C7C4A8B, -475, -124 }, + { 0xC9BCFF6034C13053, -449, -116 }, + { 0x964E858C91BA2655, -422, -108 }, + { 0xDFF9772470297EBD, -396, -100 }, + { 0xA6DFBD9FB8E5B88F, -369, -92 }, + { 0xF8A95FCF88747D94, -343, -84 }, + { 0xB94470938FA89BCF, -316, -76 }, + { 0x8A08F0F8BF0F156B, -289, -68 }, + { 0xCDB02555653131B6, -263, -60 }, + { 0x993FE2C6D07B7FAC, -236, -52 }, + { 0xE45C10C42A2B3B06, -210, -44 }, + { 0xAA242499697392D3, -183, -36 }, + { 0xFD87B5F28300CA0E, -157, -28 }, + { 0xBCE5086492111AEB, -130, -20 }, + { 0x8CBCCC096F5088CC, -103, -12 }, + { 0xD1B71758E219652C, -77, -4 }, + { 0x9C40000000000000, -50, 4 }, + { 0xE8D4A51000000000, -24, 12 }, + { 0xAD78EBC5AC620000, 3, 20 }, + { 0x813F3978F8940984, 30, 28 }, + { 0xC097CE7BC90715B3, 56, 36 }, + { 0x8F7E32CE7BEA5C70, 83, 44 }, + { 0xD5D238A4ABE98068, 109, 52 }, + { 0x9F4F2726179A2245, 136, 60 }, + { 0xED63A231D4C4FB27, 162, 68 }, + { 0xB0DE65388CC8ADA8, 189, 76 }, + { 0x83C7088E1AAB65DB, 216, 84 }, + { 0xC45D1DF942711D9A, 242, 92 }, + { 0x924D692CA61BE758, 269, 100 }, + { 0xDA01EE641A708DEA, 295, 108 }, + { 0xA26DA3999AEF774A, 322, 116 }, + { 0xF209787BB47D6B85, 348, 124 }, + { 0xB454E4A179DD1877, 375, 132 }, + { 0x865B86925B9BC5C2, 402, 140 }, + { 0xC83553C5C8965D3D, 428, 148 }, + { 0x952AB45CFA97A0B3, 455, 156 }, + { 0xDE469FBD99A05FE3, 481, 164 }, + { 0xA59BC234DB398C25, 508, 172 }, + { 0xF6C69A72A3989F5C, 534, 180 }, + { 0xB7DCBF5354E9BECE, 561, 188 }, + { 0x88FCF317F22241E2, 588, 196 }, + { 0xCC20CE9BD35C78A5, 614, 204 }, + { 0x98165AF37B2153DF, 641, 212 }, + { 0xE2A0B5DC971F303A, 667, 220 }, + { 0xA8D9D1535CE3B396, 694, 228 }, + { 0xFB9B7CD9A4A7443C, 720, 236 }, + { 0xBB764C4CA7A44410, 747, 244 }, + { 0x8BAB8EEFB6409C1A, 774, 252 }, + { 0xD01FEF10A657842C, 800, 260 }, + { 0x9B10A4E5E9913129, 827, 268 }, + { 0xE7109BFBA19C0C9D, 853, 276 }, + { 0xAC2820D9623BF429, 880, 284 }, + { 0x80444B5E7AA7CF85, 907, 292 }, + { 0xBF21E44003ACDD2D, 933, 300 }, + { 0x8E679C2F5E44FF8F, 960, 308 }, + { 0xD433179D9C8CB841, 986, 316 }, + { 0x9E19DB92B4E31BA9, 1013, 324 }, + } + }; + + // This computation gives exactly the same results for k as + // k = ceil((kAlpha - e - 1) * 0.30102999566398114) + // for |e| <= 1500, but doesn't require floating-point operations. + // NB: log_10(2) ~= 78913 / 2^18 + JSON_ASSERT(e >= -1500); + JSON_ASSERT(e <= 1500); + const int f = kAlpha - e - 1; + const int k = (f * 78913) / (1 << 18) + static_cast(f > 0); + + const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep; + JSON_ASSERT(index >= 0); + JSON_ASSERT(static_cast(index) < kCachedPowers.size()); + + const cached_power cached = kCachedPowers[static_cast(index)]; + JSON_ASSERT(kAlpha <= cached.e + e + 64); + JSON_ASSERT(kGamma >= cached.e + e + 64); + + return cached; +} + +/*! +For n != 0, returns k, such that pow10 := 10^(k-1) <= n < 10^k. +For n == 0, returns 1 and sets pow10 := 1. +*/ +inline int find_largest_pow10(const std::uint32_t n, std::uint32_t& pow10) +{ + // LCOV_EXCL_START + if (n >= 1000000000) + { + pow10 = 1000000000; + return 10; + } + // LCOV_EXCL_STOP + else if (n >= 100000000) + { + pow10 = 100000000; + return 9; + } + else if (n >= 10000000) + { + pow10 = 10000000; + return 8; + } + else if (n >= 1000000) + { + pow10 = 1000000; + return 7; + } + else if (n >= 100000) + { + pow10 = 100000; + return 6; + } + else if (n >= 10000) + { + pow10 = 10000; + return 5; + } + else if (n >= 1000) + { + pow10 = 1000; + return 4; + } + else if (n >= 100) + { + pow10 = 100; + return 3; + } + else if (n >= 10) + { + pow10 = 10; + return 2; + } + else + { + pow10 = 1; + return 1; + } +} + +inline void grisu2_round(char* buf, int len, std::uint64_t dist, std::uint64_t delta, + std::uint64_t rest, std::uint64_t ten_k) +{ + JSON_ASSERT(len >= 1); + JSON_ASSERT(dist <= delta); + JSON_ASSERT(rest <= delta); + JSON_ASSERT(ten_k > 0); + + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // ten_k + // <------> + // <---- rest ----> + // --------------[------------------+----+--------------]-------------- + // w V + // = buf * 10^k + // + // ten_k represents a unit-in-the-last-place in the decimal representation + // stored in buf. + // Decrement buf by ten_k while this takes buf closer to w. + + // The tests are written in this order to avoid overflow in unsigned + // integer arithmetic. + + while (rest < dist + && delta - rest >= ten_k + && (rest + ten_k < dist || dist - rest > rest + ten_k - dist)) + { + JSON_ASSERT(buf[len - 1] != '0'); + buf[len - 1]--; + rest += ten_k; + } +} + +/*! +Generates V = buffer * 10^decimal_exponent, such that M- <= V <= M+. +M- and M+ must be normalized and share the same exponent -60 <= e <= -32. +*/ +inline void grisu2_digit_gen(char* buffer, int& length, int& decimal_exponent, + diyfp M_minus, diyfp w, diyfp M_plus) +{ + static_assert(kAlpha >= -60, "internal error"); + static_assert(kGamma <= -32, "internal error"); + + // Generates the digits (and the exponent) of a decimal floating-point + // number V = buffer * 10^decimal_exponent in the range [M-, M+]. The diyfp's + // w, M- and M+ share the same exponent e, which satisfies alpha <= e <= gamma. + // + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // Grisu2 generates the digits of M+ from left to right and stops as soon as + // V is in [M-,M+]. + + JSON_ASSERT(M_plus.e >= kAlpha); + JSON_ASSERT(M_plus.e <= kGamma); + + std::uint64_t delta = diyfp::sub(M_plus, M_minus).f; // (significand of (M+ - M-), implicit exponent is e) + std::uint64_t dist = diyfp::sub(M_plus, w ).f; // (significand of (M+ - w ), implicit exponent is e) + + // Split M+ = f * 2^e into two parts p1 and p2 (note: e < 0): + // + // M+ = f * 2^e + // = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e + // = ((p1 ) * 2^-e + (p2 )) * 2^e + // = p1 + p2 * 2^e + + const diyfp one(std::uint64_t{1} << -M_plus.e, M_plus.e); + + auto p1 = static_cast(M_plus.f >> -one.e); // p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.) + std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-e + + // 1) + // + // Generate the digits of the integral part p1 = d[n-1]...d[1]d[0] + + JSON_ASSERT(p1 > 0); + + std::uint32_t pow10; + const int k = find_largest_pow10(p1, pow10); + + // 10^(k-1) <= p1 < 10^k, pow10 = 10^(k-1) + // + // p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1)) + // = (d[k-1] ) * 10^(k-1) + (p1 mod 10^(k-1)) + // + // M+ = p1 + p2 * 2^e + // = d[k-1] * 10^(k-1) + (p1 mod 10^(k-1)) + p2 * 2^e + // = d[k-1] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e + // = d[k-1] * 10^(k-1) + ( rest) * 2^e + // + // Now generate the digits d[n] of p1 from left to right (n = k-1,...,0) + // + // p1 = d[k-1]...d[n] * 10^n + d[n-1]...d[0] + // + // but stop as soon as + // + // rest * 2^e = (d[n-1]...d[0] * 2^-e + p2) * 2^e <= delta * 2^e + + int n = k; + while (n > 0) + { + // Invariants: + // M+ = buffer * 10^n + (p1 + p2 * 2^e) (buffer = 0 for n = k) + // pow10 = 10^(n-1) <= p1 < 10^n + // + const std::uint32_t d = p1 / pow10; // d = p1 div 10^(n-1) + const std::uint32_t r = p1 % pow10; // r = p1 mod 10^(n-1) + // + // M+ = buffer * 10^n + (d * 10^(n-1) + r) + p2 * 2^e + // = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e) + // + JSON_ASSERT(d <= 9); + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(n-1) + (r + p2 * 2^e) + // + p1 = r; + n--; + // + // M+ = buffer * 10^n + (p1 + p2 * 2^e) + // pow10 = 10^n + // + + // Now check if enough digits have been generated. + // Compute + // + // p1 + p2 * 2^e = (p1 * 2^-e + p2) * 2^e = rest * 2^e + // + // Note: + // Since rest and delta share the same exponent e, it suffices to + // compare the significands. + const std::uint64_t rest = (std::uint64_t{p1} << -one.e) + p2; + if (rest <= delta) + { + // V = buffer * 10^n, with M- <= V <= M+. + + decimal_exponent += n; + + // We may now just stop. But instead look if the buffer could be + // decremented to bring V closer to w. + // + // pow10 = 10^n is now 1 ulp in the decimal representation V. + // The rounding procedure works with diyfp's with an implicit + // exponent of e. + // + // 10^n = (10^n * 2^-e) * 2^e = ulp * 2^e + // + const std::uint64_t ten_n = std::uint64_t{pow10} << -one.e; + grisu2_round(buffer, length, dist, delta, rest, ten_n); + + return; + } + + pow10 /= 10; + // + // pow10 = 10^(n-1) <= p1 < 10^n + // Invariants restored. + } + + // 2) + // + // The digits of the integral part have been generated: + // + // M+ = d[k-1]...d[1]d[0] + p2 * 2^e + // = buffer + p2 * 2^e + // + // Now generate the digits of the fractional part p2 * 2^e. + // + // Note: + // No decimal point is generated: the exponent is adjusted instead. + // + // p2 actually represents the fraction + // + // p2 * 2^e + // = p2 / 2^-e + // = d[-1] / 10^1 + d[-2] / 10^2 + ... + // + // Now generate the digits d[-m] of p1 from left to right (m = 1,2,...) + // + // p2 * 2^e = d[-1]d[-2]...d[-m] * 10^-m + // + 10^-m * (d[-m-1] / 10^1 + d[-m-2] / 10^2 + ...) + // + // using + // + // 10^m * p2 = ((10^m * p2) div 2^-e) * 2^-e + ((10^m * p2) mod 2^-e) + // = ( d) * 2^-e + ( r) + // + // or + // 10^m * p2 * 2^e = d + r * 2^e + // + // i.e. + // + // M+ = buffer + p2 * 2^e + // = buffer + 10^-m * (d + r * 2^e) + // = (buffer * 10^m + d) * 10^-m + 10^-m * r * 2^e + // + // and stop as soon as 10^-m * r * 2^e <= delta * 2^e + + JSON_ASSERT(p2 > delta); + + int m = 0; + for (;;) + { + // Invariant: + // M+ = buffer * 10^-m + 10^-m * (d[-m-1] / 10 + d[-m-2] / 10^2 + ...) * 2^e + // = buffer * 10^-m + 10^-m * (p2 ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (10 * p2) ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * ((10*p2 div 2^-e) * 2^-e + (10*p2 mod 2^-e)) * 2^e + // + JSON_ASSERT(p2 <= (std::numeric_limits::max)() / 10); + p2 *= 10; + const std::uint64_t d = p2 >> -one.e; // d = (10 * p2) div 2^-e + const std::uint64_t r = p2 & (one.f - 1); // r = (10 * p2) mod 2^-e + // + // M+ = buffer * 10^-m + 10^-m * (1/10 * (d * 2^-e + r) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (d + r * 2^e)) + // = (buffer * 10 + d) * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + JSON_ASSERT(d <= 9); + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + p2 = r; + m++; + // + // M+ = buffer * 10^-m + 10^-m * p2 * 2^e + // Invariant restored. + + // Check if enough digits have been generated. + // + // 10^-m * p2 * 2^e <= delta * 2^e + // p2 * 2^e <= 10^m * delta * 2^e + // p2 <= 10^m * delta + delta *= 10; + dist *= 10; + if (p2 <= delta) + { + break; + } + } + + // V = buffer * 10^-m, with M- <= V <= M+. + + decimal_exponent -= m; + + // 1 ulp in the decimal representation is now 10^-m. + // Since delta and dist are now scaled by 10^m, we need to do the + // same with ulp in order to keep the units in sync. + // + // 10^m * 10^-m = 1 = 2^-e * 2^e = ten_m * 2^e + // + const std::uint64_t ten_m = one.f; + grisu2_round(buffer, length, dist, delta, p2, ten_m); + + // By construction this algorithm generates the shortest possible decimal + // number (Loitsch, Theorem 6.2) which rounds back to w. + // For an input number of precision p, at least + // + // N = 1 + ceil(p * log_10(2)) + // + // decimal digits are sufficient to identify all binary floating-point + // numbers (Matula, "In-and-Out conversions"). + // This implies that the algorithm does not produce more than N decimal + // digits. + // + // N = 17 for p = 53 (IEEE double precision) + // N = 9 for p = 24 (IEEE single precision) +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +JSON_HEDLEY_NON_NULL(1) +inline void grisu2(char* buf, int& len, int& decimal_exponent, + diyfp m_minus, diyfp v, diyfp m_plus) +{ + JSON_ASSERT(m_plus.e == m_minus.e); + JSON_ASSERT(m_plus.e == v.e); + + // --------(-----------------------+-----------------------)-------- (A) + // m- v m+ + // + // --------------------(-----------+-----------------------)-------- (B) + // m- v m+ + // + // First scale v (and m- and m+) such that the exponent is in the range + // [alpha, gamma]. + + const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e); + + const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k + + // The exponent of the products is = v.e + c_minus_k.e + q and is in the range [alpha,gamma] + const diyfp w = diyfp::mul(v, c_minus_k); + const diyfp w_minus = diyfp::mul(m_minus, c_minus_k); + const diyfp w_plus = diyfp::mul(m_plus, c_minus_k); + + // ----(---+---)---------------(---+---)---------------(---+---)---- + // w- w w+ + // = c*m- = c*v = c*m+ + // + // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and + // w+ are now off by a small amount. + // In fact: + // + // w - v * 10^k < 1 ulp + // + // To account for this inaccuracy, add resp. subtract 1 ulp. + // + // --------+---[---------------(---+---)---------------]---+-------- + // w- M- w M+ w+ + // + // Now any number in [M-, M+] (bounds included) will round to w when input, + // regardless of how the input rounding algorithm breaks ties. + // + // And digit_gen generates the shortest possible such number in [M-, M+]. + // Note that this does not mean that Grisu2 always generates the shortest + // possible number in the interval (m-, m+). + const diyfp M_minus(w_minus.f + 1, w_minus.e); + const diyfp M_plus (w_plus.f - 1, w_plus.e ); + + decimal_exponent = -cached.k; // = -(-k) = k + + grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus); +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +template +JSON_HEDLEY_NON_NULL(1) +void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) +{ + static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, + "internal error: not enough precision"); + + JSON_ASSERT(std::isfinite(value)); + JSON_ASSERT(value > 0); + + // If the neighbors (and boundaries) of 'value' are always computed for double-precision + // numbers, all float's can be recovered using strtod (and strtof). However, the resulting + // decimal representations are not exactly "short". + // + // The documentation for 'std::to_chars' (https://en.cppreference.com/w/cpp/utility/to_chars) + // says "value is converted to a string as if by std::sprintf in the default ("C") locale" + // and since sprintf promotes float's to double's, I think this is exactly what 'std::to_chars' + // does. + // On the other hand, the documentation for 'std::to_chars' requires that "parsing the + // representation using the corresponding std::from_chars function recovers value exactly". That + // indicates that single precision floating-point numbers should be recovered using + // 'std::strtof'. + // + // NB: If the neighbors are computed for single-precision numbers, there is a single float + // (7.0385307e-26f) which can't be recovered using strtod. The resulting double precision + // value is off by 1 ulp. +#if 0 + const boundaries w = compute_boundaries(static_cast(value)); +#else + const boundaries w = compute_boundaries(value); +#endif + + grisu2(buf, len, decimal_exponent, w.minus, w.w, w.plus); +} + +/*! +@brief appends a decimal representation of e to buf +@return a pointer to the element following the exponent. +@pre -1000 < e < 1000 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* append_exponent(char* buf, int e) +{ + JSON_ASSERT(e > -1000); + JSON_ASSERT(e < 1000); + + if (e < 0) + { + e = -e; + *buf++ = '-'; + } + else + { + *buf++ = '+'; + } + + auto k = static_cast(e); + if (k < 10) + { + // Always print at least two digits in the exponent. + // This is for compatibility with printf("%g"). + *buf++ = '0'; + *buf++ = static_cast('0' + k); + } + else if (k < 100) + { + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } + else + { + *buf++ = static_cast('0' + k / 100); + k %= 100; + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } + + return buf; +} + +/*! +@brief prettify v = buf * 10^decimal_exponent + +If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point +notation. Otherwise it will be printed in exponential notation. + +@pre min_exp < 0 +@pre max_exp > 0 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* format_buffer(char* buf, int len, int decimal_exponent, + int min_exp, int max_exp) +{ + JSON_ASSERT(min_exp < 0); + JSON_ASSERT(max_exp > 0); + + const int k = len; + const int n = len + decimal_exponent; + + // v = buf * 10^(n-k) + // k is the length of the buffer (number of decimal digits) + // n is the position of the decimal point relative to the start of the buffer. + + if (k <= n && n <= max_exp) + { + // digits[000] + // len <= max_exp + 2 + + std::memset(buf + k, '0', static_cast(n) - static_cast(k)); + // Make it look like a floating-point number (#362, #378) + buf[n + 0] = '.'; + buf[n + 1] = '0'; + return buf + (static_cast(n) + 2); + } + + if (0 < n && n <= max_exp) + { + // dig.its + // len <= max_digits10 + 1 + + JSON_ASSERT(k > n); + + std::memmove(buf + (static_cast(n) + 1), buf + n, static_cast(k) - static_cast(n)); + buf[n] = '.'; + return buf + (static_cast(k) + 1U); + } + + if (min_exp < n && n <= 0) + { + // 0.[000]digits + // len <= 2 + (-min_exp - 1) + max_digits10 + + std::memmove(buf + (2 + static_cast(-n)), buf, static_cast(k)); + buf[0] = '0'; + buf[1] = '.'; + std::memset(buf + 2, '0', static_cast(-n)); + return buf + (2U + static_cast(-n) + static_cast(k)); + } + + if (k == 1) + { + // dE+123 + // len <= 1 + 5 + + buf += 1; + } + else + { + // d.igitsE+123 + // len <= max_digits10 + 1 + 5 + + std::memmove(buf + 2, buf + 1, static_cast(k) - 1); + buf[1] = '.'; + buf += 1 + static_cast(k); + } + + *buf++ = 'e'; + return append_exponent(buf, n - 1); +} + +} // namespace dtoa_impl + +/*! +@brief generates a decimal representation of the floating-point number value in [first, last). + +The format of the resulting decimal representation is similar to printf's %g +format. Returns an iterator pointing past-the-end of the decimal representation. + +@note The input number must be finite, i.e. NaN's and Inf's are not supported. +@note The buffer must be large enough. +@note The result is NOT null-terminated. +*/ +template +JSON_HEDLEY_NON_NULL(1, 2) +JSON_HEDLEY_RETURNS_NON_NULL +char* to_chars(char* first, const char* last, FloatType value) +{ + static_cast(last); // maybe unused - fix warning + JSON_ASSERT(std::isfinite(value)); + + // Use signbit(value) instead of (value < 0) since signbit works for -0. + if (std::signbit(value)) + { + value = -value; + *first++ = '-'; + } + + if (value == 0) // +-0 + { + *first++ = '0'; + // Make it look like a floating-point number (#362, #378) + *first++ = '.'; + *first++ = '0'; + return first; + } + + JSON_ASSERT(last - first >= std::numeric_limits::max_digits10); + + // Compute v = buffer * 10^decimal_exponent. + // The decimal digits are stored in the buffer, which needs to be interpreted + // as an unsigned decimal integer. + // len is the length of the buffer, i.e. the number of decimal digits. + int len = 0; + int decimal_exponent = 0; + dtoa_impl::grisu2(first, len, decimal_exponent, value); + + JSON_ASSERT(len <= std::numeric_limits::max_digits10); + + // Format the buffer like printf("%.*g", prec, value) + constexpr int kMinExp = -4; + // Use digits10 here to increase compatibility with version 2. + constexpr int kMaxExp = std::numeric_limits::digits10; + + JSON_ASSERT(last - first >= kMaxExp + 2); + JSON_ASSERT(last - first >= 2 + (-kMinExp - 1) + std::numeric_limits::max_digits10); + JSON_ASSERT(last - first >= std::numeric_limits::max_digits10 + 6); + + return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, kMaxExp); +} + +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// serialization // +/////////////////// + +/// how to treat decoding errors +enum class error_handler_t +{ + strict, ///< throw a type_error exception in case of invalid UTF-8 + replace, ///< replace invalid UTF-8 sequences with U+FFFD + ignore ///< ignore invalid UTF-8 sequences +}; + +template +class serializer +{ + using string_t = typename BasicJsonType::string_t; + using number_float_t = typename BasicJsonType::number_float_t; + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using binary_char_t = typename BasicJsonType::binary_t::value_type; + static constexpr std::uint8_t UTF8_ACCEPT = 0; + static constexpr std::uint8_t UTF8_REJECT = 1; + + public: + /*! + @param[in] s output stream to serialize to + @param[in] ichar indentation character to use + @param[in] error_handler_ how to react on decoding errors + */ + serializer(output_adapter_t s, const char ichar, + error_handler_t error_handler_ = error_handler_t::strict) + : o(std::move(s)) + , loc(std::localeconv()) + , thousands_sep(loc->thousands_sep == nullptr ? '\0' : std::char_traits::to_char_type(* (loc->thousands_sep))) + , decimal_point(loc->decimal_point == nullptr ? '\0' : std::char_traits::to_char_type(* (loc->decimal_point))) + , indent_char(ichar) + , indent_string(512, indent_char) + , error_handler(error_handler_) + {} + + // delete because of pointer members + serializer(const serializer&) = delete; + serializer& operator=(const serializer&) = delete; + serializer(serializer&&) = delete; + serializer& operator=(serializer&&) = delete; + ~serializer() = default; + + /*! + @brief internal implementation of the serialization function + + This function is called by the public member function dump and organizes + the serialization internally. The indentation level is propagated as + additional parameter. In case of arrays and objects, the function is + called recursively. + + - strings and object keys are escaped using `escape_string()` + - integer numbers are converted implicitly via `operator<<` + - floating-point numbers are converted to a string using `"%g"` format + - binary values are serialized as objects containing the subtype and the + byte array + + @param[in] val value to serialize + @param[in] pretty_print whether the output shall be pretty-printed + @param[in] ensure_ascii If @a ensure_ascii is true, all non-ASCII characters + in the output are escaped with `\uXXXX` sequences, and the result consists + of ASCII characters only. + @param[in] indent_step the indent level + @param[in] current_indent the current indent level (only used internally) + */ + void dump(const BasicJsonType& val, + const bool pretty_print, + const bool ensure_ascii, + const unsigned int indent_step, + const unsigned int current_indent = 0) + { + switch (val.m_type) + { + case value_t::object: + { + if (val.m_value.object->empty()) + { + o->write_characters("{}", 2); + return; + } + + if (pretty_print) + { + o->write_characters("{\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent); + o->write_characters(",\n", 2); + } + + // last element + JSON_ASSERT(i != val.m_value.object->cend()); + JSON_ASSERT(std::next(i) == val.m_value.object->cend()); + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character('}'); + } + else + { + o->write_character('{'); + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent); + o->write_character(','); + } + + // last element + JSON_ASSERT(i != val.m_value.object->cend()); + JSON_ASSERT(std::next(i) == val.m_value.object->cend()); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent); + + o->write_character('}'); + } + + return; + } + + case value_t::array: + { + if (val.m_value.array->empty()) + { + o->write_characters("[]", 2); + return; + } + + if (pretty_print) + { + o->write_characters("[\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + dump(*i, true, ensure_ascii, indent_step, new_indent); + o->write_characters(",\n", 2); + } + + // last element + JSON_ASSERT(!val.m_value.array->empty()); + o->write_characters(indent_string.c_str(), new_indent); + dump(val.m_value.array->back(), true, ensure_ascii, indent_step, new_indent); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character(']'); + } + else + { + o->write_character('['); + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + dump(*i, false, ensure_ascii, indent_step, current_indent); + o->write_character(','); + } + + // last element + JSON_ASSERT(!val.m_value.array->empty()); + dump(val.m_value.array->back(), false, ensure_ascii, indent_step, current_indent); + + o->write_character(']'); + } + + return; + } + + case value_t::string: + { + o->write_character('\"'); + dump_escaped(*val.m_value.string, ensure_ascii); + o->write_character('\"'); + return; + } + + case value_t::binary: + { + if (pretty_print) + { + o->write_characters("{\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + o->write_characters(indent_string.c_str(), new_indent); + + o->write_characters("\"bytes\": [", 10); + + if (!val.m_value.binary->empty()) + { + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_characters(", ", 2); + } + dump_integer(val.m_value.binary->back()); + } + + o->write_characters("],\n", 3); + o->write_characters(indent_string.c_str(), new_indent); + + o->write_characters("\"subtype\": ", 11); + if (val.m_value.binary->has_subtype()) + { + dump_integer(val.m_value.binary->subtype()); + } + else + { + o->write_characters("null", 4); + } + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character('}'); + } + else + { + o->write_characters("{\"bytes\":[", 10); + + if (!val.m_value.binary->empty()) + { + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_character(','); + } + dump_integer(val.m_value.binary->back()); + } + + o->write_characters("],\"subtype\":", 12); + if (val.m_value.binary->has_subtype()) + { + dump_integer(val.m_value.binary->subtype()); + o->write_character('}'); + } + else + { + o->write_characters("null}", 5); + } + } + return; + } + + case value_t::boolean: + { + if (val.m_value.boolean) + { + o->write_characters("true", 4); + } + else + { + o->write_characters("false", 5); + } + return; + } + + case value_t::number_integer: + { + dump_integer(val.m_value.number_integer); + return; + } + + case value_t::number_unsigned: + { + dump_integer(val.m_value.number_unsigned); + return; + } + + case value_t::number_float: + { + dump_float(val.m_value.number_float); + return; + } + + case value_t::discarded: + { + o->write_characters("", 11); + return; + } + + case value_t::null: + { + o->write_characters("null", 4); + return; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + + private: + /*! + @brief dump escaped string + + Escape a string by replacing certain special characters by a sequence of an + escape character (backslash) and another character and other control + characters by a sequence of "\u" followed by a four-digit hex + representation. The escaped string is written to output stream @a o. + + @param[in] s the string to escape + @param[in] ensure_ascii whether to escape non-ASCII characters with + \uXXXX sequences + + @complexity Linear in the length of string @a s. + */ + void dump_escaped(const string_t& s, const bool ensure_ascii) + { + std::uint32_t codepoint; + std::uint8_t state = UTF8_ACCEPT; + std::size_t bytes = 0; // number of bytes written to string_buffer + + // number of bytes written at the point of the last valid byte + std::size_t bytes_after_last_accept = 0; + std::size_t undumped_chars = 0; + + for (std::size_t i = 0; i < s.size(); ++i) + { + const auto byte = static_cast(s[i]); + + switch (decode(state, codepoint, byte)) + { + case UTF8_ACCEPT: // decode found a new code point + { + switch (codepoint) + { + case 0x08: // backspace + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'b'; + break; + } + + case 0x09: // horizontal tab + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 't'; + break; + } + + case 0x0A: // newline + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'n'; + break; + } + + case 0x0C: // formfeed + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'f'; + break; + } + + case 0x0D: // carriage return + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'r'; + break; + } + + case 0x22: // quotation mark + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\"'; + break; + } + + case 0x5C: // reverse solidus + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\\'; + break; + } + + default: + { + // escape control characters (0x00..0x1F) or, if + // ensure_ascii parameter is used, non-ASCII characters + if ((codepoint <= 0x1F) || (ensure_ascii && (codepoint >= 0x7F))) + { + if (codepoint <= 0xFFFF) + { + (std::snprintf)(string_buffer.data() + bytes, 7, "\\u%04x", + static_cast(codepoint)); + bytes += 6; + } + else + { + (std::snprintf)(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x", + static_cast(0xD7C0u + (codepoint >> 10u)), + static_cast(0xDC00u + (codepoint & 0x3FFu))); + bytes += 12; + } + } + else + { + // copy byte to buffer (all previous bytes + // been copied have in default case above) + string_buffer[bytes++] = s[i]; + } + break; + } + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + // remember the byte position of this accept + bytes_after_last_accept = bytes; + undumped_chars = 0; + break; + } + + case UTF8_REJECT: // decode found invalid UTF-8 byte + { + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", byte); + JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + sn)); + } + + case error_handler_t::ignore: + case error_handler_t::replace: + { + // in case we saw this character the first time, we + // would like to read it again, because the byte + // may be OK for itself, but just not OK for the + // previous sequence + if (undumped_chars > 0) + { + --i; + } + + // reset length buffer to the last accepted index; + // thus removing/ignoring the invalid characters + bytes = bytes_after_last_accept; + + if (error_handler == error_handler_t::replace) + { + // add a replacement character + if (ensure_ascii) + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'u'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'd'; + } + else + { + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xEF'); + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xBF'); + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xBD'); + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + bytes_after_last_accept = bytes; + } + + undumped_chars = 0; + + // continue processing the string + state = UTF8_ACCEPT; + break; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + break; + } + + default: // decode found yet incomplete multi-byte code point + { + if (!ensure_ascii) + { + // code point will not be escaped - copy byte to buffer + string_buffer[bytes++] = s[i]; + } + ++undumped_chars; + break; + } + } + } + + // we finished processing the string + if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) + { + // write buffer + if (bytes > 0) + { + o->write_characters(string_buffer.data(), bytes); + } + } + else + { + // we finish reading, but do not accept: string was incomplete + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", static_cast(s.back())); + JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn)); + } + + case error_handler_t::ignore: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + break; + } + + case error_handler_t::replace: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + // add a replacement character + if (ensure_ascii) + { + o->write_characters("\\ufffd", 6); + } + else + { + o->write_characters("\xEF\xBF\xBD", 3); + } + break; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + } + + /*! + @brief count digits + + Count the number of decimal (base 10) digits for an input unsigned integer. + + @param[in] x unsigned integer number to count its digits + @return number of decimal digits + */ + inline unsigned int count_digits(number_unsigned_t x) noexcept + { + unsigned int n_digits = 1; + for (;;) + { + if (x < 10) + { + return n_digits; + } + if (x < 100) + { + return n_digits + 1; + } + if (x < 1000) + { + return n_digits + 2; + } + if (x < 10000) + { + return n_digits + 3; + } + x = x / 10000u; + n_digits += 4; + } + } + + /*! + @brief dump an integer + + Dump a given integer to output stream @a o. Works internally with + @a number_buffer. + + @param[in] x integer number (signed or unsigned) to dump + @tparam NumberType either @a number_integer_t or @a number_unsigned_t + */ + template < typename NumberType, detail::enable_if_t < + std::is_same::value || + std::is_same::value || + std::is_same::value, + int > = 0 > + void dump_integer(NumberType x) + { + static constexpr std::array, 100> digits_to_99 + { + { + {{'0', '0'}}, {{'0', '1'}}, {{'0', '2'}}, {{'0', '3'}}, {{'0', '4'}}, {{'0', '5'}}, {{'0', '6'}}, {{'0', '7'}}, {{'0', '8'}}, {{'0', '9'}}, + {{'1', '0'}}, {{'1', '1'}}, {{'1', '2'}}, {{'1', '3'}}, {{'1', '4'}}, {{'1', '5'}}, {{'1', '6'}}, {{'1', '7'}}, {{'1', '8'}}, {{'1', '9'}}, + {{'2', '0'}}, {{'2', '1'}}, {{'2', '2'}}, {{'2', '3'}}, {{'2', '4'}}, {{'2', '5'}}, {{'2', '6'}}, {{'2', '7'}}, {{'2', '8'}}, {{'2', '9'}}, + {{'3', '0'}}, {{'3', '1'}}, {{'3', '2'}}, {{'3', '3'}}, {{'3', '4'}}, {{'3', '5'}}, {{'3', '6'}}, {{'3', '7'}}, {{'3', '8'}}, {{'3', '9'}}, + {{'4', '0'}}, {{'4', '1'}}, {{'4', '2'}}, {{'4', '3'}}, {{'4', '4'}}, {{'4', '5'}}, {{'4', '6'}}, {{'4', '7'}}, {{'4', '8'}}, {{'4', '9'}}, + {{'5', '0'}}, {{'5', '1'}}, {{'5', '2'}}, {{'5', '3'}}, {{'5', '4'}}, {{'5', '5'}}, {{'5', '6'}}, {{'5', '7'}}, {{'5', '8'}}, {{'5', '9'}}, + {{'6', '0'}}, {{'6', '1'}}, {{'6', '2'}}, {{'6', '3'}}, {{'6', '4'}}, {{'6', '5'}}, {{'6', '6'}}, {{'6', '7'}}, {{'6', '8'}}, {{'6', '9'}}, + {{'7', '0'}}, {{'7', '1'}}, {{'7', '2'}}, {{'7', '3'}}, {{'7', '4'}}, {{'7', '5'}}, {{'7', '6'}}, {{'7', '7'}}, {{'7', '8'}}, {{'7', '9'}}, + {{'8', '0'}}, {{'8', '1'}}, {{'8', '2'}}, {{'8', '3'}}, {{'8', '4'}}, {{'8', '5'}}, {{'8', '6'}}, {{'8', '7'}}, {{'8', '8'}}, {{'8', '9'}}, + {{'9', '0'}}, {{'9', '1'}}, {{'9', '2'}}, {{'9', '3'}}, {{'9', '4'}}, {{'9', '5'}}, {{'9', '6'}}, {{'9', '7'}}, {{'9', '8'}}, {{'9', '9'}}, + } + }; + + // special case for "0" + if (x == 0) + { + o->write_character('0'); + return; + } + + // use a pointer to fill the buffer + auto buffer_ptr = number_buffer.begin(); + + const bool is_negative = std::is_same::value && !(x >= 0); // see issue #755 + number_unsigned_t abs_value; + + unsigned int n_chars; + + if (is_negative) + { + *buffer_ptr = '-'; + abs_value = remove_sign(static_cast(x)); + + // account one more byte for the minus sign + n_chars = 1 + count_digits(abs_value); + } + else + { + abs_value = static_cast(x); + n_chars = count_digits(abs_value); + } + + // spare 1 byte for '\0' + JSON_ASSERT(n_chars < number_buffer.size() - 1); + + // jump to the end to generate the string from backward + // so we later avoid reversing the result + buffer_ptr += n_chars; + + // Fast int2ascii implementation inspired by "Fastware" talk by Andrei Alexandrescu + // See: https://www.youtube.com/watch?v=o4-CwDo2zpg + while (abs_value >= 100) + { + const auto digits_index = static_cast((abs_value % 100)); + abs_value /= 100; + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + + if (abs_value >= 10) + { + const auto digits_index = static_cast(abs_value); + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + else + { + *(--buffer_ptr) = static_cast('0' + abs_value); + } + + o->write_characters(number_buffer.data(), n_chars); + } + + /*! + @brief dump a floating-point number + + Dump a given floating-point number to output stream @a o. Works internally + with @a number_buffer. + + @param[in] x floating-point number to dump + */ + void dump_float(number_float_t x) + { + // NaN / inf + if (!std::isfinite(x)) + { + o->write_characters("null", 4); + return; + } + + // If number_float_t is an IEEE-754 single or double precision number, + // use the Grisu2 algorithm to produce short numbers which are + // guaranteed to round-trip, using strtof and strtod, resp. + // + // NB: The test below works if == . + static constexpr bool is_ieee_single_or_double + = (std::numeric_limits::is_iec559 && std::numeric_limits::digits == 24 && std::numeric_limits::max_exponent == 128) || + (std::numeric_limits::is_iec559 && std::numeric_limits::digits == 53 && std::numeric_limits::max_exponent == 1024); + + dump_float(x, std::integral_constant()); + } + + void dump_float(number_float_t x, std::true_type /*is_ieee_single_or_double*/) + { + char* begin = number_buffer.data(); + char* end = ::nlohmann::detail::to_chars(begin, begin + number_buffer.size(), x); + + o->write_characters(begin, static_cast(end - begin)); + } + + void dump_float(number_float_t x, std::false_type /*is_ieee_single_or_double*/) + { + // get number of digits for a float -> text -> float round-trip + static constexpr auto d = std::numeric_limits::max_digits10; + + // the actual conversion + std::ptrdiff_t len = (std::snprintf)(number_buffer.data(), number_buffer.size(), "%.*g", d, x); + + // negative value indicates an error + JSON_ASSERT(len > 0); + // check if buffer was large enough + JSON_ASSERT(static_cast(len) < number_buffer.size()); + + // erase thousands separator + if (thousands_sep != '\0') + { + const auto end = std::remove(number_buffer.begin(), + number_buffer.begin() + len, thousands_sep); + std::fill(end, number_buffer.end(), '\0'); + JSON_ASSERT((end - number_buffer.begin()) <= len); + len = (end - number_buffer.begin()); + } + + // convert decimal point to '.' + if (decimal_point != '\0' && decimal_point != '.') + { + const auto dec_pos = std::find(number_buffer.begin(), number_buffer.end(), decimal_point); + if (dec_pos != number_buffer.end()) + { + *dec_pos = '.'; + } + } + + o->write_characters(number_buffer.data(), static_cast(len)); + + // determine if need to append ".0" + const bool value_is_int_like = + std::none_of(number_buffer.begin(), number_buffer.begin() + len + 1, + [](char c) + { + return c == '.' || c == 'e'; + }); + + if (value_is_int_like) + { + o->write_characters(".0", 2); + } + } + + /*! + @brief check whether a string is UTF-8 encoded + + The function checks each byte of a string whether it is UTF-8 encoded. The + result of the check is stored in the @a state parameter. The function must + be called initially with state 0 (accept). State 1 means the string must + be rejected, because the current byte is not allowed. If the string is + completely processed, but the state is non-zero, the string ended + prematurely; that is, the last byte indicated more bytes should have + followed. + + @param[in,out] state the state of the decoding + @param[in,out] codep codepoint (valid only if resulting state is UTF8_ACCEPT) + @param[in] byte next byte to decode + @return new state + + @note The function has been edited: a std::array is used. + + @copyright Copyright (c) 2008-2009 Bjoern Hoehrmann + @sa http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + */ + static std::uint8_t decode(std::uint8_t& state, std::uint32_t& codep, const std::uint8_t byte) noexcept + { + static const std::array utf8d = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF + 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF + 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF + 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF + 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2 + 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4 + 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6 + 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8 + } + }; + + const std::uint8_t type = utf8d[byte]; + + codep = (state != UTF8_ACCEPT) + ? (byte & 0x3fu) | (codep << 6u) + : (0xFFu >> type) & (byte); + + std::size_t index = 256u + static_cast(state) * 16u + static_cast(type); + JSON_ASSERT(index < 400); + state = utf8d[index]; + return state; + } + + /* + * Overload to make the compiler happy while it is instantiating + * dump_integer for number_unsigned_t. + * Must never be called. + */ + number_unsigned_t remove_sign(number_unsigned_t x) + { + JSON_ASSERT(false); // LCOV_EXCL_LINE + return x; // LCOV_EXCL_LINE + } + + /* + * Helper function for dump_integer + * + * This function takes a negative signed integer and returns its absolute + * value as unsigned integer. The plus/minus shuffling is necessary as we can + * not directly remove the sign of an arbitrary signed integer as the + * absolute values of INT_MIN and INT_MAX are usually not the same. See + * #1708 for details. + */ + inline number_unsigned_t remove_sign(number_integer_t x) noexcept + { + JSON_ASSERT(x < 0 && x < (std::numeric_limits::max)()); + return static_cast(-(x + 1)) + 1; + } + + private: + /// the output of the serializer + output_adapter_t o = nullptr; + + /// a (hopefully) large enough character buffer + std::array number_buffer{{}}; + + /// the locale + const std::lconv* loc = nullptr; + /// the locale's thousand separator character + const char thousands_sep = '\0'; + /// the locale's decimal point character + const char decimal_point = '\0'; + + /// string buffer + std::array string_buffer{{}}; + + /// the indentation character + const char indent_char; + /// the indentation string + string_t indent_string; + + /// error_handler how to react on decoding errors + const error_handler_t error_handler; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include // less +#include // allocator +#include // pair +#include // vector + +namespace nlohmann +{ + +/// ordered_map: a minimal map-like container that preserves insertion order +/// for use within nlohmann::basic_json +template , + class Allocator = std::allocator>> + struct ordered_map : std::vector, Allocator> +{ + using key_type = Key; + using mapped_type = T; + using Container = std::vector, Allocator>; + using typename Container::iterator; + using typename Container::const_iterator; + using typename Container::size_type; + using typename Container::value_type; + + // Explicit constructors instead of `using Container::Container` + // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) + ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {} + template + ordered_map(It first, It last, const Allocator& alloc = Allocator()) + : Container{first, last, alloc} {} + ordered_map(std::initializer_list init, const Allocator& alloc = Allocator() ) + : Container{init, alloc} {} + + std::pair emplace(const key_type& key, T&& t) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return {it, false}; + } + } + Container::emplace_back(key, t); + return {--this->end(), true}; + } + + T& operator[](const Key& key) + { + return emplace(key, T{}).first->second; + } + + const T& operator[](const Key& key) const + { + return at(key); + } + + T& at(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it->second; + } + } + + throw std::out_of_range("key not found"); + } + + const T& at(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it->second; + } + } + + throw std::out_of_range("key not found"); + } + + size_type erase(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + // Since we cannot move const Keys, re-construct them in place + for (auto next = it; ++next != this->end(); ++it) + { + it->~value_type(); // Destroy but keep allocation + new (&*it) value_type{std::move(*next)}; + } + Container::pop_back(); + return 1; + } + } + return 0; + } + + iterator erase(iterator pos) + { + auto it = pos; + + // Since we cannot move const Keys, re-construct them in place + for (auto next = it; ++next != this->end(); ++it) + { + it->~value_type(); // Destroy but keep allocation + new (&*it) value_type{std::move(*next)}; + } + Container::pop_back(); + return pos; + } + + size_type count(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return 1; + } + } + return 0; + } + + iterator find(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it; + } + } + return Container::end(); + } + + const_iterator find(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it; + } + } + return Container::end(); + } + + std::pair insert( value_type&& value ) + { + return emplace(value.first, std::move(value.second)); + } + + std::pair insert( const value_type& value ) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == value.first) + { + return {it, false}; + } + } + Container::push_back(value); + return {--this->end(), true}; + } +}; + +} // namespace nlohmann + + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ + +/*! +@brief a class to store JSON values + +@tparam ObjectType type for JSON objects (`std::map` by default; will be used +in @ref object_t) +@tparam ArrayType type for JSON arrays (`std::vector` by default; will be used +in @ref array_t) +@tparam StringType type for JSON strings and object keys (`std::string` by +default; will be used in @ref string_t) +@tparam BooleanType type for JSON booleans (`bool` by default; will be used +in @ref boolean_t) +@tparam NumberIntegerType type for JSON integer numbers (`int64_t` by +default; will be used in @ref number_integer_t) +@tparam NumberUnsignedType type for JSON unsigned integer numbers (@c +`uint64_t` by default; will be used in @ref number_unsigned_t) +@tparam NumberFloatType type for JSON floating-point numbers (`double` by +default; will be used in @ref number_float_t) +@tparam BinaryType type for packed binary data for compatibility with binary +serialization formats (`std::vector` by default; will be used in +@ref binary_t) +@tparam AllocatorType type of the allocator to use (`std::allocator` by +default) +@tparam JSONSerializer the serializer to resolve internal calls to `to_json()` +and `from_json()` (@ref adl_serializer by default) + +@requirement The class satisfies the following concept requirements: +- Basic + - [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible): + JSON values can be default constructed. The result will be a JSON null + value. + - [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible): + A JSON value can be constructed from an rvalue argument. + - [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible): + A JSON value can be copy-constructed from an lvalue expression. + - [MoveAssignable](https://en.cppreference.com/w/cpp/named_req/MoveAssignable): + A JSON value van be assigned from an rvalue argument. + - [CopyAssignable](https://en.cppreference.com/w/cpp/named_req/CopyAssignable): + A JSON value can be copy-assigned from an lvalue expression. + - [Destructible](https://en.cppreference.com/w/cpp/named_req/Destructible): + JSON values can be destructed. +- Layout + - [StandardLayoutType](https://en.cppreference.com/w/cpp/named_req/StandardLayoutType): + JSON values have + [standard layout](https://en.cppreference.com/w/cpp/language/data_members#Standard_layout): + All non-static data members are private and standard layout types, the + class has no virtual functions or (virtual) base classes. +- Library-wide + - [EqualityComparable](https://en.cppreference.com/w/cpp/named_req/EqualityComparable): + JSON values can be compared with `==`, see @ref + operator==(const_reference,const_reference). + - [LessThanComparable](https://en.cppreference.com/w/cpp/named_req/LessThanComparable): + JSON values can be compared with `<`, see @ref + operator<(const_reference,const_reference). + - [Swappable](https://en.cppreference.com/w/cpp/named_req/Swappable): + Any JSON lvalue or rvalue of can be swapped with any lvalue or rvalue of + other compatible types, using unqualified function call @ref swap(). + - [NullablePointer](https://en.cppreference.com/w/cpp/named_req/NullablePointer): + JSON values can be compared against `std::nullptr_t` objects which are used + to model the `null` value. +- Container + - [Container](https://en.cppreference.com/w/cpp/named_req/Container): + JSON values can be used like STL containers and provide iterator access. + - [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer); + JSON values can be used like STL containers and provide reverse iterator + access. + +@invariant The member variables @a m_value and @a m_type have the following +relationship: +- If `m_type == value_t::object`, then `m_value.object != nullptr`. +- If `m_type == value_t::array`, then `m_value.array != nullptr`. +- If `m_type == value_t::string`, then `m_value.string != nullptr`. +The invariants are checked by member function assert_invariant(). + +@internal +@note ObjectType trick from https://stackoverflow.com/a/9860911 +@endinternal + +@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange +Format](http://rfc7159.net/rfc7159) + +@since version 1.0.0 + +@nosubgrouping +*/ +NLOHMANN_BASIC_JSON_TPL_DECLARATION +class basic_json +{ + private: + template friend struct detail::external_constructor; + friend ::nlohmann::json_pointer; + + template + friend class ::nlohmann::detail::parser; + friend ::nlohmann::detail::serializer; + template + friend class ::nlohmann::detail::iter_impl; + template + friend class ::nlohmann::detail::binary_writer; + template + friend class ::nlohmann::detail::binary_reader; + template + friend class ::nlohmann::detail::json_sax_dom_parser; + template + friend class ::nlohmann::detail::json_sax_dom_callback_parser; + + /// workaround type for MSVC + using basic_json_t = NLOHMANN_BASIC_JSON_TPL; + + // convenience aliases for types residing in namespace detail; + using lexer = ::nlohmann::detail::lexer_base; + + template + static ::nlohmann::detail::parser parser( + InputAdapterType adapter, + detail::parser_callback_tcb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false + ) + { + return ::nlohmann::detail::parser(std::move(adapter), + std::move(cb), allow_exceptions, ignore_comments); + } + + using primitive_iterator_t = ::nlohmann::detail::primitive_iterator_t; + template + using internal_iterator = ::nlohmann::detail::internal_iterator; + template + using iter_impl = ::nlohmann::detail::iter_impl; + template + using iteration_proxy = ::nlohmann::detail::iteration_proxy; + template using json_reverse_iterator = ::nlohmann::detail::json_reverse_iterator; + + template + using output_adapter_t = ::nlohmann::detail::output_adapter_t; + + template + using binary_reader = ::nlohmann::detail::binary_reader; + template using binary_writer = ::nlohmann::detail::binary_writer; + + using serializer = ::nlohmann::detail::serializer; + + public: + using value_t = detail::value_t; + /// JSON Pointer, see @ref nlohmann::json_pointer + using json_pointer = ::nlohmann::json_pointer; + template + using json_serializer = JSONSerializer; + /// how to treat decoding errors + using error_handler_t = detail::error_handler_t; + /// how to treat CBOR tags + using cbor_tag_handler_t = detail::cbor_tag_handler_t; + /// helper type for initializer lists of basic_json values + using initializer_list_t = std::initializer_list>; + + using input_format_t = detail::input_format_t; + /// SAX interface type, see @ref nlohmann::json_sax + using json_sax_t = json_sax; + + //////////////// + // exceptions // + //////////////// + + /// @name exceptions + /// Classes to implement user-defined exceptions. + /// @{ + + /// @copydoc detail::exception + using exception = detail::exception; + /// @copydoc detail::parse_error + using parse_error = detail::parse_error; + /// @copydoc detail::invalid_iterator + using invalid_iterator = detail::invalid_iterator; + /// @copydoc detail::type_error + using type_error = detail::type_error; + /// @copydoc detail::out_of_range + using out_of_range = detail::out_of_range; + /// @copydoc detail::other_error + using other_error = detail::other_error; + + /// @} + + + ///////////////////// + // container types // + ///////////////////// + + /// @name container types + /// The canonic container types to use @ref basic_json like any other STL + /// container. + /// @{ + + /// the type of elements in a basic_json container + using value_type = basic_json; + + /// the type of an element reference + using reference = value_type&; + /// the type of an element const reference + using const_reference = const value_type&; + + /// a type to represent differences between iterators + using difference_type = std::ptrdiff_t; + /// a type to represent container sizes + using size_type = std::size_t; + + /// the allocator type + using allocator_type = AllocatorType; + + /// the type of an element pointer + using pointer = typename std::allocator_traits::pointer; + /// the type of an element const pointer + using const_pointer = typename std::allocator_traits::const_pointer; + + /// an iterator for a basic_json container + using iterator = iter_impl; + /// a const iterator for a basic_json container + using const_iterator = iter_impl; + /// a reverse iterator for a basic_json container + using reverse_iterator = json_reverse_iterator; + /// a const reverse iterator for a basic_json container + using const_reverse_iterator = json_reverse_iterator; + + /// @} + + + /*! + @brief returns the allocator associated with the container + */ + static allocator_type get_allocator() + { + return allocator_type(); + } + + /*! + @brief returns version information on the library + + This function returns a JSON object with information about the library, + including the version number and information on the platform and compiler. + + @return JSON object holding version information + key | description + ----------- | --------------- + `compiler` | Information on the used compiler. It is an object with the following keys: `c++` (the used C++ standard), `family` (the compiler family; possible values are `clang`, `icc`, `gcc`, `ilecpp`, `msvc`, `pgcpp`, `sunpro`, and `unknown`), and `version` (the compiler version). + `copyright` | The copyright line for the library as string. + `name` | The name of the library as string. + `platform` | The used platform as string. Possible values are `win32`, `linux`, `apple`, `unix`, and `unknown`. + `url` | The URL of the project as string. + `version` | The version of the library. It is an object with the following keys: `major`, `minor`, and `patch` as defined by [Semantic Versioning](http://semver.org), and `string` (the version string). + + @liveexample{The following code shows an example output of the `meta()` + function.,meta} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @complexity Constant. + + @since 2.1.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json meta() + { + basic_json result; + + result["copyright"] = "(C) 2013-2020 Niels Lohmann"; + result["name"] = "JSON for Modern C++"; + result["url"] = "https://github.com/nlohmann/json"; + result["version"]["string"] = + std::to_string(NLOHMANN_JSON_VERSION_MAJOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_MINOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_PATCH); + result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR; + result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR; + result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH; + +#ifdef _WIN32 + result["platform"] = "win32"; +#elif defined __linux__ + result["platform"] = "linux"; +#elif defined __APPLE__ + result["platform"] = "apple"; +#elif defined __unix__ + result["platform"] = "unix"; +#else + result["platform"] = "unknown"; +#endif + +#if defined(__ICC) || defined(__INTEL_COMPILER) + result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; +#elif defined(__clang__) + result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}}; +#elif defined(__GNUC__) || defined(__GNUG__) + result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}}; +#elif defined(__HP_cc) || defined(__HP_aCC) + result["compiler"] = "hp" +#elif defined(__IBMCPP__) + result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; +#elif defined(_MSC_VER) + result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}}; +#elif defined(__PGI) + result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}}; +#elif defined(__SUNPRO_CC) + result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}}; +#else + result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; +#endif + +#ifdef __cplusplus + result["compiler"]["c++"] = std::to_string(__cplusplus); +#else + result["compiler"]["c++"] = "unknown"; +#endif + return result; + } + + + /////////////////////////// + // JSON value data types // + /////////////////////////// + + /// @name JSON value data types + /// The data types to store a JSON value. These types are derived from + /// the template arguments passed to class @ref basic_json. + /// @{ + +#if defined(JSON_HAS_CPP_14) + // Use transparent comparator if possible, combined with perfect forwarding + // on find() and count() calls prevents unnecessary string construction. + using object_comparator_t = std::less<>; +#else + using object_comparator_t = std::less; +#endif + + /*! + @brief a type for an object + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON objects as follows: + > An object is an unordered collection of zero or more name/value pairs, + > where a name is a string and a value is a string, number, boolean, null, + > object, or array. + + To store objects in C++, a type is defined by the template parameters + described below. + + @tparam ObjectType the container to store objects (e.g., `std::map` or + `std::unordered_map`) + @tparam StringType the type of the keys or names (e.g., `std::string`). + The comparison function `std::less` is used to order elements + inside the container. + @tparam AllocatorType the allocator to use for objects (e.g., + `std::allocator`) + + #### Default type + + With the default values for @a ObjectType (`std::map`), @a StringType + (`std::string`), and @a AllocatorType (`std::allocator`), the default + value for @a object_t is: + + @code {.cpp} + std::map< + std::string, // key_type + basic_json, // value_type + std::less, // key_compare + std::allocator> // allocator_type + > + @endcode + + #### Behavior + + The choice of @a object_t influences the behavior of the JSON class. With + the default type, objects have the following behavior: + + - When all names are unique, objects will be interoperable in the sense + that all software implementations receiving that object will agree on + the name-value mappings. + - When the names within an object are not unique, it is unspecified which + one of the values for a given key will be chosen. For instance, + `{"key": 2, "key": 1}` could be equal to either `{"key": 1}` or + `{"key": 2}`. + - Internally, name/value pairs are stored in lexicographical order of the + names. Objects will also be serialized (see @ref dump) in this order. + For instance, `{"b": 1, "a": 2}` and `{"a": 2, "b": 1}` will be stored + and serialized as `{"a": 2, "b": 1}`. + - When comparing objects, the order of the name/value pairs is irrelevant. + This makes objects interoperable in the sense that they will not be + affected by these differences. For instance, `{"b": 1, "a": 2}` and + `{"a": 2, "b": 1}` will be treated as equal. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the object's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON object. + + #### Storage + + Objects are stored as pointers in a @ref basic_json type. That is, for any + access to object values, a pointer of type `object_t*` must be + dereferenced. + + @sa @ref array_t -- type for an array value + + @since version 1.0.0 + + @note The order name/value pairs are added to the object is *not* + preserved by the library. Therefore, iterating an object may return + name/value pairs in a different order than they were originally stored. In + fact, keys will be traversed in alphabetical order as `std::map` with + `std::less` is used by default. Please note this behavior conforms to [RFC + 7159](http://rfc7159.net/rfc7159), because any order implements the + specified "unordered" nature of JSON objects. + */ + using object_t = ObjectType>>; + + /*! + @brief a type for an array + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON arrays as follows: + > An array is an ordered sequence of zero or more values. + + To store objects in C++, a type is defined by the template parameters + explained below. + + @tparam ArrayType container type to store arrays (e.g., `std::vector` or + `std::list`) + @tparam AllocatorType allocator to use for arrays (e.g., `std::allocator`) + + #### Default type + + With the default values for @a ArrayType (`std::vector`) and @a + AllocatorType (`std::allocator`), the default value for @a array_t is: + + @code {.cpp} + std::vector< + basic_json, // value_type + std::allocator // allocator_type + > + @endcode + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the array's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON array. + + #### Storage + + Arrays are stored as pointers in a @ref basic_json type. That is, for any + access to array values, a pointer of type `array_t*` must be dereferenced. + + @sa @ref object_t -- type for an object value + + @since version 1.0.0 + */ + using array_t = ArrayType>; + + /*! + @brief a type for a string + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON strings as follows: + > A string is a sequence of zero or more Unicode characters. + + To store objects in C++, a type is defined by the template parameter + described below. Unicode values are split by the JSON class into + byte-sized characters during deserialization. + + @tparam StringType the container to store strings (e.g., `std::string`). + Note this container is used for keys/names in objects, see @ref object_t. + + #### Default type + + With the default values for @a StringType (`std::string`), the default + value for @a string_t is: + + @code {.cpp} + std::string + @endcode + + #### Encoding + + Strings are stored in UTF-8 encoding. Therefore, functions like + `std::string::size()` or `std::string::length()` return the number of + bytes in the string rather than the number of characters or glyphs. + + #### String comparison + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > Software implementations are typically required to test names of object + > members for equality. Implementations that transform the textual + > representation into sequences of Unicode code units and then perform the + > comparison numerically, code unit by code unit, are interoperable in the + > sense that implementations will agree in all cases on equality or + > inequality of two strings. For example, implementations that compare + > strings with escaped characters unconverted may incorrectly find that + > `"a\\b"` and `"a\u005Cb"` are not equal. + + This implementation is interoperable as it does compare strings code unit + by code unit. + + #### Storage + + String values are stored as pointers in a @ref basic_json type. That is, + for any access to string values, a pointer of type `string_t*` must be + dereferenced. + + @since version 1.0.0 + */ + using string_t = StringType; + + /*! + @brief a type for a boolean + + [RFC 7159](http://rfc7159.net/rfc7159) implicitly describes a boolean as a + type which differentiates the two literals `true` and `false`. + + To store objects in C++, a type is defined by the template parameter @a + BooleanType which chooses the type to use. + + #### Default type + + With the default values for @a BooleanType (`bool`), the default value for + @a boolean_t is: + + @code {.cpp} + bool + @endcode + + #### Storage + + Boolean values are stored directly inside a @ref basic_json type. + + @since version 1.0.0 + */ + using boolean_t = BooleanType; + + /*! + @brief a type for a number (integer) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store integer numbers in C++, a type is defined by the template + parameter @a NumberIntegerType which chooses the type to use. + + #### Default type + + With the default values for @a NumberIntegerType (`int64_t`), the default + value for @a number_integer_t is: + + @code {.cpp} + int64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `9223372036854775807` (INT64_MAX) and the minimal integer number + that can be stored is `-9223372036854775808` (INT64_MIN). Integer numbers + that are out of range will yield over/underflow when used in a + constructor. During deserialization, too large or small integer numbers + will be automatically be stored as @ref number_unsigned_t or @ref + number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange of the exactly supported range [INT64_MIN, + INT64_MAX], this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_integer_t = NumberIntegerType; + + /*! + @brief a type for a number (unsigned) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store unsigned integer numbers in C++, a type is defined by the + template parameter @a NumberUnsignedType which chooses the type to use. + + #### Default type + + With the default values for @a NumberUnsignedType (`uint64_t`), the + default value for @a number_unsigned_t is: + + @code {.cpp} + uint64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `18446744073709551615` (UINT64_MAX) and the minimal integer + number that can be stored is `0`. Integer numbers that are out of range + will yield over/underflow when used in a constructor. During + deserialization, too large or small integer numbers will be automatically + be stored as @ref number_integer_t or @ref number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange (when considered in conjunction with the + number_integer_t type) of the exactly supported range [0, UINT64_MAX], + this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + @sa @ref number_integer_t -- type for number values (integer) + + @since version 2.0.0 + */ + using number_unsigned_t = NumberUnsignedType; + + /*! + @brief a type for a number (floating-point) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store floating-point numbers in C++, a type is defined by the template + parameter @a NumberFloatType which chooses the type to use. + + #### Default type + + With the default values for @a NumberFloatType (`double`), the default + value for @a number_float_t is: + + @code {.cpp} + double + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in floating-point literals will be ignored. Internally, + the value will be stored as decimal number. For instance, the C++ + floating-point literal `01.2` will be serialized to `1.2`. During + deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > This specification allows implementations to set limits on the range and + > precision of numbers accepted. Since software that implements IEEE + > 754-2008 binary64 (double precision) numbers is generally available and + > widely used, good interoperability can be achieved by implementations + > that expect no more precision or range than these provide, in the sense + > that implementations will approximate JSON numbers within the expected + > precision. + + This implementation does exactly follow this approach, as it uses double + precision floating-point numbers. Note values smaller than + `-1.79769313486232e+308` and values greater than `1.79769313486232e+308` + will be stored as NaN internally and be serialized to `null`. + + #### Storage + + Floating-point number values are stored directly inside a @ref basic_json + type. + + @sa @ref number_integer_t -- type for number values (integer) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_float_t = NumberFloatType; + + /*! + @brief a type for a packed binary type + + This type is a type designed to carry binary data that appears in various + serialized formats, such as CBOR's Major Type 2, MessagePack's bin, and + BSON's generic binary subtype. This type is NOT a part of standard JSON and + exists solely for compatibility with these binary types. As such, it is + simply defined as an ordered sequence of zero or more byte values. + + Additionally, as an implementation detail, the subtype of the binary data is + carried around as a `std::uint8_t`, which is compatible with both of the + binary data formats that use binary subtyping, (though the specific + numbering is incompatible with each other, and it is up to the user to + translate between them). + + [CBOR's RFC 7049](https://tools.ietf.org/html/rfc7049) describes this type + as: + > Major type 2: a byte string. The string's length in bytes is represented + > following the rules for positive integers (major type 0). + + [MessagePack's documentation on the bin type + family](https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family) + describes this type as: + > Bin format family stores an byte array in 2, 3, or 5 bytes of extra bytes + > in addition to the size of the byte array. + + [BSON's specifications](http://bsonspec.org/spec.html) describe several + binary types; however, this type is intended to represent the generic binary + type which has the description: + > Generic binary subtype - This is the most commonly used binary subtype and + > should be the 'default' for drivers and tools. + + None of these impose any limitations on the internal representation other + than the basic unit of storage be some type of array whose parts are + decomposable into bytes. + + The default representation of this binary format is a + `std::vector`, which is a very common way to represent a byte + array in modern C++. + + #### Default type + + The default values for @a BinaryType is `std::vector` + + #### Storage + + Binary Arrays are stored as pointers in a @ref basic_json type. That is, + for any access to array values, a pointer of the type `binary_t*` must be + dereferenced. + + #### Notes on subtypes + + - CBOR + - Binary values are represented as byte strings. No subtypes are + supported and will be ignored when CBOR is written. + - MessagePack + - If a subtype is given and the binary array contains exactly 1, 2, 4, 8, + or 16 elements, the fixext family (fixext1, fixext2, fixext4, fixext8) + is used. For other sizes, the ext family (ext8, ext16, ext32) is used. + The subtype is then added as singed 8-bit integer. + - If no subtype is given, the bin family (bin8, bin16, bin32) is used. + - BSON + - If a subtype is given, it is used and added as unsigned 8-bit integer. + - If no subtype is given, the generic binary subtype 0x00 is used. + + @sa @ref binary -- create a binary array + + @since version 3.8.0 + */ + using binary_t = nlohmann::byte_container_with_subtype; + /// @} + + private: + + /// helper for exception-safe object creation + template + JSON_HEDLEY_RETURNS_NON_NULL + static T* create(Args&& ... args) + { + AllocatorType alloc; + using AllocatorTraits = std::allocator_traits>; + + auto deleter = [&](T * object) + { + AllocatorTraits::deallocate(alloc, object, 1); + }; + std::unique_ptr object(AllocatorTraits::allocate(alloc, 1), deleter); + AllocatorTraits::construct(alloc, object.get(), std::forward(args)...); + JSON_ASSERT(object != nullptr); + return object.release(); + } + + //////////////////////// + // JSON value storage // + //////////////////////// + + /*! + @brief a JSON value + + The actual storage for a JSON value of the @ref basic_json class. This + union combines the different storage types for the JSON value types + defined in @ref value_t. + + JSON type | value_t type | used type + --------- | --------------- | ------------------------ + object | object | pointer to @ref object_t + array | array | pointer to @ref array_t + string | string | pointer to @ref string_t + boolean | boolean | @ref boolean_t + number | number_integer | @ref number_integer_t + number | number_unsigned | @ref number_unsigned_t + number | number_float | @ref number_float_t + binary | binary | pointer to @ref binary_t + null | null | *no value is stored* + + @note Variable-length types (objects, arrays, and strings) are stored as + pointers. The size of the union should not exceed 64 bits if the default + value types are used. + + @since version 1.0.0 + */ + union json_value + { + /// object (stored with pointer to save storage) + object_t* object; + /// array (stored with pointer to save storage) + array_t* array; + /// string (stored with pointer to save storage) + string_t* string; + /// binary (stored with pointer to save storage) + binary_t* binary; + /// boolean + boolean_t boolean; + /// number (integer) + number_integer_t number_integer; + /// number (unsigned integer) + number_unsigned_t number_unsigned; + /// number (floating-point) + number_float_t number_float; + + /// default constructor (for null values) + json_value() = default; + /// constructor for booleans + json_value(boolean_t v) noexcept : boolean(v) {} + /// constructor for numbers (integer) + json_value(number_integer_t v) noexcept : number_integer(v) {} + /// constructor for numbers (unsigned) + json_value(number_unsigned_t v) noexcept : number_unsigned(v) {} + /// constructor for numbers (floating-point) + json_value(number_float_t v) noexcept : number_float(v) {} + /// constructor for empty values of a given type + json_value(value_t t) + { + switch (t) + { + case value_t::object: + { + object = create(); + break; + } + + case value_t::array: + { + array = create(); + break; + } + + case value_t::string: + { + string = create(""); + break; + } + + case value_t::binary: + { + binary = create(); + break; + } + + case value_t::boolean: + { + boolean = boolean_t(false); + break; + } + + case value_t::number_integer: + { + number_integer = number_integer_t(0); + break; + } + + case value_t::number_unsigned: + { + number_unsigned = number_unsigned_t(0); + break; + } + + case value_t::number_float: + { + number_float = number_float_t(0.0); + break; + } + + case value_t::null: + { + object = nullptr; // silence warning, see #821 + break; + } + + default: + { + object = nullptr; // silence warning, see #821 + if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) + { + JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.9.1")); // LCOV_EXCL_LINE + } + break; + } + } + } + + /// constructor for strings + json_value(const string_t& value) + { + string = create(value); + } + + /// constructor for rvalue strings + json_value(string_t&& value) + { + string = create(std::move(value)); + } + + /// constructor for objects + json_value(const object_t& value) + { + object = create(value); + } + + /// constructor for rvalue objects + json_value(object_t&& value) + { + object = create(std::move(value)); + } + + /// constructor for arrays + json_value(const array_t& value) + { + array = create(value); + } + + /// constructor for rvalue arrays + json_value(array_t&& value) + { + array = create(std::move(value)); + } + + /// constructor for binary arrays + json_value(const typename binary_t::container_type& value) + { + binary = create(value); + } + + /// constructor for rvalue binary arrays + json_value(typename binary_t::container_type&& value) + { + binary = create(std::move(value)); + } + + /// constructor for binary arrays (internal type) + json_value(const binary_t& value) + { + binary = create(value); + } + + /// constructor for rvalue binary arrays (internal type) + json_value(binary_t&& value) + { + binary = create(std::move(value)); + } + + void destroy(value_t t) noexcept + { + // flatten the current json_value to a heap-allocated stack + std::vector stack; + + // move the top-level items to stack + if (t == value_t::array) + { + stack.reserve(array->size()); + std::move(array->begin(), array->end(), std::back_inserter(stack)); + } + else if (t == value_t::object) + { + stack.reserve(object->size()); + for (auto&& it : *object) + { + stack.push_back(std::move(it.second)); + } + } + + while (!stack.empty()) + { + // move the last item to local variable to be processed + basic_json current_item(std::move(stack.back())); + stack.pop_back(); + + // if current_item is array/object, move + // its children to the stack to be processed later + if (current_item.is_array()) + { + std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), + std::back_inserter(stack)); + + current_item.m_value.array->clear(); + } + else if (current_item.is_object()) + { + for (auto&& it : *current_item.m_value.object) + { + stack.push_back(std::move(it.second)); + } + + current_item.m_value.object->clear(); + } + + // it's now safe that current_item get destructed + // since it doesn't have any children + } + + switch (t) + { + case value_t::object: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, object); + std::allocator_traits::deallocate(alloc, object, 1); + break; + } + + case value_t::array: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, array); + std::allocator_traits::deallocate(alloc, array, 1); + break; + } + + case value_t::string: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, string); + std::allocator_traits::deallocate(alloc, string, 1); + break; + } + + case value_t::binary: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, binary); + std::allocator_traits::deallocate(alloc, binary, 1); + break; + } + + default: + { + break; + } + } + } + }; + + /*! + @brief checks the class invariants + + This function asserts the class invariants. It needs to be called at the + end of every constructor to make sure that created objects respect the + invariant. Furthermore, it has to be called each time the type of a JSON + value is changed, because the invariant expresses a relationship between + @a m_type and @a m_value. + */ + void assert_invariant() const noexcept + { + JSON_ASSERT(m_type != value_t::object || m_value.object != nullptr); + JSON_ASSERT(m_type != value_t::array || m_value.array != nullptr); + JSON_ASSERT(m_type != value_t::string || m_value.string != nullptr); + JSON_ASSERT(m_type != value_t::binary || m_value.binary != nullptr); + } + + public: + ////////////////////////// + // JSON parser callback // + ////////////////////////// + + /*! + @brief parser event types + + The parser callback distinguishes the following events: + - `object_start`: the parser read `{` and started to process a JSON object + - `key`: the parser read a key of a value in an object + - `object_end`: the parser read `}` and finished processing a JSON object + - `array_start`: the parser read `[` and started to process a JSON array + - `array_end`: the parser read `]` and finished processing a JSON array + - `value`: the parser finished reading a JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + @sa @ref parser_callback_t for more information and examples + */ + using parse_event_t = detail::parse_event_t; + + /*! + @brief per-element parser callback type + + With a parser callback function, the result of parsing a JSON text can be + influenced. When passed to @ref parse, it is called on certain events + (passed as @ref parse_event_t via parameter @a event) with a set recursion + depth @a depth and context JSON value @a parsed. The return value of the + callback function is a boolean indicating whether the element that emitted + the callback shall be kept or not. + + We distinguish six scenarios (determined by the event type) in which the + callback function can be called. The following table describes the values + of the parameters @a depth, @a event, and @a parsed. + + parameter @a event | description | parameter @a depth | parameter @a parsed + ------------------ | ----------- | ------------------ | ------------------- + parse_event_t::object_start | the parser read `{` and started to process a JSON object | depth of the parent of the JSON object | a JSON value with type discarded + parse_event_t::key | the parser read a key of a value in an object | depth of the currently parsed JSON object | a JSON string containing the key + parse_event_t::object_end | the parser read `}` and finished processing a JSON object | depth of the parent of the JSON object | the parsed JSON object + parse_event_t::array_start | the parser read `[` and started to process a JSON array | depth of the parent of the JSON array | a JSON value with type discarded + parse_event_t::array_end | the parser read `]` and finished processing a JSON array | depth of the parent of the JSON array | the parsed JSON array + parse_event_t::value | the parser finished reading a JSON value | depth of the value | the parsed JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + Discarding a value (i.e., returning `false`) has different effects + depending on the context in which function was called: + + - Discarded values in structured types are skipped. That is, the parser + will behave as if the discarded value was never read. + - In case a value outside a structured type is skipped, it is replaced + with `null`. This case happens if the top-level element is skipped. + + @param[in] depth the depth of the recursion during parsing + + @param[in] event an event of type parse_event_t indicating the context in + the callback function has been called + + @param[in,out] parsed the current intermediate parse result; note that + writing to this value has no effect for parse_event_t::key events + + @return Whether the JSON value which called the function during parsing + should be kept (`true`) or not (`false`). In the latter case, it is either + skipped completely or replaced by an empty discarded object. + + @sa @ref parse for examples + + @since version 1.0.0 + */ + using parser_callback_t = detail::parser_callback_t; + + ////////////////// + // constructors // + ////////////////// + + /// @name constructors and destructors + /// Constructors of class @ref basic_json, copy/move constructor, copy + /// assignment, static functions creating objects, and the destructor. + /// @{ + + /*! + @brief create an empty value with a given type + + Create an empty JSON value with a given type. The value will be default + initialized with an empty value which depends on the type: + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + object | `{}` + array | `[]` + binary | empty array + + @param[in] v the type of the value to create + + @complexity Constant. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows the constructor for different @ref + value_t values,basic_json__value_t} + + @sa @ref clear() -- restores the postcondition of this constructor + + @since version 1.0.0 + */ + basic_json(const value_t v) + : m_type(v), m_value(v) + { + assert_invariant(); + } + + /*! + @brief create a null object + + Create a `null` JSON value. It either takes a null pointer as parameter + (explicitly creating `null`) or no parameter (implicitly creating `null`). + The passed null pointer itself is not read -- it is only used to choose + the right constructor. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @liveexample{The following code shows the constructor with and without a + null pointer parameter.,basic_json__nullptr_t} + + @since version 1.0.0 + */ + basic_json(std::nullptr_t = nullptr) noexcept + : basic_json(value_t::null) + { + assert_invariant(); + } + + /*! + @brief create a JSON value + + This is a "catch all" constructor for all compatible JSON types; that is, + types for which a `to_json()` method exists. The constructor forwards the + parameter @a val to that method (to `json_serializer::to_json` method + with `U = uncvref_t`, to be exact). + + Template type @a CompatibleType includes, but is not limited to, the + following types: + - **arrays**: @ref array_t and all kinds of compatible containers such as + `std::vector`, `std::deque`, `std::list`, `std::forward_list`, + `std::array`, `std::valarray`, `std::set`, `std::unordered_set`, + `std::multiset`, and `std::unordered_multiset` with a `value_type` from + which a @ref basic_json value can be constructed. + - **objects**: @ref object_t and all kinds of compatible associative + containers such as `std::map`, `std::unordered_map`, `std::multimap`, + and `std::unordered_multimap` with a `key_type` compatible to + @ref string_t and a `value_type` from which a @ref basic_json value can + be constructed. + - **strings**: @ref string_t, string literals, and all compatible string + containers can be used. + - **numbers**: @ref number_integer_t, @ref number_unsigned_t, + @ref number_float_t, and all convertible number types such as `int`, + `size_t`, `int64_t`, `float` or `double` can be used. + - **boolean**: @ref boolean_t / `bool` can be used. + - **binary**: @ref binary_t / `std::vector` may be used, + unfortunately because string literals cannot be distinguished from binary + character arrays by the C++ type system, all types compatible with `const + char*` will be directed to the string constructor instead. This is both + for backwards compatibility, and due to the fact that a binary type is not + a standard JSON type. + + See the examples below. + + @tparam CompatibleType a type such that: + - @a CompatibleType is not derived from `std::istream`, + - @a CompatibleType is not @ref basic_json (to avoid hijacking copy/move + constructors), + - @a CompatibleType is not a different @ref basic_json type (i.e. with different template arguments) + - @a CompatibleType is not a @ref basic_json nested type (e.g., + @ref json_pointer, @ref iterator, etc ...) + - @ref @ref json_serializer has a + `to_json(basic_json_t&, CompatibleType&&)` method + + @tparam U = `uncvref_t` + + @param[in] val the value to be forwarded to the respective constructor + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @liveexample{The following code shows the constructor with several + compatible types.,basic_json__CompatibleType} + + @since version 2.1.0 + */ + template < typename CompatibleType, + typename U = detail::uncvref_t, + detail::enable_if_t < + !detail::is_basic_json::value && detail::is_compatible_type::value, int > = 0 > + basic_json(CompatibleType && val) noexcept(noexcept( + JSONSerializer::to_json(std::declval(), + std::forward(val)))) + { + JSONSerializer::to_json(*this, std::forward(val)); + assert_invariant(); + } + + /*! + @brief create a JSON value from an existing one + + This is a constructor for existing @ref basic_json types. + It does not hijack copy/move constructors, since the parameter has different + template arguments than the current ones. + + The constructor tries to convert the internal @ref m_value of the parameter. + + @tparam BasicJsonType a type such that: + - @a BasicJsonType is a @ref basic_json type. + - @a BasicJsonType has different template arguments than @ref basic_json_t. + + @param[in] val the @ref basic_json value to be converted. + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @since version 3.2.0 + */ + template < typename BasicJsonType, + detail::enable_if_t < + detail::is_basic_json::value&& !std::is_same::value, int > = 0 > + basic_json(const BasicJsonType& val) + { + using other_boolean_t = typename BasicJsonType::boolean_t; + using other_number_float_t = typename BasicJsonType::number_float_t; + using other_number_integer_t = typename BasicJsonType::number_integer_t; + using other_number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using other_string_t = typename BasicJsonType::string_t; + using other_object_t = typename BasicJsonType::object_t; + using other_array_t = typename BasicJsonType::array_t; + using other_binary_t = typename BasicJsonType::binary_t; + + switch (val.type()) + { + case value_t::boolean: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_float: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_integer: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_unsigned: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::string: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::object: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::array: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::binary: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::null: + *this = nullptr; + break; + case value_t::discarded: + m_type = value_t::discarded; + break; + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + assert_invariant(); + } + + /*! + @brief create a container (array or object) from an initializer list + + Creates a JSON value of type array or object from the passed initializer + list @a init. In case @a type_deduction is `true` (default), the type of + the JSON value to be created is deducted from the initializer list @a init + according to the following rules: + + 1. If the list is empty, an empty JSON object value `{}` is created. + 2. If the list consists of pairs whose first element is a string, a JSON + object value is created where the first elements of the pairs are + treated as keys and the second elements are as values. + 3. In all other cases, an array is created. + + The rules aim to create the best fit between a C++ initializer list and + JSON values. The rationale is as follows: + + 1. The empty initializer list is written as `{}` which is exactly an empty + JSON object. + 2. C++ has no way of describing mapped types other than to list a list of + pairs. As JSON requires that keys must be of type string, rule 2 is the + weakest constraint one can pose on initializer lists to interpret them + as an object. + 3. In all other cases, the initializer list could not be interpreted as + JSON object type, so interpreting it as JSON array type is safe. + + With the rules described above, the following JSON values cannot be + expressed by an initializer list: + + - the empty array (`[]`): use @ref array(initializer_list_t) + with an empty initializer list in this case + - arrays whose elements satisfy rule 2: use @ref + array(initializer_list_t) with the same initializer list + in this case + + @note When used without parentheses around an empty initializer list, @ref + basic_json() is called instead of this function, yielding the JSON null + value. + + @param[in] init initializer list with JSON values + + @param[in] type_deduction internal parameter; when set to `true`, the type + of the JSON value is deducted from the initializer list @a init; when set + to `false`, the type provided via @a manual_type is forced. This mode is + used by the functions @ref array(initializer_list_t) and + @ref object(initializer_list_t). + + @param[in] manual_type internal parameter; when @a type_deduction is set + to `false`, the created JSON value will use the provided type (only @ref + value_t::array and @ref value_t::object are valid); when @a type_deduction + is set to `true`, this parameter has no effect + + @throw type_error.301 if @a type_deduction is `false`, @a manual_type is + `value_t::object`, but @a init contains an element which is not a pair + whose first element is a string. In this case, the constructor could not + create an object. If @a type_deduction would have be `true`, an array + would have been created. See @ref object(initializer_list_t) + for an example. + + @complexity Linear in the size of the initializer list @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows how JSON values are created from + initializer lists.,basic_json__list_init_t} + + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + basic_json(initializer_list_t init, + bool type_deduction = true, + value_t manual_type = value_t::array) + { + // check if each element is an array with two elements whose first + // element is a string + bool is_an_object = std::all_of(init.begin(), init.end(), + [](const detail::json_ref& element_ref) + { + return element_ref->is_array() && element_ref->size() == 2 && (*element_ref)[0].is_string(); + }); + + // adjust type if type deduction is not wanted + if (!type_deduction) + { + // if array is wanted, do not create an object though possible + if (manual_type == value_t::array) + { + is_an_object = false; + } + + // if object is wanted but impossible, throw an exception + if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object && !is_an_object)) + { + JSON_THROW(type_error::create(301, "cannot create object from initializer list")); + } + } + + if (is_an_object) + { + // the initializer list is a list of pairs -> create object + m_type = value_t::object; + m_value = value_t::object; + + std::for_each(init.begin(), init.end(), [this](const detail::json_ref& element_ref) + { + auto element = element_ref.moved_or_copied(); + m_value.object->emplace( + std::move(*((*element.m_value.array)[0].m_value.string)), + std::move((*element.m_value.array)[1])); + }); + } + else + { + // the initializer list describes an array -> create array + m_type = value_t::array; + m_value.array = create(init.begin(), init.end()); + } + + assert_invariant(); + } + + /*! + @brief explicitly create a binary array (without subtype) + + Creates a JSON binary array value from a given binary container. Binary + values are part of various binary formats, such as CBOR, MessagePack, and + BSON. This constructor is used to create a value for serialization to those + formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it does not happen on + accident. + + @param[in] init container containing bytes to use as binary type + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(const typename binary_t::container_type& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = init; + return res; + } + + /*! + @brief explicitly create a binary array (with subtype) + + Creates a JSON binary array value from a given binary container. Binary + values are part of various binary formats, such as CBOR, MessagePack, and + BSON. This constructor is used to create a value for serialization to those + formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it does not happen on + accident. + + @param[in] init container containing bytes to use as binary type + @param[in] subtype subtype to use in MessagePack and BSON + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(const typename binary_t::container_type& init, std::uint8_t subtype) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = binary_t(init, subtype); + return res; + } + + /// @copydoc binary(const typename binary_t::container_type&) + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(typename binary_t::container_type&& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = std::move(init); + return res; + } + + /// @copydoc binary(const typename binary_t::container_type&, std::uint8_t) + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(typename binary_t::container_type&& init, std::uint8_t subtype) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = binary_t(std::move(init), subtype); + return res; + } + + /*! + @brief explicitly create an array from an initializer list + + Creates a JSON array value from a given initializer list. That is, given a + list of values `a, b, c`, creates the JSON value `[a, b, c]`. If the + initializer list is empty, the empty array `[]` is created. + + @note This function is only needed to express two edge cases that cannot + be realized with the initializer list constructor (@ref + basic_json(initializer_list_t, bool, value_t)). These cases + are: + 1. creating an array whose elements are all pairs whose first element is a + string -- in this case, the initializer list constructor would create an + object, taking the first elements as keys + 2. creating an empty array -- passing the empty initializer list to the + initializer list constructor yields an empty object + + @param[in] init initializer list with JSON values to create an array from + (optional) + + @return JSON array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `array` + function.,array} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json array(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::array); + } + + /*! + @brief explicitly create an object from an initializer list + + Creates a JSON object value from a given initializer list. The initializer + lists elements must be pairs, and their first elements must be strings. If + the initializer list is empty, the empty object `{}` is created. + + @note This function is only added for symmetry reasons. In contrast to the + related function @ref array(initializer_list_t), there are + no cases which can only be expressed by this function. That is, any + initializer list @a init can also be passed to the initializer list + constructor @ref basic_json(initializer_list_t, bool, value_t). + + @param[in] init initializer list to create an object from (optional) + + @return JSON object value + + @throw type_error.301 if @a init is not a list of pairs whose first + elements are strings. In this case, no object can be created. When such a + value is passed to @ref basic_json(initializer_list_t, bool, value_t), + an array would have been created from the passed initializer list @a init. + See example below. + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `object` + function.,object} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json object(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::object); + } + + /*! + @brief construct an array with count copies of given value + + Constructs a JSON array value by creating @a cnt copies of a passed value. + In case @a cnt is `0`, an empty array is created. + + @param[in] cnt the number of JSON copies of @a val to create + @param[in] val the JSON value to copy + + @post `std::distance(begin(),end()) == cnt` holds. + + @complexity Linear in @a cnt. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows examples for the @ref + basic_json(size_type\, const basic_json&) + constructor.,basic_json__size_type_basic_json} + + @since version 1.0.0 + */ + basic_json(size_type cnt, const basic_json& val) + : m_type(value_t::array) + { + m_value.array = create(cnt, val); + assert_invariant(); + } + + /*! + @brief construct a JSON container given an iterator range + + Constructs the JSON value with the contents of the range `[first, last)`. + The semantics depends on the different types a JSON value can have: + - In case of a null type, invalid_iterator.206 is thrown. + - In case of other primitive types (number, boolean, or string), @a first + must be `begin()` and @a last must be `end()`. In this case, the value is + copied. Otherwise, invalid_iterator.204 is thrown. + - In case of structured types (array, object), the constructor behaves as + similar versions for `std::vector` or `std::map`; that is, a JSON array + or object is constructed from the values in the range. + + @tparam InputIT an input iterator type (@ref iterator or @ref + const_iterator) + + @param[in] first begin of the range to copy from (included) + @param[in] last end of the range to copy from (excluded) + + @pre Iterators @a first and @a last must be initialized. **This + precondition is enforced with an assertion (see warning).** If + assertions are switched off, a violation of this precondition yields + undefined behavior. + + @pre Range `[first, last)` is valid. Usually, this precondition cannot be + checked efficiently. Only certain edge cases are detected; see the + description of the exceptions below. A violation of this precondition + yields undefined behavior. + + @warning A precondition is enforced with a runtime assertion that will + result in calling `std::abort` if this precondition is not met. + Assertions can be disabled by defining `NDEBUG` at compile time. + See https://en.cppreference.com/w/cpp/error/assert for more + information. + + @throw invalid_iterator.201 if iterators @a first and @a last are not + compatible (i.e., do not belong to the same JSON value). In this case, + the range `[first, last)` is undefined. + @throw invalid_iterator.204 if iterators @a first and @a last belong to a + primitive type (number, boolean, or string), but @a first does not point + to the first element any more. In this case, the range `[first, last)` is + undefined. See example code below. + @throw invalid_iterator.206 if iterators @a first and @a last belong to a + null value. In this case, the range `[first, last)` is undefined. + + @complexity Linear in distance between @a first and @a last. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows several ways to create JSON values by + specifying a subrange with iterators.,basic_json__InputIt_InputIt} + + @since version 1.0.0 + */ + template < class InputIT, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type = 0 > + basic_json(InputIT first, InputIT last) + { + JSON_ASSERT(first.m_object != nullptr); + JSON_ASSERT(last.m_object != nullptr); + + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); + } + + // copy type from first iterator + m_type = first.m_object->m_type; + + // check if iterator range is complete for primitive values + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + { + if (JSON_HEDLEY_UNLIKELY(!first.m_it.primitive_iterator.is_begin() + || !last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + break; + } + + default: + break; + } + + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = first.m_object->m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = first.m_object->m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value.number_float = first.m_object->m_value.number_float; + break; + } + + case value_t::boolean: + { + m_value.boolean = first.m_object->m_value.boolean; + break; + } + + case value_t::string: + { + m_value = *first.m_object->m_value.string; + break; + } + + case value_t::object: + { + m_value.object = create(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + m_value.array = create(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + case value_t::binary: + { + m_value = *first.m_object->m_value.binary; + break; + } + + default: + JSON_THROW(invalid_iterator::create(206, "cannot construct with iterators from " + + std::string(first.m_object->type_name()))); + } + + assert_invariant(); + } + + + /////////////////////////////////////// + // other constructors and destructor // + /////////////////////////////////////// + + template, + std::is_same>::value, int> = 0 > + basic_json(const JsonRef& ref) : basic_json(ref.moved_or_copied()) {} + + /*! + @brief copy constructor + + Creates a copy of a given JSON value. + + @param[in] other the JSON value to copy + + @post `*this == other` + + @complexity Linear in the size of @a other. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - As postcondition, it holds: `other == basic_json(other)`. + + @liveexample{The following code shows an example for the copy + constructor.,basic_json__basic_json} + + @since version 1.0.0 + */ + basic_json(const basic_json& other) + : m_type(other.m_type) + { + // check of passed value is valid + other.assert_invariant(); + + switch (m_type) + { + case value_t::object: + { + m_value = *other.m_value.object; + break; + } + + case value_t::array: + { + m_value = *other.m_value.array; + break; + } + + case value_t::string: + { + m_value = *other.m_value.string; + break; + } + + case value_t::boolean: + { + m_value = other.m_value.boolean; + break; + } + + case value_t::number_integer: + { + m_value = other.m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value = other.m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value = other.m_value.number_float; + break; + } + + case value_t::binary: + { + m_value = *other.m_value.binary; + break; + } + + default: + break; + } + + assert_invariant(); + } + + /*! + @brief move constructor + + Move constructor. Constructs a JSON value with the contents of the given + value @a other using move semantics. It "steals" the resources from @a + other and leaves it as JSON null value. + + @param[in,out] other value to move to this object + + @post `*this` has the same value as @a other before the call. + @post @a other is a JSON null value. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @requirement This function helps `basic_json` satisfying the + [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible) + requirements. + + @liveexample{The code below shows the move constructor explicitly called + via std::move.,basic_json__moveconstructor} + + @since version 1.0.0 + */ + basic_json(basic_json&& other) noexcept + : m_type(std::move(other.m_type)), + m_value(std::move(other.m_value)) + { + // check that passed value is valid + other.assert_invariant(); + + // invalidate payload + other.m_type = value_t::null; + other.m_value = {}; + + assert_invariant(); + } + + /*! + @brief copy assignment + + Copy assignment operator. Copies a JSON value via the "copy and swap" + strategy: It is expressed in terms of the copy constructor, destructor, + and the `swap()` member function. + + @param[in] other value to copy from + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + + @liveexample{The code below shows and example for the copy assignment. It + creates a copy of value `a` which is then swapped with `b`. Finally\, the + copy of `a` (which is the null value after the swap) is + destroyed.,basic_json__copyassignment} + + @since version 1.0.0 + */ + basic_json& operator=(basic_json other) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + // check that passed value is valid + other.assert_invariant(); + + using std::swap; + swap(m_type, other.m_type); + swap(m_value, other.m_value); + + assert_invariant(); + return *this; + } + + /*! + @brief destructor + + Destroys the JSON value and frees all allocated memory. + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - All stored elements are destroyed and all memory is freed. + + @since version 1.0.0 + */ + ~basic_json() noexcept + { + assert_invariant(); + m_value.destroy(m_type); + } + + /// @} + + public: + /////////////////////// + // object inspection // + /////////////////////// + + /// @name object inspection + /// Functions to inspect the type of a JSON value. + /// @{ + + /*! + @brief serialization + + Serialization function for JSON values. The function tries to mimic + Python's `json.dumps()` function, and currently supports its @a indent + and @a ensure_ascii parameters. + + @param[in] indent If indent is nonnegative, then array elements and object + members will be pretty-printed with that indent level. An indent level of + `0` will only insert newlines. `-1` (the default) selects the most compact + representation. + @param[in] indent_char The character to use for indentation if @a indent is + greater than `0`. The default is ` ` (space). + @param[in] ensure_ascii If @a ensure_ascii is true, all non-ASCII characters + in the output are escaped with `\uXXXX` sequences, and the result consists + of ASCII characters only. + @param[in] error_handler how to react on decoding errors; there are three + possible values: `strict` (throws and exception in case a decoding error + occurs; default), `replace` (replace invalid UTF-8 sequences with U+FFFD), + and `ignore` (ignore invalid UTF-8 sequences during serialization; all + bytes are copied to the output unchanged). + + @return string containing the serialization of the JSON value + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded and @a error_handler is set to strict + + @note Binary values are serialized as object containing two keys: + - "bytes": an array of bytes as integers + - "subtype": the subtype as integer or "null" if the binary has no subtype + + @complexity Linear. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @liveexample{The following example shows the effect of different @a indent\, + @a indent_char\, and @a ensure_ascii parameters to the result of the + serialization.,dump} + + @see https://docs.python.org/2/library/json.html#json.dump + + @since version 1.0.0; indentation character @a indent_char, option + @a ensure_ascii and exceptions added in version 3.0.0; error + handlers added in version 3.4.0; serialization of binary values added + in version 3.8.0. + */ + string_t dump(const int indent = -1, + const char indent_char = ' ', + const bool ensure_ascii = false, + const error_handler_t error_handler = error_handler_t::strict) const + { + string_t result; + serializer s(detail::output_adapter(result), indent_char, error_handler); + + if (indent >= 0) + { + s.dump(*this, true, ensure_ascii, static_cast(indent)); + } + else + { + s.dump(*this, false, ensure_ascii, 0); + } + + return result; + } + + /*! + @brief return the type of the JSON value (explicit) + + Return the type of the JSON value as a value from the @ref value_t + enumeration. + + @return the type of the JSON value + Value type | return value + ------------------------- | ------------------------- + null | value_t::null + boolean | value_t::boolean + string | value_t::string + number (integer) | value_t::number_integer + number (unsigned integer) | value_t::number_unsigned + number (floating-point) | value_t::number_float + object | value_t::object + array | value_t::array + binary | value_t::binary + discarded | value_t::discarded + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `type()` for all JSON + types.,type} + + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr value_t type() const noexcept + { + return m_type; + } + + /*! + @brief return whether type is primitive + + This function returns true if and only if the JSON type is primitive + (string, number, boolean, or null). + + @return `true` if type is primitive (string, number, boolean, or null), + `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_primitive()` for all JSON + types.,is_primitive} + + @sa @ref is_structured() -- returns whether JSON value is structured + @sa @ref is_null() -- returns whether JSON value is `null` + @sa @ref is_string() -- returns whether JSON value is a string + @sa @ref is_boolean() -- returns whether JSON value is a boolean + @sa @ref is_number() -- returns whether JSON value is a number + @sa @ref is_binary() -- returns whether JSON value is a binary array + + @since version 1.0.0 + */ + constexpr bool is_primitive() const noexcept + { + return is_null() || is_string() || is_boolean() || is_number() || is_binary(); + } + + /*! + @brief return whether type is structured + + This function returns true if and only if the JSON type is structured + (array or object). + + @return `true` if type is structured (array or object), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_structured()` for all JSON + types.,is_structured} + + @sa @ref is_primitive() -- returns whether value is primitive + @sa @ref is_array() -- returns whether value is an array + @sa @ref is_object() -- returns whether value is an object + + @since version 1.0.0 + */ + constexpr bool is_structured() const noexcept + { + return is_array() || is_object(); + } + + /*! + @brief return whether value is null + + This function returns true if and only if the JSON value is null. + + @return `true` if type is null, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_null()` for all JSON + types.,is_null} + + @since version 1.0.0 + */ + constexpr bool is_null() const noexcept + { + return m_type == value_t::null; + } + + /*! + @brief return whether value is a boolean + + This function returns true if and only if the JSON value is a boolean. + + @return `true` if type is boolean, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_boolean()` for all JSON + types.,is_boolean} + + @since version 1.0.0 + */ + constexpr bool is_boolean() const noexcept + { + return m_type == value_t::boolean; + } + + /*! + @brief return whether value is a number + + This function returns true if and only if the JSON value is a number. This + includes both integer (signed and unsigned) and floating-point values. + + @return `true` if type is number (regardless whether integer, unsigned + integer or floating-type), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number()` for all JSON + types.,is_number} + + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number() const noexcept + { + return is_number_integer() || is_number_float(); + } + + /*! + @brief return whether value is an integer number + + This function returns true if and only if the JSON value is a signed or + unsigned integer number. This excludes floating-point values. + + @return `true` if type is an integer or unsigned integer number, `false` + otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_integer()` for all + JSON types.,is_number_integer} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number_integer() const noexcept + { + return m_type == value_t::number_integer || m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is an unsigned integer number + + This function returns true if and only if the JSON value is an unsigned + integer number. This excludes floating-point and signed integer values. + + @return `true` if type is an unsigned integer number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_unsigned()` for all + JSON types.,is_number_unsigned} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 2.0.0 + */ + constexpr bool is_number_unsigned() const noexcept + { + return m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is a floating-point number + + This function returns true if and only if the JSON value is a + floating-point number. This excludes signed and unsigned integer values. + + @return `true` if type is a floating-point number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_float()` for all + JSON types.,is_number_float} + + @sa @ref is_number() -- check if value is number + @sa @ref is_number_integer() -- check if value is an integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + + @since version 1.0.0 + */ + constexpr bool is_number_float() const noexcept + { + return m_type == value_t::number_float; + } + + /*! + @brief return whether value is an object + + This function returns true if and only if the JSON value is an object. + + @return `true` if type is object, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_object()` for all JSON + types.,is_object} + + @since version 1.0.0 + */ + constexpr bool is_object() const noexcept + { + return m_type == value_t::object; + } + + /*! + @brief return whether value is an array + + This function returns true if and only if the JSON value is an array. + + @return `true` if type is array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_array()` for all JSON + types.,is_array} + + @since version 1.0.0 + */ + constexpr bool is_array() const noexcept + { + return m_type == value_t::array; + } + + /*! + @brief return whether value is a string + + This function returns true if and only if the JSON value is a string. + + @return `true` if type is string, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_string()` for all JSON + types.,is_string} + + @since version 1.0.0 + */ + constexpr bool is_string() const noexcept + { + return m_type == value_t::string; + } + + /*! + @brief return whether value is a binary array + + This function returns true if and only if the JSON value is a binary array. + + @return `true` if type is binary array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_binary()` for all JSON + types.,is_binary} + + @since version 3.8.0 + */ + constexpr bool is_binary() const noexcept + { + return m_type == value_t::binary; + } + + /*! + @brief return whether value is discarded + + This function returns true if and only if the JSON value was discarded + during parsing with a callback function (see @ref parser_callback_t). + + @note This function will always be `false` for JSON values after parsing. + That is, discarded values can only occur during parsing, but will be + removed when inside a structured value or replaced by null in other cases. + + @return `true` if type is discarded, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_discarded()` for all JSON + types.,is_discarded} + + @since version 1.0.0 + */ + constexpr bool is_discarded() const noexcept + { + return m_type == value_t::discarded; + } + + /*! + @brief return the type of the JSON value (implicit) + + Implicitly return the type of the JSON value as a value from the @ref + value_t enumeration. + + @return the type of the JSON value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies the @ref value_t operator for + all JSON types.,operator__value_t} + + @sa @ref type() -- return the type of the JSON value (explicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr operator value_t() const noexcept + { + return m_type; + } + + /// @} + + private: + ////////////////// + // value access // + ////////////////// + + /// get a boolean (explicit) + boolean_t get_impl(boolean_t* /*unused*/) const + { + if (JSON_HEDLEY_LIKELY(is_boolean())) + { + return m_value.boolean; + } + + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(type_name()))); + } + + /// get a pointer to the value (object) + object_t* get_impl_ptr(object_t* /*unused*/) noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (object) + constexpr const object_t* get_impl_ptr(const object_t* /*unused*/) const noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (array) + array_t* get_impl_ptr(array_t* /*unused*/) noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (array) + constexpr const array_t* get_impl_ptr(const array_t* /*unused*/) const noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (string) + string_t* get_impl_ptr(string_t* /*unused*/) noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (string) + constexpr const string_t* get_impl_ptr(const string_t* /*unused*/) const noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (boolean) + boolean_t* get_impl_ptr(boolean_t* /*unused*/) noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (boolean) + constexpr const boolean_t* get_impl_ptr(const boolean_t* /*unused*/) const noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (integer number) + number_integer_t* get_impl_ptr(number_integer_t* /*unused*/) noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (integer number) + constexpr const number_integer_t* get_impl_ptr(const number_integer_t* /*unused*/) const noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (unsigned number) + number_unsigned_t* get_impl_ptr(number_unsigned_t* /*unused*/) noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (unsigned number) + constexpr const number_unsigned_t* get_impl_ptr(const number_unsigned_t* /*unused*/) const noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (floating-point number) + number_float_t* get_impl_ptr(number_float_t* /*unused*/) noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (floating-point number) + constexpr const number_float_t* get_impl_ptr(const number_float_t* /*unused*/) const noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (binary) + binary_t* get_impl_ptr(binary_t* /*unused*/) noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /// get a pointer to the value (binary) + constexpr const binary_t* get_impl_ptr(const binary_t* /*unused*/) const noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /*! + @brief helper function to implement get_ref() + + This function helps to implement get_ref() without code duplication for + const and non-const overloads + + @tparam ThisType will be deduced as `basic_json` or `const basic_json` + + @throw type_error.303 if ReferenceType does not match underlying value + type of the current JSON + */ + template + static ReferenceType get_ref_impl(ThisType& obj) + { + // delegate the call to get_ptr<>() + auto ptr = obj.template get_ptr::type>(); + + if (JSON_HEDLEY_LIKELY(ptr != nullptr)) + { + return *ptr; + } + + JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name()))); + } + + public: + /// @name value access + /// Direct access to the stored value of a JSON value. + /// @{ + + /*! + @brief get special-case overload + + This overloads avoids a lot of template boilerplate, it can be seen as the + identity method + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this + + @complexity Constant. + + @since version 2.1.0 + */ + template::type, basic_json_t>::value, + int> = 0> + basic_json get() const + { + return *this; + } + + /*! + @brief get special-case overload + + This overloads converts the current @ref basic_json in a different + @ref basic_json type + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this, converted into @tparam BasicJsonType + + @complexity Depending on the implementation of the called `from_json()` + method. + + @since version 3.2.0 + */ + template < typename BasicJsonType, detail::enable_if_t < + !std::is_same::value&& + detail::is_basic_json::value, int > = 0 > + BasicJsonType get() const + { + return *this; + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value + which is [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType ret; + JSONSerializer::from_json(*this, ret); + return ret; + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + - @ref json_serializer does not have a `from_json()` method of + the form `ValueType from_json(const basic_json&)` + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,get__ValueType_const} + + @since version 2.1.0 + */ + template < typename ValueTypeCV, typename ValueType = detail::uncvref_t, + detail::enable_if_t < + !detail::is_basic_json::value && + detail::has_from_json::value && + !detail::has_non_default_from_json::value, + int > = 0 > + ValueType get() const noexcept(noexcept( + JSONSerializer::from_json(std::declval(), std::declval()))) + { + // we cannot static_assert on ValueTypeCV being non-const, because + // there is support for get(), which is why we + // still need the uncvref + static_assert(!std::is_reference::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + static_assert(std::is_default_constructible::value, + "types must be DefaultConstructible when used with get()"); + + ValueType ret; + JSONSerializer::from_json(*this, ret); + return ret; + } + + /*! + @brief get a value (explicit); special case + + Explicit type conversion between the JSON value and a compatible value + which is **not** [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and **not** [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + return JSONSerializer::from_json(*this); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json and + - @ref json_serializer has a `from_json()` method of the form + `ValueType from_json(const basic_json&)` + + @note If @ref json_serializer has both overloads of + `from_json()`, this one is chosen. + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer `from_json()` method throws + + @since version 2.1.0 + */ + template < typename ValueTypeCV, typename ValueType = detail::uncvref_t, + detail::enable_if_t < !std::is_same::value && + detail::has_non_default_from_json::value, + int > = 0 > + ValueType get() const noexcept(noexcept( + JSONSerializer::from_json(std::declval()))) + { + static_assert(!std::is_reference::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + return JSONSerializer::from_json(*this); + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value. + The value is filled into the input parameter by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType v; + JSONSerializer::from_json(*this, v); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + + @tparam ValueType the input parameter type. + + @return the input parameter, allowing chaining calls. + + @throw what @ref json_serializer `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,get_to} + + @since version 3.3.0 + */ + template < typename ValueType, + detail::enable_if_t < + !detail::is_basic_json::value&& + detail::has_from_json::value, + int > = 0 > + ValueType & get_to(ValueType& v) const noexcept(noexcept( + JSONSerializer::from_json(std::declval(), v))) + { + JSONSerializer::from_json(*this, v); + return v; + } + + // specialization to allow to call get_to with a basic_json value + // see https://github.com/nlohmann/json/issues/2175 + template::value, + int> = 0> + ValueType & get_to(ValueType& v) const + { + v = *this; + return v; + } + + template < + typename T, std::size_t N, + typename Array = T (&)[N], + detail::enable_if_t < + detail::has_from_json::value, int > = 0 > + Array get_to(T (&v)[N]) const + noexcept(noexcept(JSONSerializer::from_json( + std::declval(), v))) + { + JSONSerializer::from_json(*this, v); + return v; + } + + + /*! + @brief get a pointer value (implicit) + + Implicit pointer access to the internally stored JSON value. No copies are + made. + + @warning Writing data to the pointee of the result yields an undefined + state. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. Enforced by a static + assertion. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get_ptr} + + @since version 1.0.0 + */ + template::value, int>::type = 0> + auto get_ptr() noexcept -> decltype(std::declval().get_impl_ptr(std::declval())) + { + // delegate the call to get_impl_ptr<>() + return get_impl_ptr(static_cast(nullptr)); + } + + /*! + @brief get a pointer value (implicit) + @copydoc get_ptr() + */ + template < typename PointerType, typename std::enable_if < + std::is_pointer::value&& + std::is_const::type>::value, int >::type = 0 > + constexpr auto get_ptr() const noexcept -> decltype(std::declval().get_impl_ptr(std::declval())) + { + // delegate the call to get_impl_ptr<>() const + return get_impl_ptr(static_cast(nullptr)); + } + + /*! + @brief get a pointer value (explicit) + + Explicit pointer access to the internally stored JSON value. No copies are + made. + + @warning The pointer becomes invalid if the underlying JSON object + changes. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get__PointerType} + + @sa @ref get_ptr() for explicit pointer-member access + + @since version 1.0.0 + */ + template::value, int>::type = 0> + auto get() noexcept -> decltype(std::declval().template get_ptr()) + { + // delegate the call to get_ptr + return get_ptr(); + } + + /*! + @brief get a pointer value (explicit) + @copydoc get() + */ + template::value, int>::type = 0> + constexpr auto get() const noexcept -> decltype(std::declval().template get_ptr()) + { + // delegate the call to get_ptr + return get_ptr(); + } + + /*! + @brief get a reference value (implicit) + + Implicit reference access to the internally stored JSON value. No copies + are made. + + @warning Writing data to the referee of the result yields an undefined + state. + + @tparam ReferenceType reference type; must be a reference to @ref array_t, + @ref object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, or + @ref number_float_t. Enforced by static assertion. + + @return reference to the internally stored JSON value if the requested + reference type @a ReferenceType fits to the JSON value; throws + type_error.303 otherwise + + @throw type_error.303 in case passed type @a ReferenceType is incompatible + with the stored JSON value; see example below + + @complexity Constant. + + @liveexample{The example shows several calls to `get_ref()`.,get_ref} + + @since version 1.1.0 + */ + template::value, int>::type = 0> + ReferenceType get_ref() + { + // delegate call to get_ref_impl + return get_ref_impl(*this); + } + + /*! + @brief get a reference value (implicit) + @copydoc get_ref() + */ + template < typename ReferenceType, typename std::enable_if < + std::is_reference::value&& + std::is_const::type>::value, int >::type = 0 > + ReferenceType get_ref() const + { + // delegate call to get_ref_impl + return get_ref_impl(*this); + } + + /*! + @brief get a value (implicit) + + Implicit type conversion between the JSON value and a compatible value. + The call is realized by calling @ref get() const. + + @tparam ValueType non-pointer type compatible to the JSON value, for + instance `int` for JSON integer numbers, `bool` for JSON booleans, or + `std::vector` types for JSON arrays. The character type of @ref string_t + as well as an initializer list of this type is excluded to avoid + ambiguities as these types implicitly convert to `std::string`. + + @return copy of the JSON value, converted to type @a ValueType + + @throw type_error.302 in case passed type @a ValueType is incompatible + to the JSON value type (e.g., the JSON value is of type boolean, but a + string is requested); see example below + + @complexity Linear in the size of the JSON value. + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,operator__ValueType} + + @since version 1.0.0 + */ + template < typename ValueType, typename std::enable_if < + !std::is_pointer::value&& + !std::is_same>::value&& + !std::is_same::value&& + !detail::is_basic_json::value + && !std::is_same>::value +#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) + && !std::is_same::value +#endif + && detail::is_detected::value + , int >::type = 0 > + JSON_EXPLICIT operator ValueType() const + { + // delegate the call to get<>() const + return get(); + } + + /*! + @return reference to the binary value + + @throw type_error.302 if the value is not binary + + @sa @ref is_binary() to check if the value is binary + + @since version 3.8.0 + */ + binary_t& get_binary() + { + if (!is_binary()) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()))); + } + + return *get_ptr(); + } + + /// @copydoc get_binary() + const binary_t& get_binary() const + { + if (!is_binary()) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()))); + } + + return *get_ptr(); + } + + /// @} + + + //////////////////// + // element access // + //////////////////// + + /// @name element access + /// Access to the JSON value. + /// @{ + + /*! + @brief access specified array element with bounds checking + + Returns a reference to the element at specified location @a idx, with + bounds checking. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__size_type} + */ + reference at(size_type idx) + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element with bounds checking + + Returns a const reference to the element at specified location @a idx, + with bounds checking. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__size_type_const} + */ + const_reference at(size_type idx) const + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a reference to the element at with specified key @a key, with + bounds checking. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__object_t_key_type} + */ + reference at(const typename object_t::key_type& key) + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a const reference to the element at with specified key @a key, + with bounds checking. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__object_t_key_type_const} + */ + const_reference at(const typename object_t::key_type& key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element + + Returns a reference to the element at specified location @a idx. + + @note If @a idx is beyond the range of the array (i.e., `idx >= size()`), + then the array is silently filled up with `null` values to make `idx` a + valid reference to the last stored element. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array or null; in that + cases, using the [] operator with an index makes no sense. + + @complexity Constant if @a idx is in the range of the array. Otherwise + linear in `idx - size()`. + + @liveexample{The example below shows how array elements can be read and + written using `[]` operator. Note the addition of `null` + values.,operatorarray__size_type} + + @since version 1.0.0 + */ + reference operator[](size_type idx) + { + // implicitly convert null value to an empty array + if (is_null()) + { + m_type = value_t::array; + m_value.array = create(); + assert_invariant(); + } + + // operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // fill up array with null values if given idx is outside range + if (idx >= m_value.array->size()) + { + m_value.array->insert(m_value.array->end(), + idx - m_value.array->size() + 1, + basic_json()); + } + + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified array element + + Returns a const reference to the element at specified location @a idx. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array; in that case, + using the [] operator with an index makes no sense. + + @complexity Constant. + + @liveexample{The example below shows how array elements can be read using + the `[]` operator.,operatorarray__size_type_const} + + @since version 1.0.0 + */ + const_reference operator[](size_type idx) const + { + // const operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + reference operator[](const typename object_t::key_type& key) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + // operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + const_reference operator[](const typename object_t::key_type& key) const + { + // const operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_ASSERT(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + reference operator[](T* key) + { + // implicitly convert null to object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + const_reference operator[](T* key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_ASSERT(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(key); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const typename object_t::key_type&), this function + does not throw if the given key @a key was not found. + + @note Unlike @ref operator[](const typename object_t::key_type& key), this + function does not implicitly add an element to the position defined by @a + key. This function is furthermore also applicable to const objects. + + @param[in] key key of the element to access + @param[in] default_value the value to return if @a key is not found + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a key + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + + @since version 1.0.0 + */ + // using std::is_convertible in a std::enable_if will fail when using explicit conversions + template < class ValueType, typename std::enable_if < + detail::is_getable::value + && !std::is_same::value, int >::type = 0 > + ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if key is found, return value and given default value otherwise + const auto it = find(key); + if (it != end()) + { + return it->template get(); + } + + return default_value; + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const + */ + string_t value(const typename object_t::key_type& key, const char* default_value) const + { + return value(key, string_t(default_value)); + } + + /*! + @brief access specified object element via JSON Pointer with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(ptr); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const json_pointer&), this function does not throw + if the given key @a key was not found. + + @param[in] ptr a JSON pointer to the element to access + @param[in] default_value the value to return if @a ptr found no value + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a ptr + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value_ptr} + + @sa @ref operator[](const json_pointer&) for unchecked access by reference + + @since version 2.0.2 + */ + template::value, int>::type = 0> + ValueType value(const json_pointer& ptr, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if pointer resolves a value, return it or use default value + JSON_TRY + { + return ptr.get_checked(this).template get(); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + return default_value; + } + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const json_pointer&, ValueType) const + */ + JSON_HEDLEY_NON_NULL(3) + string_t value(const json_pointer& ptr, const char* default_value) const + { + return value(ptr, string_t(default_value)); + } + + /*! + @brief access the first element + + Returns a reference to the first element in the container. For a JSON + container `c`, the expression `c.front()` is equivalent to `*c.begin()`. + + @return In case of a structured type (array or object), a reference to the + first element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on `null` value + + @liveexample{The following code shows an example for `front()`.,front} + + @sa @ref back() -- access the last element + + @since version 1.0.0 + */ + reference front() + { + return *begin(); + } + + /*! + @copydoc basic_json::front() + */ + const_reference front() const + { + return *cbegin(); + } + + /*! + @brief access the last element + + Returns a reference to the last element in the container. For a JSON + container `c`, the expression `c.back()` is equivalent to + @code {.cpp} + auto tmp = c.end(); + --tmp; + return *tmp; + @endcode + + @return In case of a structured type (array or object), a reference to the + last element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on a `null` value. See example + below. + + @liveexample{The following code shows an example for `back()`.,back} + + @sa @ref front() -- access the first element + + @since version 1.0.0 + */ + reference back() + { + auto tmp = end(); + --tmp; + return *tmp; + } + + /*! + @copydoc basic_json::back() + */ + const_reference back() const + { + auto tmp = cend(); + --tmp; + return *tmp; + } + + /*! + @brief remove element given an iterator + + Removes the element specified by iterator @a pos. The iterator @a pos must + be valid and dereferenceable. Thus the `end()` iterator (which is valid, + but is not dereferenceable) cannot be used as a value for @a pos. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] pos iterator to the element to remove + @return Iterator following the last removed element. If the iterator @a + pos refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.202 if called on an iterator which does not belong + to the current JSON value; example: `"iterator does not fit current + value"` + @throw invalid_iterator.205 if called on a primitive type with invalid + iterator (i.e., any iterator which is not `begin()`); example: `"iterator + out of range"` + + @complexity The complexity depends on the type: + - objects: amortized constant + - arrays: linear in distance between @a pos and the end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType} + + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template < class IteratorType, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type + = 0 > + IteratorType erase(IteratorType pos) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_UNLIKELY(!pos.m_it.primitive_iterator.is_begin())) + { + JSON_THROW(invalid_iterator::create(205, "iterator out of range")); + } + + if (is_string()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.binary); + std::allocator_traits::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(pos.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(pos.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove elements given an iterator range + + Removes the element specified by the range `[first; last)`. The iterator + @a first does not need to be dereferenceable if `first == last`: erasing + an empty range is a no-op. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] first iterator to the beginning of the range to remove + @param[in] last iterator past the end of the range to remove + @return Iterator following the last removed element. If the iterator @a + second refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.203 if called on iterators which does not belong + to the current JSON value; example: `"iterators do not fit current value"` + @throw invalid_iterator.204 if called on a primitive type with invalid + iterators (i.e., if `first != begin()` and `last != end()`); example: + `"iterators out of range"` + + @complexity The complexity depends on the type: + - objects: `log(size()) + std::distance(first, last)` + - arrays: linear in the distance between @a first and @a last, plus linear + in the distance between @a last and end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType_IteratorType} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template < class IteratorType, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type + = 0 > + IteratorType erase(IteratorType first, IteratorType last) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != first.m_object || this != last.m_object)) + { + JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_LIKELY(!first.m_it.primitive_iterator.is_begin() + || !last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + + if (is_string()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.binary); + std::allocator_traits::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove element from a JSON object given a key + + Removes elements from a JSON object with the key value @a key. + + @param[in] key value of the elements to remove + + @return Number of elements removed. If @a ObjectType is the default + `std::map` type, the return value will always be `0` (@a key was not + found) or `1` (@a key was found). + + @post References and iterators to the erased elements are invalidated. + Other references and iterators are not affected. + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + + @complexity `log(size()) + count(key)` + + @liveexample{The example shows the effect of `erase()`.,erase__key_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + size_type erase(const typename object_t::key_type& key) + { + // this erase only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->erase(key); + } + + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + /*! + @brief remove element from a JSON array given an index + + Removes element from a JSON array at the index @a idx. + + @param[in] idx index of the element to remove + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + @throw out_of_range.401 when `idx >= size()`; example: `"array index 17 + is out of range"` + + @complexity Linear in distance between @a idx and the end of the container. + + @liveexample{The example shows the effect of `erase()`.,erase__size_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + + @since version 1.0.0 + */ + void erase(const size_type idx) + { + // this erase only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + if (JSON_HEDLEY_UNLIKELY(idx >= size())) + { + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + m_value.array->erase(m_value.array->begin() + static_cast(idx)); + } + else + { + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + } + + /// @} + + + //////////// + // lookup // + //////////// + + /// @name lookup + /// @{ + + /*! + @brief find an element in a JSON object + + Finds an element in a JSON object with key equivalent to @a key. If the + element is not found or the JSON value is not an object, end() is + returned. + + @note This method always returns @ref end() when executed on a JSON type + that is not an object. + + @param[in] key key value of the element to search for. + + @return Iterator to an element with key equivalent to @a key. If no such + element is found or the JSON value is not an object, past-the-end (see + @ref end()) iterator is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `find()` is used.,find__key_type} + + @sa @ref contains(KeyT&&) const -- checks whether a key exists + + @since version 1.0.0 + */ + template + iterator find(KeyT&& key) + { + auto result = end(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward(key)); + } + + return result; + } + + /*! + @brief find an element in a JSON object + @copydoc find(KeyT&&) + */ + template + const_iterator find(KeyT&& key) const + { + auto result = cend(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward(key)); + } + + return result; + } + + /*! + @brief returns the number of occurrences of a key in a JSON object + + Returns the number of elements with key @a key. If ObjectType is the + default `std::map` type, the return value will always be `0` (@a key was + not found) or `1` (@a key was found). + + @note This method always returns `0` when executed on a JSON type that is + not an object. + + @param[in] key key value of the element to count + + @return Number of elements with key @a key. If the JSON value is not an + object, the return value will be `0`. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `count()` is used.,count} + + @since version 1.0.0 + */ + template + size_type count(KeyT&& key) const + { + // return 0 for all nonobject types + return is_object() ? m_value.object->count(std::forward(key)) : 0; + } + + /*! + @brief check the existence of an element in a JSON object + + Check whether an element exists in a JSON object with key equivalent to + @a key. If the element is not found or the JSON value is not an object, + false is returned. + + @note This method always returns false when executed on a JSON type + that is not an object. + + @param[in] key key value to check its existence. + + @return true if an element with specified @a key exists. If no such + element with such key is found or the JSON value is not an object, + false is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains} + + @sa @ref find(KeyT&&) -- returns an iterator to an object element + @sa @ref contains(const json_pointer&) const -- checks the existence for a JSON pointer + + @since version 3.6.0 + */ + template < typename KeyT, typename std::enable_if < + !std::is_same::type, json_pointer>::value, int >::type = 0 > + bool contains(KeyT && key) const + { + return is_object() && m_value.object->find(std::forward(key)) != m_value.object->end(); + } + + /*! + @brief check the existence of an element in a JSON object given a JSON pointer + + Check whether the given JSON pointer @a ptr can be resolved in the current + JSON value. + + @note This method can be executed on any JSON value type. + + @param[in] ptr JSON pointer to check its existence. + + @return true if the JSON pointer can be resolved to a stored value, false + otherwise. + + @post If `j.contains(ptr)` returns true, it is safe to call `j[ptr]`. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains_json_pointer} + + @sa @ref contains(KeyT &&) const -- checks the existence of a key + + @since version 3.7.0 + */ + bool contains(const json_pointer& ptr) const + { + return ptr.contains(this); + } + + /// @} + + + /////////////// + // iterators // + /////////////// + + /// @name iterators + /// @{ + + /*! + @brief returns an iterator to the first element + + Returns an iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `begin()`.,begin} + + @sa @ref cbegin() -- returns a const iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + iterator begin() noexcept + { + iterator result(this); + result.set_begin(); + return result; + } + + /*! + @copydoc basic_json::cbegin() + */ + const_iterator begin() const noexcept + { + return cbegin(); + } + + /*! + @brief returns a const iterator to the first element + + Returns a const iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).begin()`. + + @liveexample{The following code shows an example for `cbegin()`.,cbegin} + + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + const_iterator cbegin() const noexcept + { + const_iterator result(this); + result.set_begin(); + return result; + } + + /*! + @brief returns an iterator to one past the last element + + Returns an iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `end()`.,end} + + @sa @ref cend() -- returns a const iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + iterator end() noexcept + { + iterator result(this); + result.set_end(); + return result; + } + + /*! + @copydoc basic_json::cend() + */ + const_iterator end() const noexcept + { + return cend(); + } + + /*! + @brief returns a const iterator to one past the last element + + Returns a const iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).end()`. + + @liveexample{The following code shows an example for `cend()`.,cend} + + @sa @ref end() -- returns an iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + const_iterator cend() const noexcept + { + const_iterator result(this); + result.set_end(); + return result; + } + + /*! + @brief returns an iterator to the reverse-beginning + + Returns an iterator to the reverse-beginning; that is, the last element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(end())`. + + @liveexample{The following code shows an example for `rbegin()`.,rbegin} + + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + reverse_iterator rbegin() noexcept + { + return reverse_iterator(end()); + } + + /*! + @copydoc basic_json::crbegin() + */ + const_reverse_iterator rbegin() const noexcept + { + return crbegin(); + } + + /*! + @brief returns an iterator to the reverse-end + + Returns an iterator to the reverse-end; that is, one before the first + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(begin())`. + + @liveexample{The following code shows an example for `rend()`.,rend} + + @sa @ref crend() -- returns a const reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + reverse_iterator rend() noexcept + { + return reverse_iterator(begin()); + } + + /*! + @copydoc basic_json::crend() + */ + const_reverse_iterator rend() const noexcept + { + return crend(); + } + + /*! + @brief returns a const reverse iterator to the last element + + Returns a const iterator to the reverse-beginning; that is, the last + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).rbegin()`. + + @liveexample{The following code shows an example for `crbegin()`.,crbegin} + + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + const_reverse_iterator crbegin() const noexcept + { + return const_reverse_iterator(cend()); + } + + /*! + @brief returns a const reverse iterator to one before the first + + Returns a const reverse iterator to the reverse-end; that is, one before + the first element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).rend()`. + + @liveexample{The following code shows an example for `crend()`.,crend} + + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + const_reverse_iterator crend() const noexcept + { + return const_reverse_iterator(cbegin()); + } + + public: + /*! + @brief wrapper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without iterator_wrapper: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without iterator proxy: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with iterator proxy: + + @code{cpp} + for (auto it : json::iterator_wrapper(j_object)) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). + + @param[in] ref reference to a JSON value + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the wrapper is used,iterator_wrapper} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @note The name of this function is not yet final and may change in the + future. + + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use @ref items() instead; + that is, replace `json::iterator_wrapper(j)` with `j.items()`. + */ + JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) + static iteration_proxy iterator_wrapper(reference ref) noexcept + { + return ref.items(); + } + + /*! + @copydoc iterator_wrapper(reference) + */ + JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) + static iteration_proxy iterator_wrapper(const_reference ref) noexcept + { + return ref.items(); + } + + /*! + @brief helper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without `items()` function: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without `items()` function: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with `items()` function: + + @code{cpp} + for (auto& el : j_object.items()) + { + std::cout << "key: " << el.key() << ", value:" << el.value() << '\n'; + } + @endcode + + The `items()` function also allows to use + [structured bindings](https://en.cppreference.com/w/cpp/language/structured_binding) + (C++17): + + @code{cpp} + for (auto& [key, val] : j_object.items()) + { + std::cout << "key: " << key << ", value:" << val << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). For primitive types (e.g., numbers), + `key()` returns an empty string. + + @warning Using `items()` on temporary objects is dangerous. Make sure the + object's lifetime exeeds the iteration. See + for more + information. + + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the function is used.,items} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 3.1.0, structured bindings support since 3.5.0. + */ + iteration_proxy items() noexcept + { + return iteration_proxy(*this); + } + + /*! + @copydoc items() + */ + iteration_proxy items() const noexcept + { + return iteration_proxy(*this); + } + + /// @} + + + ////////////// + // capacity // + ////////////// + + /// @name capacity + /// @{ + + /*! + @brief checks whether the container is empty. + + Checks if a JSON value has no elements (i.e. whether its @ref size is `0`). + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `true` + boolean | `false` + string | `false` + number | `false` + binary | `false` + object | result of function `object_t::empty()` + array | result of function `array_t::empty()` + + @liveexample{The following code uses `empty()` to check if a JSON + object contains any elements.,empty} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `empty()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return whether a string stored as JSON value + is empty - it returns whether the JSON container itself is empty which is + false in the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `begin() == end()`. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + bool empty() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return true; + } + + case value_t::array: + { + // delegate call to array_t::empty() + return m_value.array->empty(); + } + + case value_t::object: + { + // delegate call to object_t::empty() + return m_value.object->empty(); + } + + default: + { + // all other types are nonempty + return false; + } + } + } + + /*! + @brief returns the number of elements + + Returns the number of elements in a JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` + boolean | `1` + string | `1` + number | `1` + binary | `1` + object | result of function object_t::size() + array | result of function array_t::size() + + @liveexample{The following code calls `size()` on the different value + types.,size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their size() functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return the length of a string stored as JSON + value - it returns the number of elements in the JSON value which is 1 in + the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `std::distance(begin(), end())`. + + @sa @ref empty() -- checks whether the container is empty + @sa @ref max_size() -- returns the maximal number of elements + + @since version 1.0.0 + */ + size_type size() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return 0; + } + + case value_t::array: + { + // delegate call to array_t::size() + return m_value.array->size(); + } + + case value_t::object: + { + // delegate call to object_t::size() + return m_value.object->size(); + } + + default: + { + // all other types have size 1 + return 1; + } + } + } + + /*! + @brief returns the maximum possible number of elements + + Returns the maximum number of elements a JSON value is able to hold due to + system or library implementation limitations, i.e. `std::distance(begin(), + end())` for the JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` (same as `size()`) + boolean | `1` (same as `size()`) + string | `1` (same as `size()`) + number | `1` (same as `size()`) + binary | `1` (same as `size()`) + object | result of function `object_t::max_size()` + array | result of function `array_t::max_size()` + + @liveexample{The following code calls `max_size()` on the different value + types. Note the output is implementation specific.,max_size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `max_size()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of returning `b.size()` where `b` is the largest + possible JSON value. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + size_type max_size() const noexcept + { + switch (m_type) + { + case value_t::array: + { + // delegate call to array_t::max_size() + return m_value.array->max_size(); + } + + case value_t::object: + { + // delegate call to object_t::max_size() + return m_value.object->max_size(); + } + + default: + { + // all other types have max_size() == size() + return size(); + } + } + } + + /// @} + + + /////////////// + // modifiers // + /////////////// + + /// @name modifiers + /// @{ + + /*! + @brief clears the contents + + Clears the content of a JSON value and resets it to the default value as + if @ref basic_json(value_t) would have been called with the current value + type from @ref type(): + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + binary | An empty byte vector + object | `{}` + array | `[]` + + @post Has the same effect as calling + @code {.cpp} + *this = basic_json(type()); + @endcode + + @liveexample{The example below shows the effect of `clear()` to different + JSON types.,clear} + + @complexity Linear in the size of the JSON value. + + @iterators All iterators, pointers and references related to this container + are invalidated. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @sa @ref basic_json(value_t) -- constructor that creates an object with the + same value than calling `clear()` + + @since version 1.0.0 + */ + void clear() noexcept + { + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = 0; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = 0; + break; + } + + case value_t::number_float: + { + m_value.number_float = 0.0; + break; + } + + case value_t::boolean: + { + m_value.boolean = false; + break; + } + + case value_t::string: + { + m_value.string->clear(); + break; + } + + case value_t::binary: + { + m_value.binary->clear(); + break; + } + + case value_t::array: + { + m_value.array->clear(); + break; + } + + case value_t::object: + { + m_value.object->clear(); + break; + } + + default: + break; + } + } + + /*! + @brief add an object to an array + + Appends the given element @a val to the end of the JSON value. If the + function is called on a JSON null value, an empty array is created before + appending @a val. + + @param[in] val the value to add to the JSON array + + @throw type_error.308 when called on a type other than JSON array or + null; example: `"cannot use push_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON array. Note how the `null` value was silently + converted to a JSON array.,push_back} + + @since version 1.0.0 + */ + void push_back(basic_json&& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (move semantics) + m_value.array->push_back(std::move(val)); + // if val is moved from, basic_json move constructor marks it null so we do not call the destructor + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(basic_json&& val) + { + push_back(std::move(val)); + return *this; + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + void push_back(const basic_json& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array + m_value.array->push_back(val); + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(const basic_json& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + Inserts the given element @a val to the JSON object. If the function is + called on a JSON null value, an empty object is created before inserting + @a val. + + @param[in] val the value to add to the JSON object + + @throw type_error.308 when called on a type other than JSON object or + null; example: `"cannot use push_back() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON object. Note how the `null` value was silently + converted to a JSON object.,push_back__object_t__value} + + @since version 1.0.0 + */ + void push_back(const typename object_t::value_type& val) + { + // push_back only works for null objects or objects + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_object()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array + m_value.object->insert(val); + } + + /*! + @brief add an object to an object + @copydoc push_back(const typename object_t::value_type&) + */ + reference operator+=(const typename object_t::value_type& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + This function allows to use `push_back` with an initializer list. In case + + 1. the current value is an object, + 2. the initializer list @a init contains only two elements, and + 3. the first element of @a init is a string, + + @a init is converted into an object element and added using + @ref push_back(const typename object_t::value_type&). Otherwise, @a init + is converted to a JSON value and added using @ref push_back(basic_json&&). + + @param[in] init an initializer list + + @complexity Linear in the size of the initializer list @a init. + + @note This function is required to resolve an ambiguous overload error, + because pairs like `{"key", "value"}` can be both interpreted as + `object_t::value_type` or `std::initializer_list`, see + https://github.com/nlohmann/json/issues/235 for more information. + + @liveexample{The example shows how initializer lists are treated as + objects when possible.,push_back__initializer_list} + */ + void push_back(initializer_list_t init) + { + if (is_object() && init.size() == 2 && (*init.begin())->is_string()) + { + basic_json&& key = init.begin()->moved_or_copied(); + push_back(typename object_t::value_type( + std::move(key.get_ref()), (init.begin() + 1)->moved_or_copied())); + } + else + { + push_back(basic_json(init)); + } + } + + /*! + @brief add an object to an object + @copydoc push_back(initializer_list_t) + */ + reference operator+=(initializer_list_t init) + { + push_back(init); + return *this; + } + + /*! + @brief add an object to an array + + Creates a JSON value from the passed parameters @a args to the end of the + JSON value. If the function is called on a JSON null value, an empty array + is created before appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return reference to the inserted element + + @throw type_error.311 when called on a type other than JSON array or + null; example: `"cannot use emplace_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` can be used to add + elements to a JSON array. Note how the `null` value was silently converted + to a JSON array.,emplace_back} + + @since version 2.0.8, returns reference since 3.7.0 + */ + template + reference emplace_back(Args&& ... args) + { + // emplace_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (perfect forwarding) +#ifdef JSON_HAS_CPP_17 + return m_value.array->emplace_back(std::forward(args)...); +#else + m_value.array->emplace_back(std::forward(args)...); + return m_value.array->back(); +#endif + } + + /*! + @brief add an object to an object if key does not exist + + Inserts a new element into a JSON object constructed in-place with the + given @a args if there is no element with the key in the container. If the + function is called on a JSON null value, an empty object is created before + appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return a pair consisting of an iterator to the inserted element, or the + already-existing element if no insertion happened, and a bool + denoting whether the insertion took place. + + @throw type_error.311 when called on a type other than JSON object or + null; example: `"cannot use emplace() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `emplace()` can be used to add elements + to a JSON object. Note how the `null` value was silently converted to a + JSON object. Further note how no value is added if there was already one + value stored with the same key.,emplace} + + @since version 2.0.8 + */ + template + std::pair emplace(Args&& ... args) + { + // emplace only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_object()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array (perfect forwarding) + auto res = m_value.object->emplace(std::forward(args)...); + // create result iterator and set iterator to the result of emplace + auto it = begin(); + it.m_it.object_iterator = res.first; + + // return pair of iterator and boolean + return {it, res.second}; + } + + /// Helper for insertion of an iterator + /// @note: This uses std::distance to support GCC 4.8, + /// see https://github.com/nlohmann/json/pull/1257 + template + iterator insert_iterator(const_iterator pos, Args&& ... args) + { + iterator result(this); + JSON_ASSERT(m_value.array != nullptr); + + auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); + m_value.array->insert(pos.m_it.array_iterator, std::forward(args)...); + result.m_it.array_iterator = m_value.array->begin() + insert_pos; + + // This could have been written as: + // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); + // but the return value of insert is missing in GCC 4.8, so it is written this way instead. + + return result; + } + + /*! + @brief inserts element + + Inserts element @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] val element to insert + @return iterator pointing to the inserted @a val. + + @throw type_error.309 if called on JSON values other than arrays; + example: `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Constant plus linear in the distance between @a pos and end of + the container. + + @liveexample{The example shows how `insert()` is used.,insert} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts element + @copydoc insert(const_iterator, const basic_json&) + */ + iterator insert(const_iterator pos, basic_json&& val) + { + return insert(pos, val); + } + + /*! + @brief inserts elements + + Inserts @a cnt copies of @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] cnt number of copies of @a val to insert + @param[in] val element to insert + @return iterator pointing to the first element inserted, or @a pos if + `cnt==0` + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Linear in @a cnt plus linear in the distance between @a pos + and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__count} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, size_type cnt, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, cnt, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)` before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + @throw invalid_iterator.211 if @a first or @a last are iterators into + container for which insert is called; example: `"passed iterators may not + belong to container"` + + @return iterator pointing to the first element inserted, or @a pos if + `first==last` + + @complexity Linear in `std::distance(first, last)` plus linear in the + distance between @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__range} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const_iterator first, const_iterator last) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(!is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + if (JSON_HEDLEY_UNLIKELY(first.m_object == this)) + { + JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); + } + + // insert to array and return iterator + return insert_iterator(pos, first.m_it.array_iterator, last.m_it.array_iterator); + } + + /*! + @brief inserts elements + + Inserts elements from initializer list @a ilist before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] ilist initializer list to insert the values from + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @return iterator pointing to the first element inserted, or @a pos if + `ilist` is empty + + @complexity Linear in `ilist.size()` plus linear in the distance between + @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__ilist} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, initializer_list_t ilist) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(!is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, ilist.begin(), ilist.end()); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)`. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than objects; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity Logarithmic: `O(N*log(size() + N))`, where `N` is the number + of elements to insert. + + @liveexample{The example shows how `insert()` is used.,insert__range_object} + + @since version 3.0.0 + */ + void insert(const_iterator first, const_iterator last) + { + // insert only works for objects + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + m_value.object->insert(first.m_it.object_iterator, last.m_it.object_iterator); + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from JSON object @a j and overwrites existing keys. + + @param[in] j JSON object to read values from + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_reference j) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + if (JSON_HEDLEY_UNLIKELY(!j.is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); + } + + for (auto it = j.cbegin(); it != j.cend(); ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from from range `[first, last)` and overwrites existing + keys. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used__range.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_iterator first, const_iterator last) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object() + || !last.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + for (auto it = first; it != last; ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of the JSON value with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other JSON value to exchange the contents with + + @complexity Constant. + + @liveexample{The example below shows how JSON values can be swapped with + `swap()`.,swap__reference} + + @since version 1.0.0 + */ + void swap(reference other) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + std::swap(m_type, other.m_type); + std::swap(m_value, other.m_value); + assert_invariant(); + } + + /*! + @brief exchanges the values + + Exchanges the contents of the JSON value from @a left with those of @a right. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. implemented as a friend function callable via ADL. + + @param[in,out] left JSON value to exchange the contents with + @param[in,out] right JSON value to exchange the contents with + + @complexity Constant. + + @liveexample{The example below shows how JSON values can be swapped with + `swap()`.,swap__reference} + + @since version 1.0.0 + */ + friend void swap(reference left, reference right) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + left.swap(right); + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON array with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other array to exchange the contents with + + @throw type_error.310 when JSON value is not an array; example: `"cannot + use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how arrays can be swapped with + `swap()`.,swap__array_t} + + @since version 1.0.0 + */ + void swap(array_t& other) + { + // swap only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + std::swap(*(m_value.array), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON object with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other object to exchange the contents with + + @throw type_error.310 when JSON value is not an object; example: + `"cannot use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how objects can be swapped with + `swap()`.,swap__object_t} + + @since version 1.0.0 + */ + void swap(object_t& other) + { + // swap only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + std::swap(*(m_value.object), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON string with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other string to exchange the contents with + + @throw type_error.310 when JSON value is not a string; example: `"cannot + use swap() with boolean"` + + @complexity Constant. + + @liveexample{The example below shows how strings can be swapped with + `swap()`.,swap__string_t} + + @since version 1.0.0 + */ + void swap(string_t& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_string())) + { + std::swap(*(m_value.string), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON string with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other binary to exchange the contents with + + @throw type_error.310 when JSON value is not a string; example: `"cannot + use swap() with boolean"` + + @complexity Constant. + + @liveexample{The example below shows how strings can be swapped with + `swap()`.,swap__binary_t} + + @since version 3.8.0 + */ + void swap(binary_t& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_binary())) + { + std::swap(*(m_value.binary), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /// @copydoc swap(binary_t) + void swap(typename binary_t::container_type& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_binary())) + { + std::swap(*(m_value.binary), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /// @} + + public: + ////////////////////////////////////////// + // lexicographical comparison operators // + ////////////////////////////////////////// + + /// @name lexicographical comparison operators + /// @{ + + /*! + @brief comparison: equal + + Compares two JSON values for equality according to the following rules: + - Two JSON values are equal if (1) they are from the same type and (2) + their stored values are the same according to their respective + `operator==`. + - Integer and floating-point numbers are automatically converted before + comparison. Note that two NaN values are always treated as unequal. + - Two JSON null values are equal. + + @note Floating-point inside JSON values numbers are compared with + `json::number_float_t::operator==` which is `double::operator==` by + default. To compare floating-point while respecting an epsilon, an alternative + [comparison function](https://github.com/mariokonrad/marnav/blob/master/include/marnav/math/floatingpoint.hpp#L34-#L39) + could be used, for instance + @code {.cpp} + template::value, T>::type> + inline bool is_same(T a, T b, T epsilon = std::numeric_limits::epsilon()) noexcept + { + return std::abs(a - b) <= epsilon; + } + @endcode + Or you can self-defined operator equal function like this: + @code {.cpp} + bool my_equal(const_reference lhs, const_reference rhs) { + const auto lhs_type lhs.type(); + const auto rhs_type rhs.type(); + if (lhs_type == rhs_type) { + switch(lhs_type) + // self_defined case + case value_t::number_float: + return std::abs(lhs - rhs) <= std::numeric_limits::epsilon(); + // other cases remain the same with the original + ... + } + ... + } + @endcode + + @note NaN values never compare equal to themselves or to other NaN values. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are equal + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Linear. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__equal} + + @since version 1.0.0 + */ + friend bool operator==(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + return *lhs.m_value.array == *rhs.m_value.array; + + case value_t::object: + return *lhs.m_value.object == *rhs.m_value.object; + + case value_t::null: + return true; + + case value_t::string: + return *lhs.m_value.string == *rhs.m_value.string; + + case value_t::boolean: + return lhs.m_value.boolean == rhs.m_value.boolean; + + case value_t::number_integer: + return lhs.m_value.number_integer == rhs.m_value.number_integer; + + case value_t::number_unsigned: + return lhs.m_value.number_unsigned == rhs.m_value.number_unsigned; + + case value_t::number_float: + return lhs.m_value.number_float == rhs.m_value.number_float; + + case value_t::binary: + return *lhs.m_value.binary == *rhs.m_value.binary; + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_integer) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float == static_cast(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_unsigned) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float == static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer) + { + return static_cast(lhs.m_value.number_unsigned) == rhs.m_value.number_integer; + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer == static_cast(rhs.m_value.number_unsigned); + } + + return false; + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs == basic_json(rhs); + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) == rhs; + } + + /*! + @brief comparison: not equal + + Compares two JSON values for inequality by calculating `not (lhs == rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are not equal + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__notequal} + + @since version 1.0.0 + */ + friend bool operator!=(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs == rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator!=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs != basic_json(rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator!=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) != rhs; + } + + /*! + @brief comparison: less than + + Compares whether one JSON value @a lhs is less than another JSON value @a + rhs according to the following rules: + - If @a lhs and @a rhs have the same type, the values are compared using + the default `<` operator. + - Integer and floating-point numbers are automatically converted before + comparison + - In case @a lhs and @a rhs have different types, the values are ignored + and the order of the types is considered, see + @ref operator<(const value_t, const value_t). + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__less} + + @since version 1.0.0 + */ + friend bool operator<(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + // note parentheses are necessary, see + // https://github.com/nlohmann/json/issues/1530 + return (*lhs.m_value.array) < (*rhs.m_value.array); + + case value_t::object: + return (*lhs.m_value.object) < (*rhs.m_value.object); + + case value_t::null: + return false; + + case value_t::string: + return (*lhs.m_value.string) < (*rhs.m_value.string); + + case value_t::boolean: + return (lhs.m_value.boolean) < (rhs.m_value.boolean); + + case value_t::number_integer: + return (lhs.m_value.number_integer) < (rhs.m_value.number_integer); + + case value_t::number_unsigned: + return (lhs.m_value.number_unsigned) < (rhs.m_value.number_unsigned); + + case value_t::number_float: + return (lhs.m_value.number_float) < (rhs.m_value.number_float); + + case value_t::binary: + return (*lhs.m_value.binary) < (*rhs.m_value.binary); + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_integer) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float < static_cast(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_unsigned) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float < static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer < static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer) + { + return static_cast(lhs.m_value.number_unsigned) < rhs.m_value.number_integer; + } + + // We only reach this line if we cannot compare values. In that case, + // we compare types. Note we have to call the operator explicitly, + // because MSVC has problems otherwise. + return operator<(lhs_type, rhs_type); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs < basic_json(rhs); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) < rhs; + } + + /*! + @brief comparison: less than or equal + + Compares whether one JSON value @a lhs is less than or equal to another + JSON value by calculating `not (rhs < lhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greater} + + @since version 1.0.0 + */ + friend bool operator<=(const_reference lhs, const_reference rhs) noexcept + { + return !(rhs < lhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs <= basic_json(rhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) <= rhs; + } + + /*! + @brief comparison: greater than + + Compares whether one JSON value @a lhs is greater than another + JSON value by calculating `not (lhs <= rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__lessequal} + + @since version 1.0.0 + */ + friend bool operator>(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs <= rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs > basic_json(rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) > rhs; + } + + /*! + @brief comparison: greater than or equal + + Compares whether one JSON value @a lhs is greater than or equal to another + JSON value by calculating `not (lhs < rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greaterequal} + + @since version 1.0.0 + */ + friend bool operator>=(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs < rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs >= basic_json(rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) >= rhs; + } + + /// @} + + /////////////////// + // serialization // + /////////////////// + + /// @name serialization + /// @{ + + /*! + @brief serialize to stream + + Serialize the given JSON value @a j to the output stream @a o. The JSON + value will be serialized using the @ref dump member function. + + - The indentation of the output can be controlled with the member variable + `width` of the output stream @a o. For instance, using the manipulator + `std::setw(4)` on @a o sets the indentation level to `4` and the + serialization result is the same as calling `dump(4)`. + + - The indentation character can be controlled with the member variable + `fill` of the output stream @a o. For instance, the manipulator + `std::setfill('\\t')` sets indentation to use a tab character rather than + the default space character. + + @param[in,out] o stream to serialize to + @param[in] j JSON value to serialize + + @return the stream @a o + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded + + @complexity Linear. + + @liveexample{The example below shows the serialization with different + parameters to `width` to adjust the indentation level.,operator_serialize} + + @since version 1.0.0; indentation character added in version 3.0.0 + */ + friend std::ostream& operator<<(std::ostream& o, const basic_json& j) + { + // read width member and use it as indentation parameter if nonzero + const bool pretty_print = o.width() > 0; + const auto indentation = pretty_print ? o.width() : 0; + + // reset width to 0 for subsequent calls to this stream + o.width(0); + + // do the actual serialization + serializer s(detail::output_adapter(o), o.fill()); + s.dump(j, pretty_print, false, static_cast(indentation)); + return o; + } + + /*! + @brief serialize to stream + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use + @ref operator<<(std::ostream&, const basic_json&) + instead; that is, replace calls like `j >> o;` with `o << j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED_FOR(3.0.0, operator<<(std::ostream&, const basic_json&)) + friend std::ostream& operator>>(const basic_json& j, std::ostream& o) + { + return o << j; + } + + /// @} + + + ///////////////////// + // deserialization // + ///////////////////// + + /// @name deserialization + /// @{ + + /*! + @brief deserialize from a compatible input + + @tparam InputType A compatible input, for instance + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the parser callback function + @a cb or reading from the input @a i has a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `parse()` function reading + from an array.,parse__array__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__string__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__istream__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function reading + from a contiguous container.,parse__contiguouscontainer__parser_callback_t} + + @since version 2.0.3 (contiguous containers); version 3.9.0 allowed to + ignore comments. + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json parse(InputType&& i, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(detail::input_adapter(std::forward(i)), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + /*! + @brief deserialize from a pair of character iterators + + The value_type of the iterator must be a integral type with size of 1, 2 or + 4 bytes, which will be interpreted respectively as UTF-8, UTF-16 and UTF-32. + + @param[in] first iterator to start of character range + @param[in] last iterator to end of character range + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json parse(IteratorType first, + IteratorType last, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(detail::input_adapter(std::move(first), std::move(last)), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, parse(ptr, ptr + len)) + static basic_json parse(detail::span_input_adapter&& i, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(i.get(), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + /*! + @brief check if the input is valid JSON + + Unlike the @ref parse(InputType&&, const parser_callback_t,const bool) + function, this function neither throws an exception in case of invalid JSON + input (i.e., a parse error) nor creates diagnostic information. + + @tparam InputType A compatible input, for instance + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return Whether the input read from @a i is valid JSON. + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `accept()` function reading + from a string.,accept__string} + */ + template + static bool accept(InputType&& i, + const bool ignore_comments = false) + { + return parser(detail::input_adapter(std::forward(i)), nullptr, false, ignore_comments).accept(true); + } + + template + static bool accept(IteratorType first, IteratorType last, + const bool ignore_comments = false) + { + return parser(detail::input_adapter(std::move(first), std::move(last)), nullptr, false, ignore_comments).accept(true); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, accept(ptr, ptr + len)) + static bool accept(detail::span_input_adapter&& i, + const bool ignore_comments = false) + { + return parser(i.get(), nullptr, false, ignore_comments).accept(true); + } + + /*! + @brief generate SAX events + + The SAX event lister must follow the interface of @ref json_sax. + + This function reads from a compatible input. Examples are: + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in,out] sax SAX event listener + @param[in] format the format to parse (JSON, CBOR, MessagePack, or UBJSON) + @param[in] strict whether the input has to be consumed completely + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default); only applies to the JSON file format. + + @return return value of the last processed SAX event + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the SAX consumer @a sax has + a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `sax_parse()` function + reading from string and processing the events with a user-defined SAX + event consumer.,sax_parse} + + @since version 3.2.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + static bool sax_parse(InputType&& i, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = detail::input_adapter(std::forward(i)); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + template + JSON_HEDLEY_NON_NULL(3) + static bool sax_parse(IteratorType first, IteratorType last, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = detail::input_adapter(std::move(first), std::move(last)); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + template + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, sax_parse(ptr, ptr + len, ...)) + JSON_HEDLEY_NON_NULL(2) + static bool sax_parse(detail::span_input_adapter&& i, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = i.get(); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + /*! + @brief deserialize from stream + @deprecated This stream operator is deprecated and will be removed in + version 4.0.0 of the library. Please use + @ref operator>>(std::istream&, basic_json&) + instead; that is, replace calls like `j << i;` with `i >> j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED_FOR(3.0.0, operator>>(std::istream&, basic_json&)) + friend std::istream& operator<<(basic_json& j, std::istream& i) + { + return operator>>(i, j); + } + + /*! + @brief deserialize from stream + + Deserializes an input stream to a JSON value. + + @param[in,out] i input stream to read a serialized JSON value from + @param[in,out] j JSON value to write the deserialized input to + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below shows how a JSON value is constructed by + reading a serialization from a stream.,operator_deserialize} + + @sa parse(std::istream&, const parser_callback_t) for a variant with a + parser callback function to filter values while parsing + + @since version 1.0.0 + */ + friend std::istream& operator>>(std::istream& i, basic_json& j) + { + parser(detail::input_adapter(i)).parse(false, j); + return i; + } + + /// @} + + /////////////////////////// + // convenience functions // + /////////////////////////// + + /*! + @brief return the type as string + + Returns the type name as string to be used in error messages - usually to + indicate that a function was called on a wrong JSON type. + + @return a string representation of a the @a m_type member: + Value type | return value + ----------- | ------------- + null | `"null"` + boolean | `"boolean"` + string | `"string"` + number | `"number"` (for all number types) + object | `"object"` + array | `"array"` + binary | `"binary"` + discarded | `"discarded"` + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Constant. + + @liveexample{The following code exemplifies `type_name()` for all JSON + types.,type_name} + + @sa @ref type() -- return the type of the JSON value + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + + @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` + since 3.0.0 + */ + JSON_HEDLEY_RETURNS_NON_NULL + const char* type_name() const noexcept + { + { + switch (m_type) + { + case value_t::null: + return "null"; + case value_t::object: + return "object"; + case value_t::array: + return "array"; + case value_t::string: + return "string"; + case value_t::boolean: + return "boolean"; + case value_t::binary: + return "binary"; + case value_t::discarded: + return "discarded"; + default: + return "number"; + } + } + } + + + private: + ////////////////////// + // member variables // + ////////////////////// + + /// the type of the current element + value_t m_type = value_t::null; + + /// the value of the current element + json_value m_value = {}; + + ////////////////////////////////////////// + // binary serialization/deserialization // + ////////////////////////////////////////// + + /// @name binary serialization/deserialization support + /// @{ + + public: + /*! + @brief create a CBOR serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the CBOR (Concise + Binary Object Representation) serialization format. CBOR is a binary + serialization format which aims to be more compact than JSON itself, yet + more efficient to parse. + + The library uses the following mapping from JSON values types to + CBOR types according to the CBOR specification (RFC 7049): + + JSON value type | value/range | CBOR type | first byte + --------------- | ------------------------------------------ | ---------------------------------- | --------------- + null | `null` | Null | 0xF6 + boolean | `true` | True | 0xF5 + boolean | `false` | False | 0xF4 + number_integer | -9223372036854775808..-2147483649 | Negative integer (8 bytes follow) | 0x3B + number_integer | -2147483648..-32769 | Negative integer (4 bytes follow) | 0x3A + number_integer | -32768..-129 | Negative integer (2 bytes follow) | 0x39 + number_integer | -128..-25 | Negative integer (1 byte follow) | 0x38 + number_integer | -24..-1 | Negative integer | 0x20..0x37 + number_integer | 0..23 | Integer | 0x00..0x17 + number_integer | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_integer | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_integer | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_integer | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_unsigned | 0..23 | Integer | 0x00..0x17 + number_unsigned | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_unsigned | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_unsigned | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_unsigned | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_float | *any value representable by a float* | Single-Precision Float | 0xFA + number_float | *any value NOT representable by a float* | Double-Precision Float | 0xFB + string | *length*: 0..23 | UTF-8 string | 0x60..0x77 + string | *length*: 23..255 | UTF-8 string (1 byte follow) | 0x78 + string | *length*: 256..65535 | UTF-8 string (2 bytes follow) | 0x79 + string | *length*: 65536..4294967295 | UTF-8 string (4 bytes follow) | 0x7A + string | *length*: 4294967296..18446744073709551615 | UTF-8 string (8 bytes follow) | 0x7B + array | *size*: 0..23 | array | 0x80..0x97 + array | *size*: 23..255 | array (1 byte follow) | 0x98 + array | *size*: 256..65535 | array (2 bytes follow) | 0x99 + array | *size*: 65536..4294967295 | array (4 bytes follow) | 0x9A + array | *size*: 4294967296..18446744073709551615 | array (8 bytes follow) | 0x9B + object | *size*: 0..23 | map | 0xA0..0xB7 + object | *size*: 23..255 | map (1 byte follow) | 0xB8 + object | *size*: 256..65535 | map (2 bytes follow) | 0xB9 + object | *size*: 65536..4294967295 | map (4 bytes follow) | 0xBA + object | *size*: 4294967296..18446744073709551615 | map (8 bytes follow) | 0xBB + binary | *size*: 0..23 | byte string | 0x40..0x57 + binary | *size*: 23..255 | byte string (1 byte follow) | 0x58 + binary | *size*: 256..65535 | byte string (2 bytes follow) | 0x59 + binary | *size*: 65536..4294967295 | byte string (4 bytes follow) | 0x5A + binary | *size*: 4294967296..18446744073709551615 | byte string (8 bytes follow) | 0x5B + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a CBOR value. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The following CBOR types are not used in the conversion: + - UTF-8 strings terminated by "break" (0x7F) + - arrays terminated by "break" (0x9F) + - maps terminated by "break" (0xBF) + - byte strings terminated by "break" (0x5F) + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + - half-precision floats (0xF9) + - break (0xFF) + + @param[in] j JSON value to serialize + @return CBOR serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in CBOR format.,to_cbor} + + @sa http://cbor.io + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + analogous deserialization + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9; compact representation of floating-point numbers + since version 3.8.0 + */ + static std::vector to_cbor(const basic_json& j) + { + std::vector result; + to_cbor(j, result); + return result; + } + + static void to_cbor(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_cbor(j); + } + + static void to_cbor(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_cbor(j); + } + + /*! + @brief create a MessagePack serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the MessagePack + serialization format. MessagePack is a binary serialization format which + aims to be more compact than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + MessagePack types according to the MessagePack specification: + + JSON value type | value/range | MessagePack type | first byte + --------------- | --------------------------------- | ---------------- | ---------- + null | `null` | nil | 0xC0 + boolean | `true` | true | 0xC3 + boolean | `false` | false | 0xC2 + number_integer | -9223372036854775808..-2147483649 | int64 | 0xD3 + number_integer | -2147483648..-32769 | int32 | 0xD2 + number_integer | -32768..-129 | int16 | 0xD1 + number_integer | -128..-33 | int8 | 0xD0 + number_integer | -32..-1 | negative fixint | 0xE0..0xFF + number_integer | 0..127 | positive fixint | 0x00..0x7F + number_integer | 128..255 | uint 8 | 0xCC + number_integer | 256..65535 | uint 16 | 0xCD + number_integer | 65536..4294967295 | uint 32 | 0xCE + number_integer | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_unsigned | 0..127 | positive fixint | 0x00..0x7F + number_unsigned | 128..255 | uint 8 | 0xCC + number_unsigned | 256..65535 | uint 16 | 0xCD + number_unsigned | 65536..4294967295 | uint 32 | 0xCE + number_unsigned | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_float | *any value representable by a float* | float 32 | 0xCA + number_float | *any value NOT representable by a float* | float 64 | 0xCB + string | *length*: 0..31 | fixstr | 0xA0..0xBF + string | *length*: 32..255 | str 8 | 0xD9 + string | *length*: 256..65535 | str 16 | 0xDA + string | *length*: 65536..4294967295 | str 32 | 0xDB + array | *size*: 0..15 | fixarray | 0x90..0x9F + array | *size*: 16..65535 | array 16 | 0xDC + array | *size*: 65536..4294967295 | array 32 | 0xDD + object | *size*: 0..15 | fix map | 0x80..0x8F + object | *size*: 16..65535 | map 16 | 0xDE + object | *size*: 65536..4294967295 | map 32 | 0xDF + binary | *size*: 0..255 | bin 8 | 0xC4 + binary | *size*: 256..65535 | bin 16 | 0xC5 + binary | *size*: 65536..4294967295 | bin 32 | 0xC6 + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a MessagePack value. + + @note The following values can **not** be converted to a MessagePack value: + - strings with more than 4294967295 bytes + - byte strings with more than 4294967295 bytes + - arrays with more than 4294967295 elements + - objects with more than 4294967295 elements + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @param[in] j JSON value to serialize + @return MessagePack serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in MessagePack format.,to_msgpack} + + @sa http://msgpack.org + @sa @ref from_msgpack for the analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9 + */ + static std::vector to_msgpack(const basic_json& j) + { + std::vector result; + to_msgpack(j, result); + return result; + } + + static void to_msgpack(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_msgpack(j); + } + + static void to_msgpack(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_msgpack(j); + } + + /*! + @brief create a UBJSON serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the UBJSON + (Universal Binary JSON) serialization format. UBJSON aims to be more compact + than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + UBJSON types according to the UBJSON specification: + + JSON value type | value/range | UBJSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | `Z` + boolean | `true` | true | `T` + boolean | `false` | false | `F` + number_integer | -9223372036854775808..-2147483649 | int64 | `L` + number_integer | -2147483648..-32769 | int32 | `l` + number_integer | -32768..-129 | int16 | `I` + number_integer | -128..127 | int8 | `i` + number_integer | 128..255 | uint8 | `U` + number_integer | 256..32767 | int16 | `I` + number_integer | 32768..2147483647 | int32 | `l` + number_integer | 2147483648..9223372036854775807 | int64 | `L` + number_unsigned | 0..127 | int8 | `i` + number_unsigned | 128..255 | uint8 | `U` + number_unsigned | 256..32767 | int16 | `I` + number_unsigned | 32768..2147483647 | int32 | `l` + number_unsigned | 2147483648..9223372036854775807 | int64 | `L` + number_unsigned | 2147483649..18446744073709551615 | high-precision | `H` + number_float | *any value* | float64 | `D` + string | *with shortest length indicator* | string | `S` + array | *see notes on optimized format* | array | `[` + object | *see notes on optimized format* | map | `{` + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a UBJSON value. + + @note The following values can **not** be converted to a UBJSON value: + - strings with more than 9223372036854775807 bytes (theoretical) + + @note The following markers are not used in the conversion: + - `Z`: no-op values are not created. + - `C`: single-byte strings are serialized with `S` markers. + + @note Any UBJSON output created @ref to_ubjson can be successfully parsed + by @ref from_ubjson. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The optimized formats for containers are supported: Parameter + @a use_size adds size information to the beginning of a container and + removes the closing marker. Parameter @a use_type further checks + whether all elements of a container have the same type and adds the + type marker to the beginning of the container. The @a use_type + parameter must only be used together with @a use_size = true. Note + that @a use_size = true alone may result in larger representations - + the benefit of this parameter is that the receiving side is + immediately informed on the number of elements of the container. + + @note If the JSON data contains the binary type, the value stored is a list + of integers, as suggested by the UBJSON documentation. In particular, + this means that serialization and the deserialization of a JSON + containing binary values into UBJSON and back will result in a + different JSON object. + + @param[in] j JSON value to serialize + @param[in] use_size whether to add size annotations to container types + @param[in] use_type whether to add type annotations to container types + (must be combined with @a use_size = true) + @return UBJSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in UBJSON format.,to_ubjson} + + @sa http://ubjson.org + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + + @since version 3.1.0 + */ + static std::vector to_ubjson(const basic_json& j, + const bool use_size = false, + const bool use_type = false) + { + std::vector result; + to_ubjson(j, result, use_size, use_type); + return result; + } + + static void to_ubjson(const basic_json& j, detail::output_adapter o, + const bool use_size = false, const bool use_type = false) + { + binary_writer(o).write_ubjson(j, use_size, use_type); + } + + static void to_ubjson(const basic_json& j, detail::output_adapter o, + const bool use_size = false, const bool use_type = false) + { + binary_writer(o).write_ubjson(j, use_size, use_type); + } + + + /*! + @brief Serializes the given JSON object `j` to BSON and returns a vector + containing the corresponding BSON-representation. + + BSON (Binary JSON) is a binary format in which zero or more ordered key/value pairs are + stored as a single entity (a so-called document). + + The library uses the following mapping from JSON values types to BSON types: + + JSON value type | value/range | BSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | 0x0A + boolean | `true`, `false` | boolean | 0x08 + number_integer | -9223372036854775808..-2147483649 | int64 | 0x12 + number_integer | -2147483648..2147483647 | int32 | 0x10 + number_integer | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 0..2147483647 | int32 | 0x10 + number_unsigned | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 9223372036854775808..18446744073709551615| -- | -- + number_float | *any value* | double | 0x01 + string | *any value* | string | 0x02 + array | *any value* | document | 0x04 + object | *any value* | document | 0x03 + binary | *any value* | binary | 0x05 + + @warning The mapping is **incomplete**, since only JSON-objects (and things + contained therein) can be serialized to BSON. + Also, integers larger than 9223372036854775807 cannot be serialized to BSON, + and the keys may not contain U+0000, since they are serialized a + zero-terminated c-strings. + + @throw out_of_range.407 if `j.is_number_unsigned() && j.get() > 9223372036854775807` + @throw out_of_range.409 if a key in `j` contains a NULL (U+0000) + @throw type_error.317 if `!j.is_object()` + + @pre The input `j` is required to be an object: `j.is_object() == true`. + + @note Any BSON output created via @ref to_bson can be successfully parsed + by @ref from_bson. + + @param[in] j JSON value to serialize + @return BSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in BSON format.,to_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref from_bson(detail::input_adapter&&, const bool strict) for the + analogous deserialization + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + @sa @ref to_cbor(const basic_json&) for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + */ + static std::vector to_bson(const basic_json& j) + { + std::vector result; + to_bson(j, result); + return result; + } + + /*! + @brief Serializes the given JSON object `j` to BSON and forwards the + corresponding BSON-representation to the given output_adapter `o`. + @param j The JSON object to convert to BSON. + @param o The output adapter that receives the binary BSON representation. + @pre The input `j` shall be an object: `j.is_object() == true` + @sa @ref to_bson(const basic_json&) + */ + static void to_bson(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_bson(j); + } + + /*! + @copydoc to_bson(const basic_json&, detail::output_adapter) + */ + static void to_bson(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_bson(j); + } + + + /*! + @brief create a JSON value from an input in CBOR format + + Deserializes a given input @a i to a JSON value using the CBOR (Concise + Binary Object Representation) serialization format. + + The library maps CBOR types to JSON value types as follows: + + CBOR type | JSON value type | first byte + ---------------------- | --------------- | ---------- + Integer | number_unsigned | 0x00..0x17 + Unsigned integer | number_unsigned | 0x18 + Unsigned integer | number_unsigned | 0x19 + Unsigned integer | number_unsigned | 0x1A + Unsigned integer | number_unsigned | 0x1B + Negative integer | number_integer | 0x20..0x37 + Negative integer | number_integer | 0x38 + Negative integer | number_integer | 0x39 + Negative integer | number_integer | 0x3A + Negative integer | number_integer | 0x3B + Byte string | binary | 0x40..0x57 + Byte string | binary | 0x58 + Byte string | binary | 0x59 + Byte string | binary | 0x5A + Byte string | binary | 0x5B + UTF-8 string | string | 0x60..0x77 + UTF-8 string | string | 0x78 + UTF-8 string | string | 0x79 + UTF-8 string | string | 0x7A + UTF-8 string | string | 0x7B + UTF-8 string | string | 0x7F + array | array | 0x80..0x97 + array | array | 0x98 + array | array | 0x99 + array | array | 0x9A + array | array | 0x9B + array | array | 0x9F + map | object | 0xA0..0xB7 + map | object | 0xB8 + map | object | 0xB9 + map | object | 0xBA + map | object | 0xBB + map | object | 0xBF + False | `false` | 0xF4 + True | `true` | 0xF5 + Null | `null` | 0xF6 + Half-Precision Float | number_float | 0xF9 + Single-Precision Float | number_float | 0xFA + Double-Precision Float | number_float | 0xFB + + @warning The mapping is **incomplete** in the sense that not all CBOR + types can be converted to a JSON value. The following CBOR types + are not supported and will yield parse errors (parse_error.112): + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + + @warning CBOR allows map keys of any type, whereas JSON only allows + strings as keys in object values. Therefore, CBOR maps with keys + other than UTF-8 strings are rejected (parse_error.113). + + @note Any CBOR output created @ref to_cbor can be successfully parsed by + @ref from_cbor. + + @param[in] i an input in CBOR format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] tag_handler how to treat CBOR tags (optional, error by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from CBOR were + used in the given input @a v or if the input is not valid CBOR + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in CBOR + format to a JSON value.,from_cbor} + + @sa http://cbor.io + @sa @ref to_cbor(const basic_json&) for the analogous serialization + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for the + related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0; added @a tag_handler parameter since 3.9.0. + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) + static basic_json from_cbor(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + return from_cbor(ptr, ptr + len, strict, allow_exceptions, tag_handler); + } + + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) + static basic_json from_cbor(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @brief create a JSON value from an input in MessagePack format + + Deserializes a given input @a i to a JSON value using the MessagePack + serialization format. + + The library maps MessagePack types to JSON value types as follows: + + MessagePack type | JSON value type | first byte + ---------------- | --------------- | ---------- + positive fixint | number_unsigned | 0x00..0x7F + fixmap | object | 0x80..0x8F + fixarray | array | 0x90..0x9F + fixstr | string | 0xA0..0xBF + nil | `null` | 0xC0 + false | `false` | 0xC2 + true | `true` | 0xC3 + float 32 | number_float | 0xCA + float 64 | number_float | 0xCB + uint 8 | number_unsigned | 0xCC + uint 16 | number_unsigned | 0xCD + uint 32 | number_unsigned | 0xCE + uint 64 | number_unsigned | 0xCF + int 8 | number_integer | 0xD0 + int 16 | number_integer | 0xD1 + int 32 | number_integer | 0xD2 + int 64 | number_integer | 0xD3 + str 8 | string | 0xD9 + str 16 | string | 0xDA + str 32 | string | 0xDB + array 16 | array | 0xDC + array 32 | array | 0xDD + map 16 | object | 0xDE + map 32 | object | 0xDF + bin 8 | binary | 0xC4 + bin 16 | binary | 0xC5 + bin 32 | binary | 0xC6 + ext 8 | binary | 0xC7 + ext 16 | binary | 0xC8 + ext 32 | binary | 0xC9 + fixext 1 | binary | 0xD4 + fixext 2 | binary | 0xD5 + fixext 4 | binary | 0xD6 + fixext 8 | binary | 0xD7 + fixext 16 | binary | 0xD8 + negative fixint | number_integer | 0xE0-0xFF + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @param[in] i an input in MessagePack format convertible to an input + adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from MessagePack were + used in the given input @a i or if the input is not valid MessagePack + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + MessagePack format to a JSON value.,from_msgpack} + + @sa http://msgpack.org + @sa @ref to_msgpack(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for + the related UBJSON format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0 + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_msgpack(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) + static basic_json from_msgpack(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_msgpack(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) + static basic_json from_msgpack(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + /*! + @brief create a JSON value from an input in UBJSON format + + Deserializes a given input @a i to a JSON value using the UBJSON (Universal + Binary JSON) serialization format. + + The library maps UBJSON types to JSON value types as follows: + + UBJSON type | JSON value type | marker + ----------- | --------------------------------------- | ------ + no-op | *no value, next value is read* | `N` + null | `null` | `Z` + false | `false` | `F` + true | `true` | `T` + float32 | number_float | `d` + float64 | number_float | `D` + uint8 | number_unsigned | `U` + int8 | number_integer | `i` + int16 | number_integer | `I` + int32 | number_integer | `l` + int64 | number_integer | `L` + high-precision number | number_integer, number_unsigned, or number_float - depends on number string | 'H' + string | string | `S` + char | string | `C` + array | array (optimized values are supported) | `[` + object | object (optimized values are supported) | `{` + + @note The mapping is **complete** in the sense that any UBJSON value can + be converted to a JSON value. + + @param[in] i an input in UBJSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if a parse error occurs + @throw parse_error.113 if a string could not be parsed successfully + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + UBJSON format to a JSON value.,from_ubjson} + + @sa http://ubjson.org + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_ubjson(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) + static basic_json from_ubjson(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_ubjson(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) + static basic_json from_ubjson(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + /*! + @brief Create a JSON value from an input in BSON format + + Deserializes a given input @a i to a JSON value using the BSON (Binary JSON) + serialization format. + + The library maps BSON record types to JSON value types as follows: + + BSON type | BSON marker byte | JSON value type + --------------- | ---------------- | --------------------------- + double | 0x01 | number_float + string | 0x02 | string + document | 0x03 | object + array | 0x04 | array + binary | 0x05 | still unsupported + undefined | 0x06 | still unsupported + ObjectId | 0x07 | still unsupported + boolean | 0x08 | boolean + UTC Date-Time | 0x09 | still unsupported + null | 0x0A | null + Regular Expr. | 0x0B | still unsupported + DB Pointer | 0x0C | still unsupported + JavaScript Code | 0x0D | still unsupported + Symbol | 0x0E | still unsupported + JavaScript Code | 0x0F | still unsupported + int32 | 0x10 | number_integer + Timestamp | 0x11 | still unsupported + 128-bit decimal float | 0x13 | still unsupported + Max Key | 0x7F | still unsupported + Min Key | 0xFF | still unsupported + + @warning The mapping is **incomplete**. The unsupported mappings + are indicated in the table above. + + @param[in] i an input in BSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.114 if an unsupported BSON record type is encountered + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + BSON format to a JSON value.,from_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref to_bson(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_bson(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) + static basic_json from_bson(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_bson(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) + static basic_json from_bson(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + /// @} + + ////////////////////////// + // JSON Pointer support // + ////////////////////////// + + /// @name JSON Pointer functions + /// @{ + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. Similar to @ref operator[](const typename + object_t::key_type&), `null` values are created in arrays and objects if + necessary. + + In particular: + - If the JSON pointer points to an object key that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. + - If the JSON pointer points to an array index that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. All indices between the current maximum and the given + index are also filled with `null`. + - The special value `-` is treated as a synonym for the index past the + end. + + @param[in] ptr a JSON pointer + + @return reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer} + + @since version 2.0.0 + */ + reference operator[](const json_pointer& ptr) + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. The function does not change the JSON + value; no `null` values are created. In particular, the special value + `-` yields an exception. + + @param[in] ptr JSON pointer to the desired element + + @return const reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer_const} + + @since version 2.0.0 + */ + const_reference operator[](const json_pointer& ptr) const + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a reference to the element at with specified JSON pointer @a ptr, + with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer} + */ + reference at(const json_pointer& ptr) + { + return ptr.get_checked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a const reference to the element at with specified JSON pointer @a + ptr, with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer_const} + */ + const_reference at(const json_pointer& ptr) const + { + return ptr.get_checked(this); + } + + /*! + @brief return flattened JSON value + + The function creates a JSON object whose keys are JSON pointers (see [RFC + 6901](https://tools.ietf.org/html/rfc6901)) and whose values are all + primitive. The original JSON value can be restored using the @ref + unflatten() function. + + @return an object that maps JSON pointers to primitive values + + @note Empty objects and arrays are flattened to `null` and will not be + reconstructed correctly by the @ref unflatten() function. + + @complexity Linear in the size the JSON value. + + @liveexample{The following code shows how a JSON object is flattened to an + object whose keys consist of JSON pointers.,flatten} + + @sa @ref unflatten() for the reverse function + + @since version 2.0.0 + */ + basic_json flatten() const + { + basic_json result(value_t::object); + json_pointer::flatten("", *this, result); + return result; + } + + /*! + @brief unflatten a previously flattened JSON value + + The function restores the arbitrary nesting of a JSON value that has been + flattened before using the @ref flatten() function. The JSON value must + meet certain constraints: + 1. The value must be an object. + 2. The keys must be JSON pointers (see + [RFC 6901](https://tools.ietf.org/html/rfc6901)) + 3. The mapped values must be primitive JSON types. + + @return the original JSON from a flattened version + + @note Empty objects and arrays are flattened by @ref flatten() to `null` + values and can not unflattened to their original type. Apart from + this example, for a JSON value `j`, the following is always true: + `j == j.flatten().unflatten()`. + + @complexity Linear in the size the JSON value. + + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + + @liveexample{The following code shows how a flattened JSON object is + unflattened into the original nested JSON object.,unflatten} + + @sa @ref flatten() for the reverse function + + @since version 2.0.0 + */ + basic_json unflatten() const + { + return json_pointer::unflatten(*this); + } + + /// @} + + ////////////////////////// + // JSON Patch functions // + ////////////////////////// + + /// @name JSON Patch functions + /// @{ + + /*! + @brief applies a JSON patch + + [JSON Patch](http://jsonpatch.com) defines a JSON document structure for + expressing a sequence of operations to apply to a JSON) document. With + this function, a JSON Patch is applied to the current JSON value by + executing all operations from the patch. + + @param[in] json_patch JSON patch document + @return patched document + + @note The application of a patch is atomic: Either all operations succeed + and the patched document is returned or an exception is thrown. In + any case, the original value is not changed: the patch is applied + to a copy of the value. + + @throw parse_error.104 if the JSON patch does not consist of an array of + objects + + @throw parse_error.105 if the JSON patch is malformed (e.g., mandatory + attributes are missing); example: `"operation add must have member path"` + + @throw out_of_range.401 if an array index is out of range. + + @throw out_of_range.403 if a JSON pointer inside the patch could not be + resolved successfully in the current JSON value; example: `"key baz not + found"` + + @throw out_of_range.405 if JSON pointer has no parent ("add", "remove", + "move") + + @throw other_error.501 if "test" operation was unsuccessful + + @complexity Linear in the size of the JSON value and the length of the + JSON patch. As usually only a fraction of the JSON value is affected by + the patch, the complexity can usually be neglected. + + @liveexample{The following code shows how a JSON patch is applied to a + value.,patch} + + @sa @ref diff -- create a JSON patch by comparing two JSON values + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + @sa [RFC 6901 (JSON Pointer)](https://tools.ietf.org/html/rfc6901) + + @since version 2.0.0 + */ + basic_json patch(const basic_json& json_patch) const + { + // make a working copy to apply the patch to + basic_json result = *this; + + // the valid JSON Patch operations + enum class patch_operations {add, remove, replace, move, copy, test, invalid}; + + const auto get_op = [](const std::string & op) + { + if (op == "add") + { + return patch_operations::add; + } + if (op == "remove") + { + return patch_operations::remove; + } + if (op == "replace") + { + return patch_operations::replace; + } + if (op == "move") + { + return patch_operations::move; + } + if (op == "copy") + { + return patch_operations::copy; + } + if (op == "test") + { + return patch_operations::test; + } + + return patch_operations::invalid; + }; + + // wrapper for "add" operation; add value at ptr + const auto operation_add = [&result](json_pointer & ptr, basic_json val) + { + // adding to the root of the target document means replacing it + if (ptr.empty()) + { + result = val; + return; + } + + // make sure the top element of the pointer exists + json_pointer top_pointer = ptr.top(); + if (top_pointer != ptr) + { + result.at(top_pointer); + } + + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result[ptr]; + + switch (parent.m_type) + { + case value_t::null: + case value_t::object: + { + // use operator[] to add value + parent[last_path] = val; + break; + } + + case value_t::array: + { + if (last_path == "-") + { + // special case: append to back + parent.push_back(val); + } + else + { + const auto idx = json_pointer::array_index(last_path); + if (JSON_HEDLEY_UNLIKELY(idx > parent.size())) + { + // avoid undefined behavior + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + // default case: insert add offset + parent.insert(parent.begin() + static_cast(idx), val); + } + break; + } + + // if there exists a parent it cannot be primitive + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + }; + + // wrapper for "remove" operation; remove value at ptr + const auto operation_remove = [&result](json_pointer & ptr) + { + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result.at(ptr); + + // remove child + if (parent.is_object()) + { + // perform range check + auto it = parent.find(last_path); + if (JSON_HEDLEY_LIKELY(it != parent.end())) + { + parent.erase(it); + } + else + { + JSON_THROW(out_of_range::create(403, "key '" + last_path + "' not found")); + } + } + else if (parent.is_array()) + { + // note erase performs range check + parent.erase(json_pointer::array_index(last_path)); + } + }; + + // type check: top level value must be an array + if (JSON_HEDLEY_UNLIKELY(!json_patch.is_array())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // iterate and apply the operations + for (const auto& val : json_patch) + { + // wrapper to get a value for an operation + const auto get_value = [&val](const std::string & op, + const std::string & member, + bool string_type) -> basic_json & + { + // find value + auto it = val.m_value.object->find(member); + + // context-sensitive error message + const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; + + // check if desired value is present + if (JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); + } + + // check if result is of type string + if (JSON_HEDLEY_UNLIKELY(string_type && !it->second.is_string())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); + } + + // no error: return value + return it->second; + }; + + // type check: every element of the array must be an object + if (JSON_HEDLEY_UNLIKELY(!val.is_object())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // collect mandatory members + const auto op = get_value("op", "op", true).template get(); + const auto path = get_value(op, "path", true).template get(); + json_pointer ptr(path); + + switch (get_op(op)) + { + case patch_operations::add: + { + operation_add(ptr, get_value("add", "value", false)); + break; + } + + case patch_operations::remove: + { + operation_remove(ptr); + break; + } + + case patch_operations::replace: + { + // the "path" location must exist - use at() + result.at(ptr) = get_value("replace", "value", false); + break; + } + + case patch_operations::move: + { + const auto from_path = get_value("move", "from", true).template get(); + json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The move operation is functionally identical to a + // "remove" operation on the "from" location, followed + // immediately by an "add" operation at the target + // location with the value that was just removed. + operation_remove(from_ptr); + operation_add(ptr, v); + break; + } + + case patch_operations::copy: + { + const auto from_path = get_value("copy", "from", true).template get(); + const json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The copy is functionally identical to an "add" + // operation at the target location using the value + // specified in the "from" member. + operation_add(ptr, v); + break; + } + + case patch_operations::test: + { + bool success = false; + JSON_TRY + { + // check if "value" matches the one at "path" + // the "path" location must exist - use at() + success = (result.at(ptr) == get_value("test", "value", false)); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + // ignore out of range errors: success remains false + } + + // throw an exception if test fails + if (JSON_HEDLEY_UNLIKELY(!success)) + { + JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); + } + + break; + } + + default: + { + // op must be "add", "remove", "replace", "move", "copy", or + // "test" + JSON_THROW(parse_error::create(105, 0, "operation value '" + op + "' is invalid")); + } + } + } + + return result; + } + + /*! + @brief creates a diff as a JSON patch + + Creates a [JSON Patch](http://jsonpatch.com) so that value @a source can + be changed into the value @a target by calling @ref patch function. + + @invariant For two JSON values @a source and @a target, the following code + yields always `true`: + @code {.cpp} + source.patch(diff(source, target)) == target; + @endcode + + @note Currently, only `remove`, `add`, and `replace` operations are + generated. + + @param[in] source JSON value to compare from + @param[in] target JSON value to compare against + @param[in] path helper value to create JSON pointers + + @return a JSON patch to convert the @a source to @a target + + @complexity Linear in the lengths of @a source and @a target. + + @liveexample{The following code shows how a JSON patch is created as a + diff for two JSON values.,diff} + + @sa @ref patch -- apply a JSON patch + @sa @ref merge_patch -- apply a JSON Merge Patch + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + + @since version 2.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json diff(const basic_json& source, const basic_json& target, + const std::string& path = "") + { + // the patch + basic_json result(value_t::array); + + // if the values are the same, return empty patch + if (source == target) + { + return result; + } + + if (source.type() != target.type()) + { + // different types: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + return result; + } + + switch (source.type()) + { + case value_t::array: + { + // first pass: traverse common elements + std::size_t i = 0; + while (i < source.size() && i < target.size()) + { + // recursive call to compare array values at index i + auto temp_diff = diff(source[i], target[i], path + "/" + std::to_string(i)); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + ++i; + } + + // i now reached the end of at least one array + // in a second pass, traverse the remaining elements + + // remove my remaining elements + const auto end_index = static_cast(result.size()); + while (i < source.size()) + { + // add operations in reverse order to avoid invalid + // indices + result.insert(result.begin() + end_index, object( + { + {"op", "remove"}, + {"path", path + "/" + std::to_string(i)} + })); + ++i; + } + + // add other remaining elements + while (i < target.size()) + { + result.push_back( + { + {"op", "add"}, + {"path", path + "/-"}, + {"value", target[i]} + }); + ++i; + } + + break; + } + + case value_t::object: + { + // first pass: traverse this object's elements + for (auto it = source.cbegin(); it != source.cend(); ++it) + { + // escape the key name to be used in a JSON patch + const auto key = json_pointer::escape(it.key()); + + if (target.find(it.key()) != target.end()) + { + // recursive call to compare object values at key it + auto temp_diff = diff(it.value(), target[it.key()], path + "/" + key); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + } + else + { + // found a key that is not in o -> remove it + result.push_back(object( + { + {"op", "remove"}, {"path", path + "/" + key} + })); + } + } + + // second pass: traverse other object's elements + for (auto it = target.cbegin(); it != target.cend(); ++it) + { + if (source.find(it.key()) == source.end()) + { + // found a key that is not in this -> add it + const auto key = json_pointer::escape(it.key()); + result.push_back( + { + {"op", "add"}, {"path", path + "/" + key}, + {"value", it.value()} + }); + } + } + + break; + } + + default: + { + // both primitive type: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + break; + } + } + + return result; + } + + /// @} + + //////////////////////////////// + // JSON Merge Patch functions // + //////////////////////////////// + + /// @name JSON Merge Patch functions + /// @{ + + /*! + @brief applies a JSON Merge Patch + + The merge patch format is primarily intended for use with the HTTP PATCH + method as a means of describing a set of modifications to a target + resource's content. This function applies a merge patch to the current + JSON value. + + The function implements the following algorithm from Section 2 of + [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396): + + ``` + define MergePatch(Target, Patch): + if Patch is an Object: + if Target is not an Object: + Target = {} // Ignore the contents and set it to an empty Object + for each Name/Value pair in Patch: + if Value is null: + if Name exists in Target: + remove the Name/Value pair from Target + else: + Target[Name] = MergePatch(Target[Name], Value) + return Target + else: + return Patch + ``` + + Thereby, `Target` is the current object; that is, the patch is applied to + the current value. + + @param[in] apply_patch the patch to apply + + @complexity Linear in the lengths of @a patch. + + @liveexample{The following code shows how a JSON Merge Patch is applied to + a JSON document.,merge_patch} + + @sa @ref patch -- apply a JSON patch + @sa [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396) + + @since version 3.0.0 + */ + void merge_patch(const basic_json& apply_patch) + { + if (apply_patch.is_object()) + { + if (!is_object()) + { + *this = object(); + } + for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it) + { + if (it.value().is_null()) + { + erase(it.key()); + } + else + { + operator[](it.key()).merge_patch(it.value()); + } + } + } + else + { + *this = apply_patch; + } + } + + /// @} +}; + +/*! +@brief user-defined to_string function for JSON values + +This function implements a user-defined to_string for JSON objects. + +@param[in] j a JSON object +@return a std::string object +*/ + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j) +{ + return j.dump(); +} +} // namespace nlohmann + +/////////////////////// +// nonmember support // +/////////////////////// + +// specialization of std::swap, and std::hash +namespace std +{ + +/// hash value for JSON objects +template<> +struct hash +{ + /*! + @brief return a hash value for a JSON object + + @since version 1.0.0 + */ + std::size_t operator()(const nlohmann::json& j) const + { + return nlohmann::detail::hash(j); + } +}; + +/// specialization for std::less +/// @note: do not remove the space after '<', +/// see https://github.com/nlohmann/json/pull/679 +template<> +struct less<::nlohmann::detail::value_t> +{ + /*! + @brief compare two value_t enum values + @since version 3.0.0 + */ + bool operator()(nlohmann::detail::value_t lhs, + nlohmann::detail::value_t rhs) const noexcept + { + return nlohmann::detail::operator<(lhs, rhs); + } +}; + +// C++20 prohibit function specialization in the std namespace. +#ifndef JSON_HAS_CPP_20 + +/*! +@brief exchanges the values of two JSON objects + +@since version 1.0.0 +*/ +template<> +inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( + is_nothrow_move_constructible::value&& + is_nothrow_move_assignable::value + ) +{ + j1.swap(j2); +} + +#endif + +} // namespace std + +/*! +@brief user-defined string literal for JSON values + +This operator implements a user-defined string literal for JSON objects. It +can be used by adding `"_json"` to a string literal and returns a JSON object +if no parse error occurred. + +@param[in] s a string representation of a JSON object +@param[in] n the length of string @a s +@return a JSON object + +@since version 1.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json operator "" _json(const char* s, std::size_t n) +{ + return nlohmann::json::parse(s, s + n); +} + +/*! +@brief user-defined string literal for JSON pointer + +This operator implements a user-defined string literal for JSON Pointers. It +can be used by adding `"_json_pointer"` to a string literal and returns a JSON pointer +object if no parse error occurred. + +@param[in] s a string representation of a JSON Pointer +@param[in] n the length of string @a s +@return a JSON pointer object + +@since version 2.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) +{ + return nlohmann::json::json_pointer(std::string(s, n)); +} + +// #include + + +// restore GCC/clang diagnostic settings +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic pop +#endif +#if defined(__clang__) + #pragma GCC diagnostic pop +#endif + +// clean up +#undef JSON_ASSERT +#undef JSON_INTERNAL_CATCH +#undef JSON_CATCH +#undef JSON_THROW +#undef JSON_TRY +#undef JSON_HAS_CPP_14 +#undef JSON_HAS_CPP_17 +#undef NLOHMANN_BASIC_JSON_TPL_DECLARATION +#undef NLOHMANN_BASIC_JSON_TPL +#undef JSON_EXPLICIT + +// #include +#undef JSON_HEDLEY_ALWAYS_INLINE +#undef JSON_HEDLEY_ARM_VERSION +#undef JSON_HEDLEY_ARM_VERSION_CHECK +#undef JSON_HEDLEY_ARRAY_PARAM +#undef JSON_HEDLEY_ASSUME +#undef JSON_HEDLEY_BEGIN_C_DECLS +#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef JSON_HEDLEY_CLANG_HAS_FEATURE +#undef JSON_HEDLEY_CLANG_HAS_WARNING +#undef JSON_HEDLEY_COMPCERT_VERSION +#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef JSON_HEDLEY_CONCAT +#undef JSON_HEDLEY_CONCAT3 +#undef JSON_HEDLEY_CONCAT3_EX +#undef JSON_HEDLEY_CONCAT_EX +#undef JSON_HEDLEY_CONST +#undef JSON_HEDLEY_CONSTEXPR +#undef JSON_HEDLEY_CONST_CAST +#undef JSON_HEDLEY_CPP_CAST +#undef JSON_HEDLEY_CRAY_VERSION +#undef JSON_HEDLEY_CRAY_VERSION_CHECK +#undef JSON_HEDLEY_C_DECL +#undef JSON_HEDLEY_DEPRECATED +#undef JSON_HEDLEY_DEPRECATED_FOR +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef JSON_HEDLEY_DIAGNOSTIC_POP +#undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef JSON_HEDLEY_DMC_VERSION +#undef JSON_HEDLEY_DMC_VERSION_CHECK +#undef JSON_HEDLEY_EMPTY_BASES +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef JSON_HEDLEY_END_C_DECLS +#undef JSON_HEDLEY_FLAGS +#undef JSON_HEDLEY_FLAGS_CAST +#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_BUILTIN +#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_EXTENSION +#undef JSON_HEDLEY_GCC_HAS_FEATURE +#undef JSON_HEDLEY_GCC_HAS_WARNING +#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef JSON_HEDLEY_GCC_VERSION +#undef JSON_HEDLEY_GCC_VERSION_CHECK +#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef JSON_HEDLEY_GNUC_HAS_FEATURE +#undef JSON_HEDLEY_GNUC_HAS_WARNING +#undef JSON_HEDLEY_GNUC_VERSION +#undef JSON_HEDLEY_GNUC_VERSION_CHECK +#undef JSON_HEDLEY_HAS_ATTRIBUTE +#undef JSON_HEDLEY_HAS_BUILTIN +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_HAS_EXTENSION +#undef JSON_HEDLEY_HAS_FEATURE +#undef JSON_HEDLEY_HAS_WARNING +#undef JSON_HEDLEY_IAR_VERSION +#undef JSON_HEDLEY_IAR_VERSION_CHECK +#undef JSON_HEDLEY_IBM_VERSION +#undef JSON_HEDLEY_IBM_VERSION_CHECK +#undef JSON_HEDLEY_IMPORT +#undef JSON_HEDLEY_INLINE +#undef JSON_HEDLEY_INTEL_VERSION +#undef JSON_HEDLEY_INTEL_VERSION_CHECK +#undef JSON_HEDLEY_IS_CONSTANT +#undef JSON_HEDLEY_IS_CONSTEXPR_ +#undef JSON_HEDLEY_LIKELY +#undef JSON_HEDLEY_MALLOC +#undef JSON_HEDLEY_MESSAGE +#undef JSON_HEDLEY_MSVC_VERSION +#undef JSON_HEDLEY_MSVC_VERSION_CHECK +#undef JSON_HEDLEY_NEVER_INLINE +#undef JSON_HEDLEY_NON_NULL +#undef JSON_HEDLEY_NO_ESCAPE +#undef JSON_HEDLEY_NO_RETURN +#undef JSON_HEDLEY_NO_THROW +#undef JSON_HEDLEY_NULL +#undef JSON_HEDLEY_PELLES_VERSION +#undef JSON_HEDLEY_PELLES_VERSION_CHECK +#undef JSON_HEDLEY_PGI_VERSION +#undef JSON_HEDLEY_PGI_VERSION_CHECK +#undef JSON_HEDLEY_PREDICT +#undef JSON_HEDLEY_PRINTF_FORMAT +#undef JSON_HEDLEY_PRIVATE +#undef JSON_HEDLEY_PUBLIC +#undef JSON_HEDLEY_PURE +#undef JSON_HEDLEY_REINTERPRET_CAST +#undef JSON_HEDLEY_REQUIRE +#undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef JSON_HEDLEY_REQUIRE_MSG +#undef JSON_HEDLEY_RESTRICT +#undef JSON_HEDLEY_RETURNS_NON_NULL +#undef JSON_HEDLEY_SENTINEL +#undef JSON_HEDLEY_STATIC_ASSERT +#undef JSON_HEDLEY_STATIC_CAST +#undef JSON_HEDLEY_STRINGIFY +#undef JSON_HEDLEY_STRINGIFY_EX +#undef JSON_HEDLEY_SUNPRO_VERSION +#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef JSON_HEDLEY_TINYC_VERSION +#undef JSON_HEDLEY_TINYC_VERSION_CHECK +#undef JSON_HEDLEY_TI_ARMCL_VERSION +#undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL2000_VERSION +#undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL430_VERSION +#undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL6X_VERSION +#undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL7X_VERSION +#undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CLPRU_VERSION +#undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#undef JSON_HEDLEY_TI_VERSION +#undef JSON_HEDLEY_TI_VERSION_CHECK +#undef JSON_HEDLEY_UNAVAILABLE +#undef JSON_HEDLEY_UNLIKELY +#undef JSON_HEDLEY_UNPREDICTABLE +#undef JSON_HEDLEY_UNREACHABLE +#undef JSON_HEDLEY_UNREACHABLE_RETURN +#undef JSON_HEDLEY_VERSION +#undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef JSON_HEDLEY_VERSION_DECODE_MINOR +#undef JSON_HEDLEY_VERSION_DECODE_REVISION +#undef JSON_HEDLEY_VERSION_ENCODE +#undef JSON_HEDLEY_WARNING +#undef JSON_HEDLEY_WARN_UNUSED_RESULT +#undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#undef JSON_HEDLEY_FALL_THROUGH + + + +#endif // INCLUDE_NLOHMANN_JSON_HPP_ diff --git a/SaraAttended/Pods/FirebaseFirestore/Interop/Auth/Public/FIRAuthInterop.h b/SaraAttended/Pods/FirebaseFirestore/Interop/Auth/Public/FIRAuthInterop.h new file mode 100644 index 0000000..a33da7c --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/Interop/Auth/Public/FIRAuthInterop.h @@ -0,0 +1,44 @@ +/* + * 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 + +#import + +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/SaraAttended/Pods/FirebaseFirestore/LICENSE b/SaraAttended/Pods/FirebaseFirestore/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/FirebaseFirestore/README.md b/SaraAttended/Pods/FirebaseFirestore/README.md new file mode 100644 index 0000000..7be298d --- /dev/null +++ b/SaraAttended/Pods/FirebaseFirestore/README.md @@ -0,0 +1,319 @@ +[![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-appcheck-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-cocoapods-integration-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-core-diagnostics-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-google-utilities-badge]][gh-actions] +[![Actions Status][gh-google-utilities-components-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-mlmodeldownloader-badge]][gh-actions] +[![Actions Status][gh-performance-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] + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics +and FirebaseML. + +Firebase is an app development platform with tools to help you build, grow and +monetize your app. More information about Firebase can be found on the +[official Firebase website](https://firebase.google.com). + +## Installation + +See the subsections below for details about the different installation methods. +1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager](SwiftPackageManager.md) +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). + +### Swift Package Manager + +Instructions for [Swift Package Manager](https://swift.org/package-manager/) support can be +found at [SwiftPackageManager.md](SwiftPackageManager.md). + +### Installing from GitHub + +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: +```ruby +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: + +```ruby +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). + +### 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 12.2 (or later) + +CocoaPods is still the canonical way to develop, but much of the repo now supports +development with Swift Package Manager. + +### CocoaPods + +Install + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +```ruby +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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Swift Package Manager +* To enable test schemes: `./scripts/setup_spm_tests.sh` +* `open Package.swift` or double click `Package.swift` in Finder. +* Xcode will open the project + * Choose a scheme for a library to build or test suite to run + * Choose a target platform by selecting the run destination along with the scheme + +### 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/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### 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 a valid +`GoogleService-Info.plist` file. 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 add it to the Xcode project. + +### Coverage Report Generation + +See [scripts/code_coverage_report/README.md](scripts/code_coverage_report/README.md). + +## 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](FirebaseAuth/Tests/Sample/README.md) for instructions about +building and running the FirebaseAuth pod along with various samples and tests. + +### Firebase Database + +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 Performance Monitoring +If you're doing specific Firebase Performance Monitoring development, see +[the Performance README](FirebasePerformance/README.md) for instructions about building the SDK +and [the Performance TestApp README](FirebasePerformance/Tests/TestApp/README.md) for instructions about +integrating Performance with the dev test App. + +### Firebase Storage + +To run the Storage Integration tests, follow the instructions in +[FIRStorageIntegrationTests.m](FirebaseStorage/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. + +## Building with Firebase on Apple platforms + +Firebase 8.9.0 introduces official beta support for macOS, Catalyst, and tvOS. watchOS continues +to be community supported. Thanks to community contributions for many of the multi-platform PRs. + +At this time, most of Firebase's products are available across Apple platforms. There are still +a few gaps, especially on watchOS. For details about the current support matrix, see +[this chart](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform) +in Firebase's documentation. + +### watchOS +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and +work on watchOS. See the [Independent Watch App Sample](Example/watchOSSample). + +Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit +test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected +on watchOS. If you encounter this, please +[file an issue](https://github.com/firebase/firebase-ios-sdk/issues). + +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 watchOS. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. + +#### Additional Crashlytics Notes +* watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are +not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded) + +## Combine +Thanks to contributions from the community, _FirebaseCombineSwift_ contains support for Apple's Combine +framework. This module is currently under development, and not yet supported for use in production +environments. Fore more details, please refer to the [docs](FirebaseCombineSwift/README.md). + +## Roadmap + +See [Roadmap](ROADMAP.md) for more about the Firebase Apple SDK Open Source +plans and directions. + +## Contributing + +See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase +Apple SDK. + +## License + +The contents of this repository are 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/). + +[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-appcheck-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/app_check/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-cocoapods-integration-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/cocoapods-integration/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-core-diagnostics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core-diagnostics/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-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg +[gh-google-utilities-components-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities-components/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-mlmodeldownloader-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/mlmodeldownloader/badge.svg +[gh-performance-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/performance/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/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTCompressionHelper.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTCompressionHelper.m new file mode 100644 index 0000000..11d849e --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTCompressionHelper.m @@ -0,0 +1,95 @@ +/* + * 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 "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h" + +#import + +@implementation GDTCCTCompressionHelper + ++ (nullable NSData *)gzippedData:(NSData *)data { +#if defined(__LP64__) && __LP64__ + // Don't support > 32bit length for 64 bit, see note in header. + if (data.length > UINT_MAX) { + return nil; + } +#endif + + enum { kChunkSize = 1024 }; + + const void *bytes = [data bytes]; + NSUInteger length = [data length]; + + int level = Z_DEFAULT_COMPRESSION; + if (!bytes || !length) { + return nil; + } + + z_stream strm; + bzero(&strm, sizeof(z_stream)); + + int memLevel = 8; // Default. + int windowBits = 15 + 16; // Enable gzip header instead of zlib header. + + int retCode; + if (deflateInit2(&strm, level, Z_DEFLATED, windowBits, memLevel, Z_DEFAULT_STRATEGY) != Z_OK) { + return nil; + } + + // Hint the size at 1/4 the input size. + NSMutableData *result = [NSMutableData dataWithCapacity:(length / 4)]; + unsigned char output[kChunkSize]; + + // Setup the input. + strm.avail_in = (unsigned int)length; + strm.next_in = (unsigned char *)bytes; + + // Collect the data. + do { + // update what we're passing in + strm.avail_out = kChunkSize; + strm.next_out = output; + retCode = deflate(&strm, Z_FINISH); + if ((retCode != Z_OK) && (retCode != Z_STREAM_END)) { + deflateEnd(&strm); + return nil; + } + // Collect what we got. + unsigned gotBack = kChunkSize - strm.avail_out; + if (gotBack > 0) { + [result appendBytes:output length:gotBack]; + } + + } while (retCode == Z_OK); + + // If the loop exits, it used all input and the stream ended. + NSAssert(strm.avail_in == 0, + @"Should have finished deflating without using all input, %u bytes left", strm.avail_in); + NSAssert(retCode == Z_STREAM_END, + @"thought we finished deflate w/o getting a result of stream end, code %d", retCode); + + // Clean up. + deflateEnd(&strm); + + return result; +} + ++ (BOOL)isGzipped:(NSData *)data { + const UInt8 *bytes = (const UInt8 *)data.bytes; + return (data.length >= 2 && bytes[0] == 0x1f && bytes[1] == 0x8b); +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m new file mode 100644 index 0000000..ece3bae --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m @@ -0,0 +1,270 @@ +/* + * 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 "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h" + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_OSX +#import +#endif // TARGET_OS_IOS || TARGET_OS_TV + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import +#import +#import + +#import "GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h" + +#pragma mark - General purpose encoders + +pb_bytes_array_t *GDTCCTEncodeString(NSString *string) { + NSData *stringBytes = [string dataUsingEncoding:NSUTF8StringEncoding]; + return GDTCCTEncodeData(stringBytes); +} + +pb_bytes_array_t *GDTCCTEncodeData(NSData *data) { + 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; +} + +#pragma mark - CCT object constructors + +NSData *_Nullable GDTCCTEncodeBatchedLogRequest(gdt_cct_BatchedLogRequest *batchedLogRequest) { + pb_ostream_t sizestream = PB_OSTREAM_SIZING; + // Encode 1 time to determine the size. + if (!pb_encode(&sizestream, gdt_cct_BatchedLogRequest_fields, batchedLogRequest)) { + GDTCORLogError(GDTCORMCEGeneralError, @"Error in nanopb encoding for size: %s", + PB_GET_ERROR(&sizestream)); + } + + // 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, gdt_cct_BatchedLogRequest_fields, batchedLogRequest)) { + GDTCORLogError(GDTCORMCEGeneralError, @"Error in nanopb encoding for bytes: %s", + PB_GET_ERROR(&ostream)); + } + + return CFBridgingRelease(dataRef); +} + +gdt_cct_BatchedLogRequest GDTCCTConstructBatchedLogRequest( + NSDictionary *> *logMappingIDToLogSet) { + gdt_cct_BatchedLogRequest batchedLogRequest = gdt_cct_BatchedLogRequest_init_default; + NSUInteger numberOfLogRequests = logMappingIDToLogSet.count; + gdt_cct_LogRequest *logRequests = calloc(numberOfLogRequests, sizeof(gdt_cct_LogRequest)); + if (logRequests == NULL) { + return batchedLogRequest; + } + + __block int i = 0; + [logMappingIDToLogSet enumerateKeysAndObjectsUsingBlock:^(NSString *_Nonnull logMappingID, + NSSet *_Nonnull logSet, + BOOL *_Nonnull stop) { + int32_t logSource = [logMappingID intValue]; + gdt_cct_LogRequest logRequest = GDTCCTConstructLogRequest(logSource, logSet); + logRequests[i] = logRequest; + i++; + }]; + + batchedLogRequest.log_request = logRequests; + batchedLogRequest.log_request_count = (pb_size_t)numberOfLogRequests; + return batchedLogRequest; +} + +gdt_cct_LogRequest GDTCCTConstructLogRequest(int32_t logSource, + NSSet *_Nonnull logSet) { + if (logSet.count == 0) { + GDTCORLogError(GDTCORMCEGeneralError, @"%@", + @"An empty event set can't be serialized to proto."); + gdt_cct_LogRequest logRequest = gdt_cct_LogRequest_init_default; + return logRequest; + } + gdt_cct_LogRequest logRequest = gdt_cct_LogRequest_init_default; + logRequest.log_source = logSource; + logRequest.has_log_source = 1; + logRequest.client_info = GDTCCTConstructClientInfo(); + logRequest.has_client_info = 1; + logRequest.log_event = calloc(logSet.count, sizeof(gdt_cct_LogEvent)); + if (logRequest.log_event == NULL) { + return logRequest; + } + int i = 0; + for (GDTCOREvent *log in logSet) { + gdt_cct_LogEvent logEvent = GDTCCTConstructLogEvent(log); + logRequest.log_event[i] = logEvent; + i++; + } + logRequest.log_event_count = (pb_size_t)logSet.count; + + GDTCORClock *currentTime = [GDTCORClock snapshot]; + logRequest.request_time_ms = currentTime.timeMillis; + logRequest.has_request_time_ms = 1; + logRequest.request_uptime_ms = [currentTime uptimeMilliseconds]; + logRequest.has_request_uptime_ms = 1; + + return logRequest; +} + +gdt_cct_LogEvent GDTCCTConstructLogEvent(GDTCOREvent *event) { + gdt_cct_LogEvent logEvent = gdt_cct_LogEvent_init_default; + logEvent.event_time_ms = event.clockSnapshot.timeMillis; + logEvent.has_event_time_ms = 1; + logEvent.event_uptime_ms = [event.clockSnapshot uptimeMilliseconds]; + logEvent.has_event_uptime_ms = 1; + logEvent.timezone_offset_seconds = event.clockSnapshot.timezoneOffsetSeconds; + logEvent.has_timezone_offset_seconds = 1; + if (event.customBytes) { + NSData *networkConnectionInfoData = event.networkConnectionInfoData; + if (networkConnectionInfoData) { + [networkConnectionInfoData getBytes:&logEvent.network_connection_info + length:networkConnectionInfoData.length]; + logEvent.has_network_connection_info = 1; + } + NSNumber *eventCode = event.eventCode; + if (eventCode != nil) { + logEvent.has_event_code = 1; + logEvent.event_code = [eventCode intValue]; + } + } + NSError *error; + NSData *extensionBytes; + extensionBytes = event.serializedDataObjectBytes; + if (error) { + GDTCORLogWarning(GDTCORMCWFileReadError, + @"There was an error reading extension bytes from disk: %@", error); + return logEvent; + } + logEvent.source_extension = GDTCCTEncodeData(extensionBytes); // read bytes from the file. + return logEvent; +} + +gdt_cct_ClientInfo GDTCCTConstructClientInfo() { + gdt_cct_ClientInfo clientInfo = gdt_cct_ClientInfo_init_default; + clientInfo.client_type = gdt_cct_ClientInfo_ClientType_IOS_FIREBASE; + clientInfo.has_client_type = 1; +#if TARGET_OS_IOS || TARGET_OS_TV + clientInfo.ios_client_info = GDTCCTConstructiOSClientInfo(); + clientInfo.has_ios_client_info = 1; +#elif TARGET_OS_OSX + // TODO(mikehaney24): Expand the proto to include macOS client info. +#endif + return clientInfo; +} + +gdt_cct_IosClientInfo GDTCCTConstructiOSClientInfo() { + gdt_cct_IosClientInfo iOSClientInfo = gdt_cct_IosClientInfo_init_default; +#if TARGET_OS_IOS || TARGET_OS_TV + UIDevice *device = [UIDevice currentDevice]; + NSBundle *bundle = [NSBundle mainBundle]; + NSLocale *locale = [NSLocale currentLocale]; + iOSClientInfo.os_full_version = GDTCCTEncodeString(device.systemVersion); + NSArray *versionComponents = [device.systemVersion componentsSeparatedByString:@"."]; + iOSClientInfo.os_major_version = GDTCCTEncodeString(versionComponents[0]); + NSString *version = [bundle objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; + if (version) { + iOSClientInfo.application_build = GDTCCTEncodeString(version); + } + NSString *countryCode = [locale objectForKey:NSLocaleCountryCode]; + if (countryCode) { + iOSClientInfo.country = GDTCCTEncodeString([locale objectForKey:NSLocaleCountryCode]); + } + iOSClientInfo.model = GDTCCTEncodeString(GDTCORDeviceModel()); + NSString *languageCode = bundle.preferredLocalizations.firstObject; + iOSClientInfo.language_code = + languageCode ? GDTCCTEncodeString(languageCode) : GDTCCTEncodeString(@"en"); + iOSClientInfo.application_bundle_id = GDTCCTEncodeString(bundle.bundleIdentifier); +#endif + return iOSClientInfo; +} + +NSData *GDTCCTConstructNetworkConnectionInfoData() { + gdt_cct_NetworkConnectionInfo networkConnectionInfo = gdt_cct_NetworkConnectionInfo_init_default; + NSInteger currentNetworkType = GDTCORNetworkTypeMessage(); + if (currentNetworkType) { + networkConnectionInfo.has_network_type = 1; + if (currentNetworkType == GDTCORNetworkTypeMobile) { + networkConnectionInfo.network_type = gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE; + networkConnectionInfo.mobile_subtype = GDTCCTNetworkConnectionInfoNetworkMobileSubtype(); + if (networkConnectionInfo.mobile_subtype != + gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE) { + networkConnectionInfo.has_mobile_subtype = 1; + } + } else { + networkConnectionInfo.network_type = gdt_cct_NetworkConnectionInfo_NetworkType_WIFI; + } + } + NSData *networkConnectionInfoData = [NSData dataWithBytes:&networkConnectionInfo + length:sizeof(networkConnectionInfo)]; + return networkConnectionInfoData; +} + +gdt_cct_NetworkConnectionInfo_MobileSubtype GDTCCTNetworkConnectionInfoNetworkMobileSubtype() { + NSNumber *networkMobileSubtypeMessage = @(GDTCORNetworkMobileSubTypeMessage()); + if (!networkMobileSubtypeMessage.intValue) { + return gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE; + } + static NSDictionary *MessageToNetworkSubTypeMessage; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + MessageToNetworkSubTypeMessage = @{ + @(GDTCORNetworkMobileSubtypeGPRS) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_GPRS), + @(GDTCORNetworkMobileSubtypeEdge) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_EDGE), + @(GDTCORNetworkMobileSubtypeWCDMA) : + @(gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE), + @(GDTCORNetworkMobileSubtypeHSDPA) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_HSDPA), + @(GDTCORNetworkMobileSubtypeHSUPA) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_HSUPA), + @(GDTCORNetworkMobileSubtypeCDMA1x) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_CDMA), + @(GDTCORNetworkMobileSubtypeCDMAEVDORev0) : + @(gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_0), + @(GDTCORNetworkMobileSubtypeCDMAEVDORevA) : + @(gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_A), + @(GDTCORNetworkMobileSubtypeCDMAEVDORevB) : + @(gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_B), + @(GDTCORNetworkMobileSubtypeHRPD) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_EHRPD), + @(GDTCORNetworkMobileSubtypeLTE) : @(gdt_cct_NetworkConnectionInfo_MobileSubtype_LTE), + }; + }); + NSNumber *networkMobileSubtype = MessageToNetworkSubTypeMessage[networkMobileSubtypeMessage]; + return networkMobileSubtype.intValue; +} + +#pragma mark - CCT Object decoders + +gdt_cct_LogResponse GDTCCTDecodeLogResponse(NSData *data, NSError **error) { + gdt_cct_LogResponse response = gdt_cct_LogResponse_init_default; + pb_istream_t istream = pb_istream_from_buffer([data bytes], [data length]); + if (!pb_decode(&istream, gdt_cct_LogResponse_fields, &response)) { + NSString *nanopb_error = [NSString stringWithFormat:@"%s", PB_GET_ERROR(&istream)]; + NSDictionary *userInfo = @{@"nanopb error:" : nanopb_error}; + if (error != NULL) { + *error = [NSError errorWithDomain:NSURLErrorDomain code:-1 userInfo:userInfo]; + } + response = (gdt_cct_LogResponse)gdt_cct_LogResponse_init_default; + } + return response; +} diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m new file mode 100644 index 0000000..f3887df --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m @@ -0,0 +1,573 @@ +/* + * 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 "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h" + +#if __has_include() +#import +#else +#import "FBLPromises.h" +#endif + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import +#import +#import + +#import +#import +#import "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h" +#import "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h" + +#import "GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h" + +NS_ASSUME_NONNULL_BEGIN + +#ifdef GDTCOR_VERSION +#define STR(x) STR_EXPAND(x) +#define STR_EXPAND(x) #x +static NSString *const kGDTCCTSupportSDKVersion = @STR(GDTCOR_VERSION); +#else +static NSString *const kGDTCCTSupportSDKVersion = @"UNKNOWN"; +#endif // GDTCOR_VERSION + +typedef void (^GDTCCTUploaderURLTaskCompletion)(NSNumber *batchID, + NSSet *_Nullable events, + NSData *_Nullable data, + NSURLResponse *_Nullable response, + NSError *_Nullable error); + +typedef void (^GDTCCTUploaderEventBatchBlock)(NSNumber *_Nullable batchID, + NSSet *_Nullable events); + +@interface GDTCCTUploadOperation () + +/// The properties to store parameters passed in the initializer. See the initialized docs for +/// details. +@property(nonatomic, readonly) GDTCORTarget target; +@property(nonatomic, readonly) GDTCORUploadConditions conditions; +@property(nonatomic, readonly) NSURL *uploadURL; +@property(nonatomic, readonly) id storage; +@property(nonatomic, readonly) id metadataProvider; + +/** The URL session that will attempt upload. */ +@property(nonatomic) NSURLSession *uploaderSession; + +/// NSOperation state properties implementation. +@property(nonatomic, readwrite, getter=isExecuting) BOOL executing; +@property(nonatomic, readwrite, getter=isFinished) BOOL finished; + +@property(nonatomic, readwrite) BOOL uploadAttempted; + +@end + +@implementation GDTCCTUploadOperation + +- (instancetype)initWithTarget:(GDTCORTarget)target + conditions:(GDTCORUploadConditions)conditions + uploadURL:(NSURL *)uploadURL + queue:(dispatch_queue_t)queue + storage:(id)storage + metadataProvider:(id)metadataProvider { + self = [super init]; + if (self) { + _uploaderQueue = queue; + _target = target; + _conditions = conditions; + _uploadURL = uploadURL; + _storage = storage; + _metadataProvider = metadataProvider; + } + return self; +} + +- (NSURLSession *)uploaderSessionCreateIfNeeded { + if (_uploaderSession == nil) { + NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration]; + _uploaderSession = [NSURLSession sessionWithConfiguration:config + delegate:self + delegateQueue:nil]; + } + return _uploaderSession; +} + +- (void)uploadTarget:(GDTCORTarget)target withConditions:(GDTCORUploadConditions)conditions { + __block GDTCORBackgroundIdentifier backgroundTaskID = GDTCORBackgroundIdentifierInvalid; + + dispatch_block_t backgroundTaskCompletion = ^{ + // End the background task if there was one. + if (backgroundTaskID != GDTCORBackgroundIdentifierInvalid) { + [[GDTCORApplication sharedApplication] endBackgroundTask:backgroundTaskID]; + backgroundTaskID = GDTCORBackgroundIdentifierInvalid; + } + }; + + backgroundTaskID = [[GDTCORApplication sharedApplication] + beginBackgroundTaskWithName:@"GDTCCTUploader-upload" + expirationHandler:^{ + if (backgroundTaskID != GDTCORBackgroundIdentifierInvalid) { + // Cancel the upload and complete delivery. + [self.currentTask cancel]; + + // End the background task. + backgroundTaskCompletion(); + } + }]; + + id storage = self.storage; + + // 1. Check if the conditions for the target are suitable. + [self isReadyToUploadTarget:target conditions:conditions] + .thenOn(self.uploaderQueue, + ^id(id result) { + // 2. Remove previously attempted batches + return [storage removeAllBatchesForTarget:target deleteEvents:NO]; + }) + .thenOn(self.uploaderQueue, + ^FBLPromise *(id result) { + // There may be a big amount of events stored, so creating a batch may be an + // expensive operation. + + // 3. Do a lightweight check if there are any events for the target first to + // finish early if there are no. + return [storage hasEventsForTarget:target]; + }) + .validateOn(self.uploaderQueue, + ^BOOL(NSNumber *hasEvents) { + // Stop operation if there are no events to upload. + return hasEvents.boolValue; + }) + .thenOn(self.uploaderQueue, + ^FBLPromise *(id result) { + if (self.isCancelled) { + return nil; + } + + // 4. Fetch events to upload. + GDTCORStorageEventSelector *eventSelector = [self eventSelectorTarget:target + withConditions:conditions]; + return [storage batchWithEventSelector:eventSelector + batchExpiration:[NSDate dateWithTimeIntervalSinceNow:600]]; + }) + .validateOn(self.uploaderQueue, + ^BOOL(GDTCORUploadBatch *batch) { + // 5. Validate batch. + return batch.batchID != nil && batch.events.count > 0; + }) + .thenOn(self.uploaderQueue, + ^FBLPromise *(GDTCORUploadBatch *batch) { + // A non-empty batch has been created, consider it as an upload attempt. + self.uploadAttempted = YES; + + // 6. Perform upload URL request. + return [self sendURLRequestWithBatch:batch target:target storage:storage]; + }) + .thenOn(self.uploaderQueue, + ^id(id result) { + // 7. Finish operation. + [self finishOperation]; + backgroundTaskCompletion(); + return nil; + }) + .catchOn(self.uploaderQueue, ^(NSError *error) { + // TODO: Maybe report the error to the client. + [self finishOperation]; + backgroundTaskCompletion(); + }); +} + +#pragma mark - Upload implementation details + +/** Sends URL request to upload the provided batch and handle the response. */ +- (FBLPromise *)sendURLRequestWithBatch:(GDTCORUploadBatch *)batch + target:(GDTCORTarget)target + storage:(id)storage { + NSNumber *batchID = batch.batchID; + + // 1. Send URL request. + return [self sendURLRequestWithBatch:batch target:target] + .thenOn( + self.uploaderQueue, + ^FBLPromise *(GULURLSessionDataResponse *response) { + // 2. Parse response and update the next upload time if can. + [self updateNextUploadTimeWithResponse:response forTarget:target]; + + // 3. Cleanup batch. + + // Only retry if one of these codes is returned: + // 429 - Too many requests; + // 5xx - Server errors. + NSInteger statusCode = response.HTTPResponse.statusCode; + if (statusCode == 429 || (statusCode >= 500 && statusCode < 600)) { + // Move the events back to the main storage to be uploaded on the next attempt. + return [storage removeBatchWithID:batchID deleteEvents:NO]; + } else { + if (statusCode >= 200 && statusCode <= 300) { + GDTCORLogDebug(@"CCT: batch %@ delivered", batchID); + } else { + GDTCORLogDebug( + @"CCT: batch %@ was rejected by the server and will be deleted with all events", + batchID); + } + + // The events are either delivered or unrecoverable broken, so remove the batch with + // events. + return [storage removeBatchWithID:batch.batchID deleteEvents:YES]; + } + }) + .recoverOn(self.uploaderQueue, ^id(NSError *error) { + // In the case of a network error move the events back to the main storage to be uploaded on + // the next attempt. + return [storage removeBatchWithID:batchID deleteEvents:NO]; + }); +} + +/** Composes and sends URL request. */ +- (FBLPromise *)sendURLRequestWithBatch:(GDTCORUploadBatch *)batch + target:(GDTCORTarget)target { + return [FBLPromise + onQueue:self.uploaderQueue + do:^NSURLRequest * { + // 1. Prepare URL request. + NSData *requestProtoData = [self constructRequestProtoWithEvents:batch.events]; + NSData *gzippedData = [GDTCCTCompressionHelper gzippedData:requestProtoData]; + BOOL usingGzipData = + gzippedData != nil && gzippedData.length < requestProtoData.length; + NSData *dataToSend = usingGzipData ? gzippedData : requestProtoData; + NSURLRequest *request = [self constructRequestWithURL:self.uploadURL + forTarget:target + data:dataToSend]; + GDTCORLogDebug(@"CTT: request containing %lu events for batch: %@ for target: " + @"%ld created: %@", + (unsigned long)batch.events.count, batch.batchID, (long)target, + request); + return request; + }] + .thenOn(self.uploaderQueue, + ^FBLPromise *(NSURLRequest *request) { + // 2. Send URL request. + return + [[self uploaderSessionCreateIfNeeded] gul_dataTaskPromiseWithRequest:request]; + }) + .thenOn(self.uploaderQueue, + ^GULURLSessionDataResponse *(GULURLSessionDataResponse *response) { + // Invalidate session to release the delegate (which is `self`) to break the retain + // cycle. + [self.uploaderSession finishTasksAndInvalidate]; + return response; + }) + .recoverOn(self.uploaderQueue, ^id(NSError *error) { + // Invalidate session to release the delegate (which is `self`) to break the retain cycle. + [self.uploaderSession finishTasksAndInvalidate]; + // Re-throw the error. + return error; + }); +} + +/** Parses server response and update next upload time for the specified target based on it. */ +- (void)updateNextUploadTimeWithResponse:(GULURLSessionDataResponse *)response + forTarget:(GDTCORTarget)target { + GDTCORClock *futureUploadTime; + if (response.HTTPBody) { + NSError *decodingError; + gdt_cct_LogResponse logResponse = GDTCCTDecodeLogResponse(response.HTTPBody, &decodingError); + if (!decodingError && logResponse.has_next_request_wait_millis) { + GDTCORLogDebug(@"CCT: The backend responded asking to not upload for %lld millis from now.", + logResponse.next_request_wait_millis); + futureUploadTime = + [GDTCORClock clockSnapshotInTheFuture:logResponse.next_request_wait_millis]; + } else if (decodingError) { + GDTCORLogDebug(@"There was a response decoding error: %@", decodingError); + } + pb_release(gdt_cct_LogResponse_fields, &logResponse); + } + + // If no futureUploadTime was parsed from the response body, then check + // [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header. + if (!futureUploadTime) { + NSString *retryAfterHeader = response.HTTPResponse.allHeaderFields[@"Retry-After"]; + if (retryAfterHeader.length > 0) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + NSNumber *retryAfterSeconds = [formatter numberFromString:retryAfterHeader]; + if (retryAfterSeconds != nil) { + uint64_t retryAfterMillis = retryAfterSeconds.unsignedIntegerValue * 1000u; + futureUploadTime = [GDTCORClock clockSnapshotInTheFuture:retryAfterMillis]; + } + } + } + + if (!futureUploadTime) { + GDTCORLogDebug(@"%@", @"CCT: The backend response failed to parse, so the next request " + @"won't occur until 15 minutes from now"); + // 15 minutes from now. + futureUploadTime = [GDTCORClock clockSnapshotInTheFuture:15 * 60 * 1000]; + } + + [self.metadataProvider setNextUploadTime:futureUploadTime forTarget:target]; +} + +#pragma mark - Private helper methods + +/** @return A resolved promise if is ready and a rejected promise if not. */ +- (FBLPromise *)isReadyToUploadTarget:(GDTCORTarget)target + conditions:(GDTCORUploadConditions)conditions { + FBLPromise *promise = [FBLPromise pendingPromise]; + if ([self readyToUploadTarget:target conditions:conditions]) { + [promise fulfill:[NSNull null]]; + } else { + NSString *reason = + [NSString stringWithFormat:@"Target %ld is not ready to upload with condition: %ld", + (long)target, (long)conditions]; + [promise reject:[self genericRejectedPromiseErrorWithReason:reason]]; + } + return promise; +} + +// TODO: Move to a separate class/extension/file when needed in other files. +/** Returns an error object with the specified failure reason. */ +- (NSError *)genericRejectedPromiseErrorWithReason:(NSString *)reason { + return [NSError errorWithDomain:@"GDTCCTUploader" + code:-1 + userInfo:@{NSLocalizedFailureReasonErrorKey : reason}]; +} + +/** Returns if the specified target is ready to be uploaded based on the specified conditions. */ +- (BOOL)readyToUploadTarget:(GDTCORTarget)target conditions:(GDTCORUploadConditions)conditions { + // Not ready to upload with no network connection. + // TODO: Reconsider using reachability to prevent an upload attempt. + // See https://developer.apple.com/videos/play/wwdc2019/712/ (49:40) for more details. + if (conditions & GDTCORUploadConditionNoNetwork) { + GDTCORLogDebug(@"%@", @"CCT: Not ready to upload without a network connection."); + return NO; + } + + // Upload events with no additional conditions if high priority. + if ((conditions & GDTCORUploadConditionHighPriority) == GDTCORUploadConditionHighPriority) { + GDTCORLogDebug(@"%@", @"CCT: a high priority event is allowing an upload"); + return YES; + } + + // Check next upload time for the target. + BOOL isAfterNextUploadTime = YES; + GDTCORClock *nextUploadTime = [self.metadataProvider nextUploadTimeForTarget:target]; + if (nextUploadTime) { + isAfterNextUploadTime = [[GDTCORClock snapshot] isAfter:nextUploadTime]; + } + + if (isAfterNextUploadTime) { + GDTCORLogDebug(@"CCT: can upload to target %ld because the request wait time has transpired", + (long)target); + } else { + GDTCORLogDebug(@"CCT: can't upload to target %ld because the backend asked to wait", + (long)target); + } + + return isAfterNextUploadTime; +} + +/** Constructs data given an upload package. + * + * @param events The events used to construct the request proto bytes. + * @return Proto bytes representing a gdt_cct_LogRequest object. + */ +- (nonnull NSData *)constructRequestProtoWithEvents:(NSSet *)events { + // Segment the log events by log type. + NSMutableDictionary *> *logMappingIDToLogSet = + [[NSMutableDictionary alloc] init]; + [events enumerateObjectsUsingBlock:^(GDTCOREvent *_Nonnull event, BOOL *_Nonnull stop) { + NSMutableSet *logSet = logMappingIDToLogSet[event.mappingID]; + logSet = logSet ? logSet : [[NSMutableSet alloc] init]; + [logSet addObject:event]; + logMappingIDToLogSet[event.mappingID] = logSet; + }]; + + gdt_cct_BatchedLogRequest batchedLogRequest = + GDTCCTConstructBatchedLogRequest(logMappingIDToLogSet); + + NSData *data = GDTCCTEncodeBatchedLogRequest(&batchedLogRequest); + pb_release(gdt_cct_BatchedLogRequest_fields, &batchedLogRequest); + return data ? data : [[NSData alloc] init]; +} + +/** Constructs a request to the given URL and target with the specified request body data. + * + * @param target The target backend to send the request to. + * @param data The request body data. + * @return A new NSURLRequest ready to be sent to FLL. + */ +- (nullable NSURLRequest *)constructRequestWithURL:(NSURL *)URL + forTarget:(GDTCORTarget)target + data:(NSData *)data { + if (data == nil || data.length == 0) { + GDTCORLogDebug(@"There was no data to construct a request for target %ld.", (long)target); + return nil; + } + + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; + NSString *targetString; + switch (target) { + case kGDTCORTargetCCT: + targetString = @"cct"; + break; + + case kGDTCORTargetFLL: + targetString = @"fll"; + break; + + case kGDTCORTargetCSH: + targetString = @"csh"; + break; + case kGDTCORTargetINT: + targetString = @"int"; + break; + + default: + targetString = @"unknown"; + break; + } + NSString *userAgent = + [NSString stringWithFormat:@"datatransport/%@ %@support/%@ apple/", kGDTCORVersion, + targetString, kGDTCCTSupportSDKVersion]; + + [request setValue:[self.metadataProvider APIKeyForTarget:target] + forHTTPHeaderField:@"X-Goog-Api-Key"]; + + if ([GDTCCTCompressionHelper isGzipped:data]) { + [request setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"]; + } + [request setValue:@"application/x-protobuf" forHTTPHeaderField:@"Content-Type"]; + [request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; + [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; + request.HTTPMethod = @"POST"; + [request setHTTPBody:data]; + return request; +} + +/** Creates and returns a storage event selector for the specified target and conditions. */ +- (GDTCORStorageEventSelector *)eventSelectorTarget:(GDTCORTarget)target + withConditions:(GDTCORUploadConditions)conditions { + if ((conditions & GDTCORUploadConditionHighPriority) == GDTCORUploadConditionHighPriority) { + return [GDTCORStorageEventSelector eventSelectorForTarget:target]; + } + NSMutableSet *qosTiers = [[NSMutableSet alloc] init]; + if (conditions & GDTCORUploadConditionWifiData) { + [qosTiers addObjectsFromArray:@[ + @(GDTCOREventQoSFast), @(GDTCOREventQoSWifiOnly), @(GDTCOREventQosDefault), + @(GDTCOREventQoSTelemetry), @(GDTCOREventQoSUnknown) + ]]; + } + if (conditions & GDTCORUploadConditionMobileData) { + [qosTiers addObjectsFromArray:@[ @(GDTCOREventQoSFast), @(GDTCOREventQosDefault) ]]; + } + + return [[GDTCORStorageEventSelector alloc] initWithTarget:target + eventIDs:nil + mappingIDs:nil + qosTiers:qosTiers]; +} + +#pragma mark - NSURLSessionDelegate + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + willPerformHTTPRedirection:(NSHTTPURLResponse *)response + newRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLRequest *_Nullable))completionHandler { + if (!completionHandler) { + return; + } + if (response.statusCode == 302 || response.statusCode == 301) { + NSURLRequest *newRequest = [self constructRequestWithURL:request.URL + forTarget:kGDTCORTargetCCT + data:task.originalRequest.HTTPBody]; + completionHandler(newRequest); + } else { + completionHandler(request); + } +} + +#pragma mark - NSOperation methods + +@synthesize executing = _executing; +@synthesize finished = _finished; + +- (BOOL)isFinished { + @synchronized(self) { + return _finished; + } +} + +- (BOOL)isExecuting { + @synchronized(self) { + return _executing; + } +} + +- (BOOL)isAsynchronous { + return YES; +} + +- (void)startOperation { + @synchronized(self) { + [self willChangeValueForKey:@"isExecuting"]; + [self willChangeValueForKey:@"isFinished"]; + self->_executing = YES; + self->_finished = NO; + [self didChangeValueForKey:@"isExecuting"]; + [self didChangeValueForKey:@"isFinished"]; + } +} + +- (void)finishOperation { + @synchronized(self) { + [self willChangeValueForKey:@"isExecuting"]; + [self willChangeValueForKey:@"isFinished"]; + self->_executing = NO; + self->_finished = YES; + [self didChangeValueForKey:@"isExecuting"]; + [self didChangeValueForKey:@"isFinished"]; + } +} + +- (void)start { + [self startOperation]; + + GDTCORLogDebug(@"Upload operation started: %@", self); + [self uploadTarget:self.target withConditions:self.conditions]; +} + +- (void)cancel { + @synchronized(self) { + [super cancel]; + + // If the operation hasn't been started we can set `isFinished = YES` straight away. + if (!_executing) { + _executing = NO; + _finished = YES; + } + } +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m new file mode 100644 index 0000000..d25dc54 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m @@ -0,0 +1,210 @@ +/* + * 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 "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface GDTCCTUploader () + +@property(nonatomic, readonly) NSOperationQueue *uploadOperationQueue; +@property(nonatomic, readonly) dispatch_queue_t uploadQueue; + +@property(nonatomic, readonly) + NSMutableDictionary *nextUploadTimeByTarget; + +@end + +@implementation GDTCCTUploader + +static NSURL *_testServerURL = nil; + ++ (void)load { + GDTCCTUploader *uploader = [GDTCCTUploader sharedInstance]; + [[GDTCORRegistrar sharedInstance] registerUploader:uploader target:kGDTCORTargetCCT]; + [[GDTCORRegistrar sharedInstance] registerUploader:uploader target:kGDTCORTargetFLL]; + [[GDTCORRegistrar sharedInstance] registerUploader:uploader target:kGDTCORTargetCSH]; + [[GDTCORRegistrar sharedInstance] registerUploader:uploader target:kGDTCORTargetINT]; +} + ++ (instancetype)sharedInstance { + static GDTCCTUploader *sharedInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[GDTCCTUploader alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _uploadQueue = dispatch_queue_create("com.google.GDTCCTUploader", DISPATCH_QUEUE_SERIAL); + _uploadOperationQueue = [[NSOperationQueue alloc] init]; + _uploadOperationQueue.maxConcurrentOperationCount = 1; + _nextUploadTimeByTarget = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)uploadTarget:(GDTCORTarget)target withConditions:(GDTCORUploadConditions)conditions { + // Current GDTCCTUploader expected behaviour: + // 1. Accept multiple upload request + // 2. Verify if there are events eligible for upload and start upload for the first suitable + // target + // 3. Ignore other requests while an upload is in-progress. + + // TODO: Revisit expected behaviour. + // Potentially better option: + // 1. Accept and enqueue all upload requests + // 2. Notify the client of upload stages + // 3. Allow the client cancelling upload requests as needed. + + id storage = GDTCORStoragePromiseInstanceForTarget(target); + if (storage == nil) { + GDTCORLogError(GDTCORMCEGeneralError, + @"Failed to upload target: %ld - could not find corresponding storage instance.", + (long)target); + return; + } + + GDTCCTUploadOperation *uploadOperation = + [[GDTCCTUploadOperation alloc] initWithTarget:target + conditions:conditions + uploadURL:[[self class] serverURLForTarget:target] + queue:self.uploadQueue + storage:storage + metadataProvider:self]; + + GDTCORLogDebug(@"Upload operation created: %@, target: %@", uploadOperation, @(target)); + + __weak __auto_type weakSelf = self; + __weak GDTCCTUploadOperation *weakOperation = uploadOperation; + uploadOperation.completionBlock = ^{ + __auto_type strongSelf = weakSelf; + GDTCCTUploadOperation *strongOperation = weakOperation; + if (strongSelf == nil || strongOperation == nil) { + GDTCORLogDebug(@"Internal inconsistency: GDTCCTUploader was deallocated during upload.", nil); + return; + } + + GDTCORLogDebug(@"Upload operation finished: %@, uploadAttempted: %@", strongOperation, + @(strongOperation.uploadAttempted)); + + if (strongOperation.uploadAttempted) { + // Ignore all upload requests received when the upload was in progress. + [strongSelf.uploadOperationQueue cancelAllOperations]; + } + }; + + [self.uploadOperationQueue addOperation:uploadOperation]; + GDTCORLogDebug(@"Upload operation scheduled: %@, operation count: %@", uploadOperation, + @(self.uploadOperationQueue.operationCount)); +} + +#pragma mark - URLs + ++ (void)setTestServerURL:(NSURL *_Nullable)serverURL { + _testServerURL = serverURL; +} + ++ (NSURL *_Nullable)testServerURL { + return _testServerURL; +} + ++ (nullable NSURL *)serverURLForTarget:(GDTCORTarget)target { +#if !NDEBUG + if (_testServerURL) { + return _testServerURL; + } +#endif // !NDEBUG + + return [GDTCOREndpoints uploadURLForTarget:target]; +} + +- (NSString *)FLLAndCSHAndINTAPIKey { + static NSString *defaultServerKey; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // These strings should be interleaved to construct the real key. + const char *p1 = "AzSBG0honD6A-PxV5nBc"; + const char *p2 = "Iay44Iwtu2vV0AOrz1C"; + const char defaultKey[40] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], + p1[4], p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], + p1[8], p2[8], p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], + p1[12], p2[12], p1[13], p2[13], p1[14], p2[14], p1[15], p2[15], + p1[16], p2[16], p1[17], p2[17], p1[18], p2[18], p1[19], '\0'}; + defaultServerKey = [NSString stringWithUTF8String:defaultKey]; + }); + return defaultServerKey; +} + +#pragma mark - GDTCCTUploadMetadataProvider + +- (nullable GDTCORClock *)nextUploadTimeForTarget:(GDTCORTarget)target { + @synchronized(self.nextUploadTimeByTarget) { + return self.nextUploadTimeByTarget[@(target)]; + } +} + +- (void)setNextUploadTime:(nullable GDTCORClock *)time forTarget:(GDTCORTarget)target { + @synchronized(self.nextUploadTimeByTarget) { + self.nextUploadTimeByTarget[@(target)] = time; + } +} + +- (nullable NSString *)APIKeyForTarget:(GDTCORTarget)target { + if (target == kGDTCORTargetFLL || target == kGDTCORTargetCSH) { + return [self FLLAndCSHAndINTAPIKey]; + } + + if (target == kGDTCORTargetINT) { + return [self FLLAndCSHAndINTAPIKey]; + } + + return nil; +} + +#if !NDEBUG + +- (BOOL)waitForUploadFinishedWithTimeout:(NSTimeInterval)timeout { + NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:timeout]; + while ([expirationDate compare:[NSDate date]] == NSOrderedDescending) { + if (self.uploadOperationQueue.operationCount == 0) { + return YES; + } else { + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + } + } + + GDTCORLogDebug(@"Uploader wait for finish timeout exceeded. Operations still in queue: %@", + self.uploadOperationQueue.operations); + return NO; +} + +#endif // !NDEBUG + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCOREvent+GDTCCTSupport.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCOREvent+GDTCCTSupport.m new file mode 100644 index 0000000..1c77b4c --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCOREvent+GDTCCTSupport.m @@ -0,0 +1,240 @@ +/* + * 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 "GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h" + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +NSString *const GDTCCTNeedsNetworkConnectionInfo = @"needs_network_connection_info"; + +NSString *const GDTCCTNetworkConnectionInfo = @"network_connection_info"; + +NSString *const GDTCCTEventCodeInfo = @"event_code_info"; + +@implementation GDTCOREvent (GDTCCTSupport) + +- (void)setNeedsNetworkConnectionInfoPopulated:(BOOL)needsNetworkConnectionInfoPopulated { + if (!needsNetworkConnectionInfoPopulated) { + if (!self.customBytes) { + return; + } + + // Make sure we don't destroy the eventCode data, if any is present. + @try { + NSError *error; + NSMutableDictionary *bytesDict = + [[NSJSONSerialization JSONObjectWithData:self.customBytes options:0 + error:&error] mutableCopy]; + if (error) { + GDTCORLogDebug(@"Error when setting an event's event_code: %@", error); + return; + } + NSNumber *eventCode = bytesDict[GDTCCTEventCodeInfo]; + if (eventCode != nil) { + self.customBytes = + [NSJSONSerialization dataWithJSONObject:@{GDTCCTEventCodeInfo : eventCode} + options:0 + error:&error]; + } + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when setting the event for needs_network_connection_info: %@", + exception); + } + } else { + @try { + NSError *error; + NSMutableDictionary *bytesDict; + if (self.customBytes) { + bytesDict = [[NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error] mutableCopy]; + if (error) { + GDTCORLogDebug(@"Error when setting an even'ts event_code: %@", error); + return; + } + } else { + bytesDict = [[NSMutableDictionary alloc] init]; + } + [bytesDict setObject:@YES forKey:GDTCCTNeedsNetworkConnectionInfo]; + self.customBytes = [NSJSONSerialization dataWithJSONObject:bytesDict options:0 error:&error]; + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when setting the event for needs_network_connection_info: %@", + exception); + } + } +} + +- (BOOL)needsNetworkConnectionInfoPopulated { + if (self.customBytes) { + @try { + NSError *error; + NSDictionary *bytesDict = [NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error]; + return bytesDict && !error && [bytesDict[GDTCCTNeedsNetworkConnectionInfo] boolValue]; + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when checking the event for needs_network_connection_info: %@", + exception); + } + } + return NO; +} + +- (void)setNetworkConnectionInfoData:(NSData *)networkConnectionInfoData { + @try { + NSError *error; + NSString *dataString = [networkConnectionInfoData base64EncodedStringWithOptions:0]; + if (dataString != nil) { + NSMutableDictionary *bytesDict; + if (self.customBytes) { + bytesDict = [[NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error] mutableCopy]; + if (error) { + GDTCORLogDebug(@"Error when setting an even'ts event_code: %@", error); + return; + } + } else { + bytesDict = [[NSMutableDictionary alloc] init]; + } + [bytesDict setObject:dataString forKey:GDTCCTNetworkConnectionInfo]; + self.customBytes = [NSJSONSerialization dataWithJSONObject:bytesDict options:0 error:&error]; + if (error) { + self.customBytes = nil; + GDTCORLogDebug(@"Error when setting an event's network_connection_info: %@", error); + } + } + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when setting an event's network_connection_info: %@", exception); + } +} + +- (nullable NSData *)networkConnectionInfoData { + if (self.customBytes) { + @try { + NSError *error; + NSDictionary *bytesDict = [NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error]; + NSString *base64Data = bytesDict[GDTCCTNetworkConnectionInfo]; + if (base64Data == nil) { + return nil; + } + + NSData *networkConnectionInfoData = [[NSData alloc] initWithBase64EncodedString:base64Data + options:0]; + if (error) { + GDTCORLogDebug(@"Error when getting an event's network_connection_info: %@", error); + return nil; + } else { + return networkConnectionInfoData; + } + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when getting an event's network_connection_info: %@", exception); + } + } + return nil; +} + +- (NSNumber *)eventCode { + if (self.customBytes) { + @try { + NSError *error; + NSDictionary *bytesDict = [NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error]; + NSString *eventCodeString = bytesDict[GDTCCTEventCodeInfo]; + + if (!eventCodeString) { + return nil; + } + + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + NSNumber *eventCode = [formatter numberFromString:eventCodeString]; + + if (error) { + GDTCORLogDebug(@"Error when getting an event's network_connection_info: %@", error); + return nil; + } else { + return eventCode; + } + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when getting an event's event_code: %@", exception); + } + } + return nil; +} + +- (void)setEventCode:(NSNumber *)eventCode { + if (eventCode == nil) { + if (!self.customBytes) { + return; + } + + NSError *error; + NSMutableDictionary *bytesDict = [[NSJSONSerialization JSONObjectWithData:self.customBytes + options:0 + error:&error] mutableCopy]; + if (error) { + GDTCORLogDebug(@"Error when setting an event's event_code: %@", error); + return; + } + + [bytesDict removeObjectForKey:GDTCCTEventCodeInfo]; + self.customBytes = [NSJSONSerialization dataWithJSONObject:bytesDict options:0 error:&error]; + if (error) { + self.customBytes = nil; + GDTCORLogDebug(@"Error when setting an event's event_code: %@", error); + return; + } + return; + } + + @try { + NSMutableDictionary *bytesDict; + NSError *error; + if (self.customBytes) { + bytesDict = [[NSJSONSerialization JSONObjectWithData:self.customBytes options:0 + error:&error] mutableCopy]; + if (error) { + GDTCORLogDebug(@"Error when setting an event's event_code: %@", error); + return; + } + } else { + bytesDict = [[NSMutableDictionary alloc] init]; + } + + NSString *eventCodeString = [eventCode stringValue]; + if (eventCodeString == nil) { + return; + } + + [bytesDict setObject:eventCodeString forKey:GDTCCTEventCodeInfo]; + + self.customBytes = [NSJSONSerialization dataWithJSONObject:bytesDict options:0 error:&error]; + if (error) { + self.customBytes = nil; + GDTCORLogDebug(@"Error when setting an event's network_connection_info: %@", error); + return; + } + + } @catch (NSException *exception) { + GDTCORLogDebug(@"Error when getting an event's network_connection_info: %@", exception); + } +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h new file mode 100644 index 0000000..b53dd5f --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h @@ -0,0 +1,40 @@ +/* + * 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 + +NS_ASSUME_NONNULL_BEGIN + +/** A class with methods to help with gzipped data. */ +@interface GDTCCTCompressionHelper : NSObject + +/** Compresses the given data and returns a new data object. + * + * @note Reduced version from GULNSData+zlib.m of GoogleUtilities. + * @return Compressed data, or nil if there was an error. + */ ++ (nullable NSData *)gzippedData:(NSData *)data; + +/** Returns YES if the data looks like it was gzip compressed by checking for the gzip magic number. + * + * @note: From https://en.wikipedia.org/wiki/Gzip, gzip's magic number is 1f 8b. + * @return YES if the data appears gzipped, NO otherwise. + */ ++ (BOOL)isGzipped:(NSData *)data; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h new file mode 100644 index 0000000..8372cf9 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.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. + */ + +#import + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - General purpose encoders + +/** Converts an NSString* to a pb_bytes_array_t*. + * + * @note calloc is called in this method. Ensure that pb_release is called on this or the parent. + * + * @param string The string to convert. + * @return A newly allocated array of bytes representing the UTF8 encoding of the string. + */ +pb_bytes_array_t *GDTCCTEncodeString(NSString *string); + +/** Converts an NSData to a pb_bytes_array_t*. + * + * @note calloc is called in this method. Ensure that pb_release is called on this or the parent. + * + * @param data The data to convert. + * @return A newly allocated array of bytes with [data bytes] copied into it. + */ +pb_bytes_array_t *GDTCCTEncodeData(NSData *data); + +#pragma mark - CCT object constructors + +/** Encodes a batched log request. + * + * @note Ensure that pb_release is called on the batchedLogRequest param. + * + * @param batchedLogRequest A pointer to the log batch to encode to bytes. + * @return An NSData object representing the bytes of the log request batch. + */ +FOUNDATION_EXPORT +NSData *GDTCCTEncodeBatchedLogRequest(gdt_cct_BatchedLogRequest *batchedLogRequest); + +/** Constructs a gdt_cct_BatchedLogRequest given sets of events segemented by mapping ID. + * + * @note calloc is called in this method. Ensure that pb_release is called on this or the parent. + * + * @param logMappingIDToLogSet A map of mapping IDs to sets of events to convert into a batch. + * @return A newly created gdt_cct_BatchedLogRequest. + */ +FOUNDATION_EXPORT +gdt_cct_BatchedLogRequest GDTCCTConstructBatchedLogRequest( + NSDictionary *> *logMappingIDToLogSet); + +/** Constructs a log request given a log source and a set of events. + * + * @note calloc is called in this method. Ensure that pb_release is called on this or the parent. + * @param logSource The CCT log source to put into the log request. + * @param logSet The set of events to send in this log request. + */ +FOUNDATION_EXPORT +gdt_cct_LogRequest GDTCCTConstructLogRequest(int32_t logSource, NSSet *logSet); + +/** Constructs a gdt_cct_LogEvent given a GDTCOREvent*. + * + * @param event The GDTCOREvent to convert. + * @return The new gdt_cct_LogEvent object. + */ +FOUNDATION_EXPORT +gdt_cct_LogEvent GDTCCTConstructLogEvent(GDTCOREvent *event); + +/** Constructs a gdt_cct_ClientInfo representing the client device. + * + * @return The new gdt_cct_ClientInfo object. + */ +FOUNDATION_EXPORT +gdt_cct_ClientInfo GDTCCTConstructClientInfo(void); + +/** Constructs a gdt_cct_IosClientInfo representing the client device. + * + * @return The new gdt_cct_IosClientInfo object. + */ +FOUNDATION_EXPORT +gdt_cct_IosClientInfo GDTCCTConstructiOSClientInfo(void); + +/** Constructs the data of a gdt_cct_NetworkConnectionInfo representing the client nework connection + * information. + * + * @return The data of a gdt_cct_NetworkConnectionInfo object. + */ +FOUNDATION_EXPORT +NSData *GDTCCTConstructNetworkConnectionInfoData(void); + +/** Return a gdt_cct_NetworkConnectionInfo_MobileSubtype representing the client + * + * @return The gdt_cct_NetworkConnectionInfo_MobileSubtype. + */ +FOUNDATION_EXPORT +gdt_cct_NetworkConnectionInfo_MobileSubtype GDTCCTNetworkConnectionInfoNetworkMobileSubtype(void); + +#pragma mark - CCT object decoders + +/** Decodes a gdt_cct_LogResponse given proto bytes. + * + * @note calloc is called in this method. Ensure that pb_release is called on the return value. + * + * @param data The proto bytes of the gdt_cct_LogResponse. + * @param error An error that will be populated if something went wrong during decoding. + * @return A newly allocated gdt_cct_LogResponse from the data, if the bytes decoded properly. + */ +FOUNDATION_EXPORT +gdt_cct_LogResponse GDTCCTDecodeLogResponse(NSData *data, NSError **error); + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h new file mode 100644 index 0000000..3f63644 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h @@ -0,0 +1,76 @@ +/* + * 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/Internal/GDTCORUploader.h" + +@protocol GDTCORStoragePromiseProtocol; + +NS_ASSUME_NONNULL_BEGIN + +/// The protocol defines methods to retrieve/update data shared between different upload operations. +@protocol GDTCCTUploadMetadataProvider + +/** Returns a GDTCORClock object representing time after which a next upload attempt is allowed for + * the specified target. Upload is allowed now if `nil`. */ +- (nullable GDTCORClock *)nextUploadTimeForTarget:(GDTCORTarget)target; + +/** Stores or resets time after which a next upload attempt is allowed for the specified target. */ +- (void)setNextUploadTime:(nullable GDTCORClock *)time forTarget:(GDTCORTarget)target; + +/** Returns an API key for the specified target. */ +- (nullable NSString *)APIKeyForTarget:(GDTCORTarget)target; + +@end + +/** Class capable of uploading events to the CCT backend. */ +@interface GDTCCTUploadOperation : NSOperation + +- (instancetype)init NS_UNAVAILABLE; + +/** The designated initializer. + * @param target The events target to upload. + * @param conditions A set of upload conditions. The conditions affect the set of events to be + * uploaded, e.g. events with some QoS are not uploaded on a cellular network, etc. + * @param uploadURL The backend URL to upload the events. + * @param queue A queue to dispatch async upload steps. + * @param storage A storage object to fetch events for upload. + * @param metadataProvider An object to retrieve/update data shared between different upload + * operations. + * @return An instance of GDTCCTUploadOperation ready to be added to an NSOperationQueue. + */ +- (instancetype)initWithTarget:(GDTCORTarget)target + conditions:(GDTCORUploadConditions)conditions + uploadURL:(NSURL *)uploadURL + queue:(dispatch_queue_t)queue + storage:(id)storage + metadataProvider:(id)metadataProvider + NS_DESIGNATED_INITIALIZER; + +/** YES if a batch upload attempt was performed. NO otherwise. If NO for the finished operation, + * then there were no events suitable for upload. */ +@property(nonatomic, readonly) BOOL uploadAttempted; + +/** The queue on which all CCT uploading will occur. */ +@property(nonatomic, readonly) dispatch_queue_t uploaderQueue; + +/** The current upload task. */ +@property(nullable, nonatomic, readonly) NSURLSessionUploadTask *currentTask; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h new file mode 100644 index 0000000..876fbe1 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h @@ -0,0 +1,45 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Class capable of uploading events to the CCT backend. */ +@interface GDTCCTUploader : NSObject + +/** Creates and/or returns the singleton instance of this class. + * + * @return The singleton instance of this class. + */ ++ (instancetype)sharedInstance; + +#if !NDEBUG +/** An upload URL used across all targets. For testing only. */ +@property(class, nullable, nonatomic) NSURL *testServerURL; + +/** Spins runloop until upload finishes or timeout. + * @return YES if upload finishes, NO in the case of timeout. + */ +- (BOOL)waitForUploadFinishedWithTimeout:(NSTimeInterval)timeout; + +#endif // !NDEBUG + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c new file mode 100644 index 0000000..2f5327e --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c @@ -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. + */ + +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.9.7 */ + +#include "GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h" + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +const gdt_cct_NetworkConnectionInfo_NetworkType gdt_cct_NetworkConnectionInfo_network_type_default = gdt_cct_NetworkConnectionInfo_NetworkType_NONE; +const gdt_cct_NetworkConnectionInfo_MobileSubtype gdt_cct_NetworkConnectionInfo_mobile_subtype_default = gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE; +const gdt_cct_QosTierConfiguration_QosTier gdt_cct_LogRequest_qos_tier_default = gdt_cct_QosTierConfiguration_QosTier_DEFAULT; +const int32_t gdt_cct_QosTierConfiguration_log_source_default = 0; + + +const pb_field_t gdt_cct_LogEvent_fields[7] = { + PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, gdt_cct_LogEvent, event_time_ms, event_time_ms, 0), + PB_FIELD( 6, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_LogEvent, source_extension, event_time_ms, 0), + PB_FIELD( 11, INT32 , OPTIONAL, STATIC , OTHER, gdt_cct_LogEvent, event_code, source_extension, 0), + PB_FIELD( 15, SINT64 , OPTIONAL, STATIC , OTHER, gdt_cct_LogEvent, timezone_offset_seconds, event_code, 0), + PB_FIELD( 17, INT64 , OPTIONAL, STATIC , OTHER, gdt_cct_LogEvent, event_uptime_ms, timezone_offset_seconds, 0), + PB_FIELD( 23, MESSAGE , OPTIONAL, STATIC , OTHER, gdt_cct_LogEvent, network_connection_info, event_uptime_ms, &gdt_cct_NetworkConnectionInfo_fields), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_NetworkConnectionInfo_fields[3] = { + PB_FIELD( 1, ENUM , OPTIONAL, STATIC , FIRST, gdt_cct_NetworkConnectionInfo, network_type, network_type, &gdt_cct_NetworkConnectionInfo_network_type_default), + PB_FIELD( 2, UENUM , OPTIONAL, STATIC , OTHER, gdt_cct_NetworkConnectionInfo, mobile_subtype, network_type, &gdt_cct_NetworkConnectionInfo_mobile_subtype_default), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_IosClientInfo_fields[8] = { + PB_FIELD( 3, BYTES , OPTIONAL, POINTER , FIRST, gdt_cct_IosClientInfo, os_major_version, os_major_version, 0), + PB_FIELD( 4, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, os_full_version, os_major_version, 0), + PB_FIELD( 5, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, application_build, os_full_version, 0), + PB_FIELD( 6, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, country, application_build, 0), + PB_FIELD( 7, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, model, country, 0), + PB_FIELD( 8, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, language_code, model, 0), + PB_FIELD( 11, BYTES , OPTIONAL, POINTER , OTHER, gdt_cct_IosClientInfo, application_bundle_id, language_code, 0), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_ClientInfo_fields[3] = { + PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, gdt_cct_ClientInfo, client_type, client_type, 0), + PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, gdt_cct_ClientInfo, ios_client_info, client_type, &gdt_cct_IosClientInfo_fields), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_BatchedLogRequest_fields[2] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, gdt_cct_BatchedLogRequest, log_request, log_request, &gdt_cct_LogRequest_fields), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_LogRequest_fields[7] = { + PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, gdt_cct_LogRequest, client_info, client_info, &gdt_cct_ClientInfo_fields), + PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, gdt_cct_LogRequest, log_source, client_info, 0), + PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, gdt_cct_LogRequest, log_event, log_source, &gdt_cct_LogEvent_fields), + PB_FIELD( 4, INT64 , OPTIONAL, STATIC , OTHER, gdt_cct_LogRequest, request_time_ms, log_event, 0), + PB_FIELD( 8, INT64 , OPTIONAL, STATIC , OTHER, gdt_cct_LogRequest, request_uptime_ms, request_time_ms, 0), + PB_FIELD( 9, UENUM , OPTIONAL, STATIC , OTHER, gdt_cct_LogRequest, qos_tier, request_uptime_ms, &gdt_cct_LogRequest_qos_tier_default), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_QosTierConfiguration_fields[3] = { + PB_FIELD( 2, UENUM , OPTIONAL, STATIC , FIRST, gdt_cct_QosTierConfiguration, qos_tier, qos_tier, 0), + PB_FIELD( 3, INT32 , OPTIONAL, STATIC , OTHER, gdt_cct_QosTierConfiguration, log_source, qos_tier, &gdt_cct_QosTierConfiguration_log_source_default), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_QosTiersOverride_fields[3] = { + PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, gdt_cct_QosTiersOverride, qos_tier_configuration, qos_tier_configuration, &gdt_cct_QosTierConfiguration_fields), + PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, gdt_cct_QosTiersOverride, qos_tier_fingerprint, qos_tier_configuration, 0), + PB_LAST_FIELD +}; + +const pb_field_t gdt_cct_LogResponse_fields[3] = { + PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, gdt_cct_LogResponse, next_request_wait_millis, next_request_wait_millis, 0), + PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, gdt_cct_LogResponse, qos_tier, next_request_wait_millis, &gdt_cct_QosTiersOverride_fields), + PB_LAST_FIELD +}; + + + + + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(gdt_cct_LogEvent, network_connection_info) < 65536 && pb_membersize(gdt_cct_ClientInfo, ios_client_info) < 65536 && pb_membersize(gdt_cct_LogRequest, client_info) < 65536 && pb_membersize(gdt_cct_LogResponse, qos_tier) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_gdt_cct_LogEvent_gdt_cct_NetworkConnectionInfo_gdt_cct_IosClientInfo_gdt_cct_ClientInfo_gdt_cct_BatchedLogRequest_gdt_cct_LogRequest_gdt_cct_QosTierConfiguration_gdt_cct_QosTiersOverride_gdt_cct_LogResponse) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(gdt_cct_LogEvent, network_connection_info) < 256 && pb_membersize(gdt_cct_ClientInfo, ios_client_info) < 256 && pb_membersize(gdt_cct_LogRequest, client_info) < 256 && pb_membersize(gdt_cct_LogResponse, qos_tier) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_gdt_cct_LogEvent_gdt_cct_NetworkConnectionInfo_gdt_cct_IosClientInfo_gdt_cct_ClientInfo_gdt_cct_BatchedLogRequest_gdt_cct_LogRequest_gdt_cct_QosTierConfiguration_gdt_cct_QosTiersOverride_gdt_cct_LogResponse) +#endif + + +/* @@protoc_insertion_point(eof) */ diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h new file mode 100644 index 0000000..05bdf58 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h @@ -0,0 +1,281 @@ +/* + * 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. + */ + +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.9.7 */ + +#ifndef PB_GDT_CCT_CCT_NANOPB_H_INCLUDED +#define PB_GDT_CCT_CCT_NANOPB_H_INCLUDED +#include + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + +/* Enum definitions */ +typedef enum _gdt_cct_NetworkConnectionInfo_NetworkType { + gdt_cct_NetworkConnectionInfo_NetworkType_NONE = -1, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE = 0, + gdt_cct_NetworkConnectionInfo_NetworkType_WIFI = 1, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_MMS = 2, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_SUPL = 3, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_DUN = 4, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_HIPRI = 5, + gdt_cct_NetworkConnectionInfo_NetworkType_WIMAX = 6, + gdt_cct_NetworkConnectionInfo_NetworkType_BLUETOOTH = 7, + gdt_cct_NetworkConnectionInfo_NetworkType_DUMMY = 8, + gdt_cct_NetworkConnectionInfo_NetworkType_ETHERNET = 9, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_FOTA = 10, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_IMS = 11, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_CBS = 12, + gdt_cct_NetworkConnectionInfo_NetworkType_WIFI_P2P = 13, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_IA = 14, + gdt_cct_NetworkConnectionInfo_NetworkType_MOBILE_EMERGENCY = 15, + gdt_cct_NetworkConnectionInfo_NetworkType_PROXY = 16, + gdt_cct_NetworkConnectionInfo_NetworkType_VPN = 17 +} gdt_cct_NetworkConnectionInfo_NetworkType; +#define _gdt_cct_NetworkConnectionInfo_NetworkType_MIN gdt_cct_NetworkConnectionInfo_NetworkType_NONE +#define _gdt_cct_NetworkConnectionInfo_NetworkType_MAX gdt_cct_NetworkConnectionInfo_NetworkType_VPN +#define _gdt_cct_NetworkConnectionInfo_NetworkType_ARRAYSIZE ((gdt_cct_NetworkConnectionInfo_NetworkType)(gdt_cct_NetworkConnectionInfo_NetworkType_VPN+1)) + +typedef enum _gdt_cct_NetworkConnectionInfo_MobileSubtype { + gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE = 0, + gdt_cct_NetworkConnectionInfo_MobileSubtype_GPRS = 1, + gdt_cct_NetworkConnectionInfo_MobileSubtype_EDGE = 2, + gdt_cct_NetworkConnectionInfo_MobileSubtype_UMTS = 3, + gdt_cct_NetworkConnectionInfo_MobileSubtype_CDMA = 4, + gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_0 = 5, + gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_A = 6, + gdt_cct_NetworkConnectionInfo_MobileSubtype_RTT = 7, + gdt_cct_NetworkConnectionInfo_MobileSubtype_HSDPA = 8, + gdt_cct_NetworkConnectionInfo_MobileSubtype_HSUPA = 9, + gdt_cct_NetworkConnectionInfo_MobileSubtype_HSPA = 10, + gdt_cct_NetworkConnectionInfo_MobileSubtype_IDEN = 11, + gdt_cct_NetworkConnectionInfo_MobileSubtype_EVDO_B = 12, + gdt_cct_NetworkConnectionInfo_MobileSubtype_LTE = 13, + gdt_cct_NetworkConnectionInfo_MobileSubtype_EHRPD = 14, + gdt_cct_NetworkConnectionInfo_MobileSubtype_HSPAP = 15, + gdt_cct_NetworkConnectionInfo_MobileSubtype_GSM = 16, + gdt_cct_NetworkConnectionInfo_MobileSubtype_TD_SCDMA = 17, + gdt_cct_NetworkConnectionInfo_MobileSubtype_IWLAN = 18, + gdt_cct_NetworkConnectionInfo_MobileSubtype_LTE_CA = 19, + gdt_cct_NetworkConnectionInfo_MobileSubtype_COMBINED = 100 +} gdt_cct_NetworkConnectionInfo_MobileSubtype; +#define _gdt_cct_NetworkConnectionInfo_MobileSubtype_MIN gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE +#define _gdt_cct_NetworkConnectionInfo_MobileSubtype_MAX gdt_cct_NetworkConnectionInfo_MobileSubtype_COMBINED +#define _gdt_cct_NetworkConnectionInfo_MobileSubtype_ARRAYSIZE ((gdt_cct_NetworkConnectionInfo_MobileSubtype)(gdt_cct_NetworkConnectionInfo_MobileSubtype_COMBINED+1)) + +typedef enum _gdt_cct_ClientInfo_ClientType { + gdt_cct_ClientInfo_ClientType_CLIENT_UNKNOWN = 0, + gdt_cct_ClientInfo_ClientType_IOS_FIREBASE = 15 +} gdt_cct_ClientInfo_ClientType; +#define _gdt_cct_ClientInfo_ClientType_MIN gdt_cct_ClientInfo_ClientType_CLIENT_UNKNOWN +#define _gdt_cct_ClientInfo_ClientType_MAX gdt_cct_ClientInfo_ClientType_IOS_FIREBASE +#define _gdt_cct_ClientInfo_ClientType_ARRAYSIZE ((gdt_cct_ClientInfo_ClientType)(gdt_cct_ClientInfo_ClientType_IOS_FIREBASE+1)) + +typedef enum _gdt_cct_QosTierConfiguration_QosTier { + gdt_cct_QosTierConfiguration_QosTier_DEFAULT = 0, + gdt_cct_QosTierConfiguration_QosTier_UNMETERED_ONLY = 1, + gdt_cct_QosTierConfiguration_QosTier_UNMETERED_OR_DAILY = 2, + gdt_cct_QosTierConfiguration_QosTier_FAST_IF_RADIO_AWAKE = 3, + gdt_cct_QosTierConfiguration_QosTier_NEVER = 4 +} gdt_cct_QosTierConfiguration_QosTier; +#define _gdt_cct_QosTierConfiguration_QosTier_MIN gdt_cct_QosTierConfiguration_QosTier_DEFAULT +#define _gdt_cct_QosTierConfiguration_QosTier_MAX gdt_cct_QosTierConfiguration_QosTier_NEVER +#define _gdt_cct_QosTierConfiguration_QosTier_ARRAYSIZE ((gdt_cct_QosTierConfiguration_QosTier)(gdt_cct_QosTierConfiguration_QosTier_NEVER+1)) + +/* Struct definitions */ +typedef struct _gdt_cct_BatchedLogRequest { + pb_size_t log_request_count; + struct _gdt_cct_LogRequest *log_request; +/* @@protoc_insertion_point(struct:gdt_cct_BatchedLogRequest) */ +} gdt_cct_BatchedLogRequest; + +typedef struct _gdt_cct_IosClientInfo { + pb_bytes_array_t *os_major_version; + pb_bytes_array_t *os_full_version; + pb_bytes_array_t *application_build; + pb_bytes_array_t *country; + pb_bytes_array_t *model; + pb_bytes_array_t *language_code; + pb_bytes_array_t *application_bundle_id; +/* @@protoc_insertion_point(struct:gdt_cct_IosClientInfo) */ +} gdt_cct_IosClientInfo; + +typedef struct _gdt_cct_ClientInfo { + bool has_client_type; + gdt_cct_ClientInfo_ClientType client_type; + bool has_ios_client_info; + gdt_cct_IosClientInfo ios_client_info; +/* @@protoc_insertion_point(struct:gdt_cct_ClientInfo) */ +} gdt_cct_ClientInfo; + +typedef struct _gdt_cct_NetworkConnectionInfo { + bool has_network_type; + gdt_cct_NetworkConnectionInfo_NetworkType network_type; + bool has_mobile_subtype; + gdt_cct_NetworkConnectionInfo_MobileSubtype mobile_subtype; +/* @@protoc_insertion_point(struct:gdt_cct_NetworkConnectionInfo) */ +} gdt_cct_NetworkConnectionInfo; + +typedef struct _gdt_cct_QosTierConfiguration { + bool has_qos_tier; + gdt_cct_QosTierConfiguration_QosTier qos_tier; + bool has_log_source; + int32_t log_source; +/* @@protoc_insertion_point(struct:gdt_cct_QosTierConfiguration) */ +} gdt_cct_QosTierConfiguration; + +typedef struct _gdt_cct_QosTiersOverride { + pb_size_t qos_tier_configuration_count; + struct _gdt_cct_QosTierConfiguration *qos_tier_configuration; + bool has_qos_tier_fingerprint; + int64_t qos_tier_fingerprint; +/* @@protoc_insertion_point(struct:gdt_cct_QosTiersOverride) */ +} gdt_cct_QosTiersOverride; + +typedef struct _gdt_cct_LogEvent { + bool has_event_time_ms; + int64_t event_time_ms; + pb_bytes_array_t *source_extension; + bool has_event_code; + int32_t event_code; + bool has_timezone_offset_seconds; + int64_t timezone_offset_seconds; + bool has_event_uptime_ms; + int64_t event_uptime_ms; + bool has_network_connection_info; + gdt_cct_NetworkConnectionInfo network_connection_info; +/* @@protoc_insertion_point(struct:gdt_cct_LogEvent) */ +} gdt_cct_LogEvent; + +typedef struct _gdt_cct_LogRequest { + bool has_client_info; + gdt_cct_ClientInfo client_info; + bool has_log_source; + int32_t log_source; + pb_size_t log_event_count; + struct _gdt_cct_LogEvent *log_event; + bool has_request_time_ms; + int64_t request_time_ms; + bool has_request_uptime_ms; + int64_t request_uptime_ms; + bool has_qos_tier; + gdt_cct_QosTierConfiguration_QosTier qos_tier; +/* @@protoc_insertion_point(struct:gdt_cct_LogRequest) */ +} gdt_cct_LogRequest; + +typedef struct _gdt_cct_LogResponse { + bool has_next_request_wait_millis; + int64_t next_request_wait_millis; + bool has_qos_tier; + gdt_cct_QosTiersOverride qos_tier; +/* @@protoc_insertion_point(struct:gdt_cct_LogResponse) */ +} gdt_cct_LogResponse; + +/* Default values for struct fields */ +extern const gdt_cct_NetworkConnectionInfo_NetworkType gdt_cct_NetworkConnectionInfo_network_type_default; +extern const gdt_cct_NetworkConnectionInfo_MobileSubtype gdt_cct_NetworkConnectionInfo_mobile_subtype_default; +extern const gdt_cct_QosTierConfiguration_QosTier gdt_cct_LogRequest_qos_tier_default; +extern const int32_t gdt_cct_QosTierConfiguration_log_source_default; + +/* Initializer values for message structs */ +#define gdt_cct_LogEvent_init_default {false, 0, NULL, false, 0, false, 0, false, 0, false, gdt_cct_NetworkConnectionInfo_init_default} +#define gdt_cct_NetworkConnectionInfo_init_default {false, gdt_cct_NetworkConnectionInfo_NetworkType_NONE, false, gdt_cct_NetworkConnectionInfo_MobileSubtype_UNKNOWN_MOBILE_SUBTYPE} +#define gdt_cct_IosClientInfo_init_default {NULL, NULL, NULL, NULL, NULL, NULL, NULL} +#define gdt_cct_ClientInfo_init_default {false, _gdt_cct_ClientInfo_ClientType_MIN, false, gdt_cct_IosClientInfo_init_default} +#define gdt_cct_BatchedLogRequest_init_default {0, NULL} +#define gdt_cct_LogRequest_init_default {false, gdt_cct_ClientInfo_init_default, false, 0, 0, NULL, false, 0, false, 0, false, gdt_cct_QosTierConfiguration_QosTier_DEFAULT} +#define gdt_cct_QosTierConfiguration_init_default {false, _gdt_cct_QosTierConfiguration_QosTier_MIN, false, 0} +#define gdt_cct_QosTiersOverride_init_default {0, NULL, false, 0} +#define gdt_cct_LogResponse_init_default {false, 0, false, gdt_cct_QosTiersOverride_init_default} +#define gdt_cct_LogEvent_init_zero {false, 0, NULL, false, 0, false, 0, false, 0, false, gdt_cct_NetworkConnectionInfo_init_zero} +#define gdt_cct_NetworkConnectionInfo_init_zero {false, _gdt_cct_NetworkConnectionInfo_NetworkType_MIN, false, _gdt_cct_NetworkConnectionInfo_MobileSubtype_MIN} +#define gdt_cct_IosClientInfo_init_zero {NULL, NULL, NULL, NULL, NULL, NULL, NULL} +#define gdt_cct_ClientInfo_init_zero {false, _gdt_cct_ClientInfo_ClientType_MIN, false, gdt_cct_IosClientInfo_init_zero} +#define gdt_cct_BatchedLogRequest_init_zero {0, NULL} +#define gdt_cct_LogRequest_init_zero {false, gdt_cct_ClientInfo_init_zero, false, 0, 0, NULL, false, 0, false, 0, false, _gdt_cct_QosTierConfiguration_QosTier_MIN} +#define gdt_cct_QosTierConfiguration_init_zero {false, _gdt_cct_QosTierConfiguration_QosTier_MIN, false, 0} +#define gdt_cct_QosTiersOverride_init_zero {0, NULL, false, 0} +#define gdt_cct_LogResponse_init_zero {false, 0, false, gdt_cct_QosTiersOverride_init_zero} + +/* Field tags (for use in manual encoding/decoding) */ +#define gdt_cct_BatchedLogRequest_log_request_tag 1 +#define gdt_cct_IosClientInfo_os_major_version_tag 3 +#define gdt_cct_IosClientInfo_os_full_version_tag 4 +#define gdt_cct_IosClientInfo_application_build_tag 5 +#define gdt_cct_IosClientInfo_country_tag 6 +#define gdt_cct_IosClientInfo_model_tag 7 +#define gdt_cct_IosClientInfo_language_code_tag 8 +#define gdt_cct_IosClientInfo_application_bundle_id_tag 11 +#define gdt_cct_ClientInfo_client_type_tag 1 +#define gdt_cct_ClientInfo_ios_client_info_tag 4 +#define gdt_cct_NetworkConnectionInfo_network_type_tag 1 +#define gdt_cct_NetworkConnectionInfo_mobile_subtype_tag 2 +#define gdt_cct_QosTierConfiguration_qos_tier_tag 2 +#define gdt_cct_QosTierConfiguration_log_source_tag 3 +#define gdt_cct_QosTiersOverride_qos_tier_configuration_tag 1 +#define gdt_cct_QosTiersOverride_qos_tier_fingerprint_tag 2 +#define gdt_cct_LogEvent_event_time_ms_tag 1 +#define gdt_cct_LogEvent_event_code_tag 11 +#define gdt_cct_LogEvent_event_uptime_ms_tag 17 +#define gdt_cct_LogEvent_source_extension_tag 6 +#define gdt_cct_LogEvent_timezone_offset_seconds_tag 15 +#define gdt_cct_LogEvent_network_connection_info_tag 23 +#define gdt_cct_LogRequest_request_time_ms_tag 4 +#define gdt_cct_LogRequest_request_uptime_ms_tag 8 +#define gdt_cct_LogRequest_client_info_tag 1 +#define gdt_cct_LogRequest_log_source_tag 2 +#define gdt_cct_LogRequest_log_event_tag 3 +#define gdt_cct_LogRequest_qos_tier_tag 9 +#define gdt_cct_LogResponse_next_request_wait_millis_tag 1 +#define gdt_cct_LogResponse_qos_tier_tag 3 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t gdt_cct_LogEvent_fields[7]; +extern const pb_field_t gdt_cct_NetworkConnectionInfo_fields[3]; +extern const pb_field_t gdt_cct_IosClientInfo_fields[8]; +extern const pb_field_t gdt_cct_ClientInfo_fields[3]; +extern const pb_field_t gdt_cct_BatchedLogRequest_fields[2]; +extern const pb_field_t gdt_cct_LogRequest_fields[7]; +extern const pb_field_t gdt_cct_QosTierConfiguration_fields[3]; +extern const pb_field_t gdt_cct_QosTiersOverride_fields[3]; +extern const pb_field_t gdt_cct_LogResponse_fields[3]; + +/* Maximum encoded size of messages (where known) */ +/* gdt_cct_LogEvent_size depends on runtime parameters */ +#define gdt_cct_NetworkConnectionInfo_size 13 +/* gdt_cct_IosClientInfo_size depends on runtime parameters */ +/* gdt_cct_ClientInfo_size depends on runtime parameters */ +/* gdt_cct_BatchedLogRequest_size depends on runtime parameters */ +/* gdt_cct_LogRequest_size depends on runtime parameters */ +#define gdt_cct_QosTierConfiguration_size 13 +/* gdt_cct_QosTiersOverride_size depends on runtime parameters */ +/* gdt_cct_LogResponse_size depends on runtime parameters */ + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define CCT_MESSAGES \ + + +#endif + +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h new file mode 100644 index 0000000..295e6f8 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h @@ -0,0 +1,51 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +NS_ASSUME_NONNULL_BEGIN + +/** A string sets in customBytes as a key paired to @YES if current event needs to + * populate network connection info data, @NO otherwise. + */ +FOUNDATION_EXPORT NSString *const GDTCCTNeedsNetworkConnectionInfo; + +/** A string sets in customBytes as a key paired to the network connection info data + * of current event. + */ +FOUNDATION_EXPORT NSString *const GDTCCTNetworkConnectionInfo; + +/** A category that uses the customBytes property of a GDTCOREvent to store network connection info. + */ +@interface GDTCOREvent (GDTCCTSupport) + +/** If YES, needs the network connection info field set during prioritization. + * @note Uses the GDTCOREvent customBytes property. + */ +@property(nonatomic) BOOL needsNetworkConnectionInfoPopulated; + +/** The network connection info as collected at the time of the event. + * @note Uses the GDTCOREvent customBytes property. + */ +@property(nullable, nonatomic) NSData *networkConnectionInfoData; + +/** Code that identifies the event to be sent to the CCT backend. + */ +@property(nullable, nonatomic) NSNumber *eventCode; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORAssert.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORAssert.m new file mode 100644 index 0000000..14462ae --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORAssert.m @@ -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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" + +GDTCORAssertionBlock GDTCORAssertionBlockToRunInstead(void) { + // This class is only compiled in by unit tests, and this should fail quickly in optimized builds. + Class GDTCORAssertClass = NSClassFromString(@"GDTCORAssertHelper"); + if (__builtin_expect(!!GDTCORAssertClass, 0)) { + SEL assertionBlockSEL = NSSelectorFromString(@"assertionBlock"); + if (assertionBlockSEL) { + IMP assertionBlockIMP = [GDTCORAssertClass methodForSelector:assertionBlockSEL]; + if (assertionBlockIMP) { + GDTCORAssertionBlock assertionBlock = ((GDTCORAssertionBlock(*)(id, SEL))assertionBlockIMP)( + GDTCORAssertClass, assertionBlockSEL); + if (assertionBlock) { + return assertionBlock; + } + } + } + } + return NULL; +} diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORClock.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORClock.m new file mode 100644 index 0000000..85afeba --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORClock.m @@ -0,0 +1,178 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" + +#import + +// Using a monotonic clock is necessary because CFAbsoluteTimeGetCurrent(), NSDate, and related all +// are subject to drift. That it to say, multiple consecutive calls do not always result in a +// time that is in the future. Clocks may be adjusted by the user, NTP, or any number of external +// factors. This class attempts to determine the wall-clock time at the time of the event by +// capturing the kernel start and time since boot to determine a wallclock time in UTC. +// +// Timezone offsets at the time of a snapshot are also captured in order to provide local-time +// details. Other classes in this library depend on comparing times at some time in the future to +// a time captured in the past, and this class needs to provide a mechanism to do that. +// +// TL;DR: This class attempts to accomplish two things: 1. Provide accurate event times. 2. Provide +// a monotonic clock mechanism to accurately check if some clock snapshot was before or after +// by using a shared reference point (kernel boot time). +// +// Note: Much of the mach time stuff doesn't work properly in the simulator. So this class can be +// difficult to unit test. + +/** Returns the kernel boottime property from sysctl. + * + * Inspired by https://stackoverflow.com/a/40497811 + * + * @return The KERN_BOOTTIME property from sysctl, in nanoseconds. + */ +static int64_t KernelBootTimeInNanoseconds() { + // Caching the result is not possible because clock drift would not be accounted for. + struct timeval boottime; + int mib[2] = {CTL_KERN, KERN_BOOTTIME}; + size_t size = sizeof(boottime); + int rc = sysctl(mib, 2, &boottime, &size, NULL, 0); + if (rc != 0) { + return 0; + } + return (int64_t)boottime.tv_sec * NSEC_PER_SEC + (int64_t)boottime.tv_usec * NSEC_PER_USEC; +} + +/** Returns value of gettimeofday, in nanoseconds. + * + * Inspired by https://stackoverflow.com/a/40497811 + * + * @return The value of gettimeofday, in nanoseconds. + */ +static int64_t UptimeInNanoseconds() { + int64_t before_now_nsec; + int64_t after_now_nsec; + struct timeval now; + + before_now_nsec = KernelBootTimeInNanoseconds(); + // Addresses a race condition in which the system time has updated, but the boottime has not. + do { + gettimeofday(&now, NULL); + after_now_nsec = KernelBootTimeInNanoseconds(); + } while (after_now_nsec != before_now_nsec); + return (int64_t)now.tv_sec * NSEC_PER_SEC + (int64_t)now.tv_usec * NSEC_PER_USEC - + before_now_nsec; +} + +// TODO: Consider adding a 'trustedTime' property that can be populated by the response from a BE. +@implementation GDTCORClock + +- (instancetype)init { + self = [super init]; + if (self) { + _kernelBootTimeNanoseconds = KernelBootTimeInNanoseconds(); + _uptimeNanoseconds = UptimeInNanoseconds(); + _timeMillis = + (int64_t)((CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970) * NSEC_PER_USEC); + _timezoneOffsetSeconds = [[NSTimeZone systemTimeZone] secondsFromGMT]; + } + return self; +} + ++ (GDTCORClock *)snapshot { + return [[GDTCORClock alloc] init]; +} + ++ (instancetype)clockSnapshotInTheFuture:(uint64_t)millisInTheFuture { + GDTCORClock *snapshot = [self snapshot]; + snapshot->_timeMillis += millisInTheFuture; + return snapshot; +} + +- (BOOL)isAfter:(GDTCORClock *)otherClock { + // These clocks are trivially comparable when they share a kernel boot time. + if (_kernelBootTimeNanoseconds == otherClock->_kernelBootTimeNanoseconds) { + int64_t timeDiff = (_timeMillis + _timezoneOffsetSeconds) - + (otherClock->_timeMillis + otherClock->_timezoneOffsetSeconds); + return timeDiff > 0; + } else { + int64_t kernelBootTimeDiff = + otherClock->_kernelBootTimeNanoseconds - _kernelBootTimeNanoseconds; + // This isn't a great solution, but essentially, if the other clock's boot time is 'later', NO + // is returned. This can be altered by changing the system time and rebooting. + return kernelBootTimeDiff < 0 ? YES : NO; + } +} + +- (int64_t)uptimeMilliseconds { + return self.uptimeNanoseconds / NSEC_PER_MSEC; +} + +- (NSUInteger)hash { + return [@(_kernelBootTimeNanoseconds) hash] ^ [@(_uptimeNanoseconds) hash] ^ + [@(_timeMillis) hash] ^ [@(_timezoneOffsetSeconds) hash]; +} + +- (BOOL)isEqual:(id)object { + return [self hash] == [object hash]; +} + +#pragma mark - NSSecureCoding + +/** NSKeyedCoder key for timeMillis property. */ +static NSString *const kGDTCORClockTimeMillisKey = @"GDTCORClockTimeMillis"; + +/** NSKeyedCoder key for timezoneOffsetMillis property. */ +static NSString *const kGDTCORClockTimezoneOffsetSeconds = @"GDTCORClockTimezoneOffsetSeconds"; + +/** NSKeyedCoder key for _kernelBootTime ivar. */ +static NSString *const kGDTCORClockKernelBootTime = @"GDTCORClockKernelBootTime"; + +/** NSKeyedCoder key for _uptimeNanoseconds ivar. */ +static NSString *const kGDTCORClockUptime = @"GDTCORClockUptime"; + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + // TODO: If the kernelBootTimeNanoseconds is more recent, we need to change the kernel boot time + // and uptimeMillis ivars + _timeMillis = [aDecoder decodeInt64ForKey:kGDTCORClockTimeMillisKey]; + _timezoneOffsetSeconds = [aDecoder decodeInt64ForKey:kGDTCORClockTimezoneOffsetSeconds]; + _kernelBootTimeNanoseconds = [aDecoder decodeInt64ForKey:kGDTCORClockKernelBootTime]; + _uptimeNanoseconds = [aDecoder decodeInt64ForKey:kGDTCORClockUptime]; + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeInt64:_timeMillis forKey:kGDTCORClockTimeMillisKey]; + [aCoder encodeInt64:_timezoneOffsetSeconds forKey:kGDTCORClockTimezoneOffsetSeconds]; + [aCoder encodeInt64:_kernelBootTimeNanoseconds forKey:kGDTCORClockKernelBootTime]; + [aCoder encodeInt64:_uptimeNanoseconds forKey:kGDTCORClockUptime]; +} + +#pragma mark - Deprecated properties + +- (int64_t)kernelBootTime { + return self.kernelBootTimeNanoseconds; +} + +- (int64_t)uptime { + return self.uptimeNanoseconds; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORConsoleLogger.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORConsoleLogger.m new file mode 100644 index 0000000..5eaee92 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORConsoleLogger.m @@ -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. + */ + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +volatile NSInteger GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevelErrors; + +/** The console logger prefix. */ +static NSString *kGDTCORConsoleLogger = @"[GoogleDataTransport]"; + +NSString *GDTCORMessageCodeEnumToString(GDTCORMessageCode code) { + return [[NSString alloc] initWithFormat:@"I-GDTCOR%06ld", (long)code]; +} + +void GDTCORLog(GDTCORMessageCode code, GDTCORLoggingLevel logLevel, NSString *format, ...) { +// Don't log anything in not debug builds. +#if !NDEBUG + if (logLevel >= GDTCORConsoleLoggerLoggingLevel) { + NSString *logFormat = [NSString stringWithFormat:@"%@[%@] %@", kGDTCORConsoleLogger, + GDTCORMessageCodeEnumToString(code), format]; + va_list args; + va_start(args, format); + NSLogv(logFormat, args); + va_end(args); + } +#endif // !NDEBUG +} + +void GDTCORLogAssert( + BOOL wasFatal, NSString *_Nonnull file, NSInteger line, NSString *_Nullable format, ...) { +// Don't log anything in not debug builds. +#if !NDEBUG + GDTCORMessageCode code = wasFatal ? GDTCORMCEFatalAssertion : GDTCORMCEGeneralError; + NSString *logFormat = + [NSString stringWithFormat:@"%@[%@] (%@:%ld) : %@", kGDTCORConsoleLogger, + GDTCORMessageCodeEnumToString(code), file, (long)line, format]; + va_list args; + va_start(args, format); + NSLogv(logFormat, args); + va_end(args); +#endif // !NDEBUG +} diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORDirectorySizeTracker.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORDirectorySizeTracker.m new file mode 100644 index 0000000..0bc8515 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORDirectorySizeTracker.m @@ -0,0 +1,101 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h" + +@interface GDTCORDirectorySizeTracker () + +/** The observed directory path. */ +@property(nonatomic, readonly) NSString *directoryPath; + +/** The cached content size of the observed directory. */ +@property(nonatomic, nullable) NSNumber *cachedSizeBytes; + +@end + +@implementation GDTCORDirectorySizeTracker + +- (instancetype)initWithDirectoryPath:(NSString *)path { + self = [super init]; + if (self) { + _directoryPath = path; + } + return self; +} + +- (GDTCORStorageSizeBytes)directoryContentSize { + if (self.cachedSizeBytes == nil) { + self.cachedSizeBytes = @([self calculateDirectoryContentSize]); + } + + return self.cachedSizeBytes.unsignedLongLongValue; +} + +- (void)fileWasAddedAtPath:(NSString *)path withSize:(GDTCORStorageSizeBytes)fileSize { + if (![path hasPrefix:self.directoryPath]) { + // Ignore because the file is not inside the directory. + return; + } + + self.cachedSizeBytes = @([self directoryContentSize] + fileSize); +} + +- (void)fileWasRemovedAtPath:(NSString *)path withSize:(GDTCORStorageSizeBytes)fileSize { + if (![path hasPrefix:self.directoryPath]) { + // Ignore because the file is not inside the directory. + return; + } + + self.cachedSizeBytes = @([self directoryContentSize] - fileSize); +} + +- (void)resetCachedSize { + self.cachedSizeBytes = nil; +} + +- (GDTCORStorageSizeBytes)calculateDirectoryContentSize { + NSArray *prefetchedProperties = @[ NSURLIsRegularFileKey, NSURLFileSizeKey ]; + uint64_t totalBytes = 0; + NSURL *directoryURL = [NSURL fileURLWithPath:self.directoryPath]; + + NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] + enumeratorAtURL:directoryURL + includingPropertiesForKeys:prefetchedProperties + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:^BOOL(NSURL *_Nonnull url, NSError *_Nonnull error) { + return YES; + }]; + + for (NSURL *fileURL in enumerator) { + @autoreleasepool { + NSNumber *isRegularFile; + [fileURL getResourceValue:&isRegularFile forKey:NSURLIsRegularFileKey error:nil]; + if (isRegularFile.boolValue) { + totalBytes += [self fileSizeAtURL:fileURL]; + } + } + } + + return totalBytes; +} + +- (GDTCORStorageSizeBytes)fileSizeAtURL:(NSURL *)fileURL { + NSNumber *fileSize; + [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:nil]; + return fileSize.unsignedLongLongValue; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREndpoints.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREndpoints.m new file mode 100644 index 0000000..eacc7b4 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREndpoints.m @@ -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. + */ + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h" + +static NSString *const kINTServerURL = + @"https://dummyapiverylong-dummy.dummy.com/dummy/api/very/long"; + +@implementation GDTCOREndpoints + ++ (NSDictionary *)uploadURLs { + // These strings should be interleaved to construct the real URL. This is just to (hopefully) + // fool github URL scanning bots. + static NSURL *CCTServerURL; + static dispatch_once_t CCTOnceToken; + dispatch_once(&CCTOnceToken, ^{ + const char *p1 = "hts/frbslgiggolai.o/0clgbth"; + const char *p2 = "tp:/ieaeogn.ogepscmvc/o/ac"; + const char URL[54] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4], + p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8], + p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13], + p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17], + p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22], + p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], '\0'}; + CCTServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]]; + }); + + static NSURL *FLLServerURL; + static dispatch_once_t FLLOnceToken; + dispatch_once(&FLLOnceToken, ^{ + const char *p1 = "hts/frbslgigp.ogepscmv/ieo/eaybtho"; + const char *p2 = "tp:/ieaeogn-agolai.o/1frlglgc/aclg"; + const char URL[69] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4], + p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8], + p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13], + p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17], + p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22], + p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], p2[26], + p1[27], p2[27], p1[28], p2[28], p1[29], p2[29], p1[30], p2[30], p1[31], + p2[31], p1[32], p2[32], p1[33], p2[33], '\0'}; + FLLServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]]; + }); + + static NSURL *CSHServerURL; + static dispatch_once_t CSHOnceToken; + dispatch_once(&CSHOnceToken, ^{ + // These strings should be interleaved to construct the real URL. This is just to (hopefully) + // fool github URL scanning bots. + const char *p1 = "hts/cahyiseot-agolai.o/1frlglgc/aclg"; + const char *p2 = "tp:/rsltcrprsp.ogepscmv/ieo/eaybtho"; + const char URL[72] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4], + p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8], + p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13], + p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17], + p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22], + p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], p2[26], + p1[27], p2[27], p1[28], p2[28], p1[29], p2[29], p1[30], p2[30], p1[31], + p2[31], p1[32], p2[32], p1[33], p2[33], p1[34], p2[34], p1[35], '\0'}; + CSHServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]]; + }); + static NSDictionary *uploadURLs; + static dispatch_once_t URLOnceToken; + dispatch_once(&URLOnceToken, ^{ + uploadURLs = @{ + @(kGDTCORTargetCCT) : CCTServerURL, + @(kGDTCORTargetFLL) : FLLServerURL, + @(kGDTCORTargetCSH) : CSHServerURL, + @(kGDTCORTargetINT) : [NSURL URLWithString:kINTServerURL] + }; + }); + return uploadURLs; +} + ++ (nullable NSURL *)uploadURLForTarget:(GDTCORTarget)target { + NSDictionary *URLs = [self uploadURLs]; + return [URLs objectForKey:@(target)]; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREvent.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREvent.m new file mode 100644 index 0000000..5a8d324 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREvent.m @@ -0,0 +1,153 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h" + +@implementation GDTCOREvent + ++ (NSString *)nextEventID { + // Replace special non-alphanumeric characters to avoid potential conflicts with storage logic. + return [[NSUUID UUID].UUIDString stringByReplacingOccurrencesOfString:@"-" withString:@""]; +} + +- (nullable instancetype)initWithMappingID:(NSString *)mappingID target:(GDTCORTarget)target { + GDTCORAssert(mappingID.length > 0, @"Please give a valid mapping ID"); + GDTCORAssert(target > 0, @"A target cannot be negative or 0"); + if (mappingID.length == 0 || target <= 0) { + return nil; + } + self = [super init]; + if (self) { + _eventID = [GDTCOREvent nextEventID]; + _mappingID = mappingID; + _target = target; + _qosTier = GDTCOREventQosDefault; + _expirationDate = [NSDate dateWithTimeIntervalSinceNow:604800]; // 7 days. + + GDTCORLogDebug(@"Event %@ created. ID:%@ mappingID: %@ target:%ld", self, _eventID, mappingID, + (long)target); + } + + return self; +} + +- (instancetype)copy { + GDTCOREvent *copy = [[GDTCOREvent alloc] initWithMappingID:_mappingID target:_target]; + copy->_eventID = _eventID; + copy.dataObject = _dataObject; + copy.qosTier = _qosTier; + copy.clockSnapshot = _clockSnapshot; + copy.customBytes = _customBytes; + GDTCORLogDebug(@"Copying event %@ to event %@", self, copy); + return copy; +} + +- (NSUInteger)hash { + // This loses some precision, but it's probably fine. + NSUInteger eventIDHash = [_eventID hash]; + NSUInteger mappingIDHash = [_mappingID hash]; + NSUInteger timeHash = [_clockSnapshot hash]; + NSInteger serializedBytesHash = [_serializedDataObjectBytes hash]; + + return eventIDHash ^ mappingIDHash ^ _target ^ _qosTier ^ timeHash ^ serializedBytesHash; +} + +- (BOOL)isEqual:(id)object { + return [self hash] == [object hash]; +} + +#pragma mark - Property overrides + +- (void)setDataObject:(id)dataObject { + // If you're looking here because of a performance issue in -transportBytes slowing the assignment + // of -dataObject, one way to address this is to add a queue to this class, + // dispatch_(barrier_ if concurrent)async here, and implement the getter with a dispatch_sync. + if (dataObject != _dataObject) { + _dataObject = dataObject; + } + self->_serializedDataObjectBytes = [dataObject transportBytes]; +} + +#pragma mark - NSSecureCoding and NSCoding Protocols + +/** NSCoding key for eventID property. */ +static NSString *kEventIDKey = @"GDTCOREventEventIDKey"; + +/** NSCoding key for mappingID property. */ +static NSString *kMappingIDKey = @"GDTCOREventMappingIDKey"; + +/** NSCoding key for target property. */ +static NSString *kTargetKey = @"GDTCOREventTargetKey"; + +/** NSCoding key for qosTier property. */ +static NSString *kQoSTierKey = @"GDTCOREventQoSTierKey"; + +/** NSCoding key for clockSnapshot property. */ +static NSString *kClockSnapshotKey = @"GDTCOREventClockSnapshotKey"; + +/** NSCoding key for expirationDate property. */ +static NSString *kExpirationDateKey = @"GDTCOREventExpirationDateKey"; + +/** NSCoding key for serializedDataObjectBytes property. */ +static NSString *kSerializedDataObjectBytes = @"GDTCOREventSerializedDataObjectBytesKey"; + +/** NSCoding key for customData property. */ +static NSString *kCustomDataKey = @"GDTCOREventCustomDataKey"; + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [self init]; + if (self) { + _mappingID = [aDecoder decodeObjectOfClass:[NSString class] forKey:kMappingIDKey]; + _target = [aDecoder decodeIntegerForKey:kTargetKey]; + _eventID = [aDecoder decodeObjectOfClass:[NSString class] forKey:kEventIDKey] + ?: [GDTCOREvent nextEventID]; + _qosTier = [aDecoder decodeIntegerForKey:kQoSTierKey]; + _clockSnapshot = [aDecoder decodeObjectOfClass:[GDTCORClock class] forKey:kClockSnapshotKey]; + _customBytes = [aDecoder decodeObjectOfClass:[NSData class] forKey:kCustomDataKey]; + _expirationDate = [aDecoder decodeObjectOfClass:[NSDate class] forKey:kExpirationDateKey]; + _serializedDataObjectBytes = [aDecoder decodeObjectOfClass:[NSData class] + forKey:kSerializedDataObjectBytes]; + if (!_serializedDataObjectBytes) { + return nil; + } + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeObject:_eventID forKey:kEventIDKey]; + [aCoder encodeObject:_mappingID forKey:kMappingIDKey]; + [aCoder encodeInteger:_target forKey:kTargetKey]; + [aCoder encodeInteger:_qosTier forKey:kQoSTierKey]; + [aCoder encodeObject:_clockSnapshot forKey:kClockSnapshotKey]; + [aCoder encodeObject:_customBytes forKey:kCustomDataKey]; + [aCoder encodeObject:_expirationDate forKey:kExpirationDateKey]; + [aCoder encodeObject:self.serializedDataObjectBytes forKey:kSerializedDataObjectBytes]; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage+Promises.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage+Promises.m new file mode 100644 index 0000000..c3a22a8 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage+Promises.m @@ -0,0 +1,104 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage+Promises.h" + +#if __has_include() +#import +#else +#import "FBLPromises.h" +#endif + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h" + +@implementation GDTCORFlatFileStorage (Promises) + +- (FBLPromise *> *)batchIDsForTarget:(GDTCORTarget)target { + return [FBLPromise onQueue:self.storageQueue + wrapObjectCompletion:^(FBLPromiseObjectCompletion _Nonnull handler) { + [self batchIDsForTarget:target onComplete:handler]; + }]; +} + +- (FBLPromise *)removeBatchWithID:(NSNumber *)batchID deleteEvents:(BOOL)deleteEvents { + return [FBLPromise onQueue:self.storageQueue + wrapCompletion:^(FBLPromiseCompletion _Nonnull handler) { + [self removeBatchWithID:batchID deleteEvents:deleteEvents onComplete:handler]; + }]; +} + +- (FBLPromise *)removeBatchesWithIDs:(NSSet *)batchIDs + deleteEvents:(BOOL)deleteEvents { + NSMutableArray *removeBatchPromises = + [NSMutableArray arrayWithCapacity:batchIDs.count]; + for (NSNumber *batchID in batchIDs) { + [removeBatchPromises addObject:[self removeBatchWithID:batchID deleteEvents:deleteEvents]]; + } + + return [FBLPromise onQueue:self.storageQueue all:[removeBatchPromises copy]].thenOn( + self.storageQueue, ^id(id result) { + return [FBLPromise resolvedWith:[NSNull null]]; + }); +} + +- (FBLPromise *)removeAllBatchesForTarget:(GDTCORTarget)target + deleteEvents:(BOOL)deleteEvents { + return + [self batchIDsForTarget:target].thenOn(self.storageQueue, ^id(NSSet *batchIDs) { + if (batchIDs.count == 0) { + return [FBLPromise resolvedWith:[NSNull null]]; + } else { + return [self removeBatchesWithIDs:batchIDs deleteEvents:NO]; + } + }); +} + +- (FBLPromise *)hasEventsForTarget:(GDTCORTarget)target { + return [FBLPromise onQueue:self.storageQueue + wrapBoolCompletion:^(FBLPromiseBoolCompletion _Nonnull handler) { + [self hasEventsForTarget:target onComplete:handler]; + }]; +} + +- (FBLPromise *)batchWithEventSelector: + (GDTCORStorageEventSelector *)eventSelector + batchExpiration:(NSDate *)expiration { + return [FBLPromise + onQueue:self.storageQueue + async:^(FBLPromiseFulfillBlock _Nonnull fulfill, FBLPromiseRejectBlock _Nonnull reject) { + [self batchWithEventSelector:eventSelector + batchExpiration:expiration + onComplete:^(NSNumber *_Nullable newBatchID, + NSSet *_Nullable batchEvents) { + if (newBatchID == nil || batchEvents == nil) { + reject([self genericRejectedPromiseErrorWithReason: + @"There are no events for the selector."]); + } else { + fulfill([[GDTCORUploadBatch alloc] initWithBatchID:newBatchID + events:batchEvents]); + } + }]; + }]; +} + +// TODO: Move to a separate class/extension when needed in more places. +- (NSError *)genericRejectedPromiseErrorWithReason:(NSString *)reason { + return [NSError errorWithDomain:@"GDTCORFlatFileStorage" + code:-1 + userInfo:@{NSLocalizedFailureReasonErrorKey : reason}]; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage.m new file mode 100644 index 0000000..6e326d8 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage.m @@ -0,0 +1,826 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h" + +NS_ASSUME_NONNULL_BEGIN + +/** A library data key this class uses to track batchIDs. */ +static NSString *const gBatchIDCounterKey = @"GDTCORFlatFileStorageBatchIDCounter"; + +/** The separator used between metadata elements in filenames. */ +static NSString *const kMetadataSeparator = @"-"; + +NSString *const kGDTCOREventComponentsEventIDKey = @"GDTCOREventComponentsEventIDKey"; + +NSString *const kGDTCOREventComponentsQoSTierKey = @"GDTCOREventComponentsQoSTierKey"; + +NSString *const kGDTCOREventComponentsMappingIDKey = @"GDTCOREventComponentsMappingIDKey"; + +NSString *const kGDTCOREventComponentsExpirationKey = @"GDTCOREventComponentsExpirationKey"; + +NSString *const kGDTCORBatchComponentsTargetKey = @"GDTCORBatchComponentsTargetKey"; + +NSString *const kGDTCORBatchComponentsBatchIDKey = @"GDTCORBatchComponentsBatchIDKey"; + +NSString *const kGDTCORBatchComponentsExpirationKey = @"GDTCORBatchComponentsExpirationKey"; + +NSString *const GDTCORFlatFileStorageErrorDomain = @"GDTCORFlatFileStorage"; + +const uint64_t kGDTCORFlatFileStorageSizeLimit = 20 * 1000 * 1000; // 20 MB. + +@interface GDTCORFlatFileStorage () + +/** An instance of the size tracker to keep track of the disk space consumed by the storage. */ +@property(nonatomic, readonly) GDTCORDirectorySizeTracker *sizeTracker; + +@end + +@implementation GDTCORFlatFileStorage + +@synthesize sizeTracker = _sizeTracker; + ++ (void)load { +#if !NDEBUG + [[GDTCORRegistrar sharedInstance] registerStorage:[self sharedInstance] target:kGDTCORTargetTest]; +#endif // !NDEBUG + [[GDTCORRegistrar sharedInstance] registerStorage:[self sharedInstance] target:kGDTCORTargetCCT]; + [[GDTCORRegistrar sharedInstance] registerStorage:[self sharedInstance] target:kGDTCORTargetFLL]; + [[GDTCORRegistrar sharedInstance] registerStorage:[self sharedInstance] target:kGDTCORTargetCSH]; + [[GDTCORRegistrar sharedInstance] registerStorage:[self sharedInstance] target:kGDTCORTargetINT]; +} + ++ (instancetype)sharedInstance { + static GDTCORFlatFileStorage *sharedStorage; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedStorage = [[GDTCORFlatFileStorage alloc] init]; + }); + return sharedStorage; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _storageQueue = + dispatch_queue_create("com.google.GDTCORFlatFileStorage", DISPATCH_QUEUE_SERIAL); + _uploadCoordinator = [GDTCORUploadCoordinator sharedInstance]; + } + return self; +} + +- (GDTCORDirectorySizeTracker *)sizeTracker { + if (_sizeTracker == nil) { + _sizeTracker = + [[GDTCORDirectorySizeTracker alloc] initWithDirectoryPath:GDTCORRootDirectory().path]; + } + return _sizeTracker; +} + +#pragma mark - GDTCORStorageProtocol + +- (void)storeEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion { + GDTCORLogDebug(@"Saving event: %@", event); + if (event == nil || event.serializedDataObjectBytes == nil) { + GDTCORLogDebug(@"%@", @"The event was nil, so it was not saved."); + if (completion) { + completion(NO, [NSError errorWithDomain:NSInternalInconsistencyException + code:-1 + userInfo:nil]); + } + return; + } + if (!completion) { + completion = ^(BOOL wasWritten, NSError *_Nullable error) { + GDTCORLogDebug(@"event %@ stored. success:%@ error:%@", event, wasWritten ? @"YES" : @"NO", + error); + }; + } + + __block GDTCORBackgroundIdentifier bgID = GDTCORBackgroundIdentifierInvalid; + bgID = [[GDTCORApplication sharedApplication] + beginBackgroundTaskWithName:@"GDTStorage" + expirationHandler:^{ + // End the background task if it's still valid. + [[GDTCORApplication sharedApplication] endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }]; + + dispatch_async(_storageQueue, ^{ + // Check that a backend implementation is available for this target. + GDTCORTarget target = event.target; + NSString *filePath = [GDTCORFlatFileStorage pathForTarget:target + eventID:event.eventID + qosTier:@(event.qosTier) + expirationDate:event.expirationDate + mappingID:event.mappingID]; + NSError *error; + NSData *encodedEvent = GDTCOREncodeArchive(event, nil, &error); + if (error) { + completion(NO, error); + return; + } + + // Check storage size limit before storing the event. + uint64_t resultingStorageSize = self.sizeTracker.directoryContentSize + encodedEvent.length; + if (resultingStorageSize > kGDTCORFlatFileStorageSizeLimit) { + NSError *error = [NSError + errorWithDomain:GDTCORFlatFileStorageErrorDomain + code:GDTCORFlatFileStorageErrorSizeLimitReached + userInfo:@{ + NSLocalizedFailureReasonErrorKey : @"Storage size limit has been reached." + }]; + completion(NO, error); + return; + } + + // Write the encoded event to the file. + BOOL writeResult = GDTCORWriteDataToFile(encodedEvent, filePath, &error); + if (writeResult == NO || error) { + GDTCORLogDebug(@"Attempt to write archive failed: path:%@ error:%@", filePath, error); + completion(NO, error); + return; + } else { + GDTCORLogDebug(@"Writing archive succeeded: %@", filePath); + completion(YES, nil); + } + + // Notify size tracker. + [self.sizeTracker fileWasAddedAtPath:filePath withSize:encodedEvent.length]; + + // Check the QoS, if it's high priority, notify the target that it has a high priority event. + if (event.qosTier == GDTCOREventQoSFast) { + // TODO: Remove a direct dependency on the upload coordinator. + [self.uploadCoordinator forceUploadForTarget:target]; + } + + // Cancel or end the associated background task if it's still valid. + [[GDTCORApplication sharedApplication] endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }); +} + +- (void)batchWithEventSelector:(nonnull GDTCORStorageEventSelector *)eventSelector + batchExpiration:(nonnull NSDate *)expiration + onComplete: + (nonnull void (^)(NSNumber *_Nullable batchID, + NSSet *_Nullable events))onComplete { + dispatch_queue_t queue = _storageQueue; + void (^onPathsForTargetComplete)(NSNumber *, NSSet *_Nonnull) = ^( + NSNumber *batchID, NSSet *_Nonnull paths) { + dispatch_async(queue, ^{ + NSMutableSet *events = [[NSMutableSet alloc] init]; + for (NSString *eventPath in paths) { + NSError *error; + GDTCOREvent *event = + (GDTCOREvent *)GDTCORDecodeArchive([GDTCOREvent class], eventPath, nil, &error); + if (event == nil || error) { + GDTCORLogDebug(@"Error deserializing event: %@", error); + [[NSFileManager defaultManager] removeItemAtPath:eventPath error:nil]; + continue; + } else { + NSString *fileName = [eventPath lastPathComponent]; + NSString *batchPath = + [GDTCORFlatFileStorage batchPathForTarget:eventSelector.selectedTarget + batchID:batchID + expirationDate:expiration]; + [[NSFileManager defaultManager] createDirectoryAtPath:batchPath + withIntermediateDirectories:YES + attributes:nil + error:nil]; + NSString *destinationPath = [batchPath stringByAppendingPathComponent:fileName]; + error = nil; + [[NSFileManager defaultManager] moveItemAtPath:eventPath + toPath:destinationPath + error:&error]; + if (error) { + GDTCORLogDebug(@"An event file wasn't moveable into the batch directory: %@", error); + } + [events addObject:event]; + } + } + if (onComplete) { + if (events.count == 0) { + onComplete(nil, nil); + } else { + onComplete(batchID, events); + } + } + }); + }; + + void (^onBatchIDFetchComplete)(NSNumber *) = ^(NSNumber *batchID) { + dispatch_async(queue, ^{ + if (batchID == nil) { + if (onComplete) { + onComplete(nil, nil); + return; + } + } + [self pathsForTarget:eventSelector.selectedTarget + eventIDs:eventSelector.selectedEventIDs + qosTiers:eventSelector.selectedQosTiers + mappingIDs:eventSelector.selectedMappingIDs + onComplete:^(NSSet *_Nonnull paths) { + onPathsForTargetComplete(batchID, paths); + }]; + }); + }; + + [self nextBatchID:^(NSNumber *_Nullable batchID) { + if (batchID == nil) { + if (onComplete) { + onComplete(nil, nil); + } + } else { + onBatchIDFetchComplete(batchID); + } + }]; +} + +- (void)removeBatchWithID:(nonnull NSNumber *)batchID + deleteEvents:(BOOL)deleteEvents + onComplete:(void (^_Nullable)(void))onComplete { + dispatch_async(_storageQueue, ^{ + [self syncThreadUnsafeRemoveBatchWithID:batchID deleteEvents:deleteEvents]; + + if (onComplete) { + onComplete(); + } + }); +} + +- (void)batchIDsForTarget:(GDTCORTarget)target + onComplete:(nonnull void (^)(NSSet *_Nullable))onComplete { + dispatch_async(_storageQueue, ^{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error; + NSArray *batchPaths = + [fileManager contentsOfDirectoryAtPath:[GDTCORFlatFileStorage batchDataStoragePath] + error:&error]; + if (error || batchPaths.count == 0) { + if (onComplete) { + onComplete(nil); + } + return; + } + NSMutableSet *batchIDs = [[NSMutableSet alloc] init]; + for (NSString *path in batchPaths) { + NSDictionary *components = [self batchComponentsFromFilename:path]; + NSNumber *targetNumber = components[kGDTCORBatchComponentsTargetKey]; + NSNumber *batchID = components[kGDTCORBatchComponentsBatchIDKey]; + if (batchID != nil && targetNumber.intValue == target) { + [batchIDs addObject:batchID]; + } + } + if (onComplete) { + onComplete(batchIDs); + } + }); +} + +- (void)libraryDataForKey:(nonnull NSString *)key + onFetchComplete:(nonnull void (^)(NSData *_Nullable, NSError *_Nullable))onFetchComplete + setNewValue:(NSData *_Nullable (^_Nullable)(void))setValueBlock { + dispatch_async(_storageQueue, ^{ + NSString *dataPath = [[[self class] libraryDataStoragePath] stringByAppendingPathComponent:key]; + NSError *error; + NSData *data = [NSData dataWithContentsOfFile:dataPath options:0 error:&error]; + if (onFetchComplete) { + onFetchComplete(data, error); + } + if (setValueBlock) { + NSData *newValue = setValueBlock(); + // The -isKindOfClass check is necessary because without an explicit 'return nil' in the block + // the implicit return value will be the block itself. The compiler doesn't detect this. + if (newValue != nil && [newValue isKindOfClass:[NSData class]] && newValue.length) { + NSError *newValueError; + if ([newValue writeToFile:dataPath options:NSDataWritingAtomic error:&newValueError]) { + // Update storage size. + [self.sizeTracker fileWasRemovedAtPath:dataPath withSize:data.length]; + [self.sizeTracker fileWasAddedAtPath:dataPath withSize:newValue.length]; + } else { + GDTCORLogDebug(@"Error writing new value in libraryDataForKey: %@", newValueError); + } + } + } + }); +} + +- (void)storeLibraryData:(NSData *)data + forKey:(nonnull NSString *)key + onComplete:(nullable void (^)(NSError *_Nullable error))onComplete { + if (!data || data.length <= 0) { + if (onComplete) { + onComplete([NSError errorWithDomain:NSInternalInconsistencyException code:-1 userInfo:nil]); + } + return; + } + dispatch_async(_storageQueue, ^{ + NSError *error; + NSString *dataPath = [[[self class] libraryDataStoragePath] stringByAppendingPathComponent:key]; + if ([data writeToFile:dataPath options:NSDataWritingAtomic error:&error]) { + [self.sizeTracker fileWasAddedAtPath:dataPath withSize:data.length]; + } + if (onComplete) { + onComplete(error); + } + }); +} + +- (void)removeLibraryDataForKey:(nonnull NSString *)key + onComplete:(nonnull void (^)(NSError *_Nullable error))onComplete { + dispatch_async(_storageQueue, ^{ + NSError *error; + NSString *dataPath = [[[self class] libraryDataStoragePath] stringByAppendingPathComponent:key]; + GDTCORStorageSizeBytes fileSize = + [self.sizeTracker fileSizeAtURL:[NSURL fileURLWithPath:dataPath]]; + + if ([[NSFileManager defaultManager] fileExistsAtPath:dataPath]) { + if ([[NSFileManager defaultManager] removeItemAtPath:dataPath error:&error]) { + [self.sizeTracker fileWasRemovedAtPath:dataPath withSize:fileSize]; + } + if (onComplete) { + onComplete(error); + } + } + }); +} + +- (void)hasEventsForTarget:(GDTCORTarget)target onComplete:(void (^)(BOOL hasEvents))onComplete { + dispatch_async(_storageQueue, ^{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSString *targetPath = [NSString + stringWithFormat:@"%@/%ld", [GDTCORFlatFileStorage eventDataStoragePath], (long)target]; + [fileManager createDirectoryAtPath:targetPath + withIntermediateDirectories:YES + attributes:nil + error:nil]; + NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtPath:targetPath]; + BOOL hasEventAtLeastOneEvent = [enumerator nextObject] != nil; + if (onComplete) { + onComplete(hasEventAtLeastOneEvent); + } + }); +} + +- (void)checkForExpirations { + dispatch_async(_storageQueue, ^{ + GDTCORLogDebug(@"%@", @"Checking for expired events and batches"); + NSTimeInterval now = [NSDate date].timeIntervalSince1970; + NSFileManager *fileManager = [NSFileManager defaultManager]; + + // TODO: Storage may not have enough context to remove batches because a batch may be being + // uploaded but the storage has not context of it. + + // Find expired batches and move their events back to the main storage. + // If a batch contains expired events they are expected to be removed further in the method + // together with other expired events in the main storage. + NSString *batchDataPath = [GDTCORFlatFileStorage batchDataStoragePath]; + NSArray *batchDataPaths = [fileManager contentsOfDirectoryAtPath:batchDataPath + error:nil]; + for (NSString *path in batchDataPaths) { + @autoreleasepool { + NSString *fileName = [path lastPathComponent]; + NSDictionary *batchComponents = [self batchComponentsFromFilename:fileName]; + NSDate *expirationDate = batchComponents[kGDTCORBatchComponentsExpirationKey]; + NSNumber *batchID = batchComponents[kGDTCORBatchComponentsBatchIDKey]; + if (expirationDate != nil && expirationDate.timeIntervalSince1970 < now && batchID != nil) { + NSNumber *batchID = batchComponents[kGDTCORBatchComponentsBatchIDKey]; + // Move all events from the expired batch back to the main storage. + [self syncThreadUnsafeRemoveBatchWithID:batchID deleteEvents:NO]; + } + } + } + + // Find expired events and remove them from the storage. + NSString *eventDataPath = [GDTCORFlatFileStorage eventDataStoragePath]; + NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtPath:eventDataPath]; + NSString *path; + + while (YES) { + @autoreleasepool { + // Call `[enumerator nextObject]` under autorelease pool to make sure all autoreleased + // objects created under the hood are released on each iteration end to avoid unnecessary + // memory growth. + path = [enumerator nextObject]; + if (path == nil) { + break; + } + + NSString *fileName = [path lastPathComponent]; + NSDictionary *eventComponents = [self eventComponentsFromFilename:fileName]; + NSDate *expirationDate = eventComponents[kGDTCOREventComponentsExpirationKey]; + if (expirationDate != nil && expirationDate.timeIntervalSince1970 < now) { + NSString *pathToDelete = [eventDataPath stringByAppendingPathComponent:path]; + NSError *error; + [fileManager removeItemAtPath:pathToDelete error:&error]; + if (error != nil) { + GDTCORLogDebug(@"There was an error deleting an expired item: %@", error); + } else { + GDTCORLogDebug(@"Item deleted because it expired: %@", pathToDelete); + } + } + } + } + + [self.sizeTracker resetCachedSize]; + }); +} + +- (void)storageSizeWithCallback:(void (^)(uint64_t storageSize))onComplete { + if (!onComplete) { + return; + } + + dispatch_async(_storageQueue, ^{ + onComplete([self.sizeTracker directoryContentSize]); + }); +} + +#pragma mark - Private not thread safe methods +/** Looks for directory paths containing events for a batch with the specified ID. + * @param batchID A batch ID. + * @param outError A pointer to `NSError *` to assign as possible error to. + * @return An array of an array of paths to directories for event batches with a specified batch ID + * or `nil` in the case of an error. Usually returns a single path but potentially return more in + * cases when the app is terminated while uploading a batch. + */ +- (nullable NSArray *)batchDirPathsForBatchID:(NSNumber *)batchID + error:(NSError **_Nonnull)outError { + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error; + NSArray *batches = + [fileManager contentsOfDirectoryAtPath:[GDTCORFlatFileStorage batchDataStoragePath] + error:&error]; + if (batches == nil) { + *outError = error; + GDTCORLogDebug(@"Failed to find event file paths for batchID: %@, error: %@", batchID, error); + return nil; + } + + NSMutableArray *batchDirPaths = [NSMutableArray array]; + for (NSString *path in batches) { + NSDictionary *components = [self batchComponentsFromFilename:path]; + NSNumber *pathBatchID = components[kGDTCORBatchComponentsBatchIDKey]; + if ([pathBatchID isEqual:batchID]) { + NSString *batchDirPath = + [[GDTCORFlatFileStorage batchDataStoragePath] stringByAppendingPathComponent:path]; + [batchDirPaths addObject:batchDirPath]; + } + } + + return [batchDirPaths copy]; +} + +/** Makes a copy of the contents of a directory to a directory at the specified path.*/ +- (BOOL)moveContentsOfDirectoryAtPath:(NSString *)sourcePath + to:(NSString *)destinationPath + error:(NSError **_Nonnull)outError { + NSFileManager *fileManager = [NSFileManager defaultManager]; + + NSError *error; + NSArray *contentsPaths = [fileManager contentsOfDirectoryAtPath:sourcePath + error:&error]; + if (contentsPaths == nil) { + *outError = error; + return NO; + } + + NSMutableArray *errors = [NSMutableArray array]; + for (NSString *path in contentsPaths) { + NSString *contentDestinationPath = [destinationPath stringByAppendingPathComponent:path]; + NSString *contentSourcePath = [sourcePath stringByAppendingPathComponent:path]; + + NSError *moveError; + if (![fileManager moveItemAtPath:contentSourcePath + toPath:contentDestinationPath + error:&moveError] && + moveError) { + [errors addObject:moveError]; + } + } + + if (errors.count == 0) { + return YES; + } else { + NSError *combinedError = [NSError errorWithDomain:@"GDTCORFlatFileStorage" + code:-1 + userInfo:@{NSUnderlyingErrorKey : errors}]; + *outError = combinedError; + return NO; + } +} + +- (void)syncThreadUnsafeRemoveBatchWithID:(nonnull NSNumber *)batchID + deleteEvents:(BOOL)deleteEvents { + NSError *error; + NSArray *batchDirPaths = [self batchDirPathsForBatchID:batchID error:&error]; + + if (batchDirPaths == nil) { + return; + } + + NSFileManager *fileManager = [NSFileManager defaultManager]; + + void (^removeBatchDir)(NSString *batchDirPath) = ^(NSString *batchDirPath) { + NSError *error; + if ([fileManager removeItemAtPath:batchDirPath error:&error]) { + GDTCORLogDebug(@"Batch removed at path: %@", batchDirPath); + } else { + GDTCORLogDebug(@"Failed to remove batch at path: %@", batchDirPath); + } + }; + + for (NSString *batchDirPath in batchDirPaths) { + @autoreleasepool { + if (deleteEvents) { + removeBatchDir(batchDirPath); + } else { + NSString *batchDirName = [batchDirPath lastPathComponent]; + NSDictionary *components = [self batchComponentsFromFilename:batchDirName]; + NSString *targetValue = [components[kGDTCORBatchComponentsTargetKey] stringValue]; + NSString *destinationPath; + if (targetValue) { + destinationPath = [[GDTCORFlatFileStorage eventDataStoragePath] + stringByAppendingPathComponent:targetValue]; + } + + // `- [NSFileManager moveItemAtPath:toPath:error:]` method fails if an item by the + // destination path already exists (which usually is the case for the current method). Move + // the events one by one instead. + if (destinationPath && [self moveContentsOfDirectoryAtPath:batchDirPath + to:destinationPath + error:&error]) { + GDTCORLogDebug(@"Batched events at path: %@ moved back to the storage: %@", batchDirPath, + destinationPath); + } else { + GDTCORLogDebug(@"Error encountered whilst moving events back: %@", error); + } + + // Even if not all events where moved back to the storage, there is not much can be done at + // this point, so cleanup batch directory now to avoid cluttering. + removeBatchDir(batchDirPath); + } + } + } + + [self.sizeTracker resetCachedSize]; +} + +#pragma mark - Private helper methods + ++ (NSString *)eventDataStoragePath { + static NSString *eventDataPath; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + eventDataPath = [NSString stringWithFormat:@"%@/%@/gdt_event_data", GDTCORRootDirectory().path, + NSStringFromClass([self class])]; + }); + NSError *error; + [[NSFileManager defaultManager] createDirectoryAtPath:eventDataPath + withIntermediateDirectories:YES + attributes:0 + error:&error]; + GDTCORAssert(error == nil, @"Creating the library data path failed: %@", error); + return eventDataPath; +} + ++ (NSString *)batchDataStoragePath { + static NSString *batchDataPath; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + batchDataPath = [NSString stringWithFormat:@"%@/%@/gdt_batch_data", GDTCORRootDirectory().path, + NSStringFromClass([self class])]; + }); + NSError *error; + [[NSFileManager defaultManager] createDirectoryAtPath:batchDataPath + withIntermediateDirectories:YES + attributes:0 + error:&error]; + GDTCORAssert(error == nil, @"Creating the batch data path failed: %@", error); + return batchDataPath; +} + ++ (NSString *)libraryDataStoragePath { + static NSString *libraryDataPath; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + libraryDataPath = + [NSString stringWithFormat:@"%@/%@/gdt_library_data", GDTCORRootDirectory().path, + NSStringFromClass([self class])]; + }); + NSError *error; + [[NSFileManager defaultManager] createDirectoryAtPath:libraryDataPath + withIntermediateDirectories:YES + attributes:0 + error:&error]; + GDTCORAssert(error == nil, @"Creating the library data path failed: %@", error); + return libraryDataPath; +} + ++ (NSString *)batchPathForTarget:(GDTCORTarget)target + batchID:(NSNumber *)batchID + expirationDate:(NSDate *)expirationDate { + return + [NSString stringWithFormat:@"%@/%ld%@%@%@%llu", [GDTCORFlatFileStorage batchDataStoragePath], + (long)target, kMetadataSeparator, batchID, kMetadataSeparator, + ((uint64_t)expirationDate.timeIntervalSince1970)]; +} + ++ (NSString *)pathForTarget:(GDTCORTarget)target + eventID:(NSString *)eventID + qosTier:(NSNumber *)qosTier + expirationDate:(NSDate *)expirationDate + mappingID:(NSString *)mappingID { + NSMutableCharacterSet *allowedChars = [[NSCharacterSet alphanumericCharacterSet] mutableCopy]; + [allowedChars addCharactersInString:kMetadataSeparator]; + mappingID = [mappingID stringByAddingPercentEncodingWithAllowedCharacters:allowedChars]; + return [NSString stringWithFormat:@"%@/%ld/%@%@%@%@%llu%@%@", + [GDTCORFlatFileStorage eventDataStoragePath], (long)target, + eventID, kMetadataSeparator, qosTier, kMetadataSeparator, + ((uint64_t)expirationDate.timeIntervalSince1970), + kMetadataSeparator, mappingID]; +} + +- (void)pathsForTarget:(GDTCORTarget)target + eventIDs:(nullable NSSet *)eventIDs + qosTiers:(nullable NSSet *)qosTiers + mappingIDs:(nullable NSSet *)mappingIDs + onComplete:(void (^)(NSSet *paths))onComplete { + void (^completion)(NSSet *) = onComplete == nil ? ^(NSSet *paths){} : onComplete; + dispatch_async(_storageQueue, ^{ + NSMutableSet *paths = [[NSMutableSet alloc] init]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSString *targetPath = [NSString + stringWithFormat:@"%@/%ld", [GDTCORFlatFileStorage eventDataStoragePath], (long)target]; + [fileManager createDirectoryAtPath:targetPath + withIntermediateDirectories:YES + attributes:nil + error:nil]; + NSError *error; + NSArray *dirPaths = [fileManager contentsOfDirectoryAtPath:targetPath error:&error]; + if (error) { + GDTCORLogDebug(@"There was an error reading the contents of the target path: %@", error); + completion(paths); + return; + } + BOOL checkingIDs = eventIDs.count > 0; + BOOL checkingQosTiers = qosTiers.count > 0; + BOOL checkingMappingIDs = mappingIDs.count > 0; + BOOL checkingAnything = checkingIDs == NO && checkingQosTiers == NO && checkingMappingIDs == NO; + for (NSString *path in dirPaths) { + // Skip hidden files that are created as part of atomic file creation. + if ([path hasPrefix:@"."]) { + continue; + } + NSString *filePath = [targetPath stringByAppendingPathComponent:path]; + if (checkingAnything) { + [paths addObject:filePath]; + continue; + } + NSString *filename = [path lastPathComponent]; + NSDictionary *eventComponents = [self eventComponentsFromFilename:filename]; + if (!eventComponents) { + GDTCORLogDebug(@"There was an error reading the filename components: %@", eventComponents); + continue; + } + NSString *eventID = eventComponents[kGDTCOREventComponentsEventIDKey]; + NSNumber *qosTier = eventComponents[kGDTCOREventComponentsQoSTierKey]; + NSString *mappingID = eventComponents[kGDTCOREventComponentsMappingIDKey]; + + NSNumber *eventIDMatch = checkingIDs ? @([eventIDs containsObject:eventID]) : nil; + NSNumber *qosTierMatch = checkingQosTiers ? @([qosTiers containsObject:qosTier]) : nil; + NSNumber *mappingIDMatch = + checkingMappingIDs + ? @([mappingIDs containsObject:[mappingID stringByRemovingPercentEncoding]]) + : nil; + if ((eventIDMatch == nil || eventIDMatch.boolValue) && + (qosTierMatch == nil || qosTierMatch.boolValue) && + (mappingIDMatch == nil || mappingIDMatch.boolValue)) { + [paths addObject:filePath]; + } + } + completion(paths); + }); +} + +- (void)nextBatchID:(void (^)(NSNumber *_Nullable batchID))nextBatchID { + __block int32_t lastBatchID = -1; + [self libraryDataForKey:gBatchIDCounterKey + onFetchComplete:^(NSData *_Nullable data, NSError *_Nullable getValueError) { + if (!getValueError) { + [data getBytes:(void *)&lastBatchID length:sizeof(int32_t)]; + } + if (data == nil) { + lastBatchID = 0; + } + if (nextBatchID) { + nextBatchID(@(lastBatchID)); + } + } + setNewValue:^NSData *_Nullable(void) { + if (lastBatchID != -1) { + int32_t incrementedValue = lastBatchID + 1; + return [NSData dataWithBytes:&incrementedValue length:sizeof(int32_t)]; + } + return nil; + }]; +} + +- (nullable NSDictionary *)eventComponentsFromFilename:(NSString *)fileName { + NSArray *components = [fileName componentsSeparatedByString:kMetadataSeparator]; + if (components.count >= 4) { + NSString *eventID = components[0]; + NSNumber *qosTier = @(components[1].integerValue); + NSDate *expirationDate = [NSDate dateWithTimeIntervalSince1970:components[2].longLongValue]; + NSString *mappingID = [[components subarrayWithRange:NSMakeRange(3, components.count - 3)] + componentsJoinedByString:kMetadataSeparator]; + if (eventID == nil || qosTier == nil || mappingID == nil || expirationDate == nil) { + GDTCORLogDebug(@"There was an error parsing the event filename components: %@", components); + return nil; + } + return @{ + kGDTCOREventComponentsEventIDKey : eventID, + kGDTCOREventComponentsQoSTierKey : qosTier, + kGDTCOREventComponentsExpirationKey : expirationDate, + kGDTCOREventComponentsMappingIDKey : mappingID + }; + } + GDTCORLogDebug(@"The event filename could not be split: %@", fileName); + return nil; +} + +- (nullable NSDictionary *)batchComponentsFromFilename:(NSString *)fileName { + NSArray *components = [fileName componentsSeparatedByString:kMetadataSeparator]; + if (components.count == 3) { + NSNumber *target = @(components[0].integerValue); + NSNumber *batchID = @(components[1].integerValue); + NSDate *expirationDate = [NSDate dateWithTimeIntervalSince1970:components[2].doubleValue]; + if (target == nil || batchID == nil || expirationDate == nil) { + GDTCORLogDebug(@"There was an error parsing the batch filename components: %@", components); + return nil; + } + return @{ + kGDTCORBatchComponentsTargetKey : target, + kGDTCORBatchComponentsBatchIDKey : batchID, + kGDTCORBatchComponentsExpirationKey : expirationDate + }; + } + GDTCORLogDebug(@"The batch filename could not be split: %@", fileName); + return nil; +} + +#pragma mark - GDTCORLifecycleProtocol + +- (void)appWillBackground:(GDTCORApplication *)app { + dispatch_async(_storageQueue, ^{ + // Immediately request a background task to run until the end of the current queue of work, + // and cancel it once the work is done. + __block GDTCORBackgroundIdentifier bgID = + [app beginBackgroundTaskWithName:@"GDTStorage" + expirationHandler:^{ + [app endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }]; + // End the background task if it's still valid. + [app endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }); +} + +- (void)appWillTerminate:(GDTCORApplication *)application { + dispatch_sync(_storageQueue, ^{ + }); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORLifecycle.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORLifecycle.m new file mode 100644 index 0000000..89da75d --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORLifecycle.m @@ -0,0 +1,119 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h" + +@implementation GDTCORLifecycle + ++ (void)load { + [self sharedInstance]; +} + +/** Creates/returns the singleton instance of this class. + * + * @return The singleton instance of this class. + */ ++ (instancetype)sharedInstance { + static GDTCORLifecycle *sharedInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[GDTCORLifecycle alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(applicationDidEnterBackground:) + name:kGDTCORApplicationDidEnterBackgroundNotification + object:nil]; + [notificationCenter addObserver:self + selector:@selector(applicationWillEnterForeground:) + name:kGDTCORApplicationWillEnterForegroundNotification + object:nil]; + + NSString *name = kGDTCORApplicationWillTerminateNotification; + [notificationCenter addObserver:self + selector:@selector(applicationWillTerminate:) + name:name + object:nil]; + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)applicationDidEnterBackground:(NSNotification *)notification { + GDTCORApplication *application = [GDTCORApplication sharedApplication]; + if ([[GDTCORTransformer sharedInstance] respondsToSelector:@selector(appWillBackground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORTransformer that the app is backgrounding."); + [[GDTCORTransformer sharedInstance] appWillBackground:application]; + } + if ([[GDTCORUploadCoordinator sharedInstance] respondsToSelector:@selector(appWillBackground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORUploadCoordinator that the app is backgrounding."); + [[GDTCORUploadCoordinator sharedInstance] appWillBackground:application]; + } + if ([[GDTCORRegistrar sharedInstance] respondsToSelector:@selector(appWillBackground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORRegistrar that the app is backgrounding."); + [[GDTCORRegistrar sharedInstance] appWillBackground:application]; + } +} + +- (void)applicationWillEnterForeground:(NSNotification *)notification { + GDTCORApplication *application = [GDTCORApplication sharedApplication]; + if ([[GDTCORTransformer sharedInstance] respondsToSelector:@selector(appWillForeground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORTransformer that the app is foregrounding."); + [[GDTCORTransformer sharedInstance] appWillForeground:application]; + } + if ([[GDTCORUploadCoordinator sharedInstance] respondsToSelector:@selector(appWillForeground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORUploadCoordinator that the app is foregrounding."); + [[GDTCORUploadCoordinator sharedInstance] appWillForeground:application]; + } + if ([[GDTCORRegistrar sharedInstance] respondsToSelector:@selector(appWillForeground:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORRegistrar that the app is foregrounding."); + [[GDTCORRegistrar sharedInstance] appWillForeground:application]; + } +} + +- (void)applicationWillTerminate:(NSNotification *)notification { + GDTCORApplication *application = [GDTCORApplication sharedApplication]; + if ([[GDTCORTransformer sharedInstance] respondsToSelector:@selector(appWillTerminate:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORTransformer that the app is terminating."); + [[GDTCORTransformer sharedInstance] appWillTerminate:application]; + } + if ([[GDTCORUploadCoordinator sharedInstance] respondsToSelector:@selector(appWillTerminate:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORUploadCoordinator that the app is terminating."); + [[GDTCORUploadCoordinator sharedInstance] appWillTerminate:application]; + } + if ([[GDTCORRegistrar sharedInstance] respondsToSelector:@selector(appWillTerminate:)]) { + GDTCORLogDebug(@"%@", @"Signaling GDTCORRegistrar that the app is terminating."); + [[GDTCORRegistrar sharedInstance] appWillTerminate:application]; + } +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m new file mode 100644 index 0000000..a6207ec --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m @@ -0,0 +1,604 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" + +#import + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" + +#ifdef GDTCOR_VERSION +#define STR(x) STR_EXPAND(x) +#define STR_EXPAND(x) #x +NSString *const kGDTCORVersion = @STR(GDTCOR_VERSION); +#else +NSString *const kGDTCORVersion = @"Unknown"; +#endif // GDTCOR_VERSION + +const GDTCORBackgroundIdentifier GDTCORBackgroundIdentifierInvalid = 0; + +NSString *const kGDTCORApplicationDidEnterBackgroundNotification = + @"GDTCORApplicationDidEnterBackgroundNotification"; + +NSString *const kGDTCORApplicationWillEnterForegroundNotification = + @"GDTCORApplicationWillEnterForegroundNotification"; + +NSString *const kGDTCORApplicationWillTerminateNotification = + @"GDTCORApplicationWillTerminateNotification"; + +NSURL *GDTCORRootDirectory(void) { + static NSURL *GDTPath; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSString *cachePath = + NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0]; + GDTPath = + [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/google-sdks-events", cachePath]]; + GDTCORLogDebug(@"GDT's state will be saved to: %@", GDTPath); + }); + NSError *error; + [[NSFileManager defaultManager] createDirectoryAtPath:GDTPath.path + withIntermediateDirectories:YES + attributes:nil + error:&error]; + GDTCORAssert(error == nil, @"There was an error creating GDT's path"); + return GDTPath; +} + +BOOL GDTCORReachabilityFlagsReachable(GDTCORNetworkReachabilityFlags flags) { +#if !TARGET_OS_WATCH + BOOL reachable = + (flags & kSCNetworkReachabilityFlagsReachable) == kSCNetworkReachabilityFlagsReachable; + BOOL connectionRequired = (flags & kSCNetworkReachabilityFlagsConnectionRequired) == + kSCNetworkReachabilityFlagsConnectionRequired; + return reachable && !connectionRequired; +#else + return (flags & kGDTCORNetworkReachabilityFlagsReachable) == + kGDTCORNetworkReachabilityFlagsReachable; +#endif +} + +BOOL GDTCORReachabilityFlagsContainWWAN(GDTCORNetworkReachabilityFlags flags) { +#if TARGET_OS_IOS + return (flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN; +#else + // Assume network connection not WWAN on macOS, tvOS, watchOS. + return NO; +#endif // TARGET_OS_IOS +} + +GDTCORNetworkType GDTCORNetworkTypeMessage() { +#if !TARGET_OS_WATCH + SCNetworkReachabilityFlags reachabilityFlags = [GDTCORReachability currentFlags]; + if ((reachabilityFlags & kSCNetworkReachabilityFlagsReachable) == + kSCNetworkReachabilityFlagsReachable) { + if (GDTCORReachabilityFlagsContainWWAN(reachabilityFlags)) { + return GDTCORNetworkTypeMobile; + } else { + return GDTCORNetworkTypeWIFI; + } + } +#endif + return GDTCORNetworkTypeUNKNOWN; +} + +GDTCORNetworkMobileSubtype GDTCORNetworkMobileSubTypeMessage() { +#if TARGET_OS_IOS + static NSDictionary *CTRadioAccessTechnologyToNetworkSubTypeMessage; + static CTTelephonyNetworkInfo *networkInfo; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + CTRadioAccessTechnologyToNetworkSubTypeMessage = @{ + CTRadioAccessTechnologyGPRS : @(GDTCORNetworkMobileSubtypeGPRS), + CTRadioAccessTechnologyEdge : @(GDTCORNetworkMobileSubtypeEdge), + CTRadioAccessTechnologyWCDMA : @(GDTCORNetworkMobileSubtypeWCDMA), + CTRadioAccessTechnologyHSDPA : @(GDTCORNetworkMobileSubtypeHSDPA), + CTRadioAccessTechnologyHSUPA : @(GDTCORNetworkMobileSubtypeHSUPA), + CTRadioAccessTechnologyCDMA1x : @(GDTCORNetworkMobileSubtypeCDMA1x), + CTRadioAccessTechnologyCDMAEVDORev0 : @(GDTCORNetworkMobileSubtypeCDMAEVDORev0), + CTRadioAccessTechnologyCDMAEVDORevA : @(GDTCORNetworkMobileSubtypeCDMAEVDORevA), + CTRadioAccessTechnologyCDMAEVDORevB : @(GDTCORNetworkMobileSubtypeCDMAEVDORevB), + CTRadioAccessTechnologyeHRPD : @(GDTCORNetworkMobileSubtypeHRPD), + CTRadioAccessTechnologyLTE : @(GDTCORNetworkMobileSubtypeLTE), + }; + networkInfo = [[CTTelephonyNetworkInfo alloc] init]; + }); + NSString *networkCurrentRadioAccessTechnology; +#if TARGET_OS_MACCATALYST + NSDictionary *networkCurrentRadioAccessTechnologyDict = + networkInfo.serviceCurrentRadioAccessTechnology; + if (networkCurrentRadioAccessTechnologyDict.count) { + networkCurrentRadioAccessTechnology = networkCurrentRadioAccessTechnologyDict.allValues[0]; + } +#else // TARGET_OS_MACCATALYST + if (@available(iOS 12.0, *)) { + NSDictionary *networkCurrentRadioAccessTechnologyDict = + networkInfo.serviceCurrentRadioAccessTechnology; + if (networkCurrentRadioAccessTechnologyDict.count) { + // In iOS 12, multiple radio technologies can be captured. We prefer not particular radio + // tech to another, so we'll just return the first value in the dictionary. + networkCurrentRadioAccessTechnology = networkCurrentRadioAccessTechnologyDict.allValues[0]; + } + } else { +#if TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED < 120000 + networkCurrentRadioAccessTechnology = networkInfo.currentRadioAccessTechnology; +#endif // TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED < 120000 + } +#endif // TARGET_OS_MACCATALYST + if (networkCurrentRadioAccessTechnology) { + NSNumber *networkMobileSubtype = + CTRadioAccessTechnologyToNetworkSubTypeMessage[networkCurrentRadioAccessTechnology]; + return networkMobileSubtype.intValue; + } else { + return GDTCORNetworkMobileSubtypeUNKNOWN; + } +#else // TARGET_OS_IOS + return GDTCORNetworkMobileSubtypeUNKNOWN; +#endif // TARGET_OS_IOS +} + +NSString *_Nonnull GDTCORDeviceModel() { + static NSString *deviceModel = @"Unknown"; + +#if TARGET_OS_IOS || TARGET_OS_TV + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + size_t size; + char *keyToExtract = "hw.machine"; + sysctlbyname(keyToExtract, NULL, &size, NULL, 0); + if (size > 0) { + char *machine = calloc(1, size); + sysctlbyname(keyToExtract, machine, &size, NULL, 0); + deviceModel = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding]; + free(machine); + } else { + deviceModel = [UIDevice currentDevice].model; + } + }); +#endif + + return deviceModel; +} + +NSData *_Nullable GDTCOREncodeArchive(id obj, + NSString *filePath, + NSError *_Nullable *error) { + BOOL result = NO; + if (filePath.length > 0) { + result = [[NSFileManager defaultManager] + createDirectoryAtPath:[filePath stringByDeletingLastPathComponent] + withIntermediateDirectories:YES + attributes:nil + error:error]; + if (result == NO || *error) { + GDTCORLogDebug(@"Attempt to create directory failed: path:%@ error:%@", filePath, *error); + return nil; + } + } + NSData *resultData; + if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4, *)) { + resultData = [NSKeyedArchiver archivedDataWithRootObject:obj + requiringSecureCoding:YES + error:error]; + if (resultData == nil || (error != NULL && *error != nil)) { + GDTCORLogDebug(@"Encoding an object failed: %@", *error); + return nil; + } + if (filePath.length > 0) { + result = [resultData writeToFile:filePath options:NSDataWritingAtomic error:error]; + if (result == NO || *error) { + GDTCORLogDebug(@"Attempt to write archive failed: path:%@ error:%@", filePath, *error); + } else { + GDTCORLogDebug(@"Writing archive succeeded: %@", filePath); + } + } + } else { + @try { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + resultData = [NSKeyedArchiver archivedDataWithRootObject:obj]; +#pragma clang diagnostic pop + if (filePath.length > 0) { + result = [resultData writeToFile:filePath options:NSDataWritingAtomic error:error]; + if (result == NO || *error) { + GDTCORLogDebug(@"Attempt to write archive failed: URL:%@ error:%@", filePath, *error); + } else { + GDTCORLogDebug(@"Writing archive succeeded: %@", filePath); + } + } + } @catch (NSException *exception) { + NSString *errorString = + [NSString stringWithFormat:@"An exception was thrown during encoding: %@", exception]; + *error = [NSError errorWithDomain:NSCocoaErrorDomain + code:-1 + userInfo:@{NSLocalizedFailureReasonErrorKey : errorString}]; + } + if (filePath.length > 0) { + GDTCORLogDebug(@"Attempt to write archive. successful:%@ URL:%@ error:%@", + result ? @"YES" : @"NO", filePath, *error); + } + } + return resultData; +} + +id _Nullable GDTCORDecodeArchive(Class archiveClass, + NSString *_Nullable archivePath, + NSData *_Nullable archiveData, + NSError *_Nullable *error) { + id unarchivedObject = nil; + if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4, *)) { + NSData *data = archiveData ? archiveData : [NSData dataWithContentsOfFile:archivePath]; + if (data) { + unarchivedObject = [NSKeyedUnarchiver unarchivedObjectOfClass:archiveClass + fromData:data + error:error]; + } + } else { + @try { + NSData *archivedData = + archiveData ? archiveData : [NSData dataWithContentsOfFile:archivePath]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + unarchivedObject = [NSKeyedUnarchiver unarchiveObjectWithData:archivedData]; +#pragma clang diagnostic pop + } @catch (NSException *exception) { + NSString *errorString = + [NSString stringWithFormat:@"An exception was thrown during encoding: %@", exception]; + *error = [NSError errorWithDomain:NSCocoaErrorDomain + code:-1 + userInfo:@{NSLocalizedFailureReasonErrorKey : errorString}]; + } + } + return unarchivedObject; +} + +BOOL GDTCORWriteDataToFile(NSData *data, NSString *filePath, NSError *_Nullable *outError) { + BOOL result = NO; + if (filePath.length > 0) { + result = [[NSFileManager defaultManager] + createDirectoryAtPath:[filePath stringByDeletingLastPathComponent] + withIntermediateDirectories:YES + attributes:nil + error:outError]; + if (result == NO || *outError) { + GDTCORLogDebug(@"Attempt to create directory failed: path:%@ error:%@", filePath, *outError); + return result; + } + } + + if (filePath.length > 0) { + result = [data writeToFile:filePath options:NSDataWritingAtomic error:outError]; + if (result == NO || *outError) { + GDTCORLogDebug(@"Attempt to write archive failed: path:%@ error:%@", filePath, *outError); + } else { + GDTCORLogDebug(@"Writing archive succeeded: %@", filePath); + } + } + + return result; +} + +@interface GDTCORApplication () +/** + Private flag to match the existing `readonly` public flag. This will be accurate for all platforms, + since we handle each platform's lifecycle notifications separately. + */ +@property(atomic, readwrite) BOOL isRunningInBackground; + +@end + +@implementation GDTCORApplication + +#if TARGET_OS_WATCH +/** A dispatch queue on which all task semaphores will populate and remove from + * gBackgroundIdentifierToSemaphoreMap. + */ +static dispatch_queue_t gSemaphoreQueue; + +/** For mapping backgroundIdentifier to task semaphore. */ +static NSMutableDictionary *gBackgroundIdentifierToSemaphoreMap; +#endif + ++ (void)load { + GDTCORLogDebug( + @"%@", @"GDT is initializing. Please note that if you quit the app via the " + "debugger and not through a lifecycle event, event data will remain on disk but " + "storage won't have a reference to them since the singleton wasn't saved to disk."); +#if TARGET_OS_IOS || TARGET_OS_TV + // If this asserts, please file a bug at https://github.com/firebase/firebase-ios-sdk/issues. + GDTCORFatalAssert( + GDTCORBackgroundIdentifierInvalid == UIBackgroundTaskInvalid, + @"GDTCORBackgroundIdentifierInvalid and UIBackgroundTaskInvalid should be the same."); +#endif + [self sharedApplication]; +} + ++ (void)initialize { +#if TARGET_OS_WATCH + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + gSemaphoreQueue = dispatch_queue_create("com.google.GDTCORApplication", DISPATCH_QUEUE_SERIAL); + GDTCORLogDebug( + @"%@", + @"GDTCORApplication is initializing on watchOS, gSemaphoreQueue has been initialized."); + gBackgroundIdentifierToSemaphoreMap = [[NSMutableDictionary alloc] init]; + GDTCORLogDebug(@"%@", @"GDTCORApplication is initializing on watchOS, " + @"gBackgroundIdentifierToSemaphoreMap has been initialized."); + }); +#endif +} + ++ (nullable GDTCORApplication *)sharedApplication { + static GDTCORApplication *application; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + application = [[GDTCORApplication alloc] init]; + }); + return application; +} + +- (instancetype)init { + self = [super init]; + if (self) { + // This class will be instantiated in the foreground. + _isRunningInBackground = NO; + +#if TARGET_OS_IOS || TARGET_OS_TV + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationDidEnterBackground:) + name:UIApplicationDidEnterBackgroundNotification + object:nil]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationWillEnterForeground:) + name:UIApplicationWillEnterForegroundNotification + object:nil]; + + NSString *name = UIApplicationWillTerminateNotification; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationWillTerminate:) + name:name + object:nil]; + +#if defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 + if (@available(iOS 13, tvOS 13.0, *)) { + [notificationCenter addObserver:self + selector:@selector(iOSApplicationWillEnterForeground:) + name:UISceneWillEnterForegroundNotification + object:nil]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationDidEnterBackground:) + name:UISceneWillDeactivateNotification + object:nil]; + } +#endif // defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 + +#elif TARGET_OS_OSX + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(macOSApplicationWillTerminate:) + name:NSApplicationWillTerminateNotification + object:nil]; + +#elif TARGET_OS_WATCH + // TODO: Notification on watchOS platform is currently posted by strings which are frangible. + // TODO: Needs improvements here. + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationDidEnterBackground:) + name:@"UIApplicationDidEnterBackgroundNotification" + object:nil]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationWillEnterForeground:) + name:@"UIApplicationWillEnterForegroundNotification" + object:nil]; + + // Adds observers for app extension on watchOS platform + [notificationCenter addObserver:self + selector:@selector(iOSApplicationDidEnterBackground:) + name:NSExtensionHostDidEnterBackgroundNotification + object:nil]; + [notificationCenter addObserver:self + selector:@selector(iOSApplicationWillEnterForeground:) + name:NSExtensionHostWillEnterForegroundNotification + object:nil]; +#endif + } + return self; +} + +#if TARGET_OS_WATCH +/** Generates and maps a unique background identifier to the given semaphore. + * + * @param semaphore The semaphore to map. + * @return A unique GDTCORBackgroundIdentifier mapped to the given semaphore. + */ ++ (GDTCORBackgroundIdentifier)createAndMapBackgroundIdentifierToSemaphore: + (dispatch_semaphore_t)semaphore { + __block GDTCORBackgroundIdentifier bgID = GDTCORBackgroundIdentifierInvalid; + dispatch_queue_t queue = gSemaphoreQueue; + NSMutableDictionary *map = gBackgroundIdentifierToSemaphoreMap; + if (queue && map) { + dispatch_sync(queue, ^{ + bgID = arc4random(); + NSNumber *bgIDNumber = @(bgID); + while (bgID == GDTCORBackgroundIdentifierInvalid || map[bgIDNumber]) { + bgID = arc4random(); + bgIDNumber = @(bgID); + } + map[bgIDNumber] = semaphore; + }); + } + return bgID; +} + +/** Returns the semaphore mapped to given bgID and removes the value from the map. + * + * @param bgID The unique NSUInteger as GDTCORBackgroundIdentifier. + * @return The semaphore mapped by given bgID. + */ ++ (dispatch_semaphore_t)semaphoreForBackgroundIdentifier:(GDTCORBackgroundIdentifier)bgID { + __block dispatch_semaphore_t semaphore; + dispatch_queue_t queue = gSemaphoreQueue; + NSMutableDictionary *map = gBackgroundIdentifierToSemaphoreMap; + NSNumber *bgIDNumber = @(bgID); + if (queue && map) { + dispatch_sync(queue, ^{ + semaphore = map[bgIDNumber]; + [map removeObjectForKey:bgIDNumber]; + }); + } + return semaphore; +} +#endif + +- (GDTCORBackgroundIdentifier)beginBackgroundTaskWithName:(NSString *)name + expirationHandler:(void (^)(void))handler { + __block GDTCORBackgroundIdentifier bgID = GDTCORBackgroundIdentifierInvalid; +#if !TARGET_OS_WATCH + bgID = [[self sharedApplicationForBackgroundTask] beginBackgroundTaskWithName:name + expirationHandler:handler]; +#if !NDEBUG + if (bgID != GDTCORBackgroundIdentifierInvalid) { + GDTCORLogDebug(@"Creating background task with name:%@ bgID:%ld", name, (long)bgID); + } +#endif // !NDEBUG +#elif TARGET_OS_WATCH + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + bgID = [GDTCORApplication createAndMapBackgroundIdentifierToSemaphore:semaphore]; + if (bgID != GDTCORBackgroundIdentifierInvalid) { + GDTCORLogDebug(@"Creating activity with name:%@ bgID:%ld on watchOS.", name, (long)bgID); + } + [[self sharedNSProcessInfoForBackgroundTask] + performExpiringActivityWithReason:name + usingBlock:^(BOOL expired) { + if (expired) { + if (handler) { + handler(); + } + dispatch_semaphore_signal(semaphore); + GDTCORLogDebug( + @"Activity with name:%@ bgID:%ld on watchOS is expiring.", + name, (long)bgID); + } else { + dispatch_semaphore_wait( + semaphore, + dispatch_time(DISPATCH_TIME_NOW, 30 * NSEC_PER_SEC)); + } + }]; +#endif + return bgID; +} + +- (void)endBackgroundTask:(GDTCORBackgroundIdentifier)bgID { +#if !TARGET_OS_WATCH + if (bgID != GDTCORBackgroundIdentifierInvalid) { + GDTCORLogDebug(@"Ending background task with ID:%ld was successful", (long)bgID); + [[self sharedApplicationForBackgroundTask] endBackgroundTask:bgID]; + return; + } +#elif TARGET_OS_WATCH + if (bgID != GDTCORBackgroundIdentifierInvalid) { + dispatch_semaphore_t semaphore = [GDTCORApplication semaphoreForBackgroundIdentifier:bgID]; + GDTCORLogDebug(@"Ending activity with bgID:%ld on watchOS.", (long)bgID); + if (semaphore) { + dispatch_semaphore_signal(semaphore); + GDTCORLogDebug(@"Signaling semaphore with bgID:%ld on watchOS.", (long)bgID); + } else { + GDTCORLogDebug(@"Semaphore with bgID:%ld is nil on watchOS.", (long)bgID); + } + } +#endif // !TARGET_OS_WATCH +} + +#pragma mark - App environment helpers + +- (BOOL)isAppExtension { + BOOL appExtension = [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]; + return appExtension; +} + +/** Returns a UIApplication or NSProcessInfo instance if on the appropriate platform. + * + * @return The shared UIApplication or NSProcessInfo if on the appropriate platform. + */ +#if TARGET_OS_IOS || TARGET_OS_TV +- (nullable UIApplication *)sharedApplicationForBackgroundTask { +#elif TARGET_OS_WATCH +- (nullable NSProcessInfo *)sharedNSProcessInfoForBackgroundTask { +#else +- (nullable id)sharedApplicationForBackgroundTask { +#endif + id sharedInstance = nil; +#if TARGET_OS_IOS || TARGET_OS_TV + if (![self isAppExtension]) { + Class uiApplicationClass = NSClassFromString(@"UIApplication"); + if (uiApplicationClass && + [uiApplicationClass respondsToSelector:(NSSelectorFromString(@"sharedApplication"))]) { + sharedInstance = [uiApplicationClass sharedApplication]; + } + } +#elif TARGET_OS_WATCH + sharedInstance = [NSProcessInfo processInfo]; +#endif + return sharedInstance; +} + +#pragma mark - UIApplicationDelegate and WKExtensionDelegate + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +- (void)iOSApplicationDidEnterBackground:(NSNotification *)notif { + _isRunningInBackground = YES; + + NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter]; + GDTCORLogDebug(@"%@", @"GDTCORPlatform is sending a notif that the app is backgrounding."); + [notifCenter postNotificationName:kGDTCORApplicationDidEnterBackgroundNotification object:nil]; +} + +- (void)iOSApplicationWillEnterForeground:(NSNotification *)notif { + _isRunningInBackground = NO; + + NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter]; + GDTCORLogDebug(@"%@", @"GDTCORPlatform is sending a notif that the app is foregrounding."); + [notifCenter postNotificationName:kGDTCORApplicationWillEnterForegroundNotification object:nil]; +} +#endif // TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + +#pragma mark - UIApplicationDelegate + +#if TARGET_OS_IOS || TARGET_OS_TV +- (void)iOSApplicationWillTerminate:(NSNotification *)notif { + NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter]; + GDTCORLogDebug(@"%@", @"GDTCORPlatform is sending a notif that the app is terminating."); + [notifCenter postNotificationName:kGDTCORApplicationWillTerminateNotification object:nil]; +} +#endif // TARGET_OS_IOS || TARGET_OS_TV + +#pragma mark - NSApplicationDelegate + +#if TARGET_OS_OSX +- (void)macOSApplicationWillTerminate:(NSNotification *)notif { + NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter]; + GDTCORLogDebug(@"%@", @"GDTCORPlatform is sending a notif that the app is terminating."); + [notifCenter postNotificationName:kGDTCORApplicationWillTerminateNotification object:nil]; +} +#endif // TARGET_OS_OSX + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORReachability.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORReachability.m new file mode 100644 index 0000000..43811e6 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORReachability.m @@ -0,0 +1,125 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORReachability_Private.h" + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +#import + +/** Sets the _callbackFlag ivar whenever the network changes. + * + * @param reachability The reachability object calling back. + * @param flags The new flag values. + * @param info Any data that might be passed in by the callback. + */ +static void GDTCORReachabilityCallback(GDTCORNetworkReachabilityRef reachability, + GDTCORNetworkReachabilityFlags flags, + void *info); + +@implementation GDTCORReachability { + /** The reachability object. */ + GDTCORNetworkReachabilityRef _reachabilityRef; + + /** The queue on which callbacks and all work will occur. */ + dispatch_queue_t _reachabilityQueue; + + /** Flags specified by reachability callbacks. */ + GDTCORNetworkReachabilityFlags _callbackFlags; +} + ++ (void)initialize { + [self sharedInstance]; +} + ++ (instancetype)sharedInstance { + static GDTCORReachability *sharedInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[GDTCORReachability alloc] init]; + }); + return sharedInstance; +} + ++ (GDTCORNetworkReachabilityFlags)currentFlags { + __block GDTCORNetworkReachabilityFlags currentFlags; +#if !TARGET_OS_WATCH + dispatch_sync([GDTCORReachability sharedInstance] -> _reachabilityQueue, ^{ + GDTCORReachability *reachability = [GDTCORReachability sharedInstance]; + currentFlags = + reachability->_callbackFlags ? reachability->_callbackFlags : reachability->_flags; + GDTCORLogDebug(@"Initial reachability flags determined: %d", currentFlags); + }); +#else + currentFlags = kGDTCORNetworkReachabilityFlagsReachable; +#endif + return currentFlags; +} + +- (instancetype)init { + self = [super init]; +#if !TARGET_OS_WATCH + if (self) { + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + _reachabilityQueue = + dispatch_queue_create("com.google.GDTCORReachability", DISPATCH_QUEUE_SERIAL); + _reachabilityRef = SCNetworkReachabilityCreateWithAddress( + kCFAllocatorDefault, (const struct sockaddr *)&zeroAddress); + Boolean success = SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, _reachabilityQueue); + if (!success) { + GDTCORLogWarning(GDTCORMCWReachabilityFailed, @"%@", @"The reachability queue wasn't set."); + } + success = SCNetworkReachabilitySetCallback(_reachabilityRef, GDTCORReachabilityCallback, NULL); + if (!success) { + GDTCORLogWarning(GDTCORMCWReachabilityFailed, @"%@", + @"The reachability callback wasn't set."); + } + + // Get the initial set of flags. + dispatch_async(_reachabilityQueue, ^{ + Boolean valid = SCNetworkReachabilityGetFlags(self->_reachabilityRef, &self->_flags); + if (!valid) { + GDTCORLogDebug(@"%@", @"Determining reachability failed."); + self->_flags = 0; + } + }); + } +#endif + return self; +} + +- (void)setCallbackFlags:(GDTCORNetworkReachabilityFlags)flags { + if (_callbackFlags != flags) { + self->_callbackFlags = flags; + } +} + +@end + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +static void GDTCORReachabilityCallback(GDTCORNetworkReachabilityRef reachability, + GDTCORNetworkReachabilityFlags flags, + void *info) { +#pragma clang diagnostic pop + GDTCORLogDebug(@"Reachability changed, new flags: %d", flags); + [[GDTCORReachability sharedInstance] setCallbackFlags:flags]; +} diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORRegistrar.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORRegistrar.m new file mode 100644 index 0000000..d7e9b09 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORRegistrar.m @@ -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. + */ + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +id _Nullable GDTCORStorageInstanceForTarget(GDTCORTarget target) { + return [GDTCORRegistrar sharedInstance].targetToStorage[@(target)]; +} + +FOUNDATION_EXPORT +id _Nullable GDTCORStoragePromiseInstanceForTarget( + GDTCORTarget target) { + id storage = [GDTCORRegistrar sharedInstance].targetToStorage[@(target)]; + if ([storage conformsToProtocol:@protocol(GDTCORStoragePromiseProtocol)]) { + return storage; + } else { + return nil; + } +} + +@implementation GDTCORRegistrar { + /** Backing ivar for targetToUploader property. */ + NSMutableDictionary> *_targetToUploader; + + /** Backing ivar for targetToStorage property. */ + NSMutableDictionary> *_targetToStorage; +} + ++ (instancetype)sharedInstance { + static GDTCORRegistrar *sharedInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[GDTCORRegistrar alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _registrarQueue = dispatch_queue_create("com.google.GDTCORRegistrar", DISPATCH_QUEUE_SERIAL); + _targetToUploader = [[NSMutableDictionary alloc] init]; + _targetToStorage = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)registerUploader:(id)backend target:(GDTCORTarget)target { + __weak GDTCORRegistrar *weakSelf = self; + dispatch_async(_registrarQueue, ^{ + GDTCORRegistrar *strongSelf = weakSelf; + if (strongSelf) { + GDTCORLogDebug(@"Registered an uploader: %@ for target:%ld", backend, (long)target); + strongSelf->_targetToUploader[@(target)] = backend; + } + }); +} + +- (void)registerStorage:(id)storage target:(GDTCORTarget)target { + __weak GDTCORRegistrar *weakSelf = self; + dispatch_async(_registrarQueue, ^{ + GDTCORRegistrar *strongSelf = weakSelf; + if (strongSelf) { + GDTCORLogDebug(@"Registered storage: %@ for target:%ld", storage, (long)target); + strongSelf->_targetToStorage[@(target)] = storage; + } + }); +} + +- (NSMutableDictionary> *)targetToUploader { + __block NSMutableDictionary> *targetToUploader; + __weak GDTCORRegistrar *weakSelf = self; + dispatch_sync(_registrarQueue, ^{ + GDTCORRegistrar *strongSelf = weakSelf; + if (strongSelf) { + targetToUploader = strongSelf->_targetToUploader; + } + }); + return targetToUploader; +} + +- (NSMutableDictionary> *)targetToStorage { + __block NSMutableDictionary> *targetToStorage; + __weak GDTCORRegistrar *weakSelf = self; + dispatch_sync(_registrarQueue, ^{ + GDTCORRegistrar *strongSelf = weakSelf; + if (strongSelf) { + targetToStorage = strongSelf->_targetToStorage; + } + }); + return targetToStorage; +} + +#pragma mark - GDTCORLifecycleProtocol + +- (void)appWillBackground:(nonnull GDTCORApplication *)app { + NSArray> *uploaders = [self.targetToUploader allValues]; + for (id uploader in uploaders) { + if ([uploader respondsToSelector:@selector(appWillBackground:)]) { + [uploader appWillBackground:app]; + } + } + NSArray> *storages = [self.targetToStorage allValues]; + for (id storage in storages) { + if ([storage respondsToSelector:@selector(appWillBackground:)]) { + [storage appWillBackground:app]; + } + } +} + +- (void)appWillForeground:(nonnull GDTCORApplication *)app { + NSArray> *uploaders = [self.targetToUploader allValues]; + for (id uploader in uploaders) { + if ([uploader respondsToSelector:@selector(appWillForeground:)]) { + [uploader appWillForeground:app]; + } + } + NSArray> *storages = [self.targetToStorage allValues]; + for (id storage in storages) { + if ([storage respondsToSelector:@selector(appWillForeground:)]) { + [storage appWillForeground:app]; + } + } +} + +- (void)appWillTerminate:(nonnull GDTCORApplication *)app { + NSArray> *uploaders = [self.targetToUploader allValues]; + for (id uploader in uploaders) { + if ([uploader respondsToSelector:@selector(appWillTerminate:)]) { + [uploader appWillTerminate:app]; + } + } + NSArray> *storages = [self.targetToStorage allValues]; + for (id storage in storages) { + if ([storage respondsToSelector:@selector(appWillTerminate:)]) { + [storage appWillTerminate:app]; + } + } +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORStorageEventSelector.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORStorageEventSelector.m new file mode 100644 index 0000000..30915da --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORStorageEventSelector.m @@ -0,0 +1,39 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h" + +@implementation GDTCORStorageEventSelector + ++ (instancetype)eventSelectorForTarget:(GDTCORTarget)target { + return [[self alloc] initWithTarget:target eventIDs:nil mappingIDs:nil qosTiers:nil]; +} + +- (instancetype)initWithTarget:(GDTCORTarget)target + eventIDs:(nullable NSSet *)eventIDs + mappingIDs:(nullable NSSet *)mappingIDs + qosTiers:(nullable NSSet *)qosTiers { + self = [super init]; + if (self) { + _selectedTarget = target; + _selectedEventIDs = eventIDs; + _selectedMappingIDs = mappingIDs; + _selectedQosTiers = qosTiers; + } + return self; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransformer.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransformer.m new file mode 100644 index 0000000..b6d0249 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransformer.m @@ -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. + */ + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventTransformer.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" + +@implementation GDTCORTransformer + ++ (instancetype)sharedInstance { + static GDTCORTransformer *eventTransformer; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + eventTransformer = [[self alloc] init]; + }); + return eventTransformer; +} + +- (instancetype)init { + return [self initWithApplication:[GDTCORApplication sharedApplication]]; +} + +- (instancetype)initWithApplication:(id)application { + self = [super init]; + if (self) { + _eventWritingQueue = + dispatch_queue_create("com.google.GDTCORTransformer", DISPATCH_QUEUE_SERIAL); + _application = application; + } + return self; +} + +- (void)transformEvent:(GDTCOREvent *)event + withTransformers:(NSArray> *)transformers + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion { + GDTCORAssert(event, @"You can't write a nil event"); + + __block GDTCORBackgroundIdentifier bgID = GDTCORBackgroundIdentifierInvalid; + __auto_type __weak weakApplication = self.application; + bgID = [self.application beginBackgroundTaskWithName:@"GDTTransformer" + expirationHandler:^{ + [weakApplication endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }]; + + __auto_type completionWrapper = ^(BOOL wasWritten, NSError *_Nullable error) { + if (completion) { + completion(wasWritten, error); + } + + // The work is done, cancel the background task if it's valid. + [weakApplication endBackgroundTask:bgID]; + bgID = GDTCORBackgroundIdentifierInvalid; + }; + + dispatch_async(_eventWritingQueue, ^{ + GDTCOREvent *transformedEvent = event; + for (id transformer in transformers) { + if ([transformer respondsToSelector:@selector(transformGDTEvent:)]) { + GDTCORLogDebug(@"Applying a transformer to event %@", event); + transformedEvent = [transformer transformGDTEvent:event]; + if (!transformedEvent) { + completionWrapper(NO, nil); + return; + } + } else { + GDTCORLogError(GDTCORMCETransformerDoesntImplementTransform, + @"Transformer doesn't implement transformGDTEvent: %@", transformer); + completionWrapper(NO, nil); + return; + } + } + + id storage = + [GDTCORRegistrar sharedInstance].targetToStorage[@(event.target)]; + + [storage storeEvent:transformedEvent onComplete:completionWrapper]; + }); +} + +#pragma mark - GDTCORLifecycleProtocol + +- (void)appWillTerminate:(GDTCORApplication *)application { + // Flush the queue immediately. + dispatch_sync(_eventWritingQueue, ^{ + }); +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransport.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransport.m new file mode 100644 index 0000000..1db4d52 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORTransport.m @@ -0,0 +1,92 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h" +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransport_Private.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h" + +@implementation GDTCORTransport + +- (nullable instancetype)initWithMappingID:(NSString *)mappingID + transformers: + (nullable NSArray> *)transformers + target:(GDTCORTarget)target { + GDTCORAssert(mappingID.length > 0, @"A mapping ID cannot be nil or empty"); + GDTCORAssert(target > 0, @"A target cannot be negative or 0"); + if (mappingID == nil || mappingID.length == 0 || target <= 0) { + return nil; + } + self = [super init]; + if (self) { + _mappingID = mappingID; + _transformers = transformers; + _target = target; + _transformerInstance = [GDTCORTransformer sharedInstance]; + } + GDTCORLogDebug(@"Transport object created. mappingID:%@ transformers:%@ target:%ld", mappingID, + transformers, (long)target); + return self; +} + +- (void)sendTelemetryEvent:(GDTCOREvent *)event + onComplete: + (void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion { + event.qosTier = GDTCOREventQoSTelemetry; + [self sendEvent:event onComplete:completion]; +} + +- (void)sendDataEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion { + GDTCORAssert(event.qosTier != GDTCOREventQoSTelemetry, @"Use -sendTelemetryEvent, please."); + [self sendEvent:event onComplete:completion]; +} + +- (void)sendTelemetryEvent:(GDTCOREvent *)event { + [self sendTelemetryEvent:event onComplete:nil]; +} + +- (void)sendDataEvent:(GDTCOREvent *)event { + [self sendDataEvent:event onComplete:nil]; +} + +- (GDTCOREvent *)eventForTransport { + return [[GDTCOREvent alloc] initWithMappingID:_mappingID target:_target]; +} + +#pragma mark - Private helper methods + +/** Sends the given event through the transport pipeline. + * + * @param event The event to send. + * @param completion A block that will be called when the event has been written or dropped. + */ +- (void)sendEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion { + // TODO: Determine if sending an event before registration is allowed. + GDTCORAssert(event, @"You can't send a nil event"); + GDTCOREvent *copiedEvent = [event copy]; + copiedEvent.clockSnapshot = [GDTCORClock snapshot]; + [self.transformerInstance transformEvent:copiedEvent + withTransformers:_transformers + onComplete:completion]; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadBatch.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadBatch.m new file mode 100644 index 0000000..7d2abe2 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadBatch.m @@ -0,0 +1,30 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h" + +@implementation GDTCORUploadBatch + +- (instancetype)initWithBatchID:(NSNumber *)batchID events:(NSSet *)events { + self = [super init]; + if (self) { + _batchID = batchID; + _events = events; + } + return self; +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadCoordinator.m b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadCoordinator.m new file mode 100644 index 0000000..3357fbe --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORUploadCoordinator.m @@ -0,0 +1,176 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h" + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +#import "GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h" + +@implementation GDTCORUploadCoordinator + ++ (instancetype)sharedInstance { + static GDTCORUploadCoordinator *sharedUploader; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedUploader = [[GDTCORUploadCoordinator alloc] init]; + [sharedUploader startTimer]; + }); + return sharedUploader; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _coordinationQueue = + dispatch_queue_create("com.google.GDTCORUploadCoordinator", DISPATCH_QUEUE_SERIAL); + _registrar = [GDTCORRegistrar sharedInstance]; + _timerInterval = 30 * NSEC_PER_SEC; + _timerLeeway = 5 * NSEC_PER_SEC; + } + return self; +} + +- (void)forceUploadForTarget:(GDTCORTarget)target { + dispatch_async(_coordinationQueue, ^{ + GDTCORLogDebug(@"Forcing an upload of target %ld", (long)target); + GDTCORUploadConditions conditions = [self uploadConditions]; + conditions |= GDTCORUploadConditionHighPriority; + [self uploadTargets:@[ @(target) ] conditions:conditions]; + }); +} + +#pragma mark - Private helper methods + +/** Starts a timer that checks whether or not events can be uploaded at regular intervals. It will + * check the next-upload clocks of all targets to determine if an upload attempt can be made. + */ +- (void)startTimer { + dispatch_async(_coordinationQueue, ^{ + if (self->_timer) { + // The timer has been already started. + return; + } + + // Delay the timer slightly so it doesn't run while +load calls are still running. + dispatch_time_t deadline = dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC / 2); + + self->_timer = + dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self->_coordinationQueue); + dispatch_source_set_timer(self->_timer, deadline, self->_timerInterval, self->_timerLeeway); + + dispatch_source_set_event_handler(self->_timer, ^{ + if (![[GDTCORApplication sharedApplication] isRunningInBackground]) { + GDTCORUploadConditions conditions = [self uploadConditions]; + GDTCORLogDebug(@"%@", @"Upload timer fired"); + [self uploadTargets:[self.registrar.targetToUploader allKeys] conditions:conditions]; + } + }); + GDTCORLogDebug(@"%@", @"Upload timer started"); + dispatch_resume(self->_timer); + }); +} + +/** Stops the currently running timer. */ +- (void)stopTimer { + if (_timer) { + dispatch_source_cancel(_timer); + _timer = nil; + } +} + +/** Triggers the uploader implementations for the given targets to upload. + * + * @param targets An array of targets to trigger. + * @param conditions The set of upload conditions. + */ +- (void)uploadTargets:(NSArray *)targets conditions:(GDTCORUploadConditions)conditions { + dispatch_async(_coordinationQueue, ^{ + // TODO: The reachability signal may be not reliable enough to prevent an upload attempt. + // See https://developer.apple.com/videos/play/wwdc2019/712/ (49:40) for more details. + if ((conditions & GDTCORUploadConditionNoNetwork) == GDTCORUploadConditionNoNetwork) { + return; + } + for (NSNumber *target in targets) { + id uploader = self->_registrar.targetToUploader[target]; + [uploader uploadTarget:target.intValue withConditions:conditions]; + } + }); +} + +- (void)signalToStoragesToCheckExpirations { + // The same storage may be associated with several targets. Make sure to check for expirations + // only once per storage. + NSSet> *storages = + [NSSet setWithArray:[_registrar.targetToStorage allValues]]; + for (id storage in storages) { + [storage checkForExpirations]; + } +} + +/** Returns the registered storage for the given NSNumber wrapped GDTCORTarget. + * + * @param target The NSNumber wrapping of a GDTCORTarget to find the storage instance of. + * @return The storage instance for the given target. + */ +- (nullable id)storageForTarget:(NSNumber *)target { + id storage = [GDTCORRegistrar sharedInstance].targetToStorage[target]; + GDTCORAssert(storage, @"A storage must be registered for target %@", target); + return storage; +} + +/** Returns the current upload conditions after making determinations about the network connection. + * + * @return The current upload conditions. + */ +- (GDTCORUploadConditions)uploadConditions { + GDTCORNetworkReachabilityFlags currentFlags = [GDTCORReachability currentFlags]; + BOOL networkConnected = GDTCORReachabilityFlagsReachable(currentFlags); + if (!networkConnected) { + return GDTCORUploadConditionNoNetwork; + } + BOOL isWWAN = GDTCORReachabilityFlagsContainWWAN(currentFlags); + if (isWWAN) { + return GDTCORUploadConditionMobileData; + } else { + return GDTCORUploadConditionWifiData; + } +} + +#pragma mark - GDTCORLifecycleProtocol + +- (void)appWillForeground:(GDTCORApplication *)app { + // -startTimer is thread-safe. + [self startTimer]; + [self signalToStoragesToCheckExpirations]; +} + +- (void)appWillBackground:(GDTCORApplication *)app { + dispatch_async(_coordinationQueue, ^{ + [self stopTimer]; + }); +} + +- (void)appWillTerminate:(GDTCORApplication *)application { + dispatch_sync(_coordinationQueue, ^{ + [self stopTimer]; + }); +} + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h new file mode 100644 index 0000000..e158a5a --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.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. + */ + +#import + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h" + +NS_ASSUME_NONNULL_BEGIN + +/** A block type that could be run instead of normal assertion logging. No return type, no params. + */ +typedef void (^GDTCORAssertionBlock)(void); + +/** Returns the result of executing a soft-linked method present in unit tests that allows a block + * to be run instead of normal assertion logging. This helps ameliorate issues with catching + * exceptions that occur on a dispatch_queue. + * + * @return A block that can be run instead of normal assert printing. + */ +FOUNDATION_EXPORT GDTCORAssertionBlock _Nullable GDTCORAssertionBlockToRunInstead(void); + +#if defined(NS_BLOCK_ASSERTIONS) + +#define GDTCORAssert(condition, ...) \ + do { \ + } while (0); + +#define GDTCORFatalAssert(condition, ...) \ + do { \ + } while (0); + +#else // defined(NS_BLOCK_ASSERTIONS) + +/** Asserts using a console log, unless a block was specified to be run instead. + * + * @param condition The condition you'd expect to be YES. + */ +#define GDTCORAssert(condition, format, ...) \ + do { \ + __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \ + if (__builtin_expect(!(condition), 0)) { \ + GDTCORAssertionBlock assertionBlock = GDTCORAssertionBlockToRunInstead(); \ + if (assertionBlock) { \ + assertionBlock(); \ + } else { \ + NSString *__assert_file__ = [NSString stringWithUTF8String:__FILE__]; \ + __assert_file__ = __assert_file__ ? __assert_file__ : @""; \ + GDTCORLogAssert(NO, __assert_file__, __LINE__, format, ##__VA_ARGS__); \ + __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \ + } \ + } \ + } while (0); + +/** Asserts by logging to the console and throwing an exception if NS_BLOCK_ASSERTIONS is not + * defined. + * + * @param condition The condition you'd expect to be YES. + */ +#define GDTCORFatalAssert(condition, format, ...) \ + do { \ + __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \ + if (__builtin_expect(!(condition), 0)) { \ + GDTCORAssertionBlock assertionBlock = GDTCORAssertionBlockToRunInstead(); \ + if (assertionBlock) { \ + assertionBlock(); \ + } else { \ + NSString *__assert_file__ = [NSString stringWithUTF8String:__FILE__]; \ + __assert_file__ = __assert_file__ ? __assert_file__ : @""; \ + GDTCORLogAssert(YES, __assert_file__, __LINE__, format, ##__VA_ARGS__); \ + [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \ + object:self \ + file:__assert_file__ \ + lineNumber:__LINE__ \ + description:format, ##__VA_ARGS__]; \ + __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \ + } \ + } \ + } while (0); + +#endif // defined(NS_BLOCK_ASSERTIONS) + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h new file mode 100644 index 0000000..a6fa8a3 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/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/Internal/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/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h new file mode 100644 index 0000000..3d77970 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h @@ -0,0 +1,63 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" + +@class GDTCOREvent; + +NS_ASSUME_NONNULL_BEGIN + +/** A protocol defining the lifecycle events objects in the library must respond to immediately. */ +@protocol GDTCORLifecycleProtocol + +@optional + +/** Indicates an imminent app termination in the rare occurrence when -applicationWillTerminate: has + * been called. + * + * @param app The GDTCORApplication instance. + */ +- (void)appWillTerminate:(GDTCORApplication *)app; + +/** Indicates that the app is moving to background and eventual suspension or the current UIScene is + * deactivating. + * + * @param app The GDTCORApplication instance. + */ +- (void)appWillBackground:(GDTCORApplication *)app; + +/** Indicates that the app is resuming operation or a UIScene is activating. + * + * @param app The GDTCORApplication instance. + */ +- (void)appWillForeground:(GDTCORApplication *)app; + +@end + +/** This class manages the library's response to app lifecycle events. + * + * When backgrounding, the library doesn't stop processing events, it's just that several background + * tasks will end up being created for every event that's sent, and the stateful objects of the + * library (GDTCORStorage and GDTCORUploadCoordinator instances) will deserialize themselves from + * and to disk before and after every operation, respectively. + */ +@interface GDTCORLifecycle : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h new file mode 100644 index 0000000..44252ab --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h @@ -0,0 +1,225 @@ +/* + * 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 + +#if !TARGET_OS_WATCH +#import +#endif + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_OSX +#import +#elif TARGET_OS_WATCH +#import +#endif // TARGET_OS_IOS || TARGET_OS_TV + +#if TARGET_OS_IOS +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** The GoogleDataTransport library version. */ +FOUNDATION_EXPORT NSString *const kGDTCORVersion; + +/** A notification sent out if the app is backgrounding. */ +FOUNDATION_EXPORT NSString *const kGDTCORApplicationDidEnterBackgroundNotification; + +/** A notification sent out if the app is foregrounding. */ +FOUNDATION_EXPORT NSString *const kGDTCORApplicationWillEnterForegroundNotification; + +/** A notification sent out if the app is terminating. */ +FOUNDATION_EXPORT NSString *const kGDTCORApplicationWillTerminateNotification; + +/** The different possible network connection type. */ +typedef NS_ENUM(NSInteger, GDTCORNetworkType) { + GDTCORNetworkTypeUNKNOWN = 0, + GDTCORNetworkTypeWIFI = 1, + GDTCORNetworkTypeMobile = 2, +}; + +/** The different possible network connection mobile subtype. */ +typedef NS_ENUM(NSInteger, GDTCORNetworkMobileSubtype) { + GDTCORNetworkMobileSubtypeUNKNOWN = 0, + GDTCORNetworkMobileSubtypeGPRS = 1, + GDTCORNetworkMobileSubtypeEdge = 2, + GDTCORNetworkMobileSubtypeWCDMA = 3, + GDTCORNetworkMobileSubtypeHSDPA = 4, + GDTCORNetworkMobileSubtypeHSUPA = 5, + GDTCORNetworkMobileSubtypeCDMA1x = 6, + GDTCORNetworkMobileSubtypeCDMAEVDORev0 = 7, + GDTCORNetworkMobileSubtypeCDMAEVDORevA = 8, + GDTCORNetworkMobileSubtypeCDMAEVDORevB = 9, + GDTCORNetworkMobileSubtypeHRPD = 10, + GDTCORNetworkMobileSubtypeLTE = 11, +}; + +#if !TARGET_OS_WATCH +/** Define SCNetworkReachabilityFlags as GDTCORNetworkReachabilityFlags on non-watchOS. */ +typedef SCNetworkReachabilityFlags GDTCORNetworkReachabilityFlags; + +/** Define SCNetworkReachabilityRef as GDTCORNetworkReachabilityRef on non-watchOS. */ +typedef SCNetworkReachabilityRef GDTCORNetworkReachabilityRef; + +#else +/** The different possible reachabilityFlags option on watchOS. */ +typedef NS_OPTIONS(uint32_t, GDTCORNetworkReachabilityFlags) { + kGDTCORNetworkReachabilityFlagsReachable = 1 << 1, + // TODO(doudounan): Add more options on watchOS if watchOS network connection information relative + // APIs available in the future. +}; + +/** Define a struct as GDTCORNetworkReachabilityRef on watchOS to store network connection + * information. */ +typedef struct { + // TODO(doudounan): Store network connection information on watchOS if watchOS network connection + // information relative APIs available in the future. +} GDTCORNetworkReachabilityRef; +#endif + +/** Returns a URL to the root directory under which all GDT-associated data must be saved. + * + * @return A URL to the root directory under which all GDT-associated data must be saved. + */ +NSURL *GDTCORRootDirectory(void); + +/** Compares flags with the reachable flag (on non-watchos with both reachable and + * connectionRequired flags), if available, and returns YES if network reachable. + * + * @param flags The set of reachability flags. + * @return YES if the network is reachable, NO otherwise. + */ +BOOL GDTCORReachabilityFlagsReachable(GDTCORNetworkReachabilityFlags flags); + +/** Compares flags with the WWAN reachability flag, if available, and returns YES if present. + * + * @param flags The set of reachability flags. + * @return YES if the WWAN flag is set, NO otherwise. + */ +BOOL GDTCORReachabilityFlagsContainWWAN(GDTCORNetworkReachabilityFlags flags); + +/** Generates an enum message GDTCORNetworkType representing network connection type. + * + * @return A GDTCORNetworkType representing network connection type. + */ +GDTCORNetworkType GDTCORNetworkTypeMessage(void); + +/** Generates an enum message GDTCORNetworkMobileSubtype representing network connection mobile + * subtype. + * + * @return A GDTCORNetworkMobileSubtype representing network connection mobile subtype. + */ +GDTCORNetworkMobileSubtype GDTCORNetworkMobileSubTypeMessage(void); + +/** Identifies the model of the device on which the library is currently working on. + * + * @return A NSString representing the device model. + */ +NSString *_Nonnull GDTCORDeviceModel(void); + +/** Writes the given object to the given fileURL and populates the given error if it fails. + * + * @param obj The object to encode. + * @param filePath The path to write the object to. Can be nil if you just need the data. + * @param error The error to populate if something goes wrong. + * @return The data of the archive. If error is nil, it's been written to disk. + */ +NSData *_Nullable GDTCOREncodeArchive(id obj, + NSString *_Nullable filePath, + NSError *_Nullable *error); + +/** Decodes an object of the given class from the given archive path or data and populates the given + * error if it fails. + * + * @param archiveClass The class of the archive's root object. + * @param archivePath The path to the archived data. Don't use with the archiveData param. + * @param archiveData The data to decode. Don't use with the archivePath param. + * @param error The error to populate if something goes wrong. + */ +id _Nullable GDTCORDecodeArchive(Class archiveClass, + NSString *_Nullable archivePath, + NSData *_Nullable archiveData, + NSError *_Nullable *error); + +/** Writes the provided data to a file at the provided path. Intermediate directories will be + * created as needed. + * @param data The file content. + * @param filePath The path to the file to write the provided data. + * @param outError The error to populate if something goes wrong. + * @return `YES` in the case of success, `NO` otherwise. + */ +BOOL GDTCORWriteDataToFile(NSData *data, NSString *filePath, NSError *_Nullable *outError); + +/** A typedef identify background identifiers. */ +typedef volatile NSUInteger GDTCORBackgroundIdentifier; + +/** A background task's invalid sentinel value. */ +FOUNDATION_EXPORT const GDTCORBackgroundIdentifier GDTCORBackgroundIdentifierInvalid; + +#if TARGET_OS_IOS || TARGET_OS_TV +/** A protocol that wraps UIApplicationDelegate, WKExtensionDelegate or NSObject protocol, depending + * on the platform. + */ +@protocol GDTCORApplicationDelegate +#elif TARGET_OS_OSX +@protocol GDTCORApplicationDelegate +#elif TARGET_OS_WATCH +@protocol GDTCORApplicationDelegate +#else +@protocol GDTCORApplicationDelegate +#endif // TARGET_OS_IOS || TARGET_OS_TV + +@end + +@protocol GDTCORApplicationProtocol + +@required + +/** Flag to determine if the application is running in the background. */ +@property(atomic, readonly) BOOL isRunningInBackground; + +/** Creates a background task with the returned identifier if on a suitable platform. + * + * @name name The name of the task, useful for debugging which background tasks are running. + * @param handler The handler block that is called if the background task expires. + * @return An identifier for the background task, or GDTCORBackgroundIdentifierInvalid if one + * couldn't be created. + */ +- (GDTCORBackgroundIdentifier)beginBackgroundTaskWithName:(NSString *)name + expirationHandler:(void (^__nullable)(void))handler; + +/** Ends the background task if the identifier is valid. + * + * @param bgID The background task to end. + */ +- (void)endBackgroundTask:(GDTCORBackgroundIdentifier)bgID; + +@end + +/** A cross-platform application class. */ +@interface GDTCORApplication : NSObject + +/** Creates and/or returns the shared application instance. + * + * @return The shared application instance. + */ ++ (nullable GDTCORApplication *)sharedApplication; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h new file mode 100644 index 0000000..eb89832 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h @@ -0,0 +1,31 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h" + +NS_ASSUME_NONNULL_BEGIN + +/** This class helps determine upload conditions by determining connectivity. */ +@interface GDTCORReachability : NSObject + +/** The current set flags indicating network conditions */ ++ (GDTCORNetworkReachabilityFlags)currentFlags; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h new file mode 100644 index 0000000..3ea521b --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.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 + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Manages the registration of targets with the transport SDK. */ +@interface GDTCORRegistrar : NSObject + +/** Creates and/or returns the singleton instance. + * + * @return The singleton instance of this class. + */ ++ (instancetype)sharedInstance; + +/** Registers a backend implementation with the GoogleDataTransport infrastructure. + * + * @param backend The backend object to register. + * @param target The target this backend object will be responsible for. + */ +- (void)registerUploader:(id)backend target:(GDTCORTarget)target; + +/** Registers a storage implementation with the GoogleDataTransport infrastructure. + * + * @param storage The storage instance to be associated with this uploader and target. + * @param target The target this backend object will be responsible for. + */ +- (void)registerStorage:(id)storage target:(GDTCORTarget)target; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h new file mode 100644 index 0000000..7662d8b --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h @@ -0,0 +1,61 @@ +/* + * 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/GDTCORTargets.h" + +NS_ASSUME_NONNULL_BEGIN + +/** This class enables the finding of events by matching events with the properties of this class. + */ +@interface GDTCORStorageEventSelector : NSObject + +/** The target to find events for. Required. */ +@property(readonly, nonatomic) GDTCORTarget selectedTarget; + +/** Finds a specific event. */ +@property(nullable, readonly, nonatomic) NSSet *selectedEventIDs; + +/** Finds all events of a mappingID. */ +@property(nullable, readonly, nonatomic) NSSet *selectedMappingIDs; + +/** Finds all events matching the qosTiers in this list. */ +@property(nullable, readonly, nonatomic) NSSet *selectedQosTiers; + +/** Initializes an event selector that will find all events for the given target. + * + * @param target The selected target. + * @return An immutable event selector instance. + */ ++ (instancetype)eventSelectorForTarget:(GDTCORTarget)target; + +/** Instantiates an event selector. + * + * @param target The selected target. + * @param eventIDs Optional param to find an event matching this eventID. + * @param mappingIDs Optional param to find events matching this mappingID. + * @param qosTiers Optional param to find events matching the given QoS tiers. + * @return An immutable event selector instance. + */ +- (instancetype)initWithTarget:(GDTCORTarget)target + eventIDs:(nullable NSSet *)eventIDs + mappingIDs:(nullable NSSet *)mappingIDs + qosTiers:(nullable NSSet *)qosTiers; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h new file mode 100644 index 0000000..ffccfdb --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h @@ -0,0 +1,171 @@ +/* + * 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/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h" + +@class GDTCOREvent; +@class GDTCORClock; +@class GDTCORUploadBatch; + +@class FBLPromise; + +NS_ASSUME_NONNULL_BEGIN + +/** The data type to represent storage size. */ +typedef uint64_t GDTCORStorageSizeBytes; + +typedef void (^GDTCORStorageBatchBlock)(NSNumber *_Nullable newBatchID, + NSSet *_Nullable batchEvents); + +/** Defines the interface a storage subsystem is expected to implement. */ +@protocol GDTCORStorageProtocol + +@required + +/** Stores an event and calls onComplete with a non-nil error if anything went wrong. + * + * @param event The event to store + * @param completion The completion block to call after an attempt to store the event has been made. + */ +- (void)storeEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion; + +/** Returns YES if some events have been stored for the given target, NO otherwise. + * + * @param onComplete The completion block to invoke when determining if there are events is done. + */ +- (void)hasEventsForTarget:(GDTCORTarget)target onComplete:(void (^)(BOOL hasEvents))onComplete; + +/** Constructs an event batch with the given event selector. Events in this batch will not be + * returned in any queries or other batches until the batch is removed. + * + * @param eventSelector The event selector used to find the events. + * @param expiration The expiration time of the batch. If removeBatchWithID:deleteEvents:onComplete: + * is not called within this time frame, the batch will be removed with its events deleted. + * @param onComplete The completion handler to be called when the events have been fetched. + */ +- (void)batchWithEventSelector:(nonnull GDTCORStorageEventSelector *)eventSelector + batchExpiration:(nonnull NSDate *)expiration + onComplete:(nonnull GDTCORStorageBatchBlock)onComplete; + +/** Removes the event batch. + * + * @param batchID The batchID to remove. + * @param deleteEvents If YES, the events in this batch are deleted. + * @param onComplete The completion handler to call when the batch removal process has completed. + */ +- (void)removeBatchWithID:(NSNumber *)batchID + deleteEvents:(BOOL)deleteEvents + onComplete:(void (^_Nullable)(void))onComplete; + +/** Finds the batchIDs for the given target and calls the callback block. + * + * @param target The target. + * @param onComplete The block to invoke with the set of current batchIDs. + */ +- (void)batchIDsForTarget:(GDTCORTarget)target + onComplete:(void (^)(NSSet *_Nullable batchIDs))onComplete; + +/** Checks the storage for expired events and batches, deletes them if they're expired. */ +- (void)checkForExpirations; + +/** Persists the given data with the given key. + * + * @param data The data to store. + * @param key The unique key to store it to. + * @param onComplete An block to be run when storage of the data is complete. + */ +- (void)storeLibraryData:(NSData *)data + forKey:(NSString *)key + onComplete:(nullable void (^)(NSError *_Nullable error))onComplete; + +/** Retrieves the stored data for the given key and optionally sets a new value. + * + * @param key The key corresponding to the desired data. + * @param onFetchComplete The callback to invoke with the data once it's retrieved. + * @param setValueBlock This optional block can provide a new value to set. + */ +- (void)libraryDataForKey:(nonnull NSString *)key + onFetchComplete:(nonnull void (^)(NSData *_Nullable data, + NSError *_Nullable error))onFetchComplete + setNewValue:(NSData *_Nullable (^_Nullable)(void))setValueBlock; + +/** Removes data from storage and calls the callback when complete. + * + * @param key The key of the data to remove. + * @param onComplete The callback that will be invoked when removing the data is complete. + */ +- (void)removeLibraryDataForKey:(NSString *)key + onComplete:(void (^)(NSError *_Nullable error))onComplete; + +/** Calculates and returns the total disk size that this storage consumes. + * + * @param onComplete The callback that will be invoked once storage size calculation is complete. + */ +- (void)storageSizeWithCallback:(void (^)(GDTCORStorageSizeBytes storageSize))onComplete; + +@end + +// TODO: Consider complete replacing block based API by promise API. + +/** Promise based version of API defined in GDTCORStorageProtocol. See API docs for corresponding + * methods in GDTCORStorageProtocol. */ +@protocol GDTCORStoragePromiseProtocol + +- (FBLPromise *> *)batchIDsForTarget:(GDTCORTarget)target; + +- (FBLPromise *)removeBatchWithID:(NSNumber *)batchID deleteEvents:(BOOL)deleteEvents; + +- (FBLPromise *)removeBatchesWithIDs:(NSSet *)batchIDs + deleteEvents:(BOOL)deleteEvents; + +- (FBLPromise *)removeAllBatchesForTarget:(GDTCORTarget)target + deleteEvents:(BOOL)deleteEvents; + +/** See `hasEventsForTarget:onComplete:`. + * @return A promise object that is resolved with @YES if there are events for the specified target + * and @NO otherwise. + */ +- (FBLPromise *)hasEventsForTarget:(GDTCORTarget)target; + +/** See `batchWithEventSelector:batchExpiration:onComplete:` + * The promise is rejected when there are no events for the specified selector. + */ +- (FBLPromise *)batchWithEventSelector: + (GDTCORStorageEventSelector *)eventSelector + batchExpiration:(NSDate *)expiration; + +@end + +/** Retrieves the storage instance for the given target. + * + * @param target The target. + * * @return The storage instance registered for the target, or nil if there is none. + */ +FOUNDATION_EXPORT +id _Nullable GDTCORStorageInstanceForTarget(GDTCORTarget target); + +// TODO: Ideally we should remove completion-based API and use promise-based one. Need to double +// check if it's ok. +FOUNDATION_EXPORT +id _Nullable GDTCORStoragePromiseInstanceForTarget( + GDTCORTarget target); + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h new file mode 100644 index 0000000..9b5343d --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h @@ -0,0 +1,59 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Options that define a set of upload conditions. This is used to help minimize end user data + * consumption impact. + */ +typedef NS_OPTIONS(NSInteger, GDTCORUploadConditions) { + + /** An upload shouldn't be attempted, because there's no network. */ + GDTCORUploadConditionNoNetwork = 1 << 0, + + /** An upload would likely use mobile data. */ + GDTCORUploadConditionMobileData = 1 << 1, + + /** An upload would likely use wifi data. */ + GDTCORUploadConditionWifiData = 1 << 2, + + /** An upload uses some sort of network connection, but it's unclear which. */ + GDTCORUploadConditionUnclearConnection = 1 << 3, + + /** A high priority event has occurred. */ + GDTCORUploadConditionHighPriority = 1 << 4, +}; + +/** This protocol defines the common interface for uploader implementations. */ +@protocol GDTCORUploader + +@required + +/** Uploads events to the backend using this specific backend's chosen format. + * + * @param conditions The conditions that the upload attempt is likely to occur under. + */ +- (void)uploadTarget:(GDTCORTarget)target withConditions:(GDTCORUploadConditions)conditions; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREndpoints_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREndpoints_Private.h new file mode 100644 index 0000000..4b1a903 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREndpoints_Private.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. + */ + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h" + +@interface GDTCOREndpoints () + +/** Returns the list of all the upload URLs used by the transport library. + * + * @return Map of the transport target and the URL used for uploading the events for that target. + */ ++ (NSDictionary *)uploadURLs; + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h new file mode 100644 index 0000000..e97eb31 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h @@ -0,0 +1,33 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h" + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface GDTCOREvent () + +/** The unique ID of the event. This property is for testing only. */ +@property(nonatomic, readwrite) NSString *eventID; + +/** Generates a unique event ID. */ ++ (NSString *)nextEventID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage+Promises.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage+Promises.h new file mode 100644 index 0000000..66ea857 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage+Promises.h @@ -0,0 +1,28 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h" + +@class FBLPromise; + +NS_ASSUME_NONNULL_BEGIN + +/// The category extends `GDTCORFlatFileStorage` API with `GDTCORStoragePromiseProtocol` methods. +@interface GDTCORFlatFileStorage (Promises) + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h new file mode 100644 index 0000000..09f1dae --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h @@ -0,0 +1,158 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h" + +@class GDTCOREvent; +@class GDTCORUploadCoordinator; + +NS_ASSUME_NONNULL_BEGIN + +/** The event components eventID dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCOREventComponentsEventIDKey; + +/** The event components qosTier dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCOREventComponentsQoSTierKey; + +/** The event components mappingID dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCOREventComponentsMappingIDKey; + +/** The event components expirationDate dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCOREventComponentsExpirationKey; + +/** The batch components target dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCORBatchComponentsTargetKey; + +/** The batch components batchID dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCORBatchComponentsBatchIDKey; + +/** The batch components expiration dictionary key. */ +FOUNDATION_EXPORT NSString *const kGDTCORBatchComponentsExpirationKey; + +/** The maximum allowed disk space taken by the stored data. */ +FOUNDATION_EXPORT const uint64_t kGDTCORFlatFileStorageSizeLimit; + +FOUNDATION_EXPORT NSString *const GDTCORFlatFileStorageErrorDomain; + +typedef NS_ENUM(NSInteger, GDTCORFlatFileStorageError) { + GDTCORFlatFileStorageErrorSizeLimitReached = 0 +}; + +/** Manages the storage of events. This class is thread-safe. + * + * Event files will be stored as follows: + * /google-sdk-events//gdt_event_data//.. + * + * Library data will be stored as follows: + * /google-sdk-events//gdt_library_data/ + * + * Batch data will be stored as follows: + * /google-sdk-events//gdt_batch_data/./.. + */ +@interface GDTCORFlatFileStorage : NSObject + +/** The queue on which all storage work will occur. */ +@property(nonatomic) dispatch_queue_t storageQueue; + +/** The upload coordinator instance used by this storage instance. */ +@property(nonatomic) GDTCORUploadCoordinator *uploadCoordinator; + +/** Creates and/or returns the storage singleton. + * + * @return The storage singleton. + */ ++ (instancetype)sharedInstance; + +/** Returns the base directory under which all events will be stored. + * + * @return The base directory under which all events will be stored. + */ ++ (NSString *)eventDataStoragePath; + +/** Returns the base directory under which all library data will be stored. + * + * @return The base directory under which all library data will be stored. + */ ++ (NSString *)libraryDataStoragePath; + +/** Returns the base directory under which all batch data will be stored. + * + * @return The base directory under which all batch data will be stored. + */ ++ (NSString *)batchDataStoragePath; + +/** */ ++ (NSString *)batchPathForTarget:(GDTCORTarget)target + batchID:(NSNumber *)batchID + expirationDate:(NSDate *)expirationDate; + +/** Returns a constructed storage path based on the given values. This path may not exist. + * + * @param target The target, which is necessary to be given a path. + * @param eventID The eventID. + * @param qosTier The qosTier. + * @param expirationDate The expirationDate as a 1970-relative time interval. + * @param mappingID The mappingID. + * @return The path representing the combination of the given parameters. + */ ++ (NSString *)pathForTarget:(GDTCORTarget)target + eventID:(NSString *)eventID + qosTier:(NSNumber *)qosTier + expirationDate:(NSDate *)expirationDate + mappingID:(NSString *)mappingID; + +/** Returns extant paths that match all of the given parameters. + * + * @param eventIDs The list of eventIDs to look for, or nil for any. + * @param qosTiers The list of qosTiers to look for, or nil for any. + * @param mappingIDs The list of mappingIDs to look for, or nil for any. + * @param onComplete The completion to call once the paths have been discovered. + */ +- (void)pathsForTarget:(GDTCORTarget)target + eventIDs:(nullable NSSet *)eventIDs + qosTiers:(nullable NSSet *)qosTiers + mappingIDs:(nullable NSSet *)mappingIDs + onComplete:(void (^)(NSSet *paths))onComplete; + +/** Fetches the current batchID counter value from library storage, increments it, and sets the new + * value. Returns nil if a batchID was not able to be created for some reason. + * + * @param onComplete A block to execute when creating the next batchID is complete. + */ +- (void)nextBatchID:(void (^)(NSNumber *_Nullable batchID))onComplete; + +/** Constructs a dictionary of event filename components. + * + * @param fileName The event filename to split. + * @return The dictionary of event component keys to their values. + */ +- (nullable NSDictionary *)eventComponentsFromFilename:(NSString *)fileName; + +/** Constructs a dictionary of batch filename components. + * + * @param fileName The batch folder name to split. + * @return The dictionary of batch component keys to their values. + */ +- (nullable NSDictionary *)batchComponentsFromFilename:(NSString *)fileName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORReachability_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORReachability_Private.h new file mode 100644 index 0000000..06b1f67 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORReachability_Private.h @@ -0,0 +1,30 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h" + +@interface GDTCORReachability () + +/** Allows manually setting the flags for testing purposes. */ +@property(nonatomic, readwrite) GDTCORNetworkReachabilityFlags flags; + +/** Creates/returns the singleton instance of this class. + * + * @return The singleton instance of this class. + */ ++ (instancetype)sharedInstance; + +@end diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h new file mode 100644 index 0000000..2679611 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h @@ -0,0 +1,35 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h" + +@interface GDTCORRegistrar () + +NS_ASSUME_NONNULL_BEGIN + +/** The concurrent queue on which all registration occurs. */ +@property(nonatomic, readonly) dispatch_queue_t registrarQueue; + +/** A map of targets to backend implementations. */ +@property(atomic, readonly) NSMutableDictionary> *targetToUploader; + +/** A map of targets to storage instances. */ +@property(atomic, readonly) + NSMutableDictionary> *targetToStorage; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h new file mode 100644 index 0000000..ccca628 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.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. + */ + +#import + +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" + +@class GDTCOREvent; + +@protocol GDTCOREventTransformer; + +NS_ASSUME_NONNULL_BEGIN + +/** Manages the transforming of events. It's desirable for this to be its own class + * because running all events through a single instance ensures that transformers are thread-safe. + * Having a per-transport queue to run on isn't sufficient because transformer objects could + * maintain state (or at least, there's nothing to stop them from doing that) and the same instances + * may be used across multiple instances. + */ +@interface GDTCORTransformer : NSObject + +/** Instantiates or returns the event transformer singleton. + * + * @return The singleton instance of the event transformer. + */ ++ (instancetype)sharedInstance; + +/** Writes the result of applying the given transformers' `transformGDTEvent:` method on the given + * event. + * + * @note If the app is suspended, a background task will be created to complete work in-progress, + * but this method will not send any further events until the app is resumed. + * + * @param event The event to apply transformers on. + * @param transformers The list of transformers to apply. + * @param completion A block to run when an event was written to disk or dropped. + */ +- (void)transformEvent:(GDTCOREvent *)event + withTransformers:(nullable NSArray> *)transformers + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h new file mode 100644 index 0000000..bb86407 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h @@ -0,0 +1,37 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h" + +@protocol GDTCORApplicationProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@interface GDTCORTransformer () + +/** The queue on which all work will occur. */ +@property(nonatomic) dispatch_queue_t eventWritingQueue; + +/** The application instance that is used to begin/end background tasks. */ +@property(nonatomic, readonly) id application; + +/** The internal initializer. Should be used in tests only to create an instance with a + * particular(fake) application instance. */ +- (instancetype)initWithApplication:(id)application; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransport_Private.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransport_Private.h new file mode 100644 index 0000000..41a1224 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransport_Private.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 "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h" + +@class GDTCORTransformer; + +NS_ASSUME_NONNULL_BEGIN + +@interface GDTCORTransport () + +/** The mapping identifier that the target backend will use to map the transport bytes to proto. */ +@property(nonatomic) NSString *mappingID; + +/** The transformers that will operate on events sent by this transport. */ +@property(nonatomic) NSArray> *transformers; + +/** The target backend of this transport. */ +@property(nonatomic) NSInteger target; + +/** The transformer instance to used to transform events. Allows injecting a fake during testing. */ +@property(nonatomic) GDTCORTransformer *transformerInstance; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h new file mode 100644 index 0000000..8d1fd11 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h @@ -0,0 +1,37 @@ +/* + * 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 + +@class GDTCOREvent; + +NS_ASSUME_NONNULL_BEGIN + +/// A data object representing a batch of events scheduled for upload. +@interface GDTCORUploadBatch : NSObject + +/// An ID used to identify the batch in the storage. +@property(nonatomic, readonly) NSNumber *batchID; + +/// The collection of the events in the batch. +@property(nonatomic, readonly) NSSet *events; + +/// The default initializer. See also docs for the corresponding properties. +- (instancetype)initWithBatchID:(NSNumber *)batchID events:(NSSet *)events; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h new file mode 100644 index 0000000..bdac3f3 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h @@ -0,0 +1,68 @@ +/* + * 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 "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h" +#import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h" + +@class GDTCORClock; + +NS_ASSUME_NONNULL_BEGIN + +/** This class connects storage and uploader implementations, providing events to an uploader + * and informing the storage what events were successfully uploaded or not. + */ +@interface GDTCORUploadCoordinator : NSObject + +/** The queue on which all upload coordination will occur. Also used by a dispatch timer. */ +/** Creates and/or returrns the singleton. + * + * @return The singleton instance of this class. + */ ++ (instancetype)sharedInstance; + +/** The queue on which all upload coordination will occur. */ +@property(nonatomic, readonly) dispatch_queue_t coordinationQueue; + +/** A timer that will causes regular checks for events to upload. */ +@property(nonatomic, readonly, nullable) dispatch_source_t timer; + +/** The interval the timer will fire. */ +@property(nonatomic, readonly) uint64_t timerInterval; + +/** Some leeway given to libdispatch for the timer interval event. */ +@property(nonatomic, readonly) uint64_t timerLeeway; + +/** The registrar object the coordinator will use. Generally used for testing. */ +@property(nonatomic) GDTCORRegistrar *registrar; + +/** Forces the backend specified by the target to upload the provided set of events. This should + * only ever happen when the QoS tier of an event requires it. + * + * @param target The target that should force an upload. + */ +- (void)forceUploadForTarget:(GDTCORTarget)target; + +/** Starts the upload timer. */ +- (void)startTimer; + +/** Stops the upload timer from running. */ +- (void)stopTimer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h new file mode 100644 index 0000000..8c75b50 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h @@ -0,0 +1,66 @@ +/* + * 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 + +/** This class manages the device clock and produces snapshots of the current time. */ +@interface GDTCORClock : NSObject + +/** The wallclock time, UTC, in milliseconds. */ +@property(nonatomic, readonly) int64_t timeMillis; + +/** The offset from UTC in seconds. */ +@property(nonatomic, readonly) int64_t timezoneOffsetSeconds; + +/** The kernel boot time when this clock was created in nanoseconds. */ +@property(nonatomic, readonly) int64_t kernelBootTimeNanoseconds; + +/** The device uptime when this clock was created in nanoseconds. */ +@property(nonatomic, readonly) int64_t uptimeNanoseconds; + +@property(nonatomic, readonly) int64_t kernelBootTime DEPRECATED_MSG_ATTRIBUTE( + "Please use `kernelBootTimeNanoseconds` instead"); + +@property(nonatomic, readonly) + int64_t uptime DEPRECATED_MSG_ATTRIBUTE("Please use `uptimeNanoseconds` instead"); + +/** Creates a GDTCORClock object using the current time and offsets. + * + * @return A new GDTCORClock object representing the current time state. + */ ++ (instancetype)snapshot; + +/** Creates a GDTCORClock object representing a time in the future, relative to now. + * + * @param millisInTheFuture The millis in the future from now this clock should represent. + * @return An instance representing a future time. + */ ++ (instancetype)clockSnapshotInTheFuture:(uint64_t)millisInTheFuture; + +/** Compares one clock with another, returns YES if the caller is after the parameter. + * + * @return YES if the calling clock's time is after the given clock's time. + */ +- (BOOL)isAfter:(GDTCORClock *)otherClock; + +/** Returns value of `uptime` property in milliseconds. */ +- (int64_t)uptimeMilliseconds; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h new file mode 100644 index 0000000..1fdf732 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h @@ -0,0 +1,144 @@ +/* + * 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 current logging level. This value and higher will be printed. Declared as volatile to make + * getting and setting atomic. + */ +FOUNDATION_EXPORT volatile NSInteger GDTCORConsoleLoggerLoggingLevel; + +/** A list of logging levels that GDT supports. */ +typedef NS_ENUM(NSInteger, GDTCORLoggingLevel) { + + /** Causes all logs to be printed. */ + GDTCORLoggingLevelDebug = 1, + + /** Causes all non-debug logs to be printed. */ + GDTCORLoggingLevelVerbose = 2, + + /** Causes warnings and errors to be printed. */ + GDTCORLoggingLevelWarnings = 3, + + /** Causes errors to be printed. This is the default value. */ + GDTCORLoggingLevelErrors = 4 +}; + +/** A list of message codes to print in the logger that help to correspond printed messages with + * code locations. + * + * Prefixes: + * - MCD => MessageCodeDebug + * - MCW => MessageCodeWarning + * - MCE => MessageCodeError + */ +typedef NS_ENUM(NSInteger, GDTCORMessageCode) { + + /** For debug logs. */ + GDTCORMCDDebugLog = 0, + + /** For warning messages concerning transportBytes: not being implemented by a data object. */ + GDTCORMCWDataObjectMissingBytesImpl = 1, + + /** For warning messages concerning a failed event upload. */ + GDTCORMCWUploadFailed = 2, + + /** For warning messages concerning a forced event upload. */ + GDTCORMCWForcedUpload = 3, + + /** For warning messages concerning a failed reachability call. */ + GDTCORMCWReachabilityFailed = 4, + + /** For warning messages concerning a database warning. */ + GDTCORMCWDatabaseWarning = 5, + + /** For warning messages concerning the reading of a event file. */ + GDTCORMCWFileReadError = 6, + + /** For error messages concerning transformGDTEvent: not being implemented by an event + transformer. */ + GDTCORMCETransformerDoesntImplementTransform = 1000, + + /** For error messages concerning the creation of a directory failing. */ + GDTCORMCEDirectoryCreationError = 1001, + + /** For error messages concerning the writing of a event file. */ + GDTCORMCEFileWriteError = 1002, + + /** For error messages concerning the lack of a prioritizer for a given backend. */ + GDTCORMCEPrioritizerError = 1003, + + /** For error messages concerning a package delivery API violation. */ + GDTCORMCEDeliverTwice = 1004, + + /** For error messages concerning an error in an implementation of -transportBytes. */ + GDTCORMCETransportBytesError = 1005, + + /** For general purpose error messages in a dependency. */ + GDTCORMCEGeneralError = 1006, + + /** For fatal errors. Please go to https://github.com/firebase/firebase-ios-sdk/issues and open + * an issue if you encounter an error with this code. + */ + GDTCORMCEFatalAssertion = 1007, + + /** For error messages concerning the reading of a event file. */ + GDTCORMCEFileReadError = 1008, + + /** For errors related to running sqlite. */ + GDTCORMCEDatabaseError = 1009, +}; + +/** Prints the given code and format string to the console. + * + * @param code The message code describing the nature of the log. + * @param logLevel The log level of this log. + * @param format The format string. + */ +FOUNDATION_EXPORT +void GDTCORLog(GDTCORMessageCode code, GDTCORLoggingLevel logLevel, NSString *_Nonnull format, ...) + NS_FORMAT_FUNCTION(3, 4); + +/** Prints an assert log to the console. + * + * @param wasFatal Send YES if the assertion should be fatal, NO otherwise. + * @param file The file in which the failure occurred. + * @param line The line number of the failure. + * @param format The format string. + */ +FOUNDATION_EXPORT void GDTCORLogAssert(BOOL wasFatal, + NSString *_Nonnull file, + NSInteger line, + NSString *_Nullable format, + ...) NS_FORMAT_FUNCTION(4, 5); + +/** Returns the string that represents some message code. + * + * @param code The code to convert to a string. + * @return The string representing the message code. + */ +FOUNDATION_EXPORT NSString *_Nonnull GDTCORMessageCodeEnumToString(GDTCORMessageCode code); + +#define GDTCORLogDebug(MESSAGE_FORMAT, ...) \ + GDTCORLog(GDTCORMCDDebugLog, GDTCORLoggingLevelDebug, MESSAGE_FORMAT, __VA_ARGS__); + +// A define to wrap GULLogWarning with slightly more convenient usage. +#define GDTCORLogWarning(MESSAGE_CODE, MESSAGE_FORMAT, ...) \ + GDTCORLog(MESSAGE_CODE, GDTCORLoggingLevelWarnings, MESSAGE_FORMAT, __VA_ARGS__); + +// A define to wrap GULLogError with slightly more convenient usage and a failing assert. +#define GDTCORLogError(MESSAGE_CODE, MESSAGE_FORMAT, ...) \ + GDTCORLog(MESSAGE_CODE, GDTCORLoggingLevelErrors, MESSAGE_FORMAT, __VA_ARGS__); diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h new file mode 100644 index 0000000..836a454 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#import +#import "GDTCORTargets.h" + +NS_ASSUME_NONNULL_BEGIN + +/* Class that manages the endpoints used by Google data transport library. */ +@interface GDTCOREndpoints : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Returns the upload URL for a target specified. If the target is not available, returns nil. + * + * @param target GoogleDataTransport target for which the upload URL is being looked up for. + * @return URL that will be used for uploading the events for the provided target. + */ ++ (nullable NSURL *)uploadURLForTarget:(GDTCORTarget)target; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h new file mode 100644 index 0000000..52c2384 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h @@ -0,0 +1,87 @@ +/* + * 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 "GDTCOREventDataObject.h" +#import "GDTCORTargets.h" + +@class GDTCORClock; + +NS_ASSUME_NONNULL_BEGIN + +/** The different possible quality of service specifiers. High values indicate high priority. */ +typedef NS_ENUM(NSInteger, GDTCOREventQoS) { + /** The QoS tier wasn't set, and won't ever be sent. */ + GDTCOREventQoSUnknown = 0, + + /** This event is internal telemetry data that should not be sent on its own if possible. */ + GDTCOREventQoSTelemetry = 1, + + /** This event should be sent, but in a batch only roughly once per day. */ + GDTCOREventQoSDaily = 2, + + /** This event should be sent when requested by the uploader. */ + GDTCOREventQosDefault = 3, + + /** This event should be sent immediately along with any other data that can be batched. */ + GDTCOREventQoSFast = 4, + + /** This event should only be uploaded on wifi. */ + GDTCOREventQoSWifiOnly = 5, +}; + +@interface GDTCOREvent : NSObject + +/** The unique ID of the event. */ +@property(readonly, nonatomic) NSString *eventID; + +/** The mapping identifier, to allow backends to map the transport bytes to a proto. */ +@property(nullable, readonly, nonatomic) NSString *mappingID; + +/** The identifier for the backend this event will eventually be sent to. */ +@property(readonly, nonatomic) GDTCORTarget target; + +/** The data object encapsulated in the transport of your choice, as long as it implements + * the GDTCOREventDataObject protocol. */ +@property(nullable, nonatomic) id dataObject; + +/** The serialized bytes from calling [dataObject transportBytes]. */ +@property(nullable, readonly, nonatomic) NSData *serializedDataObjectBytes; + +/** The quality of service tier this event belongs to. */ +@property(nonatomic) GDTCOREventQoS qosTier; + +/** The clock snapshot at the time of the event. */ +@property(nonatomic) GDTCORClock *clockSnapshot; + +/** The expiration date of the event. Default is 604800 seconds (7 days) from creation. */ +@property(nonatomic) NSDate *expirationDate; + +/** Bytes that can be used by an uploader later on. */ +@property(nullable, nonatomic) NSData *customBytes; + +/** Initializes an instance using the given mappingID. + * + * @param mappingID The mapping identifier. + * @param target The event's target identifier. + * @return An instance of this class. + */ +- (nullable instancetype)initWithMappingID:(NSString *)mappingID target:(GDTCORTarget)target; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventDataObject.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventDataObject.h new file mode 100644 index 0000000..34ef624 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventDataObject.h @@ -0,0 +1,36 @@ +/* + * 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 + +/** This protocol defines the common interface that event protos should implement regardless of the + * underlying transport technology (protobuf, nanopb, etc). + */ +@protocol GDTCOREventDataObject + +@required + +/** Returns the serialized proto bytes of the implementing event proto. + * + * @return the serialized proto bytes of the implementing event proto. + */ +- (NSData *)transportBytes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventTransformer.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventTransformer.h new file mode 100644 index 0000000..80dee7d --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventTransformer.h @@ -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. + */ + +#import + +@class GDTCOREvent; + +NS_ASSUME_NONNULL_BEGIN + +/** Defines the API that event transformers must adopt. */ +@protocol GDTCOREventTransformer + +@required + +/** Transforms an event by applying some logic to it. Events returned can be nil, for example, in + * instances where the event should be sampled. + * + * @param event The event to transform. + * @return A transformed event, or nil if the transformation dropped the event. + */ +- (nullable GDTCOREvent *)transformGDTEvent:(GDTCOREvent *)event; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h new file mode 100644 index 0000000..0b83ab9 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h @@ -0,0 +1,40 @@ +/* + * 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 + +/** The list of targets supported by the shared transport infrastructure. If adding a new target, + * please use the previous value +1. + */ +typedef NS_ENUM(NSInteger, GDTCORTarget) { + + /** A target only used in testing. */ + kGDTCORTargetTest = 999, + + /** The CCT target. */ + kGDTCORTargetCCT = 1000, + + /** The FLL target. */ + kGDTCORTargetFLL = 1001, + + /** The CSH target. The CSH target is a special-purpose backend. Please do not use it without + * permission. + */ + kGDTCORTargetCSH = 1002, + + /** The INT target. */ + kGDTCORTargetINT = 1003, +}; diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h new file mode 100644 index 0000000..e58248d --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h @@ -0,0 +1,92 @@ +/* + * 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 "GDTCOREventTransformer.h" +#import "GDTCORTargets.h" + +@class GDTCOREvent; + +NS_ASSUME_NONNULL_BEGIN + +@interface GDTCORTransport : NSObject + +// Please use the designated initializer. +- (instancetype)init NS_UNAVAILABLE; + +/** Initializes a new transport that will send events to the given target backend. + * + * @param mappingID The mapping identifier used by the backend to map the data object transport + * bytes to a proto. + * @param transformers A list of transformers to be applied to events that are sent. + * @param target The target backend of this transport. + * @return A transport that will send events. + */ +- (nullable instancetype)initWithMappingID:(NSString *)mappingID + transformers: + (nullable NSArray> *)transformers + target:(GDTCORTarget)target NS_DESIGNATED_INITIALIZER; + +/** Copies and sends an internal telemetry event. Events sent using this API are lower in priority, + * and sometimes won't be sent on their own. + * + * @note This will convert the event's data object to data and release the original event. + * + * @param event The event to send. + * @param completion A block that will be called when the event has been written or dropped. + */ +- (void)sendTelemetryEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion; + +/** Copies and sends an internal telemetry event. Events sent using this API are lower in priority, + * and sometimes won't be sent on their own. + * + * @note This will convert the event's data object to data and release the original event. + * + * @param event The event to send. + */ +- (void)sendTelemetryEvent:(GDTCOREvent *)event; + +/** Copies and sends an SDK service data event. Events send using this API are higher in priority, + * and will cause a network request at some point in the relative near future. + * + * @note This will convert the event's data object to data and release the original event. + * + * @param event The event to send. + * @param completion A block that will be called when the event has been written or dropped. + */ +- (void)sendDataEvent:(GDTCOREvent *)event + onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable error))completion; + +/** Copies and sends an SDK service data event. Events send using this API are higher in priority, + * and will cause a network request at some point in the relative near future. + * + * @note This will convert the event's data object to data and release the original event. + * + * @param event The event to send. + */ +- (void)sendDataEvent:(GDTCOREvent *)event; + +/** Creates an event for use by this transport. + * + * @return An event that is suited for use by this transport. + */ +- (GDTCOREvent *)eventForTransport; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GoogleDataTransport.h b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GoogleDataTransport.h new file mode 100644 index 0000000..0bd39dc --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GoogleDataTransport.h @@ -0,0 +1,24 @@ +/* + * 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 "GDTCORClock.h" +#import "GDTCORConsoleLogger.h" +#import "GDTCOREndpoints.h" +#import "GDTCOREvent.h" +#import "GDTCOREventDataObject.h" +#import "GDTCOREventTransformer.h" +#import "GDTCORTargets.h" +#import "GDTCORTransport.h" diff --git a/SaraAttended/Pods/GoogleDataTransport/LICENSE b/SaraAttended/Pods/GoogleDataTransport/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/GoogleDataTransport/README.md b/SaraAttended/Pods/GoogleDataTransport/README.md new file mode 100644 index 0000000..2633a79 --- /dev/null +++ b/SaraAttended/Pods/GoogleDataTransport/README.md @@ -0,0 +1,231 @@ +[![Version](https://img.shields.io/cocoapods/v/GoogleDataTransport.svg?style=flat)](https://cocoapods.org/pods/GoogleDataTransport) +[![License](https://img.shields.io/cocoapods/l/GoogleDataTransport.svg?style=flat)](https://cocoapods.org/pods/GoogleDataTransport) +[![Platform](https://img.shields.io/cocoapods/p/GoogleDataTransport.svg?style=flat)](https://cocoapods.org/pods/GoogleDataTransport) + +[![Actions Status][gh-datatransport-badge]][gh-actions] + +# GoogleDataTransport + +This library is for internal Google use only. It allows the logging of data and +telemetry from Google SDKs. + +## Integration Testing +These instructions apply to minor and patch version updates. Major versions need +a customized adaptation. + +After the CI is green: +* Determine the next version for release by checking the + [tagged releases](https://github.com/google/GoogleDataTransport/tags). + Ensure that the next release version keeps the Swift PM and CocoaPods versions in sync. +* Verify that the releasing version is the latest entry in the [CHANGELOG.md](CHANGELOG.md), + updating it if necessary. +* Update the version in the podspec to match the latest entry in the [CHANGELOG.md](CHANGELOG.md) +* Checkout the `main` branch and ensure it is up to date. + ```console + git checkout main + git pull + ``` +* Add the CocoaPods tag (`{version}` will be the latest version in the [podspec](GoogleDataTransport.podspec#L3)) + ```console + git tag CocoaPods-{version} + git push origin CocoaPods-{version} + ``` +* Push the podspec to the designated repo + * If this version of GDT is intended to launch **before or with** the next Firebase release: +
+ Push to SpecsStaging + + ```console + pod repo push --skip-tests staging GoogleDataTransport.podspec + ``` + + If the command fails with `Unable to find the 'staging' repo.`, add the staging repo with: + ```console + pod repo add staging git@github.com:firebase/SpecsStaging.git + ``` +
+ * Otherwise: +
+ Push to SpecsDev + + ```console + pod repo push --skip-tests dev GoogleDataTransport.podspec + ``` + + If the command fails with `Unable to find the 'dev' repo.`, add the dev repo with: + ```console + pod repo add dev git@github.com:firebase/SpecsDev.git + ``` +
+* Run Firebase CI by waiting until next nightly or adding a PR that touches `Gemfile`. +* On google3, create a workspace and new CL. Then copybara and run a global TAP. +
+  /google/data/ro/teams/copybara/copybara third_party/firebase/ios/Releases/GoogleDataTransport/copy.bara.sky \
+  --piper-description-behavior=OVERWRITE \
+  --destination-cl=YOUR_CL gdt
+  
+ +## Publishing +The release process is as follows: +1. [Tag and release for Swift PM](#swift-package-manager) +2. [Publish to CocoaPods](#cocoapods) +3. [Create GitHub Release](#create-github-release) +4. [Perform post release cleanup](#post-release-cleanup) + +### Swift Package Manager + By creating and [pushing a tag](https://github.com/google/GoogleDataTransport/tags) + for Swift PM, the newly tagged version will be immediately released for public use. + Given this, please verify the intended time of release for Swift PM. + * Add a version tag for Swift PM + ```console + git tag {version} + git push origin {version} + ``` + *Note: Ensure that any inflight PRs that depend on the new `GoogleDataTransport` version are updated to point to the + newly tagged version rather than a checksum.* + +### CocoaPods +* Publish the newly versioned pod to CocoaPods + + It's recommended to point to the `GoogleDataTransport.podspec` in `staging` to make sure the correct spec is being published. + ```console + pod trunk push ~/.cocoapods/repos/staging/GoogleDataTransport/{version}/GoogleDataTransport.podspec --skip-tests + ``` + + The pod push was successful if the above command logs: `πŸš€ GoogleDataTransport ({version}) successfully published`. + In addition, a new commit that publishes the new version (co-authored by [CocoaPodsAtGoogle](https://github.com/CocoaPodsAtGoogle)) + should appear in the [CocoaPods specs repo](https://github.com/CocoaPods/Specs). Last, the latest version should be displayed + on [GoogleDataTransport's CocoaPods page](https://cocoapods.org/pods/GoogleDataTransport). + +### [Create GitHub Release](https://github.com/google/GoogleDataTransport/releases/new/) + Update the [release template](https://github.com/google/GoogleDataTransport/releases/new/)'s **Tag version** and **Release title** + fields with the latest version. In addition, reference the [Release Notes](./CHANGELOG.md) in the release's description. + + See [this release](https://github.com/google/GoogleDataTransport/releases/edit/9.0.1) for an example. + + *Don't forget to perform the [post release cleanup](#post-release-cleanup)!* + +### Post Release Cleanup +
+ Clean up SpecsStaging + + ```console + pwd=$(pwd) + mkdir -p /tmp/release-cleanup && cd $_ + git clone git@github.com:firebase/SpecsStaging.git + cd SpecsStaging/ + git rm -rf GoogleDataTransport/ + git commit -m "Post publish cleanup" + git push origin master + rm -rf /tmp/release-cleanup + cd $pwd + ``` +
+ +## Set logging level + +### Swift + +- Import `GoogleDataTransport` module: + ```swift + import GoogleDataTransport + ``` +- Set logging level global variable to the desired value before calling `FirebaseApp.configure()`: + ```swift + GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevel.debug.rawValue + ``` +### Objective-C + +- Import `GoogleDataTransport`: + ```objective-c + #import + ``` +- Set logging level global variable to the desired value before calling `-[FIRApp configure]`: + ```objective-c + GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevelDebug; + ``` + +## Prereqs + +- `gem install --user cocoapods cocoapods-generate` +- `brew install protobuf nanopb-generator` +- `easy_install --user protobuf` + +## To develop + +- Run `./GoogleDataTransport/generate_project.sh` after installing the prereqs + +## When adding new logging endpoint + +- Use commands similar to: + - `python -c "line='https://www.firebase.com'; print line[0::2]" ` + - `python -c "line='https://www.firebase.com'; print line[1::2]" ` + +## When adding internal code that shouldn't be easily usable on github + +- Consider using go/copybara-library/scrubbing#cc_scrub + +## Development + +Ensure that you have at least the following software: + + * Xcode 12.0 (or later) + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +`pod gen GoogleDataTransport.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. + +### Development for Catalyst +* `pod gen GoogleDataTransport.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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Code Formatting + +To ensure that the code is formatted consistently, run the script +[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### Running Unit Tests + +Select a scheme and press Command-u to build a component and run its unit tests. + +## 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). + +[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions +[gh-datatransport-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/datatransport/badge.svg diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorage.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorage.m new file mode 100644 index 0000000..f1d8ddc --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorage.m @@ -0,0 +1,153 @@ +/* + * 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorage.h" +#import "GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h" + +NSString *const kGULHeartbeatStorageDirectory = @"Google/FIRApp"; + +@interface GULHeartbeatDateStorage () + +/** The name of the file that stores heartbeat information. */ +@property(nonatomic, readonly) NSString *fileName; +@end + +@implementation GULHeartbeatDateStorage + +@synthesize fileURL = _fileURL; + +- (instancetype)initWithFileName:(NSString *)fileName { + if (fileName == nil) return nil; + + self = [super init]; + if (self) { + _fileName = fileName; + } + return self; +} + +/** Lazy getter for fileURL. + * @return fileURL where heartbeat information is stored. + */ +- (NSURL *)fileURL { + if (!_fileURL) { + NSURL *directoryURL = [self directoryPathURL]; + [self checkAndCreateDirectory:directoryURL]; + _fileURL = [directoryURL URLByAppendingPathComponent:_fileName]; + } + return _fileURL; +} + +/** Returns the URL path of the directory for heartbeat storage data. + * @return the URL path of the directory for heartbeat storage data. + */ +- (NSURL *)directoryPathURL { + NSArray *paths; +#if TARGET_OS_TV + paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); +#else + paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); +#endif // TARGET_OS_TV + NSString *rootPath = [paths lastObject]; + NSURL *rootURL = [NSURL fileURLWithPath:rootPath]; + NSURL *directoryURL = [rootURL URLByAppendingPathComponent:kGULHeartbeatStorageDirectory]; + return directoryURL; +} + +/** Check for the existence of the directory specified by the URL, and create it if it does not + * exist. + * @param directoryPathURL The path to the directory that needs to exist. + */ +- (void)checkAndCreateDirectory:(NSURL *)directoryPathURL { + NSError *error; + if (![directoryPathURL checkResourceIsReachableAndReturnError:&error]) { + NSError *error; + [[NSFileManager defaultManager] createDirectoryAtURL:directoryPathURL + withIntermediateDirectories:YES + attributes:nil + error:&error]; + } +} + +- (nullable NSDate *)heartbeatDateForTag:(NSString *)tag { + @synchronized(self.class) { + NSDictionary *heartbeatDictionary = [self heartbeatDictionaryWithFileURL:self.fileURL]; + NSDate *heartbeatDate = heartbeatDictionary[tag]; + + // Validate the value type. If the storage file was corrupted or updated with a different format + // by a newer SDK version the value type may be different. + if (![heartbeatDate isKindOfClass:[NSDate class]]) { + heartbeatDate = nil; + } + + return heartbeatDate; + } +} + +- (BOOL)setHearbeatDate:(NSDate *)date forTag:(NSString *)tag { + // Synchronize on the class to ensure that the different instances of the class will not access + // the same file concurrently. + // TODO: Consider a different synchronization strategy here and in `-heartbeatDateForTag:` method. + // Currently no heartbeats can be read/written concurrently even if they are in different files. + @synchronized(self.class) { + NSMutableDictionary *heartbeatDictionary = + [[self heartbeatDictionaryWithFileURL:self.fileURL] mutableCopy]; + heartbeatDictionary[tag] = date; + NSError *error; + BOOL isSuccess = [self writeDictionary:[heartbeatDictionary copy] + forWritingURL:self.fileURL + error:&error]; + return isSuccess; + } +} + +- (NSDictionary *)heartbeatDictionaryWithFileURL:(NSURL *)readingFileURL { + NSDictionary *heartbeatDictionary; + + NSError *error; + NSData *objectData = [NSData dataWithContentsOfURL:readingFileURL options:0 error:&error]; + + if (objectData.length > 0 && error == nil) { + NSSet *objectClasses = + [NSSet setWithArray:@[ NSDictionary.class, NSDate.class, NSString.class ]]; + heartbeatDictionary = [GULSecureCoding unarchivedObjectOfClasses:objectClasses + fromData:objectData + error:&error]; + } + + if (heartbeatDictionary.count == 0 || error != nil) { + heartbeatDictionary = [NSDictionary dictionary]; + } + + return heartbeatDictionary; +} + +- (BOOL)writeDictionary:(NSDictionary *)dictionary + forWritingURL:(NSURL *)writingFileURL + error:(NSError **)outError { + // Archive a mutable copy `dictionary` for writing to disk. This is done for + // backwards compatibility. See Google Utilities issue #36 for more context. + // TODO: Remove usage of mutable copy in a future version of Google Utilities. + NSData *data = [GULSecureCoding archivedDataWithRootObject:[dictionary mutableCopy] + error:outError]; + if (data.length == 0) { + return NO; + } + + return [data writeToURL:writingFileURL atomically:YES]; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorageUserDefaults.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorageUserDefaults.m new file mode 100644 index 0000000..f8f1159 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULHeartbeatDateStorageUserDefaults.m @@ -0,0 +1,68 @@ +/* + * Copyright 2021 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorageUserDefaults.h" + +@interface GULHeartbeatDateStorageUserDefaults () + +/** The storage to store the date of the last sent heartbeat. */ +@property(nonatomic, readonly) NSUserDefaults *userDefaults; + +/** The key for user defaults to store heartbeat information. */ +@property(nonatomic, readonly) NSString *key; + +@end + +@implementation GULHeartbeatDateStorageUserDefaults + +- (instancetype)initWithDefaults:(NSUserDefaults *)defaults key:(NSString *)key { + self = [super init]; + if (self) { + _userDefaults = defaults; + _key = key; + } + return self; +} + +- (NSMutableDictionary *)heartbeatDictionaryFromDefaults { + NSDictionary *heartbeatDict = [self.userDefaults objectForKey:self.key]; + if (heartbeatDict != nil) { + return [heartbeatDict mutableCopy]; + } else { + return [NSMutableDictionary dictionary]; + } +} + +- (nullable NSDate *)heartbeatDateForTag:(NSString *)tag { + NSDate *date = nil; + @synchronized(self.userDefaults) { + NSMutableDictionary *dict = [self heartbeatDictionaryFromDefaults]; + date = dict[tag]; + } + + return date; +} + +- (BOOL)setHearbeatDate:(NSDate *)date forTag:(NSString *)tag { + @synchronized(self.userDefaults) { + NSMutableDictionary *dict = [self heartbeatDictionaryFromDefaults]; + dict[tag] = date; + [self.userDefaults setObject:dict forKey:self.key]; + } + return true; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULSecureCoding.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULSecureCoding.m new file mode 100644 index 0000000..21d5c2a --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/GULSecureCoding.m @@ -0,0 +1,103 @@ +// 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h" + +NSString *const kGULSecureCodingError = @"GULSecureCodingError"; + +@implementation GULSecureCoding + ++ (nullable id)unarchivedObjectOfClasses:(NSSet *)classes + fromData:(NSData *)data + error:(NSError **)outError { + id object; +#if __has_builtin(__builtin_available) + if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)) { + object = [NSKeyedUnarchiver unarchivedObjectOfClasses:classes fromData:data error:outError]; + } else +#endif // __has_builtin(__builtin_available) + { + @try { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; +#pragma clang diagnostic pop + unarchiver.requiresSecureCoding = YES; + + object = [unarchiver decodeObjectOfClasses:classes forKey:NSKeyedArchiveRootObjectKey]; + } @catch (NSException *exception) { + if (outError) { + *outError = [self archivingErrorWithException:exception]; + } + } + + if (object == nil && outError && *outError == nil) { + NSString *failureReason = @"NSKeyedUnarchiver failed to unarchive data."; + *outError = [NSError errorWithDomain:kGULSecureCodingError + code:-1 + userInfo:@{NSLocalizedFailureReasonErrorKey : failureReason}]; + } + } + + return object; +} + ++ (nullable id)unarchivedObjectOfClass:(Class)class + fromData:(NSData *)data + error:(NSError **)outError { + return [self unarchivedObjectOfClasses:[NSSet setWithObject:class] fromData:data error:outError]; +} + ++ (nullable NSData *)archivedDataWithRootObject:(id)object error:(NSError **)outError { + NSData *archiveData; +#if __has_builtin(__builtin_available) + if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)) { + archiveData = [NSKeyedArchiver archivedDataWithRootObject:object + requiringSecureCoding:YES + error:outError]; + } else +#endif // __has_builtin(__builtin_available) + { + @try { + NSMutableData *data = [NSMutableData data]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; +#pragma clang diagnostic pop + archiver.requiresSecureCoding = YES; + + [archiver encodeObject:object forKey:NSKeyedArchiveRootObjectKey]; + [archiver finishEncoding]; + + archiveData = [data copy]; + } @catch (NSException *exception) { + if (outError) { + *outError = [self archivingErrorWithException:exception]; + } + } + } + + return archiveData; +} + ++ (NSError *)archivingErrorWithException:(NSException *)exception { + NSString *failureReason = [NSString + stringWithFormat:@"NSKeyedArchiver exception with name: %@, reason: %@, userInfo: %@", + exception.name, exception.reason, exception.userInfo]; + NSDictionary *errorUserInfo = @{NSLocalizedFailureReasonErrorKey : failureReason}; + + return [NSError errorWithDomain:kGULSecureCodingError code:-1 userInfo:errorUserInfo]; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h new file mode 100644 index 0000000..72c46c2 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h @@ -0,0 +1,60 @@ +/* + * 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 + +@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. ++ (nullable 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."); + +/// @return YES if Swift runtime detected in the app. ++ (BOOL)hasSwiftRuntime __deprecated; + +/// @return An Apple platform. Possible values "ios", "tvos", "macos", "watchos", "maccatalyst". ++ (NSString *)applePlatform; + +/// @return The way the library was added to the app, e.g. "swiftpm", "cocoapods", etc. ++ (NSString *)deploymentType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorable.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorable.h new file mode 100644 index 0000000..43d3740 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorable.h @@ -0,0 +1,40 @@ +/* + * Copyright 2021 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 + +NS_ASSUME_NONNULL_BEGIN + +/** + * Describes an object that can store and fetch heartbeat dates for given tags. + */ +@protocol GULHeartbeatDateStorable + +/** + * 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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorage.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorage.h new file mode 100644 index 0000000..245b1a2 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorage.h @@ -0,0 +1,54 @@ +/* + * 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 "GULHeartbeatDateStorable.h" + +NS_ASSUME_NONNULL_BEGIN + +/// The name of the directory where the heartbeat data is stored. +extern NSString *const kGULHeartbeatStorageDirectory; + +/// 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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorageUserDefaults.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorageUserDefaults.h new file mode 100644 index 0000000..e6c7dda --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorageUserDefaults.h @@ -0,0 +1,51 @@ +/* + * Copyright 2021 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 "GULHeartbeatDateStorable.h" + +NS_ASSUME_NONNULL_BEGIN + +/// Stores either a date or a dictionary to a specified file. +@interface GULHeartbeatDateStorageUserDefaults : NSObject + +/** + * Default initializer. tvOS can only write to the cache directory and + * there are no guarantees that the directory will persist. User defaults will + * be retained, so that should be used instead. + * @param defaults User defaults instance to store the heartbeat information. + * @param key The key to be used with the user defaults instance. + */ +- (instancetype)initWithDefaults:(NSUserDefaults *)defaults key:(NSString *)key; + +- (instancetype)init NS_UNAVAILABLE; + +/** + * 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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainStorage.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainStorage.h new file mode 100644 index 0000000..dc01a83 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainUtils.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainUtils.h new file mode 100644 index 0000000..de4bef2 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h new file mode 100644 index 0000000..8484b39 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h new file mode 100644 index 0000000..e88eb67 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h @@ -0,0 +1,31 @@ +/* + * 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 + +NS_ASSUME_NONNULL_BEGIN + +/** The class represents HTTP response received from `NSURLSession`. */ +@interface GULURLSessionDataResponse : NSObject + +@property(nonatomic, readonly) NSHTTPURLResponse *HTTPResponse; +@property(nonatomic, nullable, readonly) NSData *HTTPBody; + +- (instancetype)initWithResponse:(NSHTTPURLResponse *)response HTTPBody:(nullable NSData *)body; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/NSURLSession+GULPromises.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/NSURLSession+GULPromises.h new file mode 100644 index 0000000..7bed005 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/NSURLSession+GULPromises.h @@ -0,0 +1,37 @@ +/* + * 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 + +@class FBLPromise; +@class GULURLSessionDataResponse; + +NS_ASSUME_NONNULL_BEGIN + +/** Promise based API for `NSURLSession`. */ +@interface NSURLSession (GULPromises) + +/** Creates a promise wrapping `-[NSURLSession dataTaskWithRequest:completionHandler:]` method. + * @param URLRequest The request to create a data task with. + * @return A promise that is fulfilled when an HTTP response is received (with any response code), + * or is rejected with the error passed to the task completion. + */ +- (FBLPromise *)gul_dataTaskPromiseWithRequest: + (NSURLRequest *)URLRequest; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m new file mode 100644 index 0000000..3b4a2d9 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m @@ -0,0 +1,192 @@ +/* + * 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainStorage.h" +#import + +#if __has_include() +#import +#else +#import "FBLPromises.h" +#endif + +#import "GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainUtils.h" +#import "GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h" + +@interface GULKeychainStorage () +@property(nonatomic, readonly) dispatch_queue_t keychainQueue; +@property(nonatomic, readonly) dispatch_queue_t inMemoryCacheQueue; +@property(nonatomic, readonly) NSString *service; +@property(nonatomic, readonly) NSCache> *inMemoryCache; +@end + +@implementation GULKeychainStorage + +- (instancetype)initWithService:(NSString *)service { + NSCache *cache = [[NSCache alloc] init]; + // Cache up to 5 installations. + cache.countLimit = 5; + return [self initWithService:service cache:cache]; +} + +- (instancetype)initWithService:(NSString *)service cache:(NSCache *)cache { + self = [super init]; + if (self) { + _keychainQueue = + dispatch_queue_create("com.gul.KeychainStorage.Keychain", DISPATCH_QUEUE_SERIAL); + _inMemoryCacheQueue = + dispatch_queue_create("com.gul.KeychainStorage.InMemoryCache", DISPATCH_QUEUE_SERIAL); + _service = [service copy]; + _inMemoryCache = cache; + } + return self; +} + +#pragma mark - Public + +- (FBLPromise> *)getObjectForKey:(NSString *)key + objectClass:(Class)objectClass + accessGroup:(nullable NSString *)accessGroup { + return [FBLPromise onQueue:self.inMemoryCacheQueue + do:^id _Nullable { + // Return cached object or fail otherwise. + id object = [self.inMemoryCache objectForKey:key]; + return object + ?: [[NSError alloc] + initWithDomain:FBLPromiseErrorDomain + code:FBLPromiseErrorCodeValidationFailure + userInfo:nil]; + }] + .recover(^id _Nullable(NSError *error) { + // Look for the object in the keychain. + return [self getObjectFromKeychainForKey:key + objectClass:objectClass + accessGroup:accessGroup]; + }); +} + +- (FBLPromise *)setObject:(id)object + forKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup { + return [FBLPromise onQueue:self.inMemoryCacheQueue + do:^id _Nullable { + // Save to the in-memory cache first. + [self.inMemoryCache setObject:object forKey:[key copy]]; + return [NSNull null]; + }] + .thenOn(self.keychainQueue, ^id(id result) { + // Then store the object to the keychain. + NSDictionary *query = [self keychainQueryWithKey:key accessGroup:accessGroup]; + NSError *error; + NSData *encodedObject = [GULSecureCoding archivedDataWithRootObject:object error:&error]; + if (!encodedObject) { + return error; + } + + if (![GULKeychainUtils setItem:encodedObject withQuery:query error:&error]) { + return error; + } + + return [NSNull null]; + }); +} + +- (FBLPromise *)removeObjectForKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup { + return [FBLPromise onQueue:self.inMemoryCacheQueue + do:^id _Nullable { + [self.inMemoryCache removeObjectForKey:key]; + return nil; + }] + .thenOn(self.keychainQueue, ^id(id result) { + NSDictionary *query = [self keychainQueryWithKey:key accessGroup:accessGroup]; + + NSError *error; + if (![GULKeychainUtils removeItemWithQuery:query error:&error]) { + return error; + } + + return [NSNull null]; + }); +} + +#pragma mark - Private + +- (FBLPromise> *)getObjectFromKeychainForKey:(NSString *)key + objectClass:(Class)objectClass + accessGroup:(nullable NSString *)accessGroup { + // Look for the object in the keychain. + return [FBLPromise + onQueue:self.keychainQueue + do:^id { + NSDictionary *query = [self keychainQueryWithKey:key accessGroup:accessGroup]; + NSError *error; + NSData *encodedObject = [GULKeychainUtils getItemWithQuery:query error:&error]; + + if (error) { + return error; + } + if (!encodedObject) { + return nil; + } + id object = [GULSecureCoding unarchivedObjectOfClass:objectClass + fromData:encodedObject + error:&error]; + if (error) { + return error; + } + + return object; + }] + .thenOn(self.inMemoryCacheQueue, + ^id _Nullable(id _Nullable object) { + // Save object to the in-memory cache if exists and return the object. + if (object) { + [self.inMemoryCache setObject:object forKey:[key copy]]; + } + return object; + }); +} + +- (void)resetInMemoryCache { + [self.inMemoryCache removeAllObjects]; +} + +#pragma mark - Keychain + +- (NSMutableDictionary *)keychainQueryWithKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup { + NSMutableDictionary *query = [NSMutableDictionary dictionary]; + + query[(__bridge NSString *)kSecClass] = (__bridge NSString *)kSecClassGenericPassword; + query[(__bridge NSString *)kSecAttrService] = self.service; + query[(__bridge NSString *)kSecAttrAccount] = key; + + if (accessGroup) { + query[(__bridge NSString *)kSecAttrAccessGroup] = accessGroup; + } + +#if TARGET_OS_OSX + if (self.keychainRef) { + query[(__bridge NSString *)kSecUseKeychain] = (__bridge id)(self.keychainRef); + query[(__bridge NSString *)kSecMatchSearchList] = @[ (__bridge id)(self.keychainRef) ]; + } +#endif // TARGET_OSX + + return query; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainUtils.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainUtils.m new file mode 100644 index 0000000..687e6a7 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/SecureStorage/GULKeychainUtils.m @@ -0,0 +1,113 @@ +/* + * 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainUtils.h" + +NSString *const kGULKeychainUtilsErrorDomain = @"com.gul.keychain.ErrorDomain"; + +@implementation GULKeychainUtils + ++ (nullable NSData *)getItemWithQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError { + NSMutableDictionary *mutableQuery = [query mutableCopy]; + + mutableQuery[(__bridge id)kSecReturnData] = @YES; + mutableQuery[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne; + + CFDataRef result = NULL; + OSStatus status = + SecItemCopyMatching((__bridge CFDictionaryRef)mutableQuery, (CFTypeRef *)&result); + + if (status == errSecSuccess && result != NULL) { + if (outError) { + *outError = nil; + } + + return (__bridge_transfer NSData *)result; + } + + if (status == errSecItemNotFound) { + if (outError) { + *outError = nil; + } + } else { + if (outError) { + *outError = [self keychainErrorWithFunction:@"SecItemCopyMatching" status:status]; + } + } + return nil; +} + ++ (BOOL)setItem:(NSData *)item + withQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError { + NSData *existingItem = [self getItemWithQuery:query error:outError]; + if (outError && *outError) { + return NO; + } + + NSMutableDictionary *mutableQuery = [query mutableCopy]; + mutableQuery[(__bridge id)kSecAttrAccessible] = + (__bridge id)kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly; + + OSStatus status; + if (!existingItem) { + mutableQuery[(__bridge id)kSecValueData] = item; + status = SecItemAdd((__bridge CFDictionaryRef)mutableQuery, NULL); + } else { + NSDictionary *attributes = @{(__bridge id)kSecValueData : item}; + status = SecItemUpdate((__bridge CFDictionaryRef)query, (__bridge CFDictionaryRef)attributes); + } + + if (status == noErr) { + if (outError) { + *outError = nil; + } + return YES; + } + + NSString *function = existingItem ? @"SecItemUpdate" : @"SecItemAdd"; + if (outError) { + *outError = [self keychainErrorWithFunction:function status:status]; + } + return NO; +} + ++ (BOOL)removeItemWithQuery:(NSDictionary *)query error:(NSError *_Nullable *_Nullable)outError { + OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query); + + if (status == noErr || status == errSecItemNotFound) { + if (outError) { + *outError = nil; + } + return YES; + } + + if (outError) { + *outError = [self keychainErrorWithFunction:@"SecItemDelete" status:status]; + } + return NO; +} + +#pragma mark - Errors + ++ (NSError *)keychainErrorWithFunction:(NSString *)keychainFunction status:(OSStatus)status { + NSString *failureReason = [NSString stringWithFormat:@"%@ (%li)", keychainFunction, (long)status]; + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey : failureReason}; + return [NSError errorWithDomain:kGULKeychainUtilsErrorDomain code:0 userInfo:userInfo]; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/GULURLSessionDataResponse.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/GULURLSessionDataResponse.m new file mode 100644 index 0000000..559875a --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/GULURLSessionDataResponse.m @@ -0,0 +1,30 @@ +/* + * 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h" + +@implementation GULURLSessionDataResponse + +- (instancetype)initWithResponse:(NSHTTPURLResponse *)response HTTPBody:(NSData *)body { + self = [super init]; + if (self) { + _HTTPResponse = response; + _HTTPBody = body; + } + return self; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/NSURLSession+GULPromises.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/NSURLSession+GULPromises.m new file mode 100644 index 0000000..6c70310 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/URLSessionPromiseWrapper/NSURLSession+GULPromises.m @@ -0,0 +1,46 @@ +/* + * 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 "GoogleUtilities/Environment/Public/GoogleUtilities/NSURLSession+GULPromises.h" + +#if __has_include() +#import +#else +#import "FBLPromises.h" +#endif + +#import "GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h" + +@implementation NSURLSession (GULPromises) + +- (FBLPromise *)gul_dataTaskPromiseWithRequest: + (NSURLRequest *)URLRequest { + return [FBLPromise async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + [[self dataTaskWithRequest:URLRequest + completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, + NSError *_Nullable error) { + if (error) { + reject(error); + } else { + fulfill([[GULURLSessionDataResponse alloc] + initWithResponse:(NSHTTPURLResponse *)response + HTTPBody:data]); + } + }] resume]; + }]; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m new file mode 100644 index 0000000..0dca899 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m @@ -0,0 +1,333 @@ +// 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 "GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h" + +#import +#import +#import +#import +#import +#import + +#if TARGET_OS_IOS +#import +#endif + +/// The encryption info struct and constants are missing from the iPhoneSimulator SDK, but not from +/// the iPhoneOS or Mac OS X SDKs. Since one doesn't ever ship a Simulator binary, we'll just +/// provide the definitions here. +#if TARGET_OS_SIMULATOR && !defined(LC_ENCRYPTION_INFO) +#define LC_ENCRYPTION_INFO 0x21 +struct encryption_info_command { + uint32_t cmd; + uint32_t cmdsize; + uint32_t cryptoff; + uint32_t cryptsize; + uint32_t cryptid; +}; +#endif + +@implementation GULAppEnvironmentUtil + +/// A key for the Info.plist to enable or disable checking if the App Store is running in a sandbox. +/// This will affect your data integrity when using Firebase Analytics, as it will disable some +/// necessary checks. +static NSString *const kFIRAppStoreReceiptURLCheckEnabledKey = + @"FirebaseAppStoreReceiptURLCheckEnabled"; + +/// The file name of the sandbox receipt. This is available on iOS >= 8.0 +static NSString *const kFIRAIdentitySandboxReceiptFileName = @"sandboxReceipt"; + +/// The following copyright from Landon J. Fuller applies to the isAppEncrypted function. +/// +/// Copyright (c) 2017 Landon J. Fuller +/// All rights reserved. +/// +/// 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. +/// +/// Comment from iPhone Dev Wiki +/// Crack Prevention: +/// App Store binaries are signed by both their developer and Apple. This encrypts the binary so +/// that decryption keys are needed in order to make the binary readable. When iOS executes the +/// binary, the decryption keys are used to decrypt the binary into a readable state where it is +/// then loaded into memory and executed. iOS can tell the encryption status of a binary via the +/// cryptid structure member of LC_ENCRYPTION_INFO MachO load command. If cryptid is a non-zero +/// value then the binary is encrypted. +/// +/// 'Cracking' works by letting the kernel decrypt the binary then siphoning the decrypted data into +/// a new binary file, resigning, and repackaging. This will only work on jailbroken devices as +/// codesignature validation has been removed. Resigning takes place because while the codesignature +/// doesn't have to be valid thanks to the jailbreak, it does have to be in place unless you have +/// AppSync or similar to disable codesignature checks. +/// +/// More information at Landon Fuller's blog +static BOOL IsAppEncrypted() { + const struct mach_header *executableHeader = NULL; + for (uint32_t i = 0; i < _dyld_image_count(); i++) { + const struct mach_header *header = _dyld_get_image_header(i); + if (header && header->filetype == MH_EXECUTE) { + executableHeader = header; + break; + } + } + + if (!executableHeader) { + return NO; + } + + BOOL is64bit = (executableHeader->magic == MH_MAGIC_64); + uintptr_t cursor = (uintptr_t)executableHeader + + (is64bit ? sizeof(struct mach_header_64) : sizeof(struct mach_header)); + const struct segment_command *segmentCommand = NULL; + uint32_t i = 0; + + while (i++ < executableHeader->ncmds) { + segmentCommand = (struct segment_command *)cursor; + + if (!segmentCommand) { + continue; + } + + if ((!is64bit && segmentCommand->cmd == LC_ENCRYPTION_INFO) || + (is64bit && segmentCommand->cmd == LC_ENCRYPTION_INFO_64)) { + if (is64bit) { + struct encryption_info_command_64 *cryptCmd = + (struct encryption_info_command_64 *)segmentCommand; + return cryptCmd && cryptCmd->cryptid != 0; + } else { + struct encryption_info_command *cryptCmd = (struct encryption_info_command *)segmentCommand; + return cryptCmd && cryptCmd->cryptid != 0; + } + } + cursor += segmentCommand->cmdsize; + } + + return NO; +} + +static BOOL HasSCInfoFolder() { +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + NSString *bundlePath = [NSBundle mainBundle].bundlePath; + NSString *scInfoPath = [bundlePath stringByAppendingPathComponent:@"SC_Info"]; + return [[NSFileManager defaultManager] fileExistsAtPath:scInfoPath]; +#elif TARGET_OS_OSX + return NO; +#endif +} + +static BOOL HasEmbeddedMobileProvision() { +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + return [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"].length > 0; +#elif TARGET_OS_OSX + return NO; +#endif +} + ++ (BOOL)isFromAppStore { + static dispatch_once_t isEncryptedOnce; + static BOOL isEncrypted = NO; + + dispatch_once(&isEncryptedOnce, ^{ + isEncrypted = IsAppEncrypted(); + }); + + if ([GULAppEnvironmentUtil isSimulator]) { + return NO; + } + + // If an app contain the sandboxReceipt file, it means its coming from TestFlight + // This must be checked before the SCInfo Folder check below since TestFlight apps may + // also have an SCInfo folder. + if ([GULAppEnvironmentUtil isAppStoreReceiptSandbox]) { + return NO; + } + + if (HasSCInfoFolder()) { + // When iTunes downloads a .ipa, it also gets a customized .sinf file which is added to the + // main SC_Info directory. + return YES; + } + + // For iOS >= 8.0, iTunesMetadata.plist is moved outside of the sandbox. Any attempt to read + // the iTunesMetadata.plist outside of the sandbox will be rejected by Apple. + // If the app does not contain the embedded.mobileprovision which is stripped out by Apple when + // the app is submitted to store, then it is highly likely that it is from Apple Store. + return isEncrypted && !HasEmbeddedMobileProvision(); +} + ++ (BOOL)isAppStoreReceiptSandbox { + // Since checking the App Store's receipt URL can be memory intensive, check the option in the + // Info.plist if developers opted out of this check. + id enableSandboxCheck = + [[NSBundle mainBundle] objectForInfoDictionaryKey:kFIRAppStoreReceiptURLCheckEnabledKey]; + if (enableSandboxCheck && [enableSandboxCheck isKindOfClass:[NSNumber class]] && + ![enableSandboxCheck boolValue]) { + return NO; + } + + NSURL *appStoreReceiptURL = [NSBundle mainBundle].appStoreReceiptURL; + NSString *appStoreReceiptFileName = appStoreReceiptURL.lastPathComponent; + return [appStoreReceiptFileName isEqualToString:kFIRAIdentitySandboxReceiptFileName]; +} + ++ (BOOL)isSimulator { +#if TARGET_OS_SIMULATOR + return YES; +#elif TARGET_OS_MACCATALYST + return NO; +#elif TARGET_OS_IOS || TARGET_OS_TV + NSString *platform = [GULAppEnvironmentUtil deviceModel]; + return [platform isEqual:@"x86_64"] || [platform isEqual:@"i386"]; +#elif TARGET_OS_OSX + return NO; +#endif + return NO; +} + ++ (NSString *)deviceModel { + static dispatch_once_t once; + static NSString *deviceModel; + +#if TARGET_OS_OSX || TARGET_OS_MACCATALYST + dispatch_once(&once, ^{ + // The `uname` function only returns x86_64 for Macs. Use `sysctlbyname` instead, but fall back + // to the `uname` function if it fails. + size_t size; + sysctlbyname("hw.model", NULL, &size, NULL, 0); + if (size > 0) { + char *machine = malloc(size); + sysctlbyname("hw.model", machine, &size, NULL, 0); + deviceModel = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding]; + free(machine); + } else { + struct utsname systemInfo; + if (uname(&systemInfo) == 0) { + deviceModel = [NSString stringWithUTF8String:systemInfo.machine]; + } + } + }); +#else + dispatch_once(&once, ^{ + struct utsname systemInfo; + if (uname(&systemInfo) == 0) { + deviceModel = [NSString stringWithUTF8String:systemInfo.machine]; + } + }); +#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST + return deviceModel; +} + ++ (NSString *)systemVersion { +#if TARGET_OS_IOS + return [UIDevice currentDevice].systemVersion; +#elif TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_WATCH + // Assemble the systemVersion, excluding the patch version if it's 0. + NSOperatingSystemVersion osVersion = [NSProcessInfo processInfo].operatingSystemVersion; + NSMutableString *versionString = [[NSMutableString alloc] + initWithFormat:@"%ld.%ld", (long)osVersion.majorVersion, (long)osVersion.minorVersion]; + if (osVersion.patchVersion != 0) { + [versionString appendFormat:@".%ld", (long)osVersion.patchVersion]; + } + return versionString; +#endif +} + ++ (BOOL)isAppExtension { +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + // Documented by Apple + BOOL appExtension = [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]; + return appExtension; +#elif TARGET_OS_OSX + return NO; +#endif +} + ++ (BOOL)isIOS7OrHigher { + return YES; +} + ++ (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 +#if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 + if (@available(iOS 14.0, *)) { + // Early iOS 14 betas do not include isiOSAppOnMac (#6969) + applePlatform = ([[NSProcessInfo processInfo] respondsToSelector:@selector(isiOSAppOnMac)] && + [NSProcessInfo processInfo].isiOSAppOnMac) ? @"ios_on_mac" : @"ios"; + } else { + applePlatform = @"ios"; + } +#else // defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 + applePlatform = @"ios"; +#endif // defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 + +#elif TARGET_OS_TV + applePlatform = @"tvos"; +#elif TARGET_OS_OSX + applePlatform = @"macos"; +#elif TARGET_OS_WATCH + applePlatform = @"watchos"; +#endif // TARGET_OS_MACCATALYST + + return applePlatform; +} + ++ (NSString *)deploymentType { +#if SWIFT_PACKAGE + NSString *deploymentType = @"swiftpm"; +#elif FIREBASE_BUILD_CARTHAGE + NSString *deploymentType = @"carthage"; +#elif FIREBASE_BUILD_ZIP_FILE + NSString *deploymentType = @"zip"; +#else + NSString *deploymentType = @"cocoapods"; +#endif + + return deploymentType; +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/GULLogger.m b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/GULLogger.m new file mode 100644 index 0000000..c5f6f1d --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/GULLogger.m @@ -0,0 +1,215 @@ +// 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 "GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h" + +#include + +#import "GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h" +#import "GoogleUtilities/Logger/Public/GoogleUtilities/GULLoggerLevel.h" + +/// ASL client facility name used by GULLogger. +const char *kGULLoggerASLClientFacilityName = "com.google.utilities.logger"; + +static dispatch_once_t sGULLoggerOnceToken; + +static aslclient sGULLoggerClient; + +static dispatch_queue_t sGULClientQueue; + +static BOOL sGULLoggerDebugMode; + +static GULLoggerLevel sGULLoggerMaximumLevel; + +// Allow clients to register a version to include in the log. +static NSString *sVersion = @""; + +static GULLoggerService kGULLoggerLogger = @"[GULLogger]"; + +#ifdef DEBUG +/// The regex pattern for the message code. +static NSString *const kMessageCodePattern = @"^I-[A-Z]{3}[0-9]{6}$"; +static NSRegularExpression *sMessageCodeRegex; +#endif + +void GULLoggerInitializeASL(void) { + dispatch_once(&sGULLoggerOnceToken, ^{ + NSInteger majorOSVersion = [[GULAppEnvironmentUtil systemVersion] integerValue]; + uint32_t aslOptions = ASL_OPT_STDERR; +#if TARGET_OS_SIMULATOR + // The iOS 11 simulator doesn't need the ASL_OPT_STDERR flag. + if (majorOSVersion >= 11) { + aslOptions = 0; + } +#else + // Devices running iOS 10 or higher don't need the ASL_OPT_STDERR flag. + if (majorOSVersion >= 10) { + aslOptions = 0; + } +#endif // TARGET_OS_SIMULATOR + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // asl is deprecated + // Initialize the ASL client handle. + sGULLoggerClient = asl_open(NULL, kGULLoggerASLClientFacilityName, aslOptions); + sGULLoggerMaximumLevel = GULLoggerLevelNotice; + + // Set the filter used by system/device log. Initialize in default mode. + asl_set_filter(sGULLoggerClient, ASL_FILTER_MASK_UPTO(ASL_LEVEL_NOTICE)); + + sGULClientQueue = dispatch_queue_create("GULLoggingClientQueue", DISPATCH_QUEUE_SERIAL); + dispatch_set_target_queue(sGULClientQueue, + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)); +#ifdef DEBUG + sMessageCodeRegex = [NSRegularExpression regularExpressionWithPattern:kMessageCodePattern + options:0 + error:NULL]; +#endif + }); +} + +void GULLoggerEnableSTDERR(void) { + asl_add_log_file(sGULLoggerClient, STDERR_FILENO); +} + +void GULLoggerForceDebug(void) { + // We should enable debug mode if we're not running from App Store. + if (![GULAppEnvironmentUtil isFromAppStore]) { + sGULLoggerDebugMode = YES; + GULSetLoggerLevel(GULLoggerLevelDebug); + } +} + +__attribute__((no_sanitize("thread"))) void GULSetLoggerLevel(GULLoggerLevel loggerLevel) { + if (loggerLevel < GULLoggerLevelMin || loggerLevel > GULLoggerLevelMax) { + GULLogError(kGULLoggerLogger, NO, @"I-COR000023", @"Invalid logger level, %ld", + (long)loggerLevel); + return; + } + GULLoggerInitializeASL(); + // We should not raise the logger level if we are running from App Store. + if (loggerLevel >= GULLoggerLevelNotice && [GULAppEnvironmentUtil isFromAppStore]) { + return; + } + + sGULLoggerMaximumLevel = loggerLevel; + dispatch_async(sGULClientQueue, ^{ + asl_set_filter(sGULLoggerClient, ASL_FILTER_MASK_UPTO(loggerLevel)); + }); +} + +/** + * Check if the level is high enough to be loggable. + */ +__attribute__((no_sanitize("thread"))) BOOL GULIsLoggableLevel(GULLoggerLevel loggerLevel) { + GULLoggerInitializeASL(); + if (sGULLoggerDebugMode) { + return YES; + } + return (BOOL)(loggerLevel <= sGULLoggerMaximumLevel); +} + +#ifdef DEBUG +void GULResetLogger(void) { + sGULLoggerOnceToken = 0; + sGULLoggerDebugMode = NO; +} + +aslclient getGULLoggerClient(void) { + return sGULLoggerClient; +} + +dispatch_queue_t getGULClientQueue(void) { + return sGULClientQueue; +} + +BOOL getGULLoggerDebugMode(void) { + return sGULLoggerDebugMode; +} +#endif + +void GULLoggerRegisterVersion(NSString *version) { + sVersion = version; +} + +void GULLogBasic(GULLoggerLevel level, + GULLoggerService service, + BOOL forceLog, + NSString *messageCode, + NSString *message, + va_list args_ptr) { + GULLoggerInitializeASL(); + if (!(level <= sGULLoggerMaximumLevel || sGULLoggerDebugMode || forceLog)) { + return; + } + +#ifdef DEBUG + NSCAssert(messageCode.length == 11, @"Incorrect message code length."); + NSRange messageCodeRange = NSMakeRange(0, messageCode.length); + NSUInteger numberOfMatches = [sMessageCodeRegex numberOfMatchesInString:messageCode + options:0 + range:messageCodeRange]; + NSCAssert(numberOfMatches == 1, @"Incorrect message code format."); +#endif + NSString *logMsg; + if (args_ptr == NULL) { + logMsg = message; + } else { + logMsg = [[NSString alloc] initWithFormat:message arguments:args_ptr]; + } + logMsg = [NSString stringWithFormat:@"%@ - %@[%@] %@", sVersion, service, messageCode, logMsg]; + dispatch_async(sGULClientQueue, ^{ + asl_log(sGULLoggerClient, NULL, (int)level, "%s", logMsg.UTF8String); + }); +} +#pragma clang diagnostic pop + +/** + * Generates the logging functions using macros. + * + * Calling GULLogError({service}, @"I-XYZ000001", @"Configure %@ failed.", @"blah") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [{service}][I-XYZ000001] Configure blah failed. + * Calling GULLogDebug({service}, @"I-XYZ000001", @"Configure succeed.") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [{service}][I-XYZ000001] Configure succeed. + */ +#define GUL_LOGGING_FUNCTION(level) \ + void GULLog##level(GULLoggerService service, BOOL force, NSString *messageCode, \ + NSString *message, ...) { \ + va_list args_ptr; \ + va_start(args_ptr, message); \ + GULLogBasic(GULLoggerLevel##level, service, force, messageCode, message, args_ptr); \ + va_end(args_ptr); \ + } + +GUL_LOGGING_FUNCTION(Error) +GUL_LOGGING_FUNCTION(Warning) +GUL_LOGGING_FUNCTION(Notice) +GUL_LOGGING_FUNCTION(Info) +GUL_LOGGING_FUNCTION(Debug) + +#undef GUL_MAKE_LOGGER + +#pragma mark - GULLoggerWrapper + +@implementation GULLoggerWrapper + ++ (void)logWithLevel:(GULLoggerLevel)level + withService:(GULLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args { + GULLogBasic(level, service, NO, messageCode, message, args); +} + +@end diff --git a/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h new file mode 100644 index 0000000..6797399 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h @@ -0,0 +1,159 @@ +/* + * 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 "GULLoggerLevel.h" + +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(NSString *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/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLoggerLevel.h b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLoggerLevel.h new file mode 100644 index 0000000..f0ee435 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/GoogleUtilities/Logger/Public/GoogleUtilities/GULLoggerLevel.h @@ -0,0 +1,37 @@ +/* + * 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 log levels used by internal logging. + */ +typedef NS_ENUM(NSInteger, GULLoggerLevel) { + /** Error level, matches ASL_LEVEL_ERR. */ + GULLoggerLevelError = 3, + /** Warning level, matches ASL_LEVEL_WARNING. */ + GULLoggerLevelWarning = 4, + /** Notice level, matches ASL_LEVEL_NOTICE. */ + GULLoggerLevelNotice = 5, + /** Info level, matches ASL_LEVEL_INFO. */ + GULLoggerLevelInfo = 6, + /** Debug level, matches ASL_LEVEL_DEBUG. */ + GULLoggerLevelDebug = 7, + /** Minimum log level. */ + GULLoggerLevelMin = GULLoggerLevelError, + /** Maximum log level. */ + GULLoggerLevelMax = GULLoggerLevelDebug +} NS_SWIFT_NAME(GoogleLoggerLevel); diff --git a/SaraAttended/Pods/GoogleUtilities/LICENSE b/SaraAttended/Pods/GoogleUtilities/LICENSE new file mode 100644 index 0000000..30a8f72 --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/LICENSE @@ -0,0 +1,247 @@ + + 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. + +================================================================================ + +The following copyright from Landon J. Fuller applies to the isAppEncrypted +function in Environment/third_party/GULAppEnvironmentUtil.m. + +Copyright (c) 2017 Landon J. Fuller +All rights reserved. + +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. + +Comment from +iPhone Dev Wiki +Crack Prevention: App Store binaries are signed by both their developer +and Apple. This encrypts the binary so that decryption keys are needed in order +to make the binary readable. When iOS executes the binary, the decryption keys +are used to decrypt the binary into a readable state where it is then loaded +into memory and executed. iOS can tell the encryption status of a binary via the +cryptid structure member of LC_ENCRYPTION_INFO MachO load command. If cryptid is +a non-zero value then the binary is encrypted. + +'Cracking' works by letting the kernel decrypt the binary then siphoning the +decrypted data into a new binary file, resigning, and repackaging. This will +only work on jailbroken devices as codesignature validation has been removed. +Resigning takes place because while the codesignature doesn't have to be valid +thanks to the jailbreak, it does have to be in place unless you have AppSync or +similar to disable codesignature checks. + +More information at Landon +Fuller's blog diff --git a/SaraAttended/Pods/GoogleUtilities/README.md b/SaraAttended/Pods/GoogleUtilities/README.md new file mode 100644 index 0000000..ff9fe1a --- /dev/null +++ b/SaraAttended/Pods/GoogleUtilities/README.md @@ -0,0 +1,189 @@ +[![Version](https://img.shields.io/cocoapods/v/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities) +[![License](https://img.shields.io/cocoapods/l/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities) +[![Platform](https://img.shields.io/cocoapods/p/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities) + +[![Actions Status][gh-google-utilities-badge]][gh-actions] + +# GoogleUtilities + +GoogleUtilities provides a set of utilities for Firebase and other Google SDKs for Apple platform +development. + +The utilities are not directly supported for non-Google library usage. + +## Integration Testing +These instructions apply to minor and patch version updates. Major versions need +a customized adaptation. + +After the CI is green: +* Determine the next version for release by checking the + [tagged releases](https://github.com/google/GoogleUtilities/tags). + Ensure that the next release version keeps the Swift PM and CocoaPods versions in sync. +* Verify that the releasing version is the latest entry in the [CHANGELOG.md](CHANGELOG.md), + updating it if necessary. +* Update the version in the podspec to match the latest entry in the [CHANGELOG.md](CHANGELOG.md) +* Checkout the `main` branch and ensure it is up to date + ```console + git checkout main + git pull + ``` +* Add the CocoaPods tag (`{version}` will be the latest version in the [podspec](GoogleUtilities.podspec#L3)) + ```console + git tag CocoaPods-{version} + git push origin CocoaPods-{version} + ``` +* Push the podspec to the designated repo + * If this version of GoogleUtilities is intended to launch **before or with** the next Firebase release: +
+ Push to SpecsStaging + + ```console + pod repo push --skip-tests staging GoogleUtilities.podspec + ``` + + If the command fails with `Unable to find the 'staging' repo.`, add the staging repo with: + ```console + pod repo add staging git@github.com:firebase/SpecsStaging.git + ``` +
+ * Otherwise: +
+ Push to SpecsDev + + ```console + pod repo push --skip-tests dev GoogleUtilities.podspec + ``` + + If the command fails with `Unable to find the 'dev' repo.`, add the dev repo with: + ```console + pod repo add dev git@github.com:firebase/SpecsDev.git + ``` +
+* Run Firebase CI by waiting until next nightly or adding a PR that touches `Gemfile`. +* On google3, run copybara using the command below. Then, start a global TAP on the generated CL. Deflake as needed. + ```console + third_party/firebase/ios/Releases/run_copy_bara.py --directory GoogleUtilities --branch main + ``` + +## Publishing +The release process is as follows: +1. [Tag and release for Swift PM](#swift-package-manager) +2. [Publish to CocoaPods](#cocoapods) +3. [Create GitHub Release](#create-github-release) +4. [Perform post release cleanup](#post-release-cleanup) + +### Swift Package Manager + By creating and [pushing a tag](https://github.com/google/GoogleUtilities/tags) + for Swift PM, the newly tagged version will be immediately released for public use. + Given this, please verify the intended time of release for Swift PM. + * Add a version tag for Swift PM + ```console + git tag {version} + git push origin {version} + ``` + *Note: Ensure that any inflight PRs that depend on the new `GoogleUtilities` version are updated to point to the + newly tagged version rather than a checksum.* + +### CocoaPods +* Publish the newly versioned pod to CocoaPods + + It's recommended to point to the `GoogleUtilities.podspec` in `staging` to make sure the correct spec is being published. + ```console + pod trunk push ~/.cocoapods/repos/staging/GoogleUtilities/{version}/GoogleUtilities.podspec + ``` + *Note: In some cases, it may be acceptable to `pod trunk push` with the `--skip-tests` flag. Please double check with + the maintainers before doing so.* + + The pod push was successful if the above command logs: `πŸš€ GoogleUtilities ({version}) successfully published`. + In addition, a new commit that publishes the new version (co-authored by [CocoaPodsAtGoogle](https://github.com/CocoaPodsAtGoogle)) + should appear in the [CocoaPods specs repo](https://github.com/CocoaPods/Specs). Last, the latest version should be displayed + on [GoogleUtilities's CocoaPods page](https://cocoapods.org/pods/GoogleUtilities). + +### [Create GitHub Release](https://github.com/google/GoogleUtilities/releases/new/) + Update the [release template](https://github.com/google/GoogleUtilities/releases/new/)'s **Tag version** and **Release title** + fields with the latest version. In addition, reference the [Release Notes](./CHANGELOG.md) in the release's description. + + See [this release](https://github.com/google/GoogleUtilities/releases/edit/9.0.1) for an example. + + *Don't forget to perform the [post release cleanup](#post-release-cleanup)!* + +### Post Release Cleanup +
+ Clean up SpecsStaging + + ```console + pwd=$(pwd) + mkdir -p /tmp/release-cleanup && cd $_ + git clone git@github.com:firebase/SpecsStaging.git + cd SpecsStaging/ + git rm -rf GoogleUtilities/ + git commit -m "Post publish cleanup" + git push origin master + rm -rf /tmp/release-cleanup + cd $pwd + ``` +
+ +## Development + +To develop in this repository, ensure that you have at least the following software: + + * Xcode 12.0 (or later) + * CocoaPods 1.10.0 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) + +For the pod that you want to develop: + +`pod gen GoogleUtilities.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. + +### Development for Catalyst +* `pod gen GoogleUtilities.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 + +Alternatively disable signing in each target: +* Go to Build Settings tab +* Click `+` +* Select `Add User-Defined Setting` +* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO` + +### Code Formatting + +To ensure that the code is formatted consistently, run the script +[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) +before creating a PR. + +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: + +```console +brew install clang-format@13 +brew install mint +``` + +### Running Unit Tests + +Select a scheme and press Command-u to build a component and run its unit tests. + +## Contributing + +See [Contributing](CONTRIBUTING.md). + +## License + +The contents of this repository is licensed under the +[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). + +[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions +[gh-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg diff --git a/SaraAttended/Pods/Headers/Private/Firebase/Firebase.h b/SaraAttended/Pods/Headers/Private/Firebase/Firebase.h new file mode 120000 index 0000000..07ac6eb --- /dev/null +++ b/SaraAttended/Pods/Headers/Private/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/CoreOnly/Sources/Firebase.h \ No newline at end of file diff --git a/SaraAttended/Pods/Headers/Public/Firebase/Firebase.h b/SaraAttended/Pods/Headers/Public/Firebase/Firebase.h new file mode 120000 index 0000000..07ac6eb --- /dev/null +++ b/SaraAttended/Pods/Headers/Public/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/CoreOnly/Sources/Firebase.h \ No newline at end of file diff --git a/SaraAttended/Pods/Manifest.lock b/SaraAttended/Pods/Manifest.lock new file mode 100644 index 0000000..ac54b6a --- /dev/null +++ b/SaraAttended/Pods/Manifest.lock @@ -0,0 +1,450 @@ +PODS: + - 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/common (0.20200225.0): + - abseil/meta/type_traits + - abseil/types/optional + - abseil/container/compressed_tuple (0.20200225.0): + - abseil/utility/utility + - abseil/container/container_memory (0.20200225.0): + - abseil/memory/memory + - abseil/utility/utility + - abseil/container/fixed_array (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/container/flat_hash_map (0.20200225.0): + - abseil/algorithm/container + - abseil/container/container_memory + - abseil/container/hash_function_defaults + - abseil/container/raw_hash_map + - abseil/memory/memory + - abseil/container/hash_function_defaults (0.20200225.0): + - abseil/base/config + - abseil/hash/hash + - abseil/strings/strings + - abseil/container/hash_policy_traits (0.20200225.0): + - abseil/meta/type_traits + - abseil/container/hashtable_debug_hooks (0.20200225.0): + - abseil/base/config + - abseil/container/hashtablez_sampler (0.20200225.0): + - abseil/base/base + - abseil/base/core_headers + - abseil/base/exponential_biased + - abseil/container/have_sse + - abseil/debugging/stacktrace + - abseil/memory/memory + - abseil/synchronization/synchronization + - abseil/utility/utility + - abseil/container/have_sse (0.20200225.0) + - 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/container/layout (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/utility/utility + - abseil/container/raw_hash_map (0.20200225.0): + - abseil/base/throw_delegate + - abseil/container/container_memory + - abseil/container/raw_hash_set + - abseil/container/raw_hash_set (0.20200225.0): + - abseil/base/bits + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/common + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/hash_policy_traits + - abseil/container/hashtable_debug_hooks + - abseil/container/hashtablez_sampler + - abseil/container/have_sse + - abseil/container/layout + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/debugging/debugging_internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/errno_saver + - abseil/base/raw_logging_internal + - abseil/debugging/demangle_internal (0.20200225.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/stacktrace (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/debugging_internal + - abseil/debugging/symbolize (0.20200225.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/debugging/demangle_internal + - abseil/hash/city (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/hash/hash (0.20200225.0): + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/fixed_array + - abseil/hash/city + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/optional + - abseil/types/variant + - abseil/utility/utility + - 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/synchronization/graphcycles_internal (0.20200225.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/synchronization/kernel_timeout_internal (0.20200225.0): + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/time/time + - abseil/synchronization/synchronization (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/synchronization/graphcycles_internal + - abseil/synchronization/kernel_timeout_internal + - abseil/time/time + - 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/CoreOnly (8.9.1): + - FirebaseCore (= 8.9.1) + - Firebase/Firestore (8.9.1): + - Firebase/CoreOnly + - FirebaseFirestore (~> 8.9.1) + - FirebaseCore (8.9.1): + - FirebaseCoreDiagnostics (~> 8.0) + - GoogleUtilities/Environment (~> 7.6) + - GoogleUtilities/Logger (~> 7.6) + - FirebaseCoreDiagnostics (8.9.0): + - GoogleDataTransport (~> 9.1) + - GoogleUtilities/Environment (~> 7.6) + - GoogleUtilities/Logger (~> 7.6) + - nanopb (~> 2.30908.0) + - FirebaseFirestore (8.9.1): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/container/flat_hash_map (= 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 (~> 8.0) + - "gRPC-C++ (~> 1.28.0)" + - leveldb-library (~> 1.22) + - nanopb (~> 2.30908.0) + - GoogleDataTransport (9.1.2): + - GoogleUtilities/Environment (~> 7.2) + - nanopb (~> 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Environment (7.6.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.6.0): + - GoogleUtilities/Environment + - "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.1) + - nanopb (2.30908.0): + - nanopb/decode (= 2.30908.0) + - nanopb/encode (= 2.30908.0) + - nanopb/decode (2.30908.0) + - nanopb/encode (2.30908.0) + - PromisesObjC (2.0.0) + +DEPENDENCIES: + - Firebase/Firestore + +SPEC REPOS: + trunk: + - abseil + - BoringSSL-GRPC + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseFirestore + - GoogleDataTransport + - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - leveldb-library + - nanopb + - PromisesObjC + +SPEC CHECKSUMS: + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + Firebase: fb5114cd2bf96e2ff7bcb01d0d9a156cf5fd2f07 + FirebaseCore: c5aab092d9c4b8efea894946166b04c9d9ef0e68 + FirebaseCoreDiagnostics: 5daa63f1c1409d981a2d5007daa100b36eac6a34 + FirebaseFirestore: 15ae9648476436efed698a909e44c4737498f9b4 + GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 + GoogleUtilities: 684ee790a24f73ebb2d1d966e9711c203f2a4237 + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 + leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729 + nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 + PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 + +PODFILE CHECKSUM: 27e61aba74382c2ee0474a235d3bafc82c664173 + +COCOAPODS: 1.11.2 diff --git a/SaraAttended/Pods/Pods.xcodeproj/project.pbxproj b/SaraAttended/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7ae0af7 --- /dev/null +++ b/SaraAttended/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,19958 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXAggregateTarget section */ + 072CEA044D2EF26F03496D5996BBF59F /* Firebase */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 4E38AC5A4DE192681466F28A5390A3F9 /* Build configuration list for PBXAggregateTarget "Firebase" */; + buildPhases = ( + ); + dependencies = ( + E00610F2114A9332FE248DA1F5CFC0E3 /* PBXTargetDependency */, + D15DEB242A3E55B249CEFE96EC77A3F4 /* PBXTargetDependency */, + ); + name = Firebase; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 002FFEC0931E3433AB0AAE2DBEE9E664 /* incoming_metadata.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7682E873616B0AC5B4010500B87A703C /* incoming_metadata.h */; }; + 00319CA159BB65EBEFEA055120EE90E0 /* sensitive.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = B3ACBE8839657A7A07B6B03D2D559583 /* sensitive.upb.h */; }; + 0048DFBD10CDE65A5C2F7E6DA59A9D5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 004E15693165F076130EBA8E2713D499 /* http_connect_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 19DE7AEA92884D5BCBC9C064503A29D4 /* http_connect_handshaker.h */; }; + 0053C06AFFDA1F756B3B7EC868D9AF71 /* server_builder_option_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = A4A0AA75430E85336A2C4B36873E0CC3 /* server_builder_option_impl.h */; }; + 0056CD1A6216DCC2794A668B5BD255B4 /* global_config_env.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 974D0D539DDB59B539BC1F7F43913A90 /* global_config_env.h */; }; + 005C3236E3907162FD28FA61FBA77D01 /* check_gcp_environment.h in Headers */ = {isa = PBXBuildFile; fileRef = BF7A15CECB726366A97C598EAAD3BE36 /* check_gcp_environment.h */; }; + 006638C007F9299BC096A64DF74DB1EF /* channel_arguments_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = B7B84AD8FEB5694D1B5DC90E365C65B4 /* channel_arguments_impl.h */; }; + 00717D4D03F4B90B1598BE02190F6D32 /* local_subchannel_pool.h in Headers */ = {isa = PBXBuildFile; fileRef = AA991AE54067FB100A899C5178166E7C /* local_subchannel_pool.h */; }; + 0071C4A4DD343FD03ABF2C09090D84D8 /* tls_gcc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 53BB379AA11E9D6252032FACF7A58092 /* tls_gcc.h */; }; + 0076C19EEDBD04E1EC5253C53368FA2D /* block_annotate.h in Headers */ = {isa = PBXBuildFile; fileRef = 23E0DB0568BF85488C2420F929509F7E /* block_annotate.h */; }; + 0079925017DD502EB7133C5F1DED02FD /* pollset.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC1BE10FC1DF8BCDE29E6F5C12E10D8 /* pollset.h */; }; + 007AD0021430044B4D332188D140058F /* bad_any_cast.h in Headers */ = {isa = PBXBuildFile; fileRef = B20618FB1F2EBACA78FC2A5BE46B3903 /* bad_any_cast.h */; }; + 009C9D47C7600D4C6531DD2FAEC0E996 /* discovery.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 84D2ACEE111EDDF5B6DA799B4694EC47 /* discovery.upb.h */; }; + 00BBFCB06E79AD06120C91C88DF13B1F /* migrate.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 87111EA4F321503D9A46A671CA8D5A34 /* migrate.upb.h */; }; + 00DC961135CA10C87C82A0844CBDB4EE /* alts_handshaker_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D6A514080E058250E5A53F49CDD116CD /* alts_handshaker_client.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 00EF09974A9BA143E1D9EF8B8DCB61EA /* crc32c.cc in Sources */ = {isa = PBXBuildFile; fileRef = 56128B9E72A3BDB53287DCFF002BEAB8 /* crc32c.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 0104BA3208BB938146A1FF903A224BE3 /* grpc_service.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 32358534B4C8D3248C3E4FED34D71A64 /* grpc_service.upb.h */; }; + 0114D7D042DFE809D4D93DAF76305DF7 /* internal.h in Copy crypto/cipher_extra Private Headers */ = {isa = PBXBuildFile; fileRef = 48E9690C8ED5EAEB257DB8919A2CE8AF /* internal.h */; }; + 0117E4827C99D4E4C1B31936C7BFE515 /* t1_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = B9D06E6C24606339788D0D52F834BAD9 /* t1_enc.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 01257D37008254514A197393A3003432 /* str_split.cc in Sources */ = {isa = PBXBuildFile; fileRef = 50B4530602F8485407D82E1D91F5ECF4 /* str_split.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 0127A6378D18A139CF2226FE89DC5C61 /* alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 471A162586C7439948EB848F7A00BF39 /* alloc.h */; }; + 01406F5723A28B29EE38BA47188DA5D5 /* ctr.c in Sources */ = {isa = PBXBuildFile; fileRef = 20B273A2295F73FF06123CBA6D8ACA13 /* ctr.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 016EA262C68116ACEB59CA85B791E140 /* call_test_only.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5717E23D4A6FBC8DA13F9A13BD24E2 /* call_test_only.h */; }; + 016F16F12EECCC3F1ADDD57ED5FEDB0A /* global_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EB4885FA802E30127217CAF0C6E262 /* global_config.h */; }; + 01AB881B14F4A4737E9D60806292032F /* parser.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = 0235052BB9836B27F86FB4973F07B20E /* parser.h */; }; + 01B7A677CF994DAE0E8BAC191E823D43 /* ecdsa.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6332265BA97DCBAEEB18C2BEBD8BBEA5 /* ecdsa.h */; }; + 020C2C9B0DF4877186A3BAB7412ADC2A /* p_rsa_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 17B92FC4A0648040FE501D4BE21C2471 /* p_rsa_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 021A08ECD84D3B9A8A89124380DCEF70 /* server_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B9E5B568FC93770BE6626D4F5F58D8 /* server_context.h */; }; + 021F4156114259EB523F35F0A16535E0 /* inlined_vector.h in Headers */ = {isa = PBXBuildFile; fileRef = CCB747D28B7C26F8522289F57BE54380 /* inlined_vector.h */; }; + 022CCB1B723FEDB27E360C5FAAE4543D /* config_source.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E4A19A16AF63A3B22B7B25B6D4B1A0 /* config_source.upb.h */; }; + 023E4C8195BF1032100E04D125F07AA7 /* xds_channel.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = E5D9C9C8C7D2D1FC075A8681CD1A76DB /* xds_channel.h */; }; + 025B9AA4617F8D8CEED20EFFF0439CC2 /* server_builder_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 42930C033D30E0C95408769940E8AE36 /* server_builder_impl.h */; }; + 025F4EECD67FC6CA102539AB0C2BEF11 /* testutil.h in Headers */ = {isa = PBXBuildFile; fileRef = DF1AD777D71E91FEF582D0621D7D3DC8 /* testutil.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0263D6753E25018E5D69AF7A8033478F /* cfb.c in Sources */ = {isa = PBXBuildFile; fileRef = 75433E6919E72CC5C0D95F85797BAE15 /* cfb.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0267FB1BCD2B90F76ED6DB72B118CA99 /* census.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 420809A3D84FCAC2EBDFC5C553797560 /* census.h */; }; + 027260963D7A8B196EBD317570DD769E /* block.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E51A66F48CAC2C668DB4ED3F6F3D6C /* block.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0279343E2489D6D0F0FABC96C003458A /* filename.cc in Sources */ = {isa = PBXBuildFile; fileRef = 902A21C0CD0071EC5F41B75D53F069F8 /* filename.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 028061F72AF3F83DAD0BDF69B719D734 /* server_builder_option.h in Headers */ = {isa = PBXBuildFile; fileRef = 7990616A3432B5CE7914989D87729E16 /* server_builder_option.h */; }; + 0282CDDE6E19ECAEA6FC922837E63A9C /* socket_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = ACD33F7F16F4EBF3970806BA1F98FE2A /* socket_windows.h */; }; + 029216A968F2BE151C37D04C146413EF /* percent.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 7ECF9171AD5E45786ECEE9F91D9B2092 /* percent.upb.h */; }; + 02A29AB7D94851072852A428F59A35AC /* upb.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = D5A6297FA57E7163544C32FD8852C6B3 /* upb.h */; }; + 02BB35E01FF17699416694B32D357D3A /* snapshot_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9CB820E1CA00F35B24C381DEE2AC94E5 /* snapshot_version.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 02C657FF15E50C75BC669CBBEBCF0989 /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 690260ACFC781EF1E784DEE2C6C603D8 /* listener.upb.h */; }; + 02CA6966937D752B7CB3E3B417E171B2 /* local_view_changes.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5D4AE9D3D75CFAEEC6D9B8369BA3A607 /* local_view_changes.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 02DA58839D4390B246EE14036D8BCEBA /* string_view.h in Headers */ = {isa = PBXBuildFile; fileRef = 715BA23D34A522CB34877C5D6C7BD6FE /* string_view.h */; }; + 031F917DA80A40EF173BCE01EDD28452 /* stream_compression_gzip.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 724F27A7E8833F11B3B9181B974AC5B4 /* stream_compression_gzip.h */; }; + 03236639C028B477E86A99A16471686B /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 40684F02670C5E032C82259DBCBDC2AA /* decode.h */; }; + 0339BBE0794BBC1292B701987E853EC5 /* channel_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A93D115672055C805A34D017E6BE86 /* channel_interface.h */; }; + 033BB1E8A0F6851450858B65DF22E30F /* iterator_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EBE87EE8373E4E916498CF6821365E2 /* iterator_wrapper.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 033FCD2C2C6D381F8B2BFE09F7CEE3EE /* uri_parser.h in Copy src/core/lib/uri Private Headers */ = {isa = PBXBuildFile; fileRef = C2FD8B4BBBA1F7122B7E451C9C875BFA /* uri_parser.h */; }; + 03533917B193C4CF37EC7308C97D685F /* chacha.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B752E2CCB34395E74669198882CFD10 /* chacha.h */; }; + 035B96C76CD860C9B6CE38B60528506F /* socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 7870BBB100B3256F9BD6409588891260 /* socket.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0374725F150450B015C4CCA11F7865E2 /* thread_identity.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 4FC7512E0ACDD7CD8B912B01507B9BC8 /* thread_identity.h */; }; + 0390F72BEBDB654395F771082945D912 /* leveldb_opener.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC650679AEF2E96E892537AB49CFE2 /* leveldb_opener.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 03AA707FAD3CBCC04B11493E4C239BD4 /* load_system_roots.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 703E0DD09A5712BE17DDB6047211A662 /* load_system_roots.h */; }; + 03BC778EC40A29C94660F6759E9C23EF /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 59DB88C88B95ECB02BC87A27D8EFF9B5 /* rsa.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 03BD4D998928511496C7D0A2025933E5 /* NSURLSession+GULPromises.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E176B80E8DC80BA18C0578389844C65 /* NSURLSession+GULPromises.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 03D8D184A64762C06A22A8834E7A0CD2 /* string.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B36415639698D83C10B4C6F4BC49426 /* string.h */; }; + 03DAA35A7B8021CD6EE1E2A1B41F2078 /* asn_pack.c in Sources */ = {isa = PBXBuildFile; fileRef = AB5BB29561CE011CEAE5A3BC8BF4E97A /* asn_pack.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 03E41B74981FDE709A55052C602EB77B /* per_thread_sem.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54E070948B2D59D3403B8E604EDBDB67 /* per_thread_sem.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 03F119702AE54E5CC10BA0E7876E4FEE /* pollset.cc in Sources */ = {isa = PBXBuildFile; fileRef = F3719F350D9168310F18A53510C3F8CD /* pollset.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 03F31F82EE186AADD5DA9601E2D08404 /* encode.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 01A752FC79D38A266A296BBC11BEF111 /* encode.h */; }; + 03FEF21339309F427FEB124CFBDEE1E8 /* compression.h in Headers */ = {isa = PBXBuildFile; fileRef = AB83EE49690EDC3506C1F03D9AD4DB2D /* compression.h */; }; + 04035934FAF7AAF6AF6EED62D5F609CF /* secure_endpoint.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 192D013E4F329EC347D8368FE5F558F0 /* secure_endpoint.h */; }; + 04183BA47E40DB853760C2F1D194696E /* server_auth_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 03BA24AFB91ECE92CAD89E779604682C /* server_auth_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 041AFC7720085A077CB20C046938FCF1 /* resource_quota_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 285BD15E9DD394E1DBAC69E726BD41B5 /* resource_quota_impl.h */; }; + 041B8D3D0AFBA5D4B4DFC1E8DCDBFD5E /* percent.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F34C27792888518DD18C8F8531DE1B2 /* percent.upb.h */; }; + 0455568867B9860C2D1FE34ABEF440B2 /* upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B9039CD50BE0BEC3FB969FDF442FF2 /* upb.h */; }; + 045C9C7E321DA4050E62FC930F471AD5 /* service_type.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 146248CAC22E5FC977650DF1B68DA60E /* service_type.h */; }; + 0473602383B4530B14B34FBBEE5FE00F /* gsec.h in Headers */ = {isa = PBXBuildFile; fileRef = 1107EFDD6A3279A099DDB015C5AB4A4F /* gsec.h */; }; + 0485E88A7079897034DF10C5C44F33B2 /* client_load_reporting_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC1745DB5372F9CD973303AF0DE1ACB /* client_load_reporting_filter.h */; }; + 04A48AE6D63FD820B939D27B1EEEF832 /* obj_xref.c in Sources */ = {isa = PBXBuildFile; fileRef = 625C10D311F9BD8DE8B4E61153A7DE97 /* obj_xref.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 04D28042CF3DD12B42A728AD85ED8496 /* secure_endpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F1BC53FFD8A4A51DA3A8131D9BFA14 /* secure_endpoint.h */; }; + 04EF2C16E892E898739FCC126ECC9D77 /* stats_data.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89E3B61C1FA389415F778362F7DDFC93 /* stats_data.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 04F5B484BD379B34BD0B96B8A42DFDC8 /* server_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 313B79D932F8211615B667947E629562 /* server_context.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 04F9683988412FEAB737D6EE393ABCF6 /* altscontext.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = 5732F2A90FB96DDE7C876A7831FA6772 /* altscontext.upb.h */; }; + 04FED65107C77C46A077326DACB3F782 /* ecdh.h in Headers */ = {isa = PBXBuildFile; fileRef = C8EA44397F063036809B8B994F31CBF2 /* ecdh.h */; }; + 04FF5F9577C6022470D5EC270B5EEDAB /* debug_location.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 7C34E45B0FE3B78A67E97766592B8092 /* debug_location.h */; }; + 0502AD1FD24A2B71B0397D72E610F8E5 /* log_android.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3F85F26406486E83C289E51756255D21 /* log_android.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 050375BC1272BEDD154AAAA920BFF5E5 /* cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 143A2E98EA9EAD3D307032D159B0D048 /* cmp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 050D30F5380A45C38AB9BADD69024DC7 /* channel_trace.h in Headers */ = {isa = PBXBuildFile; fileRef = 06A9E865AA36BFC1B00F9E7E745DE6F1 /* channel_trace.h */; }; + 051288B8E60AE3757BFE6CF07413C28E /* http_client_filter.h in Copy src/core/ext/filters/http/client Private Headers */ = {isa = PBXBuildFile; fileRef = E69164375A0446840DC6CE7CC664846F /* http_client_filter.h */; }; + 051A0A98B0D5E4092A7A4F4FA2D75609 /* tls_credentials_options_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 03CC4EE82BCD879C79C01BEDD0B6BC30 /* tls_credentials_options_util.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 051AA3F3A808958C214E6213F0B39DC2 /* any.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = 98AB66D83DAD261DD4FCB3F1607434AD /* any.h */; }; + 051B51E9EAC9AA98C59BA5D5622A2290 /* FBLPromise+Async.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F6E08C93F5F2F4F59EE7B367B27393A9 /* FBLPromise+Async.h */; }; + 05378D24E30602168FFC3094E265081F /* channel_arguments.cc in Sources */ = {isa = PBXBuildFile; fileRef = D854607912E6D3CB08D767985CA1A442 /* channel_arguments.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 05465DF0D36AF6FF039AD283E1841CCB /* listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B0ADA63A8AF80A28367FA30360B70EDB /* listener.upb.h */; }; + 055587C50897AEE16D9F76D032554731 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 288DBFDA9FB3FEC039BF70EF6F28B4C1 /* sha256.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0559668AF631E901AE0E75193DF74A59 /* any.h in Headers */ = {isa = PBXBuildFile; fileRef = 98AB66D83DAD261DD4FCB3F1607434AD /* any.h */; }; + 0563641EF8CCA841500B0B340C1E21B4 /* leveldb_bundle_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 44109291B25C2A8C13E8A30930635D21 /* leveldb_bundle_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 056B31B9F51F82304C203DD31E1DC8C6 /* internal.h in Copy crypto/fipsmodule/aes Private Headers */ = {isa = PBXBuildFile; fileRef = BDCCF92BB835F08D02294A95CF06E9A5 /* internal.h */; }; + 0578323581412D46F1BE1097FC74D4FD /* grpclb_client_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF221C1FFACB0663A4F79785651851C /* grpclb_client_stats.h */; }; + 05868C92F36E71A48F4764D83C34ECD9 /* resolver_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 0D2C92CDD47A8E0BA122DF484CFE82FF /* resolver_factory.h */; }; + 0592FF179E2EB699FAE84B60740A2018 /* json_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 176700011F13BBF1CBB85CB405F3D6BC /* json_util.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 059B2DE17CF0035DA14A04E34DE87024 /* global_config_generic.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = E10BAA4C2777BE15FB6BA268E429706B /* global_config_generic.h */; }; + 05A13AEDFC1F1D236378AA94896FAB30 /* grpc_ares_ev_driver.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C2111EBE4E82E47FE26059B387FDA2 /* grpc_ares_ev_driver.h */; }; + 05CBFC3E68D074771E22958A43612CA6 /* resource_quota_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 285BD15E9DD394E1DBAC69E726BD41B5 /* resource_quota_impl.h */; }; + 05D3C7673F44D14745E635160F8A6486 /* client_callback_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = CF1A3CF6D75124BEB09C41029E3CA22C /* client_callback_impl.h */; }; + 05D44448810FC26B3DB4098C458FD497 /* digest_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = 709254F04C66D296E8D367733E1EEFF1 /* digest_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 05DDA55C46736BBC314D2BD2DCDCF400 /* conf_def.h in Copy crypto/conf Private Headers */ = {isa = PBXBuildFile; fileRef = 01A4CD2489007A624F5F90B257E700F2 /* conf_def.h */; }; + 05DE0E092ED6B535E561B9405BB472FA /* sockaddr_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E1730F19E4224F23FD1F6E112A7A47 /* sockaddr_custom.h */; }; + 05FD5E2A3CB6FE9C8174EAD6C2E9CD58 /* fixed_array.h in Copy container Public Headers */ = {isa = PBXBuildFile; fileRef = 931599781BE22AE7AFAA7F464416FB40 /* fixed_array.h */; }; + 060A3E5D7B92B4A5711715F4DA10E073 /* FIRDocumentChange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 20923075D20F34C7D0FDCCC63697DA86 /* FIRDocumentChange.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 0617093F81D30A905B8E69D17DAD12EE /* ssl_aead_ctx.cc in Sources */ = {isa = PBXBuildFile; fileRef = F88DFF4B603A25137FDF70CA3091492F /* ssl_aead_ctx.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 062ACB1E8CDAD741608C8088B9FEABE2 /* slice.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 4A5FEFACE1AA855021F2464F98B76C77 /* slice.h */; }; + 062FB9613D8893A51BCA3288444F21DA /* sorted_container.cc in Sources */ = {isa = PBXBuildFile; fileRef = 513D3BB34A524F46BBB36B3D17B35E87 /* sorted_container.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 06311006FD84FBED34487F7393492157 /* db_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = D9E38398FEDEF6BFD1228500AB255FB3 /* db_impl.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 06375462C43B83AA6E1149157849E3EA /* server_address.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = A4BDDB4AAA4F4D605A47FB66B4FEE16A /* server_address.h */; }; + 0638C5A083EB5777D7637C4D3C2661CA /* transport_security_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = C7036343B39BFDA0F9DF8238A27AAE70 /* transport_security_interface.h */; }; + 065CDA912B18E5CDDCC45E3BD9BC0A57 /* charconv_bigint.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = CD968E8D4F3BCC435DB29548EDFF5C4F /* charconv_bigint.h */; }; + 06740BA56AF5D2ADCFCBC37D7B041BD6 /* FIRCoreDiagnosticsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 22221F044B9F7D9155FE2B197E7A0020 /* FIRCoreDiagnosticsData.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 067609CC44C1A6E06EABF7B480AED10F /* byte_buffer_reader.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6791237FDDB229B80FF9F960CD09BC2C /* byte_buffer_reader.h */; }; + 067D6E88B9D05878C57BAE68C30B4B8A /* alts_zero_copy_grpc_protector.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F016A74296D7C56C7C8BA613C59CF5 /* alts_zero_copy_grpc_protector.h */; }; + 067EBCAAC8508318245FD8A2A41B6F8F /* siphash.h in Headers */ = {isa = PBXBuildFile; fileRef = 255CC353C5FDA6CA1E8E6417A72A7530 /* siphash.h */; }; + 0680A6D9A49ADD1E478ED58C9A76033A /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 525C9EB44877774F6C84793E5D9D5E1B /* internal.h */; }; + 069997781F660695BDF743A0C0CCF1A9 /* atomic.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 753542788C5C091470AF4D13364A6DAD /* atomic.h */; }; + 069AE88B5912C6D9F8D625AEE36EC241 /* client_authority_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = BFF4010FDB9D10844BD2A963E431761F /* client_authority_filter.h */; }; + 069E440512241A30E3E0B6AEF95E7423 /* tls_pthread.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7C388295F481B616CD42572BF9649B /* tls_pthread.h */; }; + 06A5107EF89CA5761009A98A2E8214F0 /* circuit_breaker.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 632762789A1D19AA681DC4AA5B81A8AD /* circuit_breaker.upb.h */; }; + 06CB7124DD2D1D52A68C0878F0BBF025 /* json_token.h in Headers */ = {isa = PBXBuildFile; fileRef = 19DFA2FEF180F5A3402EE13F91773035 /* json_token.h */; }; + 06D859B2E0B519D813BCDBB8049644C0 /* secure_create_auth_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = D41AD06745CA4B7E6E407B804C4B6F54 /* secure_create_auth_context.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 06D969A392CB95E1D7E6079843CC4FBA /* sync_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = DC86DD624BBB8F86536B9BBD05207CA6 /* sync_stream_impl.h */; }; + 06E0D1E0EDF2A56562B05DE10D6635CC /* stream_compression_identity.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DA1862D10A5E16DB66B1A9CA4B65EE /* stream_compression_identity.h */; }; + 06E77143D6E08E4EDF19EBF8A0D18937 /* channel_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 150114D1218D95652322D51EAA164063 /* channel_filter.h */; }; + 06EC7B391AC16A945BAC6D42A0784B5D /* proxy_mapper_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = BF0F2A4D7E6BFCE77B44D101C672CBBA /* proxy_mapper_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 06F2FF087F1F9A343B24D730467268EE /* handshaker.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = C890CAD79CB25BC6F37D1A02E532AF00 /* handshaker.h */; }; + 06F3C3CD8667E0F6F9EDF70FF2AAA0F4 /* call_op_set_interface.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = B6ED6D2F2644D93740B21482FDB3A7B3 /* call_op_set_interface.h */; }; + 06FF3CFEDB20F05A277CEEC38C2C65CB /* proto_sizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCBF36C85B3DADA0FE9F311F0F97793A /* proto_sizer.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 070346F152D430280094169A884FC6A7 /* iocp_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 71001072B6B65C2DC123195C1AF70EED /* iocp_windows.h */; }; + 072125740CB312EA67F1D533CA8C8456 /* jwt_verifier.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = F35E1EA461D38B6A27DBB8E856036967 /* jwt_verifier.h */; }; + 073152C4D10575F28A7AAD6F8A291E5F /* timer_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 342A87448451AC50F9565222E3BC18F7 /* timer_manager.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0735253BFF7A9792A356B624D3FEAEAA /* fork.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 44DAD51B726D6D0AD3F797C00B8B1259 /* fork.h */; }; + 073D80FE3E42FA25DA8C50E2E59CD28F /* x509_d2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0662E898C6EC0861687AC029B9735D7C /* x509_d2.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 07504EF543D605369D6D5ACF2C6C363D /* semantic_version.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = AA0ECCEA54FD8EB5AE66767FD5BFE71C /* semantic_version.upb.h */; }; + 075EB412A90E4BCEDC09557144E62DBD /* stub_options.h in Headers */ = {isa = PBXBuildFile; fileRef = F0BA40126E444588641AC50A31C65BCE /* stub_options.h */; }; + 07636DF52F3B67AFA466E7645FBAF023 /* pem_info.c in Sources */ = {isa = PBXBuildFile; fileRef = B2DC46681E437C1AD114E17C973D9F44 /* pem_info.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 07784535CA812081F4851547EDA6600D /* proxy_mapper.h in Headers */ = {isa = PBXBuildFile; fileRef = CB9E0586786503733DE3CB26BE3895B8 /* proxy_mapper.h */; }; + 077DDF68BBF5B4B7DC6200D91B4AB9F6 /* dns_resolver_ares.cc in Sources */ = {isa = PBXBuildFile; fileRef = 034BA6ABEAC3D0030D96059FDD8085BC /* dns_resolver_ares.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0785663AC00F919D8BCB9DD80187141F /* auth_context.h in Copy impl/codegen/security Public Headers */ = {isa = PBXBuildFile; fileRef = E3DAFF6DE90508C9BDC6062F431B74D9 /* auth_context.h */; }; + 07938C52C6D4CD329B608935D63149F9 /* tasn_enc.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AF0EA46779A2ED3A8C590516EDAA051 /* tasn_enc.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 07ACAAE4C01A2FD00AA81F2843B5CA8B /* trace.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0593165C5FD6254F93A24AEBF1666D95 /* trace.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 07B0CF70333497CFFFEBB75BAD03EB93 /* unicode.c in Sources */ = {isa = PBXBuildFile; fileRef = 92104BBBBFB6AF14462769ABCF4917BE /* unicode.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 07B30690849DF4C1BD272C437988CD3B /* validate_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA6C03ECBC2D9DF2C3AE52F296DCC5B /* validate_metadata.h */; }; + 07C840C945A16DD3B8A47102F2DD1CDC /* stacktrace_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5476FE3953EBF5D8B40E5116155D11 /* stacktrace_config.h */; }; + 07E217EA5CBAE874B431F062006E53D6 /* cfstream_handle.h in Headers */ = {isa = PBXBuildFile; fileRef = A0375C1C408F48911C5A3719BE9D5F2B /* cfstream_handle.h */; }; + 07E2ED8BC1ABA4C4F96990753B182FA0 /* query_listener_registration.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1A4AF395481273F9A272ABA5E5A484BC /* query_listener_registration.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 07E9E37032681A1B6A9874487F7E417C /* tls_msvc.h in Headers */ = {isa = PBXBuildFile; fileRef = 75627434CA74A60A1612604AD510C495 /* tls_msvc.h */; }; + 07EC52D7A4EADE417B8E8E55645451FF /* container_memory.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D4905D6B3410A18BBF26BF84188C4329 /* container_memory.h */; }; + 07F3CDFBB7F8DB9A4C2AEF7CEF3A1CBF /* shift.c in Sources */ = {isa = PBXBuildFile; fileRef = 542B89F0F1ACA3CCA3440851F31ABAA6 /* shift.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 07F5431D6FFFAC40E50ACDFE29D00EB2 /* curve25519.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D86FBD5BDD257F3C8038BB216C9388EA /* curve25519.h */; }; + 07F79A44EDCD74B4A784EFC8C079CFF6 /* iomgr_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3E6BC9EEF879320F15924D807E0674A1 /* iomgr_custom.h */; }; + 0804DB0DBDFF8E5614A048EAFA16A829 /* maybe_document.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8C6F15BD1CDA9FFDC0406E5CF4D74C9 /* maybe_document.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 080635E2F5E4A2BBA8F92BF0D9952D8A /* local_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 6312A4C21F371141D02D36D7F37ACE37 /* local_transport_security.h */; }; + 081D9CC792410F8CD2EFDABB5CD3333E /* propagation_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = 113438DA4A8791BAC897914815DC34DC /* propagation_bits.h */; }; + 081E219C5C42A0D714CB1A4E1448ACE6 /* lrs.upb.h in Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 2945D010CD334A1E33FD25A3BEF30B31 /* lrs.upb.h */; }; + 0822409861EB4E68A45283E93AD864B3 /* orca_load_report.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 1268210F36578BAF3DCD8A25A0E55165 /* orca_load_report.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 08319CF46A470F19EEFB8D40EE586384 /* sync_posix.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 29C0B7E0B38BB64BD690959BF13FA3D5 /* sync_posix.h */; }; + 0835DED9CA507D0BD53834209E670E8C /* log_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F20D9FB01F9A3F129006ED323B66AF /* log_windows.h */; }; + 083CB0A951B5FF5DD597ECF2C9D350B1 /* time.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 7EF8D8C6613AB7477BACC0DC69B5887A /* time.h */; }; + 08412BE0A4DB249245C98B6936992258 /* aead.c in Sources */ = {isa = PBXBuildFile; fileRef = F92BEB79CBC9CB9796C9FB11A01DEE2E /* aead.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 084195340500A3037BB741B9250880D0 /* handshaker_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2C61B9B39560686FB2014E2184FA6FBE /* handshaker_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 084C3CDA657B40774E0D0530B566E6D2 /* lockfree_event.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7FAA70998AC724B983615D3640996345 /* lockfree_event.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0868486407F327CF252D0E4E3188324F /* json.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CC5E1FB0AA9C874CC63E06F1FBD9270 /* json.h */; }; + 0869F3360FE1212126C41A4044BB76EE /* local_transport_security.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5999A20E76BDF907D48C63820256F450 /* local_transport_security.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0874CF4542B826C7D8E8EB163E02B293 /* sync_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = D1EFD9D26DDB7103E060EAD00F7CEC22 /* sync_custom.h */; }; + 0898D51AE39711C6E1C6F2CE31CD3321 /* server_address.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9C865EAC1942B26D719DF51DFF7D3C7C /* server_address.h */; }; + 08B00B78F75C1AC8628EA9A1576AFDD6 /* alts_grpc_record_protocol_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B912DFA803CCB2A18DE83D740612AF /* alts_grpc_record_protocol_common.h */; }; + 08EEF925643844BF2A7EAA52D9003941 /* internal.h in Copy crypto/fipsmodule/digest Private Headers */ = {isa = PBXBuildFile; fileRef = 5E416B6FFF01C2016265C480E859A8D3 /* internal.h */; }; + 08EF8AD9802EB9FF4326396B9A414693 /* sync_posix.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 90875E12404A0AED3656F876411F7B2F /* sync_posix.h */; }; + 0901D9C782C59DB88994A6C061B4ECDE /* connectivity_state.h in Headers */ = {isa = PBXBuildFile; fileRef = FB6EE78C78BD233BC52E5F669C8AFAE0 /* connectivity_state.h */; }; + 090545953B3EA7AA804E8ACCDDF6DB5F /* ssl_privkey.cc in Sources */ = {isa = PBXBuildFile; fileRef = 78D0B836F8CF7251827838B25BE7A18C /* ssl_privkey.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 09087F3AC997813A1FBAD11644631E3A /* incoming_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D2D7144CD2FBB31B0573D211A5F8DE0 /* incoming_metadata.h */; }; + 091785D4AD2EE486C36F67F781EC6CC4 /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 424BA320A3592CC7617275117CC376DE /* hash.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0921A73F672C9F34D0657CC1C4F12A28 /* time.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8056BD4953560BE8C4323BC869D255D /* time.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0924B6CB42A05C70F439DFB277CB6FD9 /* discovery.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D2ACEE111EDDF5B6DA799B4694EC47 /* discovery.upb.h */; }; + 092A8EE79C04AA3E5D49BC58FB79BEF0 /* port_platform.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 2AA0481E324D7F406F906F0D617C934C /* port_platform.h */; }; + 09389108BFFAA38ADEC8E7797750D2FC /* annotations.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1935BE7E2932D2AEAF282514A83BDC6B /* annotations.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 093A8C038A2F4AEA94259A959B103F2E /* backend_metric.h in Headers */ = {isa = PBXBuildFile; fileRef = B877A4481E154F4843BE2B7B6BF110DD /* backend_metric.h */; }; + 095905F70D2AD238C8E96EBD9CAA5A49 /* str_split_internal.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 1EA4629029ECB44825A5A15440A4E2E8 /* str_split_internal.h */; }; + 0970E4E74410C99AD985841A7F51C400 /* server_builder_plugin.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 6A66EDDFCCC68F686309D219E83AA46D /* server_builder_plugin.h */; }; + 09727B49E0081E9AE305F59866273C6C /* tmpfile_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = A16C988C3A0E82F7F25F75BE2C946CFA /* tmpfile_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0999F98F054E2BCFC216801BF97C2245 /* charconv_parse.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 7703E0901E3A8AE85A412693628DCB52 /* charconv_parse.h */; }; + 09AD6C192AB65E341744FE0F4C3339E8 /* log_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 82D93A5AD910DC73DCD6E4F52DB0BEBC /* log_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 09D38EF8AF07F8AE45EA18DB9F631CA6 /* altscontext.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = 5CB03E565CB23E05469C865350E8481E /* altscontext.upb.h */; }; + 09D72970EB675F223C1C650A0E3AA8A7 /* client_callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F79AB233BA51E65780DB03CABCFC2B2 /* client_callback.h */; }; + 09E75454F1960689A95560402C23F95F /* server_context.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 34B9E5B568FC93770BE6626D4F5F58D8 /* server_context.h */; }; + 09E9D31FCE2C84A5349CD4BAA134278F /* error.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3CA599690024C45B7D3F178A156F9517 /* error.h */; }; + 0A09D39C83F17967B902F8E2134257BA /* obj_dat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E7D461A18D00764A5DACAF2D942F288 /* obj_dat.h */; }; + 0A11166AF18DDF5822DAE3C28992F0EA /* timer_heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 3534D1D157B9845F8F2ACF43722EE98D /* timer_heap.h */; }; + 0A455DAE8D81CFF57DDEC321CA7E7DC8 /* barrier.h in Headers */ = {isa = PBXBuildFile; fileRef = C7E75A3C6625795F606173495E322656 /* barrier.h */; }; + 0A53ABDAEB91F8FF7DDE9ACEB433ED73 /* buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 14B40745DACF97BCF26AF8FBF36B9130 /* buf.h */; }; + 0A5A816803C29EAF791745FC11CD142A /* cipher_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C1A95744898955B4278B82F42B2B4EA /* cipher_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0A5D286FD1F7918827D17DB4BEC3838A /* server_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = DAFAC64AB3B327E9B4C60799600C63C7 /* server_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 0A94794BF812D29939B8FD075CED6461 /* transport_security_common_api.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0BA3A49C8625C2A50F3C9D14095B0F95 /* transport_security_common_api.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0A9E2933AC01DBD8118E562328EF39EE /* oauth2_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = B234CFA38D4A58A3F077DD4ECDB1F55C /* oauth2_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0ABDE6BC38C52021D571D7165DC3B626 /* accesslog.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = CD432985E39A59D2A752A839C6572213 /* accesslog.upb.h */; }; + 0AC02EAE78A73DB059AF137187024B3A /* chttp2_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A479BD75DC8232A10102C9CF863F3B6 /* chttp2_server.h */; }; + 0AD92825CFCE728CA437CCF830B0EE7E /* validate_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1C6D9EBC7DF5EA2DE5447F4058FF2D27 /* validate_metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0AEF1FE56AEB932722407485C77C8D44 /* udp_listener_config.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = CF1788CDE9AFFBF7E60F1C43D4227EEE /* udp_listener_config.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0B2545354AF94F9F324398CB21CA970E /* curve25519_32.h in Headers */ = {isa = PBXBuildFile; fileRef = 4708BD44EC5A216E24FB4E52DD3D392F /* curve25519_32.h */; }; + 0B2BDC38C85E3622CD96CBDF4BF47CC5 /* GoogleDataTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D902EC8F9894DB24CAF3257297A29E22 /* GoogleDataTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0B2EBF4F4D8685368F2CEEA8EB10F0F9 /* secure_server_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 692CCA167BAE54029B9243C2996E4BEC /* secure_server_credentials.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 0B3B7AA6DA14DCEAA44493135B78F485 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = CEDC1AD9FCEC707B36616065392A2C1E /* internal.h */; }; + 0B4EC5BD61B5BD57C4ECF94AE34137BC /* threadpool.h in Headers */ = {isa = PBXBuildFile; fileRef = CD676D07C0BCA6C58E93E75DA606FFB0 /* threadpool.h */; }; + 0B4FB0B28081816458E7976D81AA3D78 /* uri_parser.h in Copy src/core/lib/uri Private Headers */ = {isa = PBXBuildFile; fileRef = ABCC5141DEB28F508919BD050C07F49D /* uri_parser.h */; }; + 0B58333C7914B3CBD8A251F0C6CE675B /* urandom.c in Sources */ = {isa = PBXBuildFile; fileRef = 50A5D9A5D83F8A6CCD571DDCF2D31672 /* urandom.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0B664C26867D173BB0F4A4C68D4EFFE1 /* call_op_set.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = F2BD2D588B3379F19C4BC9E8559BB359 /* call_op_set.h */; }; + 0B6C585D7146629AD11E0FC9AB86DCB9 /* cpu_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = BDD988DD3C6BF4ED823136D32F96453B /* cpu_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0B7536BF3A1EC05D491FD4485A344D8A /* alts_crypter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0A1D55B7B87A1B1071195814BD0BE75D /* alts_crypter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0B75B7C5739F4B37FD651FC9F09893D3 /* sync_custom.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = F597A3123DA662D08CACDB826E2E5BEE /* sync_custom.h */; }; + 0B889A2CC8AC860A091C1C63DDD57C68 /* str_replace.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A831916712628AFCB8A417ECFB71FA3 /* str_replace.h */; }; + 0B9493921A7BD71EDBAFA16D9D106188 /* zone_info_source.h in Copy time/internal/cctz/include/cctz Public Headers */ = {isa = PBXBuildFile; fileRef = 1ECD6207B8EAA5C8AAC66053669DF5C6 /* zone_info_source.h */; }; + 0B99A578FFBF55F4941C3025C0A8C400 /* pcy_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 1B9B58DA180AA609B576969359D3334E /* pcy_data.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0BAE793D92694F3E7E8500C3930C09B7 /* fake_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = E83774E452AC21CACDCDF4A75561AE43 /* fake_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0BB576B9B9D13C345DD5D157211CE208 /* plugin_credentials.h in Copy src/core/lib/security/credentials/plugin Private Headers */ = {isa = PBXBuildFile; fileRef = 10D5C776E0A1441020B19E29959E688C /* plugin_credentials.h */; }; + 0BC3DE62811CC4B24F6D43FC04352AA4 /* slice_weak_hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FFC6BFBCF6D712799352AD3D1225E1 /* slice_weak_hash_table.h */; }; + 0BD01C703B3E9C953627A28C66CBADD2 /* work_serializer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 26695BAEF9C0456F044A5F13BF4A4DB7 /* work_serializer.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0BD17BCEF54953244058862C29A0866D /* tls1.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 900C43A5291423E98AC6EC97FA688DCB /* tls1.h */; }; + 0BDB4A44A318D86031FAEB88D6DDE0C7 /* http_connect_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 5268762131A530F53A0F5204E3F8A2C1 /* http_connect_handshaker.h */; }; + 0BF83692E96B59464195A1592897D7AE /* status_conversion.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = CC536920ACC3ACAC107C84AD1D25B15B /* status_conversion.h */; }; + 0BFFA96E47910DFE0422FCEB67190873 /* ev_poll_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = DBEE52BED394D61CA0C646C0C4DE1453 /* ev_poll_posix.h */; }; + 0C016CC612CE6C7AAEC4126F0CD32C50 /* create_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 593854392CD23606E2DCE099FD766A02 /* create_channel.h */; }; + 0C027E62EBFB88751D664F5D95F819F8 /* channel_ping.cc in Sources */ = {isa = PBXBuildFile; fileRef = ECC1A74FF0C5A03AA6AF2ECC873090EB /* channel_ping.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0C032F8094490291462B7382D0737FE4 /* a_type.c in Sources */ = {isa = PBXBuildFile; fileRef = 82E5DE088CB05468F250C8633566A51B /* a_type.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0C0D2DCCCEA051797B327F091737CB1F /* cpu.h in Headers */ = {isa = PBXBuildFile; fileRef = 199C2D16BC8EFB980FAE08F606AB3076 /* cpu.h */; }; + 0C0EB50C2453FFD792F6F809354F64CC /* grpc_if_nametoindex_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 237729985839977E254A147F3938091B /* grpc_if_nametoindex_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0C13CE9CD78EDD63B344BCD9C5BA84D7 /* bundle_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 18FB9E0078686EBEFAE54BEA6788DD49 /* bundle_reader.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 0C27EC53C388772556B294F0D8393737 /* tmpfile.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 55AA3FA7CCA5A2DD4F2CC561B6CDFD10 /* tmpfile.h */; }; + 0C3216D3FA659B7935C58B7B0AA8E6C6 /* bn_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = B5E960B51CE1E30ED7C3E4C9A96A4D18 /* bn_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0C45B053163D51EDDBE0FB35DE0B6F09 /* hash_policy_traits.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 07F8E363F9CDE38097105618252EB3F2 /* hash_policy_traits.h */; }; + 0C5564DEEC202B9742EA4C0020F0D38A /* thd_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 45034B8772C1D99CFF8715FA857BD0A5 /* thd_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0C55829C11A91CE5131D9E17E8A86A0B /* subchannel_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A99561B4F8B50B1BF0C7246EC47ED83 /* subchannel_interface.h */; }; + 0C76E8DA159A02EEEB9290E178F0EDA7 /* client_unary_call.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 7ED9237D85289C5307DA6BABB50E35C9 /* client_unary_call.h */; }; + 0C7FFDED3939FC94EF07001C6D9248B0 /* a_bool.c in Sources */ = {isa = PBXBuildFile; fileRef = 99726721863184562E197B43DF83EB89 /* a_bool.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0C9467C957D8B3A2C4D367082E0C9384 /* stream_map.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3A412EA5BC2E26FFE585CB5AD09595AC /* stream_map.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0C9CED30416BD631451F4968C5641282 /* block_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6E47B545B0FD3ECE687598822590253E /* block_builder.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 0CA258B56104DACC708B63EB5C7A366B /* channel_arguments_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = B7B84AD8FEB5694D1B5DC90E365C65B4 /* channel_arguments_impl.h */; }; + 0CB64AAB20F9C58FE5F936EF879F4C92 /* lb_policy_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2FC67CFFD88121716465842FA877D2 /* lb_policy_factory.h */; }; + 0CB831015CFEF2D75725DFB25604B3EF /* handshaker.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = B9C07D39456BEB25DADB8C12C3CFF84D /* handshaker.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0CB9913005174EAA7C7A2389C1E047DA /* coding.h in Headers */ = {isa = PBXBuildFile; fileRef = A0B311BDF6F71B474574F2B941CD1980 /* coding.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0CC0293E5DBFA12E2E0BBA7F49CBBDF7 /* FBLPromise+Any.h in Headers */ = {isa = PBXBuildFile; fileRef = 35A7BD8BA5AF8D5B5D3A7A66AC545324 /* FBLPromise+Any.h */; }; + 0CC64AC95DE963EBDEAE251063BEBB01 /* cpu-intel.c in Sources */ = {isa = PBXBuildFile; fileRef = 7AEC4A4833E5091B3CDD7E1815A8690F /* cpu-intel.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0CD0BD7ECBD069A885606B0E3ABD9199 /* compression_args.h in Headers */ = {isa = PBXBuildFile; fileRef = 99DEC3F82F42B837EF03657BAAC60977 /* compression_args.h */; }; + 0CD3EEE320520B5C9306774064421874 /* server_callback_handlers.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 7867A1BA96A03E8F1C980E2AAEA8393E /* server_callback_handlers.h */; }; + 0CDD53BD7F4F00C5C39389DB12EBD6CA /* resolving_lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5AF1BFE885DC98B707F2D7B123D87B05 /* resolving_lb_policy.h */; }; + 0CE23E380DCC095C60C8DDE8D4952325 /* custom_tag.upb.h in Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 0989B29C0D36FEAAC9D3493CAF8910D3 /* custom_tag.upb.h */; }; + 0CE54E10F84E8D669AC362586D8793A5 /* grpcpp.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 11F1FA22BF5D93DBADFE5B1D6E370EE9 /* grpcpp.h */; }; + 0CF1BAFCF807773D6A910DA5D9BDD8F1 /* message_allocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C5B3E6E383400260EACF184A4CF39998 /* message_allocator.h */; }; + 0CF7A603C17C421CE4BBE6B0FAB692CD /* client_context_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = ECDFE3BA3DAEDD1D8996B92A462FF847 /* client_context_impl.h */; }; + 0D1A5FAE587320A7487C8CC208633E26 /* server_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C8FA03E68B2B6F8B6051D2A50FCE2148 /* server_impl.h */; }; + 0D5295321517AF70A14A6CD7C74E0F89 /* load_report.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 5350E42C1AA2174B8763D80AA5DE7721 /* load_report.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0D53CB1AA1108E7EFDAF0EC6752671D2 /* config.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = EAE79CCAF1AE912E1C941255BBE29708 /* config.h */; }; + 0D59B40583E46E9B8CB62F5BDE103692 /* p5_pbev2.c in Sources */ = {isa = PBXBuildFile; fileRef = 6CAC5129540A400C728F8403246DA32E /* p5_pbev2.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0D8EBCD6CA9723F3C8686584898D806C /* string_windows.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 4F3A0D48D2B8FCA94C74995983F04877 /* string_windows.h */; }; + 0D9DECE27AC8EE0734CF03E846DAB169 /* add.c in Sources */ = {isa = PBXBuildFile; fileRef = 3BB3BC1F21E682BF978F9996DF5BFE15 /* add.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0DBF70DB4ECBCAE30514BA94AB007626 /* base.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 0B839027E3077538DD420421FD65D9F5 /* base.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0DCF3B1D5D4FEAC11560961A46DF1F7D /* load_file.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B3FBDC6FBFF8BE3F070CE1482F5D70E2 /* load_file.h */; }; + 0DD76F7118490D1FC9B6987B602905AD /* lhash.h in Headers */ = {isa = PBXBuildFile; fileRef = CC7367D782DD81E4576FF29B43CE2581 /* lhash.h */; }; + 0DDAF6BC09F074985FDD1A0118DBF016 /* tcp_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 380E77E7227988B903FA456F1FB2BFB5 /* tcp_server.h */; }; + 0DDD12902C76F18A31C5852B8BC622CB /* internal.h in Copy crypto/fipsmodule/modes Private Headers */ = {isa = PBXBuildFile; fileRef = 88C2B6303463ECACF12ACE641E759FE6 /* internal.h */; }; + 0DDE7415D2188B425641D36A7B8B85F1 /* deprecation.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 4583E9CB7FEEE33105B059F2D82BFB72 /* deprecation.upb.h */; }; + 0DFEE9C38C2D6A526E96EFF99208C708 /* server_callback_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = ED57B4D5C68FD214EC668808F26E7373 /* server_callback_impl.h */; }; + 0E035F1D62015F8A36CB86543250E081 /* server.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = F1D041324AEF94552F612A8347FF944F /* server.h */; }; + 0E10E480076EC1BEFC9507A81F074AFA /* event_string.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FDE2E76DEFE8E85CFD4755F929091FE /* event_string.h */; }; + 0E131B97FCDF68EA3673EB2E133F4A23 /* FIRCoreDiagnosticsInterop.h in Headers */ = {isa = PBXBuildFile; fileRef = B8C5BA28988FE67D943EE4B89F70AD7C /* FIRCoreDiagnosticsInterop.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0E1B8AEFA5E72C4F6903A034CD221776 /* metadata.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = FD9B6C8E8C8C9215BC708DCD218B5285 /* metadata.upb.h */; }; + 0E1D14759E148BA4DF96D7D7CB165C2E /* struct.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = EE91BD7A7A5DF7BADF4E5D0ABB121558 /* struct.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0E28C0CB9E27FF6F04185F6EE2DA4BBE /* metadata.upb.h in Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = FD9B6C8E8C8C9215BC708DCD218B5285 /* metadata.upb.h */; }; + 0E4BF2B5B68CE547330D199A4662FF4C /* server_address.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C865EAC1942B26D719DF51DFF7D3C7C /* server_address.h */; }; + 0E6742063004EBA83AA13F67E0A10870 /* status.upb.h in Copy src/core/ext/upb-generated/google/rpc Private Headers */ = {isa = PBXBuildFile; fileRef = F102DCA4D8E69C333CBCAF1AC6FBD408 /* status.upb.h */; }; + 0E7F82170653C6EE701EBE958AEF1B41 /* e_aes.c in Sources */ = {isa = PBXBuildFile; fileRef = DDD44762A45E687EB93D355143E47EA7 /* e_aes.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0E9AAEBF621E33CE9EDB22C51AF0980A /* channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F5E7D4CCC09647D8B15C0FE1C6B8E8F /* channel.h */; }; + 0E9C7155101B5EC3C20ADDB312290A78 /* server_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = C8FA03E68B2B6F8B6051D2A50FCE2148 /* server_impl.h */; }; + 0EA711A6F4AFEF86D3B77A0C93CE39A5 /* iomgr_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8786A18496EFE7861919F652FA534D5A /* iomgr_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0ECEB59F340AB9E1DCEFE3298243AD77 /* cluster.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6FD3F5FD722AE7C27691ED3E992EE06B /* cluster.upb.h */; }; + 0ED9C4D6D7FDEBF78BF69F36D4462A0C /* fake_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01F0E948191D8F9107418B1954815CD9 /* fake_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0EDA6930F2D29B47B0092683A02636FB /* sync_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3A3179F3D454D104AC5A2966E2B649FC /* sync_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0EDD36DA739422E65FE3C5D3C5848C57 /* no_destructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ED6D8ADC39B484F485E571BE759FD27 /* no_destructor.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0EE1380F676574D83D9968981829C968 /* sys_epoll_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 8768E92C1DE2FF698FBEADFD59195034 /* sys_epoll_wrapper.h */; }; + 0EE2848582E26D736C6A00BB4BD899B8 /* check_gcp_environment_no_op.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6E2C4DAB9B1F9F5FADB214D3FA05F90E /* check_gcp_environment_no_op.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0EF0F68BC3EAC7BA5ECB6C1BA32B7685 /* field_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7A61CB6282EDA84F6EF761E93939C0C8 /* field_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 0EF122DC00DE7DB653A08F63C53409BE /* FIRFirestore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49050E1701CC08C83C08697F645358E6 /* FIRFirestore.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 0EF79602E0BF9780493923345D7F69EC /* arg.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A6DFE52D3AA115674B62CB17C7F1AA7 /* arg.h */; }; + 0F01ED0539F8B0200AC9F297845EE7A7 /* metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C12A97E173016FDB1AB399B0574C41 /* metadata.h */; }; + 0F02DE1797971FD4495A765DBBBEA748 /* client_unary_call.h in Headers */ = {isa = PBXBuildFile; fileRef = EE1ACE801B4732693EC7AEB4749FBD54 /* client_unary_call.h */; }; + 0F0553B42F1807CE2A1B7FAC797DFFD0 /* flow_control.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 3981B5D272FE54939C07182ACD00E735 /* flow_control.h */; }; + 0F147D93702EF33FA04BCB16BE9CF3AE /* p256_32.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C7EB7C367CFD848EA3481438FF18F81 /* p256_32.h */; }; + 0F1822AAAC0453757F14046D62A26BE4 /* GDTCORReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = FB44D07A16FBCB87E04515ED0C9D5AAF /* GDTCORReachability.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0F2085BFCDF55DC116920B58D64F3A95 /* FIRDiagnosticsData.h in Headers */ = {isa = PBXBuildFile; fileRef = E77D560378F569278A48673B196FC763 /* FIRDiagnosticsData.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0F263C4CA6C723B88FB4FED58A104A10 /* status.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A8908A9F38FEE3653A71C8CF6AA706A /* status.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0F3FE2473EF988D27C927A57F12E64D5 /* grpclb_client_stats.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7572A863E8A97143CF808BF6215BFA80 /* grpclb_client_stats.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0F461C1E0235B13736A3FB236F457300 /* channel_init.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB148691BC2F24E1B936AA61EC8B3DCB /* channel_init.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0F4E28D66F3576E1120E31003E09DFC0 /* asn1_mac.h in Headers */ = {isa = PBXBuildFile; fileRef = D6EF0BB4DA976434B6D51415B2012DC2 /* asn1_mac.h */; }; + 0F58A9E3FFE43FBA178DAA423048760E /* status_util.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5C26E71E0BC45D4DBDEB1695B8899FBB /* status_util.h */; }; + 0F601243BDF3CD9CB10990AAC1AB9986 /* timer_generic.cc in Sources */ = {isa = PBXBuildFile; fileRef = EE4C33B273CD2E96C9BF04694456F0B3 /* timer_generic.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0F6DAF03B2B0FE1D36E51715564F2496 /* rpc_service_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 7370655514EBEDA752C76B3B6C052503 /* rpc_service_method.h */; }; + 0F965385027A2B363AB7019B7F326811 /* timers.h in Copy src/core/lib/profiling Private Headers */ = {isa = PBXBuildFile; fileRef = 5A4083889D69AAA6415523B376A782C5 /* timers.h */; }; + 0F9A8599CC77B1B3593C933287F71CF4 /* x_info.c in Sources */ = {isa = PBXBuildFile; fileRef = 060F549530567FABD6EC369C1267D9C9 /* x_info.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 0FAFB1328B96D6E62280BAC95D96A860 /* tcp_server_utils_posix_common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 683A8D007E9001C1F4E9004DE36438CE /* tcp_server_utils_posix_common.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0FC28FE599F998C0635774ACE2812CF4 /* stacktrace_x86-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = 2B2F833A151EE4F80871CAD8924F83CF /* stacktrace_x86-inl.inc */; }; + 0FCAF2095DA0F7E8342162E71D4066BB /* migrate.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 842F145C13D43826889D805C80496C5B /* migrate.upb.h */; }; + 0FD8FBC3D10C5C691D7641107141E082 /* error.cc in Sources */ = {isa = PBXBuildFile; fileRef = CC4A63E2A2A0F9CCAC332C57C650BDD0 /* error.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 0FE6A2EC8F420A8D795451E12223923F /* FIRFirebaseUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 64AAFB0D2AA6500F624DDED98A40ED6D /* FIRFirebaseUserAgent.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 0FFDBA8ECA5F16661EDFD74F9A489211 /* load_system_roots.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 99D1B1F2635C0B5AA5221EB976A3B24F /* load_system_roots.h */; }; + 10028AE9C414A32DB10F561108A5F612 /* tls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = 00E091313428C8D72E21DB5C33C2C835 /* tls_record.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 101AD1E54F467CE4D1C12BC7C421CF87 /* grpc_completion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 307F011D6062A498664FC58DACE67415 /* grpc_completion.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 101B79473DD09A19FC02AE5E694DC696 /* bio.c in Sources */ = {isa = PBXBuildFile; fileRef = 955D62C0782FABCD4654EAC0D9FC3DC8 /* bio.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 10291ECC417AA1CC8406A9A124887A73 /* completion_queue_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F695A271D87C982FCB797831B8C4A5B /* completion_queue_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 104F1D4D0CA9914361CDBE3E33A39328 /* p_ec.c in Sources */ = {isa = PBXBuildFile; fileRef = 1FEB0462FEAE9D1EA18E047F38534936 /* p_ec.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 10660932C3819557A77BED3373D90F2B /* xds_channel_args.h in Headers */ = {isa = PBXBuildFile; fileRef = CAC79AB1E2662705341C013854CC1683 /* xds_channel_args.h */; }; + 106FCCD5CD63671399B3959088459BDC /* core_codegen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D5214C90DB7BDE9D0FC93E06B024787 /* core_codegen.h */; }; + 107C317ACB99063C33D77F3AB1512010 /* proxy_mapper.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = CB9E0586786503733DE3CB26BE3895B8 /* proxy_mapper.h */; }; + 108D4D3B9D782D9E80BDBC5CF1ADE5B6 /* max_age_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D38C9C89251BC76A22D5EFB217A2BF /* max_age_filter.h */; }; + 109207880875A9AFDEA2A5A8AE3AD5E4 /* channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DACF790A72B28E83031D36EB45ED237 /* channel.h */; }; + 10B5B500659FB78E31888F475513CEA0 /* FIRGeoPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C1DB7158A1D4AACDFA648029B7138D /* FIRGeoPoint.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 10DAEBB15D10B356B99EA2606B1D9455 /* slice_internal.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 41FB1B12AF7F7444EC885F1C15DF6677 /* slice_internal.h */; }; + 10DB1469E54C93AA970F0ADFBE8E6127 /* stacktrace_arm-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = EF7DC7895952D40AF44FF1457345D047 /* stacktrace_arm-inl.inc */; }; + 10DBC401A9CD72C3EFA0887B183F1A60 /* rsa.h in Headers */ = {isa = PBXBuildFile; fileRef = F653C2BE231542EF8F210F9C18A07B32 /* rsa.h */; }; + 10E2D8FBD9D5732A1ACAE4878EB7C81C /* xds.h in Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 555C36FF5396C3B28EDB6B6AC7529F1A /* xds.h */; }; + 10F41CFD8BB19528F9E2A3FEF73F0CC4 /* FBLPromise+All.h in Headers */ = {isa = PBXBuildFile; fileRef = DDEB5E4FE0768AEF991D265861A9C550 /* FBLPromise+All.h */; }; + 11232A617470B5563B1D8AE91B9B41EB /* version_edit.h in Headers */ = {isa = PBXBuildFile; fileRef = B8B945C4CE0702A4E4C559461E487786 /* version_edit.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 1124B92B8A8C7379A8E2610C98116AE7 /* orca_load_report.upb.h in Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = 74C8974B3B902E1EFB8E33E52DC21979 /* orca_load_report.upb.h */; }; + 112D37B3945BB21C913FDC8B0368BB35 /* a_bitstr.c in Sources */ = {isa = PBXBuildFile; fileRef = D5D64F2A0790105676B48B1D27A00ACD /* a_bitstr.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1135D1632620032F8DD4CD19754EA08D /* sockaddr_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 75CDCBAB55D2D1417B5DDAD3D9886D2D /* sockaddr_posix.h */; }; + 11446D29A29EB47A166FF11843B8E594 /* bin_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F6B0C0FD283587E498CEE3A6EBF788CD /* bin_encoder.h */; }; + 1162632E646ADBB1305A63D5E850FAB4 /* frame_data.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 0E4DC2D66EA32923CDD238BE04DF37C4 /* frame_data.h */; }; + 1169E8CC247AD37BCF9D3056E44CC295 /* evp_ctx.c in Sources */ = {isa = PBXBuildFile; fileRef = 3E2CF3C56CC98E70074D3B03C6080C02 /* evp_ctx.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1176D541267EB11B9A6A89C10946E3C5 /* output.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = F1622E9A9A961729DA445FAB73B0974D /* output.h */; }; + 11889FB37270A650EDC4710DDF2E7A85 /* tcp_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 73EB465852F876184AE6DF57B99EA7B8 /* tcp_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 11997C2E0EB98DCB42FC0F8C1E465649 /* FBLPromise+Validate.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A086B484D96840E954EB167A0B8532DB /* FBLPromise+Validate.h */; }; + 119AB301E0D3583B4623199CC44C63BA /* elf_mem_image.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = DA62D6A2A16FF788F79064DE2907302E /* elf_mem_image.h */; }; + 119DB3B8ED24E5933C1A2C3ABD5978B9 /* client_context.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 32D211F9024AF3892B1280563BCF428E /* client_context.h */; }; + 11A18CD24B179A36879A470C207E8405 /* field_mask.cc in Sources */ = {isa = PBXBuildFile; fileRef = 08DA59EC052EA331486CBB173A3BE045 /* field_mask.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 11A3E2D6E1D72656594766FF6F9F1D93 /* wakeup_fd_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = B76DE14AA09E463E45C815279F122262 /* wakeup_fd_posix.h */; }; + 11A908758D77875EFE6399744D01815D /* proxy_mapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65679A6AFC13DD9CFA432F38F3740361 /* proxy_mapper.h */; }; + 11DAA347A2BE49A5B6FE6A5E5C97F134 /* alts_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = C07F6A0A40C9DC31FA0BFE51E0F3F29C /* alts_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 11DF007A4A1F70EF0A3F6AAFF9A522AF /* lame_client.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 946FB238E205DD9FB93C848B9F9AEA3D /* lame_client.h */; }; + 11EF6B3978005E6FF8D9315C439A0A94 /* fake_resolver.h in Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */ = {isa = PBXBuildFile; fileRef = 977E014A4754BB8C4B0A8CCD7E461144 /* fake_resolver.h */; }; + 12070AA5A3239ED9BABCFB59B10F2450 /* resolver_result_parsing.cc in Sources */ = {isa = PBXBuildFile; fileRef = 683724E971A5E29FB54BDBD63773703C /* resolver_result_parsing.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 121F2849D32A0C2FF11CBF9125FEA2A6 /* tcp_server_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = C35E20E0A4A7FB1093AB2A3577E4F17E /* tcp_server_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 12209EEA82BCDD4C2B250BA5484E615F /* secure_server_credentials.h in Copy src/cpp/server Private Headers */ = {isa = PBXBuildFile; fileRef = 1C9785376AA160E8974DC735DAF3C653 /* secure_server_credentials.h */; }; + 122AADD1E4877F747A11845819CE22C4 /* generated_util.h in Headers */ = {isa = PBXBuildFile; fileRef = A88591E1AA68479C3F7CFF5862D565E7 /* generated_util.h */; }; + 122F32B210316FD88F50D1599DC4B761 /* alts_iovec_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 3AD14BFF02BA00FA4B3D8A5B2C96DF10 /* alts_iovec_record_protocol.h */; }; + 1242E5314411332025EB5211A0A19FF2 /* FBLPromise+Then.h in Headers */ = {isa = PBXBuildFile; fileRef = C7AD1CB86D9A9880C6B6C26A5250ED61 /* FBLPromise+Then.h */; }; + 124560F68F98C6CFB7BF2AC637B0A932 /* stack.c in Sources */ = {isa = PBXBuildFile; fileRef = 0244701A5C8D5C5F14728AA23CAFE97C /* stack.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1246EE38D17CE7478DA7625821C3E947 /* FBLPromise+Wrap.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 13A71F4B2C9BAD681CB1B1B737BC68BB /* FBLPromise+Wrap.h */; }; + 1247B1597FDBC478C0AC75FF3F7E9F50 /* per_thread_tls.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 7DE01779F467CAAE296AEF402CBDCDDA /* per_thread_tls.h */; }; + 1262B76AC0B0895A1D3B51565950C61D /* pcy_node.c in Sources */ = {isa = PBXBuildFile; fileRef = 8A083812C2D9429FC64452F44F8AE8A6 /* pcy_node.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 126591783AF522F8EEE597E4DFF9EFBA /* string_ref.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 577DDF8D288CD6D3EDE27C74879CDF78 /* string_ref.h */; }; + 1286CD00F9E93DE372B042972E18BC17 /* ssl_session.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F5259DFB2A55854D10423172A45D1FE /* ssl_session.h */; }; + 128DE552376D4AC8481D37D0CD34ADC0 /* callback_common.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = FDA685DC734F7751F03784B2EC5868B1 /* callback_common.h */; }; + 12A1D2FA53090D3CB21FC65C487DEAE7 /* status_code_enum.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 76AD99BA252D8EFD6A4AABC74E6C3BC1 /* status_code_enum.h */; }; + 12A34FADACA308FAFC8310EDD5DB1B8C /* montgomery.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C9B5D9EEFB195E52B8CC9B58A65F2E1 /* montgomery.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 12A54A6D8D05842B212430221E5007AE /* write_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 75EC1DEA43A8EBDAC6CDAE3F2D407750 /* write_batch.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 12AA1211FB299148CE05A9653A7A19B9 /* leveldb_index_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B6D225378BB7F76C413545C291FE357 /* leveldb_index_manager.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 12AEB8E1357D1306129AAAC6EE81F4BD /* ssl_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 440D5AA3C5AF9D2719E0389B236A7E02 /* ssl_buffer.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 12B73AE46EB33DE3E7F36D6783BAF744 /* oauth2_credentials.h in Copy src/core/lib/security/credentials/oauth2 Private Headers */ = {isa = PBXBuildFile; fileRef = A3097B52F4E36CD1C180171702D18608 /* oauth2_credentials.h */; }; + 12CC88791993370772C0E4B1A2363FC7 /* ssl_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = D5837A27CC19F7F275466C2AE31E8069 /* ssl_file.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 12CE2AEBE1ED231C3A69F8ACD32C6930 /* xds.h in Headers */ = {isa = PBXBuildFile; fileRef = 555C36FF5396C3B28EDB6B6AC7529F1A /* xds.h */; }; + 12CF4DBE5D55F48C84090926B99BF861 /* version_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46D15B24712B14D26DB149630599A386 /* version_set.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 12D9C92C3157DE44E44365F9F9355DBA /* byte_buffer.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 8E2D58AF97F55F7E1FEA485377CE7239 /* byte_buffer.h */; }; + 12DD84F9F3E5E866EF6E9A225F9F46FA /* byte_stream_cpp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5BB8119AC82C3D44A53FEE3EEFC9B815 /* byte_stream_cpp.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 12F6FF07A3140511E64DC9D6D364C6EC /* firebase_metadata_provider_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = C568E053FB87DB623CE6EF46579743E0 /* firebase_metadata_provider_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 12FBBC91F3A9C3FA4FDF3AC8635E08A2 /* error_cfstream.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 65D3A127F85D259EFFB75179FF5D1CE5 /* error_cfstream.h */; }; + 13117E434642D4015727B5DFC764ED09 /* lb_policy_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 783E4528C1488C1E5B5AC3E05CF493CC /* lb_policy_factory.h */; }; + 13148E8F39211332E25CC50B787E201D /* lhash.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = CC7367D782DD81E4576FF29B43CE2581 /* lhash.h */; }; + 13202330A8A22ED2F17BB0B74A970720 /* frame_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 8BE76444A49FA1615624EAE8A8FE1EBD /* frame_settings.h */; }; + 132F778E59E3D1F1D9CD3F84440B1B3E /* global_config_env.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = C4F94046AF98C1F7AE234D6D8EB3C3F6 /* global_config_env.h */; }; + 133131A0D20333F8D8BFA6DD849F4F57 /* orphanable.h in Headers */ = {isa = PBXBuildFile; fileRef = 3952840104A502E94C594E0BDB896FC0 /* orphanable.h */; }; + 13425BF16D9997C69CD7C7A96CF81C7F /* p_dsa_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 9FEC41C1A808A39B9FF1840284BFB9E1 /* p_dsa_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1344777549DC8D6FEC03766BD1B307DA /* authority.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9167BEC72FAF81F898D49F8EDB5801 /* authority.h */; }; + 136B11E991E7E9EFC143087302733B94 /* time_averaged_stats.cc in Sources */ = {isa = PBXBuildFile; fileRef = AF86CA9A63D47F01E919FFEEE6B2A16A /* time_averaged_stats.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 136CCE307D0217E767043EEBA6DAAC9E /* throw_delegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F9A3572E006A3AF2D2D784FA7D2E148 /* throw_delegate.h */; }; + 1397B76EC069FB684977E185F08AE816 /* graphcycles.h in Headers */ = {isa = PBXBuildFile; fileRef = 8839BEFA32CCD9B91B6BC39C67B68F8A /* graphcycles.h */; }; + 13AA86559F2F13BE32BC5A4214EBB365 /* insecure_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = B70BAEFB69553AC1D005302F44AB61AD /* insecure_credentials.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 13CC64623F8B0C41CB049BE397EEE3B8 /* poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = F81C80955C2524D9403AACD52C08FF54 /* poly1305.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 13D5B3C642DB2F9939A2430B11C4B9B9 /* metadata_batch.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 06AEA9EBB3AE752155C0F57EA283BCA5 /* metadata_batch.h */; }; + 140B7C4FADC3A8069EF75AB001CE217F /* md32_common.h in Copy crypto/fipsmodule/digest Private Headers */ = {isa = PBXBuildFile; fileRef = B9B3D3B27E959FE34D601455F52B8256 /* md32_common.h */; }; + 14291D3B71B17FE49A50B694261E5287 /* byte_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 45C2F0C6B6C2D46D99976D4F5529040E /* byte_buffer.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 14518293F3265A6DF7F3242C47EC01EE /* frame_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54F2A42B4B79396E756DCBB00FC730A4 /* frame_handler.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1472D52D59D1A02DAE6687AF70E56A2E /* security_connector.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = BD710511A69243559892D8C1A68BAD3A /* security_connector.h */; }; + 1489EF1C770409B58C86E93662A6E7FC /* duration.cc in Sources */ = {isa = PBXBuildFile; fileRef = B9EA3653E6FF20D4DDEFB9E91D53D9DA /* duration.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 14DC6BE8596D7491D7A6D3148B7F7CB3 /* alts_grpc_integrity_only_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D2E5CA8009634153869F0DEE328F4657 /* alts_grpc_integrity_only_record_protocol.h */; }; + 14DF46261456CDE7D5C6B33BB2484D82 /* frame_ping.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FCC9F65B74D5C5872E549E75D35474 /* frame_ping.h */; }; + 14E4581457C268980D066BD109D23B21 /* symbolize.h in Copy debugging Public Headers */ = {isa = PBXBuildFile; fileRef = 5CCC5E5367E56F38BE20965915C41368 /* symbolize.h */; }; + 14F9C796DEB4C7498A366FA39C68606D /* manual_constructor.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 96C4105852CD35C3281318D5271463CC /* manual_constructor.h */; }; + 14F9F657FC4C208C7B54F52F23915E5C /* http2_settings.h in Headers */ = {isa = PBXBuildFile; fileRef = D98715D72C5137C628810E8610CF3585 /* http2_settings.h */; }; + 151B910833192C850CA5AE1D2CC69FBE /* GDTCORTransformer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEA77321C3EE364949EFE1CDB3037A8 /* GDTCORTransformer_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 152B8EF343E74DF5BB5BA56A4E242F83 /* eventmanager_libuv.h in Copy src/core/lib/iomgr/poller Private Headers */ = {isa = PBXBuildFile; fileRef = 1FF01779B0EF8214DF6D4B5F0C4166F0 /* eventmanager_libuv.h */; }; + 1542E414AA17808E2751917FEC4845F4 /* GDTCORUploader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7576318C5263C6E2401312AF9CA8B55E /* GDTCORUploader.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 154ED51F354CD48FEBA39A5794473612 /* client_channel_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = D18D87A1DA3DB8521F4839C5D55DF080 /* client_channel_factory.h */; }; + 15589A4CA94AB1A83A25CDA2F3BB0327 /* parser.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = 49164116CB43D8D4FDDF652EC9E0B6EB /* parser.h */; }; + 155CAEF660EA953D13548F29CB93F6B7 /* internal.h in Copy crypto/chacha Private Headers */ = {isa = PBXBuildFile; fileRef = D159E2C7037265BFA975BA6B8CE85CBC /* internal.h */; }; + 1564EC368C4660AED847F8A4729DCD17 /* validate_service_config.cc in Sources */ = {isa = PBXBuildFile; fileRef = 725D5529E6CBBAC7D41AA8E72D27DA8D /* validate_service_config.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 157D77480A495B5074539B909565541E /* proxy_mapper_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = ABE54C835DAF515535556B26177BBA60 /* proxy_mapper_registry.h */; }; + 15843EB8B1D028BF279822980A483858 /* time_zone_format.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4ACAB14168EBA607BB36A3359A4A23CA /* time_zone_format.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 158DECDBDA303079E33AE70E2D03587D /* generic.c in Sources */ = {isa = PBXBuildFile; fileRef = BD071376906792B6FE1F55E354D2C4D1 /* generic.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 15C51DE920F3A7D8E61EE2A66E7ABE4F /* raw_hash_set.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 136878A10D9ED347E2C7570C52ECAA3E /* raw_hash_set.h */; }; + 15DBA45FE5EF57E8576414066AD0EB36 /* tcp_server.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE5D386BB6C60A3B504FF9F3CF9E6FF /* tcp_server.h */; }; + 1633A83614618D31D3BB4D2DAF9E6D9B /* validate_metadata.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = FEA6C03ECBC2D9DF2C3AE52F296DCC5B /* validate_metadata.h */; }; + 1648620A191627333651C8A346CDD7CF /* polling_entity.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = F3EF455CA17E8E84151728C5E5636789 /* polling_entity.h */; }; + 1696C38BFBC9261CE163F9AF3666DBA3 /* algorithm.c in Sources */ = {isa = PBXBuildFile; fileRef = 646531900ED79B672D00A847C224AA29 /* algorithm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 169DF0C7757A3C87633DE20F268FC06D /* host_port.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 591AE1DA172C6929AB0FBCE60B206124 /* host_port.h */; }; + 16C67F029FE0325397A71C73FF58432B /* load_balancer_api.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85FCB13A933AE95ACA4A0D34ABD62D /* load_balancer_api.h */; }; + 16CBB270B60DF163833148E1CF0CC66B /* spinlock.h in Headers */ = {isa = PBXBuildFile; fileRef = B1EFE2DBE6BE5918A384AF3B7CDBE9AA /* spinlock.h */; }; + 16CCA5D888CAC13726B29BADCC2B5A67 /* graphcycles.h in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 8839BEFA32CCD9B91B6BC39C67B68F8A /* graphcycles.h */; }; + 16DD985D2159E43F94858B0AC1D51721 /* endpoint_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = 387F772EEEAFE9929148A598D14E6E96 /* endpoint_components.upb.h */; }; + 16F540C105110CB698244EB9390418AF /* time_averaged_stats.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B41BCAD368F263C1DAB21DC55094978D /* time_averaged_stats.h */; }; + 16F875407721D69BD97A0F4D6F7C2ABC /* socket_mutator.h in Headers */ = {isa = PBXBuildFile; fileRef = 4489DC4322E7344AA9026192381DCCE7 /* socket_mutator.h */; }; + 16FBBF6D87D1EF120B781FB36EC48827 /* xds_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 58C239FC8F94B514BB08EEAB2C2A1466 /* xds_channel.h */; }; + 1700F6791C5A181A525BFE94F77D316E /* gRPC-C++-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 612E8210AAE6FCBF0104313A09CE11CF /* gRPC-C++-dummy.m */; }; + 17037CC6520E902C2CC8CE9DDB399A74 /* census.h in Headers */ = {isa = PBXBuildFile; fileRef = 420809A3D84FCAC2EBDFC5C553797560 /* census.h */; }; + 170DA69853D786E74E1CC8930F2FE65F /* mpscq.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2444F8514711F64A3BDF8DF7E4CE0C3A /* mpscq.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 171C34521B5B8AF4BD85DCB43AF1195E /* time_zone_posix.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = 09C3C84EC1B221EB2D8C3E9EC0F80F54 /* time_zone_posix.h */; }; + 1738AF8644835F406DFDBEDD16D6EF1B /* internal.h in Copy crypto/fipsmodule/rand Private Headers */ = {isa = PBXBuildFile; fileRef = A7739F4D6C512681D9041B61D69A26EC /* internal.h */; }; + 179167FB0F4EB3CD5FF41028F076F273 /* resource_path.cc in Sources */ = {isa = PBXBuildFile; fileRef = 777851AFE7FBE6DF0100814A133DF4C4 /* resource_path.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 179E2D22F6F22A6FD813D2C4FFD3F1D6 /* slice_hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D3AEDEACB3E48C54383B8817562AF5 /* slice_hash_table.h */; }; + 17B57DBC6AE7B31C49D0ED650EDE9AAF /* thread_annotations.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = ED3475FDAC93B6337A48DB0BDDFEC7B6 /* thread_annotations.h */; }; + 17DA4AD0608DE08300A8C7125E6B7C04 /* hashtablez_sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = A0DE184EB41FEA223F6492A632199C78 /* hashtablez_sampler.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 17F3EFBF71C02FF8CFDFF336F30F0CDA /* des.c in Sources */ = {isa = PBXBuildFile; fileRef = A408DB590FC2671D29D819A5E0AFC244 /* des.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 17FE3D764F79DD311D3F4C8C4525A1D8 /* FIRFirestoreSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1628A866AD0775C2468886C7793BF8D /* FIRFirestoreSource.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 1821DBE5D06C4B174A86C663EDBAEAF6 /* a_enum.c in Sources */ = {isa = PBXBuildFile; fileRef = E59707D59AE75973A10A4FEB4B5EE371 /* a_enum.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1832251F24A796515716A3D5C1A23FD2 /* subchannel.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 515DE99E1A2781FD19819BB61560931C /* subchannel.h */; }; + 185F9FE0FED9734A16DDE865C062F9C5 /* method_handler_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 70C5F5487C3D0BD41B86188E5A468273 /* method_handler_impl.h */; }; + 187891219618CE9BCBAC30DE8082C40A /* base.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = EF76B11D8DE5C0B489E5BA1A585CE327 /* base.upb.h */; }; + 1887B32B7F31A4240AE717C9502AD131 /* gRPC-Core-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE95C90A183B979359C3332736A83CA /* gRPC-Core-dummy.m */; }; + 189D3BF41D2B6E3B1865C01CDD5830D8 /* call.h in Headers */ = {isa = PBXBuildFile; fileRef = 40DEE50F5C979D98AD4B7C60CA18F339 /* call.h */; }; + 18A66A51C226E7DF5384C09C584914DC /* a_i2d_fp.c in Sources */ = {isa = PBXBuildFile; fileRef = E52E34E0DCE9C7D5FC1DB65A3342BEE8 /* a_i2d_fp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 18AC59919E7707740C598DCFA4572B3F /* jwt_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 063EF7B4806888581BA77122A4F21388 /* jwt_credentials.h */; }; + 18DCD8EA9725F74ABB54A8DABEB867E3 /* pollset_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0478D5B0634B84EEF2E8701F70276541 /* pollset_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 18FC79303B6066A8B7ED3830F5F5FAEB /* tls.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = A134C344D0C9DFC454147CCD53BC78A3 /* tls.h */; }; + 190000D5A66E0AB62BCA74D58D8BD37C /* async_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 335ED1B7339A2C331EAC0F23CD0F6CE1 /* async_stream.h */; }; + 19084CA4DFCC54BF63F40B938607316A /* memory_remote_document_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB869D4BFD5457DED0E553A84AD1B85E /* memory_remote_document_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 190AA33CEEBC74D438AAE557C49871C5 /* chttp2_transport.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = B54562C4D96285F5ED299FB73E775591 /* chttp2_transport.h */; }; + 191F7BD6BA85165D3662DA7D0116AECE /* local_store.cc in Sources */ = {isa = PBXBuildFile; fileRef = DD7170ED59976060BDD36AF18E08263A /* local_store.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 1922A7278EE1CF86388B0E54E0AFA8A0 /* grpc_tls_credentials_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = BDCEC0B20E171A7777A851872F76C946 /* grpc_tls_credentials_options.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 192F6D789C61017A62623911FAF97787 /* FBLPromise+Delay.m in Sources */ = {isa = PBXBuildFile; fileRef = 12581C1A84F6E01443F65CECD59698AE /* FBLPromise+Delay.m */; }; + 193A29D292DC4C39BB4B9A4CBBD3FB40 /* iomgr_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C9DBE43E371330B98DAD14A7381D02A5 /* iomgr_posix.h */; }; + 195C0F642355D67B3DFE7D13C4208819 /* check_gcp_environment.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 7AE6E2132EF7656B6810B0DB4FC5610B /* check_gcp_environment.h */; }; + 19700895FE52BCA27614AB57C0B01566 /* xds_api.h in Headers */ = {isa = PBXBuildFile; fileRef = 92244E328E16F05C5111104617F374D6 /* xds_api.h */; }; + 198F84590966D3B7C1C9A24F647691A5 /* xds_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D9C9C8C7D2D1FC075A8681CD1A76DB /* xds_channel.h */; }; + 19955FC242B861DAF6B921D41B0292E4 /* completion_queue.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 620BF7A8931A330D38F19B2087BEB8AA /* completion_queue.h */; }; + 199B16DF2A3165A512C79388DAF90388 /* FirebaseFirestore.h in Headers */ = {isa = PBXBuildFile; fileRef = 98C1AA8E250C05999AE180D81EBAC056 /* FirebaseFirestore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 19A8073402D30374EBE456F22EA9F0B1 /* client_callback_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = B7AED7340CC7A33CFA21702DB0C5689F /* client_callback_impl.h */; }; + 19A9B598C75DF7A5562491557281F6C2 /* nameser.h in Headers */ = {isa = PBXBuildFile; fileRef = FD84F7B7BE1474B065538076FF17D61C /* nameser.h */; }; + 19CDDEA58C2792CD19CE2172B596BB52 /* any.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 182541468796261FF9A289D16ADAE3B0 /* any.upb.h */; }; + 19DAD49C4177DECDB7C9B899BA29EA44 /* FBLPromise+Race.m in Sources */ = {isa = PBXBuildFile; fileRef = 8864C298C949190986138E5DA22979B1 /* FBLPromise+Race.m */; }; + 19F6D0DEC76230AA2E8AB57C07C03CE2 /* workaround_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = EC23E1FF77631092AD8625A0D1DEC048 /* workaround_utils.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 19FF6F159742AD5A270AA2ED4F1394BD /* ec.c in Sources */ = {isa = PBXBuildFile; fileRef = D85289894E8862DBDB54E67174956DFB /* ec.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1A092C153DCD332244D514D299227A32 /* alts_grpc_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6402D7673B28ADD5BACFD6E7736EF8 /* alts_grpc_record_protocol.h */; }; + 1A0D5AB4CBB27968DAA032D292B5374B /* ref_counted_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FBF2A1D0779AC838966FA963A60243F /* ref_counted_ptr.h */; }; + 1A2C7D440BEF417D4F8FB59EA4E7DC4E /* workaround_utils.h in Copy src/core/ext/filters/workarounds Private Headers */ = {isa = PBXBuildFile; fileRef = 5B063DBA267CCBF3589F709A1C0737DC /* workaround_utils.h */; }; + 1A3E4805CE6258106794C6137CF6C9FC /* retry_throttle.h in Headers */ = {isa = PBXBuildFile; fileRef = 25285C8F555AFD60182DB33AEC9D10BD /* retry_throttle.h */; }; + 1A5DB05A05D9FA5FD53F3A892A8FD665 /* host_port.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2FCAC336BC66411001319E2B41742D39 /* host_port.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1A624680DB0ED7E8B3BF6BF6428DA856 /* span.h in Headers */ = {isa = PBXBuildFile; fileRef = AEEFD2B8E48EBF0EC01E473ED36CF46C /* span.h */; }; + 1A6A5F4F8DBCEA81E476EDDACDA9195D /* load_system_roots_linux.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 3DE46C3FB48C77001FC457A97887CA79 /* load_system_roots_linux.h */; }; + 1A9596CEFA887D4250DDD176CC81027F /* civil_time.h in Headers */ = {isa = PBXBuildFile; fileRef = 41C3CC91C81D99B78AE2C88C52BA8008 /* civil_time.h */; }; + 1A9CE0C5CE7B290CD42790A885F461B4 /* subchannel_interface.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 7A99561B4F8B50B1BF0C7246EC47ED83 /* subchannel_interface.h */; }; + 1AA72DFB277F41BD2F2282BC06846AAA /* GDTCORReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D786ADEA083DF91413AFBC3EDD789DE /* GDTCORReachability.m */; }; + 1AB222A8536808631248234D21D4EAD8 /* scoped_route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C09B3C005F0FD627C3EA4FE43FB8733 /* scoped_route.upb.h */; }; + 1ACCBF6D0F4C86F5EC5561D7458E9ECD /* transport_security.cc in Sources */ = {isa = PBXBuildFile; fileRef = E0202AB9C2BE82FB974F97D991082699 /* transport_security.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1AD5C8DBFF9D6DA2541991C4A1DABA57 /* sync.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 2355F60BE4168BA33B86EE4132C62B08 /* sync.h */; }; + 1AEEB449193382B9F632EA45AE1715AB /* metadata_batch.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 9A92C5E558F98A6C5A2854E3C2A359BE /* metadata_batch.h */; }; + 1B0755B176507652C3A3FE3686E3AD4E /* hpack_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CC8110A37ACE35506B4F0D1694ABB09 /* hpack_encoder.h */; }; + 1B1B7D3B0AD94F0AC27F50A8D2AC1F10 /* port_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DB24AA72A09D1E97E91A8763F9C818 /* port_platform.h */; }; + 1B1EABCA2C511554E77471B412A4F201 /* query_listener.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9596881B1C2E57E2C75A0D4F5BED873F /* query_listener.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 1B3843D6BCB3C4E6599224CB664359DE /* exec_ctx.h in Headers */ = {isa = PBXBuildFile; fileRef = DB0CFE7A7ADD0167599DDCCD40326A48 /* exec_ctx.h */; }; + 1B6725629C46262D7E5C162147B47562 /* stats.cc in Sources */ = {isa = PBXBuildFile; fileRef = B197426E1F2BA4126249B4F6F23CC355 /* stats.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1B6A0081CB4856A930907889DC16F9FE /* FIROptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C50E5CAB53FFB09E1D1629A07D1781D /* FIROptions.m */; }; + 1B72A542B1AA161B62801A7F2A5877E2 /* GDTCORUploadCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F1069D612BA4932C4D69EF2F691684 /* GDTCORUploadCoordinator.m */; }; + 1B7F7A21FA36C242B25D5D29F0C625F9 /* call_test_only.h in Headers */ = {isa = PBXBuildFile; fileRef = D3A883C23B120624F2B440E7EC31025E /* call_test_only.h */; }; + 1BAE3309EE2CDE12CC686BE7FEA8D77F /* resolver.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 06401BF37C71D3F6E123CA93029A43B9 /* resolver.h */; }; + 1BB1CE7682527F1154A5EC5D4F9E773A /* timer_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = A7664361526A49829A2FA341E4FA9125 /* timer_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1BBB1003816552271E914EB9CC226D80 /* config_source.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 14E4A19A16AF63A3B22B7B25B6D4B1A0 /* config_source.upb.h */; }; + 1BC99150B3C9DB2426A9E19CA57C579B /* FBLPromiseError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4992652E6E36FA640AE080039A589DE5 /* FBLPromiseError.h */; }; + 1BCC635368000ECF480518086D50AB6C /* bundle_serializer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F8E11C50BD04C40064F5C2E82B24D57 /* bundle_serializer.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 1BD113211A5B4C548F5A74C0BD73ED81 /* byte_buffer.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C3040637B0E10661A176331DB6893688 /* byte_buffer.h */; }; + 1BF1EA11ED55DF4E74727525C94D94FA /* debug_location.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 5A7F1F93DF989DA34F744C4EB2B4A362 /* debug_location.h */; }; + 1C0A692FEE45E0EEFEDC21FD47B1A4BF /* wakeup_fd_pipe.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 7A290933D22627E2926DEFF22D4A65B2 /* wakeup_fd_pipe.h */; }; + 1C40FF0800197DD851BC73690FB3B155 /* init.cc in Sources */ = {isa = PBXBuildFile; fileRef = 33E2F328D4847E3AE8230CBB7D65CAE5 /* init.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1C533C395DDEC0B159D61F007245C01D /* compare.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = 494B5FDC07A2EAFAF88CEAAFC0064DE1 /* compare.h */; }; + 1C656F35F83F1D490D7AAE6F83B502B3 /* internal_errqueue.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3B6D0B6124F9D512DADEE6AAEA03DE4B /* internal_errqueue.h */; }; + 1C782597849DF4A328DCFEE5254F9105 /* discovery.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B6EA6E949BB67E282815367289D96D73 /* discovery.upb.h */; }; + 1C9A00E48B621C71B1414F2B6297108A /* random.h in Headers */ = {isa = PBXBuildFile; fileRef = 37D83BCA4B74EAA5091357A0E62C8824 /* random.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 1C9CFA2F4F618B2A42BD10C39E88FC38 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = A83F0196F20B53667FD9CA38AB6E3735 /* printf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1CA1F2A5CC09527EE390CF9C4E5A5AA3 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = E36E31D6EAB2B8AABDAD98B7179BC73A /* port.h */; }; + 1CC195052C961E210623623C3155067E /* socket_utils_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 304D0D9E970F0C33AB6FF953B13A6A08 /* socket_utils_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1CE4B5D714CA91FCD1F19A68171C0940 /* digest.h in Headers */ = {isa = PBXBuildFile; fileRef = 940C94CA3A6B8836C7377E1BED8EFB97 /* digest.h */; }; + 1CFADA9A4108B0218EB1DE1B98BA9931 /* err_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 6CF41C3CCD8ECFABDD0D40690DEA0917 /* err_data.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1D01DAF087A2B01D469EBC1FF2BED114 /* timeout_encoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C37954346423A50630887B3B7C56C42 /* timeout_encoding.h */; }; + 1D032C12D9CEAACC805A5CB5DA8FFDC3 /* dbformat.h in Headers */ = {isa = PBXBuildFile; fileRef = FAFF8B74EDD34A5975FAF06BFC522FCE /* dbformat.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 1D06DE231C29C1A4B3C6B962B7810BF3 /* civil_time.h in Headers */ = {isa = PBXBuildFile; fileRef = 66E112BD27CF895BC81D63432C53B66D /* civil_time.h */; }; + 1D0DCBC95932F751B2B695D706D04138 /* connectivity_state.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 0B0E5B3C7D3A20D188AD4592B218893B /* connectivity_state.h */; }; + 1D24EC6C9C04B97388286B8FE862F1CB /* api_trace.h in Headers */ = {isa = PBXBuildFile; fileRef = FA833410DD39DA0A15099F28876AA2AE /* api_trace.h */; }; + 1D277583E14E969BF491D897427D6012 /* lds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B4CC9C6128D4CE90F7156B239AF1A4A9 /* lds.upb.h */; }; + 1D41A27A8D4EDEA3056A3A3A5335909B /* empty.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B93C5630D5435A7B6CBB7527395BE2CC /* empty.upb.h */; }; + 1D5D9654835827BB486F0F149129E69B /* global_config_custom.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = BB6F9EAE8F8836E40C9E2A82CC169BF0 /* global_config_custom.h */; }; + 1D71BD2F2149F64EFBBA2E95C923B438 /* utility.h in Copy utility Public Headers */ = {isa = PBXBuildFile; fileRef = 7B494F5BF50EAC5CFEC559B42BFF63D4 /* utility.h */; }; + 1DA16669E71B64096D9BA5CA76BAB3EB /* client_auth_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = DF4B8B07C5FB3D7F560906F99E7C11BD /* client_auth_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1DE237317FEE1F4FF1958290DCAD9CB5 /* exponential_biased.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 1F19ABCC9A33949E6AA707BE381643F4 /* exponential_biased.h */; }; + 1DF0ABD3625C67BE044B752243B90436 /* proxy_mapper.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 65679A6AFC13DD9CFA432F38F3740361 /* proxy_mapper.h */; }; + 1E004A88622F017B5964425A703FEFB0 /* FBLPromise+Async.h in Headers */ = {isa = PBXBuildFile; fileRef = F6E08C93F5F2F4F59EE7B367B27393A9 /* FBLPromise+Async.h */; }; + 1E0A18BE13A655FCB2DD3D7FEB219E41 /* FBLPromise+Race.h in Headers */ = {isa = PBXBuildFile; fileRef = 109216868B5292A6CC5C2D7CB5C1A515 /* FBLPromise+Race.h */; }; + 1E369942B97345B492AD864EBD95885F /* a_utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = 3E52B8C90E0E8705D6658CF6414BF091 /* a_utf8.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1E434B9EF251A793D0D531D0E56748A3 /* static_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = A58B6CF39A3BF9233150B1782155AAB3 /* static_metadata.h */; }; + 1E43CE959195520AA4DCC81527DC667C /* channel_args.h in Headers */ = {isa = PBXBuildFile; fileRef = B118489EF3EF65E06D3BBD8008A80060 /* channel_args.h */; }; + 1E4B0D522E9B94A74CBA7996A7A20F88 /* stacktrace_config.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = BD5476FE3953EBF5D8B40E5116155D11 /* stacktrace_config.h */; }; + 1E61AE7741D39D44F71134E4554619BC /* unaligned_access.h in Headers */ = {isa = PBXBuildFile; fileRef = D1C06AFBB8E1E289E81583A7A7D7A627 /* unaligned_access.h */; }; + 1E77F63DBB76EDC56CFF8C7A54C45B54 /* bind.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = E37EC012998CA28B611BAFCCBE9FC28D /* bind.h */; }; + 1E7A5CF9DD01D200DB25EB41A642B835 /* transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 66C61EEA309F1EB978F31EDA3CDEDE16 /* transport_security.h */; }; + 1E7B717347D70DE20584F0128D752599 /* grpc_tls_credentials_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AB2E69E5DB61D8356BFEA7C7E53BA43 /* grpc_tls_credentials_options.h */; }; + 1E7BDD2B804CF891A4FB14FF9DB60A61 /* proto_buffer_reader.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 3B9C02065259D4ADE30BA766B7D414A3 /* proto_buffer_reader.h */; }; + 1E946D985D3699B8A9878C4D01AF85C8 /* socket_utils_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1A67E4874AE7708C0705896C235FAD59 /* socket_utils_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1EAAE2D1B70AC97A4A768521FA5BF68B /* hide_ptr.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 09C4E2E4D95944579FECE037FDA0205E /* hide_ptr.h */; }; + 1EACA49B81705DF50ACD6AB906981334 /* connectivity_state.h in Headers */ = {isa = PBXBuildFile; fileRef = AA95BD5E58480D50DD1606867D204B39 /* connectivity_state.h */; }; + 1EB2E3036B76DCBCF9EEE3546C726BA5 /* civil_time.h in Copy time Public Headers */ = {isa = PBXBuildFile; fileRef = 41C3CC91C81D99B78AE2C88C52BA8008 /* civil_time.h */; }; + 1ECA7D9EBD27C0AE07E8C2F9311B313D /* f_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 786D44E350C930D4AC1EAE0FABDF28E8 /* f_int.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1ECA88801001F8FF0628A30E892733C4 /* message_size_filter.h in Copy src/core/ext/filters/message_size Private Headers */ = {isa = PBXBuildFile; fileRef = AC3AEC3251AA008CCF6EF8411B38908D /* message_size_filter.h */; }; + 1ECC4AA326998C9EBA7B530E87022C17 /* ssl_utils_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 24E19AC1A5E10778F7EC1F07D8952891 /* ssl_utils_config.h */; }; + 1ECFB7975BD4CC716FF569385BB3CB3D /* resolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 06401BF37C71D3F6E123CA93029A43B9 /* resolver.h */; }; + 1EE4465574876BB277C2B0A6E9A36F84 /* FIRQuerySnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = B0E7FBCD229FDC32936600AFD1544DB2 /* FIRQuerySnapshot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1EF9285173394F74C82E64E4D0BC6B77 /* generated_util.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 52F81BD932E7877CF6129978D9768500 /* generated_util.h */; }; + 1F1BCEE650C2AD57C9AF16203C2832E4 /* struct.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4A9BA2F1E9E5133693F4542C7F2C17B5 /* struct.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 1F21D6F0AD9A130D097F93C88948BE35 /* custom_tag.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 0989B29C0D36FEAAC9D3493CAF8910D3 /* custom_tag.upb.h */; }; + 1F238ED263DE7F8AE88C556457031F14 /* time_averaged_stats.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 0A098371DD345940D882B0DA9BDEA385 /* time_averaged_stats.h */; }; + 1F23B6B6DFB444046E223FDDAEA835B2 /* regex.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2647BEA98C98B5C71539F80A83017838 /* regex.upb.h */; }; + 1F41FF0D84296B1C300E4AB93D11541D /* FIRDocumentReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C230BB84FAD9936159B061CA51C52C3 /* FIRDocumentReference.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F442A370317C2988D01F8AD987FAF64 /* server_credentials.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = 725C58F525929D4EF7DCBA63ACE87C49 /* server_credentials.h */; }; + 1F802EBAEDF705E9B0151F760E087163 /* secure_auth_context.h in Copy src/cpp/common Private Headers */ = {isa = PBXBuildFile; fileRef = 879D1366693D17BFFD22A9411AA44EE7 /* secure_auth_context.h */; }; + 1F89D87CF5AFB9550A674C3CCEB720A5 /* frame_goaway.h in Headers */ = {isa = PBXBuildFile; fileRef = 379CF150978B0F5A23E159DC42331CCB /* frame_goaway.h */; }; + 1F8D45CD7C3A5CB1EBCBA5FE133D80C9 /* propagation_bits.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 113438DA4A8791BAC897914815DC34DC /* propagation_bits.h */; }; + 1F913EE7E4A809C83D2E4C57C742C3FD /* alts_tsi_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = 10D0D92283FDFA365217D785982D524A /* alts_tsi_utils.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1FAB69D1FFAE665ECDEFCB8F364FBB08 /* route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D13BA5906839D71C59B4B8E2AFFB361 /* route.upb.h */; }; + 1FABF2DD6E9645AE6AF85E153853832B /* unscaledcycleclock.h in Headers */ = {isa = PBXBuildFile; fileRef = C61C247E80D4D023E85484ECD546AC0B /* unscaledcycleclock.h */; }; + 1FB1D122BC07EEADC03AA890479D333F /* sync_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D80A7EDBE3547565F2D296355827193 /* sync_generic.h */; }; + 1FC169B734D2FFDA40A443EBE3501EDA /* alts_tsi_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 760B8EC06583C79A3F1830C4E17AE723 /* alts_tsi_handshaker.h */; }; + 1FC9C77BBB53385CBFF9582C3F0AAB73 /* json.h in Copy src/core/lib/json Private Headers */ = {isa = PBXBuildFile; fileRef = DD41F1702EEAC76E0B5B7262243DE517 /* json.h */; }; + 1FD00FE0F755D8D160568D8DF3C39FB1 /* alts_shared_resource.cc in Sources */ = {isa = PBXBuildFile; fileRef = F5EF88EDBB1929F1B730A4C4243898B5 /* alts_shared_resource.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 1FDA63BCFA3AD6DBB748EA53842CEDCA /* wakeup_fd_pipe.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A290933D22627E2926DEFF22D4A65B2 /* wakeup_fd_pipe.h */; }; + 1FF0547B60A1531C531C0786E035A2C5 /* backoff.h in Copy src/core/lib/backoff Private Headers */ = {isa = PBXBuildFile; fileRef = 1DAD54AEFF45B76E2F97203CD59A4543 /* backoff.h */; }; + 1FF8D5C418E0AF17411F2557603EFCE4 /* time_support.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E351D23705876BAF11CE8239D710C4B /* time_support.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 1FFA2B427959278E94E0FA9C8B781F00 /* env_windows_test_helper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C3EB4A0566A8607AD43E870FFDE536A /* env_windows_test_helper.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 2004D2BA7AEB5646E8646F3453220941 /* orphanable.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 3952840104A502E94C594E0BDB896FC0 /* orphanable.h */; }; + 2010FA47FBC54175BCD2E130DC9C2327 /* grpc_library.h in Headers */ = {isa = PBXBuildFile; fileRef = F2BCB5A6E163E223AB4EC37942EC748E /* grpc_library.h */; }; + 2022C7A30FE3AE9D46FAB18F3E10D6B3 /* tls_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = D1C641E80759BADEC2646F8FC15CB346 /* tls_gcc.h */; }; + 203AF4EBDAC76E6A8719BC01DF705849 /* resolver_result_parsing.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A80269127372F74B3C44097DCF9430C /* resolver_result_parsing.h */; }; + 205631A49B5002A74844294EAD1397AB /* health_check_service.cc in Sources */ = {isa = PBXBuildFile; fileRef = DA57813EC2D1D105BD0FCCDF156303C2 /* health_check_service.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 206FE48FF30653AEBFCD1569B0ED5EFD /* timers.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A4083889D69AAA6415523B376A782C5 /* timers.h */; }; + 208248068C87521446CD790C2DCA4A09 /* poly1305_arm.c in Sources */ = {isa = PBXBuildFile; fileRef = FC0DE0D534542BBEAAAC40D5C26EC014 /* poly1305_arm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2082DE929B3EC77AC6ED5C7BB2D81DED /* aead.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 85FEB2491ED23AABC904F7B1B658C7D8 /* aead.h */; }; + 208BD72D3A2562115950EB01220A73FE /* metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46C309C9CF31A4465FBC856BF4A71298 /* metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 208E2F366144FA0CE6E3C19630752C8C /* proxy_mapper_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9AE2B3726976A1847F298F3A3E47041E /* proxy_mapper_registry.h */; }; + 209B05A223DD36E092E0DAFE6AC1AB37 /* avl.h in Copy src/core/lib/avl Private Headers */ = {isa = PBXBuildFile; fileRef = C43DF0BBD4AAB949A2BACC8206E54CF9 /* avl.h */; }; + 209E065A6E80F801F1DABB3A331CCD3B /* gethostname.h in Headers */ = {isa = PBXBuildFile; fileRef = B58036161C7A30DF610470F176CC308B /* gethostname.h */; }; + 20A17A3024706B69480A89561DA76B9E /* grpc_security.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 1319E85F66E15ADBAF6C9ED31849EA68 /* grpc_security.h */; }; + 20A1B7E39BAC2E9FD46F2B84D3F5D521 /* srds.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 66B6E75D106679E1527BAD1A3703A794 /* srds.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 20A5B332E8DBB71A08D459234B8BE375 /* generic_stub.h in Headers */ = {isa = PBXBuildFile; fileRef = B521EB4F00263E53A42457E5355945FB /* generic_stub.h */; }; + 20ABC99A12E03CF79580FDB25B5A38A6 /* timer.h in Headers */ = {isa = PBXBuildFile; fileRef = C1BE46C4A61415F111C103DAC90A8336 /* timer.h */; }; + 20B5C175E309AF48CA77B6E5FF040927 /* tsan_mutex_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 529FFBD228E87DBA888ED9C5ECD2B492 /* tsan_mutex_interface.h */; }; + 20B6B86DDC1A866619ECE2FD08714AB8 /* cluster.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FD3F5FD722AE7C27691ED3E992EE06B /* cluster.upb.h */; }; + 20BAA8F63C7FBE52A24FE1B46BC58963 /* global_subchannel_pool.h in Headers */ = {isa = PBXBuildFile; fileRef = A0733CD04448701C39EEA1F5C0270133 /* global_subchannel_pool.h */; }; + 20D4D06BC7CCFCB90B2898921136CB65 /* gsec.h in Copy src/core/tsi/alts/crypt Private Headers */ = {isa = PBXBuildFile; fileRef = 9AD01CBC19BBBB43A67E6767D3181791 /* gsec.h */; }; + 20F69DF34FDF2BE4FF4FEF278C7A8B50 /* frame_handler.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 16CE1112F5DA7855F8D9CAD46BDFF5CC /* frame_handler.h */; }; + 210973B4A9B2E313E5C91F01E5258293 /* user_data.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2236B991AD1D74EDD3775EC6A52E15C /* user_data.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 21161B331ED4BEA1826EBE3CEDEEC1B5 /* slice_string_helpers.h in Headers */ = {isa = PBXBuildFile; fileRef = BF975F8D02AE3175AD21B5BED7FDC2D1 /* slice_string_helpers.h */; }; + 2147EE673BEDBE89AC14921733DFA3BF /* buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9710FFE0600759BFF531DB88EA62873E /* buffer.h */; }; + 214E4A22A110CFA55A09C7DE617CF84F /* d1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 69D84BC6F7EFC75BD6AE7026624BF864 /* d1_lib.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 215E66B16421B3A8BEFBBA291F228836 /* spake25519.c in Sources */ = {isa = PBXBuildFile; fileRef = F7D23F3C861BDA5EE61D19CB89AE8C05 /* spake25519.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2187DA6F456CADFE6671A1130C378D2C /* iocp_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 2970A316BF1BFE4C0942C083FC524E8C /* iocp_windows.h */; }; + 21B6212299417A743676B00B815214AE /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 49164116CB43D8D4FDDF652EC9E0B6EB /* parser.h */; }; + 21C38DA2B0B57B1F35097C0B67C55240 /* format.cc in Sources */ = {isa = PBXBuildFile; fileRef = B9A8DB63C9E6BC478B02C6A286D5CC84 /* format.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 21CCF59FCC1FAE3DC5783D9B1EA11F14 /* geo_point.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB7CEB9CA802E896C51E550B87E62C31 /* geo_point.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 21CE1C7FAE9EC0553D6DDE303053E19C /* config.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 51C721B724E5E995C8911EB0238842E6 /* config.h */; }; + 21DF880714E351E9A3B60B1F53FB74BF /* byte_buffer_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = D0B0558C216DF889DD5871BF99B38DC0 /* byte_buffer_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 21E3930F64370394B29273255D55B7F9 /* cmac.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = AE7C373BBF03293FB30EDAD11BC6CE5A /* cmac.h */; }; + 21E4D6389E6B496035684D74CFE6E596 /* lb_policy.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CBFCA714C8EEB4F70F7C99676C4B0B5 /* lb_policy.h */; }; + 21F4E70A8E03C6522489DC42C1898E7A /* alts_record_protocol_crypter_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F4CDC11C5CE10922CC54F8623B421F06 /* alts_record_protocol_crypter_common.h */; }; + 21F9C1BF1CE5C867EF1CD94520B57C94 /* listener_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB4897CA1EA2BA8F99CEDA4B79794BD /* listener_components.upb.h */; }; + 21FE6EC1A55E54598CA4D6D37671BB19 /* endpoint_pair.h in Headers */ = {isa = PBXBuildFile; fileRef = C8F580082C4E97246CBB58D8E9E5043D /* endpoint_pair.h */; }; + 2204B1FE5BF3E580F0C9EA09354E486B /* security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = BD710511A69243559892D8C1A68BAD3A /* security_connector.h */; }; + 2219B59322E43256C6A81DE0F948FE66 /* stl_type_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AB52674FB7A979DD7A36DE61C1031E8 /* stl_type_traits.h */; }; + 222C63C08FAE091C6EF6031367844CE3 /* FIRFieldPath.h in Headers */ = {isa = PBXBuildFile; fileRef = F29FAC3B039690DC69E6AA318A91F7F9 /* FIRFieldPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 223487ADB2A7EA306323CA284E75A59C /* firestore_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB863D3AABBC8C31F4D6DC0ECBEF88A6 /* firestore_client.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 223DC4E4EA57FEDD17E7AB6A1BEE1B13 /* key_field_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12E88198C7188136050F950CCB88F22B /* key_field_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 224B90D23F046893ED010DF351B1EA93 /* sockaddr_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46E965579B7EFFEA4F99E621F0BBEDD6 /* sockaddr_resolver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2255ACD8E004DDF7B7FD8599B6A733D3 /* FIRBundleUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 263E8B399A92FFC41F51FC5A7A9C50BE /* FIRBundleUtil.m */; }; + 225E5273BC35C029A4779A7134F9989E /* key_field_in_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 064C4268209BCBABE36F35D6DB7B565B /* key_field_in_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 225FF1872B085ACE873AD6795F6BD9E7 /* dynamic_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = 657901658F4CB37D372FC3801030D114 /* dynamic_annotations.h */; }; + 22629715E4347B4C00861E6D507C2D48 /* table_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7D8D6088A70D6AB4121D10AC4DABF491 /* table_builder.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 227115C8B3354D40539661ABE8671767 /* client_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 42E71288C15E81D916D729C6D0019521 /* client_context.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 2273006ACB36C6B191DF573B4C35C515 /* server_interface.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 46D6B082B1EA2B1ED9216CC06A2EF706 /* server_interface.h */; }; + 22855CBF5305FB9ADEB20234538C1C94 /* work_serializer.h in Headers */ = {isa = PBXBuildFile; fileRef = B6E5DB5B9ED2BB4E09D66C69B3AF2FAA /* work_serializer.h */; }; + 22A72911C78290AF4BB28E0DF3498A38 /* api_listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AB2A5FD7F9BE7FDD0A2919849E6BA1D /* api_listener.upb.h */; }; + 22B690BF90D7A06F0FFDF7A4F8B46DB1 /* mutexlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 39426085DB1BB35CB175995B81EA8656 /* mutexlock.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 22CBCFF56F954A149DDB45451DF37063 /* dynamic_thread_pool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5680DD2CE8D36A8B0DDFDACC0CCD8CF9 /* dynamic_thread_pool.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 22F0309EB4EC20504A5DF41DC6B12EFB /* json_token.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1477923DA3F1B02293B4F16364561C13 /* json_token.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2307EAD56E5F8160A169361D14B54BF1 /* alts_security_connector.h in Copy src/core/lib/security/security_connector/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 989C399F3BCDD02547BB58C53307D5A8 /* alts_security_connector.h */; }; + 230E268078EFB1F4822480647EFA8F6C /* grpclb_channel.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = E396080735EF6DBEBC78DF1530D6010B /* grpclb_channel.h */; }; + 233FFAAB5D29B62CA2306A14D73E14D4 /* deprecation.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0F85E01AC964655BCE72E2314B9B7A /* deprecation.upb.h */; }; + 2382524F146F4107111C5CF6ADD53B97 /* pid_controller.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 3CC21FF44E36769D74D00B7BFF5A569C /* pid_controller.h */; }; + 2395634D2BAEB1AB0BDA57DFF881FA46 /* event_string.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 3FDE2E76DEFE8E85CFD4755F929091FE /* event_string.h */; }; + 23A1B93E78E8C04FDE6A894B7FB27F03 /* tcp_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D3620E8112ADA52D50236E9C708EEB6 /* tcp_client.h */; }; + 23CCA94E06C4BDED4257077D5E7DA817 /* handshaker_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 3486899FD16BD9A45BCB1987AB4B2F84 /* handshaker_registry.h */; }; + 23D0C1DD2795076AEA619BC927001CE6 /* sockaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = 9079CFE7F4F28E98663140AF17AB39CA /* sockaddr.h */; }; + 23D40F3C97EE2D4FA7279161EEDFCBB9 /* flow_control.cc in Sources */ = {isa = PBXBuildFile; fileRef = 25A6818872B9D1654FE68E68B22DA7C3 /* flow_control.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 23F9ACA6B99A8005D9FBFC101E5CAFA7 /* stack.h in Headers */ = {isa = PBXBuildFile; fileRef = 232F344E78212307EEB43DE166DFB1E9 /* stack.h */; }; + 2405B9D41B9528DDDC0FE2316F7279E4 /* internal.h in Copy ssl Private Headers */ = {isa = PBXBuildFile; fileRef = B5FEE16484BBD246D925229DB5F5312B /* internal.h */; }; + 240F7FC48BBE97D6F1847CBFE8C05410 /* get_current_time_chrono.inc in Headers */ = {isa = PBXBuildFile; fileRef = EAF81A6A3D2B449128E7B49128E989E6 /* get_current_time_chrono.inc */; }; + 24182CA2CF1A1996081B8AE430B45BD4 /* utf8.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 2F581468D54E778E32D3BDA3B68F82D5 /* utf8.h */; }; + 241D497FA05AAEA7E4C4C3472A1304B1 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F6828B80F8240092CA6683D028CD7FC /* internal.h */; }; + 243C1F78C113795B0A55C177EAB0746A /* port_def.inc in Headers */ = {isa = PBXBuildFile; fileRef = 6B4E8AF8FB86A15BDCA4002950C15A3C /* port_def.inc */; }; + 24548D0EE6BB7CAA98DB527271535929 /* FIRQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FFCED5A0CCC2D40E4F4DC4C276FF66 /* FIRQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2462F2B3CD3E5FE957D8E4C1DCF588A3 /* blocking_counter.cc in Sources */ = {isa = PBXBuildFile; fileRef = AC75C664ABCE97A506988ADCFB047624 /* blocking_counter.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 2479841C934FA3CB7F757FA03984BFF5 /* str_join_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C678F46438323BBCB4A050D20053D017 /* str_join_internal.h */; }; + 248D853BCD4A8F7D11BDB044E6DE8642 /* alts_grpc_privacy_integrity_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F647CDDC588AADF1E6A54C30B1AC6E0 /* alts_grpc_privacy_integrity_record_protocol.h */; }; + 24A88A38C948D38CA7EFF010D6F5C623 /* udp_listener_config.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ECAD5E8D9652BC9BDD83380CB553C88 /* udp_listener_config.upb.h */; }; + 24ACBEA80EA087A4E2ECE72088F6CEC3 /* channel_create.cc in Sources */ = {isa = PBXBuildFile; fileRef = 34DEA3430BABF027DD56B324986636DE /* channel_create.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 24C4903EC0F5E6507E30396CD96CD6D0 /* backoff.cc in Sources */ = {isa = PBXBuildFile; fileRef = 32E37AB10A454FA367DCDE649A0489D1 /* backoff.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 24FC5CB1475F726F8DF96BE6AA79EBDD /* rds.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = A6FCD8B2211614AEA1A4A002269310CE /* rds.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 251E4232CCD3BFAE570EB2D9764694E7 /* bio.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 773BC85B9BFF5AA58D3976A4F30674F3 /* bio.h */; }; + 252DBFEFF06B2B7A08D0EE468C31B5FB /* trace.h in Headers */ = {isa = PBXBuildFile; fileRef = 608520DF27379759B955051E218A4119 /* trace.h */; }; + 253E1E18D4C04448A5E642578681191D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 25405645F65C6CC366DFD410256B4F3C /* bound.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3FE619629A1795D2850BA2450E81AE37 /* bound.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 254B90DAA2625F5985DE653AD4B2F98F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 258DC7B95CAF683D6C1BC89687D36BD9 /* subchannel_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F8D52B2C57098447E1AFBFB5325E1EB /* subchannel_list.h */; }; + 25901486CB1F1A238031BE46F3B5D2DF /* string.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = CAECDFECDF6874B5BE6A7DA67D4053D6 /* string.upb.h */; }; + 25938F30AA7E05FE0D99A58040C2EA10 /* http.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */ = {isa = PBXBuildFile; fileRef = C8327A3256B4CE3C87DCCEA19397E6F3 /* http.upb.h */; }; + 259E46EAEC6E76936B527A82243DFEB1 /* workaround_list.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 1DCCFAA1252D3422682CC0943DE5E997 /* workaround_list.h */; }; + 25A198E3709A8873BC847838F007F25E /* connected_channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = BCDFDD5A82F42416C11FDCEBCEF4F35D /* connected_channel.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 25AC33B8A51C5E8F64A9C08E3628BEF1 /* time_zone_info.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F531CD79C0BC6E4272574162F46F7B /* time_zone_info.h */; }; + 25BAF39559183759F31BCB5952261E58 /* xds_bootstrap.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0B1D0486DD55FBB1C96101E044AB31C8 /* xds_bootstrap.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 25BE06F7C53B3B262EE6046E0B10468B /* internal.h in Copy crypto/bytestring Private Headers */ = {isa = PBXBuildFile; fileRef = 262B6C334E2DA4182F6E05C1BE8E85E2 /* internal.h */; }; + 25CC9A254F77DBBBECF0A12E2CBBD93F /* FBLPromise+Race.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 109216868B5292A6CC5C2D7CB5C1A515 /* FBLPromise+Race.h */; }; + 25D98A867D69981006BF385DAE213DAD /* grpc_tls_credentials_options.h in Copy src/core/lib/security/credentials/tls Private Headers */ = {isa = PBXBuildFile; fileRef = A19F3068182DE62C6728C21C22646D12 /* grpc_tls_credentials_options.h */; }; + 25DFB29126A961C588733B3A6F150F59 /* get_current_time_posix.inc in Copy time/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 22677551E226FF49A7D34AF0A337DFBE /* get_current_time_posix.inc */; }; + 25EB71627490B3100C2EF6C0B8A1E086 /* timestamp.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = A2A2100C6EA9BD8D2E78ADAC0E1EC844 /* timestamp.upb.h */; }; + 25EF45129026EBE3AD6B4ECA9348B7E2 /* health_check_service_interface.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2EAD0C9EFB2E3180C2DBFAF8CDB9150F /* health_check_service_interface.h */; }; + 261B765ECD31B84E0EC079D7F7640E89 /* escaping.h in Headers */ = {isa = PBXBuildFile; fileRef = AF5A5E16288FED709D3068F845F4C469 /* escaping.h */; }; + 261F9E81C4E490BD596350C2A56B0045 /* chttp2_transport.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1A6700B6D0B90896DFB60A6850407AA6 /* chttp2_transport.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 262D06F553D6218AAC02EE2580617218 /* export.h in Headers */ = {isa = PBXBuildFile; fileRef = 8254CFF2C7E0B6547CF1CA30A9DF8BFB /* export.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 26341AAA8185E533F122A3DF5F509BCA /* FIRVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = C45ECDECA1CC685F920E3086D10E4331 /* FIRVersion.m */; }; + 263B0A4546FD8FF5F835CB769CFBC131 /* sockaddr_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 77167CE9076DE7BD53D1C1499566CBAD /* sockaddr_posix.h */; }; + 26654D191847ED85318EB04880AF15C8 /* pkcs8.c in Sources */ = {isa = PBXBuildFile; fileRef = 7BED3B9FF8A2A7FD773ECEB065FA95D9 /* pkcs8.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 266825AFC209D0C897716A834E17AAD6 /* server_builder.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = AEA737254896940AB0A0E90A22C30D7F /* server_builder.h */; }; + 267405D5A35E3A2DBDF955FDFA5F88CC /* endpoint_components.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C705266C9BC559B117BE781A5F6784CF /* endpoint_components.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2678445457EA2C196DD836A0AB40D5BF /* useful.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 4E4438A2B9802CC7625F45E0908E6C21 /* useful.h */; }; + 26811B97DDF705C7A45E58497169BB6D /* socket_mutator.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AFDD73E6EB84B430A2B2FC445718D4A /* socket_mutator.h */; }; + 2695BECF5B5A01B90D22AF4F495BFD79 /* felem.c in Sources */ = {isa = PBXBuildFile; fileRef = BFB71B3499C2B7952DC2380E28AC26DA /* felem.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 269923A5E1E800507F717895455416DA /* global_config.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 3D4AE169D8ADBE9D89664991B5D6DF0D /* global_config.h */; }; + 26A09BE819733B2A95B7AC03685C57A8 /* httpcli_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1E9B567C2825D7F2A284331368876C7B /* httpcli_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 26A20288865D41333BFE990BE2C760DD /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = 440025C65577D4DA4E2733C2C7BB05B2 /* port.h */; }; + 26A7540FB4105C8D5E36ED2632E4B596 /* polling_entity.cc in Sources */ = {isa = PBXBuildFile; fileRef = C0995314397C451FB3BA572AEE93EAC0 /* polling_entity.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 26A929985F03FE033395AA962407A2BC /* cert.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */ = {isa = PBXBuildFile; fileRef = B2EEE88DF8265BD7966C655D0F1A8ADF /* cert.upb.h */; }; + 26BEF649B0EB37EDA01104CE26813E75 /* dynamic_annotations.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E72B56008D3132A59FA1190FE8B413D1 /* dynamic_annotations.h */; }; + 26E3EE618895DFD8CDF051DFE76420F3 /* sync_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 583465E0891F13EE0E35B79A88B240F0 /* sync_stream_impl.h */; }; + 27056F503EE1E98689697752EF39899C /* semantic_version.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B3E876E28EDBC4984AF9188899C964E4 /* semantic_version.upb.h */; }; + 270DC7167A7568C869FA1C1DBAA74715 /* load_report.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E5671FB07752F56090B0C6377032B6B /* load_report.upb.h */; }; + 2722AB899C6EE6D013492A3362BFCA35 /* digest.c in Sources */ = {isa = PBXBuildFile; fileRef = D66DB317CC4C4F2F6AE85A0942F38184 /* digest.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 272689BB2DC9BFC1852EA0B275B171D2 /* FBLPromiseError.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 4992652E6E36FA640AE080039A589DE5 /* FBLPromiseError.h */; }; + 273A95DE9154313CB81B138A516CC961 /* channel_arguments.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 07FA27FC76BE4704F299E45758F66254 /* channel_arguments.h */; }; + 276BBD9CC506B730D79E5A5B1882F15F /* endpoint.cc in Sources */ = {isa = PBXBuildFile; fileRef = F67FE899F9D2D76DF5500524B1D6A157 /* endpoint.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2779C9F0F84276D072A212590ECE99FE /* load_balancer.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = 877F80FE844F159AEB3712C281F3441A /* load_balancer.upb.h */; }; + 2782A6A9D2C26C0B6B0BA24601281F58 /* server_builder_option.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 7990616A3432B5CE7914989D87729E16 /* server_builder_option.h */; }; + 2784C6BD779AC5F637B9B518E43AF39E /* sync_stream.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 9499EC6161BBF62D9D6CC424E6F66184 /* sync_stream.h */; }; + 2787183B82A5BF393EF7C0E1058E651E /* FIRFirestoreErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = D12C858DC3D97B674C7B817D39A7ABA3 /* FIRFirestoreErrors.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 278EE97438596B508D811F357010FD09 /* stream_compression_gzip.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = D6A5855B0528D0A21B543310647FC369 /* stream_compression_gzip.h */; }; + 2794285CA552B55D04950FB80BE81F26 /* delegating_channel.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 1D7082806BB3DD63DD675328C5BDF865 /* delegating_channel.h */; }; + 279887BD19DCD172B3BC76F716BA06B8 /* error_cfstream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 442E2F112D7DB4047BF287BC7874BAF7 /* error_cfstream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 27BD33A965417FB36505C389390939B9 /* grpclb.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = 1254352DE4846BFEB37C5C536523E0ED /* grpclb.h */; }; + 27D038541A5765695DA0B52B31CA1F43 /* inlined_vector.h in Headers */ = {isa = PBXBuildFile; fileRef = A80F3CEFA5FF9FE72EC0AFEC38F341B4 /* inlined_vector.h */; }; + 27D490A8A8DE58A1DB1B89F1057CD475 /* FBLPromise+Always.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E00718B57B591507B2647430447DA7A /* FBLPromise+Always.m */; }; + 2802A350C6DBEA5B851EED86861628A4 /* grpc_root_certificates_generated.cc in Sources */ = {isa = PBXBuildFile; fileRef = C65FFAB5F7F4C7F4CB26D6247ABDC4BE /* grpc_root_certificates_generated.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 280E4E13A0B962A59C8204834907E0C4 /* FIROptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E255EDEAAE074BC8A3A7DF9AFA841DD /* FIROptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2825AD401239FB39044CD00B002561B0 /* bdp_estimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 44FE1F32C1768389A81F0A6275733508 /* bdp_estimator.h */; }; + 282BFA19C115CD46B0169808D5A10E91 /* api_trace.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 1A1A42CF7B62E83F9CAB827668EC644B /* api_trace.h */; }; + 2834BB7FCB8EF51278A2B9FED5963822 /* e_chacha20poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = 150E9E06EA4173D1E8E4CC4E52E93959 /* e_chacha20poly1305.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 28371E24BDC250B5D08FB7046F6C8281 /* PromisesObjC-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D5B741F0EBFBD9401F861844A3FD767 /* PromisesObjC-dummy.m */; }; + 283889E99D27F5300C239C97A27FD208 /* query_snapshot.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0142698C82305E8FB4EB2BCC0C1A2366 /* query_snapshot.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2850EF26DCB599438C3172659939CE6B /* channel_argument_option.h in Headers */ = {isa = PBXBuildFile; fileRef = 94B99171C07D2E616847F8CC1E620728 /* channel_argument_option.h */; }; + 285C01764B74FF66F46B44CFC4C365DB /* health_check_service_server_builder_option.h in Headers */ = {isa = PBXBuildFile; fileRef = 300641136217C3F72893388DFE42F334 /* health_check_service_server_builder_option.h */; }; + 2880C5A5A731B6F4871F89FCEBB6972F /* sync_custom.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = D1EFD9D26DDB7103E060EAD00F7CEC22 /* sync_custom.h */; }; + 288EE4AF87219D59D1D23E006961F92A /* port.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 440025C65577D4DA4E2733C2C7BB05B2 /* port.h */; }; + 2897380ED3052F660514F5529E54BB02 /* iocp_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 71001072B6B65C2DC123195C1AF70EED /* iocp_windows.h */; }; + 28AF9EC27902FA528B9C7558CE5A7238 /* escaping.cc in Sources */ = {isa = PBXBuildFile; fileRef = 568BB452E0A2B0830B807E2D9DB447B8 /* escaping.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 28D0135526BD933F861795E4AB714F10 /* handshake_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D152C0DC7DF8C5DB5241ECF7D290B257 /* handshake_client.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 28E645694A6EC18C300EC500517982F2 /* tcp_client.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 2D3620E8112ADA52D50236E9C708EEB6 /* tcp_client.h */; }; + 28F4E6103E0E70A876587EF7D699A0C6 /* call_once.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CC8A3ADBDB9807C72DD61D696EB6CCB /* call_once.h */; }; + 290350F4E8537F7E1E9D3190D44BFB1A /* xds_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = C360C13D2D40CC6D783F9E87E5D90719 /* xds_resolver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 292E5C23BFC5E65F3470FCD697CB489E /* create_channel.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 593854392CD23606E2DCE099FD766A02 /* create_channel.h */; }; + 29453AD824C0874A4689C5A026595262 /* route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 451C4CD4076AF2620CADFDF3B55A8248 /* route.upb.h */; }; + 294AE41EA88BA79CA2530BCE42914565 /* conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 5518FAF1F576E58EFB99A2A9F0E62AE2 /* conf.h */; }; + 2951FB661282F61D65B1409E51C21E5E /* executor.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8934264C38A2DDF44C859974DDF76E4A /* executor.h */; }; + 2963EC341EFBAEFC94AB83C7892FBCC4 /* cert.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 0F5ECBF97CAE261EAC200C6D49C4F08A /* cert.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2964883F03D85D5CECB1BCBA56702FE8 /* reference_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 17B8745CD6EFDCB192C7E5E84BD48C43 /* reference_set.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 299A730892E6354BB074EBDEAF12203C /* fixed_array.h in Headers */ = {isa = PBXBuildFile; fileRef = 931599781BE22AE7AFAA7F464416FB40 /* fixed_array.h */; }; + 29A45BFB88A356170951453DAD55D6BE /* subchannel_pool_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 5227BEA7F5786F7260DC6621A2E8890E /* subchannel_pool_interface.h */; }; + 29DA3EC56ADF46EDF57ECE25DE700210 /* table_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 3845EED97A182E92F5B9534F992CD436 /* table_builder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 29DEB4299DECE0FC1AC5D6C079B4C8C4 /* socket_utils_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 148BBF1E31DB4AF7565E67B963BA0029 /* socket_utils_posix.h */; }; + 29EC666A1CE7C8019AD2D77F10720264 /* lockfree_event.h in Headers */ = {isa = PBXBuildFile; fileRef = F0B7573BE70B3E29B5D33B4E021A4B55 /* lockfree_event.h */; }; + 29EEEA7F720E05A2C4ED90ED1621DC98 /* engine.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = FA2294EED77B3BE132FAF4BB8565B349 /* engine.h */; }; + 29F58890993FF11251ADE20FD6E72C07 /* array_contains_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 824BEE1922AB5E669D432F166209355C /* array_contains_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2A03E52A98B96055AACF5A39B47968D8 /* cast.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F5C999832105B5B01F81A701E0276CE9 /* cast.h */; }; + 2A0CB297BB34992A14E0CADB80CBD584 /* atm_windows.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 22057244B276E9DD6EEC01798385A77A /* atm_windows.h */; }; + 2A1206914D49C67FE0E9323C628F507D /* charconv_bigint.cc in Sources */ = {isa = PBXBuildFile; fileRef = EC4FDA499726E5BDCFDFB8A78E250F88 /* charconv_bigint.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 2A1655A900EB9234ACF962312D07D368 /* vdso_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E9B635D0E7623DDA13073D9549921C /* vdso_support.h */; }; + 2A23CD4B91A39B3D80C20ECEF00251BD /* descriptor.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 361B5F1184D2461D8A0CE4F6C0620787 /* descriptor.upb.h */; }; + 2A269668FA45A9735724F4F9DE18DABF /* generated_util.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = A88591E1AA68479C3F7CFF5862D565E7 /* generated_util.h */; }; + 2A3FAC107F5852F91D675F3A00CBDFCD /* casts.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 5AEDDB7052DD395CD4E4EBFCC0DED63A /* casts.h */; }; + 2A417CF1E35E4EC063345991FB01754D /* subchannel.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = BF4B22447247346F2D6BA25E3A38580B /* subchannel.h */; }; + 2A42965D84E7BE34AB8290A9576ED113 /* http2_errors.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7B3A25BF47C9C8ABB7FF4323152EFAA8 /* http2_errors.h */; }; + 2A481E5ED5EE28326EC0A7DE644A53FB /* authority.h in Headers */ = {isa = PBXBuildFile; fileRef = 97978E8EF1E9A1C594B56600C302D6B7 /* authority.h */; }; + 2A6951ADCB98C3CA822F5CF5B1A8E142 /* client_authority_filter.h in Copy src/core/ext/filters/http Private Headers */ = {isa = PBXBuildFile; fileRef = BFF4010FDB9D10844BD2A963E431761F /* client_authority_filter.h */; }; + 2AAC39F213D1F004EF3ECBCBF3648CBD /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = A9981EAD1F1A5E388F2921C166A3A170 /* md5.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2ACA525503E5A905288804376D7F2D23 /* cpu-arm.c in Sources */ = {isa = PBXBuildFile; fileRef = 91FDF7608AA718C54E5B66DC6F3D0A55 /* cpu-arm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2AE141B32F0376D5736532FF7F20EF84 /* route_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = {isa = PBXBuildFile; fileRef = 0B0188D071A2BAAE8F6F853ECC2F8A9D /* route_components.upb.h */; }; + 2AF07C0495D31F1B40D82CD1AA05BE55 /* alts_seal_privacy_integrity_crypter.cc in Sources */ = {isa = PBXBuildFile; fileRef = ECD705304334C7CACBFD7A8852C3A144 /* alts_seal_privacy_integrity_crypter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2AFEC81FDBCAEEFEB77652503D27AB2E /* memory_persistence.cc in Sources */ = {isa = PBXBuildFile; fileRef = D1EBFEEA08404A41677D3698370627F2 /* memory_persistence.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2B09FCA3380ACDA8E3EB166CFB81B6B2 /* thd_id.h in Headers */ = {isa = PBXBuildFile; fileRef = E92BCBCD2EC5118CB4748145324C6145 /* thd_id.h */; }; + 2B0E7CE79BA6A2B7CE4A261CFE80CCBA /* socket_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = ACD33F7F16F4EBF3970806BA1F98FE2A /* socket_windows.h */; }; + 2B13FDA0EFA0635D6202078DF79A137B /* task.cc in Sources */ = {isa = PBXBuildFile; fileRef = 012D35287FBE5F05808D75E782C2019C /* task.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2B213051908095ADF524337C69981F08 /* endpoint.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = B212E1EA3F28797855E0155D59F86AD3 /* endpoint.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2B3CC4074E7F4C4B941B65E597B1E84F /* compression_internal.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = CCF3050B8F684E641A61005EA0A6D8C0 /* compression_internal.h */; }; + 2B5696243C8FBFDDBC3468923C2E7E1B /* client_context_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = ECDFE3BA3DAEDD1D8996B92A462FF847 /* client_context_impl.h */; }; + 2B5AD899A3C45D965019F069FE3DE5C1 /* variant.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D0606A8EF843A5D0FB70E85489D5E25 /* variant.h */; }; + 2B68BFEF3991F78A493338B655F1BE43 /* FIRQuerySnapshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9355D7ACA9D1415F317F40134BDE6DE9 /* FIRQuerySnapshot.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 2B7F9F81A90F5CA81B7AC23C72059A71 /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3103B5E5E8961AE81A4FDB7D4757D4AE /* parser.h */; }; + 2B89EC64091BE6A579D75DCC44BE0635 /* hard_assert.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4DF90DAA0A2C3DBCDA90B16A2A0C3BD3 /* hard_assert.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2B948985FEFF10CFA84FCE79B722C7E5 /* status.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46417F5AD9A23058AD37BD569A701642 /* status.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2BA60A54D6304913097D8A3C981805C3 /* filter.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3D599FF436D35431DE4C357824F0C7 /* filter.upb.h */; }; + 2BB766B63BACD9CEFA48459322692A07 /* alts_zero_copy_grpc_protector.h in Headers */ = {isa = PBXBuildFile; fileRef = B7D075AAA4EA4B9A66F838FB07E06537 /* alts_zero_copy_grpc_protector.h */; }; + 2BBAB9C7F93ACC5A29F75175570ED525 /* fips_shared_support.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E87B6AA70EF3C7303B6A13AE63EFD35 /* fips_shared_support.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2BCA2B861E1D531BBEBB4194BEE24601 /* cpu.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = EE15F12E75AA3A66DE9DF6E8E4EEC935 /* cpu.h */; }; + 2BD27D647E4FB0AD580849D46CCC1A5A /* alloc.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 20DFAB3F1AC251213E4C33910664847F /* alloc.h */; }; + 2C01378BB2AB8DEBE0EFD30C05A78804 /* x509name.c in Sources */ = {isa = PBXBuildFile; fileRef = 587A45D33DC5F9425E154A513740E58B /* x509name.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2C16EFD82B4C70972378E4654A141596 /* channel.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = CB32E308C5968F01A8B4A53F87A867B8 /* channel.h */; }; + 2C190110E87AB88A175BC4F26901783E /* core_codegen.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 9D5214C90DB7BDE9D0FC93E06B024787 /* core_codegen.h */; }; + 2C2C6ACBF0A763050AEC971B232EB296 /* e_tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 24F14E626FFBBFEC7C46434448CBE7B2 /* e_tls.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2C52D76E8EEFD496BD5FC3138F23D63E /* completion_queue_factory.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 5CCBC26D6661F84EC915A3F121F83D06 /* completion_queue_factory.h */; }; + 2C535104168DA2B1F459F7F8808B72B6 /* FBLPromise+Delay.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A0652A8506B00EC0855B4E63F59C3509 /* FBLPromise+Delay.h */; }; + 2C6831B335D0AF3FA541F17AD0776F96 /* timeout_encoding.cc in Sources */ = {isa = PBXBuildFile; fileRef = 83166E85990B302FE401B09ACD1311FA /* timeout_encoding.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2C852FC1E5E70C4B04C3FC176B5E839B /* message_size_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3AEC3251AA008CCF6EF8411B38908D /* message_size_filter.h */; }; + 2C89BB98AE61E4B47E98F74E751309B4 /* inlined_vector.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = CCB747D28B7C26F8522289F57BE54380 /* inlined_vector.h */; }; + 2C8AB429C778F2B2B820D5D8F5AA7A95 /* version_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = C441124E91653A0ACB44A88B91CC4A9D /* version_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 2C8DC4AEEFBD1B3D72FDFBB02124620B /* health_check_service_server_builder_option.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4EF388BD65063707AE61C66938C357D2 /* health_check_service_server_builder_option.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 2CA0E1A18360D996FC0276FEBD093FF7 /* substitute.cc in Sources */ = {isa = PBXBuildFile; fileRef = A957D82CE2750495058EA01364A0459F /* substitute.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 2CB51703318CE6C8FF4A6191F8464CE8 /* firebasecore.nanopb.h in Headers */ = {isa = PBXBuildFile; fileRef = F6B971B410643AF9F21F0053EAA13332 /* firebasecore.nanopb.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 2CC3093A5C482F42BC886514D7935872 /* ref_counted.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 6CE64CEC1C19AFA412AD194A343E6E18 /* ref_counted.h */; }; + 2CC39194FC20240B87A5792D48F1D311 /* bits.h in Headers */ = {isa = PBXBuildFile; fileRef = B82A3BF0600ACFBB166AEA37753D9B47 /* bits.h */; }; + 2CC6F270F31227D96E20CDE4767D3DE6 /* string_util.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 735743FFE3A449B51A15E24901AECF1F /* string_util.h */; }; + 2CC77AA393721E96CB7DD089AFCDE687 /* pollset.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 0F1F3CF8E88DD83D2DBE7E06C9DC76EB /* pollset.h */; }; + 2CCEE7D2D81E80FDF236890D70111CC6 /* frame_rst_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 578BA6C09B305AB6F8451B48B88B4D8C /* frame_rst_stream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2CE2179AEFC4CBA032D92DFD313D6DD2 /* http.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = C8327A3256B4CE3C87DCCEA19397E6F3 /* http.upb.h */; }; + 2CF4493E48513658CB0063B1D1C9480E /* symbolize_win32.inc in Headers */ = {isa = PBXBuildFile; fileRef = CD6064577A74079D5FA2FF512B0DCA65 /* symbolize_win32.inc */; }; + 2CF87343781F6CFD4599671BF5C3FDC0 /* frame_goaway.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 75746EB8FB15F347875401786A1E5DA2 /* frame_goaway.h */; }; + 2D0378F646808A63402B15E4B542D9D4 /* bad_optional_access.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F9842D7843EDC209B57E48DAF7DFB2A /* bad_optional_access.h */; }; + 2D0841BF8B3BBEC35690C98079110484 /* api_listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E87A37252B47E86765B38E1546BDD73 /* api_listener.upb.h */; }; + 2D174ED75E17ACFF712819EADE18D2DB /* container_memory.h in Headers */ = {isa = PBXBuildFile; fileRef = D4905D6B3410A18BBF26BF84188C4329 /* container_memory.h */; }; + 2D1DB2247E9BA0EC0AE4A7A16975862D /* transport_security_interface.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = C7036343B39BFDA0F9DF8238A27AAE70 /* transport_security_interface.h */; }; + 2D43D63B89D51CD74C8E035B043E0FCB /* pid_controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CC21FF44E36769D74D00B7BFF5A569C /* pid_controller.h */; }; + 2D4F4D6CD0BB1528CA77DBD0D5BF982F /* pollset_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C49FAEB23BB437B37D5073B9CA45CC /* pollset_custom.h */; }; + 2D7A13CCAE2C8774DA577D26446C5A4A /* periodic_sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2C710C706A4C3B6C6658D73F068450C1 /* periodic_sampler.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 2D823FF210E5246D01EA54E239D8B370 /* ascii.h in Headers */ = {isa = PBXBuildFile; fileRef = A514CA128BAE38DA1C046B4723F7A58C /* ascii.h */; }; + 2D900350EE7C58CB070E2B44B7A50183 /* slice_hash_table.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = CBE383C29BEDF8484AB6FD097D1BE43B /* slice_hash_table.h */; }; + 2D940E12E3D3A3555FD723B6AEFE1F28 /* server_timestamp_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3121D2EA76FA86111FE79EAAB7C81F00 /* server_timestamp_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2DA3C4B46ADDF92DC28C50F19730D3B4 /* FBLPromise+Async.m in Sources */ = {isa = PBXBuildFile; fileRef = 729EF04CBBC30ED9447DDF4D3FFF6009 /* FBLPromise+Async.m */; }; + 2DB11D4941AB780558D4CDC9BD16F071 /* notification.h in Copy synchronization Public Headers */ = {isa = PBXBuildFile; fileRef = D427F01390693996D900AA7735DF54DE /* notification.h */; }; + 2DB5AF65F5F6879A292F15FC7383F10F /* init_secure.cc in Sources */ = {isa = PBXBuildFile; fileRef = 00A330EC4B929E07DEF5020B6E628E4A /* init_secure.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2DBDC6960FB84FEAE4A675415326F848 /* auth_context.h in Headers */ = {isa = PBXBuildFile; fileRef = E3DAFF6DE90508C9BDC6062F431B74D9 /* auth_context.h */; }; + 2DDC439C5A663A13E1A53B06051A312D /* context.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F9BB401AA3D1C784081723BDA924AF0 /* context.h */; }; + 2E06E23AB2A9A8BBC1F34E1ED94603E2 /* transport_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 82DA192B1B982D663E101F0873EB2796 /* transport_impl.h */; }; + 2E3CD58E872EF0F4636C734217BD0AB4 /* schedule.cc in Sources */ = {isa = PBXBuildFile; fileRef = 81E97ABEB1C53416EB4D3DF76FBD61A3 /* schedule.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 2E436BE8958EEB2DB7C5519FAA95F09F /* grpc_ares_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = AA46FC2EF94E9F5572BD914C67BAD5C0 /* grpc_ares_wrapper.h */; }; + 2E497AEA12F761C0869BD5B7490E68BC /* tcp_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 7167DB962799499BB9AFCA97C28414EF /* tcp_custom.h */; }; + 2E614C2C035E3469CC8E9D856204666B /* jwt_credentials.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = 063EF7B4806888581BA77122A4F21388 /* jwt_credentials.h */; }; + 2E8D2322A5A821EC4B579F0FEF8C0378 /* GDTCORFlatFileStorage+Promises.m in Sources */ = {isa = PBXBuildFile; fileRef = 60CBC225D5210CBFA6B4FB6F8D4BC450 /* GDTCORFlatFileStorage+Promises.m */; }; + 2E910F6904CA27C8E0C0CCD9EBD018A4 /* dynamic_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = E72B56008D3132A59FA1190FE8B413D1 /* dynamic_annotations.h */; }; + 2EAA5ACCE82B2F61AE1FD0792544D1E3 /* lame_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 946FB238E205DD9FB93C848B9F9AEA3D /* lame_client.h */; }; + 2EBA1CB5B71ED2546C50BF5DCDA2060C /* timestamp.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = D3CB08C929B497B45F5ABAE870F7D4A1 /* timestamp.upb.h */; }; + 2EC5665E75508394FF8EC5E5B5640D38 /* tcp_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F6FF34929322FE8870E7BDBF6A05982 /* tcp_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2ED50F13B2E1D7CD18BBEF1DA5DC666E /* is_boringssl.h in Headers */ = {isa = PBXBuildFile; fileRef = E29D3A11FCE715E06A78E2168353C130 /* is_boringssl.h */; }; + 2EEA81B255C5B70BB3FE76371F731DD1 /* endpoint.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 01FF4609D5497521C83F7CF4D937FC90 /* endpoint.upb.h */; }; + 2EF99D2C78FB14AE218774C9CF671DBF /* udp_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8D44F4656224F3AD7F22416E7792E57E /* udp_server.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2F0180ABF844DB0FBBE5CF029C8B0CB5 /* str_split.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 728A441643EE84474DCC1D24C9BE8102 /* str_split.h */; }; + 2F13210E31EAAF73F159A174691C93AE /* timestamp.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = D3CB08C929B497B45F5ABAE870F7D4A1 /* timestamp.upb.h */; }; + 2F41648BF86A73F30611902B20443C08 /* secure_credentials.h in Copy src/cpp/client Private Headers */ = {isa = PBXBuildFile; fileRef = 6DC502B8F9EF1F8F9C4200695FCFD22D /* secure_credentials.h */; }; + 2F4A866A19D2D55CBC6F3DFEA82E081D /* completion_queue_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CCBC26D6661F84EC915A3F121F83D06 /* completion_queue_factory.h */; }; + 2F5A897553716A5F768453F548C49D8B /* env.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 0BF940D079EE26182F7A3B8DCCCB06B1 /* env.h */; }; + 2F6F610FE1AD40DC4A8CA3E2E3E85D61 /* alpn.h in Copy src/core/ext/transport/chttp2/alpn Private Headers */ = {isa = PBXBuildFile; fileRef = C93587944B54F3913789EA657E2C4742 /* alpn.h */; }; + 2F7952842F6B570FA94C5B166B07DE09 /* completion_queue.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2657535AAAAF14E09FAFF37B6DAF663F /* completion_queue.h */; }; + 2F8B233618E29CAAD25AC084F76443CE /* siphash.c in Sources */ = {isa = PBXBuildFile; fileRef = 346A4C827C53BEA56A4BB722158591F0 /* siphash.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 2FA797299ACB54E81E196C359F6065A0 /* channel_trace.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D585EE92D5882AC28F9B12C6E3FE0F /* channel_trace.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 2FAD4460A00505A32E01FC03F292325B /* FIRQuery.mm in Sources */ = {isa = PBXBuildFile; fileRef = 892FCC179A98C6081F21DC4D6B5E3B6D /* FIRQuery.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 2FB7663E79BE84C16D392EB455FDE4FF /* algorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 42A3491AAFF3AB54FD6B26EFD99BB876 /* algorithm.h */; }; + 2FF2C3CFDBF560E923ED4C6E1D22B071 /* db_iter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 331ED7D8710CC1001B80D4D19BC211E4 /* db_iter.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 2FFCA5CEBA1C3BAE54D8BB2D36A07A3A /* x509_v3.c in Sources */ = {isa = PBXBuildFile; fileRef = 687BA8868ECE122ED37C2197706D1E0C /* x509_v3.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 301A359396878B98A81C666A46097969 /* pkcs12.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D1BEDC0AC9B722D8F9D332675C97D7 /* pkcs12.h */; }; + 3026014CDA84EE17A2EEF413E2377DBB /* FIRAppCheckInterop.h in Headers */ = {isa = PBXBuildFile; fileRef = A11DB0635F1EAFCAEEE41078DBDC5CB2 /* FIRAppCheckInterop.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 3027D850795E7E93B8DDC070C7DD2C86 /* error_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 03802921213BD6AF75F8E23379BD49FE /* error_internal.h */; }; + 304BAC0274F87CD1F154522C1FF15911 /* fake_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = EBFE9E298F6BE2F8EDD6EFA38A31934D /* fake_transport_security.h */; }; + 3095BA817B12D9CDD7113E901B836279 /* thd.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 729A21CC7006CAEC65ED71CC4742B14F /* thd.h */; }; + 30A36505D379E3D031DF8E0B7D2875B6 /* decode.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 40684F02670C5E032C82259DBCBDC2AA /* decode.h */; }; + 30AC36A20FB78B7C34ED6BCB2AC96EFF /* stream_compression_gzip.h in Headers */ = {isa = PBXBuildFile; fileRef = 724F27A7E8833F11B3B9181B974AC5B4 /* stream_compression_gzip.h */; }; + 30C6D8C2AD23188639316B13336F72B6 /* frame_window_update.cc in Sources */ = {isa = PBXBuildFile; fileRef = D41CFF0716D31BD2ABEC6258B737A37C /* frame_window_update.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 30D2AE4808253A5604CE3108FA99605C /* xds_client_stats.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = C829FB38561BAE9EB5AEB66C4ED272AA /* xds_client_stats.h */; }; + 30E4618F370939DC4568643D51B3C63E /* frame_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 9BDE6E0D386F7AF73EEAC9F7564A8941 /* frame_settings.h */; }; + 30ED5D09B272E788E37BDE31F62B6D4F /* obj_mac.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D9C6A04D472A4D24C7D78EE9F581CE8C /* obj_mac.h */; }; + 30FF8C6BDEEBAA340CA894E4A00D2C54 /* method_handler_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 70C5F5487C3D0BD41B86188E5A468273 /* method_handler_impl.h */; }; + 311AC85FECF881C4651EE06954A86128 /* grpc.h in Headers */ = {isa = PBXBuildFile; fileRef = B348A4F8A3F1013C061BE48235C47CB8 /* grpc.h */; }; + 311DD0AEE8DB78D43D33B6A39DC7C569 /* tcp_server_utils_posix_noifaddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7AFBFAF71709356F760579AFDDDBBDD0 /* tcp_server_utils_posix_noifaddrs.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 311EB09211608022625802E2C1BDDC52 /* FIRFirestoreVersion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 743E429B88FD90AF606E30D5484D31C3 /* FIRFirestoreVersion.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 31254AEEC196FF291C587C6446317871 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDEA68FAD2F4DBA7A5871269B0871 /* util.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 31334FDEB585F8DA0D50B46037D2F540 /* thd.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = E0AFD7074CAB64C323F60EB099B7CD4E /* thd.h */; }; + 3156B7775BEE2A1C37C58F03FEEC0085 /* resource.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 835524689A096870E9893C71B94C253A /* resource.upb.h */; }; + 3157390EC9C16A0BA6BB958A2368738D /* ex_data.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A968949A80360C1905158D071E4C1C /* ex_data.h */; }; + 315F54C543C19F2A25C6D991CE41A0BB /* call_combiner.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 980DE03C57A327190CE7C575C4E5E831 /* call_combiner.h */; }; + 3161D0F866D24D559D88128736FCB8A5 /* timers.h in Headers */ = {isa = PBXBuildFile; fileRef = DFBBF5427F6D287EB64E3B36E5EF6D7D /* timers.h */; }; + 316763940F5A8D9E781D6F9011C5C436 /* byte_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 42DBF69F67A26054C8A87F2EED5A5D44 /* byte_stream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 316D1B2FDF1B22CB09F0E22C3A7E12D0 /* GDTCOREndpoints_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE107A7579FCAEF4E75974BBBEA6390 /* GDTCOREndpoints_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 31765E7BB6298F018082142770F01B50 /* polling_entity.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EF455CA17E8E84151728C5E5636789 /* polling_entity.h */; }; + 3190D33B86D2251B463186E21DD29754 /* async_generic_service.h in Headers */ = {isa = PBXBuildFile; fileRef = C453377C6E38701BE8795477EAE77A8A /* async_generic_service.h */; }; + 31930FABFCD92005B8E9B4EADF799784 /* varint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C77EBAB7C9B6CA3B0440FE7AC464C2E /* varint.h */; }; + 319643D86AC244952A317D7EA8E2D4CF /* health_check_client.h in Copy src/core/ext/filters/client_channel/health Private Headers */ = {isa = PBXBuildFile; fileRef = 56A5ED8B90D19F65FB85B63F6A3ED587 /* health_check_client.h */; }; + 31C27BA9F935B7EE100CFD7C5038573A /* atm_windows.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 5A21288CE7FD248E5937A1691F1F6B1A /* atm_windows.h */; }; + 31C30971EAAEBFD5BFA159FBCAFE52D1 /* service_type.h in Headers */ = {isa = PBXBuildFile; fileRef = 146248CAC22E5FC977650DF1B68DA60E /* service_type.h */; }; + 31D59E2B2F87F663487AE8CB6F9EC007 /* iomgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451140231B672DF6F7631B009CE8478D /* iomgr.h */; }; + 31E5579599F8487C78C3CFDAF7C20775 /* p256-x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = C794B0701088F676E57A0A7CBF4989D0 /* p256-x86_64.h */; }; + 31E6AA7B8913F4C5DDAC980D867D73E0 /* ctrdrbg.c in Sources */ = {isa = PBXBuildFile; fileRef = EE84E888FEEE2D71B13B1A9E66211639 /* ctrdrbg.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 31F1F67B6F7C30FA9251383D0332E81A /* connectivity_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 48EF9FFEC74353F57A5647B7B7E82CF5 /* connectivity_state.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 31F3EC7402B90DB41BA9DE75955E97CD /* completion_queue_tag.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = EF1CF1358AED46E75D926E03531F42E3 /* completion_queue_tag.h */; }; + 31F9E7EB39E60B50A45C521987B41D3B /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 9F9BF554EFFC04267916166595FCC2EB /* route.upb.h */; }; + 3202C111929BBD7B0A5CF0BB1F4F4515 /* round_robin.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4B09FCFA689324A0375DD7616F471F3 /* round_robin.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 321C4338C1387198AA9C60283B509F7D /* a_octet.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FAA93E4A8212CC7532F3B1A494F11AE /* a_octet.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 322871C24CE26E5BB8CBE86AF0ADF2CC /* grpc_library.h in Headers */ = {isa = PBXBuildFile; fileRef = BADA78E910ACE2BCEDCCD27287A5B7D6 /* grpc_library.h */; }; + 32395E35BD3EBE436740D4688090ABFC /* channel_stack.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 32D673EFA5DD266B72426A27401141D0 /* channel_stack.h */; }; + 3242447311D97BF2618C0E8E85F890C9 /* socket_utils_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8C3E1E8DA0687EF03F3768202880B8A7 /* socket_utils_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3247D264FBD3B007E86E348DB44A18D2 /* huffsyms.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB3E9C734A34DA2057BD330F36277ADA /* huffsyms.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 324F8E66482A3611808EA1AAFF3C532E /* ssl_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 20FE2D07EA808054F93271C756735D8D /* ssl_credentials.h */; }; + 326EFD2541D006917B205323677DA688 /* alts_record_protocol_crypter_common.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 4A6BA8F1D6B4002E7BC3FABF863B280A /* alts_record_protocol_crypter_common.h */; }; + 3273C397AF8B25FEED1D31CA908917EC /* buffer_list.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0B448218FE1A4BEB721E3651987E28FD /* buffer_list.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 329DEDBF1E5F759F42A5F6E3524BBDEB /* http_uri.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 4B758CA3A10F0A530AB2F8EF69605B78 /* http_uri.upb.h */; }; + 32B31825B63564E0EA36029FC36E6E79 /* ext_dat.h in Headers */ = {isa = PBXBuildFile; fileRef = DB86A54D31A9A3098C237DA9706417D5 /* ext_dat.h */; }; + 32C4723A13F5FDFFE1B52D35ADE61599 /* alts_crypter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EF9BAAC12070A8E68EC4747F69049BA /* alts_crypter.h */; }; + 32C62B8C76D02E28FBBD1BCEA955FC94 /* ev_poll_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = C08BBCFD2E1E030C2A149B618CE72893 /* ev_poll_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 32D34ED8DABE158DB859BDB45EBFCCEA /* gcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 8B34C190B1DE501246389F79CFB5E4E9 /* gcm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 32DD2CE8B966139DEE6C5E046BA0EAE7 /* sys_epoll_wrapper.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8A6FBD8C15F233AB29F00632508099D3 /* sys_epoll_wrapper.h */; }; + 32DE2F280F7C8A441591F8C80BD2B1B7 /* resolve_address.cc in Sources */ = {isa = PBXBuildFile; fileRef = 559140FD3540DD8045409E14748899F3 /* resolve_address.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 32DE4654D603E618FAE6ADDFF2BDE540 /* parse_address.cc in Sources */ = {isa = PBXBuildFile; fileRef = D23242036D231157154F210870401E3E /* parse_address.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 32E05BC1320D26A3288F25DE0D4DD0CF /* server_chttp2_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2B26D1FC1C4254B7DFF79D25144A4970 /* server_chttp2_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 32F1AAE68207A5B5E3782205052DED29 /* stacktrace_aarch64-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 2C3876BF971373587610297E8F6525A3 /* stacktrace_aarch64-inl.inc */; }; + 32FD3E0AD44BB01C2E2B1D3CB3D84157 /* timer_heap.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB6FEAA72CAB7E959371C3F7C2DC4CD3 /* timer_heap.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 330FB8D28172BCA331430FEC13C0BAB1 /* symbolize.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = B46F0E4D4D1CAF33B69692A375C1CB8F /* symbolize.h */; }; + 332766EA51681442A24DFEB1EB46941D /* child_policy_handler.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = {isa = PBXBuildFile; fileRef = 5BEA5E74CFEE66ED0688BAD4176E42C9 /* child_policy_handler.h */; }; + 3331F9D3CD97D4ABF7A72477FAD56190 /* x_pubkey.c in Sources */ = {isa = PBXBuildFile; fileRef = 117A19181C15DEAF6F81B5490A41D7C2 /* x_pubkey.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 33336FA7E8FAE4B5BD35A813ED778CB4 /* security_context.h in Copy src/core/lib/security/context Private Headers */ = {isa = PBXBuildFile; fileRef = 593F0B894480261EB6B865EA99EF9506 /* security_context.h */; }; + 33394FF9DDEFF7456ED4DDE41F3C0DE0 /* jacobi.c in Sources */ = {isa = PBXBuildFile; fileRef = 651BF0816B4B332C18209C9BFCFCA837 /* jacobi.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 333D4E22F46FE760EE6B8C2EFC8466B5 /* atomic_hook.h in Headers */ = {isa = PBXBuildFile; fileRef = 287E26C9E3791FABB0831B7AD94A7AF5 /* atomic_hook.h */; }; + 3344BAE6406C52D5C9E46CE7A82763B4 /* GULSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 94E35964BC0034013F356E04B178FDEE /* GULSecureCoding.m */; }; + 3345F00C12557251F45ED6E58A6864E7 /* frame_goaway.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 379CF150978B0F5A23E159DC42331CCB /* frame_goaway.h */; }; + 334952E8E95F69C72B544F2E8721CD42 /* x509rset.c in Sources */ = {isa = PBXBuildFile; fileRef = 0C0E3894574E143BC94F0A74E990E5E1 /* x509rset.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 334CCDF1C47F282F02451380ADC488DA /* iocp_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 2970A316BF1BFE4C0942C083FC524E8C /* iocp_windows.h */; }; + 335C1A51CDCAF1E6336BD38A2A9ED3CC /* murmur_hash.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = D8CEBD833D04172DEE7C52ECEC2DBAF0 /* murmur_hash.h */; }; + 336106112BDD0D8D909E74231732CAE6 /* cipher.c in Sources */ = {isa = PBXBuildFile; fileRef = AD939B0974B0C1A66C77AFC21CD3F9F1 /* cipher.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 337D635008A774F013F1CBEB456BA2B6 /* security_context.h in Copy src/core/lib/security/context Private Headers */ = {isa = PBXBuildFile; fileRef = 0AD940282C7B916B8067C94A6E7F5FE3 /* security_context.h */; }; + 33ABFF9D9C3ACA7F54B09C36187B6127 /* workaround_cronet_compression_filter.h in Copy src/core/ext/filters/workarounds Private Headers */ = {isa = PBXBuildFile; fileRef = 145112654FF4FDFC7090F654F9BD1A78 /* workaround_cronet_compression_filter.h */; }; + 33AD99F777ED29A3AD63A97AF2D4C21E /* log_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D77F9B38F3D78B3C8617AF8195B5915 /* log_reader.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 33CFDB88BCA15D19116C100D5C7746DE /* log_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6A932D17BAF42D2FB6E062BC540AB59E /* log_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 33DA9FCD1708BD796CCC11A72D4FF66A /* annotations.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 06762793F5E47A79E012F1948C1F661E /* annotations.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 33EF4DC33C0CC28417479669AD80DE63 /* env_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 21C3F2A96C0E4AA7B2B3DD91214C7024 /* env_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 33F7AF9B51507A5FD0DB0C0660388D29 /* credentials_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = 32045BB58E6A962E5010F9232903DF89 /* credentials_metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 33FF776F632BCC5268E457E74FF61FC3 /* fake_security_connector.h in Copy src/core/lib/security/security_connector/fake Private Headers */ = {isa = PBXBuildFile; fileRef = 1622DC85A779012D11AEAD69D528003F /* fake_security_connector.h */; }; + 3407097C69ACF3E0A64905C1753FBE4E /* pcy_int.h in Copy crypto/x509v3 Private Headers */ = {isa = PBXBuildFile; fileRef = 2B75DD07E543761371585696907AF45C /* pcy_int.h */; }; + 34141DF03078DBD1B086A2A4D431A4AE /* FIRFieldValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1A6FB7F4CF44C46C1449EEADAB214FD /* FIRFieldValue.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 3437727F41C03E56E82C997EBD9AE602 /* grpc_if_nametoindex.h in Headers */ = {isa = PBXBuildFile; fileRef = C62DCF6C8D4E7CA9AFA7D2DB579020D5 /* grpc_if_nametoindex.h */; }; + 343B650B5D85AAD3D0BD4386BCC00D88 /* trace.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = A32279DF47CB815E6A6DAA6FC92E81F3 /* trace.h */; }; + 3442DCDF2EED4FB732F2EF45761B249C /* ssl_session_cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A0335BD65D301B9439EC0691C11369 /* ssl_session_cache.h */; }; + 344D2659A56F6BF09164D0DD979D5372 /* descriptor.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 2DAD39114F176ABDAE1D3505716D04F4 /* descriptor.upb.h */; }; + 346120777DCDCD458A53183F9F009981 /* transport.h in Headers */ = {isa = PBXBuildFile; fileRef = 20C5D36C79D1BB20457FF8BB2482A275 /* transport.h */; }; + 347AEC6E07747C1E3A5F948E82914F52 /* ssl_credentials.h in Copy src/core/lib/security/credentials/ssl Private Headers */ = {isa = PBXBuildFile; fileRef = 20FE2D07EA808054F93271C756735D8D /* ssl_credentials.h */; }; + 3490A40624E9F7B235558B24C0FAC5F6 /* fake_credentials.h in Copy src/core/lib/security/credentials/fake Private Headers */ = {isa = PBXBuildFile; fileRef = B34D89A7C532C51A510254029B3BFEB5 /* fake_credentials.h */; }; + 349DEDBA48BDFB4284BE1D026E2A0799 /* tls_pthread.h in Headers */ = {isa = PBXBuildFile; fileRef = C5C3298D881E6BC29AF8B4E10D80113D /* tls_pthread.h */; }; + 34AAFD44AE71978E69B369F90F0D855E /* fork.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = C44A9673099B2584D7099AFAB608672A /* fork.h */; }; + 34AB1D429019DBCC97F847A519525A20 /* FBLPromise+Await.m in Sources */ = {isa = PBXBuildFile; fileRef = DBF18FCBC8E01220189F13FD470FE4A3 /* FBLPromise+Await.m */; }; + 34ACA5570E40142368794C3CFC16B4FB /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = 35C6E34D3BF3E17F698291949B8A853D /* endpoint.upb.h */; }; + 34DBDF5EF983EE6D8136C649E14648CB /* string_view.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FC28EE8D3452EDA699A4B5651A8372 /* string_view.h */; }; + 34E136A06DF6ECAA84D10B038D9BB240 /* iam_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = B7442BB3F818B96D0B920E14ACB75FB7 /* iam_credentials.h */; }; + 34E698C223A544F2118BA00B9F669ED8 /* s3_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 91F3433400AF48F6BEA7EB5CD4DAC985 /* s3_pkt.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 34E7AF8D52860A3E0B33C549A7E33E31 /* compressed_tuple.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C81D2805D217ED5A120F4A8DF0C7155 /* compressed_tuple.h */; }; + 34E89272E83D13C46BC8A310F60E69ED /* address_is_readable.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3DE4A2600B80B995AFA6EB97FF19584D /* address_is_readable.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 34EF83FC86AD70D030F1F1249742D572 /* stacktrace_unimplemented-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = ACD5D7B78AA4F01E6A83A481D7AC4FF6 /* stacktrace_unimplemented-inl.inc */; }; + 34F19D8264B7A8D1EC4EC401940AEDD8 /* p256_64.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = A3EB023FED87D37C6403299E876C3CAC /* p256_64.h */; }; + 34F483CA7D48F3AB54C380FBAC85C580 /* tcp_server.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = CDE5D386BB6C60A3B504FF9F3CF9E6FF /* tcp_server.h */; }; + 34F4FB391AC3ABCF56F699AB45B2E0A4 /* filter.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 26716858B5A91D0AFA538D833B251738 /* filter.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3517F55640E8849F3DF6D4ACAFCFB193 /* log.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B610AB95754760FA8B42D3893F00921 /* log.h */; }; + 3526DE41BDC3E70371B3AAA1096A38CF /* server_callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 17CEF00AA004CFD393B09091B419187F /* server_callback.h */; }; + 353358D9F8576B32D0F74A1A58C1918D /* client_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D211F9024AF3892B1280563BCF428E /* client_context.h */; }; + 35747BFC39AF779D6B621CC41A1AD3CD /* resolver_result_parsing.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3955A2D928D5CF136DE430715ABD72 /* resolver_result_parsing.h */; }; + 358DC34DD070F91F853FEBE079C33601 /* hpack_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 68752EEB6A2A54E14D19F0FB23FAAB90 /* hpack_parser.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 358DE67BD81BC88BA6BFA70105BAF8D0 /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2355F60BE4168BA33B86EE4132C62B08 /* sync.h */; }; + 35A738EB4A69AE26C6B0E4E33799155A /* channel.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 1DACF790A72B28E83031D36EB45ED237 /* channel.h */; }; + 35A9018F5DBCCC8DC294FD7759C5ED6C /* pem_pkey.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A77CDD8EB44C7CA82CCF26B37D7BE27 /* pem_pkey.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 35AFC44A8CC8DFD5BEAC5C2C94FF0E7B /* handshaker.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = DB01EEADFD8F4283D79402AFDF7526A8 /* handshaker.h */; }; + 35BCD2B7588A4E442ECD20A65DD4C863 /* resolver_result_parsing.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 6A80269127372F74B3C44097DCF9430C /* resolver_result_parsing.h */; }; + 35C468AEE601BB0919C32583DF2E02CD /* p256.c in Sources */ = {isa = PBXBuildFile; fileRef = D1EF4642D948D1C40F1F27641F9E7E37 /* p256.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 35C781A6E1D77730EBB2BDC1FEDE0BD8 /* client_callback.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 2357611EAAC607066D736FC1DF733387 /* client_callback.h */; }; + 35DE390B2B787DF8DD641EAF31E53CF3 /* raw_hash_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 136878A10D9ED347E2C7570C52ECAA3E /* raw_hash_set.h */; }; + 35E585928714B9430EBFA7BE013CBB00 /* FIRComponentContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = A031B0E03D3060C46E493AEC9CA16E70 /* FIRComponentContainer.m */; }; + 35FE0F9A79EF9095CEC0D71E2CD0AF78 /* completion_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1C393122811C651E2FBA2115CA45DEFD /* completion_queue.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 360030BE4B07272C9997892CD41DF10F /* async_stream.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = C12FDA4D0284C83C4D7A328AAD8476A5 /* async_stream.h */; }; + 3603E18B2E3E8635756118B23D846983 /* FIRLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = ECD33F95A7B1C50A9E511A0C8BA399CA /* FIRLogger.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 36198CFEBC3D2AD5ABC0D7D9009C2478 /* murmur_hash.cc in Sources */ = {isa = PBXBuildFile; fileRef = 88A6957092676D8EB869B41B41819646 /* murmur_hash.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3628C7890EC28213F252BD126D26E06E /* lb_policy_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 1E2FC67CFFD88121716465842FA877D2 /* lb_policy_factory.h */; }; + 3640433C3DCFC1FE29178AEE5A8232E1 /* FIRSnapshotMetadata.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01B26CFE2F76C29EBDEA60A8BF11A63A /* FIRSnapshotMetadata.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 364A7268CA26167A034336B3ACD427C7 /* writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5F7B7B9E9DB84FB194521CD878F489E1 /* writer.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 368523CEEF3FEBDC147DBBC9E0D637A1 /* FIROptionsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = C99606D6DC22C6EFC7C59C9BF3D109BF /* FIROptionsInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 36A1792EF79077028F91EB028A2EAC60 /* d1_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = D880CF6F56DD4727366742B101439716 /* d1_both.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 36A8F1EE44929998362EFFC55A9569BF /* grpc_if_nametoindex_unsupported.cc in Sources */ = {isa = PBXBuildFile; fileRef = 328687CB79C415F176336CA8784493F1 /* grpc_if_nametoindex_unsupported.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 36BF66E6CD4CB703982BA2BC4B263AED /* status_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2CD8F375C3FAFE74F1D17105D22E652E /* status_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 36DD6D4D65460949B3DBC60FABC6CCC7 /* api_trace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1A42CF7B62E83F9CAB827668EC644B /* api_trace.h */; }; + 3707FA70431E375B6AEC13959FC6B7E1 /* http_client_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = B5C0118BE6E61929008E1E1D7C94D40F /* http_client_filter.h */; }; + 372B66496F6104A199AE5F9D5FB06D75 /* pcy_tree.c in Sources */ = {isa = PBXBuildFile; fileRef = F6B76E8CA1120C3B37CD4E26737262BB /* pcy_tree.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 37392FA30A2F9A3B9C0F009363875BD5 /* demangle.cc in Sources */ = {isa = PBXBuildFile; fileRef = E8CD1879AB4564BF8AC4F8C9DB056B8A /* demangle.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 373EA3F50EF228EDF4E6EA7EE6293BDC /* fork.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 5B3A3153CE6675A91D4DB4C46DA9EDF4 /* fork.h */; }; + 374C2A36B95AF2E6AD4A4E469D390548 /* server_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F25E574F3F8F80198A3D62A0AE3871 /* server_context.h */; }; + 3764EBA20190BC076D719252EF8406AF /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BDCCF92BB835F08D02294A95CF06E9A5 /* internal.h */; }; + 37664EE157F50ABFC5E11BD37CADB536 /* subchannel_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AC08D791B5B330D3D95E91C9CFA364A /* subchannel_list.h */; }; + 37728BA66ED3C42A45F8A74835C3B5AF /* eds.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 1BE7D11636B0B07F20A9BCCF4B580D3C /* eds.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 378B8D73E75471A42132D43423ABFD47 /* ssl_session_openssl.cc in Sources */ = {isa = PBXBuildFile; fileRef = CAF3A088DC0DFCAD5B04CD156CA78E5E /* ssl_session_openssl.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 37B2B1E2D412F8693B072F2CAE01BE92 /* global_config.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 53EB4885FA802E30127217CAF0C6E262 /* global_config.h */; }; + 37BFB2086C3A49E24AF6CCD461CB2912 /* curve25519.c in Sources */ = {isa = PBXBuildFile; fileRef = 99871DF08627BB0875ABC7F34BA94E76 /* curve25519.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 37CB56380755B7FEE37CCBD3D70B30C0 /* FIRLoadBundleTask.h in Headers */ = {isa = PBXBuildFile; fileRef = D94C417F36AE5BEDB01A94A81DC23DF8 /* FIRLoadBundleTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37CF852900C21052771297956B823632 /* GDTCORDirectorySizeTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = A94B2D26AC4AEF80C7232EC115747DAE /* GDTCORDirectorySizeTracker.m */; }; + 37D33E887C915B5B8DA30F429C6BB865 /* str_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 728A441643EE84474DCC1D24C9BE8102 /* str_split.h */; }; + 37E50283C44DBA327234541B01790A58 /* buffer_list.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 429CDBFF1E41ECF06C4D98A9CB755343 /* buffer_list.h */; }; + 37EA3D9129E5CFD9E7CF2D61A3630099 /* uri_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FD8B4BBBA1F7122B7E451C9C875BFA /* uri_parser.h */; }; + 37EB29AB0944C96EBA129BC7E76F1B3E /* hpack_parser.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 70C105943F6DB6E5BDA3DBBE29104B3F /* hpack_parser.h */; }; + 37EBD5BDBA038C0DCF416F9DD9EE827D /* grpc_root_certificate_finder_generated.cc in Sources */ = {isa = PBXBuildFile; fileRef = 60711FE87AF4AB20E84297D270C023B9 /* grpc_root_certificate_finder_generated.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 37EF5D1AB0EEDF4F10D14A2117FA20B6 /* local_serializer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 05F0B78A6D8F1291ABA4D37887BD58CE /* local_serializer.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 37F2290530F6967122CE3EB74828B534 /* FBLPromise+Always.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 0EDF1E0017A317E9F67DE924DD9EB0EF /* FBLPromise+Always.h */; }; + 3808CC5BF27646323FE7F3B11B7775AE /* target_authority_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 305C8A6F686BC6581EC1248F92C42D3B /* target_authority_table.h */; }; + 382D0D6C71AE59219DDAD4D735AC68A7 /* timer.cc in Sources */ = {isa = PBXBuildFile; fileRef = E2E29F23DDF6AF6D901812E7136A68AC /* timer.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 38302274EFC1732E53324E0C6769FD5D /* GDTCORClock.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC4E0650D504476E993AE3C31F9192F /* GDTCORClock.m */; }; + 3832B933336A93B6CCD4ACD8C26C0AB6 /* umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA61E1B16406097B9C59D176E6870A2 /* umbrella.h */; }; + 3833E748083BE664DE8B03CDECF75715 /* GDTCORConsoleLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 24C3244EFC3C88261038CFBEF04E22AC /* GDTCORConsoleLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 383C96A3A1714709B1C312848FCED033 /* FIRConfigurationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 363650DAA6C5D3C6FA491B0B1432A1CD /* FIRConfigurationInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 385718DC7EA8B3DC6FE9C410BD008DB0 /* dynamic_annotations.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 657901658F4CB37D372FC3801030D114 /* dynamic_annotations.h */; }; + 38870D6A9BFB165C40FE2DEF16531A93 /* tmpfile_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 781C38AB608E1AE0427C1F5D50011524 /* tmpfile_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3895C38465CE97B97DB80449E22F35F2 /* FBLPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A664B7F32C368F559FC343E0895B515 /* FBLPromise.h */; }; + 38B8E9E0A13F1E5B693BF993DB44F9FB /* socket_utils_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 253470E49DDF43BFA861CEA1B9873E55 /* socket_utils_posix.h */; }; + 38BD386440063C08899050AC6BC6ABEB /* const_init.h in Headers */ = {isa = PBXBuildFile; fileRef = F5870C1FB9B406541E9791E36FD3855B /* const_init.h */; }; + 38C0279E89D003C73284A6B1D4177E80 /* hash.cc in Sources */ = {isa = PBXBuildFile; fileRef = EBF73FED0C4D64C0CEFCD8D20F5E93FD /* hash.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 38C707356E7261340C4833759378C03D /* load_system_roots_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DE46C3FB48C77001FC457A97887CA79 /* load_system_roots_linux.h */; }; + 38C9B60E3B75097E6E319B150790EA83 /* server_chttp2.cc in Sources */ = {isa = PBXBuildFile; fileRef = 426608583B60E305CCCCE4C445615B99 /* server_chttp2.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 38DFB01A7BA79A39638B84A7F2893349 /* GDTCORRegistrar.h in Headers */ = {isa = PBXBuildFile; fileRef = D175E244220CBE3EDA640388DBDCA2CF /* GDTCORRegistrar.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 38EADA8ABE2615BB8B8E7D090463C40D /* grpclb.h in Headers */ = {isa = PBXBuildFile; fileRef = D51158DEA1DC70A7141E4DA7BB36FF1C /* grpclb.h */; }; + 38ED1D38FB122AE6D10EACFD70E7CFC1 /* connectivity_monitor_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3353976E4911A92B46473E8FD680703E /* connectivity_monitor_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 38F7614BCCF3525CB35631CADFE8AD90 /* policy_checks.h in Headers */ = {isa = PBXBuildFile; fileRef = 407F2336D528FAE4942037AE24703D4B /* policy_checks.h */; }; + 38F90F62664F51AAE2DB5ECC0D62606C /* GDTCORAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D25CDDD9A88978F014D4A99CC3B37C6 /* GDTCORAssert.m */; }; + 3904722F2164DAADBAD3AEBBB306CFAF /* serialization_traits.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 4DAB80ABFC5C5709021BC0268A3CA1CE /* serialization_traits.h */; }; + 39125AB67ABC6CA53FB5A1703FAB9C1C /* ssl_transport_security.cc in Sources */ = {isa = PBXBuildFile; fileRef = 733103FD9FF89DCAAE38FCA5E7848460 /* ssl_transport_security.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 392E86B85A4BCE20A55BB49C9F12B772 /* server_callback.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 2CB28731A55CAE12BF53A8FE971AFEB2 /* server_callback.h */; }; + 39423405C6EB4986EA9FCC463CE6FD17 /* pem.h in Headers */ = {isa = PBXBuildFile; fileRef = E3805AFA476B3217C1F1BF3D044E927A /* pem.h */; }; + 39573E4DFEDEB4851E49FF6EFACCA2C6 /* FBLPromise+Retry.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F00BA2A6D7DC421EE71DB8F625BE28 /* FBLPromise+Retry.h */; }; + 397A24EBEE57DA57FC789683DCC7E960 /* resolver.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = F99567E10473566C36B7068F1EE6F56F /* resolver.h */; }; + 3988BE879FC79E4A25790E9E98ECEBF9 /* http_client_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = C971340180014EF94FAA2EC4BCC9DAFC /* http_client_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 39891F86B6161B8A6D52A2E7FD936E7B /* xds_channel.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 58C239FC8F94B514BB08EEAB2C2A1466 /* xds_channel.h */; }; + 3999BBDA39F6391FC2C47AA7E10AA593 /* executor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5EF2CBC6AD04A4862AAD83FA3CD8CB /* executor.h */; }; + 39B08DA6D74BF610EBCD419154EC4457 /* tasn_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 2FAF69DC4853BE7B2EB671C87AC4FA0B /* tasn_new.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 39BAF7C7F2E7B192906FDCDA4C35EB98 /* server_address.cc in Sources */ = {isa = PBXBuildFile; fileRef = B92C6DF5A8773B02B200E0C10CBD35A5 /* server_address.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 39BCDF8394B6ABD5CB70B171963A2664 /* validate.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2040C110BB160079D3AD87D98859F6 /* validate.upb.h */; }; + 39C08D85255F9FA0120B36FB7AD4AD08 /* nameser.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = FD84F7B7BE1474B065538076FF17D61C /* nameser.h */; }; + 39CDA1B1E69818FF073F18E95FD17EA1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 39FB84E82AB40EFE6E9234780367C951 /* empty.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 52D04F00250DA3B85F9DFF84A81E710D /* empty.upb.h */; }; + 39FBA0D0EF3EA9D000DCAE839017BB19 /* sockaddr.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 9079CFE7F4F28E98663140AF17AB39CA /* sockaddr.h */; }; + 3A20C063411BEE823E8DD7C9BB2BC6A4 /* ssl_session_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = BC7837EC1934C77FD3D8F0DC9948586D /* ssl_session_cache.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3A2BC80DC9A819094D93EB00D5A1E382 /* ssl_session_cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 34391FEAE71B56A3166780B622652052 /* ssl_session_cache.h */; }; + 3A2C1C32065460FCF0AEEC0D54994997 /* atomic_hook.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 287E26C9E3791FABB0831B7AD94A7AF5 /* atomic_hook.h */; }; + 3A2E73025C2EFE1E085BA17E885A12FB /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 72A32A4BF6281371B497549A499A9F2F /* aes.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3A317CC259B2112C423AE449E5146B5A /* e_des.c in Sources */ = {isa = PBXBuildFile; fileRef = B3105A65AA18D123210C1BEF70CD091C /* e_des.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3A3A2443E85227CC0F7B7089994F4374 /* ec.h in Headers */ = {isa = PBXBuildFile; fileRef = D08A7E6F91DB7B01CF0FEAEE5AD4DDBB /* ec.h */; }; + 3A3F856F6EBF540236F195FFCA443052 /* civil_time.h in Copy time/internal/cctz/include/cctz Public Headers */ = {isa = PBXBuildFile; fileRef = 66E112BD27CF895BC81D63432C53B66D /* civil_time.h */; }; + 3A5921DC6787172CDCB3AB2DB0E144DE /* varint.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0E5DC2574ECAB35140C4432C125301E9 /* varint.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3A6E586A86B13BE53D9024C7E60F4C7D /* message_compress_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4333A065C00392A33513D7E58EE8AA2C /* message_compress_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3A6F0F3321699083415AEBECEFE4B331 /* xds_bootstrap.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 66E80990B7602DE869237F057B85CB28 /* xds_bootstrap.h */; }; + 3A81303953F7434AD4C327515374095A /* security_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED18D5D434887DC1392437A8F376A33 /* security_handshaker.h */; }; + 3AA7AB6C6E7609995590D38C07FAE062 /* FBLPromises.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 5B072266F91315365F609A1AD22E0851 /* FBLPromises.h */; }; + 3AAE4F9ABD228EE366988A21878AF972 /* direction.cc in Sources */ = {isa = PBXBuildFile; fileRef = FB3455E17C4C9DCB88F0BA9EBBB368D4 /* direction.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 3AB57E57290B21CCE33AFCD6F4076C0F /* google_default_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 030013C730D65D48EA49BA6310252C9B /* google_default_credentials.h */; }; + 3AC84A30E486B34E2FA8D17E4113B949 /* xds_client_stats.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = BCB66564FCB5BC008A67488E854FFC22 /* xds_client_stats.h */; }; + 3AE5E1DA64A71EC38EA6D11A772B4165 /* uri_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9920D84C7F5A89495E59B2BCC0BF8FFC /* uri_parser.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3AEB38D52B495886D86B722DEF52FBA1 /* stacktrace_win32-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = E94733C68F02C4AD46CEC1A93576EF61 /* stacktrace_win32-inl.inc */; }; + 3AECC2C88670E4C811E298D308A004A7 /* cluster.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = BE4E7E7FBE269A8D8925A4C2B7D3BD0A /* cluster.upb.h */; }; + 3B1787D0712CA51AD1D9FB1E8D2328BF /* timestamp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 630CFC57E0EB1039CC050ABF6B80618A /* timestamp.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 3B1FA3DF27B7040FA2847B0500A60792 /* channelz_registry.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5650C58CEC45512D23502D6789F4656F /* channelz_registry.h */; }; + 3B2140184AEEF2FAEE26F0C40D060E67 /* zone_info_source.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4A8A2CDF6BEB3571DC25A01CCB30A869 /* zone_info_source.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 3B328BD5100AB62D4A4AA2B0011E94C0 /* inline_variable.h in Headers */ = {isa = PBXBuildFile; fileRef = 8028A5B3D7DA53E4582C3E730E757ED0 /* inline_variable.h */; }; + 3B8BD926656F4AE16A5B4F2EE8C68B54 /* completion_queue_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 31CC97CB5DB9C22723097EBA3F9769A0 /* completion_queue_impl.h */; }; + 3B94014FF64A3CADD0AFC8E05CDD7721 /* stream_compression.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 0D4F1ED5380B12CD82F023BA482367C0 /* stream_compression.h */; }; + 3BBAB1728012F47BE1C800D7132E14BB /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = B0ADA63A8AF80A28367FA30360B70EDB /* listener.upb.h */; }; + 3BBBF03E04BDD415B880197D6079C541 /* thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 31F9594AAD58371E0A4E511067F71A4E /* thread.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3BCB8D97A84ED7D589B0BF5D3076920C /* struct.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 19E856387C9916C6CB8F132F974B43AD /* struct.upb.h */; }; + 3BD4459C830AD51059464F355D060C4C /* gethostname.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 938D47EB98925AAC75F84424C624BD35 /* gethostname.h */; }; + 3BD4ADBC4997E7100D798A4C8886D828 /* grpclb_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = E396080735EF6DBEBC78DF1530D6010B /* grpclb_channel.h */; }; + 3BD92A75FECA6C05D6A63457C69218C4 /* resource.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 835524689A096870E9893C71B94C253A /* resource.upb.h */; }; + 3BEBB8E74B44E2F7EBDECB66304320A9 /* env.h in Headers */ = {isa = PBXBuildFile; fileRef = 2FE71EFE1211CCDBACA64EADB156F322 /* env.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3BF9837D710F829B55369EC2C2507F78 /* wrappers.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = B2B2AD4A805ACAE37CAA1D85222E9219 /* wrappers.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 3BFEAFA3B2FAFF8F2FB5ECD68EEF5445 /* error_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = AC4D2EB60ECE5CF6ED2237BDA6E79CA3 /* error_utils.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3C1AD76B18D175D89F6D0329D233C051 /* hash_policy_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F8E363F9CDE38097105618252EB3F2 /* hash_policy_traits.h */; }; + 3C28156B6812E4F00841F662B80F818A /* eds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 8A8CD361B2A2D4A86816AFA83E23A5C7 /* eds.upb.h */; }; + 3C57055E756C2F8DF7F7A425ADFEFF15 /* mpmcqueue.h in Copy src/core/lib/iomgr/executor Private Headers */ = {isa = PBXBuildFile; fileRef = 6378779BB664AE75A73E8345EF9F1901 /* mpmcqueue.h */; }; + 3C80FD8613B9384EA70B6821723F06E4 /* thread_win.c in Sources */ = {isa = PBXBuildFile; fileRef = 048660E3AF6CB3E3B137F63962C883DB /* thread_win.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3CA75D8EF6EC8D5EEA74D48251E5154F /* grpc_library.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = F2BCB5A6E163E223AB4EC37942EC748E /* grpc_library.h */; }; + 3CA8636936BDFAE0B4E64FDB6FD07DF6 /* global_config_generic.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 9FC3305A5F3D8A40C5B58619C09FA24C /* global_config_generic.h */; }; + 3CC47A4B81121F438DF3DA608C24DA3D /* cpu.h in Headers */ = {isa = PBXBuildFile; fileRef = EE15F12E75AA3A66DE9DF6E8E4EEC935 /* cpu.h */; }; + 3CDBF4175B112FCD06D1ECB0B83DBBF3 /* channel_stack_type.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 6E712B22330FB2E373E230870DE2E459 /* channel_stack_type.h */; }; + 3D089CE2B9DEF100020206FD38A4D8A4 /* context_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 560E9A1167F4EEF8C1F655734DFC88EF /* context_list.h */; }; + 3D10A97DF08DBF35F7CFA22A81E0B774 /* grpc_shadow_boringssl.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 050849C7F064DCED00CFCA2CCE677D3C /* grpc_shadow_boringssl.h */; }; + 3D130AD66C64F6B49FA11D9A0296759F /* mpmcqueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 540B135F8C7CDC06240F239A59FE9F4E /* mpmcqueue.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3D1FDA5B54C21166ABB791D9BF27F54E /* FIRLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 70E37422BC5C235944D781B14FFFAB1D /* FIRLibrary.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 3D33FC599C89FC92E9A1FFAC60536DCF /* bn.h in Headers */ = {isa = PBXBuildFile; fileRef = BDD36E0AD59593429CEEDA4EA237E1C9 /* bn.h */; }; + 3D4D841A56FF4A4C8D900E39DA7865CB /* channel_stack_type.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C80EFEA0137B3537C4392910BD6EF74 /* channel_stack_type.h */; }; + 3D68FEBE36D9DA1DC98344247DDC0F2C /* sync_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 29C0B7E0B38BB64BD690959BF13FA3D5 /* sync_posix.h */; }; + 3D6B81D54E4B943C77A36B678C0FE570 /* gsec.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AD01CBC19BBBB43A67E6767D3181791 /* gsec.h */; }; + 3D724D67FB5FC8722266D7D935D5F21F /* x509v3.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 518BCC9BA5A8A2E47689691FB7BC8DD9 /* x509v3.h */; }; + 3D802EC82A00339B24272876F6EEC20A /* env.h in Headers */ = {isa = PBXBuildFile; fileRef = D7F0EFA07241EDB7C86BBE9C0994F124 /* env.h */; }; + 3D8664B92FE4347ED9A2C1F93BE29AD1 /* combiner.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = AF22FBE9343697E005570E9F0B43BF4D /* combiner.h */; }; + 3DC3F630FABC9F17B1357ABCD44B515B /* alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1913DCB78682B6D5A6D7987739E4C702 /* alloc.h */; }; + 3DC94D882D0CB731FC2CAC9C11AAFD6B /* metadata_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 822D0C3423CF2B5CA2E2F2473A5EEBE8 /* metadata_batch.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3DDABA0E6BD4A84766F70DE9B650490B /* md32_common.h in Headers */ = {isa = PBXBuildFile; fileRef = B9B3D3B27E959FE34D601455F52B8256 /* md32_common.h */; }; + 3DF009DA75A41BB166B5C65304BBCF24 /* ec_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = E15CF7FDB27C66EFBE8FE47724E53215 /* ec_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3DF0B13129E3CB2D100FD209CB177CCE /* mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DD342F2761D43D340F2DE16B63412B8 /* mutex.h */; }; + 3DF0E1CEC8CE8DC4844E69AD11C197F2 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = D8D13B6B6A0E82411728078AC4F21571 /* macros.h */; }; + 3E04E39DA776650179F9D19831856F9D /* int128_have_intrinsic.inc in Headers */ = {isa = PBXBuildFile; fileRef = FF759DBF5FF7A93E89C5041696E05D6D /* int128_have_intrinsic.inc */; }; + 3E1837FB6AE0E494341138C041315BA7 /* any.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62D4A3694FDB279D23D1D9A697A08821 /* any.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 3E18E5F9B553D21DDC1D3A2AE267ECC5 /* pool.c in Sources */ = {isa = PBXBuildFile; fileRef = 52AD23F2AB0C25B54942E69032F7E604 /* pool.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3E48D3CC0D6D4F89F22CE7B2E493E13E /* periodic_sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AF41BCD737855422A8E60BDEBFEB02C /* periodic_sampler.h */; }; + 3E4B201CE573A25B315ED57626A4442E /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = AA66DFD8E5E6CCC24E2C6AC53B722682 /* div.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3E58D60C1CD010CD83783E15B5A46551 /* deadline_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3264F286DBC219137465BA6C19CB09 /* deadline_filter.h */; }; + 3E61702D21F4C751E28B7B09DB47F78C /* ssl_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 0C31DF07FC035EC1690AE609A446AF56 /* ssl_transport_security.h */; }; + 3E7EE75D380FCDE792B502E564F89DE1 /* FBLPromises.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B072266F91315365F609A1AD22E0851 /* FBLPromises.h */; }; + 3E7FFB0DDD2FC2569824262804DBFBCA /* wrappers.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 5FBBA7ADE29FE86D71F484593F1D26E2 /* wrappers.upb.h */; }; + 3E8062E04E18EBAD13FB3BB8CCDC83B1 /* grpc_service.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 5B55226C83EA202B83BDB45C3DBF7D4C /* grpc_service.upb.h */; }; + 3E92E576FBC4AED3C8FC43020FAEAE85 /* GDTCORStorageEventSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 40633848FF26A08A6737B41BFA03446D /* GDTCORStorageEventSelector.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 3EA62D5902D146EE395F18294371A655 /* http2_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = F64F1939265A0552BA2F9A53AE1B5AD2 /* http2_settings.h */; }; + 3EA9E7BCBF057F895BFF2EAD5B266364 /* lb_policy_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BBDF31030AE611AC41E8C05ACD93118 /* lb_policy_registry.h */; }; + 3EAB768B686BBD59BA06637ED185FA4A /* timestamp.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 54322520C1C7EC65A9B03907FB292FE1 /* timestamp.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3EBCF140D634A3CF5957F3DB17959C87 /* frame_ping.h in Headers */ = {isa = PBXBuildFile; fileRef = 20697784672ED522459F591E8032AACF /* frame_ping.h */; }; + 3EE5611D5B1B3530863585D0B4F6E551 /* murmur_hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C5299A5EA2E3D8DFA6E4A0A512D2621 /* murmur_hash.h */; }; + 3EFFED4AFC0510DF283F55C3B611D2CC /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F2A658368ACBCF2310386D030BB10C5 /* port.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 3F00E9ACA584ECAFFD97CE4909EB5B84 /* cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 708794D61C44B97FC187ED209D1EB8FE /* cache.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3F0DACBC1069A224B6BBCEB03B0533CC /* scoped_route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 9C59E0F8D64C904B6F3DF382FC1943AF /* scoped_route.upb.h */; }; + 3F179132BB7AF8BCF841044CE45DDDEA /* socket_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A82A7E8392D43AF8038FF0F727AD5AB /* socket_utils.h */; }; + 3F18A743F5614C1499E11593172BD7F0 /* lb_policy_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9BBDF31030AE611AC41E8C05ACD93118 /* lb_policy_registry.h */; }; + 3F1A78439875F6B461793C6059666D7F /* iomgr_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 905EF31577DFDD0EE1E8AA78E7BA4BA5 /* iomgr_posix.h */; }; + 3F1A92B11D7C6A52CFDE7679FCF39834 /* low_level_scheduling.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FD61DC34AB43E983BA6082C5263B028 /* low_level_scheduling.h */; }; + 3F3576858B52509E54B64A2CDAD9D342 /* port_def.inc in Headers */ = {isa = PBXBuildFile; fileRef = 3AEC022C82A3CA5856F4649FF5F712AA /* port_def.inc */; }; + 3F3AC294A1E4F865021B88E61E2CF4C4 /* coding.cc in Sources */ = {isa = PBXBuildFile; fileRef = 251C8F835383CBFEBF8FC7DD51F74D6B /* coding.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3F505A3D55090FA1E6EA8E8CD611AD31 /* http_proxy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = C0A84F8A336DF72C0ACD14A34CC6B4E0 /* http_proxy.h */; }; + 3F7A072928942C356AF9818975C94B06 /* bad_variant_access.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = 1911C0C740F0172D7C5A5A2E4B6B8C9E /* bad_variant_access.h */; }; + 3F7C093340039C2DDA464CB0512949AB /* server_callback_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C77AF6EB4EA42AD0D875AC763515E4B /* server_callback_impl.h */; }; + 3F90BEB1B1464E0EFB2E057C105883A1 /* memory_bundle_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C160A8AF03BE920E0B92B72393912B5 /* memory_bundle_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 3F9D38E306459747D8298F7A7F48D530 /* pid_controller.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 16EB7C7D422AC2646E0FBC639CB66C91 /* pid_controller.h */; }; + 3FBBCAC2BBC77B280853403A7CF1CD31 /* handoff.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F1259B1A2443FE3FDB39AAD4AAC3D08 /* handoff.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 3FC52325A7BE6DF2E20536A96E8AFA27 /* socket_factory_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = BA89020A58C9CEAFC4D18F0F7D08B551 /* socket_factory_posix.h */; }; + 3FE0A308CF6D68CC164FD054F9C74909 /* chttp2_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3DB54510A83FDE9E6144ABD2AD77235E /* chttp2_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 3FFB1EC471E07A3873A8CC1CD4D73322 /* frame_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = A2487D73586BB044B7A6D3BAE481FC73 /* frame_handler.h */; }; + 4002F73CCC23D0152F91D90A13A6137F /* v3_utl.c in Sources */ = {isa = PBXBuildFile; fileRef = 879D1DA6F99C4758AF4422AFC9DC4A14 /* v3_utl.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 403F32A974DADFC5EDD7B5C49EE3F153 /* sockaddr_utils.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 86774CC4E513D98DAA8A5937084DF598 /* sockaddr_utils.h */; }; + 40430F60D34D42562375133EC6292D45 /* format.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8BD6BA7A02447C17B981A29DEC24BE90 /* format.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 405B8855B213D073E55A557D8132901B /* ev_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 853299A1FB498B3CC03E06CFB16D1343 /* ev_posix.h */; }; + 406421478002FAE79A67FBBE8D4B5E50 /* bin_decoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 6E2F7E0A38A3803B3D985992CF8E602D /* bin_decoder.h */; }; + 406E9834573922C7415A946E710C3BB2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 4077FFFC9F912BD94B5992041E972DF8 /* filter.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = FE3D599FF436D35431DE4C357824F0C7 /* filter.upb.h */; }; + 40915CC072FB7C334C4E367BD79BBC48 /* json_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = FFC253B3258E7A9D1C02245FAC42D0D6 /* json_writer.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4094A5D7F50E2A7995EDC2B22CBDA287 /* cluster.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = BE4E7E7FBE269A8D8925A4C2B7D3BD0A /* cluster.upb.h */; }; + 409AA2C05221428703382F99D6382F23 /* string_view.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFF21DE94A5E94BB5306A5FE74D66BE /* string_view.h */; }; + 40BC9DC5D4726758155855661E943B27 /* call_combiner.cc in Sources */ = {isa = PBXBuildFile; fileRef = C11001863E0DC4ECF24BC41B2E2351B2 /* call_combiner.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 40CCCDADB074D830BF98B67DCED27887 /* rand_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = A45B2607AB28FD02DDED58B5FC26BDB5 /* rand_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 40D333D752C37BE7ADB400AF43AB332C /* obj.c in Sources */ = {isa = PBXBuildFile; fileRef = 195AEE4ADE9068B38ED51FA939D87C63 /* obj.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 40DB6243000AFEA52689CE99CB0EC54C /* FBLPromise+Always.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EDF1E0017A317E9F67DE924DD9EB0EF /* FBLPromise+Always.h */; }; + 40DBD9C8C075896202278464C452FFFF /* GULHeartbeatDateStorageUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 79318409836E677F346B550088F6BA80 /* GULHeartbeatDateStorageUserDefaults.m */; }; + 40E6CA3BA65A0A18D42CE80745CB5E09 /* secure_random_arc4random.cc in Sources */ = {isa = PBXBuildFile; fileRef = D02274CABF9691BE25B3701E08592D57 /* secure_random_arc4random.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 412F5D118FB1B6EAEEF8C0C8B2F52B66 /* inlined_vector.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = A80F3CEFA5FF9FE72EC0AFEC38F341B4 /* inlined_vector.h */; }; + 413418366BB7699DFA065A677173126E /* checker.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = 435D0F489605EADDCF177F734D741809 /* checker.h */; }; + 4141F02C3E0B1F9FEAB0B2F50D4749FC /* alts_frame_protector.h in Headers */ = {isa = PBXBuildFile; fileRef = B5BBC219C766DE7677982303868AD116 /* alts_frame_protector.h */; }; + 415793DB8D780695013D60AF2106EA97 /* socket_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = C78C141A9A2F8317180F5FA5798131FC /* socket_utils.h */; }; + 41628D705E80247E03AFB49E919C87F8 /* validate.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = E38F8F3CAA0B133C6DD9D6B7D4D632AA /* validate.upb.h */; }; + 416BB920676C01ABC50CC4B181B0A965 /* memory.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 8E93DF14EB4CE3B818C6A74286397264 /* memory.h */; }; + 4197C3E01F588E4BE03DE2C942076727 /* tcp_server_utils_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 4726FB4D018035E3D0C77A2B382650FC /* tcp_server_utils_posix.h */; }; + 41AED76458604EFEF5D51BFFBC3C6B26 /* endpoint_pair_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 22EB140C32995E200292BBAA294DD425 /* endpoint_pair_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 41CAC6FE0AC59DE1D22203CBEDE419CC /* ssl_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0D96ACD4271830E830F4D07B4B8CE1ED /* ssl_lib.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 41CBE8287EB4433A79AD6C591CA81620 /* evp_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 4E1B19D1B778FB9E04A9A994382EC36A /* evp_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 41DAAEDC44271D007A5F9C6BBC18CDF1 /* security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0816F65DA43C7261008884743B248B18 /* security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 41DDBD89A4D18DE8FFD683E36D882551 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EFA29BE5456CD955C742714DF6E6DF7 /* internal.h */; }; + 41DFFCAB752435624AD5C0EFF6DB5971 /* range.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B74CE35B81363F1FABC595B676CED52 /* range.upb.h */; }; + 4223D9375240878440DD7FDD150E4DBC /* atm.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = E0A614C75FFADDFB44252D45D892E332 /* atm.h */; }; + 422876B6E3E7152C65E656785FE22529 /* hpack_table.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 43C7929F6E2F822270B483898A8BE789 /* hpack_table.h */; }; + 4233FF237CDA2A286FCB18A574096202 /* interceptor_common.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = C77437A75F722B23647A5CFC01FB6905 /* interceptor_common.h */; }; + 425F892B5248496CA5C37FB09B941216 /* load_file.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E6FE678653823AFA359C6EFE7CACB4F7 /* load_file.h */; }; + 4284C18F2EB6E514DB6058491A0CC193 /* format_request.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = 06FBC15D3658E1B0EBE51204B312B299 /* format_request.h */; }; + 428B60D61D3AE3367DF4C513C5E70BC7 /* civil_time_detail.h in Headers */ = {isa = PBXBuildFile; fileRef = 8875E9D3E11A77D985AFF88AD7F3E264 /* civil_time_detail.h */; }; + 428D25677C03DF5B189B5DD2E0B05E11 /* tls_credentials.h in Copy src/core/lib/security/credentials/tls Private Headers */ = {isa = PBXBuildFile; fileRef = EB830BFD69D9FBE5363B26BA1BF01565 /* tls_credentials.h */; }; + 42913570E263FD28F549E96A83838398 /* client_callback_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = B7AED7340CC7A33CFA21702DB0C5689F /* client_callback_impl.h */; }; + 42A1E2B57C5459F7A36A6F8B657D7197 /* pb_decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A8392C419EB6ADFDFE1B5A27183E2C1 /* pb_decode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 42B21419C06F223C1ED3454691A943CD /* dtls1.h in Headers */ = {isa = PBXBuildFile; fileRef = E2836E8E06B07FFD41230B3CE181EF44 /* dtls1.h */; }; + 42B24E3D13E81B0677CC010115A79C42 /* time_zone_info.cc in Sources */ = {isa = PBXBuildFile; fileRef = A20C926E01A3071F5ACB1EBCF09A2FF7 /* time_zone_info.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 42BFA8D44C36D79B7F64BA00425B1E7A /* channel_stack_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA268B568DC346FAA7E9EA795F8A8C1 /* channel_stack_builder.h */; }; + 42CF12D99954964CC751B4231B578F0C /* FIRListenerRegistration.h in Headers */ = {isa = PBXBuildFile; fileRef = 6ECBAAAD9ECB59BFB369D702AF7F98B0 /* FIRListenerRegistration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 42E1ADCEF0A7179E55DD939DBE10FE51 /* memory.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = A60387F616E5571CEF9AE353F45D7C70 /* memory.h */; }; + 42E8FCED36FFAE10F0EF006B09414968 /* slice_intern.cc in Sources */ = {isa = PBXBuildFile; fileRef = CDD9B22F6A71F521E4C000F493C1E179 /* slice_intern.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 42EAAAE7EB1AFD8D2DE9A6DC9A2FFC3E /* composite_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = F5E25607BD68162D90074FF9D1A0FB1A /* composite_credentials.h */; }; + 42EFCE3FD60736360DAD4081069AF31E /* conf.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 5518FAF1F576E58EFB99A2A9F0E62AE2 /* conf.h */; }; + 4327FAC03B676B7F476EC72BD43037C1 /* rpc_service_method.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = E5C24F3890C4CE6C36359EFEE0F6EB41 /* rpc_service_method.h */; }; + 433599187A94B4A983DB287E3528EFAD /* resolver_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D2C92CDD47A8E0BA122DF484CFE82FF /* resolver_factory.h */; }; + 434140CFFD299E1E6F060206FACCD9FD /* log.cc in Sources */ = {isa = PBXBuildFile; fileRef = 15FDC3CBDA967B9D461007ACE3C673B3 /* log.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 43611F29A3335C4BC804B0356193A966 /* transport_security_common_api.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 2C44E3A313385725A97F0F3C6F66E6AC /* transport_security_common_api.h */; }; + 43A403E816A22649C41A3B8F45BF67E7 /* frame_settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BE76444A49FA1615624EAE8A8FE1EBD /* frame_settings.h */; }; + 43AB7020C1FA1FEC7B83D87D1D4FFE05 /* local_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = DD2B8AD9B43921BA75454041D5201225 /* local_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 43B276CDDA0CCF3C24250814A5C2E5C3 /* FirebaseCoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DAE5600E0080211F843A6E5FD4EB450 /* FirebaseCoreInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 43BAFFD81082505AB7743F5A0EF5617A /* pb_encode.h in Headers */ = {isa = PBXBuildFile; fileRef = D8CB6409C7D345E216597170BB01A5AA /* pb_encode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 43D39F9F646F8D520AA453132E43F4CB /* clock.cc in Sources */ = {isa = PBXBuildFile; fileRef = 71C90E2B37FD0C40CB7DCE9B35201228 /* clock.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 43D9A431A5C16A7F03836FB6ACE1BDE1 /* child_policy_handler.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = {isa = PBXBuildFile; fileRef = 6008611CEF4CB9DBD49DABAD59E11A8E /* child_policy_handler.h */; }; + 43E717C6A660D12964B46F1DEDEAEFC8 /* ssl_session_boringssl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5D3BE554095280180E5BD93BFA2ACCC2 /* ssl_session_boringssl.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4408720482E92CE78FA2F6DEBC38B31A /* http2_errors.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = C84D9865D597EFA2055680E9A871A64E /* http2_errors.h */; }; + 440E0C603012655B0E75C7F8C08AF502 /* encode.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 7C1153C3709FD9A3F88D22CA47AC1150 /* encode.h */; }; + 440FE05BC5833A0FC57B75144729431F /* handshake.cc in Sources */ = {isa = PBXBuildFile; fileRef = 25F1B5715D38B4B9E70CE4A49C87ACB3 /* handshake.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 442142BB8AD01A66BCEA08C1776D0D65 /* internal.h in Copy crypto/fipsmodule/sha Private Headers */ = {isa = PBXBuildFile; fileRef = 1FC5AA96F90F0E7EAE181267AF9455AE /* internal.h */; }; + 442353387BF8895EDEA1FC4F46F93B24 /* msg.h in Headers */ = {isa = PBXBuildFile; fileRef = DF811445B1994FEC29D209515B12871B /* msg.h */; }; + 44307D093806F4DF212EC932A838988E /* x_exten.c in Sources */ = {isa = PBXBuildFile; fileRef = CF2A5FE548133BDB401A39ED658C5664 /* x_exten.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 443300C5840BC19C2607A5A05DD6BD9E /* wrappers.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = BFA7899F031EE1AD276272290F6723D3 /* wrappers.upb.h */; }; + 443AF0DE6E69FDB93D4C36E78EFCD813 /* create_channel_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 44651260A080C7B0ED2C0D690EC8E8EA /* create_channel_posix.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 4474BC8E57A68F720EDF5C091D6E0D24 /* resolving_lb_policy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AF1BFE885DC98B707F2D7B123D87B05 /* resolving_lb_policy.h */; }; + 4482A24716DAE8ADC506D10D785A23CF /* route_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B0188D071A2BAAE8F6F853ECC2F8A9D /* route_components.upb.h */; }; + 448AB05A5B356E9AA53AF60FFA42C985 /* inproc_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = 280C16391AAF3C3CCD571AEF613E0CDE /* inproc_transport.h */; }; + 449152B4E1AC7581027C6374D9AABFC6 /* exec_ctx.h in Headers */ = {isa = PBXBuildFile; fileRef = 511739E7E7C1E7FC6C57CD61A8F794D4 /* exec_ctx.h */; }; + 44A7603686B3EAAE3A7D5B599551C7BE /* tcp_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = D49C703E504A3D58320C1A833ABBB8B9 /* tcp_custom.h */; }; + 44A809F5748E6EEE528251EA1D2DF3A8 /* umbrella.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2BA61E1B16406097B9C59D176E6870A2 /* umbrella.h */; }; + 44A80F08A4325E134B33E48DFF21ED02 /* ssl_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 398FA6BE3CD65C056358FBE7EBBEDDC3 /* ssl_credentials.h */; }; + 44AA1652BF892B5A17A18C0D400F474E /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = 194809C76D8E87B035E30CEE09C01E08 /* listener.upb.h */; }; + 44AB08338B88858BC1EEF5AEE286F102 /* endpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FDB818CE2139D1F1F49FD25FBF04A68F /* endpoint.h */; }; + 44C7624479EC9AA6B65E9B28385451AD /* FBLPromise+Retry.m in Sources */ = {isa = PBXBuildFile; fileRef = 217E26ED82FF7D4D3EDF083AD0FEECDD /* FBLPromise+Retry.m */; }; + 44DD558C69D0E48C404075ED610A0A08 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = E529C5C7EE13336B343F49BB289452D1 /* frame.h */; }; + 44F26643132EC6963C506BE05CACBC73 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5E392FE59043AAD544555ABE745D5E /* frame.h */; }; + 450833679AAE7AF96219B7D4FEF34F72 /* FIRGeoPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CBFAA65733F56B7F9559726C8315AC0 /* FIRGeoPoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 450B4AB4A283148C2A597FFC23F50EB8 /* port_def.inc in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 6B4E8AF8FB86A15BDCA4002950C15A3C /* port_def.inc */; }; + 45143A6D372605CE33B5B29A5C976638 /* path.cc in Sources */ = {isa = PBXBuildFile; fileRef = 20923FB22CEB592E2B44256F10307779 /* path.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4527ECFCAF9D5592EFAB04D5CCB1AB2F /* rpc_method.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 7521C3B21B070A87DEA95363CB064967 /* rpc_method.h */; }; + 452D84F6C1D76F75EA2EE682DDB6F884 /* huffsyms.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D5C4C195972E9AD4EB8FA8CB1C17854 /* huffsyms.h */; }; + 453BF6F745861188C9FE984A16C06127 /* slice.h in Headers */ = {isa = PBXBuildFile; fileRef = AD20A9651BFF424572F741E7C677A18E /* slice.h */; }; + 454034AD82BFE242155BE8DE9BA69F22 /* a_digest.c in Sources */ = {isa = PBXBuildFile; fileRef = 9094F3703EDFC96E4658D133A7A6BE13 /* a_digest.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 454E5FF84D7892581CC9FB30D71BE40F /* FIRConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 93A3A27DE44CC98212BFEAEEC8370E4E /* FIRConfiguration.m */; }; + 4557E59D46BEB69469012FB217B5F7BE /* fake_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = F60F47E2B7FF6B33A23F66F1863C54B3 /* fake_resolver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 455EFA5100C89EFEE662231844D53FEE /* char_map.h in Headers */ = {isa = PBXBuildFile; fileRef = C0BCF9BBBCE0F13B2106AE7DFE12B7A3 /* char_map.h */; }; + 45686FBB2A9AD5E4DDB38958CABAC116 /* FIRFirestore.h in Headers */ = {isa = PBXBuildFile; fileRef = D9965082750007B191BFFE9F31B16108 /* FIRFirestore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 456BC3E83DF05B77D71BD58A6B51D1F5 /* FIRTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B3724F90A9B693A32BA7950966A27BE /* FIRTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 456BE38F6F6EB19008DF178177E7E8C3 /* slice_hash_table.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = B6D3AEDEACB3E48C54383B8817562AF5 /* slice_hash_table.h */; }; + 4575E2040143555DF1920E493CB057C4 /* http_connection_manager.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 00C8BD1B52446E60AC16BC271D818BEB /* http_connection_manager.upb.h */; }; + 457D132712B6F2D43D6AD4AE824B4CCA /* in_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = F628C3DF28DE01D9BE04EEC397AC014A /* in_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 459E0A2731227375C34F13D841DC5C35 /* chttp2_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8ABA3904F1F65AC67FE1F4EB01534486 /* chttp2_server.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 45AE69C2380A01CD49EFF1BD3CB3A88F /* charconv_bigint.h in Headers */ = {isa = PBXBuildFile; fileRef = CD968E8D4F3BCC435DB29548EDFF5C4F /* charconv_bigint.h */; }; + 45F00F750D84E1D875F5E1850B16ABE0 /* global_config_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FC3305A5F3D8A40C5B58619C09FA24C /* global_config_generic.h */; }; + 46137C6A44E178D25B1DDA97E7E06019 /* wakeup_fd_eventfd.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1C7C417D34B0A875BF3E27964F1D8855 /* wakeup_fd_eventfd.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4617C3663971AD051E064FE50979DD24 /* target_authority_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FE1F4833D4B78AB84329C8A1CB20104 /* target_authority_table.h */; }; + 4625F25AA0D55CF701451724D518D99B /* server_interceptor.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = B968209A67B472D066E21374175A4133 /* server_interceptor.h */; }; + 462F89CD3AAD78423310204DE6C466D5 /* status_code_enum.h in Headers */ = {isa = PBXBuildFile; fileRef = 76AD99BA252D8EFD6A4AABC74E6C3BC1 /* status_code_enum.h */; }; + 462FA41538912CA71331B8F1990BFB10 /* base64.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 18FCC60BBDEE8D35E75391A4ACD3E958 /* base64.h */; }; + 4630755B66748CCC6B1F2FEB013CD57C /* async_stream_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 8C20E5941418C595010D3682C18A08A3 /* async_stream_impl.h */; }; + 465BC389CCD2D909FE5DDD3C7385827D /* spinlock.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 69D2389FD8623A3C724B261FDD99F931 /* spinlock.h */; }; + 466E30CECC5719A9438A3814834E0590 /* stream_compression_identity.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = F6D33BF02C2D1EC08BF2F70E0BB36A01 /* stream_compression_identity.h */; }; + 466F0D443717A0BE766505B3C05457AB /* endpoint_pair_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 32E524FF275CF724F70E0D625A502FE4 /* endpoint_pair_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 467D1CDDE0E7B4519B3BE4EE9E6B9631 /* udp_server.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 7FA8F6C3A5A28CE127CB531C6F55F598 /* udp_server.h */; }; + 4687DD9FC43EFF8A4D0FAE4DCA0B6E8F /* tcp_client_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = AFFDBDD9C75E5BA8A2372D3866E0BFA9 /* tcp_client_posix.h */; }; + 469426415C642A8A659AA90AC476D62D /* flow_control.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E28F5EE7EBCCD7499F26B97589268F2 /* flow_control.h */; }; + 469ECE4FBCAF7989CF77181704AEE36E /* grpc_tls_credentials_options.h in Headers */ = {isa = PBXBuildFile; fileRef = A19F3068182DE62C6728C21C22646D12 /* grpc_tls_credentials_options.h */; }; + 46C792FC54C8C8DB1A4DC608FE869397 /* background_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 88E4B60C142EE92DB724A96E3D2CE314 /* background_queue.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 46D79886E2DFCED3F4CDEF86C304CA38 /* scrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 43ACF272241767AE195CBA6DC6B6B948 /* scrypt.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 46EC18C03C6C423E692B40CB34931D0E /* connectivity_state.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = AA95BD5E58480D50DD1606867D204B39 /* connectivity_state.h */; }; + 46EF29A183C834E9B65C5BAB97A9F67C /* v3_pku.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CE8A7E1DAF671E45FCD30CEC4C03F3C /* v3_pku.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 472D25FA00E74E2633FDB64DC31E8A65 /* FIRTimestamp.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFF0497467C0D05AF3D156549165A48 /* FIRTimestamp.m */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 474477F24F51E241BA3E148147B661C2 /* timer_heap.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3534D1D157B9845F8F2ACF43722EE98D /* timer_heap.h */; }; + 475477A63236C6683330C2F9F76FC70B /* call.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 7EE26BC24756397D2051B7CC194EF0D1 /* call.h */; }; + 47978E03FD7AB7DF06271BFC26849B41 /* wnaf.c in Sources */ = {isa = PBXBuildFile; fileRef = 4834AE0EA0304B56E352D8F6C5FA074C /* wnaf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 47CEA59B3A0A8E38A6FBD1CA339D561A /* bad_variant_access.h in Headers */ = {isa = PBXBuildFile; fileRef = 1911C0C740F0172D7C5A5A2E4B6B8C9E /* bad_variant_access.h */; }; + 47D5F4EAE1EC6AF4699334C33014E372 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC45A9314A6A47E4ED1ED2E268675EE /* internal.h */; }; + 47DD8A4CAE3CFCD35306D8FC837F4D6E /* address_is_readable.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 8E759C57EA1F07CB3B2FA315AC1D51E3 /* address_is_readable.h */; }; + 47DF1E2E646EFB2937155310E3286557 /* serialization_traits.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 630E9EC214F9E235473F8EBA91AA4447 /* serialization_traits.h */; }; + 47E38215E9DA5C7AB9B6DB0D651F2EF5 /* ev_poll_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = DBEE52BED394D61CA0C646C0C4DE1453 /* ev_poll_posix.h */; }; + 47F8A08FF86C506EFD055CEFB597685F /* hpack_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 6CC8110A37ACE35506B4F0D1694ABB09 /* hpack_encoder.h */; }; + 48012CDC5E2250E69F1890442DB4A56E /* prime.c in Sources */ = {isa = PBXBuildFile; fileRef = F34E5FFCFEBE7E0E425CD673A997E4E3 /* prime.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4805E91426AF266FA42C3E280B95F961 /* char_map.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = C0BCF9BBBCE0F13B2106AE7DFE12B7A3 /* char_map.h */; }; + 4815F789D44BCFF2F1CD37C921B1640A /* grpc_ares_ev_driver.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = {isa = PBXBuildFile; fileRef = 93C2111EBE4E82E47FE26059B387FDA2 /* grpc_ares_ev_driver.h */; }; + 48279C12A138864A9B407C56569123CE /* channel_trace.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 06A9E865AA36BFC1B00F9E7E745DE6F1 /* channel_trace.h */; }; + 4829A561B33A9EE0114C784A91B5FE4E /* cbb.c in Sources */ = {isa = PBXBuildFile; fileRef = 8DF85470DB4C77C87BB99B22F4B60E17 /* cbb.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 483370568955FBE6EB418161C1C4AACE /* slice.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = AD20A9651BFF424572F741E7C677A18E /* slice.h */; }; + 4873D714253A6345BA4DD63FD5ADB4BB /* alts_credentials.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 87E1EDC9D257A4A6ABD96CB40C8CB318 /* alts_credentials.h */; }; + 48749F9B35225D701E9D9A81C66C37AD /* opensslconf.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C1176295495A9747C0B9B9B03E9A680B /* opensslconf.h */; }; + 488D3219317E580B2F73C9212D1A1EE0 /* x86_64-gcc.c in Sources */ = {isa = PBXBuildFile; fileRef = 318C29D1AB28F79342E35099BACEED1F /* x86_64-gcc.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 489D6E089F27F59DD2B14474F48127D1 /* secure_channel_arguments.cc in Sources */ = {isa = PBXBuildFile; fileRef = F231F75A3EF0E5AC7BF05A7356CF6B3E /* secure_channel_arguments.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 48D2F6E22007377EBF2B5210CAA303F2 /* block_annotate.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = A5430633590CF29EFC7B2AEDD2AA5A96 /* block_annotate.h */; }; + 48F4D7EE9677167E0217B81B1611F615 /* internal.h in Copy crypto/pkcs7 Private Headers */ = {isa = PBXBuildFile; fileRef = 6899F70129CBD04132766D607E5F51F4 /* internal.h */; }; + 4900AB5C7C7D92A6ACB8BA28E8D8592A /* outlier_detection.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = 0AE2EB7309A8EB284195DA2B8C21DD29 /* outlier_detection.upb.h */; }; + 490709C27E053BCA97C4EDA04533FC98 /* combiner.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = FA738BD4985005BC8490C1FA0F63003B /* combiner.h */; }; + 49076CEFE1AB96565734163830AE687E /* asn1_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 50A491CEE1281637FF354DA1FB129D38 /* asn1_compat.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4907DED5C12039866DC8D38619A78738 /* optional.h in Headers */ = {isa = PBXBuildFile; fileRef = 63BBF2B4A372E1B2C092764230DA5B67 /* optional.h */; }; + 491407C6EACC99FE12CC0F7761901145 /* handshaker_registry.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 955633B7DC07D0A78D93BAEB2A94CA07 /* handshaker_registry.h */; }; + 4935439C4CC54271A9E001D3AEBFC5D0 /* server_initializer_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = BEB68F5A6FCCA598215C0060142CC500 /* server_initializer_impl.h */; }; + 493C417F91CCE6D7EFABFBE7901E6C46 /* vdso_support.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2BB47F23464FF6E8ABA7D7611B408883 /* vdso_support.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 49439BDC7126A4BA4B1BC186D679F03A /* credentials_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = A4B54D6420B3444FCD5BE511FE112605 /* credentials_impl.h */; }; + 494A9FF5AFDB48141ADEFE46CFE318C1 /* sync_abseil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F144783699836CF4D53EC2EA9790D3A /* sync_abseil.h */; }; + 494AB0C69187606B6748BC7CDEAA7FA0 /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = {isa = PBXBuildFile; fileRef = B890B6474BF0D27B4CD83FBF2973F8D5 /* route.upb.h */; }; + 4958EA27D9DE1D75C9A1F0D2E249ABB5 /* config_source.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B82D9E038D349AF015B40853CD1C09 /* config_source.upb.h */; }; + 49778BA408ECDE835DF441DC1B1DF48B /* client_channel_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = D18D87A1DA3DB8521F4839C5D55DF080 /* client_channel_factory.h */; }; + 4995D6AA3560C5CC5B16AA49C9ECA5E9 /* sync_generic.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = A491B7806FC7172EEB90073096906545 /* sync_generic.h */; }; + 49975A7B5D2D58429E0F37B7ABE2C630 /* ssl_session.h in Copy src/core/tsi/ssl/session_cache Private Headers */ = {isa = PBXBuildFile; fileRef = 5F5259DFB2A55854D10423172A45D1FE /* ssl_session.h */; }; + 499AA3E782811628D10E3C962E62038F /* grpc_shadow_boringssl.h in Headers */ = {isa = PBXBuildFile; fileRef = 050849C7F064DCED00CFCA2CCE677D3C /* grpc_shadow_boringssl.h */; }; + 499EB42789D90FDC8413A3D713416801 /* cipher.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 4215984B22861EEE66F7975BC8826B61 /* cipher.h */; }; + 49B228E95E7024CEE39B6066642968C5 /* error_utils.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7ADA79FF6900CC9538575985CA827E5D /* error_utils.h */; }; + 49C5CE0D19EBB57B19A8DA55213BB613 /* cpu-arm-linux.c in Sources */ = {isa = PBXBuildFile; fileRef = 2F43F0B5079B8BAD3706850C3E9D3EEE /* cpu-arm-linux.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 49F1DB5BE23463BF6C96340CA54E113E /* proto_buffer_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B9C02065259D4ADE30BA766B7D414A3 /* proto_buffer_reader.h */; }; + 49F50D50019F4D7C4548B049EE197B4A /* optional.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 96FA9461DDD51A9034CD0339B4C39969 /* optional.h */; }; + 49F9FD176A790535F8C1EDC4FB8A70F9 /* time_zone_if.h in Headers */ = {isa = PBXBuildFile; fileRef = 602E6064F0F2EB38B769534FFEA856CA /* time_zone_if.h */; }; + 4A164393CF32C3B1CE8F2EF5B21D0A7E /* FIRSnapshotMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F57D5223674DE8297E00191AE812843 /* FIRSnapshotMetadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4A1B57DAA9D6F1C4350DEAFA64AFCCA4 /* percent.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ECF9171AD5E45786ECEE9F91D9B2092 /* percent.upb.h */; }; + 4A21DEA5D97FC6653A6D206FD4DB71BD /* load_balancer_api.h in Headers */ = {isa = PBXBuildFile; fileRef = 5877DD34B3544A592E2E4FBC1D5DCAD0 /* load_balancer_api.h */; }; + 4A28CA55443D88FAEBB701F8D7AB8F8C /* FBLPromise+Timeout.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A705B5E2F23E918976FBD98D3A8110B1 /* FBLPromise+Timeout.h */; }; + 4A4D16DC73273A589206D8373B57603F /* stacktrace_generic-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = 60CAD879D8EACD61B88CCD724549E955 /* stacktrace_generic-inl.inc */; }; + 4A68CD5A0EEFD0B9089753752F3E2D39 /* grpc_security_constants.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7CC048BEE5432B20FEC4E3308BEEC4 /* grpc_security_constants.h */; }; + 4A7D58A3129B5739596EE13523041826 /* local_subchannel_pool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 593290B58B1DDA02987788CE5DEF7F01 /* local_subchannel_pool.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4A9202F3E05F3B1E71F7146F30CEC6CE /* bn.c in Sources */ = {isa = PBXBuildFile; fileRef = B9A7671B2DB654BDC0949E6996270A31 /* bn.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4AA09B67A86242C5EDEDC00B0C4FC335 /* json_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 6178ED876AA27BB64FEC736A9D17E490 /* json_util.h */; }; + 4AA7715811F3FF3CBD45CD02B89AE39E /* FIRAnalyticsConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E40E56CAA644830047C7CF84C5B8D78 /* FIRAnalyticsConfiguration.m */; }; + 4AD84927561D5FDD0026A2975E36727F /* span.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = AEEFD2B8E48EBF0EC01E473ED36CF46C /* span.h */; }; + 4AF6741F4D06CCF0F3E62C9DA940AB45 /* alts_iovec_record_protocol.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01B3A05C0CD77B8DFE62014D8A623B76 /* alts_iovec_record_protocol.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4AFF6F6AEEB2F3A88CDC9E610D909143 /* compare.h in Headers */ = {isa = PBXBuildFile; fileRef = 494B5FDC07A2EAFAF88CEAAFC0064DE1 /* compare.h */; }; + 4B2FF4DFC6D04238DC3D34CFCC7DDA23 /* slice_string_helpers.cc in Sources */ = {isa = PBXBuildFile; fileRef = A7AB7D7BE8033FF6D64EA64A1794DB65 /* slice_string_helpers.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4B318298C878E4A8C1AEE4D6975A4B2B /* e_rc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 1378E88D1012BCD79A53F91672210C39 /* e_rc4.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4B3FBB36833D77D4EC34FE232B36A88C /* GDTCCTCompressionHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E20745F47D7578D58BF2B679D05551 /* GDTCCTCompressionHelper.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 4B4605288F718A2B8763F160CEC7E962 /* cds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = DDFAC152A766E48750F028897C6F6DC2 /* cds.upb.h */; }; + 4B4830A217295A2288354BCEC539D49B /* protocol.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = BE185D6B647352A4F9246396D77855D6 /* protocol.upb.h */; }; + 4B502C8028E91CEF4A50392505CABAF8 /* errno_saver.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A9E2CAC4D607565A22567FB93A269E0 /* errno_saver.h */; }; + 4B5116D2C7DBCBFD4946DDE380BF4BB0 /* algorithm_metadata.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = D86AF0433110A71F87D564547D2A1C44 /* algorithm_metadata.h */; }; + 4B559A518B72878DF13CA46DF065F33D /* alts_credentials.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 64977221336CEF3D34926E7F9B2250DD /* alts_credentials.h */; }; + 4B57534CD5F18D5920172F7404C2CE28 /* jwt_verifier.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = DFEF90EAD503C39E0C1FE1AFAF69683A /* jwt_verifier.h */; }; + 4B5AA685438CE8B1996D7BC7F510664C /* status.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BFEA36C244F81A773B32DA6223A0AD4 /* status.upb.h */; }; + 4B6A77E6A17A39389270408B6E286BD5 /* serializer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7E5B04F1DA47B2A8B8880DC91CB6545B /* serializer.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4B6BC139B13921B9B3ADFB6FE20CFF81 /* any.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = A0D9F94DC9B38464FEBB8B25D355C0E0 /* any.upb.h */; }; + 4B6CC0B3BD7290B286D631DB23D2393F /* wakeup_fd_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 84E118DE4D5140F0155C18244BB54563 /* wakeup_fd_posix.h */; }; + 4B6F1109F98268976A95C4F2836563EC /* GDTCCTNanopbHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 98C2DAE80D13FFA966F0502660D6B186 /* GDTCCTNanopbHelpers.m */; }; + 4B72EE6E9BA2952A58465AEB73E988CA /* memory.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E93DF14EB4CE3B818C6A74286397264 /* memory.h */; }; + 4B90D5519A164ED7F11C00D105D5B2CC /* span.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D57E2123FA0697547374E39991A2107 /* span.h */; }; + 4B9F7C7491CE07E02755F5DC727FCDBD /* GULLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 0665600A3F802CD2D235A7CA08B137AB /* GULLogger.m */; }; + 4BCF37C63FA81742EFB36EDAF6E0AC97 /* remote_store.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6CB77AD39D4D25E7CE4D2C621C5A6F79 /* remote_store.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4BD32309139597E1EAEEC156B02C0A9B /* format_request.h in Headers */ = {isa = PBXBuildFile; fileRef = 06FBC15D3658E1B0EBE51204B312B299 /* format_request.h */; }; + 4BD46B5D5D38DC12B17E1E75088AACCE /* delocate.h in Copy crypto/fipsmodule Private Headers */ = {isa = PBXBuildFile; fileRef = 0B169F793DB8E2AB80E258594851EB38 /* delocate.h */; }; + 4BEAE4A8B31015042289BE9684B4AC10 /* wrappers.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = BFA7899F031EE1AD276272290F6723D3 /* wrappers.upb.h */; }; + 4C07CE123F2081767491DFB9B461233B /* local_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 6312A4C21F371141D02D36D7F37ACE37 /* local_transport_security.h */; }; + 4C1D07AA9A97747970955432D759E661 /* identity.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 87C4D55119C30A31119CF079FDA56C98 /* identity.h */; }; + 4C22509C5610862A897C9400247B9AB5 /* bio_ssl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8D56C137E519B6142CA42469541BC972 /* bio_ssl.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4C4638467A7A5E810DF65C571EC55194 /* load_system_roots.h in Headers */ = {isa = PBXBuildFile; fileRef = 99D1B1F2635C0B5AA5221EB976A3B24F /* load_system_roots.h */; }; + 4C578FCDE5A1831199DFA40A82BBDF15 /* endpoint.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C6E34D3BF3E17F698291949B8A853D /* endpoint.upb.h */; }; + 4C669A64DD9D272F49905CE83DD88E5C /* auth_metadata_processor_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CCF07C1E11206B22B474B76097194590 /* auth_metadata_processor_impl.h */; }; + 4C6ABE9E4CF8D4995C17FCE8A7C91C45 /* route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F9BF554EFFC04267916166595FCC2EB /* route.upb.h */; }; + 4C6DE5E6A08FB2AC077BD88C874B73A3 /* grpc_ares_wrapper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F2BA1E33746B7A3E852F8F7C2365178 /* grpc_ares_wrapper.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4C9FB10B9591B902E4F712FAC7CC50A2 /* sync_abseil.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = FF4A0E8DE8149F64767FF12775A0601F /* sync_abseil.h */; }; + 4CA838CEA6C5E89F8650BD0CC0401D39 /* handshaker_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7350DC0B08E336D1D3E82BF84F331768 /* handshaker_factory.h */; }; + 4CB2191AA8A2F8AC3ABA5EDC6E52394C /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = BADEB8C599956CA2DD1F03F5D3F4849C /* md4.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4CB538BF76B879428499DD063AC8274E /* error_utils.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = BA7135395A9444571CCD8E81298A659B /* error_utils.h */; }; + 4CBA5F4115EC090B6C81BD35A90BA17C /* version_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 73D31A0931A92A36F9CC4E6DB9D6AC7F /* version_set.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 4CCD0066195CCD8B797B37F94C6CC514 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 60DBA1068D5F2F91374DD33CC685B627 /* endpoint.upb.h */; }; + 4CEBD2A75E45E9C7E56C12CD1D508F03 /* obj.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 257CBA6F049DDC229362A2266A940B20 /* obj.h */; }; + 4CEC6A2414353C1BE59934456576DF34 /* FBLPromise.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6A664B7F32C368F559FC343E0895B515 /* FBLPromise.h */; }; + 4CECC01F60FB225770C33E5ABEA66B50 /* FIRCoreDiagnostics.h in Headers */ = {isa = PBXBuildFile; fileRef = 8821CF5AA9CE91D5372EDE8DC54F0B67 /* FIRCoreDiagnostics.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4D01C74D6AEF5ED4ECE1FE99C1741B04 /* endpoint_cfstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E91F82DCB0AECFDF7CC2719334D1909 /* endpoint_cfstream.h */; }; + 4D0325C9FBC332131498D1F10E53D246 /* iomgr.h in Headers */ = {isa = PBXBuildFile; fileRef = A56CC67B0787B694FADFA2B3B9015932 /* iomgr.h */; }; + 4D037FCF2D94F7A5745808A3492049FD /* GDTCORStorageProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 022CA1CB15A7268E67F501BEAD00C894 /* GDTCORStorageProtocol.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 4D12F71DE32B72F3D89D82BDEDAEC9AE /* v3_conf.c in Sources */ = {isa = PBXBuildFile; fileRef = 511AF504B3810F4058878C1F36AC6C54 /* v3_conf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4D1FB4B79F1D19FD7D4D1F6BCE182A9B /* statusor.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE639E980CC0E3D99D915F70F272A2D4 /* statusor.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4D33E41BF6266A6AFD834C27B2B4BE26 /* block.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5D6785BE81AE8168BC93D5294967FDB7 /* block.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4D39A49BB065F0B9A305C17B1BAD4F8B /* grpc_alts_credentials_options.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 527B0E3FDE01E7A23AF4B743981950B7 /* grpc_alts_credentials_options.h */; }; + 4D631DD7771CCA6321151DFE27054DE5 /* alts_grpc_record_protocol_common.h in Headers */ = {isa = PBXBuildFile; fileRef = A554763492A7AE4913B09C3FB632A059 /* alts_grpc_record_protocol_common.h */; }; + 4D807F6DC17B41A879F5791919B2C707 /* global_config_env.cc in Sources */ = {isa = PBXBuildFile; fileRef = AFDED5A80D701F4DCE0B5E71BF2BB9A2 /* global_config_env.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4D9DD1BA741C97EA187A496FFEFDD6A9 /* f_enum.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DAAB579BC114D3C3501C5FE3F75C6F9 /* f_enum.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 4DA8A3E3BAB5DC73AEF85CE535DD8BBC /* variant.h in Copy types/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 1D0606A8EF843A5D0FB70E85489D5E25 /* variant.h */; }; + 4DB76D7C8F95A5AF746183CB0F5E576E /* leveldb_transaction.cc in Sources */ = {isa = PBXBuildFile; fileRef = 51AFAA98EFF7906A36AC33D982A0C6B2 /* leveldb_transaction.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4DB8FF1FA5B5B03F734C6446B82721E6 /* tls_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = EB830BFD69D9FBE5363B26BA1BF01565 /* tls_credentials.h */; }; + 4DBAA7DAAFC90C5A5004FF0C781AD68E /* user.cc in Sources */ = {isa = PBXBuildFile; fileRef = CB304E6E4DDDD47D7B5FC05DB827965F /* user.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4DCB24CB835CD4F11C1C35D6421207B8 /* ssl_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CEAEB7D39DF0455F6BBB6B997BFF411 /* ssl_transport_security.h */; }; + 4DCE6BA545C4EC2B4A5CE38B4DCACDCA /* optional.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = 63BBF2B4A372E1B2C092764230DA5B67 /* optional.h */; }; + 4DE16D483BEA0E5189CA270FB9D7F664 /* dns_resolver_selection.cc in Sources */ = {isa = PBXBuildFile; fileRef = CB98B1EEEBA6CDEC82C29D97F81668A5 /* dns_resolver_selection.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4DE16DE1C41ED7155862C93E6ADE1FAC /* ssl_utils.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = B5E40543B08B101D409F25A9DFF58259 /* ssl_utils.h */; }; + 4DF438696A2F6D188AA0984F16256971 /* GDTCORPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 459AB63EDCA10BF23F45F3A64546AE8F /* GDTCORPlatform.m */; }; + 4DF6A8C070381763C0F6348B634A4D0C /* grpc_if_nametoindex.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3B138A1856E682C0F461A346EBF053 /* grpc_if_nametoindex.h */; }; + 4E1638E9AAF645A44C0461E9EFFEBC16 /* encode.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1153C3709FD9A3F88D22CA47AC1150 /* encode.h */; }; + 4E1BBC03584C0E74B0FB95E4166ABB56 /* internal_errqueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3E75DB6E8C23E6056B158209E0EE3D73 /* internal_errqueue.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4E28C356A3C9E1B4D6171012AB8B87B3 /* slice_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FB1B12AF7F7444EC885F1C15DF6677 /* slice_internal.h */; }; + 4E4DA40C1370EAAB3AEE134DA30F316D /* ssl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 9C292CBE769708DE151C297EEB3CA295 /* ssl.h */; }; + 4E501FCF264946BF11C49893A79AE732 /* float_conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = A2E4CB80A06EF267FB377C5873C2C90C /* float_conversion.h */; }; + 4E5D12460B1AB0E047E3F08C026B2B40 /* grpc_shadow_boringssl.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = E3B8ABDAC044FF0BCE343A472CE5A753 /* grpc_shadow_boringssl.h */; }; + 4E5F3DAAC3869C88F021533BD10A7008 /* channel_init.h in Headers */ = {isa = PBXBuildFile; fileRef = C04B2099E2F95F4843121C72BCAE1329 /* channel_init.h */; }; + 4E7C3FFA21D57C9B495FEFF71071162C /* json.h in Headers */ = {isa = PBXBuildFile; fileRef = DD41F1702EEAC76E0B5B7262243DE517 /* json.h */; }; + 4E7CB751F23950AF87BB60FF80AF0604 /* format.h in Headers */ = {isa = PBXBuildFile; fileRef = 475B7F4FA0153A9211E99C94E981B8E4 /* format.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 4E82E80E62A0C997593743C74F6CFD84 /* client_channel_channelz.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CD7E598A744FDA9FD16EC55E8643D1A /* client_channel_channelz.h */; }; + 4E8A7B311043691BA66D50C66E75AD2C /* ev_epollex_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = D582928E748E3172B559F84ABAC5F1AB /* ev_epollex_linux.h */; }; + 4E8C4C6BC152284F81CD8DE277008F67 /* options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8FCFA906BB703DD49BA7EE34935703F0 /* options.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4EA47C209886E4FF0DE189AEABADBAD2 /* endpoint.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 60DBA1068D5F2F91374DD33CC685B627 /* endpoint.upb.h */; }; + 4EDEF88663684D41EA24CFE13DEEA3C7 /* resource.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EA38BA2CF7F0A304CA28CAB63CF71A2 /* resource.upb.h */; }; + 4F006037F7BB6525745C78134CF9C574 /* address.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E63A1B0B7D97A30E89DE05BB773936 /* address.upb.h */; }; + 4F1E6D717AA8C232AE097C35D44ED640 /* stats.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = 61ACC90E8D73B8BDE98CD9AECF447C81 /* stats.h */; }; + 4F43529B15F194DF14E781503DE0E2F2 /* is_epollexclusive_available.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AE4EBC6D1F8771BEAAD41C611E60245 /* is_epollexclusive_available.h */; }; + 4F4FB685AED6024984DBAEEA169DC25B /* iomgr.cc in Sources */ = {isa = PBXBuildFile; fileRef = AFF231C1A7DC5993018B4C3F2AFEE8B1 /* iomgr.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4F55BB7998E559DD4C8894FC6020BD53 /* string.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F37AE6D86B05253605220AAA2B9D2AC /* string.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4F67F4745E1FD32710A2D6A0A12966EC /* thread_identity.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FC7512E0ACDD7CD8B912B01507B9BC8 /* thread_identity.h */; }; + 4F6CAEF8830DC3934FED4EA585D49331 /* stacktrace_win32-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = E94733C68F02C4AD46CEC1A93576EF61 /* stacktrace_win32-inl.inc */; }; + 4F715AFEEDAF121435166B14057B436E /* udp_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FA8F6C3A5A28CE127CB531C6F55F598 /* udp_server.h */; }; + 4F767589FD8B8920F20AAAAFC5EBE1C9 /* dumpfile.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3F292AF18FA858FCD857A193543E4F14 /* dumpfile.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4F7BB29635736797A04C692500CB670E /* firestore.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BE071EE977CA5001F9EC22ECDEF9AF8 /* firestore.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 4F9CA83FA154EEFB9CDFDB056D47BDB6 /* secure_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DC502B8F9EF1F8F9C4200695FCFD22D /* secure_credentials.h */; }; + 4FAC95830CEC35241F661832EE390DCB /* inproc_plugin.cc in Sources */ = {isa = PBXBuildFile; fileRef = B283E93B2457511449DB72A0FE8C556C /* inproc_plugin.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 4FB45B3D6E68DACCBF9ADF4A6888F4A4 /* connected_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF8997B901EE96A89E8661A022BEC92 /* connected_channel.h */; }; + 4FC2C20C89F4922427F60944160B1FDA /* method_handler.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = A67BB7E59B0B6A837B089F22CA423BED /* method_handler.h */; }; + 4FC4CB14DB1C1726CCD261486E9B3534 /* internal.h in Copy crypto/bio Private Headers */ = {isa = PBXBuildFile; fileRef = 1F6828B80F8240092CA6683D028CD7FC /* internal.h */; }; + 4FCB69AE1692AC512DDE6741A5358938 /* ev_epoll1_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CA902355FCDD4D7425028F7FAA3C440 /* ev_epoll1_linux.h */; }; + 4FCFD01E771AA74DDCDC6F865E42D0B8 /* ssl.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C292CBE769708DE151C297EEB3CA295 /* ssl.h */; }; + 4FD66333B1E7E0748A1DA7FAC0235A2C /* async_unary_call.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = B2FFB2EE419C9A72A3B8781CFF2B88FE /* async_unary_call.h */; }; + 4FF27A0FC57F8FD8B1B13CB40C027ACF /* sockaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = 5ED4CDF9DB6B970ECB686FFBB863545C /* sockaddr.h */; }; + 500394EEAA914C595AE39E3114BABF9C /* channel_trace.h in Headers */ = {isa = PBXBuildFile; fileRef = D611A40F8B6A2EF6FE12FC444F22469B /* channel_trace.h */; }; + 50211027F5270A47317EF949EB26AA4D /* channel_stack_builder.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9DA268B568DC346FAA7E9EA795F8A8C1 /* channel_stack_builder.h */; }; + 502EFDE3ED6E2258BA07DD5ECB88A6B5 /* client_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EEC13855B0D75AF2432EAB151AE5E33 /* client_context.h */; }; + 50438F5BE0528DAF734AE2606461D551 /* client_context.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 8EEC13855B0D75AF2432EAB151AE5E33 /* client_context.h */; }; + 50453405B2C0B1B1140C73D9805BFF87 /* context_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 204F44207D81AAC775BF1E202108F385 /* context_list.h */; }; + 5056C6777D583C5890A7A2FE8DD3B6FB /* client_channel_plugin.cc in Sources */ = {isa = PBXBuildFile; fileRef = 382B48D78383BA4EC5774D0ED1543DFE /* client_channel_plugin.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 50593BF914E4E4AA912620F62DC1028B /* alts_grpc_record_protocol_common.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = A554763492A7AE4913B09C3FB632A059 /* alts_grpc_record_protocol_common.h */; }; + 507D4777B06171CF68EA2883CF6D6536 /* backup_poller.h in Headers */ = {isa = PBXBuildFile; fileRef = F8B83F4A9E5AFB2DACE6E28615F69FFD /* backup_poller.h */; }; + 508D36FD074E5D5B2D1B3B309674847C /* completion_queue.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = D350394F4E41E95D5B38E70E61A66088 /* completion_queue.h */; }; + 5094C654F5B1A111DDE3627D7FBEB6F0 /* service_config.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3FAF9183B212D36621D019982E9AEF75 /* service_config.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 50A3F25E9000FFEE36CA9A2641334782 /* channel_args.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 2840A7C135CDC9EF86C8D46ECC0C47E0 /* channel_args.h */; }; + 50AE0B587DB2EA87BDB97CC859177B8D /* server_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = AEA737254896940AB0A0E90A22C30D7F /* server_builder.h */; }; + 50B7B73FAE437060F97A7720A743A2FC /* exception_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 638F8751A39473AAA3E2E475D74ACA8D /* exception_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 50EF7F36A1168B829AC20686EDB9D39F /* stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 61ACC90E8D73B8BDE98CD9AECF447C81 /* stats.h */; }; + 50F6F61F4B1CF3CC1AAF0E51C0904E50 /* grpcpp.h in Headers */ = {isa = PBXBuildFile; fileRef = 11F1FA22BF5D93DBADFE5B1D6E370EE9 /* grpcpp.h */; }; + 5105DEAC72E762F1CA1123AE88D3A94E /* channel_init.h in Headers */ = {isa = PBXBuildFile; fileRef = E49189552843572545B0263578F0A98A /* channel_init.h */; }; + 5106E573F34DC56A2A6D67F17C76274A /* range.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 8B74CE35B81363F1FABC595B676CED52 /* range.upb.h */; }; + 51076239FCBF7402B9206A237ADC497C /* rpc_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 31D25403FFC95B707D2F5CBF1D925403 /* rpc_method.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 5113C7EE29D6C9B4AAB857C2B3B3F6D2 /* ev_epollex_linux.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 54B00FA0E63AB41FCAB76B9D4296A785 /* ev_epollex_linux.h */; }; + 514D23BBAFCFFC9817DA0DF573F9AF11 /* dynamic_thread_pool.h in Headers */ = {isa = PBXBuildFile; fileRef = AA6CD30588C39DABF9AF0A185DBD2A3B /* dynamic_thread_pool.h */; }; + 5172452E58C608C0EFEACD05B6B9C505 /* nameser.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 981429380B759381967B806CAE201AA0 /* nameser.h */; }; + 517B19DFF621298064FB291057635222 /* aes_nohw.c in Sources */ = {isa = PBXBuildFile; fileRef = BD284FC7A814576CC2BFD9A571D2F3AB /* aes_nohw.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 517DE9210A7E4F3B9E115433C3CC2BDF /* v3_ia5.c in Sources */ = {isa = PBXBuildFile; fileRef = 922DDB80D137F08C2D27133906CC7FD7 /* v3_ia5.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 518EC636AB889098E8CCAB26771D0AA8 /* GULKeychainUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F338B20AACF5A0F8EA2DB94A749F46 /* GULKeychainUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5195C4375414F6F85E75F5998F6E24ED /* log.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 1B610AB95754760FA8B42D3893F00921 /* log.h */; }; + 51977E9C4C92927BFE67D54B46C466AE /* view.cc in Sources */ = {isa = PBXBuildFile; fileRef = AFDD69BAA69550856BFCB1E65A18327A /* view.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 519D20A3F6840B48B22C606FDA0758F9 /* string_ref.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 5C8505F921D4BFE5EC6C0C2FB4E9C45D /* string_ref.h */; }; + 51F1B13FA1F94B0C2BE609F7D005D3B0 /* async_unary_call_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 78B49660DCAF348B5AF0AA74D7113328 /* async_unary_call_impl.h */; }; + 521E7D8205679A66DD4F8BB9C9CDCC78 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B494F5BF50EAC5CFEC559B42BFF63D4 /* utility.h */; }; + 5231B434D641ED0301C417574310D1A0 /* host_port.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 0FB7500FDD218447E2A8951E79D047ED /* host_port.h */; }; + 524FF5C1AA092D241C2A200F493F2BE7 /* endpoint_pair.h in Headers */ = {isa = PBXBuildFile; fileRef = B8F5D730C790565BCD245A8E8D89D8AF /* endpoint_pair.h */; }; + 525DDBF473346C4E08A10151EA36E306 /* call_op_set.h in Headers */ = {isa = PBXBuildFile; fileRef = F2BD2D588B3379F19C4BC9E8559BB359 /* call_op_set.h */; }; + 528FD8574D8D720C659FC21BEEEA8405 /* outlier_detection.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FF6EA6F5C09355903F15F5CDF0EB9EC /* outlier_detection.upb.h */; }; + 52B176ACF8BEEF4E8F28E74D4037505A /* circuit_breaker.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = E89C5F4718BD12CDB155016FF56F7DCA /* circuit_breaker.upb.h */; }; + 52C516C98D86F87416FA3451D5982B0F /* byte_buffer_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = ACBBEC8E052441D95D28727A20F34D79 /* byte_buffer_reader.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 52F0B4B96F45450AA593EB037670E8E1 /* ssl_security_connector.h in Copy src/core/lib/security/security_connector/ssl Private Headers */ = {isa = PBXBuildFile; fileRef = AF01CB3AD0BB7E0A4582EACC66AAF706 /* ssl_security_connector.h */; }; + 52F63CB3479C9A62F7269DD8ADB538DD /* GDTCORDirectorySizeTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = FCDD12DC0C6106F724280FCF4A3C1060 /* GDTCORDirectorySizeTracker.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 531188D74E715C66BFDC86B91566CC00 /* chttp2_plugin.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BC28FABF554ADA856CE3883B7D1C357 /* chttp2_plugin.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 53140C3763EDFDFBB6AE1B17A0B34E33 /* plugin_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5D5A9878981CB08FA8BCD48682D853D6 /* plugin_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5321DACB24007CF7D4DF1583668E2CA5 /* strip.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 60DCCD9C129B4D5C465D720C3CB56FC4 /* strip.h */; }; + 532E503B8E57054771CF77EAF7097776 /* compression_types.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = B304508F4D1BA3E6653A85511CF1C329 /* compression_types.h */; }; + 5347BFA5BCD7ABB294D3018DEEE445C6 /* FBLPromisePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1124CC7D776FC3C0C380D7F944BA169 /* FBLPromisePrivate.h */; }; + 534A0C0E804728C25722C1173B0B043A /* channelz.h in Headers */ = {isa = PBXBuildFile; fileRef = E6368A41EF6D4F9F45FB7E08D37312FE /* channelz.h */; }; + 5354A3A90D67C23E55E013DF16B11150 /* grpc_ares_ev_driver.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = {isa = PBXBuildFile; fileRef = F5F14D9C982BF07F9C6C55C9B0365D54 /* grpc_ares_ev_driver.h */; }; + 5356E9D0B2D045AD0BEE8156B649A671 /* resolve_address.h in Headers */ = {isa = PBXBuildFile; fileRef = E04BE206FDAB3DBB396E61E589EDEBF5 /* resolve_address.h */; }; + 53666CEFDD567350BA03ED24AB8D9D62 /* manual_constructor.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 3BAEFB567038EDFFD8219B65064045A4 /* manual_constructor.h */; }; + 5367317F3583CA020FC0882803CCC7D7 /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 7814FB0FF75920942E7C1B20879BAFBE /* sync.h */; }; + 5374EC1D9ADE8A9B6B3AD0E84A68ED29 /* grpc_shadow_boringssl.h in Headers */ = {isa = PBXBuildFile; fileRef = E3B8ABDAC044FF0BCE343A472CE5A753 /* grpc_shadow_boringssl.h */; }; + 53965D6F9EB25A4800384E5B36C4CE77 /* time_zone_libc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38F399F8DC28719939770D74A131 /* time_zone_libc.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 53B5EF6AF9690EC06E764BF7CA0BD95A /* ssl_cert.cc in Sources */ = {isa = PBXBuildFile; fileRef = B3B094199D9B61EB18907CA55BFBD3A5 /* ssl_cert.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 53BE22599FE0ED3196B68A11C5213547 /* GDTCCTNanopbHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = C3FBD6A9D5FA239CA5766A8F9C4B13F6 /* GDTCCTNanopbHelpers.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 53C3BB34CCE28C72C826E059E1224E0D /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F3E929839096653111D65E2F29BE3A /* sync.h */; }; + 53D7DB3EE90EC0899C02317EDE31E25B /* sockaddr_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = E021F74765601E55677CEC43369B569D /* sockaddr_utils.h */; }; + 53E094A5C9032D23A5E9BC8018AD326A /* async_unary_call_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 78B49660DCAF348B5AF0AA74D7113328 /* async_unary_call_impl.h */; }; + 53FAF68806D7C61C31F3D71C4E4D690C /* create_thread_identity.cc in Sources */ = {isa = PBXBuildFile; fileRef = 831E811655F45D87C159FD46B12B9033 /* create_thread_identity.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 53FC276736D9C331F6A901A4E8791596 /* macros.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = D8D13B6B6A0E82411728078AC4F21571 /* macros.h */; }; + 53FC5446B0B93042549CF228803701E0 /* alts_shared_resource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A7440CFF031982570D78C193E1319E /* alts_shared_resource.h */; }; + 5404D3E2FF2556B5FAF9976A7E245534 /* work_serializer.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B6E5DB5B9ED2BB4E09D66C69B3AF2FAA /* work_serializer.h */; }; + 540A25D0376C30D0699569566C6A99B5 /* exec_ctx.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = DB0CFE7A7ADD0167599DDCCD40326A48 /* exec_ctx.h */; }; + 540E86F72358DEA3ED9063848467B978 /* internal.h in Copy crypto/fipsmodule/bn Private Headers */ = {isa = PBXBuildFile; fileRef = F60E11FD666EBB2FB74FA667AAB716F1 /* internal.h */; }; + 541B17F5FE264CB743B90EBE7611DF74 /* context_list.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 560E9A1167F4EEF8C1F655734DFC88EF /* context_list.h */; }; + 542D90719D33ABCE68E098B8907A2806 /* backoff.h in Headers */ = {isa = PBXBuildFile; fileRef = DB0487AF4DCC51991A674B6146F2B6E9 /* backoff.h */; }; + 5483D4362CDB65A72E7739DF83F4965E /* tls13_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE89EE53BA730471669A24E6395BFFA3 /* tls13_server.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5484B1E5A3B8E1E60AEDA96079CF4DB6 /* slice.cc in Sources */ = {isa = PBXBuildFile; fileRef = A61CC5B8ACFD1D1EA9E43F18B60258CB /* slice.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 549EE6F31824EB6737693C3575F72B0C /* accesslog.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = E60B72EF39955A076FC093D4B48EA276 /* accesslog.upb.h */; }; + 54B2768E384A9E5BCBAFDC3A805E396B /* FIRDependency.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F46375A3AC1F39573C6A281A0AFDA7C /* FIRDependency.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 54BDFA45654CB0B482D62CA41C7D5D9B /* percent_encoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C6BA9D63B2C822DB021273F3CF14AD6 /* percent_encoding.h */; }; + 54CD0CD1816E2771F113C02028E83814 /* lame_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 767CACAD361C9C0003CA194B8B071644 /* lame_client.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 553BDBBB4ECA7467A65B4FC425976F0E /* mutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1511D3462BCF17289DD619259C029C9E /* mutation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5573260535E8DBBD112B596A34BB9834 /* inline_variable.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 8028A5B3D7DA53E4582C3E730E757ED0 /* inline_variable.h */; }; + 55E83827A9109CA5846E2C631194C014 /* scoped_route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C59E0F8D64C904B6F3DF382FC1943AF /* scoped_route.upb.h */; }; + 55ECCF59AB3C7BFF1D82564603992BED /* flow_control.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7E28F5EE7EBCCD7499F26B97589268F2 /* flow_control.h */; }; + 55F338687D452BE8FF59B21C77C46325 /* filter_policy.h in Headers */ = {isa = PBXBuildFile; fileRef = C7F138DC17DE54C2F2670836233F1D75 /* filter_policy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5625BC1663D1917720BADAED6EFAABC9 /* call_combiner.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E15A49E106AA5251194810E927C2F4B /* call_combiner.h */; }; + 562F391B24E88E263C58AEFC432644B1 /* errno_saver.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 5A9E2CAC4D607565A22567FB93A269E0 /* errno_saver.h */; }; + 563F8BF7F2A27F5CFE91DE188DFF5DF4 /* custom_tag.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C6FC9F98592D1139A0D409DDC4E71088 /* custom_tag.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 564153B1C08CA8F18C8FE04BA70E23BF /* raw_hash_map.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9B5338171CD061E47F2E361FCE6F29 /* raw_hash_map.h */; }; + 564EF3B3D29679C47BA8AA2CF4BD5F84 /* gcd.c in Sources */ = {isa = PBXBuildFile; fileRef = 86EA1E2DF13B4C433704BBFE070A2689 /* gcd.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5650AD5170C46FFF9BB9E766DE3F0201 /* atm_gcc_sync.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 45F3712FB4F0F778F038527E8B3E7D76 /* atm_gcc_sync.h */; }; + 567CBD338305B4AC1409D1002F3EF8A4 /* frame_goaway.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8250B6E23F5C421DC9D28BDE6F0EFAE8 /* frame_goaway.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 56CD4B7F8FD13FC5AC0B869BEB4EF785 /* exponential_biased.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F19ABCC9A33949E6AA707BE381643F4 /* exponential_biased.h */; }; + 56D15B1406C3053B722B063A782F598F /* gethostname.h in Headers */ = {isa = PBXBuildFile; fileRef = 938D47EB98925AAC75F84424C624BD35 /* gethostname.h */; }; + 5708A31938B7473B49FB6DED4DA614C6 /* buf.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 14B40745DACF97BCF26AF8FBF36B9130 /* buf.h */; }; + 571AC94D1AF9B56EC9D34DEFC778671A /* array_contains_any_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D1A85F8180A80DD21013455EC1A2751 /* array_contains_any_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5756F6069B7C2792601E3E8A1443012A /* mem.h in Headers */ = {isa = PBXBuildFile; fileRef = B85C1607FF9B70FE3F5E9976FFC0A4C0 /* mem.h */; }; + 575F39A3AAFD1C77760A48C943C433BE /* error_cfstream.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 4EF0EA5F6C234102A14DDF0969DE4782 /* error_cfstream.h */; }; + 577D1D77424F1BC1BB2D779837DBFC81 /* grpc_ares_ev_driver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3EA6970878B97E9A4FE428BDB39F3FA8 /* grpc_ares_ev_driver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 578605592CA196FB390E39D61C0556FF /* v3_akey.c in Sources */ = {isa = PBXBuildFile; fileRef = 3070FBAE52C0B169065DCF9C2616C3EB /* v3_akey.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 57A109DC0E5357DFA4BF256180E3832E /* FIRAppInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D6115E6A018F3CBC8D219F1BCC5CB93 /* FIRAppInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 57B465DE10448D544804588EC57B39E5 /* spinlock_posix.inc in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 61060E937CC594BAB60BC43807AB59CC /* spinlock_posix.inc */; }; + 57BFE22BCC80BD48044BC57E8487433C /* p256_32.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = 2C7EB7C367CFD848EA3481438FF18F81 /* p256_32.h */; }; + 57F6C14CD5ACD92537D11281B9459CB3 /* byte_stream_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 89B5CC08F0D78B71F647EE48083C853A /* byte_stream_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 57F9F642270ACAE1CE4C277AC6FDB25C /* FIRCollectionReference.h in Headers */ = {isa = PBXBuildFile; fileRef = FDBD9D85B71132929F853945215B2274 /* FIRCollectionReference.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5812B7932870E136139433543CF3265E /* interceptor.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = BD4D206E034593577820C0BD18349D7E /* interceptor.h */; }; + 581DAD6F88FFB26144F09C1C40A4FE63 /* substitute.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = A5C51F3B802FDFD04AB847340FF10B35 /* substitute.h */; }; + 5833F346DD8F0097F15D98DD67F67F13 /* log.h in Headers */ = {isa = PBXBuildFile; fileRef = D8AC7E83731928232AE65C64254BC997 /* log.h */; }; + 5855024A05C2BE8C3C390ADC060B81CF /* ripemd.h in Headers */ = {isa = PBXBuildFile; fileRef = A4299A26608CC95F9C409DAE53B183C5 /* ripemd.h */; }; + 588727029257E38C685C0D2B69E5BE94 /* ev_epoll1_linux.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 6CA902355FCDD4D7425028F7FAA3C440 /* ev_epoll1_linux.h */; }; + 5890BC4A58B030A89D1D08CD43A0276B /* cast.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C999832105B5B01F81A701E0276CE9 /* cast.h */; }; + 589911DBFB0D3509D3F1CA7E6276E6FA /* proxy_mapper_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = ABE54C835DAF515535556B26177BBA60 /* proxy_mapper_registry.h */; }; + 589AF2AA333A3C1AD84FA7BF5D4E6FD4 /* intercepted_channel.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = FB6E28756AF9D5278A5ADB2BA818DD5C /* intercepted_channel.h */; }; + 58A0DC817C737971F1EFA25661FC8BA3 /* mpscq.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 92EEEBC78DE622415462CD883B6A2914 /* mpscq.h */; }; + 58BA63DBD34E82735B7883A0BF7275F2 /* chttp2_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 1356E5C2283E0942CFDFBE52BA0942DC /* chttp2_server.h */; }; + 58C2F720FFA09D73A9FF1A6C360A00D4 /* call_test_only.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 7C5717E23D4A6FBC8DA13F9A13BD24E2 /* call_test_only.h */; }; + 58C7D778FE922C1EADDB3AB0AA3FAB10 /* validate_service_config.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 9CFD1651BEC48147949B5B99E1587687 /* validate_service_config.h */; }; + 58CC94BAB07B702BE7F35C7B31636B09 /* FIRBundleUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = EBCDEE91D7C5C9EE0735903AE801AA77 /* FIRBundleUtil.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 58D20C1A3F7CB8FC6E6E896B31327CD6 /* xds_bootstrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 7665D3F712E5B040DBCDDFAA4A8EF960 /* xds_bootstrap.h */; }; + 58F738E060120B41B25C073CD452C543 /* value_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BB9ADA2E70BFC8824E39DA9996ECD97 /* value_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 590FB3559EB0862A22A09515BAA149DA /* create_default_thread_pool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46EEC2499CB5F5F370F0179032F4BEAB /* create_default_thread_pool.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 5916D7617A25B5CB4503EE26038C4258 /* GDTCORAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 32C22F219976F585EB755FDF633B2488 /* GDTCORAssert.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 592846A55D5DCD353D5CE4A99876D301 /* server_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = E2D944E6CD95C567660E31CC2C797A3F /* server_posix.h */; }; + 5936D29282A90C03D19B5230EA1B8B11 /* fake_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = F833DA52F02D691022D829A74BE58ADE /* fake_security_connector.h */; }; + 5937FCD099F0E7B5EB276C9885B73DB8 /* create_channel_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BD53403E4372AE2A9BBA894429AFB48C /* create_channel_impl.h */; }; + 596FBD67778D0B3D216AB60399A52274 /* FIRComponentType.m in Sources */ = {isa = PBXBuildFile; fileRef = E6B18A381307DB711369991B38B1CB66 /* FIRComponentType.m */; }; + 5973603C868EEE44D9771AD6EC6273F3 /* status_metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = C909F81954D9B7DB45952082B104FE03 /* status_metadata.h */; }; + 59774F8DA573C3BE83E42B848113EB23 /* x509.h in Headers */ = {isa = PBXBuildFile; fileRef = 71621132FB49E588ABD9206CE29BA54E /* x509.h */; }; + 59778856ACA8027182877B137BAEF548 /* sync_generic.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 5D80A7EDBE3547565F2D296355827193 /* sync_generic.h */; }; + 597D14B7AF69EB2DD4A6910A84E6BCCD /* asn1.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C8E2BCA63656E9197EE81C9058A4DB6E /* asn1.h */; }; + 598DB82B8F26FF990C02BAD512A0A2EF /* thread_pthread.c in Sources */ = {isa = PBXBuildFile; fileRef = 2E09442B1860709EF4832571B348711A /* thread_pthread.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 59902A519FA1C4BA47B5FBC803A9A750 /* default_health_check_service.cc in Sources */ = {isa = PBXBuildFile; fileRef = EAAB62C6FD33409AD7699DB614014C4B /* default_health_check_service.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 5999E32B3CBBDAF22D41EA4802B20DE5 /* ascii.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = A514CA128BAE38DA1C046B4723F7A58C /* ascii.h */; }; + 59A4CE168743C8195D192296050011E7 /* channel_stack_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D4A259EFEB08101C8818EE28E425B /* channel_stack_builder.h */; }; + 59A768C376E2F66CDC6BEF6476B02F20 /* spinlock_win32.inc in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D5CCEC4ECBC30052D1BDDAA5FAA0D2C4 /* spinlock_win32.inc */; }; + 59B0CB5296AD01A3073A1D09E9477286 /* low_level_scheduling.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 6FD61DC34AB43E983BA6082C5263B028 /* low_level_scheduling.h */; }; + 59EB9D45B030A65782254C7910E117E8 /* bio.h in Headers */ = {isa = PBXBuildFile; fileRef = 773BC85B9BFF5AA58D3976A4F30674F3 /* bio.h */; }; + 59EC0D7B47D8E225B924CE53E17E8709 /* server_interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 797DC204ECCEA4793FE955D926F86063 /* server_interceptor.h */; }; + 59F25151D6DC083FDCA67D9188048D8A /* status.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = ED537F5536237513019B8F4866FB5EB0 /* status.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5A0AD7E84D108023E07BE07FFB5F7CBF /* client_idle_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3EF8AF8A90604349280F03259FF00F07 /* client_idle_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5A1747016074C4648F678D2567812792 /* status_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = C909F81954D9B7DB45952082B104FE03 /* status_metadata.h */; }; + 5A1B6A9159138DB7EC5E43CFA5D425CD /* FIRAppInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EE4E4E6995DB123A1C58AFFB2284359 /* FIRAppInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 5A1FD5BADE4C2A8C3114DAB9C3076E28 /* fake_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = B34D89A7C532C51A510254029B3BFEB5 /* fake_credentials.h */; }; + 5A27A6E84D49EF733C638BB79F79924D /* filename.h in Headers */ = {isa = PBXBuildFile; fileRef = 4540C2059DE869A0A0A334D5001F1630 /* filename.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 5A4B0716B3E408A6740AAF57CF4DFF77 /* string_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 436A13930E01446E2ED5E4C1A0ADDC0B /* string_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5A510C0817453BD27B18EF30F86A5B3A /* channel_stack_builder.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 781D4A259EFEB08101C8818EE28E425B /* channel_stack_builder.h */; }; + 5A56AB50E1773A2DC6F19BFBBE522E7E /* spinlock_wait.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EF1027B77CF7A21833485066A7DCE3 /* spinlock_wait.h */; }; + 5A58DF5FA2B436698CED518758172C3B /* p_rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 33401FADF018CD6DA51A59A0B30792E4 /* p_rsa.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5A65B876E356A865A30B002117C0D379 /* GDTCORUploadBatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A543609844C6990EDD87FDAACDEDE63 /* GDTCORUploadBatch.m */; }; + 5A783ACA3879F7D60A10689AF1A0B209 /* FIRComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E6B38A60A185A9EC2E2E06D2AD5648 /* FIRComponent.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 5A81E3A939D1C83D12E1B76C110A48E9 /* symbolize_unimplemented.inc in Copy debugging Public Headers */ = {isa = PBXBuildFile; fileRef = E821E862169B9C48AE0585E407F38613 /* symbolize_unimplemented.inc */; }; + 5A85DD4B8BB50A019743AEE533F0B4AA /* leveldb_key.cc in Sources */ = {isa = PBXBuildFile; fileRef = 30E5C63133477DA2B8CC7B76208CF09B /* leveldb_key.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5AD448FC4105EE14F70C632418D9C08B /* FIRComponentContainerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F20603543688FE7E0F7E0D499F90045 /* FIRComponentContainerInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 5AEE4FEED212E72EBEED48C65C73665A /* pick_first.cc in Sources */ = {isa = PBXBuildFile; fileRef = E2462D8D4CE7B98A40B00938E441AC3D /* pick_first.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5B0559AF6D0D11F351911F38348A29DD /* msg.h in Headers */ = {isa = PBXBuildFile; fileRef = ABB914CA2D8F559EC70238FCF503BCD0 /* msg.h */; }; + 5B53FFB848207105C4B9EE36D25EAC29 /* GULURLSessionDataResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F9A065C506BE5D919864CF52037C4BE /* GULURLSessionDataResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5B69BB420FA2368CE16FDBEB0A36DD41 /* ex_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C39DBB52327F16A36B4F665B0D14B93 /* ex_data.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5B6C902A19517915F5757200D5F67A65 /* str_cat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A2639E3A9DAEFF8438C9E4BCF9A2A79 /* str_cat.h */; }; + 5B7B8DCC1A17F9D48B53436BC11B14AF /* lhash.c in Sources */ = {isa = PBXBuildFile; fileRef = BCA523D863485A1586D2C1DD6ACE89DF /* lhash.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5B83021B013A6FC4F512ED71EE41A0B3 /* metadata_batch.h in Headers */ = {isa = PBXBuildFile; fileRef = 06AEA9EBB3AE752155C0F57EA283BCA5 /* metadata_batch.h */; }; + 5B84207047635C0511B452DDDD2929E6 /* sync_stream_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = DC86DD624BBB8F86536B9BBD05207CA6 /* sync_stream_impl.h */; }; + 5B920A9A890F58410E9A5CC19F5B90E4 /* health_check_service_server_builder_option.h in Copy ext Public Headers */ = {isa = PBXBuildFile; fileRef = 300641136217C3F72893388DFE42F334 /* health_check_service_server_builder_option.h */; }; + 5B98F935E12CD3899D1448AA25EF6481 /* lrs.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 44660551561017400EC935F864AA4EDE /* lrs.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5BCD36498CE44ECC9C94553B3221BFB6 /* d1_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54CEC49A03FA699140C9622FF53874E8 /* d1_pkt.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5BD9FF0401D96A87013CBE67E5618A65 /* query_core.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB7AC688268FF9E6BF7121026CC24803 /* query_core.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5BDEF580602F3D6EB3E678CBD072A83A /* ostringstream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 66D5D5ED965A18F6F8CF3E5FD06DBE7B /* ostringstream.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 5BFB6AD3B98F7DDB88D863B77BA452F7 /* server_callback_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 5C77AF6EB4EA42AD0D875AC763515E4B /* server_callback_impl.h */; }; + 5BFD2EBB359172C672165855F9B9B0D6 /* channel_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7F875194E544D97D96D786FA3997A1 /* channel_impl.h */; }; + 5C03AA3114A2840A0673698F9216E8ED /* sockaddr_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 121195A1992721C717452598998B4349 /* sockaddr_windows.h */; }; + 5C0B1772810A06520468AAFC1A392614 /* huffsyms.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 0D5C4C195972E9AD4EB8FA8CB1C17854 /* huffsyms.h */; }; + 5C310BE8882AC4936D77A3EEE1734EA7 /* str_format.h in Headers */ = {isa = PBXBuildFile; fileRef = 9178E47C67BB082F4BDD3542702F00C4 /* str_format.h */; }; + 5C59211B4504607D4A2A7C4B0168F33E /* optional.h in Copy types/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 89762919352304B630804EA6DC787FC6 /* optional.h */; }; + 5C5BFB3564D875150FB060CC6645756D /* fake_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = EBFE9E298F6BE2F8EDD6EFA38A31934D /* fake_transport_security.h */; }; + 5C7A77B3A9589C585C3DB60939E26C9B /* semantic_version.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0ECCEA54FD8EB5AE66767FD5BFE71C /* semantic_version.upb.h */; }; + 5C8422121EE4B56296BBF80562A6F65C /* FBLPromise+Wrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A71F4B2C9BAD681CB1B1B737BC68BB /* FBLPromise+Wrap.h */; }; + 5C86FA892DA157CFF6BD46D08F1F73EE /* ssl_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C31DF07FC035EC1690AE609A446AF56 /* ssl_transport_security.h */; }; + 5C90CE1C9780147DCADB5617CA4866D3 /* channel_stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1519BB64EF3C991F8EDACE43C2758BCC /* channel_stack.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5CBC07F6B6A4049FCBE7D73F80E0E1D1 /* incoming_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = E08B3DF21340AB512474B5E6335495BC /* incoming_metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5CBEFC8DBC655E156E886D7463139FF2 /* bytestring.h in Headers */ = {isa = PBXBuildFile; fileRef = 60FD395ACC387DC13902992C7F82FDA0 /* bytestring.h */; }; + 5CC7023E1021D0797BA7C2763F17FC28 /* a_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 05613D12F20BED5782E8F875D6060479 /* a_int.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5CDE8E1123F46FF95E8F892C06B062EA /* cbs.c in Sources */ = {isa = PBXBuildFile; fileRef = 01086C47DF75801EE8C1B2CC9E8E533A /* cbs.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5CE8B00D39E4CBE5DF53234C5C40E474 /* server_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 46D6B082B1EA2B1ED9216CC06A2EF706 /* server_interface.h */; }; + 5CEF77025A1B629DF4EBAEA9CC812932 /* grpc_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 48F2043236F70A5747D902B21422D45A /* grpc_types.h */; }; + 5CFA0BA21AAD11848D994835F9DB342E /* forkunsafe.c in Sources */ = {isa = PBXBuildFile; fileRef = 93196289CE749EA6B5354E9285A0C9DA /* forkunsafe.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5CFA813AC14BD295927ACE1926D7269C /* alts_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FC04DE1D076ACF463126268796D2A8 /* alts_security_connector.h */; }; + 5D0F859D15F554C1E1964A1F452DEF78 /* log_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2426A1FC6C09AE5B0FABD891B1DE922D /* log_reader.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 5D3567C843D232A721B7F1FA601C086D /* two_level_iterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6250A505B1D7CFDAE15D9D0B6DF6EB4 /* two_level_iterator.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 5D37BE6F7DB414ED9E8DBF2C834A4866 /* FIRDiagnosticsData.m in Sources */ = {isa = PBXBuildFile; fileRef = 82954EE9A25E2F2FCAE05D9C23D21A7A /* FIRDiagnosticsData.m */; }; + 5D387B35519182BDE9C7227E82EC4C74 /* socket_utils_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4E7CF74A9BFE198D6BEF3FFAA3072809 /* socket_utils_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5D48C7C0900F2279ECA59876732FD3EF /* resource_quota.h in Headers */ = {isa = PBXBuildFile; fileRef = 99039F2EA3DB530F4B0608A609A94DC7 /* resource_quota.h */; }; + 5D4C1AF5FA394983BFF00F0B7325B10C /* GDTCOREndpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DA7CBF62BB3656E09A77A3F5F593554 /* GDTCOREndpoints.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5D5EC0EEAAC2093AD5C565AB280A4F28 /* s3_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = EFA044295F1ED786E7CF33310154BA17 /* s3_lib.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5D6793075332D224ECBFA16CD38BB005 /* ads.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 67F87B58CDE8C6CA4193815173DAB3D2 /* ads.upb.h */; }; + 5D840DA9155416DA00A38E7F8809488E /* time_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE0C30425BCEA85F808902144CB8DCA2 /* time_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5D99467560FA33DBE77A181B720D9B50 /* invoke.h in Headers */ = {isa = PBXBuildFile; fileRef = 16D9E7FDC0048458C43611D963313690 /* invoke.h */; }; + 5D99ED8BF4E26ED6E4B3C2A54028FC71 /* FIRListenerRegistration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9238B970FFD0DA74F5DC9A34A1E40220 /* FIRListenerRegistration.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 5DA531D0E59FCCC034340B5AA5D261BF /* x509_txt.c in Sources */ = {isa = PBXBuildFile; fileRef = 64C5AD682535D608A522A047798193A2 /* x509_txt.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5DC777A79CCBBB7021459ACF47849E95 /* server_context.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 37F25E574F3F8F80198A3D62A0AE3871 /* server_context.h */; }; + 5DD43D71A61B2CA8E7B70006F92FF30D /* inproc_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C86E75121BAA1E70938E672141693E0 /* inproc_transport.h */; }; + 5E1937B29447ABBB2AFD01FB2D5BE8EA /* nanopb-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B58C221D6324649F211E8B4D296F6731 /* nanopb-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5E3E71C4490C27A657A8C0B4F56DE186 /* tls_pthread.cc in Sources */ = {isa = PBXBuildFile; fileRef = 50E29D7755C2F7766A92793F1EA8D6FA /* tls_pthread.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5E621D364E2486682215A8A7E626D871 /* alts_crypter.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 0EF9BAAC12070A8E68EC4747F69049BA /* alts_crypter.h */; }; + 5E6F46195D330F1454767DA6C6BB1803 /* slice_string_helpers.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = BF975F8D02AE3175AD21B5BED7FDC2D1 /* slice_string_helpers.h */; }; + 5E70025EB59EB517CAD8435F61F388C8 /* log_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C41D690E5603981F1A6038BCE8B913F /* log_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 5E7F3DF3C7EE740F1F82886024928274 /* fork.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E81AC51019F0FD3D5ECD6A75D29621 /* fork.h */; }; + 5E91587EC416FAC9887B6093E4211754 /* status.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C6EE08C23D04559BACCC047EFFB9509 /* status.h */; }; + 5EB0B3FFE9D111500B25F06B9298E8B6 /* api_listener.upb.h in Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 3E87A37252B47E86765B38E1546BDD73 /* api_listener.upb.h */; }; + 5EC33043ABB642F42115D1C7684D94F9 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = F37130F35FDFD15BF12C013E47957649 /* options.h */; }; + 5ED0F24166E16142519B3635A8468F01 /* arena.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A3899B023FABB06DCC73CC4AD4F4605 /* arena.h */; }; + 5ED5B1E378338731C81DFF0E8C78FED9 /* reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = E47323FE190B0C24EBEBC7834B45B3E9 /* reader.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 5EDD5B1E66849BCE336CB7A3CE06F497 /* status_util.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = AD7F038300BA50B8ECEE08E051166E54 /* status_util.h */; }; + 5F0B710E9E7E079A218975A7032E4ED2 /* string_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 8397A89A565E7E8601D622B9A7D3B8DA /* string_windows.h */; }; + 5F15B9985211615EE436686086D2391F /* GDTCOREventDataObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 24B350451EE1CC133DECFA8857CFAF56 /* GDTCOREventDataObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5F1845D259EBAA13171E2BA6747849BB /* tcp_client_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = ADDB86B7C169DDFFB21D4359AD1C71D0 /* tcp_client_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5F20CFF501924FC61D35396E2E2D92E7 /* eventmanager_libuv.h in Copy src/core/lib/iomgr/poller Private Headers */ = {isa = PBXBuildFile; fileRef = E590D2875C3BC56D26EAF797BC85AD88 /* eventmanager_libuv.h */; }; + 5F275151A68EE6AD71FADA817EDA2B40 /* serialization_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DAB80ABFC5C5709021BC0268A3CA1CE /* serialization_traits.h */; }; + 5F2A4396DA4B38A009C7A16BE97457FB /* t_x509a.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC5FC1E25B7C3707B4A26A93C54D264 /* t_x509a.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5F2BE0220A75AF26B77090912A3504FA /* security_handshaker.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7ED18D5D434887DC1392437A8F376A33 /* security_handshaker.h */; }; + 5F306BDAA590352825F32A3B82C80014 /* lockfree_event.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = EB2E25A001863A1F0A3AC138047C601C /* lockfree_event.h */; }; + 5F308AA45115E170C4DD6689A6FF52B3 /* local_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = AA991AE54067FB100A899C5178166E7C /* local_subchannel_pool.h */; }; + 5F4963E7928BCF4CBCB750529533EEAA /* orphanable.h in Headers */ = {isa = PBXBuildFile; fileRef = FDC80743B9299684E51D6A595D902770 /* orphanable.h */; }; + 5F600550F5A922DC9E374AA08206E19E /* thread_identity.cc in Sources */ = {isa = PBXBuildFile; fileRef = E9B99011D6EC62F17055B52AB47834C7 /* thread_identity.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 5F6E5A50206E6A522B2E35A20EE9DF13 /* fake_resolver.h in Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */ = {isa = PBXBuildFile; fileRef = 74687F981785848CF193542E9D404CB9 /* fake_resolver.h */; }; + 5F810BA044E144865F9E7AA16D611255 /* FIRVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 004389D24BC022DC6B69A7925CCF7007 /* FIRVersion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5FBB0E31A597A4F1448803B96D347F51 /* convert.c in Sources */ = {isa = PBXBuildFile; fileRef = 8863A0A2EEE3B9B8D719AA20A04F1242 /* convert.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5FBD8BE2B289C62D35EDB11D747319E8 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = 1EB4F4919F03F6077BED09C670254F39 /* table.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5FC4F24B1E42120B47D52E1AF4AD7060 /* percent.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C1452B0C756F28A1E66A09F6C31F96CC /* percent.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 5FDA371E4D7B53EC3036FE6573C8966E /* compression_args.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 99DEC3F82F42B837EF03657BAAC60977 /* compression_args.h */; }; + 5FDA930D36FB22CCEBF2D6ADCF3EEC63 /* x509_vfy.c in Sources */ = {isa = PBXBuildFile; fileRef = 8232A5190580C321ACD7B0B164990349 /* x509_vfy.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 5FFCB880F8CFB8F45C67423F02A4EFA1 /* grpclb_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 536FAD0A306763D48380064D60D93127 /* grpclb_channel.h */; }; + 600ADA55E01240A0736DF4C2AC235C5A /* tsi_error.h in Headers */ = {isa = PBXBuildFile; fileRef = 021AC33601AC9193154A278DC0A3D897 /* tsi_error.h */; }; + 600E557052DD77D09AC67F6096027D6E /* validate_metadata.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = B6C99F15F3F7F60D14514B5520BBA0DE /* validate_metadata.h */; }; + 60222597786A9D66D8F4BE2C171DC912 /* str_replace.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3F759925CBAB1B3CB74AD7CDD9F22449 /* str_replace.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 6026BEB1D3637F0F731E757D7DA3258D /* grpc.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B348A4F8A3F1013C061BE48235C47CB8 /* grpc.h */; }; + 602BC6EE9ECDE148AD5B0B0320EF9457 /* evp.c in Sources */ = {isa = PBXBuildFile; fileRef = E39297772AD13E7BC8092FD5912A045F /* evp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 602E3EE142FAD752F59A1BE7874AA446 /* spinlock.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = B1EFE2DBE6BE5918A384AF3B7CDBE9AA /* spinlock.h */; }; + 6053558C61E28BAF6FD445788AE0425E /* ssl_types.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 9479988C8B97951722C63AFDC64A2446 /* ssl_types.h */; }; + 60547A661A154414EC4CA34255566813 /* bin_decoder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F420F2D85E8C5958F23A7FD784652FB /* bin_decoder.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 606A12988407ABC1D6B8EE4C5A4DD0EE /* internal.h in Copy crypto/evp Private Headers */ = {isa = PBXBuildFile; fileRef = F744B7BCEF0EB94E5E6E6595DE737F7E /* internal.h */; }; + 606FE5ECF436814ED2206AFB35076948 /* max_age_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2D3384A5E6A0A9074F60AB2DFC546DE7 /* max_age_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 607F35EF402DFBD5D253FB946B218E40 /* credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = DA68EE17DE7FEE9FD0AC0B1913D624EC /* credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6096E65AB75BF6F254DA888E138D3C57 /* pollset_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = F71B7A15B8674D581D9403D194B0E106 /* pollset_set.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 609833F44588F25131223E27ED02CF2B /* GoogleDataTransport-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0478A1B2FBD0AA9F1B2D032BB151B5A2 /* GoogleDataTransport-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 60AC62DE4D14B83547CE5507D8634EDB /* poly1305_vec.c in Sources */ = {isa = PBXBuildFile; fileRef = E2309ACF4E98F5608C035A4FD328AFA2 /* poly1305_vec.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 60C94F0C6BC85A92D656B2097F246BDF /* stacktrace_unimplemented-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = ACD5D7B78AA4F01E6A83A481D7AC4FF6 /* stacktrace_unimplemented-inl.inc */; }; + 60CC7DE8ED5D29F35D5F141B4AF76D6C /* sync.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 1298A66348AA9C6483630CDEF02EF11B /* sync.h */; }; + 60E4DAA7A764E21DD7E941312952BECC /* time_precise.h in Headers */ = {isa = PBXBuildFile; fileRef = 50611EEE6D727D95433EDE3CDB41271F /* time_precise.h */; }; + 6108C040B1CDED5E4F812DA5B112CC54 /* target_authority_table.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 305C8A6F686BC6581EC1248F92C42D3B /* target_authority_table.h */; }; + 612D08B903810EDA74E783D407C739F8 /* city.h in Headers */ = {isa = PBXBuildFile; fileRef = D64598FEF74F6080B3AF85464C906927 /* city.h */; }; + 615CFD9FD73EA84FC24C2ABDEB605377 /* barrier.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5CCE6080690B7DA6DEDADE7D9C67318E /* barrier.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 6167B9718C027A94B05C6E392F8112BF /* plugin_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 10D5C776E0A1441020B19E29959E688C /* plugin_credentials.h */; }; + 61689EEAF462A41D8C13B1FB3E7FA6C5 /* grpc_ares_ev_driver.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F14D9C982BF07F9C6C55C9B0365D54 /* grpc_ares_ev_driver.h */; }; + 617021E892B9BA16D970E46D43D314C7 /* httpcli.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = D5BC0AC5B88EA0B67C4E1179A9AE9542 /* httpcli.h */; }; + 61965365F22B3D180C7B79FC40807CF1 /* transport_security_common_api.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C44E3A313385725A97F0F3C6F66E6AC /* transport_security_common_api.h */; }; + 61971CAD343DCD23EADAE6A7EB1AB76B /* tls_security_connector.h in Copy src/core/lib/security/security_connector/tls Private Headers */ = {isa = PBXBuildFile; fileRef = F93B69F1C42D2674A97DFCA32E808939 /* tls_security_connector.h */; }; + 619E9DDABFA6B55DD302B7728C0AD7C0 /* channel_create_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 03B5E77F4EAB14191E0B906E65441D6F /* channel_create_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 61A06959B8180EF227FDA8E35509F5CA /* credentials.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = 23156AFDC8CF437ED995D8E10E66F1AC /* credentials.h */; }; + 61AE1AE0F0D0D840050C921BC05275EB /* log_windows.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 41F20D9FB01F9A3F129006ED323B66AF /* log_windows.h */; }; + 61B46F08FAE05CFF62211B7C569960D4 /* lame_client.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = A6FC36BA9BDB68998B65C9C65B7D60C4 /* lame_client.h */; }; + 61BB4AE970DC86B9DD87BF11D17DF736 /* pem_xaux.c in Sources */ = {isa = PBXBuildFile; fileRef = E1BCF54E235E2B907E9A37FC7B860F4F /* pem_xaux.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 61BEE8D4D02CEF12A6460F8E846DB2D5 /* tls.h in Headers */ = {isa = PBXBuildFile; fileRef = A134C344D0C9DFC454147CCD53BC78A3 /* tls.h */; }; + 61D003D58FC25D2FAB43898A76744993 /* async_generic_service.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FB54186D0B4D570D66E19742CBB6FD4 /* async_generic_service.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 61E2CBDAB5A3FA87BAF6E0CCD9A36FEC /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F744B7BCEF0EB94E5E6E6595DE737F7E /* internal.h */; }; + 61F0B293E97131D6A00D9F19C2BBF23B /* http_connect_handshaker.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5268762131A530F53A0F5204E3F8A2C1 /* http_connect_handshaker.h */; }; + 61F7AEC85760EAEFC0C3FAD59096508B /* firebase_auth_credentials_provider_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 885FA52C1E81313350937E7C8E8BA430 /* firebase_auth_credentials_provider_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 6205367D9A710FA2FE039EEB1A21A75F /* slice_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3BA4D17A907DFD005514D01BECC450E2 /* slice_buffer.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6221558BA3A3DDE2419AB420D7F1DD68 /* transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 5E71D724C3E47B5F6B27A0D86265C45C /* transport_security.h */; }; + 6241FAF14750D65FE13A0A555B7C3712 /* opensslv.h in Headers */ = {isa = PBXBuildFile; fileRef = D594189E2BF6247FB7E86C7671B2BEBC /* opensslv.h */; }; + 626B0A2224B2DD1A54057BA079A2E268 /* ssl_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = 43E435037B59162BC0485738ED724D4E /* ssl_utils.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 626FCBBB199311543173548D4A2E5CB4 /* ssl_asn1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58AC4CB66FCA222DAF660FEF972FE3A1 /* ssl_asn1.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6277317ADC66DA057C0B601C63A3A05F /* alarm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5D47BF6740ACC4E9C63CFB5E44D4B227 /* alarm.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 629105F2AE61C75BECB5A458E091DB80 /* FSTFirestoreComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E8E9D3A62322EB1CDF58810A2198A43 /* FSTFirestoreComponent.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 62ABBFDC759E6D4B2F5962267686D3AC /* poly1305.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A7650560AD12323E976A0A5CFA6457C1 /* poly1305.h */; }; + 62CBC8D535AA77EB22C341D4BA03F2FE /* hkdf.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2EB9BAE1BBC76D9C11855FE834FAC8FE /* hkdf.h */; }; + 62CF09AAD0369057FF838F7D4F9DD4A1 /* compression_args.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 957DC20A7FA2E082E900F1EE47BFAF05 /* compression_args.h */; }; + 62E5A855C114EFB015DA5F9281DB6C79 /* FIRWriteBatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AD945AEB20B9646F00E10101EE68B31 /* FIRWriteBatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6345847653D341782EE4A44BE7574773 /* FirebaseCoreDiagnostics-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CA09288322BBF42C93B3F5A29490A607 /* FirebaseCoreDiagnostics-dummy.m */; }; + 63539CDF5A8E2CBBD4AF63EDF88FF7BC /* descriptor.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAD39114F176ABDAE1D3505716D04F4 /* descriptor.upb.h */; }; + 6356295F8EE34061370E053C0A08D313 /* pollset_set.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 2CC9ED5FA0A7D424B82F27AC70FC8BFE /* pollset_set.h */; }; + 637823D4F91D0D91FF48F1BDA7951D53 /* socket_utils_common_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = FACAAC88C97DA55E00D20CEA12A3E2A6 /* socket_utils_common_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 63881606175B949E7B8303C6C4078922 /* proto_buffer_writer.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD1EFE89EDC32963ED5DF3D278AE53D /* proto_buffer_writer.h */; }; + 638CDE1697655A217BFF3A0EFD4BB556 /* percent_encoding.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 7C6BA9D63B2C822DB021273F3CF14AD6 /* percent_encoding.h */; }; + 63C34B056D525B08E83CEE46359378C6 /* client_load_reporting_filter.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = 3560DBCBDD820BA5A07FBA4DEE093344 /* client_load_reporting_filter.h */; }; + 63D24E3DF9409AFD920FBBA3AC7ED689 /* ssl_utils_config.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 5DF95D32DE32B398A176B60ACC5C7F26 /* ssl_utils_config.h */; }; + 63E2DAFF2FE654C749C649AA78EC3A79 /* threadpool.h in Headers */ = {isa = PBXBuildFile; fileRef = 03F8C50107A79647B6CFEF808B390797 /* threadpool.h */; }; + 63EEA6440DF1E7FF1FB47335D2896473 /* oauth2_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FAB7538814660A314E9C038CE70E37B /* oauth2_credentials.h */; }; + 640344F61B47AF6FDBF13048DEBEBD75 /* sync_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = F597A3123DA662D08CACDB826E2E5BEE /* sync_custom.h */; }; + 64177E2B4EFEBA9A5E43160E8EAFA90B /* aes.h in Headers */ = {isa = PBXBuildFile; fileRef = 67D9D789AF50B525348AACCFC44B20BF /* aes.h */; }; + 641E82EFB8164E2AF590EF67903301AD /* fork.h in Headers */ = {isa = PBXBuildFile; fileRef = C44A9673099B2584D7099AFAB608672A /* fork.h */; }; + 6422ECFA0EC299D0B9DE4BCCE2EEEE54 /* p256-x86_64-table.h in Copy crypto/fipsmodule/ec Private Headers */ = {isa = PBXBuildFile; fileRef = 1CBF28415CBDA07BC4CE1F5A5A5649B5 /* p256-x86_64-table.h */; }; + 6425FA6B9646033D60C0446672E2495E /* v3_extku.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B82965517F26D32D39EB3EA2FAAF5B4 /* v3_extku.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 642DA0A972D6F95BD2E141A263850358 /* listener_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD3D92FD7CCA0707DD1333F8A1B2A44 /* listener_components.upb.h */; }; + 64472ABEC969C6722EB3F239568E14AC /* alts_frame_protector.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = B5BBC219C766DE7677982303868AD116 /* alts_frame_protector.h */; }; + 644F260DE57266D1206E60C838A32D3E /* tcp_client.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 00F4D0A03E256C135B9EAE3E42644BF0 /* tcp_client.h */; }; + 644F8CE5E335CC3AD1AB3A86464A2B5A /* internal.h in Copy crypto Private Headers */ = {isa = PBXBuildFile; fileRef = 4BC45A9314A6A47E4ED1ED2E268675EE /* internal.h */; }; + 64515B0C34A887D4FE9D0EA720ACB422 /* xds_api.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A01B697DF503C3D93135B3C0F28D25F /* xds_api.h */; }; + 6454C8EE69958AAD64D0CBE6966FA51C /* grpc_library.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = BADA78E910ACE2BCEDCCD27287A5B7D6 /* grpc_library.h */; }; + 645E53D92FEA5B9C34D37424A08C0700 /* roots.pem in Resources */ = {isa = PBXBuildFile; fileRef = 9570F0DA560D5DBAD3D18157F01D9B60 /* roots.pem */; }; + 649FE5CB280F723AC6456B584FF0A230 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 64B09F58DCF37CA61DC95665929CF729 /* alts_tsi_utils.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 1CB284BD2ACEE8F0D301A63F8B46C27C /* alts_tsi_utils.h */; }; + 64B801AFB9255FABCDD5D1EEC8F6C33F /* cfstream_handle.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0EF9D1F74E34B509558AE353EBB49FDF /* cfstream_handle.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 64C6217CD50BD6538AA89D362402DFEB /* duration.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCEB77F18F4584631BA806547F5BCE6 /* duration.upb.h */; }; + 64D3FB1BC46D7F0A2894B48B26CAB3F0 /* filter.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = BF491B7EC78D49D1C61B2B007A52FA85 /* filter.upb.h */; }; + 64E8E407036D92427BE83BC15134E026 /* load_reporting.h in Headers */ = {isa = PBXBuildFile; fileRef = 80C720B0399FCC99B19B600E3D4E3241 /* load_reporting.h */; }; + 650126C4632C6ADAE212C419568062F7 /* city.h in Copy hash/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D64598FEF74F6080B3AF85464C906927 /* city.h */; }; + 650469DA2A49955AAB2BEAF4251137F0 /* alloc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 1913DCB78682B6D5A6D7987739E4C702 /* alloc.h */; }; + 6506C9B9797C21E369C319A755A1F380 /* GULHeartbeatDateStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = C4D0667700B3B9F86DC608BF0D167F32 /* GULHeartbeatDateStorage.m */; }; + 652FAF72B2B68BDD8E814DFAF95EAA0D /* health_check_client.h in Copy src/core/ext/filters/client_channel/health Private Headers */ = {isa = PBXBuildFile; fileRef = 3C2CFE7651B561BB6CFA7CC9B15F63E9 /* health_check_client.h */; }; + 6567018EB6FE0A577D676DE6E29B93C9 /* simple_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 740CB51E8F85611AE5DD5BED764EAC85 /* simple_mul.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 656F29440F94332BE6EC42143F35FB2A /* GULURLSessionDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = DEAD2EE0B4B3E0F82293A5A8E964CBCF /* GULURLSessionDataResponse.m */; }; + 6574298151692EE585EFE670B69586B1 /* socket_utils_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 148BBF1E31DB4AF7565E67B963BA0029 /* socket_utils_posix.h */; }; + 657D5960ED2671DE0F4953ED0F21A186 /* log_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F78B98CF571646B0BFC32DCBF279E904 /* log_writer.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 657DD49A753C6374C8AAF784464977DA /* flat_hash_map.h in Headers */ = {isa = PBXBuildFile; fileRef = CDADDF63B94ED816838C92C98FF81B15 /* flat_hash_map.h */; }; + 65919F9DF5DD987972C6B9C4CB72129E /* alts_tsi_handshaker_private.h in Headers */ = {isa = PBXBuildFile; fileRef = A6477AED5C47C17A2825B86E3920E093 /* alts_tsi_handshaker_private.h */; }; + 65960DFD3766BF18E01A6E1613900056 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = CC3D4368692AC125461B76F60FC5AE5D /* options.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65A3508B7B06C89B599E01A71A972F81 /* slice_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 78BA118E8B62D64218555D3C890098CF /* slice_utils.h */; }; + 65A3604E2055A6E1F20DCB5FF16DE0E0 /* FIRComponentType.h in Headers */ = {isa = PBXBuildFile; fileRef = CC6069A09DEAE7C6F305E4D73F80A306 /* FIRComponentType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 65A463A025D91799137456CBBD128992 /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = DA3CBF62666DA5577546703BEC34B76D /* error.h */; }; + 65B77DBA393B20C4C83A1CBCCFC1AE17 /* stream_compression_identity.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 44DA1862D10A5E16DB66B1A9CA4B65EE /* stream_compression_identity.h */; }; + 65BFD60551F83A4F7E02983C40B1BD85 /* http_proxy.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2BF71C89522F57A2DA99817DDB95EC37 /* http_proxy.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 65C620AFD40230EAC07C018DEE589982 /* alts_record_protocol_crypter_common.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = F4CDC11C5CE10922CC54F8623B421F06 /* alts_record_protocol_crypter_common.h */; }; + 65D4EBC3756D15863BDF44954FDEEB01 /* version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9598C8D3D5224BF92DA977B428DF0CE0 /* version.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 65D975E932DFC554FCF7AFFC44573AE5 /* table_cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 93343EAF5E6FE24CA9CFF6ABE1740D01 /* table_cache.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 65DE0865C64736D04AC07BF9D989D87E /* lb_policy_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 783E4528C1488C1E5B5AC3E05CF493CC /* lb_policy_factory.h */; }; + 65E92107012575B42A4C8928AB6FDD1F /* transport_security_common.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = 0A2A3C2D9D89DE20073978B4954BC390 /* transport_security_common.upb.h */; }; + 65F0719E0C1B0939C5114EE81ACF2636 /* sync_abseil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6EF199DEBC6744AAEFC454ECCF6D2250 /* sync_abseil.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6637F7270D575B72AF594DE9011454C0 /* crypto.h in Headers */ = {isa = PBXBuildFile; fileRef = BEB75104005D644894B0A870CA28013A /* crypto.h */; }; + 66396C4D17E2B2C7E68EACA790B30DFC /* local_subchannel_pool.h in Headers */ = {isa = PBXBuildFile; fileRef = 16FFF8B86C102F7D8F8B82D75E0F6552 /* local_subchannel_pool.h */; }; + 663D2A82C2DCD54AE747147F1132F674 /* FBLPromise+Catch.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 8B1FD4A85E64A8BA3121F8DCCED3AC75 /* FBLPromise+Catch.h */; }; + 667C25EAED0ED307B04FAA4830A8C985 /* safestack.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B9DDFD2DB55AACAB93FA58F91DB2B0CA /* safestack.h */; }; + 669F03A3AF729EC32B02B49D0EFD08AF /* spinlock_linux.inc in Headers */ = {isa = PBXBuildFile; fileRef = ACA63BF9403CDBAAB57966A713249632 /* spinlock_linux.inc */; }; + 66A7196E819C235F0BA6D8B37D1408F9 /* endian.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 6BF0D13350F25D402E034AA04E024241 /* endian.h */; }; + 66CDCB5A0601DD12BC9B28610AA5C416 /* tcp_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F4D0A03E256C135B9EAE3E42644BF0 /* tcp_client.h */; }; + 66D8FAD198BF31C3C9883B791953999B /* channelz_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5650C58CEC45512D23502D6789F4656F /* channelz_registry.h */; }; + 66E5192708EE61CC852FF94D73A4E683 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 66F76139A11795F6CB61B1D96936FACB /* channel_args.cc in Sources */ = {isa = PBXBuildFile; fileRef = D5119B025539C487983DF46575884379 /* channel_args.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 67474BCB90359C39863051D3907FC58D /* demangle.h in Headers */ = {isa = PBXBuildFile; fileRef = FBF3160F613DA48B3D45168A65B04115 /* demangle.h */; }; + 675D72CA13CAAD8E7E828EF971C1AE79 /* tls_msvc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = B0A2E8A49B30A409617821E5044F444F /* tls_msvc.h */; }; + 677B9897E5459E8CFDF6D8933DB22428 /* bits.cc in Sources */ = {isa = PBXBuildFile; fileRef = 360048D07014C552F5C3B924CC9B33F6 /* bits.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 678D445934483DEF005FB83D930FCAE2 /* online_state_tracker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 355EE783706767D2B2ED13809C08E8FA /* online_state_tracker.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6795F4C13F89E02486152D51D465CB27 /* resource_quota.cc in Sources */ = {isa = PBXBuildFile; fileRef = BF47503B9F6EBE5698D99FE7D2501F3A /* resource_quota.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 67980B9E9A5A0E47AC8FC35DA91E3B3A /* alts_grpc_privacy_integrity_record_protocol.cc in Sources */ = {isa = PBXBuildFile; fileRef = E0D4564FBA5A59532E2A16562FFEA7FE /* alts_grpc_privacy_integrity_record_protocol.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 679BA648E2D8E69E9A83BE7F58402906 /* GoogleUtilities-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 299FECDAA701F13AE58DB4ED4FF0B1DE /* GoogleUtilities-dummy.m */; }; + 679FA4F995EFFFAF43CB82EE7CCFD25F /* pcy_int.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B75DD07E543761371585696907AF45C /* pcy_int.h */; }; + 67BA17A560CB235AA957350A087947E1 /* is_fips.c in Sources */ = {isa = PBXBuildFile; fileRef = 7997A3E2D8595195C901B2D801DC79E0 /* is_fips.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 67BC155BEA5974617185690179654B5E /* regex.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = {isa = PBXBuildFile; fileRef = 2647BEA98C98B5C71539F80A83017838 /* regex.upb.h */; }; + 67D65D377C51E935A315E343E50A8455 /* health_check.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 46E075C8BED1B36D60EF96BADFF8B9FB /* health_check.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 67DCF639A298D00FE473B7CAC41AA372 /* channelz_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CA9118C0853A93F8E99CD19D4812CB8 /* channelz_registry.h */; }; + 67E09BA228DD1EAB0B3D3CE2F68EFF36 /* cpu_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0AE207E4501D5AE4978FF3C1838D1ADB /* cpu_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 67F2A2723E101037F689D78F19FFF12B /* route_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A21D417F0FE23EDBD61DA38C26113734 /* route_components.upb.h */; }; + 67F552DE2D8BDD7EFB04F866CFCF9B95 /* curve25519.h in Headers */ = {isa = PBXBuildFile; fileRef = D86FBD5BDD257F3C8038BB216C9388EA /* curve25519.h */; }; + 6801C0C32DC5FFA40FF29C5F5DEE39BC /* byte_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2920D6AE76F6A58FCD9983528B62C48D /* byte_buffer.h */; }; + 681D6C0D6992C5AB0C712FC73CD360D1 /* api_trace.cc in Sources */ = {isa = PBXBuildFile; fileRef = A5E574F17FB22368716C845CF5791C94 /* api_trace.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6835DB8BCCFEFE33D05072C81AA41C38 /* secure_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 65EE7AD9F2EDA71CBD1BD54CA1DE18D3 /* secure_credentials.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 683C118F417AC57AB6D4A1E8DD6AE5D0 /* internal_errqueue.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = AC82E00BF2CA5BAAD779E044347C73FA /* internal_errqueue.h */; }; + 6844D186440D6FB2F52A26EAD1785F4C /* fork.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0A09E4563D0F22CD71C65BB902A5AE40 /* fork.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6860F1D90D171BD9F12BB95F92335CC2 /* manual_constructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 96C4105852CD35C3281318D5271463CC /* manual_constructor.h */; }; + 6868EC7812E993A58ADBE4038A75B0D8 /* load_report.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A18FF02CBC9822154D65D9BC978A31C8 /* load_report.upb.h */; }; + 6869A549E5B5EF86E1F9E9A339FA1979 /* xds_bootstrap.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 7665D3F712E5B040DBCDDFAA4A8EF960 /* xds_bootstrap.h */; }; + 686A87B12ECA5675760789044790D969 /* rds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 1BF261CEDF36ED26D467AD508DD5853E /* rds.upb.h */; }; + 688FB402D56E36D085933715C2D8322D /* byte_buffer_reader.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 358D562D0BC9DC87C5EA2ABB31C2BFDB /* byte_buffer_reader.h */; }; + 689D8688B1B8109BDCA59A659E7AA07C /* workaround_cronet_compression_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = B582CBCABB9ADF0BFF2E891B9252FEC6 /* workaround_cronet_compression_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 68A58CFBCB124ED820826E89C4253D76 /* GDTCOREvent.m in Sources */ = {isa = PBXBuildFile; fileRef = D9DC1435F47B6AC7EA42DCCCE81E9470 /* GDTCOREvent.m */; }; + 68D40940A072E0F2D714023FDA4A30F6 /* unaligned_access.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D1C06AFBB8E1E289E81583A7A7D7A627 /* unaligned_access.h */; }; + 68DB302764217136A8D82145928A148C /* sensitive.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A60518B5C6AA0D002A4EF00B04C6F16D /* sensitive.upb.h */; }; + 68E0A023DF3F9D8D79CEB452F9F93F6B /* fork.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DAD51B726D6D0AD3F797C00B8B1259 /* fork.h */; }; + 68F0725BB62F41F78E9A36B405DE4E98 /* secure_endpoint.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = C3F1BC53FFD8A4A51DA3A8131D9BFA14 /* secure_endpoint.h */; }; + 6900E6C54EEC19145862CB697B6AA547 /* tzfile.h in Headers */ = {isa = PBXBuildFile; fileRef = D77AA049CC87EB804FA5BD66030A1CA5 /* tzfile.h */; }; + 69034CAE164F1E03E5C8560C8D4071B0 /* FBLPromise+Validate.m in Sources */ = {isa = PBXBuildFile; fileRef = 56946162EAC440276805FE8F569C7181 /* FBLPromise+Validate.m */; }; + 6926CFE7DD26621680ED96D7A677CCE9 /* channel_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6E7F875194E544D97D96D786FA3997A1 /* channel_impl.h */; }; + 693E5A27773F2F23B2F6CC6E7150EBBB /* thread_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = B88479DDF08A5793854D3A5C6CC7B955 /* thread_annotations.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 695165DBB488D10CCFA21F9CA9C75E74 /* layout.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = EFBD224024BA96E3D699CDEB9DDE6839 /* layout.h */; }; + 6957DC60D08F5A446A22A4C9642A46F9 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = A26EF50458271CA82806498A1533BF93 /* internal.h */; }; + 695ED7196DC76F47D03C2C34C51E20FE /* auth_filters.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AB0046377B280A57EAB8E730B88997B /* auth_filters.h */; }; + 69775933FA111769BF1D349AE84437EA /* v3_ocsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 162F6E1D07F1240CF5DF466527791599 /* v3_ocsp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6977EA9DADB03EFDFDE5151052D8AF4D /* resolve_address.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E04BE206FDAB3DBB396E61E589EDEBF5 /* resolve_address.h */; }; + 6979E552990C61368668AE41E291BAA3 /* server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 794BCEDADBFFE2E63D0D9C0FE56DEE8E /* server.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 699D9455F04A7B796C021A564DE96A63 /* work_serializer.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 707C3D8840963A14079CA85700DD7279 /* work_serializer.h */; }; + 69A37004E81428D8EDF155DA76044E87 /* backup_poller.cc in Sources */ = {isa = PBXBuildFile; fileRef = 48714E806CF47F9772053FE937AA391F /* backup_poller.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 69A62CD4A13440DCE1363CC450B590BD /* sockaddr_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 121195A1992721C717452598998B4349 /* sockaddr_windows.h */; }; + 69A8DB39EAD8B80E337A271544EA0593 /* xds_client.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = D7E7BD393DDAC9ADEA8450A07D2877DD /* xds_client.h */; }; + 69AD101584C6FFDD0556D6694AC55F95 /* alts_grpc_record_protocol_common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5BE35EF523E5713C7DC02E3074BAD1EA /* alts_grpc_record_protocol_common.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 69B2E509707800645A9071C5B3E5F315 /* frame_data.cc in Sources */ = {isa = PBXBuildFile; fileRef = DE795E37D113F7626530E15A195367A8 /* frame_data.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 69B3861AD7B0AD484BA357BE6030E4A1 /* local_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9EDAB641EF9B8CFC172F1E2876451556 /* local_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 69B5A0B3C6F388F0FC34222910FA5940 /* ssl_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 9479988C8B97951722C63AFDC64A2446 /* ssl_types.h */; }; + 69C65ECE14323A8BFA5E03687DA4BDEE /* exception.cc in Sources */ = {isa = PBXBuildFile; fileRef = 853E4770089A2A0408D662C02A2BE157 /* exception.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 69D46713D09549EA3AEC2F6DC7C56520 /* GDTCORTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = B11A86487F16624DB6C78C55CE5098B7 /* GDTCORTransport.m */; }; + 69D848AABECFD615278C976AA6B30D47 /* rsaz_exp.h in Headers */ = {isa = PBXBuildFile; fileRef = 0049238C3E9AAC3BC661E86C89A71143 /* rsaz_exp.h */; }; + 69DCFBC6C04CAFA0E1233147BB1638ED /* resolver_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 061E3D0E4C036EB9690A95CD28C2B174 /* resolver_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 69E4B0C33866A5AFAA5260550D6B09EC /* stats_data.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = 192682220D65CC123ECC31B83806052A /* stats_data.h */; }; + 69EAF81D862478295F4AB95031930D0A /* FIRAppCheckTokenResultInterop.h in Headers */ = {isa = PBXBuildFile; fileRef = 1675E677767D304323D71A6AD52A79F0 /* FIRAppCheckTokenResultInterop.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 69F84EF76E2648A0DE573C04021E95C0 /* parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = F2B42E37529D0CFD3E5B77383C40FC3F /* parser.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6A083A382726F1E98E64B1A9BF285AE7 /* demangle.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = FBF3160F613DA48B3D45168A65B04115 /* demangle.h */; }; + 6A0DB1046DF12844ABFC2FDB24BC7521 /* x_crl.c in Sources */ = {isa = PBXBuildFile; fileRef = 4082596820A859BB5CBB84F1AD6D52C6 /* x_crl.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6A0E8FD060AD27486CA7A1A37593472F /* v3_bitst.c in Sources */ = {isa = PBXBuildFile; fileRef = 56CE689280D7E03B26BB86F56687B2B5 /* v3_bitst.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6A114DB2757EA0C961B51B86E17837AA /* security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8B64D12B101D6945DBF2E662876660 /* security_connector.h */; }; + 6A13CE5917E8A56B31D59D7F60C938A9 /* resource.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = E8AA7A1C7046681F7457AA1745BE2749 /* resource.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6A1896433644F33A6AC0B114545BF5AE /* huffsyms.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7E9F7C6F8DDC8752F34EB27B2EA45038 /* huffsyms.h */; }; + 6A224A3437DB9725EA8C09D59A559810 /* FIRDependency.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BD99431D13A0200B9E86F6240B59422 /* FIRDependency.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 6A23A07FD8A8FD9EA740FC88BC9FE147 /* hash.h in Copy hash/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 979966287B4F51FF3C0BA7982BA258F4 /* hash.h */; }; + 6A45738E536BA006F2D1BC0A8B3C087D /* FBLPromise+All.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = DDEB5E4FE0768AEF991D265861A9C550 /* FBLPromise+All.h */; }; + 6A7C90E5F8537266302D9CBAC709C3BE /* http.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2EFC08623CDCB418157DC52800AAF14B /* http.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6A86B90E75E63804EAB4497C69ADDA4B /* thread_none.c in Sources */ = {isa = PBXBuildFile; fileRef = DF1CC2F0643A2BA93A0BA41DB9FB2E00 /* thread_none.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6A8CC9BED5396FB668C60B779DE32D1F /* FirebaseCoreDiagnostics-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A51AE3F96F277D764A798B322CFD9EDF /* FirebaseCoreDiagnostics-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6AA188DAE78D74EC9314FF00CE9FAC9F /* event_string.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 79F4076575012C7494D398ABBEC45A18 /* event_string.h */; }; + 6AAE22DC1BB77A4B0BD84E76067CDE1B /* wakeup_fd_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B76DE14AA09E463E45C815279F122262 /* wakeup_fd_posix.h */; }; + 6AAFD3356BBE23913825AF9F8580A251 /* throw_delegate.cc in Sources */ = {isa = PBXBuildFile; fileRef = DDBA219B26A46DACBC3BBB50C08D0CAF /* throw_delegate.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 6AB4AC0BCC5A022C8A59EC079355F55A /* charconv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6BAE89B682408E1540F6F23CB91D3EDA /* charconv.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 6ACD164DF65370A050C7CCCEF9A6AC5E /* rds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6B23B91D857C394AC9B6A46BF51C470A /* rds.upb.h */; }; + 6AD42D7BF63FF5BC39FFDCCF0227E905 /* pollset_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 99C1768C99CDB3B0B5FAA54D2EA764AB /* pollset_custom.h */; }; + 6AEED8EC7D640895CFF0AF756F5181F9 /* http2_settings.h in Headers */ = {isa = PBXBuildFile; fileRef = F64F1939265A0552BA2F9A53AE1B5AD2 /* http2_settings.h */; }; + 6B2004A15D72ACAF55AC5C37B61B20DD /* compression.cc in Sources */ = {isa = PBXBuildFile; fileRef = D55A21B8612C3744B9FF79B123CBB6FA /* compression.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6B22DC8F290329BAD802E7A1DE4A2AD9 /* backend_metric.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A530D16A35BA070587ECB2A518590E4 /* backend_metric.h */; }; + 6B4786AE5DB52AB6240E0302D13A96ED /* backup_poller.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D4FD3CE529D5052F28E1CFF76AAD1C /* backup_poller.h */; }; + 6B610EEC287149202560A47755EBA165 /* FIRDependency.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B2907AE026FB981D8504EF0B529FD5 /* FIRDependency.m */; }; + 6B95B9C9BEED2DA740BBE9E880633E3F /* merger.cc in Sources */ = {isa = PBXBuildFile; fileRef = E2D650C523EEA29DAF171DEC4D83B300 /* merger.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 6BB7419B2BD1A858A5C95B2819CA29A0 /* decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 053213A0CC6738A69DB6FBBE362E3E75 /* decode.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6BD614419B46A436F895F429BC0DDEF8 /* rsa_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = FAD8A7EF54472CECDA1234F4A0880196 /* rsa_impl.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6BEE9A99E47B1E62937DD8E0479EF4E4 /* match.cc in Sources */ = {isa = PBXBuildFile; fileRef = DDAFD2F28A6BDD6C6DD7B33358B069C4 /* match.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 6BF2A8FA8D90304B468F73C83FBEEF85 /* error_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 039BEA729826C3D85DA222EC6F94975E /* error_internal.h */; }; + 6BF84387924FA88541961DC68BD5160A /* transport_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = DC4696E577091CD5D56B195286AA6D4D /* transport_impl.h */; }; + 6C13D68556DFE88E5362AD2C5382FF72 /* pool.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 0F0E6F94588A9EDAB64D05FFCD82679A /* pool.h */; }; + 6C191517F32B06AE4AE430D577D89B21 /* message.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13F7D04CE543FC13DE1CE37822055B13 /* message.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6C1DF27CDA12B13CD3FCCCD048A24338 /* chacha.c in Sources */ = {isa = PBXBuildFile; fileRef = 17FCD7FD56BC613FCE058FA35C6C15EC /* chacha.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6C205CA06DE739D6388521FEDA3F1944 /* load_balancer_api.cc in Sources */ = {isa = PBXBuildFile; fileRef = DF3E7390BAE77BB00C79037B0A5B5A17 /* load_balancer_api.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6C2511C2C8ED04A3525D5C34E4B0159D /* alts_shared_resource.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 08A7440CFF031982570D78C193E1319E /* alts_shared_resource.h */; }; + 6C269DD696B5CEE9B856528E6863A504 /* scoped_route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6C09B3C005F0FD627C3EA4FE43FB8733 /* scoped_route.upb.h */; }; + 6C5AC3175D938678FC03755174918D47 /* FIRLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D623F8E0554C2BB582285E8E379C0EDF /* FIRLogger.m */; }; + 6C67C0BFF878FA98A13B1291B14D2F97 /* internal.h in Copy crypto/fipsmodule/ec Private Headers */ = {isa = PBXBuildFile; fileRef = BC745D065B51B818F70988028DFC89FA /* internal.h */; }; + 6C71B7F70690F1F744A5FB433312B20C /* grpc_alts_credentials_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3F387FBA9DDCDE0212264495DB93AF3A /* grpc_alts_credentials_options.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6C99259236A0CFF61455D9ECF5C7B14F /* channelz_registry.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 8CA9118C0853A93F8E99CD19D4812CB8 /* channelz_registry.h */; }; + 6C9BB667BEE9209D8B52B5578D1A8D0E /* base.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = EF76B11D8DE5C0B489E5BA1A585CE327 /* base.upb.h */; }; + 6CA4E5B097160FC6C25AD342F5E9A077 /* v3_crld.c in Sources */ = {isa = PBXBuildFile; fileRef = B89455D4D5E651EC8A9E4F437F876E1E /* v3_crld.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6CB944E4AA5FA4C57D8F7E45BC3934C7 /* transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E71D724C3E47B5F6B27A0D86265C45C /* transport_security.h */; }; + 6CC048B39F029041960A1759D6718875 /* fd.c in Sources */ = {isa = PBXBuildFile; fileRef = 31A087031ADDE1AF7880A8A86D0C7F41 /* fd.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6CC795B114FAF0EE8E8C89921D2256A7 /* xds.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7B740FD698E3CA13E378DAA34EFEF3D6 /* xds.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6CF1C2B10CA4961150E96A134A552032 /* slice_string_helpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B6C0C7BACF09F445535CE0F6C779143 /* slice_string_helpers.h */; }; + 6CF3E7D231FA9A577C82E176D32692CA /* match.h in Headers */ = {isa = PBXBuildFile; fileRef = 180D252F816C445EFE273EDA89501423 /* match.h */; }; + 6D2DC33EEC1BD9C9F000E9C42B561AC5 /* slice_buffer.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = DA9B38B02FC04FFF9E9B84E4D3E7C859 /* slice_buffer.h */; }; + 6D2FB7E76722BF966BCC6D18B38A84C6 /* error_internal.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 03802921213BD6AF75F8E23379BD49FE /* error_internal.h */; }; + 6D413E50E3F2F1F1760150567336DE38 /* grpc_service.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 7E9BFB96EF97B46DA6BBE29783375AA5 /* grpc_service.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6D49976AB716D60EE30532D2744116E7 /* output.h in Headers */ = {isa = PBXBuildFile; fileRef = F1622E9A9A961729DA445FAB73B0974D /* output.h */; }; + 6D4FA213902103CD228300673E6E5E3E /* database_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1A6D36D6C209266D5ECC3572D41AA7E8 /* database_id.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6D5C7F97E7AD5BBECC2FA8ADB63B7960 /* static_metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = A58B6CF39A3BF9233150B1782155AAB3 /* static_metadata.h */; }; + 6D6248668A63B019507959BA48ED81AC /* altscontext.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB03E565CB23E05469C865350E8481E /* altscontext.upb.h */; }; + 6D7ADFF757FC04756A5A0E31B14571AF /* handshaker.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 75BB1AFF2F9D9F5D67043A052BDF2AEA /* handshaker.upb.h */; }; + 6D87DAB899FB6DFDB753DD75EF389D3D /* oct.c in Sources */ = {isa = PBXBuildFile; fileRef = 78A85F747EBF50DEFA43E830EA297434 /* oct.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6D8BB5D0C6B77DF33EFD267CDB665F74 /* grpc_unary_call.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0F07A817973FE0DDFD54E66F375D98C6 /* grpc_unary_call.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6D9E38209BC6215135D1C8A16E52E11C /* resolve_address_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = A9F4DDB181B2A441A209A1651D4F22CD /* resolve_address_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6DA0ADA38CC766128674236E6B7137E1 /* status.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 8C6EE08C23D04559BACCC047EFFB9509 /* status.h */; }; + 6DA6DC663B9B7AEDF4E835AF4E0D510A /* memory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4291555008D94A32C804A59C52ED3475 /* memory.h */; }; + 6DB567631D02BD1EB77FB2A0051E1BE6 /* stacktrace_arm-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = EF7DC7895952D40AF44FF1457345D047 /* stacktrace_arm-inl.inc */; }; + 6DBCBEA9783052637155D0ADDFFC75BF /* ev_epoll1_linux.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = F6A593B29FF8456257AD9767E1EE0BBA /* ev_epoll1_linux.h */; }; + 6DD3D81477A84A9366E9F70A2BFE46D8 /* listener_components.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 2D889716CA8C2EBD7DC40C9E7718A74A /* listener_components.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 6DD5B12846480E32EA0B88E263740283 /* iomgr.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = A56CC67B0787B694FADFA2B3B9015932 /* iomgr.h */; }; + 6DD66C9E81A2DD07CB44530E50AFB7C9 /* hash.h in Copy hash Public Headers */ = {isa = PBXBuildFile; fileRef = F7B65AC4592C7EEA55B70BBEECB2A919 /* hash.h */; }; + 6DF2D55A868DE0884CE826AA2EAFA03E /* symbolize.h in Headers */ = {isa = PBXBuildFile; fileRef = B46F0E4D4D1CAF33B69692A375C1CB8F /* symbolize.h */; }; + 6E16E9A718963DBD435E74E31DB3B152 /* filter_policy.cc in Sources */ = {isa = PBXBuildFile; fileRef = D68E02F4EA431301782785D1E57DC3E8 /* filter_policy.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 6E22879787D985632CA3101650CB6684 /* server_builder_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 42930C033D30E0C95408769940E8AE36 /* server_builder_impl.h */; }; + 6E230A5DE3695F06AB6CE9F13B2B81B4 /* discovery.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = B6EA6E949BB67E282815367289D96D73 /* discovery.upb.h */; }; + 6E3427191E86694FCD8D35FBEA5E2D58 /* bio_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 913AB50B1D427BBFFEC3573E5A05D701 /* bio_mem.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6E3536C47903C039F5B2486E11384DCA /* slice.h in Headers */ = {isa = PBXBuildFile; fileRef = A21399A3BD7D75F80B053BEDEFFFA4F2 /* slice.h */; }; + 6E3A0FDE392EA890B9D2A8182B9B857D /* grpclb_client_stats.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = 2DF221C1FFACB0663A4F79785651851C /* grpclb_client_stats.h */; }; + 6E50B808F3CB1EDC3263F96DEBDE12CF /* server_initializer_impl.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = BEB68F5A6FCCA598215C0060142CC500 /* server_initializer_impl.h */; }; + 6E55097A38E0852E042F9B0E134A2AF3 /* x509_trs.c in Sources */ = {isa = PBXBuildFile; fileRef = D6463500ED181ABC5E4A63EACE23447A /* x509_trs.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6E5F643BEB86AA8C0D3B23F2985B0B27 /* filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 82FBA47BD6F5524762E00CFE3EB1CAC1 /* filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6E721D032A69BC26C2758C4C76609F6A /* FBLPromise+Do.h in Headers */ = {isa = PBXBuildFile; fileRef = 78B799C5CD60EF0F2A8DAD61EDD7C304 /* FBLPromise+Do.h */; }; + 6E85D89BBB60B794A78967CAF4A02C04 /* v3_pcons.c in Sources */ = {isa = PBXBuildFile; fileRef = F449B073E2EB4910F6B47402D0C4F789 /* v3_pcons.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6E885026E24FEA1317D3910E4E73BB93 /* duration.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 3CCEB77F18F4584631BA806547F5BCE6 /* duration.upb.h */; }; + 6E893CFE49DA5BC3AAA99DD839504788 /* GULSecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F660407E9951B59034B8EF2ED69083E /* GULSecureCoding.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E8FCD6137FBEA4C9F2984F4481D384D /* auth_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 444AB9B18BEBE02DA7B5CE51CE888C46 /* auth_context.h */; }; + 6E96C2312155A0A2F459FD0B5C1B4AAD /* stream_map.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = B5930E543F0DA06668114E5617874688 /* stream_map.h */; }; + 6EC52727CD1750229F241B8A255FE01A /* message_size_filter.h in Copy src/core/ext/filters/message_size Private Headers */ = {isa = PBXBuildFile; fileRef = 32EB43B068040C2D345B6965A4E33D03 /* message_size_filter.h */; }; + 6F04E5CA137B5BC4450EC3B3DCC3AC15 /* resolve_address_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B47CA2898B3BAF5F43DA3D92B73A271B /* resolve_address_custom.h */; }; + 6F0540727F6066E9229CDAD7496A9B68 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 6F0ECB6BC614811F8A33CF0EFA917571 /* charmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0DA9DE01C62DC239C2D784F936B2E920 /* charmap.h */; }; + 6F106878D8AAF25E0CAB0249B3B15DF5 /* grpc_if_nametoindex.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C62DCF6C8D4E7CA9AFA7D2DB579020D5 /* grpc_if_nametoindex.h */; }; + 6F1A66352FEA79126A63000B2121C276 /* timer_manager.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = A25C69824148C82983802E09EA43329F /* timer_manager.h */; }; + 6F2826CBD3F29E444E3970649B4C0A80 /* FIRAppAssociationRegistration.h in Headers */ = {isa = PBXBuildFile; fileRef = 53841BC6166418C9ABD7280C47B2F7FF /* FIRAppAssociationRegistration.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 6F2E25F8097B57DFA60DA3AA972B2A56 /* database_info.cc in Sources */ = {isa = PBXBuildFile; fileRef = B992BDC47F8D5EA6167AB33530A667F3 /* database_info.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6F30D0360FA6C31EF32FB8A5C2BCF656 /* varint.h in Headers */ = {isa = PBXBuildFile; fileRef = 92084C2699C4C3F8815767B3E4FE8D62 /* varint.h */; }; + 6F50A7D8980329952C7FF1FBE5CA495F /* alpn.h in Copy src/core/ext/transport/chttp2/alpn Private Headers */ = {isa = PBXBuildFile; fileRef = 24385D56D890C859D59455A951BF4D46 /* alpn.h */; }; + 6F52FA56A4A060D8BAE9C9BB2AF497E9 /* rpc_service_method.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 7370655514EBEDA752C76B3B6C052503 /* rpc_service_method.h */; }; + 6F5501717D40BFCB2E2E96F2390B4A77 /* mutable_document.cc in Sources */ = {isa = PBXBuildFile; fileRef = DE60217F7EC6CE9C5AFDAE439BAB3BF3 /* mutable_document.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 6F5FE9FD2AAD466BC0BD9F55B988B3D1 /* sync.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = C5290DC6851A635298C20FAF5B67CE70 /* sync.h */; }; + 6F6CDDB4F9B1691CEF56D9F66382EB84 /* spinlock_posix.inc in Headers */ = {isa = PBXBuildFile; fileRef = 61060E937CC594BAB60BC43807AB59CC /* spinlock_posix.inc */; }; + 6F6E6D21DBAB0022112D40EB51CAA5CD /* arena.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 88FDEDAD0531906F2A06282D40C09148 /* arena.h */; }; + 6F724B4AA4184E7D627CD175E8203B1B /* time_zone_info.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = 24F531CD79C0BC6E4272574162F46F7B /* time_zone_info.h */; }; + 6F8F54ADD97B1F741D45FAD976F81FD3 /* unix_sockets_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 72AD3AC6CBC8250F45B18C6AAD60CC0D /* unix_sockets_posix.h */; }; + 6F9BF614FC0EA8FAE48A5BF0FE89FC79 /* async_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = C12FDA4D0284C83C4D7A328AAD8476A5 /* async_stream.h */; }; + 6FA267C6FB7F1E12EA31541AB9A4D169 /* server_context_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = D99D47646D47CE546DF15348736C4E82 /* server_context_impl.h */; }; + 6FB99C569E062950FFF500577DC3369D /* dh_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = F9A85A218694BC0C65B81F0C0B7DA4D9 /* dh_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 6FBF1E307C1E43B61929344307CBA53D /* bind.h in Headers */ = {isa = PBXBuildFile; fileRef = E37EC012998CA28B611BAFCCBE9FC28D /* bind.h */; }; + 6FDEAC944FACA7E6BFD7DF6D7B87F115 /* xds_client.h in Headers */ = {isa = PBXBuildFile; fileRef = AD3D0AA603EBFB0F04A26EB7C52C531B /* xds_client.h */; }; + 6FE09BD595B3DBC9BA5EB1295847820A /* string.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 0122781482DB99BE6378BC4DF1087D05 /* string.h */; }; + 702256CA2EF295A45918498BDD1669DF /* unix_sockets_posix_noop.cc in Sources */ = {isa = PBXBuildFile; fileRef = ED30DB9CFB54C848410E0EEDF042FD9E /* unix_sockets_posix_noop.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7023C64B2F1B8589E4A389092F0AD9FF /* socket_utils.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C78C141A9A2F8317180F5FA5798131FC /* socket_utils.h */; }; + 7025CE66087A7042CB1A4B0F0DC9BACA /* port.c in Sources */ = {isa = PBXBuildFile; fileRef = 898A07FB8760FC2672D23FD7383A791A /* port.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 702A2D2A6C3CD5DAABF66A60962FA86D /* iomgr_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = F093766FF2A26F5432830F50C0B42D98 /* iomgr_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7034F73D746204F01A44582C695ECB70 /* elf_mem_image.h in Headers */ = {isa = PBXBuildFile; fileRef = DA62D6A2A16FF788F79064DE2907302E /* elf_mem_image.h */; }; + 70351819CB607E3AE5EDE9127B19940A /* opensslconf.h in Headers */ = {isa = PBXBuildFile; fileRef = C1176295495A9747C0B9B9B03E9A680B /* opensslconf.h */; }; + 703E0C5B7135CC6590BF0B4DAE6833A9 /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BD3F0B6294C4ADB164D918CC624806E /* snapshot.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 704867D2661413BFB1C3120D2DDF7C34 /* alts_counter.h in Headers */ = {isa = PBXBuildFile; fileRef = 18E1B8B1DC940C40B0291001AAFFE1BC /* alts_counter.h */; }; + 7048778880A3C9C43965B6AC310753D9 /* http_client_filter.h in Copy src/core/ext/filters/http/client Private Headers */ = {isa = PBXBuildFile; fileRef = B5C0118BE6E61929008E1E1D7C94D40F /* http_client_filter.h */; }; + 704C1262A7DA090ADE6A61BE3F4A5D0C /* db.h in Headers */ = {isa = PBXBuildFile; fileRef = A449BAF74875449A62888CB039B14F40 /* db.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7051AA81D21812639DA46D86FB7D9B45 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC745D065B51B818F70988028DFC89FA /* internal.h */; }; + 7051F8EBB820621C0FDD46219B77A7F2 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = D159E2C7037265BFA975BA6B8CE85CBC /* internal.h */; }; + 7067771213368ABCBA22436C3A82ED6A /* load_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = D7F0AC7CEA7D6480EF1F50134E8EC420 /* load_file.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7068AE77B64E82B477A371180A347693 /* load_balancer.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 877F80FE844F159AEB3712C281F3441A /* load_balancer.upb.h */; }; + 7074377CA978FA172816E8FD7F1AFBC1 /* tcp_server_utils_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 4FC8EF4B7A4D3FBA96EBB69A2F992A7F /* tcp_server_utils_posix.h */; }; + 708239AED072CA2D8EC974BD826FFB76 /* time.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EF8D8C6613AB7477BACC0DC69B5887A /* time.h */; }; + 7099EBB89BEBBB4E2E2BB2A4B57CC0F1 /* msg.c in Sources */ = {isa = PBXBuildFile; fileRef = 77EE97F143015E95C0B1845D8C8ABB58 /* msg.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 70A834BA2A9E6F296B8065E89507953C /* subchannel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 470A2E0E8B613BCA4289281E71307DA9 /* subchannel.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 70AD83AD52155ED4994533287922D3F2 /* leveldb_remote_document_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = F496FB27791EC99D7E1900129F1A46CE /* leveldb_remote_document_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 70AE29C09E21A1BA262C9A8702A01AF9 /* service_config.h in Headers */ = {isa = PBXBuildFile; fileRef = C5C671C3A8E2619B166BB8466A4C0ED0 /* service_config.h */; }; + 70C0CDDB660530FB9134EE802B150505 /* curve25519_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 0618EF3D922942AB0599F423215BB750 /* curve25519_tables.h */; }; + 70F017D9501668A43658FEAEE920FA61 /* tls_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 53BB379AA11E9D6252032FACF7A58092 /* tls_gcc.h */; }; + 70F4D826449F0D5947302D6B30F31B0D /* string.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 2B36415639698D83C10B4C6F4BC49426 /* string.h */; }; + 70FE06D7429ECA20112D2C1F07393955 /* GDTCORFlatFileStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 416BD878FDE36B0E876E3A02BAE72148 /* GDTCORFlatFileStorage.m */; }; + 71050FC7809921E80DA120BE0445AB5F /* v3_prn.c in Sources */ = {isa = PBXBuildFile; fileRef = 713116C5F644A85F2280CD820ECD957E /* v3_prn.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7107F8B132D868303F6C6E6C52E1FBC1 /* ev_poll_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = C5023C9AD47210C9FDB7C03D14544B73 /* ev_poll_posix.h */; }; + 710C678DC1984847A38923DABFD25A2E /* async_unary_call.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FFB2EE419C9A72A3B8781CFF2B88FE /* async_unary_call.h */; }; + 7115E68B9740356C58CBE295B1549802 /* tls_gcc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = D1C641E80759BADEC2646F8FC15CB346 /* tls_gcc.h */; }; + 7116AC4BE3AA3F9600D877D34B86E3BB /* gpr_types.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9868F082F4AA742CA857B0F81F9A90 /* gpr_types.h */; }; + 711B44D2A59599382EE558181315C7F7 /* rpc_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 7521C3B21B070A87DEA95363CB064967 /* rpc_method.h */; }; + 7124E5465B5031943910ED09334F0359 /* http_connect_handshaker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 925CBFE07879CED7AB664C795A2897F9 /* http_connect_handshaker.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 714271A6E0F5A0B0326CB7CF6C9085AF /* mem.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B85C1607FF9B70FE3F5E9976FFC0A4C0 /* mem.h */; }; + 71913F1E1994B9917E5CF571E22E5AAF /* local_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 20BE36670AF41FEAC19EF9286FC4AD7A /* local_transport_security.h */; }; + 71917BE1845462554400344479AAC085 /* status_util.h in Headers */ = {isa = PBXBuildFile; fileRef = AD7F038300BA50B8ECEE08E051166E54 /* status_util.h */; }; + 719E91620DFD9F7243BF54587537FCE3 /* x509.c in Sources */ = {isa = PBXBuildFile; fileRef = EEECD989879D7D11D823655F92D76BA3 /* x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 71A28D845463BF6FBAEF82884BFC6B12 /* lame_client.h in Headers */ = {isa = PBXBuildFile; fileRef = A6FC36BA9BDB68998B65C9C65B7D60C4 /* lame_client.h */; }; + 71A69E75012CD4CD4FFF7E9CCDFAF423 /* query.cc in Sources */ = {isa = PBXBuildFile; fileRef = C750DB7FD3ECBC4EEC46DDE950FD8737 /* query.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 71B8685C9B06A06FD407F7F18088D293 /* sensitive.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B3ACBE8839657A7A07B6B03D2D559583 /* sensitive.upb.h */; }; + 71FDA856580469C7C79557580359042D /* GoogleDataTransport-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED364E8B5FD0DD7B7F3391132B01025 /* GoogleDataTransport-dummy.m */; }; + 7200FD0C3EAA6652ED474E0765CF7A6D /* cct.nanopb.c in Sources */ = {isa = PBXBuildFile; fileRef = 7B2B4A836335C82CB5CBDC1D12EA8755 /* cct.nanopb.c */; }; + 7205A548DC3F732C0FE3FA961A0D219F /* order_by.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8F3F8D9CC413B79B798AA7CC891E85DA /* order_by.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7214AA8ABC0B3BBD6479509020DBC69B /* client_channel_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = EDFD570883F6D2D879064CDBD947045D /* client_channel_factory.h */; }; + 72172056F31E0F6A705A50B85BF936D6 /* pkcs8.h in Headers */ = {isa = PBXBuildFile; fileRef = E02D2539BC68BCE4F8E801127350935E /* pkcs8.h */; }; + 722F503E5524F303BA5980CBAC84CEF7 /* span.h in Headers */ = {isa = PBXBuildFile; fileRef = 0616886D4D867ECC1ED7D73DDC3DB27A /* span.h */; }; + 723124C0FE28A9DC1476B0E650D94315 /* port_platform.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 65DB24AA72A09D1E97E91A8763F9C818 /* port_platform.h */; }; + 7234188DC2F8E210244C49675CF05217 /* nanopb_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7430EE0C24F9C897450F138CDF396FF6 /* nanopb_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 72536361CD02350CABEBFB17394D99E4 /* handshake_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = E286F7F35966B90C4AB25A4AF4E221BD /* handshake_server.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 72557BF505FCEB32013D906AC99C1C27 /* executor_libdispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 03DAE0986021B6A0ADE31ECBF13BC2B6 /* executor_libdispatch.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 7259B9A22E253751A5C377C6CC992E01 /* wrappers.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 5646E592BBAC6854FA2A9E247B330FC6 /* wrappers.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 726D1DA6DFB1CB3D570F29606A7D4618 /* i2d_pr.c in Sources */ = {isa = PBXBuildFile; fileRef = EEDEAAE34E2DDD91998408BCFE50DB68 /* i2d_pr.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 727B6B0F391661F86018CB7CB79679FD /* stacktrace_generic-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 60CAD879D8EACD61B88CCD724549E955 /* stacktrace_generic-inl.inc */; }; + 72809A291812EC57914A6CD1979006AF /* crc32c.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B6CDB868D356BD0A3C52A5D9FC12118 /* crc32c.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 7295C075CBEB0DB1F328AE007545997E /* curve25519_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 49CCF8A64C5BDB15A5BF1062196A5959 /* curve25519_64.h */; }; + 72AAB64FD3338541B6F6418662C045DF /* memory.h in Headers */ = {isa = PBXBuildFile; fileRef = A60387F616E5571CEF9AE353F45D7C70 /* memory.h */; }; + 72C4F867BE3F250D74C3A8760B16732C /* alarm.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F366375B86B3AC902A44764DD321B8F5 /* alarm.h */; }; + 72CD22891C34392DE4E97B6AE07E34FD /* frame_rst_stream.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = D2BEEF4FD18F0E39C9A0892573CB698E /* frame_rst_stream.h */; }; + 72D5E81975F6EF5800B342D6BC47BA63 /* ev_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 853299A1FB498B3CC03E06CFB16D1343 /* ev_posix.h */; }; + 72E28F8C1F58CEEA376D3D1761180024 /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 7565456ED66C9F7AAB35CFF93C311B70 /* kdf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 73007D732F76B78FCF6C8D67C6AFCF73 /* target_data.cc in Sources */ = {isa = PBXBuildFile; fileRef = A5BDF47E4C51DCD86B15BC08DEE68099 /* target_data.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7317C78C5B0CB22B6B5C242F2F17E5AA /* frame_goaway.h in Headers */ = {isa = PBXBuildFile; fileRef = 75746EB8FB15F347875401786A1E5DA2 /* frame_goaway.h */; }; + 731B0916AE888905F4C62C38C1B0B867 /* create_channel_posix_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = AF3DCF24D3613D03CA60B425BFE16B9E /* create_channel_posix_impl.h */; }; + 7344702E1EEEB9C69C181C747A8B98CE /* ssl_credentials.h in Copy src/core/lib/security/credentials/ssl Private Headers */ = {isa = PBXBuildFile; fileRef = 398FA6BE3CD65C056358FBE7EBBEDDC3 /* ssl_credentials.h */; }; + 735E2D92D52CB385D3448DBB32B3DB04 /* create_channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4328B8C23D84342B8BF117B78402199F /* create_channel.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 73772FAA5B027591DC53C9D5655AAB1F /* d1_srtp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7D56DE1BC949B4B4F93C71C452A035AF /* d1_srtp.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 738168489A15EF2C6FA50B3FFDAAD3C0 /* dsa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6629A5097D67C07858B93A17D9373E /* dsa.h */; }; + 73816861609770420643B0C7B3B89193 /* http_server_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D4BEF4E82F2C880C20B283963A36281 /* http_server_filter.h */; }; + 739036EBEFBCA20D71CBAD9CCF0E601A /* grpc_alts_credentials_server_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 76489A841AE3766DCA096942FE84094E /* grpc_alts_credentials_server_options.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 739A54740C24B3B7662A533FC08F4EB6 /* bad_variant_access.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9EAF735DB4F8C896B4B0612350E08A0E /* bad_variant_access.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 739DD9045B646B76A26B45F62AE03793 /* resolving_lb_policy.cc in Sources */ = {isa = PBXBuildFile; fileRef = C0C01AFC3951F03191910FD0B061E5AC /* resolving_lb_policy.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 73B705BAD79850D6D62C764F28ADE09F /* any.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A0D9F94DC9B38464FEBB8B25D355C0E0 /* any.upb.h */; }; + 73BDB1380A22FAE4E107A20F6B106F94 /* endpoint.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = FDB818CE2139D1F1F49FD25FBF04A68F /* endpoint.h */; }; + 73C451C7FF483E1911C5222A0EF8F4EB /* global_config_env.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F94046AF98C1F7AE234D6D8EB3C3F6 /* global_config_env.h */; }; + 73D1A67A3A065C64113426803C44DFC0 /* rpc_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 48C0BC392FFF6685F862551F33F6D994 /* rpc_method.h */; }; + 73E2E45E7DE8E40AB65817676974EFBB /* static_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2473AA39618F241F27934D3F6555CC28 /* static_metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 73E561C5989FD59C3C6AF70EBB816128 /* FIRAnalyticsConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C3483A9E757721D4A9C8A9839154EA6B /* FIRAnalyticsConfiguration.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 73ED2D547B7B50C3934CCEC00CA6BC4E /* http.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C0F95936CA615C11C89937BAB702E9FF /* http.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7438108BD239C10C474363FCA605B211 /* sync.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 38F3E929839096653111D65E2F29BE3A /* sync.h */; }; + 7439A2E1B5C01851D7BD91941F9E93C8 /* GDTCOREndpoints.m in Sources */ = {isa = PBXBuildFile; fileRef = C8E192B9EA33B3BCEC71CD10D86848B8 /* GDTCOREndpoints.m */; }; + 744DE4E5BB355CF87145077B3BD54C11 /* iomgr_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 39A5254AF0CAFA22B443D30475E677E8 /* iomgr_internal.h */; }; + 7451FC28A10C6DD9E80F2F716517D489 /* pem_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = A0868D0ECF4259B69353F0DBBF61B27A /* pem_lib.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7455E9CB1CC969A086382E64CCA8EE84 /* interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 01E9E32DCC2758F4DD9AF31F20C36D25 /* interceptor.h */; }; + 7493FE6646542B0A198EED1062FDFF2D /* insecure_server_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F06B79D5DBAB6A2F2D6769F942634F5 /* insecure_server_credentials.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 74A179F7A0BD47843C9D071328756EC4 /* bdp_estimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 83FBF2ADBA37C6AE104DA0354C416D7A /* bdp_estimator.h */; }; + 74A2578217CCA79F83F95E4B088B8130 /* server.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F2CA69F1A5A70221803E171B54EDD51E /* server.h */; }; + 74B3471B9CF0CD214BD535E121E56CE2 /* polyval.c in Sources */ = {isa = PBXBuildFile; fileRef = A466854894ED4D8DC61B11E610F3A953 /* polyval.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 74B6BBE4192D8628482B7FFF16AB560E /* pollset_set_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 17C2FBD16FAA0916679B9E24DC144CF4 /* pollset_set_custom.h */; }; + 74D85E62C4F0CF83E47FD9865C4F3B66 /* db_iter.h in Headers */ = {isa = PBXBuildFile; fileRef = DBD7AFE202CDCF4E8B889D9F9EB131F0 /* db_iter.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 74E7EAFA0407525CC2C2742B5257FE32 /* credentials.h in Copy src/core/lib/security/credentials Private Headers */ = {isa = PBXBuildFile; fileRef = A9E4BAEAE257CE5BF099CEE6D9CFEE1D /* credentials.h */; }; + 74F5BB9418968C47CC4808100FC09367 /* channel_trace.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = D611A40F8B6A2EF6FE12FC444F22469B /* channel_trace.h */; }; + 7511787524811F67D45DC6C4914DD39B /* backup_poller.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 43D4FD3CE529D5052F28E1CFF76AAD1C /* backup_poller.h */; }; + 752196BED9A63ABE288C7345ADDFC668 /* ssl_session.h in Headers */ = {isa = PBXBuildFile; fileRef = 1004B2FF809ADB5136C6207146F8CF05 /* ssl_session.h */; }; + 7526DF06319A826070EE6F566FEA388E /* by_file.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D51483FE296BC1F22031B12790E17B5 /* by_file.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 753819167FB081CFDA965E7C71AAA9C1 /* thd_id.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = E92BCBCD2EC5118CB4748145324C6145 /* thd_id.h */; }; + 75612B802DB373F785390F70CD041D68 /* arm_arch.h in Headers */ = {isa = PBXBuildFile; fileRef = B2B7493C81A4B6F855A3AD8B76C5B7DA /* arm_arch.h */; }; + 75764FAAA8636D9CC6C9519A84D30BDF /* call.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C8EAE3AB2E0EF5A563D19724B03017 /* call.h */; }; + 757AF20BA912A3D39CB28119F3CC2414 /* timer_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = D062DE1EF6A244B83C34527A3F6E1B8F /* timer_custom.h */; }; + 75A8A96227BDE414BE2EA9C3B5608887 /* call_combiner.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3E15A49E106AA5251194810E927C2F4B /* call_combiner.h */; }; + 75AC56AFC06C3E5E0935B9C019AB4E40 /* time_zone_fixed.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FA59C12BFEBBCE17D29BBE9163CE881 /* time_zone_fixed.h */; }; + 75AF9F73B1467744214367F6887D543A /* tls_msvc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 75627434CA74A60A1612604AD510C495 /* tls_msvc.h */; }; + 75BCB14A1814929DAF5C357A62DEF55B /* compression_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = CCF3050B8F684E641A61005EA0A6D8C0 /* compression_internal.h */; }; + 7613F5F57A23F6EE36B6BEB8CDDFCE70 /* filesystem_common.cc in Sources */ = {isa = PBXBuildFile; fileRef = AEAED9EED49D19DF250AA653A5592363 /* filesystem_common.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 761543FE8FA42FB9DF694E65E7FCA2C8 /* log_severity.cc in Sources */ = {isa = PBXBuildFile; fileRef = D1E0A100FC0CD0A46CD7AB8EC4409FED /* log_severity.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 7644CF862715E285682966DA89401196 /* context_list.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 204F44207D81AAC775BF1E202108F385 /* context_list.h */; }; + 766A6DB33A5AC1DCCF4FDCCBB7E7942C /* grpc_ares_ev_driver_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E948E4FE08B40EA7338760D24DD1C /* grpc_ares_ev_driver_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 767213C27CD814E3B357EF8743DED3F7 /* resource_quota.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = DE3910421BE3971CEDA899A59D46974B /* resource_quota.h */; }; + 767703405C550B7EA03EAD9A35761B44 /* x509_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 37384569AA4C3DD68DC0C52D69C1FAAC /* x509_set.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 767875B04FF60630BDD2E671FFBB29DD /* symbolize_elf.inc in Headers */ = {isa = PBXBuildFile; fileRef = BC0178DF14AC0D9F8CDA8D7FAF34524B /* symbolize_elf.inc */; }; + 76885C6D018A043FC128324C451E9FB7 /* resolve_address_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = CB8103890F95891B388D7F9E5FB8E2BA /* resolve_address_custom.h */; }; + 76B0FCBDFFDF0FB57937FB99FF5FED94 /* string_apple.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3CF54DA3A53D783F2B0CB8A100C90B1E /* string_apple.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 76E10E8C41CE4E70AFDAA654405664B7 /* ostringstream.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 7FD55D078350569E123F008748C531D9 /* ostringstream.h */; }; + 76E6447BA790475629A21756DC626A8E /* graphcycles.cc in Sources */ = {isa = PBXBuildFile; fileRef = F81A305F48B90D54EEAC5AD3A6164D9E /* graphcycles.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 76EBA7D7D17A88177A2C7093A93AEA45 /* scheduling_mode.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 6C57F873C20677DBB378816C7DFC14B3 /* scheduling_mode.h */; }; + 76EC596E9B683E465235CF231332EE61 /* b64.h in Headers */ = {isa = PBXBuildFile; fileRef = F69BFBB91D7CF1A9E5B54FEBB922A452 /* b64.h */; }; + 76EEC83F6BB759D8F992C3F37E0AF468 /* descriptor.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 361B5F1184D2461D8A0CE4F6C0620787 /* descriptor.upb.h */; }; + 76F1C91D220C0D89E437519B2499D63B /* client_channel_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = EDFD570883F6D2D879064CDBD947045D /* client_channel_factory.h */; }; + 76F321A06CFDE7C3B088DDEBA1F54201 /* socket_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = C7202C5F56C36FEA4840D0810CFEC451 /* socket_windows.h */; }; + 76F8D3CAF07CB8358D084102E0737355 /* raw_logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6D836625861FE1C9A1C5237A5802F7C3 /* raw_logging.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 77178BAE97776B8EFBC6B8E0E7B1FEE3 /* internal.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = CEDC1AD9FCEC707B36616065392A2C1E /* internal.h */; }; + 771DAD31942F9B8D48B2D04E074E6662 /* pem_pk8.c in Sources */ = {isa = PBXBuildFile; fileRef = C1B7B714FB039D1AA506F7C651DDF88A /* pem_pk8.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 773C184EFA9AA3B16E5927310C46458B /* endpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6DF4B32899D322F74979AD7AD18FAF /* endpoint.h */; }; + 774159CA2CD51A384CF0AA7279C0E1D0 /* rpc_service_method.h in Headers */ = {isa = PBXBuildFile; fileRef = E5C24F3890C4CE6C36359EFEE0F6EB41 /* rpc_service_method.h */; }; + 77432780953794841D94AA937E407F1E /* stacktrace.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55B27282DD7E25E54C56EA43C3EB7C2D /* stacktrace.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 77498D3B4E7E1FDD7377390DE4D23765 /* secure_channel_create.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7137352E69ACBDC06129B37CA23A37CF /* secure_channel_create.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 775D35AA1853BB678AFEEC6A9FBA7DC5 /* engine.c in Sources */ = {isa = PBXBuildFile; fileRef = 85A14766BA2D6B6486854D6FCF02E73A /* engine.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 77712067D7F7A452F0D624836463316E /* frame_settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BDE6E0D386F7AF73EEAC9F7564A8941 /* frame_settings.h */; }; + 7771B3B25EBCF9586FA5E882CA07DA76 /* pid_controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 16EB7C7D422AC2646E0FBC639CB66C91 /* pid_controller.h */; }; + 77759B953AFE970CA646326B11199AF3 /* field_transform.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8885F9F52FB0E7DBAFB11CB199ED9BBA /* field_transform.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 77791977F8BBA7E2C53288CDFBE579D4 /* charconv_parse.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9880A4C51327F557D53BA02E4E2EE559 /* charconv_parse.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 77836C97114A1B13CA411DCAA594858E /* FBLPromise+Validate.h in Headers */ = {isa = PBXBuildFile; fileRef = A086B484D96840E954EB167A0B8532DB /* FBLPromise+Validate.h */; }; + 778EF51D5A94C9E0F69D539E164859ED /* completion_queue_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B7FF7729957306D9027B07B3BD4C7F1F /* completion_queue_factory.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 77A0C1452EBCCCD9E76591B1CA39D0A6 /* child_policy_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5BEA5E74CFEE66ED0688BAD4176E42C9 /* child_policy_handler.h */; }; + 77A8AB0F7B7E55D731487B84AD5E36AB /* create_channel_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = BD53403E4372AE2A9BBA894429AFB48C /* create_channel_impl.h */; }; + 78057BF16E20C9B8A25BF047BEEABB47 /* bad_optional_access.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = 4F9842D7843EDC209B57E48DAF7DFB2A /* bad_optional_access.h */; }; + 782285867FB7980E179FE37933DE7DA0 /* sockaddr_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AD08B5926A35F7E6906761F0DBC47EA /* sockaddr_windows.h */; }; + 783C5E3A897A008584E68508CBCE5F6D /* outlier_detection.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AE2EB7309A8EB284195DA2B8C21DD29 /* outlier_detection.upb.h */; }; + 784114AF143E58D0D4DE7A4428E85953 /* sha.h in Headers */ = {isa = PBXBuildFile; fileRef = C49DD1E3E8979A79261C335076E29E97 /* sha.h */; }; + 7861D2ACC01FB7396F939A9DA0217D0D /* sensitive.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = A60518B5C6AA0D002A4EF00B04C6F16D /* sensitive.upb.h */; }; + 78670CC012C03DC4E0C5204A45EFF71C /* FIRHeartbeatInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A56ACE38A2F08AE312DE31CB0B651EF9 /* FIRHeartbeatInfo.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 786D4012BA7133E75B57ECBE0C89DBD0 /* resize_uninitialized.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 42DE6B8BAA3F2D02FB99B98DC0D836DD /* resize_uninitialized.h */; }; + 788C1CF8BF5E4B69D332578C474AF54F /* message_compress.h in Headers */ = {isa = PBXBuildFile; fileRef = 631429BE71CD6B8B75244E3C2C2B917C /* message_compress.h */; }; + 789D8EE98671E238953EAF8C81A16861 /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 0D13BA5906839D71C59B4B8E2AFFB361 /* route.upb.h */; }; + 78A12EFCE7B3286EE66B56D9BB73845F /* server.h in Headers */ = {isa = PBXBuildFile; fileRef = 86828F9E80D747789AB8A9F20ACCB2D6 /* server.h */; }; + 78B4D11C4ABD87732E2A84F11C754BDE /* map.h in Headers */ = {isa = PBXBuildFile; fileRef = F8A4446542DEEDCDADB62112CC79C290 /* map.h */; }; + 78CF8C2F38DE8A0A2170AE1AC4918767 /* FBLPromise+Catch.m in Sources */ = {isa = PBXBuildFile; fileRef = B45E5F9037A62FCA03DF871EADF52926 /* FBLPromise+Catch.m */; }; + 78ED738F3812C37B13C727BF78A14505 /* bin_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E57016635083DC208B90EC4B2983319D /* bin_encoder.h */; }; + 7904C5E39CE2FA65CCECE1C639E0145A /* a_verify.c in Sources */ = {isa = PBXBuildFile; fileRef = 4F9B0ADF610133D2CEF1CFA4A1562583 /* a_verify.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 791B184390C8384902C82432472ABC12 /* resolve_address_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = B47CA2898B3BAF5F43DA3D92B73A271B /* resolve_address_custom.h */; }; + 792E210DE5BA03C7F98387128FC5A575 /* ossl_typ.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C959F6F19FC96C3E56B0C86325687B0 /* ossl_typ.h */; }; + 792F19ABD6B60473C9A9B13020421873 /* child_policy_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6008611CEF4CB9DBD49DABAD59E11A8E /* child_policy_handler.h */; }; + 7931B3BF2237025942ABF2C491ACD69C /* dynamic_annotations.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = CFA5EB10BD9E4552ECAFEBB2189AD2C2 /* dynamic_annotations.h */; }; + 7937E68FC3FE903C350AC819FD92BF0C /* generic_stub_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D43DD5D3FE562A1974961EC0CBA7708 /* generic_stub_impl.h */; }; + 7943234CC3A53474D035FE2D07D8313E /* stacktrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 8741C6DA08968E7E1200FFE615AE7384 /* stacktrace.h */; }; + 794797FC247FF251F1B6C9497F5799AF /* ssl3.h in Headers */ = {isa = PBXBuildFile; fileRef = 08DCCB69B5BFD3F4C4237AF9FECE56BD /* ssl3.h */; }; + 79570EBD3E061844A2C7F1FF5A110360 /* tls_credentials_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AB22F1F9925C0AA3889BA8A9F88799B /* tls_credentials_options.h */; }; + 795BD48DE6A4E4128EAFE88F3D8D8A5B /* GDTCORTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = 67231506166E828D9E3C83F285AF0629 /* GDTCORTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 795D9D0F787D4F8D330BA161019F24D8 /* ads.upb.h in Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = FF315A587D4F9A607150E883F693B0CE /* ads.upb.h */; }; + 795F7A3F2090AA55DA888DC7AD40CAFC /* timer.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C1BE46C4A61415F111C103DAC90A8336 /* timer.h */; }; + 7963A5EA8C12D00BD23C04E0DE72E313 /* env_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 035B185447B62AA82940A376F12AB1CB /* env_posix.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 79A31B2313A83C08AC0C12AD3B24F9DA /* transport_impl.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = DC4696E577091CD5D56B195286AA6D4D /* transport_impl.h */; }; + 79B782016FCC2DC8D7A97C578F526242 /* x509_r2x.c in Sources */ = {isa = PBXBuildFile; fileRef = CA6A93BE4E01D3F7B894BD2A5342D8C3 /* x509_r2x.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 79C8CCA74F841407EB38F4AC787044F1 /* cpu-aarch64-linux.c in Sources */ = {isa = PBXBuildFile; fileRef = 5430FC95560439093E2D2C2BB90FC129 /* cpu-aarch64-linux.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 79CEB4B011713A51016D5AE06B1335BA /* listener.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 8F1FDB1BA88FC67EF05D1F562910ACEE /* listener.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 79D06FDD64FCE32FA4DD024682FED0D6 /* lb_policy_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = A20021D2FEE0D8C0E30C9EAE7946A61F /* lb_policy_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 79D9D27AB5C35699B34445F6877452D7 /* server_posix.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E2D944E6CD95C567660E31CC2C797A3F /* server_posix.h */; }; + 79FB69BEC7BDD36B9C98E3184598FEA0 /* endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF0D13350F25D402E034AA04E024241 /* endian.h */; }; + 79FE3D77E6A565964709C1FE74311C62 /* unscaledcycleclock.cc in Sources */ = {isa = PBXBuildFile; fileRef = 26B5BB6E5A14137A1DBEB44D55871588 /* unscaledcycleclock.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 7A08CBA8BF5533889C98B4375672C73E /* socket_utils_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 253470E49DDF43BFA861CEA1B9873E55 /* socket_utils_posix.h */; }; + 7A4095E6C49A9A7BFD5ABDFA0CCDAE91 /* hashtablez_sampler_force_weak_definition.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0587424F4164451527E3B56AB37AD4E5 /* hashtablez_sampler_force_weak_definition.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 7A453F7A1FB194F89509E20298B0B2FC /* pretty_function.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 85B7A8746B944A38ED662B6933651D2C /* pretty_function.h */; }; + 7A4DA953FE9B69988C76FBB585E05309 /* security_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F464093E6619365780B739C836CFDFC /* security_handshaker.h */; }; + 7A681D29628B53FE9BABD2DCEFA745A8 /* server_callback_handlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 7867A1BA96A03E8F1C980E2AAEA8393E /* server_callback_handlers.h */; }; + 7A8AA77DAB4FCDE4EA06FE6900FA7023 /* varint.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 92084C2699C4C3F8815767B3E4FE8D62 /* varint.h */; }; + 7A9C006A23C60DC861F4CF673E7B10C0 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 88C2B6303463ECACF12ACE641E759FE6 /* internal.h */; }; + 7A9FE28D2E4E2E7F7A11B8706708AED3 /* windows_logger.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D73A5F99FD2ABE54446CCEC00A50062 /* windows_logger.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 7AA9BF0B384F325FAFAFA0CE1632C88F /* tcp_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 831276D94483FF24EF64BB31C8965B48 /* tcp_posix.h */; }; + 7AD7905C43FD0F238DFA5A00FBB3EF53 /* x509_ext.c in Sources */ = {isa = PBXBuildFile; fileRef = 70F6E27CE4188CBD025613EA7DA63C37 /* x509_ext.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7ADE6DEBDA5FCD21CD3905555F510F3D /* string_windows.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 8397A89A565E7E8601D622B9A7D3B8DA /* string_windows.h */; }; + 7AE04F31C4E9D63E4C8E3012D9EDF35D /* wakeup_fd_pipe.h in Headers */ = {isa = PBXBuildFile; fileRef = 80B9DC6C22839E8DD2A57F8F22A7DE9F /* wakeup_fd_pipe.h */; }; + 7B0CEFF0810203AAA81EC50D0FA45AA1 /* iomgr_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = BD0F49082734818E144B79E58E5697AD /* iomgr_custom.h */; }; + 7B0D8BD74333354BA0FF605D54F86403 /* FIRFirestoreSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 7504352F38E98E6E2DF19B1FBA23AB89 /* FIRFirestoreSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7B13CAF766D6831CE3D4F8C1D13340EE /* version_edit.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7969673FA84BC8675583230DEE78B5B0 /* version_edit.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 7B1A78689801A18C9DEA0EE9A461B13D /* rc4.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 7B4769859D5231F4C0D6C91D8186CEF9 /* rc4.h */; }; + 7B28191262DCA91592B26B098BDDC531 /* ssl_session.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6192ECC540B10D8E39942352FCDEF1CF /* ssl_session.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7B283B2DB19519872A87506066C49BF5 /* grpc_security_constants.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = DA7CC048BEE5432B20FEC4E3308BEEC4 /* grpc_security_constants.h */; }; + 7B3715FA73BCD965659E788321A6FD6E /* host_port.h in Headers */ = {isa = PBXBuildFile; fileRef = 591AE1DA172C6929AB0FBCE60B206124 /* host_port.h */; }; + 7B37E3639971E35A03F1EB655A6F4F6E /* lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 487080C34B2182DC7185465FF17F2546 /* lb_policy.h */; }; + 7B57094FE2296FB90EA0C0D7A440B148 /* load_bundle_task.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2F9AEAE615FC47EAD6B57161EEFCDD14 /* load_bundle_task.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7B702C066D7329BF7930EF7772758442 /* stream_compression_identity.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5034F97F9A2B13E06BE0A669458D2B43 /* stream_compression_identity.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7B75D26AFA68EF5BDAB34DD77CD0BCC3 /* arg.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = 5A6DFE52D3AA115674B62CB17C7F1AA7 /* arg.h */; }; + 7B8A817FEC75159E2922C1BAF99946FF /* threadpool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1224124633512735774FB07FFB34CE4D /* threadpool.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7B9081E6624FF810276F38CB0C3E2C6D /* frame_rst_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = D71F48199E579FC9CBE6062B7E093227 /* frame_rst_stream.h */; }; + 7B92A8FF663CB1FF9839E749A3B86842 /* validate_service_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CFD1651BEC48147949B5B99E1587687 /* validate_service_config.h */; }; + 7BB73755E7DAD61AB52EBEFB863E9900 /* leveldb-library-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 74DA42176BD18BF27A2921B163A95B2F /* leveldb-library-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7BB82F28D08C22A1560D0D9EAB9CA7D6 /* channel_stack_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 882C41FE349F253C9BDC4BAA5D56AA83 /* channel_stack_builder.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7BBE8A596C6B16D1ADCAEC3A60E04A19 /* strip.h in Headers */ = {isa = PBXBuildFile; fileRef = 60DCCD9C129B4D5C465D720C3CB56FC4 /* strip.h */; }; + 7BC0A40B730F24D69AF52D7629253909 /* metadata_array.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8A51EC75B0D406765BE75771944A63CE /* metadata_array.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7BC295F3093115DC17190EE42F782CA2 /* pretty_printing.cc in Sources */ = {isa = PBXBuildFile; fileRef = 32719B7CFC847D795346852B6B72B884 /* pretty_printing.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7BE14F33524867725BA902D698670748 /* xds_channel_secure.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B0753C06F5CC830263CB0E4C0A03085 /* xds_channel_secure.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7BE3AFA018D91229A93C9125EF6F4BF4 /* raw_hash_map.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 9A9B5338171CD061E47F2E361FCE6F29 /* raw_hash_map.h */; }; + 7BE40C374CA5F9283CB269D5BD681B2F /* timer_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F70F679EB641A64E00FE5C7726F8C28 /* timer_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7BEC03739952D637BC4D126C4052DD98 /* local_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5480A47E68C11A33DA5E6CBFC3B84936 /* local_security_connector.h */; }; + 7C0E21259C27050B87C5060D2B09D4F4 /* sockaddr_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CBF1715FA22DDF4859F58983C96BB21 /* sockaddr_custom.h */; }; + 7C0E7B39CD4F0FB2AA124A632D902A7F /* dsa.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 1A6629A5097D67C07858B93A17D9373E /* dsa.h */; }; + 7C0F76A68E1602DFB8351BFCD96A8790 /* simple.c in Sources */ = {isa = PBXBuildFile; fileRef = D7E2556CD95D3FE708E3FC27604B2746 /* simple.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7C31C3FDEFDA6514C502AE1F3009B6BF /* retry_throttle.h in Headers */ = {isa = PBXBuildFile; fileRef = 16A05B65E0D122718E9BA48EDC4EE798 /* retry_throttle.h */; }; + 7C33BF9858FFC1004639F8F57552143C /* FBLPromise+Retry.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 22F00BA2A6D7DC421EE71DB8F625BE28 /* FBLPromise+Retry.h */; }; + 7C8DA8B1FA6B58B6043030F357981DF4 /* workaround_utils.h in Copy src/core/ext/filters/workarounds Private Headers */ = {isa = PBXBuildFile; fileRef = 8C6751218E0A1A314A66BDB34A4449FD /* workaround_utils.h */; }; + 7CA090B6F6B7E8C728E6047DC15BA363 /* x_sig.c in Sources */ = {isa = PBXBuildFile; fileRef = 37440E46D2AC2369BB334D712A3F0604 /* x_sig.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7CA36708287B3F0156CDCEAB7E1A872F /* sync_windows.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = CF9597C496DE5BF09079B3514E56B148 /* sync_windows.h */; }; + 7CBAA033E2063BA8F1912CD5404C60C7 /* context.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA2C9E67C4452AC95FF0E0E799F9D69 /* context.h */; }; + 7CBBE5AAEAF51A504EB4869B2F06111B /* firestore.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6EB606CA34D6F8ECA23EE3CF535BA45E /* firestore.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7CD6CE41BC29F8C24A0E58F259B1583E /* channel_argument_option.cc in Sources */ = {isa = PBXBuildFile; fileRef = 849846AEF2F51C4CB13E792477B368AC /* channel_argument_option.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 7D233A372FA41B9F558FF91ECB03917E /* alarm_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6A5DDFDD593F8C5874769DED9E7E33 /* alarm_impl.h */; }; + 7D241CD0A61B126B9A905A391EEEE799 /* error_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = BA7135395A9444571CCD8E81298A659B /* error_utils.h */; }; + 7D6AA184C3D0E7DBC466CE5E84B00F5F /* FIRComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = DC4B38404A30E1CAFBB8301529C267E3 /* FIRComponentContainer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 7D830CCF7526AE94E31725B11FD9408A /* tcp_server_utils_posix_ifaddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 15E8A4BAE02D2BC08BD3DD07414E69E7 /* tcp_server_utils_posix_ifaddrs.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7D831A9CA1DDE2BE06F0F599DA043960 /* secure_auth_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9C302CB40166ED08DEBFD2CD3F3CB231 /* secure_auth_context.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 7D8B3261A303FCFB76C77B025D6ECCEA /* http.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2830D2781CAA1B007DC5605D679ED3D6 /* http.upb.h */; }; + 7D8DC4AE296D60459E8771995605CDF4 /* resolver_result_parsing.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = CD3955A2D928D5CF136DE430715ABD72 /* resolver_result_parsing.h */; }; + 7DADC36606A4EF3EF54990EFC0F84C15 /* collection_reference.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FDC9D1269710F95D814C073F2E9324D /* collection_reference.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7DBAB98DD76D3ABB57D782A5F9775BB1 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC5AA96F90F0E7EAE181267AF9455AE /* internal.h */; }; + 7DBCEFFC2B8BDE6BE851CF4136216592 /* str_split_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EA4629029ECB44825A5A15440A4E2E8 /* str_split_internal.h */; }; + 7DD4A5C8A169B6F218A534556FBED036 /* firebasecore.nanopb.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BEADCEEB9596C01212F566358BBFD9B /* firebasecore.nanopb.c */; }; + 7DD7FD2E666497AC110504783853912B /* grpc_service.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B55226C83EA202B83BDB45C3DBF7D4C /* grpc_service.upb.h */; }; + 7DE3738B2CFCE84F7E38F96150F1E941 /* internal.h in Copy crypto/fipsmodule/rsa Private Headers */ = {isa = PBXBuildFile; fileRef = 5D1B4DC0068EB1EA0EE1ADB0F32EE0CF /* internal.h */; }; + 7DEA0B313E95AD9D310ED3BBF50E9158 /* fake_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1622DC85A779012D11AEAD69D528003F /* fake_security_connector.h */; }; + 7DFB526FCBCA3CC0607D3959A51305E8 /* notification.h in Headers */ = {isa = PBXBuildFile; fileRef = D427F01390693996D900AA7735DF54DE /* notification.h */; }; + 7E11A11A23412EA42F8F7BD758671EBC /* spinlock.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 058FAB760C94291A6846B1D83C0CFC12 /* spinlock.h */; }; + 7E1736AE692E1BD2704320FDDE61D748 /* global_config_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = E10BAA4C2777BE15FB6BA268E429706B /* global_config_generic.h */; }; + 7E263430E8A0A224302FD5E25FEA21ED /* stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = A01F3D8A406CB451A7FEA08513C4BD92 /* stream.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7E48275F72469B189A17020CDB6181EF /* error_internal.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 039BEA729826C3D85DA222EC6F94975E /* error_internal.h */; }; + 7E7E84EC45C791EF1D268A740AD3D8C5 /* ev_epollex_linux.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = D582928E748E3172B559F84ABAC5F1AB /* ev_epollex_linux.h */; }; + 7E84A20E130C0221AE2DB5912817D511 /* int128_no_intrinsic.inc in Copy numeric Public Headers */ = {isa = PBXBuildFile; fileRef = 8258B53CD53B6F137AAE2FA93E035D01 /* int128_no_intrinsic.inc */; }; + 7E9F9C1B0B39C88E9FAD94DB9507B2EA /* metadata_batch.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A92C5E558F98A6C5A2854E3C2A359BE /* metadata_batch.h */; }; + 7EA17442274F3978CEFFB5BF5F5D4C76 /* FirebaseCore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 15FB5CF44F4EE0EF13E7D237ACDE94CB /* FirebaseCore-dummy.m */; }; + 7EB81D891A48BC3297DF1953A7FC52DC /* lrs.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2945D010CD334A1E33FD25A3BEF30B31 /* lrs.upb.h */; }; + 7EC2FF0097E6368FF1C02D9A8E43B6BC /* route_components.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B8FE9BAC48B868A9C5A01E67633192 /* route_components.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7ECCF4143C773CC1B86CB8F9E27F02EE /* transport_impl.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 82DA192B1B982D663E101F0873EB2796 /* transport_impl.h */; }; + 7EDED6D622C2FF811C3F8ED3712F6F57 /* alts_tsi_handshaker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 35A78741B92DC5A19643DFCFC54E57DB /* alts_tsi_handshaker.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7EEBB82FF414A4D8B4DBEF2E067A299E /* dynamic_annotations.cc in Sources */ = {isa = PBXBuildFile; fileRef = 82A89F71266C2B167BD5E06F28B90A81 /* dynamic_annotations.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 7F0F1C6465BB17DD82E8BDAEE1AC0298 /* key_field_not_in_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = E24E434379208E1B1C3A3F2381668A57 /* key_field_not_in_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7F229B228650BB128131D2DDD72113BE /* listener_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = 2BB4897CA1EA2BA8F99CEDA4B79794BD /* listener_components.upb.h */; }; + 7F3984D3A79EF1ACD90CC178E4B1264B /* eventmanager_libuv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6C18979A49656331100B8E0912781C5B /* eventmanager_libuv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7F4E202CBB71001FDCF2EA64825D68FC /* grpc_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 75F15C23315B1471554D004C10E07F76 /* grpc_stream.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 7F531F3ECEE3045F9E7B6DB5D1CF9053 /* v3_purp.c in Sources */ = {isa = PBXBuildFile; fileRef = D216EA4523D5DEAE1AD0EEFB7D99689B /* v3_purp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7F616AB6EF025EF7A390C13E3D0A7229 /* blocking_counter.h in Copy synchronization Public Headers */ = {isa = PBXBuildFile; fileRef = 51BE2D3DD1DD4E8DD1B5D1DDC0F9F310 /* blocking_counter.h */; }; + 7F6A50AAA31BA15FAB7CCE2ED6AF2776 /* testharness.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A40E153D6CF41878799159B14580A7D /* testharness.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 7F6B98E19B4221BE1C0DEB6D853FD30A /* v3_bcons.c in Sources */ = {isa = PBXBuildFile; fileRef = 417A2789C4F23A37BDCE282162588D44 /* v3_bcons.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 7F9472568941AE2BB4E32EEA9E95D692 /* substitute.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C51F3B802FDFD04AB847340FF10B35 /* substitute.h */; }; + 7F978434DB68DF7255F511B58B7D3346 /* subchannel_pool_interface.cc in Sources */ = {isa = PBXBuildFile; fileRef = 72AB31EBEFFB48DDBB17305B3876E151 /* subchannel_pool_interface.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 7F9BEA2620426788DD90623E8DD9CA5A /* nameser.h in Headers */ = {isa = PBXBuildFile; fileRef = 981429380B759381967B806CAE201AA0 /* nameser.h */; }; + 7FA19CE7638DF8005183C8716F1CE114 /* endpoint.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A24D4743A89B8E7D48AB0715175498 /* endpoint.upb.h */; }; + 7FA3DCDF5A6E4A418EEDFC624DCC9B61 /* async_unary_call.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 87629CC7AB3D5C63FC604777868B6FCE /* async_unary_call.h */; }; + 7FAB086540B2FEAD32D766BA46CAA9F1 /* resource.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 4EA38BA2CF7F0A304CA28CAB63CF71A2 /* resource.upb.h */; }; + 7FABE1E4269B57F5F4E3822D2B222B83 /* local_security_connector.h in Copy src/core/lib/security/security_connector/local Private Headers */ = {isa = PBXBuildFile; fileRef = 5480A47E68C11A33DA5E6CBFC3B84936 /* local_security_connector.h */; }; + 7FC07EE290EFEA60AC9A91BB1A973050 /* pollset_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CC9ED5FA0A7D424B82F27AC70FC8BFE /* pollset_set.h */; }; + 7FEF9AFCA7249277D99F58EDE991EA89 /* chttp2_server.h in Copy src/core/ext/transport/chttp2/server Private Headers */ = {isa = PBXBuildFile; fileRef = 4A479BD75DC8232A10102C9CF863F3B6 /* chttp2_server.h */; }; + 7FEFB1EA4AAFEA5C2C5B8B690BE9A564 /* optimization.h in Headers */ = {isa = PBXBuildFile; fileRef = EA5D594CBBD6AE3388627A89640D5A92 /* optimization.h */; }; + 7FFB051C7CCA6CF297A565BE2ED67502 /* sync_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = E2F4960E27D7001F66FB146918ACB20A /* sync_stream.h */; }; + 8038841973630699710D0CD1F20A6B85 /* lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 6CBFCA714C8EEB4F70F7C99676C4B0B5 /* lb_policy.h */; }; + 80438ABA8BEFA52FAB68FFE568B7BB9F /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = B837CFC74CD4A6D99F897281F8338977 /* hmac.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 804DE05DCEE98DC30D5484762D0DCDE0 /* listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 194809C76D8E87B035E30CEE09C01E08 /* listener.upb.h */; }; + 805E9D0ED63586FF183B421138D1A902 /* mpscq.h in Headers */ = {isa = PBXBuildFile; fileRef = 933637D73C2E0FBF376FDD7CAD50516C /* mpscq.h */; }; + 807B9F5C629BEE0497F8010B07529616 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DC7DB6E71A31FD235556787BA8ADF4E /* UIKit.framework */; }; + 807E0B49D8241EF81D2B4C0F6F71F6FC /* objects.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2409A5B27F02D276DE2D4E8F87D00B1D /* objects.h */; }; + 808526F87D382516DE3A5FFDA1340A3D /* algorithm.h in Copy algorithm Public Headers */ = {isa = PBXBuildFile; fileRef = 42A3491AAFF3AB54FD6B26EFD99BB876 /* algorithm.h */; }; + 809C0AC6FD41B4FE7E2339B5B0FF04F8 /* string_view.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 5DFF21DE94A5E94BB5306A5FE74D66BE /* string_view.h */; }; + 80B27A98FD7D0D803E101E70886B3E38 /* timer_manager.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 9CBB69D578C84B497AB0493D4B6185EB /* timer_manager.h */; }; + 80CA16E063DDA83D4A478183C49FCD17 /* stats_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A00BBB980AE203C34BBF2E75B09A34A /* stats_data.h */; }; + 80D4E44A15D927D97AA981AC59DE71BC /* cfstream_handle.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = A0375C1C408F48911C5A3719BE9D5F2B /* cfstream_handle.h */; }; + 80E2471EFD01E84729AE5A68B1FBF851 /* grpc_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2C11CF3156D9FA43AB2D38C1B2D83A9A /* grpc_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 80F47170A9DFC6F004A2B3006DE0DD99 /* http_connection_manager.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 27C35D8FAFC7B1C25E18F09E32279CB9 /* http_connection_manager.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8102D81FC8DA19A975A05602065A489F /* md4.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6B7D195ACE05E7761FEB1D1D191CEF73 /* md4.h */; }; + 81081A116B0A40B210408B8AE249A053 /* FBLPromise+Wrap.m in Sources */ = {isa = PBXBuildFile; fileRef = 41FB36346D7717A550141E0230ED56AE /* FBLPromise+Wrap.m */; }; + 81159129F30A72565C96DA751ACAA2D5 /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 1298A66348AA9C6483630CDEF02EF11B /* sync.h */; }; + 813EC9A3B04FB93FA1B79172866C7C55 /* tcp_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58CACAF80EED157C4169DE2E44250500 /* tcp_server.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 815424BBAA68E6924AF3430DBA519186 /* byte_stream.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 08673AD396301BB45B9A477046C3BF02 /* byte_stream.h */; }; + 816E6F3EA6A5B297D378060FC3ED3307 /* call.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 81DA4CB165A8EEC88E496A06AC7CB66B /* call.h */; }; + 817ADDDCEFA2B1D3675509237B7CD359 /* http_filters_plugin.cc in Sources */ = {isa = PBXBuildFile; fileRef = 91B819DA7C59D3ADB341E2A09FEC3629 /* http_filters_plugin.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8183E15F9FF1DEC259327135C240D522 /* FBLPromise+Any.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C65B3BC901262AF531DBC49307EFCFD /* FBLPromise+Any.m */; }; + 81B7F828E51BFB425C6FF19101CF3C1C /* ripemd.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A4299A26608CC95F9C409DAE53B183C5 /* ripemd.h */; }; + 81C8E9E14E8194EAAB45D64A2CE4FD0E /* flat_hash_map.h in Copy container Public Headers */ = {isa = PBXBuildFile; fileRef = CDADDF63B94ED816838C92C98FF81B15 /* flat_hash_map.h */; }; + 81DB2523DD33DA94AA1AC0D753CD9F9B /* refcount_lock.c in Sources */ = {isa = PBXBuildFile; fileRef = 00BF389E62959EE7F4358912718FA7C3 /* refcount_lock.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 81FA65F3CEDC4AA2278544569A082409 /* alloc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 52E4F31901D668E026F8F75AEB5FEB08 /* alloc.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 81FE3D3703DDF84A0F82075577B280A3 /* client_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 7266059A56A9BAD00828F12817CFE1A8 /* client_channel.h */; }; + 8216D8A87BBC20216610A43F6F1AEAF2 /* workaround_cronet_compression_filter.h in Copy src/core/ext/filters/workarounds Private Headers */ = {isa = PBXBuildFile; fileRef = D6F4C064A3488B846AECA0EFD4E63363 /* workaround_cronet_compression_filter.h */; }; + 821CE1F118096F0D1BFE755B3ECB661B /* wakeup_fd_nospecial.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7EC7EE331E3AF2872E4A697275BBA7CC /* wakeup_fd_nospecial.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 82639AD149B1E8D9012BA6DB67297D44 /* init.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FF14D280C4F0FA3B55181E7ACB9FF8B /* init.h */; }; + 8263D63D4220C035E39586686374DFB6 /* hmac.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B37E0CF180870E481A1720691A8F3F /* hmac.h */; }; + 8283620C7E8BB4520EB18CD0600E862F /* listener.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C98E238F3BDDE0190425CE3014F5505 /* listener.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 82960E3803016CDBF39E2E560B72FE16 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 48E9690C8ED5EAEB257DB8919A2CE8AF /* internal.h */; }; + 82D7869D31A2E1FD3359AE78D79BEC44 /* cpu-arm-linux.h in Copy crypto Private Headers */ = {isa = PBXBuildFile; fileRef = 1D86999284262D6577D93238FE6260A5 /* cpu-arm-linux.h */; }; + 82D8912D29D9B20901EF1793621B78C8 /* rds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BF261CEDF36ED26D467AD508DD5853E /* rds.upb.h */; }; + 82E3B8449B0796ABC8DB8E69306B3F36 /* ecdh.c in Sources */ = {isa = PBXBuildFile; fileRef = FBFF04262559F8569FCD36F3791128BA /* ecdh.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 82F39B74105E6C6CD12074A1413306B1 /* health_check.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = EBF17CB71417B5B4D8A6ED7BD00FD13F /* health_check.upb.h */; }; + 82F48DE3DF952DF36F0D934B2D2354AE /* document_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6B9FD21E29437B49EFC575D5AA5332FB /* document_set.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 82F4CD96BC7613A38B35650040605A0C /* handshaker_factory.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 7350DC0B08E336D1D3E82BF84F331768 /* handshaker_factory.h */; }; + 830B514153C982E441E261B3065E7A7A /* low_level_alloc.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D14D669FA9F70C2AC3B78DA3D6322BEC /* low_level_alloc.h */; }; + 83134939C4C43DFFD015F17DAC92865C /* waiter.h in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = C0B4CBC2E1E86CE7E8AE79BC48878FA8 /* waiter.h */; }; + 831A506FC16A2FC0EB011599A3D5C381 /* percent_encoding.cc in Sources */ = {isa = PBXBuildFile; fileRef = CA854AE345848AF841C7A0D297C78EEF /* percent_encoding.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8327C3DAE4CD6FFF7290356308D700D1 /* a_time.c in Sources */ = {isa = PBXBuildFile; fileRef = 2911A43369133CA2F34E4EA3EBC8E405 /* a_time.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 83325445B2B8F1EE6392D2C82190C8D4 /* frame_ping.cc in Sources */ = {isa = PBXBuildFile; fileRef = B32672A04A2CE687168D966736235A06 /* frame_ping.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 83361764F77763C5AB76CF45C8CACF4F /* time_zone.h in Headers */ = {isa = PBXBuildFile; fileRef = 181FF250BA35C4FEF7D372ED4506EAE6 /* time_zone.h */; }; + 835D85D268512E4CDA55B619EA5C060C /* mpmcqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7722679195318B384A72A867C5E3EAB0 /* mpmcqueue.h */; }; + 837C320CD695D689793C969146D41E9B /* health.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D410CF41A7E0B4E07C0FD7ACBF5CD79 /* health.upb.h */; }; + 838CD0C38F6C7715021827D2F6ED0763 /* load_balancer_api.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = EA85FCB13A933AE95ACA4A0D34ABD62D /* load_balancer_api.h */; }; + 83936016DCC3DFFB3B1A37FF8ADC2119 /* x509_vpm.c in Sources */ = {isa = PBXBuildFile; fileRef = 09254C0C340E781C6A07F83801A7CF59 /* x509_vpm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 83964B76F23605B845997CFBB9E63FC3 /* cpu-arm-linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D86999284262D6577D93238FE6260A5 /* cpu-arm-linux.h */; }; + 839A03E43A7E7016171A8EC0AB8242F3 /* pkcs7.h in Headers */ = {isa = PBXBuildFile; fileRef = B90B89D30EE6628A3B9CD306B66CBCEB /* pkcs7.h */; }; + 839D107B5F5A21622C1A9E7A26EC3B35 /* polling_entity.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = A0817D26D1636DBA54BA48A57B6E9FC6 /* polling_entity.h */; }; + 83B27496B7BE2FBA09141D6F5C24A551 /* stats.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = 80E662C826D669430F44C6DBB92E8340 /* stats.h */; }; + 83B4C23DF8AD2FEB9B8517712E757801 /* pb_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 8A5F0918CD5C118C2DEA9DD06AAE03B7 /* pb_common.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc -fno-objc-arc"; }; }; + 83D2ADD5AD76075E66F4AF6065AD939F /* message_size_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 32EB43B068040C2D345B6965A4E33D03 /* message_size_filter.h */; }; + 83DCAF700730B0994B2555B2A0B732B0 /* completion_queue_tag.h in Headers */ = {isa = PBXBuildFile; fileRef = EF1CF1358AED46E75D926E03531F42E3 /* completion_queue_tag.h */; }; + 83E64F6850FB08F165971A29CB7B966B /* FBLPromise+Await.h in Headers */ = {isa = PBXBuildFile; fileRef = D089363314634F4CE0918ABB0AD2197B /* FBLPromise+Await.h */; }; + 840CDCE1B9B12F55DEB079D4B07F1B72 /* grpc_service.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 32358534B4C8D3248C3E4FED34D71A64 /* grpc_service.upb.h */; }; + 841B898B0319E60D3AB603DC695F8460 /* iomgr_internal.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 39A5254AF0CAFA22B443D30475E677E8 /* iomgr_internal.h */; }; + 8424B9C2F6E2B39FD877841468E0A70F /* transport.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 20C5D36C79D1BB20457FF8BB2482A275 /* transport.h */; }; + 84291BF1F265D7BF31E616A3A9EAB9C9 /* local_credentials.h in Copy src/core/lib/security/credentials/local Private Headers */ = {isa = PBXBuildFile; fileRef = 3D9DEE9D0A3229B90F0043F9BFF1EB4A /* local_credentials.h */; }; + 843178D297AE8B4B78BA374640F17B5A /* algorithm_metadata.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 585EBA7BE3A68C247364F6F5F9F1AD0B /* algorithm_metadata.h */; }; + 8445F6C7F1559768C62DC4203EF1055A /* port_undef.inc in Headers */ = {isa = PBXBuildFile; fileRef = 7577B5F97ADA05BE37E9E4BA59C7A73B /* port_undef.inc */; }; + 845AD26A0FC068982AE423B002ADD6F5 /* clock.h in Copy time Public Headers */ = {isa = PBXBuildFile; fileRef = 9B7EC5B5404862C8F432F69E173C4393 /* clock.h */; }; + 845CB9575BBC717699D3CEEEBF7E2F44 /* target_id_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = E40F11003B87EA1D8D03A37CB3A53038 /* target_id_generator.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 8467981CC2B3FA884BCA9F3CC837499B /* p256-x86_64.h in Copy crypto/fipsmodule/ec Private Headers */ = {isa = PBXBuildFile; fileRef = C794B0701088F676E57A0A7CBF4989D0 /* p256-x86_64.h */; }; + 8472A82B2C6A4903941D90B4C0EA023D /* sockaddr_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 75CDCBAB55D2D1417B5DDAD3D9886D2D /* sockaddr_posix.h */; }; + 84771602EBCF755960D6FA81BBEFE163 /* pb_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = FB05D36C9EA8B60C967175B8413FAE1D /* pb_encode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + 849E6FC83D5CB6041B5450F14E9E89AD /* converters.mm in Sources */ = {isa = PBXBuildFile; fileRef = D8F792CB523ADA9CAAC0E2139870BA7A /* converters.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 84B09DD3507B1E75C10F3E6F663A458F /* load_balancer.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = ECC8BB2A7BA8DE1189AF125087AFEF54 /* load_balancer.upb.h */; }; + 84C153958402195F0DD146FA4DE9256A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8464DF14361766A9E158A6E361BF2886 /* Security.framework */; }; + 84D0BD8353A8BD1D22B0691153F31E9E /* GULAppEnvironmentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 4855F73788559D7D3856CB64D848269C /* GULAppEnvironmentUtil.m */; }; + 84D3C9D3DAFE523B87352E902A2A5E3A /* deadline_filter.h in Copy src/core/ext/filters/deadline Private Headers */ = {isa = PBXBuildFile; fileRef = 532F31967448B9FCDD457AC17BEAC2BE /* deadline_filter.h */; }; + 84FABE78A74ED3CE8D983A7F66337EFD /* transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 66C61EEA309F1EB978F31EDA3CDEDE16 /* transport_security.h */; }; + 85132ACBB5A38AE0BE8998B2559125A7 /* channel_init.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = E49189552843572545B0263578F0A98A /* channel_init.h */; }; + 852794B7D83E609B23A128EE36E5D781 /* mutex.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6C5BE90EAC6E022526BFABD0B6F3D0CE /* mutex.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 85353E997A8651F2708F037B86BED30A /* FIRLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = AC7D4CB09A76136FE10200C7ABDE8D12 /* FIRLibrary.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 854236C75003F33AE692272656A74D9B /* engine.h in Headers */ = {isa = PBXBuildFile; fileRef = FA2294EED77B3BE132FAF4BB8565B349 /* engine.h */; }; + 85462305C5D1543A3E6677C5D4239838 /* alts_grpc_integrity_only_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 18F1E9F059C0A110CC44A15DF13F9E48 /* alts_grpc_integrity_only_record_protocol.h */; }; + 85A417F742F7784FC353FB9817A80E6F /* google_default_credentials.h in Copy src/core/lib/security/credentials/google_default Private Headers */ = {isa = PBXBuildFile; fileRef = 030013C730D65D48EA49BA6310252C9B /* google_default_credentials.h */; }; + 85DA7F11EB79E0AC0D27B429EFE915D5 /* resolver_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = D2E064930E744AB4F123EAAA3A009D4F /* resolver_registry.h */; }; + 85ED7786B69F1CB1E4219BC515E7DBF0 /* FIRConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E501AABE0F34BBD4BA9A5709A3F2402 /* FIRConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 862D9485F5F7856B8ADA03F959984A67 /* srtp.h in Headers */ = {isa = PBXBuildFile; fileRef = 7665E9702E0012EA9C42C224EADAE12B /* srtp.h */; }; + 86476F1E4CFA1A4D38134E09745E2B7F /* p_ed25519.c in Sources */ = {isa = PBXBuildFile; fileRef = D200A2FA9E31C8BE63F72E2DEE095156 /* p_ed25519.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 86629BC373187727559847C02FE008B7 /* time.h in Copy time Public Headers */ = {isa = PBXBuildFile; fileRef = C88238DAA407FE576B2D439F35479F37 /* time.h */; }; + 86675FEF4DFEFE17B097EAEBD47E2D75 /* status.h in Headers */ = {isa = PBXBuildFile; fileRef = 342E064120BA4D297641CD07E942E3E6 /* status.h */; }; + 867CA2D8FE19D1F13228205A06DA17BB /* tls.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 49FA7F6A73A16F636A0662F53BC1FE52 /* tls.h */; }; + 868EBCC1ED7DD1C1FA4D04CC3873B29C /* GDTCORLifecycle.m in Sources */ = {isa = PBXBuildFile; fileRef = D63AEB66196C962BE4053CD2855D122A /* GDTCORLifecycle.m */; }; + 86A349B377354938FD0844F35A02250E /* FSTUserDataWriter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EB974BBC2DBD8B387CF2D8EBDEACA02 /* FSTUserDataWriter.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 86A7F58700D9A309EAF1B40F4EB990C6 /* http_connection_manager.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 00C8BD1B52446E60AC16BC271D818BEB /* http_connection_manager.upb.h */; }; + 86AD24286DB8DCF7CB44B58507DD80DD /* regex.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = {isa = PBXBuildFile; fileRef = 4F759296B3B0DA0A5116AC02E65CCB7F /* regex.upb.h */; }; + 86B47300A6A7B8BA5DF3040A622FEE8E /* backup_poller.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = F8B83F4A9E5AFB2DACE6E28615F69FFD /* backup_poller.h */; }; + 86BA4D29C608DEC0CE52B00F039D64F0 /* fake_security_connector.h in Copy src/core/lib/security/security_connector/fake Private Headers */ = {isa = PBXBuildFile; fileRef = F833DA52F02D691022D829A74BE58ADE /* fake_security_connector.h */; }; + 86CA837868A38557332E2170D2871960 /* health_check_service_interface_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 70A8C702CF96CC43BC57A68F8C2969FA /* health_check_service_interface_impl.h */; }; + 86D48AD8A31F475BB01590F75751991A /* x509.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 71621132FB49E588ABD9206CE29BA54E /* x509.h */; }; + 86E3B1A0E4DB68608AE9A89D6E3CEEE7 /* spinlock_win32.inc in Headers */ = {isa = PBXBuildFile; fileRef = D5CCEC4ECBC30052D1BDDAA5FAA0D2C4 /* spinlock_win32.inc */; }; + 86E95E3FE44FA0611A9AB7CDF44B3A9A /* ads.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = EEA6677EBD90EEF8BE67C33C69A74973 /* ads.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 86EC583A112429855BA2400212795E85 /* server_credentials_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EF0ABEE4EA5576EC97035233DFE65B3 /* server_credentials_impl.h */; }; + 86EC812FBE9BDC076CFED5535A0BF687 /* FBLPromise+Recover.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BD394E2AA9A6F3C1611A9250512A6320 /* FBLPromise+Recover.h */; }; + 86FFF01BD2A02E0E37BB4788F9AC0FF0 /* optional.h in Headers */ = {isa = PBXBuildFile; fileRef = 96FA9461DDD51A9034CD0339B4C39969 /* optional.h */; }; + 87159C94547F89F1D55067DC06B369F6 /* server_callback_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = ED57B4D5C68FD214EC668808F26E7373 /* server_callback_impl.h */; }; + 87172F84A215E3D6620372B12FDD3C2A /* health_check_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D0068BCA45A5140365FC9EC41498BB74 /* health_check_client.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 87234EA14068845E6EA9D7EB06D3D726 /* GDTCORConsoleLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 242474927BBDB038EE0FF6F4E321FA1B /* GDTCORConsoleLogger.m */; }; + 8730CB03475312D8360AA6D5875AD36D /* annotations.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = EDF5C2B9E092AC473CE996CC5F92F75A /* annotations.upb.h */; }; + 87401E1CE2615731A510BD37BEA29EBB /* posix_logger.h in Headers */ = {isa = PBXBuildFile; fileRef = 392C741810C6A496B45E20AEA0FE691B /* posix_logger.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 8777570CEE1826024C1B05997BF85161 /* iomgr_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = 395FED92263FE00D8C1FECA38029D133 /* iomgr_internal.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 877BDBD2E5D9DFBF072DA7A41B20E29E /* encode.c in Sources */ = {isa = PBXBuildFile; fileRef = BADAD519CFD8E5CEB574659BB63EB6C8 /* encode.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8786B21944FA22DFA3950C4EF284BEDE /* jwt_verifier.cc in Sources */ = {isa = PBXBuildFile; fileRef = E11CB86FB2859C267DA28A96133B576E /* jwt_verifier.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 878BEC82DF1C7FC790979203877D56BB /* time_precise.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 5CBDF21A6B5663334396CACD280FE454 /* time_precise.h */; }; + 878F802E3D05C7644EBF3755C6B355A3 /* rand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F50FB8D47C280191AF4BDC5ACBDC7E0 /* rand.h */; }; + 878F9572C5B8F2488E57BBA7B26884C7 /* channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3E711594F3475539AD1CACDDE4DBC420 /* channel.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 87921881EF0778955C2478E6F8BC55F2 /* bytestring.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 60FD395ACC387DC13902992C7F82FDA0 /* bytestring.h */; }; + 879283A706857D9F5FB7ECBF78C44F47 /* cds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = C9E1D7CB8A6610A6119F02E31452F2A4 /* cds.upb.h */; }; + 87A5155ED03A40CC6700FFECC718E128 /* grpclb.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = D51158DEA1DC70A7141E4DA7BB36FF1C /* grpclb.h */; }; + 87BBAF5F8AA1945A48106BA081E5C591 /* histogram.cc in Sources */ = {isa = PBXBuildFile; fileRef = 995C01AA81C73AACABB486C7669C7F2B /* histogram.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 87C15904F92B614E2A4C84482940A12D /* gogo.upb.h in Copy src/core/ext/upb-generated/gogoproto Private Headers */ = {isa = PBXBuildFile; fileRef = 26EBD07C8C7DAB33CC752704958D1957 /* gogo.upb.h */; }; + 87C7F62844799D35688F90ACA4CB7911 /* workaround_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C6751218E0A1A314A66BDB34A4449FD /* workaround_utils.h */; }; + 87ED57CDA96FE41F30BB47847E4AF89B /* resource_quota.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = F17E4FD2F23A37F6AFA7CAED1D2F6C85 /* resource_quota.h */; }; + 87F9FECA872744C9BF3E2AFA8FD79B09 /* auth_context.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = 444AB9B18BEBE02DA7B5CE51CE888C46 /* auth_context.h */; }; + 8819AD26348A0BFCFC2F5A429363F003 /* core_codegen.h in Copy include/grpcpp/impl/codegen Private Headers */ = {isa = PBXBuildFile; fileRef = 9D5214C90DB7BDE9D0FC93E06B024787 /* core_codegen.h */; }; + 881A159625DB02171EC3451CDBE9412E /* target_authority_table.cc in Sources */ = {isa = PBXBuildFile; fileRef = 087F90E9E7052CA14900AE0BD482FAB0 /* target_authority_table.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 882295C0212C67666C3A757029D3F52D /* grpc_plugin_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = DEBF0F3DBAF13B61A17C043E19188AB5 /* grpc_plugin_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 882D37D1178FC2D4D9AEA0D73FFF4DDF /* channelz.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3FD574DA2FA452870EC12EBE316A0FBC /* channelz.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8843D8D0E3F2AF12409108719A1C5BAE /* byte_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F8DFB761F716328C8EACBF3AD1865B8 /* byte_stream.h */; }; + 885FA21781C9F5A3ABED8175F7CC313F /* retry_throttle.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 16A05B65E0D122718E9BA48EDC4EE798 /* retry_throttle.h */; }; + 8863D664EB760115DC21CBB9535D0905 /* internal.h in Copy crypto/poly1305 Private Headers */ = {isa = PBXBuildFile; fileRef = 824DC6191395B2C833E1B6EBDCEE127A /* internal.h */; }; + 887BE43D1EE1340A9D0A4CA64994CCD2 /* x509_vfy.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1A5CA112680CAD15A50AA9C9C144F5 /* x509_vfy.h */; }; + 8891128EBC0C2749F3DD4D5C0742CAB8 /* barrier.h in Copy synchronization Public Headers */ = {isa = PBXBuildFile; fileRef = C7E75A3C6625795F606173495E322656 /* barrier.h */; }; + 88BBFD74AEE53A5E11CCFD2C0C404AC7 /* ev_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1A25A10DC894BE9B6525486EC902E13C /* ev_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 88C1390C037F5348B264389DDC2435CA /* time.h in Headers */ = {isa = PBXBuildFile; fileRef = 967BEABE5C0BE6793F717C6FDFEBF6B9 /* time.h */; }; + 88CDAFE6B1D69622FDA927D04C6158EC /* workaround_cronet_compression_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 145112654FF4FDFC7090F654F9BD1A78 /* workaround_cronet_compression_filter.h */; }; + 88EAFC2FAFAC5064F872ECA5DA0C11A1 /* tls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 650C424B1A5E114F2995FA11B7295D51 /* tls_method.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 88ED5B35938524A97A8FE2DDB5CF87F7 /* rds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B23B91D857C394AC9B6A46BF51C470A /* rds.upb.h */; }; + 8901FF7008F04D96CC650DF48E55B239 /* hexdump.c in Sources */ = {isa = PBXBuildFile; fileRef = 2F391FE475FAE6B551A62DC96136EFE0 /* hexdump.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 890293D1E2BC67037C7C9965ED8F8A4B /* create_thread_identity.h in Headers */ = {isa = PBXBuildFile; fileRef = 1971FDEC917369CE223266C795BB5777 /* create_thread_identity.h */; }; + 890A54A259EBAB3F39C422630E9E1B67 /* safestack.h in Headers */ = {isa = PBXBuildFile; fileRef = B9DDFD2DB55AACAB93FA58F91DB2B0CA /* safestack.h */; }; + 890FCC458E5573A32A246DBE8D4C59C8 /* route.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 020893C043D192B28524F562B1DE9713 /* route.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 891731C9C792A2E8B8505AC8D6BAB7BD /* internal.h in Copy crypto/x509 Private Headers */ = {isa = PBXBuildFile; fileRef = 807D6B561A3D702B1D4139FF75965BC3 /* internal.h */; }; + 8948B8CE0D43E8F23753C06DBEB896CB /* e_null.c in Sources */ = {isa = PBXBuildFile; fileRef = CA9AB38A79694A5AE631AB1CE594D504 /* e_null.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8950C6F72B96AD744C1A819C88E94BCF /* bits.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = B82A3BF0600ACFBB166AEA37753D9B47 /* bits.h */; }; + 8975166800E5E5C418D61BFE7C07C9DA /* cmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 097F3D8E54B939EEF18E0CCD09DD902B /* cmac.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 89782455D35A1D364D03FD4D9A856E0A /* secure_endpoint.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0AD3B8DE321285EF35E53D057CFBFCCD /* secure_endpoint.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8983032B4CE4C75D23F7579F997023CA /* error_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADA79FF6900CC9538575985CA827E5D /* error_utils.h */; }; + 8985ED9EB17DE568494AD03E0FBB0320 /* ssl_types.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 003E83FF1B679A9B48F56CDA90C03386 /* ssl_types.h */; }; + 89A330F395DE56B07D880CCE1F4A707B /* byte_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 120A7E8EDD868C0D9CAD56A643E7C869 /* byte_buffer.h */; }; + 89BC1A022B65498ACBD444673B096D6C /* v3_skey.c in Sources */ = {isa = PBXBuildFile; fileRef = 5B197D3F3E30BFE2DCA76A1594E9F681 /* v3_skey.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 89DD742A14E783BFCD8E5E100B472BD8 /* ssl_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB4312445B14C11C2146B1478E0E76 /* ssl_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 89EC054EFD5A5BFC3DDA4FBAA6EB7EE7 /* service_type.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = C1CBE59511729F6F65A789D0499AAE62 /* service_type.h */; }; + 89FA07FED2E02EAF12D21AC76F51D2C8 /* cbc.c in Sources */ = {isa = PBXBuildFile; fileRef = AA033B2B30F2E8AC153AEBE867BFF34D /* cbc.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8A0C9F1F11BCF41645B484589E6094F1 /* alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 20DFAB3F1AC251213E4C33910664847F /* alloc.h */; }; + 8A19BBEEE65F3A8204F951B356BECE09 /* GDTCORClock.h in Headers */ = {isa = PBXBuildFile; fileRef = DF9FB01E85F1BB238BFC15F28E9D8967 /* GDTCORClock.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8A4A02B6D00040062BE72C144EC0409F /* pbkdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 781EBAF045EBF2F854241A062EB73645 /* pbkdf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8A52C6482CCD66A25E6A272EF9147E20 /* composite_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0AD2424201A62E5DB79CA3BAB789C27E /* composite_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8A53813F47C8730D092BD57CE65FBD06 /* FirebaseCore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = DF3E6B695BB499315B1092C8C3D75F34 /* FirebaseCore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8A70D88A81DAAF3B23B1AE226DD96D78 /* byte_buffer_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 358D562D0BC9DC87C5EA2ABB31C2BFDB /* byte_buffer_reader.h */; }; + 8A7B5C0D4E47D9A8C691A0CD6B962CD2 /* FIRHeartbeatInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DAFC643797D95E0605BE608B76B2B51 /* FIRHeartbeatInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8A885E1973EFE457338D91AF725C0FF7 /* v3_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 817883CCBF46D67DDF23023B09E8DA08 /* v3_lib.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8AA2FA9C7830044CA55DE441AE0D2FB9 /* authority.h in Copy src/core/ext/transport/chttp2/client Private Headers */ = {isa = PBXBuildFile; fileRef = 1A9167BEC72FAF81F898D49F8EDB5801 /* authority.h */; }; + 8AACDD287CC3F766DDDB771890F3F5BC /* span.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 3D57E2123FA0697547374E39991A2107 /* span.h */; }; + 8AB059B063A5C4D64393AB8DA4FAFBA0 /* checker.h in Headers */ = {isa = PBXBuildFile; fileRef = 435D0F489605EADDCF177F734D741809 /* checker.h */; }; + 8AB3A46E785D9334709026BF3B984D69 /* cds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = C9E1D7CB8A6610A6119F02E31452F2A4 /* cds.upb.h */; }; + 8AB417CC9AE5AD5016BF08FDB6A18AFA /* bin_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = E57016635083DC208B90EC4B2983319D /* bin_encoder.h */; }; + 8AE5A11DD07AF93E22C44A818DFFF09A /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 979966287B4F51FF3C0BA7982BA258F4 /* hash.h */; }; + 8B20DBC75E1D8316BD5D647807465A43 /* sockaddr_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 77167CE9076DE7BD53D1C1499566CBAD /* sockaddr_posix.h */; }; + 8B2B06E8796735E1BE85B0D1F4746DE7 /* cds.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 2C085694E94AAA83168675A0ABB22D77 /* cds.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8B3D3F827FA6A8D5EFDAA8E234EB9639 /* srds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BB180D91ADEB406F8D06B6685881A4F /* srds.upb.h */; }; + 8B4A925E1769F78619E0B1A33720BDAA /* layout.h in Headers */ = {isa = PBXBuildFile; fileRef = EFBD224024BA96E3D699CDEB9DDE6839 /* layout.h */; }; + 8B5F15448F14C2AA418F7C90BFCA31B9 /* completion_queue_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = FA955A6E8F8F84D04CCB4E379AC4BD50 /* completion_queue_impl.h */; }; + 8B623CC78AE8C5229B64BF0A6ECCA6E4 /* blowfish.h in Headers */ = {isa = PBXBuildFile; fileRef = AD596FCBFCD9AB42760D5ECAC6D676B5 /* blowfish.h */; }; + 8B799F58812C178985135F248BD06BCE /* client_channel_channelz.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 6CD7E598A744FDA9FD16EC55E8643D1A /* client_channel_channelz.h */; }; + 8BA0964B6AAFA3126D4D284BEAD752F5 /* pollset_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 99C1768C99CDB3B0B5FAA54D2EA764AB /* pollset_custom.h */; }; + 8BBD54776B92C3026205B30969C272AC /* xds.h in Headers */ = {isa = PBXBuildFile; fileRef = D13B2E5B609C5B5BFBD8010D760DFE5D /* xds.h */; }; + 8BC443D0E242A2D5D42842A466C89F5F /* route_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = {isa = PBXBuildFile; fileRef = A21D417F0FE23EDBD61DA38C26113734 /* route_components.upb.h */; }; + 8BCFB11EE2A2F56B1157486D55F02337 /* endpoint_cfstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED5D8708E746EEAAA8F20FA079BE5B4 /* endpoint_cfstream.h */; }; + 8BD22C584888B6494FB28D00276D368E /* atm_gcc_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = FFC3148D92C5C6899C9E8F04A356808A /* atm_gcc_atomic.h */; }; + 8BEA46A46EF9145AACCA1DB780B4B712 /* exponentiation.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B888E1B9AB8866C4959554B1EFE4D64 /* exponentiation.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8C3E7F4B4350E5965642E5ADA1701F26 /* raw_hash_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 801E5CBA2EEDBB1637FD98EEED2AA2FA /* raw_hash_set.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 8C41D113BF7DBBB5CCB63B31DAAD8BCF /* transport_security_common.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 575051F96A719458A3D42D0FD4564277 /* transport_security_common.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8C5046581E8D8468CA289039E4C5373B /* tcp_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E15F527EEACB19EE41A26F8BCF3B018E /* tcp_windows.h */; }; + 8C5A0DE1C59CB5E13188E48258EA23F0 /* wakeup_fd_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E118DE4D5140F0155C18244BB54563 /* wakeup_fd_posix.h */; }; + 8C69F39C2305212D51A0C0408B0490CA /* callback_common.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685DC734F7751F03784B2EC5868B1 /* callback_common.h */; }; + 8C71790A5C2555FBF164540F5D579031 /* orca_load_report.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = F92F53BEA7101FF595D02B9B1054C9C4 /* orca_load_report.upb.h */; }; + 8C7925B674A2DCBB419B15E629ADA803 /* a_dup.c in Sources */ = {isa = PBXBuildFile; fileRef = 613A9258307623D8B2A315EB50668550 /* a_dup.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8C92E823FDAAD9C6E23609035AD025EA /* frame.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7B5E392FE59043AAD544555ABE745D5E /* frame.h */; }; + 8C96456D15286DA33AF122D8486F38C1 /* atm_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 22057244B276E9DD6EEC01798385A77A /* atm_windows.h */; }; + 8C99BFD79010A387AB1617739EF575CB /* write_batch_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF43BFDCDC776BB52EE90CFA9A9C009 /* write_batch_internal.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 8CA189BFE86AAE0F818917F4FA31D06B /* event_string.cc in Sources */ = {isa = PBXBuildFile; fileRef = B524E63494FE7218A5BC92D6C350F71A /* event_string.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8CA28E093B36BF421131694B55D83587 /* string_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = C3C6821DE3D82C3B325C8667807CA566 /* string_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8CACA5A904DE8DE4BFD9120F953E5956 /* get_current_time_posix.inc in Headers */ = {isa = PBXBuildFile; fileRef = 22677551E226FF49A7D34AF0A337DFBE /* get_current_time_posix.inc */; }; + 8CB92A72B23B9649D6C97A953A3CAF70 /* udp_listener_config.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B6186BFC3B1A865F4340EF47AA6ED804 /* udp_listener_config.upb.h */; }; + 8CC14E90C7C8F0FBC78DDD2A52814286 /* eventmanager_libuv.h in Headers */ = {isa = PBXBuildFile; fileRef = E590D2875C3BC56D26EAF797BC85AD88 /* eventmanager_libuv.h */; }; + 8CD1B6695B6D31D2059E607515A9E39D /* call_log_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8AE634B6B9748B1FA94196BC908BED03 /* call_log_batch.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8CF159333428720D55D8E78ADED04BB7 /* stream_compression_identity.h in Headers */ = {isa = PBXBuildFile; fileRef = F6D33BF02C2D1EC08BF2F70E0BB36A01 /* stream_compression_identity.h */; }; + 8CF6A3F9261BCAAB1B02A8C5976A5296 /* xds_channel_args.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = FC07AFB1A7B3C6E8AD9875D1F744BF03 /* xds_channel_args.h */; }; + 8CFD51F28D964E91B9F8D77C488D0B27 /* x509_vfy.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BE1A5CA112680CAD15A50AA9C9C144F5 /* x509_vfy.h */; }; + 8CFE7CC2D5EBB4946641842DCE8D45CE /* upb.h in Headers */ = {isa = PBXBuildFile; fileRef = D5A6297FA57E7163544C32FD8852C6B3 /* upb.h */; }; + 8D1F2FA9F617B054C0047BA2EA1E300E /* grpc_tls_credentials_options.h in Copy src/core/lib/security/credentials/tls Private Headers */ = {isa = PBXBuildFile; fileRef = 5AB2E69E5DB61D8356BFEA7C7E53BA43 /* grpc_tls_credentials_options.h */; }; + 8D2B776B3B8C9DB0FCF3EC13FBB34C7D /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 824DC6191395B2C833E1B6EBDCEE127A /* internal.h */; }; + 8D65E8F78A006CAF97EA016A3771017B /* fork_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8F634D50652E2BFF3B1482A0B19B47AB /* fork_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8D675C89C8B844914A2F678C18037331 /* connected_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 365FA78B1287711599C9B8AF26FA7F62 /* connected_channel.h */; }; + 8D7F2D7B7516BF8C821A39E3BA329A27 /* status.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 5736CCB1D8190AC29D63010FEED81666 /* status.h */; }; + 8D8EDABA056A7B4CFA2D17A011457374 /* protocol.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = BE185D6B647352A4F9246396D77855D6 /* protocol.upb.h */; }; + 8DB324C42D6A9DD7E3E0945E448C0639 /* tls_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = E264DE7C30F286F5752702492B068487 /* tls_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8DCC4B663022D9EE29B47D7F24874771 /* resolver_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C93E8A83FE787BD7C3CEB208303AED /* resolver_factory.h */; }; + 8DEB5C56530152E9EB1300AD2EA08D47 /* completion_queue_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E947D92741F9D5F54ECF9711B73288A /* completion_queue_factory.h */; }; + 8DEC90432DF6342E742203C5B55FD5DA /* check.c in Sources */ = {isa = PBXBuildFile; fileRef = 80E0C8984F1B7F9983C944D5DFAF80CC /* check.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8DF3999ED9E48D551E17C8DB887C07D5 /* int128_have_intrinsic.inc in Copy numeric Public Headers */ = {isa = PBXBuildFile; fileRef = FF759DBF5FF7A93E89C5041696E05D6D /* int128_have_intrinsic.inc */; }; + 8DF6441B3D3BC7656F81655AC1D0B62C /* log.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = D8AC7E83731928232AE65C64254BC997 /* log.h */; }; + 8E0077B98ECA8EA9797B0FC2F62BB9C1 /* ssl_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = AF01CB3AD0BB7E0A4582EACC66AAF706 /* ssl_security_connector.h */; }; + 8E07212A9C342B1DB8D3321A0FF6A7B5 /* compressed_tuple.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 7C81D2805D217ED5A120F4A8DF0C7155 /* compressed_tuple.h */; }; + 8E1B1A053C5C4D65F90E5493D89E6E68 /* spinlock_wait.cc in Sources */ = {isa = PBXBuildFile; fileRef = A0A9F2BD72E3B373249A267756FCDCC4 /* spinlock_wait.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 8E45DE706ABD841F6E644FA2E82BD69B /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 0235052BB9836B27F86FB4973F07B20E /* parser.h */; }; + 8E5606E266E02E852FC1C0C3B3565AC7 /* pem_oth.c in Sources */ = {isa = PBXBuildFile; fileRef = 98F512C481C464CA50062372843DF7F2 /* pem_oth.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8E63B79CBA87BA9B9D7AE75087771C97 /* GDTCORTransport_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 386BB34824ED1E0EE99659E7D3951FA3 /* GDTCORTransport_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 8E6511AB2B537132C82522135C3BF148 /* sync.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 7814FB0FF75920942E7C1B20879BAFBE /* sync.h */; }; + 8E686CC2D24FBA9A06743D9A0BEAD58C /* xds_api.cc in Sources */ = {isa = PBXBuildFile; fileRef = F0F76938BACAA5E344C6C590CF9E04A2 /* xds_api.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8E70FBD9FFF4A39F5D0297A70A22BB9B /* wakeup_fd_pipe.cc in Sources */ = {isa = PBXBuildFile; fileRef = 25426CD35EF8F8384D3247A3089C1642 /* wakeup_fd_pipe.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 8E9F380133E5AA6CBB86D08C490C996F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + 8EB7926FE394C4ED618999143661453D /* thread_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C82291FEEAA7FF8E6C5EC9B97B0CF94 /* thread_annotations.h */; }; + 8EBBDE4511147F8DB1A372EBD0733940 /* xds_client_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB66564FCB5BC008A67488E854FFC22 /* xds_client_stats.h */; }; + 8EDA42CA377521F2FAFBB831BEBD5E9D /* handshaker_factory.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 45979CB70BBD7D08B85AD8EBF2E94BF7 /* handshaker_factory.h */; }; + 8EE9C82138C2CBEF727A8603D0D98354 /* credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = DB80A2BB852ED1EF4798DC5BCEC10C9E /* credentials.h */; }; + 8EF3BF5F92D9005BE4DEB58776471BFD /* time.h in Headers */ = {isa = PBXBuildFile; fileRef = C88238DAA407FE576B2D439F35479F37 /* time.h */; }; + 8EF7CD29B7CBAF67D49A10ACA053FFDD /* comparison.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0095D0E40BA0950DEE437C7007669E42 /* comparison.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 8EF94178105FF50BE359463B3A27509D /* a_strnid.c in Sources */ = {isa = PBXBuildFile; fileRef = B0C14C713BF221471AEA7527F926779E /* a_strnid.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8EF9C9751407F005091C8854A06E00FE /* interceptor_common.h in Headers */ = {isa = PBXBuildFile; fileRef = C77437A75F722B23647A5CFC01FB6905 /* interceptor_common.h */; }; + 8F20B924D15B7E916C026792393A522D /* extension.cc in Sources */ = {isa = PBXBuildFile; fileRef = DED1C60C95A9B521B0BD4F8EB071DED7 /* extension.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 8F33AACE58A818F8A9BE911F183CB8D1 /* sync_windows.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 0CD52E53F168C7206030912D47CA52C7 /* sync_windows.h */; }; + 8F4B87101F154AAB6EE9B1CD1CB92A78 /* hrss.c in Sources */ = {isa = PBXBuildFile; fileRef = 488C3EC97E91D717507401F44AFA326B /* hrss.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8F586A6306D531E37D2F8D32443F1DCB /* time_zone_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8F6CB7668BBE5735E516AA275AAC13F4 /* time_zone_posix.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 8F7F9794DA030CBA102236C78D30A6D4 /* stacktrace_x86-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 2B2F833A151EE4F80871CAD8924F83CF /* stacktrace_x86-inl.inc */; }; + 8F8B522E543A066C3FD1919EB11E24E1 /* FBLPromise+Reduce.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF22BA39780F38686297704E9D7D2DA /* FBLPromise+Reduce.m */; }; + 8F933D65A5DFC189ADBF5D6426D13757 /* x509spki.c in Sources */ = {isa = PBXBuildFile; fileRef = C6895E29EC353E27DBE7B52C43BE9D25 /* x509spki.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 8FAB2F9A0F4551C88812B9EA4F55D413 /* atomic.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 8545DCD9A87148D45FCF694311196747 /* atomic.h */; }; + 8FBA292DE3B8CD655E6B284B4F73011F /* FIRCoreDiagnosticsConnector.m in Sources */ = {isa = PBXBuildFile; fileRef = F3FDF10D0635517E0F667DCBA8134560 /* FIRCoreDiagnosticsConnector.m */; }; + 8FD03DF0D40FA1230C5A0C74FBA02EE3 /* atm.h in Headers */ = {isa = PBXBuildFile; fileRef = E0A614C75FFADDFB44252D45D892E332 /* atm.h */; }; + 8FD5CEE5C18BE80C30006B3461C6148D /* udp_server.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A21D662F502F91EBB1BD7C4C412ECD /* udp_server.h */; }; + 8FD6DCA65E8727A36D0D0C3D0AF0EECE /* memory_eager_reference_delegate.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95CB84ABE674CCD3BD01515FCB66FB47 /* memory_eager_reference_delegate.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 8FEC00E0549448F9B501BB2ECC4A9CB4 /* FBLPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 352D58AC7499CDFD2FD08B146E797B6F /* FBLPromise.m */; }; + 8FFCBE8B59E67E13E5A9724BC4E1DBC7 /* json_token.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = A0EAC698C4F4564B197311DBE5D5B93F /* json_token.h */; }; + 9013FF5305966CAFFD9E50CBF0863164 /* frame_window_update.h in Headers */ = {isa = PBXBuildFile; fileRef = 96F3D1CA3C848558BEB297E24ABC3B92 /* frame_window_update.h */; }; + 9021F50195173A11B8A64374A557BFBC /* GULKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 64E1D2F02E98FFCD0BF893A3858FF385 /* GULKeychainUtils.m */; }; + 9031FCB217CD0C3492F64A5750E10F63 /* format_request.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = A8B544BF694C29E4C478D06008B63316 /* format_request.h */; }; + 90713B5B159353401E7E80F51907194C /* arg.cc in Sources */ = {isa = PBXBuildFile; fileRef = C4B78A20DAD26B9E8FB2F462145044B5 /* arg.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 909208B455A684F4B5A48B79D63C3FCA /* generated_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F81BD932E7877CF6129978D9768500 /* generated_util.h */; }; + 90AB240A7123E33DBBB9561F04F3C04A /* is_epollexclusive_available.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6BE367AFF2CEE3B3275654AA478CA468 /* is_epollexclusive_available.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 90D12A381194811E3A82D9914B5441D4 /* check_gcp_environment_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5A9D2FD971EA50C4B5B04E83C97609A4 /* check_gcp_environment_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 90D829D9B18CBE9691FC23D2872E1F9D /* GDTCOREvent+GDTCCTSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C75E9F8F29FED1DFA8A55DD8C04464C /* GDTCOREvent+GDTCCTSupport.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 90DB48501A29159B6E49DBFEC710F912 /* semantic_version.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = B3E876E28EDBC4984AF9188899C964E4 /* semantic_version.upb.h */; }; + 90ED66B1BA6EC0B51A57728DE548A83F /* cmac.h in Headers */ = {isa = PBXBuildFile; fileRef = AE7C373BBF03293FB30EDAD11BC6CE5A /* cmac.h */; }; + 90F00511341AF87406E4F9106F521A59 /* timeout_encoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D2391EFEA1878086C6B9C2D265FF4E8 /* timeout_encoding.h */; }; + 9102285EA4365C982758461795FDB103 /* intercepted_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = FB6E28756AF9D5278A5ADB2BA818DD5C /* intercepted_channel.h */; }; + 9104E5EDBB79ABE6EDBFA1ACA772FAD1 /* cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 62CFB0424987A30330ADCB83E81CCCBE /* cache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 91158C155852DB083DEA4BD40AC31A17 /* json_util.h in Copy src/core/lib/security/util Private Headers */ = {isa = PBXBuildFile; fileRef = 6178ED876AA27BB64FEC736A9D17E490 /* json_util.h */; }; + 91259F297C8EDA708C168BF400350BBD /* transport_security_common.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB37BE5B2BFA000FB346F2FCFF797AF /* transport_security_common.upb.h */; }; + 912CC266DE3D414E882B960C4EDD91D9 /* client_interceptor.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 9D147D68F8693EC4F25860C9BEBEA063 /* client_interceptor.h */; }; + 915621C23F82A461EBF5B50E769F8329 /* arena.cc in Sources */ = {isa = PBXBuildFile; fileRef = FB9729F52D2DCA8DFE896C9262B90CA3 /* arena.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 9174BC7B94942B05EEF9FD8B559C0374 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = B85CE4D725A04808B8CCED68C7A34233 /* base64.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 917ED899E79EACF3C864AD3C7410A70F /* direct_mmap.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 12709ACA310AE10CD81CEB0D221D27D4 /* direct_mmap.h */; }; + 9198E41715DF4931DEB898EE4B7697F3 /* generic_stub_impl.h in Copy generic Public Headers */ = {isa = PBXBuildFile; fileRef = 5D43DD5D3FE562A1974961EC0CBA7708 /* generic_stub_impl.h */; }; + 91D389ECA642F0A5E64D68B5CC7AB26F /* gethostname.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B58036161C7A30DF610470F176CC308B /* gethostname.h */; }; + 91E9EBA236870C1577783597FD766991 /* GULKeychainStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = FF2294BB343A82BD43CBF340CC692115 /* GULKeychainStorage.m */; }; + 9216AA5B5A03CB5099DA8F8BB40AD7E0 /* msg.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = DF811445B1994FEC29D209515B12871B /* msg.h */; }; + 92178868825AB8ED6968160489784E21 /* handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = DB01EEADFD8F4283D79402AFDF7526A8 /* handshaker.h */; }; + 9224BCE6BCFB884D235B1534E3E3A407 /* spinlock_akaros.inc in Headers */ = {isa = PBXBuildFile; fileRef = 0D37CFF2BE60C28917E248625DD8CECF /* spinlock_akaros.inc */; }; + 92454B0D21F9ADB4C31ED86AE6172F98 /* call_hook.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 150421C9742BB4F0B119B06D89B0E8E7 /* call_hook.h */; }; + 9277424E703C8B826CB5D8680899E266 /* rc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 3BD5C9FFD3CF5903ACEB28B80FA94E65 /* rc4.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 92840CE0E6A2690E92A7DED012063688 /* gsec.h in Copy src/core/tsi/alts/crypt Private Headers */ = {isa = PBXBuildFile; fileRef = 1107EFDD6A3279A099DDB015C5AB4A4F /* gsec.h */; }; + 92858283215A268C7AEE96C53214DCFD /* metadata.upb.h in Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6D4912D20507EF01C5F95D28A1023B18 /* metadata.upb.h */; }; + 9293A8D28ABB9D2D56EC00863F5D18E1 /* ext_dat.h in Copy crypto/x509v3 Private Headers */ = {isa = PBXBuildFile; fileRef = DB86A54D31A9A3098C237DA9706417D5 /* ext_dat.h */; }; + 92BF864186A0DFE945F62FF56D54DF3C /* sync_stream.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = E2F4960E27D7001F66FB146918ACB20A /* sync_stream.h */; }; + 92C9404841387BD0E2B1F13A11D13B85 /* log_writer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0997C996B2C913C986BAA2835C5C7003 /* log_writer.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 92DB300EFA0F487A1464BEAE7AB6084D /* t_req.c in Sources */ = {isa = PBXBuildFile; fileRef = 8D6B6C481B59F703670039972DB53612 /* t_req.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 92F3CDAC32443EB44374B6B66B9F8F86 /* workaround_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B063DBA267CCBF3589F709A1C0737DC /* workaround_utils.h */; }; + 93120474B4042CEB2D75D5282E57DED4 /* endpoint.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 6EA633D54E25B242F06A1362C952E70D /* endpoint.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9315425EAC7DFB0D9DBD035E999F44A0 /* ofb.c in Sources */ = {isa = PBXBuildFile; fileRef = A6102DCA3C36EB30A53C7CB4F1D02BAF /* ofb.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9320C084C2BD5B294C8BC57C3011434B /* ev_epollex_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9938E14D8183D70AD20895E3EFA1C295 /* ev_epollex_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 932665654244F6BBA7F2448EFA1BE2E0 /* sync_abseil.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 6F144783699836CF4D53EC2EA9790D3A /* sync_abseil.h */; }; + 93289973E35405B67072D9B1253BD230 /* iomgr_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = BCAB9C2B4E6A113E8D6D86D365C32573 /* iomgr_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9328AF7C99BB9E16C01A0B4EA92DC62F /* polling_entity.h in Headers */ = {isa = PBXBuildFile; fileRef = A0817D26D1636DBA54BA48A57B6E9FC6 /* polling_entity.h */; }; + 9330FE111A087B895B028667DB0A4C49 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE79CCAF1AE912E1C941255BBE29708 /* config.h */; }; + 935B2A1C60C4F7973B1024748EBC8D47 /* json_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D524A4B27B0C18EFF8A6A2A0928068 /* json_util.h */; }; + 939B4A2E59C89C2B39B5985195670FDC /* flow_control.h in Headers */ = {isa = PBXBuildFile; fileRef = 3981B5D272FE54939C07182ACD00E735 /* flow_control.h */; }; + 939C5D27D26B0CC7B58C0081B00D55C1 /* completion_queue.h in Headers */ = {isa = PBXBuildFile; fileRef = D350394F4E41E95D5B38E70E61A66088 /* completion_queue.h */; }; + 93A86931DFE114DB62ABF318AC9EC48E /* port_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AA0481E324D7F406F906F0D617C934C /* port_platform.h */; }; + 93AA4F498D9922569D8DE278CC49D2ED /* memory.h in Copy memory Public Headers */ = {isa = PBXBuildFile; fileRef = 4291555008D94A32C804A59C52ED3475 /* memory.h */; }; + 93CB36777A2CC019E1FA757B6F96BC9C /* remote_event.cc in Sources */ = {isa = PBXBuildFile; fileRef = 76271E67B8FBB9EFE56AFAB1625245CC /* remote_event.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 93D844ED4D10107B543B5EB93D9B6716 /* gogo.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = FB4E17CA503AA15A2D1C6290A2B7CE5D /* gogo.upb.h */; }; + 93EDC40D084A9F2BF17A569FF581E598 /* document_change.cc in Sources */ = {isa = PBXBuildFile; fileRef = E2C8DBB1C38D5A3E34F7BEF975CA2E2B /* document_change.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 93F3EA30F197DB12DA07429DB566613F /* tls13_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = E75CCA19A437137880D71AC82C0A0331 /* tls13_client.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 93FBA66E29D44360EB8C8A31B51F9DE4 /* string_view.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = C0FC28EE8D3452EDA699A4B5651A8372 /* string_view.h */; }; + 941B5C1545EEBEF9904B49B3E7DBB223 /* tmpfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 55AA3FA7CCA5A2DD4F2CC561B6CDFD10 /* tmpfile.h */; }; + 941F77F91F52BA847EC84A6A99200F59 /* GDTCOREvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DC4924C9EFB233AC319AC2FD5474F0 /* GDTCOREvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 942767FF21CC62AC1D1866114151923E /* chttp2_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = AD0FADFA76F83284B62934281CC6AC18 /* chttp2_transport.h */; }; + 942EDADBB31372C8A5635233F3A915A7 /* charmap.h in Copy crypto/x509 Private Headers */ = {isa = PBXBuildFile; fileRef = 0DA9DE01C62DC239C2D784F936B2E920 /* charmap.h */; }; + 94385C9D53BDC1998BE2EEB4FB18FE0E /* global_config_env.h in Headers */ = {isa = PBXBuildFile; fileRef = 974D0D539DDB59B539BC1F7F43913A90 /* global_config_env.h */; }; + 9440013326FFA77477CF8D08E09A5326 /* hkdf.c in Sources */ = {isa = PBXBuildFile; fileRef = B142F3998802B0C34B526C0D505C9898 /* hkdf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 944073DDC529FFB0D7CF76952A8EB962 /* debug_location.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C34E45B0FE3B78A67E97766592B8092 /* debug_location.h */; }; + 944A0D981F8D5EF99932F4FE929751AC /* http_connection_manager.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = F722B083D385D1B6922816F230665A9A /* http_connection_manager.upb.h */; }; + 9459E534982C1AFC32FB15BFDC00EE98 /* ref_counted.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CE64CEC1C19AFA412AD194A343E6E18 /* ref_counted.h */; }; + 948C48B301A8B38FD5AA2C7AE9C7A341 /* pollset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1F3CF8E88DD83D2DBE7E06C9DC76EB /* pollset.h */; }; + 94B8758B519C1807153F81F8EBEF5080 /* external_connection_acceptor_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3D1CFAB531E01148681292263B67973F /* external_connection_acceptor_impl.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 94C404F72FB09D41F94D5061847A67ED /* p_x25519.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B83A3D9C9B0C5A54EE3E4C557831D9F /* p_x25519.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 94EB9F8B4FB9805255E08E50916E10A8 /* stream_lists.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7DE1C42CE15129988D16C61CA17BF384 /* stream_lists.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 94F4E242BF1AE9ED7180A4D83B1851A3 /* metadata_map.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 0FE17F5F00A1C87DA3B687F8CD8DE38F /* metadata_map.h */; }; + 94FF73A4307D86DC1B1E52245C6E4624 /* stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 80E662C826D669430F44C6DBB92E8340 /* stats.h */; }; + 95269BB972F32A79B6E9421FEFAD5DCE /* Pods-SaraAttended-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 16E06494239BD92431415BB216E3906D /* Pods-SaraAttended-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9537815D96C614E16750DBD758245F01 /* accesslog.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C4DBDFAA01677E09DE671E3F9C9CAB05 /* accesslog.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 95426F4538F858DEE0633145270871AC /* range.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 28793964619C1F7228788C0B1387513F /* range.upb.h */; }; + 956664D981E2C0622251CC42DEB1C202 /* objects.h in Headers */ = {isa = PBXBuildFile; fileRef = 2409A5B27F02D276DE2D4E8F87D00B1D /* objects.h */; }; + 956672FFF5B6FBB0038CDA29B5E25CE8 /* optional.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = BA6ABD04387D25D5D76CB8B541694A7C /* optional.h */; }; + 956B7BC48FCCF080FFD18DF49176E3F6 /* auth_metadata_processor.h in Headers */ = {isa = PBXBuildFile; fileRef = C29464429CCADC80A3820661FAE5D16E /* auth_metadata_processor.h */; }; + 9577E43CD3177ED20B613C31E625DED5 /* frame_rst_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = D2BEEF4FD18F0E39C9A0892573CB698E /* frame_rst_stream.h */; }; + 957A7EC00A7A7F3C88D40E4B29EFD856 /* call.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE26BC24756397D2051B7CC194EF0D1 /* call.h */; }; + 95BCC22AEE55E9A387D812DEA25D7639 /* alts_grpc_privacy_integrity_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 1F647CDDC588AADF1E6A54C30B1AC6E0 /* alts_grpc_privacy_integrity_record_protocol.h */; }; + 95D26A7F242AE80D7763E4CDEE3C199A /* str_join.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = F742EA742A187ACD17E43DB1B78C5D97 /* str_join.h */; }; + 95D7F62AC1664414A0576E30934F8AED /* delegating_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D7082806BB3DD63DD675328C5BDF865 /* delegating_channel.h */; }; + 95E90CA5BFD51C793118BABEE4DE4B8F /* backend_metric.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = B877A4481E154F4843BE2B7B6BF110DD /* backend_metric.h */; }; + 95EDE65D33C787CA198C355AD36FE0CA /* bn.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BDD36E0AD59593429CEEDA4EA237E1C9 /* bn.h */; }; + 95F11E8CE38A97A070B21E053BEB1AC0 /* bundle_loader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 73C98D4CCFA711E992BFF0C1839A30BF /* bundle_loader.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9603DC0C35DD727DB2880D3AECD91792 /* event_string.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F4076575012C7494D398ABBEC45A18 /* event_string.h */; }; + 960D8D417F0D8D59C5E9065722CCDF95 /* stacktrace_powerpc-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = BC12C02DA0FEBD8871DB81CF851840EF /* stacktrace_powerpc-inl.inc */; }; + 961392D9BA0411C12917ECD4F3C76173 /* FIRTimestamp.h in Headers */ = {isa = PBXBuildFile; fileRef = D5D3E02C653B695422153E0F588F2A3A /* FIRTimestamp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9637A684BC98E4E8248743AF684FD8AA /* bind.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5400FA5634EA7A0E83B7D07CF8CA5C4E /* bind.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 964097C1BB4385D3BCE46648601EC498 /* blinding.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E954268BF933F68C3F91B0409388140 /* blinding.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9641592635D3BC671918D2911F9B0B6D /* lrs.upb.h in Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = C7F493F10F5205AD768A4E37DF5E5A37 /* lrs.upb.h */; }; + 9644C58F468AEA8E097AA8ABFEBE3814 /* channel.h in Headers */ = {isa = PBXBuildFile; fileRef = CB32E308C5968F01A8B4A53F87A867B8 /* channel.h */; }; + 964AEFC16A556324B382B6775C5325ED /* crypto.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BEB75104005D644894B0A870CA28013A /* crypto.h */; }; + 9658CFF05B0D7B010A314ED108545ABF /* semantic_version.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 7F41B21455F534A1E5E49F2F1D820869 /* semantic_version.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 96626D5F879812D38FA300425FEC82BA /* call_op_set_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ED6D2F2644D93740B21482FDB3A7B3 /* call_op_set_interface.h */; }; + 9673B0F5BB2FEF820398DF33FACFA7D3 /* elf_mem_image.cc in Sources */ = {isa = PBXBuildFile; fileRef = B4F6D9254808BDD5802369E8000BBCE0 /* elf_mem_image.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 96A30BA7ED58B7DADA9146575F1569F3 /* altscontext.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 5732F2A90FB96DDE7C876A7831FA6772 /* altscontext.upb.h */; }; + 96B46362F927A3220EEEC6AC57D0C9FC /* transport_security_grpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3035EBD8934F19F344CB2450BB32F009 /* transport_security_grpc.h */; }; + 96C08EAD0DC76A5AAC9C6393297FF81B /* env_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = D9640BAB2CE5E08CA68F04E245F0C7F0 /* env_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 96C61A85F59201C832698246A30F956D /* xds_client_stats.cc in Sources */ = {isa = PBXBuildFile; fileRef = 05FE74B4861BFB87C230C39D0FFAFAC2 /* xds_client_stats.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 96D81DDCA0158A6156C2623E7749A001 /* xds_channel_args.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = CAC79AB1E2662705341C013854CC1683 /* xds_channel_args.h */; }; + 96DE0CDA259638447B1E1B69DAD17D2F /* eventmanager_libuv.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FF01779B0EF8214DF6D4B5F0C4166F0 /* eventmanager_libuv.h */; }; + 96F6BD72A6747555086B147C4E159BAB /* vpm_int.h in Headers */ = {isa = PBXBuildFile; fileRef = D27AE3FF2855764C3712CB4D06D4752D /* vpm_int.h */; }; + 9725861E40D10AEAD868243601EF7CBB /* slice_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B6031C0254744F53D1F7DA8C0FB2D3E /* slice_internal.h */; }; + 9737F3C8143EFFE02FFE5801EEFF117E /* tls_cbc.c in Sources */ = {isa = PBXBuildFile; fileRef = EABE052D4B7270F09C17282EAFB486BF /* tls_cbc.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 973962FE51456A4C04CADFA7161B5C67 /* buffer_list.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3BC4B11148B1D8E6011B1124EEBE2DAE /* buffer_list.h */; }; + 9758540C7A0F9F0636B18A37F4DFFF8F /* charconv_parse.h in Headers */ = {isa = PBXBuildFile; fileRef = 7703E0901E3A8AE85A412693628DCB52 /* charconv_parse.h */; }; + 97839DA32896073B62D7881E27D1EC0D /* health_check.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = F37E2B4B8FC4316895B7F43046408D13 /* health_check.upb.h */; }; + 978B9697CB4F1B23B95F1C0DE92E9CA9 /* alts_iovec_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AD14BFF02BA00FA4B3D8A5B2C96DF10 /* alts_iovec_record_protocol.h */; }; + 978F225AC565026D7496CF1277F37228 /* tsi_error.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB5255D8AAD1A692C837841211057171 /* tsi_error.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 97A1DE9FD29EBFE85CDA7CC917D69633 /* c.cc in Sources */ = {isa = PBXBuildFile; fileRef = DBF76DAC6129166C2DC38CA4C4AFC734 /* c.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 97D4E0C055D74622D013C9B4274BBD37 /* listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B9744E060D64452ED6339052B6AB4D0 /* listener.upb.h */; }; + 97EF3180F1F4711D83ADF1DFEF0F8E6C /* ec_montgomery.c in Sources */ = {isa = PBXBuildFile; fileRef = B6870D211B012015250AB07F1337686E /* ec_montgomery.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 980210C489B57BD51A3193011EE8979F /* civil_time_detail.h in Copy time/internal/cctz/include/cctz Public Headers */ = {isa = PBXBuildFile; fileRef = 8875E9D3E11A77D985AFF88AD7F3E264 /* civil_time_detail.h */; }; + 980819218E74FBD09F16F1C51E5D4F52 /* ssl_transcript.cc in Sources */ = {isa = PBXBuildFile; fileRef = 94E35B5EEC049D9F53D098CB4A231CF7 /* ssl_transcript.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 981B2CDA5073C09ECCE97661F72F94A7 /* type_traits.h in Copy meta Public Headers */ = {isa = PBXBuildFile; fileRef = 2439C8F4E63DBAC7CB1F852ED86C6F3A /* type_traits.h */; }; + 9845C8CB6778EF02175D11B7724621FC /* server_builder_option_impl.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = A4A0AA75430E85336A2C4B36873E0CC3 /* server_builder_option_impl.h */; }; + 984B908DB09526DF30551AE412F874DA /* symbolize_win32.inc in Copy debugging Public Headers */ = {isa = PBXBuildFile; fileRef = CD6064577A74079D5FA2FF512B0DCA65 /* symbolize_win32.inc */; }; + 984CF44642C5130014267D4910983A3F /* struct.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 19E856387C9916C6CB8F132F974B43AD /* struct.upb.h */; }; + 985B13F3CC5EA07698D96DEAF76FF5AA /* merger.h in Headers */ = {isa = PBXBuildFile; fileRef = B3BAA51471AAC8ADC53C24ED0797A1BE /* merger.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 986B83C9A255222BE1AA502F0320D0C9 /* dns_resolver_selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 0105331323361FB6B77031C4D88C0928 /* dns_resolver_selection.h */; }; + 9893FF7EFF2D4847544D3260CB704428 /* document_reference.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7E285DDF18479012AA88E1D105A1CECA /* document_reference.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 98D88B091F827F48FE9A055BF5288272 /* duration.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCF900FF44FCAE833AEE9C6E5CE9212 /* duration.upb.h */; }; + 98DD5C267FD4B1099F279CC6EF0B79A2 /* asn1.h in Headers */ = {isa = PBXBuildFile; fileRef = C8E2BCA63656E9197EE81C9058A4DB6E /* asn1.h */; }; + 98EB62374E81EB9D86DDE343B83BB69B /* server_initializer.h in Headers */ = {isa = PBXBuildFile; fileRef = D806117EF85F98336E70753B24DF7E84 /* server_initializer.h */; }; + 99221F3EE6C31960FCCEA8AA10F4CAA7 /* create_channel_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = CD805EFC5439762E359FE90670D50C81 /* create_channel_internal.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 9924F2D03EE4097DD24F8E707B41FE50 /* listener_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = CDD3D92FD7CCA0707DD1333F8A1B2A44 /* listener_components.upb.h */; }; + 992A1BC2EE0BD266E523F8A79D678025 /* algorithm_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = D86AF0433110A71F87D564547D2A1C44 /* algorithm_metadata.h */; }; + 9969C4B92555CFF28B617ED820CD13C2 /* x_pkey.c in Sources */ = {isa = PBXBuildFile; fileRef = 6A721E00F65B4123EA521950AA41BCFD /* x_pkey.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9977A51A65D50923E64AD5FBD7072255 /* http_uri.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E4D776F4BAFAC065AFBFBFF6EE4B69 /* http_uri.upb.h */; }; + 997BA8B2EF8045C376C1512A8488D0B8 /* proxy_mapper_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AE2B3726976A1847F298F3A3E47041E /* proxy_mapper_registry.h */; }; + 9980AFB73F824A077945D11D58BA0612 /* dtls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = BED497979D5401D5008955BBAC0949D5 /* dtls_record.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9995931809EB93C259AED0F9C431D95A /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7739F4D6C512681D9041B61D69A26EC /* internal.h */; }; + 99A7555222A2FBE1F6F2DED46D9692F1 /* hashtablez_sampler.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 697445CA7A17A5B802C3D19D046B6AB9 /* hashtablez_sampler.h */; }; + 99B321CC5DAFFB0BDB4796D7B900ADF2 /* tcp_server_utils_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 4726FB4D018035E3D0C77A2B382650FC /* tcp_server_utils_posix.h */; }; + 99B5AC7111F2116C8F7359513526C258 /* closure.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E9862CEE92E648371F72C157A5674BC1 /* closure.h */; }; + 99C912E6CD09DE1DB0C0F574C075F7D8 /* codegen_init.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B604EACDD1CC69A4D9074C6B9A40397 /* codegen_init.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 99CB98787F476CCF369D06F131750A8F /* server_initializer.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = D806117EF85F98336E70753B24DF7E84 /* server_initializer.h */; }; + 99E2D403F6C315AF0DB75BA3FBA70951 /* FIRFirestoreSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41EFA1B5BDCCFAEC42437967FE88B641 /* FIRFirestoreSettings.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + 9A070872ECCF2CBA238097C193DB60F9 /* container.h in Copy algorithm Public Headers */ = {isa = PBXBuildFile; fileRef = 93DEB4FAB9AE3DF791E5E7007329BD99 /* container.h */; }; + 9A11C430680411BDA07D5CA9E22722E7 /* x509v3.h in Headers */ = {isa = PBXBuildFile; fileRef = 518BCC9BA5A8A2E47689691FB7BC8DD9 /* x509v3.h */; }; + 9A1231794FA6CFBF24E4B99E8F1703AA /* workaround_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DCCFAA1252D3422682CC0943DE5E997 /* workaround_list.h */; }; + 9A1D08945D01A89C009F7D3A0F52BAAD /* dtls1.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E2836E8E06B07FFD41230B3CE181EF44 /* dtls1.h */; }; + 9A1DC326C463AD9885B3CED70514E9F7 /* common.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5279CA4BEE8BBBFE1C7B8978F678020 /* common.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9A2D6DFA0939B734887C8A93E02D5244 /* container.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DEB4FAB9AE3DF791E5E7007329BD99 /* container.h */; }; + 9A63AC0B9DD330BDC868180BF35A2918 /* deadline_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = D8C942792EEFE63287C868126C41DF44 /* deadline_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9A7CBC19711B9A0B25B1059B613091A1 /* create_channel_internal.h in Copy src/cpp/client Private Headers */ = {isa = PBXBuildFile; fileRef = A8BD8CB1C3DD033EF22C73BBD7F4D064 /* create_channel_internal.h */; }; + 9A884A61F4023708596FC882B8C0B538 /* tcp_client_cfstream.cc in Sources */ = {isa = PBXBuildFile; fileRef = ECC433DC378B7361CECD8969A01BB388 /* tcp_client_cfstream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9A8C67BAF93D0177338F15FA63971C9F /* status_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2834F5A158B47708196C21F2F36C85FA /* status_util.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9AAEB3FB3ACA1F3DA5814744DDCA9A8A /* iocp_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 159E496A001CA8B05902D1308137E6B8 /* iocp_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9ACBCB1679E404B70F7C1701793A9C3F /* tcp_client_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 5C10A22C20AE618E70785E07CFF47B12 /* tcp_client_posix.h */; }; + 9ACD2D9C3493CD2F8ECD395A1538C365 /* mutation_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9D1721FE77FEEE595295694CBBCBF74B /* mutation_batch.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9AF1ECB2D12610A02A755390E8E9925C /* tcp_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = AD3BD3C50585CBAAB39D83E8C3170326 /* tcp_client.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9AF308BA6420FD18699392CBD41600F0 /* call.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = A1C8EAE3AB2E0EF5A563D19724B03017 /* call.h */; }; + 9B11DFB0D4A3F77889B9CCC5CF8D0ADF /* empty.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 442BEF46A4CE4B98E1864CF664B03C6A /* empty.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9B198BE05DE08B9C1A0A8E221A462C22 /* call_test_only.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = D3A883C23B120624F2B440E7EC31025E /* call_test_only.h */; }; + 9B1B16E1FA136BE6AF7C2BD29ABF9138 /* object_value.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8C7FBB93F710929F2C6A73568B22F2EF /* object_value.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9B2EF54C6F76117B58473A040CAD0CEA /* completion_queue_factory.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 3E947D92741F9D5F54ECF9711B73288A /* completion_queue_factory.h */; }; + 9B4029D08418A0057949F9EB5048AC16 /* FBLPromise+Do.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 78B799C5CD60EF0F2A8DAD61EDD7C304 /* FBLPromise+Do.h */; }; + 9B6D455CB721AFC103706FB48034BB05 /* spinlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 058FAB760C94291A6846B1D83C0CFC12 /* spinlock.h */; }; + 9B8FB44EB7009C1AF89DE2E652683CCE /* str_join.h in Headers */ = {isa = PBXBuildFile; fileRef = F742EA742A187ACD17E43DB1B78C5D97 /* str_join.h */; }; + 9B944A4B3454F7CB5D6DC09890EA42DE /* json_util.h in Copy src/core/lib/security/util Private Headers */ = {isa = PBXBuildFile; fileRef = 13D524A4B27B0C18EFF8A6A2A0928068 /* json_util.h */; }; + 9BA670F9C3CEAE9DB82C8FF162182610 /* arena.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = BED200068BA15F70BDAF41898196F81E /* arena.h */; }; + 9BACE85B158AC35F4C280D3892D29D0F /* circuit_breaker.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = A8B3B2F75C9E79B4CCC58B400E7EA868 /* circuit_breaker.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9BCB69DDD8A4A6ACB6A3D9671C6C890C /* encode.h in Headers */ = {isa = PBXBuildFile; fileRef = 01A752FC79D38A266A296BBC11BEF111 /* encode.h */; }; + 9C218BCC54C748D4027B2DC07B290AD9 /* delete_mutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = D452A8A5ECDB46D31F082F2462A97C24 /* delete_mutation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9C262047738ADDD23D7F24D751384E9E /* cert.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */ = {isa = PBXBuildFile; fileRef = DC38E35A4C8A73FD7F3F2376D18987B8 /* cert.upb.h */; }; + 9C4BF1F1164B181AABADF9D4D607D19C /* global_subchannel_pool.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6302406E4AA0DF6A3C104B521ECBE9 /* global_subchannel_pool.h */; }; + 9C51A4A296C8708FCD3158BDCC9E0DC7 /* internal.h in Copy crypto/hrss Private Headers */ = {isa = PBXBuildFile; fileRef = C2EBEFC627CDE60001FD058D2F266910 /* internal.h */; }; + 9C806ACE4025B850ECDB5001F1EBD039 /* pollset_set_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 2355BC31601975D8B7E534B0E0A2E34D /* pollset_set_custom.h */; }; + 9CACAAF898783512E40AABE798F03116 /* refcount_c11.c in Sources */ = {isa = PBXBuildFile; fileRef = 654B3EA2BD33E3C5ADF4476821507BF5 /* refcount_c11.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9CB496F0C9EF55228C501EC317543624 /* chttp2_server.h in Copy src/core/ext/transport/chttp2/server Private Headers */ = {isa = PBXBuildFile; fileRef = 1356E5C2283E0942CFDFBE52BA0942DC /* chttp2_server.h */; }; + 9CBF2F3080A3472AE90493C0C66B6DB8 /* load_reporting.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 80C720B0399FCC99B19B600E3D4E3241 /* load_reporting.h */; }; + 9CD1A004A89311DD69C33F35672101A9 /* key_wrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EA211AB1988BC9248B4ED12A148C236 /* key_wrap.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9CE42A3091834AF9DB986D70DD837E74 /* avl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB1A769C688D0A641D42290CEEB1C7 /* avl.h */; }; + 9CEBE4757E1D5CE0093F5D6263688300 /* tcp_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 1723A5C0C342EAA87D9AE85B9140E563 /* tcp_windows.h */; }; + 9D0601F98F1D9D836CED379B923B1BB4 /* escaping.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3792BA295EEB300CB0C045634F2BAA3C /* escaping.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + 9D08855113683F0D451CFADFCEEC2841 /* precondition.cc in Sources */ = {isa = PBXBuildFile; fileRef = EAC15DDD03A481ED76F0B1C19121212B /* precondition.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9D13A748E2AC0C11C572A6DCBA7BED5B /* status_errno.cc in Sources */ = {isa = PBXBuildFile; fileRef = DEBC07CB023FC32266244E76712EFECD /* status_errno.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9D16F36663EA4DB28DCE5A13FBA5A84E /* transport_op_string.cc in Sources */ = {isa = PBXBuildFile; fileRef = 958EE32A1236AB1C0679007C61ECD4F2 /* transport_op_string.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9D2D04C5127FB77DA8FEF0CE7C74A5D8 /* resolve_address.h in Headers */ = {isa = PBXBuildFile; fileRef = EEB3759F7A0F39B804221B3B53DDA1EB /* resolve_address.h */; }; + 9D35828A938445AB90952F8C03FD2CD3 /* snapshots_in_sync_listener_registration.cc in Sources */ = {isa = PBXBuildFile; fileRef = 73B72E8ECBDB34D712E9FB17A84D12D6 /* snapshots_in_sync_listener_registration.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + 9D4F0668E943584DF1EEC6E1A1949B02 /* useful.h in Headers */ = {isa = PBXBuildFile; fileRef = F7F17B070E00266DCEC517C3123F5F75 /* useful.h */; }; + 9D5034969CFA9C13ADEAE7343B517445 /* slice_string_helpers.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 0B6C0C7BACF09F445535CE0F6C779143 /* slice_string_helpers.h */; }; + 9D5CC99A6F129DA248DB408E2250C008 /* FIRCoreDiagnosticsConnector.h in Headers */ = {isa = PBXBuildFile; fileRef = 02A356512AC6468A0C53864D1C9ACD6E /* FIRCoreDiagnosticsConnector.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 9D60AF1AD29B1D1D3C20BADF1BE89987 /* load_system_roots_fallback.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70876681E2EBC6E4AAD038C2CB0075BB /* load_system_roots_fallback.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9D626AD6B3CF74FF200CB6D8D122FE31 /* frame_window_update.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 96F3D1CA3C848558BEB297E24ABC3B92 /* frame_window_update.h */; }; + 9D6DB1BF916428E04308B56EA43413E3 /* stl_type_traits.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 4AB52674FB7A979DD7A36DE61C1031E8 /* stl_type_traits.h */; }; + 9D7987629AB6F8E26D84029C38329FB1 /* ssl3.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 08DCCB69B5BFD3F4C4237AF9FECE56BD /* ssl3.h */; }; + 9D7FA83F5FA60EE75D63F9F31BF9C25E /* spinlock_linux.inc in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = ACA63BF9403CDBAAB57966A713249632 /* spinlock_linux.inc */; }; + 9D82B104810B0DC769E782F28CEA68CE /* a_mbstr.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A3BC1CF9DBF45DB55787D9AF672FBF4 /* a_mbstr.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9D8EABA44C53596EF2E9817DABF7DE2F /* transport_security_common_api.h in Headers */ = {isa = PBXBuildFile; fileRef = CEFB3F5141D9519858DD21AD7B723BD7 /* transport_security_common_api.h */; }; + 9D962512A37339E1BD8661EDE31CB6CE /* x_name.c in Sources */ = {isa = PBXBuildFile; fileRef = B72ABDC2AF0BBFF6ED51215689DBE3DC /* x_name.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9D9D848CBDFBD20B8B2DD4D4EEBAE3CE /* outlier_detection.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = 3FF6EA6F5C09355903F15F5CDF0EB9EC /* outlier_detection.upb.h */; }; + 9DAB26504A7E3B1D23EE2D9CF998F645 /* tls_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 438CC79580532F080A206E81530D5748 /* tls_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9DC014446B5D9A27CBC277F15951987B /* protocol.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 04488BCA843893FBC5E90E958DA72828 /* protocol.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9DC31B9AAA672963E3DA73615321C145 /* transport_security_common.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = 7BB37BE5B2BFA000FB346F2FCFF797AF /* transport_security_common.upb.h */; }; + 9DCCEE5611AE2687C0A531DFBEE99909 /* sign.c in Sources */ = {isa = PBXBuildFile; fileRef = 4F8D6D110F13BC605F984AB7CD8D06FD /* sign.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9DD34D25B9E0C20DCA319A5AC3FF7A47 /* grpclb_channel.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = 536FAD0A306763D48380064D60D93127 /* grpclb_channel.h */; }; + 9DE112AD5CC1021A246253FAC0AF5916 /* tls_pthread.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 6E7C388295F481B616CD42572BF9649B /* tls_pthread.h */; }; + 9E01ADB76AE9D8D7670AADCDB0B42093 /* evp.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA9B0F489506D839E54613F8FF2A6A2 /* evp.h */; }; + 9E0CBC37EB69854310CD953CF2F6FF34 /* timestamp.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A2A2100C6EA9BD8D2E78ADAC0E1EC844 /* timestamp.upb.h */; }; + 9E28CBA3A3803CDE67BBB52DB843F9CC /* context_list.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01AA09207ED07385DCBF635BAFA70C38 /* context_list.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9E51078BC7824642DE572567034D4242 /* error_cfstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EF0EA5F6C234102A14DDF0969DE4782 /* error_cfstream.h */; }; + 9E5B63753A9C600FB1DFC6EA791034CF /* arena.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = ABAD5CF3B2F079651491304D130C2FEE /* arena.h */; }; + 9E986B8E822054F73B397C270C56A268 /* create_channel_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = E5B869C89802921B22497BEF5788A0BE /* create_channel_posix.h */; }; + 9E9DCBC6A3B827376DB665AC99A3E004 /* alts_tsi_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 9019873A1D8506818A39F7F4AF4BD0AD /* alts_tsi_utils.h */; }; + 9E9E0308DED7093A463F96B6428230AC /* port_undef.inc in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 7577B5F97ADA05BE37E9E4BA59C7A73B /* port_undef.inc */; }; + 9EA91D04C876A4FAD92BD4CAFA9BD37A /* type_check.h in Headers */ = {isa = PBXBuildFile; fileRef = 29B00A4F43EA93179CD4C8102ECB5083 /* type_check.h */; }; + 9EB153DB632DD0858AF30AC38FDD99AE /* string_ref.cc in Sources */ = {isa = PBXBuildFile; fileRef = 545D5F31F3173DFD099A6DF4F5F8A71D /* string_ref.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + 9EB4B5935BB67B317AF04772719B1C72 /* env_posix_test_helper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F31BD1CE7C0CE2046B3695252F4CED7 /* env_posix_test_helper.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 9EDB4CB7AA46C68CDE3D1938CD34C1B2 /* crypto.c in Sources */ = {isa = PBXBuildFile; fileRef = 1B7D1949E7E90565475A743D32EE903B /* crypto.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9EEFA072A2C57AE9AAF5F09F77A7DD51 /* basic_timers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6A39D41DEDC8F04603A76EA46AA2AC37 /* basic_timers.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9F168EAF01A1FFA4828B63E04E43055F /* health.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 77F988063E3B618B1E15A040CC1935DB /* health.upb.h */; }; + 9F17DDB685A7F7F8C322C2C9360BD654 /* thread_pool_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F18534FF4B75EC164C841BA60034DB3 /* thread_pool_interface.h */; }; + 9F27152F49F1FCD8F8403EFC663AB56E /* async_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C20E5941418C595010D3682C18A08A3 /* async_stream_impl.h */; }; + 9F3B02538FDAF06962E3BF3BF4B20EBD /* create_channel_posix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3DCF24D3613D03CA60B425BFE16B9E /* create_channel_posix_impl.h */; }; + 9F5A357513A95419A8FC2620531D4963 /* arena.cc in Sources */ = {isa = PBXBuildFile; fileRef = 66AC3F8AD68A10DA9F61CEB020C00256 /* arena.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9F6C3DEC2FB722DADF397CB5552FB9FB /* sysinfo.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 10F7D921AD7838C910160A14EC5F5641 /* sysinfo.h */; }; + 9F738A4E3E402D5CD508F68E8AA14058 /* curve25519_64.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = 49CCF8A64C5BDB15A5BF1062196A5959 /* curve25519_64.h */; }; + 9F7951804CE4A7F75178C54A8CEE47BE /* tcp_client_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 92325F123C739CEFD8A33700FCFFE023 /* tcp_client_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + 9F7A41B749D69FD1C13DC0D1F63CCB71 /* internal.h in Copy crypto/err Private Headers */ = {isa = PBXBuildFile; fileRef = 2C19FA528F4AA9BB34521DF059BE8F87 /* internal.h */; }; + 9F7D3AD42AD18E279C92D7CDA8A67F78 /* migrate.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 87111EA4F321503D9A46A671CA8D5A34 /* migrate.upb.h */; }; + 9F7EDB276DD9FCFE5715DFFDDC8CBD79 /* v3_sxnet.c in Sources */ = {isa = PBXBuildFile; fileRef = 391691F3034C5352842FE2708CA898F0 /* v3_sxnet.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9FC7DBD410B743BC667A2CCE3ADE1D33 /* tls.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FA7F6A73A16F636A0662F53BC1FE52 /* tls.h */; }; + 9FE491959099C23A5EDD409369BE4A62 /* e_aesgcmsiv.c in Sources */ = {isa = PBXBuildFile; fileRef = 269E3AD42CD40C891900549025DFC7A0 /* e_aesgcmsiv.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + 9FE759F69402B199AF7856AD67EE7DA0 /* server_interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = B968209A67B472D066E21374175A4133 /* server_interceptor.h */; }; + 9FF533F857E2D63B5ED67DA9A58658AA /* internal_errqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC82E00BF2CA5BAAD779E044347C73FA /* internal_errqueue.h */; }; + A02305729A85B2A010CBB4C4B81E0139 /* slice_weak_hash_table.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = C736C7F24FA06CEC8120148702B9593B /* slice_weak_hash_table.h */; }; + A024FFD9354E06825CE855527D8CA4C6 /* config_source.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = D76149D5B3D2748BD77035C8553FB63A /* config_source.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A04720F99FD823FE1A4176403975CB35 /* async_unary_call_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 8EB60C1294724FDC2B764EB7D5C88B93 /* async_unary_call_impl.h */; }; + A04D28CBE9365E12424E70B06FFB98FA /* arena.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 4A3899B023FABB06DCC73CC4AD4F4605 /* arena.h */; }; + A0637DF3999A681E5C8C545B9DB55305 /* time_zone_lookup.cc in Sources */ = {isa = PBXBuildFile; fileRef = 19DDEFE91BF33977306BFC06B66E0BD8 /* time_zone_lookup.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + A0780AE2D9172447C32C67C0619B5E8F /* client_channel_channelz.cc in Sources */ = {isa = PBXBuildFile; fileRef = 69327BD8613EE4C447F311D3C38EC636 /* client_channel_channelz.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A09A4D0D4E3807017A9559C189E428B5 /* writing.cc in Sources */ = {isa = PBXBuildFile; fileRef = 35A8779C3484072854FA5E517B30AB0A /* writing.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A09C28FD23BC7864E5485F35F5930C84 /* grpc_alts_credentials_client_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A449B0A5202F58351E26952D3A60310 /* grpc_alts_credentials_client_options.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A0AD95B4C0A043EB3A5AF9CF27338CEC /* fake_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FFDDB0D890246CB3926154DCADDC6F1 /* fake_credentials.h */; }; + A0AE37464A38C462512704F4213CD1EB /* frame_rst_stream.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = D71F48199E579FC9CBE6062B7E093227 /* frame_rst_stream.h */; }; + A0DDAB34A86FBAA5321F6528F0E7119A /* ref_counted_ptr.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 7E91272A9A7BE8B8CBBCD7314930800E /* ref_counted_ptr.h */; }; + A0F103BB787DF38D91029CAF0274CCFF /* sha.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C49DD1E3E8979A79261C335076E29E97 /* sha.h */; }; + A145BCF82CBC5EAE105FF57993F6CDCC /* status_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 922330D32B27D4FB78D2F47F9D40BB84 /* status_metadata.h */; }; + A16CD6A1DB24FCD290A8B4A13C8848AA /* create_channel_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = A8BD8CB1C3DD033EF22C73BBD7F4D064 /* create_channel_internal.h */; }; + A175C92E5C00EF7C3AE35569E4DFD110 /* status_conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = CC536920ACC3ACAC107C84AD1D25B15B /* status_conversion.h */; }; + A176E9EF9ACB8F5E424B2CBA7A01DCF3 /* FBLPromise+Then.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C7AD1CB86D9A9880C6B6C26A5250ED61 /* FBLPromise+Then.h */; }; + A1845563EE89C360885E3B085EE68C2F /* asn1_locl.h in Copy crypto/asn1 Private Headers */ = {isa = PBXBuildFile; fileRef = B90753262908732447133E9EB7EA9133 /* asn1_locl.h */; }; + A1951648D836A760AF3A8A178E29CBFA /* stream_map.h in Headers */ = {isa = PBXBuildFile; fileRef = B5930E543F0DA06668114E5617874688 /* stream_map.h */; }; + A1C7FE0D5CBEB16975A7DC07B8A51141 /* metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BCBBF4B51DF8811C70E4A89B8051019 /* metadata.h */; }; + A1CA0EE5B501E717794DB0AF4D63BBEA /* GULHeartbeatDateStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = E23BBB6D4C3974CEC17F6B23291C1C51 /* GULHeartbeatDateStorage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A1CCD34536E2FBA141073A9E38AB9E8F /* x_req.c in Sources */ = {isa = PBXBuildFile; fileRef = 5CEE2544EAD92C850522C322F37533C1 /* x_req.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A1CEADE0F53D4C0B0C704AA7A33A7157 /* sync_stream_impl.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 583465E0891F13EE0E35B79A88B240F0 /* sync_stream_impl.h */; }; + A1CFD72C18E9B442B493DCEF16926BD5 /* address.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 49E63A1B0B7D97A30E89DE05BB773936 /* address.upb.h */; }; + A1D6EED5E2FADBE233B53E2BB13BD934 /* api_listener.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = B85686523B51ED1B96C574E89BE80623 /* api_listener.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A1DB1FE9E91DB572C297F18C7320E3B2 /* pollset_set_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 2355BC31601975D8B7E534B0E0A2E34D /* pollset_set_custom.h */; }; + A1EA633D564CD9551616C8809751913E /* rsaz_exp.h in Copy crypto/fipsmodule/bn Private Headers */ = {isa = PBXBuildFile; fileRef = 0049238C3E9AAC3BC661E86C89A71143 /* rsaz_exp.h */; }; + A2069FF0999574B023799AE18C497207 /* rsa_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 81DB1ADA388DC2C495267B1FADF5CBB0 /* rsa_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A20C4F254E4A1F2E1C2DB81C6A8E1245 /* buffer_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BC4B11148B1D8E6011B1124EEBE2DAE /* buffer_list.h */; }; + A214BAFEE84BB169583CF632B1E01408 /* google_default_credentials.h in Copy src/core/lib/security/credentials/google_default Private Headers */ = {isa = PBXBuildFile; fileRef = E72F4419733B8C21D797E9E594B8A977 /* google_default_credentials.h */; }; + A21C51BE52920BE55BCC74A8AA3ED08B /* rc4.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B4769859D5231F4C0D6C91D8186CEF9 /* rc4.h */; }; + A228CFC25986E6280752899CE5576803 /* pollset_set_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C2FBD16FAA0916679B9E24DC144CF4 /* pollset_set_custom.h */; }; + A22B0885DA117F5D5871760581964530 /* connectivity_state.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B0E5B3C7D3A20D188AD4592B218893B /* connectivity_state.h */; }; + A25DD73493DDB97C7C299D9A5071E809 /* server_callback.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6CFF5FC83A9D4BA6332523FD9DC0B8C0 /* server_callback.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + A26884140B84CE8A359B65FEAF5CDBC3 /* ref_counted_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E91272A9A7BE8B8CBBCD7314930800E /* ref_counted_ptr.h */; }; + A27306BE312587964511BA132E2CF165 /* fake_credentials.h in Copy src/core/lib/security/credentials/fake Private Headers */ = {isa = PBXBuildFile; fileRef = 4FFDDB0D890246CB3926154DCADDC6F1 /* fake_credentials.h */; }; + A2903D2427D46D9D6E1EC338986FAE7B /* e_aesctrhmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 98C1ABA8FF18B7C09F06BAC17BBC2B2A /* e_aesctrhmac.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A2CB8EDDE43C025F74BE8D7AF11093A0 /* mutex_nonprod.inc in Headers */ = {isa = PBXBuildFile; fileRef = 05BBF7398C7A402D224160BB799B4E5B /* mutex_nonprod.inc */; }; + A2CC9EDA9F65BE305AC403A035E0D199 /* http_connect_handshaker.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 19DE7AEA92884D5BCBC9C064503A29D4 /* http_connect_handshaker.h */; }; + A2DF0EB878E976E203DC757B4A9803E9 /* socket_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C7202C5F56C36FEA4840D0810CFEC451 /* socket_windows.h */; }; + A2E75A713EBE8407DF099D95880B1E88 /* frame.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = E529C5C7EE13336B343F49BB289452D1 /* frame.h */; }; + A2F4550688158E705E714FB9A19F01F0 /* endpoint_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 387F772EEEAFE9929148A598D14E6E96 /* endpoint_components.upb.h */; }; + A2F7451403C38B516E29F2CF005B9B59 /* http_server_filter.h in Copy src/core/ext/filters/http/server Private Headers */ = {isa = PBXBuildFile; fileRef = 7D4BEF4E82F2C880C20B283963A36281 /* http_server_filter.h */; }; + A303E8BC7C47CD1A356FBDD71B97C388 /* ssl_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 2CEAEB7D39DF0455F6BBB6B997BFF411 /* ssl_transport_security.h */; }; + A31E5DF9327CA03E8B6B8B1CD47A9638 /* core_codegen_interface.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = ECA59ED6E17663C92621418F953576A3 /* core_codegen_interface.h */; }; + A33D49BC7E9BDF93FF4BDA7B85E206A2 /* FBLPromise+Await.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D089363314634F4CE0918ABB0AD2197B /* FBLPromise+Await.h */; }; + A3414C7E61885609CB1D91DB206BD4BB /* alts_counter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13A7018941419937399FAD63543E6F1F /* alts_counter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A34DADCDE669EBEDD7B8BADD21942D28 /* ec_key.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF5062BDF551F333806FBA6E0156D7A /* ec_key.h */; }; + A376EEDE01608D31C3DAF7A677C9C095 /* interceptor.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 01E9E32DCC2758F4DD9AF31F20C36D25 /* interceptor.h */; }; + A37B97ED54EF5E827628CB0C9AD1EE25 /* health_check_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A5ED8B90D19F65FB85B63F6A3ED587 /* health_check_client.h */; }; + A37F77981D233062240A592988FD2E28 /* grpc_ares_wrapper_fallback.cc in Sources */ = {isa = PBXBuildFile; fileRef = 75372A0EF1BBDA166E71C7F6E233BC97 /* grpc_ares_wrapper_fallback.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A38799C9C602780D5688EFDA8BFDAE9A /* x509_def.c in Sources */ = {isa = PBXBuildFile; fileRef = C26CB30253C7D28ED95B593D2D9F6B3E /* x509_def.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A3938F6C97BF2E6BC921848799B63A0E /* resolve_address_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = C8BE8279B6758E926B4976ACD4AFEFB4 /* resolve_address_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A393F63500CF7937E668E9165A72A119 /* transport_security_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EC874E822AEF71603431310B98615A7 /* transport_security_interface.h */; }; + A3A7D864E7B1AF378F3BAFD742FA5963 /* http_server_filter.h in Copy src/core/ext/filters/http/server Private Headers */ = {isa = PBXBuildFile; fileRef = F32757B213FB20E73CCC0158CCFD6F3B /* http_server_filter.h */; }; + A3AC5C15AA7D379DF97A66EC0EFFB8F9 /* tasn_typ.c in Sources */ = {isa = PBXBuildFile; fileRef = 47459DDBD455E8EDC36BF6BE1A3096AF /* tasn_typ.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A3B7F6D26A4214A30FFB58EC8F6831BF /* validate.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = D16EF3C7A3BD592538B774DCF57A8809 /* validate.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A3C469861409F838EF3D75376BE65F8B /* GULLoggerLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = FFE2AFFC9EBC1677F5EFE4FC4BAC583C /* GULLoggerLevel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3C98E2884A1E1204666487DAC0A3A83 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6899F70129CBD04132766D607E5F51F4 /* internal.h */; }; + A3D3AA057C55889DA2C4EAE98AEC96B9 /* common.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 9778EE1B2F9B8EF00AF2A8AFEFD2188F /* common.h */; }; + A3D9412DFF56CDDC237EB5CE61039D03 /* transaction.cc in Sources */ = {isa = PBXBuildFile; fileRef = 67459D488E0930C75534A13CE44A611A /* transaction.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + A3DCD5A999BDED75E240BE7125585B8B /* alarm.h in Headers */ = {isa = PBXBuildFile; fileRef = F366375B86B3AC902A44764DD321B8F5 /* alarm.h */; }; + A3E3B1FFB514D4781DF29282C94C9D87 /* ascii.cc in Sources */ = {isa = PBXBuildFile; fileRef = 07070DB1C41C0C5E166E3BEF6412D271 /* ascii.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + A3EE0B88B2083331B0D97727A03749E0 /* useful.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4438A2B9802CC7625F45E0908E6C21 /* useful.h */; }; + A3FD4D7DE00E573CF87C6EB735A70312 /* xds_api.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 92244E328E16F05C5111104617F374D6 /* xds_api.h */; }; + A3FE1A2092B82B83C9D03CC16418067C /* base.h in Headers */ = {isa = PBXBuildFile; fileRef = ED016E10EA5F97BF30488BAC657CF05D /* base.h */; }; + A404C43912D660E62C39687DC73AAF16 /* udp_listener_config.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = B6186BFC3B1A865F4340EF47AA6ED804 /* udp_listener_config.upb.h */; }; + A41D59186DE28F986014080E9C9D423D /* handshaker.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = A056D6984CC86A443DF3C5AC42C7471B /* handshaker.upb.h */; }; + A44D17B24551623C3787C162DCA8C9AC /* zone_info_source.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ECD6207B8EAA5C8AAC66053669DF5C6 /* zone_info_source.h */; }; + A45246B72D10DBE1292605BE0618FF52 /* xds_bootstrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 66E80990B7602DE869237F057B85CB28 /* xds_bootstrap.h */; }; + A46690D86F61AA0966AE818D4BB3BE93 /* a_d2i_fp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7F14E9F77AAA2F88330E0F2606B3603B /* a_d2i_fp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A469DE9F0A8CD766926B97BD593C2DE3 /* handshaker_registry.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 3486899FD16BD9A45BCB1987AB4B2F84 /* handshaker_registry.h */; }; + A4867C7DFD8486B4D650E39B07D69AF2 /* protocol.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 10F4E2752364C3220503CC5F3C48DF8A /* protocol.upb.h */; }; + A4A2A96CB4624CAD1344EA36D8C4F788 /* pollset_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = AF4A0F5FF115B44C14F7017B9C059C2D /* pollset_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A4B73DAAB12E4A7FACA7CBD446F4DDB2 /* async_generic_service.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = C453377C6E38701BE8795477EAE77A8A /* async_generic_service.h */; }; + A4BF6EC41FE34788456228DCD22937AC /* migrate.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 842F145C13D43826889D805C80496C5B /* migrate.upb.h */; }; + A4CB8C7FDB3A5F424A29CC93A06A214B /* lrs.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = C7F493F10F5205AD768A4E37DF5E5A37 /* lrs.upb.h */; }; + A4D55297E0B040C51313DED8F67F63F3 /* gsec.cc in Sources */ = {isa = PBXBuildFile; fileRef = EED52649B8D265AA1260608D8313C339 /* gsec.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A5080CCFD8B0513CF45C90F2323A8468 /* alts_frame_protector.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A37C441D777E90C6764BF3834EA1B75 /* alts_frame_protector.h */; }; + A509864E4B7D9F866F0C91C38DE99359 /* gRPC-C++-gRPCCertificates-Cpp in Resources */ = {isa = PBXBuildFile; fileRef = 9C7C87B5D0A6752AFA2642F1BCA967A3 /* gRPC-C++-gRPCCertificates-Cpp */; }; + A542C9D69A6C9C40B2C2AB271B7830CD /* http2_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = D98715D72C5137C628810E8610CF3585 /* http2_settings.h */; }; + A54F0EFAC59616BD2D5782986A116C4C /* load_system_roots_linux.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = EE6DA62E3D3C94FE5C42637D38DB195B /* load_system_roots_linux.h */; }; + A55891CC4CD04AE9274BC76FE43F9485 /* table_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0DBFD9D17999435BA54AA000357CF297 /* table_cache.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + A565C0269D0DA5B6C63308B1E40D2667 /* cfstream_handle.h in Headers */ = {isa = PBXBuildFile; fileRef = 48F9284EBAC70D1E68FE63520EFE0BC9 /* cfstream_handle.h */; }; + A5788AD55987231D69C39AD3EFEA8397 /* pcy_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 494466C1F3B2173F87F7A06D335021FC /* pcy_lib.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A59624D7B5BE71D34E7C894E0C9577E9 /* init.h in Headers */ = {isa = PBXBuildFile; fileRef = FDC6A78A78235B12BDDBE2CCB0CCF495 /* init.h */; }; + A59AFBE2663F16D8CD4C3E16ACAEF72C /* GDTCCTCompressionHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 621BBE4CD378521268FD1056F97AB8DB /* GDTCCTCompressionHelper.m */; }; + A59CBB29C79DFD20EB8832A2C68FA92C /* timer_manager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CBB69D578C84B497AB0493D4B6185EB /* timer_manager.h */; }; + A59F1FAB240B5B3DC286CECEABE8FE59 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 807D6B561A3D702B1D4139FF75965BC3 /* internal.h */; }; + A5BB64F6AEB2702BAAC7BBC7E3DC91F5 /* GDTCORFlatFileStorage+Promises.h in Headers */ = {isa = PBXBuildFile; fileRef = F42293DFD17E3B5421CB37A555B6C0FD /* GDTCORFlatFileStorage+Promises.h */; settings = {ATTRIBUTES = (Project, ); }; }; + A5C4F7A1F517A6C0BA757AB513EC0E16 /* internal.h in Copy crypto/fipsmodule/tls Private Headers */ = {isa = PBXBuildFile; fileRef = A26EF50458271CA82806498A1533BF93 /* internal.h */; }; + A5EAF29C197C8BE81771D04356D9B8F9 /* http.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */ = {isa = PBXBuildFile; fileRef = 2830D2781CAA1B007DC5605D679ED3D6 /* http.upb.h */; }; + A5EF7044FE8AC32B181DD927F1DCFD61 /* method_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = A67BB7E59B0B6A837B089F22CA423BED /* method_handler.h */; }; + A5FDA17F5755AB30B98666C09FC998C7 /* alts_handshaker_client.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = C1A700116171DB2AAD92182ED70C2F4B /* alts_handshaker_client.h */; }; + A60F6A08A0761F16945A9CE40B17F895 /* datastore.cc in Sources */ = {isa = PBXBuildFile; fileRef = 47F316ABC8B1138CEC418AAF6E53652F /* datastore.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + A6149282C5F2EC4DE49553861E8DFCCB /* delocate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B169F793DB8E2AB80E258594851EB38 /* delocate.h */; }; + A6202075D6EED51116A533536F47E62F /* grpc_alts_credentials_options.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 6BDAB9FA4CD49F8B5ED138AB95764BF7 /* grpc_alts_credentials_options.h */; }; + A62221ADE491570F4A70E2CE15C81F79 /* params.c in Sources */ = {isa = PBXBuildFile; fileRef = 964790B67114ECDCDA22E8BBFA1755B9 /* params.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A65160293DF727E46FF5A5FAE7CB9ADF /* chttp2_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 635CDD0C54FA76F8CB9052C2E7156F50 /* chttp2_connector.h */; }; + A670BA6550A05C603C07E20189C3F8E5 /* rpc_method.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 48C0BC392FFF6685F862551F33F6D994 /* rpc_method.h */; }; + A67897C447F4E21A5835D88A4D0C57F4 /* base.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = ED016E10EA5F97BF30488BAC657CF05D /* base.h */; }; + A6C89C7E358F1720AACDAAA6F3575DB4 /* hpack_table.cc in Sources */ = {isa = PBXBuildFile; fileRef = 237CE43F630563858D827DB55EACF44A /* hpack_table.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A6F74815F394675CBC04417CA69061E5 /* variant.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8E4DD22025DFEB1D8911FBAF47F6E2 /* variant.h */; }; + A7028C087A209500B08830CFBCEBA46B /* output.cc in Sources */ = {isa = PBXBuildFile; fileRef = 437BBB331542A87EA663492AADD4352A /* output.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + A7417FCC5EE7CBA1C7FD4EF268549C62 /* message_compress.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 9C417DDF359FFC9262AD9A311ECFFB65 /* message_compress.h */; }; + A747D686E8FE87AA75FA0108E5CA40EC /* ssl_utils.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 84E4957692C9D0E838B00A0F2D9C6327 /* ssl_utils.h */; }; + A74CA8CE8240D48E0AC6BB80062AB238 /* alts_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 989C399F3BCDD02547BB58C53307D5A8 /* alts_security_connector.h */; }; + A76A97B92E178EFA4CC10F487C9E23C3 /* err.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = DD0EAF650079CBA4866283FA3ACAE404 /* err.h */; }; + A770353462B32567438987F447F2686D /* FIRCoreDiagnosticsConnector.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FD6DDDB94DDFDFE7FEA3A4AE283F1AE /* FIRCoreDiagnosticsConnector.h */; settings = {ATTRIBUTES = (Project, ); }; }; + A77AEC43F8303646AF5DA18A1C766F96 /* conf.c in Sources */ = {isa = PBXBuildFile; fileRef = 166601B1F74E89BE8E2BB88DECF1CF50 /* conf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A77F67FC9B32A5F7DD355FCD586B435B /* windows.c in Sources */ = {isa = PBXBuildFile; fileRef = E741729D5D64FB7C626170E7F325544E /* windows.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A78E7E9825ACBCC18CFA8B8B6DD6F1AA /* curve25519_tables.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = 0618EF3D922942AB0599F423215BB750 /* curve25519_tables.h */; }; + A796C289087E6EE83DD1FF8CD541F00B /* time_zone.h in Copy time/internal/cctz/include/cctz Public Headers */ = {isa = PBXBuildFile; fileRef = 181FF250BA35C4FEF7D372ED4506EAE6 /* time_zone.h */; }; + A7F9365A291CBB16B3C688C4DA3ED962 /* status.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 85A207A4B852EADD49DBB92DA94DC3A4 /* status.h */; }; + A81A300F9BFD0B4015B70C5B18C95B40 /* backend_metric.cc in Sources */ = {isa = PBXBuildFile; fileRef = 49E11B75F61BF294392D1DF088D66C4A /* backend_metric.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A824D6850CCD3F6DC0DD4DDBA8A61D0E /* gogo.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 26EBD07C8C7DAB33CC752704958D1957 /* gogo.upb.h */; }; + A82CA960DDEB95DF478CBE6EC88FC1EE /* transport_security_interface.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 6EC874E822AEF71603431310B98615A7 /* transport_security_interface.h */; }; + A82F508DB78506ADDA3BE72E413F56A5 /* bundle.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = EE192DB052B79D11AE6E23BB68E44EAE /* bundle.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + A8373269860F7D096D1DE8DE4FDA4D52 /* casts.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AEDDB7052DD395CD4E4EBFCC0DED63A /* casts.h */; }; + A85931B668910DF38AF20E2A7EE823C4 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = B2A24D4743A89B8E7D48AB0715175498 /* endpoint.upb.h */; }; + A868284C0520F4383369E05A594CFBD2 /* async_generic_service.h in Headers */ = {isa = PBXBuildFile; fileRef = 78B26E2E34B7A494C881016636BAFBBB /* async_generic_service.h */; }; + A86B6B55660FE0311A771754157930FD /* t_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D1F68BB0400FBA570B96E7B5D2F60BF /* t_x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A888400E0737C7E82E6794F86EB3882D /* deadline_filter.h in Copy src/core/ext/filters/deadline Private Headers */ = {isa = PBXBuildFile; fileRef = 6B3264F286DBC219137465BA6C19CB09 /* deadline_filter.h */; }; + A8A0BA51D350A4542F2DF685E4281D12 /* resolver_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D45ED61830C467AC4B5009EF5DC7CE /* resolver_registry.h */; }; + A8C56C952BDD1E697952B8EC3F2D03C9 /* slice_weak_hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = C736C7F24FA06CEC8120148702B9593B /* slice_weak_hash_table.h */; }; + A8C8BAFD7926EEFA72C5F96C25CED1ED /* credentials_impl.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = A4B54D6420B3444FCD5BE511FE112605 /* credentials_impl.h */; }; + A8D8745CEB36629ECC608D89AEFFF39F /* const_amd64.h in Copy ssl/test/runner/curve25519 Private Headers */ = {isa = PBXBuildFile; fileRef = 11AB1B2817C84F8D1973E8D153CFBC4B /* const_amd64.h */; }; + A8DF437ABFDF2BAC2DC53F239E424FB3 /* health_check_service_interface_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 70A8C702CF96CC43BC57A68F8C2969FA /* health_check_service_interface_impl.h */; }; + A8EFA566925C2C0A8C45337ABD04EC86 /* time_zone_impl.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = 017527197F417982A48F54CAB5BE1B53 /* time_zone_impl.h */; }; + A8F9BA477B422BA12CF6F72347C776DC /* x_x509a.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F51EEAF8CD8D8FFA3580AD750842C63 /* x_x509a.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A8FBA8EC13A01A6202D527B10FF6D257 /* closure.h in Headers */ = {isa = PBXBuildFile; fileRef = E9862CEE92E648371F72C157A5674BC1 /* closure.h */; }; + A92494DF24C57E942D7B5EB1AAD01891 /* time_zone_libc.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E47917B5D3B3625D08295A98F25F54 /* time_zone_libc.h */; }; + A93203F9550A9BCDFA2C5C6F83CB947C /* server_context_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = D99D47646D47CE546DF15348736C4E82 /* server_context_impl.h */; }; + A9373B2CD36A7B0B3240FEB77CAE0271 /* struct.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2546A47F0D4FEDE7194ABB6CCC8598C4 /* struct.upb.h */; }; + A97F89DA5274564992615CE6EA8DC32A /* t_crl.c in Sources */ = {isa = PBXBuildFile; fileRef = 57B4458BF9F1A2D02C13CADB33FD9FA2 /* t_crl.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A986CCAB3A6C6BAE110289528B55C6A7 /* tmpfile_msys.cc in Sources */ = {isa = PBXBuildFile; fileRef = 68602F7A47AE03E2D11F7E68E863CD60 /* tmpfile_msys.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A987DE2A6B1C1411B3B69400DE82239E /* compression_args.h in Headers */ = {isa = PBXBuildFile; fileRef = 957DC20A7FA2E082E900F1EE47BFAF05 /* compression_args.h */; }; + A99FB1CB42C49C3A3F4CCCFECEC033F4 /* sockaddr_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B2E1730F19E4224F23FD1F6E112A7A47 /* sockaddr_custom.h */; }; + A9AF1EDAB79400DDF0A45E8E96103748 /* hash.cc in Sources */ = {isa = PBXBuildFile; fileRef = 72CA26BF0546AD4251A47A38F0C1E193 /* hash.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + A9B2E36FEC5C65AAD663B83C33DBBB9D /* internal_errqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B6D0B6124F9D512DADEE6AAEA03DE4B /* internal_errqueue.h */; }; + A9B312799C6A8782413F1B4CFA6B8855 /* transport_security_grpc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549A0A129267757E88C3B9BBF72B3891 /* transport_security_grpc.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + A9D15141ADC2B3535C6F645AA3EF4D10 /* document.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = D04606BC88251771AD750CFAD3476CD6 /* document.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + A9E82DF719E7B17BA827ECE610EC7FDE /* bad_optional_access.cc in Sources */ = {isa = PBXBuildFile; fileRef = 17936BFECBE0CC394E15286D54BFA158 /* bad_optional_access.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + A9E90E794BE93D00F8BBB01B7E3718C9 /* v3_akeya.c in Sources */ = {isa = PBXBuildFile; fileRef = E75A1198CC49C1D9DAB88863F0BEC9F7 /* v3_akeya.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + A9F109BE41A5B079040474297E8EC80C /* http.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A2B7AAF021624A3B2FB10C87EB67EA7 /* http.upb.h */; }; + A9F57814ED806A1EC6DE1CEFF5249594 /* accesslog.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = E60B72EF39955A076FC093D4B48EA276 /* accesslog.upb.h */; }; + AA08A9AB279A6A3108EDBC9B91058F69 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F60E11FD666EBB2FB74FA667AAB716F1 /* internal.h */; }; + AA0FF04FA55C40AAF75E3BB0B6FBCD12 /* asn1_mac.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D6EF0BB4DA976434B6D51415B2012DC2 /* asn1_mac.h */; }; + AA1AF46D61C6CD51CAE37A5556FC09D2 /* sync_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CD52E53F168C7206030912D47CA52C7 /* sync_windows.h */; }; + AA1D2CD2F75F2536D990D2BBD5F5CE5E /* FIRFirebaseUserAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F469255EB9E102CEA1699F96F7D4EA /* FIRFirebaseUserAgent.m */; }; + AA32115DA4784A4C897DF7D358EB34EA /* wakeup_fd_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 795ADF04F4AA6A250594D93F8C5C77FE /* wakeup_fd_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AA34920FB2991CCE2F05BDD6E779B5F3 /* pollset_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 35C49FAEB23BB437B37D5073B9CA45CC /* pollset_custom.h */; }; + AA4696767AB9EF840BBBB606899449E7 /* srds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 8BB180D91ADEB406F8D06B6685881A4F /* srds.upb.h */; }; + AA65EFA1C7D0646CC8B5C1855039B605 /* v3_cpols.c in Sources */ = {isa = PBXBuildFile; fileRef = A68AF0A8082B9569E0D7B07B411E00EF /* v3_cpols.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AA712B985515C10710F6D7E4F867936A /* periodic_sampler.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 2AF41BCD737855422A8E60BDEBFEB02C /* periodic_sampler.h */; }; + AA72ECD54FF2A35D0E0186BB7B9799F1 /* e_rc2.c in Sources */ = {isa = PBXBuildFile; fileRef = E66A5423448C896D6AFCFD5C09748865 /* e_rc2.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AA7805D99825192E1DA629813D05BB55 /* pollset_set_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6A7D16A01E330E3D7859D2C1E6143F /* pollset_set_windows.h */; }; + AA7968C29BB06A431C2C99F2CF7B3D8D /* map.h in Headers */ = {isa = PBXBuildFile; fileRef = 3ACDAA76599D5B821934B1EBF93B36C8 /* map.h */; }; + AA820769DAF72F4BE0A07BA7385F417A /* per_thread_sem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C29C9928D15DDD75348B863CB3438B9 /* per_thread_sem.h */; }; + AA9875D0C0767A5C9A3716D2E64C944A /* escaping.h in Headers */ = {isa = PBXBuildFile; fileRef = 5837FC87F631F4B0B42612D6362B36BF /* escaping.h */; }; + AAACE3DA6DDAB0E1040EE9952CDEF2A7 /* dbformat.cc in Sources */ = {isa = PBXBuildFile; fileRef = ADF34D14D6CD78F4F7FD92EC0A9BD0D8 /* dbformat.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + AAB44C55CBC839C9B3F3FE80051C1CA8 /* filter_block.cc in Sources */ = {isa = PBXBuildFile; fileRef = BC461799E3B8B280DFD5984271BE0BFA /* filter_block.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + AAB495582AF5CCDE619476CDFFCE5FBB /* incoming_metadata.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7D2D7144CD2FBB31B0573D211A5F8DE0 /* incoming_metadata.h */; }; + AABAD661B1743224CD2DD305C824AACA /* grpclb_channel_secure.cc in Sources */ = {isa = PBXBuildFile; fileRef = C722FD41DE216F5E42D8B5B0BA8A2170 /* grpclb_channel_secure.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AAD7618C95102F7F1671FA16DC6ACDD7 /* obj_dat.h in Copy crypto/obj Private Headers */ = {isa = PBXBuildFile; fileRef = 0E7D461A18D00764A5DACAF2D942F288 /* obj_dat.h */; }; + AAE2FD9FEE26965A7AD53F4B25D631FF /* murmur_hash.h in Headers */ = {isa = PBXBuildFile; fileRef = D8CEBD833D04172DEE7C52ECEC2DBAF0 /* murmur_hash.h */; }; + AAE4CBA456354BBAEF323C3C1392ADBE /* atm_gcc_sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FE860E0897B1CF3E4D5D13932205702 /* atm_gcc_sync.h */; }; + AAE6F35392FEFFF2F556BEDE615EB37F /* create_auth_context.h in Headers */ = {isa = PBXBuildFile; fileRef = C376CA4ADCF65A427E0495534EEA6ACD /* create_auth_context.h */; }; + AAF9CB996E85E66761768F209693DBFB /* atm_gcc_sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 45F3712FB4F0F778F038527E8B3E7D76 /* atm_gcc_sync.h */; }; + AB061F8725C93B0027A3F8C135A9E11F /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F581468D54E778E32D3BDA3B68F82D5 /* utf8.h */; }; + AB13218AF2826B524A6A177DE7BC541C /* ev_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 32296CC35C4C6686456F9FB7699236B4 /* ev_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AB13340138B97CF56707F7C264D13A3C /* is_epollexclusive_available.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 5AE4EBC6D1F8771BEAAD41C611E60245 /* is_epollexclusive_available.h */; }; + AB1A4BD57805F97D6377356446B968A2 /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = C5290DC6851A635298C20FAF5B67CE70 /* sync.h */; }; + AB415F2BD12C21DAE0D5F94CE09C8B3C /* v3_pci.c in Sources */ = {isa = PBXBuildFile; fileRef = 8D8A1B85D95A6C08C2FB1E546DCE0897 /* v3_pci.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AB69C2E0BC1932F90F6197332EDD85B9 /* frame_settings.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7117926BF223B96B69F21906D44BA768 /* frame_settings.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AB6CAE36470C201D83A3AB7A87207BB8 /* percent_encoding.h in Headers */ = {isa = PBXBuildFile; fileRef = CC06571CA7534BECBFF51CB4CAEF8120 /* percent_encoding.h */; }; + AB6CC107DB1C81C4CF32F97F2A75AA26 /* ecdh.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C8EA44397F063036809B8B994F31CBF2 /* ecdh.h */; }; + AB822765E6010241241DA3D45F58AC68 /* ecdsa_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = C5BAE0EF410BB567EEB31BEFF337A9A5 /* ecdsa_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AB8A0FACE441AB2DD01DB16867DE9DF9 /* hpack_table.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = AD5F16CE4D5C90761220A70B813EA9A3 /* hpack_table.h */; }; + AB8D4317A8282CEE0BFEFF53A679D71A /* protocol.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 10F4E2752364C3220503CC5F3C48DF8A /* protocol.upb.h */; }; + ABA2370C9D2B2A1180F2997779FCA433 /* asn1t.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 2155A84DEC3E9F9E032992F56BFAECCC /* asn1t.h */; }; + ABA9F5F6267D3DDBE9CB3B86E7B99203 /* GDTCOREvent+GDTCCTSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 390E1EFE88DDAEC3EE6294C7408CD71D /* GDTCOREvent+GDTCCTSupport.m */; }; + ABB969A8097102DAC0D273AFEF4500C4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1365595CD3433AA406454C412F9B6F48 /* SystemConfiguration.framework */; }; + ABD8255ECFAE84082B3CA0FFD9E24EE8 /* charconv.h in Headers */ = {isa = PBXBuildFile; fileRef = D45830430241957B9CEB417B5F6DD151 /* charconv.h */; }; + ABDA1EB91ED74606C37294C1EFCC7A37 /* symbolize.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CCC5E5367E56F38BE20965915C41368 /* symbolize.h */; }; + ABED428B7EEACC05C9BDB5AC7B6118B8 /* executor.h in Headers */ = {isa = PBXBuildFile; fileRef = 8934264C38A2DDF44C859974DDF76E4A /* executor.h */; }; + ABF29A1896B2EAC37130640E13D2F6B4 /* tmpfile.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = BCDA4B4BD0B0067A866E17307EE7AA60 /* tmpfile.h */; }; + ABF2CBC6A55798DB007AC15C44DAA137 /* cycleclock.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B57CC3581A2F1C36A41FC92FD471066 /* cycleclock.h */; }; + ABF32D4FDEC120576D38407F9E4221C5 /* GDTCORRegistrar_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BDEF32DE7B79E9425C0940C902B67AA1 /* GDTCORRegistrar_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + AC087D145D3A34DC92C974D988985544 /* status_conversion.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 72522FB6ECCD5B4D3161C13F25A68A2B /* status_conversion.h */; }; + AC0FF1B08EE4F50C2F75FD4B0D1C7049 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 01FF4609D5497521C83F7CF4D937FC90 /* endpoint.upb.h */; }; + AC1AB792BAF160CBBDE34BFC2901C651 /* tls_credentials_options_util.h in Copy src/cpp/common Private Headers */ = {isa = PBXBuildFile; fileRef = 00A999BA53AED1F3360BE2B79E1276CC /* tls_credentials_options_util.h */; }; + AC26528FDEF133C0D1F4203E3A5ACADF /* parser.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = 3103B5E5E8961AE81A4FDB7D4757D4AE /* parser.h */; }; + AC35F3CEE33B35686B38B458C3A49258 /* context.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 8F9BB401AA3D1C784081723BDA924AF0 /* context.h */; }; + AC4D4C01AEDBCE94CE5B2342C37A6B23 /* pollset_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 06D6148BF61FDC5B620DDA60B37DDA84 /* pollset_windows.h */; }; + AC75E3E5D5144F2C0012B1E97499E1B1 /* scheduling_mode.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C57F873C20677DBB378816C7DFC14B3 /* scheduling_mode.h */; }; + AC8F83CC30ACCE576718E66B62E5BB8A /* alts_grpc_integrity_only_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 18F1E9F059C0A110CC44A15DF13F9E48 /* alts_grpc_integrity_only_record_protocol.h */; }; + AC92D9CF656F84FF80879EE1BF8F387A /* static_metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 4856F247635DDFF25590A63A1EB08FF7 /* static_metadata.h */; }; + AC99AE61DB9997006B565EC7742028B9 /* socket_factory_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2A5DE4EC60B3FC05089F935D9BB40AD1 /* socket_factory_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AC9D03B4838D773D3F5F31F8E196D0F1 /* transport_security_grpc.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 02054DA0396C7663732C32D7690309DE /* transport_security_grpc.h */; }; + ACB846E1680523FFC7441A66C51088A3 /* time_zone_if.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = 602E6064F0F2EB38B769534FFEA856CA /* time_zone_if.h */; }; + ACB8C010C045781229C5C87FCE23EAE8 /* log_format.h in Headers */ = {isa = PBXBuildFile; fileRef = 91677845D4B364197BF2B44A290AD6D3 /* log_format.h */; settings = {ATTRIBUTES = (Project, ); }; }; + ACD9F822357956045F3976358C201A16 /* alts_unseal_privacy_integrity_crypter.cc in Sources */ = {isa = PBXBuildFile; fileRef = BCF66273E55F5A6AF80811B117615C86 /* alts_unseal_privacy_integrity_crypter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + ACE1DEAD449957C49FC896120D06A70C /* bytes.c in Sources */ = {isa = PBXBuildFile; fileRef = AA21EE8C05E8EB4D0FFC5B450C03C314 /* bytes.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + ACE419E013DD0E67C8D1B28DA34CA750 /* channel_interface.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 41A93D115672055C805A34D017E6BE86 /* channel_interface.h */; }; + ACEC7D3E021523B43EEC0DD48BDECBE5 /* channel_arguments.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FA27FC76BE4704F299E45758F66254 /* channel_arguments.h */; }; + ACF316AB28602030758E7352C56CA6DD /* p_x25519_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 1D249314DA46EA0731824E09C8639B82 /* p_x25519_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AD02F34BEB013C087E45335A75D4AC3E /* bin_decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DCAFFC8B7C9B05A7879283CF23CADBC /* bin_decoder.h */; }; + AD05AD75CB5AC5FFC7674CDABC19780C /* FBLPromise+Timeout.h in Headers */ = {isa = PBXBuildFile; fileRef = A705B5E2F23E918976FBD98D3A8110B1 /* FBLPromise+Timeout.h */; }; + AD0FE1EBA4B12736679D69E26E59824C /* call_combiner.h in Headers */ = {isa = PBXBuildFile; fileRef = 980DE03C57A327190CE7C575C4E5E831 /* call_combiner.h */; }; + AD2EA981467E66725EB916BA9D828FDF /* parse_address.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = FE2A5512BD4BBDBF9D6B47B95AB122DC /* parse_address.h */; }; + AD3986514226BB9A748658CC95EB6DF1 /* exponential_biased.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3CDD6694CC550534B1181B3D249C08B3 /* exponential_biased.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + AD43261D0457F7A556607BDA399C312C /* timeout_encoding.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 4D2391EFEA1878086C6B9C2D265FF4E8 /* timeout_encoding.h */; }; + AD67BD1C48CC3AB18CAE6C2599A782AB /* x509_obj.c in Sources */ = {isa = PBXBuildFile; fileRef = EC4B5BAEB7765FC73F6F5612C6F1E377 /* x509_obj.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AD9506852F473F4D4366CA46BFC64FAB /* local_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D9DEE9D0A3229B90F0043F9BFF1EB4A /* local_credentials.h */; }; + AD97D987E3796BDC0C000721A17C3365 /* lds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 91FAA086DC2883346DE8C42D4CF7DD34 /* lds.upb.h */; }; + ADBCA0BD98E2490215C1EF06948C1459 /* hashtable_debug_hooks.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = AF9FE1C105714C48F02ADCBCA92D2F40 /* hashtable_debug_hooks.h */; }; + ADBDA4B5337379316F8DFD24029D3457 /* ossl_typ.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 4C959F6F19FC96C3E56B0C86325687B0 /* ossl_typ.h */; }; + ADDA4DA6DF8464F2632714FCE7E4B7BD /* server.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 86828F9E80D747789AB8A9F20ACCB2D6 /* server.h */; }; + ADDAF87FE5B79367D4AC066ED1BAF8CB /* eds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8CD361B2A2D4A86816AFA83E23A5C7 /* eds.upb.h */; }; + ADFE41A01F2DE34926A30298EDAF7EEE /* status_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = C9086F7E8F8207376E67A8A3538135DD /* status_metadata.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AE0D215BC33CED5C05E766BB91AADA23 /* charconv.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = D45830430241957B9CEB417B5F6DD151 /* charconv.h */; }; + AE1C70A3994AAD80D3614970E1052338 /* p256-x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 07404AAA8FCDAEDBD1B62A8D0B33961B /* p256-x86_64.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AE27544AD33D37DA1C257DC4CD99C021 /* is_boringssl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E29D3A11FCE715E06A78E2168353C130 /* is_boringssl.h */; }; + AE34C98E0166933D53AD99EED2240305 /* mpmcqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 6378779BB664AE75A73E8345EF9F1901 /* mpmcqueue.h */; }; + AE40AD959D9896968C0BD915D7C39CA5 /* memtable.cc in Sources */ = {isa = PBXBuildFile; fileRef = A045B03D292089864E80F033B4385B4F /* memtable.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + AE4D97579B734D5804E2F29ED83817C6 /* grpc_ares_wrapper_libuv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B9B1ECECDCDF419D009ABF477F942CF /* grpc_ares_wrapper_libuv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + AE5B176B3856ACA893BE921810C4E9CC /* orca_load_report.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 74C8974B3B902E1EFB8E33E52DC21979 /* orca_load_report.upb.h */; }; + AE5B5EBDBA381B212A77CB159FF0467D /* grpc_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E1A23420F4011712F05BD2979FDBE50 /* grpc_posix.h */; }; + AE871EEEE8228335E8A69C9446E04276 /* digestsign.c in Sources */ = {isa = PBXBuildFile; fileRef = EBE55BC5EBBA67AC56DD26829E6EB0E4 /* digestsign.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AEDA7610B362E6AEAD43F63ED343F329 /* stats_data.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = 9A00BBB980AE203C34BBF2E75B09A34A /* stats_data.h */; }; + AEEE3EC2AA4E0AFDB9146EBA52F0C3C8 /* subchannel_interface.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9446F18433A710F3CFB2EFB16DC7AA03 /* subchannel_interface.h */; }; + AF02D30F901F4126AA8FC78B05766F90 /* const_amd64.h in Headers */ = {isa = PBXBuildFile; fileRef = 11AB1B2817C84F8D1973E8D153CFBC4B /* const_amd64.h */; }; + AF0480FF1CCB335A53939EB899BF4DFD /* pollset.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 1AC1BE10FC1DF8BCDE29E6F5C12E10D8 /* pollset.h */; }; + AF099296DA5F9D7D0BE72414CA3AC9E0 /* lb_policy.h in Headers */ = {isa = PBXBuildFile; fileRef = 487080C34B2182DC7185465FF17F2546 /* lb_policy.h */; }; + AF0AF7CCC9D6ECE7CBCA7C4F76315A89 /* string.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = F46F19261670AA0D96E6494F0C02F67F /* string.upb.h */; }; + AF2603BDA0F3E59A0B2E5C974F20396E /* iterator.h in Headers */ = {isa = PBXBuildFile; fileRef = F4B814B310FFE7E806C94D301234039A /* iterator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AF40A2FFF746F2817558D6B291F5B939 /* external_connection_acceptor_impl.h in Copy src/cpp/server Private Headers */ = {isa = PBXBuildFile; fileRef = CCAB8392092C9D2B149B03DE38E1F51E /* external_connection_acceptor_impl.h */; }; + AF564D06A5CA484D2977971800CF368B /* f_string.c in Sources */ = {isa = PBXBuildFile; fileRef = F3ED5BBA5A5E9C3BECF3DDFC42052963 /* f_string.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AF65A4B58608ED8E36D4F049A50565F0 /* alts_grpc_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 4B472C585FF3AFE6DA27A2D064C8B019 /* alts_grpc_record_protocol.h */; }; + AF8712D16627D7EDA1C2A7EDC42B4F34 /* pollset_set_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = CD6A7D16A01E330E3D7859D2C1E6143F /* pollset_set_windows.h */; }; + AF9F55D8F46C6B07E2A348210E245FC2 /* memutil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 69E56F28F23EB668D4D43E369DF0A33D /* memutil.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + AFB5EC3AEFE29132D36D9FF8BD935E74 /* byte_stream.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 2F8DFB761F716328C8EACBF3AD1865B8 /* byte_stream.h */; }; + AFD533C0BDB6284BAECE3970C6366EA8 /* FBLPromise+Testing.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 5F18E7687A7A6D07648D7178E09B2455 /* FBLPromise+Testing.h */; }; + AFDFA385CA6BC41DE42FEB5228324909 /* channelz.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = B9B8640AFD3A0D5E5D8E7B48D1AC36F4 /* channelz.h */; }; + AFE61F80F27598C4D9330817F1C982CF /* filter_block.h in Headers */ = {isa = PBXBuildFile; fileRef = A608E1DEC03C31D95C076F0D54638102 /* filter_block.h */; settings = {ATTRIBUTES = (Project, ); }; }; + AFEAE48A9ADFC55A68D96FE731B0EED2 /* x_val.c in Sources */ = {isa = PBXBuildFile; fileRef = 991646968C4E012B3B30BAFFA98237A8 /* x_val.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + AFFEA0CFAA75CE27C4F1AA79F5A0C227 /* a_print.c in Sources */ = {isa = PBXBuildFile; fileRef = 0F1F0DD0EDFBD2742BB0D955A0BB9E99 /* a_print.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B01446CFB21D25C3D4A2282FC99A82F1 /* address.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 112C1E3B3A05AE0271459556AC54B570 /* address.upb.h */; }; + B01BE1B2871816B579C6E03B3B4E93BC /* alts_zero_copy_grpc_protector.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = C9F016A74296D7C56C7C8BA613C59CF5 /* alts_zero_copy_grpc_protector.h */; }; + B025905DAAC9A33331FA922C3DBC5430 /* dns_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8429896309152F60325A57BE1CFE6382 /* dns_resolver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B03BB7290B6FAF3EC23FF51C28304C77 /* FIRComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5337A65C10583FAF2537A6BE2B0D285C /* FIRComponent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + B056240B885BE31F97F00602DC95A7BF /* write_batch.h in Headers */ = {isa = PBXBuildFile; fileRef = F63FB24E85F74BF90CADE18BB83D1BA3 /* write_batch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B05A7CA17DF1CB0DD9162D1F692080A2 /* view_snapshot.cc in Sources */ = {isa = PBXBuildFile; fileRef = FCCA30672600EF310C1AC89F398065BD /* view_snapshot.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B05CEBA8424666CE060F732914794438 /* global_config_custom.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 8F3EE303E9B2E59CE4CC163A96BFEE5F /* global_config_custom.h */; }; + B0627FDA8D7876AD2B9F501B4F4D639C /* annotations.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */ = {isa = PBXBuildFile; fileRef = 6BC7A68EADA873C78CFE5C42DFD4997C /* annotations.upb.h */; }; + B06D96E79F949C08F2F094FF136D20BD /* percent.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 9F34C27792888518DD18C8F8531DE1B2 /* percent.upb.h */; }; + B0811BA8A5729594E410FA5658DA75DC /* v3_ncons.c in Sources */ = {isa = PBXBuildFile; fileRef = 9933B495C16D5CED674CDFE5BB24FE0F /* v3_ncons.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B08CBE2D3048E1AD352546BB9E3B68A2 /* range.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = BA68FCEF1837B17A1D301620F1691D8A /* range.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B0A817DC8BBD506EA6B5755F066D4057 /* gpr_types.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = BD9868F082F4AA742CA857B0F81F9A90 /* gpr_types.h */; }; + B0ADB1F69564F930411EBBD83B03EC4F /* x_algor.c in Sources */ = {isa = PBXBuildFile; fileRef = 95EF6C798829EE2DC030C24819EE2298 /* x_algor.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B0BA279B164CB6F39F47F1454ABF0711 /* call.cc in Sources */ = {isa = PBXBuildFile; fileRef = A91305DD4667353F0C3B30286CE14858 /* call.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B0C6FF1773BF874BC81378587224B20D /* arm_arch.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B2B7493C81A4B6F855A3AD8B76C5B7DA /* arm_arch.h */; }; + B0FD615D0ECD1A76C082E21AC7F04D3D /* ecdsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 1DAB72662E83D1D1061C16A3EAA3FB92 /* ecdsa.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B1201588EE19D83B86AE1FFEDE7CDF2E /* p256_64.h in Headers */ = {isa = PBXBuildFile; fileRef = A3EB023FED87D37C6403299E876C3CAC /* p256_64.h */; }; + B13E8F1E18A3E27B3CC1E7AB6FFF48A8 /* alts_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 64977221336CEF3D34926E7F9B2250DD /* alts_credentials.h */; }; + B1485A65A1FC4EB083EBF88D839D1DDA /* annotations.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */ = {isa = PBXBuildFile; fileRef = EDF5C2B9E092AC473CE996CC5F92F75A /* annotations.upb.h */; }; + B150EEE30A758808DE923D5B033E30D0 /* leveldb_mutation_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 18484767EE110FAE5016F0B898172E1A /* leveldb_mutation_queue.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B17571C3A76AAE2612ABD19A655D5C57 /* server_builder_plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A66EDDFCCC68F686309D219E83AA46D /* server_builder_plugin.h */; }; + B19B2F19AB9C39CCEA0660F50CF30D36 /* memutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A65027B5AC3B0BEA043E518801657BA /* memutil.h */; }; + B1B073B950F8F342471985EDE8EEA56E /* notification.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1E38A0446DD4881BBB0CB0BA9BA3F096 /* notification.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + B1B1A408AAC460624E1F3A42CD9B196B /* evp.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 1FA9B0F489506D839E54613F8FF2A6A2 /* evp.h */; }; + B1BC466845ADB0143C621AE428CDA33C /* identity.h in Headers */ = {isa = PBXBuildFile; fileRef = 87C4D55119C30A31119CF079FDA56C98 /* identity.h */; }; + B1D761D64F7F614B5B25DD606D04FDC1 /* iomgr_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6BC9EEF879320F15924D807E0674A1 /* iomgr_custom.h */; }; + B1EC9AF19DCE366F91B0F4004D930B5D /* endpoint_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = 21F061F543BD2B7C5A77DF17DE9EF163 /* endpoint_components.upb.h */; }; + B1FDCBACBBC9191623185E200712977B /* lockfree_event.h in Headers */ = {isa = PBXBuildFile; fileRef = EB2E25A001863A1F0A3AC138047C601C /* lockfree_event.h */; }; + B205935DF01370360691C0A358CA2A9E /* config.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 133E5C2929C7B4D3823137AB4244A9BD /* config.h */; }; + B2198CFF1040D81FD15845F53B26BF13 /* message_compress_filter.h in Copy src/core/ext/filters/http/message_compress Private Headers */ = {isa = PBXBuildFile; fileRef = B02B5648392F5D58B25616C6AC8329ED /* message_compress_filter.h */; }; + B23110C6897DB4C6FC3CD30B8F95A2F4 /* string_util_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9CF6723BB05DEC37F90BA50E101B5BBE /* string_util_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B2339FD7D4F974F1AE3B8A5A181B5E2D /* target_authority_table.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 4FE1F4833D4B78AB84329C8A1CB20104 /* target_authority_table.h */; }; + B23C07998FF787066491321A85C7EBF6 /* gcm_nohw.c in Sources */ = {isa = PBXBuildFile; fileRef = ED30EEF89E3F26907A1A5C85DDF60A81 /* gcm_nohw.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B2492CC78BC817A72C599AA96941C142 /* thd_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = FAB1D65E68C223D2FEEF4EC568EA3A8F /* thd_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B272C41BDF32380D90FBBC81BC3A031B /* completion_queue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0669EC87902A174C07ECC27922C9207B /* completion_queue.h */; }; + B295F9A8A8CC3F54DDE4ACA0C09A4862 /* thread_manager.h in Copy src/cpp/thread_manager Private Headers */ = {isa = PBXBuildFile; fileRef = C34D4943091EB3998904FAA5A6C79FC6 /* thread_manager.h */; }; + B2B3A52B415A80081691EC87ABCF3EE2 /* ssl_x509.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F326A7AC42901733691D403D8CBFAD6 /* ssl_x509.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B2CC5B5EDB48A7B3F654227433FD1075 /* logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 81AD0A969365DC86D49B97CBAD3E8F76 /* logging.h */; settings = {ATTRIBUTES = (Project, ); }; }; + B2CDDFEA1C479193C326184D359DE20B /* variant.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = FE8E4DD22025DFEB1D8911FBAF47F6E2 /* variant.h */; }; + B2D0110BD3DB7109036424F72DF76E8C /* client_load_reporting_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = A62139F07699F4A3238DCFB24654FDDA /* client_load_reporting_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B2D92AF8D27AD16C212BD192178C4CCE /* route.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = E11EC83D2D3AE097D3EE61259903A3D2 /* route.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B2E051CD2C6807AAF6F84BB20344694D /* load_report.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = 9E5671FB07752F56090B0C6377032B6B /* load_report.upb.h */; }; + B2E767C64A18B006786DBBAD72E11494 /* int128_no_intrinsic.inc in Headers */ = {isa = PBXBuildFile; fileRef = 8258B53CD53B6F137AAE2FA93E035D01 /* int128_no_intrinsic.inc */; }; + B2EAC758E0895A05B9F0FE598763D2DD /* retry_throttle.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 25285C8F555AFD60182DB33AEC9D10BD /* retry_throttle.h */; }; + B2EBED71337099B7420C52BA1B1BAE7A /* stub_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 52BA331001F77169CEFADCBB9A58C02B /* stub_options.h */; }; + B2F326070EC26E1A5EA74183CB5564EB /* slice.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A5FEFACE1AA855021F2464F98B76C77 /* slice.h */; }; + B2F8AC6A07B03B6E4A4831A81CEE7833 /* lds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = B4CC9C6128D4CE90F7156B239AF1A4A9 /* lds.upb.h */; }; + B30A472547EA6F3B5BAB1DD8DBD142C6 /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = A4F490579130970808943F3F104248D0 /* pkcs7.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B30FD6D17306A490B8DDE549867ADF7B /* ref_counted.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 77119AEE9AE74035001C1D8784F9D9A9 /* ref_counted.h */; }; + B3165DC5D6F24B818AADEAF718ABC9E2 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = 853D2A565D62967727699E29EF2CFB9E /* port.h */; }; + B31C29155AF654A068CB18B6D81A6197 /* google_default_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = E72F4419733B8C21D797E9E594B8A977 /* google_default_credentials.h */; }; + B3269023C7BAC8399F8AB4A847559388 /* scoped_route.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = CAA186BD32F13676AAF8B7B67A8A54D2 /* scoped_route.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B32DD1529B38C2AFFAB11E83DF160B33 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 9778EE1B2F9B8EF00AF2A8AFEFD2188F /* common.h */; }; + B331D2AA98BCF7A5D90AC13C3ECF80BD /* grpc_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A501D9B8CCD468D97F793DC06F27B6 /* grpc_context.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B333C73F3ED585A8BF879C396E41B7AB /* endpoint_cfstream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 910313BAD7CAD36747FA01457BC4ECD1 /* endpoint_cfstream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B352528838DC24E045A1CDD4A7BF9057 /* alts_tsi_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB284BD2ACEE8F0D301A63F8B46C27C /* alts_tsi_utils.h */; }; + B38E6A5CB358154C17BD1CE4B945D8CE /* FIRCollectionReference.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC97C2EC4CDD54ECE16CD500F9A484CC /* FIRCollectionReference.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + B3A358987FA8B5D8EBA9332AAE58D3E8 /* timer_heap.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 341BD3517E4F990FAB166795F3C151A3 /* timer_heap.h */; }; + B3A75C2870504A75C53E31391B2093F9 /* inlined_vector.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0BEA16D51DF53608E34D4D740CDDE6 /* inlined_vector.h */; }; + B3BAB3FF635DEE3AF0717CF6A0FD3C69 /* range.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 28793964619C1F7228788C0B1387513F /* range.upb.h */; }; + B3C41A521B4EA1EB5FE08DEF93B912DB /* ref_counted.h in Headers */ = {isa = PBXBuildFile; fileRef = 77119AEE9AE74035001C1D8784F9D9A9 /* ref_counted.h */; }; + B3D05B7C740B9A2263C83651E3054412 /* bdp_estimator.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 44FE1F32C1768389A81F0A6275733508 /* bdp_estimator.h */; }; + B3D1B5DB94835346FCCA98E10B1A1C69 /* unscaledcycleclock.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = C61C247E80D4D023E85484ECD546AC0B /* unscaledcycleclock.h */; }; + B3E74C1AEEF831D8777199FD6918DA27 /* x509_att.c in Sources */ = {isa = PBXBuildFile; fileRef = E197518A8B25A3D9600C9AC2028D695C /* x509_att.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B3E7BA92B641992E7FFD4D9489913150 /* http_uri.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 5491A1C01349E2714B8B961E419ED8C3 /* http_uri.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B3E9C1BB5F3B5980E7C43BAD5C3279A8 /* check_gcp_environment_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 06543595F0017DA7C2D864B8C59959DA /* check_gcp_environment_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B3F63CAC69258C8040575708778D0270 /* varint.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 5C77EBAB7C9B6CA3B0440FE7AC464C2E /* varint.h */; }; + B3F8125BE10393D0D50A8FBFBE356F4D /* GDTCORStorageEventSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C6DCD4547B6351867A16CEB2FAA8C1 /* GDTCORStorageEventSelector.m */; }; + B3F95545874DEBB2A7A708FCFD4BE728 /* alts_grpc_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B472C585FF3AFE6DA27A2D064C8B019 /* alts_grpc_record_protocol.h */; }; + B40669767540DC76A8D7053C3E59F848 /* client_interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0958C4BB5B66784FC1D759AB158E5507 /* client_interceptor.h */; }; + B40F7534E7DF35D87A696525486C3E28 /* resolver_factory.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = A0C93E8A83FE787BD7C3CEB208303AED /* resolver_factory.h */; }; + B41FBD4EBC3A3DFE77DAB2734CA22C1E /* FirebaseCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 420A2D2A6930523849B70B9C3348A4DB /* FirebaseCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B422863D9CD711162E572069CB12162B /* write_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5725B9C930213912511C259F55BE9149 /* write_stream.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B437DD8E7D61CB7143E6C1AA443B191A /* clock.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B7EC5B5404862C8F432F69E173C4393 /* clock.h */; }; + B4401B18B0BB45238EC83645E00ADF16 /* GULAppEnvironmentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BFD27E9223734B6A049858399B753A /* GULAppEnvironmentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B44E7E11CEACD12A7B9B263D24ED3FA2 /* metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = E1C12A97E173016FDB1AB399B0574C41 /* metadata.h */; }; + B45883B2FAF72582EF9B712B4A6E5C40 /* FIRFieldValue.h in Headers */ = {isa = PBXBuildFile; fileRef = F07E3CC40A551C5BD4627CC04D39A30F /* FIRFieldValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B45C26BB166F64EAD2F69AF6F76EDBF9 /* interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = BD4D206E034593577820C0BD18349D7E /* interceptor.h */; }; + B48DFF5E05150BCD7BBBA3D80BC7F927 /* hkdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EB9BAE1BBC76D9C11855FE834FAC8FE /* hkdf.h */; }; + B498A3AD56724A571CC1F00D71CEB6AB /* GDTCCTUploadOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5AAF9F921A0C5D3FC1E9AE6BAFAB0 /* GDTCCTUploadOperation.h */; settings = {ATTRIBUTES = (Project, ); }; }; + B4A93C22E6477FDF82F21BF79F8608B7 /* completion_queue.h in Headers */ = {isa = PBXBuildFile; fileRef = 620BF7A8931A330D38F19B2087BEB8AA /* completion_queue.h */; }; + B4B7AECC6DE003F6400A9182F6D5FD27 /* alpn.h in Headers */ = {isa = PBXBuildFile; fileRef = 24385D56D890C859D59455A951BF4D46 /* alpn.h */; }; + B4BE805AD0E93C25D037B77498F2AE19 /* FIRLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 59B49F118C6CE5A72F34DEC83533A761 /* FIRLogger.h */; settings = {ATTRIBUTES = (Private, ); }; }; + B4CB2C1C355904F3DC6895D6F6C115B0 /* health_check.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF17CB71417B5B4D8A6ED7BD00FD13F /* health_check.upb.h */; }; + B4DE73212508358741E730710F203881 /* client_channel.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 19F8F9E30A7E6292F27C8FEC8E88F9AA /* client_channel.h */; }; + B4E68F03E8C46B85B8B535DF2B2EB628 /* dsa_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 3182A7D0F280665F541697E482D7D137 /* dsa_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B50FB617D12C1D1E05E06E2253F1452D /* atm_gcc_sync.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 3FE860E0897B1CF3E4D5D13932205702 /* atm_gcc_sync.h */; }; + B51D4C6D094FF836E5A073A4B4C796E3 /* cipher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4215984B22861EEE66F7975BC8826B61 /* cipher.h */; }; + B52C0DA3BDC88BE44B4B37583D62C029 /* subchannel_pool_interface.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5227BEA7F5786F7260DC6621A2E8890E /* subchannel_pool_interface.h */; }; + B5476F89687FFF9CDF1075B156723277 /* metadata.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 631213FA203B725122B795A19693DC1B /* metadata.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B55290997BB919383E92452178BA5E04 /* health_check_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C2CFE7651B561BB6CFA7CC9B15F63E9 /* health_check_client.h */; }; + B565B4AAC0F1E84F7DBFC6BEB8F340B6 /* slice_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ACEF7DE13EEEF21E1DEB53F06F651CC /* slice_utils.h */; }; + B5745AA22102F82181DAE3CA5385A938 /* pollset_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C6C363EE4C56B508C002874F18FD34 /* pollset_set.h */; }; + B57CADBAC022A0DDC34819E9E6457194 /* leveldb_migrations.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7B2DCC6B174ED373F1002AA6B1FE1FD0 /* leveldb_migrations.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B5842527423BD1EDAB9F4BAFB1F4A1F2 /* base.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = D9FBAE0517C65051B89AE153CFFD5FAC /* base.upb.h */; }; + B58936EBFC37A42661EC95B2C98A7F6B /* alts_frame_protector.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 4A37C441D777E90C6764BF3834EA1B75 /* alts_frame_protector.h */; }; + B595A373B63CE8755D26D900CC96FB61 /* memory_lru_reference_delegate.cc in Sources */ = {isa = PBXBuildFile; fileRef = 81A5F5C7035B2C87A24CF7B069A42CEB /* memory_lru_reference_delegate.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B5C4BE068DA5E44BA76BA4130B35BCB8 /* custom_tag.upb.h in Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = EB454D797281307398578203D87FEAB7 /* custom_tag.upb.h */; }; + B5CBCE13EC633FAEC73185DF37B6B228 /* nid.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A8057155076411DB6A73027FD64C60AB /* nid.h */; }; + B5D52AD847DD78B3A53E18E22351A98C /* incoming_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 7682E873616B0AC5B4010500B87A703C /* incoming_metadata.h */; }; + B60988DCAEBD76A1A79C3DD2C392568D /* arena.h in Headers */ = {isa = PBXBuildFile; fileRef = BED200068BA15F70BDAF41898196F81E /* arena.h */; }; + B61679B31BAC48CA66B36D8D2C6780D2 /* status_code_enum.h in Headers */ = {isa = PBXBuildFile; fileRef = DEEDEA94AB15B525343CA25364DBC905 /* status_code_enum.h */; }; + B6183B7566D1DB07B6AF059CFDA76874 /* ev_epoll1_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 748B2260BF1522BC284270557AC5DF69 /* ev_epoll1_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B63B24802CCEDEFCAB40E8C697B84A92 /* tls13_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2C3C51EC9AF65CDA9032057E9BB8210F /* tls13_enc.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B654CCD57BCEDD7DCF79C8DB4EB7B889 /* tzfile.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = D77AA049CC87EB804FA5BD66030A1CA5 /* tzfile.h */; }; + B662800E11704CCD7950A48D850A4F42 /* bdp_estimator.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 83FBF2ADBA37C6AE104DA0354C416D7A /* bdp_estimator.h */; }; + B66482EA29D7976149BFEB6611116D7A /* grpc_ares_ev_driver_libuv.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCF3958E0C5B380C0F1EA053B4DC876C /* grpc_ares_ev_driver_libuv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B664AF38CD5EF1F5CCF7D54B0576AFA7 /* tcp_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E80008EC9FB5BEE4EEAE02CF4BC9068 /* tcp_posix.h */; }; + B671C6610CC3FC642C43B0ECF6050ACD /* async_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = B882E42BF6F3E01E5EC81F7A55920316 /* async_stream_impl.h */; }; + B68792F39132A4D10744B3B4C41EABD4 /* alts_grpc_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 4A6402D7673B28ADD5BACFD6E7736EF8 /* alts_grpc_record_protocol.h */; }; + B68DEE2D73195E7414A23DC4A0BF21E7 /* timestamp_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = 35AF1F62F668B0DB4AE8656A452AC6DD /* timestamp_internal.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B69169B25AF1A85FD1FA62D1A982CF7C /* load_system_roots.h in Headers */ = {isa = PBXBuildFile; fileRef = 703E0DD09A5712BE17DDB6047211A662 /* load_system_roots.h */; }; + B6C0A7E81D217623807E6EA7959F5EA8 /* client_unary_call.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED9237D85289C5307DA6BABB50E35C9 /* client_unary_call.h */; }; + B6CA64F06C13BDF9F9116FB2A82020D7 /* FBLPromiseError.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA1F6131B8B62CF6F75405F9197BA3 /* FBLPromiseError.m */; }; + B6CC7B656A6E6C1DC0F88835FA815AAB /* GULKeychainStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = D33E14FBFFF2D8733E45613FBD7B4336 /* GULKeychainStorage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B6E97AC613F82C9D9F6C2E8A2F811572 /* arena.h in Headers */ = {isa = PBXBuildFile; fileRef = ABAD5CF3B2F079651491304D130C2FEE /* arena.h */; }; + B6E992F690C7D35FDA4CE63F59F77D5F /* write.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = F60BA8BCB155286F8EB206ABEF7A5B67 /* write.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + B6EA5800A1F9381EF6CD16290D44E4B6 /* tls_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = CE2D2DD03C29671D5CA640FDC172BFEF /* tls_security_connector.h */; }; + B6F378F5A4B477178A2A35F2BCB379D1 /* backend_metric.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 8A530D16A35BA070587ECB2A518590E4 /* backend_metric.h */; }; + B705E621204FAC763EEA680CD9319C0F /* e_os2.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F9342B69F768D5869D7C73F050EC77F /* e_os2.h */; }; + B7317AD61CA8D01035D12EA7D40EED03 /* stream_compression.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = FC8D20028EF6AD5FC84F04049A68A6EA /* stream_compression.h */; }; + B73BC9EBDCED4A86970381E825BD0232 /* gethostname_fallback.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC35B5E778E247E727CF82C0C86D56DE /* gethostname_fallback.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B74850DBBA2E246D1BD403B9F8E878E9 /* string.h in Headers */ = {isa = PBXBuildFile; fileRef = 0122781482DB99BE6378BC4DF1087D05 /* string.h */; }; + B750CF2BB4A8E7A66228FD791D210CDB /* alts_tsi_handshaker.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 760B8EC06583C79A3F1830C4E17AE723 /* alts_tsi_handshaker.h */; }; + B7512147A520D2C9ECA084B9A0C69F8B /* alts_grpc_privacy_integrity_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = C043FAE2657D24268BEAC10297E6C5CE /* alts_grpc_privacy_integrity_record_protocol.h */; }; + B752F6512E407B6E64F1388621E8E5FB /* client_load_reporting_filter.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = CCC1745DB5372F9CD973303AF0DE1ACB /* client_load_reporting_filter.h */; }; + B7557CCE95DAB65EE81DFD8C3E444BD1 /* span.h in Copy types/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 0616886D4D867ECC1ED7D73DDC3DB27A /* span.h */; }; + B75779C1DF4BA6152E258F72A8672E05 /* ssl_utils_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DF95D32DE32B398A176B60ACC5C7F26 /* ssl_utils_config.h */; }; + B77A85096B3C5E886CB7961DBE9D0D9E /* cert.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B2EEE88DF8265BD7966C655D0F1A8ADF /* cert.upb.h */; }; + B78657C60302105595EB3EB4A7C9333E /* tcp_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = E15F527EEACB19EE41A26F8BCF3B018E /* tcp_windows.h */; }; + B79AD2B4175374C22B3057432CB942BE /* message_compress_filter.h in Copy src/core/ext/filters/http/message_compress Private Headers */ = {isa = PBXBuildFile; fileRef = F7115F78FC67D382EC6862E32A909784 /* message_compress_filter.h */; }; + B7B0CACCD1E3B59591131E469D8734EF /* timer_manager.h in Headers */ = {isa = PBXBuildFile; fileRef = A25C69824148C82983802E09EA43329F /* timer_manager.h */; }; + B7EF8B3061DFB9AFE33933FBA34615B2 /* httpcli.h in Headers */ = {isa = PBXBuildFile; fileRef = D5BC0AC5B88EA0B67C4E1179A9AE9542 /* httpcli.h */; }; + B7F00F2D28711644CC60D27AB1BAA3BA /* thread_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = ED3475FDAC93B6337A48DB0BDDFEC7B6 /* thread_annotations.h */; }; + B7F527744C0771CDD96BC6EE97F5EBFC /* alts_tsi_handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 561C73C1E83BD2580E9141F5AEF08ECA /* alts_tsi_handshaker.h */; }; + B80182DC95C5BBF535EFEAF5414AEA2C /* pretty_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B7A8746B944A38ED662B6933651D2C /* pretty_function.h */; }; + B81193FC8FE5323136C0F122754D2E43 /* int128.h in Copy numeric Public Headers */ = {isa = PBXBuildFile; fileRef = 7F540B5A9B6E44693FB42012CFF51A28 /* int128.h */; }; + B81BACE66C1714FE17A54DF183AD9A75 /* validate.upb.h in Copy src/core/ext/upb-generated/validate Private Headers */ = {isa = PBXBuildFile; fileRef = BA2040C110BB160079D3AD87D98859F6 /* validate.upb.h */; }; + B81BCF779D2D24EFD8B7DE16B56609BA /* ctx.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B1D45B38111E8D1DA3BE14CB613724 /* ctx.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B81F3990E7E17C3E5B37A32FFC6B2734 /* iomgr_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E9D1E79459145589F28007C94E9EB274 /* iomgr_internal.h */; }; + B82F300CF4C839D6AF2566ABA9414324 /* p224-64.c in Sources */ = {isa = PBXBuildFile; fileRef = A16F04ED2F2B3312349B5EBC21A0B79F /* p224-64.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B8415FA51F1D875F1195594546625593 /* socket_mutator.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8AFDD73E6EB84B430A2B2FC445718D4A /* socket_mutator.h */; }; + B84FFFC407AD861B819F9962BA195A1A /* GDTCORTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = CA10B384C2987C54413082FF23735492 /* GDTCORTransformer.m */; }; + B865631297E5E4B78CB0ACFA040579DE /* percent_encoding.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = CC06571CA7534BECBFF51CB4CAEF8120 /* percent_encoding.h */; }; + B87400CD1FF2E8EA7D7E8C0335A36218 /* udp_listener_config.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = {isa = PBXBuildFile; fileRef = 1ECAD5E8D9652BC9BDD83380CB553C88 /* udp_listener_config.upb.h */; }; + B87A179D04206042A327FF3D1E2A946A /* time_zone_libc.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = A7E47917B5D3B3625D08295A98F25F54 /* time_zone_libc.h */; }; + B894BF7F07497180A7A977CEBFBC9BE5 /* default_health_check_service.h in Headers */ = {isa = PBXBuildFile; fileRef = EE4D8F5ED0B55EA104AFE2858B9ABD92 /* default_health_check_service.h */; }; + B894F44BDC39E76C6FD0DD0EC67301AB /* kernel_timeout.h in Headers */ = {isa = PBXBuildFile; fileRef = D9B6FE7617E920F054E9D6A3F426B1E3 /* kernel_timeout.h */; }; + B89DAF13984F489E9044BEFF812398DC /* sync.cc in Sources */ = {isa = PBXBuildFile; fileRef = ED3670E27C2181A13C75EBFE273189C5 /* sync.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B8ADB345F8312A4A97E8642AE99959A0 /* x_all.c in Sources */ = {isa = PBXBuildFile; fileRef = F9ECE3CC88DC5F9CF5590E4BECDAFF10 /* x_all.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B8BC7DEBABFD1E1838370B842BC37C23 /* dns_resolver_selection.h in Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */ = {isa = PBXBuildFile; fileRef = 0105331323361FB6B77031C4D88C0928 /* dns_resolver_selection.h */; }; + B8C3C1CD94E7C37862A967A869690FDF /* alts_record_protocol_crypter_common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 128BA0920634D6FFD02EFBFEB26D37FB /* alts_record_protocol_crypter_common.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + B8DC2035C720D29C8871566A3B0D40ED /* resolving_lb_policy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9078ABF4885664441CEBC7C246515245 /* resolving_lb_policy.h */; }; + B8E227497BDDB92A7973501C200AB67F /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = 40E596A03BD27031C6B1374D6CBB1865 /* file.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B8E71627B09D05A821819473E060B767 /* sha1-altivec.c in Sources */ = {isa = PBXBuildFile; fileRef = B7500E416674A858D09E5A4B94CEAA0A /* sha1-altivec.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B9037689AACBD91D86AFDE521A23E448 /* grpc_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 1319E85F66E15ADBAF6C9ED31849EA68 /* grpc_security.h */; }; + B90481FB88D208059C9AC02DAA01030B /* builder.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAFFBCE88659266BA37FE7EC2FAABCA /* builder.h */; settings = {ATTRIBUTES = (Project, ); }; }; + B917802EE7A964AD03798CE94693AB0A /* grpc_posix.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 3E1A23420F4011712F05BD2979FDBE50 /* grpc_posix.h */; }; + B918AF4BD47AA1189298076F1C653B69 /* status_conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 72522FB6ECCD5B4D3161C13F25A68A2B /* status_conversion.h */; }; + B9344EA1B9E8C834E4D00C9886128723 /* optional.h in Headers */ = {isa = PBXBuildFile; fileRef = 89762919352304B630804EA6DC787FC6 /* optional.h */; }; + B9356E03CFA66CAD181B2DE097ED4EAD /* hmac.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E4B37E0CF180870E481A1720691A8F3F /* hmac.h */; }; + B93C501273E83D7456FB2103592B87AB /* max_age_filter.h in Copy src/core/ext/filters/max_age Private Headers */ = {isa = PBXBuildFile; fileRef = 93D38C9C89251BC76A22D5EFB217A2BF /* max_age_filter.h */; }; + B93F07440D13502B503A13084C5BB96F /* map.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 3ACDAA76599D5B821934B1EBF93B36C8 /* map.h */; }; + B94B0A7AD03D0A807D66D2AB24808892 /* rsaz_exp.c in Sources */ = {isa = PBXBuildFile; fileRef = E695FD7B79E5C893CA67FDBADFF65588 /* rsaz_exp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B965BB4BCC2374E4BB5603846322867C /* resize_uninitialized.h in Headers */ = {isa = PBXBuildFile; fileRef = 42DE6B8BAA3F2D02FB99B98DC0D836DD /* resize_uninitialized.h */; }; + B982D96B500BF8AD00AF514B41E87D33 /* pollset_set.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 71C6C363EE4C56B508C002874F18FD34 /* pollset_set.h */; }; + B98482190413F69A3684CA5B00B5EB18 /* FIRComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 605D6A9E54961B971682B34C80F43763 /* FIRComponentContainer.h */; settings = {ATTRIBUTES = (Project, ); }; }; + B9AB95B5DA458F8A2DCE354CDA9A9627 /* huffsyms.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E9F7C6F8DDC8752F34EB27B2EA45038 /* huffsyms.h */; }; + B9C8098D1FDC735E74F1589D2B180329 /* a_strex.c in Sources */ = {isa = PBXBuildFile; fileRef = D92626F4FC960755F6FB8693856C3BF1 /* a_strex.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + B9CE01C4434443BC13DD0AB9128C27ED /* metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 7BCBBF4B51DF8811C70E4A89B8051019 /* metadata.h */; }; + B9CE478C994367E62FA0889577B6F8C0 /* health_check.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = F37E2B4B8FC4316895B7F43046408D13 /* health_check.upb.h */; }; + B9D65038EAF9EA62554D4808F46F1BAE /* init.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = FDC6A78A78235B12BDDBE2CCB0CCF495 /* init.h */; }; + B9E12C4EF0F8BC8F9071A8A394F44BEF /* symbolize_elf.inc in Copy debugging Public Headers */ = {isa = PBXBuildFile; fileRef = BC0178DF14AC0D9F8CDA8D7FAF34524B /* symbolize_elf.inc */; }; + B9F7DAEC5E421B9797DB4DEA88F260EF /* hrss.h in Headers */ = {isa = PBXBuildFile; fileRef = F7229CBE896CDFA77D31D55CFF1D039B /* hrss.h */; }; + BA039CC760095C472ACEFFE867D7DB62 /* log_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1001BFF8E5F7589AF3989A2E15EC4978 /* log_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BA131B5E7BCDD89139C676C8688FB918 /* security_handshaker.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 6F464093E6619365780B739C836CFDFC /* security_handshaker.h */; }; + BA272CE8F44F18F306C16C9E18EFEBBC /* any.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = FB89F3C63BC67038371022710B8302A8 /* any.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BA39588D28207DE34004736BEE86AA61 /* eds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6BB92693CCC64385D2FF6431D7890F1E /* eds.upb.h */; }; + BA5B5D7BCA9BD1299936A7F7A04E5339 /* have_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = A75884DD09B8566BF894752E00DF2665 /* have_sse.h */; }; + BA675415F798941AEDB7FFCE20771D01 /* bdp_estimator.cc in Sources */ = {isa = PBXBuildFile; fileRef = AC1A7B92A2E51C886809807B73BD01EC /* bdp_estimator.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BA6CF0CFF05C13D58F171B8A1AEBBC5A /* fake_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 753C0EF261CDDE6C75C21DABB832BB16 /* fake_transport_security.h */; }; + BA6D88D1907C41666FEDF4A71AC5BFDE /* credentials_generic.cc in Sources */ = {isa = PBXBuildFile; fileRef = DE8B6B11502CA8ED37E537FADA851DA0 /* credentials_generic.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BA741936FC002B19910B57FA0779774D /* json_token.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = 19DFA2FEF180F5A3402EE13F91773035 /* json_token.h */; }; + BA7ED9A2F9D0072F7F1780C6B9F6EFF5 /* client_callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2357611EAAC607066D736FC1DF733387 /* client_callback.h */; }; + BA94D554FEF2121866DBD5BBFD589F99 /* chttp2_connector.h in Copy src/core/ext/transport/chttp2/client Private Headers */ = {isa = PBXBuildFile; fileRef = 6A4DAD705DD68E9F9B4489DA7427A818 /* chttp2_connector.h */; }; + BAA0A810AE4DEEBD32AF1AE6EFAED247 /* combiner.h in Headers */ = {isa = PBXBuildFile; fileRef = AF22FBE9343697E005570E9F0B43BF4D /* combiner.h */; }; + BAA75F9BD700150069772CA449B25626 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E416B6FFF01C2016265C480E859A8D3 /* internal.h */; }; + BAB6F7E6573D0661A600709304DE8148 /* fake_resolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 977E014A4754BB8C4B0A8CCD7E461144 /* fake_resolver.h */; }; + BABE0025757BE9790FA7DF8C461999A0 /* connectivity_monitor.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B13413FFB0F61136436993DEA918F35 /* connectivity_monitor.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + BACF462867CDEA2EDDBC143AC07F624B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + BAD2A2F65DB0F9B945E78AAC2704AB1E /* empty.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = B93C5630D5435A7B6CBB7527395BE2CC /* empty.upb.h */; }; + BAFCDD06E52E4D003336C97BB7F3FF88 /* api_listener.upb.h in Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 6AB2A5FD7F9BE7FDD0A2919849E6BA1D /* api_listener.upb.h */; }; + BB20EE5EF7916EE5ECC14140EE6EDD2C /* inproc_transport.cc in Sources */ = {isa = PBXBuildFile; fileRef = 502090062BA80C2295236121A94D524E /* inproc_transport.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BB2D7D0B34C1C1C1F4B022F12DD724A2 /* message_size_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 263EFB806EBF6269985D5A90F2CC4E51 /* message_size_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BB7AF5FED97730A924C0AB551244344A /* log_severity.h in Headers */ = {isa = PBXBuildFile; fileRef = F89DE2BD98F44628A3F9C6E095D66E03 /* log_severity.h */; }; + BB7D6D998A22EB28661BC7449BE47F41 /* sensitive.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 0565B1D3A5B1DE8B3DDD61843DB5C268 /* sensitive.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BB99E9BF59F7FCA8602C89F58DB4C01E /* alts_tsi_handshaker_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 602C5A4FFD45F80D69045E02EF581931 /* alts_tsi_handshaker_private.h */; }; + BB9D724D8160305110E4E49C3C9BDCD1 /* tmpfile.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDA4B4BD0B0067A866E17307EE7AA60 /* tmpfile.h */; }; + BBABBFECC1F3BC0F05D36356422EE89B /* sync_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = CF9597C496DE5BF09079B3514E56B148 /* sync_windows.h */; }; + BBCD1A0CA05CF1F7B0BEAF087054E39A /* obj.h in Headers */ = {isa = PBXBuildFile; fileRef = 257CBA6F049DDC229362A2266A940B20 /* obj.h */; }; + BBCEF5D08D8BF671F20CC1ECAF5B1D76 /* message_compress_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = B02B5648392F5D58B25616C6AC8329ED /* message_compress_filter.h */; }; + BC08E0925194F23CECD80A328C213D79 /* base.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = D9FBAE0517C65051B89AE153CFFD5FAC /* base.upb.h */; }; + BC304255F3944B8899FC178ACC21FE59 /* duration.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = AD83148BBABCCAF7D2F2991318C03BA5 /* duration.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BC33367ACBBB4857C8110FEDCEC02C94 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA63CC21607F5F59C9A89C589E497A4C /* decode.h */; }; + BC3DDAB1270757014A5FD68C6B1AEA4A /* scalar.c in Sources */ = {isa = PBXBuildFile; fileRef = 47B13EBE03D5CDA2C05768C5BA9179AB /* scalar.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + BC5165A66CD1CD4A750D12A7D4C377AE /* alts_handshaker_client.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 4E31D1C1A5A47DBC716FC276D230DA13 /* alts_handshaker_client.h */; }; + BC6FDB548A946B3933FFECFC9AF08FAB /* bad_any_cast.h in Copy types Public Headers */ = {isa = PBXBuildFile; fileRef = B20618FB1F2EBACA78FC2A5BE46B3903 /* bad_any_cast.h */; }; + BC737D7FBC43DBA2FDD225C4DF5DF581 /* circuit_breaker.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = 632762789A1D19AA681DC4AA5B81A8AD /* circuit_breaker.upb.h */; }; + BC7B9E3494A6B426098B5BB8A63D278F /* service_config.h in Headers */ = {isa = PBXBuildFile; fileRef = F6FC809C9C4AA5E36CC4DE6CB5D47D36 /* service_config.h */; }; + BC845C341BFDFEF32BD7993AA574EF86 /* inlined_vector.h in Copy container Public Headers */ = {isa = PBXBuildFile; fileRef = 8B0BEA16D51DF53608E34D4D740CDDE6 /* inlined_vector.h */; }; + BC8B02C0BB8BA405C278AD2C2B2AD6F6 /* alts_grpc_privacy_integrity_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = C043FAE2657D24268BEAC10297E6C5CE /* alts_grpc_privacy_integrity_record_protocol.h */; }; + BCA76BF458F1E428F1B96A018248D9E9 /* self_check.c in Sources */ = {isa = PBXBuildFile; fileRef = C6D0FECC069776402D0BFFD1768CE856 /* self_check.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + BCB1E3243FF47C6D9A31758FBB172C69 /* s3_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D24F6E60BB76D9760C11589422A5D /* s3_both.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + BCB7A631611ADA018885F5CC30FE268F /* exponential_backoff.cc in Sources */ = {isa = PBXBuildFile; fileRef = 19D8D86A8C9FACA0CED9A2EE17D195DE /* exponential_backoff.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + BCC46DAC1A493406F5F515F4B692E4FF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1365595CD3433AA406454C412F9B6F48 /* SystemConfiguration.framework */; }; + BCC5D70C259E0F2C62D122B78A8F2A01 /* comparator.h in Headers */ = {isa = PBXBuildFile; fileRef = 99F3C52BCD05EBFA3D648E038A0A31CA /* comparator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BCDD04235A5769D8688678A6BCE513D3 /* client_channel_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B3614B9E60A4883B9A98F50776F1746A /* client_channel_factory.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BCEC07499DC73DB55F8A6F71A7D6C99D /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A3F7B0603946255579608E98726D52B /* internal.h */; }; + BCF3696A231BE0969E4A4CAC2B73243D /* chttp2_connector.h in Copy src/core/ext/transport/chttp2/client Private Headers */ = {isa = PBXBuildFile; fileRef = 635CDD0C54FA76F8CB9052C2E7156F50 /* chttp2_connector.h */; }; + BD3C6999AE61D6B4D9DE49277F462FCB /* frame_handler.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = A2487D73586BB044B7A6D3BAE481FC73 /* frame_handler.h */; }; + BD3DCFDC8699E0FF0EFC54C069814C21 /* atm_gcc_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = E7959196CB1EC295C1D7EFB05C1A62D2 /* atm_gcc_atomic.h */; }; + BD467EA95F22CE884A4C0F89529232C6 /* jwt_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA9F14D30DD3A8D92CCA2CDEAA0BC67A /* jwt_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BD476138791806597963FA692B9BA774 /* deterministic.c in Sources */ = {isa = PBXBuildFile; fileRef = 655A1BD52011D79F025D1B3061703200 /* deterministic.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + BD4DDF3FD8561C36DAE13128B0B09C6F /* city.cc in Sources */ = {isa = PBXBuildFile; fileRef = C0C6AEAD726718D6AD4F0C71E7E98FFE /* city.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + BD58AC2E1F03B837B6FF0B95F2350814 /* byte_buffer_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791237FDDB229B80FF9F960CD09BC2C /* byte_buffer_reader.h */; }; + BD5CA489E59AEA2442C5BD1EC2319C7A /* transport_security_common.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A2A3C2D9D89DE20073978B4954BC390 /* transport_security_common.upb.h */; }; + BD6041459396E4468AFAA9D52609A892 /* document_snapshot.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA72B3E467BF6F44B2177C5E45B9B39 /* document_snapshot.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + BD9179EC15C9859BE5FE796133773406 /* endpoint_pair.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B8F5D730C790565BCD245A8E8D89D8AF /* endpoint_pair.h */; }; + BDA0A6F5B509D31D4D00EC5A54306507 /* tls_credentials_options_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 00A999BA53AED1F3360BE2B79E1276CC /* tls_credentials_options_util.h */; }; + BDAE866DEEFE69991C5D6F5F1DBF8714 /* policy_checks.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 407F2336D528FAE4942037AE24703D4B /* policy_checks.h */; }; + BDB0FE074CA168CBE1E554D45D91AB70 /* cpu_iphone.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6A40217F6693BAFCBD8ED3F005007FD1 /* cpu_iphone.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BDBA1E6F7234F33ABE401B95AEB1333D /* aes_gcm.cc in Sources */ = {isa = PBXBuildFile; fileRef = D7EF5070003F64714A164D4FD8259C26 /* aes_gcm.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BDBF0C779D7E6C23988E8C0BC1B62D8F /* descriptor.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = CFB9A6C63751153BC747E55D43B375E3 /* descriptor.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + BDD070BA6F66F93CBE80A8326528013F /* authority.h in Copy src/core/ext/transport/chttp2/client Private Headers */ = {isa = PBXBuildFile; fileRef = 97978E8EF1E9A1C594B56600C302D6B7 /* authority.h */; }; + BDF0730BBA1E42ADDA9E1E2B85FD022A /* blocking_counter.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BE2D3DD1DD4E8DD1B5D1DDC0F9F310 /* blocking_counter.h */; }; + BDF2B8EBD2EDED18D4C775310365BC9C /* NSURLSession+GULPromises.m in Sources */ = {isa = PBXBuildFile; fileRef = 8076CA75CD2587BBFEBA18201CF95B38 /* NSURLSession+GULPromises.m */; }; + BDF6026CF363ED397075F96CF51511BD /* grpc_ares_wrapper.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = {isa = PBXBuildFile; fileRef = AA46FC2EF94E9F5572BD914C67BAD5C0 /* grpc_ares_wrapper.h */; }; + BE1C0E0D253E7A28C6922BBE1A726FCB /* status.h in Headers */ = {isa = PBXBuildFile; fileRef = 5736CCB1D8190AC29D63010FEED81666 /* status.h */; }; + BE43A7E73B6DA1187850D2B82CD3ABD6 /* load_report.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = {isa = PBXBuildFile; fileRef = A18FF02CBC9822154D65D9BC978A31C8 /* load_report.upb.h */; }; + BE60F7BD739941D7E9BDF3B676F34A98 /* algorithm_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 585EBA7BE3A68C247364F6F5F9F1AD0B /* algorithm_metadata.h */; }; + BE63D5974C1E51BC438A44E3E49BA0C3 /* endpoint.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = BC6DF4B32899D322F74979AD7AD18FAF /* endpoint.h */; }; + BE69CA2A451DFD76751E19A210FE19A7 /* arena.h in Headers */ = {isa = PBXBuildFile; fileRef = 88FDEDAD0531906F2A06282D40C09148 /* arena.h */; }; + BE6D3EE205C686F5748F8D67EF1504D7 /* sys_epoll_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A6FBD8C15F233AB29F00632508099D3 /* sys_epoll_wrapper.h */; }; + BE71DBA2B431781A1F1A91040F1F812B /* FIRCoreDiagnosticsInterop.h in Headers */ = {isa = PBXBuildFile; fileRef = F90E070CF9B63F98769A73192FA5B2B5 /* FIRCoreDiagnosticsInterop.h */; settings = {ATTRIBUTES = (Project, ); }; }; + BE963229892930C491279FCAAA480A44 /* FIRDocumentSnapshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD74399B5F51BF1848F33AA8EE2F5729 /* FIRDocumentSnapshot.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + BEA87430BDDC6CFB49688E04E2825B8F /* http.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 6A2B7AAF021624A3B2FB10C87EB67EA7 /* http.upb.h */; }; + BED862B4B136CC66D355BF1C0801A343 /* pollset_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 25592B2A61C69BF28CADC8150043D35E /* pollset_windows.h */; }; + BEE8DF12BCBEAD567F75FCF033C955D6 /* md5.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 575F8E5E4BEA92C01819BC7BE61B4344 /* md5.h */; }; + BEF604AADF225EAD044FAAD39B14DE5B /* local_transport_security.h in Headers */ = {isa = PBXBuildFile; fileRef = 20BE36670AF41FEAC19EF9286FC4AD7A /* local_transport_security.h */; }; + BEFEF6A1DCFADE8CE127A62CC964403B /* FBLPromisePrivate.h in Copy . Private Headers */ = {isa = PBXBuildFile; fileRef = A1124CC7D776FC3C0C380D7F944BA169 /* FBLPromisePrivate.h */; }; + BF105756685FC996BDEDB9D002A17A0B /* hash_function_defaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 98EC4006F852AD14461271C9A99F9586 /* hash_function_defaults.h */; }; + BF1E4D852D47DF687331F34ACF5EA0DA /* circuit_breaker.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = E89C5F4718BD12CDB155016FF56F7DCA /* circuit_breaker.upb.h */; }; + BF263E9587FFB3A6584A990F6B8DDF2C /* options.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = F37130F35FDFD15BF12C013E47957649 /* options.h */; }; + BF4CB12654CF5BF84F9DB2192E0E913A /* lb_policy_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 18E2773333D37D79898DCF455DF4463D /* lb_policy_registry.h */; }; + BF8BDFBBDC916CBFA6A15E3F33DCBFE1 /* gcd_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = E2F3610D3B40489699AC20C069E6D56B /* gcd_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + BF9AD4D3A333665F5052FA8CCB0DF902 /* ostringstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FD55D078350569E123F008748C531D9 /* ostringstream.h */; }; + BFAD721D00735872B40796A0DA2363FD /* tls_credentials_options.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = 6AB22F1F9925C0AA3889BA8A9F88799B /* tls_credentials_options.h */; }; + BFC04C11F63E376AFA2FCB54C4DB1579 /* tls_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = F93B69F1C42D2674A97DFCA32E808939 /* tls_security_connector.h */; }; + BFC7DFCEA0250E674F84CB3EB56F3CD9 /* ssl_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 003E83FF1B679A9B48F56CDA90C03386 /* ssl_types.h */; }; + BFCFA90D80179124EBCA6055650C632C /* ssl_session_cache.h in Copy src/core/tsi/ssl/session_cache Private Headers */ = {isa = PBXBuildFile; fileRef = 34391FEAE71B56A3166780B622652052 /* ssl_session_cache.h */; }; + BFD22A71936A10029BF149BD9EF49AB1 /* transport_security_grpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 02054DA0396C7663732C32D7690309DE /* transport_security_grpc.h */; }; + BFE3779472836867110FE82D848EC94A /* atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = 8545DCD9A87148D45FCF694311196747 /* atomic.h */; }; + BFE4C42EABB67474CCA3FACD37AA5B6F /* handshaker_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 955633B7DC07D0A78D93BAEB2A94CA07 /* handshaker_registry.h */; }; + BFF44DC75E237B822AE7033750116E81 /* grpc_streaming_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = ABDAC6BA1239B29F18ED25459D95FE04 /* grpc_streaming_reader.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + BFFF20DAEDB92A54849851EA31EA044F /* GDTCCTUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 205BF93224B19AE2B0B15B8FB06658AE /* GDTCCTUploadOperation.m */; }; + C03E10DD1F696F5FE6BB8900F42621EE /* throw_delegate.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 9F9A3572E006A3AF2D2D784FA7D2E148 /* throw_delegate.h */; }; + C06035AD221AE2F30A740066E84769D5 /* comparator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 084F54054980956409809817A9185C0D /* comparator.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C077C62016041E6FFC1521C877489DA7 /* leveldb_lru_reference_delegate.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7863E8269AB9B9304AE2631E48FEA146 /* leveldb_lru_reference_delegate.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C0783DC10F6FF2C83FCD4DB868848F84 /* resolver_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = D2E064930E744AB4F123EAAA3A009D4F /* resolver_registry.h */; }; + C089BD1A9349F8B6DD288A4E31580958 /* parsing.cc in Sources */ = {isa = PBXBuildFile; fileRef = F3B697670C29CE2E5665229D8D27E1C3 /* parsing.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C0C3D6DFCCDD5B210BA75E73C21B986C /* external_connection_acceptor_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CCAB8392092C9D2B149B03DE38E1F51E /* external_connection_acceptor_impl.h */; }; + C0CEDE753B3DCE16BD4F87A43FE4A1AE /* grpc_ares_wrapper_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 884024A8F005AC8A9CC7CA68172EC129 /* grpc_ares_wrapper_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C0ED3828C689F5AA56C229674381E72E /* filter.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = {isa = PBXBuildFile; fileRef = BF491B7EC78D49D1C61B2B007A52FA85 /* filter.upb.h */; }; + C10377687379EBEDB7A179441E68A2CA /* frame_window_update.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 1450166D6224B9D3744B09172A7EBC19 /* frame_window_update.h */; }; + C11BF1CF8688326D7857015B90E5B9E2 /* a_object.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EE741B74BE076658425875860FA9F4 /* a_object.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C1248C1EDA287E203B2F91C5B926849D /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C721B724E5E995C8911EB0238842E6 /* config.h */; }; + C127A99DF91DE36B597F0005FFCCB81E /* tls_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = E87DFED2DA30CBDB5B3ECC57C280B7D0 /* tls_credentials.h */; }; + C1337E48A83BD0745561645FC26BB2DB /* client_interceptor.cc in Sources */ = {isa = PBXBuildFile; fileRef = D25FA8EB0B342841E0C22257E2936BBD /* client_interceptor.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + C14901A4BA7D2FF5BD830094D11669CD /* histogram.h in Headers */ = {isa = PBXBuildFile; fileRef = 709C476ADF004340DE0E611411A3F682 /* histogram.h */; settings = {ATTRIBUTES = (Project, ); }; }; + C14FF191846F585FEBEF6E235A9FA057 /* grpclb_client_stats.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = C748D5F0B1DB94E7F4C21469C988B672 /* grpclb_client_stats.h */; }; + C1662B4A20DBEA07914479A0AEC64DCF /* alts_tsi_handshaker_private.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 602C5A4FFD45F80D69045E02EF581931 /* alts_tsi_handshaker_private.h */; }; + C16964C5D9BEF680714F967A3AB563D2 /* http_client_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = E69164375A0446840DC6CE7CC664846F /* http_client_filter.h */; }; + C19F790FAA221422A187433060A9A218 /* FirebaseFirestore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0625B451A83FA539603141FE9432CD4D /* FirebaseFirestore-dummy.m */; }; + C1B20892F80395DF3919B79E5B0EED6E /* credentials.h in Copy src/core/lib/security/credentials Private Headers */ = {isa = PBXBuildFile; fileRef = DB80A2BB852ED1EF4798DC5BCEC10C9E /* credentials.h */; }; + C1B5D6A1AF7A98488C36FE2F3FB64FC3 /* int128.cc in Sources */ = {isa = PBXBuildFile; fileRef = 67D0EA25E5A124E272B58F5A6BCF22E6 /* int128.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C1C9AF98CD58B1BBAE19FE7D692873B6 /* resource_quota.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 99039F2EA3DB530F4B0608A609A94DC7 /* resource_quota.h */; }; + C1DD9C11FF3F1286318BB74E6BF26E2E /* route.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = B890B6474BF0D27B4CD83FBF2973F8D5 /* route.upb.h */; }; + C22CABF91214B8EE42D1CB74A99D7BDD /* closure.h in Headers */ = {isa = PBXBuildFile; fileRef = AB974890D4BF327B904955BCF2182AEE /* closure.h */; }; + C22F0A828FA910DB024B6B4A6C620B2A /* iam_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 078CA41B562783942098A5FDFC7D4758 /* iam_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C236D2B362B5DBB394EA93FE08753404 /* float_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4A9327117A99BCD5D2460B6ADDD974E7 /* float_conversion.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C24B3E584334108158461ACBFC3950E7 /* grpc_alts_credentials_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 527B0E3FDE01E7A23AF4B743981950B7 /* grpc_alts_credentials_options.h */; }; + C251606665B83D42F86617828C5EA7C3 /* FBLPromise+Do.m in Sources */ = {isa = PBXBuildFile; fileRef = FB7C74D862C77160C47225BDF2192058 /* FBLPromise+Do.m */; }; + C29EA863E57D2709E05528519A88A163 /* load_balancer.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = ECC8BB2A7BA8DE1189AF125087AFEF54 /* load_balancer.upb.h */; }; + C2A38AD30B4B0F86950E047F3F693716 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + C2A7E80D46DC9FBE70C55032500C3662 /* stap_timers.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCBD31BF5E01DD986558450D77094E43 /* stap_timers.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C2C6A1C9F0E1160CF83A7EA06D7E7CE8 /* x_attrib.c in Sources */ = {isa = PBXBuildFile; fileRef = 88366B1CB2700DEA09298D9116E88222 /* x_attrib.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C2C9E4B70E28DEE0AB52862D7C0467C7 /* handshaker.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = A056D6984CC86A443DF3C5AC42C7471B /* handshaker.upb.h */; }; + C2CFA3CF3F54A0D8921207603CC54507 /* local_security_connector.h in Copy src/core/lib/security/security_connector/local Private Headers */ = {isa = PBXBuildFile; fileRef = DCAD43C85B8298C22ECAFD9BE46C7619 /* local_security_connector.h */; }; + C2E0BD4011FC1069AAA3B497AA4BBDC2 /* oauth2_credentials.h in Copy src/core/lib/security/credentials/oauth2 Private Headers */ = {isa = PBXBuildFile; fileRef = 4FAB7538814660A314E9C038CE70E37B /* oauth2_credentials.h */; }; + C2E175C1DB8DF60D78E22E8751BB10FE /* ssl_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = B5E40543B08B101D409F25A9DFF58259 /* ssl_utils.h */; }; + C2F1C245ECD27B28B940C2D6A3A0B79D /* iomgr_posix_cfstream.cc in Sources */ = {isa = PBXBuildFile; fileRef = BF01A6D43CB86206732DF664B5E50589 /* iomgr_posix_cfstream.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C2F80392C4AB16FEB28D8450D15DE1BC /* status_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 98316369C223112281330952440BBF37 /* status_win.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C3084C362417D91B0E697A370695CE7B /* filesystem_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 43FAFC4B5882220F24952B47E295C07E /* filesystem_posix.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C34BB2A22A7FCE27067F77120D777179 /* autoid.cc in Sources */ = {isa = PBXBuildFile; fileRef = FFD4B31452A9981277D282361FC81C10 /* autoid.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C358A85CD411B4F4A8EF6E74605703B5 /* low_level_alloc.cc in Sources */ = {isa = PBXBuildFile; fileRef = F8A07008189BAAAC95B608E3B032B911 /* low_level_alloc.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C35B472005748B54CC166C9E8C494344 /* slice_internal.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 1B6031C0254744F53D1F7DA8C0FB2D3E /* slice_internal.h */; }; + C3A10D9B3ADB5800F28F4457B15CEC9C /* security_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1CEC26D7E014356769FD7BF103D1FE49 /* security_context.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C3A4CB1EDF31FFB898A53E4F1AF847BC /* slice_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9B38B02FC04FFF9E9B84E4D3E7C859 /* slice_buffer.h */; }; + C3A621DE75D8B3632F157FAED1EC2FAF /* ec_key.c in Sources */ = {isa = PBXBuildFile; fileRef = DC90F532DA9136A5AC68A9A55471B52B /* ec_key.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C3A76C75343CAB039D9516076DE09425 /* altscontext.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 11493E67BC46E222427792FAAF39AFF8 /* altscontext.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C3AF6EBD1D1BD11A7420B92028CDD459 /* security_handshaker.cc in Sources */ = {isa = PBXBuildFile; fileRef = A56AEF2B52A8CAA0074B21F1051F7C7F /* security_handshaker.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C3D4A0EB2EAC672DE99C7748CF3138F1 /* grpc_types.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 48F2043236F70A5747D902B21422D45A /* grpc_types.h */; }; + C3E2D361A4A43493071C36DB3A17FEA3 /* time.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 967BEABE5C0BE6793F717C6FDFEBF6B9 /* time.h */; }; + C3EB9B38C3C648E7865DA4C66829C054 /* b64.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7BC2043F5D30ECC6235DF242F8DD6B /* b64.h */; }; + C3EE038140E969F0B3F78E6544CCC0D1 /* mutex.h in Copy synchronization Public Headers */ = {isa = PBXBuildFile; fileRef = 1DD342F2761D43D340F2DE16B63412B8 /* mutex.h */; }; + C3FFC74E387BBCB594C20934070B150A /* lockfree_event.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = F0B7573BE70B3E29B5D33B4E021A4B55 /* lockfree_event.h */; }; + C44B9DB7BEE64AA23B702378B27A5DCE /* alts_counter.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 18E1B8B1DC940C40B0291001AAFFE1BC /* alts_counter.h */; }; + C4856B5CE8E8F7348D8C93229DB25D2B /* FBLPromise+Reduce.h in Headers */ = {isa = PBXBuildFile; fileRef = 7664DD245795DEFDE12568838F32FBD7 /* FBLPromise+Reduce.h */; }; + C4899EC8AE091954BC1C68A31A9FAB22 /* asn1_par.c in Sources */ = {isa = PBXBuildFile; fileRef = 59FDA70766A600F09B7EC7EA98A17C66 /* asn1_par.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C4AE1772D01BF9BFD91B58D80AED67C0 /* internal.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = AD6B66162EA7B2F1DA9F0A2B07FBDA97 /* internal.h */; }; + C4C81A5869A4755E9F8518BDFEC72E19 /* alloc.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 471A162586C7439948EB848F7A00BF39 /* alloc.h */; }; + C4CC6790236F87A356847290C04A6B87 /* repair.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3DDF03DC9E76B9A50571A15F51739E5B /* repair.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C4D5A0482D75A8880EE072A2185FF3D3 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = B5FEE16484BBD246D925229DB5F5312B /* internal.h */; }; + C4D97EEF87D4D85B1FCFFC26A6ED2519 /* numbers.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 7E88F3326149071F9EF148B778F3473B /* numbers.h */; }; + C51211AE02C2A13E5E7D0CFB8947629F /* cds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = DDFAC152A766E48750F028897C6F6DC2 /* cds.upb.h */; }; + C5155242D83B350F3023481674469781 /* tcp_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2C90CEB8CA3058F7F5EC2F0968CD808 /* tcp_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C54A1DB83F0AB40E20791A63EC52CFB7 /* ssl_security_connector.h in Copy src/core/lib/security/security_connector/ssl Private Headers */ = {isa = PBXBuildFile; fileRef = C5EDF444EA6073E298253A4A97F3AF51 /* ssl_security_connector.h */; }; + C54D1E16C11ABA69C66C2ACC25696B1C /* extension.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = 70D476564D9BBCE1BD0616BF5ED79124 /* extension.h */; }; + C5586CE2AFB6BFB941AA30046E9283EF /* GDTCORUploadBatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B057FBCF7405CACAA8807CE25EBED87 /* GDTCORUploadBatch.h */; settings = {ATTRIBUTES = (Project, ); }; }; + C5604AC4550CDF1C94DDEDBBF9C44712 /* waiter.cc in Sources */ = {isa = PBXBuildFile; fileRef = B70F5B8BAC9639370472813E432CC316 /* waiter.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C586FC7964253153BFA017955B2D3CD8 /* BoringSSL-GRPC-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = DC02B323251C05AE29CD677621010DCA /* BoringSSL-GRPC-dummy.m */; }; + C58A7E5412932A374922DD700F796047 /* FBLPromise+Reduce.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 7664DD245795DEFDE12568838F32FBD7 /* FBLPromise+Reduce.h */; }; + C597985908213CC77AC6531880CB54E2 /* builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = EF1E01436EB64D9F92375215FAB4E8FE /* builder.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C5A3083341B597AB6F40D52CB457AAA3 /* iam_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 79B0271B775AEAE70F68A6C7694DA390 /* iam_credentials.h */; }; + C5B72E78519F6D3EEC649712BAFFE0C7 /* message_allocator.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = C7EEA401F0F0737E47114170D1B40EAF /* message_allocator.h */; }; + C5B8CE3270C756076AFBAE545F6B7D05 /* threadpool.h in Copy src/core/lib/iomgr/executor Private Headers */ = {isa = PBXBuildFile; fileRef = CD676D07C0BCA6C58E93E75DA606FFB0 /* threadpool.h */; }; + C5BC42F349F2C2AF226B931A739FBF5A /* timers.h in Copy src/core/lib/profiling Private Headers */ = {isa = PBXBuildFile; fileRef = DFBBF5427F6D287EB64E3B36E5EF6D7D /* timers.h */; }; + C5C00F96547939BB886F2C01F32D0FF2 /* wrap_memcpy.cc in Sources */ = {isa = PBXBuildFile; fileRef = E1DC3AACCD82428A7231829D9743D299 /* wrap_memcpy.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C5C6833108CA4EC4EEB51B56D6223E9C /* empty.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 760292060E9C9A9DB8985F31CDAA12E3 /* empty.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C5C997F46FD29FF32FFB3234ACAA5CC9 /* env.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BF940D079EE26182F7A3B8DCCCB06B1 /* env.h */; }; + C5D212A840269BBE25C70046207D7634 /* buffer.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 9710FFE0600759BFF531DB88EA62873E /* buffer.h */; }; + C5D586579E69EBC2A32B96398E3DE9AD /* subchannel_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 9446F18433A710F3CFB2EFB16DC7AA03 /* subchannel_interface.h */; }; + C5F8CFB46135FB66430F3E2273EE556A /* env.cc in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A84A6A27BF8FFEE704209E95F1F8 /* env.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C60E74C634EBA1B7347BF3354A59C3B8 /* FBLPromise+Timeout.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F92C9CD287154E896E3E8DC83B0EC56 /* FBLPromise+Timeout.m */; }; + C611AA8D58E0BFE081418B18B6630749 /* slice_utils.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 78BA118E8B62D64218555D3C890098CF /* slice_utils.h */; }; + C6138719E9C86BDB4A6B3EAC71F9E9E8 /* gethostname_host_name_max.cc in Sources */ = {isa = PBXBuildFile; fileRef = DE3E07C607F96BF8E06E006E44C6A2FF /* gethostname_host_name_max.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C62D80B67AC093106C79BB7135084A09 /* e_os2.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 1F9342B69F768D5869D7C73F050EC77F /* e_os2.h */; }; + C630EAC3A38F2081291AA260656CBA21 /* invoke.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 16D9E7FDC0048458C43611D963313690 /* invoke.h */; }; + C63A987298943353A14177F2623850E0 /* alts_frame_protector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9DD50785C581B619221C9A00D0002FC8 /* alts_frame_protector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C641843771A04050A9D2FC1E42574754 /* a_sign.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AD666A64B37FD6370853C72E35A12 /* a_sign.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C64A8E23AF89FF247F8FE91A6C7070B4 /* gpr_slice.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 76005E7A0B18417C2398A61E8131A0B6 /* gpr_slice.h */; }; + C64F82179681F533AE28F9513448401A /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 18FCC60BBDEE8D35E75391A4ACD3E958 /* base64.h */; }; + C65B94174750BD5782FABD2394EADB9A /* bin_encoder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1125D712F1F7D8DE064C2CF7D8EC1FEE /* bin_encoder.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C6725F9D7BE7D51AEC35CD4D4A6ED89C /* civil_time_detail.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62B71C9C57019F50FA4651A091504ADD /* civil_time_detail.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C672D11242CF245E68F026B55EFDCA28 /* opensslv.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D594189E2BF6247FB7E86C7671B2BEBC /* opensslv.h */; }; + C67909B559060A1E6B09F39A08F73146 /* v3_info.c in Sources */ = {isa = PBXBuildFile; fileRef = 17723983F89AC7CB351CA15DE6428311 /* v3_info.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C6806F0C6EE4C3A80A873EF4317C388F /* have_sse.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = A75884DD09B8566BF894752E00DF2665 /* have_sse.h */; }; + C683392CF118F0DA44E956F571001974 /* pkcs7_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 879DFADF4518007F490FA85EBB2C668C /* pkcs7_x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C69435C5DA5AF0D7F317AF0712A0D9B6 /* time_zone_fixed.cc in Sources */ = {isa = PBXBuildFile; fileRef = B7E98F1151263F1582E44733EC665B35 /* time_zone_fixed.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + C699E0F7925C17F911BFE7EC8468B613 /* load_system_roots_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4E5623848221A6B06BC7A9620EDB87BB /* load_system_roots_linux.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C69D349D175898DFBBFD4B9090EFB01E /* ssl_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = D35568987CB22CF82E321EAE0BC6A752 /* ssl_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C6C13CC8BAA4590ADE8072BCCA36B1BE /* upb.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 91B9039CD50BE0BEC3FB969FDF442FF2 /* upb.h */; }; + C6D90423BAD06D234E2533EF9D7057B2 /* resolve_address_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = E39896542BE44F8AB97D331C8265BCF7 /* resolve_address_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C6DABADE0E1560CF81F1D07747BAD5AC /* status_code_enum.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = DEEDEA94AB15B525343CA25364DBC905 /* status_code_enum.h */; }; + C6DB331811E065B0E68862651D768A93 /* string_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 735743FFE3A449B51A15E24901AECF1F /* string_util.h */; }; + C6ECD9541A52D1B673E443C5EA43D6FE /* slice_hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = CBE383C29BEDF8484AB6FD097D1BE43B /* slice_hash_table.h */; }; + C70EA413B6DB62C99560D86B0D8AD065 /* b64.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = F69BFBB91D7CF1A9E5B54FEBB922A452 /* b64.h */; }; + C72CF33A82C59392756CD6A42DA8BE28 /* subchannel_pool_interface.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 50F386007ACFF3B0112187AAC1AE463A /* subchannel_pool_interface.h */; }; + C7473E9C29275C23C9E2DD4A44331CFD /* time_zone_fixed.h in Copy time/internal/cctz/src Public Headers */ = {isa = PBXBuildFile; fileRef = 7FA59C12BFEBBCE17D29BBE9163CE881 /* time_zone_fixed.h */; }; + C74AF73BAFEF518E10C125532C68ADF6 /* sync_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9499EC6161BBF62D9D6CC424E6F66184 /* sync_stream.h */; }; + C7602E0B7B6C924C2AF27F179EC49378 /* core_codegen_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = ECA59ED6E17663C92621418F953576A3 /* core_codegen_interface.h */; }; + C763EECAC914A5110F0036B0F264BB1B /* FBLPromise+Any.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 35A7BD8BA5AF8D5B5D3A7A66AC545324 /* FBLPromise+Any.h */; }; + C765337DDDB2532158A226AA5D16709C /* pb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F977289B2AC1DA7B8583EFDBDECE3C08 /* pb_common.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C7682AB97CFD9B408F97638A7D615E46 /* xds_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9265B4AD0C295481ABD34E0BDEF8F5E9 /* xds_client.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C77B8C354220CD3068D650D6D642366F /* escaping.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = AF5A5E16288FED709D3068F845F4C469 /* escaping.h */; }; + C78095946B7F05FBD1E79B3433BF7E1B /* chacha.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6B752E2CCB34395E74669198882CFD10 /* chacha.h */; }; + C7947F91884651B9932EDF75A54144B0 /* slice.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 18519B81C338C5096FC7F8AB9AF57FC5 /* slice.h */; }; + C79B91C76E05B95F5BC238CC722190C5 /* patch_mutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 10E7F325F2BC11470A372F3A297C842F /* patch_mutation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C7AE5DBD461C1F28B09DB7483E912DE1 /* inproc_transport.h in Copy src/core/ext/transport/inproc Private Headers */ = {isa = PBXBuildFile; fileRef = 6C86E75121BAA1E70938E672141693E0 /* inproc_transport.h */; }; + C7C08555D93C0C90AEA2992609129396 /* wrappers.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FBBA7ADE29FE86D71F484593F1D26E2 /* wrappers.upb.h */; }; + C7C0EE4E38E417436D980C703D15EFA3 /* dns_resolver_selection.h in Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */ = {isa = PBXBuildFile; fileRef = AF6E0F94D9485229CFE1242EB04ED666 /* dns_resolver_selection.h */; }; + C7D7E3D2386C680093B6C44E8DD0D0E1 /* cpu.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 199C2D16BC8EFB980FAE08F606AB3076 /* cpu.h */; }; + C7D974D769835463E0124E4D60B14F4B /* hpack_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D62822281C54A60773896EAD6FA9D6 /* hpack_parser.h */; }; + C7EC60C1336B4CED3B867DEC31DD521A /* timeout_encoding.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 0C37954346423A50630887B3B7C56C42 /* timeout_encoding.h */; }; + C7F38522F9EF5177256483D7928650F1 /* x509_lu.c in Sources */ = {isa = PBXBuildFile; fileRef = A19B8FFA1AB568A7023B5B1F7D27D785 /* x509_lu.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C7F49DA4DDF1AD8AD8ABFECD1161DD44 /* GULLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8711C6D60C208846D4B38B8E70DEC6 /* GULLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C803BB43E1A45D192EA6BA9EFD9E2A64 /* gRPC-C++-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B55EB91303FBDC08783F84BF6997B52 /* gRPC-C++-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C807B70162C29E6E1E636C7F58B36651 /* srds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = DDB34E70DE46C0DBFA68657EE8AB1BB5 /* srds.upb.h */; }; + C80D5D1438EBE5A37FBDE0A152D5A951 /* compression_args.cc in Sources */ = {isa = PBXBuildFile; fileRef = 211C1F617812FCB36039E168586EC6F9 /* compression_args.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C81298549E26FCE221993076AA5405B3 /* bin_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = F6B0C0FD283587E498CEE3A6EBF788CD /* bin_encoder.h */; }; + C818DB50DF68573D9A10C5A596F41164 /* client_channel.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 7266059A56A9BAD00828F12817CFE1A8 /* client_channel.h */; }; + C837C761288AE6450D3ABE0CA4107571 /* internal.h in Copy crypto/conf Private Headers */ = {isa = PBXBuildFile; fileRef = 3EFA29BE5456CD955C742714DF6E6DF7 /* internal.h */; }; + C8500530FAFECC56E063A3FB024725F9 /* resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = A58096DD9E14A2347D2CE6BC195CB534 /* resolver.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C8674EC9ABD6A884078D90D4E7B695E5 /* inproc_transport.h in Copy src/core/ext/transport/inproc Private Headers */ = {isa = PBXBuildFile; fileRef = 280C16391AAF3C3CCD571AEF613E0CDE /* inproc_transport.h */; }; + C870E9EDDB9E8763B4790D02DFE7412B /* parse_address.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2A5512BD4BBDBF9D6B47B95AB122DC /* parse_address.h */; }; + C8727617E6B40546F0E829463B0DA1EC /* pollset_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 193505E21D1C48A8C5F7C950CF022AD0 /* pollset_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C87CD42CCF2BC851CD9E80333C3C6484 /* frame_ping.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 20697784672ED522459F591E8032AACF /* frame_ping.h */; }; + C8AC5CCAB0DD4040D2C061E70DBD684E /* alpn.h in Headers */ = {isa = PBXBuildFile; fileRef = C93587944B54F3913789EA657E2C4742 /* alpn.h */; }; + C8B7F9DE708B2AAF86B42ACFFB2B32A5 /* message_allocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C7EEA401F0F0737E47114170D1B40EAF /* message_allocator.h */; }; + C8BC0291DA55865C1419899712218DDD /* sync_abseil.h in Headers */ = {isa = PBXBuildFile; fileRef = FF4A0E8DE8149F64767FF12775A0601F /* sync_abseil.h */; }; + C8D1F31FAE332DC8A014A5C4C8E3CDF8 /* http2_errors.h in Headers */ = {isa = PBXBuildFile; fileRef = C84D9865D597EFA2055680E9A871A64E /* http2_errors.h */; }; + C92BF1250271FA2A95CA5D47B801BB12 /* async_generic_service.h in Copy generic Public Headers */ = {isa = PBXBuildFile; fileRef = 78B26E2E34B7A494C881016636BAFBBB /* async_generic_service.h */; }; + C95143D86B1027A416313C21AF383DF7 /* cert.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = DC38E35A4C8A73FD7F3F2376D18987B8 /* cert.upb.h */; }; + C95F9F7FCED96B61C5990F46954A3827 /* sockaddr_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8AD08B5926A35F7E6906761F0DBC47EA /* sockaddr_windows.h */; }; + C96E189326B06620C7A320F8F8E5E78F /* kernel_timeout.h in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = D9B6FE7617E920F054E9D6A3F426B1E3 /* kernel_timeout.h */; }; + C96ECB483D03FC94EA8A153B761B2AE7 /* create_channel_posix.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E5B869C89802921B22497BEF5788A0BE /* create_channel_posix.h */; }; + C99D3EC85FF68F1B227778CCBEC716FB /* async_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3463BA3E18078099E529BAA8FFC9DC53 /* async_queue.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + C99FD81FF575E8CC5B2DC98DD6B02393 /* skiplist.h in Headers */ = {isa = PBXBuildFile; fileRef = F4BB3C36D3E8DC8855C64F2DE77F9A8E /* skiplist.h */; settings = {ATTRIBUTES = (Project, ); }; }; + C9A15D50D4D668164B3A5856290AC8BB /* ssl_stat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 475AF9819AB0CC06134DAEDA3DAF6A1A /* ssl_stat.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + C9AE1770CC1FA1074BD74089076E36EC /* client_callback.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 6F79AB233BA51E65780DB03CABCFC2B2 /* client_callback.h */; }; + C9CB79C5CE6AC05589C21763012F1D55 /* status_metadata.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 922330D32B27D4FB78D2F47F9D40BB84 /* status_metadata.h */; }; + C9CE287BA7713ECF7AC85E18932BF174 /* server_credentials_impl.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = 1EF0ABEE4EA5576EC97035233DFE65B3 /* server_credentials_impl.h */; }; + C9E77D99ACF65C69111349809B09C8B7 /* cds.cc in Sources */ = {isa = PBXBuildFile; fileRef = B90C8BFB4C62A1154FC047C735BBCBD5 /* cds.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + C9EB0C0C24BD63B287C5E8B7D4C8EE46 /* escaping.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 5837FC87F631F4B0B42612D6362B36BF /* escaping.h */; }; + CA02288211ECA1F332EDD28B0F0B3F2B /* plugin_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F52A4EF4A8E4430229297A2C290E02 /* plugin_credentials.h */; }; + CA23F5976176EE26EEDD9C25844891DA /* sockaddr_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 86774CC4E513D98DAA8A5937084DF598 /* sockaddr_utils.h */; }; + CA2CC4B0289C3FD2C6D65B24FCD0CA2C /* timer.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 71FD7727C8A00943F0820A0160818320 /* timer.h */; }; + CA310773AF56C46033B0B58E22D774F1 /* tsi_error.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = B9376AEE9CBF0723E43D5C941FCCDECB /* tsi_error.h */; }; + CA3E9C9DE480B90DF2461D7C95D4CDAE /* pkcs12.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B6D1BEDC0AC9B722D8F9D332675C97D7 /* pkcs12.h */; }; + CA4059C64566125929D2AC4A038BA527 /* plugin_credentials.h in Copy src/core/lib/security/credentials/plugin Private Headers */ = {isa = PBXBuildFile; fileRef = A3F52A4EF4A8E4430229297A2C290E02 /* plugin_credentials.h */; }; + CA4C3D46B776972039067B6A947B84EE /* x_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 098A69B3B723EFA42D46B66467717313 /* x_x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + CA4E20A46CA58B03BA5C4D7C3F9E1984 /* service_type.h in Headers */ = {isa = PBXBuildFile; fileRef = C1CBE59511729F6F65A789D0499AAE62 /* service_type.h */; }; + CA4F064FCF2FC3BCD7E08CF44D890A17 /* alts_iovec_record_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 9725C5F072EF77446F1746D2294B77DD /* alts_iovec_record_protocol.h */; }; + CA718E5A5FE18D4223E24E11628BB088 /* atm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 37136FF8C80063F3DF8F522C22C01715 /* atm.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CA91D5CA44A43ACA8A96BC823B3EAD39 /* server_interceptor.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 797DC204ECCEA4793FE955D926F86063 /* server_interceptor.h */; }; + CAB827FEF92F5CA1CAB3A2A1E6C7E25D /* health_check_service_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EAD0C9EFB2E3180C2DBFAF8CDB9150F /* health_check_service_interface.h */; }; + CADADF5E53EEF58F5FBEEBF7570F8BD9 /* channel_stack.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 3A3D937FB23127FB2863991631314588 /* channel_stack.h */; }; + CAE0F5113EFA2C0137F068939F85BD0D /* channel_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C76AAF707C9DCFD37E241EC010011B8 /* channel_filter.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + CB0308EB70E1C85C880B0E61A30C27BC /* pb.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CFB930C45A98DBDEAA7F0D80DDB556 /* pb.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CB19EBA6A664A894DCF6BD0C2D97E837 /* GDTCOREventTransformer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DCFD02AF1A42B83B122A97E0062D3B0 /* GDTCOREventTransformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CB1F8C2656255089D2A7F26671EF64C9 /* authority.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8458232314DD82060D06DB2B6FC52765 /* authority.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CB42ECF6D3C3A59F0CF8B68A784337FF /* aead.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEB2491ED23AABC904F7B1B658C7D8 /* aead.h */; }; + CB4F93ACB08982EFA0887E22DE340015 /* stream_compression.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D4F1ED5380B12CD82F023BA482367C0 /* stream_compression.h */; }; + CB6B00E1C1708AA887C1D3414859C90E /* p_ec_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = EA2BB2CFA51B1AA7EAC1F4957188EBA0 /* p_ec_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + CB78988C9470C05496999C2D5735C54A /* ev_epoll1_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A593B29FF8456257AD9767E1EE0BBA /* ev_epoll1_linux.h */; }; + CB9B3E5AC7A3E4317DE1889043218A93 /* cct.nanopb.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BD06794CAD8EB9EBF409100605C94A3 /* cct.nanopb.h */; settings = {ATTRIBUTES = (Project, ); }; }; + CBA85F167477D408E2C4913B296AC7F5 /* map.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = F8A4446542DEEDCDADB62112CC79C290 /* map.h */; }; + CBBD5E481D6FCF208A2DA5D0DBB8054C /* timer_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = D062DE1EF6A244B83C34527A3F6E1B8F /* timer_custom.h */; }; + CBCAE88BBA5E6261C36687B1C0015F25 /* port_undef.inc in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 8540F15ED4ADD1999CB3E095288A21AE /* port_undef.inc */; }; + CBEE051A70037F682AF98BA6F215F6D1 /* health.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = 7D410CF41A7E0B4E07C0FD7ACBF5CD79 /* health.upb.h */; }; + CBF53E5740A362A7A6FA095F7442CBF0 /* subchannel_pool_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 50F386007ACFF3B0112187AAC1AE463A /* subchannel_pool_interface.h */; }; + CC01E26DF1FAF82157E68A3F76E94270 /* http_uri.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 85E4D776F4BAFAC065AFBFBFF6EE4B69 /* http_uri.upb.h */; }; + CC033DD9BB9D9B42ADA08F0F1F4A1C11 /* FIRFieldPath.mm in Sources */ = {isa = PBXBuildFile; fileRef = D40B576B9738E3339371CADBFBA9011E /* FIRFieldPath.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + CC084F0F5BBF368B5BEBE1BE01901FE8 /* status.cc in Sources */ = {isa = PBXBuildFile; fileRef = 82724BD93847DB1AB3C0ED9BACF9AF3F /* status.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CC0B06A48B6249CBAC7EF292885999E0 /* slice.h in Headers */ = {isa = PBXBuildFile; fileRef = F2B8A6485EC0A2B8CF2107C23FF00A37 /* slice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CC19415B3694282A23D484C1CE259ABA /* http.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = C1F602F381982562125C87D9DE821A42 /* http.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CC1F73E47C33719AE392DA13157872ED /* iomgr_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = D159D65B8AF7CC63ECB358FFF5AEC2B8 /* iomgr_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CC28D98C880431BCB0D1DEC0D715D4B2 /* FBLPromise+Recover.m in Sources */ = {isa = PBXBuildFile; fileRef = C8F9C45FE872D6F4C3B5FCB43ECE638C /* FBLPromise+Recover.m */; }; + CC334C0B8D60E2785F00E13A167D47DC /* local_credentials.h in Copy src/core/lib/security/credentials/local Private Headers */ = {isa = PBXBuildFile; fileRef = 04D4A1971E007FF328FBD833184AF696 /* local_credentials.h */; }; + CC5384A301D7103714B5BFD64CBD2720 /* tcp_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 7167DB962799499BB9AFCA97C28414EF /* tcp_custom.h */; }; + CC5A9588715E5DCC9F66825E0B0F43E4 /* hash_function_defaults.h in Copy container/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 98EC4006F852AD14461271C9A99F9586 /* hash_function_defaults.h */; }; + CC5CBF3F26E0EC2CCC1D3F5795F0BD0D /* leveldb_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 311A8592E4873FAE5C377D57E004F876 /* leveldb_util.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + CC792F9170EF0ADD2B71196AD80A225E /* GDTCORLifecycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 272432795AA12FE37FFCEDF06982DE17 /* GDTCORLifecycle.h */; settings = {ATTRIBUTES = (Project, ); }; }; + CCB195493868B3006D08FDCB8B82A76F /* FBLPromise+Catch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B1FD4A85E64A8BA3121F8DCCED3AC75 /* FBLPromise+Catch.h */; }; + CCCEF7CA6DBCD8F37A0CD9B94A6C2D2D /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 6B6D2709F7503E18DF89C3C065E47A05 /* dh.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + CCDDE31B28C098C0E1DD2D6574E0BBB1 /* endpoint_pair.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C8F580082C4E97246CBB58D8E9E5043D /* endpoint_pair.h */; }; + CCE752BA3F602D64FF0A54D5D5AB6967 /* civil_time.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6C6C330C425E31795232C0D7B760873E /* civil_time.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + CCEB0379CA9881992CC41B41CBAF2960 /* auth_metadata_processor.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = C29464429CCADC80A3820661FAE5D16E /* auth_metadata_processor.h */; }; + CCF3DD55B6BA8AAE0D32FAD991C5C44A /* mutex_nonprod.inc in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 05BBF7398C7A402D224160BB799B4E5B /* mutex_nonprod.inc */; }; + CD07A21B4B874214706502D468C5A497 /* time.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = A1C8009C9A7CEFF96C11B62DED1EE0AC /* time.h */; }; + CD07EC0959C2409F66F615A78DE1F72D /* sockaddr_utils.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E021F74765601E55677CEC43369B569D /* sockaddr_utils.h */; }; + CD2AA4E2F2D5747A24B48D7F4E0F8995 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C19FA528F4AA9BB34521DF059BE8F87 /* internal.h */; }; + CD3251C9DAF096DD13A3E00BA99EAD68 /* aes.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 67D9D789AF50B525348AACCFC44B20BF /* aes.h */; }; + CD3D1591A03ACA117E5F587B94296FF8 /* time_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 683463B420FCE12481D7F5D3BBC79314 /* time_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CD5F8C615ADA5B60B0246F8C780DED26 /* direct_mmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 12709ACA310AE10CD81CEB0D221D27D4 /* direct_mmap.h */; }; + CD60C2912D09B4B9FA36ECAAA05CA9D6 /* murmur_hash.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 9C5299A5EA2E3D8DFA6E4A0A512D2621 /* murmur_hash.h */; }; + CD70937ABFDB88D4F606B6B51D05E0C0 /* FBLPromise+Testing.m in Sources */ = {isa = PBXBuildFile; fileRef = AFB72065C305200D4EACB28F35716EB7 /* FBLPromise+Testing.m */; }; + CD87058648AAA5ABC4B590D145CF1ACB /* FIRComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A01EB067D0B2AB3D4ABDB0980C0EAD /* FIRComponent.m */; }; + CD9AB49061A69FD3C687D5DCDE9A034C /* transport.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 533966E56E7DAF10FFF1D26104B75F33 /* transport.h */; }; + CDAFAD927B2D1B3A1FEBCEC383D8150E /* stacktrace_powerpc-inl.inc in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = BC12C02DA0FEBD8871DB81CF851840EF /* stacktrace_powerpc-inl.inc */; }; + CDBDC6B03A115D74517D1DB7E293C087 /* x509_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F8C09D90B9AA4B989B9CF45089A6EEC /* x509_cmp.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + CDC9B4A286450FE99973248BD1F99570 /* asn1_locl.h in Headers */ = {isa = PBXBuildFile; fileRef = B90753262908732447133E9EB7EA9133 /* asn1_locl.h */; }; + CDDB83D44FCC87EF14F9D31BEB997C89 /* FIRDocumentReference.mm in Sources */ = {isa = PBXBuildFile; fileRef = 38B648D43D814C6B663D06516D926B03 /* FIRDocumentReference.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + CDE1275555BF0B25A1B8A8761F7E42D5 /* empty.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D04F00250DA3B85F9DFF84A81E710D /* empty.upb.h */; }; + CDEE241050A1F31C86EBC9A41A5C3550 /* transaction_runner.cc in Sources */ = {isa = PBXBuildFile; fileRef = E33E6DEDB8882D897B8A95E3A192A148 /* transaction_runner.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + CDEE734BA92F2251481C7ABA35D1BD53 /* tls_msvc.h in Headers */ = {isa = PBXBuildFile; fileRef = B0A2E8A49B30A409617821E5044F444F /* tls_msvc.h */; }; + CDFB1B1747BB862B8F20F7E23500F301 /* xds_client_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = C829FB38561BAE9EB5AEB66C4ED272AA /* xds_client_stats.h */; }; + CE0EA0882F3151CA4C5D07CEB570281B /* local_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D4A1971E007FF328FBD833184AF696 /* local_credentials.h */; }; + CE10685B1DB2F0B2FE82D7B55AECC1D1 /* table.cc in Sources */ = {isa = PBXBuildFile; fileRef = E3CAFBE093EF332BAEE26FD8CFAD2AE3 /* table.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CE2C25774082946FC46485DF04A348F5 /* sys_epoll_wrapper.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8768E92C1DE2FF698FBEADFD59195034 /* sys_epoll_wrapper.h */; }; + CE2C8E6E5FBE621BF4698ECE5E12F55F /* composite_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 98ABB0B301CD275ACE88D40C1D5469A3 /* composite_credentials.h */; }; + CE35463B42D7EB43B8D1E9F6EE5E8798 /* poly1305.h in Headers */ = {isa = PBXBuildFile; fileRef = A7650560AD12323E976A0A5CFA6457C1 /* poly1305.h */; }; + CE3A9CB8A02DD57D15B134D56E2504AB /* thread_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3608CD380C85A3520DDDD6E20013CEA5 /* thread_manager.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + CE4E3787183C9E022779D327E9DC328A /* service_config.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = C5C671C3A8E2619B166BB8466A4C0ED0 /* service_config.h */; }; + CE5142B6D5DEA465478CDCFE5E970605 /* block_annotate.h in Headers */ = {isa = PBXBuildFile; fileRef = A5430633590CF29EFC7B2AEDD2AA5A96 /* block_annotate.h */; }; + CE8A8638E4A099334E71FB29D6CF0578 /* resolver.h in Headers */ = {isa = PBXBuildFile; fileRef = F99567E10473566C36B7068F1EE6F56F /* resolver.h */; }; + CEA05E264DEAC2AED14A0E68A72A9969 /* rand.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 0F50FB8D47C280191AF4BDC5ACBDC7E0 /* rand.h */; }; + CEAF782C45DEC9AEB19230324B708FF1 /* transform_operation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 832C6F139A846A69D6D942898C54F600 /* transform_operation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + CEB5FF4F6078E6AC4BAD5C735F9E756D /* iomgr_internal.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E9D1E79459145589F28007C94E9EB274 /* iomgr_internal.h */; }; + CEC40E544C2DAB38AC3A779259405148 /* subchannel_list.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = {isa = PBXBuildFile; fileRef = 0AC08D791B5B330D3D95E91C9CFA364A /* subchannel_list.h */; }; + CEEBCF7B5490BFEF57218D1D3F68F1B4 /* auth_filters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5636BE4349FD1A8E5FD081A5B1B0F2AC /* auth_filters.h */; }; + CEFA39D88C45C65788D7A0DE6CEA893B /* optional.h in Headers */ = {isa = PBXBuildFile; fileRef = BA6ABD04387D25D5D76CB8B541694A7C /* optional.h */; }; + CEFA92B579D976A853654718C324A79F /* spinlock_akaros.inc in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 0D37CFF2BE60C28917E248625DD8CECF /* spinlock_akaros.inc */; }; + CF146A6B8EE237E22A272682238E41C4 /* client_unary_call.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = EE1ACE801B4732693EC7AEB4749FBD54 /* client_unary_call.h */; }; + CF244DBA49597C58CF1B69B4C4DA9E54 /* FIRHeartbeatInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 51EABC598FE1CA74FD6A098E118FC6D7 /* FIRHeartbeatInfo.m */; }; + CF33837F59A3E8AD7DE11BD183BBAD14 /* backoff.h in Copy src/core/lib/backoff Private Headers */ = {isa = PBXBuildFile; fileRef = DB0487AF4DCC51991A674B6146F2B6E9 /* backoff.h */; }; + CF38988E13B45F633DCAFECAE7ED6281 /* pid_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = 21E538E957EF219ADA6BE4D48CB7E22F /* pid_controller.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + CF4A48546EF1C65A31B8D9BFBAF7F0AB /* grpc_nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F55D3DC9E3F24EA5FD511078B41B047 /* grpc_nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + CF82EFB77DD33D2DBB7A6D0C3279C0C6 /* message_compress.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C417DDF359FFC9262AD9A311ECFFB65 /* message_compress.h */; }; + CF8AE6F706798DB85A1B3ACEB8AE0E82 /* ec_key.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 0CF5062BDF551F333806FBA6E0156D7A /* ec_key.h */; }; + CF9FBA158B58509202DFAF2FC56AC40F /* struct.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 2546A47F0D4FEDE7194ABB6CCC8598C4 /* struct.upb.h */; }; + CFB6CFC4A73EA3B4637C5E841BE23676 /* mode_wrappers.c in Sources */ = {isa = PBXBuildFile; fileRef = 5580998A6B3829A4D28D26D312CAD55E /* mode_wrappers.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + CFC606450B2C76E0A10D24F80F422A55 /* rsa.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F653C2BE231542EF8F210F9C18A07B32 /* rsa.h */; }; + CFD45FBFBD989D543A3AA260069DFE2A /* int128.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F540B5A9B6E44693FB42012CFF51A28 /* int128.h */; }; + CFE2E2AC191AD1777472A891C13BA12E /* const_init.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = F5870C1FB9B406541E9791E36FD3855B /* const_init.h */; }; + D00A8608F87B2A94C83ED3C852440E9D /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1B4DC0068EB1EA0EE1ADB0F32EE0CF /* internal.h */; }; + D016D185421BA81B0C7EF6FFBF9E5D42 /* stack.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 232F344E78212307EEB43DE166DFB1E9 /* stack.h */; }; + D0469C4888693DD1E3F2531CB89AC117 /* rsa_pss.c in Sources */ = {isa = PBXBuildFile; fileRef = A6FD5677089EA9034D0A64FA02498BB3 /* rsa_pss.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D04D691AADDD41DE197E13E6B0E6D737 /* combiner.h in Headers */ = {isa = PBXBuildFile; fileRef = FA738BD4985005BC8490C1FA0F63003B /* combiner.h */; }; + D05AF216EC07255B4281D81B497D6954 /* str_cat.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 9A2639E3A9DAEFF8438C9E4BCF9A2A79 /* str_cat.h */; }; + D063E8C25C0ECC34CCF1776D354EE7B0 /* endpoint_pair_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = F455A496C1F3D69F6114BC76FC796D84 /* endpoint_pair_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D066096D2A089FCB59BB7C8918786A83 /* wakeup_fd_pipe.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 80B9DC6C22839E8DD2A57F8F22A7DE9F /* wakeup_fd_pipe.h */; }; + D074BB197E62BD6FAF1EEC8B046F2C81 /* secure_auth_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 879D1366693D17BFFD22A9411AA44EE7 /* secure_auth_context.h */; }; + D076B2E9FBCA34CB153AF3D9E15C2C1B /* GDTCORFlatFileStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B43CD33F3F1F3EF0114CE8B81660C94 /* GDTCORFlatFileStorage.h */; settings = {ATTRIBUTES = (Project, ); }; }; + D08385CCF5834881CEB06645EEF3C8E8 /* message_allocator.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = C5B3E6E383400260EACF184A4CF39998 /* message_allocator.h */; }; + D087789A8D95C4663F1D737997ABBFBB /* stream_compression.h in Headers */ = {isa = PBXBuildFile; fileRef = FC8D20028EF6AD5FC84F04049A68A6EA /* stream_compression.h */; }; + D09669FE5455983BFB94F0BB2A4B78FF /* completion_queue_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = FA955A6E8F8F84D04CCB4E379AC4BD50 /* completion_queue_impl.h */; }; + D0A1634089638E4221F50E6CC9B18F19 /* vpm_int.h in Copy crypto/x509 Private Headers */ = {isa = PBXBuildFile; fileRef = D27AE3FF2855764C3712CB4D06D4752D /* vpm_int.h */; }; + D0A8ACA28FE84DE09B93B3C70AD1D1F8 /* channel_connectivity.cc in Sources */ = {isa = PBXBuildFile; fileRef = 15379C1083DD29AB800A7782C38A7AA9 /* channel_connectivity.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D0A9D86CAAE0319A1AB9FF324F6241FD /* tcp_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 6E80008EC9FB5BEE4EEAE02CF4BC9068 /* tcp_posix.h */; }; + D0F55762F1FE45FA7985DBA1512B9766 /* outlier_detection.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 4773B12D9409994ECA18BB4B13D79E13 /* outlier_detection.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D0FB69B58173072378858B1ABD5B11B8 /* proto_buffer_writer.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = CCD1EFE89EDC32963ED5DF3D278AE53D /* proto_buffer_writer.h */; }; + D1107AC15454D3E44198E2EEA5710FF5 /* field_path.cc in Sources */ = {isa = PBXBuildFile; fileRef = 02A80276D1041E3572A13C7F7BAD60FC /* field_path.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + D110D6C747DEE31ACEC8B19D3738AADD /* tls_security_connector.h in Copy src/core/lib/security/security_connector/tls Private Headers */ = {isa = PBXBuildFile; fileRef = CE2D2DD03C29671D5CA640FDC172BFEF /* tls_security_connector.h */; }; + D11BA680C355EED34FD2A8247659E964 /* subchannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 515DE99E1A2781FD19819BB61560931C /* subchannel.h */; }; + D1331F702336983DB914576FA4E35A7C /* hpack_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 43C7929F6E2F822270B483898A8BE789 /* hpack_table.h */; }; + D1527108446AD60E0C3A123B82ABA0D3 /* load_file.h in Headers */ = {isa = PBXBuildFile; fileRef = E6FE678653823AFA359C6EFE7CACB4F7 /* load_file.h */; }; + D1579BD3B92BAAF55FD9C66336939F45 /* message_compress.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AF3CF6540C07E060296D88034CA1892 /* message_compress.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D168590CDE49C3F5DC0C55E21433D6CE /* port_stdcxx.h in Headers */ = {isa = PBXBuildFile; fileRef = 57165CAEB8D8587D8856ABC4F7664C01 /* port_stdcxx.h */; settings = {ATTRIBUTES = (Project, ); }; }; + D16ECCF9A66498E69474D3926A90DAC8 /* string_ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 577DDF8D288CD6D3EDE27C74879CDF78 /* string_ref.h */; }; + D17BA0B593961DB7D11ADD46FD8D138C /* deprecation.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 6FCF885D31138F964D4DED96FF4B14DA /* deprecation.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D17D4BB65076317943C25C15772EF1A0 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3ED4CEA481AA965C59ACC1C3661D9675 /* internal.h */; }; + D19B7096BDD9D95FDAFEB1EB92B21667 /* not_in_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 69B7EAE9EF9A21A0349C2C5A7AB43479 /* not_in_filter.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + D1A662ADFD5BE50DF22E933DC29CE1CF /* mpscq.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 933637D73C2E0FBF376FDD7CAD50516C /* mpscq.h */; }; + D1B19424E86A374D6CE0DB42E099CC5D /* jwt_verifier.h in Headers */ = {isa = PBXBuildFile; fileRef = DFEF90EAD503C39E0C1FE1AFAF69683A /* jwt_verifier.h */; }; + D1BF4BB45640F2D253C2D886A061862C /* sockaddr_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 3CBF1715FA22DDF4859F58983C96BB21 /* sockaddr_custom.h */; }; + D1DA50170C3ED245246B35EAB185D128 /* GULHeartbeatDateStorable.h in Headers */ = {isa = PBXBuildFile; fileRef = 205771B2FC8BCC1AB7D4AB45107369BD /* GULHeartbeatDateStorable.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D1E9EFA40000C373F871485845334D36 /* call.h in Headers */ = {isa = PBXBuildFile; fileRef = 81DA4CB165A8EEC88E496A06AC7CB66B /* call.h */; }; + D1EC0FE186B17246EBF8852D92731F32 /* ssl_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EDF444EA6073E298253A4A97F3AF51 /* ssl_security_connector.h */; }; + D1F36CB3251F39394FAD5D1F670E73FD /* static_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4856F247635DDFF25590A63A1EB08FF7 /* static_metadata.h */; }; + D1F50D0AB8B4F94686A460BEC26A508D /* ex_data.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = C3A968949A80360C1905158D071E4C1C /* ex_data.h */; }; + D200C36CD28F2EDA344F65AA5665F0FE /* parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = D991A77A4FAA05504D10738C573806E3 /* parser.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + D2344D66779755C8850E9C6D34AD07BE /* per_thread_tls.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DE01779F467CAAE296AEF402CBDCDDA /* per_thread_tls.h */; }; + D237DC68AF9913186757245880243025 /* call_details.cc in Sources */ = {isa = PBXBuildFile; fileRef = 21DFF18CD05CDE57222DF9BACEF5B5D0 /* call_details.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D241877A91386322A945948843D349AB /* verify_mutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = AFA6C4E167F40B32FC9C8C56A5FC79F3 /* verify_mutation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + D2519B5751A5C562B06F7776E4A75F6A /* symbolize_unimplemented.inc in Headers */ = {isa = PBXBuildFile; fileRef = E821E862169B9C48AE0585E407F38613 /* symbolize_unimplemented.inc */; }; + D26573EB16A85DF20D1B1AB00C849D4A /* slice.h in Headers */ = {isa = PBXBuildFile; fileRef = 18519B81C338C5096FC7F8AB9AF57FC5 /* slice.h */; }; + D27A7B5D8D0AD9A7606B547FB75F3AE0 /* format_request.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1AB8D181D31620F5CD2033EFCE4388DE /* format_request.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D286CEF6FB74A710B9B093CB4F0FDFFF /* ev_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = B60212C267ADB81DCD9D45751AF8BCFA /* ev_posix.h */; }; + D29A6011EDD3711E0381C0F46E371130 /* byte_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 08673AD396301BB45B9A477046C3BF02 /* byte_stream.h */; }; + D2B4627FBA56079E6304554F51B770C4 /* str_replace.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 3A831916712628AFCB8A417ECFB71FA3 /* str_replace.h */; }; + D2C9428CBDA28497C79A3D95DF0F6263 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5612F1A4C41C0FEEE7A43EF9BD4D16AD /* logging.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D2CE25007D387D1E402BE2D91420BB92 /* json_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 66D7C00648CEF99F4B33717B9637DB24 /* json_reader.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D2D53AB4E551276F2A22E09EDC007C90 /* atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = 753542788C5C091470AF4D13364A6DAD /* atomic.h */; }; + D2E97AD6CA4537DAFD6DAA9C8DE1ED1E /* blowfish.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = AD596FCBFCD9AB42760D5ECAC6D676B5 /* blowfish.h */; }; + D3287E9A865C00A1E0ACC39446601146 /* compression_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E7EE0A12409EBE28A1E990CAF84B6C /* compression_internal.h */; }; + D335C3D22265C11D400ADA63AA8B460D /* server.h in Headers */ = {isa = PBXBuildFile; fileRef = F1D041324AEF94552F612A8347FF944F /* server.h */; }; + D33879C043D8E16BEA58D9B5CFD1F64E /* discovery.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 60E4DA724A5BD20EC44D42863D5DE697 /* discovery.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D364BC8C1ED026B185CE2A1F7E1BC6C3 /* alts_security_connector.cc in Sources */ = {isa = PBXBuildFile; fileRef = CFAFB90C55F040EB8BE36A53562024A4 /* alts_security_connector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D365D88E7502E1126A0080BCDD0E68B4 /* time_zone_if.cc in Sources */ = {isa = PBXBuildFile; fileRef = A94F5E13A79FEA609854601CF6FEFF37 /* time_zone_if.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + D37A65C00F2CE4A3C42F20E17611E527 /* srtp.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 7665E9702E0012EA9C42C224EADAE12B /* srtp.h */; }; + D37E87671D054452A0DF7C9ED13491D6 /* alts_counter.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = A0BADFFC5D25B5F63F20F3D82BD3B61D /* alts_counter.h */; }; + D38EAD20DF5DD1EDE5C7E8C388B44F06 /* time_zone_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 017527197F417982A48F54CAB5BE1B53 /* time_zone_impl.h */; }; + D39746CED2D0D6B9B636A2B2842CB692 /* create_thread_identity.h in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 1971FDEC917369CE223266C795BB5777 /* create_thread_identity.h */; }; + D3A0ACC0FE5D59CDD1470CA0221D43F8 /* local_security_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = DCAD43C85B8298C22ECAFD9BE46C7619 /* local_security_connector.h */; }; + D3A1008DFC99A115F88F0368CE3D2363 /* server_callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CB28731A55CAE12BF53A8FE971AFEB2 /* server_callback.h */; }; + D3C6B4A4EF35492C35E286ED3797699C /* frame_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DBC24144AC4AE30B20D02AA76B71B7B /* frame_data.h */; }; + D3D70C5FDC3853C082C7DD2C7CFDB2C6 /* http_uri.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B758CA3A10F0A530AB2F8EF69605B78 /* http_uri.upb.h */; }; + D3F93C552840DF4E589C8B5D96F4D67C /* tcp_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = D49C703E504A3D58320C1A833ABBB8B9 /* tcp_custom.h */; }; + D40EE8C59F15C0DCC4A658C0D940DF89 /* bloom.cc in Sources */ = {isa = PBXBuildFile; fileRef = F521DC622436B91DA4F8B69523B3515B /* bloom.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D427C916078F7E62D5238CBFE969409D /* chttp2_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = B54562C4D96285F5ED299FB73E775591 /* chttp2_transport.h */; }; + D438565ECFFA4735E7210B4D0AC84B0F /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EBEFC627CDE60001FD058D2F266910 /* internal.h */; }; + D440216B7B3975B7239B47BC9986333D /* tsi_error.h in Headers */ = {isa = PBXBuildFile; fileRef = B9376AEE9CBF0723E43D5C941FCCDECB /* tsi_error.h */; }; + D44CB3B9C6A222C989357D69162E6B86 /* tcp_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 1723A5C0C342EAA87D9AE85B9140E563 /* tcp_windows.h */; }; + D4508B8C8C1683A812DC3EBE5DE169F5 /* grpclb_client_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = C748D5F0B1DB94E7F4C21469C988B672 /* grpclb_client_stats.h */; }; + D484D4DFECA196C97235AC0AD29C0DD8 /* testharness.cc in Sources */ = {isa = PBXBuildFile; fileRef = B76BA64695FE756F1CEBFD90E1C045F6 /* testharness.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D4C042F85E92F2624669EBF8A918A1EF /* connected_channel.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 2DF8997B901EE96A89E8661A022BEC92 /* connected_channel.h */; }; + D4CD0AA4F3D04C14D5C112F1FA9DB7C3 /* compression.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = AB83EE49690EDC3506C1F03D9AD4DB2D /* compression.h */; }; + D4E6CFD0026C098FD02683642361E9DC /* time_zone_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 739DBC173EB03342F3CD5A61230BC090 /* time_zone_impl.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + D4F2257E9F019B0C2F8C0093F10165DD /* api_trace.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = FA833410DD39DA0A15099F28876AA2AE /* api_trace.h */; }; + D50CBA317D5E420AB0DB2E754B00F749 /* string_ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C8505F921D4BFE5EC6C0C2FB4E9C45D /* string_ref.h */; }; + D5360B28401212D3F4648E1D8F665B38 /* status_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C26E71E0BC45D4DBDEB1695B8899FBB /* status_util.h */; }; + D54400E811BBA6DB781E8EB02843A955 /* closure.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = AB974890D4BF327B904955BCF2182AEE /* closure.h */; }; + D5594B3D8D8557D785D764667E924FDE /* async_unary_call_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EB60C1294724FDC2B764EB7D5C88B93 /* async_unary_call_impl.h */; }; + D55E2E4A89C015C6579757A2F0B0B4E6 /* des.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = A38F042B47380D89B412DD983F8133E1 /* des.h */; }; + D55F2904DD0795CC9F98BD633D0FB830 /* transport.cc in Sources */ = {isa = PBXBuildFile; fileRef = 522D7AF891819896D31BDC12A4134FD9 /* transport.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D5686439DFADECDF03CB26CCACE6876D /* init.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 4FF14D280C4F0FA3B55181E7ACB9FF8B /* init.h */; }; + D577CB96FE0EC01FABACA0DF76C0D45D /* call_hook.h in Headers */ = {isa = PBXBuildFile; fileRef = 150421C9742BB4F0B119B06D89B0E8E7 /* call_hook.h */; }; + D585620FA88968480296ECB58A3C5023 /* port_def.inc in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = 3AEC022C82A3CA5856F4649FF5F712AA /* port_def.inc */; }; + D5879D7F5AF7FC394271E7A28889CFB2 /* atm_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A21288CE7FD248E5937A1691F1F6B1A /* atm_windows.h */; }; + D5B8B634BB14B0CCFBCCFD855B3AFF94 /* dns_resolver_selection.h in Headers */ = {isa = PBXBuildFile; fileRef = AF6E0F94D9485229CFE1242EB04ED666 /* dns_resolver_selection.h */; }; + D5C504E089C47CA1CFACB9A314BCA2F4 /* retry_throttle.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAF187282C131CA4DC09077C4F5F31F /* retry_throttle.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D5C8406C8137C8F79EC6FA81EDB4A902 /* ev_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = B60212C267ADB81DCD9D45751AF8BCFA /* ev_posix.h */; }; + D5D951EC6126A435A08260DCBEA7E7A2 /* channel_args.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = B118489EF3EF65E06D3BBD8008A80060 /* channel_args.h */; }; + D5E0537C0260735636724DBE648F90BE /* dh.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E153D3704EB930D7B97C84C5022DE5C /* dh.h */; }; + D5F4FA6F682E1DDC9EE449764F1B551F /* FIRAuthInterop.h in Headers */ = {isa = PBXBuildFile; fileRef = FACCD01FD4A1CE43B774B75732CB6A0A /* FIRAuthInterop.h */; settings = {ATTRIBUTES = (Project, ); }; }; + D61DEACE85B3A53A58FCB33B6975BBF1 /* stub_options.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 52BA331001F77169CEFADCBB9A58C02B /* stub_options.h */; }; + D662B112A50D097553F9D65FD8CB4B2E /* waiter.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B4CBC2E1E86CE7E8AE79BC48878FA8 /* waiter.h */; }; + D66497D23ECDF9EAFEAF2694303C2B3C /* time_precise.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = 50611EEE6D727D95433EDE3CDB41271F /* time_precise.h */; }; + D6B07AB98C2FD6D2B2BEA58476FFA905 /* http_server_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = F32757B213FB20E73CCC0158CCFD6F3B /* http_server_filter.h */; }; + D6B8DE3E8407D4734F46E94298D88EE9 /* block_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8C48F21446CE136BCDCD21F125F85 /* block_builder.h */; settings = {ATTRIBUTES = (Project, ); }; }; + D6B9B7DF23950F5E0A6770D912130974 /* alts_shared_resource.h in Headers */ = {isa = PBXBuildFile; fileRef = 4240E54F4AAF1F1901EF558A20C959C8 /* alts_shared_resource.h */; }; + D6C6126949B5F93B04EB7D02231FF1D6 /* watch_change.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6DC56AA569404671EB413B4059575E5C /* watch_change.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + D6D0A75328E39F1D96F44C5245E0FA18 /* async_stream_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = B882E42BF6F3E01E5EC81F7A55920316 /* async_stream_impl.h */; }; + D6DEA7315C582322E475E8DFE1022A4E /* t1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3DBED362B4E9BDE07141BE65A5E463DE /* t1_lib.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D6DEEEC12AEA54B78E846402E9C6BA59 /* jwt_credentials.h in Copy src/core/lib/security/credentials/jwt Private Headers */ = {isa = PBXBuildFile; fileRef = AB5ACF8E43B999D518721FCE505FF313 /* jwt_credentials.h */; }; + D6DF38515EEAFB9D3BBE1471F1983CDC /* p256-x86_64-table.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CBF28415CBDA07BC4CE1F5A5A5649B5 /* p256-x86_64-table.h */; }; + D6DF79F659B2BCD212BF6F7CD42CB578 /* error.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = DA3CBF62666DA5577546703BEC34B76D /* error.h */; }; + D6F7D70FA402A44E349A7A520CCD465A /* tls1.h in Headers */ = {isa = PBXBuildFile; fileRef = 900C43A5291423E98AC6EC97FA688DCB /* tls1.h */; }; + D6FA5FE0F405307EE4C4D0B38EAF796D /* table.int.h in Headers */ = {isa = PBXBuildFile; fileRef = E611580D32E35681680743D0C3390B3F /* table.int.h */; }; + D72359C8ABA37BFA70D13544ACF0FE3C /* hide_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = 09C4E2E4D95944579FECE037FDA0205E /* hide_ptr.h */; }; + D752B00B32A3378E105A04F7E84ED33C /* asn1_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 001B4B27E14395D35EB3A1B598BF9543 /* asn1_lib.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D75581BD9344D435AA8B1B3726EAAE94 /* ev_epollex_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 54B00FA0E63AB41FCAB76B9D4296A785 /* ev_epollex_linux.h */; }; + D755E510EFF1EC4A9A1F5028C4DB6009 /* raw_logging.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 255AEAD212B44C00052AD62866F4ADB3 /* raw_logging.h */; }; + D7613DF2BC6ECE9F31E384A69FB50661 /* ssl_key_share.cc in Sources */ = {isa = PBXBuildFile; fileRef = 075A96ABA887F30E5F0B6E9694CF9973 /* ssl_key_share.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D770403367D17A247C34627A98BD6828 /* alts_grpc_record_protocol_common.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 68B912DFA803CCB2A18DE83D740612AF /* alts_grpc_record_protocol_common.h */; }; + D77288C84A80A0F10C772CFCF0043C8A /* alts_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 87E1EDC9D257A4A6ABD96CB40C8CB318 /* alts_credentials.h */; }; + D79626F8444FB254FA14960674C19A96 /* hashtable_debug_hooks.h in Headers */ = {isa = PBXBuildFile; fileRef = AF9FE1C105714C48F02ADCBCA92D2F40 /* hashtable_debug_hooks.h */; }; + D7A7A881E62A5B7FE8D4C7923308562F /* channel_stack_type.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 4C80EFEA0137B3537C4392910BD6EF74 /* channel_stack_type.h */; }; + D7AF0BBB850C059C3D3AE9BDBB9544CF /* parse_address.h in Headers */ = {isa = PBXBuildFile; fileRef = 95143C02666C136DC73EFABB655F1951 /* parse_address.h */; }; + D7B9BE7D292EA69997E75D36040D04C4 /* type_check.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 29B00A4F43EA93179CD4C8102ECB5083 /* type_check.h */; }; + D7C4AB545EB88B0D8F42343CE050118D /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = FF65EAC59A0CED510C1F98D3618BB018 /* sha1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D7C8D15390FA38717F90A750CE162FB8 /* FBLPromise+Testing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F18E7687A7A6D07648D7178E09B2455 /* FBLPromise+Testing.h */; }; + D7E72E184D1423FB8D17314DEDC291DD /* hpack_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 43CE1AC53A26F98B286ED83375EE2FF0 /* hpack_encoder.h */; }; + D7E87C930618F0D9DDD3A9E18E305A96 /* cfstream_handle.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 48F9284EBAC70D1E68FE63520EFE0BC9 /* cfstream_handle.h */; }; + D8310CFA4993008D3CF84E6A0832B0AF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + D8477C966F7DB63EE9B045ED08E04672 /* FBLPromise+All.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB11948F88B998DA11F5993B19FED1A /* FBLPromise+All.m */; }; + D852FA6EE49E83E434E73B979F2B1ACD /* channel_stack.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A3D937FB23127FB2863991631314588 /* channel_stack.h */; }; + D85A2FF10AD8CF9702BEEF4C8F3A0963 /* symbolize.cc in Sources */ = {isa = PBXBuildFile; fileRef = 85604F44CA83C0ED88AB459B44401B9E /* symbolize.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + D867E6E82E617540746A01BAFB3D9EFF /* global_config_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = BB6F9EAE8F8836E40C9E2A82CC169BF0 /* global_config_custom.h */; }; + D87164C5D399F8EE5BFF1592ECACF3ED /* connector.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 7073AB33F73D3CDCF28DF09E42E111FF /* connector.h */; }; + D872AD4A9A2981B1F68C54F02882A1E9 /* unix_sockets_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C909D2575066B9D55D407688BC220B8F /* unix_sockets_posix.h */; }; + D8735DFD1E28808015FE11E29BA4D58A /* des.h in Headers */ = {isa = PBXBuildFile; fileRef = A38F042B47380D89B412DD983F8133E1 /* des.h */; }; + D89A7AC359A21480E83EC1C426C9A55E /* pcy_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 98A3DA4893A5A28934517CD32A000891 /* pcy_cache.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D8AF50D46ED25A1BE8E0E5C84E6D600B /* tcp_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = A4B51A89D051FDBD18FF5341E0E97334 /* tcp_uv.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + D8C6687DDEDF2313835DF3B176EE6522 /* subchannel_list.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = {isa = PBXBuildFile; fileRef = 8F8D52B2C57098447E1AFBFB5325E1EB /* subchannel_list.h */; }; + D8F7ECBA9D5AD60BA1680C522D20A7E3 /* sync_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 90875E12404A0AED3656F876411F7B2F /* sync_posix.h */; }; + D8FAF12024C5CED3225CD29B6FBE9296 /* a_utctm.c in Sources */ = {isa = PBXBuildFile; fileRef = C1F38D55C8E30A661DE2C27721FD3E20 /* a_utctm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D900E385C00046F73C76CB5D42FC5D27 /* FIRDocumentSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 508D71FF61612BB5C3FEFFA0245D5903 /* FIRDocumentSnapshot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D906EBF0749A15583A64C704849205DB /* grpc_alts_credentials_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDAB9FA4CD49F8B5ED138AB95764BF7 /* grpc_alts_credentials_options.h */; }; + D91601E7A691DB19E52D674C09336F6A /* cycleclock.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 7B57CC3581A2F1C36A41FC92FD471066 /* cycleclock.h */; }; + D921AA46FB29BF81B478187F52B57D15 /* resolve_address.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = EEB3759F7A0F39B804221B3B53DDA1EB /* resolve_address.h */; }; + D923971B75B8DA1CBF9CE82A6976C511 /* div_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = A18BB1AA798E12F9EBFFE675EADB83DE /* div_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D9309D2AE51556512BA8BB5EA89B446D /* trace.h in Headers */ = {isa = PBXBuildFile; fileRef = A32279DF47CB815E6A6DAA6FC92E81F3 /* trace.h */; }; + D96C17802041D9C33DCA1909AB7EE0DD /* pkcs8.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E02D2539BC68BCE4F8E801127350935E /* pkcs8.h */; }; + D97D4BAE1C9A48F16CBCD0CA52343D9F /* FBLPromise+Then.m in Sources */ = {isa = PBXBuildFile; fileRef = 044B747742E07C2B1C0BEBF2FDDE7748 /* FBLPromise+Then.m */; }; + D9887A55FC1CE6879C659744BB8BF94D /* grpc_connection.cc in Sources */ = {isa = PBXBuildFile; fileRef = 00F9C00975F303BF8DE7F221D6FCEB86 /* grpc_connection.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + D994C7D24A2AA0BCBF09F2832337297F /* obj_mac.h in Headers */ = {isa = PBXBuildFile; fileRef = D9C6A04D472A4D24C7D78EE9F581CE8C /* obj_mac.h */; }; + D99A0D21B0207E13FC0003F5867F91A1 /* json_token.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EAC698C4F4564B197311DBE5D5B93F /* json_token.h */; }; + D9CA0AB5BF688DC9015C652A7CA264C5 /* dynamic_thread_pool.h in Copy src/cpp/server Private Headers */ = {isa = PBXBuildFile; fileRef = AA6CD30588C39DABF9AF0A185DBD2A3B /* dynamic_thread_pool.h */; }; + D9D9B3B80B29D8C5992CED82F97964CF /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = 73ADC394E1256ACBFD87B2FD254B30E1 /* rand.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D9D9F143463AD40D2EDEBED49175C317 /* tasn_fre.c in Sources */ = {isa = PBXBuildFile; fileRef = 2FF4343C8A0C8538837D09BF323823C5 /* tasn_fre.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + D9F28A38E2E9D09967922314E9BC6699 /* status.h in Headers */ = {isa = PBXBuildFile; fileRef = 85A207A4B852EADD49DBB92DA94DC3A4 /* status.h */; }; + DA00DF11228DE8582CA0F56BE9491232 /* hashtablez_sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 697445CA7A17A5B802C3D19D046B6AB9 /* hashtablez_sampler.h */; }; + DA077C123D7A711B69BD60E27FF0F884 /* handshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = C890CAD79CB25BC6F37D1A02E532AF00 /* handshaker.h */; }; + DA09B84DA76DBCD42DFFC706A38ED94D /* lb_policy_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 18E2773333D37D79898DCF455DF4463D /* lb_policy_registry.h */; }; + DA1B7157415B7E994D0C7014820A203F /* endpoint_components.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 21F061F543BD2B7C5A77DF17DE9EF163 /* endpoint_components.upb.h */; }; + DA304A8D502901B51C02AA8DE0A7034A /* table.int.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = D52A4A005D866346A987BA9AB8FB690D /* table.int.h */; }; + DA7F7D5EA499ADDBB53A68F8E2A75ACC /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 756A14A84A126F04022E146D1A67F7D4 /* sha512.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DA82E9D2CAEF99E104A40C77982C15CF /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = {isa = PBXBuildFile; fileRef = 451C4CD4076AF2620CADFDF3B55A8248 /* route.upb.h */; }; + DA93FAB08BFC54934E15B5043B82400D /* cpu-ppc64le.c in Sources */ = {isa = PBXBuildFile; fileRef = D193F3BE2E8E8EFAC3608999076B70CA /* cpu-ppc64le.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DAAE7A67DBE0EADEEBE1243C1AD4DDA0 /* frame_window_update.h in Headers */ = {isa = PBXBuildFile; fileRef = 1450166D6224B9D3744B09172A7EBC19 /* frame_window_update.h */; }; + DAC70E1AE02E6D3A15856664D54F4EF8 /* child_policy_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = EFB8821C2B01004562A7683C2880B9C1 /* child_policy_handler.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DAD484F74CF4569B5B6FE14138AFC273 /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = F7B65AC4592C7EEA55B70BBEECB2A919 /* hash.h */; }; + DAE03785A48AC969630411E050603CD7 /* channel_argument_option.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 94B99171C07D2E616847F8CC1E620728 /* channel_argument_option.h */; }; + DAF8326657D3784F22F1BE137B185D3D /* b64.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = DA7BC2043F5D30ECC6235DF242F8DD6B /* b64.h */; }; + DAF9C703225F9CEB70F610CB7849B386 /* msg.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = ABB914CA2D8F559EC70238FCF503BCD0 /* msg.h */; }; + DB0A8BC4F7CF6331716F283FE9EB7F0A /* resource_quota.h in Headers */ = {isa = PBXBuildFile; fileRef = F17E4FD2F23A37F6AFA7CAED1D2F6C85 /* resource_quota.h */; }; + DB11F16054A89329AEE25D710AF86683 /* frame_ping.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = C0FCC9F65B74D5C5872E549E75D35474 /* frame_ping.h */; }; + DB14A87BCB9DA924353FCDA6986FF906 /* numbers.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB098768D6E55818F430EB6C4612D19E /* numbers.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + DB176316F3F6111EFDD7167A81E12072 /* FIRCoreDiagnostics.m in Sources */ = {isa = PBXBuildFile; fileRef = A77DB249AE8630BD91CEE0413AB157BA /* FIRCoreDiagnostics.m */; }; + DB3180F3825D0C1AF7A7F9287CBA880A /* timer_heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 341BD3517E4F990FAB166795F3C151A3 /* timer_heap.h */; }; + DB393F9EA17195422B7BF2847F70773F /* FIRComponentType.h in Headers */ = {isa = PBXBuildFile; fileRef = DC6B33792F33E8EB3FC539DE92C0D36D /* FIRComponentType.h */; settings = {ATTRIBUTES = (Project, ); }; }; + DB39ED2F6584FE889BB1F2E2DEB85DB3 /* client_channel_channelz.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3DAC5EF5EB9DD36C3EF7364F17FAD0 /* client_channel_channelz.h */; }; + DB4EE7AED03D820723AFA6A714FB713D /* port.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 853D2A565D62967727699E29EF2CFB9E /* port.h */; }; + DB671E8A4DC9FF7C7929DFDA92FCA80D /* trace.h in Copy src/core/lib/debug Private Headers */ = {isa = PBXBuildFile; fileRef = 608520DF27379759B955051E218A4119 /* trace.h */; }; + DB67F353ED3C667559237754B9468E42 /* abseil-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 864AFAAA65DA21BF2A41FD914BB15027 /* abseil-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DB6FBACCB678C706CFE58E4BACC2CEAC /* iam_credentials.h in Copy src/core/lib/security/credentials/iam Private Headers */ = {isa = PBXBuildFile; fileRef = 79B0271B775AEAE70F68A6C7694DA390 /* iam_credentials.h */; }; + DB7467BB2DC8559A4027C1420D18990C /* deprecation.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = {isa = PBXBuildFile; fileRef = 4E0F85E01AC964655BCE72E2314B9B7A /* deprecation.upb.h */; }; + DB833FC36113E9E177029BBD1A45AD38 /* ecdsa.h in Headers */ = {isa = PBXBuildFile; fileRef = 6332265BA97DCBAEEB18C2BEBD8BBEA5 /* ecdsa.h */; }; + DB9281CB8CFA9FC97C8BE9788193DB5E /* avl.h in Copy src/core/lib/avl Private Headers */ = {isa = PBXBuildFile; fileRef = 51FB1A769C688D0A641D42290CEEB1C7 /* avl.h */; }; + DBA37A453E1A429C11551CD0A9F49A39 /* status.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = F102DCA4D8E69C333CBCAF1AC6FBD408 /* status.upb.h */; }; + DBA4615561F8037F5D9D83BAAF17CB12 /* v3_pmaps.c in Sources */ = {isa = PBXBuildFile; fileRef = AEEEEDC0BBB4927EDB158F6C26F19DF9 /* v3_pmaps.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DBBDD7755046847D3F8FE8A0C924A30B /* async_unary_call.h in Headers */ = {isa = PBXBuildFile; fileRef = 87629CC7AB3D5C63FC604777868B6FCE /* async_unary_call.h */; }; + DBF0A900E75F07C299A55E90FFB69E51 /* socket_mutator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FEDC036B519DEEE76ACE73F77F058B6 /* socket_mutator.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DBF2EBA778F508C27718BDE47CBC1DB2 /* transport_security_grpc.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 3035EBD8934F19F344CB2450BB32F009 /* transport_security_grpc.h */; }; + DBF7A85218CCAECE522DF86BF3207675 /* auth_property_iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BEAB20D74799C10CD5D7FDCF954F7C7F /* auth_property_iterator.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + DC0259F3C6CCB59F73FB0AFA733F13F3 /* grpc_ares_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 374133BF7EDBB2EFEE3F257750EF244E /* grpc_ares_wrapper.h */; }; + DC26116F7C614DB4B9DDC3F5BE8AED9D /* executor_std.cc in Sources */ = {isa = PBXBuildFile; fileRef = 727C3F47E92394D30AE82A7FEA783126 /* executor_std.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + DC2D627AD6C390AB8F13EC6D19C4C92F /* connect.c in Sources */ = {isa = PBXBuildFile; fileRef = E6C88DEC6DE3D2A3B1C8889940473042 /* connect.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DC42E71D05D3E47FFC064F071640E662 /* GDTCORUploadCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DF9F21770FD8304AB8E04FD2CB0FE25 /* GDTCORUploadCoordinator.h */; settings = {ATTRIBUTES = (Project, ); }; }; + DC4B6EC40C736B51F2B478F42569FE30 /* orca_load_report.upb.h in Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = F92F53BEA7101FF595D02B9B1054C9C4 /* orca_load_report.upb.h */; }; + DC4EE07B0A5412DC2BD537B7BEEA4885 /* log_severity.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = F89DE2BD98F44628A3F9C6E095D66E03 /* log_severity.h */; }; + DC77025E0DB2040DF9F384FA2F8516E0 /* exec_ctx.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 511739E7E7C1E7FC6C57CD61A8F794D4 /* exec_ctx.h */; }; + DC94685FE177642C5ADDFB5A4246BF00 /* uri_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = ABCC5141DEB28F508919BD050C07F49D /* uri_parser.h */; }; + DCB464AFC2702719823B1915CE874A23 /* status_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12F0D535527BE5219CF713151D2E6E28 /* status_conversion.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DCE2D17844375D26996216AEC1BBF61B /* connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 7073AB33F73D3CDCF28DF09E42E111FF /* connector.h */; }; + DCE583BA3ECAC2CE2D849C7332600C70 /* time_precise.cc in Sources */ = {isa = PBXBuildFile; fileRef = 75525DB2C4D4193F51A3A235949F1C01 /* time_precise.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DCE8786C73A67DAB9C1FEE5DD2D8E1DA /* digest.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 940C94CA3A6B8836C7377E1BED8EFB97 /* digest.h */; }; + DD015E2499685CFE94799EC05E32F949 /* cycleclock.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46759EE4919B288A782AEBB1A7DB42DC /* cycleclock.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + DD07E6B592F549031B3B990A6C2B911A /* get_current_time_chrono.inc in Copy time/internal Public Headers */ = {isa = PBXBuildFile; fileRef = EAF81A6A3D2B449128E7B49128E989E6 /* get_current_time_chrono.inc */; }; + DD1138D0F02D4D7FED00D63B8413B147 /* grpclb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B0D4F4EEE4AE85072814B6355F52787 /* grpclb.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DD45CFA494725BC2973AD5B7C3180302 /* asn1t.h in Headers */ = {isa = PBXBuildFile; fileRef = 2155A84DEC3E9F9E032992F56BFAECCC /* asn1t.h */; }; + DD4D6A8E8B15C6A32878E4041BB7AF4A /* workaround_cronet_compression_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = D6F4C064A3488B846AECA0EFD4E63363 /* workaround_cronet_compression_filter.h */; }; + DD713203418B726BBEE5BB42AD2D6EBA /* string.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = {isa = PBXBuildFile; fileRef = F46F19261670AA0D96E6494F0C02F67F /* string.upb.h */; }; + DD9E6EE72AF303DE32697B910ECCEBAE /* server_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 87E31D3E0C681884709B709A5913C273 /* server_builder.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + DDB88EEBEAAD3C2989D6DF405EAF58EC /* ec.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = D08A7E6F91DB7B01CF0FEAEE5AD4DDBB /* ec.h */; }; + DDC68D1BE4E6B1EF8882DA1F0A18CFD6 /* target.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = BF0A8F53E46B4EABBCF9C8F623CBE3FB /* target.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + DDE2FF0A8CAB9A39CCD7713A324D0F75 /* byte_buffer.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 120A7E8EDD868C0D9CAD56A643E7C869 /* byte_buffer.h */; }; + DDE385BB902E020597B36D5A311F9C43 /* type_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 2439C8F4E63DBAC7CB1F852ED86C6F3A /* type_traits.h */; }; + DDF1E9AEA33DA8206C9AB05D640EC4D7 /* two_level_iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 38341EF01EBCAA31235B83E4B61B51A6 /* two_level_iterator.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + DE00FEF0B64BEEA44CE5F50070E07E29 /* handshaker_factory.h in Headers */ = {isa = PBXBuildFile; fileRef = 45979CB70BBD7D08B85AD8EBF2E94BF7 /* handshaker_factory.h */; }; + DE032411E29C742D61EDA7BB0AE99A40 /* endpoint_cfstream.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 1E91F82DCB0AECFDF7CC2719334D1909 /* endpoint_cfstream.h */; }; + DE166A7DBEEB0AE072B8102C97EF22C8 /* fuchsia.c in Sources */ = {isa = PBXBuildFile; fileRef = 3734870221525279DFF5056604225D14 /* fuchsia.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DE19A126672D9F64E6B2104F4D40510A /* channel_stack.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D673EFA5DD266B72426A27401141D0 /* channel_stack.h */; }; + DE25CC1E40356188395783B5A8D98273 /* ordered_code.cc in Sources */ = {isa = PBXBuildFile; fileRef = AD5BCE0A02A0C91F4F19722BF8489C03 /* ordered_code.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + DE3364054F573EB37231D0FA91D5BD38 /* time_averaged_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = B41BCAD368F263C1DAB21DC55094978D /* time_averaged_stats.h */; }; + DE3D650BED050C6CF3FD33C1D78DBA60 /* e_aesccm.c in Sources */ = {isa = PBXBuildFile; fileRef = 2719DE982895D28FF4FEB2206C2A9646 /* e_aesccm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DE42B4B59CCEB3B0E46E43B1CEB2E435 /* nid.h in Headers */ = {isa = PBXBuildFile; fileRef = A8057155076411DB6A73027FD64C60AB /* nid.h */; }; + DE594D9EF9D7FD32B30E293F6FBFE4D8 /* check_gcp_environment.h in Copy src/core/lib/security/credentials/alts Private Headers */ = {isa = PBXBuildFile; fileRef = BF7A15CECB726366A97C598EAAD3BE36 /* check_gcp_environment.h */; }; + DE765937C5C203D90D1844E9676926CB /* completion_queue.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 0669EC87902A174C07ECC27922C9207B /* completion_queue.h */; }; + DE7BC25D4E46DF803B33733528ECEF78 /* arena.h in Headers */ = {isa = PBXBuildFile; fileRef = 943A303D5607C52627215987F26B043C /* arena.h */; settings = {ATTRIBUTES = (Project, ); }; }; + DE9091B337FBF9F24EF31FF8514C5A29 /* ssl_versions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 542C4EF5C2D25D913A7482A7635E83CC /* ssl_versions.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DEB7B367C652BA7F8FC6AA256BC9F7FE /* resolve_address_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8103890F95891B388D7F9E5FB8E2BA /* resolve_address_custom.h */; }; + DEC18068B374D89528B87A30B34B1DD6 /* socket_utils.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8A82A7E8392D43AF8038FF0F727AD5AB /* socket_utils.h */; }; + DECFF604388901ED57FB4EE793BB6130 /* thread_annotations.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 4C82291FEEAA7FF8E6C5EC9B97B0CF94 /* thread_annotations.h */; }; + DF0BF6D8389134D748D7ECBF77321C7F /* socket_mutator.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 4489DC4322E7344AA9026192381DCCE7 /* socket_mutator.h */; }; + DF0F89D40DEE322C4DA8783DA103509C /* load_balancer.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 2ED964BC4D3AA82AF91695733999F97D /* load_balancer.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DF1330B56927AD92BE5733AFB426F56C /* httpcli.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9848FEB0957948F515B0706923D185AF /* httpcli.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DF1981B116BC3ED69355E348140964BE /* thread.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 8F609D6FB2C573ED1D71736277080C20 /* thread.h */; }; + DF49CE050EEFF65687EE4A10B40B9A64 /* endpoint_cfstream.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 2ED5D8708E746EEAAA8F20FA079BE5B4 /* endpoint_cfstream.h */; }; + DF524BA530D34844DFFFB3D7E2F01A27 /* settings.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5E37DB0C1F4047AD767EC6194FAC8133 /* settings.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + DF8E4DC298BEC7C8FB5FA0D8BF47037A /* ref_counted_ptr.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 6FBF2A1D0779AC838966FA963A60243F /* ref_counted_ptr.h */; }; + DF97084FA799BDFF880C03F0F1D64B16 /* server_secure_chttp2.cc in Sources */ = {isa = PBXBuildFile; fileRef = 995F520A6943DE6EFE5EEB50D42738DE /* server_secure_chttp2.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + DF9C86DA2C1675656461087986281B03 /* gogo.upb.h in Copy src/core/ext/upb-generated/gogoproto Private Headers */ = {isa = PBXBuildFile; fileRef = FB4E17CA503AA15A2D1C6290A2B7CE5D /* gogo.upb.h */; }; + DFBBF0897C7AFFBD95E723547D6A7754 /* iam_credentials.h in Copy src/core/lib/security/credentials/iam Private Headers */ = {isa = PBXBuildFile; fileRef = B7442BB3F818B96D0B920E14ACB75FB7 /* iam_credentials.h */; }; + DFDECB0039B0A7F4892491DA20A24C3C /* dumpfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9308446BF8719953240026D5E0D0165C /* dumpfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DFE379B6DE18398DA740D150C51BA0E9 /* digests.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F1A12C64E72845D4AE3E7E75AF41A9F /* digests.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + DFE576315CF81F49AB0464F3AE7A1DF0 /* alts_record_protocol_crypter_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6BA8F1D6B4002E7BC3FABF863B280A /* alts_record_protocol_crypter_common.h */; }; + DFE8D084D6D07453D9B672B85687E8A7 /* is_epollexclusive_available.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BB144CDCE0996B1EB850A6F510E0DB9 /* is_epollexclusive_available.h */; }; + E00354D9ED82D4C53DE5C9F24846369A /* Pods-SaraAttended-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 59BE8FCCD6F11C97F01F3A68EE0A1598 /* Pods-SaraAttended-dummy.m */; }; + E017C02A2F08EE05D23E647757857663 /* tls13_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 52C8327E12F9D095F285A2CDAAB9ED4A /* tls13_both.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E01BC32F18B1917502ECA14D168A64D1 /* compression_internal.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 77E7EE0A12409EBE28A1E990CAF84B6C /* compression_internal.h */; }; + E03CFE790EA8C8F6C0E1AABCF7D3C19D /* http_server_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 119566C11E2CC6F2C68CF280E11BDC22 /* http_server_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E04950E6DCADEBDAC29B82657CFBCD28 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = DB5F4B021E7BC12C31C22C7255A1A674 /* random.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E04F2CB9E733625CAFAFE1F30B2D640A /* GoogleUtilities-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB8E7B65E7C327D476A2F3C9373857 /* GoogleUtilities-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E053AB4D38AC2CECC3B2E9BABB7D6751 /* socket_factory_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = BA89020A58C9CEAFC4D18F0F7D08B551 /* socket_factory_posix.h */; }; + E0826360D46EDEE13F986804C03DB3F6 /* resolving_lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 9078ABF4885664441CEBC7C246515245 /* resolving_lb_policy.h */; }; + E093ED601BC39CD66B7644432DD10E07 /* client_interceptor.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 0958C4BB5B66784FC1D759AB158E5507 /* client_interceptor.h */; }; + E09919E1AEE0F014954151ACBF73031F /* PromisesObjC-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CCABD3D5279855E5536DE3F2F51E31F2 /* PromisesObjC-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E0D00F76925E1E345987A52F62CE60B5 /* ber.c in Sources */ = {isa = PBXBuildFile; fileRef = 1C93B1A77D72BBDB26A32F49BDB8B4FB /* ber.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E0E941A5C69E26ACF2D9C2988D781B9F /* is_epollexclusive_available.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 8BB144CDCE0996B1EB850A6F510E0DB9 /* is_epollexclusive_available.h */; }; + E0F04BB7AFEA4A3F5B791AB5E3B56E15 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DC7DB6E71A31FD235556787BA8ADF4E /* UIKit.framework */; }; + E0F4E63C75E773CB9C39E9161427BEA9 /* address.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 112C1E3B3A05AE0271459556AC54B570 /* address.upb.h */; }; + E0F8B22B57C6EB249099C74FB0B479D1 /* pollset_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 25592B2A61C69BF28CADC8150043D35E /* pollset_windows.h */; }; + E102A41DDFE959564AEB12D4A0E1B535 /* internal.h in Copy crypto/x509v3 Private Headers */ = {isa = PBXBuildFile; fileRef = 699DA49F293CA45ABB3014D681F33C16 /* internal.h */; }; + E103F4FE07AA71A9F54D1587653E810F /* ecdh_extra.c in Sources */ = {isa = PBXBuildFile; fileRef = C4F26573BCE94BD7C3312652A786CA78 /* ecdh_extra.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E12FC5F96355DCF20CB0474D080324D7 /* eds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BB92693CCC64385D2FF6431D7890F1E /* eds.upb.h */; }; + E1452B93A7B8698A16738FB1BC919654 /* method_handler_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A91C14F7189A43A5B0078E6950800DA /* method_handler_impl.h */; }; + E14799D5BE19E8A8252467E81ACF5614 /* target.cc in Sources */ = {isa = PBXBuildFile; fileRef = F0A6ADBA12C11CA654BB21328411B1C2 /* target.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E15C106EC5FD1A39E38A13C3C3BA4609 /* sockaddr.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 5ED4CDF9DB6B970ECB686FFBB863545C /* sockaddr.h */; }; + E1679DB995901A8D8799127B8419A2DC /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 262B6C334E2DA4182F6E05C1BE8E85E2 /* internal.h */; }; + E1920BAA5FB9D93A916074FBC650B4BA /* alts_tsi_utils.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 9019873A1D8506818A39F7F4AF4BD0AD /* alts_tsi_utils.h */; }; + E19C929B379E9810C8BA8BAD766C1EE8 /* rsa_print.c in Sources */ = {isa = PBXBuildFile; fileRef = C17E933B460CB8BAD35A45C8547719B9 /* rsa_print.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E1C0B6E1A8AA68DC99F7593D4528458E /* mpscq.h in Headers */ = {isa = PBXBuildFile; fileRef = 92EEEBC78DE622415462CD883B6A2914 /* mpscq.h */; }; + E1D5543491348A4D83B9660A36FE4EF8 /* pollset_set_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C6A491080ED123BA2B4869AE8D95B47 /* pollset_set_windows.h */; }; + E20B1289877E5ADC2A06E08C690956EC /* json.h in Copy src/core/lib/json Private Headers */ = {isa = PBXBuildFile; fileRef = 3CC5E1FB0AA9C874CC63E06F1FBD9270 /* json.h */; }; + E22158A13C437839B2D0EF9D06D5C7C8 /* GDTCORReachability_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A590FAC573405ECFA26516B654801D0 /* GDTCORReachability_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + E24C6CF802AB21C7BD1CA0334AADBB43 /* atm_gcc_atomic.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = FFC3148D92C5C6899C9E8F04A356808A /* atm_gcc_atomic.h */; }; + E25177713C736975B05AA4C85B137035 /* nanopb-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0641ECD8129761440688E3F2FEF3D6E5 /* nanopb-dummy.m */; }; + E254213EE151942E9EDD5EB5D78826DD /* tcp_server_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 04BB4A2F1E8A7F153A34E5E0B2FF62EA /* tcp_server_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E261E4CA25416B6A586357676715982B /* sync_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D7E925E144EAD5330FA5794C9806D /* sync_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E26A1884E90C6E6AFAE4F24E3776EFC1 /* channel_stack_type.cc in Sources */ = {isa = PBXBuildFile; fileRef = 14338412315B7FC7515BCB1B997CAE6E /* channel_stack_type.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E26DEF7CC5B5B453B0F1A76EDA41AA34 /* serialization_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 630E9EC214F9E235473F8EBA91AA4447 /* serialization_traits.h */; }; + E293F0E726DAC92EF5C05B50A0C80431 /* security_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AD940282C7B916B8067C94A6E7F5FE3 /* security_context.h */; }; + E29CD90CC74C0FBF9BD3CA69D5320F87 /* client_interceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D147D68F8693EC4F25860C9BEBEA063 /* client_interceptor.h */; }; + E2A14DE1DA2C03EEA8C06165AD9F12AD /* buffer_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 429CDBFF1E41ECF06C4D98A9CB755343 /* buffer_list.h */; }; + E2A98468A5C95599563D2D172C2D421A /* FIROptionsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F9EE2F1683A930FBADA8100E120A0F8B /* FIROptionsInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E2B4B8A7635B05C6BC05423461F37953 /* alts_handshaker_client.h in Headers */ = {isa = PBXBuildFile; fileRef = C1A700116171DB2AAD92182ED70C2F4B /* alts_handshaker_client.h */; }; + E2C932AADA5439A55470743EEF7044C8 /* debug_location.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A7F1F93DF989DA34F744C4EB2B4A362 /* debug_location.h */; }; + E2E6AA86AE1CFF58AC5292248FB5A162 /* global_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = A0733CD04448701C39EEA1F5C0270133 /* global_subchannel_pool.h */; }; + E31646333359DEC71CD6814AB4A2BAAD /* server_callback.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 17CEF00AA004CFD393B09091B419187F /* server_callback.h */; }; + E31A993F58C262E68A27C449180CF035 /* tcp_client_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C10A22C20AE618E70785E07CFF47B12 /* tcp_client_posix.h */; }; + E321110D856279FBFBDD3D12086242C9 /* alarm_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = EE6A5DDFDD593F8C5874769DED9E7E33 /* alarm_impl.h */; }; + E323453A0C9AD36D2361C0312AA81EED /* internal.h in Copy crypto/fipsmodule/cipher Private Headers */ = {isa = PBXBuildFile; fileRef = 525C9EB44877774F6C84793E5D9D5E1B /* internal.h */; }; + E3654BE7A905317D776FDF74AD4D3985 /* stream_map.h in Headers */ = {isa = PBXBuildFile; fileRef = E88AC67415B807A3F70ADA80C12F5C9E /* stream_map.h */; }; + E3726A29BA78844B2C57C17A9DE5EE83 /* composite_credentials.h in Copy src/core/lib/security/credentials/composite Private Headers */ = {isa = PBXBuildFile; fileRef = 98ABB0B301CD275ACE88D40C1D5469A3 /* composite_credentials.h */; }; + E38F209A54C1AB24F29B652147F74AB3 /* server_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 725C58F525929D4EF7DCBA63ACE87C49 /* server_credentials.h */; }; + E3B78E5E7244CA407FEB4A4F90E7C9B7 /* padding.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D6642692ADA5BCA078E1B5ACDB08841 /* padding.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E3E9ED903765CDF5BB65AF86BC9ECDC2 /* secure_server_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C9785376AA160E8974DC735DAF3C653 /* secure_server_credentials.h */; }; + E3F7F8EBD9851CA5155D2ED23CDD2F07 /* httpcli.h in Copy src/core/lib/http Private Headers */ = {isa = PBXBuildFile; fileRef = 3CE9C39D8AAEE53FEACB1EB019C72DBB /* httpcli.h */; }; + E40E89288004B66277463155D057828D /* string_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7A6418A56C5DC3D60630153E76811E78 /* string_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E41D84243D410468AC576843116DE1C9 /* block_annotate.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 23E0DB0568BF85488C2420F929509F7E /* block_annotate.h */; }; + E4348A2BE4249A6C2BB7262ED9F06910 /* FIRCoreDiagnosticsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D4D184E1E29A6B73E0E27B1C87C6FC /* FIRCoreDiagnosticsData.h */; settings = {ATTRIBUTES = (Project, ); }; }; + E449940073B422C465C0DCC6D3D1244A /* query.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = B7009F7D37D5CC96B730B368C2834138 /* query.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E458F1E5A1C3F2DC6F8B12D611A7F2B3 /* string_view.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FC743841BB9DE5F288C23DF81AA50CB /* string_view.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + E466F972BF12650DC4B23ABC2DF55AE4 /* pb_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 6A5C20C43790C92304C52BE564E0A511 /* pb_decode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + E47FD20C98B516B01DFEA874CC0D9F49 /* match.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 180D252F816C445EFE273EDA89501423 /* match.h */; }; + E481900AC240DFCCC366D5231BE4FB59 /* address_is_readable.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E759C57EA1F07CB3B2FA315AC1D51E3 /* address_is_readable.h */; }; + E48C5067B1C1CCDD6CA1FF98E71295B3 /* query_engine.cc in Sources */ = {isa = PBXBuildFile; fileRef = 655F9B569AE0B266E165B9DB0468745F /* query_engine.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E4AC001CCEE1857FEB35E2BD667FC29D /* document.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7D530914D66EE4A4CFD0752FB8BBA1AF /* document.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E4AF5E259C1354731502220A22430E39 /* socket_factory_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 47FDE70C5FEC483AD9C719B313814297 /* socket_factory_posix.h */; }; + E4C9E642D3F94585A2E7830EBBFBA2A3 /* time_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 302D2EEA5F7C765B6C37A580E00C31FF /* time_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + E4ED29B50B67D36D5AB54A7BE7AD96B5 /* google_default_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = E282F6D408EB0F0B513645CDE871D69A /* google_default_credentials.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E4F181C677F318D9C0A451D3571CF3D9 /* attributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E24185D3511A625C74BB0E395BED9B7 /* attributes.h */; }; + E4F8062E2CDEB6FABFFE479ACDF8BC3A /* FSTUserDataReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 96CDF0456C64946B0AAA05382534D384 /* FSTUserDataReader.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + E4F82E1873C7935D380E5853C03FE818 /* GDTCCTUploader.h in Headers */ = {isa = PBXBuildFile; fileRef = A3D9BA366DEC557FC6ED6AFA29421653 /* GDTCCTUploader.h */; settings = {ATTRIBUTES = (Project, ); }; }; + E505EF96F69A58AEF8D23A0CFFBF33A2 /* time_zone_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 09C3C84EC1B221EB2D8C3E9EC0F80F54 /* time_zone_posix.h */; }; + E50BDF2E0A0BE7FF02FEB3694CEAC80C /* tls_credentials_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3F39F3D5A4D381899679B49E7A1887FE /* tls_credentials_options.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + E50F3341C783FA43E10F2F76D842010A /* stub_options.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = F0BA40126E444588641AC50A31C65BCE /* stub_options.h */; }; + E52386B2342B756BD513CBE27FCAD317 /* http_proxy.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = E859BF67F2B48F487375961E73FB867A /* http_proxy.h */; }; + E528D116A73A45DAA253A69D8D1B341C /* FIRApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E89C89E8C625140A3984B2D73DA107F /* FIRApp.m */; }; + E52C8B27C822EEEF8E76C4FA84B43763 /* GDTCORTargets.h in Headers */ = {isa = PBXBuildFile; fileRef = D52349A8F7412AEC80B53A04E79BCD52 /* GDTCORTargets.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E53AA3E665ACB5E938D9DC0E652A8BAE /* document_key.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8011B9576572A2EF5FCEDFB78383C91C /* document_key.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E545F4F39731AFA12384A00936BF04A2 /* alts_shared_resource.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 4240E54F4AAF1F1901EF558A20C959C8 /* alts_shared_resource.h */; }; + E550C0F8F7DBE4DFCAD5439A7123A539 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = B0B733DF6CFFB65C25C263B74B0773AB /* dsa.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E581B8C43785B885A7CADE5922011E9C /* service_config.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = F6FC809C9C4AA5E36CC4DE6CB5D47D36 /* service_config.h */; }; + E584B5FDF99FADAECACCA2AC2A34F1E6 /* xds_api.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = 2A01B697DF503C3D93135B3C0F28D25F /* xds_api.h */; }; + E586402873F908969A74D3DBE9FC4594 /* internal.h in Copy crypto/fipsmodule/md5 Private Headers */ = {isa = PBXBuildFile; fileRef = B91C24609F1C744CA97FBEAA648F4388 /* internal.h */; }; + E58CDE5CD539835E9FB9A3E31D6308F9 /* cpu_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = FE9F0215D2AF3F8BA7BB19BD77B1D1BB /* cpu_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E5946869DE1C19D009A4E50BF759CD98 /* server_address.h in Headers */ = {isa = PBXBuildFile; fileRef = A4BDDB4AAA4F4D605A47FB66B4FEE16A /* server_address.h */; }; + E59956ED993A74C0AB63940115D0DED9 /* inlined_vector.h in Headers */ = {isa = PBXBuildFile; fileRef = A6B5D45C7991471C1EA06ECDB38ECC46 /* inlined_vector.h */; }; + E5A2964C74FAC6F5CC3559772C8A4A59 /* unix_sockets_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 63B0A4F03AAD2B6EACFC450E01E290F9 /* unix_sockets_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E5A40C3C5D63F61F99033CD8B84A5A57 /* utf8.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB5A85B870F7ACC87F74840D10982450 /* utf8.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + E5AB3D18DF63CFEF962F034162B7AA99 /* host_port.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7500FDD218447E2A8951E79D047ED /* host_port.h */; }; + E5C239A944C3155CF72804417EA23264 /* stream_compression_gzip.h in Headers */ = {isa = PBXBuildFile; fileRef = D6A5855B0528D0A21B543310647FC369 /* stream_compression_gzip.h */; }; + E5C9938CD3E0A85FFC9111E20846D7FD /* fork.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B3A3153CE6675A91D4DB4C46DA9EDF4 /* fork.h */; }; + E5CC051ABE1813BEBF4D471BF8455D1B /* credentials_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1D5898EA9800D5CEA0298805255D87E6 /* credentials_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + E600E198026117A460171BC87629B057 /* xds_client.h in Headers */ = {isa = PBXBuildFile; fileRef = D7E7BD393DDAC9ADEA8450A07D2877DD /* xds_client.h */; }; + E60421ABFF97A4BB6355E11490C6EF83 /* byte_string.cc in Sources */ = {isa = PBXBuildFile; fileRef = C12D068B4C260A5B7B3E461C7940A9FC /* byte_string.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E606A633707AC0A533A4C5EF19CBBC54 /* str_join_internal.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = C678F46438323BBCB4A050D20053D017 /* str_join_internal.h */; }; + E64B6F1F679BCF79274E66D901A7035F /* method_handler_impl.h in Copy impl Public Headers */ = {isa = PBXBuildFile; fileRef = 2A91C14F7189A43A5B0078E6950800DA /* method_handler_impl.h */; }; + E668E3ADD42DA2EA0B2166D0C2D2C2CC /* pem.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = E3805AFA476B3217C1F1BF3D044E927A /* pem.h */; }; + E688291ACC439FCCEF36EFB401FFD5FC /* dtls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 410135060F6A6677272AF2FB06EDDA70 /* dtls_method.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E6D8E72BF689D19542637CC882F10453 /* channel_args.h in Headers */ = {isa = PBXBuildFile; fileRef = 2840A7C135CDC9EF86C8D46ECC0C47E0 /* channel_args.h */; }; + E6EFEA1E56C38C5118368E525A099163 /* executor.cc in Sources */ = {isa = PBXBuildFile; fileRef = 606A72855987161C2401EA9E921AA06B /* executor.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E71FD8765C36801FC4BCFC39C20C5088 /* channelz.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = E6368A41EF6D4F9F45FB7E08D37312FE /* channelz.h */; }; + E74198F572C18F10B4F03A734D9ACF76 /* channel_filter.h in Copy src/cpp/common Private Headers */ = {isa = PBXBuildFile; fileRef = 150114D1218D95652322D51EAA164063 /* channel_filter.h */; }; + E74E0D69BC14865B00E969E39A8429DB /* watch_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = EAD0B8E22BB13B12D4918CD79749CB4A /* watch_stream.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E753476441AE61DB70BD6180FCE170D6 /* timer_custom.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 1DF53804F4862E20DA49C335AE25EC7E /* timer_custom.h */; }; + E76CDCED9A88018FBDECBF3C7EA7E5CA /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8F412BEDA9A3CA749A252C7357A3E8 /* CoreTelephony.framework */; }; + E779D8C54154249F70F5C7FBA4879E2A /* server_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 99DE5ED0C45BD2BA9B0B09773462074B /* server_posix.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + E77D0B3A851E93B09CE8E7844536F0F4 /* resource_quota.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3910421BE3971CEDA899A59D46974B /* resource_quota.h */; }; + E78A3F31E9FD428538A4460C0194B921 /* channel.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = 3F5E7D4CCC09647D8B15C0FE1C6B8E8F /* channel.h */; }; + E795F3C3CCE809EE618A3D067C5CACF2 /* leveldb_persistence.cc in Sources */ = {isa = PBXBuildFile; fileRef = 215873535BAAC9EB2C2E3E28B1C42929 /* leveldb_persistence.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E79A5F9188CA0FB75B679FEC430CC5C0 /* siphash.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 255CC353C5FDA6CA1E8E6417A72A7530 /* siphash.h */; }; + E7A367C94D7849B99A112ED21927F6E5 /* metadata.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D4912D20507EF01C5F95D28A1023B18 /* metadata.upb.h */; }; + E7B1B6280EA7BBA0F0F9EB32C4E70E4B /* tls_pthread.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = C5C3298D881E6BC29AF8B4E10D80113D /* tls_pthread.h */; }; + E7B46CA548A247F855FBD0788AB00267 /* jwt_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = AB5ACF8E43B999D518721FCE505FF313 /* jwt_credentials.h */; }; + E7BA212230962BA1B70EEBE2B03C0AA1 /* load_file.h in Headers */ = {isa = PBXBuildFile; fileRef = B3FBDC6FBFF8BE3F070CE1482F5D70E2 /* load_file.h */; }; + E7C3A49440AC634243064D880B14B2B4 /* internal.h in Copy crypto/pool Private Headers */ = {isa = PBXBuildFile; fileRef = 3ED4CEA481AA965C59ACC1C3661D9675 /* internal.h */; }; + E7CB382737FBD1513E7C1AD3EED8A06F /* tcp_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 831276D94483FF24EF64BB31C8965B48 /* tcp_posix.h */; }; + E7D5CF20F29BD7AD248E38347209EE14 /* fork_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3DABE1A5226AF62B55FDFA414FCF140C /* fork_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E7DE413469BE4618699F0805C748702B /* gogo.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = E44F2ED4D0FCA1EDB6654DC189D58C92 /* gogo.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E81E89485958B103E44E97169C67B636 /* byte_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E2D58AF97F55F7E1FEA485377CE7239 /* byte_buffer.h */; }; + E838326DC9139E1B2092521C1952676E /* table.int.h in Headers */ = {isa = PBXBuildFile; fileRef = D52A4A005D866346A987BA9AB8FB690D /* table.int.h */; }; + E859667260530373D49E199FB3320A2D /* socket_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = B0938A6AD23650847BCFA32BAD6CFDC6 /* socket_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E867C2F65D157CE55B75DD0116E304A5 /* tcp_server_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 37AD10ED6129F588C06F028D72018CBD /* tcp_server_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E86C9A5534791F1F2376315C3DEDA190 /* iomgr.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 451140231B672DF6F7631B009CE8478D /* iomgr.h */; }; + E8B31FBE81FFF6E8D15C07E5F21BC277 /* sync_engine.cc in Sources */ = {isa = PBXBuildFile; fileRef = E6DDAF89CCCBB25AB51D51CF88D98A29 /* sync_engine.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E8D77B2E143D67B877ACFFF318DD6898 /* GDTCORRegistrar.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CB911B4ACF1165984AC259F22DCD40 /* GDTCORRegistrar.m */; }; + E907116099F6E07791D6AC325936FEEA /* db_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2204BD7D50BCDA31A2F94496C0395B94 /* db_impl.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + E9163BA19244AB46AC8DC2869A3F9D39 /* time.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2BFCCF5439408D90DFC33A3F6AC86FB4 /* time.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + E918208A13257A728D73FBC0D1E65C55 /* error_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E2B2F82194B0FC93C4B99EB72EDEC /* error_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + E91D0775603D7AA8D448108F62D7E762 /* secure_endpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 192D013E4F329EC347D8368FE5F558F0 /* secure_endpoint.h */; }; + E92406E7D76415C3DB8E5CDFDE5500CB /* firebase_metadata_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = CF99C8276446029A4FF42F03148B7B1F /* firebase_metadata_provider.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + E938A67C80AF85582D735CACE0A6BDB8 /* x509_req.c in Sources */ = {isa = PBXBuildFile; fileRef = D11EBFFA09C9F4CDF0C75D36AD135ED1 /* x509_req.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E93C4DB9AB1A35B769D683C936A0B05F /* p_ed25519_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = E82C09DE196166D349EACD3D25D1E03F /* p_ed25519_asn1.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + E93EC7650CF82D6D24829CE2DB0A11F2 /* resource_quota_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 932A3E5D1959D7663E90094BD34785A0 /* resource_quota_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + E945398112F1659F46C6A99986E0E389 /* inlined_vector.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = A6B5D45C7991471C1EA06ECDB38ECC46 /* inlined_vector.h */; }; + E94A8CB70DDA0F35A3182D8DDA8580E3 /* spinlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 69D2389FD8623A3C724B261FDD99F931 /* spinlock.h */; }; + E966AC919716F1472DACC8410AB1BB68 /* channelz.h in Headers */ = {isa = PBXBuildFile; fileRef = B9B8640AFD3A0D5E5D8E7B48D1AC36F4 /* channelz.h */; }; + E9A3F06D1C48A3C15919BDEAC0D02B79 /* address.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 55E380F447B00CF092B74F18F0CB691C /* address.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + E9A4CC80DC048C7B5342C85E7E421691 /* unix_sockets_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 72AD3AC6CBC8250F45B18C6AAD60CC0D /* unix_sockets_posix.h */; }; + E9C21D836EDF1A677B81CBFFA020DBD6 /* max_age_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DEACF4A3D6CF15D0970F294F8570372 /* max_age_filter.h */; }; + E9F889B7D9E3C8F6B96DB05E2BA74673 /* frame_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E4DC2D66EA32923CDD238BE04DF37C4 /* frame_data.h */; }; + EA0490EF4B27F5C73492C50A1EB63C76 /* mpmcqueue.h in Copy src/core/lib/iomgr/executor Private Headers */ = {isa = PBXBuildFile; fileRef = 7722679195318B384A72A867C5E3EAB0 /* mpmcqueue.h */; }; + EA0734BE360A5A4CEFC2C67E22937ED2 /* montgomery_inv.c in Sources */ = {isa = PBXBuildFile; fileRef = 33A6F5624C52006F1ABD137D1400130D /* montgomery_inv.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EA138CB91CFE50BCA31CD9039EED6DE8 /* server_posix_impl.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = BD6EE669E7867E6FAE6234BAEC37F3B3 /* server_posix_impl.h */; }; + EA1D285626135EB43C38499FC44F8170 /* tsi_error.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 021AC33601AC9193154A278DC0A3D897 /* tsi_error.h */; }; + EA2BA1939B569BF310DB52E97E1B2B18 /* load_system_roots_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6DA62E3D3C94FE5C42637D38DB195B /* load_system_roots_linux.h */; }; + EA2E39934EBFABD93C4EC7F744301CB2 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DD2340A293A98A49C1B9EE8423845EB /* err.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EA35AC7A61C23D1362B2CE53EA7ED076 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 133E5C2929C7B4D3823137AB4244A9BD /* config.h */; }; + EA3CB00AE5620B8AE99C8FCAF5A038BC /* alts_tsi_handshaker_private.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = A6477AED5C47C17A2825B86E3920E093 /* alts_tsi_handshaker_private.h */; }; + EA3D005A2AB5A84E0155ADBAE457072D /* fake_resolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 74687F981785848CF193542E9D404CB9 /* fake_resolver.h */; }; + EA5C05340772187860ED990F5F66E039 /* string.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = {isa = PBXBuildFile; fileRef = CAECDFECDF6874B5BE6A7DA67D4053D6 /* string.upb.h */; }; + EA69142DB63E8E8D3D53FE2687DC9171 /* client_channel_channelz.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 2E3DAC5EF5EB9DD36C3EF7364F17FAD0 /* client_channel_channelz.h */; }; + EA6A8B88417EA380764273AADEE77DC2 /* udp_server.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E1A21D662F502F91EBB1BD7C4C412ECD /* udp_server.h */; }; + EA7A13845A7FF2C61422E6701C80AE07 /* alts_crypter.h in Headers */ = {isa = PBXBuildFile; fileRef = C059B70AC0BD62C9C8C01173AAC7101B /* alts_crypter.h */; }; + EA918EC978F2F114AA61208D41F26D73 /* filesystem_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A6B0F28E4A1E1C85C8C3B0F7A8E8C22 /* filesystem_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + EA924C954A151D4765531CE9246A2A89 /* time.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C8009C9A7CEFF96C11B62DED1EE0AC /* time.h */; }; + EA9AE897E83FE3FD4FE6CD5C7F1552E8 /* a_gentm.c in Sources */ = {isa = PBXBuildFile; fileRef = 469F2002D2586FCFFD3B4A6AFE915109 /* a_gentm.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EA9D47589D6C76C218027DE54EAB2B63 /* ssl_session.h in Copy src/core/tsi/ssl/session_cache Private Headers */ = {isa = PBXBuildFile; fileRef = 1004B2FF809ADB5136C6207146F8CF05 /* ssl_session.h */; }; + EAC95B693B0749570B102AB00E970180 /* status.upb.h in Copy src/core/ext/upb-generated/google/rpc Private Headers */ = {isa = PBXBuildFile; fileRef = 2BFEA36C244F81A773B32DA6223A0AD4 /* status.upb.h */; }; + EADEC9D8760FC5AA1724EAA8715B4DE0 /* GDTCORTransformer.h in Headers */ = {isa = PBXBuildFile; fileRef = 511ED73A162181E1F436509BD4A86D64 /* GDTCORTransformer.h */; settings = {ATTRIBUTES = (Project, ); }; }; + EAE834B8EA3CC2D9FBA306A3AEE10F58 /* string_view.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = 715BA23D34A522CB34877C5D6C7BD6FE /* string_view.h */; }; + EAF614EC3D055E4C1A02C0026E64B742 /* thd.h in Headers */ = {isa = PBXBuildFile; fileRef = 729A21CC7006CAEC65ED71CC4742B14F /* thd.h */; }; + EAF9324CE77117A74B2E902A58F3501C /* cluster.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 0546C9F4A64E4E5EE7C9030601390424 /* cluster.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EB332B5805F8F00BCFE917AC307174E2 /* subchannel.h in Headers */ = {isa = PBXBuildFile; fileRef = BF4B22447247346F2D6BA25E3A38580B /* subchannel.h */; }; + EB6D879FAEF3E7DC469FC1D1708C3068 /* latlng.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8861093DEFACEF1F323166FE2D71CE9 /* latlng.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + EB84466A3EDE488A25C4C23E628099BE /* tcp_client_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = AFFDBDD9C75E5BA8A2372D3866E0BFA9 /* tcp_client_posix.h */; }; + EB9FE334D2424D28FD6D81F39355B450 /* hpack_parser.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = A6D62822281C54A60773896EAD6FA9D6 /* hpack_parser.h */; }; + EBA60359CDE511623E74CA7722134E02 /* ads.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = FF315A587D4F9A607150E883F693B0CE /* ads.upb.h */; }; + EBB0CFFD07464FBA7F71E6BFBD4C0F44 /* event_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9912B0A906B209946FD26DB5B0E0D520 /* event_manager.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + EBB27B4BCAE355A4EA9AE23386C1540C /* pem_all.c in Sources */ = {isa = PBXBuildFile; fileRef = E0D32F565C9F2C24D6E6035EB3F967F5 /* pem_all.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EBC17E8FF19AD2E48EBBF97D5A415B02 /* lds.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = FA7AB0F77D52007714D70052EB2DA27B /* lds.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EBFDBA840A207FDB27154572BE969D29 /* decode.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = AA63CC21607F5F59C9A89C589E497A4C /* decode.h */; }; + EC0AFE051F6008E991CD801CE37C108A /* vdso_support.h in Copy debugging/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 57E9B635D0E7623DDA13073D9549921C /* vdso_support.h */; }; + EC16DE330EB6742454404BFB05FDFAC9 /* max_age_filter.h in Copy src/core/ext/filters/max_age Private Headers */ = {isa = PBXBuildFile; fileRef = 5DEACF4A3D6CF15D0970F294F8570372 /* max_age_filter.h */; }; + EC64E84E716A4794E1E73ED626CA6F83 /* byte_buffer.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 2920D6AE76F6A58FCD9983528B62C48D /* byte_buffer.h */; }; + ECB6F07A06FC02EC8B88EC3BA3CA780E /* httpcli.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CE9C39D8AAEE53FEACB1EB019C72DBB /* httpcli.h */; }; + ECBD5263B865A6C720F7E4C7BE809931 /* accesslog.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = CD432985E39A59D2A752A839C6572213 /* accesslog.upb.h */; }; + ECC0840632C15C7E95BF24FAE97DC4A8 /* http2_errors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B3A25BF47C9C8ABB7FF4323152EFAA8 /* http2_errors.h */; }; + ECD0C49B48A9414CBF658186BE7B1206 /* v3_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 5B47194B7BDA928B8060159E5985E3A0 /* v3_int.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + ECD488FB1AA383ED5A2D28F01585370A /* channel_init.h in Copy src/core/lib/surface Private Headers */ = {isa = PBXBuildFile; fileRef = C04B2099E2F95F4843121C72BCAE1329 /* channel_init.h */; }; + ECF8E77962E9B80C149A65DEF0B51F3A /* time_averaged_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A098371DD345940D882B0DA9BDEA385 /* time_averaged_stats.h */; }; + ECFB4ED8C65E70C700DF88CA9044DA2D /* stacktrace_aarch64-inl.inc in Headers */ = {isa = PBXBuildFile; fileRef = 2C3876BF971373587610297E8F6525A3 /* stacktrace_aarch64-inl.inc */; }; + ED0E11ED53BB172A17DFE20AEF5FF657 /* auth_token.cc in Sources */ = {isa = PBXBuildFile; fileRef = D996893AD45476D78C31A7A4C5D01978 /* auth_token.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + ED172833375BAD8F56018C888538182C /* context.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = FEA2C9E67C4452AC95FF0E0E799F9D69 /* context.h */; }; + ED2662AD4AB8A1DF3ED096752634E8CE /* composite_credentials.h in Copy src/core/lib/security/credentials/composite Private Headers */ = {isa = PBXBuildFile; fileRef = F5E25607BD68162D90074FF9D1A0FB1A /* composite_credentials.h */; }; + ED3055BC679545945A9B2A087D6F009E /* firebase_app_check_credentials_provider_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 471B8E9831E0AE7B8BCAEF5EEA722404 /* firebase_app_check_credentials_provider_apple.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + ED376B02DEAFBB5048E8F801A660C634 /* fake_transport_security.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7158AF3EA4F8FE893DF82964AED61FC4 /* fake_transport_security.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + ED3A19F9522394D521679C6724C38EC3 /* sysinfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 330D9C1100B7FA18C2D010F351E8BC4B /* sysinfo.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + ED3D8D6F167955C718CE501AA86D9CA9 /* numbers.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E88F3326149071F9EF148B778F3473B /* numbers.h */; }; + ED478A91AB121B44AD449C7C3FBFAEC6 /* call_once.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 8CC8A3ADBDB9807C72DD61D696EB6CCB /* call_once.h */; }; + ED60D1CCB27C3A37401F7CA9AD6AD65A /* auth_filters.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 0AB0046377B280A57EAB8E730B88997B /* auth_filters.h */; }; + ED6BE707D48CF6ECE78450D6EA9988B3 /* memory_index_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 59D6F2653E8BCAC060CB891007E2BF48 /* memory_index_manager.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + ED784F81C1D4E02462299C9285E04FE0 /* thread_manager.h in Headers */ = {isa = PBXBuildFile; fileRef = C34D4943091EB3998904FAA5A6C79FC6 /* thread_manager.h */; }; + ED79C66A2C294DAB65B943EC52AAA8E1 /* thd.h in Headers */ = {isa = PBXBuildFile; fileRef = E0AFD7074CAB64C323F60EB099B7CD4E /* thd.h */; }; + ED7D26B2E0BA88B68872F80FC457F87E /* lb_policy.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5F08DE081B01255064034E2AB6644A33 /* lb_policy.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + ED97679FD98EEB82A4636C31D731DED8 /* completion_queue_impl.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 31CC97CB5DB9C22723097EBA3F9769A0 /* completion_queue_impl.h */; }; + EDA3949059B2F7C61252A9DB620AC2B0 /* pollset_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 06D6148BF61FDC5B620DDA60B37DDA84 /* pollset_windows.h */; }; + EDA7DCCCDDF763CC1E26D1F3D450EDD1 /* any.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 182541468796261FF9A289D16ADAE3B0 /* any.upb.h */; }; + EDAE12E079E853620ED08D4F9DD3C1BD /* alts_zero_copy_grpc_protector.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FB2C64DDF5C1DD923B787E0EF664418 /* alts_zero_copy_grpc_protector.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EDB1F642480E7C33DE8AE3C29649FCA9 /* hpack_encoder.cc in Sources */ = {isa = PBXBuildFile; fileRef = A89788D1A47DC75E3E0E61C6D7FAC9B2 /* hpack_encoder.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EDC3667E10A378C892D5DEA38F76266D /* channel_cc.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9281F782BB97E09594B037B5FD36366 /* channel_cc.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + EDD088C6E584BB2EB6F21505E33FE486 /* alpn.cc in Sources */ = {isa = PBXBuildFile; fileRef = FE9F9F9132B59241634C2AF133BF85C6 /* alpn.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EDD6F76C3B178D91620E3AB6539BE70C /* threadpool.h in Copy src/core/lib/iomgr/executor Private Headers */ = {isa = PBXBuildFile; fileRef = 03F8C50107A79647B6CFEF808B390797 /* threadpool.h */; }; + EDE51D9F129C4B44ABF9F4AEBE9216CA /* alts_handshaker_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E31D1C1A5A47DBC716FC276D230DA13 /* alts_handshaker_client.h */; }; + EDEE451BD8B7649209DC12D7E28C5A90 /* hpack_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 43CE1AC53A26F98B286ED83375EE2FF0 /* hpack_encoder.h */; }; + EDF1F1799393C331F91BC3E14A3E940A /* tasn_utl.c in Sources */ = {isa = PBXBuildFile; fileRef = FBD5D840A56881FA2FF3B1C64B9C7789 /* tasn_utl.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EE02FEEECA1B3885C0940AACBA08CA28 /* mutation.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1AF111EA40541007B06CA1C98A71FB97 /* mutation.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + EE119E9C350C14CC781CAB7A66D15984 /* FirebaseFirestore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 88A3FB44FE70B7E9E33EEA41F70B0C31 /* FirebaseFirestore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EE23CC76ACCB1028F23B269CEA357798 /* leveldb-library-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D091AC3E9EEBAFA30C41554EDE4AB0F /* leveldb-library-dummy.m */; }; + EE256DBCE9A26F54A1AE21D835D78CD7 /* mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 49D0032E07F75A07B74B862502700F05 /* mul.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EE54517444337CD9CD8327143E2ABE3B /* global_subchannel_pool.cc in Sources */ = {isa = PBXBuildFile; fileRef = D59A0B9DB2BF57DE8FB0F91247D3FEC1 /* global_subchannel_pool.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EE7019EDE1DC00463BE1738E5FF33533 /* hpack_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 70C105943F6DB6E5BDA3DBBE29104B3F /* hpack_parser.h */; }; + EE7B1BB3B9EB595F9DF8BF4ACC6DCB5E /* mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D42260DA44C5886C45DC8FB23001AF7 /* mem.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EE891A2BA8AC98E6AA850387B5165AA4 /* fake_transport_security.h in Copy src/core/tsi Private Headers */ = {isa = PBXBuildFile; fileRef = 753C0EF261CDDE6C75C21DABB832BB16 /* fake_transport_security.h */; }; + EE9EB991CA00A36187ED8B9FD322A987 /* GDTCORPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = CAAC3788E201C140F3F27330EC20E486 /* GDTCORPlatform.h */; settings = {ATTRIBUTES = (Project, ); }; }; + EEC1A36217D837C0E9BB09028DEDBA9F /* b64.cc in Sources */ = {isa = PBXBuildFile; fileRef = A91898EDF2231E16F7E340C782B13AEA /* b64.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EEC707748D35EA14F03B130E10BEF7DA /* grpc_ares_wrapper.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = {isa = PBXBuildFile; fileRef = 374133BF7EDBB2EFEE3F257750EF244E /* grpc_ares_wrapper.h */; }; + EECE5511C871EB8CF74BF260FF7CB54C /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = B91C24609F1C744CA97FBEAA648F4388 /* internal.h */; }; + EEDA83133FAE50322248DCDFDB067400 /* validate.upb.h in Copy src/core/ext/upb-generated/validate Private Headers */ = {isa = PBXBuildFile; fileRef = E38F8F3CAA0B133C6DD9D6B7D4D632AA /* validate.upb.h */; }; + EEDFE5A4B79084710409966C79D004DC /* pcy_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 999CBC13F0A807304CD38B03830A7894 /* pcy_map.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + EEF4A89C8BD7731847FE5EA80F0631D8 /* string_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9D04CBBBFA548BA25FA4A23088C6DE01 /* string_win.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + EEF973D4017FD11D11DA15FB4A05B90C /* stacktrace.h in Copy debugging Public Headers */ = {isa = PBXBuildFile; fileRef = 8741C6DA08968E7E1200FFE615AE7384 /* stacktrace.h */; }; + EF0E1666240FDCE445230BA5A6D36199 /* transport.h in Headers */ = {isa = PBXBuildFile; fileRef = 533966E56E7DAF10FFF1D26104B75F33 /* transport.h */; }; + EF2C1F949CA7D9365563BEE147936C1D /* chttp2_transport.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = AD0FADFA76F83284B62934281CC6AC18 /* chttp2_transport.h */; }; + EF6562FD4856AEC7CD5CC3C65939E79C /* write_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 24644CF4B9DBFC240B3FBF7A07EADC6F /* write_batch.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + EF937927C0A9BB34C8F3B677B28CC87A /* manual_constructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BAEFB567038EDFFD8219B65064045A4 /* manual_constructor.h */; }; + EF9568AED4273605DC961294F3FE32EC /* security_connector.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 8A8B64D12B101D6945DBF2E662876660 /* security_connector.h */; }; + EFA2DDFA2328F0EB200D7B03C1C64434 /* atm_gcc_atomic.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = E7959196CB1EC295C1D7EFB05C1A62D2 /* atm_gcc_atomic.h */; }; + EFA47F8989AD82AAA3ABB1AF0EE8F037 /* per_thread_sem.h in Copy synchronization/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 4C29C9928D15DDD75348B863CB3438B9 /* per_thread_sem.h */; }; + EFC7726CEFA70363BA69232579374B7B /* avl.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8303536D8311470048E22BAD7C0022E /* avl.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + EFE3D4FB0C6D6AC50A393C9613EA441B /* grpclb.h in Headers */ = {isa = PBXBuildFile; fileRef = 1254352DE4846BFEB37C5C536523E0ED /* grpclb.h */; }; + EFEA5E450C8DE328CA4D402F2E5915ED /* status.cc in Sources */ = {isa = PBXBuildFile; fileRef = 577EF0CDF949EAE1A987FB96D71A2CCA /* status.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F004819E143BE9FAD832315D4EDB3246 /* tcp_server_utils_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FC8EF4B7A4D3FBA96EBB69A2F992A7F /* tcp_server_utils_posix.h */; }; + F0117DB2784E092D5B35C2CBF68DA17B /* GDTCOREvent_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40DBDD6AFED2AF2508997CB1D7E329FD /* GDTCOREvent_Private.h */; settings = {ATTRIBUTES = (Project, ); }; }; + F02DD9BD1A5978295836823E92F9699F /* memtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 975D9514E31E8C56DDB203FBA1664BBE /* memtable.h */; settings = {ATTRIBUTES = (Project, ); }; }; + F03C37697681A9B672506D4DAA581F3A /* timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FD7727C8A00943F0820A0160818320 /* timer.h */; }; + F0624CF714408A2E56CAE81BE4131989 /* validate_metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = B6C99F15F3F7F60D14514B5520BBA0DE /* validate_metadata.h */; }; + F07053BB03672EA2712AEC1CA3F594E3 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6B66162EA7B2F1DA9F0A2B07FBDA97 /* internal.h */; }; + F0994278EEDBDA32E47862232D8205BF /* conf_def.h in Headers */ = {isa = PBXBuildFile; fileRef = 01A4CD2489007A624F5F90B257E700F2 /* conf_def.h */; }; + F09CD74F0F07CC011F66E269B00C31CE /* executor.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 7C5EF2CBC6AD04A4862AAD83FA3CD8CB /* executor.h */; }; + F09E623463C28D973B872D58175ECF27 /* string_format.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5FE7DA64DA0A2FAC82F978B8C8C214A /* string_format.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F0A3258AABAA1FFA5C292F77A9071D1A /* low_level_alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = D14D669FA9F70C2AC3B78DA3D6322BEC /* low_level_alloc.h */; }; + F0E8E7ABBE027BE7D1BFBFD48EF82591 /* core_codegen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0EE17ECFCDAAEA71E331B88DE3FD1D3C /* core_codegen.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + F100DE49F12181547856DFF7FE4C061F /* dh.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 6E153D3704EB930D7B97C84C5022DE5C /* dh.h */; }; + F1185F45A9122D305489698E3C38E72B /* GDTCCTUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 796214088AA525811BB7BD373FDF91AA /* GDTCCTUploader.m */; }; + F1208D6F5E2BF33CB2655961A299E3CB /* err.h in Headers */ = {isa = PBXBuildFile; fileRef = DD0EAF650079CBA4866283FA3ACAE404 /* err.h */; }; + F136FA01EE26F5E1FE6521152E2EC875 /* lds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 91FAA086DC2883346DE8C42D4CF7DD34 /* lds.upb.h */; }; + F14576667CE49A1A76CD67168879E6A2 /* stats_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 192682220D65CC123ECC31B83806052A /* stats_data.h */; }; + F1617BDBB567465F2309015A9B984CE7 /* iomgr_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = BD0F49082734818E144B79E58E5697AD /* iomgr_custom.h */; }; + F1851794760977907EF3045ACABA9E67 /* client_authority_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = C0D4BF860FCF3CB320E8D08BE31CB6AA /* client_authority_filter.h */; }; + F191F8AE11C0B050118FF36C8C1EEA1D /* health.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */ = {isa = PBXBuildFile; fileRef = 77F988063E3B618B1E15A040CC1935DB /* health.upb.h */; }; + F1994C67CA78D6AC4D47C4AFFFDAF96A /* server_credentials.cc in Sources */ = {isa = PBXBuildFile; fileRef = 167BD08858D39E8D6BA9D2CEAE9B3F41 /* server_credentials.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + F1A9F28ECCCEB46E9C39521EC081A1AD /* parse_address.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 95143C02666C136DC73EFABB655F1951 /* parse_address.h */; }; + F1AA5427648E73A5D005C200E1366CBE /* time_precise.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBDF21A6B5663334396CACD280FE454 /* time_precise.h */; }; + F1B2BE4B0F488AFBAC78C9B3EC051943 /* FIRDocumentChange.h in Headers */ = {isa = PBXBuildFile; fileRef = 96D041460C44DBB994E1212C7E28965C /* FIRDocumentChange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F1D8BBB4E1B35736566EC02E92A00FDD /* health.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = D9BF85B1AA5E6DC22635795555EDFC90 /* health.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F1F0085ACDF1BBDA65592B6855C88149 /* async_stream.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 335ED1B7339A2C331EAC0F23CD0F6CE1 /* async_stream.h */; }; + F1F637C4C13B1C40DA139ADD13F165F4 /* connected_channel.h in Copy src/core/lib/channel Private Headers */ = {isa = PBXBuildFile; fileRef = 365FA78B1287711599C9B8AF26FA7F62 /* connected_channel.h */; }; + F1F8DC84655B8C28C23FA7DBFB69B80C /* timestamp.nanopb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 604057E13720363AB70882472915AB7F /* timestamp.nanopb.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F1FA8F5CB5D73F19B6C2A9BA2802613F /* sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = 838EE7D040CA97C0B0579B335E85DB63 /* sqrt.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F201CA735BF9723D16B6A86242633B71 /* grpc_if_nametoindex.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = FB3B138A1856E682C0F461A346EBF053 /* grpc_if_nametoindex.h */; }; + F20D732CCF96B64F8DB1C7DA39F6EF32 /* duration.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = {isa = PBXBuildFile; fileRef = 3CCF900FF44FCAE833AEE9C6E5CE9212 /* duration.upb.h */; }; + F2132AB8F54E806D6464D96AEAD91174 /* alts_iovec_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = 9725C5F072EF77446F1746D2294B77DD /* alts_iovec_record_protocol.h */; }; + F21D6E6E2A2A17BA1F729640A10DC8A2 /* port.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = E36E31D6EAB2B8AABDAD98B7179BC73A /* port.h */; }; + F2251F0FFAB83062C9D8047CCADD1425 /* oauth2_credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = A3097B52F4E36CD1C180171702D18608 /* oauth2_credentials.h */; }; + F23E225F05148905BA8BEE9A75D95497 /* FIRWriteBatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A7244FE0A01B1C1B5532E33847085AD /* FIRWriteBatch.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + F25B7DC64870D77D9246E69E655524C5 /* pkcs7.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = B90B89D30EE6628A3B9CD306B66CBCEB /* pkcs7.h */; }; + F2625B77D80C4E05352FAC3B64016E08 /* local_documents_view.cc in Sources */ = {isa = PBXBuildFile; fileRef = E1B336B7E76A9047F6A3846EE8379626 /* local_documents_view.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F26BF9E1D436A8F7A18B2A6160E529A1 /* print.c in Sources */ = {isa = PBXBuildFile; fileRef = 705F9D7C25A4BC2347A81C6032FD0D00 /* print.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F275D63B2520BB80DABADF66ED692F4E /* resolver_registry.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 00D45ED61830C467AC4B5009EF5DC7CE /* resolver_registry.h */; }; + F2847D1251F9BC74DF1280DB653BDA68 /* remote_objc_bridge.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6C63F7A36A6F4D2A8AB38B701DED739E /* remote_objc_bridge.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F28B239B17DC8E95F8757F0971CEB3F5 /* FIRTransaction.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAC9AFDC2F9DC85EB2C00EF63D809DF7 /* FIRTransaction.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + F28EEAB3D4FEA5AAF4641CE36F57AE3A /* leveldb_target_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = A42C1ADC7346EDB1615DD7F0248971D3 /* leveldb_target_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F29F13C57B434C7BCB834342F087721C /* srds.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = DDB34E70DE46C0DBFA68657EE8AB1BB5 /* srds.upb.h */; }; + F2D1FB29B99B9D3AD426196CBD133487 /* memutil.h in Copy strings/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 3A65027B5AC3B0BEA043E518801657BA /* memutil.h */; }; + F2DD7EEEE10383EE800937ECE04C5AFA /* http.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */ = {isa = PBXBuildFile; fileRef = 7956807588DE8229B949A946CCD498BE /* http.upb.h */; }; + F309F45E8E19E728EECDE61A803AFBC2 /* combiner.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62E5E466B0FA04CFB2DC364B1C5B815B /* combiner.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F31987CB065D227AA4E2AD372F869FA4 /* alts_grpc_integrity_only_record_protocol.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7750342932155F7D2878D0BBCADB9E54 /* alts_grpc_integrity_only_record_protocol.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F32C78B49659B436E1C216F250F8613C /* stream_compression_gzip.cc in Sources */ = {isa = PBXBuildFile; fileRef = A158DE7549F420A16BC48EDD4762E5AD /* stream_compression_gzip.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F33AA7ECE49A6ADBB3DAB2636494CEF3 /* alts_security_connector.h in Copy src/core/lib/security/security_connector/alts Private Headers */ = {isa = PBXBuildFile; fileRef = 38FC04DE1D076ACF463126268796D2A8 /* alts_security_connector.h */; }; + F34D6CB8D414B6FA5A155E5289F93FD6 /* client_authority_filter.h in Copy src/core/ext/filters/http Private Headers */ = {isa = PBXBuildFile; fileRef = C0D4BF860FCF3CB320E8D08BE31CB6AA /* client_authority_filter.h */; }; + F365316B029D9D6D775385D80FB1117D /* asn1_gen.c in Sources */ = {isa = PBXBuildFile; fileRef = 223991F82BCFCC63339443E3FF0C40A8 /* asn1_gen.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F36CE0966AEB97993CE65C151E69A9B1 /* pollset_set_windows.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 6C6A491080ED123BA2B4869AE8D95B47 /* pollset_set_windows.h */; }; + F37122944A93D55430C6F05FFADC86CD /* raw_logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 255AEAD212B44C00052AD62866F4ADB3 /* raw_logging.h */; }; + F37670C0A385A8667E1E05642F58F6FF /* ec_derive.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F0FBFE524EED058041C4F427768BF4 /* ec_derive.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F388E58582671CF56A4C9C43BACAFCE1 /* env_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = E83FE6E67F31928F6E97E0162BBFAA8E /* env_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F39C91E7F13EFEC839A2773565A33EA5 /* port_example.h in Headers */ = {isa = PBXBuildFile; fileRef = C212D56249A75AF324510228EA386D6D /* port_example.h */; settings = {ATTRIBUTES = (Project, ); }; }; + F3A3AF9F6C9CFD59064BD8E71967E3DC /* upb.c in Sources */ = {isa = PBXBuildFile; fileRef = D20779E8474DFE298660E2C93AA82839 /* upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F3AF66F478BB15EB4A693554E92D635F /* tcp_server.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 380E77E7227988B903FA456F1FB2BFB5 /* tcp_server.h */; }; + F3B71905CD9356C32CA1DF0C1B56022A /* attributes.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = 7E24185D3511A625C74BB0E395BED9B7 /* attributes.h */; }; + F3D55E0F01159FB8B36BF659368A64B0 /* memory_mutation_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = AAC355D81DC8EB07A8726AF9F749ABC8 /* memory_mutation_queue.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F3DCB843F7AABC8B66C55498D52EC6B9 /* pair.c in Sources */ = {isa = PBXBuildFile; fileRef = 800E626DBE4ED7CB7F1761804AAFD80F /* pair.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F3DCE6ADFF12F4297DED54F703F90EBC /* sync_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = A491B7806FC7172EEB90073096906545 /* sync_generic.h */; }; + F3EDB6AFCC10910111BF0D29E6AD567A /* set_mutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8DF70E24F7BC596A07F9A691DDD72420 /* set_mutation.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F403C83E497072E5EFF27E4612BC6F50 /* alts_grpc_integrity_only_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = D2E5CA8009634153869F0DEE328F4657 /* alts_grpc_integrity_only_record_protocol.h */; }; + F424DA7F7FAE4A3319C9A773209ED0C2 /* v3_alt.c in Sources */ = {isa = PBXBuildFile; fileRef = 352208019ADCADE1E9569BE08E687469 /* v3_alt.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F42DE2F5956719485DE8C6E64B522B8D /* credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E4BAEAE257CE5BF099CEE6D9CFEE1D /* credentials.h */; }; + F433D46DDE9ED697B654A79AAB14D272 /* channel_stack_type.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E712B22330FB2E373E230870DE2E459 /* channel_stack_type.h */; }; + F43DB87FE177FC16D0743C1796E38D22 /* status.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = 342E064120BA4D297641CD07E942E3E6 /* status.h */; }; + F4440886DA35C0DE34B23404E9544807 /* metadata_map.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE17F5F00A1C87DA3B687F8CD8DE38F /* metadata_map.h */; }; + F444D7B28F5D9F46CAD7EAEAE669085D /* iomgr_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 905EF31577DFDD0EE1E8AA78E7BA4BA5 /* iomgr_posix.h */; }; + F445EC9FF362752175B8990E424B1CA1 /* compression_types.h in Headers */ = {isa = PBXBuildFile; fileRef = B304508F4D1BA3E6653A85511CF1C329 /* compression_types.h */; }; + F4507A4B7766FACB2CEC1A18352C128B /* FIRAppAssociationRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = C02F3C374771C1823618EC8DD2F40674 /* FIRAppAssociationRegistration.m */; }; + F4634FE2FC399AAA22D9841FF812F158 /* jwt_verifier.h in Headers */ = {isa = PBXBuildFile; fileRef = F35E1EA461D38B6A27DBB8E856036967 /* jwt_verifier.h */; }; + F4792832245D154AB9C318939CAF54D3 /* extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 70D476564D9BBCE1BD0616BF5ED79124 /* extension.h */; }; + F4D0980A674EB2695D4873177D6B554F /* create_auth_context.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = C376CA4ADCF65A427E0495534EEA6ACD /* create_auth_context.h */; }; + F4EE9FC7C2A5C914E8B03819932B918F /* xds.h in Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */ = {isa = PBXBuildFile; fileRef = D13B2E5B609C5B5BFBD8010D760DFE5D /* xds.h */; }; + F4EEEA8DF77EC8BCD1748B6353C2BC01 /* server_posix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6EE669E7867E6FAE6234BAEC37F3B3 /* server_posix_impl.h */; }; + F4F64932B22A2A9E63CCEFC15B6FC67D /* default_health_check_service.h in Copy src/cpp/server/health Private Headers */ = {isa = PBXBuildFile; fileRef = EE4D8F5ED0B55EA104AFE2858B9ABD92 /* default_health_check_service.h */; }; + F4F6DE5CBC4D11A2007B89970EB63390 /* derive_key.c in Sources */ = {isa = PBXBuildFile; fileRef = FB06D2711AA1B749D921BE1C430B49FB /* derive_key.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F5049D2569D0DD0CD8F78DB2940ABD60 /* ssl_cipher.cc in Sources */ = {isa = PBXBuildFile; fileRef = 824AF003EBE6F43313C49AA798BD7D1F /* ssl_cipher.cc */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F54557D8C0F05806B75E0AE6C3376C35 /* snapshot_metadata.cc in Sources */ = {isa = PBXBuildFile; fileRef = E8E06741A68C2304AE4184D5A7B4438C /* snapshot_metadata.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + F550A6B0EC266890778C48B2EC67B34E /* slice_weak_hash_table.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = A8FFC6BFBCF6D712799352AD3D1225E1 /* slice_weak_hash_table.h */; }; + F56B5D1F03062CE48D8966A2BF8A42DE /* global_config_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F3EE303E9B2E59CE4CC163A96BFEE5F /* global_config_custom.h */; }; + F574E917E53F2A6F90123F12323E5E41 /* format_request.h in Headers */ = {isa = PBXBuildFile; fileRef = A8B544BF694C29E4C478D06008B63316 /* format_request.h */; }; + F579727FEA18228EE59F152A085CECF8 /* orphanable.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = FDC80743B9299684E51D6A595D902770 /* orphanable.h */; }; + F57A94B10374D86C0BB95BB1AF876302 /* compression_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = 31E4E51E717262B92F1721361794F8D4 /* compression_internal.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F57F9E2F87707FBDF803E9DB05B68ADD /* spinlock_wait.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 68EF1027B77CF7A21833485066A7DCE3 /* spinlock_wait.h */; }; + F5B2F4D01EA74174C8E71109ED62C203 /* client_callback_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CF1A3CF6D75124BEB09C41029E3CA22C /* client_callback_impl.h */; }; + F5CA15EF259DA0A10619A6D797C3581A /* pollset_set_custom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7681F71B82ECA16770CE60AE10BF2F14 /* pollset_set_custom.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F5EF90C821BB2F8059A4DB2017FDCAC9 /* string.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = ACBFD264B273F8176D420444FCF5F2B7 /* string.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F5F48A0C1577861C5B012DD5C5658909 /* table.int.h in Copy third_party/upb/upb Private Headers */ = {isa = PBXBuildFile; fileRef = E611580D32E35681680743D0C3390B3F /* table.int.h */; }; + F5F8D50A2300C98E9294734417845F9B /* bin_decoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 2DCAFFC8B7C9B05A7879283CF23CADBC /* bin_decoder.h */; }; + F5FD1210511BD473EA8E8FE6F745FF71 /* bin_decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E2F7E0A38A3803B3D985992CF8E602D /* bin_decoder.h */; }; + F618E694702D82CC8B55AFC1618DE36F /* sysinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 10F7D921AD7838C910160A14EC5F5641 /* sysinfo.h */; }; + F63E101B599D6D22143F6C03BB7D6A7C /* ssl_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E4957692C9D0E838B00A0F2D9C6327 /* ssl_utils.h */; }; + F68B4C7355E00A0205235EBC15EB6811 /* socket_factory_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = 47FDE70C5FEC483AD9C719B313814297 /* socket_factory_posix.h */; }; + F69C7D711E0C0690FD2E8EDD124B4A8D /* global_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D4AE169D8ADBE9D89664991B5D6DF0D /* global_config.h */; }; + F6A2CDBC94A55CC591548EF4A8C7C42B /* work_serializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 707C3D8840963A14079CA85700DD7279 /* work_serializer.h */; }; + F6A56677CD36516422759D29B08565CF /* custom_tag.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = EB454D797281307398578203D87FEAB7 /* custom_tag.upb.h */; }; + F6B2720F0AF84A116D1AFB33DECC1E74 /* env.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = D7F0EFA07241EDB7C86BBE9C0994F124 /* env.h */; }; + F6B3FA452CB977A84259BE003785516E /* connector.h in Headers */ = {isa = PBXBuildFile; fileRef = ED3A1DC6B9FE0788D7C08386FDC324ED /* connector.h */; }; + F6B7322A232C02ECD0090DE9D45E9155 /* grpc_ares_ev_driver_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3C2674DF3DB6BF983145BF1D7CD207AF /* grpc_ares_ev_driver_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F6BEC1339882786E8A4F164C33D8A9A3 /* fork.h in Copy src/core/lib/gprpp Private Headers */ = {isa = PBXBuildFile; fileRef = F2E81AC51019F0FD3D5ECD6A75D29621 /* fork.h */; }; + F6E9C69B69A85779A7B24BBE38128890 /* global_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 5D6302406E4AA0DF6A3C104B521ECBE9 /* global_subchannel_pool.h */; }; + F6F4B7C227DD2B551800CA2E463DC01F /* byte_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3040637B0E10661A176331DB6893688 /* byte_buffer.h */; }; + F70CA3F427AFCF94C96FE6644FF4F00A /* GULHeartbeatDateStorageUserDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2784EC7FDF125E53043E97FEC1A93C /* GULHeartbeatDateStorageUserDefaults.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F712F97072133A34BBB32CF3B49A4998 /* avl.h in Headers */ = {isa = PBXBuildFile; fileRef = C43DF0BBD4AAB949A2BACC8206E54CF9 /* avl.h */; }; + F73079CB8A4458C774B4E290452598AB /* check_gcp_environment.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE6E2132EF7656B6810B0DB4FC5610B /* check_gcp_environment.h */; }; + F74522C06E9D45BD6F6B335869555922 /* annotations.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BC7A68EADA873C78CFE5C42DFD4997C /* annotations.upb.h */; }; + F7505D65945B45425AE254846D0DB403 /* x509cset.c in Sources */ = {isa = PBXBuildFile; fileRef = 4A6F04C0C1936C195A8E0877BBAC5E6E /* x509cset.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F79B2DE31CDCF2F074EC512FF13F3832 /* sockaddr_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = BBD52C3309788076B92258E6C03FDBBE /* sockaddr_utils.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F7A77C44671C799A8C4BEDD2E548CFDD /* FBLPromise+Recover.h in Headers */ = {isa = PBXBuildFile; fileRef = BD394E2AA9A6F3C1611A9250512A6320 /* FBLPromise+Recover.h */; }; + F7AE761577F8C56B926FA5DD57455C8A /* bad_any_cast.cc in Sources */ = {isa = PBXBuildFile; fileRef = C30AA0201F10E929C58BF307B5B88491 /* bad_any_cast.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + F7BE5EC1FFD92B52D7682ABAAE178CA1 /* internal.h in Copy crypto/fipsmodule/des Private Headers */ = {isa = PBXBuildFile; fileRef = C7834BFC231D585EC48892D05C85A74F /* internal.h */; }; + F7D8B4540FCD1E41301638EB08807255 /* transport_security_common_api.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = CEFB3F5141D9519858DD21AD7B723BD7 /* transport_security_common_api.h */; }; + F7D8D5B0B760C8B0BB529E1E64986A98 /* cpu-aarch64-fuchsia.c in Sources */ = {isa = PBXBuildFile; fileRef = BAB8A844CC9BF67B2CE40DF3AE15D905 /* cpu-aarch64-fuchsia.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F7E56C673DB74E524515166644512E60 /* tcp_client_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = E0D14C0FF8B1CC0F2E3D6B0F61D360B3 /* tcp_client_posix.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F80162216C65679671AF01584FACF74E /* auth_filters.h in Copy src/core/lib/security/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 5636BE4349FD1A8E5FD081A5B1B0F2AC /* auth_filters.h */; }; + F80E6054BFA31CAD2B42E98064BDE215 /* alts_tsi_handshaker.h in Copy src/core/tsi/alts/handshaker Private Headers */ = {isa = PBXBuildFile; fileRef = 561C73C1E83BD2580E9141F5AEF08ECA /* alts_tsi_handshaker.h */; }; + F822B914E8A9E681BC1B26765749A210 /* atm.h in Copy support Public Headers */ = {isa = PBXBuildFile; fileRef = 1225A64673D20C6A4389387B6DE4CB4C /* atm.h */; }; + F8247C2F5A90B76653D898ADF80B8165 /* abseil-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C88B9497962F43DFFE2E8C47A44B4670 /* abseil-dummy.m */; }; + F82B7F900AA0511146C3FBD03042FCF2 /* generic_stub.h in Copy generic Public Headers */ = {isa = PBXBuildFile; fileRef = B521EB4F00263E53A42457E5355945FB /* generic_stub.h */; }; + F83089FA4F9C7D3FA61C70314D68D24B /* x_spki.c in Sources */ = {isa = PBXBuildFile; fileRef = 89303FDAAD8DD96F373292A08440E650 /* x_spki.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F833969F8A73DC55FBB66B1E0C1AEBB5 /* message_compress.h in Copy src/core/lib/compression Private Headers */ = {isa = PBXBuildFile; fileRef = 631429BE71CD6B8B75244E3C2C2B917C /* message_compress.h */; }; + F83CD0018AD441A42513D1C0870DC85F /* FIRFirestoreSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 18ED08173DA751A2F0711D475B0A239E /* FIRFirestoreSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F859149E2E731191CE1A7262F4D7B5C6 /* slice.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = A21399A3BD7D75F80B053BEDEFFFA4F2 /* slice.h */; }; + F86572C5A8052BBB4455F9F2851468D3 /* v3_pcia.c in Sources */ = {isa = PBXBuildFile; fileRef = 54ED8DC48179740D4B09CD387DD75A80 /* v3_pcia.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F87AF7A2895FAB783CDC529C02E63BA1 /* socket_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = B57AB9958C4CE358AC4E6EDFEEDFE12B /* socket_helper.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + F8899368EF6C4EAB93097B693F9E1A35 /* migrate.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 04454E53C1A5426BD89BE12373724382 /* migrate.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F89B35006C7968E9CCA1A7DBE9AE985F /* alts_crypter.h in Copy src/core/tsi/alts/frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = C059B70AC0BD62C9C8C01173AAC7101B /* alts_crypter.h */; }; + F8AD7E22ACC3BABEAD77735381321936 /* xds_channel_args.h in Headers */ = {isa = PBXBuildFile; fileRef = FC07AFB1A7B3C6E8AD9875D1F744BF03 /* xds_channel_args.h */; }; + F8B4BE0986744100D40EFA341E521F89 /* dynamic_annotations.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA5EB10BD9E4552ECAFEBB2189AD2C2 /* dynamic_annotations.h */; }; + F8B596408CACF9B8EC121C58BCE04656 /* http.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 7956807588DE8229B949A946CCD498BE /* http.upb.h */; }; + F8BB33B82F2B622F3E04754859394ABC /* frame_data.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 9DBC24144AC4AE30B20D02AA76B71B7B /* frame_data.h */; }; + F8BD0A62BC638BB64384C32D0F3F43FD /* ssl_utils_config.cc in Sources */ = {isa = PBXBuildFile; fileRef = 01C5A712FA078A8CBA6C8365E1EA071A /* ssl_utils_config.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F9240E3A6EBBE2CE495758234BBB8B7E /* iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0043AE8C7FA93FC299669D57A4CCE2BF /* iterator.cc */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + F927967B4FAFE744CB5A33BB26636B50 /* float_conversion.h in Copy strings/internal/str_format Public Headers */ = {isa = PBXBuildFile; fileRef = A2E4CB80A06EF267FB377C5873C2C90C /* float_conversion.h */; }; + F93591CE8AA8726BCDF79E535F00AF54 /* auth_metadata_processor_impl.h in Copy security Public Headers */ = {isa = PBXBuildFile; fileRef = CCF07C1E11206B22B474B76097194590 /* auth_metadata_processor_impl.h */; }; + F93C50A03EFABC27C1D1945DE57522A6 /* ads.upb.h in Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 67F87B58CDE8C6CA4193815173DAB3D2 /* ads.upb.h */; }; + F94CB5C7CCA8D747A93B9689F417EB3C /* FIRLoadBundleTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA7877D68E192DB6D96F7FC562099168 /* FIRLoadBundleTask.mm */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma"; }; }; + F96143959361D3CA09D720B601A6CB52 /* thread.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F609D6FB2C573ED1D71736277080C20 /* thread.h */; }; + F96B6F866EF55DD38504EA9358760AC9 /* chttp2_connector.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A4DAD705DD68E9F9B4489DA7427A818 /* chttp2_connector.h */; }; + F9B6BBA5ADC2DA5A7786D6D879FDFD18 /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CA599690024C45B7D3F178A156F9517 /* error.h */; }; + F9C20148C077DFBBD286F58889AB6C99 /* md4.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7D195ACE05E7761FEB1D1D191CEF73 /* md4.h */; }; + F9D25B737A056866ADA456161FE5BB48 /* gethostname_sysconf.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8007CB382231B37504C9AF7B4CED259C /* gethostname_sysconf.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + F9F37C960B099E1B4D2CD6C9812FF68D /* regex.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F759296B3B0DA0A5116AC02E65CCB7F /* regex.upb.h */; }; + FA307016DC5A1F8BFA055889EFFF1816 /* FIRLoggerLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = DA4E9CB337C3571E4A00E47B8DAA971F /* FIRLoggerLevel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FA31F14DC20129DF13A54D385C7BA581 /* error_cfstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D3A127F85D259EFFB75179FF5D1CE5 /* error_cfstream.h */; }; + FA40D13F0BA4C8D4AEDF123F66A07299 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C7834BFC231D585EC48892D05C85A74F /* internal.h */; }; + FA4D21B700F0C54BA6AA8DA58C9B7F5F /* client_channel.h in Headers */ = {isa = PBXBuildFile; fileRef = 19F8F9E30A7E6292F27C8FEC8E88F9AA /* client_channel.h */; }; + FA5697C1651E7E16E99175F1C924407D /* useful.h in Copy src/core/lib/gpr Private Headers */ = {isa = PBXBuildFile; fileRef = F7F17B070E00266DCEC517C3123F5F75 /* useful.h */; }; + FA64F8EE0871CF1DD9A02D2575D52B81 /* ssl_utils_config.h in Copy src/core/lib/security/security_connector Private Headers */ = {isa = PBXBuildFile; fileRef = 24E19AC1A5E10778F7EC1F07D8952891 /* ssl_utils_config.h */; }; + FA898B8C7E72CCDB122CEA4D4160E02A /* by_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = BF4DF5A173FFDBE5D81916F40C6097C3 /* by_dir.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FAA89DF4C9C8981047359A1EC814F65B /* v3_enum.c in Sources */ = {isa = PBXBuildFile; fileRef = BE37AC01F35D68250437EA7364FBFDDB /* v3_enum.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FABF9C4C2CC47C088B49FD82E66CC7C8 /* channelz_registry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3A705335B43DA99B5322E05DC7A4AED8 /* channelz_registry.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FAC341265FF41FD0D058008FF0CAD48F /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 699DA49F293CA45ABB3014D681F33C16 /* internal.h */; }; + FAC76D21D1E5DC775F7CCD6E5C31A769 /* security_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 593F0B894480261EB6B865EA99EF9506 /* security_context.h */; }; + FAC86AB3D3BFA3DAC5BC5E28B8C18D36 /* client_load_reporting_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3560DBCBDD820BA5A07FBA4DEE093344 /* client_load_reporting_filter.h */; }; + FAEE6CFA8744B43E7453A4BA4BD916F3 /* check_gcp_environment.cc in Sources */ = {isa = PBXBuildFile; fileRef = 60AD273010453FE5738BCB00AFA98D79 /* check_gcp_environment.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FB18497B1E733C0D7976F044121F8B33 /* firestore_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = F046C2E8B13635C1C374CFB208B1565F /* firestore_version.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FB441B08451102D714B87223B9D79BB0 /* firebase_metadata_provider_noop.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FCCD3D39348BDC0800EE0E7EFCE5259 /* firebase_metadata_provider_noop.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FB4BE2B6C5589333EA3B553848AAFAAE /* document_key_reference.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB7E916FC12CF5766C7F3D6DC4CC0CB9 /* document_key_reference.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FB5312F3058481348747459EDAABB126 /* alts_counter.h in Headers */ = {isa = PBXBuildFile; fileRef = A0BADFFC5D25B5F63F20F3D82BD3B61D /* alts_counter.h */; }; + FB7D03EBD346A090C79026B08F201A78 /* atm.h in Headers */ = {isa = PBXBuildFile; fileRef = 1225A64673D20C6A4389387B6DE4CB4C /* atm.h */; }; + FBB014BEA67A7C6C78131711C9BD6FC0 /* optimization.h in Copy base Public Headers */ = {isa = PBXBuildFile; fileRef = EA5D594CBBD6AE3388627A89640D5A92 /* optimization.h */; }; + FBBE224A3D8FA6579D9C468CB31C4409 /* tls_credentials.h in Copy src/core/lib/security/credentials/tls Private Headers */ = {isa = PBXBuildFile; fileRef = E87DFED2DA30CBDB5B3ECC57C280B7D0 /* tls_credentials.h */; }; + FBC41B5DC4DC68C1D7158E94C8BE3784 /* port_undef.inc in Headers */ = {isa = PBXBuildFile; fileRef = 8540F15ED4ADD1999CB3E095288A21AE /* port_undef.inc */; }; + FBD1DBAE07648312C1F7FEEFE80DEAE7 /* gpr_slice.h in Headers */ = {isa = PBXBuildFile; fileRef = 76005E7A0B18417C2398A61E8131A0B6 /* gpr_slice.h */; }; + FBD4C22D2B04DC4B7060DCFE81734AA2 /* connectivity_state.h in Copy src/core/lib/transport Private Headers */ = {isa = PBXBuildFile; fileRef = FB6EE78C78BD233BC52E5F669C8AFAE0 /* connectivity_state.h */; }; + FBE1DBB064629260F878D90ECA106E4A /* deprecation.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 4583E9CB7FEEE33105B059F2D82BFB72 /* deprecation.upb.h */; }; + FBF6362ED2F767F6F1850896CEB8027C /* message_compress_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = F7115F78FC67D382EC6862E32A909784 /* message_compress_filter.h */; }; + FBFD59F13ADF7C5CFD498901F9D05479 /* thread_pool_interface.h in Copy src/cpp/server Private Headers */ = {isa = PBXBuildFile; fileRef = 4F18534FF4B75EC164C841BA60034DB3 /* thread_pool_interface.h */; }; + FBFE04533DEF3403D7E9FA42C8EA622E /* http2_settings.cc in Sources */ = {isa = PBXBuildFile; fileRef = A7B5B09DFF1AD0648ED987A49B552909 /* http2_settings.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FC2233472F3A8AA17CF0725BD1AA5BEF /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B844FFAE23F1A2B97CDDF8BF94985DB /* internal.h */; }; + FC28910287E6C1526492FB4BCE3E9A9B /* stream_compression.cc in Sources */ = {isa = PBXBuildFile; fileRef = B31181EDB8A805B69CAA30F4688BCC47 /* stream_compression.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FC30F61C4E624330240E488C9F7EF80C /* str_cat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4505701F268374FC5F33F6D593AFCAC0 /* str_cat.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + FC3C7D26EC21A35712BF0D5A25BB1894 /* xds_client.h in Copy src/core/ext/filters/client_channel/xds Private Headers */ = {isa = PBXBuildFile; fileRef = AD3D0AA603EBFB0F04A26EB7C52C531B /* xds_client.h */; }; + FC4318F9EE0FFA36B58DEDD6C76929E8 /* FBLPromise+Delay.h in Headers */ = {isa = PBXBuildFile; fileRef = A0652A8506B00EC0855B4E63F59C3509 /* FBLPromise+Delay.h */; }; + FC45885DECC9DDB9F6C5BABE8959AE59 /* load_balancer_api.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = {isa = PBXBuildFile; fileRef = 5877DD34B3544A592E2E4FBC1D5DCAD0 /* load_balancer_api.h */; }; + FC490961BEA3B34007C7A438C1167F49 /* listener.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = 690260ACFC781EF1E784DEE2C6C603D8 /* listener.upb.h */; }; + FC4DCD10474DD59811CD3BED99E7BD1A /* handshaker.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = {isa = PBXBuildFile; fileRef = 75BB1AFF2F9D9F5D67043A052BDF2AEA /* handshaker.upb.h */; }; + FC5DA58AC406CBEBF80A504A22687583 /* stream_map.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = E88AC67415B807A3F70ADA80C12F5C9E /* stream_map.h */; }; + FC6483D1A00C2B6F07A072D3FFF42BA4 /* tasn_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CDF8192762FC4FFDD9F39C6869B2CF5 /* tasn_dec.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FC804B8DDF303C6E8F2105BEA9EAF317 /* pkcs8_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 1941F9303703D6FA0C77BFA6EF6E5661 /* pkcs8_x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FCA5D618F2EBBDE023C6EAD9304622D6 /* call.h in Copy impl/codegen Public Headers */ = {isa = PBXBuildFile; fileRef = 40DEE50F5C979D98AD4B7C60CA18F339 /* call.h */; }; + FCA627E601C3122D4A7A6134131AD580 /* lru_garbage_collector.cc in Sources */ = {isa = PBXBuildFile; fileRef = ED061D0791AD1C27CF4524F34C298AB0 /* lru_garbage_collector.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FCB072B7201676B23791D0988B437114 /* FIRApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A87C5EA5B4275B0CB816C231A79303 /* FIRApp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FCC17450FB14B1CB950AF871565965D7 /* tsan_mutex_interface.h in Copy base/internal Public Headers */ = {isa = PBXBuildFile; fileRef = 529FFBD228E87DBA888ED9C5ECD2B492 /* tsan_mutex_interface.h */; }; + FCC636D4D9E85D739BF5E8A5F26DC54F /* hpack_table.h in Headers */ = {isa = PBXBuildFile; fileRef = AD5F16CE4D5C90761220A70B813EA9A3 /* hpack_table.h */; }; + FCEB28B51495A16E6E5DCEFBB1A46752 /* server.h in Headers */ = {isa = PBXBuildFile; fileRef = F2CA69F1A5A70221803E171B54EDD51E /* server.h */; }; + FCF7A369A1AD4F2AC0B8ACE5B1F2409B /* http_proxy.h in Headers */ = {isa = PBXBuildFile; fileRef = C0A84F8A336DF72C0ACD14A34CC6B4E0 /* http_proxy.h */; }; + FD19AD7F4ED06CF7A1ECB746106BF331 /* v3_genn.c in Sources */ = {isa = PBXBuildFile; fileRef = 279DEAFD43888FDDB4EA222B41151ED8 /* v3_genn.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FD2065216F45BE205E92B2B1EE6F26B9 /* curve25519_32.h in Copy third_party/fiat Private Headers */ = {isa = PBXBuildFile; fileRef = 4708BD44EC5A216E24FB4E52DD3D392F /* curve25519_32.h */; }; + FD3AB3BC1A24A6B5214B9B689DFFB320 /* strerror.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8E2B4207D8A65104EFC655828838DD4F /* strerror.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FD4461BFEB0B1444148019C5F7763BC5 /* pem_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 4F1767B8DEDAC5E0A9A1E40584567EFE /* pem_x509.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FD61C0235532365FE5397C5BA9ECD9B9 /* connector.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = ED3A1DC6B9FE0788D7C08386FDC324ED /* connector.h */; }; + FD694B54147C17441C8ADF8832823A2B /* pollset_set_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = C829A0AD4AF4F4BF35A998E7C8B131B2 /* pollset_set_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FD779FA566365B65B4DF0B554AE84CAE /* ev_poll_posix.h in Copy src/core/lib/iomgr Private Headers */ = {isa = PBXBuildFile; fileRef = C5023C9AD47210C9FDB7C03D14544B73 /* ev_poll_posix.h */; }; + FD8F2F95A19DB285CE41C5FE196F8163 /* internal.h in Copy src/core/ext/transport/chttp2/transport Private Headers */ = {isa = PBXBuildFile; fileRef = 4A3F7B0603946255579608E98726D52B /* internal.h */; }; + FDBD9DC9A2555ADE4C1E9F4D32B42326 /* alts_zero_copy_grpc_protector.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = {isa = PBXBuildFile; fileRef = B7D075AAA4EA4B9A66F838FB07E06537 /* alts_zero_copy_grpc_protector.h */; }; + FDC3FD2B67CFAD8980531205E8C3F55C /* iomgr_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = C9DBE43E371330B98DAD14A7381D02A5 /* iomgr_posix.h */; }; + FDC3FFF832A1D3329BE718EF92B9C04F /* http_proxy.h in Headers */ = {isa = PBXBuildFile; fileRef = E859BF67F2B48F487375961E73FB867A /* http_proxy.h */; }; + FDC5B27F405DB7934EDF4C30693C9D16 /* c.h in Headers */ = {isa = PBXBuildFile; fileRef = 514E2C59522D6EB944CE7EC8CB687149 /* c.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FDE43800CD267A900AD991F50A384B8B /* backoff.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DAD54AEFF45B76E2F97203CD59A4543 /* backoff.h */; }; + FDE7D6FA22308A7EBAE785B8F6D865B2 /* memory_target_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = F0D3C3A0257A66C849ADAC285D874751 /* memory_target_cache.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FE0E691D9C4DB40AFCE892F8D1E84EA3 /* regex.upb.c in Sources */ = {isa = PBXBuildFile; fileRef = 4F5E15B63F67BBA53335FC08BFD95FA9 /* regex.upb.c */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FE170373458B336C1E79D8B93EC45A47 /* table.h in Headers */ = {isa = PBXBuildFile; fileRef = 69B86306FF6FC7BDD21B76BAB4F8AE48 /* table.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FE23FC1562FA01B28384A1CD5E19A071 /* http_connection_manager.upb.h in Headers */ = {isa = PBXBuildFile; fileRef = F722B083D385D1B6922816F230665A9A /* http_connection_manager.upb.h */; }; + FE24B5B43948A5559B6138D93B59028F /* string_windows.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3A0D48D2B8FCA94C74995983F04877 /* string_windows.h */; }; + FE2E9C7885F2CBC56667806F3A5D06A5 /* completion_queue.h in Headers */ = {isa = PBXBuildFile; fileRef = 2657535AAAAF14E09FAFF37B6DAF663F /* completion_queue.h */; }; + FE504490D04A17D76105C3ED0CBBC33C /* pool.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0E6F94588A9EDAB64D05FFCD82679A /* pool.h */; }; + FE8275BA749FE78131A76134D32BC6D3 /* str_format.h in Copy strings Public Headers */ = {isa = PBXBuildFile; fileRef = 9178E47C67BB082F4BDD3542702F00C4 /* str_format.h */; }; + FE8D7334EA1D6FCC8191C1160939E2AE /* frame_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 16CE1112F5DA7855F8D9CAD46BDFF5CC /* frame_handler.h */; }; + FEAFFC769FFDCDBB4B5165DB83B59497 /* client_authority_filter.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB1A968E222AE20414824C188A1A0FB1 /* client_authority_filter.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FEB70040C9DFF46BE3A868CF54793716 /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = {isa = PBXBuildFile; fileRef = 5B9744E060D64452ED6339052B6AB4D0 /* listener.upb.h */; }; + FEBBC166B619D627C9D910CDCA3CFFE3 /* status.cc in Sources */ = {isa = PBXBuildFile; fileRef = 09D93768027DDA4A4DDD0AB09E880F42 /* status.cc */; settings = {COMPILER_FLAGS = "-Wno-comma -fno-objc-arc"; }; }; + FEE9EDB962D2C13413769717ED0790C7 /* ssl_session_cache.h in Copy src/core/tsi/ssl/session_cache Private Headers */ = {isa = PBXBuildFile; fileRef = 77A0335BD65D301B9439EC0691C11369 /* ssl_session_cache.h */; }; + FEF7CC09EC3200E1AAD33C1590846549 /* client_channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = D74150405DBF0D26F917BC578291DCF1 /* client_channel.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FF0FE9CCF12F18F392203B75763917F5 /* credentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 23156AFDC8CF437ED995D8E10E66F1AC /* credentials.h */; }; + FF11158F54B06E1C605ADAAE16694F13 /* unix_sockets_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = C909D2575066B9D55D407688BC220B8F /* unix_sockets_posix.h */; }; + FF12958E531D478E06095D8F67966A51 /* internal.h in Copy crypto/pkcs8 Private Headers */ = {isa = PBXBuildFile; fileRef = 0B844FFAE23F1A2B97CDDF8BF94985DB /* internal.h */; }; + FF1B4CAF3B03E39FFC21EAAD1B6474BB /* md5.h in Headers */ = {isa = PBXBuildFile; fileRef = 575F8E5E4BEA92C01819BC7BE61B4344 /* md5.h */; }; + FF1D25B6E2DD6DE29AF80D5271495D67 /* grpc_ares_wrapper_windows.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0A38A12C2A35B6D0DC7D79C94E231260 /* grpc_ares_wrapper_windows.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FF36A3C328E206EE09AE48D7664EC269 /* FirebaseCoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 844B32EF2F526691F84CCD70FFC79797 /* FirebaseCoreInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + FF41FA23F94C5F19CD21C02E74A90567 /* slice_utils.h in Copy src/core/lib/slice Private Headers */ = {isa = PBXBuildFile; fileRef = 0ACEF7DE13EEEF21E1DEB53F06F651CC /* slice_utils.h */; }; + FF48CD12BE7EC18EFF83F12B68DD10D2 /* timer_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DF53804F4862E20DA49C335AE25EC7E /* timer_custom.h */; }; + FF4A6354D8956C48630ED4972EF76366 /* spinlock.cc in Sources */ = {isa = PBXBuildFile; fileRef = E1DAC88BD8364EF5E2F3DBB770861BC6 /* spinlock.cc */; settings = {COMPILER_FLAGS = "-Wno-everything"; }; }; + FF7AB5445FA12C258508D4A525E221E1 /* config_source.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = {isa = PBXBuildFile; fileRef = 84B82D9E038D349AF015B40853CD1C09 /* config_source.upb.h */; }; + FF99FC52E067A31B6233F7722BE5CA87 /* buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 36A53D2CC1DF53FDE70A9D9EC834FDF7 /* buf.c */; settings = {COMPILER_FLAGS = "-DOPENSSL_NO_ASM -GCC_WARN_INHIBIT_ALL_WARNINGS -w -fno-objc-arc"; }; }; + FF9BF82D8A61D09FD4B76DF37585AFF7 /* local_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */ = {isa = PBXBuildFile; fileRef = 16FFF8B86C102F7D8F8B82D75E0F6552 /* local_subchannel_pool.h */; }; + FFBCC3F7290087D2883818F02DF01EEF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE307E136B53B452E84DF514986145B /* Foundation.framework */; }; + FFC59C9E0A6C244EA76224D589EA04E6 /* mutation_batch_result.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2ECD809A94CDBDAB5A65BFB459EFCE88 /* mutation_batch_result.cc */; settings = {COMPILER_FLAGS = "$(inherited) -Wreorder -Werror=reorder -Wno-comma -fno-objc-arc"; }; }; + FFCBEB7DAB67688023A3A6E8472448A8 /* deadline_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 532F31967448B9FCDD457AC17BEAC2BE /* deadline_filter.h */; }; + FFD3961B191C0B6AA28FC5165E056E8E /* exec_ctx.cc in Sources */ = {isa = PBXBuildFile; fileRef = 74B9F2FBCA145AC94E4AB4527DA50546 /* exec_ctx.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FFD82DFF3C462D024DE38D94CDAB0AD0 /* handshaker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F2EF1BAB52858C3620B34AAC6C0E2651 /* handshaker.cc */; settings = {COMPILER_FLAGS = "-DGRPC_ARES=0 -Wno-comma -DGRPC_SHADOW_BORINGSSL_SYMBOLS -fno-objc-arc"; }; }; + FFEADEEE0654F8C1F1455E4D6D6BD60D /* hrss.h in Copy . Public Headers */ = {isa = PBXBuildFile; fileRef = F7229CBE896CDFA77D31D55CFF1D039B /* hrss.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 011265689CC15157E55A52A984D5A262 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5C0371EE948D0357B8EE0E34ABB44BF0; + remoteInfo = GoogleDataTransport; + }; + 0E597CA01430DCA2C171727E4AEB9408 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2BBF7206D7FAC92C82A042A99C4A98F8; + remoteInfo = PromisesObjC; + }; + 168976978B13F01663DCF5709AFFBB3A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4402AFF83DBDC4DD07E198685FDC2DF2; + remoteInfo = FirebaseCore; + }; + 30E706C0E7F62B76BFB5FA3CD165247A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2B5E7DCCBBFB32341D857D01211A1A3; + remoteInfo = nanopb; + }; + 3587BFB719FFC4A252A044E469E40908 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4402AFF83DBDC4DD07E198685FDC2DF2; + remoteInfo = FirebaseCore; + }; + 3B350CDA33A71A29671C5AAE244D6B32 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 620E05868772C10B4920DC7E324F2C87; + remoteInfo = FirebaseCoreDiagnostics; + }; + 4010A702EBD85D4A3FFB605858D09CB0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 445FD4CB16BB7BEE2D1C404951CDE14A; + remoteInfo = "BoringSSL-GRPC"; + }; + 46820728F8F9772E54D5AD037506BEFB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73CDC3D182DB953135F62609681B443D; + remoteInfo = abseil; + }; + 50B58B426D5D9F69E743256B82BBE0C4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2B5E7DCCBBFB32341D857D01211A1A3; + remoteInfo = nanopb; + }; + 50E646A27F830592C72D9F9A184CE7E6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8D7F5D5DD528D21A72DC87ADA5B12E2D; + remoteInfo = GoogleUtilities; + }; + 586D0D5A93ADABC89A26BEF0F4B96066 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4402AFF83DBDC4DD07E198685FDC2DF2; + remoteInfo = FirebaseCore; + }; + 5DE929F0B66DE0269B1E9BEC80D63355 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8D7F5D5DD528D21A72DC87ADA5B12E2D; + remoteInfo = GoogleUtilities; + }; + 61A4A2373A6615C79EE677E5388CADA9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DBA2B63E3A5FE83FE89E731664C9269F; + remoteInfo = FirebaseFirestore; + }; + 63CDB901F4AF5FFFEE1C6FCEF5F73416 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73CDC3D182DB953135F62609681B443D; + remoteInfo = abseil; + }; + 6C285E1D5D9574F05EC63DC11BEA2DD4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 50F380A87A4FC4EC7EE3AC9BDADB6D2D; + remoteInfo = "gRPC-Core"; + }; + 71015D5527865E0214ADD3C445D0D08F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5C0371EE948D0357B8EE0E34ABB44BF0; + remoteInfo = GoogleDataTransport; + }; + 786D6746790E20F6415EC0F34A65A74E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3B8CAC3956E59F928387D0C6310E3B37; + remoteInfo = "gRPC-C++-gRPCCertificates-Cpp"; + }; + 84F1B2AB15BA5CE01EC930DB06D4BF4B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C5E43B0A9555E7C2E43A6D7C8A23CF6; + remoteInfo = "gRPC-C++"; + }; + 90B298FCBDD34E55B0F315A0CA164E81 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2B5E7DCCBBFB32341D857D01211A1A3; + remoteInfo = nanopb; + }; + 93C8AE5C520E061DC3BEDEDC929BA7D7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8D7F5D5DD528D21A72DC87ADA5B12E2D; + remoteInfo = GoogleUtilities; + }; + A409A9163BDCAE9C2E153AABBB4ADC78 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9307B7A119490930CF70393AB529AAC1; + remoteInfo = "leveldb-library"; + }; + A84EAB6D657119E4BD88C2B18F3F7531 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73CDC3D182DB953135F62609681B443D; + remoteInfo = abseil; + }; + B6103199347F0CE079F628D428440A0A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2B5E7DCCBBFB32341D857D01211A1A3; + remoteInfo = nanopb; + }; + BA667624F034FCBD3256C66FE3CCFBD3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9307B7A119490930CF70393AB529AAC1; + remoteInfo = "leveldb-library"; + }; + C01F8993C7B91DC3F65B46976B9DB1E3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 072CEA044D2EF26F03496D5996BBF59F; + remoteInfo = Firebase; + }; + C69728CAC1E142F8375626D3D15897EC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73CDC3D182DB953135F62609681B443D; + remoteInfo = abseil; + }; + D184F31DDF034BDB481D4A1FDFDD9F3A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C5E43B0A9555E7C2E43A6D7C8A23CF6; + remoteInfo = "gRPC-C++"; + }; + DA989B08A7D2075770395897BE284EA4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 620E05868772C10B4920DC7E324F2C87; + remoteInfo = FirebaseCoreDiagnostics; + }; + DB251FBD300E9E528C47291557D42FAB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8D7F5D5DD528D21A72DC87ADA5B12E2D; + remoteInfo = GoogleUtilities; + }; + E5071D801B3147DE9C084592C9F2F972 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 50F380A87A4FC4EC7EE3AC9BDADB6D2D; + remoteInfo = "gRPC-Core"; + }; + E76FEC2E4B79FA1C85E004A4DD977874 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2BBF7206D7FAC92C82A042A99C4A98F8; + remoteInfo = PromisesObjC; + }; + FB1DB4F427C6D1B15E4B952ED0FA170C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 445FD4CB16BB7BEE2D1C404951CDE14A; + remoteInfo = "BoringSSL-GRPC"; + }; + FC2E194AC2AFB3A0768AECB8174C88FE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DBA2B63E3A5FE83FE89E731664C9269F; + remoteInfo = FirebaseFirestore; + }; + FE5E95847CBCE98B97C5B10A0C9C2F33 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2BBF7206D7FAC92C82A042A99C4A98F8; + remoteInfo = PromisesObjC; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 00355775CF598F323FA205AB3FD77B85 /* Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/annotations"; + dstSubfolderSpec = 16; + files = ( + DB7467BB2DC8559A4027C1420D18990C /* deprecation.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + 7FAB086540B2FEAD32D766BA46CAA9F1 /* resource.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/annotations Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 00D4306755662CCA063EC2A92A67E0A9 /* Copy src/core/ext/filters/max_age Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/max_age"; + dstSubfolderSpec = 16; + files = ( + EC16DE330EB6742454404BFB05FDFAC9 /* max_age_filter.h in Copy src/core/ext/filters/max_age Private Headers */, + ); + name = "Copy src/core/ext/filters/max_age Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 01A4500BA6CD8A97AFCFC7D8CADDF696 /* Copy src/core/tsi/alts/frame_protector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/frame_protector"; + dstSubfolderSpec = 16; + files = ( + C44B9DB7BEE64AA23B702378B27A5DCE /* alts_counter.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + F89B35006C7968E9CCA1A7DBE9AE985F /* alts_crypter.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + B58936EBFC37A42661EC95B2C98A7F6B /* alts_frame_protector.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + 65C620AFD40230EAC07C018DEE589982 /* alts_record_protocol_crypter_common.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + 20F69DF34FDF2BE4FF4FEF278C7A8B50 /* frame_handler.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + ); + name = "Copy src/core/tsi/alts/frame_protector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 02FFFFB896934F8F0255B11226BD59CA /* Copy src/core/lib/security/credentials/local Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/local"; + dstSubfolderSpec = 16; + files = ( + CC334C0B8D60E2785F00E13A167D47DC /* local_credentials.h in Copy src/core/lib/security/credentials/local Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/local Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0495AF171240225543EFA2AD4E18B253 /* Copy src/core/ext/upb-generated/envoy/type Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type"; + dstSubfolderSpec = 16; + files = ( + BEA87430BDDC6CFB49688E04E2825B8F /* http.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + B06D96E79F949C08F2F094FF136D20BD /* percent.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + 5106E573F34DC56A2A6D67F17C76274A /* range.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + 07504EF543D605369D6D5ACF2C6C363D /* semantic_version.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0586241DAF3B15541F0B16D40BE06876 /* Copy container/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/container/internal"; + dstSubfolderSpec = 16; + files = ( + A3D3AA057C55889DA2C4EAE98AEC96B9 /* common.h in Copy container/internal Public Headers */, + 8E07212A9C342B1DB8D3321A0FF6A7B5 /* compressed_tuple.h in Copy container/internal Public Headers */, + 07EC52D7A4EADE417B8E8E55645451FF /* container_memory.h in Copy container/internal Public Headers */, + CC5A9588715E5DCC9F66825E0B0F43E4 /* hash_function_defaults.h in Copy container/internal Public Headers */, + 0C45B053163D51EDDBE0FB35DE0B6F09 /* hash_policy_traits.h in Copy container/internal Public Headers */, + ADBCA0BD98E2490215C1EF06948C1459 /* hashtable_debug_hooks.h in Copy container/internal Public Headers */, + 99A7555222A2FBE1F6F2DED46D9692F1 /* hashtablez_sampler.h in Copy container/internal Public Headers */, + C6806F0C6EE4C3A80A873EF4317C388F /* have_sse.h in Copy container/internal Public Headers */, + 412F5D118FB1B6EAEEF8C0C8B2F52B66 /* inlined_vector.h in Copy container/internal Public Headers */, + 695165DBB488D10CCFA21F9CA9C75E74 /* layout.h in Copy container/internal Public Headers */, + 7BE3AFA018D91229A93C9125EF6F4BF4 /* raw_hash_map.h in Copy container/internal Public Headers */, + 15C51DE920F3A7D8E61EE2A66E7ABE4F /* raw_hash_set.h in Copy container/internal Public Headers */, + ); + name = "Copy container/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 06BAD96E6F10305F17350595F1F2FB62 /* Copy crypto/evp Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/evp"; + dstSubfolderSpec = 16; + files = ( + 606A12988407ABC1D6B8EE4C5A4DD0EE /* internal.h in Copy crypto/evp Private Headers */, + ); + name = "Copy crypto/evp Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 06DE7570D1336D11E7AE4D3E98C2AD40 /* Copy crypto/fipsmodule/rsa Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/rsa"; + dstSubfolderSpec = 16; + files = ( + 7DE3738B2CFCE84F7E38F96150F1E941 /* internal.h in Copy crypto/fipsmodule/rsa Private Headers */, + ); + name = "Copy crypto/fipsmodule/rsa Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 08911BB7F4C403767C5C2457BC30D739 /* Copy src/core/lib/avl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/avl"; + dstSubfolderSpec = 16; + files = ( + 209B05A223DD36E092E0DAFE6AC1AB37 /* avl.h in Copy src/core/lib/avl Private Headers */, + ); + name = "Copy src/core/lib/avl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 08BBD04A79439AE7335379BCB7134479 /* Copy src/core/lib/backoff Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/backoff"; + dstSubfolderSpec = 16; + files = ( + CF33837F59A3E8AD7DE11BD183BBAD14 /* backoff.h in Copy src/core/lib/backoff Private Headers */, + ); + name = "Copy src/core/lib/backoff Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0AF2D7CD5C18760CEC5C667BB14169EE /* Copy crypto/obj Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/obj"; + dstSubfolderSpec = 16; + files = ( + AAD7618C95102F7F1671FA16DC6ACDD7 /* obj_dat.h in Copy crypto/obj Private Headers */, + ); + name = "Copy crypto/obj Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0B32D14A3F8137A20A373AD54E585D8A /* Copy src/core/lib/security/credentials/tls Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/tls"; + dstSubfolderSpec = 16; + files = ( + 25D98A867D69981006BF385DAE213DAD /* grpc_tls_credentials_options.h in Copy src/core/lib/security/credentials/tls Private Headers */, + 428D25677C03DF5B189B5DD2E0B05E11 /* tls_credentials.h in Copy src/core/lib/security/credentials/tls Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/tls Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0CC056E45510334C684D11291BA72CA8 /* Copy src/cpp/server/health Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/cpp/server/health"; + dstSubfolderSpec = 16; + files = ( + F4F64932B22A2A9E63CCEFC15B6FC67D /* default_health_check_service.h in Copy src/cpp/server/health Private Headers */, + ); + name = "Copy src/cpp/server/health Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0DFF43E1C7A953C7E3D3AE99406EA2F5 /* Copy src/core/lib/security/credentials Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials"; + dstSubfolderSpec = 16; + files = ( + C1B20892F80395DF3919B79E5B0EED6E /* credentials.h in Copy src/core/lib/security/credentials Private Headers */, + ); + name = "Copy src/core/lib/security/credentials Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0E46EA5D94C5E4C82F5999C350A9CF32 /* Copy src/core/lib/http Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/http"; + dstSubfolderSpec = 16; + files = ( + 9031FCB217CD0C3492F64A5750E10F63 /* format_request.h in Copy src/core/lib/http Private Headers */, + E3F7F8EBD9851CA5155D2ED23CDD2F07 /* httpcli.h in Copy src/core/lib/http Private Headers */, + 01AB881B14F4A4737E9D60806292032F /* parser.h in Copy src/core/lib/http Private Headers */, + ); + name = "Copy src/core/lib/http Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0F16536D913219B33C527082F183335F /* Copy src/core/lib/security/credentials/oauth2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/oauth2"; + dstSubfolderSpec = 16; + files = ( + 12B73AE46EB33DE3E7F36D6783BAF744 /* oauth2_credentials.h in Copy src/core/lib/security/credentials/oauth2 Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/oauth2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 0FFE6982AE1E38EEBEB275F71D9C452B /* Copy src/core/lib/slice Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/slice"; + dstSubfolderSpec = 16; + files = ( + C70EA413B6DB62C99560D86B0D8AD065 /* b64.h in Copy src/core/lib/slice Private Headers */, + 638CDE1697655A217BFF3A0EFD4BB556 /* percent_encoding.h in Copy src/core/lib/slice Private Headers */, + 456BE38F6F6EB19008DF178177E7E8C3 /* slice_hash_table.h in Copy src/core/lib/slice Private Headers */, + C35B472005748B54CC166C9E8C494344 /* slice_internal.h in Copy src/core/lib/slice Private Headers */, + 5E6F46195D330F1454767DA6C6BB1803 /* slice_string_helpers.h in Copy src/core/lib/slice Private Headers */, + FF41FA23F94C5F19CD21C02E74A90567 /* slice_utils.h in Copy src/core/lib/slice Private Headers */, + F550A6B0EC266890778C48B2EC67B34E /* slice_weak_hash_table.h in Copy src/core/lib/slice Private Headers */, + ); + name = "Copy src/core/lib/slice Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1415B310237413B9A2B27F12CBC5C058 /* Copy src/core/lib/slice Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/slice"; + dstSubfolderSpec = 16; + files = ( + DAF8326657D3784F22F1BE137B185D3D /* b64.h in Copy src/core/lib/slice Private Headers */, + B865631297E5E4B78CB0ACFA040579DE /* percent_encoding.h in Copy src/core/lib/slice Private Headers */, + 2D900350EE7C58CB070E2B44B7A50183 /* slice_hash_table.h in Copy src/core/lib/slice Private Headers */, + 10DAEBB15D10B356B99EA2606B1D9455 /* slice_internal.h in Copy src/core/lib/slice Private Headers */, + 9D5034969CFA9C13ADEAE7343B517445 /* slice_string_helpers.h in Copy src/core/lib/slice Private Headers */, + C611AA8D58E0BFE081418B18B6630749 /* slice_utils.h in Copy src/core/lib/slice Private Headers */, + A02305729A85B2A010CBB4C4B81E0139 /* slice_weak_hash_table.h in Copy src/core/lib/slice Private Headers */, + ); + name = "Copy src/core/lib/slice Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 14738F6548C57BD278A0E22A1E7AC9ED /* Copy src/core/lib/security/credentials/ssl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/ssl"; + dstSubfolderSpec = 16; + files = ( + 347AEC6E07747C1E3A5F948E82914F52 /* ssl_credentials.h in Copy src/core/lib/security/credentials/ssl Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/ssl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 14B07B232FDE37647F85396A231FD43D /* Copy src/core/lib/gprpp Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/gprpp"; + dstSubfolderSpec = 16; + files = ( + 6F6E6D21DBAB0022112D40EB51CAA5CD /* arena.h in Copy src/core/lib/gprpp Private Headers */, + 069997781F660695BDF743A0C0CCF1A9 /* atomic.h in Copy src/core/lib/gprpp Private Headers */, + 04FF5F9577C6022470D5EC270B5EEDAB /* debug_location.h in Copy src/core/lib/gprpp Private Headers */, + F6BEC1339882786E8A4F164C33D8A9A3 /* fork.h in Copy src/core/lib/gprpp Private Headers */, + 269923A5E1E800507F717895455416DA /* global_config.h in Copy src/core/lib/gprpp Private Headers */, + B05CEBA8424666CE060F732914794438 /* global_config_custom.h in Copy src/core/lib/gprpp Private Headers */, + 0056CD1A6216DCC2794A668B5BD255B4 /* global_config_env.h in Copy src/core/lib/gprpp Private Headers */, + 059B2DE17CF0035DA14A04E34DE87024 /* global_config_generic.h in Copy src/core/lib/gprpp Private Headers */, + 5231B434D641ED0301C417574310D1A0 /* host_port.h in Copy src/core/lib/gprpp Private Headers */, + E945398112F1659F46C6A99986E0E389 /* inlined_vector.h in Copy src/core/lib/gprpp Private Headers */, + 53666CEFDD567350BA03ED24AB8D9D62 /* manual_constructor.h in Copy src/core/lib/gprpp Private Headers */, + CBA85F167477D408E2C4913B296AC7F5 /* map.h in Copy src/core/lib/gprpp Private Headers */, + 42E1ADCEF0A7179E55DD939DBE10FE51 /* memory.h in Copy src/core/lib/gprpp Private Headers */, + 58A0DC817C737971F1EFA25661FC8BA3 /* mpscq.h in Copy src/core/lib/gprpp Private Headers */, + 49F50D50019F4D7C4548B049EE197B4A /* optional.h in Copy src/core/lib/gprpp Private Headers */, + F579727FEA18228EE59F152A085CECF8 /* orphanable.h in Copy src/core/lib/gprpp Private Headers */, + B30FD6D17306A490B8DDE549867ADF7B /* ref_counted.h in Copy src/core/lib/gprpp Private Headers */, + DF8E4DC298BEC7C8FB5FA0D8BF47037A /* ref_counted_ptr.h in Copy src/core/lib/gprpp Private Headers */, + EAE834B8EA3CC2D9FBA306A3AEE10F58 /* string_view.h in Copy src/core/lib/gprpp Private Headers */, + 7438108BD239C10C474363FCA605B211 /* sync.h in Copy src/core/lib/gprpp Private Headers */, + 31334FDEB585F8DA0D50B46037D2F540 /* thd.h in Copy src/core/lib/gprpp Private Headers */, + ); + name = "Copy src/core/lib/gprpp Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 14FBCB9B7BA78BEFE2338FFFE9270F96 /* Copy crypto Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto"; + dstSubfolderSpec = 16; + files = ( + 82D7869D31A2E1FD3359AE78D79BEC44 /* cpu-arm-linux.h in Copy crypto Private Headers */, + 644F8CE5E335CC3AD1AB3A86464A2B5A /* internal.h in Copy crypto Private Headers */, + ); + name = "Copy crypto Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 16E0D4E4DCBB371B9225532AA661FBAD /* Copy crypto/fipsmodule/rand Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/rand"; + dstSubfolderSpec = 16; + files = ( + 1738AF8644835F406DFDBEDD16D6EF1B /* internal.h in Copy crypto/fipsmodule/rand Private Headers */, + ); + name = "Copy crypto/fipsmodule/rand Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 16F213EF4E561591369AB03347734BFC /* Copy src/core/lib/security/credentials/iam Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/iam"; + dstSubfolderSpec = 16; + files = ( + DB6FBACCB678C706CFE58E4BACC2CEAC /* iam_credentials.h in Copy src/core/lib/security/credentials/iam Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/iam Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 173BE26F1D7D100FF111BD309E6A23E0 /* Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/listener"; + dstSubfolderSpec = 16; + files = ( + 44AA1652BF892B5A17A18C0D400F474E /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + 7F229B228650BB128131D2DDD72113BE /* listener_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + B87400CD1FF2E8EA7D7E8C0335A36218 /* udp_listener_config.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1A8BC042A62A1AD5108D923BC8DF608D /* Copy time/internal/cctz/src Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/time/internal/cctz/src"; + dstSubfolderSpec = 16; + files = ( + C7473E9C29275C23C9E2DD4A44331CFD /* time_zone_fixed.h in Copy time/internal/cctz/src Public Headers */, + ACB846E1680523FFC7441A66C51088A3 /* time_zone_if.h in Copy time/internal/cctz/src Public Headers */, + A8EFA566925C2C0A8C45337ABD04EC86 /* time_zone_impl.h in Copy time/internal/cctz/src Public Headers */, + 6F724B4AA4184E7D627CD175E8203B1B /* time_zone_info.h in Copy time/internal/cctz/src Public Headers */, + B87A179D04206042A327FF3D1E2A946A /* time_zone_libc.h in Copy time/internal/cctz/src Public Headers */, + 171C34521B5B8AF4BD85DCB43AF1195E /* time_zone_posix.h in Copy time/internal/cctz/src Public Headers */, + B654CCD57BCEDD7DCF79C8DB4EB7B889 /* tzfile.h in Copy time/internal/cctz/src Public Headers */, + ); + name = "Copy time/internal/cctz/src Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1B85EB0E862DD5229CC266C64BB62DFE /* Copy src/core/lib/security/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/transport"; + dstSubfolderSpec = 16; + files = ( + F80162216C65679671AF01584FACF74E /* auth_filters.h in Copy src/core/lib/security/transport Private Headers */, + 04035934FAF7AAF6AF6EED62D5F609CF /* secure_endpoint.h in Copy src/core/lib/security/transport Private Headers */, + BA131B5E7BCDD89139C676C8688FB918 /* security_handshaker.h in Copy src/core/lib/security/transport Private Headers */, + 6108C040B1CDED5E4F812DA5B112CC54 /* target_authority_table.h in Copy src/core/lib/security/transport Private Headers */, + EA1D285626135EB43C38499FC44F8170 /* tsi_error.h in Copy src/core/lib/security/transport Private Headers */, + ); + name = "Copy src/core/lib/security/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1CAB005D8067700A7C4A2636683A2D92 /* Copy src/core/lib/security/credentials/oauth2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/oauth2"; + dstSubfolderSpec = 16; + files = ( + C2E0BD4011FC1069AAA3B497AA4BBDC2 /* oauth2_credentials.h in Copy src/core/lib/security/credentials/oauth2 Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/oauth2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1E18ADF6B97DDE699C9AAB96A582677D /* Copy src/core/lib/json Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/json"; + dstSubfolderSpec = 16; + files = ( + E20B1289877E5ADC2A06E08C690956EC /* json.h in Copy src/core/lib/json Private Headers */, + ); + name = "Copy src/core/lib/json Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1E993CF8D38A6D4EA6067D296D5CA9CA /* Copy src/cpp/common Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/cpp/common"; + dstSubfolderSpec = 16; + files = ( + E74198F572C18F10B4F03A734D9ACF76 /* channel_filter.h in Copy src/cpp/common Private Headers */, + 1F802EBAEDF705E9B0151F760E087163 /* secure_auth_context.h in Copy src/cpp/common Private Headers */, + AC1AB792BAF160CBBDE34BFC2901C651 /* tls_credentials_options_util.h in Copy src/cpp/common Private Headers */, + ); + name = "Copy src/cpp/common Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1EF6E1D4F0463A20C16883878F1F2C86 /* Copy src/core/tsi/alts/crypt Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/crypt"; + dstSubfolderSpec = 16; + files = ( + 92840CE0E6A2690E92A7DED012063688 /* gsec.h in Copy src/core/tsi/alts/crypt Private Headers */, + ); + name = "Copy src/core/tsi/alts/crypt Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 20C39E3DA1D5C30DBFE938B8E06F115C /* Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy/grpclb"; + dstSubfolderSpec = 16; + files = ( + B752F6512E407B6E64F1388621E8E5FB /* client_load_reporting_filter.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 27BD33A965417FB36505C389390939B9 /* grpclb.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 230E268078EFB1F4822480647EFA8F6C /* grpclb_channel.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 6E3A0FDE392EA890B9D2A8182B9B857D /* grpclb_client_stats.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 838CD0C38F6C7715021827D2F6ED0763 /* load_balancer_api.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 225608A3BD0E881BEB63692F9AD456DF /* Copy src/core/lib/gprpp Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/gprpp"; + dstSubfolderSpec = 16; + files = ( + 9BA670F9C3CEAE9DB82C8FF162182610 /* arena.h in Copy src/core/lib/gprpp Private Headers */, + 8FAB2F9A0F4551C88812B9EA4F55D413 /* atomic.h in Copy src/core/lib/gprpp Private Headers */, + 1BF1EA11ED55DF4E74727525C94D94FA /* debug_location.h in Copy src/core/lib/gprpp Private Headers */, + 34AAFD44AE71978E69B369F90F0D855E /* fork.h in Copy src/core/lib/gprpp Private Headers */, + 37B2B1E2D412F8693B072F2CAE01BE92 /* global_config.h in Copy src/core/lib/gprpp Private Headers */, + 1D5D9654835827BB486F0F149129E69B /* global_config_custom.h in Copy src/core/lib/gprpp Private Headers */, + 132F778E59E3D1F1D9CD3F84440B1B3E /* global_config_env.h in Copy src/core/lib/gprpp Private Headers */, + 3CA8636936BDFAE0B4E64FDB6FD07DF6 /* global_config_generic.h in Copy src/core/lib/gprpp Private Headers */, + 169DF0C7757A3C87633DE20F268FC06D /* host_port.h in Copy src/core/lib/gprpp Private Headers */, + 2C89BB98AE61E4B47E98F74E751309B4 /* inlined_vector.h in Copy src/core/lib/gprpp Private Headers */, + 14F9C796DEB4C7498A366FA39C68606D /* manual_constructor.h in Copy src/core/lib/gprpp Private Headers */, + B93F07440D13502B503A13084C5BB96F /* map.h in Copy src/core/lib/gprpp Private Headers */, + 416BB920676C01ABC50CC4B181B0A965 /* memory.h in Copy src/core/lib/gprpp Private Headers */, + D1A662ADFD5BE50DF22E933DC29CE1CF /* mpscq.h in Copy src/core/lib/gprpp Private Headers */, + 956672FFF5B6FBB0038CDA29B5E25CE8 /* optional.h in Copy src/core/lib/gprpp Private Headers */, + 2004D2BA7AEB5646E8646F3453220941 /* orphanable.h in Copy src/core/lib/gprpp Private Headers */, + 2CC3093A5C482F42BC886514D7935872 /* ref_counted.h in Copy src/core/lib/gprpp Private Headers */, + A0DDAB34A86FBAA5321F6528F0E7119A /* ref_counted_ptr.h in Copy src/core/lib/gprpp Private Headers */, + 93FBA66E29D44360EB8C8A31B51F9DE4 /* string_view.h in Copy src/core/lib/gprpp Private Headers */, + 8E6511AB2B537132C82522135C3BF148 /* sync.h in Copy src/core/lib/gprpp Private Headers */, + 3095BA817B12D9CDD7113E901B836279 /* thd.h in Copy src/core/lib/gprpp Private Headers */, + ); + name = "Copy src/core/lib/gprpp Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2407DAE4654435BE4ECBDDB58ADED291 /* Copy crypto/fipsmodule/des Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/des"; + dstSubfolderSpec = 16; + files = ( + F7BE5EC1FFD92B52D7682ABAAE178CA1 /* internal.h in Copy crypto/fipsmodule/des Private Headers */, + ); + name = "Copy crypto/fipsmodule/des Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2408E7950D6A720D24C9F80B28D9BC6A /* Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/service/load_stats/v2"; + dstSubfolderSpec = 16; + files = ( + 081E219C5C42A0D714CB1A4E1448ACE6 /* lrs.upb.h in Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 24392D2792DD24AB8D355E9740A40712 /* Copy src/core/lib/security/context Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/context"; + dstSubfolderSpec = 16; + files = ( + 337D635008A774F013F1CBEB456BA2B6 /* security_context.h in Copy src/core/lib/security/context Private Headers */, + ); + name = "Copy src/core/lib/security/context Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 24F03958CAC3C33C3B0F1BC2AF13C6AA /* Copy numeric Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/numeric"; + dstSubfolderSpec = 16; + files = ( + B81193FC8FE5323136C0F122754D2E43 /* int128.h in Copy numeric Public Headers */, + 8DF3999ED9E48D551E17C8DB887C07D5 /* int128_have_intrinsic.inc in Copy numeric Public Headers */, + 7E84A20E130C0221AE2DB5912817D511 /* int128_no_intrinsic.inc in Copy numeric Public Headers */, + ); + name = "Copy numeric Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 256DFFDBCE51373A97DB4282AB07A4F0 /* Copy src/core/ext/filters/workarounds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/workarounds"; + dstSubfolderSpec = 16; + files = ( + 8216D8A87BBC20216610A43F6F1AEAF2 /* workaround_cronet_compression_filter.h in Copy src/core/ext/filters/workarounds Private Headers */, + 7C8DA8B1FA6B58B6043030F357981DF4 /* workaround_utils.h in Copy src/core/ext/filters/workarounds Private Headers */, + ); + name = "Copy src/core/ext/filters/workarounds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 27378EE235508A527E7B656930AF87C2 /* Copy src/core/lib/security/credentials/plugin Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/plugin"; + dstSubfolderSpec = 16; + files = ( + CA4059C64566125929D2AC4A038BA527 /* plugin_credentials.h in Copy src/core/lib/security/credentials/plugin Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/plugin Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2B77C53D8C25063B978E1447A14E5398 /* Copy src/core/lib/security/credentials/google_default Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/google_default"; + dstSubfolderSpec = 16; + files = ( + A214BAFEE84BB169583CF632B1E01408 /* google_default_credentials.h in Copy src/core/lib/security/credentials/google_default Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/google_default Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2C01783753739A9E9641851865BA9B47 /* Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/zero_copy_frame_protector"; + dstSubfolderSpec = 16; + files = ( + F403C83E497072E5EFF27E4612BC6F50 /* alts_grpc_integrity_only_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + B7512147A520D2C9ECA084B9A0C69F8B /* alts_grpc_privacy_integrity_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + B68792F39132A4D10744B3B4C41EABD4 /* alts_grpc_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + D770403367D17A247C34627A98BD6828 /* alts_grpc_record_protocol_common.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + 122F32B210316FD88F50D1599DC4B761 /* alts_iovec_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + B01BE1B2871816B579C6E03B3B4E93BC /* alts_zero_copy_grpc_protector.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + ); + name = "Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2D60F13695E8A1E4333783FA28442947 /* Copy impl/codegen Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/impl/codegen"; + dstSubfolderSpec = 16; + files = ( + A4B73DAAB12E4A7FACA7CBD446F4DDB2 /* async_generic_service.h in Copy impl/codegen Public Headers */, + F1F0085ACDF1BBDA65592B6855C88149 /* async_stream.h in Copy impl/codegen Public Headers */, + D6D0A75328E39F1D96F44C5245E0FA18 /* async_stream_impl.h in Copy impl/codegen Public Headers */, + 4FD66333B1E7E0748A1DA7FAC0235A2C /* async_unary_call.h in Copy impl/codegen Public Headers */, + A04720F99FD823FE1A4176403975CB35 /* async_unary_call_impl.h in Copy impl/codegen Public Headers */, + 12D9C92C3157DE44E44365F9F9355DBA /* byte_buffer.h in Copy impl/codegen Public Headers */, + FCA5D618F2EBBDE023C6EAD9304622D6 /* call.h in Copy impl/codegen Public Headers */, + 92454B0D21F9ADB4C31ED86AE6172F98 /* call_hook.h in Copy impl/codegen Public Headers */, + 0B664C26867D173BB0F4A4C68D4EFFE1 /* call_op_set.h in Copy impl/codegen Public Headers */, + 06F3C3CD8667E0F6F9EDF70FF2AAA0F4 /* call_op_set_interface.h in Copy impl/codegen Public Headers */, + 128DE552376D4AC8481D37D0CD34ADC0 /* callback_common.h in Copy impl/codegen Public Headers */, + ACE419E013DD0E67C8D1B28DA34CA750 /* channel_interface.h in Copy impl/codegen Public Headers */, + C9AE1770CC1FA1074BD74089076E36EC /* client_callback.h in Copy impl/codegen Public Headers */, + 42913570E263FD28F549E96A83838398 /* client_callback_impl.h in Copy impl/codegen Public Headers */, + 50438F5BE0528DAF734AE2606461D551 /* client_context.h in Copy impl/codegen Public Headers */, + 0CF7A603C17C421CE4BBE6B0FAB692CD /* client_context_impl.h in Copy impl/codegen Public Headers */, + 912CC266DE3D414E882B960C4EDD91D9 /* client_interceptor.h in Copy impl/codegen Public Headers */, + 0C76E8DA159A02EEEB9290E178F0EDA7 /* client_unary_call.h in Copy impl/codegen Public Headers */, + DE765937C5C203D90D1844E9676926CB /* completion_queue.h in Copy impl/codegen Public Headers */, + ED97679FD98EEB82A4636C31D731DED8 /* completion_queue_impl.h in Copy impl/codegen Public Headers */, + 31F3EC7402B90DB41BA9DE75955E97CD /* completion_queue_tag.h in Copy impl/codegen Public Headers */, + 21CE1C7FAE9EC0553D6DDE303053E19C /* config.h in Copy impl/codegen Public Headers */, + 2C190110E87AB88A175BC4F26901783E /* core_codegen.h in Copy impl/codegen Public Headers */, + A31E5DF9327CA03E8B6B8B1CD47A9638 /* core_codegen_interface.h in Copy impl/codegen Public Headers */, + F4D0980A674EB2695D4873177D6B554F /* create_auth_context.h in Copy impl/codegen Public Headers */, + 2794285CA552B55D04950FB80BE81F26 /* delegating_channel.h in Copy impl/codegen Public Headers */, + 6454C8EE69958AAD64D0CBE6966FA51C /* grpc_library.h in Copy impl/codegen Public Headers */, + 589AF2AA333A3C1AD84FA7BF5D4E6FD4 /* intercepted_channel.h in Copy impl/codegen Public Headers */, + 5812B7932870E136139433543CF3265E /* interceptor.h in Copy impl/codegen Public Headers */, + 4233FF237CDA2A286FCB18A574096202 /* interceptor_common.h in Copy impl/codegen Public Headers */, + C5B72E78519F6D3EEC649712BAFFE0C7 /* message_allocator.h in Copy impl/codegen Public Headers */, + 94F4E242BF1AE9ED7180A4D83B1851A3 /* metadata_map.h in Copy impl/codegen Public Headers */, + 4FC2C20C89F4922427F60944160B1FDA /* method_handler.h in Copy impl/codegen Public Headers */, + 30FF8C6BDEEBAA340CA894E4A00D2C54 /* method_handler_impl.h in Copy impl/codegen Public Headers */, + A670BA6550A05C603C07E20189C3F8E5 /* rpc_method.h in Copy impl/codegen Public Headers */, + 6F52FA56A4A060D8BAE9C9BB2AF497E9 /* rpc_service_method.h in Copy impl/codegen Public Headers */, + 47DF1E2E646EFB2937155310E3286557 /* serialization_traits.h in Copy impl/codegen Public Headers */, + 392E86B85A4BCE20A55BB49C9F12B772 /* server_callback.h in Copy impl/codegen Public Headers */, + 0CD3EEE320520B5C9306774064421874 /* server_callback_handlers.h in Copy impl/codegen Public Headers */, + 5BFB6AD3B98F7DDB88D863B77BA452F7 /* server_callback_impl.h in Copy impl/codegen Public Headers */, + 09E75454F1960689A95560402C23F95F /* server_context.h in Copy impl/codegen Public Headers */, + A93203F9550A9BCDFA2C5C6F83CB947C /* server_context_impl.h in Copy impl/codegen Public Headers */, + CA91D5CA44A43ACA8A96BC823B3EAD39 /* server_interceptor.h in Copy impl/codegen Public Headers */, + 2273006ACB36C6B191DF573B4C35C515 /* server_interface.h in Copy impl/codegen Public Headers */, + 045C9C7E321DA4050E62FC930F471AD5 /* service_type.h in Copy impl/codegen Public Headers */, + F859149E2E731191CE1A7262F4D7B5C6 /* slice.h in Copy impl/codegen Public Headers */, + 8D7F2D7B7516BF8C821A39E3BA329A27 /* status.h in Copy impl/codegen Public Headers */, + C6DABADE0E1560CF81F1D07747BAD5AC /* status_code_enum.h in Copy impl/codegen Public Headers */, + 519D20A3F6840B48B22C606FDA0758F9 /* string_ref.h in Copy impl/codegen Public Headers */, + D61DEACE85B3A53A58FCB33B6975BBF1 /* stub_options.h in Copy impl/codegen Public Headers */, + 60CC7DE8ED5D29F35D5F141B4AF76D6C /* sync.h in Copy impl/codegen Public Headers */, + 92BF864186A0DFE945F62FF56D54DF3C /* sync_stream.h in Copy impl/codegen Public Headers */, + 5B84207047635C0511B452DDDD2929E6 /* sync_stream_impl.h in Copy impl/codegen Public Headers */, + 083CB0A951B5FF5DD597ECF2C9D350B1 /* time.h in Copy impl/codegen Public Headers */, + ); + name = "Copy impl/codegen Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2EBEFF9032525F1C3BC304CA480C05CE /* Copy src/core/lib/security/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/transport"; + dstSubfolderSpec = 16; + files = ( + ED60D1CCB27C3A37401F7CA9AD6AD65A /* auth_filters.h in Copy src/core/lib/security/transport Private Headers */, + 68F0725BB62F41F78E9A36B405DE4E98 /* secure_endpoint.h in Copy src/core/lib/security/transport Private Headers */, + 5F2BE0220A75AF26B77090912A3504FA /* security_handshaker.h in Copy src/core/lib/security/transport Private Headers */, + B2339FD7D4F974F1AE3B8A5A181B5E2D /* target_authority_table.h in Copy src/core/lib/security/transport Private Headers */, + CA310773AF56C46033B0B58E22D774F1 /* tsi_error.h in Copy src/core/lib/security/transport Private Headers */, + ); + name = "Copy src/core/lib/security/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2EF9854F310F875F506142DCADF16901 /* Copy crypto/chacha Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/chacha"; + dstSubfolderSpec = 16; + files = ( + 155CAEF660EA953D13548F29CB93F6B7 /* internal.h in Copy crypto/chacha Private Headers */, + ); + name = "Copy crypto/chacha Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 2F7A7860591E295337FBAC754E0B62DF /* Copy src/core/lib/security/credentials/plugin Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/plugin"; + dstSubfolderSpec = 16; + files = ( + 0BB576B9B9D13C345DD5D157211CE208 /* plugin_credentials.h in Copy src/core/lib/security/credentials/plugin Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/plugin Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 304731C4C3DABE421A5F8A00D9881A2C /* Copy src/core/lib/security/util Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/util"; + dstSubfolderSpec = 16; + files = ( + 91158C155852DB083DEA4BD40AC31A17 /* json_util.h in Copy src/core/lib/security/util Private Headers */, + ); + name = "Copy src/core/lib/security/util Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 30923C69651043C3A16135421C8B5796 /* Copy ssl/test/runner/curve25519 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/ssl/test/runner/curve25519"; + dstSubfolderSpec = 16; + files = ( + A8D8745CEB36629ECC608D89AEFFF39F /* const_amd64.h in Copy ssl/test/runner/curve25519 Private Headers */, + ); + name = "Copy ssl/test/runner/curve25519 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 30BE2727A1F9C99CC4D19A14B5B72BF2 /* Copy src/core/ext/filters/http Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http"; + dstSubfolderSpec = 16; + files = ( + F34D6CB8D414B6FA5A155E5289F93FD6 /* client_authority_filter.h in Copy src/core/ext/filters/http Private Headers */, + ); + name = "Copy src/core/ext/filters/http Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 310A1B0731F0DD35941A85E604E1622C /* Copy types Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/types"; + dstSubfolderSpec = 16; + files = ( + 051AA3F3A808958C214E6213F0B39DC2 /* any.h in Copy types Public Headers */, + BC6FDB548A946B3933FFECFC9AF08FAB /* bad_any_cast.h in Copy types Public Headers */, + 78057BF16E20C9B8A25BF047BEEABB47 /* bad_optional_access.h in Copy types Public Headers */, + 3F7A072928942C356AF9818975C94B06 /* bad_variant_access.h in Copy types Public Headers */, + 1C533C395DDEC0B159D61F007245C01D /* compare.h in Copy types Public Headers */, + 4DCE6BA545C4EC2B4A5CE38B4DCACDCA /* optional.h in Copy types Public Headers */, + 4AD84927561D5FDD0026A2975E36727F /* span.h in Copy types Public Headers */, + B2CDDFEA1C479193C326184D359DE20B /* variant.h in Copy types Public Headers */, + ); + name = "Copy types Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 32D312A30A9288D00D97A178A0D61A2A /* Copy src/core/lib/debug Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/debug"; + dstSubfolderSpec = 16; + files = ( + 83B27496B7BE2FBA09141D6F5C24A551 /* stats.h in Copy src/core/lib/debug Private Headers */, + 69E4B0C33866A5AFAA5260550D6B09EC /* stats_data.h in Copy src/core/lib/debug Private Headers */, + DB671E8A4DC9FF7C7929DFDA92FCA80D /* trace.h in Copy src/core/lib/debug Private Headers */, + ); + name = "Copy src/core/lib/debug Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3327A827C0828F86763913165B862C60 /* Copy src/core/lib/json Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/json"; + dstSubfolderSpec = 16; + files = ( + 1FC9C77BBB53385CBFF9582C3F0AAB73 /* json.h in Copy src/core/lib/json Private Headers */, + ); + name = "Copy src/core/lib/json Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 357CEE98E09CF79E36971A296B062FA2 /* Copy src/core/ext/filters/deadline Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/deadline"; + dstSubfolderSpec = 16; + files = ( + A888400E0737C7E82E6794F86EB3882D /* deadline_filter.h in Copy src/core/ext/filters/deadline Private Headers */, + ); + name = "Copy src/core/ext/filters/deadline Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3587DF46ECD6B49A64B9C0BC91CC5D94 /* Copy src/core/lib/uri Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/uri"; + dstSubfolderSpec = 16; + files = ( + 033FCD2C2C6D381F8B2BFE09F7CEE3EE /* uri_parser.h in Copy src/core/lib/uri Private Headers */, + ); + name = "Copy src/core/lib/uri Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 36BF55EF5EA3D0066CFB932D92C57FFA /* Copy src/core/ext/filters/http/server Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/server"; + dstSubfolderSpec = 16; + files = ( + A3A7D864E7B1AF378F3BAFD742FA5963 /* http_server_filter.h in Copy src/core/ext/filters/http/server Private Headers */, + ); + name = "Copy src/core/ext/filters/http/server Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 382D7E38E31849D334E19E296B262782 /* Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/auth"; + dstSubfolderSpec = 16; + files = ( + 9C262047738ADDD23D7F24D751384E9E /* cert.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3836C9FC21CD04FB737DF7106035B41E /* Copy time Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/time"; + dstSubfolderSpec = 16; + files = ( + 1EB2E3036B76DCBCF9EEE3546C726BA5 /* civil_time.h in Copy time Public Headers */, + 845AD26A0FC068982AE423B002ADD6F5 /* clock.h in Copy time Public Headers */, + 86629BC373187727559847C02FE008B7 /* time.h in Copy time Public Headers */, + ); + name = "Copy time Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 399598D0C8C4946417FA58409B8F65B1 /* Copy src/core/lib/security/security_connector/alts Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/alts"; + dstSubfolderSpec = 16; + files = ( + F33AA7ECE49A6ADBB3DAB2636494CEF3 /* alts_security_connector.h in Copy src/core/lib/security/security_connector/alts Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/alts Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3B393003226E7B56C1A6723609654893 /* Copy ssl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/ssl"; + dstSubfolderSpec = 16; + files = ( + 2405B9D41B9528DDDC0FE2316F7279E4 /* internal.h in Copy ssl Private Headers */, + ); + name = "Copy ssl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3B630F972930201DE7CFE3039E2DC7E4 /* Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/health/v1"; + dstSubfolderSpec = 16; + files = ( + F191F8AE11C0B050118FF36C8C1EEA1D /* health.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3C3B8B9A1C1D1D387122ABBA09B650E7 /* Copy src/core/lib/channel Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/channel"; + dstSubfolderSpec = 16; + files = ( + D5D951EC6126A435A08260DCBEA7E7A2 /* channel_args.h in Copy src/core/lib/channel Private Headers */, + CADADF5E53EEF58F5FBEEBF7570F8BD9 /* channel_stack.h in Copy src/core/lib/channel Private Headers */, + 5A510C0817453BD27B18EF30F86A5B3A /* channel_stack_builder.h in Copy src/core/lib/channel Private Headers */, + 74F5BB9418968C47CC4808100FC09367 /* channel_trace.h in Copy src/core/lib/channel Private Headers */, + E71FD8765C36801FC4BCFC39C20C5088 /* channelz.h in Copy src/core/lib/channel Private Headers */, + 3B1FA3DF27B7040FA2847B0500A60792 /* channelz_registry.h in Copy src/core/lib/channel Private Headers */, + D4C042F85E92F2624669EBF8A918A1EF /* connected_channel.h in Copy src/core/lib/channel Private Headers */, + AC35F3CEE33B35686B38B458C3A49258 /* context.h in Copy src/core/lib/channel Private Headers */, + 06F2FF087F1F9A343B24D730467268EE /* handshaker.h in Copy src/core/lib/channel Private Headers */, + 8EDA42CA377521F2FAFBB831BEBD5E9D /* handshaker_factory.h in Copy src/core/lib/channel Private Headers */, + 491407C6EACC99FE12CC0F7761901145 /* handshaker_registry.h in Copy src/core/lib/channel Private Headers */, + 5EDD5B1E66849BCE336CB7A3CE06F497 /* status_util.h in Copy src/core/lib/channel Private Headers */, + ); + name = "Copy src/core/lib/channel Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3C61A74A77F085DA08FAE44FD04E42D5 /* Copy src/core/lib/security/security_connector/tls Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/tls"; + dstSubfolderSpec = 16; + files = ( + D110D6C747DEE31ACEC8B19D3738AADD /* tls_security_connector.h in Copy src/core/lib/security/security_connector/tls Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/tls Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3D473148AE226A221F5BD14723C04F38 /* Copy meta Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/meta"; + dstSubfolderSpec = 16; + files = ( + 981B2CDA5073C09ECCE97661F72F94A7 /* type_traits.h in Copy meta Public Headers */, + ); + name = "Copy meta Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 3F5EE70ED0169EFDEAD1AA684C44EB41 /* Copy impl/codegen Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/impl/codegen"; + dstSubfolderSpec = 16; + files = ( + 4223D9375240878440DD7FDD150E4DBC /* atm.h in Copy impl/codegen Public Headers */, + EFA2DDFA2328F0EB200D7B03C1C64434 /* atm_gcc_atomic.h in Copy impl/codegen Public Headers */, + B50FB617D12C1D1E05E06E2253F1452D /* atm_gcc_sync.h in Copy impl/codegen Public Headers */, + 2A0CB297BB34992A14E0CADB80CBD584 /* atm_windows.h in Copy impl/codegen Public Headers */, + DDE2FF0A8CAB9A39CCD7713A324D0F75 /* byte_buffer.h in Copy impl/codegen Public Headers */, + 688FB402D56E36D085933715C2D8322D /* byte_buffer_reader.h in Copy impl/codegen Public Headers */, + 532E503B8E57054771CF77EAF7097776 /* compression_types.h in Copy impl/codegen Public Headers */, + 46EC18C03C6C423E692B40CB34931D0E /* connectivity_state.h in Copy impl/codegen Public Headers */, + 373EA3F50EF228EDF4E6EA7EE6293BDC /* fork.h in Copy impl/codegen Public Headers */, + C64A8E23AF89FF247F8FE91A6C7070B4 /* gpr_slice.h in Copy impl/codegen Public Headers */, + B0A817DC8BBD506EA6B5755F066D4057 /* gpr_types.h in Copy impl/codegen Public Headers */, + C3D4A0EB2EAC672DE99C7748CF3138F1 /* grpc_types.h in Copy impl/codegen Public Headers */, + 8DF6441B3D3BC7656F81655AC1D0B62C /* log.h in Copy impl/codegen Public Headers */, + 723124C0FE28A9DC1476B0E650D94315 /* port_platform.h in Copy impl/codegen Public Headers */, + 1F8D45CD7C3A5CB1EBCBA5FE133D80C9 /* propagation_bits.h in Copy impl/codegen Public Headers */, + 062ACB1E8CDAD741608C8088B9FEABE2 /* slice.h in Copy impl/codegen Public Headers */, + A7F9365A291CBB16B3C688C4DA3ED962 /* status.h in Copy impl/codegen Public Headers */, + 6F5FE9FD2AAD466BC0BD9F55B988B3D1 /* sync.h in Copy impl/codegen Public Headers */, + 932665654244F6BBA7F2448EFA1BE2E0 /* sync_abseil.h in Copy impl/codegen Public Headers */, + 2880C5A5A731B6F4871F89FCEBB6972F /* sync_custom.h in Copy impl/codegen Public Headers */, + 59778856ACA8027182877B137BAEF548 /* sync_generic.h in Copy impl/codegen Public Headers */, + 08EF8AD9802EB9FF4326396B9A414693 /* sync_posix.h in Copy impl/codegen Public Headers */, + 8F33AACE58A818F8A9BE911F183CB8D1 /* sync_windows.h in Copy impl/codegen Public Headers */, + ); + name = "Copy impl/codegen Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 44C747C86BC33F517D40FC2F9EA64B4C /* Copy src/core/lib/security/credentials/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/fake"; + dstSubfolderSpec = 16; + files = ( + A27306BE312587964511BA132E2CF165 /* fake_credentials.h in Copy src/core/lib/security/credentials/fake Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4617E61F0D13A3DD1CE84F1917AAAAC4 /* Copy crypto/fipsmodule/md5 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/md5"; + dstSubfolderSpec = 16; + files = ( + E586402873F908969A74D3DBE9FC4594 /* internal.h in Copy crypto/fipsmodule/md5 Private Headers */, + ); + name = "Copy crypto/fipsmodule/md5 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4715CBFF9037E78F341829BD7B623A6A /* Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/listener"; + dstSubfolderSpec = 16; + files = ( + 3BBAB1728012F47BE1C800D7132E14BB /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + 9924F2D03EE4097DD24F8E707B41FE50 /* listener_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + A404C43912D660E62C39687DC73AAF16 /* udp_listener_config.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4779D3001F58A8ED47F2651323857FFA /* Copy src/core/ext/filters/message_size Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/message_size"; + dstSubfolderSpec = 16; + files = ( + 6EC52727CD1750229F241B8A255FE01A /* message_size_filter.h in Copy src/core/ext/filters/message_size Private Headers */, + ); + name = "Copy src/core/ext/filters/message_size Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4797331282621435D810E17B5520FD7D /* Copy crypto/fipsmodule/aes Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/aes"; + dstSubfolderSpec = 16; + files = ( + 056B31B9F51F82304C203DD31E1DC8C6 /* internal.h in Copy crypto/fipsmodule/aes Private Headers */, + ); + name = "Copy crypto/fipsmodule/aes Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 49A13FCAEFDEB814B12F5EB58BAD3D3B /* Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/dns"; + dstSubfolderSpec = 16; + files = ( + C7C0EE4E38E417436D980C703D15EFA3 /* dns_resolver_selection.h in Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/dns Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 49CF00E147A76577850B1700E28356EB /* Copy . Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/."; + dstSubfolderSpec = 16; + files = ( + 1BD113211A5B4C548F5A74C0BD73ED81 /* byte_buffer.h in Copy . Public Headers */, + 067609CC44C1A6E06EABF7B480AED10F /* byte_buffer_reader.h in Copy . Public Headers */, + 0267FB1BCD2B90F76ED6DB72B118CA99 /* census.h in Copy . Public Headers */, + D4CD0AA4F3D04C14D5C112F1FA9DB7C3 /* compression.h in Copy . Public Headers */, + 0735253BFF7A9792A356B624D3FEAEAA /* fork.h in Copy . Public Headers */, + 6026BEB1D3637F0F731E757D7DA3258D /* grpc.h in Copy . Public Headers */, + B917802EE7A964AD03798CE94693AB0A /* grpc_posix.h in Copy . Public Headers */, + 20A17A3024706B69480A89561DA76B9E /* grpc_security.h in Copy . Public Headers */, + 7B283B2DB19519872A87506066C49BF5 /* grpc_security_constants.h in Copy . Public Headers */, + 9CBF2F3080A3472AE90493C0C66B6DB8 /* load_reporting.h in Copy . Public Headers */, + C7947F91884651B9932EDF75A54144B0 /* slice.h in Copy . Public Headers */, + 6D2DC33EEC1BD9C9F000E9C42B561AC5 /* slice_buffer.h in Copy . Public Headers */, + F43DB87FE177FC16D0743C1796E38D22 /* status.h in Copy . Public Headers */, + ); + name = "Copy . Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4A4690FE0B7B65955D710ECEDB459AFB /* Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/lb/v1"; + dstSubfolderSpec = 16; + files = ( + C29EA863E57D2709E05528519A88A163 /* load_balancer.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4B11B901F0AFBF09005EF041019CB663 /* Copy strings Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/strings"; + dstSubfolderSpec = 16; + files = ( + 5999E32B3CBBDAF22D41EA4802B20DE5 /* ascii.h in Copy strings Public Headers */, + AE0D215BC33CED5C05E766BB91AADA23 /* charconv.h in Copy strings Public Headers */, + C77B8C354220CD3068D650D6D642366F /* escaping.h in Copy strings Public Headers */, + E47FD20C98B516B01DFEA874CC0D9F49 /* match.h in Copy strings Public Headers */, + C4D97EEF87D4D85B1FCFFC26A6ED2519 /* numbers.h in Copy strings Public Headers */, + D05AF216EC07255B4281D81B497D6954 /* str_cat.h in Copy strings Public Headers */, + FE8275BA749FE78131A76134D32BC6D3 /* str_format.h in Copy strings Public Headers */, + 95D26A7F242AE80D7763E4CDEE3C199A /* str_join.h in Copy strings Public Headers */, + D2B4627FBA56079E6304554F51B770C4 /* str_replace.h in Copy strings Public Headers */, + 2F0180ABF844DB0FBBE5CF029C8B0CB5 /* str_split.h in Copy strings Public Headers */, + 809C0AC6FD41B4FE7E2339B5B0FF04F8 /* string_view.h in Copy strings Public Headers */, + 5321DACB24007CF7D4DF1583668E2CA5 /* strip.h in Copy strings Public Headers */, + 581DAD6F88FFB26144F09C1C40A4FE63 /* substitute.h in Copy strings Public Headers */, + ); + name = "Copy strings Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4C543F13ED4145AC213920A02078EC15 /* Copy utility Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/utility"; + dstSubfolderSpec = 16; + files = ( + 1D71BD2F2149F64EFBBA2E95C923B438 /* utility.h in Copy utility Public Headers */, + ); + name = "Copy utility Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4C9915B49854742CFE34B96635B5EA5D /* Copy third_party/upb/upb Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/third_party/upb/upb"; + dstSubfolderSpec = 16; + files = ( + 30A36505D379E3D031DF8E0B7D2875B6 /* decode.h in Copy third_party/upb/upb Private Headers */, + 03F31F82EE186AADD5DA9601E2D08404 /* encode.h in Copy third_party/upb/upb Private Headers */, + 2A269668FA45A9735724F4F9DE18DABF /* generated_util.h in Copy third_party/upb/upb Private Headers */, + DAF9C703225F9CEB70F610CB7849B386 /* msg.h in Copy third_party/upb/upb Private Headers */, + 450B4AB4A283148C2A597FFC23F50EB8 /* port_def.inc in Copy third_party/upb/upb Private Headers */, + CBCAE88BBA5E6261C36687B1C0015F25 /* port_undef.inc in Copy third_party/upb/upb Private Headers */, + F5F48A0C1577861C5B012DD5C5658909 /* table.int.h in Copy third_party/upb/upb Private Headers */, + C6C13CC8BAA4590ADE8072BCCA36B1BE /* upb.h in Copy third_party/upb/upb Private Headers */, + ); + name = "Copy third_party/upb/upb Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4CA3B56863BCFF37FF8CB5A2F657962F /* Copy synchronization/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/synchronization/internal"; + dstSubfolderSpec = 16; + files = ( + D39746CED2D0D6B9B636A2B2842CB692 /* create_thread_identity.h in Copy synchronization/internal Public Headers */, + 16CCA5D888CAC13726B29BADCC2B5A67 /* graphcycles.h in Copy synchronization/internal Public Headers */, + C96E189326B06620C7A320F8F8E5E78F /* kernel_timeout.h in Copy synchronization/internal Public Headers */, + CCF3DD55B6BA8AAE0D32FAD991C5C44A /* mutex_nonprod.inc in Copy synchronization/internal Public Headers */, + EFA47F8989AD82AAA3ABB1AF0EE8F037 /* per_thread_sem.h in Copy synchronization/internal Public Headers */, + 83134939C4C43DFFD015F17DAC92865C /* waiter.h in Copy synchronization/internal Public Headers */, + ); + name = "Copy synchronization/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4CEE960D2D12BB257A35F0C1F4E58D87 /* Copy time/internal/cctz/include/cctz Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/time/internal/cctz/include/cctz"; + dstSubfolderSpec = 16; + files = ( + 3A3F856F6EBF540236F195FFCA443052 /* civil_time.h in Copy time/internal/cctz/include/cctz Public Headers */, + 980210C489B57BD51A3193011EE8979F /* civil_time_detail.h in Copy time/internal/cctz/include/cctz Public Headers */, + A796C289087E6EE83DD1FF8CD541F00B /* time_zone.h in Copy time/internal/cctz/include/cctz Public Headers */, + 0B9493921A7BD71EDBAFA16D9D106188 /* zone_info_source.h in Copy time/internal/cctz/include/cctz Public Headers */, + ); + name = "Copy time/internal/cctz/include/cctz Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 4EFA727BF37CE041F18CECEFADD00D98 /* Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/cluster"; + dstSubfolderSpec = 16; + files = ( + BC737D7FBC43DBA2FDD225C4DF5DF581 /* circuit_breaker.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + 4077FFFC9F912BD94B5992041E972DF8 /* filter.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + 4900AB5C7C7D92A6ACB8BA28E8D8592A /* outlier_detection.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 50910F21DD8CF7D309F549942EE2558E /* Copy src/core/lib/surface Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/surface"; + dstSubfolderSpec = 16; + files = ( + 282BFA19C115CD46B0169808D5A10E91 /* api_trace.h in Copy src/core/lib/surface Private Headers */, + 9AF308BA6420FD18699392CBD41600F0 /* call.h in Copy src/core/lib/surface Private Headers */, + 9B198BE05DE08B9C1A0A8E221A462C22 /* call_test_only.h in Copy src/core/lib/surface Private Headers */, + E78A3F31E9FD428538A4460C0194B921 /* channel.h in Copy src/core/lib/surface Private Headers */, + ECD488FB1AA383ED5A2D28F01585370A /* channel_init.h in Copy src/core/lib/surface Private Headers */, + 3CDBF4175B112FCD06D1ECB0B83DBBF3 /* channel_stack_type.h in Copy src/core/lib/surface Private Headers */, + 508D36FD074E5D5B2D1B3B309674847C /* completion_queue.h in Copy src/core/lib/surface Private Headers */, + 9B2EF54C6F76117B58473A040CAD0CEA /* completion_queue_factory.h in Copy src/core/lib/surface Private Headers */, + 6AA188DAE78D74EC9314FF00CE9FAC9F /* event_string.h in Copy src/core/lib/surface Private Headers */, + D5686439DFADECDF03CB26CCACE6876D /* init.h in Copy src/core/lib/surface Private Headers */, + 61B46F08FAE05CFF62211B7C569960D4 /* lame_client.h in Copy src/core/lib/surface Private Headers */, + ADDA4DA6DF8464F2632714FCE7E4B7BD /* server.h in Copy src/core/lib/surface Private Headers */, + 600E557052DD77D09AC67F6096027D6E /* validate_metadata.h in Copy src/core/lib/surface Private Headers */, + ); + name = "Copy src/core/lib/surface Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 515FEEF5C2F0981C506B82831FA57EA3 /* Copy src/core/ext/transport/chttp2/client Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/client"; + dstSubfolderSpec = 16; + files = ( + BDD070BA6F66F93CBE80A8326528013F /* authority.h in Copy src/core/ext/transport/chttp2/client Private Headers */, + BA94D554FEF2121866DBD5BBFD589F99 /* chttp2_connector.h in Copy src/core/ext/transport/chttp2/client Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/client Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 51F006D3F9C370645ECA520F6376015D /* Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2"; + dstSubfolderSpec = 16; + files = ( + 86A7F58700D9A309EAF1B40F4EB990C6 /* http_connection_manager.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 523405D7EC2D5892ABBFDCB2DEC39FE4 /* Copy src/cpp/server Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/cpp/server"; + dstSubfolderSpec = 16; + files = ( + D9CA0AB5BF688DC9015C652A7CA264C5 /* dynamic_thread_pool.h in Copy src/cpp/server Private Headers */, + AF40A2FFF746F2817558D6B291F5B939 /* external_connection_acceptor_impl.h in Copy src/cpp/server Private Headers */, + 12209EEA82BCDD4C2B250BA5484E615F /* secure_server_credentials.h in Copy src/cpp/server Private Headers */, + FBFD59F13ADF7C5CFD498901F9D05479 /* thread_pool_interface.h in Copy src/cpp/server Private Headers */, + ); + name = "Copy src/cpp/server Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 523E8536CE7903CC31C449FB00E50516 /* Copy src/core/lib/compression Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/compression"; + dstSubfolderSpec = 16; + files = ( + 4B5116D2C7DBCBFD4946DDE380BF4BB0 /* algorithm_metadata.h in Copy src/core/lib/compression Private Headers */, + 5FDA371E4D7B53EC3036FE6573C8966E /* compression_args.h in Copy src/core/lib/compression Private Headers */, + E01BC32F18B1917502ECA14D168A64D1 /* compression_internal.h in Copy src/core/lib/compression Private Headers */, + A7417FCC5EE7CBA1C7FD4EF268549C62 /* message_compress.h in Copy src/core/lib/compression Private Headers */, + B7317AD61CA8D01035D12EA7D40EED03 /* stream_compression.h in Copy src/core/lib/compression Private Headers */, + 278EE97438596B508D811F357010FD09 /* stream_compression_gzip.h in Copy src/core/lib/compression Private Headers */, + 466E30CECC5719A9438A3814834E0590 /* stream_compression_identity.h in Copy src/core/lib/compression Private Headers */, + ); + name = "Copy src/core/lib/compression Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 54D71A82E2AB941DCDE437B6C2AD460A /* Copy src/core/lib/uri Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/uri"; + dstSubfolderSpec = 16; + files = ( + 0B4FB0B28081816458E7976D81AA3D78 /* uri_parser.h in Copy src/core/lib/uri Private Headers */, + ); + name = "Copy src/core/lib/uri Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 56B02A0DE21F61733545C69F6829E23C /* Copy debugging/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/debugging/internal"; + dstSubfolderSpec = 16; + files = ( + 47DD8A4CAE3CFCD35306D8FC837F4D6E /* address_is_readable.h in Copy debugging/internal Public Headers */, + 6A083A382726F1E98E64B1A9BF285AE7 /* demangle.h in Copy debugging/internal Public Headers */, + 119AB301E0D3583B4623199CC44C63BA /* elf_mem_image.h in Copy debugging/internal Public Headers */, + 32F1AAE68207A5B5E3782205052DED29 /* stacktrace_aarch64-inl.inc in Copy debugging/internal Public Headers */, + 6DB567631D02BD1EB77FB2A0051E1BE6 /* stacktrace_arm-inl.inc in Copy debugging/internal Public Headers */, + 1E4B0D522E9B94A74CBA7996A7A20F88 /* stacktrace_config.h in Copy debugging/internal Public Headers */, + 727B6B0F391661F86018CB7CB79679FD /* stacktrace_generic-inl.inc in Copy debugging/internal Public Headers */, + CDAFAD927B2D1B3A1FEBCEC383D8150E /* stacktrace_powerpc-inl.inc in Copy debugging/internal Public Headers */, + 34EF83FC86AD70D030F1F1249742D572 /* stacktrace_unimplemented-inl.inc in Copy debugging/internal Public Headers */, + 3AEB38D52B495886D86B722DEF52FBA1 /* stacktrace_win32-inl.inc in Copy debugging/internal Public Headers */, + 8F7F9794DA030CBA102236C78D30A6D4 /* stacktrace_x86-inl.inc in Copy debugging/internal Public Headers */, + 330FB8D28172BCA331430FEC13C0BAB1 /* symbolize.h in Copy debugging/internal Public Headers */, + EC0AFE051F6008E991CD801CE37C108A /* vdso_support.h in Copy debugging/internal Public Headers */, + ); + name = "Copy debugging/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 57C40966BCD4856B90E74DC267A765D3 /* Copy src/core/lib/security/credentials/google_default Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/google_default"; + dstSubfolderSpec = 16; + files = ( + 85A417F742F7784FC353FB9817A80E6F /* google_default_credentials.h in Copy src/core/lib/security/credentials/google_default Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/google_default Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 590C68C6BF6FFD85D753E3B2B61A86A1 /* Copy src/core/ext/transport/chttp2/alpn Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/alpn"; + dstSubfolderSpec = 16; + files = ( + 6F50A7D8980329952C7FF1FBE5CA495F /* alpn.h in Copy src/core/ext/transport/chttp2/alpn Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/alpn Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5A41CDE111FC3C81856E2A17447B76ED /* Copy src/core/ext/transport/chttp2/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/transport"; + dstSubfolderSpec = 16; + files = ( + F5F8D50A2300C98E9294734417845F9B /* bin_decoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + C81298549E26FCE221993076AA5405B3 /* bin_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + EF2C1F949CA7D9365563BEE147936C1D /* chttp2_transport.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 7644CF862715E285682966DA89401196 /* context_list.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 0F0553B42F1807CE2A1B7FAC797DFFD0 /* flow_control.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + A2E75A713EBE8407DF099D95880B1E88 /* frame.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + F8BB33B82F2B622F3E04754859394ABC /* frame_data.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 3345F00C12557251F45ED6E58A6864E7 /* frame_goaway.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + DB11F16054A89329AEE25D710AF86683 /* frame_ping.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + A0AE37464A38C462512704F4213CD1EB /* frame_rst_stream.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 30E4618F370939DC4568643D51B3C63E /* frame_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + C10377687379EBEDB7A179441E68A2CA /* frame_window_update.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 47F8A08FF86C506EFD055CEFB597685F /* hpack_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + EB9FE334D2424D28FD6D81F39355B450 /* hpack_parser.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + AB8A0FACE441AB2DD01DB16867DE9DF9 /* hpack_table.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 3EA62D5902D146EE395F18294371A655 /* http2_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 6A1896433644F33A6AC0B114545BF5AE /* huffsyms.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 002FFEC0931E3433AB0AAE2DBEE9E664 /* incoming_metadata.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + C4AE1772D01BF9BFD91B58D80AED67C0 /* internal.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 6E96C2312155A0A2F459FD0B5C1B4AAD /* stream_map.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + B3F63CAC69258C8040575708778D0270 /* varint.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5B14D3AAB1C1B87B5B552B87575499CC /* Copy crypto/x509 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/x509"; + dstSubfolderSpec = 16; + files = ( + 942EDADBB31372C8A5635233F3A915A7 /* charmap.h in Copy crypto/x509 Private Headers */, + 891731C9C792A2E8B8505AC8D6BAB7BD /* internal.h in Copy crypto/x509 Private Headers */, + D0A1634089638E4221F50E6CC9B18F19 /* vpm_int.h in Copy crypto/x509 Private Headers */, + ); + name = "Copy crypto/x509 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5B699A2A4C2D1C2669D8E6931523C83B /* Copy crypto/poly1305 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/poly1305"; + dstSubfolderSpec = 16; + files = ( + 8863D664EB760115DC21CBB9535D0905 /* internal.h in Copy crypto/poly1305 Private Headers */, + ); + name = "Copy crypto/poly1305 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5BBB2C9BC9B8BFC8A7ECA18C555DA88E /* Copy src/core/lib/surface Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/surface"; + dstSubfolderSpec = 16; + files = ( + D4F2257E9F019B0C2F8C0093F10165DD /* api_trace.h in Copy src/core/lib/surface Private Headers */, + 816E6F3EA6A5B297D378060FC3ED3307 /* call.h in Copy src/core/lib/surface Private Headers */, + 58C2F720FFA09D73A9FF1A6C360A00D4 /* call_test_only.h in Copy src/core/lib/surface Private Headers */, + 2C16EFD82B4C70972378E4654A141596 /* channel.h in Copy src/core/lib/surface Private Headers */, + 85132ACBB5A38AE0BE8998B2559125A7 /* channel_init.h in Copy src/core/lib/surface Private Headers */, + D7A7A881E62A5B7FE8D4C7923308562F /* channel_stack_type.h in Copy src/core/lib/surface Private Headers */, + 19955FC242B861DAF6B921D41B0292E4 /* completion_queue.h in Copy src/core/lib/surface Private Headers */, + 2C52D76E8EEFD496BD5FC3138F23D63E /* completion_queue_factory.h in Copy src/core/lib/surface Private Headers */, + 2395634D2BAEB1AB0BDA57DFF881FA46 /* event_string.h in Copy src/core/lib/surface Private Headers */, + B9D65038EAF9EA62554D4808F46F1BAE /* init.h in Copy src/core/lib/surface Private Headers */, + 11DF007A4A1F70EF0A3F6AAFF9A522AF /* lame_client.h in Copy src/core/lib/surface Private Headers */, + 0E035F1D62015F8A36CB86543250E081 /* server.h in Copy src/core/lib/surface Private Headers */, + 1633A83614618D31D3BB4D2DAF9E6D9B /* validate_metadata.h in Copy src/core/lib/surface Private Headers */, + ); + name = "Copy src/core/lib/surface Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5CF673EDF03402A736498E058F6D15E8 /* Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/matcher"; + dstSubfolderSpec = 16; + files = ( + 67BC155BEA5974617185690179654B5E /* regex.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + DD713203418B726BBEE5BB42AD2D6EBA /* string.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5D33039548481DB1B9F40BE786F112D2 /* Copy src/core/lib/security/context Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/context"; + dstSubfolderSpec = 16; + files = ( + 33336FA7E8FAE4B5BD35A813ED778CB4 /* security_context.h in Copy src/core/lib/security/context Private Headers */, + ); + name = "Copy src/core/lib/security/context Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5EE75D722C31D167D98AAB68E3F84F47 /* Copy impl Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/impl"; + dstSubfolderSpec = 16; + files = ( + 475477A63236C6683330C2F9F76FC70B /* call.h in Copy impl Public Headers */, + DAE03785A48AC969630411E050603CD7 /* channel_argument_option.h in Copy impl Public Headers */, + CF146A6B8EE237E22A272682238E41C4 /* client_unary_call.h in Copy impl Public Headers */, + 3CA75D8EF6EC8D5EEA74D48251E5154F /* grpc_library.h in Copy impl Public Headers */, + E64B6F1F679BCF79274E66D901A7035F /* method_handler_impl.h in Copy impl Public Headers */, + 4527ECFCAF9D5592EFAB04D5CCB1AB2F /* rpc_method.h in Copy impl Public Headers */, + 4327FAC03B676B7F476EC72BD43037C1 /* rpc_service_method.h in Copy impl Public Headers */, + 3904722F2164DAADBAD3AEBBB306CFAF /* serialization_traits.h in Copy impl Public Headers */, + 2782A6A9D2C26C0B6B0BA24601281F58 /* server_builder_option.h in Copy impl Public Headers */, + 9845C8CB6778EF02175D11B7724621FC /* server_builder_option_impl.h in Copy impl Public Headers */, + 0970E4E74410C99AD985841A7F51C400 /* server_builder_plugin.h in Copy impl Public Headers */, + 99CB98787F476CCF369D06F131750A8F /* server_initializer.h in Copy impl Public Headers */, + 6E50B808F3CB1EDC3263F96DEBDE12CF /* server_initializer_impl.h in Copy impl Public Headers */, + 89EC054EFD5A5BFC3DDA4FBAA6EB7EE7 /* service_type.h in Copy impl Public Headers */, + ); + name = "Copy impl Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 600FD8BBEABCD7765EA669E6B4C3A0A9 /* Copy algorithm Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/algorithm"; + dstSubfolderSpec = 16; + files = ( + 808526F87D382516DE3A5FFDA1340A3D /* algorithm.h in Copy algorithm Public Headers */, + 9A070872ECCF2CBA238097C193DB60F9 /* container.h in Copy algorithm Public Headers */, + ); + name = "Copy algorithm Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 60CC508CCF58F8EE07F1EF0D0B3BF685 /* Copy src/core/lib/security/security_connector/tls Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/tls"; + dstSubfolderSpec = 16; + files = ( + 61971CAD343DCD23EADAE6A7EB1AB76B /* tls_security_connector.h in Copy src/core/lib/security/security_connector/tls Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/tls Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 61AC98C6A7AB54E0C1EC7F5433531537 /* Copy src/core/lib/iomgr Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr"; + dstSubfolderSpec = 16; + files = ( + E41D84243D410468AC576843116DE1C9 /* block_annotate.h in Copy src/core/lib/iomgr Private Headers */, + 973962FE51456A4C04CADFA7161B5C67 /* buffer_list.h in Copy src/core/lib/iomgr Private Headers */, + 315F54C543C19F2A25C6D991CE41A0BB /* call_combiner.h in Copy src/core/lib/iomgr Private Headers */, + 80D4E44A15D927D97AA981AC59DE71BC /* cfstream_handle.h in Copy src/core/lib/iomgr Private Headers */, + 99B5AC7111F2116C8F7359513526C258 /* closure.h in Copy src/core/lib/iomgr Private Headers */, + 3D8664B92FE4347ED9A2C1F93BE29AD1 /* combiner.h in Copy src/core/lib/iomgr Private Headers */, + 7931B3BF2237025942ABF2C491ACD69C /* dynamic_annotations.h in Copy src/core/lib/iomgr Private Headers */, + BE63D5974C1E51BC438A44E3E49BA0C3 /* endpoint.h in Copy src/core/lib/iomgr Private Headers */, + DF49CE050EEFF65687EE4A10B40B9A64 /* endpoint_cfstream.h in Copy src/core/lib/iomgr Private Headers */, + CCDDE31B28C098C0E1DD2D6574E0BBB1 /* endpoint_pair.h in Copy src/core/lib/iomgr Private Headers */, + D6DF79F659B2BCD212BF6F7CD42CB578 /* error.h in Copy src/core/lib/iomgr Private Headers */, + 12FBBC91F3A9C3FA4FDF3AC8635E08A2 /* error_cfstream.h in Copy src/core/lib/iomgr Private Headers */, + 6D2FB7E76722BF966BCC6D18B38A84C6 /* error_internal.h in Copy src/core/lib/iomgr Private Headers */, + 588727029257E38C685C0D2B69E5BE94 /* ev_epoll1_linux.h in Copy src/core/lib/iomgr Private Headers */, + 5113C7EE29D6C9B4AAB857C2B3B3F6D2 /* ev_epollex_linux.h in Copy src/core/lib/iomgr Private Headers */, + 0BFFA96E47910DFE0422FCEB67190873 /* ev_poll_posix.h in Copy src/core/lib/iomgr Private Headers */, + 405B8855B213D073E55A557D8132901B /* ev_posix.h in Copy src/core/lib/iomgr Private Headers */, + 540A25D0376C30D0699569566C6A99B5 /* exec_ctx.h in Copy src/core/lib/iomgr Private Headers */, + 2951FB661282F61D65B1409E51C21E5E /* executor.h in Copy src/core/lib/iomgr Private Headers */, + 91D389ECA642F0A5E64D68B5CC7AB26F /* gethostname.h in Copy src/core/lib/iomgr Private Headers */, + 6F106878D8AAF25E0CAB0249B3B15DF5 /* grpc_if_nametoindex.h in Copy src/core/lib/iomgr Private Headers */, + 1C656F35F83F1D490D7AAE6F83B502B3 /* internal_errqueue.h in Copy src/core/lib/iomgr Private Headers */, + 334CCDF1C47F282F02451380ADC488DA /* iocp_windows.h in Copy src/core/lib/iomgr Private Headers */, + E86C9A5534791F1F2376315C3DEDA190 /* iomgr.h in Copy src/core/lib/iomgr Private Headers */, + 07F79A44EDCD74B4A784EFC8C079CFF6 /* iomgr_custom.h in Copy src/core/lib/iomgr Private Headers */, + 841B898B0319E60D3AB603DC695F8460 /* iomgr_internal.h in Copy src/core/lib/iomgr Private Headers */, + F444D7B28F5D9F46CAD7EAEAE669085D /* iomgr_posix.h in Copy src/core/lib/iomgr Private Headers */, + E0E941A5C69E26ACF2D9C2988D781B9F /* is_epollexclusive_available.h in Copy src/core/lib/iomgr Private Headers */, + 0DCF3B1D5D4FEAC11560961A46DF1F7D /* load_file.h in Copy src/core/lib/iomgr Private Headers */, + C3FFC74E387BBCB594C20934070B150A /* lockfree_event.h in Copy src/core/lib/iomgr Private Headers */, + 39C08D85255F9FA0120B36FB7AD4AD08 /* nameser.h in Copy src/core/lib/iomgr Private Headers */, + 1648620A191627333651C8A346CDD7CF /* polling_entity.h in Copy src/core/lib/iomgr Private Headers */, + AF0480FF1CCB335A53939EB899BF4DFD /* pollset.h in Copy src/core/lib/iomgr Private Headers */, + 6AD42D7BF63FF5BC39FFDCCF0227E905 /* pollset_custom.h in Copy src/core/lib/iomgr Private Headers */, + B982D96B500BF8AD00AF514B41E87D33 /* pollset_set.h in Copy src/core/lib/iomgr Private Headers */, + 74B6BBE4192D8628482B7FFF16AB560E /* pollset_set_custom.h in Copy src/core/lib/iomgr Private Headers */, + AF8712D16627D7EDA1C2A7EDC42B4F34 /* pollset_set_windows.h in Copy src/core/lib/iomgr Private Headers */, + E0F8B22B57C6EB249099C74FB0B479D1 /* pollset_windows.h in Copy src/core/lib/iomgr Private Headers */, + 288EE4AF87219D59D1D23E006961F92A /* port.h in Copy src/core/lib/iomgr Private Headers */, + 6977EA9DADB03EFDFDE5151052D8AF4D /* resolve_address.h in Copy src/core/lib/iomgr Private Headers */, + 6F04E5CA137B5BC4450EC3B3DCC3AC15 /* resolve_address_custom.h in Copy src/core/lib/iomgr Private Headers */, + C1C9AF98CD58B1BBAE19FE7D692873B6 /* resource_quota.h in Copy src/core/lib/iomgr Private Headers */, + E15C106EC5FD1A39E38A13C3C3BA4609 /* sockaddr.h in Copy src/core/lib/iomgr Private Headers */, + D1BF4BB45640F2D253C2D886A061862C /* sockaddr_custom.h in Copy src/core/lib/iomgr Private Headers */, + 8B20DBC75E1D8316BD5D647807465A43 /* sockaddr_posix.h in Copy src/core/lib/iomgr Private Headers */, + 403F32A974DADFC5EDD7B5C49EE3F153 /* sockaddr_utils.h in Copy src/core/lib/iomgr Private Headers */, + 5C03AA3114A2840A0673698F9216E8ED /* sockaddr_windows.h in Copy src/core/lib/iomgr Private Headers */, + 3FC52325A7BE6DF2E20536A96E8AFA27 /* socket_factory_posix.h in Copy src/core/lib/iomgr Private Headers */, + B8415FA51F1D875F1195594546625593 /* socket_mutator.h in Copy src/core/lib/iomgr Private Headers */, + 7023C64B2F1B8589E4A389092F0AD9FF /* socket_utils.h in Copy src/core/lib/iomgr Private Headers */, + 29DEB4299DECE0FC1AC5D6C079B4C8C4 /* socket_utils_posix.h in Copy src/core/lib/iomgr Private Headers */, + 0282CDDE6E19ECAEA6FC922837E63A9C /* socket_windows.h in Copy src/core/lib/iomgr Private Headers */, + CE2C25774082946FC46485DF04A348F5 /* sys_epoll_wrapper.h in Copy src/core/lib/iomgr Private Headers */, + 644F260DE57266D1206E60C838A32D3E /* tcp_client.h in Copy src/core/lib/iomgr Private Headers */, + 4687DD9FC43EFF8A4D0FAE4DCA0B6E8F /* tcp_client_posix.h in Copy src/core/lib/iomgr Private Headers */, + CC5384A301D7103714B5BFD64CBD2720 /* tcp_custom.h in Copy src/core/lib/iomgr Private Headers */, + D0A9D86CAAE0319A1AB9FF324F6241FD /* tcp_posix.h in Copy src/core/lib/iomgr Private Headers */, + 34F483CA7D48F3AB54C380FBAC85C580 /* tcp_server.h in Copy src/core/lib/iomgr Private Headers */, + 4197C3E01F588E4BE03DE2C942076727 /* tcp_server_utils_posix.h in Copy src/core/lib/iomgr Private Headers */, + 8C5046581E8D8468CA289039E4C5373B /* tcp_windows.h in Copy src/core/lib/iomgr Private Headers */, + 16F540C105110CB698244EB9390418AF /* time_averaged_stats.h in Copy src/core/lib/iomgr Private Headers */, + 795F7A3F2090AA55DA888DC7AD40CAFC /* timer.h in Copy src/core/lib/iomgr Private Headers */, + E753476441AE61DB70BD6180FCE170D6 /* timer_custom.h in Copy src/core/lib/iomgr Private Headers */, + B3A358987FA8B5D8EBA9332AAE58D3E8 /* timer_heap.h in Copy src/core/lib/iomgr Private Headers */, + 80B27A98FD7D0D803E101E70886B3E38 /* timer_manager.h in Copy src/core/lib/iomgr Private Headers */, + 467D1CDDE0E7B4519B3BE4EE9E6B9631 /* udp_server.h in Copy src/core/lib/iomgr Private Headers */, + D872AD4A9A2981B1F68C54F02882A1E9 /* unix_sockets_posix.h in Copy src/core/lib/iomgr Private Headers */, + D066096D2A089FCB59BB7C8918786A83 /* wakeup_fd_pipe.h in Copy src/core/lib/iomgr Private Headers */, + 6AAE22DC1BB77A4B0BD84E76067CDE1B /* wakeup_fd_posix.h in Copy src/core/lib/iomgr Private Headers */, + 699D9455F04A7B796C021A564DE96A63 /* work_serializer.h in Copy src/core/lib/iomgr Private Headers */, + ); + name = "Copy src/core/lib/iomgr Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 634B9B9B13BBE7CF420A593A9439C444 /* Copy src/core/ext/filters/client_channel/xds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/xds"; + dstSubfolderSpec = 16; + files = ( + A3FD4D7DE00E573CF87C6EB735A70312 /* xds_api.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 6869A549E5B5EF86E1F9E9A339FA1979 /* xds_bootstrap.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 39891F86B6161B8A6D52A2E7FD936E7B /* xds_channel.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 8CF6A3F9261BCAAB1B02A8C5976A5296 /* xds_channel_args.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 69A8DB39EAD8B80E337A271544EA0593 /* xds_client.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 30D2AE4808253A5604CE3108FA99605C /* xds_client_stats.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/xds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 63679165D2A875315D90AE67C84F062A /* Copy src/core/ext/filters/deadline Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/deadline"; + dstSubfolderSpec = 16; + files = ( + 84D3C9D3DAFE523B87352E902A2A5E3A /* deadline_filter.h in Copy src/core/ext/filters/deadline Private Headers */, + ); + name = "Copy src/core/ext/filters/deadline Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 65E974274A77A1327315E1F39CF5AD6B /* Copy src/core/lib/security/security_connector/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/fake"; + dstSubfolderSpec = 16; + files = ( + 33FF776F632BCC5268E457E74FF61FC3 /* fake_security_connector.h in Copy src/core/lib/security/security_connector/fake Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 660E505B0732A74674C0EBA797428A8A /* Copy crypto/x509v3 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/x509v3"; + dstSubfolderSpec = 16; + files = ( + 9293A8D28ABB9D2D56EC00863F5D18E1 /* ext_dat.h in Copy crypto/x509v3 Private Headers */, + E102A41DDFE959564AEB12D4A0E1B535 /* internal.h in Copy crypto/x509v3 Private Headers */, + 3407097C69ACF3E0A64905C1753FBE4E /* pcy_int.h in Copy crypto/x509v3 Private Headers */, + ); + name = "Copy crypto/x509v3 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 667E86135FDF3BDB92149B32CA8FEFB5 /* Copy src/core/lib/iomgr/poller Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr/poller"; + dstSubfolderSpec = 16; + files = ( + 152B8EF343E74DF5BB5BA56A4E242F83 /* eventmanager_libuv.h in Copy src/core/lib/iomgr/poller Private Headers */, + ); + name = "Copy src/core/lib/iomgr/poller Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6706335C2743070D66841EC3086644FC /* Copy src/core/lib/security/security_connector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector"; + dstSubfolderSpec = 16; + files = ( + 03AA707FAD3CBCC04B11493E4C239BD4 /* load_system_roots.h in Copy src/core/lib/security/security_connector Private Headers */, + A54F0EFAC59616BD2D5782986A116C4C /* load_system_roots_linux.h in Copy src/core/lib/security/security_connector Private Headers */, + 1472D52D59D1A02DAE6687AF70E56A2E /* security_connector.h in Copy src/core/lib/security/security_connector Private Headers */, + A747D686E8FE87AA75FA0108E5CA40EC /* ssl_utils.h in Copy src/core/lib/security/security_connector Private Headers */, + FA64F8EE0871CF1DD9A02D2575D52B81 /* ssl_utils_config.h in Copy src/core/lib/security/security_connector Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 679E69E629C3C468A11CF83BE98F9F69 /* Copy crypto/conf Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/conf"; + dstSubfolderSpec = 16; + files = ( + 05DDA55C46736BBC314D2BD2DCDCF400 /* conf_def.h in Copy crypto/conf Private Headers */, + C837C761288AE6450D3ABE0CA4107571 /* internal.h in Copy crypto/conf Private Headers */, + ); + name = "Copy crypto/conf Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 67D076D53225361EA713F69163090628 /* Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/endpoint"; + dstSubfolderSpec = 16; + files = ( + A85931B668910DF38AF20E2A7EE823C4 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + 16DD985D2159E43F94858B0AC1D51721 /* endpoint_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + BE43A7E73B6DA1187850D2B82CD3ABD6 /* load_report.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 698A91BDDBE6AAC38F73D845DDC7A07C /* Copy src/core/lib/security/security_connector/ssl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/ssl"; + dstSubfolderSpec = 16; + files = ( + C54A1DB83F0AB40E20791A63EC52CFB7 /* ssl_security_connector.h in Copy src/core/lib/security/security_connector/ssl Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/ssl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 69F24EDFDA2732CB19CB9A57CF51783C /* Copy src/core/ext/upb-generated/gogoproto Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/gogoproto"; + dstSubfolderSpec = 16; + files = ( + DF9C86DA2C1675656461087986281B03 /* gogo.upb.h in Copy src/core/ext/upb-generated/gogoproto Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/gogoproto Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6A623559A6B4A8302BB3A9B8455BD10F /* Copy synchronization Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/synchronization"; + dstSubfolderSpec = 16; + files = ( + 8891128EBC0C2749F3DD4D5C0742CAB8 /* barrier.h in Copy synchronization Public Headers */, + 7F616AB6EF025EF7A390C13E3D0A7229 /* blocking_counter.h in Copy synchronization Public Headers */, + C3EE038140E969F0B3F78E6544CCC0D1 /* mutex.h in Copy synchronization Public Headers */, + 2DB11D4941AB780558D4CDC9BD16F071 /* notification.h in Copy synchronization Public Headers */, + ); + name = "Copy synchronization Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6A6867C97232463A508B7E60E37FE11E /* Copy src/core/lib/security/credentials/alts Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/alts"; + dstSubfolderSpec = 16; + files = ( + 4873D714253A6345BA4DD63FD5ADB4BB /* alts_credentials.h in Copy src/core/lib/security/credentials/alts Private Headers */, + DE594D9EF9D7FD32B30E293F6FBFE4D8 /* check_gcp_environment.h in Copy src/core/lib/security/credentials/alts Private Headers */, + A6202075D6EED51116A533536F47E62F /* grpc_alts_credentials_options.h in Copy src/core/lib/security/credentials/alts Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/alts Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6AB68FB0CCB1E628FF54065EE6BEB024 /* Copy crypto/pkcs8 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/pkcs8"; + dstSubfolderSpec = 16; + files = ( + FF12958E531D478E06095D8F67966A51 /* internal.h in Copy crypto/pkcs8 Private Headers */, + ); + name = "Copy crypto/pkcs8 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6D51D467DC56080606BBBB4134E2FC70 /* Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy/xds"; + dstSubfolderSpec = 16; + files = ( + 10E2D8FBD9D5732A1ACAE4878EB7C81C /* xds.h in Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6D9DA91E14731F1E53E75C52C6E36FB1 /* Copy src/core/lib/security/credentials/iam Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/iam"; + dstSubfolderSpec = 16; + files = ( + DFBBF0897C7AFFBD95E723547D6A7754 /* iam_credentials.h in Copy src/core/lib/security/credentials/iam Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/iam Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6F116A8EBF7B72915D0CE7CF6C7AEDD6 /* Copy src/core/tsi Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi"; + dstSubfolderSpec = 16; + files = ( + EE891A2BA8AC98E6AA850387B5165AA4 /* fake_transport_security.h in Copy src/core/tsi Private Headers */, + 4E5D12460B1AB0E047E3F08C026B2B40 /* grpc_shadow_boringssl.h in Copy src/core/tsi Private Headers */, + 71913F1E1994B9917E5CF571E22E5AAF /* local_transport_security.h in Copy src/core/tsi Private Headers */, + 3E61702D21F4C751E28B7B09DB47F78C /* ssl_transport_security.h in Copy src/core/tsi Private Headers */, + 6053558C61E28BAF6FD445788AE0425E /* ssl_types.h in Copy src/core/tsi Private Headers */, + 6221558BA3A3DDE2419AB420D7F1DD68 /* transport_security.h in Copy src/core/tsi Private Headers */, + AC9D03B4838D773D3F5F31F8E196D0F1 /* transport_security_grpc.h in Copy src/core/tsi Private Headers */, + A82CA960DDEB95DF478CBE6EC88FC1EE /* transport_security_interface.h in Copy src/core/tsi Private Headers */, + ); + name = "Copy src/core/tsi Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 6FD36D2F2D49193B2DACAA9B286192BE /* Copy src/core/lib/security/credentials/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/fake"; + dstSubfolderSpec = 16; + files = ( + 3490A40624E9F7B235558B24C0FAC5F6 /* fake_credentials.h in Copy src/core/lib/security/credentials/fake Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 704F91E7C67AAE69E6A6EF338BEF1004 /* Copy src/cpp/thread_manager Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/cpp/thread_manager"; + dstSubfolderSpec = 16; + files = ( + B295F9A8A8CC3F54DDE4ACA0C09A4862 /* thread_manager.h in Copy src/cpp/thread_manager Private Headers */, + ); + name = "Copy src/cpp/thread_manager Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 70800FBCA1CCB6842237AFF335FA6EAF /* Copy crypto/pool Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/pool"; + dstSubfolderSpec = 16; + files = ( + E7C3A49440AC634243064D880B14B2B4 /* internal.h in Copy crypto/pool Private Headers */, + ); + name = "Copy crypto/pool Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7252340B9E23BF6F4DC13F9E0B6367BB /* Copy src/core/ext/upb-generated/envoy/type Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type"; + dstSubfolderSpec = 16; + files = ( + F2DD7EEEE10383EE800937ECE04C5AFA /* http.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + 029216A968F2BE151C37D04C146413EF /* percent.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + 95426F4538F858DEE0633145270871AC /* range.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + 90DB48501A29159B6E49DBFEC710F912 /* semantic_version.upb.h in Copy src/core/ext/upb-generated/envoy/type Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 72A3F5904786721D0DCEAFFEEDDC3631 /* Copy src/core/lib/channel Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/channel"; + dstSubfolderSpec = 16; + files = ( + 50A3F25E9000FFEE36CA9A2641334782 /* channel_args.h in Copy src/core/lib/channel Private Headers */, + 32395E35BD3EBE436740D4688090ABFC /* channel_stack.h in Copy src/core/lib/channel Private Headers */, + 50211027F5270A47317EF949EB26AA4D /* channel_stack_builder.h in Copy src/core/lib/channel Private Headers */, + 48279C12A138864A9B407C56569123CE /* channel_trace.h in Copy src/core/lib/channel Private Headers */, + AFDFA385CA6BC41DE42FEB5228324909 /* channelz.h in Copy src/core/lib/channel Private Headers */, + 6C99259236A0CFF61455D9ECF5C7B14F /* channelz_registry.h in Copy src/core/lib/channel Private Headers */, + F1F637C4C13B1C40DA139ADD13F165F4 /* connected_channel.h in Copy src/core/lib/channel Private Headers */, + ED172833375BAD8F56018C888538182C /* context.h in Copy src/core/lib/channel Private Headers */, + 35AFC44A8CC8DFD5BEAC5C2C94FF0E7B /* handshaker.h in Copy src/core/lib/channel Private Headers */, + 82F4CD96BC7613A38B35650040605A0C /* handshaker_factory.h in Copy src/core/lib/channel Private Headers */, + A469DE9F0A8CD766926B97BD593C2DE3 /* handshaker_registry.h in Copy src/core/lib/channel Private Headers */, + 0F58A9E3FFE43FBA178DAA423048760E /* status_util.h in Copy src/core/lib/channel Private Headers */, + ); + name = "Copy src/core/lib/channel Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7451B22C9C044108E81FDD4C3B13624E /* Copy src/core/tsi/alts/handshaker Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/handshaker"; + dstSubfolderSpec = 16; + files = ( + BC5165A66CD1CD4A750D12A7D4C377AE /* alts_handshaker_client.h in Copy src/core/tsi/alts/handshaker Private Headers */, + E545F4F39731AFA12384A00936BF04A2 /* alts_shared_resource.h in Copy src/core/tsi/alts/handshaker Private Headers */, + F80E6054BFA31CAD2B42E98064BDE215 /* alts_tsi_handshaker.h in Copy src/core/tsi/alts/handshaker Private Headers */, + EA3CB00AE5620B8AE99C8FCAF5A038BC /* alts_tsi_handshaker_private.h in Copy src/core/tsi/alts/handshaker Private Headers */, + 64B09F58DCF37CA61DC95665929CF729 /* alts_tsi_utils.h in Copy src/core/tsi/alts/handshaker Private Headers */, + F7D8B4540FCD1E41301638EB08807255 /* transport_security_common_api.h in Copy src/core/tsi/alts/handshaker Private Headers */, + ); + name = "Copy src/core/tsi/alts/handshaker Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7783B6E28D541059DAAD2AA8A58148DE /* Copy src/core/ext/upb-generated/validate Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/validate"; + dstSubfolderSpec = 16; + files = ( + EEDA83133FAE50322248DCDFDB067400 /* validate.upb.h in Copy src/core/ext/upb-generated/validate Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/validate Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 780D853AEDCCDC4BBCA3B9D1E3C330AB /* Copy debugging Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/debugging"; + dstSubfolderSpec = 16; + files = ( + EEF973D4017FD11D11DA15FB4A05B90C /* stacktrace.h in Copy debugging Public Headers */, + 14E4581457C268980D066BD109D23B21 /* symbolize.h in Copy debugging Public Headers */, + B9E12C4EF0F8BC8F9071A8A394F44BEF /* symbolize_elf.inc in Copy debugging Public Headers */, + 5A81E3A939D1C83D12E1B76C110A48E9 /* symbolize_unimplemented.inc in Copy debugging Public Headers */, + 984B908DB09526DF30551AE412F874DA /* symbolize_win32.inc in Copy debugging Public Headers */, + ); + name = "Copy debugging Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 78311D4A2B35E5BE43666D751C7D2D16 /* Copy src/core/lib/security/credentials/tls Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/tls"; + dstSubfolderSpec = 16; + files = ( + 8D1F2FA9F617B054C0047BA2EA1E300E /* grpc_tls_credentials_options.h in Copy src/core/lib/security/credentials/tls Private Headers */, + FBBE224A3D8FA6579D9C468CB31C4409 /* tls_credentials.h in Copy src/core/lib/security/credentials/tls Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/tls Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 783CC13BEB0443AC64B2548C92AFAFAF /* Copy src/core/tsi Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi"; + dstSubfolderSpec = 16; + files = ( + 304BAC0274F87CD1F154522C1FF15911 /* fake_transport_security.h in Copy src/core/tsi Private Headers */, + 3D10A97DF08DBF35F7CFA22A81E0B774 /* grpc_shadow_boringssl.h in Copy src/core/tsi Private Headers */, + 080635E2F5E4A2BBA8F92BF0D9952D8A /* local_transport_security.h in Copy src/core/tsi Private Headers */, + A303E8BC7C47CD1A356FBDD71B97C388 /* ssl_transport_security.h in Copy src/core/tsi Private Headers */, + 8985ED9EB17DE568494AD03E0FBB0320 /* ssl_types.h in Copy src/core/tsi Private Headers */, + 1E7A5CF9DD01D200DB25EB41A642B835 /* transport_security.h in Copy src/core/tsi Private Headers */, + DBF2EBA778F508C27718BDE47CBC1DB2 /* transport_security_grpc.h in Copy src/core/tsi Private Headers */, + 2D1DB2247E9BA0EC0AE4A7A16975862D /* transport_security_interface.h in Copy src/core/tsi Private Headers */, + ); + name = "Copy src/core/tsi Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 784FBE885B6BA27B49FF78CA23A0E708 /* Copy container Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/container"; + dstSubfolderSpec = 16; + files = ( + 05FD5E2A3CB6FE9C8174EAD6C2E9CD58 /* fixed_array.h in Copy container Public Headers */, + 81C8E9E14E8194EAAB45D64A2CE4FD0E /* flat_hash_map.h in Copy container Public Headers */, + BC845C341BFDFEF32BD7993AA574EF86 /* inlined_vector.h in Copy container Public Headers */, + ); + name = "Copy container Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 78518DBBC6250CA130FB76F917FE8C73 /* Copy src/core/lib/security/security_connector/local Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/local"; + dstSubfolderSpec = 16; + files = ( + C2CFA3CF3F54A0D8921207603CC54507 /* local_security_connector.h in Copy src/core/lib/security/security_connector/local Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/local Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 78F832533271C215601FF6DFA473E484 /* Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/core"; + dstSubfolderSpec = 16; + files = ( + A1CFD72C18E9B442B493DCEF16926BD5 /* address.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 6C9BB667BEE9209D8B52B5578D1A8D0E /* base.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + FF7AB5445FA12C258508D4A525E221E1 /* config_source.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 840CDCE1B9B12F55DEB079D4B07F1B72 /* grpc_service.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + B9CE478C994367E62FA0889577B6F8C0 /* health_check.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 329DEDBF1E5F759F42A5F6E3524BBDEB /* http_uri.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 4B4830A217295A2288354BCEC539D49B /* protocol.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7994E5843320954C4FED0266F77B334D /* Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/dns/c_ares"; + dstSubfolderSpec = 16; + files = ( + 4815F789D44BCFF2F1CD37C921B1640A /* grpc_ares_ev_driver.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + EEC707748D35EA14F03B130E10BEF7DA /* grpc_ares_wrapper.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 79A34B02BFE2C646B3FB1214DF4E3FF1 /* Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/tracing/v2"; + dstSubfolderSpec = 16; + files = ( + 0CE23E380DCC095C60C8DDE8D4952325 /* custom_tag.upb.h in Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7AD1E865C4928382BED6ED0CFAF9BBDB /* Copy src/core/ext/transport/chttp2/client Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/client"; + dstSubfolderSpec = 16; + files = ( + 8AA2FA9C7830044CA55DE441AE0D2FB9 /* authority.h in Copy src/core/ext/transport/chttp2/client Private Headers */, + BCF3696A231BE0969E4A4CAC2B73243D /* chttp2_connector.h in Copy src/core/ext/transport/chttp2/client Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/client Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7B3B00381A1B67D861CF1AA7DB52ACB0 /* Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2"; + dstSubfolderSpec = 16; + files = ( + 549EE6F31824EB6737693C3575F72B0C /* accesslog.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7C15A31E7F553344A649DE2D0CAED09D /* Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/protobuf"; + dstSubfolderSpec = 16; + files = ( + 4B6BC139B13921B9B3ADFB6FE20CFF81 /* any.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 76EEC83F6BB759D8F992C3F37E0AF468 /* descriptor.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 6E885026E24FEA1317D3910E4E73BB93 /* duration.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 39FB84E82AB40EFE6E9234780367C951 /* empty.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + CF9FBA158B58509202DFAF2FC56AC40F /* struct.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 25EB71627490B3100C2EF6C0B8A1E086 /* timestamp.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 4BEAE4A8B31015042289BE9684B4AC10 /* wrappers.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/protobuf Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7C80FB4397330AAE052CCE98F7AF6214 /* Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/zero_copy_frame_protector"; + dstSubfolderSpec = 16; + files = ( + 85462305C5D1543A3E6677C5D4239838 /* alts_grpc_integrity_only_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + 95BCC22AEE55E9A387D812DEA25D7639 /* alts_grpc_privacy_integrity_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + AF65A4B58608ED8E36D4F049A50565F0 /* alts_grpc_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + 50593BF914E4E4AA912620F62DC1028B /* alts_grpc_record_protocol_common.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + F2132AB8F54E806D6464D96AEAD91174 /* alts_iovec_record_protocol.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + FDBD9DC9A2555ADE4C1E9F4D32B42326 /* alts_zero_copy_grpc_protector.h in Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + ); + name = "Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7D01712FA09D41B950DC3C167AAA8ADE /* Copy hash Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/hash"; + dstSubfolderSpec = 16; + files = ( + 6DD66C9E81A2DD07CB44530E50AFB7C9 /* hash.h in Copy hash Public Headers */, + ); + name = "Copy hash Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7D8781A49501552D42299095D9FBC0E5 /* Copy crypto/fipsmodule/sha Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/sha"; + dstSubfolderSpec = 16; + files = ( + 442142BB8AD01A66BCEA08C1776D0D65 /* internal.h in Copy crypto/fipsmodule/sha Private Headers */, + ); + name = "Copy crypto/fipsmodule/sha Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7DC5F677F6A955466461EF26342DC640 /* Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2"; + dstSubfolderSpec = 16; + files = ( + 4B4605288F718A2B8763F160CEC7E962 /* cds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 0ECEB59F340AB9E1DCEFE3298243AD77 /* cluster.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 009C9D47C7600D4C6531DD2FAEC0E996 /* discovery.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 3C28156B6812E4F00841F662B80F818A /* eds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 4CCD0066195CCD8B797B37F94C6CC514 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + B2F8AC6A07B03B6E4A4831A81CEE7833 /* lds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + FEB70040C9DFF46BE3A868CF54793716 /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 6ACD164DF65370A050C7CCCEF9A6AC5E /* rds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 789D8EE98671E238953EAF8C81A16861 /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 6C269DD696B5CEE9B856528E6863A504 /* scoped_route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + AA4696767AB9EF840BBBB606899449E7 /* srds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7DF8F015727BB18C9A9763B04D477497 /* Copy src/core/ext/filters/http/client Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/client"; + dstSubfolderSpec = 16; + files = ( + 7048778880A3C9C43965B6AC310753D9 /* http_client_filter.h in Copy src/core/ext/filters/http/client Private Headers */, + ); + name = "Copy src/core/ext/filters/http/client Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7E23BF6CBF1DBEADDDE626432B794E7E /* Copy src/core/tsi/alts/frame_protector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/frame_protector"; + dstSubfolderSpec = 16; + files = ( + D37E87671D054452A0DF7C9ED13491D6 /* alts_counter.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + 5E621D364E2486682215A8A7E626D871 /* alts_crypter.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + 64472ABEC969C6722EB3F239568E14AC /* alts_frame_protector.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + 326EFD2541D006917B205323677DA688 /* alts_record_protocol_crypter_common.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + BD3C6999AE61D6B4D9DE49277F462FCB /* frame_handler.h in Copy src/core/tsi/alts/frame_protector Private Headers */, + ); + name = "Copy src/core/tsi/alts/frame_protector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7F65EE7CFB805F5F475D8FB372406E78 /* Copy src/core/lib/debug Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/debug"; + dstSubfolderSpec = 16; + files = ( + 4F1E6D717AA8C232AE097C35D44ED640 /* stats.h in Copy src/core/lib/debug Private Headers */, + AEDA7610B362E6AEAD43F63ED343F329 /* stats_data.h in Copy src/core/lib/debug Private Headers */, + 343B650B5D85AAD3D0BD4386BCC00D88 /* trace.h in Copy src/core/lib/debug Private Headers */, + ); + name = "Copy src/core/lib/debug Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 7F9E9EF1AD9D0D6AE69BC87666EDD663 /* Copy src/core/ext/filters/workarounds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/workarounds"; + dstSubfolderSpec = 16; + files = ( + 33ABFF9D9C3ACA7F54B09C36187B6127 /* workaround_cronet_compression_filter.h in Copy src/core/ext/filters/workarounds Private Headers */, + 1A2C7D440BEF417D4F8FB59EA4E7DC4E /* workaround_utils.h in Copy src/core/ext/filters/workarounds Private Headers */, + ); + name = "Copy src/core/ext/filters/workarounds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 800364888314F5A4C402C658494C39C9 /* Copy . Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/."; + dstSubfolderSpec = 16; + files = ( + 4CEC6A2414353C1BE59934456576DF34 /* FBLPromise.h in Copy . Public Headers */, + 6A45738E536BA006F2D1BC0A8B3C087D /* FBLPromise+All.h in Copy . Public Headers */, + 37F2290530F6967122CE3EB74828B534 /* FBLPromise+Always.h in Copy . Public Headers */, + C763EECAC914A5110F0036B0F264BB1B /* FBLPromise+Any.h in Copy . Public Headers */, + 051B51E9EAC9AA98C59BA5D5622A2290 /* FBLPromise+Async.h in Copy . Public Headers */, + A33D49BC7E9BDF93FF4BDA7B85E206A2 /* FBLPromise+Await.h in Copy . Public Headers */, + 663D2A82C2DCD54AE747147F1132F674 /* FBLPromise+Catch.h in Copy . Public Headers */, + 2C535104168DA2B1F459F7F8808B72B6 /* FBLPromise+Delay.h in Copy . Public Headers */, + 9B4029D08418A0057949F9EB5048AC16 /* FBLPromise+Do.h in Copy . Public Headers */, + 25CC9A254F77DBBBECF0A12E2CBBD93F /* FBLPromise+Race.h in Copy . Public Headers */, + 86EC812FBE9BDC076CFED5535A0BF687 /* FBLPromise+Recover.h in Copy . Public Headers */, + C58A7E5412932A374922DD700F796047 /* FBLPromise+Reduce.h in Copy . Public Headers */, + 7C33BF9858FFC1004639F8F57552143C /* FBLPromise+Retry.h in Copy . Public Headers */, + AFD533C0BDB6284BAECE3970C6366EA8 /* FBLPromise+Testing.h in Copy . Public Headers */, + A176E9EF9ACB8F5E424B2CBA7A01DCF3 /* FBLPromise+Then.h in Copy . Public Headers */, + 4A28CA55443D88FAEBB701F8D7AB8F8C /* FBLPromise+Timeout.h in Copy . Public Headers */, + 11997C2E0EB98DCB42FC0F8C1E465649 /* FBLPromise+Validate.h in Copy . Public Headers */, + 1246EE38D17CE7478DA7625821C3E947 /* FBLPromise+Wrap.h in Copy . Public Headers */, + 272689BB2DC9BFC1852EA0B275B171D2 /* FBLPromiseError.h in Copy . Public Headers */, + 3AA7AB6C6E7609995590D38C07FAE062 /* FBLPromises.h in Copy . Public Headers */, + ); + name = "Copy . Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 80B581373BC8DA45E69C69E9D53244C7 /* Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy/xds"; + dstSubfolderSpec = 16; + files = ( + F4EE9FC7C2A5C914E8B03819932B918F /* xds.h in Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 80F570444281FF017873AA6C77D6B535 /* Copy src/core/lib/backoff Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/backoff"; + dstSubfolderSpec = 16; + files = ( + 1FF0547B60A1531C531C0786E035A2C5 /* backoff.h in Copy src/core/lib/backoff Private Headers */, + ); + name = "Copy src/core/lib/backoff Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 81C1CEE4A6FCD4728418F91E741F0824 /* Copy generic Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/generic"; + dstSubfolderSpec = 16; + files = ( + C92BF1250271FA2A95CA5D47B801BB12 /* async_generic_service.h in Copy generic Public Headers */, + F82B7F900AA0511146C3FBD03042FCF2 /* generic_stub.h in Copy generic Public Headers */, + 9198E41715DF4931DEB898EE4B7697F3 /* generic_stub_impl.h in Copy generic Public Headers */, + ); + name = "Copy generic Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 849AFA0BED338218735CBA356ED50333 /* Copy src/core/lib/security/util Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/util"; + dstSubfolderSpec = 16; + files = ( + 9B944A4B3454F7CB5D6DC09890EA42DE /* json_util.h in Copy src/core/lib/security/util Private Headers */, + ); + name = "Copy src/core/lib/security/util Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 850BAF43C7451A99D223E366F61940AB /* Copy src/core/ext/filters/client_channel/health Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/health"; + dstSubfolderSpec = 16; + files = ( + 652FAF72B2B68BDD8E814DFAF95EAA0D /* health_check_client.h in Copy src/core/ext/filters/client_channel/health Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/health Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 85A3794DCE891ECBB12A056B137A3A88 /* Copy src/core/lib/compression Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/compression"; + dstSubfolderSpec = 16; + files = ( + 843178D297AE8B4B78BA374640F17B5A /* algorithm_metadata.h in Copy src/core/lib/compression Private Headers */, + 62CF09AAD0369057FF838F7D4F9DD4A1 /* compression_args.h in Copy src/core/lib/compression Private Headers */, + 2B3CC4074E7F4C4B941B65E597B1E84F /* compression_internal.h in Copy src/core/lib/compression Private Headers */, + F833969F8A73DC55FBB66B1E0C1AEBB5 /* message_compress.h in Copy src/core/lib/compression Private Headers */, + 3B94014FF64A3CADD0AFC8E05CDD7721 /* stream_compression.h in Copy src/core/lib/compression Private Headers */, + 031F917DA80A40EF173BCE01EDD28452 /* stream_compression_gzip.h in Copy src/core/lib/compression Private Headers */, + 65B77DBA393B20C4C83A1CBCCFC1AE17 /* stream_compression_identity.h in Copy src/core/lib/compression Private Headers */, + ); + name = "Copy src/core/lib/compression Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8617B776AB9B1B509A192D9A6E32AB04 /* Copy src/core/lib/iomgr Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr"; + dstSubfolderSpec = 16; + files = ( + 48D2F6E22007377EBF2B5210CAA303F2 /* block_annotate.h in Copy src/core/lib/iomgr Private Headers */, + 37E50283C44DBA327234541B01790A58 /* buffer_list.h in Copy src/core/lib/iomgr Private Headers */, + 75A8A96227BDE414BE2EA9C3B5608887 /* call_combiner.h in Copy src/core/lib/iomgr Private Headers */, + D7E87C930618F0D9DDD3A9E18E305A96 /* cfstream_handle.h in Copy src/core/lib/iomgr Private Headers */, + D54400E811BBA6DB781E8EB02843A955 /* closure.h in Copy src/core/lib/iomgr Private Headers */, + 490709C27E053BCA97C4EDA04533FC98 /* combiner.h in Copy src/core/lib/iomgr Private Headers */, + 26BEF649B0EB37EDA01104CE26813E75 /* dynamic_annotations.h in Copy src/core/lib/iomgr Private Headers */, + 73BDB1380A22FAE4E107A20F6B106F94 /* endpoint.h in Copy src/core/lib/iomgr Private Headers */, + DE032411E29C742D61EDA7BB0AE99A40 /* endpoint_cfstream.h in Copy src/core/lib/iomgr Private Headers */, + BD9179EC15C9859BE5FE796133773406 /* endpoint_pair.h in Copy src/core/lib/iomgr Private Headers */, + 09E9D31FCE2C84A5349CD4BAA134278F /* error.h in Copy src/core/lib/iomgr Private Headers */, + 575F39A3AAFD1C77760A48C943C433BE /* error_cfstream.h in Copy src/core/lib/iomgr Private Headers */, + 7E48275F72469B189A17020CDB6181EF /* error_internal.h in Copy src/core/lib/iomgr Private Headers */, + 6DBCBEA9783052637155D0ADDFFC75BF /* ev_epoll1_linux.h in Copy src/core/lib/iomgr Private Headers */, + 7E7E84EC45C791EF1D268A740AD3D8C5 /* ev_epollex_linux.h in Copy src/core/lib/iomgr Private Headers */, + FD779FA566365B65B4DF0B554AE84CAE /* ev_poll_posix.h in Copy src/core/lib/iomgr Private Headers */, + D5C8406C8137C8F79EC6FA81EDB4A902 /* ev_posix.h in Copy src/core/lib/iomgr Private Headers */, + DC77025E0DB2040DF9F384FA2F8516E0 /* exec_ctx.h in Copy src/core/lib/iomgr Private Headers */, + F09CD74F0F07CC011F66E269B00C31CE /* executor.h in Copy src/core/lib/iomgr Private Headers */, + 3BD4459C830AD51059464F355D060C4C /* gethostname.h in Copy src/core/lib/iomgr Private Headers */, + F201CA735BF9723D16B6A86242633B71 /* grpc_if_nametoindex.h in Copy src/core/lib/iomgr Private Headers */, + 683C118F417AC57AB6D4A1E8DD6AE5D0 /* internal_errqueue.h in Copy src/core/lib/iomgr Private Headers */, + 070346F152D430280094169A884FC6A7 /* iocp_windows.h in Copy src/core/lib/iomgr Private Headers */, + 6DD5B12846480E32EA0B88E263740283 /* iomgr.h in Copy src/core/lib/iomgr Private Headers */, + 7B0CEFF0810203AAA81EC50D0FA45AA1 /* iomgr_custom.h in Copy src/core/lib/iomgr Private Headers */, + CEB5FF4F6078E6AC4BAD5C735F9E756D /* iomgr_internal.h in Copy src/core/lib/iomgr Private Headers */, + 193A29D292DC4C39BB4B9A4CBBD3FB40 /* iomgr_posix.h in Copy src/core/lib/iomgr Private Headers */, + AB13340138B97CF56707F7C264D13A3C /* is_epollexclusive_available.h in Copy src/core/lib/iomgr Private Headers */, + 425F892B5248496CA5C37FB09B941216 /* load_file.h in Copy src/core/lib/iomgr Private Headers */, + 5F306BDAA590352825F32A3B82C80014 /* lockfree_event.h in Copy src/core/lib/iomgr Private Headers */, + 5172452E58C608C0EFEACD05B6B9C505 /* nameser.h in Copy src/core/lib/iomgr Private Headers */, + 839D107B5F5A21622C1A9E7A26EC3B35 /* polling_entity.h in Copy src/core/lib/iomgr Private Headers */, + 2CC77AA393721E96CB7DD089AFCDE687 /* pollset.h in Copy src/core/lib/iomgr Private Headers */, + AA34920FB2991CCE2F05BDD6E779B5F3 /* pollset_custom.h in Copy src/core/lib/iomgr Private Headers */, + 6356295F8EE34061370E053C0A08D313 /* pollset_set.h in Copy src/core/lib/iomgr Private Headers */, + A1DB1FE9E91DB572C297F18C7320E3B2 /* pollset_set_custom.h in Copy src/core/lib/iomgr Private Headers */, + F36CE0966AEB97993CE65C151E69A9B1 /* pollset_set_windows.h in Copy src/core/lib/iomgr Private Headers */, + EDA3949059B2F7C61252A9DB620AC2B0 /* pollset_windows.h in Copy src/core/lib/iomgr Private Headers */, + F21D6E6E2A2A17BA1F729640A10DC8A2 /* port.h in Copy src/core/lib/iomgr Private Headers */, + D921AA46FB29BF81B478187F52B57D15 /* resolve_address.h in Copy src/core/lib/iomgr Private Headers */, + 76885C6D018A043FC128324C451E9FB7 /* resolve_address_custom.h in Copy src/core/lib/iomgr Private Headers */, + 87ED57CDA96FE41F30BB47847E4AF89B /* resource_quota.h in Copy src/core/lib/iomgr Private Headers */, + 39FBA0D0EF3EA9D000DCAE839017BB19 /* sockaddr.h in Copy src/core/lib/iomgr Private Headers */, + A99FB1CB42C49C3A3F4CCCFECEC033F4 /* sockaddr_custom.h in Copy src/core/lib/iomgr Private Headers */, + 8472A82B2C6A4903941D90B4C0EA023D /* sockaddr_posix.h in Copy src/core/lib/iomgr Private Headers */, + CD07EC0959C2409F66F615A78DE1F72D /* sockaddr_utils.h in Copy src/core/lib/iomgr Private Headers */, + C95F9F7FCED96B61C5990F46954A3827 /* sockaddr_windows.h in Copy src/core/lib/iomgr Private Headers */, + F68B4C7355E00A0205235EBC15EB6811 /* socket_factory_posix.h in Copy src/core/lib/iomgr Private Headers */, + DF0BF6D8389134D748D7ECBF77321C7F /* socket_mutator.h in Copy src/core/lib/iomgr Private Headers */, + DEC18068B374D89528B87A30B34B1DD6 /* socket_utils.h in Copy src/core/lib/iomgr Private Headers */, + 38B8E9E0A13F1E5B693BF993DB44F9FB /* socket_utils_posix.h in Copy src/core/lib/iomgr Private Headers */, + A2DF0EB878E976E203DC757B4A9803E9 /* socket_windows.h in Copy src/core/lib/iomgr Private Headers */, + 32DD2CE8B966139DEE6C5E046BA0EAE7 /* sys_epoll_wrapper.h in Copy src/core/lib/iomgr Private Headers */, + 28E645694A6EC18C300EC500517982F2 /* tcp_client.h in Copy src/core/lib/iomgr Private Headers */, + 9ACBCB1679E404B70F7C1701793A9C3F /* tcp_client_posix.h in Copy src/core/lib/iomgr Private Headers */, + D3F93C552840DF4E589C8B5D96F4D67C /* tcp_custom.h in Copy src/core/lib/iomgr Private Headers */, + 7AA9BF0B384F325FAFAFA0CE1632C88F /* tcp_posix.h in Copy src/core/lib/iomgr Private Headers */, + F3AF66F478BB15EB4A693554E92D635F /* tcp_server.h in Copy src/core/lib/iomgr Private Headers */, + 7074377CA978FA172816E8FD7F1AFBC1 /* tcp_server_utils_posix.h in Copy src/core/lib/iomgr Private Headers */, + D44CB3B9C6A222C989357D69162E6B86 /* tcp_windows.h in Copy src/core/lib/iomgr Private Headers */, + 1F238ED263DE7F8AE88C556457031F14 /* time_averaged_stats.h in Copy src/core/lib/iomgr Private Headers */, + CA2CC4B0289C3FD2C6D65B24FCD0CA2C /* timer.h in Copy src/core/lib/iomgr Private Headers */, + CBBD5E481D6FCF208A2DA5D0DBB8054C /* timer_custom.h in Copy src/core/lib/iomgr Private Headers */, + 474477F24F51E241BA3E148147B661C2 /* timer_heap.h in Copy src/core/lib/iomgr Private Headers */, + 6F1A66352FEA79126A63000B2121C276 /* timer_manager.h in Copy src/core/lib/iomgr Private Headers */, + EA6A8B88417EA380764273AADEE77DC2 /* udp_server.h in Copy src/core/lib/iomgr Private Headers */, + 6F8F54ADD97B1F741D45FAD976F81FD3 /* unix_sockets_posix.h in Copy src/core/lib/iomgr Private Headers */, + 1C0A692FEE45E0EEFEDC21FD47B1A4BF /* wakeup_fd_pipe.h in Copy src/core/lib/iomgr Private Headers */, + 4B6CC0B3BD7290B286D631DB23D2393F /* wakeup_fd_posix.h in Copy src/core/lib/iomgr Private Headers */, + 5404D3E2FF2556B5FAF9976A7E245534 /* work_serializer.h in Copy src/core/lib/iomgr Private Headers */, + ); + name = "Copy src/core/lib/iomgr Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 871AEB8505108549EC0428F93BC21561 /* Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/endpoint"; + dstSubfolderSpec = 16; + files = ( + 34ACA5570E40142368794C3CFC16B4FB /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + B1EC9AF19DCE366F91B0F4004D930B5D /* endpoint_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + B2E051CD2C6807AAF6F84BB20344694D /* load_report.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 872E2B981FD2BE171E472C51D93CE732 /* Copy src/core/lib/iomgr/poller Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr/poller"; + dstSubfolderSpec = 16; + files = ( + 5F20CFF501924FC61D35396E2E2D92E7 /* eventmanager_libuv.h in Copy src/core/lib/iomgr/poller Private Headers */, + ); + name = "Copy src/core/lib/iomgr/poller Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 87AC9751489FD9234CBCF6CA620907FF /* Copy src/core/ext/filters/http Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http"; + dstSubfolderSpec = 16; + files = ( + 2A6951ADCB98C3CA822F5CF5B1A8E142 /* client_authority_filter.h in Copy src/core/ext/filters/http Private Headers */, + ); + name = "Copy src/core/ext/filters/http Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 885E39A9AA3A88D7FF3FDD54628D5431 /* Copy src/core/lib/security/credentials/composite Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/composite"; + dstSubfolderSpec = 16; + files = ( + E3726A29BA78844B2C57C17A9DE5EE83 /* composite_credentials.h in Copy src/core/lib/security/credentials/composite Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/composite Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 88986958C58FC9C7D23544B4CDF1593A /* Copy third_party/fiat Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/third_party/fiat"; + dstSubfolderSpec = 16; + files = ( + FD2065216F45BE205E92B2B1EE6F26B9 /* curve25519_32.h in Copy third_party/fiat Private Headers */, + 9F738A4E3E402D5CD508F68E8AA14058 /* curve25519_64.h in Copy third_party/fiat Private Headers */, + A78E7E9825ACBCC18CFA8B8B6DD6F1AA /* curve25519_tables.h in Copy third_party/fiat Private Headers */, + 77178BAE97776B8EFBC6B8E0E7B1FEE3 /* internal.h in Copy third_party/fiat Private Headers */, + 57BFE22BCC80BD48044BC57E8487433C /* p256_32.h in Copy third_party/fiat Private Headers */, + 34F19D8264B7A8D1EC4EC401940AEDD8 /* p256_64.h in Copy third_party/fiat Private Headers */, + ); + name = "Copy third_party/fiat Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 899F2C0BF3808B2220BF3F119B004B6B /* Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/udpa/annotations"; + dstSubfolderSpec = 16; + files = ( + A4BF6EC41FE34788456228DCD22937AC /* migrate.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + 7861D2ACC01FB7396F939A9DA0217D0D /* sensitive.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/udpa/annotations Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8BBD8A70D097206BCF3DA7FA84E4D9B3 /* Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/gcp"; + dstSubfolderSpec = 16; + files = ( + 09D38EF8AF07F8AE45EA18DB9F631CA6 /* altscontext.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + C2C9E4B70E28DEE0AB52862D7C0467C7 /* handshaker.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + 9DC31B9AAA672963E3DA73615321C145 /* transport_security_common.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8C4350E9F3DA5E766F3B6C6BBA7AF2F8 /* Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy"; + dstSubfolderSpec = 16; + files = ( + 332766EA51681442A24DFEB1EB46941D /* child_policy_handler.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + CEC40E544C2DAB38AC3A779259405148 /* subchannel_list.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8E339C4CF27B6756D69C86CE55A161D7 /* Copy include/grpcpp/impl/codegen Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/include/grpcpp/impl/codegen"; + dstSubfolderSpec = 16; + files = ( + 8819AD26348A0BFCFC2F5A429363F003 /* core_codegen.h in Copy include/grpcpp/impl/codegen Private Headers */, + ); + name = "Copy include/grpcpp/impl/codegen Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8EC19C25B20FFE93DE717FDAB43CBEAB /* Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2"; + dstSubfolderSpec = 16; + files = ( + 944A0D981F8D5EF99932F4FE929751AC /* http_connection_manager.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 8FBB3A35420C86E5840FC30A9508C12B /* Copy crypto/err Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/err"; + dstSubfolderSpec = 16; + files = ( + 9F7A41B749D69FD1C13DC0D1F63CCB71 /* internal.h in Copy crypto/err Private Headers */, + ); + name = "Copy crypto/err Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 904B9FB4353AA5984C03AE6CED11FD90 /* Copy src/core/lib/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/transport"; + dstSubfolderSpec = 16; + files = ( + B3D05B7C740B9A2263C83651E3054412 /* bdp_estimator.h in Copy src/core/lib/transport Private Headers */, + 815424BBAA68E6924AF3430DBA519186 /* byte_stream.h in Copy src/core/lib/transport Private Headers */, + 1D0DCBC95932F751B2B695D706D04138 /* connectivity_state.h in Copy src/core/lib/transport Private Headers */, + 4CB538BF76B879428499DD063AC8274E /* error_utils.h in Copy src/core/lib/transport Private Headers */, + 4408720482E92CE78FA2F6DEBC38B31A /* http2_errors.h in Copy src/core/lib/transport Private Headers */, + B9CE01C4434443BC13DD0AB9128C27ED /* metadata.h in Copy src/core/lib/transport Private Headers */, + 1AEEB449193382B9F632EA45AE1715AB /* metadata_batch.h in Copy src/core/lib/transport Private Headers */, + 2382524F146F4107111C5CF6ADD53B97 /* pid_controller.h in Copy src/core/lib/transport Private Headers */, + AC92D9CF656F84FF80879EE1BF8F387A /* static_metadata.h in Copy src/core/lib/transport Private Headers */, + AC087D145D3A34DC92C974D988985544 /* status_conversion.h in Copy src/core/lib/transport Private Headers */, + 5973603C868EEE44D9771AD6EC6273F3 /* status_metadata.h in Copy src/core/lib/transport Private Headers */, + AD43261D0457F7A556607BDA399C312C /* timeout_encoding.h in Copy src/core/lib/transport Private Headers */, + 8424B9C2F6E2B39FD877841468E0A70F /* transport.h in Copy src/core/lib/transport Private Headers */, + 79A31B2313A83C08AC0C12AD3B24F9DA /* transport_impl.h in Copy src/core/lib/transport Private Headers */, + ); + name = "Copy src/core/lib/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 906BB5248E78B653AF55E38AE46750A0 /* Copy src/core/ext/upb-generated/validate Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/validate"; + dstSubfolderSpec = 16; + files = ( + B81BACE66C1714FE17A54DF183AD9A75 /* validate.upb.h in Copy src/core/ext/upb-generated/validate Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/validate Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 915CF8A9B486E4E0F986D9069A8193FA /* Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/cluster"; + dstSubfolderSpec = 16; + files = ( + BF1E4D852D47DF687331F34ACF5EA0DA /* circuit_breaker.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + C0ED3828C689F5AA56C229674381E72E /* filter.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + 9D9D848CBDFBD20B8B2DD4D4EEBAE3CE /* outlier_detection.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 918FC73CDD2C9B34499DA6C1ED64E12F /* Copy types/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/types/internal"; + dstSubfolderSpec = 16; + files = ( + 5C59211B4504607D4A2A7C4B0168F33E /* optional.h in Copy types/internal Public Headers */, + B7557CCE95DAB65EE81DFD8C3E444BD1 /* span.h in Copy types/internal Public Headers */, + 4DA8A3E3BAB5DC73AEF85CE535DD8BBC /* variant.h in Copy types/internal Public Headers */, + ); + name = "Copy types/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 931F58D1E6035347B5E034E90BB84907 /* Copy src/core/ext/filters/http/message_compress Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/message_compress"; + dstSubfolderSpec = 16; + files = ( + B79AD2B4175374C22B3057432CB942BE /* message_compress_filter.h in Copy src/core/ext/filters/http/message_compress Private Headers */, + ); + name = "Copy src/core/ext/filters/http/message_compress Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 93AC54E62E433AF08035608DD34AD35D /* Copy crypto/fipsmodule Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule"; + dstSubfolderSpec = 16; + files = ( + 4BD46B5D5D38DC12B17E1E75088AACCE /* delocate.h in Copy crypto/fipsmodule Private Headers */, + ); + name = "Copy crypto/fipsmodule Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 9511E1694F7466ED55EF0AEE910B2855 /* Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/route"; + dstSubfolderSpec = 16; + files = ( + DA82E9D2CAEF99E104A40C77982C15CF /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + 2AE141B32F0376D5736532FF7F20EF84 /* route_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 9555572D7E370C680F05C08324A00734 /* Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/fake"; + dstSubfolderSpec = 16; + files = ( + 11EF6B3978005E6FF8D9315C439A0A94 /* fake_resolver.h in Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 96C1328F4C9660B8BCDC79AEFFA6EAC3 /* Copy strings/internal/str_format Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/strings/internal/str_format"; + dstSubfolderSpec = 16; + files = ( + 7B75D26AFA68EF5BDAB34DD77CD0BCC3 /* arg.h in Copy strings/internal/str_format Public Headers */, + 1E77F63DBB76EDC56CFF8C7A54C45B54 /* bind.h in Copy strings/internal/str_format Public Headers */, + 413418366BB7699DFA065A677173126E /* checker.h in Copy strings/internal/str_format Public Headers */, + C54D1E16C11ABA69C66C2ACC25696B1C /* extension.h in Copy strings/internal/str_format Public Headers */, + F927967B4FAFE744CB5A33BB26636B50 /* float_conversion.h in Copy strings/internal/str_format Public Headers */, + 1176D541267EB11B9A6A89C10946E3C5 /* output.h in Copy strings/internal/str_format Public Headers */, + AC26528FDEF133C0D1F4203E3A5ACADF /* parser.h in Copy strings/internal/str_format Public Headers */, + ); + name = "Copy strings/internal/str_format Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 981D540BC71F90E9E1DD20A752ECDE4E /* Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/route"; + dstSubfolderSpec = 16; + files = ( + 494AB0C69187606B6748BC7CDEAA7FA0 /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + 8BC443D0E242A2D5D42842A466C89F5F /* route_components.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 995512DCC3B34220916827E5E559B7AD /* Copy . Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/."; + dstSubfolderSpec = 16; + files = ( + 2082DE929B3EC77AC6ED5C7BB2D81DED /* aead.h in Copy . Public Headers */, + CD3251C9DAF096DD13A3E00BA99EAD68 /* aes.h in Copy . Public Headers */, + B0C6FF1773BF874BC81378587224B20D /* arm_arch.h in Copy . Public Headers */, + 597D14B7AF69EB2DD4A6910A84E6BCCD /* asn1.h in Copy . Public Headers */, + AA0FF04FA55C40AAF75E3BB0B6FBCD12 /* asn1_mac.h in Copy . Public Headers */, + ABA2370C9D2B2A1180F2997779FCA433 /* asn1t.h in Copy . Public Headers */, + A67897C447F4E21A5835D88A4D0C57F4 /* base.h in Copy . Public Headers */, + 462FA41538912CA71331B8F1990BFB10 /* base64.h in Copy . Public Headers */, + 251E4232CCD3BFAE570EB2D9764694E7 /* bio.h in Copy . Public Headers */, + D2E97AD6CA4537DAFD6DAA9C8DE1ED1E /* blowfish.h in Copy . Public Headers */, + 95EDE65D33C787CA198C355AD36FE0CA /* bn.h in Copy . Public Headers */, + 5708A31938B7473B49FB6DED4DA614C6 /* buf.h in Copy . Public Headers */, + C5D212A840269BBE25C70046207D7634 /* buffer.h in Copy . Public Headers */, + 87921881EF0778955C2478E6F8BC55F2 /* bytestring.h in Copy . Public Headers */, + 2A03E52A98B96055AACF5A39B47968D8 /* cast.h in Copy . Public Headers */, + C78095946B7F05FBD1E79B3433BF7E1B /* chacha.h in Copy . Public Headers */, + 499EB42789D90FDC8413A3D713416801 /* cipher.h in Copy . Public Headers */, + 21E3930F64370394B29273255D55B7F9 /* cmac.h in Copy . Public Headers */, + 42EFCE3FD60736360DAD4081069AF31E /* conf.h in Copy . Public Headers */, + C7D7E3D2386C680093B6C44E8DD0D0E1 /* cpu.h in Copy . Public Headers */, + 964AEFC16A556324B382B6775C5325ED /* crypto.h in Copy . Public Headers */, + 07F5431D6FFFAC40E50ACDFE29D00EB2 /* curve25519.h in Copy . Public Headers */, + D55E2E4A89C015C6579757A2F0B0B4E6 /* des.h in Copy . Public Headers */, + F100DE49F12181547856DFF7FE4C061F /* dh.h in Copy . Public Headers */, + DCE8786C73A67DAB9C1FEE5DD2D8E1DA /* digest.h in Copy . Public Headers */, + 7C0E7B39CD4F0FB2AA124A632D902A7F /* dsa.h in Copy . Public Headers */, + 9A1D08945D01A89C009F7D3A0F52BAAD /* dtls1.h in Copy . Public Headers */, + C62D80B67AC093106C79BB7135084A09 /* e_os2.h in Copy . Public Headers */, + DDB88EEBEAAD3C2989D6DF405EAF58EC /* ec.h in Copy . Public Headers */, + CF8AE6F706798DB85A1B3ACEB8AE0E82 /* ec_key.h in Copy . Public Headers */, + AB6CC107DB1C81C4CF32F97F2A75AA26 /* ecdh.h in Copy . Public Headers */, + 01B7A677CF994DAE0E8BAC191E823D43 /* ecdsa.h in Copy . Public Headers */, + 29EEEA7F720E05A2C4ED90ED1621DC98 /* engine.h in Copy . Public Headers */, + A76A97B92E178EFA4CC10F487C9E23C3 /* err.h in Copy . Public Headers */, + B1B1A408AAC460624E1F3A42CD9B196B /* evp.h in Copy . Public Headers */, + D1F50D0AB8B4F94686A460BEC26A508D /* ex_data.h in Copy . Public Headers */, + 62CBC8D535AA77EB22C341D4BA03F2FE /* hkdf.h in Copy . Public Headers */, + B9356E03CFA66CAD181B2DE097ED4EAD /* hmac.h in Copy . Public Headers */, + FFEADEEE0654F8C1F1455E4D6D6BD60D /* hrss.h in Copy . Public Headers */, + AE27544AD33D37DA1C257DC4CD99C021 /* is_boringssl.h in Copy . Public Headers */, + 13148E8F39211332E25CC50B787E201D /* lhash.h in Copy . Public Headers */, + 8102D81FC8DA19A975A05602065A489F /* md4.h in Copy . Public Headers */, + BEE8DF12BCBEAD567F75FCF033C955D6 /* md5.h in Copy . Public Headers */, + 714271A6E0F5A0B0326CB7CF6C9085AF /* mem.h in Copy . Public Headers */, + B5CBCE13EC633FAEC73185DF37B6B228 /* nid.h in Copy . Public Headers */, + 4CEBD2A75E45E9C7E56C12CD1D508F03 /* obj.h in Copy . Public Headers */, + 30ED5D09B272E788E37BDE31F62B6D4F /* obj_mac.h in Copy . Public Headers */, + 807E0B49D8241EF81D2B4C0F6F71F6FC /* objects.h in Copy . Public Headers */, + 48749F9B35225D701E9D9A81C66C37AD /* opensslconf.h in Copy . Public Headers */, + C672D11242CF245E68F026B55EFDCA28 /* opensslv.h in Copy . Public Headers */, + ADBDA4B5337379316F8DFD24029D3457 /* ossl_typ.h in Copy . Public Headers */, + E668E3ADD42DA2EA0B2166D0C2D2C2CC /* pem.h in Copy . Public Headers */, + CA3E9C9DE480B90DF2461D7C95D4CDAE /* pkcs12.h in Copy . Public Headers */, + F25B7DC64870D77D9246E69E655524C5 /* pkcs7.h in Copy . Public Headers */, + D96C17802041D9C33DCA1909AB7EE0DD /* pkcs8.h in Copy . Public Headers */, + 62ABBFDC759E6D4B2F5962267686D3AC /* poly1305.h in Copy . Public Headers */, + 6C13D68556DFE88E5362AD2C5382FF72 /* pool.h in Copy . Public Headers */, + CEA05E264DEAC2AED14A0E68A72A9969 /* rand.h in Copy . Public Headers */, + 7B1A78689801A18C9DEA0EE9A461B13D /* rc4.h in Copy . Public Headers */, + 81B7F828E51BFB425C6FF19101CF3C1C /* ripemd.h in Copy . Public Headers */, + CFC606450B2C76E0A10D24F80F422A55 /* rsa.h in Copy . Public Headers */, + 667C25EAED0ED307B04FAA4830A8C985 /* safestack.h in Copy . Public Headers */, + A0F103BB787DF38D91029CAF0274CCFF /* sha.h in Copy . Public Headers */, + E79A5F9188CA0FB75B679FEC430CC5C0 /* siphash.h in Copy . Public Headers */, + 8AACDD287CC3F766DDDB771890F3F5BC /* span.h in Copy . Public Headers */, + D37A65C00F2CE4A3C42F20E17611E527 /* srtp.h in Copy . Public Headers */, + 4E4DA40C1370EAAB3AEE134DA30F316D /* ssl.h in Copy . Public Headers */, + 9D7987629AB6F8E26D84029C38329FB1 /* ssl3.h in Copy . Public Headers */, + D016D185421BA81B0C7EF6FFBF9E5D42 /* stack.h in Copy . Public Headers */, + DF1981B116BC3ED69355E348140964BE /* thread.h in Copy . Public Headers */, + 0BD17BCEF54953244058862C29A0866D /* tls1.h in Copy . Public Headers */, + D7B9BE7D292EA69997E75D36040D04C4 /* type_check.h in Copy . Public Headers */, + 44A809F5748E6EEE528251EA1D2DF3A8 /* umbrella.h in Copy . Public Headers */, + 86D48AD8A31F475BB01590F75751991A /* x509.h in Copy . Public Headers */, + 8CFD51F28D964E91B9F8D77C488D0B27 /* x509_vfy.h in Copy . Public Headers */, + 3D724D67FB5FC8722266D7D935D5F21F /* x509v3.h in Copy . Public Headers */, + ); + name = "Copy . Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 9CD4E5BC7CA8E880B58A292833EDCC6A /* Copy src/core/ext/filters/client_channel Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel"; + dstSubfolderSpec = 16; + files = ( + 95E90CA5BFD51C793118BABEE4DE4B8F /* backend_metric.h in Copy src/core/ext/filters/client_channel Private Headers */, + 86B47300A6A7B8BA5DF3040A622FEE8E /* backup_poller.h in Copy src/core/ext/filters/client_channel Private Headers */, + B4DE73212508358741E730710F203881 /* client_channel.h in Copy src/core/ext/filters/client_channel Private Headers */, + 8B799F58812C178985135F248BD06BCE /* client_channel_channelz.h in Copy src/core/ext/filters/client_channel Private Headers */, + 76F1C91D220C0D89E437519B2499D63B /* client_channel_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + FD61C0235532365FE5397C5BA9ECD9B9 /* connector.h in Copy src/core/ext/filters/client_channel Private Headers */, + E2E6AA86AE1CFF58AC5292248FB5A162 /* global_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */, + 61F0B293E97131D6A00D9F19C2BBF23B /* http_connect_handshaker.h in Copy src/core/ext/filters/client_channel Private Headers */, + 3F505A3D55090FA1E6EA8E8CD611AD31 /* http_proxy.h in Copy src/core/ext/filters/client_channel Private Headers */, + 7B37E3639971E35A03F1EB655A6F4F6E /* lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */, + 3628C7890EC28213F252BD126D26E06E /* lb_policy_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + 3F18A743F5614C1499E11593172BD7F0 /* lb_policy_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + FF9BF82D8A61D09FD4B76DF37585AFF7 /* local_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */, + F1A9F28ECCCEB46E9C39521EC081A1AD /* parse_address.h in Copy src/core/ext/filters/client_channel Private Headers */, + 1DF0ABD3625C67BE044B752243B90436 /* proxy_mapper.h in Copy src/core/ext/filters/client_channel Private Headers */, + 157D77480A495B5074539B909565541E /* proxy_mapper_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + 397A24EBEE57DA57FC789683DCC7E960 /* resolver.h in Copy src/core/ext/filters/client_channel Private Headers */, + 05868C92F36E71A48F4764D83C34ECD9 /* resolver_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + F275D63B2520BB80DABADF66ED692F4E /* resolver_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + 35BCD2B7588A4E442ECD20A65DD4C863 /* resolver_result_parsing.h in Copy src/core/ext/filters/client_channel Private Headers */, + 0CDD53BD7F4F00C5C39389DB12EBD6CA /* resolving_lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */, + 885FA21781C9F5A3ABED8175F7CC313F /* retry_throttle.h in Copy src/core/ext/filters/client_channel Private Headers */, + 0898D51AE39711C6E1C6F2CE31CD3321 /* server_address.h in Copy src/core/ext/filters/client_channel Private Headers */, + CE4E3787183C9E022779D327E9DC328A /* service_config.h in Copy src/core/ext/filters/client_channel Private Headers */, + 1832251F24A796515716A3D5C1A23FD2 /* subchannel.h in Copy src/core/ext/filters/client_channel Private Headers */, + AEEE3EC2AA4E0AFDB9146EBA52F0C3C8 /* subchannel_interface.h in Copy src/core/ext/filters/client_channel Private Headers */, + B52C0DA3BDC88BE44B4B37583D62C029 /* subchannel_pool_interface.h in Copy src/core/ext/filters/client_channel Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 9D64906FB759560F7C47B722A3EE224E /* Copy ext Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/ext"; + dstSubfolderSpec = 16; + files = ( + 5B920A9A890F58410E9A5CC19F5B90E4 /* health_check_service_server_builder_option.h in Copy ext Public Headers */, + ); + name = "Copy ext Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + 9E49037FCE47A18665EF463503871813 /* Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2"; + dstSubfolderSpec = 16; + files = ( + 0ABDE6BC38C52021D571D7165DC3B626 /* accesslog.upb.h in Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A23523568F3BB47ED3F44D5E7A3205F7 /* Copy src/core/lib/security/credentials/local Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/local"; + dstSubfolderSpec = 16; + files = ( + 84291BF1F265D7BF31E616A3A9EAB9C9 /* local_credentials.h in Copy src/core/lib/security/credentials/local Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/local Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A35981792D21A3C10D45489759EE644C /* Copy src/core/ext/filters/http/message_compress Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/message_compress"; + dstSubfolderSpec = 16; + files = ( + B2198CFF1040D81FD15845F53B26BF13 /* message_compress_filter.h in Copy src/core/ext/filters/http/message_compress Private Headers */, + ); + name = "Copy src/core/ext/filters/http/message_compress Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A3B6CB5A16F54FE44724ECC86A4B2262 /* Copy src/core/lib/security/credentials/alts Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/alts"; + dstSubfolderSpec = 16; + files = ( + 4B559A518B72878DF13CA46DF065F33D /* alts_credentials.h in Copy src/core/lib/security/credentials/alts Private Headers */, + 195C0F642355D67B3DFE7D13C4208819 /* check_gcp_environment.h in Copy src/core/lib/security/credentials/alts Private Headers */, + 4D39A49BB065F0B9A305C17B1BAD4F8B /* grpc_alts_credentials_options.h in Copy src/core/lib/security/credentials/alts Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/alts Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A550C3D57F4B70C51C20841170DB11CC /* Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy/grpclb"; + dstSubfolderSpec = 16; + files = ( + 63C34B056D525B08E83CEE46359378C6 /* client_load_reporting_filter.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 87A5155ED03A40CC6700FFECC718E128 /* grpclb.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 9DD34D25B9E0C20DCA319A5AC3FF7A47 /* grpclb_channel.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + C14FF191846F585FEBEF6E235A9FA057 /* grpclb_client_stats.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + FC45885DECC9DDB9F6C5BABE8959AE59 /* load_balancer_api.h in Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A5AEC7DDC0C86D87C08496F1FB6F4CA9 /* Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/lb/v1"; + dstSubfolderSpec = 16; + files = ( + 2779C9F0F84276D072A212590ECE99FE /* load_balancer.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A6DD5D81C08E7CB9B01C95E74C3A1C54 /* Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/listener/v2"; + dstSubfolderSpec = 16; + files = ( + 5EB0B3FFE9D111500B25F06B9298E8B6 /* api_listener.upb.h in Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A76F8FF0AA8306F18A8CD19FE306B9E7 /* Copy src/core/ext/transport/chttp2/server Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/server"; + dstSubfolderSpec = 16; + files = ( + 9CB496F0C9EF55228C501EC317543624 /* chttp2_server.h in Copy src/core/ext/transport/chttp2/server Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/server Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A7F11F79E3FD33B8C2ECDAA68B24A3B2 /* Copy src/core/ext/upb-generated/google/rpc Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/rpc"; + dstSubfolderSpec = 16; + files = ( + EAC95B693B0749570B102AB00E970180 /* status.upb.h in Copy src/core/ext/upb-generated/google/rpc Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/rpc Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A7F858C468C1B6F280DE2185A9077145 /* Copy src/core/lib/profiling Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/profiling"; + dstSubfolderSpec = 16; + files = ( + C5BC42F349F2C2AF226B931A739FBF5A /* timers.h in Copy src/core/lib/profiling Private Headers */, + ); + name = "Copy src/core/lib/profiling Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A83824105503014CFFB1D835911E9D72 /* Copy security Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/security"; + dstSubfolderSpec = 16; + files = ( + 87F9FECA872744C9BF3E2AFA8FD79B09 /* auth_context.h in Copy security Public Headers */, + CCEB0379CA9881992CC41B41CBAF2960 /* auth_metadata_processor.h in Copy security Public Headers */, + F93591CE8AA8726BCDF79E535F00AF54 /* auth_metadata_processor_impl.h in Copy security Public Headers */, + 61A06959B8180EF227FDA8E35509F5CA /* credentials.h in Copy security Public Headers */, + A8C8BAFD7926EEFA72C5F96C25CED1ED /* credentials_impl.h in Copy security Public Headers */, + 1F442A370317C2988D01F8AD987FAF64 /* server_credentials.h in Copy security Public Headers */, + C9CE287BA7713ECF7AC85E18932BF174 /* server_credentials_impl.h in Copy security Public Headers */, + BFAD721D00735872B40796A0DA2363FD /* tls_credentials_options.h in Copy security Public Headers */, + ); + name = "Copy security Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A8CCC64C3358B42240F65F63A480F6F9 /* Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/metadata/v2"; + dstSubfolderSpec = 16; + files = ( + 0E28C0CB9E27FF6F04185F6EE2DA4BBE /* metadata.upb.h in Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + A93887798FD5B7C06D75199D5581C86D /* Copy crypto/fipsmodule/cipher Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/cipher"; + dstSubfolderSpec = 16; + files = ( + E323453A0C9AD36D2361C0312AA81EED /* internal.h in Copy crypto/fipsmodule/cipher Private Headers */, + ); + name = "Copy crypto/fipsmodule/cipher Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AA74CDFCAF84A7EF5F6AEC3658E75828 /* Copy crypto/cipher_extra Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/cipher_extra"; + dstSubfolderSpec = 16; + files = ( + 0114D7D042DFE809D4D93DAF76305DF7 /* internal.h in Copy crypto/cipher_extra Private Headers */, + ); + name = "Copy crypto/cipher_extra Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AAFFEEB0904A50E6D4778E71E9A33A5E /* Copy support Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/support"; + dstSubfolderSpec = 16; + files = ( + 2BD27D647E4FB0AD580849D46CCC1A5A /* alloc.h in Copy support Public Headers */, + F822B914E8A9E681BC1B26765749A210 /* atm.h in Copy support Public Headers */, + E24C6CF802AB21C7BD1CA0334AADBB43 /* atm_gcc_atomic.h in Copy support Public Headers */, + 5650AD5170C46FFF9BB9E766DE3F0201 /* atm_gcc_sync.h in Copy support Public Headers */, + 31C27BA9F935B7EE100CFD7C5038573A /* atm_windows.h in Copy support Public Headers */, + 2BCA2B861E1D531BBEBB4194BEE24601 /* cpu.h in Copy support Public Headers */, + 5195C4375414F6F85E75F5998F6E24ED /* log.h in Copy support Public Headers */, + 61AE1AE0F0D0D840050C921BC05275EB /* log_windows.h in Copy support Public Headers */, + 092A8EE79C04AA3E5D49BC58FB79BEF0 /* port_platform.h in Copy support Public Headers */, + 2CC6F270F31227D96E20CDE4767D3DE6 /* string_util.h in Copy support Public Headers */, + 1AD5C8DBFF9D6DA2541991C4A1DABA57 /* sync.h in Copy support Public Headers */, + 4C9FB10B9591B902E4F712FAC7CC50A2 /* sync_abseil.h in Copy support Public Headers */, + 0B75B7C5739F4B37FD651FC9F09893D3 /* sync_custom.h in Copy support Public Headers */, + 4995D6AA3560C5CC5B16AA49C9ECA5E9 /* sync_generic.h in Copy support Public Headers */, + 08319CF46A470F19EEFB8D40EE586384 /* sync_posix.h in Copy support Public Headers */, + 7CA36708287B3F0156CDCEAB7E1A872F /* sync_windows.h in Copy support Public Headers */, + 753819167FB081CFDA965E7C71AAA9C1 /* thd_id.h in Copy support Public Headers */, + CD07A21B4B874214706502D468C5A497 /* time.h in Copy support Public Headers */, + 259E46EAEC6E76936B527A82243DFEB1 /* workaround_list.h in Copy support Public Headers */, + ); + name = "Copy support Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + ABF2F38A209D1C77629F4B548C937B66 /* Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/dns/c_ares"; + dstSubfolderSpec = 16; + files = ( + 5354A3A90D67C23E55E013DF16B11150 /* grpc_ares_ev_driver.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + BDF6026CF363ED397075F96CF51511BD /* grpc_ares_wrapper.h in Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AC891B0FAF8A0EFB19BC5A46F28DBC89 /* Copy src/core/lib/profiling Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/profiling"; + dstSubfolderSpec = 16; + files = ( + 0F965385027A2B363AB7019B7F326811 /* timers.h in Copy src/core/lib/profiling Private Headers */, + ); + name = "Copy src/core/lib/profiling Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + ACB1BE11D6EB8D42C59D2E4A159F9240 /* Copy src/core/lib/security/security_connector/alts Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/alts"; + dstSubfolderSpec = 16; + files = ( + 2307EAD56E5F8160A169361D14B54BF1 /* alts_security_connector.h in Copy src/core/lib/security/security_connector/alts Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/alts Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + ADAFB560C4B355AC53DC4EDCE7E136A2 /* Copy src/core/ext/filters/http/client Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/client"; + dstSubfolderSpec = 16; + files = ( + 051288B8E60AE3757BFE6CF07413C28E /* http_client_filter.h in Copy src/core/ext/filters/http/client Private Headers */, + ); + name = "Copy src/core/ext/filters/http/client Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AE7909B62E286A794C84A562AA22F3DE /* Copy crypto/fipsmodule/bn Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/bn"; + dstSubfolderSpec = 16; + files = ( + 540E86F72358DEA3ED9063848467B978 /* internal.h in Copy crypto/fipsmodule/bn Private Headers */, + A1EA633D564CD9551616C8809751913E /* rsaz_exp.h in Copy crypto/fipsmodule/bn Private Headers */, + ); + name = "Copy crypto/fipsmodule/bn Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AE7DE5077504D1B2F7CE1CE8C7EBC0F3 /* Copy src/core/ext/transport/chttp2/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/transport"; + dstSubfolderSpec = 16; + files = ( + 406421478002FAE79A67FBBE8D4B5E50 /* bin_decoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 8AB417CC9AE5AD5016BF08FDB6A18AFA /* bin_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 190AA33CEEBC74D438AAE557C49871C5 /* chttp2_transport.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 541B17F5FE264CB743B90EBE7611DF74 /* context_list.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 55ECCF59AB3C7BFF1D82564603992BED /* flow_control.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 8C92E823FDAAD9C6E23609035AD025EA /* frame.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 1162632E646ADBB1305A63D5E850FAB4 /* frame_data.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 2CF87343781F6CFD4599671BF5C3FDC0 /* frame_goaway.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + C87CD42CCF2BC851CD9E80333C3C6484 /* frame_ping.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 72CD22891C34392DE4E97B6AE07E34FD /* frame_rst_stream.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 13202330A8A22ED2F17BB0B74A970720 /* frame_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 9D626AD6B3CF74FF200CB6D8D122FE31 /* frame_window_update.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + D7E72E184D1423FB8D17314DEDC291DD /* hpack_encoder.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 37EB29AB0944C96EBA129BC7E76F1B3E /* hpack_parser.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 422876B6E3E7152C65E656785FE22529 /* hpack_table.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + A542C9D69A6C9C40B2C2AB271B7830CD /* http2_settings.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 5C0B1772810A06520468AAFC1A392614 /* huffsyms.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + AAB495582AF5CCDE619476CDFFCE5FBB /* incoming_metadata.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + FD8F2F95A19DB285CE41C5FE196F8163 /* internal.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + FC5DA58AC406CBEBF80A504A22687583 /* stream_map.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + 7A8AA77DAB4FCDE4EA06FE6900FA7023 /* varint.h in Copy src/core/ext/transport/chttp2/transport Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AEECCB4BB03834C58FEB56E5DEEAEB36 /* Copy crypto/fipsmodule/ec Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/ec"; + dstSubfolderSpec = 16; + files = ( + 6C67C0BFF878FA98A13B1291B14D2F97 /* internal.h in Copy crypto/fipsmodule/ec Private Headers */, + 8467981CC2B3FA884BCA9F3CC837499B /* p256-x86_64.h in Copy crypto/fipsmodule/ec Private Headers */, + 6422ECFA0EC299D0B9DE4BCCE2EEEE54 /* p256-x86_64-table.h in Copy crypto/fipsmodule/ec Private Headers */, + ); + name = "Copy crypto/fipsmodule/ec Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + AF8E3E410A754D8BACE79387853B9CBA /* Copy src/core/ext/transport/chttp2/alpn Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/alpn"; + dstSubfolderSpec = 16; + files = ( + 2F6F610FE1AD40DC4A8CA3E2E3E85D61 /* alpn.h in Copy src/core/ext/transport/chttp2/alpn Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/alpn Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B05DA8BC5954BFCBEF5DA52AAEC652BD /* Copy support Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/support"; + dstSubfolderSpec = 16; + files = ( + 360030BE4B07272C9997892CD41DF10F /* async_stream.h in Copy support Public Headers */, + 4630755B66748CCC6B1F2FEB013CD57C /* async_stream_impl.h in Copy support Public Headers */, + 7FA3DCDF5A6E4A418EEDFC624DCC9B61 /* async_unary_call.h in Copy support Public Headers */, + 53E094A5C9032D23A5E9BC8018AD326A /* async_unary_call_impl.h in Copy support Public Headers */, + EC64E84E716A4794E1E73ED626CA6F83 /* byte_buffer.h in Copy support Public Headers */, + 273A95DE9154313CB81B138A516CC961 /* channel_arguments.h in Copy support Public Headers */, + 006638C007F9299BC096A64DF74DB1EF /* channel_arguments_impl.h in Copy support Public Headers */, + 35C781A6E1D77730EBB2BDC1FEDE0BD8 /* client_callback.h in Copy support Public Headers */, + 05D3C7673F44D14745E635160F8A6486 /* client_callback_impl.h in Copy support Public Headers */, + E093ED601BC39CD66B7644432DD10E07 /* client_interceptor.h in Copy support Public Headers */, + 0D53CB1AA1108E7EFDAF0EC6752671D2 /* config.h in Copy support Public Headers */, + A376EEDE01608D31C3DAF7A677C9C095 /* interceptor.h in Copy support Public Headers */, + D08385CCF5834881CEB06645EEF3C8E8 /* message_allocator.h in Copy support Public Headers */, + 1E7BDD2B804CF891A4FB14FF9DB60A61 /* proto_buffer_reader.h in Copy support Public Headers */, + D0FB69B58173072378858B1ABD5B11B8 /* proto_buffer_writer.h in Copy support Public Headers */, + E31646333359DEC71CD6814AB4A2BAAD /* server_callback.h in Copy support Public Headers */, + 87159C94547F89F1D55067DC06B369F6 /* server_callback_impl.h in Copy support Public Headers */, + 4625F25AA0D55CF701451724D518D99B /* server_interceptor.h in Copy support Public Headers */, + 483370568955FBE6EB418161C1C4AACE /* slice.h in Copy support Public Headers */, + 6DA0ADA38CC766128674236E6B7137E1 /* status.h in Copy support Public Headers */, + 12A1D2FA53090D3CB21FC65C487DEAE7 /* status_code_enum.h in Copy support Public Headers */, + 126591783AF522F8EEE597E4DFF9EFBA /* string_ref.h in Copy support Public Headers */, + E50F3341C783FA43E10F2F76D842010A /* stub_options.h in Copy support Public Headers */, + 2784C6BD779AC5F637B9B518E43AF39E /* sync_stream.h in Copy support Public Headers */, + A1CEADE0F53D4C0B0C704AA7A33A7157 /* sync_stream_impl.h in Copy support Public Headers */, + C3E2D361A4A43493071C36DB3A17FEA3 /* time.h in Copy support Public Headers */, + 58C7D778FE922C1EADDB3AB0AA3FAB10 /* validate_service_config.h in Copy support Public Headers */, + ); + name = "Copy support Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B085D4F6110FDB784E128B8BC6ED8389 /* Copy src/core/tsi/ssl/session_cache Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/ssl/session_cache"; + dstSubfolderSpec = 16; + files = ( + EA9D47589D6C76C218027DE54EAB2B63 /* ssl_session.h in Copy src/core/tsi/ssl/session_cache Private Headers */, + FEE9EDB962D2C13413769717ED0790C7 /* ssl_session_cache.h in Copy src/core/tsi/ssl/session_cache Private Headers */, + ); + name = "Copy src/core/tsi/ssl/session_cache Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B360FF1AB08A164815EDADABDDCD61A0 /* Copy crypto/pkcs7 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/pkcs7"; + dstSubfolderSpec = 16; + files = ( + 48F4D7EE9677167E0217B81B1611F615 /* internal.h in Copy crypto/pkcs7 Private Headers */, + ); + name = "Copy crypto/pkcs7 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B3B00B0283A58FE804F80B299D023E65 /* Copy third_party/upb/upb Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/third_party/upb/upb"; + dstSubfolderSpec = 16; + files = ( + EBFDBA840A207FDB27154572BE969D29 /* decode.h in Copy third_party/upb/upb Private Headers */, + 440E0C603012655B0E75C7F8C08AF502 /* encode.h in Copy third_party/upb/upb Private Headers */, + 1EF9285173394F74C82E64E4D0BC6B77 /* generated_util.h in Copy third_party/upb/upb Private Headers */, + 9216AA5B5A03CB5099DA8F8BB40AD7E0 /* msg.h in Copy third_party/upb/upb Private Headers */, + D585620FA88968480296ECB58A3C5023 /* port_def.inc in Copy third_party/upb/upb Private Headers */, + 9E9E0308DED7093A463F96B6428230AC /* port_undef.inc in Copy third_party/upb/upb Private Headers */, + DA304A8D502901B51C02AA8DE0A7034A /* table.int.h in Copy third_party/upb/upb Private Headers */, + 02A29AB7D94851072852A428F59A35AC /* upb.h in Copy third_party/upb/upb Private Headers */, + ); + name = "Copy third_party/upb/upb Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B6A9A630E116BE43481D0EA2D1475171 /* Copy src/core/ext/filters/http/server Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/http/server"; + dstSubfolderSpec = 16; + files = ( + A2F7451403C38B516E29F2CF005B9B59 /* http_server_filter.h in Copy src/core/ext/filters/http/server Private Headers */, + ); + name = "Copy src/core/ext/filters/http/server Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B81F122B8D660C9B65511CC732CDAE89 /* Copy src/core/lib/iomgr/executor Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr/executor"; + dstSubfolderSpec = 16; + files = ( + 3C57055E756C2F8DF7F7A425ADFEFF15 /* mpmcqueue.h in Copy src/core/lib/iomgr/executor Private Headers */, + C5B8CE3270C756076AFBAE545F6B7D05 /* threadpool.h in Copy src/core/lib/iomgr/executor Private Headers */, + ); + name = "Copy src/core/lib/iomgr/executor Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + B8FF0B842C05D6E82DD91CB5AFEDA594 /* Copy src/core/ext/upb-generated/google/rpc Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/rpc"; + dstSubfolderSpec = 16; + files = ( + 0E6742063004EBA83AA13F67E0A10870 /* status.upb.h in Copy src/core/ext/upb-generated/google/rpc Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/rpc Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BA7489423942389196B4B55F27893F57 /* Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/config/listener/v2"; + dstSubfolderSpec = 16; + files = ( + BAFCDD06E52E4D003336C97BB7F3FF88 /* api_listener.upb.h in Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BD113CD222F6A42ADB175EB03A39E0D3 /* Copy src/core/ext/transport/inproc Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/inproc"; + dstSubfolderSpec = 16; + files = ( + C8674EC9ABD6A884078D90D4E7B695E5 /* inproc_transport.h in Copy src/core/ext/transport/inproc Private Headers */, + ); + name = "Copy src/core/ext/transport/inproc Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BD190A56ECB65938577FA6A7713B3F3E /* Copy crypto/asn1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/asn1"; + dstSubfolderSpec = 16; + files = ( + A1845563EE89C360885E3B085EE68C2F /* asn1_locl.h in Copy crypto/asn1 Private Headers */, + ); + name = "Copy crypto/asn1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BDE38B4303B470648FD8FF3197AEAE37 /* Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/health/v1"; + dstSubfolderSpec = 16; + files = ( + CBEE051A70037F682AF98BA6F215F6D1 /* health.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BE0EF359E9C6EB2556A2216E693199EE /* Copy src/core/lib/security/credentials Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials"; + dstSubfolderSpec = 16; + files = ( + 74E7EAFA0407525CC2C2742B5257FE32 /* credentials.h in Copy src/core/lib/security/credentials Private Headers */, + ); + name = "Copy src/core/lib/security/credentials Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + BF886068D51F2C45440D2016DDCEC513 /* Copy memory Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/memory"; + dstSubfolderSpec = 16; + files = ( + 93AA4F498D9922569D8DE278CC49D2ED /* memory.h in Copy memory Public Headers */, + ); + name = "Copy memory Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C0CA96F629E5D41EAC3CC9D397E109C5 /* Copy strings/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/strings/internal"; + dstSubfolderSpec = 16; + files = ( + 4805E91426AF266FA42C3E280B95F961 /* char_map.h in Copy strings/internal Public Headers */, + 065CDA912B18E5CDDCC45E3BD9BC0A57 /* charconv_bigint.h in Copy strings/internal Public Headers */, + 0999F98F054E2BCFC216801BF97C2245 /* charconv_parse.h in Copy strings/internal Public Headers */, + C9EB0C0C24BD63B287C5E8B7D4C8EE46 /* escaping.h in Copy strings/internal Public Headers */, + F2D1FB29B99B9D3AD426196CBD133487 /* memutil.h in Copy strings/internal Public Headers */, + 76E10E8C41CE4E70AFDAA654405664B7 /* ostringstream.h in Copy strings/internal Public Headers */, + 786D4012BA7133E75B57ECBE0C89DBD0 /* resize_uninitialized.h in Copy strings/internal Public Headers */, + 9D6DB1BF916428E04308B56EA43413E3 /* stl_type_traits.h in Copy strings/internal Public Headers */, + E606A633707AC0A533A4C5EF19CBBC54 /* str_join_internal.h in Copy strings/internal Public Headers */, + 095905F70D2AD238C8E96EBD9CAA5A49 /* str_split_internal.h in Copy strings/internal Public Headers */, + 24182CA2CF1A1996081B8AE430B45BD4 /* utf8.h in Copy strings/internal Public Headers */, + ); + name = "Copy strings/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C118D2E74F8BB997A7A89EC19BA097B1 /* Copy src/core/lib/transport Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/transport"; + dstSubfolderSpec = 16; + files = ( + B662800E11704CCD7950A48D850A4F42 /* bdp_estimator.h in Copy src/core/lib/transport Private Headers */, + AFB5EC3AEFE29132D36D9FF8BD935E74 /* byte_stream.h in Copy src/core/lib/transport Private Headers */, + FBD4C22D2B04DC4B7060DCFE81734AA2 /* connectivity_state.h in Copy src/core/lib/transport Private Headers */, + 49B228E95E7024CEE39B6066642968C5 /* error_utils.h in Copy src/core/lib/transport Private Headers */, + 2A42965D84E7BE34AB8290A9576ED113 /* http2_errors.h in Copy src/core/lib/transport Private Headers */, + B44E7E11CEACD12A7B9B263D24ED3FA2 /* metadata.h in Copy src/core/lib/transport Private Headers */, + 13D5B3C642DB2F9939A2430B11C4B9B9 /* metadata_batch.h in Copy src/core/lib/transport Private Headers */, + 3F9D38E306459747D8298F7A7F48D530 /* pid_controller.h in Copy src/core/lib/transport Private Headers */, + 6D5C7F97E7AD5BBECC2FA8ADB63B7960 /* static_metadata.h in Copy src/core/lib/transport Private Headers */, + 0BF83692E96B59464195A1592897D7AE /* status_conversion.h in Copy src/core/lib/transport Private Headers */, + C9CB79C5CE6AC05589C21763012F1D55 /* status_metadata.h in Copy src/core/lib/transport Private Headers */, + C7EC60C1336B4CED3B867DEC31DD521A /* timeout_encoding.h in Copy src/core/lib/transport Private Headers */, + CD9AB49061A69FD3C687D5DCDE9A034C /* transport.h in Copy src/core/lib/transport Private Headers */, + 7ECCF4143C773CC1B86CB8F9E27F02EE /* transport_impl.h in Copy src/core/lib/transport Private Headers */, + ); + name = "Copy src/core/lib/transport Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C31F31CB9DA223B746C4916CF0560E1F /* Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2"; + dstSubfolderSpec = 16; + files = ( + 8AB3A46E785D9334709026BF3B984D69 /* cds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 3AECC2C88670E4C811E298D308A004A7 /* cluster.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 6E230A5DE3695F06AB6CE9F13B2B81B4 /* discovery.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + BA39588D28207DE34004736BEE86AA61 /* eds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + AC0FF1B08EE4F50C2F75FD4B0D1C7049 /* endpoint.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + AD97D987E3796BDC0C000721A17C3365 /* lds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 02C657FF15E50C75BC669CBBEBCF0989 /* listener.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 686A87B12ECA5675760789044790D969 /* rds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 31F9E7EB39E60B50A45C521987B41D3B /* route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + 3F0DACBC1069A224B6BBCEB03B0533CC /* scoped_route.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + C807B70162C29E6E1E636C7F58B36651 /* srds.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C33EE98905AA8F865EA7A39EF3B8C597 /* Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/core"; + dstSubfolderSpec = 16; + files = ( + E0F4E63C75E773CB9C39E9161427BEA9 /* address.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + BC08E0925194F23CECD80A328C213D79 /* base.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 1BBB1003816552271E914EB9CC226D80 /* config_source.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 3E8062E04E18EBAD13FB3BB8CCDC83B1 /* grpc_service.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 82F39B74105E6C6CD12074A1413306B1 /* health_check.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + CC01E26DF1FAF82157E68A3F76E94270 /* http_uri.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + A4867C7DFD8486B4D650E39B07D69AF2 /* protocol.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C45F9989382F9EDEF23409311283D2D6 /* Copy src/core/ext/upb-generated/udpa/annotations Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/udpa/annotations"; + dstSubfolderSpec = 16; + files = ( + 9F7D3AD42AD18E279C92D7CDA8A67F78 /* migrate.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + 00319CA159BB65EBEFEA055120EE90E0 /* sensitive.upb.h in Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/udpa/annotations Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + C7685AB53DA9EEC4661A1777D62D48E8 /* Copy hash/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/hash/internal"; + dstSubfolderSpec = 16; + files = ( + 650126C4632C6ADAE212C419568062F7 /* city.h in Copy hash/internal Public Headers */, + 6A23A07FD8A8FD9EA740FC88BC9FE147 /* hash.h in Copy hash/internal Public Headers */, + ); + name = "Copy hash/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + CA08E846C208164F71006F147BC72F11 /* Copy src/core/tsi/alts/crypt Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/crypt"; + dstSubfolderSpec = 16; + files = ( + 20D4D06BC7CCFCB90B2898921136CB65 /* gsec.h in Copy src/core/tsi/alts/crypt Private Headers */, + ); + name = "Copy src/core/tsi/alts/crypt Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + CAA9D45163E13022A96D7547FBC9EBDD /* Copy src/core/ext/filters/max_age Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/max_age"; + dstSubfolderSpec = 16; + files = ( + B93C501273E83D7456FB2103592B87AB /* max_age_filter.h in Copy src/core/ext/filters/max_age Private Headers */, + ); + name = "Copy src/core/ext/filters/max_age Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + CEA908C6D84422DC169DCA972F84719B /* Copy src/core/lib/http Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/http"; + dstSubfolderSpec = 16; + files = ( + 4284C18F2EB6E514DB6058491A0CC193 /* format_request.h in Copy src/core/lib/http Private Headers */, + 617021E892B9BA16D970E46D43D314C7 /* httpcli.h in Copy src/core/lib/http Private Headers */, + 15589A4CA94AB1A83A25CDA2F3BB0327 /* parser.h in Copy src/core/lib/http Private Headers */, + ); + name = "Copy src/core/lib/http Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D00C617FD8EB6FC9249FF91B4D02B5BF /* Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/udpa/data/orca/v1"; + dstSubfolderSpec = 16; + files = ( + 1124B92B8A8C7379A8E2610C98116AE7 /* orca_load_report.upb.h in Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D0891CCDF75A33BC8A6B52756947DC5C /* Copy src/core/ext/upb-generated/google/protobuf Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/protobuf"; + dstSubfolderSpec = 16; + files = ( + 19CDDEA58C2792CD19CE2172B596BB52 /* any.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 344D2659A56F6BF09164D0DD979D5372 /* descriptor.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + F20D732CCF96B64F8DB1C7DA39F6EF32 /* duration.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + BAD2A2F65DB0F9B945E78AAC2704AB1E /* empty.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 3BCB8D97A84ED7D589B0BF5D3076920C /* struct.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 2EBA1CB5B71ED2546C50BF5DCDA2060C /* timestamp.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 3E7FFB0DDD2FC2569824262804DBFBCA /* wrappers.upb.h in Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/protobuf Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D1C27A9375289AA6F403925A9DDDBBDE /* Copy . Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/."; + dstSubfolderSpec = 16; + files = ( + BEFEF6A1DCFADE8CE127A62CC964403B /* FBLPromisePrivate.h in Copy . Private Headers */, + ); + name = "Copy . Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D2C718CB8016A888749133D185C0E1F7 /* Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/dns"; + dstSubfolderSpec = 16; + files = ( + B8BC7DEBABFD1E1838370B842BC37C23 /* dns_resolver_selection.h in Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/dns Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D3CA18E0CF74079BD1470151141CAE2C /* Copy src/core/lib/security/credentials/composite Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/composite"; + dstSubfolderSpec = 16; + files = ( + ED2662AD4AB8A1DF3ED096752634E8CE /* composite_credentials.h in Copy src/core/lib/security/credentials/composite Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/composite Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D80184CC6E309B75A7EB5705E167B6C0 /* Copy src/core/lib/gpr Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/gpr"; + dstSubfolderSpec = 16; + files = ( + 650469DA2A49955AAB2BEAF4251137F0 /* alloc.h in Copy src/core/lib/gpr Private Headers */, + A04D28CBE9365E12424E70B06FFB98FA /* arena.h in Copy src/core/lib/gpr Private Headers */, + F6B2720F0AF84A116D1AFB33DECC1E74 /* env.h in Copy src/core/lib/gpr Private Headers */, + 335C1A51CDCAF1E6336BD38A2A9ED3CC /* murmur_hash.h in Copy src/core/lib/gpr Private Headers */, + 602E3EE142FAD752F59A1BE7874AA446 /* spinlock.h in Copy src/core/lib/gpr Private Headers */, + 6FE09BD595B3DBC9BA5EB1295847820A /* string.h in Copy src/core/lib/gpr Private Headers */, + 0D8EBCD6CA9723F3C8686584898D806C /* string_windows.h in Copy src/core/lib/gpr Private Headers */, + D66497D23ECDF9EAFEAF2694303C2B3C /* time_precise.h in Copy src/core/lib/gpr Private Headers */, + 867CA2D8FE19D1F13228205A06DA17BB /* tls.h in Copy src/core/lib/gpr Private Headers */, + 0071C4A4DD343FD03ABF2C09090D84D8 /* tls_gcc.h in Copy src/core/lib/gpr Private Headers */, + 675D72CA13CAAD8E7E828EF971C1AE79 /* tls_msvc.h in Copy src/core/lib/gpr Private Headers */, + 9DE112AD5CC1021A246253FAC0AF5916 /* tls_pthread.h in Copy src/core/lib/gpr Private Headers */, + ABF29A1896B2EAC37130640E13D2F6B4 /* tmpfile.h in Copy src/core/lib/gpr Private Headers */, + 2678445457EA2C196DD836A0AB40D5BF /* useful.h in Copy src/core/lib/gpr Private Headers */, + ); + name = "Copy src/core/lib/gpr Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D87A702EAE7A97A1B383B30837F3EA9B /* Copy src/core/lib/security/credentials/jwt Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/jwt"; + dstSubfolderSpec = 16; + files = ( + 8FFCBE8B59E67E13E5A9724BC4E1DBC7 /* json_token.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + D6DEEEC12AEA54B78E846402E9C6BA59 /* jwt_credentials.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + 4B57534CD5F18D5920172F7404C2CE28 /* jwt_verifier.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/jwt Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + D9FC4F0E69A9584725C9CC44F0D75BBE /* Copy src/core/ext/upb-generated/gogoproto Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/gogoproto"; + dstSubfolderSpec = 16; + files = ( + 87C15904F92B614E2A4C84482940A12D /* gogo.upb.h in Copy src/core/ext/upb-generated/gogoproto Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/gogoproto Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + DA9901266A70DDB6F859D2527BE3FAFB /* Copy src/core/lib/avl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/avl"; + dstSubfolderSpec = 16; + files = ( + DB9281CB8CFA9FC97C8BE9788193DB5E /* avl.h in Copy src/core/lib/avl Private Headers */, + ); + name = "Copy src/core/lib/avl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + DAB320AC649AFDC577C4F23ABA4F2BE3 /* Copy crypto/hrss Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/hrss"; + dstSubfolderSpec = 16; + files = ( + 9C51A4A296C8708FCD3158BDCC9E0DC7 /* internal.h in Copy crypto/hrss Private Headers */, + ); + name = "Copy crypto/hrss Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + DB7B76C2A6ABCDC6C0144110F60468B3 /* Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/service/load_stats/v2"; + dstSubfolderSpec = 16; + files = ( + 9641592635D3BC671918D2911F9B0B6D /* lrs.upb.h in Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + DDCAF1E900DFEAE45EE35B2BB06003B6 /* Copy src/cpp/client Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/cpp/client"; + dstSubfolderSpec = 16; + files = ( + 9A7CBC19711B9A0B25B1059B613091A1 /* create_channel_internal.h in Copy src/cpp/client Private Headers */, + 2F41648BF86A73F30611902B20443C08 /* secure_credentials.h in Copy src/cpp/client Private Headers */, + ); + name = "Copy src/cpp/client Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + DE488C3EE1BB2D6CAD9C6EA3391EBD29 /* Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/resolver/fake"; + dstSubfolderSpec = 16; + files = ( + 5F6E5A50206E6A522B2E35A20EE9DF13 /* fake_resolver.h in Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/resolver/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E063116DCF29ECF04A398A9AD414DD0F /* Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/metadata/v2"; + dstSubfolderSpec = 16; + files = ( + 92858283215A268C7AEE96C53214DCFD /* metadata.upb.h in Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E0BDA19F22B60E4B7399614198EE8934 /* Copy crypto/fipsmodule/digest Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/digest"; + dstSubfolderSpec = 16; + files = ( + 08EEF925643844BF2A7EAA52D9003941 /* internal.h in Copy crypto/fipsmodule/digest Private Headers */, + 140B7C4FADC3A8069EF75AB001CE217F /* md32_common.h in Copy crypto/fipsmodule/digest Private Headers */, + ); + name = "Copy crypto/fipsmodule/digest Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E1F604B011E3A8F7094B70230EDB882B /* Copy src/core/tsi/alts/handshaker Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/alts/handshaker"; + dstSubfolderSpec = 16; + files = ( + A5FDA17F5755AB30B98666C09FC998C7 /* alts_handshaker_client.h in Copy src/core/tsi/alts/handshaker Private Headers */, + 6C2511C2C8ED04A3525D5C34E4B0159D /* alts_shared_resource.h in Copy src/core/tsi/alts/handshaker Private Headers */, + B750CF2BB4A8E7A66228FD791D210CDB /* alts_tsi_handshaker.h in Copy src/core/tsi/alts/handshaker Private Headers */, + C1662B4A20DBEA07914479A0AEC64DCF /* alts_tsi_handshaker_private.h in Copy src/core/tsi/alts/handshaker Private Headers */, + E1920BAA5FB9D93A916074FBC650B4BA /* alts_tsi_utils.h in Copy src/core/tsi/alts/handshaker Private Headers */, + 43611F29A3335C4BC804B0356193A966 /* transport_security_common_api.h in Copy src/core/tsi/alts/handshaker Private Headers */, + ); + name = "Copy src/core/tsi/alts/handshaker Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E2F75945AFA6745EFEAB212950B68FD7 /* Copy src/core/lib/iomgr/executor Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/iomgr/executor"; + dstSubfolderSpec = 16; + files = ( + EA0490EF4B27F5C73492C50A1EB63C76 /* mpmcqueue.h in Copy src/core/lib/iomgr/executor Private Headers */, + EDD6F76C3B178D91620E3AB6539BE70C /* threadpool.h in Copy src/core/lib/iomgr/executor Private Headers */, + ); + name = "Copy src/core/lib/iomgr/executor Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E300AAABA212649BA19481D40CB28587 /* Copy src/core/lib/security/credentials/ssl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/ssl"; + dstSubfolderSpec = 16; + files = ( + 7344702E1EEEB9C69C181C747A8B98CE /* ssl_credentials.h in Copy src/core/lib/security/credentials/ssl Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/ssl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E366E9E2193C9A68B46F8B778ED6D371 /* Copy src/core/tsi/ssl/session_cache Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/tsi/ssl/session_cache"; + dstSubfolderSpec = 16; + files = ( + 49975A7B5D2D58429E0F37B7ABE2C630 /* ssl_session.h in Copy src/core/tsi/ssl/session_cache Private Headers */, + BFCFA90D80179124EBCA6055650C632C /* ssl_session_cache.h in Copy src/core/tsi/ssl/session_cache Private Headers */, + ); + name = "Copy src/core/tsi/ssl/session_cache Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E4A722B7970F59ED36588914C4DE862D /* Copy src/core/ext/filters/message_size Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/message_size"; + dstSubfolderSpec = 16; + files = ( + 1ECA88801001F8FF0628A30E892733C4 /* message_size_filter.h in Copy src/core/ext/filters/message_size Private Headers */, + ); + name = "Copy src/core/ext/filters/message_size Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E4ACF613D896617B67896BEDCBCC0D60 /* Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/service/discovery/v2"; + dstSubfolderSpec = 16; + files = ( + 795D9D0F787D4F8D330BA161019F24D8 /* ads.upb.h in Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E65DC70939D1931C0B56A839800E6DB0 /* Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/udpa/data/orca/v1"; + dstSubfolderSpec = 16; + files = ( + DC4B6EC40C736B51F2B478F42569FE30 /* orca_load_report.upb.h in Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E66539B2330FD3910D9AB77DC4D16AF9 /* Copy crypto/fipsmodule/modes Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/modes"; + dstSubfolderSpec = 16; + files = ( + 0DDD12902C76F18A31C5852B8BC622CB /* internal.h in Copy crypto/fipsmodule/modes Private Headers */, + ); + name = "Copy crypto/fipsmodule/modes Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E68DF31E292DC27D13C1E7AC6D08A1A1 /* Copy src/core/lib/security/security_connector Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector"; + dstSubfolderSpec = 16; + files = ( + 0FFDBA8ECA5F16661EDFD74F9A489211 /* load_system_roots.h in Copy src/core/lib/security/security_connector Private Headers */, + 1A6A5F4F8DBCEA81E476EDDACDA9195D /* load_system_roots_linux.h in Copy src/core/lib/security/security_connector Private Headers */, + EF9568AED4273605DC961294F3FE32EC /* security_connector.h in Copy src/core/lib/security/security_connector Private Headers */, + 4DE16DE1C41ED7155862C93E6ADE1FAC /* ssl_utils.h in Copy src/core/lib/security/security_connector Private Headers */, + 63D24E3DF9409AFD920FBBA3AC7ED689 /* ssl_utils_config.h in Copy src/core/lib/security/security_connector Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E6CCED92B9F5A899EA523E14CEBCC7A2 /* Copy crypto/fipsmodule/tls Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/fipsmodule/tls"; + dstSubfolderSpec = 16; + files = ( + A5C4F7A1F517A6C0BA757AB513EC0E16 /* internal.h in Copy crypto/fipsmodule/tls Private Headers */, + ); + name = "Copy crypto/fipsmodule/tls Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E7422041404CDDC2483126F883E3D4B6 /* Copy src/core/ext/filters/client_channel/xds Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/xds"; + dstSubfolderSpec = 16; + files = ( + E584B5FDF99FADAECACCA2AC2A34F1E6 /* xds_api.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 3A6F0F3321699083415AEBECEFE4B331 /* xds_bootstrap.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 023E4C8195BF1032100E04D125F07AA7 /* xds_channel.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 96D81DDCA0158A6156C2623E7749A001 /* xds_channel_args.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + FC3C7D26EC21A35712BF0D5A25BB1894 /* xds_client.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + 3AC84A30E486B34E2FA8D17E4113B949 /* xds_client_stats.h in Copy src/core/ext/filters/client_channel/xds Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/xds Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E92342C1015D85A880AC9B77A2BA3959 /* Copy src/core/ext/upb-generated/google/api Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/api"; + dstSubfolderSpec = 16; + files = ( + B1485A65A1FC4EB083EBF88D839D1DDA /* annotations.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */, + 25938F30AA7E05FE0D99A58040C2EA10 /* http.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/api Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E94733BBD4B7CEEAE38CA86A25524FA5 /* Copy src/core/ext/transport/inproc Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/inproc"; + dstSubfolderSpec = 16; + files = ( + C7AE5DBD461C1F28B09DB7483E912DE1 /* inproc_transport.h in Copy src/core/ext/transport/inproc Private Headers */, + ); + name = "Copy src/core/ext/transport/inproc Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + E98EF7A18D61E1142965A233AD43D5DC /* Copy src/core/lib/gpr Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/gpr"; + dstSubfolderSpec = 16; + files = ( + C4C81A5869A4755E9F8518BDFEC72E19 /* alloc.h in Copy src/core/lib/gpr Private Headers */, + 9E5B63753A9C600FB1DFC6EA791034CF /* arena.h in Copy src/core/lib/gpr Private Headers */, + 2F5A897553716A5F768453F548C49D8B /* env.h in Copy src/core/lib/gpr Private Headers */, + CD60C2912D09B4B9FA36ECAAA05CA9D6 /* murmur_hash.h in Copy src/core/lib/gpr Private Headers */, + 7E11A11A23412EA42F8F7BD758671EBC /* spinlock.h in Copy src/core/lib/gpr Private Headers */, + 70F4D826449F0D5947302D6B30F31B0D /* string.h in Copy src/core/lib/gpr Private Headers */, + 7ADE6DEBDA5FCD21CD3905555F510F3D /* string_windows.h in Copy src/core/lib/gpr Private Headers */, + 878BEC82DF1C7FC790979203877D56BB /* time_precise.h in Copy src/core/lib/gpr Private Headers */, + 18FC79303B6066A8B7ED3830F5F5FAEB /* tls.h in Copy src/core/lib/gpr Private Headers */, + 7115E68B9740356C58CBE295B1549802 /* tls_gcc.h in Copy src/core/lib/gpr Private Headers */, + 75AF9F73B1467744214367F6887D543A /* tls_msvc.h in Copy src/core/lib/gpr Private Headers */, + E7B1B6280EA7BBA0F0F9EB32C4E70E4B /* tls_pthread.h in Copy src/core/lib/gpr Private Headers */, + 0C27EC53C388772556B294F0D8393737 /* tmpfile.h in Copy src/core/lib/gpr Private Headers */, + FA5697C1651E7E16E99175F1C924407D /* useful.h in Copy src/core/lib/gpr Private Headers */, + ); + name = "Copy src/core/lib/gpr Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + EB7761B7B2C8D0CDDE5697302AE03552 /* Copy src/core/ext/upb-generated/google/api Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/google/api"; + dstSubfolderSpec = 16; + files = ( + B0627FDA8D7876AD2B9F501B4F4D639C /* annotations.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */, + A5EAF29C197C8BE81771D04356D9B8F9 /* http.upb.h in Copy src/core/ext/upb-generated/google/api Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/google/api Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + ECA78CD8E679781C1C1F74DEAF3E8CF8 /* Copy impl/codegen/security Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/impl/codegen/security"; + dstSubfolderSpec = 16; + files = ( + 0785663AC00F919D8BCB9DD80187141F /* auth_context.h in Copy impl/codegen/security Public Headers */, + ); + name = "Copy impl/codegen/security Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + ED9450B69FBC7DF7625BA2E6D6ABA6A0 /* Copy src/core/lib/security/security_connector/ssl Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/ssl"; + dstSubfolderSpec = 16; + files = ( + 52F0B4B96F45450AA593EB037670E8E1 /* ssl_security_connector.h in Copy src/core/lib/security/security_connector/ssl Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/ssl Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + EEA318F4E9C071273D8D655D301CFC9A /* Copy src/core/lib/security/credentials/jwt Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/credentials/jwt"; + dstSubfolderSpec = 16; + files = ( + BA741936FC002B19910B57FA0779774D /* json_token.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + 2E614C2C035E3469CC8E9D856204666B /* jwt_credentials.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + 072125740CB312EA67F1D533CA8C8456 /* jwt_verifier.h in Copy src/core/lib/security/credentials/jwt Private Headers */, + ); + name = "Copy src/core/lib/security/credentials/jwt Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + EED76687D15D9D62ADF0C78B0963B6C1 /* Copy src/core/ext/transport/chttp2/server Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/transport/chttp2/server"; + dstSubfolderSpec = 16; + files = ( + 7FEF9AFCA7249277D99F58EDE991EA89 /* chttp2_server.h in Copy src/core/ext/transport/chttp2/server Private Headers */, + ); + name = "Copy src/core/ext/transport/chttp2/server Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + EEF5D7C6137A9EEB21B707E036A5373D /* Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/api/v2/auth"; + dstSubfolderSpec = 16; + files = ( + 26A929985F03FE033395AA962407A2BC /* cert.upb.h in Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F0EE9E9D20E30120116CD042F75AE7B5 /* Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/service/discovery/v2"; + dstSubfolderSpec = 16; + files = ( + F93C50A03EFABC27C1D1945DE57522A6 /* ads.upb.h in Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F23B79B347084D66BCF21031FA19CCE5 /* Copy src/core/lib/security/security_connector/local Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/local"; + dstSubfolderSpec = 16; + files = ( + 7FABE1E4269B57F5F4E3822D2B222B83 /* local_security_connector.h in Copy src/core/lib/security/security_connector/local Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/local Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F258F0D3D4DB2122D2957C10C8FDB2EC /* Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/matcher"; + dstSubfolderSpec = 16; + files = ( + 86AD24286DB8DCF7CB44B58507DD80DD /* regex.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + EA5C05340772187860ED990F5F66E039 /* string.upb.h in Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3B96E337116A76E5F0AA5A2EDFB34A4 /* Copy src/core/lib/security/security_connector/fake Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/lib/security/security_connector/fake"; + dstSubfolderSpec = 16; + files = ( + 86BA4D29C608DEC0CE52B00F039D64F0 /* fake_security_connector.h in Copy src/core/lib/security/security_connector/fake Private Headers */, + ); + name = "Copy src/core/lib/security/security_connector/fake Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F44F7BFE835888A426986C37F01A2AD3 /* Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/type/tracing/v2"; + dstSubfolderSpec = 16; + files = ( + B5C4BE068DA5E44BA76BA4130B35BCB8 /* custom_tag.upb.h in Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F6A3F276E99378ED30466007B09CC669 /* Copy src/core/ext/filters/client_channel/health Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/health"; + dstSubfolderSpec = 16; + files = ( + 319643D86AC244952A317D7EA8E2D4CF /* health_check_client.h in Copy src/core/ext/filters/client_channel/health Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/health Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F7A6F081CADBBCC89BAA5ABE63958E2D /* Copy src/core/ext/filters/client_channel/lb_policy Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel/lb_policy"; + dstSubfolderSpec = 16; + files = ( + 43D9A431A5C16A7F03836FB6ACE1BDE1 /* child_policy_handler.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + D8C6687DDEDF2313835DF3B176EE6522 /* subchannel_list.h in Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel/lb_policy Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F7B259E0FF8B8A345643C4BEF301D618 /* Copy crypto/bio Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/bio"; + dstSubfolderSpec = 16; + files = ( + 4FC4CB14DB1C1726CCD261486E9B3534 /* internal.h in Copy crypto/bio Private Headers */, + ); + name = "Copy crypto/bio Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F7D094268EB85AC2467B9BE5767FA226 /* Copy base Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/base"; + dstSubfolderSpec = 16; + files = ( + F3B71905CD9356C32CA1DF0C1B56022A /* attributes.h in Copy base Public Headers */, + ED478A91AB121B44AD449C7C3FBFAEC6 /* call_once.h in Copy base Public Headers */, + 2A3FAC107F5852F91D675F3A00CBDFCD /* casts.h in Copy base Public Headers */, + B205935DF01370360691C0A358CA2A9E /* config.h in Copy base Public Headers */, + CFE2E2AC191AD1777472A891C13BA12E /* const_init.h in Copy base Public Headers */, + 385718DC7EA8B3DC6FE9C410BD008DB0 /* dynamic_annotations.h in Copy base Public Headers */, + DC4EE07B0A5412DC2BD537B7BEEA4885 /* log_severity.h in Copy base Public Headers */, + 53FC276736D9C331F6A901A4E8791596 /* macros.h in Copy base Public Headers */, + FBB014BEA67A7C6C78131711C9BD6FC0 /* optimization.h in Copy base Public Headers */, + BF263E9587FFB3A6584A990F6B8DDF2C /* options.h in Copy base Public Headers */, + BDAE866DEEFE69991C5D6F5F1DBF8714 /* policy_checks.h in Copy base Public Headers */, + DB4EE7AED03D820723AFA6A714FB713D /* port.h in Copy base Public Headers */, + 17B57DBC6AE7B31C49D0ED650EDE9AAF /* thread_annotations.h in Copy base Public Headers */, + ); + name = "Copy base Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F811133AB254104829C578A63AAD03E5 /* Copy src/core/ext/filters/client_channel Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/filters/client_channel"; + dstSubfolderSpec = 16; + files = ( + B6F378F5A4B477178A2A35F2BCB379D1 /* backend_metric.h in Copy src/core/ext/filters/client_channel Private Headers */, + 7511787524811F67D45DC6C4914DD39B /* backup_poller.h in Copy src/core/ext/filters/client_channel Private Headers */, + C818DB50DF68573D9A10C5A596F41164 /* client_channel.h in Copy src/core/ext/filters/client_channel Private Headers */, + EA69142DB63E8E8D3D53FE2687DC9171 /* client_channel_channelz.h in Copy src/core/ext/filters/client_channel Private Headers */, + 49778BA408ECDE835DF441DC1B1DF48B /* client_channel_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + D87164C5D399F8EE5BFF1592ECACF3ED /* connector.h in Copy src/core/ext/filters/client_channel Private Headers */, + F6E9C69B69A85779A7B24BBE38128890 /* global_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */, + A2CC9EDA9F65BE305AC403A035E0D199 /* http_connect_handshaker.h in Copy src/core/ext/filters/client_channel Private Headers */, + E52386B2342B756BD513CBE27FCAD317 /* http_proxy.h in Copy src/core/ext/filters/client_channel Private Headers */, + 8038841973630699710D0CD1F20A6B85 /* lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */, + 65DE0865C64736D04AC07BF9D989D87E /* lb_policy_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + BF4CB12654CF5BF84F9DB2192E0E913A /* lb_policy_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + 5F308AA45115E170C4DD6689A6FF52B3 /* local_subchannel_pool.h in Copy src/core/ext/filters/client_channel Private Headers */, + AD2EA981467E66725EB916BA9D828FDF /* parse_address.h in Copy src/core/ext/filters/client_channel Private Headers */, + 107C317ACB99063C33D77F3AB1512010 /* proxy_mapper.h in Copy src/core/ext/filters/client_channel Private Headers */, + 208E2F366144FA0CE6E3C19630752C8C /* proxy_mapper_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + 1BAE3309EE2CDE12CC686BE7FEA8D77F /* resolver.h in Copy src/core/ext/filters/client_channel Private Headers */, + B40F7534E7DF35D87A696525486C3E28 /* resolver_factory.h in Copy src/core/ext/filters/client_channel Private Headers */, + C0783DC10F6FF2C83FCD4DB868848F84 /* resolver_registry.h in Copy src/core/ext/filters/client_channel Private Headers */, + 7D8DC4AE296D60459E8771995605CDF4 /* resolver_result_parsing.h in Copy src/core/ext/filters/client_channel Private Headers */, + E0826360D46EDEE13F986804C03DB3F6 /* resolving_lb_policy.h in Copy src/core/ext/filters/client_channel Private Headers */, + B2EAC758E0895A05B9F0FE598763D2DD /* retry_throttle.h in Copy src/core/ext/filters/client_channel Private Headers */, + 06375462C43B83AA6E1149157849E3EA /* server_address.h in Copy src/core/ext/filters/client_channel Private Headers */, + E581B8C43785B885A7CADE5922011E9C /* service_config.h in Copy src/core/ext/filters/client_channel Private Headers */, + 2A417CF1E35E4EC063345991FB01754D /* subchannel.h in Copy src/core/ext/filters/client_channel Private Headers */, + 1A9CE0C5CE7B290CD42790A885F461B4 /* subchannel_interface.h in Copy src/core/ext/filters/client_channel Private Headers */, + C72CF33A82C59392756CD6A42DA8BE28 /* subchannel_pool_interface.h in Copy src/core/ext/filters/client_channel Private Headers */, + ); + name = "Copy src/core/ext/filters/client_channel Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + F8D70E55EFBD5DE9A51FDDE8E7CEA57C /* Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/src/proto/grpc/gcp"; + dstSubfolderSpec = 16; + files = ( + 04F9683988412FEAB737D6EE393ABCF6 /* altscontext.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + FC4DCD10474DD59811CD3BED99E7BD1A /* handshaker.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + 65E92107012575B42A4C8928AB6FDD1F /* transport_security_common.upb.h in Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + FA8ADDE242B49E3D0D89CDACD69BE875 /* Copy src/core/ext/upb-generated/envoy/annotations Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/src/core/ext/upb-generated/envoy/annotations"; + dstSubfolderSpec = 16; + files = ( + 0DDE7415D2188B425641D36A7B8B85F1 /* deprecation.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + 3156B7775BEE2A1C37C58F03FEEC0085 /* resource.upb.h in Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + ); + name = "Copy src/core/ext/upb-generated/envoy/annotations Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + FA9DAF009DD4699512AB4BABC6070AC0 /* Copy time/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/time/internal"; + dstSubfolderSpec = 16; + files = ( + DD07E6B592F549031B3B990A6C2B911A /* get_current_time_chrono.inc in Copy time/internal Public Headers */, + 25DFB29126A961C588733B3A6F150F59 /* get_current_time_posix.inc in Copy time/internal Public Headers */, + ); + name = "Copy time/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + FB0C2F81712102066F23B2C8AD81460F /* Copy crypto/bytestring Private Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PRIVATE_HEADERS_FOLDER_PATH)/crypto/bytestring"; + dstSubfolderSpec = 16; + files = ( + 25BE06F7C53B3B262EE6046E0B10468B /* internal.h in Copy crypto/bytestring Private Headers */, + ); + name = "Copy crypto/bytestring Private Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + FC80983F16094BC7BB334C06C2D45B13 /* Copy . Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/."; + dstSubfolderSpec = 16; + files = ( + 72C4F867BE3F250D74C3A8760B16732C /* alarm.h in Copy . Public Headers */, + E321110D856279FBFBDD3D12086242C9 /* alarm_impl.h in Copy . Public Headers */, + 35A738EB4A69AE26C6B0E4E33799155A /* channel.h in Copy . Public Headers */, + 6926CFE7DD26621680ED96D7A677CCE9 /* channel_impl.h in Copy . Public Headers */, + 119DB3B8ED24E5933C1A2C3ABD5978B9 /* client_context.h in Copy . Public Headers */, + 2F7952842F6B570FA94C5B166B07DE09 /* completion_queue.h in Copy . Public Headers */, + 8B5F15448F14C2AA418F7C90BFCA31B9 /* completion_queue_impl.h in Copy . Public Headers */, + 292E5C23BFC5E65F3470FCD697CB489E /* create_channel.h in Copy . Public Headers */, + 5937FCD099F0E7B5EB276C9885B73DB8 /* create_channel_impl.h in Copy . Public Headers */, + C96ECB483D03FC94EA8A153B761B2AE7 /* create_channel_posix.h in Copy . Public Headers */, + 731B0916AE888905F4C62C38C1B0B867 /* create_channel_posix_impl.h in Copy . Public Headers */, + 0CE54E10F84E8D669AC362586D8793A5 /* grpcpp.h in Copy . Public Headers */, + 25EF45129026EBE3AD6B4ECA9348B7E2 /* health_check_service_interface.h in Copy . Public Headers */, + 86CA837868A38557332E2170D2871960 /* health_check_service_interface_impl.h in Copy . Public Headers */, + 767213C27CD814E3B357EF8743DED3F7 /* resource_quota.h in Copy . Public Headers */, + 041AFC7720085A077CB20C046938FCF1 /* resource_quota_impl.h in Copy . Public Headers */, + 74A2578217CCA79F83F95E4B088B8130 /* server.h in Copy . Public Headers */, + 266825AFC209D0C897716A834E17AAD6 /* server_builder.h in Copy . Public Headers */, + 6E22879787D985632CA3101650CB6684 /* server_builder_impl.h in Copy . Public Headers */, + 5DC777A79CCBBB7021459ACF47849E95 /* server_context.h in Copy . Public Headers */, + 0D1A5FAE587320A7487C8CC208633E26 /* server_impl.h in Copy . Public Headers */, + 79D9D27AB5C35699B34445F6877452D7 /* server_posix.h in Copy . Public Headers */, + EA138CB91CFE50BCA31CD9039EED6DE8 /* server_posix_impl.h in Copy . Public Headers */, + ); + name = "Copy . Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; + FCC6ABC40C520A10D19B8D25B7DDFFFA /* Copy base/internal Public Headers */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(PUBLIC_HEADERS_FOLDER_PATH)/base/internal"; + dstSubfolderSpec = 16; + files = ( + 3A2C1C32065460FCF0AEEC0D54994997 /* atomic_hook.h in Copy base/internal Public Headers */, + 8950C6F72B96AD744C1A819C88E94BCF /* bits.h in Copy base/internal Public Headers */, + D91601E7A691DB19E52D674C09336F6A /* cycleclock.h in Copy base/internal Public Headers */, + 917ED899E79EACF3C864AD3C7410A70F /* direct_mmap.h in Copy base/internal Public Headers */, + 66A7196E819C235F0BA6D8B37D1408F9 /* endian.h in Copy base/internal Public Headers */, + 562F391B24E88E263C58AEFC432644B1 /* errno_saver.h in Copy base/internal Public Headers */, + 1DE237317FEE1F4FF1958290DCAD9CB5 /* exponential_biased.h in Copy base/internal Public Headers */, + 1EAAE2D1B70AC97A4A768521FA5BF68B /* hide_ptr.h in Copy base/internal Public Headers */, + 4C1D07AA9A97747970955432D759E661 /* identity.h in Copy base/internal Public Headers */, + 5573260535E8DBBD112B596A34BB9834 /* inline_variable.h in Copy base/internal Public Headers */, + C630EAC3A38F2081291AA260656CBA21 /* invoke.h in Copy base/internal Public Headers */, + 830B514153C982E441E261B3065E7A7A /* low_level_alloc.h in Copy base/internal Public Headers */, + 59B0CB5296AD01A3073A1D09E9477286 /* low_level_scheduling.h in Copy base/internal Public Headers */, + 1247B1597FDBC478C0AC75FF3F7E9F50 /* per_thread_tls.h in Copy base/internal Public Headers */, + AA712B985515C10710F6D7E4F867936A /* periodic_sampler.h in Copy base/internal Public Headers */, + 7A453F7A1FB194F89509E20298B0B2FC /* pretty_function.h in Copy base/internal Public Headers */, + D755E510EFF1EC4A9A1F5028C4DB6009 /* raw_logging.h in Copy base/internal Public Headers */, + 76EBA7D7D17A88177A2C7093A93AEA45 /* scheduling_mode.h in Copy base/internal Public Headers */, + 465BC389CCD2D909FE5DDD3C7385827D /* spinlock.h in Copy base/internal Public Headers */, + CEFA92B579D976A853654718C324A79F /* spinlock_akaros.inc in Copy base/internal Public Headers */, + 9D7FA83F5FA60EE75D63F9F31BF9C25E /* spinlock_linux.inc in Copy base/internal Public Headers */, + 57B465DE10448D544804588EC57B39E5 /* spinlock_posix.inc in Copy base/internal Public Headers */, + F57F9E2F87707FBDF803E9DB05B68ADD /* spinlock_wait.h in Copy base/internal Public Headers */, + 59A768C376E2F66CDC6BEF6476B02F20 /* spinlock_win32.inc in Copy base/internal Public Headers */, + 9F6C3DEC2FB722DADF397CB5552FB9FB /* sysinfo.h in Copy base/internal Public Headers */, + DECFF604388901ED57FB4EE793BB6130 /* thread_annotations.h in Copy base/internal Public Headers */, + 0374725F150450B015C4CCA11F7865E2 /* thread_identity.h in Copy base/internal Public Headers */, + C03E10DD1F696F5FE6BB8900F42621EE /* throw_delegate.h in Copy base/internal Public Headers */, + FCC17450FB14B1CB950AF871565965D7 /* tsan_mutex_interface.h in Copy base/internal Public Headers */, + 68D40940A072E0F2D714023FDA4A30F6 /* unaligned_access.h in Copy base/internal Public Headers */, + B3D1B5DB94835346FCCA98E10B1A1C69 /* unscaledcycleclock.h in Copy base/internal Public Headers */, + ); + name = "Copy base/internal Public Headers"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 000100487D801EF5ED9C0180E19A700F /* FirebaseFirestore-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "FirebaseFirestore-Info.plist"; sourceTree = ""; }; + 001B4B27E14395D35EB3A1B598BF9543 /* asn1_lib.c */ = {isa = PBXFileReference; includeInIndex = 1; name = asn1_lib.c; path = src/crypto/asn1/asn1_lib.c; sourceTree = ""; }; + 0038A2ECB3F315B264D2ABE627F3C1D3 /* FirebaseCore.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseCore.debug.xcconfig; sourceTree = ""; }; + 003E83FF1B679A9B48F56CDA90C03386 /* ssl_types.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_types.h; path = src/core/tsi/ssl_types.h; sourceTree = ""; }; + 004389D24BC022DC6B69A7925CCF7007 /* FIRVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRVersion.h; path = FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h; sourceTree = ""; }; + 0043AE8C7FA93FC299669D57A4CCE2BF /* iterator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iterator.cc; path = table/iterator.cc; sourceTree = ""; }; + 0049238C3E9AAC3BC661E86C89A71143 /* rsaz_exp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rsaz_exp.h; path = src/crypto/fipsmodule/bn/rsaz_exp.h; sourceTree = ""; }; + 0095D0E40BA0950DEE437C7007669E42 /* comparison.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = comparison.cc; path = Firestore/core/src/util/comparison.cc; sourceTree = ""; }; + 00A330EC4B929E07DEF5020B6E628E4A /* init_secure.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = init_secure.cc; path = src/core/lib/surface/init_secure.cc; sourceTree = ""; }; + 00A999BA53AED1F3360BE2B79E1276CC /* tls_credentials_options_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_credentials_options_util.h; path = src/cpp/common/tls_credentials_options_util.h; sourceTree = ""; }; + 00BF389E62959EE7F4358912718FA7C3 /* refcount_lock.c */ = {isa = PBXFileReference; includeInIndex = 1; name = refcount_lock.c; path = src/crypto/refcount_lock.c; sourceTree = ""; }; + 00C8BD1B52446E60AC16BC271D818BEB /* http_connection_manager.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_connection_manager.upb.h; path = "src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h"; sourceTree = ""; }; + 00D45ED61830C467AC4B5009EF5DC7CE /* resolver_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_registry.h; path = src/core/ext/filters/client_channel/resolver_registry.h; sourceTree = ""; }; + 00E091313428C8D72E21DB5C33C2C835 /* tls_record.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_record.cc; path = src/ssl/tls_record.cc; sourceTree = ""; }; + 00F4D0A03E256C135B9EAE3E42644BF0 /* tcp_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_client.h; path = src/core/lib/iomgr/tcp_client.h; sourceTree = ""; }; + 00F9C00975F303BF8DE7F221D6FCEB86 /* grpc_connection.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_connection.cc; path = Firestore/core/src/remote/grpc_connection.cc; sourceTree = ""; }; + 0105331323361FB6B77031C4D88C0928 /* dns_resolver_selection.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dns_resolver_selection.h; path = src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h; sourceTree = ""; }; + 01086C47DF75801EE8C1B2CC9E8E533A /* cbs.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cbs.c; path = src/crypto/bytestring/cbs.c; sourceTree = ""; }; + 0122781482DB99BE6378BC4DF1087D05 /* string.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string.h; path = src/core/lib/gpr/string.h; sourceTree = ""; }; + 012D35287FBE5F05808D75E782C2019C /* task.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = task.cc; path = Firestore/core/src/util/task.cc; sourceTree = ""; }; + 0142698C82305E8FB4EB2BCC0C1A2366 /* query_snapshot.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query_snapshot.cc; path = Firestore/core/src/api/query_snapshot.cc; sourceTree = ""; }; + 017527197F417982A48F54CAB5BE1B53 /* time_zone_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_impl.h; path = absl/time/internal/cctz/src/time_zone_impl.h; sourceTree = ""; }; + 01A4CD2489007A624F5F90B257E700F2 /* conf_def.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = conf_def.h; path = src/crypto/conf/conf_def.h; sourceTree = ""; }; + 01A752FC79D38A266A296BBC11BEF111 /* encode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = encode.h; path = third_party/upb/upb/encode.h; sourceTree = ""; }; + 01AA09207ED07385DCBF635BAFA70C38 /* context_list.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = context_list.cc; path = src/core/ext/transport/chttp2/transport/context_list.cc; sourceTree = ""; }; + 01B26CFE2F76C29EBDEA60A8BF11A63A /* FIRSnapshotMetadata.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRSnapshotMetadata.mm; path = Firestore/Source/API/FIRSnapshotMetadata.mm; sourceTree = ""; }; + 01B3A05C0CD77B8DFE62014D8A623B76 /* alts_iovec_record_protocol.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_iovec_record_protocol.cc; path = src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc; sourceTree = ""; }; + 01C5A712FA078A8CBA6C8365E1EA071A /* ssl_utils_config.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_utils_config.cc; path = src/core/lib/security/security_connector/ssl_utils_config.cc; sourceTree = ""; }; + 01E9E32DCC2758F4DD9AF31F20C36D25 /* interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = interceptor.h; path = include/grpcpp/support/interceptor.h; sourceTree = ""; }; + 01F0E948191D8F9107418B1954815CD9 /* fake_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fake_security_connector.cc; path = src/core/lib/security/security_connector/fake/fake_security_connector.cc; sourceTree = ""; }; + 01FF4609D5497521C83F7CF4D937FC90 /* endpoint.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h"; sourceTree = ""; }; + 02054DA0396C7663732C32D7690309DE /* transport_security_grpc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_grpc.h; path = src/core/tsi/transport_security_grpc.h; sourceTree = ""; }; + 020893C043D192B28524F562B1DE9713 /* route.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = route.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c"; sourceTree = ""; }; + 021AC33601AC9193154A278DC0A3D897 /* tsi_error.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tsi_error.h; path = src/core/lib/security/transport/tsi_error.h; sourceTree = ""; }; + 022CA1CB15A7268E67F501BEAD00C894 /* GDTCORStorageProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORStorageProtocol.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageProtocol.h; sourceTree = ""; }; + 0235052BB9836B27F86FB4973F07B20E /* parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = parser.h; path = src/core/lib/http/parser.h; sourceTree = ""; }; + 0244701A5C8D5C5F14728AA23CAFE97C /* stack.c */ = {isa = PBXFileReference; includeInIndex = 1; name = stack.c; path = src/crypto/stack/stack.c; sourceTree = ""; }; + 02A356512AC6468A0C53864D1C9ACD6E /* FIRCoreDiagnosticsConnector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsConnector.h; path = FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h; sourceTree = ""; }; + 02A80276D1041E3572A13C7F7BAD60FC /* field_path.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = field_path.cc; path = Firestore/core/src/model/field_path.cc; sourceTree = ""; }; + 030013C730D65D48EA49BA6310252C9B /* google_default_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = google_default_credentials.h; path = src/core/lib/security/credentials/google_default/google_default_credentials.h; sourceTree = ""; }; + 034BA6ABEAC3D0030D96059FDD8085BC /* dns_resolver_ares.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dns_resolver_ares.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc; sourceTree = ""; }; + 035B185447B62AA82940A376F12AB1CB /* env_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = env_posix.cc; path = util/env_posix.cc; sourceTree = ""; }; + 03802921213BD6AF75F8E23379BD49FE /* error_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_internal.h; path = src/core/lib/iomgr/error_internal.h; sourceTree = ""; }; + 039BEA729826C3D85DA222EC6F94975E /* error_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_internal.h; path = src/core/lib/iomgr/error_internal.h; sourceTree = ""; }; + 03B5E77F4EAB14191E0B906E65441D6F /* channel_create_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_create_posix.cc; path = src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc; sourceTree = ""; }; + 03BA24AFB91ECE92CAD89E779604682C /* server_auth_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_auth_filter.cc; path = src/core/lib/security/transport/server_auth_filter.cc; sourceTree = ""; }; + 03CC4EE82BCD879C79C01BEDD0B6BC30 /* tls_credentials_options_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_credentials_options_util.cc; path = src/cpp/common/tls_credentials_options_util.cc; sourceTree = ""; }; + 03DAE0986021B6A0ADE31ECBF13BC2B6 /* executor_libdispatch.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = executor_libdispatch.mm; path = Firestore/core/src/util/executor_libdispatch.mm; sourceTree = ""; }; + 03F8C50107A79647B6CFEF808B390797 /* threadpool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = threadpool.h; path = src/core/lib/iomgr/executor/threadpool.h; sourceTree = ""; }; + 04454E53C1A5426BD89BE12373724382 /* migrate.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = migrate.upb.c; path = "src/core/ext/upb-generated/udpa/annotations/migrate.upb.c"; sourceTree = ""; }; + 04488BCA843893FBC5E90E958DA72828 /* protocol.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = protocol.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c"; sourceTree = ""; }; + 044B747742E07C2B1C0BEBF2FDDE7748 /* FBLPromise+Then.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Then.m"; path = "Sources/FBLPromises/FBLPromise+Then.m"; sourceTree = ""; }; + 0478A1B2FBD0AA9F1B2D032BB151B5A2 /* GoogleDataTransport-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GoogleDataTransport-umbrella.h"; sourceTree = ""; }; + 0478D5B0634B84EEF2E8701F70276541 /* pollset_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_windows.cc; path = src/core/lib/iomgr/pollset_windows.cc; sourceTree = ""; }; + 048660E3AF6CB3E3B137F63962C883DB /* thread_win.c */ = {isa = PBXFileReference; includeInIndex = 1; name = thread_win.c; path = src/crypto/thread_win.c; sourceTree = ""; }; + 04BB4A2F1E8A7F153A34E5E0B2FF62EA /* tcp_server_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_posix.cc; path = src/core/lib/iomgr/tcp_server_posix.cc; sourceTree = ""; }; + 04D4A1971E007FF328FBD833184AF696 /* local_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_credentials.h; path = src/core/lib/security/credentials/local/local_credentials.h; sourceTree = ""; }; + 04F0FBFE524EED058041C4F427768BF4 /* ec_derive.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ec_derive.c; path = src/crypto/ec_extra/ec_derive.c; sourceTree = ""; }; + 050849C7F064DCED00CFCA2CCE677D3C /* grpc_shadow_boringssl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_shadow_boringssl.h; path = src/core/tsi/grpc_shadow_boringssl.h; sourceTree = ""; }; + 053213A0CC6738A69DB6FBBE362E3E75 /* decode.c */ = {isa = PBXFileReference; includeInIndex = 1; name = decode.c; path = third_party/upb/upb/decode.c; sourceTree = ""; }; + 0546C9F4A64E4E5EE7C9030601390424 /* cluster.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cluster.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c"; sourceTree = ""; }; + 05613D12F20BED5782E8F875D6060479 /* a_int.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_int.c; path = src/crypto/asn1/a_int.c; sourceTree = ""; }; + 0565B1D3A5B1DE8B3DDD61843DB5C268 /* sensitive.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sensitive.upb.c; path = "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c"; sourceTree = ""; }; + 0587424F4164451527E3B56AB37AD4E5 /* hashtablez_sampler_force_weak_definition.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hashtablez_sampler_force_weak_definition.cc; path = absl/container/internal/hashtablez_sampler_force_weak_definition.cc; sourceTree = ""; }; + 058FAB760C94291A6846B1D83C0CFC12 /* spinlock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = spinlock.h; path = src/core/lib/gpr/spinlock.h; sourceTree = ""; }; + 0593165C5FD6254F93A24AEBF1666D95 /* trace.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = trace.cc; path = src/core/lib/debug/trace.cc; sourceTree = ""; }; + 05BBF7398C7A402D224160BB799B4E5B /* mutex_nonprod.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutex_nonprod.inc; path = absl/synchronization/internal/mutex_nonprod.inc; sourceTree = ""; }; + 05F0B78A6D8F1291ABA4D37887BD58CE /* local_serializer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_serializer.cc; path = Firestore/core/src/local/local_serializer.cc; sourceTree = ""; }; + 05FE74B4861BFB87C230C39D0FFAFAC2 /* xds_client_stats.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_client_stats.cc; path = src/core/ext/filters/client_channel/xds/xds_client_stats.cc; sourceTree = ""; }; + 060F549530567FABD6EC369C1267D9C9 /* x_info.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_info.c; path = src/crypto/x509/x_info.c; sourceTree = ""; }; + 0616886D4D867ECC1ED7D73DDC3DB27A /* span.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = span.h; path = absl/types/internal/span.h; sourceTree = ""; }; + 0618EF3D922942AB0599F423215BB750 /* curve25519_tables.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = curve25519_tables.h; path = src/third_party/fiat/curve25519_tables.h; sourceTree = ""; }; + 061E3D0E4C036EB9690A95CD28C2B174 /* resolver_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolver_registry.cc; path = src/core/ext/filters/client_channel/resolver_registry.cc; sourceTree = ""; }; + 0625B451A83FA539603141FE9432CD4D /* FirebaseFirestore-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FirebaseFirestore-dummy.m"; sourceTree = ""; }; + 063EF7B4806888581BA77122A4F21388 /* jwt_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = jwt_credentials.h; path = src/core/lib/security/credentials/jwt/jwt_credentials.h; sourceTree = ""; }; + 06401BF37C71D3F6E123CA93029A43B9 /* resolver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver.h; path = src/core/ext/filters/client_channel/resolver.h; sourceTree = ""; }; + 0641ECD8129761440688E3F2FEF3D6E5 /* nanopb-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "nanopb-dummy.m"; sourceTree = ""; }; + 064C4268209BCBABE36F35D6DB7B565B /* key_field_in_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = key_field_in_filter.cc; path = Firestore/core/src/core/key_field_in_filter.cc; sourceTree = ""; }; + 06543595F0017DA7C2D864B8C59959DA /* check_gcp_environment_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = check_gcp_environment_windows.cc; path = src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc; sourceTree = ""; }; + 0662E898C6EC0861687AC029B9735D7C /* x509_d2.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_d2.c; path = src/crypto/x509/x509_d2.c; sourceTree = ""; }; + 0665600A3F802CD2D235A7CA08B137AB /* GULLogger.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULLogger.m; path = GoogleUtilities/Logger/GULLogger.m; sourceTree = ""; }; + 0669EC87902A174C07ECC27922C9207B /* completion_queue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue.h; path = include/grpcpp/impl/codegen/completion_queue.h; sourceTree = ""; }; + 06762793F5E47A79E012F1948C1F661E /* annotations.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = annotations.upb.c; path = "src/core/ext/upb-generated/google/api/annotations.upb.c"; sourceTree = ""; }; + 06A9E865AA36BFC1B00F9E7E745DE6F1 /* channel_trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_trace.h; path = src/core/lib/channel/channel_trace.h; sourceTree = ""; }; + 06AEA9EBB3AE752155C0F57EA283BCA5 /* metadata_batch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata_batch.h; path = src/core/lib/transport/metadata_batch.h; sourceTree = ""; }; + 06D6148BF61FDC5B620DDA60B37DDA84 /* pollset_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_windows.h; path = src/core/lib/iomgr/pollset_windows.h; sourceTree = ""; }; + 06FBC15D3658E1B0EBE51204B312B299 /* format_request.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = format_request.h; path = src/core/lib/http/format_request.h; sourceTree = ""; }; + 06FC5C9CF96D60C50FCD47D339C91951 /* nanopb */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = nanopb; path = nanopb.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 07070DB1C41C0C5E166E3BEF6412D271 /* ascii.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ascii.cc; path = absl/strings/ascii.cc; sourceTree = ""; }; + 07404AAA8FCDAEDBD1B62A8D0B33961B /* p256-x86_64.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "p256-x86_64.c"; path = "src/crypto/fipsmodule/ec/p256-x86_64.c"; sourceTree = ""; }; + 075A96ABA887F30E5F0B6E9694CF9973 /* ssl_key_share.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_key_share.cc; path = src/ssl/ssl_key_share.cc; sourceTree = ""; }; + 078CA41B562783942098A5FDFC7D4758 /* iam_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iam_credentials.cc; path = src/core/lib/security/credentials/iam/iam_credentials.cc; sourceTree = ""; }; + 07E20745F47D7578D58BF2B679D05551 /* GDTCCTCompressionHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCCTCompressionHelper.h; path = GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h; sourceTree = ""; }; + 07F338B20AACF5A0F8EA2DB94A749F46 /* GULKeychainUtils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULKeychainUtils.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainUtils.h; sourceTree = ""; }; + 07F8E363F9CDE38097105618252EB3F2 /* hash_policy_traits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hash_policy_traits.h; path = absl/container/internal/hash_policy_traits.h; sourceTree = ""; }; + 07FA27FC76BE4704F299E45758F66254 /* channel_arguments.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_arguments.h; path = include/grpcpp/support/channel_arguments.h; sourceTree = ""; }; + 0816F65DA43C7261008884743B248B18 /* security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = security_connector.cc; path = src/core/lib/security/security_connector/security_connector.cc; sourceTree = ""; }; + 084F54054980956409809817A9185C0D /* comparator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = comparator.cc; path = util/comparator.cc; sourceTree = ""; }; + 08673AD396301BB45B9A477046C3BF02 /* byte_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_stream.h; path = src/core/lib/transport/byte_stream.h; sourceTree = ""; }; + 087F90E9E7052CA14900AE0BD482FAB0 /* target_authority_table.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = target_authority_table.cc; path = src/core/lib/security/transport/target_authority_table.cc; sourceTree = ""; }; + 08A7440CFF031982570D78C193E1319E /* alts_shared_resource.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_shared_resource.h; path = src/core/tsi/alts/handshaker/alts_shared_resource.h; sourceTree = ""; }; + 08DA59EC052EA331486CBB173A3BE045 /* field_mask.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = field_mask.cc; path = Firestore/core/src/model/field_mask.cc; sourceTree = ""; }; + 08DCCB69B5BFD3F4C4237AF9FECE56BD /* ssl3.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl3.h; path = src/include/openssl/ssl3.h; sourceTree = ""; }; + 09254C0C340E781C6A07F83801A7CF59 /* x509_vpm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_vpm.c; path = src/crypto/x509/x509_vpm.c; sourceTree = ""; }; + 0958C4BB5B66784FC1D759AB158E5507 /* client_interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_interceptor.h; path = include/grpcpp/support/client_interceptor.h; sourceTree = ""; }; + 097F3D8E54B939EEF18E0CCD09DD902B /* cmac.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cmac.c; path = src/crypto/cmac/cmac.c; sourceTree = ""; }; + 0989B29C0D36FEAAC9D3493CAF8910D3 /* custom_tag.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = custom_tag.upb.h; path = "src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h"; sourceTree = ""; }; + 098A69B3B723EFA42D46B66467717313 /* x_x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_x509.c; path = src/crypto/x509/x_x509.c; sourceTree = ""; }; + 0997C996B2C913C986BAA2835C5C7003 /* log_writer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log_writer.h; path = db/log_writer.h; sourceTree = ""; }; + 09B7093943DEE64A8869CBCD14253515 /* FirebaseCoreDiagnostics-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "FirebaseCoreDiagnostics-Info.plist"; sourceTree = ""; }; + 09C3C84EC1B221EB2D8C3E9EC0F80F54 /* time_zone_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_posix.h; path = absl/time/internal/cctz/src/time_zone_posix.h; sourceTree = ""; }; + 09C4E2E4D95944579FECE037FDA0205E /* hide_ptr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hide_ptr.h; path = absl/base/internal/hide_ptr.h; sourceTree = ""; }; + 09D93768027DDA4A4DDD0AB09E880F42 /* status.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status.cc; path = src/cpp/util/status.cc; sourceTree = ""; }; + 0A098371DD345940D882B0DA9BDEA385 /* time_averaged_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_averaged_stats.h; path = src/core/lib/iomgr/time_averaged_stats.h; sourceTree = ""; }; + 0A09E4563D0F22CD71C65BB902A5AE40 /* fork.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fork.cc; path = src/core/lib/gprpp/fork.cc; sourceTree = ""; }; + 0A1D55B7B87A1B1071195814BD0BE75D /* alts_crypter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_crypter.cc; path = src/core/tsi/alts/frame_protector/alts_crypter.cc; sourceTree = ""; }; + 0A2A3C2D9D89DE20073978B4954BC390 /* transport_security_common.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_common.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h"; sourceTree = ""; }; + 0A38A12C2A35B6D0DC7D79C94E231260 /* grpc_ares_wrapper_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_wrapper_windows.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc; sourceTree = ""; }; + 0A9F46A999C47653013D3AD854352507 /* leveldb-library */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "leveldb-library"; path = leveldb.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0AB0046377B280A57EAB8E730B88997B /* auth_filters.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_filters.h; path = src/core/lib/security/transport/auth_filters.h; sourceTree = ""; }; + 0AC08D791B5B330D3D95E91C9CFA364A /* subchannel_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_list.h; path = src/core/ext/filters/client_channel/lb_policy/subchannel_list.h; sourceTree = ""; }; + 0ACEF7DE13EEEF21E1DEB53F06F651CC /* slice_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_utils.h; path = src/core/lib/slice/slice_utils.h; sourceTree = ""; }; + 0AD2424201A62E5DB79CA3BAB789C27E /* composite_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = composite_credentials.cc; path = src/core/lib/security/credentials/composite/composite_credentials.cc; sourceTree = ""; }; + 0AD3B8DE321285EF35E53D057CFBFCCD /* secure_endpoint.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_endpoint.cc; path = src/core/lib/security/transport/secure_endpoint.cc; sourceTree = ""; }; + 0AD63ADDEDB529F0C8041E1D2590251C /* GoogleUtilities-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleUtilities-Info.plist"; sourceTree = ""; }; + 0AD940282C7B916B8067C94A6E7F5FE3 /* security_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_context.h; path = src/core/lib/security/context/security_context.h; sourceTree = ""; }; + 0AE207E4501D5AE4978FF3C1838D1ADB /* cpu_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cpu_posix.cc; path = src/core/lib/gpr/cpu_posix.cc; sourceTree = ""; }; + 0AE2EB7309A8EB284195DA2B8C21DD29 /* outlier_detection.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = outlier_detection.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h"; sourceTree = ""; }; + 0B0188D071A2BAAE8F6F853ECC2F8A9D /* route_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h"; sourceTree = ""; }; + 0B0E5B3C7D3A20D188AD4592B218893B /* connectivity_state.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connectivity_state.h; path = src/core/lib/transport/connectivity_state.h; sourceTree = ""; }; + 0B169F793DB8E2AB80E258594851EB38 /* delocate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = delocate.h; path = src/crypto/fipsmodule/delocate.h; sourceTree = ""; }; + 0B1D0486DD55FBB1C96101E044AB31C8 /* xds_bootstrap.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_bootstrap.cc; path = src/core/ext/filters/client_channel/xds/xds_bootstrap.cc; sourceTree = ""; }; + 0B3724F90A9B693A32BA7950966A27BE /* FIRTransaction.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRTransaction.h; path = Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h; sourceTree = ""; }; + 0B448218FE1A4BEB721E3651987E28FD /* buffer_list.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = buffer_list.cc; path = src/core/lib/iomgr/buffer_list.cc; sourceTree = ""; }; + 0B55EB91303FBDC08783F84BF6997B52 /* gRPC-C++-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "gRPC-C++-umbrella.h"; sourceTree = ""; }; + 0B6C0C7BACF09F445535CE0F6C779143 /* slice_string_helpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_string_helpers.h; path = src/core/lib/slice/slice_string_helpers.h; sourceTree = ""; }; + 0B839027E3077538DD420421FD65D9F5 /* base.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = base.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c"; sourceTree = ""; }; + 0B844FFAE23F1A2B97CDDF8BF94985DB /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/pkcs8/internal.h; sourceTree = ""; }; + 0BA3A49C8625C2A50F3C9D14095B0F95 /* transport_security_common_api.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transport_security_common_api.cc; path = src/core/tsi/alts/handshaker/transport_security_common_api.cc; sourceTree = ""; }; + 0BF940D079EE26182F7A3B8DCCCB06B1 /* env.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = env.h; path = src/core/lib/gpr/env.h; sourceTree = ""; }; + 0C0E3894574E143BC94F0A74E990E5E1 /* x509rset.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509rset.c; path = src/crypto/x509/x509rset.c; sourceTree = ""; }; + 0C31DF07FC035EC1690AE609A446AF56 /* ssl_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_transport_security.h; path = src/core/tsi/ssl_transport_security.h; sourceTree = ""; }; + 0C37954346423A50630887B3B7C56C42 /* timeout_encoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timeout_encoding.h; path = src/core/lib/transport/timeout_encoding.h; sourceTree = ""; }; + 0CD52E53F168C7206030912D47CA52C7 /* sync_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_windows.h; path = include/grpc/impl/codegen/sync_windows.h; sourceTree = ""; }; + 0CF5062BDF551F333806FBA6E0156D7A /* ec_key.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ec_key.h; path = src/include/openssl/ec_key.h; sourceTree = ""; }; + 0D13BA5906839D71C59B4B8E2AFFB361 /* route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route.upb.h"; sourceTree = ""; }; + 0D1F68BB0400FBA570B96E7B5D2F60BF /* t_x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = t_x509.c; path = src/crypto/x509/t_x509.c; sourceTree = ""; }; + 0D2C92CDD47A8E0BA122DF484CFE82FF /* resolver_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_factory.h; path = src/core/ext/filters/client_channel/resolver_factory.h; sourceTree = ""; }; + 0D37CFF2BE60C28917E248625DD8CECF /* spinlock_akaros.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock_akaros.inc; path = absl/base/internal/spinlock_akaros.inc; sourceTree = ""; }; + 0D42260DA44C5886C45DC8FB23001AF7 /* mem.c */ = {isa = PBXFileReference; includeInIndex = 1; name = mem.c; path = src/crypto/mem.c; sourceTree = ""; }; + 0D4F1ED5380B12CD82F023BA482367C0 /* stream_compression.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression.h; path = src/core/lib/compression/stream_compression.h; sourceTree = ""; }; + 0D51483FE296BC1F22031B12790E17B5 /* by_file.c */ = {isa = PBXFileReference; includeInIndex = 1; name = by_file.c; path = src/crypto/x509/by_file.c; sourceTree = ""; }; + 0D5C4C195972E9AD4EB8FA8CB1C17854 /* huffsyms.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = huffsyms.h; path = src/core/ext/transport/chttp2/transport/huffsyms.h; sourceTree = ""; }; + 0D96ACD4271830E830F4D07B4B8CE1ED /* ssl_lib.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_lib.cc; path = src/ssl/ssl_lib.cc; sourceTree = ""; }; + 0DA9DE01C62DC239C2D784F936B2E920 /* charmap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = charmap.h; path = src/crypto/x509/charmap.h; sourceTree = ""; }; + 0DBFD9D17999435BA54AA000357CF297 /* table_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = table_cache.cc; path = db/table_cache.cc; sourceTree = ""; }; + 0E00718B57B591507B2647430447DA7A /* FBLPromise+Always.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Always.m"; path = "Sources/FBLPromises/FBLPromise+Always.m"; sourceTree = ""; }; + 0E4DC2D66EA32923CDD238BE04DF37C4 /* frame_data.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_data.h; path = src/core/ext/transport/chttp2/transport/frame_data.h; sourceTree = ""; }; + 0E5DC2574ECAB35140C4432C125301E9 /* varint.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = varint.cc; path = src/core/ext/transport/chttp2/transport/varint.cc; sourceTree = ""; }; + 0E7D461A18D00764A5DACAF2D942F288 /* obj_dat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = obj_dat.h; path = src/crypto/obj/obj_dat.h; sourceTree = ""; }; + 0E89C89E8C625140A3984B2D73DA107F /* FIRApp.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRApp.m; path = FirebaseCore/Sources/FIRApp.m; sourceTree = ""; }; + 0EBE87EE8373E4E916498CF6821365E2 /* iterator_wrapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iterator_wrapper.h; path = table/iterator_wrapper.h; sourceTree = ""; }; + 0EDF1E0017A317E9F67DE924DD9EB0EF /* FBLPromise+Always.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Always.h"; path = "Sources/FBLPromises/include/FBLPromise+Always.h"; sourceTree = ""; }; + 0EE17ECFCDAAEA71E331B88DE3FD1D3C /* core_codegen.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = core_codegen.cc; path = src/cpp/common/core_codegen.cc; sourceTree = ""; }; + 0EF9BAAC12070A8E68EC4747F69049BA /* alts_crypter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_crypter.h; path = src/core/tsi/alts/frame_protector/alts_crypter.h; sourceTree = ""; }; + 0EF9D1F74E34B509558AE353EBB49FDF /* cfstream_handle.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cfstream_handle.cc; path = src/core/lib/iomgr/cfstream_handle.cc; sourceTree = ""; }; + 0EFF0497467C0D05AF3D156549165A48 /* FIRTimestamp.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRTimestamp.m; path = Firestore/Source/API/FIRTimestamp.m; sourceTree = ""; }; + 0F07A817973FE0DDFD54E66F375D98C6 /* grpc_unary_call.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_unary_call.cc; path = Firestore/core/src/remote/grpc_unary_call.cc; sourceTree = ""; }; + 0F0E6F94588A9EDAB64D05FFCD82679A /* pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pool.h; path = src/include/openssl/pool.h; sourceTree = ""; }; + 0F1F0DD0EDFBD2742BB0D955A0BB9E99 /* a_print.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_print.c; path = src/crypto/asn1/a_print.c; sourceTree = ""; }; + 0F1F3CF8E88DD83D2DBE7E06C9DC76EB /* pollset.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset.h; path = src/core/lib/iomgr/pollset.h; sourceTree = ""; }; + 0F31BD1CE7C0CE2046B3695252F4CED7 /* env_posix_test_helper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = env_posix_test_helper.h; path = util/env_posix_test_helper.h; sourceTree = ""; }; + 0F50FB8D47C280191AF4BDC5ACBDC7E0 /* rand.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rand.h; path = src/include/openssl/rand.h; sourceTree = ""; }; + 0F5ECBF97CAE261EAC200C6D49C4F08A /* cert.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cert.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c"; sourceTree = ""; }; + 0F8711C6D60C208846D4B38B8E70DEC6 /* GULLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULLogger.h; path = GoogleUtilities/Logger/Public/GoogleUtilities/GULLogger.h; sourceTree = ""; }; + 0F92C9CD287154E896E3E8DC83B0EC56 /* FBLPromise+Timeout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Timeout.m"; path = "Sources/FBLPromises/FBLPromise+Timeout.m"; sourceTree = ""; }; + 0FAA93E4A8212CC7532F3B1A494F11AE /* a_octet.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_octet.c; path = src/crypto/asn1/a_octet.c; sourceTree = ""; }; + 0FB7500FDD218447E2A8951E79D047ED /* host_port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = host_port.h; path = src/core/lib/gprpp/host_port.h; sourceTree = ""; }; + 0FE17F5F00A1C87DA3B687F8CD8DE38F /* metadata_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata_map.h; path = include/grpcpp/impl/codegen/metadata_map.h; sourceTree = ""; }; + 0FE48DF0A2F4C90F906E56124F2D5A83 /* GoogleDataTransport.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleDataTransport.debug.xcconfig; sourceTree = ""; }; + 0FEA1F6131B8B62CF6F75405F9197BA3 /* FBLPromiseError.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FBLPromiseError.m; path = Sources/FBLPromises/FBLPromiseError.m; sourceTree = ""; }; + 1001BFF8E5F7589AF3989A2E15EC4978 /* log_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_windows.cc; path = src/core/lib/gpr/log_windows.cc; sourceTree = ""; }; + 1004B2FF809ADB5136C6207146F8CF05 /* ssl_session.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_session.h; path = src/core/tsi/ssl/session_cache/ssl_session.h; sourceTree = ""; }; + 109216868B5292A6CC5C2D7CB5C1A515 /* FBLPromise+Race.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Race.h"; path = "Sources/FBLPromises/include/FBLPromise+Race.h"; sourceTree = ""; }; + 10D0D92283FDFA365217D785982D524A /* alts_tsi_utils.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_tsi_utils.cc; path = src/core/tsi/alts/handshaker/alts_tsi_utils.cc; sourceTree = ""; }; + 10D5C776E0A1441020B19E29959E688C /* plugin_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = plugin_credentials.h; path = src/core/lib/security/credentials/plugin/plugin_credentials.h; sourceTree = ""; }; + 10E7F325F2BC11470A372F3A297C842F /* patch_mutation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = patch_mutation.cc; path = Firestore/core/src/model/patch_mutation.cc; sourceTree = ""; }; + 10F4E2752364C3220503CC5F3C48DF8A /* protocol.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = protocol.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h"; sourceTree = ""; }; + 10F7D921AD7838C910160A14EC5F5641 /* sysinfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sysinfo.h; path = absl/base/internal/sysinfo.h; sourceTree = ""; }; + 1107EFDD6A3279A099DDB015C5AB4A4F /* gsec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gsec.h; path = src/core/tsi/alts/crypt/gsec.h; sourceTree = ""; }; + 1125D712F1F7D8DE064C2CF7D8EC1FEE /* bin_encoder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bin_encoder.cc; path = src/core/ext/transport/chttp2/transport/bin_encoder.cc; sourceTree = ""; }; + 112C1E3B3A05AE0271459556AC54B570 /* address.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = address.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h"; sourceTree = ""; }; + 113438DA4A8791BAC897914815DC34DC /* propagation_bits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = propagation_bits.h; path = include/grpc/impl/codegen/propagation_bits.h; sourceTree = ""; }; + 11493E67BC46E222427792FAAF39AFF8 /* altscontext.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = altscontext.upb.c; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c"; sourceTree = ""; }; + 117A19181C15DEAF6F81B5490A41D7C2 /* x_pubkey.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_pubkey.c; path = src/crypto/x509/x_pubkey.c; sourceTree = ""; }; + 119566C11E2CC6F2C68CF280E11BDC22 /* http_server_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http_server_filter.cc; path = src/core/ext/filters/http/server/http_server_filter.cc; sourceTree = ""; }; + 11AB1B2817C84F8D1973E8D153CFBC4B /* const_amd64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = const_amd64.h; path = src/ssl/test/runner/curve25519/const_amd64.h; sourceTree = ""; }; + 11E51A66F48CAC2C668DB4ED3F6F3D6C /* block.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = block.h; path = table/block.h; sourceTree = ""; }; + 11F1FA22BF5D93DBADFE5B1D6E370EE9 /* grpcpp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpcpp.h; path = include/grpcpp/grpcpp.h; sourceTree = ""; }; + 120A7E8EDD868C0D9CAD56A643E7C869 /* byte_buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer.h; path = include/grpc/impl/codegen/byte_buffer.h; sourceTree = ""; }; + 121195A1992721C717452598998B4349 /* sockaddr_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_windows.h; path = src/core/lib/iomgr/sockaddr_windows.h; sourceTree = ""; }; + 1224124633512735774FB07FFB34CE4D /* threadpool.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = threadpool.cc; path = src/core/lib/iomgr/executor/threadpool.cc; sourceTree = ""; }; + 1225A64673D20C6A4389387B6DE4CB4C /* atm.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm.h; path = include/grpc/support/atm.h; sourceTree = ""; }; + 1254352DE4846BFEB37C5C536523E0ED /* grpclb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h; sourceTree = ""; }; + 12581C1A84F6E01443F65CECD59698AE /* FBLPromise+Delay.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Delay.m"; path = "Sources/FBLPromises/FBLPromise+Delay.m"; sourceTree = ""; }; + 1268210F36578BAF3DCD8A25A0E55165 /* orca_load_report.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = orca_load_report.upb.c; path = "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c"; sourceTree = ""; }; + 12709ACA310AE10CD81CEB0D221D27D4 /* direct_mmap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = direct_mmap.h; path = absl/base/internal/direct_mmap.h; sourceTree = ""; }; + 128BA0920634D6FFD02EFBFEB26D37FB /* alts_record_protocol_crypter_common.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_record_protocol_crypter_common.cc; path = src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc; sourceTree = ""; }; + 1298A66348AA9C6483630CDEF02EF11B /* sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync.h; path = include/grpcpp/impl/codegen/sync.h; sourceTree = ""; }; + 12E88198C7188136050F950CCB88F22B /* key_field_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = key_field_filter.cc; path = Firestore/core/src/core/key_field_filter.cc; sourceTree = ""; }; + 12F0D535527BE5219CF713151D2E6E28 /* status_conversion.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status_conversion.cc; path = src/core/lib/transport/status_conversion.cc; sourceTree = ""; }; + 1319E85F66E15ADBAF6C9ED31849EA68 /* grpc_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_security.h; path = include/grpc/grpc_security.h; sourceTree = ""; }; + 133E5C2929C7B4D3823137AB4244A9BD /* config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = config.h; path = absl/base/config.h; sourceTree = ""; }; + 1356E5C2283E0942CFDFBE52BA0942DC /* chttp2_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_server.h; path = src/core/ext/transport/chttp2/server/chttp2_server.h; sourceTree = ""; }; + 1365595CD3433AA406454C412F9B6F48 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + 136878A10D9ED347E2C7570C52ECAA3E /* raw_hash_set.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = raw_hash_set.h; path = absl/container/internal/raw_hash_set.h; sourceTree = ""; }; + 1378E88D1012BCD79A53F91672210C39 /* e_rc4.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_rc4.c; path = src/crypto/cipher_extra/e_rc4.c; sourceTree = ""; }; + 13A7018941419937399FAD63543E6F1F /* alts_counter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_counter.cc; path = src/core/tsi/alts/frame_protector/alts_counter.cc; sourceTree = ""; }; + 13A71F4B2C9BAD681CB1B1B737BC68BB /* FBLPromise+Wrap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Wrap.h"; path = "Sources/FBLPromises/include/FBLPromise+Wrap.h"; sourceTree = ""; }; + 13D524A4B27B0C18EFF8A6A2A0928068 /* json_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json_util.h; path = src/core/lib/security/util/json_util.h; sourceTree = ""; }; + 13F469255EB9E102CEA1699F96F7D4EA /* FIRFirebaseUserAgent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRFirebaseUserAgent.m; path = FirebaseCore/Sources/FIRFirebaseUserAgent.m; sourceTree = ""; }; + 13F7D04CE543FC13DE1CE37822055B13 /* message.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = message.cc; path = Firestore/core/src/nanopb/message.cc; sourceTree = ""; }; + 14338412315B7FC7515BCB1B997CAE6E /* channel_stack_type.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_stack_type.cc; path = src/core/lib/surface/channel_stack_type.cc; sourceTree = ""; }; + 143A2E98EA9EAD3D307032D159B0D048 /* cmp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cmp.c; path = src/crypto/fipsmodule/bn/cmp.c; sourceTree = ""; }; + 1450166D6224B9D3744B09172A7EBC19 /* frame_window_update.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_window_update.h; path = src/core/ext/transport/chttp2/transport/frame_window_update.h; sourceTree = ""; }; + 145112654FF4FDFC7090F654F9BD1A78 /* workaround_cronet_compression_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = workaround_cronet_compression_filter.h; path = src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h; sourceTree = ""; }; + 146248CAC22E5FC977650DF1B68DA60E /* service_type.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = service_type.h; path = include/grpcpp/impl/codegen/service_type.h; sourceTree = ""; }; + 1477923DA3F1B02293B4F16364561C13 /* json_token.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = json_token.cc; path = src/core/lib/security/credentials/jwt/json_token.cc; sourceTree = ""; }; + 148BBF1E31DB4AF7565E67B963BA0029 /* socket_utils_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_utils_posix.h; path = src/core/lib/iomgr/socket_utils_posix.h; sourceTree = ""; }; + 14B40745DACF97BCF26AF8FBF36B9130 /* buf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = buf.h; path = src/include/openssl/buf.h; sourceTree = ""; }; + 14DC4924C9EFB233AC319AC2FD5474F0 /* GDTCOREvent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREvent.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREvent.h; sourceTree = ""; }; + 14E4A19A16AF63A3B22B7B25B6D4B1A0 /* config_source.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = config_source.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h"; sourceTree = ""; }; + 150114D1218D95652322D51EAA164063 /* channel_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_filter.h; path = src/cpp/common/channel_filter.h; sourceTree = ""; }; + 150421C9742BB4F0B119B06D89B0E8E7 /* call_hook.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_hook.h; path = include/grpcpp/impl/codegen/call_hook.h; sourceTree = ""; }; + 150E9E06EA4173D1E8E4CC4E52E93959 /* e_chacha20poly1305.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_chacha20poly1305.c; path = src/crypto/cipher_extra/e_chacha20poly1305.c; sourceTree = ""; }; + 1511D3462BCF17289DD619259C029C9E /* mutation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutation.cc; path = Firestore/core/src/model/mutation.cc; sourceTree = ""; }; + 1519BB64EF3C991F8EDACE43C2758BCC /* channel_stack.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_stack.cc; path = src/core/lib/channel/channel_stack.cc; sourceTree = ""; }; + 15379C1083DD29AB800A7782C38A7AA9 /* channel_connectivity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_connectivity.cc; path = src/core/ext/filters/client_channel/channel_connectivity.cc; sourceTree = ""; }; + 159E496A001CA8B05902D1308137E6B8 /* iocp_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iocp_windows.cc; path = src/core/lib/iomgr/iocp_windows.cc; sourceTree = ""; }; + 15CB911B4ACF1165984AC259F22DCD40 /* GDTCORRegistrar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORRegistrar.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORRegistrar.m; sourceTree = ""; }; + 15E8A4BAE02D2BC08BD3DD07414E69E7 /* tcp_server_utils_posix_ifaddrs.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_utils_posix_ifaddrs.cc; path = src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc; sourceTree = ""; }; + 15FB5CF44F4EE0EF13E7D237ACDE94CB /* FirebaseCore-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FirebaseCore-dummy.m"; sourceTree = ""; }; + 15FDC3CBDA967B9D461007ACE3C673B3 /* log.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log.cc; path = src/core/lib/gpr/log.cc; sourceTree = ""; }; + 1622DC85A779012D11AEAD69D528003F /* fake_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_security_connector.h; path = src/core/lib/security/security_connector/fake/fake_security_connector.h; sourceTree = ""; }; + 162F6E1D07F1240CF5DF466527791599 /* v3_ocsp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_ocsp.c; path = src/crypto/x509v3/v3_ocsp.c; sourceTree = ""; }; + 166601B1F74E89BE8E2BB88DECF1CF50 /* conf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = conf.c; path = src/crypto/conf/conf.c; sourceTree = ""; }; + 1675E677767D304323D71A6AD52A79F0 /* FIRAppCheckTokenResultInterop.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppCheckTokenResultInterop.h; path = FirebaseAppCheck/Sources/Interop/FIRAppCheckTokenResultInterop.h; sourceTree = ""; }; + 167BD08858D39E8D6BA9D2CEAE9B3F41 /* server_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_credentials.cc; path = src/cpp/server/server_credentials.cc; sourceTree = ""; }; + 16A05B65E0D122718E9BA48EDC4EE798 /* retry_throttle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = retry_throttle.h; path = src/core/ext/filters/client_channel/retry_throttle.h; sourceTree = ""; }; + 16CE1112F5DA7855F8D9CAD46BDFF5CC /* frame_handler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_handler.h; path = src/core/tsi/alts/frame_protector/frame_handler.h; sourceTree = ""; }; + 16D9E7FDC0048458C43611D963313690 /* invoke.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = invoke.h; path = absl/base/internal/invoke.h; sourceTree = ""; }; + 16E06494239BD92431415BB216E3906D /* Pods-SaraAttended-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SaraAttended-umbrella.h"; sourceTree = ""; }; + 16EB7C7D422AC2646E0FBC639CB66C91 /* pid_controller.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pid_controller.h; path = src/core/lib/transport/pid_controller.h; sourceTree = ""; }; + 16FFF8B86C102F7D8F8B82D75E0F6552 /* local_subchannel_pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_subchannel_pool.h; path = src/core/ext/filters/client_channel/local_subchannel_pool.h; sourceTree = ""; }; + 170F763C40ACE64E7ED54F760E881781 /* GoogleDataTransport.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = GoogleDataTransport.modulemap; sourceTree = ""; }; + 1723A5C0C342EAA87D9AE85B9140E563 /* tcp_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_windows.h; path = src/core/lib/iomgr/tcp_windows.h; sourceTree = ""; }; + 176700011F13BBF1CBB85CB405F3D6BC /* json_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = json_util.cc; path = src/core/lib/security/util/json_util.cc; sourceTree = ""; }; + 17723983F89AC7CB351CA15DE6428311 /* v3_info.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_info.c; path = src/crypto/x509v3/v3_info.c; sourceTree = ""; }; + 17936BFECBE0CC394E15286D54BFA158 /* bad_optional_access.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bad_optional_access.cc; path = absl/types/bad_optional_access.cc; sourceTree = ""; }; + 17B8745CD6EFDCB192C7E5E84BD48C43 /* reference_set.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = reference_set.cc; path = Firestore/core/src/local/reference_set.cc; sourceTree = ""; }; + 17B92FC4A0648040FE501D4BE21C2471 /* p_rsa_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_rsa_asn1.c; path = src/crypto/evp/p_rsa_asn1.c; sourceTree = ""; }; + 17C2FBD16FAA0916679B9E24DC144CF4 /* pollset_set_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set_custom.h; path = src/core/lib/iomgr/pollset_set_custom.h; sourceTree = ""; }; + 17CEF00AA004CFD393B09091B419187F /* server_callback.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_callback.h; path = include/grpcpp/support/server_callback.h; sourceTree = ""; }; + 17FCD7FD56BC613FCE058FA35C6C15EC /* chacha.c */ = {isa = PBXFileReference; includeInIndex = 1; name = chacha.c; path = src/crypto/chacha/chacha.c; sourceTree = ""; }; + 180D252F816C445EFE273EDA89501423 /* match.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = match.h; path = absl/strings/match.h; sourceTree = ""; }; + 181FF250BA35C4FEF7D372ED4506EAE6 /* time_zone.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone.h; path = absl/time/internal/cctz/include/cctz/time_zone.h; sourceTree = ""; }; + 182541468796261FF9A289D16ADAE3B0 /* any.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = any.upb.h; path = "src/core/ext/upb-generated/google/protobuf/any.upb.h"; sourceTree = ""; }; + 18484767EE110FAE5016F0B898172E1A /* leveldb_mutation_queue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_mutation_queue.cc; path = Firestore/core/src/local/leveldb_mutation_queue.cc; sourceTree = ""; }; + 18519B81C338C5096FC7F8AB9AF57FC5 /* slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice.h; path = include/grpc/slice.h; sourceTree = ""; }; + 18D7CBF791C0ACD7E4EB4E6867A567F4 /* gRPC-C++-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "gRPC-C++-prefix.pch"; sourceTree = ""; }; + 18E1B8B1DC940C40B0291001AAFFE1BC /* alts_counter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_counter.h; path = src/core/tsi/alts/frame_protector/alts_counter.h; sourceTree = ""; }; + 18E2773333D37D79898DCF455DF4463D /* lb_policy_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy_registry.h; path = src/core/ext/filters/client_channel/lb_policy_registry.h; sourceTree = ""; }; + 18ED08173DA751A2F0711D475B0A239E /* FIRFirestoreSource.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFirestoreSource.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h; sourceTree = ""; }; + 18F1E9F059C0A110CC44A15DF13F9E48 /* alts_grpc_integrity_only_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_integrity_only_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h; sourceTree = ""; }; + 18FB9E0078686EBEFAE54BEA6788DD49 /* bundle_reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bundle_reader.cc; path = Firestore/core/src/bundle/bundle_reader.cc; sourceTree = ""; }; + 18FCC60BBDEE8D35E75391A4ACD3E958 /* base64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/include/openssl/base64.h; sourceTree = ""; }; + 1911113E0FBF13CFF9132E5FF7685228 /* gRPC-C++ */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "gRPC-C++"; path = grpcpp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1911C0C740F0172D7C5A5A2E4B6B8C9E /* bad_variant_access.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bad_variant_access.h; path = absl/types/bad_variant_access.h; sourceTree = ""; }; + 1913DCB78682B6D5A6D7987739E4C702 /* alloc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alloc.h; path = src/core/lib/gpr/alloc.h; sourceTree = ""; }; + 192682220D65CC123ECC31B83806052A /* stats_data.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stats_data.h; path = src/core/lib/debug/stats_data.h; sourceTree = ""; }; + 192D013E4F329EC347D8368FE5F558F0 /* secure_endpoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = secure_endpoint.h; path = src/core/lib/security/transport/secure_endpoint.h; sourceTree = ""; }; + 193505E21D1C48A8C5F7C950CF022AD0 /* pollset_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_uv.cc; path = src/core/lib/iomgr/pollset_uv.cc; sourceTree = ""; }; + 1935BE7E2932D2AEAF282514A83BDC6B /* annotations.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = annotations.nanopb.cc; path = Firestore/Protos/nanopb/google/api/annotations.nanopb.cc; sourceTree = ""; }; + 1941F9303703D6FA0C77BFA6EF6E5661 /* pkcs8_x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pkcs8_x509.c; path = src/crypto/pkcs8/pkcs8_x509.c; sourceTree = ""; }; + 194809C76D8E87B035E30CEE09C01E08 /* listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h"; sourceTree = ""; }; + 195AEE4ADE9068B38ED51FA939D87C63 /* obj.c */ = {isa = PBXFileReference; includeInIndex = 1; name = obj.c; path = src/crypto/obj/obj.c; sourceTree = ""; }; + 1971FDEC917369CE223266C795BB5777 /* create_thread_identity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_thread_identity.h; path = absl/synchronization/internal/create_thread_identity.h; sourceTree = ""; }; + 199C2D16BC8EFB980FAE08F606AB3076 /* cpu.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cpu.h; path = src/include/openssl/cpu.h; sourceTree = ""; }; + 19D8D86A8C9FACA0CED9A2EE17D195DE /* exponential_backoff.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = exponential_backoff.cc; path = Firestore/core/src/remote/exponential_backoff.cc; sourceTree = ""; }; + 19DDEFE91BF33977306BFC06B66E0BD8 /* time_zone_lookup.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_lookup.cc; path = absl/time/internal/cctz/src/time_zone_lookup.cc; sourceTree = ""; }; + 19DE7AEA92884D5BCBC9C064503A29D4 /* http_connect_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_connect_handshaker.h; path = src/core/ext/filters/client_channel/http_connect_handshaker.h; sourceTree = ""; }; + 19DFA2FEF180F5A3402EE13F91773035 /* json_token.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json_token.h; path = src/core/lib/security/credentials/jwt/json_token.h; sourceTree = ""; }; + 19E856387C9916C6CB8F132F974B43AD /* struct.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = struct.upb.h; path = "src/core/ext/upb-generated/google/protobuf/struct.upb.h"; sourceTree = ""; }; + 19F8F9E30A7E6292F27C8FEC8E88F9AA /* client_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel.h; path = src/core/ext/filters/client_channel/client_channel.h; sourceTree = ""; }; + 1A1A42CF7B62E83F9CAB827668EC644B /* api_trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = api_trace.h; path = src/core/lib/surface/api_trace.h; sourceTree = ""; }; + 1A25A10DC894BE9B6525486EC902E13C /* ev_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ev_posix.cc; path = src/core/lib/iomgr/ev_posix.cc; sourceTree = ""; }; + 1A3E2B2F82194B0FC93C4B99EB72EDEC /* error_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = error_apple.mm; path = Firestore/core/src/util/error_apple.mm; sourceTree = ""; }; + 1A4AF395481273F9A272ABA5E5A484BC /* query_listener_registration.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query_listener_registration.cc; path = Firestore/core/src/api/query_listener_registration.cc; sourceTree = ""; }; + 1A6629A5097D67C07858B93A17D9373E /* dsa.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dsa.h; path = src/include/openssl/dsa.h; sourceTree = ""; }; + 1A6700B6D0B90896DFB60A6850407AA6 /* chttp2_transport.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = chttp2_transport.cc; path = src/core/ext/transport/chttp2/transport/chttp2_transport.cc; sourceTree = ""; }; + 1A67E4874AE7708C0705896C235FAD59 /* socket_utils_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_utils_uv.cc; path = src/core/lib/iomgr/socket_utils_uv.cc; sourceTree = ""; }; + 1A6D36D6C209266D5ECC3572D41AA7E8 /* database_id.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = database_id.cc; path = Firestore/core/src/model/database_id.cc; sourceTree = ""; }; + 1A6F7D1BC95FD2032D74AA5AEB6D78BC /* gRPC-C++.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "gRPC-C++.debug.xcconfig"; sourceTree = ""; }; + 1A9167BEC72FAF81F898D49F8EDB5801 /* authority.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = authority.h; path = src/core/ext/transport/chttp2/client/authority.h; sourceTree = ""; }; + 1AB8D181D31620F5CD2033EFCE4388DE /* format_request.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = format_request.cc; path = src/core/lib/http/format_request.cc; sourceTree = ""; }; + 1AC1BE10FC1DF8BCDE29E6F5C12E10D8 /* pollset.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset.h; path = src/core/lib/iomgr/pollset.h; sourceTree = ""; }; + 1AF111EA40541007B06CA1C98A71FB97 /* mutation.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutation.nanopb.cc; path = Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc; sourceTree = ""; }; + 1B16F4B125D18F293A44B3AB7E50F0FE /* gRPC-Core.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "gRPC-Core.debug.xcconfig"; sourceTree = ""; }; + 1B6031C0254744F53D1F7DA8C0FB2D3E /* slice_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_internal.h; path = src/core/lib/slice/slice_internal.h; sourceTree = ""; }; + 1B610AB95754760FA8B42D3893F00921 /* log.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log.h; path = include/grpc/support/log.h; sourceTree = ""; }; + 1B7D1949E7E90565475A743D32EE903B /* crypto.c */ = {isa = PBXFileReference; includeInIndex = 1; name = crypto.c; path = src/crypto/crypto.c; sourceTree = ""; }; + 1B9B58DA180AA609B576969359D3334E /* pcy_data.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_data.c; path = src/crypto/x509v3/pcy_data.c; sourceTree = ""; }; + 1BAF187282C131CA4DC09077C4F5F31F /* retry_throttle.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = retry_throttle.cc; path = src/core/ext/filters/client_channel/retry_throttle.cc; sourceTree = ""; }; + 1BC28FABF554ADA856CE3883B7D1C357 /* chttp2_plugin.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = chttp2_plugin.cc; path = src/core/ext/transport/chttp2/transport/chttp2_plugin.cc; sourceTree = ""; }; + 1BD99431D13A0200B9E86F6240B59422 /* FIRDependency.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDependency.h; path = FirebaseCore/Sources/Private/FIRDependency.h; sourceTree = ""; }; + 1BE071EE977CA5001F9EC22ECDEF9AF8 /* firestore.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firestore.cc; path = Firestore/core/src/api/firestore.cc; sourceTree = ""; }; + 1BE7D11636B0B07F20A9BCCF4B580D3C /* eds.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = eds.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c"; sourceTree = ""; }; + 1BF261CEDF36ED26D467AD508DD5853E /* rds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/rds.upb.h"; sourceTree = ""; }; + 1C393122811C651E2FBA2115CA45DEFD /* completion_queue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = completion_queue.cc; path = src/core/lib/surface/completion_queue.cc; sourceTree = ""; }; + 1C6D9EBC7DF5EA2DE5447F4058FF2D27 /* validate_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = validate_metadata.cc; path = src/core/lib/surface/validate_metadata.cc; sourceTree = ""; }; + 1C7C417D34B0A875BF3E27964F1D8855 /* wakeup_fd_eventfd.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wakeup_fd_eventfd.cc; path = src/core/lib/iomgr/wakeup_fd_eventfd.cc; sourceTree = ""; }; + 1C93B1A77D72BBDB26A32F49BDB8B4FB /* ber.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ber.c; path = src/crypto/bytestring/ber.c; sourceTree = ""; }; + 1C9785376AA160E8974DC735DAF3C653 /* secure_server_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = secure_server_credentials.h; path = src/cpp/server/secure_server_credentials.h; sourceTree = ""; }; + 1CB284BD2ACEE8F0D301A63F8B46C27C /* alts_tsi_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_utils.h; path = src/core/tsi/alts/handshaker/alts_tsi_utils.h; sourceTree = ""; }; + 1CBF28415CBDA07BC4CE1F5A5A5649B5 /* p256-x86_64-table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "p256-x86_64-table.h"; path = "src/crypto/fipsmodule/ec/p256-x86_64-table.h"; sourceTree = ""; }; + 1CEC26D7E014356769FD7BF103D1FE49 /* security_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = security_context.cc; path = src/core/lib/security/context/security_context.cc; sourceTree = ""; }; + 1D0606A8EF843A5D0FB70E85489D5E25 /* variant.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = variant.h; path = absl/types/internal/variant.h; sourceTree = ""; }; + 1D249314DA46EA0731824E09C8639B82 /* p_x25519_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_x25519_asn1.c; path = src/crypto/evp/p_x25519_asn1.c; sourceTree = ""; }; + 1D5898EA9800D5CEA0298805255D87E6 /* credentials_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = credentials_cc.cc; path = src/cpp/client/credentials_cc.cc; sourceTree = ""; }; + 1D5B741F0EBFBD9401F861844A3FD767 /* PromisesObjC-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromisesObjC-dummy.m"; sourceTree = ""; }; + 1D7082806BB3DD63DD675328C5BDF865 /* delegating_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = delegating_channel.h; path = include/grpcpp/impl/codegen/delegating_channel.h; sourceTree = ""; }; + 1D7D38F399F8DC28719939770D74A131 /* time_zone_libc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_libc.cc; path = absl/time/internal/cctz/src/time_zone_libc.cc; sourceTree = ""; }; + 1D86999284262D6577D93238FE6260A5 /* cpu-arm-linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "cpu-arm-linux.h"; path = "src/crypto/cpu-arm-linux.h"; sourceTree = ""; }; + 1DAB72662E83D1D1061C16A3EAA3FB92 /* ecdsa.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ecdsa.c; path = src/crypto/fipsmodule/ecdsa/ecdsa.c; sourceTree = ""; }; + 1DACF790A72B28E83031D36EB45ED237 /* channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel.h; path = include/grpcpp/channel.h; sourceTree = ""; }; + 1DAD54AEFF45B76E2F97203CD59A4543 /* backoff.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backoff.h; path = src/core/lib/backoff/backoff.h; sourceTree = ""; }; + 1DC7DB6E71A31FD235556787BA8ADF4E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 1DCCFAA1252D3422682CC0943DE5E997 /* workaround_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = workaround_list.h; path = include/grpc/support/workaround_list.h; sourceTree = ""; }; + 1DD342F2761D43D340F2DE16B63412B8 /* mutex.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mutex.h; path = absl/synchronization/mutex.h; sourceTree = ""; }; + 1DE370C5B821DB68A6A3C39CCE0A21DC /* leveldb-library-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "leveldb-library-Info.plist"; sourceTree = ""; }; + 1DF53804F4862E20DA49C335AE25EC7E /* timer_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_custom.h; path = src/core/lib/iomgr/timer_custom.h; sourceTree = ""; }; + 1E255EDEAAE074BC8A3A7DF9AFA841DD /* FIROptions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIROptions.h; path = FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h; sourceTree = ""; }; + 1E2FC67CFFD88121716465842FA877D2 /* lb_policy_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy_factory.h; path = src/core/ext/filters/client_channel/lb_policy_factory.h; sourceTree = ""; }; + 1E351D23705876BAF11CE8239D710C4B /* time_support.c */ = {isa = PBXFileReference; includeInIndex = 1; name = time_support.c; path = src/crypto/asn1/time_support.c; sourceTree = ""; }; + 1E38A0446DD4881BBB0CB0BA9BA3F096 /* notification.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = notification.cc; path = absl/synchronization/notification.cc; sourceTree = ""; }; + 1E87B6AA70EF3C7303B6A13AE63EFD35 /* fips_shared_support.c */ = {isa = PBXFileReference; includeInIndex = 1; name = fips_shared_support.c; path = src/crypto/fipsmodule/fips_shared_support.c; sourceTree = ""; }; + 1E91F82DCB0AECFDF7CC2719334D1909 /* endpoint_cfstream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_cfstream.h; path = src/core/lib/iomgr/endpoint_cfstream.h; sourceTree = ""; }; + 1E954268BF933F68C3F91B0409388140 /* blinding.c */ = {isa = PBXFileReference; includeInIndex = 1; name = blinding.c; path = src/crypto/fipsmodule/rsa/blinding.c; sourceTree = ""; }; + 1E9B567C2825D7F2A284331368876C7B /* httpcli_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = httpcli_security_connector.cc; path = src/core/lib/http/httpcli_security_connector.cc; sourceTree = ""; }; + 1EA4629029ECB44825A5A15440A4E2E8 /* str_split_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_split_internal.h; path = absl/strings/internal/str_split_internal.h; sourceTree = ""; }; + 1EB4F4919F03F6077BED09C670254F39 /* table.c */ = {isa = PBXFileReference; includeInIndex = 1; name = table.c; path = third_party/upb/upb/table.c; sourceTree = ""; }; + 1ECAD5E8D9652BC9BDD83380CB553C88 /* udp_listener_config.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = udp_listener_config.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h"; sourceTree = ""; }; + 1ECD6207B8EAA5C8AAC66053669DF5C6 /* zone_info_source.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = zone_info_source.h; path = absl/time/internal/cctz/include/cctz/zone_info_source.h; sourceTree = ""; }; + 1EF0ABEE4EA5576EC97035233DFE65B3 /* server_credentials_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_credentials_impl.h; path = include/grpcpp/security/server_credentials_impl.h; sourceTree = ""; }; + 1F06B79D5DBAB6A2F2D6769F942634F5 /* insecure_server_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = insecure_server_credentials.cc; path = src/cpp/server/insecure_server_credentials.cc; sourceTree = ""; }; + 1F19ABCC9A33949E6AA707BE381643F4 /* exponential_biased.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = exponential_biased.h; path = absl/base/internal/exponential_biased.h; sourceTree = ""; }; + 1F37AE6D86B05253605220AAA2B9D2AC /* string.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string.cc; path = src/core/lib/gpr/string.cc; sourceTree = ""; }; + 1F647CDDC588AADF1E6A54C30B1AC6E0 /* alts_grpc_privacy_integrity_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_privacy_integrity_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h; sourceTree = ""; }; + 1F6828B80F8240092CA6683D028CD7FC /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/bio/internal.h; sourceTree = ""; }; + 1F9342B69F768D5869D7C73F050EC77F /* e_os2.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = e_os2.h; path = src/include/openssl/e_os2.h; sourceTree = ""; }; + 1F9A065C506BE5D919864CF52037C4BE /* GULURLSessionDataResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULURLSessionDataResponse.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULURLSessionDataResponse.h; sourceTree = ""; }; + 1FA9B0F489506D839E54613F8FF2A6A2 /* evp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = evp.h; path = src/include/openssl/evp.h; sourceTree = ""; }; + 1FB2C64DDF5C1DD923B787E0EF664418 /* alts_zero_copy_grpc_protector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_zero_copy_grpc_protector.cc; path = src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc; sourceTree = ""; }; + 1FC5AA96F90F0E7EAE181267AF9455AE /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/sha/internal.h; sourceTree = ""; }; + 1FCCD3D39348BDC0800EE0E7EFCE5259 /* firebase_metadata_provider_noop.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firebase_metadata_provider_noop.cc; path = Firestore/core/src/remote/firebase_metadata_provider_noop.cc; sourceTree = ""; }; + 1FEB0462FEAE9D1EA18E047F38534936 /* p_ec.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_ec.c; path = src/crypto/evp/p_ec.c; sourceTree = ""; }; + 1FEDC036B519DEEE76ACE73F77F058B6 /* socket_mutator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_mutator.cc; path = src/core/lib/iomgr/socket_mutator.cc; sourceTree = ""; }; + 1FF01779B0EF8214DF6D4B5F0C4166F0 /* eventmanager_libuv.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = eventmanager_libuv.h; path = src/core/lib/iomgr/poller/eventmanager_libuv.h; sourceTree = ""; }; + 204F44207D81AAC775BF1E202108F385 /* context_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = context_list.h; path = src/core/ext/transport/chttp2/transport/context_list.h; sourceTree = ""; }; + 205771B2FC8BCC1AB7D4AB45107369BD /* GULHeartbeatDateStorable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULHeartbeatDateStorable.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorable.h; sourceTree = ""; }; + 205BF93224B19AE2B0B15B8FB06658AE /* GDTCCTUploadOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCCTUploadOperation.m; path = GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m; sourceTree = ""; }; + 20697784672ED522459F591E8032AACF /* frame_ping.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_ping.h; path = src/core/ext/transport/chttp2/transport/frame_ping.h; sourceTree = ""; }; + 20923075D20F34C7D0FDCCC63697DA86 /* FIRDocumentChange.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRDocumentChange.mm; path = Firestore/Source/API/FIRDocumentChange.mm; sourceTree = ""; }; + 20923FB22CEB592E2B44256F10307779 /* path.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = path.cc; path = Firestore/core/src/util/path.cc; sourceTree = ""; }; + 20B273A2295F73FF06123CBA6D8ACA13 /* ctr.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ctr.c; path = src/crypto/fipsmodule/modes/ctr.c; sourceTree = ""; }; + 20BE36670AF41FEAC19EF9286FC4AD7A /* local_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_transport_security.h; path = src/core/tsi/local_transport_security.h; sourceTree = ""; }; + 20C5D36C79D1BB20457FF8BB2482A275 /* transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport.h; path = src/core/lib/transport/transport.h; sourceTree = ""; }; + 20DFAB3F1AC251213E4C33910664847F /* alloc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alloc.h; path = include/grpc/support/alloc.h; sourceTree = ""; }; + 20FE2D07EA808054F93271C756735D8D /* ssl_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_credentials.h; path = src/core/lib/security/credentials/ssl/ssl_credentials.h; sourceTree = ""; }; + 211C1F617812FCB36039E168586EC6F9 /* compression_args.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = compression_args.cc; path = src/core/lib/compression/compression_args.cc; sourceTree = ""; }; + 2155A84DEC3E9F9E032992F56BFAECCC /* asn1t.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = asn1t.h; path = src/include/openssl/asn1t.h; sourceTree = ""; }; + 215873535BAAC9EB2C2E3E28B1C42929 /* leveldb_persistence.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_persistence.cc; path = Firestore/core/src/local/leveldb_persistence.cc; sourceTree = ""; }; + 217E26ED82FF7D4D3EDF083AD0FEECDD /* FBLPromise+Retry.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Retry.m"; path = "Sources/FBLPromises/FBLPromise+Retry.m"; sourceTree = ""; }; + 21C3F2A96C0E4AA7B2B3DD91214C7024 /* env_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = env_linux.cc; path = src/core/lib/gpr/env_linux.cc; sourceTree = ""; }; + 21DFF18CD05CDE57222DF9BACEF5B5D0 /* call_details.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = call_details.cc; path = src/core/lib/surface/call_details.cc; sourceTree = ""; }; + 21E538E957EF219ADA6BE4D48CB7E22F /* pid_controller.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pid_controller.cc; path = src/core/lib/transport/pid_controller.cc; sourceTree = ""; }; + 21F061F543BD2B7C5A77DF17DE9EF163 /* endpoint_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h"; sourceTree = ""; }; + 2204BD7D50BCDA31A2F94496C0395B94 /* db_impl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = db_impl.cc; path = db/db_impl.cc; sourceTree = ""; }; + 22057244B276E9DD6EEC01798385A77A /* atm_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_windows.h; path = include/grpc/impl/codegen/atm_windows.h; sourceTree = ""; }; + 22221F044B9F7D9155FE2B197E7A0020 /* FIRCoreDiagnosticsData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsData.h; path = Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h; sourceTree = ""; }; + 223991F82BCFCC63339443E3FF0C40A8 /* asn1_gen.c */ = {isa = PBXFileReference; includeInIndex = 1; name = asn1_gen.c; path = src/crypto/x509/asn1_gen.c; sourceTree = ""; }; + 22677551E226FF49A7D34AF0A337DFBE /* get_current_time_posix.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = get_current_time_posix.inc; path = absl/time/internal/get_current_time_posix.inc; sourceTree = ""; }; + 22EB140C32995E200292BBAA294DD425 /* endpoint_pair_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint_pair_windows.cc; path = src/core/lib/iomgr/endpoint_pair_windows.cc; sourceTree = ""; }; + 22F00BA2A6D7DC421EE71DB8F625BE28 /* FBLPromise+Retry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Retry.h"; path = "Sources/FBLPromises/include/FBLPromise+Retry.h"; sourceTree = ""; }; + 23156AFDC8CF437ED995D8E10E66F1AC /* credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = credentials.h; path = include/grpcpp/security/credentials.h; sourceTree = ""; }; + 232F344E78212307EEB43DE166DFB1E9 /* stack.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stack.h; path = src/include/openssl/stack.h; sourceTree = ""; }; + 2355BC31601975D8B7E534B0E0A2E34D /* pollset_set_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set_custom.h; path = src/core/lib/iomgr/pollset_set_custom.h; sourceTree = ""; }; + 2355F60BE4168BA33B86EE4132C62B08 /* sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync.h; path = include/grpc/support/sync.h; sourceTree = ""; }; + 2357611EAAC607066D736FC1DF733387 /* client_callback.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_callback.h; path = include/grpcpp/support/client_callback.h; sourceTree = ""; }; + 237729985839977E254A147F3938091B /* grpc_if_nametoindex_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_if_nametoindex_posix.cc; path = src/core/lib/iomgr/grpc_if_nametoindex_posix.cc; sourceTree = ""; }; + 237CE43F630563858D827DB55EACF44A /* hpack_table.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hpack_table.cc; path = src/core/ext/transport/chttp2/transport/hpack_table.cc; sourceTree = ""; }; + 23E0DB0568BF85488C2420F929509F7E /* block_annotate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = block_annotate.h; path = src/core/lib/iomgr/block_annotate.h; sourceTree = ""; }; + 2409A5B27F02D276DE2D4E8F87D00B1D /* objects.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = objects.h; path = src/include/openssl/objects.h; sourceTree = ""; }; + 242474927BBDB038EE0FF6F4E321FA1B /* GDTCORConsoleLogger.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORConsoleLogger.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORConsoleLogger.m; sourceTree = ""; }; + 2426A1FC6C09AE5B0FABD891B1DE922D /* log_reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_reader.cc; path = db/log_reader.cc; sourceTree = ""; }; + 24385D56D890C859D59455A951BF4D46 /* alpn.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alpn.h; path = src/core/ext/transport/chttp2/alpn/alpn.h; sourceTree = ""; }; + 2439C8F4E63DBAC7CB1F852ED86C6F3A /* type_traits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = type_traits.h; path = absl/meta/type_traits.h; sourceTree = ""; }; + 24446E73C9678EF9D157C1F9DF2253AD /* abseil-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "abseil-prefix.pch"; sourceTree = ""; }; + 2444F8514711F64A3BDF8DF7E4CE0C3A /* mpscq.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mpscq.cc; path = src/core/lib/gprpp/mpscq.cc; sourceTree = ""; }; + 24644CF4B9DBFC240B3FBF7A07EADC6F /* write_batch.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = write_batch.cc; path = db/write_batch.cc; sourceTree = ""; }; + 2473AA39618F241F27934D3F6555CC28 /* static_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = static_metadata.cc; path = src/core/lib/transport/static_metadata.cc; sourceTree = ""; }; + 24B350451EE1CC133DECFA8857CFAF56 /* GDTCOREventDataObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREventDataObject.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventDataObject.h; sourceTree = ""; }; + 24C3244EFC3C88261038CFBEF04E22AC /* GDTCORConsoleLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORConsoleLogger.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORConsoleLogger.h; sourceTree = ""; }; + 24E19AC1A5E10778F7EC1F07D8952891 /* ssl_utils_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_utils_config.h; path = src/core/lib/security/security_connector/ssl_utils_config.h; sourceTree = ""; }; + 24F14E626FFBBFEC7C46434448CBE7B2 /* e_tls.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_tls.c; path = src/crypto/cipher_extra/e_tls.c; sourceTree = ""; }; + 24F531CD79C0BC6E4272574162F46F7B /* time_zone_info.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_info.h; path = absl/time/internal/cctz/src/time_zone_info.h; sourceTree = ""; }; + 251C8F835383CBFEBF8FC7DD51F74D6B /* coding.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = coding.cc; path = util/coding.cc; sourceTree = ""; }; + 25285C8F555AFD60182DB33AEC9D10BD /* retry_throttle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = retry_throttle.h; path = src/core/ext/filters/client_channel/retry_throttle.h; sourceTree = ""; }; + 253470E49DDF43BFA861CEA1B9873E55 /* socket_utils_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_utils_posix.h; path = src/core/lib/iomgr/socket_utils_posix.h; sourceTree = ""; }; + 25426CD35EF8F8384D3247A3089C1642 /* wakeup_fd_pipe.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wakeup_fd_pipe.cc; path = src/core/lib/iomgr/wakeup_fd_pipe.cc; sourceTree = ""; }; + 2546A47F0D4FEDE7194ABB6CCC8598C4 /* struct.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = struct.upb.h; path = "src/core/ext/upb-generated/google/protobuf/struct.upb.h"; sourceTree = ""; }; + 25592B2A61C69BF28CADC8150043D35E /* pollset_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_windows.h; path = src/core/lib/iomgr/pollset_windows.h; sourceTree = ""; }; + 255AEAD212B44C00052AD62866F4ADB3 /* raw_logging.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = raw_logging.h; path = absl/base/internal/raw_logging.h; sourceTree = ""; }; + 255CC353C5FDA6CA1E8E6417A72A7530 /* siphash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = siphash.h; path = src/include/openssl/siphash.h; sourceTree = ""; }; + 257CBA6F049DDC229362A2266A940B20 /* obj.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = obj.h; path = src/include/openssl/obj.h; sourceTree = ""; }; + 25A6818872B9D1654FE68E68B22DA7C3 /* flow_control.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = flow_control.cc; path = src/core/ext/transport/chttp2/transport/flow_control.cc; sourceTree = ""; }; + 25F1B5715D38B4B9E70CE4A49C87ACB3 /* handshake.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handshake.cc; path = src/ssl/handshake.cc; sourceTree = ""; }; + 262B6C334E2DA4182F6E05C1BE8E85E2 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/bytestring/internal.h; sourceTree = ""; }; + 263E8B399A92FFC41F51FC5A7A9C50BE /* FIRBundleUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRBundleUtil.m; path = FirebaseCore/Sources/FIRBundleUtil.m; sourceTree = ""; }; + 263EFB806EBF6269985D5A90F2CC4E51 /* message_size_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = message_size_filter.cc; path = src/core/ext/filters/message_size/message_size_filter.cc; sourceTree = ""; }; + 2647BEA98C98B5C71539F80A83017838 /* regex.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = regex.upb.h; path = "src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h"; sourceTree = ""; }; + 2657535AAAAF14E09FAFF37B6DAF663F /* completion_queue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue.h; path = include/grpcpp/completion_queue.h; sourceTree = ""; }; + 26695BAEF9C0456F044A5F13BF4A4DB7 /* work_serializer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = work_serializer.cc; path = src/core/lib/iomgr/work_serializer.cc; sourceTree = ""; }; + 26716858B5A91D0AFA538D833B251738 /* filter.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = filter.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c"; sourceTree = ""; }; + 269E3AD42CD40C891900549025DFC7A0 /* e_aesgcmsiv.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_aesgcmsiv.c; path = src/crypto/cipher_extra/e_aesgcmsiv.c; sourceTree = ""; }; + 26B5BB6E5A14137A1DBEB44D55871588 /* unscaledcycleclock.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = unscaledcycleclock.cc; path = absl/base/internal/unscaledcycleclock.cc; sourceTree = ""; }; + 26C1DB7158A1D4AACDFA648029B7138D /* FIRGeoPoint.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRGeoPoint.mm; path = Firestore/Source/API/FIRGeoPoint.mm; sourceTree = ""; }; + 26EBD07C8C7DAB33CC752704958D1957 /* gogo.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gogo.upb.h; path = "src/core/ext/upb-generated/gogoproto/gogo.upb.h"; sourceTree = ""; }; + 2719DE982895D28FF4FEB2206C2A9646 /* e_aesccm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_aesccm.c; path = src/crypto/cipher_extra/e_aesccm.c; sourceTree = ""; }; + 272432795AA12FE37FFCEDF06982DE17 /* GDTCORLifecycle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORLifecycle.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORLifecycle.h; sourceTree = ""; }; + 279DEAFD43888FDDB4EA222B41151ED8 /* v3_genn.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_genn.c; path = src/crypto/x509v3/v3_genn.c; sourceTree = ""; }; + 27C35D8FAFC7B1C25E18F09E32279CB9 /* http_connection_manager.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = http_connection_manager.upb.c; path = "src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c"; sourceTree = ""; }; + 280C16391AAF3C3CCD571AEF613E0CDE /* inproc_transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inproc_transport.h; path = src/core/ext/transport/inproc/inproc_transport.h; sourceTree = ""; }; + 2830D2781CAA1B007DC5605D679ED3D6 /* http.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http.upb.h; path = "src/core/ext/upb-generated/google/api/http.upb.h"; sourceTree = ""; }; + 2834F5A158B47708196C21F2F36C85FA /* status_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status_util.cc; path = src/core/lib/channel/status_util.cc; sourceTree = ""; }; + 2840A7C135CDC9EF86C8D46ECC0C47E0 /* channel_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_args.h; path = src/core/lib/channel/channel_args.h; sourceTree = ""; }; + 285BD15E9DD394E1DBAC69E726BD41B5 /* resource_quota_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource_quota_impl.h; path = include/grpcpp/resource_quota_impl.h; sourceTree = ""; }; + 287861E4AA5099313770B01785517654 /* leveldb-library.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "leveldb-library.modulemap"; sourceTree = ""; }; + 28793964619C1F7228788C0B1387513F /* range.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = range.upb.h; path = "src/core/ext/upb-generated/envoy/type/range.upb.h"; sourceTree = ""; }; + 287E26C9E3791FABB0831B7AD94A7AF5 /* atomic_hook.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atomic_hook.h; path = absl/base/internal/atomic_hook.h; sourceTree = ""; }; + 288DBFDA9FB3FEC039BF70EF6F28B4C1 /* sha256.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sha256.c; path = src/crypto/fipsmodule/sha/sha256.c; sourceTree = ""; }; + 289CCF46E257E176674DC3FF398AF3E5 /* leveldb-library.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "leveldb-library.debug.xcconfig"; sourceTree = ""; }; + 2911A43369133CA2F34E4EA3EBC8E405 /* a_time.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_time.c; path = src/crypto/asn1/a_time.c; sourceTree = ""; }; + 2920D6AE76F6A58FCD9983528B62C48D /* byte_buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer.h; path = include/grpcpp/support/byte_buffer.h; sourceTree = ""; }; + 2945D010CD334A1E33FD25A3BEF30B31 /* lrs.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lrs.upb.h; path = "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h"; sourceTree = ""; }; + 2970A316BF1BFE4C0942C083FC524E8C /* iocp_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iocp_windows.h; path = src/core/lib/iomgr/iocp_windows.h; sourceTree = ""; }; + 299FECDAA701F13AE58DB4ED4FF0B1DE /* GoogleUtilities-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GoogleUtilities-dummy.m"; sourceTree = ""; }; + 29B00A4F43EA93179CD4C8102ECB5083 /* type_check.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = type_check.h; path = src/include/openssl/type_check.h; sourceTree = ""; }; + 29C0B7E0B38BB64BD690959BF13FA3D5 /* sync_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_posix.h; path = include/grpc/support/sync_posix.h; sourceTree = ""; }; + 2A01B697DF503C3D93135B3C0F28D25F /* xds_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_api.h; path = src/core/ext/filters/client_channel/xds/xds_api.h; sourceTree = ""; }; + 2A3BC1CF9DBF45DB55787D9AF672FBF4 /* a_mbstr.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_mbstr.c; path = src/crypto/asn1/a_mbstr.c; sourceTree = ""; }; + 2A5DE4EC60B3FC05089F935D9BB40AD1 /* socket_factory_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_factory_posix.cc; path = src/core/lib/iomgr/socket_factory_posix.cc; sourceTree = ""; }; + 2A7244FE0A01B1C1B5532E33847085AD /* FIRWriteBatch.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRWriteBatch.mm; path = Firestore/Source/API/FIRWriteBatch.mm; sourceTree = ""; }; + 2A77CDD8EB44C7CA82CCF26B37D7BE27 /* pem_pkey.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_pkey.c; path = src/crypto/pem/pem_pkey.c; sourceTree = ""; }; + 2A91C14F7189A43A5B0078E6950800DA /* method_handler_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = method_handler_impl.h; path = include/grpcpp/impl/method_handler_impl.h; sourceTree = ""; }; + 2AA0481E324D7F406F906F0D617C934C /* port_platform.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port_platform.h; path = include/grpc/support/port_platform.h; sourceTree = ""; }; + 2AF3CF6540C07E060296D88034CA1892 /* message_compress.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = message_compress.cc; path = src/core/lib/compression/message_compress.cc; sourceTree = ""; }; + 2AF41BCD737855422A8E60BDEBFEB02C /* periodic_sampler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = periodic_sampler.h; path = absl/base/internal/periodic_sampler.h; sourceTree = ""; }; + 2B26D1FC1C4254B7DFF79D25144A4970 /* server_chttp2_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_chttp2_posix.cc; path = src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc; sourceTree = ""; }; + 2B2F833A151EE4F80871CAD8924F83CF /* stacktrace_x86-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_x86-inl.inc"; path = "absl/debugging/internal/stacktrace_x86-inl.inc"; sourceTree = ""; }; + 2B36415639698D83C10B4C6F4BC49426 /* string.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string.h; path = src/core/lib/gpr/string.h; sourceTree = ""; }; + 2B75DD07E543761371585696907AF45C /* pcy_int.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pcy_int.h; path = src/crypto/x509v3/pcy_int.h; sourceTree = ""; }; + 2BA61E1B16406097B9C59D176E6870A2 /* umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = umbrella.h; path = src/include/openssl/umbrella.h; sourceTree = ""; }; + 2BB47F23464FF6E8ABA7D7611B408883 /* vdso_support.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = vdso_support.cc; path = absl/debugging/internal/vdso_support.cc; sourceTree = ""; }; + 2BB4897CA1EA2BA8F99CEDA4B79794BD /* listener_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h"; sourceTree = ""; }; + 2BD06794CAD8EB9EBF409100605C94A3 /* cct.nanopb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cct.nanopb.h; path = GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h; sourceTree = ""; }; + 2BF71C89522F57A2DA99817DDB95EC37 /* http_proxy.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http_proxy.cc; path = src/core/ext/filters/client_channel/http_proxy.cc; sourceTree = ""; }; + 2BFCCF5439408D90DFC33A3F6AC86FB4 /* time.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time.cc; path = absl/time/time.cc; sourceTree = ""; }; + 2BFEA36C244F81A773B32DA6223A0AD4 /* status.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.upb.h; path = "src/core/ext/upb-generated/google/rpc/status.upb.h"; sourceTree = ""; }; + 2C085694E94AAA83168675A0ABB22D77 /* cds.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cds.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c"; sourceTree = ""; }; + 2C11CF3156D9FA43AB2D38C1B2D83A9A /* grpc_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_util.cc; path = Firestore/core/src/remote/grpc_util.cc; sourceTree = ""; }; + 2C19FA528F4AA9BB34521DF059BE8F87 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/err/internal.h; sourceTree = ""; }; + 2C3876BF971373587610297E8F6525A3 /* stacktrace_aarch64-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_aarch64-inl.inc"; path = "absl/debugging/internal/stacktrace_aarch64-inl.inc"; sourceTree = ""; }; + 2C3C51EC9AF65CDA9032057E9BB8210F /* tls13_enc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls13_enc.cc; path = src/ssl/tls13_enc.cc; sourceTree = ""; }; + 2C3E948E4FE08B40EA7338760D24DD1C /* grpc_ares_ev_driver_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_ev_driver_posix.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc; sourceTree = ""; }; + 2C44E3A313385725A97F0F3C6F66E6AC /* transport_security_common_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_common_api.h; path = src/core/tsi/alts/handshaker/transport_security_common_api.h; sourceTree = ""; }; + 2C61B9B39560686FB2014E2184FA6FBE /* handshaker_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handshaker_registry.cc; path = src/core/lib/channel/handshaker_registry.cc; sourceTree = ""; }; + 2C710C706A4C3B6C6658D73F068450C1 /* periodic_sampler.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = periodic_sampler.cc; path = absl/base/internal/periodic_sampler.cc; sourceTree = ""; }; + 2C7EB7C367CFD848EA3481438FF18F81 /* p256_32.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = p256_32.h; path = src/third_party/fiat/p256_32.h; sourceTree = ""; }; + 2CB28731A55CAE12BF53A8FE971AFEB2 /* server_callback.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_callback.h; path = include/grpcpp/impl/codegen/server_callback.h; sourceTree = ""; }; + 2CC9ED5FA0A7D424B82F27AC70FC8BFE /* pollset_set.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set.h; path = src/core/lib/iomgr/pollset_set.h; sourceTree = ""; }; + 2CD8F375C3FAFE74F1D17105D22E652E /* status_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = status_apple.mm; path = Firestore/core/src/util/status_apple.mm; sourceTree = ""; }; + 2CEAEB7D39DF0455F6BBB6B997BFF411 /* ssl_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_transport_security.h; path = src/core/tsi/ssl_transport_security.h; sourceTree = ""; }; + 2D3384A5E6A0A9074F60AB2DFC546DE7 /* max_age_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = max_age_filter.cc; path = src/core/ext/filters/max_age/max_age_filter.cc; sourceTree = ""; }; + 2D3620E8112ADA52D50236E9C708EEB6 /* tcp_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_client.h; path = src/core/lib/iomgr/tcp_client.h; sourceTree = ""; }; + 2D889716CA8C2EBD7DC40C9E7718A74A /* listener_components.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = listener_components.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c"; sourceTree = ""; }; + 2DAD39114F176ABDAE1D3505716D04F4 /* descriptor.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = descriptor.upb.h; path = "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h"; sourceTree = ""; }; + 2DB11948F88B998DA11F5993B19FED1A /* FBLPromise+All.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+All.m"; path = "Sources/FBLPromises/FBLPromise+All.m"; sourceTree = ""; }; + 2DCAFFC8B7C9B05A7879283CF23CADBC /* bin_decoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bin_decoder.h; path = src/core/ext/transport/chttp2/transport/bin_decoder.h; sourceTree = ""; }; + 2DF221C1FFACB0663A4F79785651851C /* grpclb_client_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb_client_stats.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h; sourceTree = ""; }; + 2DF8997B901EE96A89E8661A022BEC92 /* connected_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connected_channel.h; path = src/core/lib/channel/connected_channel.h; sourceTree = ""; }; + 2E09442B1860709EF4832571B348711A /* thread_pthread.c */ = {isa = PBXFileReference; includeInIndex = 1; name = thread_pthread.c; path = src/crypto/thread_pthread.c; sourceTree = ""; }; + 2E3DAC5EF5EB9DD36C3EF7364F17FAD0 /* client_channel_channelz.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel_channelz.h; path = src/core/ext/filters/client_channel/client_channel_channelz.h; sourceTree = ""; }; + 2EAD0C9EFB2E3180C2DBFAF8CDB9150F /* health_check_service_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check_service_interface.h; path = include/grpcpp/health_check_service_interface.h; sourceTree = ""; }; + 2EB974BBC2DBD8B387CF2D8EBDEACA02 /* FSTUserDataWriter.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FSTUserDataWriter.mm; path = Firestore/Source/API/FSTUserDataWriter.mm; sourceTree = ""; }; + 2EB9BAE1BBC76D9C11855FE834FAC8FE /* hkdf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hkdf.h; path = src/include/openssl/hkdf.h; sourceTree = ""; }; + 2ECD809A94CDBDAB5A65BFB459EFCE88 /* mutation_batch_result.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutation_batch_result.cc; path = Firestore/core/src/model/mutation_batch_result.cc; sourceTree = ""; }; + 2ED364E8B5FD0DD7B7F3391132B01025 /* GoogleDataTransport-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GoogleDataTransport-dummy.m"; sourceTree = ""; }; + 2ED5D8708E746EEAAA8F20FA079BE5B4 /* endpoint_cfstream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_cfstream.h; path = src/core/lib/iomgr/endpoint_cfstream.h; sourceTree = ""; }; + 2ED964BC4D3AA82AF91695733999F97D /* load_balancer.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = load_balancer.upb.c; path = "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c"; sourceTree = ""; }; + 2EFC08623CDCB418157DC52800AAF14B /* http.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http.nanopb.cc; path = Firestore/Protos/nanopb/google/api/http.nanopb.cc; sourceTree = ""; }; + 2F391FE475FAE6B551A62DC96136EFE0 /* hexdump.c */ = {isa = PBXFileReference; includeInIndex = 1; name = hexdump.c; path = src/crypto/bio/hexdump.c; sourceTree = ""; }; + 2F43F0B5079B8BAD3706850C3E9D3EEE /* cpu-arm-linux.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-arm-linux.c"; path = "src/crypto/cpu-arm-linux.c"; sourceTree = ""; }; + 2F581468D54E778E32D3BDA3B68F82D5 /* utf8.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = utf8.h; path = absl/strings/internal/utf8.h; sourceTree = ""; }; + 2F8DFB761F716328C8EACBF3AD1865B8 /* byte_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_stream.h; path = src/core/lib/transport/byte_stream.h; sourceTree = ""; }; + 2F9AEAE615FC47EAD6B57161EEFCDD14 /* load_bundle_task.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = load_bundle_task.cc; path = Firestore/core/src/api/load_bundle_task.cc; sourceTree = ""; }; + 2FAF69DC4853BE7B2EB671C87AC4FA0B /* tasn_new.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_new.c; path = src/crypto/asn1/tasn_new.c; sourceTree = ""; }; + 2FCAC336BC66411001319E2B41742D39 /* host_port.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = host_port.cc; path = src/core/lib/gprpp/host_port.cc; sourceTree = ""; }; + 2FE71EFE1211CCDBACA64EADB156F322 /* env.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = env.h; path = include/leveldb/env.h; sourceTree = ""; }; + 2FF4343C8A0C8538837D09BF323823C5 /* tasn_fre.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_fre.c; path = src/crypto/asn1/tasn_fre.c; sourceTree = ""; }; + 300641136217C3F72893388DFE42F334 /* health_check_service_server_builder_option.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check_service_server_builder_option.h; path = include/grpcpp/ext/health_check_service_server_builder_option.h; sourceTree = ""; }; + 302D2EEA5F7C765B6C37A580E00C31FF /* time_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_cc.cc; path = src/cpp/util/time_cc.cc; sourceTree = ""; }; + 3035EBD8934F19F344CB2450BB32F009 /* transport_security_grpc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_grpc.h; path = src/core/tsi/transport_security_grpc.h; sourceTree = ""; }; + 304D0D9E970F0C33AB6FF953B13A6A08 /* socket_utils_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_utils_windows.cc; path = src/core/lib/iomgr/socket_utils_windows.cc; sourceTree = ""; }; + 305C8A6F686BC6581EC1248F92C42D3B /* target_authority_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = target_authority_table.h; path = src/core/lib/security/transport/target_authority_table.h; sourceTree = ""; }; + 3070FBAE52C0B169065DCF9C2616C3EB /* v3_akey.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_akey.c; path = src/crypto/x509v3/v3_akey.c; sourceTree = ""; }; + 307F011D6062A498664FC58DACE67415 /* grpc_completion.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_completion.cc; path = Firestore/core/src/remote/grpc_completion.cc; sourceTree = ""; }; + 30E5C63133477DA2B8CC7B76208CF09B /* leveldb_key.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_key.cc; path = Firestore/core/src/local/leveldb_key.cc; sourceTree = ""; }; + 3103B5E5E8961AE81A4FDB7D4757D4AE /* parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = parser.h; path = absl/strings/internal/str_format/parser.h; sourceTree = ""; }; + 311A8592E4873FAE5C377D57E004F876 /* leveldb_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_util.cc; path = Firestore/core/src/local/leveldb_util.cc; sourceTree = ""; }; + 3121D2EA76FA86111FE79EAAB7C81F00 /* server_timestamp_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_timestamp_util.cc; path = Firestore/core/src/model/server_timestamp_util.cc; sourceTree = ""; }; + 313B79D932F8211615B667947E629562 /* server_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_context.cc; path = src/cpp/server/server_context.cc; sourceTree = ""; }; + 3182A7D0F280665F541697E482D7D137 /* dsa_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = dsa_asn1.c; path = src/crypto/dsa/dsa_asn1.c; sourceTree = ""; }; + 318C29D1AB28F79342E35099BACEED1F /* x86_64-gcc.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "x86_64-gcc.c"; path = "src/crypto/fipsmodule/bn/asm/x86_64-gcc.c"; sourceTree = ""; }; + 31A087031ADDE1AF7880A8A86D0C7F41 /* fd.c */ = {isa = PBXFileReference; includeInIndex = 1; name = fd.c; path = src/crypto/bio/fd.c; sourceTree = ""; }; + 31CC97CB5DB9C22723097EBA3F9769A0 /* completion_queue_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue_impl.h; path = include/grpcpp/impl/codegen/completion_queue_impl.h; sourceTree = ""; }; + 31D25403FFC95B707D2F5CBF1D925403 /* rpc_method.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = rpc_method.cc; path = src/cpp/common/rpc_method.cc; sourceTree = ""; }; + 31E4E51E717262B92F1721361794F8D4 /* compression_internal.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = compression_internal.cc; path = src/core/lib/compression/compression_internal.cc; sourceTree = ""; }; + 31F9594AAD58371E0A4E511067F71A4E /* thread.c */ = {isa = PBXFileReference; includeInIndex = 1; name = thread.c; path = src/crypto/thread.c; sourceTree = ""; }; + 32045BB58E6A962E5010F9232903DF89 /* credentials_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = credentials_metadata.cc; path = src/core/lib/security/credentials/credentials_metadata.cc; sourceTree = ""; }; + 32296CC35C4C6686456F9FB7699236B4 /* ev_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ev_windows.cc; path = src/core/lib/iomgr/ev_windows.cc; sourceTree = ""; }; + 32358534B4C8D3248C3E4FED34D71A64 /* grpc_service.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_service.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h"; sourceTree = ""; }; + 32719B7CFC847D795346852B6B72B884 /* pretty_printing.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pretty_printing.cc; path = Firestore/core/src/nanopb/pretty_printing.cc; sourceTree = ""; }; + 328687CB79C415F176336CA8784493F1 /* grpc_if_nametoindex_unsupported.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_if_nametoindex_unsupported.cc; path = src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc; sourceTree = ""; }; + 32A01EB067D0B2AB3D4ABDB0980C0EAD /* FIRComponent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRComponent.m; path = FirebaseCore/Sources/FIRComponent.m; sourceTree = ""; }; + 32C22F219976F585EB755FDF633B2488 /* GDTCORAssert.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORAssert.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORAssert.h; sourceTree = ""; }; + 32D211F9024AF3892B1280563BCF428E /* client_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_context.h; path = include/grpcpp/client_context.h; sourceTree = ""; }; + 32D673EFA5DD266B72426A27401141D0 /* channel_stack.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack.h; path = src/core/lib/channel/channel_stack.h; sourceTree = ""; }; + 32E37AB10A454FA367DCDE649A0489D1 /* backoff.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = backoff.cc; path = src/core/lib/backoff/backoff.cc; sourceTree = ""; }; + 32E524FF275CF724F70E0D625A502FE4 /* endpoint_pair_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint_pair_uv.cc; path = src/core/lib/iomgr/endpoint_pair_uv.cc; sourceTree = ""; }; + 32EB43B068040C2D345B6965A4E33D03 /* message_size_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_size_filter.h; path = src/core/ext/filters/message_size/message_size_filter.h; sourceTree = ""; }; + 330D9C1100B7FA18C2D010F351E8BC4B /* sysinfo.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sysinfo.cc; path = absl/base/internal/sysinfo.cc; sourceTree = ""; }; + 331ED7D8710CC1001B80D4D19BC211E4 /* db_iter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = db_iter.cc; path = db/db_iter.cc; sourceTree = ""; }; + 33401FADF018CD6DA51A59A0B30792E4 /* p_rsa.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_rsa.c; path = src/crypto/evp/p_rsa.c; sourceTree = ""; }; + 3347A1AB6546F0A3977529B8F199DC41 /* PromisesObjC */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromisesObjC; path = FBLPromises.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3353976E4911A92B46473E8FD680703E /* connectivity_monitor_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = connectivity_monitor_apple.mm; path = Firestore/core/src/remote/connectivity_monitor_apple.mm; sourceTree = ""; }; + 335ED1B7339A2C331EAC0F23CD0F6CE1 /* async_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_stream.h; path = include/grpcpp/impl/codegen/async_stream.h; sourceTree = ""; }; + 33A6F5624C52006F1ABD137D1400130D /* montgomery_inv.c */ = {isa = PBXFileReference; includeInIndex = 1; name = montgomery_inv.c; path = src/crypto/fipsmodule/bn/montgomery_inv.c; sourceTree = ""; }; + 33E2F328D4847E3AE8230CBB7D65CAE5 /* init.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = init.cc; path = src/core/lib/surface/init.cc; sourceTree = ""; }; + 341BD3517E4F990FAB166795F3C151A3 /* timer_heap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_heap.h; path = src/core/lib/iomgr/timer_heap.h; sourceTree = ""; }; + 342A87448451AC50F9565222E3BC18F7 /* timer_manager.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer_manager.cc; path = src/core/lib/iomgr/timer_manager.cc; sourceTree = ""; }; + 342E064120BA4D297641CD07E942E3E6 /* status.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.h; path = include/grpc/status.h; sourceTree = ""; }; + 34391FEAE71B56A3166780B622652052 /* ssl_session_cache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_session_cache.h; path = src/core/tsi/ssl/session_cache/ssl_session_cache.h; sourceTree = ""; }; + 3463BA3E18078099E529BAA8FFC9DC53 /* async_queue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = async_queue.cc; path = Firestore/core/src/util/async_queue.cc; sourceTree = ""; }; + 346A4C827C53BEA56A4BB722158591F0 /* siphash.c */ = {isa = PBXFileReference; includeInIndex = 1; name = siphash.c; path = src/crypto/siphash/siphash.c; sourceTree = ""; }; + 3486899FD16BD9A45BCB1987AB4B2F84 /* handshaker_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker_registry.h; path = src/core/lib/channel/handshaker_registry.h; sourceTree = ""; }; + 34B9E5B568FC93770BE6626D4F5F58D8 /* server_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_context.h; path = include/grpcpp/impl/codegen/server_context.h; sourceTree = ""; }; + 34DEA3430BABF027DD56B324986636DE /* channel_create.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_create.cc; path = src/core/ext/transport/chttp2/client/insecure/channel_create.cc; sourceTree = ""; }; + 352208019ADCADE1E9569BE08E687469 /* v3_alt.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_alt.c; path = src/crypto/x509v3/v3_alt.c; sourceTree = ""; }; + 352D58AC7499CDFD2FD08B146E797B6F /* FBLPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FBLPromise.m; path = Sources/FBLPromises/FBLPromise.m; sourceTree = ""; }; + 3534D1D157B9845F8F2ACF43722EE98D /* timer_heap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_heap.h; path = src/core/lib/iomgr/timer_heap.h; sourceTree = ""; }; + 355EE783706767D2B2ED13809C08E8FA /* online_state_tracker.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = online_state_tracker.cc; path = Firestore/core/src/remote/online_state_tracker.cc; sourceTree = ""; }; + 3560DBCBDD820BA5A07FBA4DEE093344 /* client_load_reporting_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_load_reporting_filter.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h; sourceTree = ""; }; + 358D562D0BC9DC87C5EA2ABB31C2BFDB /* byte_buffer_reader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer_reader.h; path = include/grpc/impl/codegen/byte_buffer_reader.h; sourceTree = ""; }; + 35A78741B92DC5A19643DFCFC54E57DB /* alts_tsi_handshaker.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_tsi_handshaker.cc; path = src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc; sourceTree = ""; }; + 35A7BD8BA5AF8D5B5D3A7A66AC545324 /* FBLPromise+Any.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Any.h"; path = "Sources/FBLPromises/include/FBLPromise+Any.h"; sourceTree = ""; }; + 35A8779C3484072854FA5E517B30AB0A /* writing.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = writing.cc; path = src/core/ext/transport/chttp2/transport/writing.cc; sourceTree = ""; }; + 35AF1F62F668B0DB4AE8656A452AC6DD /* timestamp_internal.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timestamp_internal.cc; path = Firestore/core/src/timestamp_internal.cc; sourceTree = ""; }; + 35C49FAEB23BB437B37D5073B9CA45CC /* pollset_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_custom.h; path = src/core/lib/iomgr/pollset_custom.h; sourceTree = ""; }; + 35C6E34D3BF3E17F698291949B8A853D /* endpoint.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h"; sourceTree = ""; }; + 360048D07014C552F5C3B924CC9B33F6 /* bits.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bits.cc; path = Firestore/core/src/util/bits.cc; sourceTree = ""; }; + 3608CD380C85A3520DDDD6E20013CEA5 /* thread_manager.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = thread_manager.cc; path = src/cpp/thread_manager/thread_manager.cc; sourceTree = ""; }; + 361B5F1184D2461D8A0CE4F6C0620787 /* descriptor.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = descriptor.upb.h; path = "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h"; sourceTree = ""; }; + 363650DAA6C5D3C6FA491B0B1432A1CD /* FIRConfigurationInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRConfigurationInternal.h; path = FirebaseCore/Sources/FIRConfigurationInternal.h; sourceTree = ""; }; + 365FA78B1287711599C9B8AF26FA7F62 /* connected_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connected_channel.h; path = src/core/lib/channel/connected_channel.h; sourceTree = ""; }; + 36A53D2CC1DF53FDE70A9D9EC834FDF7 /* buf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = buf.c; path = src/crypto/buf/buf.c; sourceTree = ""; }; + 37136FF8C80063F3DF8F522C22C01715 /* atm.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = atm.cc; path = src/core/lib/gpr/atm.cc; sourceTree = ""; }; + 3734870221525279DFF5056604225D14 /* fuchsia.c */ = {isa = PBXFileReference; includeInIndex = 1; name = fuchsia.c; path = src/crypto/rand_extra/fuchsia.c; sourceTree = ""; }; + 37384569AA4C3DD68DC0C52D69C1FAAC /* x509_set.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_set.c; path = src/crypto/x509/x509_set.c; sourceTree = ""; }; + 374133BF7EDBB2EFEE3F257750EF244E /* grpc_ares_wrapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_ares_wrapper.h; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h; sourceTree = ""; }; + 37440E46D2AC2369BB334D712A3F0604 /* x_sig.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_sig.c; path = src/crypto/x509/x_sig.c; sourceTree = ""; }; + 3792BA295EEB300CB0C045634F2BAA3C /* escaping.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = escaping.cc; path = absl/strings/internal/escaping.cc; sourceTree = ""; }; + 379CF150978B0F5A23E159DC42331CCB /* frame_goaway.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_goaway.h; path = src/core/ext/transport/chttp2/transport/frame_goaway.h; sourceTree = ""; }; + 37AD10ED6129F588C06F028D72018CBD /* tcp_server_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_custom.cc; path = src/core/lib/iomgr/tcp_server_custom.cc; sourceTree = ""; }; + 37D83BCA4B74EAA5091357A0E62C8824 /* random.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = random.h; path = util/random.h; sourceTree = ""; }; + 37F25E574F3F8F80198A3D62A0AE3871 /* server_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_context.h; path = include/grpcpp/server_context.h; sourceTree = ""; }; + 380E77E7227988B903FA456F1FB2BFB5 /* tcp_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_server.h; path = src/core/lib/iomgr/tcp_server.h; sourceTree = ""; }; + 382B48D78383BA4EC5774D0ED1543DFE /* client_channel_plugin.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_channel_plugin.cc; path = src/core/ext/filters/client_channel/client_channel_plugin.cc; sourceTree = ""; }; + 38341EF01EBCAA31235B83E4B61B51A6 /* two_level_iterator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = two_level_iterator.cc; path = table/two_level_iterator.cc; sourceTree = ""; }; + 3845EED97A182E92F5B9534F992CD436 /* table_builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = table_builder.h; path = include/leveldb/table_builder.h; sourceTree = ""; }; + 386BB34824ED1E0EE99659E7D3951FA3 /* GDTCORTransport_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORTransport_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransport_Private.h; sourceTree = ""; }; + 387F772EEEAFE9929148A598D14E6E96 /* endpoint_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h"; sourceTree = ""; }; + 38B648D43D814C6B663D06516D926B03 /* FIRDocumentReference.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRDocumentReference.mm; path = Firestore/Source/API/FIRDocumentReference.mm; sourceTree = ""; }; + 38F3E929839096653111D65E2F29BE3A /* sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync.h; path = src/core/lib/gprpp/sync.h; sourceTree = ""; }; + 38FC04DE1D076ACF463126268796D2A8 /* alts_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_security_connector.h; path = src/core/lib/security/security_connector/alts/alts_security_connector.h; sourceTree = ""; }; + 390E1EFE88DDAEC3EE6294C7408CD71D /* GDTCOREvent+GDTCCTSupport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "GDTCOREvent+GDTCCTSupport.m"; path = "GoogleDataTransport/GDTCCTLibrary/GDTCOREvent+GDTCCTSupport.m"; sourceTree = ""; }; + 391691F3034C5352842FE2708CA898F0 /* v3_sxnet.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_sxnet.c; path = src/crypto/x509v3/v3_sxnet.c; sourceTree = ""; }; + 392C741810C6A496B45E20AEA0FE691B /* posix_logger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = posix_logger.h; path = util/posix_logger.h; sourceTree = ""; }; + 39426085DB1BB35CB175995B81EA8656 /* mutexlock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mutexlock.h; path = util/mutexlock.h; sourceTree = ""; }; + 3952840104A502E94C594E0BDB896FC0 /* orphanable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = orphanable.h; path = src/core/lib/gprpp/orphanable.h; sourceTree = ""; }; + 395FED92263FE00D8C1FECA38029D133 /* iomgr_internal.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_internal.cc; path = src/core/lib/iomgr/iomgr_internal.cc; sourceTree = ""; }; + 3981B5D272FE54939C07182ACD00E735 /* flow_control.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = flow_control.h; path = src/core/ext/transport/chttp2/transport/flow_control.h; sourceTree = ""; }; + 398FA6BE3CD65C056358FBE7EBBEDDC3 /* ssl_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_credentials.h; path = src/core/lib/security/credentials/ssl/ssl_credentials.h; sourceTree = ""; }; + 39A5254AF0CAFA22B443D30475E677E8 /* iomgr_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_internal.h; path = src/core/lib/iomgr/iomgr_internal.h; sourceTree = ""; }; + 3A3179F3D454D104AC5A2966E2B649FC /* sync_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sync_windows.cc; path = src/core/lib/gpr/sync_windows.cc; sourceTree = ""; }; + 3A3D937FB23127FB2863991631314588 /* channel_stack.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack.h; path = src/core/lib/channel/channel_stack.h; sourceTree = ""; }; + 3A40E153D6CF41878799159B14580A7D /* testharness.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = testharness.h; path = util/testharness.h; sourceTree = ""; }; + 3A412EA5BC2E26FFE585CB5AD09595AC /* stream_map.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream_map.cc; path = src/core/ext/transport/chttp2/transport/stream_map.cc; sourceTree = ""; }; + 3A65027B5AC3B0BEA043E518801657BA /* memutil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = memutil.h; path = absl/strings/internal/memutil.h; sourceTree = ""; }; + 3A705335B43DA99B5322E05DC7A4AED8 /* channelz_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channelz_registry.cc; path = src/core/lib/channel/channelz_registry.cc; sourceTree = ""; }; + 3A7AC2793067554108FB0C965A401C84 /* GoogleDataTransport.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleDataTransport.release.xcconfig; sourceTree = ""; }; + 3A831916712628AFCB8A417ECFB71FA3 /* str_replace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_replace.h; path = absl/strings/str_replace.h; sourceTree = ""; }; + 3A8392C419EB6ADFDFE1B5A27183E2C1 /* pb_decode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_decode.h; sourceTree = ""; }; + 3A8908A9F38FEE3653A71C8CF6AA706A /* status.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.h; path = include/leveldb/status.h; sourceTree = ""; }; + 3ACDAA76599D5B821934B1EBF93B36C8 /* map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = map.h; path = src/core/lib/gprpp/map.h; sourceTree = ""; }; + 3AD14BFF02BA00FA4B3D8A5B2C96DF10 /* alts_iovec_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_iovec_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h; sourceTree = ""; }; + 3AEC022C82A3CA5856F4649FF5F712AA /* port_def.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = port_def.inc; path = third_party/upb/upb/port_def.inc; sourceTree = ""; }; + 3B0753C06F5CC830263CB0E4C0A03085 /* xds_channel_secure.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_channel_secure.cc; path = src/core/ext/filters/client_channel/xds/xds_channel_secure.cc; sourceTree = ""; }; + 3B0D4F4EEE4AE85072814B6355F52787 /* grpclb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpclb.cc; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc; sourceTree = ""; }; + 3B6CDB868D356BD0A3C52A5D9FC12118 /* crc32c.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = crc32c.h; path = util/crc32c.h; sourceTree = ""; }; + 3B6D0B6124F9D512DADEE6AAEA03DE4B /* internal_errqueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal_errqueue.h; path = src/core/lib/iomgr/internal_errqueue.h; sourceTree = ""; }; + 3B9B1ECECDCDF419D009ABF477F942CF /* grpc_ares_wrapper_libuv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_wrapper_libuv.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc; sourceTree = ""; }; + 3B9C02065259D4ADE30BA766B7D414A3 /* proto_buffer_reader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proto_buffer_reader.h; path = include/grpcpp/support/proto_buffer_reader.h; sourceTree = ""; }; + 3BA4D17A907DFD005514D01BECC450E2 /* slice_buffer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = slice_buffer.cc; path = src/core/lib/slice/slice_buffer.cc; sourceTree = ""; }; + 3BAEFB567038EDFFD8219B65064045A4 /* manual_constructor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = manual_constructor.h; path = src/core/lib/gprpp/manual_constructor.h; sourceTree = ""; }; + 3BB3BC1F21E682BF978F9996DF5BFE15 /* add.c */ = {isa = PBXFileReference; includeInIndex = 1; name = add.c; path = src/crypto/fipsmodule/bn/add.c; sourceTree = ""; }; + 3BC4B11148B1D8E6011B1124EEBE2DAE /* buffer_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = buffer_list.h; path = src/core/lib/iomgr/buffer_list.h; sourceTree = ""; }; + 3BD5C9FFD3CF5903ACEB28B80FA94E65 /* rc4.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rc4.c; path = src/crypto/rc4/rc4.c; sourceTree = ""; }; + 3C1A95744898955B4278B82F42B2B4EA /* cipher_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cipher_extra.c; path = src/crypto/cipher_extra/cipher_extra.c; sourceTree = ""; }; + 3C2674DF3DB6BF983145BF1D7CD207AF /* grpc_ares_ev_driver_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_ev_driver_windows.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc; sourceTree = ""; }; + 3C2CFE7651B561BB6CFA7CC9B15F63E9 /* health_check_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check_client.h; path = src/core/ext/filters/client_channel/health/health_check_client.h; sourceTree = ""; }; + 3C39DBB52327F16A36B4F665B0D14B93 /* ex_data.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ex_data.c; path = src/crypto/ex_data.c; sourceTree = ""; }; + 3C50E5CAB53FFB09E1D1629A07D1781D /* FIROptions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIROptions.m; path = FirebaseCore/Sources/FIROptions.m; sourceTree = ""; }; + 3C5AB43C7FCCBEFB3E67FA4E22874F40 /* GoogleUtilities.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleUtilities.debug.xcconfig; sourceTree = ""; }; + 3CA599690024C45B7D3F178A156F9517 /* error.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error.h; path = src/core/lib/iomgr/error.h; sourceTree = ""; }; + 3CBF1715FA22DDF4859F58983C96BB21 /* sockaddr_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_custom.h; path = src/core/lib/iomgr/sockaddr_custom.h; sourceTree = ""; }; + 3CC21FF44E36769D74D00B7BFF5A569C /* pid_controller.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pid_controller.h; path = src/core/lib/transport/pid_controller.h; sourceTree = ""; }; + 3CC5E1FB0AA9C874CC63E06F1FBD9270 /* json.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json.h; path = src/core/lib/json/json.h; sourceTree = ""; }; + 3CCB8E7B65E7C327D476A2F3C9373857 /* GoogleUtilities-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GoogleUtilities-umbrella.h"; sourceTree = ""; }; + 3CCEB77F18F4584631BA806547F5BCE6 /* duration.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = duration.upb.h; path = "src/core/ext/upb-generated/google/protobuf/duration.upb.h"; sourceTree = ""; }; + 3CCF900FF44FCAE833AEE9C6E5CE9212 /* duration.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = duration.upb.h; path = "src/core/ext/upb-generated/google/protobuf/duration.upb.h"; sourceTree = ""; }; + 3CDD6694CC550534B1181B3D249C08B3 /* exponential_biased.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = exponential_biased.cc; path = absl/base/internal/exponential_biased.cc; sourceTree = ""; }; + 3CE9C39D8AAEE53FEACB1EB019C72DBB /* httpcli.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = httpcli.h; path = src/core/lib/http/httpcli.h; sourceTree = ""; }; + 3CF54DA3A53D783F2B0CB8A100C90B1E /* string_apple.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_apple.cc; path = Firestore/core/src/util/string_apple.cc; sourceTree = ""; }; + 3D1CFAB531E01148681292263B67973F /* external_connection_acceptor_impl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = external_connection_acceptor_impl.cc; path = src/cpp/server/external_connection_acceptor_impl.cc; sourceTree = ""; }; + 3D2AD666A64B37FD6370853C72E35A12 /* a_sign.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_sign.c; path = src/crypto/x509/a_sign.c; sourceTree = ""; }; + 3D4AE169D8ADBE9D89664991B5D6DF0D /* global_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config.h; path = src/core/lib/gprpp/global_config.h; sourceTree = ""; }; + 3D57E2123FA0697547374E39991A2107 /* span.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = span.h; path = src/include/openssl/span.h; sourceTree = ""; }; + 3D6642692ADA5BCA078E1B5ACDB08841 /* padding.c */ = {isa = PBXFileReference; includeInIndex = 1; name = padding.c; path = src/crypto/fipsmodule/rsa/padding.c; sourceTree = ""; }; + 3D786ADEA083DF91413AFBC3EDD789DE /* GDTCORReachability.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORReachability.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORReachability.m; sourceTree = ""; }; + 3D9DEE9D0A3229B90F0043F9BFF1EB4A /* local_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_credentials.h; path = src/core/lib/security/credentials/local/local_credentials.h; sourceTree = ""; }; + 3DA7CBF62BB3656E09A77A3F5F593554 /* GDTCOREndpoints.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREndpoints.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h; sourceTree = ""; }; + 3DABE1A5226AF62B55FDFA414FCF140C /* fork_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fork_windows.cc; path = src/core/lib/iomgr/fork_windows.cc; sourceTree = ""; }; + 3DB54510A83FDE9E6144ABD2AD77235E /* chttp2_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = chttp2_connector.cc; path = src/core/ext/transport/chttp2/client/chttp2_connector.cc; sourceTree = ""; }; + 3DBED362B4E9BDE07141BE65A5E463DE /* t1_lib.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = t1_lib.cc; path = src/ssl/t1_lib.cc; sourceTree = ""; }; + 3DDF03DC9E76B9A50571A15F51739E5B /* repair.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = repair.cc; path = db/repair.cc; sourceTree = ""; }; + 3DE46C3FB48C77001FC457A97887CA79 /* load_system_roots_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_system_roots_linux.h; path = src/core/lib/security/security_connector/load_system_roots_linux.h; sourceTree = ""; }; + 3DE4A2600B80B995AFA6EB97FF19584D /* address_is_readable.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = address_is_readable.cc; path = absl/debugging/internal/address_is_readable.cc; sourceTree = ""; }; + 3E15A49E106AA5251194810E927C2F4B /* call_combiner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_combiner.h; path = src/core/lib/iomgr/call_combiner.h; sourceTree = ""; }; + 3E1A23420F4011712F05BD2979FDBE50 /* grpc_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_posix.h; path = include/grpc/grpc_posix.h; sourceTree = ""; }; + 3E2CF3C56CC98E70074D3B03C6080C02 /* evp_ctx.c */ = {isa = PBXFileReference; includeInIndex = 1; name = evp_ctx.c; path = src/crypto/evp/evp_ctx.c; sourceTree = ""; }; + 3E52B8C90E0E8705D6658CF6414BF091 /* a_utf8.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_utf8.c; path = src/crypto/asn1/a_utf8.c; sourceTree = ""; }; + 3E6BC9EEF879320F15924D807E0674A1 /* iomgr_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_custom.h; path = src/core/lib/iomgr/iomgr_custom.h; sourceTree = ""; }; + 3E711594F3475539AD1CACDDE4DBC420 /* channel.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel.cc; path = src/core/lib/surface/channel.cc; sourceTree = ""; }; + 3E75DB6E8C23E6056B158209E0EE3D73 /* internal_errqueue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = internal_errqueue.cc; path = src/core/lib/iomgr/internal_errqueue.cc; sourceTree = ""; }; + 3E87A37252B47E86765B38E1546BDD73 /* api_listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = api_listener.upb.h; path = "src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h"; sourceTree = ""; }; + 3E947D92741F9D5F54ECF9711B73288A /* completion_queue_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue_factory.h; path = src/core/lib/surface/completion_queue_factory.h; sourceTree = ""; }; + 3EA6970878B97E9A4FE428BDB39F3FA8 /* grpc_ares_ev_driver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_ev_driver.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc; sourceTree = ""; }; + 3ED4CEA481AA965C59ACC1C3661D9675 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/pool/internal.h; sourceTree = ""; }; + 3EE4E4E6995DB123A1C58AFFB2284359 /* FIRAppInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppInternal.h; path = FirebaseCore/Sources/Private/FIRAppInternal.h; sourceTree = ""; }; + 3EF8AF8A90604349280F03259FF00F07 /* client_idle_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_idle_filter.cc; path = src/core/ext/filters/client_idle/client_idle_filter.cc; sourceTree = ""; }; + 3EFA29BE5456CD955C742714DF6E6DF7 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/conf/internal.h; sourceTree = ""; }; + 3F281DA6DBC33AF233D7D6C2DCAF377A /* Pods-SaraAttended-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SaraAttended-acknowledgements.markdown"; sourceTree = ""; }; + 3F292AF18FA858FCD857A193543E4F14 /* dumpfile.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dumpfile.cc; path = db/dumpfile.cc; sourceTree = ""; }; + 3F387FBA9DDCDE0212264495DB93AF3A /* grpc_alts_credentials_options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_alts_credentials_options.cc; path = src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc; sourceTree = ""; }; + 3F39F3D5A4D381899679B49E7A1887FE /* tls_credentials_options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_credentials_options.cc; path = src/cpp/common/tls_credentials_options.cc; sourceTree = ""; }; + 3F57D5223674DE8297E00191AE812843 /* FIRSnapshotMetadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRSnapshotMetadata.h; path = Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h; sourceTree = ""; }; + 3F5E7D4CCC09647D8B15C0FE1C6B8E8F /* channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel.h; path = src/core/lib/surface/channel.h; sourceTree = ""; }; + 3F759925CBAB1B3CB74AD7CDD9F22449 /* str_replace.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = str_replace.cc; path = absl/strings/str_replace.cc; sourceTree = ""; }; + 3F85F26406486E83C289E51756255D21 /* log_android.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_android.cc; path = src/core/lib/gpr/log_android.cc; sourceTree = ""; }; + 3FAF9183B212D36621D019982E9AEF75 /* service_config.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = service_config.cc; path = src/core/ext/filters/client_channel/service_config.cc; sourceTree = ""; }; + 3FD574DA2FA452870EC12EBE316A0FBC /* channelz.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channelz.cc; path = src/core/lib/channel/channelz.cc; sourceTree = ""; }; + 3FDE2E76DEFE8E85CFD4755F929091FE /* event_string.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = event_string.h; path = src/core/lib/surface/event_string.h; sourceTree = ""; }; + 3FE619629A1795D2850BA2450E81AE37 /* bound.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bound.cc; path = Firestore/core/src/core/bound.cc; sourceTree = ""; }; + 3FE860E0897B1CF3E4D5D13932205702 /* atm_gcc_sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_gcc_sync.h; path = include/grpc/impl/codegen/atm_gcc_sync.h; sourceTree = ""; }; + 3FF6EA6F5C09355903F15F5CDF0EB9EC /* outlier_detection.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = outlier_detection.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h"; sourceTree = ""; }; + 3FF81C533E6274BB099F725AE1BA8E18 /* gRPC-Core-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "gRPC-Core-Info.plist"; sourceTree = ""; }; + 40633848FF26A08A6737B41BFA03446D /* GDTCORStorageEventSelector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORStorageEventSelector.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORStorageEventSelector.h; sourceTree = ""; }; + 40684F02670C5E032C82259DBCBDC2AA /* decode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = decode.h; path = third_party/upb/upb/decode.h; sourceTree = ""; }; + 407F2336D528FAE4942037AE24703D4B /* policy_checks.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = policy_checks.h; path = absl/base/policy_checks.h; sourceTree = ""; }; + 4082596820A859BB5CBB84F1AD6D52C6 /* x_crl.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_crl.c; path = src/crypto/x509/x_crl.c; sourceTree = ""; }; + 40DBDD6AFED2AF2508997CB1D7E329FD /* GDTCOREvent_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREvent_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCOREvent_Private.h; sourceTree = ""; }; + 40DEE50F5C979D98AD4B7C60CA18F339 /* call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call.h; path = include/grpcpp/impl/codegen/call.h; sourceTree = ""; }; + 40E596A03BD27031C6B1374D6CBB1865 /* file.c */ = {isa = PBXFileReference; includeInIndex = 1; name = file.c; path = src/crypto/bio/file.c; sourceTree = ""; }; + 410135060F6A6677272AF2FB06EDDA70 /* dtls_method.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dtls_method.cc; path = src/ssl/dtls_method.cc; sourceTree = ""; }; + 416BD878FDE36B0E876E3A02BAE72148 /* GDTCORFlatFileStorage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORFlatFileStorage.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage.m; sourceTree = ""; }; + 417A2789C4F23A37BDCE282162588D44 /* v3_bcons.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_bcons.c; path = src/crypto/x509v3/v3_bcons.c; sourceTree = ""; }; + 41A93D115672055C805A34D017E6BE86 /* channel_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_interface.h; path = include/grpcpp/impl/codegen/channel_interface.h; sourceTree = ""; }; + 41C3CC91C81D99B78AE2C88C52BA8008 /* civil_time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = civil_time.h; path = absl/time/civil_time.h; sourceTree = ""; }; + 41EFA1B5BDCCFAEC42437967FE88B641 /* FIRFirestoreSettings.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFirestoreSettings.mm; path = Firestore/Source/API/FIRFirestoreSettings.mm; sourceTree = ""; }; + 41F20D9FB01F9A3F129006ED323B66AF /* log_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log_windows.h; path = include/grpc/support/log_windows.h; sourceTree = ""; }; + 41FB1B12AF7F7444EC885F1C15DF6677 /* slice_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_internal.h; path = src/core/lib/slice/slice_internal.h; sourceTree = ""; }; + 41FB36346D7717A550141E0230ED56AE /* FBLPromise+Wrap.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Wrap.m"; path = "Sources/FBLPromises/FBLPromise+Wrap.m"; sourceTree = ""; }; + 420809A3D84FCAC2EBDFC5C553797560 /* census.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = census.h; path = include/grpc/census.h; sourceTree = ""; }; + 420A2D2A6930523849B70B9C3348A4DB /* FirebaseCore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FirebaseCore.h; path = FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h; sourceTree = ""; }; + 4215984B22861EEE66F7975BC8826B61 /* cipher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cipher.h; path = src/include/openssl/cipher.h; sourceTree = ""; }; + 4240E54F4AAF1F1901EF558A20C959C8 /* alts_shared_resource.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_shared_resource.h; path = src/core/tsi/alts/handshaker/alts_shared_resource.h; sourceTree = ""; }; + 424BA320A3592CC7617275117CC376DE /* hash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hash.h; path = util/hash.h; sourceTree = ""; }; + 426608583B60E305CCCCE4C445615B99 /* server_chttp2.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_chttp2.cc; path = src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc; sourceTree = ""; }; + 4291555008D94A32C804A59C52ED3475 /* memory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = memory.h; path = absl/memory/memory.h; sourceTree = ""; }; + 42930C033D30E0C95408769940E8AE36 /* server_builder_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_builder_impl.h; path = include/grpcpp/server_builder_impl.h; sourceTree = ""; }; + 429CDBFF1E41ECF06C4D98A9CB755343 /* buffer_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = buffer_list.h; path = src/core/lib/iomgr/buffer_list.h; sourceTree = ""; }; + 42A3491AAFF3AB54FD6B26EFD99BB876 /* algorithm.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = algorithm.h; path = absl/algorithm/algorithm.h; sourceTree = ""; }; + 42DBF69F67A26054C8A87F2EED5A5D44 /* byte_stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_stream.cc; path = src/core/lib/transport/byte_stream.cc; sourceTree = ""; }; + 42DE6B8BAA3F2D02FB99B98DC0D836DD /* resize_uninitialized.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resize_uninitialized.h; path = absl/strings/internal/resize_uninitialized.h; sourceTree = ""; }; + 42E71288C15E81D916D729C6D0019521 /* client_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_context.cc; path = src/cpp/client/client_context.cc; sourceTree = ""; }; + 4328B8C23D84342B8BF117B78402199F /* create_channel.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = create_channel.cc; path = src/cpp/client/create_channel.cc; sourceTree = ""; }; + 4333A065C00392A33513D7E58EE8AA2C /* message_compress_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = message_compress_filter.cc; path = src/core/ext/filters/http/message_compress/message_compress_filter.cc; sourceTree = ""; }; + 435D0F489605EADDCF177F734D741809 /* checker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = checker.h; path = absl/strings/internal/str_format/checker.h; sourceTree = ""; }; + 436A13930E01446E2ED5E4C1A0ADDC0B /* string_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_util.cc; path = Firestore/core/src/util/string_util.cc; sourceTree = ""; }; + 437BBB331542A87EA663492AADD4352A /* output.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = output.cc; path = absl/strings/internal/str_format/output.cc; sourceTree = ""; }; + 438CC79580532F080A206E81530D5748 /* tls_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_credentials.cc; path = src/core/lib/security/credentials/tls/tls_credentials.cc; sourceTree = ""; }; + 43ACF272241767AE195CBA6DC6B6B948 /* scrypt.c */ = {isa = PBXFileReference; includeInIndex = 1; name = scrypt.c; path = src/crypto/evp/scrypt.c; sourceTree = ""; }; + 43C7929F6E2F822270B483898A8BE789 /* hpack_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_table.h; path = src/core/ext/transport/chttp2/transport/hpack_table.h; sourceTree = ""; }; + 43CE1AC53A26F98B286ED83375EE2FF0 /* hpack_encoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_encoder.h; path = src/core/ext/transport/chttp2/transport/hpack_encoder.h; sourceTree = ""; }; + 43D4D184E1E29A6B73E0E27B1C87C6FC /* FIRCoreDiagnosticsData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsData.h; path = Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h; sourceTree = ""; }; + 43D4FD3CE529D5052F28E1CFF76AAD1C /* backup_poller.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backup_poller.h; path = src/core/ext/filters/client_channel/backup_poller.h; sourceTree = ""; }; + 43E435037B59162BC0485738ED724D4E /* ssl_utils.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_utils.cc; path = src/core/lib/security/security_connector/ssl_utils.cc; sourceTree = ""; }; + 43FAFC4B5882220F24952B47E295C07E /* filesystem_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filesystem_posix.cc; path = Firestore/core/src/util/filesystem_posix.cc; sourceTree = ""; }; + 440025C65577D4DA4E2733C2C7BB05B2 /* port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port.h; path = src/core/lib/iomgr/port.h; sourceTree = ""; }; + 440D5AA3C5AF9D2719E0389B236A7E02 /* ssl_buffer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_buffer.cc; path = src/ssl/ssl_buffer.cc; sourceTree = ""; }; + 44109291B25C2A8C13E8A30930635D21 /* leveldb_bundle_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_bundle_cache.cc; path = Firestore/core/src/local/leveldb_bundle_cache.cc; sourceTree = ""; }; + 442BEF46A4CE4B98E1864CF664B03C6A /* empty.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = empty.nanopb.cc; path = Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc; sourceTree = ""; }; + 442E2F112D7DB4047BF287BC7874BAF7 /* error_cfstream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = error_cfstream.cc; path = src/core/lib/iomgr/error_cfstream.cc; sourceTree = ""; }; + 444AB9B18BEBE02DA7B5CE51CE888C46 /* auth_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_context.h; path = include/grpcpp/security/auth_context.h; sourceTree = ""; }; + 44651260A080C7B0ED2C0D690EC8E8EA /* create_channel_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = create_channel_posix.cc; path = src/cpp/client/create_channel_posix.cc; sourceTree = ""; }; + 44660551561017400EC935F864AA4EDE /* lrs.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = lrs.upb.c; path = "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c"; sourceTree = ""; }; + 4489DC4322E7344AA9026192381DCCE7 /* socket_mutator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_mutator.h; path = src/core/lib/iomgr/socket_mutator.h; sourceTree = ""; }; + 44A87C5EA5B4275B0CB816C231A79303 /* FIRApp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRApp.h; path = FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h; sourceTree = ""; }; + 44DA1862D10A5E16DB66B1A9CA4B65EE /* stream_compression_identity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression_identity.h; path = src/core/lib/compression/stream_compression_identity.h; sourceTree = ""; }; + 44DAD51B726D6D0AD3F797C00B8B1259 /* fork.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fork.h; path = include/grpc/fork.h; sourceTree = ""; }; + 44FE1F32C1768389A81F0A6275733508 /* bdp_estimator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bdp_estimator.h; path = src/core/lib/transport/bdp_estimator.h; sourceTree = ""; }; + 45034B8772C1D99CFF8715FA857BD0A5 /* thd_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = thd_posix.cc; path = src/core/lib/gprpp/thd_posix.cc; sourceTree = ""; }; + 4505701F268374FC5F33F6D593AFCAC0 /* str_cat.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = str_cat.cc; path = absl/strings/str_cat.cc; sourceTree = ""; }; + 451140231B672DF6F7631B009CE8478D /* iomgr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr.h; path = src/core/lib/iomgr/iomgr.h; sourceTree = ""; }; + 451C4CD4076AF2620CADFDF3B55A8248 /* route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h"; sourceTree = ""; }; + 4540C2059DE869A0A0A334D5001F1630 /* filename.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = filename.h; path = db/filename.h; sourceTree = ""; }; + 4583E9CB7FEEE33105B059F2D82BFB72 /* deprecation.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = deprecation.upb.h; path = "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h"; sourceTree = ""; }; + 45979CB70BBD7D08B85AD8EBF2E94BF7 /* handshaker_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker_factory.h; path = src/core/lib/channel/handshaker_factory.h; sourceTree = ""; }; + 459AB63EDCA10BF23F45F3A64546AE8F /* GDTCORPlatform.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORPlatform.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m; sourceTree = ""; }; + 45C2F0C6B6C2D46D99976D4F5529040E /* byte_buffer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_buffer.cc; path = src/core/lib/surface/byte_buffer.cc; sourceTree = ""; }; + 45F3712FB4F0F778F038527E8B3E7D76 /* atm_gcc_sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_gcc_sync.h; path = include/grpc/support/atm_gcc_sync.h; sourceTree = ""; }; + 46417F5AD9A23058AD37BD569A701642 /* status.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status.nanopb.cc; path = Firestore/Protos/nanopb/google/rpc/status.nanopb.cc; sourceTree = ""; }; + 46759EE4919B288A782AEBB1A7DB42DC /* cycleclock.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cycleclock.cc; path = absl/base/internal/cycleclock.cc; sourceTree = ""; }; + 469F2002D2586FCFFD3B4A6AFE915109 /* a_gentm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_gentm.c; path = src/crypto/asn1/a_gentm.c; sourceTree = ""; }; + 46C309C9CF31A4465FBC856BF4A71298 /* metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = metadata.cc; path = src/core/lib/transport/metadata.cc; sourceTree = ""; }; + 46D15B24712B14D26DB149630599A386 /* version_set.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = version_set.cc; path = db/version_set.cc; sourceTree = ""; }; + 46D6B082B1EA2B1ED9216CC06A2EF706 /* server_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_interface.h; path = include/grpcpp/impl/codegen/server_interface.h; sourceTree = ""; }; + 46E075C8BED1B36D60EF96BADFF8B9FB /* health_check.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = health_check.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c"; sourceTree = ""; }; + 46E965579B7EFFEA4F99E621F0BBEDD6 /* sockaddr_resolver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sockaddr_resolver.cc; path = src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc; sourceTree = ""; }; + 46EEC2499CB5F5F370F0179032F4BEAB /* create_default_thread_pool.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = create_default_thread_pool.cc; path = src/cpp/server/create_default_thread_pool.cc; sourceTree = ""; }; + 46FDDEA68FAD2F4DBA7A5871269B0871 /* util.c */ = {isa = PBXFileReference; includeInIndex = 1; name = util.c; path = src/crypto/fipsmodule/ec/util.c; sourceTree = ""; }; + 4708BD44EC5A216E24FB4E52DD3D392F /* curve25519_32.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = curve25519_32.h; path = src/third_party/fiat/curve25519_32.h; sourceTree = ""; }; + 470A2E0E8B613BCA4289281E71307DA9 /* subchannel.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = subchannel.cc; path = src/core/ext/filters/client_channel/subchannel.cc; sourceTree = ""; }; + 471A162586C7439948EB848F7A00BF39 /* alloc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alloc.h; path = src/core/lib/gpr/alloc.h; sourceTree = ""; }; + 471B8E9831E0AE7B8BCAEF5EEA722404 /* firebase_app_check_credentials_provider_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = firebase_app_check_credentials_provider_apple.mm; path = Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.mm; sourceTree = ""; }; + 4726FB4D018035E3D0C77A2B382650FC /* tcp_server_utils_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_server_utils_posix.h; path = src/core/lib/iomgr/tcp_server_utils_posix.h; sourceTree = ""; }; + 47459DDBD455E8EDC36BF6BE1A3096AF /* tasn_typ.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_typ.c; path = src/crypto/asn1/tasn_typ.c; sourceTree = ""; }; + 475AF9819AB0CC06134DAEDA3DAF6A1A /* ssl_stat.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_stat.cc; path = src/ssl/ssl_stat.cc; sourceTree = ""; }; + 475B7F4FA0153A9211E99C94E981B8E4 /* format.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = format.h; path = table/format.h; sourceTree = ""; }; + 4773B12D9409994ECA18BB4B13D79E13 /* outlier_detection.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = outlier_detection.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c"; sourceTree = ""; }; + 47B13EBE03D5CDA2C05768C5BA9179AB /* scalar.c */ = {isa = PBXFileReference; includeInIndex = 1; name = scalar.c; path = src/crypto/fipsmodule/ec/scalar.c; sourceTree = ""; }; + 47F316ABC8B1138CEC418AAF6E53652F /* datastore.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = datastore.cc; path = Firestore/core/src/remote/datastore.cc; sourceTree = ""; }; + 47FDE70C5FEC483AD9C719B313814297 /* socket_factory_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_factory_posix.h; path = src/core/lib/iomgr/socket_factory_posix.h; sourceTree = ""; }; + 4834AE0EA0304B56E352D8F6C5FA074C /* wnaf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = wnaf.c; path = src/crypto/fipsmodule/ec/wnaf.c; sourceTree = ""; }; + 4855F73788559D7D3856CB64D848269C /* GULAppEnvironmentUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULAppEnvironmentUtil.m; path = GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m; sourceTree = ""; }; + 4856F247635DDFF25590A63A1EB08FF7 /* static_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = static_metadata.h; path = src/core/lib/transport/static_metadata.h; sourceTree = ""; }; + 487080C34B2182DC7185465FF17F2546 /* lb_policy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy.h; path = src/core/ext/filters/client_channel/lb_policy.h; sourceTree = ""; }; + 48714E806CF47F9772053FE937AA391F /* backup_poller.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = backup_poller.cc; path = src/core/ext/filters/client_channel/backup_poller.cc; sourceTree = ""; }; + 488C3EC97E91D717507401F44AFA326B /* hrss.c */ = {isa = PBXFileReference; includeInIndex = 1; name = hrss.c; path = src/crypto/hrss/hrss.c; sourceTree = ""; }; + 48C0BC392FFF6685F862551F33F6D994 /* rpc_method.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rpc_method.h; path = include/grpcpp/impl/codegen/rpc_method.h; sourceTree = ""; }; + 48E9690C8ED5EAEB257DB8919A2CE8AF /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/cipher_extra/internal.h; sourceTree = ""; }; + 48EF9FFEC74353F57A5647B7B7E82CF5 /* connectivity_state.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = connectivity_state.cc; path = src/core/lib/transport/connectivity_state.cc; sourceTree = ""; }; + 48F2043236F70A5747D902B21422D45A /* grpc_types.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_types.h; path = include/grpc/impl/codegen/grpc_types.h; sourceTree = ""; }; + 48F9284EBAC70D1E68FE63520EFE0BC9 /* cfstream_handle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cfstream_handle.h; path = src/core/lib/iomgr/cfstream_handle.h; sourceTree = ""; }; + 49050E1701CC08C83C08697F645358E6 /* FIRFirestore.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFirestore.mm; path = Firestore/Source/API/FIRFirestore.mm; sourceTree = ""; }; + 49164116CB43D8D4FDDF652EC9E0B6EB /* parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = parser.h; path = src/core/lib/http/parser.h; sourceTree = ""; }; + 494466C1F3B2173F87F7A06D335021FC /* pcy_lib.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_lib.c; path = src/crypto/x509v3/pcy_lib.c; sourceTree = ""; }; + 494B5FDC07A2EAFAF88CEAAFC0064DE1 /* compare.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compare.h; path = absl/types/compare.h; sourceTree = ""; }; + 4992652E6E36FA640AE080039A589DE5 /* FBLPromiseError.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBLPromiseError.h; path = Sources/FBLPromises/include/FBLPromiseError.h; sourceTree = ""; }; + 49CCF8A64C5BDB15A5BF1062196A5959 /* curve25519_64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = curve25519_64.h; path = src/third_party/fiat/curve25519_64.h; sourceTree = ""; }; + 49D0032E07F75A07B74B862502700F05 /* mul.c */ = {isa = PBXFileReference; includeInIndex = 1; name = mul.c; path = src/crypto/fipsmodule/bn/mul.c; sourceTree = ""; }; + 49E11B75F61BF294392D1DF088D66C4A /* backend_metric.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = backend_metric.cc; path = src/core/ext/filters/client_channel/backend_metric.cc; sourceTree = ""; }; + 49E63A1B0B7D97A30E89DE05BB773936 /* address.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = address.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h"; sourceTree = ""; }; + 49FA7F6A73A16F636A0662F53BC1FE52 /* tls.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls.h; path = src/core/lib/gpr/tls.h; sourceTree = ""; }; + 4A37C441D777E90C6764BF3834EA1B75 /* alts_frame_protector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_frame_protector.h; path = src/core/tsi/alts/frame_protector/alts_frame_protector.h; sourceTree = ""; }; + 4A3899B023FABB06DCC73CC4AD4F4605 /* arena.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arena.h; path = src/core/lib/gpr/arena.h; sourceTree = ""; }; + 4A3F7B0603946255579608E98726D52B /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/core/ext/transport/chttp2/transport/internal.h; sourceTree = ""; }; + 4A479BD75DC8232A10102C9CF863F3B6 /* chttp2_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_server.h; path = src/core/ext/transport/chttp2/server/chttp2_server.h; sourceTree = ""; }; + 4A5FEFACE1AA855021F2464F98B76C77 /* slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice.h; path = include/grpc/impl/codegen/slice.h; sourceTree = ""; }; + 4A6402D7673B28ADD5BACFD6E7736EF8 /* alts_grpc_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h; sourceTree = ""; }; + 4A6BA8F1D6B4002E7BC3FABF863B280A /* alts_record_protocol_crypter_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_record_protocol_crypter_common.h; path = src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h; sourceTree = ""; }; + 4A6F04C0C1936C195A8E0877BBAC5E6E /* x509cset.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509cset.c; path = src/crypto/x509/x509cset.c; sourceTree = ""; }; + 4A8A2CDF6BEB3571DC25A01CCB30A869 /* zone_info_source.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = zone_info_source.cc; path = absl/time/internal/cctz/src/zone_info_source.cc; sourceTree = ""; }; + 4A9327117A99BCD5D2460B6ADDD974E7 /* float_conversion.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = float_conversion.cc; path = absl/strings/internal/str_format/float_conversion.cc; sourceTree = ""; }; + 4A9BA2F1E9E5133693F4542C7F2C17B5 /* struct.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = struct.nanopb.cc; path = Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc; sourceTree = ""; }; + 4AB52674FB7A979DD7A36DE61C1031E8 /* stl_type_traits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stl_type_traits.h; path = absl/strings/internal/stl_type_traits.h; sourceTree = ""; }; + 4ACAB14168EBA607BB36A3359A4A23CA /* time_zone_format.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_format.cc; path = absl/time/internal/cctz/src/time_zone_format.cc; sourceTree = ""; }; + 4AD945AEB20B9646F00E10101EE68B31 /* FIRWriteBatch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRWriteBatch.h; path = Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h; sourceTree = ""; }; + 4B472C585FF3AFE6DA27A2D064C8B019 /* alts_grpc_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h; sourceTree = ""; }; + 4B4E231879E11FB540084EF21BDC2495 /* GoogleDataTransport-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleDataTransport-Info.plist"; sourceTree = ""; }; + 4B604EACDD1CC69A4D9074C6B9A40397 /* codegen_init.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = codegen_init.cc; path = src/cpp/codegen/codegen_init.cc; sourceTree = ""; }; + 4B758CA3A10F0A530AB2F8EF69605B78 /* http_uri.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_uri.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h"; sourceTree = ""; }; + 4B83A3D9C9B0C5A54EE3E4C557831D9F /* p_x25519.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_x25519.c; path = src/crypto/evp/p_x25519.c; sourceTree = ""; }; + 4BC45A9314A6A47E4ED1ED2E268675EE /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/internal.h; sourceTree = ""; }; + 4BEADCEEB9596C01212F566358BBFD9B /* firebasecore.nanopb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = firebasecore.nanopb.c; path = Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c; sourceTree = ""; }; + 4C230BB84FAD9936159B061CA51C52C3 /* FIRDocumentReference.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDocumentReference.h; path = Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h; sourceTree = ""; }; + 4C29C9928D15DDD75348B863CB3438B9 /* per_thread_sem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = per_thread_sem.h; path = absl/synchronization/internal/per_thread_sem.h; sourceTree = ""; }; + 4C7412EC9D0EE1569D8FB28942FB7014 /* FirebaseCore.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseCore.release.xcconfig; sourceTree = ""; }; + 4C75E9F8F29FED1DFA8A55DD8C04464C /* GDTCOREvent+GDTCCTSupport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "GDTCOREvent+GDTCCTSupport.h"; path = "GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h"; sourceTree = ""; }; + 4C80EFEA0137B3537C4392910BD6EF74 /* channel_stack_type.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack_type.h; path = src/core/lib/surface/channel_stack_type.h; sourceTree = ""; }; + 4C82291FEEAA7FF8E6C5EC9B97B0CF94 /* thread_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_annotations.h; path = absl/base/internal/thread_annotations.h; sourceTree = ""; }; + 4C959F6F19FC96C3E56B0C86325687B0 /* ossl_typ.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ossl_typ.h; path = src/include/openssl/ossl_typ.h; sourceTree = ""; }; + 4D2391EFEA1878086C6B9C2D265FF4E8 /* timeout_encoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timeout_encoding.h; path = src/core/lib/transport/timeout_encoding.h; sourceTree = ""; }; + 4D6115E6A018F3CBC8D219F1BCC5CB93 /* FIRAppInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppInternal.h; path = FirebaseCore/Sources/Private/FIRAppInternal.h; sourceTree = ""; }; + 4D73A5F99FD2ABE54446CCEC00A50062 /* windows_logger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = windows_logger.h; path = util/windows_logger.h; sourceTree = ""; }; + 4DAB80ABFC5C5709021BC0268A3CA1CE /* serialization_traits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = serialization_traits.h; path = include/grpcpp/impl/serialization_traits.h; sourceTree = ""; }; + 4DAFC643797D95E0605BE608B76B2B51 /* FIRHeartbeatInfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRHeartbeatInfo.h; path = FirebaseCore/Sources/Private/FIRHeartbeatInfo.h; sourceTree = ""; }; + 4DF43BFDCDC776BB52EE90CFA9A9C009 /* write_batch_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = write_batch_internal.h; path = db/write_batch_internal.h; sourceTree = ""; }; + 4DF90DAA0A2C3DBCDA90B16A2A0C3BD3 /* hard_assert.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hard_assert.cc; path = Firestore/core/src/util/hard_assert.cc; sourceTree = ""; }; + 4E0F85E01AC964655BCE72E2314B9B7A /* deprecation.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = deprecation.upb.h; path = "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h"; sourceTree = ""; }; + 4E176B80E8DC80BA18C0578389844C65 /* NSURLSession+GULPromises.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSURLSession+GULPromises.h"; path = "GoogleUtilities/Environment/Public/GoogleUtilities/NSURLSession+GULPromises.h"; sourceTree = ""; }; + 4E1B19D1B778FB9E04A9A994382EC36A /* evp_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = evp_asn1.c; path = src/crypto/evp/evp_asn1.c; sourceTree = ""; }; + 4E31D1C1A5A47DBC716FC276D230DA13 /* alts_handshaker_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_handshaker_client.h; path = src/core/tsi/alts/handshaker/alts_handshaker_client.h; sourceTree = ""; }; + 4E4438A2B9802CC7625F45E0908E6C21 /* useful.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = useful.h; path = src/core/lib/gpr/useful.h; sourceTree = ""; }; + 4E534C292BA659A547693A54D89C2852 /* nanopb-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "nanopb-Info.plist"; sourceTree = ""; }; + 4E5623848221A6B06BC7A9620EDB87BB /* load_system_roots_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = load_system_roots_linux.cc; path = src/core/lib/security/security_connector/load_system_roots_linux.cc; sourceTree = ""; }; + 4E7CF74A9BFE198D6BEF3FFAA3072809 /* socket_utils_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_utils_posix.cc; path = src/core/lib/iomgr/socket_utils_posix.cc; sourceTree = ""; }; + 4EA38BA2CF7F0A304CA28CAB63CF71A2 /* resource.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource.upb.h; path = "src/core/ext/upb-generated/envoy/annotations/resource.upb.h"; sourceTree = ""; }; + 4ED6D8ADC39B484F485E571BE759FD27 /* no_destructor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = no_destructor.h; path = util/no_destructor.h; sourceTree = ""; }; + 4EEFEACB2009276482A111DA74E51FBE /* abseil.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abseil.release.xcconfig; sourceTree = ""; }; + 4EF0EA5F6C234102A14DDF0969DE4782 /* error_cfstream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_cfstream.h; path = src/core/lib/iomgr/error_cfstream.h; sourceTree = ""; }; + 4EF388BD65063707AE61C66938C357D2 /* health_check_service_server_builder_option.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = health_check_service_server_builder_option.cc; path = src/cpp/server/health/health_check_service_server_builder_option.cc; sourceTree = ""; }; + 4F1767B8DEDAC5E0A9A1E40584567EFE /* pem_x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_x509.c; path = src/crypto/pem/pem_x509.c; sourceTree = ""; }; + 4F18534FF4B75EC164C841BA60034DB3 /* thread_pool_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_pool_interface.h; path = src/cpp/server/thread_pool_interface.h; sourceTree = ""; }; + 4F2A658368ACBCF2310386D030BB10C5 /* port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port.h; path = port/port.h; sourceTree = ""; }; + 4F3A0D48D2B8FCA94C74995983F04877 /* string_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_windows.h; path = src/core/lib/gpr/string_windows.h; sourceTree = ""; }; + 4F5E15B63F67BBA53335FC08BFD95FA9 /* regex.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = regex.upb.c; path = "src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c"; sourceTree = ""; }; + 4F695A271D87C982FCB797831B8C4A5B /* completion_queue_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = completion_queue_cc.cc; path = src/cpp/common/completion_queue_cc.cc; sourceTree = ""; }; + 4F6FF34929322FE8870E7BDBF6A05982 /* tcp_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_custom.cc; path = src/core/lib/iomgr/tcp_custom.cc; sourceTree = ""; }; + 4F759296B3B0DA0A5116AC02E65CCB7F /* regex.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = regex.upb.h; path = "src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h"; sourceTree = ""; }; + 4F8D6D110F13BC605F984AB7CD8D06FD /* sign.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sign.c; path = src/crypto/evp/sign.c; sourceTree = ""; }; + 4F9842D7843EDC209B57E48DAF7DFB2A /* bad_optional_access.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bad_optional_access.h; path = absl/types/bad_optional_access.h; sourceTree = ""; }; + 4F9B0ADF610133D2CEF1CFA4A1562583 /* a_verify.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_verify.c; path = src/crypto/x509/a_verify.c; sourceTree = ""; }; + 4FAB7538814660A314E9C038CE70E37B /* oauth2_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = oauth2_credentials.h; path = src/core/lib/security/credentials/oauth2/oauth2_credentials.h; sourceTree = ""; }; + 4FB54186D0B4D570D66E19742CBB6FD4 /* async_generic_service.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = async_generic_service.cc; path = src/cpp/server/async_generic_service.cc; sourceTree = ""; }; + 4FC743841BB9DE5F288C23DF81AA50CB /* string_view.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_view.cc; path = absl/strings/string_view.cc; sourceTree = ""; }; + 4FC7512E0ACDD7CD8B912B01507B9BC8 /* thread_identity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_identity.h; path = absl/base/internal/thread_identity.h; sourceTree = ""; }; + 4FC8EF4B7A4D3FBA96EBB69A2F992A7F /* tcp_server_utils_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_server_utils_posix.h; path = src/core/lib/iomgr/tcp_server_utils_posix.h; sourceTree = ""; }; + 4FE1F4833D4B78AB84329C8A1CB20104 /* target_authority_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = target_authority_table.h; path = src/core/lib/security/transport/target_authority_table.h; sourceTree = ""; }; + 4FF14D280C4F0FA3B55181E7ACB9FF8B /* init.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = init.h; path = src/core/lib/surface/init.h; sourceTree = ""; }; + 4FF22BA39780F38686297704E9D7D2DA /* FBLPromise+Reduce.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Reduce.m"; path = "Sources/FBLPromises/FBLPromise+Reduce.m"; sourceTree = ""; }; + 4FFDDB0D890246CB3926154DCADDC6F1 /* fake_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_credentials.h; path = src/core/lib/security/credentials/fake/fake_credentials.h; sourceTree = ""; }; + 502090062BA80C2295236121A94D524E /* inproc_transport.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = inproc_transport.cc; path = src/core/ext/transport/inproc/inproc_transport.cc; sourceTree = ""; }; + 5034F97F9A2B13E06BE0A669458D2B43 /* stream_compression_identity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream_compression_identity.cc; path = src/core/lib/compression/stream_compression_identity.cc; sourceTree = ""; }; + 50611EEE6D727D95433EDE3CDB41271F /* time_precise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_precise.h; path = src/core/lib/gpr/time_precise.h; sourceTree = ""; }; + 508D71FF61612BB5C3FEFFA0245D5903 /* FIRDocumentSnapshot.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDocumentSnapshot.h; path = Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h; sourceTree = ""; }; + 50A491CEE1281637FF354DA1FB129D38 /* asn1_compat.c */ = {isa = PBXFileReference; includeInIndex = 1; name = asn1_compat.c; path = src/crypto/bytestring/asn1_compat.c; sourceTree = ""; }; + 50A5D9A5D83F8A6CCD571DDCF2D31672 /* urandom.c */ = {isa = PBXFileReference; includeInIndex = 1; name = urandom.c; path = src/crypto/fipsmodule/rand/urandom.c; sourceTree = ""; }; + 50B4530602F8485407D82E1D91F5ECF4 /* str_split.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = str_split.cc; path = absl/strings/str_split.cc; sourceTree = ""; }; + 50E29D7755C2F7766A92793F1EA8D6FA /* tls_pthread.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_pthread.cc; path = src/core/lib/gpr/tls_pthread.cc; sourceTree = ""; }; + 50F386007ACFF3B0112187AAC1AE463A /* subchannel_pool_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_pool_interface.h; path = src/core/ext/filters/client_channel/subchannel_pool_interface.h; sourceTree = ""; }; + 511739E7E7C1E7FC6C57CD61A8F794D4 /* exec_ctx.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = exec_ctx.h; path = src/core/lib/iomgr/exec_ctx.h; sourceTree = ""; }; + 511AF504B3810F4058878C1F36AC6C54 /* v3_conf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_conf.c; path = src/crypto/x509v3/v3_conf.c; sourceTree = ""; }; + 511ED73A162181E1F436509BD4A86D64 /* GDTCORTransformer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORTransformer.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer.h; sourceTree = ""; }; + 513D3BB34A524F46BBB36B3D17B35E87 /* sorted_container.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sorted_container.cc; path = Firestore/core/src/immutable/sorted_container.cc; sourceTree = ""; }; + 514D7742C6CBB0BDBD9984AEE97DDFDE /* BoringSSL-GRPC */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "BoringSSL-GRPC"; path = openssl_grpc.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 514E2C59522D6EB944CE7EC8CB687149 /* c.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = c.h; path = include/leveldb/c.h; sourceTree = ""; }; + 515DE99E1A2781FD19819BB61560931C /* subchannel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel.h; path = src/core/ext/filters/client_channel/subchannel.h; sourceTree = ""; }; + 518BCC9BA5A8A2E47689691FB7BC8DD9 /* x509v3.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = x509v3.h; path = src/include/openssl/x509v3.h; sourceTree = ""; }; + 51AFAA98EFF7906A36AC33D982A0C6B2 /* leveldb_transaction.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_transaction.cc; path = Firestore/core/src/local/leveldb_transaction.cc; sourceTree = ""; }; + 51BE2D3DD1DD4E8DD1B5D1DDC0F9F310 /* blocking_counter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = blocking_counter.h; path = absl/synchronization/blocking_counter.h; sourceTree = ""; }; + 51C721B724E5E995C8911EB0238842E6 /* config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = config.h; path = include/grpcpp/impl/codegen/config.h; sourceTree = ""; }; + 51EABC598FE1CA74FD6A098E118FC6D7 /* FIRHeartbeatInfo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRHeartbeatInfo.m; path = FirebaseCore/Sources/FIRHeartbeatInfo.m; sourceTree = ""; }; + 51FB1A769C688D0A641D42290CEEB1C7 /* avl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = avl.h; path = src/core/lib/avl/avl.h; sourceTree = ""; }; + 5227BEA7F5786F7260DC6621A2E8890E /* subchannel_pool_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_pool_interface.h; path = src/core/ext/filters/client_channel/subchannel_pool_interface.h; sourceTree = ""; }; + 522D7AF891819896D31BDC12A4134FD9 /* transport.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transport.cc; path = src/core/lib/transport/transport.cc; sourceTree = ""; }; + 525C9EB44877774F6C84793E5D9D5E1B /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/cipher/internal.h; sourceTree = ""; }; + 5268762131A530F53A0F5204E3F8A2C1 /* http_connect_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_connect_handshaker.h; path = src/core/ext/filters/client_channel/http_connect_handshaker.h; sourceTree = ""; }; + 527B0E3FDE01E7A23AF4B743981950B7 /* grpc_alts_credentials_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_alts_credentials_options.h; path = src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h; sourceTree = ""; }; + 529FFBD228E87DBA888ED9C5ECD2B492 /* tsan_mutex_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tsan_mutex_interface.h; path = absl/base/internal/tsan_mutex_interface.h; sourceTree = ""; }; + 52AD23F2AB0C25B54942E69032F7E604 /* pool.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pool.c; path = src/crypto/pool/pool.c; sourceTree = ""; }; + 52B1AF67D5F20D6B078793E5785FC1C9 /* Pods-SaraAttended.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SaraAttended.modulemap"; sourceTree = ""; }; + 52B8FE9BAC48B868A9C5A01E67633192 /* route_components.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = route_components.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c"; sourceTree = ""; }; + 52BA331001F77169CEFADCBB9A58C02B /* stub_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stub_options.h; path = include/grpcpp/impl/codegen/stub_options.h; sourceTree = ""; }; + 52C8327E12F9D095F285A2CDAAB9ED4A /* tls13_both.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls13_both.cc; path = src/ssl/tls13_both.cc; sourceTree = ""; }; + 52D04F00250DA3B85F9DFF84A81E710D /* empty.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = empty.upb.h; path = "src/core/ext/upb-generated/google/protobuf/empty.upb.h"; sourceTree = ""; }; + 52E4F31901D668E026F8F75AEB5FEB08 /* alloc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alloc.cc; path = src/core/lib/gpr/alloc.cc; sourceTree = ""; }; + 52F81BD932E7877CF6129978D9768500 /* generated_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = generated_util.h; path = third_party/upb/upb/generated_util.h; sourceTree = ""; }; + 532F31967448B9FCDD457AC17BEAC2BE /* deadline_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = deadline_filter.h; path = src/core/ext/filters/deadline/deadline_filter.h; sourceTree = ""; }; + 5337A65C10583FAF2537A6BE2B0D285C /* FIRComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponent.h; path = FirebaseCore/Sources/Private/FIRComponent.h; sourceTree = ""; }; + 533966E56E7DAF10FFF1D26104B75F33 /* transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport.h; path = src/core/lib/transport/transport.h; sourceTree = ""; }; + 5350E42C1AA2174B8763D80AA5DE7721 /* load_report.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = load_report.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c"; sourceTree = ""; }; + 536FAD0A306763D48380064D60D93127 /* grpclb_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb_channel.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h; sourceTree = ""; }; + 53841BC6166418C9ABD7280C47B2F7FF /* FIRAppAssociationRegistration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppAssociationRegistration.h; path = FirebaseCore/Sources/FIRAppAssociationRegistration.h; sourceTree = ""; }; + 53BB379AA11E9D6252032FACF7A58092 /* tls_gcc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_gcc.h; path = src/core/lib/gpr/tls_gcc.h; sourceTree = ""; }; + 53EB4885FA802E30127217CAF0C6E262 /* global_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config.h; path = src/core/lib/gprpp/global_config.h; sourceTree = ""; }; + 5400FA5634EA7A0E83B7D07CF8CA5C4E /* bind.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bind.cc; path = absl/strings/internal/str_format/bind.cc; sourceTree = ""; }; + 540B135F8C7CDC06240F239A59FE9F4E /* mpmcqueue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mpmcqueue.cc; path = src/core/lib/iomgr/executor/mpmcqueue.cc; sourceTree = ""; }; + 542B89F0F1ACA3CCA3440851F31ABAA6 /* shift.c */ = {isa = PBXFileReference; includeInIndex = 1; name = shift.c; path = src/crypto/fipsmodule/bn/shift.c; sourceTree = ""; }; + 542C4EF5C2D25D913A7482A7635E83CC /* ssl_versions.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_versions.cc; path = src/ssl/ssl_versions.cc; sourceTree = ""; }; + 5430FC95560439093E2D2C2BB90FC129 /* cpu-aarch64-linux.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-aarch64-linux.c"; path = "src/crypto/cpu-aarch64-linux.c"; sourceTree = ""; }; + 54322520C1C7EC65A9B03907FB292FE1 /* timestamp.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = timestamp.upb.c; path = "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c"; sourceTree = ""; }; + 545D5F31F3173DFD099A6DF4F5F8A71D /* string_ref.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_ref.cc; path = src/cpp/util/string_ref.cc; sourceTree = ""; }; + 5480A47E68C11A33DA5E6CBFC3B84936 /* local_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_security_connector.h; path = src/core/lib/security/security_connector/local/local_security_connector.h; sourceTree = ""; }; + 5491A1C01349E2714B8B961E419ED8C3 /* http_uri.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = http_uri.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c"; sourceTree = ""; }; + 549A0A129267757E88C3B9BBF72B3891 /* transport_security_grpc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transport_security_grpc.cc; path = src/core/tsi/transport_security_grpc.cc; sourceTree = ""; }; + 54B00FA0E63AB41FCAB76B9D4296A785 /* ev_epollex_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_epollex_linux.h; path = src/core/lib/iomgr/ev_epollex_linux.h; sourceTree = ""; }; + 54CEC49A03FA699140C9622FF53874E8 /* d1_pkt.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = d1_pkt.cc; path = src/ssl/d1_pkt.cc; sourceTree = ""; }; + 54E070948B2D59D3403B8E604EDBDB67 /* per_thread_sem.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = per_thread_sem.cc; path = absl/synchronization/internal/per_thread_sem.cc; sourceTree = ""; }; + 54ED8DC48179740D4B09CD387DD75A80 /* v3_pcia.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_pcia.c; path = src/crypto/x509v3/v3_pcia.c; sourceTree = ""; }; + 54F2A42B4B79396E756DCBB00FC730A4 /* frame_handler.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_handler.cc; path = src/core/tsi/alts/frame_protector/frame_handler.cc; sourceTree = ""; }; + 5518FAF1F576E58EFB99A2A9F0E62AE2 /* conf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = conf.h; path = src/include/openssl/conf.h; sourceTree = ""; }; + 555C36FF5396C3B28EDB6B6AC7529F1A /* xds.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds.h; path = src/core/ext/filters/client_channel/lb_policy/xds/xds.h; sourceTree = ""; }; + 5580998A6B3829A4D28D26D312CAD55E /* mode_wrappers.c */ = {isa = PBXFileReference; includeInIndex = 1; name = mode_wrappers.c; path = src/crypto/fipsmodule/aes/mode_wrappers.c; sourceTree = ""; }; + 559140FD3540DD8045409E14748899F3 /* resolve_address.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolve_address.cc; path = src/core/lib/iomgr/resolve_address.cc; sourceTree = ""; }; + 55AA3FA7CCA5A2DD4F2CC561B6CDFD10 /* tmpfile.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tmpfile.h; path = src/core/lib/gpr/tmpfile.h; sourceTree = ""; }; + 55B27282DD7E25E54C56EA43C3EB7C2D /* stacktrace.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stacktrace.cc; path = absl/debugging/stacktrace.cc; sourceTree = ""; }; + 55D585EE92D5882AC28F9B12C6E3FE0F /* channel_trace.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_trace.cc; path = src/core/lib/channel/channel_trace.cc; sourceTree = ""; }; + 55E380F447B00CF092B74F18F0CB691C /* address.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = address.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c"; sourceTree = ""; }; + 560E9A1167F4EEF8C1F655734DFC88EF /* context_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = context_list.h; path = src/core/ext/transport/chttp2/transport/context_list.h; sourceTree = ""; }; + 56128B9E72A3BDB53287DCFF002BEAB8 /* crc32c.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = crc32c.cc; path = util/crc32c.cc; sourceTree = ""; }; + 5612F1A4C41C0FEEE7A43EF9BD4D16AD /* logging.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = logging.cc; path = util/logging.cc; sourceTree = ""; }; + 561C73C1E83BD2580E9141F5AEF08ECA /* alts_tsi_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_handshaker.h; path = src/core/tsi/alts/handshaker/alts_tsi_handshaker.h; sourceTree = ""; }; + 5636BE4349FD1A8E5FD081A5B1B0F2AC /* auth_filters.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_filters.h; path = src/core/lib/security/transport/auth_filters.h; sourceTree = ""; }; + 5646E592BBAC6854FA2A9E247B330FC6 /* wrappers.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = wrappers.upb.c; path = "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c"; sourceTree = ""; }; + 5650C58CEC45512D23502D6789F4656F /* channelz_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channelz_registry.h; path = src/core/lib/channel/channelz_registry.h; sourceTree = ""; }; + 5680DD2CE8D36A8B0DDFDACC0CCD8CF9 /* dynamic_thread_pool.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dynamic_thread_pool.cc; path = src/cpp/server/dynamic_thread_pool.cc; sourceTree = ""; }; + 568BB452E0A2B0830B807E2D9DB447B8 /* escaping.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = escaping.cc; path = absl/strings/escaping.cc; sourceTree = ""; }; + 56946162EAC440276805FE8F569C7181 /* FBLPromise+Validate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Validate.m"; path = "Sources/FBLPromises/FBLPromise+Validate.m"; sourceTree = ""; }; + 56A5ED8B90D19F65FB85B63F6A3ED587 /* health_check_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check_client.h; path = src/core/ext/filters/client_channel/health/health_check_client.h; sourceTree = ""; }; + 56CE689280D7E03B26BB86F56687B2B5 /* v3_bitst.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_bitst.c; path = src/crypto/x509v3/v3_bitst.c; sourceTree = ""; }; + 57165CAEB8D8587D8856ABC4F7664C01 /* port_stdcxx.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port_stdcxx.h; path = port/port_stdcxx.h; sourceTree = ""; }; + 5725B9C930213912511C259F55BE9149 /* write_stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = write_stream.cc; path = Firestore/core/src/remote/write_stream.cc; sourceTree = ""; }; + 5732F2A90FB96DDE7C876A7831FA6772 /* altscontext.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = altscontext.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h"; sourceTree = ""; }; + 5736CCB1D8190AC29D63010FEED81666 /* status.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.h; path = include/grpcpp/impl/codegen/status.h; sourceTree = ""; }; + 575051F96A719458A3D42D0FD4564277 /* transport_security_common.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = transport_security_common.upb.c; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c"; sourceTree = ""; }; + 575F8E5E4BEA92C01819BC7BE61B4344 /* md5.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = md5.h; path = src/include/openssl/md5.h; sourceTree = ""; }; + 577DDF8D288CD6D3EDE27C74879CDF78 /* string_ref.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_ref.h; path = include/grpcpp/support/string_ref.h; sourceTree = ""; }; + 577EF0CDF949EAE1A987FB96D71A2CCA /* status.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status.cc; path = Firestore/core/src/util/status.cc; sourceTree = ""; }; + 578BA6C09B305AB6F8451B48B88B4D8C /* frame_rst_stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_rst_stream.cc; path = src/core/ext/transport/chttp2/transport/frame_rst_stream.cc; sourceTree = ""; }; + 57B4458BF9F1A2D02C13CADB33FD9FA2 /* t_crl.c */ = {isa = PBXFileReference; includeInIndex = 1; name = t_crl.c; path = src/crypto/x509/t_crl.c; sourceTree = ""; }; + 57E9B635D0E7623DDA13073D9549921C /* vdso_support.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = vdso_support.h; path = absl/debugging/internal/vdso_support.h; sourceTree = ""; }; + 583465E0891F13EE0E35B79A88B240F0 /* sync_stream_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_stream_impl.h; path = include/grpcpp/support/sync_stream_impl.h; sourceTree = ""; }; + 5837FC87F631F4B0B42612D6362B36BF /* escaping.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = escaping.h; path = absl/strings/internal/escaping.h; sourceTree = ""; }; + 585EBA7BE3A68C247364F6F5F9F1AD0B /* algorithm_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = algorithm_metadata.h; path = src/core/lib/compression/algorithm_metadata.h; sourceTree = ""; }; + 5877DD34B3544A592E2E4FBC1D5DCAD0 /* load_balancer_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_balancer_api.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h; sourceTree = ""; }; + 587A45D33DC5F9425E154A513740E58B /* x509name.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509name.c; path = src/crypto/x509/x509name.c; sourceTree = ""; }; + 58AC4CB66FCA222DAF660FEF972FE3A1 /* ssl_asn1.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_asn1.cc; path = src/ssl/ssl_asn1.cc; sourceTree = ""; }; + 58C239FC8F94B514BB08EEAB2C2A1466 /* xds_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_channel.h; path = src/core/ext/filters/client_channel/xds/xds_channel.h; sourceTree = ""; }; + 58CACAF80EED157C4169DE2E44250500 /* tcp_server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server.cc; path = src/core/lib/iomgr/tcp_server.cc; sourceTree = ""; }; + 591AE1DA172C6929AB0FBCE60B206124 /* host_port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = host_port.h; path = src/core/lib/gprpp/host_port.h; sourceTree = ""; }; + 593290B58B1DDA02987788CE5DEF7F01 /* local_subchannel_pool.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_subchannel_pool.cc; path = src/core/ext/filters/client_channel/local_subchannel_pool.cc; sourceTree = ""; }; + 593854392CD23606E2DCE099FD766A02 /* create_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_channel.h; path = include/grpcpp/create_channel.h; sourceTree = ""; }; + 593F0B894480261EB6B865EA99EF9506 /* security_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_context.h; path = src/core/lib/security/context/security_context.h; sourceTree = ""; }; + 595FA36719EBBEB254EF8CB5A5417DF6 /* FirebaseCoreDiagnostics.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseCoreDiagnostics.debug.xcconfig; sourceTree = ""; }; + 5964F286971D3E312DA8B219F8E02E3C /* abseil-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "abseil-Info.plist"; sourceTree = ""; }; + 5999A20E76BDF907D48C63820256F450 /* local_transport_security.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_transport_security.cc; path = src/core/tsi/local_transport_security.cc; sourceTree = ""; }; + 59B49F118C6CE5A72F34DEC83533A761 /* FIRLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLogger.h; path = FirebaseCore/Sources/Private/FIRLogger.h; sourceTree = ""; }; + 59BE8FCCD6F11C97F01F3A68EE0A1598 /* Pods-SaraAttended-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SaraAttended-dummy.m"; sourceTree = ""; }; + 59D6F2653E8BCAC060CB891007E2BF48 /* memory_index_manager.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_index_manager.cc; path = Firestore/core/src/local/memory_index_manager.cc; sourceTree = ""; }; + 59DB88C88B95ECB02BC87A27D8EFF9B5 /* rsa.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsa.c; path = src/crypto/fipsmodule/rsa/rsa.c; sourceTree = ""; }; + 59F75AF17377ECCE99C3B2A941C6000B /* GoogleUtilities.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleUtilities.release.xcconfig; sourceTree = ""; }; + 59FDA70766A600F09B7EC7EA98A17C66 /* asn1_par.c */ = {isa = PBXFileReference; includeInIndex = 1; name = asn1_par.c; path = src/crypto/asn1/asn1_par.c; sourceTree = ""; }; + 5A21288CE7FD248E5937A1691F1F6B1A /* atm_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_windows.h; path = include/grpc/support/atm_windows.h; sourceTree = ""; }; + 5A4083889D69AAA6415523B376A782C5 /* timers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timers.h; path = src/core/lib/profiling/timers.h; sourceTree = ""; }; + 5A6DFE52D3AA115674B62CB17C7F1AA7 /* arg.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arg.h; path = absl/strings/internal/str_format/arg.h; sourceTree = ""; }; + 5A7F1F93DF989DA34F744C4EB2B4A362 /* debug_location.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = debug_location.h; path = src/core/lib/gprpp/debug_location.h; sourceTree = ""; }; + 5A9D2FD971EA50C4B5B04E83C97609A4 /* check_gcp_environment_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = check_gcp_environment_linux.cc; path = src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc; sourceTree = ""; }; + 5A9E2CAC4D607565A22567FB93A269E0 /* errno_saver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = errno_saver.h; path = absl/base/internal/errno_saver.h; sourceTree = ""; }; + 5AB2E69E5DB61D8356BFEA7C7E53BA43 /* grpc_tls_credentials_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_tls_credentials_options.h; path = src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h; sourceTree = ""; }; + 5AE4EBC6D1F8771BEAAD41C611E60245 /* is_epollexclusive_available.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = is_epollexclusive_available.h; path = src/core/lib/iomgr/is_epollexclusive_available.h; sourceTree = ""; }; + 5AEDDB7052DD395CD4E4EBFCC0DED63A /* casts.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = casts.h; path = absl/base/casts.h; sourceTree = ""; }; + 5AF1BFE885DC98B707F2D7B123D87B05 /* resolving_lb_policy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolving_lb_policy.h; path = src/core/ext/filters/client_channel/resolving_lb_policy.h; sourceTree = ""; }; + 5B057FBCF7405CACAA8807CE25EBED87 /* GDTCORUploadBatch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORUploadBatch.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadBatch.h; sourceTree = ""; }; + 5B063DBA267CCBF3589F709A1C0737DC /* workaround_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = workaround_utils.h; path = src/core/ext/filters/workarounds/workaround_utils.h; sourceTree = ""; }; + 5B072266F91315365F609A1AD22E0851 /* FBLPromises.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBLPromises.h; path = Sources/FBLPromises/include/FBLPromises.h; sourceTree = ""; }; + 5B197D3F3E30BFE2DCA76A1594E9F681 /* v3_skey.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_skey.c; path = src/crypto/x509v3/v3_skey.c; sourceTree = ""; }; + 5B3A3153CE6675A91D4DB4C46DA9EDF4 /* fork.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fork.h; path = include/grpc/impl/codegen/fork.h; sourceTree = ""; }; + 5B47194B7BDA928B8060159E5985E3A0 /* v3_int.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_int.c; path = src/crypto/x509v3/v3_int.c; sourceTree = ""; }; + 5B55226C83EA202B83BDB45C3DBF7D4C /* grpc_service.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_service.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h"; sourceTree = ""; }; + 5B9744E060D64452ED6339052B6AB4D0 /* listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener.upb.h"; sourceTree = ""; }; + 5BB8119AC82C3D44A53FEE3EEFC9B815 /* byte_stream_cpp.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_stream_cpp.cc; path = Firestore/core/src/util/byte_stream_cpp.cc; sourceTree = ""; }; + 5BE35EF523E5713C7DC02E3074BAD1EA /* alts_grpc_record_protocol_common.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_grpc_record_protocol_common.cc; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc; sourceTree = ""; }; + 5BEA5E74CFEE66ED0688BAD4176E42C9 /* child_policy_handler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = child_policy_handler.h; path = src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h; sourceTree = ""; }; + 5C10A22C20AE618E70785E07CFF47B12 /* tcp_client_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_client_posix.h; path = src/core/lib/iomgr/tcp_client_posix.h; sourceTree = ""; }; + 5C160A8AF03BE920E0B92B72393912B5 /* memory_bundle_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_bundle_cache.cc; path = Firestore/core/src/local/memory_bundle_cache.cc; sourceTree = ""; }; + 5C26E71E0BC45D4DBDEB1695B8899FBB /* status_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_util.h; path = src/core/lib/channel/status_util.h; sourceTree = ""; }; + 5C65B3BC901262AF531DBC49307EFCFD /* FBLPromise+Any.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Any.m"; path = "Sources/FBLPromises/FBLPromise+Any.m"; sourceTree = ""; }; + 5C76AAF707C9DCFD37E241EC010011B8 /* channel_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_filter.cc; path = src/cpp/common/channel_filter.cc; sourceTree = ""; }; + 5C77AF6EB4EA42AD0D875AC763515E4B /* server_callback_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_callback_impl.h; path = include/grpcpp/impl/codegen/server_callback_impl.h; sourceTree = ""; }; + 5C77EBAB7C9B6CA3B0440FE7AC464C2E /* varint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = varint.h; path = src/core/ext/transport/chttp2/transport/varint.h; sourceTree = ""; }; + 5C8505F921D4BFE5EC6C0C2FB4E9C45D /* string_ref.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_ref.h; path = include/grpcpp/impl/codegen/string_ref.h; sourceTree = ""; }; + 5C98E238F3BDDE0190425CE3014F5505 /* listener.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = listener.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/listener.upb.c"; sourceTree = ""; }; + 5CB03E565CB23E05469C865350E8481E /* altscontext.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = altscontext.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h"; sourceTree = ""; }; + 5CBDF21A6B5663334396CACD280FE454 /* time_precise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_precise.h; path = src/core/lib/gpr/time_precise.h; sourceTree = ""; }; + 5CCBC26D6661F84EC915A3F121F83D06 /* completion_queue_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue_factory.h; path = src/core/lib/surface/completion_queue_factory.h; sourceTree = ""; }; + 5CCC5E5367E56F38BE20965915C41368 /* symbolize.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = symbolize.h; path = absl/debugging/symbolize.h; sourceTree = ""; }; + 5CCE6080690B7DA6DEDADE7D9C67318E /* barrier.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = barrier.cc; path = absl/synchronization/barrier.cc; sourceTree = ""; }; + 5CEE2544EAD92C850522C322F37533C1 /* x_req.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_req.c; path = src/crypto/x509/x_req.c; sourceTree = ""; }; + 5D1B4DC0068EB1EA0EE1ADB0F32EE0CF /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/rsa/internal.h; sourceTree = ""; }; + 5D3BE554095280180E5BD93BFA2ACCC2 /* ssl_session_boringssl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_session_boringssl.cc; path = src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc; sourceTree = ""; }; + 5D43DD5D3FE562A1974961EC0CBA7708 /* generic_stub_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = generic_stub_impl.h; path = include/grpcpp/generic/generic_stub_impl.h; sourceTree = ""; }; + 5D47BF6740ACC4E9C63CFB5E44D4B227 /* alarm.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alarm.cc; path = src/cpp/common/alarm.cc; sourceTree = ""; }; + 5D4AE9D3D75CFAEEC6D9B8369BA3A607 /* local_view_changes.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_view_changes.cc; path = Firestore/core/src/local/local_view_changes.cc; sourceTree = ""; }; + 5D5A9878981CB08FA8BCD48682D853D6 /* plugin_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = plugin_credentials.cc; path = src/core/lib/security/credentials/plugin/plugin_credentials.cc; sourceTree = ""; }; + 5D6302406E4AA0DF6A3C104B521ECBE9 /* global_subchannel_pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_subchannel_pool.h; path = src/core/ext/filters/client_channel/global_subchannel_pool.h; sourceTree = ""; }; + 5D6785BE81AE8168BC93D5294967FDB7 /* block.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = block.cc; path = table/block.cc; sourceTree = ""; }; + 5D77F9B38F3D78B3C8617AF8195B5915 /* log_reader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log_reader.h; path = db/log_reader.h; sourceTree = ""; }; + 5D80A7EDBE3547565F2D296355827193 /* sync_generic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_generic.h; path = include/grpc/impl/codegen/sync_generic.h; sourceTree = ""; }; + 5DEACF4A3D6CF15D0970F294F8570372 /* max_age_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = max_age_filter.h; path = src/core/ext/filters/max_age/max_age_filter.h; sourceTree = ""; }; + 5DF95D32DE32B398A176B60ACC5C7F26 /* ssl_utils_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_utils_config.h; path = src/core/lib/security/security_connector/ssl_utils_config.h; sourceTree = ""; }; + 5DFF21DE94A5E94BB5306A5FE74D66BE /* string_view.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_view.h; path = absl/strings/string_view.h; sourceTree = ""; }; + 5E08D3E6EEA1333970EB56302AF3E883 /* BoringSSL-GRPC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "BoringSSL-GRPC.debug.xcconfig"; sourceTree = ""; }; + 5E37DB0C1F4047AD767EC6194FAC8133 /* settings.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = settings.cc; path = Firestore/core/src/api/settings.cc; sourceTree = ""; }; + 5E416B6FFF01C2016265C480E859A8D3 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/digest/internal.h; sourceTree = ""; }; + 5E71D724C3E47B5F6B27A0D86265C45C /* transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security.h; path = src/core/tsi/transport_security.h; sourceTree = ""; }; + 5ED4CDF9DB6B970ECB686FFBB863545C /* sockaddr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr.h; path = src/core/lib/iomgr/sockaddr.h; sourceTree = ""; }; + 5F08DE081B01255064034E2AB6644A33 /* lb_policy.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = lb_policy.cc; path = src/core/ext/filters/client_channel/lb_policy.cc; sourceTree = ""; }; + 5F18E7687A7A6D07648D7178E09B2455 /* FBLPromise+Testing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Testing.h"; path = "Sources/FBLPromises/include/FBLPromise+Testing.h"; sourceTree = ""; }; + 5F5259DFB2A55854D10423172A45D1FE /* ssl_session.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_session.h; path = src/core/tsi/ssl/session_cache/ssl_session.h; sourceTree = ""; }; + 5F7B7B9E9DB84FB194521CD878F489E1 /* writer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = writer.cc; path = Firestore/core/src/nanopb/writer.cc; sourceTree = ""; }; + 5FBBA7ADE29FE86D71F484593F1D26E2 /* wrappers.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wrappers.upb.h; path = "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h"; sourceTree = ""; }; + 6008611CEF4CB9DBD49DABAD59E11A8E /* child_policy_handler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = child_policy_handler.h; path = src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h; sourceTree = ""; }; + 602C5A4FFD45F80D69045E02EF581931 /* alts_tsi_handshaker_private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_handshaker_private.h; path = src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h; sourceTree = ""; }; + 602E6064F0F2EB38B769534FFEA856CA /* time_zone_if.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_if.h; path = absl/time/internal/cctz/src/time_zone_if.h; sourceTree = ""; }; + 604057E13720363AB70882472915AB7F /* timestamp.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timestamp.nanopb.cc; path = Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc; sourceTree = ""; }; + 605D6A9E54961B971682B34C80F43763 /* FIRComponentContainer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponentContainer.h; path = FirebaseCore/Sources/Private/FIRComponentContainer.h; sourceTree = ""; }; + 606A72855987161C2401EA9E921AA06B /* executor.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = executor.cc; path = src/core/lib/iomgr/executor.cc; sourceTree = ""; }; + 60711FE87AF4AB20E84297D270C023B9 /* grpc_root_certificate_finder_generated.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_root_certificate_finder_generated.cc; path = Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc; sourceTree = ""; }; + 608520DF27379759B955051E218A4119 /* trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = trace.h; path = src/core/lib/debug/trace.h; sourceTree = ""; }; + 60AD273010453FE5738BCB00AFA98D79 /* check_gcp_environment.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = check_gcp_environment.cc; path = src/core/lib/security/credentials/alts/check_gcp_environment.cc; sourceTree = ""; }; + 60CAD879D8EACD61B88CCD724549E955 /* stacktrace_generic-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_generic-inl.inc"; path = "absl/debugging/internal/stacktrace_generic-inl.inc"; sourceTree = ""; }; + 60CBC225D5210CBFA6B4FB6F8D4BC450 /* GDTCORFlatFileStorage+Promises.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "GDTCORFlatFileStorage+Promises.m"; path = "GoogleDataTransport/GDTCORLibrary/GDTCORFlatFileStorage+Promises.m"; sourceTree = ""; }; + 60DBA1068D5F2F91374DD33CC685B627 /* endpoint.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h"; sourceTree = ""; }; + 60DCCD9C129B4D5C465D720C3CB56FC4 /* strip.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = strip.h; path = absl/strings/strip.h; sourceTree = ""; }; + 60E4DA724A5BD20EC44D42863D5DE697 /* discovery.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = discovery.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c"; sourceTree = ""; }; + 60FD395ACC387DC13902992C7F82FDA0 /* bytestring.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bytestring.h; path = src/include/openssl/bytestring.h; sourceTree = ""; }; + 61060E937CC594BAB60BC43807AB59CC /* spinlock_posix.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock_posix.inc; path = absl/base/internal/spinlock_posix.inc; sourceTree = ""; }; + 612E8210AAE6FCBF0104313A09CE11CF /* gRPC-C++-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "gRPC-C++-dummy.m"; sourceTree = ""; }; + 613A9258307623D8B2A315EB50668550 /* a_dup.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_dup.c; path = src/crypto/asn1/a_dup.c; sourceTree = ""; }; + 6178ED876AA27BB64FEC736A9D17E490 /* json_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json_util.h; path = src/core/lib/security/util/json_util.h; sourceTree = ""; }; + 6192ECC540B10D8E39942352FCDEF1CF /* ssl_session.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_session.cc; path = src/ssl/ssl_session.cc; sourceTree = ""; }; + 61ACC90E8D73B8BDE98CD9AECF447C81 /* stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stats.h; path = src/core/lib/debug/stats.h; sourceTree = ""; }; + 620BF7A8931A330D38F19B2087BEB8AA /* completion_queue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue.h; path = src/core/lib/surface/completion_queue.h; sourceTree = ""; }; + 621BBE4CD378521268FD1056F97AB8DB /* GDTCCTCompressionHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCCTCompressionHelper.m; path = GoogleDataTransport/GDTCCTLibrary/GDTCCTCompressionHelper.m; sourceTree = ""; }; + 625C10D311F9BD8DE8B4E61153A7DE97 /* obj_xref.c */ = {isa = PBXFileReference; includeInIndex = 1; name = obj_xref.c; path = src/crypto/obj/obj_xref.c; sourceTree = ""; }; + 62B71C9C57019F50FA4651A091504ADD /* civil_time_detail.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = civil_time_detail.cc; path = absl/time/internal/cctz/src/civil_time_detail.cc; sourceTree = ""; }; + 62CFB0424987A30330ADCB83E81CCCBE /* cache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cache.h; path = include/leveldb/cache.h; sourceTree = ""; }; + 62D4A3694FDB279D23D1D9A697A08821 /* any.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = any.nanopb.cc; path = Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc; sourceTree = ""; }; + 62E5E466B0FA04CFB2DC364B1C5B815B /* combiner.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = combiner.cc; path = src/core/lib/iomgr/combiner.cc; sourceTree = ""; }; + 630CFC57E0EB1039CC050ABF6B80618A /* timestamp.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timestamp.cc; path = Firestore/core/src/timestamp.cc; sourceTree = ""; }; + 630E9EC214F9E235473F8EBA91AA4447 /* serialization_traits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = serialization_traits.h; path = include/grpcpp/impl/codegen/serialization_traits.h; sourceTree = ""; }; + 631213FA203B725122B795A19693DC1B /* metadata.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = metadata.upb.c; path = "src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c"; sourceTree = ""; }; + 6312A4C21F371141D02D36D7F37ACE37 /* local_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_transport_security.h; path = src/core/tsi/local_transport_security.h; sourceTree = ""; }; + 631429BE71CD6B8B75244E3C2C2B917C /* message_compress.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_compress.h; path = src/core/lib/compression/message_compress.h; sourceTree = ""; }; + 632762789A1D19AA681DC4AA5B81A8AD /* circuit_breaker.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = circuit_breaker.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h"; sourceTree = ""; }; + 6332265BA97DCBAEEB18C2BEBD8BBEA5 /* ecdsa.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ecdsa.h; path = src/include/openssl/ecdsa.h; sourceTree = ""; }; + 635CDD0C54FA76F8CB9052C2E7156F50 /* chttp2_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_connector.h; path = src/core/ext/transport/chttp2/client/chttp2_connector.h; sourceTree = ""; }; + 6378779BB664AE75A73E8345EF9F1901 /* mpmcqueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mpmcqueue.h; path = src/core/lib/iomgr/executor/mpmcqueue.h; sourceTree = ""; }; + 638F8751A39473AAA3E2E475D74ACA8D /* exception_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = exception_apple.mm; path = Firestore/core/src/util/exception_apple.mm; sourceTree = ""; }; + 63A44D6D32DA85D8A02374D7AAEF561F /* FirebaseCore.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = FirebaseCore.modulemap; sourceTree = ""; }; + 63B0A4F03AAD2B6EACFC450E01E290F9 /* unix_sockets_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = unix_sockets_posix.cc; path = src/core/lib/iomgr/unix_sockets_posix.cc; sourceTree = ""; }; + 63BBF2B4A372E1B2C092764230DA5B67 /* optional.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = optional.h; path = absl/types/optional.h; sourceTree = ""; }; + 646531900ED79B672D00A847C224AA29 /* algorithm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = algorithm.c; path = src/crypto/x509/algorithm.c; sourceTree = ""; }; + 64977221336CEF3D34926E7F9B2250DD /* alts_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_credentials.h; path = src/core/lib/security/credentials/alts/alts_credentials.h; sourceTree = ""; }; + 64AAFB0D2AA6500F624DDED98A40ED6D /* FIRFirebaseUserAgent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFirebaseUserAgent.h; path = FirebaseCore/Sources/FIRFirebaseUserAgent.h; sourceTree = ""; }; + 64C5AD682535D608A522A047798193A2 /* x509_txt.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_txt.c; path = src/crypto/x509/x509_txt.c; sourceTree = ""; }; + 64E1D2F02E98FFCD0BF893A3858FF385 /* GULKeychainUtils.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULKeychainUtils.m; path = GoogleUtilities/Environment/SecureStorage/GULKeychainUtils.m; sourceTree = ""; }; + 650C424B1A5E114F2995FA11B7295D51 /* tls_method.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_method.cc; path = src/ssl/tls_method.cc; sourceTree = ""; }; + 651BF0816B4B332C18209C9BFCFCA837 /* jacobi.c */ = {isa = PBXFileReference; includeInIndex = 1; name = jacobi.c; path = src/crypto/fipsmodule/bn/jacobi.c; sourceTree = ""; }; + 654B3EA2BD33E3C5ADF4476821507BF5 /* refcount_c11.c */ = {isa = PBXFileReference; includeInIndex = 1; name = refcount_c11.c; path = src/crypto/refcount_c11.c; sourceTree = ""; }; + 655A1BD52011D79F025D1B3061703200 /* deterministic.c */ = {isa = PBXFileReference; includeInIndex = 1; name = deterministic.c; path = src/crypto/rand_extra/deterministic.c; sourceTree = ""; }; + 655F9B569AE0B266E165B9DB0468745F /* query_engine.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query_engine.cc; path = Firestore/core/src/local/query_engine.cc; sourceTree = ""; }; + 65679A6AFC13DD9CFA432F38F3740361 /* proxy_mapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proxy_mapper.h; path = src/core/ext/filters/client_channel/proxy_mapper.h; sourceTree = ""; }; + 657901658F4CB37D372FC3801030D114 /* dynamic_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dynamic_annotations.h; path = absl/base/dynamic_annotations.h; sourceTree = ""; }; + 65D3A127F85D259EFFB75179FF5D1CE5 /* error_cfstream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_cfstream.h; path = src/core/lib/iomgr/error_cfstream.h; sourceTree = ""; }; + 65DB24AA72A09D1E97E91A8763F9C818 /* port_platform.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port_platform.h; path = include/grpc/impl/codegen/port_platform.h; sourceTree = ""; }; + 65EE7AD9F2EDA71CBD1BD54CA1DE18D3 /* secure_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_credentials.cc; path = src/cpp/client/secure_credentials.cc; sourceTree = ""; }; + 66628993B3498B56A57E3D4494D15D14 /* nanopb.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = nanopb.release.xcconfig; sourceTree = ""; }; + 66AC3F8AD68A10DA9F61CEB020C00256 /* arena.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = arena.cc; path = src/core/lib/gprpp/arena.cc; sourceTree = ""; }; + 66B6E75D106679E1527BAD1A3703A794 /* srds.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = srds.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/srds.upb.c"; sourceTree = ""; }; + 66C61EEA309F1EB978F31EDA3CDEDE16 /* transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security.h; path = src/core/tsi/transport_security.h; sourceTree = ""; }; + 66D5D5ED965A18F6F8CF3E5FD06DBE7B /* ostringstream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ostringstream.cc; path = absl/strings/internal/ostringstream.cc; sourceTree = ""; }; + 66D7C00648CEF99F4B33717B9637DB24 /* json_reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = json_reader.cc; path = src/core/lib/json/json_reader.cc; sourceTree = ""; }; + 66E112BD27CF895BC81D63432C53B66D /* civil_time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = civil_time.h; path = absl/time/internal/cctz/include/cctz/civil_time.h; sourceTree = ""; }; + 66E80990B7602DE869237F057B85CB28 /* xds_bootstrap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_bootstrap.h; path = src/core/ext/filters/client_channel/xds/xds_bootstrap.h; sourceTree = ""; }; + 67231506166E828D9E3C83F285AF0629 /* GDTCORTransport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORTransport.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTransport.h; sourceTree = ""; }; + 67459D488E0930C75534A13CE44A611A /* transaction.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transaction.cc; path = Firestore/core/src/core/transaction.cc; sourceTree = ""; }; + 6791237FDDB229B80FF9F960CD09BC2C /* byte_buffer_reader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer_reader.h; path = include/grpc/byte_buffer_reader.h; sourceTree = ""; }; + 67A3D205B05871CBA8CDE98108A56AF8 /* gRPC-C++.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "gRPC-C++.release.xcconfig"; sourceTree = ""; }; + 67B06532914C1BCA15ADF300B57ABB9A /* Firebase.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Firebase.debug.xcconfig; sourceTree = ""; }; + 67B1D45B38111E8D1DA3BE14CB613724 /* ctx.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ctx.c; path = src/crypto/fipsmodule/bn/ctx.c; sourceTree = ""; }; + 67D0EA25E5A124E272B58F5A6BCF22E6 /* int128.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = int128.cc; path = absl/numeric/int128.cc; sourceTree = ""; }; + 67D990116E8A864DD03DD36835E254B3 /* FirebaseCore-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "FirebaseCore-Info.plist"; sourceTree = ""; }; + 67D9D789AF50B525348AACCFC44B20BF /* aes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = aes.h; path = src/include/openssl/aes.h; sourceTree = ""; }; + 67F87B58CDE8C6CA4193815173DAB3D2 /* ads.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ads.upb.h; path = "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h"; sourceTree = ""; }; + 683463B420FCE12481D7F5D3BBC79314 /* time_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_posix.cc; path = src/core/lib/gpr/time_posix.cc; sourceTree = ""; }; + 683724E971A5E29FB54BDBD63773703C /* resolver_result_parsing.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolver_result_parsing.cc; path = src/core/ext/filters/client_channel/resolver_result_parsing.cc; sourceTree = ""; }; + 683A8D007E9001C1F4E9004DE36438CE /* tcp_server_utils_posix_common.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_utils_posix_common.cc; path = src/core/lib/iomgr/tcp_server_utils_posix_common.cc; sourceTree = ""; }; + 68602F7A47AE03E2D11F7E68E863CD60 /* tmpfile_msys.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tmpfile_msys.cc; path = src/core/lib/gpr/tmpfile_msys.cc; sourceTree = ""; }; + 68752EEB6A2A54E14D19F0FB23FAAB90 /* hpack_parser.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hpack_parser.cc; path = src/core/ext/transport/chttp2/transport/hpack_parser.cc; sourceTree = ""; }; + 687BA8868ECE122ED37C2197706D1E0C /* x509_v3.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_v3.c; path = src/crypto/x509/x509_v3.c; sourceTree = ""; }; + 6899F70129CBD04132766D607E5F51F4 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/pkcs7/internal.h; sourceTree = ""; }; + 68B912DFA803CCB2A18DE83D740612AF /* alts_grpc_record_protocol_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_record_protocol_common.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h; sourceTree = ""; }; + 68EF1027B77CF7A21833485066A7DCE3 /* spinlock_wait.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = spinlock_wait.h; path = absl/base/internal/spinlock_wait.h; sourceTree = ""; }; + 690260ACFC781EF1E784DEE2C6C603D8 /* listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener.upb.h"; sourceTree = ""; }; + 692CCA167BAE54029B9243C2996E4BEC /* secure_server_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_server_credentials.cc; path = src/cpp/server/secure_server_credentials.cc; sourceTree = ""; }; + 69327BD8613EE4C447F311D3C38EC636 /* client_channel_channelz.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_channel_channelz.cc; path = src/core/ext/filters/client_channel/client_channel_channelz.cc; sourceTree = ""; }; + 697445CA7A17A5B802C3D19D046B6AB9 /* hashtablez_sampler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hashtablez_sampler.h; path = absl/container/internal/hashtablez_sampler.h; sourceTree = ""; }; + 699DA49F293CA45ABB3014D681F33C16 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/x509v3/internal.h; sourceTree = ""; }; + 69B7EAE9EF9A21A0349C2C5A7AB43479 /* not_in_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = not_in_filter.cc; path = Firestore/core/src/core/not_in_filter.cc; sourceTree = ""; }; + 69B86306FF6FC7BDD21B76BAB4F8AE48 /* table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = table.h; path = include/leveldb/table.h; sourceTree = ""; }; + 69D2389FD8623A3C724B261FDD99F931 /* spinlock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = spinlock.h; path = absl/base/internal/spinlock.h; sourceTree = ""; }; + 69D76D6502361D626C231350D623585A /* BoringSSL-GRPC.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "BoringSSL-GRPC.modulemap"; sourceTree = ""; }; + 69D84BC6F7EFC75BD6AE7026624BF864 /* d1_lib.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = d1_lib.cc; path = src/ssl/d1_lib.cc; sourceTree = ""; }; + 69E56F28F23EB668D4D43E369DF0A33D /* memutil.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memutil.cc; path = absl/strings/internal/memutil.cc; sourceTree = ""; }; + 6A2B7AAF021624A3B2FB10C87EB67EA7 /* http.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http.upb.h; path = "src/core/ext/upb-generated/envoy/type/http.upb.h"; sourceTree = ""; }; + 6A39D41DEDC8F04603A76EA46AA2AC37 /* basic_timers.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = basic_timers.cc; path = src/core/lib/profiling/basic_timers.cc; sourceTree = ""; }; + 6A40217F6693BAFCBD8ED3F005007FD1 /* cpu_iphone.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cpu_iphone.cc; path = src/core/lib/gpr/cpu_iphone.cc; sourceTree = ""; }; + 6A4DAD705DD68E9F9B4489DA7427A818 /* chttp2_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_connector.h; path = src/core/ext/transport/chttp2/client/chttp2_connector.h; sourceTree = ""; }; + 6A590FAC573405ECFA26516B654801D0 /* GDTCORReachability_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORReachability_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORReachability_Private.h; sourceTree = ""; }; + 6A5C20C43790C92304C52BE564E0A511 /* pb_decode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_decode.c; sourceTree = ""; }; + 6A664B7F32C368F559FC343E0895B515 /* FBLPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBLPromise.h; path = Sources/FBLPromises/include/FBLPromise.h; sourceTree = ""; }; + 6A66EDDFCCC68F686309D219E83AA46D /* server_builder_plugin.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_builder_plugin.h; path = include/grpcpp/impl/server_builder_plugin.h; sourceTree = ""; }; + 6A721E00F65B4123EA521950AA41BCFD /* x_pkey.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_pkey.c; path = src/crypto/x509/x_pkey.c; sourceTree = ""; }; + 6A80269127372F74B3C44097DCF9430C /* resolver_result_parsing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_result_parsing.h; path = src/core/ext/filters/client_channel/resolver_result_parsing.h; sourceTree = ""; }; + 6A932D17BAF42D2FB6E062BC540AB59E /* log_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_linux.cc; path = src/core/lib/gpr/log_linux.cc; sourceTree = ""; }; + 6AB22F1F9925C0AA3889BA8A9F88799B /* tls_credentials_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_credentials_options.h; path = include/grpcpp/security/tls_credentials_options.h; sourceTree = ""; }; + 6AB2A5FD7F9BE7FDD0A2919849E6BA1D /* api_listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = api_listener.upb.h; path = "src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h"; sourceTree = ""; }; + 6AF0EA46779A2ED3A8C590516EDAA051 /* tasn_enc.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_enc.c; path = src/crypto/asn1/tasn_enc.c; sourceTree = ""; }; + 6B23B91D857C394AC9B6A46BF51C470A /* rds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/rds.upb.h"; sourceTree = ""; }; + 6B2784EC7FDF125E53043E97FEC1A93C /* GULHeartbeatDateStorageUserDefaults.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULHeartbeatDateStorageUserDefaults.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorageUserDefaults.h; sourceTree = ""; }; + 6B3264F286DBC219137465BA6C19CB09 /* deadline_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = deadline_filter.h; path = src/core/ext/filters/deadline/deadline_filter.h; sourceTree = ""; }; + 6B4E8AF8FB86A15BDCA4002950C15A3C /* port_def.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = port_def.inc; path = third_party/upb/upb/port_def.inc; sourceTree = ""; }; + 6B6D2709F7503E18DF89C3C065E47A05 /* dh.c */ = {isa = PBXFileReference; includeInIndex = 1; name = dh.c; path = src/crypto/dh/dh.c; sourceTree = ""; }; + 6B752E2CCB34395E74669198882CFD10 /* chacha.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chacha.h; path = src/include/openssl/chacha.h; sourceTree = ""; }; + 6B7D195ACE05E7761FEB1D1D191CEF73 /* md4.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = md4.h; path = src/include/openssl/md4.h; sourceTree = ""; }; + 6B9FD21E29437B49EFC575D5AA5332FB /* document_set.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_set.cc; path = Firestore/core/src/model/document_set.cc; sourceTree = ""; }; + 6BAE89B682408E1540F6F23CB91D3EDA /* charconv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = charconv.cc; path = absl/strings/charconv.cc; sourceTree = ""; }; + 6BB92693CCC64385D2FF6431D7890F1E /* eds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = eds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h"; sourceTree = ""; }; + 6BC7A68EADA873C78CFE5C42DFD4997C /* annotations.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = annotations.upb.h; path = "src/core/ext/upb-generated/google/api/annotations.upb.h"; sourceTree = ""; }; + 6BDAB9FA4CD49F8B5ED138AB95764BF7 /* grpc_alts_credentials_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_alts_credentials_options.h; path = src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h; sourceTree = ""; }; + 6BE367AFF2CEE3B3275654AA478CA468 /* is_epollexclusive_available.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = is_epollexclusive_available.cc; path = src/core/lib/iomgr/is_epollexclusive_available.cc; sourceTree = ""; }; + 6BF0D13350F25D402E034AA04E024241 /* endian.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endian.h; path = absl/base/internal/endian.h; sourceTree = ""; }; + 6C09B3C005F0FD627C3EA4FE43FB8733 /* scoped_route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = scoped_route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h"; sourceTree = ""; }; + 6C18979A49656331100B8E0912781C5B /* eventmanager_libuv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = eventmanager_libuv.cc; path = src/core/lib/iomgr/poller/eventmanager_libuv.cc; sourceTree = ""; }; + 6C3EB4A0566A8607AD43E870FFDE536A /* env_windows_test_helper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = env_windows_test_helper.h; path = util/env_windows_test_helper.h; sourceTree = ""; }; + 6C57F873C20677DBB378816C7DFC14B3 /* scheduling_mode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = scheduling_mode.h; path = absl/base/internal/scheduling_mode.h; sourceTree = ""; }; + 6C5BE90EAC6E022526BFABD0B6F3D0CE /* mutex.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutex.cc; path = absl/synchronization/mutex.cc; sourceTree = ""; }; + 6C63F7A36A6F4D2A8AB38B701DED739E /* remote_objc_bridge.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = remote_objc_bridge.cc; path = Firestore/core/src/remote/remote_objc_bridge.cc; sourceTree = ""; }; + 6C6A491080ED123BA2B4869AE8D95B47 /* pollset_set_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set_windows.h; path = src/core/lib/iomgr/pollset_set_windows.h; sourceTree = ""; }; + 6C6C330C425E31795232C0D7B760873E /* civil_time.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = civil_time.cc; path = absl/time/civil_time.cc; sourceTree = ""; }; + 6C86E75121BAA1E70938E672141693E0 /* inproc_transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inproc_transport.h; path = src/core/ext/transport/inproc/inproc_transport.h; sourceTree = ""; }; + 6C9B5D9EEFB195E52B8CC9B58A65F2E1 /* montgomery.c */ = {isa = PBXFileReference; includeInIndex = 1; name = montgomery.c; path = src/crypto/fipsmodule/bn/montgomery.c; sourceTree = ""; }; + 6CA902355FCDD4D7425028F7FAA3C440 /* ev_epoll1_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_epoll1_linux.h; path = src/core/lib/iomgr/ev_epoll1_linux.h; sourceTree = ""; }; + 6CAC5129540A400C728F8403246DA32E /* p5_pbev2.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p5_pbev2.c; path = src/crypto/pkcs8/p5_pbev2.c; sourceTree = ""; }; + 6CB77AD39D4D25E7CE4D2C621C5A6F79 /* remote_store.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = remote_store.cc; path = Firestore/core/src/remote/remote_store.cc; sourceTree = ""; }; + 6CBFAA65733F56B7F9559726C8315AC0 /* FIRGeoPoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRGeoPoint.h; path = Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h; sourceTree = ""; }; + 6CBFCA714C8EEB4F70F7C99676C4B0B5 /* lb_policy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy.h; path = src/core/ext/filters/client_channel/lb_policy.h; sourceTree = ""; }; + 6CC8110A37ACE35506B4F0D1694ABB09 /* hpack_encoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_encoder.h; path = src/core/ext/transport/chttp2/transport/hpack_encoder.h; sourceTree = ""; }; + 6CD7E598A744FDA9FD16EC55E8643D1A /* client_channel_channelz.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel_channelz.h; path = src/core/ext/filters/client_channel/client_channel_channelz.h; sourceTree = ""; }; + 6CE64CEC1C19AFA412AD194A343E6E18 /* ref_counted.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ref_counted.h; path = src/core/lib/gprpp/ref_counted.h; sourceTree = ""; }; + 6CF41C3CCD8ECFABDD0D40690DEA0917 /* err_data.c */ = {isa = PBXFileReference; includeInIndex = 1; path = err_data.c; sourceTree = ""; }; + 6CFF5FC83A9D4BA6332523FD9DC0B8C0 /* server_callback.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_callback.cc; path = src/cpp/server/server_callback.cc; sourceTree = ""; }; + 6D1A85F8180A80DD21013455EC1A2751 /* array_contains_any_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = array_contains_any_filter.cc; path = Firestore/core/src/core/array_contains_any_filter.cc; sourceTree = ""; }; + 6D25CDDD9A88978F014D4A99CC3B37C6 /* GDTCORAssert.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORAssert.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORAssert.m; sourceTree = ""; }; + 6D4912D20507EF01C5F95D28A1023B18 /* metadata.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata.upb.h; path = "src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h"; sourceTree = ""; }; + 6D836625861FE1C9A1C5237A5802F7C3 /* raw_logging.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = raw_logging.cc; path = absl/base/internal/raw_logging.cc; sourceTree = ""; }; + 6DAAB579BC114D3C3501C5FE3F75C6F9 /* f_enum.c */ = {isa = PBXFileReference; includeInIndex = 1; name = f_enum.c; path = src/crypto/asn1/f_enum.c; sourceTree = ""; }; + 6DC502B8F9EF1F8F9C4200695FCFD22D /* secure_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = secure_credentials.h; path = src/cpp/client/secure_credentials.h; sourceTree = ""; }; + 6DC56AA569404671EB413B4059575E5C /* watch_change.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = watch_change.cc; path = Firestore/core/src/remote/watch_change.cc; sourceTree = ""; }; + 6DC72CD345336EAF4EB59FE7F08DB0FB /* nanopb.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = nanopb.debug.xcconfig; sourceTree = ""; }; + 6DCFD02AF1A42B83B122A97E0062D3B0 /* GDTCOREventTransformer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREventTransformer.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREventTransformer.h; sourceTree = ""; }; + 6DD2340A293A98A49C1B9EE8423845EB /* err.c */ = {isa = PBXFileReference; includeInIndex = 1; name = err.c; path = src/crypto/err/err.c; sourceTree = ""; }; + 6DF9F21770FD8304AB8E04FD2CB0FE25 /* GDTCORUploadCoordinator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORUploadCoordinator.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORUploadCoordinator.h; sourceTree = ""; }; + 6E153D3704EB930D7B97C84C5022DE5C /* dh.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dh.h; path = src/include/openssl/dh.h; sourceTree = ""; }; + 6E2C4DAB9B1F9F5FADB214D3FA05F90E /* check_gcp_environment_no_op.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = check_gcp_environment_no_op.cc; path = src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc; sourceTree = ""; }; + 6E2F7E0A38A3803B3D985992CF8E602D /* bin_decoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bin_decoder.h; path = src/core/ext/transport/chttp2/transport/bin_decoder.h; sourceTree = ""; }; + 6E47B545B0FD3ECE687598822590253E /* block_builder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = block_builder.cc; path = table/block_builder.cc; sourceTree = ""; }; + 6E501AABE0F34BBD4BA9A5709A3F2402 /* FIRConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRConfiguration.h; path = FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h; sourceTree = ""; }; + 6E712B22330FB2E373E230870DE2E459 /* channel_stack_type.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack_type.h; path = src/core/lib/surface/channel_stack_type.h; sourceTree = ""; }; + 6E7C388295F481B616CD42572BF9649B /* tls_pthread.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_pthread.h; path = src/core/lib/gpr/tls_pthread.h; sourceTree = ""; }; + 6E7F875194E544D97D96D786FA3997A1 /* channel_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_impl.h; path = include/grpcpp/channel_impl.h; sourceTree = ""; }; + 6E80008EC9FB5BEE4EEAE02CF4BC9068 /* tcp_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_posix.h; path = src/core/lib/iomgr/tcp_posix.h; sourceTree = ""; }; + 6EA633D54E25B242F06A1362C952E70D /* endpoint.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c"; sourceTree = ""; }; + 6EB606CA34D6F8ECA23EE3CF535BA45E /* firestore.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firestore.nanopb.cc; path = Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc; sourceTree = ""; }; + 6EC874E822AEF71603431310B98615A7 /* transport_security_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_interface.h; path = src/core/tsi/transport_security_interface.h; sourceTree = ""; }; + 6ECBAAAD9ECB59BFB369D702AF7F98B0 /* FIRListenerRegistration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRListenerRegistration.h; path = Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h; sourceTree = ""; }; + 6EE95C90A183B979359C3332736A83CA /* gRPC-Core-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "gRPC-Core-dummy.m"; sourceTree = ""; }; + 6EF199DEBC6744AAEFC454ECCF6D2250 /* sync_abseil.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sync_abseil.cc; path = src/core/lib/gpr/sync_abseil.cc; sourceTree = ""; }; + 6F144783699836CF4D53EC2EA9790D3A /* sync_abseil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_abseil.h; path = include/grpc/impl/codegen/sync_abseil.h; sourceTree = ""; }; + 6F420F2D85E8C5958F23A7FD784652FB /* bin_decoder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bin_decoder.cc; path = src/core/ext/transport/chttp2/transport/bin_decoder.cc; sourceTree = ""; }; + 6F464093E6619365780B739C836CFDFC /* security_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_handshaker.h; path = src/core/lib/security/transport/security_handshaker.h; sourceTree = ""; }; + 6F55D3DC9E3F24EA5FD511078B41B047 /* grpc_nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_nanopb.cc; path = Firestore/core/src/remote/grpc_nanopb.cc; sourceTree = ""; }; + 6F660407E9951B59034B8EF2ED69083E /* GULSecureCoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULSecureCoding.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h; sourceTree = ""; }; + 6F70F679EB641A64E00FE5C7726F8C28 /* timer_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer_custom.cc; path = src/core/lib/iomgr/timer_custom.cc; sourceTree = ""; }; + 6F79AB233BA51E65780DB03CABCFC2B2 /* client_callback.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_callback.h; path = include/grpcpp/impl/codegen/client_callback.h; sourceTree = ""; }; + 6F8E11C50BD04C40064F5C2E82B24D57 /* bundle_serializer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bundle_serializer.cc; path = Firestore/core/src/bundle/bundle_serializer.cc; sourceTree = ""; }; + 6FBF2A1D0779AC838966FA963A60243F /* ref_counted_ptr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ref_counted_ptr.h; path = src/core/lib/gprpp/ref_counted_ptr.h; sourceTree = ""; }; + 6FCF885D31138F964D4DED96FF4B14DA /* deprecation.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = deprecation.upb.c; path = "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c"; sourceTree = ""; }; + 6FD3F5FD722AE7C27691ED3E992EE06B /* cluster.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cluster.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h"; sourceTree = ""; }; + 6FD61DC34AB43E983BA6082C5263B028 /* low_level_scheduling.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = low_level_scheduling.h; path = absl/base/internal/low_level_scheduling.h; sourceTree = ""; }; + 703E0DD09A5712BE17DDB6047211A662 /* load_system_roots.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_system_roots.h; path = src/core/lib/security/security_connector/load_system_roots.h; sourceTree = ""; }; + 705F9D7C25A4BC2347A81C6032FD0D00 /* print.c */ = {isa = PBXFileReference; includeInIndex = 1; name = print.c; path = src/crypto/evp/print.c; sourceTree = ""; }; + 7073AB33F73D3CDCF28DF09E42E111FF /* connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connector.h; path = src/core/ext/filters/client_channel/connector.h; sourceTree = ""; }; + 707C3D8840963A14079CA85700DD7279 /* work_serializer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = work_serializer.h; path = src/core/lib/iomgr/work_serializer.h; sourceTree = ""; }; + 70876681E2EBC6E4AAD038C2CB0075BB /* load_system_roots_fallback.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = load_system_roots_fallback.cc; path = src/core/lib/security/security_connector/load_system_roots_fallback.cc; sourceTree = ""; }; + 708794D61C44B97FC187ED209D1EB8FE /* cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cache.cc; path = util/cache.cc; sourceTree = ""; }; + 709254F04C66D296E8D367733E1EEFF1 /* digest_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = digest_extra.c; path = src/crypto/digest_extra/digest_extra.c; sourceTree = ""; }; + 709C476ADF004340DE0E611411A3F682 /* histogram.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = histogram.h; path = util/histogram.h; sourceTree = ""; }; + 70A8C702CF96CC43BC57A68F8C2969FA /* health_check_service_interface_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check_service_interface_impl.h; path = include/grpcpp/health_check_service_interface_impl.h; sourceTree = ""; }; + 70C105943F6DB6E5BDA3DBBE29104B3F /* hpack_parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_parser.h; path = src/core/ext/transport/chttp2/transport/hpack_parser.h; sourceTree = ""; }; + 70C5F5487C3D0BD41B86188E5A468273 /* method_handler_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = method_handler_impl.h; path = include/grpcpp/impl/codegen/method_handler_impl.h; sourceTree = ""; }; + 70D476564D9BBCE1BD0616BF5ED79124 /* extension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = extension.h; path = absl/strings/internal/str_format/extension.h; sourceTree = ""; }; + 70E37422BC5C235944D781B14FFFAB1D /* FIRLibrary.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLibrary.h; path = FirebaseCore/Sources/Private/FIRLibrary.h; sourceTree = ""; }; + 70F6E27CE4188CBD025613EA7DA63C37 /* x509_ext.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_ext.c; path = src/crypto/x509/x509_ext.c; sourceTree = ""; }; + 71001072B6B65C2DC123195C1AF70EED /* iocp_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iocp_windows.h; path = src/core/lib/iomgr/iocp_windows.h; sourceTree = ""; }; + 7117926BF223B96B69F21906D44BA768 /* frame_settings.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_settings.cc; path = src/core/ext/transport/chttp2/transport/frame_settings.cc; sourceTree = ""; }; + 713116C5F644A85F2280CD820ECD957E /* v3_prn.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_prn.c; path = src/crypto/x509v3/v3_prn.c; sourceTree = ""; }; + 7137352E69ACBDC06129B37CA23A37CF /* secure_channel_create.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_channel_create.cc; path = src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc; sourceTree = ""; }; + 7158AF3EA4F8FE893DF82964AED61FC4 /* fake_transport_security.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fake_transport_security.cc; path = src/core/tsi/fake_transport_security.cc; sourceTree = ""; }; + 715BA23D34A522CB34877C5D6C7BD6FE /* string_view.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_view.h; path = src/core/lib/gprpp/string_view.h; sourceTree = ""; }; + 71621132FB49E588ABD9206CE29BA54E /* x509.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = x509.h; path = src/include/openssl/x509.h; sourceTree = ""; }; + 7167DB962799499BB9AFCA97C28414EF /* tcp_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_custom.h; path = src/core/lib/iomgr/tcp_custom.h; sourceTree = ""; }; + 71C6C363EE4C56B508C002874F18FD34 /* pollset_set.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set.h; path = src/core/lib/iomgr/pollset_set.h; sourceTree = ""; }; + 71C90E2B37FD0C40CB7DCE9B35201228 /* clock.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = clock.cc; path = absl/time/clock.cc; sourceTree = ""; }; + 71FD7727C8A00943F0820A0160818320 /* timer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer.h; path = src/core/lib/iomgr/timer.h; sourceTree = ""; }; + 724F27A7E8833F11B3B9181B974AC5B4 /* stream_compression_gzip.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression_gzip.h; path = src/core/lib/compression/stream_compression_gzip.h; sourceTree = ""; }; + 72522FB6ECCD5B4D3161C13F25A68A2B /* status_conversion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_conversion.h; path = src/core/lib/transport/status_conversion.h; sourceTree = ""; }; + 725C58F525929D4EF7DCBA63ACE87C49 /* server_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_credentials.h; path = include/grpcpp/security/server_credentials.h; sourceTree = ""; }; + 725D5529E6CBBAC7D41AA8E72D27DA8D /* validate_service_config.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = validate_service_config.cc; path = src/cpp/common/validate_service_config.cc; sourceTree = ""; }; + 7266059A56A9BAD00828F12817CFE1A8 /* client_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel.h; path = src/core/ext/filters/client_channel/client_channel.h; sourceTree = ""; }; + 727C3F47E92394D30AE82A7FEA783126 /* executor_std.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = executor_std.cc; path = Firestore/core/src/util/executor_std.cc; sourceTree = ""; }; + 728A441643EE84474DCC1D24C9BE8102 /* str_split.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_split.h; path = absl/strings/str_split.h; sourceTree = ""; }; + 729A21CC7006CAEC65ED71CC4742B14F /* thd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thd.h; path = src/core/lib/gprpp/thd.h; sourceTree = ""; }; + 729EF04CBBC30ED9447DDF4D3FFF6009 /* FBLPromise+Async.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Async.m"; path = "Sources/FBLPromises/FBLPromise+Async.m"; sourceTree = ""; }; + 72A32A4BF6281371B497549A499A9F2F /* aes.c */ = {isa = PBXFileReference; includeInIndex = 1; name = aes.c; path = src/crypto/fipsmodule/aes/aes.c; sourceTree = ""; }; + 72AB31EBEFFB48DDBB17305B3876E151 /* subchannel_pool_interface.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = subchannel_pool_interface.cc; path = src/core/ext/filters/client_channel/subchannel_pool_interface.cc; sourceTree = ""; }; + 72AD3AC6CBC8250F45B18C6AAD60CC0D /* unix_sockets_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = unix_sockets_posix.h; path = src/core/lib/iomgr/unix_sockets_posix.h; sourceTree = ""; }; + 72CA26BF0546AD4251A47A38F0C1E193 /* hash.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hash.cc; path = absl/hash/internal/hash.cc; sourceTree = ""; }; + 733103FD9FF89DCAAE38FCA5E7848460 /* ssl_transport_security.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_transport_security.cc; path = src/core/tsi/ssl_transport_security.cc; sourceTree = ""; }; + 7350DC0B08E336D1D3E82BF84F331768 /* handshaker_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker_factory.h; path = src/core/lib/channel/handshaker_factory.h; sourceTree = ""; }; + 735743FFE3A449B51A15E24901AECF1F /* string_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_util.h; path = include/grpc/support/string_util.h; sourceTree = ""; }; + 7370655514EBEDA752C76B3B6C052503 /* rpc_service_method.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rpc_service_method.h; path = include/grpcpp/impl/codegen/rpc_service_method.h; sourceTree = ""; }; + 739DBC173EB03342F3CD5A61230BC090 /* time_zone_impl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_impl.cc; path = absl/time/internal/cctz/src/time_zone_impl.cc; sourceTree = ""; }; + 73ADC394E1256ACBFD87B2FD254B30E1 /* rand.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rand.c; path = src/crypto/fipsmodule/rand/rand.c; sourceTree = ""; }; + 73B72E8ECBDB34D712E9FB17A84D12D6 /* snapshots_in_sync_listener_registration.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = snapshots_in_sync_listener_registration.cc; path = Firestore/core/src/api/snapshots_in_sync_listener_registration.cc; sourceTree = ""; }; + 73C98D4CCFA711E992BFF0C1839A30BF /* bundle_loader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bundle_loader.cc; path = Firestore/core/src/bundle/bundle_loader.cc; sourceTree = ""; }; + 73D31A0931A92A36F9CC4E6DB9D6AC7F /* version_set.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = version_set.h; path = db/version_set.h; sourceTree = ""; }; + 73EB465852F876184AE6DF57B99EA7B8 /* tcp_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_windows.cc; path = src/core/lib/iomgr/tcp_windows.cc; sourceTree = ""; }; + 740CB51E8F85611AE5DD5BED764EAC85 /* simple_mul.c */ = {isa = PBXFileReference; includeInIndex = 1; name = simple_mul.c; path = src/crypto/fipsmodule/ec/simple_mul.c; sourceTree = ""; }; + 7430EE0C24F9C897450F138CDF396FF6 /* nanopb_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = nanopb_util.cc; path = Firestore/core/src/nanopb/nanopb_util.cc; sourceTree = ""; }; + 743E429B88FD90AF606E30D5484D31C3 /* FIRFirestoreVersion.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFirestoreVersion.mm; path = Firestore/Source/API/FIRFirestoreVersion.mm; sourceTree = ""; }; + 74687F981785848CF193542E9D404CB9 /* fake_resolver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_resolver.h; path = src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h; sourceTree = ""; }; + 748B2260BF1522BC284270557AC5DF69 /* ev_epoll1_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ev_epoll1_linux.cc; path = src/core/lib/iomgr/ev_epoll1_linux.cc; sourceTree = ""; }; + 74B9F2FBCA145AC94E4AB4527DA50546 /* exec_ctx.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = exec_ctx.cc; path = src/core/lib/iomgr/exec_ctx.cc; sourceTree = ""; }; + 74C8974B3B902E1EFB8E33E52DC21979 /* orca_load_report.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = orca_load_report.upb.h; path = "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h"; sourceTree = ""; }; + 74DA42176BD18BF27A2921B163A95B2F /* leveldb-library-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "leveldb-library-umbrella.h"; sourceTree = ""; }; + 7504352F38E98E6E2DF19B1FBA23AB89 /* FIRFirestoreSettings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFirestoreSettings.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h; sourceTree = ""; }; + 7521C3B21B070A87DEA95363CB064967 /* rpc_method.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rpc_method.h; path = include/grpcpp/impl/rpc_method.h; sourceTree = ""; }; + 753542788C5C091470AF4D13364A6DAD /* atomic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atomic.h; path = src/core/lib/gprpp/atomic.h; sourceTree = ""; }; + 75372A0EF1BBDA166E71C7F6E233BC97 /* grpc_ares_wrapper_fallback.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_wrapper_fallback.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc; sourceTree = ""; }; + 753C0EF261CDDE6C75C21DABB832BB16 /* fake_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_transport_security.h; path = src/core/tsi/fake_transport_security.h; sourceTree = ""; }; + 75433E6919E72CC5C0D95F85797BAE15 /* cfb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cfb.c; path = src/crypto/fipsmodule/modes/cfb.c; sourceTree = ""; }; + 75525DB2C4D4193F51A3A235949F1C01 /* time_precise.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_precise.cc; path = src/core/lib/gpr/time_precise.cc; sourceTree = ""; }; + 75627434CA74A60A1612604AD510C495 /* tls_msvc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_msvc.h; path = src/core/lib/gpr/tls_msvc.h; sourceTree = ""; }; + 7565456ED66C9F7AAB35CFF93C311B70 /* kdf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = kdf.c; path = src/crypto/fipsmodule/tls/kdf.c; sourceTree = ""; }; + 756A14A84A126F04022E146D1A67F7D4 /* sha512.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sha512.c; path = src/crypto/fipsmodule/sha/sha512.c; sourceTree = ""; }; + 7572A863E8A97143CF808BF6215BFA80 /* grpclb_client_stats.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpclb_client_stats.cc; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc; sourceTree = ""; }; + 75746EB8FB15F347875401786A1E5DA2 /* frame_goaway.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_goaway.h; path = src/core/ext/transport/chttp2/transport/frame_goaway.h; sourceTree = ""; }; + 7576318C5263C6E2401312AF9CA8B55E /* GDTCORUploader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORUploader.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h; sourceTree = ""; }; + 7577B5F97ADA05BE37E9E4BA59C7A73B /* port_undef.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = port_undef.inc; path = third_party/upb/upb/port_undef.inc; sourceTree = ""; }; + 75BB1AFF2F9D9F5D67043A052BDF2AEA /* handshaker.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h"; sourceTree = ""; }; + 75CDCBAB55D2D1417B5DDAD3D9886D2D /* sockaddr_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_posix.h; path = src/core/lib/iomgr/sockaddr_posix.h; sourceTree = ""; }; + 75EC1DEA43A8EBDAC6CDAE3F2D407750 /* write_batch.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = write_batch.cc; path = Firestore/core/src/api/write_batch.cc; sourceTree = ""; }; + 75F15C23315B1471554D004C10E07F76 /* grpc_stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_stream.cc; path = Firestore/core/src/remote/grpc_stream.cc; sourceTree = ""; }; + 76005E7A0B18417C2398A61E8131A0B6 /* gpr_slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gpr_slice.h; path = include/grpc/impl/codegen/gpr_slice.h; sourceTree = ""; }; + 760292060E9C9A9DB8985F31CDAA12E3 /* empty.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = empty.upb.c; path = "src/core/ext/upb-generated/google/protobuf/empty.upb.c"; sourceTree = ""; }; + 760B8EC06583C79A3F1830C4E17AE723 /* alts_tsi_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_handshaker.h; path = src/core/tsi/alts/handshaker/alts_tsi_handshaker.h; sourceTree = ""; }; + 76271E67B8FBB9EFE56AFAB1625245CC /* remote_event.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = remote_event.cc; path = Firestore/core/src/remote/remote_event.cc; sourceTree = ""; }; + 76489A841AE3766DCA096942FE84094E /* grpc_alts_credentials_server_options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_alts_credentials_server_options.cc; path = src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc; sourceTree = ""; }; + 7664DD245795DEFDE12568838F32FBD7 /* FBLPromise+Reduce.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Reduce.h"; path = "Sources/FBLPromises/include/FBLPromise+Reduce.h"; sourceTree = ""; }; + 7665D3F712E5B040DBCDDFAA4A8EF960 /* xds_bootstrap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_bootstrap.h; path = src/core/ext/filters/client_channel/xds/xds_bootstrap.h; sourceTree = ""; }; + 7665E9702E0012EA9C42C224EADAE12B /* srtp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = srtp.h; path = src/include/openssl/srtp.h; sourceTree = ""; }; + 767CACAD361C9C0003CA194B8B071644 /* lame_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = lame_client.cc; path = src/core/lib/surface/lame_client.cc; sourceTree = ""; }; + 7681F71B82ECA16770CE60AE10BF2F14 /* pollset_set_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_set_custom.cc; path = src/core/lib/iomgr/pollset_set_custom.cc; sourceTree = ""; }; + 7682E873616B0AC5B4010500B87A703C /* incoming_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = incoming_metadata.h; path = src/core/ext/transport/chttp2/transport/incoming_metadata.h; sourceTree = ""; }; + 76AD99BA252D8EFD6A4AABC74E6C3BC1 /* status_code_enum.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_code_enum.h; path = include/grpcpp/support/status_code_enum.h; sourceTree = ""; }; + 7703E0901E3A8AE85A412693628DCB52 /* charconv_parse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = charconv_parse.h; path = absl/strings/internal/charconv_parse.h; sourceTree = ""; }; + 77119AEE9AE74035001C1D8784F9D9A9 /* ref_counted.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ref_counted.h; path = src/core/lib/gprpp/ref_counted.h; sourceTree = ""; }; + 77167CE9076DE7BD53D1C1499566CBAD /* sockaddr_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_posix.h; path = src/core/lib/iomgr/sockaddr_posix.h; sourceTree = ""; }; + 7722679195318B384A72A867C5E3EAB0 /* mpmcqueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mpmcqueue.h; path = src/core/lib/iomgr/executor/mpmcqueue.h; sourceTree = ""; }; + 773BC85B9BFF5AA58D3976A4F30674F3 /* bio.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bio.h; path = src/include/openssl/bio.h; sourceTree = ""; }; + 7750342932155F7D2878D0BBCADB9E54 /* alts_grpc_integrity_only_record_protocol.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_grpc_integrity_only_record_protocol.cc; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc; sourceTree = ""; }; + 777851AFE7FBE6DF0100814A133DF4C4 /* resource_path.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resource_path.cc; path = Firestore/core/src/model/resource_path.cc; sourceTree = ""; }; + 77A0335BD65D301B9439EC0691C11369 /* ssl_session_cache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_session_cache.h; path = src/core/tsi/ssl/session_cache/ssl_session_cache.h; sourceTree = ""; }; + 77E7EE0A12409EBE28A1E990CAF84B6C /* compression_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression_internal.h; path = src/core/lib/compression/compression_internal.h; sourceTree = ""; }; + 77EE97F143015E95C0B1845D8C8ABB58 /* msg.c */ = {isa = PBXFileReference; includeInIndex = 1; name = msg.c; path = third_party/upb/upb/msg.c; sourceTree = ""; }; + 77F988063E3B618B1E15A040CC1935DB /* health.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h"; sourceTree = ""; }; + 7814FB0FF75920942E7C1B20879BAFBE /* sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync.h; path = src/core/lib/gprpp/sync.h; sourceTree = ""; }; + 781C38AB608E1AE0427C1F5D50011524 /* tmpfile_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tmpfile_posix.cc; path = src/core/lib/gpr/tmpfile_posix.cc; sourceTree = ""; }; + 781D4A259EFEB08101C8818EE28E425B /* channel_stack_builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack_builder.h; path = src/core/lib/channel/channel_stack_builder.h; sourceTree = ""; }; + 781EBAF045EBF2F854241A062EB73645 /* pbkdf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pbkdf.c; path = src/crypto/evp/pbkdf.c; sourceTree = ""; }; + 783E4528C1488C1E5B5AC3E05CF493CC /* lb_policy_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy_factory.h; path = src/core/ext/filters/client_channel/lb_policy_factory.h; sourceTree = ""; }; + 7863E8269AB9B9304AE2631E48FEA146 /* leveldb_lru_reference_delegate.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_lru_reference_delegate.cc; path = Firestore/core/src/local/leveldb_lru_reference_delegate.cc; sourceTree = ""; }; + 7867A1BA96A03E8F1C980E2AAEA8393E /* server_callback_handlers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_callback_handlers.h; path = include/grpcpp/impl/codegen/server_callback_handlers.h; sourceTree = ""; }; + 786D44E350C930D4AC1EAE0FABDF28E8 /* f_int.c */ = {isa = PBXFileReference; includeInIndex = 1; name = f_int.c; path = src/crypto/asn1/f_int.c; sourceTree = ""; }; + 7870BBB100B3256F9BD6409588891260 /* socket.c */ = {isa = PBXFileReference; includeInIndex = 1; name = socket.c; path = src/crypto/bio/socket.c; sourceTree = ""; }; + 78A85F747EBF50DEFA43E830EA297434 /* oct.c */ = {isa = PBXFileReference; includeInIndex = 1; name = oct.c; path = src/crypto/fipsmodule/ec/oct.c; sourceTree = ""; }; + 78B26E2E34B7A494C881016636BAFBBB /* async_generic_service.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_generic_service.h; path = include/grpcpp/generic/async_generic_service.h; sourceTree = ""; }; + 78B49660DCAF348B5AF0AA74D7113328 /* async_unary_call_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_unary_call_impl.h; path = include/grpcpp/support/async_unary_call_impl.h; sourceTree = ""; }; + 78B799C5CD60EF0F2A8DAD61EDD7C304 /* FBLPromise+Do.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Do.h"; path = "Sources/FBLPromises/include/FBLPromise+Do.h"; sourceTree = ""; }; + 78BA118E8B62D64218555D3C890098CF /* slice_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_utils.h; path = src/core/lib/slice/slice_utils.h; sourceTree = ""; }; + 78D0B836F8CF7251827838B25BE7A18C /* ssl_privkey.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_privkey.cc; path = src/ssl/ssl_privkey.cc; sourceTree = ""; }; + 79318409836E677F346B550088F6BA80 /* GULHeartbeatDateStorageUserDefaults.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULHeartbeatDateStorageUserDefaults.m; path = GoogleUtilities/Environment/GULHeartbeatDateStorageUserDefaults.m; sourceTree = ""; }; + 794BCEDADBFFE2E63D0D9C0FE56DEE8E /* server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server.cc; path = src/core/lib/surface/server.cc; sourceTree = ""; }; + 7956807588DE8229B949A946CCD498BE /* http.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http.upb.h; path = "src/core/ext/upb-generated/envoy/type/http.upb.h"; sourceTree = ""; }; + 795ADF04F4AA6A250594D93F8C5C77FE /* wakeup_fd_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wakeup_fd_posix.cc; path = src/core/lib/iomgr/wakeup_fd_posix.cc; sourceTree = ""; }; + 796214088AA525811BB7BD373FDF91AA /* GDTCCTUploader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCCTUploader.m; path = GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m; sourceTree = ""; }; + 7969673FA84BC8675583230DEE78B5B0 /* version_edit.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = version_edit.cc; path = db/version_edit.cc; sourceTree = ""; }; + 797DC204ECCEA4793FE955D926F86063 /* server_interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_interceptor.h; path = include/grpcpp/impl/codegen/server_interceptor.h; sourceTree = ""; }; + 7990616A3432B5CE7914989D87729E16 /* server_builder_option.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_builder_option.h; path = include/grpcpp/impl/server_builder_option.h; sourceTree = ""; }; + 7997A3E2D8595195C901B2D801DC79E0 /* is_fips.c */ = {isa = PBXFileReference; includeInIndex = 1; name = is_fips.c; path = src/crypto/fipsmodule/is_fips.c; sourceTree = ""; }; + 79B0271B775AEAE70F68A6C7694DA390 /* iam_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iam_credentials.h; path = src/core/lib/security/credentials/iam/iam_credentials.h; sourceTree = ""; }; + 79F4076575012C7494D398ABBEC45A18 /* event_string.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = event_string.h; path = src/core/lib/surface/event_string.h; sourceTree = ""; }; + 7A290933D22627E2926DEFF22D4A65B2 /* wakeup_fd_pipe.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wakeup_fd_pipe.h; path = src/core/lib/iomgr/wakeup_fd_pipe.h; sourceTree = ""; }; + 7A61CB6282EDA84F6EF761E93939C0C8 /* field_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = field_filter.cc; path = Firestore/core/src/core/field_filter.cc; sourceTree = ""; }; + 7A6418A56C5DC3D60630153E76811E78 /* string_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_posix.cc; path = src/core/lib/gpr/string_posix.cc; sourceTree = ""; }; + 7A99561B4F8B50B1BF0C7246EC47ED83 /* subchannel_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_interface.h; path = src/core/ext/filters/client_channel/subchannel_interface.h; sourceTree = ""; }; + 7ADA79FF6900CC9538575985CA827E5D /* error_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_utils.h; path = src/core/lib/transport/error_utils.h; sourceTree = ""; }; + 7AE6E2132EF7656B6810B0DB4FC5610B /* check_gcp_environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = check_gcp_environment.h; path = src/core/lib/security/credentials/alts/check_gcp_environment.h; sourceTree = ""; }; + 7AEC4A4833E5091B3CDD7E1815A8690F /* cpu-intel.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-intel.c"; path = "src/crypto/cpu-intel.c"; sourceTree = ""; }; + 7AFBFAF71709356F760579AFDDDBBDD0 /* tcp_server_utils_posix_noifaddrs.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_utils_posix_noifaddrs.cc; path = src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc; sourceTree = ""; }; + 7B2B4A836335C82CB5CBDC1D12EA8755 /* cct.nanopb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cct.nanopb.c; path = GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c; sourceTree = ""; }; + 7B2DCC6B174ED373F1002AA6B1FE1FD0 /* leveldb_migrations.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_migrations.cc; path = Firestore/core/src/local/leveldb_migrations.cc; sourceTree = ""; }; + 7B3A25BF47C9C8ABB7FF4323152EFAA8 /* http2_errors.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http2_errors.h; path = src/core/lib/transport/http2_errors.h; sourceTree = ""; }; + 7B4769859D5231F4C0D6C91D8186CEF9 /* rc4.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rc4.h; path = src/include/openssl/rc4.h; sourceTree = ""; }; + 7B494F5BF50EAC5CFEC559B42BFF63D4 /* utility.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = utility.h; path = absl/utility/utility.h; sourceTree = ""; }; + 7B57CC3581A2F1C36A41FC92FD471066 /* cycleclock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cycleclock.h; path = absl/base/internal/cycleclock.h; sourceTree = ""; }; + 7B5E392FE59043AAD544555ABE745D5E /* frame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame.h; path = src/core/ext/transport/chttp2/transport/frame.h; sourceTree = ""; }; + 7B740FD698E3CA13E378DAA34EFEF3D6 /* xds.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds.cc; path = src/core/ext/filters/client_channel/lb_policy/xds/xds.cc; sourceTree = ""; }; + 7BB37BE5B2BFA000FB346F2FCFF797AF /* transport_security_common.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_common.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h"; sourceTree = ""; }; + 7BCBBF4B51DF8811C70E4A89B8051019 /* metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata.h; path = src/core/lib/transport/metadata.h; sourceTree = ""; }; + 7BD3F0B6294C4ADB164D918CC624806E /* snapshot.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = snapshot.h; path = db/snapshot.h; sourceTree = ""; }; + 7BED3B9FF8A2A7FD773ECEB065FA95D9 /* pkcs8.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pkcs8.c; path = src/crypto/pkcs8/pkcs8.c; sourceTree = ""; }; + 7C1153C3709FD9A3F88D22CA47AC1150 /* encode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = encode.h; path = third_party/upb/upb/encode.h; sourceTree = ""; }; + 7C34E45B0FE3B78A67E97766592B8092 /* debug_location.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = debug_location.h; path = src/core/lib/gprpp/debug_location.h; sourceTree = ""; }; + 7C5717E23D4A6FBC8DA13F9A13BD24E2 /* call_test_only.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_test_only.h; path = src/core/lib/surface/call_test_only.h; sourceTree = ""; }; + 7C5EF2CBC6AD04A4862AAD83FA3CD8CB /* executor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = executor.h; path = src/core/lib/iomgr/executor.h; sourceTree = ""; }; + 7C6BA9D63B2C822DB021273F3CF14AD6 /* percent_encoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = percent_encoding.h; path = src/core/lib/slice/percent_encoding.h; sourceTree = ""; }; + 7C81D2805D217ED5A120F4A8DF0C7155 /* compressed_tuple.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compressed_tuple.h; path = absl/container/internal/compressed_tuple.h; sourceTree = ""; }; + 7C8D7E925E144EAD5330FA5794C9806D /* sync_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sync_posix.cc; path = src/core/lib/gpr/sync_posix.cc; sourceTree = ""; }; + 7C9C024C5645D13D545A3DE06DB6CEB5 /* abseil.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abseil.debug.xcconfig; sourceTree = ""; }; + 7D2D7144CD2FBB31B0573D211A5F8DE0 /* incoming_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = incoming_metadata.h; path = src/core/ext/transport/chttp2/transport/incoming_metadata.h; sourceTree = ""; }; + 7D410CF41A7E0B4E07C0FD7ACBF5CD79 /* health.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h"; sourceTree = ""; }; + 7D4BEF4E82F2C880C20B283963A36281 /* http_server_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_server_filter.h; path = src/core/ext/filters/http/server/http_server_filter.h; sourceTree = ""; }; + 7D530914D66EE4A4CFD0752FB8BBA1AF /* document.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document.cc; path = Firestore/core/src/model/document.cc; sourceTree = ""; }; + 7D56DE1BC949B4B4F93C71C452A035AF /* d1_srtp.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = d1_srtp.cc; path = src/ssl/d1_srtp.cc; sourceTree = ""; }; + 7D6A83C6D09A90628B7283F3B9B07679 /* Firebase.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Firebase.release.xcconfig; sourceTree = ""; }; + 7D8D6088A70D6AB4121D10AC4DABF491 /* table_builder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = table_builder.cc; path = table/table_builder.cc; sourceTree = ""; }; + 7DE01779F467CAAE296AEF402CBDCDDA /* per_thread_tls.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = per_thread_tls.h; path = absl/base/internal/per_thread_tls.h; sourceTree = ""; }; + 7DE1C42CE15129988D16C61CA17BF384 /* stream_lists.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream_lists.cc; path = src/core/ext/transport/chttp2/transport/stream_lists.cc; sourceTree = ""; }; + 7DF8C48F21446CE136BCDCD21F125F85 /* block_builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = block_builder.h; path = table/block_builder.h; sourceTree = ""; }; + 7E24185D3511A625C74BB0E395BED9B7 /* attributes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = attributes.h; path = absl/base/attributes.h; sourceTree = ""; }; + 7E285DDF18479012AA88E1D105A1CECA /* document_reference.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_reference.cc; path = Firestore/core/src/api/document_reference.cc; sourceTree = ""; }; + 7E28F5EE7EBCCD7499F26B97589268F2 /* flow_control.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = flow_control.h; path = src/core/ext/transport/chttp2/transport/flow_control.h; sourceTree = ""; }; + 7E45E0505735AA32522C1F2F67FFAB0A /* Pods-SaraAttended.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SaraAttended.release.xcconfig"; sourceTree = ""; }; + 7E5B04F1DA47B2A8B8880DC91CB6545B /* serializer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = serializer.cc; path = Firestore/core/src/remote/serializer.cc; sourceTree = ""; }; + 7E88F3326149071F9EF148B778F3473B /* numbers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = numbers.h; path = absl/strings/numbers.h; sourceTree = ""; }; + 7E8E9D3A62322EB1CDF58810A2198A43 /* FSTFirestoreComponent.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FSTFirestoreComponent.mm; path = Firestore/Source/API/FSTFirestoreComponent.mm; sourceTree = ""; }; + 7E91272A9A7BE8B8CBBCD7314930800E /* ref_counted_ptr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ref_counted_ptr.h; path = src/core/lib/gprpp/ref_counted_ptr.h; sourceTree = ""; }; + 7E9BFB96EF97B46DA6BBE29783375AA5 /* grpc_service.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_service.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c"; sourceTree = ""; }; + 7E9F7C6F8DDC8752F34EB27B2EA45038 /* huffsyms.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = huffsyms.h; path = src/core/ext/transport/chttp2/transport/huffsyms.h; sourceTree = ""; }; + 7EC7EE331E3AF2872E4A697275BBA7CC /* wakeup_fd_nospecial.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wakeup_fd_nospecial.cc; path = src/core/lib/iomgr/wakeup_fd_nospecial.cc; sourceTree = ""; }; + 7ECF9171AD5E45786ECEE9F91D9B2092 /* percent.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = percent.upb.h; path = "src/core/ext/upb-generated/envoy/type/percent.upb.h"; sourceTree = ""; }; + 7ED18D5D434887DC1392437A8F376A33 /* security_handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_handshaker.h; path = src/core/lib/security/transport/security_handshaker.h; sourceTree = ""; }; + 7ED9237D85289C5307DA6BABB50E35C9 /* client_unary_call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_unary_call.h; path = include/grpcpp/impl/codegen/client_unary_call.h; sourceTree = ""; }; + 7EE26BC24756397D2051B7CC194EF0D1 /* call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call.h; path = include/grpcpp/impl/call.h; sourceTree = ""; }; + 7EF8D8C6613AB7477BACC0DC69B5887A /* time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time.h; path = include/grpcpp/impl/codegen/time.h; sourceTree = ""; }; + 7F14E9F77AAA2F88330E0F2606B3603B /* a_d2i_fp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_d2i_fp.c; path = src/crypto/asn1/a_d2i_fp.c; sourceTree = ""; }; + 7F20603543688FE7E0F7E0D499F90045 /* FIRComponentContainerInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponentContainerInternal.h; path = FirebaseCore/Sources/FIRComponentContainerInternal.h; sourceTree = ""; }; + 7F41B21455F534A1E5E49F2F1D820869 /* semantic_version.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = semantic_version.upb.c; path = "src/core/ext/upb-generated/envoy/type/semantic_version.upb.c"; sourceTree = ""; }; + 7F540B5A9B6E44693FB42012CFF51A28 /* int128.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = int128.h; path = absl/numeric/int128.h; sourceTree = ""; }; + 7FA59C12BFEBBCE17D29BBE9163CE881 /* time_zone_fixed.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_fixed.h; path = absl/time/internal/cctz/src/time_zone_fixed.h; sourceTree = ""; }; + 7FA8F6C3A5A28CE127CB531C6F55F598 /* udp_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = udp_server.h; path = src/core/lib/iomgr/udp_server.h; sourceTree = ""; }; + 7FAA70998AC724B983615D3640996345 /* lockfree_event.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = lockfree_event.cc; path = src/core/lib/iomgr/lockfree_event.cc; sourceTree = ""; }; + 7FD55D078350569E123F008748C531D9 /* ostringstream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ostringstream.h; path = absl/strings/internal/ostringstream.h; sourceTree = ""; }; + 7FD6DDDB94DDFDFE7FEA3A4AE283F1AE /* FIRCoreDiagnosticsConnector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsConnector.h; path = FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h; sourceTree = ""; }; + 8007CB382231B37504C9AF7B4CED259C /* gethostname_sysconf.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = gethostname_sysconf.cc; path = src/core/lib/iomgr/gethostname_sysconf.cc; sourceTree = ""; }; + 800E626DBE4ED7CB7F1761804AAFD80F /* pair.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pair.c; path = src/crypto/bio/pair.c; sourceTree = ""; }; + 8011B9576572A2EF5FCEDFB78383C91C /* document_key.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_key.cc; path = Firestore/core/src/model/document_key.cc; sourceTree = ""; }; + 801E5CBA2EEDBB1637FD98EEED2AA2FA /* raw_hash_set.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = raw_hash_set.cc; path = absl/container/internal/raw_hash_set.cc; sourceTree = ""; }; + 8028A5B3D7DA53E4582C3E730E757ED0 /* inline_variable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inline_variable.h; path = absl/base/internal/inline_variable.h; sourceTree = ""; }; + 8076CA75CD2587BBFEBA18201CF95B38 /* NSURLSession+GULPromises.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+GULPromises.m"; path = "GoogleUtilities/Environment/URLSessionPromiseWrapper/NSURLSession+GULPromises.m"; sourceTree = ""; }; + 807D6B561A3D702B1D4139FF75965BC3 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/x509/internal.h; sourceTree = ""; }; + 80B9DC6C22839E8DD2A57F8F22A7DE9F /* wakeup_fd_pipe.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wakeup_fd_pipe.h; path = src/core/lib/iomgr/wakeup_fd_pipe.h; sourceTree = ""; }; + 80C720B0399FCC99B19B600E3D4E3241 /* load_reporting.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_reporting.h; path = include/grpc/load_reporting.h; sourceTree = ""; }; + 80E0C8984F1B7F9983C944D5DFAF80CC /* check.c */ = {isa = PBXFileReference; includeInIndex = 1; name = check.c; path = src/crypto/dh/check.c; sourceTree = ""; }; + 80E662C826D669430F44C6DBB92E8340 /* stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stats.h; path = src/core/lib/debug/stats.h; sourceTree = ""; }; + 817883CCBF46D67DDF23023B09E8DA08 /* v3_lib.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_lib.c; path = src/crypto/x509v3/v3_lib.c; sourceTree = ""; }; + 81A5F5C7035B2C87A24CF7B069A42CEB /* memory_lru_reference_delegate.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_lru_reference_delegate.cc; path = Firestore/core/src/local/memory_lru_reference_delegate.cc; sourceTree = ""; }; + 81AD0A969365DC86D49B97CBAD3E8F76 /* logging.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = logging.h; path = util/logging.h; sourceTree = ""; }; + 81DA4CB165A8EEC88E496A06AC7CB66B /* call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call.h; path = src/core/lib/surface/call.h; sourceTree = ""; }; + 81DB1ADA388DC2C495267B1FADF5CBB0 /* rsa_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsa_asn1.c; path = src/crypto/rsa_extra/rsa_asn1.c; sourceTree = ""; }; + 81E97ABEB1C53416EB4D3DF76FBD61A3 /* schedule.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = schedule.cc; path = Firestore/core/src/util/schedule.cc; sourceTree = ""; }; + 822D0C3423CF2B5CA2E2F2473A5EEBE8 /* metadata_batch.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = metadata_batch.cc; path = src/core/lib/transport/metadata_batch.cc; sourceTree = ""; }; + 8232A5190580C321ACD7B0B164990349 /* x509_vfy.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_vfy.c; path = src/crypto/x509/x509_vfy.c; sourceTree = ""; }; + 824AF003EBE6F43313C49AA798BD7D1F /* ssl_cipher.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_cipher.cc; path = src/ssl/ssl_cipher.cc; sourceTree = ""; }; + 824BEE1922AB5E669D432F166209355C /* array_contains_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = array_contains_filter.cc; path = Firestore/core/src/core/array_contains_filter.cc; sourceTree = ""; }; + 824DC6191395B2C833E1B6EBDCEE127A /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/poly1305/internal.h; sourceTree = ""; }; + 8250B6E23F5C421DC9D28BDE6F0EFAE8 /* frame_goaway.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_goaway.cc; path = src/core/ext/transport/chttp2/transport/frame_goaway.cc; sourceTree = ""; }; + 8254CFF2C7E0B6547CF1CA30A9DF8BFB /* export.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = export.h; path = include/leveldb/export.h; sourceTree = ""; }; + 8258B53CD53B6F137AAE2FA93E035D01 /* int128_no_intrinsic.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = int128_no_intrinsic.inc; path = absl/numeric/int128_no_intrinsic.inc; sourceTree = ""; }; + 82724BD93847DB1AB3C0ED9BACF9AF3F /* status.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status.cc; path = util/status.cc; sourceTree = ""; }; + 82954EE9A25E2F2FCAE05D9C23D21A7A /* FIRDiagnosticsData.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRDiagnosticsData.m; path = FirebaseCore/Sources/FIRDiagnosticsData.m; sourceTree = ""; }; + 82A89F71266C2B167BD5E06F28B90A81 /* dynamic_annotations.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dynamic_annotations.cc; path = absl/base/dynamic_annotations.cc; sourceTree = ""; }; + 82D93A5AD910DC73DCD6E4F52DB0BEBC /* log_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_posix.cc; path = src/core/lib/gpr/log_posix.cc; sourceTree = ""; }; + 82DA192B1B982D663E101F0873EB2796 /* transport_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_impl.h; path = src/core/lib/transport/transport_impl.h; sourceTree = ""; }; + 82E5DE088CB05468F250C8633566A51B /* a_type.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_type.c; path = src/crypto/asn1/a_type.c; sourceTree = ""; }; + 82FBA47BD6F5524762E00CFE3EB1CAC1 /* filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filter.cc; path = Firestore/core/src/core/filter.cc; sourceTree = ""; }; + 831276D94483FF24EF64BB31C8965B48 /* tcp_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_posix.h; path = src/core/lib/iomgr/tcp_posix.h; sourceTree = ""; }; + 83166E85990B302FE401B09ACD1311FA /* timeout_encoding.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timeout_encoding.cc; path = src/core/lib/transport/timeout_encoding.cc; sourceTree = ""; }; + 831E811655F45D87C159FD46B12B9033 /* create_thread_identity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = create_thread_identity.cc; path = absl/synchronization/internal/create_thread_identity.cc; sourceTree = ""; }; + 832C6F139A846A69D6D942898C54F600 /* transform_operation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transform_operation.cc; path = Firestore/core/src/model/transform_operation.cc; sourceTree = ""; }; + 835524689A096870E9893C71B94C253A /* resource.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource.upb.h; path = "src/core/ext/upb-generated/envoy/annotations/resource.upb.h"; sourceTree = ""; }; + 838EE7D040CA97C0B0579B335E85DB63 /* sqrt.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sqrt.c; path = src/crypto/fipsmodule/bn/sqrt.c; sourceTree = ""; }; + 8397A89A565E7E8601D622B9A7D3B8DA /* string_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_windows.h; path = src/core/lib/gpr/string_windows.h; sourceTree = ""; }; + 83FBF2ADBA37C6AE104DA0354C416D7A /* bdp_estimator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bdp_estimator.h; path = src/core/lib/transport/bdp_estimator.h; sourceTree = ""; }; + 8429896309152F60325A57BE1CFE6382 /* dns_resolver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dns_resolver.cc; path = src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc; sourceTree = ""; }; + 842F145C13D43826889D805C80496C5B /* migrate.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = migrate.upb.h; path = "src/core/ext/upb-generated/udpa/annotations/migrate.upb.h"; sourceTree = ""; }; + 844B32EF2F526691F84CCD70FFC79797 /* FirebaseCoreInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FirebaseCoreInternal.h; path = FirebaseCore/Sources/Private/FirebaseCoreInternal.h; sourceTree = ""; }; + 8458232314DD82060D06DB2B6FC52765 /* authority.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = authority.cc; path = src/core/ext/transport/chttp2/client/authority.cc; sourceTree = ""; }; + 8464DF14361766A9E158A6E361BF2886 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 849846AEF2F51C4CB13E792477B368AC /* channel_argument_option.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_argument_option.cc; path = src/cpp/server/channel_argument_option.cc; sourceTree = ""; }; + 84B82D9E038D349AF015B40853CD1C09 /* config_source.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = config_source.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h"; sourceTree = ""; }; + 84BFD27E9223734B6A049858399B753A /* GULAppEnvironmentUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULAppEnvironmentUtil.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULAppEnvironmentUtil.h; sourceTree = ""; }; + 84D2ACEE111EDDF5B6DA799B4694EC47 /* discovery.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = discovery.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h"; sourceTree = ""; }; + 84E118DE4D5140F0155C18244BB54563 /* wakeup_fd_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wakeup_fd_posix.h; path = src/core/lib/iomgr/wakeup_fd_posix.h; sourceTree = ""; }; + 84E4957692C9D0E838B00A0F2D9C6327 /* ssl_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_utils.h; path = src/core/lib/security/security_connector/ssl_utils.h; sourceTree = ""; }; + 853299A1FB498B3CC03E06CFB16D1343 /* ev_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_posix.h; path = src/core/lib/iomgr/ev_posix.h; sourceTree = ""; }; + 853D2A565D62967727699E29EF2CFB9E /* port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port.h; path = absl/base/port.h; sourceTree = ""; }; + 853E4770089A2A0408D662C02A2BE157 /* exception.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = exception.cc; path = Firestore/core/src/util/exception.cc; sourceTree = ""; }; + 8540F15ED4ADD1999CB3E095288A21AE /* port_undef.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = port_undef.inc; path = third_party/upb/upb/port_undef.inc; sourceTree = ""; }; + 8545DCD9A87148D45FCF694311196747 /* atomic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atomic.h; path = src/core/lib/gprpp/atomic.h; sourceTree = ""; }; + 85604F44CA83C0ED88AB459B44401B9E /* symbolize.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = symbolize.cc; path = absl/debugging/symbolize.cc; sourceTree = ""; }; + 85670E29ADEF6733450704AE375AD102 /* Pods-SaraAttended-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SaraAttended-acknowledgements.plist"; sourceTree = ""; }; + 856B5CD56F194FAD26EA91620B66D614 /* GoogleDataTransport */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GoogleDataTransport; path = GoogleDataTransport.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 85A14766BA2D6B6486854D6FCF02E73A /* engine.c */ = {isa = PBXFileReference; includeInIndex = 1; name = engine.c; path = src/crypto/engine/engine.c; sourceTree = ""; }; + 85A207A4B852EADD49DBB92DA94DC3A4 /* status.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.h; path = include/grpc/impl/codegen/status.h; sourceTree = ""; }; + 85B7A8746B944A38ED662B6933651D2C /* pretty_function.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pretty_function.h; path = absl/base/internal/pretty_function.h; sourceTree = ""; }; + 85E4D776F4BAFAC065AFBFBFF6EE4B69 /* http_uri.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_uri.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h"; sourceTree = ""; }; + 85FEB2491ED23AABC904F7B1B658C7D8 /* aead.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = aead.h; path = src/include/openssl/aead.h; sourceTree = ""; }; + 85FFCED5A0CCC2D40E4F4DC4C276FF66 /* FIRQuery.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRQuery.h; path = Firestore/Source/Public/FirebaseFirestore/FIRQuery.h; sourceTree = ""; }; + 864AFAAA65DA21BF2A41FD914BB15027 /* abseil-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "abseil-umbrella.h"; sourceTree = ""; }; + 865F0DE0A1B753003270A8745C554008 /* gRPC-Core-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "gRPC-Core-prefix.pch"; sourceTree = ""; }; + 86774CC4E513D98DAA8A5937084DF598 /* sockaddr_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_utils.h; path = src/core/lib/iomgr/sockaddr_utils.h; sourceTree = ""; }; + 86828F9E80D747789AB8A9F20ACCB2D6 /* server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server.h; path = src/core/lib/surface/server.h; sourceTree = ""; }; + 86B2907AE026FB981D8504EF0B529FD5 /* FIRDependency.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRDependency.m; path = FirebaseCore/Sources/FIRDependency.m; sourceTree = ""; }; + 86EA1E2DF13B4C433704BBFE070A2689 /* gcd.c */ = {isa = PBXFileReference; includeInIndex = 1; name = gcd.c; path = src/crypto/fipsmodule/bn/gcd.c; sourceTree = ""; }; + 87111EA4F321503D9A46A671CA8D5A34 /* migrate.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = migrate.upb.h; path = "src/core/ext/upb-generated/udpa/annotations/migrate.upb.h"; sourceTree = ""; }; + 8741C6DA08968E7E1200FFE615AE7384 /* stacktrace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stacktrace.h; path = absl/debugging/stacktrace.h; sourceTree = ""; }; + 87629CC7AB3D5C63FC604777868B6FCE /* async_unary_call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_unary_call.h; path = include/grpcpp/support/async_unary_call.h; sourceTree = ""; }; + 8768E92C1DE2FF698FBEADFD59195034 /* sys_epoll_wrapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sys_epoll_wrapper.h; path = src/core/lib/iomgr/sys_epoll_wrapper.h; sourceTree = ""; }; + 877F80FE844F159AEB3712C281F3441A /* load_balancer.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_balancer.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h"; sourceTree = ""; }; + 8786A18496EFE7861919F652FA534D5A /* iomgr_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_uv.cc; path = src/core/lib/iomgr/iomgr_uv.cc; sourceTree = ""; }; + 879D1366693D17BFFD22A9411AA44EE7 /* secure_auth_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = secure_auth_context.h; path = src/cpp/common/secure_auth_context.h; sourceTree = ""; }; + 879D1DA6F99C4758AF4422AFC9DC4A14 /* v3_utl.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_utl.c; path = src/crypto/x509v3/v3_utl.c; sourceTree = ""; }; + 879DFADF4518007F490FA85EBB2C668C /* pkcs7_x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pkcs7_x509.c; path = src/crypto/pkcs7/pkcs7_x509.c; sourceTree = ""; }; + 87C4D55119C30A31119CF079FDA56C98 /* identity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = identity.h; path = absl/base/internal/identity.h; sourceTree = ""; }; + 87E1EDC9D257A4A6ABD96CB40C8CB318 /* alts_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_credentials.h; path = src/core/lib/security/credentials/alts/alts_credentials.h; sourceTree = ""; }; + 87E31D3E0C681884709B709A5913C273 /* server_builder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_builder.cc; path = src/cpp/server/server_builder.cc; sourceTree = ""; }; + 8821CF5AA9CE91D5372EDE8DC54F0B67 /* FIRCoreDiagnostics.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnostics.h; path = Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnostics.h; sourceTree = ""; }; + 882C41FE349F253C9BDC4BAA5D56AA83 /* channel_stack_builder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_stack_builder.cc; path = src/core/lib/channel/channel_stack_builder.cc; sourceTree = ""; }; + 88366B1CB2700DEA09298D9116E88222 /* x_attrib.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_attrib.c; path = src/crypto/x509/x_attrib.c; sourceTree = ""; }; + 8839BEFA32CCD9B91B6BC39C67B68F8A /* graphcycles.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = graphcycles.h; path = absl/synchronization/internal/graphcycles.h; sourceTree = ""; }; + 884024A8F005AC8A9CC7CA68172EC129 /* grpc_ares_wrapper_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_wrapper_posix.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc; sourceTree = ""; }; + 885FA52C1E81313350937E7C8E8BA430 /* firebase_auth_credentials_provider_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = firebase_auth_credentials_provider_apple.mm; path = Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.mm; sourceTree = ""; }; + 8863A0A2EEE3B9B8D719AA20A04F1242 /* convert.c */ = {isa = PBXFileReference; includeInIndex = 1; name = convert.c; path = src/crypto/bn_extra/convert.c; sourceTree = ""; }; + 8864C298C949190986138E5DA22979B1 /* FBLPromise+Race.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Race.m"; path = "Sources/FBLPromises/FBLPromise+Race.m"; sourceTree = ""; }; + 8875E9D3E11A77D985AFF88AD7F3E264 /* civil_time_detail.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = civil_time_detail.h; path = absl/time/internal/cctz/include/cctz/civil_time_detail.h; sourceTree = ""; }; + 8885F9F52FB0E7DBAFB11CB199ED9BBA /* field_transform.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = field_transform.cc; path = Firestore/core/src/model/field_transform.cc; sourceTree = ""; }; + 88A3FB44FE70B7E9E33EEA41F70B0C31 /* FirebaseFirestore-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FirebaseFirestore-umbrella.h"; sourceTree = ""; }; + 88A6957092676D8EB869B41B41819646 /* murmur_hash.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = murmur_hash.cc; path = src/core/lib/gpr/murmur_hash.cc; sourceTree = ""; }; + 88A6C8E4489828DA24B200A2703AC586 /* FirebaseFirestore.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseFirestore.release.xcconfig; sourceTree = ""; }; + 88C2B6303463ECACF12ACE641E759FE6 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/modes/internal.h; sourceTree = ""; }; + 88E4B60C142EE92DB724A96E3D2CE314 /* background_queue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = background_queue.cc; path = Firestore/core/src/util/background_queue.cc; sourceTree = ""; }; + 88FDEDAD0531906F2A06282D40C09148 /* arena.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arena.h; path = src/core/lib/gprpp/arena.h; sourceTree = ""; }; + 892FCC179A98C6081F21DC4D6B5E3B6D /* FIRQuery.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRQuery.mm; path = Firestore/Source/API/FIRQuery.mm; sourceTree = ""; }; + 89303FDAAD8DD96F373292A08440E650 /* x_spki.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_spki.c; path = src/crypto/x509/x_spki.c; sourceTree = ""; }; + 8934264C38A2DDF44C859974DDF76E4A /* executor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = executor.h; path = src/core/lib/iomgr/executor.h; sourceTree = ""; }; + 89762919352304B630804EA6DC787FC6 /* optional.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = optional.h; path = absl/types/internal/optional.h; sourceTree = ""; }; + 898A07FB8760FC2672D23FD7383A791A /* port.c */ = {isa = PBXFileReference; includeInIndex = 1; name = port.c; path = third_party/upb/upb/port.c; sourceTree = ""; }; + 89A501D9B8CCD468D97F793DC06F27B6 /* grpc_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_context.cc; path = src/core/ext/filters/census/grpc_context.cc; sourceTree = ""; }; + 89B5CC08F0D78B71F647EE48083C853A /* byte_stream_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_stream_apple.mm; path = Firestore/core/src/util/byte_stream_apple.mm; sourceTree = ""; }; + 89D948E74EED8DE4CAECEBC82CCBE3FD /* BoringSSL-GRPC-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "BoringSSL-GRPC-prefix.pch"; sourceTree = ""; }; + 89E3B61C1FA389415F778362F7DDFC93 /* stats_data.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stats_data.cc; path = src/core/lib/debug/stats_data.cc; sourceTree = ""; }; + 8A083812C2D9429FC64452F44F8AE8A6 /* pcy_node.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_node.c; path = src/crypto/x509v3/pcy_node.c; sourceTree = ""; }; + 8A51EC75B0D406765BE75771944A63CE /* metadata_array.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = metadata_array.cc; path = src/core/lib/surface/metadata_array.cc; sourceTree = ""; }; + 8A530D16A35BA070587ECB2A518590E4 /* backend_metric.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backend_metric.h; path = src/core/ext/filters/client_channel/backend_metric.h; sourceTree = ""; }; + 8A543609844C6990EDD87FDAACDEDE63 /* GDTCORUploadBatch.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORUploadBatch.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORUploadBatch.m; sourceTree = ""; }; + 8A5F0918CD5C118C2DEA9DD06AAE03B7 /* pb_common.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_common.c; sourceTree = ""; }; + 8A6B0F28E4A1E1C85C8C3B0F7A8E8C22 /* filesystem_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = filesystem_apple.mm; path = Firestore/core/src/util/filesystem_apple.mm; sourceTree = ""; }; + 8A6FBD8C15F233AB29F00632508099D3 /* sys_epoll_wrapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sys_epoll_wrapper.h; path = src/core/lib/iomgr/sys_epoll_wrapper.h; sourceTree = ""; }; + 8A82A7E8392D43AF8038FF0F727AD5AB /* socket_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_utils.h; path = src/core/lib/iomgr/socket_utils.h; sourceTree = ""; }; + 8A8B64D12B101D6945DBF2E662876660 /* security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_connector.h; path = src/core/lib/security/security_connector/security_connector.h; sourceTree = ""; }; + 8A8CD361B2A2D4A86816AFA83E23A5C7 /* eds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = eds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h"; sourceTree = ""; }; + 8ABA3904F1F65AC67FE1F4EB01534486 /* chttp2_server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = chttp2_server.cc; path = src/core/ext/transport/chttp2/server/chttp2_server.cc; sourceTree = ""; }; + 8AD08B5926A35F7E6906761F0DBC47EA /* sockaddr_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_windows.h; path = src/core/lib/iomgr/sockaddr_windows.h; sourceTree = ""; }; + 8AE634B6B9748B1FA94196BC908BED03 /* call_log_batch.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = call_log_batch.cc; path = src/core/lib/surface/call_log_batch.cc; sourceTree = ""; }; + 8AFDD73E6EB84B430A2B2FC445718D4A /* socket_mutator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_mutator.h; path = src/core/lib/iomgr/socket_mutator.h; sourceTree = ""; }; + 8B0BEA16D51DF53608E34D4D740CDDE6 /* inlined_vector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inlined_vector.h; path = absl/container/inlined_vector.h; sourceTree = ""; }; + 8B1FD4A85E64A8BA3121F8DCCED3AC75 /* FBLPromise+Catch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Catch.h"; path = "Sources/FBLPromises/include/FBLPromise+Catch.h"; sourceTree = ""; }; + 8B34C190B1DE501246389F79CFB5E4E9 /* gcm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = gcm.c; path = src/crypto/fipsmodule/modes/gcm.c; sourceTree = ""; }; + 8B74CE35B81363F1FABC595B676CED52 /* range.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = range.upb.h; path = "src/core/ext/upb-generated/envoy/type/range.upb.h"; sourceTree = ""; }; + 8BB144CDCE0996B1EB850A6F510E0DB9 /* is_epollexclusive_available.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = is_epollexclusive_available.h; path = src/core/lib/iomgr/is_epollexclusive_available.h; sourceTree = ""; }; + 8BB180D91ADEB406F8D06B6685881A4F /* srds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = srds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/srds.upb.h"; sourceTree = ""; }; + 8BD6BA7A02447C17B981A29DEC24BE90 /* format.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = format.cc; path = absl/time/format.cc; sourceTree = ""; }; + 8BE76444A49FA1615624EAE8A8FE1EBD /* frame_settings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_settings.h; path = src/core/ext/transport/chttp2/transport/frame_settings.h; sourceTree = ""; }; + 8C20E5941418C595010D3682C18A08A3 /* async_stream_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_stream_impl.h; path = include/grpcpp/support/async_stream_impl.h; sourceTree = ""; }; + 8C3E1E8DA0687EF03F3768202880B8A7 /* socket_utils_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_utils_linux.cc; path = src/core/lib/iomgr/socket_utils_linux.cc; sourceTree = ""; }; + 8C6751218E0A1A314A66BDB34A4449FD /* workaround_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = workaround_utils.h; path = src/core/ext/filters/workarounds/workaround_utils.h; sourceTree = ""; }; + 8C6EE08C23D04559BACCC047EFFB9509 /* status.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.h; path = include/grpcpp/support/status.h; sourceTree = ""; }; + 8C7FBB93F710929F2C6A73568B22F2EF /* object_value.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = object_value.cc; path = Firestore/core/src/model/object_value.cc; sourceTree = ""; }; + 8CA9118C0853A93F8E99CD19D4812CB8 /* channelz_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channelz_registry.h; path = src/core/lib/channel/channelz_registry.h; sourceTree = ""; }; + 8CC8A3ADBDB9807C72DD61D696EB6CCB /* call_once.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_once.h; path = absl/base/call_once.h; sourceTree = ""; }; + 8CC9178C366942FD6FF6A115604EAD58 /* FirebaseCoreDiagnostics */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FirebaseCoreDiagnostics; path = FirebaseCoreDiagnostics.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8CE8A7E1DAF671E45FCD30CEC4C03F3C /* v3_pku.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_pku.c; path = src/crypto/x509v3/v3_pku.c; sourceTree = ""; }; + 8D091AC3E9EEBAFA30C41554EDE4AB0F /* leveldb-library-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "leveldb-library-dummy.m"; sourceTree = ""; }; + 8D44F4656224F3AD7F22416E7792E57E /* udp_server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = udp_server.cc; path = src/core/lib/iomgr/udp_server.cc; sourceTree = ""; }; + 8D56C137E519B6142CA42469541BC972 /* bio_ssl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bio_ssl.cc; path = src/ssl/bio_ssl.cc; sourceTree = ""; }; + 8D6B6C481B59F703670039972DB53612 /* t_req.c */ = {isa = PBXFileReference; includeInIndex = 1; name = t_req.c; path = src/crypto/x509/t_req.c; sourceTree = ""; }; + 8D8A1B85D95A6C08C2FB1E546DCE0897 /* v3_pci.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_pci.c; path = src/crypto/x509v3/v3_pci.c; sourceTree = ""; }; + 8DF70E24F7BC596A07F9A691DDD72420 /* set_mutation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = set_mutation.cc; path = Firestore/core/src/model/set_mutation.cc; sourceTree = ""; }; + 8DF85470DB4C77C87BB99B22F4B60E17 /* cbb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cbb.c; path = src/crypto/bytestring/cbb.c; sourceTree = ""; }; + 8DFC650679AEF2E96E892537AB49CFE2 /* leveldb_opener.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_opener.cc; path = Firestore/core/src/local/leveldb_opener.cc; sourceTree = ""; }; + 8E2B4207D8A65104EFC655828838DD4F /* strerror.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = strerror.cc; path = Firestore/core/src/util/strerror.cc; sourceTree = ""; }; + 8E2D58AF97F55F7E1FEA485377CE7239 /* byte_buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer.h; path = include/grpcpp/impl/codegen/byte_buffer.h; sourceTree = ""; }; + 8E759C57EA1F07CB3B2FA315AC1D51E3 /* address_is_readable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = address_is_readable.h; path = absl/debugging/internal/address_is_readable.h; sourceTree = ""; }; + 8E93DF14EB4CE3B818C6A74286397264 /* memory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = memory.h; path = src/core/lib/gprpp/memory.h; sourceTree = ""; }; + 8EA211AB1988BC9248B4ED12A148C236 /* key_wrap.c */ = {isa = PBXFileReference; includeInIndex = 1; name = key_wrap.c; path = src/crypto/fipsmodule/aes/key_wrap.c; sourceTree = ""; }; + 8EB60C1294724FDC2B764EB7D5C88B93 /* async_unary_call_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_unary_call_impl.h; path = include/grpcpp/impl/codegen/async_unary_call_impl.h; sourceTree = ""; }; + 8EE307E136B53B452E84DF514986145B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 8EEC13855B0D75AF2432EAB151AE5E33 /* client_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_context.h; path = include/grpcpp/impl/codegen/client_context.h; sourceTree = ""; }; + 8F1FDB1BA88FC67EF05D1F562910ACEE /* listener.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = listener.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c"; sourceTree = ""; }; + 8F3EE303E9B2E59CE4CC163A96BFEE5F /* global_config_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_custom.h; path = src/core/lib/gprpp/global_config_custom.h; sourceTree = ""; }; + 8F3F8D9CC413B79B798AA7CC891E85DA /* order_by.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = order_by.cc; path = Firestore/core/src/core/order_by.cc; sourceTree = ""; }; + 8F46375A3AC1F39573C6A281A0AFDA7C /* FIRDependency.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDependency.h; path = FirebaseCore/Sources/Private/FIRDependency.h; sourceTree = ""; }; + 8F609D6FB2C573ED1D71736277080C20 /* thread.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread.h; path = src/include/openssl/thread.h; sourceTree = ""; }; + 8F634D50652E2BFF3B1482A0B19B47AB /* fork_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fork_posix.cc; path = src/core/lib/iomgr/fork_posix.cc; sourceTree = ""; }; + 8F6CB7668BBE5735E516AA275AAC13F4 /* time_zone_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_posix.cc; path = absl/time/internal/cctz/src/time_zone_posix.cc; sourceTree = ""; }; + 8F8D52B2C57098447E1AFBFB5325E1EB /* subchannel_list.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_list.h; path = src/core/ext/filters/client_channel/lb_policy/subchannel_list.h; sourceTree = ""; }; + 8F9BB401AA3D1C784081723BDA924AF0 /* context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = context.h; path = src/core/lib/channel/context.h; sourceTree = ""; }; + 8FCFA906BB703DD49BA7EE34935703F0 /* options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = options.cc; path = util/options.cc; sourceTree = ""; }; + 900C43A5291423E98AC6EC97FA688DCB /* tls1.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls1.h; path = src/include/openssl/tls1.h; sourceTree = ""; }; + 9019873A1D8506818A39F7F4AF4BD0AD /* alts_tsi_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_utils.h; path = src/core/tsi/alts/handshaker/alts_tsi_utils.h; sourceTree = ""; }; + 902A21C0CD0071EC5F41B75D53F069F8 /* filename.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filename.cc; path = db/filename.cc; sourceTree = ""; }; + 905EF31577DFDD0EE1E8AA78E7BA4BA5 /* iomgr_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_posix.h; path = src/core/lib/iomgr/iomgr_posix.h; sourceTree = ""; }; + 9078ABF4885664441CEBC7C246515245 /* resolving_lb_policy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolving_lb_policy.h; path = src/core/ext/filters/client_channel/resolving_lb_policy.h; sourceTree = ""; }; + 9079CFE7F4F28E98663140AF17AB39CA /* sockaddr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr.h; path = src/core/lib/iomgr/sockaddr.h; sourceTree = ""; }; + 90875E12404A0AED3656F876411F7B2F /* sync_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_posix.h; path = include/grpc/impl/codegen/sync_posix.h; sourceTree = ""; }; + 9094F3703EDFC96E4658D133A7A6BE13 /* a_digest.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_digest.c; path = src/crypto/x509/a_digest.c; sourceTree = ""; }; + 910313BAD7CAD36747FA01457BC4ECD1 /* endpoint_cfstream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint_cfstream.cc; path = src/core/lib/iomgr/endpoint_cfstream.cc; sourceTree = ""; }; + 913AB50B1D427BBFFEC3573E5A05D701 /* bio_mem.c */ = {isa = PBXFileReference; includeInIndex = 1; name = bio_mem.c; path = src/crypto/bio/bio_mem.c; sourceTree = ""; }; + 91677845D4B364197BF2B44A290AD6D3 /* log_format.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log_format.h; path = db/log_format.h; sourceTree = ""; }; + 9178E47C67BB082F4BDD3542702F00C4 /* str_format.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_format.h; path = absl/strings/str_format.h; sourceTree = ""; }; + 91B819DA7C59D3ADB341E2A09FEC3629 /* http_filters_plugin.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http_filters_plugin.cc; path = src/core/ext/filters/http/http_filters_plugin.cc; sourceTree = ""; }; + 91B9039CD50BE0BEC3FB969FDF442FF2 /* upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = upb.h; path = third_party/upb/upb/upb.h; sourceTree = ""; }; + 91F3433400AF48F6BEA7EB5CD4DAC985 /* s3_pkt.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = s3_pkt.cc; path = src/ssl/s3_pkt.cc; sourceTree = ""; }; + 91FAA086DC2883346DE8C42D4CF7DD34 /* lds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/lds.upb.h"; sourceTree = ""; }; + 91FDF7608AA718C54E5B66DC6F3D0A55 /* cpu-arm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-arm.c"; path = "src/crypto/cpu-arm.c"; sourceTree = ""; }; + 92000153CD73F7FC2DBAB4AB708269F3 /* FirebaseFirestore */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FirebaseFirestore; path = FirebaseFirestore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 92084C2699C4C3F8815767B3E4FE8D62 /* varint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = varint.h; path = src/core/ext/transport/chttp2/transport/varint.h; sourceTree = ""; }; + 92104BBBBFB6AF14462769ABCF4917BE /* unicode.c */ = {isa = PBXFileReference; includeInIndex = 1; name = unicode.c; path = src/crypto/bytestring/unicode.c; sourceTree = ""; }; + 922330D32B27D4FB78D2F47F9D40BB84 /* status_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_metadata.h; path = src/core/lib/transport/status_metadata.h; sourceTree = ""; }; + 92244E328E16F05C5111104617F374D6 /* xds_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_api.h; path = src/core/ext/filters/client_channel/xds/xds_api.h; sourceTree = ""; }; + 922DDB80D137F08C2D27133906CC7FD7 /* v3_ia5.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_ia5.c; path = src/crypto/x509v3/v3_ia5.c; sourceTree = ""; }; + 92325F123C739CEFD8A33700FCFFE023 /* tcp_client_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_client_custom.cc; path = src/core/lib/iomgr/tcp_client_custom.cc; sourceTree = ""; }; + 9238B970FFD0DA74F5DC9A34A1E40220 /* FIRListenerRegistration.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRListenerRegistration.mm; path = Firestore/Source/API/FIRListenerRegistration.mm; sourceTree = ""; }; + 925CBFE07879CED7AB664C795A2897F9 /* http_connect_handshaker.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http_connect_handshaker.cc; path = src/core/ext/filters/client_channel/http_connect_handshaker.cc; sourceTree = ""; }; + 9265B4AD0C295481ABD34E0BDEF8F5E9 /* xds_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_client.cc; path = src/core/ext/filters/client_channel/xds/xds_client.cc; sourceTree = ""; }; + 92EEEBC78DE622415462CD883B6A2914 /* mpscq.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mpscq.h; path = src/core/lib/gprpp/mpscq.h; sourceTree = ""; }; + 9308446BF8719953240026D5E0D0165C /* dumpfile.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dumpfile.h; path = include/leveldb/dumpfile.h; sourceTree = ""; }; + 931599781BE22AE7AFAA7F464416FB40 /* fixed_array.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fixed_array.h; path = absl/container/fixed_array.h; sourceTree = ""; }; + 93196289CE749EA6B5354E9285A0C9DA /* forkunsafe.c */ = {isa = PBXFileReference; includeInIndex = 1; name = forkunsafe.c; path = src/crypto/rand_extra/forkunsafe.c; sourceTree = ""; }; + 932A3E5D1959D7663E90094BD34785A0 /* resource_quota_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resource_quota_cc.cc; path = src/cpp/common/resource_quota_cc.cc; sourceTree = ""; }; + 93343EAF5E6FE24CA9CFF6ABE1740D01 /* table_cache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = table_cache.h; path = db/table_cache.h; sourceTree = ""; }; + 933637D73C2E0FBF376FDD7CAD50516C /* mpscq.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mpscq.h; path = src/core/lib/gprpp/mpscq.h; sourceTree = ""; }; + 9355D7ACA9D1415F317F40134BDE6DE9 /* FIRQuerySnapshot.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRQuerySnapshot.mm; path = Firestore/Source/API/FIRQuerySnapshot.mm; sourceTree = ""; }; + 938D47EB98925AAC75F84424C624BD35 /* gethostname.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gethostname.h; path = src/core/lib/iomgr/gethostname.h; sourceTree = ""; }; + 93A3A27DE44CC98212BFEAEEC8370E4E /* FIRConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRConfiguration.m; path = FirebaseCore/Sources/FIRConfiguration.m; sourceTree = ""; }; + 93C2111EBE4E82E47FE26059B387FDA2 /* grpc_ares_ev_driver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_ares_ev_driver.h; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h; sourceTree = ""; }; + 93CFB930C45A98DBDEAA7F0D80DDB556 /* pb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb.h; sourceTree = ""; }; + 93D38C9C89251BC76A22D5EFB217A2BF /* max_age_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = max_age_filter.h; path = src/core/ext/filters/max_age/max_age_filter.h; sourceTree = ""; }; + 93DEB4FAB9AE3DF791E5E7007329BD99 /* container.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = container.h; path = absl/algorithm/container.h; sourceTree = ""; }; + 940C94CA3A6B8836C7377E1BED8EFB97 /* digest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = digest.h; path = src/include/openssl/digest.h; sourceTree = ""; }; + 943A303D5607C52627215987F26B043C /* arena.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arena.h; path = util/arena.h; sourceTree = ""; }; + 9446F18433A710F3CFB2EFB16DC7AA03 /* subchannel_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel_interface.h; path = src/core/ext/filters/client_channel/subchannel_interface.h; sourceTree = ""; }; + 946FB238E205DD9FB93C848B9F9AEA3D /* lame_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lame_client.h; path = src/core/lib/surface/lame_client.h; sourceTree = ""; }; + 9479988C8B97951722C63AFDC64A2446 /* ssl_types.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_types.h; path = src/core/tsi/ssl_types.h; sourceTree = ""; }; + 9499EC6161BBF62D9D6CC424E6F66184 /* sync_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_stream.h; path = include/grpcpp/support/sync_stream.h; sourceTree = ""; }; + 94B99171C07D2E616847F8CC1E620728 /* channel_argument_option.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_argument_option.h; path = include/grpcpp/impl/channel_argument_option.h; sourceTree = ""; }; + 94E35964BC0034013F356E04B178FDEE /* GULSecureCoding.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULSecureCoding.m; path = GoogleUtilities/Environment/GULSecureCoding.m; sourceTree = ""; }; + 94E35B5EEC049D9F53D098CB4A231CF7 /* ssl_transcript.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_transcript.cc; path = src/ssl/ssl_transcript.cc; sourceTree = ""; }; + 95143C02666C136DC73EFABB655F1951 /* parse_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = parse_address.h; path = src/core/ext/filters/client_channel/parse_address.h; sourceTree = ""; }; + 955633B7DC07D0A78D93BAEB2A94CA07 /* handshaker_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker_registry.h; path = src/core/lib/channel/handshaker_registry.h; sourceTree = ""; }; + 955D62C0782FABCD4654EAC0D9FC3DC8 /* bio.c */ = {isa = PBXFileReference; includeInIndex = 1; name = bio.c; path = src/crypto/bio/bio.c; sourceTree = ""; }; + 9570F0DA560D5DBAD3D18157F01D9B60 /* roots.pem */ = {isa = PBXFileReference; includeInIndex = 1; name = roots.pem; path = etc/roots.pem; sourceTree = ""; }; + 957DC20A7FA2E082E900F1EE47BFAF05 /* compression_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression_args.h; path = src/core/lib/compression/compression_args.h; sourceTree = ""; }; + 958EE32A1236AB1C0679007C61ECD4F2 /* transport_op_string.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transport_op_string.cc; path = src/core/lib/transport/transport_op_string.cc; sourceTree = ""; }; + 9596881B1C2E57E2C75A0D4F5BED873F /* query_listener.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query_listener.cc; path = Firestore/core/src/core/query_listener.cc; sourceTree = ""; }; + 9598C8D3D5224BF92DA977B428DF0CE0 /* version.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = version.cc; path = src/core/lib/surface/version.cc; sourceTree = ""; }; + 95B017F647A7A78E579E26C8DC315B41 /* Pods-SaraAttended-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SaraAttended-frameworks.sh"; sourceTree = ""; }; + 95CB84ABE674CCD3BD01515FCB66FB47 /* memory_eager_reference_delegate.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_eager_reference_delegate.cc; path = Firestore/core/src/local/memory_eager_reference_delegate.cc; sourceTree = ""; }; + 95EF6C798829EE2DC030C24819EE2298 /* x_algor.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_algor.c; path = src/crypto/x509/x_algor.c; sourceTree = ""; }; + 964790B67114ECDCDA22E8BBFA1755B9 /* params.c */ = {isa = PBXFileReference; includeInIndex = 1; name = params.c; path = src/crypto/dh/params.c; sourceTree = ""; }; + 967BEABE5C0BE6793F717C6FDFEBF6B9 /* time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time.h; path = include/grpcpp/support/time.h; sourceTree = ""; }; + 96C4105852CD35C3281318D5271463CC /* manual_constructor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = manual_constructor.h; path = src/core/lib/gprpp/manual_constructor.h; sourceTree = ""; }; + 96CDF0456C64946B0AAA05382534D384 /* FSTUserDataReader.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FSTUserDataReader.mm; path = Firestore/Source/API/FSTUserDataReader.mm; sourceTree = ""; }; + 96D041460C44DBB994E1212C7E28965C /* FIRDocumentChange.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDocumentChange.h; path = Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h; sourceTree = ""; }; + 96F3D1CA3C848558BEB297E24ABC3B92 /* frame_window_update.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_window_update.h; path = src/core/ext/transport/chttp2/transport/frame_window_update.h; sourceTree = ""; }; + 96FA9461DDD51A9034CD0339B4C39969 /* optional.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = optional.h; path = src/core/lib/gprpp/optional.h; sourceTree = ""; }; + 9710FFE0600759BFF531DB88EA62873E /* buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = buffer.h; path = src/include/openssl/buffer.h; sourceTree = ""; }; + 9725C5F072EF77446F1746D2294B77DD /* alts_iovec_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_iovec_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h; sourceTree = ""; }; + 974D0D539DDB59B539BC1F7F43913A90 /* global_config_env.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_env.h; path = src/core/lib/gprpp/global_config_env.h; sourceTree = ""; }; + 975D9514E31E8C56DDB203FBA1664BBE /* memtable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = memtable.h; path = db/memtable.h; sourceTree = ""; }; + 9778EE1B2F9B8EF00AF2A8AFEFD2188F /* common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = common.h; path = absl/container/internal/common.h; sourceTree = ""; }; + 977E014A4754BB8C4B0A8CCD7E461144 /* fake_resolver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_resolver.h; path = src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h; sourceTree = ""; }; + 97978E8EF1E9A1C594B56600C302D6B7 /* authority.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = authority.h; path = src/core/ext/transport/chttp2/client/authority.h; sourceTree = ""; }; + 979966287B4F51FF3C0BA7982BA258F4 /* hash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hash.h; path = absl/hash/internal/hash.h; sourceTree = ""; }; + 980DE03C57A327190CE7C575C4E5E831 /* call_combiner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_combiner.h; path = src/core/lib/iomgr/call_combiner.h; sourceTree = ""; }; + 981429380B759381967B806CAE201AA0 /* nameser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = nameser.h; path = src/core/lib/iomgr/nameser.h; sourceTree = ""; }; + 98316369C223112281330952440BBF37 /* status_win.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status_win.cc; path = Firestore/core/src/util/status_win.cc; sourceTree = ""; }; + 9848FEB0957948F515B0706923D185AF /* httpcli.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = httpcli.cc; path = src/core/lib/http/httpcli.cc; sourceTree = ""; }; + 9880A4C51327F557D53BA02E4E2EE559 /* charconv_parse.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = charconv_parse.cc; path = absl/strings/internal/charconv_parse.cc; sourceTree = ""; }; + 989C399F3BCDD02547BB58C53307D5A8 /* alts_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_security_connector.h; path = src/core/lib/security/security_connector/alts/alts_security_connector.h; sourceTree = ""; }; + 98A3DA4893A5A28934517CD32A000891 /* pcy_cache.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_cache.c; path = src/crypto/x509v3/pcy_cache.c; sourceTree = ""; }; + 98AB66D83DAD261DD4FCB3F1607434AD /* any.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = any.h; path = absl/types/any.h; sourceTree = ""; }; + 98ABB0B301CD275ACE88D40C1D5469A3 /* composite_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = composite_credentials.h; path = src/core/lib/security/credentials/composite/composite_credentials.h; sourceTree = ""; }; + 98C1AA8E250C05999AE180D81EBAC056 /* FirebaseFirestore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FirebaseFirestore.h; path = Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h; sourceTree = ""; }; + 98C1ABA8FF18B7C09F06BAC17BBC2B2A /* e_aesctrhmac.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_aesctrhmac.c; path = src/crypto/cipher_extra/e_aesctrhmac.c; sourceTree = ""; }; + 98C2DAE80D13FFA966F0502660D6B186 /* GDTCCTNanopbHelpers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCCTNanopbHelpers.m; path = GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m; sourceTree = ""; }; + 98EC4006F852AD14461271C9A99F9586 /* hash_function_defaults.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hash_function_defaults.h; path = absl/container/internal/hash_function_defaults.h; sourceTree = ""; }; + 98F512C481C464CA50062372843DF7F2 /* pem_oth.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_oth.c; path = src/crypto/pem/pem_oth.c; sourceTree = ""; }; + 99039F2EA3DB530F4B0608A609A94DC7 /* resource_quota.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource_quota.h; path = src/core/lib/iomgr/resource_quota.h; sourceTree = ""; }; + 9912B0A906B209946FD26DB5B0E0D520 /* event_manager.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = event_manager.cc; path = Firestore/core/src/core/event_manager.cc; sourceTree = ""; }; + 991646968C4E012B3B30BAFFA98237A8 /* x_val.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_val.c; path = src/crypto/x509/x_val.c; sourceTree = ""; }; + 9920D84C7F5A89495E59B2BCC0BF8FFC /* uri_parser.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = uri_parser.cc; path = src/core/lib/uri/uri_parser.cc; sourceTree = ""; }; + 9933B495C16D5CED674CDFE5BB24FE0F /* v3_ncons.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_ncons.c; path = src/crypto/x509v3/v3_ncons.c; sourceTree = ""; }; + 9938E14D8183D70AD20895E3EFA1C295 /* ev_epollex_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ev_epollex_linux.cc; path = src/core/lib/iomgr/ev_epollex_linux.cc; sourceTree = ""; }; + 995C01AA81C73AACABB486C7669C7F2B /* histogram.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = histogram.cc; path = util/histogram.cc; sourceTree = ""; }; + 995F520A6943DE6EFE5EEB50D42738DE /* server_secure_chttp2.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_secure_chttp2.cc; path = src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc; sourceTree = ""; }; + 99726721863184562E197B43DF83EB89 /* a_bool.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_bool.c; path = src/crypto/asn1/a_bool.c; sourceTree = ""; }; + 99871DF08627BB0875ABC7F34BA94E76 /* curve25519.c */ = {isa = PBXFileReference; includeInIndex = 1; name = curve25519.c; path = src/third_party/fiat/curve25519.c; sourceTree = ""; }; + 999CBC13F0A807304CD38B03830A7894 /* pcy_map.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_map.c; path = src/crypto/x509v3/pcy_map.c; sourceTree = ""; }; + 99C1768C99CDB3B0B5FAA54D2EA764AB /* pollset_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_custom.h; path = src/core/lib/iomgr/pollset_custom.h; sourceTree = ""; }; + 99D1B1F2635C0B5AA5221EB976A3B24F /* load_system_roots.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_system_roots.h; path = src/core/lib/security/security_connector/load_system_roots.h; sourceTree = ""; }; + 99DE5ED0C45BD2BA9B0B09773462074B /* server_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_posix.cc; path = src/cpp/server/server_posix.cc; sourceTree = ""; }; + 99DEC3F82F42B837EF03657BAAC60977 /* compression_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression_args.h; path = src/core/lib/compression/compression_args.h; sourceTree = ""; }; + 99F3C52BCD05EBFA3D648E038A0A31CA /* comparator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = comparator.h; path = include/leveldb/comparator.h; sourceTree = ""; }; + 9A00BBB980AE203C34BBF2E75B09A34A /* stats_data.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stats_data.h; path = src/core/lib/debug/stats_data.h; sourceTree = ""; }; + 9A2639E3A9DAEFF8438C9E4BCF9A2A79 /* str_cat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_cat.h; path = absl/strings/str_cat.h; sourceTree = ""; }; + 9A449B0A5202F58351E26952D3A60310 /* grpc_alts_credentials_client_options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_alts_credentials_client_options.cc; path = src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc; sourceTree = ""; }; + 9A6779861EE647D79AA9DE2D37153AF2 /* BoringSSL-GRPC-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "BoringSSL-GRPC-Info.plist"; sourceTree = ""; }; + 9A92C5E558F98A6C5A2854E3C2A359BE /* metadata_batch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata_batch.h; path = src/core/lib/transport/metadata_batch.h; sourceTree = ""; }; + 9A9B5338171CD061E47F2E361FCE6F29 /* raw_hash_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = raw_hash_map.h; path = absl/container/internal/raw_hash_map.h; sourceTree = ""; }; + 9A9D24F6E60BB76D9760C11589422A5D /* s3_both.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = s3_both.cc; path = src/ssl/s3_both.cc; sourceTree = ""; }; + 9AD01CBC19BBBB43A67E6767D3181791 /* gsec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gsec.h; path = src/core/tsi/alts/crypt/gsec.h; sourceTree = ""; }; + 9AE2B3726976A1847F298F3A3E47041E /* proxy_mapper_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proxy_mapper_registry.h; path = src/core/ext/filters/client_channel/proxy_mapper_registry.h; sourceTree = ""; }; + 9B13413FFB0F61136436993DEA918F35 /* connectivity_monitor.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = connectivity_monitor.cc; path = Firestore/core/src/remote/connectivity_monitor.cc; sourceTree = ""; }; + 9B43CD33F3F1F3EF0114CE8B81660C94 /* GDTCORFlatFileStorage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORFlatFileStorage.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage.h; sourceTree = ""; }; + 9B6D225378BB7F76C413545C291FE357 /* leveldb_index_manager.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_index_manager.cc; path = Firestore/core/src/local/leveldb_index_manager.cc; sourceTree = ""; }; + 9B7EC5B5404862C8F432F69E173C4393 /* clock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = clock.h; path = absl/time/clock.h; sourceTree = ""; }; + 9B82965517F26D32D39EB3EA2FAAF5B4 /* v3_extku.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_extku.c; path = src/crypto/x509v3/v3_extku.c; sourceTree = ""; }; + 9B888E1B9AB8866C4959554B1EFE4D64 /* exponentiation.c */ = {isa = PBXFileReference; includeInIndex = 1; name = exponentiation.c; path = src/crypto/fipsmodule/bn/exponentiation.c; sourceTree = ""; }; + 9BB9ADA2E70BFC8824E39DA9996ECD97 /* value_util.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = value_util.cc; path = Firestore/core/src/model/value_util.cc; sourceTree = ""; }; + 9BBDF31030AE611AC41E8C05ACD93118 /* lb_policy_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lb_policy_registry.h; path = src/core/ext/filters/client_channel/lb_policy_registry.h; sourceTree = ""; }; + 9BDE6E0D386F7AF73EEAC9F7564A8941 /* frame_settings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_settings.h; path = src/core/ext/transport/chttp2/transport/frame_settings.h; sourceTree = ""; }; + 9C292CBE769708DE151C297EEB3CA295 /* ssl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl.h; path = src/include/openssl/ssl.h; sourceTree = ""; }; + 9C302CB40166ED08DEBFD2CD3F3CB231 /* secure_auth_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_auth_context.cc; path = src/cpp/common/secure_auth_context.cc; sourceTree = ""; }; + 9C417DDF359FFC9262AD9A311ECFFB65 /* message_compress.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_compress.h; path = src/core/lib/compression/message_compress.h; sourceTree = ""; }; + 9C41D690E5603981F1A6038BCE8B913F /* log_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = log_apple.mm; path = Firestore/core/src/util/log_apple.mm; sourceTree = ""; }; + 9C5299A5EA2E3D8DFA6E4A0A512D2621 /* murmur_hash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = murmur_hash.h; path = src/core/lib/gpr/murmur_hash.h; sourceTree = ""; }; + 9C59E0F8D64C904B6F3DF382FC1943AF /* scoped_route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = scoped_route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h"; sourceTree = ""; }; + 9C7C87B5D0A6752AFA2642F1BCA967A3 /* gRPC-C++-gRPCCertificates-Cpp */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = "gRPC-C++-gRPCCertificates-Cpp"; path = "gRPCCertificates-Cpp.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9C865EAC1942B26D719DF51DFF7D3C7C /* server_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_address.h; path = src/core/ext/filters/client_channel/server_address.h; sourceTree = ""; }; + 9CB820E1CA00F35B24C381DEE2AC94E5 /* snapshot_version.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = snapshot_version.cc; path = Firestore/core/src/model/snapshot_version.cc; sourceTree = ""; }; + 9CBB69D578C84B497AB0493D4B6185EB /* timer_manager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_manager.h; path = src/core/lib/iomgr/timer_manager.h; sourceTree = ""; }; + 9CC5FC1E25B7C3707B4A26A93C54D264 /* t_x509a.c */ = {isa = PBXFileReference; includeInIndex = 1; name = t_x509a.c; path = src/crypto/x509/t_x509a.c; sourceTree = ""; }; + 9CDF8192762FC4FFDD9F39C6869B2CF5 /* tasn_dec.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_dec.c; path = src/crypto/asn1/tasn_dec.c; sourceTree = ""; }; + 9CF6723BB05DEC37F90BA50E101B5BBE /* string_util_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_util_windows.cc; path = src/core/lib/gpr/string_util_windows.cc; sourceTree = ""; }; + 9CFD1651BEC48147949B5B99E1587687 /* validate_service_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = validate_service_config.h; path = include/grpcpp/support/validate_service_config.h; sourceTree = ""; }; + 9D04CBBBFA548BA25FA4A23088C6DE01 /* string_win.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_win.cc; path = Firestore/core/src/util/string_win.cc; sourceTree = ""; }; + 9D147D68F8693EC4F25860C9BEBEA063 /* client_interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_interceptor.h; path = include/grpcpp/impl/codegen/client_interceptor.h; sourceTree = ""; }; + 9D1721FE77FEEE595295694CBBCBF74B /* mutation_batch.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutation_batch.cc; path = Firestore/core/src/model/mutation_batch.cc; sourceTree = ""; }; + 9D5214C90DB7BDE9D0FC93E06B024787 /* core_codegen.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = core_codegen.h; path = include/grpcpp/impl/codegen/core_codegen.h; sourceTree = ""; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9DA268B568DC346FAA7E9EA795F8A8C1 /* channel_stack_builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_stack_builder.h; path = src/core/lib/channel/channel_stack_builder.h; sourceTree = ""; }; + 9DAE5600E0080211F843A6E5FD4EB450 /* FirebaseCoreInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FirebaseCoreInternal.h; path = FirebaseCore/Sources/Private/FirebaseCoreInternal.h; sourceTree = ""; }; + 9DBC24144AC4AE30B20D02AA76B71B7B /* frame_data.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_data.h; path = src/core/ext/transport/chttp2/transport/frame_data.h; sourceTree = ""; }; + 9DD50785C581B619221C9A00D0002FC8 /* alts_frame_protector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_frame_protector.cc; path = src/core/tsi/alts/frame_protector/alts_frame_protector.cc; sourceTree = ""; }; + 9DFB4312445B14C11C2146B1478E0E76 /* ssl_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_security_connector.cc; path = src/core/lib/security/security_connector/ssl/ssl_security_connector.cc; sourceTree = ""; }; + 9E40E56CAA644830047C7CF84C5B8D78 /* FIRAnalyticsConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRAnalyticsConfiguration.m; path = FirebaseCore/Sources/FIRAnalyticsConfiguration.m; sourceTree = ""; }; + 9E5671FB07752F56090B0C6377032B6B /* load_report.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_report.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h"; sourceTree = ""; }; + 9E8730CF5DB7BA3502AF1CEF5693A483 /* Firebase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Firebase.h; path = CoreOnly/Sources/Firebase.h; sourceTree = ""; }; + 9EAF735DB4F8C896B4B0612350E08A0E /* bad_variant_access.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bad_variant_access.cc; path = absl/types/bad_variant_access.cc; sourceTree = ""; }; + 9EDAB641EF9B8CFC172F1E2876451556 /* local_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_credentials.cc; path = src/core/lib/security/credentials/local/local_credentials.cc; sourceTree = ""; }; + 9F1259B1A2443FE3FDB39AAD4AAC3D08 /* handoff.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handoff.cc; path = src/ssl/handoff.cc; sourceTree = ""; }; + 9F1A12C64E72845D4AE3E7E75AF41A9F /* digests.c */ = {isa = PBXFileReference; includeInIndex = 1; name = digests.c; path = src/crypto/fipsmodule/digest/digests.c; sourceTree = ""; }; + 9F2BA1E33746B7A3E852F8F7C2365178 /* grpc_ares_wrapper.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_wrapper.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc; sourceTree = ""; }; + 9F326A7AC42901733691D403D8CBFAD6 /* ssl_x509.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_x509.cc; path = src/ssl/ssl_x509.cc; sourceTree = ""; }; + 9F34C27792888518DD18C8F8531DE1B2 /* percent.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = percent.upb.h; path = "src/core/ext/upb-generated/envoy/type/percent.upb.h"; sourceTree = ""; }; + 9F51EEAF8CD8D8FFA3580AD750842C63 /* x_x509a.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_x509a.c; path = src/crypto/x509/x_x509a.c; sourceTree = ""; }; + 9F8C09D90B9AA4B989B9CF45089A6EEC /* x509_cmp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_cmp.c; path = src/crypto/x509/x509_cmp.c; sourceTree = ""; }; + 9F9A3572E006A3AF2D2D784FA7D2E148 /* throw_delegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = throw_delegate.h; path = absl/base/internal/throw_delegate.h; sourceTree = ""; }; + 9F9BF554EFFC04267916166595FCC2EB /* route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route.upb.h"; sourceTree = ""; }; + 9FA72B3E467BF6F44B2177C5E45B9B39 /* document_snapshot.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_snapshot.cc; path = Firestore/core/src/api/document_snapshot.cc; sourceTree = ""; }; + 9FC3305A5F3D8A40C5B58619C09FA24C /* global_config_generic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_generic.h; path = src/core/lib/gprpp/global_config_generic.h; sourceTree = ""; }; + 9FDC9D1269710F95D814C073F2E9324D /* collection_reference.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = collection_reference.cc; path = Firestore/core/src/api/collection_reference.cc; sourceTree = ""; }; + 9FEC41C1A808A39B9FF1840284BFB9E1 /* p_dsa_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_dsa_asn1.c; path = src/crypto/evp/p_dsa_asn1.c; sourceTree = ""; }; + A01F3D8A406CB451A7FEA08513C4BD92 /* stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream.cc; path = Firestore/core/src/remote/stream.cc; sourceTree = ""; }; + A031B0E03D3060C46E493AEC9CA16E70 /* FIRComponentContainer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRComponentContainer.m; path = FirebaseCore/Sources/FIRComponentContainer.m; sourceTree = ""; }; + A0375C1C408F48911C5A3719BE9D5F2B /* cfstream_handle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cfstream_handle.h; path = src/core/lib/iomgr/cfstream_handle.h; sourceTree = ""; }; + A045B03D292089864E80F033B4385B4F /* memtable.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memtable.cc; path = db/memtable.cc; sourceTree = ""; }; + A056D6984CC86A443DF3C5AC42C7471B /* handshaker.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h"; sourceTree = ""; }; + A0652A8506B00EC0855B4E63F59C3509 /* FBLPromise+Delay.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Delay.h"; path = "Sources/FBLPromises/include/FBLPromise+Delay.h"; sourceTree = ""; }; + A0733CD04448701C39EEA1F5C0270133 /* global_subchannel_pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_subchannel_pool.h; path = src/core/ext/filters/client_channel/global_subchannel_pool.h; sourceTree = ""; }; + A0817D26D1636DBA54BA48A57B6E9FC6 /* polling_entity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = polling_entity.h; path = src/core/lib/iomgr/polling_entity.h; sourceTree = ""; }; + A0868D0ECF4259B69353F0DBBF61B27A /* pem_lib.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_lib.c; path = src/crypto/pem/pem_lib.c; sourceTree = ""; }; + A086B484D96840E954EB167A0B8532DB /* FBLPromise+Validate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Validate.h"; path = "Sources/FBLPromises/include/FBLPromise+Validate.h"; sourceTree = ""; }; + A0A9F2BD72E3B373249A267756FCDCC4 /* spinlock_wait.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock_wait.cc; path = absl/base/internal/spinlock_wait.cc; sourceTree = ""; }; + A0B311BDF6F71B474574F2B941CD1980 /* coding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = coding.h; path = util/coding.h; sourceTree = ""; }; + A0BADFFC5D25B5F63F20F3D82BD3B61D /* alts_counter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_counter.h; path = src/core/tsi/alts/frame_protector/alts_counter.h; sourceTree = ""; }; + A0C93E8A83FE787BD7C3CEB208303AED /* resolver_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_factory.h; path = src/core/ext/filters/client_channel/resolver_factory.h; sourceTree = ""; }; + A0D9F94DC9B38464FEBB8B25D355C0E0 /* any.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = any.upb.h; path = "src/core/ext/upb-generated/google/protobuf/any.upb.h"; sourceTree = ""; }; + A0DE184EB41FEA223F6492A632199C78 /* hashtablez_sampler.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hashtablez_sampler.cc; path = absl/container/internal/hashtablez_sampler.cc; sourceTree = ""; }; + A0EAC698C4F4564B197311DBE5D5B93F /* json_token.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json_token.h; path = src/core/lib/security/credentials/jwt/json_token.h; sourceTree = ""; }; + A1124CC7D776FC3C0C380D7F944BA169 /* FBLPromisePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBLPromisePrivate.h; path = Sources/FBLPromises/include/FBLPromisePrivate.h; sourceTree = ""; }; + A11DB0635F1EAFCAEEE41078DBDC5CB2 /* FIRAppCheckInterop.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppCheckInterop.h; path = FirebaseAppCheck/Sources/Interop/FIRAppCheckInterop.h; sourceTree = ""; }; + A134C344D0C9DFC454147CCD53BC78A3 /* tls.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls.h; path = src/core/lib/gpr/tls.h; sourceTree = ""; }; + A158DE7549F420A16BC48EDD4762E5AD /* stream_compression_gzip.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream_compression_gzip.cc; path = src/core/lib/compression/stream_compression_gzip.cc; sourceTree = ""; }; + A16C988C3A0E82F7F25F75BE2C946CFA /* tmpfile_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tmpfile_windows.cc; path = src/core/lib/gpr/tmpfile_windows.cc; sourceTree = ""; }; + A16F04ED2F2B3312349B5EBC21A0B79F /* p224-64.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "p224-64.c"; path = "src/crypto/fipsmodule/ec/p224-64.c"; sourceTree = ""; }; + A18BB1AA798E12F9EBFFE675EADB83DE /* div_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = div_extra.c; path = src/crypto/fipsmodule/bn/div_extra.c; sourceTree = ""; }; + A18FF02CBC9822154D65D9BC978A31C8 /* load_report.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_report.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h"; sourceTree = ""; }; + A19B8FFA1AB568A7023B5B1F7D27D785 /* x509_lu.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_lu.c; path = src/crypto/x509/x509_lu.c; sourceTree = ""; }; + A19F3068182DE62C6728C21C22646D12 /* grpc_tls_credentials_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_tls_credentials_options.h; path = src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h; sourceTree = ""; }; + A1B872FA9156271AA33449423B5AF30D /* gRPC-Core.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "gRPC-Core.release.xcconfig"; sourceTree = ""; }; + A1C8009C9A7CEFF96C11B62DED1EE0AC /* time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time.h; path = include/grpc/support/time.h; sourceTree = ""; }; + A1C8EAE3AB2E0EF5A563D19724B03017 /* call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call.h; path = src/core/lib/surface/call.h; sourceTree = ""; }; + A20021D2FEE0D8C0E30C9EAE7946A61F /* lb_policy_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = lb_policy_registry.cc; path = src/core/ext/filters/client_channel/lb_policy_registry.cc; sourceTree = ""; }; + A20C926E01A3071F5ACB1EBCF09A2FF7 /* time_zone_info.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_info.cc; path = absl/time/internal/cctz/src/time_zone_info.cc; sourceTree = ""; }; + A21399A3BD7D75F80B053BEDEFFFA4F2 /* slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice.h; path = include/grpcpp/impl/codegen/slice.h; sourceTree = ""; }; + A21D417F0FE23EDBD61DA38C26113734 /* route_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h"; sourceTree = ""; }; + A2487D73586BB044B7A6D3BAE481FC73 /* frame_handler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_handler.h; path = src/core/tsi/alts/frame_protector/frame_handler.h; sourceTree = ""; }; + A25C69824148C82983802E09EA43329F /* timer_manager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_manager.h; path = src/core/lib/iomgr/timer_manager.h; sourceTree = ""; }; + A26EF50458271CA82806498A1533BF93 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/tls/internal.h; sourceTree = ""; }; + A2A2100C6EA9BD8D2E78ADAC0E1EC844 /* timestamp.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timestamp.upb.h; path = "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h"; sourceTree = ""; }; + A2E4CB80A06EF267FB377C5873C2C90C /* float_conversion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = float_conversion.h; path = absl/strings/internal/str_format/float_conversion.h; sourceTree = ""; }; + A3097B52F4E36CD1C180171702D18608 /* oauth2_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = oauth2_credentials.h; path = src/core/lib/security/credentials/oauth2/oauth2_credentials.h; sourceTree = ""; }; + A32279DF47CB815E6A6DAA6FC92E81F3 /* trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = trace.h; path = src/core/lib/debug/trace.h; sourceTree = ""; }; + A35FBE92AF8F9C94C802F54EC774AB25 /* PromisesObjC-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "PromisesObjC-Info.plist"; sourceTree = ""; }; + A38F042B47380D89B412DD983F8133E1 /* des.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = des.h; path = src/include/openssl/des.h; sourceTree = ""; }; + A3D9BA366DEC557FC6ED6AFA29421653 /* GDTCCTUploader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCCTUploader.h; path = GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h; sourceTree = ""; }; + A3EB023FED87D37C6403299E876C3CAC /* p256_64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = p256_64.h; path = src/third_party/fiat/p256_64.h; sourceTree = ""; }; + A3F52A4EF4A8E4430229297A2C290E02 /* plugin_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = plugin_credentials.h; path = src/core/lib/security/credentials/plugin/plugin_credentials.h; sourceTree = ""; }; + A408DB590FC2671D29D819A5E0AFC244 /* des.c */ = {isa = PBXFileReference; includeInIndex = 1; name = des.c; path = src/crypto/fipsmodule/des/des.c; sourceTree = ""; }; + A4299A26608CC95F9C409DAE53B183C5 /* ripemd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ripemd.h; path = src/include/openssl/ripemd.h; sourceTree = ""; }; + A42C1ADC7346EDB1615DD7F0248971D3 /* leveldb_target_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_target_cache.cc; path = Firestore/core/src/local/leveldb_target_cache.cc; sourceTree = ""; }; + A449BAF74875449A62888CB039B14F40 /* db.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = db.h; path = include/leveldb/db.h; sourceTree = ""; }; + A45B2607AB28FD02DDED58B5FC26BDB5 /* rand_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rand_extra.c; path = src/crypto/rand_extra/rand_extra.c; sourceTree = ""; }; + A466854894ED4D8DC61B11E610F3A953 /* polyval.c */ = {isa = PBXFileReference; includeInIndex = 1; name = polyval.c; path = src/crypto/fipsmodule/modes/polyval.c; sourceTree = ""; }; + A491B7806FC7172EEB90073096906545 /* sync_generic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_generic.h; path = include/grpc/support/sync_generic.h; sourceTree = ""; }; + A4A0AA75430E85336A2C4B36873E0CC3 /* server_builder_option_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_builder_option_impl.h; path = include/grpcpp/impl/server_builder_option_impl.h; sourceTree = ""; }; + A4B51A89D051FDBD18FF5341E0E97334 /* tcp_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_uv.cc; path = src/core/lib/iomgr/tcp_uv.cc; sourceTree = ""; }; + A4B54D6420B3444FCD5BE511FE112605 /* credentials_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = credentials_impl.h; path = include/grpcpp/security/credentials_impl.h; sourceTree = ""; }; + A4BDDB4AAA4F4D605A47FB66B4FEE16A /* server_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_address.h; path = src/core/ext/filters/client_channel/server_address.h; sourceTree = ""; }; + A4F490579130970808943F3F104248D0 /* pkcs7.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pkcs7.c; path = src/crypto/pkcs7/pkcs7.c; sourceTree = ""; }; + A514CA128BAE38DA1C046B4723F7A58C /* ascii.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ascii.h; path = absl/strings/ascii.h; sourceTree = ""; }; + A51AE3F96F277D764A798B322CFD9EDF /* FirebaseCoreDiagnostics-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FirebaseCoreDiagnostics-umbrella.h"; sourceTree = ""; }; + A5430633590CF29EFC7B2AEDD2AA5A96 /* block_annotate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = block_annotate.h; path = src/core/lib/iomgr/block_annotate.h; sourceTree = ""; }; + A554763492A7AE4913B09C3FB632A059 /* alts_grpc_record_protocol_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_record_protocol_common.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h; sourceTree = ""; }; + A56ACE38A2F08AE312DE31CB0B651EF9 /* FIRHeartbeatInfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRHeartbeatInfo.h; path = FirebaseCore/Sources/Private/FIRHeartbeatInfo.h; sourceTree = ""; }; + A56AEF2B52A8CAA0074B21F1051F7C7F /* security_handshaker.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = security_handshaker.cc; path = src/core/lib/security/transport/security_handshaker.cc; sourceTree = ""; }; + A56CC67B0787B694FADFA2B3B9015932 /* iomgr.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr.h; path = src/core/lib/iomgr/iomgr.h; sourceTree = ""; }; + A58096DD9E14A2347D2CE6BC195CB534 /* resolver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolver.cc; path = src/core/ext/filters/client_channel/resolver.cc; sourceTree = ""; }; + A58B6CF39A3BF9233150B1782155AAB3 /* static_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = static_metadata.h; path = src/core/lib/transport/static_metadata.h; sourceTree = ""; }; + A5BDF47E4C51DCD86B15BC08DEE68099 /* target_data.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = target_data.cc; path = Firestore/core/src/local/target_data.cc; sourceTree = ""; }; + A5C51F3B802FDFD04AB847340FF10B35 /* substitute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = substitute.h; path = absl/strings/substitute.h; sourceTree = ""; }; + A5E574F17FB22368716C845CF5791C94 /* api_trace.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = api_trace.cc; path = src/core/lib/surface/api_trace.cc; sourceTree = ""; }; + A60387F616E5571CEF9AE353F45D7C70 /* memory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = memory.h; path = src/core/lib/gprpp/memory.h; sourceTree = ""; }; + A60518B5C6AA0D002A4EF00B04C6F16D /* sensitive.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sensitive.upb.h; path = "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h"; sourceTree = ""; }; + A608E1DEC03C31D95C076F0D54638102 /* filter_block.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = filter_block.h; path = table/filter_block.h; sourceTree = ""; }; + A6102DCA3C36EB30A53C7CB4F1D02BAF /* ofb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ofb.c; path = src/crypto/fipsmodule/modes/ofb.c; sourceTree = ""; }; + A61CC5B8ACFD1D1EA9E43F18B60258CB /* slice.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = slice.cc; path = src/core/lib/slice/slice.cc; sourceTree = ""; }; + A62139F07699F4A3238DCFB24654FDDA /* client_load_reporting_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_load_reporting_filter.cc; path = src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc; sourceTree = ""; }; + A6250A505B1D7CFDAE15D9D0B6DF6EB4 /* two_level_iterator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = two_level_iterator.h; path = table/two_level_iterator.h; sourceTree = ""; }; + A6477AED5C47C17A2825B86E3920E093 /* alts_tsi_handshaker_private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_tsi_handshaker_private.h; path = src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h; sourceTree = ""; }; + A67BB7E59B0B6A837B089F22CA423BED /* method_handler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = method_handler.h; path = include/grpcpp/impl/codegen/method_handler.h; sourceTree = ""; }; + A68AF0A8082B9569E0D7B07B411E00EF /* v3_cpols.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_cpols.c; path = src/crypto/x509v3/v3_cpols.c; sourceTree = ""; }; + A6B5D45C7991471C1EA06ECDB38ECC46 /* inlined_vector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inlined_vector.h; path = src/core/lib/gprpp/inlined_vector.h; sourceTree = ""; }; + A6B9A1961056CF5678404B6DA4DCD7ED /* nanopb-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "nanopb-prefix.pch"; sourceTree = ""; }; + A6D62822281C54A60773896EAD6FA9D6 /* hpack_parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_parser.h; path = src/core/ext/transport/chttp2/transport/hpack_parser.h; sourceTree = ""; }; + A6FC36BA9BDB68998B65C9C65B7D60C4 /* lame_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lame_client.h; path = src/core/lib/surface/lame_client.h; sourceTree = ""; }; + A6FCD8B2211614AEA1A4A002269310CE /* rds.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rds.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/rds.upb.c"; sourceTree = ""; }; + A6FD5677089EA9034D0A64FA02498BB3 /* rsa_pss.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsa_pss.c; path = src/crypto/x509/rsa_pss.c; sourceTree = ""; }; + A705B5E2F23E918976FBD98D3A8110B1 /* FBLPromise+Timeout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Timeout.h"; path = "Sources/FBLPromises/include/FBLPromise+Timeout.h"; sourceTree = ""; }; + A75884DD09B8566BF894752E00DF2665 /* have_sse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = have_sse.h; path = absl/container/internal/have_sse.h; sourceTree = ""; }; + A7650560AD12323E976A0A5CFA6457C1 /* poly1305.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = poly1305.h; path = src/include/openssl/poly1305.h; sourceTree = ""; }; + A7664361526A49829A2FA341E4FA9125 /* timer_uv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer_uv.cc; path = src/core/lib/iomgr/timer_uv.cc; sourceTree = ""; }; + A76F07379709A61A0CC11021D2818F29 /* FirebaseFirestore.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = FirebaseFirestore.modulemap; sourceTree = ""; }; + A7739F4D6C512681D9041B61D69A26EC /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/rand/internal.h; sourceTree = ""; }; + A77DB249AE8630BD91CEE0413AB157BA /* FIRCoreDiagnostics.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRCoreDiagnostics.m; path = Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m; sourceTree = ""; }; + A79B3210FDF394229768AED58FAEECBB /* BoringSSL-GRPC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "BoringSSL-GRPC.release.xcconfig"; sourceTree = ""; }; + A7AB7D7BE8033FF6D64EA64A1794DB65 /* slice_string_helpers.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = slice_string_helpers.cc; path = src/core/lib/slice/slice_string_helpers.cc; sourceTree = ""; }; + A7B5B09DFF1AD0648ED987A49B552909 /* http2_settings.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http2_settings.cc; path = src/core/ext/transport/chttp2/transport/http2_settings.cc; sourceTree = ""; }; + A7E47917B5D3B3625D08295A98F25F54 /* time_zone_libc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_zone_libc.h; path = absl/time/internal/cctz/src/time_zone_libc.h; sourceTree = ""; }; + A8057155076411DB6A73027FD64C60AB /* nid.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = nid.h; path = src/include/openssl/nid.h; sourceTree = ""; }; + A80F3CEFA5FF9FE72EC0AFEC38F341B4 /* inlined_vector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inlined_vector.h; path = absl/container/internal/inlined_vector.h; sourceTree = ""; }; + A83F0196F20B53667FD9CA38AB6E3735 /* printf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = printf.c; path = src/crypto/bio/printf.c; sourceTree = ""; }; + A88591E1AA68479C3F7CFF5862D565E7 /* generated_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = generated_util.h; path = third_party/upb/upb/generated_util.h; sourceTree = ""; }; + A8861093DEFACEF1F323166FE2D71CE9 /* latlng.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = latlng.nanopb.cc; path = Firestore/Protos/nanopb/google/type/latlng.nanopb.cc; sourceTree = ""; }; + A89788D1A47DC75E3E0E61C6D7FAC9B2 /* hpack_encoder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hpack_encoder.cc; path = src/core/ext/transport/chttp2/transport/hpack_encoder.cc; sourceTree = ""; }; + A8B3B2F75C9E79B4CCC58B400E7EA868 /* circuit_breaker.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = circuit_breaker.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c"; sourceTree = ""; }; + A8B544BF694C29E4C478D06008B63316 /* format_request.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = format_request.h; path = src/core/lib/http/format_request.h; sourceTree = ""; }; + A8BD8CB1C3DD033EF22C73BBD7F4D064 /* create_channel_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_channel_internal.h; path = src/cpp/client/create_channel_internal.h; sourceTree = ""; }; + A8C6F15BD1CDA9FFDC0406E5CF4D74C9 /* maybe_document.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = maybe_document.nanopb.cc; path = Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc; sourceTree = ""; }; + A8FFC6BFBCF6D712799352AD3D1225E1 /* slice_weak_hash_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_weak_hash_table.h; path = src/core/lib/slice/slice_weak_hash_table.h; sourceTree = ""; }; + A91305DD4667353F0C3B30286CE14858 /* call.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = call.cc; path = src/core/lib/surface/call.cc; sourceTree = ""; }; + A91898EDF2231E16F7E340C782B13AEA /* b64.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = b64.cc; path = src/core/lib/slice/b64.cc; sourceTree = ""; }; + A94B2D26AC4AEF80C7232EC115747DAE /* GDTCORDirectorySizeTracker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORDirectorySizeTracker.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORDirectorySizeTracker.m; sourceTree = ""; }; + A94F5E13A79FEA609854601CF6FEFF37 /* time_zone_if.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_if.cc; path = absl/time/internal/cctz/src/time_zone_if.cc; sourceTree = ""; }; + A957D82CE2750495058EA01364A0459F /* substitute.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = substitute.cc; path = absl/strings/substitute.cc; sourceTree = ""; }; + A9981EAD1F1A5E388F2921C166A3A170 /* md5.c */ = {isa = PBXFileReference; includeInIndex = 1; name = md5.c; path = src/crypto/fipsmodule/md5/md5.c; sourceTree = ""; }; + A9E4BAEAE257CE5BF099CEE6D9CFEE1D /* credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = credentials.h; path = src/core/lib/security/credentials/credentials.h; sourceTree = ""; }; + A9F4DDB181B2A441A209A1651D4F22CD /* resolve_address_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolve_address_posix.cc; path = src/core/lib/iomgr/resolve_address_posix.cc; sourceTree = ""; }; + AA033B2B30F2E8AC153AEBE867BFF34D /* cbc.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cbc.c; path = src/crypto/fipsmodule/modes/cbc.c; sourceTree = ""; }; + AA0ECCEA54FD8EB5AE66767FD5BFE71C /* semantic_version.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = semantic_version.upb.h; path = "src/core/ext/upb-generated/envoy/type/semantic_version.upb.h"; sourceTree = ""; }; + AA21EE8C05E8EB4D0FFC5B450C03C314 /* bytes.c */ = {isa = PBXFileReference; includeInIndex = 1; name = bytes.c; path = src/crypto/fipsmodule/bn/bytes.c; sourceTree = ""; }; + AA46FC2EF94E9F5572BD914C67BAD5C0 /* grpc_ares_wrapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_ares_wrapper.h; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h; sourceTree = ""; }; + AA63CC21607F5F59C9A89C589E497A4C /* decode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = decode.h; path = third_party/upb/upb/decode.h; sourceTree = ""; }; + AA66DFD8E5E6CCC24E2C6AC53B722682 /* div.c */ = {isa = PBXFileReference; includeInIndex = 1; name = div.c; path = src/crypto/fipsmodule/bn/div.c; sourceTree = ""; }; + AA6CD30588C39DABF9AF0A185DBD2A3B /* dynamic_thread_pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dynamic_thread_pool.h; path = src/cpp/server/dynamic_thread_pool.h; sourceTree = ""; }; + AA95BD5E58480D50DD1606867D204B39 /* connectivity_state.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connectivity_state.h; path = include/grpc/impl/codegen/connectivity_state.h; sourceTree = ""; }; + AA991AE54067FB100A899C5178166E7C /* local_subchannel_pool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_subchannel_pool.h; path = src/core/ext/filters/client_channel/local_subchannel_pool.h; sourceTree = ""; }; + AAC355D81DC8EB07A8726AF9F749ABC8 /* memory_mutation_queue.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_mutation_queue.cc; path = Firestore/core/src/local/memory_mutation_queue.cc; sourceTree = ""; }; + AB3E9C734A34DA2057BD330F36277ADA /* huffsyms.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = huffsyms.cc; path = src/core/ext/transport/chttp2/transport/huffsyms.cc; sourceTree = ""; }; + AB5ACF8E43B999D518721FCE505FF313 /* jwt_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = jwt_credentials.h; path = src/core/lib/security/credentials/jwt/jwt_credentials.h; sourceTree = ""; }; + AB5BB29561CE011CEAE5A3BC8BF4E97A /* asn_pack.c */ = {isa = PBXFileReference; includeInIndex = 1; name = asn_pack.c; path = src/crypto/asn1/asn_pack.c; sourceTree = ""; }; + AB83EE49690EDC3506C1F03D9AD4DB2D /* compression.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression.h; path = include/grpc/compression.h; sourceTree = ""; }; + AB863D3AABBC8C31F4D6DC0ECBEF88A6 /* firestore_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firestore_client.cc; path = Firestore/core/src/core/firestore_client.cc; sourceTree = ""; }; + AB974890D4BF327B904955BCF2182AEE /* closure.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = closure.h; path = src/core/lib/iomgr/closure.h; sourceTree = ""; }; + ABAD5CF3B2F079651491304D130C2FEE /* arena.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arena.h; path = src/core/lib/gpr/arena.h; sourceTree = ""; }; + ABB914CA2D8F559EC70238FCF503BCD0 /* msg.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = msg.h; path = third_party/upb/upb/msg.h; sourceTree = ""; }; + ABCC5141DEB28F508919BD050C07F49D /* uri_parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = uri_parser.h; path = src/core/lib/uri/uri_parser.h; sourceTree = ""; }; + ABDAC6BA1239B29F18ED25459D95FE04 /* grpc_streaming_reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_streaming_reader.cc; path = Firestore/core/src/remote/grpc_streaming_reader.cc; sourceTree = ""; }; + ABE54C835DAF515535556B26177BBA60 /* proxy_mapper_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proxy_mapper_registry.h; path = src/core/ext/filters/client_channel/proxy_mapper_registry.h; sourceTree = ""; }; + AC1A7B92A2E51C886809807B73BD01EC /* bdp_estimator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bdp_estimator.cc; path = src/core/lib/transport/bdp_estimator.cc; sourceTree = ""; }; + AC3AEC3251AA008CCF6EF8411B38908D /* message_size_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_size_filter.h; path = src/core/ext/filters/message_size/message_size_filter.h; sourceTree = ""; }; + AC4D2EB60ECE5CF6ED2237BDA6E79CA3 /* error_utils.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = error_utils.cc; path = src/core/lib/transport/error_utils.cc; sourceTree = ""; }; + AC75C664ABCE97A506988ADCFB047624 /* blocking_counter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = blocking_counter.cc; path = absl/synchronization/blocking_counter.cc; sourceTree = ""; }; + AC7D4CB09A76136FE10200C7ABDE8D12 /* FIRLibrary.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLibrary.h; path = FirebaseCore/Sources/Private/FIRLibrary.h; sourceTree = ""; }; + AC82E00BF2CA5BAAD779E044347C73FA /* internal_errqueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal_errqueue.h; path = src/core/lib/iomgr/internal_errqueue.h; sourceTree = ""; }; + ACA63BF9403CDBAAB57966A713249632 /* spinlock_linux.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock_linux.inc; path = absl/base/internal/spinlock_linux.inc; sourceTree = ""; }; + ACBBEC8E052441D95D28727A20F34D79 /* byte_buffer_reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_buffer_reader.cc; path = src/core/lib/surface/byte_buffer_reader.cc; sourceTree = ""; }; + ACBFD264B273F8176D420444FCF5F2B7 /* string.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = string.upb.c; path = "src/core/ext/upb-generated/envoy/type/matcher/string.upb.c"; sourceTree = ""; }; + ACD33F7F16F4EBF3970806BA1F98FE2A /* socket_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_windows.h; path = src/core/lib/iomgr/socket_windows.h; sourceTree = ""; }; + ACD5D7B78AA4F01E6A83A481D7AC4FF6 /* stacktrace_unimplemented-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_unimplemented-inl.inc"; path = "absl/debugging/internal/stacktrace_unimplemented-inl.inc"; sourceTree = ""; }; + AD0FADFA76F83284B62934281CC6AC18 /* chttp2_transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_transport.h; path = src/core/ext/transport/chttp2/transport/chttp2_transport.h; sourceTree = ""; }; + AD20A9651BFF424572F741E7C677A18E /* slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice.h; path = include/grpcpp/support/slice.h; sourceTree = ""; }; + AD3BD3C50585CBAAB39D83E8C3170326 /* tcp_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_client.cc; path = src/core/lib/iomgr/tcp_client.cc; sourceTree = ""; }; + AD3D0AA603EBFB0F04A26EB7C52C531B /* xds_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_client.h; path = src/core/ext/filters/client_channel/xds/xds_client.h; sourceTree = ""; }; + AD596FCBFCD9AB42760D5ECAC6D676B5 /* blowfish.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = blowfish.h; path = src/include/openssl/blowfish.h; sourceTree = ""; }; + AD5BCE0A02A0C91F4F19722BF8489C03 /* ordered_code.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ordered_code.cc; path = Firestore/core/src/util/ordered_code.cc; sourceTree = ""; }; + AD5F16CE4D5C90761220A70B813EA9A3 /* hpack_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hpack_table.h; path = src/core/ext/transport/chttp2/transport/hpack_table.h; sourceTree = ""; }; + AD6B66162EA7B2F1DA9F0A2B07FBDA97 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/core/ext/transport/chttp2/transport/internal.h; sourceTree = ""; }; + AD7F038300BA50B8ECEE08E051166E54 /* status_util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_util.h; path = src/core/lib/channel/status_util.h; sourceTree = ""; }; + AD83148BBABCCAF7D2F2991318C03BA5 /* duration.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = duration.upb.c; path = "src/core/ext/upb-generated/google/protobuf/duration.upb.c"; sourceTree = ""; }; + AD939B0974B0C1A66C77AFC21CD3F9F1 /* cipher.c */ = {isa = PBXFileReference; includeInIndex = 1; name = cipher.c; path = src/crypto/fipsmodule/cipher/cipher.c; sourceTree = ""; }; + ADDB86B7C169DDFFB21D4359AD1C71D0 /* tcp_client_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_client_windows.cc; path = src/core/lib/iomgr/tcp_client_windows.cc; sourceTree = ""; }; + ADF34D14D6CD78F4F7FD92EC0A9BD0D8 /* dbformat.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dbformat.cc; path = db/dbformat.cc; sourceTree = ""; }; + AE0C30425BCEA85F808902144CB8DCA2 /* time_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_windows.cc; path = src/core/lib/gpr/time_windows.cc; sourceTree = ""; }; + AE639E980CC0E3D99D915F70F272A2D4 /* statusor.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = statusor.cc; path = Firestore/core/src/util/statusor.cc; sourceTree = ""; }; + AE7C373BBF03293FB30EDAD11BC6CE5A /* cmac.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cmac.h; path = src/include/openssl/cmac.h; sourceTree = ""; }; + AEA737254896940AB0A0E90A22C30D7F /* server_builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_builder.h; path = include/grpcpp/server_builder.h; sourceTree = ""; }; + AEAED9EED49D19DF250AA653A5592363 /* filesystem_common.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filesystem_common.cc; path = Firestore/core/src/util/filesystem_common.cc; sourceTree = ""; }; + AEEEEDC0BBB4927EDB158F6C26F19DF9 /* v3_pmaps.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_pmaps.c; path = src/crypto/x509v3/v3_pmaps.c; sourceTree = ""; }; + AEEFD2B8E48EBF0EC01E473ED36CF46C /* span.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = span.h; path = absl/types/span.h; sourceTree = ""; }; + AF01CB3AD0BB7E0A4582EACC66AAF706 /* ssl_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_security_connector.h; path = src/core/lib/security/security_connector/ssl/ssl_security_connector.h; sourceTree = ""; }; + AF22FBE9343697E005570E9F0B43BF4D /* combiner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = combiner.h; path = src/core/lib/iomgr/combiner.h; sourceTree = ""; }; + AF3DCF24D3613D03CA60B425BFE16B9E /* create_channel_posix_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_channel_posix_impl.h; path = include/grpcpp/create_channel_posix_impl.h; sourceTree = ""; }; + AF4A0F5FF115B44C14F7017B9C059C2D /* pollset_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_custom.cc; path = src/core/lib/iomgr/pollset_custom.cc; sourceTree = ""; }; + AF5A5E16288FED709D3068F845F4C469 /* escaping.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = escaping.h; path = absl/strings/escaping.h; sourceTree = ""; }; + AF6E0F94D9485229CFE1242EB04ED666 /* dns_resolver_selection.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dns_resolver_selection.h; path = src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h; sourceTree = ""; }; + AF86CA9A63D47F01E919FFEEE6B2A16A /* time_averaged_stats.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_averaged_stats.cc; path = src/core/lib/iomgr/time_averaged_stats.cc; sourceTree = ""; }; + AF9FE1C105714C48F02ADCBCA92D2F40 /* hashtable_debug_hooks.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hashtable_debug_hooks.h; path = absl/container/internal/hashtable_debug_hooks.h; sourceTree = ""; }; + AFA6C4E167F40B32FC9C8C56A5FC79F3 /* verify_mutation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = verify_mutation.cc; path = Firestore/core/src/model/verify_mutation.cc; sourceTree = ""; }; + AFB72065C305200D4EACB28F35716EB7 /* FBLPromise+Testing.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Testing.m"; path = "Sources/FBLPromises/FBLPromise+Testing.m"; sourceTree = ""; }; + AFDD69BAA69550856BFCB1E65A18327A /* view.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = view.cc; path = Firestore/core/src/core/view.cc; sourceTree = ""; }; + AFDED5A80D701F4DCE0B5E71BF2BB9A2 /* global_config_env.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = global_config_env.cc; path = src/core/lib/gprpp/global_config_env.cc; sourceTree = ""; }; + AFF231C1A7DC5993018B4C3F2AFEE8B1 /* iomgr.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr.cc; path = src/core/lib/iomgr/iomgr.cc; sourceTree = ""; }; + AFFDBDD9C75E5BA8A2372D3866E0BFA9 /* tcp_client_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_client_posix.h; path = src/core/lib/iomgr/tcp_client_posix.h; sourceTree = ""; }; + B02B5648392F5D58B25616C6AC8329ED /* message_compress_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_compress_filter.h; path = src/core/ext/filters/http/message_compress/message_compress_filter.h; sourceTree = ""; }; + B0938A6AD23650847BCFA32BAD6CFDC6 /* socket_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_windows.cc; path = src/core/lib/iomgr/socket_windows.cc; sourceTree = ""; }; + B0A2E8A49B30A409617821E5044F444F /* tls_msvc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_msvc.h; path = src/core/lib/gpr/tls_msvc.h; sourceTree = ""; }; + B0ADA63A8AF80A28367FA30360B70EDB /* listener.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h"; sourceTree = ""; }; + B0B733DF6CFFB65C25C263B74B0773AB /* dsa.c */ = {isa = PBXFileReference; includeInIndex = 1; name = dsa.c; path = src/crypto/dsa/dsa.c; sourceTree = ""; }; + B0C14C713BF221471AEA7527F926779E /* a_strnid.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_strnid.c; path = src/crypto/asn1/a_strnid.c; sourceTree = ""; }; + B0E7FBCD229FDC32936600AFD1544DB2 /* FIRQuerySnapshot.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRQuerySnapshot.h; path = Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h; sourceTree = ""; }; + B118489EF3EF65E06D3BBD8008A80060 /* channel_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_args.h; path = src/core/lib/channel/channel_args.h; sourceTree = ""; }; + B11A86487F16624DB6C78C55CE5098B7 /* GDTCORTransport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORTransport.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORTransport.m; sourceTree = ""; }; + B142F3998802B0C34B526C0D505C9898 /* hkdf.c */ = {isa = PBXFileReference; includeInIndex = 1; name = hkdf.c; path = src/crypto/hkdf/hkdf.c; sourceTree = ""; }; + B16DC2FA6A718298FC7B28C912E1FF65 /* GoogleUtilities.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = GoogleUtilities.modulemap; sourceTree = ""; }; + B197426E1F2BA4126249B4F6F23CC355 /* stats.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stats.cc; path = src/core/lib/debug/stats.cc; sourceTree = ""; }; + B1E6B38A60A185A9EC2E2E06D2AD5648 /* FIRComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponent.h; path = FirebaseCore/Sources/Private/FIRComponent.h; sourceTree = ""; }; + B1EFE2DBE6BE5918A384AF3B7CDBE9AA /* spinlock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = spinlock.h; path = src/core/lib/gpr/spinlock.h; sourceTree = ""; }; + B20618FB1F2EBACA78FC2A5BE46B3903 /* bad_any_cast.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bad_any_cast.h; path = absl/types/bad_any_cast.h; sourceTree = ""; }; + B212E1EA3F28797855E0155D59F86AD3 /* endpoint.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c"; sourceTree = ""; }; + B234CFA38D4A58A3F077DD4ECDB1F55C /* oauth2_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = oauth2_credentials.cc; path = src/core/lib/security/credentials/oauth2/oauth2_credentials.cc; sourceTree = ""; }; + B283E93B2457511449DB72A0FE8C556C /* inproc_plugin.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = inproc_plugin.cc; path = src/core/ext/transport/inproc/inproc_plugin.cc; sourceTree = ""; }; + B2A24D4743A89B8E7D48AB0715175498 /* endpoint.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h"; sourceTree = ""; }; + B2B2AD4A805ACAE37CAA1D85222E9219 /* wrappers.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wrappers.nanopb.cc; path = Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc; sourceTree = ""; }; + B2B7493C81A4B6F855A3AD8B76C5B7DA /* arm_arch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arm_arch.h; path = src/include/openssl/arm_arch.h; sourceTree = ""; }; + B2DC46681E437C1AD114E17C973D9F44 /* pem_info.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_info.c; path = src/crypto/pem/pem_info.c; sourceTree = ""; }; + B2E1730F19E4224F23FD1F6E112A7A47 /* sockaddr_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_custom.h; path = src/core/lib/iomgr/sockaddr_custom.h; sourceTree = ""; }; + B2EEE88DF8265BD7966C655D0F1A8ADF /* cert.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cert.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h"; sourceTree = ""; }; + B2FFB2EE419C9A72A3B8781CFF2B88FE /* async_unary_call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_unary_call.h; path = include/grpcpp/impl/codegen/async_unary_call.h; sourceTree = ""; }; + B304508F4D1BA3E6653A85511CF1C329 /* compression_types.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression_types.h; path = include/grpc/impl/codegen/compression_types.h; sourceTree = ""; }; + B3105A65AA18D123210C1BEF70CD091C /* e_des.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_des.c; path = src/crypto/fipsmodule/cipher/e_des.c; sourceTree = ""; }; + B31181EDB8A805B69CAA30F4688BCC47 /* stream_compression.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stream_compression.cc; path = src/core/lib/compression/stream_compression.cc; sourceTree = ""; }; + B32672A04A2CE687168D966736235A06 /* frame_ping.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_ping.cc; path = src/core/ext/transport/chttp2/transport/frame_ping.cc; sourceTree = ""; }; + B348A4F8A3F1013C061BE48235C47CB8 /* grpc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc.h; path = include/grpc/grpc.h; sourceTree = ""; }; + B34D89A7C532C51A510254029B3BFEB5 /* fake_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_credentials.h; path = src/core/lib/security/credentials/fake/fake_credentials.h; sourceTree = ""; }; + B3614B9E60A4883B9A98F50776F1746A /* client_channel_factory.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_channel_factory.cc; path = src/core/ext/filters/client_channel/client_channel_factory.cc; sourceTree = ""; }; + B3ACBE8839657A7A07B6B03D2D559583 /* sensitive.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sensitive.upb.h; path = "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h"; sourceTree = ""; }; + B3B094199D9B61EB18907CA55BFBD3A5 /* ssl_cert.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_cert.cc; path = src/ssl/ssl_cert.cc; sourceTree = ""; }; + B3BAA51471AAC8ADC53C24ED0797A1BE /* merger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = merger.h; path = table/merger.h; sourceTree = ""; }; + B3D998FD723B816CBBAFF1FE51DADD30 /* abseil.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = abseil.modulemap; sourceTree = ""; }; + B3E876E28EDBC4984AF9188899C964E4 /* semantic_version.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = semantic_version.upb.h; path = "src/core/ext/upb-generated/envoy/type/semantic_version.upb.h"; sourceTree = ""; }; + B3FBDC6FBFF8BE3F070CE1482F5D70E2 /* load_file.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_file.h; path = src/core/lib/iomgr/load_file.h; sourceTree = ""; }; + B41BCAD368F263C1DAB21DC55094978D /* time_averaged_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time_averaged_stats.h; path = src/core/lib/iomgr/time_averaged_stats.h; sourceTree = ""; }; + B43874C6CBB50E7134FBEC24BABFE14F /* GoogleUtilities */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GoogleUtilities; path = GoogleUtilities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B45E5F9037A62FCA03DF871EADF52926 /* FBLPromise+Catch.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Catch.m"; path = "Sources/FBLPromises/FBLPromise+Catch.m"; sourceTree = ""; }; + B46F0E4D4D1CAF33B69692A375C1CB8F /* symbolize.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = symbolize.h; path = absl/debugging/internal/symbolize.h; sourceTree = ""; }; + B471867C535B02FA55D87E260F6480F8 /* gRPC-Core */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "gRPC-Core"; path = grpc.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B47CA2898B3BAF5F43DA3D92B73A271B /* resolve_address_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolve_address_custom.h; path = src/core/lib/iomgr/resolve_address_custom.h; sourceTree = ""; }; + B4B77BFF7B034F5885E2CC44FA47184D /* leveldb-library.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "leveldb-library.release.xcconfig"; sourceTree = ""; }; + B4CC9C6128D4CE90F7156B239AF1A4A9 /* lds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/lds.upb.h"; sourceTree = ""; }; + B4F6D9254808BDD5802369E8000BBCE0 /* elf_mem_image.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = elf_mem_image.cc; path = absl/debugging/internal/elf_mem_image.cc; sourceTree = ""; }; + B521EB4F00263E53A42457E5355945FB /* generic_stub.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = generic_stub.h; path = include/grpcpp/generic/generic_stub.h; sourceTree = ""; }; + B524E63494FE7218A5BC92D6C350F71A /* event_string.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = event_string.cc; path = src/core/lib/surface/event_string.cc; sourceTree = ""; }; + B5279CA4BEE8BBBFE1C7B8978F678020 /* common.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = common.nanopb.cc; path = Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc; sourceTree = ""; }; + B54562C4D96285F5ED299FB73E775591 /* chttp2_transport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = chttp2_transport.h; path = src/core/ext/transport/chttp2/transport/chttp2_transport.h; sourceTree = ""; }; + B57AB9958C4CE358AC4E6EDFEEDFE12B /* socket_helper.c */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_helper.c; path = src/crypto/bio/socket_helper.c; sourceTree = ""; }; + B58036161C7A30DF610470F176CC308B /* gethostname.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gethostname.h; path = src/core/lib/iomgr/gethostname.h; sourceTree = ""; }; + B582CBCABB9ADF0BFF2E891B9252FEC6 /* workaround_cronet_compression_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = workaround_cronet_compression_filter.cc; path = src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc; sourceTree = ""; }; + B58C221D6324649F211E8B4D296F6731 /* nanopb-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "nanopb-umbrella.h"; sourceTree = ""; }; + B5930E543F0DA06668114E5617874688 /* stream_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_map.h; path = src/core/ext/transport/chttp2/transport/stream_map.h; sourceTree = ""; }; + B5BBC219C766DE7677982303868AD116 /* alts_frame_protector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_frame_protector.h; path = src/core/tsi/alts/frame_protector/alts_frame_protector.h; sourceTree = ""; }; + B5C0118BE6E61929008E1E1D7C94D40F /* http_client_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_client_filter.h; path = src/core/ext/filters/http/client/http_client_filter.h; sourceTree = ""; }; + B5E40543B08B101D409F25A9DFF58259 /* ssl_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_utils.h; path = src/core/lib/security/security_connector/ssl_utils.h; sourceTree = ""; }; + B5E960B51CE1E30ED7C3E4C9A96A4D18 /* bn_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = bn_asn1.c; path = src/crypto/bn_extra/bn_asn1.c; sourceTree = ""; }; + B5FE7DA64DA0A2FAC82F978B8C8C214A /* string_format.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_format.cc; path = Firestore/core/src/util/string_format.cc; sourceTree = ""; }; + B5FEE16484BBD246D925229DB5F5312B /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/ssl/internal.h; sourceTree = ""; }; + B60212C267ADB81DCD9D45751AF8BCFA /* ev_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_posix.h; path = src/core/lib/iomgr/ev_posix.h; sourceTree = ""; }; + B6186BFC3B1A865F4340EF47AA6ED804 /* udp_listener_config.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = udp_listener_config.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h"; sourceTree = ""; }; + B6870D211B012015250AB07F1337686E /* ec_montgomery.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ec_montgomery.c; path = src/crypto/fipsmodule/ec/ec_montgomery.c; sourceTree = ""; }; + B6C99F15F3F7F60D14514B5520BBA0DE /* validate_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = validate_metadata.h; path = src/core/lib/surface/validate_metadata.h; sourceTree = ""; }; + B6D1BEDC0AC9B722D8F9D332675C97D7 /* pkcs12.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pkcs12.h; path = src/include/openssl/pkcs12.h; sourceTree = ""; }; + B6D3AEDEACB3E48C54383B8817562AF5 /* slice_hash_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_hash_table.h; path = src/core/lib/slice/slice_hash_table.h; sourceTree = ""; }; + B6E5DB5B9ED2BB4E09D66C69B3AF2FAA /* work_serializer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = work_serializer.h; path = src/core/lib/iomgr/work_serializer.h; sourceTree = ""; }; + B6EA6E949BB67E282815367289D96D73 /* discovery.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = discovery.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h"; sourceTree = ""; }; + B6ED6D2F2644D93740B21482FDB3A7B3 /* call_op_set_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_op_set_interface.h; path = include/grpcpp/impl/codegen/call_op_set_interface.h; sourceTree = ""; }; + B7009F7D37D5CC96B730B368C2834138 /* query.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query.nanopb.cc; path = Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc; sourceTree = ""; }; + B70BAEFB69553AC1D005302F44AB61AD /* insecure_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = insecure_credentials.cc; path = src/cpp/client/insecure_credentials.cc; sourceTree = ""; }; + B70F5B8BAC9639370472813E432CC316 /* waiter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = waiter.cc; path = absl/synchronization/internal/waiter.cc; sourceTree = ""; }; + B72ABDC2AF0BBFF6ED51215689DBE3DC /* x_name.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_name.c; path = src/crypto/x509/x_name.c; sourceTree = ""; }; + B7442BB3F818B96D0B920E14ACB75FB7 /* iam_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iam_credentials.h; path = src/core/lib/security/credentials/iam/iam_credentials.h; sourceTree = ""; }; + B7500E416674A858D09E5A4B94CEAA0A /* sha1-altivec.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "sha1-altivec.c"; path = "src/crypto/fipsmodule/sha/sha1-altivec.c"; sourceTree = ""; }; + B76BA64695FE756F1CEBFD90E1C045F6 /* testharness.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = testharness.cc; path = util/testharness.cc; sourceTree = ""; }; + B76DE14AA09E463E45C815279F122262 /* wakeup_fd_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wakeup_fd_posix.h; path = src/core/lib/iomgr/wakeup_fd_posix.h; sourceTree = ""; }; + B7AED7340CC7A33CFA21702DB0C5689F /* client_callback_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_callback_impl.h; path = include/grpcpp/impl/codegen/client_callback_impl.h; sourceTree = ""; }; + B7B84AD8FEB5694D1B5DC90E365C65B4 /* channel_arguments_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_arguments_impl.h; path = include/grpcpp/support/channel_arguments_impl.h; sourceTree = ""; }; + B7D075AAA4EA4B9A66F838FB07E06537 /* alts_zero_copy_grpc_protector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_zero_copy_grpc_protector.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h; sourceTree = ""; }; + B7E98F1151263F1582E44733EC665B35 /* time_zone_fixed.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time_zone_fixed.cc; path = absl/time/internal/cctz/src/time_zone_fixed.cc; sourceTree = ""; }; + B7FF7729957306D9027B07B3BD4C7F1F /* completion_queue_factory.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = completion_queue_factory.cc; path = src/core/lib/surface/completion_queue_factory.cc; sourceTree = ""; }; + B8056BD4953560BE8C4323BC869D255D /* time.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = time.cc; path = src/core/lib/gpr/time.cc; sourceTree = ""; }; + B82A3BF0600ACFBB166AEA37753D9B47 /* bits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bits.h; path = absl/base/internal/bits.h; sourceTree = ""; }; + B8303536D8311470048E22BAD7C0022E /* avl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = avl.cc; path = src/core/lib/avl/avl.cc; sourceTree = ""; }; + B837CFC74CD4A6D99F897281F8338977 /* hmac.c */ = {isa = PBXFileReference; includeInIndex = 1; name = hmac.c; path = src/crypto/fipsmodule/hmac/hmac.c; sourceTree = ""; }; + B85686523B51ED1B96C574E89BE80623 /* api_listener.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = api_listener.upb.c; path = "src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c"; sourceTree = ""; }; + B85C1607FF9B70FE3F5E9976FFC0A4C0 /* mem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mem.h; path = src/include/openssl/mem.h; sourceTree = ""; }; + B85CE4D725A04808B8CCED68C7A34233 /* base64.c */ = {isa = PBXFileReference; includeInIndex = 1; name = base64.c; path = src/crypto/base64/base64.c; sourceTree = ""; }; + B877A4481E154F4843BE2B7B6BF110DD /* backend_metric.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backend_metric.h; path = src/core/ext/filters/client_channel/backend_metric.h; sourceTree = ""; }; + B882E42BF6F3E01E5EC81F7A55920316 /* async_stream_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_stream_impl.h; path = include/grpcpp/impl/codegen/async_stream_impl.h; sourceTree = ""; }; + B88479DDF08A5793854D3A5C6CC7B955 /* thread_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_annotations.h; path = port/thread_annotations.h; sourceTree = ""; }; + B890B6474BF0D27B4CD83FBF2973F8D5 /* route.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = route.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h"; sourceTree = ""; }; + B89455D4D5E651EC8A9E4F437F876E1E /* v3_crld.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_crld.c; path = src/crypto/x509v3/v3_crld.c; sourceTree = ""; }; + B8B945C4CE0702A4E4C559461E487786 /* version_edit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = version_edit.h; path = db/version_edit.h; sourceTree = ""; }; + B8C5BA28988FE67D943EE4B89F70AD7C /* FIRCoreDiagnosticsInterop.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsInterop.h; path = Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h; sourceTree = ""; }; + B8F5D730C790565BCD245A8E8D89D8AF /* endpoint_pair.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_pair.h; path = src/core/lib/iomgr/endpoint_pair.h; sourceTree = ""; }; + B90753262908732447133E9EB7EA9133 /* asn1_locl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = asn1_locl.h; path = src/crypto/asn1/asn1_locl.h; sourceTree = ""; }; + B90B89D30EE6628A3B9CD306B66CBCEB /* pkcs7.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pkcs7.h; path = src/include/openssl/pkcs7.h; sourceTree = ""; }; + B90C8BFB4C62A1154FC047C735BBCBD5 /* cds.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cds.cc; path = src/core/ext/filters/client_channel/lb_policy/xds/cds.cc; sourceTree = ""; }; + B91C24609F1C744CA97FBEAA648F4388 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/md5/internal.h; sourceTree = ""; }; + B92C6DF5A8773B02B200E0C10CBD35A5 /* server_address.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_address.cc; path = src/core/ext/filters/client_channel/server_address.cc; sourceTree = ""; }; + B9376AEE9CBF0723E43D5C941FCCDECB /* tsi_error.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tsi_error.h; path = src/core/lib/security/transport/tsi_error.h; sourceTree = ""; }; + B93C5630D5435A7B6CBB7527395BE2CC /* empty.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = empty.upb.h; path = "src/core/ext/upb-generated/google/protobuf/empty.upb.h"; sourceTree = ""; }; + B968209A67B472D066E21374175A4133 /* server_interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_interceptor.h; path = include/grpcpp/support/server_interceptor.h; sourceTree = ""; }; + B992BDC47F8D5EA6167AB33530A667F3 /* database_info.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = database_info.cc; path = Firestore/core/src/core/database_info.cc; sourceTree = ""; }; + B9A7671B2DB654BDC0949E6996270A31 /* bn.c */ = {isa = PBXFileReference; includeInIndex = 1; name = bn.c; path = src/crypto/fipsmodule/bn/bn.c; sourceTree = ""; }; + B9A8DB63C9E6BC478B02C6A286D5CC84 /* format.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = format.cc; path = table/format.cc; sourceTree = ""; }; + B9B3D3B27E959FE34D601455F52B8256 /* md32_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = md32_common.h; path = src/crypto/fipsmodule/digest/md32_common.h; sourceTree = ""; }; + B9B8640AFD3A0D5E5D8E7B48D1AC36F4 /* channelz.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channelz.h; path = src/core/lib/channel/channelz.h; sourceTree = ""; }; + B9C07D39456BEB25DADB8C12C3CFF84D /* handshaker.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = handshaker.upb.c; path = "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c"; sourceTree = ""; }; + B9D06E6C24606339788D0D52F834BAD9 /* t1_enc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = t1_enc.cc; path = src/ssl/t1_enc.cc; sourceTree = ""; }; + B9DDFD2DB55AACAB93FA58F91DB2B0CA /* safestack.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = safestack.h; path = src/include/openssl/safestack.h; sourceTree = ""; }; + B9EA3653E6FF20D4DDEFB9E91D53D9DA /* duration.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = duration.cc; path = absl/time/duration.cc; sourceTree = ""; }; + BA2040C110BB160079D3AD87D98859F6 /* validate.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = validate.upb.h; path = "src/core/ext/upb-generated/validate/validate.upb.h"; sourceTree = ""; }; + BA277D1A72D65DC13D7BEC2924E49626 /* FirebaseCoreDiagnostics.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseCoreDiagnostics.release.xcconfig; sourceTree = ""; }; + BA68FCEF1837B17A1D301620F1691D8A /* range.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = range.upb.c; path = "src/core/ext/upb-generated/envoy/type/range.upb.c"; sourceTree = ""; }; + BA6ABD04387D25D5D76CB8B541694A7C /* optional.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = optional.h; path = src/core/lib/gprpp/optional.h; sourceTree = ""; }; + BA7135395A9444571CCD8E81298A659B /* error_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error_utils.h; path = src/core/lib/transport/error_utils.h; sourceTree = ""; }; + BA89020A58C9CEAFC4D18F0F7D08B551 /* socket_factory_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_factory_posix.h; path = src/core/lib/iomgr/socket_factory_posix.h; sourceTree = ""; }; + BA9F14D30DD3A8D92CCA2CDEAA0BC67A /* jwt_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = jwt_credentials.cc; path = src/core/lib/security/credentials/jwt/jwt_credentials.cc; sourceTree = ""; }; + BAB8A844CC9BF67B2CE40DF3AE15D905 /* cpu-aarch64-fuchsia.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-aarch64-fuchsia.c"; path = "src/crypto/cpu-aarch64-fuchsia.c"; sourceTree = ""; }; + BADA78E910ACE2BCEDCCD27287A5B7D6 /* grpc_library.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_library.h; path = include/grpcpp/impl/codegen/grpc_library.h; sourceTree = ""; }; + BADAD519CFD8E5CEB574659BB63EB6C8 /* encode.c */ = {isa = PBXFileReference; includeInIndex = 1; name = encode.c; path = third_party/upb/upb/encode.c; sourceTree = ""; }; + BADEB8C599956CA2DD1F03F5D3F4849C /* md4.c */ = {isa = PBXFileReference; includeInIndex = 1; name = md4.c; path = src/crypto/fipsmodule/md4/md4.c; sourceTree = ""; }; + BB6F9EAE8F8836E40C9E2A82CC169BF0 /* global_config_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_custom.h; path = src/core/lib/gprpp/global_config_custom.h; sourceTree = ""; }; + BBD52C3309788076B92258E6C03FDBBE /* sockaddr_utils.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sockaddr_utils.cc; path = src/core/lib/iomgr/sockaddr_utils.cc; sourceTree = ""; }; + BC0178DF14AC0D9F8CDA8D7FAF34524B /* symbolize_elf.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = symbolize_elf.inc; path = absl/debugging/symbolize_elf.inc; sourceTree = ""; }; + BC12C02DA0FEBD8871DB81CF851840EF /* stacktrace_powerpc-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_powerpc-inl.inc"; path = "absl/debugging/internal/stacktrace_powerpc-inl.inc"; sourceTree = ""; }; + BC461799E3B8B280DFD5984271BE0BFA /* filter_block.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filter_block.cc; path = table/filter_block.cc; sourceTree = ""; }; + BC6DF4B32899D322F74979AD7AD18FAF /* endpoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.h; path = src/core/lib/iomgr/endpoint.h; sourceTree = ""; }; + BC745D065B51B818F70988028DFC89FA /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/ec/internal.h; sourceTree = ""; }; + BC7837EC1934C77FD3D8F0DC9948586D /* ssl_session_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_session_cache.cc; path = src/core/tsi/ssl/session_cache/ssl_session_cache.cc; sourceTree = ""; }; + BCA523D863485A1586D2C1DD6ACE89DF /* lhash.c */ = {isa = PBXFileReference; includeInIndex = 1; name = lhash.c; path = src/crypto/lhash/lhash.c; sourceTree = ""; }; + BCAB9C2B4E6A113E8D6D86D365C32573 /* iomgr_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_custom.cc; path = src/core/lib/iomgr/iomgr_custom.cc; sourceTree = ""; }; + BCAFFBCE88659266BA37FE7EC2FAABCA /* builder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = builder.h; path = db/builder.h; sourceTree = ""; }; + BCB66564FCB5BC008A67488E854FFC22 /* xds_client_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_client_stats.h; path = src/core/ext/filters/client_channel/xds/xds_client_stats.h; sourceTree = ""; }; + BCDA4B4BD0B0067A866E17307EE7AA60 /* tmpfile.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tmpfile.h; path = src/core/lib/gpr/tmpfile.h; sourceTree = ""; }; + BCDFDD5A82F42416C11FDCEBCEF4F35D /* connected_channel.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = connected_channel.cc; path = src/core/lib/channel/connected_channel.cc; sourceTree = ""; }; + BCF66273E55F5A6AF80811B117615C86 /* alts_unseal_privacy_integrity_crypter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_unseal_privacy_integrity_crypter.cc; path = src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc; sourceTree = ""; }; + BD071376906792B6FE1F55E354D2C4D1 /* generic.c */ = {isa = PBXFileReference; includeInIndex = 1; name = generic.c; path = src/crypto/fipsmodule/bn/generic.c; sourceTree = ""; }; + BD0F49082734818E144B79E58E5697AD /* iomgr_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_custom.h; path = src/core/lib/iomgr/iomgr_custom.h; sourceTree = ""; }; + BD284FC7A814576CC2BFD9A571D2F3AB /* aes_nohw.c */ = {isa = PBXFileReference; includeInIndex = 1; name = aes_nohw.c; path = src/crypto/fipsmodule/aes/aes_nohw.c; sourceTree = ""; }; + BD394E2AA9A6F3C1611A9250512A6320 /* FBLPromise+Recover.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Recover.h"; path = "Sources/FBLPromises/include/FBLPromise+Recover.h"; sourceTree = ""; }; + BD4D206E034593577820C0BD18349D7E /* interceptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = interceptor.h; path = include/grpcpp/impl/codegen/interceptor.h; sourceTree = ""; }; + BD53403E4372AE2A9BBA894429AFB48C /* create_channel_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_channel_impl.h; path = include/grpcpp/create_channel_impl.h; sourceTree = ""; }; + BD5476FE3953EBF5D8B40E5116155D11 /* stacktrace_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stacktrace_config.h; path = absl/debugging/internal/stacktrace_config.h; sourceTree = ""; }; + BD6EE669E7867E6FAE6234BAEC37F3B3 /* server_posix_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_posix_impl.h; path = include/grpcpp/server_posix_impl.h; sourceTree = ""; }; + BD710511A69243559892D8C1A68BAD3A /* security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = security_connector.h; path = src/core/lib/security/security_connector/security_connector.h; sourceTree = ""; }; + BD9868F082F4AA742CA857B0F81F9A90 /* gpr_types.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gpr_types.h; path = include/grpc/impl/codegen/gpr_types.h; sourceTree = ""; }; + BDCCF92BB835F08D02294A95CF06E9A5 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/aes/internal.h; sourceTree = ""; }; + BDCEC0B20E171A7777A851872F76C946 /* grpc_tls_credentials_options.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_tls_credentials_options.cc; path = src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc; sourceTree = ""; }; + BDD36E0AD59593429CEEDA4EA237E1C9 /* bn.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bn.h; path = src/include/openssl/bn.h; sourceTree = ""; }; + BDD988DD3C6BF4ED823136D32F96453B /* cpu_linux.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cpu_linux.cc; path = src/core/lib/gpr/cpu_linux.cc; sourceTree = ""; }; + BDEF32DE7B79E9425C0940C902B67AA1 /* GDTCORRegistrar_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORRegistrar_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORRegistrar_Private.h; sourceTree = ""; }; + BE185D6B647352A4F9246396D77855D6 /* protocol.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = protocol.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h"; sourceTree = ""; }; + BE1A5CA112680CAD15A50AA9C9C144F5 /* x509_vfy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = x509_vfy.h; path = src/include/openssl/x509_vfy.h; sourceTree = ""; }; + BE37AC01F35D68250437EA7364FBFDDB /* v3_enum.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_enum.c; path = src/crypto/x509v3/v3_enum.c; sourceTree = ""; }; + BE4E7E7FBE269A8D8925A4C2B7D3BD0A /* cluster.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cluster.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h"; sourceTree = ""; }; + BEAB20D74799C10CD5D7FDCF954F7C7F /* auth_property_iterator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = auth_property_iterator.cc; path = src/cpp/common/auth_property_iterator.cc; sourceTree = ""; }; + BEB68F5A6FCCA598215C0060142CC500 /* server_initializer_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_initializer_impl.h; path = include/grpcpp/impl/server_initializer_impl.h; sourceTree = ""; }; + BEB75104005D644894B0A870CA28013A /* crypto.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = crypto.h; path = src/include/openssl/crypto.h; sourceTree = ""; }; + BED200068BA15F70BDAF41898196F81E /* arena.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = arena.h; path = src/core/lib/gprpp/arena.h; sourceTree = ""; }; + BED497979D5401D5008955BBAC0949D5 /* dtls_record.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dtls_record.cc; path = src/ssl/dtls_record.cc; sourceTree = ""; }; + BF01A6D43CB86206732DF664B5E50589 /* iomgr_posix_cfstream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_posix_cfstream.cc; path = src/core/lib/iomgr/iomgr_posix_cfstream.cc; sourceTree = ""; }; + BF0A8F53E46B4EABBCF9C8F623CBE3FB /* target.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = target.nanopb.cc; path = Firestore/Protos/nanopb/firestore/local/target.nanopb.cc; sourceTree = ""; }; + BF0F2A4D7E6BFCE77B44D101C672CBBA /* proxy_mapper_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = proxy_mapper_registry.cc; path = src/core/ext/filters/client_channel/proxy_mapper_registry.cc; sourceTree = ""; }; + BF47503B9F6EBE5698D99FE7D2501F3A /* resource_quota.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resource_quota.cc; path = src/core/lib/iomgr/resource_quota.cc; sourceTree = ""; }; + BF491B7EC78D49D1C61B2B007A52FA85 /* filter.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = filter.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h"; sourceTree = ""; }; + BF4B22447247346F2D6BA25E3A38580B /* subchannel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = subchannel.h; path = src/core/ext/filters/client_channel/subchannel.h; sourceTree = ""; }; + BF4DF5A173FFDBE5D81916F40C6097C3 /* by_dir.c */ = {isa = PBXFileReference; includeInIndex = 1; name = by_dir.c; path = src/crypto/x509/by_dir.c; sourceTree = ""; }; + BF6E062C93E29B0E891706DFC310BA7F /* ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist"; sourceTree = ""; }; + BF7A15CECB726366A97C598EAAD3BE36 /* check_gcp_environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = check_gcp_environment.h; path = src/core/lib/security/credentials/alts/check_gcp_environment.h; sourceTree = ""; }; + BF96B57ADE05E8909F823BDF6868B3E3 /* abseil */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = abseil; path = absl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BF975F8D02AE3175AD21B5BED7FDC2D1 /* slice_string_helpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_string_helpers.h; path = src/core/lib/slice/slice_string_helpers.h; sourceTree = ""; }; + BFA7899F031EE1AD276272290F6723D3 /* wrappers.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = wrappers.upb.h; path = "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h"; sourceTree = ""; }; + BFB71B3499C2B7952DC2380E28AC26DA /* felem.c */ = {isa = PBXFileReference; includeInIndex = 1; name = felem.c; path = src/crypto/fipsmodule/ec/felem.c; sourceTree = ""; }; + BFF4010FDB9D10844BD2A963E431761F /* client_authority_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_authority_filter.h; path = src/core/ext/filters/http/client_authority_filter.h; sourceTree = ""; }; + C02F3C374771C1823618EC8DD2F40674 /* FIRAppAssociationRegistration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRAppAssociationRegistration.m; path = FirebaseCore/Sources/FIRAppAssociationRegistration.m; sourceTree = ""; }; + C043FAE2657D24268BEAC10297E6C5CE /* alts_grpc_privacy_integrity_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_privacy_integrity_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h; sourceTree = ""; }; + C04B2099E2F95F4843121C72BCAE1329 /* channel_init.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_init.h; path = src/core/lib/surface/channel_init.h; sourceTree = ""; }; + C059B70AC0BD62C9C8C01173AAC7101B /* alts_crypter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_crypter.h; path = src/core/tsi/alts/frame_protector/alts_crypter.h; sourceTree = ""; }; + C07F6A0A40C9DC31FA0BFE51E0F3F29C /* alts_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_credentials.cc; path = src/core/lib/security/credentials/alts/alts_credentials.cc; sourceTree = ""; }; + C08BBCFD2E1E030C2A149B618CE72893 /* ev_poll_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ev_poll_posix.cc; path = src/core/lib/iomgr/ev_poll_posix.cc; sourceTree = ""; }; + C0995314397C451FB3BA572AEE93EAC0 /* polling_entity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = polling_entity.cc; path = src/core/lib/iomgr/polling_entity.cc; sourceTree = ""; }; + C0A84F8A336DF72C0ACD14A34CC6B4E0 /* http_proxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_proxy.h; path = src/core/ext/filters/client_channel/http_proxy.h; sourceTree = ""; }; + C0B4CBC2E1E86CE7E8AE79BC48878FA8 /* waiter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = waiter.h; path = absl/synchronization/internal/waiter.h; sourceTree = ""; }; + C0BCF9BBBCE0F13B2106AE7DFE12B7A3 /* char_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = char_map.h; path = absl/strings/internal/char_map.h; sourceTree = ""; }; + C0C01AFC3951F03191910FD0B061E5AC /* resolving_lb_policy.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolving_lb_policy.cc; path = src/core/ext/filters/client_channel/resolving_lb_policy.cc; sourceTree = ""; }; + C0C6AEAD726718D6AD4F0C71E7E98FFE /* city.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = city.cc; path = absl/hash/internal/city.cc; sourceTree = ""; }; + C0D4BF860FCF3CB320E8D08BE31CB6AA /* client_authority_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_authority_filter.h; path = src/core/ext/filters/http/client_authority_filter.h; sourceTree = ""; }; + C0F1069D612BA4932C4D69EF2F691684 /* GDTCORUploadCoordinator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORUploadCoordinator.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORUploadCoordinator.m; sourceTree = ""; }; + C0F95936CA615C11C89937BAB702E9FF /* http.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = http.upb.c; path = "src/core/ext/upb-generated/google/api/http.upb.c"; sourceTree = ""; }; + C0FC28EE8D3452EDA699A4B5651A8372 /* string_view.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string_view.h; path = src/core/lib/gprpp/string_view.h; sourceTree = ""; }; + C0FCC9F65B74D5C5872E549E75D35474 /* frame_ping.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_ping.h; path = src/core/ext/transport/chttp2/transport/frame_ping.h; sourceTree = ""; }; + C11001863E0DC4ECF24BC41B2E2351B2 /* call_combiner.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = call_combiner.cc; path = src/core/lib/iomgr/call_combiner.cc; sourceTree = ""; }; + C1176295495A9747C0B9B9B03E9A680B /* opensslconf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = opensslconf.h; path = src/include/openssl/opensslconf.h; sourceTree = ""; }; + C12D068B4C260A5B7B3E461C7940A9FC /* byte_string.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_string.cc; path = Firestore/core/src/nanopb/byte_string.cc; sourceTree = ""; }; + C12FDA4D0284C83C4D7A328AAD8476A5 /* async_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_stream.h; path = include/grpcpp/support/async_stream.h; sourceTree = ""; }; + C1452B0C756F28A1E66A09F6C31F96CC /* percent.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = percent.upb.c; path = "src/core/ext/upb-generated/envoy/type/percent.upb.c"; sourceTree = ""; }; + C1628A866AD0775C2468886C7793BF8D /* FIRFirestoreSource.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFirestoreSource.mm; path = Firestore/Source/API/FIRFirestoreSource.mm; sourceTree = ""; }; + C17E933B460CB8BAD35A45C8547719B9 /* rsa_print.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsa_print.c; path = src/crypto/rsa_extra/rsa_print.c; sourceTree = ""; }; + C1A6FB7F4CF44C46C1449EEADAB214FD /* FIRFieldValue.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFieldValue.mm; path = Firestore/Source/API/FIRFieldValue.mm; sourceTree = ""; }; + C1A700116171DB2AAD92182ED70C2F4B /* alts_handshaker_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_handshaker_client.h; path = src/core/tsi/alts/handshaker/alts_handshaker_client.h; sourceTree = ""; }; + C1B7B714FB039D1AA506F7C651DDF88A /* pem_pk8.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_pk8.c; path = src/crypto/pem/pem_pk8.c; sourceTree = ""; }; + C1BE46C4A61415F111C103DAC90A8336 /* timer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer.h; path = src/core/lib/iomgr/timer.h; sourceTree = ""; }; + C1C6DCD4547B6351867A16CEB2FAA8C1 /* GDTCORStorageEventSelector.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORStorageEventSelector.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORStorageEventSelector.m; sourceTree = ""; }; + C1CBE59511729F6F65A789D0499AAE62 /* service_type.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = service_type.h; path = include/grpcpp/impl/service_type.h; sourceTree = ""; }; + C1F38D55C8E30A661DE2C27721FD3E20 /* a_utctm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_utctm.c; path = src/crypto/asn1/a_utctm.c; sourceTree = ""; }; + C1F602F381982562125C87D9DE821A42 /* http.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = http.upb.c; path = "src/core/ext/upb-generated/envoy/type/http.upb.c"; sourceTree = ""; }; + C212D56249A75AF324510228EA386D6D /* port_example.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port_example.h; path = port/port_example.h; sourceTree = ""; }; + C26CB30253C7D28ED95B593D2D9F6B3E /* x509_def.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_def.c; path = src/crypto/x509/x509_def.c; sourceTree = ""; }; + C29464429CCADC80A3820661FAE5D16E /* auth_metadata_processor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_metadata_processor.h; path = include/grpcpp/security/auth_metadata_processor.h; sourceTree = ""; }; + C2EBEFC627CDE60001FD058D2F266910 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/hrss/internal.h; sourceTree = ""; }; + C2FD8B4BBBA1F7122B7E451C9C875BFA /* uri_parser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = uri_parser.h; path = src/core/lib/uri/uri_parser.h; sourceTree = ""; }; + C3040637B0E10661A176331DB6893688 /* byte_buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = byte_buffer.h; path = include/grpc/byte_buffer.h; sourceTree = ""; }; + C30AA0201F10E929C58BF307B5B88491 /* bad_any_cast.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bad_any_cast.cc; path = absl/types/bad_any_cast.cc; sourceTree = ""; }; + C3483A9E757721D4A9C8A9839154EA6B /* FIRAnalyticsConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAnalyticsConfiguration.h; path = FirebaseCore/Sources/FIRAnalyticsConfiguration.h; sourceTree = ""; }; + C34D4943091EB3998904FAA5A6C79FC6 /* thread_manager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_manager.h; path = src/cpp/thread_manager/thread_manager.h; sourceTree = ""; }; + C35E20E0A4A7FB1093AB2A3577E4F17E /* tcp_server_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_server_windows.cc; path = src/core/lib/iomgr/tcp_server_windows.cc; sourceTree = ""; }; + C360C13D2D40CC6D783F9E87E5D90719 /* xds_resolver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_resolver.cc; path = src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc; sourceTree = ""; }; + C376CA4ADCF65A427E0495534EEA6ACD /* create_auth_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_auth_context.h; path = include/grpcpp/impl/codegen/create_auth_context.h; sourceTree = ""; }; + C37752E1C6F639AE3D672954C6D7B2FC /* gRPC-C++-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "gRPC-C++-Info.plist"; sourceTree = ""; }; + C3A968949A80360C1905158D071E4C1C /* ex_data.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ex_data.h; path = src/include/openssl/ex_data.h; sourceTree = ""; }; + C3C6821DE3D82C3B325C8667807CA566 /* string_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = string_windows.cc; path = src/core/lib/gpr/string_windows.cc; sourceTree = ""; }; + C3F1BC53FFD8A4A51DA3A8131D9BFA14 /* secure_endpoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = secure_endpoint.h; path = src/core/lib/security/transport/secure_endpoint.h; sourceTree = ""; }; + C3FBD6A9D5FA239CA5766A8F9C4B13F6 /* GDTCCTNanopbHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCCTNanopbHelpers.h; path = GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h; sourceTree = ""; }; + C43DF0BBD4AAB949A2BACC8206E54CF9 /* avl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = avl.h; path = src/core/lib/avl/avl.h; sourceTree = ""; }; + C441124E91653A0ACB44A88B91CC4A9D /* version_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = version_cc.cc; path = src/cpp/common/version_cc.cc; sourceTree = ""; }; + C44A9673099B2584D7099AFAB608672A /* fork.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fork.h; path = src/core/lib/gprpp/fork.h; sourceTree = ""; }; + C453377C6E38701BE8795477EAE77A8A /* async_generic_service.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = async_generic_service.h; path = include/grpcpp/impl/codegen/async_generic_service.h; sourceTree = ""; }; + C45ECDECA1CC685F920E3086D10E4331 /* FIRVersion.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRVersion.m; path = FirebaseCore/Sources/FIRVersion.m; sourceTree = ""; }; + C49DD1E3E8979A79261C335076E29E97 /* sha.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sha.h; path = src/include/openssl/sha.h; sourceTree = ""; }; + C4B78A20DAD26B9E8FB2F462145044B5 /* arg.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = arg.cc; path = absl/strings/internal/str_format/arg.cc; sourceTree = ""; }; + C4D0667700B3B9F86DC608BF0D167F32 /* GULHeartbeatDateStorage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULHeartbeatDateStorage.m; path = GoogleUtilities/Environment/GULHeartbeatDateStorage.m; sourceTree = ""; }; + C4DBDFAA01677E09DE671E3F9C9CAB05 /* accesslog.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = accesslog.upb.c; path = "src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c"; sourceTree = ""; }; + C4F26573BCE94BD7C3312652A786CA78 /* ecdh_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ecdh_extra.c; path = src/crypto/ecdh_extra/ecdh_extra.c; sourceTree = ""; }; + C4F94046AF98C1F7AE234D6D8EB3C3F6 /* global_config_env.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_env.h; path = src/core/lib/gprpp/global_config_env.h; sourceTree = ""; }; + C5023C9AD47210C9FDB7C03D14544B73 /* ev_poll_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_poll_posix.h; path = src/core/lib/iomgr/ev_poll_posix.h; sourceTree = ""; }; + C5290DC6851A635298C20FAF5B67CE70 /* sync.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync.h; path = include/grpc/impl/codegen/sync.h; sourceTree = ""; }; + C568E053FB87DB623CE6EF46579743E0 /* firebase_metadata_provider_apple.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = firebase_metadata_provider_apple.mm; path = Firestore/core/src/remote/firebase_metadata_provider_apple.mm; sourceTree = ""; }; + C5B3E6E383400260EACF184A4CF39998 /* message_allocator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_allocator.h; path = include/grpcpp/support/message_allocator.h; sourceTree = ""; }; + C5BAE0EF410BB567EEB31BEFF337A9A5 /* ecdsa_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ecdsa_asn1.c; path = src/crypto/ecdsa_extra/ecdsa_asn1.c; sourceTree = ""; }; + C5C3298D881E6BC29AF8B4E10D80113D /* tls_pthread.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_pthread.h; path = src/core/lib/gpr/tls_pthread.h; sourceTree = ""; }; + C5C671C3A8E2619B166BB8466A4C0ED0 /* service_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = service_config.h; path = src/core/ext/filters/client_channel/service_config.h; sourceTree = ""; }; + C5EDF444EA6073E298253A4A97F3AF51 /* ssl_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ssl_security_connector.h; path = src/core/lib/security/security_connector/ssl/ssl_security_connector.h; sourceTree = ""; }; + C61C247E80D4D023E85484ECD546AC0B /* unscaledcycleclock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = unscaledcycleclock.h; path = absl/base/internal/unscaledcycleclock.h; sourceTree = ""; }; + C62DCF6C8D4E7CA9AFA7D2DB579020D5 /* grpc_if_nametoindex.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_if_nametoindex.h; path = src/core/lib/iomgr/grpc_if_nametoindex.h; sourceTree = ""; }; + C65FFAB5F7F4C7F4CB26D6247ABDC4BE /* grpc_root_certificates_generated.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_root_certificates_generated.cc; path = Firestore/core/src/remote/grpc_root_certificates_generated.cc; sourceTree = ""; }; + C678F46438323BBCB4A050D20053D017 /* str_join_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_join_internal.h; path = absl/strings/internal/str_join_internal.h; sourceTree = ""; }; + C6895E29EC353E27DBE7B52C43BE9D25 /* x509spki.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509spki.c; path = src/crypto/x509/x509spki.c; sourceTree = ""; }; + C6D0FECC069776402D0BFFD1768CE856 /* self_check.c */ = {isa = PBXFileReference; includeInIndex = 1; name = self_check.c; path = src/crypto/fipsmodule/self_check/self_check.c; sourceTree = ""; }; + C6FC9F98592D1139A0D409DDC4E71088 /* custom_tag.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = custom_tag.upb.c; path = "src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c"; sourceTree = ""; }; + C7036343B39BFDA0F9DF8238A27AAE70 /* transport_security_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_interface.h; path = src/core/tsi/transport_security_interface.h; sourceTree = ""; }; + C705266C9BC559B117BE781A5F6784CF /* endpoint_components.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint_components.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c"; sourceTree = ""; }; + C7202C5F56C36FEA4840D0810CFEC451 /* socket_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_windows.h; path = src/core/lib/iomgr/socket_windows.h; sourceTree = ""; }; + C722FD41DE216F5E42D8B5B0BA8A2170 /* grpclb_channel_secure.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpclb_channel_secure.cc; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc; sourceTree = ""; }; + C736C7F24FA06CEC8120148702B9593B /* slice_weak_hash_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_weak_hash_table.h; path = src/core/lib/slice/slice_weak_hash_table.h; sourceTree = ""; }; + C748D5F0B1DB94E7F4C21469C988B672 /* grpclb_client_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb_client_stats.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h; sourceTree = ""; }; + C750DB7FD3ECBC4EEC46DDE950FD8737 /* query.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query.cc; path = Firestore/core/src/core/query.cc; sourceTree = ""; }; + C77437A75F722B23647A5CFC01FB6905 /* interceptor_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = interceptor_common.h; path = include/grpcpp/impl/codegen/interceptor_common.h; sourceTree = ""; }; + C7834BFC231D585EC48892D05C85A74F /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/des/internal.h; sourceTree = ""; }; + C78C141A9A2F8317180F5FA5798131FC /* socket_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = socket_utils.h; path = src/core/lib/iomgr/socket_utils.h; sourceTree = ""; }; + C794B0701088F676E57A0A7CBF4989D0 /* p256-x86_64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "p256-x86_64.h"; path = "src/crypto/fipsmodule/ec/p256-x86_64.h"; sourceTree = ""; }; + C7AD1CB86D9A9880C6B6C26A5250ED61 /* FBLPromise+Then.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Then.h"; path = "Sources/FBLPromises/include/FBLPromise+Then.h"; sourceTree = ""; }; + C7E75A3C6625795F606173495E322656 /* barrier.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = barrier.h; path = absl/synchronization/barrier.h; sourceTree = ""; }; + C7EEA401F0F0737E47114170D1B40EAF /* message_allocator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_allocator.h; path = include/grpcpp/impl/codegen/message_allocator.h; sourceTree = ""; }; + C7F138DC17DE54C2F2670836233F1D75 /* filter_policy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = filter_policy.h; path = include/leveldb/filter_policy.h; sourceTree = ""; }; + C7F493F10F5205AD768A4E37DF5E5A37 /* lrs.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lrs.upb.h; path = "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h"; sourceTree = ""; }; + C829A0AD4AF4F4BF35A998E7C8B131B2 /* pollset_set_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_set_windows.cc; path = src/core/lib/iomgr/pollset_set_windows.cc; sourceTree = ""; }; + C829FB38561BAE9EB5AEB66C4ED272AA /* xds_client_stats.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_client_stats.h; path = src/core/ext/filters/client_channel/xds/xds_client_stats.h; sourceTree = ""; }; + C8327A3256B4CE3C87DCCEA19397E6F3 /* http.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http.upb.h; path = "src/core/ext/upb-generated/google/api/http.upb.h"; sourceTree = ""; }; + C84D9865D597EFA2055680E9A871A64E /* http2_errors.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http2_errors.h; path = src/core/lib/transport/http2_errors.h; sourceTree = ""; }; + C88238DAA407FE576B2D439F35479F37 /* time.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = time.h; path = absl/time/time.h; sourceTree = ""; }; + C88B9497962F43DFFE2E8C47A44B4670 /* abseil-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "abseil-dummy.m"; sourceTree = ""; }; + C890CAD79CB25BC6F37D1A02E532AF00 /* handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker.h; path = src/core/lib/channel/handshaker.h; sourceTree = ""; }; + C8BE8279B6758E926B4976ACD4AFEFB4 /* resolve_address_custom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolve_address_custom.cc; path = src/core/lib/iomgr/resolve_address_custom.cc; sourceTree = ""; }; + C8E192B9EA33B3BCEC71CD10D86848B8 /* GDTCOREndpoints.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCOREndpoints.m; path = GoogleDataTransport/GDTCORLibrary/GDTCOREndpoints.m; sourceTree = ""; }; + C8E2BCA63656E9197EE81C9058A4DB6E /* asn1.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = asn1.h; path = src/include/openssl/asn1.h; sourceTree = ""; }; + C8EA44397F063036809B8B994F31CBF2 /* ecdh.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ecdh.h; path = src/include/openssl/ecdh.h; sourceTree = ""; }; + C8F580082C4E97246CBB58D8E9E5043D /* endpoint_pair.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint_pair.h; path = src/core/lib/iomgr/endpoint_pair.h; sourceTree = ""; }; + C8F9C45FE872D6F4C3B5FCB43ECE638C /* FBLPromise+Recover.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Recover.m"; path = "Sources/FBLPromises/FBLPromise+Recover.m"; sourceTree = ""; }; + C8FA03E68B2B6F8B6051D2A50FCE2148 /* server_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_impl.h; path = include/grpcpp/server_impl.h; sourceTree = ""; }; + C9086F7E8F8207376E67A8A3538135DD /* status_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status_metadata.cc; path = src/core/lib/transport/status_metadata.cc; sourceTree = ""; }; + C909D2575066B9D55D407688BC220B8F /* unix_sockets_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = unix_sockets_posix.h; path = src/core/lib/iomgr/unix_sockets_posix.h; sourceTree = ""; }; + C909F81954D9B7DB45952082B104FE03 /* status_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_metadata.h; path = src/core/lib/transport/status_metadata.h; sourceTree = ""; }; + C93587944B54F3913789EA657E2C4742 /* alpn.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alpn.h; path = src/core/ext/transport/chttp2/alpn/alpn.h; sourceTree = ""; }; + C971340180014EF94FAA2EC4BCC9DAFC /* http_client_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = http_client_filter.cc; path = src/core/ext/filters/http/client/http_client_filter.cc; sourceTree = ""; }; + C99606D6DC22C6EFC7C59C9BF3D109BF /* FIROptionsInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIROptionsInternal.h; path = FirebaseCore/Sources/Private/FIROptionsInternal.h; sourceTree = ""; }; + C9DBE43E371330B98DAD14A7381D02A5 /* iomgr_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_posix.h; path = src/core/lib/iomgr/iomgr_posix.h; sourceTree = ""; }; + C9E1D7CB8A6610A6119F02E31452F2A4 /* cds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h"; sourceTree = ""; }; + C9F016A74296D7C56C7C8BA613C59CF5 /* alts_zero_copy_grpc_protector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_zero_copy_grpc_protector.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h; sourceTree = ""; }; + CA09288322BBF42C93B3F5A29490A607 /* FirebaseCoreDiagnostics-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FirebaseCoreDiagnostics-dummy.m"; sourceTree = ""; }; + CA10B384C2987C54413082FF23735492 /* GDTCORTransformer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORTransformer.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORTransformer.m; sourceTree = ""; }; + CA6A93BE4E01D3F7B894BD2A5342D8C3 /* x509_r2x.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_r2x.c; path = src/crypto/x509/x509_r2x.c; sourceTree = ""; }; + CA854AE345848AF841C7A0D297C78EEF /* percent_encoding.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = percent_encoding.cc; path = src/core/lib/slice/percent_encoding.cc; sourceTree = ""; }; + CA9AB38A79694A5AE631AB1CE594D504 /* e_null.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_null.c; path = src/crypto/cipher_extra/e_null.c; sourceTree = ""; }; + CAA186BD32F13676AAF8B7B67A8A54D2 /* scoped_route.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = scoped_route.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c"; sourceTree = ""; }; + CAAC3788E201C140F3F27330EC20E486 /* GDTCORPlatform.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORPlatform.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORPlatform.h; sourceTree = ""; }; + CAC79AB1E2662705341C013854CC1683 /* xds_channel_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_channel_args.h; path = src/core/ext/filters/client_channel/xds/xds_channel_args.h; sourceTree = ""; }; + CAECDFECDF6874B5BE6A7DA67D4053D6 /* string.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string.upb.h; path = "src/core/ext/upb-generated/envoy/type/matcher/string.upb.h"; sourceTree = ""; }; + CAF3A088DC0DFCAD5B04CD156CA78E5E /* ssl_session_openssl.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_session_openssl.cc; path = src/core/tsi/ssl/session_cache/ssl_session_openssl.cc; sourceTree = ""; }; + CB304E6E4DDDD47D7B5FC05DB827965F /* user.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = user.cc; path = Firestore/core/src/credentials/user.cc; sourceTree = ""; }; + CB32E308C5968F01A8B4A53F87A867B8 /* channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel.h; path = src/core/lib/surface/channel.h; sourceTree = ""; }; + CB471F5CF9763A5337E2D9D7E5ED8130 /* FirebaseFirestore.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseFirestore.debug.xcconfig; sourceTree = ""; }; + CB8103890F95891B388D7F9E5FB8E2BA /* resolve_address_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolve_address_custom.h; path = src/core/lib/iomgr/resolve_address_custom.h; sourceTree = ""; }; + CB98B1EEEBA6CDEC82C29D97F81668A5 /* dns_resolver_selection.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = dns_resolver_selection.cc; path = src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc; sourceTree = ""; }; + CB9E0586786503733DE3CB26BE3895B8 /* proxy_mapper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proxy_mapper.h; path = src/core/ext/filters/client_channel/proxy_mapper.h; sourceTree = ""; }; + CBE383C29BEDF8484AB6FD097D1BE43B /* slice_hash_table.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_hash_table.h; path = src/core/lib/slice/slice_hash_table.h; sourceTree = ""; }; + CC06571CA7534BECBFF51CB4CAEF8120 /* percent_encoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = percent_encoding.h; path = src/core/lib/slice/percent_encoding.h; sourceTree = ""; }; + CC3D4368692AC125461B76F60FC5AE5D /* options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = options.h; path = include/leveldb/options.h; sourceTree = ""; }; + CC4A63E2A2A0F9CCAC332C57C650BDD0 /* error.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = error.cc; path = src/core/lib/iomgr/error.cc; sourceTree = ""; }; + CC536920ACC3ACAC107C84AD1D25B15B /* status_conversion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_conversion.h; path = src/core/lib/transport/status_conversion.h; sourceTree = ""; }; + CC6069A09DEAE7C6F305E4D73F80A306 /* FIRComponentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponentType.h; path = FirebaseCore/Sources/Private/FIRComponentType.h; sourceTree = ""; }; + CC7367D782DD81E4576FF29B43CE2581 /* lhash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lhash.h; path = src/include/openssl/lhash.h; sourceTree = ""; }; + CC97C2EC4CDD54ECE16CD500F9A484CC /* FIRCollectionReference.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRCollectionReference.mm; path = Firestore/Source/API/FIRCollectionReference.mm; sourceTree = ""; }; + CCAB8392092C9D2B149B03DE38E1F51E /* external_connection_acceptor_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = external_connection_acceptor_impl.h; path = src/cpp/server/external_connection_acceptor_impl.h; sourceTree = ""; }; + CCABD3D5279855E5536DE3F2F51E31F2 /* PromisesObjC-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromisesObjC-umbrella.h"; sourceTree = ""; }; + CCB747D28B7C26F8522289F57BE54380 /* inlined_vector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = inlined_vector.h; path = src/core/lib/gprpp/inlined_vector.h; sourceTree = ""; }; + CCC1745DB5372F9CD973303AF0DE1ACB /* client_load_reporting_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_load_reporting_filter.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h; sourceTree = ""; }; + CCC4E0650D504476E993AE3C31F9192F /* GDTCORClock.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORClock.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORClock.m; sourceTree = ""; }; + CCD1EFE89EDC32963ED5DF3D278AE53D /* proto_buffer_writer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = proto_buffer_writer.h; path = include/grpcpp/support/proto_buffer_writer.h; sourceTree = ""; }; + CCF07C1E11206B22B474B76097194590 /* auth_metadata_processor_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_metadata_processor_impl.h; path = include/grpcpp/security/auth_metadata_processor_impl.h; sourceTree = ""; }; + CCF3050B8F684E641A61005EA0A6D8C0 /* compression_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = compression_internal.h; path = src/core/lib/compression/compression_internal.h; sourceTree = ""; }; + CD3955A2D928D5CF136DE430715ABD72 /* resolver_result_parsing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_result_parsing.h; path = src/core/ext/filters/client_channel/resolver_result_parsing.h; sourceTree = ""; }; + CD432985E39A59D2A752A839C6572213 /* accesslog.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = accesslog.upb.h; path = "src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h"; sourceTree = ""; }; + CD6064577A74079D5FA2FF512B0DCA65 /* symbolize_win32.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = symbolize_win32.inc; path = absl/debugging/symbolize_win32.inc; sourceTree = ""; }; + CD676D07C0BCA6C58E93E75DA606FFB0 /* threadpool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = threadpool.h; path = src/core/lib/iomgr/executor/threadpool.h; sourceTree = ""; }; + CD6A7D16A01E330E3D7859D2C1E6143F /* pollset_set_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pollset_set_windows.h; path = src/core/lib/iomgr/pollset_set_windows.h; sourceTree = ""; }; + CD74399B5F51BF1848F33AA8EE2F5729 /* FIRDocumentSnapshot.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRDocumentSnapshot.mm; path = Firestore/Source/API/FIRDocumentSnapshot.mm; sourceTree = ""; }; + CD7901B81D9F0281ED1313A06D465E34 /* FirebaseCoreDiagnostics.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = FirebaseCoreDiagnostics.modulemap; sourceTree = ""; }; + CD805EFC5439762E359FE90670D50C81 /* create_channel_internal.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = create_channel_internal.cc; path = src/cpp/client/create_channel_internal.cc; sourceTree = ""; }; + CD968E8D4F3BCC435DB29548EDFF5C4F /* charconv_bigint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = charconv_bigint.h; path = absl/strings/internal/charconv_bigint.h; sourceTree = ""; }; + CDADDF63B94ED816838C92C98FF81B15 /* flat_hash_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = flat_hash_map.h; path = absl/container/flat_hash_map.h; sourceTree = ""; }; + CDD3D92FD7CCA0707DD1333F8A1B2A44 /* listener_components.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = listener_components.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h"; sourceTree = ""; }; + CDD9B22F6A71F521E4C000F493C1E179 /* slice_intern.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = slice_intern.cc; path = src/core/lib/slice/slice_intern.cc; sourceTree = ""; }; + CDE5D386BB6C60A3B504FF9F3CF9E6FF /* tcp_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_server.h; path = src/core/lib/iomgr/tcp_server.h; sourceTree = ""; }; + CE2D2DD03C29671D5CA640FDC172BFEF /* tls_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_security_connector.h; path = src/core/lib/security/security_connector/tls/tls_security_connector.h; sourceTree = ""; }; + CE89EE53BA730471669A24E6395BFFA3 /* tls13_server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls13_server.cc; path = src/ssl/tls13_server.cc; sourceTree = ""; }; + CEDC1AD9FCEC707B36616065392A2C1E /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/third_party/fiat/internal.h; sourceTree = ""; }; + CEFB3F5141D9519858DD21AD7B723BD7 /* transport_security_common_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_security_common_api.h; path = src/core/tsi/alts/handshaker/transport_security_common_api.h; sourceTree = ""; }; + CF1788CDE9AFFBF7E60F1C43D4227EEE /* udp_listener_config.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = udp_listener_config.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c"; sourceTree = ""; }; + CF1A3CF6D75124BEB09C41029E3CA22C /* client_callback_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_callback_impl.h; path = include/grpcpp/support/client_callback_impl.h; sourceTree = ""; }; + CF2A5FE548133BDB401A39ED658C5664 /* x_exten.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_exten.c; path = src/crypto/x509/x_exten.c; sourceTree = ""; }; + CF9597C496DE5BF09079B3514E56B148 /* sync_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_windows.h; path = include/grpc/support/sync_windows.h; sourceTree = ""; }; + CF99C8276446029A4FF42F03148B7B1F /* firebase_metadata_provider.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firebase_metadata_provider.cc; path = Firestore/core/src/remote/firebase_metadata_provider.cc; sourceTree = ""; }; + CFA5EB10BD9E4552ECAFEBB2189AD2C2 /* dynamic_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dynamic_annotations.h; path = src/core/lib/iomgr/dynamic_annotations.h; sourceTree = ""; }; + CFAD76890CF2533FB3EB6411F8611842 /* leveldb-library-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "leveldb-library-prefix.pch"; sourceTree = ""; }; + CFAFB90C55F040EB8BE36A53562024A4 /* alts_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_security_connector.cc; path = src/core/lib/security/security_connector/alts/alts_security_connector.cc; sourceTree = ""; }; + CFB9A6C63751153BC747E55D43B375E3 /* descriptor.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = descriptor.upb.c; path = "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c"; sourceTree = ""; }; + D0068BCA45A5140365FC9EC41498BB74 /* health_check_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = health_check_client.cc; path = src/core/ext/filters/client_channel/health/health_check_client.cc; sourceTree = ""; }; + D02274CABF9691BE25B3701E08592D57 /* secure_random_arc4random.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_random_arc4random.cc; path = Firestore/core/src/util/secure_random_arc4random.cc; sourceTree = ""; }; + D04606BC88251771AD750CFAD3476CD6 /* document.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document.nanopb.cc; path = Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc; sourceTree = ""; }; + D062DE1EF6A244B83C34527A3F6E1B8F /* timer_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timer_custom.h; path = src/core/lib/iomgr/timer_custom.h; sourceTree = ""; }; + D089363314634F4CE0918ABB0AD2197B /* FBLPromise+Await.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Await.h"; path = "Sources/FBLPromises/include/FBLPromise+Await.h"; sourceTree = ""; }; + D08A7E6F91DB7B01CF0FEAEE5AD4DDBB /* ec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ec.h; path = src/include/openssl/ec.h; sourceTree = ""; }; + D0B0558C216DF889DD5871BF99B38DC0 /* byte_buffer_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = byte_buffer_cc.cc; path = src/cpp/util/byte_buffer_cc.cc; sourceTree = ""; }; + D11EBFFA09C9F4CDF0C75D36AD135ED1 /* x509_req.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_req.c; path = src/crypto/x509/x509_req.c; sourceTree = ""; }; + D12C858DC3D97B674C7B817D39A7ABA3 /* FIRFirestoreErrors.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFirestoreErrors.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.h; sourceTree = ""; }; + D13B2E5B609C5B5BFBD8010D760DFE5D /* xds.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds.h; path = src/core/ext/filters/client_channel/lb_policy/xds/xds.h; sourceTree = ""; }; + D14D669FA9F70C2AC3B78DA3D6322BEC /* low_level_alloc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = low_level_alloc.h; path = absl/base/internal/low_level_alloc.h; sourceTree = ""; }; + D152C0DC7DF8C5DB5241ECF7D290B257 /* handshake_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handshake_client.cc; path = src/ssl/handshake_client.cc; sourceTree = ""; }; + D159D65B8AF7CC63ECB358FFF5AEC2B8 /* iomgr_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_posix.cc; path = src/core/lib/iomgr/iomgr_posix.cc; sourceTree = ""; }; + D159E2C7037265BFA975BA6B8CE85CBC /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/chacha/internal.h; sourceTree = ""; }; + D16EF3C7A3BD592538B774DCF57A8809 /* validate.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = validate.upb.c; path = "src/core/ext/upb-generated/validate/validate.upb.c"; sourceTree = ""; }; + D175E244220CBE3EDA640388DBDCA2CF /* GDTCORRegistrar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORRegistrar.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h; sourceTree = ""; }; + D18D87A1DA3DB8521F4839C5D55DF080 /* client_channel_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel_factory.h; path = src/core/ext/filters/client_channel/client_channel_factory.h; sourceTree = ""; }; + D193F3BE2E8E8EFAC3608999076B70CA /* cpu-ppc64le.c */ = {isa = PBXFileReference; includeInIndex = 1; name = "cpu-ppc64le.c"; path = "src/crypto/cpu-ppc64le.c"; sourceTree = ""; }; + D1C06AFBB8E1E289E81583A7A7D7A627 /* unaligned_access.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = unaligned_access.h; path = absl/base/internal/unaligned_access.h; sourceTree = ""; }; + D1C641E80759BADEC2646F8FC15CB346 /* tls_gcc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_gcc.h; path = src/core/lib/gpr/tls_gcc.h; sourceTree = ""; }; + D1E0A100FC0CD0A46CD7AB8EC4409FED /* log_severity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_severity.cc; path = absl/base/log_severity.cc; sourceTree = ""; }; + D1EBFEEA08404A41677D3698370627F2 /* memory_persistence.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_persistence.cc; path = Firestore/core/src/local/memory_persistence.cc; sourceTree = ""; }; + D1EF4642D948D1C40F1F27641F9E7E37 /* p256.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p256.c; path = src/third_party/fiat/p256.c; sourceTree = ""; }; + D1EFD9D26DDB7103E060EAD00F7CEC22 /* sync_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_custom.h; path = include/grpc/impl/codegen/sync_custom.h; sourceTree = ""; }; + D200A2FA9E31C8BE63F72E2DEE095156 /* p_ed25519.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_ed25519.c; path = src/crypto/evp/p_ed25519.c; sourceTree = ""; }; + D20779E8474DFE298660E2C93AA82839 /* upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = upb.c; path = third_party/upb/upb/upb.c; sourceTree = ""; }; + D216EA4523D5DEAE1AD0EEFB7D99689B /* v3_purp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_purp.c; path = src/crypto/x509v3/v3_purp.c; sourceTree = ""; }; + D2236B991AD1D74EDD3775EC6A52E15C /* user_data.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = user_data.cc; path = Firestore/core/src/core/user_data.cc; sourceTree = ""; }; + D23242036D231157154F210870401E3E /* parse_address.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = parse_address.cc; path = src/core/ext/filters/client_channel/parse_address.cc; sourceTree = ""; }; + D25FA8EB0B342841E0C22257E2936BBD /* client_interceptor.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_interceptor.cc; path = src/cpp/client/client_interceptor.cc; sourceTree = ""; }; + D27AE3FF2855764C3712CB4D06D4752D /* vpm_int.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = vpm_int.h; path = src/crypto/x509/vpm_int.h; sourceTree = ""; }; + D2BEEF4FD18F0E39C9A0892573CB698E /* frame_rst_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_rst_stream.h; path = src/core/ext/transport/chttp2/transport/frame_rst_stream.h; sourceTree = ""; }; + D2C90CEB8CA3058F7F5EC2F0968CD808 /* tcp_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_posix.cc; path = src/core/lib/iomgr/tcp_posix.cc; sourceTree = ""; }; + D2E064930E744AB4F123EAAA3A009D4F /* resolver_registry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver_registry.h; path = src/core/ext/filters/client_channel/resolver_registry.h; sourceTree = ""; }; + D2E5CA8009634153869F0DEE328F4657 /* alts_grpc_integrity_only_record_protocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_grpc_integrity_only_record_protocol.h; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h; sourceTree = ""; }; + D33E14FBFFF2D8733E45613FBD7B4336 /* GULKeychainStorage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULKeychainStorage.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULKeychainStorage.h; sourceTree = ""; }; + D350394F4E41E95D5B38E70E61A66088 /* completion_queue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue.h; path = src/core/lib/surface/completion_queue.h; sourceTree = ""; }; + D35568987CB22CF82E321EAE0BC6A752 /* ssl_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_credentials.cc; path = src/core/lib/security/credentials/ssl/ssl_credentials.cc; sourceTree = ""; }; + D3A883C23B120624F2B440E7EC31025E /* call_test_only.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_test_only.h; path = src/core/lib/surface/call_test_only.h; sourceTree = ""; }; + D3CB08C929B497B45F5ABAE870F7D4A1 /* timestamp.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timestamp.upb.h; path = "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h"; sourceTree = ""; }; + D3F9A84A6A27BF8FFEE704209E95F1F8 /* env.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = env.cc; path = util/env.cc; sourceTree = ""; }; + D40B576B9738E3339371CADBFBA9011E /* FIRFieldPath.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRFieldPath.mm; path = Firestore/Source/API/FIRFieldPath.mm; sourceTree = ""; }; + D41AD06745CA4B7E6E407B804C4B6F54 /* secure_create_auth_context.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_create_auth_context.cc; path = src/cpp/common/secure_create_auth_context.cc; sourceTree = ""; }; + D41CFF0716D31BD2ABEC6258B737A37C /* frame_window_update.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_window_update.cc; path = src/core/ext/transport/chttp2/transport/frame_window_update.cc; sourceTree = ""; }; + D427F01390693996D900AA7735DF54DE /* notification.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = notification.h; path = absl/synchronization/notification.h; sourceTree = ""; }; + D452A8A5ECDB46D31F082F2462A97C24 /* delete_mutation.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = delete_mutation.cc; path = Firestore/core/src/model/delete_mutation.cc; sourceTree = ""; }; + D45830430241957B9CEB417B5F6DD151 /* charconv.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = charconv.h; path = absl/strings/charconv.h; sourceTree = ""; }; + D4905D6B3410A18BBF26BF84188C4329 /* container_memory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = container_memory.h; path = absl/container/internal/container_memory.h; sourceTree = ""; }; + D49C703E504A3D58320C1A833ABBB8B9 /* tcp_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_custom.h; path = src/core/lib/iomgr/tcp_custom.h; sourceTree = ""; }; + D4EE741B74BE076658425875860FA9F4 /* a_object.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_object.c; path = src/crypto/asn1/a_object.c; sourceTree = ""; }; + D502CDC0DFFBDC46C6A8B6E7B80B36B2 /* Pods-SaraAttended */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-SaraAttended"; path = Pods_SaraAttended.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D51158DEA1DC70A7141E4DA7BB36FF1C /* grpclb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h; sourceTree = ""; }; + D5119B025539C487983DF46575884379 /* channel_args.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_args.cc; path = src/core/lib/channel/channel_args.cc; sourceTree = ""; }; + D52349A8F7412AEC80B53A04E79BCD52 /* GDTCORTargets.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORTargets.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h; sourceTree = ""; }; + D52A4A005D866346A987BA9AB8FB690D /* table.int.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = table.int.h; path = third_party/upb/upb/table.int.h; sourceTree = ""; }; + D55A21B8612C3744B9FF79B123CBB6FA /* compression.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = compression.cc; path = src/core/lib/compression/compression.cc; sourceTree = ""; }; + D582928E748E3172B559F84ABAC5F1AB /* ev_epollex_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_epollex_linux.h; path = src/core/lib/iomgr/ev_epollex_linux.h; sourceTree = ""; }; + D5837A27CC19F7F275466C2AE31E8069 /* ssl_file.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_file.cc; path = src/ssl/ssl_file.cc; sourceTree = ""; }; + D594189E2BF6247FB7E86C7671B2BEBC /* opensslv.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = opensslv.h; path = src/include/openssl/opensslv.h; sourceTree = ""; }; + D59A0B9DB2BF57DE8FB0F91247D3FEC1 /* global_subchannel_pool.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = global_subchannel_pool.cc; path = src/core/ext/filters/client_channel/global_subchannel_pool.cc; sourceTree = ""; }; + D5A6297FA57E7163544C32FD8852C6B3 /* upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = upb.h; path = third_party/upb/upb/upb.h; sourceTree = ""; }; + D5BC0AC5B88EA0B67C4E1179A9AE9542 /* httpcli.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = httpcli.h; path = src/core/lib/http/httpcli.h; sourceTree = ""; }; + D5CCEC4ECBC30052D1BDDAA5FAA0D2C4 /* spinlock_win32.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock_win32.inc; path = absl/base/internal/spinlock_win32.inc; sourceTree = ""; }; + D5D3E02C653B695422153E0F588F2A3A /* FIRTimestamp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRTimestamp.h; path = Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h; sourceTree = ""; }; + D5D64F2A0790105676B48B1D27A00ACD /* a_bitstr.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_bitstr.c; path = src/crypto/asn1/a_bitstr.c; sourceTree = ""; }; + D611A40F8B6A2EF6FE12FC444F22469B /* channel_trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_trace.h; path = src/core/lib/channel/channel_trace.h; sourceTree = ""; }; + D623F8E0554C2BB582285E8E379C0EDF /* FIRLogger.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRLogger.m; path = FirebaseCore/Sources/FIRLogger.m; sourceTree = ""; }; + D63AEB66196C962BE4053CD2855D122A /* GDTCORLifecycle.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCORLifecycle.m; path = GoogleDataTransport/GDTCORLibrary/GDTCORLifecycle.m; sourceTree = ""; }; + D64598FEF74F6080B3AF85464C906927 /* city.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = city.h; path = absl/hash/internal/city.h; sourceTree = ""; }; + D6463500ED181ABC5E4A63EACE23447A /* x509_trs.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_trs.c; path = src/crypto/x509/x509_trs.c; sourceTree = ""; }; + D66DB317CC4C4F2F6AE85A0942F38184 /* digest.c */ = {isa = PBXFileReference; includeInIndex = 1; name = digest.c; path = src/crypto/fipsmodule/digest/digest.c; sourceTree = ""; }; + D68E02F4EA431301782785D1E57DC3E8 /* filter_policy.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = filter_policy.cc; path = util/filter_policy.cc; sourceTree = ""; }; + D6A514080E058250E5A53F49CDD116CD /* alts_handshaker_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_handshaker_client.cc; path = src/core/tsi/alts/handshaker/alts_handshaker_client.cc; sourceTree = ""; }; + D6A5855B0528D0A21B543310647FC369 /* stream_compression_gzip.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression_gzip.h; path = src/core/lib/compression/stream_compression_gzip.h; sourceTree = ""; }; + D6EF0BB4DA976434B6D51415B2012DC2 /* asn1_mac.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = asn1_mac.h; path = src/include/openssl/asn1_mac.h; sourceTree = ""; }; + D6F4C064A3488B846AECA0EFD4E63363 /* workaround_cronet_compression_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = workaround_cronet_compression_filter.h; path = src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h; sourceTree = ""; }; + D71F48199E579FC9CBE6062B7E093227 /* frame_rst_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame_rst_stream.h; path = src/core/ext/transport/chttp2/transport/frame_rst_stream.h; sourceTree = ""; }; + D74150405DBF0D26F917BC578291DCF1 /* client_channel.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_channel.cc; path = src/core/ext/filters/client_channel/client_channel.cc; sourceTree = ""; }; + D76149D5B3D2748BD77035C8553FB63A /* config_source.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = config_source.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c"; sourceTree = ""; }; + D77AA049CC87EB804FA5BD66030A1CA5 /* tzfile.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tzfile.h; path = absl/time/internal/cctz/src/tzfile.h; sourceTree = ""; }; + D7E2556CD95D3FE708E3FC27604B2746 /* simple.c */ = {isa = PBXFileReference; includeInIndex = 1; name = simple.c; path = src/crypto/fipsmodule/ec/simple.c; sourceTree = ""; }; + D7E7BD393DDAC9ADEA8450A07D2877DD /* xds_client.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_client.h; path = src/core/ext/filters/client_channel/xds/xds_client.h; sourceTree = ""; }; + D7EF5070003F64714A164D4FD8259C26 /* aes_gcm.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = aes_gcm.cc; path = src/core/tsi/alts/crypt/aes_gcm.cc; sourceTree = ""; }; + D7F0AC7CEA7D6480EF1F50134E8EC420 /* load_file.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = load_file.cc; path = src/core/lib/iomgr/load_file.cc; sourceTree = ""; }; + D7F0EFA07241EDB7C86BBE9C0994F124 /* env.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = env.h; path = src/core/lib/gpr/env.h; sourceTree = ""; }; + D806117EF85F98336E70753B24DF7E84 /* server_initializer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_initializer.h; path = include/grpcpp/impl/server_initializer.h; sourceTree = ""; }; + D85289894E8862DBDB54E67174956DFB /* ec.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ec.c; path = src/crypto/fipsmodule/ec/ec.c; sourceTree = ""; }; + D854607912E6D3CB08D767985CA1A442 /* channel_arguments.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_arguments.cc; path = src/cpp/common/channel_arguments.cc; sourceTree = ""; }; + D86AF0433110A71F87D564547D2A1C44 /* algorithm_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = algorithm_metadata.h; path = src/core/lib/compression/algorithm_metadata.h; sourceTree = ""; }; + D86FBD5BDD257F3C8038BB216C9388EA /* curve25519.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = curve25519.h; path = src/include/openssl/curve25519.h; sourceTree = ""; }; + D880CF6F56DD4727366742B101439716 /* d1_both.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = d1_both.cc; path = src/ssl/d1_both.cc; sourceTree = ""; }; + D8AC7E83731928232AE65C64254BC997 /* log.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log.h; path = include/grpc/impl/codegen/log.h; sourceTree = ""; }; + D8C942792EEFE63287C868126C41DF44 /* deadline_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = deadline_filter.cc; path = src/core/ext/filters/deadline/deadline_filter.cc; sourceTree = ""; }; + D8CB6409C7D345E216597170BB01A5AA /* pb_encode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_encode.h; sourceTree = ""; }; + D8CEBD833D04172DEE7C52ECEC2DBAF0 /* murmur_hash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = murmur_hash.h; path = src/core/lib/gpr/murmur_hash.h; sourceTree = ""; }; + D8D13B6B6A0E82411728078AC4F21571 /* macros.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = macros.h; path = absl/base/macros.h; sourceTree = ""; }; + D8F792CB523ADA9CAAC0E2139870BA7A /* converters.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = converters.mm; path = Firestore/Source/API/converters.mm; sourceTree = ""; }; + D902EC8F9894DB24CAF3257297A29E22 /* GoogleDataTransport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GoogleDataTransport.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GoogleDataTransport.h; sourceTree = ""; }; + D92626F4FC960755F6FB8693856C3BF1 /* a_strex.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_strex.c; path = src/crypto/x509/a_strex.c; sourceTree = ""; }; + D94C417F36AE5BEDB01A94A81DC23DF8 /* FIRLoadBundleTask.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLoadBundleTask.h; path = Firestore/Source/Public/FirebaseFirestore/FIRLoadBundleTask.h; sourceTree = ""; }; + D9640BAB2CE5E08CA68F04E245F0C7F0 /* env_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = env_windows.cc; path = src/core/lib/gpr/env_windows.cc; sourceTree = ""; }; + D98715D72C5137C628810E8610CF3585 /* http2_settings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http2_settings.h; path = src/core/ext/transport/chttp2/transport/http2_settings.h; sourceTree = ""; }; + D991A77A4FAA05504D10738C573806E3 /* parser.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = parser.cc; path = absl/strings/internal/str_format/parser.cc; sourceTree = ""; }; + D9965082750007B191BFFE9F31B16108 /* FIRFirestore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFirestore.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h; sourceTree = ""; }; + D996893AD45476D78C31A7A4C5D01978 /* auth_token.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = auth_token.cc; path = Firestore/core/src/credentials/auth_token.cc; sourceTree = ""; }; + D99D47646D47CE546DF15348736C4E82 /* server_context_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_context_impl.h; path = include/grpcpp/impl/codegen/server_context_impl.h; sourceTree = ""; }; + D9B6FE7617E920F054E9D6A3F426B1E3 /* kernel_timeout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = kernel_timeout.h; path = absl/synchronization/internal/kernel_timeout.h; sourceTree = ""; }; + D9BF85B1AA5E6DC22635795555EDFC90 /* health.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = health.upb.c; path = "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c"; sourceTree = ""; }; + D9C6A04D472A4D24C7D78EE9F581CE8C /* obj_mac.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = obj_mac.h; path = src/include/openssl/obj_mac.h; sourceTree = ""; }; + D9DC1435F47B6AC7EA42DCCCE81E9470 /* GDTCOREvent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDTCOREvent.m; path = GoogleDataTransport/GDTCORLibrary/GDTCOREvent.m; sourceTree = ""; }; + D9E38398FEDEF6BFD1228500AB255FB3 /* db_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = db_impl.h; path = db/db_impl.h; sourceTree = ""; }; + D9FBAE0517C65051B89AE153CFFD5FAC /* base.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = base.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h"; sourceTree = ""; }; + DA3CBF62666DA5577546703BEC34B76D /* error.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = error.h; path = src/core/lib/iomgr/error.h; sourceTree = ""; }; + DA4E9CB337C3571E4A00E47B8DAA971F /* FIRLoggerLevel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLoggerLevel.h; path = FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h; sourceTree = ""; }; + DA57813EC2D1D105BD0FCCDF156303C2 /* health_check_service.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = health_check_service.cc; path = src/cpp/server/health/health_check_service.cc; sourceTree = ""; }; + DA62D6A2A16FF788F79064DE2907302E /* elf_mem_image.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = elf_mem_image.h; path = absl/debugging/internal/elf_mem_image.h; sourceTree = ""; }; + DA68EE17DE7FEE9FD0AC0B1913D624EC /* credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = credentials.cc; path = src/core/lib/security/credentials/credentials.cc; sourceTree = ""; }; + DA7877D68E192DB6D96F7FC562099168 /* FIRLoadBundleTask.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRLoadBundleTask.mm; path = Firestore/Source/API/FIRLoadBundleTask.mm; sourceTree = ""; }; + DA7BC2043F5D30ECC6235DF242F8DD6B /* b64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = b64.h; path = src/core/lib/slice/b64.h; sourceTree = ""; }; + DA7CC048BEE5432B20FEC4E3308BEEC4 /* grpc_security_constants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_security_constants.h; path = include/grpc/grpc_security_constants.h; sourceTree = ""; }; + DA9B38B02FC04FFF9E9B84E4D3E7C859 /* slice_buffer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice_buffer.h; path = include/grpc/slice_buffer.h; sourceTree = ""; }; + DAC9AFDC2F9DC85EB2C00EF63D809DF7 /* FIRTransaction.mm */ = {isa = PBXFileReference; includeInIndex = 1; name = FIRTransaction.mm; path = Firestore/Source/API/FIRTransaction.mm; sourceTree = ""; }; + DAFAC64AB3B327E9B4C60799600C63C7 /* server_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = server_cc.cc; path = src/cpp/server/server_cc.cc; sourceTree = ""; }; + DB01EEADFD8F4283D79402AFDF7526A8 /* handshaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = handshaker.h; path = src/core/lib/channel/handshaker.h; sourceTree = ""; }; + DB0487AF4DCC51991A674B6146F2B6E9 /* backoff.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backoff.h; path = src/core/lib/backoff/backoff.h; sourceTree = ""; }; + DB098768D6E55818F430EB6C4612D19E /* numbers.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = numbers.cc; path = absl/strings/numbers.cc; sourceTree = ""; }; + DB0CFE7A7ADD0167599DDCCD40326A48 /* exec_ctx.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = exec_ctx.h; path = src/core/lib/iomgr/exec_ctx.h; sourceTree = ""; }; + DB5A85B870F7ACC87F74840D10982450 /* utf8.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = utf8.cc; path = absl/strings/internal/utf8.cc; sourceTree = ""; }; + DB5F4B021E7BC12C31C22C7255A1A674 /* random.c */ = {isa = PBXFileReference; includeInIndex = 1; name = random.c; path = src/crypto/fipsmodule/bn/random.c; sourceTree = ""; }; + DB7AC688268FF9E6BF7121026CC24803 /* query_core.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = query_core.cc; path = Firestore/core/src/api/query_core.cc; sourceTree = ""; }; + DB7CEB9CA802E896C51E550B87E62C31 /* geo_point.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = geo_point.cc; path = Firestore/core/src/geo_point.cc; sourceTree = ""; }; + DB80A2BB852ED1EF4798DC5BCEC10C9E /* credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = credentials.h; path = src/core/lib/security/credentials/credentials.h; sourceTree = ""; }; + DB86A54D31A9A3098C237DA9706417D5 /* ext_dat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ext_dat.h; path = src/crypto/x509v3/ext_dat.h; sourceTree = ""; }; + DBD7AFE202CDCF4E8B889D9F9EB131F0 /* db_iter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = db_iter.h; path = db/db_iter.h; sourceTree = ""; }; + DBEE52BED394D61CA0C646C0C4DE1453 /* ev_poll_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_poll_posix.h; path = src/core/lib/iomgr/ev_poll_posix.h; sourceTree = ""; }; + DBF18FCBC8E01220189F13FD470FE4A3 /* FBLPromise+Await.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Await.m"; path = "Sources/FBLPromises/FBLPromise+Await.m"; sourceTree = ""; }; + DBF76DAC6129166C2DC38CA4C4AFC734 /* c.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = c.cc; path = db/c.cc; sourceTree = ""; }; + DC02B323251C05AE29CD677621010DCA /* BoringSSL-GRPC-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "BoringSSL-GRPC-dummy.m"; sourceTree = ""; }; + DC38E35A4C8A73FD7F3F2376D18987B8 /* cert.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cert.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h"; sourceTree = ""; }; + DC4696E577091CD5D56B195286AA6D4D /* transport_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = transport_impl.h; path = src/core/lib/transport/transport_impl.h; sourceTree = ""; }; + DC4B38404A30E1CAFBB8301529C267E3 /* FIRComponentContainer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponentContainer.h; path = FirebaseCore/Sources/Private/FIRComponentContainer.h; sourceTree = ""; }; + DC6B33792F33E8EB3FC539DE92C0D36D /* FIRComponentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRComponentType.h; path = FirebaseCore/Sources/Private/FIRComponentType.h; sourceTree = ""; }; + DC86DD624BBB8F86536B9BBD05207CA6 /* sync_stream_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_stream_impl.h; path = include/grpcpp/impl/codegen/sync_stream_impl.h; sourceTree = ""; }; + DC90F532DA9136A5AC68A9A55471B52B /* ec_key.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ec_key.c; path = src/crypto/fipsmodule/ec/ec_key.c; sourceTree = ""; }; + DCAD43C85B8298C22ECAFD9BE46C7619 /* local_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = local_security_connector.h; path = src/core/lib/security/security_connector/local/local_security_connector.h; sourceTree = ""; }; + DCBD31BF5E01DD986558450D77094E43 /* stap_timers.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = stap_timers.cc; path = src/core/lib/profiling/stap_timers.cc; sourceTree = ""; }; + DCBF36C85B3DADA0FE9F311F0F97793A /* proto_sizer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = proto_sizer.cc; path = Firestore/core/src/local/proto_sizer.cc; sourceTree = ""; }; + DCF3958E0C5B380C0F1EA053B4DC876C /* grpc_ares_ev_driver_libuv.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_ares_ev_driver_libuv.cc; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc; sourceTree = ""; }; + DD0EAF650079CBA4866283FA3ACAE404 /* err.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = err.h; path = src/include/openssl/err.h; sourceTree = ""; }; + DD2B8AD9B43921BA75454041D5201225 /* local_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_security_connector.cc; path = src/core/lib/security/security_connector/local/local_security_connector.cc; sourceTree = ""; }; + DD41F1702EEAC76E0B5B7262243DE517 /* json.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = json.h; path = src/core/lib/json/json.h; sourceTree = ""; }; + DD7170ED59976060BDD36AF18E08263A /* local_store.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_store.cc; path = Firestore/core/src/local/local_store.cc; sourceTree = ""; }; + DD71B32B40DD93411ED7C8A55A8D6D34 /* PromisesObjC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromisesObjC.release.xcconfig; sourceTree = ""; }; + DDAFD2F28A6BDD6C6DD7B33358B069C4 /* match.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = match.cc; path = absl/strings/match.cc; sourceTree = ""; }; + DDB34E70DE46C0DBFA68657EE8AB1BB5 /* srds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = srds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/srds.upb.h"; sourceTree = ""; }; + DDBA219B26A46DACBC3BBB50C08D0CAF /* throw_delegate.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = throw_delegate.cc; path = absl/base/internal/throw_delegate.cc; sourceTree = ""; }; + DDD44762A45E687EB93D355143E47EA7 /* e_aes.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_aes.c; path = src/crypto/fipsmodule/cipher/e_aes.c; sourceTree = ""; }; + DDEB5E4FE0768AEF991D265861A9C550 /* FBLPromise+All.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+All.h"; path = "Sources/FBLPromises/include/FBLPromise+All.h"; sourceTree = ""; }; + DDFAC152A766E48750F028897C6F6DC2 /* cds.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cds.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h"; sourceTree = ""; }; + DE3910421BE3971CEDA899A59D46974B /* resource_quota.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource_quota.h; path = include/grpcpp/resource_quota.h; sourceTree = ""; }; + DE3E07C607F96BF8E06E006E44C6A2FF /* gethostname_host_name_max.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = gethostname_host_name_max.cc; path = src/core/lib/iomgr/gethostname_host_name_max.cc; sourceTree = ""; }; + DE60217F7EC6CE9C5AFDAE439BAB3BF3 /* mutable_document.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = mutable_document.cc; path = Firestore/core/src/model/mutable_document.cc; sourceTree = ""; }; + DE795E37D113F7626530E15A195367A8 /* frame_data.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = frame_data.cc; path = src/core/ext/transport/chttp2/transport/frame_data.cc; sourceTree = ""; }; + DE8B6B11502CA8ED37E537FADA851DA0 /* credentials_generic.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = credentials_generic.cc; path = src/core/lib/security/credentials/google_default/credentials_generic.cc; sourceTree = ""; }; + DEAD2EE0B4B3E0F82293A5A8E964CBCF /* GULURLSessionDataResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULURLSessionDataResponse.m; path = GoogleUtilities/Environment/URLSessionPromiseWrapper/GULURLSessionDataResponse.m; sourceTree = ""; }; + DEBC07CB023FC32266244E76712EFECD /* status_errno.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = status_errno.cc; path = Firestore/core/src/util/status_errno.cc; sourceTree = ""; }; + DEBF0F3DBAF13B61A17C043E19188AB5 /* grpc_plugin_registry.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = grpc_plugin_registry.cc; path = src/core/plugin_registry/grpc_plugin_registry.cc; sourceTree = ""; }; + DED1C60C95A9B521B0BD4F8EB071DED7 /* extension.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = extension.cc; path = absl/strings/internal/str_format/extension.cc; sourceTree = ""; }; + DEEDEA94AB15B525343CA25364DBC905 /* status_code_enum.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status_code_enum.h; path = include/grpcpp/impl/codegen/status_code_enum.h; sourceTree = ""; }; + DF1AD777D71E91FEF582D0621D7D3DC8 /* testutil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = testutil.h; path = util/testutil.h; sourceTree = ""; }; + DF1CC2F0643A2BA93A0BA41DB9FB2E00 /* thread_none.c */ = {isa = PBXFileReference; includeInIndex = 1; name = thread_none.c; path = src/crypto/thread_none.c; sourceTree = ""; }; + DF3E6B695BB499315B1092C8C3D75F34 /* FirebaseCore-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FirebaseCore-umbrella.h"; sourceTree = ""; }; + DF3E7390BAE77BB00C79037B0A5B5A17 /* load_balancer_api.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = load_balancer_api.cc; path = src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc; sourceTree = ""; }; + DF4B8B07C5FB3D7F560906F99E7C11BD /* client_auth_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_auth_filter.cc; path = src/core/lib/security/transport/client_auth_filter.cc; sourceTree = ""; }; + DF637044AEB06109E9B64B798E173247 /* gRPC-C++.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "gRPC-C++.modulemap"; sourceTree = ""; }; + DF68626A4FE4D88AE160D648CE2CAD3C /* PromisesObjC.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PromisesObjC.modulemap; sourceTree = ""; }; + DF811445B1994FEC29D209515B12871B /* msg.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = msg.h; path = third_party/upb/upb/msg.h; sourceTree = ""; }; + DF9FB01E85F1BB238BFC15F28E9D8967 /* GDTCORClock.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORClock.h; path = GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORClock.h; sourceTree = ""; }; + DFBBF5427F6D287EB64E3B36E5EF6D7D /* timers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = timers.h; path = src/core/lib/profiling/timers.h; sourceTree = ""; }; + DFEF90EAD503C39E0C1FE1AFAF69683A /* jwt_verifier.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = jwt_verifier.h; path = src/core/lib/security/credentials/jwt/jwt_verifier.h; sourceTree = ""; }; + E0202AB9C2BE82FB974F97D991082699 /* transport_security.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transport_security.cc; path = src/core/tsi/transport_security.cc; sourceTree = ""; }; + E021F74765601E55677CEC43369B569D /* sockaddr_utils.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sockaddr_utils.h; path = src/core/lib/iomgr/sockaddr_utils.h; sourceTree = ""; }; + E02D2539BC68BCE4F8E801127350935E /* pkcs8.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pkcs8.h; path = src/include/openssl/pkcs8.h; sourceTree = ""; }; + E04BE206FDAB3DBB396E61E589EDEBF5 /* resolve_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolve_address.h; path = src/core/lib/iomgr/resolve_address.h; sourceTree = ""; }; + E08B3DF21340AB512474B5E6335495BC /* incoming_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = incoming_metadata.cc; path = src/core/ext/transport/chttp2/transport/incoming_metadata.cc; sourceTree = ""; }; + E0A614C75FFADDFB44252D45D892E332 /* atm.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm.h; path = include/grpc/impl/codegen/atm.h; sourceTree = ""; }; + E0AFD7074CAB64C323F60EB099B7CD4E /* thd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thd.h; path = src/core/lib/gprpp/thd.h; sourceTree = ""; }; + E0D14C0FF8B1CC0F2E3D6B0F61D360B3 /* tcp_client_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_client_posix.cc; path = src/core/lib/iomgr/tcp_client_posix.cc; sourceTree = ""; }; + E0D32F565C9F2C24D6E6035EB3F967F5 /* pem_all.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_all.c; path = src/crypto/pem/pem_all.c; sourceTree = ""; }; + E0D4564FBA5A59532E2A16562FFEA7FE /* alts_grpc_privacy_integrity_record_protocol.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_grpc_privacy_integrity_record_protocol.cc; path = src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc; sourceTree = ""; }; + E10BAA4C2777BE15FB6BA268E429706B /* global_config_generic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = global_config_generic.h; path = src/core/lib/gprpp/global_config_generic.h; sourceTree = ""; }; + E11CB86FB2859C267DA28A96133B576E /* jwt_verifier.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = jwt_verifier.cc; path = src/core/lib/security/credentials/jwt/jwt_verifier.cc; sourceTree = ""; }; + E11EC83D2D3AE097D3EE61259903A3D2 /* route.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = route.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/route.upb.c"; sourceTree = ""; }; + E15CF7FDB27C66EFBE8FE47724E53215 /* ec_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ec_asn1.c; path = src/crypto/ec_extra/ec_asn1.c; sourceTree = ""; }; + E15F527EEACB19EE41A26F8BCF3B018E /* tcp_windows.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tcp_windows.h; path = src/core/lib/iomgr/tcp_windows.h; sourceTree = ""; }; + E197518A8B25A3D9600C9AC2028D695C /* x509_att.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_att.c; path = src/crypto/x509/x509_att.c; sourceTree = ""; }; + E1A21D662F502F91EBB1BD7C4C412ECD /* udp_server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = udp_server.h; path = src/core/lib/iomgr/udp_server.h; sourceTree = ""; }; + E1B336B7E76A9047F6A3846EE8379626 /* local_documents_view.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = local_documents_view.cc; path = Firestore/core/src/local/local_documents_view.cc; sourceTree = ""; }; + E1BCF54E235E2B907E9A37FC7B860F4F /* pem_xaux.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pem_xaux.c; path = src/crypto/pem/pem_xaux.c; sourceTree = ""; }; + E1C12A97E173016FDB1AB399B0574C41 /* metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata.h; path = src/core/lib/transport/metadata.h; sourceTree = ""; }; + E1DAC88BD8364EF5E2F3DBB770861BC6 /* spinlock.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = spinlock.cc; path = absl/base/internal/spinlock.cc; sourceTree = ""; }; + E1DC3AACCD82428A7231829D9743D299 /* wrap_memcpy.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = wrap_memcpy.cc; path = src/core/lib/gpr/wrap_memcpy.cc; sourceTree = ""; }; + E2309ACF4E98F5608C035A4FD328AFA2 /* poly1305_vec.c */ = {isa = PBXFileReference; includeInIndex = 1; name = poly1305_vec.c; path = src/crypto/poly1305/poly1305_vec.c; sourceTree = ""; }; + E23BBB6D4C3974CEC17F6B23291C1C51 /* GULHeartbeatDateStorage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULHeartbeatDateStorage.h; path = GoogleUtilities/Environment/Public/GoogleUtilities/GULHeartbeatDateStorage.h; sourceTree = ""; }; + E2462D8D4CE7B98A40B00938E441AC3D /* pick_first.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pick_first.cc; path = src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc; sourceTree = ""; }; + E24E434379208E1B1C3A3F2381668A57 /* key_field_not_in_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = key_field_not_in_filter.cc; path = Firestore/core/src/core/key_field_not_in_filter.cc; sourceTree = ""; }; + E264DE7C30F286F5752702492B068487 /* tls_security_connector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_security_connector.cc; path = src/core/lib/security/security_connector/tls/tls_security_connector.cc; sourceTree = ""; }; + E282F6D408EB0F0B513645CDE871D69A /* google_default_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = google_default_credentials.cc; path = src/core/lib/security/credentials/google_default/google_default_credentials.cc; sourceTree = ""; }; + E2836E8E06B07FFD41230B3CE181EF44 /* dtls1.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dtls1.h; path = src/include/openssl/dtls1.h; sourceTree = ""; }; + E286F7F35966B90C4AB25A4AF4E221BD /* handshake_server.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handshake_server.cc; path = src/ssl/handshake_server.cc; sourceTree = ""; }; + E29D3A11FCE715E06A78E2168353C130 /* is_boringssl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = is_boringssl.h; path = src/include/openssl/is_boringssl.h; sourceTree = ""; }; + E2B63D462DB7F827C4B11FD51E4F8E2D /* FirebaseCore */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FirebaseCore; path = FirebaseCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E2C8DBB1C38D5A3E34F7BEF975CA2E2B /* document_change.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_change.cc; path = Firestore/core/src/api/document_change.cc; sourceTree = ""; }; + E2D650C523EEA29DAF171DEC4D83B300 /* merger.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = merger.cc; path = table/merger.cc; sourceTree = ""; }; + E2D944E6CD95C567660E31CC2C797A3F /* server_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_posix.h; path = include/grpcpp/server_posix.h; sourceTree = ""; }; + E2E29F23DDF6AF6D901812E7136A68AC /* timer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer.cc; path = src/core/lib/iomgr/timer.cc; sourceTree = ""; }; + E2F3610D3B40489699AC20C069E6D56B /* gcd_extra.c */ = {isa = PBXFileReference; includeInIndex = 1; name = gcd_extra.c; path = src/crypto/fipsmodule/bn/gcd_extra.c; sourceTree = ""; }; + E2F4960E27D7001F66FB146918ACB20A /* sync_stream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_stream.h; path = include/grpcpp/impl/codegen/sync_stream.h; sourceTree = ""; }; + E33E6DEDB8882D897B8A95E3A192A148 /* transaction_runner.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = transaction_runner.cc; path = Firestore/core/src/core/transaction_runner.cc; sourceTree = ""; }; + E36E31D6EAB2B8AABDAD98B7179BC73A /* port.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = port.h; path = src/core/lib/iomgr/port.h; sourceTree = ""; }; + E37EC012998CA28B611BAFCCBE9FC28D /* bind.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bind.h; path = absl/strings/internal/str_format/bind.h; sourceTree = ""; }; + E3805AFA476B3217C1F1BF3D044E927A /* pem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = pem.h; path = src/include/openssl/pem.h; sourceTree = ""; }; + E38F8F3CAA0B133C6DD9D6B7D4D632AA /* validate.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = validate.upb.h; path = "src/core/ext/upb-generated/validate/validate.upb.h"; sourceTree = ""; }; + E39297772AD13E7BC8092FD5912A045F /* evp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = evp.c; path = src/crypto/evp/evp.c; sourceTree = ""; }; + E396080735EF6DBEBC78DF1530D6010B /* grpclb_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpclb_channel.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h; sourceTree = ""; }; + E39896542BE44F8AB97D331C8265BCF7 /* resolve_address_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = resolve_address_windows.cc; path = src/core/lib/iomgr/resolve_address_windows.cc; sourceTree = ""; }; + E3B8ABDAC044FF0BCE343A472CE5A753 /* grpc_shadow_boringssl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_shadow_boringssl.h; path = src/core/tsi/grpc_shadow_boringssl.h; sourceTree = ""; }; + E3CAFBE093EF332BAEE26FD8CFAD2AE3 /* table.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = table.cc; path = table/table.cc; sourceTree = ""; }; + E3DAFF6DE90508C9BDC6062F431B74D9 /* auth_context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = auth_context.h; path = include/grpcpp/impl/codegen/security/auth_context.h; sourceTree = ""; }; + E40F11003B87EA1D8D03A37CB3A53038 /* target_id_generator.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = target_id_generator.cc; path = Firestore/core/src/core/target_id_generator.cc; sourceTree = ""; }; + E44F2ED4D0FCA1EDB6654DC189D58C92 /* gogo.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = gogo.upb.c; path = "src/core/ext/upb-generated/gogoproto/gogo.upb.c"; sourceTree = ""; }; + E47323FE190B0C24EBEBC7834B45B3E9 /* reader.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = reader.cc; path = Firestore/core/src/nanopb/reader.cc; sourceTree = ""; }; + E49189552843572545B0263578F0A98A /* channel_init.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channel_init.h; path = src/core/lib/surface/channel_init.h; sourceTree = ""; }; + E4B09FCFA689324A0375DD7616F471F3 /* round_robin.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = round_robin.cc; path = src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc; sourceTree = ""; }; + E4B37E0CF180870E481A1720691A8F3F /* hmac.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hmac.h; path = src/include/openssl/hmac.h; sourceTree = ""; }; + E525708B637223AE22E830FE9836A5ED /* Pods-SaraAttended.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SaraAttended.debug.xcconfig"; sourceTree = ""; }; + E529C5C7EE13336B343F49BB289452D1 /* frame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = frame.h; path = src/core/ext/transport/chttp2/transport/frame.h; sourceTree = ""; }; + E52E34E0DCE9C7D5FC1DB65A3342BEE8 /* a_i2d_fp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_i2d_fp.c; path = src/crypto/asn1/a_i2d_fp.c; sourceTree = ""; }; + E57016635083DC208B90EC4B2983319D /* bin_encoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bin_encoder.h; path = src/core/ext/transport/chttp2/transport/bin_encoder.h; sourceTree = ""; }; + E590D2875C3BC56D26EAF797BC85AD88 /* eventmanager_libuv.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = eventmanager_libuv.h; path = src/core/lib/iomgr/poller/eventmanager_libuv.h; sourceTree = ""; }; + E59707D59AE75973A10A4FEB4B5EE371 /* a_enum.c */ = {isa = PBXFileReference; includeInIndex = 1; name = a_enum.c; path = src/crypto/asn1/a_enum.c; sourceTree = ""; }; + E5B869C89802921B22497BEF5788A0BE /* create_channel_posix.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = create_channel_posix.h; path = include/grpcpp/create_channel_posix.h; sourceTree = ""; }; + E5C24F3890C4CE6C36359EFEE0F6EB41 /* rpc_service_method.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rpc_service_method.h; path = include/grpcpp/impl/rpc_service_method.h; sourceTree = ""; }; + E5D9C9C8C7D2D1FC075A8681CD1A76DB /* xds_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_channel.h; path = src/core/ext/filters/client_channel/xds/xds_channel.h; sourceTree = ""; }; + E60B72EF39955A076FC093D4B48EA276 /* accesslog.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = accesslog.upb.h; path = "src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h"; sourceTree = ""; }; + E611580D32E35681680743D0C3390B3F /* table.int.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = table.int.h; path = third_party/upb/upb/table.int.h; sourceTree = ""; }; + E6368A41EF6D4F9F45FB7E08D37312FE /* channelz.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = channelz.h; path = src/core/lib/channel/channelz.h; sourceTree = ""; }; + E66A5423448C896D6AFCFD5C09748865 /* e_rc2.c */ = {isa = PBXFileReference; includeInIndex = 1; name = e_rc2.c; path = src/crypto/cipher_extra/e_rc2.c; sourceTree = ""; }; + E69164375A0446840DC6CE7CC664846F /* http_client_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_client_filter.h; path = src/core/ext/filters/http/client/http_client_filter.h; sourceTree = ""; }; + E695FD7B79E5C893CA67FDBADFF65588 /* rsaz_exp.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsaz_exp.c; path = src/crypto/fipsmodule/bn/rsaz_exp.c; sourceTree = ""; }; + E6B18A381307DB711369991B38B1CB66 /* FIRComponentType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRComponentType.m; path = FirebaseCore/Sources/FIRComponentType.m; sourceTree = ""; }; + E6C88DEC6DE3D2A3B1C8889940473042 /* connect.c */ = {isa = PBXFileReference; includeInIndex = 1; name = connect.c; path = src/crypto/bio/connect.c; sourceTree = ""; }; + E6DDAF89CCCBB25AB51D51CF88D98A29 /* sync_engine.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sync_engine.cc; path = Firestore/core/src/core/sync_engine.cc; sourceTree = ""; }; + E6FE678653823AFA359C6EFE7CACB4F7 /* load_file.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_file.h; path = src/core/lib/iomgr/load_file.h; sourceTree = ""; }; + E72B56008D3132A59FA1190FE8B413D1 /* dynamic_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dynamic_annotations.h; path = src/core/lib/iomgr/dynamic_annotations.h; sourceTree = ""; }; + E72F4419733B8C21D797E9E594B8A977 /* google_default_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = google_default_credentials.h; path = src/core/lib/security/credentials/google_default/google_default_credentials.h; sourceTree = ""; }; + E741729D5D64FB7C626170E7F325544E /* windows.c */ = {isa = PBXFileReference; includeInIndex = 1; name = windows.c; path = src/crypto/rand_extra/windows.c; sourceTree = ""; }; + E75A1198CC49C1D9DAB88863F0BEC9F7 /* v3_akeya.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_akeya.c; path = src/crypto/x509v3/v3_akeya.c; sourceTree = ""; }; + E75CCA19A437137880D71AC82C0A0331 /* tls13_client.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tls13_client.cc; path = src/ssl/tls13_client.cc; sourceTree = ""; }; + E77D560378F569278A48673B196FC763 /* FIRDiagnosticsData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRDiagnosticsData.h; path = FirebaseCore/Sources/FIRDiagnosticsData.h; sourceTree = ""; }; + E7959196CB1EC295C1D7EFB05C1A62D2 /* atm_gcc_atomic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_gcc_atomic.h; path = include/grpc/impl/codegen/atm_gcc_atomic.h; sourceTree = ""; }; + E821E862169B9C48AE0585E407F38613 /* symbolize_unimplemented.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = symbolize_unimplemented.inc; path = absl/debugging/symbolize_unimplemented.inc; sourceTree = ""; }; + E82C09DE196166D349EACD3D25D1E03F /* p_ed25519_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_ed25519_asn1.c; path = src/crypto/evp/p_ed25519_asn1.c; sourceTree = ""; }; + E83774E452AC21CACDCDF4A75561AE43 /* fake_credentials.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fake_credentials.cc; path = src/core/lib/security/credentials/fake/fake_credentials.cc; sourceTree = ""; }; + E83FE6E67F31928F6E97E0162BBFAA8E /* env_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = env_posix.cc; path = src/core/lib/gpr/env_posix.cc; sourceTree = ""; }; + E859BF67F2B48F487375961E73FB867A /* http_proxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_proxy.h; path = src/core/ext/filters/client_channel/http_proxy.h; sourceTree = ""; }; + E87DFED2DA30CBDB5B3ECC57C280B7D0 /* tls_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_credentials.h; path = src/core/lib/security/credentials/tls/tls_credentials.h; sourceTree = ""; }; + E88AC67415B807A3F70ADA80C12F5C9E /* stream_map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_map.h; path = src/core/ext/transport/chttp2/transport/stream_map.h; sourceTree = ""; }; + E89C5F4718BD12CDB155016FF56F7DCA /* circuit_breaker.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = circuit_breaker.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h"; sourceTree = ""; }; + E8AA7A1C7046681F7457AA1745BE2749 /* resource.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = resource.upb.c; path = "src/core/ext/upb-generated/envoy/annotations/resource.upb.c"; sourceTree = ""; }; + E8CD1879AB4564BF8AC4F8C9DB056B8A /* demangle.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = demangle.cc; path = absl/debugging/internal/demangle.cc; sourceTree = ""; }; + E8E06741A68C2304AE4184D5A7B4438C /* snapshot_metadata.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = snapshot_metadata.cc; path = Firestore/core/src/api/snapshot_metadata.cc; sourceTree = ""; }; + E92BCBCD2EC5118CB4748145324C6145 /* thd_id.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thd_id.h; path = include/grpc/support/thd_id.h; sourceTree = ""; }; + E94733C68F02C4AD46CEC1A93576EF61 /* stacktrace_win32-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_win32-inl.inc"; path = "absl/debugging/internal/stacktrace_win32-inl.inc"; sourceTree = ""; }; + E9862CEE92E648371F72C157A5674BC1 /* closure.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = closure.h; path = src/core/lib/iomgr/closure.h; sourceTree = ""; }; + E9B99011D6EC62F17055B52AB47834C7 /* thread_identity.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = thread_identity.cc; path = absl/base/internal/thread_identity.cc; sourceTree = ""; }; + E9D1E79459145589F28007C94E9EB274 /* iomgr_internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iomgr_internal.h; path = src/core/lib/iomgr/iomgr_internal.h; sourceTree = ""; }; + EA2BB2CFA51B1AA7EAC1F4957188EBA0 /* p_ec_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = p_ec_asn1.c; path = src/crypto/evp/p_ec_asn1.c; sourceTree = ""; }; + EA5D594CBBD6AE3388627A89640D5A92 /* optimization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = optimization.h; path = absl/base/optimization.h; sourceTree = ""; }; + EA85FCB13A933AE95ACA4A0D34ABD62D /* load_balancer_api.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_balancer_api.h; path = src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h; sourceTree = ""; }; + EAAB62C6FD33409AD7699DB614014C4B /* default_health_check_service.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = default_health_check_service.cc; path = src/cpp/server/health/default_health_check_service.cc; sourceTree = ""; }; + EABE052D4B7270F09C17282EAFB486BF /* tls_cbc.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tls_cbc.c; path = src/crypto/cipher_extra/tls_cbc.c; sourceTree = ""; }; + EAC15DDD03A481ED76F0B1C19121212B /* precondition.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = precondition.cc; path = Firestore/core/src/model/precondition.cc; sourceTree = ""; }; + EAD0B8E22BB13B12D4918CD79749CB4A /* watch_stream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = watch_stream.cc; path = Firestore/core/src/remote/watch_stream.cc; sourceTree = ""; }; + EAE79CCAF1AE912E1C941255BBE29708 /* config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = config.h; path = include/grpcpp/support/config.h; sourceTree = ""; }; + EAF81A6A3D2B449128E7B49128E989E6 /* get_current_time_chrono.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = get_current_time_chrono.inc; path = absl/time/internal/get_current_time_chrono.inc; sourceTree = ""; }; + EB148691BC2F24E1B936AA61EC8B3DCB /* channel_init.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_init.cc; path = src/core/lib/surface/channel_init.cc; sourceTree = ""; }; + EB1A968E222AE20414824C188A1A0FB1 /* client_authority_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = client_authority_filter.cc; path = src/core/ext/filters/http/client_authority_filter.cc; sourceTree = ""; }; + EB2E25A001863A1F0A3AC138047C601C /* lockfree_event.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lockfree_event.h; path = src/core/lib/iomgr/lockfree_event.h; sourceTree = ""; }; + EB454D797281307398578203D87FEAB7 /* custom_tag.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = custom_tag.upb.h; path = "src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h"; sourceTree = ""; }; + EB5255D8AAD1A692C837841211057171 /* tsi_error.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tsi_error.cc; path = src/core/lib/security/transport/tsi_error.cc; sourceTree = ""; }; + EB6FEAA72CAB7E959371C3F7C2DC4CD3 /* timer_heap.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer_heap.cc; path = src/core/lib/iomgr/timer_heap.cc; sourceTree = ""; }; + EB7E916FC12CF5766C7F3D6DC4CC0CB9 /* document_key_reference.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = document_key_reference.cc; path = Firestore/core/src/local/document_key_reference.cc; sourceTree = ""; }; + EB830BFD69D9FBE5363B26BA1BF01565 /* tls_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_credentials.h; path = src/core/lib/security/credentials/tls/tls_credentials.h; sourceTree = ""; }; + EB869D4BFD5457DED0E553A84AD1B85E /* memory_remote_document_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_remote_document_cache.cc; path = Firestore/core/src/local/memory_remote_document_cache.cc; sourceTree = ""; }; + EBCDEE91D7C5C9EE0735903AE801AA77 /* FIRBundleUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRBundleUtil.h; path = FirebaseCore/Sources/FIRBundleUtil.h; sourceTree = ""; }; + EBE55BC5EBBA67AC56DD26829E6EB0E4 /* digestsign.c */ = {isa = PBXFileReference; includeInIndex = 1; name = digestsign.c; path = src/crypto/evp/digestsign.c; sourceTree = ""; }; + EBEA77321C3EE364949EFE1CDB3037A8 /* GDTCORTransformer_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORTransformer_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCORTransformer_Private.h; sourceTree = ""; }; + EBF17CB71417B5B4D8A6ED7BD00FD13F /* health_check.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h"; sourceTree = ""; }; + EBF73FED0C4D64C0CEFCD8D20F5E93FD /* hash.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = hash.cc; path = util/hash.cc; sourceTree = ""; }; + EBFE9E298F6BE2F8EDD6EFA38A31934D /* fake_transport_security.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_transport_security.h; path = src/core/tsi/fake_transport_security.h; sourceTree = ""; }; + EC23E1FF77631092AD8625A0D1DEC048 /* workaround_utils.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = workaround_utils.cc; path = src/core/ext/filters/workarounds/workaround_utils.cc; sourceTree = ""; }; + EC4B5BAEB7765FC73F6F5612C6F1E377 /* x509_obj.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509_obj.c; path = src/crypto/x509/x509_obj.c; sourceTree = ""; }; + EC4FDA499726E5BDCFDFB8A78E250F88 /* charconv_bigint.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = charconv_bigint.cc; path = absl/strings/internal/charconv_bigint.cc; sourceTree = ""; }; + ECA59ED6E17663C92621418F953576A3 /* core_codegen_interface.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = core_codegen_interface.h; path = include/grpcpp/impl/codegen/core_codegen_interface.h; sourceTree = ""; }; + ECC1A74FF0C5A03AA6AF2ECC873090EB /* channel_ping.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_ping.cc; path = src/core/lib/surface/channel_ping.cc; sourceTree = ""; }; + ECC433DC378B7361CECD8969A01BB388 /* tcp_client_cfstream.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = tcp_client_cfstream.cc; path = src/core/lib/iomgr/tcp_client_cfstream.cc; sourceTree = ""; }; + ECC8BB2A7BA8DE1189AF125087AFEF54 /* load_balancer.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_balancer.upb.h; path = "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h"; sourceTree = ""; }; + ECD33F95A7B1C50A9E511A0C8BA399CA /* FIRLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLogger.h; path = FirebaseCore/Sources/Private/FIRLogger.h; sourceTree = ""; }; + ECD705304334C7CACBFD7A8852C3A144 /* alts_seal_privacy_integrity_crypter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_seal_privacy_integrity_crypter.cc; path = src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc; sourceTree = ""; }; + ECDFE3BA3DAEDD1D8996B92A462FF847 /* client_context_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_context_impl.h; path = include/grpcpp/impl/codegen/client_context_impl.h; sourceTree = ""; }; + ED016E10EA5F97BF30488BAC657CF05D /* base.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = base.h; path = src/include/openssl/base.h; sourceTree = ""; }; + ED061D0791AD1C27CF4524F34C298AB0 /* lru_garbage_collector.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = lru_garbage_collector.cc; path = Firestore/core/src/local/lru_garbage_collector.cc; sourceTree = ""; }; + ED30DB9CFB54C848410E0EEDF042FD9E /* unix_sockets_posix_noop.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = unix_sockets_posix_noop.cc; path = src/core/lib/iomgr/unix_sockets_posix_noop.cc; sourceTree = ""; }; + ED30EEF89E3F26907A1A5C85DDF60A81 /* gcm_nohw.c */ = {isa = PBXFileReference; includeInIndex = 1; name = gcm_nohw.c; path = src/crypto/fipsmodule/modes/gcm_nohw.c; sourceTree = ""; }; + ED3475FDAC93B6337A48DB0BDDFEC7B6 /* thread_annotations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = thread_annotations.h; path = absl/base/thread_annotations.h; sourceTree = ""; }; + ED3670E27C2181A13C75EBFE273189C5 /* sync.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = sync.cc; path = src/core/lib/gpr/sync.cc; sourceTree = ""; }; + ED3A1DC6B9FE0788D7C08386FDC324ED /* connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connector.h; path = src/core/ext/filters/client_channel/connector.h; sourceTree = ""; }; + ED537F5536237513019B8F4866FB5EB0 /* status.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = status.upb.c; path = "src/core/ext/upb-generated/google/rpc/status.upb.c"; sourceTree = ""; }; + ED57B4D5C68FD214EC668808F26E7373 /* server_callback_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server_callback_impl.h; path = include/grpcpp/support/server_callback_impl.h; sourceTree = ""; }; + EDF5C2B9E092AC473CE996CC5F92F75A /* annotations.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = annotations.upb.h; path = "src/core/ext/upb-generated/google/api/annotations.upb.h"; sourceTree = ""; }; + EDFD570883F6D2D879064CDBD947045D /* client_channel_factory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_channel_factory.h; path = src/core/ext/filters/client_channel/client_channel_factory.h; sourceTree = ""; }; + EE15F12E75AA3A66DE9DF6E8E4EEC935 /* cpu.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cpu.h; path = include/grpc/support/cpu.h; sourceTree = ""; }; + EE192DB052B79D11AE6E23BB68E44EAE /* bundle.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bundle.nanopb.cc; path = Firestore/Protos/nanopb/firestore/bundle.nanopb.cc; sourceTree = ""; }; + EE1ACE801B4732693EC7AEB4749FBD54 /* client_unary_call.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = client_unary_call.h; path = include/grpcpp/impl/client_unary_call.h; sourceTree = ""; }; + EE4C33B273CD2E96C9BF04694456F0B3 /* timer_generic.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = timer_generic.cc; path = src/core/lib/iomgr/timer_generic.cc; sourceTree = ""; }; + EE4D8F5ED0B55EA104AFE2858B9ABD92 /* default_health_check_service.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = default_health_check_service.h; path = src/cpp/server/health/default_health_check_service.h; sourceTree = ""; }; + EE6A5DDFDD593F8C5874769DED9E7E33 /* alarm_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alarm_impl.h; path = include/grpcpp/alarm_impl.h; sourceTree = ""; }; + EE6DA62E3D3C94FE5C42637D38DB195B /* load_system_roots_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = load_system_roots_linux.h; path = src/core/lib/security/security_connector/load_system_roots_linux.h; sourceTree = ""; }; + EE84E888FEEE2D71B13B1A9E66211639 /* ctrdrbg.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ctrdrbg.c; path = src/crypto/fipsmodule/rand/ctrdrbg.c; sourceTree = ""; }; + EE91BD7A7A5DF7BADF4E5D0ABB121558 /* struct.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = struct.upb.c; path = "src/core/ext/upb-generated/google/protobuf/struct.upb.c"; sourceTree = ""; }; + EEA6677EBD90EEF8BE67C33C69A74973 /* ads.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ads.upb.c; path = "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c"; sourceTree = ""; }; + EEB12961B525825CEE242B485D541413 /* PromisesObjC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromisesObjC.debug.xcconfig; sourceTree = ""; }; + EEB3759F7A0F39B804221B3B53DDA1EB /* resolve_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolve_address.h; path = src/core/lib/iomgr/resolve_address.h; sourceTree = ""; }; + EED52649B8D265AA1260608D8313C339 /* gsec.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = gsec.cc; path = src/core/tsi/alts/crypt/gsec.cc; sourceTree = ""; }; + EEDEAAE34E2DDD91998408BCFE50DB68 /* i2d_pr.c */ = {isa = PBXFileReference; includeInIndex = 1; name = i2d_pr.c; path = src/crypto/x509/i2d_pr.c; sourceTree = ""; }; + EEECD989879D7D11D823655F92D76BA3 /* x509.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x509.c; path = src/crypto/x509/x509.c; sourceTree = ""; }; + EF1CF1358AED46E75D926E03531F42E3 /* completion_queue_tag.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue_tag.h; path = include/grpcpp/impl/codegen/completion_queue_tag.h; sourceTree = ""; }; + EF1E01436EB64D9F92375215FAB4E8FE /* builder.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = builder.cc; path = db/builder.cc; sourceTree = ""; }; + EF76B11D8DE5C0B489E5BA1A585CE327 /* base.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = base.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h"; sourceTree = ""; }; + EF7DC7895952D40AF44FF1457345D047 /* stacktrace_arm-inl.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = "stacktrace_arm-inl.inc"; path = "absl/debugging/internal/stacktrace_arm-inl.inc"; sourceTree = ""; }; + EFA044295F1ED786E7CF33310154BA17 /* s3_lib.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = s3_lib.cc; path = src/ssl/s3_lib.cc; sourceTree = ""; }; + EFB8821C2B01004562A7683C2880B9C1 /* child_policy_handler.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = child_policy_handler.cc; path = src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc; sourceTree = ""; }; + EFBD224024BA96E3D699CDEB9DDE6839 /* layout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = layout.h; path = absl/container/internal/layout.h; sourceTree = ""; }; + F046C2E8B13635C1C374CFB208B1565F /* firestore_version.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = firestore_version.cc; path = Firestore/core/src/firestore_version.cc; sourceTree = ""; }; + F07E3CC40A551C5BD4627CC04D39A30F /* FIRFieldValue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFieldValue.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h; sourceTree = ""; }; + F093766FF2A26F5432830F50C0B42D98 /* iomgr_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = iomgr_windows.cc; path = src/core/lib/iomgr/iomgr_windows.cc; sourceTree = ""; }; + F0A6ADBA12C11CA654BB21328411B1C2 /* target.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = target.cc; path = Firestore/core/src/core/target.cc; sourceTree = ""; }; + F0B7573BE70B3E29B5D33B4E021A4B55 /* lockfree_event.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = lockfree_event.h; path = src/core/lib/iomgr/lockfree_event.h; sourceTree = ""; }; + F0BA40126E444588641AC50A31C65BCE /* stub_options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stub_options.h; path = include/grpcpp/support/stub_options.h; sourceTree = ""; }; + F0D3C3A0257A66C849ADAC285D874751 /* memory_target_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = memory_target_cache.cc; path = Firestore/core/src/local/memory_target_cache.cc; sourceTree = ""; }; + F0F76938BACAA5E344C6C590CF9E04A2 /* xds_api.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = xds_api.cc; path = src/core/ext/filters/client_channel/xds/xds_api.cc; sourceTree = ""; }; + F102DCA4D8E69C333CBCAF1AC6FBD408 /* status.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = status.upb.h; path = "src/core/ext/upb-generated/google/rpc/status.upb.h"; sourceTree = ""; }; + F1622E9A9A961729DA445FAB73B0974D /* output.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = output.h; path = absl/strings/internal/str_format/output.h; sourceTree = ""; }; + F17E4FD2F23A37F6AFA7CAED1D2F6C85 /* resource_quota.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resource_quota.h; path = src/core/lib/iomgr/resource_quota.h; sourceTree = ""; }; + F1D041324AEF94552F612A8347FF944F /* server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server.h; path = src/core/lib/surface/server.h; sourceTree = ""; }; + F231F75A3EF0E5AC7BF05A7356CF6B3E /* secure_channel_arguments.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = secure_channel_arguments.cc; path = src/cpp/common/secure_channel_arguments.cc; sourceTree = ""; }; + F29FAC3B039690DC69E6AA318A91F7F9 /* FIRFieldPath.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRFieldPath.h; path = Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h; sourceTree = ""; }; + F2B42E37529D0CFD3E5B77383C40FC3F /* parser.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = parser.cc; path = src/core/lib/http/parser.cc; sourceTree = ""; }; + F2B8A6485EC0A2B8CF2107C23FF00A37 /* slice.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = slice.h; path = include/leveldb/slice.h; sourceTree = ""; }; + F2BCB5A6E163E223AB4EC37942EC748E /* grpc_library.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_library.h; path = include/grpcpp/impl/grpc_library.h; sourceTree = ""; }; + F2BD2D588B3379F19C4BC9E8559BB359 /* call_op_set.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = call_op_set.h; path = include/grpcpp/impl/codegen/call_op_set.h; sourceTree = ""; }; + F2CA69F1A5A70221803E171B54EDD51E /* server.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = server.h; path = include/grpcpp/server.h; sourceTree = ""; }; + F2E81AC51019F0FD3D5ECD6A75D29621 /* fork.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fork.h; path = src/core/lib/gprpp/fork.h; sourceTree = ""; }; + F2EF1BAB52858C3620B34AAC6C0E2651 /* handshaker.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = handshaker.cc; path = src/core/lib/channel/handshaker.cc; sourceTree = ""; }; + F32757B213FB20E73CCC0158CCFD6F3B /* http_server_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_server_filter.h; path = src/core/ext/filters/http/server/http_server_filter.h; sourceTree = ""; }; + F34E5FFCFEBE7E0E425CD673A997E4E3 /* prime.c */ = {isa = PBXFileReference; includeInIndex = 1; name = prime.c; path = src/crypto/fipsmodule/bn/prime.c; sourceTree = ""; }; + F35E1EA461D38B6A27DBB8E856036967 /* jwt_verifier.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = jwt_verifier.h; path = src/core/lib/security/credentials/jwt/jwt_verifier.h; sourceTree = ""; }; + F366375B86B3AC902A44764DD321B8F5 /* alarm.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alarm.h; path = include/grpcpp/alarm.h; sourceTree = ""; }; + F37130F35FDFD15BF12C013E47957649 /* options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = options.h; path = absl/base/options.h; sourceTree = ""; }; + F3719F350D9168310F18A53510C3F8CD /* pollset.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset.cc; path = src/core/lib/iomgr/pollset.cc; sourceTree = ""; }; + F37E2B4B8FC4316895B7F43046408D13 /* health_check.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = health_check.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h"; sourceTree = ""; }; + F3B697670C29CE2E5665229D8D27E1C3 /* parsing.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = parsing.cc; path = src/core/ext/transport/chttp2/transport/parsing.cc; sourceTree = ""; }; + F3ED5BBA5A5E9C3BECF3DDFC42052963 /* f_string.c */ = {isa = PBXFileReference; includeInIndex = 1; name = f_string.c; path = src/crypto/asn1/f_string.c; sourceTree = ""; }; + F3EF455CA17E8E84151728C5E5636789 /* polling_entity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = polling_entity.h; path = src/core/lib/iomgr/polling_entity.h; sourceTree = ""; }; + F3FDF10D0635517E0F667DCBA8134560 /* FIRCoreDiagnosticsConnector.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRCoreDiagnosticsConnector.m; path = FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m; sourceTree = ""; }; + F42293DFD17E3B5421CB37A555B6C0FD /* GDTCORFlatFileStorage+Promises.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "GDTCORFlatFileStorage+Promises.h"; path = "GoogleDataTransport/GDTCORLibrary/Private/GDTCORFlatFileStorage+Promises.h"; sourceTree = ""; }; + F449B073E2EB4910F6B47402D0C4F789 /* v3_pcons.c */ = {isa = PBXFileReference; includeInIndex = 1; name = v3_pcons.c; path = src/crypto/x509v3/v3_pcons.c; sourceTree = ""; }; + F455A496C1F3D69F6114BC76FC796D84 /* endpoint_pair_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint_pair_posix.cc; path = src/core/lib/iomgr/endpoint_pair_posix.cc; sourceTree = ""; }; + F46F19261670AA0D96E6494F0C02F67F /* string.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = string.upb.h; path = "src/core/ext/upb-generated/envoy/type/matcher/string.upb.h"; sourceTree = ""; }; + F496FB27791EC99D7E1900129F1A46CE /* leveldb_remote_document_cache.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = leveldb_remote_document_cache.cc; path = Firestore/core/src/local/leveldb_remote_document_cache.cc; sourceTree = ""; }; + F4B814B310FFE7E806C94D301234039A /* iterator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = iterator.h; path = include/leveldb/iterator.h; sourceTree = ""; }; + F4BB3C36D3E8DC8855C64F2DE77F9A8E /* skiplist.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = skiplist.h; path = db/skiplist.h; sourceTree = ""; }; + F4CDC11C5CE10922CC54F8623B421F06 /* alts_record_protocol_crypter_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = alts_record_protocol_crypter_common.h; path = src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h; sourceTree = ""; }; + F521DC622436B91DA4F8B69523B3515B /* bloom.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = bloom.cc; path = util/bloom.cc; sourceTree = ""; }; + F5870C1FB9B406541E9791E36FD3855B /* const_init.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = const_init.h; path = absl/base/const_init.h; sourceTree = ""; }; + F597A3123DA662D08CACDB826E2E5BEE /* sync_custom.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_custom.h; path = include/grpc/support/sync_custom.h; sourceTree = ""; }; + F5C999832105B5B01F81A701E0276CE9 /* cast.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = cast.h; path = src/include/openssl/cast.h; sourceTree = ""; }; + F5E25607BD68162D90074FF9D1A0FB1A /* composite_credentials.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = composite_credentials.h; path = src/core/lib/security/credentials/composite/composite_credentials.h; sourceTree = ""; }; + F5EF88EDBB1929F1B730A4C4243898B5 /* alts_shared_resource.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alts_shared_resource.cc; path = src/core/tsi/alts/handshaker/alts_shared_resource.cc; sourceTree = ""; }; + F5F14D9C982BF07F9C6C55C9B0365D54 /* grpc_ares_ev_driver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_ares_ev_driver.h; path = src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h; sourceTree = ""; }; + F60BA8BCB155286F8EB206ABEF7A5B67 /* write.nanopb.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = write.nanopb.cc; path = Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc; sourceTree = ""; }; + F60E11FD666EBB2FB74FA667AAB716F1 /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/fipsmodule/bn/internal.h; sourceTree = ""; }; + F60F47E2B7FF6B33A23F66F1863C54B3 /* fake_resolver.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = fake_resolver.cc; path = src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc; sourceTree = ""; }; + F628C3DF28DE01D9BE04EEC397AC014A /* in_filter.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = in_filter.cc; path = Firestore/core/src/core/in_filter.cc; sourceTree = ""; }; + F63FB24E85F74BF90CADE18BB83D1BA3 /* write_batch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = write_batch.h; path = include/leveldb/write_batch.h; sourceTree = ""; }; + F64F1939265A0552BA2F9A53AE1B5AD2 /* http2_settings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http2_settings.h; path = src/core/ext/transport/chttp2/transport/http2_settings.h; sourceTree = ""; }; + F653C2BE231542EF8F210F9C18A07B32 /* rsa.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = rsa.h; path = src/include/openssl/rsa.h; sourceTree = ""; }; + F67FE899F9D2D76DF5500524B1D6A157 /* endpoint.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = endpoint.cc; path = src/core/lib/iomgr/endpoint.cc; sourceTree = ""; }; + F69BFBB91D7CF1A9E5B54FEBB922A452 /* b64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = b64.h; path = src/core/lib/slice/b64.h; sourceTree = ""; }; + F6A593B29FF8456257AD9767E1EE0BBA /* ev_epoll1_linux.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ev_epoll1_linux.h; path = src/core/lib/iomgr/ev_epoll1_linux.h; sourceTree = ""; }; + F6B0C0FD283587E498CEE3A6EBF788CD /* bin_encoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = bin_encoder.h; path = src/core/ext/transport/chttp2/transport/bin_encoder.h; sourceTree = ""; }; + F6B76E8CA1120C3B37CD4E26737262BB /* pcy_tree.c */ = {isa = PBXFileReference; includeInIndex = 1; name = pcy_tree.c; path = src/crypto/x509v3/pcy_tree.c; sourceTree = ""; }; + F6B971B410643AF9F21F0053EAA13332 /* firebasecore.nanopb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = firebasecore.nanopb.h; path = Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h; sourceTree = ""; }; + F6D33BF02C2D1EC08BF2F70E0BB36A01 /* stream_compression_identity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression_identity.h; path = src/core/lib/compression/stream_compression_identity.h; sourceTree = ""; }; + F6E08C93F5F2F4F59EE7B367B27393A9 /* FBLPromise+Async.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FBLPromise+Async.h"; path = "Sources/FBLPromises/include/FBLPromise+Async.h"; sourceTree = ""; }; + F6FC809C9C4AA5E36CC4DE6CB5D47D36 /* service_config.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = service_config.h; path = src/core/ext/filters/client_channel/service_config.h; sourceTree = ""; }; + F7115F78FC67D382EC6862E32A909784 /* message_compress_filter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = message_compress_filter.h; path = src/core/ext/filters/http/message_compress/message_compress_filter.h; sourceTree = ""; }; + F71B7A15B8674D581D9403D194B0E106 /* pollset_set.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = pollset_set.cc; path = src/core/lib/iomgr/pollset_set.cc; sourceTree = ""; }; + F71F0E2B51BD13E6F68C24202B41F257 /* gRPC-Core.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "gRPC-Core.modulemap"; sourceTree = ""; }; + F7229CBE896CDFA77D31D55CFF1D039B /* hrss.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hrss.h; path = src/include/openssl/hrss.h; sourceTree = ""; }; + F722B083D385D1B6922816F230665A9A /* http_connection_manager.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = http_connection_manager.upb.h; path = "src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h"; sourceTree = ""; }; + F742EA742A187ACD17E43DB1B78C5D97 /* str_join.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = str_join.h; path = absl/strings/str_join.h; sourceTree = ""; }; + F744B7BCEF0EB94E5E6E6595DE737F7E /* internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = internal.h; path = src/crypto/evp/internal.h; sourceTree = ""; }; + F78B98CF571646B0BFC32DCBF279E904 /* log_writer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = log_writer.cc; path = db/log_writer.cc; sourceTree = ""; }; + F7B65AC4592C7EEA55B70BBEECB2A919 /* hash.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = hash.h; path = absl/hash/hash.h; sourceTree = ""; }; + F7D23F3C861BDA5EE61D19CB89AE8C05 /* spake25519.c */ = {isa = PBXFileReference; includeInIndex = 1; name = spake25519.c; path = src/crypto/curve25519/spake25519.c; sourceTree = ""; }; + F7F17B070E00266DCEC517C3123F5F75 /* useful.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = useful.h; path = src/core/lib/gpr/useful.h; sourceTree = ""; }; + F81A305F48B90D54EEAC5AD3A6164D9E /* graphcycles.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = graphcycles.cc; path = absl/synchronization/internal/graphcycles.cc; sourceTree = ""; }; + F81C80955C2524D9403AACD52C08FF54 /* poly1305.c */ = {isa = PBXFileReference; includeInIndex = 1; name = poly1305.c; path = src/crypto/poly1305/poly1305.c; sourceTree = ""; }; + F833DA52F02D691022D829A74BE58ADE /* fake_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fake_security_connector.h; path = src/core/lib/security/security_connector/fake/fake_security_connector.h; sourceTree = ""; }; + F88DFF4B603A25137FDF70CA3091492F /* ssl_aead_ctx.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = ssl_aead_ctx.cc; path = src/ssl/ssl_aead_ctx.cc; sourceTree = ""; }; + F89DE2BD98F44628A3F9C6E095D66E03 /* log_severity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = log_severity.h; path = absl/base/log_severity.h; sourceTree = ""; }; + F8A07008189BAAAC95B608E3B032B911 /* low_level_alloc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = low_level_alloc.cc; path = absl/base/internal/low_level_alloc.cc; sourceTree = ""; }; + F8A4446542DEEDCDADB62112CC79C290 /* map.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = map.h; path = src/core/lib/gprpp/map.h; sourceTree = ""; }; + F8B83F4A9E5AFB2DACE6E28615F69FFD /* backup_poller.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = backup_poller.h; path = src/core/ext/filters/client_channel/backup_poller.h; sourceTree = ""; }; + F90E070CF9B63F98769A73192FA5B2B5 /* FIRCoreDiagnosticsInterop.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCoreDiagnosticsInterop.h; path = Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h; sourceTree = ""; }; + F9281F782BB97E09594B037B5FD36366 /* channel_cc.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = channel_cc.cc; path = src/cpp/client/channel_cc.cc; sourceTree = ""; }; + F92BEB79CBC9CB9796C9FB11A01DEE2E /* aead.c */ = {isa = PBXFileReference; includeInIndex = 1; name = aead.c; path = src/crypto/fipsmodule/cipher/aead.c; sourceTree = ""; }; + F92F53BEA7101FF595D02B9B1054C9C4 /* orca_load_report.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = orca_load_report.upb.h; path = "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h"; sourceTree = ""; }; + F93B69F1C42D2674A97DFCA32E808939 /* tls_security_connector.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = tls_security_connector.h; path = src/core/lib/security/security_connector/tls/tls_security_connector.h; sourceTree = ""; }; + F977289B2AC1DA7B8583EFDBDECE3C08 /* pb_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_common.h; sourceTree = ""; }; + F99567E10473566C36B7068F1EE6F56F /* resolver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = resolver.h; path = src/core/ext/filters/client_channel/resolver.h; sourceTree = ""; }; + F9A85A218694BC0C65B81F0C0B7DA4D9 /* dh_asn1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = dh_asn1.c; path = src/crypto/dh/dh_asn1.c; sourceTree = ""; }; + F9ECE3CC88DC5F9CF5590E4BECDAFF10 /* x_all.c */ = {isa = PBXFileReference; includeInIndex = 1; name = x_all.c; path = src/crypto/x509/x_all.c; sourceTree = ""; }; + F9EE2F1683A930FBADA8100E120A0F8B /* FIROptionsInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIROptionsInternal.h; path = FirebaseCore/Sources/Private/FIROptionsInternal.h; sourceTree = ""; }; + FA2294EED77B3BE132FAF4BB8565B349 /* engine.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = engine.h; path = src/include/openssl/engine.h; sourceTree = ""; }; + FA738BD4985005BC8490C1FA0F63003B /* combiner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = combiner.h; path = src/core/lib/iomgr/combiner.h; sourceTree = ""; }; + FA7AB0F77D52007714D70052EB2DA27B /* lds.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = lds.upb.c; path = "src/core/ext/upb-generated/envoy/api/v2/lds.upb.c"; sourceTree = ""; }; + FA833410DD39DA0A15099F28876AA2AE /* api_trace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = api_trace.h; path = src/core/lib/surface/api_trace.h; sourceTree = ""; }; + FA955A6E8F8F84D04CCB4E379AC4BD50 /* completion_queue_impl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = completion_queue_impl.h; path = include/grpcpp/completion_queue_impl.h; sourceTree = ""; }; + FA962D878266159C8CDFDCEFBC108D72 /* nanopb.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = nanopb.modulemap; sourceTree = ""; }; + FAB1D65E68C223D2FEEF4EC568EA3A8F /* thd_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = thd_windows.cc; path = src/core/lib/gprpp/thd_windows.cc; sourceTree = ""; }; + FACAAC88C97DA55E00D20CEA12A3E2A6 /* socket_utils_common_posix.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = socket_utils_common_posix.cc; path = src/core/lib/iomgr/socket_utils_common_posix.cc; sourceTree = ""; }; + FACCD01FD4A1CE43B774B75732CB6A0A /* FIRAuthInterop.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAuthInterop.h; path = Interop/Auth/Public/FIRAuthInterop.h; sourceTree = ""; }; + FAD8A7EF54472CECDA1234F4A0880196 /* rsa_impl.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rsa_impl.c; path = src/crypto/fipsmodule/rsa/rsa_impl.c; sourceTree = ""; }; + FAFF8B74EDD34A5975FAF06BFC522FCE /* dbformat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = dbformat.h; path = db/dbformat.h; sourceTree = ""; }; + FB05D36C9EA8B60C967175B8413FAE1D /* pb_encode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_encode.c; sourceTree = ""; }; + FB06D2711AA1B749D921BE1C430B49FB /* derive_key.c */ = {isa = PBXFileReference; includeInIndex = 1; name = derive_key.c; path = src/crypto/cipher_extra/derive_key.c; sourceTree = ""; }; + FB3455E17C4C9DCB88F0BA9EBBB368D4 /* direction.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = direction.cc; path = Firestore/core/src/core/direction.cc; sourceTree = ""; }; + FB3B138A1856E682C0F461A346EBF053 /* grpc_if_nametoindex.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = grpc_if_nametoindex.h; path = src/core/lib/iomgr/grpc_if_nametoindex.h; sourceTree = ""; }; + FB44D07A16FBCB87E04515ED0C9D5AAF /* GDTCORReachability.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORReachability.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORReachability.h; sourceTree = ""; }; + FB4E17CA503AA15A2D1C6290A2B7CE5D /* gogo.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = gogo.upb.h; path = "src/core/ext/upb-generated/gogoproto/gogo.upb.h"; sourceTree = ""; }; + FB6E28756AF9D5278A5ADB2BA818DD5C /* intercepted_channel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = intercepted_channel.h; path = include/grpcpp/impl/codegen/intercepted_channel.h; sourceTree = ""; }; + FB6EE78C78BD233BC52E5F669C8AFAE0 /* connectivity_state.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = connectivity_state.h; path = src/core/lib/transport/connectivity_state.h; sourceTree = ""; }; + FB7C74D862C77160C47225BDF2192058 /* FBLPromise+Do.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FBLPromise+Do.m"; path = "Sources/FBLPromises/FBLPromise+Do.m"; sourceTree = ""; }; + FB89F3C63BC67038371022710B8302A8 /* any.upb.c */ = {isa = PBXFileReference; includeInIndex = 1; name = any.upb.c; path = "src/core/ext/upb-generated/google/protobuf/any.upb.c"; sourceTree = ""; }; + FB9729F52D2DCA8DFE896C9262B90CA3 /* arena.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = arena.cc; path = util/arena.cc; sourceTree = ""; }; + FBD5D840A56881FA2FF3B1C64B9C7789 /* tasn_utl.c */ = {isa = PBXFileReference; includeInIndex = 1; name = tasn_utl.c; path = src/crypto/asn1/tasn_utl.c; sourceTree = ""; }; + FBF3160F613DA48B3D45168A65B04115 /* demangle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = demangle.h; path = absl/debugging/internal/demangle.h; sourceTree = ""; }; + FBFF04262559F8569FCD36F3791128BA /* ecdh.c */ = {isa = PBXFileReference; includeInIndex = 1; name = ecdh.c; path = src/crypto/fipsmodule/ecdh/ecdh.c; sourceTree = ""; }; + FC07AFB1A7B3C6E8AD9875D1F744BF03 /* xds_channel_args.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = xds_channel_args.h; path = src/core/ext/filters/client_channel/xds/xds_channel_args.h; sourceTree = ""; }; + FC0DE0D534542BBEAAAC40D5C26EC014 /* poly1305_arm.c */ = {isa = PBXFileReference; includeInIndex = 1; name = poly1305_arm.c; path = src/crypto/poly1305/poly1305_arm.c; sourceTree = ""; }; + FC35B5E778E247E727CF82C0C86D56DE /* gethostname_fallback.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = gethostname_fallback.cc; path = src/core/lib/iomgr/gethostname_fallback.cc; sourceTree = ""; }; + FC8D20028EF6AD5FC84F04049A68A6EA /* stream_compression.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = stream_compression.h; path = src/core/lib/compression/stream_compression.h; sourceTree = ""; }; + FC8F412BEDA9A3CA749A252C7357A3E8 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/CoreTelephony.framework; sourceTree = DEVELOPER_DIR; }; + FCCA30672600EF310C1AC89F398065BD /* view_snapshot.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = view_snapshot.cc; path = Firestore/core/src/core/view_snapshot.cc; sourceTree = ""; }; + FCDD12DC0C6106F724280FCF4A3C1060 /* GDTCORDirectorySizeTracker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCORDirectorySizeTracker.h; path = GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h; sourceTree = ""; }; + FD84F7B7BE1474B065538076FF17D61C /* nameser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = nameser.h; path = src/core/lib/iomgr/nameser.h; sourceTree = ""; }; + FD9B6C8E8C8C9215BC708DCD218B5285 /* metadata.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = metadata.upb.h; path = "src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h"; sourceTree = ""; }; + FDA685DC734F7751F03784B2EC5868B1 /* callback_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = callback_common.h; path = include/grpcpp/impl/codegen/callback_common.h; sourceTree = ""; }; + FDB818CE2139D1F1F49FD25FBF04A68F /* endpoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = endpoint.h; path = src/core/lib/iomgr/endpoint.h; sourceTree = ""; }; + FDBD9D85B71132929F853945215B2274 /* FIRCollectionReference.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRCollectionReference.h; path = Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h; sourceTree = ""; }; + FDC6A78A78235B12BDDBE2CCB0CCF495 /* init.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = init.h; path = src/core/lib/surface/init.h; sourceTree = ""; }; + FDC80743B9299684E51D6A595D902770 /* orphanable.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = orphanable.h; path = src/core/lib/gprpp/orphanable.h; sourceTree = ""; }; + FE2A5512BD4BBDBF9D6B47B95AB122DC /* parse_address.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = parse_address.h; path = src/core/ext/filters/client_channel/parse_address.h; sourceTree = ""; }; + FE3D599FF436D35431DE4C357824F0C7 /* filter.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = filter.upb.h; path = "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h"; sourceTree = ""; }; + FE54D77BBDA6A2F766C6BC37C9BC38BC /* Pods-SaraAttended-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SaraAttended-Info.plist"; sourceTree = ""; }; + FE8E4DD22025DFEB1D8911FBAF47F6E2 /* variant.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = variant.h; path = absl/types/variant.h; sourceTree = ""; }; + FE9F0215D2AF3F8BA7BB19BD77B1D1BB /* cpu_windows.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = cpu_windows.cc; path = src/core/lib/gpr/cpu_windows.cc; sourceTree = ""; }; + FE9F9F9132B59241634C2AF133BF85C6 /* alpn.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = alpn.cc; path = src/core/ext/transport/chttp2/alpn/alpn.cc; sourceTree = ""; }; + FEA2C9E67C4452AC95FF0E0E799F9D69 /* context.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = context.h; path = src/core/lib/channel/context.h; sourceTree = ""; }; + FEA6C03ECBC2D9DF2C3AE52F296DCC5B /* validate_metadata.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = validate_metadata.h; path = src/core/lib/surface/validate_metadata.h; sourceTree = ""; }; + FEE107A7579FCAEF4E75974BBBEA6390 /* GDTCOREndpoints_Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCOREndpoints_Private.h; path = GoogleDataTransport/GDTCORLibrary/Private/GDTCOREndpoints_Private.h; sourceTree = ""; }; + FF2294BB343A82BD43CBF340CC692115 /* GULKeychainStorage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GULKeychainStorage.m; path = GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m; sourceTree = ""; }; + FF315A587D4F9A607150E883F693B0CE /* ads.upb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ads.upb.h; path = "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h"; sourceTree = ""; }; + FF4A0E8DE8149F64767FF12775A0601F /* sync_abseil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = sync_abseil.h; path = include/grpc/support/sync_abseil.h; sourceTree = ""; }; + FF65EAC59A0CED510C1F98D3618BB018 /* sha1.c */ = {isa = PBXFileReference; includeInIndex = 1; name = sha1.c; path = src/crypto/fipsmodule/sha/sha1.c; sourceTree = ""; }; + FF759DBF5FF7A93E89C5041696E05D6D /* int128_have_intrinsic.inc */ = {isa = PBXFileReference; includeInIndex = 1; name = int128_have_intrinsic.inc; path = absl/numeric/int128_have_intrinsic.inc; sourceTree = ""; }; + FFC253B3258E7A9D1C02245FAC42D0D6 /* json_writer.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = json_writer.cc; path = src/core/lib/json/json_writer.cc; sourceTree = ""; }; + FFC3148D92C5C6899C9E8F04A356808A /* atm_gcc_atomic.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = atm_gcc_atomic.h; path = include/grpc/support/atm_gcc_atomic.h; sourceTree = ""; }; + FFD4B31452A9981277D282361FC81C10 /* autoid.cc */ = {isa = PBXFileReference; includeInIndex = 1; name = autoid.cc; path = Firestore/core/src/util/autoid.cc; sourceTree = ""; }; + FFD5AAF9F921A0C5D3FC1E9AE6BAFAB0 /* GDTCCTUploadOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDTCCTUploadOperation.h; path = GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploadOperation.h; sourceTree = ""; }; + FFE2AFFC9EBC1677F5EFE4FC4BAC583C /* GULLoggerLevel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GULLoggerLevel.h; path = GoogleUtilities/Logger/Public/GoogleUtilities/GULLoggerLevel.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 01AE753564010498981790C3351A6A06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8E9F380133E5AA6CBB86D08C490C996F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0ED21B27BF4F6B0FB6F03904DC8EF29C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 12A76319F69F1F49A599DF29CAE7DBE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 253E1E18D4C04448A5E642578681191D /* Foundation.framework in Frameworks */, + 84C153958402195F0DD146FA4DE9256A /* Security.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3E357E2036A8449036AB72569A43DD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E76CDCED9A88018FBDECBF3C7EA7E5CA /* CoreTelephony.framework in Frameworks */, + BACF462867CDEA2EDDBC143AC07F624B /* Foundation.framework in Frameworks */, + BCC46DAC1A493406F5F515F4B692E4FF /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 619A559E3A3AE927BD1F4BF7D7471681 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FFBCC3F7290087D2883818F02DF01EEF /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6870C205861FD1E4C5B934EEA813B4B8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 649FE5CB280F723AC6456B584FF0A230 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7A56ADBEE360BFEA414A965872D89778 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D8310CFA4993008D3CF84E6A0832B0AF /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7DBD352BCEA6C534DDC074853F25148E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 39CDA1B1E69818FF073F18E95FD17EA1 /* Foundation.framework in Frameworks */, + ABB969A8097102DAC0D273AFEF4500C4 /* SystemConfiguration.framework in Frameworks */, + 807B9F5C629BEE0497F8010B07529616 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8A9541DF7BCC59D3B72A0FD545BF9540 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0048DFBD10CDE65A5C2F7E6DA59A9D5E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 91006711998B9A7B6EA7587740330AED /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C2A38AD30B4B0F86950E047F3F693716 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A6D7B251DE0A6AD1EF20EBB8ADCE08B0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 66E5192708EE61CC852FF94D73A4E683 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AF3A588514854A49A113F296B333A1C1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 406E9834573922C7415A946E710C3BB2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AFDE8C4BEC7ED55E8CAE17DD48B8C641 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 254B90DAA2625F5985DE653AD4B2F98F /* Foundation.framework in Frameworks */, + E0F04BB7AFEA4A3F5B791AB5E3B56E15 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DE94FE6511046F0F52631FC3B7B66C43 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6F0540727F6066E9229CDAD7496A9B68 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 013E9038AFEFB3345FA3E635F87744A1 /* Logger */ = { + isa = PBXGroup; + children = ( + 0F8711C6D60C208846D4B38B8E70DEC6 /* GULLogger.h */, + 0665600A3F802CD2D235A7CA08B137AB /* GULLogger.m */, + FFE2AFFC9EBC1677F5EFE4FC4BAC583C /* GULLoggerLevel.h */, + ); + name = Logger; + sourceTree = ""; + }; + 02C90D41DD4DBD075253E136DDFBB670 /* bad_any_cast_impl */ = { + isa = PBXGroup; + children = ( + C30AA0201F10E929C58BF307B5B88491 /* bad_any_cast.cc */, + ); + name = bad_any_cast_impl; + sourceTree = ""; + }; + 050AF11DB791AE5E41C37878CE0A0AF0 /* pretty_function */ = { + isa = PBXGroup; + children = ( + 85B7A8746B944A38ED662B6933651D2C /* pretty_function.h */, + ); + name = pretty_function; + sourceTree = ""; + }; + 0558F799111E92C44DD89FB6AC9D20DE /* Support Files */ = { + isa = PBXGroup; + children = ( + B3D998FD723B816CBBAFF1FE51DADD30 /* abseil.modulemap */, + C88B9497962F43DFFE2E8C47A44B4670 /* abseil-dummy.m */, + 5964F286971D3E312DA8B219F8E02E3C /* abseil-Info.plist */, + 24446E73C9678EF9D157C1F9DF2253AD /* abseil-prefix.pch */, + 864AFAAA65DA21BF2A41FD914BB15027 /* abseil-umbrella.h */, + 7C9C024C5645D13D545A3DE06DB6CEB5 /* abseil.debug.xcconfig */, + 4EEFEACB2009276482A111DA74E51FBE /* abseil.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/abseil"; + sourceTree = ""; + }; + 076B1809423AFCF4A216124D4A667B3A /* layout */ = { + isa = PBXGroup; + children = ( + EFBD224024BA96E3D699CDEB9DDE6839 /* layout.h */, + ); + name = layout; + sourceTree = ""; + }; + 08263F0FAE744D6E41A791615160DD09 /* debugging */ = { + isa = PBXGroup; + children = ( + 70906D5CC2B4114C69DA7B4F738CE089 /* debugging_internal */, + B9E82B6696F4AFAEF1578C01CEE70486 /* demangle_internal */, + DC272ECD90C4FA860E4AB6EF106819E9 /* stacktrace */, + 772482FE0B3F976098F5CF7145C86AF8 /* symbolize */, + ); + name = debugging; + sourceTree = ""; + }; + 09A8703F39C4E6858BE4CE6518865556 /* Environment */ = { + isa = PBXGroup; + children = ( + 84BFD27E9223734B6A049858399B753A /* GULAppEnvironmentUtil.h */, + 4855F73788559D7D3856CB64D848269C /* GULAppEnvironmentUtil.m */, + 205771B2FC8BCC1AB7D4AB45107369BD /* GULHeartbeatDateStorable.h */, + E23BBB6D4C3974CEC17F6B23291C1C51 /* GULHeartbeatDateStorage.h */, + C4D0667700B3B9F86DC608BF0D167F32 /* GULHeartbeatDateStorage.m */, + 6B2784EC7FDF125E53043E97FEC1A93C /* GULHeartbeatDateStorageUserDefaults.h */, + 79318409836E677F346B550088F6BA80 /* GULHeartbeatDateStorageUserDefaults.m */, + D33E14FBFFF2D8733E45613FBD7B4336 /* GULKeychainStorage.h */, + FF2294BB343A82BD43CBF340CC692115 /* GULKeychainStorage.m */, + 07F338B20AACF5A0F8EA2DB94A749F46 /* GULKeychainUtils.h */, + 64E1D2F02E98FFCD0BF893A3858FF385 /* GULKeychainUtils.m */, + 6F660407E9951B59034B8EF2ED69083E /* GULSecureCoding.h */, + 94E35964BC0034013F356E04B178FDEE /* GULSecureCoding.m */, + 1F9A065C506BE5D919864CF52037C4BE /* GULURLSessionDataResponse.h */, + DEAD2EE0B4B3E0F82293A5A8E964CBCF /* GULURLSessionDataResponse.m */, + 4E176B80E8DC80BA18C0578389844C65 /* NSURLSession+GULPromises.h */, + 8076CA75CD2587BBFEBA18201CF95B38 /* NSURLSession+GULPromises.m */, + ); + name = Environment; + sourceTree = ""; + }; + 0B8269346541F816F8542CA747FD86A4 /* internal */ = { + isa = PBXGroup; + children = ( + C0BCF9BBBCE0F13B2106AE7DFE12B7A3 /* char_map.h */, + 3792BA295EEB300CB0C045634F2BAA3C /* escaping.cc */, + 5837FC87F631F4B0B42612D6362B36BF /* escaping.h */, + 66D5D5ED965A18F6F8CF3E5FD06DBE7B /* ostringstream.cc */, + 7FD55D078350569E123F008748C531D9 /* ostringstream.h */, + 42DE6B8BAA3F2D02FB99B98DC0D836DD /* resize_uninitialized.h */, + DB5A85B870F7ACC87F74840D10982450 /* utf8.cc */, + 2F581468D54E778E32D3BDA3B68F82D5 /* utf8.h */, + ); + name = internal; + sourceTree = ""; + }; + 0D20F09AC47E6A8AD4590AEFDCC6539F /* time */ = { + isa = PBXGroup; + children = ( + 2FD21F8201B5D535189D161627F6BF6C /* internal */, + 4D8172204A79346B6AA221E1248FC5EB /* time */, + ); + name = time; + sourceTree = ""; + }; + 0F27B24C5E536899D13F43FCF3B3B7DF /* meta */ = { + isa = PBXGroup; + children = ( + 548C7F9C4B8A4D0E7DB3C4AC212533FD /* type_traits */, + ); + name = meta; + sourceTree = ""; + }; + 14A562A4B8C913579A178B95A9C4AFBB /* cctz */ = { + isa = PBXGroup; + children = ( + 6CEC13665E4BC45E0F76084115FB0A77 /* civil_time */, + 718B18634B5419EE7AE0AD54955D8FE4 /* time_zone */, + ); + name = cctz; + sourceTree = ""; + }; + 14DC1589B7D9B9B331E11CB4EC7D57DC /* log_severity */ = { + isa = PBXGroup; + children = ( + D1E0A100FC0CD0A46CD7AB8EC4409FED /* log_severity.cc */, + F89DE2BD98F44628A3F9C6E095D66E03 /* log_severity.h */, + ); + name = log_severity; + sourceTree = ""; + }; + 156C3A57A7ADCDD834754A625E9AEB33 /* Support Files */ = { + isa = PBXGroup; + children = ( + DF637044AEB06109E9B64B798E173247 /* gRPC-C++.modulemap */, + 612E8210AAE6FCBF0104313A09CE11CF /* gRPC-C++-dummy.m */, + C37752E1C6F639AE3D672954C6D7B2FC /* gRPC-C++-Info.plist */, + 18D7CBF791C0ACD7E4EB4E6867A567F4 /* gRPC-C++-prefix.pch */, + 0B55EB91303FBDC08783F84BF6997B52 /* gRPC-C++-umbrella.h */, + 1A6F7D1BC95FD2032D74AA5AEB6D78BC /* gRPC-C++.debug.xcconfig */, + 67A3D205B05871CBA8CDE98108A56AF8 /* gRPC-C++.release.xcconfig */, + BF6E062C93E29B0E891706DFC310BA7F /* ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/gRPC-C++"; + sourceTree = ""; + }; + 15A08647C1F8D7490E2E6DEA9B29B161 /* synchronization */ = { + isa = PBXGroup; + children = ( + 3C97C5DBFE34685705E774D25D3AEE5B /* graphcycles_internal */, + 5290BFA91EC90278A0B965E999C5DC40 /* kernel_timeout_internal */, + 3C313304612246C02DE65C221FBF5161 /* synchronization */, + ); + name = synchronization; + sourceTree = ""; + }; + 186DDEAE61CA17D9293EB278704FCAAB /* hashtable_debug_hooks */ = { + isa = PBXGroup; + children = ( + AF9FE1C105714C48F02ADCBCA92D2F40 /* hashtable_debug_hooks.h */, + ); + name = hashtable_debug_hooks; + sourceTree = ""; + }; + 1A7F877FFAE4ED7484D3C2A61A1A9D66 /* hash */ = { + isa = PBXGroup; + children = ( + 72CA26BF0546AD4251A47A38F0C1E193 /* hash.cc */, + F7B65AC4592C7EEA55B70BBEECB2A919 /* hash.h */, + 979966287B4F51FF3C0BA7982BA258F4 /* hash.h */, + ); + name = hash; + sourceTree = ""; + }; + 1DC6020303DDD04FEEBC692365AEFB6B /* throw_delegate */ = { + isa = PBXGroup; + children = ( + DDBA219B26A46DACBC3BBB50C08D0CAF /* throw_delegate.cc */, + 9F9A3572E006A3AF2D2D784FA7D2E148 /* throw_delegate.h */, + ); + name = throw_delegate; + sourceTree = ""; + }; + 1F7A6E26DA32AE50117AA99E02DBC6B9 /* GoogleDataTransport */ = { + isa = PBXGroup; + children = ( + 7B2B4A836335C82CB5CBDC1D12EA8755 /* cct.nanopb.c */, + 2BD06794CAD8EB9EBF409100605C94A3 /* cct.nanopb.h */, + 07E20745F47D7578D58BF2B679D05551 /* GDTCCTCompressionHelper.h */, + 621BBE4CD378521268FD1056F97AB8DB /* GDTCCTCompressionHelper.m */, + C3FBD6A9D5FA239CA5766A8F9C4B13F6 /* GDTCCTNanopbHelpers.h */, + 98C2DAE80D13FFA966F0502660D6B186 /* GDTCCTNanopbHelpers.m */, + A3D9BA366DEC557FC6ED6AFA29421653 /* GDTCCTUploader.h */, + 796214088AA525811BB7BD373FDF91AA /* GDTCCTUploader.m */, + FFD5AAF9F921A0C5D3FC1E9AE6BAFAB0 /* GDTCCTUploadOperation.h */, + 205BF93224B19AE2B0B15B8FB06658AE /* GDTCCTUploadOperation.m */, + 32C22F219976F585EB755FDF633B2488 /* GDTCORAssert.h */, + 6D25CDDD9A88978F014D4A99CC3B37C6 /* GDTCORAssert.m */, + DF9FB01E85F1BB238BFC15F28E9D8967 /* GDTCORClock.h */, + CCC4E0650D504476E993AE3C31F9192F /* GDTCORClock.m */, + 24C3244EFC3C88261038CFBEF04E22AC /* GDTCORConsoleLogger.h */, + 242474927BBDB038EE0FF6F4E321FA1B /* GDTCORConsoleLogger.m */, + FCDD12DC0C6106F724280FCF4A3C1060 /* GDTCORDirectorySizeTracker.h */, + A94B2D26AC4AEF80C7232EC115747DAE /* GDTCORDirectorySizeTracker.m */, + 3DA7CBF62BB3656E09A77A3F5F593554 /* GDTCOREndpoints.h */, + C8E192B9EA33B3BCEC71CD10D86848B8 /* GDTCOREndpoints.m */, + FEE107A7579FCAEF4E75974BBBEA6390 /* GDTCOREndpoints_Private.h */, + 14DC4924C9EFB233AC319AC2FD5474F0 /* GDTCOREvent.h */, + D9DC1435F47B6AC7EA42DCCCE81E9470 /* GDTCOREvent.m */, + 4C75E9F8F29FED1DFA8A55DD8C04464C /* GDTCOREvent+GDTCCTSupport.h */, + 390E1EFE88DDAEC3EE6294C7408CD71D /* GDTCOREvent+GDTCCTSupport.m */, + 40DBDD6AFED2AF2508997CB1D7E329FD /* GDTCOREvent_Private.h */, + 24B350451EE1CC133DECFA8857CFAF56 /* GDTCOREventDataObject.h */, + 6DCFD02AF1A42B83B122A97E0062D3B0 /* GDTCOREventTransformer.h */, + 9B43CD33F3F1F3EF0114CE8B81660C94 /* GDTCORFlatFileStorage.h */, + 416BD878FDE36B0E876E3A02BAE72148 /* GDTCORFlatFileStorage.m */, + F42293DFD17E3B5421CB37A555B6C0FD /* GDTCORFlatFileStorage+Promises.h */, + 60CBC225D5210CBFA6B4FB6F8D4BC450 /* GDTCORFlatFileStorage+Promises.m */, + 272432795AA12FE37FFCEDF06982DE17 /* GDTCORLifecycle.h */, + D63AEB66196C962BE4053CD2855D122A /* GDTCORLifecycle.m */, + CAAC3788E201C140F3F27330EC20E486 /* GDTCORPlatform.h */, + 459AB63EDCA10BF23F45F3A64546AE8F /* GDTCORPlatform.m */, + FB44D07A16FBCB87E04515ED0C9D5AAF /* GDTCORReachability.h */, + 3D786ADEA083DF91413AFBC3EDD789DE /* GDTCORReachability.m */, + 6A590FAC573405ECFA26516B654801D0 /* GDTCORReachability_Private.h */, + D175E244220CBE3EDA640388DBDCA2CF /* GDTCORRegistrar.h */, + 15CB911B4ACF1165984AC259F22DCD40 /* GDTCORRegistrar.m */, + BDEF32DE7B79E9425C0940C902B67AA1 /* GDTCORRegistrar_Private.h */, + 40633848FF26A08A6737B41BFA03446D /* GDTCORStorageEventSelector.h */, + C1C6DCD4547B6351867A16CEB2FAA8C1 /* GDTCORStorageEventSelector.m */, + 022CA1CB15A7268E67F501BEAD00C894 /* GDTCORStorageProtocol.h */, + D52349A8F7412AEC80B53A04E79BCD52 /* GDTCORTargets.h */, + 511ED73A162181E1F436509BD4A86D64 /* GDTCORTransformer.h */, + CA10B384C2987C54413082FF23735492 /* GDTCORTransformer.m */, + EBEA77321C3EE364949EFE1CDB3037A8 /* GDTCORTransformer_Private.h */, + 67231506166E828D9E3C83F285AF0629 /* GDTCORTransport.h */, + B11A86487F16624DB6C78C55CE5098B7 /* GDTCORTransport.m */, + 386BB34824ED1E0EE99659E7D3951FA3 /* GDTCORTransport_Private.h */, + 5B057FBCF7405CACAA8807CE25EBED87 /* GDTCORUploadBatch.h */, + 8A543609844C6990EDD87FDAACDEDE63 /* GDTCORUploadBatch.m */, + 6DF9F21770FD8304AB8E04FD2CB0FE25 /* GDTCORUploadCoordinator.h */, + C0F1069D612BA4932C4D69EF2F691684 /* GDTCORUploadCoordinator.m */, + 7576318C5263C6E2401312AF9CA8B55E /* GDTCORUploader.h */, + D902EC8F9894DB24CAF3257297A29E22 /* GoogleDataTransport.h */, + D29362E6E7EF680A7E73A7CE5EFF452F /* Support Files */, + ); + name = GoogleDataTransport; + path = GoogleDataTransport; + sourceTree = ""; + }; + 1FBF27D2B1DAC8E0E898816387E676B2 /* Support Files */ = { + isa = PBXGroup; + children = ( + CD7901B81D9F0281ED1313A06D465E34 /* FirebaseCoreDiagnostics.modulemap */, + CA09288322BBF42C93B3F5A29490A607 /* FirebaseCoreDiagnostics-dummy.m */, + 09B7093943DEE64A8869CBCD14253515 /* FirebaseCoreDiagnostics-Info.plist */, + A51AE3F96F277D764A798B322CFD9EDF /* FirebaseCoreDiagnostics-umbrella.h */, + 595FA36719EBBEB254EF8CB5A5417DF6 /* FirebaseCoreDiagnostics.debug.xcconfig */, + BA277D1A72D65DC13D7BEC2924E49626 /* FirebaseCoreDiagnostics.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/FirebaseCoreDiagnostics"; + sourceTree = ""; + }; + 217FF8EF786A1B90F9F4343078353843 /* nanopb */ = { + isa = PBXGroup; + children = ( + 93CFB930C45A98DBDEAA7F0D80DDB556 /* pb.h */, + 8A5F0918CD5C118C2DEA9DD06AAE03B7 /* pb_common.c */, + F977289B2AC1DA7B8583EFDBDECE3C08 /* pb_common.h */, + 6A5C20C43790C92304C52BE564E0A511 /* pb_decode.c */, + 3A8392C419EB6ADFDFE1B5A27183E2C1 /* pb_decode.h */, + FB05D36C9EA8B60C967175B8413FAE1D /* pb_encode.c */, + D8CB6409C7D345E216597170BB01A5AA /* pb_encode.h */, + 8FE74C9FB7AEEE03D86143B0D46335AC /* decode */, + D81E66EE20871DC60D402EBA7A86982D /* encode */, + 7A4FAF415C89D6DC76C2E231A3D9228F /* Support Files */, + ); + name = nanopb; + path = nanopb; + sourceTree = ""; + }; + 246B475EF001D8342F0ED45B50EEAFE0 /* memory */ = { + isa = PBXGroup; + children = ( + E3E5259D1CD4685D0666BC76FC6A28EF /* memory */, + ); + name = memory; + sourceTree = ""; + }; + 2685DE990CDBDE92F88507D93DC19E89 /* numeric */ = { + isa = PBXGroup; + children = ( + E82CAD7C1E78361D781B19345EADB5D0 /* int128 */, + ); + name = numeric; + sourceTree = ""; + }; + 281B2074745D2844D49917019E5D7150 /* utility */ = { + isa = PBXGroup; + children = ( + D2BB709106F1A9D4BD42753765C5C73D /* utility */, + ); + name = utility; + sourceTree = ""; + }; + 2AD5E6DC842EB2DF01835DCF12ABF408 /* bad_variant_access */ = { + isa = PBXGroup; + children = ( + 9EAF735DB4F8C896B4B0612350E08A0E /* bad_variant_access.cc */, + 1911C0C740F0172D7C5A5A2E4B6B8C9E /* bad_variant_access.h */, + ); + name = bad_variant_access; + sourceTree = ""; + }; + 2FD21F8201B5D535189D161627F6BF6C /* internal */ = { + isa = PBXGroup; + children = ( + 14A562A4B8C913579A178B95A9C4AFBB /* cctz */, + ); + name = internal; + sourceTree = ""; + }; + 3C313304612246C02DE65C221FBF5161 /* synchronization */ = { + isa = PBXGroup; + children = ( + 5CCE6080690B7DA6DEDADE7D9C67318E /* barrier.cc */, + C7E75A3C6625795F606173495E322656 /* barrier.h */, + AC75C664ABCE97A506988ADCFB047624 /* blocking_counter.cc */, + 51BE2D3DD1DD4E8DD1B5D1DDC0F9F310 /* blocking_counter.h */, + 831E811655F45D87C159FD46B12B9033 /* create_thread_identity.cc */, + 1971FDEC917369CE223266C795BB5777 /* create_thread_identity.h */, + 6C5BE90EAC6E022526BFABD0B6F3D0CE /* mutex.cc */, + 1DD342F2761D43D340F2DE16B63412B8 /* mutex.h */, + 05BBF7398C7A402D224160BB799B4E5B /* mutex_nonprod.inc */, + 1E38A0446DD4881BBB0CB0BA9BA3F096 /* notification.cc */, + D427F01390693996D900AA7735DF54DE /* notification.h */, + 54E070948B2D59D3403B8E604EDBDB67 /* per_thread_sem.cc */, + 4C29C9928D15DDD75348B863CB3438B9 /* per_thread_sem.h */, + B70F5B8BAC9639370472813E432CC316 /* waiter.cc */, + C0B4CBC2E1E86CE7E8AE79BC48878FA8 /* waiter.h */, + ); + name = synchronization; + sourceTree = ""; + }; + 3C97C5DBFE34685705E774D25D3AEE5B /* graphcycles_internal */ = { + isa = PBXGroup; + children = ( + F81A305F48B90D54EEAC5AD3A6164D9E /* graphcycles.cc */, + 8839BEFA32CCD9B91B6BC39C67B68F8A /* graphcycles.h */, + ); + name = graphcycles_internal; + sourceTree = ""; + }; + 3CD15DEF0B586D3862BDE29DDADB1084 /* flat_hash_map */ = { + isa = PBXGroup; + children = ( + CDADDF63B94ED816838C92C98FF81B15 /* flat_hash_map.h */, + ); + name = flat_hash_map; + sourceTree = ""; + }; + 40CD3849D6F096E2972FC5D59BF7E602 /* Support Files */ = { + isa = PBXGroup; + children = ( + 287861E4AA5099313770B01785517654 /* leveldb-library.modulemap */, + 8D091AC3E9EEBAFA30C41554EDE4AB0F /* leveldb-library-dummy.m */, + 1DE370C5B821DB68A6A3C39CCE0A21DC /* leveldb-library-Info.plist */, + CFAD76890CF2533FB3EB6411F8611842 /* leveldb-library-prefix.pch */, + 74DA42176BD18BF27A2921B163A95B2F /* leveldb-library-umbrella.h */, + 289CCF46E257E176674DC3FF398AF3E5 /* leveldb-library.debug.xcconfig */, + B4B77BFF7B034F5885E2CC44FA47184D /* leveldb-library.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/leveldb-library"; + sourceTree = ""; + }; + 4188EF5440E1D0D68B93AE783BF7BEB1 /* Support Files */ = { + isa = PBXGroup; + children = ( + 67B06532914C1BCA15ADF300B57ABB9A /* Firebase.debug.xcconfig */, + 7D6A83C6D09A90628B7283F3B9B07679 /* Firebase.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/Firebase"; + sourceTree = ""; + }; + 41FB9256370455DCEB382C2ED4ECD32D /* BoringSSL-GRPC */ = { + isa = PBXGroup; + children = ( + 8C50732B384812714B891BA829DE4545 /* Implementation */, + 6538E984FDA41A6FCB0F4698E512B75F /* Interface */, + 76A098F763A45CFB7EC84A32264C2322 /* Support Files */, + ); + name = "BoringSSL-GRPC"; + path = "BoringSSL-GRPC"; + sourceTree = ""; + }; + 439755DE3642ECFF605B146E62AF99ED /* Products */ = { + isa = PBXGroup; + children = ( + BF96B57ADE05E8909F823BDF6868B3E3 /* abseil */, + 514D7742C6CBB0BDBD9984AEE97DDFDE /* BoringSSL-GRPC */, + E2B63D462DB7F827C4B11FD51E4F8E2D /* FirebaseCore */, + 8CC9178C366942FD6FF6A115604EAD58 /* FirebaseCoreDiagnostics */, + 92000153CD73F7FC2DBAB4AB708269F3 /* FirebaseFirestore */, + 856B5CD56F194FAD26EA91620B66D614 /* GoogleDataTransport */, + B43874C6CBB50E7134FBEC24BABFE14F /* GoogleUtilities */, + 1911113E0FBF13CFF9132E5FF7685228 /* gRPC-C++ */, + 9C7C87B5D0A6752AFA2642F1BCA967A3 /* gRPC-C++-gRPCCertificates-Cpp */, + B471867C535B02FA55D87E260F6480F8 /* gRPC-Core */, + 0A9F46A999C47653013D3AD854352507 /* leveldb-library */, + 06FC5C9CF96D60C50FCD47D339C91951 /* nanopb */, + D502CDC0DFFBDC46C6A8B6E7B80B36B2 /* Pods-SaraAttended */, + 3347A1AB6546F0A3977529B8F199DC41 /* PromisesObjC */, + ); + name = Products; + sourceTree = ""; + }; + 45C75426F9CD2623D8F11FB654DA6A09 /* city */ = { + isa = PBXGroup; + children = ( + C0C6AEAD726718D6AD4F0C71E7E98FFE /* city.cc */, + D64598FEF74F6080B3AF85464C906927 /* city.h */, + ); + name = city; + sourceTree = ""; + }; + 469EA363EE5089EF58767C09C246548C /* types */ = { + isa = PBXGroup; + children = ( + E9D16D3006FF484C32B8BC7C22F7AA90 /* any */, + 97D71DCBD68E0F2B79DC495FA7372CFB /* bad_any_cast */, + 02C90D41DD4DBD075253E136DDFBB670 /* bad_any_cast_impl */, + 94B3DC7A873477C4E76B2F1BB5546F6C /* bad_optional_access */, + 2AD5E6DC842EB2DF01835DCF12ABF408 /* bad_variant_access */, + 5EC6DAF52EA1B2645E483418086E4121 /* compare */, + FB9ED122D571C9EBA247B7CA3A312ED1 /* optional */, + B05E198492A248813C6C912092CDE7FD /* span */, + 57FD41D1DEFC7AE99E623D8D99F1C6C9 /* variant */, + ); + name = types; + sourceTree = ""; + }; + 4AE63BD6C82A99AC4B4440197233A51F /* gRPC-Core */ = { + isa = PBXGroup; + children = ( + BA42DE5E189045EEE72C8050BFA74251 /* Implementation */, + C5037B88FB993AAA36765421F83ED445 /* Interface */, + FF8A42FC1DE09451533F742D61F3A17E /* Support Files */, + ); + name = "gRPC-Core"; + path = "gRPC-Core"; + sourceTree = ""; + }; + 4D8172204A79346B6AA221E1248FC5EB /* time */ = { + isa = PBXGroup; + children = ( + 6C6C330C425E31795232C0D7B760873E /* civil_time.cc */, + 41C3CC91C81D99B78AE2C88C52BA8008 /* civil_time.h */, + 71C90E2B37FD0C40CB7DCE9B35201228 /* clock.cc */, + 9B7EC5B5404862C8F432F69E173C4393 /* clock.h */, + B9EA3653E6FF20D4DDEFB9E91D53D9DA /* duration.cc */, + 8BD6BA7A02447C17B981A29DEC24BE90 /* format.cc */, + EAF81A6A3D2B449128E7B49128E989E6 /* get_current_time_chrono.inc */, + 22677551E226FF49A7D34AF0A337DFBE /* get_current_time_posix.inc */, + 2BFCCF5439408D90DFC33A3F6AC86FB4 /* time.cc */, + C88238DAA407FE576B2D439F35479F37 /* time.h */, + ); + name = time; + sourceTree = ""; + }; + 4F0CBBED16FBC96B29F81F6416E1B0C9 /* Support Files */ = { + isa = PBXGroup; + children = ( + B16DC2FA6A718298FC7B28C912E1FF65 /* GoogleUtilities.modulemap */, + 299FECDAA701F13AE58DB4ED4FF0B1DE /* GoogleUtilities-dummy.m */, + 0AD63ADDEDB529F0C8041E1D2590251C /* GoogleUtilities-Info.plist */, + 3CCB8E7B65E7C327D476A2F3C9373857 /* GoogleUtilities-umbrella.h */, + 3C5AB43C7FCCBEFB3E67FA4E22874F40 /* GoogleUtilities.debug.xcconfig */, + 59F75AF17377ECCE99C3B2A941C6000B /* GoogleUtilities.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/GoogleUtilities"; + sourceTree = ""; + }; + 5290BFA91EC90278A0B965E999C5DC40 /* kernel_timeout_internal */ = { + isa = PBXGroup; + children = ( + D9B6FE7617E920F054E9D6A3F426B1E3 /* kernel_timeout.h */, + ); + name = kernel_timeout_internal; + sourceTree = ""; + }; + 538882152676CE0CD6F64311C3C14C71 /* container_memory */ = { + isa = PBXGroup; + children = ( + D4905D6B3410A18BBF26BF84188C4329 /* container_memory.h */, + ); + name = container_memory; + sourceTree = ""; + }; + 548C7F9C4B8A4D0E7DB3C4AC212533FD /* type_traits */ = { + isa = PBXGroup; + children = ( + 2439C8F4E63DBAC7CB1F852ED86C6F3A /* type_traits.h */, + ); + name = type_traits; + sourceTree = ""; + }; + 56CD8DA596D402E0DC0A7CBB5A459EF7 /* periodic_sampler */ = { + isa = PBXGroup; + children = ( + 2C710C706A4C3B6C6658D73F068450C1 /* periodic_sampler.cc */, + 2AF41BCD737855422A8E60BDEBFEB02C /* periodic_sampler.h */, + ); + name = periodic_sampler; + sourceTree = ""; + }; + 57FD41D1DEFC7AE99E623D8D99F1C6C9 /* variant */ = { + isa = PBXGroup; + children = ( + 1D0606A8EF843A5D0FB70E85489D5E25 /* variant.h */, + FE8E4DD22025DFEB1D8911FBAF47F6E2 /* variant.h */, + ); + name = variant; + sourceTree = ""; + }; + 585CCDFB0E77E7B26214EA291C0F70CA /* container */ = { + isa = PBXGroup; + children = ( + 93DEB4FAB9AE3DF791E5E7007329BD99 /* container.h */, + ); + name = container; + sourceTree = ""; + }; + 5CE7001675D5E151780DB5F07BAC6AA2 /* common */ = { + isa = PBXGroup; + children = ( + 9778EE1B2F9B8EF00AF2A8AFEFD2188F /* common.h */, + ); + name = common; + sourceTree = ""; + }; + 5E36A7856261EC09CE82E81D550F9173 /* raw_logging_internal */ = { + isa = PBXGroup; + children = ( + 6D836625861FE1C9A1C5237A5802F7C3 /* raw_logging.cc */, + 255AEAD212B44C00052AD62866F4ADB3 /* raw_logging.h */, + ); + name = raw_logging_internal; + sourceTree = ""; + }; + 5EC6DAF52EA1B2645E483418086E4121 /* compare */ = { + isa = PBXGroup; + children = ( + 494B5FDC07A2EAFAF88CEAAFC0064DE1 /* compare.h */, + ); + name = compare; + sourceTree = ""; + }; + 60B7FAB223750B879F44D7175AD9FCAE /* fixed_array */ = { + isa = PBXGroup; + children = ( + 931599781BE22AE7AFAA7F464416FB40 /* fixed_array.h */, + ); + name = fixed_array; + sourceTree = ""; + }; + 63225B394096F9E6AFA4A778D044DC81 /* Support Files */ = { + isa = PBXGroup; + children = ( + DF68626A4FE4D88AE160D648CE2CAD3C /* PromisesObjC.modulemap */, + 1D5B741F0EBFBD9401F861844A3FD767 /* PromisesObjC-dummy.m */, + A35FBE92AF8F9C94C802F54EC774AB25 /* PromisesObjC-Info.plist */, + CCABD3D5279855E5536DE3F2F51E31F2 /* PromisesObjC-umbrella.h */, + EEB12961B525825CEE242B485D541413 /* PromisesObjC.debug.xcconfig */, + DD71B32B40DD93411ED7C8A55A8D6D34 /* PromisesObjC.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/PromisesObjC"; + sourceTree = ""; + }; + 6538E984FDA41A6FCB0F4698E512B75F /* Interface */ = { + isa = PBXGroup; + children = ( + 85FEB2491ED23AABC904F7B1B658C7D8 /* aead.h */, + 67D9D789AF50B525348AACCFC44B20BF /* aes.h */, + B2B7493C81A4B6F855A3AD8B76C5B7DA /* arm_arch.h */, + C8E2BCA63656E9197EE81C9058A4DB6E /* asn1.h */, + D6EF0BB4DA976434B6D51415B2012DC2 /* asn1_mac.h */, + 2155A84DEC3E9F9E032992F56BFAECCC /* asn1t.h */, + ED016E10EA5F97BF30488BAC657CF05D /* base.h */, + 18FCC60BBDEE8D35E75391A4ACD3E958 /* base64.h */, + 773BC85B9BFF5AA58D3976A4F30674F3 /* bio.h */, + AD596FCBFCD9AB42760D5ECAC6D676B5 /* blowfish.h */, + BDD36E0AD59593429CEEDA4EA237E1C9 /* bn.h */, + 14B40745DACF97BCF26AF8FBF36B9130 /* buf.h */, + 9710FFE0600759BFF531DB88EA62873E /* buffer.h */, + 60FD395ACC387DC13902992C7F82FDA0 /* bytestring.h */, + F5C999832105B5B01F81A701E0276CE9 /* cast.h */, + 6B752E2CCB34395E74669198882CFD10 /* chacha.h */, + 4215984B22861EEE66F7975BC8826B61 /* cipher.h */, + AE7C373BBF03293FB30EDAD11BC6CE5A /* cmac.h */, + 5518FAF1F576E58EFB99A2A9F0E62AE2 /* conf.h */, + 199C2D16BC8EFB980FAE08F606AB3076 /* cpu.h */, + BEB75104005D644894B0A870CA28013A /* crypto.h */, + D86FBD5BDD257F3C8038BB216C9388EA /* curve25519.h */, + A38F042B47380D89B412DD983F8133E1 /* des.h */, + 6E153D3704EB930D7B97C84C5022DE5C /* dh.h */, + 940C94CA3A6B8836C7377E1BED8EFB97 /* digest.h */, + 1A6629A5097D67C07858B93A17D9373E /* dsa.h */, + E2836E8E06B07FFD41230B3CE181EF44 /* dtls1.h */, + 1F9342B69F768D5869D7C73F050EC77F /* e_os2.h */, + D08A7E6F91DB7B01CF0FEAEE5AD4DDBB /* ec.h */, + 0CF5062BDF551F333806FBA6E0156D7A /* ec_key.h */, + C8EA44397F063036809B8B994F31CBF2 /* ecdh.h */, + 6332265BA97DCBAEEB18C2BEBD8BBEA5 /* ecdsa.h */, + FA2294EED77B3BE132FAF4BB8565B349 /* engine.h */, + DD0EAF650079CBA4866283FA3ACAE404 /* err.h */, + 1FA9B0F489506D839E54613F8FF2A6A2 /* evp.h */, + C3A968949A80360C1905158D071E4C1C /* ex_data.h */, + 2EB9BAE1BBC76D9C11855FE834FAC8FE /* hkdf.h */, + E4B37E0CF180870E481A1720691A8F3F /* hmac.h */, + F7229CBE896CDFA77D31D55CFF1D039B /* hrss.h */, + E29D3A11FCE715E06A78E2168353C130 /* is_boringssl.h */, + CC7367D782DD81E4576FF29B43CE2581 /* lhash.h */, + 6B7D195ACE05E7761FEB1D1D191CEF73 /* md4.h */, + 575F8E5E4BEA92C01819BC7BE61B4344 /* md5.h */, + B85C1607FF9B70FE3F5E9976FFC0A4C0 /* mem.h */, + A8057155076411DB6A73027FD64C60AB /* nid.h */, + 257CBA6F049DDC229362A2266A940B20 /* obj.h */, + D9C6A04D472A4D24C7D78EE9F581CE8C /* obj_mac.h */, + 2409A5B27F02D276DE2D4E8F87D00B1D /* objects.h */, + C1176295495A9747C0B9B9B03E9A680B /* opensslconf.h */, + D594189E2BF6247FB7E86C7671B2BEBC /* opensslv.h */, + 4C959F6F19FC96C3E56B0C86325687B0 /* ossl_typ.h */, + E3805AFA476B3217C1F1BF3D044E927A /* pem.h */, + B6D1BEDC0AC9B722D8F9D332675C97D7 /* pkcs12.h */, + B90B89D30EE6628A3B9CD306B66CBCEB /* pkcs7.h */, + E02D2539BC68BCE4F8E801127350935E /* pkcs8.h */, + A7650560AD12323E976A0A5CFA6457C1 /* poly1305.h */, + 0F0E6F94588A9EDAB64D05FFCD82679A /* pool.h */, + 0F50FB8D47C280191AF4BDC5ACBDC7E0 /* rand.h */, + 7B4769859D5231F4C0D6C91D8186CEF9 /* rc4.h */, + A4299A26608CC95F9C409DAE53B183C5 /* ripemd.h */, + F653C2BE231542EF8F210F9C18A07B32 /* rsa.h */, + B9DDFD2DB55AACAB93FA58F91DB2B0CA /* safestack.h */, + C49DD1E3E8979A79261C335076E29E97 /* sha.h */, + 255CC353C5FDA6CA1E8E6417A72A7530 /* siphash.h */, + 3D57E2123FA0697547374E39991A2107 /* span.h */, + 7665E9702E0012EA9C42C224EADAE12B /* srtp.h */, + 9C292CBE769708DE151C297EEB3CA295 /* ssl.h */, + 08DCCB69B5BFD3F4C4237AF9FECE56BD /* ssl3.h */, + 232F344E78212307EEB43DE166DFB1E9 /* stack.h */, + 8F609D6FB2C573ED1D71736277080C20 /* thread.h */, + 900C43A5291423E98AC6EC97FA688DCB /* tls1.h */, + 29B00A4F43EA93179CD4C8102ECB5083 /* type_check.h */, + 2BA61E1B16406097B9C59D176E6870A2 /* umbrella.h */, + 71621132FB49E588ABD9206CE29BA54E /* x509.h */, + BE1A5CA112680CAD15A50AA9C9C144F5 /* x509_vfy.h */, + 518BCC9BA5A8A2E47689691FB7BC8DD9 /* x509v3.h */, + ); + name = Interface; + sourceTree = ""; + }; + 662A94AD3A4F4CF90BE8788D19441353 /* container */ = { + isa = PBXGroup; + children = ( + 5CE7001675D5E151780DB5F07BAC6AA2 /* common */, + BDD635F87C763AC309D11AA57BB1B732 /* compressed_tuple */, + 538882152676CE0CD6F64311C3C14C71 /* container_memory */, + 60B7FAB223750B879F44D7175AD9FCAE /* fixed_array */, + 3CD15DEF0B586D3862BDE29DDADB1084 /* flat_hash_map */, + 9AD55D01BBAB9DAF1B487F770B8937C2 /* hash_function_defaults */, + BC023050BFA67CFD42A39AE2FE870EEC /* hash_policy_traits */, + 186DDEAE61CA17D9293EB278704FCAAB /* hashtable_debug_hooks */, + AA9B3F080D135581F21260A03E4ED668 /* hashtablez_sampler */, + A8FB169E62490CC696F99CFFFB12631B /* have_sse */, + F1050939A7F0EE4D959AC4CE612AC6EC /* inlined_vector */, + F73382804F05CDB6149EDFF05BA05F5E /* inlined_vector_internal */, + 076B1809423AFCF4A216124D4A667B3A /* layout */, + FE487DC52B396DDF56665B55FB88037A /* raw_hash_map */, + 6EA62D450FF481263EF61B88348130CE /* raw_hash_set */, + ); + name = container; + sourceTree = ""; + }; + 68E34F3C837665DF77598253F99545AC /* algorithm */ = { + isa = PBXGroup; + children = ( + AE1359C345CC543613DB3E7BB88B5B55 /* algorithm */, + 585CCDFB0E77E7B26214EA291C0F70CA /* container */, + ); + name = algorithm; + sourceTree = ""; + }; + 6C11BB9DBDF14477FB9E3ED07EC7ADE2 /* GoogleUtilities */ = { + isa = PBXGroup; + children = ( + 09A8703F39C4E6858BE4CE6518865556 /* Environment */, + 013E9038AFEFB3345FA3E635F87744A1 /* Logger */, + 4F0CBBED16FBC96B29F81F6416E1B0C9 /* Support Files */, + ); + name = GoogleUtilities; + path = GoogleUtilities; + sourceTree = ""; + }; + 6CEC13665E4BC45E0F76084115FB0A77 /* civil_time */ = { + isa = PBXGroup; + children = ( + 66E112BD27CF895BC81D63432C53B66D /* civil_time.h */, + 62B71C9C57019F50FA4651A091504ADD /* civil_time_detail.cc */, + 8875E9D3E11A77D985AFF88AD7F3E264 /* civil_time_detail.h */, + ); + name = civil_time; + sourceTree = ""; + }; + 6DBF2C9F78ACDAD654AA615D830F9AB8 /* abseil */ = { + isa = PBXGroup; + children = ( + 68E34F3C837665DF77598253F99545AC /* algorithm */, + 7FE54FFE7A61798D2B4CF14A7D1B86A0 /* base */, + 662A94AD3A4F4CF90BE8788D19441353 /* container */, + 08263F0FAE744D6E41A791615160DD09 /* debugging */, + E4F8963B67B506BAEC545BDEC815CFB4 /* hash */, + 246B475EF001D8342F0ED45B50EEAFE0 /* memory */, + 0F27B24C5E536899D13F43FCF3B3B7DF /* meta */, + 2685DE990CDBDE92F88507D93DC19E89 /* numeric */, + 9A2D7F6108A9F22E2DCB1484DD1A176F /* strings */, + 0558F799111E92C44DD89FB6AC9D20DE /* Support Files */, + 15A08647C1F8D7490E2E6DEA9B29B161 /* synchronization */, + 0D20F09AC47E6A8AD4590AEFDCC6539F /* time */, + 469EA363EE5089EF58767C09C246548C /* types */, + 281B2074745D2844D49917019E5D7150 /* utility */, + ); + name = abseil; + path = abseil; + sourceTree = ""; + }; + 6EA62D450FF481263EF61B88348130CE /* raw_hash_set */ = { + isa = PBXGroup; + children = ( + 801E5CBA2EEDBB1637FD98EEED2AA2FA /* raw_hash_set.cc */, + 136878A10D9ED347E2C7570C52ECAA3E /* raw_hash_set.h */, + ); + name = raw_hash_set; + sourceTree = ""; + }; + 70906D5CC2B4114C69DA7B4F738CE089 /* debugging_internal */ = { + isa = PBXGroup; + children = ( + 3DE4A2600B80B995AFA6EB97FF19584D /* address_is_readable.cc */, + 8E759C57EA1F07CB3B2FA315AC1D51E3 /* address_is_readable.h */, + B4F6D9254808BDD5802369E8000BBCE0 /* elf_mem_image.cc */, + DA62D6A2A16FF788F79064DE2907302E /* elf_mem_image.h */, + 2BB47F23464FF6E8ABA7D7611B408883 /* vdso_support.cc */, + 57E9B635D0E7623DDA13073D9549921C /* vdso_support.h */, + ); + name = debugging_internal; + sourceTree = ""; + }; + 718B18634B5419EE7AE0AD54955D8FE4 /* time_zone */ = { + isa = PBXGroup; + children = ( + 181FF250BA35C4FEF7D372ED4506EAE6 /* time_zone.h */, + B7E98F1151263F1582E44733EC665B35 /* time_zone_fixed.cc */, + 7FA59C12BFEBBCE17D29BBE9163CE881 /* time_zone_fixed.h */, + 4ACAB14168EBA607BB36A3359A4A23CA /* time_zone_format.cc */, + A94F5E13A79FEA609854601CF6FEFF37 /* time_zone_if.cc */, + 602E6064F0F2EB38B769534FFEA856CA /* time_zone_if.h */, + 739DBC173EB03342F3CD5A61230BC090 /* time_zone_impl.cc */, + 017527197F417982A48F54CAB5BE1B53 /* time_zone_impl.h */, + A20C926E01A3071F5ACB1EBCF09A2FF7 /* time_zone_info.cc */, + 24F531CD79C0BC6E4272574162F46F7B /* time_zone_info.h */, + 1D7D38F399F8DC28719939770D74A131 /* time_zone_libc.cc */, + A7E47917B5D3B3625D08295A98F25F54 /* time_zone_libc.h */, + 19DDEFE91BF33977306BFC06B66E0BD8 /* time_zone_lookup.cc */, + 8F6CB7668BBE5735E516AA275AAC13F4 /* time_zone_posix.cc */, + 09C3C84EC1B221EB2D8C3E9EC0F80F54 /* time_zone_posix.h */, + D77AA049CC87EB804FA5BD66030A1CA5 /* tzfile.h */, + 4A8A2CDF6BEB3571DC25A01CCB30A869 /* zone_info_source.cc */, + 1ECD6207B8EAA5C8AAC66053669DF5C6 /* zone_info_source.h */, + ); + name = time_zone; + sourceTree = ""; + }; + 76A098F763A45CFB7EC84A32264C2322 /* Support Files */ = { + isa = PBXGroup; + children = ( + 69D76D6502361D626C231350D623585A /* BoringSSL-GRPC.modulemap */, + DC02B323251C05AE29CD677621010DCA /* BoringSSL-GRPC-dummy.m */, + 9A6779861EE647D79AA9DE2D37153AF2 /* BoringSSL-GRPC-Info.plist */, + 89D948E74EED8DE4CAECEBC82CCBE3FD /* BoringSSL-GRPC-prefix.pch */, + 5E08D3E6EEA1333970EB56302AF3E883 /* BoringSSL-GRPC.debug.xcconfig */, + A79B3210FDF394229768AED58FAEECBB /* BoringSSL-GRPC.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/BoringSSL-GRPC"; + sourceTree = ""; + }; + 772482FE0B3F976098F5CF7145C86AF8 /* symbolize */ = { + isa = PBXGroup; + children = ( + 85604F44CA83C0ED88AB459B44401B9E /* symbolize.cc */, + B46F0E4D4D1CAF33B69692A375C1CB8F /* symbolize.h */, + 5CCC5E5367E56F38BE20965915C41368 /* symbolize.h */, + BC0178DF14AC0D9F8CDA8D7FAF34524B /* symbolize_elf.inc */, + E821E862169B9C48AE0585E407F38613 /* symbolize_unimplemented.inc */, + CD6064577A74079D5FA2FF512B0DCA65 /* symbolize_win32.inc */, + ); + name = symbolize; + sourceTree = ""; + }; + 79224E812861CCEE4ADC7C508E4FA2CF /* endian */ = { + isa = PBXGroup; + children = ( + 6BF0D13350F25D402E034AA04E024241 /* endian.h */, + D1C06AFBB8E1E289E81583A7A7D7A627 /* unaligned_access.h */, + ); + name = endian; + sourceTree = ""; + }; + 7A4FAF415C89D6DC76C2E231A3D9228F /* Support Files */ = { + isa = PBXGroup; + children = ( + FA962D878266159C8CDFDCEFBC108D72 /* nanopb.modulemap */, + 0641ECD8129761440688E3F2FEF3D6E5 /* nanopb-dummy.m */, + 4E534C292BA659A547693A54D89C2852 /* nanopb-Info.plist */, + A6B9A1961056CF5678404B6DA4DCD7ED /* nanopb-prefix.pch */, + B58C221D6324649F211E8B4D296F6731 /* nanopb-umbrella.h */, + 6DC72CD345336EAF4EB59FE7F08DB0FB /* nanopb.debug.xcconfig */, + 66628993B3498B56A57E3D4494D15D14 /* nanopb.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/nanopb"; + sourceTree = ""; + }; + 7AB7573257B451968CB5F9ADF2A0D697 /* leveldb-library */ = { + isa = PBXGroup; + children = ( + FB9729F52D2DCA8DFE896C9262B90CA3 /* arena.cc */, + 943A303D5607C52627215987F26B043C /* arena.h */, + 5D6785BE81AE8168BC93D5294967FDB7 /* block.cc */, + 11E51A66F48CAC2C668DB4ED3F6F3D6C /* block.h */, + 6E47B545B0FD3ECE687598822590253E /* block_builder.cc */, + 7DF8C48F21446CE136BCDCD21F125F85 /* block_builder.h */, + F521DC622436B91DA4F8B69523B3515B /* bloom.cc */, + EF1E01436EB64D9F92375215FAB4E8FE /* builder.cc */, + BCAFFBCE88659266BA37FE7EC2FAABCA /* builder.h */, + DBF76DAC6129166C2DC38CA4C4AFC734 /* c.cc */, + 514E2C59522D6EB944CE7EC8CB687149 /* c.h */, + 708794D61C44B97FC187ED209D1EB8FE /* cache.cc */, + 62CFB0424987A30330ADCB83E81CCCBE /* cache.h */, + 251C8F835383CBFEBF8FC7DD51F74D6B /* coding.cc */, + A0B311BDF6F71B474574F2B941CD1980 /* coding.h */, + 084F54054980956409809817A9185C0D /* comparator.cc */, + 99F3C52BCD05EBFA3D648E038A0A31CA /* comparator.h */, + 56128B9E72A3BDB53287DCFF002BEAB8 /* crc32c.cc */, + 3B6CDB868D356BD0A3C52A5D9FC12118 /* crc32c.h */, + A449BAF74875449A62888CB039B14F40 /* db.h */, + 2204BD7D50BCDA31A2F94496C0395B94 /* db_impl.cc */, + D9E38398FEDEF6BFD1228500AB255FB3 /* db_impl.h */, + 331ED7D8710CC1001B80D4D19BC211E4 /* db_iter.cc */, + DBD7AFE202CDCF4E8B889D9F9EB131F0 /* db_iter.h */, + ADF34D14D6CD78F4F7FD92EC0A9BD0D8 /* dbformat.cc */, + FAFF8B74EDD34A5975FAF06BFC522FCE /* dbformat.h */, + 3F292AF18FA858FCD857A193543E4F14 /* dumpfile.cc */, + 9308446BF8719953240026D5E0D0165C /* dumpfile.h */, + D3F9A84A6A27BF8FFEE704209E95F1F8 /* env.cc */, + 2FE71EFE1211CCDBACA64EADB156F322 /* env.h */, + 035B185447B62AA82940A376F12AB1CB /* env_posix.cc */, + 0F31BD1CE7C0CE2046B3695252F4CED7 /* env_posix_test_helper.h */, + 6C3EB4A0566A8607AD43E870FFDE536A /* env_windows_test_helper.h */, + 8254CFF2C7E0B6547CF1CA30A9DF8BFB /* export.h */, + 902A21C0CD0071EC5F41B75D53F069F8 /* filename.cc */, + 4540C2059DE869A0A0A334D5001F1630 /* filename.h */, + BC461799E3B8B280DFD5984271BE0BFA /* filter_block.cc */, + A608E1DEC03C31D95C076F0D54638102 /* filter_block.h */, + D68E02F4EA431301782785D1E57DC3E8 /* filter_policy.cc */, + C7F138DC17DE54C2F2670836233F1D75 /* filter_policy.h */, + B9A8DB63C9E6BC478B02C6A286D5CC84 /* format.cc */, + 475B7F4FA0153A9211E99C94E981B8E4 /* format.h */, + EBF73FED0C4D64C0CEFCD8D20F5E93FD /* hash.cc */, + 424BA320A3592CC7617275117CC376DE /* hash.h */, + 995C01AA81C73AACABB486C7669C7F2B /* histogram.cc */, + 709C476ADF004340DE0E611411A3F682 /* histogram.h */, + 0043AE8C7FA93FC299669D57A4CCE2BF /* iterator.cc */, + F4B814B310FFE7E806C94D301234039A /* iterator.h */, + 0EBE87EE8373E4E916498CF6821365E2 /* iterator_wrapper.h */, + 91677845D4B364197BF2B44A290AD6D3 /* log_format.h */, + 2426A1FC6C09AE5B0FABD891B1DE922D /* log_reader.cc */, + 5D77F9B38F3D78B3C8617AF8195B5915 /* log_reader.h */, + F78B98CF571646B0BFC32DCBF279E904 /* log_writer.cc */, + 0997C996B2C913C986BAA2835C5C7003 /* log_writer.h */, + 5612F1A4C41C0FEEE7A43EF9BD4D16AD /* logging.cc */, + 81AD0A969365DC86D49B97CBAD3E8F76 /* logging.h */, + A045B03D292089864E80F033B4385B4F /* memtable.cc */, + 975D9514E31E8C56DDB203FBA1664BBE /* memtable.h */, + E2D650C523EEA29DAF171DEC4D83B300 /* merger.cc */, + B3BAA51471AAC8ADC53C24ED0797A1BE /* merger.h */, + 39426085DB1BB35CB175995B81EA8656 /* mutexlock.h */, + 4ED6D8ADC39B484F485E571BE759FD27 /* no_destructor.h */, + 8FCFA906BB703DD49BA7EE34935703F0 /* options.cc */, + CC3D4368692AC125461B76F60FC5AE5D /* options.h */, + 4F2A658368ACBCF2310386D030BB10C5 /* port.h */, + C212D56249A75AF324510228EA386D6D /* port_example.h */, + 57165CAEB8D8587D8856ABC4F7664C01 /* port_stdcxx.h */, + 392C741810C6A496B45E20AEA0FE691B /* posix_logger.h */, + 37D83BCA4B74EAA5091357A0E62C8824 /* random.h */, + 3DDF03DC9E76B9A50571A15F51739E5B /* repair.cc */, + F4BB3C36D3E8DC8855C64F2DE77F9A8E /* skiplist.h */, + F2B8A6485EC0A2B8CF2107C23FF00A37 /* slice.h */, + 7BD3F0B6294C4ADB164D918CC624806E /* snapshot.h */, + 82724BD93847DB1AB3C0ED9BACF9AF3F /* status.cc */, + 3A8908A9F38FEE3653A71C8CF6AA706A /* status.h */, + E3CAFBE093EF332BAEE26FD8CFAD2AE3 /* table.cc */, + 69B86306FF6FC7BDD21B76BAB4F8AE48 /* table.h */, + 7D8D6088A70D6AB4121D10AC4DABF491 /* table_builder.cc */, + 3845EED97A182E92F5B9534F992CD436 /* table_builder.h */, + 0DBFD9D17999435BA54AA000357CF297 /* table_cache.cc */, + 93343EAF5E6FE24CA9CFF6ABE1740D01 /* table_cache.h */, + B76BA64695FE756F1CEBFD90E1C045F6 /* testharness.cc */, + 3A40E153D6CF41878799159B14580A7D /* testharness.h */, + DF1AD777D71E91FEF582D0621D7D3DC8 /* testutil.h */, + B88479DDF08A5793854D3A5C6CC7B955 /* thread_annotations.h */, + 38341EF01EBCAA31235B83E4B61B51A6 /* two_level_iterator.cc */, + A6250A505B1D7CFDAE15D9D0B6DF6EB4 /* two_level_iterator.h */, + 7969673FA84BC8675583230DEE78B5B0 /* version_edit.cc */, + B8B945C4CE0702A4E4C559461E487786 /* version_edit.h */, + 46D15B24712B14D26DB149630599A386 /* version_set.cc */, + 73D31A0931A92A36F9CC4E6DB9D6AC7F /* version_set.h */, + 4D73A5F99FD2ABE54446CCEC00A50062 /* windows_logger.h */, + 24644CF4B9DBFC240B3FBF7A07EADC6F /* write_batch.cc */, + F63FB24E85F74BF90CADE18BB83D1BA3 /* write_batch.h */, + 4DF43BFDCDC776BB52EE90CFA9A9C009 /* write_batch_internal.h */, + 40CD3849D6F096E2972FC5D59BF7E602 /* Support Files */, + ); + name = "leveldb-library"; + path = "leveldb-library"; + sourceTree = ""; + }; + 7F35613C4F4E3108C57604900BCBC3F8 /* iOS */ = { + isa = PBXGroup; + children = ( + FC8F412BEDA9A3CA749A252C7357A3E8 /* CoreTelephony.framework */, + 8EE307E136B53B452E84DF514986145B /* Foundation.framework */, + 8464DF14361766A9E158A6E361BF2886 /* Security.framework */, + 1365595CD3433AA406454C412F9B6F48 /* SystemConfiguration.framework */, + 1DC7DB6E71A31FD235556787BA8ADF4E /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 7FE54FFE7A61798D2B4CF14A7D1B86A0 /* base */ = { + isa = PBXGroup; + children = ( + DE092D0628429258285ABE53510A8FA1 /* atomic_hook */, + 8D324C10E4F916A76C2C0D5F637CA40A /* base */, + E2E37E9FEE4CF7E3868C20C21F40540A /* base_internal */, + A41FCFAF3ABAF83DE4E6F50E1A24B358 /* bits */, + A91BCD50AA774C4C602D3CA14BE35318 /* config */, + FD632C9E2B39CD620ADE88B8AF131ECE /* core_headers */, + F2387C3761A43F10BEA64709A9214B2B /* dynamic_annotations */, + 79224E812861CCEE4ADC7C508E4FA2CF /* endian */, + E23D31C33D137CD43A19EC7698822131 /* errno_saver */, + C6C004B0DC6EAAE923BFBE64A591EA9E /* exponential_biased */, + 14DC1589B7D9B9B331E11CB4EC7D57DC /* log_severity */, + B8C22FCFCB1615CE1B19B6A0A6F1CFAB /* malloc_internal */, + 56CD8DA596D402E0DC0A7CBB5A459EF7 /* periodic_sampler */, + 050AF11DB791AE5E41C37878CE0A0AF0 /* pretty_function */, + 5E36A7856261EC09CE82E81D550F9173 /* raw_logging_internal */, + 9B5E6B972216A99F96BDC8FC7C10BEA2 /* spinlock_wait */, + 1DC6020303DDD04FEEBC692365AEFB6B /* throw_delegate */, + ); + name = base; + sourceTree = ""; + }; + 826427820F6A921738EC4C57647D01DF /* PromisesObjC */ = { + isa = PBXGroup; + children = ( + 6A664B7F32C368F559FC343E0895B515 /* FBLPromise.h */, + 352D58AC7499CDFD2FD08B146E797B6F /* FBLPromise.m */, + DDEB5E4FE0768AEF991D265861A9C550 /* FBLPromise+All.h */, + 2DB11948F88B998DA11F5993B19FED1A /* FBLPromise+All.m */, + 0EDF1E0017A317E9F67DE924DD9EB0EF /* FBLPromise+Always.h */, + 0E00718B57B591507B2647430447DA7A /* FBLPromise+Always.m */, + 35A7BD8BA5AF8D5B5D3A7A66AC545324 /* FBLPromise+Any.h */, + 5C65B3BC901262AF531DBC49307EFCFD /* FBLPromise+Any.m */, + F6E08C93F5F2F4F59EE7B367B27393A9 /* FBLPromise+Async.h */, + 729EF04CBBC30ED9447DDF4D3FFF6009 /* FBLPromise+Async.m */, + D089363314634F4CE0918ABB0AD2197B /* FBLPromise+Await.h */, + DBF18FCBC8E01220189F13FD470FE4A3 /* FBLPromise+Await.m */, + 8B1FD4A85E64A8BA3121F8DCCED3AC75 /* FBLPromise+Catch.h */, + B45E5F9037A62FCA03DF871EADF52926 /* FBLPromise+Catch.m */, + A0652A8506B00EC0855B4E63F59C3509 /* FBLPromise+Delay.h */, + 12581C1A84F6E01443F65CECD59698AE /* FBLPromise+Delay.m */, + 78B799C5CD60EF0F2A8DAD61EDD7C304 /* FBLPromise+Do.h */, + FB7C74D862C77160C47225BDF2192058 /* FBLPromise+Do.m */, + 109216868B5292A6CC5C2D7CB5C1A515 /* FBLPromise+Race.h */, + 8864C298C949190986138E5DA22979B1 /* FBLPromise+Race.m */, + BD394E2AA9A6F3C1611A9250512A6320 /* FBLPromise+Recover.h */, + C8F9C45FE872D6F4C3B5FCB43ECE638C /* FBLPromise+Recover.m */, + 7664DD245795DEFDE12568838F32FBD7 /* FBLPromise+Reduce.h */, + 4FF22BA39780F38686297704E9D7D2DA /* FBLPromise+Reduce.m */, + 22F00BA2A6D7DC421EE71DB8F625BE28 /* FBLPromise+Retry.h */, + 217E26ED82FF7D4D3EDF083AD0FEECDD /* FBLPromise+Retry.m */, + 5F18E7687A7A6D07648D7178E09B2455 /* FBLPromise+Testing.h */, + AFB72065C305200D4EACB28F35716EB7 /* FBLPromise+Testing.m */, + C7AD1CB86D9A9880C6B6C26A5250ED61 /* FBLPromise+Then.h */, + 044B747742E07C2B1C0BEBF2FDDE7748 /* FBLPromise+Then.m */, + A705B5E2F23E918976FBD98D3A8110B1 /* FBLPromise+Timeout.h */, + 0F92C9CD287154E896E3E8DC83B0EC56 /* FBLPromise+Timeout.m */, + A086B484D96840E954EB167A0B8532DB /* FBLPromise+Validate.h */, + 56946162EAC440276805FE8F569C7181 /* FBLPromise+Validate.m */, + 13A71F4B2C9BAD681CB1B1B737BC68BB /* FBLPromise+Wrap.h */, + 41FB36346D7717A550141E0230ED56AE /* FBLPromise+Wrap.m */, + 4992652E6E36FA640AE080039A589DE5 /* FBLPromiseError.h */, + 0FEA1F6131B8B62CF6F75405F9197BA3 /* FBLPromiseError.m */, + A1124CC7D776FC3C0C380D7F944BA169 /* FBLPromisePrivate.h */, + 5B072266F91315365F609A1AD22E0851 /* FBLPromises.h */, + 63225B394096F9E6AFA4A778D044DC81 /* Support Files */, + ); + name = PromisesObjC; + path = PromisesObjC; + sourceTree = ""; + }; + 8BFC7BA216D6563AA47A64C9C6BFF6DF /* FirebaseCore */ = { + isa = PBXGroup; + children = ( + C3483A9E757721D4A9C8A9839154EA6B /* FIRAnalyticsConfiguration.h */, + 9E40E56CAA644830047C7CF84C5B8D78 /* FIRAnalyticsConfiguration.m */, + 44A87C5EA5B4275B0CB816C231A79303 /* FIRApp.h */, + 0E89C89E8C625140A3984B2D73DA107F /* FIRApp.m */, + 53841BC6166418C9ABD7280C47B2F7FF /* FIRAppAssociationRegistration.h */, + C02F3C374771C1823618EC8DD2F40674 /* FIRAppAssociationRegistration.m */, + 4D6115E6A018F3CBC8D219F1BCC5CB93 /* FIRAppInternal.h */, + EBCDEE91D7C5C9EE0735903AE801AA77 /* FIRBundleUtil.h */, + 263E8B399A92FFC41F51FC5A7A9C50BE /* FIRBundleUtil.m */, + 5337A65C10583FAF2537A6BE2B0D285C /* FIRComponent.h */, + 32A01EB067D0B2AB3D4ABDB0980C0EAD /* FIRComponent.m */, + DC4B38404A30E1CAFBB8301529C267E3 /* FIRComponentContainer.h */, + A031B0E03D3060C46E493AEC9CA16E70 /* FIRComponentContainer.m */, + 7F20603543688FE7E0F7E0D499F90045 /* FIRComponentContainerInternal.h */, + CC6069A09DEAE7C6F305E4D73F80A306 /* FIRComponentType.h */, + E6B18A381307DB711369991B38B1CB66 /* FIRComponentType.m */, + 6E501AABE0F34BBD4BA9A5709A3F2402 /* FIRConfiguration.h */, + 93A3A27DE44CC98212BFEAEEC8370E4E /* FIRConfiguration.m */, + 363650DAA6C5D3C6FA491B0B1432A1CD /* FIRConfigurationInternal.h */, + 02A356512AC6468A0C53864D1C9ACD6E /* FIRCoreDiagnosticsConnector.h */, + F3FDF10D0635517E0F667DCBA8134560 /* FIRCoreDiagnosticsConnector.m */, + 43D4D184E1E29A6B73E0E27B1C87C6FC /* FIRCoreDiagnosticsData.h */, + F90E070CF9B63F98769A73192FA5B2B5 /* FIRCoreDiagnosticsInterop.h */, + 1BD99431D13A0200B9E86F6240B59422 /* FIRDependency.h */, + 86B2907AE026FB981D8504EF0B529FD5 /* FIRDependency.m */, + E77D560378F569278A48673B196FC763 /* FIRDiagnosticsData.h */, + 82954EE9A25E2F2FCAE05D9C23D21A7A /* FIRDiagnosticsData.m */, + 420A2D2A6930523849B70B9C3348A4DB /* FirebaseCore.h */, + 844B32EF2F526691F84CCD70FFC79797 /* FirebaseCoreInternal.h */, + 64AAFB0D2AA6500F624DDED98A40ED6D /* FIRFirebaseUserAgent.h */, + 13F469255EB9E102CEA1699F96F7D4EA /* FIRFirebaseUserAgent.m */, + 4DAFC643797D95E0605BE608B76B2B51 /* FIRHeartbeatInfo.h */, + 51EABC598FE1CA74FD6A098E118FC6D7 /* FIRHeartbeatInfo.m */, + 70E37422BC5C235944D781B14FFFAB1D /* FIRLibrary.h */, + 59B49F118C6CE5A72F34DEC83533A761 /* FIRLogger.h */, + D623F8E0554C2BB582285E8E379C0EDF /* FIRLogger.m */, + DA4E9CB337C3571E4A00E47B8DAA971F /* FIRLoggerLevel.h */, + 1E255EDEAAE074BC8A3A7DF9AFA841DD /* FIROptions.h */, + 3C50E5CAB53FFB09E1D1629A07D1781D /* FIROptions.m */, + F9EE2F1683A930FBADA8100E120A0F8B /* FIROptionsInternal.h */, + 004389D24BC022DC6B69A7925CCF7007 /* FIRVersion.h */, + C45ECDECA1CC685F920E3086D10E4331 /* FIRVersion.m */, + 910C0BE9A277CDABD11A0C7705D11587 /* Support Files */, + ); + name = FirebaseCore; + path = FirebaseCore; + sourceTree = ""; + }; + 8C50732B384812714B891BA829DE4545 /* Implementation */ = { + isa = PBXGroup; + children = ( + D5D64F2A0790105676B48B1D27A00ACD /* a_bitstr.c */, + 99726721863184562E197B43DF83EB89 /* a_bool.c */, + 7F14E9F77AAA2F88330E0F2606B3603B /* a_d2i_fp.c */, + 9094F3703EDFC96E4658D133A7A6BE13 /* a_digest.c */, + 613A9258307623D8B2A315EB50668550 /* a_dup.c */, + E59707D59AE75973A10A4FEB4B5EE371 /* a_enum.c */, + 469F2002D2586FCFFD3B4A6AFE915109 /* a_gentm.c */, + E52E34E0DCE9C7D5FC1DB65A3342BEE8 /* a_i2d_fp.c */, + 05613D12F20BED5782E8F875D6060479 /* a_int.c */, + 2A3BC1CF9DBF45DB55787D9AF672FBF4 /* a_mbstr.c */, + D4EE741B74BE076658425875860FA9F4 /* a_object.c */, + 0FAA93E4A8212CC7532F3B1A494F11AE /* a_octet.c */, + 0F1F0DD0EDFBD2742BB0D955A0BB9E99 /* a_print.c */, + 3D2AD666A64B37FD6370853C72E35A12 /* a_sign.c */, + D92626F4FC960755F6FB8693856C3BF1 /* a_strex.c */, + B0C14C713BF221471AEA7527F926779E /* a_strnid.c */, + 2911A43369133CA2F34E4EA3EBC8E405 /* a_time.c */, + 82E5DE088CB05468F250C8633566A51B /* a_type.c */, + C1F38D55C8E30A661DE2C27721FD3E20 /* a_utctm.c */, + 3E52B8C90E0E8705D6658CF6414BF091 /* a_utf8.c */, + 4F9B0ADF610133D2CEF1CFA4A1562583 /* a_verify.c */, + 3BB3BC1F21E682BF978F9996DF5BFE15 /* add.c */, + F92BEB79CBC9CB9796C9FB11A01DEE2E /* aead.c */, + 72A32A4BF6281371B497549A499A9F2F /* aes.c */, + BD284FC7A814576CC2BFD9A571D2F3AB /* aes_nohw.c */, + 646531900ED79B672D00A847C224AA29 /* algorithm.c */, + 50A491CEE1281637FF354DA1FB129D38 /* asn1_compat.c */, + 223991F82BCFCC63339443E3FF0C40A8 /* asn1_gen.c */, + 001B4B27E14395D35EB3A1B598BF9543 /* asn1_lib.c */, + B90753262908732447133E9EB7EA9133 /* asn1_locl.h */, + 59FDA70766A600F09B7EC7EA98A17C66 /* asn1_par.c */, + AB5BB29561CE011CEAE5A3BC8BF4E97A /* asn_pack.c */, + B85CE4D725A04808B8CCED68C7A34233 /* base64.c */, + 1C93B1A77D72BBDB26A32F49BDB8B4FB /* ber.c */, + 955D62C0782FABCD4654EAC0D9FC3DC8 /* bio.c */, + 913AB50B1D427BBFFEC3573E5A05D701 /* bio_mem.c */, + 8D56C137E519B6142CA42469541BC972 /* bio_ssl.cc */, + 1E954268BF933F68C3F91B0409388140 /* blinding.c */, + B9A7671B2DB654BDC0949E6996270A31 /* bn.c */, + B5E960B51CE1E30ED7C3E4C9A96A4D18 /* bn_asn1.c */, + 36A53D2CC1DF53FDE70A9D9EC834FDF7 /* buf.c */, + BF4DF5A173FFDBE5D81916F40C6097C3 /* by_dir.c */, + 0D51483FE296BC1F22031B12790E17B5 /* by_file.c */, + AA21EE8C05E8EB4D0FFC5B450C03C314 /* bytes.c */, + 8DF85470DB4C77C87BB99B22F4B60E17 /* cbb.c */, + AA033B2B30F2E8AC153AEBE867BFF34D /* cbc.c */, + 01086C47DF75801EE8C1B2CC9E8E533A /* cbs.c */, + 75433E6919E72CC5C0D95F85797BAE15 /* cfb.c */, + 17FCD7FD56BC613FCE058FA35C6C15EC /* chacha.c */, + 0DA9DE01C62DC239C2D784F936B2E920 /* charmap.h */, + 80E0C8984F1B7F9983C944D5DFAF80CC /* check.c */, + AD939B0974B0C1A66C77AFC21CD3F9F1 /* cipher.c */, + 3C1A95744898955B4278B82F42B2B4EA /* cipher_extra.c */, + 097F3D8E54B939EEF18E0CCD09DD902B /* cmac.c */, + 143A2E98EA9EAD3D307032D159B0D048 /* cmp.c */, + 166601B1F74E89BE8E2BB88DECF1CF50 /* conf.c */, + 01A4CD2489007A624F5F90B257E700F2 /* conf_def.h */, + E6C88DEC6DE3D2A3B1C8889940473042 /* connect.c */, + 11AB1B2817C84F8D1973E8D153CFBC4B /* const_amd64.h */, + 8863A0A2EEE3B9B8D719AA20A04F1242 /* convert.c */, + BAB8A844CC9BF67B2CE40DF3AE15D905 /* cpu-aarch64-fuchsia.c */, + 5430FC95560439093E2D2C2BB90FC129 /* cpu-aarch64-linux.c */, + 91FDF7608AA718C54E5B66DC6F3D0A55 /* cpu-arm.c */, + 2F43F0B5079B8BAD3706850C3E9D3EEE /* cpu-arm-linux.c */, + 1D86999284262D6577D93238FE6260A5 /* cpu-arm-linux.h */, + 7AEC4A4833E5091B3CDD7E1815A8690F /* cpu-intel.c */, + D193F3BE2E8E8EFAC3608999076B70CA /* cpu-ppc64le.c */, + 1B7D1949E7E90565475A743D32EE903B /* crypto.c */, + 20B273A2295F73FF06123CBA6D8ACA13 /* ctr.c */, + EE84E888FEEE2D71B13B1A9E66211639 /* ctrdrbg.c */, + 67B1D45B38111E8D1DA3BE14CB613724 /* ctx.c */, + 99871DF08627BB0875ABC7F34BA94E76 /* curve25519.c */, + 4708BD44EC5A216E24FB4E52DD3D392F /* curve25519_32.h */, + 49CCF8A64C5BDB15A5BF1062196A5959 /* curve25519_64.h */, + 0618EF3D922942AB0599F423215BB750 /* curve25519_tables.h */, + D880CF6F56DD4727366742B101439716 /* d1_both.cc */, + 69D84BC6F7EFC75BD6AE7026624BF864 /* d1_lib.cc */, + 54CEC49A03FA699140C9622FF53874E8 /* d1_pkt.cc */, + 7D56DE1BC949B4B4F93C71C452A035AF /* d1_srtp.cc */, + 0B169F793DB8E2AB80E258594851EB38 /* delocate.h */, + FB06D2711AA1B749D921BE1C430B49FB /* derive_key.c */, + A408DB590FC2671D29D819A5E0AFC244 /* des.c */, + 655A1BD52011D79F025D1B3061703200 /* deterministic.c */, + 6B6D2709F7503E18DF89C3C065E47A05 /* dh.c */, + F9A85A218694BC0C65B81F0C0B7DA4D9 /* dh_asn1.c */, + D66DB317CC4C4F2F6AE85A0942F38184 /* digest.c */, + 709254F04C66D296E8D367733E1EEFF1 /* digest_extra.c */, + 9F1A12C64E72845D4AE3E7E75AF41A9F /* digests.c */, + EBE55BC5EBBA67AC56DD26829E6EB0E4 /* digestsign.c */, + AA66DFD8E5E6CCC24E2C6AC53B722682 /* div.c */, + A18BB1AA798E12F9EBFFE675EADB83DE /* div_extra.c */, + B0B733DF6CFFB65C25C263B74B0773AB /* dsa.c */, + 3182A7D0F280665F541697E482D7D137 /* dsa_asn1.c */, + 410135060F6A6677272AF2FB06EDDA70 /* dtls_method.cc */, + BED497979D5401D5008955BBAC0949D5 /* dtls_record.cc */, + DDD44762A45E687EB93D355143E47EA7 /* e_aes.c */, + 2719DE982895D28FF4FEB2206C2A9646 /* e_aesccm.c */, + 98C1ABA8FF18B7C09F06BAC17BBC2B2A /* e_aesctrhmac.c */, + 269E3AD42CD40C891900549025DFC7A0 /* e_aesgcmsiv.c */, + 150E9E06EA4173D1E8E4CC4E52E93959 /* e_chacha20poly1305.c */, + B3105A65AA18D123210C1BEF70CD091C /* e_des.c */, + CA9AB38A79694A5AE631AB1CE594D504 /* e_null.c */, + E66A5423448C896D6AFCFD5C09748865 /* e_rc2.c */, + 1378E88D1012BCD79A53F91672210C39 /* e_rc4.c */, + 24F14E626FFBBFEC7C46434448CBE7B2 /* e_tls.c */, + D85289894E8862DBDB54E67174956DFB /* ec.c */, + E15CF7FDB27C66EFBE8FE47724E53215 /* ec_asn1.c */, + 04F0FBFE524EED058041C4F427768BF4 /* ec_derive.c */, + DC90F532DA9136A5AC68A9A55471B52B /* ec_key.c */, + B6870D211B012015250AB07F1337686E /* ec_montgomery.c */, + FBFF04262559F8569FCD36F3791128BA /* ecdh.c */, + C4F26573BCE94BD7C3312652A786CA78 /* ecdh_extra.c */, + 1DAB72662E83D1D1061C16A3EAA3FB92 /* ecdsa.c */, + C5BAE0EF410BB567EEB31BEFF337A9A5 /* ecdsa_asn1.c */, + 85A14766BA2D6B6486854D6FCF02E73A /* engine.c */, + 6DD2340A293A98A49C1B9EE8423845EB /* err.c */, + 6CF41C3CCD8ECFABDD0D40690DEA0917 /* err_data.c */, + E39297772AD13E7BC8092FD5912A045F /* evp.c */, + 4E1B19D1B778FB9E04A9A994382EC36A /* evp_asn1.c */, + 3E2CF3C56CC98E70074D3B03C6080C02 /* evp_ctx.c */, + 3C39DBB52327F16A36B4F665B0D14B93 /* ex_data.c */, + 9B888E1B9AB8866C4959554B1EFE4D64 /* exponentiation.c */, + DB86A54D31A9A3098C237DA9706417D5 /* ext_dat.h */, + 6DAAB579BC114D3C3501C5FE3F75C6F9 /* f_enum.c */, + 786D44E350C930D4AC1EAE0FABDF28E8 /* f_int.c */, + F3ED5BBA5A5E9C3BECF3DDFC42052963 /* f_string.c */, + 31A087031ADDE1AF7880A8A86D0C7F41 /* fd.c */, + BFB71B3499C2B7952DC2380E28AC26DA /* felem.c */, + 40E596A03BD27031C6B1374D6CBB1865 /* file.c */, + 1E87B6AA70EF3C7303B6A13AE63EFD35 /* fips_shared_support.c */, + 93196289CE749EA6B5354E9285A0C9DA /* forkunsafe.c */, + 3734870221525279DFF5056604225D14 /* fuchsia.c */, + 86EA1E2DF13B4C433704BBFE070A2689 /* gcd.c */, + E2F3610D3B40489699AC20C069E6D56B /* gcd_extra.c */, + 8B34C190B1DE501246389F79CFB5E4E9 /* gcm.c */, + ED30EEF89E3F26907A1A5C85DDF60A81 /* gcm_nohw.c */, + BD071376906792B6FE1F55E354D2C4D1 /* generic.c */, + 9F1259B1A2443FE3FDB39AAD4AAC3D08 /* handoff.cc */, + 25F1B5715D38B4B9E70CE4A49C87ACB3 /* handshake.cc */, + D152C0DC7DF8C5DB5241ECF7D290B257 /* handshake_client.cc */, + E286F7F35966B90C4AB25A4AF4E221BD /* handshake_server.cc */, + 2F391FE475FAE6B551A62DC96136EFE0 /* hexdump.c */, + B142F3998802B0C34B526C0D505C9898 /* hkdf.c */, + B837CFC74CD4A6D99F897281F8338977 /* hmac.c */, + 488C3EC97E91D717507401F44AFA326B /* hrss.c */, + EEDEAAE34E2DDD91998408BCFE50DB68 /* i2d_pr.c */, + 1F6828B80F8240092CA6683D028CD7FC /* internal.h */, + 262B6C334E2DA4182F6E05C1BE8E85E2 /* internal.h */, + D159E2C7037265BFA975BA6B8CE85CBC /* internal.h */, + 48E9690C8ED5EAEB257DB8919A2CE8AF /* internal.h */, + 3EFA29BE5456CD955C742714DF6E6DF7 /* internal.h */, + 2C19FA528F4AA9BB34521DF059BE8F87 /* internal.h */, + F744B7BCEF0EB94E5E6E6595DE737F7E /* internal.h */, + BDCCF92BB835F08D02294A95CF06E9A5 /* internal.h */, + F60E11FD666EBB2FB74FA667AAB716F1 /* internal.h */, + 525C9EB44877774F6C84793E5D9D5E1B /* internal.h */, + C7834BFC231D585EC48892D05C85A74F /* internal.h */, + 5E416B6FFF01C2016265C480E859A8D3 /* internal.h */, + BC745D065B51B818F70988028DFC89FA /* internal.h */, + B91C24609F1C744CA97FBEAA648F4388 /* internal.h */, + 88C2B6303463ECACF12ACE641E759FE6 /* internal.h */, + A7739F4D6C512681D9041B61D69A26EC /* internal.h */, + 5D1B4DC0068EB1EA0EE1ADB0F32EE0CF /* internal.h */, + 1FC5AA96F90F0E7EAE181267AF9455AE /* internal.h */, + A26EF50458271CA82806498A1533BF93 /* internal.h */, + C2EBEFC627CDE60001FD058D2F266910 /* internal.h */, + 4BC45A9314A6A47E4ED1ED2E268675EE /* internal.h */, + 6899F70129CBD04132766D607E5F51F4 /* internal.h */, + 0B844FFAE23F1A2B97CDDF8BF94985DB /* internal.h */, + 824DC6191395B2C833E1B6EBDCEE127A /* internal.h */, + 3ED4CEA481AA965C59ACC1C3661D9675 /* internal.h */, + 807D6B561A3D702B1D4139FF75965BC3 /* internal.h */, + 699DA49F293CA45ABB3014D681F33C16 /* internal.h */, + B5FEE16484BBD246D925229DB5F5312B /* internal.h */, + CEDC1AD9FCEC707B36616065392A2C1E /* internal.h */, + 7997A3E2D8595195C901B2D801DC79E0 /* is_fips.c */, + 651BF0816B4B332C18209C9BFCFCA837 /* jacobi.c */, + 7565456ED66C9F7AAB35CFF93C311B70 /* kdf.c */, + 8EA211AB1988BC9248B4ED12A148C236 /* key_wrap.c */, + BCA523D863485A1586D2C1DD6ACE89DF /* lhash.c */, + B9B3D3B27E959FE34D601455F52B8256 /* md32_common.h */, + BADEB8C599956CA2DD1F03F5D3F4849C /* md4.c */, + A9981EAD1F1A5E388F2921C166A3A170 /* md5.c */, + 0D42260DA44C5886C45DC8FB23001AF7 /* mem.c */, + 5580998A6B3829A4D28D26D312CAD55E /* mode_wrappers.c */, + 6C9B5D9EEFB195E52B8CC9B58A65F2E1 /* montgomery.c */, + 33A6F5624C52006F1ABD137D1400130D /* montgomery_inv.c */, + 49D0032E07F75A07B74B862502700F05 /* mul.c */, + 195AEE4ADE9068B38ED51FA939D87C63 /* obj.c */, + 0E7D461A18D00764A5DACAF2D942F288 /* obj_dat.h */, + 625C10D311F9BD8DE8B4E61153A7DE97 /* obj_xref.c */, + 78A85F747EBF50DEFA43E830EA297434 /* oct.c */, + A6102DCA3C36EB30A53C7CB4F1D02BAF /* ofb.c */, + A16F04ED2F2B3312349B5EBC21A0B79F /* p224-64.c */, + D1EF4642D948D1C40F1F27641F9E7E37 /* p256.c */, + 07404AAA8FCDAEDBD1B62A8D0B33961B /* p256-x86_64.c */, + C794B0701088F676E57A0A7CBF4989D0 /* p256-x86_64.h */, + 1CBF28415CBDA07BC4CE1F5A5A5649B5 /* p256-x86_64-table.h */, + 2C7EB7C367CFD848EA3481438FF18F81 /* p256_32.h */, + A3EB023FED87D37C6403299E876C3CAC /* p256_64.h */, + 6CAC5129540A400C728F8403246DA32E /* p5_pbev2.c */, + 9FEC41C1A808A39B9FF1840284BFB9E1 /* p_dsa_asn1.c */, + 1FEB0462FEAE9D1EA18E047F38534936 /* p_ec.c */, + EA2BB2CFA51B1AA7EAC1F4957188EBA0 /* p_ec_asn1.c */, + D200A2FA9E31C8BE63F72E2DEE095156 /* p_ed25519.c */, + E82C09DE196166D349EACD3D25D1E03F /* p_ed25519_asn1.c */, + 33401FADF018CD6DA51A59A0B30792E4 /* p_rsa.c */, + 17B92FC4A0648040FE501D4BE21C2471 /* p_rsa_asn1.c */, + 4B83A3D9C9B0C5A54EE3E4C557831D9F /* p_x25519.c */, + 1D249314DA46EA0731824E09C8639B82 /* p_x25519_asn1.c */, + 3D6642692ADA5BCA078E1B5ACDB08841 /* padding.c */, + 800E626DBE4ED7CB7F1761804AAFD80F /* pair.c */, + 964790B67114ECDCDA22E8BBFA1755B9 /* params.c */, + 781EBAF045EBF2F854241A062EB73645 /* pbkdf.c */, + 98A3DA4893A5A28934517CD32A000891 /* pcy_cache.c */, + 1B9B58DA180AA609B576969359D3334E /* pcy_data.c */, + 2B75DD07E543761371585696907AF45C /* pcy_int.h */, + 494466C1F3B2173F87F7A06D335021FC /* pcy_lib.c */, + 999CBC13F0A807304CD38B03830A7894 /* pcy_map.c */, + 8A083812C2D9429FC64452F44F8AE8A6 /* pcy_node.c */, + F6B76E8CA1120C3B37CD4E26737262BB /* pcy_tree.c */, + E0D32F565C9F2C24D6E6035EB3F967F5 /* pem_all.c */, + B2DC46681E437C1AD114E17C973D9F44 /* pem_info.c */, + A0868D0ECF4259B69353F0DBBF61B27A /* pem_lib.c */, + 98F512C481C464CA50062372843DF7F2 /* pem_oth.c */, + C1B7B714FB039D1AA506F7C651DDF88A /* pem_pk8.c */, + 2A77CDD8EB44C7CA82CCF26B37D7BE27 /* pem_pkey.c */, + 4F1767B8DEDAC5E0A9A1E40584567EFE /* pem_x509.c */, + E1BCF54E235E2B907E9A37FC7B860F4F /* pem_xaux.c */, + A4F490579130970808943F3F104248D0 /* pkcs7.c */, + 879DFADF4518007F490FA85EBB2C668C /* pkcs7_x509.c */, + 7BED3B9FF8A2A7FD773ECEB065FA95D9 /* pkcs8.c */, + 1941F9303703D6FA0C77BFA6EF6E5661 /* pkcs8_x509.c */, + F81C80955C2524D9403AACD52C08FF54 /* poly1305.c */, + FC0DE0D534542BBEAAAC40D5C26EC014 /* poly1305_arm.c */, + E2309ACF4E98F5608C035A4FD328AFA2 /* poly1305_vec.c */, + A466854894ED4D8DC61B11E610F3A953 /* polyval.c */, + 52AD23F2AB0C25B54942E69032F7E604 /* pool.c */, + F34E5FFCFEBE7E0E425CD673A997E4E3 /* prime.c */, + 705F9D7C25A4BC2347A81C6032FD0D00 /* print.c */, + A83F0196F20B53667FD9CA38AB6E3735 /* printf.c */, + 73ADC394E1256ACBFD87B2FD254B30E1 /* rand.c */, + A45B2607AB28FD02DDED58B5FC26BDB5 /* rand_extra.c */, + DB5F4B021E7BC12C31C22C7255A1A674 /* random.c */, + 3BD5C9FFD3CF5903ACEB28B80FA94E65 /* rc4.c */, + 654B3EA2BD33E3C5ADF4476821507BF5 /* refcount_c11.c */, + 00BF389E62959EE7F4358912718FA7C3 /* refcount_lock.c */, + 59DB88C88B95ECB02BC87A27D8EFF9B5 /* rsa.c */, + 81DB1ADA388DC2C495267B1FADF5CBB0 /* rsa_asn1.c */, + FAD8A7EF54472CECDA1234F4A0880196 /* rsa_impl.c */, + C17E933B460CB8BAD35A45C8547719B9 /* rsa_print.c */, + A6FD5677089EA9034D0A64FA02498BB3 /* rsa_pss.c */, + E695FD7B79E5C893CA67FDBADFF65588 /* rsaz_exp.c */, + 0049238C3E9AAC3BC661E86C89A71143 /* rsaz_exp.h */, + 9A9D24F6E60BB76D9760C11589422A5D /* s3_both.cc */, + EFA044295F1ED786E7CF33310154BA17 /* s3_lib.cc */, + 91F3433400AF48F6BEA7EB5CD4DAC985 /* s3_pkt.cc */, + 47B13EBE03D5CDA2C05768C5BA9179AB /* scalar.c */, + 43ACF272241767AE195CBA6DC6B6B948 /* scrypt.c */, + C6D0FECC069776402D0BFFD1768CE856 /* self_check.c */, + FF65EAC59A0CED510C1F98D3618BB018 /* sha1.c */, + B7500E416674A858D09E5A4B94CEAA0A /* sha1-altivec.c */, + 288DBFDA9FB3FEC039BF70EF6F28B4C1 /* sha256.c */, + 756A14A84A126F04022E146D1A67F7D4 /* sha512.c */, + 542B89F0F1ACA3CCA3440851F31ABAA6 /* shift.c */, + 4F8D6D110F13BC605F984AB7CD8D06FD /* sign.c */, + D7E2556CD95D3FE708E3FC27604B2746 /* simple.c */, + 740CB51E8F85611AE5DD5BED764EAC85 /* simple_mul.c */, + 346A4C827C53BEA56A4BB722158591F0 /* siphash.c */, + 7870BBB100B3256F9BD6409588891260 /* socket.c */, + B57AB9958C4CE358AC4E6EDFEEDFE12B /* socket_helper.c */, + F7D23F3C861BDA5EE61D19CB89AE8C05 /* spake25519.c */, + 838EE7D040CA97C0B0579B335E85DB63 /* sqrt.c */, + F88DFF4B603A25137FDF70CA3091492F /* ssl_aead_ctx.cc */, + 58AC4CB66FCA222DAF660FEF972FE3A1 /* ssl_asn1.cc */, + 440D5AA3C5AF9D2719E0389B236A7E02 /* ssl_buffer.cc */, + B3B094199D9B61EB18907CA55BFBD3A5 /* ssl_cert.cc */, + 824AF003EBE6F43313C49AA798BD7D1F /* ssl_cipher.cc */, + D5837A27CC19F7F275466C2AE31E8069 /* ssl_file.cc */, + 075A96ABA887F30E5F0B6E9694CF9973 /* ssl_key_share.cc */, + 0D96ACD4271830E830F4D07B4B8CE1ED /* ssl_lib.cc */, + 78D0B836F8CF7251827838B25BE7A18C /* ssl_privkey.cc */, + 6192ECC540B10D8E39942352FCDEF1CF /* ssl_session.cc */, + 475AF9819AB0CC06134DAEDA3DAF6A1A /* ssl_stat.cc */, + 94E35B5EEC049D9F53D098CB4A231CF7 /* ssl_transcript.cc */, + 542C4EF5C2D25D913A7482A7635E83CC /* ssl_versions.cc */, + 9F326A7AC42901733691D403D8CBFAD6 /* ssl_x509.cc */, + 0244701A5C8D5C5F14728AA23CAFE97C /* stack.c */, + B9D06E6C24606339788D0D52F834BAD9 /* t1_enc.cc */, + 3DBED362B4E9BDE07141BE65A5E463DE /* t1_lib.cc */, + 57B4458BF9F1A2D02C13CADB33FD9FA2 /* t_crl.c */, + 8D6B6C481B59F703670039972DB53612 /* t_req.c */, + 0D1F68BB0400FBA570B96E7B5D2F60BF /* t_x509.c */, + 9CC5FC1E25B7C3707B4A26A93C54D264 /* t_x509a.c */, + 9CDF8192762FC4FFDD9F39C6869B2CF5 /* tasn_dec.c */, + 6AF0EA46779A2ED3A8C590516EDAA051 /* tasn_enc.c */, + 2FF4343C8A0C8538837D09BF323823C5 /* tasn_fre.c */, + 2FAF69DC4853BE7B2EB671C87AC4FA0B /* tasn_new.c */, + 47459DDBD455E8EDC36BF6BE1A3096AF /* tasn_typ.c */, + FBD5D840A56881FA2FF3B1C64B9C7789 /* tasn_utl.c */, + 31F9594AAD58371E0A4E511067F71A4E /* thread.c */, + DF1CC2F0643A2BA93A0BA41DB9FB2E00 /* thread_none.c */, + 2E09442B1860709EF4832571B348711A /* thread_pthread.c */, + 048660E3AF6CB3E3B137F63962C883DB /* thread_win.c */, + 1E351D23705876BAF11CE8239D710C4B /* time_support.c */, + 52C8327E12F9D095F285A2CDAAB9ED4A /* tls13_both.cc */, + E75CCA19A437137880D71AC82C0A0331 /* tls13_client.cc */, + 2C3C51EC9AF65CDA9032057E9BB8210F /* tls13_enc.cc */, + CE89EE53BA730471669A24E6395BFFA3 /* tls13_server.cc */, + EABE052D4B7270F09C17282EAFB486BF /* tls_cbc.c */, + 650C424B1A5E114F2995FA11B7295D51 /* tls_method.cc */, + 00E091313428C8D72E21DB5C33C2C835 /* tls_record.cc */, + 92104BBBBFB6AF14462769ABCF4917BE /* unicode.c */, + 50A5D9A5D83F8A6CCD571DDCF2D31672 /* urandom.c */, + 46FDDEA68FAD2F4DBA7A5871269B0871 /* util.c */, + 3070FBAE52C0B169065DCF9C2616C3EB /* v3_akey.c */, + E75A1198CC49C1D9DAB88863F0BEC9F7 /* v3_akeya.c */, + 352208019ADCADE1E9569BE08E687469 /* v3_alt.c */, + 417A2789C4F23A37BDCE282162588D44 /* v3_bcons.c */, + 56CE689280D7E03B26BB86F56687B2B5 /* v3_bitst.c */, + 511AF504B3810F4058878C1F36AC6C54 /* v3_conf.c */, + A68AF0A8082B9569E0D7B07B411E00EF /* v3_cpols.c */, + B89455D4D5E651EC8A9E4F437F876E1E /* v3_crld.c */, + BE37AC01F35D68250437EA7364FBFDDB /* v3_enum.c */, + 9B82965517F26D32D39EB3EA2FAAF5B4 /* v3_extku.c */, + 279DEAFD43888FDDB4EA222B41151ED8 /* v3_genn.c */, + 922DDB80D137F08C2D27133906CC7FD7 /* v3_ia5.c */, + 17723983F89AC7CB351CA15DE6428311 /* v3_info.c */, + 5B47194B7BDA928B8060159E5985E3A0 /* v3_int.c */, + 817883CCBF46D67DDF23023B09E8DA08 /* v3_lib.c */, + 9933B495C16D5CED674CDFE5BB24FE0F /* v3_ncons.c */, + 162F6E1D07F1240CF5DF466527791599 /* v3_ocsp.c */, + 8D8A1B85D95A6C08C2FB1E546DCE0897 /* v3_pci.c */, + 54ED8DC48179740D4B09CD387DD75A80 /* v3_pcia.c */, + F449B073E2EB4910F6B47402D0C4F789 /* v3_pcons.c */, + 8CE8A7E1DAF671E45FCD30CEC4C03F3C /* v3_pku.c */, + AEEEEDC0BBB4927EDB158F6C26F19DF9 /* v3_pmaps.c */, + 713116C5F644A85F2280CD820ECD957E /* v3_prn.c */, + D216EA4523D5DEAE1AD0EEFB7D99689B /* v3_purp.c */, + 5B197D3F3E30BFE2DCA76A1594E9F681 /* v3_skey.c */, + 391691F3034C5352842FE2708CA898F0 /* v3_sxnet.c */, + 879D1DA6F99C4758AF4422AFC9DC4A14 /* v3_utl.c */, + D27AE3FF2855764C3712CB4D06D4752D /* vpm_int.h */, + E741729D5D64FB7C626170E7F325544E /* windows.c */, + 4834AE0EA0304B56E352D8F6C5FA074C /* wnaf.c */, + EEECD989879D7D11D823655F92D76BA3 /* x509.c */, + E197518A8B25A3D9600C9AC2028D695C /* x509_att.c */, + 9F8C09D90B9AA4B989B9CF45089A6EEC /* x509_cmp.c */, + 0662E898C6EC0861687AC029B9735D7C /* x509_d2.c */, + C26CB30253C7D28ED95B593D2D9F6B3E /* x509_def.c */, + 70F6E27CE4188CBD025613EA7DA63C37 /* x509_ext.c */, + A19B8FFA1AB568A7023B5B1F7D27D785 /* x509_lu.c */, + EC4B5BAEB7765FC73F6F5612C6F1E377 /* x509_obj.c */, + CA6A93BE4E01D3F7B894BD2A5342D8C3 /* x509_r2x.c */, + D11EBFFA09C9F4CDF0C75D36AD135ED1 /* x509_req.c */, + 37384569AA4C3DD68DC0C52D69C1FAAC /* x509_set.c */, + D6463500ED181ABC5E4A63EACE23447A /* x509_trs.c */, + 64C5AD682535D608A522A047798193A2 /* x509_txt.c */, + 687BA8868ECE122ED37C2197706D1E0C /* x509_v3.c */, + 8232A5190580C321ACD7B0B164990349 /* x509_vfy.c */, + 09254C0C340E781C6A07F83801A7CF59 /* x509_vpm.c */, + 4A6F04C0C1936C195A8E0877BBAC5E6E /* x509cset.c */, + 587A45D33DC5F9425E154A513740E58B /* x509name.c */, + 0C0E3894574E143BC94F0A74E990E5E1 /* x509rset.c */, + C6895E29EC353E27DBE7B52C43BE9D25 /* x509spki.c */, + 318C29D1AB28F79342E35099BACEED1F /* x86_64-gcc.c */, + 95EF6C798829EE2DC030C24819EE2298 /* x_algor.c */, + F9ECE3CC88DC5F9CF5590E4BECDAFF10 /* x_all.c */, + 88366B1CB2700DEA09298D9116E88222 /* x_attrib.c */, + 4082596820A859BB5CBB84F1AD6D52C6 /* x_crl.c */, + CF2A5FE548133BDB401A39ED658C5664 /* x_exten.c */, + 060F549530567FABD6EC369C1267D9C9 /* x_info.c */, + B72ABDC2AF0BBFF6ED51215689DBE3DC /* x_name.c */, + 6A721E00F65B4123EA521950AA41BCFD /* x_pkey.c */, + 117A19181C15DEAF6F81B5490A41D7C2 /* x_pubkey.c */, + 5CEE2544EAD92C850522C322F37533C1 /* x_req.c */, + 37440E46D2AC2369BB334D712A3F0604 /* x_sig.c */, + 89303FDAAD8DD96F373292A08440E650 /* x_spki.c */, + 991646968C4E012B3B30BAFFA98237A8 /* x_val.c */, + 098A69B3B723EFA42D46B66467717313 /* x_x509.c */, + 9F51EEAF8CD8D8FFA3580AD750842C63 /* x_x509a.c */, + ); + name = Implementation; + sourceTree = ""; + }; + 8C77C80DA05CFF4422243B5DEA748A45 /* Implementation */ = { + isa = PBXGroup; + children = ( + E60B72EF39955A076FC093D4B48EA276 /* accesslog.upb.h */, + 112C1E3B3A05AE0271459556AC54B570 /* address.upb.h */, + FF315A587D4F9A607150E883F693B0CE /* ads.upb.h */, + 5D47BF6740ACC4E9C63CFB5E44D4B227 /* alarm.cc */, + D86AF0433110A71F87D564547D2A1C44 /* algorithm_metadata.h */, + 471A162586C7439948EB848F7A00BF39 /* alloc.h */, + C93587944B54F3913789EA657E2C4742 /* alpn.h */, + A0BADFFC5D25B5F63F20F3D82BD3B61D /* alts_counter.h */, + 87E1EDC9D257A4A6ABD96CB40C8CB318 /* alts_credentials.h */, + 0EF9BAAC12070A8E68EC4747F69049BA /* alts_crypter.h */, + B5BBC219C766DE7677982303868AD116 /* alts_frame_protector.h */, + D2E5CA8009634153869F0DEE328F4657 /* alts_grpc_integrity_only_record_protocol.h */, + C043FAE2657D24268BEAC10297E6C5CE /* alts_grpc_privacy_integrity_record_protocol.h */, + 4A6402D7673B28ADD5BACFD6E7736EF8 /* alts_grpc_record_protocol.h */, + 68B912DFA803CCB2A18DE83D740612AF /* alts_grpc_record_protocol_common.h */, + C1A700116171DB2AAD92182ED70C2F4B /* alts_handshaker_client.h */, + 3AD14BFF02BA00FA4B3D8A5B2C96DF10 /* alts_iovec_record_protocol.h */, + 4A6BA8F1D6B4002E7BC3FABF863B280A /* alts_record_protocol_crypter_common.h */, + 989C399F3BCDD02547BB58C53307D5A8 /* alts_security_connector.h */, + 08A7440CFF031982570D78C193E1319E /* alts_shared_resource.h */, + 760B8EC06583C79A3F1830C4E17AE723 /* alts_tsi_handshaker.h */, + 602C5A4FFD45F80D69045E02EF581931 /* alts_tsi_handshaker_private.h */, + 9019873A1D8506818A39F7F4AF4BD0AD /* alts_tsi_utils.h */, + C9F016A74296D7C56C7C8BA613C59CF5 /* alts_zero_copy_grpc_protector.h */, + 5CB03E565CB23E05469C865350E8481E /* altscontext.upb.h */, + 6BC7A68EADA873C78CFE5C42DFD4997C /* annotations.upb.h */, + A0D9F94DC9B38464FEBB8B25D355C0E0 /* any.upb.h */, + 6AB2A5FD7F9BE7FDD0A2919849E6BA1D /* api_listener.upb.h */, + 1A1A42CF7B62E83F9CAB827668EC644B /* api_trace.h */, + ABAD5CF3B2F079651491304D130C2FEE /* arena.h */, + BED200068BA15F70BDAF41898196F81E /* arena.h */, + 4FB54186D0B4D570D66E19742CBB6FD4 /* async_generic_service.cc */, + 8545DCD9A87148D45FCF694311196747 /* atomic.h */, + 5636BE4349FD1A8E5FD081A5B1B0F2AC /* auth_filters.h */, + BEAB20D74799C10CD5D7FDCF954F7C7F /* auth_property_iterator.cc */, + 97978E8EF1E9A1C594B56600C302D6B7 /* authority.h */, + 51FB1A769C688D0A641D42290CEEB1C7 /* avl.h */, + F69BFBB91D7CF1A9E5B54FEBB922A452 /* b64.h */, + 8A530D16A35BA070587ECB2A518590E4 /* backend_metric.h */, + DB0487AF4DCC51991A674B6146F2B6E9 /* backoff.h */, + 43D4FD3CE529D5052F28E1CFF76AAD1C /* backup_poller.h */, + D9FBAE0517C65051B89AE153CFFD5FAC /* base.upb.h */, + 83FBF2ADBA37C6AE104DA0354C416D7A /* bdp_estimator.h */, + 6E2F7E0A38A3803B3D985992CF8E602D /* bin_decoder.h */, + E57016635083DC208B90EC4B2983319D /* bin_encoder.h */, + 23E0DB0568BF85488C2420F929509F7E /* block_annotate.h */, + 3BC4B11148B1D8E6011B1124EEBE2DAE /* buffer_list.h */, + D0B0558C216DF889DD5871BF99B38DC0 /* byte_buffer_cc.cc */, + 2F8DFB761F716328C8EACBF3AD1865B8 /* byte_stream.h */, + A1C8EAE3AB2E0EF5A563D19724B03017 /* call.h */, + 980DE03C57A327190CE7C575C4E5E831 /* call_combiner.h */, + D3A883C23B120624F2B440E7EC31025E /* call_test_only.h */, + C9E1D7CB8A6610A6119F02E31452F2A4 /* cds.upb.h */, + B2EEE88DF8265BD7966C655D0F1A8ADF /* cert.upb.h */, + A0375C1C408F48911C5A3719BE9D5F2B /* cfstream_handle.h */, + 3F5E7D4CCC09647D8B15C0FE1C6B8E8F /* channel.h */, + B118489EF3EF65E06D3BBD8008A80060 /* channel_args.h */, + 849846AEF2F51C4CB13E792477B368AC /* channel_argument_option.cc */, + D854607912E6D3CB08D767985CA1A442 /* channel_arguments.cc */, + F9281F782BB97E09594B037B5FD36366 /* channel_cc.cc */, + 5C76AAF707C9DCFD37E241EC010011B8 /* channel_filter.cc */, + 150114D1218D95652322D51EAA164063 /* channel_filter.h */, + C04B2099E2F95F4843121C72BCAE1329 /* channel_init.h */, + 3A3D937FB23127FB2863991631314588 /* channel_stack.h */, + 781D4A259EFEB08101C8818EE28E425B /* channel_stack_builder.h */, + 6E712B22330FB2E373E230870DE2E459 /* channel_stack_type.h */, + D611A40F8B6A2EF6FE12FC444F22469B /* channel_trace.h */, + E6368A41EF6D4F9F45FB7E08D37312FE /* channelz.h */, + 5650C58CEC45512D23502D6789F4656F /* channelz_registry.h */, + BF7A15CECB726366A97C598EAAD3BE36 /* check_gcp_environment.h */, + 6008611CEF4CB9DBD49DABAD59E11A8E /* child_policy_handler.h */, + 6A4DAD705DD68E9F9B4489DA7427A818 /* chttp2_connector.h */, + 4A479BD75DC8232A10102C9CF863F3B6 /* chttp2_server.h */, + B54562C4D96285F5ED299FB73E775591 /* chttp2_transport.h */, + E89C5F4718BD12CDB155016FF56F7DCA /* circuit_breaker.upb.h */, + BFF4010FDB9D10844BD2A963E431761F /* client_authority_filter.h */, + 7266059A56A9BAD00828F12817CFE1A8 /* client_channel.h */, + 2E3DAC5EF5EB9DD36C3EF7364F17FAD0 /* client_channel_channelz.h */, + D18D87A1DA3DB8521F4839C5D55DF080 /* client_channel_factory.h */, + 42E71288C15E81D916D729C6D0019521 /* client_context.cc */, + D25FA8EB0B342841E0C22257E2936BBD /* client_interceptor.cc */, + 3560DBCBDD820BA5A07FBA4DEE093344 /* client_load_reporting_filter.h */, + E9862CEE92E648371F72C157A5674BC1 /* closure.h */, + BE4E7E7FBE269A8D8925A4C2B7D3BD0A /* cluster.upb.h */, + 4B604EACDD1CC69A4D9074C6B9A40397 /* codegen_init.cc */, + AF22FBE9343697E005570E9F0B43BF4D /* combiner.h */, + D350394F4E41E95D5B38E70E61A66088 /* completion_queue.h */, + 4F695A271D87C982FCB797831B8C4A5B /* completion_queue_cc.cc */, + 3E947D92741F9D5F54ECF9711B73288A /* completion_queue_factory.h */, + 98ABB0B301CD275ACE88D40C1D5469A3 /* composite_credentials.h */, + 99DEC3F82F42B837EF03657BAAC60977 /* compression_args.h */, + 77E7EE0A12409EBE28A1E990CAF84B6C /* compression_internal.h */, + 14E4A19A16AF63A3B22B7B25B6D4B1A0 /* config_source.upb.h */, + 2DF8997B901EE96A89E8661A022BEC92 /* connected_channel.h */, + FB6EE78C78BD233BC52E5F669C8AFAE0 /* connectivity_state.h */, + 7073AB33F73D3CDCF28DF09E42E111FF /* connector.h */, + 8F9BB401AA3D1C784081723BDA924AF0 /* context.h */, + 560E9A1167F4EEF8C1F655734DFC88EF /* context_list.h */, + 0EE17ECFCDAAEA71E331B88DE3FD1D3C /* core_codegen.cc */, + 9D5214C90DB7BDE9D0FC93E06B024787 /* core_codegen.h */, + 4328B8C23D84342B8BF117B78402199F /* create_channel.cc */, + CD805EFC5439762E359FE90670D50C81 /* create_channel_internal.cc */, + A8BD8CB1C3DD033EF22C73BBD7F4D064 /* create_channel_internal.h */, + 44651260A080C7B0ED2C0D690EC8E8EA /* create_channel_posix.cc */, + 46EEC2499CB5F5F370F0179032F4BEAB /* create_default_thread_pool.cc */, + DB80A2BB852ED1EF4798DC5BCEC10C9E /* credentials.h */, + 1D5898EA9800D5CEA0298805255D87E6 /* credentials_cc.cc */, + 0989B29C0D36FEAAC9D3493CAF8910D3 /* custom_tag.upb.h */, + 532F31967448B9FCDD457AC17BEAC2BE /* deadline_filter.h */, + 5A7F1F93DF989DA34F744C4EB2B4A362 /* debug_location.h */, + AA63CC21607F5F59C9A89C589E497A4C /* decode.h */, + EAAB62C6FD33409AD7699DB614014C4B /* default_health_check_service.cc */, + EE4D8F5ED0B55EA104AFE2858B9ABD92 /* default_health_check_service.h */, + 4E0F85E01AC964655BCE72E2314B9B7A /* deprecation.upb.h */, + 361B5F1184D2461D8A0CE4F6C0620787 /* descriptor.upb.h */, + B6EA6E949BB67E282815367289D96D73 /* discovery.upb.h */, + 0105331323361FB6B77031C4D88C0928 /* dns_resolver_selection.h */, + 3CCEB77F18F4584631BA806547F5BCE6 /* duration.upb.h */, + CFA5EB10BD9E4552ECAFEBB2189AD2C2 /* dynamic_annotations.h */, + 5680DD2CE8D36A8B0DDFDACC0CCD8CF9 /* dynamic_thread_pool.cc */, + AA6CD30588C39DABF9AF0A185DBD2A3B /* dynamic_thread_pool.h */, + 6BB92693CCC64385D2FF6431D7890F1E /* eds.upb.h */, + 52D04F00250DA3B85F9DFF84A81E710D /* empty.upb.h */, + 7C1153C3709FD9A3F88D22CA47AC1150 /* encode.h */, + BC6DF4B32899D322F74979AD7AD18FAF /* endpoint.h */, + 01FF4609D5497521C83F7CF4D937FC90 /* endpoint.upb.h */, + B2A24D4743A89B8E7D48AB0715175498 /* endpoint.upb.h */, + 2ED5D8708E746EEAAA8F20FA079BE5B4 /* endpoint_cfstream.h */, + 387F772EEEAFE9929148A598D14E6E96 /* endpoint_components.upb.h */, + C8F580082C4E97246CBB58D8E9E5043D /* endpoint_pair.h */, + 0BF940D079EE26182F7A3B8DCCCB06B1 /* env.h */, + DA3CBF62666DA5577546703BEC34B76D /* error.h */, + 65D3A127F85D259EFFB75179FF5D1CE5 /* error_cfstream.h */, + 03802921213BD6AF75F8E23379BD49FE /* error_internal.h */, + 7ADA79FF6900CC9538575985CA827E5D /* error_utils.h */, + 6CA902355FCDD4D7425028F7FAA3C440 /* ev_epoll1_linux.h */, + 54B00FA0E63AB41FCAB76B9D4296A785 /* ev_epollex_linux.h */, + DBEE52BED394D61CA0C646C0C4DE1453 /* ev_poll_posix.h */, + 853299A1FB498B3CC03E06CFB16D1343 /* ev_posix.h */, + 79F4076575012C7494D398ABBEC45A18 /* event_string.h */, + 1FF01779B0EF8214DF6D4B5F0C4166F0 /* eventmanager_libuv.h */, + DB0CFE7A7ADD0167599DDCCD40326A48 /* exec_ctx.h */, + 8934264C38A2DDF44C859974DDF76E4A /* executor.h */, + 3D1CFAB531E01148681292263B67973F /* external_connection_acceptor_impl.cc */, + CCAB8392092C9D2B149B03DE38E1F51E /* external_connection_acceptor_impl.h */, + B34D89A7C532C51A510254029B3BFEB5 /* fake_credentials.h */, + 74687F981785848CF193542E9D404CB9 /* fake_resolver.h */, + F833DA52F02D691022D829A74BE58ADE /* fake_security_connector.h */, + 753C0EF261CDDE6C75C21DABB832BB16 /* fake_transport_security.h */, + BF491B7EC78D49D1C61B2B007A52FA85 /* filter.upb.h */, + 7E28F5EE7EBCCD7499F26B97589268F2 /* flow_control.h */, + C44A9673099B2584D7099AFAB608672A /* fork.h */, + A8B544BF694C29E4C478D06008B63316 /* format_request.h */, + 7B5E392FE59043AAD544555ABE745D5E /* frame.h */, + 0E4DC2D66EA32923CDD238BE04DF37C4 /* frame_data.h */, + 75746EB8FB15F347875401786A1E5DA2 /* frame_goaway.h */, + A2487D73586BB044B7A6D3BAE481FC73 /* frame_handler.h */, + 20697784672ED522459F591E8032AACF /* frame_ping.h */, + D2BEEF4FD18F0E39C9A0892573CB698E /* frame_rst_stream.h */, + 8BE76444A49FA1615624EAE8A8FE1EBD /* frame_settings.h */, + 96F3D1CA3C848558BEB297E24ABC3B92 /* frame_window_update.h */, + 52F81BD932E7877CF6129978D9768500 /* generated_util.h */, + B58036161C7A30DF610470F176CC308B /* gethostname.h */, + 53EB4885FA802E30127217CAF0C6E262 /* global_config.h */, + BB6F9EAE8F8836E40C9E2A82CC169BF0 /* global_config_custom.h */, + C4F94046AF98C1F7AE234D6D8EB3C3F6 /* global_config_env.h */, + 9FC3305A5F3D8A40C5B58619C09FA24C /* global_config_generic.h */, + 5D6302406E4AA0DF6A3C104B521ECBE9 /* global_subchannel_pool.h */, + 26EBD07C8C7DAB33CC752704958D1957 /* gogo.upb.h */, + 030013C730D65D48EA49BA6310252C9B /* google_default_credentials.h */, + 6BDAB9FA4CD49F8B5ED138AB95764BF7 /* grpc_alts_credentials_options.h */, + F5F14D9C982BF07F9C6C55C9B0365D54 /* grpc_ares_ev_driver.h */, + AA46FC2EF94E9F5572BD914C67BAD5C0 /* grpc_ares_wrapper.h */, + C62DCF6C8D4E7CA9AFA7D2DB579020D5 /* grpc_if_nametoindex.h */, + 5B55226C83EA202B83BDB45C3DBF7D4C /* grpc_service.upb.h */, + E3B8ABDAC044FF0BCE343A472CE5A753 /* grpc_shadow_boringssl.h */, + 5AB2E69E5DB61D8356BFEA7C7E53BA43 /* grpc_tls_credentials_options.h */, + D51158DEA1DC70A7141E4DA7BB36FF1C /* grpclb.h */, + 536FAD0A306763D48380064D60D93127 /* grpclb_channel.h */, + C748D5F0B1DB94E7F4C21469C988B672 /* grpclb_client_stats.h */, + 1107EFDD6A3279A099DDB015C5AB4A4F /* gsec.h */, + C890CAD79CB25BC6F37D1A02E532AF00 /* handshaker.h */, + A056D6984CC86A443DF3C5AC42C7471B /* handshaker.upb.h */, + 45979CB70BBD7D08B85AD8EBF2E94BF7 /* handshaker_factory.h */, + 955633B7DC07D0A78D93BAEB2A94CA07 /* handshaker_registry.h */, + 7D410CF41A7E0B4E07C0FD7ACBF5CD79 /* health.upb.h */, + EBF17CB71417B5B4D8A6ED7BD00FD13F /* health_check.upb.h */, + 3C2CFE7651B561BB6CFA7CC9B15F63E9 /* health_check_client.h */, + DA57813EC2D1D105BD0FCCDF156303C2 /* health_check_service.cc */, + 4EF388BD65063707AE61C66938C357D2 /* health_check_service_server_builder_option.cc */, + 591AE1DA172C6929AB0FBCE60B206124 /* host_port.h */, + 43CE1AC53A26F98B286ED83375EE2FF0 /* hpack_encoder.h */, + 70C105943F6DB6E5BDA3DBBE29104B3F /* hpack_parser.h */, + 43C7929F6E2F822270B483898A8BE789 /* hpack_table.h */, + 7956807588DE8229B949A946CCD498BE /* http.upb.h */, + 2830D2781CAA1B007DC5605D679ED3D6 /* http.upb.h */, + 7B3A25BF47C9C8ABB7FF4323152EFAA8 /* http2_errors.h */, + D98715D72C5137C628810E8610CF3585 /* http2_settings.h */, + E69164375A0446840DC6CE7CC664846F /* http_client_filter.h */, + 19DE7AEA92884D5BCBC9C064503A29D4 /* http_connect_handshaker.h */, + 00C8BD1B52446E60AC16BC271D818BEB /* http_connection_manager.upb.h */, + E859BF67F2B48F487375961E73FB867A /* http_proxy.h */, + F32757B213FB20E73CCC0158CCFD6F3B /* http_server_filter.h */, + 85E4D776F4BAFAC065AFBFBFF6EE4B69 /* http_uri.upb.h */, + 3CE9C39D8AAEE53FEACB1EB019C72DBB /* httpcli.h */, + 0D5C4C195972E9AD4EB8FA8CB1C17854 /* huffsyms.h */, + 79B0271B775AEAE70F68A6C7694DA390 /* iam_credentials.h */, + 7D2D7144CD2FBB31B0573D211A5F8DE0 /* incoming_metadata.h */, + 4FF14D280C4F0FA3B55181E7ACB9FF8B /* init.h */, + CCB747D28B7C26F8522289F57BE54380 /* inlined_vector.h */, + 280C16391AAF3C3CCD571AEF613E0CDE /* inproc_transport.h */, + B70BAEFB69553AC1D005302F44AB61AD /* insecure_credentials.cc */, + 1F06B79D5DBAB6A2F2D6769F942634F5 /* insecure_server_credentials.cc */, + 4A3F7B0603946255579608E98726D52B /* internal.h */, + 3B6D0B6124F9D512DADEE6AAEA03DE4B /* internal_errqueue.h */, + 2970A316BF1BFE4C0942C083FC524E8C /* iocp_windows.h */, + 451140231B672DF6F7631B009CE8478D /* iomgr.h */, + 3E6BC9EEF879320F15924D807E0674A1 /* iomgr_custom.h */, + 39A5254AF0CAFA22B443D30475E677E8 /* iomgr_internal.h */, + 905EF31577DFDD0EE1E8AA78E7BA4BA5 /* iomgr_posix.h */, + 8BB144CDCE0996B1EB850A6F510E0DB9 /* is_epollexclusive_available.h */, + 3CC5E1FB0AA9C874CC63E06F1FBD9270 /* json.h */, + 19DFA2FEF180F5A3402EE13F91773035 /* json_token.h */, + 13D524A4B27B0C18EFF8A6A2A0928068 /* json_util.h */, + 063EF7B4806888581BA77122A4F21388 /* jwt_credentials.h */, + F35E1EA461D38B6A27DBB8E856036967 /* jwt_verifier.h */, + A6FC36BA9BDB68998B65C9C65B7D60C4 /* lame_client.h */, + 6CBFCA714C8EEB4F70F7C99676C4B0B5 /* lb_policy.h */, + 783E4528C1488C1E5B5AC3E05CF493CC /* lb_policy_factory.h */, + 18E2773333D37D79898DCF455DF4463D /* lb_policy_registry.h */, + 91FAA086DC2883346DE8C42D4CF7DD34 /* lds.upb.h */, + 690260ACFC781EF1E784DEE2C6C603D8 /* listener.upb.h */, + B0ADA63A8AF80A28367FA30360B70EDB /* listener.upb.h */, + CDD3D92FD7CCA0707DD1333F8A1B2A44 /* listener_components.upb.h */, + 877F80FE844F159AEB3712C281F3441A /* load_balancer.upb.h */, + 5877DD34B3544A592E2E4FBC1D5DCAD0 /* load_balancer_api.h */, + B3FBDC6FBFF8BE3F070CE1482F5D70E2 /* load_file.h */, + A18FF02CBC9822154D65D9BC978A31C8 /* load_report.upb.h */, + 99D1B1F2635C0B5AA5221EB976A3B24F /* load_system_roots.h */, + 3DE46C3FB48C77001FC457A97887CA79 /* load_system_roots_linux.h */, + 3D9DEE9D0A3229B90F0043F9BFF1EB4A /* local_credentials.h */, + DCAD43C85B8298C22ECAFD9BE46C7619 /* local_security_connector.h */, + AA991AE54067FB100A899C5178166E7C /* local_subchannel_pool.h */, + 20BE36670AF41FEAC19EF9286FC4AD7A /* local_transport_security.h */, + F0B7573BE70B3E29B5D33B4E021A4B55 /* lockfree_event.h */, + 2945D010CD334A1E33FD25A3BEF30B31 /* lrs.upb.h */, + 96C4105852CD35C3281318D5271463CC /* manual_constructor.h */, + 3ACDAA76599D5B821934B1EBF93B36C8 /* map.h */, + 5DEACF4A3D6CF15D0970F294F8570372 /* max_age_filter.h */, + 8E93DF14EB4CE3B818C6A74286397264 /* memory.h */, + 9C417DDF359FFC9262AD9A311ECFFB65 /* message_compress.h */, + F7115F78FC67D382EC6862E32A909784 /* message_compress_filter.h */, + 32EB43B068040C2D345B6965A4E33D03 /* message_size_filter.h */, + E1C12A97E173016FDB1AB399B0574C41 /* metadata.h */, + 6D4912D20507EF01C5F95D28A1023B18 /* metadata.upb.h */, + 06AEA9EBB3AE752155C0F57EA283BCA5 /* metadata_batch.h */, + 87111EA4F321503D9A46A671CA8D5A34 /* migrate.upb.h */, + 7722679195318B384A72A867C5E3EAB0 /* mpmcqueue.h */, + 933637D73C2E0FBF376FDD7CAD50516C /* mpscq.h */, + DF811445B1994FEC29D209515B12871B /* msg.h */, + 9C5299A5EA2E3D8DFA6E4A0A512D2621 /* murmur_hash.h */, + FD84F7B7BE1474B065538076FF17D61C /* nameser.h */, + 4FAB7538814660A314E9C038CE70E37B /* oauth2_credentials.h */, + BA6ABD04387D25D5D76CB8B541694A7C /* optional.h */, + 74C8974B3B902E1EFB8E33E52DC21979 /* orca_load_report.upb.h */, + 3952840104A502E94C594E0BDB896FC0 /* orphanable.h */, + 3FF6EA6F5C09355903F15F5CDF0EB9EC /* outlier_detection.upb.h */, + FE2A5512BD4BBDBF9D6B47B95AB122DC /* parse_address.h */, + 0235052BB9836B27F86FB4973F07B20E /* parser.h */, + 7ECF9171AD5E45786ECEE9F91D9B2092 /* percent.upb.h */, + 7C6BA9D63B2C822DB021273F3CF14AD6 /* percent_encoding.h */, + 16EB7C7D422AC2646E0FBC639CB66C91 /* pid_controller.h */, + 10D5C776E0A1441020B19E29959E688C /* plugin_credentials.h */, + F3EF455CA17E8E84151728C5E5636789 /* polling_entity.h */, + 1AC1BE10FC1DF8BCDE29E6F5C12E10D8 /* pollset.h */, + 99C1768C99CDB3B0B5FAA54D2EA764AB /* pollset_custom.h */, + 71C6C363EE4C56B508C002874F18FD34 /* pollset_set.h */, + 17C2FBD16FAA0916679B9E24DC144CF4 /* pollset_set_custom.h */, + CD6A7D16A01E330E3D7859D2C1E6143F /* pollset_set_windows.h */, + 25592B2A61C69BF28CADC8150043D35E /* pollset_windows.h */, + 440025C65577D4DA4E2733C2C7BB05B2 /* port.h */, + 3AEC022C82A3CA5856F4649FF5F712AA /* port_def.inc */, + 7577B5F97ADA05BE37E9E4BA59C7A73B /* port_undef.inc */, + 10F4E2752364C3220503CC5F3C48DF8A /* protocol.upb.h */, + CB9E0586786503733DE3CB26BE3895B8 /* proxy_mapper.h */, + 9AE2B3726976A1847F298F3A3E47041E /* proxy_mapper_registry.h */, + 28793964619C1F7228788C0B1387513F /* range.upb.h */, + 1BF261CEDF36ED26D467AD508DD5853E /* rds.upb.h */, + 6CE64CEC1C19AFA412AD194A343E6E18 /* ref_counted.h */, + 7E91272A9A7BE8B8CBBCD7314930800E /* ref_counted_ptr.h */, + 2647BEA98C98B5C71539F80A83017838 /* regex.upb.h */, + E04BE206FDAB3DBB396E61E589EDEBF5 /* resolve_address.h */, + B47CA2898B3BAF5F43DA3D92B73A271B /* resolve_address_custom.h */, + 06401BF37C71D3F6E123CA93029A43B9 /* resolver.h */, + A0C93E8A83FE787BD7C3CEB208303AED /* resolver_factory.h */, + D2E064930E744AB4F123EAAA3A009D4F /* resolver_registry.h */, + CD3955A2D928D5CF136DE430715ABD72 /* resolver_result_parsing.h */, + 9078ABF4885664441CEBC7C246515245 /* resolving_lb_policy.h */, + 4EA38BA2CF7F0A304CA28CAB63CF71A2 /* resource.upb.h */, + 99039F2EA3DB530F4B0608A609A94DC7 /* resource_quota.h */, + 932A3E5D1959D7663E90094BD34785A0 /* resource_quota_cc.cc */, + 25285C8F555AFD60182DB33AEC9D10BD /* retry_throttle.h */, + 9F9BF554EFFC04267916166595FCC2EB /* route.upb.h */, + 451C4CD4076AF2620CADFDF3B55A8248 /* route.upb.h */, + 0B0188D071A2BAAE8F6F853ECC2F8A9D /* route_components.upb.h */, + 31D25403FFC95B707D2F5CBF1D925403 /* rpc_method.cc */, + 9C59E0F8D64C904B6F3DF382FC1943AF /* scoped_route.upb.h */, + 9C302CB40166ED08DEBFD2CD3F3CB231 /* secure_auth_context.cc */, + 879D1366693D17BFFD22A9411AA44EE7 /* secure_auth_context.h */, + F231F75A3EF0E5AC7BF05A7356CF6B3E /* secure_channel_arguments.cc */, + D41AD06745CA4B7E6E407B804C4B6F54 /* secure_create_auth_context.cc */, + 65EE7AD9F2EDA71CBD1BD54CA1DE18D3 /* secure_credentials.cc */, + 6DC502B8F9EF1F8F9C4200695FCFD22D /* secure_credentials.h */, + 192D013E4F329EC347D8368FE5F558F0 /* secure_endpoint.h */, + 692CCA167BAE54029B9243C2996E4BEC /* secure_server_credentials.cc */, + 1C9785376AA160E8974DC735DAF3C653 /* secure_server_credentials.h */, + 8A8B64D12B101D6945DBF2E662876660 /* security_connector.h */, + 0AD940282C7B916B8067C94A6E7F5FE3 /* security_context.h */, + 6F464093E6619365780B739C836CFDFC /* security_handshaker.h */, + B3E876E28EDBC4984AF9188899C964E4 /* semantic_version.upb.h */, + B3ACBE8839657A7A07B6B03D2D559583 /* sensitive.upb.h */, + 86828F9E80D747789AB8A9F20ACCB2D6 /* server.h */, + A4BDDB4AAA4F4D605A47FB66B4FEE16A /* server_address.h */, + 87E31D3E0C681884709B709A5913C273 /* server_builder.cc */, + 6CFF5FC83A9D4BA6332523FD9DC0B8C0 /* server_callback.cc */, + DAFAC64AB3B327E9B4C60799600C63C7 /* server_cc.cc */, + 313B79D932F8211615B667947E629562 /* server_context.cc */, + 167BD08858D39E8D6BA9D2CEAE9B3F41 /* server_credentials.cc */, + 99DE5ED0C45BD2BA9B0B09773462074B /* server_posix.cc */, + F6FC809C9C4AA5E36CC4DE6CB5D47D36 /* service_config.h */, + B6D3AEDEACB3E48C54383B8817562AF5 /* slice_hash_table.h */, + 1B6031C0254744F53D1F7DA8C0FB2D3E /* slice_internal.h */, + BF975F8D02AE3175AD21B5BED7FDC2D1 /* slice_string_helpers.h */, + 0ACEF7DE13EEEF21E1DEB53F06F651CC /* slice_utils.h */, + A8FFC6BFBCF6D712799352AD3D1225E1 /* slice_weak_hash_table.h */, + 5ED4CDF9DB6B970ECB686FFBB863545C /* sockaddr.h */, + 3CBF1715FA22DDF4859F58983C96BB21 /* sockaddr_custom.h */, + 77167CE9076DE7BD53D1C1499566CBAD /* sockaddr_posix.h */, + 86774CC4E513D98DAA8A5937084DF598 /* sockaddr_utils.h */, + 121195A1992721C717452598998B4349 /* sockaddr_windows.h */, + BA89020A58C9CEAFC4D18F0F7D08B551 /* socket_factory_posix.h */, + 8AFDD73E6EB84B430A2B2FC445718D4A /* socket_mutator.h */, + C78C141A9A2F8317180F5FA5798131FC /* socket_utils.h */, + 148BBF1E31DB4AF7565E67B963BA0029 /* socket_utils_posix.h */, + ACD33F7F16F4EBF3970806BA1F98FE2A /* socket_windows.h */, + 058FAB760C94291A6846B1D83C0CFC12 /* spinlock.h */, + DDB34E70DE46C0DBFA68657EE8AB1BB5 /* srds.upb.h */, + 20FE2D07EA808054F93271C756735D8D /* ssl_credentials.h */, + C5EDF444EA6073E298253A4A97F3AF51 /* ssl_security_connector.h */, + 1004B2FF809ADB5136C6207146F8CF05 /* ssl_session.h */, + 77A0335BD65D301B9439EC0691C11369 /* ssl_session_cache.h */, + 0C31DF07FC035EC1690AE609A446AF56 /* ssl_transport_security.h */, + 9479988C8B97951722C63AFDC64A2446 /* ssl_types.h */, + B5E40543B08B101D409F25A9DFF58259 /* ssl_utils.h */, + 5DF95D32DE32B398A176B60ACC5C7F26 /* ssl_utils_config.h */, + A58B6CF39A3BF9233150B1782155AAB3 /* static_metadata.h */, + 61ACC90E8D73B8BDE98CD9AECF447C81 /* stats.h */, + 9A00BBB980AE203C34BBF2E75B09A34A /* stats_data.h */, + 09D93768027DDA4A4DDD0AB09E880F42 /* status.cc */, + 2BFEA36C244F81A773B32DA6223A0AD4 /* status.upb.h */, + CC536920ACC3ACAC107C84AD1D25B15B /* status_conversion.h */, + 922330D32B27D4FB78D2F47F9D40BB84 /* status_metadata.h */, + AD7F038300BA50B8ECEE08E051166E54 /* status_util.h */, + FC8D20028EF6AD5FC84F04049A68A6EA /* stream_compression.h */, + D6A5855B0528D0A21B543310647FC369 /* stream_compression_gzip.h */, + F6D33BF02C2D1EC08BF2F70E0BB36A01 /* stream_compression_identity.h */, + E88AC67415B807A3F70ADA80C12F5C9E /* stream_map.h */, + 2B36415639698D83C10B4C6F4BC49426 /* string.h */, + F46F19261670AA0D96E6494F0C02F67F /* string.upb.h */, + 545D5F31F3173DFD099A6DF4F5F8A71D /* string_ref.cc */, + C0FC28EE8D3452EDA699A4B5651A8372 /* string_view.h */, + 8397A89A565E7E8601D622B9A7D3B8DA /* string_windows.h */, + 2546A47F0D4FEDE7194ABB6CCC8598C4 /* struct.upb.h */, + BF4B22447247346F2D6BA25E3A38580B /* subchannel.h */, + 7A99561B4F8B50B1BF0C7246EC47ED83 /* subchannel_interface.h */, + 8F8D52B2C57098447E1AFBFB5325E1EB /* subchannel_list.h */, + 50F386007ACFF3B0112187AAC1AE463A /* subchannel_pool_interface.h */, + 7814FB0FF75920942E7C1B20879BAFBE /* sync.h */, + 8768E92C1DE2FF698FBEADFD59195034 /* sys_epoll_wrapper.h */, + D52A4A005D866346A987BA9AB8FB690D /* table.int.h */, + 305C8A6F686BC6581EC1248F92C42D3B /* target_authority_table.h */, + 00F4D0A03E256C135B9EAE3E42644BF0 /* tcp_client.h */, + AFFDBDD9C75E5BA8A2372D3866E0BFA9 /* tcp_client_posix.h */, + 7167DB962799499BB9AFCA97C28414EF /* tcp_custom.h */, + 6E80008EC9FB5BEE4EEAE02CF4BC9068 /* tcp_posix.h */, + CDE5D386BB6C60A3B504FF9F3CF9E6FF /* tcp_server.h */, + 4726FB4D018035E3D0C77A2B382650FC /* tcp_server_utils_posix.h */, + E15F527EEACB19EE41A26F8BCF3B018E /* tcp_windows.h */, + 729A21CC7006CAEC65ED71CC4742B14F /* thd.h */, + 3608CD380C85A3520DDDD6E20013CEA5 /* thread_manager.cc */, + C34D4943091EB3998904FAA5A6C79FC6 /* thread_manager.h */, + 4F18534FF4B75EC164C841BA60034DB3 /* thread_pool_interface.h */, + 03F8C50107A79647B6CFEF808B390797 /* threadpool.h */, + B41BCAD368F263C1DAB21DC55094978D /* time_averaged_stats.h */, + 302D2EEA5F7C765B6C37A580E00C31FF /* time_cc.cc */, + 5CBDF21A6B5663334396CACD280FE454 /* time_precise.h */, + 0C37954346423A50630887B3B7C56C42 /* timeout_encoding.h */, + C1BE46C4A61415F111C103DAC90A8336 /* timer.h */, + 1DF53804F4862E20DA49C335AE25EC7E /* timer_custom.h */, + 341BD3517E4F990FAB166795F3C151A3 /* timer_heap.h */, + 9CBB69D578C84B497AB0493D4B6185EB /* timer_manager.h */, + 5A4083889D69AAA6415523B376A782C5 /* timers.h */, + A2A2100C6EA9BD8D2E78ADAC0E1EC844 /* timestamp.upb.h */, + A134C344D0C9DFC454147CCD53BC78A3 /* tls.h */, + E87DFED2DA30CBDB5B3ECC57C280B7D0 /* tls_credentials.h */, + 3F39F3D5A4D381899679B49E7A1887FE /* tls_credentials_options.cc */, + 03CC4EE82BCD879C79C01BEDD0B6BC30 /* tls_credentials_options_util.cc */, + 00A999BA53AED1F3360BE2B79E1276CC /* tls_credentials_options_util.h */, + D1C641E80759BADEC2646F8FC15CB346 /* tls_gcc.h */, + 75627434CA74A60A1612604AD510C495 /* tls_msvc.h */, + C5C3298D881E6BC29AF8B4E10D80113D /* tls_pthread.h */, + F93B69F1C42D2674A97DFCA32E808939 /* tls_security_connector.h */, + 55AA3FA7CCA5A2DD4F2CC561B6CDFD10 /* tmpfile.h */, + A32279DF47CB815E6A6DAA6FC92E81F3 /* trace.h */, + 533966E56E7DAF10FFF1D26104B75F33 /* transport.h */, + 82DA192B1B982D663E101F0873EB2796 /* transport_impl.h */, + 5E71D724C3E47B5F6B27A0D86265C45C /* transport_security.h */, + 7BB37BE5B2BFA000FB346F2FCFF797AF /* transport_security_common.upb.h */, + 2C44E3A313385725A97F0F3C6F66E6AC /* transport_security_common_api.h */, + 02054DA0396C7663732C32D7690309DE /* transport_security_grpc.h */, + 6EC874E822AEF71603431310B98615A7 /* transport_security_interface.h */, + 021AC33601AC9193154A278DC0A3D897 /* tsi_error.h */, + B6186BFC3B1A865F4340EF47AA6ED804 /* udp_listener_config.upb.h */, + 7FA8F6C3A5A28CE127CB531C6F55F598 /* udp_server.h */, + C909D2575066B9D55D407688BC220B8F /* unix_sockets_posix.h */, + D5A6297FA57E7163544C32FD8852C6B3 /* upb.h */, + C2FD8B4BBBA1F7122B7E451C9C875BFA /* uri_parser.h */, + F7F17B070E00266DCEC517C3123F5F75 /* useful.h */, + BA2040C110BB160079D3AD87D98859F6 /* validate.upb.h */, + B6C99F15F3F7F60D14514B5520BBA0DE /* validate_metadata.h */, + 725D5529E6CBBAC7D41AA8E72D27DA8D /* validate_service_config.cc */, + 92084C2699C4C3F8815767B3E4FE8D62 /* varint.h */, + C441124E91653A0ACB44A88B91CC4A9D /* version_cc.cc */, + 80B9DC6C22839E8DD2A57F8F22A7DE9F /* wakeup_fd_pipe.h */, + B76DE14AA09E463E45C815279F122262 /* wakeup_fd_posix.h */, + 707C3D8840963A14079CA85700DD7279 /* work_serializer.h */, + 145112654FF4FDFC7090F654F9BD1A78 /* workaround_cronet_compression_filter.h */, + 5B063DBA267CCBF3589F709A1C0737DC /* workaround_utils.h */, + BFA7899F031EE1AD276272290F6723D3 /* wrappers.upb.h */, + D13B2E5B609C5B5BFBD8010D760DFE5D /* xds.h */, + 92244E328E16F05C5111104617F374D6 /* xds_api.h */, + 7665D3F712E5B040DBCDDFAA4A8EF960 /* xds_bootstrap.h */, + 58C239FC8F94B514BB08EEAB2C2A1466 /* xds_channel.h */, + FC07AFB1A7B3C6E8AD9875D1F744BF03 /* xds_channel_args.h */, + D7E7BD393DDAC9ADEA8450A07D2877DD /* xds_client.h */, + C829FB38561BAE9EB5AEB66C4ED272AA /* xds_client_stats.h */, + ); + name = Implementation; + sourceTree = ""; + }; + 8D23E586261911A29B6B9067605CA0EC /* CoreOnly */ = { + isa = PBXGroup; + children = ( + 9E8730CF5DB7BA3502AF1CEF5693A483 /* Firebase.h */, + ); + name = CoreOnly; + sourceTree = ""; + }; + 8D324C10E4F916A76C2C0D5F637CA40A /* base */ = { + isa = PBXGroup; + children = ( + 8CC8A3ADBDB9807C72DD61D696EB6CCB /* call_once.h */, + 5AEDDB7052DD395CD4E4EBFCC0DED63A /* casts.h */, + 46759EE4919B288A782AEBB1A7DB42DC /* cycleclock.cc */, + 7B57CC3581A2F1C36A41FC92FD471066 /* cycleclock.h */, + 6FD61DC34AB43E983BA6082C5263B028 /* low_level_scheduling.h */, + 7DE01779F467CAAE296AEF402CBDCDDA /* per_thread_tls.h */, + E1DAC88BD8364EF5E2F3DBB770861BC6 /* spinlock.cc */, + 69D2389FD8623A3C724B261FDD99F931 /* spinlock.h */, + 330D9C1100B7FA18C2D010F351E8BC4B /* sysinfo.cc */, + 10F7D921AD7838C910160A14EC5F5641 /* sysinfo.h */, + E9B99011D6EC62F17055B52AB47834C7 /* thread_identity.cc */, + 4FC7512E0ACDD7CD8B912B01507B9BC8 /* thread_identity.h */, + 529FFBD228E87DBA888ED9C5ECD2B492 /* tsan_mutex_interface.h */, + 26B5BB6E5A14137A1DBEB44D55871588 /* unscaledcycleclock.cc */, + C61C247E80D4D023E85484ECD546AC0B /* unscaledcycleclock.h */, + ); + name = base; + sourceTree = ""; + }; + 8DD75FD329CEC4D353D9A9F5AA6671A2 /* FirebaseFirestore */ = { + isa = PBXGroup; + children = ( + 1935BE7E2932D2AEAF282514A83BDC6B /* annotations.nanopb.cc */, + 62D4A3694FDB279D23D1D9A697A08821 /* any.nanopb.cc */, + 6D1A85F8180A80DD21013455EC1A2751 /* array_contains_any_filter.cc */, + 824BEE1922AB5E669D432F166209355C /* array_contains_filter.cc */, + 3463BA3E18078099E529BAA8FFC9DC53 /* async_queue.cc */, + D996893AD45476D78C31A7A4C5D01978 /* auth_token.cc */, + FFD4B31452A9981277D282361FC81C10 /* autoid.cc */, + 88E4B60C142EE92DB724A96E3D2CE314 /* background_queue.cc */, + 360048D07014C552F5C3B924CC9B33F6 /* bits.cc */, + 3FE619629A1795D2850BA2450E81AE37 /* bound.cc */, + EE192DB052B79D11AE6E23BB68E44EAE /* bundle.nanopb.cc */, + 73C98D4CCFA711E992BFF0C1839A30BF /* bundle_loader.cc */, + 18FB9E0078686EBEFAE54BEA6788DD49 /* bundle_reader.cc */, + 6F8E11C50BD04C40064F5C2E82B24D57 /* bundle_serializer.cc */, + 89B5CC08F0D78B71F647EE48083C853A /* byte_stream_apple.mm */, + 5BB8119AC82C3D44A53FEE3EEFC9B815 /* byte_stream_cpp.cc */, + C12D068B4C260A5B7B3E461C7940A9FC /* byte_string.cc */, + 9FDC9D1269710F95D814C073F2E9324D /* collection_reference.cc */, + B5279CA4BEE8BBBFE1C7B8978F678020 /* common.nanopb.cc */, + 0095D0E40BA0950DEE437C7007669E42 /* comparison.cc */, + 9B13413FFB0F61136436993DEA918F35 /* connectivity_monitor.cc */, + 3353976E4911A92B46473E8FD680703E /* connectivity_monitor_apple.mm */, + D8F792CB523ADA9CAAC0E2139870BA7A /* converters.mm */, + 1A6D36D6C209266D5ECC3572D41AA7E8 /* database_id.cc */, + B992BDC47F8D5EA6167AB33530A667F3 /* database_info.cc */, + 47F316ABC8B1138CEC418AAF6E53652F /* datastore.cc */, + D452A8A5ECDB46D31F082F2462A97C24 /* delete_mutation.cc */, + FB3455E17C4C9DCB88F0BA9EBBB368D4 /* direction.cc */, + 7D530914D66EE4A4CFD0752FB8BBA1AF /* document.cc */, + D04606BC88251771AD750CFAD3476CD6 /* document.nanopb.cc */, + E2C8DBB1C38D5A3E34F7BEF975CA2E2B /* document_change.cc */, + 8011B9576572A2EF5FCEDFB78383C91C /* document_key.cc */, + EB7E916FC12CF5766C7F3D6DC4CC0CB9 /* document_key_reference.cc */, + 7E285DDF18479012AA88E1D105A1CECA /* document_reference.cc */, + 6B9FD21E29437B49EFC575D5AA5332FB /* document_set.cc */, + 9FA72B3E467BF6F44B2177C5E45B9B39 /* document_snapshot.cc */, + 442BEF46A4CE4B98E1864CF664B03C6A /* empty.nanopb.cc */, + 1A3E2B2F82194B0FC93C4B99EB72EDEC /* error_apple.mm */, + 9912B0A906B209946FD26DB5B0E0D520 /* event_manager.cc */, + 853E4770089A2A0408D662C02A2BE157 /* exception.cc */, + 638F8751A39473AAA3E2E475D74ACA8D /* exception_apple.mm */, + 03DAE0986021B6A0ADE31ECBF13BC2B6 /* executor_libdispatch.mm */, + 727C3F47E92394D30AE82A7FEA783126 /* executor_std.cc */, + 19D8D86A8C9FACA0CED9A2EE17D195DE /* exponential_backoff.cc */, + 7A61CB6282EDA84F6EF761E93939C0C8 /* field_filter.cc */, + 08DA59EC052EA331486CBB173A3BE045 /* field_mask.cc */, + 02A80276D1041E3572A13C7F7BAD60FC /* field_path.cc */, + 8885F9F52FB0E7DBAFB11CB199ED9BBA /* field_transform.cc */, + 8A6B0F28E4A1E1C85C8C3B0F7A8E8C22 /* filesystem_apple.mm */, + AEAED9EED49D19DF250AA653A5592363 /* filesystem_common.cc */, + 43FAFC4B5882220F24952B47E295C07E /* filesystem_posix.cc */, + 82FBA47BD6F5524762E00CFE3EB1CAC1 /* filter.cc */, + A11DB0635F1EAFCAEEE41078DBDC5CB2 /* FIRAppCheckInterop.h */, + 1675E677767D304323D71A6AD52A79F0 /* FIRAppCheckTokenResultInterop.h */, + 3EE4E4E6995DB123A1C58AFFB2284359 /* FIRAppInternal.h */, + FACCD01FD4A1CE43B774B75732CB6A0A /* FIRAuthInterop.h */, + FDBD9D85B71132929F853945215B2274 /* FIRCollectionReference.h */, + CC97C2EC4CDD54ECE16CD500F9A484CC /* FIRCollectionReference.mm */, + B1E6B38A60A185A9EC2E2E06D2AD5648 /* FIRComponent.h */, + 605D6A9E54961B971682B34C80F43763 /* FIRComponentContainer.h */, + DC6B33792F33E8EB3FC539DE92C0D36D /* FIRComponentType.h */, + 7FD6DDDB94DDFDFE7FEA3A4AE283F1AE /* FIRCoreDiagnosticsConnector.h */, + 8F46375A3AC1F39573C6A281A0AFDA7C /* FIRDependency.h */, + 96D041460C44DBB994E1212C7E28965C /* FIRDocumentChange.h */, + 20923075D20F34C7D0FDCCC63697DA86 /* FIRDocumentChange.mm */, + 4C230BB84FAD9936159B061CA51C52C3 /* FIRDocumentReference.h */, + 38B648D43D814C6B663D06516D926B03 /* FIRDocumentReference.mm */, + 508D71FF61612BB5C3FEFFA0245D5903 /* FIRDocumentSnapshot.h */, + CD74399B5F51BF1848F33AA8EE2F5729 /* FIRDocumentSnapshot.mm */, + 471B8E9831E0AE7B8BCAEF5EEA722404 /* firebase_app_check_credentials_provider_apple.mm */, + 885FA52C1E81313350937E7C8E8BA430 /* firebase_auth_credentials_provider_apple.mm */, + CF99C8276446029A4FF42F03148B7B1F /* firebase_metadata_provider.cc */, + C568E053FB87DB623CE6EF46579743E0 /* firebase_metadata_provider_apple.mm */, + 1FCCD3D39348BDC0800EE0E7EFCE5259 /* firebase_metadata_provider_noop.cc */, + 9DAE5600E0080211F843A6E5FD4EB450 /* FirebaseCoreInternal.h */, + 98C1AA8E250C05999AE180D81EBAC056 /* FirebaseFirestore.h */, + 1BE071EE977CA5001F9EC22ECDEF9AF8 /* firestore.cc */, + 6EB606CA34D6F8ECA23EE3CF535BA45E /* firestore.nanopb.cc */, + AB863D3AABBC8C31F4D6DC0ECBEF88A6 /* firestore_client.cc */, + F046C2E8B13635C1C374CFB208B1565F /* firestore_version.cc */, + F29FAC3B039690DC69E6AA318A91F7F9 /* FIRFieldPath.h */, + D40B576B9738E3339371CADBFBA9011E /* FIRFieldPath.mm */, + F07E3CC40A551C5BD4627CC04D39A30F /* FIRFieldValue.h */, + C1A6FB7F4CF44C46C1449EEADAB214FD /* FIRFieldValue.mm */, + D9965082750007B191BFFE9F31B16108 /* FIRFirestore.h */, + 49050E1701CC08C83C08697F645358E6 /* FIRFirestore.mm */, + D12C858DC3D97B674C7B817D39A7ABA3 /* FIRFirestoreErrors.h */, + 7504352F38E98E6E2DF19B1FBA23AB89 /* FIRFirestoreSettings.h */, + 41EFA1B5BDCCFAEC42437967FE88B641 /* FIRFirestoreSettings.mm */, + 18ED08173DA751A2F0711D475B0A239E /* FIRFirestoreSource.h */, + C1628A866AD0775C2468886C7793BF8D /* FIRFirestoreSource.mm */, + 743E429B88FD90AF606E30D5484D31C3 /* FIRFirestoreVersion.mm */, + 6CBFAA65733F56B7F9559726C8315AC0 /* FIRGeoPoint.h */, + 26C1DB7158A1D4AACDFA648029B7138D /* FIRGeoPoint.mm */, + A56ACE38A2F08AE312DE31CB0B651EF9 /* FIRHeartbeatInfo.h */, + AC7D4CB09A76136FE10200C7ABDE8D12 /* FIRLibrary.h */, + 6ECBAAAD9ECB59BFB369D702AF7F98B0 /* FIRListenerRegistration.h */, + 9238B970FFD0DA74F5DC9A34A1E40220 /* FIRListenerRegistration.mm */, + D94C417F36AE5BEDB01A94A81DC23DF8 /* FIRLoadBundleTask.h */, + DA7877D68E192DB6D96F7FC562099168 /* FIRLoadBundleTask.mm */, + ECD33F95A7B1C50A9E511A0C8BA399CA /* FIRLogger.h */, + C99606D6DC22C6EFC7C59C9BF3D109BF /* FIROptionsInternal.h */, + 85FFCED5A0CCC2D40E4F4DC4C276FF66 /* FIRQuery.h */, + 892FCC179A98C6081F21DC4D6B5E3B6D /* FIRQuery.mm */, + B0E7FBCD229FDC32936600AFD1544DB2 /* FIRQuerySnapshot.h */, + 9355D7ACA9D1415F317F40134BDE6DE9 /* FIRQuerySnapshot.mm */, + 3F57D5223674DE8297E00191AE812843 /* FIRSnapshotMetadata.h */, + 01B26CFE2F76C29EBDEA60A8BF11A63A /* FIRSnapshotMetadata.mm */, + D5D3E02C653B695422153E0F588F2A3A /* FIRTimestamp.h */, + 0EFF0497467C0D05AF3D156549165A48 /* FIRTimestamp.m */, + 0B3724F90A9B693A32BA7950966A27BE /* FIRTransaction.h */, + DAC9AFDC2F9DC85EB2C00EF63D809DF7 /* FIRTransaction.mm */, + 4AD945AEB20B9646F00E10101EE68B31 /* FIRWriteBatch.h */, + 2A7244FE0A01B1C1B5532E33847085AD /* FIRWriteBatch.mm */, + 7E8E9D3A62322EB1CDF58810A2198A43 /* FSTFirestoreComponent.mm */, + 96CDF0456C64946B0AAA05382534D384 /* FSTUserDataReader.mm */, + 2EB974BBC2DBD8B387CF2D8EBDEACA02 /* FSTUserDataWriter.mm */, + DB7CEB9CA802E896C51E550B87E62C31 /* geo_point.cc */, + 307F011D6062A498664FC58DACE67415 /* grpc_completion.cc */, + 00F9C00975F303BF8DE7F221D6FCEB86 /* grpc_connection.cc */, + 6F55D3DC9E3F24EA5FD511078B41B047 /* grpc_nanopb.cc */, + 60711FE87AF4AB20E84297D270C023B9 /* grpc_root_certificate_finder_generated.cc */, + C65FFAB5F7F4C7F4CB26D6247ABDC4BE /* grpc_root_certificates_generated.cc */, + 75F15C23315B1471554D004C10E07F76 /* grpc_stream.cc */, + ABDAC6BA1239B29F18ED25459D95FE04 /* grpc_streaming_reader.cc */, + 0F07A817973FE0DDFD54E66F375D98C6 /* grpc_unary_call.cc */, + 2C11CF3156D9FA43AB2D38C1B2D83A9A /* grpc_util.cc */, + 4DF90DAA0A2C3DBCDA90B16A2A0C3BD3 /* hard_assert.cc */, + 2EFC08623CDCB418157DC52800AAF14B /* http.nanopb.cc */, + F628C3DF28DE01D9BE04EEC397AC014A /* in_filter.cc */, + 12E88198C7188136050F950CCB88F22B /* key_field_filter.cc */, + 064C4268209BCBABE36F35D6DB7B565B /* key_field_in_filter.cc */, + E24E434379208E1B1C3A3F2381668A57 /* key_field_not_in_filter.cc */, + A8861093DEFACEF1F323166FE2D71CE9 /* latlng.nanopb.cc */, + 44109291B25C2A8C13E8A30930635D21 /* leveldb_bundle_cache.cc */, + 9B6D225378BB7F76C413545C291FE357 /* leveldb_index_manager.cc */, + 30E5C63133477DA2B8CC7B76208CF09B /* leveldb_key.cc */, + 7863E8269AB9B9304AE2631E48FEA146 /* leveldb_lru_reference_delegate.cc */, + 7B2DCC6B174ED373F1002AA6B1FE1FD0 /* leveldb_migrations.cc */, + 18484767EE110FAE5016F0B898172E1A /* leveldb_mutation_queue.cc */, + 8DFC650679AEF2E96E892537AB49CFE2 /* leveldb_opener.cc */, + 215873535BAAC9EB2C2E3E28B1C42929 /* leveldb_persistence.cc */, + F496FB27791EC99D7E1900129F1A46CE /* leveldb_remote_document_cache.cc */, + A42C1ADC7346EDB1615DD7F0248971D3 /* leveldb_target_cache.cc */, + 51AFAA98EFF7906A36AC33D982A0C6B2 /* leveldb_transaction.cc */, + 311A8592E4873FAE5C377D57E004F876 /* leveldb_util.cc */, + 2F9AEAE615FC47EAD6B57161EEFCDD14 /* load_bundle_task.cc */, + E1B336B7E76A9047F6A3846EE8379626 /* local_documents_view.cc */, + 05F0B78A6D8F1291ABA4D37887BD58CE /* local_serializer.cc */, + DD7170ED59976060BDD36AF18E08263A /* local_store.cc */, + 5D4AE9D3D75CFAEEC6D9B8369BA3A607 /* local_view_changes.cc */, + 9C41D690E5603981F1A6038BCE8B913F /* log_apple.mm */, + ED061D0791AD1C27CF4524F34C298AB0 /* lru_garbage_collector.cc */, + A8C6F15BD1CDA9FFDC0406E5CF4D74C9 /* maybe_document.nanopb.cc */, + 5C160A8AF03BE920E0B92B72393912B5 /* memory_bundle_cache.cc */, + 95CB84ABE674CCD3BD01515FCB66FB47 /* memory_eager_reference_delegate.cc */, + 59D6F2653E8BCAC060CB891007E2BF48 /* memory_index_manager.cc */, + 81A5F5C7035B2C87A24CF7B069A42CEB /* memory_lru_reference_delegate.cc */, + AAC355D81DC8EB07A8726AF9F749ABC8 /* memory_mutation_queue.cc */, + D1EBFEEA08404A41677D3698370627F2 /* memory_persistence.cc */, + EB869D4BFD5457DED0E553A84AD1B85E /* memory_remote_document_cache.cc */, + F0D3C3A0257A66C849ADAC285D874751 /* memory_target_cache.cc */, + 13F7D04CE543FC13DE1CE37822055B13 /* message.cc */, + DE60217F7EC6CE9C5AFDAE439BAB3BF3 /* mutable_document.cc */, + 1511D3462BCF17289DD619259C029C9E /* mutation.cc */, + 1AF111EA40541007B06CA1C98A71FB97 /* mutation.nanopb.cc */, + 9D1721FE77FEEE595295694CBBCBF74B /* mutation_batch.cc */, + 2ECD809A94CDBDAB5A65BFB459EFCE88 /* mutation_batch_result.cc */, + 7430EE0C24F9C897450F138CDF396FF6 /* nanopb_util.cc */, + 69B7EAE9EF9A21A0349C2C5A7AB43479 /* not_in_filter.cc */, + 8C7FBB93F710929F2C6A73568B22F2EF /* object_value.cc */, + 355EE783706767D2B2ED13809C08E8FA /* online_state_tracker.cc */, + 8F3F8D9CC413B79B798AA7CC891E85DA /* order_by.cc */, + AD5BCE0A02A0C91F4F19722BF8489C03 /* ordered_code.cc */, + 10E7F325F2BC11470A372F3A297C842F /* patch_mutation.cc */, + 20923FB22CEB592E2B44256F10307779 /* path.cc */, + EAC15DDD03A481ED76F0B1C19121212B /* precondition.cc */, + 32719B7CFC847D795346852B6B72B884 /* pretty_printing.cc */, + DCBF36C85B3DADA0FE9F311F0F97793A /* proto_sizer.cc */, + C750DB7FD3ECBC4EEC46DDE950FD8737 /* query.cc */, + B7009F7D37D5CC96B730B368C2834138 /* query.nanopb.cc */, + DB7AC688268FF9E6BF7121026CC24803 /* query_core.cc */, + 655F9B569AE0B266E165B9DB0468745F /* query_engine.cc */, + 9596881B1C2E57E2C75A0D4F5BED873F /* query_listener.cc */, + 1A4AF395481273F9A272ABA5E5A484BC /* query_listener_registration.cc */, + 0142698C82305E8FB4EB2BCC0C1A2366 /* query_snapshot.cc */, + E47323FE190B0C24EBEBC7834B45B3E9 /* reader.cc */, + 17B8745CD6EFDCB192C7E5E84BD48C43 /* reference_set.cc */, + 76271E67B8FBB9EFE56AFAB1625245CC /* remote_event.cc */, + 6C63F7A36A6F4D2A8AB38B701DED739E /* remote_objc_bridge.cc */, + 6CB77AD39D4D25E7CE4D2C621C5A6F79 /* remote_store.cc */, + 777851AFE7FBE6DF0100814A133DF4C4 /* resource_path.cc */, + 81E97ABEB1C53416EB4D3DF76FBD61A3 /* schedule.cc */, + D02274CABF9691BE25B3701E08592D57 /* secure_random_arc4random.cc */, + 7E5B04F1DA47B2A8B8880DC91CB6545B /* serializer.cc */, + 3121D2EA76FA86111FE79EAAB7C81F00 /* server_timestamp_util.cc */, + 8DF70E24F7BC596A07F9A691DDD72420 /* set_mutation.cc */, + 5E37DB0C1F4047AD767EC6194FAC8133 /* settings.cc */, + E8E06741A68C2304AE4184D5A7B4438C /* snapshot_metadata.cc */, + 9CB820E1CA00F35B24C381DEE2AC94E5 /* snapshot_version.cc */, + 73B72E8ECBDB34D712E9FB17A84D12D6 /* snapshots_in_sync_listener_registration.cc */, + 513D3BB34A524F46BBB36B3D17B35E87 /* sorted_container.cc */, + 577EF0CDF949EAE1A987FB96D71A2CCA /* status.cc */, + 46417F5AD9A23058AD37BD569A701642 /* status.nanopb.cc */, + 2CD8F375C3FAFE74F1D17105D22E652E /* status_apple.mm */, + DEBC07CB023FC32266244E76712EFECD /* status_errno.cc */, + 98316369C223112281330952440BBF37 /* status_win.cc */, + AE639E980CC0E3D99D915F70F272A2D4 /* statusor.cc */, + A01F3D8A406CB451A7FEA08513C4BD92 /* stream.cc */, + 8E2B4207D8A65104EFC655828838DD4F /* strerror.cc */, + 3CF54DA3A53D783F2B0CB8A100C90B1E /* string_apple.cc */, + B5FE7DA64DA0A2FAC82F978B8C8C214A /* string_format.cc */, + 436A13930E01446E2ED5E4C1A0ADDC0B /* string_util.cc */, + 9D04CBBBFA548BA25FA4A23088C6DE01 /* string_win.cc */, + 4A9BA2F1E9E5133693F4542C7F2C17B5 /* struct.nanopb.cc */, + E6DDAF89CCCBB25AB51D51CF88D98A29 /* sync_engine.cc */, + F0A6ADBA12C11CA654BB21328411B1C2 /* target.cc */, + BF0A8F53E46B4EABBCF9C8F623CBE3FB /* target.nanopb.cc */, + A5BDF47E4C51DCD86B15BC08DEE68099 /* target_data.cc */, + E40F11003B87EA1D8D03A37CB3A53038 /* target_id_generator.cc */, + 012D35287FBE5F05808D75E782C2019C /* task.cc */, + 630CFC57E0EB1039CC050ABF6B80618A /* timestamp.cc */, + 604057E13720363AB70882472915AB7F /* timestamp.nanopb.cc */, + 35AF1F62F668B0DB4AE8656A452AC6DD /* timestamp_internal.cc */, + 67459D488E0930C75534A13CE44A611A /* transaction.cc */, + E33E6DEDB8882D897B8A95E3A192A148 /* transaction_runner.cc */, + 832C6F139A846A69D6D942898C54F600 /* transform_operation.cc */, + CB304E6E4DDDD47D7B5FC05DB827965F /* user.cc */, + D2236B991AD1D74EDD3775EC6A52E15C /* user_data.cc */, + 9BB9ADA2E70BFC8824E39DA9996ECD97 /* value_util.cc */, + AFA6C4E167F40B32FC9C8C56A5FC79F3 /* verify_mutation.cc */, + AFDD69BAA69550856BFCB1E65A18327A /* view.cc */, + FCCA30672600EF310C1AC89F398065BD /* view_snapshot.cc */, + 6DC56AA569404671EB413B4059575E5C /* watch_change.cc */, + EAD0B8E22BB13B12D4918CD79749CB4A /* watch_stream.cc */, + B2B2AD4A805ACAE37CAA1D85222E9219 /* wrappers.nanopb.cc */, + F60BA8BCB155286F8EB206ABEF7A5B67 /* write.nanopb.cc */, + 75EC1DEA43A8EBDAC6CDAE3F2D407750 /* write_batch.cc */, + 5725B9C930213912511C259F55BE9149 /* write_stream.cc */, + 5F7B7B9E9DB84FB194521CD878F489E1 /* writer.cc */, + DC8330B0C00EA66B819BA244E87E9D80 /* Support Files */, + ); + name = FirebaseFirestore; + path = FirebaseFirestore; + sourceTree = ""; + }; + 8FE74C9FB7AEEE03D86143B0D46335AC /* decode */ = { + isa = PBXGroup; + children = ( + ); + name = decode; + sourceTree = ""; + }; + 910C0BE9A277CDABD11A0C7705D11587 /* Support Files */ = { + isa = PBXGroup; + children = ( + 63A44D6D32DA85D8A02374D7AAEF561F /* FirebaseCore.modulemap */, + 15FB5CF44F4EE0EF13E7D237ACDE94CB /* FirebaseCore-dummy.m */, + 67D990116E8A864DD03DD36835E254B3 /* FirebaseCore-Info.plist */, + DF3E6B695BB499315B1092C8C3D75F34 /* FirebaseCore-umbrella.h */, + 0038A2ECB3F315B264D2ABE627F3C1D3 /* FirebaseCore.debug.xcconfig */, + 4C7412EC9D0EE1569D8FB28942FB7014 /* FirebaseCore.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/FirebaseCore"; + sourceTree = ""; + }; + 94B3DC7A873477C4E76B2F1BB5546F6C /* bad_optional_access */ = { + isa = PBXGroup; + children = ( + 17936BFECBE0CC394E15286D54BFA158 /* bad_optional_access.cc */, + 4F9842D7843EDC209B57E48DAF7DFB2A /* bad_optional_access.h */, + ); + name = bad_optional_access; + sourceTree = ""; + }; + 969FF4A5E3EB659344B244EC683ED90D /* FirebaseCoreDiagnostics */ = { + isa = PBXGroup; + children = ( + 8821CF5AA9CE91D5372EDE8DC54F0B67 /* FIRCoreDiagnostics.h */, + A77DB249AE8630BD91CEE0413AB157BA /* FIRCoreDiagnostics.m */, + 22221F044B9F7D9155FE2B197E7A0020 /* FIRCoreDiagnosticsData.h */, + B8C5BA28988FE67D943EE4B89F70AD7C /* FIRCoreDiagnosticsInterop.h */, + 4BEADCEEB9596C01212F566358BBFD9B /* firebasecore.nanopb.c */, + F6B971B410643AF9F21F0053EAA13332 /* firebasecore.nanopb.h */, + 1FBF27D2B1DAC8E0E898816387E676B2 /* Support Files */, + ); + name = FirebaseCoreDiagnostics; + path = FirebaseCoreDiagnostics; + sourceTree = ""; + }; + 97D71DCBD68E0F2B79DC495FA7372CFB /* bad_any_cast */ = { + isa = PBXGroup; + children = ( + B20618FB1F2EBACA78FC2A5BE46B3903 /* bad_any_cast.h */, + ); + name = bad_any_cast; + sourceTree = ""; + }; + 9A2D7F6108A9F22E2DCB1484DD1A176F /* strings */ = { + isa = PBXGroup; + children = ( + 0B8269346541F816F8542CA747FD86A4 /* internal */, + B9D944FD0A7C8CF93F8EAD96DD3CA183 /* str_format */, + A604814F7842628191B9240AE2A116E6 /* str_format_internal */, + AA8F0E780138D97F013FE423B1F57522 /* strings */, + ); + name = strings; + sourceTree = ""; + }; + 9AD55D01BBAB9DAF1B487F770B8937C2 /* hash_function_defaults */ = { + isa = PBXGroup; + children = ( + 98EC4006F852AD14461271C9A99F9586 /* hash_function_defaults.h */, + ); + name = hash_function_defaults; + sourceTree = ""; + }; + 9B5E6B972216A99F96BDC8FC7C10BEA2 /* spinlock_wait */ = { + isa = PBXGroup; + children = ( + 0D37CFF2BE60C28917E248625DD8CECF /* spinlock_akaros.inc */, + ACA63BF9403CDBAAB57966A713249632 /* spinlock_linux.inc */, + 61060E937CC594BAB60BC43807AB59CC /* spinlock_posix.inc */, + A0A9F2BD72E3B373249A267756FCDCC4 /* spinlock_wait.cc */, + 68EF1027B77CF7A21833485066A7DCE3 /* spinlock_wait.h */, + D5CCEC4ECBC30052D1BDDAA5FAA0D2C4 /* spinlock_win32.inc */, + ); + name = spinlock_wait; + sourceTree = ""; + }; + A41FCFAF3ABAF83DE4E6F50E1A24B358 /* bits */ = { + isa = PBXGroup; + children = ( + B82A3BF0600ACFBB166AEA37753D9B47 /* bits.h */, + ); + name = bits; + sourceTree = ""; + }; + A604814F7842628191B9240AE2A116E6 /* str_format_internal */ = { + isa = PBXGroup; + children = ( + C4B78A20DAD26B9E8FB2F462145044B5 /* arg.cc */, + 5A6DFE52D3AA115674B62CB17C7F1AA7 /* arg.h */, + 5400FA5634EA7A0E83B7D07CF8CA5C4E /* bind.cc */, + E37EC012998CA28B611BAFCCBE9FC28D /* bind.h */, + 435D0F489605EADDCF177F734D741809 /* checker.h */, + DED1C60C95A9B521B0BD4F8EB071DED7 /* extension.cc */, + 70D476564D9BBCE1BD0616BF5ED79124 /* extension.h */, + 4A9327117A99BCD5D2460B6ADDD974E7 /* float_conversion.cc */, + A2E4CB80A06EF267FB377C5873C2C90C /* float_conversion.h */, + 437BBB331542A87EA663492AADD4352A /* output.cc */, + F1622E9A9A961729DA445FAB73B0974D /* output.h */, + D991A77A4FAA05504D10738C573806E3 /* parser.cc */, + 3103B5E5E8961AE81A4FDB7D4757D4AE /* parser.h */, + ); + name = str_format_internal; + sourceTree = ""; + }; + A844DC8628E166B2B0C64F7C861D9B74 /* Interface */ = { + isa = PBXGroup; + children = ( + F366375B86B3AC902A44764DD321B8F5 /* alarm.h */, + EE6A5DDFDD593F8C5874769DED9E7E33 /* alarm_impl.h */, + 78B26E2E34B7A494C881016636BAFBBB /* async_generic_service.h */, + C453377C6E38701BE8795477EAE77A8A /* async_generic_service.h */, + 335ED1B7339A2C331EAC0F23CD0F6CE1 /* async_stream.h */, + C12FDA4D0284C83C4D7A328AAD8476A5 /* async_stream.h */, + B882E42BF6F3E01E5EC81F7A55920316 /* async_stream_impl.h */, + 8C20E5941418C595010D3682C18A08A3 /* async_stream_impl.h */, + B2FFB2EE419C9A72A3B8781CFF2B88FE /* async_unary_call.h */, + 87629CC7AB3D5C63FC604777868B6FCE /* async_unary_call.h */, + 8EB60C1294724FDC2B764EB7D5C88B93 /* async_unary_call_impl.h */, + 78B49660DCAF348B5AF0AA74D7113328 /* async_unary_call_impl.h */, + E3DAFF6DE90508C9BDC6062F431B74D9 /* auth_context.h */, + 444AB9B18BEBE02DA7B5CE51CE888C46 /* auth_context.h */, + C29464429CCADC80A3820661FAE5D16E /* auth_metadata_processor.h */, + CCF07C1E11206B22B474B76097194590 /* auth_metadata_processor_impl.h */, + 8E2D58AF97F55F7E1FEA485377CE7239 /* byte_buffer.h */, + 2920D6AE76F6A58FCD9983528B62C48D /* byte_buffer.h */, + 7EE26BC24756397D2051B7CC194EF0D1 /* call.h */, + 40DEE50F5C979D98AD4B7C60CA18F339 /* call.h */, + 150421C9742BB4F0B119B06D89B0E8E7 /* call_hook.h */, + F2BD2D588B3379F19C4BC9E8559BB359 /* call_op_set.h */, + B6ED6D2F2644D93740B21482FDB3A7B3 /* call_op_set_interface.h */, + FDA685DC734F7751F03784B2EC5868B1 /* callback_common.h */, + 1DACF790A72B28E83031D36EB45ED237 /* channel.h */, + 94B99171C07D2E616847F8CC1E620728 /* channel_argument_option.h */, + 07FA27FC76BE4704F299E45758F66254 /* channel_arguments.h */, + B7B84AD8FEB5694D1B5DC90E365C65B4 /* channel_arguments_impl.h */, + 6E7F875194E544D97D96D786FA3997A1 /* channel_impl.h */, + 41A93D115672055C805A34D017E6BE86 /* channel_interface.h */, + 6F79AB233BA51E65780DB03CABCFC2B2 /* client_callback.h */, + 2357611EAAC607066D736FC1DF733387 /* client_callback.h */, + B7AED7340CC7A33CFA21702DB0C5689F /* client_callback_impl.h */, + CF1A3CF6D75124BEB09C41029E3CA22C /* client_callback_impl.h */, + 32D211F9024AF3892B1280563BCF428E /* client_context.h */, + 8EEC13855B0D75AF2432EAB151AE5E33 /* client_context.h */, + ECDFE3BA3DAEDD1D8996B92A462FF847 /* client_context_impl.h */, + 9D147D68F8693EC4F25860C9BEBEA063 /* client_interceptor.h */, + 0958C4BB5B66784FC1D759AB158E5507 /* client_interceptor.h */, + EE1ACE801B4732693EC7AEB4749FBD54 /* client_unary_call.h */, + 7ED9237D85289C5307DA6BABB50E35C9 /* client_unary_call.h */, + 2657535AAAAF14E09FAFF37B6DAF663F /* completion_queue.h */, + 0669EC87902A174C07ECC27922C9207B /* completion_queue.h */, + FA955A6E8F8F84D04CCB4E379AC4BD50 /* completion_queue_impl.h */, + 31CC97CB5DB9C22723097EBA3F9769A0 /* completion_queue_impl.h */, + EF1CF1358AED46E75D926E03531F42E3 /* completion_queue_tag.h */, + 51C721B724E5E995C8911EB0238842E6 /* config.h */, + EAE79CCAF1AE912E1C941255BBE29708 /* config.h */, + ECA59ED6E17663C92621418F953576A3 /* core_codegen_interface.h */, + C376CA4ADCF65A427E0495534EEA6ACD /* create_auth_context.h */, + 593854392CD23606E2DCE099FD766A02 /* create_channel.h */, + BD53403E4372AE2A9BBA894429AFB48C /* create_channel_impl.h */, + E5B869C89802921B22497BEF5788A0BE /* create_channel_posix.h */, + AF3DCF24D3613D03CA60B425BFE16B9E /* create_channel_posix_impl.h */, + 23156AFDC8CF437ED995D8E10E66F1AC /* credentials.h */, + A4B54D6420B3444FCD5BE511FE112605 /* credentials_impl.h */, + 1D7082806BB3DD63DD675328C5BDF865 /* delegating_channel.h */, + B521EB4F00263E53A42457E5355945FB /* generic_stub.h */, + 5D43DD5D3FE562A1974961EC0CBA7708 /* generic_stub_impl.h */, + BADA78E910ACE2BCEDCCD27287A5B7D6 /* grpc_library.h */, + F2BCB5A6E163E223AB4EC37942EC748E /* grpc_library.h */, + 11F1FA22BF5D93DBADFE5B1D6E370EE9 /* grpcpp.h */, + 2EAD0C9EFB2E3180C2DBFAF8CDB9150F /* health_check_service_interface.h */, + 70A8C702CF96CC43BC57A68F8C2969FA /* health_check_service_interface_impl.h */, + 300641136217C3F72893388DFE42F334 /* health_check_service_server_builder_option.h */, + FB6E28756AF9D5278A5ADB2BA818DD5C /* intercepted_channel.h */, + BD4D206E034593577820C0BD18349D7E /* interceptor.h */, + 01E9E32DCC2758F4DD9AF31F20C36D25 /* interceptor.h */, + C77437A75F722B23647A5CFC01FB6905 /* interceptor_common.h */, + C7EEA401F0F0737E47114170D1B40EAF /* message_allocator.h */, + C5B3E6E383400260EACF184A4CF39998 /* message_allocator.h */, + 0FE17F5F00A1C87DA3B687F8CD8DE38F /* metadata_map.h */, + A67BB7E59B0B6A837B089F22CA423BED /* method_handler.h */, + 70C5F5487C3D0BD41B86188E5A468273 /* method_handler_impl.h */, + 2A91C14F7189A43A5B0078E6950800DA /* method_handler_impl.h */, + 3B9C02065259D4ADE30BA766B7D414A3 /* proto_buffer_reader.h */, + CCD1EFE89EDC32963ED5DF3D278AE53D /* proto_buffer_writer.h */, + DE3910421BE3971CEDA899A59D46974B /* resource_quota.h */, + 285BD15E9DD394E1DBAC69E726BD41B5 /* resource_quota_impl.h */, + 48C0BC392FFF6685F862551F33F6D994 /* rpc_method.h */, + 7521C3B21B070A87DEA95363CB064967 /* rpc_method.h */, + 7370655514EBEDA752C76B3B6C052503 /* rpc_service_method.h */, + E5C24F3890C4CE6C36359EFEE0F6EB41 /* rpc_service_method.h */, + 630E9EC214F9E235473F8EBA91AA4447 /* serialization_traits.h */, + 4DAB80ABFC5C5709021BC0268A3CA1CE /* serialization_traits.h */, + F2CA69F1A5A70221803E171B54EDD51E /* server.h */, + AEA737254896940AB0A0E90A22C30D7F /* server_builder.h */, + 42930C033D30E0C95408769940E8AE36 /* server_builder_impl.h */, + 7990616A3432B5CE7914989D87729E16 /* server_builder_option.h */, + A4A0AA75430E85336A2C4B36873E0CC3 /* server_builder_option_impl.h */, + 6A66EDDFCCC68F686309D219E83AA46D /* server_builder_plugin.h */, + 2CB28731A55CAE12BF53A8FE971AFEB2 /* server_callback.h */, + 17CEF00AA004CFD393B09091B419187F /* server_callback.h */, + 7867A1BA96A03E8F1C980E2AAEA8393E /* server_callback_handlers.h */, + 5C77AF6EB4EA42AD0D875AC763515E4B /* server_callback_impl.h */, + ED57B4D5C68FD214EC668808F26E7373 /* server_callback_impl.h */, + 34B9E5B568FC93770BE6626D4F5F58D8 /* server_context.h */, + 37F25E574F3F8F80198A3D62A0AE3871 /* server_context.h */, + D99D47646D47CE546DF15348736C4E82 /* server_context_impl.h */, + 725C58F525929D4EF7DCBA63ACE87C49 /* server_credentials.h */, + 1EF0ABEE4EA5576EC97035233DFE65B3 /* server_credentials_impl.h */, + C8FA03E68B2B6F8B6051D2A50FCE2148 /* server_impl.h */, + D806117EF85F98336E70753B24DF7E84 /* server_initializer.h */, + BEB68F5A6FCCA598215C0060142CC500 /* server_initializer_impl.h */, + 797DC204ECCEA4793FE955D926F86063 /* server_interceptor.h */, + B968209A67B472D066E21374175A4133 /* server_interceptor.h */, + 46D6B082B1EA2B1ED9216CC06A2EF706 /* server_interface.h */, + E2D944E6CD95C567660E31CC2C797A3F /* server_posix.h */, + BD6EE669E7867E6FAE6234BAEC37F3B3 /* server_posix_impl.h */, + 146248CAC22E5FC977650DF1B68DA60E /* service_type.h */, + C1CBE59511729F6F65A789D0499AAE62 /* service_type.h */, + A21399A3BD7D75F80B053BEDEFFFA4F2 /* slice.h */, + AD20A9651BFF424572F741E7C677A18E /* slice.h */, + 5736CCB1D8190AC29D63010FEED81666 /* status.h */, + 8C6EE08C23D04559BACCC047EFFB9509 /* status.h */, + DEEDEA94AB15B525343CA25364DBC905 /* status_code_enum.h */, + 76AD99BA252D8EFD6A4AABC74E6C3BC1 /* status_code_enum.h */, + 5C8505F921D4BFE5EC6C0C2FB4E9C45D /* string_ref.h */, + 577DDF8D288CD6D3EDE27C74879CDF78 /* string_ref.h */, + 52BA331001F77169CEFADCBB9A58C02B /* stub_options.h */, + F0BA40126E444588641AC50A31C65BCE /* stub_options.h */, + 1298A66348AA9C6483630CDEF02EF11B /* sync.h */, + E2F4960E27D7001F66FB146918ACB20A /* sync_stream.h */, + 9499EC6161BBF62D9D6CC424E6F66184 /* sync_stream.h */, + DC86DD624BBB8F86536B9BBD05207CA6 /* sync_stream_impl.h */, + 583465E0891F13EE0E35B79A88B240F0 /* sync_stream_impl.h */, + 7EF8D8C6613AB7477BACC0DC69B5887A /* time.h */, + 967BEABE5C0BE6793F717C6FDFEBF6B9 /* time.h */, + 6AB22F1F9925C0AA3889BA8A9F88799B /* tls_credentials_options.h */, + 9CFD1651BEC48147949B5B99E1587687 /* validate_service_config.h */, + ); + name = Interface; + sourceTree = ""; + }; + A8FB169E62490CC696F99CFFFB12631B /* have_sse */ = { + isa = PBXGroup; + children = ( + A75884DD09B8566BF894752E00DF2665 /* have_sse.h */, + ); + name = have_sse; + sourceTree = ""; + }; + A91BCD50AA774C4C602D3CA14BE35318 /* config */ = { + isa = PBXGroup; + children = ( + 133E5C2929C7B4D3823137AB4244A9BD /* config.h */, + F37130F35FDFD15BF12C013E47957649 /* options.h */, + 407F2336D528FAE4942037AE24703D4B /* policy_checks.h */, + ); + name = config; + sourceTree = ""; + }; + AA8F0E780138D97F013FE423B1F57522 /* strings */ = { + isa = PBXGroup; + children = ( + 07070DB1C41C0C5E166E3BEF6412D271 /* ascii.cc */, + A514CA128BAE38DA1C046B4723F7A58C /* ascii.h */, + 6BAE89B682408E1540F6F23CB91D3EDA /* charconv.cc */, + D45830430241957B9CEB417B5F6DD151 /* charconv.h */, + EC4FDA499726E5BDCFDFB8A78E250F88 /* charconv_bigint.cc */, + CD968E8D4F3BCC435DB29548EDFF5C4F /* charconv_bigint.h */, + 9880A4C51327F557D53BA02E4E2EE559 /* charconv_parse.cc */, + 7703E0901E3A8AE85A412693628DCB52 /* charconv_parse.h */, + 568BB452E0A2B0830B807E2D9DB447B8 /* escaping.cc */, + AF5A5E16288FED709D3068F845F4C469 /* escaping.h */, + DDAFD2F28A6BDD6C6DD7B33358B069C4 /* match.cc */, + 180D252F816C445EFE273EDA89501423 /* match.h */, + 69E56F28F23EB668D4D43E369DF0A33D /* memutil.cc */, + 3A65027B5AC3B0BEA043E518801657BA /* memutil.h */, + DB098768D6E55818F430EB6C4612D19E /* numbers.cc */, + 7E88F3326149071F9EF148B778F3473B /* numbers.h */, + 4AB52674FB7A979DD7A36DE61C1031E8 /* stl_type_traits.h */, + 4505701F268374FC5F33F6D593AFCAC0 /* str_cat.cc */, + 9A2639E3A9DAEFF8438C9E4BCF9A2A79 /* str_cat.h */, + F742EA742A187ACD17E43DB1B78C5D97 /* str_join.h */, + C678F46438323BBCB4A050D20053D017 /* str_join_internal.h */, + 3F759925CBAB1B3CB74AD7CDD9F22449 /* str_replace.cc */, + 3A831916712628AFCB8A417ECFB71FA3 /* str_replace.h */, + 50B4530602F8485407D82E1D91F5ECF4 /* str_split.cc */, + 728A441643EE84474DCC1D24C9BE8102 /* str_split.h */, + 1EA4629029ECB44825A5A15440A4E2E8 /* str_split_internal.h */, + 4FC743841BB9DE5F288C23DF81AA50CB /* string_view.cc */, + 5DFF21DE94A5E94BB5306A5FE74D66BE /* string_view.h */, + 60DCCD9C129B4D5C465D720C3CB56FC4 /* strip.h */, + A957D82CE2750495058EA01364A0459F /* substitute.cc */, + A5C51F3B802FDFD04AB847340FF10B35 /* substitute.h */, + ); + name = strings; + sourceTree = ""; + }; + AA9B3F080D135581F21260A03E4ED668 /* hashtablez_sampler */ = { + isa = PBXGroup; + children = ( + A0DE184EB41FEA223F6492A632199C78 /* hashtablez_sampler.cc */, + 697445CA7A17A5B802C3D19D046B6AB9 /* hashtablez_sampler.h */, + 0587424F4164451527E3B56AB37AD4E5 /* hashtablez_sampler_force_weak_definition.cc */, + ); + name = hashtablez_sampler; + sourceTree = ""; + }; + AE1359C345CC543613DB3E7BB88B5B55 /* algorithm */ = { + isa = PBXGroup; + children = ( + 42A3491AAFF3AB54FD6B26EFD99BB876 /* algorithm.h */, + ); + name = algorithm; + sourceTree = ""; + }; + B05E198492A248813C6C912092CDE7FD /* span */ = { + isa = PBXGroup; + children = ( + 0616886D4D867ECC1ED7D73DDC3DB27A /* span.h */, + AEEFD2B8E48EBF0EC01E473ED36CF46C /* span.h */, + ); + name = span; + sourceTree = ""; + }; + B8C22FCFCB1615CE1B19B6A0A6F1CFAB /* malloc_internal */ = { + isa = PBXGroup; + children = ( + 12709ACA310AE10CD81CEB0D221D27D4 /* direct_mmap.h */, + F8A07008189BAAAC95B608E3B032B911 /* low_level_alloc.cc */, + D14D669FA9F70C2AC3B78DA3D6322BEC /* low_level_alloc.h */, + ); + name = malloc_internal; + sourceTree = ""; + }; + B94D7768568A9992200DB461E8CF687F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7F35613C4F4E3108C57604900BCBC3F8 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + B9D944FD0A7C8CF93F8EAD96DD3CA183 /* str_format */ = { + isa = PBXGroup; + children = ( + 9178E47C67BB082F4BDD3542702F00C4 /* str_format.h */, + ); + name = str_format; + sourceTree = ""; + }; + B9E82B6696F4AFAEF1578C01CEE70486 /* demangle_internal */ = { + isa = PBXGroup; + children = ( + E8CD1879AB4564BF8AC4F8C9DB056B8A /* demangle.cc */, + FBF3160F613DA48B3D45168A65B04115 /* demangle.h */, + ); + name = demangle_internal; + sourceTree = ""; + }; + BA42DE5E189045EEE72C8050BFA74251 /* Implementation */ = { + isa = PBXGroup; + children = ( + C4DBDFAA01677E09DE671E3F9C9CAB05 /* accesslog.upb.c */, + CD432985E39A59D2A752A839C6572213 /* accesslog.upb.h */, + 55E380F447B00CF092B74F18F0CB691C /* address.upb.c */, + 49E63A1B0B7D97A30E89DE05BB773936 /* address.upb.h */, + EEA6677EBD90EEF8BE67C33C69A74973 /* ads.upb.c */, + 67F87B58CDE8C6CA4193815173DAB3D2 /* ads.upb.h */, + D7EF5070003F64714A164D4FD8259C26 /* aes_gcm.cc */, + 585EBA7BE3A68C247364F6F5F9F1AD0B /* algorithm_metadata.h */, + 52E4F31901D668E026F8F75AEB5FEB08 /* alloc.cc */, + 1913DCB78682B6D5A6D7987739E4C702 /* alloc.h */, + FE9F9F9132B59241634C2AF133BF85C6 /* alpn.cc */, + 24385D56D890C859D59455A951BF4D46 /* alpn.h */, + 13A7018941419937399FAD63543E6F1F /* alts_counter.cc */, + 18E1B8B1DC940C40B0291001AAFFE1BC /* alts_counter.h */, + C07F6A0A40C9DC31FA0BFE51E0F3F29C /* alts_credentials.cc */, + 64977221336CEF3D34926E7F9B2250DD /* alts_credentials.h */, + 0A1D55B7B87A1B1071195814BD0BE75D /* alts_crypter.cc */, + C059B70AC0BD62C9C8C01173AAC7101B /* alts_crypter.h */, + 9DD50785C581B619221C9A00D0002FC8 /* alts_frame_protector.cc */, + 4A37C441D777E90C6764BF3834EA1B75 /* alts_frame_protector.h */, + 7750342932155F7D2878D0BBCADB9E54 /* alts_grpc_integrity_only_record_protocol.cc */, + 18F1E9F059C0A110CC44A15DF13F9E48 /* alts_grpc_integrity_only_record_protocol.h */, + E0D4564FBA5A59532E2A16562FFEA7FE /* alts_grpc_privacy_integrity_record_protocol.cc */, + 1F647CDDC588AADF1E6A54C30B1AC6E0 /* alts_grpc_privacy_integrity_record_protocol.h */, + 4B472C585FF3AFE6DA27A2D064C8B019 /* alts_grpc_record_protocol.h */, + 5BE35EF523E5713C7DC02E3074BAD1EA /* alts_grpc_record_protocol_common.cc */, + A554763492A7AE4913B09C3FB632A059 /* alts_grpc_record_protocol_common.h */, + D6A514080E058250E5A53F49CDD116CD /* alts_handshaker_client.cc */, + 4E31D1C1A5A47DBC716FC276D230DA13 /* alts_handshaker_client.h */, + 01B3A05C0CD77B8DFE62014D8A623B76 /* alts_iovec_record_protocol.cc */, + 9725C5F072EF77446F1746D2294B77DD /* alts_iovec_record_protocol.h */, + 128BA0920634D6FFD02EFBFEB26D37FB /* alts_record_protocol_crypter_common.cc */, + F4CDC11C5CE10922CC54F8623B421F06 /* alts_record_protocol_crypter_common.h */, + ECD705304334C7CACBFD7A8852C3A144 /* alts_seal_privacy_integrity_crypter.cc */, + CFAFB90C55F040EB8BE36A53562024A4 /* alts_security_connector.cc */, + 38FC04DE1D076ACF463126268796D2A8 /* alts_security_connector.h */, + F5EF88EDBB1929F1B730A4C4243898B5 /* alts_shared_resource.cc */, + 4240E54F4AAF1F1901EF558A20C959C8 /* alts_shared_resource.h */, + 35A78741B92DC5A19643DFCFC54E57DB /* alts_tsi_handshaker.cc */, + 561C73C1E83BD2580E9141F5AEF08ECA /* alts_tsi_handshaker.h */, + A6477AED5C47C17A2825B86E3920E093 /* alts_tsi_handshaker_private.h */, + 10D0D92283FDFA365217D785982D524A /* alts_tsi_utils.cc */, + 1CB284BD2ACEE8F0D301A63F8B46C27C /* alts_tsi_utils.h */, + BCF66273E55F5A6AF80811B117615C86 /* alts_unseal_privacy_integrity_crypter.cc */, + 1FB2C64DDF5C1DD923B787E0EF664418 /* alts_zero_copy_grpc_protector.cc */, + B7D075AAA4EA4B9A66F838FB07E06537 /* alts_zero_copy_grpc_protector.h */, + 11493E67BC46E222427792FAAF39AFF8 /* altscontext.upb.c */, + 5732F2A90FB96DDE7C876A7831FA6772 /* altscontext.upb.h */, + 06762793F5E47A79E012F1948C1F661E /* annotations.upb.c */, + EDF5C2B9E092AC473CE996CC5F92F75A /* annotations.upb.h */, + FB89F3C63BC67038371022710B8302A8 /* any.upb.c */, + 182541468796261FF9A289D16ADAE3B0 /* any.upb.h */, + B85686523B51ED1B96C574E89BE80623 /* api_listener.upb.c */, + 3E87A37252B47E86765B38E1546BDD73 /* api_listener.upb.h */, + A5E574F17FB22368716C845CF5791C94 /* api_trace.cc */, + FA833410DD39DA0A15099F28876AA2AE /* api_trace.h */, + 66AC3F8AD68A10DA9F61CEB020C00256 /* arena.cc */, + 4A3899B023FABB06DCC73CC4AD4F4605 /* arena.h */, + 88FDEDAD0531906F2A06282D40C09148 /* arena.h */, + 37136FF8C80063F3DF8F522C22C01715 /* atm.cc */, + 753542788C5C091470AF4D13364A6DAD /* atomic.h */, + 0AB0046377B280A57EAB8E730B88997B /* auth_filters.h */, + 8458232314DD82060D06DB2B6FC52765 /* authority.cc */, + 1A9167BEC72FAF81F898D49F8EDB5801 /* authority.h */, + B8303536D8311470048E22BAD7C0022E /* avl.cc */, + C43DF0BBD4AAB949A2BACC8206E54CF9 /* avl.h */, + A91898EDF2231E16F7E340C782B13AEA /* b64.cc */, + DA7BC2043F5D30ECC6235DF242F8DD6B /* b64.h */, + 49E11B75F61BF294392D1DF088D66C4A /* backend_metric.cc */, + B877A4481E154F4843BE2B7B6BF110DD /* backend_metric.h */, + 32E37AB10A454FA367DCDE649A0489D1 /* backoff.cc */, + 1DAD54AEFF45B76E2F97203CD59A4543 /* backoff.h */, + 48714E806CF47F9772053FE937AA391F /* backup_poller.cc */, + F8B83F4A9E5AFB2DACE6E28615F69FFD /* backup_poller.h */, + 0B839027E3077538DD420421FD65D9F5 /* base.upb.c */, + EF76B11D8DE5C0B489E5BA1A585CE327 /* base.upb.h */, + 6A39D41DEDC8F04603A76EA46AA2AC37 /* basic_timers.cc */, + AC1A7B92A2E51C886809807B73BD01EC /* bdp_estimator.cc */, + 44FE1F32C1768389A81F0A6275733508 /* bdp_estimator.h */, + 6F420F2D85E8C5958F23A7FD784652FB /* bin_decoder.cc */, + 2DCAFFC8B7C9B05A7879283CF23CADBC /* bin_decoder.h */, + 1125D712F1F7D8DE064C2CF7D8EC1FEE /* bin_encoder.cc */, + F6B0C0FD283587E498CEE3A6EBF788CD /* bin_encoder.h */, + A5430633590CF29EFC7B2AEDD2AA5A96 /* block_annotate.h */, + 0B448218FE1A4BEB721E3651987E28FD /* buffer_list.cc */, + 429CDBFF1E41ECF06C4D98A9CB755343 /* buffer_list.h */, + 45C2F0C6B6C2D46D99976D4F5529040E /* byte_buffer.cc */, + ACBBEC8E052441D95D28727A20F34D79 /* byte_buffer_reader.cc */, + 42DBF69F67A26054C8A87F2EED5A5D44 /* byte_stream.cc */, + 08673AD396301BB45B9A477046C3BF02 /* byte_stream.h */, + A91305DD4667353F0C3B30286CE14858 /* call.cc */, + 81DA4CB165A8EEC88E496A06AC7CB66B /* call.h */, + C11001863E0DC4ECF24BC41B2E2351B2 /* call_combiner.cc */, + 3E15A49E106AA5251194810E927C2F4B /* call_combiner.h */, + 21DFF18CD05CDE57222DF9BACEF5B5D0 /* call_details.cc */, + 8AE634B6B9748B1FA94196BC908BED03 /* call_log_batch.cc */, + 7C5717E23D4A6FBC8DA13F9A13BD24E2 /* call_test_only.h */, + B90C8BFB4C62A1154FC047C735BBCBD5 /* cds.cc */, + 2C085694E94AAA83168675A0ABB22D77 /* cds.upb.c */, + DDFAC152A766E48750F028897C6F6DC2 /* cds.upb.h */, + 0F5ECBF97CAE261EAC200C6D49C4F08A /* cert.upb.c */, + DC38E35A4C8A73FD7F3F2376D18987B8 /* cert.upb.h */, + 0EF9D1F74E34B509558AE353EBB49FDF /* cfstream_handle.cc */, + 48F9284EBAC70D1E68FE63520EFE0BC9 /* cfstream_handle.h */, + 3E711594F3475539AD1CACDDE4DBC420 /* channel.cc */, + CB32E308C5968F01A8B4A53F87A867B8 /* channel.h */, + D5119B025539C487983DF46575884379 /* channel_args.cc */, + 2840A7C135CDC9EF86C8D46ECC0C47E0 /* channel_args.h */, + 15379C1083DD29AB800A7782C38A7AA9 /* channel_connectivity.cc */, + 34DEA3430BABF027DD56B324986636DE /* channel_create.cc */, + 03B5E77F4EAB14191E0B906E65441D6F /* channel_create_posix.cc */, + EB148691BC2F24E1B936AA61EC8B3DCB /* channel_init.cc */, + E49189552843572545B0263578F0A98A /* channel_init.h */, + ECC1A74FF0C5A03AA6AF2ECC873090EB /* channel_ping.cc */, + 1519BB64EF3C991F8EDACE43C2758BCC /* channel_stack.cc */, + 32D673EFA5DD266B72426A27401141D0 /* channel_stack.h */, + 882C41FE349F253C9BDC4BAA5D56AA83 /* channel_stack_builder.cc */, + 9DA268B568DC346FAA7E9EA795F8A8C1 /* channel_stack_builder.h */, + 14338412315B7FC7515BCB1B997CAE6E /* channel_stack_type.cc */, + 4C80EFEA0137B3537C4392910BD6EF74 /* channel_stack_type.h */, + 55D585EE92D5882AC28F9B12C6E3FE0F /* channel_trace.cc */, + 06A9E865AA36BFC1B00F9E7E745DE6F1 /* channel_trace.h */, + 3FD574DA2FA452870EC12EBE316A0FBC /* channelz.cc */, + B9B8640AFD3A0D5E5D8E7B48D1AC36F4 /* channelz.h */, + 3A705335B43DA99B5322E05DC7A4AED8 /* channelz_registry.cc */, + 8CA9118C0853A93F8E99CD19D4812CB8 /* channelz_registry.h */, + 60AD273010453FE5738BCB00AFA98D79 /* check_gcp_environment.cc */, + 7AE6E2132EF7656B6810B0DB4FC5610B /* check_gcp_environment.h */, + 5A9D2FD971EA50C4B5B04E83C97609A4 /* check_gcp_environment_linux.cc */, + 6E2C4DAB9B1F9F5FADB214D3FA05F90E /* check_gcp_environment_no_op.cc */, + 06543595F0017DA7C2D864B8C59959DA /* check_gcp_environment_windows.cc */, + EFB8821C2B01004562A7683C2880B9C1 /* child_policy_handler.cc */, + 5BEA5E74CFEE66ED0688BAD4176E42C9 /* child_policy_handler.h */, + 3DB54510A83FDE9E6144ABD2AD77235E /* chttp2_connector.cc */, + 635CDD0C54FA76F8CB9052C2E7156F50 /* chttp2_connector.h */, + 1BC28FABF554ADA856CE3883B7D1C357 /* chttp2_plugin.cc */, + 8ABA3904F1F65AC67FE1F4EB01534486 /* chttp2_server.cc */, + 1356E5C2283E0942CFDFBE52BA0942DC /* chttp2_server.h */, + 1A6700B6D0B90896DFB60A6850407AA6 /* chttp2_transport.cc */, + AD0FADFA76F83284B62934281CC6AC18 /* chttp2_transport.h */, + A8B3B2F75C9E79B4CCC58B400E7EA868 /* circuit_breaker.upb.c */, + 632762789A1D19AA681DC4AA5B81A8AD /* circuit_breaker.upb.h */, + DF4B8B07C5FB3D7F560906F99E7C11BD /* client_auth_filter.cc */, + EB1A968E222AE20414824C188A1A0FB1 /* client_authority_filter.cc */, + C0D4BF860FCF3CB320E8D08BE31CB6AA /* client_authority_filter.h */, + D74150405DBF0D26F917BC578291DCF1 /* client_channel.cc */, + 19F8F9E30A7E6292F27C8FEC8E88F9AA /* client_channel.h */, + 69327BD8613EE4C447F311D3C38EC636 /* client_channel_channelz.cc */, + 6CD7E598A744FDA9FD16EC55E8643D1A /* client_channel_channelz.h */, + B3614B9E60A4883B9A98F50776F1746A /* client_channel_factory.cc */, + EDFD570883F6D2D879064CDBD947045D /* client_channel_factory.h */, + 382B48D78383BA4EC5774D0ED1543DFE /* client_channel_plugin.cc */, + 3EF8AF8A90604349280F03259FF00F07 /* client_idle_filter.cc */, + A62139F07699F4A3238DCFB24654FDDA /* client_load_reporting_filter.cc */, + CCC1745DB5372F9CD973303AF0DE1ACB /* client_load_reporting_filter.h */, + AB974890D4BF327B904955BCF2182AEE /* closure.h */, + 0546C9F4A64E4E5EE7C9030601390424 /* cluster.upb.c */, + 6FD3F5FD722AE7C27691ED3E992EE06B /* cluster.upb.h */, + 62E5E466B0FA04CFB2DC364B1C5B815B /* combiner.cc */, + FA738BD4985005BC8490C1FA0F63003B /* combiner.h */, + 1C393122811C651E2FBA2115CA45DEFD /* completion_queue.cc */, + 620BF7A8931A330D38F19B2087BEB8AA /* completion_queue.h */, + B7FF7729957306D9027B07B3BD4C7F1F /* completion_queue_factory.cc */, + 5CCBC26D6661F84EC915A3F121F83D06 /* completion_queue_factory.h */, + 0AD2424201A62E5DB79CA3BAB789C27E /* composite_credentials.cc */, + F5E25607BD68162D90074FF9D1A0FB1A /* composite_credentials.h */, + D55A21B8612C3744B9FF79B123CBB6FA /* compression.cc */, + 211C1F617812FCB36039E168586EC6F9 /* compression_args.cc */, + 957DC20A7FA2E082E900F1EE47BFAF05 /* compression_args.h */, + 31E4E51E717262B92F1721361794F8D4 /* compression_internal.cc */, + CCF3050B8F684E641A61005EA0A6D8C0 /* compression_internal.h */, + D76149D5B3D2748BD77035C8553FB63A /* config_source.upb.c */, + 84B82D9E038D349AF015B40853CD1C09 /* config_source.upb.h */, + BCDFDD5A82F42416C11FDCEBCEF4F35D /* connected_channel.cc */, + 365FA78B1287711599C9B8AF26FA7F62 /* connected_channel.h */, + 48EF9FFEC74353F57A5647B7B7E82CF5 /* connectivity_state.cc */, + 0B0E5B3C7D3A20D188AD4592B218893B /* connectivity_state.h */, + ED3A1DC6B9FE0788D7C08386FDC324ED /* connector.h */, + FEA2C9E67C4452AC95FF0E0E799F9D69 /* context.h */, + 01AA09207ED07385DCBF635BAFA70C38 /* context_list.cc */, + 204F44207D81AAC775BF1E202108F385 /* context_list.h */, + 6A40217F6693BAFCBD8ED3F005007FD1 /* cpu_iphone.cc */, + BDD988DD3C6BF4ED823136D32F96453B /* cpu_linux.cc */, + 0AE207E4501D5AE4978FF3C1838D1ADB /* cpu_posix.cc */, + FE9F0215D2AF3F8BA7BB19BD77B1D1BB /* cpu_windows.cc */, + DA68EE17DE7FEE9FD0AC0B1913D624EC /* credentials.cc */, + A9E4BAEAE257CE5BF099CEE6D9CFEE1D /* credentials.h */, + DE8B6B11502CA8ED37E537FADA851DA0 /* credentials_generic.cc */, + 32045BB58E6A962E5010F9232903DF89 /* credentials_metadata.cc */, + C6FC9F98592D1139A0D409DDC4E71088 /* custom_tag.upb.c */, + EB454D797281307398578203D87FEAB7 /* custom_tag.upb.h */, + D8C942792EEFE63287C868126C41DF44 /* deadline_filter.cc */, + 6B3264F286DBC219137465BA6C19CB09 /* deadline_filter.h */, + 7C34E45B0FE3B78A67E97766592B8092 /* debug_location.h */, + 053213A0CC6738A69DB6FBBE362E3E75 /* decode.c */, + 40684F02670C5E032C82259DBCBDC2AA /* decode.h */, + 6FCF885D31138F964D4DED96FF4B14DA /* deprecation.upb.c */, + 4583E9CB7FEEE33105B059F2D82BFB72 /* deprecation.upb.h */, + CFB9A6C63751153BC747E55D43B375E3 /* descriptor.upb.c */, + 2DAD39114F176ABDAE1D3505716D04F4 /* descriptor.upb.h */, + 60E4DA724A5BD20EC44D42863D5DE697 /* discovery.upb.c */, + 84D2ACEE111EDDF5B6DA799B4694EC47 /* discovery.upb.h */, + 8429896309152F60325A57BE1CFE6382 /* dns_resolver.cc */, + 034BA6ABEAC3D0030D96059FDD8085BC /* dns_resolver_ares.cc */, + CB98B1EEEBA6CDEC82C29D97F81668A5 /* dns_resolver_selection.cc */, + AF6E0F94D9485229CFE1242EB04ED666 /* dns_resolver_selection.h */, + AD83148BBABCCAF7D2F2991318C03BA5 /* duration.upb.c */, + 3CCF900FF44FCAE833AEE9C6E5CE9212 /* duration.upb.h */, + E72B56008D3132A59FA1190FE8B413D1 /* dynamic_annotations.h */, + 1BE7D11636B0B07F20A9BCCF4B580D3C /* eds.upb.c */, + 8A8CD361B2A2D4A86816AFA83E23A5C7 /* eds.upb.h */, + 760292060E9C9A9DB8985F31CDAA12E3 /* empty.upb.c */, + B93C5630D5435A7B6CBB7527395BE2CC /* empty.upb.h */, + BADAD519CFD8E5CEB574659BB63EB6C8 /* encode.c */, + 01A752FC79D38A266A296BBC11BEF111 /* encode.h */, + F67FE899F9D2D76DF5500524B1D6A157 /* endpoint.cc */, + FDB818CE2139D1F1F49FD25FBF04A68F /* endpoint.h */, + B212E1EA3F28797855E0155D59F86AD3 /* endpoint.upb.c */, + 6EA633D54E25B242F06A1362C952E70D /* endpoint.upb.c */, + 60DBA1068D5F2F91374DD33CC685B627 /* endpoint.upb.h */, + 35C6E34D3BF3E17F698291949B8A853D /* endpoint.upb.h */, + 910313BAD7CAD36747FA01457BC4ECD1 /* endpoint_cfstream.cc */, + 1E91F82DCB0AECFDF7CC2719334D1909 /* endpoint_cfstream.h */, + C705266C9BC559B117BE781A5F6784CF /* endpoint_components.upb.c */, + 21F061F543BD2B7C5A77DF17DE9EF163 /* endpoint_components.upb.h */, + B8F5D730C790565BCD245A8E8D89D8AF /* endpoint_pair.h */, + F455A496C1F3D69F6114BC76FC796D84 /* endpoint_pair_posix.cc */, + 32E524FF275CF724F70E0D625A502FE4 /* endpoint_pair_uv.cc */, + 22EB140C32995E200292BBAA294DD425 /* endpoint_pair_windows.cc */, + D7F0EFA07241EDB7C86BBE9C0994F124 /* env.h */, + 21C3F2A96C0E4AA7B2B3DD91214C7024 /* env_linux.cc */, + E83FE6E67F31928F6E97E0162BBFAA8E /* env_posix.cc */, + D9640BAB2CE5E08CA68F04E245F0C7F0 /* env_windows.cc */, + CC4A63E2A2A0F9CCAC332C57C650BDD0 /* error.cc */, + 3CA599690024C45B7D3F178A156F9517 /* error.h */, + 442E2F112D7DB4047BF287BC7874BAF7 /* error_cfstream.cc */, + 4EF0EA5F6C234102A14DDF0969DE4782 /* error_cfstream.h */, + 039BEA729826C3D85DA222EC6F94975E /* error_internal.h */, + AC4D2EB60ECE5CF6ED2237BDA6E79CA3 /* error_utils.cc */, + BA7135395A9444571CCD8E81298A659B /* error_utils.h */, + 748B2260BF1522BC284270557AC5DF69 /* ev_epoll1_linux.cc */, + F6A593B29FF8456257AD9767E1EE0BBA /* ev_epoll1_linux.h */, + 9938E14D8183D70AD20895E3EFA1C295 /* ev_epollex_linux.cc */, + D582928E748E3172B559F84ABAC5F1AB /* ev_epollex_linux.h */, + C08BBCFD2E1E030C2A149B618CE72893 /* ev_poll_posix.cc */, + C5023C9AD47210C9FDB7C03D14544B73 /* ev_poll_posix.h */, + 1A25A10DC894BE9B6525486EC902E13C /* ev_posix.cc */, + B60212C267ADB81DCD9D45751AF8BCFA /* ev_posix.h */, + 32296CC35C4C6686456F9FB7699236B4 /* ev_windows.cc */, + B524E63494FE7218A5BC92D6C350F71A /* event_string.cc */, + 3FDE2E76DEFE8E85CFD4755F929091FE /* event_string.h */, + 6C18979A49656331100B8E0912781C5B /* eventmanager_libuv.cc */, + E590D2875C3BC56D26EAF797BC85AD88 /* eventmanager_libuv.h */, + 74B9F2FBCA145AC94E4AB4527DA50546 /* exec_ctx.cc */, + 511739E7E7C1E7FC6C57CD61A8F794D4 /* exec_ctx.h */, + 606A72855987161C2401EA9E921AA06B /* executor.cc */, + 7C5EF2CBC6AD04A4862AAD83FA3CD8CB /* executor.h */, + E83774E452AC21CACDCDF4A75561AE43 /* fake_credentials.cc */, + 4FFDDB0D890246CB3926154DCADDC6F1 /* fake_credentials.h */, + F60F47E2B7FF6B33A23F66F1863C54B3 /* fake_resolver.cc */, + 977E014A4754BB8C4B0A8CCD7E461144 /* fake_resolver.h */, + 01F0E948191D8F9107418B1954815CD9 /* fake_security_connector.cc */, + 1622DC85A779012D11AEAD69D528003F /* fake_security_connector.h */, + 7158AF3EA4F8FE893DF82964AED61FC4 /* fake_transport_security.cc */, + EBFE9E298F6BE2F8EDD6EFA38A31934D /* fake_transport_security.h */, + 26716858B5A91D0AFA538D833B251738 /* filter.upb.c */, + FE3D599FF436D35431DE4C357824F0C7 /* filter.upb.h */, + 25A6818872B9D1654FE68E68B22DA7C3 /* flow_control.cc */, + 3981B5D272FE54939C07182ACD00E735 /* flow_control.h */, + 0A09E4563D0F22CD71C65BB902A5AE40 /* fork.cc */, + F2E81AC51019F0FD3D5ECD6A75D29621 /* fork.h */, + 8F634D50652E2BFF3B1482A0B19B47AB /* fork_posix.cc */, + 3DABE1A5226AF62B55FDFA414FCF140C /* fork_windows.cc */, + 1AB8D181D31620F5CD2033EFCE4388DE /* format_request.cc */, + 06FBC15D3658E1B0EBE51204B312B299 /* format_request.h */, + E529C5C7EE13336B343F49BB289452D1 /* frame.h */, + DE795E37D113F7626530E15A195367A8 /* frame_data.cc */, + 9DBC24144AC4AE30B20D02AA76B71B7B /* frame_data.h */, + 8250B6E23F5C421DC9D28BDE6F0EFAE8 /* frame_goaway.cc */, + 379CF150978B0F5A23E159DC42331CCB /* frame_goaway.h */, + 54F2A42B4B79396E756DCBB00FC730A4 /* frame_handler.cc */, + 16CE1112F5DA7855F8D9CAD46BDFF5CC /* frame_handler.h */, + B32672A04A2CE687168D966736235A06 /* frame_ping.cc */, + C0FCC9F65B74D5C5872E549E75D35474 /* frame_ping.h */, + 578BA6C09B305AB6F8451B48B88B4D8C /* frame_rst_stream.cc */, + D71F48199E579FC9CBE6062B7E093227 /* frame_rst_stream.h */, + 7117926BF223B96B69F21906D44BA768 /* frame_settings.cc */, + 9BDE6E0D386F7AF73EEAC9F7564A8941 /* frame_settings.h */, + D41CFF0716D31BD2ABEC6258B737A37C /* frame_window_update.cc */, + 1450166D6224B9D3744B09172A7EBC19 /* frame_window_update.h */, + A88591E1AA68479C3F7CFF5862D565E7 /* generated_util.h */, + 938D47EB98925AAC75F84424C624BD35 /* gethostname.h */, + FC35B5E778E247E727CF82C0C86D56DE /* gethostname_fallback.cc */, + DE3E07C607F96BF8E06E006E44C6A2FF /* gethostname_host_name_max.cc */, + 8007CB382231B37504C9AF7B4CED259C /* gethostname_sysconf.cc */, + 3D4AE169D8ADBE9D89664991B5D6DF0D /* global_config.h */, + 8F3EE303E9B2E59CE4CC163A96BFEE5F /* global_config_custom.h */, + AFDED5A80D701F4DCE0B5E71BF2BB9A2 /* global_config_env.cc */, + 974D0D539DDB59B539BC1F7F43913A90 /* global_config_env.h */, + E10BAA4C2777BE15FB6BA268E429706B /* global_config_generic.h */, + D59A0B9DB2BF57DE8FB0F91247D3FEC1 /* global_subchannel_pool.cc */, + A0733CD04448701C39EEA1F5C0270133 /* global_subchannel_pool.h */, + E44F2ED4D0FCA1EDB6654DC189D58C92 /* gogo.upb.c */, + FB4E17CA503AA15A2D1C6290A2B7CE5D /* gogo.upb.h */, + E282F6D408EB0F0B513645CDE871D69A /* google_default_credentials.cc */, + E72F4419733B8C21D797E9E594B8A977 /* google_default_credentials.h */, + 9A449B0A5202F58351E26952D3A60310 /* grpc_alts_credentials_client_options.cc */, + 3F387FBA9DDCDE0212264495DB93AF3A /* grpc_alts_credentials_options.cc */, + 527B0E3FDE01E7A23AF4B743981950B7 /* grpc_alts_credentials_options.h */, + 76489A841AE3766DCA096942FE84094E /* grpc_alts_credentials_server_options.cc */, + 3EA6970878B97E9A4FE428BDB39F3FA8 /* grpc_ares_ev_driver.cc */, + 93C2111EBE4E82E47FE26059B387FDA2 /* grpc_ares_ev_driver.h */, + DCF3958E0C5B380C0F1EA053B4DC876C /* grpc_ares_ev_driver_libuv.cc */, + 2C3E948E4FE08B40EA7338760D24DD1C /* grpc_ares_ev_driver_posix.cc */, + 3C2674DF3DB6BF983145BF1D7CD207AF /* grpc_ares_ev_driver_windows.cc */, + 9F2BA1E33746B7A3E852F8F7C2365178 /* grpc_ares_wrapper.cc */, + 374133BF7EDBB2EFEE3F257750EF244E /* grpc_ares_wrapper.h */, + 75372A0EF1BBDA166E71C7F6E233BC97 /* grpc_ares_wrapper_fallback.cc */, + 3B9B1ECECDCDF419D009ABF477F942CF /* grpc_ares_wrapper_libuv.cc */, + 884024A8F005AC8A9CC7CA68172EC129 /* grpc_ares_wrapper_posix.cc */, + 0A38A12C2A35B6D0DC7D79C94E231260 /* grpc_ares_wrapper_windows.cc */, + 89A501D9B8CCD468D97F793DC06F27B6 /* grpc_context.cc */, + FB3B138A1856E682C0F461A346EBF053 /* grpc_if_nametoindex.h */, + 237729985839977E254A147F3938091B /* grpc_if_nametoindex_posix.cc */, + 328687CB79C415F176336CA8784493F1 /* grpc_if_nametoindex_unsupported.cc */, + DEBF0F3DBAF13B61A17C043E19188AB5 /* grpc_plugin_registry.cc */, + 7E9BFB96EF97B46DA6BBE29783375AA5 /* grpc_service.upb.c */, + 32358534B4C8D3248C3E4FED34D71A64 /* grpc_service.upb.h */, + 050849C7F064DCED00CFCA2CCE677D3C /* grpc_shadow_boringssl.h */, + BDCEC0B20E171A7777A851872F76C946 /* grpc_tls_credentials_options.cc */, + A19F3068182DE62C6728C21C22646D12 /* grpc_tls_credentials_options.h */, + 3B0D4F4EEE4AE85072814B6355F52787 /* grpclb.cc */, + 1254352DE4846BFEB37C5C536523E0ED /* grpclb.h */, + E396080735EF6DBEBC78DF1530D6010B /* grpclb_channel.h */, + C722FD41DE216F5E42D8B5B0BA8A2170 /* grpclb_channel_secure.cc */, + 7572A863E8A97143CF808BF6215BFA80 /* grpclb_client_stats.cc */, + 2DF221C1FFACB0663A4F79785651851C /* grpclb_client_stats.h */, + EED52649B8D265AA1260608D8313C339 /* gsec.cc */, + 9AD01CBC19BBBB43A67E6767D3181791 /* gsec.h */, + F2EF1BAB52858C3620B34AAC6C0E2651 /* handshaker.cc */, + DB01EEADFD8F4283D79402AFDF7526A8 /* handshaker.h */, + B9C07D39456BEB25DADB8C12C3CFF84D /* handshaker.upb.c */, + 75BB1AFF2F9D9F5D67043A052BDF2AEA /* handshaker.upb.h */, + 7350DC0B08E336D1D3E82BF84F331768 /* handshaker_factory.h */, + 2C61B9B39560686FB2014E2184FA6FBE /* handshaker_registry.cc */, + 3486899FD16BD9A45BCB1987AB4B2F84 /* handshaker_registry.h */, + D9BF85B1AA5E6DC22635795555EDFC90 /* health.upb.c */, + 77F988063E3B618B1E15A040CC1935DB /* health.upb.h */, + 46E075C8BED1B36D60EF96BADFF8B9FB /* health_check.upb.c */, + F37E2B4B8FC4316895B7F43046408D13 /* health_check.upb.h */, + D0068BCA45A5140365FC9EC41498BB74 /* health_check_client.cc */, + 56A5ED8B90D19F65FB85B63F6A3ED587 /* health_check_client.h */, + 2FCAC336BC66411001319E2B41742D39 /* host_port.cc */, + 0FB7500FDD218447E2A8951E79D047ED /* host_port.h */, + A89788D1A47DC75E3E0E61C6D7FAC9B2 /* hpack_encoder.cc */, + 6CC8110A37ACE35506B4F0D1694ABB09 /* hpack_encoder.h */, + 68752EEB6A2A54E14D19F0FB23FAAB90 /* hpack_parser.cc */, + A6D62822281C54A60773896EAD6FA9D6 /* hpack_parser.h */, + 237CE43F630563858D827DB55EACF44A /* hpack_table.cc */, + AD5F16CE4D5C90761220A70B813EA9A3 /* hpack_table.h */, + C1F602F381982562125C87D9DE821A42 /* http.upb.c */, + C0F95936CA615C11C89937BAB702E9FF /* http.upb.c */, + 6A2B7AAF021624A3B2FB10C87EB67EA7 /* http.upb.h */, + C8327A3256B4CE3C87DCCEA19397E6F3 /* http.upb.h */, + C84D9865D597EFA2055680E9A871A64E /* http2_errors.h */, + A7B5B09DFF1AD0648ED987A49B552909 /* http2_settings.cc */, + F64F1939265A0552BA2F9A53AE1B5AD2 /* http2_settings.h */, + C971340180014EF94FAA2EC4BCC9DAFC /* http_client_filter.cc */, + B5C0118BE6E61929008E1E1D7C94D40F /* http_client_filter.h */, + 925CBFE07879CED7AB664C795A2897F9 /* http_connect_handshaker.cc */, + 5268762131A530F53A0F5204E3F8A2C1 /* http_connect_handshaker.h */, + 27C35D8FAFC7B1C25E18F09E32279CB9 /* http_connection_manager.upb.c */, + F722B083D385D1B6922816F230665A9A /* http_connection_manager.upb.h */, + 91B819DA7C59D3ADB341E2A09FEC3629 /* http_filters_plugin.cc */, + 2BF71C89522F57A2DA99817DDB95EC37 /* http_proxy.cc */, + C0A84F8A336DF72C0ACD14A34CC6B4E0 /* http_proxy.h */, + 119566C11E2CC6F2C68CF280E11BDC22 /* http_server_filter.cc */, + 7D4BEF4E82F2C880C20B283963A36281 /* http_server_filter.h */, + 5491A1C01349E2714B8B961E419ED8C3 /* http_uri.upb.c */, + 4B758CA3A10F0A530AB2F8EF69605B78 /* http_uri.upb.h */, + 9848FEB0957948F515B0706923D185AF /* httpcli.cc */, + D5BC0AC5B88EA0B67C4E1179A9AE9542 /* httpcli.h */, + 1E9B567C2825D7F2A284331368876C7B /* httpcli_security_connector.cc */, + AB3E9C734A34DA2057BD330F36277ADA /* huffsyms.cc */, + 7E9F7C6F8DDC8752F34EB27B2EA45038 /* huffsyms.h */, + 078CA41B562783942098A5FDFC7D4758 /* iam_credentials.cc */, + B7442BB3F818B96D0B920E14ACB75FB7 /* iam_credentials.h */, + E08B3DF21340AB512474B5E6335495BC /* incoming_metadata.cc */, + 7682E873616B0AC5B4010500B87A703C /* incoming_metadata.h */, + 33E2F328D4847E3AE8230CBB7D65CAE5 /* init.cc */, + FDC6A78A78235B12BDDBE2CCB0CCF495 /* init.h */, + 00A330EC4B929E07DEF5020B6E628E4A /* init_secure.cc */, + A6B5D45C7991471C1EA06ECDB38ECC46 /* inlined_vector.h */, + B283E93B2457511449DB72A0FE8C556C /* inproc_plugin.cc */, + 502090062BA80C2295236121A94D524E /* inproc_transport.cc */, + 6C86E75121BAA1E70938E672141693E0 /* inproc_transport.h */, + AD6B66162EA7B2F1DA9F0A2B07FBDA97 /* internal.h */, + 3E75DB6E8C23E6056B158209E0EE3D73 /* internal_errqueue.cc */, + AC82E00BF2CA5BAAD779E044347C73FA /* internal_errqueue.h */, + 159E496A001CA8B05902D1308137E6B8 /* iocp_windows.cc */, + 71001072B6B65C2DC123195C1AF70EED /* iocp_windows.h */, + AFF231C1A7DC5993018B4C3F2AFEE8B1 /* iomgr.cc */, + A56CC67B0787B694FADFA2B3B9015932 /* iomgr.h */, + BCAB9C2B4E6A113E8D6D86D365C32573 /* iomgr_custom.cc */, + BD0F49082734818E144B79E58E5697AD /* iomgr_custom.h */, + 395FED92263FE00D8C1FECA38029D133 /* iomgr_internal.cc */, + E9D1E79459145589F28007C94E9EB274 /* iomgr_internal.h */, + D159D65B8AF7CC63ECB358FFF5AEC2B8 /* iomgr_posix.cc */, + C9DBE43E371330B98DAD14A7381D02A5 /* iomgr_posix.h */, + BF01A6D43CB86206732DF664B5E50589 /* iomgr_posix_cfstream.cc */, + 8786A18496EFE7861919F652FA534D5A /* iomgr_uv.cc */, + F093766FF2A26F5432830F50C0B42D98 /* iomgr_windows.cc */, + 6BE367AFF2CEE3B3275654AA478CA468 /* is_epollexclusive_available.cc */, + 5AE4EBC6D1F8771BEAAD41C611E60245 /* is_epollexclusive_available.h */, + DD41F1702EEAC76E0B5B7262243DE517 /* json.h */, + 66D7C00648CEF99F4B33717B9637DB24 /* json_reader.cc */, + 1477923DA3F1B02293B4F16364561C13 /* json_token.cc */, + A0EAC698C4F4564B197311DBE5D5B93F /* json_token.h */, + 176700011F13BBF1CBB85CB405F3D6BC /* json_util.cc */, + 6178ED876AA27BB64FEC736A9D17E490 /* json_util.h */, + FFC253B3258E7A9D1C02245FAC42D0D6 /* json_writer.cc */, + BA9F14D30DD3A8D92CCA2CDEAA0BC67A /* jwt_credentials.cc */, + AB5ACF8E43B999D518721FCE505FF313 /* jwt_credentials.h */, + E11CB86FB2859C267DA28A96133B576E /* jwt_verifier.cc */, + DFEF90EAD503C39E0C1FE1AFAF69683A /* jwt_verifier.h */, + 767CACAD361C9C0003CA194B8B071644 /* lame_client.cc */, + 946FB238E205DD9FB93C848B9F9AEA3D /* lame_client.h */, + 5F08DE081B01255064034E2AB6644A33 /* lb_policy.cc */, + 487080C34B2182DC7185465FF17F2546 /* lb_policy.h */, + 1E2FC67CFFD88121716465842FA877D2 /* lb_policy_factory.h */, + A20021D2FEE0D8C0E30C9EAE7946A61F /* lb_policy_registry.cc */, + 9BBDF31030AE611AC41E8C05ACD93118 /* lb_policy_registry.h */, + FA7AB0F77D52007714D70052EB2DA27B /* lds.upb.c */, + B4CC9C6128D4CE90F7156B239AF1A4A9 /* lds.upb.h */, + 5C98E238F3BDDE0190425CE3014F5505 /* listener.upb.c */, + 8F1FDB1BA88FC67EF05D1F562910ACEE /* listener.upb.c */, + 5B9744E060D64452ED6339052B6AB4D0 /* listener.upb.h */, + 194809C76D8E87B035E30CEE09C01E08 /* listener.upb.h */, + 2D889716CA8C2EBD7DC40C9E7718A74A /* listener_components.upb.c */, + 2BB4897CA1EA2BA8F99CEDA4B79794BD /* listener_components.upb.h */, + 2ED964BC4D3AA82AF91695733999F97D /* load_balancer.upb.c */, + ECC8BB2A7BA8DE1189AF125087AFEF54 /* load_balancer.upb.h */, + DF3E7390BAE77BB00C79037B0A5B5A17 /* load_balancer_api.cc */, + EA85FCB13A933AE95ACA4A0D34ABD62D /* load_balancer_api.h */, + D7F0AC7CEA7D6480EF1F50134E8EC420 /* load_file.cc */, + E6FE678653823AFA359C6EFE7CACB4F7 /* load_file.h */, + 5350E42C1AA2174B8763D80AA5DE7721 /* load_report.upb.c */, + 9E5671FB07752F56090B0C6377032B6B /* load_report.upb.h */, + 703E0DD09A5712BE17DDB6047211A662 /* load_system_roots.h */, + 70876681E2EBC6E4AAD038C2CB0075BB /* load_system_roots_fallback.cc */, + 4E5623848221A6B06BC7A9620EDB87BB /* load_system_roots_linux.cc */, + EE6DA62E3D3C94FE5C42637D38DB195B /* load_system_roots_linux.h */, + 9EDAB641EF9B8CFC172F1E2876451556 /* local_credentials.cc */, + 04D4A1971E007FF328FBD833184AF696 /* local_credentials.h */, + DD2B8AD9B43921BA75454041D5201225 /* local_security_connector.cc */, + 5480A47E68C11A33DA5E6CBFC3B84936 /* local_security_connector.h */, + 593290B58B1DDA02987788CE5DEF7F01 /* local_subchannel_pool.cc */, + 16FFF8B86C102F7D8F8B82D75E0F6552 /* local_subchannel_pool.h */, + 5999A20E76BDF907D48C63820256F450 /* local_transport_security.cc */, + 6312A4C21F371141D02D36D7F37ACE37 /* local_transport_security.h */, + 7FAA70998AC724B983615D3640996345 /* lockfree_event.cc */, + EB2E25A001863A1F0A3AC138047C601C /* lockfree_event.h */, + 15FDC3CBDA967B9D461007ACE3C673B3 /* log.cc */, + 3F85F26406486E83C289E51756255D21 /* log_android.cc */, + 6A932D17BAF42D2FB6E062BC540AB59E /* log_linux.cc */, + 82D93A5AD910DC73DCD6E4F52DB0BEBC /* log_posix.cc */, + 1001BFF8E5F7589AF3989A2E15EC4978 /* log_windows.cc */, + 44660551561017400EC935F864AA4EDE /* lrs.upb.c */, + C7F493F10F5205AD768A4E37DF5E5A37 /* lrs.upb.h */, + 3BAEFB567038EDFFD8219B65064045A4 /* manual_constructor.h */, + F8A4446542DEEDCDADB62112CC79C290 /* map.h */, + 2D3384A5E6A0A9074F60AB2DFC546DE7 /* max_age_filter.cc */, + 93D38C9C89251BC76A22D5EFB217A2BF /* max_age_filter.h */, + A60387F616E5571CEF9AE353F45D7C70 /* memory.h */, + 2AF3CF6540C07E060296D88034CA1892 /* message_compress.cc */, + 631429BE71CD6B8B75244E3C2C2B917C /* message_compress.h */, + 4333A065C00392A33513D7E58EE8AA2C /* message_compress_filter.cc */, + B02B5648392F5D58B25616C6AC8329ED /* message_compress_filter.h */, + 263EFB806EBF6269985D5A90F2CC4E51 /* message_size_filter.cc */, + AC3AEC3251AA008CCF6EF8411B38908D /* message_size_filter.h */, + 46C309C9CF31A4465FBC856BF4A71298 /* metadata.cc */, + 7BCBBF4B51DF8811C70E4A89B8051019 /* metadata.h */, + 631213FA203B725122B795A19693DC1B /* metadata.upb.c */, + FD9B6C8E8C8C9215BC708DCD218B5285 /* metadata.upb.h */, + 8A51EC75B0D406765BE75771944A63CE /* metadata_array.cc */, + 822D0C3423CF2B5CA2E2F2473A5EEBE8 /* metadata_batch.cc */, + 9A92C5E558F98A6C5A2854E3C2A359BE /* metadata_batch.h */, + 04454E53C1A5426BD89BE12373724382 /* migrate.upb.c */, + 842F145C13D43826889D805C80496C5B /* migrate.upb.h */, + 540B135F8C7CDC06240F239A59FE9F4E /* mpmcqueue.cc */, + 6378779BB664AE75A73E8345EF9F1901 /* mpmcqueue.h */, + 2444F8514711F64A3BDF8DF7E4CE0C3A /* mpscq.cc */, + 92EEEBC78DE622415462CD883B6A2914 /* mpscq.h */, + 77EE97F143015E95C0B1845D8C8ABB58 /* msg.c */, + ABB914CA2D8F559EC70238FCF503BCD0 /* msg.h */, + 88A6957092676D8EB869B41B41819646 /* murmur_hash.cc */, + D8CEBD833D04172DEE7C52ECEC2DBAF0 /* murmur_hash.h */, + 981429380B759381967B806CAE201AA0 /* nameser.h */, + B234CFA38D4A58A3F077DD4ECDB1F55C /* oauth2_credentials.cc */, + A3097B52F4E36CD1C180171702D18608 /* oauth2_credentials.h */, + 96FA9461DDD51A9034CD0339B4C39969 /* optional.h */, + 1268210F36578BAF3DCD8A25A0E55165 /* orca_load_report.upb.c */, + F92F53BEA7101FF595D02B9B1054C9C4 /* orca_load_report.upb.h */, + FDC80743B9299684E51D6A595D902770 /* orphanable.h */, + 4773B12D9409994ECA18BB4B13D79E13 /* outlier_detection.upb.c */, + 0AE2EB7309A8EB284195DA2B8C21DD29 /* outlier_detection.upb.h */, + D23242036D231157154F210870401E3E /* parse_address.cc */, + 95143C02666C136DC73EFABB655F1951 /* parse_address.h */, + F2B42E37529D0CFD3E5B77383C40FC3F /* parser.cc */, + 49164116CB43D8D4FDDF652EC9E0B6EB /* parser.h */, + F3B697670C29CE2E5665229D8D27E1C3 /* parsing.cc */, + C1452B0C756F28A1E66A09F6C31F96CC /* percent.upb.c */, + 9F34C27792888518DD18C8F8531DE1B2 /* percent.upb.h */, + CA854AE345848AF841C7A0D297C78EEF /* percent_encoding.cc */, + CC06571CA7534BECBFF51CB4CAEF8120 /* percent_encoding.h */, + E2462D8D4CE7B98A40B00938E441AC3D /* pick_first.cc */, + 21E538E957EF219ADA6BE4D48CB7E22F /* pid_controller.cc */, + 3CC21FF44E36769D74D00B7BFF5A569C /* pid_controller.h */, + 5D5A9878981CB08FA8BCD48682D853D6 /* plugin_credentials.cc */, + A3F52A4EF4A8E4430229297A2C290E02 /* plugin_credentials.h */, + C0995314397C451FB3BA572AEE93EAC0 /* polling_entity.cc */, + A0817D26D1636DBA54BA48A57B6E9FC6 /* polling_entity.h */, + F3719F350D9168310F18A53510C3F8CD /* pollset.cc */, + 0F1F3CF8E88DD83D2DBE7E06C9DC76EB /* pollset.h */, + AF4A0F5FF115B44C14F7017B9C059C2D /* pollset_custom.cc */, + 35C49FAEB23BB437B37D5073B9CA45CC /* pollset_custom.h */, + F71B7A15B8674D581D9403D194B0E106 /* pollset_set.cc */, + 2CC9ED5FA0A7D424B82F27AC70FC8BFE /* pollset_set.h */, + 7681F71B82ECA16770CE60AE10BF2F14 /* pollset_set_custom.cc */, + 2355BC31601975D8B7E534B0E0A2E34D /* pollset_set_custom.h */, + C829A0AD4AF4F4BF35A998E7C8B131B2 /* pollset_set_windows.cc */, + 6C6A491080ED123BA2B4869AE8D95B47 /* pollset_set_windows.h */, + 193505E21D1C48A8C5F7C950CF022AD0 /* pollset_uv.cc */, + 0478D5B0634B84EEF2E8701F70276541 /* pollset_windows.cc */, + 06D6148BF61FDC5B620DDA60B37DDA84 /* pollset_windows.h */, + 898A07FB8760FC2672D23FD7383A791A /* port.c */, + E36E31D6EAB2B8AABDAD98B7179BC73A /* port.h */, + 6B4E8AF8FB86A15BDCA4002950C15A3C /* port_def.inc */, + 8540F15ED4ADD1999CB3E095288A21AE /* port_undef.inc */, + 04488BCA843893FBC5E90E958DA72828 /* protocol.upb.c */, + BE185D6B647352A4F9246396D77855D6 /* protocol.upb.h */, + 65679A6AFC13DD9CFA432F38F3740361 /* proxy_mapper.h */, + BF0F2A4D7E6BFCE77B44D101C672CBBA /* proxy_mapper_registry.cc */, + ABE54C835DAF515535556B26177BBA60 /* proxy_mapper_registry.h */, + BA68FCEF1837B17A1D301620F1691D8A /* range.upb.c */, + 8B74CE35B81363F1FABC595B676CED52 /* range.upb.h */, + A6FCD8B2211614AEA1A4A002269310CE /* rds.upb.c */, + 6B23B91D857C394AC9B6A46BF51C470A /* rds.upb.h */, + 77119AEE9AE74035001C1D8784F9D9A9 /* ref_counted.h */, + 6FBF2A1D0779AC838966FA963A60243F /* ref_counted_ptr.h */, + 4F5E15B63F67BBA53335FC08BFD95FA9 /* regex.upb.c */, + 4F759296B3B0DA0A5116AC02E65CCB7F /* regex.upb.h */, + 559140FD3540DD8045409E14748899F3 /* resolve_address.cc */, + EEB3759F7A0F39B804221B3B53DDA1EB /* resolve_address.h */, + C8BE8279B6758E926B4976ACD4AFEFB4 /* resolve_address_custom.cc */, + CB8103890F95891B388D7F9E5FB8E2BA /* resolve_address_custom.h */, + A9F4DDB181B2A441A209A1651D4F22CD /* resolve_address_posix.cc */, + E39896542BE44F8AB97D331C8265BCF7 /* resolve_address_windows.cc */, + A58096DD9E14A2347D2CE6BC195CB534 /* resolver.cc */, + F99567E10473566C36B7068F1EE6F56F /* resolver.h */, + 0D2C92CDD47A8E0BA122DF484CFE82FF /* resolver_factory.h */, + 061E3D0E4C036EB9690A95CD28C2B174 /* resolver_registry.cc */, + 00D45ED61830C467AC4B5009EF5DC7CE /* resolver_registry.h */, + 683724E971A5E29FB54BDBD63773703C /* resolver_result_parsing.cc */, + 6A80269127372F74B3C44097DCF9430C /* resolver_result_parsing.h */, + C0C01AFC3951F03191910FD0B061E5AC /* resolving_lb_policy.cc */, + 5AF1BFE885DC98B707F2D7B123D87B05 /* resolving_lb_policy.h */, + E8AA7A1C7046681F7457AA1745BE2749 /* resource.upb.c */, + 835524689A096870E9893C71B94C253A /* resource.upb.h */, + BF47503B9F6EBE5698D99FE7D2501F3A /* resource_quota.cc */, + F17E4FD2F23A37F6AFA7CAED1D2F6C85 /* resource_quota.h */, + 1BAF187282C131CA4DC09077C4F5F31F /* retry_throttle.cc */, + 16A05B65E0D122718E9BA48EDC4EE798 /* retry_throttle.h */, + E4B09FCFA689324A0375DD7616F471F3 /* round_robin.cc */, + E11EC83D2D3AE097D3EE61259903A3D2 /* route.upb.c */, + 020893C043D192B28524F562B1DE9713 /* route.upb.c */, + 0D13BA5906839D71C59B4B8E2AFFB361 /* route.upb.h */, + B890B6474BF0D27B4CD83FBF2973F8D5 /* route.upb.h */, + 52B8FE9BAC48B868A9C5A01E67633192 /* route_components.upb.c */, + A21D417F0FE23EDBD61DA38C26113734 /* route_components.upb.h */, + CAA186BD32F13676AAF8B7B67A8A54D2 /* scoped_route.upb.c */, + 6C09B3C005F0FD627C3EA4FE43FB8733 /* scoped_route.upb.h */, + 7137352E69ACBDC06129B37CA23A37CF /* secure_channel_create.cc */, + 0AD3B8DE321285EF35E53D057CFBFCCD /* secure_endpoint.cc */, + C3F1BC53FFD8A4A51DA3A8131D9BFA14 /* secure_endpoint.h */, + 0816F65DA43C7261008884743B248B18 /* security_connector.cc */, + BD710511A69243559892D8C1A68BAD3A /* security_connector.h */, + 1CEC26D7E014356769FD7BF103D1FE49 /* security_context.cc */, + 593F0B894480261EB6B865EA99EF9506 /* security_context.h */, + A56AEF2B52A8CAA0074B21F1051F7C7F /* security_handshaker.cc */, + 7ED18D5D434887DC1392437A8F376A33 /* security_handshaker.h */, + 7F41B21455F534A1E5E49F2F1D820869 /* semantic_version.upb.c */, + AA0ECCEA54FD8EB5AE66767FD5BFE71C /* semantic_version.upb.h */, + 0565B1D3A5B1DE8B3DDD61843DB5C268 /* sensitive.upb.c */, + A60518B5C6AA0D002A4EF00B04C6F16D /* sensitive.upb.h */, + 794BCEDADBFFE2E63D0D9C0FE56DEE8E /* server.cc */, + F1D041324AEF94552F612A8347FF944F /* server.h */, + B92C6DF5A8773B02B200E0C10CBD35A5 /* server_address.cc */, + 9C865EAC1942B26D719DF51DFF7D3C7C /* server_address.h */, + 03BA24AFB91ECE92CAD89E779604682C /* server_auth_filter.cc */, + 426608583B60E305CCCCE4C445615B99 /* server_chttp2.cc */, + 2B26D1FC1C4254B7DFF79D25144A4970 /* server_chttp2_posix.cc */, + 995F520A6943DE6EFE5EEB50D42738DE /* server_secure_chttp2.cc */, + 3FAF9183B212D36621D019982E9AEF75 /* service_config.cc */, + C5C671C3A8E2619B166BB8466A4C0ED0 /* service_config.h */, + A61CC5B8ACFD1D1EA9E43F18B60258CB /* slice.cc */, + 3BA4D17A907DFD005514D01BECC450E2 /* slice_buffer.cc */, + CBE383C29BEDF8484AB6FD097D1BE43B /* slice_hash_table.h */, + CDD9B22F6A71F521E4C000F493C1E179 /* slice_intern.cc */, + 41FB1B12AF7F7444EC885F1C15DF6677 /* slice_internal.h */, + A7AB7D7BE8033FF6D64EA64A1794DB65 /* slice_string_helpers.cc */, + 0B6C0C7BACF09F445535CE0F6C779143 /* slice_string_helpers.h */, + 78BA118E8B62D64218555D3C890098CF /* slice_utils.h */, + C736C7F24FA06CEC8120148702B9593B /* slice_weak_hash_table.h */, + 9079CFE7F4F28E98663140AF17AB39CA /* sockaddr.h */, + B2E1730F19E4224F23FD1F6E112A7A47 /* sockaddr_custom.h */, + 75CDCBAB55D2D1417B5DDAD3D9886D2D /* sockaddr_posix.h */, + 46E965579B7EFFEA4F99E621F0BBEDD6 /* sockaddr_resolver.cc */, + BBD52C3309788076B92258E6C03FDBBE /* sockaddr_utils.cc */, + E021F74765601E55677CEC43369B569D /* sockaddr_utils.h */, + 8AD08B5926A35F7E6906761F0DBC47EA /* sockaddr_windows.h */, + 2A5DE4EC60B3FC05089F935D9BB40AD1 /* socket_factory_posix.cc */, + 47FDE70C5FEC483AD9C719B313814297 /* socket_factory_posix.h */, + 1FEDC036B519DEEE76ACE73F77F058B6 /* socket_mutator.cc */, + 4489DC4322E7344AA9026192381DCCE7 /* socket_mutator.h */, + 8A82A7E8392D43AF8038FF0F727AD5AB /* socket_utils.h */, + FACAAC88C97DA55E00D20CEA12A3E2A6 /* socket_utils_common_posix.cc */, + 8C3E1E8DA0687EF03F3768202880B8A7 /* socket_utils_linux.cc */, + 4E7CF74A9BFE198D6BEF3FFAA3072809 /* socket_utils_posix.cc */, + 253470E49DDF43BFA861CEA1B9873E55 /* socket_utils_posix.h */, + 1A67E4874AE7708C0705896C235FAD59 /* socket_utils_uv.cc */, + 304D0D9E970F0C33AB6FF953B13A6A08 /* socket_utils_windows.cc */, + B0938A6AD23650847BCFA32BAD6CFDC6 /* socket_windows.cc */, + C7202C5F56C36FEA4840D0810CFEC451 /* socket_windows.h */, + B1EFE2DBE6BE5918A384AF3B7CDBE9AA /* spinlock.h */, + 66B6E75D106679E1527BAD1A3703A794 /* srds.upb.c */, + 8BB180D91ADEB406F8D06B6685881A4F /* srds.upb.h */, + D35568987CB22CF82E321EAE0BC6A752 /* ssl_credentials.cc */, + 398FA6BE3CD65C056358FBE7EBBEDDC3 /* ssl_credentials.h */, + 9DFB4312445B14C11C2146B1478E0E76 /* ssl_security_connector.cc */, + AF01CB3AD0BB7E0A4582EACC66AAF706 /* ssl_security_connector.h */, + 5F5259DFB2A55854D10423172A45D1FE /* ssl_session.h */, + 5D3BE554095280180E5BD93BFA2ACCC2 /* ssl_session_boringssl.cc */, + BC7837EC1934C77FD3D8F0DC9948586D /* ssl_session_cache.cc */, + 34391FEAE71B56A3166780B622652052 /* ssl_session_cache.h */, + CAF3A088DC0DFCAD5B04CD156CA78E5E /* ssl_session_openssl.cc */, + 733103FD9FF89DCAAE38FCA5E7848460 /* ssl_transport_security.cc */, + 2CEAEB7D39DF0455F6BBB6B997BFF411 /* ssl_transport_security.h */, + 003E83FF1B679A9B48F56CDA90C03386 /* ssl_types.h */, + 43E435037B59162BC0485738ED724D4E /* ssl_utils.cc */, + 84E4957692C9D0E838B00A0F2D9C6327 /* ssl_utils.h */, + 01C5A712FA078A8CBA6C8365E1EA071A /* ssl_utils_config.cc */, + 24E19AC1A5E10778F7EC1F07D8952891 /* ssl_utils_config.h */, + DCBD31BF5E01DD986558450D77094E43 /* stap_timers.cc */, + 2473AA39618F241F27934D3F6555CC28 /* static_metadata.cc */, + 4856F247635DDFF25590A63A1EB08FF7 /* static_metadata.h */, + B197426E1F2BA4126249B4F6F23CC355 /* stats.cc */, + 80E662C826D669430F44C6DBB92E8340 /* stats.h */, + 89E3B61C1FA389415F778362F7DDFC93 /* stats_data.cc */, + 192682220D65CC123ECC31B83806052A /* stats_data.h */, + ED537F5536237513019B8F4866FB5EB0 /* status.upb.c */, + F102DCA4D8E69C333CBCAF1AC6FBD408 /* status.upb.h */, + 12F0D535527BE5219CF713151D2E6E28 /* status_conversion.cc */, + 72522FB6ECCD5B4D3161C13F25A68A2B /* status_conversion.h */, + C9086F7E8F8207376E67A8A3538135DD /* status_metadata.cc */, + C909F81954D9B7DB45952082B104FE03 /* status_metadata.h */, + 2834F5A158B47708196C21F2F36C85FA /* status_util.cc */, + 5C26E71E0BC45D4DBDEB1695B8899FBB /* status_util.h */, + B31181EDB8A805B69CAA30F4688BCC47 /* stream_compression.cc */, + 0D4F1ED5380B12CD82F023BA482367C0 /* stream_compression.h */, + A158DE7549F420A16BC48EDD4762E5AD /* stream_compression_gzip.cc */, + 724F27A7E8833F11B3B9181B974AC5B4 /* stream_compression_gzip.h */, + 5034F97F9A2B13E06BE0A669458D2B43 /* stream_compression_identity.cc */, + 44DA1862D10A5E16DB66B1A9CA4B65EE /* stream_compression_identity.h */, + 7DE1C42CE15129988D16C61CA17BF384 /* stream_lists.cc */, + 3A412EA5BC2E26FFE585CB5AD09595AC /* stream_map.cc */, + B5930E543F0DA06668114E5617874688 /* stream_map.h */, + 1F37AE6D86B05253605220AAA2B9D2AC /* string.cc */, + 0122781482DB99BE6378BC4DF1087D05 /* string.h */, + ACBFD264B273F8176D420444FCF5F2B7 /* string.upb.c */, + CAECDFECDF6874B5BE6A7DA67D4053D6 /* string.upb.h */, + 7A6418A56C5DC3D60630153E76811E78 /* string_posix.cc */, + 9CF6723BB05DEC37F90BA50E101B5BBE /* string_util_windows.cc */, + 715BA23D34A522CB34877C5D6C7BD6FE /* string_view.h */, + C3C6821DE3D82C3B325C8667807CA566 /* string_windows.cc */, + 4F3A0D48D2B8FCA94C74995983F04877 /* string_windows.h */, + EE91BD7A7A5DF7BADF4E5D0ABB121558 /* struct.upb.c */, + 19E856387C9916C6CB8F132F974B43AD /* struct.upb.h */, + 470A2E0E8B613BCA4289281E71307DA9 /* subchannel.cc */, + 515DE99E1A2781FD19819BB61560931C /* subchannel.h */, + 9446F18433A710F3CFB2EFB16DC7AA03 /* subchannel_interface.h */, + 0AC08D791B5B330D3D95E91C9CFA364A /* subchannel_list.h */, + 72AB31EBEFFB48DDBB17305B3876E151 /* subchannel_pool_interface.cc */, + 5227BEA7F5786F7260DC6621A2E8890E /* subchannel_pool_interface.h */, + ED3670E27C2181A13C75EBFE273189C5 /* sync.cc */, + 38F3E929839096653111D65E2F29BE3A /* sync.h */, + 6EF199DEBC6744AAEFC454ECCF6D2250 /* sync_abseil.cc */, + 7C8D7E925E144EAD5330FA5794C9806D /* sync_posix.cc */, + 3A3179F3D454D104AC5A2966E2B649FC /* sync_windows.cc */, + 8A6FBD8C15F233AB29F00632508099D3 /* sys_epoll_wrapper.h */, + 1EB4F4919F03F6077BED09C670254F39 /* table.c */, + E611580D32E35681680743D0C3390B3F /* table.int.h */, + 087F90E9E7052CA14900AE0BD482FAB0 /* target_authority_table.cc */, + 4FE1F4833D4B78AB84329C8A1CB20104 /* target_authority_table.h */, + AD3BD3C50585CBAAB39D83E8C3170326 /* tcp_client.cc */, + 2D3620E8112ADA52D50236E9C708EEB6 /* tcp_client.h */, + ECC433DC378B7361CECD8969A01BB388 /* tcp_client_cfstream.cc */, + 92325F123C739CEFD8A33700FCFFE023 /* tcp_client_custom.cc */, + E0D14C0FF8B1CC0F2E3D6B0F61D360B3 /* tcp_client_posix.cc */, + 5C10A22C20AE618E70785E07CFF47B12 /* tcp_client_posix.h */, + ADDB86B7C169DDFFB21D4359AD1C71D0 /* tcp_client_windows.cc */, + 4F6FF34929322FE8870E7BDBF6A05982 /* tcp_custom.cc */, + D49C703E504A3D58320C1A833ABBB8B9 /* tcp_custom.h */, + D2C90CEB8CA3058F7F5EC2F0968CD808 /* tcp_posix.cc */, + 831276D94483FF24EF64BB31C8965B48 /* tcp_posix.h */, + 58CACAF80EED157C4169DE2E44250500 /* tcp_server.cc */, + 380E77E7227988B903FA456F1FB2BFB5 /* tcp_server.h */, + 37AD10ED6129F588C06F028D72018CBD /* tcp_server_custom.cc */, + 04BB4A2F1E8A7F153A34E5E0B2FF62EA /* tcp_server_posix.cc */, + 4FC8EF4B7A4D3FBA96EBB69A2F992A7F /* tcp_server_utils_posix.h */, + 683A8D007E9001C1F4E9004DE36438CE /* tcp_server_utils_posix_common.cc */, + 15E8A4BAE02D2BC08BD3DD07414E69E7 /* tcp_server_utils_posix_ifaddrs.cc */, + 7AFBFAF71709356F760579AFDDDBBDD0 /* tcp_server_utils_posix_noifaddrs.cc */, + C35E20E0A4A7FB1093AB2A3577E4F17E /* tcp_server_windows.cc */, + A4B51A89D051FDBD18FF5341E0E97334 /* tcp_uv.cc */, + 73EB465852F876184AE6DF57B99EA7B8 /* tcp_windows.cc */, + 1723A5C0C342EAA87D9AE85B9140E563 /* tcp_windows.h */, + E0AFD7074CAB64C323F60EB099B7CD4E /* thd.h */, + 45034B8772C1D99CFF8715FA857BD0A5 /* thd_posix.cc */, + FAB1D65E68C223D2FEEF4EC568EA3A8F /* thd_windows.cc */, + 1224124633512735774FB07FFB34CE4D /* threadpool.cc */, + CD676D07C0BCA6C58E93E75DA606FFB0 /* threadpool.h */, + B8056BD4953560BE8C4323BC869D255D /* time.cc */, + AF86CA9A63D47F01E919FFEEE6B2A16A /* time_averaged_stats.cc */, + 0A098371DD345940D882B0DA9BDEA385 /* time_averaged_stats.h */, + 683463B420FCE12481D7F5D3BBC79314 /* time_posix.cc */, + 75525DB2C4D4193F51A3A235949F1C01 /* time_precise.cc */, + 50611EEE6D727D95433EDE3CDB41271F /* time_precise.h */, + AE0C30425BCEA85F808902144CB8DCA2 /* time_windows.cc */, + 83166E85990B302FE401B09ACD1311FA /* timeout_encoding.cc */, + 4D2391EFEA1878086C6B9C2D265FF4E8 /* timeout_encoding.h */, + E2E29F23DDF6AF6D901812E7136A68AC /* timer.cc */, + 71FD7727C8A00943F0820A0160818320 /* timer.h */, + 6F70F679EB641A64E00FE5C7726F8C28 /* timer_custom.cc */, + D062DE1EF6A244B83C34527A3F6E1B8F /* timer_custom.h */, + EE4C33B273CD2E96C9BF04694456F0B3 /* timer_generic.cc */, + EB6FEAA72CAB7E959371C3F7C2DC4CD3 /* timer_heap.cc */, + 3534D1D157B9845F8F2ACF43722EE98D /* timer_heap.h */, + 342A87448451AC50F9565222E3BC18F7 /* timer_manager.cc */, + A25C69824148C82983802E09EA43329F /* timer_manager.h */, + A7664361526A49829A2FA341E4FA9125 /* timer_uv.cc */, + DFBBF5427F6D287EB64E3B36E5EF6D7D /* timers.h */, + 54322520C1C7EC65A9B03907FB292FE1 /* timestamp.upb.c */, + D3CB08C929B497B45F5ABAE870F7D4A1 /* timestamp.upb.h */, + 49FA7F6A73A16F636A0662F53BC1FE52 /* tls.h */, + 438CC79580532F080A206E81530D5748 /* tls_credentials.cc */, + EB830BFD69D9FBE5363B26BA1BF01565 /* tls_credentials.h */, + 53BB379AA11E9D6252032FACF7A58092 /* tls_gcc.h */, + B0A2E8A49B30A409617821E5044F444F /* tls_msvc.h */, + 50E29D7755C2F7766A92793F1EA8D6FA /* tls_pthread.cc */, + 6E7C388295F481B616CD42572BF9649B /* tls_pthread.h */, + E264DE7C30F286F5752702492B068487 /* tls_security_connector.cc */, + CE2D2DD03C29671D5CA640FDC172BFEF /* tls_security_connector.h */, + BCDA4B4BD0B0067A866E17307EE7AA60 /* tmpfile.h */, + 68602F7A47AE03E2D11F7E68E863CD60 /* tmpfile_msys.cc */, + 781C38AB608E1AE0427C1F5D50011524 /* tmpfile_posix.cc */, + A16C988C3A0E82F7F25F75BE2C946CFA /* tmpfile_windows.cc */, + 0593165C5FD6254F93A24AEBF1666D95 /* trace.cc */, + 608520DF27379759B955051E218A4119 /* trace.h */, + 522D7AF891819896D31BDC12A4134FD9 /* transport.cc */, + 20C5D36C79D1BB20457FF8BB2482A275 /* transport.h */, + DC4696E577091CD5D56B195286AA6D4D /* transport_impl.h */, + 958EE32A1236AB1C0679007C61ECD4F2 /* transport_op_string.cc */, + E0202AB9C2BE82FB974F97D991082699 /* transport_security.cc */, + 66C61EEA309F1EB978F31EDA3CDEDE16 /* transport_security.h */, + 575051F96A719458A3D42D0FD4564277 /* transport_security_common.upb.c */, + 0A2A3C2D9D89DE20073978B4954BC390 /* transport_security_common.upb.h */, + 0BA3A49C8625C2A50F3C9D14095B0F95 /* transport_security_common_api.cc */, + CEFB3F5141D9519858DD21AD7B723BD7 /* transport_security_common_api.h */, + 549A0A129267757E88C3B9BBF72B3891 /* transport_security_grpc.cc */, + 3035EBD8934F19F344CB2450BB32F009 /* transport_security_grpc.h */, + C7036343B39BFDA0F9DF8238A27AAE70 /* transport_security_interface.h */, + EB5255D8AAD1A692C837841211057171 /* tsi_error.cc */, + B9376AEE9CBF0723E43D5C941FCCDECB /* tsi_error.h */, + CF1788CDE9AFFBF7E60F1C43D4227EEE /* udp_listener_config.upb.c */, + 1ECAD5E8D9652BC9BDD83380CB553C88 /* udp_listener_config.upb.h */, + 8D44F4656224F3AD7F22416E7792E57E /* udp_server.cc */, + E1A21D662F502F91EBB1BD7C4C412ECD /* udp_server.h */, + 63B0A4F03AAD2B6EACFC450E01E290F9 /* unix_sockets_posix.cc */, + 72AD3AC6CBC8250F45B18C6AAD60CC0D /* unix_sockets_posix.h */, + ED30DB9CFB54C848410E0EEDF042FD9E /* unix_sockets_posix_noop.cc */, + D20779E8474DFE298660E2C93AA82839 /* upb.c */, + 91B9039CD50BE0BEC3FB969FDF442FF2 /* upb.h */, + 9920D84C7F5A89495E59B2BCC0BF8FFC /* uri_parser.cc */, + ABCC5141DEB28F508919BD050C07F49D /* uri_parser.h */, + 4E4438A2B9802CC7625F45E0908E6C21 /* useful.h */, + D16EF3C7A3BD592538B774DCF57A8809 /* validate.upb.c */, + E38F8F3CAA0B133C6DD9D6B7D4D632AA /* validate.upb.h */, + 1C6D9EBC7DF5EA2DE5447F4058FF2D27 /* validate_metadata.cc */, + FEA6C03ECBC2D9DF2C3AE52F296DCC5B /* validate_metadata.h */, + 0E5DC2574ECAB35140C4432C125301E9 /* varint.cc */, + 5C77EBAB7C9B6CA3B0440FE7AC464C2E /* varint.h */, + 9598C8D3D5224BF92DA977B428DF0CE0 /* version.cc */, + 1C7C417D34B0A875BF3E27964F1D8855 /* wakeup_fd_eventfd.cc */, + 7EC7EE331E3AF2872E4A697275BBA7CC /* wakeup_fd_nospecial.cc */, + 25426CD35EF8F8384D3247A3089C1642 /* wakeup_fd_pipe.cc */, + 7A290933D22627E2926DEFF22D4A65B2 /* wakeup_fd_pipe.h */, + 795ADF04F4AA6A250594D93F8C5C77FE /* wakeup_fd_posix.cc */, + 84E118DE4D5140F0155C18244BB54563 /* wakeup_fd_posix.h */, + 26695BAEF9C0456F044A5F13BF4A4DB7 /* work_serializer.cc */, + B6E5DB5B9ED2BB4E09D66C69B3AF2FAA /* work_serializer.h */, + B582CBCABB9ADF0BFF2E891B9252FEC6 /* workaround_cronet_compression_filter.cc */, + D6F4C064A3488B846AECA0EFD4E63363 /* workaround_cronet_compression_filter.h */, + EC23E1FF77631092AD8625A0D1DEC048 /* workaround_utils.cc */, + 8C6751218E0A1A314A66BDB34A4449FD /* workaround_utils.h */, + E1DC3AACCD82428A7231829D9743D299 /* wrap_memcpy.cc */, + 5646E592BBAC6854FA2A9E247B330FC6 /* wrappers.upb.c */, + 5FBBA7ADE29FE86D71F484593F1D26E2 /* wrappers.upb.h */, + 35A8779C3484072854FA5E517B30AB0A /* writing.cc */, + 7B740FD698E3CA13E378DAA34EFEF3D6 /* xds.cc */, + 555C36FF5396C3B28EDB6B6AC7529F1A /* xds.h */, + F0F76938BACAA5E344C6C590CF9E04A2 /* xds_api.cc */, + 2A01B697DF503C3D93135B3C0F28D25F /* xds_api.h */, + 0B1D0486DD55FBB1C96101E044AB31C8 /* xds_bootstrap.cc */, + 66E80990B7602DE869237F057B85CB28 /* xds_bootstrap.h */, + E5D9C9C8C7D2D1FC075A8681CD1A76DB /* xds_channel.h */, + CAC79AB1E2662705341C013854CC1683 /* xds_channel_args.h */, + 3B0753C06F5CC830263CB0E4C0A03085 /* xds_channel_secure.cc */, + 9265B4AD0C295481ABD34E0BDEF8F5E9 /* xds_client.cc */, + AD3D0AA603EBFB0F04A26EB7C52C531B /* xds_client.h */, + 05FE74B4861BFB87C230C39D0FFAFAC2 /* xds_client_stats.cc */, + BCB66564FCB5BC008A67488E854FFC22 /* xds_client_stats.h */, + C360C13D2D40CC6D783F9E87E5D90719 /* xds_resolver.cc */, + ); + name = Implementation; + sourceTree = ""; + }; + BC023050BFA67CFD42A39AE2FE870EEC /* hash_policy_traits */ = { + isa = PBXGroup; + children = ( + 07F8E363F9CDE38097105618252EB3F2 /* hash_policy_traits.h */, + ); + name = hash_policy_traits; + sourceTree = ""; + }; + BDD635F87C763AC309D11AA57BB1B732 /* compressed_tuple */ = { + isa = PBXGroup; + children = ( + 7C81D2805D217ED5A120F4A8DF0C7155 /* compressed_tuple.h */, + ); + name = compressed_tuple; + sourceTree = ""; + }; + C458D0C4C9AF442CAE0D4648FE4AF7DB /* Pods-SaraAttended */ = { + isa = PBXGroup; + children = ( + 52B1AF67D5F20D6B078793E5785FC1C9 /* Pods-SaraAttended.modulemap */, + 3F281DA6DBC33AF233D7D6C2DCAF377A /* Pods-SaraAttended-acknowledgements.markdown */, + 85670E29ADEF6733450704AE375AD102 /* Pods-SaraAttended-acknowledgements.plist */, + 59BE8FCCD6F11C97F01F3A68EE0A1598 /* Pods-SaraAttended-dummy.m */, + 95B017F647A7A78E579E26C8DC315B41 /* Pods-SaraAttended-frameworks.sh */, + FE54D77BBDA6A2F766C6BC37C9BC38BC /* Pods-SaraAttended-Info.plist */, + 16E06494239BD92431415BB216E3906D /* Pods-SaraAttended-umbrella.h */, + E525708B637223AE22E830FE9836A5ED /* Pods-SaraAttended.debug.xcconfig */, + 7E45E0505735AA32522C1F2F67FFAB0A /* Pods-SaraAttended.release.xcconfig */, + ); + name = "Pods-SaraAttended"; + path = "Target Support Files/Pods-SaraAttended"; + sourceTree = ""; + }; + C5037B88FB993AAA36765421F83ED445 /* Interface */ = { + isa = PBXGroup; + children = ( + 20DFAB3F1AC251213E4C33910664847F /* alloc.h */, + E0A614C75FFADDFB44252D45D892E332 /* atm.h */, + 1225A64673D20C6A4389387B6DE4CB4C /* atm.h */, + E7959196CB1EC295C1D7EFB05C1A62D2 /* atm_gcc_atomic.h */, + FFC3148D92C5C6899C9E8F04A356808A /* atm_gcc_atomic.h */, + 3FE860E0897B1CF3E4D5D13932205702 /* atm_gcc_sync.h */, + 45F3712FB4F0F778F038527E8B3E7D76 /* atm_gcc_sync.h */, + 22057244B276E9DD6EEC01798385A77A /* atm_windows.h */, + 5A21288CE7FD248E5937A1691F1F6B1A /* atm_windows.h */, + C3040637B0E10661A176331DB6893688 /* byte_buffer.h */, + 120A7E8EDD868C0D9CAD56A643E7C869 /* byte_buffer.h */, + 6791237FDDB229B80FF9F960CD09BC2C /* byte_buffer_reader.h */, + 358D562D0BC9DC87C5EA2ABB31C2BFDB /* byte_buffer_reader.h */, + 420809A3D84FCAC2EBDFC5C553797560 /* census.h */, + AB83EE49690EDC3506C1F03D9AD4DB2D /* compression.h */, + B304508F4D1BA3E6653A85511CF1C329 /* compression_types.h */, + AA95BD5E58480D50DD1606867D204B39 /* connectivity_state.h */, + EE15F12E75AA3A66DE9DF6E8E4EEC935 /* cpu.h */, + 44DAD51B726D6D0AD3F797C00B8B1259 /* fork.h */, + 5B3A3153CE6675A91D4DB4C46DA9EDF4 /* fork.h */, + 76005E7A0B18417C2398A61E8131A0B6 /* gpr_slice.h */, + BD9868F082F4AA742CA857B0F81F9A90 /* gpr_types.h */, + B348A4F8A3F1013C061BE48235C47CB8 /* grpc.h */, + 3E1A23420F4011712F05BD2979FDBE50 /* grpc_posix.h */, + 1319E85F66E15ADBAF6C9ED31849EA68 /* grpc_security.h */, + DA7CC048BEE5432B20FEC4E3308BEEC4 /* grpc_security_constants.h */, + 48F2043236F70A5747D902B21422D45A /* grpc_types.h */, + 80C720B0399FCC99B19B600E3D4E3241 /* load_reporting.h */, + D8AC7E83731928232AE65C64254BC997 /* log.h */, + 1B610AB95754760FA8B42D3893F00921 /* log.h */, + 41F20D9FB01F9A3F129006ED323B66AF /* log_windows.h */, + 65DB24AA72A09D1E97E91A8763F9C818 /* port_platform.h */, + 2AA0481E324D7F406F906F0D617C934C /* port_platform.h */, + 113438DA4A8791BAC897914815DC34DC /* propagation_bits.h */, + 4A5FEFACE1AA855021F2464F98B76C77 /* slice.h */, + 18519B81C338C5096FC7F8AB9AF57FC5 /* slice.h */, + DA9B38B02FC04FFF9E9B84E4D3E7C859 /* slice_buffer.h */, + 85A207A4B852EADD49DBB92DA94DC3A4 /* status.h */, + 342E064120BA4D297641CD07E942E3E6 /* status.h */, + 735743FFE3A449B51A15E24901AECF1F /* string_util.h */, + C5290DC6851A635298C20FAF5B67CE70 /* sync.h */, + 2355F60BE4168BA33B86EE4132C62B08 /* sync.h */, + 6F144783699836CF4D53EC2EA9790D3A /* sync_abseil.h */, + FF4A0E8DE8149F64767FF12775A0601F /* sync_abseil.h */, + D1EFD9D26DDB7103E060EAD00F7CEC22 /* sync_custom.h */, + F597A3123DA662D08CACDB826E2E5BEE /* sync_custom.h */, + 5D80A7EDBE3547565F2D296355827193 /* sync_generic.h */, + A491B7806FC7172EEB90073096906545 /* sync_generic.h */, + 90875E12404A0AED3656F876411F7B2F /* sync_posix.h */, + 29C0B7E0B38BB64BD690959BF13FA3D5 /* sync_posix.h */, + 0CD52E53F168C7206030912D47CA52C7 /* sync_windows.h */, + CF9597C496DE5BF09079B3514E56B148 /* sync_windows.h */, + E92BCBCD2EC5118CB4748145324C6145 /* thd_id.h */, + A1C8009C9A7CEFF96C11B62DED1EE0AC /* time.h */, + 1DCCFAA1252D3422682CC0943DE5E997 /* workaround_list.h */, + ); + name = Interface; + sourceTree = ""; + }; + C6C004B0DC6EAAE923BFBE64A591EA9E /* exponential_biased */ = { + isa = PBXGroup; + children = ( + 3CDD6694CC550534B1181B3D249C08B3 /* exponential_biased.cc */, + 1F19ABCC9A33949E6AA707BE381643F4 /* exponential_biased.h */, + ); + name = exponential_biased; + sourceTree = ""; + }; + CD76105220BD8628E6BF42B052281F89 /* gRPC-C++ */ = { + isa = PBXGroup; + children = ( + 8C77C80DA05CFF4422243B5DEA748A45 /* Implementation */, + A844DC8628E166B2B0C64F7C861D9B74 /* Interface */, + E006094CE31E572BCA81853B508C617F /* Resources */, + 156C3A57A7ADCDD834754A625E9AEB33 /* Support Files */, + ); + name = "gRPC-C++"; + path = "gRPC-C++"; + sourceTree = ""; + }; + CF1408CF629C7361332E53B88F7BD30C = { + isa = PBXGroup; + children = ( + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + B94D7768568A9992200DB461E8CF687F /* Frameworks */, + FDFF369B1449F330103E575FFE83A724 /* Pods */, + 439755DE3642ECFF605B146E62AF99ED /* Products */, + D5819177D30CE683358B6477C1188630 /* Targets Support Files */, + ); + sourceTree = ""; + }; + D29362E6E7EF680A7E73A7CE5EFF452F /* Support Files */ = { + isa = PBXGroup; + children = ( + 170F763C40ACE64E7ED54F760E881781 /* GoogleDataTransport.modulemap */, + 2ED364E8B5FD0DD7B7F3391132B01025 /* GoogleDataTransport-dummy.m */, + 4B4E231879E11FB540084EF21BDC2495 /* GoogleDataTransport-Info.plist */, + 0478A1B2FBD0AA9F1B2D032BB151B5A2 /* GoogleDataTransport-umbrella.h */, + 0FE48DF0A2F4C90F906E56124F2D5A83 /* GoogleDataTransport.debug.xcconfig */, + 3A7AC2793067554108FB0C965A401C84 /* GoogleDataTransport.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/GoogleDataTransport"; + sourceTree = ""; + }; + D2BB709106F1A9D4BD42753765C5C73D /* utility */ = { + isa = PBXGroup; + children = ( + 7B494F5BF50EAC5CFEC559B42BFF63D4 /* utility.h */, + ); + name = utility; + sourceTree = ""; + }; + D5819177D30CE683358B6477C1188630 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + C458D0C4C9AF442CAE0D4648FE4AF7DB /* Pods-SaraAttended */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + D81E66EE20871DC60D402EBA7A86982D /* encode */ = { + isa = PBXGroup; + children = ( + ); + name = encode; + sourceTree = ""; + }; + DC272ECD90C4FA860E4AB6EF106819E9 /* stacktrace */ = { + isa = PBXGroup; + children = ( + 55B27282DD7E25E54C56EA43C3EB7C2D /* stacktrace.cc */, + 8741C6DA08968E7E1200FFE615AE7384 /* stacktrace.h */, + 2C3876BF971373587610297E8F6525A3 /* stacktrace_aarch64-inl.inc */, + EF7DC7895952D40AF44FF1457345D047 /* stacktrace_arm-inl.inc */, + BD5476FE3953EBF5D8B40E5116155D11 /* stacktrace_config.h */, + 60CAD879D8EACD61B88CCD724549E955 /* stacktrace_generic-inl.inc */, + BC12C02DA0FEBD8871DB81CF851840EF /* stacktrace_powerpc-inl.inc */, + ACD5D7B78AA4F01E6A83A481D7AC4FF6 /* stacktrace_unimplemented-inl.inc */, + E94733C68F02C4AD46CEC1A93576EF61 /* stacktrace_win32-inl.inc */, + 2B2F833A151EE4F80871CAD8924F83CF /* stacktrace_x86-inl.inc */, + ); + name = stacktrace; + sourceTree = ""; + }; + DC8330B0C00EA66B819BA244E87E9D80 /* Support Files */ = { + isa = PBXGroup; + children = ( + A76F07379709A61A0CC11021D2818F29 /* FirebaseFirestore.modulemap */, + 0625B451A83FA539603141FE9432CD4D /* FirebaseFirestore-dummy.m */, + 000100487D801EF5ED9C0180E19A700F /* FirebaseFirestore-Info.plist */, + 88A3FB44FE70B7E9E33EEA41F70B0C31 /* FirebaseFirestore-umbrella.h */, + CB471F5CF9763A5337E2D9D7E5ED8130 /* FirebaseFirestore.debug.xcconfig */, + 88A6C8E4489828DA24B200A2703AC586 /* FirebaseFirestore.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/FirebaseFirestore"; + sourceTree = ""; + }; + DE092D0628429258285ABE53510A8FA1 /* atomic_hook */ = { + isa = PBXGroup; + children = ( + 287E26C9E3791FABB0831B7AD94A7AF5 /* atomic_hook.h */, + ); + name = atomic_hook; + sourceTree = ""; + }; + E006094CE31E572BCA81853B508C617F /* Resources */ = { + isa = PBXGroup; + children = ( + 9570F0DA560D5DBAD3D18157F01D9B60 /* roots.pem */, + ); + name = Resources; + sourceTree = ""; + }; + E1F1769EE912AB63117B6DCB97BEE624 /* Firebase */ = { + isa = PBXGroup; + children = ( + 8D23E586261911A29B6B9067605CA0EC /* CoreOnly */, + 4188EF5440E1D0D68B93AE783BF7BEB1 /* Support Files */, + ); + name = Firebase; + path = Firebase; + sourceTree = ""; + }; + E23D31C33D137CD43A19EC7698822131 /* errno_saver */ = { + isa = PBXGroup; + children = ( + 5A9E2CAC4D607565A22567FB93A269E0 /* errno_saver.h */, + ); + name = errno_saver; + sourceTree = ""; + }; + E2E37E9FEE4CF7E3868C20C21F40540A /* base_internal */ = { + isa = PBXGroup; + children = ( + 09C4E2E4D95944579FECE037FDA0205E /* hide_ptr.h */, + 87C4D55119C30A31119CF079FDA56C98 /* identity.h */, + 8028A5B3D7DA53E4582C3E730E757ED0 /* inline_variable.h */, + 16D9E7FDC0048458C43611D963313690 /* invoke.h */, + 6C57F873C20677DBB378816C7DFC14B3 /* scheduling_mode.h */, + ); + name = base_internal; + sourceTree = ""; + }; + E3E5259D1CD4685D0666BC76FC6A28EF /* memory */ = { + isa = PBXGroup; + children = ( + 4291555008D94A32C804A59C52ED3475 /* memory.h */, + ); + name = memory; + sourceTree = ""; + }; + E4F8963B67B506BAEC545BDEC815CFB4 /* hash */ = { + isa = PBXGroup; + children = ( + 45C75426F9CD2623D8F11FB654DA6A09 /* city */, + 1A7F877FFAE4ED7484D3C2A61A1A9D66 /* hash */, + ); + name = hash; + sourceTree = ""; + }; + E82CAD7C1E78361D781B19345EADB5D0 /* int128 */ = { + isa = PBXGroup; + children = ( + 67D0EA25E5A124E272B58F5A6BCF22E6 /* int128.cc */, + 7F540B5A9B6E44693FB42012CFF51A28 /* int128.h */, + FF759DBF5FF7A93E89C5041696E05D6D /* int128_have_intrinsic.inc */, + 8258B53CD53B6F137AAE2FA93E035D01 /* int128_no_intrinsic.inc */, + ); + name = int128; + sourceTree = ""; + }; + E9D16D3006FF484C32B8BC7C22F7AA90 /* any */ = { + isa = PBXGroup; + children = ( + 98AB66D83DAD261DD4FCB3F1607434AD /* any.h */, + ); + name = any; + sourceTree = ""; + }; + F1050939A7F0EE4D959AC4CE612AC6EC /* inlined_vector */ = { + isa = PBXGroup; + children = ( + 8B0BEA16D51DF53608E34D4D740CDDE6 /* inlined_vector.h */, + ); + name = inlined_vector; + sourceTree = ""; + }; + F2387C3761A43F10BEA64709A9214B2B /* dynamic_annotations */ = { + isa = PBXGroup; + children = ( + 82A89F71266C2B167BD5E06F28B90A81 /* dynamic_annotations.cc */, + 657901658F4CB37D372FC3801030D114 /* dynamic_annotations.h */, + ); + name = dynamic_annotations; + sourceTree = ""; + }; + F73382804F05CDB6149EDFF05BA05F5E /* inlined_vector_internal */ = { + isa = PBXGroup; + children = ( + A80F3CEFA5FF9FE72EC0AFEC38F341B4 /* inlined_vector.h */, + ); + name = inlined_vector_internal; + sourceTree = ""; + }; + FB9ED122D571C9EBA247B7CA3A312ED1 /* optional */ = { + isa = PBXGroup; + children = ( + 89762919352304B630804EA6DC787FC6 /* optional.h */, + 63BBF2B4A372E1B2C092764230DA5B67 /* optional.h */, + ); + name = optional; + sourceTree = ""; + }; + FD632C9E2B39CD620ADE88B8AF131ECE /* core_headers */ = { + isa = PBXGroup; + children = ( + 7E24185D3511A625C74BB0E395BED9B7 /* attributes.h */, + F5870C1FB9B406541E9791E36FD3855B /* const_init.h */, + D8D13B6B6A0E82411728078AC4F21571 /* macros.h */, + EA5D594CBBD6AE3388627A89640D5A92 /* optimization.h */, + 853D2A565D62967727699E29EF2CFB9E /* port.h */, + 4C82291FEEAA7FF8E6C5EC9B97B0CF94 /* thread_annotations.h */, + ED3475FDAC93B6337A48DB0BDDFEC7B6 /* thread_annotations.h */, + ); + name = core_headers; + sourceTree = ""; + }; + FDFF369B1449F330103E575FFE83A724 /* Pods */ = { + isa = PBXGroup; + children = ( + 6DBF2C9F78ACDAD654AA615D830F9AB8 /* abseil */, + 41FB9256370455DCEB382C2ED4ECD32D /* BoringSSL-GRPC */, + E1F1769EE912AB63117B6DCB97BEE624 /* Firebase */, + 8BFC7BA216D6563AA47A64C9C6BFF6DF /* FirebaseCore */, + 969FF4A5E3EB659344B244EC683ED90D /* FirebaseCoreDiagnostics */, + 8DD75FD329CEC4D353D9A9F5AA6671A2 /* FirebaseFirestore */, + 1F7A6E26DA32AE50117AA99E02DBC6B9 /* GoogleDataTransport */, + 6C11BB9DBDF14477FB9E3ED07EC7ADE2 /* GoogleUtilities */, + CD76105220BD8628E6BF42B052281F89 /* gRPC-C++ */, + 4AE63BD6C82A99AC4B4440197233A51F /* gRPC-Core */, + 7AB7573257B451968CB5F9ADF2A0D697 /* leveldb-library */, + 217FF8EF786A1B90F9F4343078353843 /* nanopb */, + 826427820F6A921738EC4C57647D01DF /* PromisesObjC */, + ); + name = Pods; + sourceTree = ""; + }; + FE487DC52B396DDF56665B55FB88037A /* raw_hash_map */ = { + isa = PBXGroup; + children = ( + 9A9B5338171CD061E47F2E361FCE6F29 /* raw_hash_map.h */, + ); + name = raw_hash_map; + sourceTree = ""; + }; + FF8A42FC1DE09451533F742D61F3A17E /* Support Files */ = { + isa = PBXGroup; + children = ( + F71F0E2B51BD13E6F68C24202B41F257 /* gRPC-Core.modulemap */, + 6EE95C90A183B979359C3332736A83CA /* gRPC-Core-dummy.m */, + 3FF81C533E6274BB099F725AE1BA8E18 /* gRPC-Core-Info.plist */, + 865F0DE0A1B753003270A8745C554008 /* gRPC-Core-prefix.pch */, + 1B16F4B125D18F293A44B3AB7E50F0FE /* gRPC-Core.debug.xcconfig */, + A1B872FA9156271AA33449423B5AF30D /* gRPC-Core.release.xcconfig */, + ); + name = "Support Files"; + path = "../Target Support Files/gRPC-Core"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 295A28C348330B2091914CAD83D659A0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3026014CDA84EE17A2EEF413E2377DBB /* FIRAppCheckInterop.h in Headers */, + 69EAF81D862478295F4AB95031930D0A /* FIRAppCheckTokenResultInterop.h in Headers */, + 5A1B6A9159138DB7EC5E43CFA5D425CD /* FIRAppInternal.h in Headers */, + D5F4FA6F682E1DDC9EE449764F1B551F /* FIRAuthInterop.h in Headers */, + 57F9F642270ACAE1CE4C277AC6FDB25C /* FIRCollectionReference.h in Headers */, + 5A783ACA3879F7D60A10689AF1A0B209 /* FIRComponent.h in Headers */, + B98482190413F69A3684CA5B00B5EB18 /* FIRComponentContainer.h in Headers */, + DB393F9EA17195422B7BF2847F70773F /* FIRComponentType.h in Headers */, + A770353462B32567438987F447F2686D /* FIRCoreDiagnosticsConnector.h in Headers */, + 54B2768E384A9E5BCBAFDC3A805E396B /* FIRDependency.h in Headers */, + F1B2BE4B0F488AFBAC78C9B3EC051943 /* FIRDocumentChange.h in Headers */, + 1F41FF0D84296B1C300E4AB93D11541D /* FIRDocumentReference.h in Headers */, + D900E385C00046F73C76CB5D42FC5D27 /* FIRDocumentSnapshot.h in Headers */, + 43B276CDDA0CCF3C24250814A5C2E5C3 /* FirebaseCoreInternal.h in Headers */, + 199B16DF2A3165A512C79388DAF90388 /* FirebaseFirestore.h in Headers */, + EE119E9C350C14CC781CAB7A66D15984 /* FirebaseFirestore-umbrella.h in Headers */, + 222C63C08FAE091C6EF6031367844CE3 /* FIRFieldPath.h in Headers */, + B45883B2FAF72582EF9B712B4A6E5C40 /* FIRFieldValue.h in Headers */, + 45686FBB2A9AD5E4DDB38958CABAC116 /* FIRFirestore.h in Headers */, + 2787183B82A5BF393EF7C0E1058E651E /* FIRFirestoreErrors.h in Headers */, + 7B0D8BD74333354BA0FF605D54F86403 /* FIRFirestoreSettings.h in Headers */, + F83CD0018AD441A42513D1C0870DC85F /* FIRFirestoreSource.h in Headers */, + 450833679AAE7AF96219B7D4FEF34F72 /* FIRGeoPoint.h in Headers */, + 78670CC012C03DC4E0C5204A45EFF71C /* FIRHeartbeatInfo.h in Headers */, + 85353E997A8651F2708F037B86BED30A /* FIRLibrary.h in Headers */, + 42CF12D99954964CC751B4231B578F0C /* FIRListenerRegistration.h in Headers */, + 37CB56380755B7FEE37CCBD3D70B30C0 /* FIRLoadBundleTask.h in Headers */, + 3603E18B2E3E8635756118B23D846983 /* FIRLogger.h in Headers */, + 368523CEEF3FEBDC147DBBC9E0D637A1 /* FIROptionsInternal.h in Headers */, + 24548D0EE6BB7CAA98DB527271535929 /* FIRQuery.h in Headers */, + 1EE4465574876BB277C2B0A6E9A36F84 /* FIRQuerySnapshot.h in Headers */, + 4A164393CF32C3B1CE8F2EF5B21D0A7E /* FIRSnapshotMetadata.h in Headers */, + 961392D9BA0411C12917ECD4F3C76173 /* FIRTimestamp.h in Headers */, + 456BC3E83DF05B77D71BD58A6B51D1F5 /* FIRTransaction.h in Headers */, + 62E5A855C114EFB015DA5F9281DB6C79 /* FIRWriteBatch.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2F056E2555A9F94747FFACEA9ADE752D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CB42ECF6D3C3A59F0CF8B68A784337FF /* aead.h in Headers */, + 64177E2B4EFEBA9A5E43160E8EAFA90B /* aes.h in Headers */, + 75612B802DB373F785390F70CD041D68 /* arm_arch.h in Headers */, + 98DD5C267FD4B1099F279CC6EF0B79A2 /* asn1.h in Headers */, + CDC9B4A286450FE99973248BD1F99570 /* asn1_locl.h in Headers */, + 0F4E28D66F3576E1120E31003E09DFC0 /* asn1_mac.h in Headers */, + DD45CFA494725BC2973AD5B7C3180302 /* asn1t.h in Headers */, + A3FE1A2092B82B83C9D03CC16418067C /* base.h in Headers */, + C64F82179681F533AE28F9513448401A /* base64.h in Headers */, + 59EB9D45B030A65782254C7910E117E8 /* bio.h in Headers */, + 8B623CC78AE8C5229B64BF0A6ECCA6E4 /* blowfish.h in Headers */, + 3D33FC599C89FC92E9A1FFAC60536DCF /* bn.h in Headers */, + 0A53ABDAEB91F8FF7DDE9ACEB433ED73 /* buf.h in Headers */, + 2147EE673BEDBE89AC14921733DFA3BF /* buffer.h in Headers */, + 5CBEFC8DBC655E156E886D7463139FF2 /* bytestring.h in Headers */, + 5890BC4A58B030A89D1D08CD43A0276B /* cast.h in Headers */, + 03533917B193C4CF37EC7308C97D685F /* chacha.h in Headers */, + 6F0ECB6BC614811F8A33CF0EFA917571 /* charmap.h in Headers */, + B51D4C6D094FF836E5A073A4B4C796E3 /* cipher.h in Headers */, + 90ED66B1BA6EC0B51A57728DE548A83F /* cmac.h in Headers */, + 294AE41EA88BA79CA2530BCE42914565 /* conf.h in Headers */, + F0994278EEDBDA32E47862232D8205BF /* conf_def.h in Headers */, + AF02D30F901F4126AA8FC78B05766F90 /* const_amd64.h in Headers */, + 0C0D2DCCCEA051797B327F091737CB1F /* cpu.h in Headers */, + 83964B76F23605B845997CFBB9E63FC3 /* cpu-arm-linux.h in Headers */, + 6637F7270D575B72AF594DE9011454C0 /* crypto.h in Headers */, + 67F552DE2D8BDD7EFB04F866CFCF9B95 /* curve25519.h in Headers */, + 0B2545354AF94F9F324398CB21CA970E /* curve25519_32.h in Headers */, + 7295C075CBEB0DB1F328AE007545997E /* curve25519_64.h in Headers */, + 70C0CDDB660530FB9134EE802B150505 /* curve25519_tables.h in Headers */, + A6149282C5F2EC4DE49553861E8DFCCB /* delocate.h in Headers */, + D8735DFD1E28808015FE11E29BA4D58A /* des.h in Headers */, + D5E0537C0260735636724DBE648F90BE /* dh.h in Headers */, + 1CE4B5D714CA91FCD1F19A68171C0940 /* digest.h in Headers */, + 738168489A15EF2C6FA50B3FFDAAD3C0 /* dsa.h in Headers */, + 42B21419C06F223C1ED3454691A943CD /* dtls1.h in Headers */, + B705E621204FAC763EEA680CD9319C0F /* e_os2.h in Headers */, + 3A3A2443E85227CC0F7B7089994F4374 /* ec.h in Headers */, + A34DADCDE669EBEDD7B8BADD21942D28 /* ec_key.h in Headers */, + 04FED65107C77C46A077326DACB3F782 /* ecdh.h in Headers */, + DB833FC36113E9E177029BBD1A45AD38 /* ecdsa.h in Headers */, + 854236C75003F33AE692272656A74D9B /* engine.h in Headers */, + F1208D6F5E2BF33CB2655961A299E3CB /* err.h in Headers */, + 9E01ADB76AE9D8D7670AADCDB0B42093 /* evp.h in Headers */, + 3157390EC9C16A0BA6BB958A2368738D /* ex_data.h in Headers */, + 32B31825B63564E0EA36029FC36E6E79 /* ext_dat.h in Headers */, + B48DFF5E05150BCD7BBBA3D80BC7F927 /* hkdf.h in Headers */, + 8263D63D4220C035E39586686374DFB6 /* hmac.h in Headers */, + B9F7DAEC5E421B9797DB4DEA88F260EF /* hrss.h in Headers */, + 241D497FA05AAEA7E4C4C3472A1304B1 /* internal.h in Headers */, + E1679DB995901A8D8799127B8419A2DC /* internal.h in Headers */, + 7051F8EBB820621C0FDD46219B77A7F2 /* internal.h in Headers */, + 82960E3803016CDBF39E2E560B72FE16 /* internal.h in Headers */, + 41DDBD89A4D18DE8FFD683E36D882551 /* internal.h in Headers */, + CD2AA4E2F2D5747A24B48D7F4E0F8995 /* internal.h in Headers */, + 61E2CBDAB5A3FA87BAF6E0CCD9A36FEC /* internal.h in Headers */, + 3764EBA20190BC076D719252EF8406AF /* internal.h in Headers */, + AA08A9AB279A6A3108EDBC9B91058F69 /* internal.h in Headers */, + 0680A6D9A49ADD1E478ED58C9A76033A /* internal.h in Headers */, + FA40D13F0BA4C8D4AEDF123F66A07299 /* internal.h in Headers */, + BAA75F9BD700150069772CA449B25626 /* internal.h in Headers */, + 7051AA81D21812639DA46D86FB7D9B45 /* internal.h in Headers */, + EECE5511C871EB8CF74BF260FF7CB54C /* internal.h in Headers */, + 7A9C006A23C60DC861F4CF673E7B10C0 /* internal.h in Headers */, + 9995931809EB93C259AED0F9C431D95A /* internal.h in Headers */, + D00A8608F87B2A94C83ED3C852440E9D /* internal.h in Headers */, + 7DBAB98DD76D3ABB57D782A5F9775BB1 /* internal.h in Headers */, + 6957DC60D08F5A446A22A4C9642A46F9 /* internal.h in Headers */, + D438565ECFFA4735E7210B4D0AC84B0F /* internal.h in Headers */, + 47D5F4EAE1EC6AF4699334C33014E372 /* internal.h in Headers */, + A3C98E2884A1E1204666487DAC0A3A83 /* internal.h in Headers */, + FC2233472F3A8AA17CF0725BD1AA5BEF /* internal.h in Headers */, + 8D2B776B3B8C9DB0FCF3EC13FBB34C7D /* internal.h in Headers */, + D17D4BB65076317943C25C15772EF1A0 /* internal.h in Headers */, + A59F1FAB240B5B3DC286CECEABE8FE59 /* internal.h in Headers */, + FAC341265FF41FD0D058008FF0CAD48F /* internal.h in Headers */, + C4D5A0482D75A8880EE072A2185FF3D3 /* internal.h in Headers */, + 0B3B7AA6DA14DCEAA44493135B78F485 /* internal.h in Headers */, + 2ED50F13B2E1D7CD18BBEF1DA5DC666E /* is_boringssl.h in Headers */, + 0DD76F7118490D1FC9B6987B602905AD /* lhash.h in Headers */, + 3DDABA0E6BD4A84766F70DE9B650490B /* md32_common.h in Headers */, + F9C20148C077DFBBD286F58889AB6C99 /* md4.h in Headers */, + FF1B4CAF3B03E39FFC21EAAD1B6474BB /* md5.h in Headers */, + 5756F6069B7C2792601E3E8A1443012A /* mem.h in Headers */, + DE42B4B59CCEB3B0E46E43B1CEB2E435 /* nid.h in Headers */, + BBCD1A0CA05CF1F7B0BEAF087054E39A /* obj.h in Headers */, + 0A09D39C83F17967B902F8E2134257BA /* obj_dat.h in Headers */, + D994C7D24A2AA0BCBF09F2832337297F /* obj_mac.h in Headers */, + 956664D981E2C0622251CC42DEB1C202 /* objects.h in Headers */, + 70351819CB607E3AE5EDE9127B19940A /* opensslconf.h in Headers */, + 6241FAF14750D65FE13A0A555B7C3712 /* opensslv.h in Headers */, + 792E210DE5BA03C7F98387128FC5A575 /* ossl_typ.h in Headers */, + 31E5579599F8487C78C3CFDAF7C20775 /* p256-x86_64.h in Headers */, + D6DF38515EEAFB9D3BBE1471F1983CDC /* p256-x86_64-table.h in Headers */, + 0F147D93702EF33FA04BCB16BE9CF3AE /* p256_32.h in Headers */, + B1201588EE19D83B86AE1FFEDE7CDF2E /* p256_64.h in Headers */, + 679FA4F995EFFFAF43CB82EE7CCFD25F /* pcy_int.h in Headers */, + 39423405C6EB4986EA9FCC463CE6FD17 /* pem.h in Headers */, + 301A359396878B98A81C666A46097969 /* pkcs12.h in Headers */, + 839A03E43A7E7016171A8EC0AB8242F3 /* pkcs7.h in Headers */, + 72172056F31E0F6A705A50B85BF936D6 /* pkcs8.h in Headers */, + CE35463B42D7EB43B8D1E9F6EE5E8798 /* poly1305.h in Headers */, + FE504490D04A17D76105C3ED0CBBC33C /* pool.h in Headers */, + 878F802E3D05C7644EBF3755C6B355A3 /* rand.h in Headers */, + A21C51BE52920BE55BCC74A8AA3ED08B /* rc4.h in Headers */, + 5855024A05C2BE8C3C390ADC060B81CF /* ripemd.h in Headers */, + 10DBC401A9CD72C3EFA0887B183F1A60 /* rsa.h in Headers */, + 69D848AABECFD615278C976AA6B30D47 /* rsaz_exp.h in Headers */, + 890A54A259EBAB3F39C422630E9E1B67 /* safestack.h in Headers */, + 784114AF143E58D0D4DE7A4428E85953 /* sha.h in Headers */, + 067EBCAAC8508318245FD8A2A41B6F8F /* siphash.h in Headers */, + 4B90D5519A164ED7F11C00D105D5B2CC /* span.h in Headers */, + 862D9485F5F7856B8ADA03F959984A67 /* srtp.h in Headers */, + 4FCFD01E771AA74DDCDC6F865E42D0B8 /* ssl.h in Headers */, + 794797FC247FF251F1B6C9497F5799AF /* ssl3.h in Headers */, + 23F9ACA6B99A8005D9FBFC101E5CAFA7 /* stack.h in Headers */, + F96143959361D3CA09D720B601A6CB52 /* thread.h in Headers */, + D6F7D70FA402A44E349A7A520CCD465A /* tls1.h in Headers */, + 9EA91D04C876A4FAD92BD4CAFA9BD37A /* type_check.h in Headers */, + 3832B933336A93B6CCD4ACD8C26C0AB6 /* umbrella.h in Headers */, + 96F6BD72A6747555086B147C4E159BAB /* vpm_int.h in Headers */, + 59774F8DA573C3BE83E42B848113EB23 /* x509.h in Headers */, + 887BE43D1EE1340A9D0A4CA64994CCD2 /* x509_vfy.h in Headers */, + 9A11C430680411BDA07D5CA9E22722E7 /* x509v3.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 30167C53BC7F64196FB18EE03027C3D5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + E04F2CB9E733625CAFAFE1F30B2D640A /* GoogleUtilities-umbrella.h in Headers */, + B4401B18B0BB45238EC83645E00ADF16 /* GULAppEnvironmentUtil.h in Headers */, + D1DA50170C3ED245246B35EAB185D128 /* GULHeartbeatDateStorable.h in Headers */, + A1CA0EE5B501E717794DB0AF4D63BBEA /* GULHeartbeatDateStorage.h in Headers */, + F70CA3F427AFCF94C96FE6644FF4F00A /* GULHeartbeatDateStorageUserDefaults.h in Headers */, + B6CC7B656A6E6C1DC0F88835FA815AAB /* GULKeychainStorage.h in Headers */, + 518EC636AB889098E8CCAB26771D0AA8 /* GULKeychainUtils.h in Headers */, + C7F49DA4DDF1AD8AD8ABFECD1161DD44 /* GULLogger.h in Headers */, + A3C469861409F838EF3D75376BE65F8B /* GULLoggerLevel.h in Headers */, + 6E893CFE49DA5BC3AAA99DD839504788 /* GULSecureCoding.h in Headers */, + 5B53FFB848207105C4B9EE36D25EAC29 /* GULURLSessionDataResponse.h in Headers */, + 03BD4D998928511496C7D0A2025933E5 /* NSURLSession+GULPromises.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 55E58BA293CF40706B36A964C72965A9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DE7BC25D4E46DF803B33733528ECEF78 /* arena.h in Headers */, + 027260963D7A8B196EBD317570DD769E /* block.h in Headers */, + D6B8DE3E8407D4734F46E94298D88EE9 /* block_builder.h in Headers */, + B90481FB88D208059C9AC02DAA01030B /* builder.h in Headers */, + FDC5B27F405DB7934EDF4C30693C9D16 /* c.h in Headers */, + 9104E5EDBB79ABE6EDBFA1ACA772FAD1 /* cache.h in Headers */, + 0CB9913005174EAA7C7A2389C1E047DA /* coding.h in Headers */, + BCC5D70C259E0F2C62D122B78A8F2A01 /* comparator.h in Headers */, + 72809A291812EC57914A6CD1979006AF /* crc32c.h in Headers */, + 704C1262A7DA090ADE6A61BE3F4A5D0C /* db.h in Headers */, + 06311006FD84FBED34487F7393492157 /* db_impl.h in Headers */, + 74D85E62C4F0CF83E47FD9865C4F3B66 /* db_iter.h in Headers */, + 1D032C12D9CEAACC805A5CB5DA8FFDC3 /* dbformat.h in Headers */, + DFDECB0039B0A7F4892491DA20A24C3C /* dumpfile.h in Headers */, + 3BEBB8E74B44E2F7EBDECB66304320A9 /* env.h in Headers */, + 9EB4B5935BB67B317AF04772719B1C72 /* env_posix_test_helper.h in Headers */, + 1FFA2B427959278E94E0FA9C8B781F00 /* env_windows_test_helper.h in Headers */, + 262D06F553D6218AAC02EE2580617218 /* export.h in Headers */, + 5A27A6E84D49EF733C638BB79F79924D /* filename.h in Headers */, + AFE61F80F27598C4D9330817F1C982CF /* filter_block.h in Headers */, + 55F338687D452BE8FF59B21C77C46325 /* filter_policy.h in Headers */, + 4E7CB751F23950AF87BB60FF80AF0604 /* format.h in Headers */, + 091785D4AD2EE486C36F67F781EC6CC4 /* hash.h in Headers */, + C14901A4BA7D2FF5BD830094D11669CD /* histogram.h in Headers */, + AF2603BDA0F3E59A0B2E5C974F20396E /* iterator.h in Headers */, + 033BB1E8A0F6851450858B65DF22E30F /* iterator_wrapper.h in Headers */, + 7BB73755E7DAD61AB52EBEFB863E9900 /* leveldb-library-umbrella.h in Headers */, + ACB8C010C045781229C5C87FCE23EAE8 /* log_format.h in Headers */, + 33AD99F777ED29A3AD63A97AF2D4C21E /* log_reader.h in Headers */, + 92C9404841387BD0E2B1F13A11D13B85 /* log_writer.h in Headers */, + B2CC5B5EDB48A7B3F654227433FD1075 /* logging.h in Headers */, + F02DD9BD1A5978295836823E92F9699F /* memtable.h in Headers */, + 985B13F3CC5EA07698D96DEAF76FF5AA /* merger.h in Headers */, + 22B690BF90D7A06F0FFDF7A4F8B46DB1 /* mutexlock.h in Headers */, + 0EDD36DA739422E65FE3C5D3C5848C57 /* no_destructor.h in Headers */, + 65960DFD3766BF18E01A6E1613900056 /* options.h in Headers */, + 3EFFED4AFC0510DF283F55C3B611D2CC /* port.h in Headers */, + F39C91E7F13EFEC839A2773565A33EA5 /* port_example.h in Headers */, + D168590CDE49C3F5DC0C55E21433D6CE /* port_stdcxx.h in Headers */, + 87401E1CE2615731A510BD37BEA29EBB /* posix_logger.h in Headers */, + 1C9A00E48B621C71B1414F2B6297108A /* random.h in Headers */, + C99FD81FF575E8CC5B2DC98DD6B02393 /* skiplist.h in Headers */, + CC0B06A48B6249CBAC7EF292885999E0 /* slice.h in Headers */, + 703E0C5B7135CC6590BF0B4DAE6833A9 /* snapshot.h in Headers */, + 0F263C4CA6C723B88FB4FED58A104A10 /* status.h in Headers */, + FE170373458B336C1E79D8B93EC45A47 /* table.h in Headers */, + 29DA3EC56ADF46EDF57ECE25DE700210 /* table_builder.h in Headers */, + 65D975E932DFC554FCF7AFFC44573AE5 /* table_cache.h in Headers */, + 7F6A50AAA31BA15FAB7CCE2ED6AF2776 /* testharness.h in Headers */, + 025F4EECD67FC6CA102539AB0C2BEF11 /* testutil.h in Headers */, + 693E5A27773F2F23B2F6CC6E7150EBBB /* thread_annotations.h in Headers */, + 5D3567C843D232A721B7F1FA601C086D /* two_level_iterator.h in Headers */, + 11232A617470B5563B1D8AE91B9B41EB /* version_edit.h in Headers */, + 4CBA5F4115EC090B6C81BD35A90BA17C /* version_set.h in Headers */, + 7A9FE28D2E4E2E7F7A11B8706708AED3 /* windows_logger.h in Headers */, + B056240B885BE31F97F00602DC95A7BF /* write_batch.h in Headers */, + 8C99BFD79010A387AB1617739EF575CB /* write_batch_internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6FB4E531B60262379F4AD92F3AB3ED9C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 73E561C5989FD59C3C6AF70EBB816128 /* FIRAnalyticsConfiguration.h in Headers */, + FCB072B7201676B23791D0988B437114 /* FIRApp.h in Headers */, + 6F2826CBD3F29E444E3970649B4C0A80 /* FIRAppAssociationRegistration.h in Headers */, + 57A109DC0E5357DFA4BF256180E3832E /* FIRAppInternal.h in Headers */, + 58CC94BAB07B702BE7F35C7B31636B09 /* FIRBundleUtil.h in Headers */, + B03BB7290B6FAF3EC23FF51C28304C77 /* FIRComponent.h in Headers */, + 7D6AA184C3D0E7DBC466CE5E84B00F5F /* FIRComponentContainer.h in Headers */, + 5AD448FC4105EE14F70C632418D9C08B /* FIRComponentContainerInternal.h in Headers */, + 65A3604E2055A6E1F20DCB5FF16DE0E0 /* FIRComponentType.h in Headers */, + 85ED7786B69F1CB1E4219BC515E7DBF0 /* FIRConfiguration.h in Headers */, + 383C96A3A1714709B1C312848FCED033 /* FIRConfigurationInternal.h in Headers */, + 9D5CC99A6F129DA248DB408E2250C008 /* FIRCoreDiagnosticsConnector.h in Headers */, + E4348A2BE4249A6C2BB7262ED9F06910 /* FIRCoreDiagnosticsData.h in Headers */, + BE71DBA2B431781A1F1A91040F1F812B /* FIRCoreDiagnosticsInterop.h in Headers */, + 6A224A3437DB9725EA8C09D59A559810 /* FIRDependency.h in Headers */, + 0F2085BFCDF55DC116920B58D64F3A95 /* FIRDiagnosticsData.h in Headers */, + B41FBD4EBC3A3DFE77DAB2734CA22C1E /* FirebaseCore.h in Headers */, + 8A53813F47C8730D092BD57CE65FBD06 /* FirebaseCore-umbrella.h in Headers */, + FF36A3C328E206EE09AE48D7664EC269 /* FirebaseCoreInternal.h in Headers */, + 0FE6A2EC8F420A8D795451E12223923F /* FIRFirebaseUserAgent.h in Headers */, + 8A7B5C0D4E47D9A8C691A0CD6B962CD2 /* FIRHeartbeatInfo.h in Headers */, + 3D1FDA5B54C21166ABB791D9BF27F54E /* FIRLibrary.h in Headers */, + B4BE805AD0E93C25D037B77498F2AE19 /* FIRLogger.h in Headers */, + FA307016DC5A1F8BFA055889EFFF1816 /* FIRLoggerLevel.h in Headers */, + 280E4E13A0B962A59C8204834907E0C4 /* FIROptions.h in Headers */, + E2A98468A5C95599563D2D172C2D421A /* FIROptionsInternal.h in Headers */, + 5F810BA044E144865F9E7AA16D611255 /* FIRVersion.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 74CB6E612E6FDDBAC946C6BB37232DCF /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A9F57814ED806A1EC6DE1CEFF5249594 /* accesslog.upb.h in Headers */, + B01446CFB21D25C3D4A2282FC99A82F1 /* address.upb.h in Headers */, + EBA60359CDE511623E74CA7722134E02 /* ads.upb.h in Headers */, + A3DCD5A999BDED75E240BE7125585B8B /* alarm.h in Headers */, + 7D233A372FA41B9F558FF91ECB03917E /* alarm_impl.h in Headers */, + 992A1BC2EE0BD266E523F8A79D678025 /* algorithm_metadata.h in Headers */, + 0127A6378D18A139CF2226FE89DC5C61 /* alloc.h in Headers */, + C8AC5CCAB0DD4040D2C061E70DBD684E /* alpn.h in Headers */, + FB5312F3058481348747459EDAABB126 /* alts_counter.h in Headers */, + D77288C84A80A0F10C772CFCF0043C8A /* alts_credentials.h in Headers */, + 32C4723A13F5FDFFE1B52D35ADE61599 /* alts_crypter.h in Headers */, + 4141F02C3E0B1F9FEAB0B2F50D4749FC /* alts_frame_protector.h in Headers */, + 14DC6BE8596D7491D7A6D3148B7F7CB3 /* alts_grpc_integrity_only_record_protocol.h in Headers */, + BC8B02C0BB8BA405C278AD2C2B2AD6F6 /* alts_grpc_privacy_integrity_record_protocol.h in Headers */, + 1A092C153DCD332244D514D299227A32 /* alts_grpc_record_protocol.h in Headers */, + 08B00B78F75C1AC8628EA9A1576AFDD6 /* alts_grpc_record_protocol_common.h in Headers */, + E2B4B8A7635B05C6BC05423461F37953 /* alts_handshaker_client.h in Headers */, + 978B9697CB4F1B23B95F1C0DE92E9CA9 /* alts_iovec_record_protocol.h in Headers */, + DFE576315CF81F49AB0464F3AE7A1DF0 /* alts_record_protocol_crypter_common.h in Headers */, + A74CA8CE8240D48E0AC6BB80062AB238 /* alts_security_connector.h in Headers */, + 53FC5446B0B93042549CF228803701E0 /* alts_shared_resource.h in Headers */, + 1FC169B734D2FFDA40A443EBE3501EDA /* alts_tsi_handshaker.h in Headers */, + BB99E9BF59F7FCA8602C89F58DB4C01E /* alts_tsi_handshaker_private.h in Headers */, + 9E9DCBC6A3B827376DB665AC99A3E004 /* alts_tsi_utils.h in Headers */, + 067D6E88B9D05878C57BAE68C30B4B8A /* alts_zero_copy_grpc_protector.h in Headers */, + 6D6248668A63B019507959BA48ED81AC /* altscontext.upb.h in Headers */, + F74522C06E9D45BD6F6B335869555922 /* annotations.upb.h in Headers */, + 73B705BAD79850D6D62C764F28ADE09F /* any.upb.h in Headers */, + 22A72911C78290AF4BB28E0DF3498A38 /* api_listener.upb.h in Headers */, + 36DD6D4D65460949B3DBC60FABC6CCC7 /* api_trace.h in Headers */, + B6E97AC613F82C9D9F6C2E8A2F811572 /* arena.h in Headers */, + B60988DCAEBD76A1A79C3DD2C392568D /* arena.h in Headers */, + A868284C0520F4383369E05A594CFBD2 /* async_generic_service.h in Headers */, + 3190D33B86D2251B463186E21DD29754 /* async_generic_service.h in Headers */, + 190000D5A66E0AB62BCA74D58D8BD37C /* async_stream.h in Headers */, + 6F9BF614FC0EA8FAE48A5BF0FE89FC79 /* async_stream.h in Headers */, + B671C6610CC3FC642C43B0ECF6050ACD /* async_stream_impl.h in Headers */, + 9F27152F49F1FCD8F8403EFC663AB56E /* async_stream_impl.h in Headers */, + 710C678DC1984847A38923DABFD25A2E /* async_unary_call.h in Headers */, + DBBDD7755046847D3F8FE8A0C924A30B /* async_unary_call.h in Headers */, + D5594B3D8D8557D785D764667E924FDE /* async_unary_call_impl.h in Headers */, + 51F1B13FA1F94B0C2BE609F7D005D3B0 /* async_unary_call_impl.h in Headers */, + BFE3779472836867110FE82D848EC94A /* atomic.h in Headers */, + 2DBDC6960FB84FEAE4A675415326F848 /* auth_context.h in Headers */, + 6E8FCD6137FBEA4C9F2984F4481D384D /* auth_context.h in Headers */, + CEEBCF7B5490BFEF57218D1D3F68F1B4 /* auth_filters.h in Headers */, + 956B7BC48FCCF080FFD18DF49176E3F6 /* auth_metadata_processor.h in Headers */, + 4C669A64DD9D272F49905CE83DD88E5C /* auth_metadata_processor_impl.h in Headers */, + 2A481E5ED5EE28326EC0A7DE644A53FB /* authority.h in Headers */, + 9CE42A3091834AF9DB986D70DD837E74 /* avl.h in Headers */, + 76EC596E9B683E465235CF231332EE61 /* b64.h in Headers */, + 6B22DC8F290329BAD802E7A1DE4A2AD9 /* backend_metric.h in Headers */, + 542D90719D33ABCE68E098B8907A2806 /* backoff.h in Headers */, + 6B4786AE5DB52AB6240E0302D13A96ED /* backup_poller.h in Headers */, + B5842527423BD1EDAB9F4BAFB1F4A1F2 /* base.upb.h in Headers */, + 74A179F7A0BD47843C9D071328756EC4 /* bdp_estimator.h in Headers */, + F5FD1210511BD473EA8E8FE6F745FF71 /* bin_decoder.h in Headers */, + 78ED738F3812C37B13C727BF78A14505 /* bin_encoder.h in Headers */, + 0076C19EEDBD04E1EC5253C53368FA2D /* block_annotate.h in Headers */, + A20C4F254E4A1F2E1C2DB81C6A8E1245 /* buffer_list.h in Headers */, + E81E89485958B103E44E97169C67B636 /* byte_buffer.h in Headers */, + 6801C0C32DC5FFA40FF29C5F5DEE39BC /* byte_buffer.h in Headers */, + 8843D8D0E3F2AF12409108719A1C5BAE /* byte_stream.h in Headers */, + 957A7EC00A7A7F3C88D40E4B29EFD856 /* call.h in Headers */, + 189D3BF41D2B6E3B1865C01CDD5830D8 /* call.h in Headers */, + 75764FAAA8636D9CC6C9519A84D30BDF /* call.h in Headers */, + AD0FE1EBA4B12736679D69E26E59824C /* call_combiner.h in Headers */, + D577CB96FE0EC01FABACA0DF76C0D45D /* call_hook.h in Headers */, + 525DDBF473346C4E08A10151EA36E306 /* call_op_set.h in Headers */, + 96626D5F879812D38FA300425FEC82BA /* call_op_set_interface.h in Headers */, + 1B7F7A21FA36C242B25D5D29F0C625F9 /* call_test_only.h in Headers */, + 8C69F39C2305212D51A0C0408B0490CA /* callback_common.h in Headers */, + 879283A706857D9F5FB7ECBF78C44F47 /* cds.upb.h in Headers */, + B77A85096B3C5E886CB7961DBE9D0D9E /* cert.upb.h in Headers */, + 07E217EA5CBAE874B431F062006E53D6 /* cfstream_handle.h in Headers */, + 109207880875A9AFDEA2A5A8AE3AD5E4 /* channel.h in Headers */, + 0E9AAEBF621E33CE9EDB22C51AF0980A /* channel.h in Headers */, + 1E43CE959195520AA4DCC81527DC667C /* channel_args.h in Headers */, + 2850EF26DCB599438C3172659939CE6B /* channel_argument_option.h in Headers */, + ACEC7D3E021523B43EEC0DD48BDECBE5 /* channel_arguments.h in Headers */, + 0CA258B56104DACC708B63EB5C7A366B /* channel_arguments_impl.h in Headers */, + 06E77143D6E08E4EDF19EBF8A0D18937 /* channel_filter.h in Headers */, + 5BFD2EBB359172C672165855F9B9B0D6 /* channel_impl.h in Headers */, + 4E5F3DAAC3869C88F021533BD10A7008 /* channel_init.h in Headers */, + 0339BBE0794BBC1292B701987E853EC5 /* channel_interface.h in Headers */, + D852FA6EE49E83E434E73B979F2B1ACD /* channel_stack.h in Headers */, + 59A4CE168743C8195D192296050011E7 /* channel_stack_builder.h in Headers */, + F433D46DDE9ED697B654A79AAB14D272 /* channel_stack_type.h in Headers */, + 500394EEAA914C595AE39E3114BABF9C /* channel_trace.h in Headers */, + 534A0C0E804728C25722C1173B0B043A /* channelz.h in Headers */, + 66D8FAD198BF31C3C9883B791953999B /* channelz_registry.h in Headers */, + 005C3236E3907162FD28FA61FBA77D01 /* check_gcp_environment.h in Headers */, + 792F19ABD6B60473C9A9B13020421873 /* child_policy_handler.h in Headers */, + F96B6F866EF55DD38504EA9358760AC9 /* chttp2_connector.h in Headers */, + 0AC02EAE78A73DB059AF137187024B3A /* chttp2_server.h in Headers */, + D427C916078F7E62D5238CBFE969409D /* chttp2_transport.h in Headers */, + 52B176ACF8BEEF4E8F28E74D4037505A /* circuit_breaker.upb.h in Headers */, + 069AE88B5912C6D9F8D625AEE36EC241 /* client_authority_filter.h in Headers */, + 09D72970EB675F223C1C650A0E3AA8A7 /* client_callback.h in Headers */, + BA7ED9A2F9D0072F7F1780C6B9F6EFF5 /* client_callback.h in Headers */, + 19A8073402D30374EBE456F22EA9F0B1 /* client_callback_impl.h in Headers */, + F5B2F4D01EA74174C8E71109ED62C203 /* client_callback_impl.h in Headers */, + 81FE3D3703DDF84A0F82075577B280A3 /* client_channel.h in Headers */, + DB39ED2F6584FE889BB1F2E2DEB85DB3 /* client_channel_channelz.h in Headers */, + 154ED51F354CD48FEBA39A5794473612 /* client_channel_factory.h in Headers */, + 353358D9F8576B32D0F74A1A58C1918D /* client_context.h in Headers */, + 502EFDE3ED6E2258BA07DD5ECB88A6B5 /* client_context.h in Headers */, + 2B5696243C8FBFDDBC3468923C2E7E1B /* client_context_impl.h in Headers */, + E29CD90CC74C0FBF9BD3CA69D5320F87 /* client_interceptor.h in Headers */, + B40669767540DC76A8D7053C3E59F848 /* client_interceptor.h in Headers */, + FAC86AB3D3BFA3DAC5BC5E28B8C18D36 /* client_load_reporting_filter.h in Headers */, + 0F02DE1797971FD4495A765DBBBEA748 /* client_unary_call.h in Headers */, + B6C0A7E81D217623807E6EA7959F5EA8 /* client_unary_call.h in Headers */, + A8FBA8EC13A01A6202D527B10FF6D257 /* closure.h in Headers */, + 4094A5D7F50E2A7995EDC2B22CBDA287 /* cluster.upb.h in Headers */, + BAA0A810AE4DEEBD32AF1AE6EFAED247 /* combiner.h in Headers */, + FE2E9C7885F2CBC56667806F3A5D06A5 /* completion_queue.h in Headers */, + B272C41BDF32380D90FBBC81BC3A031B /* completion_queue.h in Headers */, + 939C5D27D26B0CC7B58C0081B00D55C1 /* completion_queue.h in Headers */, + 8DEB5C56530152E9EB1300AD2EA08D47 /* completion_queue_factory.h in Headers */, + D09669FE5455983BFB94F0BB2A4B78FF /* completion_queue_impl.h in Headers */, + 3B8BD926656F4AE16A5B4F2EE8C68B54 /* completion_queue_impl.h in Headers */, + 83DCAF700730B0994B2555B2A0B732B0 /* completion_queue_tag.h in Headers */, + CE2C8E6E5FBE621BF4698ECE5E12F55F /* composite_credentials.h in Headers */, + 0CD0BD7ECBD069A885606B0E3ABD9199 /* compression_args.h in Headers */, + D3287E9A865C00A1E0ACC39446601146 /* compression_internal.h in Headers */, + C1248C1EDA287E203B2F91C5B926849D /* config.h in Headers */, + 9330FE111A087B895B028667DB0A4C49 /* config.h in Headers */, + 022CCB1B723FEDB27E360C5FAAE4543D /* config_source.upb.h in Headers */, + 4FB45B3D6E68DACCBF9ADF4A6888F4A4 /* connected_channel.h in Headers */, + 0901D9C782C59DB88994A6C061B4ECDE /* connectivity_state.h in Headers */, + DCE2D17844375D26996216AEC1BBF61B /* connector.h in Headers */, + 2DDC439C5A663A13E1A53B06051A312D /* context.h in Headers */, + 3D089CE2B9DEF100020206FD38A4D8A4 /* context_list.h in Headers */, + 106FCCD5CD63671399B3959088459BDC /* core_codegen.h in Headers */, + C7602E0B7B6C924C2AF27F179EC49378 /* core_codegen_interface.h in Headers */, + AAE6F35392FEFFF2F556BEDE615EB37F /* create_auth_context.h in Headers */, + 0C016CC612CE6C7AAEC4126F0CD32C50 /* create_channel.h in Headers */, + 77A8AB0F7B7E55D731487B84AD5E36AB /* create_channel_impl.h in Headers */, + A16CD6A1DB24FCD290A8B4A13C8848AA /* create_channel_internal.h in Headers */, + 9E986B8E822054F73B397C270C56A268 /* create_channel_posix.h in Headers */, + 9F3B02538FDAF06962E3BF3BF4B20EBD /* create_channel_posix_impl.h in Headers */, + FF0FE9CCF12F18F392203B75763917F5 /* credentials.h in Headers */, + 8EE9C82138C2CBEF727A8603D0D98354 /* credentials.h in Headers */, + 49439BDC7126A4BA4B1BC186D679F03A /* credentials_impl.h in Headers */, + 1F21D6F0AD9A130D097F93C88948BE35 /* custom_tag.upb.h in Headers */, + FFCBEB7DAB67688023A3A6E8472448A8 /* deadline_filter.h in Headers */, + E2C932AADA5439A55470743EEF7044C8 /* debug_location.h in Headers */, + BC33367ACBBB4857C8110FEDCEC02C94 /* decode.h in Headers */, + B894BF7F07497180A7A977CEBFBC9BE5 /* default_health_check_service.h in Headers */, + 95D7F62AC1664414A0576E30934F8AED /* delegating_channel.h in Headers */, + 233FFAAB5D29B62CA2306A14D73E14D4 /* deprecation.upb.h in Headers */, + 2A23CD4B91A39B3D80C20ECEF00251BD /* descriptor.upb.h in Headers */, + 1C782597849DF4A328DCFEE5254F9105 /* discovery.upb.h in Headers */, + 986B83C9A255222BE1AA502F0320D0C9 /* dns_resolver_selection.h in Headers */, + 64C6217CD50BD6538AA89D362402DFEB /* duration.upb.h in Headers */, + F8B4BE0986744100D40EFA341E521F89 /* dynamic_annotations.h in Headers */, + 514D23BBAFCFFC9817DA0DF573F9AF11 /* dynamic_thread_pool.h in Headers */, + E12FC5F96355DCF20CB0474D080324D7 /* eds.upb.h in Headers */, + CDE1275555BF0B25A1B8A8761F7E42D5 /* empty.upb.h in Headers */, + 4E1638E9AAF645A44C0461E9EFFEBC16 /* encode.h in Headers */, + 773C184EFA9AA3B16E5927310C46458B /* endpoint.h in Headers */, + 2EEA81B255C5B70BB3FE76371F731DD1 /* endpoint.upb.h in Headers */, + 7FA19CE7638DF8005183C8716F1CE114 /* endpoint.upb.h in Headers */, + 8BCFB11EE2A2F56B1157486D55F02337 /* endpoint_cfstream.h in Headers */, + A2F4550688158E705E714FB9A19F01F0 /* endpoint_components.upb.h in Headers */, + 21FE6EC1A55E54598CA4D6D37671BB19 /* endpoint_pair.h in Headers */, + C5C997F46FD29FF32FFB3234ACAA5CC9 /* env.h in Headers */, + 65A463A025D91799137456CBBD128992 /* error.h in Headers */, + FA31F14DC20129DF13A54D385C7BA581 /* error_cfstream.h in Headers */, + 3027D850795E7E93B8DDC070C7DD2C86 /* error_internal.h in Headers */, + 8983032B4CE4C75D23F7579F997023CA /* error_utils.h in Headers */, + 4FCB69AE1692AC512DDE6741A5358938 /* ev_epoll1_linux.h in Headers */, + D75581BD9344D435AA8B1B3726EAAE94 /* ev_epollex_linux.h in Headers */, + 47E38215E9DA5C7AB9B6DB0D651F2EF5 /* ev_poll_posix.h in Headers */, + 72D5E81975F6EF5800B342D6BC47BA63 /* ev_posix.h in Headers */, + 9603DC0C35DD727DB2880D3AECD91792 /* event_string.h in Headers */, + 96DE0CDA259638447B1E1B69DAD17D2F /* eventmanager_libuv.h in Headers */, + 1B3843D6BCB3C4E6599224CB664359DE /* exec_ctx.h in Headers */, + ABED428B7EEACC05C9BDB5AC7B6118B8 /* executor.h in Headers */, + C0C3D6DFCCDD5B210BA75E73C21B986C /* external_connection_acceptor_impl.h in Headers */, + 5A1FD5BADE4C2A8C3114DAB9C3076E28 /* fake_credentials.h in Headers */, + EA3D005A2AB5A84E0155ADBAE457072D /* fake_resolver.h in Headers */, + 5936D29282A90C03D19B5230EA1B8B11 /* fake_security_connector.h in Headers */, + BA6CF0CFF05C13D58F171B8A1AEBBC5A /* fake_transport_security.h in Headers */, + 64D3FB1BC46D7F0A2894B48B26CAB3F0 /* filter.upb.h in Headers */, + 469426415C642A8A659AA90AC476D62D /* flow_control.h in Headers */, + 641E82EFB8164E2AF590EF67903301AD /* fork.h in Headers */, + F574E917E53F2A6F90123F12323E5E41 /* format_request.h in Headers */, + 44F26643132EC6963C506BE05CACBC73 /* frame.h in Headers */, + E9F889B7D9E3C8F6B96DB05E2BA74673 /* frame_data.h in Headers */, + 7317C78C5B0CB22B6B5C242F2F17E5AA /* frame_goaway.h in Headers */, + 3FFB1EC471E07A3873A8CC1CD4D73322 /* frame_handler.h in Headers */, + 3EBCF140D634A3CF5957F3DB17959C87 /* frame_ping.h in Headers */, + 9577E43CD3177ED20B613C31E625DED5 /* frame_rst_stream.h in Headers */, + 43A403E816A22649C41A3B8F45BF67E7 /* frame_settings.h in Headers */, + 9013FF5305966CAFFD9E50CBF0863164 /* frame_window_update.h in Headers */, + 909208B455A684F4B5A48B79D63C3FCA /* generated_util.h in Headers */, + 20A5B332E8DBB71A08D459234B8BE375 /* generic_stub.h in Headers */, + 7937E68FC3FE903C350AC819FD92BF0C /* generic_stub_impl.h in Headers */, + 209E065A6E80F801F1DABB3A331CCD3B /* gethostname.h in Headers */, + 016F16F12EECCC3F1ADDD57ED5FEDB0A /* global_config.h in Headers */, + D867E6E82E617540746A01BAFB3D9EFF /* global_config_custom.h in Headers */, + 73C451C7FF483E1911C5222A0EF8F4EB /* global_config_env.h in Headers */, + 45F00F750D84E1D875F5E1850B16ABE0 /* global_config_generic.h in Headers */, + 9C4BF1F1164B181AABADF9D4D607D19C /* global_subchannel_pool.h in Headers */, + A824D6850CCD3F6DC0DD4DDBA8A61D0E /* gogo.upb.h in Headers */, + 3AB57E57290B21CCE33AFCD6F4076C0F /* google_default_credentials.h in Headers */, + C803BB43E1A45D192EA6BA9EFD9E2A64 /* gRPC-C++-umbrella.h in Headers */, + D906EBF0749A15583A64C704849205DB /* grpc_alts_credentials_options.h in Headers */, + 61689EEAF462A41D8C13B1FB3E7FA6C5 /* grpc_ares_ev_driver.h in Headers */, + 2E436BE8958EEB2DB7C5519FAA95F09F /* grpc_ares_wrapper.h in Headers */, + 3437727F41C03E56E82C997EBD9AE602 /* grpc_if_nametoindex.h in Headers */, + 322871C24CE26E5BB8CBE86AF0ADF2CC /* grpc_library.h in Headers */, + 2010FA47FBC54175BCD2E130DC9C2327 /* grpc_library.h in Headers */, + 7DD7FD2E666497AC110504783853912B /* grpc_service.upb.h in Headers */, + 5374EC1D9ADE8A9B6B3AD0E84A68ED29 /* grpc_shadow_boringssl.h in Headers */, + 1E7B717347D70DE20584F0128D752599 /* grpc_tls_credentials_options.h in Headers */, + 38EADA8ABE2615BB8B8E7D090463C40D /* grpclb.h in Headers */, + 5FFCB880F8CFB8F45C67423F02A4EFA1 /* grpclb_channel.h in Headers */, + D4508B8C8C1683A812DC3EBE5DE169F5 /* grpclb_client_stats.h in Headers */, + 50F6F61F4B1CF3CC1AAF0E51C0904E50 /* grpcpp.h in Headers */, + 0473602383B4530B14B34FBBEE5FE00F /* gsec.h in Headers */, + DA077C123D7A711B69BD60E27FF0F884 /* handshaker.h in Headers */, + A41D59186DE28F986014080E9C9D423D /* handshaker.upb.h in Headers */, + DE00FEF0B64BEEA44CE5F50070E07E29 /* handshaker_factory.h in Headers */, + BFE4C42EABB67474CCA3FACD37AA5B6F /* handshaker_registry.h in Headers */, + 837C320CD695D689793C969146D41E9B /* health.upb.h in Headers */, + B4CB2C1C355904F3DC6895D6F6C115B0 /* health_check.upb.h in Headers */, + B55290997BB919383E92452178BA5E04 /* health_check_client.h in Headers */, + CAB827FEF92F5CA1CAB3A2A1E6C7E25D /* health_check_service_interface.h in Headers */, + A8DF437ABFDF2BAC2DC53F239E424FB3 /* health_check_service_interface_impl.h in Headers */, + 285C01764B74FF66F46B44CFC4C365DB /* health_check_service_server_builder_option.h in Headers */, + 7B3715FA73BCD965659E788321A6FD6E /* host_port.h in Headers */, + EDEE451BD8B7649209DC12D7E28C5A90 /* hpack_encoder.h in Headers */, + EE7019EDE1DC00463BE1738E5FF33533 /* hpack_parser.h in Headers */, + D1331F702336983DB914576FA4E35A7C /* hpack_table.h in Headers */, + F8B596408CACF9B8EC121C58BCE04656 /* http.upb.h in Headers */, + 7D8B3261A303FCFB76C77B025D6ECCEA /* http.upb.h in Headers */, + ECC0840632C15C7E95BF24FAE97DC4A8 /* http2_errors.h in Headers */, + 14F9F657FC4C208C7B54F52F23915E5C /* http2_settings.h in Headers */, + C16964C5D9BEF680714F967A3AB563D2 /* http_client_filter.h in Headers */, + 004E15693165F076130EBA8E2713D499 /* http_connect_handshaker.h in Headers */, + 4575E2040143555DF1920E493CB057C4 /* http_connection_manager.upb.h in Headers */, + FDC3FFF832A1D3329BE718EF92B9C04F /* http_proxy.h in Headers */, + D6B07AB98C2FD6D2B2BEA58476FFA905 /* http_server_filter.h in Headers */, + 9977A51A65D50923E64AD5FBD7072255 /* http_uri.upb.h in Headers */, + ECB6F07A06FC02EC8B88EC3BA3CA780E /* httpcli.h in Headers */, + 452D84F6C1D76F75EA2EE682DDB6F884 /* huffsyms.h in Headers */, + C5A3083341B597AB6F40D52CB457AAA3 /* iam_credentials.h in Headers */, + 09087F3AC997813A1FBAD11644631E3A /* incoming_metadata.h in Headers */, + 82639AD149B1E8D9012BA6DB67297D44 /* init.h in Headers */, + 021F4156114259EB523F35F0A16535E0 /* inlined_vector.h in Headers */, + 448AB05A5B356E9AA53AF60FFA42C985 /* inproc_transport.h in Headers */, + 9102285EA4365C982758461795FDB103 /* intercepted_channel.h in Headers */, + B45C26BB166F64EAD2F69AF6F76EDBF9 /* interceptor.h in Headers */, + 7455E9CB1CC969A086382E64CCA8EE84 /* interceptor.h in Headers */, + 8EF9C9751407F005091C8854A06E00FE /* interceptor_common.h in Headers */, + BCEC07499DC73DB55F8A6F71A7D6C99D /* internal.h in Headers */, + A9B2E36FEC5C65AAD663B83C33DBBB9D /* internal_errqueue.h in Headers */, + 2187DA6F456CADFE6671A1130C378D2C /* iocp_windows.h in Headers */, + 31D59E2B2F87F663487AE8CB6F9EC007 /* iomgr.h in Headers */, + B1D761D64F7F614B5B25DD606D04FDC1 /* iomgr_custom.h in Headers */, + 744DE4E5BB355CF87145077B3BD54C11 /* iomgr_internal.h in Headers */, + 3F1A78439875F6B461793C6059666D7F /* iomgr_posix.h in Headers */, + DFE8D084D6D07453D9B672B85687E8A7 /* is_epollexclusive_available.h in Headers */, + 0868486407F327CF252D0E4E3188324F /* json.h in Headers */, + 06CB7124DD2D1D52A68C0878F0BBF025 /* json_token.h in Headers */, + 935B2A1C60C4F7973B1024748EBC8D47 /* json_util.h in Headers */, + 18AC59919E7707740C598DCFA4572B3F /* jwt_credentials.h in Headers */, + F4634FE2FC399AAA22D9841FF812F158 /* jwt_verifier.h in Headers */, + 71A28D845463BF6FBAEF82884BFC6B12 /* lame_client.h in Headers */, + 21E4D6389E6B496035684D74CFE6E596 /* lb_policy.h in Headers */, + 13117E434642D4015727B5DFC764ED09 /* lb_policy_factory.h in Headers */, + DA09B84DA76DBCD42DFFC706A38ED94D /* lb_policy_registry.h in Headers */, + F136FA01EE26F5E1FE6521152E2EC875 /* lds.upb.h in Headers */, + FC490961BEA3B34007C7A438C1167F49 /* listener.upb.h in Headers */, + 05465DF0D36AF6FF039AD283E1841CCB /* listener.upb.h in Headers */, + 642DA0A972D6F95BD2E141A263850358 /* listener_components.upb.h in Headers */, + 7068AE77B64E82B477A371180A347693 /* load_balancer.upb.h in Headers */, + 4A21DEA5D97FC6653A6D206FD4DB71BD /* load_balancer_api.h in Headers */, + E7BA212230962BA1B70EEBE2B03C0AA1 /* load_file.h in Headers */, + 6868EC7812E993A58ADBE4038A75B0D8 /* load_report.upb.h in Headers */, + 4C4638467A7A5E810DF65C571EC55194 /* load_system_roots.h in Headers */, + 38C707356E7261340C4833759378C03D /* load_system_roots_linux.h in Headers */, + AD9506852F473F4D4366CA46BFC64FAB /* local_credentials.h in Headers */, + D3A0ACC0FE5D59CDD1470CA0221D43F8 /* local_security_connector.h in Headers */, + 00717D4D03F4B90B1598BE02190F6D32 /* local_subchannel_pool.h in Headers */, + BEF604AADF225EAD044FAAD39B14DE5B /* local_transport_security.h in Headers */, + 29EC666A1CE7C8019AD2D77F10720264 /* lockfree_event.h in Headers */, + 7EB81D891A48BC3297DF1953A7FC52DC /* lrs.upb.h in Headers */, + 6860F1D90D171BD9F12BB95F92335CC2 /* manual_constructor.h in Headers */, + AA7968C29BB06A431C2C99F2CF7B3D8D /* map.h in Headers */, + E9C21D836EDF1A677B81CBFFA020DBD6 /* max_age_filter.h in Headers */, + 4B72EE6E9BA2952A58465AEB73E988CA /* memory.h in Headers */, + C8B7F9DE708B2AAF86B42ACFFB2B32A5 /* message_allocator.h in Headers */, + 0CF1BAFCF807773D6A910DA5D9BDD8F1 /* message_allocator.h in Headers */, + CF82EFB77DD33D2DBB7A6D0C3279C0C6 /* message_compress.h in Headers */, + FBF6362ED2F767F6F1850896CEB8027C /* message_compress_filter.h in Headers */, + 83D2ADD5AD76075E66F4AF6065AD939F /* message_size_filter.h in Headers */, + 0F01ED0539F8B0200AC9F297845EE7A7 /* metadata.h in Headers */, + E7A367C94D7849B99A112ED21927F6E5 /* metadata.upb.h in Headers */, + 5B83021B013A6FC4F512ED71EE41A0B3 /* metadata_batch.h in Headers */, + F4440886DA35C0DE34B23404E9544807 /* metadata_map.h in Headers */, + A5EF7044FE8AC32B181DD927F1DCFD61 /* method_handler.h in Headers */, + 185F9FE0FED9734A16DDE865C062F9C5 /* method_handler_impl.h in Headers */, + E1452B93A7B8698A16738FB1BC919654 /* method_handler_impl.h in Headers */, + 00BBFCB06E79AD06120C91C88DF13B1F /* migrate.upb.h in Headers */, + 835D85D268512E4CDA55B619EA5C060C /* mpmcqueue.h in Headers */, + 805E9D0ED63586FF183B421138D1A902 /* mpscq.h in Headers */, + 442353387BF8895EDEA1FC4F46F93B24 /* msg.h in Headers */, + 3EE5611D5B1B3530863585D0B4F6E551 /* murmur_hash.h in Headers */, + 19A9B598C75DF7A5562491557281F6C2 /* nameser.h in Headers */, + 63EEA6440DF1E7FF1FB47335D2896473 /* oauth2_credentials.h in Headers */, + CEFA39D88C45C65788D7A0DE6CEA893B /* optional.h in Headers */, + AE5B176B3856ACA893BE921810C4E9CC /* orca_load_report.upb.h in Headers */, + 133131A0D20333F8D8BFA6DD849F4F57 /* orphanable.h in Headers */, + 528FD8574D8D720C659FC21BEEEA8405 /* outlier_detection.upb.h in Headers */, + C870E9EDDB9E8763B4790D02DFE7412B /* parse_address.h in Headers */, + 8E45DE706ABD841F6E644FA2E82BD69B /* parser.h in Headers */, + 4A1B57DAA9D6F1C4350DEAFA64AFCCA4 /* percent.upb.h in Headers */, + 54BDFA45654CB0B482D62CA41C7D5D9B /* percent_encoding.h in Headers */, + 7771B3B25EBCF9586FA5E882CA07DA76 /* pid_controller.h in Headers */, + 6167B9718C027A94B05C6E392F8112BF /* plugin_credentials.h in Headers */, + 31765E7BB6298F018082142770F01B50 /* polling_entity.h in Headers */, + 0079925017DD502EB7133C5F1DED02FD /* pollset.h in Headers */, + 8BA0964B6AAFA3126D4D284BEAD752F5 /* pollset_custom.h in Headers */, + B5745AA22102F82181DAE3CA5385A938 /* pollset_set.h in Headers */, + A228CFC25986E6280752899CE5576803 /* pollset_set_custom.h in Headers */, + AA7805D99825192E1DA629813D05BB55 /* pollset_set_windows.h in Headers */, + BED862B4B136CC66D355BF1C0801A343 /* pollset_windows.h in Headers */, + 26A20288865D41333BFE990BE2C760DD /* port.h in Headers */, + 3F3576858B52509E54B64A2CDAD9D342 /* port_def.inc in Headers */, + 8445F6C7F1559768C62DC4203EF1055A /* port_undef.inc in Headers */, + 49F1DB5BE23463BF6C96340CA54E113E /* proto_buffer_reader.h in Headers */, + 63881606175B949E7B8303C6C4078922 /* proto_buffer_writer.h in Headers */, + AB8D4317A8282CEE0BFEFF53A679D71A /* protocol.upb.h in Headers */, + 07784535CA812081F4851547EDA6600D /* proxy_mapper.h in Headers */, + 997BA8B2EF8045C376C1512A8488D0B8 /* proxy_mapper_registry.h in Headers */, + B3BAB3FF635DEE3AF0717CF6A0FD3C69 /* range.upb.h in Headers */, + 82D8912D29D9B20901EF1793621B78C8 /* rds.upb.h in Headers */, + 9459E534982C1AFC32FB15BFDC00EE98 /* ref_counted.h in Headers */, + A26884140B84CE8A359B65FEAF5CDBC3 /* ref_counted_ptr.h in Headers */, + 1F23B6B6DFB444046E223FDDAEA835B2 /* regex.upb.h in Headers */, + 5356E9D0B2D045AD0BEE8156B649A671 /* resolve_address.h in Headers */, + 791B184390C8384902C82432472ABC12 /* resolve_address_custom.h in Headers */, + 1ECFB7975BD4CC716FF569385BB3CB3D /* resolver.h in Headers */, + 8DCC4B663022D9EE29B47D7F24874771 /* resolver_factory.h in Headers */, + 85DA7F11EB79E0AC0D27B429EFE915D5 /* resolver_registry.h in Headers */, + 35747BFC39AF779D6B621CC41A1AD3CD /* resolver_result_parsing.h in Headers */, + B8DC2035C720D29C8871566A3B0D40ED /* resolving_lb_policy.h in Headers */, + 4EDEF88663684D41EA24CFE13DEEA3C7 /* resource.upb.h in Headers */, + E77D0B3A851E93B09CE8E7844536F0F4 /* resource_quota.h in Headers */, + 5D48C7C0900F2279ECA59876732FD3EF /* resource_quota.h in Headers */, + 05CBFC3E68D074771E22958A43612CA6 /* resource_quota_impl.h in Headers */, + 1A3E4805CE6258106794C6137CF6C9FC /* retry_throttle.h in Headers */, + 4C6ABE9E4CF8D4995C17FCE8A7C91C45 /* route.upb.h in Headers */, + 29453AD824C0874A4689C5A026595262 /* route.upb.h in Headers */, + 4482A24716DAE8ADC506D10D785A23CF /* route_components.upb.h in Headers */, + 73D1A67A3A065C64113426803C44DFC0 /* rpc_method.h in Headers */, + 711B44D2A59599382EE558181315C7F7 /* rpc_method.h in Headers */, + 0F6DAF03B2B0FE1D36E51715564F2496 /* rpc_service_method.h in Headers */, + 774159CA2CD51A384CF0AA7279C0E1D0 /* rpc_service_method.h in Headers */, + 55E83827A9109CA5846E2C631194C014 /* scoped_route.upb.h in Headers */, + D074BB197E62BD6FAF1EEC8B046F2C81 /* secure_auth_context.h in Headers */, + 4F9CA83FA154EEFB9CDFDB056D47BDB6 /* secure_credentials.h in Headers */, + E91D0775603D7AA8D448108F62D7E762 /* secure_endpoint.h in Headers */, + E3E9ED903765CDF5BB65AF86BC9ECDC2 /* secure_server_credentials.h in Headers */, + 6A114DB2757EA0C961B51B86E17837AA /* security_connector.h in Headers */, + E293F0E726DAC92EF5C05B50A0C80431 /* security_context.h in Headers */, + 7A4DA953FE9B69988C76FBB585E05309 /* security_handshaker.h in Headers */, + 27056F503EE1E98689697752EF39899C /* semantic_version.upb.h in Headers */, + 71B8685C9B06A06FD407F7F18088D293 /* sensitive.upb.h in Headers */, + E26DEF7CC5B5B453B0F1A76EDA41AA34 /* serialization_traits.h in Headers */, + 5F275151A68EE6AD71FADA817EDA2B40 /* serialization_traits.h in Headers */, + FCEB28B51495A16E6E5DCEFBB1A46752 /* server.h in Headers */, + 78A12EFCE7B3286EE66B56D9BB73845F /* server.h in Headers */, + E5946869DE1C19D009A4E50BF759CD98 /* server_address.h in Headers */, + 50AE0B587DB2EA87BDB97CC859177B8D /* server_builder.h in Headers */, + 025B9AA4617F8D8CEED20EFFF0439CC2 /* server_builder_impl.h in Headers */, + 028061F72AF3F83DAD0BDF69B719D734 /* server_builder_option.h in Headers */, + 0053C06AFFDA1F756B3B7EC868D9AF71 /* server_builder_option_impl.h in Headers */, + B17571C3A76AAE2612ABD19A655D5C57 /* server_builder_plugin.h in Headers */, + D3A1008DFC99A115F88F0368CE3D2363 /* server_callback.h in Headers */, + 3526DE41BDC3E70371B3AAA1096A38CF /* server_callback.h in Headers */, + 7A681D29628B53FE9BABD2DCEFA745A8 /* server_callback_handlers.h in Headers */, + 3F7C093340039C2DDA464CB0512949AB /* server_callback_impl.h in Headers */, + 0DFEE9C38C2D6A526E96EFF99208C708 /* server_callback_impl.h in Headers */, + 021A08ECD84D3B9A8A89124380DCEF70 /* server_context.h in Headers */, + 374C2A36B95AF2E6AD4A4E469D390548 /* server_context.h in Headers */, + 6FA267C6FB7F1E12EA31541AB9A4D169 /* server_context_impl.h in Headers */, + E38F209A54C1AB24F29B652147F74AB3 /* server_credentials.h in Headers */, + 86EC583A112429855BA2400212795E85 /* server_credentials_impl.h in Headers */, + 0E9C7155101B5EC3C20ADDB312290A78 /* server_impl.h in Headers */, + 98EB62374E81EB9D86DDE343B83BB69B /* server_initializer.h in Headers */, + 4935439C4CC54271A9E001D3AEBFC5D0 /* server_initializer_impl.h in Headers */, + 59EC0D7B47D8E225B924CE53E17E8709 /* server_interceptor.h in Headers */, + 9FE759F69402B199AF7856AD67EE7DA0 /* server_interceptor.h in Headers */, + 5CE8B00D39E4CBE5DF53234C5C40E474 /* server_interface.h in Headers */, + 592846A55D5DCD353D5CE4A99876D301 /* server_posix.h in Headers */, + F4EEEA8DF77EC8BCD1748B6353C2BC01 /* server_posix_impl.h in Headers */, + BC7B9E3494A6B426098B5BB8A63D278F /* service_config.h in Headers */, + 31C30971EAAEBFD5BFA159FBCAFE52D1 /* service_type.h in Headers */, + CA4E20A46CA58B03BA5C4D7C3F9E1984 /* service_type.h in Headers */, + 6E3536C47903C039F5B2486E11384DCA /* slice.h in Headers */, + 453BF6F745861188C9FE984A16C06127 /* slice.h in Headers */, + 179E2D22F6F22A6FD813D2C4FFD3F1D6 /* slice_hash_table.h in Headers */, + 9725861E40D10AEAD868243601EF7CBB /* slice_internal.h in Headers */, + 21161B331ED4BEA1826EBE3CEDEEC1B5 /* slice_string_helpers.h in Headers */, + B565B4AAC0F1E84F7DBFC6BEB8F340B6 /* slice_utils.h in Headers */, + 0BC3DE62811CC4B24F6D43FC04352AA4 /* slice_weak_hash_table.h in Headers */, + 4FF27A0FC57F8FD8B1B13CB40C027ACF /* sockaddr.h in Headers */, + 7C0E21259C27050B87C5060D2B09D4F4 /* sockaddr_custom.h in Headers */, + 263B0A4546FD8FF5F835CB769CFBC131 /* sockaddr_posix.h in Headers */, + CA23F5976176EE26EEDD9C25844891DA /* sockaddr_utils.h in Headers */, + 69A62CD4A13440DCE1363CC450B590BD /* sockaddr_windows.h in Headers */, + E053AB4D38AC2CECC3B2E9BABB7D6751 /* socket_factory_posix.h in Headers */, + 26811B97DDF705C7A45E58497169BB6D /* socket_mutator.h in Headers */, + 415793DB8D780695013D60AF2106EA97 /* socket_utils.h in Headers */, + 6574298151692EE585EFE670B69586B1 /* socket_utils_posix.h in Headers */, + 2B0E7CE79BA6A2B7CE4A261CFE80CCBA /* socket_windows.h in Headers */, + 9B6D455CB721AFC103706FB48034BB05 /* spinlock.h in Headers */, + F29F13C57B434C7BCB834342F087721C /* srds.upb.h in Headers */, + 324F8E66482A3611808EA1AAFF3C532E /* ssl_credentials.h in Headers */, + D1EC0FE186B17246EBF8852D92731F32 /* ssl_security_connector.h in Headers */, + 752196BED9A63ABE288C7345ADDFC668 /* ssl_session.h in Headers */, + 3442DCDF2EED4FB732F2EF45761B249C /* ssl_session_cache.h in Headers */, + 5C86FA892DA157CFF6BD46D08F1F73EE /* ssl_transport_security.h in Headers */, + 69B5A0B3C6F388F0FC34222910FA5940 /* ssl_types.h in Headers */, + C2E175C1DB8DF60D78E22E8751BB10FE /* ssl_utils.h in Headers */, + B75779C1DF4BA6152E258F72A8672E05 /* ssl_utils_config.h in Headers */, + 1E434B9EF251A793D0D531D0E56748A3 /* static_metadata.h in Headers */, + 50EF7F36A1168B829AC20686EDB9D39F /* stats.h in Headers */, + 80CA16E063DDA83D4A478183C49FCD17 /* stats_data.h in Headers */, + BE1C0E0D253E7A28C6922BBE1A726FCB /* status.h in Headers */, + 5E91587EC416FAC9887B6093E4211754 /* status.h in Headers */, + 4B5AA685438CE8B1996D7BC7F510664C /* status.upb.h in Headers */, + B61679B31BAC48CA66B36D8D2C6780D2 /* status_code_enum.h in Headers */, + 462F89CD3AAD78423310204DE6C466D5 /* status_code_enum.h in Headers */, + A175C92E5C00EF7C3AE35569E4DFD110 /* status_conversion.h in Headers */, + A145BCF82CBC5EAE105FF57993F6CDCC /* status_metadata.h in Headers */, + 71917BE1845462554400344479AAC085 /* status_util.h in Headers */, + D087789A8D95C4663F1D737997ABBFBB /* stream_compression.h in Headers */, + E5C239A944C3155CF72804417EA23264 /* stream_compression_gzip.h in Headers */, + 8CF159333428720D55D8E78ADED04BB7 /* stream_compression_identity.h in Headers */, + E3654BE7A905317D776FDF74AD4D3985 /* stream_map.h in Headers */, + 03D8D184A64762C06A22A8834E7A0CD2 /* string.h in Headers */, + AF0AF7CCC9D6ECE7CBCA7C4F76315A89 /* string.upb.h in Headers */, + D50CBA317D5E420AB0DB2E754B00F749 /* string_ref.h in Headers */, + D16ECCF9A66498E69474D3926A90DAC8 /* string_ref.h in Headers */, + 34DBDF5EF983EE6D8136C649E14648CB /* string_view.h in Headers */, + 5F0B710E9E7E079A218975A7032E4ED2 /* string_windows.h in Headers */, + A9373B2CD36A7B0B3240FEB77CAE0271 /* struct.upb.h in Headers */, + B2EBED71337099B7420C52BA1B1BAE7A /* stub_options.h in Headers */, + 075EB412A90E4BCEDC09557144E62DBD /* stub_options.h in Headers */, + EB332B5805F8F00BCFE917AC307174E2 /* subchannel.h in Headers */, + 0C55829C11A91CE5131D9E17E8A86A0B /* subchannel_interface.h in Headers */, + 258DC7B95CAF683D6C1BC89687D36BD9 /* subchannel_list.h in Headers */, + CBF53E5740A362A7A6FA095F7442CBF0 /* subchannel_pool_interface.h in Headers */, + 81159129F30A72565C96DA751ACAA2D5 /* sync.h in Headers */, + 5367317F3583CA020FC0882803CCC7D7 /* sync.h in Headers */, + 7FFB051C7CCA6CF297A565BE2ED67502 /* sync_stream.h in Headers */, + C74AF73BAFEF518E10C125532C68ADF6 /* sync_stream.h in Headers */, + 06D969A392CB95E1D7E6079843CC4FBA /* sync_stream_impl.h in Headers */, + 26E3EE618895DFD8CDF051DFE76420F3 /* sync_stream_impl.h in Headers */, + 0EE1380F676574D83D9968981829C968 /* sys_epoll_wrapper.h in Headers */, + E838326DC9139E1B2092521C1952676E /* table.int.h in Headers */, + 3808CC5BF27646323FE7F3B11B7775AE /* target_authority_table.h in Headers */, + 66CDCB5A0601DD12BC9B28610AA5C416 /* tcp_client.h in Headers */, + EB84466A3EDE488A25C4C23E628099BE /* tcp_client_posix.h in Headers */, + 2E497AEA12F761C0869BD5B7490E68BC /* tcp_custom.h in Headers */, + B664AF38CD5EF1F5CCF7D54B0576AFA7 /* tcp_posix.h in Headers */, + 15DBA45FE5EF57E8576414066AD0EB36 /* tcp_server.h in Headers */, + 99B321CC5DAFFB0BDB4796D7B900ADF2 /* tcp_server_utils_posix.h in Headers */, + B78657C60302105595EB3EB4A7C9333E /* tcp_windows.h in Headers */, + EAF614EC3D055E4C1A02C0026E64B742 /* thd.h in Headers */, + ED784F81C1D4E02462299C9285E04FE0 /* thread_manager.h in Headers */, + 9F17DDB685A7F7F8C322C2C9360BD654 /* thread_pool_interface.h in Headers */, + 63E2DAFF2FE654C749C649AA78EC3A79 /* threadpool.h in Headers */, + 708239AED072CA2D8EC974BD826FFB76 /* time.h in Headers */, + 88C1390C037F5348B264389DDC2435CA /* time.h in Headers */, + DE3364054F573EB37231D0FA91D5BD38 /* time_averaged_stats.h in Headers */, + F1AA5427648E73A5D005C200E1366CBE /* time_precise.h in Headers */, + 1D01DAF087A2B01D469EBC1FF2BED114 /* timeout_encoding.h in Headers */, + 20ABC99A12E03CF79580FDB25B5A38A6 /* timer.h in Headers */, + FF48CD12BE7EC18EFF83F12B68DD10D2 /* timer_custom.h in Headers */, + DB3180F3825D0C1AF7A7F9287CBA880A /* timer_heap.h in Headers */, + A59CBB29C79DFD20EB8832A2C68FA92C /* timer_manager.h in Headers */, + 206FE48FF30653AEBFCD1569B0ED5EFD /* timers.h in Headers */, + 9E0CBC37EB69854310CD953CF2F6FF34 /* timestamp.upb.h in Headers */, + 61BEE8D4D02CEF12A6460F8E846DB2D5 /* tls.h in Headers */, + C127A99DF91DE36B597F0005FFCCB81E /* tls_credentials.h in Headers */, + 79570EBD3E061844A2C7F1FF5A110360 /* tls_credentials_options.h in Headers */, + BDA0A6F5B509D31D4D00EC5A54306507 /* tls_credentials_options_util.h in Headers */, + 2022C7A30FE3AE9D46FAB18F3E10D6B3 /* tls_gcc.h in Headers */, + 07E9E37032681A1B6A9874487F7E417C /* tls_msvc.h in Headers */, + 349DEDBA48BDFB4284BE1D026E2A0799 /* tls_pthread.h in Headers */, + BFC04C11F63E376AFA2FCB54C4DB1579 /* tls_security_connector.h in Headers */, + 941B5C1545EEBEF9904B49B3E7DBB223 /* tmpfile.h in Headers */, + D9309D2AE51556512BA8BB5EA89B446D /* trace.h in Headers */, + EF0E1666240FDCE445230BA5A6D36199 /* transport.h in Headers */, + 2E06E23AB2A9A8BBC1F34E1ED94603E2 /* transport_impl.h in Headers */, + 6CB944E4AA5FA4C57D8F7E45BC3934C7 /* transport_security.h in Headers */, + 91259F297C8EDA708C168BF400350BBD /* transport_security_common.upb.h in Headers */, + 61965365F22B3D180C7B79FC40807CF1 /* transport_security_common_api.h in Headers */, + BFD22A71936A10029BF149BD9EF49AB1 /* transport_security_grpc.h in Headers */, + A393F63500CF7937E668E9165A72A119 /* transport_security_interface.h in Headers */, + 600ADA55E01240A0736DF4C2AC235C5A /* tsi_error.h in Headers */, + 8CB92A72B23B9649D6C97A953A3CAF70 /* udp_listener_config.upb.h in Headers */, + 4F715AFEEDAF121435166B14057B436E /* udp_server.h in Headers */, + FF11158F54B06E1C605ADAAE16694F13 /* unix_sockets_posix.h in Headers */, + 8CFE7CC2D5EBB4946641842DCE8D45CE /* upb.h in Headers */, + 37EA3D9129E5CFD9E7CF2D61A3630099 /* uri_parser.h in Headers */, + 9D4F0668E943584DF1EEC6E1A1949B02 /* useful.h in Headers */, + 39BCDF8394B6ABD5CB70B171963A2664 /* validate.upb.h in Headers */, + F0624CF714408A2E56CAE81BE4131989 /* validate_metadata.h in Headers */, + 7B92A8FF663CB1FF9839E749A3B86842 /* validate_service_config.h in Headers */, + 6F30D0360FA6C31EF32FB8A5C2BCF656 /* varint.h in Headers */, + 7AE04F31C4E9D63E4C8E3012D9EDF35D /* wakeup_fd_pipe.h in Headers */, + 11A3E2D6E1D72656594766FF6F9F1D93 /* wakeup_fd_posix.h in Headers */, + F6A2CDBC94A55CC591548EF4A8C7C42B /* work_serializer.h in Headers */, + 88CDAFE6B1D69622FDA927D04C6158EC /* workaround_cronet_compression_filter.h in Headers */, + 92F3CDAC32443EB44374B6B66B9F8F86 /* workaround_utils.h in Headers */, + 443300C5840BC19C2607A5A05DD6BD9E /* wrappers.upb.h in Headers */, + 8BBD54776B92C3026205B30969C272AC /* xds.h in Headers */, + 19700895FE52BCA27614AB57C0B01566 /* xds_api.h in Headers */, + 58D20C1A3F7CB8FC6E6E896B31327CD6 /* xds_bootstrap.h in Headers */, + 16FBBF6D87D1EF120B781FB36EC48827 /* xds_channel.h in Headers */, + F8AD7E22ACC3BABEAD77735381321936 /* xds_channel_args.h in Headers */, + E600E198026117A460171BC87629B057 /* xds_client.h in Headers */, + CDFB1B1747BB862B8F20F7E23500F301 /* xds_client_stats.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 804B879B610A5D7F6A457BEC49B49EA6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 5E1937B29447ABBB2AFD01FB2D5BE8EA /* nanopb-umbrella.h in Headers */, + CB0308EB70E1C85C880B0E61A30C27BC /* pb.h in Headers */, + C765337DDDB2532158A226AA5D16709C /* pb_common.h in Headers */, + 42A1E2B57C5459F7A36A6F8B657D7197 /* pb_decode.h in Headers */, + 43BAFFD81082505AB7743F5A0EF5617A /* pb_encode.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8A670A330E640E5D0FEE4D249CD8ACFB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ECBD5263B865A6C720F7E4C7BE809931 /* accesslog.upb.h in Headers */, + 4F006037F7BB6525745C78134CF9C574 /* address.upb.h in Headers */, + 5D6793075332D224ECBFA16CD38BB005 /* ads.upb.h in Headers */, + BE60F7BD739941D7E9BDF3B676F34A98 /* algorithm_metadata.h in Headers */, + 8A0C9F1F11BCF41645B484589E6094F1 /* alloc.h in Headers */, + 3DC3F630FABC9F17B1357ABCD44B515B /* alloc.h in Headers */, + B4B7AECC6DE003F6400A9182F6D5FD27 /* alpn.h in Headers */, + 704867D2661413BFB1C3120D2DDF7C34 /* alts_counter.h in Headers */, + B13E8F1E18A3E27B3CC1E7AB6FFF48A8 /* alts_credentials.h in Headers */, + EA7A13845A7FF2C61422E6701C80AE07 /* alts_crypter.h in Headers */, + A5080CCFD8B0513CF45C90F2323A8468 /* alts_frame_protector.h in Headers */, + AC8F83CC30ACCE576718E66B62E5BB8A /* alts_grpc_integrity_only_record_protocol.h in Headers */, + 248D853BCD4A8F7D11BDB044E6DE8642 /* alts_grpc_privacy_integrity_record_protocol.h in Headers */, + B3F95545874DEBB2A7A708FCFD4BE728 /* alts_grpc_record_protocol.h in Headers */, + 4D631DD7771CCA6321151DFE27054DE5 /* alts_grpc_record_protocol_common.h in Headers */, + EDE51D9F129C4B44ABF9F4AEBE9216CA /* alts_handshaker_client.h in Headers */, + CA4F064FCF2FC3BCD7E08CF44D890A17 /* alts_iovec_record_protocol.h in Headers */, + 21F4E70A8E03C6522489DC42C1898E7A /* alts_record_protocol_crypter_common.h in Headers */, + 5CFA813AC14BD295927ACE1926D7269C /* alts_security_connector.h in Headers */, + D6B9B7DF23950F5E0A6770D912130974 /* alts_shared_resource.h in Headers */, + B7F527744C0771CDD96BC6EE97F5EBFC /* alts_tsi_handshaker.h in Headers */, + 65919F9DF5DD987972C6B9C4CB72129E /* alts_tsi_handshaker_private.h in Headers */, + B352528838DC24E045A1CDD4A7BF9057 /* alts_tsi_utils.h in Headers */, + 2BB766B63BACD9CEFA48459322692A07 /* alts_zero_copy_grpc_protector.h in Headers */, + 96A30BA7ED58B7DADA9146575F1569F3 /* altscontext.upb.h in Headers */, + 8730CB03475312D8360AA6D5875AD36D /* annotations.upb.h in Headers */, + EDA7DCCCDDF763CC1E26D1F3D450EDD1 /* any.upb.h in Headers */, + 2D0841BF8B3BBEC35690C98079110484 /* api_listener.upb.h in Headers */, + 1D24EC6C9C04B97388286B8FE862F1CB /* api_trace.h in Headers */, + 5ED0F24166E16142519B3635A8468F01 /* arena.h in Headers */, + BE69CA2A451DFD76751E19A210FE19A7 /* arena.h in Headers */, + 8FD03DF0D40FA1230C5A0C74FBA02EE3 /* atm.h in Headers */, + FB7D03EBD346A090C79026B08F201A78 /* atm.h in Headers */, + BD3DCFDC8699E0FF0EFC54C069814C21 /* atm_gcc_atomic.h in Headers */, + 8BD22C584888B6494FB28D00276D368E /* atm_gcc_atomic.h in Headers */, + AAE4CBA456354BBAEF323C3C1392ADBE /* atm_gcc_sync.h in Headers */, + AAF9CB996E85E66761768F209693DBFB /* atm_gcc_sync.h in Headers */, + 8C96456D15286DA33AF122D8486F38C1 /* atm_windows.h in Headers */, + D5879D7F5AF7FC394271E7A28889CFB2 /* atm_windows.h in Headers */, + D2D53AB4E551276F2A22E09EDC007C90 /* atomic.h in Headers */, + 695ED7196DC76F47D03C2C34C51E20FE /* auth_filters.h in Headers */, + 1344777549DC8D6FEC03766BD1B307DA /* authority.h in Headers */, + F712F97072133A34BBB32CF3B49A4998 /* avl.h in Headers */, + C3EB9B38C3C648E7865DA4C66829C054 /* b64.h in Headers */, + 093A8C038A2F4AEA94259A959B103F2E /* backend_metric.h in Headers */, + FDE43800CD267A900AD991F50A384B8B /* backoff.h in Headers */, + 507D4777B06171CF68EA2883CF6D6536 /* backup_poller.h in Headers */, + 187891219618CE9BCBAC30DE8082C40A /* base.upb.h in Headers */, + 2825AD401239FB39044CD00B002561B0 /* bdp_estimator.h in Headers */, + AD02F34BEB013C087E45335A75D4AC3E /* bin_decoder.h in Headers */, + 11446D29A29EB47A166FF11843B8E594 /* bin_encoder.h in Headers */, + CE5142B6D5DEA465478CDCFE5E970605 /* block_annotate.h in Headers */, + E2A14DE1DA2C03EEA8C06165AD9F12AD /* buffer_list.h in Headers */, + F6F4B7C227DD2B551800CA2E463DC01F /* byte_buffer.h in Headers */, + 89A330F395DE56B07D880CCE1F4A707B /* byte_buffer.h in Headers */, + BD58AC2E1F03B837B6FF0B95F2350814 /* byte_buffer_reader.h in Headers */, + 8A70D88A81DAAF3B23B1AE226DD96D78 /* byte_buffer_reader.h in Headers */, + D29A6011EDD3711E0381C0F46E371130 /* byte_stream.h in Headers */, + D1E9EFA40000C373F871485845334D36 /* call.h in Headers */, + 5625BC1663D1917720BADAED6EFAABC9 /* call_combiner.h in Headers */, + 016EA262C68116ACEB59CA85B791E140 /* call_test_only.h in Headers */, + C51211AE02C2A13E5E7D0CFB8947629F /* cds.upb.h in Headers */, + 17037CC6520E902C2CC8CE9DDB399A74 /* census.h in Headers */, + C95143D86B1027A416313C21AF383DF7 /* cert.upb.h in Headers */, + A565C0269D0DA5B6C63308B1E40D2667 /* cfstream_handle.h in Headers */, + 9644C58F468AEA8E097AA8ABFEBE3814 /* channel.h in Headers */, + E6D8E72BF689D19542637CC882F10453 /* channel_args.h in Headers */, + 5105DEAC72E762F1CA1123AE88D3A94E /* channel_init.h in Headers */, + DE19A126672D9F64E6B2104F4D40510A /* channel_stack.h in Headers */, + 42BFA8D44C36D79B7F64BA00425B1E7A /* channel_stack_builder.h in Headers */, + 3D4D841A56FF4A4C8D900E39DA7865CB /* channel_stack_type.h in Headers */, + 050D30F5380A45C38AB9BADD69024DC7 /* channel_trace.h in Headers */, + E966AC919716F1472DACC8410AB1BB68 /* channelz.h in Headers */, + 67DCF639A298D00FE473B7CAC41AA372 /* channelz_registry.h in Headers */, + F73079CB8A4458C774B4E290452598AB /* check_gcp_environment.h in Headers */, + 77A0C1452EBCCCD9E76591B1CA39D0A6 /* child_policy_handler.h in Headers */, + A65160293DF727E46FF5A5FAE7CB9ADF /* chttp2_connector.h in Headers */, + 58BA63DBD34E82735B7883A0BF7275F2 /* chttp2_server.h in Headers */, + 942767FF21CC62AC1D1866114151923E /* chttp2_transport.h in Headers */, + 06A5107EF89CA5761009A98A2E8214F0 /* circuit_breaker.upb.h in Headers */, + F1851794760977907EF3045ACABA9E67 /* client_authority_filter.h in Headers */, + FA4D21B700F0C54BA6AA8DA58C9B7F5F /* client_channel.h in Headers */, + 4E82E80E62A0C997593743C74F6CFD84 /* client_channel_channelz.h in Headers */, + 7214AA8ABC0B3BBD6479509020DBC69B /* client_channel_factory.h in Headers */, + 0485E88A7079897034DF10C5C44F33B2 /* client_load_reporting_filter.h in Headers */, + C22CABF91214B8EE42D1CB74A99D7BDD /* closure.h in Headers */, + 20B6B86DDC1A866619ECE2FD08714AB8 /* cluster.upb.h in Headers */, + D04D691AADDD41DE197E13E6B0E6D737 /* combiner.h in Headers */, + B4A93C22E6477FDF82F21BF79F8608B7 /* completion_queue.h in Headers */, + 2F4A866A19D2D55CBC6F3DFEA82E081D /* completion_queue_factory.h in Headers */, + 42EAAAE7EB1AFD8D2DE9A6DC9A2FFC3E /* composite_credentials.h in Headers */, + 03FEF21339309F427FEB124CFBDEE1E8 /* compression.h in Headers */, + A987DE2A6B1C1411B3B69400DE82239E /* compression_args.h in Headers */, + 75BCB14A1814929DAF5C357A62DEF55B /* compression_internal.h in Headers */, + F445EC9FF362752175B8990E424B1CA1 /* compression_types.h in Headers */, + 4958EA27D9DE1D75C9A1F0D2E249ABB5 /* config_source.upb.h in Headers */, + 8D675C89C8B844914A2F678C18037331 /* connected_channel.h in Headers */, + 1EACA49B81705DF50ACD6AB906981334 /* connectivity_state.h in Headers */, + A22B0885DA117F5D5871760581964530 /* connectivity_state.h in Headers */, + F6B3FA452CB977A84259BE003785516E /* connector.h in Headers */, + 7CBAA033E2063BA8F1912CD5404C60C7 /* context.h in Headers */, + 50453405B2C0B1B1140C73D9805BFF87 /* context_list.h in Headers */, + 3CC47A4B81121F438DF3DA608C24DA3D /* cpu.h in Headers */, + F42DE2F5956719485DE8C6E64B522B8D /* credentials.h in Headers */, + F6A56677CD36516422759D29B08565CF /* custom_tag.upb.h in Headers */, + 3E58D60C1CD010CD83783E15B5A46551 /* deadline_filter.h in Headers */, + 944073DDC529FFB0D7CF76952A8EB962 /* debug_location.h in Headers */, + 03236639C028B477E86A99A16471686B /* decode.h in Headers */, + FBE1DBB064629260F878D90ECA106E4A /* deprecation.upb.h in Headers */, + 63539CDF5A8E2CBBD4AF63EDF88FF7BC /* descriptor.upb.h in Headers */, + 0924B6CB42A05C70F439DFB277CB6FD9 /* discovery.upb.h in Headers */, + D5B8B634BB14B0CCFBCCFD855B3AFF94 /* dns_resolver_selection.h in Headers */, + 98D88B091F827F48FE9A055BF5288272 /* duration.upb.h in Headers */, + 2E910F6904CA27C8E0C0CCD9EBD018A4 /* dynamic_annotations.h in Headers */, + ADDAF87FE5B79367D4AC066ED1BAF8CB /* eds.upb.h in Headers */, + 1D41A27A8D4EDEA3056A3A3A5335909B /* empty.upb.h in Headers */, + 9BCB69DDD8A4A6ACB6A3D9671C6C890C /* encode.h in Headers */, + 44AB08338B88858BC1EEF5AEE286F102 /* endpoint.h in Headers */, + 4EA47C209886E4FF0DE189AEABADBAD2 /* endpoint.upb.h in Headers */, + 4C578FCDE5A1831199DFA40A82BBDF15 /* endpoint.upb.h in Headers */, + 4D01C74D6AEF5ED4ECE1FE99C1741B04 /* endpoint_cfstream.h in Headers */, + DA1B7157415B7E994D0C7014820A203F /* endpoint_components.upb.h in Headers */, + 524FF5C1AA092D241C2A200F493F2BE7 /* endpoint_pair.h in Headers */, + 3D802EC82A00339B24272876F6EEC20A /* env.h in Headers */, + F9B6BBA5ADC2DA5A7786D6D879FDFD18 /* error.h in Headers */, + 9E51078BC7824642DE572567034D4242 /* error_cfstream.h in Headers */, + 6BF2A8FA8D90304B468F73C83FBEEF85 /* error_internal.h in Headers */, + 7D241CD0A61B126B9A905A391EEEE799 /* error_utils.h in Headers */, + CB78988C9470C05496999C2D5735C54A /* ev_epoll1_linux.h in Headers */, + 4E8A7B311043691BA66D50C66E75AD2C /* ev_epollex_linux.h in Headers */, + 7107F8B132D868303F6C6E6C52E1FBC1 /* ev_poll_posix.h in Headers */, + D286CEF6FB74A710B9B093CB4F0FDFFF /* ev_posix.h in Headers */, + 0E10E480076EC1BEFC9507A81F074AFA /* event_string.h in Headers */, + 8CC14E90C7C8F0FBC78DDD2A52814286 /* eventmanager_libuv.h in Headers */, + 449152B4E1AC7581027C6374D9AABFC6 /* exec_ctx.h in Headers */, + 3999BBDA39F6391FC2C47AA7E10AA593 /* executor.h in Headers */, + A0AD95B4C0A043EB3A5AF9CF27338CEC /* fake_credentials.h in Headers */, + BAB6F7E6573D0661A600709304DE8148 /* fake_resolver.h in Headers */, + 7DEA0B313E95AD9D310ED3BBF50E9158 /* fake_security_connector.h in Headers */, + 5C5BFB3564D875150FB060CC6645756D /* fake_transport_security.h in Headers */, + 2BA60A54D6304913097D8A3C981805C3 /* filter.upb.h in Headers */, + 939B4A2E59C89C2B39B5985195670FDC /* flow_control.h in Headers */, + 68E0A023DF3F9D8D79CEB452F9F93F6B /* fork.h in Headers */, + E5C9938CD3E0A85FFC9111E20846D7FD /* fork.h in Headers */, + 5E7F3DF3C7EE740F1F82886024928274 /* fork.h in Headers */, + 4BD32309139597E1EAEEC156B02C0A9B /* format_request.h in Headers */, + 44DD558C69D0E48C404075ED610A0A08 /* frame.h in Headers */, + D3C6B4A4EF35492C35E286ED3797699C /* frame_data.h in Headers */, + 1F89D87CF5AFB9550A674C3CCEB720A5 /* frame_goaway.h in Headers */, + FE8D7334EA1D6FCC8191C1160939E2AE /* frame_handler.h in Headers */, + 14DF46261456CDE7D5C6B33BB2484D82 /* frame_ping.h in Headers */, + 7B9081E6624FF810276F38CB0C3E2C6D /* frame_rst_stream.h in Headers */, + 77712067D7F7A452F0D624836463316E /* frame_settings.h in Headers */, + DAAE7A67DBE0EADEEBE1243C1AD4DDA0 /* frame_window_update.h in Headers */, + 122AADD1E4877F747A11845819CE22C4 /* generated_util.h in Headers */, + 56D15B1406C3053B722B063A782F598F /* gethostname.h in Headers */, + F69C7D711E0C0690FD2E8EDD124B4A8D /* global_config.h in Headers */, + F56B5D1F03062CE48D8966A2BF8A42DE /* global_config_custom.h in Headers */, + 94385C9D53BDC1998BE2EEB4FB18FE0E /* global_config_env.h in Headers */, + 7E1736AE692E1BD2704320FDDE61D748 /* global_config_generic.h in Headers */, + 20BAA8F63C7FBE52A24FE1B46BC58963 /* global_subchannel_pool.h in Headers */, + 93D844ED4D10107B543B5EB93D9B6716 /* gogo.upb.h in Headers */, + B31C29155AF654A068CB18B6D81A6197 /* google_default_credentials.h in Headers */, + FBD1DBAE07648312C1F7FEEFE80DEAE7 /* gpr_slice.h in Headers */, + 7116AC4BE3AA3F9600D877D34B86E3BB /* gpr_types.h in Headers */, + 311AC85FECF881C4651EE06954A86128 /* grpc.h in Headers */, + C24B3E584334108158461ACBFC3950E7 /* grpc_alts_credentials_options.h in Headers */, + 05A13AEDFC1F1D236378AA94896FAB30 /* grpc_ares_ev_driver.h in Headers */, + DC0259F3C6CCB59F73FB0AFA733F13F3 /* grpc_ares_wrapper.h in Headers */, + 4DF6A8C070381763C0F6348B634A4D0C /* grpc_if_nametoindex.h in Headers */, + AE5B5EBDBA381B212A77CB159FF0467D /* grpc_posix.h in Headers */, + B9037689AACBD91D86AFDE521A23E448 /* grpc_security.h in Headers */, + 4A68CD5A0EEFD0B9089753752F3E2D39 /* grpc_security_constants.h in Headers */, + 0104BA3208BB938146A1FF903A224BE3 /* grpc_service.upb.h in Headers */, + 499AA3E782811628D10E3C962E62038F /* grpc_shadow_boringssl.h in Headers */, + 469ECE4FBCAF7989CF77181704AEE36E /* grpc_tls_credentials_options.h in Headers */, + 5CEF77025A1B629DF4EBAEA9CC812932 /* grpc_types.h in Headers */, + EFE3D4FB0C6D6AC50A393C9613EA441B /* grpclb.h in Headers */, + 3BD4ADBC4997E7100D798A4C8886D828 /* grpclb_channel.h in Headers */, + 0578323581412D46F1BE1097FC74D4FD /* grpclb_client_stats.h in Headers */, + 3D6B81D54E4B943C77A36B678C0FE570 /* gsec.h in Headers */, + 92178868825AB8ED6968160489784E21 /* handshaker.h in Headers */, + 6D7ADFF757FC04756A5A0E31B14571AF /* handshaker.upb.h in Headers */, + 4CA838CEA6C5E89F8650BD0CC0401D39 /* handshaker_factory.h in Headers */, + 23CCA94E06C4BDED4257077D5E7DA817 /* handshaker_registry.h in Headers */, + 9F168EAF01A1FFA4828B63E04E43055F /* health.upb.h in Headers */, + 97839DA32896073B62D7881E27D1EC0D /* health_check.upb.h in Headers */, + A37B97ED54EF5E827628CB0C9AD1EE25 /* health_check_client.h in Headers */, + E5AB3D18DF63CFEF962F034162B7AA99 /* host_port.h in Headers */, + 1B0755B176507652C3A3FE3686E3AD4E /* hpack_encoder.h in Headers */, + C7D974D769835463E0124E4D60B14F4B /* hpack_parser.h in Headers */, + FCC636D4D9E85D739BF5E8A5F26DC54F /* hpack_table.h in Headers */, + A9F109BE41A5B079040474297E8EC80C /* http.upb.h in Headers */, + 2CE2179AEFC4CBA032D92DFD313D6DD2 /* http.upb.h in Headers */, + C8D1F31FAE332DC8A014A5C4C8E3CDF8 /* http2_errors.h in Headers */, + 6AEED8EC7D640895CFF0AF756F5181F9 /* http2_settings.h in Headers */, + 3707FA70431E375B6AEC13959FC6B7E1 /* http_client_filter.h in Headers */, + 0BDB4A44A318D86031FAEB88D6DDE0C7 /* http_connect_handshaker.h in Headers */, + FE23FC1562FA01B28384A1CD5E19A071 /* http_connection_manager.upb.h in Headers */, + FCF7A369A1AD4F2AC0B8ACE5B1F2409B /* http_proxy.h in Headers */, + 73816861609770420643B0C7B3B89193 /* http_server_filter.h in Headers */, + D3D70C5FDC3853C082C7DD2C7CFDB2C6 /* http_uri.upb.h in Headers */, + B7EF8B3061DFB9AFE33933FBA34615B2 /* httpcli.h in Headers */, + B9AB95B5DA458F8A2DCE354CDA9A9627 /* huffsyms.h in Headers */, + 34E136A06DF6ECAA84D10B038D9BB240 /* iam_credentials.h in Headers */, + B5D52AD847DD78B3A53E18E22351A98C /* incoming_metadata.h in Headers */, + A59624D7B5BE71D34E7C894E0C9577E9 /* init.h in Headers */, + E59956ED993A74C0AB63940115D0DED9 /* inlined_vector.h in Headers */, + 5DD43D71A61B2CA8E7B70006F92FF30D /* inproc_transport.h in Headers */, + F07053BB03672EA2712AEC1CA3F594E3 /* internal.h in Headers */, + 9FF533F857E2D63B5ED67DA9A58658AA /* internal_errqueue.h in Headers */, + 2897380ED3052F660514F5529E54BB02 /* iocp_windows.h in Headers */, + 4D0325C9FBC332131498D1F10E53D246 /* iomgr.h in Headers */, + F1617BDBB567465F2309015A9B984CE7 /* iomgr_custom.h in Headers */, + B81F3990E7E17C3E5B37A32FFC6B2734 /* iomgr_internal.h in Headers */, + FDC3FD2B67CFAD8980531205E8C3F55C /* iomgr_posix.h in Headers */, + 4F43529B15F194DF14E781503DE0E2F2 /* is_epollexclusive_available.h in Headers */, + 4E7C3FFA21D57C9B495FEFF71071162C /* json.h in Headers */, + D99A0D21B0207E13FC0003F5867F91A1 /* json_token.h in Headers */, + 4AA09B67A86242C5EDEDC00B0C4FC335 /* json_util.h in Headers */, + E7B46CA548A247F855FBD0788AB00267 /* jwt_credentials.h in Headers */, + D1B19424E86A374D6CE0DB42E099CC5D /* jwt_verifier.h in Headers */, + 2EAA5ACCE82B2F61AE1FD0792544D1E3 /* lame_client.h in Headers */, + AF099296DA5F9D7D0BE72414CA3AC9E0 /* lb_policy.h in Headers */, + 0CB64AAB20F9C58FE5F936EF879F4C92 /* lb_policy_factory.h in Headers */, + 3EA9E7BCBF057F895BFF2EAD5B266364 /* lb_policy_registry.h in Headers */, + 1D277583E14E969BF491D897427D6012 /* lds.upb.h in Headers */, + 97D4E0C055D74622D013C9B4274BBD37 /* listener.upb.h in Headers */, + 804DE05DCEE98DC30D5484762D0DCDE0 /* listener.upb.h in Headers */, + 21F9C1BF1CE5C867EF1CD94520B57C94 /* listener_components.upb.h in Headers */, + 84B09DD3507B1E75C10F3E6F663A458F /* load_balancer.upb.h in Headers */, + 16C67F029FE0325397A71C73FF58432B /* load_balancer_api.h in Headers */, + D1527108446AD60E0C3A123B82ABA0D3 /* load_file.h in Headers */, + 270DC7167A7568C869FA1C1DBAA74715 /* load_report.upb.h in Headers */, + 64E8E407036D92427BE83BC15134E026 /* load_reporting.h in Headers */, + B69169B25AF1A85FD1FA62D1A982CF7C /* load_system_roots.h in Headers */, + EA2BA1939B569BF310DB52E97E1B2B18 /* load_system_roots_linux.h in Headers */, + CE0EA0882F3151CA4C5D07CEB570281B /* local_credentials.h in Headers */, + 7BEC03739952D637BC4D126C4052DD98 /* local_security_connector.h in Headers */, + 66396C4D17E2B2C7E68EACA790B30DFC /* local_subchannel_pool.h in Headers */, + 4C07CE123F2081767491DFB9B461233B /* local_transport_security.h in Headers */, + B1FDCBACBBC9191623185E200712977B /* lockfree_event.h in Headers */, + 5833F346DD8F0097F15D98DD67F67F13 /* log.h in Headers */, + 3517F55640E8849F3DF6D4ACAFCFB193 /* log.h in Headers */, + 0835DED9CA507D0BD53834209E670E8C /* log_windows.h in Headers */, + A4CB8C7FDB3A5F424A29CC93A06A214B /* lrs.upb.h in Headers */, + EF937927C0A9BB34C8F3B677B28CC87A /* manual_constructor.h in Headers */, + 78B4D11C4ABD87732E2A84F11C754BDE /* map.h in Headers */, + 108D4D3B9D782D9E80BDBC5CF1ADE5B6 /* max_age_filter.h in Headers */, + 72AAB64FD3338541B6F6418662C045DF /* memory.h in Headers */, + 788C1CF8BF5E4B69D332578C474AF54F /* message_compress.h in Headers */, + BBCEF5D08D8BF671F20CC1ECAF5B1D76 /* message_compress_filter.h in Headers */, + 2C852FC1E5E70C4B04C3FC176B5E839B /* message_size_filter.h in Headers */, + A1C7FE0D5CBEB16975A7DC07B8A51141 /* metadata.h in Headers */, + 0E1B8AEFA5E72C4F6903A034CD221776 /* metadata.upb.h in Headers */, + 7E9F9C1B0B39C88E9FAD94DB9507B2EA /* metadata_batch.h in Headers */, + 0FCAF2095DA0F7E8342162E71D4066BB /* migrate.upb.h in Headers */, + AE34C98E0166933D53AD99EED2240305 /* mpmcqueue.h in Headers */, + E1C0B6E1A8AA68DC99F7593D4528458E /* mpscq.h in Headers */, + 5B0559AF6D0D11F351911F38348A29DD /* msg.h in Headers */, + AAE2FD9FEE26965A7AD53F4B25D631FF /* murmur_hash.h in Headers */, + 7F9BEA2620426788DD90623E8DD9CA5A /* nameser.h in Headers */, + F2251F0FFAB83062C9D8047CCADD1425 /* oauth2_credentials.h in Headers */, + 86FFF01BD2A02E0E37BB4788F9AC0FF0 /* optional.h in Headers */, + 8C71790A5C2555FBF164540F5D579031 /* orca_load_report.upb.h in Headers */, + 5F4963E7928BCF4CBCB750529533EEAA /* orphanable.h in Headers */, + 783C5E3A897A008584E68508CBCE5F6D /* outlier_detection.upb.h in Headers */, + D7AF0BBB850C059C3D3AE9BDBB9544CF /* parse_address.h in Headers */, + 21B6212299417A743676B00B815214AE /* parser.h in Headers */, + 041B8D3D0AFBA5D4B4DFC1E8DCDBFD5E /* percent.upb.h in Headers */, + AB6CAE36470C201D83A3AB7A87207BB8 /* percent_encoding.h in Headers */, + 2D43D63B89D51CD74C8E035B043E0FCB /* pid_controller.h in Headers */, + CA02288211ECA1F332EDD28B0F0B3F2B /* plugin_credentials.h in Headers */, + 9328AF7C99BB9E16C01A0B4EA92DC62F /* polling_entity.h in Headers */, + 948C48B301A8B38FD5AA2C7AE9C7A341 /* pollset.h in Headers */, + 2D4F4D6CD0BB1528CA77DBD0D5BF982F /* pollset_custom.h in Headers */, + 7FC07EE290EFEA60AC9A91BB1A973050 /* pollset_set.h in Headers */, + 9C806ACE4025B850ECDB5001F1EBD039 /* pollset_set_custom.h in Headers */, + E1D5543491348A4D83B9660A36FE4EF8 /* pollset_set_windows.h in Headers */, + AC4D4C01AEDBCE94CE5B2342C37A6B23 /* pollset_windows.h in Headers */, + 1CA1F2A5CC09527EE390CF9C4E5A5AA3 /* port.h in Headers */, + 243C1F78C113795B0A55C177EAB0746A /* port_def.inc in Headers */, + 1B1B7D3B0AD94F0AC27F50A8D2AC1F10 /* port_platform.h in Headers */, + 93A86931DFE114DB62ABF318AC9EC48E /* port_platform.h in Headers */, + FBC41B5DC4DC68C1D7158E94C8BE3784 /* port_undef.inc in Headers */, + 081D9CC792410F8CD2EFDABB5CD3333E /* propagation_bits.h in Headers */, + 8D8EDABA056A7B4CFA2D17A011457374 /* protocol.upb.h in Headers */, + 11A908758D77875EFE6399744D01815D /* proxy_mapper.h in Headers */, + 589911DBFB0D3509D3F1CA7E6276E6FA /* proxy_mapper_registry.h in Headers */, + 41DFFCAB752435624AD5C0EFF6DB5971 /* range.upb.h in Headers */, + 88ED5B35938524A97A8FE2DDB5CF87F7 /* rds.upb.h in Headers */, + B3C41A521B4EA1EB5FE08DEF93B912DB /* ref_counted.h in Headers */, + 1A0D5AB4CBB27968DAA032D292B5374B /* ref_counted_ptr.h in Headers */, + F9F37C960B099E1B4D2CD6C9812FF68D /* regex.upb.h in Headers */, + 9D2D04C5127FB77DA8FEF0CE7C74A5D8 /* resolve_address.h in Headers */, + DEB7B367C652BA7F8FC6AA256BC9F7FE /* resolve_address_custom.h in Headers */, + CE8A8638E4A099334E71FB29D6CF0578 /* resolver.h in Headers */, + 433599187A94B4A983DB287E3528EFAD /* resolver_factory.h in Headers */, + A8A0BA51D350A4542F2DF685E4281D12 /* resolver_registry.h in Headers */, + 203AF4EBDAC76E6A8719BC01DF705849 /* resolver_result_parsing.h in Headers */, + 4474BC8E57A68F720EDF5C091D6E0D24 /* resolving_lb_policy.h in Headers */, + 3BD92A75FECA6C05D6A63457C69218C4 /* resource.upb.h in Headers */, + DB0A8BC4F7CF6331716F283FE9EB7F0A /* resource_quota.h in Headers */, + 7C31C3FDEFDA6514C502AE1F3009B6BF /* retry_throttle.h in Headers */, + 1FAB69D1FFAE665ECDEFCB8F364FBB08 /* route.upb.h in Headers */, + C1DD9C11FF3F1286318BB74E6BF26E2E /* route.upb.h in Headers */, + 67F2A2723E101037F689D78F19FFF12B /* route_components.upb.h in Headers */, + 1AB222A8536808631248234D21D4EAD8 /* scoped_route.upb.h in Headers */, + 04D28042CF3DD12B42A728AD85ED8496 /* secure_endpoint.h in Headers */, + 2204B1FE5BF3E580F0C9EA09354E486B /* security_connector.h in Headers */, + FAC76D21D1E5DC775F7CCD6E5C31A769 /* security_context.h in Headers */, + 3A81303953F7434AD4C327515374095A /* security_handshaker.h in Headers */, + 5C7A77B3A9589C585C3DB60939E26C9B /* semantic_version.upb.h in Headers */, + 68DB302764217136A8D82145928A148C /* sensitive.upb.h in Headers */, + D335C3D22265C11D400ADA63AA8B460D /* server.h in Headers */, + 0E4BF2B5B68CE547330D199A4662FF4C /* server_address.h in Headers */, + 70AE29C09E21A1BA262C9A8702A01AF9 /* service_config.h in Headers */, + B2F326070EC26E1A5EA74183CB5564EB /* slice.h in Headers */, + D26573EB16A85DF20D1B1AB00C849D4A /* slice.h in Headers */, + C3A4CB1EDF31FFB898A53E4F1AF847BC /* slice_buffer.h in Headers */, + C6ECD9541A52D1B673E443C5EA43D6FE /* slice_hash_table.h in Headers */, + 4E28C356A3C9E1B4D6171012AB8B87B3 /* slice_internal.h in Headers */, + 6CF1C2B10CA4961150E96A134A552032 /* slice_string_helpers.h in Headers */, + 65A3508B7B06C89B599E01A71A972F81 /* slice_utils.h in Headers */, + A8C56C952BDD1E697952B8EC3F2D03C9 /* slice_weak_hash_table.h in Headers */, + 23D0C1DD2795076AEA619BC927001CE6 /* sockaddr.h in Headers */, + 05DE0E092ED6B535E561B9405BB472FA /* sockaddr_custom.h in Headers */, + 1135D1632620032F8DD4CD19754EA08D /* sockaddr_posix.h in Headers */, + 53D7DB3EE90EC0899C02317EDE31E25B /* sockaddr_utils.h in Headers */, + 782285867FB7980E179FE37933DE7DA0 /* sockaddr_windows.h in Headers */, + E4AF5E259C1354731502220A22430E39 /* socket_factory_posix.h in Headers */, + 16F875407721D69BD97A0F4D6F7C2ABC /* socket_mutator.h in Headers */, + 3F179132BB7AF8BCF841044CE45DDDEA /* socket_utils.h in Headers */, + 7A08CBA8BF5533889C98B4375672C73E /* socket_utils_posix.h in Headers */, + 76F321A06CFDE7C3B088DDEBA1F54201 /* socket_windows.h in Headers */, + 16CBB270B60DF163833148E1CF0CC66B /* spinlock.h in Headers */, + 8B3D3F827FA6A8D5EFDAA8E234EB9639 /* srds.upb.h in Headers */, + 44A80F08A4325E134B33E48DFF21ED02 /* ssl_credentials.h in Headers */, + 8E0077B98ECA8EA9797B0FC2F62BB9C1 /* ssl_security_connector.h in Headers */, + 1286CD00F9E93DE372B042972E18BC17 /* ssl_session.h in Headers */, + 3A2BC80DC9A819094D93EB00D5A1E382 /* ssl_session_cache.h in Headers */, + 4DCB24CB835CD4F11C1C35D6421207B8 /* ssl_transport_security.h in Headers */, + BFC7DFCEA0250E674F84CB3EB56F3CD9 /* ssl_types.h in Headers */, + F63E101B599D6D22143F6C03BB7D6A7C /* ssl_utils.h in Headers */, + 1ECC4AA326998C9EBA7B530E87022C17 /* ssl_utils_config.h in Headers */, + D1F36CB3251F39394FAD5D1F670E73FD /* static_metadata.h in Headers */, + 94FF73A4307D86DC1B1E52245C6E4624 /* stats.h in Headers */, + F14576667CE49A1A76CD67168879E6A2 /* stats_data.h in Headers */, + D9F28A38E2E9D09967922314E9BC6699 /* status.h in Headers */, + 86675FEF4DFEFE17B097EAEBD47E2D75 /* status.h in Headers */, + DBA37A453E1A429C11551CD0A9F49A39 /* status.upb.h in Headers */, + B918AF4BD47AA1189298076F1C653B69 /* status_conversion.h in Headers */, + 5A1747016074C4648F678D2567812792 /* status_metadata.h in Headers */, + D5360B28401212D3F4648E1D8F665B38 /* status_util.h in Headers */, + CB4F93ACB08982EFA0887E22DE340015 /* stream_compression.h in Headers */, + 30AC36A20FB78B7C34ED6BCB2AC96EFF /* stream_compression_gzip.h in Headers */, + 06E0D1E0EDF2A56562B05DE10D6635CC /* stream_compression_identity.h in Headers */, + A1951648D836A760AF3A8A178E29CBFA /* stream_map.h in Headers */, + B74850DBBA2E246D1BD403B9F8E878E9 /* string.h in Headers */, + 25901486CB1F1A238031BE46F3B5D2DF /* string.upb.h in Headers */, + C6DB331811E065B0E68862651D768A93 /* string_util.h in Headers */, + 02DA58839D4390B246EE14036D8BCEBA /* string_view.h in Headers */, + FE24B5B43948A5559B6138D93B59028F /* string_windows.h in Headers */, + 984CF44642C5130014267D4910983A3F /* struct.upb.h in Headers */, + D11BA680C355EED34FD2A8247659E964 /* subchannel.h in Headers */, + C5D586579E69EBC2A32B96398E3DE9AD /* subchannel_interface.h in Headers */, + 37664EE157F50ABFC5E11BD37CADB536 /* subchannel_list.h in Headers */, + 29A45BFB88A356170951453DAD55D6BE /* subchannel_pool_interface.h in Headers */, + AB1A4BD57805F97D6377356446B968A2 /* sync.h in Headers */, + 358DE67BD81BC88BA6BFA70105BAF8D0 /* sync.h in Headers */, + 53C3BB34CCE28C72C826E059E1224E0D /* sync.h in Headers */, + 494A9FF5AFDB48141ADEFE46CFE318C1 /* sync_abseil.h in Headers */, + C8BC0291DA55865C1419899712218DDD /* sync_abseil.h in Headers */, + 0874CF4542B826C7D8E8EB163E02B293 /* sync_custom.h in Headers */, + 640344F61B47AF6FDBF13048DEBEBD75 /* sync_custom.h in Headers */, + 1FB1D122BC07EEADC03AA890479D333F /* sync_generic.h in Headers */, + F3DCE6ADFF12F4297DED54F703F90EBC /* sync_generic.h in Headers */, + D8F7ECBA9D5AD60BA1680C522D20A7E3 /* sync_posix.h in Headers */, + 3D68FEBE36D9DA1DC98344247DDC0F2C /* sync_posix.h in Headers */, + AA1AF46D61C6CD51CAE37A5556FC09D2 /* sync_windows.h in Headers */, + BBABBFECC1F3BC0F05D36356422EE89B /* sync_windows.h in Headers */, + BE6D3EE205C686F5748F8D67EF1504D7 /* sys_epoll_wrapper.h in Headers */, + D6FA5FE0F405307EE4C4D0B38EAF796D /* table.int.h in Headers */, + 4617C3663971AD051E064FE50979DD24 /* target_authority_table.h in Headers */, + 23A1B93E78E8C04FDE6A894B7FB27F03 /* tcp_client.h in Headers */, + E31A993F58C262E68A27C449180CF035 /* tcp_client_posix.h in Headers */, + 44A7603686B3EAAE3A7D5B599551C7BE /* tcp_custom.h in Headers */, + E7CB382737FBD1513E7C1AD3EED8A06F /* tcp_posix.h in Headers */, + 0DDAF6BC09F074985FDD1A0118DBF016 /* tcp_server.h in Headers */, + F004819E143BE9FAD832315D4EDB3246 /* tcp_server_utils_posix.h in Headers */, + 9CEBE4757E1D5CE0093F5D6263688300 /* tcp_windows.h in Headers */, + ED79C66A2C294DAB65B943EC52AAA8E1 /* thd.h in Headers */, + 2B09FCA3380ACDA8E3EB166CFB81B6B2 /* thd_id.h in Headers */, + 0B4EC5BD61B5BD57C4ECF94AE34137BC /* threadpool.h in Headers */, + EA924C954A151D4765531CE9246A2A89 /* time.h in Headers */, + ECF8E77962E9B80C149A65DEF0B51F3A /* time_averaged_stats.h in Headers */, + 60E4DAA7A764E21DD7E941312952BECC /* time_precise.h in Headers */, + 90F00511341AF87406E4F9106F521A59 /* timeout_encoding.h in Headers */, + F03C37697681A9B672506D4DAA581F3A /* timer.h in Headers */, + 757AF20BA912A3D39CB28119F3CC2414 /* timer_custom.h in Headers */, + 0A11166AF18DDF5822DAE3C28992F0EA /* timer_heap.h in Headers */, + B7B0CACCD1E3B59591131E469D8734EF /* timer_manager.h in Headers */, + 3161D0F866D24D559D88128736FCB8A5 /* timers.h in Headers */, + 2F13210E31EAAF73F159A174691C93AE /* timestamp.upb.h in Headers */, + 9FC7DBD410B743BC667A2CCE3ADE1D33 /* tls.h in Headers */, + 4DB8FF1FA5B5B03F734C6446B82721E6 /* tls_credentials.h in Headers */, + 70F017D9501668A43658FEAEE920FA61 /* tls_gcc.h in Headers */, + CDEE734BA92F2251481C7ABA35D1BD53 /* tls_msvc.h in Headers */, + 069E440512241A30E3E0B6AEF95E7423 /* tls_pthread.h in Headers */, + B6EA5800A1F9381EF6CD16290D44E4B6 /* tls_security_connector.h in Headers */, + BB9D724D8160305110E4E49C3C9BDCD1 /* tmpfile.h in Headers */, + 252DBFEFF06B2B7A08D0EE468C31B5FB /* trace.h in Headers */, + 346120777DCDCD458A53183F9F009981 /* transport.h in Headers */, + 6BF84387924FA88541961DC68BD5160A /* transport_impl.h in Headers */, + 84FABE78A74ED3CE8D983A7F66337EFD /* transport_security.h in Headers */, + BD5CA489E59AEA2442C5BD1EC2319C7A /* transport_security_common.upb.h in Headers */, + 9D8EABA44C53596EF2E9817DABF7DE2F /* transport_security_common_api.h in Headers */, + 96B46362F927A3220EEEC6AC57D0C9FC /* transport_security_grpc.h in Headers */, + 0638C5A083EB5777D7637C4D3C2661CA /* transport_security_interface.h in Headers */, + D440216B7B3975B7239B47BC9986333D /* tsi_error.h in Headers */, + 24A88A38C948D38CA7EFF010D6F5C623 /* udp_listener_config.upb.h in Headers */, + 8FD5CEE5C18BE80C30006B3461C6148D /* udp_server.h in Headers */, + E9A4CC80DC048C7B5342C85E7E421691 /* unix_sockets_posix.h in Headers */, + 0455568867B9860C2D1FE34ABEF440B2 /* upb.h in Headers */, + DC94685FE177642C5ADDFB5A4246BF00 /* uri_parser.h in Headers */, + A3EE0B88B2083331B0D97727A03749E0 /* useful.h in Headers */, + 41628D705E80247E03AFB49E919C87F8 /* validate.upb.h in Headers */, + 07B30690849DF4C1BD272C437988CD3B /* validate_metadata.h in Headers */, + 31930FABFCD92005B8E9B4EADF799784 /* varint.h in Headers */, + 1FDA63BCFA3AD6DBB748EA53842CEDCA /* wakeup_fd_pipe.h in Headers */, + 8C5A0DE1C59CB5E13188E48258EA23F0 /* wakeup_fd_posix.h in Headers */, + 22855CBF5305FB9ADEB20234538C1C94 /* work_serializer.h in Headers */, + DD4D6A8E8B15C6A32878E4041BB7AF4A /* workaround_cronet_compression_filter.h in Headers */, + 9A1231794FA6CFBF24E4B99E8F1703AA /* workaround_list.h in Headers */, + 87C7F62844799D35688F90ACA4CB7911 /* workaround_utils.h in Headers */, + C7C08555D93C0C90AEA2992609129396 /* wrappers.upb.h in Headers */, + 12CE2AEBE1ED231C3A69F8ACD32C6930 /* xds.h in Headers */, + 64515B0C34A887D4FE9D0EA720ACB422 /* xds_api.h in Headers */, + A45246B72D10DBE1292605BE0618FF52 /* xds_bootstrap.h in Headers */, + 198F84590966D3B7C1C9A24F647691A5 /* xds_channel.h in Headers */, + 10660932C3819557A77BED3373D90F2B /* xds_channel_args.h in Headers */, + 6FDEAC944FACA7E6BFD7DF6D7B87F115 /* xds_client.h in Headers */, + 8EBBDE4511147F8DB1A372EBD0733940 /* xds_client_stats.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 90C37D6AD6280B7EBF0CBAC27FAE9C45 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CECC01F60FB225770C33E5ABEA66B50 /* FIRCoreDiagnostics.h in Headers */, + 06740BA56AF5D2ADCFCBC37D7B041BD6 /* FIRCoreDiagnosticsData.h in Headers */, + 0E131B97FCDF68EA3673EB2E133F4A23 /* FIRCoreDiagnosticsInterop.h in Headers */, + 2CB51703318CE6C8FF4A6191F8464CE8 /* firebasecore.nanopb.h in Headers */, + 6A8CC9BED5396FB668C60B779DE32D1F /* FirebaseCoreDiagnostics-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 949FB3CEEBBD6FFA8D2D05E5F6A6F384 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95269BB972F32A79B6E9421FEFAD5DCE /* Pods-SaraAttended-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A97B495B350EE15B5D583CF96E897E81 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3895C38465CE97B97DB80449E22F35F2 /* FBLPromise.h in Headers */, + 10F41CFD8BB19528F9E2A3FEF73F0CC4 /* FBLPromise+All.h in Headers */, + 40DB6243000AFEA52689CE99CB0EC54C /* FBLPromise+Always.h in Headers */, + 0CC0293E5DBFA12E2E0BBA7F49CBBDF7 /* FBLPromise+Any.h in Headers */, + 1E004A88622F017B5964425A703FEFB0 /* FBLPromise+Async.h in Headers */, + 83E64F6850FB08F165971A29CB7B966B /* FBLPromise+Await.h in Headers */, + CCB195493868B3006D08FDCB8B82A76F /* FBLPromise+Catch.h in Headers */, + FC4318F9EE0FFA36B58DEDD6C76929E8 /* FBLPromise+Delay.h in Headers */, + 6E721D032A69BC26C2758C4C76609F6A /* FBLPromise+Do.h in Headers */, + 1E0A18BE13A655FCB2DD3D7FEB219E41 /* FBLPromise+Race.h in Headers */, + F7A77C44671C799A8C4BEDD2E548CFDD /* FBLPromise+Recover.h in Headers */, + C4856B5CE8E8F7348D8C93229DB25D2B /* FBLPromise+Reduce.h in Headers */, + 39573E4DFEDEB4851E49FF6EFACCA2C6 /* FBLPromise+Retry.h in Headers */, + D7C8D15390FA38717F90A750CE162FB8 /* FBLPromise+Testing.h in Headers */, + 1242E5314411332025EB5211A0A19FF2 /* FBLPromise+Then.h in Headers */, + AD05AD75CB5AC5FFC7674CDABC19780C /* FBLPromise+Timeout.h in Headers */, + 77836C97114A1B13CA411DCAA594858E /* FBLPromise+Validate.h in Headers */, + 5C8422121EE4B56296BBF80562A6F65C /* FBLPromise+Wrap.h in Headers */, + 1BC99150B3C9DB2426A9E19CA57C579B /* FBLPromiseError.h in Headers */, + 5347BFA5BCD7ABB294D3018DEEE445C6 /* FBLPromisePrivate.h in Headers */, + 3E7EE75D380FCDE792B502E564F89DE1 /* FBLPromises.h in Headers */, + E09919E1AEE0F014954151ACBF73031F /* PromisesObjC-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AE2EFA3B09B8971C562E3F9700989DB3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CB9B3E5AC7A3E4317DE1889043218A93 /* cct.nanopb.h in Headers */, + 4B3FBB36833D77D4EC34FE232B36A88C /* GDTCCTCompressionHelper.h in Headers */, + 53BE22599FE0ED3196B68A11C5213547 /* GDTCCTNanopbHelpers.h in Headers */, + E4F82E1873C7935D380E5853C03FE818 /* GDTCCTUploader.h in Headers */, + B498A3AD56724A571CC1F00D71CEB6AB /* GDTCCTUploadOperation.h in Headers */, + 5916D7617A25B5CB4503EE26038C4258 /* GDTCORAssert.h in Headers */, + 8A19BBEEE65F3A8204F951B356BECE09 /* GDTCORClock.h in Headers */, + 3833E748083BE664DE8B03CDECF75715 /* GDTCORConsoleLogger.h in Headers */, + 52F63CB3479C9A62F7269DD8ADB538DD /* GDTCORDirectorySizeTracker.h in Headers */, + 5D4C1AF5FA394983BFF00F0B7325B10C /* GDTCOREndpoints.h in Headers */, + 316D1B2FDF1B22CB09F0E22C3A7E12D0 /* GDTCOREndpoints_Private.h in Headers */, + 941F77F91F52BA847EC84A6A99200F59 /* GDTCOREvent.h in Headers */, + 90D829D9B18CBE9691FC23D2872E1F9D /* GDTCOREvent+GDTCCTSupport.h in Headers */, + F0117DB2784E092D5B35C2CBF68DA17B /* GDTCOREvent_Private.h in Headers */, + 5F15B9985211615EE436686086D2391F /* GDTCOREventDataObject.h in Headers */, + CB19EBA6A664A894DCF6BD0C2D97E837 /* GDTCOREventTransformer.h in Headers */, + D076B2E9FBCA34CB153AF3D9E15C2C1B /* GDTCORFlatFileStorage.h in Headers */, + A5BB64F6AEB2702BAAC7BBC7E3DC91F5 /* GDTCORFlatFileStorage+Promises.h in Headers */, + CC792F9170EF0ADD2B71196AD80A225E /* GDTCORLifecycle.h in Headers */, + EE9EB991CA00A36187ED8B9FD322A987 /* GDTCORPlatform.h in Headers */, + 0F1822AAAC0453757F14046D62A26BE4 /* GDTCORReachability.h in Headers */, + E22158A13C437839B2D0EF9D06D5C7C8 /* GDTCORReachability_Private.h in Headers */, + 38DFB01A7BA79A39638B84A7F2893349 /* GDTCORRegistrar.h in Headers */, + ABF32D4FDEC120576D38407F9E4221C5 /* GDTCORRegistrar_Private.h in Headers */, + 3E92E576FBC4AED3C8FC43020FAEAE85 /* GDTCORStorageEventSelector.h in Headers */, + 4D037FCF2D94F7A5745808A3492049FD /* GDTCORStorageProtocol.h in Headers */, + E52C8B27C822EEEF8E76C4FA84B43763 /* GDTCORTargets.h in Headers */, + EADEC9D8760FC5AA1724EAA8715B4DE0 /* GDTCORTransformer.h in Headers */, + 151B910833192C850CA5AE1D2CC69FBE /* GDTCORTransformer_Private.h in Headers */, + 795BD48DE6A4E4128EAFE88F3D8D8A5B /* GDTCORTransport.h in Headers */, + 8E63B79CBA87BA9B9D7AE75087771C97 /* GDTCORTransport_Private.h in Headers */, + C5586CE2AFB6BFB941AA30046E9283EF /* GDTCORUploadBatch.h in Headers */, + DC42E71D05D3E47FFC064F071640E662 /* GDTCORUploadCoordinator.h in Headers */, + 1542E414AA17808E2751917FEC4845F4 /* GDTCORUploader.h in Headers */, + 0B2BDC38C85E3622CD96CBDF4BF47CC5 /* GoogleDataTransport.h in Headers */, + 609833F44588F25131223E27ED02CF2B /* GoogleDataTransport-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F81D064E8FCDC77296EFC77EA472FE3C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DB67F353ED3C667559237754B9468E42 /* abseil-umbrella.h in Headers */, + E481900AC240DFCCC366D5231BE4FB59 /* address_is_readable.h in Headers */, + 2FB7663E79BE84C16D392EB455FDE4FF /* algorithm.h in Headers */, + 0559668AF631E901AE0E75193DF74A59 /* any.h in Headers */, + 0EF79602E0BF9780493923345D7F69EC /* arg.h in Headers */, + 2D823FF210E5246D01EA54E239D8B370 /* ascii.h in Headers */, + 333D4E22F46FE760EE6B8C2EFC8466B5 /* atomic_hook.h in Headers */, + E4F181C677F318D9C0A451D3571CF3D9 /* attributes.h in Headers */, + 007AD0021430044B4D332188D140058F /* bad_any_cast.h in Headers */, + 2D0378F646808A63402B15E4B542D9D4 /* bad_optional_access.h in Headers */, + 47CEA59B3A0A8E38A6FBD1CA339D561A /* bad_variant_access.h in Headers */, + 0A455DAE8D81CFF57DDEC321CA7E7DC8 /* barrier.h in Headers */, + 6FBF1E307C1E43B61929344307CBA53D /* bind.h in Headers */, + 2CC39194FC20240B87A5792D48F1D311 /* bits.h in Headers */, + BDF0730BBA1E42ADDA9E1E2B85FD022A /* blocking_counter.h in Headers */, + 28F4E6103E0E70A876587EF7D699A0C6 /* call_once.h in Headers */, + A8373269860F7D096D1DE8DE4FDA4D52 /* casts.h in Headers */, + 455EFA5100C89EFEE662231844D53FEE /* char_map.h in Headers */, + ABD8255ECFAE84082B3CA0FFD9E24EE8 /* charconv.h in Headers */, + 45AE69C2380A01CD49EFF1BD3CB3A88F /* charconv_bigint.h in Headers */, + 9758540C7A0F9F0636B18A37F4DFFF8F /* charconv_parse.h in Headers */, + 8AB059B063A5C4D64393AB8DA4FAFBA0 /* checker.h in Headers */, + 612D08B903810EDA74E783D407C739F8 /* city.h in Headers */, + 1A9596CEFA887D4250DDD176CC81027F /* civil_time.h in Headers */, + 1D06DE231C29C1A4B3C6B962B7810BF3 /* civil_time.h in Headers */, + 428B60D61D3AE3367DF4C513C5E70BC7 /* civil_time_detail.h in Headers */, + B437DD8E7D61CB7143E6C1AA443B191A /* clock.h in Headers */, + B32DD1529B38C2AFFAB11E83DF160B33 /* common.h in Headers */, + 4AFF6F6AEEB2F3A88CDC9E610D909143 /* compare.h in Headers */, + 34E7AF8D52860A3E0B33C549A7E33E31 /* compressed_tuple.h in Headers */, + EA35AC7A61C23D1362B2CE53EA7ED076 /* config.h in Headers */, + 38BD386440063C08899050AC6BC6ABEB /* const_init.h in Headers */, + 9A2D6DFA0939B734887C8A93E02D5244 /* container.h in Headers */, + 2D174ED75E17ACFF712819EADE18D2DB /* container_memory.h in Headers */, + 890293D1E2BC67037C7C9965ED8F8A4B /* create_thread_identity.h in Headers */, + ABF2CBC6A55798DB007AC15C44DAA137 /* cycleclock.h in Headers */, + 67474BCB90359C39863051D3907FC58D /* demangle.h in Headers */, + CD5F8C615ADA5B60B0246F8C780DED26 /* direct_mmap.h in Headers */, + 225FF1872B085ACE873AD6795F6BD9E7 /* dynamic_annotations.h in Headers */, + 7034F73D746204F01A44582C695ECB70 /* elf_mem_image.h in Headers */, + 79FB69BEC7BDD36B9C98E3184598FEA0 /* endian.h in Headers */, + 4B502C8028E91CEF4A50392505CABAF8 /* errno_saver.h in Headers */, + 261B765ECD31B84E0EC079D7F7640E89 /* escaping.h in Headers */, + AA9875D0C0767A5C9A3716D2E64C944A /* escaping.h in Headers */, + 56CD4B7F8FD13FC5AC0B869BEB4EF785 /* exponential_biased.h in Headers */, + F4792832245D154AB9C318939CAF54D3 /* extension.h in Headers */, + 299A730892E6354BB074EBDEAF12203C /* fixed_array.h in Headers */, + 657DD49A753C6374C8AAF784464977DA /* flat_hash_map.h in Headers */, + 4E501FCF264946BF11C49893A79AE732 /* float_conversion.h in Headers */, + 240F7FC48BBE97D6F1847CBFE8C05410 /* get_current_time_chrono.inc in Headers */, + 8CACA5A904DE8DE4BFD9120F953E5956 /* get_current_time_posix.inc in Headers */, + 1397B76EC069FB684977E185F08AE816 /* graphcycles.h in Headers */, + DAD484F74CF4569B5B6FE14138AFC273 /* hash.h in Headers */, + 8AE5A11DD07AF93E22C44A818DFFF09A /* hash.h in Headers */, + BF105756685FC996BDEDB9D002A17A0B /* hash_function_defaults.h in Headers */, + 3C1AD76B18D175D89F6D0329D233C051 /* hash_policy_traits.h in Headers */, + D79626F8444FB254FA14960674C19A96 /* hashtable_debug_hooks.h in Headers */, + DA00DF11228DE8582CA0F56BE9491232 /* hashtablez_sampler.h in Headers */, + BA5B5D7BCA9BD1299936A7F7A04E5339 /* have_sse.h in Headers */, + D72359C8ABA37BFA70D13544ACF0FE3C /* hide_ptr.h in Headers */, + B1BC466845ADB0143C621AE428CDA33C /* identity.h in Headers */, + 3B328BD5100AB62D4A4AA2B0011E94C0 /* inline_variable.h in Headers */, + B3A75C2870504A75C53E31391B2093F9 /* inlined_vector.h in Headers */, + 27D038541A5765695DA0B52B31CA1F43 /* inlined_vector.h in Headers */, + CFD45FBFBD989D543A3AA260069DFE2A /* int128.h in Headers */, + 3E04E39DA776650179F9D19831856F9D /* int128_have_intrinsic.inc in Headers */, + B2E767C64A18B006786DBBAD72E11494 /* int128_no_intrinsic.inc in Headers */, + 5D99467560FA33DBE77A181B720D9B50 /* invoke.h in Headers */, + B894F44BDC39E76C6FD0DD0EC67301AB /* kernel_timeout.h in Headers */, + 8B4A925E1769F78619E0B1A33720BDAA /* layout.h in Headers */, + BB7AF5FED97730A924C0AB551244344A /* log_severity.h in Headers */, + F0A3258AABAA1FFA5C292F77A9071D1A /* low_level_alloc.h in Headers */, + 3F1A92B11D7C6A52CFDE7679FCF39834 /* low_level_scheduling.h in Headers */, + 3DF0E1CEC8CE8DC4844E69AD11C197F2 /* macros.h in Headers */, + 6CF3E7D231FA9A577C82E176D32692CA /* match.h in Headers */, + 6DA6DC663B9B7AEDF4E835AF4E0D510A /* memory.h in Headers */, + B19B2F19AB9C39CCEA0660F50CF30D36 /* memutil.h in Headers */, + 3DF0B13129E3CB2D100FD209CB177CCE /* mutex.h in Headers */, + A2CB8EDDE43C025F74BE8D7AF11093A0 /* mutex_nonprod.inc in Headers */, + 7DFB526FCBCA3CC0607D3959A51305E8 /* notification.h in Headers */, + ED3D8D6F167955C718CE501AA86D9CA9 /* numbers.h in Headers */, + 7FEFB1EA4AAFEA5C2C5B8B690BE9A564 /* optimization.h in Headers */, + B9344EA1B9E8C834E4D00C9886128723 /* optional.h in Headers */, + 4907DED5C12039866DC8D38619A78738 /* optional.h in Headers */, + 5EC33043ABB642F42115D1C7684D94F9 /* options.h in Headers */, + BF9AD4D3A333665F5052FA8CCB0DF902 /* ostringstream.h in Headers */, + 6D49976AB716D60EE30532D2744116E7 /* output.h in Headers */, + 2B7F9F81A90F5CA81B7AC23C72059A71 /* parser.h in Headers */, + AA820769DAF72F4BE0A07BA7385F417A /* per_thread_sem.h in Headers */, + D2344D66779755C8850E9C6D34AD07BE /* per_thread_tls.h in Headers */, + 3E48D3CC0D6D4F89F22CE7B2E493E13E /* periodic_sampler.h in Headers */, + 38F7614BCCF3525CB35631CADFE8AD90 /* policy_checks.h in Headers */, + B3165DC5D6F24B818AADEAF718ABC9E2 /* port.h in Headers */, + B80182DC95C5BBF535EFEAF5414AEA2C /* pretty_function.h in Headers */, + 564153B1C08CA8F18C8FE04BA70E23BF /* raw_hash_map.h in Headers */, + 35DE390B2B787DF8DD641EAF31E53CF3 /* raw_hash_set.h in Headers */, + F37122944A93D55430C6F05FFADC86CD /* raw_logging.h in Headers */, + B965BB4BCC2374E4BB5603846322867C /* resize_uninitialized.h in Headers */, + AC75E3E5D5144F2C0012B1E97499E1B1 /* scheduling_mode.h in Headers */, + 722F503E5524F303BA5980CBAC84CEF7 /* span.h in Headers */, + 1A624680DB0ED7E8B3BF6BF6428DA856 /* span.h in Headers */, + E94A8CB70DDA0F35A3182D8DDA8580E3 /* spinlock.h in Headers */, + 9224BCE6BCFB884D235B1534E3E3A407 /* spinlock_akaros.inc in Headers */, + 669F03A3AF729EC32B02B49D0EFD08AF /* spinlock_linux.inc in Headers */, + 6F6CDDB4F9B1691CEF56D9F66382EB84 /* spinlock_posix.inc in Headers */, + 5A56AB50E1773A2DC6F19BFBBE522E7E /* spinlock_wait.h in Headers */, + 86E3B1A0E4DB68608AE9A89D6E3CEEE7 /* spinlock_win32.inc in Headers */, + 7943234CC3A53474D035FE2D07D8313E /* stacktrace.h in Headers */, + ECFB4ED8C65E70C700DF88CA9044DA2D /* stacktrace_aarch64-inl.inc in Headers */, + 10DB1469E54C93AA970F0ADFBE8E6127 /* stacktrace_arm-inl.inc in Headers */, + 07C840C945A16DD3B8A47102F2DD1CDC /* stacktrace_config.h in Headers */, + 4A4D16DC73273A589206D8373B57603F /* stacktrace_generic-inl.inc in Headers */, + 960D8D417F0D8D59C5E9065722CCDF95 /* stacktrace_powerpc-inl.inc in Headers */, + 60C94F0C6BC85A92D656B2097F246BDF /* stacktrace_unimplemented-inl.inc in Headers */, + 4F6CAEF8830DC3934FED4EA585D49331 /* stacktrace_win32-inl.inc in Headers */, + 0FC28FE599F998C0635774ACE2812CF4 /* stacktrace_x86-inl.inc in Headers */, + 2219B59322E43256C6A81DE0F948FE66 /* stl_type_traits.h in Headers */, + 5B6C902A19517915F5757200D5F67A65 /* str_cat.h in Headers */, + 5C310BE8882AC4936D77A3EEE1734EA7 /* str_format.h in Headers */, + 9B8FB44EB7009C1AF89DE2E652683CCE /* str_join.h in Headers */, + 2479841C934FA3CB7F757FA03984BFF5 /* str_join_internal.h in Headers */, + 0B889A2CC8AC860A091C1C63DDD57C68 /* str_replace.h in Headers */, + 37D33E887C915B5B8DA30F429C6BB865 /* str_split.h in Headers */, + 7DBCEFFC2B8BDE6BE851CF4136216592 /* str_split_internal.h in Headers */, + 409AA2C05221428703382F99D6382F23 /* string_view.h in Headers */, + 7BBE8A596C6B16D1ADCAEC3A60E04A19 /* strip.h in Headers */, + 7F9472568941AE2BB4E32EEA9E95D692 /* substitute.h in Headers */, + 6DF2D55A868DE0884CE826AA2EAFA03E /* symbolize.h in Headers */, + ABDA1EB91ED74606C37294C1EFCC7A37 /* symbolize.h in Headers */, + 767875B04FF60630BDD2E671FFBB29DD /* symbolize_elf.inc in Headers */, + D2519B5751A5C562B06F7776E4A75F6A /* symbolize_unimplemented.inc in Headers */, + 2CF4493E48513658CB0063B1D1C9480E /* symbolize_win32.inc in Headers */, + F618E694702D82CC8B55AFC1618DE36F /* sysinfo.h in Headers */, + 8EB7926FE394C4ED618999143661453D /* thread_annotations.h in Headers */, + B7F00F2D28711644CC60D27AB1BAA3BA /* thread_annotations.h in Headers */, + 4F67F4745E1FD32710A2D6A0A12966EC /* thread_identity.h in Headers */, + 136CCE307D0217E767043EEBA6DAAC9E /* throw_delegate.h in Headers */, + 8EF3BF5F92D9005BE4DEB58776471BFD /* time.h in Headers */, + 83361764F77763C5AB76CF45C8CACF4F /* time_zone.h in Headers */, + 75AC56AFC06C3E5E0935B9C019AB4E40 /* time_zone_fixed.h in Headers */, + 49F9FD176A790535F8C1EDC4FB8A70F9 /* time_zone_if.h in Headers */, + D38EAD20DF5DD1EDE5C7E8C388B44F06 /* time_zone_impl.h in Headers */, + 25AC33B8A51C5E8F64A9C08E3628BEF1 /* time_zone_info.h in Headers */, + A92494DF24C57E942D7B5EB1AAD01891 /* time_zone_libc.h in Headers */, + E505EF96F69A58AEF8D23A0CFFBF33A2 /* time_zone_posix.h in Headers */, + 20B5C175E309AF48CA77B6E5FF040927 /* tsan_mutex_interface.h in Headers */, + DDE385BB902E020597B36D5A311F9C43 /* type_traits.h in Headers */, + 6900E6C54EEC19145862CB697B6AA547 /* tzfile.h in Headers */, + 1E61AE7741D39D44F71134E4554619BC /* unaligned_access.h in Headers */, + 1FABF2DD6E9645AE6AF85E153853832B /* unscaledcycleclock.h in Headers */, + AB061F8725C93B0027A3F8C135A9E11F /* utf8.h in Headers */, + 521E7D8205679A66DD4F8BB9C9CDCC78 /* utility.h in Headers */, + 2B5AD899A3C45D965019F069FE3DE5C1 /* variant.h in Headers */, + A6F74815F394675CBC04417CA69061E5 /* variant.h in Headers */, + 2A1655A900EB9234ACF962312D07D368 /* vdso_support.h in Headers */, + D662B112A50D097553F9D65FD8CB4B2E /* waiter.h in Headers */, + A44D17B24551623C3787C162DCA8C9AC /* zone_info_source.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 1400EFE1EBD21D4AEECF32F71ED7416E /* Pods-SaraAttended */ = { + isa = PBXNativeTarget; + buildConfigurationList = 859BFB5CC122E32358167B58D4660B10 /* Build configuration list for PBXNativeTarget "Pods-SaraAttended" */; + buildPhases = ( + 949FB3CEEBBD6FFA8D2D05E5F6A6F384 /* Headers */, + 231B65C2BF12939BAF504CD9E4A6CA1F /* Sources */, + 8A9541DF7BCC59D3B72A0FD545BF9540 /* Frameworks */, + 77DD85BA5A8A9ADD13C743177AF58E44 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + E130AB14137AE747F91AEEB6D5B6F114 /* PBXTargetDependency */, + 4E28F261AE84116236D0FFB6AB6B1571 /* PBXTargetDependency */, + 8058AD8AF8F1832A1A863B6382C6D3DE /* PBXTargetDependency */, + 242930ADDE616330C15E84ACC6E4A1EE /* PBXTargetDependency */, + F26A7EF96425D9963F2CCDA3D69D7154 /* PBXTargetDependency */, + AD59CD9506B81B300D4C2F556996F1EA /* PBXTargetDependency */, + 941FFA1DE1D7B33E49E3F1FD3FAD5066 /* PBXTargetDependency */, + DA3B5FBCDD5F015D726EFE7F84592BF9 /* PBXTargetDependency */, + B07A433F8F3232ABF8D074F0A8A03366 /* PBXTargetDependency */, + FB8B73A7BACD1F9498F6BA52150DF4FF /* PBXTargetDependency */, + 87F03EC96C443D07A390B9525BF2A5EA /* PBXTargetDependency */, + AD5584EBC262E9B5B8B057C1D2EF5457 /* PBXTargetDependency */, + AEFFA6302B943CDC17A69C07E344DEE9 /* PBXTargetDependency */, + ); + name = "Pods-SaraAttended"; + productName = Pods_SaraAttended; + productReference = D502CDC0DFFBDC46C6A8B6E7B80B36B2 /* Pods-SaraAttended */; + productType = "com.apple.product-type.framework"; + }; + 1C5E43B0A9555E7C2E43A6D7C8A23CF6 /* gRPC-C++ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 87B4A9F5CC0702CA2B8D8E5A6B18B90B /* Build configuration list for PBXNativeTarget "gRPC-C++" */; + buildPhases = ( + 8E339C4CF27B6756D69C86CE55A161D7 /* Copy include/grpcpp/impl/codegen Private Headers */, + 74CB6E612E6FDDBAC946C6BB37232DCF /* Headers */, + 850BAF43C7451A99D223E366F61940AB /* Copy src/core/ext/filters/client_channel/health Private Headers */, + A550C3D57F4B70C51C20841170DB11CC /* Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 80B581373BC8DA45E69C69E9D53244C7 /* Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */, + F7A6F081CADBBCC89BAA5ABE63958E2D /* Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + D2C718CB8016A888749133D185C0E1F7 /* Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */, + DE488C3EE1BB2D6CAD9C6EA3391EBD29 /* Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */, + ABF2F38A209D1C77629F4B548C937B66 /* Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + F811133AB254104829C578A63AAD03E5 /* Copy src/core/ext/filters/client_channel Private Headers */, + 63679165D2A875315D90AE67C84F062A /* Copy src/core/ext/filters/deadline Private Headers */, + ADAFB560C4B355AC53DC4EDCE7E136A2 /* Copy src/core/ext/filters/http/client Private Headers */, + 87AC9751489FD9234CBCF6CA620907FF /* Copy src/core/ext/filters/http Private Headers */, + 931F58D1E6035347B5E034E90BB84907 /* Copy src/core/ext/filters/http/message_compress Private Headers */, + 36BF55EF5EA3D0066CFB932D92C57FFA /* Copy src/core/ext/filters/http/server Private Headers */, + 00D4306755662CCA063EC2A92A67E0A9 /* Copy src/core/ext/filters/max_age Private Headers */, + 4779D3001F58A8ED47F2651323857FFA /* Copy src/core/ext/filters/message_size Private Headers */, + 634B9B9B13BBE7CF420A593A9439C444 /* Copy src/core/ext/filters/client_channel/xds Private Headers */, + AF8E3E410A754D8BACE79387853B9CBA /* Copy src/core/ext/transport/chttp2/alpn Private Headers */, + 7F9E9EF1AD9D0D6AE69BC87666EDD663 /* Copy src/core/ext/filters/workarounds Private Headers */, + EED76687D15D9D62ADF0C78B0963B6C1 /* Copy src/core/ext/transport/chttp2/server Private Headers */, + 515FEEF5C2F0981C506B82831FA57EA3 /* Copy src/core/ext/transport/chttp2/client Private Headers */, + BD113CD222F6A42ADB175EB03A39E0D3 /* Copy src/core/ext/transport/inproc Private Headers */, + AE7DE5077504D1B2F7CE1CE8C7EBC0F3 /* Copy src/core/ext/transport/chttp2/transport Private Headers */, + EEF5D7C6137A9EEB21B707E036A5373D /* Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */, + 00355775CF598F323FA205AB3FD77B85 /* Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + 915CF8A9B486E4E0F986D9069A8193FA /* Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + C33EE98905AA8F865EA7A39EF3B8C597 /* Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 67D076D53225361EA713F69163090628 /* Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + 4715CBFF9037E78F341829BD7B623A6A /* Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + 9511E1694F7466ED55EF0AEE910B2855 /* Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + 7B3B00381A1B67D861CF1AA7DB52ACB0 /* Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */, + 51F006D3F9C370645ECA520F6376015D /* Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */, + BA7489423942389196B4B55F27893F57 /* Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */, + E4ACF613D896617B67896BEDCBCC0D60 /* Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */, + 2408E7950D6A720D24C9F80B28D9BC6A /* Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */, + C31F31CB9DA223B746C4916CF0560E1F /* Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + E063116DCF29ECF04A398A9AD414DD0F /* Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */, + 5CF673EDF03402A736498E058F6D15E8 /* Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + 79A34B02BFE2C646B3FB1214DF4E3FF1 /* Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */, + D9FC4F0E69A9584725C9CC44F0D75BBE /* Copy src/core/ext/upb-generated/gogoproto Private Headers */, + 7252340B9E23BF6F4DC13F9E0B6367BB /* Copy src/core/ext/upb-generated/envoy/type Private Headers */, + EB7761B7B2C8D0CDDE5697302AE03552 /* Copy src/core/ext/upb-generated/google/api Private Headers */, + A7F11F79E3FD33B8C2ECDAA68B24A3B2 /* Copy src/core/ext/upb-generated/google/rpc Private Headers */, + 7C15A31E7F553344A649DE2D0CAED09D /* Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + BDE38B4303B470648FD8FF3197AEAE37 /* Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */, + A5AEC7DDC0C86D87C08496F1FB6F4CA9 /* Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */, + 8BBD8A70D097206BCF3DA7FA84E4D9B3 /* Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + D00C617FD8EB6FC9249FF91B4D02B5BF /* Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */, + 906BB5248E78B653AF55E38AE46750A0 /* Copy src/core/ext/upb-generated/validate Private Headers */, + DA9901266A70DDB6F859D2527BE3FAFB /* Copy src/core/lib/avl Private Headers */, + 08BBD04A79439AE7335379BCB7134479 /* Copy src/core/lib/backoff Private Headers */, + C45F9989382F9EDEF23409311283D2D6 /* Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + 3C3B8B9A1C1D1D387122ABBA09B650E7 /* Copy src/core/lib/channel Private Headers */, + 523E8536CE7903CC31C449FB00E50516 /* Copy src/core/lib/compression Private Headers */, + 7F65EE7CFB805F5F475D8FB372406E78 /* Copy src/core/lib/debug Private Headers */, + E98EF7A18D61E1142965A233AD43D5DC /* Copy src/core/lib/gpr Private Headers */, + 225608A3BD0E881BEB63692F9AD456DF /* Copy src/core/lib/gprpp Private Headers */, + 0E46EA5D94C5E4C82F5999C350A9CF32 /* Copy src/core/lib/http Private Headers */, + E2F75945AFA6745EFEAB212950B68FD7 /* Copy src/core/lib/iomgr/executor Private Headers */, + 667E86135FDF3BDB92149B32CA8FEFB5 /* Copy src/core/lib/iomgr/poller Private Headers */, + 1E18ADF6B97DDE699C9AAB96A582677D /* Copy src/core/lib/json Private Headers */, + AC891B0FAF8A0EFB19BC5A46F28DBC89 /* Copy src/core/lib/profiling Private Headers */, + 24392D2792DD24AB8D355E9740A40712 /* Copy src/core/lib/security/context Private Headers */, + 61AC98C6A7AB54E0C1EC7F5433531537 /* Copy src/core/lib/iomgr Private Headers */, + 885E39A9AA3A88D7FF3FDD54628D5431 /* Copy src/core/lib/security/credentials/composite Private Headers */, + 0DFF43E1C7A953C7E3D3AE99406EA2F5 /* Copy src/core/lib/security/credentials Private Headers */, + 6FD36D2F2D49193B2DACAA9B286192BE /* Copy src/core/lib/security/credentials/fake Private Headers */, + 57C40966BCD4856B90E74DC267A765D3 /* Copy src/core/lib/security/credentials/google_default Private Headers */, + 16F213EF4E561591369AB03347734BFC /* Copy src/core/lib/security/credentials/iam Private Headers */, + 6A6867C97232463A508B7E60E37FE11E /* Copy src/core/lib/security/credentials/alts Private Headers */, + A23523568F3BB47ED3F44D5E7A3205F7 /* Copy src/core/lib/security/credentials/local Private Headers */, + 1CAB005D8067700A7C4A2636683A2D92 /* Copy src/core/lib/security/credentials/oauth2 Private Headers */, + 2F7A7860591E295337FBAC754E0B62DF /* Copy src/core/lib/security/credentials/plugin Private Headers */, + 14738F6548C57BD278A0E22A1E7AC9ED /* Copy src/core/lib/security/credentials/ssl Private Headers */, + EEA318F4E9C071273D8D655D301CFC9A /* Copy src/core/lib/security/credentials/jwt Private Headers */, + ACB1BE11D6EB8D42C59D2E4A159F9240 /* Copy src/core/lib/security/security_connector/alts Private Headers */, + F3B96E337116A76E5F0AA5A2EDFB34A4 /* Copy src/core/lib/security/security_connector/fake Private Headers */, + 78311D4A2B35E5BE43666D751C7D2D16 /* Copy src/core/lib/security/credentials/tls Private Headers */, + 78518DBBC6250CA130FB76F917FE8C73 /* Copy src/core/lib/security/security_connector/local Private Headers */, + 698A91BDDBE6AAC38F73D845DDC7A07C /* Copy src/core/lib/security/security_connector/ssl Private Headers */, + 60CC508CCF58F8EE07F1EF0D0B3BF685 /* Copy src/core/lib/security/security_connector/tls Private Headers */, + E68DF31E292DC27D13C1E7AC6D08A1A1 /* Copy src/core/lib/security/security_connector Private Headers */, + 849AFA0BED338218735CBA356ED50333 /* Copy src/core/lib/security/util Private Headers */, + 1B85EB0E862DD5229CC266C64BB62DFE /* Copy src/core/lib/security/transport Private Headers */, + 0FFE6982AE1E38EEBEB275F71D9C452B /* Copy src/core/lib/slice Private Headers */, + 50910F21DD8CF7D309F549942EE2558E /* Copy src/core/lib/surface Private Headers */, + 3587DF46ECD6B49A64B9C0BC91CC5D94 /* Copy src/core/lib/uri Private Headers */, + 1EF6E1D4F0463A20C16883878F1F2C86 /* Copy src/core/tsi/alts/crypt Private Headers */, + C118D2E74F8BB997A7A89EC19BA097B1 /* Copy src/core/lib/transport Private Headers */, + 7E23BF6CBF1DBEADDDE626432B794E7E /* Copy src/core/tsi/alts/frame_protector Private Headers */, + E1F604B011E3A8F7094B70230EDB882B /* Copy src/core/tsi/alts/handshaker Private Headers */, + 2C01783753739A9E9641851865BA9B47 /* Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + B085D4F6110FDB784E128B8BC6ED8389 /* Copy src/core/tsi/ssl/session_cache Private Headers */, + 6F116A8EBF7B72915D0CE7CF6C7AEDD6 /* Copy src/core/tsi Private Headers */, + DDCAF1E900DFEAE45EE35B2BB06003B6 /* Copy src/cpp/client Private Headers */, + 1E993CF8D38A6D4EA6067D296D5CA9CA /* Copy src/cpp/common Private Headers */, + 0CC056E45510334C684D11291BA72CA8 /* Copy src/cpp/server/health Private Headers */, + 704F91E7C67AAE69E6A6EF338BEF1004 /* Copy src/cpp/thread_manager Private Headers */, + 523405D7EC2D5892ABBFDCB2DEC39FE4 /* Copy src/cpp/server Private Headers */, + B3B00B0283A58FE804F80B299D023E65 /* Copy third_party/upb/upb Private Headers */, + 9D64906FB759560F7C47B722A3EE224E /* Copy ext Public Headers */, + 81C1CEE4A6FCD4728418F91E741F0824 /* Copy generic Public Headers */, + ECA78CD8E679781C1C1F74DEAF3E8CF8 /* Copy impl/codegen/security Public Headers */, + 2D60F13695E8A1E4333783FA28442947 /* Copy impl/codegen Public Headers */, + 5EE75D722C31D167D98AAB68E3F84F47 /* Copy impl Public Headers */, + A83824105503014CFFB1D835911E9D72 /* Copy security Public Headers */, + FC80983F16094BC7BB334C06C2D45B13 /* Copy . Public Headers */, + B05DA8BC5954BFCBEF5DA52AAEC652BD /* Copy support Public Headers */, + C21184981121DC3016292F0392DC1BE0 /* Sources */, + 01AE753564010498981790C3351A6A06 /* Frameworks */, + 1E3B3C88A1CEE77688CCE260D5090F3D /* Resources */, + D687DC926A2B8B9C280A134A8AA0A0BC /* Create Symlinks to Header Folders */, + ); + buildRules = ( + ); + dependencies = ( + 54D3A4D29872369EC7B05E500D375C2D /* PBXTargetDependency */, + D17BC85203192F5137EFE1A3F1A17F4D /* PBXTargetDependency */, + 1CF5D6A26C6B6D7FF9EB00B9C59BDB5A /* PBXTargetDependency */, + ); + name = "gRPC-C++"; + productName = grpcpp; + productReference = 1911113E0FBF13CFF9132E5FF7685228 /* gRPC-C++ */; + productType = "com.apple.product-type.framework"; + }; + 2BBF7206D7FAC92C82A042A99C4A98F8 /* PromisesObjC */ = { + isa = PBXNativeTarget; + buildConfigurationList = EA69D44C8DC4056CBA2FD7F241B939CD /* Build configuration list for PBXNativeTarget "PromisesObjC" */; + buildPhases = ( + A97B495B350EE15B5D583CF96E897E81 /* Headers */, + D1C27A9375289AA6F403925A9DDDBBDE /* Copy . Private Headers */, + 800364888314F5A4C402C658494C39C9 /* Copy . Public Headers */, + E0957F2F98618EB1861C22BC543C62A1 /* Sources */, + 7A56ADBEE360BFEA414A965872D89778 /* Frameworks */, + 78FE6D58A9EFD976F036100AAD9E9A7A /* Resources */, + 2F4C9696A5A2F9E18FEE62BB8E3348B8 /* Create Symlinks to Header Folders */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PromisesObjC; + productName = FBLPromises; + productReference = 3347A1AB6546F0A3977529B8F199DC41 /* PromisesObjC */; + productType = "com.apple.product-type.framework"; + }; + 3B8CAC3956E59F928387D0C6310E3B37 /* gRPC-C++-gRPCCertificates-Cpp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B918C5EC31216F43A6B64C1DB751CAD /* Build configuration list for PBXNativeTarget "gRPC-C++-gRPCCertificates-Cpp" */; + buildPhases = ( + 336880C3C4F7CDC2A945E572DDDC46E8 /* Sources */, + 0ED21B27BF4F6B0FB6F03904DC8EF29C /* Frameworks */, + 952A07B343E2B8145EC139F1E181F0C1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "gRPC-C++-gRPCCertificates-Cpp"; + productName = "gRPCCertificates-Cpp"; + productReference = 9C7C87B5D0A6752AFA2642F1BCA967A3 /* gRPC-C++-gRPCCertificates-Cpp */; + productType = "com.apple.product-type.bundle"; + }; + 4402AFF83DBDC4DD07E198685FDC2DF2 /* FirebaseCore */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8C9740BA76AF3B8C9751F600628218F9 /* Build configuration list for PBXNativeTarget "FirebaseCore" */; + buildPhases = ( + 6FB4E531B60262379F4AD92F3AB3ED9C /* Headers */, + 81E4D23AD4CB44F20D0C125FBF943DF7 /* Sources */, + AFDE8C4BEC7ED55E8CAE17DD48B8C641 /* Frameworks */, + E307C0EAF7603DF4A7CE324D8C8BA9A4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + E23CE57654F779069C84588B7807C531 /* PBXTargetDependency */, + 6F7F4206D98C7E13DDD1E45C371FAA1E /* PBXTargetDependency */, + ); + name = FirebaseCore; + productName = FirebaseCore; + productReference = E2B63D462DB7F827C4B11FD51E4F8E2D /* FirebaseCore */; + productType = "com.apple.product-type.framework"; + }; + 445FD4CB16BB7BEE2D1C404951CDE14A /* BoringSSL-GRPC */ = { + isa = PBXNativeTarget; + buildConfigurationList = E6B2D3186238DEDE13E81B334302AE32 /* Build configuration list for PBXNativeTarget "BoringSSL-GRPC" */; + buildPhases = ( + 3B393003226E7B56C1A6723609654893 /* Copy ssl Private Headers */, + 30923C69651043C3A16135421C8B5796 /* Copy ssl/test/runner/curve25519 Private Headers */, + 2F056E2555A9F94747FFACEA9ADE752D /* Headers */, + BD190A56ECB65938577FA6A7713B3F3E /* Copy crypto/asn1 Private Headers */, + F7B259E0FF8B8A345643C4BEF301D618 /* Copy crypto/bio Private Headers */, + FB0C2F81712102066F23B2C8AD81460F /* Copy crypto/bytestring Private Headers */, + 2EF9854F310F875F506142DCADF16901 /* Copy crypto/chacha Private Headers */, + AA74CDFCAF84A7EF5F6AEC3658E75828 /* Copy crypto/cipher_extra Private Headers */, + 14FBCB9B7BA78BEFE2338FFFE9270F96 /* Copy crypto Private Headers */, + 8FBB3A35420C86E5840FC30A9508C12B /* Copy crypto/err Private Headers */, + 06BAD96E6F10305F17350595F1F2FB62 /* Copy crypto/evp Private Headers */, + 4797331282621435D810E17B5520FD7D /* Copy crypto/fipsmodule/aes Private Headers */, + 679E69E629C3C468A11CF83BE98F9F69 /* Copy crypto/conf Private Headers */, + A93887798FD5B7C06D75199D5581C86D /* Copy crypto/fipsmodule/cipher Private Headers */, + 93AC54E62E433AF08035608DD34AD35D /* Copy crypto/fipsmodule Private Headers */, + 2407DAE4654435BE4ECBDDB58ADED291 /* Copy crypto/fipsmodule/des Private Headers */, + AE7909B62E286A794C84A562AA22F3DE /* Copy crypto/fipsmodule/bn Private Headers */, + E0BDA19F22B60E4B7399614198EE8934 /* Copy crypto/fipsmodule/digest Private Headers */, + 4617E61F0D13A3DD1CE84F1917AAAAC4 /* Copy crypto/fipsmodule/md5 Private Headers */, + E66539B2330FD3910D9AB77DC4D16AF9 /* Copy crypto/fipsmodule/modes Private Headers */, + 16E0D4E4DCBB371B9225532AA661FBAD /* Copy crypto/fipsmodule/rand Private Headers */, + 06DE7570D1336D11E7AE4D3E98C2AD40 /* Copy crypto/fipsmodule/rsa Private Headers */, + 7D8781A49501552D42299095D9FBC0E5 /* Copy crypto/fipsmodule/sha Private Headers */, + E6CCED92B9F5A899EA523E14CEBCC7A2 /* Copy crypto/fipsmodule/tls Private Headers */, + DAB320AC649AFDC577C4F23ABA4F2BE3 /* Copy crypto/hrss Private Headers */, + 0AF2D7CD5C18760CEC5C667BB14169EE /* Copy crypto/obj Private Headers */, + B360FF1AB08A164815EDADABDDCD61A0 /* Copy crypto/pkcs7 Private Headers */, + 6AB68FB0CCB1E628FF54065EE6BEB024 /* Copy crypto/pkcs8 Private Headers */, + 5B699A2A4C2D1C2669D8E6931523C83B /* Copy crypto/poly1305 Private Headers */, + 70800FBCA1CCB6842237AFF335FA6EAF /* Copy crypto/pool Private Headers */, + AEECCB4BB03834C58FEB56E5DEEAEB36 /* Copy crypto/fipsmodule/ec Private Headers */, + 5B14D3AAB1C1B87B5B552B87575499CC /* Copy crypto/x509 Private Headers */, + 660E505B0732A74674C0EBA797428A8A /* Copy crypto/x509v3 Private Headers */, + 88986958C58FC9C7D23544B4CDF1593A /* Copy third_party/fiat Private Headers */, + 995512DCC3B34220916827E5E559B7AD /* Copy . Public Headers */, + F2B7E3A598111762F7E6BD16669D2373 /* Sources */, + A6D7B251DE0A6AD1EF20EBB8ADCE08B0 /* Frameworks */, + FB8C31E491001D32253CFB4CBCF9492E /* Resources */, + B344B870153BABCE2AEE4C77472CCF37 /* Create Symlinks to Header Folders */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "BoringSSL-GRPC"; + productName = openssl_grpc; + productReference = 514D7742C6CBB0BDBD9984AEE97DDFDE /* BoringSSL-GRPC */; + productType = "com.apple.product-type.framework"; + }; + 50F380A87A4FC4EC7EE3AC9BDADB6D2D /* gRPC-Core */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84E9E2B55065E4567479B8E93895E505 /* Build configuration list for PBXNativeTarget "gRPC-Core" */; + buildPhases = ( + 8A670A330E640E5D0FEE4D249CD8ACFB /* Headers */, + F6A3F276E99378ED30466007B09CC669 /* Copy src/core/ext/filters/client_channel/health Private Headers */, + 20C39E3DA1D5C30DBFE938B8E06F115C /* Copy src/core/ext/filters/client_channel/lb_policy/grpclb Private Headers */, + 6D51D467DC56080606BBBB4134E2FC70 /* Copy src/core/ext/filters/client_channel/lb_policy/xds Private Headers */, + 8C4350E9F3DA5E766F3B6C6BBA7AF2F8 /* Copy src/core/ext/filters/client_channel/lb_policy Private Headers */, + 49A13FCAEFDEB814B12F5EB58BAD3D3B /* Copy src/core/ext/filters/client_channel/resolver/dns Private Headers */, + 9555572D7E370C680F05C08324A00734 /* Copy src/core/ext/filters/client_channel/resolver/fake Private Headers */, + 7994E5843320954C4FED0266F77B334D /* Copy src/core/ext/filters/client_channel/resolver/dns/c_ares Private Headers */, + 9CD4E5BC7CA8E880B58A292833EDCC6A /* Copy src/core/ext/filters/client_channel Private Headers */, + 357CEE98E09CF79E36971A296B062FA2 /* Copy src/core/ext/filters/deadline Private Headers */, + 7DF8F015727BB18C9A9763B04D477497 /* Copy src/core/ext/filters/http/client Private Headers */, + 30BE2727A1F9C99CC4D19A14B5B72BF2 /* Copy src/core/ext/filters/http Private Headers */, + A35981792D21A3C10D45489759EE644C /* Copy src/core/ext/filters/http/message_compress Private Headers */, + B6A9A630E116BE43481D0EA2D1475171 /* Copy src/core/ext/filters/http/server Private Headers */, + CAA9D45163E13022A96D7547FBC9EBDD /* Copy src/core/ext/filters/max_age Private Headers */, + E4A722B7970F59ED36588914C4DE862D /* Copy src/core/ext/filters/message_size Private Headers */, + E7422041404CDDC2483126F883E3D4B6 /* Copy src/core/ext/filters/client_channel/xds Private Headers */, + 590C68C6BF6FFD85D753E3B2B61A86A1 /* Copy src/core/ext/transport/chttp2/alpn Private Headers */, + 256DFFDBCE51373A97DB4282AB07A4F0 /* Copy src/core/ext/filters/workarounds Private Headers */, + A76F8FF0AA8306F18A8CD19FE306B9E7 /* Copy src/core/ext/transport/chttp2/server Private Headers */, + 7AD1E865C4928382BED6ED0CFAF9BBDB /* Copy src/core/ext/transport/chttp2/client Private Headers */, + E94733BBD4B7CEEAE38CA86A25524FA5 /* Copy src/core/ext/transport/inproc Private Headers */, + 5A41CDE111FC3C81856E2A17447B76ED /* Copy src/core/ext/transport/chttp2/transport Private Headers */, + 382D7E38E31849D334E19E296B262782 /* Copy src/core/ext/upb-generated/envoy/api/v2/auth Private Headers */, + FA8ADDE242B49E3D0D89CDACD69BE875 /* Copy src/core/ext/upb-generated/envoy/annotations Private Headers */, + 4EFA727BF37CE041F18CECEFADD00D98 /* Copy src/core/ext/upb-generated/envoy/api/v2/cluster Private Headers */, + 78F832533271C215601FF6DFA473E484 /* Copy src/core/ext/upb-generated/envoy/api/v2/core Private Headers */, + 871AEB8505108549EC0428F93BC21561 /* Copy src/core/ext/upb-generated/envoy/api/v2/endpoint Private Headers */, + 173BE26F1D7D100FF111BD309E6A23E0 /* Copy src/core/ext/upb-generated/envoy/api/v2/listener Private Headers */, + 981D540BC71F90E9E1DD20A752ECDE4E /* Copy src/core/ext/upb-generated/envoy/api/v2/route Private Headers */, + 9E49037FCE47A18665EF463503871813 /* Copy src/core/ext/upb-generated/envoy/config/filter/accesslog/v2 Private Headers */, + 8EC19C25B20FFE93DE717FDAB43CBEAB /* Copy src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2 Private Headers */, + A6DD5D81C08E7CB9B01C95E74C3A1C54 /* Copy src/core/ext/upb-generated/envoy/config/listener/v2 Private Headers */, + F0EE9E9D20E30120116CD042F75AE7B5 /* Copy src/core/ext/upb-generated/envoy/service/discovery/v2 Private Headers */, + DB7B76C2A6ABCDC6C0144110F60468B3 /* Copy src/core/ext/upb-generated/envoy/service/load_stats/v2 Private Headers */, + 7DC5F677F6A955466461EF26342DC640 /* Copy src/core/ext/upb-generated/envoy/api/v2 Private Headers */, + A8CCC64C3358B42240F65F63A480F6F9 /* Copy src/core/ext/upb-generated/envoy/type/metadata/v2 Private Headers */, + F258F0D3D4DB2122D2957C10C8FDB2EC /* Copy src/core/ext/upb-generated/envoy/type/matcher Private Headers */, + F44F7BFE835888A426986C37F01A2AD3 /* Copy src/core/ext/upb-generated/envoy/type/tracing/v2 Private Headers */, + 69F24EDFDA2732CB19CB9A57CF51783C /* Copy src/core/ext/upb-generated/gogoproto Private Headers */, + 0495AF171240225543EFA2AD4E18B253 /* Copy src/core/ext/upb-generated/envoy/type Private Headers */, + E92342C1015D85A880AC9B77A2BA3959 /* Copy src/core/ext/upb-generated/google/api Private Headers */, + B8FF0B842C05D6E82DD91CB5AFEDA594 /* Copy src/core/ext/upb-generated/google/rpc Private Headers */, + D0891CCDF75A33BC8A6B52756947DC5C /* Copy src/core/ext/upb-generated/google/protobuf Private Headers */, + 3B630F972930201DE7CFE3039E2DC7E4 /* Copy src/core/ext/upb-generated/src/proto/grpc/health/v1 Private Headers */, + 4A4690FE0B7B65955D710ECEDB459AFB /* Copy src/core/ext/upb-generated/src/proto/grpc/lb/v1 Private Headers */, + F8D70E55EFBD5DE9A51FDDE8E7CEA57C /* Copy src/core/ext/upb-generated/src/proto/grpc/gcp Private Headers */, + E65DC70939D1931C0B56A839800E6DB0 /* Copy src/core/ext/upb-generated/udpa/data/orca/v1 Private Headers */, + 7783B6E28D541059DAAD2AA8A58148DE /* Copy src/core/ext/upb-generated/validate Private Headers */, + 08911BB7F4C403767C5C2457BC30D739 /* Copy src/core/lib/avl Private Headers */, + 80F570444281FF017873AA6C77D6B535 /* Copy src/core/lib/backoff Private Headers */, + 899F2C0BF3808B2220BF3F119B004B6B /* Copy src/core/ext/upb-generated/udpa/annotations Private Headers */, + 72A3F5904786721D0DCEAFFEEDDC3631 /* Copy src/core/lib/channel Private Headers */, + 85A3794DCE891ECBB12A056B137A3A88 /* Copy src/core/lib/compression Private Headers */, + 32D312A30A9288D00D97A178A0D61A2A /* Copy src/core/lib/debug Private Headers */, + D80184CC6E309B75A7EB5705E167B6C0 /* Copy src/core/lib/gpr Private Headers */, + 14B07B232FDE37647F85396A231FD43D /* Copy src/core/lib/gprpp Private Headers */, + CEA908C6D84422DC169DCA972F84719B /* Copy src/core/lib/http Private Headers */, + B81F122B8D660C9B65511CC732CDAE89 /* Copy src/core/lib/iomgr/executor Private Headers */, + 872E2B981FD2BE171E472C51D93CE732 /* Copy src/core/lib/iomgr/poller Private Headers */, + 3327A827C0828F86763913165B862C60 /* Copy src/core/lib/json Private Headers */, + A7F858C468C1B6F280DE2185A9077145 /* Copy src/core/lib/profiling Private Headers */, + 5D33039548481DB1B9F40BE786F112D2 /* Copy src/core/lib/security/context Private Headers */, + 8617B776AB9B1B509A192D9A6E32AB04 /* Copy src/core/lib/iomgr Private Headers */, + D3CA18E0CF74079BD1470151141CAE2C /* Copy src/core/lib/security/credentials/composite Private Headers */, + BE0EF359E9C6EB2556A2216E693199EE /* Copy src/core/lib/security/credentials Private Headers */, + 44C747C86BC33F517D40FC2F9EA64B4C /* Copy src/core/lib/security/credentials/fake Private Headers */, + 2B77C53D8C25063B978E1447A14E5398 /* Copy src/core/lib/security/credentials/google_default Private Headers */, + 6D9DA91E14731F1E53E75C52C6E36FB1 /* Copy src/core/lib/security/credentials/iam Private Headers */, + A3B6CB5A16F54FE44724ECC86A4B2262 /* Copy src/core/lib/security/credentials/alts Private Headers */, + 02FFFFB896934F8F0255B11226BD59CA /* Copy src/core/lib/security/credentials/local Private Headers */, + 0F16536D913219B33C527082F183335F /* Copy src/core/lib/security/credentials/oauth2 Private Headers */, + 27378EE235508A527E7B656930AF87C2 /* Copy src/core/lib/security/credentials/plugin Private Headers */, + E300AAABA212649BA19481D40CB28587 /* Copy src/core/lib/security/credentials/ssl Private Headers */, + D87A702EAE7A97A1B383B30837F3EA9B /* Copy src/core/lib/security/credentials/jwt Private Headers */, + 399598D0C8C4946417FA58409B8F65B1 /* Copy src/core/lib/security/security_connector/alts Private Headers */, + 65E974274A77A1327315E1F39CF5AD6B /* Copy src/core/lib/security/security_connector/fake Private Headers */, + 0B32D14A3F8137A20A373AD54E585D8A /* Copy src/core/lib/security/credentials/tls Private Headers */, + F23B79B347084D66BCF21031FA19CCE5 /* Copy src/core/lib/security/security_connector/local Private Headers */, + ED9450B69FBC7DF7625BA2E6D6ABA6A0 /* Copy src/core/lib/security/security_connector/ssl Private Headers */, + 3C61A74A77F085DA08FAE44FD04E42D5 /* Copy src/core/lib/security/security_connector/tls Private Headers */, + 6706335C2743070D66841EC3086644FC /* Copy src/core/lib/security/security_connector Private Headers */, + 304731C4C3DABE421A5F8A00D9881A2C /* Copy src/core/lib/security/util Private Headers */, + 2EBEFF9032525F1C3BC304CA480C05CE /* Copy src/core/lib/security/transport Private Headers */, + 1415B310237413B9A2B27F12CBC5C058 /* Copy src/core/lib/slice Private Headers */, + 5BBB2C9BC9B8BFC8A7ECA18C555DA88E /* Copy src/core/lib/surface Private Headers */, + 54D71A82E2AB941DCDE437B6C2AD460A /* Copy src/core/lib/uri Private Headers */, + CA08E846C208164F71006F147BC72F11 /* Copy src/core/tsi/alts/crypt Private Headers */, + 904B9FB4353AA5984C03AE6CED11FD90 /* Copy src/core/lib/transport Private Headers */, + 01A4500BA6CD8A97AFCFC7D8CADDF696 /* Copy src/core/tsi/alts/frame_protector Private Headers */, + 7451B22C9C044108E81FDD4C3B13624E /* Copy src/core/tsi/alts/handshaker Private Headers */, + 7C80FB4397330AAE052CCE98F7AF6214 /* Copy src/core/tsi/alts/zero_copy_frame_protector Private Headers */, + E366E9E2193C9A68B46F8B778ED6D371 /* Copy src/core/tsi/ssl/session_cache Private Headers */, + 783CC13BEB0443AC64B2548C92AFAFAF /* Copy src/core/tsi Private Headers */, + 4C9915B49854742CFE34B96635B5EA5D /* Copy third_party/upb/upb Private Headers */, + 3F5EE70ED0169EFDEAD1AA684C44EB41 /* Copy impl/codegen Public Headers */, + 49CF00E147A76577850B1700E28356EB /* Copy . Public Headers */, + AAFFEEB0904A50E6D4778E71E9A33A5E /* Copy support Public Headers */, + F974C1F644918E246E31B6FE249AA8A6 /* Sources */, + 6870C205861FD1E4C5B934EEA813B4B8 /* Frameworks */, + 3AA64AE21B2875D95B594B9EE83096FD /* Resources */, + 896C61343716B0BCB9D2EFA97998EF97 /* Create Symlinks to Header Folders */, + ); + buildRules = ( + ); + dependencies = ( + BCC434A6D1A9EB6F65DD20EB311E1436 /* PBXTargetDependency */, + 4C376FF9C75E9ECD715435D9FB38B274 /* PBXTargetDependency */, + ); + name = "gRPC-Core"; + productName = grpc; + productReference = B471867C535B02FA55D87E260F6480F8 /* gRPC-Core */; + productType = "com.apple.product-type.framework"; + }; + 5C0371EE948D0357B8EE0E34ABB44BF0 /* GoogleDataTransport */ = { + isa = PBXNativeTarget; + buildConfigurationList = 56554ABBABE81D2AC13B694DE35721D3 /* Build configuration list for PBXNativeTarget "GoogleDataTransport" */; + buildPhases = ( + AE2EFA3B09B8971C562E3F9700989DB3 /* Headers */, + D6A16C2943A3CB1D4CD742AC2F72D68B /* Sources */, + 3D3E357E2036A8449036AB72569A43DD /* Frameworks */, + 0D4B2EA4B756B556E29CD7D33BC1D7DA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 444895DB2E81857B8E894B22AB1FCE3F /* PBXTargetDependency */, + D300A2B4EC450FF3D2231DBDD212AD4A /* PBXTargetDependency */, + 72AA7F4B0BEECFCE426B6F427C0F2DBF /* PBXTargetDependency */, + ); + name = GoogleDataTransport; + productName = GoogleDataTransport; + productReference = 856B5CD56F194FAD26EA91620B66D614 /* GoogleDataTransport */; + productType = "com.apple.product-type.framework"; + }; + 620E05868772C10B4920DC7E324F2C87 /* FirebaseCoreDiagnostics */ = { + isa = PBXNativeTarget; + buildConfigurationList = C5F8E10645F265DE2D10691BFC9A6E16 /* Build configuration list for PBXNativeTarget "FirebaseCoreDiagnostics" */; + buildPhases = ( + 90C37D6AD6280B7EBF0CBAC27FAE9C45 /* Headers */, + 45527F750C05B39F3CFD92CFAC930F7D /* Sources */, + 91006711998B9A7B6EA7587740330AED /* Frameworks */, + 8E0C4A8E69543752089DB2F53DB51442 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CAA4668DB294DFFBE51D6E88A8BCC6F2 /* PBXTargetDependency */, + E200126568B1970AC5423AC75C8B3AC1 /* PBXTargetDependency */, + DACED389B3B165154951685BC573B7EB /* PBXTargetDependency */, + ); + name = FirebaseCoreDiagnostics; + productName = FirebaseCoreDiagnostics; + productReference = 8CC9178C366942FD6FF6A115604EAD58 /* FirebaseCoreDiagnostics */; + productType = "com.apple.product-type.framework"; + }; + 73CDC3D182DB953135F62609681B443D /* abseil */ = { + isa = PBXNativeTarget; + buildConfigurationList = F09FBDA6DC3D29DACC253BA8C7F4E04C /* Build configuration list for PBXNativeTarget "abseil" */; + buildPhases = ( + F81D064E8FCDC77296EFC77EA472FE3C /* Headers */, + 600FD8BBEABCD7765EA669E6B4C3A0A9 /* Copy algorithm Public Headers */, + F7D094268EB85AC2467B9BE5767FA226 /* Copy base Public Headers */, + FCC6ABC40C520A10D19B8D25B7DDFFFA /* Copy base/internal Public Headers */, + 784FBE885B6BA27B49FF78CA23A0E708 /* Copy container Public Headers */, + 0586241DAF3B15541F0B16D40BE06876 /* Copy container/internal Public Headers */, + 56B02A0DE21F61733545C69F6829E23C /* Copy debugging/internal Public Headers */, + 7D01712FA09D41B950DC3C167AAA8ADE /* Copy hash Public Headers */, + 780D853AEDCCDC4BBCA3B9D1E3C330AB /* Copy debugging Public Headers */, + BF886068D51F2C45440D2016DDCEC513 /* Copy memory Public Headers */, + 3D473148AE226A221F5BD14723C04F38 /* Copy meta Public Headers */, + C7685AB53DA9EEC4661A1777D62D48E8 /* Copy hash/internal Public Headers */, + 24F03958CAC3C33C3B0F1BC2AF13C6AA /* Copy numeric Public Headers */, + 96C1328F4C9660B8BCDC79AEFFA6EAC3 /* Copy strings/internal/str_format Public Headers */, + C0CA96F629E5D41EAC3CC9D397E109C5 /* Copy strings/internal Public Headers */, + 4B11B901F0AFBF09005EF041019CB663 /* Copy strings Public Headers */, + 4CA3B56863BCFF37FF8CB5A2F657962F /* Copy synchronization/internal Public Headers */, + 6A623559A6B4A8302BB3A9B8455BD10F /* Copy synchronization Public Headers */, + 4CEE960D2D12BB257A35F0C1F4E58D87 /* Copy time/internal/cctz/include/cctz Public Headers */, + 1A8BC042A62A1AD5108D923BC8DF608D /* Copy time/internal/cctz/src Public Headers */, + FA9DAF009DD4699512AB4BABC6070AC0 /* Copy time/internal Public Headers */, + 3836C9FC21CD04FB737DF7106035B41E /* Copy time Public Headers */, + 918FC73CDD2C9B34499DA6C1ED64E12F /* Copy types/internal Public Headers */, + 4C543F13ED4145AC213920A02078EC15 /* Copy utility Public Headers */, + 310A1B0731F0DD35941A85E604E1622C /* Copy types Public Headers */, + FCD3E76807736F00134DEE6D6C3791AD /* Sources */, + AF3A588514854A49A113F296B333A1C1 /* Frameworks */, + 08942B17FE05BA2A3339663E4746BF3B /* Resources */, + F304C8EFF874A1F15DC5A33A479F30D2 /* Create Symlinks to Header Folders */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = abseil; + productName = absl; + productReference = BF96B57ADE05E8909F823BDF6868B3E3 /* abseil */; + productType = "com.apple.product-type.framework"; + }; + 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BE720CF8575FB8ABCE3277D74FF48A3 /* Build configuration list for PBXNativeTarget "GoogleUtilities" */; + buildPhases = ( + 30167C53BC7F64196FB18EE03027C3D5 /* Headers */, + 31D0B503C21336EC1A938ACB92D2CC83 /* Sources */, + 12A76319F69F1F49A599DF29CAE7DBE5 /* Frameworks */, + 17504E09DF85B634B66AFCAF57514761 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 33C41DBA28BE1C70E2B021A11E80E4FE /* PBXTargetDependency */, + ); + name = GoogleUtilities; + productName = GoogleUtilities; + productReference = B43874C6CBB50E7134FBEC24BABFE14F /* GoogleUtilities */; + productType = "com.apple.product-type.framework"; + }; + 9307B7A119490930CF70393AB529AAC1 /* leveldb-library */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0DD487BFDC576ABA80D43449B9CF0685 /* Build configuration list for PBXNativeTarget "leveldb-library" */; + buildPhases = ( + 55E58BA293CF40706B36A964C72965A9 /* Headers */, + 6EB96C71FA6BAFBE8151B4A1CD39BC28 /* Sources */, + DE94FE6511046F0F52631FC3B7B66C43 /* Frameworks */, + A054F4CD9F784C49AB86D891D5B6AE50 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "leveldb-library"; + productName = leveldb; + productReference = 0A9F46A999C47653013D3AD854352507 /* leveldb-library */; + productType = "com.apple.product-type.framework"; + }; + D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */ = { + isa = PBXNativeTarget; + buildConfigurationList = 51CA6E3B99F02D04242A492F54A06288 /* Build configuration list for PBXNativeTarget "nanopb" */; + buildPhases = ( + 804B879B610A5D7F6A457BEC49B49EA6 /* Headers */, + 741579231A6965F074EAC2F205F37BDB /* Sources */, + 619A559E3A3AE927BD1F4BF7D7471681 /* Frameworks */, + 2622559FCA4E8388683418A4E4E19C98 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = nanopb; + productName = nanopb; + productReference = 06FC5C9CF96D60C50FCD47D339C91951 /* nanopb */; + productType = "com.apple.product-type.framework"; + }; + DBA2B63E3A5FE83FE89E731664C9269F /* FirebaseFirestore */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6A38BB905EA0C97D0E5999B20E06B0B3 /* Build configuration list for PBXNativeTarget "FirebaseFirestore" */; + buildPhases = ( + 295A28C348330B2091914CAD83D659A0 /* Headers */, + EFB7A721756FC626CA9BD1E888AF211D /* Sources */, + 7DBD352BCEA6C534DDC074853F25148E /* Frameworks */, + 720DDED7A30AC79804537C64CCDC11FD /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 4449D80DC226276DA271457933D4E31C /* PBXTargetDependency */, + 7BE7C7BF611BF38A7105D933C0304992 /* PBXTargetDependency */, + CE838D5E8D0C2C8735CC511006397AD9 /* PBXTargetDependency */, + 37EDC9A6283E9E7ACE3C9E943BD52023 /* PBXTargetDependency */, + 4A82F20C8154A8C11A6C1AFD9699A0AB /* PBXTargetDependency */, + ); + name = FirebaseFirestore; + productName = FirebaseFirestore; + productReference = 92000153CD73F7FC2DBAB4AB708269F3 /* FirebaseFirestore */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; + }; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + Base, + en, + ); + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = 439755DE3642ECFF605B146E62AF99ED /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 73CDC3D182DB953135F62609681B443D /* abseil */, + 445FD4CB16BB7BEE2D1C404951CDE14A /* BoringSSL-GRPC */, + 072CEA044D2EF26F03496D5996BBF59F /* Firebase */, + 4402AFF83DBDC4DD07E198685FDC2DF2 /* FirebaseCore */, + 620E05868772C10B4920DC7E324F2C87 /* FirebaseCoreDiagnostics */, + DBA2B63E3A5FE83FE89E731664C9269F /* FirebaseFirestore */, + 5C0371EE948D0357B8EE0E34ABB44BF0 /* GoogleDataTransport */, + 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */, + 1C5E43B0A9555E7C2E43A6D7C8A23CF6 /* gRPC-C++ */, + 3B8CAC3956E59F928387D0C6310E3B37 /* gRPC-C++-gRPCCertificates-Cpp */, + 50F380A87A4FC4EC7EE3AC9BDADB6D2D /* gRPC-Core */, + 9307B7A119490930CF70393AB529AAC1 /* leveldb-library */, + D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */, + 1400EFE1EBD21D4AEECF32F71ED7416E /* Pods-SaraAttended */, + 2BBF7206D7FAC92C82A042A99C4A98F8 /* PromisesObjC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 08942B17FE05BA2A3339663E4746BF3B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0D4B2EA4B756B556E29CD7D33BC1D7DA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17504E09DF85B634B66AFCAF57514761 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1E3B3C88A1CEE77688CCE260D5090F3D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A509864E4B7D9F866F0C91C38DE99359 /* gRPC-C++-gRPCCertificates-Cpp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2622559FCA4E8388683418A4E4E19C98 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3AA64AE21B2875D95B594B9EE83096FD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 720DDED7A30AC79804537C64CCDC11FD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 77DD85BA5A8A9ADD13C743177AF58E44 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 78FE6D58A9EFD976F036100AAD9E9A7A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8E0C4A8E69543752089DB2F53DB51442 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 952A07B343E2B8145EC139F1E181F0C1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 645E53D92FEA5B9C34D37424A08C0700 /* roots.pem in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A054F4CD9F784C49AB86D891D5B6AE50 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E307C0EAF7603DF4A7CE324D8C8BA9A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB8C31E491001D32253CFB4CBCF9492E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 2F4C9696A5A2F9E18FEE62BB8E3348B8 /* Create Symlinks to Header Folders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create Symlinks to Header Folders"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\" || exit 1\nif [ ! -d Versions ]; then\n # Not a versioned framework, so no need to do anything\n exit 0\nfi\n\npublic_path=\"${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$public_path\" ]; then\n ln -fs \"${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$public_path\"\nfi\n\nprivate_path=\"${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$private_path\" ]; then\n ln -fs \"${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$private_path\"\nfi\n"; + }; + 896C61343716B0BCB9D2EFA97998EF97 /* Create Symlinks to Header Folders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create Symlinks to Header Folders"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\" || exit 1\nif [ ! -d Versions ]; then\n # Not a versioned framework, so no need to do anything\n exit 0\nfi\n\npublic_path=\"${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$public_path\" ]; then\n ln -fs \"${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$public_path\"\nfi\n\nprivate_path=\"${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$private_path\" ]; then\n ln -fs \"${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$private_path\"\nfi\n"; + }; + B344B870153BABCE2AEE4C77472CCF37 /* Create Symlinks to Header Folders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create Symlinks to Header Folders"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\" || exit 1\nif [ ! -d Versions ]; then\n # Not a versioned framework, so no need to do anything\n exit 0\nfi\n\npublic_path=\"${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$public_path\" ]; then\n ln -fs \"${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$public_path\"\nfi\n\nprivate_path=\"${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$private_path\" ]; then\n ln -fs \"${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$private_path\"\nfi\n"; + }; + D687DC926A2B8B9C280A134A8AA0A0BC /* Create Symlinks to Header Folders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create Symlinks to Header Folders"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\" || exit 1\nif [ ! -d Versions ]; then\n # Not a versioned framework, so no need to do anything\n exit 0\nfi\n\npublic_path=\"${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$public_path\" ]; then\n ln -fs \"${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$public_path\"\nfi\n\nprivate_path=\"${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$private_path\" ]; then\n ln -fs \"${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$private_path\"\nfi\n"; + }; + F304C8EFF874A1F15DC5A33A479F30D2 /* Create Symlinks to Header Folders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create Symlinks to Header Folders"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\" || exit 1\nif [ ! -d Versions ]; then\n # Not a versioned framework, so no need to do anything\n exit 0\nfi\n\npublic_path=\"${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$public_path\" ]; then\n ln -fs \"${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$public_path\"\nfi\n\nprivate_path=\"${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}\"\nif [ ! -f \"$private_path\" ]; then\n ln -fs \"${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}\" \"$private_path\"\nfi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 231B65C2BF12939BAF504CD9E4A6CA1F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E00354D9ED82D4C53DE5C9F24846369A /* Pods-SaraAttended-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 31D0B503C21336EC1A938ACB92D2CC83 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 679BA648E2D8E69E9A83BE7F58402906 /* GoogleUtilities-dummy.m in Sources */, + 84D0BD8353A8BD1D22B0691153F31E9E /* GULAppEnvironmentUtil.m in Sources */, + 6506C9B9797C21E369C319A755A1F380 /* GULHeartbeatDateStorage.m in Sources */, + 40DBD9C8C075896202278464C452FFFF /* GULHeartbeatDateStorageUserDefaults.m in Sources */, + 91E9EBA236870C1577783597FD766991 /* GULKeychainStorage.m in Sources */, + 9021F50195173A11B8A64374A557BFBC /* GULKeychainUtils.m in Sources */, + 4B9F7C7491CE07E02755F5DC727FCDBD /* GULLogger.m in Sources */, + 3344BAE6406C52D5C9E46CE7A82763B4 /* GULSecureCoding.m in Sources */, + 656F29440F94332BE6EC42143F35FB2A /* GULURLSessionDataResponse.m in Sources */, + BDF2B8EBD2EDED18D4C775310365BC9C /* NSURLSession+GULPromises.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 336880C3C4F7CDC2A945E572DDDC46E8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 45527F750C05B39F3CFD92CFAC930F7D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB176316F3F6111EFDD7167A81E12072 /* FIRCoreDiagnostics.m in Sources */, + 7DD4A5C8A169B6F218A534556FBED036 /* firebasecore.nanopb.c in Sources */, + 6345847653D341782EE4A44BE7574773 /* FirebaseCoreDiagnostics-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6EB96C71FA6BAFBE8151B4A1CD39BC28 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 915621C23F82A461EBF5B50E769F8329 /* arena.cc in Sources */, + 4D33E41BF6266A6AFD834C27B2B4BE26 /* block.cc in Sources */, + 0C9CED30416BD631451F4968C5641282 /* block_builder.cc in Sources */, + D40EE8C59F15C0DCC4A658C0D940DF89 /* bloom.cc in Sources */, + C597985908213CC77AC6531880CB54E2 /* builder.cc in Sources */, + 97A1DE9FD29EBFE85CDA7CC917D69633 /* c.cc in Sources */, + 3F00E9ACA584ECAFFD97CE4909EB5B84 /* cache.cc in Sources */, + 3F3AC294A1E4F865021B88E61E2CF4C4 /* coding.cc in Sources */, + C06035AD221AE2F30A740066E84769D5 /* comparator.cc in Sources */, + 00EF09974A9BA143E1D9EF8B8DCB61EA /* crc32c.cc in Sources */, + E907116099F6E07791D6AC325936FEEA /* db_impl.cc in Sources */, + 2FF2C3CFDBF560E923ED4C6E1D22B071 /* db_iter.cc in Sources */, + AAACE3DA6DDAB0E1040EE9952CDEF2A7 /* dbformat.cc in Sources */, + 4F767589FD8B8920F20AAAAFC5EBE1C9 /* dumpfile.cc in Sources */, + C5F8CFB46135FB66430F3E2273EE556A /* env.cc in Sources */, + 7963A5EA8C12D00BD23C04E0DE72E313 /* env_posix.cc in Sources */, + 0279343E2489D6D0F0FABC96C003458A /* filename.cc in Sources */, + AAB44C55CBC839C9B3F3FE80051C1CA8 /* filter_block.cc in Sources */, + 6E16E9A718963DBD435E74E31DB3B152 /* filter_policy.cc in Sources */, + 21C38DA2B0B57B1F35097C0B67C55240 /* format.cc in Sources */, + 38C0279E89D003C73284A6B1D4177E80 /* hash.cc in Sources */, + 87BBAF5F8AA1945A48106BA081E5C591 /* histogram.cc in Sources */, + F9240E3A6EBBE2CE495758234BBB8B7E /* iterator.cc in Sources */, + EE23CC76ACCB1028F23B269CEA357798 /* leveldb-library-dummy.m in Sources */, + 5D0F859D15F554C1E1964A1F452DEF78 /* log_reader.cc in Sources */, + 657D5960ED2671DE0F4953ED0F21A186 /* log_writer.cc in Sources */, + D2C9428CBDA28497C79A3D95DF0F6263 /* logging.cc in Sources */, + AE40AD959D9896968C0BD915D7C39CA5 /* memtable.cc in Sources */, + 6B95B9C9BEED2DA740BBE9E880633E3F /* merger.cc in Sources */, + 4E8C4C6BC152284F81CD8DE277008F67 /* options.cc in Sources */, + C4CC6790236F87A356847290C04A6B87 /* repair.cc in Sources */, + CC084F0F5BBF368B5BEBE1BE01901FE8 /* status.cc in Sources */, + CE10685B1DB2F0B2FE82D7B55AECC1D1 /* table.cc in Sources */, + 22629715E4347B4C00861E6D507C2D48 /* table_builder.cc in Sources */, + A55891CC4CD04AE9274BC76FE43F9485 /* table_cache.cc in Sources */, + D484D4DFECA196C97235AC0AD29C0DD8 /* testharness.cc in Sources */, + DDF1E9AEA33DA8206C9AB05D640EC4D7 /* two_level_iterator.cc in Sources */, + 7B13CAF766D6831CE3D4F8C1D13340EE /* version_edit.cc in Sources */, + 12CF4DBE5D55F48C84090926B99BF861 /* version_set.cc in Sources */, + EF6562FD4856AEC7CD5CC3C65939E79C /* write_batch.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 741579231A6965F074EAC2F205F37BDB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E25177713C736975B05AA4C85B137035 /* nanopb-dummy.m in Sources */, + 83B4C23DF8AD2FEB9B8517712E757801 /* pb_common.c in Sources */, + E466F972BF12650DC4B23ABC2DF55AE4 /* pb_decode.c in Sources */, + 84771602EBCF755960D6FA81BBEFE163 /* pb_encode.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 81E4D23AD4CB44F20D0C125FBF943DF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4AA7715811F3FF3CBD45CD02B89AE39E /* FIRAnalyticsConfiguration.m in Sources */, + E528D116A73A45DAA253A69D8D1B341C /* FIRApp.m in Sources */, + F4507A4B7766FACB2CEC1A18352C128B /* FIRAppAssociationRegistration.m in Sources */, + 2255ACD8E004DDF7B7FD8599B6A733D3 /* FIRBundleUtil.m in Sources */, + CD87058648AAA5ABC4B590D145CF1ACB /* FIRComponent.m in Sources */, + 35E585928714B9430EBFA7BE013CBB00 /* FIRComponentContainer.m in Sources */, + 596FBD67778D0B3D216AB60399A52274 /* FIRComponentType.m in Sources */, + 454E5FF84D7892581CC9FB30D71BE40F /* FIRConfiguration.m in Sources */, + 8FBA292DE3B8CD655E6B284B4F73011F /* FIRCoreDiagnosticsConnector.m in Sources */, + 6B610EEC287149202560A47755EBA165 /* FIRDependency.m in Sources */, + 5D37BE6F7DB414ED9E8DBF2C834A4866 /* FIRDiagnosticsData.m in Sources */, + 7EA17442274F3978CEFFB5BF5F5D4C76 /* FirebaseCore-dummy.m in Sources */, + AA1D2CD2F75F2536D990D2BBD5F5CE5E /* FIRFirebaseUserAgent.m in Sources */, + CF244DBA49597C58CF1B69B4C4DA9E54 /* FIRHeartbeatInfo.m in Sources */, + 6C5AC3175D938678FC03755174918D47 /* FIRLogger.m in Sources */, + 1B6A0081CB4856A930907889DC16F9FE /* FIROptions.m in Sources */, + 26341AAA8185E533F122A3DF5F509BCA /* FIRVersion.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C21184981121DC3016292F0392DC1BE0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6277317ADC66DA057C0B601C63A3A05F /* alarm.cc in Sources */, + 61D003D58FC25D2FAB43898A76744993 /* async_generic_service.cc in Sources */, + DBF7A85218CCAECE522DF86BF3207675 /* auth_property_iterator.cc in Sources */, + 21DF880714E351E9A3B60B1F53FB74BF /* byte_buffer_cc.cc in Sources */, + 7CD6CE41BC29F8C24A0E58F259B1583E /* channel_argument_option.cc in Sources */, + 05378D24E30602168FFC3094E265081F /* channel_arguments.cc in Sources */, + EDC3667E10A378C892D5DEA38F76266D /* channel_cc.cc in Sources */, + CAE0F5113EFA2C0137F068939F85BD0D /* channel_filter.cc in Sources */, + 227115C8B3354D40539661ABE8671767 /* client_context.cc in Sources */, + C1337E48A83BD0745561645FC26BB2DB /* client_interceptor.cc in Sources */, + 99C912E6CD09DE1DB0C0F574C075F7D8 /* codegen_init.cc in Sources */, + 10291ECC417AA1CC8406A9A124887A73 /* completion_queue_cc.cc in Sources */, + F0E8E7ABBE027BE7D1BFBFD48EF82591 /* core_codegen.cc in Sources */, + 735E2D92D52CB385D3448DBB32B3DB04 /* create_channel.cc in Sources */, + 99221F3EE6C31960FCCEA8AA10F4CAA7 /* create_channel_internal.cc in Sources */, + 443AF0DE6E69FDB93D4C36E78EFCD813 /* create_channel_posix.cc in Sources */, + 590FB3559EB0862A22A09515BAA149DA /* create_default_thread_pool.cc in Sources */, + E5CC051ABE1813BEBF4D471BF8455D1B /* credentials_cc.cc in Sources */, + 59902A519FA1C4BA47B5FBC803A9A750 /* default_health_check_service.cc in Sources */, + 22CBCFF56F954A149DDB45451DF37063 /* dynamic_thread_pool.cc in Sources */, + 94B8758B519C1807153F81F8EBEF5080 /* external_connection_acceptor_impl.cc in Sources */, + 1700F6791C5A181A525BFE94F77D316E /* gRPC-C++-dummy.m in Sources */, + 205631A49B5002A74844294EAD1397AB /* health_check_service.cc in Sources */, + 2C8DC4AEEFBD1B3D72FDFBB02124620B /* health_check_service_server_builder_option.cc in Sources */, + 13AA86559F2F13BE32BC5A4214EBB365 /* insecure_credentials.cc in Sources */, + 7493FE6646542B0A198EED1062FDFF2D /* insecure_server_credentials.cc in Sources */, + E93EC7650CF82D6D24829CE2DB0A11F2 /* resource_quota_cc.cc in Sources */, + 51076239FCBF7402B9206A237ADC497C /* rpc_method.cc in Sources */, + 7D831A9CA1DDE2BE06F0F599DA043960 /* secure_auth_context.cc in Sources */, + 489D6E089F27F59DD2B14474F48127D1 /* secure_channel_arguments.cc in Sources */, + 06D859B2E0B519D813BCDBB8049644C0 /* secure_create_auth_context.cc in Sources */, + 6835DB8BCCFEFE33D05072C81AA41C38 /* secure_credentials.cc in Sources */, + 0B2EBF4F4D8685368F2CEEA8EB10F0F9 /* secure_server_credentials.cc in Sources */, + DD9E6EE72AF303DE32697B910ECCEBAE /* server_builder.cc in Sources */, + A25DD73493DDB97C7C299D9A5071E809 /* server_callback.cc in Sources */, + 0A5D286FD1F7918827D17DB4BEC3838A /* server_cc.cc in Sources */, + 04F5B484BD379B34BD0B96B8A42DFDC8 /* server_context.cc in Sources */, + F1994C67CA78D6AC4D47C4AFFFDAF96A /* server_credentials.cc in Sources */, + E779D8C54154249F70F5C7FBA4879E2A /* server_posix.cc in Sources */, + FEBBC166B619D627C9D910CDCA3CFFE3 /* status.cc in Sources */, + 9EB153DB632DD0858AF30AC38FDD99AE /* string_ref.cc in Sources */, + CE3A9CB8A02DD57D15B134D56E2504AB /* thread_manager.cc in Sources */, + E4C9E642D3F94585A2E7830EBBFBA2A3 /* time_cc.cc in Sources */, + E50BDF2E0A0BE7FF02FEB3694CEAC80C /* tls_credentials_options.cc in Sources */, + 051A0A98B0D5E4092A7A4F4FA2D75609 /* tls_credentials_options_util.cc in Sources */, + 1564EC368C4660AED847F8A4729DCD17 /* validate_service_config.cc in Sources */, + 2C8AB429C778F2B2B820D5D8F5AA7A95 /* version_cc.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D6A16C2943A3CB1D4CD742AC2F72D68B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7200FD0C3EAA6652ED474E0765CF7A6D /* cct.nanopb.c in Sources */, + A59AFBE2663F16D8CD4C3E16ACAEF72C /* GDTCCTCompressionHelper.m in Sources */, + 4B6F1109F98268976A95C4F2836563EC /* GDTCCTNanopbHelpers.m in Sources */, + F1185F45A9122D305489698E3C38E72B /* GDTCCTUploader.m in Sources */, + BFFF20DAEDB92A54849851EA31EA044F /* GDTCCTUploadOperation.m in Sources */, + 38F90F62664F51AAE2DB5ECC0D62606C /* GDTCORAssert.m in Sources */, + 38302274EFC1732E53324E0C6769FD5D /* GDTCORClock.m in Sources */, + 87234EA14068845E6EA9D7EB06D3D726 /* GDTCORConsoleLogger.m in Sources */, + 37CF852900C21052771297956B823632 /* GDTCORDirectorySizeTracker.m in Sources */, + 7439A2E1B5C01851D7BD91941F9E93C8 /* GDTCOREndpoints.m in Sources */, + 68A58CFBCB124ED820826E89C4253D76 /* GDTCOREvent.m in Sources */, + ABA9F5F6267D3DDBE9CB3B86E7B99203 /* GDTCOREvent+GDTCCTSupport.m in Sources */, + 70FE06D7429ECA20112D2C1F07393955 /* GDTCORFlatFileStorage.m in Sources */, + 2E8D2322A5A821EC4B579F0FEF8C0378 /* GDTCORFlatFileStorage+Promises.m in Sources */, + 868EBCC1ED7DD1C1FA4D04CC3873B29C /* GDTCORLifecycle.m in Sources */, + 4DF438696A2F6D188AA0984F16256971 /* GDTCORPlatform.m in Sources */, + 1AA72DFB277F41BD2F2282BC06846AAA /* GDTCORReachability.m in Sources */, + E8D77B2E143D67B877ACFFF318DD6898 /* GDTCORRegistrar.m in Sources */, + B3F8125BE10393D0D50A8FBFBE356F4D /* GDTCORStorageEventSelector.m in Sources */, + B84FFFC407AD861B819F9962BA195A1A /* GDTCORTransformer.m in Sources */, + 69D46713D09549EA3AEC2F6DC7C56520 /* GDTCORTransport.m in Sources */, + 5A65B876E356A865A30B002117C0D379 /* GDTCORUploadBatch.m in Sources */, + 1B72A542B1AA161B62801A7F2A5877E2 /* GDTCORUploadCoordinator.m in Sources */, + 71FDA856580469C7C79557580359042D /* GoogleDataTransport-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E0957F2F98618EB1861C22BC543C62A1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8FEC00E0549448F9B501BB2ECC4A9CB4 /* FBLPromise.m in Sources */, + D8477C966F7DB63EE9B045ED08E04672 /* FBLPromise+All.m in Sources */, + 27D490A8A8DE58A1DB1B89F1057CD475 /* FBLPromise+Always.m in Sources */, + 8183E15F9FF1DEC259327135C240D522 /* FBLPromise+Any.m in Sources */, + 2DA3C4B46ADDF92DC28C50F19730D3B4 /* FBLPromise+Async.m in Sources */, + 34AB1D429019DBCC97F847A519525A20 /* FBLPromise+Await.m in Sources */, + 78CF8C2F38DE8A0A2170AE1AC4918767 /* FBLPromise+Catch.m in Sources */, + 192F6D789C61017A62623911FAF97787 /* FBLPromise+Delay.m in Sources */, + C251606665B83D42F86617828C5EA7C3 /* FBLPromise+Do.m in Sources */, + 19DAD49C4177DECDB7C9B899BA29EA44 /* FBLPromise+Race.m in Sources */, + CC28D98C880431BCB0D1DEC0D715D4B2 /* FBLPromise+Recover.m in Sources */, + 8F8B522E543A066C3FD1919EB11E24E1 /* FBLPromise+Reduce.m in Sources */, + 44C7624479EC9AA6B65E9B28385451AD /* FBLPromise+Retry.m in Sources */, + CD70937ABFDB88D4F606B6B51D05E0C0 /* FBLPromise+Testing.m in Sources */, + D97D4BAE1C9A48F16CBCD0CA52343D9F /* FBLPromise+Then.m in Sources */, + C60E74C634EBA1B7347BF3354A59C3B8 /* FBLPromise+Timeout.m in Sources */, + 69034CAE164F1E03E5C8560C8D4071B0 /* FBLPromise+Validate.m in Sources */, + 81081A116B0A40B210408B8AE249A053 /* FBLPromise+Wrap.m in Sources */, + B6CA64F06C13BDF9F9116FB2A82020D7 /* FBLPromiseError.m in Sources */, + 28371E24BDC250B5D08FB7046F6C8281 /* PromisesObjC-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EFB7A721756FC626CA9BD1E888AF211D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 09389108BFFAA38ADEC8E7797750D2FC /* annotations.nanopb.cc in Sources */, + 3E1837FB6AE0E494341138C041315BA7 /* any.nanopb.cc in Sources */, + 571AC94D1AF9B56EC9D34DEFC778671A /* array_contains_any_filter.cc in Sources */, + 29F58890993FF11251ADE20FD6E72C07 /* array_contains_filter.cc in Sources */, + C99D3EC85FF68F1B227778CCBEC716FB /* async_queue.cc in Sources */, + ED0E11ED53BB172A17DFE20AEF5FF657 /* auth_token.cc in Sources */, + C34BB2A22A7FCE27067F77120D777179 /* autoid.cc in Sources */, + 46C792FC54C8C8DB1A4DC608FE869397 /* background_queue.cc in Sources */, + 677B9897E5459E8CFDF6D8933DB22428 /* bits.cc in Sources */, + 25405645F65C6CC366DFD410256B4F3C /* bound.cc in Sources */, + A82F508DB78506ADDA3BE72E413F56A5 /* bundle.nanopb.cc in Sources */, + 95F11E8CE38A97A070B21E053BEB1AC0 /* bundle_loader.cc in Sources */, + 0C13CE9CD78EDD63B344BCD9C5BA84D7 /* bundle_reader.cc in Sources */, + 1BCC635368000ECF480518086D50AB6C /* bundle_serializer.cc in Sources */, + 57F6C14CD5ACD92537D11281B9459CB3 /* byte_stream_apple.mm in Sources */, + 12DD84F9F3E5E866EF6E9A225F9F46FA /* byte_stream_cpp.cc in Sources */, + E60421ABFF97A4BB6355E11490C6EF83 /* byte_string.cc in Sources */, + 7DADC36606A4EF3EF54990EFC0F84C15 /* collection_reference.cc in Sources */, + 9A1DC326C463AD9885B3CED70514E9F7 /* common.nanopb.cc in Sources */, + 8EF7CD29B7CBAF67D49A10ACA053FFDD /* comparison.cc in Sources */, + BABE0025757BE9790FA7DF8C461999A0 /* connectivity_monitor.cc in Sources */, + 38ED1D38FB122AE6D10EACFD70E7CFC1 /* connectivity_monitor_apple.mm in Sources */, + 849E6FC83D5CB6041B5450F14E9E89AD /* converters.mm in Sources */, + 6D4FA213902103CD228300673E6E5E3E /* database_id.cc in Sources */, + 6F2E25F8097B57DFA60DA3AA972B2A56 /* database_info.cc in Sources */, + A60F6A08A0761F16945A9CE40B17F895 /* datastore.cc in Sources */, + 9C218BCC54C748D4027B2DC07B290AD9 /* delete_mutation.cc in Sources */, + 3AAE4F9ABD228EE366988A21878AF972 /* direction.cc in Sources */, + E4AC001CCEE1857FEB35E2BD667FC29D /* document.cc in Sources */, + A9D15141ADC2B3535C6F645AA3EF4D10 /* document.nanopb.cc in Sources */, + 93EDC40D084A9F2BF17A569FF581E598 /* document_change.cc in Sources */, + E53AA3E665ACB5E938D9DC0E652A8BAE /* document_key.cc in Sources */, + FB4BE2B6C5589333EA3B553848AAFAAE /* document_key_reference.cc in Sources */, + 9893FF7EFF2D4847544D3260CB704428 /* document_reference.cc in Sources */, + 82F48DE3DF952DF36F0D934B2D2354AE /* document_set.cc in Sources */, + BD6041459396E4468AFAA9D52609A892 /* document_snapshot.cc in Sources */, + 9B11DFB0D4A3F77889B9CCC5CF8D0ADF /* empty.nanopb.cc in Sources */, + E918208A13257A728D73FBC0D1E65C55 /* error_apple.mm in Sources */, + EBB0CFFD07464FBA7F71E6BFBD4C0F44 /* event_manager.cc in Sources */, + 69C65ECE14323A8BFA5E03687DA4BDEE /* exception.cc in Sources */, + 50B7B73FAE437060F97A7720A743A2FC /* exception_apple.mm in Sources */, + 72557BF505FCEB32013D906AC99C1C27 /* executor_libdispatch.mm in Sources */, + DC26116F7C614DB4B9DDC3F5BE8AED9D /* executor_std.cc in Sources */, + BCB7A631611ADA018885F5CC30FE268F /* exponential_backoff.cc in Sources */, + 0EF0F68BC3EAC7BA5ECB6C1BA32B7685 /* field_filter.cc in Sources */, + 11A18CD24B179A36879A470C207E8405 /* field_mask.cc in Sources */, + D1107AC15454D3E44198E2EEA5710FF5 /* field_path.cc in Sources */, + 77759B953AFE970CA646326B11199AF3 /* field_transform.cc in Sources */, + EA918EC978F2F114AA61208D41F26D73 /* filesystem_apple.mm in Sources */, + 7613F5F57A23F6EE36B6BEB8CDDFCE70 /* filesystem_common.cc in Sources */, + C3084C362417D91B0E697A370695CE7B /* filesystem_posix.cc in Sources */, + 6E5F643BEB86AA8C0D3B23F2985B0B27 /* filter.cc in Sources */, + B38E6A5CB358154C17BD1CE4B945D8CE /* FIRCollectionReference.mm in Sources */, + 060A3E5D7B92B4A5711715F4DA10E073 /* FIRDocumentChange.mm in Sources */, + CDDB83D44FCC87EF14F9D31BEB997C89 /* FIRDocumentReference.mm in Sources */, + BE963229892930C491279FCAAA480A44 /* FIRDocumentSnapshot.mm in Sources */, + ED3055BC679545945A9B2A087D6F009E /* firebase_app_check_credentials_provider_apple.mm in Sources */, + 61F7AEC85760EAEFC0C3FAD59096508B /* firebase_auth_credentials_provider_apple.mm in Sources */, + E92406E7D76415C3DB8E5CDFDE5500CB /* firebase_metadata_provider.cc in Sources */, + 12F6FF07A3140511E64DC9D6D364C6EC /* firebase_metadata_provider_apple.mm in Sources */, + FB441B08451102D714B87223B9D79BB0 /* firebase_metadata_provider_noop.cc in Sources */, + C19F790FAA221422A187433060A9A218 /* FirebaseFirestore-dummy.m in Sources */, + 4F7BB29635736797A04C692500CB670E /* firestore.cc in Sources */, + 7CBBE5AAEAF51A504EB4869B2F06111B /* firestore.nanopb.cc in Sources */, + 223487ADB2A7EA306323CA284E75A59C /* firestore_client.cc in Sources */, + FB18497B1E733C0D7976F044121F8B33 /* firestore_version.cc in Sources */, + CC033DD9BB9D9B42ADA08F0F1F4A1C11 /* FIRFieldPath.mm in Sources */, + 34141DF03078DBD1B086A2A4D431A4AE /* FIRFieldValue.mm in Sources */, + 0EF122DC00DE7DB653A08F63C53409BE /* FIRFirestore.mm in Sources */, + 99E2D403F6C315AF0DB75BA3FBA70951 /* FIRFirestoreSettings.mm in Sources */, + 17FE3D764F79DD311D3F4C8C4525A1D8 /* FIRFirestoreSource.mm in Sources */, + 311EB09211608022625802E2C1BDDC52 /* FIRFirestoreVersion.mm in Sources */, + 10B5B500659FB78E31888F475513CEA0 /* FIRGeoPoint.mm in Sources */, + 5D99ED8BF4E26ED6E4B3C2A54028FC71 /* FIRListenerRegistration.mm in Sources */, + F94CB5C7CCA8D747A93B9689F417EB3C /* FIRLoadBundleTask.mm in Sources */, + 2FAD4460A00505A32E01FC03F292325B /* FIRQuery.mm in Sources */, + 2B68BFEF3991F78A493338B655F1BE43 /* FIRQuerySnapshot.mm in Sources */, + 3640433C3DCFC1FE29178AEE5A8232E1 /* FIRSnapshotMetadata.mm in Sources */, + 472D25FA00E74E2633FDB64DC31E8A65 /* FIRTimestamp.m in Sources */, + F28B239B17DC8E95F8757F0971CEB3F5 /* FIRTransaction.mm in Sources */, + F23E225F05148905BA8BEE9A75D95497 /* FIRWriteBatch.mm in Sources */, + 629105F2AE61C75BECB5A458E091DB80 /* FSTFirestoreComponent.mm in Sources */, + E4F8062E2CDEB6FABFFE479ACDF8BC3A /* FSTUserDataReader.mm in Sources */, + 86A349B377354938FD0844F35A02250E /* FSTUserDataWriter.mm in Sources */, + 21CCF59FCC1FAE3DC5783D9B1EA11F14 /* geo_point.cc in Sources */, + 101AD1E54F467CE4D1C12BC7C421CF87 /* grpc_completion.cc in Sources */, + D9887A55FC1CE6879C659744BB8BF94D /* grpc_connection.cc in Sources */, + CF4A48546EF1C65A31B8D9BFBAF7F0AB /* grpc_nanopb.cc in Sources */, + 37EBD5BDBA038C0DCF416F9DD9EE827D /* grpc_root_certificate_finder_generated.cc in Sources */, + 2802A350C6DBEA5B851EED86861628A4 /* grpc_root_certificates_generated.cc in Sources */, + 7F4E202CBB71001FDCF2EA64825D68FC /* grpc_stream.cc in Sources */, + BFF44DC75E237B822AE7033750116E81 /* grpc_streaming_reader.cc in Sources */, + 6D8BB5D0C6B77DF33EFD267CDB665F74 /* grpc_unary_call.cc in Sources */, + 80E2471EFD01E84729AE5A68B1FBF851 /* grpc_util.cc in Sources */, + 2B89EC64091BE6A579D75DCC44BE0635 /* hard_assert.cc in Sources */, + 6A7C90E5F8537266302D9CBAC709C3BE /* http.nanopb.cc in Sources */, + 457D132712B6F2D43D6AD4AE824B4CCA /* in_filter.cc in Sources */, + 223DC4E4EA57FEDD17E7AB6A1BEE1B13 /* key_field_filter.cc in Sources */, + 225E5273BC35C029A4779A7134F9989E /* key_field_in_filter.cc in Sources */, + 7F0F1C6465BB17DD82E8BDAEE1AC0298 /* key_field_not_in_filter.cc in Sources */, + EB6D879FAEF3E7DC469FC1D1708C3068 /* latlng.nanopb.cc in Sources */, + 0563641EF8CCA841500B0B340C1E21B4 /* leveldb_bundle_cache.cc in Sources */, + 12AA1211FB299148CE05A9653A7A19B9 /* leveldb_index_manager.cc in Sources */, + 5A85DD4B8BB50A019743AEE533F0B4AA /* leveldb_key.cc in Sources */, + C077C62016041E6FFC1521C877489DA7 /* leveldb_lru_reference_delegate.cc in Sources */, + B57CADBAC022A0DDC34819E9E6457194 /* leveldb_migrations.cc in Sources */, + B150EEE30A758808DE923D5B033E30D0 /* leveldb_mutation_queue.cc in Sources */, + 0390F72BEBDB654395F771082945D912 /* leveldb_opener.cc in Sources */, + E795F3C3CCE809EE618A3D067C5CACF2 /* leveldb_persistence.cc in Sources */, + 70AD83AD52155ED4994533287922D3F2 /* leveldb_remote_document_cache.cc in Sources */, + F28EEAB3D4FEA5AAF4641CE36F57AE3A /* leveldb_target_cache.cc in Sources */, + 4DB76D7C8F95A5AF746183CB0F5E576E /* leveldb_transaction.cc in Sources */, + CC5CBF3F26E0EC2CCC1D3F5795F0BD0D /* leveldb_util.cc in Sources */, + 7B57094FE2296FB90EA0C0D7A440B148 /* load_bundle_task.cc in Sources */, + F2625B77D80C4E05352FAC3B64016E08 /* local_documents_view.cc in Sources */, + 37EF5D1AB0EEDF4F10D14A2117FA20B6 /* local_serializer.cc in Sources */, + 191F7BD6BA85165D3662DA7D0116AECE /* local_store.cc in Sources */, + 02CA6966937D752B7CB3E3B417E171B2 /* local_view_changes.cc in Sources */, + 5E70025EB59EB517CAD8435F61F388C8 /* log_apple.mm in Sources */, + FCA627E601C3122D4A7A6134131AD580 /* lru_garbage_collector.cc in Sources */, + 0804DB0DBDFF8E5614A048EAFA16A829 /* maybe_document.nanopb.cc in Sources */, + 3F90BEB1B1464E0EFB2E057C105883A1 /* memory_bundle_cache.cc in Sources */, + 8FD6DCA65E8727A36D0D0C3D0AF0EECE /* memory_eager_reference_delegate.cc in Sources */, + ED6BE707D48CF6ECE78450D6EA9988B3 /* memory_index_manager.cc in Sources */, + B595A373B63CE8755D26D900CC96FB61 /* memory_lru_reference_delegate.cc in Sources */, + F3D55E0F01159FB8B36BF659368A64B0 /* memory_mutation_queue.cc in Sources */, + 2AFEC81FDBCAEEFEB77652503D27AB2E /* memory_persistence.cc in Sources */, + 19084CA4DFCC54BF63F40B938607316A /* memory_remote_document_cache.cc in Sources */, + FDE7D6FA22308A7EBAE785B8F6D865B2 /* memory_target_cache.cc in Sources */, + 6C191517F32B06AE4AE430D577D89B21 /* message.cc in Sources */, + 6F5501717D40BFCB2E2E96F2390B4A77 /* mutable_document.cc in Sources */, + 553BDBBB4ECA7467A65B4FC425976F0E /* mutation.cc in Sources */, + EE02FEEECA1B3885C0940AACBA08CA28 /* mutation.nanopb.cc in Sources */, + 9ACD2D9C3493CD2F8ECD395A1538C365 /* mutation_batch.cc in Sources */, + FFC59C9E0A6C244EA76224D589EA04E6 /* mutation_batch_result.cc in Sources */, + 7234188DC2F8E210244C49675CF05217 /* nanopb_util.cc in Sources */, + D19B7096BDD9D95FDAFEB1EB92B21667 /* not_in_filter.cc in Sources */, + 9B1B16E1FA136BE6AF7C2BD29ABF9138 /* object_value.cc in Sources */, + 678D445934483DEF005FB83D930FCAE2 /* online_state_tracker.cc in Sources */, + 7205A548DC3F732C0FE3FA961A0D219F /* order_by.cc in Sources */, + DE25CC1E40356188395783B5A8D98273 /* ordered_code.cc in Sources */, + C79B91C76E05B95F5BC238CC722190C5 /* patch_mutation.cc in Sources */, + 45143A6D372605CE33B5B29A5C976638 /* path.cc in Sources */, + 9D08855113683F0D451CFADFCEEC2841 /* precondition.cc in Sources */, + 7BC295F3093115DC17190EE42F782CA2 /* pretty_printing.cc in Sources */, + 06FF3CFEDB20F05A277CEEC38C2C65CB /* proto_sizer.cc in Sources */, + 71A69E75012CD4CD4FFF7E9CCDFAF423 /* query.cc in Sources */, + E449940073B422C465C0DCC6D3D1244A /* query.nanopb.cc in Sources */, + 5BD9FF0401D96A87013CBE67E5618A65 /* query_core.cc in Sources */, + E48C5067B1C1CCDD6CA1FF98E71295B3 /* query_engine.cc in Sources */, + 1B1EABCA2C511554E77471B412A4F201 /* query_listener.cc in Sources */, + 07E2ED8BC1ABA4C4F96990753B182FA0 /* query_listener_registration.cc in Sources */, + 283889E99D27F5300C239C97A27FD208 /* query_snapshot.cc in Sources */, + 5ED5B1E378338731C81DFF0E8C78FED9 /* reader.cc in Sources */, + 2964883F03D85D5CECB1BCBA56702FE8 /* reference_set.cc in Sources */, + 93CB36777A2CC019E1FA757B6F96BC9C /* remote_event.cc in Sources */, + F2847D1251F9BC74DF1280DB653BDA68 /* remote_objc_bridge.cc in Sources */, + 4BCF37C63FA81742EFB36EDAF6E0AC97 /* remote_store.cc in Sources */, + 179167FB0F4EB3CD5FF41028F076F273 /* resource_path.cc in Sources */, + 2E3CD58E872EF0F4636C734217BD0AB4 /* schedule.cc in Sources */, + 40E6CA3BA65A0A18D42CE80745CB5E09 /* secure_random_arc4random.cc in Sources */, + 4B6A77E6A17A39389270408B6E286BD5 /* serializer.cc in Sources */, + 2D940E12E3D3A3555FD723B6AEFE1F28 /* server_timestamp_util.cc in Sources */, + F3EDB6AFCC10910111BF0D29E6AD567A /* set_mutation.cc in Sources */, + DF524BA530D34844DFFFB3D7E2F01A27 /* settings.cc in Sources */, + F54557D8C0F05806B75E0AE6C3376C35 /* snapshot_metadata.cc in Sources */, + 02BB35E01FF17699416694B32D357D3A /* snapshot_version.cc in Sources */, + 9D35828A938445AB90952F8C03FD2CD3 /* snapshots_in_sync_listener_registration.cc in Sources */, + 062FB9613D8893A51BCA3288444F21DA /* sorted_container.cc in Sources */, + EFEA5E450C8DE328CA4D402F2E5915ED /* status.cc in Sources */, + 2B948985FEFF10CFA84FCE79B722C7E5 /* status.nanopb.cc in Sources */, + 36BF66E6CD4CB703982BA2BC4B263AED /* status_apple.mm in Sources */, + 9D13A748E2AC0C11C572A6DCBA7BED5B /* status_errno.cc in Sources */, + C2F80392C4AB16FEB28D8450D15DE1BC /* status_win.cc in Sources */, + 4D1FB4B79F1D19FD7D4D1F6BCE182A9B /* statusor.cc in Sources */, + 7E263430E8A0A224302FD5E25FEA21ED /* stream.cc in Sources */, + FD3AB3BC1A24A6B5214B9B689DFFB320 /* strerror.cc in Sources */, + 76B0FCBDFFDF0FB57937FB99FF5FED94 /* string_apple.cc in Sources */, + F09E623463C28D973B872D58175ECF27 /* string_format.cc in Sources */, + 5A4B0716B3E408A6740AAF57CF4DFF77 /* string_util.cc in Sources */, + EEF4A89C8BD7731847FE5EA80F0631D8 /* string_win.cc in Sources */, + 1F1BCEE650C2AD57C9AF16203C2832E4 /* struct.nanopb.cc in Sources */, + E8B31FBE81FFF6E8D15C07E5F21BC277 /* sync_engine.cc in Sources */, + E14799D5BE19E8A8252467E81ACF5614 /* target.cc in Sources */, + DDC68D1BE4E6B1EF8882DA1F0A18CFD6 /* target.nanopb.cc in Sources */, + 73007D732F76B78FCF6C8D67C6AFCF73 /* target_data.cc in Sources */, + 845CB9575BBC717699D3CEEEBF7E2F44 /* target_id_generator.cc in Sources */, + 2B13FDA0EFA0635D6202078DF79A137B /* task.cc in Sources */, + 3B1787D0712CA51AD1D9FB1E8D2328BF /* timestamp.cc in Sources */, + F1F8DC84655B8C28C23FA7DBFB69B80C /* timestamp.nanopb.cc in Sources */, + B68DEE2D73195E7414A23DC4A0BF21E7 /* timestamp_internal.cc in Sources */, + A3D9412DFF56CDDC237EB5CE61039D03 /* transaction.cc in Sources */, + CDEE241050A1F31C86EBC9A41A5C3550 /* transaction_runner.cc in Sources */, + CEAF782C45DEC9AEB19230324B708FF1 /* transform_operation.cc in Sources */, + 4DBAA7DAAFC90C5A5004FF0C781AD68E /* user.cc in Sources */, + 210973B4A9B2E313E5C91F01E5258293 /* user_data.cc in Sources */, + 58F738E060120B41B25C073CD452C543 /* value_util.cc in Sources */, + D241877A91386322A945948843D349AB /* verify_mutation.cc in Sources */, + 51977E9C4C92927BFE67D54B46C466AE /* view.cc in Sources */, + B05A7CA17DF1CB0DD9162D1F692080A2 /* view_snapshot.cc in Sources */, + D6C6126949B5F93B04EB7D02231FF1D6 /* watch_change.cc in Sources */, + E74E0D69BC14865B00E969E39A8429DB /* watch_stream.cc in Sources */, + 3BF9837D710F829B55369EC2C2507F78 /* wrappers.nanopb.cc in Sources */, + B6E992F690C7D35FDA4CE63F59F77D5F /* write.nanopb.cc in Sources */, + 12A54A6D8D05842B212430221E5007AE /* write_batch.cc in Sources */, + B422863D9CD711162E572069CB12162B /* write_stream.cc in Sources */, + 364A7268CA26167A034336B3ACD427C7 /* writer.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F2B7E3A598111762F7E6BD16669D2373 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 112D37B3945BB21C913FDC8B0368BB35 /* a_bitstr.c in Sources */, + 0C7FFDED3939FC94EF07001C6D9248B0 /* a_bool.c in Sources */, + A46690D86F61AA0966AE818D4BB3BE93 /* a_d2i_fp.c in Sources */, + 454034AD82BFE242155BE8DE9BA69F22 /* a_digest.c in Sources */, + 8C7925B674A2DCBB419B15E629ADA803 /* a_dup.c in Sources */, + 1821DBE5D06C4B174A86C663EDBAEAF6 /* a_enum.c in Sources */, + EA9AE897E83FE3FD4FE6CD5C7F1552E8 /* a_gentm.c in Sources */, + 18A66A51C226E7DF5384C09C584914DC /* a_i2d_fp.c in Sources */, + 5CC7023E1021D0797BA7C2763F17FC28 /* a_int.c in Sources */, + 9D82B104810B0DC769E782F28CEA68CE /* a_mbstr.c in Sources */, + C11BF1CF8688326D7857015B90E5B9E2 /* a_object.c in Sources */, + 321C4338C1387198AA9C60283B509F7D /* a_octet.c in Sources */, + AFFEA0CFAA75CE27C4F1AA79F5A0C227 /* a_print.c in Sources */, + C641843771A04050A9D2FC1E42574754 /* a_sign.c in Sources */, + B9C8098D1FDC735E74F1589D2B180329 /* a_strex.c in Sources */, + 8EF94178105FF50BE359463B3A27509D /* a_strnid.c in Sources */, + 8327C3DAE4CD6FFF7290356308D700D1 /* a_time.c in Sources */, + 0C032F8094490291462B7382D0737FE4 /* a_type.c in Sources */, + D8FAF12024C5CED3225CD29B6FBE9296 /* a_utctm.c in Sources */, + 1E369942B97345B492AD864EBD95885F /* a_utf8.c in Sources */, + 7904C5E39CE2FA65CCECE1C639E0145A /* a_verify.c in Sources */, + 0D9DECE27AC8EE0734CF03E846DAB169 /* add.c in Sources */, + 08412BE0A4DB249245C98B6936992258 /* aead.c in Sources */, + 3A2E73025C2EFE1E085BA17E885A12FB /* aes.c in Sources */, + 517B19DFF621298064FB291057635222 /* aes_nohw.c in Sources */, + 1696C38BFBC9261CE163F9AF3666DBA3 /* algorithm.c in Sources */, + 49076CEFE1AB96565734163830AE687E /* asn1_compat.c in Sources */, + F365316B029D9D6D775385D80FB1117D /* asn1_gen.c in Sources */, + D752B00B32A3378E105A04F7E84ED33C /* asn1_lib.c in Sources */, + C4899EC8AE091954BC1C68A31A9FAB22 /* asn1_par.c in Sources */, + 03DAA35A7B8021CD6EE1E2A1B41F2078 /* asn_pack.c in Sources */, + 9174BC7B94942B05EEF9FD8B559C0374 /* base64.c in Sources */, + E0D00F76925E1E345987A52F62CE60B5 /* ber.c in Sources */, + 101B79473DD09A19FC02AE5E694DC696 /* bio.c in Sources */, + 6E3427191E86694FCD8D35FBEA5E2D58 /* bio_mem.c in Sources */, + 4C22509C5610862A897C9400247B9AB5 /* bio_ssl.cc in Sources */, + 964097C1BB4385D3BCE46648601EC498 /* blinding.c in Sources */, + 4A9202F3E05F3B1E71F7146F30CEC6CE /* bn.c in Sources */, + 0C3216D3FA659B7935C58B7B0AA8E6C6 /* bn_asn1.c in Sources */, + C586FC7964253153BFA017955B2D3CD8 /* BoringSSL-GRPC-dummy.m in Sources */, + FF99FC52E067A31B6233F7722BE5CA87 /* buf.c in Sources */, + FA898B8C7E72CCDB122CEA4D4160E02A /* by_dir.c in Sources */, + 7526DF06319A826070EE6F566FEA388E /* by_file.c in Sources */, + ACE1DEAD449957C49FC896120D06A70C /* bytes.c in Sources */, + 4829A561B33A9EE0114C784A91B5FE4E /* cbb.c in Sources */, + 89FA07FED2E02EAF12D21AC76F51D2C8 /* cbc.c in Sources */, + 5CDE8E1123F46FF95E8F892C06B062EA /* cbs.c in Sources */, + 0263D6753E25018E5D69AF7A8033478F /* cfb.c in Sources */, + 6C1DF27CDA12B13CD3FCCCD048A24338 /* chacha.c in Sources */, + 8DEC90432DF6342E742203C5B55FD5DA /* check.c in Sources */, + 336106112BDD0D8D909E74231732CAE6 /* cipher.c in Sources */, + 0A5A816803C29EAF791745FC11CD142A /* cipher_extra.c in Sources */, + 8975166800E5E5C418D61BFE7C07C9DA /* cmac.c in Sources */, + 050375BC1272BEDD154AAAA920BFF5E5 /* cmp.c in Sources */, + A77AEC43F8303646AF5DA18A1C766F96 /* conf.c in Sources */, + DC2D627AD6C390AB8F13EC6D19C4C92F /* connect.c in Sources */, + 5FBB0E31A597A4F1448803B96D347F51 /* convert.c in Sources */, + F7D8D5B0B760C8B0BB529E1E64986A98 /* cpu-aarch64-fuchsia.c in Sources */, + 79C8CCA74F841407EB38F4AC787044F1 /* cpu-aarch64-linux.c in Sources */, + 2ACA525503E5A905288804376D7F2D23 /* cpu-arm.c in Sources */, + 49C5CE0D19EBB57B19A8DA55213BB613 /* cpu-arm-linux.c in Sources */, + 0CC64AC95DE963EBDEAE251063BEBB01 /* cpu-intel.c in Sources */, + DA93FAB08BFC54934E15B5043B82400D /* cpu-ppc64le.c in Sources */, + 9EDB4CB7AA46C68CDE3D1938CD34C1B2 /* crypto.c in Sources */, + 01406F5723A28B29EE38BA47188DA5D5 /* ctr.c in Sources */, + 31E6AA7B8913F4C5DDAC980D867D73E0 /* ctrdrbg.c in Sources */, + B81BCF779D2D24EFD8B7DE16B56609BA /* ctx.c in Sources */, + 37BFB2086C3A49E24AF6CCD461CB2912 /* curve25519.c in Sources */, + 36A1792EF79077028F91EB028A2EAC60 /* d1_both.cc in Sources */, + 214E4A22A110CFA55A09C7DE617CF84F /* d1_lib.cc in Sources */, + 5BCD36498CE44ECC9C94553B3221BFB6 /* d1_pkt.cc in Sources */, + 73772FAA5B027591DC53C9D5655AAB1F /* d1_srtp.cc in Sources */, + F4F6DE5CBC4D11A2007B89970EB63390 /* derive_key.c in Sources */, + 17F3EFBF71C02FF8CFDFF336F30F0CDA /* des.c in Sources */, + BD476138791806597963FA692B9BA774 /* deterministic.c in Sources */, + CCCEF7CA6DBCD8F37A0CD9B94A6C2D2D /* dh.c in Sources */, + 6FB99C569E062950FFF500577DC3369D /* dh_asn1.c in Sources */, + 2722AB899C6EE6D013492A3362BFCA35 /* digest.c in Sources */, + 05D44448810FC26B3DB4098C458FD497 /* digest_extra.c in Sources */, + DFE379B6DE18398DA740D150C51BA0E9 /* digests.c in Sources */, + AE871EEEE8228335E8A69C9446E04276 /* digestsign.c in Sources */, + 3E4B201CE573A25B315ED57626A4442E /* div.c in Sources */, + D923971B75B8DA1CBF9CE82A6976C511 /* div_extra.c in Sources */, + E550C0F8F7DBE4DFCAD5439A7123A539 /* dsa.c in Sources */, + B4E68F03E8C46B85B8B535DF2B2EB628 /* dsa_asn1.c in Sources */, + E688291ACC439FCCEF36EFB401FFD5FC /* dtls_method.cc in Sources */, + 9980AFB73F824A077945D11D58BA0612 /* dtls_record.cc in Sources */, + 0E7F82170653C6EE701EBE958AEF1B41 /* e_aes.c in Sources */, + DE3D650BED050C6CF3FD33C1D78DBA60 /* e_aesccm.c in Sources */, + A2903D2427D46D9D6E1EC338986FAE7B /* e_aesctrhmac.c in Sources */, + 9FE491959099C23A5EDD409369BE4A62 /* e_aesgcmsiv.c in Sources */, + 2834BB7FCB8EF51278A2B9FED5963822 /* e_chacha20poly1305.c in Sources */, + 3A317CC259B2112C423AE449E5146B5A /* e_des.c in Sources */, + 8948B8CE0D43E8F23753C06DBEB896CB /* e_null.c in Sources */, + AA72ECD54FF2A35D0E0186BB7B9799F1 /* e_rc2.c in Sources */, + 4B318298C878E4A8C1AEE4D6975A4B2B /* e_rc4.c in Sources */, + 2C2C6ACBF0A763050AEC971B232EB296 /* e_tls.c in Sources */, + 19FF6F159742AD5A270AA2ED4F1394BD /* ec.c in Sources */, + 3DF009DA75A41BB166B5C65304BBCF24 /* ec_asn1.c in Sources */, + F37670C0A385A8667E1E05642F58F6FF /* ec_derive.c in Sources */, + C3A621DE75D8B3632F157FAED1EC2FAF /* ec_key.c in Sources */, + 97EF3180F1F4711D83ADF1DFEF0F8E6C /* ec_montgomery.c in Sources */, + 82E3B8449B0796ABC8DB8E69306B3F36 /* ecdh.c in Sources */, + E103F4FE07AA71A9F54D1587653E810F /* ecdh_extra.c in Sources */, + B0FD615D0ECD1A76C082E21AC7F04D3D /* ecdsa.c in Sources */, + AB822765E6010241241DA3D45F58AC68 /* ecdsa_asn1.c in Sources */, + 775D35AA1853BB678AFEEC6A9FBA7DC5 /* engine.c in Sources */, + EA2E39934EBFABD93C4EC7F744301CB2 /* err.c in Sources */, + 1CFADA9A4108B0218EB1DE1B98BA9931 /* err_data.c in Sources */, + 602BC6EE9ECDE148AD5B0B0320EF9457 /* evp.c in Sources */, + 41CBE8287EB4433A79AD6C591CA81620 /* evp_asn1.c in Sources */, + 1169E8CC247AD37BCF9D3056E44CC295 /* evp_ctx.c in Sources */, + 5B69BB420FA2368CE16FDBEB0A36DD41 /* ex_data.c in Sources */, + 8BEA46A46EF9145AACCA1DB780B4B712 /* exponentiation.c in Sources */, + 4D9DD1BA741C97EA187A496FFEFDD6A9 /* f_enum.c in Sources */, + 1ECA7D9EBD27C0AE07E8C2F9311B313D /* f_int.c in Sources */, + AF564D06A5CA484D2977971800CF368B /* f_string.c in Sources */, + 6CC048B39F029041960A1759D6718875 /* fd.c in Sources */, + 2695BECF5B5A01B90D22AF4F495BFD79 /* felem.c in Sources */, + B8E227497BDDB92A7973501C200AB67F /* file.c in Sources */, + 2BBAB9C7F93ACC5A29F75175570ED525 /* fips_shared_support.c in Sources */, + 5CFA0BA21AAD11848D994835F9DB342E /* forkunsafe.c in Sources */, + DE166A7DBEEB0AE072B8102C97EF22C8 /* fuchsia.c in Sources */, + 564EF3B3D29679C47BA8AA2CF4BD5F84 /* gcd.c in Sources */, + BF8BDFBBDC916CBFA6A15E3F33DCBFE1 /* gcd_extra.c in Sources */, + 32D34ED8DABE158DB859BDB45EBFCCEA /* gcm.c in Sources */, + B23C07998FF787066491321A85C7EBF6 /* gcm_nohw.c in Sources */, + 158DECDBDA303079E33AE70E2D03587D /* generic.c in Sources */, + 3FBBCAC2BBC77B280853403A7CF1CD31 /* handoff.cc in Sources */, + 440FE05BC5833A0FC57B75144729431F /* handshake.cc in Sources */, + 28D0135526BD933F861795E4AB714F10 /* handshake_client.cc in Sources */, + 72536361CD02350CABEBFB17394D99E4 /* handshake_server.cc in Sources */, + 8901FF7008F04D96CC650DF48E55B239 /* hexdump.c in Sources */, + 9440013326FFA77477CF8D08E09A5326 /* hkdf.c in Sources */, + 80438ABA8BEFA52FAB68FFE568B7BB9F /* hmac.c in Sources */, + 8F4B87101F154AAB6EE9B1CD1CB92A78 /* hrss.c in Sources */, + 726D1DA6DFB1CB3D570F29606A7D4618 /* i2d_pr.c in Sources */, + 67BA17A560CB235AA957350A087947E1 /* is_fips.c in Sources */, + 33394FF9DDEFF7456ED4DDE41F3C0DE0 /* jacobi.c in Sources */, + 72E28F8C1F58CEEA376D3D1761180024 /* kdf.c in Sources */, + 9CD1A004A89311DD69C33F35672101A9 /* key_wrap.c in Sources */, + 5B7B8DCC1A17F9D48B53436BC11B14AF /* lhash.c in Sources */, + 4CB2191AA8A2F8AC3ABA5EDC6E52394C /* md4.c in Sources */, + 2AAC39F213D1F004EF3ECBCBF3648CBD /* md5.c in Sources */, + EE7B1BB3B9EB595F9DF8BF4ACC6DCB5E /* mem.c in Sources */, + CFB6CFC4A73EA3B4637C5E841BE23676 /* mode_wrappers.c in Sources */, + 12A34FADACA308FAFC8310EDD5DB1B8C /* montgomery.c in Sources */, + EA0734BE360A5A4CEFC2C67E22937ED2 /* montgomery_inv.c in Sources */, + EE256DBCE9A26F54A1AE21D835D78CD7 /* mul.c in Sources */, + 40D333D752C37BE7ADB400AF43AB332C /* obj.c in Sources */, + 04A48AE6D63FD820B939D27B1EEEF832 /* obj_xref.c in Sources */, + 6D87DAB899FB6DFDB753DD75EF389D3D /* oct.c in Sources */, + 9315425EAC7DFB0D9DBD035E999F44A0 /* ofb.c in Sources */, + B82F300CF4C839D6AF2566ABA9414324 /* p224-64.c in Sources */, + 35C468AEE601BB0919C32583DF2E02CD /* p256.c in Sources */, + AE1C70A3994AAD80D3614970E1052338 /* p256-x86_64.c in Sources */, + 0D59B40583E46E9B8CB62F5BDE103692 /* p5_pbev2.c in Sources */, + 13425BF16D9997C69CD7C7A96CF81C7F /* p_dsa_asn1.c in Sources */, + 104F1D4D0CA9914361CDBE3E33A39328 /* p_ec.c in Sources */, + CB6B00E1C1708AA887C1D3414859C90E /* p_ec_asn1.c in Sources */, + 86476F1E4CFA1A4D38134E09745E2B7F /* p_ed25519.c in Sources */, + E93C4DB9AB1A35B769D683C936A0B05F /* p_ed25519_asn1.c in Sources */, + 5A58DF5FA2B436698CED518758172C3B /* p_rsa.c in Sources */, + 020C2C9B0DF4877186A3BAB7412ADC2A /* p_rsa_asn1.c in Sources */, + 94C404F72FB09D41F94D5061847A67ED /* p_x25519.c in Sources */, + ACF316AB28602030758E7352C56CA6DD /* p_x25519_asn1.c in Sources */, + E3B78E5E7244CA407FEB4A4F90E7C9B7 /* padding.c in Sources */, + F3DCB843F7AABC8B66C55498D52EC6B9 /* pair.c in Sources */, + A62221ADE491570F4A70E2CE15C81F79 /* params.c in Sources */, + 8A4A02B6D00040062BE72C144EC0409F /* pbkdf.c in Sources */, + D89A7AC359A21480E83EC1C426C9A55E /* pcy_cache.c in Sources */, + 0B99A578FFBF55F4941C3025C0A8C400 /* pcy_data.c in Sources */, + A5788AD55987231D69C39AD3EFEA8397 /* pcy_lib.c in Sources */, + EEDFE5A4B79084710409966C79D004DC /* pcy_map.c in Sources */, + 1262B76AC0B0895A1D3B51565950C61D /* pcy_node.c in Sources */, + 372B66496F6104A199AE5F9D5FB06D75 /* pcy_tree.c in Sources */, + EBB27B4BCAE355A4EA9AE23386C1540C /* pem_all.c in Sources */, + 07636DF52F3B67AFA466E7645FBAF023 /* pem_info.c in Sources */, + 7451FC28A10C6DD9E80F2F716517D489 /* pem_lib.c in Sources */, + 8E5606E266E02E852FC1C0C3B3565AC7 /* pem_oth.c in Sources */, + 771DAD31942F9B8D48B2D04E074E6662 /* pem_pk8.c in Sources */, + 35A9018F5DBCCC8DC294FD7759C5ED6C /* pem_pkey.c in Sources */, + FD4461BFEB0B1444148019C5F7763BC5 /* pem_x509.c in Sources */, + 61BB4AE970DC86B9DD87BF11D17DF736 /* pem_xaux.c in Sources */, + B30A472547EA6F3B5BAB1DD8DBD142C6 /* pkcs7.c in Sources */, + C683392CF118F0DA44E956F571001974 /* pkcs7_x509.c in Sources */, + 26654D191847ED85318EB04880AF15C8 /* pkcs8.c in Sources */, + FC804B8DDF303C6E8F2105BEA9EAF317 /* pkcs8_x509.c in Sources */, + 13CC64623F8B0C41CB049BE397EEE3B8 /* poly1305.c in Sources */, + 208248068C87521446CD790C2DCA4A09 /* poly1305_arm.c in Sources */, + 60AC62DE4D14B83547CE5507D8634EDB /* poly1305_vec.c in Sources */, + 74B3471B9CF0CD214BD535E121E56CE2 /* polyval.c in Sources */, + 3E18E5F9B553D21DDC1D3A2AE267ECC5 /* pool.c in Sources */, + 48012CDC5E2250E69F1890442DB4A56E /* prime.c in Sources */, + F26BF9E1D436A8F7A18B2A6160E529A1 /* print.c in Sources */, + 1C9CFA2F4F618B2A42BD10C39E88FC38 /* printf.c in Sources */, + D9D9B3B80B29D8C5992CED82F97964CF /* rand.c in Sources */, + 40CCCDADB074D830BF98B67DCED27887 /* rand_extra.c in Sources */, + E04950E6DCADEBDAC29B82657CFBCD28 /* random.c in Sources */, + 9277424E703C8B826CB5D8680899E266 /* rc4.c in Sources */, + 9CACAAF898783512E40AABE798F03116 /* refcount_c11.c in Sources */, + 81DB2523DD33DA94AA1AC0D753CD9F9B /* refcount_lock.c in Sources */, + 03BC778EC40A29C94660F6759E9C23EF /* rsa.c in Sources */, + A2069FF0999574B023799AE18C497207 /* rsa_asn1.c in Sources */, + 6BD614419B46A436F895F429BC0DDEF8 /* rsa_impl.c in Sources */, + E19C929B379E9810C8BA8BAD766C1EE8 /* rsa_print.c in Sources */, + D0469C4888693DD1E3F2531CB89AC117 /* rsa_pss.c in Sources */, + B94B0A7AD03D0A807D66D2AB24808892 /* rsaz_exp.c in Sources */, + BCB1E3243FF47C6D9A31758FBB172C69 /* s3_both.cc in Sources */, + 5D5EC0EEAAC2093AD5C565AB280A4F28 /* s3_lib.cc in Sources */, + 34E698C223A544F2118BA00B9F669ED8 /* s3_pkt.cc in Sources */, + BC3DDAB1270757014A5FD68C6B1AEA4A /* scalar.c in Sources */, + 46D79886E2DFCED3F4CDEF86C304CA38 /* scrypt.c in Sources */, + BCA76BF458F1E428F1B96A018248D9E9 /* self_check.c in Sources */, + D7C4AB545EB88B0D8F42343CE050118D /* sha1.c in Sources */, + B8E71627B09D05A821819473E060B767 /* sha1-altivec.c in Sources */, + 055587C50897AEE16D9F76D032554731 /* sha256.c in Sources */, + DA7F7D5EA499ADDBB53A68F8E2A75ACC /* sha512.c in Sources */, + 07F3CDFBB7F8DB9A4C2AEF7CEF3A1CBF /* shift.c in Sources */, + 9DCCEE5611AE2687C0A531DFBEE99909 /* sign.c in Sources */, + 7C0F76A68E1602DFB8351BFCD96A8790 /* simple.c in Sources */, + 6567018EB6FE0A577D676DE6E29B93C9 /* simple_mul.c in Sources */, + 2F8B233618E29CAAD25AC084F76443CE /* siphash.c in Sources */, + 035B96C76CD860C9B6CE38B60528506F /* socket.c in Sources */, + F87AF7A2895FAB783CDC529C02E63BA1 /* socket_helper.c in Sources */, + 215E66B16421B3A8BEFBBA291F228836 /* spake25519.c in Sources */, + F1FA8F5CB5D73F19B6C2A9BA2802613F /* sqrt.c in Sources */, + 0617093F81D30A905B8E69D17DAD12EE /* ssl_aead_ctx.cc in Sources */, + 626FCBBB199311543173548D4A2E5CB4 /* ssl_asn1.cc in Sources */, + 12AEB8E1357D1306129AAAC6EE81F4BD /* ssl_buffer.cc in Sources */, + 53B5EF6AF9690EC06E764BF7CA0BD95A /* ssl_cert.cc in Sources */, + F5049D2569D0DD0CD8F78DB2940ABD60 /* ssl_cipher.cc in Sources */, + 12CC88791993370772C0E4B1A2363FC7 /* ssl_file.cc in Sources */, + D7613DF2BC6ECE9F31E384A69FB50661 /* ssl_key_share.cc in Sources */, + 41CAC6FE0AC59DE1D22203CBEDE419CC /* ssl_lib.cc in Sources */, + 090545953B3EA7AA804E8ACCDDF6DB5F /* ssl_privkey.cc in Sources */, + 7B28191262DCA91592B26B098BDDC531 /* ssl_session.cc in Sources */, + C9A15D50D4D668164B3A5856290AC8BB /* ssl_stat.cc in Sources */, + 980819218E74FBD09F16F1C51E5D4F52 /* ssl_transcript.cc in Sources */, + DE9091B337FBF9F24EF31FF8514C5A29 /* ssl_versions.cc in Sources */, + B2B3A52B415A80081691EC87ABCF3EE2 /* ssl_x509.cc in Sources */, + 124560F68F98C6CFB7BF2AC637B0A932 /* stack.c in Sources */, + 0117E4827C99D4E4C1B31936C7BFE515 /* t1_enc.cc in Sources */, + D6DEA7315C582322E475E8DFE1022A4E /* t1_lib.cc in Sources */, + A97F89DA5274564992615CE6EA8DC32A /* t_crl.c in Sources */, + 92DB300EFA0F487A1464BEAE7AB6084D /* t_req.c in Sources */, + A86B6B55660FE0311A771754157930FD /* t_x509.c in Sources */, + 5F2A4396DA4B38A009C7A16BE97457FB /* t_x509a.c in Sources */, + FC6483D1A00C2B6F07A072D3FFF42BA4 /* tasn_dec.c in Sources */, + 07938C52C6D4CD329B608935D63149F9 /* tasn_enc.c in Sources */, + D9D9F143463AD40D2EDEBED49175C317 /* tasn_fre.c in Sources */, + 39B08DA6D74BF610EBCD419154EC4457 /* tasn_new.c in Sources */, + A3AC5C15AA7D379DF97A66EC0EFFB8F9 /* tasn_typ.c in Sources */, + EDF1F1799393C331F91BC3E14A3E940A /* tasn_utl.c in Sources */, + 3BBBF03E04BDD415B880197D6079C541 /* thread.c in Sources */, + 6A86B90E75E63804EAB4497C69ADDA4B /* thread_none.c in Sources */, + 598DB82B8F26FF990C02BAD512A0A2EF /* thread_pthread.c in Sources */, + 3C80FD8613B9384EA70B6821723F06E4 /* thread_win.c in Sources */, + 1FF8D5C418E0AF17411F2557603EFCE4 /* time_support.c in Sources */, + E017C02A2F08EE05D23E647757857663 /* tls13_both.cc in Sources */, + 93F3EA30F197DB12DA07429DB566613F /* tls13_client.cc in Sources */, + B63B24802CCEDEFCAB40E8C697B84A92 /* tls13_enc.cc in Sources */, + 5483D4362CDB65A72E7739DF83F4965E /* tls13_server.cc in Sources */, + 9737F3C8143EFFE02FFE5801EEFF117E /* tls_cbc.c in Sources */, + 88EAFC2FAFAC5064F872ECA5DA0C11A1 /* tls_method.cc in Sources */, + 10028AE9C414A32DB10F561108A5F612 /* tls_record.cc in Sources */, + 07B0CF70333497CFFFEBB75BAD03EB93 /* unicode.c in Sources */, + 0B58333C7914B3CBD8A251F0C6CE675B /* urandom.c in Sources */, + 31254AEEC196FF291C587C6446317871 /* util.c in Sources */, + 578605592CA196FB390E39D61C0556FF /* v3_akey.c in Sources */, + A9E90E794BE93D00F8BBB01B7E3718C9 /* v3_akeya.c in Sources */, + F424DA7F7FAE4A3319C9A773209ED0C2 /* v3_alt.c in Sources */, + 7F6B98E19B4221BE1C0DEB6D853FD30A /* v3_bcons.c in Sources */, + 6A0E8FD060AD27486CA7A1A37593472F /* v3_bitst.c in Sources */, + 4D12F71DE32B72F3D89D82BDEDAEC9AE /* v3_conf.c in Sources */, + AA65EFA1C7D0646CC8B5C1855039B605 /* v3_cpols.c in Sources */, + 6CA4E5B097160FC6C25AD342F5E9A077 /* v3_crld.c in Sources */, + FAA89DF4C9C8981047359A1EC814F65B /* v3_enum.c in Sources */, + 6425FA6B9646033D60C0446672E2495E /* v3_extku.c in Sources */, + FD19AD7F4ED06CF7A1ECB746106BF331 /* v3_genn.c in Sources */, + 517DE9210A7E4F3B9E115433C3CC2BDF /* v3_ia5.c in Sources */, + C67909B559060A1E6B09F39A08F73146 /* v3_info.c in Sources */, + ECD0C49B48A9414CBF658186BE7B1206 /* v3_int.c in Sources */, + 8A885E1973EFE457338D91AF725C0FF7 /* v3_lib.c in Sources */, + B0811BA8A5729594E410FA5658DA75DC /* v3_ncons.c in Sources */, + 69775933FA111769BF1D349AE84437EA /* v3_ocsp.c in Sources */, + AB415F2BD12C21DAE0D5F94CE09C8B3C /* v3_pci.c in Sources */, + F86572C5A8052BBB4455F9F2851468D3 /* v3_pcia.c in Sources */, + 6E85D89BBB60B794A78967CAF4A02C04 /* v3_pcons.c in Sources */, + 46EF29A183C834E9B65C5BAB97A9F67C /* v3_pku.c in Sources */, + DBA4615561F8037F5D9D83BAAF17CB12 /* v3_pmaps.c in Sources */, + 71050FC7809921E80DA120BE0445AB5F /* v3_prn.c in Sources */, + 7F531F3ECEE3045F9E7B6DB5D1CF9053 /* v3_purp.c in Sources */, + 89BC1A022B65498ACBD444673B096D6C /* v3_skey.c in Sources */, + 9F7EDB276DD9FCFE5715DFFDDC8CBD79 /* v3_sxnet.c in Sources */, + 4002F73CCC23D0152F91D90A13A6137F /* v3_utl.c in Sources */, + A77F67FC9B32A5F7DD355FCD586B435B /* windows.c in Sources */, + 47978E03FD7AB7DF06271BFC26849B41 /* wnaf.c in Sources */, + 719E91620DFD9F7243BF54587537FCE3 /* x509.c in Sources */, + B3E74C1AEEF831D8777199FD6918DA27 /* x509_att.c in Sources */, + CDBDC6B03A115D74517D1DB7E293C087 /* x509_cmp.c in Sources */, + 073D80FE3E42FA25DA8C50E2E59CD28F /* x509_d2.c in Sources */, + A38799C9C602780D5688EFDA8BFDAE9A /* x509_def.c in Sources */, + 7AD7905C43FD0F238DFA5A00FBB3EF53 /* x509_ext.c in Sources */, + C7F38522F9EF5177256483D7928650F1 /* x509_lu.c in Sources */, + AD67BD1C48CC3AB18CAE6C2599A782AB /* x509_obj.c in Sources */, + 79B782016FCC2DC8D7A97C578F526242 /* x509_r2x.c in Sources */, + E938A67C80AF85582D735CACE0A6BDB8 /* x509_req.c in Sources */, + 767703405C550B7EA03EAD9A35761B44 /* x509_set.c in Sources */, + 6E55097A38E0852E042F9B0E134A2AF3 /* x509_trs.c in Sources */, + 5DA531D0E59FCCC034340B5AA5D261BF /* x509_txt.c in Sources */, + 2FFCA5CEBA1C3BAE54D8BB2D36A07A3A /* x509_v3.c in Sources */, + 5FDA930D36FB22CCEBF2D6ADCF3EEC63 /* x509_vfy.c in Sources */, + 83936016DCC3DFFB3B1A37FF8ADC2119 /* x509_vpm.c in Sources */, + F7505D65945B45425AE254846D0DB403 /* x509cset.c in Sources */, + 2C01378BB2AB8DEBE0EFD30C05A78804 /* x509name.c in Sources */, + 334952E8E95F69C72B544F2E8721CD42 /* x509rset.c in Sources */, + 8F933D65A5DFC189ADBF5D6426D13757 /* x509spki.c in Sources */, + 488D3219317E580B2F73C9212D1A1EE0 /* x86_64-gcc.c in Sources */, + B0ADB1F69564F930411EBBD83B03EC4F /* x_algor.c in Sources */, + B8ADB345F8312A4A97E8642AE99959A0 /* x_all.c in Sources */, + C2C6A1C9F0E1160CF83A7EA06D7E7CE8 /* x_attrib.c in Sources */, + 6A0DB1046DF12844ABFC2FDB24BC7521 /* x_crl.c in Sources */, + 44307D093806F4DF212EC932A838988E /* x_exten.c in Sources */, + 0F9A8599CC77B1B3593C933287F71CF4 /* x_info.c in Sources */, + 9D962512A37339E1BD8661EDE31CB6CE /* x_name.c in Sources */, + 9969C4B92555CFF28B617ED820CD13C2 /* x_pkey.c in Sources */, + 3331F9D3CD97D4ABF7A72477FAD56190 /* x_pubkey.c in Sources */, + A1CCD34536E2FBA141073A9E38AB9E8F /* x_req.c in Sources */, + 7CA090B6F6B7E8C728E6047DC15BA363 /* x_sig.c in Sources */, + F83089FA4F9C7D3FA61C70314D68D24B /* x_spki.c in Sources */, + AFEAE48A9ADFC55A68D96FE731B0EED2 /* x_val.c in Sources */, + CA4C3D46B776972039067B6A947B84EE /* x_x509.c in Sources */, + A8F9BA477B422BA12CF6F72347C776DC /* x_x509a.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F974C1F644918E246E31B6FE249AA8A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9537815D96C614E16750DBD758245F01 /* accesslog.upb.c in Sources */, + E9A3F06D1C48A3C15919BDEAC0D02B79 /* address.upb.c in Sources */, + 86E95E3FE44FA0611A9AB7CDF44B3A9A /* ads.upb.c in Sources */, + BDBA1E6F7234F33ABE401B95AEB1333D /* aes_gcm.cc in Sources */, + 81FA65F3CEDC4AA2278544569A082409 /* alloc.cc in Sources */, + EDD088C6E584BB2EB6F21505E33FE486 /* alpn.cc in Sources */, + A3414C7E61885609CB1D91DB206BD4BB /* alts_counter.cc in Sources */, + 11DAA347A2BE49A5B6FE6A5E5C97F134 /* alts_credentials.cc in Sources */, + 0B7536BF3A1EC05D491FD4485A344D8A /* alts_crypter.cc in Sources */, + C63A987298943353A14177F2623850E0 /* alts_frame_protector.cc in Sources */, + F31987CB065D227AA4E2AD372F869FA4 /* alts_grpc_integrity_only_record_protocol.cc in Sources */, + 67980B9E9A5A0E47AC8FC35DA91E3B3A /* alts_grpc_privacy_integrity_record_protocol.cc in Sources */, + 69AD101584C6FFDD0556D6694AC55F95 /* alts_grpc_record_protocol_common.cc in Sources */, + 00DC961135CA10C87C82A0844CBDB4EE /* alts_handshaker_client.cc in Sources */, + 4AF6741F4D06CCF0F3E62C9DA940AB45 /* alts_iovec_record_protocol.cc in Sources */, + B8C3C1CD94E7C37862A967A869690FDF /* alts_record_protocol_crypter_common.cc in Sources */, + 2AF07C0495D31F1B40D82CD1AA05BE55 /* alts_seal_privacy_integrity_crypter.cc in Sources */, + D364BC8C1ED026B185CE2A1F7E1BC6C3 /* alts_security_connector.cc in Sources */, + 1FD00FE0F755D8D160568D8DF3C39FB1 /* alts_shared_resource.cc in Sources */, + 7EDED6D622C2FF811C3F8ED3712F6F57 /* alts_tsi_handshaker.cc in Sources */, + 1F913EE7E4A809C83D2E4C57C742C3FD /* alts_tsi_utils.cc in Sources */, + ACD9F822357956045F3976358C201A16 /* alts_unseal_privacy_integrity_crypter.cc in Sources */, + EDAE12E079E853620ED08D4F9DD3C1BD /* alts_zero_copy_grpc_protector.cc in Sources */, + C3A76C75343CAB039D9516076DE09425 /* altscontext.upb.c in Sources */, + 33DA9FCD1708BD796CCC11A72D4FF66A /* annotations.upb.c in Sources */, + BA272CE8F44F18F306C16C9E18EFEBBC /* any.upb.c in Sources */, + A1D6EED5E2FADBE233B53E2BB13BD934 /* api_listener.upb.c in Sources */, + 681D6C0D6992C5AB0C712FC73CD360D1 /* api_trace.cc in Sources */, + 9F5A357513A95419A8FC2620531D4963 /* arena.cc in Sources */, + CA718E5A5FE18D4223E24E11628BB088 /* atm.cc in Sources */, + CB1F8C2656255089D2A7F26671EF64C9 /* authority.cc in Sources */, + EFC7726CEFA70363BA69232579374B7B /* avl.cc in Sources */, + EEC1A36217D837C0E9BB09028DEDBA9F /* b64.cc in Sources */, + A81A300F9BFD0B4015B70C5B18C95B40 /* backend_metric.cc in Sources */, + 24C4903EC0F5E6507E30396CD96CD6D0 /* backoff.cc in Sources */, + 69A37004E81428D8EDF155DA76044E87 /* backup_poller.cc in Sources */, + 0DBF70DB4ECBCAE30514BA94AB007626 /* base.upb.c in Sources */, + 9EEFA072A2C57AE9AAF5F09F77A7DD51 /* basic_timers.cc in Sources */, + BA675415F798941AEDB7FFCE20771D01 /* bdp_estimator.cc in Sources */, + 60547A661A154414EC4CA34255566813 /* bin_decoder.cc in Sources */, + C65B94174750BD5782FABD2394EADB9A /* bin_encoder.cc in Sources */, + 3273C397AF8B25FEED1D31CA908917EC /* buffer_list.cc in Sources */, + 14291D3B71B17FE49A50B694261E5287 /* byte_buffer.cc in Sources */, + 52C516C98D86F87416FA3451D5982B0F /* byte_buffer_reader.cc in Sources */, + 316763940F5A8D9E781D6F9011C5C436 /* byte_stream.cc in Sources */, + B0BA279B164CB6F39F47F1454ABF0711 /* call.cc in Sources */, + 40BC9DC5D4726758155855661E943B27 /* call_combiner.cc in Sources */, + D237DC68AF9913186757245880243025 /* call_details.cc in Sources */, + 8CD1B6695B6D31D2059E607515A9E39D /* call_log_batch.cc in Sources */, + C9E77D99ACF65C69111349809B09C8B7 /* cds.cc in Sources */, + 8B2B06E8796735E1BE85B0D1F4746DE7 /* cds.upb.c in Sources */, + 2963EC341EFBAEFC94AB83C7892FBCC4 /* cert.upb.c in Sources */, + 64B801AFB9255FABCDD5D1EEC8F6C33F /* cfstream_handle.cc in Sources */, + 878F9572C5B8F2488E57BBA7B26884C7 /* channel.cc in Sources */, + 66F76139A11795F6CB61B1D96936FACB /* channel_args.cc in Sources */, + D0A8ACA28FE84DE09B93B3C70AD1D1F8 /* channel_connectivity.cc in Sources */, + 24ACBEA80EA087A4E2ECE72088F6CEC3 /* channel_create.cc in Sources */, + 619E9DDABFA6B55DD302B7728C0AD7C0 /* channel_create_posix.cc in Sources */, + 0F461C1E0235B13736A3FB236F457300 /* channel_init.cc in Sources */, + 0C027E62EBFB88751D664F5D95F819F8 /* channel_ping.cc in Sources */, + 5C90CE1C9780147DCADB5617CA4866D3 /* channel_stack.cc in Sources */, + 7BB82F28D08C22A1560D0D9EAB9CA7D6 /* channel_stack_builder.cc in Sources */, + E26A1884E90C6E6AFAE4F24E3776EFC1 /* channel_stack_type.cc in Sources */, + 2FA797299ACB54E81E196C359F6065A0 /* channel_trace.cc in Sources */, + 882D37D1178FC2D4D9AEA0D73FFF4DDF /* channelz.cc in Sources */, + FABF9C4C2CC47C088B49FD82E66CC7C8 /* channelz_registry.cc in Sources */, + FAEE6CFA8744B43E7453A4BA4BD916F3 /* check_gcp_environment.cc in Sources */, + 90D12A381194811E3A82D9914B5441D4 /* check_gcp_environment_linux.cc in Sources */, + 0EE2848582E26D736C6A00BB4BD899B8 /* check_gcp_environment_no_op.cc in Sources */, + B3E9C1BB5F3B5980E7C43BAD5C3279A8 /* check_gcp_environment_windows.cc in Sources */, + DAC70E1AE02E6D3A15856664D54F4EF8 /* child_policy_handler.cc in Sources */, + 3FE0A308CF6D68CC164FD054F9C74909 /* chttp2_connector.cc in Sources */, + 531188D74E715C66BFDC86B91566CC00 /* chttp2_plugin.cc in Sources */, + 459E0A2731227375C34F13D841DC5C35 /* chttp2_server.cc in Sources */, + 261F9E81C4E490BD596350C2A56B0045 /* chttp2_transport.cc in Sources */, + 9BACE85B158AC35F4C280D3892D29D0F /* circuit_breaker.upb.c in Sources */, + 1DA16669E71B64096D9BA5CA76BAB3EB /* client_auth_filter.cc in Sources */, + FEAFFC769FFDCDBB4B5165DB83B59497 /* client_authority_filter.cc in Sources */, + FEF7CC09EC3200E1AAD33C1590846549 /* client_channel.cc in Sources */, + A0780AE2D9172447C32C67C0619B5E8F /* client_channel_channelz.cc in Sources */, + BCDD04235A5769D8688678A6BCE513D3 /* client_channel_factory.cc in Sources */, + 5056C6777D583C5890A7A2FE8DD3B6FB /* client_channel_plugin.cc in Sources */, + 5A0AD7E84D108023E07BE07FFB5F7CBF /* client_idle_filter.cc in Sources */, + B2D0110BD3DB7109036424F72DF76E8C /* client_load_reporting_filter.cc in Sources */, + EAF9324CE77117A74B2E902A58F3501C /* cluster.upb.c in Sources */, + F309F45E8E19E728EECDE61A803AFBC2 /* combiner.cc in Sources */, + 35FE0F9A79EF9095CEC0D71E2CD0AF78 /* completion_queue.cc in Sources */, + 778EF51D5A94C9E0F69D539E164859ED /* completion_queue_factory.cc in Sources */, + 8A52C6482CCD66A25E6A272EF9147E20 /* composite_credentials.cc in Sources */, + 6B2004A15D72ACAF55AC5C37B61B20DD /* compression.cc in Sources */, + C80D5D1438EBE5A37FBDE0A152D5A951 /* compression_args.cc in Sources */, + F57A94B10374D86C0BB95BB1AF876302 /* compression_internal.cc in Sources */, + A024FFD9354E06825CE855527D8CA4C6 /* config_source.upb.c in Sources */, + 25A198E3709A8873BC847838F007F25E /* connected_channel.cc in Sources */, + 31F1F67B6F7C30FA9251383D0332E81A /* connectivity_state.cc in Sources */, + 9E28CBA3A3803CDE67BBB52DB843F9CC /* context_list.cc in Sources */, + BDB0FE074CA168CBE1E554D45D91AB70 /* cpu_iphone.cc in Sources */, + 0B6C585D7146629AD11E0FC9AB86DCB9 /* cpu_linux.cc in Sources */, + 67E09BA228DD1EAB0B3D3CE2F68EFF36 /* cpu_posix.cc in Sources */, + E58CDE5CD539835E9FB9A3E31D6308F9 /* cpu_windows.cc in Sources */, + 607F35EF402DFBD5D253FB946B218E40 /* credentials.cc in Sources */, + BA6D88D1907C41666FEDF4A71AC5BFDE /* credentials_generic.cc in Sources */, + 33F7AF9B51507A5FD0DB0C0660388D29 /* credentials_metadata.cc in Sources */, + 563F8BF7F2A27F5CFE91DE188DFF5DF4 /* custom_tag.upb.c in Sources */, + 9A63AC0B9DD330BDC868180BF35A2918 /* deadline_filter.cc in Sources */, + 6BB7419B2BD1A858A5C95B2819CA29A0 /* decode.c in Sources */, + D17BA0B593961DB7D11ADD46FD8D138C /* deprecation.upb.c in Sources */, + BDBF0C779D7E6C23988E8C0BC1B62D8F /* descriptor.upb.c in Sources */, + D33879C043D8E16BEA58D9B5CFD1F64E /* discovery.upb.c in Sources */, + B025905DAAC9A33331FA922C3DBC5430 /* dns_resolver.cc in Sources */, + 077DDF68BBF5B4B7DC6200D91B4AB9F6 /* dns_resolver_ares.cc in Sources */, + 4DE16D483BEA0E5189CA270FB9D7F664 /* dns_resolver_selection.cc in Sources */, + BC304255F3944B8899FC178ACC21FE59 /* duration.upb.c in Sources */, + 37728BA66ED3C42A45F8A74835C3B5AF /* eds.upb.c in Sources */, + C5C6833108CA4EC4EEB51B56D6223E9C /* empty.upb.c in Sources */, + 877BDBD2E5D9DFBF072DA7A41B20E29E /* encode.c in Sources */, + 276BBD9CC506B730D79E5A5B1882F15F /* endpoint.cc in Sources */, + 2B213051908095ADF524337C69981F08 /* endpoint.upb.c in Sources */, + 93120474B4042CEB2D75D5282E57DED4 /* endpoint.upb.c in Sources */, + B333C73F3ED585A8BF879C396E41B7AB /* endpoint_cfstream.cc in Sources */, + 267405D5A35E3A2DBDF955FDFA5F88CC /* endpoint_components.upb.c in Sources */, + D063E8C25C0ECC34CCF1776D354EE7B0 /* endpoint_pair_posix.cc in Sources */, + 466F0D443717A0BE766505B3C05457AB /* endpoint_pair_uv.cc in Sources */, + 41AED76458604EFEF5D51BFFBC3C6B26 /* endpoint_pair_windows.cc in Sources */, + 33EF4DC33C0CC28417479669AD80DE63 /* env_linux.cc in Sources */, + F388E58582671CF56A4C9C43BACAFCE1 /* env_posix.cc in Sources */, + 96C08EAD0DC76A5AAC9C6393297FF81B /* env_windows.cc in Sources */, + 0FD8FBC3D10C5C691D7641107141E082 /* error.cc in Sources */, + 279887BD19DCD172B3BC76F716BA06B8 /* error_cfstream.cc in Sources */, + 3BFEAFA3B2FAFF8F2FB5ECD68EEF5445 /* error_utils.cc in Sources */, + B6183B7566D1DB07B6AF059CFDA76874 /* ev_epoll1_linux.cc in Sources */, + 9320C084C2BD5B294C8BC57C3011434B /* ev_epollex_linux.cc in Sources */, + 32C62B8C76D02E28FBBD1BCEA955FC94 /* ev_poll_posix.cc in Sources */, + 88BBFD74AEE53A5E11CCFD2C0C404AC7 /* ev_posix.cc in Sources */, + AB13218AF2826B524A6A177DE7BC541C /* ev_windows.cc in Sources */, + 8CA189BFE86AAE0F818917F4FA31D06B /* event_string.cc in Sources */, + 7F3984D3A79EF1ACD90CC178E4B1264B /* eventmanager_libuv.cc in Sources */, + FFD3961B191C0B6AA28FC5165E056E8E /* exec_ctx.cc in Sources */, + E6EFEA1E56C38C5118368E525A099163 /* executor.cc in Sources */, + 0BAE793D92694F3E7E8500C3930C09B7 /* fake_credentials.cc in Sources */, + 4557E59D46BEB69469012FB217B5F7BE /* fake_resolver.cc in Sources */, + 0ED9C4D6D7FDEBF78BF69F36D4462A0C /* fake_security_connector.cc in Sources */, + ED376B02DEAFBB5048E8F801A660C634 /* fake_transport_security.cc in Sources */, + 34F4FB391AC3ABCF56F699AB45B2E0A4 /* filter.upb.c in Sources */, + 23D40F3C97EE2D4FA7279161EEDFCBB9 /* flow_control.cc in Sources */, + 6844D186440D6FB2F52A26EAD1785F4C /* fork.cc in Sources */, + 8D65E8F78A006CAF97EA016A3771017B /* fork_posix.cc in Sources */, + E7D5CF20F29BD7AD248E38347209EE14 /* fork_windows.cc in Sources */, + D27A7B5D8D0AD9A7606B547FB75F3AE0 /* format_request.cc in Sources */, + 69B2E509707800645A9071C5B3E5F315 /* frame_data.cc in Sources */, + 567CBD338305B4AC1409D1002F3EF8A4 /* frame_goaway.cc in Sources */, + 14518293F3265A6DF7F3242C47EC01EE /* frame_handler.cc in Sources */, + 83325445B2B8F1EE6392D2C82190C8D4 /* frame_ping.cc in Sources */, + 2CCEE7D2D81E80FDF236890D70111CC6 /* frame_rst_stream.cc in Sources */, + AB69C2E0BC1932F90F6197332EDD85B9 /* frame_settings.cc in Sources */, + 30C6D8C2AD23188639316B13336F72B6 /* frame_window_update.cc in Sources */, + B73BC9EBDCED4A86970381E825BD0232 /* gethostname_fallback.cc in Sources */, + C6138719E9C86BDB4A6B3EAC71F9E9E8 /* gethostname_host_name_max.cc in Sources */, + F9D25B737A056866ADA456161FE5BB48 /* gethostname_sysconf.cc in Sources */, + 4D807F6DC17B41A879F5791919B2C707 /* global_config_env.cc in Sources */, + EE54517444337CD9CD8327143E2ABE3B /* global_subchannel_pool.cc in Sources */, + E7DE413469BE4618699F0805C748702B /* gogo.upb.c in Sources */, + E4ED29B50B67D36D5AB54A7BE7AD96B5 /* google_default_credentials.cc in Sources */, + 1887B32B7F31A4240AE717C9502AD131 /* gRPC-Core-dummy.m in Sources */, + A09C28FD23BC7864E5485F35F5930C84 /* grpc_alts_credentials_client_options.cc in Sources */, + 6C71B7F70690F1F744A5FB433312B20C /* grpc_alts_credentials_options.cc in Sources */, + 739036EBEFBCA20D71CBAD9CCF0E601A /* grpc_alts_credentials_server_options.cc in Sources */, + 577D1D77424F1BC1BB2D779837DBFC81 /* grpc_ares_ev_driver.cc in Sources */, + B66482EA29D7976149BFEB6611116D7A /* grpc_ares_ev_driver_libuv.cc in Sources */, + 766A6DB33A5AC1DCCF4FDCCBB7E7942C /* grpc_ares_ev_driver_posix.cc in Sources */, + F6B7322A232C02ECD0090DE9D45E9155 /* grpc_ares_ev_driver_windows.cc in Sources */, + 4C6DE5E6A08FB2AC077BD88C874B73A3 /* grpc_ares_wrapper.cc in Sources */, + A37F77981D233062240A592988FD2E28 /* grpc_ares_wrapper_fallback.cc in Sources */, + AE4D97579B734D5804E2F29ED83817C6 /* grpc_ares_wrapper_libuv.cc in Sources */, + C0CEDE753B3DCE16BD4F87A43FE4A1AE /* grpc_ares_wrapper_posix.cc in Sources */, + FF1D25B6E2DD6DE29AF80D5271495D67 /* grpc_ares_wrapper_windows.cc in Sources */, + B331D2AA98BCF7A5D90AC13C3ECF80BD /* grpc_context.cc in Sources */, + 0C0EB50C2453FFD792F6F809354F64CC /* grpc_if_nametoindex_posix.cc in Sources */, + 36A8F1EE44929998362EFFC55A9569BF /* grpc_if_nametoindex_unsupported.cc in Sources */, + 882295C0212C67666C3A757029D3F52D /* grpc_plugin_registry.cc in Sources */, + 6D413E50E3F2F1F1760150567336DE38 /* grpc_service.upb.c in Sources */, + 1922A7278EE1CF86388B0E54E0AFA8A0 /* grpc_tls_credentials_options.cc in Sources */, + DD1138D0F02D4D7FED00D63B8413B147 /* grpclb.cc in Sources */, + AABAD661B1743224CD2DD305C824AACA /* grpclb_channel_secure.cc in Sources */, + 0F3FE2473EF988D27C927A57F12E64D5 /* grpclb_client_stats.cc in Sources */, + A4D55297E0B040C51313DED8F67F63F3 /* gsec.cc in Sources */, + FFD82DFF3C462D024DE38D94CDAB0AD0 /* handshaker.cc in Sources */, + 0CB831015CFEF2D75725DFB25604B3EF /* handshaker.upb.c in Sources */, + 084195340500A3037BB741B9250880D0 /* handshaker_registry.cc in Sources */, + F1D8BBB4E1B35736566EC02E92A00FDD /* health.upb.c in Sources */, + 67D65D377C51E935A315E343E50A8455 /* health_check.upb.c in Sources */, + 87172F84A215E3D6620372B12FDD3C2A /* health_check_client.cc in Sources */, + 1A5DB05A05D9FA5FD53F3A892A8FD665 /* host_port.cc in Sources */, + EDB1F642480E7C33DE8AE3C29649FCA9 /* hpack_encoder.cc in Sources */, + 358DC34DD070F91F853FEBE079C33601 /* hpack_parser.cc in Sources */, + A6C89C7E358F1720AACDAAA6F3575DB4 /* hpack_table.cc in Sources */, + CC19415B3694282A23D484C1CE259ABA /* http.upb.c in Sources */, + 73ED2D547B7B50C3934CCEC00CA6BC4E /* http.upb.c in Sources */, + FBFE04533DEF3403D7E9FA42C8EA622E /* http2_settings.cc in Sources */, + 3988BE879FC79E4A25790E9E98ECEBF9 /* http_client_filter.cc in Sources */, + 7124E5465B5031943910ED09334F0359 /* http_connect_handshaker.cc in Sources */, + 80F47170A9DFC6F004A2B3006DE0DD99 /* http_connection_manager.upb.c in Sources */, + 817ADDDCEFA2B1D3675509237B7CD359 /* http_filters_plugin.cc in Sources */, + 65BFD60551F83A4F7E02983C40B1BD85 /* http_proxy.cc in Sources */, + E03CFE790EA8C8F6C0E1AABCF7D3C19D /* http_server_filter.cc in Sources */, + B3E7BA92B641992E7FFD4D9489913150 /* http_uri.upb.c in Sources */, + DF1330B56927AD92BE5733AFB426F56C /* httpcli.cc in Sources */, + 26A09BE819733B2A95B7AC03685C57A8 /* httpcli_security_connector.cc in Sources */, + 3247D264FBD3B007E86E348DB44A18D2 /* huffsyms.cc in Sources */, + C22F0A828FA910DB024B6B4A6C620B2A /* iam_credentials.cc in Sources */, + 5CBC07F6B6A4049FCBE7D73F80E0E1D1 /* incoming_metadata.cc in Sources */, + 1C40FF0800197DD851BC73690FB3B155 /* init.cc in Sources */, + 2DB5AF65F5F6879A292F15FC7383F10F /* init_secure.cc in Sources */, + 4FAC95830CEC35241F661832EE390DCB /* inproc_plugin.cc in Sources */, + BB20EE5EF7916EE5ECC14140EE6EDD2C /* inproc_transport.cc in Sources */, + 4E1BBC03584C0E74B0FB95E4166ABB56 /* internal_errqueue.cc in Sources */, + 9AAEB3FB3ACA1F3DA5814744DDCA9A8A /* iocp_windows.cc in Sources */, + 4F4FB685AED6024984DBAEEA169DC25B /* iomgr.cc in Sources */, + 93289973E35405B67072D9B1253BD230 /* iomgr_custom.cc in Sources */, + 8777570CEE1826024C1B05997BF85161 /* iomgr_internal.cc in Sources */, + CC1F73E47C33719AE392DA13157872ED /* iomgr_posix.cc in Sources */, + C2F1C245ECD27B28B940C2D6A3A0B79D /* iomgr_posix_cfstream.cc in Sources */, + 0EA711A6F4AFEF86D3B77A0C93CE39A5 /* iomgr_uv.cc in Sources */, + 702A2D2A6C3CD5DAABF66A60962FA86D /* iomgr_windows.cc in Sources */, + 90AB240A7123E33DBBB9561F04F3C04A /* is_epollexclusive_available.cc in Sources */, + D2CE25007D387D1E402BE2D91420BB92 /* json_reader.cc in Sources */, + 22F0309EB4EC20504A5DF41DC6B12EFB /* json_token.cc in Sources */, + 0592FF179E2EB699FAE84B60740A2018 /* json_util.cc in Sources */, + 40915CC072FB7C334C4E367BD79BBC48 /* json_writer.cc in Sources */, + BD467EA95F22CE884A4C0F89529232C6 /* jwt_credentials.cc in Sources */, + 8786B21944FA22DFA3950C4EF284BEDE /* jwt_verifier.cc in Sources */, + 54CD0CD1816E2771F113C02028E83814 /* lame_client.cc in Sources */, + ED7D26B2E0BA88B68872F80FC457F87E /* lb_policy.cc in Sources */, + 79D06FDD64FCE32FA4DD024682FED0D6 /* lb_policy_registry.cc in Sources */, + EBC17E8FF19AD2E48EBBF97D5A415B02 /* lds.upb.c in Sources */, + 8283620C7E8BB4520EB18CD0600E862F /* listener.upb.c in Sources */, + 79CEB4B011713A51016D5AE06B1335BA /* listener.upb.c in Sources */, + 6DD3D81477A84A9366E9F70A2BFE46D8 /* listener_components.upb.c in Sources */, + DF0F89D40DEE322C4DA8783DA103509C /* load_balancer.upb.c in Sources */, + 6C205CA06DE739D6388521FEDA3F1944 /* load_balancer_api.cc in Sources */, + 7067771213368ABCBA22436C3A82ED6A /* load_file.cc in Sources */, + 0D5295321517AF70A14A6CD7C74E0F89 /* load_report.upb.c in Sources */, + 9D60AF1AD29B1D1D3C20BADF1BE89987 /* load_system_roots_fallback.cc in Sources */, + C699E0F7925C17F911BFE7EC8468B613 /* load_system_roots_linux.cc in Sources */, + 69B3861AD7B0AD484BA357BE6030E4A1 /* local_credentials.cc in Sources */, + 43AB7020C1FA1FEC7B83D87D1D4FFE05 /* local_security_connector.cc in Sources */, + 4A7D58A3129B5739596EE13523041826 /* local_subchannel_pool.cc in Sources */, + 0869F3360FE1212126C41A4044BB76EE /* local_transport_security.cc in Sources */, + 084C3CDA657B40774E0D0530B566E6D2 /* lockfree_event.cc in Sources */, + 434140CFFD299E1E6F060206FACCD9FD /* log.cc in Sources */, + 0502AD1FD24A2B71B0397D72E610F8E5 /* log_android.cc in Sources */, + 33CFDB88BCA15D19116C100D5C7746DE /* log_linux.cc in Sources */, + 09AD6C192AB65E341744FE0F4C3339E8 /* log_posix.cc in Sources */, + BA039CC760095C472ACEFFE867D7DB62 /* log_windows.cc in Sources */, + 5B98F935E12CD3899D1448AA25EF6481 /* lrs.upb.c in Sources */, + 606FE5ECF436814ED2206AFB35076948 /* max_age_filter.cc in Sources */, + D1579BD3B92BAAF55FD9C66336939F45 /* message_compress.cc in Sources */, + 3A6E586A86B13BE53D9024C7E60F4C7D /* message_compress_filter.cc in Sources */, + BB2D7D0B34C1C1C1F4B022F12DD724A2 /* message_size_filter.cc in Sources */, + 208BD72D3A2562115950EB01220A73FE /* metadata.cc in Sources */, + B5476F89687FFF9CDF1075B156723277 /* metadata.upb.c in Sources */, + 7BC0A40B730F24D69AF52D7629253909 /* metadata_array.cc in Sources */, + 3DC94D882D0CB731FC2CAC9C11AAFD6B /* metadata_batch.cc in Sources */, + F8899368EF6C4EAB93097B693F9E1A35 /* migrate.upb.c in Sources */, + 3D130AD66C64F6B49FA11D9A0296759F /* mpmcqueue.cc in Sources */, + 170DA69853D786E74E1CC8930F2FE65F /* mpscq.cc in Sources */, + 7099EBB89BEBBB4E2E2BB2A4B57CC0F1 /* msg.c in Sources */, + 36198CFEBC3D2AD5ABC0D7D9009C2478 /* murmur_hash.cc in Sources */, + 0A9E2933AC01DBD8118E562328EF39EE /* oauth2_credentials.cc in Sources */, + 0822409861EB4E68A45283E93AD864B3 /* orca_load_report.upb.c in Sources */, + D0F55762F1FE45FA7985DBA1512B9766 /* outlier_detection.upb.c in Sources */, + 32DE4654D603E618FAE6ADDFF2BDE540 /* parse_address.cc in Sources */, + 69F84EF76E2648A0DE573C04021E95C0 /* parser.cc in Sources */, + C089BD1A9349F8B6DD288A4E31580958 /* parsing.cc in Sources */, + 5FC4F24B1E42120B47D52E1AF4AD7060 /* percent.upb.c in Sources */, + 831A506FC16A2FC0EB011599A3D5C381 /* percent_encoding.cc in Sources */, + 5AEE4FEED212E72EBEED48C65C73665A /* pick_first.cc in Sources */, + CF38988E13B45F633DCAFECAE7ED6281 /* pid_controller.cc in Sources */, + 53140C3763EDFDFBB6AE1B17A0B34E33 /* plugin_credentials.cc in Sources */, + 26A7540FB4105C8D5E36ED2632E4B596 /* polling_entity.cc in Sources */, + 03F119702AE54E5CC10BA0E7876E4FEE /* pollset.cc in Sources */, + A4A2A96CB4624CAD1344EA36D8C4F788 /* pollset_custom.cc in Sources */, + 6096E65AB75BF6F254DA888E138D3C57 /* pollset_set.cc in Sources */, + F5CA15EF259DA0A10619A6D797C3581A /* pollset_set_custom.cc in Sources */, + FD694B54147C17441C8ADF8832823A2B /* pollset_set_windows.cc in Sources */, + C8727617E6B40546F0E829463B0DA1EC /* pollset_uv.cc in Sources */, + 18DCD8EA9725F74ABB54A8DABEB867E3 /* pollset_windows.cc in Sources */, + 7025CE66087A7042CB1A4B0F0DC9BACA /* port.c in Sources */, + 9DC014446B5D9A27CBC277F15951987B /* protocol.upb.c in Sources */, + 06EC7B391AC16A945BAC6D42A0784B5D /* proxy_mapper_registry.cc in Sources */, + B08CBE2D3048E1AD352546BB9E3B68A2 /* range.upb.c in Sources */, + 24FC5CB1475F726F8DF96BE6AA79EBDD /* rds.upb.c in Sources */, + FE0E691D9C4DB40AFCE892F8D1E84EA3 /* regex.upb.c in Sources */, + 32DE2F280F7C8A441591F8C80BD2B1B7 /* resolve_address.cc in Sources */, + A3938F6C97BF2E6BC921848799B63A0E /* resolve_address_custom.cc in Sources */, + 6D9E38209BC6215135D1C8A16E52E11C /* resolve_address_posix.cc in Sources */, + C6D90423BAD06D234E2533EF9D7057B2 /* resolve_address_windows.cc in Sources */, + C8500530FAFECC56E063A3FB024725F9 /* resolver.cc in Sources */, + 69DCFBC6C04CAFA0E1233147BB1638ED /* resolver_registry.cc in Sources */, + 12070AA5A3239ED9BABCFB59B10F2450 /* resolver_result_parsing.cc in Sources */, + 739DD9045B646B76A26B45F62AE03793 /* resolving_lb_policy.cc in Sources */, + 6A13CE5917E8A56B31D59D7F60C938A9 /* resource.upb.c in Sources */, + 6795F4C13F89E02486152D51D465CB27 /* resource_quota.cc in Sources */, + D5C504E089C47CA1CFACB9A314BCA2F4 /* retry_throttle.cc in Sources */, + 3202C111929BBD7B0A5CF0BB1F4F4515 /* round_robin.cc in Sources */, + B2D92AF8D27AD16C212BD192178C4CCE /* route.upb.c in Sources */, + 890FCC458E5573A32A246DBE8D4C59C8 /* route.upb.c in Sources */, + 7EC2FF0097E6368FF1C02D9A8E43B6BC /* route_components.upb.c in Sources */, + B3269023C7BAC8399F8AB4A847559388 /* scoped_route.upb.c in Sources */, + 77498D3B4E7E1FDD7377390DE4D23765 /* secure_channel_create.cc in Sources */, + 89782455D35A1D364D03FD4D9A856E0A /* secure_endpoint.cc in Sources */, + 41DAAEDC44271D007A5F9C6BBC18CDF1 /* security_connector.cc in Sources */, + C3A10D9B3ADB5800F28F4457B15CEC9C /* security_context.cc in Sources */, + C3AF6EBD1D1BD11A7420B92028CDD459 /* security_handshaker.cc in Sources */, + 9658CFF05B0D7B010A314ED108545ABF /* semantic_version.upb.c in Sources */, + BB7D6D998A22EB28661BC7449BE47F41 /* sensitive.upb.c in Sources */, + 6979E552990C61368668AE41E291BAA3 /* server.cc in Sources */, + 39BAF7C7F2E7B192906FDCDA4C35EB98 /* server_address.cc in Sources */, + 04183BA47E40DB853760C2F1D194696E /* server_auth_filter.cc in Sources */, + 38C9B60E3B75097E6E319B150790EA83 /* server_chttp2.cc in Sources */, + 32E05BC1320D26A3288F25DE0D4DD0CF /* server_chttp2_posix.cc in Sources */, + DF97084FA799BDFF880C03F0F1D64B16 /* server_secure_chttp2.cc in Sources */, + 5094C654F5B1A111DDE3627D7FBEB6F0 /* service_config.cc in Sources */, + 5484B1E5A3B8E1E60AEDA96079CF4DB6 /* slice.cc in Sources */, + 6205367D9A710FA2FE039EEB1A21A75F /* slice_buffer.cc in Sources */, + 42E8FCED36FFAE10F0EF006B09414968 /* slice_intern.cc in Sources */, + 4B2FF4DFC6D04238DC3D34CFCC7DDA23 /* slice_string_helpers.cc in Sources */, + 224B90D23F046893ED010DF351B1EA93 /* sockaddr_resolver.cc in Sources */, + F79B2DE31CDCF2F074EC512FF13F3832 /* sockaddr_utils.cc in Sources */, + AC99AE61DB9997006B565EC7742028B9 /* socket_factory_posix.cc in Sources */, + DBF0A900E75F07C299A55E90FFB69E51 /* socket_mutator.cc in Sources */, + 637823D4F91D0D91FF48F1BDA7951D53 /* socket_utils_common_posix.cc in Sources */, + 3242447311D97BF2618C0E8E85F890C9 /* socket_utils_linux.cc in Sources */, + 5D387B35519182BDE9C7227E82EC4C74 /* socket_utils_posix.cc in Sources */, + 1E946D985D3699B8A9878C4D01AF85C8 /* socket_utils_uv.cc in Sources */, + 1CC195052C961E210623623C3155067E /* socket_utils_windows.cc in Sources */, + E859667260530373D49E199FB3320A2D /* socket_windows.cc in Sources */, + 20A1B7E39BAC2E9FD46F2B84D3F5D521 /* srds.upb.c in Sources */, + C69D349D175898DFBBFD4B9090EFB01E /* ssl_credentials.cc in Sources */, + 89DD742A14E783BFCD8E5E100B472BD8 /* ssl_security_connector.cc in Sources */, + 43E717C6A660D12964B46F1DEDEAEFC8 /* ssl_session_boringssl.cc in Sources */, + 3A20C063411BEE823E8DD7C9BB2BC6A4 /* ssl_session_cache.cc in Sources */, + 378B8D73E75471A42132D43423ABFD47 /* ssl_session_openssl.cc in Sources */, + 39125AB67ABC6CA53FB5A1703FAB9C1C /* ssl_transport_security.cc in Sources */, + 626B0A2224B2DD1A54057BA079A2E268 /* ssl_utils.cc in Sources */, + F8BD0A62BC638BB64384C32D0F3F43FD /* ssl_utils_config.cc in Sources */, + C2A7E80D46DC9FBE70C55032500C3662 /* stap_timers.cc in Sources */, + 73E2E45E7DE8E40AB65817676974EFBB /* static_metadata.cc in Sources */, + 1B6725629C46262D7E5C162147B47562 /* stats.cc in Sources */, + 04EF2C16E892E898739FCC126ECC9D77 /* stats_data.cc in Sources */, + 59F25151D6DC083FDCA67D9188048D8A /* status.upb.c in Sources */, + DCB464AFC2702719823B1915CE874A23 /* status_conversion.cc in Sources */, + ADFE41A01F2DE34926A30298EDAF7EEE /* status_metadata.cc in Sources */, + 9A8C67BAF93D0177338F15FA63971C9F /* status_util.cc in Sources */, + FC28910287E6C1526492FB4BCE3E9A9B /* stream_compression.cc in Sources */, + F32C78B49659B436E1C216F250F8613C /* stream_compression_gzip.cc in Sources */, + 7B702C066D7329BF7930EF7772758442 /* stream_compression_identity.cc in Sources */, + 94EB9F8B4FB9805255E08E50916E10A8 /* stream_lists.cc in Sources */, + 0C9467C957D8B3A2C4D367082E0C9384 /* stream_map.cc in Sources */, + 4F55BB7998E559DD4C8894FC6020BD53 /* string.cc in Sources */, + F5EF90C821BB2F8059A4DB2017FDCAC9 /* string.upb.c in Sources */, + E40E89288004B66277463155D057828D /* string_posix.cc in Sources */, + B23110C6897DB4C6FC3CD30B8F95A2F4 /* string_util_windows.cc in Sources */, + 8CA28E093B36BF421131694B55D83587 /* string_windows.cc in Sources */, + 0E1D14759E148BA4DF96D7D7CB165C2E /* struct.upb.c in Sources */, + 70A834BA2A9E6F296B8065E89507953C /* subchannel.cc in Sources */, + 7F978434DB68DF7255F511B58B7D3346 /* subchannel_pool_interface.cc in Sources */, + B89DAF13984F489E9044BEFF812398DC /* sync.cc in Sources */, + 65F0719E0C1B0939C5114EE81ACF2636 /* sync_abseil.cc in Sources */, + E261E4CA25416B6A586357676715982B /* sync_posix.cc in Sources */, + 0EDA6930F2D29B47B0092683A02636FB /* sync_windows.cc in Sources */, + 5FBD8BE2B289C62D35EDB11D747319E8 /* table.c in Sources */, + 881A159625DB02171EC3451CDBE9412E /* target_authority_table.cc in Sources */, + 9AF1ECB2D12610A02A755390E8E9925C /* tcp_client.cc in Sources */, + 9A884A61F4023708596FC882B8C0B538 /* tcp_client_cfstream.cc in Sources */, + 9F7951804CE4A7F75178C54A8CEE47BE /* tcp_client_custom.cc in Sources */, + F7E56C673DB74E524515166644512E60 /* tcp_client_posix.cc in Sources */, + 5F1845D259EBAA13171E2BA6747849BB /* tcp_client_windows.cc in Sources */, + 2EC5665E75508394FF8EC5E5B5640D38 /* tcp_custom.cc in Sources */, + C5155242D83B350F3023481674469781 /* tcp_posix.cc in Sources */, + 813EC9A3B04FB93FA1B79172866C7C55 /* tcp_server.cc in Sources */, + E867C2F65D157CE55B75DD0116E304A5 /* tcp_server_custom.cc in Sources */, + E254213EE151942E9EDD5EB5D78826DD /* tcp_server_posix.cc in Sources */, + 0FAFB1328B96D6E62280BAC95D96A860 /* tcp_server_utils_posix_common.cc in Sources */, + 7D830CCF7526AE94E31725B11FD9408A /* tcp_server_utils_posix_ifaddrs.cc in Sources */, + 311DD0AEE8DB78D43D33B6A39DC7C569 /* tcp_server_utils_posix_noifaddrs.cc in Sources */, + 121F2849D32A0C2FF11CBF9125FEA2A6 /* tcp_server_windows.cc in Sources */, + D8AF50D46ED25A1BE8E0E5C84E6D600B /* tcp_uv.cc in Sources */, + 11889FB37270A650EDC4710DDF2E7A85 /* tcp_windows.cc in Sources */, + 0C5564DEEC202B9742EA4C0020F0D38A /* thd_posix.cc in Sources */, + B2492CC78BC817A72C599AA96941C142 /* thd_windows.cc in Sources */, + 7B8A817FEC75159E2922C1BAF99946FF /* threadpool.cc in Sources */, + 0921A73F672C9F34D0657CC1C4F12A28 /* time.cc in Sources */, + 136B11E991E7E9EFC143087302733B94 /* time_averaged_stats.cc in Sources */, + CD3D1591A03ACA117E5F587B94296FF8 /* time_posix.cc in Sources */, + DCE583BA3ECAC2CE2D849C7332600C70 /* time_precise.cc in Sources */, + 5D840DA9155416DA00A38E7F8809488E /* time_windows.cc in Sources */, + 2C6831B335D0AF3FA541F17AD0776F96 /* timeout_encoding.cc in Sources */, + 382D0D6C71AE59219DDAD4D735AC68A7 /* timer.cc in Sources */, + 7BE40C374CA5F9283CB269D5BD681B2F /* timer_custom.cc in Sources */, + 0F601243BDF3CD9CB10990AAC1AB9986 /* timer_generic.cc in Sources */, + 32FD3E0AD44BB01C2E2B1D3CB3D84157 /* timer_heap.cc in Sources */, + 073152C4D10575F28A7AAD6F8A291E5F /* timer_manager.cc in Sources */, + 1BB1CE7682527F1154A5EC5D4F9E773A /* timer_uv.cc in Sources */, + 3EAB768B686BBD59BA06637ED185FA4A /* timestamp.upb.c in Sources */, + 9DAB26504A7E3B1D23EE2D9CF998F645 /* tls_credentials.cc in Sources */, + 5E3E71C4490C27A657A8C0B4F56DE186 /* tls_pthread.cc in Sources */, + 8DB324C42D6A9DD7E3E0945E448C0639 /* tls_security_connector.cc in Sources */, + A986CCAB3A6C6BAE110289528B55C6A7 /* tmpfile_msys.cc in Sources */, + 38870D6A9BFB165C40FE2DEF16531A93 /* tmpfile_posix.cc in Sources */, + 09727B49E0081E9AE305F59866273C6C /* tmpfile_windows.cc in Sources */, + 07ACAAE4C01A2FD00AA81F2843B5CA8B /* trace.cc in Sources */, + D55F2904DD0795CC9F98BD633D0FB830 /* transport.cc in Sources */, + 9D16F36663EA4DB28DCE5A13FBA5A84E /* transport_op_string.cc in Sources */, + 1ACCBF6D0F4C86F5EC5561D7458E9ECD /* transport_security.cc in Sources */, + 8C41D113BF7DBBB5CCB63B31DAAD8BCF /* transport_security_common.upb.c in Sources */, + 0A94794BF812D29939B8FD075CED6461 /* transport_security_common_api.cc in Sources */, + A9B312799C6A8782413F1B4CFA6B8855 /* transport_security_grpc.cc in Sources */, + 978F225AC565026D7496CF1277F37228 /* tsi_error.cc in Sources */, + 0AEF1FE56AEB932722407485C77C8D44 /* udp_listener_config.upb.c in Sources */, + 2EF99D2C78FB14AE218774C9CF671DBF /* udp_server.cc in Sources */, + E5A2964C74FAC6F5CC3559772C8A4A59 /* unix_sockets_posix.cc in Sources */, + 702256CA2EF295A45918498BDD1669DF /* unix_sockets_posix_noop.cc in Sources */, + F3A3AF9F6C9CFD59064BD8E71967E3DC /* upb.c in Sources */, + 3AE5E1DA64A71EC38EA6D11A772B4165 /* uri_parser.cc in Sources */, + A3B7F6D26A4214A30FFB58EC8F6831BF /* validate.upb.c in Sources */, + 0AD92825CFCE728CA437CCF830B0EE7E /* validate_metadata.cc in Sources */, + 3A5921DC6787172CDCB3AB2DB0E144DE /* varint.cc in Sources */, + 65D4EBC3756D15863BDF44954FDEEB01 /* version.cc in Sources */, + 46137C6A44E178D25B1DDA97E7E06019 /* wakeup_fd_eventfd.cc in Sources */, + 821CE1F118096F0D1BFE755B3ECB661B /* wakeup_fd_nospecial.cc in Sources */, + 8E70FBD9FFF4A39F5D0297A70A22BB9B /* wakeup_fd_pipe.cc in Sources */, + AA32115DA4784A4C897DF7D358EB34EA /* wakeup_fd_posix.cc in Sources */, + 0BD01C703B3E9C953627A28C66CBADD2 /* work_serializer.cc in Sources */, + 689D8688B1B8109BDCA59A659E7AA07C /* workaround_cronet_compression_filter.cc in Sources */, + 19F6D0DEC76230AA2E8AB57C07C03CE2 /* workaround_utils.cc in Sources */, + C5C00F96547939BB886F2C01F32D0FF2 /* wrap_memcpy.cc in Sources */, + 7259B9A22E253751A5C377C6CC992E01 /* wrappers.upb.c in Sources */, + A09A4D0D4E3807017A9559C189E428B5 /* writing.cc in Sources */, + 6CC795B114FAF0EE8E8C89921D2256A7 /* xds.cc in Sources */, + 8E686CC2D24FBA9A06743D9A0BEAD58C /* xds_api.cc in Sources */, + 25BAF39559183759F31BCB5952261E58 /* xds_bootstrap.cc in Sources */, + 7BE14F33524867725BA902D698670748 /* xds_channel_secure.cc in Sources */, + C7682AB97CFD9B408F97638A7D615E46 /* xds_client.cc in Sources */, + 96C61A85F59201C832698246A30F956D /* xds_client_stats.cc in Sources */, + 290350F4E8537F7E1E9D3190D44BFB1A /* xds_resolver.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FCD3E76807736F00134DEE6D6C3791AD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8247C2F5A90B76653D898ADF80B8165 /* abseil-dummy.m in Sources */, + 34E89272E83D13C46BC8A310F60E69ED /* address_is_readable.cc in Sources */, + 90713B5B159353401E7E80F51907194C /* arg.cc in Sources */, + A3E3B1FFB514D4781DF29282C94C9D87 /* ascii.cc in Sources */, + F7AE761577F8C56B926FA5DD57455C8A /* bad_any_cast.cc in Sources */, + A9E82DF719E7B17BA827ECE610EC7FDE /* bad_optional_access.cc in Sources */, + 739A54740C24B3B7662A533FC08F4EB6 /* bad_variant_access.cc in Sources */, + 615CFD9FD73EA84FC24C2ABDEB605377 /* barrier.cc in Sources */, + 9637A684BC98E4E8248743AF684FD8AA /* bind.cc in Sources */, + 2462F2B3CD3E5FE957D8E4C1DCF588A3 /* blocking_counter.cc in Sources */, + 6AB4AC0BCC5A022C8A59EC079355F55A /* charconv.cc in Sources */, + 2A1206914D49C67FE0E9323C628F507D /* charconv_bigint.cc in Sources */, + 77791977F8BBA7E2C53288CDFBE579D4 /* charconv_parse.cc in Sources */, + BD4DDF3FD8561C36DAE13128B0B09C6F /* city.cc in Sources */, + CCE752BA3F602D64FF0A54D5D5AB6967 /* civil_time.cc in Sources */, + C6725F9D7BE7D51AEC35CD4D4A6ED89C /* civil_time_detail.cc in Sources */, + 43D39F9F646F8D520AA453132E43F4CB /* clock.cc in Sources */, + 53FAF68806D7C61C31F3D71C4E4D690C /* create_thread_identity.cc in Sources */, + DD015E2499685CFE94799EC05E32F949 /* cycleclock.cc in Sources */, + 37392FA30A2F9A3B9C0F009363875BD5 /* demangle.cc in Sources */, + 1489EF1C770409B58C86E93662A6E7FC /* duration.cc in Sources */, + 7EEBB82FF414A4D8B4DBEF2E067A299E /* dynamic_annotations.cc in Sources */, + 9673B0F5BB2FEF820398DF33FACFA7D3 /* elf_mem_image.cc in Sources */, + 28AF9EC27902FA528B9C7558CE5A7238 /* escaping.cc in Sources */, + 9D0601F98F1D9D836CED379B923B1BB4 /* escaping.cc in Sources */, + AD3986514226BB9A748658CC95EB6DF1 /* exponential_biased.cc in Sources */, + 8F20B924D15B7E916C026792393A522D /* extension.cc in Sources */, + C236D2B362B5DBB394EA93FE08753404 /* float_conversion.cc in Sources */, + 40430F60D34D42562375133EC6292D45 /* format.cc in Sources */, + 76E6447BA790475629A21756DC626A8E /* graphcycles.cc in Sources */, + A9AF1EDAB79400DDF0A45E8E96103748 /* hash.cc in Sources */, + 17DA4AD0608DE08300A8C7125E6B7C04 /* hashtablez_sampler.cc in Sources */, + 7A4095E6C49A9A7BFD5ABDFA0CCDAE91 /* hashtablez_sampler_force_weak_definition.cc in Sources */, + C1B5D6A1AF7A98488C36FE2F3FB64FC3 /* int128.cc in Sources */, + 761543FE8FA42FB9DF694E65E7FCA2C8 /* log_severity.cc in Sources */, + C358A85CD411B4F4A8EF6E74605703B5 /* low_level_alloc.cc in Sources */, + 6BEE9A99E47B1E62937DD8E0479EF4E4 /* match.cc in Sources */, + AF9F55D8F46C6B07E2A348210E245FC2 /* memutil.cc in Sources */, + 852794B7D83E609B23A128EE36E5D781 /* mutex.cc in Sources */, + B1B073B950F8F342471985EDE8EEA56E /* notification.cc in Sources */, + DB14A87BCB9DA924353FCDA6986FF906 /* numbers.cc in Sources */, + 5BDEF580602F3D6EB3E678CBD072A83A /* ostringstream.cc in Sources */, + A7028C087A209500B08830CFBCEBA46B /* output.cc in Sources */, + D200C36CD28F2EDA344F65AA5665F0FE /* parser.cc in Sources */, + 03E41B74981FDE709A55052C602EB77B /* per_thread_sem.cc in Sources */, + 2D7A13CCAE2C8774DA577D26446C5A4A /* periodic_sampler.cc in Sources */, + 8C3E7F4B4350E5965642E5ADA1701F26 /* raw_hash_set.cc in Sources */, + 76F8D3CAF07CB8358D084102E0737355 /* raw_logging.cc in Sources */, + FF4A6354D8956C48630ED4972EF76366 /* spinlock.cc in Sources */, + 8E1B1A053C5C4D65F90E5493D89E6E68 /* spinlock_wait.cc in Sources */, + 77432780953794841D94AA937E407F1E /* stacktrace.cc in Sources */, + FC30F61C4E624330240E488C9F7EF80C /* str_cat.cc in Sources */, + 60222597786A9D66D8F4BE2C171DC912 /* str_replace.cc in Sources */, + 01257D37008254514A197393A3003432 /* str_split.cc in Sources */, + E458F1E5A1C3F2DC6F8B12D611A7F2B3 /* string_view.cc in Sources */, + 2CA0E1A18360D996FC0276FEBD093FF7 /* substitute.cc in Sources */, + D85A2FF10AD8CF9702BEEF4C8F3A0963 /* symbolize.cc in Sources */, + ED3A19F9522394D521679C6724C38EC3 /* sysinfo.cc in Sources */, + 5F600550F5A922DC9E374AA08206E19E /* thread_identity.cc in Sources */, + 6AAFD3356BBE23913825AF9F8580A251 /* throw_delegate.cc in Sources */, + E9163BA19244AB46AC8DC2869A3F9D39 /* time.cc in Sources */, + C69435C5DA5AF0D7F317AF0712A0D9B6 /* time_zone_fixed.cc in Sources */, + 15843EB8B1D028BF279822980A483858 /* time_zone_format.cc in Sources */, + D365D88E7502E1126A0080BCDD0E68B4 /* time_zone_if.cc in Sources */, + D4E6CFD0026C098FD02683642361E9DC /* time_zone_impl.cc in Sources */, + 42B24E3D13E81B0677CC010115A79C42 /* time_zone_info.cc in Sources */, + 53965D6F9EB25A4800384E5B36C4CE77 /* time_zone_libc.cc in Sources */, + A0637DF3999A681E5C8C545B9DB55305 /* time_zone_lookup.cc in Sources */, + 8F586A6306D531E37D2F8D32443F1DCB /* time_zone_posix.cc in Sources */, + 79FE3D77E6A565964709C1FE74311C62 /* unscaledcycleclock.cc in Sources */, + E5A40C3C5D63F61F99033CD8B84A5A57 /* utf8.cc in Sources */, + 493C417F91CCE6D7EFABFBE7901E6C46 /* vdso_support.cc in Sources */, + C5604AC4550CDF1C94DDEDBBF9C44712 /* waiter.cc in Sources */, + 3B2140184AEEF2FAEE26F0C40D060E67 /* zone_info_source.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1CF5D6A26C6B6D7FF9EB00B9C59BDB5A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "gRPC-Core"; + target = 50F380A87A4FC4EC7EE3AC9BDADB6D2D /* gRPC-Core */; + targetProxy = 6C285E1D5D9574F05EC63DC11BEA2DD4 /* PBXContainerItemProxy */; + }; + 242930ADDE616330C15E84ACC6E4A1EE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCoreDiagnostics; + target = 620E05868772C10B4920DC7E324F2C87 /* FirebaseCoreDiagnostics */; + targetProxy = DA989B08A7D2075770395897BE284EA4 /* PBXContainerItemProxy */; + }; + 33C41DBA28BE1C70E2B021A11E80E4FE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromisesObjC; + target = 2BBF7206D7FAC92C82A042A99C4A98F8 /* PromisesObjC */; + targetProxy = 0E597CA01430DCA2C171727E4AEB9408 /* PBXContainerItemProxy */; + }; + 37EDC9A6283E9E7ACE3C9E943BD52023 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "leveldb-library"; + target = 9307B7A119490930CF70393AB529AAC1 /* leveldb-library */; + targetProxy = BA667624F034FCBD3256C66FE3CCFBD3 /* PBXContainerItemProxy */; + }; + 444895DB2E81857B8E894B22AB1FCE3F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleUtilities; + target = 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */; + targetProxy = 5DE929F0B66DE0269B1E9BEC80D63355 /* PBXContainerItemProxy */; + }; + 4449D80DC226276DA271457933D4E31C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCore; + target = 4402AFF83DBDC4DD07E198685FDC2DF2 /* FirebaseCore */; + targetProxy = 586D0D5A93ADABC89A26BEF0F4B96066 /* PBXContainerItemProxy */; + }; + 4A82F20C8154A8C11A6C1AFD9699A0AB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */; + targetProxy = 30E706C0E7F62B76BFB5FA3CD165247A /* PBXContainerItemProxy */; + }; + 4C376FF9C75E9ECD715435D9FB38B274 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = abseil; + target = 73CDC3D182DB953135F62609681B443D /* abseil */; + targetProxy = 46820728F8F9772E54D5AD037506BEFB /* PBXContainerItemProxy */; + }; + 4E28F261AE84116236D0FFB6AB6B1571 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Firebase; + target = 072CEA044D2EF26F03496D5996BBF59F /* Firebase */; + targetProxy = C01F8993C7B91DC3F65B46976B9DB1E3 /* PBXContainerItemProxy */; + }; + 54D3A4D29872369EC7B05E500D375C2D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = abseil; + target = 73CDC3D182DB953135F62609681B443D /* abseil */; + targetProxy = A84EAB6D657119E4BD88C2B18F3F7531 /* PBXContainerItemProxy */; + }; + 6F7F4206D98C7E13DDD1E45C371FAA1E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleUtilities; + target = 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */; + targetProxy = 93C8AE5C520E061DC3BEDEDC929BA7D7 /* PBXContainerItemProxy */; + }; + 72AA7F4B0BEECFCE426B6F427C0F2DBF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */; + targetProxy = 50B58B426D5D9F69E743256B82BBE0C4 /* PBXContainerItemProxy */; + }; + 7BE7C7BF611BF38A7105D933C0304992 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = abseil; + target = 73CDC3D182DB953135F62609681B443D /* abseil */; + targetProxy = 63CDB901F4AF5FFFEE1C6FCEF5F73416 /* PBXContainerItemProxy */; + }; + 8058AD8AF8F1832A1A863B6382C6D3DE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCore; + target = 4402AFF83DBDC4DD07E198685FDC2DF2 /* FirebaseCore */; + targetProxy = 3587BFB719FFC4A252A044E469E40908 /* PBXContainerItemProxy */; + }; + 87F03EC96C443D07A390B9525BF2A5EA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "gRPC-Core"; + target = 50F380A87A4FC4EC7EE3AC9BDADB6D2D /* gRPC-Core */; + targetProxy = E5071D801B3147DE9C084592C9F2F972 /* PBXContainerItemProxy */; + }; + 941FFA1DE1D7B33E49E3F1FD3FAD5066 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleUtilities; + target = 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */; + targetProxy = 50E646A27F830592C72D9F9A184CE7E6 /* PBXContainerItemProxy */; + }; + AD5584EBC262E9B5B8B057C1D2EF5457 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "leveldb-library"; + target = 9307B7A119490930CF70393AB529AAC1 /* leveldb-library */; + targetProxy = A409A9163BDCAE9C2E153AABBB4ADC78 /* PBXContainerItemProxy */; + }; + AD59CD9506B81B300D4C2F556996F1EA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleDataTransport; + target = 5C0371EE948D0357B8EE0E34ABB44BF0 /* GoogleDataTransport */; + targetProxy = 011265689CC15157E55A52A984D5A262 /* PBXContainerItemProxy */; + }; + AEFFA6302B943CDC17A69C07E344DEE9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */; + targetProxy = 90B298FCBDD34E55B0F315A0CA164E81 /* PBXContainerItemProxy */; + }; + B07A433F8F3232ABF8D074F0A8A03366 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = abseil; + target = 73CDC3D182DB953135F62609681B443D /* abseil */; + targetProxy = C69728CAC1E142F8375626D3D15897EC /* PBXContainerItemProxy */; + }; + BCC434A6D1A9EB6F65DD20EB311E1436 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "BoringSSL-GRPC"; + target = 445FD4CB16BB7BEE2D1C404951CDE14A /* BoringSSL-GRPC */; + targetProxy = FB1DB4F427C6D1B15E4B952ED0FA170C /* PBXContainerItemProxy */; + }; + CAA4668DB294DFFBE51D6E88A8BCC6F2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleDataTransport; + target = 5C0371EE948D0357B8EE0E34ABB44BF0 /* GoogleDataTransport */; + targetProxy = 71015D5527865E0214ADD3C445D0D08F /* PBXContainerItemProxy */; + }; + CE838D5E8D0C2C8735CC511006397AD9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "gRPC-C++"; + target = 1C5E43B0A9555E7C2E43A6D7C8A23CF6 /* gRPC-C++ */; + targetProxy = 84F1B2AB15BA5CE01EC930DB06D4BF4B /* PBXContainerItemProxy */; + }; + D15DEB242A3E55B249CEFE96EC77A3F4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseFirestore; + target = DBA2B63E3A5FE83FE89E731664C9269F /* FirebaseFirestore */; + targetProxy = FC2E194AC2AFB3A0768AECB8174C88FE /* PBXContainerItemProxy */; + }; + D17BC85203192F5137EFE1A3F1A17F4D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "gRPC-C++-gRPCCertificates-Cpp"; + target = 3B8CAC3956E59F928387D0C6310E3B37 /* gRPC-C++-gRPCCertificates-Cpp */; + targetProxy = 786D6746790E20F6415EC0F34A65A74E /* PBXContainerItemProxy */; + }; + D300A2B4EC450FF3D2231DBDD212AD4A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromisesObjC; + target = 2BBF7206D7FAC92C82A042A99C4A98F8 /* PromisesObjC */; + targetProxy = FE5E95847CBCE98B97C5B10A0C9C2F33 /* PBXContainerItemProxy */; + }; + DA3B5FBCDD5F015D726EFE7F84592BF9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromisesObjC; + target = 2BBF7206D7FAC92C82A042A99C4A98F8 /* PromisesObjC */; + targetProxy = E76FEC2E4B79FA1C85E004A4DD977874 /* PBXContainerItemProxy */; + }; + DACED389B3B165154951685BC573B7EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = D2B5E7DCCBBFB32341D857D01211A1A3 /* nanopb */; + targetProxy = B6103199347F0CE079F628D428440A0A /* PBXContainerItemProxy */; + }; + E00610F2114A9332FE248DA1F5CFC0E3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCore; + target = 4402AFF83DBDC4DD07E198685FDC2DF2 /* FirebaseCore */; + targetProxy = 168976978B13F01663DCF5709AFFBB3A /* PBXContainerItemProxy */; + }; + E130AB14137AE747F91AEEB6D5B6F114 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "BoringSSL-GRPC"; + target = 445FD4CB16BB7BEE2D1C404951CDE14A /* BoringSSL-GRPC */; + targetProxy = 4010A702EBD85D4A3FFB605858D09CB0 /* PBXContainerItemProxy */; + }; + E200126568B1970AC5423AC75C8B3AC1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleUtilities; + target = 8D7F5D5DD528D21A72DC87ADA5B12E2D /* GoogleUtilities */; + targetProxy = DB251FBD300E9E528C47291557D42FAB /* PBXContainerItemProxy */; + }; + E23CE57654F779069C84588B7807C531 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCoreDiagnostics; + target = 620E05868772C10B4920DC7E324F2C87 /* FirebaseCoreDiagnostics */; + targetProxy = 3B350CDA33A71A29671C5AAE244D6B32 /* PBXContainerItemProxy */; + }; + F26A7EF96425D9963F2CCDA3D69D7154 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseFirestore; + target = DBA2B63E3A5FE83FE89E731664C9269F /* FirebaseFirestore */; + targetProxy = 61A4A2373A6615C79EE677E5388CADA9 /* PBXContainerItemProxy */; + }; + FB8B73A7BACD1F9498F6BA52150DF4FF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "gRPC-C++"; + target = 1C5E43B0A9555E7C2E43A6D7C8A23CF6 /* gRPC-C++ */; + targetProxy = D184F31DDF034BDB481D4A1FDFDD9F3A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 022B6203DB54B39FC17042032AE7B7AB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 67A3D205B05871CBA8CDE98108A56AF8 /* gRPC-C++.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/gRPC-C++/gRPC-C++-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/gRPC-C++/gRPC-C++-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/gRPC-C++/gRPC-C++.modulemap"; + PRODUCT_MODULE_NAME = grpcpp; + PRODUCT_NAME = grpcpp; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 09376007858C180832D5648E04D82615 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4EEFEACB2009276482A111DA74E51FBE /* abseil.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/abseil/abseil-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/abseil/abseil-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/abseil/abseil.modulemap"; + PRODUCT_MODULE_NAME = absl; + PRODUCT_NAME = absl; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 0EE8E53A0E3F0F8A83265198BBDD23F5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7C9C024C5645D13D545A3DE06DB6CEB5 /* abseil.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/abseil/abseil-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/abseil/abseil-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/abseil/abseil.modulemap"; + PRODUCT_MODULE_NAME = absl; + PRODUCT_NAME = absl; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 110E49F2EE9DBBAA2ACFD9A908AE7C69 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D6A83C6D09A90628B7283F3B9B07679 /* Firebase.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_OBJC_WEAK = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 1AEF1226F6865683623F873C30825A92 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 595FA36719EBBEB254EF8CB5A5417DF6 /* FirebaseCoreDiagnostics.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCoreDiagnostics; + PRODUCT_NAME = FirebaseCoreDiagnostics; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 21367B43AC8676AC121E1C3796660C92 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A1B872FA9156271AA33449423B5AF30D /* gRPC-Core.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/gRPC-Core/gRPC-Core-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/gRPC-Core/gRPC-Core-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/gRPC-Core/gRPC-Core.modulemap"; + PRODUCT_MODULE_NAME = grpc; + PRODUCT_NAME = grpc; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 29EED869E96D34B7D69D193BF8804D0C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 59F75AF17377ECCE99C3B2A941C6000B /* GoogleUtilities.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/GoogleUtilities/GoogleUtilities-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/GoogleUtilities/GoogleUtilities.modulemap"; + PRODUCT_MODULE_NAME = GoogleUtilities; + PRODUCT_NAME = GoogleUtilities; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2DD48BB5CA382A9AD25ECAAA03E39F56 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A79B3210FDF394229768AED58FAEECBB /* BoringSSL-GRPC.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.modulemap"; + PRODUCT_MODULE_NAME = openssl_grpc; + PRODUCT_NAME = openssl_grpc; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 341FC7C7CA8F780F2766D53DC1C3B2EB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6DC72CD345336EAF4EB59FE7F08DB0FB /* nanopb.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/nanopb/nanopb-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/nanopb/nanopb.modulemap"; + PRODUCT_MODULE_NAME = nanopb; + PRODUCT_NAME = nanopb; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 413E9997E524C69DBC64D4085B59691E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7E45E0505735AA32522C1F2F67FFAB0A /* Pods-SaraAttended.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CLANG_ENABLE_OBJC_WEAK = NO; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SaraAttended/Pods-SaraAttended-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SaraAttended/Pods-SaraAttended.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 4BC7450F9457737EE3E637BA155B56F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 50CBB32078198D82808EAC0411E363FB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DD71B32B40DD93411ED7C8A55A8D6D34 /* PromisesObjC.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/PromisesObjC/PromisesObjC-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/PromisesObjC/PromisesObjC.modulemap"; + PRODUCT_MODULE_NAME = FBLPromises; + PRODUCT_NAME = FBLPromises; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 646432F000819F3D15A8E26589150306 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5E08D3E6EEA1333970EB56302AF3E883 /* BoringSSL-GRPC.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.modulemap"; + PRODUCT_MODULE_NAME = openssl_grpc; + PRODUCT_NAME = openssl_grpc; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 69049650E0290C600D16EA6A23444239 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0038A2ECB3F315B264D2ABE627F3C1D3 /* FirebaseCore.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseCore/FirebaseCore-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseCore/FirebaseCore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCore; + PRODUCT_NAME = FirebaseCore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 72CA4F7F8CC847455928694397BB7F42 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 88A6C8E4489828DA24B200A2703AC586 /* FirebaseFirestore.release.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseFirestore/FirebaseFirestore-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseFirestore/FirebaseFirestore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseFirestore; + PRODUCT_NAME = FirebaseFirestore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 7A7C4DF7FDF52F7E14698D0F675CEFC0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BA277D1A72D65DC13D7BEC2924E49626 /* FirebaseCoreDiagnostics.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCoreDiagnostics; + PRODUCT_NAME = FirebaseCoreDiagnostics; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 833377534369F39AEAC29C9BEF4B5A10 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0FE48DF0A2F4C90F906E56124F2D5A83 /* GoogleDataTransport.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/GoogleDataTransport/GoogleDataTransport-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/GoogleDataTransport/GoogleDataTransport.modulemap"; + PRODUCT_MODULE_NAME = GoogleDataTransport; + PRODUCT_NAME = GoogleDataTransport; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 837A8F3E40649DF2C1F8EFE63CE93195 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1B16F4B125D18F293A44B3AB7E50F0FE /* gRPC-Core.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/gRPC-Core/gRPC-Core-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/gRPC-Core/gRPC-Core-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/gRPC-Core/gRPC-Core.modulemap"; + PRODUCT_MODULE_NAME = grpc; + PRODUCT_NAME = grpc; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 8B5A46FF8D3C1289CDEE3BAFACABCD2A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + 9B9C4B860FDE61376103DA7E94D5429D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C5AB43C7FCCBEFB3E67FA4E22874F40 /* GoogleUtilities.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/GoogleUtilities/GoogleUtilities-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/GoogleUtilities/GoogleUtilities.modulemap"; + PRODUCT_MODULE_NAME = GoogleUtilities; + PRODUCT_NAME = GoogleUtilities; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A53D530D0C7DA403A5545A6E3DE11BBF /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1A6F7D1BC95FD2032D74AA5AEB6D78BC /* gRPC-C++.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/gRPC-C++/gRPC-C++-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/gRPC-C++/gRPC-C++-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/gRPC-C++/gRPC-C++.modulemap"; + PRODUCT_MODULE_NAME = grpcpp; + PRODUCT_NAME = grpcpp; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C26EA7F99784C6A310C97F3F29BFCED6 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 67A3D205B05871CBA8CDE98108A56AF8 /* gRPC-C++.release.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/gRPC-C++"; + IBSC_MODULE = grpcpp; + INFOPLIST_FILE = "Target Support Files/gRPC-C++/ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = "gRPCCertificates-Cpp"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + C3C5C44EDC3D2C830494856FA788F213 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CB471F5CF9763A5337E2D9D7E5ED8130 /* FirebaseFirestore.debug.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseFirestore/FirebaseFirestore-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseFirestore/FirebaseFirestore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseFirestore; + PRODUCT_NAME = FirebaseFirestore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + DCF2F75CA5BCCDE02DA6B02F582B173F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 66628993B3498B56A57E3D4494D15D14 /* nanopb.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/nanopb/nanopb-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/nanopb/nanopb.modulemap"; + PRODUCT_MODULE_NAME = nanopb; + PRODUCT_NAME = nanopb; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + DDC05B6D0F952DB50DB083A8DF74D474 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1A6F7D1BC95FD2032D74AA5AEB6D78BC /* gRPC-C++.debug.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/gRPC-C++"; + IBSC_MODULE = grpcpp; + INFOPLIST_FILE = "Target Support Files/gRPC-C++/ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = "gRPCCertificates-Cpp"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + E0A2F8A63F06B72F1CCB02B69E61DE39 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 289CCF46E257E176674DC3FF398AF3E5 /* leveldb-library.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/leveldb-library/leveldb-library-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/leveldb-library/leveldb-library-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/leveldb-library/leveldb-library.modulemap"; + PRODUCT_MODULE_NAME = leveldb; + PRODUCT_NAME = leveldb; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + E4974F107479E8693A9127DB2E9C0389 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EEB12961B525825CEE242B485D541413 /* PromisesObjC.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/PromisesObjC/PromisesObjC-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/PromisesObjC/PromisesObjC.modulemap"; + PRODUCT_MODULE_NAME = FBLPromises; + PRODUCT_NAME = FBLPromises; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + EB1221C3CED12C0668D92130FB3B10CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3A7AC2793067554108FB0C965A401C84 /* GoogleDataTransport.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/GoogleDataTransport/GoogleDataTransport-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/GoogleDataTransport/GoogleDataTransport.modulemap"; + PRODUCT_MODULE_NAME = GoogleDataTransport; + PRODUCT_NAME = GoogleDataTransport; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + EB928C8FD12D193B4EBE9804A342BF10 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4C7412EC9D0EE1569D8FB28942FB7014 /* FirebaseCore.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/FirebaseCore/FirebaseCore-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/FirebaseCore/FirebaseCore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCore; + PRODUCT_NAME = FirebaseCore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + ED0C28A28FAA3DE0F348DADD1D5E98EE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 67B06532914C1BCA15ADF300B57ABB9A /* Firebase.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_OBJC_WEAK = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F6C982B5C2CBF6291CAA44FF73D3B4BA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4B77BFF7B034F5885E2CC44FA47184D /* leveldb-library.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/leveldb-library/leveldb-library-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/leveldb-library/leveldb-library-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/leveldb-library/leveldb-library.modulemap"; + PRODUCT_MODULE_NAME = leveldb; + PRODUCT_NAME = leveldb; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + FC0F604976442A9258552DA4D95209DA /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E525708B637223AE22E830FE9836A5ED /* Pods-SaraAttended.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CLANG_ENABLE_OBJC_WEAK = NO; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SaraAttended/Pods-SaraAttended-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SaraAttended/Pods-SaraAttended.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0DD487BFDC576ABA80D43449B9CF0685 /* Build configuration list for PBXNativeTarget "leveldb-library" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E0A2F8A63F06B72F1CCB02B69E61DE39 /* Debug */, + F6C982B5C2CBF6291CAA44FF73D3B4BA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4BC7450F9457737EE3E637BA155B56F7 /* Debug */, + 8B5A46FF8D3C1289CDEE3BAFACABCD2A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4E38AC5A4DE192681466F28A5390A3F9 /* Build configuration list for PBXAggregateTarget "Firebase" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED0C28A28FAA3DE0F348DADD1D5E98EE /* Debug */, + 110E49F2EE9DBBAA2ACFD9A908AE7C69 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 51CA6E3B99F02D04242A492F54A06288 /* Build configuration list for PBXNativeTarget "nanopb" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 341FC7C7CA8F780F2766D53DC1C3B2EB /* Debug */, + DCF2F75CA5BCCDE02DA6B02F582B173F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 56554ABBABE81D2AC13B694DE35721D3 /* Build configuration list for PBXNativeTarget "GoogleDataTransport" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 833377534369F39AEAC29C9BEF4B5A10 /* Debug */, + EB1221C3CED12C0668D92130FB3B10CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5BE720CF8575FB8ABCE3277D74FF48A3 /* Build configuration list for PBXNativeTarget "GoogleUtilities" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9B9C4B860FDE61376103DA7E94D5429D /* Debug */, + 29EED869E96D34B7D69D193BF8804D0C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6A38BB905EA0C97D0E5999B20E06B0B3 /* Build configuration list for PBXNativeTarget "FirebaseFirestore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3C5C44EDC3D2C830494856FA788F213 /* Debug */, + 72CA4F7F8CC847455928694397BB7F42 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6B918C5EC31216F43A6B64C1DB751CAD /* Build configuration list for PBXNativeTarget "gRPC-C++-gRPCCertificates-Cpp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DDC05B6D0F952DB50DB083A8DF74D474 /* Debug */, + C26EA7F99784C6A310C97F3F29BFCED6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84E9E2B55065E4567479B8E93895E505 /* Build configuration list for PBXNativeTarget "gRPC-Core" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 837A8F3E40649DF2C1F8EFE63CE93195 /* Debug */, + 21367B43AC8676AC121E1C3796660C92 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 859BFB5CC122E32358167B58D4660B10 /* Build configuration list for PBXNativeTarget "Pods-SaraAttended" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FC0F604976442A9258552DA4D95209DA /* Debug */, + 413E9997E524C69DBC64D4085B59691E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 87B4A9F5CC0702CA2B8D8E5A6B18B90B /* Build configuration list for PBXNativeTarget "gRPC-C++" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A53D530D0C7DA403A5545A6E3DE11BBF /* Debug */, + 022B6203DB54B39FC17042032AE7B7AB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8C9740BA76AF3B8C9751F600628218F9 /* Build configuration list for PBXNativeTarget "FirebaseCore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69049650E0290C600D16EA6A23444239 /* Debug */, + EB928C8FD12D193B4EBE9804A342BF10 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C5F8E10645F265DE2D10691BFC9A6E16 /* Build configuration list for PBXNativeTarget "FirebaseCoreDiagnostics" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1AEF1226F6865683623F873C30825A92 /* Debug */, + 7A7C4DF7FDF52F7E14698D0F675CEFC0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E6B2D3186238DEDE13E81B334302AE32 /* Build configuration list for PBXNativeTarget "BoringSSL-GRPC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 646432F000819F3D15A8E26589150306 /* Debug */, + 2DD48BB5CA382A9AD25ECAAA03E39F56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EA69D44C8DC4056CBA2FD7F241B939CD /* Build configuration list for PBXNativeTarget "PromisesObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4974F107479E8693A9127DB2E9C0389 /* Debug */, + 50CBB32078198D82808EAC0411E363FB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F09FBDA6DC3D29DACC253BA8C7F4E04C /* Build configuration list for PBXNativeTarget "abseil" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0EE8E53A0E3F0F8A83265198BBDD23F5 /* Debug */, + 09376007858C180832D5648E04D82615 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; +} diff --git a/SaraAttended/Pods/PromisesObjC/LICENSE b/SaraAttended/Pods/PromisesObjC/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/LICENSE @@ -0,0 +1,202 @@ + + 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/SaraAttended/Pods/PromisesObjC/README.md b/SaraAttended/Pods/PromisesObjC/README.md new file mode 100644 index 0000000..e0e65b7 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/README.md @@ -0,0 +1,60 @@ +[![Apache +License](https://img.shields.io/github/license/google/promises.svg)](LICENSE) +[![Travis](https://api.travis-ci.org/google/promises.svg?branch=master)](https://travis-ci.org/google/promises) +[![Gitter Chat](https://badges.gitter.im/google/promises.svg)](https://gitter.im/google/promises) + +![Platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20tvOS%20%7C%20watchOS-blue.svg?longCache=true&style=flat) +![Languages](https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg?longCache=true&style=flat) +![Package Managers](https://img.shields.io/badge/supports-Bazel%20%7C%20SwiftPM%20%7C%20CocoaPods%20%7C%20Carthage-yellow.svg?longCache=true&style=flat) + +# Promises + +Promises is a modern framework that provides a synchronization construct for +Objective-C and Swift to facilitate writing asynchronous code. + +* [Introduction](g3doc/index.md) + * [The problem with async + code](g3doc/index.md#the-problem-with-async-code) + * [Promises to the rescue](g3doc/index.md#promises-to-the-rescue) + * [What is a promise?](g3doc/index.md#what-is-a-promise) +* [Framework](g3doc/index.md#framework) + * [Features](g3doc/index.md#features) + * [Benchmark](g3doc/index.md#benchmark) +* [Getting started](g3doc/index.md#getting-started) + * [Add dependency](g3doc/index.md#add-dependency) + * [Import](g3doc/index.md#import) + * [Adopt](g3doc/index.md#adopt) +* [Basics](g3doc/index.md#basics) + * [Creating promises](g3doc/index.md#creating-promises) + * [Async](g3doc/index.md#async) + * [Do](g3doc/index.md#do) + * [Pending](g3doc/index.md#pending) + * [Resolved](g3doc/index.md#create-a-resolved-promise) + * [Observing fulfillment](g3doc/index.md#observing-fulfillment) + * [Then](g3doc/index.md#then) + * [Observing rejection](g3doc/index.md#observing-rejection) + * [Catch](g3doc/index.md#catch) +* [Extensions](g3doc/index.md#extensions) + * [All](g3doc/index.md#all) + * [Always](g3doc/index.md#always) + * [Any](g3doc/index.md#any) + * [AwaitPromise](g3doc/index.md#awaitpromise) + * [Delay](g3doc/index.md#delay) + * [Race](g3doc/index.md#race) + * [Recover](g3doc/index.md#recover) + * [Reduce](g3doc/index.md#reduce) + * [Retry](g3doc/index.md#retry) + * [Timeout](g3doc/index.md#timeout) + * [Validate](g3doc/index.md#validate) + * [Wrap](g3doc/index.md#wrap) +* [Advanced topics](g3doc/index.md#advanced-topics) + * [Default dispatch queue](g3doc/index.md#default-dispatch-queue) + * [Ownership and retain + cycles](g3doc/index.md#ownership-and-retain-cycles) + * [Testing](g3doc/index.md#testing) + * [Objective-C <-> Swift + interoperability](g3doc/index.md#objective-c---swift-interoperability) + * [Dot-syntax in Objective-C](g3doc/index.md#dot-syntax-in-objective-c) +* [Anti-patterns](g3doc/index.md#anti-patterns) + * [Broken chain](g3doc/index.md#broken-chain) + * [Nested promises](g3doc/index.md#nested-promises) diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+All.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+All.m new file mode 100644 index 0000000..c21f30e --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+All.m @@ -0,0 +1,86 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+All.h" + +#import "FBLPromise+Async.h" +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (AllAdditions) + ++ (FBLPromise *)all:(NSArray *)promises { + return [self onQueue:self.defaultDispatchQueue all:promises]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue all:(NSArray *)allPromises { + NSParameterAssert(queue); + NSParameterAssert(allPromises); + + if (allPromises.count == 0) { + return [[FBLPromise alloc] initWithResolution:@[]]; + } + NSMutableArray *promises = [allPromises mutableCopy]; + return [FBLPromise + onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + for (NSUInteger i = 0; i < promises.count; ++i) { + id promise = promises[i]; + if ([promise isKindOfClass:self]) { + continue; + } else if ([promise isKindOfClass:[NSError class]]) { + reject(promise); + return; + } else { + [promises replaceObjectAtIndex:i + withObject:[[FBLPromise alloc] initWithResolution:promise]]; + } + } + for (FBLPromise *promise in promises) { + [promise observeOnQueue:queue + fulfill:^(id __unused _) { + // Wait until all are fulfilled. + for (FBLPromise *promise in promises) { + if (!promise.isFulfilled) { + return; + } + } + // If called multiple times, only the first one affects the result. + fulfill([promises valueForKey:NSStringFromSelector(@selector(value))]); + } + reject:^(NSError *error) { + reject(error); + }]; + } + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_AllAdditions) + ++ (FBLPromise * (^)(NSArray *))all { + return ^(NSArray *promises) { + return [self all:promises]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))allOn { + return ^(dispatch_queue_t queue, NSArray *promises) { + return [self onQueue:queue all:promises]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Always.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Always.m new file mode 100644 index 0000000..6927442 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Always.m @@ -0,0 +1,58 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Always.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (AlwaysAdditions) + +- (FBLPromise *)always:(FBLPromiseAlwaysWorkBlock)work { + return [self onQueue:FBLPromise.defaultDispatchQueue always:work]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue always:(FBLPromiseAlwaysWorkBlock)work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self chainOnQueue:queue + chainedFulfill:^id(id value) { + work(); + return value; + } + chainedReject:^id(NSError *error) { + work(); + return error; + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_AlwaysAdditions) + +- (FBLPromise * (^)(FBLPromiseAlwaysWorkBlock))always { + return ^(FBLPromiseAlwaysWorkBlock work) { + return [self always:work]; + }; +} + +- (FBLPromise * (^)(dispatch_queue_t, FBLPromiseAlwaysWorkBlock))alwaysOn { + return ^(dispatch_queue_t queue, FBLPromiseAlwaysWorkBlock work) { + return [self onQueue:queue always:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Any.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Any.m new file mode 100644 index 0000000..e101c98 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Any.m @@ -0,0 +1,112 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Any.h" + +#import "FBLPromise+Async.h" +#import "FBLPromisePrivate.h" + +static NSArray *FBLPromiseCombineValuesAndErrors(NSArray *promises) { + NSMutableArray *combinedValuesAndErrors = [[NSMutableArray alloc] init]; + for (FBLPromise *promise in promises) { + if (promise.isFulfilled) { + [combinedValuesAndErrors addObject:promise.value ?: [NSNull null]]; + continue; + } + if (promise.isRejected) { + [combinedValuesAndErrors addObject:promise.error]; + continue; + } + assert(!promise.isPending); + }; + return combinedValuesAndErrors; +} + +@implementation FBLPromise (AnyAdditions) + ++ (FBLPromise *)any:(NSArray *)promises { + return [self onQueue:FBLPromise.defaultDispatchQueue any:promises]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue any:(NSArray *)anyPromises { + NSParameterAssert(queue); + NSParameterAssert(anyPromises); + + if (anyPromises.count == 0) { + return [[FBLPromise alloc] initWithResolution:@[]]; + } + NSMutableArray *promises = [anyPromises mutableCopy]; + return [FBLPromise + onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + for (NSUInteger i = 0; i < promises.count; ++i) { + id promise = promises[i]; + if ([promise isKindOfClass:self]) { + continue; + } else { + [promises replaceObjectAtIndex:i + withObject:[[FBLPromise alloc] initWithResolution:promise]]; + } + } + for (FBLPromise *promise in promises) { + [promise observeOnQueue:queue + fulfill:^(id __unused _) { + // Wait until all are resolved. + for (FBLPromise *promise in promises) { + if (promise.isPending) { + return; + } + } + // If called multiple times, only the first one affects the result. + fulfill(FBLPromiseCombineValuesAndErrors(promises)); + } + reject:^(NSError *error) { + BOOL atLeastOneIsFulfilled = NO; + for (FBLPromise *promise in promises) { + if (promise.isPending) { + return; + } + if (promise.isFulfilled) { + atLeastOneIsFulfilled = YES; + } + } + if (atLeastOneIsFulfilled) { + fulfill(FBLPromiseCombineValuesAndErrors(promises)); + } else { + reject(error); + } + }]; + } + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_AnyAdditions) + ++ (FBLPromise * (^)(NSArray *))any { + return ^(NSArray *promises) { + return [self any:promises]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))anyOn { + return ^(dispatch_queue_t queue, NSArray *promises) { + return [self onQueue:queue any:promises]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Async.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Async.m new file mode 100644 index 0000000..249158c --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Async.m @@ -0,0 +1,70 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Async.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (AsyncAdditions) + ++ (instancetype)async:(FBLPromiseAsyncWorkBlock)work { + return [self onQueue:self.defaultDispatchQueue async:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue async:(FBLPromiseAsyncWorkBlock)work { + NSParameterAssert(queue); + NSParameterAssert(work); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + dispatch_group_async(FBLPromise.dispatchGroup, queue, ^{ + work( + ^(id __nullable value) { + if ([value isKindOfClass:[FBLPromise class]]) { + [(FBLPromise *)value observeOnQueue:queue + fulfill:^(id __nullable value) { + [promise fulfill:value]; + } + reject:^(NSError *error) { + [promise reject:error]; + }]; + } else { + [promise fulfill:value]; + } + }, + ^(NSError *error) { + [promise reject:error]; + }); + }); + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_AsyncAdditions) + ++ (FBLPromise* (^)(FBLPromiseAsyncWorkBlock))async { + return ^(FBLPromiseAsyncWorkBlock work) { + return [self async:work]; + }; +} + ++ (FBLPromise* (^)(dispatch_queue_t, FBLPromiseAsyncWorkBlock))asyncOn { + return ^(dispatch_queue_t queue, FBLPromiseAsyncWorkBlock work) { + return [self onQueue:queue async:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Await.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Await.m new file mode 100644 index 0000000..ea3b87a --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Await.m @@ -0,0 +1,48 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Await.h" + +#import "FBLPromisePrivate.h" + +id __nullable FBLPromiseAwait(FBLPromise *promise, NSError **outError) { + assert(promise); + + static dispatch_once_t onceToken; + static dispatch_queue_t queue; + dispatch_once(&onceToken, ^{ + queue = dispatch_queue_create("com.google.FBLPromises.Await", DISPATCH_QUEUE_CONCURRENT); + }); + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + id __block resolution; + NSError __block *blockError; + [promise chainOnQueue:queue + chainedFulfill:^id(id value) { + resolution = value; + dispatch_semaphore_signal(semaphore); + return value; + } + chainedReject:^id(NSError *error) { + blockError = error; + dispatch_semaphore_signal(semaphore); + return error; + }]; + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + if (outError) { + *outError = blockError; + } + return resolution; +} diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Catch.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Catch.m new file mode 100644 index 0000000..25e8ce6 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Catch.m @@ -0,0 +1,55 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Catch.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (CatchAdditions) + +- (FBLPromise *)catch:(FBLPromiseCatchWorkBlock)reject { + return [self onQueue:FBLPromise.defaultDispatchQueue catch:reject]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue catch:(FBLPromiseCatchWorkBlock)reject { + NSParameterAssert(queue); + NSParameterAssert(reject); + + return [self chainOnQueue:queue + chainedFulfill:nil + chainedReject:^id(NSError *error) { + reject(error); + return error; + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_CatchAdditions) + +- (FBLPromise* (^)(FBLPromiseCatchWorkBlock))catch { + return ^(FBLPromiseCatchWorkBlock catch) { + return [self catch:catch]; + }; +} + +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseCatchWorkBlock))catchOn { + return ^(dispatch_queue_t queue, FBLPromiseCatchWorkBlock catch) { + return [self onQueue:queue catch:catch]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Delay.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Delay.m new file mode 100644 index 0000000..ce94c33 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Delay.m @@ -0,0 +1,59 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Delay.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (DelayAdditions) + +- (FBLPromise *)delay:(NSTimeInterval)interval { + return [self onQueue:FBLPromise.defaultDispatchQueue delay:interval]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue delay:(NSTimeInterval)interval { + NSParameterAssert(queue); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + [self observeOnQueue:queue + fulfill:^(id __nullable value) { + dispatch_after(dispatch_time(0, (int64_t)(interval * NSEC_PER_SEC)), queue, ^{ + [promise fulfill:value]; + }); + } + reject:^(NSError *error) { + [promise reject:error]; + }]; + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_DelayAdditions) + +- (FBLPromise * (^)(NSTimeInterval))delay { + return ^(NSTimeInterval interval) { + return [self delay:interval]; + }; +} + +- (FBLPromise * (^)(dispatch_queue_t, NSTimeInterval))delayOn { + return ^(dispatch_queue_t queue, NSTimeInterval interval) { + return [self onQueue:queue delay:interval]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Do.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Do.m new file mode 100644 index 0000000..eb7e10d --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Do.m @@ -0,0 +1,59 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Do.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (DoAdditions) + ++ (instancetype)do:(FBLPromiseDoWorkBlock)work { + return [self onQueue:self.defaultDispatchQueue do:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue do:(FBLPromiseDoWorkBlock)work { + NSParameterAssert(queue); + NSParameterAssert(work); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + dispatch_group_async(FBLPromise.dispatchGroup, queue, ^{ + id value = work(); + if ([value isKindOfClass:[FBLPromise class]]) { + [(FBLPromise *)value observeOnQueue:queue + fulfill:^(id __nullable value) { + [promise fulfill:value]; + } + reject:^(NSError *error) { + [promise reject:error]; + }]; + } else { + [promise fulfill:value]; + } + }); + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_DoAdditions) + ++ (FBLPromise* (^)(dispatch_queue_t, FBLPromiseDoWorkBlock))doOn { + return ^(dispatch_queue_t queue, FBLPromiseDoWorkBlock work) { + return [self onQueue:queue do:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Race.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Race.m new file mode 100644 index 0000000..b5bd9f1 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Race.m @@ -0,0 +1,65 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Race.h" + +#import "FBLPromise+Async.h" +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (RaceAdditions) + ++ (instancetype)race:(NSArray *)promises { + return [self onQueue:self.defaultDispatchQueue race:promises]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue race:(NSArray *)racePromises { + NSParameterAssert(queue); + NSAssert(racePromises.count > 0, @"No promises to observe"); + + NSArray *promises = [racePromises copy]; + return [FBLPromise onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + for (id promise in promises) { + if (![promise isKindOfClass:self]) { + fulfill(promise); + return; + } + } + // Subscribe all, but only the first one to resolve will change + // the resulting promise's state. + for (FBLPromise *promise in promises) { + [promise observeOnQueue:queue fulfill:fulfill reject:reject]; + } + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_RaceAdditions) + ++ (FBLPromise * (^)(NSArray *))race { + return ^(NSArray *promises) { + return [self race:promises]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))raceOn { + return ^(dispatch_queue_t queue, NSArray *promises) { + return [self onQueue:queue race:promises]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Recover.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Recover.m new file mode 100644 index 0000000..0c9326a --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Recover.m @@ -0,0 +1,54 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Recover.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (RecoverAdditions) + +- (FBLPromise *)recover:(FBLPromiseRecoverWorkBlock)recovery { + return [self onQueue:FBLPromise.defaultDispatchQueue recover:recovery]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue recover:(FBLPromiseRecoverWorkBlock)recovery { + NSParameterAssert(queue); + NSParameterAssert(recovery); + + return [self chainOnQueue:queue + chainedFulfill:nil + chainedReject:^id(NSError *error) { + return recovery(error); + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_RecoverAdditions) + +- (FBLPromise * (^)(FBLPromiseRecoverWorkBlock))recover { + return ^(FBLPromiseRecoverWorkBlock recovery) { + return [self recover:recovery]; + }; +} + +- (FBLPromise * (^)(dispatch_queue_t, FBLPromiseRecoverWorkBlock))recoverOn { + return ^(dispatch_queue_t queue, FBLPromiseRecoverWorkBlock recovery) { + return [self onQueue:queue recover:recovery]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Reduce.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Reduce.m new file mode 100644 index 0000000..1f3fc50 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Reduce.m @@ -0,0 +1,61 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Reduce.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (ReduceAdditions) + +- (FBLPromise *)reduce:(NSArray *)items combine:(FBLPromiseReducerBlock)reducer { + return [self onQueue:FBLPromise.defaultDispatchQueue reduce:items combine:reducer]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + reduce:(NSArray *)items + combine:(FBLPromiseReducerBlock)reducer { + NSParameterAssert(queue); + NSParameterAssert(items); + NSParameterAssert(reducer); + + FBLPromise *promise = self; + for (id item in items) { + promise = [promise chainOnQueue:queue + chainedFulfill:^id(id value) { + return reducer(value, item); + } + chainedReject:nil]; + } + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_ReduceAdditions) + +- (FBLPromise * (^)(NSArray *, FBLPromiseReducerBlock))reduce { + return ^(NSArray *items, FBLPromiseReducerBlock reducer) { + return [self reduce:items combine:reducer]; + }; +} + +- (FBLPromise * (^)(dispatch_queue_t, NSArray *, FBLPromiseReducerBlock))reduceOn { + return ^(dispatch_queue_t queue, NSArray *items, FBLPromiseReducerBlock reducer) { + return [self onQueue:queue reduce:items combine:reducer]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Retry.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Retry.m new file mode 100644 index 0000000..37c5576 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Retry.m @@ -0,0 +1,128 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Retry.h" + +#import "FBLPromisePrivate.h" + +NSInteger const FBLPromiseRetryDefaultAttemptsCount = 1; +NSTimeInterval const FBLPromiseRetryDefaultDelayInterval = 1.0; + +static void FBLPromiseRetryAttempt(FBLPromise *promise, dispatch_queue_t queue, NSInteger count, + NSTimeInterval interval, FBLPromiseRetryPredicateBlock predicate, + FBLPromiseRetryWorkBlock work) { + __auto_type retrier = ^(id __nullable value) { + if ([value isKindOfClass:[NSError class]]) { + if (count <= 0 || (predicate && !predicate(count, value))) { + [promise reject:value]; + } else { + dispatch_after(dispatch_time(0, (int64_t)(interval * NSEC_PER_SEC)), queue, ^{ + FBLPromiseRetryAttempt(promise, queue, count - 1, interval, predicate, work); + }); + } + } else { + [promise fulfill:value]; + } + }; + id value = work(); + if ([value isKindOfClass:[FBLPromise class]]) { + [(FBLPromise *)value observeOnQueue:queue fulfill:retrier reject:retrier]; + } else { + retrier(value); + } +} + +@implementation FBLPromise (RetryAdditions) + ++ (FBLPromise *)retry:(FBLPromiseRetryWorkBlock)work { + return [self onQueue:FBLPromise.defaultDispatchQueue retry:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue retry:(FBLPromiseRetryWorkBlock)work { + return [self onQueue:queue attempts:FBLPromiseRetryDefaultAttemptsCount retry:work]; +} + ++ (FBLPromise *)attempts:(NSInteger)count retry:(FBLPromiseRetryWorkBlock)work { + return [self onQueue:FBLPromise.defaultDispatchQueue attempts:count retry:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + attempts:(NSInteger)count + retry:(FBLPromiseRetryWorkBlock)work { + return [self onQueue:queue + attempts:count + delay:FBLPromiseRetryDefaultDelayInterval + condition:nil + retry:work]; +} + ++ (FBLPromise *)attempts:(NSInteger)count + delay:(NSTimeInterval)interval + condition:(nullable FBLPromiseRetryPredicateBlock)predicate + retry:(FBLPromiseRetryWorkBlock)work { + return [self onQueue:FBLPromise.defaultDispatchQueue + attempts:count + delay:interval + condition:predicate + retry:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + attempts:(NSInteger)count + delay:(NSTimeInterval)interval + condition:(nullable FBLPromiseRetryPredicateBlock)predicate + retry:(FBLPromiseRetryWorkBlock)work { + NSParameterAssert(queue); + NSParameterAssert(work); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + FBLPromiseRetryAttempt(promise, queue, count, interval, predicate, work); + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_RetryAdditions) + ++ (FBLPromise * (^)(FBLPromiseRetryWorkBlock))retry { + return ^id(FBLPromiseRetryWorkBlock work) { + return [self retry:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, FBLPromiseRetryWorkBlock))retryOn { + return ^id(dispatch_queue_t queue, FBLPromiseRetryWorkBlock work) { + return [self onQueue:queue retry:work]; + }; +} + ++ (FBLPromise * (^)(NSInteger, NSTimeInterval, FBLPromiseRetryPredicateBlock, + FBLPromiseRetryWorkBlock))retryAgain { + return ^id(NSInteger count, NSTimeInterval interval, FBLPromiseRetryPredicateBlock predicate, + FBLPromiseRetryWorkBlock work) { + return [self attempts:count delay:interval condition:predicate retry:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, NSInteger, NSTimeInterval, FBLPromiseRetryPredicateBlock, + FBLPromiseRetryWorkBlock))retryAgainOn { + return ^id(dispatch_queue_t queue, NSInteger count, NSTimeInterval interval, + FBLPromiseRetryPredicateBlock predicate, FBLPromiseRetryWorkBlock work) { + return [self onQueue:queue attempts:count delay:interval condition:predicate retry:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Testing.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Testing.m new file mode 100644 index 0000000..33d3536 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Testing.m @@ -0,0 +1,55 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Testing.h" + +BOOL FBLWaitForPromisesWithTimeout(NSTimeInterval timeout) { + BOOL isTimedOut = NO; + NSDate *timeoutDate = [NSDate dateWithTimeIntervalSinceNow:timeout]; + static NSTimeInterval const minimalTimeout = 0.01; + static int64_t const minimalTimeToWait = (int64_t)(minimalTimeout * NSEC_PER_SEC); + dispatch_time_t waitTime = dispatch_time(DISPATCH_TIME_NOW, minimalTimeToWait); + dispatch_group_t dispatchGroup = FBLPromise.dispatchGroup; + NSRunLoop *runLoop = NSRunLoop.currentRunLoop; + while (dispatch_group_wait(dispatchGroup, waitTime)) { + isTimedOut = timeoutDate.timeIntervalSinceNow < 0.0; + if (isTimedOut) { + break; + } + [runLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:minimalTimeout]]; + } + return !isTimedOut; +} + +@implementation FBLPromise (TestingAdditions) + +// These properties are implemented in the FBLPromise class itself. +@dynamic isPending; +@dynamic isFulfilled; +@dynamic isRejected; +@dynamic value; +@dynamic error; + ++ (dispatch_group_t)dispatchGroup { + static dispatch_group_t gDispatchGroup; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + gDispatchGroup = dispatch_group_create(); + }); + return gDispatchGroup; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Then.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Then.m new file mode 100644 index 0000000..ab03bd1 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Then.m @@ -0,0 +1,50 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Then.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (ThenAdditions) + +- (FBLPromise *)then:(FBLPromiseThenWorkBlock)work { + return [self onQueue:FBLPromise.defaultDispatchQueue then:work]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue then:(FBLPromiseThenWorkBlock)work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self chainOnQueue:queue chainedFulfill:work chainedReject:nil]; +} + +@end + +@implementation FBLPromise (DotSyntax_ThenAdditions) + +- (FBLPromise* (^)(FBLPromiseThenWorkBlock))then { + return ^(FBLPromiseThenWorkBlock work) { + return [self then:work]; + }; +} + +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseThenWorkBlock))thenOn { + return ^(dispatch_queue_t queue, FBLPromiseThenWorkBlock work) { + return [self onQueue:queue then:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Timeout.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Timeout.m new file mode 100644 index 0000000..a2252e6 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Timeout.m @@ -0,0 +1,64 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Timeout.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (TimeoutAdditions) + +- (FBLPromise *)timeout:(NSTimeInterval)interval { + return [self onQueue:FBLPromise.defaultDispatchQueue timeout:interval]; +} + +- (FBLPromise *)onQueue:(dispatch_queue_t)queue timeout:(NSTimeInterval)interval { + NSParameterAssert(queue); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + [self observeOnQueue:queue + fulfill:^(id __nullable value) { + [promise fulfill:value]; + } + reject:^(NSError *error) { + [promise reject:error]; + }]; + typeof(self) __weak weakPromise = promise; + dispatch_after(dispatch_time(0, (int64_t)(interval * NSEC_PER_SEC)), queue, ^{ + NSError *timedOutError = [[NSError alloc] initWithDomain:FBLPromiseErrorDomain + code:FBLPromiseErrorCodeTimedOut + userInfo:nil]; + [weakPromise reject:timedOutError]; + }); + return promise; +} + +@end + +@implementation FBLPromise (DotSyntax_TimeoutAdditions) + +- (FBLPromise* (^)(NSTimeInterval))timeout { + return ^(NSTimeInterval interval) { + return [self timeout:interval]; + }; +} + +- (FBLPromise* (^)(dispatch_queue_t, NSTimeInterval))timeoutOn { + return ^(dispatch_queue_t queue, NSTimeInterval interval) { + return [self onQueue:queue timeout:interval]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Validate.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Validate.m new file mode 100644 index 0000000..1e21e81 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Validate.m @@ -0,0 +1,56 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Validate.h" + +#import "FBLPromisePrivate.h" + +@implementation FBLPromise (ValidateAdditions) + +- (FBLPromise*)validate:(FBLPromiseValidateWorkBlock)predicate { + return [self onQueue:FBLPromise.defaultDispatchQueue validate:predicate]; +} + +- (FBLPromise*)onQueue:(dispatch_queue_t)queue validate:(FBLPromiseValidateWorkBlock)predicate { + NSParameterAssert(queue); + NSParameterAssert(predicate); + + FBLPromiseChainedFulfillBlock chainedFulfill = ^id(id value) { + return predicate(value) ? value : + [[NSError alloc] initWithDomain:FBLPromiseErrorDomain + code:FBLPromiseErrorCodeValidationFailure + userInfo:nil]; + }; + return [self chainOnQueue:queue chainedFulfill:chainedFulfill chainedReject:nil]; +} + +@end + +@implementation FBLPromise (DotSyntax_ValidateAdditions) + +- (FBLPromise* (^)(FBLPromiseValidateWorkBlock))validate { + return ^(FBLPromiseValidateWorkBlock predicate) { + return [self validate:predicate]; + }; +} + +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseValidateWorkBlock))validateOn { + return ^(dispatch_queue_t queue, FBLPromiseValidateWorkBlock predicate) { + return [self onQueue:queue validate:predicate]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Wrap.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Wrap.m new file mode 100644 index 0000000..ee10951 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise+Wrap.m @@ -0,0 +1,420 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Wrap.h" + +#import "FBLPromise+Async.h" + +@implementation FBLPromise (WrapAdditions) + ++ (instancetype)wrapCompletion:(void (^)(FBLPromiseCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapCompletion:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapCompletion:(void (^)(FBLPromiseCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock __unused _) { + work(^{ + fulfill(nil); + }); + }]; +} + ++ (instancetype)wrapObjectCompletion:(void (^)(FBLPromiseObjectCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapObjectCompletion:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapObjectCompletion:(void (^)(FBLPromiseObjectCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock __unused _) { + work(^(id __nullable value) { + fulfill(value); + }); + }]; +} + ++ (instancetype)wrapErrorCompletion:(void (^)(FBLPromiseErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapErrorCompletion:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapErrorCompletion:(void (^)(FBLPromiseErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(nil); + } + }); + }]; +} + ++ (instancetype)wrapObjectOrErrorCompletion:(void (^)(FBLPromiseObjectOrErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapObjectOrErrorCompletion:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapObjectOrErrorCompletion:(void (^)(FBLPromiseObjectOrErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(id __nullable value, NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(value); + } + }); + }]; +} + ++ (instancetype)wrapErrorOrObjectCompletion:(void (^)(FBLPromiseErrorOrObjectCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapErrorOrObjectCompletion:work]; +} + ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapErrorOrObjectCompletion:(void (^)(FBLPromiseErrorOrObjectCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(NSError *__nullable error, id __nullable value) { + if (error) { + reject(error); + } else { + fulfill(value); + } + }); + }]; +} + ++ (FBLPromise *)wrap2ObjectsOrErrorCompletion: + (void (^)(FBLPromise2ObjectsOrErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrap2ObjectsOrErrorCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrap2ObjectsOrErrorCompletion:(void (^)(FBLPromise2ObjectsOrErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(id __nullable value1, id __nullable value2, NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(@[ value1 ?: [NSNull null], value2 ?: [NSNull null] ]); + } + }); + }]; +} + ++ (FBLPromise *)wrapBoolCompletion:(void (^)(FBLPromiseBoolCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapBoolCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapBoolCompletion:(void (^)(FBLPromiseBoolCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock __unused _) { + work(^(BOOL value) { + fulfill(@(value)); + }); + }]; +} + ++ (FBLPromise *)wrapBoolOrErrorCompletion: + (void (^)(FBLPromiseBoolOrErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapBoolOrErrorCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapBoolOrErrorCompletion:(void (^)(FBLPromiseBoolOrErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(BOOL value, NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(@(value)); + } + }); + }]; +} + ++ (FBLPromise *)wrapIntegerCompletion:(void (^)(FBLPromiseIntegerCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapIntegerCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapIntegerCompletion:(void (^)(FBLPromiseIntegerCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock __unused _) { + work(^(NSInteger value) { + fulfill(@(value)); + }); + }]; +} + ++ (FBLPromise *)wrapIntegerOrErrorCompletion: + (void (^)(FBLPromiseIntegerOrErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapIntegerOrErrorCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapIntegerOrErrorCompletion:(void (^)(FBLPromiseIntegerOrErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(NSInteger value, NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(@(value)); + } + }); + }]; +} + ++ (FBLPromise *)wrapDoubleCompletion:(void (^)(FBLPromiseDoubleCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapDoubleCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapDoubleCompletion:(void (^)(FBLPromiseDoubleCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:(dispatch_queue_t)queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock __unused _) { + work(^(double value) { + fulfill(@(value)); + }); + }]; +} + ++ (FBLPromise *)wrapDoubleOrErrorCompletion: + (void (^)(FBLPromiseDoubleOrErrorCompletion))work { + return [self onQueue:self.defaultDispatchQueue wrapDoubleOrErrorCompletion:work]; +} + ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + wrapDoubleOrErrorCompletion:(void (^)(FBLPromiseDoubleOrErrorCompletion))work { + NSParameterAssert(queue); + NSParameterAssert(work); + + return [self onQueue:queue + async:^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { + work(^(double value, NSError *__nullable error) { + if (error) { + reject(error); + } else { + fulfill(@(value)); + } + }); + }]; +} + +@end + +@implementation FBLPromise (DotSyntax_WrapAdditions) + ++ (FBLPromise * (^)(void (^)(FBLPromiseCompletion)))wrapCompletion { + return ^(void (^work)(FBLPromiseCompletion)) { + return [self wrapCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseCompletion)))wrapCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseCompletion)) { + return [self onQueue:queue wrapCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseObjectCompletion)))wrapObjectCompletion { + return ^(void (^work)(FBLPromiseObjectCompletion)) { + return [self wrapObjectCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseObjectCompletion)))wrapObjectCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseObjectCompletion)) { + return [self onQueue:queue wrapObjectCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseErrorCompletion)))wrapErrorCompletion { + return ^(void (^work)(FBLPromiseErrorCompletion)) { + return [self wrapErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseErrorCompletion)))wrapErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseErrorCompletion)) { + return [self onQueue:queue wrapErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseObjectOrErrorCompletion)))wrapObjectOrErrorCompletion { + return ^(void (^work)(FBLPromiseObjectOrErrorCompletion)) { + return [self wrapObjectOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, + void (^)(FBLPromiseObjectOrErrorCompletion)))wrapObjectOrErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseObjectOrErrorCompletion)) { + return [self onQueue:queue wrapObjectOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseErrorOrObjectCompletion)))wrapErrorOrObjectCompletion { + return ^(void (^work)(FBLPromiseErrorOrObjectCompletion)) { + return [self wrapErrorOrObjectCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, + void (^)(FBLPromiseErrorOrObjectCompletion)))wrapErrorOrObjectCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseErrorOrObjectCompletion)) { + return [self onQueue:queue wrapErrorOrObjectCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromise2ObjectsOrErrorCompletion))) + wrap2ObjectsOrErrorCompletion { + return ^(void (^work)(FBLPromise2ObjectsOrErrorCompletion)) { + return [self wrap2ObjectsOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromise2ObjectsOrErrorCompletion))) + wrap2ObjectsOrErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromise2ObjectsOrErrorCompletion)) { + return [self onQueue:queue wrap2ObjectsOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseBoolCompletion)))wrapBoolCompletion { + return ^(void (^work)(FBLPromiseBoolCompletion)) { + return [self wrapBoolCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, + void (^)(FBLPromiseBoolCompletion)))wrapBoolCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseBoolCompletion)) { + return [self onQueue:queue wrapBoolCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseBoolOrErrorCompletion))) + wrapBoolOrErrorCompletion { + return ^(void (^work)(FBLPromiseBoolOrErrorCompletion)) { + return [self wrapBoolOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseBoolOrErrorCompletion))) + wrapBoolOrErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseBoolOrErrorCompletion)) { + return [self onQueue:queue wrapBoolOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseIntegerCompletion)))wrapIntegerCompletion { + return ^(void (^work)(FBLPromiseIntegerCompletion)) { + return [self wrapIntegerCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, + void (^)(FBLPromiseIntegerCompletion)))wrapIntegerCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseIntegerCompletion)) { + return [self onQueue:queue wrapIntegerCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseIntegerOrErrorCompletion))) + wrapIntegerOrErrorCompletion { + return ^(void (^work)(FBLPromiseIntegerOrErrorCompletion)) { + return [self wrapIntegerOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseIntegerOrErrorCompletion))) + wrapIntegerOrErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseIntegerOrErrorCompletion)) { + return [self onQueue:queue wrapIntegerOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseDoubleCompletion)))wrapDoubleCompletion { + return ^(void (^work)(FBLPromiseDoubleCompletion)) { + return [self wrapDoubleCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, + void (^)(FBLPromiseDoubleCompletion)))wrapDoubleCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseDoubleCompletion)) { + return [self onQueue:queue wrapDoubleCompletion:work]; + }; +} + ++ (FBLPromise * (^)(void (^)(FBLPromiseDoubleOrErrorCompletion))) + wrapDoubleOrErrorCompletion { + return ^(void (^work)(FBLPromiseDoubleOrErrorCompletion)) { + return [self wrapDoubleOrErrorCompletion:work]; + }; +} + ++ (FBLPromise * (^)(dispatch_queue_t, void (^)(FBLPromiseDoubleOrErrorCompletion))) + wrapDoubleOrErrorCompletionOn { + return ^(dispatch_queue_t queue, void (^work)(FBLPromiseDoubleOrErrorCompletion)) { + return [self onQueue:queue wrapDoubleOrErrorCompletion:work]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise.m new file mode 100644 index 0000000..c12ad32 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromise.m @@ -0,0 +1,299 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromisePrivate.h" + +/** All states a promise can be in. */ +typedef NS_ENUM(NSInteger, FBLPromiseState) { + FBLPromiseStatePending = 0, + FBLPromiseStateFulfilled, + FBLPromiseStateRejected, +}; + +typedef void (^FBLPromiseObserver)(FBLPromiseState state, id __nullable resolution); + +static dispatch_queue_t gFBLPromiseDefaultDispatchQueue; + +@implementation FBLPromise { + /** Current state of the promise. */ + FBLPromiseState _state; + /** + Set of arbitrary objects to keep strongly while the promise is pending. + Becomes nil after the promise has been resolved. + */ + NSMutableSet *__nullable _pendingObjects; + /** + Value to fulfill the promise with. + Can be nil if the promise is still pending, was resolved with nil or after it has been rejected. + */ + id __nullable _value; + /** + Error to reject the promise with. + Can be nil if the promise is still pending or after it has been fulfilled. + */ + NSError *__nullable _error; + /** List of observers to notify when the promise gets resolved. */ + NSMutableArray *_observers; +} + ++ (void)initialize { + if (self == [FBLPromise class]) { + gFBLPromiseDefaultDispatchQueue = dispatch_get_main_queue(); + } +} + ++ (dispatch_queue_t)defaultDispatchQueue { + @synchronized(self) { + return gFBLPromiseDefaultDispatchQueue; + } +} + ++ (void)setDefaultDispatchQueue:(dispatch_queue_t)queue { + NSParameterAssert(queue); + + @synchronized(self) { + gFBLPromiseDefaultDispatchQueue = queue; + } +} + ++ (instancetype)pendingPromise { + return [[self alloc] initPending]; +} + ++ (instancetype)resolvedWith:(nullable id)resolution { + return [[self alloc] initWithResolution:resolution]; +} + +- (void)fulfill:(nullable id)value { + if ([value isKindOfClass:[NSError class]]) { + [self reject:(NSError *)value]; + } else { + @synchronized(self) { + if (_state == FBLPromiseStatePending) { + _state = FBLPromiseStateFulfilled; + _value = value; + _pendingObjects = nil; + for (FBLPromiseObserver observer in _observers) { + observer(_state, _value); + } + _observers = nil; + dispatch_group_leave(FBLPromise.dispatchGroup); + } + } + } +} + +- (void)reject:(NSError *)error { + NSAssert([error isKindOfClass:[NSError class]], @"Invalid error type."); + + if (![error isKindOfClass:[NSError class]]) { + // Give up on invalid error type in Release mode. + @throw error; // NOLINT + } + @synchronized(self) { + if (_state == FBLPromiseStatePending) { + _state = FBLPromiseStateRejected; + _error = error; + _pendingObjects = nil; + for (FBLPromiseObserver observer in _observers) { + observer(_state, _error); + } + _observers = nil; + dispatch_group_leave(FBLPromise.dispatchGroup); + } + } +} + +#pragma mark - NSObject + +- (NSString *)description { + if (self.isFulfilled) { + return [NSString stringWithFormat:@"<%@ %p> Fulfilled: %@", NSStringFromClass([self class]), + self, self.value]; + } + if (self.isRejected) { + return [NSString stringWithFormat:@"<%@ %p> Rejected: %@", NSStringFromClass([self class]), + self, self.error]; + } + return [NSString stringWithFormat:@"<%@ %p> Pending", NSStringFromClass([self class]), self]; +} + +#pragma mark - Private + +- (instancetype)initPending { + self = [super init]; + if (self) { + dispatch_group_enter(FBLPromise.dispatchGroup); + } + return self; +} + +- (instancetype)initWithResolution:(nullable id)resolution { + self = [super init]; + if (self) { + if ([resolution isKindOfClass:[NSError class]]) { + _state = FBLPromiseStateRejected; + _error = (NSError *)resolution; + } else { + _state = FBLPromiseStateFulfilled; + _value = resolution; + } + } + return self; +} + +- (void)dealloc { + if (_state == FBLPromiseStatePending) { + dispatch_group_leave(FBLPromise.dispatchGroup); + } +} + +- (BOOL)isPending { + @synchronized(self) { + return _state == FBLPromiseStatePending; + } +} + +- (BOOL)isFulfilled { + @synchronized(self) { + return _state == FBLPromiseStateFulfilled; + } +} + +- (BOOL)isRejected { + @synchronized(self) { + return _state == FBLPromiseStateRejected; + } +} + +- (nullable id)value { + @synchronized(self) { + return _value; + } +} + +- (NSError *__nullable)error { + @synchronized(self) { + return _error; + } +} + +- (void)addPendingObject:(id)object { + NSParameterAssert(object); + + @synchronized(self) { + if (_state == FBLPromiseStatePending) { + if (!_pendingObjects) { + _pendingObjects = [[NSMutableSet alloc] init]; + } + [_pendingObjects addObject:object]; + } + } +} + +- (void)observeOnQueue:(dispatch_queue_t)queue + fulfill:(FBLPromiseOnFulfillBlock)onFulfill + reject:(FBLPromiseOnRejectBlock)onReject { + NSParameterAssert(queue); + NSParameterAssert(onFulfill); + NSParameterAssert(onReject); + + @synchronized(self) { + switch (_state) { + case FBLPromiseStatePending: { + if (!_observers) { + _observers = [[NSMutableArray alloc] init]; + } + [_observers addObject:^(FBLPromiseState state, id __nullable resolution) { + dispatch_group_async(FBLPromise.dispatchGroup, queue, ^{ + switch (state) { + case FBLPromiseStatePending: + break; + case FBLPromiseStateFulfilled: + onFulfill(resolution); + break; + case FBLPromiseStateRejected: + onReject(resolution); + break; + } + }); + }]; + break; + } + case FBLPromiseStateFulfilled: { + dispatch_group_async(FBLPromise.dispatchGroup, queue, ^{ + onFulfill(self->_value); + }); + break; + } + case FBLPromiseStateRejected: { + dispatch_group_async(FBLPromise.dispatchGroup, queue, ^{ + onReject(self->_error); + }); + break; + } + } + } +} + +- (FBLPromise *)chainOnQueue:(dispatch_queue_t)queue + chainedFulfill:(FBLPromiseChainedFulfillBlock)chainedFulfill + chainedReject:(FBLPromiseChainedRejectBlock)chainedReject { + NSParameterAssert(queue); + + FBLPromise *promise = [[FBLPromise alloc] initPending]; + __auto_type resolver = ^(id __nullable value) { + if ([value isKindOfClass:[FBLPromise class]]) { + [(FBLPromise *)value observeOnQueue:queue + fulfill:^(id __nullable value) { + [promise fulfill:value]; + } + reject:^(NSError *error) { + [promise reject:error]; + }]; + } else { + [promise fulfill:value]; + } + }; + [self observeOnQueue:queue + fulfill:^(id __nullable value) { + value = chainedFulfill ? chainedFulfill(value) : value; + resolver(value); + } + reject:^(NSError *error) { + id value = chainedReject ? chainedReject(error) : error; + resolver(value); + }]; + return promise; +} + +@end + +@implementation FBLPromise (DotSyntaxAdditions) + ++ (instancetype (^)(void))pending { + return ^(void) { + return [self pendingPromise]; + }; +} + ++ (instancetype (^)(id __nullable))resolved { + return ^(id resolution) { + return [self resolvedWith:resolution]; + }; +} + +@end diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromiseError.m b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromiseError.m new file mode 100644 index 0000000..1cc181a --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/FBLPromiseError.m @@ -0,0 +1,19 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromiseError.h" + +NSErrorDomain const FBLPromiseErrorDomain = @"com.google.FBLPromises.Error"; diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+All.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+All.h new file mode 100644 index 0000000..9c0090e --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+All.h @@ -0,0 +1,63 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(AllAdditions) + +/** + Wait until all of the given promises are fulfilled. + If one of the given promises is rejected, then the returned promise is rejected with same error. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected `FBLPromise` correspondingly. + Promises resolved with `nil` become `NSNull` instances in the resulting array. + + @param promises Promises to wait for. + @return Promise of an array containing the values of input promises in the same order. + */ ++ (FBLPromise *)all:(NSArray *)promises NS_SWIFT_UNAVAILABLE(""); + +/** + Wait until all of the given promises are fulfilled. + If one of the given promises is rejected, then the returned promise is rejected with same error. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected FBLPromise correspondingly. + Promises resolved with `nil` become `NSNull` instances in the resulting array. + + @param queue A queue to dispatch on. + @param promises Promises to wait for. + @return Promise of an array containing the values of input promises in the same order. + */ ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + all:(NSArray *)promises NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `all` operators. + Usage: FBLPromise.all(@[ ... ]) + */ +@interface FBLPromise(DotSyntax_AllAdditions) + ++ (FBLPromise * (^)(NSArray *))all FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))allOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Always.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Always.h new file mode 100644 index 0000000..13000f5 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Always.h @@ -0,0 +1,54 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(AlwaysAdditions) + +typedef void (^FBLPromiseAlwaysWorkBlock)(void) NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block that always executes, no matter if the receiver is rejected or fulfilled. + @return A new pending promise to be resolved with same resolution as the receiver. + */ +- (FBLPromise *)always:(FBLPromiseAlwaysWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to dispatch on. + @param work A block that always executes, no matter if the receiver is rejected or fulfilled. + @return A new pending promise to be resolved with same resolution as the receiver. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + always:(FBLPromiseAlwaysWorkBlock)work NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `always` operators. + Usage: promise.always(^{...}) + */ +@interface FBLPromise(DotSyntax_AlwaysAdditions) + +- (FBLPromise* (^)(FBLPromiseAlwaysWorkBlock))always FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseAlwaysWorkBlock))alwaysOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Any.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Any.h new file mode 100644 index 0000000..82875bf --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Any.h @@ -0,0 +1,69 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(AnyAdditions) + +/** + Waits until all of the given promises are either fulfilled or rejected. + If all promises are rejected, then the returned promise is rejected with same error + as the last one rejected. + If at least one of the promises is fulfilled, the resulting promise is fulfilled with an array of + values or `NSErrors`, matching the original order of fulfilled or rejected promises respectively. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected `FBLPromise` correspondingly. + Promises resolved with `nil` become `NSNull` instances in the resulting array. + + @param promises Promises to wait for. + @return Promise of array containing the values or `NSError`s of input promises in the same order. + */ ++ (FBLPromise *)any:(NSArray *)promises NS_SWIFT_UNAVAILABLE(""); + +/** + Waits until all of the given promises are either fulfilled or rejected. + If all promises are rejected, then the returned promise is rejected with same error + as the last one rejected. + If at least one of the promises is fulfilled, the resulting promise is fulfilled with an array of + values or `NSError`s, matching the original order of fulfilled or rejected promises respectively. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected `FBLPromise` correspondingly. + Promises resolved with `nil` become `NSNull` instances in the resulting array. + + @param queue A queue to dispatch on. + @param promises Promises to wait for. + @return Promise of array containing the values or `NSError`s of input promises in the same order. + */ ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + any:(NSArray *)promises NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `any` operators. + Usage: FBLPromise.any(@[ ... ]) + */ +@interface FBLPromise(DotSyntax_AnyAdditions) + ++ (FBLPromise * (^)(NSArray *))any FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))anyOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Async.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Async.h new file mode 100644 index 0000000..0588a9e --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Async.h @@ -0,0 +1,60 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(AsyncAdditions) + +typedef void (^FBLPromiseFulfillBlock)(Value __nullable value) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseRejectBlock)(NSError *error) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseAsyncWorkBlock)(FBLPromiseFulfillBlock fulfill, + FBLPromiseRejectBlock reject) NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise and executes `work` block asynchronously. + + @param work A block to perform any operations needed to resolve the promise. + @return A new pending promise. + */ ++ (instancetype)async:(FBLPromiseAsyncWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise and executes `work` block asynchronously on the given queue. + + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @return A new pending promise. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + async:(FBLPromiseAsyncWorkBlock)work NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `async` operators. + Usage: FBLPromise.async(^(FBLPromiseFulfillBlock fulfill, FBLPromiseRejectBlock reject) { ... }) + */ +@interface FBLPromise(DotSyntax_AsyncAdditions) + ++ (FBLPromise* (^)(FBLPromiseAsyncWorkBlock))async FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, FBLPromiseAsyncWorkBlock))asyncOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Await.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Await.h new file mode 100644 index 0000000..c97a1ba --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Await.h @@ -0,0 +1,32 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Waits for promise resolution. The current thread blocks until the promise is resolved. + + @param promise Promise to wait for. + @param error Error the promise was rejected with, or `nil` if the promise was fulfilled. + @return Value the promise was fulfilled with. If the promise was rejected, the return value + is always `nil`, but the error out arg is not. + */ +FOUNDATION_EXTERN id __nullable FBLPromiseAwait(FBLPromise *promise, + NSError **error) NS_REFINED_FOR_SWIFT; + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Catch.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Catch.h new file mode 100644 index 0000000..a9ff170 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Catch.h @@ -0,0 +1,59 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(CatchAdditions) + +typedef void (^FBLPromiseCatchWorkBlock)(NSError *error) NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise which eventually gets resolved with same resolution as the receiver. + If receiver is rejected, then `reject` block is executed asynchronously. + + @param reject A block to handle the error that receiver was rejected with. + @return A new pending promise. + */ +- (FBLPromise *)catch:(FBLPromiseCatchWorkBlock)reject NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise which eventually gets resolved with same resolution as the receiver. + If receiver is rejected, then `reject` block is executed asynchronously on the given queue. + + @param queue A queue to invoke the `reject` block on. + @param reject A block to handle the error that receiver was rejected with. + @return A new pending promise. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + catch:(FBLPromiseCatchWorkBlock)reject NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `catch` operators. + Usage: promise.catch(^(NSError *error) { ... }) + */ +@interface FBLPromise(DotSyntax_CatchAdditions) + +- (FBLPromise* (^)(FBLPromiseCatchWorkBlock))catch FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseCatchWorkBlock))catchOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Delay.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Delay.h new file mode 100644 index 0000000..557df48 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Delay.h @@ -0,0 +1,59 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(DelayAdditions) + +/** + Creates a new pending promise that fulfills with the same value as `self` after the `delay`, or + rejects with the same error immediately. + + @param interval Time to wait in seconds. + @return A new pending promise that fulfills at least `delay` seconds later than `self`, or rejects + with the same error immediately. + */ +- (FBLPromise *)delay:(NSTimeInterval)interval NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a new pending promise that fulfills with the same value as `self` after the `delay`, or + rejects with the same error immediately. + + @param queue A queue to dispatch on. + @param interval Time to wait in seconds. + @return A new pending promise that fulfills at least `delay` seconds later than `self`, or rejects + with the same error immediately. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + delay:(NSTimeInterval)interval NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `delay` operators. + Usage: promise.delay(...) + */ +@interface FBLPromise(DotSyntax_DelayAdditions) + +- (FBLPromise * (^)(NSTimeInterval))delay FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise * (^)(dispatch_queue_t, NSTimeInterval))delayOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Do.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Do.h new file mode 100644 index 0000000..6838e0a --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Do.h @@ -0,0 +1,55 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(DoAdditions) + +typedef id __nullable (^FBLPromiseDoWorkBlock)(void) NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise and executes `work` block asynchronously. + + @param work A block that returns a value or an error used to resolve the promise. + @return A new pending promise. + */ ++ (instancetype)do:(FBLPromiseDoWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise and executes `work` block asynchronously on the given queue. + + @param queue A queue to invoke the `work` block on. + @param work A block that returns a value or an error used to resolve the promise. + @return A new pending promise. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue do:(FBLPromiseDoWorkBlock)work NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `do` operators. + Usage: FBLPromise.doOn(queue, ^(NSError *error) { ... }) + */ +@interface FBLPromise(DotSyntax_DoAdditions) + ++ (FBLPromise * (^)(dispatch_queue_t, FBLPromiseDoWorkBlock))doOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Race.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Race.h new file mode 100644 index 0000000..2f67258 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Race.h @@ -0,0 +1,62 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(RaceAdditions) + +/** + Wait until any of the given promises are fulfilled. + If one of the promises is rejected, then the returned promise is rejected with same error. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected `FBLPromise` correspondingly. + + @param promises Promises to wait for. + @return A new pending promise to be resolved with the same resolution as the first promise, among + the given ones, which was resolved. + */ ++ (instancetype)race:(NSArray *)promises NS_SWIFT_UNAVAILABLE(""); + +/** + Wait until any of the given promises are fulfilled. + If one of the promises is rejected, then the returned promise is rejected with same error. + If any other arbitrary value or `NSError` appears in the array instead of `FBLPromise`, + it's implicitly considered a pre-fulfilled or pre-rejected `FBLPromise` correspondingly. + + @param queue A queue to dispatch on. + @param promises Promises to wait for. + @return A new pending promise to be resolved with the same resolution as the first promise, among + the given ones, which was resolved. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue race:(NSArray *)promises NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `race` operators. + Usage: FBLPromise.race(@[ ... ]) + */ +@interface FBLPromise(DotSyntax_RaceAdditions) + ++ (FBLPromise * (^)(NSArray *))race FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(dispatch_queue_t, NSArray *))raceOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Recover.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Recover.h new file mode 100644 index 0000000..bb7df7e --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Recover.h @@ -0,0 +1,60 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(RecoverAdditions) + +typedef id __nullable (^FBLPromiseRecoverWorkBlock)(NSError *error) NS_SWIFT_UNAVAILABLE(""); + +/** + Provides a new promise to recover in case the receiver gets rejected. + + @param recovery A block to handle the error that the receiver was rejected with. + @return A new pending promise to use instead of the rejected one that gets resolved with resolution + returned from `recovery` block. + */ +- (FBLPromise *)recover:(FBLPromiseRecoverWorkBlock)recovery NS_SWIFT_UNAVAILABLE(""); + +/** + Provides a new promise to recover in case the receiver gets rejected. + + @param queue A queue to dispatch on. + @param recovery A block to handle the error that the receiver was rejected with. + @return A new pending promise to use instead of the rejected one that gets resolved with resolution + returned from `recovery` block. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + recover:(FBLPromiseRecoverWorkBlock)recovery NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `recover` operators. + Usage: promise.recover(^id(NSError *error) {...}) + */ +@interface FBLPromise(DotSyntax_RecoverAdditions) + +- (FBLPromise * (^)(FBLPromiseRecoverWorkBlock))recover FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise * (^)(dispatch_queue_t, FBLPromiseRecoverWorkBlock))recoverOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Reduce.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Reduce.h new file mode 100644 index 0000000..5bb1eee --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Reduce.h @@ -0,0 +1,71 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(ReduceAdditions) + +typedef id __nullable (^FBLPromiseReducerBlock)(Value __nullable partial, id next) + NS_SWIFT_UNAVAILABLE(""); + +/** + Sequentially reduces a collection of values to a single promise using a given combining block + and the value `self` resolves with as initial value. + + @param items An array of values to process in order. + @param reducer A block to combine an accumulating value and an element of the sequence into + the new accumulating value or a promise resolved with it, to be used in the next + call of the `reducer` or returned to the caller. + @return A new pending promise returned from the last `reducer` invocation. + Or `self` if `items` is empty. + */ +- (FBLPromise *)reduce:(NSArray *)items + combine:(FBLPromiseReducerBlock)reducer NS_SWIFT_UNAVAILABLE(""); + +/** + Sequentially reduces a collection of values to a single promise using a given combining block + and the value `self` resolves with as initial value. + + @param queue A queue to dispatch on. + @param items An array of values to process in order. + @param reducer A block to combine an accumulating value and an element of the sequence into + the new accumulating value or a promise resolved with it, to be used in the next + call of the `reducer` or returned to the caller. + @return A new pending promise returned from the last `reducer` invocation. + Or `self` if `items` is empty. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + reduce:(NSArray *)items + combine:(FBLPromiseReducerBlock)reducer NS_SWIFT_UNAVAILABLE(""); + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `reduce` operators. + Usage: promise.reduce(values, ^id(id partial, id next) { ... }) + */ +@interface FBLPromise(DotSyntax_ReduceAdditions) + +- (FBLPromise * (^)(NSArray *, FBLPromiseReducerBlock))reduce FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise * (^)(dispatch_queue_t, NSArray *, FBLPromiseReducerBlock))reduceOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Retry.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Retry.h new file mode 100644 index 0000000..98ef558 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Retry.h @@ -0,0 +1,165 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +/** The default number of retry attempts is 1. */ +FOUNDATION_EXTERN NSInteger const FBLPromiseRetryDefaultAttemptsCount NS_REFINED_FOR_SWIFT; + +/** The default delay interval before making a retry attempt is 1.0 second. */ +FOUNDATION_EXTERN NSTimeInterval const FBLPromiseRetryDefaultDelayInterval NS_REFINED_FOR_SWIFT; + +@interface FBLPromise(RetryAdditions) + +typedef id __nullable (^FBLPromiseRetryWorkBlock)(void) NS_SWIFT_UNAVAILABLE(""); +typedef BOOL (^FBLPromiseRetryPredicateBlock)(NSInteger, NSError *) NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously, or rejects with the same error after all retry attempts have + been exhausted. Defaults to `FBLPromiseRetryDefaultAttemptsCount` attempt(s) on rejection where the + `work` block is retried after a delay of `FBLPromiseRetryDefaultDelayInterval` second(s). + + @param work A block that executes asynchronously on the default queue and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted. + */ ++ (FBLPromise *)retry:(FBLPromiseRetryWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously on the given `queue`, or rejects with the same error after all + retry attempts have been exhausted. Defaults to `FBLPromiseRetryDefaultAttemptsCount` attempt(s) on + rejection where the `work` block is retried on the given `queue` after a delay of + `FBLPromiseRetryDefaultDelayInterval` second(s). + + @param queue A queue to invoke the `work` block on. + @param work A block that executes asynchronously on the given `queue` and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted. + */ ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + retry:(FBLPromiseRetryWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously, or rejects with the same error after all retry attempts have + been exhausted. + + @param count Max number of retry attempts. The `work` block will be executed once if the specified + count is less than or equal to zero. + @param work A block that executes asynchronously on the default queue and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted. + */ ++ (FBLPromise *)attempts:(NSInteger)count + retry:(FBLPromiseRetryWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously on the given `queue`, or rejects with the same error after all + retry attempts have been exhausted. + + @param queue A queue to invoke the `work` block on. + @param count Max number of retry attempts. The `work` block will be executed once if the specified + count is less than or equal to zero. + @param work A block that executes asynchronously on the given `queue` and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted. + */ ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + attempts:(NSInteger)count + retry:(FBLPromiseRetryWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously, or rejects with the same error after all retry attempts have + been exhausted. On rejection, the `work` block is retried after the given delay `interval` and will + continue to retry until the number of specified attempts have been exhausted or will bail early if + the given condition is not met. + + @param count Max number of retry attempts. The `work` block will be executed once if the specified + count is less than or equal to zero. + @param interval Time to wait before the next retry attempt. + @param predicate Condition to check before the next retry attempt. The predicate block provides the + the number of remaining retry attempts and the error that the promise was rejected + with. + @param work A block that executes asynchronously on the default queue and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted or if + the given condition is not met. + */ ++ (FBLPromise *)attempts:(NSInteger)count + delay:(NSTimeInterval)interval + condition:(nullable FBLPromiseRetryPredicateBlock)predicate + retry:(FBLPromiseRetryWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise that fulfills with the same value as the promise returned from `work` + block, which executes asynchronously on the given `queue`, or rejects with the same error after all + retry attempts have been exhausted. On rejection, the `work` block is retried after the given + delay `interval` and will continue to retry until the number of specified attempts have been + exhausted or will bail early if the given condition is not met. + + @param queue A queue to invoke the `work` block on. + @param count Max number of retry attempts. The `work` block will be executed once if the specified + count is less than or equal to zero. + @param interval Time to wait before the next retry attempt. + @param predicate Condition to check before the next retry attempt. The predicate block provides the + the number of remaining retry attempts and the error that the promise was rejected + with. + @param work A block that executes asynchronously on the given `queue` and returns a value or an + error used to resolve the promise. + @return A new pending promise that fulfills with the same value as the promise returned from `work` + block, or rejects with the same error after all retry attempts have been exhausted or if + the given condition is not met. + */ ++ (FBLPromise *)onQueue:(dispatch_queue_t)queue + attempts:(NSInteger)count + delay:(NSTimeInterval)interval + condition:(nullable FBLPromiseRetryPredicateBlock)predicate + retry:(FBLPromiseRetryWorkBlock)work NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise+Retry` operators. + Usage: FBLPromise.retry(^id { ... }) + */ +@interface FBLPromise(DotSyntax_RetryAdditions) + ++ (FBLPromise * (^)(FBLPromiseRetryWorkBlock))retry FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(dispatch_queue_t, FBLPromiseRetryWorkBlock))retryOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(NSInteger, NSTimeInterval, FBLPromiseRetryPredicateBlock __nullable, + FBLPromiseRetryWorkBlock))retryAgain FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise * (^)(dispatch_queue_t, NSInteger, NSTimeInterval, + FBLPromiseRetryPredicateBlock __nullable, + FBLPromiseRetryWorkBlock))retryAgainOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Testing.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Testing.h new file mode 100644 index 0000000..8478ae2 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Testing.h @@ -0,0 +1,57 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Waits for all scheduled promises blocks. + + @param timeout Maximum time to wait. + @return YES if all promises blocks have completed before the timeout and NO otherwise. + */ +FOUNDATION_EXTERN BOOL FBLWaitForPromisesWithTimeout(NSTimeInterval timeout) NS_REFINED_FOR_SWIFT; + +@interface FBLPromise(TestingAdditions) + +/** + Dispatch group for promises that is typically used to wait for all scheduled blocks. + */ +@property(class, nonatomic, readonly) dispatch_group_t dispatchGroup NS_REFINED_FOR_SWIFT; + +/** + Properties to get the current state of the promise. + */ +@property(nonatomic, readonly) BOOL isPending NS_REFINED_FOR_SWIFT; +@property(nonatomic, readonly) BOOL isFulfilled NS_REFINED_FOR_SWIFT; +@property(nonatomic, readonly) BOOL isRejected NS_REFINED_FOR_SWIFT; + +/** + Value the promise was fulfilled with. + Can be nil if the promise is still pending, was resolved with nil or after it has been rejected. + */ +@property(nonatomic, readonly, nullable) Value value NS_REFINED_FOR_SWIFT; + +/** + Error the promise was rejected with. + Can be nil if the promise is still pending or after it has been fulfilled. + */ +@property(nonatomic, readonly, nullable) NSError *error NS_REFINED_FOR_SWIFT; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Then.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Then.h new file mode 100644 index 0000000..32027e6 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Then.h @@ -0,0 +1,63 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(ThenAdditions) + +typedef id __nullable (^FBLPromiseThenWorkBlock)(Value __nullable value) NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise which eventually gets resolved with resolution returned from `work` + block: either value, error or another promise. The `work` block is executed asynchronously only + when the receiver is fulfilled. If receiver is rejected, the returned promise is also rejected with + the same error. + + @param work A block to handle the value that receiver was fulfilled with. + @return A new pending promise to be resolved with resolution returned from the `work` block. + */ +- (FBLPromise *)then:(FBLPromiseThenWorkBlock)work NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise which eventually gets resolved with resolution returned from `work` + block: either value, error or another promise. The `work` block is executed asynchronously when the + receiver is fulfilled. If receiver is rejected, the returned promise is also rejected with the same + error. + + @param queue A queue to invoke the `work` block on. + @param work A block to handle the value that receiver was fulfilled with. + @return A new pending promise to be resolved with resolution returned from the `work` block. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + then:(FBLPromiseThenWorkBlock)work NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `then` operators. + Usage: promise.then(^id(id value) { ... }) + */ +@interface FBLPromise(DotSyntax_ThenAdditions) + +- (FBLPromise* (^)(FBLPromiseThenWorkBlock))then FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise* (^)(dispatch_queue_t, FBLPromiseThenWorkBlock))thenOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Timeout.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Timeout.h new file mode 100644 index 0000000..184ba16 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Timeout.h @@ -0,0 +1,57 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(TimeoutAdditions) + +/** + Waits for a promise with the specified `timeout`. + + @param interval Time to wait in seconds. + @return A new pending promise that gets either resolved with same resolution as the receiver or + rejected with `FBLPromiseErrorCodeTimedOut` error code in `FBLPromiseErrorDomain`. + */ +- (FBLPromise *)timeout:(NSTimeInterval)interval NS_SWIFT_UNAVAILABLE(""); + +/** + Waits for a promise with the specified `timeout`. + + @param queue A queue to dispatch on. + @param interval Time to wait in seconds. + @return A new pending promise that gets either resolved with same resolution as the receiver or + rejected with `FBLPromiseErrorCodeTimedOut` error code in `FBLPromiseErrorDomain`. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + timeout:(NSTimeInterval)interval NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `timeout` operators. + Usage: promise.timeout(...) + */ +@interface FBLPromise(DotSyntax_TimeoutAdditions) + +- (FBLPromise* (^)(NSTimeInterval))timeout FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise* (^)(dispatch_queue_t, NSTimeInterval))timeoutOn FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Validate.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Validate.h new file mode 100644 index 0000000..9dfa2f1 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Validate.h @@ -0,0 +1,60 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FBLPromise(ValidateAdditions) + +typedef BOOL (^FBLPromiseValidateWorkBlock)(Value __nullable value) NS_SWIFT_UNAVAILABLE(""); + +/** + Validates a fulfilled value or rejects the value if it can not be validated. + + @param predicate An expression to validate. + @return A new pending promise that gets either resolved with same resolution as the receiver or + rejected with `FBLPromiseErrorCodeValidationFailure` error code in `FBLPromiseErrorDomain`. + */ +- (FBLPromise *)validate:(FBLPromiseValidateWorkBlock)predicate NS_SWIFT_UNAVAILABLE(""); + +/** + Validates a fulfilled value or rejects the value if it can not be validated. + + @param queue A queue to dispatch on. + @param predicate An expression to validate. + @return A new pending promise that gets either resolved with same resolution as the receiver or + rejected with `FBLPromiseErrorCodeValidationFailure` error code in `FBLPromiseErrorDomain`. + */ +- (FBLPromise *)onQueue:(dispatch_queue_t)queue + validate:(FBLPromiseValidateWorkBlock)predicate NS_REFINED_FOR_SWIFT; + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `validate` operators. + Usage: promise.validate(^BOOL(id value) { ... }) + */ +@interface FBLPromise(DotSyntax_ValidateAdditions) + +- (FBLPromise * (^)(FBLPromiseValidateWorkBlock))validate FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); +- (FBLPromise * (^)(dispatch_queue_t, FBLPromiseValidateWorkBlock))validateOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Wrap.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Wrap.h new file mode 100644 index 0000000..664e1bb --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise+Wrap.h @@ -0,0 +1,316 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Different types of completion handlers available to be wrapped with promise. + */ +typedef void (^FBLPromiseCompletion)(void) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseObjectCompletion)(id __nullable) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseErrorCompletion)(NSError* __nullable) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseObjectOrErrorCompletion)(id __nullable, NSError* __nullable) + NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseErrorOrObjectCompletion)(NSError* __nullable, id __nullable) + NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromise2ObjectsOrErrorCompletion)(id __nullable, id __nullable, + NSError* __nullable) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseBoolCompletion)(BOOL) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseBoolOrErrorCompletion)(BOOL, NSError* __nullable) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseIntegerCompletion)(NSInteger) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseIntegerOrErrorCompletion)(NSInteger, NSError* __nullable) + NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseDoubleCompletion)(double) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseDoubleOrErrorCompletion)(double, NSError* __nullable) + NS_SWIFT_UNAVAILABLE(""); + +/** + Provides an easy way to convert methods that use common callback patterns into promises. + */ +@interface FBLPromise(WrapAdditions) + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with `nil` when completion handler is invoked. + */ ++ (instancetype)wrapCompletion:(void (^)(FBLPromiseCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with `nil` when completion handler is invoked. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapCompletion:(void (^)(FBLPromiseCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an object provided by completion handler. + */ ++ (instancetype)wrapObjectCompletion:(void (^)(FBLPromiseObjectCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an object provided by completion handler. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapObjectCompletion:(void (^)(FBLPromiseObjectCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an error provided by completion handler. + If error is `nil`, fulfills with `nil`, otherwise rejects with the error. + */ ++ (instancetype)wrapErrorCompletion:(void (^)(FBLPromiseErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an error provided by completion handler. + If error is `nil`, fulfills with `nil`, otherwise rejects with the error. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapErrorCompletion:(void (^)(FBLPromiseErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an object provided by completion handler if error is `nil`. + Otherwise, rejects with the error. + */ ++ (instancetype)wrapObjectOrErrorCompletion: + (void (^)(FBLPromiseObjectOrErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an object provided by completion handler if error is `nil`. + Otherwise, rejects with the error. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapObjectOrErrorCompletion:(void (^)(FBLPromiseObjectOrErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an error or object provided by completion handler. If error + is not `nil`, rejects with the error. + */ ++ (instancetype)wrapErrorOrObjectCompletion: + (void (^)(FBLPromiseErrorOrObjectCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an error or object provided by completion handler. If error + is not `nil`, rejects with the error. + */ ++ (instancetype)onQueue:(dispatch_queue_t)queue + wrapErrorOrObjectCompletion:(void (^)(FBLPromiseErrorOrObjectCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an array of objects provided by completion handler in order + if error is `nil`. Otherwise, rejects with the error. + */ ++ (FBLPromise*)wrap2ObjectsOrErrorCompletion: + (void (^)(FBLPromise2ObjectsOrErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an array of objects provided by completion handler in order + if error is `nil`. Otherwise, rejects with the error. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrap2ObjectsOrErrorCompletion:(void (^)(FBLPromise2ObjectsOrErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping YES/NO. + */ ++ (FBLPromise*)wrapBoolCompletion:(void (^)(FBLPromiseBoolCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping YES/NO. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapBoolCompletion:(void (^)(FBLPromiseBoolCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping YES/NO when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)wrapBoolOrErrorCompletion: + (void (^)(FBLPromiseBoolOrErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping YES/NO when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapBoolOrErrorCompletion:(void (^)(FBLPromiseBoolOrErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping an integer. + */ ++ (FBLPromise*)wrapIntegerCompletion:(void (^)(FBLPromiseIntegerCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping an integer. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapIntegerCompletion:(void (^)(FBLPromiseIntegerCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping an integer when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)wrapIntegerOrErrorCompletion: + (void (^)(FBLPromiseIntegerOrErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping an integer when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapIntegerOrErrorCompletion:(void (^)(FBLPromiseIntegerOrErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping a double. + */ ++ (FBLPromise*)wrapDoubleCompletion:(void (^)(FBLPromiseDoubleCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping a double. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapDoubleCompletion:(void (^)(FBLPromiseDoubleCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +/** + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping a double when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)wrapDoubleOrErrorCompletion: + (void (^)(FBLPromiseDoubleOrErrorCompletion handler))work NS_SWIFT_UNAVAILABLE(""); + +/** + @param queue A queue to invoke the `work` block on. + @param work A block to perform any operations needed to resolve the promise. + @returns A promise that resolves with an `NSNumber` wrapping a double when error is `nil`. + Otherwise rejects with the error. + */ ++ (FBLPromise*)onQueue:(dispatch_queue_t)queue + wrapDoubleOrErrorCompletion:(void (^)(FBLPromiseDoubleOrErrorCompletion handler))work + NS_SWIFT_UNAVAILABLE(""); + +@end + +/** + Convenience dot-syntax wrappers for `FBLPromise` `wrap` operators. + Usage: FBLPromise.wrapCompletion(^(FBLPromiseCompletion handler) {...}) + */ +@interface FBLPromise(DotSyntax_WrapAdditions) + ++ (FBLPromise* (^)(void (^)(FBLPromiseCompletion)))wrapCompletion FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromiseCompletion)))wrapCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseObjectCompletion)))wrapObjectCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromiseObjectCompletion)))wrapObjectCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseErrorCompletion)))wrapErrorCompletion FBL_PROMISES_DOT_SYNTAX + NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromiseErrorCompletion)))wrapErrorCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseObjectOrErrorCompletion)))wrapObjectOrErrorCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseObjectOrErrorCompletion)))wrapObjectOrErrorCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseErrorOrObjectCompletion)))wrapErrorOrObjectCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseErrorOrObjectCompletion)))wrapErrorOrObjectCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromise2ObjectsOrErrorCompletion))) + wrap2ObjectsOrErrorCompletion FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromise2ObjectsOrErrorCompletion))) + wrap2ObjectsOrErrorCompletionOn FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseBoolCompletion)))wrapBoolCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseBoolCompletion)))wrapBoolCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseBoolOrErrorCompletion)))wrapBoolOrErrorCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseBoolOrErrorCompletion)))wrapBoolOrErrorCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseIntegerCompletion)))wrapIntegerCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseIntegerCompletion)))wrapIntegerCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseIntegerOrErrorCompletion))) + wrapIntegerOrErrorCompletion FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromiseIntegerOrErrorCompletion))) + wrapIntegerOrErrorCompletionOn FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseDoubleCompletion)))wrapDoubleCompletion + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, + void (^)(FBLPromiseDoubleCompletion)))wrapDoubleCompletionOn + FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(void (^)(FBLPromiseDoubleOrErrorCompletion))) + wrapDoubleOrErrorCompletion FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (FBLPromise* (^)(dispatch_queue_t, void (^)(FBLPromiseDoubleOrErrorCompletion))) + wrapDoubleOrErrorCompletionOn FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise.h new file mode 100644 index 0000000..b1380dc --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromise.h @@ -0,0 +1,93 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromiseError.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Promises synchronization construct in Objective-C. + */ +@interface FBLPromise<__covariant Value> : NSObject + +/** + Default dispatch queue used for `FBLPromise`, which is `main` if a queue is not specified. + */ +@property(class) dispatch_queue_t defaultDispatchQueue NS_REFINED_FOR_SWIFT; + +/** + Creates a pending promise. + */ ++ (instancetype)pendingPromise NS_REFINED_FOR_SWIFT; + +/** + Creates a resolved promise. + + @param resolution An object to resolve the promise with: either a value or an error. + @return A new resolved promise. + */ ++ (instancetype)resolvedWith:(nullable id)resolution NS_REFINED_FOR_SWIFT; + +/** + Synchronously fulfills the promise with a value. + + @param value An arbitrary value to fulfill the promise with, including `nil`. + */ +- (void)fulfill:(nullable Value)value NS_REFINED_FOR_SWIFT; + +/** + Synchronously rejects the promise with an error. + + @param error An error to reject the promise with. + */ +- (void)reject:(NSError *)error NS_REFINED_FOR_SWIFT; + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; +@end + +@interface FBLPromise() + +/** + Adds an object to the set of pending objects to keep strongly while the promise is pending. + Used by the Swift wrappers to keep them alive until the underlying ObjC promise is resolved. + + @param object An object to add. + */ +- (void)addPendingObject:(id)object NS_REFINED_FOR_SWIFT; + +@end + +#ifdef FBL_PROMISES_DOT_SYNTAX_IS_DEPRECATED +#define FBL_PROMISES_DOT_SYNTAX __attribute__((deprecated)) +#else +#define FBL_PROMISES_DOT_SYNTAX +#endif + +@interface FBLPromise(DotSyntaxAdditions) + +/** + Convenience dot-syntax wrappers for FBLPromise. + Usage: FBLPromise.pending() + FBLPromise.resolved(value) + + */ ++ (instancetype (^)(void))pending FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); ++ (instancetype (^)(id __nullable))resolved FBL_PROMISES_DOT_SYNTAX NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromiseError.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromiseError.h new file mode 100644 index 0000000..d37af53 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromiseError.h @@ -0,0 +1,43 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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_EXTERN NSErrorDomain const FBLPromiseErrorDomain NS_REFINED_FOR_SWIFT; + +/** + Possible error codes in `FBLPromiseErrorDomain`. + */ +typedef NS_ENUM(NSInteger, FBLPromiseErrorCode) { + /** Promise failed to resolve in time. */ + FBLPromiseErrorCodeTimedOut = 1, + /** Validation predicate returned false. */ + FBLPromiseErrorCodeValidationFailure = 2, +} NS_REFINED_FOR_SWIFT; + +NS_INLINE BOOL FBLPromiseErrorIsTimedOut(NSError *error) NS_SWIFT_UNAVAILABLE("") { + return error.domain == FBLPromiseErrorDomain && + error.code == FBLPromiseErrorCodeTimedOut; +} + +NS_INLINE BOOL FBLPromiseErrorIsValidationFailure(NSError *error) NS_SWIFT_UNAVAILABLE("") { + return error.domain == FBLPromiseErrorDomain && + error.code == FBLPromiseErrorCodeValidationFailure; +} + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromisePrivate.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromisePrivate.h new file mode 100644 index 0000000..7a132f2 --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromisePrivate.h @@ -0,0 +1,66 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+Testing.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Miscellaneous low-level private interfaces available to extend standard FBLPromise functionality. + */ +@interface FBLPromise() + +typedef void (^FBLPromiseOnFulfillBlock)(Value __nullable value) NS_SWIFT_UNAVAILABLE(""); +typedef void (^FBLPromiseOnRejectBlock)(NSError *error) NS_SWIFT_UNAVAILABLE(""); +typedef id __nullable (^__nullable FBLPromiseChainedFulfillBlock)(Value __nullable value) + NS_SWIFT_UNAVAILABLE(""); +typedef id __nullable (^__nullable FBLPromiseChainedRejectBlock)(NSError *error) + NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a pending promise. + */ +- (instancetype)initPending NS_SWIFT_UNAVAILABLE(""); + +/** + Creates a resolved promise. + + @param resolution An object to resolve the promise with: either a value or an error. + @return A new resolved promise. + */ +- (instancetype)initWithResolution:(nullable id)resolution NS_SWIFT_UNAVAILABLE(""); + +/** + Invokes `fulfill` and `reject` blocks on `queue` when the receiver gets either fulfilled or + rejected respectively. + */ +- (void)observeOnQueue:(dispatch_queue_t)queue + fulfill:(FBLPromiseOnFulfillBlock)onFulfill + reject:(FBLPromiseOnRejectBlock)onReject NS_SWIFT_UNAVAILABLE(""); + +/** + Returns a new promise which gets resolved with the return value of `chainedFulfill` or + `chainedReject` blocks respectively. The blocks are invoked when the receiver gets either + fulfilled or rejected. If `nil` is passed to either block arg, the returned promise is resolved + with the same resolution as the receiver. + */ +- (FBLPromise *)chainOnQueue:(dispatch_queue_t)queue + chainedFulfill:(FBLPromiseChainedFulfillBlock)chainedFulfill + chainedReject:(FBLPromiseChainedRejectBlock)chainedReject NS_SWIFT_UNAVAILABLE(""); + +@end + +NS_ASSUME_NONNULL_END diff --git a/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromises.h b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromises.h new file mode 100644 index 0000000..2d90bad --- /dev/null +++ b/SaraAttended/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromises.h @@ -0,0 +1,32 @@ +/** + Copyright 2018 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 "FBLPromise+All.h" +#import "FBLPromise+Always.h" +#import "FBLPromise+Any.h" +#import "FBLPromise+Async.h" +#import "FBLPromise+Await.h" +#import "FBLPromise+Catch.h" +#import "FBLPromise+Delay.h" +#import "FBLPromise+Do.h" +#import "FBLPromise+Race.h" +#import "FBLPromise+Recover.h" +#import "FBLPromise+Reduce.h" +#import "FBLPromise+Retry.h" +#import "FBLPromise+Then.h" +#import "FBLPromise+Timeout.h" +#import "FBLPromise+Validate.h" +#import "FBLPromise+Wrap.h" diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-Info.plist b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-Info.plist new file mode 100644 index 0000000..294cbb9 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.7 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-dummy.m b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-dummy.m new file mode 100644 index 0000000..162155d --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_BoringSSL_GRPC : NSObject +@end +@implementation PodsDummy_BoringSSL_GRPC +@end diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch new file mode 100644 index 0000000..1098316 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch @@ -0,0 +1,3289 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#define a2i_GENERAL_NAME GRPC_SHADOW_a2i_GENERAL_NAME +#define a2i_ipadd GRPC_SHADOW_a2i_ipadd +#define a2i_IPADDRESS GRPC_SHADOW_a2i_IPADDRESS +#define a2i_IPADDRESS_NC GRPC_SHADOW_a2i_IPADDRESS_NC +#define abi_test_bad_unwind_temporary GRPC_SHADOW_abi_test_bad_unwind_temporary +#define abi_test_bad_unwind_wrong_register GRPC_SHADOW_abi_test_bad_unwind_wrong_register +#define abi_test_clobber_r10 GRPC_SHADOW_abi_test_clobber_r10 +#define abi_test_clobber_r11 GRPC_SHADOW_abi_test_clobber_r11 +#define abi_test_clobber_r12 GRPC_SHADOW_abi_test_clobber_r12 +#define abi_test_clobber_r13 GRPC_SHADOW_abi_test_clobber_r13 +#define abi_test_clobber_r14 GRPC_SHADOW_abi_test_clobber_r14 +#define abi_test_clobber_r15 GRPC_SHADOW_abi_test_clobber_r15 +#define abi_test_clobber_r8 GRPC_SHADOW_abi_test_clobber_r8 +#define abi_test_clobber_r9 GRPC_SHADOW_abi_test_clobber_r9 +#define abi_test_clobber_rax GRPC_SHADOW_abi_test_clobber_rax +#define abi_test_clobber_rbp GRPC_SHADOW_abi_test_clobber_rbp +#define abi_test_clobber_rbx GRPC_SHADOW_abi_test_clobber_rbx +#define abi_test_clobber_rcx GRPC_SHADOW_abi_test_clobber_rcx +#define abi_test_clobber_rdi GRPC_SHADOW_abi_test_clobber_rdi +#define abi_test_clobber_rdx GRPC_SHADOW_abi_test_clobber_rdx +#define abi_test_clobber_rsi GRPC_SHADOW_abi_test_clobber_rsi +#define abi_test_clobber_xmm0 GRPC_SHADOW_abi_test_clobber_xmm0 +#define abi_test_clobber_xmm1 GRPC_SHADOW_abi_test_clobber_xmm1 +#define abi_test_clobber_xmm10 GRPC_SHADOW_abi_test_clobber_xmm10 +#define abi_test_clobber_xmm11 GRPC_SHADOW_abi_test_clobber_xmm11 +#define abi_test_clobber_xmm12 GRPC_SHADOW_abi_test_clobber_xmm12 +#define abi_test_clobber_xmm13 GRPC_SHADOW_abi_test_clobber_xmm13 +#define abi_test_clobber_xmm14 GRPC_SHADOW_abi_test_clobber_xmm14 +#define abi_test_clobber_xmm15 GRPC_SHADOW_abi_test_clobber_xmm15 +#define abi_test_clobber_xmm2 GRPC_SHADOW_abi_test_clobber_xmm2 +#define abi_test_clobber_xmm3 GRPC_SHADOW_abi_test_clobber_xmm3 +#define abi_test_clobber_xmm4 GRPC_SHADOW_abi_test_clobber_xmm4 +#define abi_test_clobber_xmm5 GRPC_SHADOW_abi_test_clobber_xmm5 +#define abi_test_clobber_xmm6 GRPC_SHADOW_abi_test_clobber_xmm6 +#define abi_test_clobber_xmm7 GRPC_SHADOW_abi_test_clobber_xmm7 +#define abi_test_clobber_xmm8 GRPC_SHADOW_abi_test_clobber_xmm8 +#define abi_test_clobber_xmm9 GRPC_SHADOW_abi_test_clobber_xmm9 +#define abi_test_get_and_clear_direction_flag GRPC_SHADOW_abi_test_get_and_clear_direction_flag +#define abi_test_set_direction_flag GRPC_SHADOW_abi_test_set_direction_flag +#define abi_test_trampoline GRPC_SHADOW_abi_test_trampoline +#define abi_test_unwind_return GRPC_SHADOW_abi_test_unwind_return +#define abi_test_unwind_start GRPC_SHADOW_abi_test_unwind_start +#define abi_test_unwind_stop GRPC_SHADOW_abi_test_unwind_stop +#define ACCESS_DESCRIPTION_free GRPC_SHADOW_ACCESS_DESCRIPTION_free +#define ACCESS_DESCRIPTION_it GRPC_SHADOW_ACCESS_DESCRIPTION_it +#define ACCESS_DESCRIPTION_new GRPC_SHADOW_ACCESS_DESCRIPTION_new +#define aes128gcmsiv_aes_ks GRPC_SHADOW_aes128gcmsiv_aes_ks +#define aes128gcmsiv_aes_ks_enc_x1 GRPC_SHADOW_aes128gcmsiv_aes_ks_enc_x1 +#define aes128gcmsiv_dec GRPC_SHADOW_aes128gcmsiv_dec +#define aes128gcmsiv_ecb_enc_block GRPC_SHADOW_aes128gcmsiv_ecb_enc_block +#define aes128gcmsiv_enc_msg_x4 GRPC_SHADOW_aes128gcmsiv_enc_msg_x4 +#define aes128gcmsiv_enc_msg_x8 GRPC_SHADOW_aes128gcmsiv_enc_msg_x8 +#define aes128gcmsiv_kdf GRPC_SHADOW_aes128gcmsiv_kdf +#define aes256gcmsiv_aes_ks GRPC_SHADOW_aes256gcmsiv_aes_ks +#define aes256gcmsiv_aes_ks_enc_x1 GRPC_SHADOW_aes256gcmsiv_aes_ks_enc_x1 +#define aes256gcmsiv_dec GRPC_SHADOW_aes256gcmsiv_dec +#define aes256gcmsiv_ecb_enc_block GRPC_SHADOW_aes256gcmsiv_ecb_enc_block +#define aes256gcmsiv_enc_msg_x4 GRPC_SHADOW_aes256gcmsiv_enc_msg_x4 +#define aes256gcmsiv_enc_msg_x8 GRPC_SHADOW_aes256gcmsiv_enc_msg_x8 +#define aes256gcmsiv_kdf GRPC_SHADOW_aes256gcmsiv_kdf +#define AES_cbc_encrypt GRPC_SHADOW_AES_cbc_encrypt +#define AES_cfb128_encrypt GRPC_SHADOW_AES_cfb128_encrypt +#define AES_CMAC GRPC_SHADOW_AES_CMAC +#define AES_ctr128_encrypt GRPC_SHADOW_AES_ctr128_encrypt +#define aes_ctr_set_key GRPC_SHADOW_aes_ctr_set_key +#define AES_decrypt GRPC_SHADOW_AES_decrypt +#define AES_ecb_encrypt GRPC_SHADOW_AES_ecb_encrypt +#define AES_encrypt GRPC_SHADOW_AES_encrypt +#define aesgcmsiv_htable6_init GRPC_SHADOW_aesgcmsiv_htable6_init +#define aesgcmsiv_htable_init GRPC_SHADOW_aesgcmsiv_htable_init +#define aesgcmsiv_htable_polyval GRPC_SHADOW_aesgcmsiv_htable_polyval +#define aesgcmsiv_polyval_horner GRPC_SHADOW_aesgcmsiv_polyval_horner +#define aes_hw_cbc_encrypt GRPC_SHADOW_aes_hw_cbc_encrypt +#define aes_hw_ctr32_encrypt_blocks GRPC_SHADOW_aes_hw_ctr32_encrypt_blocks +#define aes_hw_decrypt GRPC_SHADOW_aes_hw_decrypt +#define aes_hw_ecb_encrypt GRPC_SHADOW_aes_hw_ecb_encrypt +#define aes_hw_encrypt GRPC_SHADOW_aes_hw_encrypt +#define aes_hw_set_decrypt_key GRPC_SHADOW_aes_hw_set_decrypt_key +#define aes_hw_set_encrypt_key GRPC_SHADOW_aes_hw_set_encrypt_key +#define aesni_gcm_decrypt GRPC_SHADOW_aesni_gcm_decrypt +#define aesni_gcm_encrypt GRPC_SHADOW_aesni_gcm_encrypt +#define aes_nohw_cbc_encrypt GRPC_SHADOW_aes_nohw_cbc_encrypt +#define aes_nohw_ctr32_encrypt_blocks GRPC_SHADOW_aes_nohw_ctr32_encrypt_blocks +#define aes_nohw_decrypt GRPC_SHADOW_aes_nohw_decrypt +#define aes_nohw_encrypt GRPC_SHADOW_aes_nohw_encrypt +#define aes_nohw_set_decrypt_key GRPC_SHADOW_aes_nohw_set_decrypt_key +#define aes_nohw_set_encrypt_key GRPC_SHADOW_aes_nohw_set_encrypt_key +#define AES_ofb128_encrypt GRPC_SHADOW_AES_ofb128_encrypt +#define AES_set_decrypt_key GRPC_SHADOW_AES_set_decrypt_key +#define AES_set_encrypt_key GRPC_SHADOW_AES_set_encrypt_key +#define AES_unwrap_key GRPC_SHADOW_AES_unwrap_key +#define AES_unwrap_key_padded GRPC_SHADOW_AES_unwrap_key_padded +#define AES_wrap_key GRPC_SHADOW_AES_wrap_key +#define AES_wrap_key_padded GRPC_SHADOW_AES_wrap_key_padded +#define ASN1_ANY_it GRPC_SHADOW_ASN1_ANY_it +#define ASN1_BIT_STRING_check GRPC_SHADOW_ASN1_BIT_STRING_check +#define ASN1_BIT_STRING_free GRPC_SHADOW_ASN1_BIT_STRING_free +#define ASN1_BIT_STRING_get_bit GRPC_SHADOW_ASN1_BIT_STRING_get_bit +#define ASN1_BIT_STRING_it GRPC_SHADOW_ASN1_BIT_STRING_it +#define ASN1_BIT_STRING_new GRPC_SHADOW_ASN1_BIT_STRING_new +#define ASN1_BIT_STRING_set GRPC_SHADOW_ASN1_BIT_STRING_set +#define ASN1_BIT_STRING_set_bit GRPC_SHADOW_ASN1_BIT_STRING_set_bit +#define ASN1_BMPSTRING_free GRPC_SHADOW_ASN1_BMPSTRING_free +#define ASN1_BMPSTRING_it GRPC_SHADOW_ASN1_BMPSTRING_it +#define ASN1_BMPSTRING_new GRPC_SHADOW_ASN1_BMPSTRING_new +#define ASN1_BOOLEAN_it GRPC_SHADOW_ASN1_BOOLEAN_it +#define ASN1_digest GRPC_SHADOW_ASN1_digest +#define asn1_do_adb GRPC_SHADOW_asn1_do_adb +#define asn1_enc_free GRPC_SHADOW_asn1_enc_free +#define asn1_enc_init GRPC_SHADOW_asn1_enc_init +#define asn1_enc_restore GRPC_SHADOW_asn1_enc_restore +#define asn1_enc_save GRPC_SHADOW_asn1_enc_save +#define ASN1_ENUMERATED_free GRPC_SHADOW_ASN1_ENUMERATED_free +#define ASN1_ENUMERATED_get GRPC_SHADOW_ASN1_ENUMERATED_get +#define ASN1_ENUMERATED_it GRPC_SHADOW_ASN1_ENUMERATED_it +#define ASN1_ENUMERATED_new GRPC_SHADOW_ASN1_ENUMERATED_new +#define ASN1_ENUMERATED_set GRPC_SHADOW_ASN1_ENUMERATED_set +#define ASN1_ENUMERATED_to_BN GRPC_SHADOW_ASN1_ENUMERATED_to_BN +#define asn1_ex_c2i GRPC_SHADOW_asn1_ex_c2i +#define asn1_ex_i2c GRPC_SHADOW_asn1_ex_i2c +#define ASN1_FBOOLEAN_it GRPC_SHADOW_ASN1_FBOOLEAN_it +#define ASN1_GENERALIZEDTIME_adj GRPC_SHADOW_ASN1_GENERALIZEDTIME_adj +#define ASN1_GENERALIZEDTIME_check GRPC_SHADOW_ASN1_GENERALIZEDTIME_check +#define ASN1_GENERALIZEDTIME_free GRPC_SHADOW_ASN1_GENERALIZEDTIME_free +#define ASN1_GENERALIZEDTIME_it GRPC_SHADOW_ASN1_GENERALIZEDTIME_it +#define ASN1_GENERALIZEDTIME_new GRPC_SHADOW_ASN1_GENERALIZEDTIME_new +#define ASN1_GENERALIZEDTIME_print GRPC_SHADOW_ASN1_GENERALIZEDTIME_print +#define ASN1_GENERALIZEDTIME_set GRPC_SHADOW_ASN1_GENERALIZEDTIME_set +#define ASN1_GENERALIZEDTIME_set_string GRPC_SHADOW_ASN1_GENERALIZEDTIME_set_string +#define asn1_generalizedtime_to_tm GRPC_SHADOW_asn1_generalizedtime_to_tm +#define ASN1_GENERALSTRING_free GRPC_SHADOW_ASN1_GENERALSTRING_free +#define ASN1_GENERALSTRING_it GRPC_SHADOW_ASN1_GENERALSTRING_it +#define ASN1_GENERALSTRING_new GRPC_SHADOW_ASN1_GENERALSTRING_new +#define ASN1_generate_nconf GRPC_SHADOW_ASN1_generate_nconf +#define ASN1_generate_v3 GRPC_SHADOW_ASN1_generate_v3 +#define asn1_get_choice_selector GRPC_SHADOW_asn1_get_choice_selector +#define asn1_get_field_ptr GRPC_SHADOW_asn1_get_field_ptr +#define ASN1_get_object GRPC_SHADOW_ASN1_get_object +#define ASN1_IA5STRING_free GRPC_SHADOW_ASN1_IA5STRING_free +#define ASN1_IA5STRING_it GRPC_SHADOW_ASN1_IA5STRING_it +#define ASN1_IA5STRING_new GRPC_SHADOW_ASN1_IA5STRING_new +#define ASN1_INTEGER_cmp GRPC_SHADOW_ASN1_INTEGER_cmp +#define ASN1_INTEGER_dup GRPC_SHADOW_ASN1_INTEGER_dup +#define ASN1_INTEGER_free GRPC_SHADOW_ASN1_INTEGER_free +#define ASN1_INTEGER_get GRPC_SHADOW_ASN1_INTEGER_get +#define ASN1_INTEGER_it GRPC_SHADOW_ASN1_INTEGER_it +#define ASN1_INTEGER_new GRPC_SHADOW_ASN1_INTEGER_new +#define ASN1_INTEGER_set GRPC_SHADOW_ASN1_INTEGER_set +#define ASN1_INTEGER_set_uint64 GRPC_SHADOW_ASN1_INTEGER_set_uint64 +#define ASN1_INTEGER_to_BN GRPC_SHADOW_ASN1_INTEGER_to_BN +#define asn1_item_combine_free GRPC_SHADOW_asn1_item_combine_free +#define ASN1_item_d2i GRPC_SHADOW_ASN1_item_d2i +#define ASN1_item_d2i_bio GRPC_SHADOW_ASN1_item_d2i_bio +#define ASN1_item_d2i_fp GRPC_SHADOW_ASN1_item_d2i_fp +#define ASN1_item_digest GRPC_SHADOW_ASN1_item_digest +#define ASN1_item_dup GRPC_SHADOW_ASN1_item_dup +#define ASN1_item_ex_d2i GRPC_SHADOW_ASN1_item_ex_d2i +#define ASN1_item_ex_free GRPC_SHADOW_ASN1_item_ex_free +#define ASN1_item_ex_i2d GRPC_SHADOW_ASN1_item_ex_i2d +#define ASN1_item_ex_new GRPC_SHADOW_ASN1_item_ex_new +#define ASN1_item_free GRPC_SHADOW_ASN1_item_free +#define ASN1_item_i2d GRPC_SHADOW_ASN1_item_i2d +#define ASN1_item_i2d_bio GRPC_SHADOW_ASN1_item_i2d_bio +#define ASN1_item_i2d_fp GRPC_SHADOW_ASN1_item_i2d_fp +#define ASN1_item_ndef_i2d GRPC_SHADOW_ASN1_item_ndef_i2d +#define ASN1_item_new GRPC_SHADOW_ASN1_item_new +#define ASN1_item_pack GRPC_SHADOW_ASN1_item_pack +#define ASN1_item_sign GRPC_SHADOW_ASN1_item_sign +#define ASN1_item_sign_ctx GRPC_SHADOW_ASN1_item_sign_ctx +#define ASN1_item_unpack GRPC_SHADOW_ASN1_item_unpack +#define ASN1_item_verify GRPC_SHADOW_ASN1_item_verify +#define ASN1_mbstring_copy GRPC_SHADOW_ASN1_mbstring_copy +#define ASN1_mbstring_ncopy GRPC_SHADOW_ASN1_mbstring_ncopy +#define ASN1_NULL_free GRPC_SHADOW_ASN1_NULL_free +#define ASN1_NULL_it GRPC_SHADOW_ASN1_NULL_it +#define ASN1_NULL_new GRPC_SHADOW_ASN1_NULL_new +#define ASN1_OBJECT_create GRPC_SHADOW_ASN1_OBJECT_create +#define ASN1_OBJECT_free GRPC_SHADOW_ASN1_OBJECT_free +#define ASN1_OBJECT_it GRPC_SHADOW_ASN1_OBJECT_it +#define ASN1_OBJECT_new GRPC_SHADOW_ASN1_OBJECT_new +#define ASN1_object_size GRPC_SHADOW_ASN1_object_size +#define ASN1_OCTET_STRING_cmp GRPC_SHADOW_ASN1_OCTET_STRING_cmp +#define ASN1_OCTET_STRING_dup GRPC_SHADOW_ASN1_OCTET_STRING_dup +#define ASN1_OCTET_STRING_free GRPC_SHADOW_ASN1_OCTET_STRING_free +#define ASN1_OCTET_STRING_it GRPC_SHADOW_ASN1_OCTET_STRING_it +#define ASN1_OCTET_STRING_NDEF_it GRPC_SHADOW_ASN1_OCTET_STRING_NDEF_it +#define ASN1_OCTET_STRING_new GRPC_SHADOW_ASN1_OCTET_STRING_new +#define ASN1_OCTET_STRING_set GRPC_SHADOW_ASN1_OCTET_STRING_set +#define ASN1_primitive_free GRPC_SHADOW_ASN1_primitive_free +#define ASN1_primitive_new GRPC_SHADOW_ASN1_primitive_new +#define ASN1_PRINTABLE_free GRPC_SHADOW_ASN1_PRINTABLE_free +#define ASN1_PRINTABLE_it GRPC_SHADOW_ASN1_PRINTABLE_it +#define ASN1_PRINTABLE_new GRPC_SHADOW_ASN1_PRINTABLE_new +#define ASN1_PRINTABLESTRING_free GRPC_SHADOW_ASN1_PRINTABLESTRING_free +#define ASN1_PRINTABLESTRING_it GRPC_SHADOW_ASN1_PRINTABLESTRING_it +#define ASN1_PRINTABLESTRING_new GRPC_SHADOW_ASN1_PRINTABLESTRING_new +#define ASN1_PRINTABLE_type GRPC_SHADOW_ASN1_PRINTABLE_type +#define ASN1_put_eoc GRPC_SHADOW_ASN1_put_eoc +#define ASN1_put_object GRPC_SHADOW_ASN1_put_object +#define asn1_refcount_dec_and_test_zero GRPC_SHADOW_asn1_refcount_dec_and_test_zero +#define asn1_refcount_set_one GRPC_SHADOW_asn1_refcount_set_one +#define ASN1_SEQUENCE_ANY_it GRPC_SHADOW_ASN1_SEQUENCE_ANY_it +#define ASN1_SEQUENCE_it GRPC_SHADOW_ASN1_SEQUENCE_it +#define ASN1_SET_ANY_it GRPC_SHADOW_ASN1_SET_ANY_it +#define asn1_set_choice_selector GRPC_SHADOW_asn1_set_choice_selector +#define ASN1_STRING_cmp GRPC_SHADOW_ASN1_STRING_cmp +#define ASN1_STRING_copy GRPC_SHADOW_ASN1_STRING_copy +#define ASN1_STRING_data GRPC_SHADOW_ASN1_STRING_data +#define ASN1_STRING_dup GRPC_SHADOW_ASN1_STRING_dup +#define ASN1_STRING_free GRPC_SHADOW_ASN1_STRING_free +#define ASN1_STRING_get0_data GRPC_SHADOW_ASN1_STRING_get0_data +#define ASN1_STRING_get_default_mask GRPC_SHADOW_ASN1_STRING_get_default_mask +#define ASN1_STRING_length GRPC_SHADOW_ASN1_STRING_length +#define ASN1_STRING_length_set GRPC_SHADOW_ASN1_STRING_length_set +#define ASN1_STRING_new GRPC_SHADOW_ASN1_STRING_new +#define ASN1_STRING_print GRPC_SHADOW_ASN1_STRING_print +#define ASN1_STRING_print_ex GRPC_SHADOW_ASN1_STRING_print_ex +#define ASN1_STRING_print_ex_fp GRPC_SHADOW_ASN1_STRING_print_ex_fp +#define ASN1_STRING_set GRPC_SHADOW_ASN1_STRING_set +#define ASN1_STRING_set0 GRPC_SHADOW_ASN1_STRING_set0 +#define ASN1_STRING_set_by_NID GRPC_SHADOW_ASN1_STRING_set_by_NID +#define ASN1_STRING_set_default_mask GRPC_SHADOW_ASN1_STRING_set_default_mask +#define ASN1_STRING_set_default_mask_asc GRPC_SHADOW_ASN1_STRING_set_default_mask_asc +#define ASN1_STRING_TABLE_add GRPC_SHADOW_ASN1_STRING_TABLE_add +#define ASN1_STRING_TABLE_cleanup GRPC_SHADOW_ASN1_STRING_TABLE_cleanup +#define ASN1_STRING_TABLE_get GRPC_SHADOW_ASN1_STRING_TABLE_get +#define ASN1_STRING_to_UTF8 GRPC_SHADOW_ASN1_STRING_to_UTF8 +#define ASN1_STRING_type GRPC_SHADOW_ASN1_STRING_type +#define ASN1_STRING_type_new GRPC_SHADOW_ASN1_STRING_type_new +#define ASN1_T61STRING_free GRPC_SHADOW_ASN1_T61STRING_free +#define ASN1_T61STRING_it GRPC_SHADOW_ASN1_T61STRING_it +#define ASN1_T61STRING_new GRPC_SHADOW_ASN1_T61STRING_new +#define ASN1_tag2bit GRPC_SHADOW_ASN1_tag2bit +#define ASN1_tag2str GRPC_SHADOW_ASN1_tag2str +#define ASN1_TBOOLEAN_it GRPC_SHADOW_ASN1_TBOOLEAN_it +#define ASN1_template_free GRPC_SHADOW_ASN1_template_free +#define ASN1_template_new GRPC_SHADOW_ASN1_template_new +#define ASN1_TIME_adj GRPC_SHADOW_ASN1_TIME_adj +#define ASN1_TIME_check GRPC_SHADOW_ASN1_TIME_check +#define ASN1_TIME_diff GRPC_SHADOW_ASN1_TIME_diff +#define ASN1_TIME_free GRPC_SHADOW_ASN1_TIME_free +#define ASN1_TIME_it GRPC_SHADOW_ASN1_TIME_it +#define ASN1_TIME_new GRPC_SHADOW_ASN1_TIME_new +#define ASN1_TIME_print GRPC_SHADOW_ASN1_TIME_print +#define ASN1_TIME_set GRPC_SHADOW_ASN1_TIME_set +#define ASN1_TIME_set_string GRPC_SHADOW_ASN1_TIME_set_string +#define ASN1_TIME_to_generalizedtime GRPC_SHADOW_ASN1_TIME_to_generalizedtime +#define ASN1_TYPE_cmp GRPC_SHADOW_ASN1_TYPE_cmp +#define ASN1_TYPE_free GRPC_SHADOW_ASN1_TYPE_free +#define ASN1_TYPE_get GRPC_SHADOW_ASN1_TYPE_get +#define ASN1_TYPE_new GRPC_SHADOW_ASN1_TYPE_new +#define ASN1_TYPE_set GRPC_SHADOW_ASN1_TYPE_set +#define ASN1_TYPE_set1 GRPC_SHADOW_ASN1_TYPE_set1 +#define ASN1_UNIVERSALSTRING_free GRPC_SHADOW_ASN1_UNIVERSALSTRING_free +#define ASN1_UNIVERSALSTRING_it GRPC_SHADOW_ASN1_UNIVERSALSTRING_it +#define ASN1_UNIVERSALSTRING_new GRPC_SHADOW_ASN1_UNIVERSALSTRING_new +#define ASN1_UTCTIME_adj GRPC_SHADOW_ASN1_UTCTIME_adj +#define ASN1_UTCTIME_check GRPC_SHADOW_ASN1_UTCTIME_check +#define ASN1_UTCTIME_cmp_time_t GRPC_SHADOW_ASN1_UTCTIME_cmp_time_t +#define ASN1_UTCTIME_free GRPC_SHADOW_ASN1_UTCTIME_free +#define ASN1_UTCTIME_it GRPC_SHADOW_ASN1_UTCTIME_it +#define ASN1_UTCTIME_new GRPC_SHADOW_ASN1_UTCTIME_new +#define ASN1_UTCTIME_print GRPC_SHADOW_ASN1_UTCTIME_print +#define ASN1_UTCTIME_set GRPC_SHADOW_ASN1_UTCTIME_set +#define ASN1_UTCTIME_set_string GRPC_SHADOW_ASN1_UTCTIME_set_string +#define asn1_utctime_to_tm GRPC_SHADOW_asn1_utctime_to_tm +#define ASN1_UTF8STRING_free GRPC_SHADOW_ASN1_UTF8STRING_free +#define ASN1_UTF8STRING_it GRPC_SHADOW_ASN1_UTF8STRING_it +#define ASN1_UTF8STRING_new GRPC_SHADOW_ASN1_UTF8STRING_new +#define ASN1_VISIBLESTRING_free GRPC_SHADOW_ASN1_VISIBLESTRING_free +#define ASN1_VISIBLESTRING_it GRPC_SHADOW_ASN1_VISIBLESTRING_it +#define ASN1_VISIBLESTRING_new GRPC_SHADOW_ASN1_VISIBLESTRING_new +#define AUTHORITY_INFO_ACCESS_free GRPC_SHADOW_AUTHORITY_INFO_ACCESS_free +#define AUTHORITY_INFO_ACCESS_it GRPC_SHADOW_AUTHORITY_INFO_ACCESS_it +#define AUTHORITY_INFO_ACCESS_new GRPC_SHADOW_AUTHORITY_INFO_ACCESS_new +#define AUTHORITY_KEYID_free GRPC_SHADOW_AUTHORITY_KEYID_free +#define AUTHORITY_KEYID_it GRPC_SHADOW_AUTHORITY_KEYID_it +#define AUTHORITY_KEYID_new GRPC_SHADOW_AUTHORITY_KEYID_new +#define BASIC_CONSTRAINTS_free GRPC_SHADOW_BASIC_CONSTRAINTS_free +#define BASIC_CONSTRAINTS_it GRPC_SHADOW_BASIC_CONSTRAINTS_it +#define BASIC_CONSTRAINTS_new GRPC_SHADOW_BASIC_CONSTRAINTS_new +#define beeu_mod_inverse_vartime GRPC_SHADOW_beeu_mod_inverse_vartime +#define BIO_append_filename GRPC_SHADOW_BIO_append_filename +#define BIO_callback_ctrl GRPC_SHADOW_BIO_callback_ctrl +#define BIO_clear_flags GRPC_SHADOW_BIO_clear_flags +#define BIO_clear_retry_flags GRPC_SHADOW_BIO_clear_retry_flags +#define bio_clear_socket_error GRPC_SHADOW_bio_clear_socket_error +#define BIO_copy_next_retry GRPC_SHADOW_BIO_copy_next_retry +#define BIO_ctrl GRPC_SHADOW_BIO_ctrl +#define BIO_ctrl_get_read_request GRPC_SHADOW_BIO_ctrl_get_read_request +#define BIO_ctrl_get_write_guarantee GRPC_SHADOW_BIO_ctrl_get_write_guarantee +#define BIO_ctrl_pending GRPC_SHADOW_BIO_ctrl_pending +#define BIO_do_connect GRPC_SHADOW_BIO_do_connect +#define BIO_eof GRPC_SHADOW_BIO_eof +#define bio_fd_should_retry GRPC_SHADOW_bio_fd_should_retry +#define BIO_find_type GRPC_SHADOW_BIO_find_type +#define BIO_flush GRPC_SHADOW_BIO_flush +#define BIO_free GRPC_SHADOW_BIO_free +#define BIO_free_all GRPC_SHADOW_BIO_free_all +#define BIO_f_ssl GRPC_SHADOW_BIO_f_ssl +#define BIO_get_data GRPC_SHADOW_BIO_get_data +#define BIO_get_fd GRPC_SHADOW_BIO_get_fd +#define BIO_get_fp GRPC_SHADOW_BIO_get_fp +#define BIO_get_init GRPC_SHADOW_BIO_get_init +#define BIO_get_mem_data GRPC_SHADOW_BIO_get_mem_data +#define BIO_get_mem_ptr GRPC_SHADOW_BIO_get_mem_ptr +#define BIO_get_new_index GRPC_SHADOW_BIO_get_new_index +#define BIO_get_retry_flags GRPC_SHADOW_BIO_get_retry_flags +#define BIO_get_retry_reason GRPC_SHADOW_BIO_get_retry_reason +#define BIO_gets GRPC_SHADOW_BIO_gets +#define BIO_get_shutdown GRPC_SHADOW_BIO_get_shutdown +#define BIO_hexdump GRPC_SHADOW_BIO_hexdump +#define BIO_indent GRPC_SHADOW_BIO_indent +#define BIO_int_ctrl GRPC_SHADOW_BIO_int_ctrl +#define bio_ip_and_port_to_socket_and_addr GRPC_SHADOW_bio_ip_and_port_to_socket_and_addr +#define BIO_mem_contents GRPC_SHADOW_BIO_mem_contents +#define BIO_meth_free GRPC_SHADOW_BIO_meth_free +#define BIO_meth_new GRPC_SHADOW_BIO_meth_new +#define BIO_method_type GRPC_SHADOW_BIO_method_type +#define BIO_meth_set_create GRPC_SHADOW_BIO_meth_set_create +#define BIO_meth_set_ctrl GRPC_SHADOW_BIO_meth_set_ctrl +#define BIO_meth_set_destroy GRPC_SHADOW_BIO_meth_set_destroy +#define BIO_meth_set_gets GRPC_SHADOW_BIO_meth_set_gets +#define BIO_meth_set_puts GRPC_SHADOW_BIO_meth_set_puts +#define BIO_meth_set_read GRPC_SHADOW_BIO_meth_set_read +#define BIO_meth_set_write GRPC_SHADOW_BIO_meth_set_write +#define BIO_new GRPC_SHADOW_BIO_new +#define BIO_new_bio_pair GRPC_SHADOW_BIO_new_bio_pair +#define BIO_new_connect GRPC_SHADOW_BIO_new_connect +#define BIO_new_fd GRPC_SHADOW_BIO_new_fd +#define BIO_new_file GRPC_SHADOW_BIO_new_file +#define BIO_new_fp GRPC_SHADOW_BIO_new_fp +#define BIO_new_mem_buf GRPC_SHADOW_BIO_new_mem_buf +#define BIO_new_socket GRPC_SHADOW_BIO_new_socket +#define BIO_next GRPC_SHADOW_BIO_next +#define BIO_number_read GRPC_SHADOW_BIO_number_read +#define BIO_number_written GRPC_SHADOW_BIO_number_written +#define BIO_pending GRPC_SHADOW_BIO_pending +#define BIO_pop GRPC_SHADOW_BIO_pop +#define BIO_printf GRPC_SHADOW_BIO_printf +#define BIO_ptr_ctrl GRPC_SHADOW_BIO_ptr_ctrl +#define BIO_push GRPC_SHADOW_BIO_push +#define BIO_puts GRPC_SHADOW_BIO_puts +#define BIO_read GRPC_SHADOW_BIO_read +#define BIO_read_asn1 GRPC_SHADOW_BIO_read_asn1 +#define BIO_read_filename GRPC_SHADOW_BIO_read_filename +#define BIO_reset GRPC_SHADOW_BIO_reset +#define BIO_rw_filename GRPC_SHADOW_BIO_rw_filename +#define BIO_s_connect GRPC_SHADOW_BIO_s_connect +#define BIO_set_close GRPC_SHADOW_BIO_set_close +#define BIO_set_conn_hostname GRPC_SHADOW_BIO_set_conn_hostname +#define BIO_set_conn_int_port GRPC_SHADOW_BIO_set_conn_int_port +#define BIO_set_conn_port GRPC_SHADOW_BIO_set_conn_port +#define BIO_set_data GRPC_SHADOW_BIO_set_data +#define BIO_set_fd GRPC_SHADOW_BIO_set_fd +#define BIO_set_flags GRPC_SHADOW_BIO_set_flags +#define BIO_set_fp GRPC_SHADOW_BIO_set_fp +#define BIO_set_init GRPC_SHADOW_BIO_set_init +#define BIO_set_mem_buf GRPC_SHADOW_BIO_set_mem_buf +#define BIO_set_mem_eof_return GRPC_SHADOW_BIO_set_mem_eof_return +#define BIO_set_nbio GRPC_SHADOW_BIO_set_nbio +#define BIO_set_retry_read GRPC_SHADOW_BIO_set_retry_read +#define BIO_set_retry_special GRPC_SHADOW_BIO_set_retry_special +#define BIO_set_retry_write GRPC_SHADOW_BIO_set_retry_write +#define BIO_set_shutdown GRPC_SHADOW_BIO_set_shutdown +#define BIO_set_ssl GRPC_SHADOW_BIO_set_ssl +#define BIO_set_write_buffer_size GRPC_SHADOW_BIO_set_write_buffer_size +#define BIO_s_fd GRPC_SHADOW_BIO_s_fd +#define BIO_s_file GRPC_SHADOW_BIO_s_file +#define BIO_should_io_special GRPC_SHADOW_BIO_should_io_special +#define BIO_should_read GRPC_SHADOW_BIO_should_read +#define BIO_should_retry GRPC_SHADOW_BIO_should_retry +#define BIO_should_write GRPC_SHADOW_BIO_should_write +#define BIO_shutdown_wr GRPC_SHADOW_BIO_shutdown_wr +#define BIO_s_mem GRPC_SHADOW_BIO_s_mem +#define BIO_snprintf GRPC_SHADOW_BIO_snprintf +#define bio_sock_error GRPC_SHADOW_bio_sock_error +#define bio_socket_nbio GRPC_SHADOW_bio_socket_nbio +#define BIO_s_socket GRPC_SHADOW_BIO_s_socket +#define BIO_test_flags GRPC_SHADOW_BIO_test_flags +#define BIO_up_ref GRPC_SHADOW_BIO_up_ref +#define BIO_vfree GRPC_SHADOW_BIO_vfree +#define BIO_vsnprintf GRPC_SHADOW_BIO_vsnprintf +#define BIO_wpending GRPC_SHADOW_BIO_wpending +#define BIO_write GRPC_SHADOW_BIO_write +#define BIO_write_all GRPC_SHADOW_BIO_write_all +#define BIO_write_filename GRPC_SHADOW_BIO_write_filename +#define BN_abs_is_word GRPC_SHADOW_BN_abs_is_word +#define bn_abs_sub_consttime GRPC_SHADOW_bn_abs_sub_consttime +#define BN_add GRPC_SHADOW_BN_add +#define BN_add_word GRPC_SHADOW_BN_add_word +#define bn_add_words GRPC_SHADOW_bn_add_words +#define BN_asc2bn GRPC_SHADOW_BN_asc2bn +#define BN_bin2bn GRPC_SHADOW_BN_bin2bn +#define BN_BLINDING_convert GRPC_SHADOW_BN_BLINDING_convert +#define BN_BLINDING_free GRPC_SHADOW_BN_BLINDING_free +#define BN_BLINDING_invert GRPC_SHADOW_BN_BLINDING_invert +#define BN_BLINDING_new GRPC_SHADOW_BN_BLINDING_new +#define BN_bn2bin GRPC_SHADOW_BN_bn2bin +#define BN_bn2binpad GRPC_SHADOW_BN_bn2binpad +#define BN_bn2bin_padded GRPC_SHADOW_BN_bn2bin_padded +#define BN_bn2cbb_padded GRPC_SHADOW_BN_bn2cbb_padded +#define BN_bn2dec GRPC_SHADOW_BN_bn2dec +#define BN_bn2hex GRPC_SHADOW_BN_bn2hex +#define BN_bn2le_padded GRPC_SHADOW_BN_bn2le_padded +#define BN_bn2mpi GRPC_SHADOW_BN_bn2mpi +#define BN_clear GRPC_SHADOW_BN_clear +#define BN_clear_bit GRPC_SHADOW_BN_clear_bit +#define BN_clear_free GRPC_SHADOW_BN_clear_free +#define BN_cmp GRPC_SHADOW_BN_cmp +#define BN_cmp_word GRPC_SHADOW_BN_cmp_word +#define BN_copy GRPC_SHADOW_BN_copy +#define bn_copy_words GRPC_SHADOW_bn_copy_words +#define BN_count_low_zero_bits GRPC_SHADOW_BN_count_low_zero_bits +#define BN_CTX_end GRPC_SHADOW_BN_CTX_end +#define BN_CTX_free GRPC_SHADOW_BN_CTX_free +#define BN_CTX_get GRPC_SHADOW_BN_CTX_get +#define BN_CTX_new GRPC_SHADOW_BN_CTX_new +#define BN_CTX_start GRPC_SHADOW_BN_CTX_start +#define BN_dec2bn GRPC_SHADOW_BN_dec2bn +#define BN_div GRPC_SHADOW_BN_div +#define bn_div_consttime GRPC_SHADOW_bn_div_consttime +#define BN_div_word GRPC_SHADOW_BN_div_word +#define BN_dup GRPC_SHADOW_BN_dup +#define BN_enhanced_miller_rabin_primality_test GRPC_SHADOW_BN_enhanced_miller_rabin_primality_test +#define BN_equal_consttime GRPC_SHADOW_BN_equal_consttime +#define BN_exp GRPC_SHADOW_BN_exp +#define bn_expand GRPC_SHADOW_bn_expand +#define bn_fits_in_words GRPC_SHADOW_bn_fits_in_words +#define BN_free GRPC_SHADOW_BN_free +#define bn_from_montgomery GRPC_SHADOW_bn_from_montgomery +#define BN_from_montgomery GRPC_SHADOW_BN_from_montgomery +#define bn_from_montgomery_small GRPC_SHADOW_bn_from_montgomery_small +#define bn_gather5 GRPC_SHADOW_bn_gather5 +#define BN_gcd GRPC_SHADOW_BN_gcd +#define BN_GENCB_call GRPC_SHADOW_BN_GENCB_call +#define BN_GENCB_set GRPC_SHADOW_BN_GENCB_set +#define BN_generate_prime_ex GRPC_SHADOW_BN_generate_prime_ex +#define BN_get_rfc3526_prime_1536 GRPC_SHADOW_BN_get_rfc3526_prime_1536 +#define BN_get_u64 GRPC_SHADOW_BN_get_u64 +#define BN_get_word GRPC_SHADOW_BN_get_word +#define BN_hex2bn GRPC_SHADOW_BN_hex2bn +#define BN_init GRPC_SHADOW_BN_init +#define bn_in_range_words GRPC_SHADOW_bn_in_range_words +#define BN_is_bit_set GRPC_SHADOW_BN_is_bit_set +#define bn_is_bit_set_words GRPC_SHADOW_bn_is_bit_set_words +#define BN_is_negative GRPC_SHADOW_BN_is_negative +#define BN_is_odd GRPC_SHADOW_BN_is_odd +#define BN_is_one GRPC_SHADOW_BN_is_one +#define BN_is_pow2 GRPC_SHADOW_BN_is_pow2 +#define BN_is_prime_ex GRPC_SHADOW_BN_is_prime_ex +#define BN_is_prime_fasttest_ex GRPC_SHADOW_BN_is_prime_fasttest_ex +#define bn_is_relatively_prime GRPC_SHADOW_bn_is_relatively_prime +#define BN_is_word GRPC_SHADOW_BN_is_word +#define BN_is_zero GRPC_SHADOW_BN_is_zero +#define bn_jacobi GRPC_SHADOW_bn_jacobi +#define bn_lcm_consttime GRPC_SHADOW_bn_lcm_consttime +#define BN_le2bn GRPC_SHADOW_BN_le2bn +#define bn_less_than_montgomery_R GRPC_SHADOW_bn_less_than_montgomery_R +#define bn_less_than_words GRPC_SHADOW_bn_less_than_words +#define BN_lshift GRPC_SHADOW_BN_lshift +#define BN_lshift1 GRPC_SHADOW_BN_lshift1 +#define BN_marshal_asn1 GRPC_SHADOW_BN_marshal_asn1 +#define BN_mask_bits GRPC_SHADOW_BN_mask_bits +#define bn_miller_rabin_init GRPC_SHADOW_bn_miller_rabin_init +#define bn_miller_rabin_iteration GRPC_SHADOW_bn_miller_rabin_iteration +#define bn_minimal_width GRPC_SHADOW_bn_minimal_width +#define BN_mod_add GRPC_SHADOW_BN_mod_add +#define bn_mod_add_consttime GRPC_SHADOW_bn_mod_add_consttime +#define BN_mod_add_quick GRPC_SHADOW_BN_mod_add_quick +#define bn_mod_add_words GRPC_SHADOW_bn_mod_add_words +#define BN_mod_exp GRPC_SHADOW_BN_mod_exp +#define BN_mod_exp2_mont GRPC_SHADOW_BN_mod_exp2_mont +#define bn_mod_exp_base_2_consttime GRPC_SHADOW_bn_mod_exp_base_2_consttime +#define BN_mod_exp_mont GRPC_SHADOW_BN_mod_exp_mont +#define BN_mod_exp_mont_consttime GRPC_SHADOW_BN_mod_exp_mont_consttime +#define bn_mod_exp_mont_small GRPC_SHADOW_bn_mod_exp_mont_small +#define BN_mod_exp_mont_word GRPC_SHADOW_BN_mod_exp_mont_word +#define BN_mod_inverse GRPC_SHADOW_BN_mod_inverse +#define BN_mod_inverse_blinded GRPC_SHADOW_BN_mod_inverse_blinded +#define bn_mod_inverse_consttime GRPC_SHADOW_bn_mod_inverse_consttime +#define BN_mod_inverse_odd GRPC_SHADOW_BN_mod_inverse_odd +#define bn_mod_inverse_prime GRPC_SHADOW_bn_mod_inverse_prime +#define bn_mod_inverse_prime_mont_small GRPC_SHADOW_bn_mod_inverse_prime_mont_small +#define bn_mod_inverse_secret_prime GRPC_SHADOW_bn_mod_inverse_secret_prime +#define BN_mod_lshift GRPC_SHADOW_BN_mod_lshift +#define BN_mod_lshift1 GRPC_SHADOW_BN_mod_lshift1 +#define bn_mod_lshift1_consttime GRPC_SHADOW_bn_mod_lshift1_consttime +#define BN_mod_lshift1_quick GRPC_SHADOW_BN_mod_lshift1_quick +#define bn_mod_lshift_consttime GRPC_SHADOW_bn_mod_lshift_consttime +#define BN_mod_lshift_quick GRPC_SHADOW_BN_mod_lshift_quick +#define BN_mod_mul GRPC_SHADOW_BN_mod_mul +#define BN_mod_mul_montgomery GRPC_SHADOW_BN_mod_mul_montgomery +#define bn_mod_mul_montgomery_small GRPC_SHADOW_bn_mod_mul_montgomery_small +#define BN_mod_pow2 GRPC_SHADOW_BN_mod_pow2 +#define BN_mod_sqr GRPC_SHADOW_BN_mod_sqr +#define BN_mod_sqrt GRPC_SHADOW_BN_mod_sqrt +#define BN_mod_sub GRPC_SHADOW_BN_mod_sub +#define bn_mod_sub_consttime GRPC_SHADOW_bn_mod_sub_consttime +#define BN_mod_sub_quick GRPC_SHADOW_BN_mod_sub_quick +#define bn_mod_sub_words GRPC_SHADOW_bn_mod_sub_words +#define bn_mod_u16_consttime GRPC_SHADOW_bn_mod_u16_consttime +#define BN_mod_word GRPC_SHADOW_BN_mod_word +#define BN_MONT_CTX_copy GRPC_SHADOW_BN_MONT_CTX_copy +#define BN_MONT_CTX_free GRPC_SHADOW_BN_MONT_CTX_free +#define BN_MONT_CTX_new GRPC_SHADOW_BN_MONT_CTX_new +#define BN_MONT_CTX_new_consttime GRPC_SHADOW_BN_MONT_CTX_new_consttime +#define BN_MONT_CTX_new_for_modulus GRPC_SHADOW_BN_MONT_CTX_new_for_modulus +#define BN_MONT_CTX_set GRPC_SHADOW_BN_MONT_CTX_set +#define BN_MONT_CTX_set_locked GRPC_SHADOW_BN_MONT_CTX_set_locked +#define bn_mont_n0 GRPC_SHADOW_bn_mont_n0 +#define BN_mpi2bn GRPC_SHADOW_BN_mpi2bn +#define BN_mul GRPC_SHADOW_BN_mul +#define bn_mul_add_words GRPC_SHADOW_bn_mul_add_words +#define bn_mul_comba4 GRPC_SHADOW_bn_mul_comba4 +#define bn_mul_comba8 GRPC_SHADOW_bn_mul_comba8 +#define bn_mul_consttime GRPC_SHADOW_bn_mul_consttime +#define bn_mul_mont GRPC_SHADOW_bn_mul_mont +#define bn_mul_mont_gather5 GRPC_SHADOW_bn_mul_mont_gather5 +#define bn_mul_small GRPC_SHADOW_bn_mul_small +#define BN_mul_word GRPC_SHADOW_BN_mul_word +#define bn_mul_words GRPC_SHADOW_bn_mul_words +#define BN_new GRPC_SHADOW_BN_new +#define BN_nnmod GRPC_SHADOW_BN_nnmod +#define BN_nnmod_pow2 GRPC_SHADOW_BN_nnmod_pow2 +#define BN_num_bits GRPC_SHADOW_BN_num_bits +#define BN_num_bits_word GRPC_SHADOW_BN_num_bits_word +#define BN_num_bytes GRPC_SHADOW_BN_num_bytes +#define bn_odd_number_is_obviously_composite GRPC_SHADOW_bn_odd_number_is_obviously_composite +#define BN_one GRPC_SHADOW_BN_one +#define bn_one_to_montgomery GRPC_SHADOW_bn_one_to_montgomery +#define BN_parse_asn1_unsigned GRPC_SHADOW_BN_parse_asn1_unsigned +#define bn_power5 GRPC_SHADOW_bn_power5 +#define BN_primality_test GRPC_SHADOW_BN_primality_test +#define BN_print GRPC_SHADOW_BN_print +#define BN_print_fp GRPC_SHADOW_BN_print_fp +#define BN_pseudo_rand GRPC_SHADOW_BN_pseudo_rand +#define BN_pseudo_rand_range GRPC_SHADOW_BN_pseudo_rand_range +#define BN_rand GRPC_SHADOW_BN_rand +#define BN_rand_range GRPC_SHADOW_BN_rand_range +#define BN_rand_range_ex GRPC_SHADOW_BN_rand_range_ex +#define bn_rand_range_words GRPC_SHADOW_bn_rand_range_words +#define bn_rand_secret_range GRPC_SHADOW_bn_rand_secret_range +#define bn_reduce_once GRPC_SHADOW_bn_reduce_once +#define bn_reduce_once_in_place GRPC_SHADOW_bn_reduce_once_in_place +#define bn_resize_words GRPC_SHADOW_bn_resize_words +#define BN_rshift GRPC_SHADOW_BN_rshift +#define BN_rshift1 GRPC_SHADOW_BN_rshift1 +#define bn_rshift1_words GRPC_SHADOW_bn_rshift1_words +#define bn_rshift_secret_shift GRPC_SHADOW_bn_rshift_secret_shift +#define bn_rshift_words GRPC_SHADOW_bn_rshift_words +#define bn_scatter5 GRPC_SHADOW_bn_scatter5 +#define bn_select_words GRPC_SHADOW_bn_select_words +#define BN_set_bit GRPC_SHADOW_BN_set_bit +#define bn_set_minimal_width GRPC_SHADOW_bn_set_minimal_width +#define BN_set_negative GRPC_SHADOW_BN_set_negative +#define BN_set_u64 GRPC_SHADOW_BN_set_u64 +#define BN_set_word GRPC_SHADOW_BN_set_word +#define bn_set_words GRPC_SHADOW_bn_set_words +#define BN_sqr GRPC_SHADOW_BN_sqr +#define bn_sqr8x_internal GRPC_SHADOW_bn_sqr8x_internal +#define bn_sqr_comba4 GRPC_SHADOW_bn_sqr_comba4 +#define bn_sqr_comba8 GRPC_SHADOW_bn_sqr_comba8 +#define bn_sqr_consttime GRPC_SHADOW_bn_sqr_consttime +#define bn_sqr_small GRPC_SHADOW_bn_sqr_small +#define BN_sqrt GRPC_SHADOW_BN_sqrt +#define bn_sqr_words GRPC_SHADOW_bn_sqr_words +#define bn_sqrx8x_internal GRPC_SHADOW_bn_sqrx8x_internal +#define BN_sub GRPC_SHADOW_BN_sub +#define BN_sub_word GRPC_SHADOW_BN_sub_word +#define bn_sub_words GRPC_SHADOW_bn_sub_words +#define BN_to_ASN1_ENUMERATED GRPC_SHADOW_BN_to_ASN1_ENUMERATED +#define BN_to_ASN1_INTEGER GRPC_SHADOW_BN_to_ASN1_INTEGER +#define BN_to_montgomery GRPC_SHADOW_BN_to_montgomery +#define bn_to_montgomery_small GRPC_SHADOW_bn_to_montgomery_small +#define BN_uadd GRPC_SHADOW_BN_uadd +#define bn_uadd_consttime GRPC_SHADOW_bn_uadd_consttime +#define BN_ucmp GRPC_SHADOW_BN_ucmp +#define BN_usub GRPC_SHADOW_BN_usub +#define bn_usub_consttime GRPC_SHADOW_bn_usub_consttime +#define BN_value_one GRPC_SHADOW_BN_value_one +#define bn_wexpand GRPC_SHADOW_bn_wexpand +#define BN_zero GRPC_SHADOW_BN_zero +#define boringssl_fips_self_test GRPC_SHADOW_boringssl_fips_self_test +#define BORINGSSL_self_test GRPC_SHADOW_BORINGSSL_self_test +#define BUF_MEM_append GRPC_SHADOW_BUF_MEM_append +#define BUF_memdup GRPC_SHADOW_BUF_memdup +#define BUF_MEM_free GRPC_SHADOW_BUF_MEM_free +#define BUF_MEM_grow GRPC_SHADOW_BUF_MEM_grow +#define BUF_MEM_grow_clean GRPC_SHADOW_BUF_MEM_grow_clean +#define BUF_MEM_new GRPC_SHADOW_BUF_MEM_new +#define BUF_MEM_reserve GRPC_SHADOW_BUF_MEM_reserve +#define BUF_strdup GRPC_SHADOW_BUF_strdup +#define BUF_strlcat GRPC_SHADOW_BUF_strlcat +#define BUF_strlcpy GRPC_SHADOW_BUF_strlcpy +#define BUF_strndup GRPC_SHADOW_BUF_strndup +#define BUF_strnlen GRPC_SHADOW_BUF_strnlen +#define c2i_ASN1_BIT_STRING GRPC_SHADOW_c2i_ASN1_BIT_STRING +#define c2i_ASN1_INTEGER GRPC_SHADOW_c2i_ASN1_INTEGER +#define c2i_ASN1_OBJECT GRPC_SHADOW_c2i_ASN1_OBJECT +#define CBB_add_asn1 GRPC_SHADOW_CBB_add_asn1 +#define CBB_add_asn1_bool GRPC_SHADOW_CBB_add_asn1_bool +#define CBB_add_asn1_int64 GRPC_SHADOW_CBB_add_asn1_int64 +#define CBB_add_asn1_octet_string GRPC_SHADOW_CBB_add_asn1_octet_string +#define CBB_add_asn1_oid_from_text GRPC_SHADOW_CBB_add_asn1_oid_from_text +#define CBB_add_asn1_uint64 GRPC_SHADOW_CBB_add_asn1_uint64 +#define CBB_add_bytes GRPC_SHADOW_CBB_add_bytes +#define cbb_add_latin1 GRPC_SHADOW_cbb_add_latin1 +#define CBB_add_space GRPC_SHADOW_CBB_add_space +#define CBB_add_u16 GRPC_SHADOW_CBB_add_u16 +#define CBB_add_u16le GRPC_SHADOW_CBB_add_u16le +#define CBB_add_u16_length_prefixed GRPC_SHADOW_CBB_add_u16_length_prefixed +#define CBB_add_u24 GRPC_SHADOW_CBB_add_u24 +#define CBB_add_u24_length_prefixed GRPC_SHADOW_CBB_add_u24_length_prefixed +#define CBB_add_u32 GRPC_SHADOW_CBB_add_u32 +#define CBB_add_u32le GRPC_SHADOW_CBB_add_u32le +#define CBB_add_u64 GRPC_SHADOW_CBB_add_u64 +#define CBB_add_u64le GRPC_SHADOW_CBB_add_u64le +#define CBB_add_u8 GRPC_SHADOW_CBB_add_u8 +#define CBB_add_u8_length_prefixed GRPC_SHADOW_CBB_add_u8_length_prefixed +#define cbb_add_ucs2_be GRPC_SHADOW_cbb_add_ucs2_be +#define cbb_add_utf32_be GRPC_SHADOW_cbb_add_utf32_be +#define cbb_add_utf8 GRPC_SHADOW_cbb_add_utf8 +#define CBB_cleanup GRPC_SHADOW_CBB_cleanup +#define CBB_data GRPC_SHADOW_CBB_data +#define CBB_did_write GRPC_SHADOW_CBB_did_write +#define CBB_discard_child GRPC_SHADOW_CBB_discard_child +#define CBB_finish GRPC_SHADOW_CBB_finish +#define CBB_finish_i2d GRPC_SHADOW_CBB_finish_i2d +#define CBB_flush GRPC_SHADOW_CBB_flush +#define CBB_flush_asn1_set_of GRPC_SHADOW_CBB_flush_asn1_set_of +#define cbb_get_utf8_len GRPC_SHADOW_cbb_get_utf8_len +#define CBB_init GRPC_SHADOW_CBB_init +#define CBB_init_fixed GRPC_SHADOW_CBB_init_fixed +#define CBB_len GRPC_SHADOW_CBB_len +#define CBB_reserve GRPC_SHADOW_CBB_reserve +#define CBB_zero GRPC_SHADOW_CBB_zero +#define CBS_asn1_ber_to_der GRPC_SHADOW_CBS_asn1_ber_to_der +#define CBS_asn1_bitstring_has_bit GRPC_SHADOW_CBS_asn1_bitstring_has_bit +#define CBS_asn1_oid_to_text GRPC_SHADOW_CBS_asn1_oid_to_text +#define CBS_contains_zero_byte GRPC_SHADOW_CBS_contains_zero_byte +#define CBS_copy_bytes GRPC_SHADOW_CBS_copy_bytes +#define CBS_data GRPC_SHADOW_CBS_data +#define CBS_get_any_asn1 GRPC_SHADOW_CBS_get_any_asn1 +#define CBS_get_any_asn1_element GRPC_SHADOW_CBS_get_any_asn1_element +#define CBS_get_any_ber_asn1_element GRPC_SHADOW_CBS_get_any_ber_asn1_element +#define CBS_get_asn1 GRPC_SHADOW_CBS_get_asn1 +#define CBS_get_asn1_bool GRPC_SHADOW_CBS_get_asn1_bool +#define CBS_get_asn1_element GRPC_SHADOW_CBS_get_asn1_element +#define CBS_get_asn1_implicit_string GRPC_SHADOW_CBS_get_asn1_implicit_string +#define CBS_get_asn1_int64 GRPC_SHADOW_CBS_get_asn1_int64 +#define CBS_get_asn1_uint64 GRPC_SHADOW_CBS_get_asn1_uint64 +#define CBS_get_bytes GRPC_SHADOW_CBS_get_bytes +#define CBS_get_last_u8 GRPC_SHADOW_CBS_get_last_u8 +#define cbs_get_latin1 GRPC_SHADOW_cbs_get_latin1 +#define CBS_get_optional_asn1 GRPC_SHADOW_CBS_get_optional_asn1 +#define CBS_get_optional_asn1_bool GRPC_SHADOW_CBS_get_optional_asn1_bool +#define CBS_get_optional_asn1_octet_string GRPC_SHADOW_CBS_get_optional_asn1_octet_string +#define CBS_get_optional_asn1_uint64 GRPC_SHADOW_CBS_get_optional_asn1_uint64 +#define CBS_get_u16 GRPC_SHADOW_CBS_get_u16 +#define CBS_get_u16le GRPC_SHADOW_CBS_get_u16le +#define CBS_get_u16_length_prefixed GRPC_SHADOW_CBS_get_u16_length_prefixed +#define CBS_get_u24 GRPC_SHADOW_CBS_get_u24 +#define CBS_get_u24_length_prefixed GRPC_SHADOW_CBS_get_u24_length_prefixed +#define CBS_get_u32 GRPC_SHADOW_CBS_get_u32 +#define CBS_get_u32le GRPC_SHADOW_CBS_get_u32le +#define CBS_get_u64 GRPC_SHADOW_CBS_get_u64 +#define CBS_get_u64le GRPC_SHADOW_CBS_get_u64le +#define CBS_get_u8 GRPC_SHADOW_CBS_get_u8 +#define CBS_get_u8_length_prefixed GRPC_SHADOW_CBS_get_u8_length_prefixed +#define cbs_get_ucs2_be GRPC_SHADOW_cbs_get_ucs2_be +#define cbs_get_utf32_be GRPC_SHADOW_cbs_get_utf32_be +#define cbs_get_utf8 GRPC_SHADOW_cbs_get_utf8 +#define CBS_init GRPC_SHADOW_CBS_init +#define CBS_is_valid_asn1_bitstring GRPC_SHADOW_CBS_is_valid_asn1_bitstring +#define CBS_len GRPC_SHADOW_CBS_len +#define CBS_mem_equal GRPC_SHADOW_CBS_mem_equal +#define CBS_peek_asn1_tag GRPC_SHADOW_CBS_peek_asn1_tag +#define CBS_skip GRPC_SHADOW_CBS_skip +#define CBS_stow GRPC_SHADOW_CBS_stow +#define CBS_strdup GRPC_SHADOW_CBS_strdup +#define CERTIFICATEPOLICIES_free GRPC_SHADOW_CERTIFICATEPOLICIES_free +#define CERTIFICATEPOLICIES_it GRPC_SHADOW_CERTIFICATEPOLICIES_it +#define CERTIFICATEPOLICIES_new GRPC_SHADOW_CERTIFICATEPOLICIES_new +#define ChaCha20_ctr32 GRPC_SHADOW_ChaCha20_ctr32 +#define chacha20_poly1305_open GRPC_SHADOW_chacha20_poly1305_open +#define chacha20_poly1305_seal GRPC_SHADOW_chacha20_poly1305_seal +#define CMAC_CTX_copy GRPC_SHADOW_CMAC_CTX_copy +#define CMAC_CTX_free GRPC_SHADOW_CMAC_CTX_free +#define CMAC_CTX_new GRPC_SHADOW_CMAC_CTX_new +#define CMAC_Final GRPC_SHADOW_CMAC_Final +#define CMAC_Init GRPC_SHADOW_CMAC_Init +#define CMAC_Reset GRPC_SHADOW_CMAC_Reset +#define CMAC_Update GRPC_SHADOW_CMAC_Update +#define CONF_modules_free GRPC_SHADOW_CONF_modules_free +#define CONF_modules_load_file GRPC_SHADOW_CONF_modules_load_file +#define CONF_parse_list GRPC_SHADOW_CONF_parse_list +#define CONF_VALUE_new GRPC_SHADOW_CONF_VALUE_new +#define CRL_DIST_POINTS_free GRPC_SHADOW_CRL_DIST_POINTS_free +#define CRL_DIST_POINTS_it GRPC_SHADOW_CRL_DIST_POINTS_it +#define CRL_DIST_POINTS_new GRPC_SHADOW_CRL_DIST_POINTS_new +#define CRYPTO_BUFFER_alloc GRPC_SHADOW_CRYPTO_BUFFER_alloc +#define CRYPTO_BUFFER_data GRPC_SHADOW_CRYPTO_BUFFER_data +#define CRYPTO_BUFFER_free GRPC_SHADOW_CRYPTO_BUFFER_free +#define CRYPTO_BUFFER_init_CBS GRPC_SHADOW_CRYPTO_BUFFER_init_CBS +#define CRYPTO_BUFFER_len GRPC_SHADOW_CRYPTO_BUFFER_len +#define CRYPTO_BUFFER_new GRPC_SHADOW_CRYPTO_BUFFER_new +#define CRYPTO_BUFFER_new_from_CBS GRPC_SHADOW_CRYPTO_BUFFER_new_from_CBS +#define CRYPTO_BUFFER_POOL_free GRPC_SHADOW_CRYPTO_BUFFER_POOL_free +#define CRYPTO_BUFFER_POOL_new GRPC_SHADOW_CRYPTO_BUFFER_POOL_new +#define CRYPTO_BUFFER_up_ref GRPC_SHADOW_CRYPTO_BUFFER_up_ref +#define CRYPTO_cbc128_decrypt GRPC_SHADOW_CRYPTO_cbc128_decrypt +#define CRYPTO_cbc128_encrypt GRPC_SHADOW_CRYPTO_cbc128_encrypt +#define CRYPTO_cfb128_1_encrypt GRPC_SHADOW_CRYPTO_cfb128_1_encrypt +#define CRYPTO_cfb128_8_encrypt GRPC_SHADOW_CRYPTO_cfb128_8_encrypt +#define CRYPTO_cfb128_encrypt GRPC_SHADOW_CRYPTO_cfb128_encrypt +#define CRYPTO_chacha_20 GRPC_SHADOW_CRYPTO_chacha_20 +#define CRYPTO_cleanup_all_ex_data GRPC_SHADOW_CRYPTO_cleanup_all_ex_data +#define CRYPTO_ctr128_encrypt GRPC_SHADOW_CRYPTO_ctr128_encrypt +#define CRYPTO_ctr128_encrypt_ctr32 GRPC_SHADOW_CRYPTO_ctr128_encrypt_ctr32 +#define CRYPTO_free_ex_data GRPC_SHADOW_CRYPTO_free_ex_data +#define CRYPTO_gcm128_aad GRPC_SHADOW_CRYPTO_gcm128_aad +#define CRYPTO_gcm128_decrypt GRPC_SHADOW_CRYPTO_gcm128_decrypt +#define CRYPTO_gcm128_decrypt_ctr32 GRPC_SHADOW_CRYPTO_gcm128_decrypt_ctr32 +#define CRYPTO_gcm128_encrypt GRPC_SHADOW_CRYPTO_gcm128_encrypt +#define CRYPTO_gcm128_encrypt_ctr32 GRPC_SHADOW_CRYPTO_gcm128_encrypt_ctr32 +#define CRYPTO_gcm128_finish GRPC_SHADOW_CRYPTO_gcm128_finish +#define CRYPTO_gcm128_init_key GRPC_SHADOW_CRYPTO_gcm128_init_key +#define CRYPTO_gcm128_setiv GRPC_SHADOW_CRYPTO_gcm128_setiv +#define CRYPTO_gcm128_tag GRPC_SHADOW_CRYPTO_gcm128_tag +#define crypto_gcm_clmul_enabled GRPC_SHADOW_crypto_gcm_clmul_enabled +#define CRYPTO_get_dynlock_create_callback GRPC_SHADOW_CRYPTO_get_dynlock_create_callback +#define CRYPTO_get_dynlock_destroy_callback GRPC_SHADOW_CRYPTO_get_dynlock_destroy_callback +#define CRYPTO_get_dynlock_lock_callback GRPC_SHADOW_CRYPTO_get_dynlock_lock_callback +#define CRYPTO_get_ex_data GRPC_SHADOW_CRYPTO_get_ex_data +#define CRYPTO_get_ex_new_index GRPC_SHADOW_CRYPTO_get_ex_new_index +#define CRYPTO_get_locking_callback GRPC_SHADOW_CRYPTO_get_locking_callback +#define CRYPTO_get_lock_name GRPC_SHADOW_CRYPTO_get_lock_name +#define CRYPTO_get_thread_local GRPC_SHADOW_CRYPTO_get_thread_local +#define CRYPTO_ghash_init GRPC_SHADOW_CRYPTO_ghash_init +#define CRYPTO_has_asm GRPC_SHADOW_CRYPTO_has_asm +#define CRYPTO_hchacha20 GRPC_SHADOW_CRYPTO_hchacha20 +#define CRYPTO_is_confidential_build GRPC_SHADOW_CRYPTO_is_confidential_build +#define CRYPTO_library_init GRPC_SHADOW_CRYPTO_library_init +#define CRYPTO_malloc_init GRPC_SHADOW_CRYPTO_malloc_init +#define CRYPTO_memcmp GRPC_SHADOW_CRYPTO_memcmp +#define CRYPTO_MUTEX_cleanup GRPC_SHADOW_CRYPTO_MUTEX_cleanup +#define CRYPTO_MUTEX_init GRPC_SHADOW_CRYPTO_MUTEX_init +#define CRYPTO_MUTEX_lock_read GRPC_SHADOW_CRYPTO_MUTEX_lock_read +#define CRYPTO_MUTEX_lock_write GRPC_SHADOW_CRYPTO_MUTEX_lock_write +#define CRYPTO_MUTEX_unlock_read GRPC_SHADOW_CRYPTO_MUTEX_unlock_read +#define CRYPTO_MUTEX_unlock_write GRPC_SHADOW_CRYPTO_MUTEX_unlock_write +#define CRYPTO_new_ex_data GRPC_SHADOW_CRYPTO_new_ex_data +#define CRYPTO_num_locks GRPC_SHADOW_CRYPTO_num_locks +#define CRYPTO_ofb128_encrypt GRPC_SHADOW_CRYPTO_ofb128_encrypt +#define CRYPTO_once GRPC_SHADOW_CRYPTO_once +#define CRYPTO_poly1305_finish GRPC_SHADOW_CRYPTO_poly1305_finish +#define CRYPTO_poly1305_init GRPC_SHADOW_CRYPTO_poly1305_init +#define CRYPTO_poly1305_update GRPC_SHADOW_CRYPTO_poly1305_update +#define CRYPTO_POLYVAL_finish GRPC_SHADOW_CRYPTO_POLYVAL_finish +#define CRYPTO_POLYVAL_init GRPC_SHADOW_CRYPTO_POLYVAL_init +#define CRYPTO_POLYVAL_update_blocks GRPC_SHADOW_CRYPTO_POLYVAL_update_blocks +#define CRYPTO_rdrand GRPC_SHADOW_CRYPTO_rdrand +#define CRYPTO_rdrand_multiple8_buf GRPC_SHADOW_CRYPTO_rdrand_multiple8_buf +#define CRYPTO_refcount_dec_and_test_zero GRPC_SHADOW_CRYPTO_refcount_dec_and_test_zero +#define CRYPTO_refcount_inc GRPC_SHADOW_CRYPTO_refcount_inc +#define CRYPTO_set_add_lock_callback GRPC_SHADOW_CRYPTO_set_add_lock_callback +#define CRYPTO_set_dynlock_create_callback GRPC_SHADOW_CRYPTO_set_dynlock_create_callback +#define CRYPTO_set_dynlock_destroy_callback GRPC_SHADOW_CRYPTO_set_dynlock_destroy_callback +#define CRYPTO_set_dynlock_lock_callback GRPC_SHADOW_CRYPTO_set_dynlock_lock_callback +#define CRYPTO_set_ex_data GRPC_SHADOW_CRYPTO_set_ex_data +#define CRYPTO_set_id_callback GRPC_SHADOW_CRYPTO_set_id_callback +#define CRYPTO_set_locking_callback GRPC_SHADOW_CRYPTO_set_locking_callback +#define CRYPTO_set_thread_local GRPC_SHADOW_CRYPTO_set_thread_local +#define CRYPTO_STATIC_MUTEX_lock_read GRPC_SHADOW_CRYPTO_STATIC_MUTEX_lock_read +#define CRYPTO_STATIC_MUTEX_lock_write GRPC_SHADOW_CRYPTO_STATIC_MUTEX_lock_write +#define CRYPTO_STATIC_MUTEX_unlock_read GRPC_SHADOW_CRYPTO_STATIC_MUTEX_unlock_read +#define CRYPTO_STATIC_MUTEX_unlock_write GRPC_SHADOW_CRYPTO_STATIC_MUTEX_unlock_write +#define CRYPTO_sysrand GRPC_SHADOW_CRYPTO_sysrand +#define CRYPTO_THREADID_current GRPC_SHADOW_CRYPTO_THREADID_current +#define CRYPTO_THREADID_set_callback GRPC_SHADOW_CRYPTO_THREADID_set_callback +#define CRYPTO_THREADID_set_numeric GRPC_SHADOW_CRYPTO_THREADID_set_numeric +#define CRYPTO_THREADID_set_pointer GRPC_SHADOW_CRYPTO_THREADID_set_pointer +#define CRYPTO_tls1_prf GRPC_SHADOW_CRYPTO_tls1_prf +#define CTR_DRBG_clear GRPC_SHADOW_CTR_DRBG_clear +#define CTR_DRBG_generate GRPC_SHADOW_CTR_DRBG_generate +#define CTR_DRBG_init GRPC_SHADOW_CTR_DRBG_init +#define CTR_DRBG_reseed GRPC_SHADOW_CTR_DRBG_reseed +#define d2i_ACCESS_DESCRIPTION GRPC_SHADOW_d2i_ACCESS_DESCRIPTION +#define d2i_ASN1_BIT_STRING GRPC_SHADOW_d2i_ASN1_BIT_STRING +#define d2i_ASN1_BMPSTRING GRPC_SHADOW_d2i_ASN1_BMPSTRING +#define d2i_ASN1_BOOLEAN GRPC_SHADOW_d2i_ASN1_BOOLEAN +#define d2i_ASN1_ENUMERATED GRPC_SHADOW_d2i_ASN1_ENUMERATED +#define d2i_ASN1_GENERALIZEDTIME GRPC_SHADOW_d2i_ASN1_GENERALIZEDTIME +#define d2i_ASN1_GENERALSTRING GRPC_SHADOW_d2i_ASN1_GENERALSTRING +#define d2i_ASN1_IA5STRING GRPC_SHADOW_d2i_ASN1_IA5STRING +#define d2i_ASN1_INTEGER GRPC_SHADOW_d2i_ASN1_INTEGER +#define d2i_ASN1_NULL GRPC_SHADOW_d2i_ASN1_NULL +#define d2i_ASN1_OBJECT GRPC_SHADOW_d2i_ASN1_OBJECT +#define d2i_ASN1_OCTET_STRING GRPC_SHADOW_d2i_ASN1_OCTET_STRING +#define d2i_ASN1_PRINTABLE GRPC_SHADOW_d2i_ASN1_PRINTABLE +#define d2i_ASN1_PRINTABLESTRING GRPC_SHADOW_d2i_ASN1_PRINTABLESTRING +#define d2i_ASN1_SEQUENCE_ANY GRPC_SHADOW_d2i_ASN1_SEQUENCE_ANY +#define d2i_ASN1_SET_ANY GRPC_SHADOW_d2i_ASN1_SET_ANY +#define d2i_ASN1_T61STRING GRPC_SHADOW_d2i_ASN1_T61STRING +#define d2i_ASN1_TIME GRPC_SHADOW_d2i_ASN1_TIME +#define d2i_ASN1_TYPE GRPC_SHADOW_d2i_ASN1_TYPE +#define d2i_ASN1_UNIVERSALSTRING GRPC_SHADOW_d2i_ASN1_UNIVERSALSTRING +#define d2i_ASN1_UTCTIME GRPC_SHADOW_d2i_ASN1_UTCTIME +#define d2i_ASN1_UTF8STRING GRPC_SHADOW_d2i_ASN1_UTF8STRING +#define d2i_ASN1_VISIBLESTRING GRPC_SHADOW_d2i_ASN1_VISIBLESTRING +#define d2i_AUTHORITY_INFO_ACCESS GRPC_SHADOW_d2i_AUTHORITY_INFO_ACCESS +#define d2i_AUTHORITY_KEYID GRPC_SHADOW_d2i_AUTHORITY_KEYID +#define d2i_AutoPrivateKey GRPC_SHADOW_d2i_AutoPrivateKey +#define d2i_BASIC_CONSTRAINTS GRPC_SHADOW_d2i_BASIC_CONSTRAINTS +#define d2i_CERTIFICATEPOLICIES GRPC_SHADOW_d2i_CERTIFICATEPOLICIES +#define d2i_CRL_DIST_POINTS GRPC_SHADOW_d2i_CRL_DIST_POINTS +#define d2i_DHparams GRPC_SHADOW_d2i_DHparams +#define d2i_DHparams_bio GRPC_SHADOW_d2i_DHparams_bio +#define d2i_DIRECTORYSTRING GRPC_SHADOW_d2i_DIRECTORYSTRING +#define d2i_DISPLAYTEXT GRPC_SHADOW_d2i_DISPLAYTEXT +#define d2i_DIST_POINT GRPC_SHADOW_d2i_DIST_POINT +#define d2i_DIST_POINT_NAME GRPC_SHADOW_d2i_DIST_POINT_NAME +#define d2i_DSAparams GRPC_SHADOW_d2i_DSAparams +#define d2i_DSAPrivateKey GRPC_SHADOW_d2i_DSAPrivateKey +#define d2i_DSAPrivateKey_bio GRPC_SHADOW_d2i_DSAPrivateKey_bio +#define d2i_DSAPrivateKey_fp GRPC_SHADOW_d2i_DSAPrivateKey_fp +#define d2i_DSA_PUBKEY GRPC_SHADOW_d2i_DSA_PUBKEY +#define d2i_DSA_PUBKEY_bio GRPC_SHADOW_d2i_DSA_PUBKEY_bio +#define d2i_DSA_PUBKEY_fp GRPC_SHADOW_d2i_DSA_PUBKEY_fp +#define d2i_DSAPublicKey GRPC_SHADOW_d2i_DSAPublicKey +#define d2i_DSA_SIG GRPC_SHADOW_d2i_DSA_SIG +#define d2i_ECDSA_SIG GRPC_SHADOW_d2i_ECDSA_SIG +#define d2i_ECParameters GRPC_SHADOW_d2i_ECParameters +#define d2i_ECPrivateKey GRPC_SHADOW_d2i_ECPrivateKey +#define d2i_ECPrivateKey_bio GRPC_SHADOW_d2i_ECPrivateKey_bio +#define d2i_ECPrivateKey_fp GRPC_SHADOW_d2i_ECPrivateKey_fp +#define d2i_EC_PUBKEY GRPC_SHADOW_d2i_EC_PUBKEY +#define d2i_EC_PUBKEY_bio GRPC_SHADOW_d2i_EC_PUBKEY_bio +#define d2i_EC_PUBKEY_fp GRPC_SHADOW_d2i_EC_PUBKEY_fp +#define d2i_EDIPARTYNAME GRPC_SHADOW_d2i_EDIPARTYNAME +#define d2i_EXTENDED_KEY_USAGE GRPC_SHADOW_d2i_EXTENDED_KEY_USAGE +#define d2i_GENERAL_NAME GRPC_SHADOW_d2i_GENERAL_NAME +#define d2i_GENERAL_NAMES GRPC_SHADOW_d2i_GENERAL_NAMES +#define d2i_ISSUING_DIST_POINT GRPC_SHADOW_d2i_ISSUING_DIST_POINT +#define d2i_NETSCAPE_SPKAC GRPC_SHADOW_d2i_NETSCAPE_SPKAC +#define d2i_NETSCAPE_SPKI GRPC_SHADOW_d2i_NETSCAPE_SPKI +#define d2i_NOTICEREF GRPC_SHADOW_d2i_NOTICEREF +#define d2i_OTHERNAME GRPC_SHADOW_d2i_OTHERNAME +#define d2i_PKCS12 GRPC_SHADOW_d2i_PKCS12 +#define d2i_PKCS12_bio GRPC_SHADOW_d2i_PKCS12_bio +#define d2i_PKCS12_fp GRPC_SHADOW_d2i_PKCS12_fp +#define d2i_PKCS7 GRPC_SHADOW_d2i_PKCS7 +#define d2i_PKCS7_bio GRPC_SHADOW_d2i_PKCS7_bio +#define d2i_PKCS8_bio GRPC_SHADOW_d2i_PKCS8_bio +#define d2i_PKCS8_fp GRPC_SHADOW_d2i_PKCS8_fp +#define d2i_PKCS8PrivateKey_bio GRPC_SHADOW_d2i_PKCS8PrivateKey_bio +#define d2i_PKCS8PrivateKey_fp GRPC_SHADOW_d2i_PKCS8PrivateKey_fp +#define d2i_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_d2i_PKCS8_PRIV_KEY_INFO +#define d2i_PKCS8_PRIV_KEY_INFO_bio GRPC_SHADOW_d2i_PKCS8_PRIV_KEY_INFO_bio +#define d2i_PKCS8_PRIV_KEY_INFO_fp GRPC_SHADOW_d2i_PKCS8_PRIV_KEY_INFO_fp +#define d2i_PKEY_USAGE_PERIOD GRPC_SHADOW_d2i_PKEY_USAGE_PERIOD +#define d2i_POLICYINFO GRPC_SHADOW_d2i_POLICYINFO +#define d2i_POLICYQUALINFO GRPC_SHADOW_d2i_POLICYQUALINFO +#define d2i_PrivateKey GRPC_SHADOW_d2i_PrivateKey +#define d2i_PrivateKey_bio GRPC_SHADOW_d2i_PrivateKey_bio +#define d2i_PrivateKey_fp GRPC_SHADOW_d2i_PrivateKey_fp +#define d2i_PROXY_CERT_INFO_EXTENSION GRPC_SHADOW_d2i_PROXY_CERT_INFO_EXTENSION +#define d2i_PROXY_POLICY GRPC_SHADOW_d2i_PROXY_POLICY +#define d2i_PUBKEY GRPC_SHADOW_d2i_PUBKEY +#define d2i_PUBKEY_bio GRPC_SHADOW_d2i_PUBKEY_bio +#define d2i_PUBKEY_fp GRPC_SHADOW_d2i_PUBKEY_fp +#define d2i_PublicKey GRPC_SHADOW_d2i_PublicKey +#define d2i_RSAPrivateKey GRPC_SHADOW_d2i_RSAPrivateKey +#define d2i_RSAPrivateKey_bio GRPC_SHADOW_d2i_RSAPrivateKey_bio +#define d2i_RSAPrivateKey_fp GRPC_SHADOW_d2i_RSAPrivateKey_fp +#define d2i_RSA_PSS_PARAMS GRPC_SHADOW_d2i_RSA_PSS_PARAMS +#define d2i_RSA_PUBKEY GRPC_SHADOW_d2i_RSA_PUBKEY +#define d2i_RSA_PUBKEY_bio GRPC_SHADOW_d2i_RSA_PUBKEY_bio +#define d2i_RSA_PUBKEY_fp GRPC_SHADOW_d2i_RSA_PUBKEY_fp +#define d2i_RSAPublicKey GRPC_SHADOW_d2i_RSAPublicKey +#define d2i_RSAPublicKey_bio GRPC_SHADOW_d2i_RSAPublicKey_bio +#define d2i_RSAPublicKey_fp GRPC_SHADOW_d2i_RSAPublicKey_fp +#define d2i_SSL_SESSION GRPC_SHADOW_d2i_SSL_SESSION +#define d2i_SSL_SESSION_bio GRPC_SHADOW_d2i_SSL_SESSION_bio +#define d2i_SXNET GRPC_SHADOW_d2i_SXNET +#define d2i_SXNETID GRPC_SHADOW_d2i_SXNETID +#define d2i_USERNOTICE GRPC_SHADOW_d2i_USERNOTICE +#define d2i_X509 GRPC_SHADOW_d2i_X509 +#define d2i_X509_ALGOR GRPC_SHADOW_d2i_X509_ALGOR +#define d2i_X509_ALGORS GRPC_SHADOW_d2i_X509_ALGORS +#define d2i_X509_ATTRIBUTE GRPC_SHADOW_d2i_X509_ATTRIBUTE +#define d2i_X509_AUX GRPC_SHADOW_d2i_X509_AUX +#define d2i_X509_bio GRPC_SHADOW_d2i_X509_bio +#define d2i_X509_CERT_AUX GRPC_SHADOW_d2i_X509_CERT_AUX +#define d2i_X509_CINF GRPC_SHADOW_d2i_X509_CINF +#define d2i_X509_CRL GRPC_SHADOW_d2i_X509_CRL +#define d2i_X509_CRL_bio GRPC_SHADOW_d2i_X509_CRL_bio +#define d2i_X509_CRL_fp GRPC_SHADOW_d2i_X509_CRL_fp +#define d2i_X509_CRL_INFO GRPC_SHADOW_d2i_X509_CRL_INFO +#define d2i_X509_EXTENSION GRPC_SHADOW_d2i_X509_EXTENSION +#define d2i_X509_EXTENSIONS GRPC_SHADOW_d2i_X509_EXTENSIONS +#define d2i_X509_fp GRPC_SHADOW_d2i_X509_fp +#define d2i_X509_NAME GRPC_SHADOW_d2i_X509_NAME +#define d2i_X509_NAME_ENTRY GRPC_SHADOW_d2i_X509_NAME_ENTRY +#define d2i_X509_PUBKEY GRPC_SHADOW_d2i_X509_PUBKEY +#define d2i_X509_REQ GRPC_SHADOW_d2i_X509_REQ +#define d2i_X509_REQ_bio GRPC_SHADOW_d2i_X509_REQ_bio +#define d2i_X509_REQ_fp GRPC_SHADOW_d2i_X509_REQ_fp +#define d2i_X509_REQ_INFO GRPC_SHADOW_d2i_X509_REQ_INFO +#define d2i_X509_REVOKED GRPC_SHADOW_d2i_X509_REVOKED +#define d2i_X509_SIG GRPC_SHADOW_d2i_X509_SIG +#define d2i_X509_VAL GRPC_SHADOW_d2i_X509_VAL +#define DES_decrypt3 GRPC_SHADOW_DES_decrypt3 +#define DES_ecb3_encrypt GRPC_SHADOW_DES_ecb3_encrypt +#define DES_ecb_encrypt GRPC_SHADOW_DES_ecb_encrypt +#define DES_ede2_cbc_encrypt GRPC_SHADOW_DES_ede2_cbc_encrypt +#define DES_ede3_cbc_encrypt GRPC_SHADOW_DES_ede3_cbc_encrypt +#define DES_encrypt3 GRPC_SHADOW_DES_encrypt3 +#define DES_ncbc_encrypt GRPC_SHADOW_DES_ncbc_encrypt +#define DES_set_key GRPC_SHADOW_DES_set_key +#define DES_set_key_unchecked GRPC_SHADOW_DES_set_key_unchecked +#define DES_set_odd_parity GRPC_SHADOW_DES_set_odd_parity +#define DH_check GRPC_SHADOW_DH_check +#define DH_check_pub_key GRPC_SHADOW_DH_check_pub_key +#define DH_compute_key GRPC_SHADOW_DH_compute_key +#define DH_free GRPC_SHADOW_DH_free +#define DH_generate_key GRPC_SHADOW_DH_generate_key +#define DH_generate_parameters_ex GRPC_SHADOW_DH_generate_parameters_ex +#define DH_get0_key GRPC_SHADOW_DH_get0_key +#define DH_get0_pqg GRPC_SHADOW_DH_get0_pqg +#define DH_get_ex_data GRPC_SHADOW_DH_get_ex_data +#define DH_get_ex_new_index GRPC_SHADOW_DH_get_ex_new_index +#define DH_marshal_parameters GRPC_SHADOW_DH_marshal_parameters +#define DH_new GRPC_SHADOW_DH_new +#define DH_num_bits GRPC_SHADOW_DH_num_bits +#define DHparams_dup GRPC_SHADOW_DHparams_dup +#define DH_parse_parameters GRPC_SHADOW_DH_parse_parameters +#define DH_set0_key GRPC_SHADOW_DH_set0_key +#define DH_set0_pqg GRPC_SHADOW_DH_set0_pqg +#define DH_set_ex_data GRPC_SHADOW_DH_set_ex_data +#define DH_size GRPC_SHADOW_DH_size +#define DH_up_ref GRPC_SHADOW_DH_up_ref +#define DIRECTORYSTRING_free GRPC_SHADOW_DIRECTORYSTRING_free +#define DIRECTORYSTRING_it GRPC_SHADOW_DIRECTORYSTRING_it +#define DIRECTORYSTRING_new GRPC_SHADOW_DIRECTORYSTRING_new +#define DISPLAYTEXT_free GRPC_SHADOW_DISPLAYTEXT_free +#define DISPLAYTEXT_it GRPC_SHADOW_DISPLAYTEXT_it +#define DISPLAYTEXT_new GRPC_SHADOW_DISPLAYTEXT_new +#define DIST_POINT_free GRPC_SHADOW_DIST_POINT_free +#define DIST_POINT_it GRPC_SHADOW_DIST_POINT_it +#define DIST_POINT_NAME_free GRPC_SHADOW_DIST_POINT_NAME_free +#define DIST_POINT_NAME_it GRPC_SHADOW_DIST_POINT_NAME_it +#define DIST_POINT_NAME_new GRPC_SHADOW_DIST_POINT_NAME_new +#define DIST_POINT_new GRPC_SHADOW_DIST_POINT_new +#define DIST_POINT_set_dpname GRPC_SHADOW_DIST_POINT_set_dpname +#define dsa_asn1_meth GRPC_SHADOW_dsa_asn1_meth +#define DSA_check_signature GRPC_SHADOW_DSA_check_signature +#define DSA_do_check_signature GRPC_SHADOW_DSA_do_check_signature +#define DSA_do_sign GRPC_SHADOW_DSA_do_sign +#define DSA_do_verify GRPC_SHADOW_DSA_do_verify +#define DSA_dup_DH GRPC_SHADOW_DSA_dup_DH +#define DSA_free GRPC_SHADOW_DSA_free +#define DSA_generate_key GRPC_SHADOW_DSA_generate_key +#define DSA_generate_parameters_ex GRPC_SHADOW_DSA_generate_parameters_ex +#define DSA_get0_key GRPC_SHADOW_DSA_get0_key +#define DSA_get0_pqg GRPC_SHADOW_DSA_get0_pqg +#define DSA_get_ex_data GRPC_SHADOW_DSA_get_ex_data +#define DSA_get_ex_new_index GRPC_SHADOW_DSA_get_ex_new_index +#define DSA_marshal_parameters GRPC_SHADOW_DSA_marshal_parameters +#define DSA_marshal_private_key GRPC_SHADOW_DSA_marshal_private_key +#define DSA_marshal_public_key GRPC_SHADOW_DSA_marshal_public_key +#define DSA_new GRPC_SHADOW_DSA_new +#define DSAparams_dup GRPC_SHADOW_DSAparams_dup +#define DSA_parse_parameters GRPC_SHADOW_DSA_parse_parameters +#define DSA_parse_private_key GRPC_SHADOW_DSA_parse_private_key +#define DSA_parse_public_key GRPC_SHADOW_DSA_parse_public_key +#define DSA_set0_key GRPC_SHADOW_DSA_set0_key +#define DSA_set0_pqg GRPC_SHADOW_DSA_set0_pqg +#define DSA_set_ex_data GRPC_SHADOW_DSA_set_ex_data +#define DSA_SIG_free GRPC_SHADOW_DSA_SIG_free +#define DSA_SIG_marshal GRPC_SHADOW_DSA_SIG_marshal +#define DSA_sign GRPC_SHADOW_DSA_sign +#define DSA_SIG_new GRPC_SHADOW_DSA_SIG_new +#define DSA_SIG_parse GRPC_SHADOW_DSA_SIG_parse +#define DSA_size GRPC_SHADOW_DSA_size +#define DSA_up_ref GRPC_SHADOW_DSA_up_ref +#define DSA_verify GRPC_SHADOW_DSA_verify +#define DTLS_client_method GRPC_SHADOW_DTLS_client_method +#define DTLS_method GRPC_SHADOW_DTLS_method +#define DTLS_server_method GRPC_SHADOW_DTLS_server_method +#define DTLSv1_2_client_method GRPC_SHADOW_DTLSv1_2_client_method +#define DTLSv1_2_method GRPC_SHADOW_DTLSv1_2_method +#define DTLSv1_2_server_method GRPC_SHADOW_DTLSv1_2_server_method +#define DTLSv1_client_method GRPC_SHADOW_DTLSv1_client_method +#define DTLSv1_get_timeout GRPC_SHADOW_DTLSv1_get_timeout +#define DTLSv1_handle_timeout GRPC_SHADOW_DTLSv1_handle_timeout +#define DTLSv1_method GRPC_SHADOW_DTLSv1_method +#define DTLSv1_server_method GRPC_SHADOW_DTLSv1_server_method +#define DTLSv1_set_initial_timeout_duration GRPC_SHADOW_DTLSv1_set_initial_timeout_duration +#define DTLS_with_buffers_method GRPC_SHADOW_DTLS_with_buffers_method +#define ec_asn1_meth GRPC_SHADOW_ec_asn1_meth +#define ec_bignum_to_felem GRPC_SHADOW_ec_bignum_to_felem +#define ec_bignum_to_scalar GRPC_SHADOW_ec_bignum_to_scalar +#define ec_cmp_x_coordinate GRPC_SHADOW_ec_cmp_x_coordinate +#define ec_compute_wNAF GRPC_SHADOW_ec_compute_wNAF +#define EC_curve_nid2nist GRPC_SHADOW_EC_curve_nid2nist +#define EC_curve_nist2nid GRPC_SHADOW_EC_curve_nist2nid +#define ECDH_compute_key GRPC_SHADOW_ECDH_compute_key +#define ECDH_compute_key_fips GRPC_SHADOW_ECDH_compute_key_fips +#define ECDSA_do_sign GRPC_SHADOW_ECDSA_do_sign +#define ECDSA_do_verify GRPC_SHADOW_ECDSA_do_verify +#define ECDSA_SIG_free GRPC_SHADOW_ECDSA_SIG_free +#define ECDSA_SIG_from_bytes GRPC_SHADOW_ECDSA_SIG_from_bytes +#define ECDSA_SIG_get0 GRPC_SHADOW_ECDSA_SIG_get0 +#define ECDSA_SIG_marshal GRPC_SHADOW_ECDSA_SIG_marshal +#define ECDSA_SIG_max_len GRPC_SHADOW_ECDSA_SIG_max_len +#define ECDSA_sign GRPC_SHADOW_ECDSA_sign +#define ECDSA_SIG_new GRPC_SHADOW_ECDSA_SIG_new +#define ECDSA_SIG_parse GRPC_SHADOW_ECDSA_SIG_parse +#define ECDSA_SIG_set0 GRPC_SHADOW_ECDSA_SIG_set0 +#define ECDSA_SIG_to_bytes GRPC_SHADOW_ECDSA_SIG_to_bytes +#define ECDSA_size GRPC_SHADOW_ECDSA_size +#define ECDSA_verify GRPC_SHADOW_ECDSA_verify +#define ec_felem_add GRPC_SHADOW_ec_felem_add +#define ec_felem_equal GRPC_SHADOW_ec_felem_equal +#define ec_felem_neg GRPC_SHADOW_ec_felem_neg +#define ec_felem_non_zero_mask GRPC_SHADOW_ec_felem_non_zero_mask +#define ec_felem_select GRPC_SHADOW_ec_felem_select +#define ec_felem_sub GRPC_SHADOW_ec_felem_sub +#define ec_felem_to_bignum GRPC_SHADOW_ec_felem_to_bignum +#define EC_get_builtin_curves GRPC_SHADOW_EC_get_builtin_curves +#define ec_get_x_coordinate_as_scalar GRPC_SHADOW_ec_get_x_coordinate_as_scalar +#define ec_GFp_mont_add GRPC_SHADOW_ec_GFp_mont_add +#define ec_GFp_mont_bignum_to_felem GRPC_SHADOW_ec_GFp_mont_bignum_to_felem +#define ec_GFp_mont_dbl GRPC_SHADOW_ec_GFp_mont_dbl +#define ec_GFp_mont_felem_mul GRPC_SHADOW_ec_GFp_mont_felem_mul +#define ec_GFp_mont_felem_sqr GRPC_SHADOW_ec_GFp_mont_felem_sqr +#define ec_GFp_mont_felem_to_bignum GRPC_SHADOW_ec_GFp_mont_felem_to_bignum +#define ec_GFp_mont_group_finish GRPC_SHADOW_ec_GFp_mont_group_finish +#define ec_GFp_mont_group_init GRPC_SHADOW_ec_GFp_mont_group_init +#define ec_GFp_mont_group_set_curve GRPC_SHADOW_ec_GFp_mont_group_set_curve +#define EC_GFp_mont_method GRPC_SHADOW_EC_GFp_mont_method +#define ec_GFp_mont_mul GRPC_SHADOW_ec_GFp_mont_mul +#define ec_GFp_mont_mul_base GRPC_SHADOW_ec_GFp_mont_mul_base +#define ec_GFp_mont_mul_public GRPC_SHADOW_ec_GFp_mont_mul_public +#define EC_GFp_nistp224_method GRPC_SHADOW_EC_GFp_nistp224_method +#define EC_GFp_nistp256_method GRPC_SHADOW_EC_GFp_nistp256_method +#define ec_GFp_nistp_recode_scalar_bits GRPC_SHADOW_ec_GFp_nistp_recode_scalar_bits +#define EC_GFp_nistz256_method GRPC_SHADOW_EC_GFp_nistz256_method +#define ec_GFp_simple_cmp GRPC_SHADOW_ec_GFp_simple_cmp +#define ec_GFp_simple_cmp_x_coordinate GRPC_SHADOW_ec_GFp_simple_cmp_x_coordinate +#define ec_GFp_simple_group_finish GRPC_SHADOW_ec_GFp_simple_group_finish +#define ec_GFp_simple_group_get_curve GRPC_SHADOW_ec_GFp_simple_group_get_curve +#define ec_GFp_simple_group_init GRPC_SHADOW_ec_GFp_simple_group_init +#define ec_GFp_simple_group_set_curve GRPC_SHADOW_ec_GFp_simple_group_set_curve +#define ec_GFp_simple_invert GRPC_SHADOW_ec_GFp_simple_invert +#define ec_GFp_simple_is_at_infinity GRPC_SHADOW_ec_GFp_simple_is_at_infinity +#define ec_GFp_simple_is_on_curve GRPC_SHADOW_ec_GFp_simple_is_on_curve +#define ec_GFp_simple_mont_inv_mod_ord_vartime GRPC_SHADOW_ec_GFp_simple_mont_inv_mod_ord_vartime +#define ec_GFp_simple_point_copy GRPC_SHADOW_ec_GFp_simple_point_copy +#define ec_GFp_simple_point_init GRPC_SHADOW_ec_GFp_simple_point_init +#define ec_GFp_simple_point_set_affine_coordinates GRPC_SHADOW_ec_GFp_simple_point_set_affine_coordinates +#define ec_GFp_simple_point_set_to_infinity GRPC_SHADOW_ec_GFp_simple_point_set_to_infinity +#define EC_GROUP_cmp GRPC_SHADOW_EC_GROUP_cmp +#define EC_GROUP_dup GRPC_SHADOW_EC_GROUP_dup +#define EC_GROUP_free GRPC_SHADOW_EC_GROUP_free +#define EC_GROUP_get0_generator GRPC_SHADOW_EC_GROUP_get0_generator +#define EC_GROUP_get0_order GRPC_SHADOW_EC_GROUP_get0_order +#define EC_GROUP_get_cofactor GRPC_SHADOW_EC_GROUP_get_cofactor +#define EC_GROUP_get_curve_GFp GRPC_SHADOW_EC_GROUP_get_curve_GFp +#define EC_GROUP_get_curve_name GRPC_SHADOW_EC_GROUP_get_curve_name +#define EC_GROUP_get_degree GRPC_SHADOW_EC_GROUP_get_degree +#define EC_GROUP_get_order GRPC_SHADOW_EC_GROUP_get_order +#define EC_GROUP_method_of GRPC_SHADOW_EC_GROUP_method_of +#define ec_group_new GRPC_SHADOW_ec_group_new +#define EC_GROUP_new_by_curve_name GRPC_SHADOW_EC_GROUP_new_by_curve_name +#define EC_GROUP_new_curve_GFp GRPC_SHADOW_EC_GROUP_new_curve_GFp +#define EC_GROUP_order_bits GRPC_SHADOW_EC_GROUP_order_bits +#define EC_GROUP_set_asn1_flag GRPC_SHADOW_EC_GROUP_set_asn1_flag +#define EC_GROUP_set_generator GRPC_SHADOW_EC_GROUP_set_generator +#define EC_GROUP_set_point_conversion_form GRPC_SHADOW_EC_GROUP_set_point_conversion_form +#define EC_KEY_check_fips GRPC_SHADOW_EC_KEY_check_fips +#define EC_KEY_check_key GRPC_SHADOW_EC_KEY_check_key +#define EC_KEY_derive_from_secret GRPC_SHADOW_EC_KEY_derive_from_secret +#define EC_KEY_dup GRPC_SHADOW_EC_KEY_dup +#define EC_KEY_free GRPC_SHADOW_EC_KEY_free +#define EC_KEY_generate_key GRPC_SHADOW_EC_KEY_generate_key +#define EC_KEY_generate_key_fips GRPC_SHADOW_EC_KEY_generate_key_fips +#define EC_KEY_get0_group GRPC_SHADOW_EC_KEY_get0_group +#define EC_KEY_get0_private_key GRPC_SHADOW_EC_KEY_get0_private_key +#define EC_KEY_get0_public_key GRPC_SHADOW_EC_KEY_get0_public_key +#define EC_KEY_get_conv_form GRPC_SHADOW_EC_KEY_get_conv_form +#define EC_KEY_get_enc_flags GRPC_SHADOW_EC_KEY_get_enc_flags +#define EC_KEY_get_ex_data GRPC_SHADOW_EC_KEY_get_ex_data +#define EC_KEY_get_ex_new_index GRPC_SHADOW_EC_KEY_get_ex_new_index +#define EC_KEY_is_opaque GRPC_SHADOW_EC_KEY_is_opaque +#define EC_KEY_key2buf GRPC_SHADOW_EC_KEY_key2buf +#define EC_KEY_marshal_curve_name GRPC_SHADOW_EC_KEY_marshal_curve_name +#define EC_KEY_marshal_private_key GRPC_SHADOW_EC_KEY_marshal_private_key +#define EC_KEY_new GRPC_SHADOW_EC_KEY_new +#define EC_KEY_new_by_curve_name GRPC_SHADOW_EC_KEY_new_by_curve_name +#define EC_KEY_new_method GRPC_SHADOW_EC_KEY_new_method +#define EC_KEY_parse_curve_name GRPC_SHADOW_EC_KEY_parse_curve_name +#define EC_KEY_parse_parameters GRPC_SHADOW_EC_KEY_parse_parameters +#define EC_KEY_parse_private_key GRPC_SHADOW_EC_KEY_parse_private_key +#define EC_KEY_set_asn1_flag GRPC_SHADOW_EC_KEY_set_asn1_flag +#define EC_KEY_set_conv_form GRPC_SHADOW_EC_KEY_set_conv_form +#define EC_KEY_set_enc_flags GRPC_SHADOW_EC_KEY_set_enc_flags +#define EC_KEY_set_ex_data GRPC_SHADOW_EC_KEY_set_ex_data +#define EC_KEY_set_group GRPC_SHADOW_EC_KEY_set_group +#define EC_KEY_set_private_key GRPC_SHADOW_EC_KEY_set_private_key +#define EC_KEY_set_public_key GRPC_SHADOW_EC_KEY_set_public_key +#define EC_KEY_set_public_key_affine_coordinates GRPC_SHADOW_EC_KEY_set_public_key_affine_coordinates +#define EC_KEY_up_ref GRPC_SHADOW_EC_KEY_up_ref +#define EC_METHOD_get_field_type GRPC_SHADOW_EC_METHOD_get_field_type +#define ec_pkey_meth GRPC_SHADOW_ec_pkey_meth +#define ecp_nistz256_avx2_select_w7 GRPC_SHADOW_ecp_nistz256_avx2_select_w7 +#define ecp_nistz256_mul_mont GRPC_SHADOW_ecp_nistz256_mul_mont +#define ecp_nistz256_neg GRPC_SHADOW_ecp_nistz256_neg +#define ecp_nistz256_ord_mul_mont GRPC_SHADOW_ecp_nistz256_ord_mul_mont +#define ecp_nistz256_ord_sqr_mont GRPC_SHADOW_ecp_nistz256_ord_sqr_mont +#define ecp_nistz256_point_add GRPC_SHADOW_ecp_nistz256_point_add +#define ecp_nistz256_point_add_affine GRPC_SHADOW_ecp_nistz256_point_add_affine +#define ecp_nistz256_point_double GRPC_SHADOW_ecp_nistz256_point_double +#define ecp_nistz256_select_w5 GRPC_SHADOW_ecp_nistz256_select_w5 +#define ecp_nistz256_select_w7 GRPC_SHADOW_ecp_nistz256_select_w7 +#define ecp_nistz256_sqr_mont GRPC_SHADOW_ecp_nistz256_sqr_mont +#define EC_POINT_add GRPC_SHADOW_EC_POINT_add +#define EC_POINT_clear_free GRPC_SHADOW_EC_POINT_clear_free +#define EC_POINT_cmp GRPC_SHADOW_EC_POINT_cmp +#define EC_POINT_copy GRPC_SHADOW_EC_POINT_copy +#define EC_POINT_dbl GRPC_SHADOW_EC_POINT_dbl +#define EC_POINT_dup GRPC_SHADOW_EC_POINT_dup +#define EC_POINT_free GRPC_SHADOW_EC_POINT_free +#define ec_point_get_affine_coordinate_bytes GRPC_SHADOW_ec_point_get_affine_coordinate_bytes +#define EC_POINT_get_affine_coordinates_GFp GRPC_SHADOW_EC_POINT_get_affine_coordinates_GFp +#define EC_POINT_invert GRPC_SHADOW_EC_POINT_invert +#define EC_POINT_is_at_infinity GRPC_SHADOW_EC_POINT_is_at_infinity +#define EC_POINT_is_on_curve GRPC_SHADOW_EC_POINT_is_on_curve +#define EC_POINT_mul GRPC_SHADOW_EC_POINT_mul +#define ec_point_mul_scalar GRPC_SHADOW_ec_point_mul_scalar +#define ec_point_mul_scalar_base GRPC_SHADOW_ec_point_mul_scalar_base +#define ec_point_mul_scalar_public GRPC_SHADOW_ec_point_mul_scalar_public +#define EC_POINT_new GRPC_SHADOW_EC_POINT_new +#define EC_POINT_oct2point GRPC_SHADOW_EC_POINT_oct2point +#define EC_POINT_point2cbb GRPC_SHADOW_EC_POINT_point2cbb +#define EC_POINT_point2oct GRPC_SHADOW_EC_POINT_point2oct +#define EC_POINT_set_affine_coordinates_GFp GRPC_SHADOW_EC_POINT_set_affine_coordinates_GFp +#define EC_POINT_set_compressed_coordinates_GFp GRPC_SHADOW_EC_POINT_set_compressed_coordinates_GFp +#define EC_POINT_set_to_infinity GRPC_SHADOW_EC_POINT_set_to_infinity +#define ec_random_nonzero_scalar GRPC_SHADOW_ec_random_nonzero_scalar +#define ec_scalar_add GRPC_SHADOW_ec_scalar_add +#define ec_scalar_equal_vartime GRPC_SHADOW_ec_scalar_equal_vartime +#define ec_scalar_from_montgomery GRPC_SHADOW_ec_scalar_from_montgomery +#define ec_scalar_inv_montgomery GRPC_SHADOW_ec_scalar_inv_montgomery +#define ec_scalar_inv_montgomery_vartime GRPC_SHADOW_ec_scalar_inv_montgomery_vartime +#define ec_scalar_is_zero GRPC_SHADOW_ec_scalar_is_zero +#define ec_scalar_mul_montgomery GRPC_SHADOW_ec_scalar_mul_montgomery +#define ec_scalar_to_montgomery GRPC_SHADOW_ec_scalar_to_montgomery +#define ec_simple_scalar_inv_montgomery GRPC_SHADOW_ec_simple_scalar_inv_montgomery +#define ed25519_asn1_meth GRPC_SHADOW_ed25519_asn1_meth +#define ED25519_keypair GRPC_SHADOW_ED25519_keypair +#define ED25519_keypair_from_seed GRPC_SHADOW_ED25519_keypair_from_seed +#define ed25519_pkey_meth GRPC_SHADOW_ed25519_pkey_meth +#define ED25519_sign GRPC_SHADOW_ED25519_sign +#define ED25519_verify GRPC_SHADOW_ED25519_verify +#define EDIPARTYNAME_free GRPC_SHADOW_EDIPARTYNAME_free +#define EDIPARTYNAME_it GRPC_SHADOW_EDIPARTYNAME_it +#define EDIPARTYNAME_new GRPC_SHADOW_EDIPARTYNAME_new +#define ENGINE_free GRPC_SHADOW_ENGINE_free +#define ENGINE_get_ECDSA_method GRPC_SHADOW_ENGINE_get_ECDSA_method +#define ENGINE_get_RSA_method GRPC_SHADOW_ENGINE_get_RSA_method +#define ENGINE_load_builtin_engines GRPC_SHADOW_ENGINE_load_builtin_engines +#define ENGINE_new GRPC_SHADOW_ENGINE_new +#define ENGINE_register_all_complete GRPC_SHADOW_ENGINE_register_all_complete +#define ENGINE_set_ECDSA_method GRPC_SHADOW_ENGINE_set_ECDSA_method +#define ENGINE_set_RSA_method GRPC_SHADOW_ENGINE_set_RSA_method +#define ERR_add_error_data GRPC_SHADOW_ERR_add_error_data +#define ERR_add_error_dataf GRPC_SHADOW_ERR_add_error_dataf +#define ERR_clear_error GRPC_SHADOW_ERR_clear_error +#define ERR_clear_system_error GRPC_SHADOW_ERR_clear_system_error +#define ERR_error_string GRPC_SHADOW_ERR_error_string +#define ERR_error_string_n GRPC_SHADOW_ERR_error_string_n +#define ERR_free_strings GRPC_SHADOW_ERR_free_strings +#define ERR_func_error_string GRPC_SHADOW_ERR_func_error_string +#define ERR_get_error GRPC_SHADOW_ERR_get_error +#define ERR_get_error_line GRPC_SHADOW_ERR_get_error_line +#define ERR_get_error_line_data GRPC_SHADOW_ERR_get_error_line_data +#define ERR_get_next_error_library GRPC_SHADOW_ERR_get_next_error_library +#define ERR_lib_error_string GRPC_SHADOW_ERR_lib_error_string +#define ERR_load_BIO_strings GRPC_SHADOW_ERR_load_BIO_strings +#define ERR_load_crypto_strings GRPC_SHADOW_ERR_load_crypto_strings +#define ERR_load_ERR_strings GRPC_SHADOW_ERR_load_ERR_strings +#define ERR_load_RAND_strings GRPC_SHADOW_ERR_load_RAND_strings +#define ERR_load_SSL_strings GRPC_SHADOW_ERR_load_SSL_strings +#define ERR_peek_error GRPC_SHADOW_ERR_peek_error +#define ERR_peek_error_line GRPC_SHADOW_ERR_peek_error_line +#define ERR_peek_error_line_data GRPC_SHADOW_ERR_peek_error_line_data +#define ERR_peek_last_error GRPC_SHADOW_ERR_peek_last_error +#define ERR_peek_last_error_line GRPC_SHADOW_ERR_peek_last_error_line +#define ERR_peek_last_error_line_data GRPC_SHADOW_ERR_peek_last_error_line_data +#define ERR_pop_to_mark GRPC_SHADOW_ERR_pop_to_mark +#define ERR_print_errors GRPC_SHADOW_ERR_print_errors +#define ERR_print_errors_cb GRPC_SHADOW_ERR_print_errors_cb +#define ERR_print_errors_fp GRPC_SHADOW_ERR_print_errors_fp +#define ERR_put_error GRPC_SHADOW_ERR_put_error +#define ERR_reason_error_string GRPC_SHADOW_ERR_reason_error_string +#define ERR_remove_state GRPC_SHADOW_ERR_remove_state +#define ERR_remove_thread_state GRPC_SHADOW_ERR_remove_thread_state +#define ERR_restore_state GRPC_SHADOW_ERR_restore_state +#define ERR_save_state GRPC_SHADOW_ERR_save_state +#define ERR_SAVE_STATE_free GRPC_SHADOW_ERR_SAVE_STATE_free +#define ERR_set_mark GRPC_SHADOW_ERR_set_mark +#define EVP_add_cipher_alias GRPC_SHADOW_EVP_add_cipher_alias +#define EVP_add_digest GRPC_SHADOW_EVP_add_digest +#define EVP_aead_aes_128_cbc_sha1_tls GRPC_SHADOW_EVP_aead_aes_128_cbc_sha1_tls +#define EVP_aead_aes_128_cbc_sha1_tls_implicit_iv GRPC_SHADOW_EVP_aead_aes_128_cbc_sha1_tls_implicit_iv +#define EVP_aead_aes_128_cbc_sha256_tls GRPC_SHADOW_EVP_aead_aes_128_cbc_sha256_tls +#define EVP_aead_aes_128_ccm_bluetooth GRPC_SHADOW_EVP_aead_aes_128_ccm_bluetooth +#define EVP_aead_aes_128_ccm_bluetooth_8 GRPC_SHADOW_EVP_aead_aes_128_ccm_bluetooth_8 +#define EVP_aead_aes_128_ctr_hmac_sha256 GRPC_SHADOW_EVP_aead_aes_128_ctr_hmac_sha256 +#define EVP_aead_aes_128_gcm GRPC_SHADOW_EVP_aead_aes_128_gcm +#define EVP_aead_aes_128_gcm_siv GRPC_SHADOW_EVP_aead_aes_128_gcm_siv +#define EVP_aead_aes_128_gcm_tls12 GRPC_SHADOW_EVP_aead_aes_128_gcm_tls12 +#define EVP_aead_aes_128_gcm_tls13 GRPC_SHADOW_EVP_aead_aes_128_gcm_tls13 +#define EVP_aead_aes_192_gcm GRPC_SHADOW_EVP_aead_aes_192_gcm +#define EVP_aead_aes_256_cbc_sha1_tls GRPC_SHADOW_EVP_aead_aes_256_cbc_sha1_tls +#define EVP_aead_aes_256_cbc_sha1_tls_implicit_iv GRPC_SHADOW_EVP_aead_aes_256_cbc_sha1_tls_implicit_iv +#define EVP_aead_aes_256_cbc_sha256_tls GRPC_SHADOW_EVP_aead_aes_256_cbc_sha256_tls +#define EVP_aead_aes_256_cbc_sha384_tls GRPC_SHADOW_EVP_aead_aes_256_cbc_sha384_tls +#define EVP_aead_aes_256_ctr_hmac_sha256 GRPC_SHADOW_EVP_aead_aes_256_ctr_hmac_sha256 +#define EVP_aead_aes_256_gcm GRPC_SHADOW_EVP_aead_aes_256_gcm +#define EVP_aead_aes_256_gcm_siv GRPC_SHADOW_EVP_aead_aes_256_gcm_siv +#define EVP_aead_aes_256_gcm_tls12 GRPC_SHADOW_EVP_aead_aes_256_gcm_tls12 +#define EVP_aead_aes_256_gcm_tls13 GRPC_SHADOW_EVP_aead_aes_256_gcm_tls13 +#define EVP_aead_chacha20_poly1305 GRPC_SHADOW_EVP_aead_chacha20_poly1305 +#define EVP_AEAD_CTX_aead GRPC_SHADOW_EVP_AEAD_CTX_aead +#define EVP_AEAD_CTX_cleanup GRPC_SHADOW_EVP_AEAD_CTX_cleanup +#define EVP_AEAD_CTX_free GRPC_SHADOW_EVP_AEAD_CTX_free +#define EVP_AEAD_CTX_get_iv GRPC_SHADOW_EVP_AEAD_CTX_get_iv +#define EVP_AEAD_CTX_init GRPC_SHADOW_EVP_AEAD_CTX_init +#define EVP_AEAD_CTX_init_with_direction GRPC_SHADOW_EVP_AEAD_CTX_init_with_direction +#define EVP_AEAD_CTX_new GRPC_SHADOW_EVP_AEAD_CTX_new +#define EVP_AEAD_CTX_open GRPC_SHADOW_EVP_AEAD_CTX_open +#define EVP_AEAD_CTX_open_gather GRPC_SHADOW_EVP_AEAD_CTX_open_gather +#define EVP_AEAD_CTX_seal GRPC_SHADOW_EVP_AEAD_CTX_seal +#define EVP_AEAD_CTX_seal_scatter GRPC_SHADOW_EVP_AEAD_CTX_seal_scatter +#define EVP_AEAD_CTX_tag_len GRPC_SHADOW_EVP_AEAD_CTX_tag_len +#define EVP_AEAD_CTX_zero GRPC_SHADOW_EVP_AEAD_CTX_zero +#define EVP_aead_des_ede3_cbc_sha1_tls GRPC_SHADOW_EVP_aead_des_ede3_cbc_sha1_tls +#define EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv GRPC_SHADOW_EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv +#define EVP_AEAD_key_length GRPC_SHADOW_EVP_AEAD_key_length +#define EVP_AEAD_max_overhead GRPC_SHADOW_EVP_AEAD_max_overhead +#define EVP_AEAD_max_tag_len GRPC_SHADOW_EVP_AEAD_max_tag_len +#define EVP_AEAD_nonce_length GRPC_SHADOW_EVP_AEAD_nonce_length +#define EVP_aead_null_sha1_tls GRPC_SHADOW_EVP_aead_null_sha1_tls +#define EVP_aead_xchacha20_poly1305 GRPC_SHADOW_EVP_aead_xchacha20_poly1305 +#define EVP_aes_128_cbc GRPC_SHADOW_EVP_aes_128_cbc +#define EVP_aes_128_ctr GRPC_SHADOW_EVP_aes_128_ctr +#define EVP_aes_128_ecb GRPC_SHADOW_EVP_aes_128_ecb +#define EVP_aes_128_gcm GRPC_SHADOW_EVP_aes_128_gcm +#define EVP_aes_128_ofb GRPC_SHADOW_EVP_aes_128_ofb +#define EVP_aes_192_cbc GRPC_SHADOW_EVP_aes_192_cbc +#define EVP_aes_192_ctr GRPC_SHADOW_EVP_aes_192_ctr +#define EVP_aes_192_ecb GRPC_SHADOW_EVP_aes_192_ecb +#define EVP_aes_192_gcm GRPC_SHADOW_EVP_aes_192_gcm +#define EVP_aes_192_ofb GRPC_SHADOW_EVP_aes_192_ofb +#define EVP_aes_256_cbc GRPC_SHADOW_EVP_aes_256_cbc +#define EVP_aes_256_ctr GRPC_SHADOW_EVP_aes_256_ctr +#define EVP_aes_256_ecb GRPC_SHADOW_EVP_aes_256_ecb +#define EVP_aes_256_gcm GRPC_SHADOW_EVP_aes_256_gcm +#define EVP_aes_256_ofb GRPC_SHADOW_EVP_aes_256_ofb +#define EVP_BytesToKey GRPC_SHADOW_EVP_BytesToKey +#define EVP_Cipher GRPC_SHADOW_EVP_Cipher +#define EVP_CIPHER_block_size GRPC_SHADOW_EVP_CIPHER_block_size +#define EVP_CIPHER_CTX_block_size GRPC_SHADOW_EVP_CIPHER_CTX_block_size +#define EVP_CIPHER_CTX_cipher GRPC_SHADOW_EVP_CIPHER_CTX_cipher +#define EVP_CIPHER_CTX_cleanup GRPC_SHADOW_EVP_CIPHER_CTX_cleanup +#define EVP_CIPHER_CTX_copy GRPC_SHADOW_EVP_CIPHER_CTX_copy +#define EVP_CIPHER_CTX_ctrl GRPC_SHADOW_EVP_CIPHER_CTX_ctrl +#define EVP_CIPHER_CTX_encrypting GRPC_SHADOW_EVP_CIPHER_CTX_encrypting +#define EVP_CIPHER_CTX_flags GRPC_SHADOW_EVP_CIPHER_CTX_flags +#define EVP_CIPHER_CTX_free GRPC_SHADOW_EVP_CIPHER_CTX_free +#define EVP_CIPHER_CTX_get_app_data GRPC_SHADOW_EVP_CIPHER_CTX_get_app_data +#define EVP_CIPHER_CTX_init GRPC_SHADOW_EVP_CIPHER_CTX_init +#define EVP_CIPHER_CTX_iv_length GRPC_SHADOW_EVP_CIPHER_CTX_iv_length +#define EVP_CIPHER_CTX_key_length GRPC_SHADOW_EVP_CIPHER_CTX_key_length +#define EVP_CIPHER_CTX_mode GRPC_SHADOW_EVP_CIPHER_CTX_mode +#define EVP_CIPHER_CTX_new GRPC_SHADOW_EVP_CIPHER_CTX_new +#define EVP_CIPHER_CTX_nid GRPC_SHADOW_EVP_CIPHER_CTX_nid +#define EVP_CIPHER_CTX_reset GRPC_SHADOW_EVP_CIPHER_CTX_reset +#define EVP_CIPHER_CTX_set_app_data GRPC_SHADOW_EVP_CIPHER_CTX_set_app_data +#define EVP_CIPHER_CTX_set_flags GRPC_SHADOW_EVP_CIPHER_CTX_set_flags +#define EVP_CIPHER_CTX_set_key_length GRPC_SHADOW_EVP_CIPHER_CTX_set_key_length +#define EVP_CIPHER_CTX_set_padding GRPC_SHADOW_EVP_CIPHER_CTX_set_padding +#define EVP_CipherFinal_ex GRPC_SHADOW_EVP_CipherFinal_ex +#define EVP_CIPHER_flags GRPC_SHADOW_EVP_CIPHER_flags +#define EVP_CipherInit GRPC_SHADOW_EVP_CipherInit +#define EVP_CipherInit_ex GRPC_SHADOW_EVP_CipherInit_ex +#define EVP_CIPHER_iv_length GRPC_SHADOW_EVP_CIPHER_iv_length +#define EVP_CIPHER_key_length GRPC_SHADOW_EVP_CIPHER_key_length +#define EVP_CIPHER_mode GRPC_SHADOW_EVP_CIPHER_mode +#define EVP_CIPHER_nid GRPC_SHADOW_EVP_CIPHER_nid +#define EVP_CipherUpdate GRPC_SHADOW_EVP_CipherUpdate +#define EVP_cleanup GRPC_SHADOW_EVP_cleanup +#define EVP_DecodeBase64 GRPC_SHADOW_EVP_DecodeBase64 +#define EVP_DecodeBlock GRPC_SHADOW_EVP_DecodeBlock +#define EVP_DecodedLength GRPC_SHADOW_EVP_DecodedLength +#define EVP_DecodeFinal GRPC_SHADOW_EVP_DecodeFinal +#define EVP_DecodeInit GRPC_SHADOW_EVP_DecodeInit +#define EVP_DecodeUpdate GRPC_SHADOW_EVP_DecodeUpdate +#define EVP_DecryptFinal_ex GRPC_SHADOW_EVP_DecryptFinal_ex +#define EVP_DecryptInit GRPC_SHADOW_EVP_DecryptInit +#define EVP_DecryptInit_ex GRPC_SHADOW_EVP_DecryptInit_ex +#define EVP_DecryptUpdate GRPC_SHADOW_EVP_DecryptUpdate +#define EVP_des_cbc GRPC_SHADOW_EVP_des_cbc +#define EVP_des_ecb GRPC_SHADOW_EVP_des_ecb +#define EVP_des_ede GRPC_SHADOW_EVP_des_ede +#define EVP_des_ede3 GRPC_SHADOW_EVP_des_ede3 +#define EVP_des_ede3_cbc GRPC_SHADOW_EVP_des_ede3_cbc +#define EVP_des_ede3_ecb GRPC_SHADOW_EVP_des_ede3_ecb +#define EVP_des_ede_cbc GRPC_SHADOW_EVP_des_ede_cbc +#define EVP_Digest GRPC_SHADOW_EVP_Digest +#define EVP_DigestFinal GRPC_SHADOW_EVP_DigestFinal +#define EVP_DigestFinal_ex GRPC_SHADOW_EVP_DigestFinal_ex +#define EVP_DigestFinalXOF GRPC_SHADOW_EVP_DigestFinalXOF +#define EVP_DigestInit GRPC_SHADOW_EVP_DigestInit +#define EVP_DigestInit_ex GRPC_SHADOW_EVP_DigestInit_ex +#define EVP_DigestSign GRPC_SHADOW_EVP_DigestSign +#define EVP_DigestSignFinal GRPC_SHADOW_EVP_DigestSignFinal +#define EVP_DigestSignInit GRPC_SHADOW_EVP_DigestSignInit +#define EVP_DigestSignUpdate GRPC_SHADOW_EVP_DigestSignUpdate +#define EVP_DigestUpdate GRPC_SHADOW_EVP_DigestUpdate +#define EVP_DigestVerify GRPC_SHADOW_EVP_DigestVerify +#define EVP_DigestVerifyFinal GRPC_SHADOW_EVP_DigestVerifyFinal +#define EVP_DigestVerifyInit GRPC_SHADOW_EVP_DigestVerifyInit +#define EVP_DigestVerifyUpdate GRPC_SHADOW_EVP_DigestVerifyUpdate +#define EVP_enc_null GRPC_SHADOW_EVP_enc_null +#define EVP_EncodeBlock GRPC_SHADOW_EVP_EncodeBlock +#define EVP_EncodedLength GRPC_SHADOW_EVP_EncodedLength +#define EVP_EncodeFinal GRPC_SHADOW_EVP_EncodeFinal +#define EVP_EncodeInit GRPC_SHADOW_EVP_EncodeInit +#define EVP_EncodeUpdate GRPC_SHADOW_EVP_EncodeUpdate +#define EVP_EncryptFinal_ex GRPC_SHADOW_EVP_EncryptFinal_ex +#define EVP_EncryptInit GRPC_SHADOW_EVP_EncryptInit +#define EVP_EncryptInit_ex GRPC_SHADOW_EVP_EncryptInit_ex +#define EVP_EncryptUpdate GRPC_SHADOW_EVP_EncryptUpdate +#define EVP_get_cipherbyname GRPC_SHADOW_EVP_get_cipherbyname +#define EVP_get_cipherbynid GRPC_SHADOW_EVP_get_cipherbynid +#define EVP_get_digestbyname GRPC_SHADOW_EVP_get_digestbyname +#define EVP_get_digestbynid GRPC_SHADOW_EVP_get_digestbynid +#define EVP_get_digestbyobj GRPC_SHADOW_EVP_get_digestbyobj +#define EVP_has_aes_hardware GRPC_SHADOW_EVP_has_aes_hardware +#define EVP_marshal_digest_algorithm GRPC_SHADOW_EVP_marshal_digest_algorithm +#define EVP_marshal_private_key GRPC_SHADOW_EVP_marshal_private_key +#define EVP_marshal_public_key GRPC_SHADOW_EVP_marshal_public_key +#define EVP_md4 GRPC_SHADOW_EVP_md4 +#define EVP_md5 GRPC_SHADOW_EVP_md5 +#define EVP_md5_sha1 GRPC_SHADOW_EVP_md5_sha1 +#define EVP_MD_block_size GRPC_SHADOW_EVP_MD_block_size +#define EVP_MD_CTX_block_size GRPC_SHADOW_EVP_MD_CTX_block_size +#define EVP_MD_CTX_cleanup GRPC_SHADOW_EVP_MD_CTX_cleanup +#define EVP_MD_CTX_copy GRPC_SHADOW_EVP_MD_CTX_copy +#define EVP_MD_CTX_copy_ex GRPC_SHADOW_EVP_MD_CTX_copy_ex +#define EVP_MD_CTX_create GRPC_SHADOW_EVP_MD_CTX_create +#define EVP_MD_CTX_destroy GRPC_SHADOW_EVP_MD_CTX_destroy +#define EVP_MD_CTX_free GRPC_SHADOW_EVP_MD_CTX_free +#define EVP_MD_CTX_init GRPC_SHADOW_EVP_MD_CTX_init +#define EVP_MD_CTX_md GRPC_SHADOW_EVP_MD_CTX_md +#define EVP_MD_CTX_new GRPC_SHADOW_EVP_MD_CTX_new +#define EVP_MD_CTX_reset GRPC_SHADOW_EVP_MD_CTX_reset +#define EVP_MD_CTX_size GRPC_SHADOW_EVP_MD_CTX_size +#define EVP_MD_CTX_type GRPC_SHADOW_EVP_MD_CTX_type +#define EVP_MD_flags GRPC_SHADOW_EVP_MD_flags +#define EVP_MD_meth_get_flags GRPC_SHADOW_EVP_MD_meth_get_flags +#define EVP_MD_size GRPC_SHADOW_EVP_MD_size +#define EVP_MD_type GRPC_SHADOW_EVP_MD_type +#define EVP_parse_digest_algorithm GRPC_SHADOW_EVP_parse_digest_algorithm +#define EVP_parse_private_key GRPC_SHADOW_EVP_parse_private_key +#define EVP_parse_public_key GRPC_SHADOW_EVP_parse_public_key +#define EVP_PBE_scrypt GRPC_SHADOW_EVP_PBE_scrypt +#define EVP_PKCS82PKEY GRPC_SHADOW_EVP_PKCS82PKEY +#define EVP_PKEY2PKCS8 GRPC_SHADOW_EVP_PKEY2PKCS8 +#define EVP_PKEY_assign GRPC_SHADOW_EVP_PKEY_assign +#define EVP_PKEY_assign_DSA GRPC_SHADOW_EVP_PKEY_assign_DSA +#define EVP_PKEY_assign_EC_KEY GRPC_SHADOW_EVP_PKEY_assign_EC_KEY +#define EVP_PKEY_assign_RSA GRPC_SHADOW_EVP_PKEY_assign_RSA +#define EVP_PKEY_base_id GRPC_SHADOW_EVP_PKEY_base_id +#define EVP_PKEY_bits GRPC_SHADOW_EVP_PKEY_bits +#define EVP_PKEY_cmp GRPC_SHADOW_EVP_PKEY_cmp +#define EVP_PKEY_cmp_parameters GRPC_SHADOW_EVP_PKEY_cmp_parameters +#define EVP_PKEY_copy_parameters GRPC_SHADOW_EVP_PKEY_copy_parameters +#define EVP_PKEY_CTX_ctrl GRPC_SHADOW_EVP_PKEY_CTX_ctrl +#define EVP_PKEY_CTX_dup GRPC_SHADOW_EVP_PKEY_CTX_dup +#define EVP_PKEY_CTX_free GRPC_SHADOW_EVP_PKEY_CTX_free +#define EVP_PKEY_CTX_get0_pkey GRPC_SHADOW_EVP_PKEY_CTX_get0_pkey +#define EVP_PKEY_CTX_get0_rsa_oaep_label GRPC_SHADOW_EVP_PKEY_CTX_get0_rsa_oaep_label +#define EVP_PKEY_CTX_get_rsa_mgf1_md GRPC_SHADOW_EVP_PKEY_CTX_get_rsa_mgf1_md +#define EVP_PKEY_CTX_get_rsa_oaep_md GRPC_SHADOW_EVP_PKEY_CTX_get_rsa_oaep_md +#define EVP_PKEY_CTX_get_rsa_padding GRPC_SHADOW_EVP_PKEY_CTX_get_rsa_padding +#define EVP_PKEY_CTX_get_rsa_pss_saltlen GRPC_SHADOW_EVP_PKEY_CTX_get_rsa_pss_saltlen +#define EVP_PKEY_CTX_get_signature_md GRPC_SHADOW_EVP_PKEY_CTX_get_signature_md +#define EVP_PKEY_CTX_new GRPC_SHADOW_EVP_PKEY_CTX_new +#define EVP_PKEY_CTX_new_id GRPC_SHADOW_EVP_PKEY_CTX_new_id +#define EVP_PKEY_CTX_set0_rsa_oaep_label GRPC_SHADOW_EVP_PKEY_CTX_set0_rsa_oaep_label +#define EVP_PKEY_CTX_set_ec_param_enc GRPC_SHADOW_EVP_PKEY_CTX_set_ec_param_enc +#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid GRPC_SHADOW_EVP_PKEY_CTX_set_ec_paramgen_curve_nid +#define EVP_PKEY_CTX_set_rsa_keygen_bits GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_keygen_bits +#define EVP_PKEY_CTX_set_rsa_keygen_pubexp GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_keygen_pubexp +#define EVP_PKEY_CTX_set_rsa_mgf1_md GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_mgf1_md +#define EVP_PKEY_CTX_set_rsa_oaep_md GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_oaep_md +#define EVP_PKEY_CTX_set_rsa_padding GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_padding +#define EVP_PKEY_CTX_set_rsa_pss_keygen_md GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_pss_keygen_md +#define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md +#define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen +#define EVP_PKEY_CTX_set_rsa_pss_saltlen GRPC_SHADOW_EVP_PKEY_CTX_set_rsa_pss_saltlen +#define EVP_PKEY_CTX_set_signature_md GRPC_SHADOW_EVP_PKEY_CTX_set_signature_md +#define EVP_PKEY_decrypt GRPC_SHADOW_EVP_PKEY_decrypt +#define EVP_PKEY_decrypt_init GRPC_SHADOW_EVP_PKEY_decrypt_init +#define EVP_PKEY_derive GRPC_SHADOW_EVP_PKEY_derive +#define EVP_PKEY_derive_init GRPC_SHADOW_EVP_PKEY_derive_init +#define EVP_PKEY_derive_set_peer GRPC_SHADOW_EVP_PKEY_derive_set_peer +#define EVP_PKEY_encrypt GRPC_SHADOW_EVP_PKEY_encrypt +#define EVP_PKEY_encrypt_init GRPC_SHADOW_EVP_PKEY_encrypt_init +#define EVP_PKEY_free GRPC_SHADOW_EVP_PKEY_free +#define EVP_PKEY_get0_DH GRPC_SHADOW_EVP_PKEY_get0_DH +#define EVP_PKEY_get0_DSA GRPC_SHADOW_EVP_PKEY_get0_DSA +#define EVP_PKEY_get0_EC_KEY GRPC_SHADOW_EVP_PKEY_get0_EC_KEY +#define EVP_PKEY_get0_RSA GRPC_SHADOW_EVP_PKEY_get0_RSA +#define EVP_PKEY_get1_DH GRPC_SHADOW_EVP_PKEY_get1_DH +#define EVP_PKEY_get1_DSA GRPC_SHADOW_EVP_PKEY_get1_DSA +#define EVP_PKEY_get1_EC_KEY GRPC_SHADOW_EVP_PKEY_get1_EC_KEY +#define EVP_PKEY_get1_RSA GRPC_SHADOW_EVP_PKEY_get1_RSA +#define EVP_PKEY_get1_tls_encodedpoint GRPC_SHADOW_EVP_PKEY_get1_tls_encodedpoint +#define EVP_PKEY_get_raw_private_key GRPC_SHADOW_EVP_PKEY_get_raw_private_key +#define EVP_PKEY_get_raw_public_key GRPC_SHADOW_EVP_PKEY_get_raw_public_key +#define EVP_PKEY_id GRPC_SHADOW_EVP_PKEY_id +#define EVP_PKEY_is_opaque GRPC_SHADOW_EVP_PKEY_is_opaque +#define EVP_PKEY_keygen GRPC_SHADOW_EVP_PKEY_keygen +#define EVP_PKEY_keygen_init GRPC_SHADOW_EVP_PKEY_keygen_init +#define EVP_PKEY_missing_parameters GRPC_SHADOW_EVP_PKEY_missing_parameters +#define EVP_PKEY_new GRPC_SHADOW_EVP_PKEY_new +#define EVP_PKEY_new_raw_private_key GRPC_SHADOW_EVP_PKEY_new_raw_private_key +#define EVP_PKEY_new_raw_public_key GRPC_SHADOW_EVP_PKEY_new_raw_public_key +#define EVP_PKEY_paramgen GRPC_SHADOW_EVP_PKEY_paramgen +#define EVP_PKEY_paramgen_init GRPC_SHADOW_EVP_PKEY_paramgen_init +#define EVP_PKEY_print_params GRPC_SHADOW_EVP_PKEY_print_params +#define EVP_PKEY_print_private GRPC_SHADOW_EVP_PKEY_print_private +#define EVP_PKEY_print_public GRPC_SHADOW_EVP_PKEY_print_public +#define EVP_PKEY_set1_DSA GRPC_SHADOW_EVP_PKEY_set1_DSA +#define EVP_PKEY_set1_EC_KEY GRPC_SHADOW_EVP_PKEY_set1_EC_KEY +#define EVP_PKEY_set1_RSA GRPC_SHADOW_EVP_PKEY_set1_RSA +#define EVP_PKEY_set1_tls_encodedpoint GRPC_SHADOW_EVP_PKEY_set1_tls_encodedpoint +#define EVP_PKEY_set_type GRPC_SHADOW_EVP_PKEY_set_type +#define EVP_PKEY_sign GRPC_SHADOW_EVP_PKEY_sign +#define EVP_PKEY_sign_init GRPC_SHADOW_EVP_PKEY_sign_init +#define EVP_PKEY_size GRPC_SHADOW_EVP_PKEY_size +#define EVP_PKEY_type GRPC_SHADOW_EVP_PKEY_type +#define EVP_PKEY_up_ref GRPC_SHADOW_EVP_PKEY_up_ref +#define EVP_PKEY_verify GRPC_SHADOW_EVP_PKEY_verify +#define EVP_PKEY_verify_init GRPC_SHADOW_EVP_PKEY_verify_init +#define EVP_PKEY_verify_recover GRPC_SHADOW_EVP_PKEY_verify_recover +#define EVP_PKEY_verify_recover_init GRPC_SHADOW_EVP_PKEY_verify_recover_init +#define EVP_rc2_40_cbc GRPC_SHADOW_EVP_rc2_40_cbc +#define EVP_rc2_cbc GRPC_SHADOW_EVP_rc2_cbc +#define EVP_rc4 GRPC_SHADOW_EVP_rc4 +#define EVP_sha1 GRPC_SHADOW_EVP_sha1 +#define EVP_sha224 GRPC_SHADOW_EVP_sha224 +#define EVP_sha256 GRPC_SHADOW_EVP_sha256 +#define EVP_sha384 GRPC_SHADOW_EVP_sha384 +#define EVP_sha512 GRPC_SHADOW_EVP_sha512 +#define EVP_SignFinal GRPC_SHADOW_EVP_SignFinal +#define EVP_SignInit GRPC_SHADOW_EVP_SignInit +#define EVP_SignInit_ex GRPC_SHADOW_EVP_SignInit_ex +#define EVP_SignUpdate GRPC_SHADOW_EVP_SignUpdate +#define EVP_tls_cbc_copy_mac GRPC_SHADOW_EVP_tls_cbc_copy_mac +#define EVP_tls_cbc_digest_record GRPC_SHADOW_EVP_tls_cbc_digest_record +#define EVP_tls_cbc_record_digest_supported GRPC_SHADOW_EVP_tls_cbc_record_digest_supported +#define EVP_tls_cbc_remove_padding GRPC_SHADOW_EVP_tls_cbc_remove_padding +#define EVP_VerifyFinal GRPC_SHADOW_EVP_VerifyFinal +#define EVP_VerifyInit GRPC_SHADOW_EVP_VerifyInit +#define EVP_VerifyInit_ex GRPC_SHADOW_EVP_VerifyInit_ex +#define EVP_VerifyUpdate GRPC_SHADOW_EVP_VerifyUpdate +#define EXTENDED_KEY_USAGE_free GRPC_SHADOW_EXTENDED_KEY_USAGE_free +#define EXTENDED_KEY_USAGE_it GRPC_SHADOW_EXTENDED_KEY_USAGE_it +#define EXTENDED_KEY_USAGE_new GRPC_SHADOW_EXTENDED_KEY_USAGE_new +#define FIPS_mode GRPC_SHADOW_FIPS_mode +#define FIPS_mode_set GRPC_SHADOW_FIPS_mode_set +#define gcm_ghash_avx GRPC_SHADOW_gcm_ghash_avx +#define gcm_ghash_clmul GRPC_SHADOW_gcm_ghash_clmul +#define gcm_ghash_nohw GRPC_SHADOW_gcm_ghash_nohw +#define gcm_ghash_ssse3 GRPC_SHADOW_gcm_ghash_ssse3 +#define gcm_gmult_avx GRPC_SHADOW_gcm_gmult_avx +#define gcm_gmult_clmul GRPC_SHADOW_gcm_gmult_clmul +#define gcm_gmult_nohw GRPC_SHADOW_gcm_gmult_nohw +#define gcm_gmult_ssse3 GRPC_SHADOW_gcm_gmult_ssse3 +#define gcm_init_avx GRPC_SHADOW_gcm_init_avx +#define gcm_init_clmul GRPC_SHADOW_gcm_init_clmul +#define gcm_init_nohw GRPC_SHADOW_gcm_init_nohw +#define gcm_init_ssse3 GRPC_SHADOW_gcm_init_ssse3 +#define GENERAL_NAME_cmp GRPC_SHADOW_GENERAL_NAME_cmp +#define GENERAL_NAME_dup GRPC_SHADOW_GENERAL_NAME_dup +#define GENERAL_NAME_free GRPC_SHADOW_GENERAL_NAME_free +#define GENERAL_NAME_get0_otherName GRPC_SHADOW_GENERAL_NAME_get0_otherName +#define GENERAL_NAME_get0_value GRPC_SHADOW_GENERAL_NAME_get0_value +#define GENERAL_NAME_it GRPC_SHADOW_GENERAL_NAME_it +#define GENERAL_NAME_new GRPC_SHADOW_GENERAL_NAME_new +#define GENERAL_NAME_print GRPC_SHADOW_GENERAL_NAME_print +#define GENERAL_NAME_set0_othername GRPC_SHADOW_GENERAL_NAME_set0_othername +#define GENERAL_NAME_set0_value GRPC_SHADOW_GENERAL_NAME_set0_value +#define GENERAL_NAMES_free GRPC_SHADOW_GENERAL_NAMES_free +#define GENERAL_NAMES_it GRPC_SHADOW_GENERAL_NAMES_it +#define GENERAL_NAMES_new GRPC_SHADOW_GENERAL_NAMES_new +#define GENERAL_SUBTREE_free GRPC_SHADOW_GENERAL_SUBTREE_free +#define GENERAL_SUBTREE_it GRPC_SHADOW_GENERAL_SUBTREE_it +#define GENERAL_SUBTREE_new GRPC_SHADOW_GENERAL_SUBTREE_new +#define HKDF GRPC_SHADOW_HKDF +#define HKDF_expand GRPC_SHADOW_HKDF_expand +#define HKDF_extract GRPC_SHADOW_HKDF_extract +#define HMAC GRPC_SHADOW_HMAC +#define HMAC_CTX_cleanup GRPC_SHADOW_HMAC_CTX_cleanup +#define HMAC_CTX_copy GRPC_SHADOW_HMAC_CTX_copy +#define HMAC_CTX_copy_ex GRPC_SHADOW_HMAC_CTX_copy_ex +#define HMAC_CTX_free GRPC_SHADOW_HMAC_CTX_free +#define HMAC_CTX_init GRPC_SHADOW_HMAC_CTX_init +#define HMAC_CTX_new GRPC_SHADOW_HMAC_CTX_new +#define HMAC_CTX_reset GRPC_SHADOW_HMAC_CTX_reset +#define HMAC_Final GRPC_SHADOW_HMAC_Final +#define HMAC_Init GRPC_SHADOW_HMAC_Init +#define HMAC_Init_ex GRPC_SHADOW_HMAC_Init_ex +#define HMAC_size GRPC_SHADOW_HMAC_size +#define HMAC_Update GRPC_SHADOW_HMAC_Update +#define HRSS_decap GRPC_SHADOW_HRSS_decap +#define HRSS_encap GRPC_SHADOW_HRSS_encap +#define HRSS_generate_key GRPC_SHADOW_HRSS_generate_key +#define HRSS_marshal_public_key GRPC_SHADOW_HRSS_marshal_public_key +#define HRSS_parse_public_key GRPC_SHADOW_HRSS_parse_public_key +#define HRSS_poly3_invert GRPC_SHADOW_HRSS_poly3_invert +#define HRSS_poly3_mul GRPC_SHADOW_HRSS_poly3_mul +#define i2a_ACCESS_DESCRIPTION GRPC_SHADOW_i2a_ACCESS_DESCRIPTION +#define i2a_ASN1_ENUMERATED GRPC_SHADOW_i2a_ASN1_ENUMERATED +#define i2a_ASN1_INTEGER GRPC_SHADOW_i2a_ASN1_INTEGER +#define i2a_ASN1_OBJECT GRPC_SHADOW_i2a_ASN1_OBJECT +#define i2a_ASN1_STRING GRPC_SHADOW_i2a_ASN1_STRING +#define i2c_ASN1_BIT_STRING GRPC_SHADOW_i2c_ASN1_BIT_STRING +#define i2c_ASN1_INTEGER GRPC_SHADOW_i2c_ASN1_INTEGER +#define i2d_ACCESS_DESCRIPTION GRPC_SHADOW_i2d_ACCESS_DESCRIPTION +#define i2d_ASN1_BIT_STRING GRPC_SHADOW_i2d_ASN1_BIT_STRING +#define i2d_ASN1_BMPSTRING GRPC_SHADOW_i2d_ASN1_BMPSTRING +#define i2d_ASN1_BOOLEAN GRPC_SHADOW_i2d_ASN1_BOOLEAN +#define i2d_ASN1_ENUMERATED GRPC_SHADOW_i2d_ASN1_ENUMERATED +#define i2d_ASN1_GENERALIZEDTIME GRPC_SHADOW_i2d_ASN1_GENERALIZEDTIME +#define i2d_ASN1_GENERALSTRING GRPC_SHADOW_i2d_ASN1_GENERALSTRING +#define i2d_ASN1_IA5STRING GRPC_SHADOW_i2d_ASN1_IA5STRING +#define i2d_ASN1_INTEGER GRPC_SHADOW_i2d_ASN1_INTEGER +#define i2d_ASN1_NULL GRPC_SHADOW_i2d_ASN1_NULL +#define i2d_ASN1_OBJECT GRPC_SHADOW_i2d_ASN1_OBJECT +#define i2d_ASN1_OCTET_STRING GRPC_SHADOW_i2d_ASN1_OCTET_STRING +#define i2d_ASN1_PRINTABLE GRPC_SHADOW_i2d_ASN1_PRINTABLE +#define i2d_ASN1_PRINTABLESTRING GRPC_SHADOW_i2d_ASN1_PRINTABLESTRING +#define i2d_ASN1_SEQUENCE_ANY GRPC_SHADOW_i2d_ASN1_SEQUENCE_ANY +#define i2d_ASN1_SET_ANY GRPC_SHADOW_i2d_ASN1_SET_ANY +#define i2d_ASN1_T61STRING GRPC_SHADOW_i2d_ASN1_T61STRING +#define i2d_ASN1_TIME GRPC_SHADOW_i2d_ASN1_TIME +#define i2d_ASN1_TYPE GRPC_SHADOW_i2d_ASN1_TYPE +#define i2d_ASN1_UNIVERSALSTRING GRPC_SHADOW_i2d_ASN1_UNIVERSALSTRING +#define i2d_ASN1_UTCTIME GRPC_SHADOW_i2d_ASN1_UTCTIME +#define i2d_ASN1_UTF8STRING GRPC_SHADOW_i2d_ASN1_UTF8STRING +#define i2d_ASN1_VISIBLESTRING GRPC_SHADOW_i2d_ASN1_VISIBLESTRING +#define i2d_AUTHORITY_INFO_ACCESS GRPC_SHADOW_i2d_AUTHORITY_INFO_ACCESS +#define i2d_AUTHORITY_KEYID GRPC_SHADOW_i2d_AUTHORITY_KEYID +#define i2d_BASIC_CONSTRAINTS GRPC_SHADOW_i2d_BASIC_CONSTRAINTS +#define i2d_CERTIFICATEPOLICIES GRPC_SHADOW_i2d_CERTIFICATEPOLICIES +#define i2d_CRL_DIST_POINTS GRPC_SHADOW_i2d_CRL_DIST_POINTS +#define i2d_DHparams GRPC_SHADOW_i2d_DHparams +#define i2d_DHparams_bio GRPC_SHADOW_i2d_DHparams_bio +#define i2d_DIRECTORYSTRING GRPC_SHADOW_i2d_DIRECTORYSTRING +#define i2d_DISPLAYTEXT GRPC_SHADOW_i2d_DISPLAYTEXT +#define i2d_DIST_POINT GRPC_SHADOW_i2d_DIST_POINT +#define i2d_DIST_POINT_NAME GRPC_SHADOW_i2d_DIST_POINT_NAME +#define i2d_DSAparams GRPC_SHADOW_i2d_DSAparams +#define i2d_DSAPrivateKey GRPC_SHADOW_i2d_DSAPrivateKey +#define i2d_DSAPrivateKey_bio GRPC_SHADOW_i2d_DSAPrivateKey_bio +#define i2d_DSAPrivateKey_fp GRPC_SHADOW_i2d_DSAPrivateKey_fp +#define i2d_DSA_PUBKEY GRPC_SHADOW_i2d_DSA_PUBKEY +#define i2d_DSA_PUBKEY_bio GRPC_SHADOW_i2d_DSA_PUBKEY_bio +#define i2d_DSA_PUBKEY_fp GRPC_SHADOW_i2d_DSA_PUBKEY_fp +#define i2d_DSAPublicKey GRPC_SHADOW_i2d_DSAPublicKey +#define i2d_DSA_SIG GRPC_SHADOW_i2d_DSA_SIG +#define i2d_ECDSA_SIG GRPC_SHADOW_i2d_ECDSA_SIG +#define i2d_ECParameters GRPC_SHADOW_i2d_ECParameters +#define i2d_ECPrivateKey GRPC_SHADOW_i2d_ECPrivateKey +#define i2d_ECPrivateKey_bio GRPC_SHADOW_i2d_ECPrivateKey_bio +#define i2d_ECPrivateKey_fp GRPC_SHADOW_i2d_ECPrivateKey_fp +#define i2d_EC_PUBKEY GRPC_SHADOW_i2d_EC_PUBKEY +#define i2d_EC_PUBKEY_bio GRPC_SHADOW_i2d_EC_PUBKEY_bio +#define i2d_EC_PUBKEY_fp GRPC_SHADOW_i2d_EC_PUBKEY_fp +#define i2d_EDIPARTYNAME GRPC_SHADOW_i2d_EDIPARTYNAME +#define i2d_EXTENDED_KEY_USAGE GRPC_SHADOW_i2d_EXTENDED_KEY_USAGE +#define i2d_GENERAL_NAME GRPC_SHADOW_i2d_GENERAL_NAME +#define i2d_GENERAL_NAMES GRPC_SHADOW_i2d_GENERAL_NAMES +#define i2d_ISSUING_DIST_POINT GRPC_SHADOW_i2d_ISSUING_DIST_POINT +#define i2d_NETSCAPE_SPKAC GRPC_SHADOW_i2d_NETSCAPE_SPKAC +#define i2d_NETSCAPE_SPKI GRPC_SHADOW_i2d_NETSCAPE_SPKI +#define i2d_NOTICEREF GRPC_SHADOW_i2d_NOTICEREF +#define i2d_OTHERNAME GRPC_SHADOW_i2d_OTHERNAME +#define i2d_PKCS12 GRPC_SHADOW_i2d_PKCS12 +#define i2d_PKCS12_bio GRPC_SHADOW_i2d_PKCS12_bio +#define i2d_PKCS12_fp GRPC_SHADOW_i2d_PKCS12_fp +#define i2d_PKCS7 GRPC_SHADOW_i2d_PKCS7 +#define i2d_PKCS7_bio GRPC_SHADOW_i2d_PKCS7_bio +#define i2d_PKCS8_bio GRPC_SHADOW_i2d_PKCS8_bio +#define i2d_PKCS8_fp GRPC_SHADOW_i2d_PKCS8_fp +#define i2d_PKCS8PrivateKey_bio GRPC_SHADOW_i2d_PKCS8PrivateKey_bio +#define i2d_PKCS8PrivateKey_fp GRPC_SHADOW_i2d_PKCS8PrivateKey_fp +#define i2d_PKCS8PrivateKeyInfo_bio GRPC_SHADOW_i2d_PKCS8PrivateKeyInfo_bio +#define i2d_PKCS8PrivateKeyInfo_fp GRPC_SHADOW_i2d_PKCS8PrivateKeyInfo_fp +#define i2d_PKCS8PrivateKey_nid_bio GRPC_SHADOW_i2d_PKCS8PrivateKey_nid_bio +#define i2d_PKCS8PrivateKey_nid_fp GRPC_SHADOW_i2d_PKCS8PrivateKey_nid_fp +#define i2d_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_i2d_PKCS8_PRIV_KEY_INFO +#define i2d_PKCS8_PRIV_KEY_INFO_bio GRPC_SHADOW_i2d_PKCS8_PRIV_KEY_INFO_bio +#define i2d_PKCS8_PRIV_KEY_INFO_fp GRPC_SHADOW_i2d_PKCS8_PRIV_KEY_INFO_fp +#define i2d_PKEY_USAGE_PERIOD GRPC_SHADOW_i2d_PKEY_USAGE_PERIOD +#define i2d_POLICYINFO GRPC_SHADOW_i2d_POLICYINFO +#define i2d_POLICYQUALINFO GRPC_SHADOW_i2d_POLICYQUALINFO +#define i2d_PrivateKey GRPC_SHADOW_i2d_PrivateKey +#define i2d_PrivateKey_bio GRPC_SHADOW_i2d_PrivateKey_bio +#define i2d_PrivateKey_fp GRPC_SHADOW_i2d_PrivateKey_fp +#define i2d_PROXY_CERT_INFO_EXTENSION GRPC_SHADOW_i2d_PROXY_CERT_INFO_EXTENSION +#define i2d_PROXY_POLICY GRPC_SHADOW_i2d_PROXY_POLICY +#define i2d_PUBKEY GRPC_SHADOW_i2d_PUBKEY +#define i2d_PUBKEY_bio GRPC_SHADOW_i2d_PUBKEY_bio +#define i2d_PUBKEY_fp GRPC_SHADOW_i2d_PUBKEY_fp +#define i2d_PublicKey GRPC_SHADOW_i2d_PublicKey +#define i2d_re_X509_CRL_tbs GRPC_SHADOW_i2d_re_X509_CRL_tbs +#define i2d_re_X509_REQ_tbs GRPC_SHADOW_i2d_re_X509_REQ_tbs +#define i2d_re_X509_tbs GRPC_SHADOW_i2d_re_X509_tbs +#define i2d_RSAPrivateKey GRPC_SHADOW_i2d_RSAPrivateKey +#define i2d_RSAPrivateKey_bio GRPC_SHADOW_i2d_RSAPrivateKey_bio +#define i2d_RSAPrivateKey_fp GRPC_SHADOW_i2d_RSAPrivateKey_fp +#define i2d_RSA_PSS_PARAMS GRPC_SHADOW_i2d_RSA_PSS_PARAMS +#define i2d_RSA_PUBKEY GRPC_SHADOW_i2d_RSA_PUBKEY +#define i2d_RSA_PUBKEY_bio GRPC_SHADOW_i2d_RSA_PUBKEY_bio +#define i2d_RSA_PUBKEY_fp GRPC_SHADOW_i2d_RSA_PUBKEY_fp +#define i2d_RSAPublicKey GRPC_SHADOW_i2d_RSAPublicKey +#define i2d_RSAPublicKey_bio GRPC_SHADOW_i2d_RSAPublicKey_bio +#define i2d_RSAPublicKey_fp GRPC_SHADOW_i2d_RSAPublicKey_fp +#define i2d_SSL_SESSION GRPC_SHADOW_i2d_SSL_SESSION +#define i2d_SSL_SESSION_bio GRPC_SHADOW_i2d_SSL_SESSION_bio +#define i2d_SXNET GRPC_SHADOW_i2d_SXNET +#define i2d_SXNETID GRPC_SHADOW_i2d_SXNETID +#define i2d_USERNOTICE GRPC_SHADOW_i2d_USERNOTICE +#define i2d_X509 GRPC_SHADOW_i2d_X509 +#define i2d_X509_ALGOR GRPC_SHADOW_i2d_X509_ALGOR +#define i2d_X509_ALGORS GRPC_SHADOW_i2d_X509_ALGORS +#define i2d_X509_ATTRIBUTE GRPC_SHADOW_i2d_X509_ATTRIBUTE +#define i2d_X509_AUX GRPC_SHADOW_i2d_X509_AUX +#define i2d_X509_bio GRPC_SHADOW_i2d_X509_bio +#define i2d_X509_CERT_AUX GRPC_SHADOW_i2d_X509_CERT_AUX +#define i2d_X509_CINF GRPC_SHADOW_i2d_X509_CINF +#define i2d_X509_CRL GRPC_SHADOW_i2d_X509_CRL +#define i2d_X509_CRL_bio GRPC_SHADOW_i2d_X509_CRL_bio +#define i2d_X509_CRL_fp GRPC_SHADOW_i2d_X509_CRL_fp +#define i2d_X509_CRL_INFO GRPC_SHADOW_i2d_X509_CRL_INFO +#define i2d_X509_EXTENSION GRPC_SHADOW_i2d_X509_EXTENSION +#define i2d_X509_EXTENSIONS GRPC_SHADOW_i2d_X509_EXTENSIONS +#define i2d_X509_fp GRPC_SHADOW_i2d_X509_fp +#define i2d_X509_NAME GRPC_SHADOW_i2d_X509_NAME +#define i2d_X509_NAME_ENTRY GRPC_SHADOW_i2d_X509_NAME_ENTRY +#define i2d_X509_PUBKEY GRPC_SHADOW_i2d_X509_PUBKEY +#define i2d_X509_REQ GRPC_SHADOW_i2d_X509_REQ +#define i2d_X509_REQ_bio GRPC_SHADOW_i2d_X509_REQ_bio +#define i2d_X509_REQ_fp GRPC_SHADOW_i2d_X509_REQ_fp +#define i2d_X509_REQ_INFO GRPC_SHADOW_i2d_X509_REQ_INFO +#define i2d_X509_REVOKED GRPC_SHADOW_i2d_X509_REVOKED +#define i2d_X509_SIG GRPC_SHADOW_i2d_X509_SIG +#define i2d_X509_VAL GRPC_SHADOW_i2d_X509_VAL +#define i2o_ECPublicKey GRPC_SHADOW_i2o_ECPublicKey +#define i2s_ASN1_ENUMERATED GRPC_SHADOW_i2s_ASN1_ENUMERATED +#define i2s_ASN1_ENUMERATED_TABLE GRPC_SHADOW_i2s_ASN1_ENUMERATED_TABLE +#define i2s_ASN1_INTEGER GRPC_SHADOW_i2s_ASN1_INTEGER +#define i2s_ASN1_OCTET_STRING GRPC_SHADOW_i2s_ASN1_OCTET_STRING +#define i2t_ASN1_OBJECT GRPC_SHADOW_i2t_ASN1_OBJECT +#define i2v_ASN1_BIT_STRING GRPC_SHADOW_i2v_ASN1_BIT_STRING +#define i2v_GENERAL_NAME GRPC_SHADOW_i2v_GENERAL_NAME +#define i2v_GENERAL_NAMES GRPC_SHADOW_i2v_GENERAL_NAMES +#define ISSUING_DIST_POINT_free GRPC_SHADOW_ISSUING_DIST_POINT_free +#define ISSUING_DIST_POINT_it GRPC_SHADOW_ISSUING_DIST_POINT_it +#define ISSUING_DIST_POINT_new GRPC_SHADOW_ISSUING_DIST_POINT_new +#define kBoringSSLRSASqrtTwo GRPC_SHADOW_kBoringSSLRSASqrtTwo +#define kBoringSSLRSASqrtTwoLen GRPC_SHADOW_kBoringSSLRSASqrtTwoLen +#define kOpenSSLReasonStringData GRPC_SHADOW_kOpenSSLReasonStringData +#define kOpenSSLReasonValues GRPC_SHADOW_kOpenSSLReasonValues +#define kOpenSSLReasonValuesLen GRPC_SHADOW_kOpenSSLReasonValuesLen +#define level_add_node GRPC_SHADOW_level_add_node +#define level_find_node GRPC_SHADOW_level_find_node +#define lh_delete GRPC_SHADOW_lh_delete +#define lh_doall_arg GRPC_SHADOW_lh_doall_arg +#define lh_free GRPC_SHADOW_lh_free +#define lh_insert GRPC_SHADOW_lh_insert +#define lh_new GRPC_SHADOW_lh_new +#define lh_num_items GRPC_SHADOW_lh_num_items +#define lh_retrieve GRPC_SHADOW_lh_retrieve +#define lh_retrieve_key GRPC_SHADOW_lh_retrieve_key +#define lh_strhash GRPC_SHADOW_lh_strhash +#define MD4 GRPC_SHADOW_MD4 +#define md4_block_data_order GRPC_SHADOW_md4_block_data_order +#define MD4_Final GRPC_SHADOW_MD4_Final +#define MD4_Init GRPC_SHADOW_MD4_Init +#define MD4_Transform GRPC_SHADOW_MD4_Transform +#define MD4_Update GRPC_SHADOW_MD4_Update +#define MD5 GRPC_SHADOW_MD5 +#define md5_block_asm_data_order GRPC_SHADOW_md5_block_asm_data_order +#define MD5_Final GRPC_SHADOW_MD5_Final +#define MD5_Init GRPC_SHADOW_MD5_Init +#define MD5_Transform GRPC_SHADOW_MD5_Transform +#define MD5_Update GRPC_SHADOW_MD5_Update +#define METHOD_ref GRPC_SHADOW_METHOD_ref +#define METHOD_unref GRPC_SHADOW_METHOD_unref +#define NAME_CONSTRAINTS_check GRPC_SHADOW_NAME_CONSTRAINTS_check +#define NAME_CONSTRAINTS_free GRPC_SHADOW_NAME_CONSTRAINTS_free +#define NAME_CONSTRAINTS_it GRPC_SHADOW_NAME_CONSTRAINTS_it +#define NAME_CONSTRAINTS_new GRPC_SHADOW_NAME_CONSTRAINTS_new +#define NCONF_free GRPC_SHADOW_NCONF_free +#define NCONF_get_section GRPC_SHADOW_NCONF_get_section +#define NCONF_get_string GRPC_SHADOW_NCONF_get_string +#define NCONF_load GRPC_SHADOW_NCONF_load +#define NCONF_load_bio GRPC_SHADOW_NCONF_load_bio +#define NCONF_new GRPC_SHADOW_NCONF_new +#define NETSCAPE_SPKAC_free GRPC_SHADOW_NETSCAPE_SPKAC_free +#define NETSCAPE_SPKAC_it GRPC_SHADOW_NETSCAPE_SPKAC_it +#define NETSCAPE_SPKAC_new GRPC_SHADOW_NETSCAPE_SPKAC_new +#define NETSCAPE_SPKI_b64_decode GRPC_SHADOW_NETSCAPE_SPKI_b64_decode +#define NETSCAPE_SPKI_b64_encode GRPC_SHADOW_NETSCAPE_SPKI_b64_encode +#define NETSCAPE_SPKI_free GRPC_SHADOW_NETSCAPE_SPKI_free +#define NETSCAPE_SPKI_get_pubkey GRPC_SHADOW_NETSCAPE_SPKI_get_pubkey +#define NETSCAPE_SPKI_it GRPC_SHADOW_NETSCAPE_SPKI_it +#define NETSCAPE_SPKI_new GRPC_SHADOW_NETSCAPE_SPKI_new +#define NETSCAPE_SPKI_set_pubkey GRPC_SHADOW_NETSCAPE_SPKI_set_pubkey +#define NETSCAPE_SPKI_sign GRPC_SHADOW_NETSCAPE_SPKI_sign +#define NETSCAPE_SPKI_verify GRPC_SHADOW_NETSCAPE_SPKI_verify +#define NOTICEREF_free GRPC_SHADOW_NOTICEREF_free +#define NOTICEREF_it GRPC_SHADOW_NOTICEREF_it +#define NOTICEREF_new GRPC_SHADOW_NOTICEREF_new +#define o2i_ECPublicKey GRPC_SHADOW_o2i_ECPublicKey +#define OBJ_cbs2nid GRPC_SHADOW_OBJ_cbs2nid +#define OBJ_cleanup GRPC_SHADOW_OBJ_cleanup +#define OBJ_cmp GRPC_SHADOW_OBJ_cmp +#define OBJ_create GRPC_SHADOW_OBJ_create +#define OBJ_dup GRPC_SHADOW_OBJ_dup +#define OBJ_find_sigid_algs GRPC_SHADOW_OBJ_find_sigid_algs +#define OBJ_find_sigid_by_algs GRPC_SHADOW_OBJ_find_sigid_by_algs +#define OBJ_get0_data GRPC_SHADOW_OBJ_get0_data +#define OBJ_length GRPC_SHADOW_OBJ_length +#define OBJ_ln2nid GRPC_SHADOW_OBJ_ln2nid +#define OBJ_nid2cbb GRPC_SHADOW_OBJ_nid2cbb +#define OBJ_nid2ln GRPC_SHADOW_OBJ_nid2ln +#define OBJ_nid2obj GRPC_SHADOW_OBJ_nid2obj +#define OBJ_nid2sn GRPC_SHADOW_OBJ_nid2sn +#define OBJ_obj2nid GRPC_SHADOW_OBJ_obj2nid +#define OBJ_obj2txt GRPC_SHADOW_OBJ_obj2txt +#define OBJ_sn2nid GRPC_SHADOW_OBJ_sn2nid +#define OBJ_txt2nid GRPC_SHADOW_OBJ_txt2nid +#define OBJ_txt2obj GRPC_SHADOW_OBJ_txt2obj +#define OpenSSL_add_all_algorithms GRPC_SHADOW_OpenSSL_add_all_algorithms +#define OPENSSL_add_all_algorithms_conf GRPC_SHADOW_OPENSSL_add_all_algorithms_conf +#define OpenSSL_add_all_ciphers GRPC_SHADOW_OpenSSL_add_all_ciphers +#define OpenSSL_add_all_digests GRPC_SHADOW_OpenSSL_add_all_digests +#define OPENSSL_built_in_curves GRPC_SHADOW_OPENSSL_built_in_curves +#define OPENSSL_cleanse GRPC_SHADOW_OPENSSL_cleanse +#define OPENSSL_cleanup GRPC_SHADOW_OPENSSL_cleanup +#define OPENSSL_clear_free GRPC_SHADOW_OPENSSL_clear_free +#define OPENSSL_config GRPC_SHADOW_OPENSSL_config +#define OPENSSL_cpuid_setup GRPC_SHADOW_OPENSSL_cpuid_setup +#define OPENSSL_free GRPC_SHADOW_OPENSSL_free +#define OPENSSL_gmtime GRPC_SHADOW_OPENSSL_gmtime +#define OPENSSL_gmtime_adj GRPC_SHADOW_OPENSSL_gmtime_adj +#define OPENSSL_gmtime_diff GRPC_SHADOW_OPENSSL_gmtime_diff +#define OPENSSL_hash32 GRPC_SHADOW_OPENSSL_hash32 +#define OPENSSL_ia32cap_P GRPC_SHADOW_OPENSSL_ia32cap_P +#define OPENSSL_init_crypto GRPC_SHADOW_OPENSSL_init_crypto +#define OPENSSL_init_ssl GRPC_SHADOW_OPENSSL_init_ssl +#define OPENSSL_load_builtin_modules GRPC_SHADOW_OPENSSL_load_builtin_modules +#define OPENSSL_malloc GRPC_SHADOW_OPENSSL_malloc +#define OPENSSL_malloc_init GRPC_SHADOW_OPENSSL_malloc_init +#define OPENSSL_memdup GRPC_SHADOW_OPENSSL_memdup +#define OPENSSL_no_config GRPC_SHADOW_OPENSSL_no_config +#define OPENSSL_realloc GRPC_SHADOW_OPENSSL_realloc +#define OPENSSL_strcasecmp GRPC_SHADOW_OPENSSL_strcasecmp +#define OPENSSL_strdup GRPC_SHADOW_OPENSSL_strdup +#define OPENSSL_strlcat GRPC_SHADOW_OPENSSL_strlcat +#define OPENSSL_strlcpy GRPC_SHADOW_OPENSSL_strlcpy +#define OPENSSL_strncasecmp GRPC_SHADOW_OPENSSL_strncasecmp +#define OPENSSL_strndup GRPC_SHADOW_OPENSSL_strndup +#define OPENSSL_strnlen GRPC_SHADOW_OPENSSL_strnlen +#define OPENSSL_tolower GRPC_SHADOW_OPENSSL_tolower +#define OpenSSL_version GRPC_SHADOW_OpenSSL_version +#define OpenSSL_version_num GRPC_SHADOW_OpenSSL_version_num +#define OTHERNAME_cmp GRPC_SHADOW_OTHERNAME_cmp +#define OTHERNAME_free GRPC_SHADOW_OTHERNAME_free +#define OTHERNAME_it GRPC_SHADOW_OTHERNAME_it +#define OTHERNAME_new GRPC_SHADOW_OTHERNAME_new +#define PEM_ASN1_read GRPC_SHADOW_PEM_ASN1_read +#define PEM_ASN1_read_bio GRPC_SHADOW_PEM_ASN1_read_bio +#define PEM_ASN1_write GRPC_SHADOW_PEM_ASN1_write +#define PEM_ASN1_write_bio GRPC_SHADOW_PEM_ASN1_write_bio +#define PEM_bytes_read_bio GRPC_SHADOW_PEM_bytes_read_bio +#define PEM_def_callback GRPC_SHADOW_PEM_def_callback +#define PEM_dek_info GRPC_SHADOW_PEM_dek_info +#define PEM_do_header GRPC_SHADOW_PEM_do_header +#define PEM_get_EVP_CIPHER_INFO GRPC_SHADOW_PEM_get_EVP_CIPHER_INFO +#define PEM_proc_type GRPC_SHADOW_PEM_proc_type +#define PEM_read GRPC_SHADOW_PEM_read +#define PEM_read_bio GRPC_SHADOW_PEM_read_bio +#define PEM_read_bio_DHparams GRPC_SHADOW_PEM_read_bio_DHparams +#define PEM_read_bio_DSAparams GRPC_SHADOW_PEM_read_bio_DSAparams +#define PEM_read_bio_DSAPrivateKey GRPC_SHADOW_PEM_read_bio_DSAPrivateKey +#define PEM_read_bio_DSA_PUBKEY GRPC_SHADOW_PEM_read_bio_DSA_PUBKEY +#define PEM_read_bio_ECPrivateKey GRPC_SHADOW_PEM_read_bio_ECPrivateKey +#define PEM_read_bio_EC_PUBKEY GRPC_SHADOW_PEM_read_bio_EC_PUBKEY +#define PEM_read_bio_PKCS7 GRPC_SHADOW_PEM_read_bio_PKCS7 +#define PEM_read_bio_PKCS8 GRPC_SHADOW_PEM_read_bio_PKCS8 +#define PEM_read_bio_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_PEM_read_bio_PKCS8_PRIV_KEY_INFO +#define PEM_read_bio_PrivateKey GRPC_SHADOW_PEM_read_bio_PrivateKey +#define PEM_read_bio_PUBKEY GRPC_SHADOW_PEM_read_bio_PUBKEY +#define PEM_read_bio_RSAPrivateKey GRPC_SHADOW_PEM_read_bio_RSAPrivateKey +#define PEM_read_bio_RSA_PUBKEY GRPC_SHADOW_PEM_read_bio_RSA_PUBKEY +#define PEM_read_bio_RSAPublicKey GRPC_SHADOW_PEM_read_bio_RSAPublicKey +#define PEM_read_bio_SSL_SESSION GRPC_SHADOW_PEM_read_bio_SSL_SESSION +#define PEM_read_bio_X509 GRPC_SHADOW_PEM_read_bio_X509 +#define PEM_read_bio_X509_AUX GRPC_SHADOW_PEM_read_bio_X509_AUX +#define PEM_read_bio_X509_CRL GRPC_SHADOW_PEM_read_bio_X509_CRL +#define PEM_read_bio_X509_REQ GRPC_SHADOW_PEM_read_bio_X509_REQ +#define PEM_read_DHparams GRPC_SHADOW_PEM_read_DHparams +#define PEM_read_DSAparams GRPC_SHADOW_PEM_read_DSAparams +#define PEM_read_DSAPrivateKey GRPC_SHADOW_PEM_read_DSAPrivateKey +#define PEM_read_DSA_PUBKEY GRPC_SHADOW_PEM_read_DSA_PUBKEY +#define PEM_read_ECPrivateKey GRPC_SHADOW_PEM_read_ECPrivateKey +#define PEM_read_EC_PUBKEY GRPC_SHADOW_PEM_read_EC_PUBKEY +#define PEM_read_PKCS7 GRPC_SHADOW_PEM_read_PKCS7 +#define PEM_read_PKCS8 GRPC_SHADOW_PEM_read_PKCS8 +#define PEM_read_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_PEM_read_PKCS8_PRIV_KEY_INFO +#define PEM_read_PrivateKey GRPC_SHADOW_PEM_read_PrivateKey +#define PEM_read_PUBKEY GRPC_SHADOW_PEM_read_PUBKEY +#define PEM_read_RSAPrivateKey GRPC_SHADOW_PEM_read_RSAPrivateKey +#define PEM_read_RSA_PUBKEY GRPC_SHADOW_PEM_read_RSA_PUBKEY +#define PEM_read_RSAPublicKey GRPC_SHADOW_PEM_read_RSAPublicKey +#define PEM_read_SSL_SESSION GRPC_SHADOW_PEM_read_SSL_SESSION +#define PEM_read_X509 GRPC_SHADOW_PEM_read_X509 +#define PEM_read_X509_AUX GRPC_SHADOW_PEM_read_X509_AUX +#define PEM_read_X509_CRL GRPC_SHADOW_PEM_read_X509_CRL +#define PEM_read_X509_REQ GRPC_SHADOW_PEM_read_X509_REQ +#define PEM_write GRPC_SHADOW_PEM_write +#define PEM_write_bio GRPC_SHADOW_PEM_write_bio +#define PEM_write_bio_DHparams GRPC_SHADOW_PEM_write_bio_DHparams +#define PEM_write_bio_DSAparams GRPC_SHADOW_PEM_write_bio_DSAparams +#define PEM_write_bio_DSAPrivateKey GRPC_SHADOW_PEM_write_bio_DSAPrivateKey +#define PEM_write_bio_DSA_PUBKEY GRPC_SHADOW_PEM_write_bio_DSA_PUBKEY +#define PEM_write_bio_ECPrivateKey GRPC_SHADOW_PEM_write_bio_ECPrivateKey +#define PEM_write_bio_EC_PUBKEY GRPC_SHADOW_PEM_write_bio_EC_PUBKEY +#define PEM_write_bio_PKCS7 GRPC_SHADOW_PEM_write_bio_PKCS7 +#define PEM_write_bio_PKCS8 GRPC_SHADOW_PEM_write_bio_PKCS8 +#define PEM_write_bio_PKCS8PrivateKey GRPC_SHADOW_PEM_write_bio_PKCS8PrivateKey +#define PEM_write_bio_PKCS8PrivateKey_nid GRPC_SHADOW_PEM_write_bio_PKCS8PrivateKey_nid +#define PEM_write_bio_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_PEM_write_bio_PKCS8_PRIV_KEY_INFO +#define PEM_write_bio_PrivateKey GRPC_SHADOW_PEM_write_bio_PrivateKey +#define PEM_write_bio_PUBKEY GRPC_SHADOW_PEM_write_bio_PUBKEY +#define PEM_write_bio_RSAPrivateKey GRPC_SHADOW_PEM_write_bio_RSAPrivateKey +#define PEM_write_bio_RSA_PUBKEY GRPC_SHADOW_PEM_write_bio_RSA_PUBKEY +#define PEM_write_bio_RSAPublicKey GRPC_SHADOW_PEM_write_bio_RSAPublicKey +#define PEM_write_bio_SSL_SESSION GRPC_SHADOW_PEM_write_bio_SSL_SESSION +#define PEM_write_bio_X509 GRPC_SHADOW_PEM_write_bio_X509 +#define PEM_write_bio_X509_AUX GRPC_SHADOW_PEM_write_bio_X509_AUX +#define PEM_write_bio_X509_CRL GRPC_SHADOW_PEM_write_bio_X509_CRL +#define PEM_write_bio_X509_REQ GRPC_SHADOW_PEM_write_bio_X509_REQ +#define PEM_write_bio_X509_REQ_NEW GRPC_SHADOW_PEM_write_bio_X509_REQ_NEW +#define PEM_write_DHparams GRPC_SHADOW_PEM_write_DHparams +#define PEM_write_DSAparams GRPC_SHADOW_PEM_write_DSAparams +#define PEM_write_DSAPrivateKey GRPC_SHADOW_PEM_write_DSAPrivateKey +#define PEM_write_DSA_PUBKEY GRPC_SHADOW_PEM_write_DSA_PUBKEY +#define PEM_write_ECPrivateKey GRPC_SHADOW_PEM_write_ECPrivateKey +#define PEM_write_EC_PUBKEY GRPC_SHADOW_PEM_write_EC_PUBKEY +#define PEM_write_PKCS7 GRPC_SHADOW_PEM_write_PKCS7 +#define PEM_write_PKCS8 GRPC_SHADOW_PEM_write_PKCS8 +#define PEM_write_PKCS8PrivateKey GRPC_SHADOW_PEM_write_PKCS8PrivateKey +#define PEM_write_PKCS8PrivateKey_nid GRPC_SHADOW_PEM_write_PKCS8PrivateKey_nid +#define PEM_write_PKCS8_PRIV_KEY_INFO GRPC_SHADOW_PEM_write_PKCS8_PRIV_KEY_INFO +#define PEM_write_PrivateKey GRPC_SHADOW_PEM_write_PrivateKey +#define PEM_write_PUBKEY GRPC_SHADOW_PEM_write_PUBKEY +#define PEM_write_RSAPrivateKey GRPC_SHADOW_PEM_write_RSAPrivateKey +#define PEM_write_RSA_PUBKEY GRPC_SHADOW_PEM_write_RSA_PUBKEY +#define PEM_write_RSAPublicKey GRPC_SHADOW_PEM_write_RSAPublicKey +#define PEM_write_SSL_SESSION GRPC_SHADOW_PEM_write_SSL_SESSION +#define PEM_write_X509 GRPC_SHADOW_PEM_write_X509 +#define PEM_write_X509_AUX GRPC_SHADOW_PEM_write_X509_AUX +#define PEM_write_X509_CRL GRPC_SHADOW_PEM_write_X509_CRL +#define PEM_write_X509_REQ GRPC_SHADOW_PEM_write_X509_REQ +#define PEM_write_X509_REQ_NEW GRPC_SHADOW_PEM_write_X509_REQ_NEW +#define PEM_X509_INFO_read GRPC_SHADOW_PEM_X509_INFO_read +#define PEM_X509_INFO_read_bio GRPC_SHADOW_PEM_X509_INFO_read_bio +#define PEM_X509_INFO_write_bio GRPC_SHADOW_PEM_X509_INFO_write_bio +#define PKCS12_create GRPC_SHADOW_PKCS12_create +#define PKCS12_free GRPC_SHADOW_PKCS12_free +#define PKCS12_get_key_and_certs GRPC_SHADOW_PKCS12_get_key_and_certs +#define pkcs12_iterations_acceptable GRPC_SHADOW_pkcs12_iterations_acceptable +#define pkcs12_key_gen GRPC_SHADOW_pkcs12_key_gen +#define PKCS12_parse GRPC_SHADOW_PKCS12_parse +#define PKCS12_PBE_add GRPC_SHADOW_PKCS12_PBE_add +#define pkcs12_pbe_encrypt_init GRPC_SHADOW_pkcs12_pbe_encrypt_init +#define PKCS12_verify_mac GRPC_SHADOW_PKCS12_verify_mac +#define PKCS5_pbe2_decrypt_init GRPC_SHADOW_PKCS5_pbe2_decrypt_init +#define PKCS5_pbe2_encrypt_init GRPC_SHADOW_PKCS5_pbe2_encrypt_init +#define PKCS5_PBKDF2_HMAC GRPC_SHADOW_PKCS5_PBKDF2_HMAC +#define PKCS5_PBKDF2_HMAC_SHA1 GRPC_SHADOW_PKCS5_PBKDF2_HMAC_SHA1 +#define pkcs7_bundle GRPC_SHADOW_pkcs7_bundle +#define PKCS7_bundle_certificates GRPC_SHADOW_PKCS7_bundle_certificates +#define PKCS7_bundle_CRLs GRPC_SHADOW_PKCS7_bundle_CRLs +#define PKCS7_free GRPC_SHADOW_PKCS7_free +#define PKCS7_get_certificates GRPC_SHADOW_PKCS7_get_certificates +#define PKCS7_get_CRLs GRPC_SHADOW_PKCS7_get_CRLs +#define PKCS7_get_PEM_certificates GRPC_SHADOW_PKCS7_get_PEM_certificates +#define PKCS7_get_PEM_CRLs GRPC_SHADOW_PKCS7_get_PEM_CRLs +#define PKCS7_get_raw_certificates GRPC_SHADOW_PKCS7_get_raw_certificates +#define pkcs7_parse_header GRPC_SHADOW_pkcs7_parse_header +#define PKCS7_sign GRPC_SHADOW_PKCS7_sign +#define PKCS7_type_is_data GRPC_SHADOW_PKCS7_type_is_data +#define PKCS7_type_is_digest GRPC_SHADOW_PKCS7_type_is_digest +#define PKCS7_type_is_encrypted GRPC_SHADOW_PKCS7_type_is_encrypted +#define PKCS7_type_is_enveloped GRPC_SHADOW_PKCS7_type_is_enveloped +#define PKCS7_type_is_signed GRPC_SHADOW_PKCS7_type_is_signed +#define PKCS7_type_is_signedAndEnveloped GRPC_SHADOW_PKCS7_type_is_signedAndEnveloped +#define PKCS8_decrypt GRPC_SHADOW_PKCS8_decrypt +#define PKCS8_encrypt GRPC_SHADOW_PKCS8_encrypt +#define PKCS8_marshal_encrypted_private_key GRPC_SHADOW_PKCS8_marshal_encrypted_private_key +#define PKCS8_parse_encrypted_private_key GRPC_SHADOW_PKCS8_parse_encrypted_private_key +#define pkcs8_pbe_decrypt GRPC_SHADOW_pkcs8_pbe_decrypt +#define PKCS8_pkey_get0 GRPC_SHADOW_PKCS8_pkey_get0 +#define PKCS8_pkey_set0 GRPC_SHADOW_PKCS8_pkey_set0 +#define PKCS8_PRIV_KEY_INFO_free GRPC_SHADOW_PKCS8_PRIV_KEY_INFO_free +#define PKCS8_PRIV_KEY_INFO_it GRPC_SHADOW_PKCS8_PRIV_KEY_INFO_it +#define PKCS8_PRIV_KEY_INFO_new GRPC_SHADOW_PKCS8_PRIV_KEY_INFO_new +#define PKEY_USAGE_PERIOD_free GRPC_SHADOW_PKEY_USAGE_PERIOD_free +#define PKEY_USAGE_PERIOD_it GRPC_SHADOW_PKEY_USAGE_PERIOD_it +#define PKEY_USAGE_PERIOD_new GRPC_SHADOW_PKEY_USAGE_PERIOD_new +#define policy_cache_find_data GRPC_SHADOW_policy_cache_find_data +#define policy_cache_free GRPC_SHADOW_policy_cache_free +#define policy_cache_set GRPC_SHADOW_policy_cache_set +#define policy_cache_set_mapping GRPC_SHADOW_policy_cache_set_mapping +#define POLICY_CONSTRAINTS_free GRPC_SHADOW_POLICY_CONSTRAINTS_free +#define POLICY_CONSTRAINTS_it GRPC_SHADOW_POLICY_CONSTRAINTS_it +#define POLICY_CONSTRAINTS_new GRPC_SHADOW_POLICY_CONSTRAINTS_new +#define policy_data_free GRPC_SHADOW_policy_data_free +#define policy_data_new GRPC_SHADOW_policy_data_new +#define POLICYINFO_free GRPC_SHADOW_POLICYINFO_free +#define POLICYINFO_it GRPC_SHADOW_POLICYINFO_it +#define POLICYINFO_new GRPC_SHADOW_POLICYINFO_new +#define POLICY_MAPPING_free GRPC_SHADOW_POLICY_MAPPING_free +#define POLICY_MAPPING_it GRPC_SHADOW_POLICY_MAPPING_it +#define POLICY_MAPPING_new GRPC_SHADOW_POLICY_MAPPING_new +#define POLICY_MAPPINGS_it GRPC_SHADOW_POLICY_MAPPINGS_it +#define policy_node_cmp_new GRPC_SHADOW_policy_node_cmp_new +#define policy_node_free GRPC_SHADOW_policy_node_free +#define policy_node_match GRPC_SHADOW_policy_node_match +#define POLICYQUALINFO_free GRPC_SHADOW_POLICYQUALINFO_free +#define POLICYQUALINFO_it GRPC_SHADOW_POLICYQUALINFO_it +#define POLICYQUALINFO_new GRPC_SHADOW_POLICYQUALINFO_new +#define poly_Rq_mul GRPC_SHADOW_poly_Rq_mul +#define PROXY_CERT_INFO_EXTENSION_free GRPC_SHADOW_PROXY_CERT_INFO_EXTENSION_free +#define PROXY_CERT_INFO_EXTENSION_it GRPC_SHADOW_PROXY_CERT_INFO_EXTENSION_it +#define PROXY_CERT_INFO_EXTENSION_new GRPC_SHADOW_PROXY_CERT_INFO_EXTENSION_new +#define PROXY_POLICY_free GRPC_SHADOW_PROXY_POLICY_free +#define PROXY_POLICY_it GRPC_SHADOW_PROXY_POLICY_it +#define PROXY_POLICY_new GRPC_SHADOW_PROXY_POLICY_new +#define RAND_add GRPC_SHADOW_RAND_add +#define RAND_bytes GRPC_SHADOW_RAND_bytes +#define RAND_bytes_with_additional_data GRPC_SHADOW_RAND_bytes_with_additional_data +#define RAND_cleanup GRPC_SHADOW_RAND_cleanup +#define RAND_egd GRPC_SHADOW_RAND_egd +#define RAND_enable_fork_unsafe_buffering GRPC_SHADOW_RAND_enable_fork_unsafe_buffering +#define RAND_file_name GRPC_SHADOW_RAND_file_name +#define rand_fork_unsafe_buffering_enabled GRPC_SHADOW_rand_fork_unsafe_buffering_enabled +#define RAND_get_rand_method GRPC_SHADOW_RAND_get_rand_method +#define RAND_load_file GRPC_SHADOW_RAND_load_file +#define RAND_poll GRPC_SHADOW_RAND_poll +#define RAND_pseudo_bytes GRPC_SHADOW_RAND_pseudo_bytes +#define RAND_seed GRPC_SHADOW_RAND_seed +#define RAND_set_rand_method GRPC_SHADOW_RAND_set_rand_method +#define RAND_set_urandom_fd GRPC_SHADOW_RAND_set_urandom_fd +#define RAND_SSLeay GRPC_SHADOW_RAND_SSLeay +#define RAND_status GRPC_SHADOW_RAND_status +#define RC4 GRPC_SHADOW_RC4 +#define RC4_set_key GRPC_SHADOW_RC4_set_key +#define RSA_add_pkcs1_prefix GRPC_SHADOW_RSA_add_pkcs1_prefix +#define rsa_asn1_meth GRPC_SHADOW_rsa_asn1_meth +#define RSA_bits GRPC_SHADOW_RSA_bits +#define RSA_blinding_on GRPC_SHADOW_RSA_blinding_on +#define RSA_check_fips GRPC_SHADOW_RSA_check_fips +#define RSA_check_key GRPC_SHADOW_RSA_check_key +#define RSA_decrypt GRPC_SHADOW_RSA_decrypt +#define rsa_default_decrypt GRPC_SHADOW_rsa_default_decrypt +#define RSA_default_method GRPC_SHADOW_RSA_default_method +#define rsa_default_private_transform GRPC_SHADOW_rsa_default_private_transform +#define rsa_default_sign_raw GRPC_SHADOW_rsa_default_sign_raw +#define rsa_default_size GRPC_SHADOW_rsa_default_size +#define RSA_encrypt GRPC_SHADOW_RSA_encrypt +#define RSA_flags GRPC_SHADOW_RSA_flags +#define RSA_free GRPC_SHADOW_RSA_free +#define RSA_generate_key_ex GRPC_SHADOW_RSA_generate_key_ex +#define RSA_generate_key_fips GRPC_SHADOW_RSA_generate_key_fips +#define RSA_get0_crt_params GRPC_SHADOW_RSA_get0_crt_params +#define RSA_get0_factors GRPC_SHADOW_RSA_get0_factors +#define RSA_get0_key GRPC_SHADOW_RSA_get0_key +#define RSA_get_ex_data GRPC_SHADOW_RSA_get_ex_data +#define RSA_get_ex_new_index GRPC_SHADOW_RSA_get_ex_new_index +#define RSA_is_opaque GRPC_SHADOW_RSA_is_opaque +#define RSA_marshal_private_key GRPC_SHADOW_RSA_marshal_private_key +#define RSA_marshal_public_key GRPC_SHADOW_RSA_marshal_public_key +#define RSA_new GRPC_SHADOW_RSA_new +#define RSA_new_method GRPC_SHADOW_RSA_new_method +#define RSA_padding_add_none GRPC_SHADOW_RSA_padding_add_none +#define RSA_padding_add_PKCS1_OAEP_mgf1 GRPC_SHADOW_RSA_padding_add_PKCS1_OAEP_mgf1 +#define RSA_padding_add_PKCS1_PSS_mgf1 GRPC_SHADOW_RSA_padding_add_PKCS1_PSS_mgf1 +#define RSA_padding_add_PKCS1_type_1 GRPC_SHADOW_RSA_padding_add_PKCS1_type_1 +#define RSA_padding_add_PKCS1_type_2 GRPC_SHADOW_RSA_padding_add_PKCS1_type_2 +#define RSA_padding_check_PKCS1_OAEP_mgf1 GRPC_SHADOW_RSA_padding_check_PKCS1_OAEP_mgf1 +#define RSA_padding_check_PKCS1_type_1 GRPC_SHADOW_RSA_padding_check_PKCS1_type_1 +#define RSA_padding_check_PKCS1_type_2 GRPC_SHADOW_RSA_padding_check_PKCS1_type_2 +#define RSA_parse_private_key GRPC_SHADOW_RSA_parse_private_key +#define RSA_parse_public_key GRPC_SHADOW_RSA_parse_public_key +#define rsa_pkey_meth GRPC_SHADOW_rsa_pkey_meth +#define RSA_print GRPC_SHADOW_RSA_print +#define RSA_private_decrypt GRPC_SHADOW_RSA_private_decrypt +#define RSA_private_encrypt GRPC_SHADOW_RSA_private_encrypt +#define RSAPrivateKey_dup GRPC_SHADOW_RSAPrivateKey_dup +#define RSA_private_key_from_bytes GRPC_SHADOW_RSA_private_key_from_bytes +#define RSA_private_key_to_bytes GRPC_SHADOW_RSA_private_key_to_bytes +#define RSA_private_transform GRPC_SHADOW_RSA_private_transform +#define RSA_PSS_PARAMS_free GRPC_SHADOW_RSA_PSS_PARAMS_free +#define RSA_PSS_PARAMS_it GRPC_SHADOW_RSA_PSS_PARAMS_it +#define RSA_PSS_PARAMS_new GRPC_SHADOW_RSA_PSS_PARAMS_new +#define RSA_public_decrypt GRPC_SHADOW_RSA_public_decrypt +#define RSA_public_encrypt GRPC_SHADOW_RSA_public_encrypt +#define RSAPublicKey_dup GRPC_SHADOW_RSAPublicKey_dup +#define RSA_public_key_from_bytes GRPC_SHADOW_RSA_public_key_from_bytes +#define RSA_public_key_to_bytes GRPC_SHADOW_RSA_public_key_to_bytes +#define RSA_set0_crt_params GRPC_SHADOW_RSA_set0_crt_params +#define RSA_set0_factors GRPC_SHADOW_RSA_set0_factors +#define RSA_set0_key GRPC_SHADOW_RSA_set0_key +#define RSA_set_ex_data GRPC_SHADOW_RSA_set_ex_data +#define RSA_sign GRPC_SHADOW_RSA_sign +#define RSA_sign_pss_mgf1 GRPC_SHADOW_RSA_sign_pss_mgf1 +#define RSA_sign_raw GRPC_SHADOW_RSA_sign_raw +#define RSA_size GRPC_SHADOW_RSA_size +#define RSA_up_ref GRPC_SHADOW_RSA_up_ref +#define RSA_verify GRPC_SHADOW_RSA_verify +#define RSA_verify_PKCS1_PSS_mgf1 GRPC_SHADOW_RSA_verify_PKCS1_PSS_mgf1 +#define RSA_verify_pss_mgf1 GRPC_SHADOW_RSA_verify_pss_mgf1 +#define RSA_verify_raw GRPC_SHADOW_RSA_verify_raw +#define rsaz_1024_gather5_avx2 GRPC_SHADOW_rsaz_1024_gather5_avx2 +#define RSAZ_1024_mod_exp_avx2 GRPC_SHADOW_RSAZ_1024_mod_exp_avx2 +#define rsaz_1024_mul_avx2 GRPC_SHADOW_rsaz_1024_mul_avx2 +#define rsaz_1024_norm2red_avx2 GRPC_SHADOW_rsaz_1024_norm2red_avx2 +#define rsaz_1024_red2norm_avx2 GRPC_SHADOW_rsaz_1024_red2norm_avx2 +#define rsaz_1024_scatter5_avx2 GRPC_SHADOW_rsaz_1024_scatter5_avx2 +#define rsaz_1024_sqr_avx2 GRPC_SHADOW_rsaz_1024_sqr_avx2 +#define s2i_ASN1_INTEGER GRPC_SHADOW_s2i_ASN1_INTEGER +#define s2i_ASN1_OCTET_STRING GRPC_SHADOW_s2i_ASN1_OCTET_STRING +#define sdallocx GRPC_SHADOW_sdallocx +#define SHA1 GRPC_SHADOW_SHA1 +#define sha1_block_data_order GRPC_SHADOW_sha1_block_data_order +#define SHA1_Final GRPC_SHADOW_SHA1_Final +#define SHA1_Init GRPC_SHADOW_SHA1_Init +#define SHA1_Transform GRPC_SHADOW_SHA1_Transform +#define SHA1_Update GRPC_SHADOW_SHA1_Update +#define SHA224 GRPC_SHADOW_SHA224 +#define SHA224_Final GRPC_SHADOW_SHA224_Final +#define SHA224_Init GRPC_SHADOW_SHA224_Init +#define SHA224_Update GRPC_SHADOW_SHA224_Update +#define SHA256 GRPC_SHADOW_SHA256 +#define sha256_block_data_order GRPC_SHADOW_sha256_block_data_order +#define SHA256_Final GRPC_SHADOW_SHA256_Final +#define SHA256_Init GRPC_SHADOW_SHA256_Init +#define SHA256_Transform GRPC_SHADOW_SHA256_Transform +#define SHA256_TransformBlocks GRPC_SHADOW_SHA256_TransformBlocks +#define SHA256_Update GRPC_SHADOW_SHA256_Update +#define SHA384 GRPC_SHADOW_SHA384 +#define SHA384_Final GRPC_SHADOW_SHA384_Final +#define SHA384_Init GRPC_SHADOW_SHA384_Init +#define SHA384_Update GRPC_SHADOW_SHA384_Update +#define SHA512 GRPC_SHADOW_SHA512 +#define sha512_block_data_order GRPC_SHADOW_sha512_block_data_order +#define SHA512_Final GRPC_SHADOW_SHA512_Final +#define SHA512_Init GRPC_SHADOW_SHA512_Init +#define SHA512_Transform GRPC_SHADOW_SHA512_Transform +#define SHA512_Update GRPC_SHADOW_SHA512_Update +#define SIPHASH_24 GRPC_SHADOW_SIPHASH_24 +#define sk_CRYPTO_BUFFER_call_copy_func GRPC_SHADOW_sk_CRYPTO_BUFFER_call_copy_func +#define sk_CRYPTO_BUFFER_call_copy_func GRPC_SHADOW_sk_CRYPTO_BUFFER_call_copy_func +#define sk_CRYPTO_BUFFER_call_free_func GRPC_SHADOW_sk_CRYPTO_BUFFER_call_free_func +#define sk_CRYPTO_BUFFER_call_free_func GRPC_SHADOW_sk_CRYPTO_BUFFER_call_free_func +#define sk_CRYPTO_BUFFER_deep_copy GRPC_SHADOW_sk_CRYPTO_BUFFER_deep_copy +#define sk_CRYPTO_BUFFER_deep_copy GRPC_SHADOW_sk_CRYPTO_BUFFER_deep_copy +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_new_null GRPC_SHADOW_sk_CRYPTO_BUFFER_new_null +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_num GRPC_SHADOW_sk_CRYPTO_BUFFER_num +#define sk_CRYPTO_BUFFER_push GRPC_SHADOW_sk_CRYPTO_BUFFER_push +#define sk_CRYPTO_BUFFER_set GRPC_SHADOW_sk_CRYPTO_BUFFER_set +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_CRYPTO_BUFFER_value GRPC_SHADOW_sk_CRYPTO_BUFFER_value +#define sk_deep_copy GRPC_SHADOW_sk_deep_copy +#define sk_delete GRPC_SHADOW_sk_delete +#define sk_delete_ptr GRPC_SHADOW_sk_delete_ptr +#define sk_dup GRPC_SHADOW_sk_dup +#define sk_find GRPC_SHADOW_sk_find +#define sk_free GRPC_SHADOW_sk_free +#define sk_insert GRPC_SHADOW_sk_insert +#define sk_is_sorted GRPC_SHADOW_sk_is_sorted +#define sk_new GRPC_SHADOW_sk_new +#define sk_new_null GRPC_SHADOW_sk_new_null +#define sk_num GRPC_SHADOW_sk_num +#define sk_pop GRPC_SHADOW_sk_pop +#define sk_pop_free GRPC_SHADOW_sk_pop_free +#define sk_pop_free_ex GRPC_SHADOW_sk_pop_free_ex +#define sk_push GRPC_SHADOW_sk_push +#define sk_set GRPC_SHADOW_sk_set +#define sk_set_cmp_func GRPC_SHADOW_sk_set_cmp_func +#define sk_shift GRPC_SHADOW_sk_shift +#define sk_sort GRPC_SHADOW_sk_sort +#define sk_SRTP_PROTECTION_PROFILE_new_null GRPC_SHADOW_sk_SRTP_PROTECTION_PROFILE_new_null +#define sk_SRTP_PROTECTION_PROFILE_num GRPC_SHADOW_sk_SRTP_PROTECTION_PROFILE_num +#define sk_SRTP_PROTECTION_PROFILE_push GRPC_SHADOW_sk_SRTP_PROTECTION_PROFILE_push +#define sk_SSL_CIPHER_call_cmp_func GRPC_SHADOW_sk_SSL_CIPHER_call_cmp_func +#define sk_SSL_CIPHER_call_cmp_func GRPC_SHADOW_sk_SSL_CIPHER_call_cmp_func +#define sk_SSL_CIPHER_call_cmp_func GRPC_SHADOW_sk_SSL_CIPHER_call_cmp_func +#define sk_SSL_CIPHER_call_cmp_func GRPC_SHADOW_sk_SSL_CIPHER_call_cmp_func +#define sk_SSL_CIPHER_delete GRPC_SHADOW_sk_SSL_CIPHER_delete +#define sk_SSL_CIPHER_dup GRPC_SHADOW_sk_SSL_CIPHER_dup +#define sk_SSL_CIPHER_find GRPC_SHADOW_sk_SSL_CIPHER_find +#define sk_SSL_CIPHER_find GRPC_SHADOW_sk_SSL_CIPHER_find +#define sk_SSL_CIPHER_find GRPC_SHADOW_sk_SSL_CIPHER_find +#define sk_SSL_CIPHER_find GRPC_SHADOW_sk_SSL_CIPHER_find +#define sk_SSL_CIPHER_new_null GRPC_SHADOW_sk_SSL_CIPHER_new_null +#define sk_SSL_CIPHER_new_null GRPC_SHADOW_sk_SSL_CIPHER_new_null +#define sk_SSL_CIPHER_new_null GRPC_SHADOW_sk_SSL_CIPHER_new_null +#define sk_SSL_CIPHER_num GRPC_SHADOW_sk_SSL_CIPHER_num +#define sk_SSL_CIPHER_num GRPC_SHADOW_sk_SSL_CIPHER_num +#define sk_SSL_CIPHER_num GRPC_SHADOW_sk_SSL_CIPHER_num +#define sk_SSL_CIPHER_num GRPC_SHADOW_sk_SSL_CIPHER_num +#define sk_SSL_CIPHER_push GRPC_SHADOW_sk_SSL_CIPHER_push +#define sk_SSL_CIPHER_push GRPC_SHADOW_sk_SSL_CIPHER_push +#define sk_SSL_CIPHER_push GRPC_SHADOW_sk_SSL_CIPHER_push +#define sk_SSL_CIPHER_value GRPC_SHADOW_sk_SSL_CIPHER_value +#define sk_SSL_CIPHER_value GRPC_SHADOW_sk_SSL_CIPHER_value +#define sk_value GRPC_SHADOW_sk_value +#define sk_X509_call_free_func GRPC_SHADOW_sk_X509_call_free_func +#define sk_X509_NAME_call_cmp_func GRPC_SHADOW_sk_X509_NAME_call_cmp_func +#define sk_X509_NAME_call_copy_func GRPC_SHADOW_sk_X509_NAME_call_copy_func +#define sk_X509_NAME_call_free_func GRPC_SHADOW_sk_X509_NAME_call_free_func +#define sk_X509_NAME_call_free_func GRPC_SHADOW_sk_X509_NAME_call_free_func +#define sk_X509_NAME_deep_copy GRPC_SHADOW_sk_X509_NAME_deep_copy +#define sk_X509_NAME_find GRPC_SHADOW_sk_X509_NAME_find +#define sk_X509_NAME_free GRPC_SHADOW_sk_X509_NAME_free +#define sk_X509_NAME_new GRPC_SHADOW_sk_X509_NAME_new +#define sk_X509_NAME_new_null GRPC_SHADOW_sk_X509_NAME_new_null +#define sk_X509_NAME_new_null GRPC_SHADOW_sk_X509_NAME_new_null +#define sk_X509_NAME_pop_free GRPC_SHADOW_sk_X509_NAME_pop_free +#define sk_X509_NAME_pop_free GRPC_SHADOW_sk_X509_NAME_pop_free +#define sk_X509_NAME_push GRPC_SHADOW_sk_X509_NAME_push +#define sk_X509_NAME_set_cmp_func GRPC_SHADOW_sk_X509_NAME_set_cmp_func +#define sk_X509_NAME_sort GRPC_SHADOW_sk_X509_NAME_sort +#define sk_X509_new_null GRPC_SHADOW_sk_X509_new_null +#define sk_X509_num GRPC_SHADOW_sk_X509_num +#define sk_X509_pop_free GRPC_SHADOW_sk_X509_pop_free +#define sk_X509_shift GRPC_SHADOW_sk_X509_shift +#define sk_X509_value GRPC_SHADOW_sk_X509_value +#define sk_zero GRPC_SHADOW_sk_zero +#define SPAKE2_CTX_free GRPC_SHADOW_SPAKE2_CTX_free +#define SPAKE2_CTX_new GRPC_SHADOW_SPAKE2_CTX_new +#define SPAKE2_generate_msg GRPC_SHADOW_SPAKE2_generate_msg +#define SPAKE2_process_msg GRPC_SHADOW_SPAKE2_process_msg +#define SSL_accept GRPC_SHADOW_SSL_accept +#define SSL_add0_chain_cert GRPC_SHADOW_SSL_add0_chain_cert +#define SSL_add1_chain_cert GRPC_SHADOW_SSL_add1_chain_cert +#define SSL_add_client_CA GRPC_SHADOW_SSL_add_client_CA +#define SSL_add_file_cert_subjects_to_stack GRPC_SHADOW_SSL_add_file_cert_subjects_to_stack +#define SSL_alert_desc_string GRPC_SHADOW_SSL_alert_desc_string +#define SSL_alert_desc_string_long GRPC_SHADOW_SSL_alert_desc_string_long +#define SSL_alert_from_verify_result GRPC_SHADOW_SSL_alert_from_verify_result +#define SSL_alert_type_string GRPC_SHADOW_SSL_alert_type_string +#define SSL_alert_type_string_long GRPC_SHADOW_SSL_alert_type_string_long +#define SSL_cache_hit GRPC_SHADOW_SSL_cache_hit +#define SSL_certs_clear GRPC_SHADOW_SSL_certs_clear +#define SSL_check_private_key GRPC_SHADOW_SSL_check_private_key +#define SSL_CIPHER_description GRPC_SHADOW_SSL_CIPHER_description +#define SSL_CIPHER_get_auth_nid GRPC_SHADOW_SSL_CIPHER_get_auth_nid +#define SSL_CIPHER_get_bits GRPC_SHADOW_SSL_CIPHER_get_bits +#define SSL_CIPHER_get_cipher_nid GRPC_SHADOW_SSL_CIPHER_get_cipher_nid +#define SSL_CIPHER_get_digest_nid GRPC_SHADOW_SSL_CIPHER_get_digest_nid +#define SSL_CIPHER_get_id GRPC_SHADOW_SSL_CIPHER_get_id +#define SSL_CIPHER_get_kx_name GRPC_SHADOW_SSL_CIPHER_get_kx_name +#define SSL_CIPHER_get_kx_nid GRPC_SHADOW_SSL_CIPHER_get_kx_nid +#define SSL_CIPHER_get_max_version GRPC_SHADOW_SSL_CIPHER_get_max_version +#define SSL_CIPHER_get_min_version GRPC_SHADOW_SSL_CIPHER_get_min_version +#define SSL_CIPHER_get_name GRPC_SHADOW_SSL_CIPHER_get_name +#define SSL_CIPHER_get_prf_nid GRPC_SHADOW_SSL_CIPHER_get_prf_nid +#define SSL_CIPHER_get_rfc_name GRPC_SHADOW_SSL_CIPHER_get_rfc_name +#define SSL_CIPHER_get_value GRPC_SHADOW_SSL_CIPHER_get_value +#define SSL_CIPHER_get_version GRPC_SHADOW_SSL_CIPHER_get_version +#define SSL_CIPHER_is_aead GRPC_SHADOW_SSL_CIPHER_is_aead +#define SSL_CIPHER_is_block_cipher GRPC_SHADOW_SSL_CIPHER_is_block_cipher +#define SSL_CIPHER_standard_name GRPC_SHADOW_SSL_CIPHER_standard_name +#define SSL_clear GRPC_SHADOW_SSL_clear +#define SSL_clear_chain_certs GRPC_SHADOW_SSL_clear_chain_certs +#define SSL_clear_mode GRPC_SHADOW_SSL_clear_mode +#define SSL_clear_options GRPC_SHADOW_SSL_clear_options +#define SSL_COMP_add_compression_method GRPC_SHADOW_SSL_COMP_add_compression_method +#define SSL_COMP_free_compression_methods GRPC_SHADOW_SSL_COMP_free_compression_methods +#define SSL_COMP_get0_name GRPC_SHADOW_SSL_COMP_get0_name +#define SSL_COMP_get_compression_methods GRPC_SHADOW_SSL_COMP_get_compression_methods +#define SSL_COMP_get_id GRPC_SHADOW_SSL_COMP_get_id +#define SSL_COMP_get_name GRPC_SHADOW_SSL_COMP_get_name +#define SSL_connect GRPC_SHADOW_SSL_connect +#define SSL_CTX_add0_chain_cert GRPC_SHADOW_SSL_CTX_add0_chain_cert +#define SSL_CTX_add1_chain_cert GRPC_SHADOW_SSL_CTX_add1_chain_cert +#define SSL_CTX_add_cert_compression_alg GRPC_SHADOW_SSL_CTX_add_cert_compression_alg +#define SSL_CTX_add_client_CA GRPC_SHADOW_SSL_CTX_add_client_CA +#define SSL_CTX_add_extra_chain_cert GRPC_SHADOW_SSL_CTX_add_extra_chain_cert +#define SSL_CTX_add_session GRPC_SHADOW_SSL_CTX_add_session +#define SSL_CTX_check_private_key GRPC_SHADOW_SSL_CTX_check_private_key +#define SSL_CTX_cipher_in_group GRPC_SHADOW_SSL_CTX_cipher_in_group +#define SSL_CTX_clear_chain_certs GRPC_SHADOW_SSL_CTX_clear_chain_certs +#define SSL_CTX_clear_extra_chain_certs GRPC_SHADOW_SSL_CTX_clear_extra_chain_certs +#define SSL_CTX_clear_mode GRPC_SHADOW_SSL_CTX_clear_mode +#define SSL_CTX_clear_options GRPC_SHADOW_SSL_CTX_clear_options +#define SSL_CTX_enable_ocsp_stapling GRPC_SHADOW_SSL_CTX_enable_ocsp_stapling +#define SSL_CTX_enable_signed_cert_timestamps GRPC_SHADOW_SSL_CTX_enable_signed_cert_timestamps +#define SSL_CTX_enable_tls_channel_id GRPC_SHADOW_SSL_CTX_enable_tls_channel_id +#define SSL_CTX_flush_sessions GRPC_SHADOW_SSL_CTX_flush_sessions +#define SSL_CTX_free GRPC_SHADOW_SSL_CTX_free +#define SSL_CTX_get0_certificate GRPC_SHADOW_SSL_CTX_get0_certificate +#define SSL_CTX_get0_chain_certs GRPC_SHADOW_SSL_CTX_get0_chain_certs +#define SSL_CTX_get0_param GRPC_SHADOW_SSL_CTX_get0_param +#define SSL_CTX_get0_privatekey GRPC_SHADOW_SSL_CTX_get0_privatekey +#define SSL_CTX_get_cert_store GRPC_SHADOW_SSL_CTX_get_cert_store +#define SSL_CTX_get_channel_id_cb GRPC_SHADOW_SSL_CTX_get_channel_id_cb +#define SSL_CTX_get_ciphers GRPC_SHADOW_SSL_CTX_get_ciphers +#define SSL_CTX_get_client_CA_list GRPC_SHADOW_SSL_CTX_get_client_CA_list +#define SSL_CTX_get_default_passwd_cb GRPC_SHADOW_SSL_CTX_get_default_passwd_cb +#define SSL_CTX_get_default_passwd_cb_userdata GRPC_SHADOW_SSL_CTX_get_default_passwd_cb_userdata +#define SSL_CTX_get_ex_data GRPC_SHADOW_SSL_CTX_get_ex_data +#define SSL_CTX_get_ex_new_index GRPC_SHADOW_SSL_CTX_get_ex_new_index +#define SSL_CTX_get_extra_chain_certs GRPC_SHADOW_SSL_CTX_get_extra_chain_certs +#define SSL_CTX_get_info_callback GRPC_SHADOW_SSL_CTX_get_info_callback +#define SSL_CTX_get_keylog_callback GRPC_SHADOW_SSL_CTX_get_keylog_callback +#define SSL_CTX_get_max_cert_list GRPC_SHADOW_SSL_CTX_get_max_cert_list +#define SSL_CTX_get_max_proto_version GRPC_SHADOW_SSL_CTX_get_max_proto_version +#define SSL_CTX_get_min_proto_version GRPC_SHADOW_SSL_CTX_get_min_proto_version +#define SSL_CTX_get_mode GRPC_SHADOW_SSL_CTX_get_mode +#define SSL_CTX_get_options GRPC_SHADOW_SSL_CTX_get_options +#define SSL_CTX_get_quiet_shutdown GRPC_SHADOW_SSL_CTX_get_quiet_shutdown +#define SSL_CTX_get_read_ahead GRPC_SHADOW_SSL_CTX_get_read_ahead +#define SSL_CTX_get_session_cache_mode GRPC_SHADOW_SSL_CTX_get_session_cache_mode +#define SSL_CTX_get_timeout GRPC_SHADOW_SSL_CTX_get_timeout +#define SSL_CTX_get_tlsext_ticket_keys GRPC_SHADOW_SSL_CTX_get_tlsext_ticket_keys +#define SSL_CTX_get_verify_callback GRPC_SHADOW_SSL_CTX_get_verify_callback +#define SSL_CTX_get_verify_depth GRPC_SHADOW_SSL_CTX_get_verify_depth +#define SSL_CTX_get_verify_mode GRPC_SHADOW_SSL_CTX_get_verify_mode +#define SSL_CTX_load_verify_locations GRPC_SHADOW_SSL_CTX_load_verify_locations +#define SSL_CTX_need_tmp_RSA GRPC_SHADOW_SSL_CTX_need_tmp_RSA +#define SSL_CTX_new GRPC_SHADOW_SSL_CTX_new +#define SSL_CTX_remove_session GRPC_SHADOW_SSL_CTX_remove_session +#define SSL_CTX_sess_accept GRPC_SHADOW_SSL_CTX_sess_accept +#define SSL_CTX_sess_accept_good GRPC_SHADOW_SSL_CTX_sess_accept_good +#define SSL_CTX_sess_accept_renegotiate GRPC_SHADOW_SSL_CTX_sess_accept_renegotiate +#define SSL_CTX_sess_cache_full GRPC_SHADOW_SSL_CTX_sess_cache_full +#define SSL_CTX_sess_cb_hits GRPC_SHADOW_SSL_CTX_sess_cb_hits +#define SSL_CTX_sess_connect GRPC_SHADOW_SSL_CTX_sess_connect +#define SSL_CTX_sess_connect_good GRPC_SHADOW_SSL_CTX_sess_connect_good +#define SSL_CTX_sess_connect_renegotiate GRPC_SHADOW_SSL_CTX_sess_connect_renegotiate +#define SSL_CTX_sess_get_cache_size GRPC_SHADOW_SSL_CTX_sess_get_cache_size +#define SSL_CTX_sess_get_get_cb GRPC_SHADOW_SSL_CTX_sess_get_get_cb +#define SSL_CTX_sess_get_new_cb GRPC_SHADOW_SSL_CTX_sess_get_new_cb +#define SSL_CTX_sess_get_remove_cb GRPC_SHADOW_SSL_CTX_sess_get_remove_cb +#define SSL_CTX_sess_hits GRPC_SHADOW_SSL_CTX_sess_hits +#define SSL_CTX_sess_misses GRPC_SHADOW_SSL_CTX_sess_misses +#define SSL_CTX_sess_number GRPC_SHADOW_SSL_CTX_sess_number +#define SSL_CTX_sess_set_cache_size GRPC_SHADOW_SSL_CTX_sess_set_cache_size +#define SSL_CTX_sess_set_get_cb GRPC_SHADOW_SSL_CTX_sess_set_get_cb +#define SSL_CTX_sess_set_new_cb GRPC_SHADOW_SSL_CTX_sess_set_new_cb +#define SSL_CTX_sess_set_remove_cb GRPC_SHADOW_SSL_CTX_sess_set_remove_cb +#define SSL_CTX_sess_timeouts GRPC_SHADOW_SSL_CTX_sess_timeouts +#define SSL_CTX_set0_buffer_pool GRPC_SHADOW_SSL_CTX_set0_buffer_pool +#define SSL_CTX_set0_chain GRPC_SHADOW_SSL_CTX_set0_chain +#define SSL_CTX_set0_client_CAs GRPC_SHADOW_SSL_CTX_set0_client_CAs +#define SSL_CTX_set0_verify_cert_store GRPC_SHADOW_SSL_CTX_set0_verify_cert_store +#define SSL_CTX_set1_chain GRPC_SHADOW_SSL_CTX_set1_chain +#define SSL_CTX_set1_curves GRPC_SHADOW_SSL_CTX_set1_curves +#define SSL_CTX_set1_curves_list GRPC_SHADOW_SSL_CTX_set1_curves_list +#define SSL_CTX_set1_param GRPC_SHADOW_SSL_CTX_set1_param +#define SSL_CTX_set1_sigalgs GRPC_SHADOW_SSL_CTX_set1_sigalgs +#define SSL_CTX_set1_sigalgs_list GRPC_SHADOW_SSL_CTX_set1_sigalgs_list +#define SSL_CTX_set1_tls_channel_id GRPC_SHADOW_SSL_CTX_set1_tls_channel_id +#define SSL_CTX_set1_verify_cert_store GRPC_SHADOW_SSL_CTX_set1_verify_cert_store +#define SSL_CTX_set_allow_unknown_alpn_protos GRPC_SHADOW_SSL_CTX_set_allow_unknown_alpn_protos +#define SSL_CTX_set_alpn_protos GRPC_SHADOW_SSL_CTX_set_alpn_protos +#define SSL_CTX_set_alpn_select_cb GRPC_SHADOW_SSL_CTX_set_alpn_select_cb +#define SSL_CTX_set_cert_cb GRPC_SHADOW_SSL_CTX_set_cert_cb +#define SSL_CTX_set_cert_store GRPC_SHADOW_SSL_CTX_set_cert_store +#define SSL_CTX_set_cert_verify_callback GRPC_SHADOW_SSL_CTX_set_cert_verify_callback +#define SSL_CTX_set_chain_and_key GRPC_SHADOW_SSL_CTX_set_chain_and_key +#define SSL_CTX_set_channel_id_cb GRPC_SHADOW_SSL_CTX_set_channel_id_cb +#define SSL_CTX_set_cipher_list GRPC_SHADOW_SSL_CTX_set_cipher_list +#define SSL_CTX_set_client_CA_list GRPC_SHADOW_SSL_CTX_set_client_CA_list +#define SSL_CTX_set_client_cert_cb GRPC_SHADOW_SSL_CTX_set_client_cert_cb +#define SSL_CTX_set_current_time_cb GRPC_SHADOW_SSL_CTX_set_current_time_cb +#define SSL_CTX_set_custom_verify GRPC_SHADOW_SSL_CTX_set_custom_verify +#define SSL_CTX_set_default_passwd_cb GRPC_SHADOW_SSL_CTX_set_default_passwd_cb +#define SSL_CTX_set_default_passwd_cb_userdata GRPC_SHADOW_SSL_CTX_set_default_passwd_cb_userdata +#define SSL_CTX_set_default_verify_paths GRPC_SHADOW_SSL_CTX_set_default_verify_paths +#define SSL_CTX_set_dos_protection_cb GRPC_SHADOW_SSL_CTX_set_dos_protection_cb +#define SSL_CTX_set_early_data_enabled GRPC_SHADOW_SSL_CTX_set_early_data_enabled +#define SSL_CTX_set_ed25519_enabled GRPC_SHADOW_SSL_CTX_set_ed25519_enabled +#define SSL_CTX_set_ex_data GRPC_SHADOW_SSL_CTX_set_ex_data +#define SSL_CTX_set_false_start_allowed_without_alpn GRPC_SHADOW_SSL_CTX_set_false_start_allowed_without_alpn +#define SSL_CTX_set_grease_enabled GRPC_SHADOW_SSL_CTX_set_grease_enabled +#define SSL_CTX_set_ignore_tls13_downgrade GRPC_SHADOW_SSL_CTX_set_ignore_tls13_downgrade +#define SSL_CTX_set_info_callback GRPC_SHADOW_SSL_CTX_set_info_callback +#define SSL_CTX_set_keylog_callback GRPC_SHADOW_SSL_CTX_set_keylog_callback +#define SSL_CTX_set_max_cert_list GRPC_SHADOW_SSL_CTX_set_max_cert_list +#define SSL_CTX_set_max_proto_version GRPC_SHADOW_SSL_CTX_set_max_proto_version +#define SSL_CTX_set_max_send_fragment GRPC_SHADOW_SSL_CTX_set_max_send_fragment +#define SSL_CTX_set_min_proto_version GRPC_SHADOW_SSL_CTX_set_min_proto_version +#define SSL_CTX_set_mode GRPC_SHADOW_SSL_CTX_set_mode +#define SSL_CTX_set_msg_callback GRPC_SHADOW_SSL_CTX_set_msg_callback +#define SSL_CTX_set_msg_callback_arg GRPC_SHADOW_SSL_CTX_set_msg_callback_arg +#define SSL_CTX_set_next_protos_advertised_cb GRPC_SHADOW_SSL_CTX_set_next_protos_advertised_cb +#define SSL_CTX_set_next_proto_select_cb GRPC_SHADOW_SSL_CTX_set_next_proto_select_cb +#define SSL_CTX_set_ocsp_response GRPC_SHADOW_SSL_CTX_set_ocsp_response +#define SSL_CTX_set_options GRPC_SHADOW_SSL_CTX_set_options +#define SSL_CTX_set_private_key_method GRPC_SHADOW_SSL_CTX_set_private_key_method +#define SSL_CTX_set_psk_client_callback GRPC_SHADOW_SSL_CTX_set_psk_client_callback +#define SSL_CTX_set_psk_server_callback GRPC_SHADOW_SSL_CTX_set_psk_server_callback +#define SSL_CTX_set_purpose GRPC_SHADOW_SSL_CTX_set_purpose +#define SSL_CTX_set_quic_method GRPC_SHADOW_SSL_CTX_set_quic_method +#define SSL_CTX_set_quiet_shutdown GRPC_SHADOW_SSL_CTX_set_quiet_shutdown +#define SSL_CTX_set_read_ahead GRPC_SHADOW_SSL_CTX_set_read_ahead +#define SSL_CTX_set_retain_only_sha256_of_client_certs GRPC_SHADOW_SSL_CTX_set_retain_only_sha256_of_client_certs +#define SSL_CTX_set_reverify_on_resume GRPC_SHADOW_SSL_CTX_set_reverify_on_resume +#define SSL_CTX_set_select_certificate_cb GRPC_SHADOW_SSL_CTX_set_select_certificate_cb +#define SSL_CTX_set_session_cache_mode GRPC_SHADOW_SSL_CTX_set_session_cache_mode +#define SSL_CTX_set_session_id_context GRPC_SHADOW_SSL_CTX_set_session_id_context +#define SSL_CTX_set_session_psk_dhe_timeout GRPC_SHADOW_SSL_CTX_set_session_psk_dhe_timeout +#define SSL_CTX_set_signed_cert_timestamp_list GRPC_SHADOW_SSL_CTX_set_signed_cert_timestamp_list +#define SSL_CTX_set_signing_algorithm_prefs GRPC_SHADOW_SSL_CTX_set_signing_algorithm_prefs +#define SSL_CTX_set_srtp_profiles GRPC_SHADOW_SSL_CTX_set_srtp_profiles +#define SSL_CTX_set_strict_cipher_list GRPC_SHADOW_SSL_CTX_set_strict_cipher_list +#define SSL_CTX_set_ticket_aead_method GRPC_SHADOW_SSL_CTX_set_ticket_aead_method +#define SSL_CTX_set_timeout GRPC_SHADOW_SSL_CTX_set_timeout +#define SSL_CTX_set_tls_channel_id_enabled GRPC_SHADOW_SSL_CTX_set_tls_channel_id_enabled +#define SSL_CTX_set_tlsext_servername_arg GRPC_SHADOW_SSL_CTX_set_tlsext_servername_arg +#define SSL_CTX_set_tlsext_servername_callback GRPC_SHADOW_SSL_CTX_set_tlsext_servername_callback +#define SSL_CTX_set_tlsext_status_arg GRPC_SHADOW_SSL_CTX_set_tlsext_status_arg +#define SSL_CTX_set_tlsext_status_cb GRPC_SHADOW_SSL_CTX_set_tlsext_status_cb +#define SSL_CTX_set_tlsext_ticket_key_cb GRPC_SHADOW_SSL_CTX_set_tlsext_ticket_key_cb +#define SSL_CTX_set_tlsext_ticket_keys GRPC_SHADOW_SSL_CTX_set_tlsext_ticket_keys +#define SSL_CTX_set_tlsext_use_srtp GRPC_SHADOW_SSL_CTX_set_tlsext_use_srtp +#define SSL_CTX_set_tmp_dh GRPC_SHADOW_SSL_CTX_set_tmp_dh +#define SSL_CTX_set_tmp_dh_callback GRPC_SHADOW_SSL_CTX_set_tmp_dh_callback +#define SSL_CTX_set_tmp_ecdh GRPC_SHADOW_SSL_CTX_set_tmp_ecdh +#define SSL_CTX_set_tmp_rsa GRPC_SHADOW_SSL_CTX_set_tmp_rsa +#define SSL_CTX_set_tmp_rsa_callback GRPC_SHADOW_SSL_CTX_set_tmp_rsa_callback +#define SSL_CTX_set_trust GRPC_SHADOW_SSL_CTX_set_trust +#define SSL_CTX_set_verify GRPC_SHADOW_SSL_CTX_set_verify +#define SSL_CTX_set_verify_algorithm_prefs GRPC_SHADOW_SSL_CTX_set_verify_algorithm_prefs +#define SSL_CTX_set_verify_depth GRPC_SHADOW_SSL_CTX_set_verify_depth +#define SSL_CTX_up_ref GRPC_SHADOW_SSL_CTX_up_ref +#define SSL_CTX_use_certificate GRPC_SHADOW_SSL_CTX_use_certificate +#define SSL_CTX_use_certificate_ASN1 GRPC_SHADOW_SSL_CTX_use_certificate_ASN1 +#define SSL_CTX_use_certificate_chain_file GRPC_SHADOW_SSL_CTX_use_certificate_chain_file +#define SSL_CTX_use_certificate_file GRPC_SHADOW_SSL_CTX_use_certificate_file +#define SSL_CTX_use_PrivateKey GRPC_SHADOW_SSL_CTX_use_PrivateKey +#define SSL_CTX_use_PrivateKey_ASN1 GRPC_SHADOW_SSL_CTX_use_PrivateKey_ASN1 +#define SSL_CTX_use_PrivateKey_file GRPC_SHADOW_SSL_CTX_use_PrivateKey_file +#define SSL_CTX_use_psk_identity_hint GRPC_SHADOW_SSL_CTX_use_psk_identity_hint +#define SSL_CTX_use_RSAPrivateKey GRPC_SHADOW_SSL_CTX_use_RSAPrivateKey +#define SSL_CTX_use_RSAPrivateKey_ASN1 GRPC_SHADOW_SSL_CTX_use_RSAPrivateKey_ASN1 +#define SSL_CTX_use_RSAPrivateKey_file GRPC_SHADOW_SSL_CTX_use_RSAPrivateKey_file +#define SSL_cutthrough_complete GRPC_SHADOW_SSL_cutthrough_complete +#define SSL_delegated_credential_used GRPC_SHADOW_SSL_delegated_credential_used +#define SSL_do_handshake GRPC_SHADOW_SSL_do_handshake +#define SSL_dup_CA_list GRPC_SHADOW_SSL_dup_CA_list +#define SSL_early_callback_ctx_extension_get GRPC_SHADOW_SSL_early_callback_ctx_extension_get +#define SSL_early_data_accepted GRPC_SHADOW_SSL_early_data_accepted +#define SSLeay GRPC_SHADOW_SSLeay +#define SSLeay_version GRPC_SHADOW_SSLeay_version +#define SSL_enable_ocsp_stapling GRPC_SHADOW_SSL_enable_ocsp_stapling +#define SSL_enable_signed_cert_timestamps GRPC_SHADOW_SSL_enable_signed_cert_timestamps +#define SSL_enable_tls_channel_id GRPC_SHADOW_SSL_enable_tls_channel_id +#define SSL_error_description GRPC_SHADOW_SSL_error_description +#define SSL_export_keying_material GRPC_SHADOW_SSL_export_keying_material +#define SSL_free GRPC_SHADOW_SSL_free +#define SSL_generate_key_block GRPC_SHADOW_SSL_generate_key_block +#define SSL_get0_alpn_selected GRPC_SHADOW_SSL_get0_alpn_selected +#define SSL_get0_certificate_types GRPC_SHADOW_SSL_get0_certificate_types +#define SSL_get0_chain_certs GRPC_SHADOW_SSL_get0_chain_certs +#define SSL_get0_next_proto_negotiated GRPC_SHADOW_SSL_get0_next_proto_negotiated +#define SSL_get0_ocsp_response GRPC_SHADOW_SSL_get0_ocsp_response +#define SSL_get0_param GRPC_SHADOW_SSL_get0_param +#define SSL_get0_peer_certificates GRPC_SHADOW_SSL_get0_peer_certificates +#define SSL_get0_peer_verify_algorithms GRPC_SHADOW_SSL_get0_peer_verify_algorithms +#define SSL_get0_server_requested_CAs GRPC_SHADOW_SSL_get0_server_requested_CAs +#define SSL_get0_session_id_context GRPC_SHADOW_SSL_get0_session_id_context +#define SSL_get0_signed_cert_timestamp_list GRPC_SHADOW_SSL_get0_signed_cert_timestamp_list +#define SSL_get1_session GRPC_SHADOW_SSL_get1_session +#define SSL_get_certificate GRPC_SHADOW_SSL_get_certificate +#define SSL_get_cipher_by_value GRPC_SHADOW_SSL_get_cipher_by_value +#define SSL_get_cipher_list GRPC_SHADOW_SSL_get_cipher_list +#define SSL_get_ciphers GRPC_SHADOW_SSL_get_ciphers +#define SSL_get_client_CA_list GRPC_SHADOW_SSL_get_client_CA_list +#define SSL_get_client_random GRPC_SHADOW_SSL_get_client_random +#define SSL_get_current_cipher GRPC_SHADOW_SSL_get_current_cipher +#define SSL_get_current_compression GRPC_SHADOW_SSL_get_current_compression +#define SSL_get_current_expansion GRPC_SHADOW_SSL_get_current_expansion +#define SSL_get_curve_id GRPC_SHADOW_SSL_get_curve_id +#define SSL_get_curve_name GRPC_SHADOW_SSL_get_curve_name +#define SSL_get_default_timeout GRPC_SHADOW_SSL_get_default_timeout +#define SSL_get_early_data_reason GRPC_SHADOW_SSL_get_early_data_reason +#define SSL_get_error GRPC_SHADOW_SSL_get_error +#define SSL_get_ex_data GRPC_SHADOW_SSL_get_ex_data +#define SSL_get_ex_data_X509_STORE_CTX_idx GRPC_SHADOW_SSL_get_ex_data_X509_STORE_CTX_idx +#define SSL_get_ex_new_index GRPC_SHADOW_SSL_get_ex_new_index +#define SSL_get_extms_support GRPC_SHADOW_SSL_get_extms_support +#define SSL_get_fd GRPC_SHADOW_SSL_get_fd +#define SSL_get_finished GRPC_SHADOW_SSL_get_finished +#define SSL_get_info_callback GRPC_SHADOW_SSL_get_info_callback +#define SSL_get_ivs GRPC_SHADOW_SSL_get_ivs +#define SSL_get_key_block_len GRPC_SHADOW_SSL_get_key_block_len +#define SSL_get_max_cert_list GRPC_SHADOW_SSL_get_max_cert_list +#define SSL_get_max_proto_version GRPC_SHADOW_SSL_get_max_proto_version +#define SSL_get_min_proto_version GRPC_SHADOW_SSL_get_min_proto_version +#define SSL_get_mode GRPC_SHADOW_SSL_get_mode +#define SSL_get_negotiated_token_binding_param GRPC_SHADOW_SSL_get_negotiated_token_binding_param +#define SSL_get_options GRPC_SHADOW_SSL_get_options +#define SSL_get_peer_cert_chain GRPC_SHADOW_SSL_get_peer_cert_chain +#define SSL_get_peer_certificate GRPC_SHADOW_SSL_get_peer_certificate +#define SSL_get_peer_finished GRPC_SHADOW_SSL_get_peer_finished +#define SSL_get_peer_full_cert_chain GRPC_SHADOW_SSL_get_peer_full_cert_chain +#define SSL_get_peer_quic_transport_params GRPC_SHADOW_SSL_get_peer_quic_transport_params +#define SSL_get_peer_signature_algorithm GRPC_SHADOW_SSL_get_peer_signature_algorithm +#define SSL_get_pending_cipher GRPC_SHADOW_SSL_get_pending_cipher +#define SSL_get_privatekey GRPC_SHADOW_SSL_get_privatekey +#define SSL_get_psk_identity GRPC_SHADOW_SSL_get_psk_identity +#define SSL_get_psk_identity_hint GRPC_SHADOW_SSL_get_psk_identity_hint +#define SSL_get_quiet_shutdown GRPC_SHADOW_SSL_get_quiet_shutdown +#define SSL_get_rbio GRPC_SHADOW_SSL_get_rbio +#define SSL_get_read_ahead GRPC_SHADOW_SSL_get_read_ahead +#define SSL_get_read_sequence GRPC_SHADOW_SSL_get_read_sequence +#define SSL_get_rfd GRPC_SHADOW_SSL_get_rfd +#define SSL_get_secure_renegotiation_support GRPC_SHADOW_SSL_get_secure_renegotiation_support +#define SSL_get_selected_srtp_profile GRPC_SHADOW_SSL_get_selected_srtp_profile +#define SSL_get_servername GRPC_SHADOW_SSL_get_servername +#define SSL_get_servername_type GRPC_SHADOW_SSL_get_servername_type +#define SSL_get_server_random GRPC_SHADOW_SSL_get_server_random +#define SSL_get_server_tmp_key GRPC_SHADOW_SSL_get_server_tmp_key +#define SSL_get_session GRPC_SHADOW_SSL_get_session +#define SSL_get_shared_ciphers GRPC_SHADOW_SSL_get_shared_ciphers +#define SSL_get_shared_sigalgs GRPC_SHADOW_SSL_get_shared_sigalgs +#define SSL_get_shutdown GRPC_SHADOW_SSL_get_shutdown +#define SSL_get_signature_algorithm_digest GRPC_SHADOW_SSL_get_signature_algorithm_digest +#define SSL_get_signature_algorithm_key_type GRPC_SHADOW_SSL_get_signature_algorithm_key_type +#define SSL_get_signature_algorithm_name GRPC_SHADOW_SSL_get_signature_algorithm_name +#define SSL_get_srtp_profiles GRPC_SHADOW_SSL_get_srtp_profiles +#define SSL_get_SSL_CTX GRPC_SHADOW_SSL_get_SSL_CTX +#define SSL_get_ticket_age_skew GRPC_SHADOW_SSL_get_ticket_age_skew +#define SSL_get_tls_channel_id GRPC_SHADOW_SSL_get_tls_channel_id +#define SSL_get_tlsext_status_ocsp_resp GRPC_SHADOW_SSL_get_tlsext_status_ocsp_resp +#define SSL_get_tlsext_status_type GRPC_SHADOW_SSL_get_tlsext_status_type +#define SSL_get_tls_unique GRPC_SHADOW_SSL_get_tls_unique +#define SSL_get_verify_callback GRPC_SHADOW_SSL_get_verify_callback +#define SSL_get_verify_depth GRPC_SHADOW_SSL_get_verify_depth +#define SSL_get_verify_mode GRPC_SHADOW_SSL_get_verify_mode +#define SSL_get_verify_result GRPC_SHADOW_SSL_get_verify_result +#define SSL_get_version GRPC_SHADOW_SSL_get_version +#define SSL_get_wbio GRPC_SHADOW_SSL_get_wbio +#define SSL_get_wfd GRPC_SHADOW_SSL_get_wfd +#define SSL_get_write_sequence GRPC_SHADOW_SSL_get_write_sequence +#define SSL_in_early_data GRPC_SHADOW_SSL_in_early_data +#define SSL_in_false_start GRPC_SHADOW_SSL_in_false_start +#define SSL_in_init GRPC_SHADOW_SSL_in_init +#define SSL_is_dtls GRPC_SHADOW_SSL_is_dtls +#define SSL_is_init_finished GRPC_SHADOW_SSL_is_init_finished +#define SSL_is_server GRPC_SHADOW_SSL_is_server +#define SSL_is_signature_algorithm_rsa_pss GRPC_SHADOW_SSL_is_signature_algorithm_rsa_pss +#define SSL_is_tls13_downgrade GRPC_SHADOW_SSL_is_tls13_downgrade +#define SSL_is_token_binding_negotiated GRPC_SHADOW_SSL_is_token_binding_negotiated +#define SSL_key_update GRPC_SHADOW_SSL_key_update +#define SSL_library_init GRPC_SHADOW_SSL_library_init +#define SSL_load_client_CA_file GRPC_SHADOW_SSL_load_client_CA_file +#define SSL_load_error_strings GRPC_SHADOW_SSL_load_error_strings +#define SSL_magic_pending_session_ptr GRPC_SHADOW_SSL_magic_pending_session_ptr +#define SSL_max_seal_overhead GRPC_SHADOW_SSL_max_seal_overhead +#define SSL_need_tmp_RSA GRPC_SHADOW_SSL_need_tmp_RSA +#define SSL_new GRPC_SHADOW_SSL_new +#define SSL_num_renegotiations GRPC_SHADOW_SSL_num_renegotiations +#define SSL_peek GRPC_SHADOW_SSL_peek +#define SSL_pending GRPC_SHADOW_SSL_pending +#define SSL_process_quic_post_handshake GRPC_SHADOW_SSL_process_quic_post_handshake +#define SSL_provide_quic_data GRPC_SHADOW_SSL_provide_quic_data +#define SSL_quic_max_handshake_flight_len GRPC_SHADOW_SSL_quic_max_handshake_flight_len +#define SSL_quic_read_level GRPC_SHADOW_SSL_quic_read_level +#define SSL_quic_write_level GRPC_SHADOW_SSL_quic_write_level +#define SSL_read GRPC_SHADOW_SSL_read +#define SSL_renegotiate GRPC_SHADOW_SSL_renegotiate +#define SSL_renegotiate_pending GRPC_SHADOW_SSL_renegotiate_pending +#define SSL_reset_early_data_reject GRPC_SHADOW_SSL_reset_early_data_reject +#define SSL_select_next_proto GRPC_SHADOW_SSL_select_next_proto +#define SSL_send_fatal_alert GRPC_SHADOW_SSL_send_fatal_alert +#define SSL_SESSION_early_data_capable GRPC_SHADOW_SSL_SESSION_early_data_capable +#define SSL_SESSION_free GRPC_SHADOW_SSL_SESSION_free +#define SSL_SESSION_from_bytes GRPC_SHADOW_SSL_SESSION_from_bytes +#define SSL_SESSION_get0_cipher GRPC_SHADOW_SSL_SESSION_get0_cipher +#define SSL_SESSION_get0_id_context GRPC_SHADOW_SSL_SESSION_get0_id_context +#define SSL_SESSION_get0_ocsp_response GRPC_SHADOW_SSL_SESSION_get0_ocsp_response +#define SSL_SESSION_get0_peer GRPC_SHADOW_SSL_SESSION_get0_peer +#define SSL_SESSION_get0_peer_certificates GRPC_SHADOW_SSL_SESSION_get0_peer_certificates +#define SSL_SESSION_get0_peer_sha256 GRPC_SHADOW_SSL_SESSION_get0_peer_sha256 +#define SSL_SESSION_get0_signed_cert_timestamp_list GRPC_SHADOW_SSL_SESSION_get0_signed_cert_timestamp_list +#define SSL_SESSION_get0_ticket GRPC_SHADOW_SSL_SESSION_get0_ticket +#define SSL_SESSION_get_ex_data GRPC_SHADOW_SSL_SESSION_get_ex_data +#define SSL_SESSION_get_ex_new_index GRPC_SHADOW_SSL_SESSION_get_ex_new_index +#define SSL_SESSION_get_id GRPC_SHADOW_SSL_SESSION_get_id +#define SSL_SESSION_get_master_key GRPC_SHADOW_SSL_SESSION_get_master_key +#define SSL_SESSION_get_protocol_version GRPC_SHADOW_SSL_SESSION_get_protocol_version +#define SSL_SESSION_get_ticket_lifetime_hint GRPC_SHADOW_SSL_SESSION_get_ticket_lifetime_hint +#define SSL_SESSION_get_time GRPC_SHADOW_SSL_SESSION_get_time +#define SSL_SESSION_get_timeout GRPC_SHADOW_SSL_SESSION_get_timeout +#define SSL_SESSION_get_version GRPC_SHADOW_SSL_SESSION_get_version +#define SSL_SESSION_has_peer_sha256 GRPC_SHADOW_SSL_SESSION_has_peer_sha256 +#define SSL_SESSION_has_ticket GRPC_SHADOW_SSL_SESSION_has_ticket +#define SSL_SESSION_is_resumable GRPC_SHADOW_SSL_SESSION_is_resumable +#define SSL_SESSION_new GRPC_SHADOW_SSL_SESSION_new +#define SSL_session_reused GRPC_SHADOW_SSL_session_reused +#define SSL_SESSION_set1_id GRPC_SHADOW_SSL_SESSION_set1_id +#define SSL_SESSION_set1_id_context GRPC_SHADOW_SSL_SESSION_set1_id_context +#define SSL_SESSION_set_ex_data GRPC_SHADOW_SSL_SESSION_set_ex_data +#define SSL_SESSION_set_protocol_version GRPC_SHADOW_SSL_SESSION_set_protocol_version +#define SSL_SESSION_set_ticket GRPC_SHADOW_SSL_SESSION_set_ticket +#define SSL_SESSION_set_time GRPC_SHADOW_SSL_SESSION_set_time +#define SSL_SESSION_set_timeout GRPC_SHADOW_SSL_SESSION_set_timeout +#define SSL_SESSION_should_be_single_use GRPC_SHADOW_SSL_SESSION_should_be_single_use +#define SSL_SESSION_to_bytes GRPC_SHADOW_SSL_SESSION_to_bytes +#define SSL_SESSION_to_bytes_for_ticket GRPC_SHADOW_SSL_SESSION_to_bytes_for_ticket +#define SSL_SESSION_up_ref GRPC_SHADOW_SSL_SESSION_up_ref +#define SSL_set0_chain GRPC_SHADOW_SSL_set0_chain +#define SSL_set0_client_CAs GRPC_SHADOW_SSL_set0_client_CAs +#define SSL_set0_rbio GRPC_SHADOW_SSL_set0_rbio +#define SSL_set0_verify_cert_store GRPC_SHADOW_SSL_set0_verify_cert_store +#define SSL_set0_wbio GRPC_SHADOW_SSL_set0_wbio +#define SSL_set1_chain GRPC_SHADOW_SSL_set1_chain +#define SSL_set1_curves GRPC_SHADOW_SSL_set1_curves +#define SSL_set1_curves_list GRPC_SHADOW_SSL_set1_curves_list +#define SSL_set1_delegated_credential GRPC_SHADOW_SSL_set1_delegated_credential +#define SSL_set1_param GRPC_SHADOW_SSL_set1_param +#define SSL_set1_sigalgs GRPC_SHADOW_SSL_set1_sigalgs +#define SSL_set1_sigalgs_list GRPC_SHADOW_SSL_set1_sigalgs_list +#define SSL_set1_tls_channel_id GRPC_SHADOW_SSL_set1_tls_channel_id +#define SSL_set1_verify_cert_store GRPC_SHADOW_SSL_set1_verify_cert_store +#define SSL_set_accept_state GRPC_SHADOW_SSL_set_accept_state +#define SSL_set_alpn_protos GRPC_SHADOW_SSL_set_alpn_protos +#define SSL_set_bio GRPC_SHADOW_SSL_set_bio +#define SSL_set_cert_cb GRPC_SHADOW_SSL_set_cert_cb +#define SSL_set_chain_and_key GRPC_SHADOW_SSL_set_chain_and_key +#define SSL_set_cipher_list GRPC_SHADOW_SSL_set_cipher_list +#define SSL_set_client_CA_list GRPC_SHADOW_SSL_set_client_CA_list +#define SSL_set_connect_state GRPC_SHADOW_SSL_set_connect_state +#define SSL_set_custom_verify GRPC_SHADOW_SSL_set_custom_verify +#define SSL_set_early_data_enabled GRPC_SHADOW_SSL_set_early_data_enabled +#define SSL_set_enforce_rsa_key_usage GRPC_SHADOW_SSL_set_enforce_rsa_key_usage +#define SSL_set_ex_data GRPC_SHADOW_SSL_set_ex_data +#define SSL_set_fd GRPC_SHADOW_SSL_set_fd +#define SSL_set_ignore_tls13_downgrade GRPC_SHADOW_SSL_set_ignore_tls13_downgrade +#define SSL_set_info_callback GRPC_SHADOW_SSL_set_info_callback +#define SSL_set_jdk11_workaround GRPC_SHADOW_SSL_set_jdk11_workaround +#define SSL_set_max_cert_list GRPC_SHADOW_SSL_set_max_cert_list +#define SSL_set_max_proto_version GRPC_SHADOW_SSL_set_max_proto_version +#define SSL_set_max_send_fragment GRPC_SHADOW_SSL_set_max_send_fragment +#define SSL_set_min_proto_version GRPC_SHADOW_SSL_set_min_proto_version +#define SSL_set_mode GRPC_SHADOW_SSL_set_mode +#define SSL_set_msg_callback GRPC_SHADOW_SSL_set_msg_callback +#define SSL_set_msg_callback_arg GRPC_SHADOW_SSL_set_msg_callback_arg +#define SSL_set_mtu GRPC_SHADOW_SSL_set_mtu +#define SSL_set_ocsp_response GRPC_SHADOW_SSL_set_ocsp_response +#define SSL_set_options GRPC_SHADOW_SSL_set_options +#define SSL_set_private_key_method GRPC_SHADOW_SSL_set_private_key_method +#define SSL_set_psk_client_callback GRPC_SHADOW_SSL_set_psk_client_callback +#define SSL_set_psk_server_callback GRPC_SHADOW_SSL_set_psk_server_callback +#define SSL_set_purpose GRPC_SHADOW_SSL_set_purpose +#define SSL_set_quic_method GRPC_SHADOW_SSL_set_quic_method +#define SSL_set_quic_transport_params GRPC_SHADOW_SSL_set_quic_transport_params +#define SSL_set_quiet_shutdown GRPC_SHADOW_SSL_set_quiet_shutdown +#define SSL_set_read_ahead GRPC_SHADOW_SSL_set_read_ahead +#define SSL_set_renegotiate_mode GRPC_SHADOW_SSL_set_renegotiate_mode +#define SSL_set_retain_only_sha256_of_client_certs GRPC_SHADOW_SSL_set_retain_only_sha256_of_client_certs +#define SSL_set_rfd GRPC_SHADOW_SSL_set_rfd +#define SSL_set_session GRPC_SHADOW_SSL_set_session +#define SSL_set_session_id_context GRPC_SHADOW_SSL_set_session_id_context +#define SSL_set_shed_handshake_config GRPC_SHADOW_SSL_set_shed_handshake_config +#define SSL_set_shutdown GRPC_SHADOW_SSL_set_shutdown +#define SSL_set_signed_cert_timestamp_list GRPC_SHADOW_SSL_set_signed_cert_timestamp_list +#define SSL_set_signing_algorithm_prefs GRPC_SHADOW_SSL_set_signing_algorithm_prefs +#define SSL_set_srtp_profiles GRPC_SHADOW_SSL_set_srtp_profiles +#define SSL_set_SSL_CTX GRPC_SHADOW_SSL_set_SSL_CTX +#define SSL_set_state GRPC_SHADOW_SSL_set_state +#define SSL_set_strict_cipher_list GRPC_SHADOW_SSL_set_strict_cipher_list +#define SSL_set_tls_channel_id_enabled GRPC_SHADOW_SSL_set_tls_channel_id_enabled +#define SSL_set_tlsext_host_name GRPC_SHADOW_SSL_set_tlsext_host_name +#define SSL_set_tlsext_status_ocsp_resp GRPC_SHADOW_SSL_set_tlsext_status_ocsp_resp +#define SSL_set_tlsext_status_type GRPC_SHADOW_SSL_set_tlsext_status_type +#define SSL_set_tlsext_use_srtp GRPC_SHADOW_SSL_set_tlsext_use_srtp +#define SSL_set_tmp_dh GRPC_SHADOW_SSL_set_tmp_dh +#define SSL_set_tmp_dh_callback GRPC_SHADOW_SSL_set_tmp_dh_callback +#define SSL_set_tmp_ecdh GRPC_SHADOW_SSL_set_tmp_ecdh +#define SSL_set_tmp_rsa GRPC_SHADOW_SSL_set_tmp_rsa +#define SSL_set_tmp_rsa_callback GRPC_SHADOW_SSL_set_tmp_rsa_callback +#define SSL_set_token_binding_params GRPC_SHADOW_SSL_set_token_binding_params +#define SSL_set_trust GRPC_SHADOW_SSL_set_trust +#define SSL_set_verify GRPC_SHADOW_SSL_set_verify +#define SSL_set_verify_depth GRPC_SHADOW_SSL_set_verify_depth +#define SSL_set_verify_result GRPC_SHADOW_SSL_set_verify_result +#define SSL_set_wfd GRPC_SHADOW_SSL_set_wfd +#define SSL_shutdown GRPC_SHADOW_SSL_shutdown +#define SSL_state GRPC_SHADOW_SSL_state +#define SSL_state_string GRPC_SHADOW_SSL_state_string +#define SSL_state_string_long GRPC_SHADOW_SSL_state_string_long +#define SSL_total_renegotiations GRPC_SHADOW_SSL_total_renegotiations +#define SSL_use_certificate GRPC_SHADOW_SSL_use_certificate +#define SSL_use_certificate_ASN1 GRPC_SHADOW_SSL_use_certificate_ASN1 +#define SSL_use_certificate_file GRPC_SHADOW_SSL_use_certificate_file +#define SSL_used_hello_retry_request GRPC_SHADOW_SSL_used_hello_retry_request +#define SSL_use_PrivateKey GRPC_SHADOW_SSL_use_PrivateKey +#define SSL_use_PrivateKey_ASN1 GRPC_SHADOW_SSL_use_PrivateKey_ASN1 +#define SSL_use_PrivateKey_file GRPC_SHADOW_SSL_use_PrivateKey_file +#define SSL_use_psk_identity_hint GRPC_SHADOW_SSL_use_psk_identity_hint +#define SSL_use_RSAPrivateKey GRPC_SHADOW_SSL_use_RSAPrivateKey +#define SSL_use_RSAPrivateKey_ASN1 GRPC_SHADOW_SSL_use_RSAPrivateKey_ASN1 +#define SSL_use_RSAPrivateKey_file GRPC_SHADOW_SSL_use_RSAPrivateKey_file +#define SSLv23_client_method GRPC_SHADOW_SSLv23_client_method +#define SSLv23_method GRPC_SHADOW_SSLv23_method +#define SSLv23_server_method GRPC_SHADOW_SSLv23_server_method +#define SSL_version GRPC_SHADOW_SSL_version +#define SSL_want GRPC_SHADOW_SSL_want +#define SSL_write GRPC_SHADOW_SSL_write +#define SXNET_add_id_asc GRPC_SHADOW_SXNET_add_id_asc +#define SXNET_add_id_INTEGER GRPC_SHADOW_SXNET_add_id_INTEGER +#define SXNET_add_id_ulong GRPC_SHADOW_SXNET_add_id_ulong +#define SXNET_free GRPC_SHADOW_SXNET_free +#define SXNET_get_id_asc GRPC_SHADOW_SXNET_get_id_asc +#define SXNET_get_id_INTEGER GRPC_SHADOW_SXNET_get_id_INTEGER +#define SXNET_get_id_ulong GRPC_SHADOW_SXNET_get_id_ulong +#define SXNETID_free GRPC_SHADOW_SXNETID_free +#define SXNETID_it GRPC_SHADOW_SXNETID_it +#define SXNETID_new GRPC_SHADOW_SXNETID_new +#define SXNET_it GRPC_SHADOW_SXNET_it +#define SXNET_new GRPC_SHADOW_SXNET_new +#define TLS_client_method GRPC_SHADOW_TLS_client_method +#define TLS_method GRPC_SHADOW_TLS_method +#define TLS_server_method GRPC_SHADOW_TLS_server_method +#define TLSv1_1_client_method GRPC_SHADOW_TLSv1_1_client_method +#define TLSv1_1_method GRPC_SHADOW_TLSv1_1_method +#define TLSv1_1_server_method GRPC_SHADOW_TLSv1_1_server_method +#define TLSv1_2_client_method GRPC_SHADOW_TLSv1_2_client_method +#define TLSv1_2_method GRPC_SHADOW_TLSv1_2_method +#define TLSv1_2_server_method GRPC_SHADOW_TLSv1_2_server_method +#define TLSv1_client_method GRPC_SHADOW_TLSv1_client_method +#define TLSv1_method GRPC_SHADOW_TLSv1_method +#define TLSv1_server_method GRPC_SHADOW_TLSv1_server_method +#define TLS_with_buffers_method GRPC_SHADOW_TLS_with_buffers_method +#define tree_find_sk GRPC_SHADOW_tree_find_sk +#define USERNOTICE_free GRPC_SHADOW_USERNOTICE_free +#define USERNOTICE_it GRPC_SHADOW_USERNOTICE_it +#define USERNOTICE_new GRPC_SHADOW_USERNOTICE_new +#define UTF8_getc GRPC_SHADOW_UTF8_getc +#define UTF8_putc GRPC_SHADOW_UTF8_putc +#define v2i_ASN1_BIT_STRING GRPC_SHADOW_v2i_ASN1_BIT_STRING +#define v2i_GENERAL_NAME GRPC_SHADOW_v2i_GENERAL_NAME +#define v2i_GENERAL_NAME_ex GRPC_SHADOW_v2i_GENERAL_NAME_ex +#define v2i_GENERAL_NAMES GRPC_SHADOW_v2i_GENERAL_NAMES +#define v3_akey_id GRPC_SHADOW_v3_akey_id +#define v3_alt GRPC_SHADOW_v3_alt +#define v3_bcons GRPC_SHADOW_v3_bcons +#define v3_cpols GRPC_SHADOW_v3_cpols +#define v3_crld GRPC_SHADOW_v3_crld +#define v3_crl_invdate GRPC_SHADOW_v3_crl_invdate +#define v3_crl_num GRPC_SHADOW_v3_crl_num +#define v3_crl_reason GRPC_SHADOW_v3_crl_reason +#define v3_delta_crl GRPC_SHADOW_v3_delta_crl +#define v3_ext_ku GRPC_SHADOW_v3_ext_ku +#define v3_freshest_crl GRPC_SHADOW_v3_freshest_crl +#define v3_idp GRPC_SHADOW_v3_idp +#define v3_info GRPC_SHADOW_v3_info +#define v3_inhibit_anyp GRPC_SHADOW_v3_inhibit_anyp +#define v3_key_usage GRPC_SHADOW_v3_key_usage +#define v3_name_constraints GRPC_SHADOW_v3_name_constraints +#define v3_nscert GRPC_SHADOW_v3_nscert +#define v3_ns_ia5_list GRPC_SHADOW_v3_ns_ia5_list +#define v3_ocsp_accresp GRPC_SHADOW_v3_ocsp_accresp +#define v3_ocsp_nocheck GRPC_SHADOW_v3_ocsp_nocheck +#define v3_pci GRPC_SHADOW_v3_pci +#define v3_pkey_usage_period GRPC_SHADOW_v3_pkey_usage_period +#define v3_policy_constraints GRPC_SHADOW_v3_policy_constraints +#define v3_policy_mappings GRPC_SHADOW_v3_policy_mappings +#define v3_sinfo GRPC_SHADOW_v3_sinfo +#define v3_skey_id GRPC_SHADOW_v3_skey_id +#define v3_sxnet GRPC_SHADOW_v3_sxnet +#define vpaes_cbc_encrypt GRPC_SHADOW_vpaes_cbc_encrypt +#define vpaes_ctr32_encrypt_blocks GRPC_SHADOW_vpaes_ctr32_encrypt_blocks +#define vpaes_decrypt GRPC_SHADOW_vpaes_decrypt +#define vpaes_encrypt GRPC_SHADOW_vpaes_encrypt +#define vpaes_set_decrypt_key GRPC_SHADOW_vpaes_set_decrypt_key +#define vpaes_set_encrypt_key GRPC_SHADOW_vpaes_set_encrypt_key +#define X25519 GRPC_SHADOW_X25519 +#define x25519_asn1_meth GRPC_SHADOW_x25519_asn1_meth +#define x25519_ge_add GRPC_SHADOW_x25519_ge_add +#define x25519_ge_frombytes_vartime GRPC_SHADOW_x25519_ge_frombytes_vartime +#define x25519_ge_p1p1_to_p2 GRPC_SHADOW_x25519_ge_p1p1_to_p2 +#define x25519_ge_p1p1_to_p3 GRPC_SHADOW_x25519_ge_p1p1_to_p3 +#define x25519_ge_p3_to_cached GRPC_SHADOW_x25519_ge_p3_to_cached +#define x25519_ge_scalarmult GRPC_SHADOW_x25519_ge_scalarmult +#define x25519_ge_scalarmult_base GRPC_SHADOW_x25519_ge_scalarmult_base +#define x25519_ge_scalarmult_small_precomp GRPC_SHADOW_x25519_ge_scalarmult_small_precomp +#define x25519_ge_sub GRPC_SHADOW_x25519_ge_sub +#define x25519_ge_tobytes GRPC_SHADOW_x25519_ge_tobytes +#define X25519_keypair GRPC_SHADOW_X25519_keypair +#define x25519_pkey_meth GRPC_SHADOW_x25519_pkey_meth +#define X25519_public_from_private GRPC_SHADOW_X25519_public_from_private +#define x25519_sc_reduce GRPC_SHADOW_x25519_sc_reduce +#define X509_add1_ext_i2d GRPC_SHADOW_X509_add1_ext_i2d +#define X509_add1_reject_object GRPC_SHADOW_X509_add1_reject_object +#define X509_add1_trust_object GRPC_SHADOW_X509_add1_trust_object +#define X509_add_ext GRPC_SHADOW_X509_add_ext +#define X509_ALGOR_cmp GRPC_SHADOW_X509_ALGOR_cmp +#define X509_ALGOR_dup GRPC_SHADOW_X509_ALGOR_dup +#define X509_ALGOR_free GRPC_SHADOW_X509_ALGOR_free +#define X509_ALGOR_get0 GRPC_SHADOW_X509_ALGOR_get0 +#define X509_ALGOR_it GRPC_SHADOW_X509_ALGOR_it +#define X509_ALGOR_new GRPC_SHADOW_X509_ALGOR_new +#define X509_ALGOR_set0 GRPC_SHADOW_X509_ALGOR_set0 +#define X509_ALGOR_set_md GRPC_SHADOW_X509_ALGOR_set_md +#define X509_ALGORS_it GRPC_SHADOW_X509_ALGORS_it +#define X509_alias_get0 GRPC_SHADOW_X509_alias_get0 +#define X509_alias_set1 GRPC_SHADOW_X509_alias_set1 +#define X509at_add1_attr GRPC_SHADOW_X509at_add1_attr +#define X509at_add1_attr_by_NID GRPC_SHADOW_X509at_add1_attr_by_NID +#define X509at_add1_attr_by_OBJ GRPC_SHADOW_X509at_add1_attr_by_OBJ +#define X509at_add1_attr_by_txt GRPC_SHADOW_X509at_add1_attr_by_txt +#define X509at_delete_attr GRPC_SHADOW_X509at_delete_attr +#define X509at_get0_data_by_OBJ GRPC_SHADOW_X509at_get0_data_by_OBJ +#define X509at_get_attr GRPC_SHADOW_X509at_get_attr +#define X509at_get_attr_by_NID GRPC_SHADOW_X509at_get_attr_by_NID +#define X509at_get_attr_by_OBJ GRPC_SHADOW_X509at_get_attr_by_OBJ +#define X509at_get_attr_count GRPC_SHADOW_X509at_get_attr_count +#define X509_ATTRIBUTE_count GRPC_SHADOW_X509_ATTRIBUTE_count +#define X509_ATTRIBUTE_create GRPC_SHADOW_X509_ATTRIBUTE_create +#define X509_ATTRIBUTE_create_by_NID GRPC_SHADOW_X509_ATTRIBUTE_create_by_NID +#define X509_ATTRIBUTE_create_by_OBJ GRPC_SHADOW_X509_ATTRIBUTE_create_by_OBJ +#define X509_ATTRIBUTE_create_by_txt GRPC_SHADOW_X509_ATTRIBUTE_create_by_txt +#define X509_ATTRIBUTE_dup GRPC_SHADOW_X509_ATTRIBUTE_dup +#define X509_ATTRIBUTE_free GRPC_SHADOW_X509_ATTRIBUTE_free +#define X509_ATTRIBUTE_get0_data GRPC_SHADOW_X509_ATTRIBUTE_get0_data +#define X509_ATTRIBUTE_get0_object GRPC_SHADOW_X509_ATTRIBUTE_get0_object +#define X509_ATTRIBUTE_get0_type GRPC_SHADOW_X509_ATTRIBUTE_get0_type +#define X509_ATTRIBUTE_it GRPC_SHADOW_X509_ATTRIBUTE_it +#define X509_ATTRIBUTE_new GRPC_SHADOW_X509_ATTRIBUTE_new +#define X509_ATTRIBUTE_set1_data GRPC_SHADOW_X509_ATTRIBUTE_set1_data +#define X509_ATTRIBUTE_set1_object GRPC_SHADOW_X509_ATTRIBUTE_set1_object +#define X509_ATTRIBUTE_SET_it GRPC_SHADOW_X509_ATTRIBUTE_SET_it +#define X509_CERT_AUX_free GRPC_SHADOW_X509_CERT_AUX_free +#define X509_CERT_AUX_it GRPC_SHADOW_X509_CERT_AUX_it +#define X509_CERT_AUX_new GRPC_SHADOW_X509_CERT_AUX_new +#define X509_CERT_AUX_print GRPC_SHADOW_X509_CERT_AUX_print +#define X509_chain_check_suiteb GRPC_SHADOW_X509_chain_check_suiteb +#define X509_chain_up_ref GRPC_SHADOW_X509_chain_up_ref +#define X509_check_akid GRPC_SHADOW_X509_check_akid +#define X509_check_ca GRPC_SHADOW_X509_check_ca +#define X509_check_email GRPC_SHADOW_X509_check_email +#define X509_check_host GRPC_SHADOW_X509_check_host +#define X509_check_ip GRPC_SHADOW_X509_check_ip +#define X509_check_ip_asc GRPC_SHADOW_X509_check_ip_asc +#define X509_check_issued GRPC_SHADOW_X509_check_issued +#define X509_check_private_key GRPC_SHADOW_X509_check_private_key +#define X509_check_purpose GRPC_SHADOW_X509_check_purpose +#define X509_check_trust GRPC_SHADOW_X509_check_trust +#define X509_CINF_free GRPC_SHADOW_X509_CINF_free +#define X509_CINF_it GRPC_SHADOW_X509_CINF_it +#define X509_CINF_new GRPC_SHADOW_X509_CINF_new +#define X509_cmp GRPC_SHADOW_X509_cmp +#define X509_cmp_current_time GRPC_SHADOW_X509_cmp_current_time +#define X509_cmp_time GRPC_SHADOW_X509_cmp_time +#define X509_CRL_add0_revoked GRPC_SHADOW_X509_CRL_add0_revoked +#define X509_CRL_add1_ext_i2d GRPC_SHADOW_X509_CRL_add1_ext_i2d +#define X509_CRL_add_ext GRPC_SHADOW_X509_CRL_add_ext +#define X509_CRL_check_suiteb GRPC_SHADOW_X509_CRL_check_suiteb +#define X509_CRL_cmp GRPC_SHADOW_X509_CRL_cmp +#define X509_CRL_delete_ext GRPC_SHADOW_X509_CRL_delete_ext +#define X509_CRL_diff GRPC_SHADOW_X509_CRL_diff +#define X509_CRL_digest GRPC_SHADOW_X509_CRL_digest +#define X509_CRL_dup GRPC_SHADOW_X509_CRL_dup +#define X509_CRL_free GRPC_SHADOW_X509_CRL_free +#define X509_CRL_get0_by_cert GRPC_SHADOW_X509_CRL_get0_by_cert +#define X509_CRL_get0_by_serial GRPC_SHADOW_X509_CRL_get0_by_serial +#define X509_CRL_get0_lastUpdate GRPC_SHADOW_X509_CRL_get0_lastUpdate +#define X509_CRL_get0_nextUpdate GRPC_SHADOW_X509_CRL_get0_nextUpdate +#define X509_CRL_get0_signature GRPC_SHADOW_X509_CRL_get0_signature +#define X509_CRL_get_ext GRPC_SHADOW_X509_CRL_get_ext +#define X509_CRL_get_ext_by_critical GRPC_SHADOW_X509_CRL_get_ext_by_critical +#define X509_CRL_get_ext_by_NID GRPC_SHADOW_X509_CRL_get_ext_by_NID +#define X509_CRL_get_ext_by_OBJ GRPC_SHADOW_X509_CRL_get_ext_by_OBJ +#define X509_CRL_get_ext_count GRPC_SHADOW_X509_CRL_get_ext_count +#define X509_CRL_get_ext_d2i GRPC_SHADOW_X509_CRL_get_ext_d2i +#define X509_CRL_get_meth_data GRPC_SHADOW_X509_CRL_get_meth_data +#define X509_CRL_get_signature_nid GRPC_SHADOW_X509_CRL_get_signature_nid +#define X509_CRL_INFO_free GRPC_SHADOW_X509_CRL_INFO_free +#define X509_CRL_INFO_it GRPC_SHADOW_X509_CRL_INFO_it +#define X509_CRL_INFO_new GRPC_SHADOW_X509_CRL_INFO_new +#define X509_CRL_it GRPC_SHADOW_X509_CRL_it +#define X509_CRL_match GRPC_SHADOW_X509_CRL_match +#define X509_CRL_METHOD_free GRPC_SHADOW_X509_CRL_METHOD_free +#define X509_CRL_METHOD_new GRPC_SHADOW_X509_CRL_METHOD_new +#define X509_CRL_new GRPC_SHADOW_X509_CRL_new +#define X509_CRL_print GRPC_SHADOW_X509_CRL_print +#define X509_CRL_print_fp GRPC_SHADOW_X509_CRL_print_fp +#define X509_CRL_set_default_method GRPC_SHADOW_X509_CRL_set_default_method +#define X509_CRL_set_issuer_name GRPC_SHADOW_X509_CRL_set_issuer_name +#define X509_CRL_set_lastUpdate GRPC_SHADOW_X509_CRL_set_lastUpdate +#define X509_CRL_set_meth_data GRPC_SHADOW_X509_CRL_set_meth_data +#define X509_CRL_set_nextUpdate GRPC_SHADOW_X509_CRL_set_nextUpdate +#define X509_CRL_set_version GRPC_SHADOW_X509_CRL_set_version +#define X509_CRL_sign GRPC_SHADOW_X509_CRL_sign +#define X509_CRL_sign_ctx GRPC_SHADOW_X509_CRL_sign_ctx +#define X509_CRL_sort GRPC_SHADOW_X509_CRL_sort +#define X509_CRL_up_ref GRPC_SHADOW_X509_CRL_up_ref +#define X509_CRL_verify GRPC_SHADOW_X509_CRL_verify +#define X509_delete_ext GRPC_SHADOW_X509_delete_ext +#define X509_digest GRPC_SHADOW_X509_digest +#define x509_digest_sign_algorithm GRPC_SHADOW_x509_digest_sign_algorithm +#define x509_digest_verify_init GRPC_SHADOW_x509_digest_verify_init +#define X509_dup GRPC_SHADOW_X509_dup +#define X509_email_free GRPC_SHADOW_X509_email_free +#define X509_EXTENSION_create_by_NID GRPC_SHADOW_X509_EXTENSION_create_by_NID +#define X509_EXTENSION_create_by_OBJ GRPC_SHADOW_X509_EXTENSION_create_by_OBJ +#define X509_EXTENSION_dup GRPC_SHADOW_X509_EXTENSION_dup +#define X509_EXTENSION_free GRPC_SHADOW_X509_EXTENSION_free +#define X509_EXTENSION_get_critical GRPC_SHADOW_X509_EXTENSION_get_critical +#define X509_EXTENSION_get_data GRPC_SHADOW_X509_EXTENSION_get_data +#define X509_EXTENSION_get_object GRPC_SHADOW_X509_EXTENSION_get_object +#define X509_EXTENSION_it GRPC_SHADOW_X509_EXTENSION_it +#define X509_EXTENSION_new GRPC_SHADOW_X509_EXTENSION_new +#define X509_EXTENSION_set_critical GRPC_SHADOW_X509_EXTENSION_set_critical +#define X509_EXTENSION_set_data GRPC_SHADOW_X509_EXTENSION_set_data +#define X509_EXTENSION_set_object GRPC_SHADOW_X509_EXTENSION_set_object +#define X509_EXTENSIONS_it GRPC_SHADOW_X509_EXTENSIONS_it +#define X509_find_by_issuer_and_serial GRPC_SHADOW_X509_find_by_issuer_and_serial +#define X509_find_by_subject GRPC_SHADOW_X509_find_by_subject +#define X509_free GRPC_SHADOW_X509_free +#define X509_get0_extensions GRPC_SHADOW_X509_get0_extensions +#define X509_get0_notAfter GRPC_SHADOW_X509_get0_notAfter +#define X509_get0_notBefore GRPC_SHADOW_X509_get0_notBefore +#define X509_get0_pubkey_bitstr GRPC_SHADOW_X509_get0_pubkey_bitstr +#define X509_get0_signature GRPC_SHADOW_X509_get0_signature +#define X509_get0_tbs_sigalg GRPC_SHADOW_X509_get0_tbs_sigalg +#define X509_get1_email GRPC_SHADOW_X509_get1_email +#define X509_get1_ocsp GRPC_SHADOW_X509_get1_ocsp +#define X509_get_default_cert_area GRPC_SHADOW_X509_get_default_cert_area +#define X509_get_default_cert_dir GRPC_SHADOW_X509_get_default_cert_dir +#define X509_get_default_cert_dir_env GRPC_SHADOW_X509_get_default_cert_dir_env +#define X509_get_default_cert_file GRPC_SHADOW_X509_get_default_cert_file +#define X509_get_default_cert_file_env GRPC_SHADOW_X509_get_default_cert_file_env +#define X509_get_default_private_dir GRPC_SHADOW_X509_get_default_private_dir +#define X509_get_ex_data GRPC_SHADOW_X509_get_ex_data +#define X509_get_ex_new_index GRPC_SHADOW_X509_get_ex_new_index +#define X509_get_ext GRPC_SHADOW_X509_get_ext +#define X509_get_ext_by_critical GRPC_SHADOW_X509_get_ext_by_critical +#define X509_get_ext_by_NID GRPC_SHADOW_X509_get_ext_by_NID +#define X509_get_ext_by_OBJ GRPC_SHADOW_X509_get_ext_by_OBJ +#define X509_get_ext_count GRPC_SHADOW_X509_get_ext_count +#define X509_get_ext_d2i GRPC_SHADOW_X509_get_ext_d2i +#define X509_get_extended_key_usage GRPC_SHADOW_X509_get_extended_key_usage +#define X509_get_extension_flags GRPC_SHADOW_X509_get_extension_flags +#define X509_get_issuer_name GRPC_SHADOW_X509_get_issuer_name +#define X509_get_key_usage GRPC_SHADOW_X509_get_key_usage +#define X509_get_pubkey GRPC_SHADOW_X509_get_pubkey +#define X509_get_serialNumber GRPC_SHADOW_X509_get_serialNumber +#define X509_get_signature_nid GRPC_SHADOW_X509_get_signature_nid +#define X509_get_subject_name GRPC_SHADOW_X509_get_subject_name +#define X509_gmtime_adj GRPC_SHADOW_X509_gmtime_adj +#define X509_INFO_free GRPC_SHADOW_X509_INFO_free +#define X509_INFO_new GRPC_SHADOW_X509_INFO_new +#define X509_issuer_and_serial_cmp GRPC_SHADOW_X509_issuer_and_serial_cmp +#define X509_issuer_and_serial_hash GRPC_SHADOW_X509_issuer_and_serial_hash +#define X509_issuer_name_cmp GRPC_SHADOW_X509_issuer_name_cmp +#define X509_issuer_name_hash GRPC_SHADOW_X509_issuer_name_hash +#define X509_issuer_name_hash_old GRPC_SHADOW_X509_issuer_name_hash_old +#define X509_it GRPC_SHADOW_X509_it +#define X509_keyid_get0 GRPC_SHADOW_X509_keyid_get0 +#define X509_keyid_set1 GRPC_SHADOW_X509_keyid_set1 +#define X509_load_cert_crl_file GRPC_SHADOW_X509_load_cert_crl_file +#define X509_load_cert_file GRPC_SHADOW_X509_load_cert_file +#define X509_load_crl_file GRPC_SHADOW_X509_load_crl_file +#define X509_LOOKUP_by_alias GRPC_SHADOW_X509_LOOKUP_by_alias +#define X509_LOOKUP_by_fingerprint GRPC_SHADOW_X509_LOOKUP_by_fingerprint +#define X509_LOOKUP_by_issuer_serial GRPC_SHADOW_X509_LOOKUP_by_issuer_serial +#define X509_LOOKUP_by_subject GRPC_SHADOW_X509_LOOKUP_by_subject +#define X509_LOOKUP_ctrl GRPC_SHADOW_X509_LOOKUP_ctrl +#define X509_LOOKUP_file GRPC_SHADOW_X509_LOOKUP_file +#define X509_LOOKUP_free GRPC_SHADOW_X509_LOOKUP_free +#define X509_LOOKUP_hash_dir GRPC_SHADOW_X509_LOOKUP_hash_dir +#define X509_LOOKUP_init GRPC_SHADOW_X509_LOOKUP_init +#define X509_LOOKUP_new GRPC_SHADOW_X509_LOOKUP_new +#define X509_LOOKUP_shutdown GRPC_SHADOW_X509_LOOKUP_shutdown +#define X509_NAME_add_entry GRPC_SHADOW_X509_NAME_add_entry +#define X509_NAME_add_entry_by_NID GRPC_SHADOW_X509_NAME_add_entry_by_NID +#define X509_NAME_add_entry_by_OBJ GRPC_SHADOW_X509_NAME_add_entry_by_OBJ +#define X509_NAME_add_entry_by_txt GRPC_SHADOW_X509_NAME_add_entry_by_txt +#define X509_NAME_cmp GRPC_SHADOW_X509_NAME_cmp +#define X509_NAME_delete_entry GRPC_SHADOW_X509_NAME_delete_entry +#define X509_NAME_digest GRPC_SHADOW_X509_NAME_digest +#define X509_NAME_dup GRPC_SHADOW_X509_NAME_dup +#define X509_NAME_ENTRIES_it GRPC_SHADOW_X509_NAME_ENTRIES_it +#define X509_NAME_entry_count GRPC_SHADOW_X509_NAME_entry_count +#define X509_NAME_ENTRY_create_by_NID GRPC_SHADOW_X509_NAME_ENTRY_create_by_NID +#define X509_NAME_ENTRY_create_by_OBJ GRPC_SHADOW_X509_NAME_ENTRY_create_by_OBJ +#define X509_NAME_ENTRY_create_by_txt GRPC_SHADOW_X509_NAME_ENTRY_create_by_txt +#define X509_NAME_ENTRY_dup GRPC_SHADOW_X509_NAME_ENTRY_dup +#define X509_NAME_ENTRY_free GRPC_SHADOW_X509_NAME_ENTRY_free +#define X509_NAME_ENTRY_get_data GRPC_SHADOW_X509_NAME_ENTRY_get_data +#define X509_NAME_ENTRY_get_object GRPC_SHADOW_X509_NAME_ENTRY_get_object +#define X509_NAME_ENTRY_it GRPC_SHADOW_X509_NAME_ENTRY_it +#define X509_NAME_ENTRY_new GRPC_SHADOW_X509_NAME_ENTRY_new +#define X509_NAME_ENTRY_set GRPC_SHADOW_X509_NAME_ENTRY_set +#define X509_NAME_ENTRY_set_data GRPC_SHADOW_X509_NAME_ENTRY_set_data +#define X509_NAME_ENTRY_set_object GRPC_SHADOW_X509_NAME_ENTRY_set_object +#define X509_NAME_free GRPC_SHADOW_X509_NAME_free +#define X509_NAME_get0_der GRPC_SHADOW_X509_NAME_get0_der +#define X509_NAME_get_entry GRPC_SHADOW_X509_NAME_get_entry +#define X509_NAME_get_index_by_NID GRPC_SHADOW_X509_NAME_get_index_by_NID +#define X509_NAME_get_index_by_OBJ GRPC_SHADOW_X509_NAME_get_index_by_OBJ +#define X509_NAME_get_text_by_NID GRPC_SHADOW_X509_NAME_get_text_by_NID +#define X509_NAME_get_text_by_OBJ GRPC_SHADOW_X509_NAME_get_text_by_OBJ +#define X509_NAME_hash GRPC_SHADOW_X509_NAME_hash +#define X509_NAME_hash_old GRPC_SHADOW_X509_NAME_hash_old +#define X509_NAME_INTERNAL_it GRPC_SHADOW_X509_NAME_INTERNAL_it +#define X509_NAME_it GRPC_SHADOW_X509_NAME_it +#define X509_NAME_new GRPC_SHADOW_X509_NAME_new +#define X509_NAME_oneline GRPC_SHADOW_X509_NAME_oneline +#define X509_NAME_print GRPC_SHADOW_X509_NAME_print +#define X509_NAME_print_ex GRPC_SHADOW_X509_NAME_print_ex +#define X509_NAME_print_ex_fp GRPC_SHADOW_X509_NAME_print_ex_fp +#define X509_NAME_set GRPC_SHADOW_X509_NAME_set +#define X509_new GRPC_SHADOW_X509_new +#define X509_OBJECT_free_contents GRPC_SHADOW_X509_OBJECT_free_contents +#define X509_OBJECT_get0_X509 GRPC_SHADOW_X509_OBJECT_get0_X509 +#define X509_OBJECT_get_type GRPC_SHADOW_X509_OBJECT_get_type +#define X509_OBJECT_idx_by_subject GRPC_SHADOW_X509_OBJECT_idx_by_subject +#define X509_OBJECT_retrieve_by_subject GRPC_SHADOW_X509_OBJECT_retrieve_by_subject +#define X509_OBJECT_retrieve_match GRPC_SHADOW_X509_OBJECT_retrieve_match +#define X509_OBJECT_up_ref_count GRPC_SHADOW_X509_OBJECT_up_ref_count +#define X509_ocspid_print GRPC_SHADOW_X509_ocspid_print +#define X509_parse_from_buffer GRPC_SHADOW_X509_parse_from_buffer +#define X509_PKEY_free GRPC_SHADOW_X509_PKEY_free +#define X509_PKEY_new GRPC_SHADOW_X509_PKEY_new +#define X509_policy_check GRPC_SHADOW_X509_policy_check +#define X509_policy_level_get0_node GRPC_SHADOW_X509_policy_level_get0_node +#define X509_policy_level_node_count GRPC_SHADOW_X509_policy_level_node_count +#define X509_policy_node_get0_parent GRPC_SHADOW_X509_policy_node_get0_parent +#define X509_policy_node_get0_policy GRPC_SHADOW_X509_policy_node_get0_policy +#define X509_policy_node_get0_qualifiers GRPC_SHADOW_X509_policy_node_get0_qualifiers +#define X509_POLICY_NODE_print GRPC_SHADOW_X509_POLICY_NODE_print +#define X509_policy_tree_free GRPC_SHADOW_X509_policy_tree_free +#define X509_policy_tree_get0_level GRPC_SHADOW_X509_policy_tree_get0_level +#define X509_policy_tree_get0_policies GRPC_SHADOW_X509_policy_tree_get0_policies +#define X509_policy_tree_get0_user_policies GRPC_SHADOW_X509_policy_tree_get0_user_policies +#define X509_policy_tree_level_count GRPC_SHADOW_X509_policy_tree_level_count +#define X509_print GRPC_SHADOW_X509_print +#define X509_print_ex GRPC_SHADOW_X509_print_ex +#define X509_print_ex_fp GRPC_SHADOW_X509_print_ex_fp +#define X509_print_fp GRPC_SHADOW_X509_print_fp +#define x509_print_rsa_pss_params GRPC_SHADOW_x509_print_rsa_pss_params +#define X509_pubkey_digest GRPC_SHADOW_X509_pubkey_digest +#define X509_PUBKEY_free GRPC_SHADOW_X509_PUBKEY_free +#define X509_PUBKEY_get GRPC_SHADOW_X509_PUBKEY_get +#define X509_PUBKEY_get0_param GRPC_SHADOW_X509_PUBKEY_get0_param +#define X509_PUBKEY_it GRPC_SHADOW_X509_PUBKEY_it +#define X509_PUBKEY_new GRPC_SHADOW_X509_PUBKEY_new +#define X509_PUBKEY_set GRPC_SHADOW_X509_PUBKEY_set +#define X509_PUBKEY_set0_param GRPC_SHADOW_X509_PUBKEY_set0_param +#define X509_PURPOSE_add GRPC_SHADOW_X509_PURPOSE_add +#define X509_PURPOSE_cleanup GRPC_SHADOW_X509_PURPOSE_cleanup +#define X509_PURPOSE_get0 GRPC_SHADOW_X509_PURPOSE_get0 +#define X509_PURPOSE_get0_name GRPC_SHADOW_X509_PURPOSE_get0_name +#define X509_PURPOSE_get0_sname GRPC_SHADOW_X509_PURPOSE_get0_sname +#define X509_PURPOSE_get_by_id GRPC_SHADOW_X509_PURPOSE_get_by_id +#define X509_PURPOSE_get_by_sname GRPC_SHADOW_X509_PURPOSE_get_by_sname +#define X509_PURPOSE_get_count GRPC_SHADOW_X509_PURPOSE_get_count +#define X509_PURPOSE_get_id GRPC_SHADOW_X509_PURPOSE_get_id +#define X509_PURPOSE_get_trust GRPC_SHADOW_X509_PURPOSE_get_trust +#define X509_PURPOSE_set GRPC_SHADOW_X509_PURPOSE_set +#define X509_reject_clear GRPC_SHADOW_X509_reject_clear +#define X509_REQ_add1_attr GRPC_SHADOW_X509_REQ_add1_attr +#define X509_REQ_add1_attr_by_NID GRPC_SHADOW_X509_REQ_add1_attr_by_NID +#define X509_REQ_add1_attr_by_OBJ GRPC_SHADOW_X509_REQ_add1_attr_by_OBJ +#define X509_REQ_add1_attr_by_txt GRPC_SHADOW_X509_REQ_add1_attr_by_txt +#define X509_REQ_add_extensions GRPC_SHADOW_X509_REQ_add_extensions +#define X509_REQ_add_extensions_nid GRPC_SHADOW_X509_REQ_add_extensions_nid +#define X509_REQ_check_private_key GRPC_SHADOW_X509_REQ_check_private_key +#define X509_REQ_delete_attr GRPC_SHADOW_X509_REQ_delete_attr +#define X509_REQ_digest GRPC_SHADOW_X509_REQ_digest +#define X509_REQ_dup GRPC_SHADOW_X509_REQ_dup +#define X509_REQ_extension_nid GRPC_SHADOW_X509_REQ_extension_nid +#define X509_REQ_free GRPC_SHADOW_X509_REQ_free +#define X509_REQ_get0_signature GRPC_SHADOW_X509_REQ_get0_signature +#define X509_REQ_get1_email GRPC_SHADOW_X509_REQ_get1_email +#define X509_REQ_get_attr GRPC_SHADOW_X509_REQ_get_attr +#define X509_REQ_get_attr_by_NID GRPC_SHADOW_X509_REQ_get_attr_by_NID +#define X509_REQ_get_attr_by_OBJ GRPC_SHADOW_X509_REQ_get_attr_by_OBJ +#define X509_REQ_get_attr_count GRPC_SHADOW_X509_REQ_get_attr_count +#define X509_REQ_get_extension_nids GRPC_SHADOW_X509_REQ_get_extension_nids +#define X509_REQ_get_extensions GRPC_SHADOW_X509_REQ_get_extensions +#define X509_REQ_get_pubkey GRPC_SHADOW_X509_REQ_get_pubkey +#define X509_REQ_get_signature_nid GRPC_SHADOW_X509_REQ_get_signature_nid +#define X509_REQ_INFO_free GRPC_SHADOW_X509_REQ_INFO_free +#define X509_REQ_INFO_it GRPC_SHADOW_X509_REQ_INFO_it +#define X509_REQ_INFO_new GRPC_SHADOW_X509_REQ_INFO_new +#define X509_REQ_it GRPC_SHADOW_X509_REQ_it +#define X509_REQ_new GRPC_SHADOW_X509_REQ_new +#define X509_REQ_print GRPC_SHADOW_X509_REQ_print +#define X509_REQ_print_ex GRPC_SHADOW_X509_REQ_print_ex +#define X509_REQ_print_fp GRPC_SHADOW_X509_REQ_print_fp +#define X509_REQ_set_extension_nids GRPC_SHADOW_X509_REQ_set_extension_nids +#define X509_REQ_set_pubkey GRPC_SHADOW_X509_REQ_set_pubkey +#define X509_REQ_set_subject_name GRPC_SHADOW_X509_REQ_set_subject_name +#define X509_REQ_set_version GRPC_SHADOW_X509_REQ_set_version +#define X509_REQ_sign GRPC_SHADOW_X509_REQ_sign +#define X509_REQ_sign_ctx GRPC_SHADOW_X509_REQ_sign_ctx +#define X509_REQ_to_X509 GRPC_SHADOW_X509_REQ_to_X509 +#define X509_REQ_verify GRPC_SHADOW_X509_REQ_verify +#define X509_REVOKED_add1_ext_i2d GRPC_SHADOW_X509_REVOKED_add1_ext_i2d +#define X509_REVOKED_add_ext GRPC_SHADOW_X509_REVOKED_add_ext +#define X509_REVOKED_delete_ext GRPC_SHADOW_X509_REVOKED_delete_ext +#define X509_REVOKED_dup GRPC_SHADOW_X509_REVOKED_dup +#define X509_REVOKED_free GRPC_SHADOW_X509_REVOKED_free +#define X509_REVOKED_get0_revocationDate GRPC_SHADOW_X509_REVOKED_get0_revocationDate +#define X509_REVOKED_get0_serialNumber GRPC_SHADOW_X509_REVOKED_get0_serialNumber +#define X509_REVOKED_get_ext GRPC_SHADOW_X509_REVOKED_get_ext +#define X509_REVOKED_get_ext_by_critical GRPC_SHADOW_X509_REVOKED_get_ext_by_critical +#define X509_REVOKED_get_ext_by_NID GRPC_SHADOW_X509_REVOKED_get_ext_by_NID +#define X509_REVOKED_get_ext_by_OBJ GRPC_SHADOW_X509_REVOKED_get_ext_by_OBJ +#define X509_REVOKED_get_ext_count GRPC_SHADOW_X509_REVOKED_get_ext_count +#define X509_REVOKED_get_ext_d2i GRPC_SHADOW_X509_REVOKED_get_ext_d2i +#define X509_REVOKED_it GRPC_SHADOW_X509_REVOKED_it +#define X509_REVOKED_new GRPC_SHADOW_X509_REVOKED_new +#define X509_REVOKED_set_revocationDate GRPC_SHADOW_X509_REVOKED_set_revocationDate +#define X509_REVOKED_set_serialNumber GRPC_SHADOW_X509_REVOKED_set_serialNumber +#define x509_rsa_ctx_to_pss GRPC_SHADOW_x509_rsa_ctx_to_pss +#define x509_rsa_pss_to_ctx GRPC_SHADOW_x509_rsa_pss_to_ctx +#define X509_set_ex_data GRPC_SHADOW_X509_set_ex_data +#define X509_set_issuer_name GRPC_SHADOW_X509_set_issuer_name +#define X509_set_notAfter GRPC_SHADOW_X509_set_notAfter +#define X509_set_notBefore GRPC_SHADOW_X509_set_notBefore +#define X509_set_pubkey GRPC_SHADOW_X509_set_pubkey +#define X509_set_serialNumber GRPC_SHADOW_X509_set_serialNumber +#define X509_set_subject_name GRPC_SHADOW_X509_set_subject_name +#define X509_set_version GRPC_SHADOW_X509_set_version +#define X509_SIG_free GRPC_SHADOW_X509_SIG_free +#define X509_SIG_it GRPC_SHADOW_X509_SIG_it +#define X509_sign GRPC_SHADOW_X509_sign +#define X509_signature_dump GRPC_SHADOW_X509_signature_dump +#define X509_signature_print GRPC_SHADOW_X509_signature_print +#define X509_sign_ctx GRPC_SHADOW_X509_sign_ctx +#define X509_SIG_new GRPC_SHADOW_X509_SIG_new +#define X509_STORE_add_cert GRPC_SHADOW_X509_STORE_add_cert +#define X509_STORE_add_crl GRPC_SHADOW_X509_STORE_add_crl +#define X509_STORE_add_lookup GRPC_SHADOW_X509_STORE_add_lookup +#define X509_STORE_CTX_cleanup GRPC_SHADOW_X509_STORE_CTX_cleanup +#define X509_STORE_CTX_free GRPC_SHADOW_X509_STORE_CTX_free +#define X509_STORE_CTX_get0_cert GRPC_SHADOW_X509_STORE_CTX_get0_cert +#define X509_STORE_CTX_get0_current_crl GRPC_SHADOW_X509_STORE_CTX_get0_current_crl +#define X509_STORE_CTX_get0_current_issuer GRPC_SHADOW_X509_STORE_CTX_get0_current_issuer +#define X509_STORE_CTX_get0_param GRPC_SHADOW_X509_STORE_CTX_get0_param +#define X509_STORE_CTX_get0_parent_ctx GRPC_SHADOW_X509_STORE_CTX_get0_parent_ctx +#define X509_STORE_CTX_get0_policy_tree GRPC_SHADOW_X509_STORE_CTX_get0_policy_tree +#define X509_STORE_CTX_get0_store GRPC_SHADOW_X509_STORE_CTX_get0_store +#define X509_STORE_CTX_get0_untrusted GRPC_SHADOW_X509_STORE_CTX_get0_untrusted +#define X509_STORE_CTX_get1_chain GRPC_SHADOW_X509_STORE_CTX_get1_chain +#define X509_STORE_CTX_get1_issuer GRPC_SHADOW_X509_STORE_CTX_get1_issuer +#define X509_STORE_CTX_get_chain GRPC_SHADOW_X509_STORE_CTX_get_chain +#define X509_STORE_CTX_get_current_cert GRPC_SHADOW_X509_STORE_CTX_get_current_cert +#define X509_STORE_CTX_get_error GRPC_SHADOW_X509_STORE_CTX_get_error +#define X509_STORE_CTX_get_error_depth GRPC_SHADOW_X509_STORE_CTX_get_error_depth +#define X509_STORE_CTX_get_ex_data GRPC_SHADOW_X509_STORE_CTX_get_ex_data +#define X509_STORE_CTX_get_ex_new_index GRPC_SHADOW_X509_STORE_CTX_get_ex_new_index +#define X509_STORE_CTX_get_explicit_policy GRPC_SHADOW_X509_STORE_CTX_get_explicit_policy +#define X509_STORE_CTX_init GRPC_SHADOW_X509_STORE_CTX_init +#define X509_STORE_CTX_new GRPC_SHADOW_X509_STORE_CTX_new +#define X509_STORE_CTX_purpose_inherit GRPC_SHADOW_X509_STORE_CTX_purpose_inherit +#define X509_STORE_CTX_set0_crls GRPC_SHADOW_X509_STORE_CTX_set0_crls +#define X509_STORE_CTX_set0_param GRPC_SHADOW_X509_STORE_CTX_set0_param +#define X509_STORE_CTX_set_cert GRPC_SHADOW_X509_STORE_CTX_set_cert +#define X509_STORE_CTX_set_chain GRPC_SHADOW_X509_STORE_CTX_set_chain +#define X509_STORE_CTX_set_default GRPC_SHADOW_X509_STORE_CTX_set_default +#define X509_STORE_CTX_set_depth GRPC_SHADOW_X509_STORE_CTX_set_depth +#define X509_STORE_CTX_set_error GRPC_SHADOW_X509_STORE_CTX_set_error +#define X509_STORE_CTX_set_ex_data GRPC_SHADOW_X509_STORE_CTX_set_ex_data +#define X509_STORE_CTX_set_flags GRPC_SHADOW_X509_STORE_CTX_set_flags +#define X509_STORE_CTX_set_purpose GRPC_SHADOW_X509_STORE_CTX_set_purpose +#define X509_STORE_CTX_set_time GRPC_SHADOW_X509_STORE_CTX_set_time +#define X509_STORE_CTX_set_trust GRPC_SHADOW_X509_STORE_CTX_set_trust +#define X509_STORE_CTX_set_verify_cb GRPC_SHADOW_X509_STORE_CTX_set_verify_cb +#define X509_STORE_CTX_trusted_stack GRPC_SHADOW_X509_STORE_CTX_trusted_stack +#define X509_STORE_CTX_zero GRPC_SHADOW_X509_STORE_CTX_zero +#define X509_STORE_free GRPC_SHADOW_X509_STORE_free +#define X509_STORE_get0_objects GRPC_SHADOW_X509_STORE_get0_objects +#define X509_STORE_get0_param GRPC_SHADOW_X509_STORE_get0_param +#define X509_STORE_get1_certs GRPC_SHADOW_X509_STORE_get1_certs +#define X509_STORE_get1_crls GRPC_SHADOW_X509_STORE_get1_crls +#define X509_STORE_get_by_subject GRPC_SHADOW_X509_STORE_get_by_subject +#define X509_STORE_get_cert_crl GRPC_SHADOW_X509_STORE_get_cert_crl +#define X509_STORE_get_check_crl GRPC_SHADOW_X509_STORE_get_check_crl +#define X509_STORE_get_check_issued GRPC_SHADOW_X509_STORE_get_check_issued +#define X509_STORE_get_check_revocation GRPC_SHADOW_X509_STORE_get_check_revocation +#define X509_STORE_get_cleanup GRPC_SHADOW_X509_STORE_get_cleanup +#define X509_STORE_get_get_crl GRPC_SHADOW_X509_STORE_get_get_crl +#define X509_STORE_get_get_issuer GRPC_SHADOW_X509_STORE_get_get_issuer +#define X509_STORE_get_lookup_certs GRPC_SHADOW_X509_STORE_get_lookup_certs +#define X509_STORE_get_lookup_crls GRPC_SHADOW_X509_STORE_get_lookup_crls +#define X509_STORE_get_verify GRPC_SHADOW_X509_STORE_get_verify +#define X509_STORE_get_verify_cb GRPC_SHADOW_X509_STORE_get_verify_cb +#define X509_STORE_load_locations GRPC_SHADOW_X509_STORE_load_locations +#define X509_STORE_new GRPC_SHADOW_X509_STORE_new +#define X509_STORE_set0_additional_untrusted GRPC_SHADOW_X509_STORE_set0_additional_untrusted +#define X509_STORE_set1_param GRPC_SHADOW_X509_STORE_set1_param +#define X509_STORE_set_cert_crl GRPC_SHADOW_X509_STORE_set_cert_crl +#define X509_STORE_set_check_crl GRPC_SHADOW_X509_STORE_set_check_crl +#define X509_STORE_set_check_issued GRPC_SHADOW_X509_STORE_set_check_issued +#define X509_STORE_set_check_revocation GRPC_SHADOW_X509_STORE_set_check_revocation +#define X509_STORE_set_cleanup GRPC_SHADOW_X509_STORE_set_cleanup +#define X509_STORE_set_default_paths GRPC_SHADOW_X509_STORE_set_default_paths +#define X509_STORE_set_depth GRPC_SHADOW_X509_STORE_set_depth +#define X509_STORE_set_flags GRPC_SHADOW_X509_STORE_set_flags +#define X509_STORE_set_get_crl GRPC_SHADOW_X509_STORE_set_get_crl +#define X509_STORE_set_get_issuer GRPC_SHADOW_X509_STORE_set_get_issuer +#define X509_STORE_set_lookup_certs GRPC_SHADOW_X509_STORE_set_lookup_certs +#define X509_STORE_set_lookup_crls GRPC_SHADOW_X509_STORE_set_lookup_crls +#define X509_STORE_set_purpose GRPC_SHADOW_X509_STORE_set_purpose +#define X509_STORE_set_trust GRPC_SHADOW_X509_STORE_set_trust +#define X509_STORE_set_verify GRPC_SHADOW_X509_STORE_set_verify +#define X509_STORE_set_verify_cb GRPC_SHADOW_X509_STORE_set_verify_cb +#define X509_STORE_up_ref GRPC_SHADOW_X509_STORE_up_ref +#define X509_subject_name_cmp GRPC_SHADOW_X509_subject_name_cmp +#define X509_subject_name_hash GRPC_SHADOW_X509_subject_name_hash +#define X509_subject_name_hash_old GRPC_SHADOW_X509_subject_name_hash_old +#define X509_supported_extension GRPC_SHADOW_X509_supported_extension +#define X509_time_adj GRPC_SHADOW_X509_time_adj +#define X509_time_adj_ex GRPC_SHADOW_X509_time_adj_ex +#define X509_to_X509_REQ GRPC_SHADOW_X509_to_X509_REQ +#define X509_TRUST_add GRPC_SHADOW_X509_TRUST_add +#define X509_TRUST_cleanup GRPC_SHADOW_X509_TRUST_cleanup +#define X509_trust_clear GRPC_SHADOW_X509_trust_clear +#define X509_TRUST_get0 GRPC_SHADOW_X509_TRUST_get0 +#define X509_TRUST_get0_name GRPC_SHADOW_X509_TRUST_get0_name +#define X509_TRUST_get_by_id GRPC_SHADOW_X509_TRUST_get_by_id +#define X509_TRUST_get_count GRPC_SHADOW_X509_TRUST_get_count +#define X509_TRUST_get_flags GRPC_SHADOW_X509_TRUST_get_flags +#define X509_TRUST_get_trust GRPC_SHADOW_X509_TRUST_get_trust +#define X509_TRUST_set GRPC_SHADOW_X509_TRUST_set +#define X509_TRUST_set_default GRPC_SHADOW_X509_TRUST_set_default +#define X509_up_ref GRPC_SHADOW_X509_up_ref +#define X509V3_add1_i2d GRPC_SHADOW_X509V3_add1_i2d +#define X509v3_add_ext GRPC_SHADOW_X509v3_add_ext +#define X509V3_add_standard_extensions GRPC_SHADOW_X509V3_add_standard_extensions +#define X509V3_add_value GRPC_SHADOW_X509V3_add_value +#define X509V3_add_value_bool GRPC_SHADOW_X509V3_add_value_bool +#define X509V3_add_value_bool_nf GRPC_SHADOW_X509V3_add_value_bool_nf +#define X509V3_add_value_int GRPC_SHADOW_X509V3_add_value_int +#define X509V3_add_value_uchar GRPC_SHADOW_X509V3_add_value_uchar +#define x509v3_bytes_to_hex GRPC_SHADOW_x509v3_bytes_to_hex +#define X509V3_conf_free GRPC_SHADOW_X509V3_conf_free +#define X509v3_delete_ext GRPC_SHADOW_X509v3_delete_ext +#define X509V3_EXT_add GRPC_SHADOW_X509V3_EXT_add +#define X509V3_EXT_add_alias GRPC_SHADOW_X509V3_EXT_add_alias +#define X509V3_EXT_add_list GRPC_SHADOW_X509V3_EXT_add_list +#define X509V3_EXT_add_nconf GRPC_SHADOW_X509V3_EXT_add_nconf +#define X509V3_EXT_add_nconf_sk GRPC_SHADOW_X509V3_EXT_add_nconf_sk +#define X509V3_EXT_cleanup GRPC_SHADOW_X509V3_EXT_cleanup +#define X509V3_EXT_CRL_add_nconf GRPC_SHADOW_X509V3_EXT_CRL_add_nconf +#define X509V3_EXT_d2i GRPC_SHADOW_X509V3_EXT_d2i +#define X509V3_extensions_print GRPC_SHADOW_X509V3_extensions_print +#define X509V3_EXT_free GRPC_SHADOW_X509V3_EXT_free +#define X509V3_EXT_get GRPC_SHADOW_X509V3_EXT_get +#define X509V3_EXT_get_nid GRPC_SHADOW_X509V3_EXT_get_nid +#define X509V3_EXT_i2d GRPC_SHADOW_X509V3_EXT_i2d +#define X509V3_EXT_nconf GRPC_SHADOW_X509V3_EXT_nconf +#define X509V3_EXT_nconf_nid GRPC_SHADOW_X509V3_EXT_nconf_nid +#define X509V3_EXT_print GRPC_SHADOW_X509V3_EXT_print +#define X509V3_EXT_print_fp GRPC_SHADOW_X509V3_EXT_print_fp +#define X509V3_EXT_REQ_add_nconf GRPC_SHADOW_X509V3_EXT_REQ_add_nconf +#define X509V3_EXT_val_prn GRPC_SHADOW_X509V3_EXT_val_prn +#define X509V3_get_d2i GRPC_SHADOW_X509V3_get_d2i +#define X509v3_get_ext GRPC_SHADOW_X509v3_get_ext +#define X509v3_get_ext_by_critical GRPC_SHADOW_X509v3_get_ext_by_critical +#define X509v3_get_ext_by_NID GRPC_SHADOW_X509v3_get_ext_by_NID +#define X509v3_get_ext_by_OBJ GRPC_SHADOW_X509v3_get_ext_by_OBJ +#define X509v3_get_ext_count GRPC_SHADOW_X509v3_get_ext_count +#define X509V3_get_section GRPC_SHADOW_X509V3_get_section +#define X509V3_get_string GRPC_SHADOW_X509V3_get_string +#define X509V3_get_value_bool GRPC_SHADOW_X509V3_get_value_bool +#define X509V3_get_value_int GRPC_SHADOW_X509V3_get_value_int +#define x509v3_hex_to_bytes GRPC_SHADOW_x509v3_hex_to_bytes +#define x509v3_looks_like_dns_name GRPC_SHADOW_x509v3_looks_like_dns_name +#define x509v3_name_cmp GRPC_SHADOW_x509v3_name_cmp +#define X509V3_NAME_from_section GRPC_SHADOW_X509V3_NAME_from_section +#define X509V3_parse_list GRPC_SHADOW_X509V3_parse_list +#define X509V3_section_free GRPC_SHADOW_X509V3_section_free +#define X509V3_set_ctx GRPC_SHADOW_X509V3_set_ctx +#define X509V3_set_nconf GRPC_SHADOW_X509V3_set_nconf +#define X509V3_string_free GRPC_SHADOW_X509V3_string_free +#define X509_VAL_free GRPC_SHADOW_X509_VAL_free +#define X509_VAL_it GRPC_SHADOW_X509_VAL_it +#define X509_VAL_new GRPC_SHADOW_X509_VAL_new +#define X509_verify GRPC_SHADOW_X509_verify +#define X509_verify_cert GRPC_SHADOW_X509_verify_cert +#define X509_verify_cert_error_string GRPC_SHADOW_X509_verify_cert_error_string +#define X509_VERIFY_PARAM_add0_policy GRPC_SHADOW_X509_VERIFY_PARAM_add0_policy +#define X509_VERIFY_PARAM_add0_table GRPC_SHADOW_X509_VERIFY_PARAM_add0_table +#define X509_VERIFY_PARAM_add1_host GRPC_SHADOW_X509_VERIFY_PARAM_add1_host +#define X509_VERIFY_PARAM_clear_flags GRPC_SHADOW_X509_VERIFY_PARAM_clear_flags +#define X509_VERIFY_PARAM_free GRPC_SHADOW_X509_VERIFY_PARAM_free +#define X509_VERIFY_PARAM_get0 GRPC_SHADOW_X509_VERIFY_PARAM_get0 +#define X509_VERIFY_PARAM_get0_name GRPC_SHADOW_X509_VERIFY_PARAM_get0_name +#define X509_VERIFY_PARAM_get0_peername GRPC_SHADOW_X509_VERIFY_PARAM_get0_peername +#define X509_VERIFY_PARAM_get_count GRPC_SHADOW_X509_VERIFY_PARAM_get_count +#define X509_VERIFY_PARAM_get_depth GRPC_SHADOW_X509_VERIFY_PARAM_get_depth +#define X509_VERIFY_PARAM_get_flags GRPC_SHADOW_X509_VERIFY_PARAM_get_flags +#define X509_VERIFY_PARAM_inherit GRPC_SHADOW_X509_VERIFY_PARAM_inherit +#define X509_VERIFY_PARAM_lookup GRPC_SHADOW_X509_VERIFY_PARAM_lookup +#define X509_VERIFY_PARAM_new GRPC_SHADOW_X509_VERIFY_PARAM_new +#define X509_VERIFY_PARAM_set1 GRPC_SHADOW_X509_VERIFY_PARAM_set1 +#define X509_VERIFY_PARAM_set1_email GRPC_SHADOW_X509_VERIFY_PARAM_set1_email +#define X509_VERIFY_PARAM_set1_host GRPC_SHADOW_X509_VERIFY_PARAM_set1_host +#define X509_VERIFY_PARAM_set1_ip GRPC_SHADOW_X509_VERIFY_PARAM_set1_ip +#define X509_VERIFY_PARAM_set1_ip_asc GRPC_SHADOW_X509_VERIFY_PARAM_set1_ip_asc +#define X509_VERIFY_PARAM_set1_name GRPC_SHADOW_X509_VERIFY_PARAM_set1_name +#define X509_VERIFY_PARAM_set1_policies GRPC_SHADOW_X509_VERIFY_PARAM_set1_policies +#define X509_VERIFY_PARAM_set_depth GRPC_SHADOW_X509_VERIFY_PARAM_set_depth +#define X509_VERIFY_PARAM_set_flags GRPC_SHADOW_X509_VERIFY_PARAM_set_flags +#define X509_VERIFY_PARAM_set_hostflags GRPC_SHADOW_X509_VERIFY_PARAM_set_hostflags +#define X509_VERIFY_PARAM_set_purpose GRPC_SHADOW_X509_VERIFY_PARAM_set_purpose +#define X509_VERIFY_PARAM_set_time GRPC_SHADOW_X509_VERIFY_PARAM_set_time +#define X509_VERIFY_PARAM_set_trust GRPC_SHADOW_X509_VERIFY_PARAM_set_trust +#define X509_VERIFY_PARAM_table_cleanup GRPC_SHADOW_X509_VERIFY_PARAM_table_cleanup diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.debug.xcconfig b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.debug.xcconfig new file mode 100644 index 0000000..31117a2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.debug.xcconfig @@ -0,0 +1,11 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/BoringSSL-GRPC +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.modulemap b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.modulemap new file mode 100644 index 0000000..283008b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.modulemap @@ -0,0 +1,6 @@ + framework module openssl { + umbrella header "umbrella.h" + textual header "arm_arch.h" + export * + module * { export * } + } diff --git a/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.release.xcconfig b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.release.xcconfig new file mode 100644 index 0000000..31117a2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC.release.xcconfig @@ -0,0 +1,11 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/BoringSSL-GRPC +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/Firebase/Firebase.debug.xcconfig b/SaraAttended/Pods/Target Support Files/Firebase/Firebase.debug.xcconfig new file mode 100644 index 0000000..1dd8c34 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Firebase/Firebase.debug.xcconfig @@ -0,0 +1,13 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Firebase +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Firebase" "${PODS_ROOT}/Headers/Public" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Firebase +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/Firebase/Firebase.release.xcconfig b/SaraAttended/Pods/Target Support Files/Firebase/Firebase.release.xcconfig new file mode 100644 index 0000000..1dd8c34 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Firebase/Firebase.release.xcconfig @@ -0,0 +1,13 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Firebase +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Firebase" "${PODS_ROOT}/Headers/Public" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Firebase +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-Info.plist b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-Info.plist new file mode 100644 index 0000000..fa0a316 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 8.9.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m new file mode 100644 index 0000000..4f1eb27 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FirebaseCore : NSObject +@end +@implementation PodsDummy_FirebaseCore +@end diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h new file mode 100644 index 0000000..0f96d94 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h @@ -0,0 +1,22 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "FIRApp.h" +#import "FIRConfiguration.h" +#import "FirebaseCore.h" +#import "FIRLoggerLevel.h" +#import "FIROptions.h" +#import "FIRVersion.h" + +FOUNDATION_EXPORT double FirebaseCoreVersionNumber; +FOUNDATION_EXPORT const unsigned char FirebaseCoreVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.debug.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.debug.xcconfig new file mode 100644 index 0000000..356c867 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.debug.xcconfig @@ -0,0 +1,16 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 Firebase_VERSION=8.9.1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_CFLAGS = $(inherited) -fno-autolink +OTHER_LDFLAGS = $(inherited) -framework "FirebaseCoreDiagnostics" -framework "Foundation" -framework "GoogleUtilities" -framework "Security" -framework "UIKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseCore +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap new file mode 100644 index 0000000..4c38b87 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap @@ -0,0 +1,6 @@ +framework module FirebaseCore { + umbrella header "FirebaseCore-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.release.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.release.xcconfig new file mode 100644 index 0000000..356c867 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCore/FirebaseCore.release.xcconfig @@ -0,0 +1,16 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 Firebase_VERSION=8.9.1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_CFLAGS = $(inherited) -fno-autolink +OTHER_LDFLAGS = $(inherited) -framework "FirebaseCoreDiagnostics" -framework "Foundation" -framework "GoogleUtilities" -framework "Security" -framework "UIKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseCore +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-Info.plist b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-Info.plist new file mode 100644 index 0000000..fe51ae9 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 8.9.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-dummy.m b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-dummy.m new file mode 100644 index 0000000..224d263 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FirebaseCoreDiagnostics : NSObject +@end +@implementation PodsDummy_FirebaseCoreDiagnostics +@end diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-umbrella.h b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-umbrella.h new file mode 100644 index 0000000..a27569f --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics-umbrella.h @@ -0,0 +1,17 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "FIRCoreDiagnostics.h" + +FOUNDATION_EXPORT double FirebaseCoreDiagnosticsVersionNumber; +FOUNDATION_EXPORT const unsigned char FirebaseCoreDiagnosticsVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.debug.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.debug.xcconfig new file mode 100644 index 0000000..e5b1e9a --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.debug.xcconfig @@ -0,0 +1,17 @@ +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +GCC_TREAT_WARNINGS_AS_ERRORS = YES +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_LDFLAGS = $(inherited) -framework "CoreTelephony" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseCoreDiagnostics +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap new file mode 100644 index 0000000..d9cad8b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap @@ -0,0 +1,6 @@ +framework module FirebaseCoreDiagnostics { + umbrella header "FirebaseCoreDiagnostics-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.release.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.release.xcconfig new file mode 100644 index 0000000..e5b1e9a --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.release.xcconfig @@ -0,0 +1,17 @@ +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +GCC_TREAT_WARNINGS_AS_ERRORS = YES +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_LDFLAGS = $(inherited) -framework "CoreTelephony" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseCoreDiagnostics +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-Info.plist b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-Info.plist new file mode 100644 index 0000000..fa0a316 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 8.9.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-dummy.m b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-dummy.m new file mode 100644 index 0000000..42df0f9 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FirebaseFirestore : NSObject +@end +@implementation PodsDummy_FirebaseFirestore +@end diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-umbrella.h b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-umbrella.h new file mode 100644 index 0000000..65da55b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore-umbrella.h @@ -0,0 +1,36 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "FIRCollectionReference.h" +#import "FIRDocumentChange.h" +#import "FIRDocumentReference.h" +#import "FIRDocumentSnapshot.h" +#import "FirebaseFirestore.h" +#import "FIRFieldPath.h" +#import "FIRFieldValue.h" +#import "FIRFirestore.h" +#import "FIRFirestoreErrors.h" +#import "FIRFirestoreSettings.h" +#import "FIRFirestoreSource.h" +#import "FIRGeoPoint.h" +#import "FIRListenerRegistration.h" +#import "FIRLoadBundleTask.h" +#import "FIRQuery.h" +#import "FIRQuerySnapshot.h" +#import "FIRSnapshotMetadata.h" +#import "FIRTimestamp.h" +#import "FIRTransaction.h" +#import "FIRWriteBatch.h" + +FOUNDATION_EXPORT double FirebaseFirestoreVersionNumber; +FOUNDATION_EXPORT const unsigned char FirebaseFirestoreVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.debug.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.debug.xcconfig new file mode 100644 index 0000000..336023b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.debug.xcconfig @@ -0,0 +1,16 @@ +CLANG_CXX_LANGUAGE_STANDARD = c++0x +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 FIRFirestore_VERSION=8.9.1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" "${PODS_TARGET_SRCROOT}/Firestore/Source/Public/FirebaseFirestore" "${PODS_ROOT}/nanopb" "${PODS_TARGET_SRCROOT}/Firestore/Protos/nanopb" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "FirebaseCore" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit" -framework "absl" -framework "grpcpp" -framework "leveldb" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseFirestore +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.modulemap b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.modulemap new file mode 100644 index 0000000..1713ae3 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.modulemap @@ -0,0 +1,6 @@ +framework module FirebaseFirestore { + umbrella header "FirebaseFirestore-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.release.xcconfig b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.release.xcconfig new file mode 100644 index 0000000..336023b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/FirebaseFirestore/FirebaseFirestore.release.xcconfig @@ -0,0 +1,16 @@ +CLANG_CXX_LANGUAGE_STANDARD = c++0x +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 FIRFirestore_VERSION=8.9.1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" "${PODS_TARGET_SRCROOT}/Firestore/Source/Public/FirebaseFirestore" "${PODS_ROOT}/nanopb" "${PODS_TARGET_SRCROOT}/Firestore/Protos/nanopb" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "FirebaseCore" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit" -framework "absl" -framework "grpcpp" -framework "leveldb" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseFirestore +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-Info.plist b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-Info.plist new file mode 100644 index 0000000..4be429b --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 9.1.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-dummy.m b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-dummy.m new file mode 100644 index 0000000..9a08ec3 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_GoogleDataTransport : NSObject +@end +@implementation PodsDummy_GoogleDataTransport +@end diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-umbrella.h b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-umbrella.h new file mode 100644 index 0000000..53d9138 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport-umbrella.h @@ -0,0 +1,25 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "GDTCORClock.h" +#import "GDTCORConsoleLogger.h" +#import "GDTCOREndpoints.h" +#import "GDTCOREvent.h" +#import "GDTCOREventDataObject.h" +#import "GDTCOREventTransformer.h" +#import "GDTCORTargets.h" +#import "GDTCORTransport.h" +#import "GoogleDataTransport.h" + +FOUNDATION_EXPORT double GoogleDataTransportVersionNumber; +FOUNDATION_EXPORT const unsigned char GoogleDataTransportVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.debug.xcconfig b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.debug.xcconfig new file mode 100644 index 0000000..656e7c2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.debug.xcconfig @@ -0,0 +1,16 @@ +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 GDTCOR_VERSION=9.1.2 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}/" +OTHER_LDFLAGS = $(inherited) -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleDataTransport +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.modulemap b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.modulemap new file mode 100644 index 0000000..8a67414 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.modulemap @@ -0,0 +1,6 @@ +framework module GoogleDataTransport { + umbrella header "GoogleDataTransport-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.release.xcconfig b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.release.xcconfig new file mode 100644 index 0000000..656e7c2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleDataTransport/GoogleDataTransport.release.xcconfig @@ -0,0 +1,16 @@ +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 GDTCOR_VERSION=9.1.2 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}/" +OTHER_LDFLAGS = $(inherited) -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleDataTransport +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-Info.plist b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-Info.plist new file mode 100644 index 0000000..98e56b3 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 7.6.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-dummy.m b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-dummy.m new file mode 100644 index 0000000..98ac4e9 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_GoogleUtilities : NSObject +@end +@implementation PodsDummy_GoogleUtilities +@end diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-umbrella.h b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-umbrella.h new file mode 100644 index 0000000..d3167fd --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities-umbrella.h @@ -0,0 +1,27 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "GULAppEnvironmentUtil.h" +#import "GULHeartbeatDateStorable.h" +#import "GULHeartbeatDateStorage.h" +#import "GULHeartbeatDateStorageUserDefaults.h" +#import "GULKeychainStorage.h" +#import "GULKeychainUtils.h" +#import "GULSecureCoding.h" +#import "GULURLSessionDataResponse.h" +#import "NSURLSession+GULPromises.h" +#import "GULLogger.h" +#import "GULLoggerLevel.h" + +FOUNDATION_EXPORT double GoogleUtilitiesVersionNumber; +FOUNDATION_EXPORT const unsigned char GoogleUtilitiesVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.debug.xcconfig b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.debug.xcconfig new file mode 100644 index 0000000..02e34e2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.debug.xcconfig @@ -0,0 +1,15 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_LDFLAGS = $(inherited) -framework "FBLPromises" -framework "Security" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleUtilities +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.modulemap b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.modulemap new file mode 100644 index 0000000..491dd0a --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.modulemap @@ -0,0 +1,6 @@ +framework module GoogleUtilities { + umbrella header "GoogleUtilities-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.release.xcconfig b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.release.xcconfig new file mode 100644 index 0000000..02e34e2 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/GoogleUtilities/GoogleUtilities.release.xcconfig @@ -0,0 +1,15 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" +GCC_C_LANGUAGE_STANDARD = c99 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}" +OTHER_LDFLAGS = $(inherited) -framework "FBLPromises" -framework "Security" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleUtilities +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-Info.plist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.markdown b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.markdown new file mode 100644 index 0000000..c269799 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.markdown @@ -0,0 +1,2419 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## BoringSSL-GRPC + +BoringSSL is a fork of OpenSSL. As such, large parts of it fall under OpenSSL +licensing. Files that are completely new have a Google copyright and an ISC +license. This license is reproduced at the bottom of this file. + +Contributors to BoringSSL are required to follow the CLA rules for Chromium: +https://cla.developers.google.com/clas + +Files in third_party/ have their own licenses, as described therein. The MIT +license, for third_party/fiat, which, unlike other third_party directories, is +compiled into non-test libraries, is included below. + +The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the +OpenSSL License and the original SSLeay license apply to the toolkit. See below +for the actual license texts. Actually both licenses are BSD-style Open Source +licenses. In case of any license issues related to OpenSSL please contact +openssl-core@openssl.org. + +The following are Google-internal bug numbers where explicit permission from +some authors is recorded for use of their work. (This is purely for our own +record keeping.) + 27287199 + 27287880 + 27287883 + + OpenSSL License + --------------- + +/* ==================================================================== + * 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). + * + */ + + Original SSLeay License + ----------------------- + +/* 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.] + */ + + +ISC license used for completely new code in BoringSSL: + +/* 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. */ + + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +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. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + +## Firebase + + + 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. + + +## FirebaseCore + + + 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. + + +## FirebaseCoreDiagnostics + + + 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. + + +## FirebaseFirestore + + + 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. + + +## GoogleDataTransport + + + 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. + + +## GoogleUtilities + + + 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. + +================================================================================ + +The following copyright from Landon J. Fuller applies to the isAppEncrypted +function in Environment/third_party/GULAppEnvironmentUtil.m. + +Copyright (c) 2017 Landon J. Fuller +All rights reserved. + +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. + +Comment from +iPhone Dev Wiki +Crack Prevention: App Store binaries are signed by both their developer +and Apple. This encrypts the binary so that decryption keys are needed in order +to make the binary readable. When iOS executes the binary, the decryption keys +are used to decrypt the binary into a readable state where it is then loaded +into memory and executed. iOS can tell the encryption status of a binary via the +cryptid structure member of LC_ENCRYPTION_INFO MachO load command. If cryptid is +a non-zero value then the binary is encrypted. + +'Cracking' works by letting the kernel decrypt the binary then siphoning the +decrypted data into a new binary file, resigning, and repackaging. This will +only work on jailbroken devices as codesignature validation has been removed. +Resigning takes place because while the codesignature doesn't have to be valid +thanks to the jailbreak, it does have to be in place unless you have AppSync or +similar to disable codesignature checks. + +More information at Landon +Fuller's blog + + +## PromisesObjC + + + 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. + + +## abseil + + + Apache License + Version 2.0, January 2004 + https://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 + + 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. + + + +## gRPC-C++ + + + 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. + + +## gRPC-Core + + + 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. + + +## leveldb-library + +Copyright (c) 2011 The LevelDB Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + +## nanopb + +Copyright (c) 2011 Petteri Aimonen + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + +Generated by CocoaPods - https://cocoapods.org diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.plist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.plist new file mode 100644 index 0000000..ab91072 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-acknowledgements.plist @@ -0,0 +1,2523 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + BoringSSL is a fork of OpenSSL. As such, large parts of it fall under OpenSSL +licensing. Files that are completely new have a Google copyright and an ISC +license. This license is reproduced at the bottom of this file. + +Contributors to BoringSSL are required to follow the CLA rules for Chromium: +https://cla.developers.google.com/clas + +Files in third_party/ have their own licenses, as described therein. The MIT +license, for third_party/fiat, which, unlike other third_party directories, is +compiled into non-test libraries, is included below. + +The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the +OpenSSL License and the original SSLeay license apply to the toolkit. See below +for the actual license texts. Actually both licenses are BSD-style Open Source +licenses. In case of any license issues related to OpenSSL please contact +openssl-core@openssl.org. + +The following are Google-internal bug numbers where explicit permission from +some authors is recorded for use of their work. (This is purely for our own +record keeping.) + 27287199 + 27287880 + 27287883 + + OpenSSL License + --------------- + +/* ==================================================================== + * 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). + * + */ + + Original SSLeay License + ----------------------- + +/* 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.] + */ + + +ISC license used for completely new code in BoringSSL: + +/* 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. */ + + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +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. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + License + Mixed + Title + BoringSSL-GRPC + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + Firebase + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + FirebaseCore + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + FirebaseCoreDiagnostics + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + FirebaseFirestore + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + GoogleDataTransport + Type + PSGroupSpecifier + + + FooterText + + 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. + +================================================================================ + +The following copyright from Landon J. Fuller applies to the isAppEncrypted +function in Environment/third_party/GULAppEnvironmentUtil.m. + +Copyright (c) 2017 Landon J. Fuller <landon@landonf.org> +All rights reserved. + +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. + +Comment from +<a href="http://iphonedevwiki.net/index.php/Crack_prevention">iPhone Dev Wiki +Crack Prevention</a>: App Store binaries are signed by both their developer +and Apple. This encrypts the binary so that decryption keys are needed in order +to make the binary readable. When iOS executes the binary, the decryption keys +are used to decrypt the binary into a readable state where it is then loaded +into memory and executed. iOS can tell the encryption status of a binary via the +cryptid structure member of LC_ENCRYPTION_INFO MachO load command. If cryptid is +a non-zero value then the binary is encrypted. + +'Cracking' works by letting the kernel decrypt the binary then siphoning the +decrypted data into a new binary file, resigning, and repackaging. This will +only work on jailbroken devices as codesignature validation has been removed. +Resigning takes place because while the codesignature doesn't have to be valid +thanks to the jailbreak, it does have to be in place unless you have AppSync or +similar to disable codesignature checks. + +More information at <a href="http://landonf.org/2009/02/index.html">Landon +Fuller's blog</a> + + License + Apache + Title + GoogleUtilities + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache + Title + PromisesObjC + Type + PSGroupSpecifier + + + FooterText + + Apache License + Version 2.0, January 2004 + https://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 + + 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. + + + License + Apache License, Version 2.0 + Title + abseil + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache License, Version 2.0 + Title + gRPC-C++ + Type + PSGroupSpecifier + + + FooterText + + 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. + + License + Apache License, Version 2.0 + Title + gRPC-Core + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011 The LevelDB Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"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 COPYRIGHT +OWNER 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. + + License + New BSD + Title + leveldb-library + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi> + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + + License + zlib + Title + nanopb + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-dummy.m b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-dummy.m new file mode 100644 index 0000000..3d90bb0 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SaraAttended : NSObject +@end +@implementation PodsDummy_Pods_SaraAttended +@end diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-input-files.xcfilelist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-input-files.xcfilelist new file mode 100644 index 0000000..dc90923 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-input-files.xcfilelist @@ -0,0 +1,13 @@ +${PODS_ROOT}/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks.sh +${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework +${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework +${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework +${BUILT_PRODUCTS_DIR}/FirebaseFirestore/FirebaseFirestore.framework +${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework +${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework +${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework +${BUILT_PRODUCTS_DIR}/abseil/absl.framework +${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework +${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework +${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework +${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework \ No newline at end of file diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-output-files.xcfilelist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-output-files.xcfilelist new file mode 100644 index 0000000..f968208 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Debug-output-files.xcfilelist @@ -0,0 +1,12 @@ +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseFirestore.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/absl.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpcpp.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework \ No newline at end of file diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-input-files.xcfilelist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-input-files.xcfilelist new file mode 100644 index 0000000..dc90923 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-input-files.xcfilelist @@ -0,0 +1,13 @@ +${PODS_ROOT}/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks.sh +${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework +${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework +${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework +${BUILT_PRODUCTS_DIR}/FirebaseFirestore/FirebaseFirestore.framework +${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework +${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework +${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework +${BUILT_PRODUCTS_DIR}/abseil/absl.framework +${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework +${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework +${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework +${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework \ No newline at end of file diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-output-files.xcfilelist b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-output-files.xcfilelist new file mode 100644 index 0000000..f968208 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks-Release-output-files.xcfilelist @@ -0,0 +1,12 @@ +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseFirestore.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/absl.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpcpp.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework \ No newline at end of file diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks.sh b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks.sh new file mode 100755 index 0000000..73adddc --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-frameworks.sh @@ -0,0 +1,208 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +function on_error { + echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" +} +trap 'on_error $LINENO' ERR + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +BCSYMBOLMAP_DIR="BCSymbolMaps" + + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then + # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied + find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do + echo "Installing $f" + install_bcsymbolmap "$f" "$destination" + rm "$f" + done + rmdir "${source}/${BCSYMBOLMAP_DIR}" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + elif [ -L "${binary}" ]; then + echo "Destination binary is symlinked..." + dirname="$(dirname "${binary}")" + binary="${dirname}/$(readlink "${binary}")" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + warn_missing_arch=${2:-true} + if [ -r "$source" ]; then + # Copy the dSYM into the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .dSYM "$source")" + binary_name="$(ls "$source/Contents/Resources/DWARF")" + binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" + + # Strip invalid architectures from the dSYM. + if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then + strip_invalid_archs "$binary" "$warn_missing_arch" + fi + if [[ $STRIP_BINARY_RETVAL == 0 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + mkdir -p "${DWARF_DSYM_FOLDER_PATH}" + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" + fi + fi +} + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + warn_missing_arch=${2:-true} + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + if [[ "$warn_missing_arch" == "true" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + fi + STRIP_BINARY_RETVAL=1 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=0 +} + +# Copies the bcsymbolmap files of a vendored framework +install_bcsymbolmap() { + local bcsymbolmap_path="$1" + local destination="${BUILT_PRODUCTS_DIR}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identity + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseFirestore/FirebaseFirestore.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework" + install_framework "${BUILT_PRODUCTS_DIR}/abseil/absl.framework" + install_framework "${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework" + install_framework "${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework" + install_framework "${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework" + install_framework "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FirebaseFirestore/FirebaseFirestore.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework" + install_framework "${BUILT_PRODUCTS_DIR}/abseil/absl.framework" + install_framework "${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework" + install_framework "${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework" + install_framework "${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework" + install_framework "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-umbrella.h b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-umbrella.h new file mode 100644 index 0000000..b764e1e --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SaraAttendedVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SaraAttendedVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.debug.xcconfig b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.debug.xcconfig new file mode 100644 index 0000000..9b848d7 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.debug.xcconfig @@ -0,0 +1,12 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC/openssl_grpc.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore/FirebaseFirestore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/abseil/absl.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++/grpcpp.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core/grpc.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library/leveldb.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseFirestore" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "absl" -framework "grpc" -framework "grpcpp" -framework "leveldb" -framework "nanopb" -framework "openssl_grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.modulemap b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.modulemap new file mode 100644 index 0000000..8825e58 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SaraAttended { + umbrella header "Pods-SaraAttended-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.release.xcconfig b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.release.xcconfig new file mode 100644 index 0000000..9b848d7 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/Pods-SaraAttended/Pods-SaraAttended.release.xcconfig @@ -0,0 +1,12 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC/openssl_grpc.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore/FirebaseFirestore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/abseil/absl.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++/grpcpp.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core/grpc.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library/leveldb.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseFirestore" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "absl" -framework "grpc" -framework "grpcpp" -framework "leveldb" -framework "nanopb" -framework "openssl_grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-Info.plist b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-Info.plist new file mode 100644 index 0000000..0a12077 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-dummy.m b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-dummy.m new file mode 100644 index 0000000..ab1f210 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PromisesObjC : NSObject +@end +@implementation PodsDummy_PromisesObjC +@end diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-umbrella.h b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-umbrella.h new file mode 100644 index 0000000..5b014a8 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC-umbrella.h @@ -0,0 +1,36 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "FBLPromise+All.h" +#import "FBLPromise+Always.h" +#import "FBLPromise+Any.h" +#import "FBLPromise+Async.h" +#import "FBLPromise+Await.h" +#import "FBLPromise+Catch.h" +#import "FBLPromise+Delay.h" +#import "FBLPromise+Do.h" +#import "FBLPromise+Race.h" +#import "FBLPromise+Recover.h" +#import "FBLPromise+Reduce.h" +#import "FBLPromise+Retry.h" +#import "FBLPromise+Testing.h" +#import "FBLPromise+Then.h" +#import "FBLPromise+Timeout.h" +#import "FBLPromise+Validate.h" +#import "FBLPromise+Wrap.h" +#import "FBLPromise.h" +#import "FBLPromiseError.h" +#import "FBLPromises.h" + +FOUNDATION_EXPORT double FBLPromisesVersionNumber; +FOUNDATION_EXPORT const unsigned char FBLPromisesVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.debug.xcconfig b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.debug.xcconfig new file mode 100644 index 0000000..1f5ad57 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.debug.xcconfig @@ -0,0 +1,12 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromisesObjC +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.modulemap b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.modulemap new file mode 100644 index 0000000..7d485cd --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.modulemap @@ -0,0 +1,6 @@ +framework module FBLPromises { + umbrella header "PromisesObjC-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.release.xcconfig b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.release.xcconfig new file mode 100644 index 0000000..1f5ad57 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/PromisesObjC/PromisesObjC.release.xcconfig @@ -0,0 +1,12 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromisesObjC +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil-Info.plist b/SaraAttended/Pods/Target Support Files/abseil/abseil-Info.plist new file mode 100644 index 0000000..19dc877 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.20200225.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil-dummy.m b/SaraAttended/Pods/Target Support Files/abseil/abseil-dummy.m new file mode 100644 index 0000000..91c97c1 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_abseil : NSObject +@end +@implementation PodsDummy_abseil +@end diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil-prefix.pch b/SaraAttended/Pods/Target Support Files/abseil/abseil-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil-umbrella.h b/SaraAttended/Pods/Target Support Files/abseil/abseil-umbrella.h new file mode 100644 index 0000000..06dc0b3 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil-umbrella.h @@ -0,0 +1,173 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "algorithm/algorithm.h" +#import "algorithm/container.h" +#import "base/internal/atomic_hook.h" +#import "base/call_once.h" +#import "base/casts.h" +#import "base/internal/cycleclock.h" +#import "base/internal/low_level_scheduling.h" +#import "base/internal/per_thread_tls.h" +#import "base/internal/spinlock.h" +#import "base/internal/sysinfo.h" +#import "base/internal/thread_identity.h" +#import "base/internal/tsan_mutex_interface.h" +#import "base/internal/unscaledcycleclock.h" +#import "base/internal/hide_ptr.h" +#import "base/internal/identity.h" +#import "base/internal/inline_variable.h" +#import "base/internal/invoke.h" +#import "base/internal/scheduling_mode.h" +#import "base/internal/bits.h" +#import "base/config.h" +#import "base/options.h" +#import "base/policy_checks.h" +#import "base/attributes.h" +#import "base/const_init.h" +#import "base/internal/thread_annotations.h" +#import "base/macros.h" +#import "base/optimization.h" +#import "base/port.h" +#import "base/thread_annotations.h" +#import "base/dynamic_annotations.h" +#import "base/internal/endian.h" +#import "base/internal/unaligned_access.h" +#import "base/internal/errno_saver.h" +#import "base/internal/exponential_biased.h" +#import "base/log_severity.h" +#import "base/internal/direct_mmap.h" +#import "base/internal/low_level_alloc.h" +#import "base/internal/periodic_sampler.h" +#import "base/internal/pretty_function.h" +#import "base/internal/raw_logging.h" +#import "base/internal/spinlock_akaros.inc" +#import "base/internal/spinlock_linux.inc" +#import "base/internal/spinlock_posix.inc" +#import "base/internal/spinlock_wait.h" +#import "base/internal/spinlock_win32.inc" +#import "base/internal/throw_delegate.h" +#import "container/internal/common.h" +#import "container/internal/compressed_tuple.h" +#import "container/internal/container_memory.h" +#import "container/fixed_array.h" +#import "container/flat_hash_map.h" +#import "container/internal/hash_function_defaults.h" +#import "container/internal/hash_policy_traits.h" +#import "container/internal/hashtable_debug_hooks.h" +#import "container/internal/hashtablez_sampler.h" +#import "container/internal/have_sse.h" +#import "container/inlined_vector.h" +#import "container/internal/inlined_vector.h" +#import "container/internal/layout.h" +#import "container/internal/raw_hash_map.h" +#import "container/internal/raw_hash_set.h" +#import "debugging/internal/address_is_readable.h" +#import "debugging/internal/elf_mem_image.h" +#import "debugging/internal/vdso_support.h" +#import "debugging/internal/demangle.h" +#import "debugging/internal/stacktrace_aarch64-inl.inc" +#import "debugging/internal/stacktrace_arm-inl.inc" +#import "debugging/internal/stacktrace_config.h" +#import "debugging/internal/stacktrace_generic-inl.inc" +#import "debugging/internal/stacktrace_powerpc-inl.inc" +#import "debugging/internal/stacktrace_unimplemented-inl.inc" +#import "debugging/internal/stacktrace_win32-inl.inc" +#import "debugging/internal/stacktrace_x86-inl.inc" +#import "debugging/stacktrace.h" +#import "debugging/internal/symbolize.h" +#import "debugging/symbolize.h" +#import "debugging/symbolize_elf.inc" +#import "debugging/symbolize_unimplemented.inc" +#import "debugging/symbolize_win32.inc" +#import "hash/internal/city.h" +#import "hash/hash.h" +#import "hash/internal/hash.h" +#import "memory/memory.h" +#import "meta/type_traits.h" +#import "numeric/int128.h" +#import "numeric/int128_have_intrinsic.inc" +#import "numeric/int128_no_intrinsic.inc" +#import "strings/internal/char_map.h" +#import "strings/internal/escaping.h" +#import "strings/internal/ostringstream.h" +#import "strings/internal/resize_uninitialized.h" +#import "strings/internal/utf8.h" +#import "strings/str_format.h" +#import "strings/internal/str_format/arg.h" +#import "strings/internal/str_format/bind.h" +#import "strings/internal/str_format/checker.h" +#import "strings/internal/str_format/extension.h" +#import "strings/internal/str_format/float_conversion.h" +#import "strings/internal/str_format/output.h" +#import "strings/internal/str_format/parser.h" +#import "strings/ascii.h" +#import "strings/charconv.h" +#import "strings/escaping.h" +#import "strings/internal/charconv_bigint.h" +#import "strings/internal/charconv_parse.h" +#import "strings/internal/memutil.h" +#import "strings/internal/stl_type_traits.h" +#import "strings/internal/str_join_internal.h" +#import "strings/internal/str_split_internal.h" +#import "strings/match.h" +#import "strings/numbers.h" +#import "strings/str_cat.h" +#import "strings/str_join.h" +#import "strings/str_replace.h" +#import "strings/str_split.h" +#import "strings/string_view.h" +#import "strings/strip.h" +#import "strings/substitute.h" +#import "synchronization/internal/graphcycles.h" +#import "synchronization/internal/kernel_timeout.h" +#import "synchronization/barrier.h" +#import "synchronization/blocking_counter.h" +#import "synchronization/internal/create_thread_identity.h" +#import "synchronization/internal/mutex_nonprod.inc" +#import "synchronization/internal/per_thread_sem.h" +#import "synchronization/internal/waiter.h" +#import "synchronization/mutex.h" +#import "synchronization/notification.h" +#import "time/internal/cctz/include/cctz/civil_time.h" +#import "time/internal/cctz/include/cctz/civil_time_detail.h" +#import "time/internal/cctz/include/cctz/time_zone.h" +#import "time/internal/cctz/include/cctz/zone_info_source.h" +#import "time/internal/cctz/src/time_zone_fixed.h" +#import "time/internal/cctz/src/time_zone_if.h" +#import "time/internal/cctz/src/time_zone_impl.h" +#import "time/internal/cctz/src/time_zone_info.h" +#import "time/internal/cctz/src/time_zone_libc.h" +#import "time/internal/cctz/src/time_zone_posix.h" +#import "time/internal/cctz/src/tzfile.h" +#import "time/civil_time.h" +#import "time/clock.h" +#import "time/internal/get_current_time_chrono.inc" +#import "time/internal/get_current_time_posix.inc" +#import "time/time.h" +#import "types/any.h" +#import "types/bad_any_cast.h" +#import "types/bad_any_cast.h" +#import "types/bad_optional_access.h" +#import "types/bad_variant_access.h" +#import "types/compare.h" +#import "types/internal/optional.h" +#import "types/optional.h" +#import "types/internal/span.h" +#import "types/span.h" +#import "types/internal/variant.h" +#import "types/variant.h" +#import "utility/utility.h" + +FOUNDATION_EXPORT double abslVersionNumber; +FOUNDATION_EXPORT const unsigned char abslVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil.debug.xcconfig b/SaraAttended/Pods/Target Support Files/abseil/abseil.debug.xcconfig new file mode 100644 index 0000000..4bb3336 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil.debug.xcconfig @@ -0,0 +1,15 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/abseil +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = $(inherited) -l"c++" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/abseil +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = $(inherited) "$(PODS_TARGET_SRCROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil.modulemap b/SaraAttended/Pods/Target Support Files/abseil/abseil.modulemap new file mode 100644 index 0000000..a3eea8d --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil.modulemap @@ -0,0 +1,6 @@ +framework module absl { + umbrella header "abseil-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/abseil/abseil.release.xcconfig b/SaraAttended/Pods/Target Support Files/abseil/abseil.release.xcconfig new file mode 100644 index 0000000..4bb3336 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/abseil/abseil.release.xcconfig @@ -0,0 +1,15 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/abseil +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = $(inherited) -l"c++" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/abseil +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = $(inherited) "$(PODS_TARGET_SRCROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist b/SaraAttended/Pods/Target Support Files/gRPC-C++/ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist new file mode 100644 index 0000000..05bce5e --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/ResourceBundle-gRPCCertificates-Cpp-gRPC-C++-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.28.2 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-Info.plist b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-Info.plist new file mode 100644 index 0000000..eb452bd --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.28.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-dummy.m b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-dummy.m new file mode 100644 index 0000000..b8cbe56 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_gRPC_C__ : NSObject +@end +@implementation PodsDummy_gRPC_C__ +@end diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-prefix.pch b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-umbrella.h b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-umbrella.h new file mode 100644 index 0000000..21eb034 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++-umbrella.h @@ -0,0 +1,147 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "alarm.h" +#import "alarm_impl.h" +#import "channel.h" +#import "channel_impl.h" +#import "client_context.h" +#import "completion_queue.h" +#import "completion_queue_impl.h" +#import "create_channel.h" +#import "create_channel_impl.h" +#import "create_channel_posix.h" +#import "create_channel_posix_impl.h" +#import "ext/health_check_service_server_builder_option.h" +#import "generic/async_generic_service.h" +#import "generic/generic_stub.h" +#import "generic/generic_stub_impl.h" +#import "grpcpp.h" +#import "health_check_service_interface.h" +#import "health_check_service_interface_impl.h" +#import "impl/call.h" +#import "impl/channel_argument_option.h" +#import "impl/client_unary_call.h" +#import "impl/codegen/async_generic_service.h" +#import "impl/codegen/async_stream.h" +#import "impl/codegen/async_stream_impl.h" +#import "impl/codegen/async_unary_call.h" +#import "impl/codegen/async_unary_call_impl.h" +#import "impl/codegen/byte_buffer.h" +#import "impl/codegen/call.h" +#import "impl/codegen/call_hook.h" +#import "impl/codegen/call_op_set.h" +#import "impl/codegen/call_op_set_interface.h" +#import "impl/codegen/callback_common.h" +#import "impl/codegen/channel_interface.h" +#import "impl/codegen/client_callback.h" +#import "impl/codegen/client_callback_impl.h" +#import "impl/codegen/client_context.h" +#import "impl/codegen/client_context_impl.h" +#import "impl/codegen/client_interceptor.h" +#import "impl/codegen/client_unary_call.h" +#import "impl/codegen/completion_queue.h" +#import "impl/codegen/completion_queue_impl.h" +#import "impl/codegen/completion_queue_tag.h" +#import "impl/codegen/config.h" +#import "impl/codegen/core_codegen.h" +#import "impl/codegen/core_codegen_interface.h" +#import "impl/codegen/create_auth_context.h" +#import "impl/codegen/delegating_channel.h" +#import "impl/codegen/grpc_library.h" +#import "impl/codegen/intercepted_channel.h" +#import "impl/codegen/interceptor.h" +#import "impl/codegen/interceptor_common.h" +#import "impl/codegen/message_allocator.h" +#import "impl/codegen/metadata_map.h" +#import "impl/codegen/method_handler.h" +#import "impl/codegen/method_handler_impl.h" +#import "impl/codegen/rpc_method.h" +#import "impl/codegen/rpc_service_method.h" +#import "impl/codegen/security/auth_context.h" +#import "impl/codegen/serialization_traits.h" +#import "impl/codegen/server_callback.h" +#import "impl/codegen/server_callback_handlers.h" +#import "impl/codegen/server_callback_impl.h" +#import "impl/codegen/server_context.h" +#import "impl/codegen/server_context_impl.h" +#import "impl/codegen/server_interceptor.h" +#import "impl/codegen/server_interface.h" +#import "impl/codegen/service_type.h" +#import "impl/codegen/slice.h" +#import "impl/codegen/status.h" +#import "impl/codegen/status_code_enum.h" +#import "impl/codegen/string_ref.h" +#import "impl/codegen/stub_options.h" +#import "impl/codegen/sync.h" +#import "impl/codegen/sync_stream.h" +#import "impl/codegen/sync_stream_impl.h" +#import "impl/codegen/time.h" +#import "impl/grpc_library.h" +#import "impl/method_handler_impl.h" +#import "impl/rpc_method.h" +#import "impl/rpc_service_method.h" +#import "impl/serialization_traits.h" +#import "impl/server_builder_option.h" +#import "impl/server_builder_option_impl.h" +#import "impl/server_builder_plugin.h" +#import "impl/server_initializer.h" +#import "impl/server_initializer_impl.h" +#import "impl/service_type.h" +#import "resource_quota.h" +#import "resource_quota_impl.h" +#import "security/auth_context.h" +#import "security/auth_metadata_processor.h" +#import "security/auth_metadata_processor_impl.h" +#import "security/credentials.h" +#import "security/credentials_impl.h" +#import "security/server_credentials.h" +#import "security/server_credentials_impl.h" +#import "security/tls_credentials_options.h" +#import "server.h" +#import "server_builder.h" +#import "server_builder_impl.h" +#import "server_context.h" +#import "server_impl.h" +#import "server_posix.h" +#import "server_posix_impl.h" +#import "support/async_stream.h" +#import "support/async_stream_impl.h" +#import "support/async_unary_call.h" +#import "support/async_unary_call_impl.h" +#import "support/byte_buffer.h" +#import "support/channel_arguments.h" +#import "support/channel_arguments_impl.h" +#import "support/client_callback.h" +#import "support/client_callback_impl.h" +#import "support/client_interceptor.h" +#import "support/config.h" +#import "support/interceptor.h" +#import "support/message_allocator.h" +#import "support/proto_buffer_reader.h" +#import "support/proto_buffer_writer.h" +#import "support/server_callback.h" +#import "support/server_callback_impl.h" +#import "support/server_interceptor.h" +#import "support/slice.h" +#import "support/status.h" +#import "support/status_code_enum.h" +#import "support/string_ref.h" +#import "support/stub_options.h" +#import "support/sync_stream.h" +#import "support/sync_stream_impl.h" +#import "support/time.h" +#import "support/validate_service_config.h" + +FOUNDATION_EXPORT double grpcppVersionNumber; +FOUNDATION_EXPORT const unsigned char grpcppVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.debug.xcconfig b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.debug.xcconfig new file mode 100644 index 0000000..870da7a --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.debug.xcconfig @@ -0,0 +1,19 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_DOCUMENTATION_COMMENTS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_STRICT_PROTOTYPES = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "$(inherited)" "$(PODS_TARGET_SRCROOT)/include" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "absl" -framework "grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/gRPC-C++ +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = "$(PODS_TARGET_SRCROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.modulemap b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.modulemap new file mode 100644 index 0000000..9e4c2cc --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.modulemap @@ -0,0 +1,6 @@ +framework module grpcpp { + umbrella header "gRPC-C++-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.release.xcconfig b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.release.xcconfig new file mode 100644 index 0000000..870da7a --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-C++/gRPC-C++.release.xcconfig @@ -0,0 +1,19 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_DOCUMENTATION_COMMENTS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_STRICT_PROTOTYPES = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "$(inherited)" "$(PODS_TARGET_SRCROOT)/include" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "absl" -framework "grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/gRPC-C++ +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = "$(PODS_TARGET_SRCROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-Info.plist b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-Info.plist new file mode 100644 index 0000000..eb452bd --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.28.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-dummy.m b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-dummy.m new file mode 100644 index 0000000..5e59998 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_gRPC_Core : NSObject +@end +@implementation PodsDummy_gRPC_Core +@end diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-prefix.pch b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.debug.xcconfig b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.debug.xcconfig new file mode 100644 index 0000000..5fd0948 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.debug.xcconfig @@ -0,0 +1,19 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_STRICT_PROTOTYPES = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +GRPC_SRC_ROOT = $(PODS_ROOT)/gRPC-Core +HEADER_SEARCH_PATHS = "$(inherited)" "$(GRPC_SRC_ROOT)/include" +OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "absl" -framework "openssl_grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/gRPC-Core +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = "$(GRPC_SRC_ROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.modulemap b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.modulemap new file mode 100644 index 0000000..5e3b97e --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.modulemap @@ -0,0 +1,79 @@ + +framework module grpc { + umbrella header "grpc.h" + + header "support/alloc.h" + header "support/atm.h" + header "support/cpu.h" + header "support/log.h" + header "support/log_windows.h" + header "support/port_platform.h" + header "support/string_util.h" + header "support/sync.h" + header "support/sync_abseil.h" + header "support/sync_generic.h" + header "support/thd_id.h" + header "support/time.h" + header "impl/codegen/atm.h" + header "impl/codegen/fork.h" + header "impl/codegen/gpr_slice.h" + header "impl/codegen/gpr_types.h" + header "impl/codegen/log.h" + header "impl/codegen/port_platform.h" + header "impl/codegen/sync.h" + header "impl/codegen/sync_abseil.h" + header "impl/codegen/sync_generic.h" + header "impl/codegen/byte_buffer.h" + header "impl/codegen/byte_buffer_reader.h" + header "impl/codegen/compression_types.h" + header "impl/codegen/connectivity_state.h" + header "impl/codegen/grpc_types.h" + header "impl/codegen/propagation_bits.h" + header "impl/codegen/slice.h" + header "impl/codegen/status.h" + header "impl/codegen/atm.h" + header "impl/codegen/fork.h" + header "impl/codegen/gpr_slice.h" + header "impl/codegen/gpr_types.h" + header "impl/codegen/log.h" + header "impl/codegen/port_platform.h" + header "impl/codegen/sync.h" + header "impl/codegen/sync_abseil.h" + header "impl/codegen/sync_generic.h" + header "grpc_security.h" + header "byte_buffer.h" + header "byte_buffer_reader.h" + header "compression.h" + header "fork.h" + header "grpc.h" + header "grpc_posix.h" + header "grpc_security_constants.h" + header "load_reporting.h" + header "slice.h" + header "slice_buffer.h" + header "status.h" + header "support/workaround_list.h" + header "census.h" + + textual header "support/atm_gcc_atomic.h" + textual header "support/atm_gcc_sync.h" + textual header "support/atm_windows.h" + textual header "support/sync_custom.h" + textual header "support/sync_posix.h" + textual header "support/sync_windows.h" + textual header "impl/codegen/atm_gcc_atomic.h" + textual header "impl/codegen/atm_gcc_sync.h" + textual header "impl/codegen/atm_windows.h" + textual header "impl/codegen/sync_custom.h" + textual header "impl/codegen/sync_posix.h" + textual header "impl/codegen/sync_windows.h" + textual header "impl/codegen/atm_gcc_atomic.h" + textual header "impl/codegen/atm_gcc_sync.h" + textual header "impl/codegen/atm_windows.h" + textual header "impl/codegen/sync_custom.h" + textual header "impl/codegen/sync_posix.h" + textual header "impl/codegen/sync_windows.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.release.xcconfig b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.release.xcconfig new file mode 100644 index 0000000..5fd0948 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/gRPC-Core/gRPC-Core.release.xcconfig @@ -0,0 +1,19 @@ +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_STRICT_PROTOTYPES = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL-GRPC" "${PODS_CONFIGURATION_BUILD_DIR}/abseil" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +GRPC_SRC_ROOT = $(PODS_ROOT)/gRPC-Core +HEADER_SEARCH_PATHS = "$(inherited)" "$(GRPC_SRC_ROOT)/include" +OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "absl" -framework "openssl_grpc" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/gRPC-Core +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USER_HEADER_SEARCH_PATHS = "$(GRPC_SRC_ROOT)" +USE_HEADERMAP = NO +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-Info.plist b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-Info.plist new file mode 100644 index 0000000..0f6eb4f --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.22.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-dummy.m b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-dummy.m new file mode 100644 index 0000000..dba1492 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_leveldb_library : NSObject +@end +@implementation PodsDummy_leveldb_library +@end diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-prefix.pch b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-umbrella.h b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-umbrella.h new file mode 100644 index 0000000..6a45902 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library-umbrella.h @@ -0,0 +1,31 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "c.h" +#import "cache.h" +#import "comparator.h" +#import "db.h" +#import "dumpfile.h" +#import "env.h" +#import "export.h" +#import "filter_policy.h" +#import "iterator.h" +#import "options.h" +#import "slice.h" +#import "status.h" +#import "table.h" +#import "table_builder.h" +#import "write_batch.h" + +FOUNDATION_EXPORT double leveldbVersionNumber; +FOUNDATION_EXPORT const unsigned char leveldbVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.debug.xcconfig b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.debug.xcconfig new file mode 100644 index 0000000..ea1c640 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.debug.xcconfig @@ -0,0 +1,15 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LEVELDB_IS_BIG_ENDIAN=0 LEVELDB_PLATFORM_POSIX HAVE_FULLFSYNC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/leveldb-library" "${PODS_ROOT}/leveldb-library/include" +OTHER_LDFLAGS = $(inherited) -l"c++" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/leveldb-library +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_HEADERMAP = No +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES +WARNING_CFLAGS = -Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.modulemap b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.modulemap new file mode 100644 index 0000000..fd77435 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.modulemap @@ -0,0 +1,6 @@ +framework module leveldb { + umbrella header "leveldb-library-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.release.xcconfig b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.release.xcconfig new file mode 100644 index 0000000..ea1c640 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/leveldb-library/leveldb-library.release.xcconfig @@ -0,0 +1,15 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LEVELDB_IS_BIG_ENDIAN=0 LEVELDB_PLATFORM_POSIX HAVE_FULLFSYNC=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/leveldb-library" "${PODS_ROOT}/leveldb-library/include" +OTHER_LDFLAGS = $(inherited) -l"c++" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/leveldb-library +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_HEADERMAP = No +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES +WARNING_CFLAGS = -Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb-Info.plist b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-Info.plist new file mode 100644 index 0000000..658a7bf --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.30908.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb-dummy.m b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-dummy.m new file mode 100644 index 0000000..b3fa595 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_nanopb : NSObject +@end +@implementation PodsDummy_nanopb +@end diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb-prefix.pch b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb-umbrella.h b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-umbrella.h new file mode 100644 index 0000000..07e77b3 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb-umbrella.h @@ -0,0 +1,26 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "pb.h" +#import "pb_common.h" +#import "pb_decode.h" +#import "pb_encode.h" +#import "pb.h" +#import "pb_decode.h" +#import "pb_common.h" +#import "pb.h" +#import "pb_encode.h" +#import "pb_common.h" + +FOUNDATION_EXPORT double nanopbVersionNumber; +FOUNDATION_EXPORT const unsigned char nanopbVersionString[]; + diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb.debug.xcconfig b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.debug.xcconfig new file mode 100644 index 0000000..7156998 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.debug.xcconfig @@ -0,0 +1,11 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/nanopb +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/nanopb +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb.modulemap b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.modulemap new file mode 100644 index 0000000..e8d4b53 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.modulemap @@ -0,0 +1,6 @@ +framework module nanopb { + umbrella header "nanopb-umbrella.h" + + export * + module * { export * } +} diff --git a/SaraAttended/Pods/Target Support Files/nanopb/nanopb.release.xcconfig b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.release.xcconfig new file mode 100644 index 0000000..7156998 --- /dev/null +++ b/SaraAttended/Pods/Target Support Files/nanopb/nanopb.release.xcconfig @@ -0,0 +1,11 @@ +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/nanopb +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/nanopb +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/SaraAttended/Pods/abseil/LICENSE b/SaraAttended/Pods/abseil/LICENSE new file mode 100644 index 0000000..ccd61dc --- /dev/null +++ b/SaraAttended/Pods/abseil/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + https://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 + + 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. + diff --git a/SaraAttended/Pods/abseil/README.md b/SaraAttended/Pods/abseil/README.md new file mode 100644 index 0000000..85de569 --- /dev/null +++ b/SaraAttended/Pods/abseil/README.md @@ -0,0 +1,114 @@ +# Abseil - C++ Common Libraries + +The repository contains the Abseil C++ library code. Abseil is an open-source +collection of C++ code (compliant to C++11) designed to augment the C++ +standard library. + +## Table of Contents + +- [About Abseil](#about) +- [Quickstart](#quickstart) +- [Building Abseil](#build) +- [Codemap](#codemap) +- [License](#license) +- [Links](#links) + + +## About Abseil + +Abseil is an open-source collection of C++ library code designed to augment +the C++ standard library. The Abseil library code is collected from Google's +own C++ code base, has been extensively tested and used in production, and +is the same code we depend on in our daily coding lives. + +In some cases, Abseil provides pieces missing from the C++ standard; in +others, Abseil provides alternatives to the standard for special needs +we've found through usage in the Google code base. We denote those cases +clearly within the library code we provide you. + +Abseil is not meant to be a competitor to the standard library; we've +just found that many of these utilities serve a purpose within our code +base, and we now want to provide those resources to the C++ community as +a whole. + + +## Quickstart + +If you want to just get started, make sure you at least run through the +[Abseil Quickstart](https://abseil.io/docs/cpp/quickstart). The Quickstart +contains information about setting up your development environment, downloading +the Abseil code, running tests, and getting a simple binary working. + + +## Building Abseil + +[Bazel](https://bazel.build) is the official build system for Abseil, +which is supported on most major platforms (Linux, Windows, macOS, for example) +and compilers. See the [quickstart](https://abseil.io/docs/cpp/quickstart) for +more information on building Abseil using the Bazel build system. + + +If you require CMake support, please check the +[CMake build instructions](CMake/README.md). + +## Codemap + +Abseil contains the following C++ library components: + +* [`base`](absl/base/) Abseil Fundamentals +
The `base` library contains initialization code and other code which + all other Abseil code depends on. Code within `base` may not depend on any + other code (other than the C++ standard library). +* [`algorithm`](absl/algorithm/) +
The `algorithm` library contains additions to the C++ `` + library and container-based versions of such algorithms. +* [`container`](absl/container/) +
The `container` library contains additional STL-style containers, + including Abseil's unordered "Swiss table" containers. +* [`debugging`](absl/debugging/) +
The `debugging` library contains code useful for enabling leak + checks, and stacktrace and symbolization utilities. +* [`hash`](absl/hash/) +
The `hash` library contains the hashing framework and default hash + functor implementations for hashable types in Abseil. +* [`memory`](absl/memory/) +
The `memory` library contains C++11-compatible versions of + `std::make_unique()` and related memory management facilities. +* [`meta`](absl/meta/) +
The `meta` library contains C++11-compatible versions of type checks + available within C++14 and C++17 versions of the C++ `` library. +* [`numeric`](absl/numeric/) +
The `numeric` library contains C++11-compatible 128-bit integers. +* [`strings`](absl/strings/) +
The `strings` library contains a variety of strings routines and + utilities, including a C++11-compatible version of the C++17 + `std::string_view` type. +* [`synchronization`](absl/synchronization/) +
The `synchronization` library contains concurrency primitives (Abseil's + `absl::Mutex` class, an alternative to `std::mutex`) and a variety of + synchronization abstractions. +* [`time`](absl/time/) +
The `time` library contains abstractions for computing with absolute + points in time, durations of time, and formatting and parsing time within + time zones. +* [`types`](absl/types/) +
The `types` library contains non-container utility types, like a + C++11-compatible version of the C++17 `std::optional` type. +* [`utility`](absl/utility/) +
The `utility` library contains utility and helper code. + +## License + +The Abseil C++ library is licensed under the terms of the Apache +license. See [LICENSE](LICENSE) for more information. + +## Links + +For more information about Abseil: + +* Consult our [Abseil Introduction](https://abseil.io/about/intro) +* Read [Why Adopt Abseil](https://abseil.io/about/philosophy) to understand our + design philosophy. +* Peruse our + [Abseil Compatibility Guarantees](https://abseil.io/about/compatibility) to + understand both what we promise to you, and what we expect of you in return. diff --git a/SaraAttended/Pods/abseil/absl/algorithm/algorithm.h b/SaraAttended/Pods/abseil/absl/algorithm/algorithm.h new file mode 100644 index 0000000..e9b4733 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/algorithm/algorithm.h @@ -0,0 +1,159 @@ +// 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: algorithm.h +// ----------------------------------------------------------------------------- +// +// This header file contains Google extensions to the standard C++ +// header. + +#ifndef ABSL_ALGORITHM_ALGORITHM_H_ +#define ABSL_ALGORITHM_ALGORITHM_H_ + +#include +#include +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +namespace algorithm_internal { + +// Performs comparisons with operator==, similar to C++14's `std::equal_to<>`. +struct EqualTo { + template + bool operator()(const T& a, const U& b) const { + return a == b; + } +}; + +template +bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, + InputIter2 last2, Pred pred, std::input_iterator_tag, + std::input_iterator_tag) { + while (true) { + if (first1 == last1) return first2 == last2; + if (first2 == last2) return false; + if (!pred(*first1, *first2)) return false; + ++first1; + ++first2; + } +} + +template +bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, + InputIter2 last2, Pred&& pred, std::random_access_iterator_tag, + std::random_access_iterator_tag) { + return (last1 - first1 == last2 - first2) && + std::equal(first1, last1, first2, std::forward(pred)); +} + +// When we are using our own internal predicate that just applies operator==, we +// forward to the non-predicate form of std::equal. This enables an optimization +// in libstdc++ that can result in std::memcmp being used for integer types. +template +bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, + InputIter2 last2, algorithm_internal::EqualTo /* unused */, + std::random_access_iterator_tag, + std::random_access_iterator_tag) { + return (last1 - first1 == last2 - first2) && + std::equal(first1, last1, first2); +} + +template +It RotateImpl(It first, It middle, It last, std::true_type) { + return std::rotate(first, middle, last); +} + +template +It RotateImpl(It first, It middle, It last, std::false_type) { + std::rotate(first, middle, last); + return std::next(first, std::distance(middle, last)); +} + +} // namespace algorithm_internal + +// equal() +// +// Compares the equality of two ranges specified by pairs of iterators, using +// the given predicate, returning true iff for each corresponding iterator i1 +// and i2 in the first and second range respectively, pred(*i1, *i2) == true +// +// This comparison takes at most min(`last1` - `first1`, `last2` - `first2`) +// invocations of the predicate. Additionally, if InputIter1 and InputIter2 are +// both random-access iterators, and `last1` - `first1` != `last2` - `first2`, +// then the predicate is never invoked and the function returns false. +// +// This is a C++11-compatible implementation of C++14 `std::equal`. See +// https://en.cppreference.com/w/cpp/algorithm/equal for more information. +template +bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, + InputIter2 last2, Pred&& pred) { + return algorithm_internal::EqualImpl( + first1, last1, first2, last2, std::forward(pred), + typename std::iterator_traits::iterator_category{}, + typename std::iterator_traits::iterator_category{}); +} + +// Overload of equal() that performs comparison of two ranges specified by pairs +// of iterators using operator==. +template +bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, + InputIter2 last2) { + return absl::equal(first1, last1, first2, last2, + algorithm_internal::EqualTo{}); +} + +// linear_search() +// +// Performs a linear search for `value` using the iterator `first` up to +// but not including `last`, returning true if [`first`, `last`) contains an +// element equal to `value`. +// +// A linear search is of O(n) complexity which is guaranteed to make at most +// n = (`last` - `first`) comparisons. A linear search over short containers +// may be faster than a binary search, even when the container is sorted. +template +bool linear_search(InputIterator first, InputIterator last, + const EqualityComparable& value) { + return std::find(first, last, value) != last; +} + +// rotate() +// +// Performs a left rotation on a range of elements (`first`, `last`) such that +// `middle` is now the first element. `rotate()` returns an iterator pointing to +// the first element before rotation. This function is exactly the same as +// `std::rotate`, but fixes a bug in gcc +// <= 4.9 where `std::rotate` returns `void` instead of an iterator. +// +// The complexity of this algorithm is the same as that of `std::rotate`, but if +// `ForwardIterator` is not a random-access iterator, then `absl::rotate` +// performs an additional pass over the range to construct the return value. +template +ForwardIterator rotate(ForwardIterator first, ForwardIterator middle, + ForwardIterator last) { + return algorithm_internal::RotateImpl( + first, middle, last, + std::is_same()); +} + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_ALGORITHM_ALGORITHM_H_ diff --git a/SaraAttended/Pods/abseil/absl/algorithm/container.h b/SaraAttended/Pods/abseil/absl/algorithm/container.h new file mode 100644 index 0000000..d72532d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/algorithm/container.h @@ -0,0 +1,1727 @@ +// 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: container.h +// ----------------------------------------------------------------------------- +// +// This header file provides Container-based versions of algorithmic functions +// within the C++ standard library. The following standard library sets of +// functions are covered within this file: +// +// * Algorithmic functions +// * Algorithmic functions +// * functions +// +// The standard library functions operate on iterator ranges; the functions +// within this API operate on containers, though many return iterator ranges. +// +// All functions within this API are named with a `c_` prefix. Calls such as +// `absl::c_xx(container, ...) are equivalent to std:: functions such as +// `std::xx(std::begin(cont), std::end(cont), ...)`. Functions that act on +// iterators but not conceptually on iterator ranges (e.g. `std::iter_swap`) +// have no equivalent here. +// +// For template parameter and variable naming, `C` indicates the container type +// to which the function is applied, `Pred` indicates the predicate object type +// to be used by the function and `T` indicates the applicable element type. + +#ifndef ABSL_ALGORITHM_CONTAINER_H_ +#define ABSL_ALGORITHM_CONTAINER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/algorithm/algorithm.h" +#include "absl/base/macros.h" +#include "absl/meta/type_traits.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace container_algorithm_internal { + +// NOTE: it is important to defer to ADL lookup for building with C++ modules, +// especially for headers like which are not visible from this file +// but specialize std::begin and std::end. +using std::begin; +using std::end; + +// The type of the iterator given by begin(c) (possibly std::begin(c)). +// ContainerIter> gives vector::const_iterator, +// while ContainerIter> gives vector::iterator. +template +using ContainerIter = decltype(begin(std::declval())); + +// An MSVC bug involving template parameter substitution requires us to use +// decltype() here instead of just std::pair. +template +using ContainerIterPairType = + decltype(std::make_pair(ContainerIter(), ContainerIter())); + +template +using ContainerDifferenceType = + decltype(std::distance(std::declval>(), + std::declval>())); + +template +using ContainerPointerType = + typename std::iterator_traits>::pointer; + +// container_algorithm_internal::c_begin and +// container_algorithm_internal::c_end are abbreviations for proper ADL +// lookup of std::begin and std::end, i.e. +// using std::begin; +// using std::end; +// std::foo(begin(c), end(c); +// becomes +// std::foo(container_algorithm_internal::begin(c), +// container_algorithm_internal::end(c)); +// These are meant for internal use only. + +template +ContainerIter c_begin(C& c) { return begin(c); } + +template +ContainerIter c_end(C& c) { return end(c); } + +template +struct IsUnorderedContainer : std::false_type {}; + +template +struct IsUnorderedContainer< + std::unordered_map> : std::true_type {}; + +template +struct IsUnorderedContainer> + : std::true_type {}; + +// container_algorithm_internal::c_size. It is meant for internal use only. + +template +auto c_size(C& c) -> decltype(c.size()) { + return c.size(); +} + +template +constexpr std::size_t c_size(T (&)[N]) { + return N; +} + +} // namespace container_algorithm_internal + +// PUBLIC API + +//------------------------------------------------------------------------------ +// Abseil algorithm.h functions +//------------------------------------------------------------------------------ + +// c_linear_search() +// +// Container-based version of absl::linear_search() for performing a linear +// search within a container. +template +bool c_linear_search(const C& c, EqualityComparable&& value) { + return linear_search(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(value)); +} + +//------------------------------------------------------------------------------ +// algorithms +//------------------------------------------------------------------------------ + +// c_distance() +// +// Container-based version of the `std::distance()` function to +// return the number of elements within a container. +template +container_algorithm_internal::ContainerDifferenceType c_distance( + const C& c) { + return std::distance(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +//------------------------------------------------------------------------------ +// Non-modifying sequence operations +//------------------------------------------------------------------------------ + +// c_all_of() +// +// Container-based version of the `std::all_of()` function to +// test a condition on all elements within a container. +template +bool c_all_of(const C& c, Pred&& pred) { + return std::all_of(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_any_of() +// +// Container-based version of the `std::any_of()` function to +// test if any element in a container fulfills a condition. +template +bool c_any_of(const C& c, Pred&& pred) { + return std::any_of(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_none_of() +// +// Container-based version of the `std::none_of()` function to +// test if no elements in a container fulfil a condition. +template +bool c_none_of(const C& c, Pred&& pred) { + return std::none_of(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_for_each() +// +// Container-based version of the `std::for_each()` function to +// apply a function to a container's elements. +template +decay_t c_for_each(C&& c, Function&& f) { + return std::for_each(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(f)); +} + +// c_find() +// +// Container-based version of the `std::find()` function to find +// the first element containing the passed value within a container value. +template +container_algorithm_internal::ContainerIter c_find(C& c, T&& value) { + return std::find(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(value)); +} + +// c_find_if() +// +// Container-based version of the `std::find_if()` function to find +// the first element in a container matching the given condition. +template +container_algorithm_internal::ContainerIter c_find_if(C& c, Pred&& pred) { + return std::find_if(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_find_if_not() +// +// Container-based version of the `std::find_if_not()` function to +// find the first element in a container not matching the given condition. +template +container_algorithm_internal::ContainerIter c_find_if_not(C& c, + Pred&& pred) { + return std::find_if_not(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_find_end() +// +// Container-based version of the `std::find_end()` function to +// find the last subsequence within a container. +template +container_algorithm_internal::ContainerIter c_find_end( + Sequence1& sequence, Sequence2& subsequence) { + return std::find_end(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(subsequence), + container_algorithm_internal::c_end(subsequence)); +} + +// Overload of c_find_end() for using a predicate evaluation other than `==` as +// the function's test condition. +template +container_algorithm_internal::ContainerIter c_find_end( + Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { + return std::find_end(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(subsequence), + container_algorithm_internal::c_end(subsequence), + std::forward(pred)); +} + +// c_find_first_of() +// +// Container-based version of the `std::find_first_of()` function to +// find the first element within the container that is also within the options +// container. +template +container_algorithm_internal::ContainerIter c_find_first_of(C1& container, + C2& options) { + return std::find_first_of(container_algorithm_internal::c_begin(container), + container_algorithm_internal::c_end(container), + container_algorithm_internal::c_begin(options), + container_algorithm_internal::c_end(options)); +} + +// Overload of c_find_first_of() for using a predicate evaluation other than +// `==` as the function's test condition. +template +container_algorithm_internal::ContainerIter c_find_first_of( + C1& container, C2& options, BinaryPredicate&& pred) { + return std::find_first_of(container_algorithm_internal::c_begin(container), + container_algorithm_internal::c_end(container), + container_algorithm_internal::c_begin(options), + container_algorithm_internal::c_end(options), + std::forward(pred)); +} + +// c_adjacent_find() +// +// Container-based version of the `std::adjacent_find()` function to +// find equal adjacent elements within a container. +template +container_algorithm_internal::ContainerIter c_adjacent_find( + Sequence& sequence) { + return std::adjacent_find(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_adjacent_find() for using a predicate evaluation other than +// `==` as the function's test condition. +template +container_algorithm_internal::ContainerIter c_adjacent_find( + Sequence& sequence, BinaryPredicate&& pred) { + return std::adjacent_find(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(pred)); +} + +// c_count() +// +// Container-based version of the `std::count()` function to count +// values that match within a container. +template +container_algorithm_internal::ContainerDifferenceType c_count( + const C& c, T&& value) { + return std::count(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(value)); +} + +// c_count_if() +// +// Container-based version of the `std::count_if()` function to +// count values matching a condition within a container. +template +container_algorithm_internal::ContainerDifferenceType c_count_if( + const C& c, Pred&& pred) { + return std::count_if(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_mismatch() +// +// Container-based version of the `std::mismatch()` function to +// return the first element where two ordered containers differ. +template +container_algorithm_internal::ContainerIterPairType +c_mismatch(C1& c1, C2& c2) { + return std::mismatch(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2)); +} + +// Overload of c_mismatch() for using a predicate evaluation other than `==` as +// the function's test condition. +template +container_algorithm_internal::ContainerIterPairType +c_mismatch(C1& c1, C2& c2, BinaryPredicate&& pred) { + return std::mismatch(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + std::forward(pred)); +} + +// c_equal() +// +// Container-based version of the `std::equal()` function to +// test whether two containers are equal. +// +// NOTE: the semantics of c_equal() are slightly different than those of +// equal(): while the latter iterates over the second container only up to the +// size of the first container, c_equal() also checks whether the container +// sizes are equal. This better matches expectations about c_equal() based on +// its signature. +// +// Example: +// vector v1 = <1, 2, 3>; +// vector v2 = <1, 2, 3, 4>; +// equal(std::begin(v1), std::end(v1), std::begin(v2)) returns true +// c_equal(v1, v2) returns false + +template +bool c_equal(const C1& c1, const C2& c2) { + return ((container_algorithm_internal::c_size(c1) == + container_algorithm_internal::c_size(c2)) && + std::equal(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2))); +} + +// Overload of c_equal() for using a predicate evaluation other than `==` as +// the function's test condition. +template +bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) { + return ((container_algorithm_internal::c_size(c1) == + container_algorithm_internal::c_size(c2)) && + std::equal(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + std::forward(pred))); +} + +// c_is_permutation() +// +// Container-based version of the `std::is_permutation()` function +// to test whether a container is a permutation of another. +template +bool c_is_permutation(const C1& c1, const C2& c2) { + using std::begin; + using std::end; + return c1.size() == c2.size() && + std::is_permutation(begin(c1), end(c1), begin(c2)); +} + +// Overload of c_is_permutation() for using a predicate evaluation other than +// `==` as the function's test condition. +template +bool c_is_permutation(const C1& c1, const C2& c2, BinaryPredicate&& pred) { + using std::begin; + using std::end; + return c1.size() == c2.size() && + std::is_permutation(begin(c1), end(c1), begin(c2), + std::forward(pred)); +} + +// c_search() +// +// Container-based version of the `std::search()` function to search +// a container for a subsequence. +template +container_algorithm_internal::ContainerIter c_search( + Sequence1& sequence, Sequence2& subsequence) { + return std::search(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(subsequence), + container_algorithm_internal::c_end(subsequence)); +} + +// Overload of c_search() for using a predicate evaluation other than +// `==` as the function's test condition. +template +container_algorithm_internal::ContainerIter c_search( + Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { + return std::search(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(subsequence), + container_algorithm_internal::c_end(subsequence), + std::forward(pred)); +} + +// c_search_n() +// +// Container-based version of the `std::search_n()` function to +// search a container for the first sequence of N elements. +template +container_algorithm_internal::ContainerIter c_search_n( + Sequence& sequence, Size count, T&& value) { + return std::search_n(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), count, + std::forward(value)); +} + +// Overload of c_search_n() for using a predicate evaluation other than +// `==` as the function's test condition. +template +container_algorithm_internal::ContainerIter c_search_n( + Sequence& sequence, Size count, T&& value, BinaryPredicate&& pred) { + return std::search_n(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), count, + std::forward(value), + std::forward(pred)); +} + +//------------------------------------------------------------------------------ +// Modifying sequence operations +//------------------------------------------------------------------------------ + +// c_copy() +// +// Container-based version of the `std::copy()` function to copy a +// container's elements into an iterator. +template +OutputIterator c_copy(const InputSequence& input, OutputIterator output) { + return std::copy(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), output); +} + +// c_copy_n() +// +// Container-based version of the `std::copy_n()` function to copy a +// container's first N elements into an iterator. +template +OutputIterator c_copy_n(const C& input, Size n, OutputIterator output) { + return std::copy_n(container_algorithm_internal::c_begin(input), n, output); +} + +// c_copy_if() +// +// Container-based version of the `std::copy_if()` function to copy +// a container's elements satisfying some condition into an iterator. +template +OutputIterator c_copy_if(const InputSequence& input, OutputIterator output, + Pred&& pred) { + return std::copy_if(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), output, + std::forward(pred)); +} + +// c_copy_backward() +// +// Container-based version of the `std::copy_backward()` function to +// copy a container's elements in reverse order into an iterator. +template +BidirectionalIterator c_copy_backward(const C& src, + BidirectionalIterator dest) { + return std::copy_backward(container_algorithm_internal::c_begin(src), + container_algorithm_internal::c_end(src), dest); +} + +// c_move() +// +// Container-based version of the `std::move()` function to move +// a container's elements into an iterator. +template +OutputIterator c_move(C&& src, OutputIterator dest) { + return std::move(container_algorithm_internal::c_begin(src), + container_algorithm_internal::c_end(src), dest); +} + +// c_move_backward() +// +// Container-based version of the `std::move_backward()` function to +// move a container's elements into an iterator in reverse order. +template +BidirectionalIterator c_move_backward(C&& src, BidirectionalIterator dest) { + return std::move_backward(container_algorithm_internal::c_begin(src), + container_algorithm_internal::c_end(src), dest); +} + +// c_swap_ranges() +// +// Container-based version of the `std::swap_ranges()` function to +// swap a container's elements with another container's elements. +template +container_algorithm_internal::ContainerIter c_swap_ranges(C1& c1, C2& c2) { + return std::swap_ranges(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2)); +} + +// c_transform() +// +// Container-based version of the `std::transform()` function to +// transform a container's elements using the unary operation, storing the +// result in an iterator pointing to the last transformed element in the output +// range. +template +OutputIterator c_transform(const InputSequence& input, OutputIterator output, + UnaryOp&& unary_op) { + return std::transform(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), output, + std::forward(unary_op)); +} + +// Overload of c_transform() for performing a transformation using a binary +// predicate. +template +OutputIterator c_transform(const InputSequence1& input1, + const InputSequence2& input2, OutputIterator output, + BinaryOp&& binary_op) { + return std::transform(container_algorithm_internal::c_begin(input1), + container_algorithm_internal::c_end(input1), + container_algorithm_internal::c_begin(input2), output, + std::forward(binary_op)); +} + +// c_replace() +// +// Container-based version of the `std::replace()` function to +// replace a container's elements of some value with a new value. The container +// is modified in place. +template +void c_replace(Sequence& sequence, const T& old_value, const T& new_value) { + std::replace(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), old_value, + new_value); +} + +// c_replace_if() +// +// Container-based version of the `std::replace_if()` function to +// replace a container's elements of some value with a new value based on some +// condition. The container is modified in place. +template +void c_replace_if(C& c, Pred&& pred, T&& new_value) { + std::replace_if(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred), std::forward(new_value)); +} + +// c_replace_copy() +// +// Container-based version of the `std::replace_copy()` function to +// replace a container's elements of some value with a new value and return the +// results within an iterator. +template +OutputIterator c_replace_copy(const C& c, OutputIterator result, T&& old_value, + T&& new_value) { + return std::replace_copy(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result, + std::forward(old_value), + std::forward(new_value)); +} + +// c_replace_copy_if() +// +// Container-based version of the `std::replace_copy_if()` function +// to replace a container's elements of some value with a new value based on +// some condition, and return the results within an iterator. +template +OutputIterator c_replace_copy_if(const C& c, OutputIterator result, Pred&& pred, + T&& new_value) { + return std::replace_copy_if(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result, + std::forward(pred), + std::forward(new_value)); +} + +// c_fill() +// +// Container-based version of the `std::fill()` function to fill a +// container with some value. +template +void c_fill(C& c, T&& value) { + std::fill(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), std::forward(value)); +} + +// c_fill_n() +// +// Container-based version of the `std::fill_n()` function to fill +// the first N elements in a container with some value. +template +void c_fill_n(C& c, Size n, T&& value) { + std::fill_n(container_algorithm_internal::c_begin(c), n, + std::forward(value)); +} + +// c_generate() +// +// Container-based version of the `std::generate()` function to +// assign a container's elements to the values provided by the given generator. +template +void c_generate(C& c, Generator&& gen) { + std::generate(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(gen)); +} + +// c_generate_n() +// +// Container-based version of the `std::generate_n()` function to +// assign a container's first N elements to the values provided by the given +// generator. +template +container_algorithm_internal::ContainerIter c_generate_n(C& c, Size n, + Generator&& gen) { + return std::generate_n(container_algorithm_internal::c_begin(c), n, + std::forward(gen)); +} + +// Note: `c_xx()` container versions for `remove()`, `remove_if()`, +// and `unique()` are omitted, because it's not clear whether or not such +// functions should call erase on their supplied sequences afterwards. Either +// behavior would be surprising for a different set of users. + +// c_remove_copy() +// +// Container-based version of the `std::remove_copy()` function to +// copy a container's elements while removing any elements matching the given +// `value`. +template +OutputIterator c_remove_copy(const C& c, OutputIterator result, T&& value) { + return std::remove_copy(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result, + std::forward(value)); +} + +// c_remove_copy_if() +// +// Container-based version of the `std::remove_copy_if()` function +// to copy a container's elements while removing any elements matching the given +// condition. +template +OutputIterator c_remove_copy_if(const C& c, OutputIterator result, + Pred&& pred) { + return std::remove_copy_if(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result, + std::forward(pred)); +} + +// c_unique_copy() +// +// Container-based version of the `std::unique_copy()` function to +// copy a container's elements while removing any elements containing duplicate +// values. +template +OutputIterator c_unique_copy(const C& c, OutputIterator result) { + return std::unique_copy(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result); +} + +// Overload of c_unique_copy() for using a predicate evaluation other than +// `==` for comparing uniqueness of the element values. +template +OutputIterator c_unique_copy(const C& c, OutputIterator result, + BinaryPredicate&& pred) { + return std::unique_copy(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), result, + std::forward(pred)); +} + +// c_reverse() +// +// Container-based version of the `std::reverse()` function to +// reverse a container's elements. +template +void c_reverse(Sequence& sequence) { + std::reverse(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// c_reverse_copy() +// +// Container-based version of the `std::reverse()` function to +// reverse a container's elements and write them to an iterator range. +template +OutputIterator c_reverse_copy(const C& sequence, OutputIterator result) { + return std::reverse_copy(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + result); +} + +// c_rotate() +// +// Container-based version of the `std::rotate()` function to +// shift a container's elements leftward such that the `middle` element becomes +// the first element in the container. +template > +Iterator c_rotate(C& sequence, Iterator middle) { + return absl::rotate(container_algorithm_internal::c_begin(sequence), middle, + container_algorithm_internal::c_end(sequence)); +} + +// c_rotate_copy() +// +// Container-based version of the `std::rotate_copy()` function to +// shift a container's elements leftward such that the `middle` element becomes +// the first element in a new iterator range. +template +OutputIterator c_rotate_copy( + const C& sequence, + container_algorithm_internal::ContainerIter middle, + OutputIterator result) { + return std::rotate_copy(container_algorithm_internal::c_begin(sequence), + middle, container_algorithm_internal::c_end(sequence), + result); +} + +// c_shuffle() +// +// Container-based version of the `std::shuffle()` function to +// randomly shuffle elements within the container using a `gen()` uniform random +// number generator. +template +void c_shuffle(RandomAccessContainer& c, UniformRandomBitGenerator&& gen) { + std::shuffle(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(gen)); +} + +//------------------------------------------------------------------------------ +// Partition functions +//------------------------------------------------------------------------------ + +// c_is_partitioned() +// +// Container-based version of the `std::is_partitioned()` function +// to test whether all elements in the container for which `pred` returns `true` +// precede those for which `pred` is `false`. +template +bool c_is_partitioned(const C& c, Pred&& pred) { + return std::is_partitioned(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_partition() +// +// Container-based version of the `std::partition()` function +// to rearrange all elements in a container in such a way that all elements for +// which `pred` returns `true` precede all those for which it returns `false`, +// returning an iterator to the first element of the second group. +template +container_algorithm_internal::ContainerIter c_partition(C& c, Pred&& pred) { + return std::partition(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_stable_partition() +// +// Container-based version of the `std::stable_partition()` function +// to rearrange all elements in a container in such a way that all elements for +// which `pred` returns `true` precede all those for which it returns `false`, +// preserving the relative ordering between the two groups. The function returns +// an iterator to the first element of the second group. +template +container_algorithm_internal::ContainerIter c_stable_partition(C& c, + Pred&& pred) { + return std::stable_partition(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +// c_partition_copy() +// +// Container-based version of the `std::partition_copy()` function +// to partition a container's elements and return them into two iterators: one +// for which `pred` returns `true`, and one for which `pred` returns `false.` + +template +std::pair c_partition_copy( + const C& c, OutputIterator1 out_true, OutputIterator2 out_false, + Pred&& pred) { + return std::partition_copy(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), out_true, + out_false, std::forward(pred)); +} + +// c_partition_point() +// +// Container-based version of the `std::partition_point()` function +// to return the first element of an already partitioned container for which +// the given `pred` is not `true`. +template +container_algorithm_internal::ContainerIter c_partition_point(C& c, + Pred&& pred) { + return std::partition_point(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(pred)); +} + +//------------------------------------------------------------------------------ +// Sorting functions +//------------------------------------------------------------------------------ + +// c_sort() +// +// Container-based version of the `std::sort()` function +// to sort elements in ascending order of their values. +template +void c_sort(C& c) { + std::sort(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_sort() for performing a `comp` comparison other than the +// default `operator<`. +template +void c_sort(C& c, Compare&& comp) { + std::sort(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_stable_sort() +// +// Container-based version of the `std::stable_sort()` function +// to sort elements in ascending order of their values, preserving the order +// of equivalents. +template +void c_stable_sort(C& c) { + std::stable_sort(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_stable_sort() for performing a `comp` comparison other than the +// default `operator<`. +template +void c_stable_sort(C& c, Compare&& comp) { + std::stable_sort(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_is_sorted() +// +// Container-based version of the `std::is_sorted()` function +// to evaluate whether the given container is sorted in ascending order. +template +bool c_is_sorted(const C& c) { + return std::is_sorted(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// c_is_sorted() overload for performing a `comp` comparison other than the +// default `operator<`. +template +bool c_is_sorted(const C& c, Compare&& comp) { + return std::is_sorted(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_partial_sort() +// +// Container-based version of the `std::partial_sort()` function +// to rearrange elements within a container such that elements before `middle` +// are sorted in ascending order. +template +void c_partial_sort( + RandomAccessContainer& sequence, + container_algorithm_internal::ContainerIter middle) { + std::partial_sort(container_algorithm_internal::c_begin(sequence), middle, + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_partial_sort() for performing a `comp` comparison other than +// the default `operator<`. +template +void c_partial_sort( + RandomAccessContainer& sequence, + container_algorithm_internal::ContainerIter middle, + Compare&& comp) { + std::partial_sort(container_algorithm_internal::c_begin(sequence), middle, + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_partial_sort_copy() +// +// Container-based version of the `std::partial_sort_copy()` +// function to sort elements within a container such that elements before +// `middle` are sorted in ascending order, and return the result within an +// iterator. +template +container_algorithm_internal::ContainerIter +c_partial_sort_copy(const C& sequence, RandomAccessContainer& result) { + return std::partial_sort_copy(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(result), + container_algorithm_internal::c_end(result)); +} + +// Overload of c_partial_sort_copy() for performing a `comp` comparison other +// than the default `operator<`. +template +container_algorithm_internal::ContainerIter +c_partial_sort_copy(const C& sequence, RandomAccessContainer& result, + Compare&& comp) { + return std::partial_sort_copy(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + container_algorithm_internal::c_begin(result), + container_algorithm_internal::c_end(result), + std::forward(comp)); +} + +// c_is_sorted_until() +// +// Container-based version of the `std::is_sorted_until()` function +// to return the first element within a container that is not sorted in +// ascending order as an iterator. +template +container_algorithm_internal::ContainerIter c_is_sorted_until(C& c) { + return std::is_sorted_until(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_is_sorted_until() for performing a `comp` comparison other than +// the default `operator<`. +template +container_algorithm_internal::ContainerIter c_is_sorted_until( + C& c, Compare&& comp) { + return std::is_sorted_until(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_nth_element() +// +// Container-based version of the `std::nth_element()` function +// to rearrange the elements within a container such that the `nth` element +// would be in that position in an ordered sequence; other elements may be in +// any order, except that all preceding `nth` will be less than that element, +// and all following `nth` will be greater than that element. +template +void c_nth_element( + RandomAccessContainer& sequence, + container_algorithm_internal::ContainerIter nth) { + std::nth_element(container_algorithm_internal::c_begin(sequence), nth, + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_nth_element() for performing a `comp` comparison other than +// the default `operator<`. +template +void c_nth_element( + RandomAccessContainer& sequence, + container_algorithm_internal::ContainerIter nth, + Compare&& comp) { + std::nth_element(container_algorithm_internal::c_begin(sequence), nth, + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// Binary Search +//------------------------------------------------------------------------------ + +// c_lower_bound() +// +// Container-based version of the `std::lower_bound()` function +// to return an iterator pointing to the first element in a sorted container +// which does not compare less than `value`. +template +container_algorithm_internal::ContainerIter c_lower_bound( + Sequence& sequence, T&& value) { + return std::lower_bound(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value)); +} + +// Overload of c_lower_bound() for performing a `comp` comparison other than +// the default `operator<`. +template +container_algorithm_internal::ContainerIter c_lower_bound( + Sequence& sequence, T&& value, Compare&& comp) { + return std::lower_bound(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value), std::forward(comp)); +} + +// c_upper_bound() +// +// Container-based version of the `std::upper_bound()` function +// to return an iterator pointing to the first element in a sorted container +// which is greater than `value`. +template +container_algorithm_internal::ContainerIter c_upper_bound( + Sequence& sequence, T&& value) { + return std::upper_bound(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value)); +} + +// Overload of c_upper_bound() for performing a `comp` comparison other than +// the default `operator<`. +template +container_algorithm_internal::ContainerIter c_upper_bound( + Sequence& sequence, T&& value, Compare&& comp) { + return std::upper_bound(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value), std::forward(comp)); +} + +// c_equal_range() +// +// Container-based version of the `std::equal_range()` function +// to return an iterator pair pointing to the first and last elements in a +// sorted container which compare equal to `value`. +template +container_algorithm_internal::ContainerIterPairType +c_equal_range(Sequence& sequence, T&& value) { + return std::equal_range(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value)); +} + +// Overload of c_equal_range() for performing a `comp` comparison other than +// the default `operator<`. +template +container_algorithm_internal::ContainerIterPairType +c_equal_range(Sequence& sequence, T&& value, Compare&& comp) { + return std::equal_range(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value), std::forward(comp)); +} + +// c_binary_search() +// +// Container-based version of the `std::binary_search()` function +// to test if any element in the sorted container contains a value equivalent to +// 'value'. +template +bool c_binary_search(Sequence&& sequence, T&& value) { + return std::binary_search(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value)); +} + +// Overload of c_binary_search() for performing a `comp` comparison other than +// the default `operator<`. +template +bool c_binary_search(Sequence&& sequence, T&& value, Compare&& comp) { + return std::binary_search(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value), + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// Merge functions +//------------------------------------------------------------------------------ + +// c_merge() +// +// Container-based version of the `std::merge()` function +// to merge two sorted containers into a single sorted iterator. +template +OutputIterator c_merge(const C1& c1, const C2& c2, OutputIterator result) { + return std::merge(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), result); +} + +// Overload of c_merge() for performing a `comp` comparison other than +// the default `operator<`. +template +OutputIterator c_merge(const C1& c1, const C2& c2, OutputIterator result, + Compare&& comp) { + return std::merge(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), result, + std::forward(comp)); +} + +// c_inplace_merge() +// +// Container-based version of the `std::inplace_merge()` function +// to merge a supplied iterator `middle` into a container. +template +void c_inplace_merge(C& c, + container_algorithm_internal::ContainerIter middle) { + std::inplace_merge(container_algorithm_internal::c_begin(c), middle, + container_algorithm_internal::c_end(c)); +} + +// Overload of c_inplace_merge() for performing a merge using a `comp` other +// than `operator<`. +template +void c_inplace_merge(C& c, + container_algorithm_internal::ContainerIter middle, + Compare&& comp) { + std::inplace_merge(container_algorithm_internal::c_begin(c), middle, + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_includes() +// +// Container-based version of the `std::includes()` function +// to test whether a sorted container `c1` entirely contains another sorted +// container `c2`. +template +bool c_includes(const C1& c1, const C2& c2) { + return std::includes(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2)); +} + +// Overload of c_includes() for performing a merge using a `comp` other than +// `operator<`. +template +bool c_includes(const C1& c1, const C2& c2, Compare&& comp) { + return std::includes(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), + std::forward(comp)); +} + +// c_set_union() +// +// Container-based version of the `std::set_union()` function +// to return an iterator containing the union of two containers; duplicate +// values are not copied into the output. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_union(const C1& c1, const C2& c2, OutputIterator output) { + return std::set_union(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output); +} + +// Overload of c_set_union() for performing a merge using a `comp` other than +// `operator<`. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_union(const C1& c1, const C2& c2, OutputIterator output, + Compare&& comp) { + return std::set_union(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output, + std::forward(comp)); +} + +// c_set_intersection() +// +// Container-based version of the `std::set_intersection()` function +// to return an iterator containing the intersection of two containers. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_intersection(const C1& c1, const C2& c2, + OutputIterator output) { + return std::set_intersection(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output); +} + +// Overload of c_set_intersection() for performing a merge using a `comp` other +// than `operator<`. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_intersection(const C1& c1, const C2& c2, + OutputIterator output, Compare&& comp) { + return std::set_intersection(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output, + std::forward(comp)); +} + +// c_set_difference() +// +// Container-based version of the `std::set_difference()` function +// to return an iterator containing elements present in the first container but +// not in the second. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_difference(const C1& c1, const C2& c2, + OutputIterator output) { + return std::set_difference(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output); +} + +// Overload of c_set_difference() for performing a merge using a `comp` other +// than `operator<`. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_difference(const C1& c1, const C2& c2, + OutputIterator output, Compare&& comp) { + return std::set_difference(container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output, + std::forward(comp)); +} + +// c_set_symmetric_difference() +// +// Container-based version of the `std::set_symmetric_difference()` +// function to return an iterator containing elements present in either one +// container or the other, but not both. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2, + OutputIterator output) { + return std::set_symmetric_difference( + container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output); +} + +// Overload of c_set_symmetric_difference() for performing a merge using a +// `comp` other than `operator<`. +template ::value, + void>::type, + typename = typename std::enable_if< + !container_algorithm_internal::IsUnorderedContainer::value, + void>::type> +OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2, + OutputIterator output, + Compare&& comp) { + return std::set_symmetric_difference( + container_algorithm_internal::c_begin(c1), + container_algorithm_internal::c_end(c1), + container_algorithm_internal::c_begin(c2), + container_algorithm_internal::c_end(c2), output, + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// Heap functions +//------------------------------------------------------------------------------ + +// c_push_heap() +// +// Container-based version of the `std::push_heap()` function +// to push a value onto a container heap. +template +void c_push_heap(RandomAccessContainer& sequence) { + std::push_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_push_heap() for performing a push operation on a heap using a +// `comp` other than `operator<`. +template +void c_push_heap(RandomAccessContainer& sequence, Compare&& comp) { + std::push_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_pop_heap() +// +// Container-based version of the `std::pop_heap()` function +// to pop a value from a heap container. +template +void c_pop_heap(RandomAccessContainer& sequence) { + std::pop_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_pop_heap() for performing a pop operation on a heap using a +// `comp` other than `operator<`. +template +void c_pop_heap(RandomAccessContainer& sequence, Compare&& comp) { + std::pop_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_make_heap() +// +// Container-based version of the `std::make_heap()` function +// to make a container a heap. +template +void c_make_heap(RandomAccessContainer& sequence) { + std::make_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_make_heap() for performing heap comparisons using a +// `comp` other than `operator<` +template +void c_make_heap(RandomAccessContainer& sequence, Compare&& comp) { + std::make_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_sort_heap() +// +// Container-based version of the `std::sort_heap()` function +// to sort a heap into ascending order (after which it is no longer a heap). +template +void c_sort_heap(RandomAccessContainer& sequence) { + std::sort_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_sort_heap() for performing heap comparisons using a +// `comp` other than `operator<` +template +void c_sort_heap(RandomAccessContainer& sequence, Compare&& comp) { + std::sort_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_is_heap() +// +// Container-based version of the `std::is_heap()` function +// to check whether the given container is a heap. +template +bool c_is_heap(const RandomAccessContainer& sequence) { + return std::is_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_is_heap() for performing heap comparisons using a +// `comp` other than `operator<` +template +bool c_is_heap(const RandomAccessContainer& sequence, Compare&& comp) { + return std::is_heap(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_is_heap_until() +// +// Container-based version of the `std::is_heap_until()` function +// to find the first element in a given container which is not in heap order. +template +container_algorithm_internal::ContainerIter +c_is_heap_until(RandomAccessContainer& sequence) { + return std::is_heap_until(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_is_heap_until() for performing heap comparisons using a +// `comp` other than `operator<` +template +container_algorithm_internal::ContainerIter +c_is_heap_until(RandomAccessContainer& sequence, Compare&& comp) { + return std::is_heap_until(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// Min/max +//------------------------------------------------------------------------------ + +// c_min_element() +// +// Container-based version of the `std::min_element()` function +// to return an iterator pointing to the element with the smallest value, using +// `operator<` to make the comparisons. +template +container_algorithm_internal::ContainerIter c_min_element( + Sequence& sequence) { + return std::min_element(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_min_element() for performing a `comp` comparison other than +// `operator<`. +template +container_algorithm_internal::ContainerIter c_min_element( + Sequence& sequence, Compare&& comp) { + return std::min_element(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_max_element() +// +// Container-based version of the `std::max_element()` function +// to return an iterator pointing to the element with the largest value, using +// `operator<` to make the comparisons. +template +container_algorithm_internal::ContainerIter c_max_element( + Sequence& sequence) { + return std::max_element(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence)); +} + +// Overload of c_max_element() for performing a `comp` comparison other than +// `operator<`. +template +container_algorithm_internal::ContainerIter c_max_element( + Sequence& sequence, Compare&& comp) { + return std::max_element(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(comp)); +} + +// c_minmax_element() +// +// Container-based version of the `std::minmax_element()` function +// to return a pair of iterators pointing to the elements containing the +// smallest and largest values, respectively, using `operator<` to make the +// comparisons. +template +container_algorithm_internal::ContainerIterPairType +c_minmax_element(C& c) { + return std::minmax_element(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_minmax_element() for performing `comp` comparisons other than +// `operator<`. +template +container_algorithm_internal::ContainerIterPairType +c_minmax_element(C& c, Compare&& comp) { + return std::minmax_element(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// Lexicographical Comparisons +//------------------------------------------------------------------------------ + +// c_lexicographical_compare() +// +// Container-based version of the `std::lexicographical_compare()` +// function to lexicographically compare (e.g. sort words alphabetically) two +// container sequences. The comparison is performed using `operator<`. Note +// that capital letters ("A-Z") have ASCII values less than lowercase letters +// ("a-z"). +template +bool c_lexicographical_compare(Sequence1&& sequence1, Sequence2&& sequence2) { + return std::lexicographical_compare( + container_algorithm_internal::c_begin(sequence1), + container_algorithm_internal::c_end(sequence1), + container_algorithm_internal::c_begin(sequence2), + container_algorithm_internal::c_end(sequence2)); +} + +// Overload of c_lexicographical_compare() for performing a lexicographical +// comparison using a `comp` operator instead of `operator<`. +template +bool c_lexicographical_compare(Sequence1&& sequence1, Sequence2&& sequence2, + Compare&& comp) { + return std::lexicographical_compare( + container_algorithm_internal::c_begin(sequence1), + container_algorithm_internal::c_end(sequence1), + container_algorithm_internal::c_begin(sequence2), + container_algorithm_internal::c_end(sequence2), + std::forward(comp)); +} + +// c_next_permutation() +// +// Container-based version of the `std::next_permutation()` function +// to rearrange a container's elements into the next lexicographically greater +// permutation. +template +bool c_next_permutation(C& c) { + return std::next_permutation(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_next_permutation() for performing a lexicographical +// comparison using a `comp` operator instead of `operator<`. +template +bool c_next_permutation(C& c, Compare&& comp) { + return std::next_permutation(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +// c_prev_permutation() +// +// Container-based version of the `std::prev_permutation()` function +// to rearrange a container's elements into the next lexicographically lesser +// permutation. +template +bool c_prev_permutation(C& c) { + return std::prev_permutation(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c)); +} + +// Overload of c_prev_permutation() for performing a lexicographical +// comparison using a `comp` operator instead of `operator<`. +template +bool c_prev_permutation(C& c, Compare&& comp) { + return std::prev_permutation(container_algorithm_internal::c_begin(c), + container_algorithm_internal::c_end(c), + std::forward(comp)); +} + +//------------------------------------------------------------------------------ +// algorithms +//------------------------------------------------------------------------------ + +// c_iota() +// +// Container-based version of the `std::iota()` function +// to compute successive values of `value`, as if incremented with `++value` +// after each element is written. and write them to the container. +template +void c_iota(Sequence& sequence, T&& value) { + std::iota(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(value)); +} +// c_accumulate() +// +// Container-based version of the `std::accumulate()` function +// to accumulate the element values of a container to `init` and return that +// accumulation by value. +// +// Note: Due to a language technicality this function has return type +// absl::decay_t. As a user of this function you can casually read +// this as "returns T by value" and assume it does the right thing. +template +decay_t c_accumulate(const Sequence& sequence, T&& init) { + return std::accumulate(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(init)); +} + +// Overload of c_accumulate() for using a binary operations other than +// addition for computing the accumulation. +template +decay_t c_accumulate(const Sequence& sequence, T&& init, + BinaryOp&& binary_op) { + return std::accumulate(container_algorithm_internal::c_begin(sequence), + container_algorithm_internal::c_end(sequence), + std::forward(init), + std::forward(binary_op)); +} + +// c_inner_product() +// +// Container-based version of the `std::inner_product()` function +// to compute the cumulative inner product of container element pairs. +// +// Note: Due to a language technicality this function has return type +// absl::decay_t. As a user of this function you can casually read +// this as "returns T by value" and assume it does the right thing. +template +decay_t c_inner_product(const Sequence1& factors1, const Sequence2& factors2, + T&& sum) { + return std::inner_product(container_algorithm_internal::c_begin(factors1), + container_algorithm_internal::c_end(factors1), + container_algorithm_internal::c_begin(factors2), + std::forward(sum)); +} + +// Overload of c_inner_product() for using binary operations other than +// `operator+` (for computing the accumulation) and `operator*` (for computing +// the product between the two container's element pair). +template +decay_t c_inner_product(const Sequence1& factors1, const Sequence2& factors2, + T&& sum, BinaryOp1&& op1, BinaryOp2&& op2) { + return std::inner_product(container_algorithm_internal::c_begin(factors1), + container_algorithm_internal::c_end(factors1), + container_algorithm_internal::c_begin(factors2), + std::forward(sum), std::forward(op1), + std::forward(op2)); +} + +// c_adjacent_difference() +// +// Container-based version of the `std::adjacent_difference()` +// function to compute the difference between each element and the one preceding +// it and write it to an iterator. +template +OutputIt c_adjacent_difference(const InputSequence& input, + OutputIt output_first) { + return std::adjacent_difference(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), + output_first); +} + +// Overload of c_adjacent_difference() for using a binary operation other than +// subtraction to compute the adjacent difference. +template +OutputIt c_adjacent_difference(const InputSequence& input, + OutputIt output_first, BinaryOp&& op) { + return std::adjacent_difference(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), + output_first, std::forward(op)); +} + +// c_partial_sum() +// +// Container-based version of the `std::partial_sum()` function +// to compute the partial sum of the elements in a sequence and write them +// to an iterator. The partial sum is the sum of all element values so far in +// the sequence. +template +OutputIt c_partial_sum(const InputSequence& input, OutputIt output_first) { + return std::partial_sum(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), + output_first); +} + +// Overload of c_partial_sum() for using a binary operation other than addition +// to compute the "partial sum". +template +OutputIt c_partial_sum(const InputSequence& input, OutputIt output_first, + BinaryOp&& op) { + return std::partial_sum(container_algorithm_internal::c_begin(input), + container_algorithm_internal::c_end(input), + output_first, std::forward(op)); +} + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_ALGORITHM_CONTAINER_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/attributes.h b/SaraAttended/Pods/abseil/absl/base/attributes.h new file mode 100644 index 0000000..ff13862 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/attributes.h @@ -0,0 +1,621 @@ +// 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 header file defines macros for declaring attributes for functions, +// types, and variables. +// +// These macros are used within Abseil and allow the compiler to optimize, where +// applicable, certain function calls. +// +// This file is used for both C and C++! +// +// Most macros here are exposing GCC or Clang features, and are stubbed out for +// other compilers. +// +// GCC attributes documentation: +// https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Variable-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Type-Attributes.html +// +// Most attributes in this file are already supported by GCC 4.7. However, some +// of them are not supported in older version of Clang. Thus, we check +// `__has_attribute()` first. If the check fails, we check if we are on GCC and +// assume the attribute exists on GCC (which is verified on GCC 4.7). +// +// ----------------------------------------------------------------------------- +// Sanitizer Attributes +// ----------------------------------------------------------------------------- +// +// Sanitizer-related attributes are not "defined" in this file (and indeed +// are not defined as such in any file). To utilize the following +// sanitizer-related attributes within your builds, define the following macros +// within your build using a `-D` flag, along with the given value for +// `-fsanitize`: +// +// * `ADDRESS_SANITIZER` + `-fsanitize=address` (Clang, GCC 4.8) +// * `MEMORY_SANITIZER` + `-fsanitize=memory` (Clang-only) +// * `THREAD_SANITIZER + `-fsanitize=thread` (Clang, GCC 4.8+) +// * `UNDEFINED_BEHAVIOR_SANITIZER` + `-fsanitize=undefined` (Clang, GCC 4.9+) +// * `CONTROL_FLOW_INTEGRITY` + -fsanitize=cfi (Clang-only) +// +// Example: +// +// // Enable branches in the Abseil code that are tagged for ASan: +// $ bazel build --copt=-DADDRESS_SANITIZER --copt=-fsanitize=address +// --linkopt=-fsanitize=address *target* +// +// Since these macro names are only supported by GCC and Clang, we only check +// for `__GNUC__` (GCC or Clang) and the above macros. +#ifndef ABSL_BASE_ATTRIBUTES_H_ +#define ABSL_BASE_ATTRIBUTES_H_ + +// ABSL_HAVE_ATTRIBUTE +// +// A function-like feature checking macro that is a wrapper around +// `__has_attribute`, which is defined by GCC 5+ and Clang and evaluates to a +// nonzero constant integer if the attribute is supported or 0 if not. +// +// It evaluates to zero if `__has_attribute` is not defined by the compiler. +// +// GCC: https://gcc.gnu.org/gcc-5/changes.html +// Clang: https://clang.llvm.org/docs/LanguageExtensions.html +#ifdef __has_attribute +#define ABSL_HAVE_ATTRIBUTE(x) __has_attribute(x) +#else +#define ABSL_HAVE_ATTRIBUTE(x) 0 +#endif + +// ABSL_HAVE_CPP_ATTRIBUTE +// +// A function-like feature checking macro that accepts C++11 style attributes. +// It's a wrapper around `__has_cpp_attribute`, defined by ISO C++ SD-6 +// (https://en.cppreference.com/w/cpp/experimental/feature_test). If we don't +// find `__has_cpp_attribute`, will evaluate to 0. +#if defined(__cplusplus) && defined(__has_cpp_attribute) +// NOTE: requiring __cplusplus above should not be necessary, but +// works around https://bugs.llvm.org/show_bug.cgi?id=23435. +#define ABSL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#else +#define ABSL_HAVE_CPP_ATTRIBUTE(x) 0 +#endif + +// ----------------------------------------------------------------------------- +// Function Attributes +// ----------------------------------------------------------------------------- +// +// GCC: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html +// Clang: https://clang.llvm.org/docs/AttributeReference.html + +// ABSL_PRINTF_ATTRIBUTE +// ABSL_SCANF_ATTRIBUTE +// +// Tells the compiler to perform `printf` format string checking if the +// compiler supports it; see the 'format' attribute in +// . +// +// Note: As the GCC manual states, "[s]ince non-static C++ methods +// have an implicit 'this' argument, the arguments of such methods +// should be counted from two, not one." +#if ABSL_HAVE_ATTRIBUTE(format) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) \ + __attribute__((__format__(__printf__, string_index, first_to_check))) +#define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) \ + __attribute__((__format__(__scanf__, string_index, first_to_check))) +#else +#define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) +#define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) +#endif + +// ABSL_ATTRIBUTE_ALWAYS_INLINE +// ABSL_ATTRIBUTE_NOINLINE +// +// Forces functions to either inline or not inline. Introduced in gcc 3.1. +#if ABSL_HAVE_ATTRIBUTE(always_inline) || \ + (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) +#define ABSL_HAVE_ATTRIBUTE_ALWAYS_INLINE 1 +#else +#define ABSL_ATTRIBUTE_ALWAYS_INLINE +#endif + +#if ABSL_HAVE_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_NOINLINE __attribute__((noinline)) +#define ABSL_HAVE_ATTRIBUTE_NOINLINE 1 +#else +#define ABSL_ATTRIBUTE_NOINLINE +#endif + +// ABSL_ATTRIBUTE_NO_TAIL_CALL +// +// Prevents the compiler from optimizing away stack frames for functions which +// end in a call to another function. +#if ABSL_HAVE_ATTRIBUTE(disable_tail_calls) +#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 +#define ABSL_ATTRIBUTE_NO_TAIL_CALL __attribute__((disable_tail_calls)) +#elif defined(__GNUC__) && !defined(__clang__) +#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 +#define ABSL_ATTRIBUTE_NO_TAIL_CALL \ + __attribute__((optimize("no-optimize-sibling-calls"))) +#else +#define ABSL_ATTRIBUTE_NO_TAIL_CALL +#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 0 +#endif + +// ABSL_ATTRIBUTE_WEAK +// +// Tags a function as weak for the purposes of compilation and linking. +// Weak attributes currently do not work properly in LLVM's Windows backend, +// so disable them there. See https://bugs.llvm.org/show_bug.cgi?id=37598 +// for further information. +// The MinGW compiler doesn't complain about the weak attribute until the link +// step, presumably because Windows doesn't use ELF binaries. +#if (ABSL_HAVE_ATTRIBUTE(weak) || \ + (defined(__GNUC__) && !defined(__clang__))) && \ + !(defined(__llvm__) && defined(_WIN32)) && !defined(__MINGW32__) +#undef ABSL_ATTRIBUTE_WEAK +#define ABSL_ATTRIBUTE_WEAK __attribute__((weak)) +#define ABSL_HAVE_ATTRIBUTE_WEAK 1 +#else +#define ABSL_ATTRIBUTE_WEAK +#define ABSL_HAVE_ATTRIBUTE_WEAK 0 +#endif + +// ABSL_ATTRIBUTE_NONNULL +// +// Tells the compiler either (a) that a particular function parameter +// should be a non-null pointer, or (b) that all pointer arguments should +// be non-null. +// +// Note: As the GCC manual states, "[s]ince non-static C++ methods +// have an implicit 'this' argument, the arguments of such methods +// should be counted from two, not one." +// +// Args are indexed starting at 1. +// +// For non-static class member functions, the implicit `this` argument +// is arg 1, and the first explicit argument is arg 2. For static class member +// functions, there is no implicit `this`, and the first explicit argument is +// arg 1. +// +// Example: +// +// /* arg_a cannot be null, but arg_b can */ +// void Function(void* arg_a, void* arg_b) ABSL_ATTRIBUTE_NONNULL(1); +// +// class C { +// /* arg_a cannot be null, but arg_b can */ +// void Method(void* arg_a, void* arg_b) ABSL_ATTRIBUTE_NONNULL(2); +// +// /* arg_a cannot be null, but arg_b can */ +// static void StaticMethod(void* arg_a, void* arg_b) +// ABSL_ATTRIBUTE_NONNULL(1); +// }; +// +// If no arguments are provided, then all pointer arguments should be non-null. +// +// /* No pointer arguments may be null. */ +// void Function(void* arg_a, void* arg_b, int arg_c) ABSL_ATTRIBUTE_NONNULL(); +// +// NOTE: The GCC nonnull attribute actually accepts a list of arguments, but +// ABSL_ATTRIBUTE_NONNULL does not. +#if ABSL_HAVE_ATTRIBUTE(nonnull) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_NONNULL(arg_index) __attribute__((nonnull(arg_index))) +#else +#define ABSL_ATTRIBUTE_NONNULL(...) +#endif + +// ABSL_ATTRIBUTE_NORETURN +// +// Tells the compiler that a given function never returns. +#if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +#define ABSL_ATTRIBUTE_NORETURN __declspec(noreturn) +#else +#define ABSL_ATTRIBUTE_NORETURN +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS +// +// Tells the AddressSanitizer (or other memory testing tools) to ignore a given +// function. Useful for cases when a function reads random locations on stack, +// calls _exit from a cloned subprocess, deliberately accesses buffer +// out of bounds or does other scary things with memory. +// NOTE: GCC supports AddressSanitizer(asan) since 4.8. +// https://gcc.gnu.org/gcc-4.8/changes.html +#if defined(__GNUC__) +#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY +// +// Tells the MemorySanitizer to relax the handling of a given function. All +// "Use of uninitialized value" warnings from such functions will be suppressed, +// and all values loaded from memory will be considered fully initialized. +// This attribute is similar to the ADDRESS_SANITIZER attribute above, but deals +// with initialized-ness rather than addressability issues. +// NOTE: MemorySanitizer(msan) is supported by Clang but not GCC. +#if defined(__clang__) +#define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_THREAD +// +// Tells the ThreadSanitizer to not instrument a given function. +// NOTE: GCC supports ThreadSanitizer(tsan) since 4.8. +// https://gcc.gnu.org/gcc-4.8/changes.html +#if defined(__GNUC__) +#define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED +// +// Tells the UndefinedSanitizer to ignore a given function. Useful for cases +// where certain behavior (eg. division by zero) is being used intentionally. +// NOTE: GCC supports UndefinedBehaviorSanitizer(ubsan) since 4.9. +// https://gcc.gnu.org/gcc-4.9/changes.html +#if defined(__GNUC__) && \ + (defined(UNDEFINED_BEHAVIOR_SANITIZER) || defined(ADDRESS_SANITIZER)) +#define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ + __attribute__((no_sanitize("undefined"))) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_CFI +// +// Tells the ControlFlowIntegrity sanitizer to not instrument a given function. +// See https://clang.llvm.org/docs/ControlFlowIntegrity.html for details. +#if defined(__GNUC__) && defined(CONTROL_FLOW_INTEGRITY) +#define ABSL_ATTRIBUTE_NO_SANITIZE_CFI __attribute__((no_sanitize("cfi"))) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_CFI +#endif + +// ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK +// +// Tells the SafeStack to not instrument a given function. +// See https://clang.llvm.org/docs/SafeStack.html for details. +#if defined(__GNUC__) && defined(SAFESTACK_SANITIZER) +#define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK \ + __attribute__((no_sanitize("safe-stack"))) +#else +#define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK +#endif + +// ABSL_ATTRIBUTE_RETURNS_NONNULL +// +// Tells the compiler that a particular function never returns a null pointer. +#if ABSL_HAVE_ATTRIBUTE(returns_nonnull) || \ + (defined(__GNUC__) && \ + (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \ + !defined(__clang__)) +#define ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) +#else +#define ABSL_ATTRIBUTE_RETURNS_NONNULL +#endif + +// ABSL_HAVE_ATTRIBUTE_SECTION +// +// Indicates whether labeled sections are supported. Weak symbol support is +// a prerequisite. Labeled sections are not supported on Darwin/iOS. +#ifdef ABSL_HAVE_ATTRIBUTE_SECTION +#error ABSL_HAVE_ATTRIBUTE_SECTION cannot be directly set +#elif (ABSL_HAVE_ATTRIBUTE(section) || \ + (defined(__GNUC__) && !defined(__clang__))) && \ + !defined(__APPLE__) && ABSL_HAVE_ATTRIBUTE_WEAK +#define ABSL_HAVE_ATTRIBUTE_SECTION 1 + +// ABSL_ATTRIBUTE_SECTION +// +// Tells the compiler/linker to put a given function into a section and define +// `__start_ ## name` and `__stop_ ## name` symbols to bracket the section. +// This functionality is supported by GNU linker. Any function annotated with +// `ABSL_ATTRIBUTE_SECTION` must not be inlined, or it will be placed into +// whatever section its caller is placed into. +// +#ifndef ABSL_ATTRIBUTE_SECTION +#define ABSL_ATTRIBUTE_SECTION(name) \ + __attribute__((section(#name))) __attribute__((noinline)) +#endif + + +// ABSL_ATTRIBUTE_SECTION_VARIABLE +// +// Tells the compiler/linker to put a given variable into a section and define +// `__start_ ## name` and `__stop_ ## name` symbols to bracket the section. +// This functionality is supported by GNU linker. +#ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE +#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name))) +#endif + +// ABSL_DECLARE_ATTRIBUTE_SECTION_VARS +// +// A weak section declaration to be used as a global declaration +// for ABSL_ATTRIBUTE_SECTION_START|STOP(name) to compile and link +// even without functions with ABSL_ATTRIBUTE_SECTION(name). +// ABSL_DEFINE_ATTRIBUTE_SECTION should be in the exactly one file; it's +// a no-op on ELF but not on Mach-O. +// +#ifndef ABSL_DECLARE_ATTRIBUTE_SECTION_VARS +#define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) \ + extern char __start_##name[] ABSL_ATTRIBUTE_WEAK; \ + extern char __stop_##name[] ABSL_ATTRIBUTE_WEAK +#endif +#ifndef ABSL_DEFINE_ATTRIBUTE_SECTION_VARS +#define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) +#define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) +#endif + +// ABSL_ATTRIBUTE_SECTION_START +// +// Returns `void*` pointers to start/end of a section of code with +// functions having ABSL_ATTRIBUTE_SECTION(name). +// Returns 0 if no such functions exist. +// One must ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) for this to compile and +// link. +// +#define ABSL_ATTRIBUTE_SECTION_START(name) \ + (reinterpret_cast(__start_##name)) +#define ABSL_ATTRIBUTE_SECTION_STOP(name) \ + (reinterpret_cast(__stop_##name)) + +#else // !ABSL_HAVE_ATTRIBUTE_SECTION + +#define ABSL_HAVE_ATTRIBUTE_SECTION 0 + +// provide dummy definitions +#define ABSL_ATTRIBUTE_SECTION(name) +#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) +#define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) +#define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) +#define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) +#define ABSL_ATTRIBUTE_SECTION_START(name) (reinterpret_cast(0)) +#define ABSL_ATTRIBUTE_SECTION_STOP(name) (reinterpret_cast(0)) + +#endif // ABSL_ATTRIBUTE_SECTION + +// ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +// +// Support for aligning the stack on 32-bit x86. +#if ABSL_HAVE_ATTRIBUTE(force_align_arg_pointer) || \ + (defined(__GNUC__) && !defined(__clang__)) +#if defined(__i386__) +#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC \ + __attribute__((force_align_arg_pointer)) +#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#elif defined(__x86_64__) +#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (1) +#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#else // !__i386__ && !__x86_64 +#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#endif // __i386__ +#else +#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#endif + +// ABSL_MUST_USE_RESULT +// +// Tells the compiler to warn about unused results. +// +// When annotating a function, it must appear as the first part of the +// declaration or definition. The compiler will warn if the return value from +// such a function is unused: +// +// ABSL_MUST_USE_RESULT Sprocket* AllocateSprocket(); +// AllocateSprocket(); // Triggers a warning. +// +// When annotating a class, it is equivalent to annotating every function which +// returns an instance. +// +// class ABSL_MUST_USE_RESULT Sprocket {}; +// Sprocket(); // Triggers a warning. +// +// Sprocket MakeSprocket(); +// MakeSprocket(); // Triggers a warning. +// +// Note that references and pointers are not instances: +// +// Sprocket* SprocketPointer(); +// SprocketPointer(); // Does *not* trigger a warning. +// +// ABSL_MUST_USE_RESULT allows using cast-to-void to suppress the unused result +// warning. For that, warn_unused_result is used only for clang but not for gcc. +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 +// +// Note: past advice was to place the macro after the argument list. +#if ABSL_HAVE_ATTRIBUTE(nodiscard) +#define ABSL_MUST_USE_RESULT [[nodiscard]] +#elif defined(__clang__) && ABSL_HAVE_ATTRIBUTE(warn_unused_result) +#define ABSL_MUST_USE_RESULT __attribute__((warn_unused_result)) +#else +#define ABSL_MUST_USE_RESULT +#endif + +// ABSL_ATTRIBUTE_HOT, ABSL_ATTRIBUTE_COLD +// +// Tells GCC that a function is hot or cold. GCC can use this information to +// improve static analysis, i.e. a conditional branch to a cold function +// is likely to be not-taken. +// This annotation is used for function declarations. +// +// Example: +// +// int foo() ABSL_ATTRIBUTE_HOT; +#if ABSL_HAVE_ATTRIBUTE(hot) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_HOT __attribute__((hot)) +#else +#define ABSL_ATTRIBUTE_HOT +#endif + +#if ABSL_HAVE_ATTRIBUTE(cold) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_COLD __attribute__((cold)) +#else +#define ABSL_ATTRIBUTE_COLD +#endif + +// ABSL_XRAY_ALWAYS_INSTRUMENT, ABSL_XRAY_NEVER_INSTRUMENT, ABSL_XRAY_LOG_ARGS +// +// We define the ABSL_XRAY_ALWAYS_INSTRUMENT and ABSL_XRAY_NEVER_INSTRUMENT +// macro used as an attribute to mark functions that must always or never be +// instrumented by XRay. Currently, this is only supported in Clang/LLVM. +// +// For reference on the LLVM XRay instrumentation, see +// http://llvm.org/docs/XRay.html. +// +// A function with the XRAY_ALWAYS_INSTRUMENT macro attribute in its declaration +// will always get the XRay instrumentation sleds. These sleds may introduce +// some binary size and runtime overhead and must be used sparingly. +// +// These attributes only take effect when the following conditions are met: +// +// * The file/target is built in at least C++11 mode, with a Clang compiler +// that supports XRay attributes. +// * The file/target is built with the -fxray-instrument flag set for the +// Clang/LLVM compiler. +// * The function is defined in the translation unit (the compiler honors the +// attribute in either the definition or the declaration, and must match). +// +// There are cases when, even when building with XRay instrumentation, users +// might want to control specifically which functions are instrumented for a +// particular build using special-case lists provided to the compiler. These +// special case lists are provided to Clang via the +// -fxray-always-instrument=... and -fxray-never-instrument=... flags. The +// attributes in source take precedence over these special-case lists. +// +// To disable the XRay attributes at build-time, users may define +// ABSL_NO_XRAY_ATTRIBUTES. Do NOT define ABSL_NO_XRAY_ATTRIBUTES on specific +// packages/targets, as this may lead to conflicting definitions of functions at +// link-time. +// +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_always_instrument) && \ + !defined(ABSL_NO_XRAY_ATTRIBUTES) +#define ABSL_XRAY_ALWAYS_INSTRUMENT [[clang::xray_always_instrument]] +#define ABSL_XRAY_NEVER_INSTRUMENT [[clang::xray_never_instrument]] +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_log_args) +#define ABSL_XRAY_LOG_ARGS(N) \ + [[clang::xray_always_instrument, clang::xray_log_args(N)]] +#else +#define ABSL_XRAY_LOG_ARGS(N) [[clang::xray_always_instrument]] +#endif +#else +#define ABSL_XRAY_ALWAYS_INSTRUMENT +#define ABSL_XRAY_NEVER_INSTRUMENT +#define ABSL_XRAY_LOG_ARGS(N) +#endif + +// ABSL_ATTRIBUTE_REINITIALIZES +// +// Indicates that a member function reinitializes the entire object to a known +// state, independent of the previous state of the object. +// +// The clang-tidy check bugprone-use-after-move allows member functions marked +// with this attribute to be called on objects that have been moved from; +// without the attribute, this would result in a use-after-move warning. +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::reinitializes) +#define ABSL_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] +#else +#define ABSL_ATTRIBUTE_REINITIALIZES +#endif + +// ----------------------------------------------------------------------------- +// Variable Attributes +// ----------------------------------------------------------------------------- + +// ABSL_ATTRIBUTE_UNUSED +// +// Prevents the compiler from complaining about variables that appear unused. +#if ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__)) +#undef ABSL_ATTRIBUTE_UNUSED +#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__)) +#else +#define ABSL_ATTRIBUTE_UNUSED +#endif + +// ABSL_ATTRIBUTE_INITIAL_EXEC +// +// Tells the compiler to use "initial-exec" mode for a thread-local variable. +// See http://people.redhat.com/drepper/tls.pdf for the gory details. +#if ABSL_HAVE_ATTRIBUTE(tls_model) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_INITIAL_EXEC __attribute__((tls_model("initial-exec"))) +#else +#define ABSL_ATTRIBUTE_INITIAL_EXEC +#endif + +// ABSL_ATTRIBUTE_PACKED +// +// Instructs the compiler not to use natural alignment for a tagged data +// structure, but instead to reduce its alignment to 1. This attribute can +// either be applied to members of a structure or to a structure in its +// entirety. Applying this attribute (judiciously) to a structure in its +// entirety to optimize the memory footprint of very commonly-used structs is +// fine. Do not apply this attribute to a structure in its entirety if the +// purpose is to control the offsets of the members in the structure. Instead, +// apply this attribute only to structure members that need it. +// +// When applying ABSL_ATTRIBUTE_PACKED only to specific structure members the +// natural alignment of structure members not annotated is preserved. Aligned +// member accesses are faster than non-aligned member accesses even if the +// targeted microprocessor supports non-aligned accesses. +#if ABSL_HAVE_ATTRIBUTE(packed) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_PACKED __attribute__((__packed__)) +#else +#define ABSL_ATTRIBUTE_PACKED +#endif + +// ABSL_ATTRIBUTE_FUNC_ALIGN +// +// Tells the compiler to align the function start at least to certain +// alignment boundary +#if ABSL_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes))) +#else +#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) +#endif + +// ABSL_CONST_INIT +// +// A variable declaration annotated with the `ABSL_CONST_INIT` attribute will +// not compile (on supported platforms) unless the variable has a constant +// initializer. This is useful for variables with static and thread storage +// duration, because it guarantees that they will not suffer from the so-called +// "static init order fiasco". Prefer to put this attribute on the most visible +// declaration of the variable, if there's more than one, because code that +// accesses the variable can then use the attribute for optimization. +// +// Example: +// +// class MyClass { +// public: +// ABSL_CONST_INIT static MyType my_var; +// }; +// +// MyType MyClass::my_var = MakeMyType(...); +// +// Note that this attribute is redundant if the variable is declared constexpr. +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) +#define ABSL_CONST_INIT [[clang::require_constant_initialization]] +#else +#define ABSL_CONST_INIT +#endif // ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) + +#endif // ABSL_BASE_ATTRIBUTES_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/call_once.h b/SaraAttended/Pods/abseil/absl/base/call_once.h new file mode 100644 index 0000000..bc5ec93 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/call_once.h @@ -0,0 +1,226 @@ +// 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: call_once.h +// ----------------------------------------------------------------------------- +// +// This header file provides an Abseil version of `std::call_once` for invoking +// a given function at most once, across all threads. This Abseil version is +// faster than the C++11 version and incorporates the C++17 argument-passing +// fix, so that (for example) non-const references may be passed to the invoked +// function. + +#ifndef ABSL_BASE_CALL_ONCE_H_ +#define ABSL_BASE_CALL_ONCE_H_ + +#include +#include +#include +#include +#include + +#include "absl/base/internal/invoke.h" +#include "absl/base/internal/low_level_scheduling.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/scheduling_mode.h" +#include "absl/base/internal/spinlock_wait.h" +#include "absl/base/macros.h" +#include "absl/base/optimization.h" +#include "absl/base/port.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +class once_flag; + +namespace base_internal { +std::atomic* ControlWord(absl::once_flag* flag); +} // namespace base_internal + +// call_once() +// +// For all invocations using a given `once_flag`, invokes a given `fn` exactly +// once across all threads. The first call to `call_once()` with a particular +// `once_flag` argument (that does not throw an exception) will run the +// specified function with the provided `args`; other calls with the same +// `once_flag` argument will not run the function, but will wait +// for the provided function to finish running (if it is still running). +// +// This mechanism provides a safe, simple, and fast mechanism for one-time +// initialization in a multi-threaded process. +// +// Example: +// +// class MyInitClass { +// public: +// ... +// mutable absl::once_flag once_; +// +// MyInitClass* init() const { +// absl::call_once(once_, &MyInitClass::Init, this); +// return ptr_; +// } +// +template +void call_once(absl::once_flag& flag, Callable&& fn, Args&&... args); + +// once_flag +// +// Objects of this type are used to distinguish calls to `call_once()` and +// ensure the provided function is only invoked once across all threads. This +// type is not copyable or movable. However, it has a `constexpr` +// constructor, and is safe to use as a namespace-scoped global variable. +class once_flag { + public: + constexpr once_flag() : control_(0) {} + once_flag(const once_flag&) = delete; + once_flag& operator=(const once_flag&) = delete; + + private: + friend std::atomic* base_internal::ControlWord(once_flag* flag); + std::atomic control_; +}; + +//------------------------------------------------------------------------------ +// End of public interfaces. +// Implementation details follow. +//------------------------------------------------------------------------------ + +namespace base_internal { + +// Like call_once, but uses KERNEL_ONLY scheduling. Intended to be used to +// initialize entities used by the scheduler implementation. +template +void LowLevelCallOnce(absl::once_flag* flag, Callable&& fn, Args&&... args); + +// Disables scheduling while on stack when scheduling mode is non-cooperative. +// No effect for cooperative scheduling modes. +class SchedulingHelper { + public: + explicit SchedulingHelper(base_internal::SchedulingMode mode) : mode_(mode) { + if (mode_ == base_internal::SCHEDULE_KERNEL_ONLY) { + guard_result_ = base_internal::SchedulingGuard::DisableRescheduling(); + } + } + + ~SchedulingHelper() { + if (mode_ == base_internal::SCHEDULE_KERNEL_ONLY) { + base_internal::SchedulingGuard::EnableRescheduling(guard_result_); + } + } + + private: + base_internal::SchedulingMode mode_; + bool guard_result_; +}; + +// Bit patterns for call_once state machine values. Internal implementation +// detail, not for use by clients. +// +// The bit patterns are arbitrarily chosen from unlikely values, to aid in +// debugging. However, kOnceInit must be 0, so that a zero-initialized +// once_flag will be valid for immediate use. +enum { + kOnceInit = 0, + kOnceRunning = 0x65C2937B, + kOnceWaiter = 0x05A308D2, + // A very small constant is chosen for kOnceDone so that it fit in a single + // compare with immediate instruction for most common ISAs. This is verified + // for x86, POWER and ARM. + kOnceDone = 221, // Random Number +}; + +template +ABSL_ATTRIBUTE_NOINLINE +void CallOnceImpl(std::atomic* control, + base_internal::SchedulingMode scheduling_mode, Callable&& fn, + Args&&... args) { +#ifndef NDEBUG + { + uint32_t old_control = control->load(std::memory_order_relaxed); + if (old_control != kOnceInit && + old_control != kOnceRunning && + old_control != kOnceWaiter && + old_control != kOnceDone) { + ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx", + static_cast(old_control)); // NOLINT + } + } +#endif // NDEBUG + static const base_internal::SpinLockWaitTransition trans[] = { + {kOnceInit, kOnceRunning, true}, + {kOnceRunning, kOnceWaiter, false}, + {kOnceDone, kOnceDone, true}}; + + // Must do this before potentially modifying control word's state. + base_internal::SchedulingHelper maybe_disable_scheduling(scheduling_mode); + // Short circuit the simplest case to avoid procedure call overhead. + // The base_internal::SpinLockWait() call returns either kOnceInit or + // kOnceDone. If it returns kOnceDone, it must have loaded the control word + // with std::memory_order_acquire and seen a value of kOnceDone. + uint32_t old_control = kOnceInit; + if (control->compare_exchange_strong(old_control, kOnceRunning, + std::memory_order_relaxed) || + base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans, + scheduling_mode) == kOnceInit) { + base_internal::Invoke(std::forward(fn), + std::forward(args)...); + // The call to SpinLockWake below is an optimization, because the waiter + // in SpinLockWait is waiting with a short timeout. The atomic load/store + // sequence is slightly faster than an atomic exchange: + // old_control = control->exchange(base_internal::kOnceDone, + // std::memory_order_release); + // We opt for a slightly faster case when there are no waiters, in spite + // of longer tail latency when there are waiters. + old_control = control->load(std::memory_order_relaxed); + control->store(base_internal::kOnceDone, std::memory_order_release); + if (old_control == base_internal::kOnceWaiter) { + base_internal::SpinLockWake(control, true); + } + } // else *control is already kOnceDone +} + +inline std::atomic* ControlWord(once_flag* flag) { + return &flag->control_; +} + +template +void LowLevelCallOnce(absl::once_flag* flag, Callable&& fn, Args&&... args) { + std::atomic* once = base_internal::ControlWord(flag); + uint32_t s = once->load(std::memory_order_acquire); + if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + base_internal::CallOnceImpl(once, base_internal::SCHEDULE_KERNEL_ONLY, + std::forward(fn), + std::forward(args)...); + } +} + +} // namespace base_internal + +template +void call_once(absl::once_flag& flag, Callable&& fn, Args&&... args) { + std::atomic* once = base_internal::ControlWord(&flag); + uint32_t s = once->load(std::memory_order_acquire); + if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + base_internal::CallOnceImpl( + once, base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL, + std::forward(fn), std::forward(args)...); + } +} + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_CALL_ONCE_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/casts.h b/SaraAttended/Pods/abseil/absl/base/casts.h new file mode 100644 index 0000000..322cc1d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/casts.h @@ -0,0 +1,184 @@ +// +// 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: casts.h +// ----------------------------------------------------------------------------- +// +// This header file defines casting templates to fit use cases not covered by +// the standard casts provided in the C++ standard. As with all cast operations, +// use these with caution and only if alternatives do not exist. + +#ifndef ABSL_BASE_CASTS_H_ +#define ABSL_BASE_CASTS_H_ + +#include +#include +#include +#include + +#include "absl/base/internal/identity.h" +#include "absl/base/macros.h" +#include "absl/meta/type_traits.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +namespace internal_casts { + +template +struct is_bitcastable + : std::integral_constant< + bool, + sizeof(Dest) == sizeof(Source) && + type_traits_internal::is_trivially_copyable::value && + type_traits_internal::is_trivially_copyable::value && + std::is_default_constructible::value> {}; + +} // namespace internal_casts + +// implicit_cast() +// +// Performs an implicit conversion between types following the language +// rules for implicit conversion; if an implicit conversion is otherwise +// allowed by the language in the given context, this function performs such an +// implicit conversion. +// +// Example: +// +// // If the context allows implicit conversion: +// From from; +// To to = from; +// +// // Such code can be replaced by: +// implicit_cast(from); +// +// An `implicit_cast()` may also be used to annotate numeric type conversions +// that, although safe, may produce compiler warnings (such as `long` to `int`). +// Additionally, an `implicit_cast()` is also useful within return statements to +// indicate a specific implicit conversion is being undertaken. +// +// Example: +// +// return implicit_cast(size_in_bytes) / capacity_; +// +// Annotating code with `implicit_cast()` allows you to explicitly select +// particular overloads and template instantiations, while providing a safer +// cast than `reinterpret_cast()` or `static_cast()`. +// +// Additionally, an `implicit_cast()` can be used to allow upcasting within a +// type hierarchy where incorrect use of `static_cast()` could accidentally +// allow downcasting. +// +// Finally, an `implicit_cast()` can be used to perform implicit conversions +// from unrelated types that otherwise couldn't be implicitly cast directly; +// C++ will normally only implicitly cast "one step" in such conversions. +// +// That is, if C is a type which can be implicitly converted to B, with B being +// a type that can be implicitly converted to A, an `implicit_cast()` can be +// used to convert C to B (which the compiler can then implicitly convert to A +// using language rules). +// +// Example: +// +// // Assume an object C is convertible to B, which is implicitly convertible +// // to A +// A a = implicit_cast(C); +// +// Such implicit cast chaining may be useful within template logic. +template +constexpr To implicit_cast(typename absl::internal::identity_t to) { + return to; +} + +// bit_cast() +// +// Performs a bitwise cast on a type without changing the underlying bit +// representation of that type's value. The two types must be of the same size +// and both types must be trivially copyable. As with most casts, use with +// caution. A `bit_cast()` might be needed when you need to temporarily treat a +// type as some other type, such as in the following cases: +// +// * Serialization (casting temporarily to `char *` for those purposes is +// always allowed by the C++ standard) +// * Managing the individual bits of a type within mathematical operations +// that are not normally accessible through that type +// * Casting non-pointer types to pointer types (casting the other way is +// allowed by `reinterpret_cast()` but round-trips cannot occur the other +// way). +// +// Example: +// +// float f = 3.14159265358979; +// int i = bit_cast(f); +// // i = 0x40490fdb +// +// Casting non-pointer types to pointer types and then dereferencing them +// traditionally produces undefined behavior. +// +// Example: +// +// // WRONG +// float f = 3.14159265358979; // WRONG +// int i = * reinterpret_cast(&f); // WRONG +// +// The address-casting method produces undefined behavior according to the ISO +// C++ specification section [basic.lval]. Roughly, this section says: if an +// object in memory has one type, and a program accesses it with a different +// type, the result is undefined behavior for most values of "different type". +// +// Such casting results in type punning: holding an object in memory of one type +// and reading its bits back using a different type. A `bit_cast()` avoids this +// issue by implementing its casts using `memcpy()`, which avoids introducing +// this undefined behavior. +// +// NOTE: The requirements here are more strict than the bit_cast of standard +// proposal p0476 due to the need for workarounds and lack of intrinsics. +// Specifically, this implementation also requires `Dest` to be +// default-constructible. +template < + typename Dest, typename Source, + typename std::enable_if::value, + int>::type = 0> +inline Dest bit_cast(const Source& source) { + Dest dest; + memcpy(static_cast(std::addressof(dest)), + static_cast(std::addressof(source)), sizeof(dest)); + return dest; +} + +// NOTE: This overload is only picked if the requirements of bit_cast are not +// met. It is therefore UB, but is provided temporarily as previous versions of +// this function template were unchecked. Do not use this in new code. +template < + typename Dest, typename Source, + typename std::enable_if< + !internal_casts::is_bitcastable::value, int>::type = 0> +ABSL_DEPRECATED( + "absl::bit_cast type requirements were violated. Update the types being " + "used such that they are the same size and are both TriviallyCopyable.") +inline Dest bit_cast(const Source& source) { + static_assert(sizeof(Dest) == sizeof(Source), + "Source and destination types should have equal sizes."); + + Dest dest; + memcpy(&dest, &source, sizeof(dest)); + return dest; +} + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_CASTS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/config.h b/SaraAttended/Pods/abseil/absl/base/config.h new file mode 100644 index 0000000..ee99f94 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/config.h @@ -0,0 +1,671 @@ +// +// 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/options.h" +#include "absl/base/policy_checks.h" + +// Helper macro to convert a CPP variable to a string literal. +#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x +#define ABSL_INTERNAL_TOKEN_STR(x) ABSL_INTERNAL_DO_TOKEN_STR(x) + +// ----------------------------------------------------------------------------- +// Abseil namespace annotations +// ----------------------------------------------------------------------------- + +// ABSL_NAMESPACE_BEGIN/ABSL_NAMESPACE_END +// +// An annotation placed at the beginning/end of each `namespace absl` scope. +// This is used to inject an inline namespace. +// +// The proper way to write Abseil code in the `absl` namespace is: +// +// namespace absl { +// ABSL_NAMESPACE_BEGIN +// +// void Foo(); // absl::Foo(). +// +// ABSL_NAMESPACE_END +// } // namespace absl +// +// Users of Abseil should not use these macros, because users of Abseil should +// not write `namespace absl {` in their own code for any reason. (Abseil does +// not support forward declarations of its own types, nor does it support +// user-provided specialization of Abseil templates. Code that violates these +// rules may be broken without warning.) +#if !defined(ABSL_OPTION_USE_INLINE_NAMESPACE) || \ + !defined(ABSL_OPTION_INLINE_NAMESPACE_NAME) +#error options.h is misconfigured. +#endif + +// Check that ABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor "" +#if defined(__cplusplus) && ABSL_OPTION_USE_INLINE_NAMESPACE == 1 + +#define ABSL_INTERNAL_INLINE_NAMESPACE_STR \ + ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME) + +static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0', + "options.h misconfigured: ABSL_OPTION_INLINE_NAMESPACE_NAME must " + "not be empty."); +static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || + ABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' || + ABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' || + ABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' || + ABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0', + "options.h misconfigured: ABSL_OPTION_INLINE_NAMESPACE_NAME must " + "be changed to a new, unique identifier name."); + +#endif + +#if ABSL_OPTION_USE_INLINE_NAMESPACE == 0 +#define ABSL_NAMESPACE_BEGIN +#define ABSL_NAMESPACE_END +#elif ABSL_OPTION_USE_INLINE_NAMESPACE == 1 +#define ABSL_NAMESPACE_BEGIN \ + inline namespace ABSL_OPTION_INLINE_NAMESPACE_NAME { +#define ABSL_NAMESPACE_END } +#else +#error options.h is misconfigured. +#endif + +// ----------------------------------------------------------------------------- +// 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 + +#if defined(__is_identifier) +#define ABSL_INTERNAL_HAS_KEYWORD(x) !(__is_identifier(x)) +#else +#define ABSL_INTERNAL_HAS_KEYWORD(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__ > 7 || (__GNUC__ == 7 && __GNUC_MINOR__ >= 4)) && \ + (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_SOURCE_LOCATION_CURRENT +// +// Indicates whether `absl::SourceLocation::current()` will return useful +// information in some contexts. +#ifndef ABSL_HAVE_SOURCE_LOCATION_CURRENT +#if ABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \ + ABSL_INTERNAL_HAS_KEYWORD(__builtin_FILE) +#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 +#endif +#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__) + +// Emscripten doesn't yet support `thread_local` or `__thread`. +// https://github.com/emscripten-core/emscripten/issues/3502 +#if defined(__EMSCRIPTEN__) +#undef ABSL_HAVE_TLS +#undef ABSL_HAVE_THREAD_LOCAL +#endif // defined(__EMSCRIPTEN__) + +// 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. +// * 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(__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__) + +#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6) +// Clang >= 3.6 +#if __has_feature(cxx_exceptions) +#define ABSL_HAVE_EXCEPTIONS 1 +#endif // __has_feature(cxx_exceptions) +#else +// Clang < 3.6 +// 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) +#endif // __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6) + +// 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 (macOS 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_init(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(__MINGW32__) +// mingw32 doesn't provide alarm(2): +// https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/blobs/5.2-trunk/mingwrt/include/unistd.h +// mingw-w64 provides a no-op implementation: +// https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/alarm.c +#elif defined(__EMSCRIPTEN__) +// emscripten doesn't support signals +#elif defined(__Fuchsia__) +// Signals don't exist on fuchsia. +#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 and iOS 10.11 don'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 +// libc++ spells out the availability requirements in the file +// llvm-project/libcxx/include/__config via the #define +// _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS. +#if defined(__APPLE__) && defined(_LIBCPP_VERSION) && \ + ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101400) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \ + __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \ + __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 120000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \ + __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 50000)) +#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1 +#else +#define ABSL_INTERNAL_APPLE_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_APPLE_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_APPLE_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_APPLE_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 + +// ABSL_USES_STD_ANY +// +// Indicates whether absl::any is an alias for std::any. +#if !defined(ABSL_OPTION_USE_STD_ANY) +#error options.h is misconfigured. +#elif ABSL_OPTION_USE_STD_ANY == 0 || \ + (ABSL_OPTION_USE_STD_ANY == 2 && !defined(ABSL_HAVE_STD_ANY)) +#undef ABSL_USES_STD_ANY +#elif ABSL_OPTION_USE_STD_ANY == 1 || \ + (ABSL_OPTION_USE_STD_ANY == 2 && defined(ABSL_HAVE_STD_ANY)) +#define ABSL_USES_STD_ANY 1 +#else +#error options.h is misconfigured. +#endif + +// ABSL_USES_STD_OPTIONAL +// +// Indicates whether absl::optional is an alias for std::optional. +#if !defined(ABSL_OPTION_USE_STD_OPTIONAL) +#error options.h is misconfigured. +#elif ABSL_OPTION_USE_STD_OPTIONAL == 0 || \ + (ABSL_OPTION_USE_STD_OPTIONAL == 2 && !defined(ABSL_HAVE_STD_OPTIONAL)) +#undef ABSL_USES_STD_OPTIONAL +#elif ABSL_OPTION_USE_STD_OPTIONAL == 1 || \ + (ABSL_OPTION_USE_STD_OPTIONAL == 2 && defined(ABSL_HAVE_STD_OPTIONAL)) +#define ABSL_USES_STD_OPTIONAL 1 +#else +#error options.h is misconfigured. +#endif + +// ABSL_USES_STD_VARIANT +// +// Indicates whether absl::variant is an alias for std::variant. +#if !defined(ABSL_OPTION_USE_STD_VARIANT) +#error options.h is misconfigured. +#elif ABSL_OPTION_USE_STD_VARIANT == 0 || \ + (ABSL_OPTION_USE_STD_VARIANT == 2 && !defined(ABSL_HAVE_STD_VARIANT)) +#undef ABSL_USES_STD_VARIANT +#elif ABSL_OPTION_USE_STD_VARIANT == 1 || \ + (ABSL_OPTION_USE_STD_VARIANT == 2 && defined(ABSL_HAVE_STD_VARIANT)) +#define ABSL_USES_STD_VARIANT 1 +#else +#error options.h is misconfigured. +#endif + +// ABSL_USES_STD_STRING_VIEW +// +// Indicates whether absl::string_view is an alias for std::string_view. +#if !defined(ABSL_OPTION_USE_STD_STRING_VIEW) +#error options.h is misconfigured. +#elif ABSL_OPTION_USE_STD_STRING_VIEW == 0 || \ + (ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ + !defined(ABSL_HAVE_STD_STRING_VIEW)) +#undef ABSL_USES_STD_STRING_VIEW +#elif ABSL_OPTION_USE_STD_STRING_VIEW == 1 || \ + (ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ + defined(ABSL_HAVE_STD_STRING_VIEW)) +#define ABSL_USES_STD_STRING_VIEW 1 +#else +#error options.h is misconfigured. +#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 + +// ABSL_INTERNAL_MANGLED_NS +// ABSL_INTERNAL_MANGLED_BACKREFERENCE +// +// Internal macros for building up mangled names in our internal fork of CCTZ. +// This implementation detail is only needed and provided for the MSVC build. +// +// These macros both expand to string literals. ABSL_INTERNAL_MANGLED_NS is +// the mangled spelling of the `absl` namespace, and +// ABSL_INTERNAL_MANGLED_BACKREFERENCE is a back-reference integer representing +// the proper count to skip past the CCTZ fork namespace names. (This number +// is one larger when there is an inline namespace name to skip.) +#if defined(_MSC_VER) +#if ABSL_OPTION_USE_INLINE_NAMESPACE == 0 +#define ABSL_INTERNAL_MANGLED_NS "absl" +#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "5" +#else +#define ABSL_INTERNAL_MANGLED_NS \ + ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME) "@absl" +#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "6" +#endif +#endif + +#undef ABSL_INTERNAL_HAS_KEYWORD + +// ABSL_DLL +// +// When building Abseil as a DLL, this macro expands to `__declspec(dllexport)` +// so we can annotate symbols appropriately as being exported. When used in +// headers consuming a DLL, this macro expands to `__declspec(dllimport)` so +// that consumers know the symbol is defined inside the DLL. In all other cases, +// the macro expands to nothing. +#if defined(_MSC_VER) +#if defined(ABSL_BUILD_DLL) +#define ABSL_DLL __declspec(dllexport) +#elif defined(ABSL_CONSUME_DLL) +#define ABSL_DLL __declspec(dllimport) +#else +#define ABSL_DLL +#endif +#else +#define ABSL_DLL +#endif // defined(_MSC_VER) + +#endif // ABSL_BASE_CONFIG_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/const_init.h b/SaraAttended/Pods/abseil/absl/base/const_init.h new file mode 100644 index 0000000..16520b6 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/const_init.h @@ -0,0 +1,76 @@ +// 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. +// +// ----------------------------------------------------------------------------- +// kConstInit +// ----------------------------------------------------------------------------- +// +// A constructor tag used to mark an object as safe for use as a global +// variable, avoiding the usual lifetime issues that can affect globals. + +#ifndef ABSL_BASE_CONST_INIT_H_ +#define ABSL_BASE_CONST_INIT_H_ + +#include "absl/base/config.h" + +// In general, objects with static storage duration (such as global variables) +// can trigger tricky object lifetime situations. Attempting to access them +// from the constructors or destructors of other global objects can result in +// undefined behavior, unless their constructors and destructors are designed +// with this issue in mind. +// +// The normal way to deal with this issue in C++11 is to use constant +// initialization and trivial destructors. +// +// Constant initialization is guaranteed to occur before any other code +// executes. Constructors that are declared 'constexpr' are eligible for +// constant initialization. You can annotate a variable declaration with the +// ABSL_CONST_INIT macro to express this intent. For compilers that support +// it, this annotation will cause a compilation error for declarations that +// aren't subject to constant initialization (perhaps because a runtime value +// was passed as a constructor argument). +// +// On program shutdown, lifetime issues can be avoided on global objects by +// ensuring that they contain trivial destructors. A class has a trivial +// destructor unless it has a user-defined destructor, a virtual method or base +// class, or a data member or base class with a non-trivial destructor of its +// own. Objects with static storage duration and a trivial destructor are not +// cleaned up on program shutdown, and are thus safe to access from other code +// running during shutdown. +// +// For a few core Abseil classes, we make a best effort to allow for safe global +// instances, even though these classes have non-trivial destructors. These +// objects can be created with the absl::kConstInit tag. For example: +// ABSL_CONST_INIT absl::Mutex global_mutex(absl::kConstInit); +// +// The line above declares a global variable of type absl::Mutex which can be +// accessed at any point during startup or shutdown. global_mutex's destructor +// will still run, but will not invalidate the object. Note that C++ specifies +// that accessing an object after its destructor has run results in undefined +// behavior, but this pattern works on the toolchains we support. +// +// The absl::kConstInit tag should only be used to define objects with static +// or thread_local storage duration. + +namespace absl { +ABSL_NAMESPACE_BEGIN + +enum ConstInitType { + kConstInit, +}; + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_CONST_INIT_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.cc b/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.cc new file mode 100644 index 0000000..21e822e --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.cc @@ -0,0 +1,129 @@ +// 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 "absl/base/dynamic_annotations.h" + +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + +/* Compiler-based ThreadSanitizer defines + DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL = 1 + and provides its own definitions of the functions. */ + +#ifndef DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL +# define DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 0 +#endif + +/* Each function is empty and called (via a macro) only in debug mode. + The arguments are captured by dynamic tools at runtime. */ + +#if DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 && !defined(__native_client__) + +#if __has_feature(memory_sanitizer) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +void AnnotateRWLockCreate(const char *, int, + const volatile void *){} +void AnnotateRWLockDestroy(const char *, int, + const volatile void *){} +void AnnotateRWLockAcquired(const char *, int, + const volatile void *, long){} +void AnnotateRWLockReleased(const char *, int, + const volatile void *, long){} +void AnnotateBenignRace(const char *, int, + const volatile void *, + const char *){} +void AnnotateBenignRaceSized(const char *, int, + const volatile void *, + size_t, + const char *) {} +void AnnotateThreadName(const char *, int, + const char *){} +void AnnotateIgnoreReadsBegin(const char *, int){} +void AnnotateIgnoreReadsEnd(const char *, int){} +void AnnotateIgnoreWritesBegin(const char *, int){} +void AnnotateIgnoreWritesEnd(const char *, int){} +void AnnotateEnableRaceDetection(const char *, int, int){} +void AnnotateMemoryIsInitialized(const char *, int, + const volatile void *mem, size_t size) { +#if __has_feature(memory_sanitizer) + __msan_unpoison(mem, size); +#else + (void)mem; + (void)size; +#endif +} + +void AnnotateMemoryIsUninitialized(const char *, int, + const volatile void *mem, size_t size) { +#if __has_feature(memory_sanitizer) + __msan_allocated_memory(mem, size); +#else + (void)mem; + (void)size; +#endif +} + +static int GetRunningOnValgrind(void) { +#ifdef RUNNING_ON_VALGRIND + if (RUNNING_ON_VALGRIND) return 1; +#endif + char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND"); + if (running_on_valgrind_str) { + return strcmp(running_on_valgrind_str, "0") != 0; + } + return 0; +} + +/* See the comments in dynamic_annotations.h */ +int RunningOnValgrind(void) { + static volatile int running_on_valgrind = -1; + int local_running_on_valgrind = running_on_valgrind; + /* C doesn't have thread-safe initialization of statics, and we + don't want to depend on pthread_once here, so hack it. */ + ANNOTATE_BENIGN_RACE(&running_on_valgrind, "safe hack"); + if (local_running_on_valgrind == -1) + running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); + return local_running_on_valgrind; +} + +/* See the comments in dynamic_annotations.h */ +double ValgrindSlowdown(void) { + /* Same initialization hack as in RunningOnValgrind(). */ + static volatile double slowdown = 0.0; + double local_slowdown = slowdown; + ANNOTATE_BENIGN_RACE(&slowdown, "safe hack"); + if (RunningOnValgrind() == 0) { + return 1.0; + } + if (local_slowdown == 0.0) { + char *env = getenv("VALGRIND_SLOWDOWN"); + slowdown = local_slowdown = env ? atof(env) : 50.0; + } + return local_slowdown; +} + +#ifdef __cplusplus +} // extern "C" +#endif +#endif /* DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 */ diff --git a/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.h b/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.h new file mode 100644 index 0000000..65a54b4 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/dynamic_annotations.h @@ -0,0 +1,389 @@ +/* + * 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 file defines dynamic annotations for use with dynamic analysis + tool such as valgrind, PIN, etc. + + Dynamic annotation is a source code annotation that affects + the generated code (that is, the annotation is not a comment). + Each such annotation is attached to a particular + instruction and/or to a particular object (address) in the program. + + The annotations that should be used by users are macros in all upper-case + (e.g., ANNOTATE_THREAD_NAME). + + Actual implementation of these macros may differ depending on the + dynamic analysis tool being used. + + This file supports the following configurations: + - Dynamic Annotations enabled (with static thread-safety warnings disabled). + In this case, macros expand to functions implemented by Thread Sanitizer, + when building with TSan. When not provided an external implementation, + dynamic_annotations.cc provides no-op implementations. + + - Static Clang thread-safety warnings enabled. + When building with a Clang compiler that supports thread-safety warnings, + a subset of annotations can be statically-checked at compile-time. We + expand these macros to static-inline functions that can be analyzed for + thread-safety, but afterwards elided when building the final binary. + + - All annotations are disabled. + If neither Dynamic Annotations nor Clang thread-safety warnings are + enabled, then all annotation-macros expand to empty. */ + +#ifndef ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ +#define ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ + +#ifndef DYNAMIC_ANNOTATIONS_ENABLED +# define DYNAMIC_ANNOTATIONS_ENABLED 0 +#endif + +#if DYNAMIC_ANNOTATIONS_ENABLED != 0 + + /* ------------------------------------------------------------- + Annotations that suppress errors. It is usually better to express the + program's synchronization using the other annotations, but these can + be used when all else fails. */ + + /* Report that we may have a benign race at "pointer", with size + "sizeof(*(pointer))". "pointer" must be a non-void* pointer. Insert at the + point where "pointer" has been allocated, preferably close to the point + where the race happens. See also ANNOTATE_BENIGN_RACE_STATIC. */ + #define ANNOTATE_BENIGN_RACE(pointer, description) \ + AnnotateBenignRaceSized(__FILE__, __LINE__, pointer, \ + sizeof(*(pointer)), description) + + /* Same as ANNOTATE_BENIGN_RACE(address, description), but applies to + the memory range [address, address+size). */ + #define ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ + AnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description) + + /* Enable (enable!=0) or disable (enable==0) race detection for all threads. + This annotation could be useful if you want to skip expensive race analysis + during some period of program execution, e.g. during initialization. */ + #define ANNOTATE_ENABLE_RACE_DETECTION(enable) \ + AnnotateEnableRaceDetection(__FILE__, __LINE__, enable) + + /* ------------------------------------------------------------- + Annotations useful for debugging. */ + + /* Report the current thread name to a race detector. */ + #define ANNOTATE_THREAD_NAME(name) \ + AnnotateThreadName(__FILE__, __LINE__, name) + + /* ------------------------------------------------------------- + Annotations useful when implementing locks. They are not + normally needed by modules that merely use locks. + The "lock" argument is a pointer to the lock object. */ + + /* Report that a lock has been created at address "lock". */ + #define ANNOTATE_RWLOCK_CREATE(lock) \ + AnnotateRWLockCreate(__FILE__, __LINE__, lock) + + /* Report that a linker initialized lock has been created at address "lock". + */ +#ifdef THREAD_SANITIZER + #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ + AnnotateRWLockCreateStatic(__FILE__, __LINE__, lock) +#else + #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) ANNOTATE_RWLOCK_CREATE(lock) +#endif + + /* Report that the lock at address "lock" is about to be destroyed. */ + #define ANNOTATE_RWLOCK_DESTROY(lock) \ + AnnotateRWLockDestroy(__FILE__, __LINE__, lock) + + /* Report that the lock at address "lock" has been acquired. + is_w=1 for writer lock, is_w=0 for reader lock. */ + #define ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \ + AnnotateRWLockAcquired(__FILE__, __LINE__, lock, is_w) + + /* Report that the lock at address "lock" is about to be released. */ + #define ANNOTATE_RWLOCK_RELEASED(lock, is_w) \ + AnnotateRWLockReleased(__FILE__, __LINE__, lock, is_w) + +#else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */ + + #define ANNOTATE_RWLOCK_CREATE(lock) /* empty */ + #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) /* empty */ + #define ANNOTATE_RWLOCK_DESTROY(lock) /* empty */ + #define ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) /* empty */ + #define ANNOTATE_RWLOCK_RELEASED(lock, is_w) /* empty */ + #define ANNOTATE_BENIGN_RACE(address, description) /* empty */ + #define ANNOTATE_BENIGN_RACE_SIZED(address, size, description) /* empty */ + #define ANNOTATE_THREAD_NAME(name) /* empty */ + #define ANNOTATE_ENABLE_RACE_DETECTION(enable) /* empty */ + +#endif /* DYNAMIC_ANNOTATIONS_ENABLED */ + +/* These annotations are also made available to LLVM's Memory Sanitizer */ +#if DYNAMIC_ANNOTATIONS_ENABLED == 1 || defined(MEMORY_SANITIZER) + #define ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ + AnnotateMemoryIsInitialized(__FILE__, __LINE__, address, size) + + #define ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ + AnnotateMemoryIsUninitialized(__FILE__, __LINE__, address, size) +#else + #define ANNOTATE_MEMORY_IS_INITIALIZED(address, size) /* empty */ + #define ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) /* empty */ +#endif /* DYNAMIC_ANNOTATIONS_ENABLED || MEMORY_SANITIZER */ + +/* TODO(delesley) -- Replace __CLANG_SUPPORT_DYN_ANNOTATION__ with the + appropriate feature ID. */ +#if defined(__clang__) && (!defined(SWIG)) \ + && defined(__CLANG_SUPPORT_DYN_ANNOTATION__) + + #if DYNAMIC_ANNOTATIONS_ENABLED == 0 + #define ANNOTALYSIS_ENABLED + #endif + + /* When running in opt-mode, GCC will issue a warning, if these attributes are + compiled. Only include them when compiling using Clang. */ + #define ATTRIBUTE_IGNORE_READS_BEGIN \ + __attribute((exclusive_lock_function("*"))) + #define ATTRIBUTE_IGNORE_READS_END \ + __attribute((unlock_function("*"))) +#else + #define ATTRIBUTE_IGNORE_READS_BEGIN /* empty */ + #define ATTRIBUTE_IGNORE_READS_END /* empty */ +#endif /* defined(__clang__) && ... */ + +#if (DYNAMIC_ANNOTATIONS_ENABLED != 0) || defined(ANNOTALYSIS_ENABLED) + #define ANNOTATIONS_ENABLED +#endif + +#if (DYNAMIC_ANNOTATIONS_ENABLED != 0) + + /* Request the analysis tool to ignore all reads in the current thread + until ANNOTATE_IGNORE_READS_END is called. + Useful to ignore intentional racey reads, while still checking + other reads and all writes. + See also ANNOTATE_UNPROTECTED_READ. */ + #define ANNOTATE_IGNORE_READS_BEGIN() \ + AnnotateIgnoreReadsBegin(__FILE__, __LINE__) + + /* Stop ignoring reads. */ + #define ANNOTATE_IGNORE_READS_END() \ + AnnotateIgnoreReadsEnd(__FILE__, __LINE__) + + /* Similar to ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead. */ + #define ANNOTATE_IGNORE_WRITES_BEGIN() \ + AnnotateIgnoreWritesBegin(__FILE__, __LINE__) + + /* Stop ignoring writes. */ + #define ANNOTATE_IGNORE_WRITES_END() \ + AnnotateIgnoreWritesEnd(__FILE__, __LINE__) + +/* Clang provides limited support for static thread-safety analysis + through a feature called Annotalysis. We configure macro-definitions + according to whether Annotalysis support is available. */ +#elif defined(ANNOTALYSIS_ENABLED) + + #define ANNOTATE_IGNORE_READS_BEGIN() \ + StaticAnnotateIgnoreReadsBegin(__FILE__, __LINE__) + + #define ANNOTATE_IGNORE_READS_END() \ + StaticAnnotateIgnoreReadsEnd(__FILE__, __LINE__) + + #define ANNOTATE_IGNORE_WRITES_BEGIN() \ + StaticAnnotateIgnoreWritesBegin(__FILE__, __LINE__) + + #define ANNOTATE_IGNORE_WRITES_END() \ + StaticAnnotateIgnoreWritesEnd(__FILE__, __LINE__) + +#else + #define ANNOTATE_IGNORE_READS_BEGIN() /* empty */ + #define ANNOTATE_IGNORE_READS_END() /* empty */ + #define ANNOTATE_IGNORE_WRITES_BEGIN() /* empty */ + #define ANNOTATE_IGNORE_WRITES_END() /* empty */ +#endif + +/* Implement the ANNOTATE_IGNORE_READS_AND_WRITES_* annotations using the more + primitive annotations defined above. */ +#if defined(ANNOTATIONS_ENABLED) + + /* Start ignoring all memory accesses (both reads and writes). */ + #define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \ + do { \ + ANNOTATE_IGNORE_READS_BEGIN(); \ + ANNOTATE_IGNORE_WRITES_BEGIN(); \ + }while (0) + + /* Stop ignoring both reads and writes. */ + #define ANNOTATE_IGNORE_READS_AND_WRITES_END() \ + do { \ + ANNOTATE_IGNORE_WRITES_END(); \ + ANNOTATE_IGNORE_READS_END(); \ + }while (0) + +#else + #define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() /* empty */ + #define ANNOTATE_IGNORE_READS_AND_WRITES_END() /* empty */ +#endif + +/* Use the macros above rather than using these functions directly. */ +#include +#ifdef __cplusplus +extern "C" { +#endif +void AnnotateRWLockCreate(const char *file, int line, + const volatile void *lock); +void AnnotateRWLockCreateStatic(const char *file, int line, + const volatile void *lock); +void AnnotateRWLockDestroy(const char *file, int line, + const volatile void *lock); +void AnnotateRWLockAcquired(const char *file, int line, + const volatile void *lock, long is_w); /* NOLINT */ +void AnnotateRWLockReleased(const char *file, int line, + const volatile void *lock, long is_w); /* NOLINT */ +void AnnotateBenignRace(const char *file, int line, + const volatile void *address, + const char *description); +void AnnotateBenignRaceSized(const char *file, int line, + const volatile void *address, + size_t size, + const char *description); +void AnnotateThreadName(const char *file, int line, + const char *name); +void AnnotateEnableRaceDetection(const char *file, int line, int enable); +void AnnotateMemoryIsInitialized(const char *file, int line, + const volatile void *mem, size_t size); +void AnnotateMemoryIsUninitialized(const char *file, int line, + const volatile void *mem, size_t size); + +/* Annotations expand to these functions, when Dynamic Annotations are enabled. + These functions are either implemented as no-op calls, if no Sanitizer is + attached, or provided with externally-linked implementations by a library + like ThreadSanitizer. */ +void AnnotateIgnoreReadsBegin(const char *file, int line) + ATTRIBUTE_IGNORE_READS_BEGIN; +void AnnotateIgnoreReadsEnd(const char *file, int line) + ATTRIBUTE_IGNORE_READS_END; +void AnnotateIgnoreWritesBegin(const char *file, int line); +void AnnotateIgnoreWritesEnd(const char *file, int line); + +#if defined(ANNOTALYSIS_ENABLED) +/* When Annotalysis is enabled without Dynamic Annotations, the use of + static-inline functions allows the annotations to be read at compile-time, + while still letting the compiler elide the functions from the final build. + + TODO(delesley) -- The exclusive lock here ignores writes as well, but + allows IGNORE_READS_AND_WRITES to work properly. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +static inline void StaticAnnotateIgnoreReadsBegin(const char *file, int line) + ATTRIBUTE_IGNORE_READS_BEGIN { (void)file; (void)line; } +static inline void StaticAnnotateIgnoreReadsEnd(const char *file, int line) + ATTRIBUTE_IGNORE_READS_END { (void)file; (void)line; } +static inline void StaticAnnotateIgnoreWritesBegin( + const char *file, int line) { (void)file; (void)line; } +static inline void StaticAnnotateIgnoreWritesEnd( + const char *file, int line) { (void)file; (void)line; } +#pragma GCC diagnostic pop +#endif + +/* Return non-zero value if running under valgrind. + + If "valgrind.h" is included into dynamic_annotations.cc, + the regular valgrind mechanism will be used. + See http://valgrind.org/docs/manual/manual-core-adv.html about + RUNNING_ON_VALGRIND and other valgrind "client requests". + The file "valgrind.h" may be obtained by doing + svn co svn://svn.valgrind.org/valgrind/trunk/include + + If for some reason you can't use "valgrind.h" or want to fake valgrind, + there are two ways to make this function return non-zero: + - Use environment variable: export RUNNING_ON_VALGRIND=1 + - Make your tool intercept the function RunningOnValgrind() and + change its return value. + */ +int RunningOnValgrind(void); + +/* ValgrindSlowdown returns: + * 1.0, if (RunningOnValgrind() == 0) + * 50.0, if (RunningOnValgrind() != 0 && getenv("VALGRIND_SLOWDOWN") == NULL) + * atof(getenv("VALGRIND_SLOWDOWN")) otherwise + This function can be used to scale timeout values: + EXAMPLE: + for (;;) { + DoExpensiveBackgroundTask(); + SleepForSeconds(5 * ValgrindSlowdown()); + } + */ +double ValgrindSlowdown(void); + +#ifdef __cplusplus +} +#endif + +/* ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads. + + Instead of doing + ANNOTATE_IGNORE_READS_BEGIN(); + ... = x; + ANNOTATE_IGNORE_READS_END(); + one can use + ... = ANNOTATE_UNPROTECTED_READ(x); */ +#if defined(__cplusplus) && defined(ANNOTATIONS_ENABLED) +template +inline T ANNOTATE_UNPROTECTED_READ(const volatile T &x) { /* NOLINT */ + ANNOTATE_IGNORE_READS_BEGIN(); + T res = x; + ANNOTATE_IGNORE_READS_END(); + return res; + } +#else + #define ANNOTATE_UNPROTECTED_READ(x) (x) +#endif + +#if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus) + /* Apply ANNOTATE_BENIGN_RACE_SIZED to a static variable. */ + #define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \ + namespace { \ + class static_var ## _annotator { \ + public: \ + static_var ## _annotator() { \ + ANNOTATE_BENIGN_RACE_SIZED(&static_var, \ + sizeof(static_var), \ + # static_var ": " description); \ + } \ + }; \ + static static_var ## _annotator the ## static_var ## _annotator;\ + } // namespace +#else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */ + #define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) /* empty */ +#endif /* DYNAMIC_ANNOTATIONS_ENABLED */ + +#ifdef ADDRESS_SANITIZER +/* Describe the current state of a contiguous container such as e.g. + * std::vector or std::string. For more details see + * sanitizer/common_interface_defs.h, which is provided by the compiler. */ +#include +#define ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) \ + __sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid) +#define ADDRESS_SANITIZER_REDZONE(name) \ + struct { char x[8] __attribute__ ((aligned (8))); } name +#else +#define ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) +#define ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "") +#endif // ADDRESS_SANITIZER + +/* Undefine the macros intended only in this file. */ +#undef ANNOTALYSIS_ENABLED +#undef ANNOTATIONS_ENABLED +#undef ATTRIBUTE_IGNORE_READS_BEGIN +#undef ATTRIBUTE_IGNORE_READS_END + +#endif /* ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ */ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/atomic_hook.h b/SaraAttended/Pods/abseil/absl/base/internal/atomic_hook.h new file mode 100644 index 0000000..ae21cd7 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/atomic_hook.h @@ -0,0 +1,200 @@ +// 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 + +#include "absl/base/attributes.h" +#include "absl/base/config.h" + +#if defined(_MSC_VER) && !defined(__clang__) +#define ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 0 +#else +#define ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 1 +#endif + +#if defined(_MSC_VER) +#define ABSL_HAVE_WORKING_ATOMIC_POINTER 0 +#else +#define ABSL_HAVE_WORKING_ATOMIC_POINTER 1 +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +template +class AtomicHook; + +// To workaround AtomicHook not being constant-initializable on some platforms, +// prefer to annotate instances with `ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES` +// instead of `ABSL_CONST_INIT`. +#if ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT +#define ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_CONST_INIT +#else +#define ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES +#endif + +// `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. Objects of type `AtomicHook` must have +// static or thread storage duration. +// +// 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_INTERNAL_ATOMIC_HOOK_ATTRIBUTES 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 && ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT + explicit constexpr AtomicHook(FnPtr default_fn) + : hook_(default_fn), default_fn_(default_fn) {} +#elif ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT + explicit constexpr AtomicHook(FnPtr default_fn) + : hook_(kUninitialized), default_fn_(default_fn) {} +#else + // As of January 2020, on all known versions of MSVC this constructor runs in + // the global constructor sequence. If `Store()` is called by a dynamic + // initializer, we want to preserve the value, even if this constructor runs + // after the call to `Store()`. If not, `hook_` will be + // zero-initialized by the linker and we have no need to set it. + // https://developercommunity.visualstudio.com/content/problem/336946/class-with-constexpr-constructor-not-using-static.html + explicit constexpr AtomicHook(FnPtr default_fn) + : /* hook_(deliberately omitted), */ default_fn_(default_fn) { + static_assert(kUninitialized == 0, "here we rely on zero-initialization"); + } +#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 +#undef ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/bits.h b/SaraAttended/Pods/abseil/absl/base/internal/bits.h new file mode 100644 index 0000000..8b03453 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/bits.h @@ -0,0 +1,218 @@ +// 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 + +#include "absl/base/config.h" + +// 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 { +ABSL_NAMESPACE_BEGIN +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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_BITS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.cc b/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.cc new file mode 100644 index 0000000..0e65005 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.cc @@ -0,0 +1,107 @@ +// 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. + +// The implementation of CycleClock::Frequency. +// +// NOTE: only i386 and x86_64 have been well tested. +// PPC, sparc, alpha, and ia64 are based on +// http://peter.kuscsik.com/wordpress/?p=14 +// with modifications by m3b. See also +// https://setisvn.ssl.berkeley.edu/svn/lib/fftw-3.0.1/kernel/cycle.h + +#include "absl/base/internal/cycleclock.h" + +#include +#include // NOLINT(build/c++11) + +#include "absl/base/internal/unscaledcycleclock.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +#if ABSL_USE_UNSCALED_CYCLECLOCK + +namespace { + +#ifdef NDEBUG +#ifdef ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +// Not debug mode and the UnscaledCycleClock frequency is the CPU +// frequency. Scale the CycleClock to prevent overflow if someone +// tries to represent the time as cycles since the Unix epoch. +static constexpr int32_t kShift = 1; +#else +// Not debug mode and the UnscaledCycleClock isn't operating at the +// raw CPU frequency. There is no need to do any scaling, so don't +// needlessly sacrifice precision. +static constexpr int32_t kShift = 0; +#endif +#else +// In debug mode use a different shift to discourage depending on a +// particular shift value. +static constexpr int32_t kShift = 2; +#endif + +static constexpr double kFrequencyScale = 1.0 / (1 << kShift); +static std::atomic cycle_clock_source; + +CycleClockSourceFunc LoadCycleClockSource() { + // Optimize for the common case (no callback) by first doing a relaxed load; + // this is significantly faster on non-x86 platforms. + if (cycle_clock_source.load(std::memory_order_relaxed) == nullptr) { + return nullptr; + } + // This corresponds to the store(std::memory_order_release) in + // CycleClockSource::Register, and makes sure that any updates made prior to + // registering the callback are visible to this thread before the callback is + // invoked. + return cycle_clock_source.load(std::memory_order_acquire); +} + +} // namespace + +int64_t CycleClock::Now() { + auto fn = LoadCycleClockSource(); + if (fn == nullptr) { + return base_internal::UnscaledCycleClock::Now() >> kShift; + } + return fn() >> kShift; +} + +double CycleClock::Frequency() { + return kFrequencyScale * base_internal::UnscaledCycleClock::Frequency(); +} + +void CycleClockSource::Register(CycleClockSourceFunc source) { + // Corresponds to the load(std::memory_order_acquire) in LoadCycleClockSource. + cycle_clock_source.store(source, std::memory_order_release); +} + +#else + +int64_t CycleClock::Now() { + return std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch()) + .count(); +} + +double CycleClock::Frequency() { + return 1e9; +} + +#endif + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.h b/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.h new file mode 100644 index 0000000..a18b584 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/cycleclock.h @@ -0,0 +1,94 @@ +// +// 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: cycleclock.h +// ----------------------------------------------------------------------------- +// +// This header file defines a `CycleClock`, which yields the value and frequency +// of a cycle counter that increments at a rate that is approximately constant. +// +// NOTE: +// +// The cycle counter frequency is not necessarily related to the core clock +// frequency and should not be treated as such. That is, `CycleClock` cycles are +// not necessarily "CPU cycles" and code should not rely on that behavior, even +// if experimentally observed. +// +// An arbitrary offset may have been added to the counter at power on. +// +// On some platforms, the rate and offset of the counter may differ +// slightly when read from different CPUs of a multiprocessor. Usually, +// we try to ensure that the operating system adjusts values periodically +// so that values agree approximately. If you need stronger guarantees, +// consider using alternate interfaces. +// +// The CPU is not required to maintain the ordering of a cycle counter read +// with respect to surrounding instructions. + +#ifndef ABSL_BASE_INTERNAL_CYCLECLOCK_H_ +#define ABSL_BASE_INTERNAL_CYCLECLOCK_H_ + +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// ----------------------------------------------------------------------------- +// CycleClock +// ----------------------------------------------------------------------------- +class CycleClock { + public: + // CycleClock::Now() + // + // Returns the value of a cycle counter that counts at a rate that is + // approximately constant. + static int64_t Now(); + + // CycleClock::Frequency() + // + // Returns the amount by which `CycleClock::Now()` increases per second. Note + // that this value may not necessarily match the core CPU clock frequency. + static double Frequency(); + + private: + CycleClock() = delete; // no instances + CycleClock(const CycleClock&) = delete; + CycleClock& operator=(const CycleClock&) = delete; +}; + +using CycleClockSourceFunc = int64_t (*)(); + +class CycleClockSource { + private: + // CycleClockSource::Register() + // + // Register a function that provides an alternate source for the unscaled CPU + // cycle count value. The source function must be async signal safe, must not + // call CycleClock::Now(), and must have a frequency that matches that of the + // unscaled clock used by CycleClock. A nullptr value resets CycleClock to use + // the default source. + static void Register(CycleClockSourceFunc source); +}; + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_CYCLECLOCK_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/direct_mmap.h b/SaraAttended/Pods/abseil/absl/base/internal/direct_mmap.h new file mode 100644 index 0000000..5618867 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/direct_mmap.h @@ -0,0 +1,161 @@ +// 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. +// +// Functions for directly invoking mmap() via syscall, avoiding the case where +// mmap() has been locally overridden. + +#ifndef ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ +#define ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ + +#include "absl/base/config.h" + +#if ABSL_HAVE_MMAP + +#include + +#ifdef __linux__ + +#include +#ifdef __BIONIC__ +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef __mips__ +// Include definitions of the ABI currently in use. +#ifdef __BIONIC__ +// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the +// definitions we need. +#include +#else +#include +#endif // __BIONIC__ +#endif // __mips__ + +// SYS_mmap and SYS_munmap are not defined in Android. +#ifdef __BIONIC__ +extern "C" void* __mmap2(void*, size_t, int, int, int, size_t); +#if defined(__NR_mmap) && !defined(SYS_mmap) +#define SYS_mmap __NR_mmap +#endif +#ifndef SYS_munmap +#define SYS_munmap __NR_munmap +#endif +#endif // __BIONIC__ + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Platform specific logic extracted from +// https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h +inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + off64_t offset) noexcept { +#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ + (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ + (defined(__PPC__) && !defined(__PPC64__)) || \ + (defined(__s390__) && !defined(__s390x__)) + // On these architectures, implement mmap with mmap2. + static int pagesize = 0; + if (pagesize == 0) { +#if defined(__wasm__) || defined(__asmjs__) + pagesize = getpagesize(); +#else + pagesize = sysconf(_SC_PAGESIZE); +#endif + } + if (offset < 0 || offset % pagesize != 0) { + errno = EINVAL; + return MAP_FAILED; + } +#ifdef __BIONIC__ + // SYS_mmap2 has problems on Android API level <= 16. + // Workaround by invoking __mmap2() instead. + return __mmap2(start, length, prot, flags, fd, offset / pagesize); +#else + return reinterpret_cast( + syscall(SYS_mmap2, start, length, prot, flags, fd, + static_cast(offset / pagesize))); +#endif +#elif defined(__s390x__) + // On s390x, mmap() arguments are passed in memory. + unsigned long buf[6] = {reinterpret_cast(start), // NOLINT + static_cast(length), // NOLINT + static_cast(prot), // NOLINT + static_cast(flags), // NOLINT + static_cast(fd), // NOLINT + static_cast(offset)}; // NOLINT + return reinterpret_cast(syscall(SYS_mmap, buf)); +#elif defined(__x86_64__) +// The x32 ABI has 32 bit longs, but the syscall interface is 64 bit. +// We need to explicitly cast to an unsigned 64 bit type to avoid implicit +// sign extension. We can't cast pointers directly because those are +// 32 bits, and gcc will dump ugly warnings about casting from a pointer +// to an integer of a different size. We also need to make sure __off64_t +// isn't truncated to 32-bits under x32. +#define MMAP_SYSCALL_ARG(x) ((uint64_t)(uintptr_t)(x)) + return reinterpret_cast( + syscall(SYS_mmap, MMAP_SYSCALL_ARG(start), MMAP_SYSCALL_ARG(length), + MMAP_SYSCALL_ARG(prot), MMAP_SYSCALL_ARG(flags), + MMAP_SYSCALL_ARG(fd), static_cast(offset))); +#undef MMAP_SYSCALL_ARG +#else // Remaining 64-bit aritectures. + static_assert(sizeof(unsigned long) == 8, "Platform is not 64-bit"); + return reinterpret_cast( + syscall(SYS_mmap, start, length, prot, flags, fd, offset)); +#endif +} + +inline int DirectMunmap(void* start, size_t length) { + return static_cast(syscall(SYS_munmap, start, length)); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#else // !__linux__ + +// For non-linux platforms where we have mmap, just dispatch directly to the +// actual mmap()/munmap() methods. + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + off_t offset) { + return mmap(start, length, prot, flags, fd, offset); +} + +inline int DirectMunmap(void* start, size_t length) { + return munmap(start, length); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // __linux__ + +#endif // ABSL_HAVE_MMAP + +#endif // ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/endian.h b/SaraAttended/Pods/abseil/absl/base/internal/endian.h new file mode 100644 index 0000000..9677530 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/endian.h @@ -0,0 +1,266 @@ +// 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_ENDIAN_H_ +#define ABSL_BASE_INTERNAL_ENDIAN_H_ + +// The following guarantees declaration of the byte swap functions +#ifdef _MSC_VER +#include // NOLINT(build/include) +#elif defined(__FreeBSD__) +#include +#elif defined(__GLIBC__) +#include // IWYU pragma: export +#endif + +#include +#include "absl/base/config.h" +#include "absl/base/internal/unaligned_access.h" +#include "absl/base/port.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// Use compiler byte-swapping intrinsics if they are available. 32-bit +// and 64-bit versions are available in Clang and GCC as of GCC 4.3.0. +// The 16-bit version is available in Clang and GCC only as of GCC 4.8.0. +// For simplicity, we enable them all only for GCC 4.8.0 or later. +#if defined(__clang__) || \ + (defined(__GNUC__) && \ + ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ >= 5)) +inline uint64_t gbswap_64(uint64_t host_int) { + return __builtin_bswap64(host_int); +} +inline uint32_t gbswap_32(uint32_t host_int) { + return __builtin_bswap32(host_int); +} +inline uint16_t gbswap_16(uint16_t host_int) { + return __builtin_bswap16(host_int); +} + +#elif defined(_MSC_VER) +inline uint64_t gbswap_64(uint64_t host_int) { + return _byteswap_uint64(host_int); +} +inline uint32_t gbswap_32(uint32_t host_int) { + return _byteswap_ulong(host_int); +} +inline uint16_t gbswap_16(uint16_t host_int) { + return _byteswap_ushort(host_int); +} + +#else +inline uint64_t gbswap_64(uint64_t host_int) { +#if defined(__GNUC__) && defined(__x86_64__) && !defined(__APPLE__) + // Adapted from /usr/include/byteswap.h. Not available on Mac. + if (__builtin_constant_p(host_int)) { + return __bswap_constant_64(host_int); + } else { + uint64_t result; + __asm__("bswap %0" : "=r"(result) : "0"(host_int)); + return result; + } +#elif defined(__GLIBC__) + return bswap_64(host_int); +#else + return (((host_int & uint64_t{0xFF}) << 56) | + ((host_int & uint64_t{0xFF00}) << 40) | + ((host_int & uint64_t{0xFF0000}) << 24) | + ((host_int & uint64_t{0xFF000000}) << 8) | + ((host_int & uint64_t{0xFF00000000}) >> 8) | + ((host_int & uint64_t{0xFF0000000000}) >> 24) | + ((host_int & uint64_t{0xFF000000000000}) >> 40) | + ((host_int & uint64_t{0xFF00000000000000}) >> 56)); +#endif // bswap_64 +} + +inline uint32_t gbswap_32(uint32_t host_int) { +#if defined(__GLIBC__) + return bswap_32(host_int); +#else + return (((host_int & uint32_t{0xFF}) << 24) | + ((host_int & uint32_t{0xFF00}) << 8) | + ((host_int & uint32_t{0xFF0000}) >> 8) | + ((host_int & uint32_t{0xFF000000}) >> 24)); +#endif +} + +inline uint16_t gbswap_16(uint16_t host_int) { +#if defined(__GLIBC__) + return bswap_16(host_int); +#else + return (((host_int & uint16_t{0xFF}) << 8) | + ((host_int & uint16_t{0xFF00}) >> 8)); +#endif +} + +#endif // intrinsics available + +#ifdef ABSL_IS_LITTLE_ENDIAN + +// Definitions for ntohl etc. that don't require us to include +// netinet/in.h. We wrap gbswap_32 and gbswap_16 in functions rather +// than just #defining them because in debug mode, gcc doesn't +// correctly handle the (rather involved) definitions of bswap_32. +// gcc guarantees that inline functions are as fast as macros, so +// this isn't a performance hit. +inline uint16_t ghtons(uint16_t x) { return gbswap_16(x); } +inline uint32_t ghtonl(uint32_t x) { return gbswap_32(x); } +inline uint64_t ghtonll(uint64_t x) { return gbswap_64(x); } + +#elif defined ABSL_IS_BIG_ENDIAN + +// These definitions are simpler on big-endian machines +// These are functions instead of macros to avoid self-assignment warnings +// on calls such as "i = ghtnol(i);". This also provides type checking. +inline uint16_t ghtons(uint16_t x) { return x; } +inline uint32_t ghtonl(uint32_t x) { return x; } +inline uint64_t ghtonll(uint64_t x) { return x; } + +#else +#error \ + "Unsupported byte order: Either ABSL_IS_BIG_ENDIAN or " \ + "ABSL_IS_LITTLE_ENDIAN must be defined" +#endif // byte order + +inline uint16_t gntohs(uint16_t x) { return ghtons(x); } +inline uint32_t gntohl(uint32_t x) { return ghtonl(x); } +inline uint64_t gntohll(uint64_t x) { return ghtonll(x); } + +// Utilities to convert numbers between the current hosts's native byte +// order and little-endian byte order +// +// Load/Store methods are alignment safe +namespace little_endian { +// Conversion functions. +#ifdef ABSL_IS_LITTLE_ENDIAN + +inline uint16_t FromHost16(uint16_t x) { return x; } +inline uint16_t ToHost16(uint16_t x) { return x; } + +inline uint32_t FromHost32(uint32_t x) { return x; } +inline uint32_t ToHost32(uint32_t x) { return x; } + +inline uint64_t FromHost64(uint64_t x) { return x; } +inline uint64_t ToHost64(uint64_t x) { return x; } + +inline constexpr bool IsLittleEndian() { return true; } + +#elif defined ABSL_IS_BIG_ENDIAN + +inline uint16_t FromHost16(uint16_t x) { return gbswap_16(x); } +inline uint16_t ToHost16(uint16_t x) { return gbswap_16(x); } + +inline uint32_t FromHost32(uint32_t x) { return gbswap_32(x); } +inline uint32_t ToHost32(uint32_t x) { return gbswap_32(x); } + +inline uint64_t FromHost64(uint64_t x) { return gbswap_64(x); } +inline uint64_t ToHost64(uint64_t x) { return gbswap_64(x); } + +inline constexpr bool IsLittleEndian() { return false; } + +#endif /* ENDIAN */ + +// Functions to do unaligned loads and stores in little-endian order. +inline uint16_t Load16(const void *p) { + return ToHost16(ABSL_INTERNAL_UNALIGNED_LOAD16(p)); +} + +inline void Store16(void *p, uint16_t v) { + ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); +} + +inline uint32_t Load32(const void *p) { + return ToHost32(ABSL_INTERNAL_UNALIGNED_LOAD32(p)); +} + +inline void Store32(void *p, uint32_t v) { + ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); +} + +inline uint64_t Load64(const void *p) { + return ToHost64(ABSL_INTERNAL_UNALIGNED_LOAD64(p)); +} + +inline void Store64(void *p, uint64_t v) { + ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); +} + +} // namespace little_endian + +// Utilities to convert numbers between the current hosts's native byte +// order and big-endian byte order (same as network byte order) +// +// Load/Store methods are alignment safe +namespace big_endian { +#ifdef ABSL_IS_LITTLE_ENDIAN + +inline uint16_t FromHost16(uint16_t x) { return gbswap_16(x); } +inline uint16_t ToHost16(uint16_t x) { return gbswap_16(x); } + +inline uint32_t FromHost32(uint32_t x) { return gbswap_32(x); } +inline uint32_t ToHost32(uint32_t x) { return gbswap_32(x); } + +inline uint64_t FromHost64(uint64_t x) { return gbswap_64(x); } +inline uint64_t ToHost64(uint64_t x) { return gbswap_64(x); } + +inline constexpr bool IsLittleEndian() { return true; } + +#elif defined ABSL_IS_BIG_ENDIAN + +inline uint16_t FromHost16(uint16_t x) { return x; } +inline uint16_t ToHost16(uint16_t x) { return x; } + +inline uint32_t FromHost32(uint32_t x) { return x; } +inline uint32_t ToHost32(uint32_t x) { return x; } + +inline uint64_t FromHost64(uint64_t x) { return x; } +inline uint64_t ToHost64(uint64_t x) { return x; } + +inline constexpr bool IsLittleEndian() { return false; } + +#endif /* ENDIAN */ + +// Functions to do unaligned loads and stores in big-endian order. +inline uint16_t Load16(const void *p) { + return ToHost16(ABSL_INTERNAL_UNALIGNED_LOAD16(p)); +} + +inline void Store16(void *p, uint16_t v) { + ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); +} + +inline uint32_t Load32(const void *p) { + return ToHost32(ABSL_INTERNAL_UNALIGNED_LOAD32(p)); +} + +inline void Store32(void *p, uint32_t v) { + ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); +} + +inline uint64_t Load64(const void *p) { + return ToHost64(ABSL_INTERNAL_UNALIGNED_LOAD64(p)); +} + +inline void Store64(void *p, uint64_t v) { + ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); +} + +} // namespace big_endian + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_ENDIAN_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/errno_saver.h b/SaraAttended/Pods/abseil/absl/base/internal/errno_saver.h new file mode 100644 index 0000000..251de51 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/errno_saver.h @@ -0,0 +1,43 @@ +// 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_ERRNO_SAVER_H_ +#define ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ + +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// `ErrnoSaver` captures the value of `errno` upon construction and restores it +// upon deletion. It is used in low-level code and must be super fast. Do not +// add instrumentation, even in debug modes. +class ErrnoSaver { + public: + ErrnoSaver() : saved_errno_(errno) {} + ~ErrnoSaver() { errno = saved_errno_; } + int operator()() const { return saved_errno_; } + + private: + const int saved_errno_; +}; + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.cc b/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.cc new file mode 100644 index 0000000..1b30c06 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.cc @@ -0,0 +1,93 @@ +// 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/exponential_biased.h" + +#include + +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/optimization.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// The algorithm generates a random number between 0 and 1 and applies 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 ExponentialBiased::GetSkipCount(int64_t mean) { + if (ABSL_PREDICT_FALSE(!initialized_)) { + Initialize(); + } + + uint64_t rng = NextRandom(rng_); + rng_ = 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.) + // The uint32_t cast is to prevent a (hard-to-reproduce) NAN + // under piii debug for some binaries. + double q = static_cast(rng >> (kPrngNumBits - 26)) + 1.0; + // Put the computed p-value through the CDF of a geometric. + double interval = bias_ + (std::log2(q) - 26) * (-std::log(2.0) * mean); + // Very large values of interval overflow int64_t. To avoid that, we will + // cheat and clamp any huge values to (int64_t max)/2. This is a potential + // source of bias, but the mean would need to be such a large value that it's + // not likely to come up. For example, with a mean of 1e18, the probability of + // hitting this condition is about 1/1000. For a mean of 1e17, standard + // calculators claim that this event won't happen. + if (interval > static_cast(std::numeric_limits::max() / 2)) { + // Assume huge values are bias neutral, retain bias for next call. + return std::numeric_limits::max() / 2; + } + double value = std::round(interval); + bias_ = interval - value; + return value; +} + +int64_t ExponentialBiased::GetStride(int64_t mean) { + return GetSkipCount(mean - 1) + 1; +} + +void ExponentialBiased::Initialize() { + // 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(this) + + global_rand.fetch_add(1, std::memory_order_relaxed); + for (int i = 0; i < 20; ++i) { + r = NextRandom(r); + } + rng_ = r; + initialized_ = true; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.h b/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.h new file mode 100644 index 0000000..94f79a3 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/exponential_biased.h @@ -0,0 +1,130 @@ +// 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_EXPONENTIAL_BIASED_H_ +#define ABSL_BASE_INTERNAL_EXPONENTIAL_BIASED_H_ + +#include + +#include "absl/base/config.h" +#include "absl/base/macros.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// ExponentialBiased provides a small and fast random number generator for a +// rounded exponential distribution. This generator manages very little state, +// and imposes no synchronization overhead. This makes it useful in specialized +// scenarios requiring minimum overhead, such as stride based periodic sampling. +// +// ExponentialBiased provides two closely related functions, GetSkipCount() and +// GetStride(), both returning a rounded integer defining a number of events +// required before some event with a given mean probability occurs. +// +// The distribution is useful to generate a random wait time or some periodic +// event with a given mean probability. For example, if an action is supposed to +// happen on average once every 'N' events, then we can get a random 'stride' +// counting down how long before the event to happen. For example, if we'd want +// to sample one in every 1000 'Frobber' calls, our code could look like this: +// +// Frobber::Frobber() { +// stride_ = exponential_biased_.GetStride(1000); +// } +// +// void Frobber::Frob(int arg) { +// if (--stride == 0) { +// SampleFrob(arg); +// stride_ = exponential_biased_.GetStride(1000); +// } +// ... +// } +// +// The rounding of the return value creates a bias, especially for smaller means +// where the distribution of the fraction is not evenly distributed. We correct +// this bias by tracking the fraction we rounded up or down on each iteration, +// effectively tracking the distance between the cumulative value, and the +// rounded cumulative value. For example, given a mean of 2: +// +// raw = 1.63076, cumulative = 1.63076, rounded = 2, bias = -0.36923 +// raw = 0.14624, cumulative = 1.77701, rounded = 2, bias = 0.14624 +// raw = 4.93194, cumulative = 6.70895, rounded = 7, bias = -0.06805 +// raw = 0.24206, cumulative = 6.95101, rounded = 7, bias = 0.24206 +// etc... +// +// Adjusting with rounding bias is relatively trivial: +// +// double value = bias_ + exponential_distribution(mean)(); +// double rounded_value = std::round(value); +// bias_ = value - rounded_value; +// return rounded_value; +// +// This class is thread-compatible. +class ExponentialBiased { + public: + // The number of bits set by NextRandom. + static constexpr int kPrngNumBits = 48; + + // `GetSkipCount()` returns the number of events to skip before some chosen + // event happens. For example, randomly tossing a coin, we will on average + // throw heads once before we get tails. We can simulate random coin tosses + // using GetSkipCount() as: + // + // ExponentialBiased eb; + // for (...) { + // int number_of_heads_before_tail = eb.GetSkipCount(1); + // for (int flips = 0; flips < number_of_heads_before_tail; ++flips) { + // printf("head..."); + // } + // printf("tail\n"); + // } + // + int64_t GetSkipCount(int64_t mean); + + // GetStride() returns the number of events required for a specific event to + // happen. See the class comments for a usage example. `GetStride()` is + // equivalent to `GetSkipCount(mean - 1) + 1`. When to use `GetStride()` or + // `GetSkipCount()` depends mostly on what best fits the use case. + int64_t GetStride(int64_t mean); + + // Computes a random number in the range [0, 1<<(kPrngNumBits+1) - 1] + // + // This is public to enable testing. + static uint64_t NextRandom(uint64_t rnd); + + private: + void Initialize(); + + uint64_t rng_{0}; + double bias_{0}; + bool initialized_{false}; +}; + +// Returns the next prng value. +// pRNG is: aX+b mod c with a = 0x5DEECE66D, b = 0xB, c = 1<<48 +// This is the lrand64 generator. +inline uint64_t ExponentialBiased::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 = + ~((~static_cast(0)) << prng_mod_power); + return (prng_mult * rnd + prng_add) & prng_mod_mask; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_EXPONENTIAL_BIASED_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/hide_ptr.h b/SaraAttended/Pods/abseil/absl/base/internal/hide_ptr.h new file mode 100644 index 0000000..1dba809 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/hide_ptr.h @@ -0,0 +1,51 @@ +// 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_HIDE_PTR_H_ +#define ABSL_BASE_INTERNAL_HIDE_PTR_H_ + +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Arbitrary value with high bits set. Xor'ing with it is unlikely +// to map one valid pointer to another valid pointer. +constexpr uintptr_t HideMask() { + return (uintptr_t{0xF03A5F7BU} << (sizeof(uintptr_t) - 4) * 8) | 0xF03A5F7BU; +} + +// Hide a pointer from the leak checker. For internal use only. +// Differs from absl::IgnoreLeak(ptr) in that absl::IgnoreLeak(ptr) causes ptr +// and all objects reachable from ptr to be ignored by the leak checker. +template +inline uintptr_t HidePtr(T* ptr) { + return reinterpret_cast(ptr) ^ HideMask(); +} + +// Return a pointer that has been hidden from the leak checker. +// For internal use only. +template +inline T* UnhidePtr(uintptr_t hidden) { + return reinterpret_cast(hidden ^ HideMask()); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_HIDE_PTR_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/identity.h b/SaraAttended/Pods/abseil/absl/base/internal/identity.h new file mode 100644 index 0000000..a3154ed --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/identity.h @@ -0,0 +1,37 @@ +// 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_IDENTITY_H_ +#define ABSL_BASE_INTERNAL_IDENTITY_H_ + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace internal { + +template +struct identity { + typedef T type; +}; + +template +using identity_t = typename identity::type; + +} // namespace internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_IDENTITY_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/inline_variable.h b/SaraAttended/Pods/abseil/absl/base/internal/inline_variable.h new file mode 100644 index 0000000..130d8c2 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/inline_variable.h @@ -0,0 +1,107 @@ +// 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_INLINE_VARIABLE_EMULATION_H_ +#define ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ + +#include + +#include "absl/base/internal/identity.h" + +// File: +// This file define a macro that allows the creation of or emulation of C++17 +// inline variables based on whether or not the feature is supported. + +//////////////////////////////////////////////////////////////////////////////// +// Macro: ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) +// +// Description: +// Expands to the equivalent of an inline constexpr instance of the specified +// `type` and `name`, initialized to the value `init`. If the compiler being +// used is detected as supporting actual inline variables as a language +// feature, then the macro expands to an actual inline variable definition. +// +// Requires: +// `type` is a type that is usable in an extern variable declaration. +// +// Requires: `name` is a valid identifier +// +// Requires: +// `init` is an expression that can be used in the following definition: +// constexpr type name = init; +// +// Usage: +// +// // Equivalent to: `inline constexpr size_t variant_npos = -1;` +// ABSL_INTERNAL_INLINE_CONSTEXPR(size_t, variant_npos, -1); +// +// Differences in implementation: +// For a direct, language-level inline variable, decltype(name) will be the +// type that was specified along with const qualification, whereas for +// emulated inline variables, decltype(name) may be different (in practice +// it will likely be a reference type). +//////////////////////////////////////////////////////////////////////////////// + +#ifdef __cpp_inline_variables + +// Clang's -Wmissing-variable-declarations option erroneously warned that +// inline constexpr objects need to be pre-declared. This has now been fixed, +// but we will need to support this workaround for people building with older +// versions of clang. +// +// Bug: https://bugs.llvm.org/show_bug.cgi?id=35862 +// +// Note: +// identity_t is used here so that the const and name are in the +// appropriate place for pointer types, reference types, function pointer +// types, etc.. +#if defined(__clang__) +#define ABSL_INTERNAL_EXTERN_DECL(type, name) \ + extern const ::absl::internal::identity_t name; +#else // Otherwise, just define the macro to do nothing. +#define ABSL_INTERNAL_EXTERN_DECL(type, name) +#endif // defined(__clang__) + +// See above comment at top of file for details. +#define ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \ + ABSL_INTERNAL_EXTERN_DECL(type, name) \ + inline constexpr ::absl::internal::identity_t name = init + +#else + +// See above comment at top of file for details. +// +// Note: +// identity_t is used here so that the const and name are in the +// appropriate place for pointer types, reference types, function pointer +// types, etc.. +#define ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \ + template \ + struct AbslInternalInlineVariableHolder##name { \ + static constexpr ::absl::internal::identity_t kInstance = init; \ + }; \ + \ + template \ + constexpr ::absl::internal::identity_t \ + AbslInternalInlineVariableHolder##name::kInstance; \ + \ + static constexpr const ::absl::internal::identity_t& \ + name = /* NOLINT */ \ + AbslInternalInlineVariableHolder##name<>::kInstance; \ + static_assert(sizeof(void (*)(decltype(name))) != 0, \ + "Silence unused variable warnings.") + +#endif // __cpp_inline_variables + +#endif // ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/invoke.h b/SaraAttended/Pods/abseil/absl/base/internal/invoke.h new file mode 100644 index 0000000..c4eceeb --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/invoke.h @@ -0,0 +1,187 @@ +// 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::base_internal::Invoke(f, args...) is an implementation of +// INVOKE(f, args...) from section [func.require] of the C++ standard. +// +// [func.require] +// Define INVOKE (f, t1, t2, ..., tN) as follows: +// 1. (t1.*f)(t2, ..., tN) when f is a pointer to a member function of a class T +// and t1 is an object of type T or a reference to an object of type T or a +// reference to an object of a type derived from T; +// 2. ((*t1).*f)(t2, ..., tN) when f is a pointer to a member function of a +// class T and t1 is not one of the types described in the previous item; +// 3. t1.*f when N == 1 and f is a pointer to member data of a class T and t1 is +// an object of type T or a reference to an object of type T or a reference +// to an object of a type derived from T; +// 4. (*t1).*f when N == 1 and f is a pointer to member data of a class T and t1 +// is not one of the types described in the previous item; +// 5. f(t1, t2, ..., tN) in all other cases. +// +// The implementation is SFINAE-friendly: substitution failure within Invoke() +// isn't an error. + +#ifndef ABSL_BASE_INTERNAL_INVOKE_H_ +#define ABSL_BASE_INTERNAL_INVOKE_H_ + +#include +#include +#include + +#include "absl/meta/type_traits.h" + +// The following code is internal implementation detail. See the comment at the +// top of this file for the API documentation. + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// The five classes below each implement one of the clauses from the definition +// of INVOKE. The inner class template Accept checks whether the +// clause is applicable; static function template Invoke(f, args...) does the +// invocation. +// +// By separating the clause selection logic from invocation we make sure that +// Invoke() does exactly what the standard says. + +template +struct StrippedAccept { + template + struct Accept : Derived::template AcceptImpl::type>::type...> {}; +}; + +// (t1.*f)(t2, ..., tN) when f is a pointer to a member function of a class T +// and t1 is an object of type T or a reference to an object of type T or a +// reference to an object of a type derived from T. +struct MemFunAndRef : StrippedAccept { + template + struct AcceptImpl : std::false_type {}; + + template + struct AcceptImpl + : std::integral_constant::value && + absl::is_function::value> { + }; + + template + static decltype((std::declval().* + std::declval())(std::declval()...)) + Invoke(MemFun&& mem_fun, Obj&& obj, Args&&... args) { + return (std::forward(obj).* + std::forward(mem_fun))(std::forward(args)...); + } +}; + +// ((*t1).*f)(t2, ..., tN) when f is a pointer to a member function of a +// class T and t1 is not one of the types described in the previous item. +struct MemFunAndPtr : StrippedAccept { + template + struct AcceptImpl : std::false_type {}; + + template + struct AcceptImpl + : std::integral_constant::value && + absl::is_function::value> { + }; + + template + static decltype(((*std::declval()).* + std::declval())(std::declval()...)) + Invoke(MemFun&& mem_fun, Ptr&& ptr, Args&&... args) { + return ((*std::forward(ptr)).* + std::forward(mem_fun))(std::forward(args)...); + } +}; + +// t1.*f when N == 1 and f is a pointer to member data of a class T and t1 is +// an object of type T or a reference to an object of type T or a reference +// to an object of a type derived from T. +struct DataMemAndRef : StrippedAccept { + template + struct AcceptImpl : std::false_type {}; + + template + struct AcceptImpl + : std::integral_constant::value && + !absl::is_function::value> {}; + + template + static decltype(std::declval().*std::declval()) Invoke( + DataMem&& data_mem, Ref&& ref) { + return std::forward(ref).*std::forward(data_mem); + } +}; + +// (*t1).*f when N == 1 and f is a pointer to member data of a class T and t1 +// is not one of the types described in the previous item. +struct DataMemAndPtr : StrippedAccept { + template + struct AcceptImpl : std::false_type {}; + + template + struct AcceptImpl + : std::integral_constant::value && + !absl::is_function::value> {}; + + template + static decltype((*std::declval()).*std::declval()) Invoke( + DataMem&& data_mem, Ptr&& ptr) { + return (*std::forward(ptr)).*std::forward(data_mem); + } +}; + +// f(t1, t2, ..., tN) in all other cases. +struct Callable { + // Callable doesn't have Accept because it's the last clause that gets picked + // when none of the previous clauses are applicable. + template + static decltype(std::declval()(std::declval()...)) Invoke( + F&& f, Args&&... args) { + return std::forward(f)(std::forward(args)...); + } +}; + +// Resolves to the first matching clause. +template +struct Invoker { + typedef typename std::conditional< + MemFunAndRef::Accept::value, MemFunAndRef, + typename std::conditional< + MemFunAndPtr::Accept::value, MemFunAndPtr, + typename std::conditional< + DataMemAndRef::Accept::value, DataMemAndRef, + typename std::conditional::value, + DataMemAndPtr, Callable>::type>::type>:: + type>::type type; +}; + +// The result type of Invoke. +template +using InvokeT = decltype(Invoker::type::Invoke( + std::declval(), std::declval()...)); + +// Invoke(f, args...) is an implementation of INVOKE(f, args...) from section +// [func.require] of the C++ standard. +template +InvokeT Invoke(F&& f, Args&&... args) { + return Invoker::type::Invoke(std::forward(f), + std::forward(args)...); +} +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_INVOKE_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.cc b/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.cc new file mode 100644 index 0000000..1bf9443 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.cc @@ -0,0 +1,620 @@ +// 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 low-level allocator that can be used by other low-level +// modules without introducing dependency cycles. +// This allocator is slow and wasteful of memory; +// it should not be used when performance is key. + +#include "absl/base/internal/low_level_alloc.h" + +#include + +#include "absl/base/call_once.h" +#include "absl/base/config.h" +#include "absl/base/internal/direct_mmap.h" +#include "absl/base/internal/scheduling_mode.h" +#include "absl/base/macros.h" +#include "absl/base/thread_annotations.h" + +// LowLevelAlloc requires that the platform support low-level +// allocation of virtual memory. Platforms lacking this cannot use +// LowLevelAlloc. +#ifndef ABSL_LOW_LEVEL_ALLOC_MISSING + +#ifndef _WIN32 +#include +#include +#include +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include // for placement-new + +#include "absl/base/dynamic_annotations.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/spinlock.h" + +// MAP_ANONYMOUS +#if defined(__APPLE__) +// For mmap, Linux defines both MAP_ANONYMOUS and MAP_ANON and says MAP_ANON is +// deprecated. In Darwin, MAP_ANON is all there is. +#if !defined MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif // !MAP_ANONYMOUS +#endif // __APPLE__ + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// A first-fit allocator with amortized logarithmic free() time. + +// --------------------------------------------------------------------------- +static const int kMaxLevel = 30; + +namespace { +// This struct describes one allocated block, or one free block. +struct AllocList { + struct Header { + // Size of entire region, including this field. Must be + // first. Valid in both allocated and unallocated blocks. + uintptr_t size; + + // kMagicAllocated or kMagicUnallocated xor this. + uintptr_t magic; + + // Pointer to parent arena. + LowLevelAlloc::Arena *arena; + + // Aligns regions to 0 mod 2*sizeof(void*). + void *dummy_for_alignment; + } header; + + // Next two fields: in unallocated blocks: freelist skiplist data + // in allocated blocks: overlaps with client data + + // Levels in skiplist used. + int levels; + + // Actually has levels elements. The AllocList node may not have room + // for all kMaxLevel entries. See max_fit in LLA_SkiplistLevels(). + AllocList *next[kMaxLevel]; +}; +} // namespace + +// --------------------------------------------------------------------------- +// A trivial skiplist implementation. This is used to keep the freelist +// in address order while taking only logarithmic time per insert and delete. + +// An integer approximation of log2(size/base) +// Requires size >= base. +static int IntLog2(size_t size, size_t base) { + int result = 0; + for (size_t i = size; i > base; i >>= 1) { // i == floor(size/2**result) + result++; + } + // floor(size / 2**result) <= base < floor(size / 2**(result-1)) + // => log2(size/(base+1)) <= result < 1+log2(size/base) + // => result ~= log2(size/base) + return result; +} + +// Return a random integer n: p(n)=1/(2**n) if 1 <= n; p(n)=0 if n < 1. +static int Random(uint32_t *state) { + uint32_t r = *state; + int result = 1; + while ((((r = r*1103515245 + 12345) >> 30) & 1) == 0) { + result++; + } + *state = r; + return result; +} + +// Return a number of skiplist levels for a node of size bytes, where +// base is the minimum node size. Compute level=log2(size / base)+n +// where n is 1 if random is false and otherwise a random number generated with +// the standard distribution for a skiplist: See Random() above. +// Bigger nodes tend to have more skiplist levels due to the log2(size / base) +// term, so first-fit searches touch fewer nodes. "level" is clipped so +// level(level) > max_fit) level = static_cast(max_fit); + if (level > kMaxLevel-1) level = kMaxLevel - 1; + ABSL_RAW_CHECK(level >= 1, "block not big enough for even one level"); + return level; +} + +// Return "atleast", the first element of AllocList *head s.t. *atleast >= *e. +// For 0 <= i < head->levels, set prev[i] to "no_greater", where no_greater +// points to the last element at level i in the AllocList less than *e, or is +// head if no such element exists. +static AllocList *LLA_SkiplistSearch(AllocList *head, + AllocList *e, AllocList **prev) { + AllocList *p = head; + for (int level = head->levels - 1; level >= 0; level--) { + for (AllocList *n; (n = p->next[level]) != nullptr && n < e; p = n) { + } + prev[level] = p; + } + return (head->levels == 0) ? nullptr : prev[0]->next[0]; +} + +// Insert element *e into AllocList *head. Set prev[] as LLA_SkiplistSearch. +// Requires that e->levels be previously set by the caller (using +// LLA_SkiplistLevels()) +static void LLA_SkiplistInsert(AllocList *head, AllocList *e, + AllocList **prev) { + LLA_SkiplistSearch(head, e, prev); + for (; head->levels < e->levels; head->levels++) { // extend prev pointers + prev[head->levels] = head; // to all *e's levels + } + for (int i = 0; i != e->levels; i++) { // add element to list + e->next[i] = prev[i]->next[i]; + prev[i]->next[i] = e; + } +} + +// Remove element *e from AllocList *head. Set prev[] as LLA_SkiplistSearch(). +// Requires that e->levels be previous set by the caller (using +// LLA_SkiplistLevels()) +static void LLA_SkiplistDelete(AllocList *head, AllocList *e, + AllocList **prev) { + AllocList *found = LLA_SkiplistSearch(head, e, prev); + ABSL_RAW_CHECK(e == found, "element not in freelist"); + for (int i = 0; i != e->levels && prev[i]->next[i] == e; i++) { + prev[i]->next[i] = e->next[i]; + } + while (head->levels > 0 && head->next[head->levels - 1] == nullptr) { + head->levels--; // reduce head->levels if level unused + } +} + +// --------------------------------------------------------------------------- +// Arena implementation + +// Metadata for an LowLevelAlloc arena instance. +struct LowLevelAlloc::Arena { + // Constructs an arena with the given LowLevelAlloc flags. + explicit Arena(uint32_t flags_value); + + base_internal::SpinLock mu; + // Head of free list, sorted by address + AllocList freelist ABSL_GUARDED_BY(mu); + // Count of allocated blocks + int32_t allocation_count ABSL_GUARDED_BY(mu); + // flags passed to NewArena + const uint32_t flags; + // Result of sysconf(_SC_PAGESIZE) + const size_t pagesize; + // Lowest power of two >= max(16, sizeof(AllocList)) + const size_t round_up; + // Smallest allocation block size + const size_t min_size; + // PRNG state + uint32_t random ABSL_GUARDED_BY(mu); +}; + +namespace { +// Static storage space for the lazily-constructed, default global arena +// instances. We require this space because the whole point of LowLevelAlloc +// is to avoid relying on malloc/new. +alignas(LowLevelAlloc::Arena) unsigned char default_arena_storage[sizeof( + LowLevelAlloc::Arena)]; +alignas(LowLevelAlloc::Arena) unsigned char unhooked_arena_storage[sizeof( + LowLevelAlloc::Arena)]; +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +alignas( + LowLevelAlloc::Arena) unsigned char unhooked_async_sig_safe_arena_storage + [sizeof(LowLevelAlloc::Arena)]; +#endif + +// We must use LowLevelCallOnce here to construct the global arenas, rather than +// using function-level statics, to avoid recursively invoking the scheduler. +absl::once_flag create_globals_once; + +void CreateGlobalArenas() { + new (&default_arena_storage) + LowLevelAlloc::Arena(LowLevelAlloc::kCallMallocHook); + new (&unhooked_arena_storage) LowLevelAlloc::Arena(0); +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + new (&unhooked_async_sig_safe_arena_storage) + LowLevelAlloc::Arena(LowLevelAlloc::kAsyncSignalSafe); +#endif +} + +// Returns a global arena that does not call into hooks. Used by NewArena() +// when kCallMallocHook is not set. +LowLevelAlloc::Arena* UnhookedArena() { + base_internal::LowLevelCallOnce(&create_globals_once, CreateGlobalArenas); + return reinterpret_cast(&unhooked_arena_storage); +} + +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +// Returns a global arena that is async-signal safe. Used by NewArena() when +// kAsyncSignalSafe is set. +LowLevelAlloc::Arena *UnhookedAsyncSigSafeArena() { + base_internal::LowLevelCallOnce(&create_globals_once, CreateGlobalArenas); + return reinterpret_cast( + &unhooked_async_sig_safe_arena_storage); +} +#endif + +} // namespace + +// Returns the default arena, as used by LowLevelAlloc::Alloc() and friends. +LowLevelAlloc::Arena *LowLevelAlloc::DefaultArena() { + base_internal::LowLevelCallOnce(&create_globals_once, CreateGlobalArenas); + return reinterpret_cast(&default_arena_storage); +} + +// magic numbers to identify allocated and unallocated blocks +static const uintptr_t kMagicAllocated = 0x4c833e95U; +static const uintptr_t kMagicUnallocated = ~kMagicAllocated; + +namespace { +class ABSL_SCOPED_LOCKABLE ArenaLock { + public: + explicit ArenaLock(LowLevelAlloc::Arena *arena) + ABSL_EXCLUSIVE_LOCK_FUNCTION(arena->mu) + : arena_(arena) { +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { + sigset_t all; + sigfillset(&all); + mask_valid_ = pthread_sigmask(SIG_BLOCK, &all, &mask_) == 0; + } +#endif + arena_->mu.Lock(); + } + ~ArenaLock() { ABSL_RAW_CHECK(left_, "haven't left Arena region"); } + void Leave() ABSL_UNLOCK_FUNCTION() { + arena_->mu.Unlock(); +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if (mask_valid_) { + const int err = pthread_sigmask(SIG_SETMASK, &mask_, nullptr); + if (err != 0) { + ABSL_RAW_LOG(FATAL, "pthread_sigmask failed: %d", err); + } + } +#endif + left_ = true; + } + + private: + bool left_ = false; // whether left region +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + bool mask_valid_ = false; + sigset_t mask_; // old mask of blocked signals +#endif + LowLevelAlloc::Arena *arena_; + ArenaLock(const ArenaLock &) = delete; + ArenaLock &operator=(const ArenaLock &) = delete; +}; +} // namespace + +// create an appropriate magic number for an object at "ptr" +// "magic" should be kMagicAllocated or kMagicUnallocated +inline static uintptr_t Magic(uintptr_t magic, AllocList::Header *ptr) { + return magic ^ reinterpret_cast(ptr); +} + +namespace { +size_t GetPageSize() { +#ifdef _WIN32 + SYSTEM_INFO system_info; + GetSystemInfo(&system_info); + return std::max(system_info.dwPageSize, system_info.dwAllocationGranularity); +#elif defined(__wasm__) || defined(__asmjs__) + return getpagesize(); +#else + return sysconf(_SC_PAGESIZE); +#endif +} + +size_t RoundedUpBlockSize() { + // Round up block sizes to a power of two close to the header size. + size_t round_up = 16; + while (round_up < sizeof(AllocList::Header)) { + round_up += round_up; + } + return round_up; +} + +} // namespace + +LowLevelAlloc::Arena::Arena(uint32_t flags_value) + : mu(base_internal::SCHEDULE_KERNEL_ONLY), + allocation_count(0), + flags(flags_value), + pagesize(GetPageSize()), + round_up(RoundedUpBlockSize()), + min_size(2 * round_up), + random(0) { + freelist.header.size = 0; + freelist.header.magic = + Magic(kMagicUnallocated, &freelist.header); + freelist.header.arena = this; + freelist.levels = 0; + memset(freelist.next, 0, sizeof(freelist.next)); +} + +// L < meta_data_arena->mu +LowLevelAlloc::Arena *LowLevelAlloc::NewArena(int32_t flags) { + Arena *meta_data_arena = DefaultArena(); +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if ((flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { + meta_data_arena = UnhookedAsyncSigSafeArena(); + } else // NOLINT(readability/braces) +#endif + if ((flags & LowLevelAlloc::kCallMallocHook) == 0) { + meta_data_arena = UnhookedArena(); + } + Arena *result = + new (AllocWithArena(sizeof (*result), meta_data_arena)) Arena(flags); + return result; +} + +// L < arena->mu, L < arena->arena->mu +bool LowLevelAlloc::DeleteArena(Arena *arena) { + ABSL_RAW_CHECK( + arena != nullptr && arena != DefaultArena() && arena != UnhookedArena(), + "may not delete default arena"); + ArenaLock section(arena); + if (arena->allocation_count != 0) { + section.Leave(); + return false; + } + while (arena->freelist.next[0] != nullptr) { + AllocList *region = arena->freelist.next[0]; + size_t size = region->header.size; + arena->freelist.next[0] = region->next[0]; + ABSL_RAW_CHECK( + region->header.magic == Magic(kMagicUnallocated, ®ion->header), + "bad magic number in DeleteArena()"); + ABSL_RAW_CHECK(region->header.arena == arena, + "bad arena pointer in DeleteArena()"); + ABSL_RAW_CHECK(size % arena->pagesize == 0, + "empty arena has non-page-aligned block size"); + ABSL_RAW_CHECK(reinterpret_cast(region) % arena->pagesize == 0, + "empty arena has non-page-aligned block"); + int munmap_result; +#ifdef _WIN32 + munmap_result = VirtualFree(region, 0, MEM_RELEASE); + ABSL_RAW_CHECK(munmap_result != 0, + "LowLevelAlloc::DeleteArena: VitualFree failed"); +#else +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) == 0) { + munmap_result = munmap(region, size); + } else { + munmap_result = base_internal::DirectMunmap(region, size); + } +#else + munmap_result = munmap(region, size); +#endif // ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if (munmap_result != 0) { + ABSL_RAW_LOG(FATAL, "LowLevelAlloc::DeleteArena: munmap failed: %d", + errno); + } +#endif // _WIN32 + } + section.Leave(); + arena->~Arena(); + Free(arena); + return true; +} + +// --------------------------------------------------------------------------- + +// Addition, checking for overflow. The intent is to die if an external client +// manages to push through a request that would cause arithmetic to fail. +static inline uintptr_t CheckedAdd(uintptr_t a, uintptr_t b) { + uintptr_t sum = a + b; + ABSL_RAW_CHECK(sum >= a, "LowLevelAlloc arithmetic overflow"); + return sum; +} + +// Return value rounded up to next multiple of align. +// align must be a power of two. +static inline uintptr_t RoundUp(uintptr_t addr, uintptr_t align) { + return CheckedAdd(addr, align - 1) & ~(align - 1); +} + +// Equivalent to "return prev->next[i]" but with sanity checking +// that the freelist is in the correct order, that it +// consists of regions marked "unallocated", and that no two regions +// are adjacent in memory (they should have been coalesced). +// L >= arena->mu +static AllocList *Next(int i, AllocList *prev, LowLevelAlloc::Arena *arena) { + ABSL_RAW_CHECK(i < prev->levels, "too few levels in Next()"); + AllocList *next = prev->next[i]; + if (next != nullptr) { + ABSL_RAW_CHECK( + next->header.magic == Magic(kMagicUnallocated, &next->header), + "bad magic number in Next()"); + ABSL_RAW_CHECK(next->header.arena == arena, "bad arena pointer in Next()"); + if (prev != &arena->freelist) { + ABSL_RAW_CHECK(prev < next, "unordered freelist"); + ABSL_RAW_CHECK(reinterpret_cast(prev) + prev->header.size < + reinterpret_cast(next), + "malformed freelist"); + } + } + return next; +} + +// Coalesce list item "a" with its successor if they are adjacent. +static void Coalesce(AllocList *a) { + AllocList *n = a->next[0]; + if (n != nullptr && reinterpret_cast(a) + a->header.size == + reinterpret_cast(n)) { + LowLevelAlloc::Arena *arena = a->header.arena; + a->header.size += n->header.size; + n->header.magic = 0; + n->header.arena = nullptr; + AllocList *prev[kMaxLevel]; + LLA_SkiplistDelete(&arena->freelist, n, prev); + LLA_SkiplistDelete(&arena->freelist, a, prev); + a->levels = LLA_SkiplistLevels(a->header.size, arena->min_size, + &arena->random); + LLA_SkiplistInsert(&arena->freelist, a, prev); + } +} + +// Adds block at location "v" to the free list +// L >= arena->mu +static void AddToFreelist(void *v, LowLevelAlloc::Arena *arena) { + AllocList *f = reinterpret_cast( + reinterpret_cast(v) - sizeof (f->header)); + ABSL_RAW_CHECK(f->header.magic == Magic(kMagicAllocated, &f->header), + "bad magic number in AddToFreelist()"); + ABSL_RAW_CHECK(f->header.arena == arena, + "bad arena pointer in AddToFreelist()"); + f->levels = LLA_SkiplistLevels(f->header.size, arena->min_size, + &arena->random); + AllocList *prev[kMaxLevel]; + LLA_SkiplistInsert(&arena->freelist, f, prev); + f->header.magic = Magic(kMagicUnallocated, &f->header); + Coalesce(f); // maybe coalesce with successor + Coalesce(prev[0]); // maybe coalesce with predecessor +} + +// Frees storage allocated by LowLevelAlloc::Alloc(). +// L < arena->mu +void LowLevelAlloc::Free(void *v) { + if (v != nullptr) { + AllocList *f = reinterpret_cast( + reinterpret_cast(v) - sizeof (f->header)); + LowLevelAlloc::Arena *arena = f->header.arena; + ArenaLock section(arena); + AddToFreelist(v, arena); + ABSL_RAW_CHECK(arena->allocation_count > 0, "nothing in arena to free"); + arena->allocation_count--; + section.Leave(); + } +} + +// allocates and returns a block of size bytes, to be freed with Free() +// L < arena->mu +static void *DoAllocWithArena(size_t request, LowLevelAlloc::Arena *arena) { + void *result = nullptr; + if (request != 0) { + AllocList *s; // will point to region that satisfies request + ArenaLock section(arena); + // round up with header + size_t req_rnd = RoundUp(CheckedAdd(request, sizeof (s->header)), + arena->round_up); + for (;;) { // loop until we find a suitable region + // find the minimum levels that a block of this size must have + int i = LLA_SkiplistLevels(req_rnd, arena->min_size, nullptr) - 1; + if (i < arena->freelist.levels) { // potential blocks exist + AllocList *before = &arena->freelist; // predecessor of s + while ((s = Next(i, before, arena)) != nullptr && + s->header.size < req_rnd) { + before = s; + } + if (s != nullptr) { // we found a region + break; + } + } + // we unlock before mmap() both because mmap() may call a callback hook, + // and because it may be slow. + arena->mu.Unlock(); + // mmap generous 64K chunks to decrease + // the chances/impact of fragmentation: + size_t new_pages_size = RoundUp(req_rnd, arena->pagesize * 16); + void *new_pages; +#ifdef _WIN32 + new_pages = VirtualAlloc(0, new_pages_size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + ABSL_RAW_CHECK(new_pages != nullptr, "VirtualAlloc failed"); +#else +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { + new_pages = base_internal::DirectMmap(nullptr, new_pages_size, + PROT_WRITE|PROT_READ, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + } else { + new_pages = mmap(nullptr, new_pages_size, PROT_WRITE | PROT_READ, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + } +#else + new_pages = mmap(nullptr, new_pages_size, PROT_WRITE | PROT_READ, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); +#endif // ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + if (new_pages == MAP_FAILED) { + ABSL_RAW_LOG(FATAL, "mmap error: %d", errno); + } + +#endif // _WIN32 + arena->mu.Lock(); + s = reinterpret_cast(new_pages); + s->header.size = new_pages_size; + // Pretend the block is allocated; call AddToFreelist() to free it. + s->header.magic = Magic(kMagicAllocated, &s->header); + s->header.arena = arena; + AddToFreelist(&s->levels, arena); // insert new region into free list + } + AllocList *prev[kMaxLevel]; + LLA_SkiplistDelete(&arena->freelist, s, prev); // remove from free list + // s points to the first free region that's big enough + if (CheckedAdd(req_rnd, arena->min_size) <= s->header.size) { + // big enough to split + AllocList *n = reinterpret_cast + (req_rnd + reinterpret_cast(s)); + n->header.size = s->header.size - req_rnd; + n->header.magic = Magic(kMagicAllocated, &n->header); + n->header.arena = arena; + s->header.size = req_rnd; + AddToFreelist(&n->levels, arena); + } + s->header.magic = Magic(kMagicAllocated, &s->header); + ABSL_RAW_CHECK(s->header.arena == arena, ""); + arena->allocation_count++; + section.Leave(); + result = &s->levels; + } + ANNOTATE_MEMORY_IS_UNINITIALIZED(result, request); + return result; +} + +void *LowLevelAlloc::Alloc(size_t request) { + void *result = DoAllocWithArena(request, DefaultArena()); + return result; +} + +void *LowLevelAlloc::AllocWithArena(size_t request, Arena *arena) { + ABSL_RAW_CHECK(arena != nullptr, "must pass a valid arena"); + void *result = DoAllocWithArena(request, arena); + return result; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_LOW_LEVEL_ALLOC_MISSING diff --git a/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.h b/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.h new file mode 100644 index 0000000..db91951 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/low_level_alloc.h @@ -0,0 +1,126 @@ +// 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_LOW_LEVEL_ALLOC_H_ +#define ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ + +// A simple thread-safe memory allocator that does not depend on +// mutexes or thread-specific data. It is intended to be used +// sparingly, and only when malloc() would introduce an unwanted +// dependency, such as inside the heap-checker, or the Mutex +// implementation. + +// IWYU pragma: private, include "base/low_level_alloc.h" + +#include + +#include + +#include "absl/base/attributes.h" +#include "absl/base/config.h" + +// LowLevelAlloc requires that the platform support low-level +// allocation of virtual memory. Platforms lacking this cannot use +// LowLevelAlloc. +#ifdef ABSL_LOW_LEVEL_ALLOC_MISSING +#error ABSL_LOW_LEVEL_ALLOC_MISSING cannot be directly set +#elif !defined(ABSL_HAVE_MMAP) && !defined(_WIN32) +#define ABSL_LOW_LEVEL_ALLOC_MISSING 1 +#endif + +// Using LowLevelAlloc with kAsyncSignalSafe isn't supported on Windows or +// asm.js / WebAssembly. +// See https://kripken.github.io/emscripten-site/docs/porting/pthreads.html +// for more information. +#ifdef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#error ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING cannot be directly set +#elif defined(_WIN32) || defined(__asmjs__) || defined(__wasm__) +#define ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING 1 +#endif + +#include + +#include "absl/base/port.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +class LowLevelAlloc { + public: + struct Arena; // an arena from which memory may be allocated + + // Returns a pointer to a block of at least "request" bytes + // that have been newly allocated from the specific arena. + // for Alloc() call the DefaultArena() is used. + // Returns 0 if passed request==0. + // Does not return 0 under other circumstances; it crashes if memory + // is not available. + static void *Alloc(size_t request) ABSL_ATTRIBUTE_SECTION(malloc_hook); + static void *AllocWithArena(size_t request, Arena *arena) + ABSL_ATTRIBUTE_SECTION(malloc_hook); + + // Deallocates a region of memory that was previously allocated with + // Alloc(). Does nothing if passed 0. "s" must be either 0, + // or must have been returned from a call to Alloc() and not yet passed to + // Free() since that call to Alloc(). The space is returned to the arena + // from which it was allocated. + static void Free(void *s) ABSL_ATTRIBUTE_SECTION(malloc_hook); + + // ABSL_ATTRIBUTE_SECTION(malloc_hook) for Alloc* and Free + // are to put all callers of MallocHook::Invoke* in this module + // into special section, + // so that MallocHook::GetCallerStackTrace can function accurately. + + // Create a new arena. + // The root metadata for the new arena is allocated in the + // meta_data_arena; the DefaultArena() can be passed for meta_data_arena. + // These values may be ored into flags: + enum { + // Report calls to Alloc() and Free() via the MallocHook interface. + // Set in the DefaultArena. + kCallMallocHook = 0x0001, + +#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING + // Make calls to Alloc(), Free() be async-signal-safe. Not set in + // DefaultArena(). Not supported on all platforms. + kAsyncSignalSafe = 0x0002, +#endif + }; + // Construct a new arena. The allocation of the underlying metadata honors + // the provided flags. For example, the call NewArena(kAsyncSignalSafe) + // is itself async-signal-safe, as well as generatating an arena that provides + // async-signal-safe Alloc/Free. + static Arena *NewArena(int32_t flags); + + // Destroys an arena allocated by NewArena and returns true, + // provided no allocated blocks remain in the arena. + // If allocated blocks remain in the arena, does nothing and + // returns false. + // It is illegal to attempt to destroy the DefaultArena(). + static bool DeleteArena(Arena *arena); + + // The default arena that always exists. + static Arena *DefaultArena(); + + private: + LowLevelAlloc(); // no instances +}; + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/low_level_scheduling.h b/SaraAttended/Pods/abseil/absl/base/internal/low_level_scheduling.h new file mode 100644 index 0000000..961cc98 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/low_level_scheduling.h @@ -0,0 +1,107 @@ +// 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. +// +// Core interfaces and definitions used by by low-level interfaces such as +// SpinLock. + +#ifndef ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ +#define ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ + +#include "absl/base/internal/scheduling_mode.h" +#include "absl/base/macros.h" + +// The following two declarations exist so SchedulingGuard may friend them with +// the appropriate language linkage. These callbacks allow libc internals, such +// as function level statics, to schedule cooperatively when locking. +extern "C" bool __google_disable_rescheduling(void); +extern "C" void __google_enable_rescheduling(bool disable_result); + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +class SchedulingHelper; // To allow use of SchedulingGuard. +class SpinLock; // To allow use of SchedulingGuard. + +// SchedulingGuard +// Provides guard semantics that may be used to disable cooperative rescheduling +// of the calling thread within specific program blocks. This is used to +// protect resources (e.g. low-level SpinLocks or Domain code) that cooperative +// scheduling depends on. +// +// Domain implementations capable of rescheduling in reaction to involuntary +// kernel thread actions (e.g blocking due to a pagefault or syscall) must +// guarantee that an annotated thread is not allowed to (cooperatively) +// reschedule until the annotated region is complete. +// +// It is an error to attempt to use a cooperatively scheduled resource (e.g. +// Mutex) within a rescheduling-disabled region. +// +// All methods are async-signal safe. +class SchedulingGuard { + public: + // Returns true iff the calling thread may be cooperatively rescheduled. + static bool ReschedulingIsAllowed(); + + private: + // Disable cooperative rescheduling of the calling thread. It may still + // initiate scheduling operations (e.g. wake-ups), however, it may not itself + // reschedule. Nestable. The returned result is opaque, clients should not + // attempt to interpret it. + // REQUIRES: Result must be passed to a pairing EnableScheduling(). + static bool DisableRescheduling(); + + // Marks the end of a rescheduling disabled region, previously started by + // DisableRescheduling(). + // REQUIRES: Pairs with innermost call (and result) of DisableRescheduling(). + static void EnableRescheduling(bool disable_result); + + // A scoped helper for {Disable, Enable}Rescheduling(). + // REQUIRES: destructor must run in same thread as constructor. + struct ScopedDisable { + ScopedDisable() { disabled = SchedulingGuard::DisableRescheduling(); } + ~ScopedDisable() { SchedulingGuard::EnableRescheduling(disabled); } + + bool disabled; + }; + + // Access to SchedulingGuard is explicitly white-listed. + friend class SchedulingHelper; + friend class SpinLock; + + SchedulingGuard(const SchedulingGuard&) = delete; + SchedulingGuard& operator=(const SchedulingGuard&) = delete; +}; + +//------------------------------------------------------------------------------ +// End of public interfaces. +//------------------------------------------------------------------------------ + +inline bool SchedulingGuard::ReschedulingIsAllowed() { + return false; +} + +inline bool SchedulingGuard::DisableRescheduling() { + return false; +} + +inline void SchedulingGuard::EnableRescheduling(bool /* disable_result */) { + return; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/per_thread_tls.h b/SaraAttended/Pods/abseil/absl/base/internal/per_thread_tls.h new file mode 100644 index 0000000..cf5e97a --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/per_thread_tls.h @@ -0,0 +1,52 @@ +// 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_PER_THREAD_TLS_H_ +#define ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ + +// This header defines two macros: +// +// If the platform supports thread-local storage: +// +// * ABSL_PER_THREAD_TLS_KEYWORD is the C keyword needed to declare a +// thread-local variable +// * ABSL_PER_THREAD_TLS is 1 +// +// Otherwise: +// +// * ABSL_PER_THREAD_TLS_KEYWORD is empty +// * ABSL_PER_THREAD_TLS is 0 +// +// Microsoft C supports thread-local storage. +// GCC supports it if the appropriate version of glibc is available, +// which the programmer can indicate by defining ABSL_HAVE_TLS + +#include "absl/base/port.h" // For ABSL_HAVE_TLS + +#if defined(ABSL_PER_THREAD_TLS) +#error ABSL_PER_THREAD_TLS cannot be directly set +#elif defined(ABSL_PER_THREAD_TLS_KEYWORD) +#error ABSL_PER_THREAD_TLS_KEYWORD cannot be directly set +#elif defined(ABSL_HAVE_TLS) +#define ABSL_PER_THREAD_TLS_KEYWORD __thread +#define ABSL_PER_THREAD_TLS 1 +#elif defined(_MSC_VER) +#define ABSL_PER_THREAD_TLS_KEYWORD __declspec(thread) +#define ABSL_PER_THREAD_TLS 1 +#else +#define ABSL_PER_THREAD_TLS_KEYWORD +#define ABSL_PER_THREAD_TLS 0 +#endif + +#endif // ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.cc b/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.cc new file mode 100644 index 0000000..520dabb --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.cc @@ -0,0 +1,53 @@ +// 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/periodic_sampler.h" + +#include + +#include "absl/base/internal/exponential_biased.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +int64_t PeriodicSamplerBase::GetExponentialBiased(int period) noexcept { + return rng_.GetStride(period); +} + +bool PeriodicSamplerBase::SubtleConfirmSample() noexcept { + int current_period = period(); + + // Deal with period case 0 (always off) and 1 (always on) + if (ABSL_PREDICT_FALSE(current_period < 2)) { + stride_ = 0; + return current_period == 1; + } + + // Check if this is the first call to Sample() + if (ABSL_PREDICT_FALSE(stride_ == 1)) { + stride_ = static_cast(-GetExponentialBiased(current_period)); + if (static_cast(stride_) < -1) { + ++stride_; + return false; + } + } + + stride_ = static_cast(-GetExponentialBiased(current_period)); + return true; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.h b/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.h new file mode 100644 index 0000000..f8a8679 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/periodic_sampler.h @@ -0,0 +1,211 @@ +// 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_PERIODIC_SAMPLER_H_ +#define ABSL_BASE_INTERNAL_PERIODIC_SAMPLER_H_ + +#include + +#include + +#include "absl/base/internal/exponential_biased.h" +#include "absl/base/optimization.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// PeriodicSamplerBase provides the basic period sampler implementation. +// +// This is the base class for the templated PeriodicSampler class, which holds +// a global std::atomic value identified by a user defined tag, such that +// each specific PeriodSampler implementation holds its own global period. +// +// PeriodicSamplerBase is thread-compatible except where stated otherwise. +class PeriodicSamplerBase { + public: + // PeriodicSamplerBase is trivial / copyable / movable / destructible. + PeriodicSamplerBase() = default; + PeriodicSamplerBase(PeriodicSamplerBase&&) = default; + PeriodicSamplerBase(const PeriodicSamplerBase&) = default; + + // Returns true roughly once every `period` calls. This is established by a + // randomly picked `stride` that is counted down on each call to `Sample`. + // This stride is picked such that the probability of `Sample()` returning + // true is 1 in `period`. + inline bool Sample() noexcept; + + // The below methods are intended for optimized use cases where the + // size of the inlined fast path code is highly important. Applications + // should use the `Sample()` method unless they have proof that their + // specific use case requires the optimizations offered by these methods. + // + // An example of such a use case is SwissTable sampling. All sampling checks + // are in inlined SwissTable methods, and the number of call sites is huge. + // In this case, the inlined code size added to each translation unit calling + // SwissTable methods is non-trivial. + // + // The `SubtleMaybeSample()` function spuriously returns true even if the + // function should not be sampled, applications MUST match each call to + // 'SubtleMaybeSample()' returning true with a `SubtleConfirmSample()` call, + // and use the result of the latter as the sampling decision. + // In other words: the code should logically be equivalent to: + // + // if (SubtleMaybeSample() && SubtleConfirmSample()) { + // // Sample this call + // } + // + // In the 'inline-size' optimized case, the `SubtleConfirmSample()` call can + // be placed out of line, for example, the typical use case looks as follows: + // + // // --- frobber.h ----------- + // void FrobberSampled(); + // + // inline void FrobberImpl() { + // // ... + // } + // + // inline void Frobber() { + // if (ABSL_PREDICT_FALSE(sampler.SubtleMaybeSample())) { + // FrobberSampled(); + // } else { + // FrobberImpl(); + // } + // } + // + // // --- frobber.cc ----------- + // void FrobberSampled() { + // if (!sampler.SubtleConfirmSample())) { + // // Spurious false positive + // FrobberImpl(); + // return; + // } + // + // // Sampled execution + // // ... + // } + inline bool SubtleMaybeSample() noexcept; + bool SubtleConfirmSample() noexcept; + + protected: + // We explicitly don't use a virtual destructor as this class is never + // virtually destroyed, and it keeps the class trivial, which avoids TLS + // prologue and epilogue code for our TLS instances. + ~PeriodicSamplerBase() = default; + + // Returns the next stride for our sampler. + // This function is virtual for testing purposes only. + virtual int64_t GetExponentialBiased(int period) noexcept; + + private: + // Returns the current period of this sampler. Thread-safe. + virtual int period() const noexcept = 0; + + // Keep and decrement stride_ as an unsigned integer, but compare the value + // to zero casted as a signed int. clang and msvc do not create optimum code + // if we use signed for the combined decrement and sign comparison. + // + // Below 3 alternative options, all compiles generate the best code + // using the unsigned increment <---> signed int comparison option. + // + // Option 1: + // int64_t stride_; + // if (ABSL_PREDICT_TRUE(++stride_ < 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/R5MzzA + // GCC ppc (OK) : https://gcc.godbolt.org/z/z7NZAt + // Clang x64 (BAD): https://gcc.godbolt.org/z/t4gPsd + // ICC x64 (OK) : https://gcc.godbolt.org/z/rE6s8W + // MSVC x64 (OK) : https://gcc.godbolt.org/z/ARMXqS + // + // Option 2: + // int64_t stride_ = 0; + // if (ABSL_PREDICT_TRUE(--stride_ >= 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/jSQxYK + // GCC ppc (OK) : https://gcc.godbolt.org/z/VJdYaA + // Clang x64 (BAD): https://gcc.godbolt.org/z/Xm4NjX + // ICC x64 (OK) : https://gcc.godbolt.org/z/4snaFd + // MSVC x64 (BAD): https://gcc.godbolt.org/z/BgnEKE + // + // Option 3: + // uint64_t stride_; + // if (ABSL_PREDICT_TRUE(static_cast(++stride_) < 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/bFbfPy + // GCC ppc (OK) : https://gcc.godbolt.org/z/S9KkUE + // Clang x64 (OK) : https://gcc.godbolt.org/z/UYzRb4 + // ICC x64 (OK) : https://gcc.godbolt.org/z/ptTNfD + // MSVC x64 (OK) : https://gcc.godbolt.org/z/76j4-5 + uint64_t stride_ = 0; + ExponentialBiased rng_; +}; + +inline bool PeriodicSamplerBase::SubtleMaybeSample() noexcept { + // See comments on `stride_` for the unsigned increment / signed compare. + if (ABSL_PREDICT_TRUE(static_cast(++stride_) < 0)) { + return false; + } + return true; +} + +inline bool PeriodicSamplerBase::Sample() noexcept { + return ABSL_PREDICT_FALSE(SubtleMaybeSample()) ? SubtleConfirmSample() + : false; +} + +// PeriodicSampler is a concreted periodic sampler implementation. +// The user provided Tag identifies the implementation, and is required to +// isolate the global state of this instance from other instances. +// +// Typical use case: +// +// struct HashTablezTag {}; +// thread_local PeriodicSampler sampler; +// +// void HashTableSamplingLogic(...) { +// if (sampler.Sample()) { +// HashTableSlowSamplePath(...); +// } +// } +// +template +class PeriodicSampler final : public PeriodicSamplerBase { + public: + ~PeriodicSampler() = default; + + int period() const noexcept final { + return period_.load(std::memory_order_relaxed); + } + + // Sets the global period for this sampler. Thread-safe. + // Setting a period of 0 disables the sampler, i.e., every call to Sample() + // will return false. Setting a period of 1 puts the sampler in 'always on' + // mode, i.e., every call to Sample() returns true. + static void SetGlobalPeriod(int period) { + period_.store(period, std::memory_order_relaxed); + } + + private: + static std::atomic period_; +}; + +template +std::atomic PeriodicSampler::period_(default_period); + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_PERIODIC_SAMPLER_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/pretty_function.h b/SaraAttended/Pods/abseil/absl/base/internal/pretty_function.h new file mode 100644 index 0000000..35d5167 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/pretty_function.h @@ -0,0 +1,33 @@ +// 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_PRETTY_FUNCTION_H_ +#define ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ + +// ABSL_PRETTY_FUNCTION +// +// In C++11, __func__ gives the undecorated name of the current function. That +// is, "main", not "int main()". Various compilers give extra macros to get the +// decorated function name, including return type and arguments, to +// differentiate between overload sets. ABSL_PRETTY_FUNCTION is a portable +// version of these macros which forwards to the correct macro on each compiler. +#if defined(_MSC_VER) +#define ABSL_PRETTY_FUNCTION __FUNCSIG__ +#elif defined(__GNUC__) +#define ABSL_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#else +#error "Unsupported compiler" +#endif + +#endif // ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.cc b/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.cc new file mode 100644 index 0000000..40cea55 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.cc @@ -0,0 +1,240 @@ +// 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/raw_logging.h" + +#include +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/config.h" +#include "absl/base/internal/atomic_hook.h" +#include "absl/base/log_severity.h" + +// We know how to perform low-level writes to stderr in POSIX and Windows. For +// these platforms, we define the token ABSL_LOW_LEVEL_WRITE_SUPPORTED. +// Much of raw_logging.cc becomes a no-op when we can't output messages, +// although a FATAL ABSL_RAW_LOG message will still abort the process. + +// ABSL_HAVE_POSIX_WRITE is defined when the platform provides posix write() +// (as from unistd.h) +// +// This preprocessor token is also defined in raw_io.cc. If you need to copy +// this, consider moving both to config.h instead. +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__Fuchsia__) || defined(__native_client__) || \ + defined(__EMSCRIPTEN__) || defined(__ASYLO__) + +#include + +#define ABSL_HAVE_POSIX_WRITE 1 +#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#else +#undef ABSL_HAVE_POSIX_WRITE +#endif + +// ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall +// syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len); +// for low level operations that want to avoid libc. +#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__) +#include +#define ABSL_HAVE_SYSCALL_WRITE 1 +#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#else +#undef ABSL_HAVE_SYSCALL_WRITE +#endif + +#ifdef _WIN32 +#include + +#define ABSL_HAVE_RAW_IO 1 +#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#else +#undef ABSL_HAVE_RAW_IO +#endif + +// TODO(gfalcon): We want raw-logging to work on as many platforms as possible. +// Explicitly #error out when not ABSL_LOW_LEVEL_WRITE_SUPPORTED, except for a +// whitelisted set of platforms for which we expect not to be able to raw log. + +ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static absl::base_internal::AtomicHook< + absl::raw_logging_internal::LogPrefixHook> + log_prefix_hook; +ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static absl::base_internal::AtomicHook< + absl::raw_logging_internal::AbortHook> + abort_hook; + +#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED +static const char kTruncated[] = " ... (message truncated)\n"; + +// sprintf the format to the buffer, adjusting *buf and *size to reflect the +// consumed bytes, and return whether the message fit without truncation. If +// truncation occurred, if possible leave room in the buffer for the message +// kTruncated[]. +inline static bool VADoRawLog(char** buf, int* size, const char* format, + va_list ap) ABSL_PRINTF_ATTRIBUTE(3, 0); +inline static bool VADoRawLog(char** buf, int* size, + const char* format, va_list ap) { + int n = vsnprintf(*buf, *size, format, ap); + bool result = true; + if (n < 0 || n > *size) { + result = false; + if (static_cast(*size) > sizeof(kTruncated)) { + n = *size - sizeof(kTruncated); // room for truncation message + } else { + n = 0; // no room for truncation message + } + } + *size -= n; + *buf += n; + return result; +} +#endif // ABSL_LOW_LEVEL_WRITE_SUPPORTED + +static constexpr int kLogBufSize = 3000; + +namespace { + +// CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths +// that invoke malloc() and getenv() that might acquire some locks. + +// Helper for RawLog below. +// *DoRawLog writes to *buf of *size and move them past the written portion. +// It returns true iff there was no overflow or error. +bool DoRawLog(char** buf, int* size, const char* format, ...) + ABSL_PRINTF_ATTRIBUTE(3, 4); +bool DoRawLog(char** buf, int* size, const char* format, ...) { + va_list ap; + va_start(ap, format); + int n = vsnprintf(*buf, *size, format, ap); + va_end(ap); + if (n < 0 || n > *size) return false; + *size -= n; + *buf += n; + return true; +} + +void RawLogVA(absl::LogSeverity severity, const char* file, int line, + const char* format, va_list ap) ABSL_PRINTF_ATTRIBUTE(4, 0); +void RawLogVA(absl::LogSeverity severity, const char* file, int line, + const char* format, va_list ap) { + char buffer[kLogBufSize]; + char* buf = buffer; + int size = sizeof(buffer); +#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED + bool enabled = true; +#else + bool enabled = false; +#endif + +#ifdef ABSL_MIN_LOG_LEVEL + if (severity < static_cast(ABSL_MIN_LOG_LEVEL) && + severity < absl::LogSeverity::kFatal) { + enabled = false; + } +#endif + + auto log_prefix_hook_ptr = log_prefix_hook.Load(); + if (log_prefix_hook_ptr) { + enabled = log_prefix_hook_ptr(severity, file, line, &buf, &size); + } else { + if (enabled) { + DoRawLog(&buf, &size, "[%s : %d] RAW: ", file, line); + } + } + const char* const prefix_end = buf; + +#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED + if (enabled) { + bool no_chop = VADoRawLog(&buf, &size, format, ap); + if (no_chop) { + DoRawLog(&buf, &size, "\n"); + } else { + DoRawLog(&buf, &size, "%s", kTruncated); + } + absl::raw_logging_internal::SafeWriteToStderr(buffer, strlen(buffer)); + } +#else + static_cast(format); + static_cast(ap); +#endif + + // Abort the process after logging a FATAL message, even if the output itself + // was suppressed. + if (severity == absl::LogSeverity::kFatal) { + abort_hook(file, line, buffer, prefix_end, buffer + kLogBufSize); + abort(); + } +} + +} // namespace + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace raw_logging_internal { +void SafeWriteToStderr(const char *s, size_t len) { +#if defined(ABSL_HAVE_SYSCALL_WRITE) + syscall(SYS_write, STDERR_FILENO, s, len); +#elif defined(ABSL_HAVE_POSIX_WRITE) + write(STDERR_FILENO, s, len); +#elif defined(ABSL_HAVE_RAW_IO) + _write(/* stderr */ 2, s, len); +#else + // stderr logging unsupported on this platform + (void) s; + (void) len; +#endif +} + +void RawLog(absl::LogSeverity severity, const char* file, int line, + const char* format, ...) ABSL_PRINTF_ATTRIBUTE(4, 5); +void RawLog(absl::LogSeverity severity, const char* file, int line, + const char* format, ...) { + va_list ap; + va_start(ap, format); + RawLogVA(severity, file, line, format, ap); + va_end(ap); +} + +// Non-formatting version of RawLog(). +// +// TODO(gfalcon): When string_view no longer depends on base, change this +// interface to take its message as a string_view instead. +static void DefaultInternalLog(absl::LogSeverity severity, const char* file, + int line, const std::string& message) { + RawLog(severity, file, line, "%s", message.c_str()); +} + +bool RawLoggingFullySupported() { +#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED + return true; +#else // !ABSL_LOW_LEVEL_WRITE_SUPPORTED + return false; +#endif // !ABSL_LOW_LEVEL_WRITE_SUPPORTED +} + +ABSL_DLL ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES + absl::base_internal::AtomicHook + internal_log_function(DefaultInternalLog); + +void RegisterInternalLogFunction(InternalLogFunction func) { + internal_log_function.Store(func); +} + +} // namespace raw_logging_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.h b/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.h new file mode 100644 index 0000000..418d6c8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/raw_logging.h @@ -0,0 +1,183 @@ +// 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. +// +// Thread-safe logging routines that do not allocate any memory or +// acquire any locks, and can therefore be used by low-level memory +// allocation, synchronization, and signal-handling code. + +#ifndef ABSL_BASE_INTERNAL_RAW_LOGGING_H_ +#define ABSL_BASE_INTERNAL_RAW_LOGGING_H_ + +#include + +#include "absl/base/attributes.h" +#include "absl/base/config.h" +#include "absl/base/internal/atomic_hook.h" +#include "absl/base/log_severity.h" +#include "absl/base/macros.h" +#include "absl/base/optimization.h" +#include "absl/base/port.h" + +// This is similar to LOG(severity) << format..., but +// * it is to be used ONLY by low-level modules that can't use normal LOG() +// * it is designed to be a low-level logger that does not allocate any +// memory and does not need any locks, hence: +// * it logs straight and ONLY to STDERR w/o buffering +// * it uses an explicit printf-format and arguments list +// * it will silently chop off really long message strings +// Usage example: +// ABSL_RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// This will print an almost standard log line like this to stderr only: +// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file + +#define ABSL_RAW_LOG(severity, ...) \ + do { \ + constexpr const char* absl_raw_logging_internal_basename = \ + ::absl::raw_logging_internal::Basename(__FILE__, \ + sizeof(__FILE__) - 1); \ + ::absl::raw_logging_internal::RawLog(ABSL_RAW_LOGGING_INTERNAL_##severity, \ + absl_raw_logging_internal_basename, \ + __LINE__, __VA_ARGS__); \ + } while (0) + +// Similar to CHECK(condition) << message, but for low-level modules: +// we use only ABSL_RAW_LOG that does not allocate memory. +// We do not want to provide args list here to encourage this usage: +// if (!cond) ABSL_RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// so that the args are not computed when not needed. +#define ABSL_RAW_CHECK(condition, message) \ + do { \ + if (ABSL_PREDICT_FALSE(!(condition))) { \ + ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + } \ + } while (0) + +// ABSL_INTERNAL_LOG and ABSL_INTERNAL_CHECK work like the RAW variants above, +// except that if the richer log library is linked into the binary, we dispatch +// to that instead. This is potentially useful for internal logging and +// assertions, where we are using RAW_LOG neither for its async-signal-safety +// nor for its non-allocating nature, but rather because raw logging has very +// few other dependencies. +// +// The API is a subset of the above: each macro only takes two arguments. Use +// StrCat if you need to build a richer message. +#define ABSL_INTERNAL_LOG(severity, message) \ + do { \ + ::absl::raw_logging_internal::internal_log_function( \ + ABSL_RAW_LOGGING_INTERNAL_##severity, __FILE__, __LINE__, message); \ + } while (0) + +#define ABSL_INTERNAL_CHECK(condition, message) \ + do { \ + if (ABSL_PREDICT_FALSE(!(condition))) { \ + std::string death_message = "Check " #condition " failed: "; \ + death_message += std::string(message); \ + ABSL_INTERNAL_LOG(FATAL, death_message); \ + } \ + } while (0) + +#define ABSL_RAW_LOGGING_INTERNAL_INFO ::absl::LogSeverity::kInfo +#define ABSL_RAW_LOGGING_INTERNAL_WARNING ::absl::LogSeverity::kWarning +#define ABSL_RAW_LOGGING_INTERNAL_ERROR ::absl::LogSeverity::kError +#define ABSL_RAW_LOGGING_INTERNAL_FATAL ::absl::LogSeverity::kFatal +#define ABSL_RAW_LOGGING_INTERNAL_LEVEL(severity) \ + ::absl::NormalizeLogSeverity(severity) + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace raw_logging_internal { + +// Helper function to implement ABSL_RAW_LOG +// Logs format... at "severity" level, reporting it +// as called from file:line. +// This does not allocate memory or acquire locks. +void RawLog(absl::LogSeverity severity, const char* file, int line, + const char* format, ...) ABSL_PRINTF_ATTRIBUTE(4, 5); + +// Writes the provided buffer directly to stderr, in a safe, low-level manner. +// +// In POSIX this means calling write(), which is async-signal safe and does +// not malloc. If the platform supports the SYS_write syscall, we invoke that +// directly to side-step any libc interception. +void SafeWriteToStderr(const char *s, size_t len); + +// compile-time function to get the "base" filename, that is, the part of +// a filename after the last "/" or "\" path separator. The search starts at +// the end of the string; the second parameter is the length of the string. +constexpr const char* Basename(const char* fname, int offset) { + return offset == 0 || fname[offset - 1] == '/' || fname[offset - 1] == '\\' + ? fname + offset + : Basename(fname, offset - 1); +} + +// For testing only. +// Returns true if raw logging is fully supported. When it is not +// fully supported, no messages will be emitted, but a log at FATAL +// severity will cause an abort. +// +// TODO(gfalcon): Come up with a better name for this method. +bool RawLoggingFullySupported(); + +// Function type for a raw_logging customization hook for suppressing messages +// by severity, and for writing custom prefixes on non-suppressed messages. +// +// The installed hook is called for every raw log invocation. The message will +// be logged to stderr only if the hook returns true. FATAL errors will cause +// the process to abort, even if writing to stderr is suppressed. The hook is +// also provided with an output buffer, where it can write a custom log message +// prefix. +// +// The raw_logging system does not allocate memory or grab locks. User-provided +// hooks must avoid these operations, and must not throw exceptions. +// +// 'severity' is the severity level of the message being written. +// 'file' and 'line' are the file and line number where the ABSL_RAW_LOG macro +// was located. +// 'buffer' and 'buf_size' are pointers to the buffer and buffer size. If the +// hook writes a prefix, it must increment *buffer and decrement *buf_size +// accordingly. +using LogPrefixHook = bool (*)(absl::LogSeverity severity, const char* file, + int line, char** buffer, int* buf_size); + +// Function type for a raw_logging customization hook called to abort a process +// when a FATAL message is logged. If the provided AbortHook() returns, the +// logging system will call abort(). +// +// 'file' and 'line' are the file and line number where the ABSL_RAW_LOG macro +// was located. +// The NUL-terminated logged message lives in the buffer between 'buf_start' +// and 'buf_end'. 'prefix_end' points to the first non-prefix character of the +// buffer (as written by the LogPrefixHook.) +using AbortHook = void (*)(const char* file, int line, const char* buf_start, + const char* prefix_end, const char* buf_end); + +// Internal logging function for ABSL_INTERNAL_LOG to dispatch to. +// +// TODO(gfalcon): When string_view no longer depends on base, change this +// interface to take its message as a string_view instead. +using InternalLogFunction = void (*)(absl::LogSeverity severity, + const char* file, int line, + const std::string& message); + +ABSL_DLL ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES extern base_internal::AtomicHook< + InternalLogFunction> + internal_log_function; + +void RegisterInternalLogFunction(InternalLogFunction func); + +} // namespace raw_logging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_RAW_LOGGING_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/scheduling_mode.h b/SaraAttended/Pods/abseil/absl/base/internal/scheduling_mode.h new file mode 100644 index 0000000..8be5ab6 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/scheduling_mode.h @@ -0,0 +1,58 @@ +// 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. +// +// Core interfaces and definitions used by by low-level interfaces such as +// SpinLock. + +#ifndef ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ +#define ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Used to describe how a thread may be scheduled. Typically associated with +// the declaration of a resource supporting synchronized access. +// +// SCHEDULE_COOPERATIVE_AND_KERNEL: +// Specifies that when waiting, a cooperative thread (e.g. a Fiber) may +// reschedule (using base::scheduling semantics); allowing other cooperative +// threads to proceed. +// +// SCHEDULE_KERNEL_ONLY: (Also described as "non-cooperative") +// Specifies that no cooperative scheduling semantics may be used, even if the +// current thread is itself cooperatively scheduled. This means that +// cooperative threads will NOT allow other cooperative threads to execute in +// their place while waiting for a resource of this type. Host operating system +// semantics (e.g. a futex) may still be used. +// +// When optional, clients should strongly prefer SCHEDULE_COOPERATIVE_AND_KERNEL +// by default. SCHEDULE_KERNEL_ONLY should only be used for resources on which +// base::scheduling (e.g. the implementation of a Scheduler) may depend. +// +// NOTE: Cooperative resources may not be nested below non-cooperative ones. +// This means that it is invalid to to acquire a SCHEDULE_COOPERATIVE_AND_KERNEL +// resource if a SCHEDULE_KERNEL_ONLY resource is already held. +enum SchedulingMode { + SCHEDULE_KERNEL_ONLY = 0, // Allow scheduling only the host OS. + SCHEDULE_COOPERATIVE_AND_KERNEL, // Also allow cooperative scheduling. +}; + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock.cc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock.cc new file mode 100644 index 0000000..830d472 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock.cc @@ -0,0 +1,233 @@ +// 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/spinlock.h" + +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/internal/atomic_hook.h" +#include "absl/base/internal/cycleclock.h" +#include "absl/base/internal/spinlock_wait.h" +#include "absl/base/internal/sysinfo.h" /* For NumCPUs() */ +#include "absl/base/call_once.h" + +// Description of lock-word: +// 31..00: [............................3][2][1][0] +// +// [0]: kSpinLockHeld +// [1]: kSpinLockCooperative +// [2]: kSpinLockDisabledScheduling +// [31..3]: ONLY kSpinLockSleeper OR +// Wait time in cycles >> PROFILE_TIMESTAMP_SHIFT +// +// Detailed descriptions: +// +// Bit [0]: The lock is considered held iff kSpinLockHeld is set. +// +// Bit [1]: Eligible waiters (e.g. Fibers) may co-operatively reschedule when +// contended iff kSpinLockCooperative is set. +// +// Bit [2]: This bit is exclusive from bit [1]. It is used only by a +// non-cooperative lock. When set, indicates that scheduling was +// successfully disabled when the lock was acquired. May be unset, +// even if non-cooperative, if a ThreadIdentity did not yet exist at +// time of acquisition. +// +// Bit [3]: If this is the only upper bit ([31..3]) set then this lock was +// acquired without contention, however, at least one waiter exists. +// +// Otherwise, bits [31..3] represent the time spent by the current lock +// holder to acquire the lock. There may be outstanding waiter(s). + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static base_internal::AtomicHook + submit_profile_data; + +void RegisterSpinLockProfiler(void (*fn)(const void *contendedlock, + int64_t wait_cycles)) { + submit_profile_data.Store(fn); +} + +// Uncommon constructors. +SpinLock::SpinLock(base_internal::SchedulingMode mode) + : lockword_(IsCooperative(mode) ? kSpinLockCooperative : 0) { + ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); +} + +SpinLock::SpinLock(base_internal::LinkerInitialized, + base_internal::SchedulingMode mode) { + ABSL_TSAN_MUTEX_CREATE(this, 0); + if (IsCooperative(mode)) { + InitLinkerInitializedAndCooperative(); + } + // Otherwise, lockword_ is already initialized. +} + +// Static (linker initialized) spinlocks always start life as functional +// non-cooperative locks. When their static constructor does run, it will call +// this initializer to augment the lockword with the cooperative bit. By +// actually taking the lock when we do this we avoid the need for an atomic +// operation in the regular unlock path. +// +// SlowLock() must be careful to re-test for this bit so that any outstanding +// waiters may be upgraded to cooperative status. +void SpinLock::InitLinkerInitializedAndCooperative() { + Lock(); + lockword_.fetch_or(kSpinLockCooperative, std::memory_order_relaxed); + Unlock(); +} + +// Monitor the lock to see if its value changes within some time period +// (adaptive_spin_count loop iterations). The last value read from the lock +// is returned from the method. +uint32_t SpinLock::SpinLoop() { + // We are already in the slow path of SpinLock, initialize the + // adaptive_spin_count here. + ABSL_CONST_INIT static absl::once_flag init_adaptive_spin_count; + ABSL_CONST_INIT static int adaptive_spin_count = 0; + base_internal::LowLevelCallOnce(&init_adaptive_spin_count, []() { + adaptive_spin_count = base_internal::NumCPUs() > 1 ? 1000 : 1; + }); + + int c = adaptive_spin_count; + uint32_t lock_value; + do { + lock_value = lockword_.load(std::memory_order_relaxed); + } while ((lock_value & kSpinLockHeld) != 0 && --c > 0); + return lock_value; +} + +void SpinLock::SlowLock() { + uint32_t lock_value = SpinLoop(); + lock_value = TryLockInternal(lock_value, 0); + if ((lock_value & kSpinLockHeld) == 0) { + return; + } + // The lock was not obtained initially, so this thread needs to wait for + // it. Record the current timestamp in the local variable wait_start_time + // so the total wait time can be stored in the lockword once this thread + // obtains the lock. + int64_t wait_start_time = CycleClock::Now(); + uint32_t wait_cycles = 0; + int lock_wait_call_count = 0; + while ((lock_value & kSpinLockHeld) != 0) { + // If the lock is currently held, but not marked as having a sleeper, mark + // it as having a sleeper. + if ((lock_value & kWaitTimeMask) == 0) { + // Here, just "mark" that the thread is going to sleep. Don't store the + // lock wait time in the lock as that will cause the current lock + // owner to think it experienced contention. + if (lockword_.compare_exchange_strong( + lock_value, lock_value | kSpinLockSleeper, + std::memory_order_relaxed, std::memory_order_relaxed)) { + // Successfully transitioned to kSpinLockSleeper. Pass + // kSpinLockSleeper to the SpinLockWait routine to properly indicate + // the last lock_value observed. + lock_value |= kSpinLockSleeper; + } else if ((lock_value & kSpinLockHeld) == 0) { + // Lock is free again, so try and acquire it before sleeping. The + // new lock state will be the number of cycles this thread waited if + // this thread obtains the lock. + lock_value = TryLockInternal(lock_value, wait_cycles); + continue; // Skip the delay at the end of the loop. + } + } + + base_internal::SchedulingMode scheduling_mode; + if ((lock_value & kSpinLockCooperative) != 0) { + scheduling_mode = base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL; + } else { + scheduling_mode = base_internal::SCHEDULE_KERNEL_ONLY; + } + // SpinLockDelay() calls into fiber scheduler, we need to see + // synchronization there to avoid false positives. + ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); + // Wait for an OS specific delay. + base_internal::SpinLockDelay(&lockword_, lock_value, ++lock_wait_call_count, + scheduling_mode); + ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); + // Spin again after returning from the wait routine to give this thread + // some chance of obtaining the lock. + lock_value = SpinLoop(); + wait_cycles = EncodeWaitCycles(wait_start_time, CycleClock::Now()); + lock_value = TryLockInternal(lock_value, wait_cycles); + } +} + +void SpinLock::SlowUnlock(uint32_t lock_value) { + base_internal::SpinLockWake(&lockword_, + false); // wake waiter if necessary + + // If our acquisition was contended, collect contentionz profile info. We + // reserve a unitary wait time to represent that a waiter exists without our + // own acquisition having been contended. + if ((lock_value & kWaitTimeMask) != kSpinLockSleeper) { + const uint64_t wait_cycles = DecodeWaitCycles(lock_value); + ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); + submit_profile_data(this, wait_cycles); + ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); + } +} + +// We use the upper 29 bits of the lock word to store the time spent waiting to +// acquire this lock. This is reported by contentionz profiling. Since the +// lower bits of the cycle counter wrap very quickly on high-frequency +// processors we divide to reduce the granularity to 2^PROFILE_TIMESTAMP_SHIFT +// sized units. On a 4Ghz machine this will lose track of wait times greater +// than (2^29/4 Ghz)*128 =~ 17.2 seconds. Such waits should be extremely rare. +enum { PROFILE_TIMESTAMP_SHIFT = 7 }; +enum { LOCKWORD_RESERVED_SHIFT = 3 }; // We currently reserve the lower 3 bits. + +uint32_t SpinLock::EncodeWaitCycles(int64_t wait_start_time, + int64_t wait_end_time) { + static const int64_t kMaxWaitTime = + std::numeric_limits::max() >> LOCKWORD_RESERVED_SHIFT; + int64_t scaled_wait_time = + (wait_end_time - wait_start_time) >> PROFILE_TIMESTAMP_SHIFT; + + // Return a representation of the time spent waiting that can be stored in + // the lock word's upper bits. + uint32_t clamped = static_cast( + std::min(scaled_wait_time, kMaxWaitTime) << LOCKWORD_RESERVED_SHIFT); + + if (clamped == 0) { + return kSpinLockSleeper; // Just wake waiters, but don't record contention. + } + // Bump up value if necessary to avoid returning kSpinLockSleeper. + const uint32_t kMinWaitTime = + kSpinLockSleeper + (1 << LOCKWORD_RESERVED_SHIFT); + if (clamped == kSpinLockSleeper) { + return kMinWaitTime; + } + return clamped; +} + +uint64_t SpinLock::DecodeWaitCycles(uint32_t lock_value) { + // Cast to uint32_t first to ensure bits [63:32] are cleared. + const uint64_t scaled_wait_time = + static_cast(lock_value & kWaitTimeMask); + return scaled_wait_time + << (PROFILE_TIMESTAMP_SHIFT - LOCKWORD_RESERVED_SHIFT); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock.h b/SaraAttended/Pods/abseil/absl/base/internal/spinlock.h new file mode 100644 index 0000000..24e2e9a --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock.h @@ -0,0 +1,243 @@ +// +// 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. +// + +// Most users requiring mutual exclusion should use Mutex. +// SpinLock is provided for use in three situations: +// - for use in code that Mutex itself depends on +// - to get a faster fast-path release under low contention (without an +// atomic read-modify-write) In return, SpinLock has worse behaviour under +// contention, which is why Mutex is preferred in most situations. +// - for async signal safety (see below) + +// SpinLock is async signal safe. If a spinlock is used within a signal +// handler, all code that acquires the lock must ensure that the signal cannot +// arrive while they are holding the lock. Typically, this is done by blocking +// the signal. + +#ifndef ABSL_BASE_INTERNAL_SPINLOCK_H_ +#define ABSL_BASE_INTERNAL_SPINLOCK_H_ + +#include +#include + +#include + +#include "absl/base/attributes.h" +#include "absl/base/dynamic_annotations.h" +#include "absl/base/internal/low_level_scheduling.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/scheduling_mode.h" +#include "absl/base/internal/tsan_mutex_interface.h" +#include "absl/base/macros.h" +#include "absl/base/port.h" +#include "absl/base/thread_annotations.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +class ABSL_LOCKABLE SpinLock { + public: + SpinLock() : lockword_(kSpinLockCooperative) { + ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); + } + + // Special constructor for use with static SpinLock objects. E.g., + // + // static SpinLock lock(base_internal::kLinkerInitialized); + // + // When initialized using this constructor, we depend on the fact + // that the linker has already initialized the memory appropriately. The lock + // is initialized in non-cooperative mode. + // + // A SpinLock constructed like this can be freely used from global + // initializers without worrying about the order in which global + // initializers run. + explicit SpinLock(base_internal::LinkerInitialized) { + // Does nothing; lockword_ is already initialized + ABSL_TSAN_MUTEX_CREATE(this, 0); + } + + // Constructors that allow non-cooperative spinlocks to be created for use + // inside thread schedulers. Normal clients should not use these. + explicit SpinLock(base_internal::SchedulingMode mode); + SpinLock(base_internal::LinkerInitialized, + base_internal::SchedulingMode mode); + + ~SpinLock() { ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static); } + + // Acquire this SpinLock. + inline void Lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() { + ABSL_TSAN_MUTEX_PRE_LOCK(this, 0); + if (!TryLockImpl()) { + SlowLock(); + } + ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0); + } + + // Try to acquire this SpinLock without blocking and return true if the + // acquisition was successful. If the lock was not acquired, false is + // returned. If this SpinLock is free at the time of the call, TryLock + // will return true with high probability. + inline bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) { + ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock); + bool res = TryLockImpl(); + ABSL_TSAN_MUTEX_POST_LOCK( + this, __tsan_mutex_try_lock | (res ? 0 : __tsan_mutex_try_lock_failed), + 0); + return res; + } + + // Release this SpinLock, which must be held by the calling thread. + inline void Unlock() ABSL_UNLOCK_FUNCTION() { + ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0); + uint32_t lock_value = lockword_.load(std::memory_order_relaxed); + lock_value = lockword_.exchange(lock_value & kSpinLockCooperative, + std::memory_order_release); + + if ((lock_value & kSpinLockDisabledScheduling) != 0) { + base_internal::SchedulingGuard::EnableRescheduling(true); + } + if ((lock_value & kWaitTimeMask) != 0) { + // Collect contentionz profile info, and speed the wakeup of any waiter. + // The wait_cycles value indicates how long this thread spent waiting + // for the lock. + SlowUnlock(lock_value); + } + ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0); + } + + // Determine if the lock is held. When the lock is held by the invoking + // thread, true will always be returned. Intended to be used as + // CHECK(lock.IsHeld()). + inline bool IsHeld() const { + return (lockword_.load(std::memory_order_relaxed) & kSpinLockHeld) != 0; + } + + protected: + // These should not be exported except for testing. + + // Store number of cycles between wait_start_time and wait_end_time in a + // lock value. + static uint32_t EncodeWaitCycles(int64_t wait_start_time, + int64_t wait_end_time); + + // Extract number of wait cycles in a lock value. + static uint64_t DecodeWaitCycles(uint32_t lock_value); + + // Provide access to protected method above. Use for testing only. + friend struct SpinLockTest; + + private: + // lockword_ is used to store the following: + // + // bit[0] encodes whether a lock is being held. + // bit[1] encodes whether a lock uses cooperative scheduling. + // bit[2] encodes whether a lock disables scheduling. + // bit[3:31] encodes time a lock spent on waiting as a 29-bit unsigned int. + enum { kSpinLockHeld = 1 }; + enum { kSpinLockCooperative = 2 }; + enum { kSpinLockDisabledScheduling = 4 }; + enum { kSpinLockSleeper = 8 }; + enum { kWaitTimeMask = // Includes kSpinLockSleeper. + ~(kSpinLockHeld | kSpinLockCooperative | kSpinLockDisabledScheduling) }; + + // Returns true if the provided scheduling mode is cooperative. + static constexpr bool IsCooperative( + base_internal::SchedulingMode scheduling_mode) { + return scheduling_mode == base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL; + } + + uint32_t TryLockInternal(uint32_t lock_value, uint32_t wait_cycles); + void InitLinkerInitializedAndCooperative(); + void SlowLock() ABSL_ATTRIBUTE_COLD; + void SlowUnlock(uint32_t lock_value) ABSL_ATTRIBUTE_COLD; + uint32_t SpinLoop(); + + inline bool TryLockImpl() { + uint32_t lock_value = lockword_.load(std::memory_order_relaxed); + return (TryLockInternal(lock_value, 0) & kSpinLockHeld) == 0; + } + + std::atomic lockword_; + + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; +}; + +// Corresponding locker object that arranges to acquire a spinlock for +// the duration of a C++ scope. +class ABSL_SCOPED_LOCKABLE SpinLockHolder { + public: + inline explicit SpinLockHolder(SpinLock* l) ABSL_EXCLUSIVE_LOCK_FUNCTION(l) + : lock_(l) { + l->Lock(); + } + inline ~SpinLockHolder() ABSL_UNLOCK_FUNCTION() { lock_->Unlock(); } + + SpinLockHolder(const SpinLockHolder&) = delete; + SpinLockHolder& operator=(const SpinLockHolder&) = delete; + + private: + SpinLock* lock_; +}; + +// Register a hook for profiling support. +// +// The function pointer registered here will be called whenever a spinlock is +// contended. The callback is given an opaque handle to the contended spinlock +// and the number of wait cycles. This is thread-safe, but only a single +// profiler can be registered. It is an error to call this function multiple +// times with different arguments. +void RegisterSpinLockProfiler(void (*fn)(const void* lock, + int64_t wait_cycles)); + +//------------------------------------------------------------------------------ +// Public interface ends here. +//------------------------------------------------------------------------------ + +// If (result & kSpinLockHeld) == 0, then *this was successfully locked. +// Otherwise, returns last observed value for lockword_. +inline uint32_t SpinLock::TryLockInternal(uint32_t lock_value, + uint32_t wait_cycles) { + if ((lock_value & kSpinLockHeld) != 0) { + return lock_value; + } + + uint32_t sched_disabled_bit = 0; + if ((lock_value & kSpinLockCooperative) == 0) { + // For non-cooperative locks we must make sure we mark ourselves as + // non-reschedulable before we attempt to CompareAndSwap. + if (base_internal::SchedulingGuard::DisableRescheduling()) { + sched_disabled_bit = kSpinLockDisabledScheduling; + } + } + + if (!lockword_.compare_exchange_strong( + lock_value, + kSpinLockHeld | lock_value | wait_cycles | sched_disabled_bit, + std::memory_order_acquire, std::memory_order_relaxed)) { + base_internal::SchedulingGuard::EnableRescheduling(sched_disabled_bit != 0); + } + + return lock_value; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_SPINLOCK_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_akaros.inc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_akaros.inc new file mode 100644 index 0000000..bc46894 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_akaros.inc @@ -0,0 +1,35 @@ +// 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 file is an Akaros-specific part of spinlock_wait.cc + +#include + +#include "absl/base/internal/scheduling_mode.h" + +extern "C" { + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockDelay( + std::atomic* /* lock_word */, uint32_t /* value */, + int /* loop */, absl::base_internal::SchedulingMode /* mode */) { + // In Akaros, one must take care not to call anything that could cause a + // malloc(), a blocking system call, or a uthread_yield() while holding a + // spinlock. Our callers assume will not call into libraries or other + // arbitrary code. +} + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockWake( + std::atomic* /* lock_word */, bool /* all */) {} + +} // extern "C" diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_linux.inc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_linux.inc new file mode 100644 index 0000000..323edd6 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_linux.inc @@ -0,0 +1,66 @@ +// 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 file is a Linux-specific part of spinlock_wait.cc + +#include +#include +#include + +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/internal/errno_saver.h" + +// The SpinLock lockword is `std::atomic`. Here we assert that +// `std::atomic` is bitwise equivalent of the `int` expected +// by SYS_futex. We also assume that reads/writes done to the lockword +// by SYS_futex have rational semantics with regard to the +// std::atomic<> API. C++ provides no guarantees of these assumptions, +// but they are believed to hold in practice. +static_assert(sizeof(std::atomic) == sizeof(int), + "SpinLock lockword has the wrong size for a futex"); + +// Some Android headers are missing these definitions even though they +// support these futex operations. +#ifdef __BIONIC__ +#ifndef SYS_futex +#define SYS_futex __NR_futex +#endif +#ifndef FUTEX_PRIVATE_FLAG +#define FUTEX_PRIVATE_FLAG 128 +#endif +#endif + +extern "C" { + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockDelay( + std::atomic *w, uint32_t value, int loop, + absl::base_internal::SchedulingMode) { + absl::base_internal::ErrnoSaver errno_saver; + struct timespec tm; + tm.tv_sec = 0; + tm.tv_nsec = absl::base_internal::SpinLockSuggestedDelayNS(loop); + syscall(SYS_futex, w, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, value, &tm); +} + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockWake(std::atomic *w, + bool all) { + syscall(SYS_futex, w, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, all ? INT_MAX : 1, 0); +} + +} // extern "C" diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_posix.inc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_posix.inc new file mode 100644 index 0000000..fcd21b1 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_posix.inc @@ -0,0 +1,46 @@ +// 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 file is a Posix-specific part of spinlock_wait.cc + +#include + +#include +#include + +#include "absl/base/internal/errno_saver.h" +#include "absl/base/internal/scheduling_mode.h" +#include "absl/base/port.h" + +extern "C" { + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockDelay( + std::atomic* /* lock_word */, uint32_t /* value */, int loop, + absl::base_internal::SchedulingMode /* mode */) { + absl::base_internal::ErrnoSaver errno_saver; + if (loop == 0) { + } else if (loop == 1) { + sched_yield(); + } else { + struct timespec tm; + tm.tv_sec = 0; + tm.tv_nsec = absl::base_internal::SpinLockSuggestedDelayNS(loop); + nanosleep(&tm, nullptr); + } +} + +ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockWake( + std::atomic* /* lock_word */, bool /* all */) {} + +} // extern "C" diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.cc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.cc new file mode 100644 index 0000000..fa824be --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.cc @@ -0,0 +1,81 @@ +// 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. + +// The OS-specific header included below must provide two calls: +// AbslInternalSpinLockDelay() and AbslInternalSpinLockWake(). +// See spinlock_wait.h for the specs. + +#include +#include + +#include "absl/base/internal/spinlock_wait.h" + +#if defined(_WIN32) +#include "absl/base/internal/spinlock_win32.inc" +#elif defined(__linux__) +#include "absl/base/internal/spinlock_linux.inc" +#elif defined(__akaros__) +#include "absl/base/internal/spinlock_akaros.inc" +#else +#include "absl/base/internal/spinlock_posix.inc" +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// See spinlock_wait.h for spec. +uint32_t SpinLockWait(std::atomic *w, int n, + const SpinLockWaitTransition trans[], + base_internal::SchedulingMode scheduling_mode) { + int loop = 0; + for (;;) { + uint32_t v = w->load(std::memory_order_acquire); + int i; + for (i = 0; i != n && v != trans[i].from; i++) { + } + if (i == n) { + SpinLockDelay(w, v, ++loop, scheduling_mode); // no matching transition + } else if (trans[i].to == v || // null transition + w->compare_exchange_strong(v, trans[i].to, + std::memory_order_acquire, + std::memory_order_relaxed)) { + if (trans[i].done) return v; + } + } +} + +static std::atomic delay_rand; + +// Return a suggested delay in nanoseconds for iteration number "loop" +int SpinLockSuggestedDelayNS(int loop) { + // Weak pseudo-random number generator to get some spread between threads + // when many are spinning. + uint64_t r = delay_rand.load(std::memory_order_relaxed); + r = 0x5deece66dLL * r + 0xb; // numbers from nrand48() + delay_rand.store(r, std::memory_order_relaxed); + + if (loop < 0 || loop > 32) { // limit loop to 0..32 + loop = 32; + } + const int kMinDelay = 128 << 10; // 128us + // Double delay every 8 iterations, up to 16x (2ms). + int delay = kMinDelay << (loop / 8); + // Randomize in delay..2*delay range, for resulting 128us..4ms range. + return delay | ((delay - 1) & static_cast(r)); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.h b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.h new file mode 100644 index 0000000..169bc74 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_wait.h @@ -0,0 +1,93 @@ +// 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_SPINLOCK_WAIT_H_ +#define ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ + +// Operations to make atomic transitions on a word, and to allow +// waiting for those transitions to become possible. + +#include +#include + +#include "absl/base/internal/scheduling_mode.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// SpinLockWait() waits until it can perform one of several transitions from +// "from" to "to". It returns when it performs a transition where done==true. +struct SpinLockWaitTransition { + uint32_t from; + uint32_t to; + bool done; +}; + +// Wait until *w can transition from trans[i].from to trans[i].to for some i +// satisfying 0<=i *w, int n, + const SpinLockWaitTransition trans[], + SchedulingMode scheduling_mode); + +// If possible, wake some thread that has called SpinLockDelay(w, ...). If +// "all" is true, wake all such threads. This call is a hint, and on some +// systems it may be a no-op; threads calling SpinLockDelay() will always wake +// eventually even if SpinLockWake() is never called. +void SpinLockWake(std::atomic *w, bool all); + +// Wait for an appropriate spin delay on iteration "loop" of a +// spin loop on location *w, whose previously observed value was "value". +// SpinLockDelay() may do nothing, may yield the CPU, may sleep a clock tick, +// or may wait for a delay that can be truncated by a call to SpinLockWake(w). +// In all cases, it must return in bounded time even if SpinLockWake() is not +// called. +void SpinLockDelay(std::atomic *w, uint32_t value, int loop, + base_internal::SchedulingMode scheduling_mode); + +// Helper used by AbslInternalSpinLockDelay. +// Returns a suggested delay in nanoseconds for iteration number "loop". +int SpinLockSuggestedDelayNS(int loop); + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +// In some build configurations we pass --detect-odr-violations to the +// gold linker. This causes it to flag weak symbol overrides as ODR +// violations. Because ODR only applies to C++ and not C, +// --detect-odr-violations ignores symbols not mangled with C++ names. +// By changing our extension points to be extern "C", we dodge this +// check. +extern "C" { +void AbslInternalSpinLockWake(std::atomic *w, bool all); +void AbslInternalSpinLockDelay( + std::atomic *w, uint32_t value, int loop, + absl::base_internal::SchedulingMode scheduling_mode); +} + +inline void absl::base_internal::SpinLockWake(std::atomic *w, + bool all) { + AbslInternalSpinLockWake(w, all); +} + +inline void absl::base_internal::SpinLockDelay( + std::atomic *w, uint32_t value, int loop, + absl::base_internal::SchedulingMode scheduling_mode) { + AbslInternalSpinLockDelay(w, value, loop, scheduling_mode); +} + +#endif // ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/spinlock_win32.inc b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_win32.inc new file mode 100644 index 0000000..78654b5 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/spinlock_win32.inc @@ -0,0 +1,37 @@ +// 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 file is a Win32-specific part of spinlock_wait.cc + +#include +#include +#include "absl/base/internal/scheduling_mode.h" + +extern "C" { + +void AbslInternalSpinLockDelay(std::atomic* /* lock_word */, + uint32_t /* value */, int loop, + absl::base_internal::SchedulingMode /* mode */) { + if (loop == 0) { + } else if (loop == 1) { + Sleep(0); + } else { + Sleep(absl::base_internal::SpinLockSuggestedDelayNS(loop) / 1000000); + } +} + +void AbslInternalSpinLockWake(std::atomic* /* lock_word */, + bool /* all */) {} + +} // extern "C" diff --git a/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.cc b/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.cc new file mode 100644 index 0000000..a0930e9 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.cc @@ -0,0 +1,416 @@ +// 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" + +#include "absl/base/attributes.h" + +#ifdef _WIN32 +#include +#else +#include +#include +#include +#include +#include +#endif + +#ifdef __linux__ +#include +#endif + +#if defined(__APPLE__) || defined(__FreeBSD__) +#include +#endif + +#if defined(__myriad2__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // NOLINT(build/c++11) +#include +#include + +#include "absl/base/call_once.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/spinlock.h" +#include "absl/base/internal/unscaledcycleclock.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +static int GetNumCPUs() { +#if defined(__myriad2__) + return 1; +#else + // Other possibilities: + // - Read /sys/devices/system/cpu/online and use cpumask_parse() + // - sysconf(_SC_NPROCESSORS_ONLN) + return std::thread::hardware_concurrency(); +#endif +} + +#if defined(_WIN32) + +static double GetNominalCPUFrequency() { +#pragma comment(lib, "advapi32.lib") // For Reg* functions. + HKEY key; + // Use the Reg* functions rather than the SH functions because shlwapi.dll + // pulls in gdi32.dll which makes process destruction much more costly. + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, + "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, + KEY_READ, &key) == ERROR_SUCCESS) { + DWORD type = 0; + DWORD data = 0; + DWORD data_size = sizeof(data); + auto result = RegQueryValueExA(key, "~MHz", 0, &type, + reinterpret_cast(&data), &data_size); + RegCloseKey(key); + if (result == ERROR_SUCCESS && type == REG_DWORD && + data_size == sizeof(data)) { + return data * 1e6; // Value is MHz. + } + } + return 1.0; +} + +#elif defined(CTL_HW) && defined(HW_CPU_FREQ) + +static double GetNominalCPUFrequency() { + unsigned freq; + size_t size = sizeof(freq); + int mib[2] = {CTL_HW, HW_CPU_FREQ}; + if (sysctl(mib, 2, &freq, &size, nullptr, 0) == 0) { + return static_cast(freq); + } + return 1.0; +} + +#else + +// Helper function for reading a long from a file. Returns true if successful +// and the memory location pointed to by value is set to the value read. +static bool ReadLongFromFile(const char *file, long *value) { + bool ret = false; + int fd = open(file, O_RDONLY); + if (fd != -1) { + char line[1024]; + char *err; + memset(line, '\0', sizeof(line)); + int len = read(fd, line, sizeof(line) - 1); + if (len <= 0) { + ret = false; + } else { + const long temp_value = strtol(line, &err, 10); + if (line[0] != '\0' && (*err == '\n' || *err == '\0')) { + *value = temp_value; + ret = true; + } + } + close(fd); + } + return ret; +} + +#if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) + +// Reads a monotonic time source and returns a value in +// nanoseconds. The returned value uses an arbitrary epoch, not the +// Unix epoch. +static int64_t ReadMonotonicClockNanos() { + struct timespec t; +#ifdef CLOCK_MONOTONIC_RAW + int rc = clock_gettime(CLOCK_MONOTONIC_RAW, &t); +#else + int rc = clock_gettime(CLOCK_MONOTONIC, &t); +#endif + if (rc != 0) { + perror("clock_gettime() failed"); + abort(); + } + return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec; +} + +class UnscaledCycleClockWrapperForInitializeFrequency { + public: + static int64_t Now() { return base_internal::UnscaledCycleClock::Now(); } +}; + +struct TimeTscPair { + int64_t time; // From ReadMonotonicClockNanos(). + int64_t tsc; // From UnscaledCycleClock::Now(). +}; + +// Returns a pair of values (monotonic kernel time, TSC ticks) that +// approximately correspond to each other. This is accomplished by +// doing several reads and picking the reading with the lowest +// latency. This approach is used to minimize the probability that +// our thread was preempted between clock reads. +static TimeTscPair GetTimeTscPair() { + int64_t best_latency = std::numeric_limits::max(); + TimeTscPair best; + for (int i = 0; i < 10; ++i) { + int64_t t0 = ReadMonotonicClockNanos(); + int64_t tsc = UnscaledCycleClockWrapperForInitializeFrequency::Now(); + int64_t t1 = ReadMonotonicClockNanos(); + int64_t latency = t1 - t0; + if (latency < best_latency) { + best_latency = latency; + best.time = t0; + best.tsc = tsc; + } + } + return best; +} + +// Measures and returns the TSC frequency by taking a pair of +// measurements approximately `sleep_nanoseconds` apart. +static double MeasureTscFrequencyWithSleep(int sleep_nanoseconds) { + auto t0 = GetTimeTscPair(); + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = sleep_nanoseconds; + while (nanosleep(&ts, &ts) != 0 && errno == EINTR) {} + auto t1 = GetTimeTscPair(); + double elapsed_ticks = t1.tsc - t0.tsc; + double elapsed_time = (t1.time - t0.time) * 1e-9; + return elapsed_ticks / elapsed_time; +} + +// Measures and returns the TSC frequency by calling +// MeasureTscFrequencyWithSleep(), doubling the sleep interval until the +// frequency measurement stabilizes. +static double MeasureTscFrequency() { + double last_measurement = -1.0; + int sleep_nanoseconds = 1000000; // 1 millisecond. + for (int i = 0; i < 8; ++i) { + double measurement = MeasureTscFrequencyWithSleep(sleep_nanoseconds); + if (measurement * 0.99 < last_measurement && + last_measurement < measurement * 1.01) { + // Use the current measurement if it is within 1% of the + // previous measurement. + return measurement; + } + last_measurement = measurement; + sleep_nanoseconds *= 2; + } + return last_measurement; +} + +#endif // ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY + +static double GetNominalCPUFrequency() { + long freq = 0; + + // Google's production kernel has a patch to export the TSC + // frequency through sysfs. If the kernel is exporting the TSC + // frequency use that. There are issues where cpuinfo_max_freq + // cannot be relied on because the BIOS may be exporting an invalid + // p-state (on x86) or p-states may be used to put the processor in + // a new mode (turbo mode). Essentially, those frequencies cannot + // always be relied upon. The same reasons apply to /proc/cpuinfo as + // well. + if (ReadLongFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) { + return freq * 1e3; // Value is kHz. + } + +#if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) + // On these platforms, the TSC frequency is the nominal CPU + // frequency. But without having the kernel export it directly + // though /sys/devices/system/cpu/cpu0/tsc_freq_khz, there is no + // other way to reliably get the TSC frequency, so we have to + // measure it ourselves. Some CPUs abuse cpuinfo_max_freq by + // exporting "fake" frequencies for implementing new features. For + // example, Intel's turbo mode is enabled by exposing a p-state + // value with a higher frequency than that of the real TSC + // rate. Because of this, we prefer to measure the TSC rate + // ourselves on i386 and x86-64. + return MeasureTscFrequency(); +#else + + // If CPU scaling is in effect, we want to use the *maximum* + // frequency, not whatever CPU speed some random processor happens + // to be using now. + if (ReadLongFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", + &freq)) { + return freq * 1e3; // Value is kHz. + } + + return 1.0; +#endif // !ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +} + +#endif + +ABSL_CONST_INIT static once_flag init_num_cpus_once; +ABSL_CONST_INIT static int num_cpus = 0; + +// NumCPUs() may be called before main() and before malloc is properly +// initialized, therefore this must not allocate memory. +int NumCPUs() { + base_internal::LowLevelCallOnce( + &init_num_cpus_once, []() { num_cpus = GetNumCPUs(); }); + return num_cpus; +} + +// A default frequency of 0.0 might be dangerous if it is used in division. +ABSL_CONST_INIT static once_flag init_nominal_cpu_frequency_once; +ABSL_CONST_INIT static double nominal_cpu_frequency = 1.0; + +// NominalCPUFrequency() may be called before main() and before malloc is +// properly initialized, therefore this must not allocate memory. +double NominalCPUFrequency() { + base_internal::LowLevelCallOnce( + &init_nominal_cpu_frequency_once, + []() { nominal_cpu_frequency = GetNominalCPUFrequency(); }); + return nominal_cpu_frequency; +} + +#if defined(_WIN32) + +pid_t GetTID() { + return pid_t{GetCurrentThreadId()}; +} + +#elif defined(__linux__) + +#ifndef SYS_gettid +#define SYS_gettid __NR_gettid +#endif + +pid_t GetTID() { + return syscall(SYS_gettid); +} + +#elif defined(__akaros__) + +pid_t GetTID() { + // Akaros has a concept of "vcore context", which is the state the program + // is forced into when we need to make a user-level scheduling decision, or + // run a signal handler. This is analogous to the interrupt context that a + // CPU might enter if it encounters some kind of exception. + // + // There is no current thread context in vcore context, but we need to give + // a reasonable answer if asked for a thread ID (e.g., in a signal handler). + // Thread 0 always exists, so if we are in vcore context, we return that. + // + // Otherwise, we know (since we are using pthreads) that the uthread struct + // current_uthread is pointing to is the first element of a + // struct pthread_tcb, so we extract and return the thread ID from that. + // + // TODO(dcross): Akaros anticipates moving the thread ID to the uthread + // structure at some point. We should modify this code to remove the cast + // when that happens. + if (in_vcore_context()) + return 0; + return reinterpret_cast(current_uthread)->id; +} + +#elif defined(__myriad2__) + +pid_t GetTID() { + uint32_t tid; + rtems_task_ident(RTEMS_SELF, 0, &tid); + return tid; +} + +#else + +// Fallback implementation of GetTID using pthread_getspecific. +static once_flag tid_once; +static pthread_key_t tid_key; +static absl::base_internal::SpinLock tid_lock( + absl::base_internal::kLinkerInitialized); + +// We set a bit per thread in this array to indicate that an ID is in +// use. ID 0 is unused because it is the default value returned by +// pthread_getspecific(). +static std::vector* tid_array GUARDED_BY(tid_lock) = nullptr; +static constexpr int kBitsPerWord = 32; // tid_array is uint32_t. + +// Returns the TID to tid_array. +static void FreeTID(void *v) { + intptr_t tid = reinterpret_cast(v); + int word = tid / kBitsPerWord; + uint32_t mask = ~(1u << (tid % kBitsPerWord)); + absl::base_internal::SpinLockHolder lock(&tid_lock); + assert(0 <= word && static_cast(word) < tid_array->size()); + (*tid_array)[word] &= mask; +} + +static void InitGetTID() { + if (pthread_key_create(&tid_key, FreeTID) != 0) { + // The logging system calls GetTID() so it can't be used here. + perror("pthread_key_create failed"); + abort(); + } + + // Initialize tid_array. + absl::base_internal::SpinLockHolder lock(&tid_lock); + tid_array = new std::vector(1); + (*tid_array)[0] = 1; // ID 0 is never-allocated. +} + +// Return a per-thread small integer ID from pthread's thread-specific data. +pid_t GetTID() { + absl::call_once(tid_once, InitGetTID); + + intptr_t tid = reinterpret_cast(pthread_getspecific(tid_key)); + if (tid != 0) { + return tid; + } + + int bit; // tid_array[word] = 1u << bit; + size_t word; + { + // Search for the first unused ID. + absl::base_internal::SpinLockHolder lock(&tid_lock); + // First search for a word in the array that is not all ones. + word = 0; + while (word < tid_array->size() && ~(*tid_array)[word] == 0) { + ++word; + } + if (word == tid_array->size()) { + tid_array->push_back(0); // No space left, add kBitsPerWord more IDs. + } + // Search for a zero bit in the word. + bit = 0; + while (bit < kBitsPerWord && (((*tid_array)[word] >> bit) & 1) != 0) { + ++bit; + } + tid = (word * kBitsPerWord) + bit; + (*tid_array)[word] |= 1u << bit; // Mark the TID as allocated. + } + + if (pthread_setspecific(tid_key, reinterpret_cast(tid)) != 0) { + perror("pthread_setspecific failed"); + abort(); + } + + return static_cast(tid); +} + +#endif + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.h b/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.h new file mode 100644 index 0000000..7246d5d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/sysinfo.h @@ -0,0 +1,66 @@ +// 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 file includes routines to find out characteristics +// of the machine a program is running on. It is undoubtedly +// system-dependent. + +// Functions listed here that accept a pid_t as an argument act on the +// current process if the pid_t argument is 0 +// All functions here are thread-hostile due to file caching unless +// commented otherwise. + +#ifndef ABSL_BASE_INTERNAL_SYSINFO_H_ +#define ABSL_BASE_INTERNAL_SYSINFO_H_ + +#ifndef _WIN32 +#include +#endif + +#include + +#include "absl/base/port.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Nominal core processor cycles per second of each processor. This is _not_ +// necessarily the frequency of the CycleClock counter (see cycleclock.h) +// Thread-safe. +double NominalCPUFrequency(); + +// Number of logical processors (hyperthreads) in system. Thread-safe. +int NumCPUs(); + +// Return the thread id of the current thread, as told by the system. +// No two currently-live threads implemented by the OS shall have the same ID. +// Thread ids of exited threads may be reused. Multiple user-level threads +// may have the same thread ID if multiplexed on the same OS thread. +// +// On Linux, you may send a signal to the resulting ID with kill(). However, +// it is recommended for portability that you use pthread_kill() instead. +#ifdef _WIN32 +// On Windows, process id and thread id are of the same type according to the +// return types of GetProcessId() and GetThreadId() are both DWORD, an unsigned +// 32-bit type. +using pid_t = uint32_t; +#endif +pid_t GetTID(); + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_SYSINFO_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/thread_annotations.h b/SaraAttended/Pods/abseil/absl/base/internal/thread_annotations.h new file mode 100644 index 0000000..4dab6a9 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/thread_annotations.h @@ -0,0 +1,271 @@ +// 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: thread_annotations.h +// ----------------------------------------------------------------------------- +// +// WARNING: This is a backwards compatible header and it will be removed after +// the migration to prefixed thread annotations is finished; please include +// "absl/base/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_INTERNAL_THREAD_ANNOTATIONS_H_ +#define ABSL_BASE_INTERNAL_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_INTERNAL_THREAD_ANNOTATIONS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.cc b/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.cc new file mode 100644 index 0000000..d63a04a --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.cc @@ -0,0 +1,152 @@ +// 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" + +#ifndef _WIN32 +#include +#include +#endif + +#include +#include +#include + +#include "absl/base/call_once.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/spinlock.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +#if ABSL_THREAD_IDENTITY_MODE != ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +namespace { +// Used to co-ordinate one-time creation of our pthread_key +absl::once_flag init_thread_identity_key_once; +pthread_key_t thread_identity_pthread_key; +std::atomic pthread_key_initialized(false); + +void AllocateThreadIdentityKey(ThreadIdentityReclaimerFunction reclaimer) { + pthread_key_create(&thread_identity_pthread_key, reclaimer); + pthread_key_initialized.store(true, std::memory_order_release); +} +} // namespace +#endif + +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +// The actual TLS storage for a thread's currently associated ThreadIdentity. +// This is referenced by inline accessors in the header. +// "protected" visibility ensures that if multiple instances of Abseil code +// exist within a process (via dlopen() or similar), references to +// thread_identity_ptr from each instance of the code will refer to +// *different* instances of this ptr. +#ifdef __GNUC__ +__attribute__((visibility("protected"))) +#endif // __GNUC__ +#if ABSL_PER_THREAD_TLS +// Prefer __thread to thread_local as benchmarks indicate it is a bit faster. +ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* thread_identity_ptr = nullptr; +#elif defined(ABSL_HAVE_THREAD_LOCAL) +thread_local ThreadIdentity* thread_identity_ptr = nullptr; +#endif // ABSL_PER_THREAD_TLS +#endif // TLS or CPP11 + +void SetCurrentThreadIdentity( + ThreadIdentity* identity, ThreadIdentityReclaimerFunction reclaimer) { + assert(CurrentThreadIdentityIfPresent() == nullptr); + // Associate our destructor. + // NOTE: This call to pthread_setspecific is currently the only immovable + // barrier to CurrentThreadIdentity() always being async signal safe. +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC + // NOTE: Not async-safe. But can be open-coded. + absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey, + reclaimer); + +#if defined(__EMSCRIPTEN__) || defined(__MINGW32__) + // Emscripten and MinGW pthread implementations does not support signals. + // See https://kripken.github.io/emscripten-site/docs/porting/pthreads.html + // for more information. + pthread_setspecific(thread_identity_pthread_key, + reinterpret_cast(identity)); +#else + // We must mask signals around the call to setspecific as with current glibc, + // a concurrent getspecific (needed for GetCurrentThreadIdentityIfPresent()) + // may zero our value. + // + // While not officially async-signal safe, getspecific within a signal handler + // is otherwise OK. + sigset_t all_signals; + sigset_t curr_signals; + sigfillset(&all_signals); + pthread_sigmask(SIG_SETMASK, &all_signals, &curr_signals); + pthread_setspecific(thread_identity_pthread_key, + reinterpret_cast(identity)); + pthread_sigmask(SIG_SETMASK, &curr_signals, nullptr); +#endif // !__EMSCRIPTEN__ && !__MINGW32__ + +#elif ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS + // NOTE: Not async-safe. But can be open-coded. + absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey, + reclaimer); + pthread_setspecific(thread_identity_pthread_key, + reinterpret_cast(identity)); + thread_identity_ptr = identity; +#elif ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 + thread_local std::unique_ptr + holder(identity, reclaimer); + thread_identity_ptr = identity; +#else +#error Unimplemented ABSL_THREAD_IDENTITY_MODE +#endif +} + +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 + +// Please see the comment on `CurrentThreadIdentityIfPresent` in +// thread_identity.h. Because DLLs cannot expose thread_local variables in +// headers, we opt for the correct-but-slower option of placing the definition +// of this function only in a translation unit inside DLL. +#if defined(ABSL_BUILD_DLL) || defined(ABSL_CONSUME_DLL) +ThreadIdentity* CurrentThreadIdentityIfPresent() { return thread_identity_ptr; } +#endif +#endif + +void ClearCurrentThreadIdentity() { +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 + thread_identity_ptr = nullptr; +#elif ABSL_THREAD_IDENTITY_MODE == \ + ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC + // pthread_setspecific expected to clear value on destruction + assert(CurrentThreadIdentityIfPresent() == nullptr); +#endif +} + +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +ThreadIdentity* CurrentThreadIdentityIfPresent() { + bool initialized = pthread_key_initialized.load(std::memory_order_acquire); + if (!initialized) { + return nullptr; + } + return reinterpret_cast( + pthread_getspecific(thread_identity_pthread_key)); +} +#endif + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.h b/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.h new file mode 100644 index 0000000..ceb109b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/thread_identity.h @@ -0,0 +1,259 @@ +// 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. +// +// Each active thread has an ThreadIdentity that may represent the thread in +// various level interfaces. ThreadIdentity objects are never deallocated. +// When a thread terminates, its ThreadIdentity object may be reused for a +// thread created later. + +#ifndef ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ +#define ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ + +#ifndef _WIN32 +#include +// Defines __GOOGLE_GRTE_VERSION__ (via glibc-specific features.h) when +// supported. +#include +#endif + +#include +#include + +#include "absl/base/config.h" +#include "absl/base/internal/per_thread_tls.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +struct SynchLocksHeld; +struct SynchWaitParams; + +namespace base_internal { + +class SpinLock; +struct ThreadIdentity; + +// Used by the implementation of absl::Mutex and absl::CondVar. +struct PerThreadSynch { + // The internal representation of absl::Mutex and absl::CondVar rely + // on the alignment of PerThreadSynch. Both store the address of the + // PerThreadSynch in the high-order bits of their internal state, + // which means the low kLowZeroBits of the address of PerThreadSynch + // must be zero. + static constexpr int kLowZeroBits = 8; + static constexpr int kAlignment = 1 << kLowZeroBits; + + // Returns the associated ThreadIdentity. + // This can be implemented as a cast because we guarantee + // PerThreadSynch is the first element of ThreadIdentity. + ThreadIdentity* thread_identity() { + return reinterpret_cast(this); + } + + PerThreadSynch *next; // Circular waiter queue; initialized to 0. + PerThreadSynch *skip; // If non-zero, all entries in Mutex queue + // up to and including "skip" have same + // condition as this, and will be woken later + bool may_skip; // if false while on mutex queue, a mutex unlocker + // is using this PerThreadSynch as a terminator. Its + // skip field must not be filled in because the loop + // might then skip over the terminator. + + // The wait parameters of the current wait. waitp is null if the + // thread is not waiting. Transitions from null to non-null must + // occur before the enqueue commit point (state = kQueued in + // Enqueue() and CondVarEnqueue()). Transitions from non-null to + // null must occur after the wait is finished (state = kAvailable in + // Mutex::Block() and CondVar::WaitCommon()). This field may be + // changed only by the thread that describes this PerThreadSynch. A + // special case is Fer(), which calls Enqueue() on another thread, + // but with an identical SynchWaitParams pointer, thus leaving the + // pointer unchanged. + SynchWaitParams *waitp; + + bool suppress_fatal_errors; // If true, try to proceed even in the face of + // broken invariants. This is used within fatal + // signal handlers to improve the chances of + // debug logging information being output + // successfully. + + intptr_t readers; // Number of readers in mutex. + int priority; // Priority of thread (updated every so often). + + // When priority will next be read (cycles). + int64_t next_priority_read_cycles; + + // State values: + // kAvailable: This PerThreadSynch is available. + // kQueued: This PerThreadSynch is unavailable, it's currently queued on a + // Mutex or CondVar waistlist. + // + // Transitions from kQueued to kAvailable require a release + // barrier. This is needed as a waiter may use "state" to + // independently observe that it's no longer queued. + // + // Transitions from kAvailable to kQueued require no barrier, they + // are externally ordered by the Mutex. + enum State { + kAvailable, + kQueued + }; + std::atomic state; + + bool maybe_unlocking; // Valid at head of Mutex waiter queue; + // true if UnlockSlow could be searching + // for a waiter to wake. Used for an optimization + // in Enqueue(). true is always a valid value. + // Can be reset to false when the unlocker or any + // writer releases the lock, or a reader fully releases + // the lock. It may not be set to false by a reader + // that decrements the count to non-zero. + // protected by mutex spinlock + + bool wake; // This thread is to be woken from a Mutex. + + // If "x" is on a waiter list for a mutex, "x->cond_waiter" is true iff the + // waiter is waiting on the mutex as part of a CV Wait or Mutex Await. + // + // The value of "x->cond_waiter" is meaningless if "x" is not on a + // Mutex waiter list. + bool cond_waiter; + + // Locks held; used during deadlock detection. + // Allocated in Synch_GetAllLocks() and freed in ReclaimThreadIdentity(). + SynchLocksHeld *all_locks; +}; + +struct ThreadIdentity { + // Must be the first member. The Mutex implementation requires that + // the PerThreadSynch object associated with each thread is + // PerThreadSynch::kAlignment aligned. We provide this alignment on + // ThreadIdentity itself. + PerThreadSynch per_thread_synch; + + // Private: Reserved for absl::synchronization_internal::Waiter. + struct WaiterState { + char data[128]; + } waiter_state; + + // Used by PerThreadSem::{Get,Set}ThreadBlockedCounter(). + std::atomic* blocked_count_ptr; + + // The following variables are mostly read/written just by the + // thread itself. The only exception is that these are read by + // a ticker thread as a hint. + std::atomic ticker; // Tick counter, incremented once per second. + std::atomic wait_start; // Ticker value when thread started waiting. + std::atomic is_idle; // Has thread become idle yet? + + ThreadIdentity* next; +}; + +// Returns the ThreadIdentity object representing the calling thread; guaranteed +// to be unique for its lifetime. The returned object will remain valid for the +// program's lifetime; although it may be re-assigned to a subsequent thread. +// If one does not exist, return nullptr instead. +// +// Does not malloc(*), and is async-signal safe. +// [*] Technically pthread_setspecific() does malloc on first use; however this +// is handled internally within tcmalloc's initialization already. +// +// New ThreadIdentity objects can be constructed and associated with a thread +// by calling GetOrCreateCurrentThreadIdentity() in per-thread-sem.h. +ThreadIdentity* CurrentThreadIdentityIfPresent(); + +using ThreadIdentityReclaimerFunction = void (*)(void*); + +// Sets the current thread identity to the given value. 'reclaimer' is a +// pointer to the global function for cleaning up instances on thread +// destruction. +void SetCurrentThreadIdentity(ThreadIdentity* identity, + ThreadIdentityReclaimerFunction reclaimer); + +// Removes the currently associated ThreadIdentity from the running thread. +// This must be called from inside the ThreadIdentityReclaimerFunction, and only +// from that function. +void ClearCurrentThreadIdentity(); + +// May be chosen at compile time via: -DABSL_FORCE_THREAD_IDENTITY_MODE= +#ifdef ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#error ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be direcly set +#else +#define ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 0 +#endif + +#ifdef ABSL_THREAD_IDENTITY_MODE_USE_TLS +#error ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be direcly set +#else +#define ABSL_THREAD_IDENTITY_MODE_USE_TLS 1 +#endif + +#ifdef ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#error ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be direcly set +#else +#define ABSL_THREAD_IDENTITY_MODE_USE_CPP11 2 +#endif + +#ifdef ABSL_THREAD_IDENTITY_MODE +#error ABSL_THREAD_IDENTITY_MODE cannot be direcly set +#elif defined(ABSL_FORCE_THREAD_IDENTITY_MODE) +#define ABSL_THREAD_IDENTITY_MODE ABSL_FORCE_THREAD_IDENTITY_MODE +#elif defined(_WIN32) && !defined(__MINGW32__) +#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \ + (__GOOGLE_GRTE_VERSION__ >= 20140228L) +// Support for async-safe TLS was specifically added in GRTEv4. It's not +// present in the upstream eglibc. +// Note: Current default for production systems. +#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_TLS +#else +#define ABSL_THREAD_IDENTITY_MODE \ + ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#endif + +#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 + +#if ABSL_PER_THREAD_TLS +ABSL_CONST_INIT extern ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* + thread_identity_ptr; +#elif defined(ABSL_HAVE_THREAD_LOCAL) +ABSL_CONST_INIT extern thread_local ThreadIdentity* thread_identity_ptr; +#else +#error Thread-local storage not detected on this platform +#endif + +// thread_local variables cannot be in headers exposed by DLLs. However, it is +// important for performance reasons in general that +// `CurrentThreadIdentityIfPresent` be inlined. This is not possible across a +// DLL boundary so, with DLLs, we opt to have the function not be inlined. Note +// that `CurrentThreadIdentityIfPresent` is declared above so we can exclude +// this entire inline definition when compiling as a DLL. +#if !defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL) +inline ThreadIdentity* CurrentThreadIdentityIfPresent() { + return thread_identity_ptr; +} +#endif + +#elif ABSL_THREAD_IDENTITY_MODE != \ + ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#error Unknown ABSL_THREAD_IDENTITY_MODE +#endif + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.cc b/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.cc new file mode 100644 index 0000000..c055f75 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.cc @@ -0,0 +1,108 @@ +// 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 +#include "absl/base/config.h" +#include "absl/base/internal/raw_logging.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +namespace { +template +[[noreturn]] void Throw(const T& error) { +#ifdef ABSL_HAVE_EXCEPTIONS + throw error; +#else + ABSL_RAW_LOG(FATAL, "%s", error.what()); + std::abort(); +#endif +} +} // namespace + +void ThrowStdLogicError(const std::string& what_arg) { + Throw(std::logic_error(what_arg)); +} +void ThrowStdLogicError(const char* what_arg) { + Throw(std::logic_error(what_arg)); +} +void ThrowStdInvalidArgument(const std::string& what_arg) { + Throw(std::invalid_argument(what_arg)); +} +void ThrowStdInvalidArgument(const char* what_arg) { + Throw(std::invalid_argument(what_arg)); +} + +void ThrowStdDomainError(const std::string& what_arg) { + Throw(std::domain_error(what_arg)); +} +void ThrowStdDomainError(const char* what_arg) { + Throw(std::domain_error(what_arg)); +} + +void ThrowStdLengthError(const std::string& what_arg) { + Throw(std::length_error(what_arg)); +} +void ThrowStdLengthError(const char* what_arg) { + Throw(std::length_error(what_arg)); +} + +void ThrowStdOutOfRange(const std::string& what_arg) { + Throw(std::out_of_range(what_arg)); +} +void ThrowStdOutOfRange(const char* what_arg) { + Throw(std::out_of_range(what_arg)); +} + +void ThrowStdRuntimeError(const std::string& what_arg) { + Throw(std::runtime_error(what_arg)); +} +void ThrowStdRuntimeError(const char* what_arg) { + Throw(std::runtime_error(what_arg)); +} + +void ThrowStdRangeError(const std::string& what_arg) { + Throw(std::range_error(what_arg)); +} +void ThrowStdRangeError(const char* what_arg) { + Throw(std::range_error(what_arg)); +} + +void ThrowStdOverflowError(const std::string& what_arg) { + Throw(std::overflow_error(what_arg)); +} +void ThrowStdOverflowError(const char* what_arg) { + Throw(std::overflow_error(what_arg)); +} + +void ThrowStdUnderflowError(const std::string& what_arg) { + Throw(std::underflow_error(what_arg)); +} +void ThrowStdUnderflowError(const char* what_arg) { + Throw(std::underflow_error(what_arg)); +} + +void ThrowStdBadFunctionCall() { Throw(std::bad_function_call()); } + +void ThrowStdBadAlloc() { Throw(std::bad_alloc()); } + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.h b/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.h new file mode 100644 index 0000000..075f527 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/throw_delegate.h @@ -0,0 +1,75 @@ +// +// 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_THROW_DELEGATE_H_ +#define ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ + +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Helper functions that allow throwing exceptions consistently from anywhere. +// The main use case is for header-based libraries (eg templates), as they will +// be built by many different targets with their own compiler options. +// In particular, this will allow a safe way to throw exceptions even if the +// caller is compiled with -fno-exceptions. This is intended for implementing +// things like map<>::at(), which the standard documents as throwing an +// exception on error. +// +// Using other techniques like #if tricks could lead to ODR violations. +// +// You shouldn't use it unless you're writing code that you know will be built +// both with and without exceptions and you need to conform to an interface +// that uses exceptions. + +[[noreturn]] void ThrowStdLogicError(const std::string& what_arg); +[[noreturn]] void ThrowStdLogicError(const char* what_arg); +[[noreturn]] void ThrowStdInvalidArgument(const std::string& what_arg); +[[noreturn]] void ThrowStdInvalidArgument(const char* what_arg); +[[noreturn]] void ThrowStdDomainError(const std::string& what_arg); +[[noreturn]] void ThrowStdDomainError(const char* what_arg); +[[noreturn]] void ThrowStdLengthError(const std::string& what_arg); +[[noreturn]] void ThrowStdLengthError(const char* what_arg); +[[noreturn]] void ThrowStdOutOfRange(const std::string& what_arg); +[[noreturn]] void ThrowStdOutOfRange(const char* what_arg); +[[noreturn]] void ThrowStdRuntimeError(const std::string& what_arg); +[[noreturn]] void ThrowStdRuntimeError(const char* what_arg); +[[noreturn]] void ThrowStdRangeError(const std::string& what_arg); +[[noreturn]] void ThrowStdRangeError(const char* what_arg); +[[noreturn]] void ThrowStdOverflowError(const std::string& what_arg); +[[noreturn]] void ThrowStdOverflowError(const char* what_arg); +[[noreturn]] void ThrowStdUnderflowError(const std::string& what_arg); +[[noreturn]] void ThrowStdUnderflowError(const char* what_arg); + +[[noreturn]] void ThrowStdBadFunctionCall(); +[[noreturn]] void ThrowStdBadAlloc(); + +// ThrowStdBadArrayNewLength() cannot be consistently supported because +// std::bad_array_new_length is missing in libstdc++ until 4.9.0. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.3/libstdc++/api/a01379_source.html +// https://gcc.gnu.org/onlinedocs/gcc-4.9.0/libstdc++/api/a01327_source.html +// libcxx (as of 3.2) and msvc (as of 2015) both have it. +// [[noreturn]] void ThrowStdBadArrayNewLength(); + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/tsan_mutex_interface.h b/SaraAttended/Pods/abseil/absl/base/internal/tsan_mutex_interface.h new file mode 100644 index 0000000..2a51060 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/tsan_mutex_interface.h @@ -0,0 +1,66 @@ +// 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 file is intended solely for spinlock.h. +// It provides ThreadSanitizer annotations for custom mutexes. +// See for meaning of these annotations. + +#ifndef ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ +#define ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ + +// ABSL_INTERNAL_HAVE_TSAN_INTERFACE +// Macro intended only for internal use. +// +// Checks whether LLVM Thread Sanitizer interfaces are available. +// First made available in LLVM 5.0 (Sep 2017). +#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE +#error "ABSL_INTERNAL_HAVE_TSAN_INTERFACE cannot be directly set." +#endif + +#if defined(THREAD_SANITIZER) && defined(__has_include) +#if __has_include() +#define ABSL_INTERNAL_HAVE_TSAN_INTERFACE 1 +#endif +#endif + +#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE +#include + +#define ABSL_TSAN_MUTEX_CREATE __tsan_mutex_create +#define ABSL_TSAN_MUTEX_DESTROY __tsan_mutex_destroy +#define ABSL_TSAN_MUTEX_PRE_LOCK __tsan_mutex_pre_lock +#define ABSL_TSAN_MUTEX_POST_LOCK __tsan_mutex_post_lock +#define ABSL_TSAN_MUTEX_PRE_UNLOCK __tsan_mutex_pre_unlock +#define ABSL_TSAN_MUTEX_POST_UNLOCK __tsan_mutex_post_unlock +#define ABSL_TSAN_MUTEX_PRE_SIGNAL __tsan_mutex_pre_signal +#define ABSL_TSAN_MUTEX_POST_SIGNAL __tsan_mutex_post_signal +#define ABSL_TSAN_MUTEX_PRE_DIVERT __tsan_mutex_pre_divert +#define ABSL_TSAN_MUTEX_POST_DIVERT __tsan_mutex_post_divert + +#else + +#define ABSL_TSAN_MUTEX_CREATE(...) +#define ABSL_TSAN_MUTEX_DESTROY(...) +#define ABSL_TSAN_MUTEX_PRE_LOCK(...) +#define ABSL_TSAN_MUTEX_POST_LOCK(...) +#define ABSL_TSAN_MUTEX_PRE_UNLOCK(...) +#define ABSL_TSAN_MUTEX_POST_UNLOCK(...) +#define ABSL_TSAN_MUTEX_PRE_SIGNAL(...) +#define ABSL_TSAN_MUTEX_POST_SIGNAL(...) +#define ABSL_TSAN_MUTEX_PRE_DIVERT(...) +#define ABSL_TSAN_MUTEX_POST_DIVERT(...) + +#endif + +#endif // ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/unaligned_access.h b/SaraAttended/Pods/abseil/absl/base/internal/unaligned_access.h new file mode 100644 index 0000000..6be56c8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/unaligned_access.h @@ -0,0 +1,158 @@ +// +// 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_UNALIGNED_ACCESS_H_ +#define ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ + +#include + +#include + +#include "absl/base/attributes.h" +#include "absl/base/config.h" + +// unaligned APIs + +// Portable handling of unaligned loads, stores, and copies. + +// The unaligned API is C++ only. The declarations use C++ features +// (namespaces, inline) which are absent or incompatible in C. +#if defined(__cplusplus) + +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||\ + defined(MEMORY_SANITIZER) +// Consider we have an unaligned load/store of 4 bytes from address 0x...05. +// AddressSanitizer will treat it as a 3-byte access to the range 05:07 and +// will miss a bug if 08 is the first unaddressable byte. +// ThreadSanitizer will also treat this as a 3-byte access to 05:07 and will +// miss a race between this access and some other accesses to 08. +// MemorySanitizer will correctly propagate the shadow on unaligned stores +// and correctly report bugs on unaligned loads, but it may not properly +// update and report the origin of the uninitialized memory. +// For all three tools, replacing an unaligned access with a tool-specific +// callback solves the problem. + +// Make sure uint16_t/uint32_t/uint64_t are defined. +#include + +extern "C" { +uint16_t __sanitizer_unaligned_load16(const void *p); +uint32_t __sanitizer_unaligned_load32(const void *p); +uint64_t __sanitizer_unaligned_load64(const void *p); +void __sanitizer_unaligned_store16(void *p, uint16_t v); +void __sanitizer_unaligned_store32(void *p, uint32_t v); +void __sanitizer_unaligned_store64(void *p, uint64_t v); +} // extern "C" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +inline uint16_t UnalignedLoad16(const void *p) { + return __sanitizer_unaligned_load16(p); +} + +inline uint32_t UnalignedLoad32(const void *p) { + return __sanitizer_unaligned_load32(p); +} + +inline uint64_t UnalignedLoad64(const void *p) { + return __sanitizer_unaligned_load64(p); +} + +inline void UnalignedStore16(void *p, uint16_t v) { + __sanitizer_unaligned_store16(p, v); +} + +inline void UnalignedStore32(void *p, uint32_t v) { + __sanitizer_unaligned_store32(p, v); +} + +inline void UnalignedStore64(void *p, uint64_t v) { + __sanitizer_unaligned_store64(p, v); +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#define ABSL_INTERNAL_UNALIGNED_LOAD16(_p) \ + (absl::base_internal::UnalignedLoad16(_p)) +#define ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \ + (absl::base_internal::UnalignedLoad32(_p)) +#define ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \ + (absl::base_internal::UnalignedLoad64(_p)) + +#define ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \ + (absl::base_internal::UnalignedStore16(_p, _val)) +#define ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \ + (absl::base_internal::UnalignedStore32(_p, _val)) +#define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \ + (absl::base_internal::UnalignedStore64(_p, _val)) + +#else + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +inline uint16_t UnalignedLoad16(const void *p) { + uint16_t t; + memcpy(&t, p, sizeof t); + return t; +} + +inline uint32_t UnalignedLoad32(const void *p) { + uint32_t t; + memcpy(&t, p, sizeof t); + return t; +} + +inline uint64_t UnalignedLoad64(const void *p) { + uint64_t t; + memcpy(&t, p, sizeof t); + return t; +} + +inline void UnalignedStore16(void *p, uint16_t v) { memcpy(p, &v, sizeof v); } + +inline void UnalignedStore32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); } + +inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); } + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#define ABSL_INTERNAL_UNALIGNED_LOAD16(_p) \ + (absl::base_internal::UnalignedLoad16(_p)) +#define ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \ + (absl::base_internal::UnalignedLoad32(_p)) +#define ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \ + (absl::base_internal::UnalignedLoad64(_p)) + +#define ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \ + (absl::base_internal::UnalignedStore16(_p, _val)) +#define ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \ + (absl::base_internal::UnalignedStore32(_p, _val)) +#define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \ + (absl::base_internal::UnalignedStore64(_p, _val)) + +#endif + +#endif // defined(__cplusplus), end of unaligned API + +#endif // ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.cc b/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.cc new file mode 100644 index 0000000..f1e7bbe --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.cc @@ -0,0 +1,140 @@ +// 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__) +#ifdef __GLIBC__ +#include +#elif defined(__FreeBSD__) +#include +#include +#endif +#endif + +#include "absl/base/internal/sysinfo.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +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() { +#ifdef __GLIBC__ + return __ppc_get_timebase(); +#else +#ifdef __powerpc64__ + int64_t tbr; + asm volatile("mfspr %0, 268" : "=r"(tbr)); + return tbr; +#else + int32_t tbu, tbl, tmp; + asm volatile( + "0:\n" + "mftbu %[hi32]\n" + "mftb %[lo32]\n" + "mftbu %[tmp]\n" + "cmpw %[tmp],%[hi32]\n" + "bne 0b\n" + : [ hi32 ] "=r"(tbu), [ lo32 ] "=r"(tbl), [ tmp ] "=r"(tmp)); + return (static_cast(tbu) << 32) | tbl; +#endif +#endif +} + +double UnscaledCycleClock::Frequency() { +#ifdef __GLIBC__ + return __ppc_get_timebase_freq(); +#elif defined(__FreeBSD__) + static once_flag init_timebase_frequency_once; + static double timebase_frequency = 0.0; + base_internal::LowLevelCallOnce(&init_timebase_frequency_once, [&]() { + size_t length = sizeof(timebase_frequency); + sysctlbyname("kern.timecounter.tc.timebase.frequency", &timebase_frequency, + &length, nullptr, 0); + }); + return timebase_frequency; +#else +#error Must implement UnscaledCycleClock::Frequency() +#endif +} + +#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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_USE_UNSCALED_CYCLECLOCK diff --git a/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.h b/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.h new file mode 100644 index 0000000..cdce9bf --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/internal/unscaledcycleclock.h @@ -0,0 +1,124 @@ +// 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. +// +// UnscaledCycleClock +// An UnscaledCycleClock yields the value and frequency of a cycle counter +// that increments at a rate that is approximately constant. +// This class is for internal / whitelisted use only, you should consider +// using CycleClock instead. +// +// Notes: +// The cycle counter frequency is not necessarily the core clock frequency. +// That is, CycleCounter cycles are not necessarily "CPU cycles". +// +// An arbitrary offset may have been added to the counter at power on. +// +// On some platforms, the rate and offset of the counter may differ +// slightly when read from different CPUs of a multiprocessor. Usually, +// we try to ensure that the operating system adjusts values periodically +// so that values agree approximately. If you need stronger guarantees, +// consider using alternate interfaces. +// +// The CPU is not required to maintain the ordering of a cycle counter read +// with respect to surrounding instructions. + +#ifndef ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ +#define ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ + +#include + +#if defined(__APPLE__) +#include +#endif + +#include "absl/base/port.h" + +// The following platforms have an implementation of a hardware counter. +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ + defined(__powerpc__) || defined(__ppc__) || \ + defined(_M_IX86) || defined(_M_X64) +#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 +#else +#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0 +#endif + +// The following platforms often disable access to the hardware +// counter (through a sandbox) even if the underlying hardware has a +// usable counter. The CycleTimer interface also requires a *scaled* +// CycleClock that runs at atleast 1 MHz. We've found some Android +// ARM64 devices where this is not the case, so we disable it by +// default on Android ARM64. +#if defined(__native_client__) || \ + (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || \ + (defined(__ANDROID__) && defined(__aarch64__)) +#define ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 0 +#else +#define ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 1 +#endif + +// UnscaledCycleClock is an optional internal feature. +// Use "#if ABSL_USE_UNSCALED_CYCLECLOCK" to test for its presence. +// Can be overridden at compile-time via -DABSL_USE_UNSCALED_CYCLECLOCK=0|1 +#if !defined(ABSL_USE_UNSCALED_CYCLECLOCK) +#define ABSL_USE_UNSCALED_CYCLECLOCK \ + (ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION && \ + ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT) +#endif + +#if ABSL_USE_UNSCALED_CYCLECLOCK + +// This macro can be used to test if UnscaledCycleClock::Frequency() +// is NominalCPUFrequency() on a particular platform. +#if (defined(__i386__) || defined(__x86_64__) || \ + defined(_M_IX86) || defined(_M_X64)) +#define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace time_internal { +class UnscaledCycleClockWrapperForGetCurrentTime; +} // namespace time_internal + +namespace base_internal { +class CycleClock; +class UnscaledCycleClockWrapperForInitializeFrequency; + +class UnscaledCycleClock { + private: + UnscaledCycleClock() = delete; + + // Return the value of a cycle counter that counts at a rate that is + // approximately constant. + static int64_t Now(); + + // Return the how much UnscaledCycleClock::Now() increases per second. + // This is not necessarily the core CPU clock frequency. + // It may be the nominal value report by the kernel, rather than a measured + // value. + static double Frequency(); + + // Whitelisted friends. + friend class base_internal::CycleClock; + friend class time_internal::UnscaledCycleClockWrapperForGetCurrentTime; + friend class base_internal::UnscaledCycleClockWrapperForInitializeFrequency; +}; + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_USE_UNSCALED_CYCLECLOCK + +#endif // ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/log_severity.cc b/SaraAttended/Pods/abseil/absl/base/log_severity.cc new file mode 100644 index 0000000..72312af --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/log_severity.cc @@ -0,0 +1,27 @@ +// 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/log_severity.h" + +#include + +namespace absl { +ABSL_NAMESPACE_BEGIN + +std::ostream& operator<<(std::ostream& os, absl::LogSeverity s) { + if (s == absl::NormalizeLogSeverity(s)) return os << absl::LogSeverityName(s); + return os << "absl::LogSeverity(" << static_cast(s) << ")"; +} +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/base/log_severity.h b/SaraAttended/Pods/abseil/absl/base/log_severity.h new file mode 100644 index 0000000..65a3b16 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/log_severity.h @@ -0,0 +1,121 @@ +// 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" +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// absl::LogSeverity +// +// 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. +// +// Values other than the four defined levels (e.g. produced by `static_cast`) +// are valid, but their semantics when passed to a function, macro, or flag +// depend on the function, macro, or flag. The usual behavior is to normalize +// such values to a defined severity level, however in some cases values other +// than the defined levels are useful for comparison. +// +// Exmaple: +// +// // Effectively disables all logging: +// SetMinLogLevel(static_cast(100)); +// +// Abseil flags may be defined with type `LogSeverity`. Dependency layering +// constraints require that the `AbslParseFlag()` overload be declared and +// defined in the flags library itself rather than here. The `AbslUnparseFlag()` +// overload is defined there as well for consistency. +// +// absl::LogSeverity Flag String Representation +// +// An `absl::LogSeverity` has a string representation used for parsing +// command-line flags based on the enumerator name (e.g. `kFatal`) or +// its unprefixed name (without the `k`) in any case-insensitive form. (E.g. +// "FATAL", "fatal" or "Fatal" are all valid.) Unparsing such flags produces an +// unprefixed string representation in all caps (e.g. "FATAL") or an integer. +// +// Additionally, the parser accepts arbitrary integers (as if the type were +// `int`). +// +// Examples: +// +// --my_log_level=kInfo +// --my_log_level=INFO +// --my_log_level=info +// --my_log_level=0 +// +// Unparsing a flag produces the same result as `absl::LogSeverityName()` for +// the standard levels and a base-ten integer otherwise. +enum class LogSeverity : int { + kInfo = 0, + kWarning = 1, + kError = 2, + kFatal = 3, +}; + +// LogSeverities() +// +// 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}}; +} + +// LogSeverityName() +// +// Returns the all-caps string representation (e.g. "INFO") of the specified +// severity level if it is one of the standard 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"; +} + +// NormalizeLogSeverity() +// +// 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 absl::NormalizeLogSeverity(static_cast(s)); +} + +// operator<< +// +// 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); + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/macros.h b/SaraAttended/Pods/abseil/absl/base/macros.h new file mode 100644 index 0000000..547f93b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/macros.h @@ -0,0 +1,220 @@ +// +// 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: macros.h +// ----------------------------------------------------------------------------- +// +// This header file defines the set of language macros used within Abseil code. +// For the set of macros used to determine supported compilers and platforms, +// see absl/base/config.h instead. +// +// This code is compiled directly on many platforms, including client +// platforms like Windows, Mac, and embedded systems. Before making +// any changes here, make sure that you're not breaking any platforms. + +#ifndef ABSL_BASE_MACROS_H_ +#define ABSL_BASE_MACROS_H_ + +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/optimization.h" +#include "absl/base/port.h" + +// ABSL_ARRAYSIZE() +// +// Returns the number of elements in an array as a compile-time constant, which +// can be used in defining new arrays. If you use this macro on a pointer by +// mistake, you will get a compile-time error. +#define ABSL_ARRAYSIZE(array) \ + (sizeof(::absl::macros_internal::ArraySizeHelper(array))) + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace macros_internal { +// Note: this internal template function declaration is used by ABSL_ARRAYSIZE. +// The function doesn't need a definition, as we only use its type. +template +auto ArraySizeHelper(const T (&array)[N]) -> char (&)[N]; +} // namespace macros_internal +ABSL_NAMESPACE_END +} // namespace absl + +// kLinkerInitialized +// +// An enum used only as a constructor argument to indicate that a variable has +// static storage duration, and that the constructor should do nothing to its +// state. Use of this macro indicates to the reader that it is legal to +// declare a static instance of the class, provided the constructor is given +// the absl::base_internal::kLinkerInitialized argument. +// +// Normally, it is unsafe to declare a static variable that has a constructor or +// a destructor because invocation order is undefined. However, if the type can +// be zero-initialized (which the loader does for static variables) into a valid +// state and the type's destructor does not affect storage, then a constructor +// for static initialization can be declared. +// +// Example: +// // Declaration +// explicit MyClass(absl::base_internal:LinkerInitialized x) {} +// +// // Invocation +// static MyClass my_global(absl::base_internal::kLinkerInitialized); +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { +enum LinkerInitialized { + kLinkerInitialized = 0, +}; +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +// ABSL_FALLTHROUGH_INTENDED +// +// Annotates implicit fall-through between switch labels, allowing a case to +// indicate intentional fallthrough and turn off warnings about any lack of a +// `break` statement. The ABSL_FALLTHROUGH_INTENDED macro should be followed by +// a semicolon and can be used in most places where `break` can, provided that +// no statements exist between it and the next switch label. +// +// Example: +// +// switch (x) { +// case 40: +// case 41: +// if (truth_is_out_there) { +// ++x; +// ABSL_FALLTHROUGH_INTENDED; // Use instead of/along with annotations +// // in comments +// } else { +// return x; +// } +// case 42: +// ... +// +// Notes: when compiled with clang in C++11 mode, the ABSL_FALLTHROUGH_INTENDED +// macro is expanded to the [[clang::fallthrough]] attribute, which is analysed +// when performing switch labels fall-through diagnostic +// (`-Wimplicit-fallthrough`). See clang documentation on language extensions +// for details: +// https://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough +// +// When used with unsupported compilers, the ABSL_FALLTHROUGH_INTENDED macro +// has no effect on diagnostics. In any case this macro has no effect on runtime +// behavior and performance of code. +#ifdef ABSL_FALLTHROUGH_INTENDED +#error "ABSL_FALLTHROUGH_INTENDED should not be defined." +#endif + +// TODO(zhangxy): Use c++17 standard [[fallthrough]] macro, when supported. +#if defined(__clang__) && defined(__has_warning) +#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +#define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]] +#endif +#elif defined(__GNUC__) && __GNUC__ >= 7 +#define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]] +#endif + +#ifndef ABSL_FALLTHROUGH_INTENDED +#define ABSL_FALLTHROUGH_INTENDED \ + do { \ + } while (0) +#endif + +// ABSL_DEPRECATED() +// +// Marks a deprecated class, struct, enum, function, method and variable +// declarations. The macro argument is used as a custom diagnostic message (e.g. +// suggestion of a better alternative). +// +// Examples: +// +// class ABSL_DEPRECATED("Use Bar instead") Foo {...}; +// +// ABSL_DEPRECATED("Use Baz() instead") void Bar() {...} +// +// template +// ABSL_DEPRECATED("Use DoThat() instead") +// void DoThis(); +// +// Every usage of a deprecated entity will trigger a warning when compiled with +// clang's `-Wdeprecated-declarations` option. This option is turned off by +// default, but the warnings will be reported by clang-tidy. +#if defined(__clang__) && __cplusplus >= 201103L +#define ABSL_DEPRECATED(message) __attribute__((deprecated(message))) +#endif + +#ifndef ABSL_DEPRECATED +#define ABSL_DEPRECATED(message) +#endif + +// ABSL_BAD_CALL_IF() +// +// Used on a function overload to trap bad calls: any call that matches the +// overload will cause a compile-time error. This macro uses a clang-specific +// "enable_if" attribute, as described at +// https://clang.llvm.org/docs/AttributeReference.html#enable-if +// +// Overloads which use this macro should be bracketed by +// `#ifdef ABSL_BAD_CALL_IF`. +// +// Example: +// +// int isdigit(int c); +// #ifdef ABSL_BAD_CALL_IF +// int isdigit(int c) +// ABSL_BAD_CALL_IF(c <= -1 || c > 255, +// "'c' must have the value of an unsigned char or EOF"); +// #endif // ABSL_BAD_CALL_IF +#if ABSL_HAVE_ATTRIBUTE(enable_if) +#define ABSL_BAD_CALL_IF(expr, msg) \ + __attribute__((enable_if(expr, "Bad call trap"), unavailable(msg))) +#endif + +// ABSL_ASSERT() +// +// In C++11, `assert` can't be used portably within constexpr functions. +// ABSL_ASSERT functions as a runtime assert but works in C++11 constexpr +// functions. Example: +// +// constexpr double Divide(double a, double b) { +// return ABSL_ASSERT(b != 0), a / b; +// } +// +// This macro is inspired by +// https://akrzemi1.wordpress.com/2017/05/18/asserts-in-constexpr-functions/ +#if defined(NDEBUG) +#define ABSL_ASSERT(expr) \ + (false ? static_cast(expr) : static_cast(0)) +#else +#define ABSL_ASSERT(expr) \ + (ABSL_PREDICT_TRUE((expr)) ? static_cast(0) \ + : [] { assert(false && #expr); }()) // NOLINT +#endif + +#ifdef ABSL_HAVE_EXCEPTIONS +#define ABSL_INTERNAL_TRY try +#define ABSL_INTERNAL_CATCH_ANY catch (...) +#define ABSL_INTERNAL_RETHROW do { throw; } while (false) +#else // ABSL_HAVE_EXCEPTIONS +#define ABSL_INTERNAL_TRY if (true) +#define ABSL_INTERNAL_CATCH_ANY else if (false) +#define ABSL_INTERNAL_RETHROW do {} while (false) +#endif // ABSL_HAVE_EXCEPTIONS + +#endif // ABSL_BASE_MACROS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/optimization.h b/SaraAttended/Pods/abseil/absl/base/optimization.h new file mode 100644 index 0000000..646523b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/optimization.h @@ -0,0 +1,181 @@ +// +// 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: optimization.h +// ----------------------------------------------------------------------------- +// +// This header file defines portable macros for performance optimization. + +#ifndef ABSL_BASE_OPTIMIZATION_H_ +#define ABSL_BASE_OPTIMIZATION_H_ + +#include "absl/base/config.h" + +// ABSL_BLOCK_TAIL_CALL_OPTIMIZATION +// +// Instructs the compiler to avoid optimizing tail-call recursion. Use of this +// macro is useful when you wish to preserve the existing function order within +// a stack trace for logging, debugging, or profiling purposes. +// +// Example: +// +// int f() { +// int result = g(); +// ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); +// return result; +// } +#if defined(__pnacl__) +#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } +#elif defined(__clang__) +// Clang will not tail call given inline volatile assembly. +#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") +#elif defined(__GNUC__) +// GCC will not tail call given inline volatile assembly. +#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") +#elif defined(_MSC_VER) +#include +// The __nop() intrinsic blocks the optimisation. +#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __nop() +#else +#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } +#endif + +// ABSL_CACHELINE_SIZE +// +// Explicitly defines the size of the L1 cache for purposes of alignment. +// Setting the cacheline size allows you to specify that certain objects be +// aligned on a cacheline boundary with `ABSL_CACHELINE_ALIGNED` declarations. +// (See below.) +// +// NOTE: this macro should be replaced with the following C++17 features, when +// those are generally available: +// +// * `std::hardware_constructive_interference_size` +// * `std::hardware_destructive_interference_size` +// +// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0154r1.html +// for more information. +#if defined(__GNUC__) +// Cache line alignment +#if defined(__i386__) || defined(__x86_64__) +#define ABSL_CACHELINE_SIZE 64 +#elif defined(__powerpc64__) +#define ABSL_CACHELINE_SIZE 128 +#elif defined(__aarch64__) +// We would need to read special register ctr_el0 to find out L1 dcache size. +// This value is a good estimate based on a real aarch64 machine. +#define ABSL_CACHELINE_SIZE 64 +#elif defined(__arm__) +// Cache line sizes for ARM: These values are not strictly correct since +// cache line sizes depend on implementations, not architectures. There +// are even implementations with cache line sizes configurable at boot +// time. +#if defined(__ARM_ARCH_5T__) +#define ABSL_CACHELINE_SIZE 32 +#elif defined(__ARM_ARCH_7A__) +#define ABSL_CACHELINE_SIZE 64 +#endif +#endif + +#ifndef ABSL_CACHELINE_SIZE +// A reasonable default guess. Note that overestimates tend to waste more +// space, while underestimates tend to waste more time. +#define ABSL_CACHELINE_SIZE 64 +#endif + +// ABSL_CACHELINE_ALIGNED +// +// Indicates that the declared object be cache aligned using +// `ABSL_CACHELINE_SIZE` (see above). Cacheline aligning objects allows you to +// load a set of related objects in the L1 cache for performance improvements. +// Cacheline aligning objects properly allows constructive memory sharing and +// prevents destructive (or "false") memory sharing. +// +// NOTE: this macro should be replaced with usage of `alignas()` using +// `std::hardware_constructive_interference_size` and/or +// `std::hardware_destructive_interference_size` when available within C++17. +// +// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0154r1.html +// for more information. +// +// On some compilers, `ABSL_CACHELINE_ALIGNED` expands to an `__attribute__` +// or `__declspec` attribute. For compilers where this is not known to work, +// the macro expands to nothing. +// +// No further guarantees are made here. The result of applying the macro +// to variables and types is always implementation-defined. +// +// WARNING: It is easy to use this attribute incorrectly, even to the point +// of causing bugs that are difficult to diagnose, crash, etc. It does not +// of itself guarantee that objects are aligned to a cache line. +// +// NOTE: Some compilers are picky about the locations of annotations such as +// this attribute, so prefer to put it at the beginning of your declaration. +// For example, +// +// ABSL_CACHELINE_ALIGNED static Foo* foo = ... +// +// class ABSL_CACHELINE_ALIGNED Bar { ... +// +// Recommendations: +// +// 1) Consult compiler documentation; this comment is not kept in sync as +// toolchains evolve. +// 2) Verify your use has the intended effect. This often requires inspecting +// the generated machine code. +// 3) Prefer applying this attribute to individual variables. Avoid +// applying it to types. This tends to localize the effect. +#define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE))) +#elif defined(_MSC_VER) +#define ABSL_CACHELINE_SIZE 64 +#define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE)) +#else +#define ABSL_CACHELINE_SIZE 64 +#define ABSL_CACHELINE_ALIGNED +#endif + +// ABSL_PREDICT_TRUE, ABSL_PREDICT_FALSE +// +// Enables the compiler to prioritize compilation using static analysis for +// likely paths within a boolean branch. +// +// Example: +// +// if (ABSL_PREDICT_TRUE(expression)) { +// return result; // Faster if more likely +// } else { +// return 0; +// } +// +// Compilers can use the information that a certain branch is not likely to be +// taken (for instance, a CHECK failure) to optimize for the common case in +// the absence of better information (ie. compiling gcc with `-fprofile-arcs`). +// +// Recommendation: Modern CPUs dynamically predict branch execution paths, +// typically with accuracy greater than 97%. As a result, annotating every +// branch in a codebase is likely counterproductive; however, annotating +// specific branches that are both hot and consistently mispredicted is likely +// to yield performance improvements. +#if ABSL_HAVE_BUILTIN(__builtin_expect) || \ + (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_PREDICT_FALSE(x) (__builtin_expect(x, 0)) +#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true)) +#else +#define ABSL_PREDICT_FALSE(x) (x) +#define ABSL_PREDICT_TRUE(x) (x) +#endif + +#endif // ABSL_BASE_OPTIMIZATION_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/options.h b/SaraAttended/Pods/abseil/absl/base/options.h new file mode 100644 index 0000000..50f26e2 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/options.h @@ -0,0 +1,211 @@ +#ifndef ABSL_BASE_OPTIONS_H_ +#define ABSL_BASE_OPTIONS_H_ + +// 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: options.h +// ----------------------------------------------------------------------------- +// +// This file contains Abseil configuration options for setting specific +// implementations instead of letting Abseil determine which implementation to +// use at compile-time. Setting these options may be useful for package or build +// managers who wish to guarantee ABI stability within binary builds (which are +// otherwise difficult to enforce). +// +// *** IMPORTANT NOTICE FOR PACKAGE MANAGERS: It is important that +// maintainers of package managers who wish to package Abseil read and +// understand this file! *** +// +// Abseil contains a number of possible configuration endpoints, based on +// parameters such as the detected platform, language version, or command-line +// flags used to invoke the underlying binary. As is the case with all +// libraries, binaries which contain Abseil code must ensure that separate +// packages use the same compiled copy of Abseil to avoid a diamond dependency +// problem, which can occur if two packages built with different Abseil +// configuration settings are linked together. Diamond dependency problems in +// C++ may manifest as violations to the One Definition Rule (ODR) (resulting in +// linker errors), or undefined behavior (resulting in crashes). +// +// Diamond dependency problems can be avoided if all packages utilize the same +// exact version of Abseil. Building from source code with the same compilation +// parameters is the easiest way to avoid such dependency problems. However, for +// package managers who cannot control such compilation parameters, we are +// providing the file to allow you to inject ABI (Application Binary Interface) +// stability across builds. Settings options in this file will neither change +// API nor ABI, providing a stable copy of Abseil between packages. +// +// Care must be taken to keep options within these configurations isolated +// from any other dynamic settings, such as command-line flags which could alter +// these options. This file is provided specifically to help build and package +// managers provide a stable copy of Abseil within their libraries and binaries; +// other developers should not have need to alter the contents of this file. +// +// ----------------------------------------------------------------------------- +// Usage +// ----------------------------------------------------------------------------- +// +// For any particular package release, set the appropriate definitions within +// this file to whatever value makes the most sense for your package(s). Note +// that, by default, most of these options, at the moment, affect the +// implementation of types; future options may affect other implementation +// details. +// +// NOTE: the defaults within this file all assume that Abseil can select the +// proper Abseil implementation at compile-time, which will not be sufficient +// to guarantee ABI stability to package managers. + +// Include a standard library header to allow configuration based on the +// standard library in use. +#ifdef __cplusplus +#include +#endif + +// ----------------------------------------------------------------------------- +// Type Compatibility Options +// ----------------------------------------------------------------------------- +// +// ABSL_OPTION_USE_STD_ANY +// +// This option controls whether absl::any is implemented as an alias to +// std::any, or as an independent implementation. +// +// A value of 0 means to use Abseil's implementation. This requires only C++11 +// support, and is expected to work on every toolchain we support. +// +// A value of 1 means to use an alias to std::any. This requires that all code +// using Abseil is built in C++17 mode or later. +// +// A value of 2 means to detect the C++ version being used to compile Abseil, +// and use an alias only if a working std::any is available. This option is +// useful when you are building your entire program, including all of its +// dependencies, from source. It should not be used otherwise -- for example, +// if you are distributing Abseil in a binary package manager -- since in +// mode 2, absl::any will name a different type, with a different mangled name +// and binary layout, depending on the compiler flags passed by the end user. +// For more info, see https://abseil.io/about/design/dropin-types. +// +// User code should not inspect this macro. To check in the preprocessor if +// absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. + +#define ABSL_OPTION_USE_STD_ANY 2 + + +// ABSL_OPTION_USE_STD_OPTIONAL +// +// This option controls whether absl::optional is implemented as an alias to +// std::optional, or as an independent implementation. +// +// A value of 0 means to use Abseil's implementation. This requires only C++11 +// support, and is expected to work on every toolchain we support. +// +// A value of 1 means to use an alias to std::optional. This requires that all +// code using Abseil is built in C++17 mode or later. +// +// A value of 2 means to detect the C++ version being used to compile Abseil, +// and use an alias only if a working std::optional is available. This option +// is useful when you are building your program from source. It should not be +// used otherwise -- for example, if you are distributing Abseil in a binary +// package manager -- since in mode 2, absl::optional will name a different +// type, with a different mangled name and binary layout, depending on the +// compiler flags passed by the end user. For more info, see +// https://abseil.io/about/design/dropin-types. + +// User code should not inspect this macro. To check in the preprocessor if +// absl::optional is a typedef of std::optional, use the feature macro +// ABSL_USES_STD_OPTIONAL. + +#define ABSL_OPTION_USE_STD_OPTIONAL 2 + + +// ABSL_OPTION_USE_STD_STRING_VIEW +// +// This option controls whether absl::string_view is implemented as an alias to +// std::string_view, or as an independent implementation. +// +// A value of 0 means to use Abseil's implementation. This requires only C++11 +// support, and is expected to work on every toolchain we support. +// +// A value of 1 means to use an alias to std::string_view. This requires that +// all code using Abseil is built in C++17 mode or later. +// +// A value of 2 means to detect the C++ version being used to compile Abseil, +// and use an alias only if a working std::string_view is available. This +// option is useful when you are building your program from source. It should +// not be used otherwise -- for example, if you are distributing Abseil in a +// binary package manager -- since in mode 2, absl::string_view will name a +// different type, with a different mangled name and binary layout, depending on +// the compiler flags passed by the end user. For more info, see +// https://abseil.io/about/design/dropin-types. +// +// User code should not inspect this macro. To check in the preprocessor if +// absl::string_view is a typedef of std::string_view, use the feature macro +// ABSL_USES_STD_STRING_VIEW. + +#define ABSL_OPTION_USE_STD_STRING_VIEW 2 + +// ABSL_OPTION_USE_STD_VARIANT +// +// This option controls whether absl::variant is implemented as an alias to +// std::variant, or as an independent implementation. +// +// A value of 0 means to use Abseil's implementation. This requires only C++11 +// support, and is expected to work on every toolchain we support. +// +// A value of 1 means to use an alias to std::variant. This requires that all +// code using Abseil is built in C++17 mode or later. +// +// A value of 2 means to detect the C++ version being used to compile Abseil, +// and use an alias only if a working std::variant is available. This option +// is useful when you are building your program from source. It should not be +// used otherwise -- for example, if you are distributing Abseil in a binary +// package manager -- since in mode 2, absl::variant will name a different +// type, with a different mangled name and binary layout, depending on the +// compiler flags passed by the end user. For more info, see +// https://abseil.io/about/design/dropin-types. +// +// User code should not inspect this macro. To check in the preprocessor if +// absl::variant is a typedef of std::variant, use the feature macro +// ABSL_USES_STD_VARIANT. + +#define ABSL_OPTION_USE_STD_VARIANT 2 + + +// ABSL_OPTION_USE_INLINE_NAMESPACE +// ABSL_OPTION_INLINE_NAMESPACE_NAME +// +// These options controls whether all entities in the absl namespace are +// contained within an inner inline namespace. This does not affect the +// user-visible API of Abseil, but it changes the mangled names of all symbols. +// +// This can be useful as a version tag if you are distributing Abseil in +// precompiled form. This will prevent a binary library build of Abseil with +// one inline namespace being used with headers configured with a different +// inline namespace name. Binary packagers are reminded that Abseil does not +// guarantee any ABI stability in Abseil, so any update of Abseil or +// configuration change in such a binary package should be combined with a +// new, unique value for the inline namespace name. +// +// A value of 0 means not to use inline namespaces. +// +// A value of 1 means to use an inline namespace with the given name inside +// namespace absl. If this is set, ABSL_OPTION_INLINE_NAMESPACE_NAME must also +// be changed to a new, unique identifier name. In particular "head" is not +// allowed. + +#define ABSL_OPTION_USE_INLINE_NAMESPACE 1 +#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_2020_02_25 + +#endif // ABSL_BASE_OPTIONS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/policy_checks.h b/SaraAttended/Pods/abseil/absl/base/policy_checks.h new file mode 100644 index 0000000..4dfa49e --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/policy_checks.h @@ -0,0 +1,111 @@ +// 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: policy_checks.h +// ----------------------------------------------------------------------------- +// +// This header enforces a minimum set of policies at build time, such as the +// supported compiler and library versions. Unsupported configurations are +// reported with `#error`. This enforcement is best effort, so successfully +// compiling this header does not guarantee a supported configuration. + +#ifndef ABSL_BASE_POLICY_CHECKS_H_ +#define ABSL_BASE_POLICY_CHECKS_H_ + +// Included for the __GLIBC_PREREQ macro used below. +#include + +// Included for the _STLPORT_VERSION macro used below. +#if defined(__cplusplus) +#include +#endif + +// ----------------------------------------------------------------------------- +// Operating System Check +// ----------------------------------------------------------------------------- + +#if defined(__CYGWIN__) +#error "Cygwin is not supported." +#endif + +// ----------------------------------------------------------------------------- +// Compiler Check +// ----------------------------------------------------------------------------- + +// We support MSVC++ 14.0 update 2 and later. +// This minimum will go up. +#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190023918 && !defined(__clang__) +#error "This package requires Visual Studio 2015 Update 2 or higher." +#endif + +// We support gcc 4.7 and later. +// This minimum will go up. +#if defined(__GNUC__) && !defined(__clang__) +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) +#error "This package requires gcc 4.7 or higher." +#endif +#endif + +// We support Apple Xcode clang 4.2.1 (version 421.11.65) and later. +// This corresponds to Apple Xcode version 4.5. +// This minimum will go up. +#if defined(__apple_build_version__) && __apple_build_version__ < 4211165 +#error "This package requires __apple_build_version__ of 4211165 or higher." +#endif + +// ----------------------------------------------------------------------------- +// C++ Version Check +// ----------------------------------------------------------------------------- + +// Enforce C++11 as the minimum. Note that Visual Studio has not +// advanced __cplusplus despite being good enough for our purposes, so +// so we exempt it from the check. +#if defined(__cplusplus) && !defined(_MSC_VER) +#if __cplusplus < 201103L +#error "C++ versions less than C++11 are not supported." +#endif +#endif + +// ----------------------------------------------------------------------------- +// Standard Library Check +// ----------------------------------------------------------------------------- + +#if defined(_STLPORT_VERSION) +#error "STLPort is not supported." +#endif + +// ----------------------------------------------------------------------------- +// `char` Size Check +// ----------------------------------------------------------------------------- + +// Abseil currently assumes CHAR_BIT == 8. If you would like to use Abseil on a +// platform where this is not the case, please provide us with the details about +// your platform so we can consider relaxing this requirement. +#if CHAR_BIT != 8 +#error "Abseil assumes CHAR_BIT == 8." +#endif + +// ----------------------------------------------------------------------------- +// `int` Size Check +// ----------------------------------------------------------------------------- + +// Abseil currently assumes that an int is 4 bytes. If you would like to use +// Abseil on a platform where this is not the case, please provide us with the +// details about your platform so we can consider relaxing this requirement. +#if INT_MAX < 2147483647 +#error "Abseil assumes that int is at least 4 bytes. " +#endif + +#endif // ABSL_BASE_POLICY_CHECKS_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/port.h b/SaraAttended/Pods/abseil/absl/base/port.h new file mode 100644 index 0000000..6c28068 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/port.h @@ -0,0 +1,26 @@ +// 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 files is a forwarding header for other headers containing various +// portability macros and functions. +// This file is used for both C and C++! + +#ifndef ABSL_BASE_PORT_H_ +#define ABSL_BASE_PORT_H_ + +#include "absl/base/attributes.h" +#include "absl/base/config.h" +#include "absl/base/optimization.h" + +#endif // ABSL_BASE_PORT_H_ diff --git a/SaraAttended/Pods/abseil/absl/base/thread_annotations.h b/SaraAttended/Pods/abseil/absl/base/thread_annotations.h new file mode 100644 index 0000000..5f51c0c --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/base/thread_annotations.h @@ -0,0 +1,280 @@ +// 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_ + +#include "absl/base/config.h" +// TODO(mbonadei): Remove after the backward compatibility period. +#include "absl/base/internal/thread_annotations.h" // IWYU pragma: export + +#if defined(__clang__) +#define ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(x) __attribute__((x)) +#else +#define ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(x) // no-op +#endif + +// ABSL_GUARDED_BY() +// +// Documents if a shared field or global variable needs to be protected by a +// mutex. ABSL_GUARDED_BY() allows the user to specify a particular mutex that +// should be held when accessing the annotated variable. +// +// Although this annotation (and ABSL_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_ ABSL_GUARDED_BY(mu_); +// ... +// }; +#define ABSL_GUARDED_BY(x) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(guarded_by(x)) + +// ABSL_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_ ABSL_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_ ABSL_GUARDED_BY(mu1_) ABSL_PT_GUARDED_BY(mu2_); +#define ABSL_PT_GUARDED_BY(x) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(pt_guarded_by(x)) + +// ABSL_ACQUIRED_AFTER() / ABSL_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 ABSL_ACQUIRED_AFTER +// and ABSL_ACQUIRED_BEFORE.) +// +// As with ABSL_GUARDED_BY, this is only applicable to mutexes that are shared +// fields or global variables. +// +// Example: +// +// Mutex m1_; +// Mutex m2_ ABSL_ACQUIRED_AFTER(m1_); +#define ABSL_ACQUIRED_AFTER(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(acquired_after(__VA_ARGS__)) + +#define ABSL_ACQUIRED_BEFORE(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(acquired_before(__VA_ARGS__)) + +// ABSL_EXCLUSIVE_LOCKS_REQUIRED() / ABSL_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 +// ABSL_EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with +// ABSL_SHARED_LOCKS_REQUIRED. +// +// Example: +// +// Mutex mu1, mu2; +// int a ABSL_GUARDED_BY(mu1); +// int b ABSL_GUARDED_BY(mu2); +// +// void foo() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... } +// void bar() const ABSL_SHARED_LOCKS_REQUIRED(mu1, mu2) { ... } +#define ABSL_EXCLUSIVE_LOCKS_REQUIRED(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE( \ + exclusive_locks_required(__VA_ARGS__)) + +#define ABSL_SHARED_LOCKS_REQUIRED(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(shared_locks_required(__VA_ARGS__)) + +// ABSL_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 ABSL_LOCKS_EXCLUDED(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(locks_excluded(__VA_ARGS__)) + +// ABSL_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 ABSL_LOCK_RETURNED. +#define ABSL_LOCK_RETURNED(x) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(lock_returned(x)) + +// ABSL_LOCKABLE +// +// Documents if a class/type is a lockable type (such as the `Mutex` class). +#define ABSL_LOCKABLE ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(lockable) + +// ABSL_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 ABSL_SCOPED_LOCKABLE \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(scoped_lockable) + +// ABSL_EXCLUSIVE_LOCK_FUNCTION() +// +// Documents functions that acquire a lock in the body of a function, and do +// not release it. +#define ABSL_EXCLUSIVE_LOCK_FUNCTION(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE( \ + exclusive_lock_function(__VA_ARGS__)) + +// ABSL_SHARED_LOCK_FUNCTION() +// +// Documents functions that acquire a shared (reader) lock in the body of a +// function, and do not release it. +#define ABSL_SHARED_LOCK_FUNCTION(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(shared_lock_function(__VA_ARGS__)) + +// ABSL_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 ABSL_UNLOCK_FUNCTION(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(unlock_function(__VA_ARGS__)) + +// ABSL_EXCLUSIVE_TRYLOCK_FUNCTION() / ABSL_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 ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE( \ + exclusive_trylock_function(__VA_ARGS__)) + +#define ABSL_SHARED_TRYLOCK_FUNCTION(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE( \ + shared_trylock_function(__VA_ARGS__)) + +// ABSL_ASSERT_EXCLUSIVE_LOCK() / ABSL_ASSERT_SHARED_LOCK() +// +// Documents functions that dynamically check to see if a lock is held, and fail +// if it is not held. +#define ABSL_ASSERT_EXCLUSIVE_LOCK(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(assert_exclusive_lock(__VA_ARGS__)) + +#define ABSL_ASSERT_SHARED_LOCK(...) \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(assert_shared_lock(__VA_ARGS__)) + +// ABSL_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 ABSL_NO_THREAD_SAFETY_ANALYSIS \ + ABSL_INTERNAL_THREAD_ANNOTATION_ATTRIBUTE(no_thread_safety_analysis) + +//------------------------------------------------------------------------------ +// Tool-Supplied Annotations +//------------------------------------------------------------------------------ + +// ABSL_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 ABSL_TS_UNCHECKED(x) "" + +// ABSL_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 ABSL_TS_UNCHECKED. +#define ABSL_TS_FIXME(x) "" + +// Like ABSL_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 ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME ABSL_NO_THREAD_SAFETY_ANALYSIS + +// Similar to ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME, this macro marks a +// ABSL_GUARDED_BY annotation that needs to be fixed, because it is producing +// thread safety warning. It disables the ABSL_GUARDED_BY. +#define ABSL_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 ABSL_TS_UNCHECKED_READ(x) absl::base_internal::ts_unchecked_read(x) + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// Takes a reference to a guarded data member, and returns an unguarded +// reference. +// Do not used this function directly, use ABSL_TS_UNCHECKED_READ instead. +template +inline const T& ts_unchecked_read(const T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS { + return v; +} + +template +inline T& ts_unchecked_read(T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS { + return v; +} + +} // namespace base_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_THREAD_ANNOTATIONS_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/fixed_array.h b/SaraAttended/Pods/abseil/absl/container/fixed_array.h new file mode 100644 index 0000000..a9ce99b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/fixed_array.h @@ -0,0 +1,515 @@ +// 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 "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 { +ABSL_NAMESPACE_BEGIN + +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>; + + 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), ""); + + class NonEmptyInlinedStorage { + public: + StorageElement* data() { return reinterpret_cast(buff_); } + void AnnotateConstruct(size_type n); + void AnnotateDestruct(size_type n); + +#ifdef ADDRESS_SANITIZER + void* RedzoneBegin() { return &redzone_begin_; } + void* RedzoneEnd() { return &redzone_end_ + 1; } +#endif // ADDRESS_SANITIZER + + private: + ADDRESS_SANITIZER_REDZONE(redzone_begin_); + alignas(StorageElement) char buff_[sizeof(StorageElement[inline_elements])]; + ADDRESS_SANITIZER_REDZONE(redzone_end_); + }; + + class EmptyInlinedStorage { + public: + 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 +} +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_FIXED_ARRAY_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/flat_hash_map.h b/SaraAttended/Pods/abseil/absl/container/flat_hash_map.h new file mode 100644 index 0000000..fcb70d8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/flat_hash_map.h @@ -0,0 +1,600 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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 if 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. + // + // All `try_emplace()` overloads make the same guarantees regarding rvalue + // arguments as `std::unordered_map::try_emplace()`, namely that these + // functions will not move from rvalue arguments if insertions do not happen. + 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 exchanged 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; +}; + +// erase_if(flat_hash_map<>, Pred) +// +// Erases all elements that satisfy the predicate `pred` from the container `c`. +template +void erase_if(flat_hash_map& c, Predicate pred) { + container_internal::EraseIf(pred, &c); +} + +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 + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_FLAT_HASH_MAP_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/inlined_vector.h b/SaraAttended/Pods/abseil/absl/container/inlined_vector.h new file mode 100644 index 0000000..2388d47 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/inlined_vector.h @@ -0,0 +1,848 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +// ----------------------------------------------------------------------------- +// 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, "`absl::InlinedVector` requires an inlined capacity."); + + using Storage = inlined_vector_internal::Storage; + + using AllocatorTraits = typename Storage::AllocatorTraits; + using RValueReference = typename Storage::RValueReference; + using MoveIterator = typename Storage::MoveIterator; + using IsMemcpyOk = typename Storage::IsMemcpyOk; + + template + using IteratorValueAdapter = + typename Storage::template IteratorValueAdapter; + using CopyValueAdapter = typename Storage::CopyValueAdapter; + using DefaultValueAdapter = typename Storage::DefaultValueAdapter; + + template + using EnableIfAtLeastForwardIterator = absl::enable_if_t< + inlined_vector_internal::IsAtLeastForwardIterator::value>; + template + using DisableIfAtLeastForwardIterator = absl::enable_if_t< + !inlined_vector_internal::IsAtLeastForwardIterator::value>; + + 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 size_type = typename Storage::size_type; + using difference_type = typename Storage::difference_type; + using reference = typename Storage::reference; + using const_reference = typename Storage::const_reference; + 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 value-initialized allocator. + InlinedVector() noexcept(noexcept(allocator_type())) : storage_() {} + + // Creates an empty inlined vector with a copy of `alloc`. + 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) { + storage_.Initialize(DefaultValueAdapter(), 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) { + storage_.Initialize(CopyValueAdapter(v), n); + } + + // Creates an inlined vector with copies of the elements of `list`. + InlinedVector(std::initializer_list list, + const allocator_type& alloc = allocator_type()) + : InlinedVector(list.begin(), list.end(), alloc) {} + + // 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) { + storage_.Initialize(IteratorValueAdapter(first), + std::distance(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 an inlined vector by copying the contents of `other` using + // `other`'s allocator. + InlinedVector(const InlinedVector& other) + : InlinedVector(other, *other.storage_.GetAllocPtr()) {} + + // Creates an inlined vector by copying the contents of `other` using `alloc`. + InlinedVector(const InlinedVector& other, const allocator_type& alloc) + : storage_(alloc) { + if (IsMemcpyOk::value && !other.storage_.GetIsAllocated()) { + storage_.MemcpyFrom(other.storage_); + } else { + storage_.Initialize(IteratorValueAdapter(other.data()), + other.size()); + } + } + + // Creates an inlined vector by moving in the contents of `other` without + // allocating. If `other` contains allocated memory, the newly-created inlined + // vector will take ownership of that memory. However, if `other` does not + // contain allocated memory, the newly-created inlined vector will perform + // element-wise move construction of the contents of `other`. + // + // 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. It is assumed assumed that... + // 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 inlined vector'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_.GetAllocPtr()) { + if (IsMemcpyOk::value) { + storage_.MemcpyFrom(other.storage_); + + other.storage_.SetInlinedSize(0); + } else if (other.storage_.GetIsAllocated()) { + storage_.SetAllocatedData(other.storage_.GetAllocatedData(), + other.storage_.GetAllocatedCapacity()); + storage_.SetAllocatedSize(other.storage_.GetSize()); + + other.storage_.SetInlinedSize(0); + } else { + IteratorValueAdapter other_values( + MoveIterator(other.storage_.GetInlinedData())); + + inlined_vector_internal::ConstructElements( + storage_.GetAllocPtr(), storage_.GetInlinedData(), &other_values, + other.storage_.GetSize()); + + storage_.SetInlinedSize(other.storage_.GetSize()); + } + } + + // Creates an inlined vector by moving in the contents of `other` with a copy + // of `alloc`. + // + // NOTE: if `other`'s allocator is not equal to `alloc`, even if `other` + // contains allocated memory, this move constructor will still allocate. Since + // allocation is performed, this constructor can only be `noexcept` if the + // specified allocator is also `noexcept`. + InlinedVector(InlinedVector&& other, const allocator_type& alloc) noexcept( + absl::allocator_is_nothrow::value) + : storage_(alloc) { + if (IsMemcpyOk::value) { + storage_.MemcpyFrom(other.storage_); + + other.storage_.SetInlinedSize(0); + } else if ((*storage_.GetAllocPtr() == *other.storage_.GetAllocPtr()) && + other.storage_.GetIsAllocated()) { + storage_.SetAllocatedData(other.storage_.GetAllocatedData(), + other.storage_.GetAllocatedCapacity()); + storage_.SetAllocatedSize(other.storage_.GetSize()); + + other.storage_.SetInlinedSize(0); + } else { + storage_.Initialize( + IteratorValueAdapter(MoveIterator(other.data())), + other.size()); + } + } + + ~InlinedVector() {} + + // --------------------------------------------------------------------------- + // InlinedVector Member Accessors + // --------------------------------------------------------------------------- + + // `InlinedVector::empty()` + // + // Returns whether the inlined vector contains 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 inlined vector can hold. + size_type max_size() const noexcept { + // One bit of the size storage is used to indicate whether the inlined + // vector contains allocated memory. As a result, the maximum size that the + // inlined vector can express is half of the max for `size_type`. + return (std::numeric_limits::max)() / 2; + } + + // `InlinedVector::capacity()` + // + // Returns the number of elements that could be stored in the inlined vector + // without requiring a reallocation. + // + // NOTE: for most inlined vectors, `capacity()` should be equal to the + // template parameter `N`. For inlined vectors which exceed this capacity, + // they will no longer be inlined and `capacity()` will equal the capactity of + // the allocated memory. + size_type capacity() const noexcept { + return storage_.GetIsAllocated() ? storage_.GetAllocatedCapacity() + : storage_.GetInlinedCapacity(); + } + + // `InlinedVector::data()` + // + // Returns a `pointer` to the elements of the inlined vector. This pointer + // can be used to access and modify the contained elements. + // + // NOTE: only elements within [`data()`, `data() + size()`) are valid. + pointer data() noexcept { + return storage_.GetIsAllocated() ? storage_.GetAllocatedData() + : storage_.GetInlinedData(); + } + + // Overload of `InlinedVector::data()` that returns a `const_pointer` to the + // elements of the inlined vector. This pointer can be used to access but not + // modify the contained elements. + // + // NOTE: only elements within [`data()`, `data() + size()`) are valid. + 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. + reference operator[](size_type i) { + assert(i < size()); + + return data()[i]; + } + + // Overload of `InlinedVector::operator[](...)` that returns 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. + // + // NOTE: if `i` is not within the required range of `InlinedVector::at(...)`, + // in both debug and non-debug builds, `std::out_of_range` will be thrown. + 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(...)` that returns a `const_reference` to + // the `i`th element of the inlined vector. + // + // NOTE: if `i` is not within the required range of `InlinedVector::at(...)`, + // in both debug and non-debug builds, `std::out_of_range` will be thrown. + 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()` that 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()` that returns 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()` that returns 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()` that returns 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()` that returns 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()` that returns 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 inlined vector's allocator. + allocator_type get_allocator() const { return *storage_.GetAllocPtr(); } + + // --------------------------------------------------------------------------- + // InlinedVector Member Mutators + // --------------------------------------------------------------------------- + + // `InlinedVector::operator=(...)` + // + // Replaces the elements of the inlined vector with copies of the elements of + // `list`. + InlinedVector& operator=(std::initializer_list list) { + assign(list.begin(), list.end()); + + return *this; + } + + // Overload of `InlinedVector::operator=(...)` that replaces the elements of + // the inlined vector with copies of the elements of `other`. + InlinedVector& operator=(const InlinedVector& other) { + if (ABSL_PREDICT_TRUE(this != std::addressof(other))) { + const_pointer other_data = other.data(); + assign(other_data, other_data + other.size()); + } + + return *this; + } + + // Overload of `InlinedVector::operator=(...)` that moves the elements of + // `other` into the inlined vector. + // + // NOTE: as a result of calling this overload, `other` is left in a valid but + // unspecified state. + InlinedVector& operator=(InlinedVector&& other) { + if (ABSL_PREDICT_TRUE(this != std::addressof(other))) { + if (IsMemcpyOk::value || other.storage_.GetIsAllocated()) { + inlined_vector_internal::DestroyElements(storage_.GetAllocPtr(), data(), + size()); + storage_.DeallocateIfAllocated(); + storage_.MemcpyFrom(other.storage_); + + other.storage_.SetInlinedSize(0); + } else { + storage_.Assign(IteratorValueAdapter( + MoveIterator(other.storage_.GetInlinedData())), + 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) { + storage_.Assign(CopyValueAdapter(v), n); + } + + // Overload of `InlinedVector::assign(...)` that replaces the contents of the + // inlined vector with copies of the elements of `list`. + void assign(std::initializer_list list) { + assign(list.begin(), list.end()); + } + + // Overload of `InlinedVector::assign(...)` to replace the contents of the + // inlined vector with the range [`first`, `last`). + // + // NOTE: this overload is for iterators that are "forward" category or better. + template * = nullptr> + void assign(ForwardIterator first, ForwardIterator last) { + storage_.Assign(IteratorValueAdapter(first), + std::distance(first, last)); + } + + // Overload of `InlinedVector::assign(...)` to replace the contents of the + // inlined vector with the range [`first`, `last`). + // + // NOTE: this overload is for iterators that are "input" category. + template * = nullptr> + void assign(InputIterator first, InputIterator last) { + size_type i = 0; + for (; i < size() && first != last; ++i, static_cast(++first)) { + at(i) = *first; + } + + erase(data() + i, data() + size()); + std::copy(first, last, std::back_inserter(*this)); + } + + // `InlinedVector::resize(...)` + // + // Resizes the inlined vector to contain `n` elements. + // + // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n` + // is larger than `size()`, new elements are value-initialized. + void resize(size_type n) { storage_.Resize(DefaultValueAdapter(), n); } + + // Overload of `InlinedVector::resize(...)` that resizes the inlined vector to + // contain `n` elements. + // + // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n` + // is larger than `size()`, new elements are copied-constructed from `v`. + void resize(size_type n, const_reference v) { + storage_.Resize(CopyValueAdapter(v), n); + } + + // `InlinedVector::insert(...)` + // + // Inserts a copy of `v` at `pos`, returning an `iterator` to the newly + // inserted element. + iterator insert(const_iterator pos, const_reference v) { + return emplace(pos, v); + } + + // Overload of `InlinedVector::insert(...)` that inserts `v` at `pos` using + // move semantics, returning an `iterator` to the newly inserted element. + iterator insert(const_iterator pos, RValueReference v) { + return emplace(pos, std::move(v)); + } + + // Overload of `InlinedVector::insert(...)` that inserts `n` contiguous copies + // of `v` starting at `pos`, returning an `iterator` pointing to the first of + // the newly inserted elements. + iterator insert(const_iterator pos, size_type n, const_reference v) { + assert(pos >= begin()); + assert(pos <= end()); + + if (ABSL_PREDICT_TRUE(n != 0)) { + value_type dealias = v; + return storage_.Insert(pos, CopyValueAdapter(dealias), n); + } else { + return const_cast(pos); + } + } + + // Overload of `InlinedVector::insert(...)` that inserts copies of the + // elements of `list` starting at `pos`, returning 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(...)` that inserts the range [`first`, + // `last`) starting at `pos`, returning an `iterator` pointing to the first + // of the newly inserted elements. + // + // NOTE: this overload is for iterators that are "forward" category or better. + template * = nullptr> + iterator insert(const_iterator pos, ForwardIterator first, + ForwardIterator last) { + assert(pos >= begin()); + assert(pos <= end()); + + if (ABSL_PREDICT_TRUE(first != last)) { + return storage_.Insert(pos, IteratorValueAdapter(first), + std::distance(first, last)); + } else { + return const_cast(pos); + } + } + + // Overload of `InlinedVector::insert(...)` that inserts the range [`first`, + // `last`) starting at `pos`, returning an `iterator` pointing to the first + // of the newly inserted elements. + // + // NOTE: this overload is for iterators that are "input" category. + template * = nullptr> + iterator insert(const_iterator pos, InputIterator first, InputIterator last) { + assert(pos >= begin()); + assert(pos <= end()); + + size_type index = std::distance(cbegin(), pos); + for (size_type i = index; first != last; ++i, static_cast(++first)) { + insert(data() + i, *first); + } + + return iterator(data() + index); + } + + // `InlinedVector::emplace(...)` + // + // Constructs and inserts an element using `args...` in the inlined vector at + // `pos`, returning an `iterator` pointing to the newly emplaced element. + template + iterator emplace(const_iterator pos, Args&&... args) { + assert(pos >= begin()); + assert(pos <= end()); + + value_type dealias(std::forward(args)...); + return storage_.Insert(pos, + IteratorValueAdapter( + MoveIterator(std::addressof(dealias))), + 1); + } + + // `InlinedVector::emplace_back(...)` + // + // Constructs and inserts an element using `args...` in the inlined vector at + // `end()`, returning a `reference` to the newly emplaced element. + template + reference emplace_back(Args&&... args) { + return storage_.EmplaceBack(std::forward(args)...); + } + + // `InlinedVector::push_back(...)` + // + // Inserts a copy of `v` in the inlined vector at `end()`. + void push_back(const_reference v) { static_cast(emplace_back(v)); } + + // Overload of `InlinedVector::push_back(...)` for inserting `v` at `end()` + // using move semantics. + void push_back(RValueReference v) { + static_cast(emplace_back(std::move(v))); + } + + // `InlinedVector::pop_back()` + // + // Destroys the element at `back()`, reducing the size by `1`. + void pop_back() noexcept { + assert(!empty()); + + AllocatorTraits::destroy(*storage_.GetAllocPtr(), data() + (size() - 1)); + storage_.SubtractSize(1); + } + + // `InlinedVector::erase(...)` + // + // Erases the element at `pos`, returning an `iterator` pointing to where the + // erased element was located. + // + // NOTE: may return `end()`, which is not dereferencable. + iterator erase(const_iterator pos) { + assert(pos >= begin()); + assert(pos < end()); + + return storage_.Erase(pos, pos + 1); + } + + // Overload of `InlinedVector::erase(...)` that erases every element in the + // range [`from`, `to`), returning an `iterator` pointing to where the first + // erased element was located. + // + // NOTE: may return `end()`, which is not dereferencable. + iterator erase(const_iterator from, const_iterator to) { + assert(from >= begin()); + assert(from <= to); + assert(to <= end()); + + if (ABSL_PREDICT_TRUE(from != to)) { + return storage_.Erase(from, to); + } else { + return const_cast(from); + } + } + + // `InlinedVector::clear()` + // + // Destroys all elements in the inlined vector, setting the size to `0` and + // deallocating any held memory. + void clear() noexcept { + inlined_vector_internal::DestroyElements(storage_.GetAllocPtr(), data(), + size()); + storage_.DeallocateIfAllocated(); + + storage_.SetInlinedSize(0); + } + + // `InlinedVector::reserve(...)` + // + // Ensures that there is enough room for at least `n` elements. + void reserve(size_type n) { storage_.Reserve(n); } + + // `InlinedVector::shrink_to_fit()` + // + // Reduces memory usage by freeing unused memory. After being called, calls to + // `capacity()` will be equal to `max(N, size())`. + // + // If `size() <= N` and the inlined vector contains allocated memory, the + // elements will all be moved to the inlined space and the allocated memory + // will be deallocated. + // + // If `size() > N` and `size() < capacity()`, the elements will be moved to a + // smaller allocation. + void shrink_to_fit() { + if (storage_.GetIsAllocated()) { + storage_.ShrinkToFit(); + } + } + + // `InlinedVector::swap(...)` + // + // Swaps the contents of the inlined vector with `other`. + void swap(InlinedVector& other) { + if (ABSL_PREDICT_TRUE(this != std::addressof(other))) { + storage_.Swap(std::addressof(other.storage_)); + } + } + + private: + template + friend H AbslHashValue(H h, const absl::InlinedVector& a); + + Storage storage_; +}; + +// ----------------------------------------------------------------------------- +// InlinedVector Non-Member Functions +// ----------------------------------------------------------------------------- + +// `swap(...)` +// +// Swaps the contents of two inlined vectors. +template +void swap(absl::InlinedVector& a, + absl::InlinedVector& b) noexcept(noexcept(a.swap(b))) { + a.swap(b); +} + +// `operator==(...)` +// +// Tests for value-equality of two inlined vectors. +template +bool operator==(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + auto a_data = a.data(); + auto b_data = b.data(); + return absl::equal(a_data, a_data + a.size(), b_data, b_data + b.size()); +} + +// `operator!=(...)` +// +// Tests for value-inequality of two inlined vectors. +template +bool operator!=(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + return !(a == b); +} + +// `operator<(...)` +// +// Tests whether the value of an inlined vector is less than the value of +// another inlined vector using a lexicographical comparison algorithm. +template +bool operator<(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + auto a_data = a.data(); + auto b_data = b.data(); + return std::lexicographical_compare(a_data, a_data + a.size(), b_data, + b_data + b.size()); +} + +// `operator>(...)` +// +// Tests whether the value of an inlined vector is greater than the value of +// another inlined vector using a lexicographical comparison algorithm. +template +bool operator>(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + return b < a; +} + +// `operator<=(...)` +// +// Tests whether the value of an inlined vector is less than or equal to the +// value of another inlined vector using a lexicographical comparison algorithm. +template +bool operator<=(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + return !(b < a); +} + +// `operator>=(...)` +// +// Tests whether the value of an inlined vector is greater than or equal to the +// value of another inlined vector using a lexicographical comparison algorithm. +template +bool operator>=(const absl::InlinedVector& a, + const absl::InlinedVector& b) { + return !(a < b); +} + +// `AbslHashValue(...)` +// +// Provides `absl::Hash` support for `absl::InlinedVector`. It is uncommon to +// call this directly. +template +H AbslHashValue(H h, const absl::InlinedVector& a) { + auto size = a.size(); + return H::combine(H::combine_contiguous(std::move(h), a.data(), size), size); +} + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INLINED_VECTOR_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/common.h b/SaraAttended/Pods/abseil/absl/container/internal/common.h new file mode 100644 index 0000000..5037d80 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/common.h @@ -0,0 +1,202 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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() = default; + 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; + + struct transfer_tag_t {}; + node_handle_base(transfer_tag_t, const allocator_type& a, slot_type* s) + : alloc_(a) { + PolicyTraits::transfer(alloc(), slot(), s); + } + + struct move_tag_t {}; + node_handle_base(move_tag_t, const allocator_type& a, slot_type* s) + : alloc_(a) { + PolicyTraits::construct(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_ = {}; + alignas(slot_type) mutable unsigned char slot_space_[sizeof(slot_type)] = {}; +}; + +// For sets. +template +class node_handle : public node_handle_base { + using Base = 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; + + using Base::Base; +}; + +// For maps. +template +class node_handle> + : public node_handle_base { + using Base = 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; + + using Base::Base; +}; + +// 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 Destroy(Node* node) { + node->destroy(); + } + + template + static void Reset(Node* node) { + node->reset(); + } + + template + static T Transfer(Args&&... args) { + return T(typename T::transfer_tag_t{}, std::forward(args)...); + } + + template + static T Move(Args&&... args) { + return T(typename T::move_tag_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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/compressed_tuple.h b/SaraAttended/Pods/abseil/absl/container/internal/compressed_tuple.h new file mode 100644 index 0000000..4bfe92f --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/compressed_tuple.h @@ -0,0 +1,265 @@ +// 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 + +#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 { +ABSL_NAMESPACE_BEGIN +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 +} + +// We can't use EBCO on other CompressedTuples because that would mean that we +// derive from multiple Storage<> instantiations with the same I parameter, +// and potentially from multiple identical Storage<> instantiations. So anytime +// we use type inheritance rather than encapsulation, we mark +// CompressedTupleImpl, to make this easy to detect. +struct uses_inheritance {}; + +template +constexpr bool ShouldUseBase() { + return std::is_class::value && std::is_empty::value && !IsFinal() && + !std::is_base_of::value; +} + +// 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 ::type>()> +#else + bool UseBase = ShouldUseBase()> +#endif +struct Storage { + T value; + constexpr Storage() = default; + template + explicit constexpr Storage(absl::in_place_t, V&& 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 : T { + constexpr Storage() = default; + + template + explicit constexpr Storage(absl::in_place_t, V&& 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< + CompressedTuple, absl::index_sequence, ShouldAnyUseBase> + // 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 + : uses_inheritance, + Storage::value>... { + constexpr CompressedTupleImpl() = default; + template + explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args) + : Storage(absl::in_place, absl::forward(args))... {} + friend CompressedTuple; +}; + +template +struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl< + CompressedTuple, absl::index_sequence, false> + // We use the dummy identity function as above... + : Storage::value, false>... { + constexpr CompressedTupleImpl() = default; + template + explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args) + : Storage(absl::in_place, absl::forward(args))... {} + friend CompressedTuple; +}; + +std::false_type Or(std::initializer_list); +std::true_type Or(std::initializer_list); + +// MSVC requires this to be done separately rather than within the declaration +// of CompressedTuple below. +template +constexpr bool ShouldAnyUseBase() { + return decltype( + Or({std::integral_constant()>()...})){}; +} + +template +using TupleMoveConstructible = typename std::conditional< + std::is_reference::value, std::is_convertible, + std::is_constructible>::type; + +} // 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. (This +// does not apply when one or more of those empty classes is itself an empty +// CompressedTuple.) +// +// 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, + internal_compressed_tuple::ShouldAnyUseBase()> { + private: + template + using ElemT = internal_compressed_tuple::ElemT; + + template + using StorageT = internal_compressed_tuple::Storage, I>; + + public: + // There seems to be a bug in MSVC dealing in which using '=default' here will + // cause the compiler to ignore the body of other constructors. The work- + // around is to explicitly implement the default constructor. +#if defined(_MSC_VER) + constexpr CompressedTuple() : CompressedTuple::CompressedTupleImpl() {} +#else + constexpr CompressedTuple() = default; +#endif + explicit constexpr CompressedTuple(const Ts&... base) + : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {} + + template ...)>>, + internal_compressed_tuple::TupleMoveConstructible< + Ts, Vs&&>...>::value, + bool> = true> + explicit constexpr CompressedTuple(Vs&&... base) + : CompressedTuple::CompressedTupleImpl(absl::in_place, + absl::forward(base)...) {} + + template + ElemT& get() & { + return internal_compressed_tuple::Storage, I>::get(); + } + + template + constexpr const ElemT& get() const& { + return StorageT::get(); + } + + template + ElemT&& get() && { + return std::move(*this).StorageT::get(); + } + + template + constexpr const ElemT&& get() const&& { + return absl::move(*this).StorageT::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 +ABSL_NAMESPACE_END +} // namespace absl + +#undef ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC + +#endif // ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/container_memory.h b/SaraAttended/Pods/abseil/absl/container/internal/container_memory.h new file mode 100644 index 0000000..d24b0f8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/container_memory.h @@ -0,0 +1,440 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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

at(const key_arg& key) { + auto it = this->find(key); + if (it == this->end()) { + base_internal::ThrowStdOutOfRange( + "absl::container_internal::raw_hash_map<>::at"); + } + return Policy::value(&*it); + } + + template + MappedConstReference

at(const key_arg& key) const { + auto it = this->find(key); + if (it == this->end()) { + base_internal::ThrowStdOutOfRange( + "absl::container_internal::raw_hash_map<>::at"); + } + return Policy::value(&*it); + } + + template + MappedReference

operator[](key_arg&& key) { + return Policy::value(&*try_emplace(std::forward(key)).first); + } + + template + MappedReference

operator[](const key_arg& key) { + return Policy::value(&*try_emplace(key).first); + } + + private: + template + std::pair insert_or_assign_impl(K&& k, V&& v) { + auto res = this->find_or_prepare_insert(k); + if (res.second) + this->emplace_at(res.first, std::forward(k), std::forward(v)); + else + Policy::value(&*this->iterator_at(res.first)) = std::forward(v); + return {this->iterator_at(res.first), res.second}; + } + + template + std::pair try_emplace_impl(K&& k, Args&&... args) { + auto res = this->find_or_prepare_insert(k); + if (res.second) + this->emplace_at(res.first, std::piecewise_construct, + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)); + return {this->iterator_at(res.first), res.second}; + } +}; + +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_RAW_HASH_MAP_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.cc b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.cc new file mode 100644 index 0000000..919ac07 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.cc @@ -0,0 +1,48 @@ +// 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/raw_hash_set.h" + +#include +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace container_internal { + +constexpr size_t Group::kWidth; + +// Returns "random" seed. +inline size_t RandomSeed() { +#if ABSL_HAVE_THREAD_LOCAL + static thread_local size_t counter = 0; + size_t value = ++counter; +#else // ABSL_HAVE_THREAD_LOCAL + static std::atomic counter(0); + size_t value = counter.fetch_add(1, std::memory_order_relaxed); +#endif // ABSL_HAVE_THREAD_LOCAL + return value ^ static_cast(reinterpret_cast(&counter)); +} + +bool ShouldInsertBackwards(size_t hash, ctrl_t* ctrl) { + // To avoid problems with weak hashes and single bit tests, we use % 13. + // TODO(kfm,sbenza): revisit after we do unconditional mixing + return (H1(hash, ctrl) ^ RandomSeed()) % 13 > 6; +} + +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.h b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.h new file mode 100644 index 0000000..ca7be8d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_set.h @@ -0,0 +1,1882 @@ +// 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. +// +// An open-addressing +// hashtable with quadratic probing. +// +// This is a low level hashtable on top of which different interfaces can be +// implemented, like flat_hash_set, node_hash_set, string_hash_set, etc. +// +// The table interface is similar to that of std::unordered_set. Notable +// differences are that most member functions support heterogeneous keys when +// BOTH the hash and eq functions are marked as transparent. They do so by +// providing a typedef called `is_transparent`. +// +// When heterogeneous lookup is enabled, functions that take key_type act as if +// they have an overload set like: +// +// iterator find(const key_type& key); +// template +// iterator find(const K& key); +// +// size_type erase(const key_type& key); +// template +// size_type erase(const K& key); +// +// std::pair equal_range(const key_type& key); +// template +// std::pair equal_range(const K& key); +// +// When heterogeneous lookup is disabled, only the explicit `key_type` overloads +// exist. +// +// find() also supports passing the hash explicitly: +// +// iterator find(const key_type& key, size_t hash); +// template +// iterator find(const U& key, size_t hash); +// +// In addition the pointer to element and iterator stability guarantees are +// weaker: all iterators and pointers are invalidated after a new element is +// inserted. +// +// IMPLEMENTATION DETAILS +// +// The table stores elements inline in a slot array. In addition to the slot +// array the table maintains some control state per slot. The extra state is one +// byte per slot and stores empty or deleted marks, or alternatively 7 bits from +// the hash of an occupied slot. The table is split into logical groups of +// slots, like so: +// +// Group 1 Group 2 Group 3 +// +---------------+---------------+---------------+ +// | | | | | | | | | | | | | | | | | | | | | | | | | +// +---------------+---------------+---------------+ +// +// On lookup the hash is split into two parts: +// - H2: 7 bits (those stored in the control bytes) +// - H1: the rest of the bits +// The groups are probed using H1. For each group the slots are matched to H2 in +// parallel. Because H2 is 7 bits (128 states) and the number of slots per group +// is low (8 or 16) in almost all cases a match in H2 is also a lookup hit. +// +// On insert, once the right group is found (as in lookup), its slots are +// filled in order. +// +// On erase a slot is cleared. In case the group did not have any empty slots +// before the erase, the erased slot is marked as deleted. +// +// Groups without empty slots (but maybe with deleted slots) extend the probe +// sequence. The probing algorithm is quadratic. Given N the number of groups, +// the probing function for the i'th probe is: +// +// P(0) = H1 % N +// +// P(i) = (P(i - 1) + i) % N +// +// This probing function guarantees that after N probes, all the groups of the +// table will be probed exactly once. + +#ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ +#define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/base/internal/bits.h" +#include "absl/base/internal/endian.h" +#include "absl/base/port.h" +#include "absl/container/internal/common.h" +#include "absl/container/internal/compressed_tuple.h" +#include "absl/container/internal/container_memory.h" +#include "absl/container/internal/hash_policy_traits.h" +#include "absl/container/internal/hashtable_debug_hooks.h" +#include "absl/container/internal/hashtablez_sampler.h" +#include "absl/container/internal/have_sse.h" +#include "absl/container/internal/layout.h" +#include "absl/memory/memory.h" +#include "absl/meta/type_traits.h" +#include "absl/utility/utility.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace container_internal { + +template +class probe_seq { + public: + probe_seq(size_t hash, size_t mask) { + assert(((mask + 1) & mask) == 0 && "not a mask"); + mask_ = mask; + offset_ = hash & mask_; + } + size_t offset() const { return offset_; } + size_t offset(size_t i) const { return (offset_ + i) & mask_; } + + void next() { + index_ += Width; + offset_ += index_; + offset_ &= mask_; + } + // 0-based probe index. The i-th probe in the probe sequence. + size_t index() const { return index_; } + + private: + size_t mask_; + size_t offset_; + size_t index_ = 0; +}; + +template +struct RequireUsableKey { + template + std::pair< + decltype(std::declval()(std::declval())), + decltype(std::declval()(std::declval(), + std::declval()))>* + operator()(const PassedKey&, const Args&...) const; +}; + +template +struct IsDecomposable : std::false_type {}; + +template +struct IsDecomposable< + absl::void_t(), + std::declval()...))>, + Policy, Hash, Eq, Ts...> : std::true_type {}; + +// TODO(alkis): Switch to std::is_nothrow_swappable when gcc/clang supports it. +template +constexpr bool IsNoThrowSwappable() { + using std::swap; + return noexcept(swap(std::declval(), std::declval())); +} + +template +int TrailingZeros(T x) { + return sizeof(T) == 8 ? base_internal::CountTrailingZerosNonZero64( + static_cast(x)) + : base_internal::CountTrailingZerosNonZero32( + static_cast(x)); +} + +template +int LeadingZeros(T x) { + return sizeof(T) == 8 + ? base_internal::CountLeadingZeros64(static_cast(x)) + : base_internal::CountLeadingZeros32(static_cast(x)); +} + +// An abstraction over a bitmask. It provides an easy way to iterate through the +// indexes of the set bits of a bitmask. When Shift=0 (platforms with SSE), +// this is a true bitmask. On non-SSE, platforms the arithematic used to +// emulate the SSE behavior works in bytes (Shift=3) and leaves each bytes as +// either 0x00 or 0x80. +// +// For example: +// for (int i : BitMask(0x5)) -> yields 0, 2 +// for (int i : BitMask(0x0000000080800000)) -> yields 2, 3 +template +class BitMask { + static_assert(std::is_unsigned::value, ""); + static_assert(Shift == 0 || Shift == 3, ""); + + public: + // These are useful for unit tests (gunit). + using value_type = int; + using iterator = BitMask; + using const_iterator = BitMask; + + explicit BitMask(T mask) : mask_(mask) {} + BitMask& operator++() { + mask_ &= (mask_ - 1); + return *this; + } + explicit operator bool() const { return mask_ != 0; } + int operator*() const { return LowestBitSet(); } + int LowestBitSet() const { + return container_internal::TrailingZeros(mask_) >> Shift; + } + int HighestBitSet() const { + return (sizeof(T) * CHAR_BIT - container_internal::LeadingZeros(mask_) - + 1) >> + Shift; + } + + BitMask begin() const { return *this; } + BitMask end() const { return BitMask(0); } + + int TrailingZeros() const { + return container_internal::TrailingZeros(mask_) >> Shift; + } + + int LeadingZeros() const { + constexpr int total_significant_bits = SignificantBits << Shift; + constexpr int extra_bits = sizeof(T) * 8 - total_significant_bits; + return container_internal::LeadingZeros(mask_ << extra_bits) >> Shift; + } + + private: + friend bool operator==(const BitMask& a, const BitMask& b) { + return a.mask_ == b.mask_; + } + friend bool operator!=(const BitMask& a, const BitMask& b) { + return a.mask_ != b.mask_; + } + + T mask_; +}; + +using ctrl_t = signed char; +using h2_t = uint8_t; + +// The values here are selected for maximum performance. See the static asserts +// below for details. +enum Ctrl : ctrl_t { + kEmpty = -128, // 0b10000000 + kDeleted = -2, // 0b11111110 + kSentinel = -1, // 0b11111111 +}; +static_assert( + kEmpty & kDeleted & kSentinel & 0x80, + "Special markers need to have the MSB to make checking for them efficient"); +static_assert(kEmpty < kSentinel && kDeleted < kSentinel, + "kEmpty and kDeleted must be smaller than kSentinel to make the " + "SIMD test of IsEmptyOrDeleted() efficient"); +static_assert(kSentinel == -1, + "kSentinel must be -1 to elide loading it from memory into SIMD " + "registers (pcmpeqd xmm, xmm)"); +static_assert(kEmpty == -128, + "kEmpty must be -128 to make the SIMD check for its " + "existence efficient (psignb xmm, xmm)"); +static_assert(~kEmpty & ~kDeleted & kSentinel & 0x7F, + "kEmpty and kDeleted must share an unset bit that is not shared " + "by kSentinel to make the scalar test for MatchEmptyOrDeleted() " + "efficient"); +static_assert(kDeleted == -2, + "kDeleted must be -2 to make the implementation of " + "ConvertSpecialToEmptyAndFullToDeleted efficient"); + +// A single block of empty control bytes for tables without any slots allocated. +// This enables removing a branch in the hot path of find(). +inline ctrl_t* EmptyGroup() { + alignas(16) static constexpr ctrl_t empty_group[] = { + kSentinel, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, + kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty}; + return const_cast(empty_group); +} + +// Mixes a randomly generated per-process seed with `hash` and `ctrl` to +// randomize insertion order within groups. +bool ShouldInsertBackwards(size_t hash, ctrl_t* ctrl); + +// Returns a hash seed. +// +// The seed consists of the ctrl_ pointer, which adds enough entropy to ensure +// non-determinism of iteration order in most cases. +inline size_t HashSeed(const ctrl_t* ctrl) { + // The low bits of the pointer have little or no entropy because of + // alignment. We shift the pointer to try to use higher entropy bits. A + // good number seems to be 12 bits, because that aligns with page size. + return reinterpret_cast(ctrl) >> 12; +} + +inline size_t H1(size_t hash, const ctrl_t* ctrl) { + return (hash >> 7) ^ HashSeed(ctrl); +} +inline ctrl_t H2(size_t hash) { return hash & 0x7F; } + +inline bool IsEmpty(ctrl_t c) { return c == kEmpty; } +inline bool IsFull(ctrl_t c) { return c >= 0; } +inline bool IsDeleted(ctrl_t c) { return c == kDeleted; } +inline bool IsEmptyOrDeleted(ctrl_t c) { return c < kSentinel; } + +#if SWISSTABLE_HAVE_SSE2 + +// https://github.com/abseil/abseil-cpp/issues/209 +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87853 +// _mm_cmpgt_epi8 is broken under GCC with -funsigned-char +// Work around this by using the portable implementation of Group +// when using -funsigned-char under GCC. +inline __m128i _mm_cmpgt_epi8_fixed(__m128i a, __m128i b) { +#if defined(__GNUC__) && !defined(__clang__) + if (std::is_unsigned::value) { + const __m128i mask = _mm_set1_epi8(0x80); + const __m128i diff = _mm_subs_epi8(b, a); + return _mm_cmpeq_epi8(_mm_and_si128(diff, mask), mask); + } +#endif + return _mm_cmpgt_epi8(a, b); +} + +struct GroupSse2Impl { + static constexpr size_t kWidth = 16; // the number of slots per group + + explicit GroupSse2Impl(const ctrl_t* pos) { + ctrl = _mm_loadu_si128(reinterpret_cast(pos)); + } + + // Returns a bitmask representing the positions of slots that match hash. + BitMask Match(h2_t hash) const { + auto match = _mm_set1_epi8(hash); + return BitMask( + _mm_movemask_epi8(_mm_cmpeq_epi8(match, ctrl))); + } + + // Returns a bitmask representing the positions of empty slots. + BitMask MatchEmpty() const { +#if SWISSTABLE_HAVE_SSSE3 + // This only works because kEmpty is -128. + return BitMask( + _mm_movemask_epi8(_mm_sign_epi8(ctrl, ctrl))); +#else + return Match(static_cast(kEmpty)); +#endif + } + + // Returns a bitmask representing the positions of empty or deleted slots. + BitMask MatchEmptyOrDeleted() const { + auto special = _mm_set1_epi8(kSentinel); + return BitMask( + _mm_movemask_epi8(_mm_cmpgt_epi8_fixed(special, ctrl))); + } + + // Returns the number of trailing empty or deleted elements in the group. + uint32_t CountLeadingEmptyOrDeleted() const { + auto special = _mm_set1_epi8(kSentinel); + return TrailingZeros( + _mm_movemask_epi8(_mm_cmpgt_epi8_fixed(special, ctrl)) + 1); + } + + void ConvertSpecialToEmptyAndFullToDeleted(ctrl_t* dst) const { + auto msbs = _mm_set1_epi8(static_cast(-128)); + auto x126 = _mm_set1_epi8(126); +#if SWISSTABLE_HAVE_SSSE3 + auto res = _mm_or_si128(_mm_shuffle_epi8(x126, ctrl), msbs); +#else + auto zero = _mm_setzero_si128(); + auto special_mask = _mm_cmpgt_epi8_fixed(zero, ctrl); + auto res = _mm_or_si128(msbs, _mm_andnot_si128(special_mask, x126)); +#endif + _mm_storeu_si128(reinterpret_cast<__m128i*>(dst), res); + } + + __m128i ctrl; +}; +#endif // SWISSTABLE_HAVE_SSE2 + +struct GroupPortableImpl { + static constexpr size_t kWidth = 8; + + explicit GroupPortableImpl(const ctrl_t* pos) + : ctrl(little_endian::Load64(pos)) {} + + BitMask Match(h2_t hash) const { + // For the technique, see: + // http://graphics.stanford.edu/~seander/bithacks.html##ValueInWord + // (Determine if a word has a byte equal to n). + // + // Caveat: there are false positives but: + // - they only occur if there is a real match + // - they never occur on kEmpty, kDeleted, kSentinel + // - they will be handled gracefully by subsequent checks in code + // + // Example: + // v = 0x1716151413121110 + // hash = 0x12 + // retval = (v - lsbs) & ~v & msbs = 0x0000000080800000 + constexpr uint64_t msbs = 0x8080808080808080ULL; + constexpr uint64_t lsbs = 0x0101010101010101ULL; + auto x = ctrl ^ (lsbs * hash); + return BitMask((x - lsbs) & ~x & msbs); + } + + BitMask MatchEmpty() const { + constexpr uint64_t msbs = 0x8080808080808080ULL; + return BitMask((ctrl & (~ctrl << 6)) & msbs); + } + + BitMask MatchEmptyOrDeleted() const { + constexpr uint64_t msbs = 0x8080808080808080ULL; + return BitMask((ctrl & (~ctrl << 7)) & msbs); + } + + uint32_t CountLeadingEmptyOrDeleted() const { + constexpr uint64_t gaps = 0x00FEFEFEFEFEFEFEULL; + return (TrailingZeros(((~ctrl & (ctrl >> 7)) | gaps) + 1) + 7) >> 3; + } + + void ConvertSpecialToEmptyAndFullToDeleted(ctrl_t* dst) const { + constexpr uint64_t msbs = 0x8080808080808080ULL; + constexpr uint64_t lsbs = 0x0101010101010101ULL; + auto x = ctrl & msbs; + auto res = (~x + (x >> 7)) & ~lsbs; + little_endian::Store64(dst, res); + } + + uint64_t ctrl; +}; + +#if SWISSTABLE_HAVE_SSE2 +using Group = GroupSse2Impl; +#else +using Group = GroupPortableImpl; +#endif + +template +class raw_hash_set; + +inline bool IsValidCapacity(size_t n) { return ((n + 1) & n) == 0 && n > 0; } + +// PRECONDITION: +// IsValidCapacity(capacity) +// ctrl[capacity] == kSentinel +// ctrl[i] != kSentinel for all i < capacity +// Applies mapping for every byte in ctrl: +// DELETED -> EMPTY +// EMPTY -> EMPTY +// FULL -> DELETED +inline void ConvertDeletedToEmptyAndFullToDeleted( + ctrl_t* ctrl, size_t capacity) { + assert(ctrl[capacity] == kSentinel); + assert(IsValidCapacity(capacity)); + for (ctrl_t* pos = ctrl; pos != ctrl + capacity + 1; pos += Group::kWidth) { + Group{pos}.ConvertSpecialToEmptyAndFullToDeleted(pos); + } + // Copy the cloned ctrl bytes. + std::memcpy(ctrl + capacity + 1, ctrl, Group::kWidth); + ctrl[capacity] = kSentinel; +} + +// Rounds up the capacity to the next power of 2 minus 1, with a minimum of 1. +inline size_t NormalizeCapacity(size_t n) { + return n ? ~size_t{} >> LeadingZeros(n) : 1; +} + +// We use 7/8th as maximum load factor. +// For 16-wide groups, that gives an average of two empty slots per group. +inline size_t CapacityToGrowth(size_t capacity) { + assert(IsValidCapacity(capacity)); + // `capacity*7/8` + if (Group::kWidth == 8 && capacity == 7) { + // x-x/8 does not work when x==7. + return 6; + } + return capacity - capacity / 8; +} +// From desired "growth" to a lowerbound of the necessary capacity. +// Might not be a valid one and required NormalizeCapacity(). +inline size_t GrowthToLowerboundCapacity(size_t growth) { + // `growth*8/7` + if (Group::kWidth == 8 && growth == 7) { + // x+(x-1)/7 does not work when x==7. + return 8; + } + return growth + static_cast((static_cast(growth) - 1) / 7); +} + +// Policy: a policy defines how to perform different operations on +// the slots of the hashtable (see hash_policy_traits.h for the full interface +// of policy). +// +// Hash: a (possibly polymorphic) functor that hashes keys of the hashtable. The +// functor should accept a key and return size_t as hash. For best performance +// it is important that the hash function provides high entropy across all bits +// of the hash. +// +// Eq: a (possibly polymorphic) functor that compares two keys for equality. It +// should accept two (of possibly different type) keys and return a bool: true +// if they are equal, false if they are not. If two keys compare equal, then +// their hash values as defined by Hash MUST be equal. +// +// Allocator: an Allocator [https://devdocs.io/cpp/concept/allocator] with which +// the storage of the hashtable will be allocated and the elements will be +// constructed and destroyed. +template +class raw_hash_set { + using PolicyTraits = hash_policy_traits; + using KeyArgImpl = + KeyArg::value && IsTransparent::value>; + + public: + using init_type = typename PolicyTraits::init_type; + using key_type = typename PolicyTraits::key_type; + // TODO(sbenza): Hide slot_type as it is an implementation detail. Needs user + // code fixes! + using slot_type = typename PolicyTraits::slot_type; + using allocator_type = Alloc; + using size_type = size_t; + using difference_type = ptrdiff_t; + using hasher = Hash; + using key_equal = Eq; + using policy_type = Policy; + using value_type = typename PolicyTraits::value_type; + using reference = value_type&; + using const_reference = const value_type&; + using pointer = typename absl::allocator_traits< + allocator_type>::template rebind_traits::pointer; + using const_pointer = typename absl::allocator_traits< + allocator_type>::template rebind_traits::const_pointer; + + // Alias used for heterogeneous lookup functions. + // `key_arg` evaluates to `K` when the functors are transparent and to + // `key_type` otherwise. It permits template argument deduction on `K` for the + // transparent case. + template + using key_arg = typename KeyArgImpl::template type; + + private: + // Give an early error when key_type is not hashable/eq. + auto KeyTypeCanBeHashed(const Hash& h, const key_type& k) -> decltype(h(k)); + auto KeyTypeCanBeEq(const Eq& eq, const key_type& k) -> decltype(eq(k, k)); + + using Layout = absl::container_internal::Layout; + + static Layout MakeLayout(size_t capacity) { + assert(IsValidCapacity(capacity)); + return Layout(capacity + Group::kWidth + 1, capacity); + } + + using AllocTraits = absl::allocator_traits; + using SlotAlloc = typename absl::allocator_traits< + allocator_type>::template rebind_alloc; + using SlotAllocTraits = typename absl::allocator_traits< + allocator_type>::template rebind_traits; + + static_assert(std::is_lvalue_reference::value, + "Policy::element() must return a reference"); + + template + struct SameAsElementReference + : std::is_same::type>::type, + typename std::remove_cv< + typename std::remove_reference::type>::type> {}; + + // An enabler for insert(T&&): T must be convertible to init_type or be the + // same as [cv] value_type [ref]. + // Note: we separate SameAsElementReference into its own type to avoid using + // reference unless we need to. MSVC doesn't seem to like it in some + // cases. + template + using RequiresInsertable = typename std::enable_if< + absl::disjunction, + SameAsElementReference>::value, + int>::type; + + // RequiresNotInit is a workaround for gcc prior to 7.1. + // See https://godbolt.org/g/Y4xsUh. + template + using RequiresNotInit = + typename std::enable_if::value, int>::type; + + template + using IsDecomposable = IsDecomposable; + + public: + static_assert(std::is_same::value, + "Allocators with custom pointer types are not supported"); + static_assert(std::is_same::value, + "Allocators with custom pointer types are not supported"); + + class iterator { + friend class raw_hash_set; + + public: + using iterator_category = std::forward_iterator_tag; + using value_type = typename raw_hash_set::value_type; + using reference = + absl::conditional_t; + using pointer = absl::remove_reference_t*; + using difference_type = typename raw_hash_set::difference_type; + + iterator() {} + + // PRECONDITION: not an end() iterator. + reference operator*() const { + assert_is_full(); + return PolicyTraits::element(slot_); + } + + // PRECONDITION: not an end() iterator. + pointer operator->() const { return &operator*(); } + + // PRECONDITION: not an end() iterator. + iterator& operator++() { + assert_is_full(); + ++ctrl_; + ++slot_; + skip_empty_or_deleted(); + return *this; + } + // PRECONDITION: not an end() iterator. + iterator operator++(int) { + auto tmp = *this; + ++*this; + return tmp; + } + + friend bool operator==(const iterator& a, const iterator& b) { + a.assert_is_valid(); + b.assert_is_valid(); + return a.ctrl_ == b.ctrl_; + } + friend bool operator!=(const iterator& a, const iterator& b) { + return !(a == b); + } + + private: + iterator(ctrl_t* ctrl) : ctrl_(ctrl) {} // for end() + iterator(ctrl_t* ctrl, slot_type* slot) : ctrl_(ctrl), slot_(slot) {} + + void assert_is_full() const { assert(IsFull(*ctrl_)); } + void assert_is_valid() const { + assert(!ctrl_ || IsFull(*ctrl_) || *ctrl_ == kSentinel); + } + + void skip_empty_or_deleted() { + while (IsEmptyOrDeleted(*ctrl_)) { + // ctrl is not necessarily aligned to Group::kWidth. It is also likely + // to read past the space for ctrl bytes and into slots. This is ok + // because ctrl has sizeof() == 1 and slot has sizeof() >= 1 so there + // is no way to read outside the combined slot array. + uint32_t shift = Group{ctrl_}.CountLeadingEmptyOrDeleted(); + ctrl_ += shift; + slot_ += shift; + } + } + + ctrl_t* ctrl_ = nullptr; + // To avoid uninitialized member warnings, put slot_ in an anonymous union. + // The member is not initialized on singleton and end iterators. + union { + slot_type* slot_; + }; + }; + + class const_iterator { + friend class raw_hash_set; + + public: + using iterator_category = typename iterator::iterator_category; + using value_type = typename raw_hash_set::value_type; + using reference = typename raw_hash_set::const_reference; + using pointer = typename raw_hash_set::const_pointer; + using difference_type = typename raw_hash_set::difference_type; + + const_iterator() {} + // Implicit construction from iterator. + const_iterator(iterator i) : inner_(std::move(i)) {} + + reference operator*() const { return *inner_; } + pointer operator->() const { return inner_.operator->(); } + + const_iterator& operator++() { + ++inner_; + return *this; + } + const_iterator operator++(int) { return inner_++; } + + friend bool operator==(const const_iterator& a, const const_iterator& b) { + return a.inner_ == b.inner_; + } + friend bool operator!=(const const_iterator& a, const const_iterator& b) { + return !(a == b); + } + + private: + const_iterator(const ctrl_t* ctrl, const slot_type* slot) + : inner_(const_cast(ctrl), const_cast(slot)) {} + + iterator inner_; + }; + + using node_type = node_handle, Alloc>; + using insert_return_type = InsertReturnType; + + raw_hash_set() noexcept( + std::is_nothrow_default_constructible::value&& + std::is_nothrow_default_constructible::value&& + std::is_nothrow_default_constructible::value) {} + + explicit raw_hash_set(size_t bucket_count, const hasher& hash = hasher(), + const key_equal& eq = key_equal(), + const allocator_type& alloc = allocator_type()) + : ctrl_(EmptyGroup()), settings_(0, hash, eq, alloc) { + if (bucket_count) { + capacity_ = NormalizeCapacity(bucket_count); + reset_growth_left(); + initialize_slots(); + } + } + + raw_hash_set(size_t bucket_count, const hasher& hash, + const allocator_type& alloc) + : raw_hash_set(bucket_count, hash, key_equal(), alloc) {} + + raw_hash_set(size_t bucket_count, const allocator_type& alloc) + : raw_hash_set(bucket_count, hasher(), key_equal(), alloc) {} + + explicit raw_hash_set(const allocator_type& alloc) + : raw_hash_set(0, hasher(), key_equal(), alloc) {} + + template + raw_hash_set(InputIter first, InputIter last, size_t bucket_count = 0, + const hasher& hash = hasher(), const key_equal& eq = key_equal(), + const allocator_type& alloc = allocator_type()) + : raw_hash_set(bucket_count, hash, eq, alloc) { + insert(first, last); + } + + template + raw_hash_set(InputIter first, InputIter last, size_t bucket_count, + const hasher& hash, const allocator_type& alloc) + : raw_hash_set(first, last, bucket_count, hash, key_equal(), alloc) {} + + template + raw_hash_set(InputIter first, InputIter last, size_t bucket_count, + const allocator_type& alloc) + : raw_hash_set(first, last, bucket_count, hasher(), key_equal(), alloc) {} + + template + raw_hash_set(InputIter first, InputIter last, const allocator_type& alloc) + : raw_hash_set(first, last, 0, hasher(), key_equal(), alloc) {} + + // Instead of accepting std::initializer_list as the first + // argument like std::unordered_set does, we have two overloads + // that accept std::initializer_list and std::initializer_list. + // This is advantageous for performance. + // + // // Turns {"abc", "def"} into std::initializer_list, then + // // copies the strings into the set. + // std::unordered_set s = {"abc", "def"}; + // + // // Turns {"abc", "def"} into std::initializer_list, then + // // copies the strings into the set. + // absl::flat_hash_set s = {"abc", "def"}; + // + // The same trick is used in insert(). + // + // The enabler is necessary to prevent this constructor from triggering where + // the copy constructor is meant to be called. + // + // absl::flat_hash_set a, b{a}; + // + // RequiresNotInit is a workaround for gcc prior to 7.1. + template = 0, RequiresInsertable = 0> + raw_hash_set(std::initializer_list init, size_t bucket_count = 0, + const hasher& hash = hasher(), const key_equal& eq = key_equal(), + const allocator_type& alloc = allocator_type()) + : raw_hash_set(init.begin(), init.end(), bucket_count, hash, eq, alloc) {} + + raw_hash_set(std::initializer_list init, size_t bucket_count = 0, + const hasher& hash = hasher(), const key_equal& eq = key_equal(), + const allocator_type& alloc = allocator_type()) + : raw_hash_set(init.begin(), init.end(), bucket_count, hash, eq, alloc) {} + + template = 0, RequiresInsertable = 0> + raw_hash_set(std::initializer_list init, size_t bucket_count, + const hasher& hash, const allocator_type& alloc) + : raw_hash_set(init, bucket_count, hash, key_equal(), alloc) {} + + raw_hash_set(std::initializer_list init, size_t bucket_count, + const hasher& hash, const allocator_type& alloc) + : raw_hash_set(init, bucket_count, hash, key_equal(), alloc) {} + + template = 0, RequiresInsertable = 0> + raw_hash_set(std::initializer_list init, size_t bucket_count, + const allocator_type& alloc) + : raw_hash_set(init, bucket_count, hasher(), key_equal(), alloc) {} + + raw_hash_set(std::initializer_list init, size_t bucket_count, + const allocator_type& alloc) + : raw_hash_set(init, bucket_count, hasher(), key_equal(), alloc) {} + + template = 0, RequiresInsertable = 0> + raw_hash_set(std::initializer_list init, const allocator_type& alloc) + : raw_hash_set(init, 0, hasher(), key_equal(), alloc) {} + + raw_hash_set(std::initializer_list init, + const allocator_type& alloc) + : raw_hash_set(init, 0, hasher(), key_equal(), alloc) {} + + raw_hash_set(const raw_hash_set& that) + : raw_hash_set(that, AllocTraits::select_on_container_copy_construction( + that.alloc_ref())) {} + + raw_hash_set(const raw_hash_set& that, const allocator_type& a) + : raw_hash_set(0, that.hash_ref(), that.eq_ref(), a) { + reserve(that.size()); + // Because the table is guaranteed to be empty, we can do something faster + // than a full `insert`. + for (const auto& v : that) { + const size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, v); + auto target = find_first_non_full(hash); + set_ctrl(target.offset, H2(hash)); + emplace_at(target.offset, v); + infoz_.RecordInsert(hash, target.probe_length); + } + size_ = that.size(); + growth_left() -= that.size(); + } + + raw_hash_set(raw_hash_set&& that) noexcept( + std::is_nothrow_copy_constructible::value&& + std::is_nothrow_copy_constructible::value&& + std::is_nothrow_copy_constructible::value) + : ctrl_(absl::exchange(that.ctrl_, EmptyGroup())), + slots_(absl::exchange(that.slots_, nullptr)), + size_(absl::exchange(that.size_, 0)), + capacity_(absl::exchange(that.capacity_, 0)), + infoz_(absl::exchange(that.infoz_, HashtablezInfoHandle())), + // Hash, equality and allocator are copied instead of moved because + // `that` must be left valid. If Hash is std::function, moving it + // would create a nullptr functor that cannot be called. + settings_(that.settings_) { + // growth_left was copied above, reset the one from `that`. + that.growth_left() = 0; + } + + raw_hash_set(raw_hash_set&& that, const allocator_type& a) + : ctrl_(EmptyGroup()), + slots_(nullptr), + size_(0), + capacity_(0), + settings_(0, that.hash_ref(), that.eq_ref(), a) { + if (a == that.alloc_ref()) { + std::swap(ctrl_, that.ctrl_); + std::swap(slots_, that.slots_); + std::swap(size_, that.size_); + std::swap(capacity_, that.capacity_); + std::swap(growth_left(), that.growth_left()); + std::swap(infoz_, that.infoz_); + } else { + reserve(that.size()); + // Note: this will copy elements of dense_set and unordered_set instead of + // moving them. This can be fixed if it ever becomes an issue. + for (auto& elem : that) insert(std::move(elem)); + } + } + + raw_hash_set& operator=(const raw_hash_set& that) { + raw_hash_set tmp(that, + AllocTraits::propagate_on_container_copy_assignment::value + ? that.alloc_ref() + : alloc_ref()); + swap(tmp); + return *this; + } + + raw_hash_set& operator=(raw_hash_set&& that) noexcept( + absl::allocator_traits::is_always_equal::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_assignable::value) { + // TODO(sbenza): We should only use the operations from the noexcept clause + // to make sure we actually adhere to that contract. + return move_assign( + std::move(that), + typename AllocTraits::propagate_on_container_move_assignment()); + } + + ~raw_hash_set() { destroy_slots(); } + + iterator begin() { + auto it = iterator_at(0); + it.skip_empty_or_deleted(); + return it; + } + iterator end() { return {ctrl_ + capacity_}; } + + const_iterator begin() const { + return const_cast(this)->begin(); + } + const_iterator end() const { return const_cast(this)->end(); } + const_iterator cbegin() const { return begin(); } + const_iterator cend() const { return end(); } + + bool empty() const { return !size(); } + size_t size() const { return size_; } + size_t capacity() const { return capacity_; } + size_t max_size() const { return (std::numeric_limits::max)(); } + + ABSL_ATTRIBUTE_REINITIALIZES void clear() { + // Iterating over this container is O(bucket_count()). When bucket_count() + // is much greater than size(), iteration becomes prohibitively expensive. + // For clear() it is more important to reuse the allocated array when the + // container is small because allocation takes comparatively long time + // compared to destruction of the elements of the container. So we pick the + // largest bucket_count() threshold for which iteration is still fast and + // past that we simply deallocate the array. + if (capacity_ > 127) { + destroy_slots(); + } else if (capacity_) { + for (size_t i = 0; i != capacity_; ++i) { + if (IsFull(ctrl_[i])) { + PolicyTraits::destroy(&alloc_ref(), slots_ + i); + } + } + size_ = 0; + reset_ctrl(); + reset_growth_left(); + } + assert(empty()); + infoz_.RecordStorageChanged(0, capacity_); + } + + // This overload kicks in when the argument is an rvalue of insertable and + // decomposable type other than init_type. + // + // flat_hash_map m; + // m.insert(std::make_pair("abc", 42)); + // TODO(cheshire): A type alias T2 is introduced as a workaround for the nvcc + // bug. + template = 0, + class T2 = T, + typename std::enable_if::value, int>::type = 0, + T* = nullptr> + std::pair insert(T&& value) { + return emplace(std::forward(value)); + } + + // This overload kicks in when the argument is a bitfield or an lvalue of + // insertable and decomposable type. + // + // union { int n : 1; }; + // flat_hash_set s; + // s.insert(n); + // + // flat_hash_set s; + // const char* p = "hello"; + // s.insert(p); + // + // TODO(romanp): Once we stop supporting gcc 5.1 and below, replace + // RequiresInsertable with RequiresInsertable. + // We are hitting this bug: https://godbolt.org/g/1Vht4f. + template < + class T, RequiresInsertable = 0, + typename std::enable_if::value, int>::type = 0> + std::pair insert(const T& value) { + return emplace(value); + } + + // This overload kicks in when the argument is an rvalue of init_type. Its + // purpose is to handle brace-init-list arguments. + // + // flat_hash_map s; + // s.insert({"abc", 42}); + std::pair insert(init_type&& value) { + return emplace(std::move(value)); + } + + // TODO(cheshire): A type alias T2 is introduced as a workaround for the nvcc + // bug. + template = 0, class T2 = T, + typename std::enable_if::value, int>::type = 0, + T* = nullptr> + iterator insert(const_iterator, T&& value) { + return insert(std::forward(value)).first; + } + + // TODO(romanp): Once we stop supporting gcc 5.1 and below, replace + // RequiresInsertable with RequiresInsertable. + // We are hitting this bug: https://godbolt.org/g/1Vht4f. + template < + class T, RequiresInsertable = 0, + typename std::enable_if::value, int>::type = 0> + iterator insert(const_iterator, const T& value) { + return insert(value).first; + } + + iterator insert(const_iterator, init_type&& value) { + return insert(std::move(value)).first; + } + + template + void insert(InputIt first, InputIt last) { + for (; first != last; ++first) insert(*first); + } + + template = 0, RequiresInsertable = 0> + void insert(std::initializer_list ilist) { + insert(ilist.begin(), ilist.end()); + } + + void insert(std::initializer_list ilist) { + insert(ilist.begin(), ilist.end()); + } + + insert_return_type insert(node_type&& node) { + if (!node) return {end(), false, node_type()}; + const auto& elem = PolicyTraits::element(CommonAccess::GetSlot(node)); + auto res = PolicyTraits::apply( + InsertSlot{*this, std::move(*CommonAccess::GetSlot(node))}, + elem); + if (res.second) { + CommonAccess::Reset(&node); + return {res.first, true, node_type()}; + } else { + return {res.first, false, std::move(node)}; + } + } + + iterator insert(const_iterator, node_type&& node) { + return insert(std::move(node)).first; + } + + // This overload kicks in if we can deduce the key from args. This enables us + // to avoid constructing value_type if an entry with the same key already + // exists. + // + // For example: + // + // flat_hash_map m = {{"abc", "def"}}; + // // Creates no std::string copies and makes no heap allocations. + // m.emplace("abc", "xyz"); + template ::value, int>::type = 0> + std::pair emplace(Args&&... args) { + return PolicyTraits::apply(EmplaceDecomposable{*this}, + std::forward(args)...); + } + + // This overload kicks in if we cannot deduce the key from args. It constructs + // value_type unconditionally and then either moves it into the table or + // destroys. + template ::value, int>::type = 0> + std::pair emplace(Args&&... args) { + alignas(slot_type) unsigned char raw[sizeof(slot_type)]; + slot_type* slot = reinterpret_cast(&raw); + + PolicyTraits::construct(&alloc_ref(), slot, std::forward(args)...); + const auto& elem = PolicyTraits::element(slot); + return PolicyTraits::apply(InsertSlot{*this, std::move(*slot)}, elem); + } + + template + iterator emplace_hint(const_iterator, Args&&... args) { + return emplace(std::forward(args)...).first; + } + + // Extension API: support for lazy emplace. + // + // Looks up key in the table. If found, returns the iterator to the element. + // Otherwise calls `f` with one argument of type `raw_hash_set::constructor`. + // + // `f` must abide by several restrictions: + // - it MUST call `raw_hash_set::constructor` with arguments as if a + // `raw_hash_set::value_type` is constructed, + // - it MUST NOT access the container before the call to + // `raw_hash_set::constructor`, and + // - it MUST NOT erase the lazily emplaced element. + // Doing any of these is undefined behavior. + // + // For example: + // + // std::unordered_set s; + // // Makes ArenaStr even if "abc" is in the map. + // s.insert(ArenaString(&arena, "abc")); + // + // flat_hash_set s; + // // Makes ArenaStr only if "abc" is not in the map. + // s.lazy_emplace("abc", [&](const constructor& ctor) { + // ctor(&arena, "abc"); + // }); + // + // WARNING: This API is currently experimental. If there is a way to implement + // the same thing with the rest of the API, prefer that. + class constructor { + friend class raw_hash_set; + + public: + template + void operator()(Args&&... args) const { + assert(*slot_); + PolicyTraits::construct(alloc_, *slot_, std::forward(args)...); + *slot_ = nullptr; + } + + private: + constructor(allocator_type* a, slot_type** slot) : alloc_(a), slot_(slot) {} + + allocator_type* alloc_; + slot_type** slot_; + }; + + template + iterator lazy_emplace(const key_arg& key, F&& f) { + auto res = find_or_prepare_insert(key); + if (res.second) { + slot_type* slot = slots_ + res.first; + std::forward(f)(constructor(&alloc_ref(), &slot)); + assert(!slot); + } + return iterator_at(res.first); + } + + // Extension API: support for heterogeneous keys. + // + // std::unordered_set s; + // // Turns "abc" into std::string. + // s.erase("abc"); + // + // flat_hash_set s; + // // Uses "abc" directly without copying it into std::string. + // s.erase("abc"); + template + size_type erase(const key_arg& key) { + auto it = find(key); + if (it == end()) return 0; + erase(it); + return 1; + } + + // Erases the element pointed to by `it`. Unlike `std::unordered_set::erase`, + // this method returns void to reduce algorithmic complexity to O(1). The + // iterator is invalidated, so any increment should be done before calling + // erase. In order to erase while iterating across a map, use the following + // idiom (which also works for standard containers): + // + // for (auto it = m.begin(), end = m.end(); it != end;) { + // // `erase()` will invalidate `it`, so advance `it` first. + // auto copy_it = it++; + // if () { + // m.erase(copy_it); + // } + // } + void erase(const_iterator cit) { erase(cit.inner_); } + + // This overload is necessary because otherwise erase(const K&) would be + // a better match if non-const iterator is passed as an argument. + void erase(iterator it) { + it.assert_is_full(); + PolicyTraits::destroy(&alloc_ref(), it.slot_); + erase_meta_only(it); + } + + iterator erase(const_iterator first, const_iterator last) { + while (first != last) { + erase(first++); + } + return last.inner_; + } + + // Moves elements from `src` into `this`. + // If the element already exists in `this`, it is left unmodified in `src`. + template + void merge(raw_hash_set& src) { // NOLINT + assert(this != &src); + for (auto it = src.begin(), e = src.end(); it != e;) { + auto next = std::next(it); + if (PolicyTraits::apply(InsertSlot{*this, std::move(*it.slot_)}, + PolicyTraits::element(it.slot_)) + .second) { + src.erase_meta_only(it); + } + it = next; + } + } + + template + void merge(raw_hash_set&& src) { + merge(src); + } + + node_type extract(const_iterator position) { + position.inner_.assert_is_full(); + auto node = + CommonAccess::Transfer(alloc_ref(), position.inner_.slot_); + erase_meta_only(position); + return node; + } + + template < + class K = key_type, + typename std::enable_if::value, int>::type = 0> + node_type extract(const key_arg& key) { + auto it = find(key); + return it == end() ? node_type() : extract(const_iterator{it}); + } + + void swap(raw_hash_set& that) noexcept( + IsNoThrowSwappable() && IsNoThrowSwappable() && + (!AllocTraits::propagate_on_container_swap::value || + IsNoThrowSwappable())) { + using std::swap; + swap(ctrl_, that.ctrl_); + swap(slots_, that.slots_); + swap(size_, that.size_); + swap(capacity_, that.capacity_); + swap(growth_left(), that.growth_left()); + swap(hash_ref(), that.hash_ref()); + swap(eq_ref(), that.eq_ref()); + swap(infoz_, that.infoz_); + if (AllocTraits::propagate_on_container_swap::value) { + swap(alloc_ref(), that.alloc_ref()); + } else { + // If the allocators do not compare equal it is officially undefined + // behavior. We choose to do nothing. + } + } + + void rehash(size_t n) { + if (n == 0 && capacity_ == 0) return; + if (n == 0 && size_ == 0) { + destroy_slots(); + infoz_.RecordStorageChanged(0, 0); + return; + } + // bitor is a faster way of doing `max` here. We will round up to the next + // power-of-2-minus-1, so bitor is good enough. + auto m = NormalizeCapacity(n | GrowthToLowerboundCapacity(size())); + // n == 0 unconditionally rehashes as per the standard. + if (n == 0 || m > capacity_) { + resize(m); + } + } + + void reserve(size_t n) { rehash(GrowthToLowerboundCapacity(n)); } + + // Extension API: support for heterogeneous keys. + // + // std::unordered_set s; + // // Turns "abc" into std::string. + // s.count("abc"); + // + // ch_set s; + // // Uses "abc" directly without copying it into std::string. + // s.count("abc"); + template + size_t count(const key_arg& key) const { + return find(key) == end() ? 0 : 1; + } + + // Issues CPU prefetch instructions for the memory needed to find or insert + // a key. Like all lookup functions, this support heterogeneous keys. + // + // NOTE: This is a very low level operation and should not be used without + // specific benchmarks indicating its importance. + template + void prefetch(const key_arg& key) const { + (void)key; +#if defined(__GNUC__) + auto seq = probe(hash_ref()(key)); + __builtin_prefetch(static_cast(ctrl_ + seq.offset())); + __builtin_prefetch(static_cast(slots_ + seq.offset())); +#endif // __GNUC__ + } + + // The API of find() has two extensions. + // + // 1. The hash can be passed by the user. It must be equal to the hash of the + // key. + // + // 2. The type of the key argument doesn't have to be key_type. This is so + // called heterogeneous key support. + template + iterator find(const key_arg& key, size_t hash) { + auto seq = probe(hash); + while (true) { + Group g{ctrl_ + seq.offset()}; + for (int i : g.Match(H2(hash))) { + if (ABSL_PREDICT_TRUE(PolicyTraits::apply( + EqualElement{key, eq_ref()}, + PolicyTraits::element(slots_ + seq.offset(i))))) + return iterator_at(seq.offset(i)); + } + if (ABSL_PREDICT_TRUE(g.MatchEmpty())) return end(); + seq.next(); + } + } + template + iterator find(const key_arg& key) { + return find(key, hash_ref()(key)); + } + + template + const_iterator find(const key_arg& key, size_t hash) const { + return const_cast(this)->find(key, hash); + } + template + const_iterator find(const key_arg& key) const { + return find(key, hash_ref()(key)); + } + + template + bool contains(const key_arg& key) const { + return find(key) != end(); + } + + template + std::pair equal_range(const key_arg& key) { + auto it = find(key); + if (it != end()) return {it, std::next(it)}; + return {it, it}; + } + template + std::pair equal_range( + const key_arg& key) const { + auto it = find(key); + if (it != end()) return {it, std::next(it)}; + return {it, it}; + } + + size_t bucket_count() const { return capacity_; } + float load_factor() const { + return capacity_ ? static_cast(size()) / capacity_ : 0.0; + } + float max_load_factor() const { return 1.0f; } + void max_load_factor(float) { + // Does nothing. + } + + hasher hash_function() const { return hash_ref(); } + key_equal key_eq() const { return eq_ref(); } + allocator_type get_allocator() const { return alloc_ref(); } + + friend bool operator==(const raw_hash_set& a, const raw_hash_set& b) { + if (a.size() != b.size()) return false; + const raw_hash_set* outer = &a; + const raw_hash_set* inner = &b; + if (outer->capacity() > inner->capacity()) std::swap(outer, inner); + for (const value_type& elem : *outer) + if (!inner->has_element(elem)) return false; + return true; + } + + friend bool operator!=(const raw_hash_set& a, const raw_hash_set& b) { + return !(a == b); + } + + friend void swap(raw_hash_set& a, + raw_hash_set& b) noexcept(noexcept(a.swap(b))) { + a.swap(b); + } + + private: + template + friend struct absl::container_internal::hashtable_debug_internal:: + HashtableDebugAccess; + + struct FindElement { + template + const_iterator operator()(const K& key, Args&&...) const { + return s.find(key); + } + const raw_hash_set& s; + }; + + struct HashElement { + template + size_t operator()(const K& key, Args&&...) const { + return h(key); + } + const hasher& h; + }; + + template + struct EqualElement { + template + bool operator()(const K2& lhs, Args&&...) const { + return eq(lhs, rhs); + } + const K1& rhs; + const key_equal& eq; + }; + + struct EmplaceDecomposable { + template + std::pair operator()(const K& key, Args&&... args) const { + auto res = s.find_or_prepare_insert(key); + if (res.second) { + s.emplace_at(res.first, std::forward(args)...); + } + return {s.iterator_at(res.first), res.second}; + } + raw_hash_set& s; + }; + + template + struct InsertSlot { + template + std::pair operator()(const K& key, Args&&...) && { + auto res = s.find_or_prepare_insert(key); + if (res.second) { + PolicyTraits::transfer(&s.alloc_ref(), s.slots_ + res.first, &slot); + } else if (do_destroy) { + PolicyTraits::destroy(&s.alloc_ref(), &slot); + } + return {s.iterator_at(res.first), res.second}; + } + raw_hash_set& s; + // Constructed slot. Either moved into place or destroyed. + slot_type&& slot; + }; + + // "erases" the object from the container, except that it doesn't actually + // destroy the object. It only updates all the metadata of the class. + // This can be used in conjunction with Policy::transfer to move the object to + // another place. + void erase_meta_only(const_iterator it) { + assert(IsFull(*it.inner_.ctrl_) && "erasing a dangling iterator"); + --size_; + const size_t index = it.inner_.ctrl_ - ctrl_; + const size_t index_before = (index - Group::kWidth) & capacity_; + const auto empty_after = Group(it.inner_.ctrl_).MatchEmpty(); + const auto empty_before = Group(ctrl_ + index_before).MatchEmpty(); + + // We count how many consecutive non empties we have to the right and to the + // left of `it`. If the sum is >= kWidth then there is at least one probe + // window that might have seen a full group. + bool was_never_full = + empty_before && empty_after && + static_cast(empty_after.TrailingZeros() + + empty_before.LeadingZeros()) < Group::kWidth; + + set_ctrl(index, was_never_full ? kEmpty : kDeleted); + growth_left() += was_never_full; + infoz_.RecordErase(); + } + + void initialize_slots() { + assert(capacity_); + // Folks with custom allocators often make unwarranted assumptions about the + // behavior of their classes vis-a-vis trivial destructability and what + // calls they will or wont make. Avoid sampling for people with custom + // allocators to get us out of this mess. This is not a hard guarantee but + // a workaround while we plan the exact guarantee we want to provide. + // + // People are often sloppy with the exact type of their allocator (sometimes + // it has an extra const or is missing the pair, but rebinds made it work + // anyway). To avoid the ambiguity, we work off SlotAlloc which we have + // bound more carefully. + if (std::is_same>::value && + slots_ == nullptr) { + infoz_ = Sample(); + } + + auto layout = MakeLayout(capacity_); + char* mem = static_cast( + Allocate(&alloc_ref(), layout.AllocSize())); + ctrl_ = reinterpret_cast(layout.template Pointer<0>(mem)); + slots_ = layout.template Pointer<1>(mem); + reset_ctrl(); + reset_growth_left(); + infoz_.RecordStorageChanged(size_, capacity_); + } + + void destroy_slots() { + if (!capacity_) return; + for (size_t i = 0; i != capacity_; ++i) { + if (IsFull(ctrl_[i])) { + PolicyTraits::destroy(&alloc_ref(), slots_ + i); + } + } + auto layout = MakeLayout(capacity_); + // Unpoison before returning the memory to the allocator. + SanitizerUnpoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_); + Deallocate(&alloc_ref(), ctrl_, layout.AllocSize()); + ctrl_ = EmptyGroup(); + slots_ = nullptr; + size_ = 0; + capacity_ = 0; + growth_left() = 0; + } + + void resize(size_t new_capacity) { + assert(IsValidCapacity(new_capacity)); + auto* old_ctrl = ctrl_; + auto* old_slots = slots_; + const size_t old_capacity = capacity_; + capacity_ = new_capacity; + initialize_slots(); + + size_t total_probe_length = 0; + for (size_t i = 0; i != old_capacity; ++i) { + if (IsFull(old_ctrl[i])) { + size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, + PolicyTraits::element(old_slots + i)); + auto target = find_first_non_full(hash); + size_t new_i = target.offset; + total_probe_length += target.probe_length; + set_ctrl(new_i, H2(hash)); + PolicyTraits::transfer(&alloc_ref(), slots_ + new_i, old_slots + i); + } + } + if (old_capacity) { + SanitizerUnpoisonMemoryRegion(old_slots, + sizeof(slot_type) * old_capacity); + auto layout = MakeLayout(old_capacity); + Deallocate(&alloc_ref(), old_ctrl, + layout.AllocSize()); + } + infoz_.RecordRehash(total_probe_length); + } + + void drop_deletes_without_resize() ABSL_ATTRIBUTE_NOINLINE { + assert(IsValidCapacity(capacity_)); + assert(!is_small()); + // Algorithm: + // - mark all DELETED slots as EMPTY + // - mark all FULL slots as DELETED + // - for each slot marked as DELETED + // hash = Hash(element) + // target = find_first_non_full(hash) + // if target is in the same group + // mark slot as FULL + // else if target is EMPTY + // transfer element to target + // mark slot as EMPTY + // mark target as FULL + // else if target is DELETED + // swap current element with target element + // mark target as FULL + // repeat procedure for current slot with moved from element (target) + ConvertDeletedToEmptyAndFullToDeleted(ctrl_, capacity_); + alignas(slot_type) unsigned char raw[sizeof(slot_type)]; + size_t total_probe_length = 0; + slot_type* slot = reinterpret_cast(&raw); + for (size_t i = 0; i != capacity_; ++i) { + if (!IsDeleted(ctrl_[i])) continue; + size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, + PolicyTraits::element(slots_ + i)); + auto target = find_first_non_full(hash); + size_t new_i = target.offset; + total_probe_length += target.probe_length; + + // Verify if the old and new i fall within the same group wrt the hash. + // If they do, we don't need to move the object as it falls already in the + // best probe we can. + const auto probe_index = [&](size_t pos) { + return ((pos - probe(hash).offset()) & capacity_) / Group::kWidth; + }; + + // Element doesn't move. + if (ABSL_PREDICT_TRUE(probe_index(new_i) == probe_index(i))) { + set_ctrl(i, H2(hash)); + continue; + } + if (IsEmpty(ctrl_[new_i])) { + // Transfer element to the empty spot. + // set_ctrl poisons/unpoisons the slots so we have to call it at the + // right time. + set_ctrl(new_i, H2(hash)); + PolicyTraits::transfer(&alloc_ref(), slots_ + new_i, slots_ + i); + set_ctrl(i, kEmpty); + } else { + assert(IsDeleted(ctrl_[new_i])); + set_ctrl(new_i, H2(hash)); + // Until we are done rehashing, DELETED marks previously FULL slots. + // Swap i and new_i elements. + PolicyTraits::transfer(&alloc_ref(), slot, slots_ + i); + PolicyTraits::transfer(&alloc_ref(), slots_ + i, slots_ + new_i); + PolicyTraits::transfer(&alloc_ref(), slots_ + new_i, slot); + --i; // repeat + } + } + reset_growth_left(); + infoz_.RecordRehash(total_probe_length); + } + + void rehash_and_grow_if_necessary() { + if (capacity_ == 0) { + resize(1); + } else if (size() <= CapacityToGrowth(capacity()) / 2) { + // Squash DELETED without growing if there is enough capacity. + drop_deletes_without_resize(); + } else { + // Otherwise grow the container. + resize(capacity_ * 2 + 1); + } + } + + bool has_element(const value_type& elem) const { + size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, elem); + auto seq = probe(hash); + while (true) { + Group g{ctrl_ + seq.offset()}; + for (int i : g.Match(H2(hash))) { + if (ABSL_PREDICT_TRUE(PolicyTraits::element(slots_ + seq.offset(i)) == + elem)) + return true; + } + if (ABSL_PREDICT_TRUE(g.MatchEmpty())) return false; + seq.next(); + assert(seq.index() < capacity_ && "full table!"); + } + return false; + } + + // Probes the raw_hash_set with the probe sequence for hash and returns the + // pointer to the first empty or deleted slot. + // NOTE: this function must work with tables having both kEmpty and kDelete + // in one group. Such tables appears during drop_deletes_without_resize. + // + // This function is very useful when insertions happen and: + // - the input is already a set + // - there are enough slots + // - the element with the hash is not in the table + struct FindInfo { + size_t offset; + size_t probe_length; + }; + FindInfo find_first_non_full(size_t hash) { + auto seq = probe(hash); + while (true) { + Group g{ctrl_ + seq.offset()}; + auto mask = g.MatchEmptyOrDeleted(); + if (mask) { +#if !defined(NDEBUG) + // We want to add entropy even when ASLR is not enabled. + // In debug build we will randomly insert in either the front or back of + // the group. + // TODO(kfm,sbenza): revisit after we do unconditional mixing + if (!is_small() && ShouldInsertBackwards(hash, ctrl_)) { + return {seq.offset(mask.HighestBitSet()), seq.index()}; + } +#endif + return {seq.offset(mask.LowestBitSet()), seq.index()}; + } + assert(seq.index() < capacity_ && "full table!"); + seq.next(); + } + } + + // TODO(alkis): Optimize this assuming *this and that don't overlap. + raw_hash_set& move_assign(raw_hash_set&& that, std::true_type) { + raw_hash_set tmp(std::move(that)); + swap(tmp); + return *this; + } + raw_hash_set& move_assign(raw_hash_set&& that, std::false_type) { + raw_hash_set tmp(std::move(that), alloc_ref()); + swap(tmp); + return *this; + } + + protected: + template + std::pair find_or_prepare_insert(const K& key) { + auto hash = hash_ref()(key); + auto seq = probe(hash); + while (true) { + Group g{ctrl_ + seq.offset()}; + for (int i : g.Match(H2(hash))) { + if (ABSL_PREDICT_TRUE(PolicyTraits::apply( + EqualElement{key, eq_ref()}, + PolicyTraits::element(slots_ + seq.offset(i))))) + return {seq.offset(i), false}; + } + if (ABSL_PREDICT_TRUE(g.MatchEmpty())) break; + seq.next(); + } + return {prepare_insert(hash), true}; + } + + size_t prepare_insert(size_t hash) ABSL_ATTRIBUTE_NOINLINE { + auto target = find_first_non_full(hash); + if (ABSL_PREDICT_FALSE(growth_left() == 0 && + !IsDeleted(ctrl_[target.offset]))) { + rehash_and_grow_if_necessary(); + target = find_first_non_full(hash); + } + ++size_; + growth_left() -= IsEmpty(ctrl_[target.offset]); + set_ctrl(target.offset, H2(hash)); + infoz_.RecordInsert(hash, target.probe_length); + return target.offset; + } + + // Constructs the value in the space pointed by the iterator. This only works + // after an unsuccessful find_or_prepare_insert() and before any other + // modifications happen in the raw_hash_set. + // + // PRECONDITION: i is an index returned from find_or_prepare_insert(k), where + // k is the key decomposed from `forward(args)...`, and the bool + // returned by find_or_prepare_insert(k) was true. + // POSTCONDITION: *m.iterator_at(i) == value_type(forward(args)...). + template + void emplace_at(size_t i, Args&&... args) { + PolicyTraits::construct(&alloc_ref(), slots_ + i, + std::forward(args)...); + + assert(PolicyTraits::apply(FindElement{*this}, *iterator_at(i)) == + iterator_at(i) && + "constructed value does not match the lookup key"); + } + + iterator iterator_at(size_t i) { return {ctrl_ + i, slots_ + i}; } + const_iterator iterator_at(size_t i) const { return {ctrl_ + i, slots_ + i}; } + + private: + friend struct RawHashSetTestOnlyAccess; + + probe_seq probe(size_t hash) const { + return probe_seq(H1(hash, ctrl_), capacity_); + } + + // Reset all ctrl bytes back to kEmpty, except the sentinel. + void reset_ctrl() { + std::memset(ctrl_, kEmpty, capacity_ + Group::kWidth); + ctrl_[capacity_] = kSentinel; + SanitizerPoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_); + } + + void reset_growth_left() { + growth_left() = CapacityToGrowth(capacity()) - size_; + } + + // Sets the control byte, and if `i < Group::kWidth`, set the cloned byte at + // the end too. + void set_ctrl(size_t i, ctrl_t h) { + assert(i < capacity_); + + if (IsFull(h)) { + SanitizerUnpoisonObject(slots_ + i); + } else { + SanitizerPoisonObject(slots_ + i); + } + + ctrl_[i] = h; + ctrl_[((i - Group::kWidth) & capacity_) + 1 + + ((Group::kWidth - 1) & capacity_)] = h; + } + + size_t& growth_left() { return settings_.template get<0>(); } + + // The representation of the object has two modes: + // - small: For capacities < kWidth-1 + // - large: For the rest. + // + // Differences: + // - In small mode we are able to use the whole capacity. The extra control + // bytes give us at least one "empty" control byte to stop the iteration. + // This is important to make 1 a valid capacity. + // + // - In small mode only the first `capacity()` control bytes after the + // sentinel are valid. The rest contain dummy kEmpty values that do not + // represent a real slot. This is important to take into account on + // find_first_non_full(), where we never try ShouldInsertBackwards() for + // small tables. + bool is_small() const { return capacity_ < Group::kWidth - 1; } + + hasher& hash_ref() { return settings_.template get<1>(); } + const hasher& hash_ref() const { return settings_.template get<1>(); } + key_equal& eq_ref() { return settings_.template get<2>(); } + const key_equal& eq_ref() const { return settings_.template get<2>(); } + allocator_type& alloc_ref() { return settings_.template get<3>(); } + const allocator_type& alloc_ref() const { + return settings_.template get<3>(); + } + + // TODO(alkis): Investigate removing some of these fields: + // - ctrl/slots can be derived from each other + // - size can be moved into the slot array + ctrl_t* ctrl_ = EmptyGroup(); // [(capacity + 1) * ctrl_t] + slot_type* slots_ = nullptr; // [capacity * slot_type] + size_t size_ = 0; // number of full slots + size_t capacity_ = 0; // total number of slots + HashtablezInfoHandle infoz_; + absl::container_internal::CompressedTuple + settings_{0, hasher{}, key_equal{}, allocator_type{}}; +}; + +// Erases all elements that satisfy the predicate `pred` from the container `c`. +template +void EraseIf(Predicate pred, raw_hash_set* c) { + for (auto it = c->begin(), last = c->end(); it != last;) { + auto copy_it = it++; + if (pred(*copy_it)) { + c->erase(copy_it); + } + } +} + +namespace hashtable_debug_internal { +template +struct HashtableDebugAccess> { + using Traits = typename Set::PolicyTraits; + using Slot = typename Traits::slot_type; + + static size_t GetNumProbes(const Set& set, + const typename Set::key_type& key) { + size_t num_probes = 0; + size_t hash = set.hash_ref()(key); + auto seq = set.probe(hash); + while (true) { + container_internal::Group g{set.ctrl_ + seq.offset()}; + for (int i : g.Match(container_internal::H2(hash))) { + if (Traits::apply( + typename Set::template EqualElement{ + key, set.eq_ref()}, + Traits::element(set.slots_ + seq.offset(i)))) + return num_probes; + ++num_probes; + } + if (g.MatchEmpty()) return num_probes; + seq.next(); + ++num_probes; + } + } + + static size_t AllocatedByteSize(const Set& c) { + size_t capacity = c.capacity_; + if (capacity == 0) return 0; + auto layout = Set::MakeLayout(capacity); + size_t m = layout.AllocSize(); + + size_t per_slot = Traits::space_used(static_cast(nullptr)); + if (per_slot != ~size_t{}) { + m += per_slot * c.size(); + } else { + for (size_t i = 0; i != capacity; ++i) { + if (container_internal::IsFull(c.ctrl_[i])) { + m += Traits::space_used(c.slots_ + i); + } + } + } + return m; + } + + static size_t LowerBoundAllocatedByteSize(size_t size) { + size_t capacity = GrowthToLowerboundCapacity(size); + if (capacity == 0) return 0; + auto layout = Set::MakeLayout(NormalizeCapacity(capacity)); + size_t m = layout.AllocSize(); + size_t per_slot = Traits::space_used(static_cast(nullptr)); + if (per_slot != ~size_t{}) { + m += per_slot * size; + } + return m; + } +}; + +} // namespace hashtable_debug_internal +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.cc b/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.cc new file mode 100644 index 0000000..6537606 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.cc @@ -0,0 +1,138 @@ +// 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. + +// base::AddressIsReadable() probes an address to see whether it is readable, +// without faulting. + +#include "absl/debugging/internal/address_is_readable.h" + +#if !defined(__linux__) || defined(__ANDROID__) + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// On platforms other than Linux, just return true. +bool AddressIsReadable(const void* /* addr */) { return true; } + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#else + +#include +#include +#include + +#include +#include +#include + +#include "absl/base/internal/errno_saver.h" +#include "absl/base/internal/raw_logging.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// Pack a pid and two file descriptors into a 64-bit word, +// using 16, 24, and 24 bits for each respectively. +static uint64_t Pack(uint64_t pid, uint64_t read_fd, uint64_t write_fd) { + ABSL_RAW_CHECK((read_fd >> 24) == 0 && (write_fd >> 24) == 0, + "fd out of range"); + return (pid << 48) | ((read_fd & 0xffffff) << 24) | (write_fd & 0xffffff); +} + +// Unpack x into a pid and two file descriptors, where x was created with +// Pack(). +static void Unpack(uint64_t x, int *pid, int *read_fd, int *write_fd) { + *pid = x >> 48; + *read_fd = (x >> 24) & 0xffffff; + *write_fd = x & 0xffffff; +} + +// Return whether the byte at *addr is readable, without faulting. +// Save and restores errno. Returns true on systems where +// unimplemented. +// This is a namespace-scoped variable for correct zero-initialization. +static std::atomic pid_and_fds; // initially 0, an invalid pid. +bool AddressIsReadable(const void *addr) { + absl::base_internal::ErrnoSaver errno_saver; + // We test whether a byte is readable by using write(). Normally, this would + // be done via a cached file descriptor to /dev/null, but linux fails to + // check whether the byte is readable when the destination is /dev/null, so + // we use a cached pipe. We store the pid of the process that created the + // pipe to handle the case where a process forks, and the child closes all + // the file descriptors and then calls this routine. This is not perfect: + // the child could use the routine, then close all file descriptors and then + // use this routine again. But the likely use of this routine is when + // crashing, to test the validity of pages when dumping the stack. Beware + // that we may leak file descriptors, but we're unlikely to leak many. + int bytes_written; + int current_pid = getpid() & 0xffff; // we use only the low order 16 bits + do { // until we do not get EBADF trying to use file descriptors + int pid; + int read_fd; + int write_fd; + uint64_t local_pid_and_fds = pid_and_fds.load(std::memory_order_relaxed); + Unpack(local_pid_and_fds, &pid, &read_fd, &write_fd); + while (current_pid != pid) { + int p[2]; + // new pipe + if (pipe(p) != 0) { + ABSL_RAW_LOG(FATAL, "Failed to create pipe, errno=%d", errno); + } + fcntl(p[0], F_SETFD, FD_CLOEXEC); + fcntl(p[1], F_SETFD, FD_CLOEXEC); + uint64_t new_pid_and_fds = Pack(current_pid, p[0], p[1]); + if (pid_and_fds.compare_exchange_strong( + local_pid_and_fds, new_pid_and_fds, std::memory_order_relaxed, + std::memory_order_relaxed)) { + local_pid_and_fds = new_pid_and_fds; // fds exposed to other threads + } else { // fds not exposed to other threads; we can close them. + close(p[0]); + close(p[1]); + local_pid_and_fds = pid_and_fds.load(std::memory_order_relaxed); + } + Unpack(local_pid_and_fds, &pid, &read_fd, &write_fd); + } + errno = 0; + // Use syscall(SYS_write, ...) instead of write() to prevent ASAN + // and other checkers from complaining about accesses to arbitrary + // memory. + do { + bytes_written = syscall(SYS_write, write_fd, addr, 1); + } while (bytes_written == -1 && errno == EINTR); + if (bytes_written == 1) { // remove the byte from the pipe + char c; + while (read(read_fd, &c, 1) == -1 && errno == EINTR) { + } + } + if (errno == EBADF) { // Descriptors invalid. + // If pid_and_fds contains the problematic file descriptors we just used, + // this call will forget them, and the loop will try again. + pid_and_fds.compare_exchange_strong(local_pid_and_fds, 0, + std::memory_order_relaxed, + std::memory_order_relaxed); + } + } while (errno == EBADF); + return bytes_written == 1; +} + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.h b/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.h new file mode 100644 index 0000000..4bbaf4d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/address_is_readable.h @@ -0,0 +1,32 @@ +// 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_DEBUGGING_INTERNAL_ADDRESS_IS_READABLE_H_ +#define ABSL_DEBUGGING_INTERNAL_ADDRESS_IS_READABLE_H_ + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// Return whether the byte at *addr is readable, without faulting. +// Save and restores errno. +bool AddressIsReadable(const void *addr); + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_ADDRESS_IS_READABLE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.cc b/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.cc new file mode 100644 index 0000000..fc615c3 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.cc @@ -0,0 +1,1895 @@ +// 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. + +// For reference check out: +// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling +// +// Note that we only have partial C++11 support yet. + +#include "absl/debugging/internal/demangle.h" + +#include +#include +#include + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +typedef struct { + const char *abbrev; + const char *real_name; + // Number of arguments in context, or 0 if disallowed. + int arity; +} AbbrevPair; + +// List of operators from Itanium C++ ABI. +static const AbbrevPair kOperatorList[] = { + // New has special syntax (not currently supported). + {"nw", "new", 0}, + {"na", "new[]", 0}, + + // Works except that the 'gs' prefix is not supported. + {"dl", "delete", 1}, + {"da", "delete[]", 1}, + + {"ps", "+", 1}, // "positive" + {"ng", "-", 1}, // "negative" + {"ad", "&", 1}, // "address-of" + {"de", "*", 1}, // "dereference" + {"co", "~", 1}, + + {"pl", "+", 2}, + {"mi", "-", 2}, + {"ml", "*", 2}, + {"dv", "/", 2}, + {"rm", "%", 2}, + {"an", "&", 2}, + {"or", "|", 2}, + {"eo", "^", 2}, + {"aS", "=", 2}, + {"pL", "+=", 2}, + {"mI", "-=", 2}, + {"mL", "*=", 2}, + {"dV", "/=", 2}, + {"rM", "%=", 2}, + {"aN", "&=", 2}, + {"oR", "|=", 2}, + {"eO", "^=", 2}, + {"ls", "<<", 2}, + {"rs", ">>", 2}, + {"lS", "<<=", 2}, + {"rS", ">>=", 2}, + {"eq", "==", 2}, + {"ne", "!=", 2}, + {"lt", "<", 2}, + {"gt", ">", 2}, + {"le", "<=", 2}, + {"ge", ">=", 2}, + {"nt", "!", 1}, + {"aa", "&&", 2}, + {"oo", "||", 2}, + {"pp", "++", 1}, + {"mm", "--", 1}, + {"cm", ",", 2}, + {"pm", "->*", 2}, + {"pt", "->", 0}, // Special syntax + {"cl", "()", 0}, // Special syntax + {"ix", "[]", 2}, + {"qu", "?", 3}, + {"st", "sizeof", 0}, // Special syntax + {"sz", "sizeof", 1}, // Not a real operator name, but used in expressions. + {nullptr, nullptr, 0}, +}; + +// List of builtin types from Itanium C++ ABI. +// +// Invariant: only one- or two-character type abbreviations here. +static const AbbrevPair kBuiltinTypeList[] = { + {"v", "void", 0}, + {"w", "wchar_t", 0}, + {"b", "bool", 0}, + {"c", "char", 0}, + {"a", "signed char", 0}, + {"h", "unsigned char", 0}, + {"s", "short", 0}, + {"t", "unsigned short", 0}, + {"i", "int", 0}, + {"j", "unsigned int", 0}, + {"l", "long", 0}, + {"m", "unsigned long", 0}, + {"x", "long long", 0}, + {"y", "unsigned long long", 0}, + {"n", "__int128", 0}, + {"o", "unsigned __int128", 0}, + {"f", "float", 0}, + {"d", "double", 0}, + {"e", "long double", 0}, + {"g", "__float128", 0}, + {"z", "ellipsis", 0}, + + {"De", "decimal128", 0}, // IEEE 754r decimal floating point (128 bits) + {"Dd", "decimal64", 0}, // IEEE 754r decimal floating point (64 bits) + {"Dc", "decltype(auto)", 0}, + {"Da", "auto", 0}, + {"Dn", "std::nullptr_t", 0}, // i.e., decltype(nullptr) + {"Df", "decimal32", 0}, // IEEE 754r decimal floating point (32 bits) + {"Di", "char32_t", 0}, + {"Ds", "char16_t", 0}, + {"Dh", "float16", 0}, // IEEE 754r half-precision float (16 bits) + {nullptr, nullptr, 0}, +}; + +// List of substitutions Itanium C++ ABI. +static const AbbrevPair kSubstitutionList[] = { + {"St", "", 0}, + {"Sa", "allocator", 0}, + {"Sb", "basic_string", 0}, + // std::basic_string,std::allocator > + {"Ss", "string", 0}, + // std::basic_istream > + {"Si", "istream", 0}, + // std::basic_ostream > + {"So", "ostream", 0}, + // std::basic_iostream > + {"Sd", "iostream", 0}, + {nullptr, nullptr, 0}, +}; + +// State needed for demangling. This struct is copied in almost every stack +// frame, so every byte counts. +typedef struct { + int mangled_idx; // Cursor of mangled name. + int out_cur_idx; // Cursor of output std::string. + int prev_name_idx; // For constructors/destructors. + signed int prev_name_length : 16; // For constructors/destructors. + signed int nest_level : 15; // For nested names. + unsigned int append : 1; // Append flag. + // Note: for some reason MSVC can't pack "bool append : 1" into the same int + // with the above two fields, so we use an int instead. Amusingly it can pack + // "signed bool" as expected, but relying on that to continue to be a legal + // type seems ill-advised (as it's illegal in at least clang). +} ParseState; + +static_assert(sizeof(ParseState) == 4 * sizeof(int), + "unexpected size of ParseState"); + +// One-off state for demangling that's not subject to backtracking -- either +// constant data, data that's intentionally immune to backtracking (steps), or +// data that would never be changed by backtracking anyway (recursion_depth). +// +// Only one copy of this exists for each call to Demangle, so the size of this +// struct is nearly inconsequential. +typedef struct { + const char *mangled_begin; // Beginning of input std::string. + char *out; // Beginning of output std::string. + int out_end_idx; // One past last allowed output character. + int recursion_depth; // For stack exhaustion prevention. + int steps; // Cap how much work we'll do, regardless of depth. + ParseState parse_state; // Backtrackable state copied for most frames. +} State; + +namespace { +// Prevent deep recursion / stack exhaustion. +// Also prevent unbounded handling of complex inputs. +class ComplexityGuard { + public: + explicit ComplexityGuard(State *state) : state_(state) { + ++state->recursion_depth; + ++state->steps; + } + ~ComplexityGuard() { --state_->recursion_depth; } + + // 256 levels of recursion seems like a reasonable upper limit on depth. + // 128 is not enough to demagle synthetic tests from demangle_unittest.txt: + // "_ZaaZZZZ..." and "_ZaaZcvZcvZ..." + static constexpr int kRecursionDepthLimit = 256; + + // We're trying to pick a charitable upper-limit on how many parse steps are + // necessary to handle something that a human could actually make use of. + // This is mostly in place as a bound on how much work we'll do if we are + // asked to demangle an mangled name from an untrusted source, so it should be + // much larger than the largest expected symbol, but much smaller than the + // amount of work we can do in, e.g., a second. + // + // Some real-world symbols from an arbitrary binary started failing between + // 2^12 and 2^13, so we multiply the latter by an extra factor of 16 to set + // the limit. + // + // Spending one second on 2^17 parse steps would require each step to take + // 7.6us, or ~30000 clock cycles, so it's safe to say this can be done in + // under a second. + static constexpr int kParseStepsLimit = 1 << 17; + + bool IsTooComplex() const { + return state_->recursion_depth > kRecursionDepthLimit || + state_->steps > kParseStepsLimit; + } + + private: + State *state_; +}; +} // namespace + +// We don't use strlen() in libc since it's not guaranteed to be async +// signal safe. +static size_t StrLen(const char *str) { + size_t len = 0; + while (*str != '\0') { + ++str; + ++len; + } + return len; +} + +// Returns true if "str" has at least "n" characters remaining. +static bool AtLeastNumCharsRemaining(const char *str, int n) { + for (int i = 0; i < n; ++i) { + if (str[i] == '\0') { + return false; + } + } + return true; +} + +// Returns true if "str" has "prefix" as a prefix. +static bool StrPrefix(const char *str, const char *prefix) { + size_t i = 0; + while (str[i] != '\0' && prefix[i] != '\0' && str[i] == prefix[i]) { + ++i; + } + return prefix[i] == '\0'; // Consumed everything in "prefix". +} + +static void InitState(State *state, const char *mangled, char *out, + int out_size) { + state->mangled_begin = mangled; + state->out = out; + state->out_end_idx = out_size; + state->recursion_depth = 0; + state->steps = 0; + + state->parse_state.mangled_idx = 0; + state->parse_state.out_cur_idx = 0; + state->parse_state.prev_name_idx = 0; + state->parse_state.prev_name_length = -1; + state->parse_state.nest_level = -1; + state->parse_state.append = true; +} + +static inline const char *RemainingInput(State *state) { + return &state->mangled_begin[state->parse_state.mangled_idx]; +} + +// Returns true and advances "mangled_idx" if we find "one_char_token" +// at "mangled_idx" position. It is assumed that "one_char_token" does +// not contain '\0'. +static bool ParseOneCharToken(State *state, const char one_char_token) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (RemainingInput(state)[0] == one_char_token) { + ++state->parse_state.mangled_idx; + return true; + } + return false; +} + +// Returns true and advances "mangled_cur" if we find "two_char_token" +// at "mangled_cur" position. It is assumed that "two_char_token" does +// not contain '\0'. +static bool ParseTwoCharToken(State *state, const char *two_char_token) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (RemainingInput(state)[0] == two_char_token[0] && + RemainingInput(state)[1] == two_char_token[1]) { + state->parse_state.mangled_idx += 2; + return true; + } + return false; +} + +// Returns true and advances "mangled_cur" if we find any character in +// "char_class" at "mangled_cur" position. +static bool ParseCharClass(State *state, const char *char_class) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (RemainingInput(state)[0] == '\0') { + return false; + } + const char *p = char_class; + for (; *p != '\0'; ++p) { + if (RemainingInput(state)[0] == *p) { + ++state->parse_state.mangled_idx; + return true; + } + } + return false; +} + +static bool ParseDigit(State *state, int *digit) { + char c = RemainingInput(state)[0]; + if (ParseCharClass(state, "0123456789")) { + if (digit != nullptr) { + *digit = c - '0'; + } + return true; + } + return false; +} + +// This function is used for handling an optional non-terminal. +static bool Optional(bool /*status*/) { return true; } + +// This function is used for handling + syntax. +typedef bool (*ParseFunc)(State *); +static bool OneOrMore(ParseFunc parse_func, State *state) { + if (parse_func(state)) { + while (parse_func(state)) { + } + return true; + } + return false; +} + +// This function is used for handling * syntax. The function +// always returns true and must be followed by a termination token or a +// terminating sequence not handled by parse_func (e.g. +// ParseOneCharToken(state, 'E')). +static bool ZeroOrMore(ParseFunc parse_func, State *state) { + while (parse_func(state)) { + } + return true; +} + +// Append "str" at "out_cur_idx". If there is an overflow, out_cur_idx is +// set to out_end_idx+1. The output string is ensured to +// always terminate with '\0' as long as there is no overflow. +static void Append(State *state, const char *const str, const int length) { + for (int i = 0; i < length; ++i) { + if (state->parse_state.out_cur_idx + 1 < + state->out_end_idx) { // +1 for '\0' + state->out[state->parse_state.out_cur_idx++] = str[i]; + } else { + // signal overflow + state->parse_state.out_cur_idx = state->out_end_idx + 1; + break; + } + } + if (state->parse_state.out_cur_idx < state->out_end_idx) { + state->out[state->parse_state.out_cur_idx] = + '\0'; // Terminate it with '\0' + } +} + +// We don't use equivalents in libc to avoid locale issues. +static bool IsLower(char c) { return c >= 'a' && c <= 'z'; } + +static bool IsAlpha(char c) { + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); +} + +static bool IsDigit(char c) { return c >= '0' && c <= '9'; } + +// Returns true if "str" is a function clone suffix. These suffixes are used +// by GCC 4.5.x and later versions (and our locally-modified version of GCC +// 4.4.x) to indicate functions which have been cloned during optimization. +// We treat any sequence (.+.+)+ as a function clone suffix. +static bool IsFunctionCloneSuffix(const char *str) { + size_t i = 0; + while (str[i] != '\0') { + // Consume a single .+.+ sequence. + if (str[i] != '.' || !IsAlpha(str[i + 1])) { + return false; + } + i += 2; + while (IsAlpha(str[i])) { + ++i; + } + if (str[i] != '.' || !IsDigit(str[i + 1])) { + return false; + } + i += 2; + while (IsDigit(str[i])) { + ++i; + } + } + return true; // Consumed everything in "str". +} + +static bool EndsWith(State *state, const char chr) { + return state->parse_state.out_cur_idx > 0 && + chr == state->out[state->parse_state.out_cur_idx - 1]; +} + +// Append "str" with some tweaks, iff "append" state is true. +static void MaybeAppendWithLength(State *state, const char *const str, + const int length) { + if (state->parse_state.append && length > 0) { + // Append a space if the output buffer ends with '<' and "str" + // starts with '<' to avoid <<<. + if (str[0] == '<' && EndsWith(state, '<')) { + Append(state, " ", 1); + } + // Remember the last identifier name for ctors/dtors. + if (IsAlpha(str[0]) || str[0] == '_') { + state->parse_state.prev_name_idx = state->parse_state.out_cur_idx; + state->parse_state.prev_name_length = length; + } + Append(state, str, length); + } +} + +// Appends a positive decimal number to the output if appending is enabled. +static bool MaybeAppendDecimal(State *state, unsigned int val) { + // Max {32-64}-bit unsigned int is 20 digits. + constexpr size_t kMaxLength = 20; + char buf[kMaxLength]; + + // We can't use itoa or sprintf as neither is specified to be + // async-signal-safe. + if (state->parse_state.append) { + // We can't have a one-before-the-beginning pointer, so instead start with + // one-past-the-end and manipulate one character before the pointer. + char *p = &buf[kMaxLength]; + do { // val=0 is the only input that should write a leading zero digit. + *--p = (val % 10) + '0'; + val /= 10; + } while (p > buf && val != 0); + + // 'p' landed on the last character we set. How convenient. + Append(state, p, kMaxLength - (p - buf)); + } + + return true; +} + +// A convenient wrapper around MaybeAppendWithLength(). +// Returns true so that it can be placed in "if" conditions. +static bool MaybeAppend(State *state, const char *const str) { + if (state->parse_state.append) { + int length = StrLen(str); + MaybeAppendWithLength(state, str, length); + } + return true; +} + +// This function is used for handling nested names. +static bool EnterNestedName(State *state) { + state->parse_state.nest_level = 0; + return true; +} + +// This function is used for handling nested names. +static bool LeaveNestedName(State *state, int16_t prev_value) { + state->parse_state.nest_level = prev_value; + return true; +} + +// Disable the append mode not to print function parameters, etc. +static bool DisableAppend(State *state) { + state->parse_state.append = false; + return true; +} + +// Restore the append mode to the previous state. +static bool RestoreAppend(State *state, bool prev_value) { + state->parse_state.append = prev_value; + return true; +} + +// Increase the nest level for nested names. +static void MaybeIncreaseNestLevel(State *state) { + if (state->parse_state.nest_level > -1) { + ++state->parse_state.nest_level; + } +} + +// Appends :: for nested names if necessary. +static void MaybeAppendSeparator(State *state) { + if (state->parse_state.nest_level >= 1) { + MaybeAppend(state, "::"); + } +} + +// Cancel the last separator if necessary. +static void MaybeCancelLastSeparator(State *state) { + if (state->parse_state.nest_level >= 1 && state->parse_state.append && + state->parse_state.out_cur_idx >= 2) { + state->parse_state.out_cur_idx -= 2; + state->out[state->parse_state.out_cur_idx] = '\0'; + } +} + +// Returns true if the identifier of the given length pointed to by +// "mangled_cur" is anonymous namespace. +static bool IdentifierIsAnonymousNamespace(State *state, int length) { + // Returns true if "anon_prefix" is a proper prefix of "mangled_cur". + static const char anon_prefix[] = "_GLOBAL__N_"; + return (length > static_cast(sizeof(anon_prefix) - 1) && + StrPrefix(RemainingInput(state), anon_prefix)); +} + +// Forward declarations of our parsing functions. +static bool ParseMangledName(State *state); +static bool ParseEncoding(State *state); +static bool ParseName(State *state); +static bool ParseUnscopedName(State *state); +static bool ParseNestedName(State *state); +static bool ParsePrefix(State *state); +static bool ParseUnqualifiedName(State *state); +static bool ParseSourceName(State *state); +static bool ParseLocalSourceName(State *state); +static bool ParseUnnamedTypeName(State *state); +static bool ParseNumber(State *state, int *number_out); +static bool ParseFloatNumber(State *state); +static bool ParseSeqId(State *state); +static bool ParseIdentifier(State *state, int length); +static bool ParseOperatorName(State *state, int *arity); +static bool ParseSpecialName(State *state); +static bool ParseCallOffset(State *state); +static bool ParseNVOffset(State *state); +static bool ParseVOffset(State *state); +static bool ParseCtorDtorName(State *state); +static bool ParseDecltype(State *state); +static bool ParseType(State *state); +static bool ParseCVQualifiers(State *state); +static bool ParseBuiltinType(State *state); +static bool ParseFunctionType(State *state); +static bool ParseBareFunctionType(State *state); +static bool ParseClassEnumType(State *state); +static bool ParseArrayType(State *state); +static bool ParsePointerToMemberType(State *state); +static bool ParseTemplateParam(State *state); +static bool ParseTemplateTemplateParam(State *state); +static bool ParseTemplateArgs(State *state); +static bool ParseTemplateArg(State *state); +static bool ParseBaseUnresolvedName(State *state); +static bool ParseUnresolvedName(State *state); +static bool ParseExpression(State *state); +static bool ParseExprPrimary(State *state); +static bool ParseExprCastValue(State *state); +static bool ParseLocalName(State *state); +static bool ParseLocalNameSuffix(State *state); +static bool ParseDiscriminator(State *state); +static bool ParseSubstitution(State *state, bool accept_std); + +// Implementation note: the following code is a straightforward +// translation of the Itanium C++ ABI defined in BNF with a couple of +// exceptions. +// +// - Support GNU extensions not defined in the Itanium C++ ABI +// - and are combined to avoid infinite loop +// - Reorder patterns to shorten the code +// - Reorder patterns to give greedier functions precedence +// We'll mark "Less greedy than" for these cases in the code +// +// Each parsing function changes the parse state and returns true on +// success, or returns false and doesn't change the parse state (note: +// the parse-steps counter increases regardless of success or failure). +// To ensure that the parse state isn't changed in the latter case, we +// save the original state before we call multiple parsing functions +// consecutively with &&, and restore it if unsuccessful. See +// ParseEncoding() as an example of this convention. We follow the +// convention throughout the code. +// +// Originally we tried to do demangling without following the full ABI +// syntax but it turned out we needed to follow the full syntax to +// parse complicated cases like nested template arguments. Note that +// implementing a full-fledged demangler isn't trivial (libiberty's +// cp-demangle.c has +4300 lines). +// +// Note that (foo) in <(foo) ...> is a modifier to be ignored. +// +// Reference: +// - Itanium C++ ABI +// + +// ::= _Z +static bool ParseMangledName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + return ParseTwoCharToken(state, "_Z") && ParseEncoding(state); +} + +// ::= <(function) name> +// ::= <(data) name> +// ::= +static bool ParseEncoding(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + // Implementing the first two productions together as + // [] avoids exponential blowup of backtracking. + // + // Since Optional(...) can't fail, there's no need to copy the state for + // backtracking. + if (ParseName(state) && Optional(ParseBareFunctionType(state))) { + return true; + } + + if (ParseSpecialName(state)) { + return true; + } + return false; +} + +// ::= +// ::= +// ::= +// ::= +static bool ParseName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseNestedName(state) || ParseLocalName(state)) { + return true; + } + + // We reorganize the productions to avoid re-parsing unscoped names. + // - Inline productions: + // ::= + // ::= + // ::= + // - Merge the two productions that start with unscoped-name: + // ::= [] + + ParseState copy = state->parse_state; + // "std<...>" isn't a valid name. + if (ParseSubstitution(state, /*accept_std=*/false) && + ParseTemplateArgs(state)) { + return true; + } + state->parse_state = copy; + + // Note there's no need to restore state after this since only the first + // subparser can fail. + return ParseUnscopedName(state) && Optional(ParseTemplateArgs(state)); +} + +// ::= +// ::= St +static bool ParseUnscopedName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseUnqualifiedName(state)) { + return true; + } + + ParseState copy = state->parse_state; + if (ParseTwoCharToken(state, "St") && MaybeAppend(state, "std::") && + ParseUnqualifiedName(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= R // lvalue method reference qualifier +// ::= O // rvalue method reference qualifier +static inline bool ParseRefQualifier(State *state) { + return ParseCharClass(state, "OR"); +} + +// ::= N [] [] +// E +// ::= N [] [] +// E +static bool ParseNestedName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'N') && EnterNestedName(state) && + Optional(ParseCVQualifiers(state)) && + Optional(ParseRefQualifier(state)) && ParsePrefix(state) && + LeaveNestedName(state, copy.nest_level) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + return false; +} + +// This part is tricky. If we literally translate them to code, we'll +// end up infinite loop. Hence we merge them to avoid the case. +// +// ::= +// ::= +// ::= +// ::= +// ::= # empty +// ::= <(template) unqualified-name> +// ::= +// ::= +static bool ParsePrefix(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + bool has_something = false; + while (true) { + MaybeAppendSeparator(state); + if (ParseTemplateParam(state) || + ParseSubstitution(state, /*accept_std=*/true) || + ParseUnscopedName(state) || + (ParseOneCharToken(state, 'M') && ParseUnnamedTypeName(state))) { + has_something = true; + MaybeIncreaseNestLevel(state); + continue; + } + MaybeCancelLastSeparator(state); + if (has_something && ParseTemplateArgs(state)) { + return ParsePrefix(state); + } else { + break; + } + } + return true; +} + +// ::= +// ::= +// ::= +// ::= // GCC extension; see below. +// ::= +static bool ParseUnqualifiedName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + return (ParseOperatorName(state, nullptr) || ParseCtorDtorName(state) || + ParseSourceName(state) || ParseLocalSourceName(state) || + ParseUnnamedTypeName(state)); +} + +// ::= +static bool ParseSourceName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + int length = -1; + if (ParseNumber(state, &length) && ParseIdentifier(state, length)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= L [] +// +// References: +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775 +// https://gcc.gnu.org/viewcvs?view=rev&revision=124467 +static bool ParseLocalSourceName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'L') && ParseSourceName(state) && + Optional(ParseDiscriminator(state))) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= Ut [<(nonnegative) number>] _ +// ::= +// ::= Ul E [<(nonnegative) number>] _ +// ::= <(parameter) type>+ +static bool ParseUnnamedTypeName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + // Type's 1-based index n is encoded as { "", n == 1; itoa(n-2), otherwise }. + // Optionally parse the encoded value into 'which' and add 2 to get the index. + int which = -1; + + // Unnamed type local to function or class. + if (ParseTwoCharToken(state, "Ut") && Optional(ParseNumber(state, &which)) && + which <= std::numeric_limits::max() - 2 && // Don't overflow. + ParseOneCharToken(state, '_')) { + MaybeAppend(state, "{unnamed type#"); + MaybeAppendDecimal(state, 2 + which); + MaybeAppend(state, "}"); + return true; + } + state->parse_state = copy; + + // Closure type. + which = -1; + if (ParseTwoCharToken(state, "Ul") && DisableAppend(state) && + OneOrMore(ParseType, state) && RestoreAppend(state, copy.append) && + ParseOneCharToken(state, 'E') && Optional(ParseNumber(state, &which)) && + which <= std::numeric_limits::max() - 2 && // Don't overflow. + ParseOneCharToken(state, '_')) { + MaybeAppend(state, "{lambda()#"); + MaybeAppendDecimal(state, 2 + which); + MaybeAppend(state, "}"); + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= [n] +// If "number_out" is non-null, then *number_out is set to the value of the +// parsed number on success. +static bool ParseNumber(State *state, int *number_out) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + bool negative = false; + if (ParseOneCharToken(state, 'n')) { + negative = true; + } + const char *p = RemainingInput(state); + uint64_t number = 0; + for (; *p != '\0'; ++p) { + if (IsDigit(*p)) { + number = number * 10 + (*p - '0'); + } else { + break; + } + } + // Apply the sign with uint64_t arithmetic so overflows aren't UB. Gives + // "incorrect" results for out-of-range inputs, but negative values only + // appear for literals, which aren't printed. + if (negative) { + number = ~number + 1; + } + if (p != RemainingInput(state)) { // Conversion succeeded. + state->parse_state.mangled_idx += p - RemainingInput(state); + if (number_out != nullptr) { + // Note: possibly truncate "number". + *number_out = number; + } + return true; + } + return false; +} + +// Floating-point literals are encoded using a fixed-length lowercase +// hexadecimal string. +static bool ParseFloatNumber(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + const char *p = RemainingInput(state); + for (; *p != '\0'; ++p) { + if (!IsDigit(*p) && !(*p >= 'a' && *p <= 'f')) { + break; + } + } + if (p != RemainingInput(state)) { // Conversion succeeded. + state->parse_state.mangled_idx += p - RemainingInput(state); + return true; + } + return false; +} + +// The is a sequence number in base 36, +// using digits and upper case letters +static bool ParseSeqId(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + const char *p = RemainingInput(state); + for (; *p != '\0'; ++p) { + if (!IsDigit(*p) && !(*p >= 'A' && *p <= 'Z')) { + break; + } + } + if (p != RemainingInput(state)) { // Conversion succeeded. + state->parse_state.mangled_idx += p - RemainingInput(state); + return true; + } + return false; +} + +// ::= (of given length) +static bool ParseIdentifier(State *state, int length) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (length < 0 || !AtLeastNumCharsRemaining(RemainingInput(state), length)) { + return false; + } + if (IdentifierIsAnonymousNamespace(state, length)) { + MaybeAppend(state, "(anonymous namespace)"); + } else { + MaybeAppendWithLength(state, RemainingInput(state), length); + } + state->parse_state.mangled_idx += length; + return true; +} + +// ::= nw, and other two letters cases +// ::= cv # (cast) +// ::= v # vendor extended operator +static bool ParseOperatorName(State *state, int *arity) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (!AtLeastNumCharsRemaining(RemainingInput(state), 2)) { + return false; + } + // First check with "cv" (cast) case. + ParseState copy = state->parse_state; + if (ParseTwoCharToken(state, "cv") && MaybeAppend(state, "operator ") && + EnterNestedName(state) && ParseType(state) && + LeaveNestedName(state, copy.nest_level)) { + if (arity != nullptr) { + *arity = 1; + } + return true; + } + state->parse_state = copy; + + // Then vendor extended operators. + if (ParseOneCharToken(state, 'v') && ParseDigit(state, arity) && + ParseSourceName(state)) { + return true; + } + state->parse_state = copy; + + // Other operator names should start with a lower alphabet followed + // by a lower/upper alphabet. + if (!(IsLower(RemainingInput(state)[0]) && + IsAlpha(RemainingInput(state)[1]))) { + return false; + } + // We may want to perform a binary search if we really need speed. + const AbbrevPair *p; + for (p = kOperatorList; p->abbrev != nullptr; ++p) { + if (RemainingInput(state)[0] == p->abbrev[0] && + RemainingInput(state)[1] == p->abbrev[1]) { + if (arity != nullptr) { + *arity = p->arity; + } + MaybeAppend(state, "operator"); + if (IsLower(*p->real_name)) { // new, delete, etc. + MaybeAppend(state, " "); + } + MaybeAppend(state, p->real_name); + state->parse_state.mangled_idx += 2; + return true; + } + } + return false; +} + +// ::= TV +// ::= TT +// ::= TI +// ::= TS +// ::= Tc <(base) encoding> +// ::= GV <(object) name> +// ::= T <(base) encoding> +// G++ extensions: +// ::= TC <(offset) number> _ <(base) type> +// ::= TF +// ::= TJ +// ::= GR +// ::= GA +// ::= Th <(base) encoding> +// ::= Tv <(base) encoding> +// +// Note: we don't care much about them since they don't appear in +// stack traces. The are special data. +static bool ParseSpecialName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'T') && ParseCharClass(state, "VTIS") && + ParseType(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "Tc") && ParseCallOffset(state) && + ParseCallOffset(state) && ParseEncoding(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "GV") && ParseName(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'T') && ParseCallOffset(state) && + ParseEncoding(state)) { + return true; + } + state->parse_state = copy; + + // G++ extensions + if (ParseTwoCharToken(state, "TC") && ParseType(state) && + ParseNumber(state, nullptr) && ParseOneCharToken(state, '_') && + DisableAppend(state) && ParseType(state)) { + RestoreAppend(state, copy.append); + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'T') && ParseCharClass(state, "FJ") && + ParseType(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "GR") && ParseName(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "GA") && ParseEncoding(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'T') && ParseCharClass(state, "hv") && + ParseCallOffset(state) && ParseEncoding(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= h _ +// ::= v _ +static bool ParseCallOffset(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'h') && ParseNVOffset(state) && + ParseOneCharToken(state, '_')) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'v') && ParseVOffset(state) && + ParseOneCharToken(state, '_')) { + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= <(offset) number> +static bool ParseNVOffset(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + return ParseNumber(state, nullptr); +} + +// ::= <(offset) number> _ <(virtual offset) number> +static bool ParseVOffset(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseNumber(state, nullptr) && ParseOneCharToken(state, '_') && + ParseNumber(state, nullptr)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= C1 | C2 | C3 +// ::= D0 | D1 | D2 +// # GCC extensions: "unified" constructor/destructor. See +// # https://github.com/gcc-mirror/gcc/blob/7ad17b583c3643bd4557f29b8391ca7ef08391f5/gcc/cp/mangle.c#L1847 +// ::= C4 | D4 +static bool ParseCtorDtorName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'C') && ParseCharClass(state, "1234")) { + const char *const prev_name = state->out + state->parse_state.prev_name_idx; + MaybeAppendWithLength(state, prev_name, + state->parse_state.prev_name_length); + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'D') && ParseCharClass(state, "0124")) { + const char *const prev_name = state->out + state->parse_state.prev_name_idx; + MaybeAppend(state, "~"); + MaybeAppendWithLength(state, prev_name, + state->parse_state.prev_name_length); + return true; + } + state->parse_state = copy; + return false; +} + +// ::= Dt E # decltype of an id-expression or class +// # member access (C++0x) +// ::= DT E # decltype of an expression (C++0x) +static bool ParseDecltype(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'D') && ParseCharClass(state, "tT") && + ParseExpression(state) && ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= +// ::= P # pointer-to +// ::= R # reference-to +// ::= O # rvalue reference-to (C++0x) +// ::= C # complex pair (C 2000) +// ::= G # imaginary (C 2000) +// ::= U # vendor extended type qualifier +// ::= +// ::= +// ::= # note: just an alias for +// ::= +// ::= +// ::= +// ::= +// ::= +// ::= +// ::= Dp # pack expansion of (C++0x) +// +static bool ParseType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + + // We should check CV-qualifers, and PRGC things first. + // + // CV-qualifiers overlap with some operator names, but an operator name is not + // valid as a type. To avoid an ambiguity that can lead to exponential time + // complexity, refuse to backtrack the CV-qualifiers. + // + // _Z4aoeuIrMvvE + // => _Z 4aoeuI rM v v E + // aoeu + // => _Z 4aoeuI r Mv v E + // aoeu + // + // By consuming the CV-qualifiers first, the former parse is disabled. + if (ParseCVQualifiers(state)) { + const bool result = ParseType(state); + if (!result) state->parse_state = copy; + return result; + } + state->parse_state = copy; + + // Similarly, these tag characters can overlap with other s resulting in + // two different parse prefixes that land on in the same + // place, such as "C3r1xI...". So, disable the "ctor-name = C3" parse by + // refusing to backtrack the tag characters. + if (ParseCharClass(state, "OPRCG")) { + const bool result = ParseType(state); + if (!result) state->parse_state = copy; + return result; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "Dp") && ParseType(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'U') && ParseSourceName(state) && + ParseType(state)) { + return true; + } + state->parse_state = copy; + + if (ParseBuiltinType(state) || ParseFunctionType(state) || + ParseClassEnumType(state) || ParseArrayType(state) || + ParsePointerToMemberType(state) || ParseDecltype(state) || + // "std" on its own isn't a type. + ParseSubstitution(state, /*accept_std=*/false)) { + return true; + } + + if (ParseTemplateTemplateParam(state) && ParseTemplateArgs(state)) { + return true; + } + state->parse_state = copy; + + // Less greedy than . + if (ParseTemplateParam(state)) { + return true; + } + + return false; +} + +// ::= [r] [V] [K] +// We don't allow empty to avoid infinite loop in +// ParseType(). +static bool ParseCVQualifiers(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + int num_cv_qualifiers = 0; + num_cv_qualifiers += ParseOneCharToken(state, 'r'); + num_cv_qualifiers += ParseOneCharToken(state, 'V'); + num_cv_qualifiers += ParseOneCharToken(state, 'K'); + return num_cv_qualifiers > 0; +} + +// ::= v, etc. # single-character builtin types +// ::= u +// ::= Dd, etc. # two-character builtin types +// +// Not supported: +// ::= DF _ # _FloatN (N bits) +// +static bool ParseBuiltinType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + const AbbrevPair *p; + for (p = kBuiltinTypeList; p->abbrev != nullptr; ++p) { + // Guaranteed only 1- or 2-character strings in kBuiltinTypeList. + if (p->abbrev[1] == '\0') { + if (ParseOneCharToken(state, p->abbrev[0])) { + MaybeAppend(state, p->real_name); + return true; + } + } else if (p->abbrev[2] == '\0' && ParseTwoCharToken(state, p->abbrev)) { + MaybeAppend(state, p->real_name); + return true; + } + } + + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'u') && ParseSourceName(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= F [Y] E +static bool ParseFunctionType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'F') && + Optional(ParseOneCharToken(state, 'Y')) && ParseBareFunctionType(state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= <(signature) type>+ +static bool ParseBareFunctionType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + DisableAppend(state); + if (OneOrMore(ParseType, state)) { + RestoreAppend(state, copy.append); + MaybeAppend(state, "()"); + return true; + } + state->parse_state = copy; + return false; +} + +// ::= +static bool ParseClassEnumType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + return ParseName(state); +} + +// ::= A <(positive dimension) number> _ <(element) type> +// ::= A [<(dimension) expression>] _ <(element) type> +static bool ParseArrayType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'A') && ParseNumber(state, nullptr) && + ParseOneCharToken(state, '_') && ParseType(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'A') && Optional(ParseExpression(state)) && + ParseOneCharToken(state, '_') && ParseType(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= M <(class) type> <(member) type> +static bool ParsePointerToMemberType(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'M') && ParseType(state) && ParseType(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= T_ +// ::= T _ +static bool ParseTemplateParam(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseTwoCharToken(state, "T_")) { + MaybeAppend(state, "?"); // We don't support template substitutions. + return true; + } + + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'T') && ParseNumber(state, nullptr) && + ParseOneCharToken(state, '_')) { + MaybeAppend(state, "?"); // We don't support template substitutions. + return true; + } + state->parse_state = copy; + return false; +} + +// ::= +// ::= +static bool ParseTemplateTemplateParam(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + return (ParseTemplateParam(state) || + // "std" on its own isn't a template. + ParseSubstitution(state, /*accept_std=*/false)); +} + +// ::= I + E +static bool ParseTemplateArgs(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + DisableAppend(state); + if (ParseOneCharToken(state, 'I') && OneOrMore(ParseTemplateArg, state) && + ParseOneCharToken(state, 'E')) { + RestoreAppend(state, copy.append); + MaybeAppend(state, "<>"); + return true; + } + state->parse_state = copy; + return false; +} + +// ::= +// ::= +// ::= J * E # argument pack +// ::= X E +static bool ParseTemplateArg(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'J') && ZeroOrMore(ParseTemplateArg, state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + // There can be significant overlap between the following leading to + // exponential backtracking: + // + // ::= L E + // e.g. L 2xxIvE 1 E + // ==> + // e.g. L 2xx IvE + // + // This means parsing an entire twice, and can contain + // , so this can generate exponential backtracking. There is + // only overlap when the remaining input starts with "L ", so + // parse all cases that can start this way jointly to share the common prefix. + // + // We have: + // + // ::= + // ::= + // + // First, drop all the productions of that must start with something + // other than 'L'. All that's left is ; inline it. + // + // ::= # starts with 'N' + // ::= + // ::= + // ::= # starts with 'Z' + // + // Drop and inline again: + // + // ::= + // ::= + // ::= # starts with 'S' + // + // Merge the first two, inline , drop last: + // + // ::= [] + // ::= St [] # starts with 'S' + // + // Drop and inline: + // + // ::= [] # starts with lowercase + // ::= [] # starts with 'C' or 'D' + // ::= [] # starts with digit + // ::= [] + // ::= [] # starts with 'U' + // + // One more time: + // + // ::= L [] + // + // Likewise with : + // + // ::= L E + // ::= LZ E # cannot overlap; drop + // ::= L E # cannot overlap; drop + // + // By similar reasoning as shown above, the only s starting with + // are " []". Inline this. + // + // ::= L [] E + // + // Now inline both of these into : + // + // ::= L [] + // ::= L [] E + // + // Merge them and we're done: + // + // ::= L [] [ E] + if (ParseLocalSourceName(state) && Optional(ParseTemplateArgs(state))) { + copy = state->parse_state; + if (ParseExprCastValue(state) && ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + return true; + } + + // Now that the overlapping cases can't reach this code, we can safely call + // both of these. + if (ParseType(state) || ParseExprPrimary(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'X') && ParseExpression(state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= [] +// ::= +// ::= +static inline bool ParseUnresolvedType(State *state) { + // No ComplexityGuard because we don't copy the state in this stack frame. + return (ParseTemplateParam(state) && Optional(ParseTemplateArgs(state))) || + ParseDecltype(state) || ParseSubstitution(state, /*accept_std=*/false); +} + +// ::= [] +static inline bool ParseSimpleId(State *state) { + // No ComplexityGuard because we don't copy the state in this stack frame. + + // Note: cannot be followed by a parameter pack; see comment in + // ParseUnresolvedType. + return ParseSourceName(state) && Optional(ParseTemplateArgs(state)); +} + +// ::= [] +// ::= on [] +// ::= dn +static bool ParseBaseUnresolvedName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + + if (ParseSimpleId(state)) { + return true; + } + + ParseState copy = state->parse_state; + if (ParseTwoCharToken(state, "on") && ParseOperatorName(state, nullptr) && + Optional(ParseTemplateArgs(state))) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "dn") && + (ParseUnresolvedType(state) || ParseSimpleId(state))) { + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= [gs] +// ::= sr +// ::= srN + E +// +// ::= [gs] sr + E +// +static bool ParseUnresolvedName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + + ParseState copy = state->parse_state; + if (Optional(ParseTwoCharToken(state, "gs")) && + ParseBaseUnresolvedName(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "sr") && ParseUnresolvedType(state) && + ParseBaseUnresolvedName(state)) { + return true; + } + state->parse_state = copy; + + if (ParseTwoCharToken(state, "sr") && ParseOneCharToken(state, 'N') && + ParseUnresolvedType(state) && + OneOrMore(/* ::= */ ParseSimpleId, state) && + ParseOneCharToken(state, 'E') && ParseBaseUnresolvedName(state)) { + return true; + } + state->parse_state = copy; + + if (Optional(ParseTwoCharToken(state, "gs")) && + ParseTwoCharToken(state, "sr") && + OneOrMore(/* ::= */ ParseSimpleId, state) && + ParseOneCharToken(state, 'E') && ParseBaseUnresolvedName(state)) { + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= <1-ary operator-name> +// ::= <2-ary operator-name> +// ::= <3-ary operator-name> +// ::= cl + E +// ::= cv # type (expression) +// ::= cv _ * E # type (expr-list) +// ::= st +// ::= +// ::= +// ::= +// ::= dt # expr.name +// ::= pt # expr->name +// ::= sp # argument pack expansion +// ::= sr +// ::= sr +// ::= fp <(top-level) CV-qualifiers> _ +// ::= fp <(top-level) CV-qualifiers> _ +// ::= fL p <(top-level) CV-qualifiers> _ +// ::= fL p <(top-level) CV-qualifiers> _ +static bool ParseExpression(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseTemplateParam(state) || ParseExprPrimary(state)) { + return true; + } + + // Object/function call expression. + ParseState copy = state->parse_state; + if (ParseTwoCharToken(state, "cl") && OneOrMore(ParseExpression, state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + // Function-param expression (level 0). + if (ParseTwoCharToken(state, "fp") && Optional(ParseCVQualifiers(state)) && + Optional(ParseNumber(state, nullptr)) && ParseOneCharToken(state, '_')) { + return true; + } + state->parse_state = copy; + + // Function-param expression (level 1+). + if (ParseTwoCharToken(state, "fL") && Optional(ParseNumber(state, nullptr)) && + ParseOneCharToken(state, 'p') && Optional(ParseCVQualifiers(state)) && + Optional(ParseNumber(state, nullptr)) && ParseOneCharToken(state, '_')) { + return true; + } + state->parse_state = copy; + + // Parse the conversion expressions jointly to avoid re-parsing the in + // their common prefix. Parsed as: + // ::= cv + // ::= _ * E + // ::= + // + // Also don't try ParseOperatorName after seeing "cv", since ParseOperatorName + // also needs to accept "cv " in other contexts. + if (ParseTwoCharToken(state, "cv")) { + if (ParseType(state)) { + ParseState copy2 = state->parse_state; + if (ParseOneCharToken(state, '_') && ZeroOrMore(ParseExpression, state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy2; + if (ParseExpression(state)) { + return true; + } + } + } else { + // Parse unary, binary, and ternary operator expressions jointly, taking + // care not to re-parse subexpressions repeatedly. Parse like: + // ::= + // [] + // ::= [] + int arity = -1; + if (ParseOperatorName(state, &arity) && + arity > 0 && // 0 arity => disabled. + (arity < 3 || ParseExpression(state)) && + (arity < 2 || ParseExpression(state)) && + (arity < 1 || ParseExpression(state))) { + return true; + } + } + state->parse_state = copy; + + // sizeof type + if (ParseTwoCharToken(state, "st") && ParseType(state)) { + return true; + } + state->parse_state = copy; + + // Object and pointer member access expressions. + if ((ParseTwoCharToken(state, "dt") || ParseTwoCharToken(state, "pt")) && + ParseExpression(state) && ParseType(state)) { + return true; + } + state->parse_state = copy; + + // Pointer-to-member access expressions. This parses the same as a binary + // operator, but it's implemented separately because "ds" shouldn't be + // accepted in other contexts that parse an operator name. + if (ParseTwoCharToken(state, "ds") && ParseExpression(state) && + ParseExpression(state)) { + return true; + } + state->parse_state = copy; + + // Parameter pack expansion + if (ParseTwoCharToken(state, "sp") && ParseExpression(state)) { + return true; + } + state->parse_state = copy; + + return ParseUnresolvedName(state); +} + +// ::= L <(value) number> E +// ::= L <(value) float> E +// ::= L E +// // A bug in g++'s C++ ABI version 2 (-fabi-version=2). +// ::= LZ E +// +// Warning, subtle: the "bug" LZ production above is ambiguous with the first +// production where starts with , which can lead to +// exponential backtracking in two scenarios: +// +// - When whatever follows the E in the in the first production is +// not a name, we backtrack the whole and re-parse the whole thing. +// +// - When whatever follows the in the first production is not a +// number and this may be followed by a name, we backtrack the +// and re-parse it. +// +// Moreover this ambiguity isn't always resolved -- for example, the following +// has two different parses: +// +// _ZaaILZ4aoeuE1x1EvE +// => operator&& +// => operator&&<(aoeu::x)(1), void> +// +// To resolve this, we just do what GCC's demangler does, and refuse to parse +// casts to types. +static bool ParseExprPrimary(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + + // The "LZ" special case: if we see LZ, we commit to accept "LZ E" + // or fail, no backtracking. + if (ParseTwoCharToken(state, "LZ")) { + if (ParseEncoding(state) && ParseOneCharToken(state, 'E')) { + return true; + } + + state->parse_state = copy; + return false; + } + + // The merged cast production. + if (ParseOneCharToken(state, 'L') && ParseType(state) && + ParseExprCastValue(state)) { + return true; + } + state->parse_state = copy; + + if (ParseOneCharToken(state, 'L') && ParseMangledName(state) && + ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + return false; +} + +// or , followed by 'E', as described above ParseExprPrimary. +static bool ParseExprCastValue(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + // We have to be able to backtrack after accepting a number because we could + // have e.g. "7fffE", which will accept "7" as a number but then fail to find + // the 'E'. + ParseState copy = state->parse_state; + if (ParseNumber(state, nullptr) && ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + if (ParseFloatNumber(state) && ParseOneCharToken(state, 'E')) { + return true; + } + state->parse_state = copy; + + return false; +} + +// ::= Z <(function) encoding> E <(entity) name> [] +// ::= Z <(function) encoding> E s [] +// +// Parsing a common prefix of these two productions together avoids an +// exponential blowup of backtracking. Parse like: +// := Z E +// ::= s [] +// ::= [] + +static bool ParseLocalNameSuffix(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + + if (MaybeAppend(state, "::") && ParseName(state) && + Optional(ParseDiscriminator(state))) { + return true; + } + + // Since we're not going to overwrite the above "::" by re-parsing the + // (whose trailing '\0' byte was in the byte now holding the + // first ':'), we have to rollback the "::" if the parse failed. + if (state->parse_state.append) { + state->out[state->parse_state.out_cur_idx - 2] = '\0'; + } + + return ParseOneCharToken(state, 's') && Optional(ParseDiscriminator(state)); +} + +static bool ParseLocalName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'Z') && ParseEncoding(state) && + ParseOneCharToken(state, 'E') && ParseLocalNameSuffix(state)) { + return true; + } + state->parse_state = copy; + return false; +} + +// := _ <(non-negative) number> +static bool ParseDiscriminator(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, '_') && ParseNumber(state, nullptr)) { + return true; + } + state->parse_state = copy; + return false; +} + +// ::= S_ +// ::= S _ +// ::= St, etc. +// +// "St" is special in that it's not valid as a standalone name, and it *is* +// allowed to precede a name without being wrapped in "N...E". This means that +// if we accept it on its own, we can accept "St1a" and try to parse +// template-args, then fail and backtrack, accept "St" on its own, then "1a" as +// an unqualified name and re-parse the same template-args. To block this +// exponential backtracking, we disable it with 'accept_std=false' in +// problematic contexts. +static bool ParseSubstitution(State *state, bool accept_std) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseTwoCharToken(state, "S_")) { + MaybeAppend(state, "?"); // We don't support substitutions. + return true; + } + + ParseState copy = state->parse_state; + if (ParseOneCharToken(state, 'S') && ParseSeqId(state) && + ParseOneCharToken(state, '_')) { + MaybeAppend(state, "?"); // We don't support substitutions. + return true; + } + state->parse_state = copy; + + // Expand abbreviations like "St" => "std". + if (ParseOneCharToken(state, 'S')) { + const AbbrevPair *p; + for (p = kSubstitutionList; p->abbrev != nullptr; ++p) { + if (RemainingInput(state)[0] == p->abbrev[1] && + (accept_std || p->abbrev[1] != 't')) { + MaybeAppend(state, "std"); + if (p->real_name[0] != '\0') { + MaybeAppend(state, "::"); + MaybeAppend(state, p->real_name); + } + ++state->parse_state.mangled_idx; + return true; + } + } + } + state->parse_state = copy; + return false; +} + +// Parse , optionally followed by either a function-clone suffix +// or version suffix. Returns true only if all of "mangled_cur" was consumed. +static bool ParseTopLevelMangledName(State *state) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (ParseMangledName(state)) { + if (RemainingInput(state)[0] != '\0') { + // Drop trailing function clone suffix, if any. + if (IsFunctionCloneSuffix(RemainingInput(state))) { + return true; + } + // Append trailing version suffix if any. + // ex. _Z3foo@@GLIBCXX_3.4 + if (RemainingInput(state)[0] == '@') { + MaybeAppend(state, RemainingInput(state)); + return true; + } + return false; // Unconsumed suffix. + } + return true; + } + return false; +} + +static bool Overflowed(const State *state) { + return state->parse_state.out_cur_idx >= state->out_end_idx; +} + +// The demangler entry point. +bool Demangle(const char *mangled, char *out, int out_size) { + State state; + InitState(&state, mangled, out, out_size); + return ParseTopLevelMangledName(&state) && !Overflowed(&state); +} + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.h b/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.h new file mode 100644 index 0000000..c314d9b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/demangle.h @@ -0,0 +1,71 @@ +// 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. + +// An async-signal-safe and thread-safe demangler for Itanium C++ ABI +// (aka G++ V3 ABI). +// +// The demangler is implemented to be used in async signal handlers to +// symbolize stack traces. We cannot use libstdc++'s +// abi::__cxa_demangle() in such signal handlers since it's not async +// signal safe (it uses malloc() internally). +// +// Note that this demangler doesn't support full demangling. More +// specifically, it doesn't print types of function parameters and +// types of template arguments. It just skips them. However, it's +// still very useful to extract basic information such as class, +// function, constructor, destructor, and operator names. +// +// See the implementation note in demangle.cc if you are interested. +// +// Example: +// +// | Mangled Name | The Demangler | abi::__cxa_demangle() +// |---------------|---------------|----------------------- +// | _Z1fv | f() | f() +// | _Z1fi | f() | f(int) +// | _Z3foo3bar | foo() | foo(bar) +// | _Z1fIiEvi | f<>() | void f(int) +// | _ZN1N1fE | N::f | N::f +// | _ZN3Foo3BarEv | Foo::Bar() | Foo::Bar() +// | _Zrm1XS_" | operator%() | operator%(X, X) +// | _ZN3FooC1Ev | Foo::Foo() | Foo::Foo() +// | _Z1fSs | f() | f(std::basic_string, +// | | | std::allocator >) +// +// See the unit test for more examples. +// +// Note: we might want to write demanglers for ABIs other than Itanium +// C++ ABI in the future. +// + +#ifndef ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_ +#define ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_ + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// Demangle `mangled`. On success, return true and write the +// demangled symbol name to `out`. Otherwise, return false. +// `out` is modified even if demangling is unsuccessful. +bool Demangle(const char *mangled, char *out, int out_size); + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_DEMANGLE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.cc b/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.cc new file mode 100644 index 0000000..24cc013 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.cc @@ -0,0 +1,382 @@ +// 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. + +// Allow dynamic symbol lookup in an in-memory Elf image. +// + +#include "absl/debugging/internal/elf_mem_image.h" + +#ifdef ABSL_HAVE_ELF_MEM_IMAGE // defined in elf_mem_image.h + +#include +#include +#include +#include "absl/base/internal/raw_logging.h" + +// From binutils/include/elf/common.h (this doesn't appear to be documented +// anywhere else). +// +// /* This flag appears in a Versym structure. It means that the symbol +// is hidden, and is only visible with an explicit version number. +// This is a GNU extension. */ +// #define VERSYM_HIDDEN 0x8000 +// +// /* This is the mask for the rest of the Versym information. */ +// #define VERSYM_VERSION 0x7fff + +#define VERSYM_VERSION 0x7fff + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +namespace { + +#if __WORDSIZE == 32 +const int kElfClass = ELFCLASS32; +int ElfBind(const ElfW(Sym) *symbol) { return ELF32_ST_BIND(symbol->st_info); } +int ElfType(const ElfW(Sym) *symbol) { return ELF32_ST_TYPE(symbol->st_info); } +#elif __WORDSIZE == 64 +const int kElfClass = ELFCLASS64; +int ElfBind(const ElfW(Sym) *symbol) { return ELF64_ST_BIND(symbol->st_info); } +int ElfType(const ElfW(Sym) *symbol) { return ELF64_ST_TYPE(symbol->st_info); } +#else +const int kElfClass = -1; +int ElfBind(const ElfW(Sym) *) { + ABSL_RAW_LOG(FATAL, "Unexpected word size"); + return 0; +} +int ElfType(const ElfW(Sym) *) { + ABSL_RAW_LOG(FATAL, "Unexpected word size"); + return 0; +} +#endif + +// Extract an element from one of the ELF tables, cast it to desired type. +// This is just a simple arithmetic and a glorified cast. +// Callers are responsible for bounds checking. +template +const T *GetTableElement(const ElfW(Ehdr) * ehdr, ElfW(Off) table_offset, + ElfW(Word) element_size, size_t index) { + return reinterpret_cast(reinterpret_cast(ehdr) + + table_offset + + index * element_size); +} + +} // namespace + +// The value of this variable doesn't matter; it's used only for its +// unique address. +const int ElfMemImage::kInvalidBaseSentinel = 0; + +ElfMemImage::ElfMemImage(const void *base) { + ABSL_RAW_CHECK(base != kInvalidBase, "bad pointer"); + Init(base); +} + +int ElfMemImage::GetNumSymbols() const { + if (!hash_) { + return 0; + } + // See http://www.caldera.com/developers/gabi/latest/ch5.dynamic.html#hash + return hash_[1]; +} + +const ElfW(Sym) *ElfMemImage::GetDynsym(int index) const { + ABSL_RAW_CHECK(index < GetNumSymbols(), "index out of range"); + return dynsym_ + index; +} + +const ElfW(Versym) *ElfMemImage::GetVersym(int index) const { + ABSL_RAW_CHECK(index < GetNumSymbols(), "index out of range"); + return versym_ + index; +} + +const ElfW(Phdr) *ElfMemImage::GetPhdr(int index) const { + ABSL_RAW_CHECK(index < ehdr_->e_phnum, "index out of range"); + return GetTableElement(ehdr_, + ehdr_->e_phoff, + ehdr_->e_phentsize, + index); +} + +const char *ElfMemImage::GetDynstr(ElfW(Word) offset) const { + ABSL_RAW_CHECK(offset < strsize_, "offset out of range"); + return dynstr_ + offset; +} + +const void *ElfMemImage::GetSymAddr(const ElfW(Sym) *sym) const { + if (sym->st_shndx == SHN_UNDEF || sym->st_shndx >= SHN_LORESERVE) { + // Symbol corresponds to "special" (e.g. SHN_ABS) section. + return reinterpret_cast(sym->st_value); + } + ABSL_RAW_CHECK(link_base_ < sym->st_value, "symbol out of range"); + return GetTableElement(ehdr_, 0, 1, sym->st_value - link_base_); +} + +const ElfW(Verdef) *ElfMemImage::GetVerdef(int index) const { + ABSL_RAW_CHECK(0 <= index && static_cast(index) <= verdefnum_, + "index out of range"); + const ElfW(Verdef) *version_definition = verdef_; + while (version_definition->vd_ndx < index && version_definition->vd_next) { + const char *const version_definition_as_char = + reinterpret_cast(version_definition); + version_definition = + reinterpret_cast(version_definition_as_char + + version_definition->vd_next); + } + return version_definition->vd_ndx == index ? version_definition : nullptr; +} + +const ElfW(Verdaux) *ElfMemImage::GetVerdefAux( + const ElfW(Verdef) *verdef) const { + return reinterpret_cast(verdef+1); +} + +const char *ElfMemImage::GetVerstr(ElfW(Word) offset) const { + ABSL_RAW_CHECK(offset < strsize_, "offset out of range"); + return dynstr_ + offset; +} + +void ElfMemImage::Init(const void *base) { + ehdr_ = nullptr; + dynsym_ = nullptr; + dynstr_ = nullptr; + versym_ = nullptr; + verdef_ = nullptr; + hash_ = nullptr; + strsize_ = 0; + verdefnum_ = 0; + link_base_ = ~0L; // Sentinel: PT_LOAD .p_vaddr can't possibly be this. + if (!base) { + return; + } + const char *const base_as_char = reinterpret_cast(base); + if (base_as_char[EI_MAG0] != ELFMAG0 || base_as_char[EI_MAG1] != ELFMAG1 || + base_as_char[EI_MAG2] != ELFMAG2 || base_as_char[EI_MAG3] != ELFMAG3) { + assert(false); + return; + } + int elf_class = base_as_char[EI_CLASS]; + if (elf_class != kElfClass) { + assert(false); + return; + } + switch (base_as_char[EI_DATA]) { + case ELFDATA2LSB: { + if (__LITTLE_ENDIAN != __BYTE_ORDER) { + assert(false); + return; + } + break; + } + case ELFDATA2MSB: { + if (__BIG_ENDIAN != __BYTE_ORDER) { + assert(false); + return; + } + break; + } + default: { + assert(false); + return; + } + } + + ehdr_ = reinterpret_cast(base); + const ElfW(Phdr) *dynamic_program_header = nullptr; + for (int i = 0; i < ehdr_->e_phnum; ++i) { + const ElfW(Phdr) *const program_header = GetPhdr(i); + switch (program_header->p_type) { + case PT_LOAD: + if (!~link_base_) { + link_base_ = program_header->p_vaddr; + } + break; + case PT_DYNAMIC: + dynamic_program_header = program_header; + break; + } + } + if (!~link_base_ || !dynamic_program_header) { + assert(false); + // Mark this image as not present. Can not recur infinitely. + Init(nullptr); + return; + } + ptrdiff_t relocation = + base_as_char - reinterpret_cast(link_base_); + ElfW(Dyn) *dynamic_entry = + reinterpret_cast(dynamic_program_header->p_vaddr + + relocation); + for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) { + const ElfW(Xword) value = dynamic_entry->d_un.d_val + relocation; + switch (dynamic_entry->d_tag) { + case DT_HASH: + hash_ = reinterpret_cast(value); + break; + case DT_SYMTAB: + dynsym_ = reinterpret_cast(value); + break; + case DT_STRTAB: + dynstr_ = reinterpret_cast(value); + break; + case DT_VERSYM: + versym_ = reinterpret_cast(value); + break; + case DT_VERDEF: + verdef_ = reinterpret_cast(value); + break; + case DT_VERDEFNUM: + verdefnum_ = dynamic_entry->d_un.d_val; + break; + case DT_STRSZ: + strsize_ = dynamic_entry->d_un.d_val; + break; + default: + // Unrecognized entries explicitly ignored. + break; + } + } + if (!hash_ || !dynsym_ || !dynstr_ || !versym_ || + !verdef_ || !verdefnum_ || !strsize_) { + assert(false); // invalid VDSO + // Mark this image as not present. Can not recur infinitely. + Init(nullptr); + return; + } +} + +bool ElfMemImage::LookupSymbol(const char *name, + const char *version, + int type, + SymbolInfo *info_out) const { + for (const SymbolInfo& info : *this) { + if (strcmp(info.name, name) == 0 && strcmp(info.version, version) == 0 && + ElfType(info.symbol) == type) { + if (info_out) { + *info_out = info; + } + return true; + } + } + return false; +} + +bool ElfMemImage::LookupSymbolByAddress(const void *address, + SymbolInfo *info_out) const { + for (const SymbolInfo& info : *this) { + const char *const symbol_start = + reinterpret_cast(info.address); + const char *const symbol_end = symbol_start + info.symbol->st_size; + if (symbol_start <= address && address < symbol_end) { + if (info_out) { + // Client wants to know details for that symbol (the usual case). + if (ElfBind(info.symbol) == STB_GLOBAL) { + // Strong symbol; just return it. + *info_out = info; + return true; + } else { + // Weak or local. Record it, but keep looking for a strong one. + *info_out = info; + } + } else { + // Client only cares if there is an overlapping symbol. + return true; + } + } + } + return false; +} + +ElfMemImage::SymbolIterator::SymbolIterator(const void *const image, int index) + : index_(index), image_(image) { +} + +const ElfMemImage::SymbolInfo *ElfMemImage::SymbolIterator::operator->() const { + return &info_; +} + +const ElfMemImage::SymbolInfo& ElfMemImage::SymbolIterator::operator*() const { + return info_; +} + +bool ElfMemImage::SymbolIterator::operator==(const SymbolIterator &rhs) const { + return this->image_ == rhs.image_ && this->index_ == rhs.index_; +} + +bool ElfMemImage::SymbolIterator::operator!=(const SymbolIterator &rhs) const { + return !(*this == rhs); +} + +ElfMemImage::SymbolIterator &ElfMemImage::SymbolIterator::operator++() { + this->Update(1); + return *this; +} + +ElfMemImage::SymbolIterator ElfMemImage::begin() const { + SymbolIterator it(this, 0); + it.Update(0); + return it; +} + +ElfMemImage::SymbolIterator ElfMemImage::end() const { + return SymbolIterator(this, GetNumSymbols()); +} + +void ElfMemImage::SymbolIterator::Update(int increment) { + const ElfMemImage *image = reinterpret_cast(image_); + ABSL_RAW_CHECK(image->IsPresent() || increment == 0, ""); + if (!image->IsPresent()) { + return; + } + index_ += increment; + if (index_ >= image->GetNumSymbols()) { + index_ = image->GetNumSymbols(); + return; + } + const ElfW(Sym) *symbol = image->GetDynsym(index_); + const ElfW(Versym) *version_symbol = image->GetVersym(index_); + ABSL_RAW_CHECK(symbol && version_symbol, ""); + const char *const symbol_name = image->GetDynstr(symbol->st_name); + const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION; + const ElfW(Verdef) *version_definition = nullptr; + const char *version_name = ""; + if (symbol->st_shndx == SHN_UNDEF) { + // Undefined symbols reference DT_VERNEED, not DT_VERDEF, and + // version_index could well be greater than verdefnum_, so calling + // GetVerdef(version_index) may trigger assertion. + } else { + version_definition = image->GetVerdef(version_index); + } + if (version_definition) { + // I am expecting 1 or 2 auxiliary entries: 1 for the version itself, + // optional 2nd if the version has a parent. + ABSL_RAW_CHECK( + version_definition->vd_cnt == 1 || version_definition->vd_cnt == 2, + "wrong number of entries"); + const ElfW(Verdaux) *version_aux = image->GetVerdefAux(version_definition); + version_name = image->GetVerstr(version_aux->vda_name); + } + info_.name = symbol_name; + info_.version = version_name; + info_.address = image->GetSymAddr(symbol); + info_.symbol = symbol; +} + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HAVE_ELF_MEM_IMAGE diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.h b/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.h new file mode 100644 index 0000000..46bfade --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/elf_mem_image.h @@ -0,0 +1,134 @@ +/* + * 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. + */ + +// Allow dynamic symbol lookup for in-memory Elf images. + +#ifndef ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_ +#define ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_ + +// Including this will define the __GLIBC__ macro if glibc is being +// used. +#include + +#include "absl/base/config.h" + +// Maybe one day we can rewrite this file not to require the elf +// symbol extensions in glibc, but for right now we need them. +#ifdef ABSL_HAVE_ELF_MEM_IMAGE +#error ABSL_HAVE_ELF_MEM_IMAGE cannot be directly set +#endif + +#if defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \ + !defined(__asmjs__) && !defined(__wasm__) +#define ABSL_HAVE_ELF_MEM_IMAGE 1 +#endif + +#ifdef ABSL_HAVE_ELF_MEM_IMAGE + +#include // for ElfW + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// An in-memory ELF image (may not exist on disk). +class ElfMemImage { + private: + // Sentinel: there could never be an elf image at &kInvalidBaseSentinel. + static const int kInvalidBaseSentinel; + + public: + // Sentinel: there could never be an elf image at this address. + static constexpr const void *const kInvalidBase = + static_cast(&kInvalidBaseSentinel); + + // Information about a single vdso symbol. + // All pointers are into .dynsym, .dynstr, or .text of the VDSO. + // Do not free() them or modify through them. + struct SymbolInfo { + const char *name; // E.g. "__vdso_getcpu" + const char *version; // E.g. "LINUX_2.6", could be "" + // for unversioned symbol. + const void *address; // Relocated symbol address. + const ElfW(Sym) *symbol; // Symbol in the dynamic symbol table. + }; + + // Supports iteration over all dynamic symbols. + class SymbolIterator { + public: + friend class ElfMemImage; + const SymbolInfo *operator->() const; + const SymbolInfo &operator*() const; + SymbolIterator& operator++(); + bool operator!=(const SymbolIterator &rhs) const; + bool operator==(const SymbolIterator &rhs) const; + private: + SymbolIterator(const void *const image, int index); + void Update(int incr); + SymbolInfo info_; + int index_; + const void *const image_; + }; + + + explicit ElfMemImage(const void *base); + void Init(const void *base); + bool IsPresent() const { return ehdr_ != nullptr; } + const ElfW(Phdr)* GetPhdr(int index) const; + const ElfW(Sym)* GetDynsym(int index) const; + const ElfW(Versym)* GetVersym(int index) const; + const ElfW(Verdef)* GetVerdef(int index) const; + const ElfW(Verdaux)* GetVerdefAux(const ElfW(Verdef) *verdef) const; + const char* GetDynstr(ElfW(Word) offset) const; + const void* GetSymAddr(const ElfW(Sym) *sym) const; + const char* GetVerstr(ElfW(Word) offset) const; + int GetNumSymbols() const; + + SymbolIterator begin() const; + SymbolIterator end() const; + + // Look up versioned dynamic symbol in the image. + // Returns false if image is not present, or doesn't contain given + // symbol/version/type combination. + // If info_out is non-null, additional details are filled in. + bool LookupSymbol(const char *name, const char *version, + int symbol_type, SymbolInfo *info_out) const; + + // Find info about symbol (if any) which overlaps given address. + // Returns true if symbol was found; false if image isn't present + // or doesn't have a symbol overlapping given address. + // If info_out is non-null, additional details are filled in. + bool LookupSymbolByAddress(const void *address, SymbolInfo *info_out) const; + + private: + const ElfW(Ehdr) *ehdr_; + const ElfW(Sym) *dynsym_; + const ElfW(Versym) *versym_; + const ElfW(Verdef) *verdef_; + const ElfW(Word) *hash_; + const char *dynstr_; + size_t strsize_; + size_t verdefnum_; + ElfW(Addr) link_base_; // Link-time base (p_vaddr of first PT_LOAD). +}; + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HAVE_ELF_MEM_IMAGE + +#endif // ABSL_DEBUGGING_INTERNAL_ELF_MEM_IMAGE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_aarch64-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_aarch64-inl.inc new file mode 100644 index 0000000..411ea30 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_aarch64-inl.inc @@ -0,0 +1,192 @@ +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_AARCH64_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_AARCH64_INL_H_ + +// Generate stack tracer for aarch64 + +#if defined(__linux__) +#include +#include +#include +#endif + +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/debugging/internal/address_is_readable.h" +#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems +#include "absl/debugging/stacktrace.h" + +static const uintptr_t kUnknownFrameSize = 0; + +#if defined(__linux__) +// Returns the address of the VDSO __kernel_rt_sigreturn function, if present. +static const unsigned char* GetKernelRtSigreturnAddress() { + constexpr uintptr_t kImpossibleAddress = 1; + ABSL_CONST_INIT static std::atomic memoized{kImpossibleAddress}; + uintptr_t address = memoized.load(std::memory_order_relaxed); + if (address != kImpossibleAddress) { + return reinterpret_cast(address); + } + + address = reinterpret_cast(nullptr); + +#ifdef ABSL_HAVE_VDSO_SUPPORT + absl::debugging_internal::VDSOSupport vdso; + if (vdso.IsPresent()) { + absl::debugging_internal::VDSOSupport::SymbolInfo symbol_info; + if (!vdso.LookupSymbol("__kernel_rt_sigreturn", "LINUX_2.6.39", STT_FUNC, + &symbol_info) || + symbol_info.address == nullptr) { + // Unexpected: VDSO is present, yet the expected symbol is missing + // or null. + assert(false && "VDSO is present, but doesn't have expected symbol"); + } else { + if (reinterpret_cast(symbol_info.address) != + kImpossibleAddress) { + address = reinterpret_cast(symbol_info.address); + } else { + assert(false && "VDSO returned invalid address"); + } + } + } +#endif + + memoized.store(address, std::memory_order_relaxed); + return reinterpret_cast(address); +} +#endif // __linux__ + +// Compute the size of a stack frame in [low..high). We assume that +// low < high. Return size of kUnknownFrameSize. +template +static inline uintptr_t ComputeStackFrameSize(const T* low, + const T* high) { + const char* low_char_ptr = reinterpret_cast(low); + const char* high_char_ptr = reinterpret_cast(high); + return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize; +} + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return null if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template +static void **NextStackFrame(void **old_frame_pointer, const void *uc) { + void **new_frame_pointer = reinterpret_cast(*old_frame_pointer); + bool check_frame_size = true; + +#if defined(__linux__) + if (WITH_CONTEXT && uc != nullptr) { + // Check to see if next frame's return address is __kernel_rt_sigreturn. + if (old_frame_pointer[1] == GetKernelRtSigreturnAddress()) { + const ucontext_t *ucv = static_cast(uc); + // old_frame_pointer[0] is not suitable for unwinding, look at + // ucontext to discover frame pointer before signal. + void **const pre_signal_frame_pointer = + reinterpret_cast(ucv->uc_mcontext.regs[29]); + + // Check that alleged frame pointer is actually readable. This is to + // prevent "double fault" in case we hit the first fault due to e.g. + // stack corruption. + if (!absl::debugging_internal::AddressIsReadable( + pre_signal_frame_pointer)) + return nullptr; + + // Alleged frame pointer is readable, use it for further unwinding. + new_frame_pointer = pre_signal_frame_pointer; + + // Skip frame size check if we return from a signal. We may be using a + // an alternate stack for signals. + check_frame_size = false; + } + } +#endif + + // aarch64 ABI requires stack pointer to be 16-byte-aligned. + if ((reinterpret_cast(new_frame_pointer) & 15) != 0) + return nullptr; + + // Check frame size. In strict mode, we assume frames to be under + // 100,000 bytes. In non-strict mode, we relax the limit to 1MB. + if (check_frame_size) { + const uintptr_t max_size = STRICT_UNWINDING ? 100000 : 1000000; + const uintptr_t frame_size = + ComputeStackFrameSize(old_frame_pointer, new_frame_pointer); + if (frame_size == kUnknownFrameSize || frame_size > max_size) + return nullptr; + } + + return new_frame_pointer; +} + +template +static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, + const void *ucp, int *min_dropped_frames) { +#ifdef __GNUC__ + void **frame_pointer = reinterpret_cast(__builtin_frame_address(0)); +#else +# error reading stack point not yet supported on this platform. +#endif + + skip_count++; // Skip the frame for this function. + int n = 0; + + // The frame pointer points to low address of a frame. The first 64-bit + // word of a frame points to the next frame up the call chain, which normally + // is just after the high address of the current frame. The second word of + // a frame contains return adress of to the caller. To find a pc value + // associated with the current frame, we need to go down a level in the call + // chain. So we remember return the address of the last frame seen. This + // does not work for the first stack frame, which belongs to UnwindImp() but + // we skip the frame for UnwindImp() anyway. + void* prev_return_address = nullptr; + + while (frame_pointer && n < max_depth) { + // The absl::GetStackFrames routine is called when we are in some + // informational context (the failure signal handler for example). + // Use the non-strict unwinding rules to produce a stack trace + // that is as complete as possible (even if it contains a few bogus + // entries in some rare cases). + void **next_frame_pointer = + NextStackFrame(frame_pointer, ucp); + + if (skip_count > 0) { + skip_count--; + } else { + result[n] = prev_return_address; + if (IS_STACK_FRAMES) { + sizes[n] = ComputeStackFrameSize(frame_pointer, next_frame_pointer); + } + n++; + } + prev_return_address = frame_pointer[1]; + frame_pointer = next_frame_pointer; + } + if (min_dropped_frames != nullptr) { + // Implementation detail: we clamp the max of frames we are willing to + // count, so as not to spend too much time in the loop below. + const int kMaxUnwind = 200; + int j = 0; + for (; frame_pointer != nullptr && j < kMaxUnwind; j++) { + frame_pointer = + NextStackFrame(frame_pointer, ucp); + } + *min_dropped_frames = j; + } + return n; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return true; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_AARCH64_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_arm-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_arm-inl.inc new file mode 100644 index 0000000..fffda96 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_arm-inl.inc @@ -0,0 +1,125 @@ +// Copyright 2011 and onwards Google Inc. +// All rights reserved. +// +// Author: Doug Kwan +// This is inspired by Craig Silverstein's PowerPC stacktrace code. +// + +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_ARM_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_ARM_INL_H_ + +#include + +#include "absl/debugging/stacktrace.h" + +// WARNING: +// This only works if all your code is in either ARM or THUMB mode. With +// interworking, the frame pointer of the caller can either be in r11 (ARM +// mode) or r7 (THUMB mode). A callee only saves the frame pointer of its +// mode in a fixed location on its stack frame. If the caller is a different +// mode, there is no easy way to find the frame pointer. It can either be +// still in the designated register or saved on stack along with other callee +// saved registers. + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return nullptr if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template +static void **NextStackFrame(void **old_sp) { + void **new_sp = (void**) old_sp[-1]; + + // Check that the transition from frame pointer old_sp to frame + // pointer new_sp isn't clearly bogus + if (STRICT_UNWINDING) { + // With the stack growing downwards, older stack frame must be + // at a greater address that the current one. + if (new_sp <= old_sp) return nullptr; + // Assume stack frames larger than 100,000 bytes are bogus. + if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return nullptr; + } else { + // In the non-strict mode, allow discontiguous stack frames. + // (alternate-signal-stacks for example). + if (new_sp == old_sp) return nullptr; + // And allow frames upto about 1MB. + if ((new_sp > old_sp) + && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return nullptr; + } + if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return nullptr; + return new_sp; +} + +// This ensures that absl::GetStackTrace sets up the Link Register properly. +#ifdef __GNUC__ +void StacktraceArmDummyFunction() __attribute__((noinline)); +void StacktraceArmDummyFunction() { __asm__ volatile(""); } +#else +# error StacktraceArmDummyFunction() needs to be ported to this platform. +#endif + +template +static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, + const void * /* ucp */, int *min_dropped_frames) { +#ifdef __GNUC__ + void **sp = reinterpret_cast(__builtin_frame_address(0)); +#else +# error reading stack point not yet supported on this platform. +#endif + + // On ARM, the return address is stored in the link register (r14). + // This is not saved on the stack frame of a leaf function. To + // simplify code that reads return addresses, we call a dummy + // function so that the return address of this function is also + // stored in the stack frame. This works at least for gcc. + StacktraceArmDummyFunction(); + + int n = 0; + while (sp && n < max_depth) { + // The absl::GetStackFrames routine is called when we are in some + // informational context (the failure signal handler for example). + // Use the non-strict unwinding rules to produce a stack trace + // that is as complete as possible (even if it contains a few bogus + // entries in some rare cases). + void **next_sp = NextStackFrame(sp); + + if (skip_count > 0) { + skip_count--; + } else { + result[n] = *sp; + + if (IS_STACK_FRAMES) { + if (next_sp > sp) { + sizes[n] = (uintptr_t)next_sp - (uintptr_t)sp; + } else { + // A frame-size of 0 is used to indicate unknown frame size. + sizes[n] = 0; + } + } + n++; + } + sp = next_sp; + } + if (min_dropped_frames != nullptr) { + // Implementation detail: we clamp the max of frames we are willing to + // count, so as not to spend too much time in the loop below. + const int kMaxUnwind = 200; + int j = 0; + for (; sp != nullptr && j < kMaxUnwind; j++) { + sp = NextStackFrame(sp); + } + *min_dropped_frames = j; + } + return n; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return false; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_ARM_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_config.h b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_config.h new file mode 100644 index 0000000..d4e8480 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_config.h @@ -0,0 +1,70 @@ +/* + * 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. + + * Defines ABSL_STACKTRACE_INL_HEADER to the *-inl.h containing + * actual unwinder implementation. + * This header is "private" to stacktrace.cc. + * DO NOT include it into any other files. +*/ +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_ + +#if defined(ABSL_STACKTRACE_INL_HEADER) +#error ABSL_STACKTRACE_INL_HEADER cannot be directly set + +#elif defined(_WIN32) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_win32-inl.inc" + +#elif defined(__linux__) && !defined(__ANDROID__) + +#if !defined(NO_FRAME_POINTER) +# if defined(__i386__) || defined(__x86_64__) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_x86-inl.inc" +# elif defined(__ppc__) || defined(__PPC__) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_powerpc-inl.inc" +# elif defined(__aarch64__) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_aarch64-inl.inc" +# elif defined(__arm__) +// Note: When using glibc this may require -funwind-tables to function properly. +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_generic-inl.inc" +# else +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_unimplemented-inl.inc" +# endif +#else // defined(NO_FRAME_POINTER) +# if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_generic-inl.inc" +# elif defined(__ppc__) || defined(__PPC__) +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_generic-inl.inc" +# else +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_unimplemented-inl.inc" +# endif +#endif // NO_FRAME_POINTER + +#else +#define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_unimplemented-inl.inc" + +#endif + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_generic-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_generic-inl.inc new file mode 100644 index 0000000..ac034c9 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_generic-inl.inc @@ -0,0 +1,99 @@ +// Copyright 2000 - 2007 Google Inc. +// All rights reserved. +// +// Author: Sanjay Ghemawat +// +// Portable implementation - just use glibc +// +// Note: The glibc implementation may cause a call to malloc. +// This can cause a deadlock in HeapProfiler. + +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_GENERIC_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_GENERIC_INL_H_ + +#include +#include +#include + +#include "absl/debugging/stacktrace.h" +#include "absl/base/attributes.h" + +// Sometimes, we can try to get a stack trace from within a stack +// trace, because we don't block signals inside this code (which would be too +// expensive: the two extra system calls per stack trace do matter here). +// That can cause a self-deadlock. +// Protect against such reentrant call by failing to get a stack trace. +// +// We use __thread here because the code here is extremely low level -- it is +// called while collecting stack traces from within malloc and mmap, and thus +// can not call anything which might call malloc or mmap itself. +static __thread int recursive = 0; + +// The stack trace function might be invoked very early in the program's +// execution (e.g. from the very first malloc if using tcmalloc). Also, the +// glibc implementation itself will trigger malloc the first time it is called. +// As such, we suppress usage of backtrace during this early stage of execution. +static std::atomic disable_stacktraces(true); // Disabled until healthy. +// Waiting until static initializers run seems to be late enough. +// This file is included into stacktrace.cc so this will only run once. +ABSL_ATTRIBUTE_UNUSED static int stacktraces_enabler = []() { + void* unused_stack[1]; + // Force the first backtrace to happen early to get the one-time shared lib + // loading (allocation) out of the way. After the first call it is much safer + // to use backtrace from a signal handler if we crash somewhere later. + backtrace(unused_stack, 1); + disable_stacktraces.store(false, std::memory_order_relaxed); + return 0; +}(); + +template +static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, + const void *ucp, int *min_dropped_frames) { + if (recursive || disable_stacktraces.load(std::memory_order_relaxed)) { + return 0; + } + ++recursive; + + static_cast(ucp); // Unused. + static const int kStackLength = 64; + void * stack[kStackLength]; + int size; + + size = backtrace(stack, kStackLength); + skip_count++; // we want to skip the current frame as well + int result_count = size - skip_count; + if (result_count < 0) + result_count = 0; + if (result_count > max_depth) + result_count = max_depth; + for (int i = 0; i < result_count; i++) + result[i] = stack[i + skip_count]; + + if (IS_STACK_FRAMES) { + // No implementation for finding out the stack frame sizes yet. + memset(sizes, 0, sizeof(*sizes) * result_count); + } + if (min_dropped_frames != nullptr) { + if (size - skip_count - max_depth > 0) { + *min_dropped_frames = size - skip_count - max_depth; + } else { + *min_dropped_frames = 0; + } + } + + --recursive; + + return result_count; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return true; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_GENERIC_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_powerpc-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_powerpc-inl.inc new file mode 100644 index 0000000..2e7c2f4 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_powerpc-inl.inc @@ -0,0 +1,248 @@ +// 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. +// +// Produce stack trace. I'm guessing (hoping!) the code is much like +// for x86. For apple machines, at least, it seems to be; see +// https://developer.apple.com/documentation/mac/runtimehtml/RTArch-59.html +// https://www.linux-foundation.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html#STACK +// Linux has similar code: http://patchwork.ozlabs.org/linuxppc/patch?id=8882 + +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_POWERPC_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_POWERPC_INL_H_ + +#if defined(__linux__) +#include // for PT_NIP. +#include // for ucontext_t +#endif + +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/base/optimization.h" +#include "absl/base/port.h" +#include "absl/debugging/stacktrace.h" +#include "absl/debugging/internal/address_is_readable.h" +#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems + +// Given a stack pointer, return the saved link register value. +// Note that this is the link register for a callee. +static inline void *StacktracePowerPCGetLR(void **sp) { + // PowerPC has 3 main ABIs, which say where in the stack the + // Link Register is. For DARWIN and AIX (used by apple and + // linux ppc64), it's in sp[2]. For SYSV (used by linux ppc), + // it's in sp[1]. +#if defined(_CALL_AIX) || defined(_CALL_DARWIN) + return *(sp+2); +#elif defined(_CALL_SYSV) + return *(sp+1); +#elif defined(__APPLE__) || defined(__FreeBSD__) || \ + (defined(__linux__) && defined(__PPC64__)) + // This check is in case the compiler doesn't define _CALL_AIX/etc. + return *(sp+2); +#elif defined(__linux) + // This check is in case the compiler doesn't define _CALL_SYSV. + return *(sp+1); +#else +#error Need to specify the PPC ABI for your archiecture. +#endif +} + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return null if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template +ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. +ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack. +static void **NextStackFrame(void **old_sp, const void *uc) { + void **new_sp = (void **) *old_sp; + enum { kStackAlignment = 16 }; + + // Check that the transition from frame pointer old_sp to frame + // pointer new_sp isn't clearly bogus + if (STRICT_UNWINDING) { + // With the stack growing downwards, older stack frame must be + // at a greater address that the current one. + if (new_sp <= old_sp) return nullptr; + // Assume stack frames larger than 100,000 bytes are bogus. + if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return nullptr; + } else { + // In the non-strict mode, allow discontiguous stack frames. + // (alternate-signal-stacks for example). + if (new_sp == old_sp) return nullptr; + // And allow frames upto about 1MB. + if ((new_sp > old_sp) + && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return nullptr; + } + if ((uintptr_t)new_sp % kStackAlignment != 0) return nullptr; + +#if defined(__linux__) + enum StackTraceKernelSymbolStatus { + kNotInitialized = 0, kAddressValid, kAddressInvalid }; + + if (IS_WITH_CONTEXT && uc != nullptr) { + static StackTraceKernelSymbolStatus kernel_symbol_status = + kNotInitialized; // Sentinel: not computed yet. + // Initialize with sentinel value: __kernel_rt_sigtramp_rt64 can not + // possibly be there. + static const unsigned char *kernel_sigtramp_rt64_address = nullptr; + if (kernel_symbol_status == kNotInitialized) { + absl::debugging_internal::VDSOSupport vdso; + if (vdso.IsPresent()) { + absl::debugging_internal::VDSOSupport::SymbolInfo + sigtramp_rt64_symbol_info; + if (!vdso.LookupSymbol( + "__kernel_sigtramp_rt64", "LINUX_2.6.15", + absl::debugging_internal::VDSOSupport::kVDSOSymbolType, + &sigtramp_rt64_symbol_info) || + sigtramp_rt64_symbol_info.address == nullptr) { + // Unexpected: VDSO is present, yet the expected symbol is missing + // or null. + assert(false && "VDSO is present, but doesn't have expected symbol"); + kernel_symbol_status = kAddressInvalid; + } else { + kernel_sigtramp_rt64_address = + reinterpret_cast( + sigtramp_rt64_symbol_info.address); + kernel_symbol_status = kAddressValid; + } + } else { + kernel_symbol_status = kAddressInvalid; + } + } + + if (new_sp != nullptr && + kernel_symbol_status == kAddressValid && + StacktracePowerPCGetLR(new_sp) == kernel_sigtramp_rt64_address) { + const ucontext_t* signal_context = + reinterpret_cast(uc); + void **const sp_before_signal = + reinterpret_cast(signal_context->uc_mcontext.gp_regs[PT_R1]); + // Check that alleged sp before signal is nonnull and is reasonably + // aligned. + if (sp_before_signal != nullptr && + ((uintptr_t)sp_before_signal % kStackAlignment) == 0) { + // Check that alleged stack pointer is actually readable. This is to + // prevent a "double fault" in case we hit the first fault due to e.g. + // a stack corruption. + if (absl::debugging_internal::AddressIsReadable(sp_before_signal)) { + // Alleged stack pointer is readable, use it for further unwinding. + new_sp = sp_before_signal; + } + } + } + } +#endif + + return new_sp; +} + +// This ensures that absl::GetStackTrace sets up the Link Register properly. +ABSL_ATTRIBUTE_NOINLINE static void AbslStacktracePowerPCDummyFunction() { + ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); +} + +template +ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. +ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack. +static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, + const void *ucp, int *min_dropped_frames) { + void **sp; + // Apple macOS uses an old version of gnu as -- both Darwin 7.9.0 (Panther) + // and Darwin 8.8.1 (Tiger) use as 1.38. This means we have to use a + // different asm syntax. I don't know quite the best way to discriminate + // systems using the old as from the new one; I've gone with __APPLE__. +#ifdef __APPLE__ + __asm__ volatile ("mr %0,r1" : "=r" (sp)); +#else + __asm__ volatile ("mr %0,1" : "=r" (sp)); +#endif + + // On PowerPC, the "Link Register" or "Link Record" (LR), is a stack + // entry that holds the return address of the subroutine call (what + // instruction we run after our function finishes). This is the + // same as the stack-pointer of our parent routine, which is what we + // want here. While the compiler will always(?) set up LR for + // subroutine calls, it may not for leaf functions (such as this one). + // This routine forces the compiler (at least gcc) to push it anyway. + AbslStacktracePowerPCDummyFunction(); + + // The LR save area is used by the callee, so the top entry is bogus. + skip_count++; + + int n = 0; + + // Unlike ABIs of X86 and ARM, PowerPC ABIs say that return address (in + // the link register) of a function call is stored in the caller's stack + // frame instead of the callee's. When we look for the return address + // associated with a stack frame, we need to make sure that there is a + // caller frame before it. So we call NextStackFrame before entering the + // loop below and check next_sp instead of sp for loop termination. + // The outermost frame is set up by runtimes and it does not have a + // caller frame, so it is skipped. + + // The absl::GetStackFrames routine is called when we are in some + // informational context (the failure signal handler for example). + // Use the non-strict unwinding rules to produce a stack trace + // that is as complete as possible (even if it contains a few + // bogus entries in some rare cases). + void **next_sp = NextStackFrame(sp, ucp); + + while (next_sp && n < max_depth) { + if (skip_count > 0) { + skip_count--; + } else { + result[n] = StacktracePowerPCGetLR(sp); + if (IS_STACK_FRAMES) { + if (next_sp > sp) { + sizes[n] = (uintptr_t)next_sp - (uintptr_t)sp; + } else { + // A frame-size of 0 is used to indicate unknown frame size. + sizes[n] = 0; + } + } + n++; + } + + sp = next_sp; + next_sp = NextStackFrame(sp, ucp); + } + + if (min_dropped_frames != nullptr) { + // Implementation detail: we clamp the max of frames we are willing to + // count, so as not to spend too much time in the loop below. + const int kMaxUnwind = 1000; + int j = 0; + for (; next_sp != nullptr && j < kMaxUnwind; j++) { + next_sp = NextStackFrame(next_sp, ucp); + } + *min_dropped_frames = j; + } + return n; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return true; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_POWERPC_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_unimplemented-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_unimplemented-inl.inc new file mode 100644 index 0000000..5b8fb19 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_unimplemented-inl.inc @@ -0,0 +1,24 @@ +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_UNIMPLEMENTED_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_UNIMPLEMENTED_INL_H_ + +template +static int UnwindImpl(void** /* result */, int* /* sizes */, + int /* max_depth */, int /* skip_count */, + const void* /* ucp */, int *min_dropped_frames) { + if (min_dropped_frames != nullptr) { + *min_dropped_frames = 0; + } + return 0; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return false; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_UNIMPLEMENTED_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_win32-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_win32-inl.inc new file mode 100644 index 0000000..9c2c558 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_win32-inl.inc @@ -0,0 +1,85 @@ +// 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. +// +// Produces a stack trace for Windows. Normally, one could use +// stacktrace_x86-inl.h or stacktrace_x86_64-inl.h -- and indeed, that +// should work for binaries compiled using MSVC in "debug" mode. +// However, in "release" mode, Windows uses frame-pointer +// optimization, which makes getting a stack trace very difficult. +// +// There are several approaches one can take. One is to use Windows +// intrinsics like StackWalk64. These can work, but have restrictions +// on how successful they can be. Another attempt is to write a +// version of stacktrace_x86-inl.h that has heuristic support for +// dealing with FPO, similar to what WinDbg does (see +// http://www.nynaeve.net/?p=97). There are (non-working) examples of +// these approaches, complete with TODOs, in stacktrace_win32-inl.h#1 +// +// The solution we've ended up doing is to call the undocumented +// windows function RtlCaptureStackBackTrace, which probably doesn't +// work with FPO but at least is fast, and doesn't require a symbol +// server. +// +// This code is inspired by a patch from David Vitek: +// https://code.google.com/p/google-perftools/issues/detail?id=83 + +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_WIN32_INL_H_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_WIN32_INL_H_ + +#include // for GetProcAddress and GetModuleHandle +#include + +typedef USHORT NTAPI RtlCaptureStackBackTrace_Function( + IN ULONG frames_to_skip, + IN ULONG frames_to_capture, + OUT PVOID *backtrace, + OUT PULONG backtrace_hash); + +// Load the function we need at static init time, where we don't have +// to worry about someone else holding the loader's lock. +static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn = + (RtlCaptureStackBackTrace_Function*) + GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace"); + +template +static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, + const void*, int* min_dropped_frames) { + int n = 0; + if (!RtlCaptureStackBackTrace_fn) { + // can't find a stacktrace with no function to call + } else { + n = (int)RtlCaptureStackBackTrace_fn(skip_count + 2, max_depth, result, 0); + } + if (IS_STACK_FRAMES) { + // No implementation for finding out the stack frame sizes yet. + memset(sizes, 0, sizeof(*sizes) * n); + } + if (min_dropped_frames != nullptr) { + // Not implemented. + *min_dropped_frames = 0; + } + return n; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return false; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_WIN32_INL_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_x86-inl.inc b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_x86-inl.inc new file mode 100644 index 0000000..bc320ff --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/stacktrace_x86-inl.inc @@ -0,0 +1,346 @@ +// 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. +// +// Produce stack trace + +#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_X86_INL_INC_ +#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_X86_INL_INC_ + +#if defined(__linux__) && (defined(__i386__) || defined(__x86_64__)) +#include // for ucontext_t +#endif + +#if !defined(_WIN32) +#include +#endif + +#include +#include + +#include "absl/base/macros.h" +#include "absl/base/port.h" +#include "absl/debugging/internal/address_is_readable.h" +#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems +#include "absl/debugging/stacktrace.h" + +#include "absl/base/internal/raw_logging.h" + +using absl::debugging_internal::AddressIsReadable; + +#if defined(__linux__) && defined(__i386__) +// Count "push %reg" instructions in VDSO __kernel_vsyscall(), +// preceeding "syscall" or "sysenter". +// If __kernel_vsyscall uses frame pointer, answer 0. +// +// kMaxBytes tells how many instruction bytes of __kernel_vsyscall +// to analyze before giving up. Up to kMaxBytes+1 bytes of +// instructions could be accessed. +// +// Here are known __kernel_vsyscall instruction sequences: +// +// SYSENTER (linux-2.6.26/arch/x86/vdso/vdso32/sysenter.S). +// Used on Intel. +// 0xffffe400 <__kernel_vsyscall+0>: push %ecx +// 0xffffe401 <__kernel_vsyscall+1>: push %edx +// 0xffffe402 <__kernel_vsyscall+2>: push %ebp +// 0xffffe403 <__kernel_vsyscall+3>: mov %esp,%ebp +// 0xffffe405 <__kernel_vsyscall+5>: sysenter +// +// SYSCALL (see linux-2.6.26/arch/x86/vdso/vdso32/syscall.S). +// Used on AMD. +// 0xffffe400 <__kernel_vsyscall+0>: push %ebp +// 0xffffe401 <__kernel_vsyscall+1>: mov %ecx,%ebp +// 0xffffe403 <__kernel_vsyscall+3>: syscall +// + +// The sequence below isn't actually expected in Google fleet, +// here only for completeness. Remove this comment from OSS release. + +// i386 (see linux-2.6.26/arch/x86/vdso/vdso32/int80.S) +// 0xffffe400 <__kernel_vsyscall+0>: int $0x80 +// 0xffffe401 <__kernel_vsyscall+1>: ret +// +static const int kMaxBytes = 10; + +// We use assert()s instead of DCHECK()s -- this is too low level +// for DCHECK(). + +static int CountPushInstructions(const unsigned char *const addr) { + int result = 0; + for (int i = 0; i < kMaxBytes; ++i) { + if (addr[i] == 0x89) { + // "mov reg,reg" + if (addr[i + 1] == 0xE5) { + // Found "mov %esp,%ebp". + return 0; + } + ++i; // Skip register encoding byte. + } else if (addr[i] == 0x0F && + (addr[i + 1] == 0x34 || addr[i + 1] == 0x05)) { + // Found "sysenter" or "syscall". + return result; + } else if ((addr[i] & 0xF0) == 0x50) { + // Found "push %reg". + ++result; + } else if (addr[i] == 0xCD && addr[i + 1] == 0x80) { + // Found "int $0x80" + assert(result == 0); + return 0; + } else { + // Unexpected instruction. + assert(false && "unexpected instruction in __kernel_vsyscall"); + return 0; + } + } + // Unexpected: didn't find SYSENTER or SYSCALL in + // [__kernel_vsyscall, __kernel_vsyscall + kMaxBytes) interval. + assert(false && "did not find SYSENTER or SYSCALL in __kernel_vsyscall"); + return 0; +} +#endif + +// Assume stack frames larger than 100,000 bytes are bogus. +static const int kMaxFrameBytes = 100000; + +// Returns the stack frame pointer from signal context, 0 if unknown. +// vuc is a ucontext_t *. We use void* to avoid the use +// of ucontext_t on non-POSIX systems. +static uintptr_t GetFP(const void *vuc) { +#if !defined(__linux__) + static_cast(vuc); // Avoid an unused argument compiler warning. +#else + if (vuc != nullptr) { + auto *uc = reinterpret_cast(vuc); +#if defined(__i386__) + const auto bp = uc->uc_mcontext.gregs[REG_EBP]; + const auto sp = uc->uc_mcontext.gregs[REG_ESP]; +#elif defined(__x86_64__) + const auto bp = uc->uc_mcontext.gregs[REG_RBP]; + const auto sp = uc->uc_mcontext.gregs[REG_RSP]; +#else + const uintptr_t bp = 0; + const uintptr_t sp = 0; +#endif + // Sanity-check that the base pointer is valid. It should be as long as + // SHRINK_WRAP_FRAME_POINTER is not set, but it's possible that some code in + // the process is compiled with --copt=-fomit-frame-pointer or + // --copt=-momit-leaf-frame-pointer. + // + // TODO(bcmills): -momit-leaf-frame-pointer is currently the default + // behavior when building with clang. Talk to the C++ toolchain team about + // fixing that. + if (bp >= sp && bp - sp <= kMaxFrameBytes) return bp; + + // If bp isn't a plausible frame pointer, return the stack pointer instead. + // If we're lucky, it points to the start of a stack frame; otherwise, we'll + // get one frame of garbage in the stack trace and fail the sanity check on + // the next iteration. + return sp; + } +#endif + return 0; +} + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return null if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template +ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. +ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack. +static void **NextStackFrame(void **old_fp, const void *uc) { + void **new_fp = (void **)*old_fp; + +#if defined(__linux__) && defined(__i386__) + if (WITH_CONTEXT && uc != nullptr) { + // How many "push %reg" instructions are there at __kernel_vsyscall? + // This is constant for a given kernel and processor, so compute + // it only once. + static int num_push_instructions = -1; // Sentinel: not computed yet. + // Initialize with sentinel value: __kernel_rt_sigreturn can not possibly + // be there. + static const unsigned char *kernel_rt_sigreturn_address = nullptr; + static const unsigned char *kernel_vsyscall_address = nullptr; + if (num_push_instructions == -1) { +#ifdef ABSL_HAVE_VDSO_SUPPORT + absl::debugging_internal::VDSOSupport vdso; + if (vdso.IsPresent()) { + absl::debugging_internal::VDSOSupport::SymbolInfo + rt_sigreturn_symbol_info; + absl::debugging_internal::VDSOSupport::SymbolInfo vsyscall_symbol_info; + if (!vdso.LookupSymbol("__kernel_rt_sigreturn", "LINUX_2.5", STT_FUNC, + &rt_sigreturn_symbol_info) || + !vdso.LookupSymbol("__kernel_vsyscall", "LINUX_2.5", STT_FUNC, + &vsyscall_symbol_info) || + rt_sigreturn_symbol_info.address == nullptr || + vsyscall_symbol_info.address == nullptr) { + // Unexpected: 32-bit VDSO is present, yet one of the expected + // symbols is missing or null. + assert(false && "VDSO is present, but doesn't have expected symbols"); + num_push_instructions = 0; + } else { + kernel_rt_sigreturn_address = + reinterpret_cast( + rt_sigreturn_symbol_info.address); + kernel_vsyscall_address = + reinterpret_cast( + vsyscall_symbol_info.address); + num_push_instructions = + CountPushInstructions(kernel_vsyscall_address); + } + } else { + num_push_instructions = 0; + } +#else // ABSL_HAVE_VDSO_SUPPORT + num_push_instructions = 0; +#endif // ABSL_HAVE_VDSO_SUPPORT + } + if (num_push_instructions != 0 && kernel_rt_sigreturn_address != nullptr && + old_fp[1] == kernel_rt_sigreturn_address) { + const ucontext_t *ucv = static_cast(uc); + // This kernel does not use frame pointer in its VDSO code, + // and so %ebp is not suitable for unwinding. + void **const reg_ebp = + reinterpret_cast(ucv->uc_mcontext.gregs[REG_EBP]); + const unsigned char *const reg_eip = + reinterpret_cast(ucv->uc_mcontext.gregs[REG_EIP]); + if (new_fp == reg_ebp && kernel_vsyscall_address <= reg_eip && + reg_eip - kernel_vsyscall_address < kMaxBytes) { + // We "stepped up" to __kernel_vsyscall, but %ebp is not usable. + // Restore from 'ucv' instead. + void **const reg_esp = + reinterpret_cast(ucv->uc_mcontext.gregs[REG_ESP]); + // Check that alleged %esp is not null and is reasonably aligned. + if (reg_esp && + ((uintptr_t)reg_esp & (sizeof(reg_esp) - 1)) == 0) { + // Check that alleged %esp is actually readable. This is to prevent + // "double fault" in case we hit the first fault due to e.g. stack + // corruption. + void *const reg_esp2 = reg_esp[num_push_instructions - 1]; + if (AddressIsReadable(reg_esp2)) { + // Alleged %esp is readable, use it for further unwinding. + new_fp = reinterpret_cast(reg_esp2); + } + } + } + } + } +#endif + + const uintptr_t old_fp_u = reinterpret_cast(old_fp); + const uintptr_t new_fp_u = reinterpret_cast(new_fp); + + // Check that the transition from frame pointer old_fp to frame + // pointer new_fp isn't clearly bogus. Skip the checks if new_fp + // matches the signal context, so that we don't skip out early when + // using an alternate signal stack. + // + // TODO(bcmills): The GetFP call should be completely unnecessary when + // SHRINK_WRAP_FRAME_POINTER is set (because we should be back in the thread's + // stack by this point), but it is empirically still needed (e.g. when the + // stack includes a call to abort). unw_get_reg returns UNW_EBADREG for some + // frames. Figure out why GetValidFrameAddr and/or libunwind isn't doing what + // it's supposed to. + if (STRICT_UNWINDING && + (!WITH_CONTEXT || uc == nullptr || new_fp_u != GetFP(uc))) { + // With the stack growing downwards, older stack frame must be + // at a greater address that the current one. + if (new_fp_u <= old_fp_u) return nullptr; + if (new_fp_u - old_fp_u > kMaxFrameBytes) return nullptr; + } else { + if (new_fp == nullptr) return nullptr; // skip AddressIsReadable() below + // In the non-strict mode, allow discontiguous stack frames. + // (alternate-signal-stacks for example). + if (new_fp == old_fp) return nullptr; + } + + if (new_fp_u & (sizeof(void *) - 1)) return nullptr; +#ifdef __i386__ + // On 32-bit machines, the stack pointer can be very close to + // 0xffffffff, so we explicitly check for a pointer into the + // last two pages in the address space + if (new_fp_u >= 0xffffe000) return nullptr; +#endif +#if !defined(_WIN32) + if (!STRICT_UNWINDING) { + // Lax sanity checks cause a crash in 32-bit tcmalloc/crash_reason_test + // on AMD-based machines with VDSO-enabled kernels. + // Make an extra sanity check to insure new_fp is readable. + // Note: NextStackFrame() is only called while the program + // is already on its last leg, so it's ok to be slow here. + + if (!AddressIsReadable(new_fp)) { + return nullptr; + } + } +#endif + return new_fp; +} + +template +ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. +ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack. +ABSL_ATTRIBUTE_NOINLINE +static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count, + const void *ucp, int *min_dropped_frames) { + int n = 0; + void **fp = reinterpret_cast(__builtin_frame_address(0)); + + while (fp && n < max_depth) { + if (*(fp + 1) == reinterpret_cast(0)) { + // In 64-bit code, we often see a frame that + // points to itself and has a return address of 0. + break; + } + void **next_fp = NextStackFrame(fp, ucp); + if (skip_count > 0) { + skip_count--; + } else { + result[n] = *(fp + 1); + if (IS_STACK_FRAMES) { + if (next_fp > fp) { + sizes[n] = (uintptr_t)next_fp - (uintptr_t)fp; + } else { + // A frame-size of 0 is used to indicate unknown frame size. + sizes[n] = 0; + } + } + n++; + } + fp = next_fp; + } + if (min_dropped_frames != nullptr) { + // Implementation detail: we clamp the max of frames we are willing to + // count, so as not to spend too much time in the loop below. + const int kMaxUnwind = 1000; + int j = 0; + for (; fp != nullptr && j < kMaxUnwind; j++) { + fp = NextStackFrame(fp, ucp); + } + *min_dropped_frames = j; + } + return n; +} + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { +bool StackTraceWorksForTest() { + return true; +} +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_X86_INL_INC_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/symbolize.h b/SaraAttended/Pods/abseil/absl/debugging/internal/symbolize.h new file mode 100644 index 0000000..5d0858b --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/symbolize.h @@ -0,0 +1,128 @@ +// 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 file contains internal parts of the Abseil symbolizer. +// Do not depend on the anything in this file, it may change at anytime. + +#ifndef ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ +#define ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ + +#include +#include + +#include "absl/base/config.h" + +#ifdef ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE +#error ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE cannot be directly set +#elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \ + !defined(__asmjs__) && !defined(__wasm__) +#define ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE 1 + +#include +#include // For ElfW() macro. +#include +#include + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// Iterates over all sections, invoking callback on each with the section name +// and the section header. +// +// Returns true on success; otherwise returns false in case of errors. +// +// This is not async-signal-safe. +bool ForEachSection(int fd, + const std::function& callback); + +// Gets the section header for the given name, if it exists. Returns true on +// success. Otherwise, returns false. +bool GetSectionHeaderByName(int fd, const char *name, size_t name_len, + ElfW(Shdr) *out); + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +struct SymbolDecoratorArgs { + // The program counter we are getting symbolic name for. + const void *pc; + // 0 for main executable, load address for shared libraries. + ptrdiff_t relocation; + // Read-only file descriptor for ELF image covering "pc", + // or -1 if no such ELF image exists in /proc/self/maps. + int fd; + // Output buffer, size. + // Note: the buffer may not be empty -- default symbolizer may have already + // produced some output, and earlier decorators may have adorned it in + // some way. You are free to replace or augment the contents (within the + // symbol_buf_size limit). + char *const symbol_buf; + size_t symbol_buf_size; + // Temporary scratch space, size. + // Use that space in preference to allocating your own stack buffer to + // conserve stack. + char *const tmp_buf; + size_t tmp_buf_size; + // User-provided argument + void* arg; +}; +using SymbolDecorator = void (*)(const SymbolDecoratorArgs *); + +// Installs a function-pointer as a decorator. Returns a value less than zero +// if the system cannot install the decorator. Otherwise, returns a unique +// identifier corresponding to the decorator. This identifier can be used to +// uninstall the decorator - See RemoveSymbolDecorator() below. +int InstallSymbolDecorator(SymbolDecorator decorator, void* arg); + +// Removes a previously installed function-pointer decorator. Parameter "ticket" +// is the return-value from calling InstallSymbolDecorator(). +bool RemoveSymbolDecorator(int ticket); + +// Remove all installed decorators. Returns true if successful, false if +// symbolization is currently in progress. +bool RemoveAllSymbolDecorators(void); + +// Registers an address range to a file mapping. +// +// Preconditions: +// start <= end +// filename != nullptr +// +// Returns true if the file was successfully registered. +bool RegisterFileMappingHint( + const void* start, const void* end, uint64_t offset, const char* filename); + +// Looks up the file mapping registered by RegisterFileMappingHint for an +// address range. If there is one, the file name is stored in *filename and +// *start and *end are modified to reflect the registered mapping. Returns +// whether any hint was found. +bool GetFileMappingHint(const void** start, + const void** end, + uint64_t * offset, + const char** filename); + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_INTERNAL_SYMBOLIZE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.cc b/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.cc new file mode 100644 index 0000000..1e8a78a --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.cc @@ -0,0 +1,194 @@ +// 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. + +// Allow dynamic symbol lookup in the kernel VDSO page. +// +// VDSOSupport -- a class representing kernel VDSO (if present). + +#include "absl/debugging/internal/vdso_support.h" + +#ifdef ABSL_HAVE_VDSO_SUPPORT // defined in vdso_support.h + +#include +#include +#include +#include + +#if __GLIBC_PREREQ(2, 16) // GLIBC-2.16 implements getauxval. +#include +#endif + +#include "absl/base/dynamic_annotations.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/port.h" + +#ifndef AT_SYSINFO_EHDR +#define AT_SYSINFO_EHDR 33 // for crosstoolv10 +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +ABSL_CONST_INIT +std::atomic VDSOSupport::vdso_base_( + debugging_internal::ElfMemImage::kInvalidBase); + +std::atomic VDSOSupport::getcpu_fn_(&InitAndGetCPU); +VDSOSupport::VDSOSupport() + // If vdso_base_ is still set to kInvalidBase, we got here + // before VDSOSupport::Init has been called. Call it now. + : image_(vdso_base_.load(std::memory_order_relaxed) == + debugging_internal::ElfMemImage::kInvalidBase + ? Init() + : vdso_base_.load(std::memory_order_relaxed)) {} + +// NOTE: we can't use GoogleOnceInit() below, because we can be +// called by tcmalloc, and none of the *once* stuff may be functional yet. +// +// In addition, we hope that the VDSOSupportHelper constructor +// causes this code to run before there are any threads, and before +// InitGoogle() has executed any chroot or setuid calls. +// +// Finally, even if there is a race here, it is harmless, because +// the operation should be idempotent. +const void *VDSOSupport::Init() { + const auto kInvalidBase = debugging_internal::ElfMemImage::kInvalidBase; +#if __GLIBC_PREREQ(2, 16) + if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { + errno = 0; + const void *const sysinfo_ehdr = + reinterpret_cast(getauxval(AT_SYSINFO_EHDR)); + if (errno == 0) { + vdso_base_.store(sysinfo_ehdr, std::memory_order_relaxed); + } + } +#endif // __GLIBC_PREREQ(2, 16) + if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { + // Valgrind zaps AT_SYSINFO_EHDR and friends from the auxv[] + // on stack, and so glibc works as if VDSO was not present. + // But going directly to kernel via /proc/self/auxv below bypasses + // Valgrind zapping. So we check for Valgrind separately. + if (RunningOnValgrind()) { + vdso_base_.store(nullptr, std::memory_order_relaxed); + getcpu_fn_.store(&GetCPUViaSyscall, std::memory_order_relaxed); + return nullptr; + } + int fd = open("/proc/self/auxv", O_RDONLY); + if (fd == -1) { + // Kernel too old to have a VDSO. + vdso_base_.store(nullptr, std::memory_order_relaxed); + getcpu_fn_.store(&GetCPUViaSyscall, std::memory_order_relaxed); + return nullptr; + } + ElfW(auxv_t) aux; + while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) { + if (aux.a_type == AT_SYSINFO_EHDR) { + vdso_base_.store(reinterpret_cast(aux.a_un.a_val), + std::memory_order_relaxed); + break; + } + } + close(fd); + if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { + // Didn't find AT_SYSINFO_EHDR in auxv[]. + vdso_base_.store(nullptr, std::memory_order_relaxed); + } + } + GetCpuFn fn = &GetCPUViaSyscall; // default if VDSO not present. + if (vdso_base_.load(std::memory_order_relaxed)) { + VDSOSupport vdso; + SymbolInfo info; + if (vdso.LookupSymbol("__vdso_getcpu", "LINUX_2.6", STT_FUNC, &info)) { + fn = reinterpret_cast(const_cast(info.address)); + } + } + // Subtle: this code runs outside of any locks; prevent compiler + // from assigning to getcpu_fn_ more than once. + getcpu_fn_.store(fn, std::memory_order_relaxed); + return vdso_base_.load(std::memory_order_relaxed); +} + +const void *VDSOSupport::SetBase(const void *base) { + ABSL_RAW_CHECK(base != debugging_internal::ElfMemImage::kInvalidBase, + "internal error"); + const void *old_base = vdso_base_.load(std::memory_order_relaxed); + vdso_base_.store(base, std::memory_order_relaxed); + image_.Init(base); + // Also reset getcpu_fn_, so GetCPU could be tested with simulated VDSO. + getcpu_fn_.store(&InitAndGetCPU, std::memory_order_relaxed); + return old_base; +} + +bool VDSOSupport::LookupSymbol(const char *name, + const char *version, + int type, + SymbolInfo *info) const { + return image_.LookupSymbol(name, version, type, info); +} + +bool VDSOSupport::LookupSymbolByAddress(const void *address, + SymbolInfo *info_out) const { + return image_.LookupSymbolByAddress(address, info_out); +} + +// NOLINT on 'long' because this routine mimics kernel api. +long VDSOSupport::GetCPUViaSyscall(unsigned *cpu, // NOLINT(runtime/int) + void *, void *) { +#ifdef SYS_getcpu + return syscall(SYS_getcpu, cpu, nullptr, nullptr); +#else + // x86_64 never implemented sys_getcpu(), except as a VDSO call. + static_cast(cpu); // Avoid an unused argument compiler warning. + errno = ENOSYS; + return -1; +#endif +} + +// Use fast __vdso_getcpu if available. +long VDSOSupport::InitAndGetCPU(unsigned *cpu, // NOLINT(runtime/int) + void *x, void *y) { + Init(); + GetCpuFn fn = getcpu_fn_.load(std::memory_order_relaxed); + ABSL_RAW_CHECK(fn != &InitAndGetCPU, "Init() did not set getcpu_fn_"); + return (*fn)(cpu, x, y); +} + +// This function must be very fast, and may be called from very +// low level (e.g. tcmalloc). Hence I avoid things like +// GoogleOnceInit() and ::operator new. +ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY +int GetCPU() { + unsigned cpu; + int ret_code = (*VDSOSupport::getcpu_fn_)(&cpu, nullptr, nullptr); + return ret_code == 0 ? cpu : ret_code; +} + +// We need to make sure VDSOSupport::Init() is called before +// InitGoogle() does any setuid or chroot calls. If VDSOSupport +// is used in any global constructor, this will happen, since +// VDSOSupport's constructor calls Init. But if not, we need to +// ensure it here, with a global constructor of our own. This +// is an allowed exception to the normal rule against non-trivial +// global constructors. +static class VDSOInitHelper { + public: + VDSOInitHelper() { VDSOSupport::Init(); } +} vdso_init_helper; + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HAVE_VDSO_SUPPORT diff --git a/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.h b/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.h new file mode 100644 index 0000000..6562c6c --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/internal/vdso_support.h @@ -0,0 +1,158 @@ +// +// 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. +// + +// Allow dynamic symbol lookup in the kernel VDSO page. +// +// VDSO stands for "Virtual Dynamic Shared Object" -- a page of +// executable code, which looks like a shared library, but doesn't +// necessarily exist anywhere on disk, and which gets mmap()ed into +// every process by kernels which support VDSO, such as 2.6.x for 32-bit +// executables, and 2.6.24 and above for 64-bit executables. +// +// More details could be found here: +// http://www.trilithium.com/johan/2005/08/linux-gate/ +// +// VDSOSupport -- a class representing kernel VDSO (if present). +// +// Example usage: +// VDSOSupport vdso; +// VDSOSupport::SymbolInfo info; +// typedef (*FN)(unsigned *, void *, void *); +// FN fn = nullptr; +// if (vdso.LookupSymbol("__vdso_getcpu", "LINUX_2.6", STT_FUNC, &info)) { +// fn = reinterpret_cast(info.address); +// } + +#ifndef ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_ +#define ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_ + +#include + +#include "absl/base/attributes.h" +#include "absl/debugging/internal/elf_mem_image.h" + +#ifdef ABSL_HAVE_ELF_MEM_IMAGE + +#ifdef ABSL_HAVE_VDSO_SUPPORT +#error ABSL_HAVE_VDSO_SUPPORT cannot be directly set +#else +#define ABSL_HAVE_VDSO_SUPPORT 1 +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace debugging_internal { + +// NOTE: this class may be used from within tcmalloc, and can not +// use any memory allocation routines. +class VDSOSupport { + public: + VDSOSupport(); + + typedef ElfMemImage::SymbolInfo SymbolInfo; + typedef ElfMemImage::SymbolIterator SymbolIterator; + + // On PowerPC64 VDSO symbols can either be of type STT_FUNC or STT_NOTYPE + // depending on how the kernel is built. The kernel is normally built with + // STT_NOTYPE type VDSO symbols. Let's make things simpler first by using a + // compile-time constant. +#ifdef __powerpc64__ + enum { kVDSOSymbolType = STT_NOTYPE }; +#else + enum { kVDSOSymbolType = STT_FUNC }; +#endif + + // Answers whether we have a vdso at all. + bool IsPresent() const { return image_.IsPresent(); } + + // Allow to iterate over all VDSO symbols. + SymbolIterator begin() const { return image_.begin(); } + SymbolIterator end() const { return image_.end(); } + + // Look up versioned dynamic symbol in the kernel VDSO. + // Returns false if VDSO is not present, or doesn't contain given + // symbol/version/type combination. + // If info_out != nullptr, additional details are filled in. + bool LookupSymbol(const char *name, const char *version, + int symbol_type, SymbolInfo *info_out) const; + + // Find info about symbol (if any) which overlaps given address. + // Returns true if symbol was found; false if VDSO isn't present + // or doesn't have a symbol overlapping given address. + // If info_out != nullptr, additional details are filled in. + bool LookupSymbolByAddress(const void *address, SymbolInfo *info_out) const; + + // Used only for testing. Replace real VDSO base with a mock. + // Returns previous value of vdso_base_. After you are done testing, + // you are expected to call SetBase() with previous value, in order to + // reset state to the way it was. + const void *SetBase(const void *s); + + // Computes vdso_base_ and returns it. Should be called as early as + // possible; before any thread creation, chroot or setuid. + static const void *Init(); + + private: + // image_ represents VDSO ELF image in memory. + // image_.ehdr_ == nullptr implies there is no VDSO. + ElfMemImage image_; + + // Cached value of auxv AT_SYSINFO_EHDR, computed once. + // This is a tri-state: + // kInvalidBase => value hasn't been determined yet. + // 0 => there is no VDSO. + // else => vma of VDSO Elf{32,64}_Ehdr. + // + // When testing with mock VDSO, low bit is set. + // The low bit is always available because vdso_base_ is + // page-aligned. + static std::atomic vdso_base_; + + // NOLINT on 'long' because these routines mimic kernel api. + // The 'cache' parameter may be used by some versions of the kernel, + // and should be nullptr or point to a static buffer containing at + // least two 'long's. + static long InitAndGetCPU(unsigned *cpu, void *cache, // NOLINT 'long'. + void *unused); + static long GetCPUViaSyscall(unsigned *cpu, void *cache, // NOLINT 'long'. + void *unused); + typedef long (*GetCpuFn)(unsigned *cpu, void *cache, // NOLINT 'long'. + void *unused); + + // This function pointer may point to InitAndGetCPU, + // GetCPUViaSyscall, or __vdso_getcpu at different stages of initialization. + ABSL_CONST_INIT static std::atomic getcpu_fn_; + + friend int GetCPU(void); // Needs access to getcpu_fn_. + + VDSOSupport(const VDSOSupport&) = delete; + VDSOSupport& operator=(const VDSOSupport&) = delete; +}; + +// Same as sched_getcpu() on later glibc versions. +// Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, +// otherwise use syscall(SYS_getcpu,...). +// May return -1 with errno == ENOSYS if the kernel doesn't +// support SYS_getcpu. +int GetCPU(); + +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HAVE_ELF_MEM_IMAGE + +#endif // ABSL_DEBUGGING_INTERNAL_VDSO_SUPPORT_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/stacktrace.cc b/SaraAttended/Pods/abseil/absl/debugging/stacktrace.cc new file mode 100644 index 0000000..1f7c7d8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/stacktrace.cc @@ -0,0 +1,140 @@ +// 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. + +// Produce stack trace. +// +// There are three different ways we can try to get the stack trace: +// +// 1) Our hand-coded stack-unwinder. This depends on a certain stack +// layout, which is used by gcc (and those systems using a +// gcc-compatible ABI) on x86 systems, at least since gcc 2.95. +// It uses the frame pointer to do its work. +// +// 2) The libunwind library. This is still in development, and as a +// separate library adds a new dependency, but doesn't need a frame +// pointer. It also doesn't call malloc. +// +// 3) The gdb unwinder -- also the one used by the c++ exception code. +// It's obviously well-tested, but has a fatal flaw: it can call +// malloc() from the unwinder. This is a problem because we're +// trying to use the unwinder to instrument malloc(). +// +// Note: if you add a new implementation here, make sure it works +// correctly when absl::GetStackTrace() is called with max_depth == 0. +// Some code may do that. + +#include "absl/debugging/stacktrace.h" + +#include + +#include "absl/base/attributes.h" +#include "absl/base/port.h" +#include "absl/debugging/internal/stacktrace_config.h" + +#if defined(ABSL_STACKTRACE_INL_HEADER) +#include ABSL_STACKTRACE_INL_HEADER +#else +# error Cannot calculate stack trace: will need to write for your environment + +# include "absl/debugging/internal/stacktrace_aarch64-inl.inc" +# include "absl/debugging/internal/stacktrace_arm-inl.inc" +# include "absl/debugging/internal/stacktrace_generic-inl.inc" +# include "absl/debugging/internal/stacktrace_powerpc-inl.inc" +# include "absl/debugging/internal/stacktrace_unimplemented-inl.inc" +# include "absl/debugging/internal/stacktrace_win32-inl.inc" +# include "absl/debugging/internal/stacktrace_x86-inl.inc" +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace { + +typedef int (*Unwinder)(void**, int*, int, int, const void*, int*); +std::atomic custom; + +template +ABSL_ATTRIBUTE_ALWAYS_INLINE inline int Unwind(void** result, int* sizes, + int max_depth, int skip_count, + const void* uc, + int* min_dropped_frames) { + Unwinder f = &UnwindImpl; + Unwinder g = custom.load(std::memory_order_acquire); + if (g != nullptr) f = g; + + // Add 1 to skip count for the unwinder function itself + int size = (*f)(result, sizes, max_depth, skip_count + 1, uc, + min_dropped_frames); + // To disable tail call to (*f)(...) + ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); + return size; +} + +} // anonymous namespace + +ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int GetStackFrames( + void** result, int* sizes, int max_depth, int skip_count) { + return Unwind(result, sizes, max_depth, skip_count, nullptr, + nullptr); +} + +ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int +GetStackFramesWithContext(void** result, int* sizes, int max_depth, + int skip_count, const void* uc, + int* min_dropped_frames) { + return Unwind(result, sizes, max_depth, skip_count, uc, + min_dropped_frames); +} + +ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int GetStackTrace( + void** result, int max_depth, int skip_count) { + return Unwind(result, nullptr, max_depth, skip_count, nullptr, + nullptr); +} + +ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int +GetStackTraceWithContext(void** result, int max_depth, int skip_count, + const void* uc, int* min_dropped_frames) { + return Unwind(result, nullptr, max_depth, skip_count, uc, + min_dropped_frames); +} + +void SetStackUnwinder(Unwinder w) { + custom.store(w, std::memory_order_release); +} + +int DefaultStackUnwinder(void** pcs, int* sizes, int depth, int skip, + const void* uc, int* min_dropped_frames) { + skip++; // For this function + Unwinder f = nullptr; + if (sizes == nullptr) { + if (uc == nullptr) { + f = &UnwindImpl; + } else { + f = &UnwindImpl; + } + } else { + if (uc == nullptr) { + f = &UnwindImpl; + } else { + f = &UnwindImpl; + } + } + volatile int x = 0; + int n = (*f)(pcs, sizes, depth, skip, uc, min_dropped_frames); + x = 1; (void) x; // To disable tail call to (*f)(...) + return n; +} + +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/debugging/stacktrace.h b/SaraAttended/Pods/abseil/absl/debugging/stacktrace.h new file mode 100644 index 0000000..0ec0ffd --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/stacktrace.h @@ -0,0 +1,231 @@ +// 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: stacktrace.h +// ----------------------------------------------------------------------------- +// +// This file contains routines to extract the current stack trace and associated +// stack frames. These functions are thread-safe and async-signal-safe. +// +// Note that stack trace functionality is platform dependent and requires +// additional support from the compiler/build system in most cases. (That is, +// this functionality generally only works on platforms/builds that have been +// specifically configured to support it.) +// +// Note: stack traces in Abseil that do not utilize a symbolizer will result in +// frames consisting of function addresses rather than human-readable function +// names. (See symbolize.h for information on symbolizing these values.) + +#ifndef ABSL_DEBUGGING_STACKTRACE_H_ +#define ABSL_DEBUGGING_STACKTRACE_H_ + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// GetStackFrames() +// +// Records program counter values for up to `max_depth` frames, skipping the +// most recent `skip_count` stack frames, stores their corresponding values +// and sizes in `results` and `sizes` buffers, and returns the number of frames +// stored. (Note that the frame generated for the `absl::GetStackFrames()` +// routine itself is also skipped.) +// +// Example: +// +// main() { foo(); } +// foo() { bar(); } +// bar() { +// void* result[10]; +// int sizes[10]; +// int depth = absl::GetStackFrames(result, sizes, 10, 1); +// } +// +// The current stack frame would consist of three function calls: `bar()`, +// `foo()`, and then `main()`; however, since the `GetStackFrames()` call sets +// `skip_count` to `1`, it will skip the frame for `bar()`, the most recently +// invoked function call. It will therefore return 2 and fill `result` with +// program counters within the following functions: +// +// result[0] foo() +// result[1] main() +// +// (Note: in practice, a few more entries after `main()` may be added to account +// for startup processes.) +// +// Corresponding stack frame sizes will also be recorded: +// +// sizes[0] 16 +// sizes[1] 16 +// +// (Stack frame sizes of `16` above are just for illustration purposes.) +// +// Stack frame sizes of 0 or less indicate that those frame sizes couldn't +// be identified. +// +// This routine may return fewer stack frame entries than are +// available. Also note that `result` and `sizes` must both be non-null. +extern int GetStackFrames(void** result, int* sizes, int max_depth, + int skip_count); + +// GetStackFramesWithContext() +// +// Records program counter values obtained from a signal handler. Records +// program counter values for up to `max_depth` frames, skipping the most recent +// `skip_count` stack frames, stores their corresponding values and sizes in +// `results` and `sizes` buffers, and returns the number of frames stored. (Note +// that the frame generated for the `absl::GetStackFramesWithContext()` routine +// itself is also skipped.) +// +// The `uc` parameter, if non-null, should be a pointer to a `ucontext_t` value +// passed to a signal handler registered via the `sa_sigaction` field of a +// `sigaction` struct. (See +// http://man7.org/linux/man-pages/man2/sigaction.2.html.) The `uc` value may +// help a stack unwinder to provide a better stack trace under certain +// conditions. `uc` may safely be null. +// +// The `min_dropped_frames` output parameter, if non-null, points to the +// location to note any dropped stack frames, if any, due to buffer limitations +// or other reasons. (This value will be set to `0` if no frames were dropped.) +// The number of total stack frames is guaranteed to be >= skip_count + +// max_depth + *min_dropped_frames. +extern int GetStackFramesWithContext(void** result, int* sizes, int max_depth, + int skip_count, const void* uc, + int* min_dropped_frames); + +// GetStackTrace() +// +// Records program counter values for up to `max_depth` frames, skipping the +// most recent `skip_count` stack frames, stores their corresponding values +// in `results`, and returns the number of frames +// stored. Note that this function is similar to `absl::GetStackFrames()` +// except that it returns the stack trace only, and not stack frame sizes. +// +// Example: +// +// main() { foo(); } +// foo() { bar(); } +// bar() { +// void* result[10]; +// int depth = absl::GetStackTrace(result, 10, 1); +// } +// +// This produces: +// +// result[0] foo +// result[1] main +// .... ... +// +// `result` must not be null. +extern int GetStackTrace(void** result, int max_depth, int skip_count); + +// GetStackTraceWithContext() +// +// Records program counter values obtained from a signal handler. Records +// program counter values for up to `max_depth` frames, skipping the most recent +// `skip_count` stack frames, stores their corresponding values in `results`, +// and returns the number of frames stored. (Note that the frame generated for +// the `absl::GetStackFramesWithContext()` routine itself is also skipped.) +// +// The `uc` parameter, if non-null, should be a pointer to a `ucontext_t` value +// passed to a signal handler registered via the `sa_sigaction` field of a +// `sigaction` struct. (See +// http://man7.org/linux/man-pages/man2/sigaction.2.html.) The `uc` value may +// help a stack unwinder to provide a better stack trace under certain +// conditions. `uc` may safely be null. +// +// The `min_dropped_frames` output parameter, if non-null, points to the +// location to note any dropped stack frames, if any, due to buffer limitations +// or other reasons. (This value will be set to `0` if no frames were dropped.) +// The number of total stack frames is guaranteed to be >= skip_count + +// max_depth + *min_dropped_frames. +extern int GetStackTraceWithContext(void** result, int max_depth, + int skip_count, const void* uc, + int* min_dropped_frames); + +// SetStackUnwinder() +// +// Provides a custom function for unwinding stack frames that will be used in +// place of the default stack unwinder when invoking the static +// GetStack{Frames,Trace}{,WithContext}() functions above. +// +// The arguments passed to the unwinder function will match the +// arguments passed to `absl::GetStackFramesWithContext()` except that sizes +// will be non-null iff the caller is interested in frame sizes. +// +// If unwinder is set to null, we revert to the default stack-tracing behavior. +// +// ***************************************************************************** +// WARNING +// ***************************************************************************** +// +// absl::SetStackUnwinder is not suitable for general purpose use. It is +// provided for custom runtimes. +// Some things to watch out for when calling `absl::SetStackUnwinder()`: +// +// (a) The unwinder may be called from within signal handlers and +// therefore must be async-signal-safe. +// +// (b) Even after a custom stack unwinder has been unregistered, other +// threads may still be in the process of using that unwinder. +// Therefore do not clean up any state that may be needed by an old +// unwinder. +// ***************************************************************************** +extern void SetStackUnwinder(int (*unwinder)(void** pcs, int* sizes, + int max_depth, int skip_count, + const void* uc, + int* min_dropped_frames)); + +// DefaultStackUnwinder() +// +// Records program counter values of up to `max_depth` frames, skipping the most +// recent `skip_count` stack frames, and stores their corresponding values in +// `pcs`. (Note that the frame generated for this call itself is also skipped.) +// This function acts as a generic stack-unwinder; prefer usage of the more +// specific `GetStack{Trace,Frames}{,WithContext}()` functions above. +// +// If you have set your own stack unwinder (with the `SetStackUnwinder()` +// function above, you can still get the default stack unwinder by calling +// `DefaultStackUnwinder()`, which will ignore any previously set stack unwinder +// and use the default one instead. +// +// Because this function is generic, only `pcs` is guaranteed to be non-null +// upon return. It is legal for `sizes`, `uc`, and `min_dropped_frames` to all +// be null when called. +// +// The semantics are the same as the corresponding `GetStack*()` function in the +// case where `absl::SetStackUnwinder()` was never called. Equivalents are: +// +// null sizes | non-nullptr sizes +// |==========================================================| +// null uc | GetStackTrace() | GetStackFrames() | +// non-null uc | GetStackTraceWithContext() | GetStackFramesWithContext() | +// |==========================================================| +extern int DefaultStackUnwinder(void** pcs, int* sizes, int max_depth, + int skip_count, const void* uc, + int* min_dropped_frames); + +namespace debugging_internal { +// Returns true for platforms which are expected to have functioning stack trace +// implementations. Intended to be used for tests which want to exclude +// verification of logic known to be broken because stack traces are not +// working. +extern bool StackTraceWorksForTest(); +} // namespace debugging_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_STACKTRACE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/symbolize.cc b/SaraAttended/Pods/abseil/absl/debugging/symbolize.cc new file mode 100644 index 0000000..54ed970 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/symbolize.cc @@ -0,0 +1,25 @@ +// 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/debugging/symbolize.h" + +#if defined(ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE) +#include "absl/debugging/symbolize_elf.inc" +#elif defined(_WIN32) +// The Windows Symbolizer only works if PDB files containing the debug info +// are available to the program at runtime. +#include "absl/debugging/symbolize_win32.inc" +#else +#include "absl/debugging/symbolize_unimplemented.inc" +#endif diff --git a/SaraAttended/Pods/abseil/absl/debugging/symbolize.h b/SaraAttended/Pods/abseil/absl/debugging/symbolize.h new file mode 100644 index 0000000..43d93a8 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/symbolize.h @@ -0,0 +1,99 @@ +// 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: symbolize.h +// ----------------------------------------------------------------------------- +// +// This file configures the Abseil symbolizer for use in converting instruction +// pointer addresses (program counters) into human-readable names (function +// calls, etc.) within Abseil code. +// +// The symbolizer may be invoked from several sources: +// +// * Implicitly, through the installation of an Abseil failure signal handler. +// (See failure_signal_handler.h for more information.) +// * By calling `Symbolize()` directly on a program counter you obtain through +// `absl::GetStackTrace()` or `absl::GetStackFrames()`. (See stacktrace.h +// for more information. +// * By calling `Symbolize()` directly on a program counter you obtain through +// other means (which would be platform-dependent). +// +// In all of the above cases, the symbolizer must first be initialized before +// any program counter values can be symbolized. If you are installing a failure +// signal handler, initialize the symbolizer before you do so. +// +// Example: +// +// int main(int argc, char** argv) { +// // Initialize the Symbolizer before installing the failure signal handler +// absl::InitializeSymbolizer(argv[0]); +// +// // Now you may install the failure signal handler +// absl::FailureSignalHandlerOptions options; +// absl::InstallFailureSignalHandler(options); +// +// // Start running your main program +// ... +// return 0; +// } +// +#ifndef ABSL_DEBUGGING_SYMBOLIZE_H_ +#define ABSL_DEBUGGING_SYMBOLIZE_H_ + +#include "absl/debugging/internal/symbolize.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// InitializeSymbolizer() +// +// Initializes the program counter symbolizer, given the path of the program +// (typically obtained through `main()`s `argv[0]`). The Abseil symbolizer +// allows you to read program counters (instruction pointer values) using their +// human-readable names within output such as stack traces. +// +// Example: +// +// int main(int argc, char *argv[]) { +// absl::InitializeSymbolizer(argv[0]); +// // Now you can use the symbolizer +// } +void InitializeSymbolizer(const char* argv0); +// +// Symbolize() +// +// Symbolizes a program counter (instruction pointer value) `pc` and, on +// success, writes the name to `out`. The symbol name is demangled, if possible. +// Note that the symbolized name may be truncated and will be NUL-terminated. +// Demangling is supported for symbols generated by GCC 3.x or newer). Returns +// `false` on failure. +// +// Example: +// +// // Print a program counter and its symbol name. +// static void DumpPCAndSymbol(void *pc) { +// char tmp[1024]; +// const char *symbol = "(unknown)"; +// if (absl::Symbolize(pc, tmp, sizeof(tmp))) { +// symbol = tmp; +// } +// absl::PrintF("%p %s\n", pc, symbol); +// } +bool Symbolize(const void *pc, char *out, int out_size); + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_DEBUGGING_SYMBOLIZE_H_ diff --git a/SaraAttended/Pods/abseil/absl/debugging/symbolize_elf.inc b/SaraAttended/Pods/abseil/absl/debugging/symbolize_elf.inc new file mode 100644 index 0000000..c371635 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/symbolize_elf.inc @@ -0,0 +1,1480 @@ +// 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 Symbolize() function that symbolizes program +// counters to their corresponding symbol names on linux platforms. +// This library has a minimal implementation of an ELF symbol table +// reader (i.e. it doesn't depend on libelf, etc.). +// +// The algorithm used in Symbolize() is as follows. +// +// 1. Go through a list of maps in /proc/self/maps and find the map +// containing the program counter. +// +// 2. Open the mapped file and find a regular symbol table inside. +// Iterate over symbols in the symbol table and look for the symbol +// containing the program counter. If such a symbol is found, +// obtain the symbol name, and demangle the symbol if possible. +// If the symbol isn't found in the regular symbol table (binary is +// stripped), try the same thing with a dynamic symbol table. +// +// Note that Symbolize() is originally implemented to be used in +// signal handlers, hence it doesn't use malloc() and other unsafe +// operations. It should be both thread-safe and async-signal-safe. +// +// Implementation note: +// +// We don't use heaps but only use stacks. We want to reduce the +// stack consumption so that the symbolizer can run on small stacks. +// +// Here are some numbers collected with GCC 4.1.0 on x86: +// - sizeof(Elf32_Sym) = 16 +// - sizeof(Elf32_Shdr) = 40 +// - sizeof(Elf64_Sym) = 24 +// - sizeof(Elf64_Shdr) = 64 +// +// This implementation is intended to be async-signal-safe but uses some +// functions which are not guaranteed to be so, such as memchr() and +// memmove(). We assume they are async-signal-safe. + +#include +#include +#include +#include // For ElfW() macro. +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/base/casts.h" +#include "absl/base/dynamic_annotations.h" +#include "absl/base/internal/low_level_alloc.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/base/internal/spinlock.h" +#include "absl/base/port.h" +#include "absl/debugging/internal/demangle.h" +#include "absl/debugging/internal/vdso_support.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// Value of argv[0]. Used by MaybeInitializeObjFile(). +static char *argv0_value = nullptr; + +void InitializeSymbolizer(const char *argv0) { + if (argv0_value != nullptr) { + free(argv0_value); + argv0_value = nullptr; + } + if (argv0 != nullptr && argv0[0] != '\0') { + argv0_value = strdup(argv0); + } +} + +namespace debugging_internal { +namespace { + +// Re-runs fn until it doesn't cause EINTR. +#define NO_INTR(fn) \ + do { \ + } while ((fn) < 0 && errno == EINTR) + +// On Linux, ELF_ST_* are defined in . To make this portable +// we define our own ELF_ST_BIND and ELF_ST_TYPE if not available. +#ifndef ELF_ST_BIND +#define ELF_ST_BIND(info) (((unsigned char)(info)) >> 4) +#endif + +#ifndef ELF_ST_TYPE +#define ELF_ST_TYPE(info) (((unsigned char)(info)) & 0xF) +#endif + +// Some platforms use a special .opd section to store function pointers. +const char kOpdSectionName[] = ".opd"; + +#if (defined(__powerpc__) && !(_CALL_ELF > 1)) || defined(__ia64) +// Use opd section for function descriptors on these platforms, the function +// address is the first word of the descriptor. +enum { kPlatformUsesOPDSections = 1 }; +#else // not PPC or IA64 +enum { kPlatformUsesOPDSections = 0 }; +#endif + +// This works for PowerPC & IA64 only. A function descriptor consist of two +// pointers and the first one is the function's entry. +const size_t kFunctionDescriptorSize = sizeof(void *) * 2; + +const int kMaxDecorators = 10; // Seems like a reasonable upper limit. + +struct InstalledSymbolDecorator { + SymbolDecorator fn; + void *arg; + int ticket; +}; + +int g_num_decorators; +InstalledSymbolDecorator g_decorators[kMaxDecorators]; + +struct FileMappingHint { + const void *start; + const void *end; + uint64_t offset; + const char *filename; +}; + +// Protects g_decorators. +// We are using SpinLock and not a Mutex here, because we may be called +// from inside Mutex::Lock itself, and it prohibits recursive calls. +// This happens in e.g. base/stacktrace_syscall_unittest. +// Moreover, we are using only TryLock(), if the decorator list +// is being modified (is busy), we skip all decorators, and possibly +// loose some info. Sorry, that's the best we could do. +base_internal::SpinLock g_decorators_mu(base_internal::kLinkerInitialized); + +const int kMaxFileMappingHints = 8; +int g_num_file_mapping_hints; +FileMappingHint g_file_mapping_hints[kMaxFileMappingHints]; +// Protects g_file_mapping_hints. +base_internal::SpinLock g_file_mapping_mu(base_internal::kLinkerInitialized); + +// Async-signal-safe function to zero a buffer. +// memset() is not guaranteed to be async-signal-safe. +static void SafeMemZero(void* p, size_t size) { + unsigned char *c = static_cast(p); + while (size--) { + *c++ = 0; + } +} + +struct ObjFile { + ObjFile() + : filename(nullptr), + start_addr(nullptr), + end_addr(nullptr), + offset(0), + fd(-1), + elf_type(-1) { + SafeMemZero(&elf_header, sizeof(elf_header)); + } + + char *filename; + const void *start_addr; + const void *end_addr; + uint64_t offset; + + // The following fields are initialized on the first access to the + // object file. + int fd; + int elf_type; + ElfW(Ehdr) elf_header; +}; + +// Build 4-way associative cache for symbols. Within each cache line, symbols +// are replaced in LRU order. +enum { + ASSOCIATIVITY = 4, +}; +struct SymbolCacheLine { + const void *pc[ASSOCIATIVITY]; + char *name[ASSOCIATIVITY]; + + // age[i] is incremented when a line is accessed. it's reset to zero if the + // i'th entry is read. + uint32_t age[ASSOCIATIVITY]; +}; + +// --------------------------------------------------------------- +// An async-signal-safe arena for LowLevelAlloc +static std::atomic g_sig_safe_arena; + +static base_internal::LowLevelAlloc::Arena *SigSafeArena() { + return g_sig_safe_arena.load(std::memory_order_acquire); +} + +static void InitSigSafeArena() { + if (SigSafeArena() == nullptr) { + base_internal::LowLevelAlloc::Arena *new_arena = + base_internal::LowLevelAlloc::NewArena( + base_internal::LowLevelAlloc::kAsyncSignalSafe); + base_internal::LowLevelAlloc::Arena *old_value = nullptr; + if (!g_sig_safe_arena.compare_exchange_strong(old_value, new_arena, + std::memory_order_release, + std::memory_order_relaxed)) { + // We lost a race to allocate an arena; deallocate. + base_internal::LowLevelAlloc::DeleteArena(new_arena); + } + } +} + +// --------------------------------------------------------------- +// An AddrMap is a vector of ObjFile, using SigSafeArena() for allocation. + +class AddrMap { + public: + AddrMap() : size_(0), allocated_(0), obj_(nullptr) {} + ~AddrMap() { base_internal::LowLevelAlloc::Free(obj_); } + int Size() const { return size_; } + ObjFile *At(int i) { return &obj_[i]; } + ObjFile *Add(); + void Clear(); + + private: + int size_; // count of valid elements (<= allocated_) + int allocated_; // count of allocated elements + ObjFile *obj_; // array of allocated_ elements + AddrMap(const AddrMap &) = delete; + AddrMap &operator=(const AddrMap &) = delete; +}; + +void AddrMap::Clear() { + for (int i = 0; i != size_; i++) { + At(i)->~ObjFile(); + } + size_ = 0; +} + +ObjFile *AddrMap::Add() { + if (size_ == allocated_) { + int new_allocated = allocated_ * 2 + 50; + ObjFile *new_obj_ = + static_cast(base_internal::LowLevelAlloc::AllocWithArena( + new_allocated * sizeof(*new_obj_), SigSafeArena())); + if (obj_) { + memcpy(new_obj_, obj_, allocated_ * sizeof(*new_obj_)); + base_internal::LowLevelAlloc::Free(obj_); + } + obj_ = new_obj_; + allocated_ = new_allocated; + } + return new (&obj_[size_++]) ObjFile; +} + +// --------------------------------------------------------------- + +enum FindSymbolResult { SYMBOL_NOT_FOUND = 1, SYMBOL_TRUNCATED, SYMBOL_FOUND }; + +class Symbolizer { + public: + Symbolizer(); + ~Symbolizer(); + const char *GetSymbol(const void *const pc); + + private: + char *CopyString(const char *s) { + int len = strlen(s); + char *dst = static_cast( + base_internal::LowLevelAlloc::AllocWithArena(len + 1, SigSafeArena())); + ABSL_RAW_CHECK(dst != nullptr, "out of memory"); + memcpy(dst, s, len + 1); + return dst; + } + ObjFile *FindObjFile(const void *const start, + size_t size) ABSL_ATTRIBUTE_NOINLINE; + static bool RegisterObjFile(const char *filename, + const void *const start_addr, + const void *const end_addr, uint64_t offset, + void *arg); + SymbolCacheLine *GetCacheLine(const void *const pc); + const char *FindSymbolInCache(const void *const pc); + const char *InsertSymbolInCache(const void *const pc, const char *name); + void AgeSymbols(SymbolCacheLine *line); + void ClearAddrMap(); + FindSymbolResult GetSymbolFromObjectFile(const ObjFile &obj, + const void *const pc, + const ptrdiff_t relocation, + char *out, int out_size, + char *tmp_buf, int tmp_buf_size); + + enum { + SYMBOL_BUF_SIZE = 3072, + TMP_BUF_SIZE = 1024, + SYMBOL_CACHE_LINES = 128, + }; + + AddrMap addr_map_; + + bool ok_; + bool addr_map_read_; + + char symbol_buf_[SYMBOL_BUF_SIZE]; + + // tmp_buf_ will be used to store arrays of ElfW(Shdr) and ElfW(Sym) + // so we ensure that tmp_buf_ is properly aligned to store either. + alignas(16) char tmp_buf_[TMP_BUF_SIZE]; + static_assert(alignof(ElfW(Shdr)) <= 16, + "alignment of tmp buf too small for Shdr"); + static_assert(alignof(ElfW(Sym)) <= 16, + "alignment of tmp buf too small for Sym"); + + SymbolCacheLine symbol_cache_[SYMBOL_CACHE_LINES]; +}; + +static std::atomic g_cached_symbolizer; + +} // namespace + +static int SymbolizerSize() { +#if defined(__wasm__) || defined(__asmjs__) + int pagesize = getpagesize(); +#else + int pagesize = sysconf(_SC_PAGESIZE); +#endif + return ((sizeof(Symbolizer) - 1) / pagesize + 1) * pagesize; +} + +// Return (and set null) g_cached_symbolized_state if it is not null. +// Otherwise return a new symbolizer. +static Symbolizer *AllocateSymbolizer() { + InitSigSafeArena(); + Symbolizer *symbolizer = + g_cached_symbolizer.exchange(nullptr, std::memory_order_acquire); + if (symbolizer != nullptr) { + return symbolizer; + } + return new (base_internal::LowLevelAlloc::AllocWithArena( + SymbolizerSize(), SigSafeArena())) Symbolizer(); +} + +// Set g_cached_symbolize_state to s if it is null, otherwise +// delete s. +static void FreeSymbolizer(Symbolizer *s) { + Symbolizer *old_cached_symbolizer = nullptr; + if (!g_cached_symbolizer.compare_exchange_strong(old_cached_symbolizer, s, + std::memory_order_release, + std::memory_order_relaxed)) { + s->~Symbolizer(); + base_internal::LowLevelAlloc::Free(s); + } +} + +Symbolizer::Symbolizer() : ok_(true), addr_map_read_(false) { + for (SymbolCacheLine &symbol_cache_line : symbol_cache_) { + for (size_t j = 0; j < ABSL_ARRAYSIZE(symbol_cache_line.name); ++j) { + symbol_cache_line.pc[j] = nullptr; + symbol_cache_line.name[j] = nullptr; + symbol_cache_line.age[j] = 0; + } + } +} + +Symbolizer::~Symbolizer() { + for (SymbolCacheLine &symbol_cache_line : symbol_cache_) { + for (char *s : symbol_cache_line.name) { + base_internal::LowLevelAlloc::Free(s); + } + } + ClearAddrMap(); +} + +// We don't use assert() since it's not guaranteed to be +// async-signal-safe. Instead we define a minimal assertion +// macro. So far, we don't need pretty printing for __FILE__, etc. +#define SAFE_ASSERT(expr) ((expr) ? static_cast(0) : abort()) + +// Read up to "count" bytes from file descriptor "fd" into the buffer +// starting at "buf" while handling short reads and EINTR. On +// success, return the number of bytes read. Otherwise, return -1. +static ssize_t ReadPersistent(int fd, void *buf, size_t count) { + SAFE_ASSERT(fd >= 0); + SAFE_ASSERT(count <= SSIZE_MAX); + char *buf0 = reinterpret_cast(buf); + size_t num_bytes = 0; + while (num_bytes < count) { + ssize_t len; + NO_INTR(len = read(fd, buf0 + num_bytes, count - num_bytes)); + if (len < 0) { // There was an error other than EINTR. + ABSL_RAW_LOG(WARNING, "read failed: errno=%d", errno); + return -1; + } + if (len == 0) { // Reached EOF. + break; + } + num_bytes += len; + } + SAFE_ASSERT(num_bytes <= count); + return static_cast(num_bytes); +} + +// Read up to "count" bytes from "offset" in the file pointed by file +// descriptor "fd" into the buffer starting at "buf". On success, +// return the number of bytes read. Otherwise, return -1. +static ssize_t ReadFromOffset(const int fd, void *buf, const size_t count, + const off_t offset) { + off_t off = lseek(fd, offset, SEEK_SET); + if (off == (off_t)-1) { + ABSL_RAW_LOG(WARNING, "lseek(%d, %ju, SEEK_SET) failed: errno=%d", fd, + static_cast(offset), errno); + return -1; + } + return ReadPersistent(fd, buf, count); +} + +// Try reading exactly "count" bytes from "offset" bytes in a file +// pointed by "fd" into the buffer starting at "buf" while handling +// short reads and EINTR. On success, return true. Otherwise, return +// false. +static bool ReadFromOffsetExact(const int fd, void *buf, const size_t count, + const off_t offset) { + ssize_t len = ReadFromOffset(fd, buf, count, offset); + return len >= 0 && static_cast(len) == count; +} + +// Returns elf_header.e_type if the file pointed by fd is an ELF binary. +static int FileGetElfType(const int fd) { + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return -1; + } + if (memcmp(elf_header.e_ident, ELFMAG, SELFMAG) != 0) { + return -1; + } + return elf_header.e_type; +} + +// Read the section headers in the given ELF binary, and if a section +// of the specified type is found, set the output to this section header +// and return true. Otherwise, return false. +// To keep stack consumption low, we would like this function to not get +// inlined. +static ABSL_ATTRIBUTE_NOINLINE bool GetSectionHeaderByType( + const int fd, ElfW(Half) sh_num, const off_t sh_offset, ElfW(Word) type, + ElfW(Shdr) * out, char *tmp_buf, int tmp_buf_size) { + ElfW(Shdr) *buf = reinterpret_cast(tmp_buf); + const int buf_entries = tmp_buf_size / sizeof(buf[0]); + const int buf_bytes = buf_entries * sizeof(buf[0]); + + for (int i = 0; i < sh_num;) { + const ssize_t num_bytes_left = (sh_num - i) * sizeof(buf[0]); + const ssize_t num_bytes_to_read = + (buf_bytes > num_bytes_left) ? num_bytes_left : buf_bytes; + const off_t offset = sh_offset + i * sizeof(buf[0]); + const ssize_t len = ReadFromOffset(fd, buf, num_bytes_to_read, offset); + if (len % sizeof(buf[0]) != 0) { + ABSL_RAW_LOG( + WARNING, + "Reading %zd bytes from offset %ju returned %zd which is not a " + "multiple of %zu.", + num_bytes_to_read, static_cast(offset), len, + sizeof(buf[0])); + return false; + } + const ssize_t num_headers_in_buf = len / sizeof(buf[0]); + SAFE_ASSERT(num_headers_in_buf <= buf_entries); + for (int j = 0; j < num_headers_in_buf; ++j) { + if (buf[j].sh_type == type) { + *out = buf[j]; + return true; + } + } + i += num_headers_in_buf; + } + return false; +} + +// There is no particular reason to limit section name to 63 characters, +// but there has (as yet) been no need for anything longer either. +const int kMaxSectionNameLen = 64; + +bool ForEachSection(int fd, + const std::function &callback) { + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return false; + } + + ElfW(Shdr) shstrtab; + off_t shstrtab_offset = + (elf_header.e_shoff + elf_header.e_shentsize * elf_header.e_shstrndx); + if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) { + return false; + } + + for (int i = 0; i < elf_header.e_shnum; ++i) { + ElfW(Shdr) out; + off_t section_header_offset = + (elf_header.e_shoff + elf_header.e_shentsize * i); + if (!ReadFromOffsetExact(fd, &out, sizeof(out), section_header_offset)) { + return false; + } + off_t name_offset = shstrtab.sh_offset + out.sh_name; + char header_name[kMaxSectionNameLen + 1]; + ssize_t n_read = + ReadFromOffset(fd, &header_name, kMaxSectionNameLen, name_offset); + if (n_read == -1) { + return false; + } else if (n_read > kMaxSectionNameLen) { + // Long read? + return false; + } + header_name[n_read] = '\0'; + + std::string name(header_name); + if (!callback(name, out)) { + break; + } + } + return true; +} + +// name_len should include terminating '\0'. +bool GetSectionHeaderByName(int fd, const char *name, size_t name_len, + ElfW(Shdr) * out) { + char header_name[kMaxSectionNameLen]; + if (sizeof(header_name) < name_len) { + ABSL_RAW_LOG(WARNING, + "Section name '%s' is too long (%zu); " + "section will not be found (even if present).", + name, name_len); + // No point in even trying. + return false; + } + + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return false; + } + + ElfW(Shdr) shstrtab; + off_t shstrtab_offset = + (elf_header.e_shoff + elf_header.e_shentsize * elf_header.e_shstrndx); + if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) { + return false; + } + + for (int i = 0; i < elf_header.e_shnum; ++i) { + off_t section_header_offset = + (elf_header.e_shoff + elf_header.e_shentsize * i); + if (!ReadFromOffsetExact(fd, out, sizeof(*out), section_header_offset)) { + return false; + } + off_t name_offset = shstrtab.sh_offset + out->sh_name; + ssize_t n_read = ReadFromOffset(fd, &header_name, name_len, name_offset); + if (n_read < 0) { + return false; + } else if (static_cast(n_read) != name_len) { + // Short read -- name could be at end of file. + continue; + } + if (memcmp(header_name, name, name_len) == 0) { + return true; + } + } + return false; +} + +// Compare symbols at in the same address. +// Return true if we should pick symbol1. +static bool ShouldPickFirstSymbol(const ElfW(Sym) & symbol1, + const ElfW(Sym) & symbol2) { + // If one of the symbols is weak and the other is not, pick the one + // this is not a weak symbol. + char bind1 = ELF_ST_BIND(symbol1.st_info); + char bind2 = ELF_ST_BIND(symbol1.st_info); + if (bind1 == STB_WEAK && bind2 != STB_WEAK) return false; + if (bind2 == STB_WEAK && bind1 != STB_WEAK) return true; + + // If one of the symbols has zero size and the other is not, pick the + // one that has non-zero size. + if (symbol1.st_size != 0 && symbol2.st_size == 0) { + return true; + } + if (symbol1.st_size == 0 && symbol2.st_size != 0) { + return false; + } + + // If one of the symbols has no type and the other is not, pick the + // one that has a type. + char type1 = ELF_ST_TYPE(symbol1.st_info); + char type2 = ELF_ST_TYPE(symbol1.st_info); + if (type1 != STT_NOTYPE && type2 == STT_NOTYPE) { + return true; + } + if (type1 == STT_NOTYPE && type2 != STT_NOTYPE) { + return false; + } + + // Pick the first one, if we still cannot decide. + return true; +} + +// Return true if an address is inside a section. +static bool InSection(const void *address, const ElfW(Shdr) * section) { + const char *start = reinterpret_cast(section->sh_addr); + size_t size = static_cast(section->sh_size); + return start <= address && address < (start + size); +} + +static const char *ComputeOffset(const char *base, ptrdiff_t offset) { + // Note: cast to uintptr_t to avoid undefined behavior when base evaluates to + // zero and offset is non-zero. + return reinterpret_cast( + reinterpret_cast(base) + offset); +} + +// Read a symbol table and look for the symbol containing the +// pc. Iterate over symbols in a symbol table and look for the symbol +// containing "pc". If the symbol is found, and its name fits in +// out_size, the name is written into out and SYMBOL_FOUND is returned. +// If the name does not fit, truncated name is written into out, +// and SYMBOL_TRUNCATED is returned. Out is NUL-terminated. +// If the symbol is not found, SYMBOL_NOT_FOUND is returned; +// To keep stack consumption low, we would like this function to not get +// inlined. +static ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol( + const void *const pc, const int fd, char *out, int out_size, + ptrdiff_t relocation, const ElfW(Shdr) * strtab, const ElfW(Shdr) * symtab, + const ElfW(Shdr) * opd, char *tmp_buf, int tmp_buf_size) { + if (symtab == nullptr) { + return SYMBOL_NOT_FOUND; + } + + // Read multiple symbols at once to save read() calls. + ElfW(Sym) *buf = reinterpret_cast(tmp_buf); + const int buf_entries = tmp_buf_size / sizeof(buf[0]); + + const int num_symbols = symtab->sh_size / symtab->sh_entsize; + + // On platforms using an .opd section (PowerPC & IA64), a function symbol + // has the address of a function descriptor, which contains the real + // starting address. However, we do not always want to use the real + // starting address because we sometimes want to symbolize a function + // pointer into the .opd section, e.g. FindSymbol(&foo,...). + const bool pc_in_opd = + kPlatformUsesOPDSections && opd != nullptr && InSection(pc, opd); + const bool deref_function_descriptor_pointer = + kPlatformUsesOPDSections && opd != nullptr && !pc_in_opd; + + ElfW(Sym) best_match; + SafeMemZero(&best_match, sizeof(best_match)); + bool found_match = false; + for (int i = 0; i < num_symbols;) { + off_t offset = symtab->sh_offset + i * symtab->sh_entsize; + const int num_remaining_symbols = num_symbols - i; + const int entries_in_chunk = std::min(num_remaining_symbols, buf_entries); + const int bytes_in_chunk = entries_in_chunk * sizeof(buf[0]); + const ssize_t len = ReadFromOffset(fd, buf, bytes_in_chunk, offset); + SAFE_ASSERT(len % sizeof(buf[0]) == 0); + const ssize_t num_symbols_in_buf = len / sizeof(buf[0]); + SAFE_ASSERT(num_symbols_in_buf <= entries_in_chunk); + for (int j = 0; j < num_symbols_in_buf; ++j) { + const ElfW(Sym) &symbol = buf[j]; + + // For a DSO, a symbol address is relocated by the loading address. + // We keep the original address for opd redirection below. + const char *const original_start_address = + reinterpret_cast(symbol.st_value); + const char *start_address = + ComputeOffset(original_start_address, relocation); + + if (deref_function_descriptor_pointer && + InSection(original_start_address, opd)) { + // The opd section is mapped into memory. Just dereference + // start_address to get the first double word, which points to the + // function entry. + start_address = *reinterpret_cast(start_address); + } + + // If pc is inside the .opd section, it points to a function descriptor. + const size_t size = pc_in_opd ? kFunctionDescriptorSize : symbol.st_size; + const void *const end_address = ComputeOffset(start_address, size); + if (symbol.st_value != 0 && // Skip null value symbols. + symbol.st_shndx != 0 && // Skip undefined symbols. +#ifdef STT_TLS + ELF_ST_TYPE(symbol.st_info) != STT_TLS && // Skip thread-local data. +#endif // STT_TLS + ((start_address <= pc && pc < end_address) || + (start_address == pc && pc == end_address))) { + if (!found_match || ShouldPickFirstSymbol(symbol, best_match)) { + found_match = true; + best_match = symbol; + } + } + } + i += num_symbols_in_buf; + } + + if (found_match) { + const size_t off = strtab->sh_offset + best_match.st_name; + const ssize_t n_read = ReadFromOffset(fd, out, out_size, off); + if (n_read <= 0) { + // This should never happen. + ABSL_RAW_LOG(WARNING, + "Unable to read from fd %d at offset %zu: n_read = %zd", fd, + off, n_read); + return SYMBOL_NOT_FOUND; + } + ABSL_RAW_CHECK(n_read <= out_size, "ReadFromOffset read too much data."); + + // strtab->sh_offset points into .strtab-like section that contains + // NUL-terminated strings: '\0foo\0barbaz\0...". + // + // sh_offset+st_name points to the start of symbol name, but we don't know + // how long the symbol is, so we try to read as much as we have space for, + // and usually over-read (i.e. there is a NUL somewhere before n_read). + if (memchr(out, '\0', n_read) == nullptr) { + // Either out_size was too small (n_read == out_size and no NUL), or + // we tried to read past the EOF (n_read < out_size) and .strtab is + // corrupt (missing terminating NUL; should never happen for valid ELF). + out[n_read - 1] = '\0'; + return SYMBOL_TRUNCATED; + } + return SYMBOL_FOUND; + } + + return SYMBOL_NOT_FOUND; +} + +// Get the symbol name of "pc" from the file pointed by "fd". Process +// both regular and dynamic symbol tables if necessary. +// See FindSymbol() comment for description of return value. +FindSymbolResult Symbolizer::GetSymbolFromObjectFile( + const ObjFile &obj, const void *const pc, const ptrdiff_t relocation, + char *out, int out_size, char *tmp_buf, int tmp_buf_size) { + ElfW(Shdr) symtab; + ElfW(Shdr) strtab; + ElfW(Shdr) opd; + ElfW(Shdr) *opd_ptr = nullptr; + + // On platforms using an .opd sections for function descriptor, read + // the section header. The .opd section is in data segment and should be + // loaded but we check that it is mapped just to be extra careful. + if (kPlatformUsesOPDSections) { + if (GetSectionHeaderByName(obj.fd, kOpdSectionName, + sizeof(kOpdSectionName) - 1, &opd) && + FindObjFile(reinterpret_cast(opd.sh_addr) + relocation, + opd.sh_size) != nullptr) { + opd_ptr = &opd; + } else { + return SYMBOL_NOT_FOUND; + } + } + + // Consult a regular symbol table, then fall back to the dynamic symbol table. + for (const auto symbol_table_type : {SHT_SYMTAB, SHT_DYNSYM}) { + if (!GetSectionHeaderByType(obj.fd, obj.elf_header.e_shnum, + obj.elf_header.e_shoff, symbol_table_type, + &symtab, tmp_buf, tmp_buf_size)) { + continue; + } + if (!ReadFromOffsetExact( + obj.fd, &strtab, sizeof(strtab), + obj.elf_header.e_shoff + symtab.sh_link * sizeof(symtab))) { + continue; + } + const FindSymbolResult rc = + FindSymbol(pc, obj.fd, out, out_size, relocation, &strtab, &symtab, + opd_ptr, tmp_buf, tmp_buf_size); + if (rc != SYMBOL_NOT_FOUND) { + return rc; + } + } + + return SYMBOL_NOT_FOUND; +} + +namespace { +// Thin wrapper around a file descriptor so that the file descriptor +// gets closed for sure. +class FileDescriptor { + public: + explicit FileDescriptor(int fd) : fd_(fd) {} + FileDescriptor(const FileDescriptor &) = delete; + FileDescriptor &operator=(const FileDescriptor &) = delete; + + ~FileDescriptor() { + if (fd_ >= 0) { + NO_INTR(close(fd_)); + } + } + + int get() const { return fd_; } + + private: + const int fd_; +}; + +// Helper class for reading lines from file. +// +// Note: we don't use ProcMapsIterator since the object is big (it has +// a 5k array member) and uses async-unsafe functions such as sscanf() +// and snprintf(). +class LineReader { + public: + explicit LineReader(int fd, char *buf, int buf_len) + : fd_(fd), + buf_len_(buf_len), + buf_(buf), + bol_(buf), + eol_(buf), + eod_(buf) {} + + LineReader(const LineReader &) = delete; + LineReader &operator=(const LineReader &) = delete; + + // Read '\n'-terminated line from file. On success, modify "bol" + // and "eol", then return true. Otherwise, return false. + // + // Note: if the last line doesn't end with '\n', the line will be + // dropped. It's an intentional behavior to make the code simple. + bool ReadLine(const char **bol, const char **eol) { + if (BufferIsEmpty()) { // First time. + const ssize_t num_bytes = ReadPersistent(fd_, buf_, buf_len_); + if (num_bytes <= 0) { // EOF or error. + return false; + } + eod_ = buf_ + num_bytes; + bol_ = buf_; + } else { + bol_ = eol_ + 1; // Advance to the next line in the buffer. + SAFE_ASSERT(bol_ <= eod_); // "bol_" can point to "eod_". + if (!HasCompleteLine()) { + const int incomplete_line_length = eod_ - bol_; + // Move the trailing incomplete line to the beginning. + memmove(buf_, bol_, incomplete_line_length); + // Read text from file and append it. + char *const append_pos = buf_ + incomplete_line_length; + const int capacity_left = buf_len_ - incomplete_line_length; + const ssize_t num_bytes = + ReadPersistent(fd_, append_pos, capacity_left); + if (num_bytes <= 0) { // EOF or error. + return false; + } + eod_ = append_pos + num_bytes; + bol_ = buf_; + } + } + eol_ = FindLineFeed(); + if (eol_ == nullptr) { // '\n' not found. Malformed line. + return false; + } + *eol_ = '\0'; // Replace '\n' with '\0'. + + *bol = bol_; + *eol = eol_; + return true; + } + + private: + char *FindLineFeed() const { + return reinterpret_cast(memchr(bol_, '\n', eod_ - bol_)); + } + + bool BufferIsEmpty() const { return buf_ == eod_; } + + bool HasCompleteLine() const { + return !BufferIsEmpty() && FindLineFeed() != nullptr; + } + + const int fd_; + const int buf_len_; + char *const buf_; + char *bol_; + char *eol_; + const char *eod_; // End of data in "buf_". +}; +} // namespace + +// Place the hex number read from "start" into "*hex". The pointer to +// the first non-hex character or "end" is returned. +static const char *GetHex(const char *start, const char *end, + uint64_t *const value) { + uint64_t hex = 0; + const char *p; + for (p = start; p < end; ++p) { + int ch = *p; + if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || + (ch >= 'a' && ch <= 'f')) { + hex = (hex << 4) | (ch < 'A' ? ch - '0' : (ch & 0xF) + 9); + } else { // Encountered the first non-hex character. + break; + } + } + SAFE_ASSERT(p <= end); + *value = hex; + return p; +} + +static const char *GetHex(const char *start, const char *end, + const void **const addr) { + uint64_t hex = 0; + const char *p = GetHex(start, end, &hex); + *addr = reinterpret_cast(hex); + return p; +} + +// Normally we are only interested in "r?x" maps. +// On the PowerPC, function pointers point to descriptors in the .opd +// section. The descriptors themselves are not executable code, so +// we need to relax the check below to "r??". +static bool ShouldUseMapping(const char *const flags) { + return flags[0] == 'r' && (kPlatformUsesOPDSections || flags[2] == 'x'); +} + +// Read /proc/self/maps and run "callback" for each mmapped file found. If +// "callback" returns false, stop scanning and return true. Else continue +// scanning /proc/self/maps. Return true if no parse error is found. +static ABSL_ATTRIBUTE_NOINLINE bool ReadAddrMap( + bool (*callback)(const char *filename, const void *const start_addr, + const void *const end_addr, uint64_t offset, void *arg), + void *arg, void *tmp_buf, int tmp_buf_size) { + // Use /proc/self/task//maps instead of /proc/self/maps. The latter + // requires kernel to stop all threads, and is significantly slower when there + // are 1000s of threads. + char maps_path[80]; + snprintf(maps_path, sizeof(maps_path), "/proc/self/task/%d/maps", getpid()); + + int maps_fd; + NO_INTR(maps_fd = open(maps_path, O_RDONLY)); + FileDescriptor wrapped_maps_fd(maps_fd); + if (wrapped_maps_fd.get() < 0) { + ABSL_RAW_LOG(WARNING, "%s: errno=%d", maps_path, errno); + return false; + } + + // Iterate over maps and look for the map containing the pc. Then + // look into the symbol tables inside. + LineReader reader(wrapped_maps_fd.get(), static_cast(tmp_buf), + tmp_buf_size); + while (true) { + const char *cursor; + const char *eol; + if (!reader.ReadLine(&cursor, &eol)) { // EOF or malformed line. + break; + } + + const char *line = cursor; + const void *start_address; + // Start parsing line in /proc/self/maps. Here is an example: + // + // 08048000-0804c000 r-xp 00000000 08:01 2142121 /bin/cat + // + // We want start address (08048000), end address (0804c000), flags + // (r-xp) and file name (/bin/cat). + + // Read start address. + cursor = GetHex(cursor, eol, &start_address); + if (cursor == eol || *cursor != '-') { + ABSL_RAW_LOG(WARNING, "Corrupt /proc/self/maps line: %s", line); + return false; + } + ++cursor; // Skip '-'. + + // Read end address. + const void *end_address; + cursor = GetHex(cursor, eol, &end_address); + if (cursor == eol || *cursor != ' ') { + ABSL_RAW_LOG(WARNING, "Corrupt /proc/self/maps line: %s", line); + return false; + } + ++cursor; // Skip ' '. + + // Read flags. Skip flags until we encounter a space or eol. + const char *const flags_start = cursor; + while (cursor < eol && *cursor != ' ') { + ++cursor; + } + // We expect at least four letters for flags (ex. "r-xp"). + if (cursor == eol || cursor < flags_start + 4) { + ABSL_RAW_LOG(WARNING, "Corrupt /proc/self/maps: %s", line); + return false; + } + + // Check flags. + if (!ShouldUseMapping(flags_start)) { + continue; // We skip this map. + } + ++cursor; // Skip ' '. + + // Read file offset. + uint64_t offset; + cursor = GetHex(cursor, eol, &offset); + ++cursor; // Skip ' '. + + // Skip to file name. "cursor" now points to dev. We need to skip at least + // two spaces for dev and inode. + int num_spaces = 0; + while (cursor < eol) { + if (*cursor == ' ') { + ++num_spaces; + } else if (num_spaces >= 2) { + // The first non-space character after skipping two spaces + // is the beginning of the file name. + break; + } + ++cursor; + } + + // Check whether this entry corresponds to our hint table for the true + // filename. + bool hinted = + GetFileMappingHint(&start_address, &end_address, &offset, &cursor); + if (!hinted && (cursor == eol || cursor[0] == '[')) { + // not an object file, typically [vdso] or [vsyscall] + continue; + } + if (!callback(cursor, start_address, end_address, offset, arg)) break; + } + return true; +} + +// Find the objfile mapped in address region containing [addr, addr + len). +ObjFile *Symbolizer::FindObjFile(const void *const addr, size_t len) { + for (int i = 0; i < 2; ++i) { + if (!ok_) return nullptr; + + // Read /proc/self/maps if necessary + if (!addr_map_read_) { + addr_map_read_ = true; + if (!ReadAddrMap(RegisterObjFile, this, tmp_buf_, TMP_BUF_SIZE)) { + ok_ = false; + return nullptr; + } + } + + int lo = 0; + int hi = addr_map_.Size(); + while (lo < hi) { + int mid = (lo + hi) / 2; + if (addr < addr_map_.At(mid)->end_addr) { + hi = mid; + } else { + lo = mid + 1; + } + } + if (lo != addr_map_.Size()) { + ObjFile *obj = addr_map_.At(lo); + SAFE_ASSERT(obj->end_addr > addr); + if (addr >= obj->start_addr && + reinterpret_cast(addr) + len <= obj->end_addr) + return obj; + } + + // The address mapping may have changed since it was last read. Retry. + ClearAddrMap(); + } + return nullptr; +} + +void Symbolizer::ClearAddrMap() { + for (int i = 0; i != addr_map_.Size(); i++) { + ObjFile *o = addr_map_.At(i); + base_internal::LowLevelAlloc::Free(o->filename); + if (o->fd >= 0) { + NO_INTR(close(o->fd)); + } + } + addr_map_.Clear(); + addr_map_read_ = false; +} + +// Callback for ReadAddrMap to register objfiles in an in-memory table. +bool Symbolizer::RegisterObjFile(const char *filename, + const void *const start_addr, + const void *const end_addr, uint64_t offset, + void *arg) { + Symbolizer *impl = static_cast(arg); + + // Files are supposed to be added in the increasing address order. Make + // sure that's the case. + int addr_map_size = impl->addr_map_.Size(); + if (addr_map_size != 0) { + ObjFile *old = impl->addr_map_.At(addr_map_size - 1); + if (old->end_addr > end_addr) { + ABSL_RAW_LOG(ERROR, + "Unsorted addr map entry: 0x%" PRIxPTR ": %s <-> 0x%" PRIxPTR + ": %s", + reinterpret_cast(end_addr), filename, + reinterpret_cast(old->end_addr), old->filename); + return true; + } else if (old->end_addr == end_addr) { + // The same entry appears twice. This sometimes happens for [vdso]. + if (old->start_addr != start_addr || + strcmp(old->filename, filename) != 0) { + ABSL_RAW_LOG(ERROR, + "Duplicate addr 0x%" PRIxPTR ": %s <-> 0x%" PRIxPTR ": %s", + reinterpret_cast(end_addr), filename, + reinterpret_cast(old->end_addr), old->filename); + } + return true; + } + } + ObjFile *obj = impl->addr_map_.Add(); + obj->filename = impl->CopyString(filename); + obj->start_addr = start_addr; + obj->end_addr = end_addr; + obj->offset = offset; + obj->elf_type = -1; // filled on demand + obj->fd = -1; // opened on demand + return true; +} + +// This function wraps the Demangle function to provide an interface +// where the input symbol is demangled in-place. +// To keep stack consumption low, we would like this function to not +// get inlined. +static ABSL_ATTRIBUTE_NOINLINE void DemangleInplace(char *out, int out_size, + char *tmp_buf, + int tmp_buf_size) { + if (Demangle(out, tmp_buf, tmp_buf_size)) { + // Demangling succeeded. Copy to out if the space allows. + int len = strlen(tmp_buf); + if (len + 1 <= out_size) { // +1 for '\0'. + SAFE_ASSERT(len < tmp_buf_size); + memmove(out, tmp_buf, len + 1); + } + } +} + +SymbolCacheLine *Symbolizer::GetCacheLine(const void *const pc) { + uintptr_t pc0 = reinterpret_cast(pc); + pc0 >>= 3; // drop the low 3 bits + + // Shuffle bits. + pc0 ^= (pc0 >> 6) ^ (pc0 >> 12) ^ (pc0 >> 18); + return &symbol_cache_[pc0 % SYMBOL_CACHE_LINES]; +} + +void Symbolizer::AgeSymbols(SymbolCacheLine *line) { + for (uint32_t &age : line->age) { + ++age; + } +} + +const char *Symbolizer::FindSymbolInCache(const void *const pc) { + if (pc == nullptr) return nullptr; + + SymbolCacheLine *line = GetCacheLine(pc); + for (size_t i = 0; i < ABSL_ARRAYSIZE(line->pc); ++i) { + if (line->pc[i] == pc) { + AgeSymbols(line); + line->age[i] = 0; + return line->name[i]; + } + } + return nullptr; +} + +const char *Symbolizer::InsertSymbolInCache(const void *const pc, + const char *name) { + SAFE_ASSERT(pc != nullptr); + + SymbolCacheLine *line = GetCacheLine(pc); + uint32_t max_age = 0; + int oldest_index = -1; + for (size_t i = 0; i < ABSL_ARRAYSIZE(line->pc); ++i) { + if (line->pc[i] == nullptr) { + AgeSymbols(line); + line->pc[i] = pc; + line->name[i] = CopyString(name); + line->age[i] = 0; + return line->name[i]; + } + if (line->age[i] >= max_age) { + max_age = line->age[i]; + oldest_index = i; + } + } + + AgeSymbols(line); + ABSL_RAW_CHECK(oldest_index >= 0, "Corrupt cache"); + base_internal::LowLevelAlloc::Free(line->name[oldest_index]); + line->pc[oldest_index] = pc; + line->name[oldest_index] = CopyString(name); + line->age[oldest_index] = 0; + return line->name[oldest_index]; +} + +static void MaybeOpenFdFromSelfExe(ObjFile *obj) { + if (memcmp(obj->start_addr, ELFMAG, SELFMAG) != 0) { + return; + } + int fd = open("/proc/self/exe", O_RDONLY); + if (fd == -1) { + return; + } + // Verify that contents of /proc/self/exe matches in-memory image of + // the binary. This can fail if the "deleted" binary is in fact not + // the main executable, or for binaries that have the first PT_LOAD + // segment smaller than 4K. We do it in four steps so that the + // buffer is smaller and we don't consume too much stack space. + const char *mem = reinterpret_cast(obj->start_addr); + for (int i = 0; i < 4; ++i) { + char buf[1024]; + ssize_t n = read(fd, buf, sizeof(buf)); + if (n != sizeof(buf) || memcmp(buf, mem, sizeof(buf)) != 0) { + close(fd); + return; + } + mem += sizeof(buf); + } + obj->fd = fd; +} + +static bool MaybeInitializeObjFile(ObjFile *obj) { + if (obj->fd < 0) { + obj->fd = open(obj->filename, O_RDONLY); + + if (obj->fd < 0) { + // Getting /proc/self/exe here means that we were hinted. + if (strcmp(obj->filename, "/proc/self/exe") == 0) { + // /proc/self/exe may be inaccessible (due to setuid, etc.), so try + // accessing the binary via argv0. + if (argv0_value != nullptr) { + obj->fd = open(argv0_value, O_RDONLY); + } + } else { + MaybeOpenFdFromSelfExe(obj); + } + } + + if (obj->fd < 0) { + ABSL_RAW_LOG(WARNING, "%s: open failed: errno=%d", obj->filename, errno); + return false; + } + obj->elf_type = FileGetElfType(obj->fd); + if (obj->elf_type < 0) { + ABSL_RAW_LOG(WARNING, "%s: wrong elf type: %d", obj->filename, + obj->elf_type); + return false; + } + + if (!ReadFromOffsetExact(obj->fd, &obj->elf_header, sizeof(obj->elf_header), + 0)) { + ABSL_RAW_LOG(WARNING, "%s: failed to read elf header", obj->filename); + return false; + } + } + return true; +} + +// The implementation of our symbolization routine. If it +// successfully finds the symbol containing "pc" and obtains the +// symbol name, returns pointer to that symbol. Otherwise, returns nullptr. +// If any symbol decorators have been installed via InstallSymbolDecorator(), +// they are called here as well. +// To keep stack consumption low, we would like this function to not +// get inlined. +const char *Symbolizer::GetSymbol(const void *const pc) { + const char *entry = FindSymbolInCache(pc); + if (entry != nullptr) { + return entry; + } + symbol_buf_[0] = '\0'; + + ObjFile *const obj = FindObjFile(pc, 1); + ptrdiff_t relocation = 0; + int fd = -1; + if (obj != nullptr) { + if (MaybeInitializeObjFile(obj)) { + if (obj->elf_type == ET_DYN && + reinterpret_cast(obj->start_addr) >= obj->offset) { + // This object was relocated. + // + // For obj->offset > 0, adjust the relocation since a mapping at offset + // X in the file will have a start address of [true relocation]+X. + relocation = reinterpret_cast(obj->start_addr) - obj->offset; + } + + fd = obj->fd; + } + if (GetSymbolFromObjectFile(*obj, pc, relocation, symbol_buf_, + sizeof(symbol_buf_), tmp_buf_, + sizeof(tmp_buf_)) == SYMBOL_FOUND) { + // Only try to demangle the symbol name if it fit into symbol_buf_. + DemangleInplace(symbol_buf_, sizeof(symbol_buf_), tmp_buf_, + sizeof(tmp_buf_)); + } + } else { +#if ABSL_HAVE_VDSO_SUPPORT + VDSOSupport vdso; + if (vdso.IsPresent()) { + VDSOSupport::SymbolInfo symbol_info; + if (vdso.LookupSymbolByAddress(pc, &symbol_info)) { + // All VDSO symbols are known to be short. + size_t len = strlen(symbol_info.name); + ABSL_RAW_CHECK(len + 1 < sizeof(symbol_buf_), + "VDSO symbol unexpectedly long"); + memcpy(symbol_buf_, symbol_info.name, len + 1); + } + } +#endif + } + + if (g_decorators_mu.TryLock()) { + if (g_num_decorators > 0) { + SymbolDecoratorArgs decorator_args = { + pc, relocation, fd, symbol_buf_, sizeof(symbol_buf_), + tmp_buf_, sizeof(tmp_buf_), nullptr}; + for (int i = 0; i < g_num_decorators; ++i) { + decorator_args.arg = g_decorators[i].arg; + g_decorators[i].fn(&decorator_args); + } + } + g_decorators_mu.Unlock(); + } + if (symbol_buf_[0] == '\0') { + return nullptr; + } + symbol_buf_[sizeof(symbol_buf_) - 1] = '\0'; // Paranoia. + return InsertSymbolInCache(pc, symbol_buf_); +} + +bool RemoveAllSymbolDecorators(void) { + if (!g_decorators_mu.TryLock()) { + // Someone else is using decorators. Get out. + return false; + } + g_num_decorators = 0; + g_decorators_mu.Unlock(); + return true; +} + +bool RemoveSymbolDecorator(int ticket) { + if (!g_decorators_mu.TryLock()) { + // Someone else is using decorators. Get out. + return false; + } + for (int i = 0; i < g_num_decorators; ++i) { + if (g_decorators[i].ticket == ticket) { + while (i < g_num_decorators - 1) { + g_decorators[i] = g_decorators[i + 1]; + ++i; + } + g_num_decorators = i; + break; + } + } + g_decorators_mu.Unlock(); + return true; // Decorator is known to be removed. +} + +int InstallSymbolDecorator(SymbolDecorator decorator, void *arg) { + static int ticket = 0; + + if (!g_decorators_mu.TryLock()) { + // Someone else is using decorators. Get out. + return false; + } + int ret = ticket; + if (g_num_decorators >= kMaxDecorators) { + ret = -1; + } else { + g_decorators[g_num_decorators] = {decorator, arg, ticket++}; + ++g_num_decorators; + } + g_decorators_mu.Unlock(); + return ret; +} + +bool RegisterFileMappingHint(const void *start, const void *end, uint64_t offset, + const char *filename) { + SAFE_ASSERT(start <= end); + SAFE_ASSERT(filename != nullptr); + + InitSigSafeArena(); + + if (!g_file_mapping_mu.TryLock()) { + return false; + } + + bool ret = true; + if (g_num_file_mapping_hints >= kMaxFileMappingHints) { + ret = false; + } else { + // TODO(ckennelly): Move this into a std::string copy routine. + int len = strlen(filename); + char *dst = static_cast( + base_internal::LowLevelAlloc::AllocWithArena(len + 1, SigSafeArena())); + ABSL_RAW_CHECK(dst != nullptr, "out of memory"); + memcpy(dst, filename, len + 1); + + auto &hint = g_file_mapping_hints[g_num_file_mapping_hints++]; + hint.start = start; + hint.end = end; + hint.offset = offset; + hint.filename = dst; + } + + g_file_mapping_mu.Unlock(); + return ret; +} + +bool GetFileMappingHint(const void **start, const void **end, uint64_t *offset, + const char **filename) { + if (!g_file_mapping_mu.TryLock()) { + return false; + } + bool found = false; + for (int i = 0; i < g_num_file_mapping_hints; i++) { + if (g_file_mapping_hints[i].start <= *start && + *end <= g_file_mapping_hints[i].end) { + // We assume that the start_address for the mapping is the base + // address of the ELF section, but when [start_address,end_address) is + // not strictly equal to [hint.start, hint.end), that assumption is + // invalid. + // + // This uses the hint's start address (even though hint.start is not + // necessarily equal to start_address) to ensure the correct + // relocation is computed later. + *start = g_file_mapping_hints[i].start; + *end = g_file_mapping_hints[i].end; + *offset = g_file_mapping_hints[i].offset; + *filename = g_file_mapping_hints[i].filename; + found = true; + break; + } + } + g_file_mapping_mu.Unlock(); + return found; +} + +} // namespace debugging_internal + +bool Symbolize(const void *pc, char *out, int out_size) { + // Symbolization is very slow under tsan. + ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN(); + SAFE_ASSERT(out_size >= 0); + debugging_internal::Symbolizer *s = debugging_internal::AllocateSymbolizer(); + const char *name = s->GetSymbol(pc); + bool ok = false; + if (name != nullptr && out_size > 0) { + strncpy(out, name, out_size); + ok = true; + if (out[out_size - 1] != '\0') { + // strncpy() does not '\0' terminate when it truncates. Do so, with + // trailing ellipsis. + static constexpr char kEllipsis[] = "..."; + int ellipsis_size = + std::min(implicit_cast(strlen(kEllipsis)), out_size - 1); + memcpy(out + out_size - ellipsis_size - 1, kEllipsis, ellipsis_size); + out[out_size - 1] = '\0'; + } + } + debugging_internal::FreeSymbolizer(s); + ANNOTATE_IGNORE_READS_AND_WRITES_END(); + return ok; +} + +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/debugging/symbolize_unimplemented.inc b/SaraAttended/Pods/abseil/absl/debugging/symbolize_unimplemented.inc new file mode 100644 index 0000000..db24456 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/symbolize_unimplemented.inc @@ -0,0 +1,40 @@ +// 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/raw_logging.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +namespace debugging_internal { + +int InstallSymbolDecorator(SymbolDecorator, void*) { return -1; } +bool RemoveSymbolDecorator(int) { return false; } +bool RemoveAllSymbolDecorators(void) { return false; } +bool RegisterFileMappingHint(const void *, const void *, uint64_t, const char *) { + return false; +} +bool GetFileMappingHint(const void **, const void **, uint64_t *, const char **) { + return false; +} + +} // namespace debugging_internal + +void InitializeSymbolizer(const char*) {} +bool Symbolize(const void *, char *, int) { return false; } + +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/debugging/symbolize_win32.inc b/SaraAttended/Pods/abseil/absl/debugging/symbolize_win32.inc new file mode 100644 index 0000000..c3df46f --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/debugging/symbolize_win32.inc @@ -0,0 +1,81 @@ +// 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 "Retrieving Symbol Information by Address": +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680578(v=vs.85).aspx + +#include + +// MSVC header dbghelp.h has a warning for an ignored typedef. +#pragma warning(push) +#pragma warning(disable:4091) +#include +#pragma warning(pop) + +#pragma comment(lib, "dbghelp.lib") + +#include +#include + +#include "absl/base/internal/raw_logging.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +static HANDLE process = NULL; + +void InitializeSymbolizer(const char*) { + if (process != nullptr) { + return; + } + process = GetCurrentProcess(); + + // Symbols are not loaded until a reference is made requiring the + // symbols be loaded. This is the fastest, most efficient way to use + // the symbol handler. + SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME); + if (!SymInitialize(process, nullptr, true)) { + // GetLastError() returns a Win32 DWORD, but we assign to + // unsigned long long to simplify the ABSL_RAW_LOG case below. The uniform + // initialization guarantees this is not a narrowing conversion. + const unsigned long long error{GetLastError()}; // NOLINT(runtime/int) + ABSL_RAW_LOG(FATAL, "SymInitialize() failed: %llu", error); + } +} + +bool Symbolize(const void* pc, char* out, int out_size) { + if (out_size <= 0) { + return false; + } + alignas(SYMBOL_INFO) char buf[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; + SYMBOL_INFO* symbol = reinterpret_cast(buf); + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); + symbol->MaxNameLen = MAX_SYM_NAME; + if (!SymFromAddr(process, reinterpret_cast(pc), nullptr, symbol)) { + return false; + } + strncpy(out, symbol->Name, out_size); + if (out[out_size - 1] != '\0') { + // strncpy() does not '\0' terminate when it truncates. + static constexpr char kEllipsis[] = "..."; + int ellipsis_size = + std::min(sizeof(kEllipsis) - 1, out_size - 1); + memcpy(out + out_size - ellipsis_size - 1, kEllipsis, ellipsis_size); + out[out_size - 1] = '\0'; + } + return true; +} + +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/hash/hash.h b/SaraAttended/Pods/abseil/absl/hash/hash.h new file mode 100644 index 0000000..23a65ea --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/hash/hash.h @@ -0,0 +1,324 @@ +// 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: hash.h +// ----------------------------------------------------------------------------- +// +// This header file defines the Abseil `hash` library and the Abseil hashing +// framework. This framework consists of the following: +// +// * The `absl::Hash` functor, which is used to invoke the hasher within the +// Abseil hashing framework. `absl::Hash` supports most basic types and +// a number of Abseil types out of the box. +// * `AbslHashValue`, an extension point that allows you to extend types to +// support Abseil hashing without requiring you to define a hashing +// algorithm. +// * `HashState`, a type-erased class which implements the manipulation of the +// hash state (H) itself, contains member functions `combine()` and +// `combine_contiguous()`, which you can use to contribute to an existing +// hash state when hashing your types. +// +// Unlike `std::hash` or other hashing frameworks, the Abseil hashing framework +// provides most of its utility by abstracting away the hash algorithm (and its +// implementation) entirely. Instead, a type invokes the Abseil hashing +// framework by simply combining its state with the state of known, hashable +// types. Hashing of that combined state is separately done by `absl::Hash`. +// +// One should assume that a hash algorithm is chosen randomly at the start of +// each process. E.g., absl::Hash()(9) in one process and +// absl::Hash()(9) in another process are likely to differ. +// +// Example: +// +// // Suppose we have a class `Circle` for which we want to add hashing: +// class Circle { +// public: +// ... +// private: +// std::pair center_; +// int radius_; +// }; +// +// // To add hashing support to `Circle`, we simply need to add a free +// // (non-member) function `AbslHashValue()`, and return the combined hash +// // state of the existing hash state and the class state. You can add such a +// // free function using a friend declaration within the body of the class: +// class Circle { +// public: +// ... +// template +// friend H AbslHashValue(H h, const Circle& c) { +// return H::combine(std::move(h), c.center_, c.radius_); +// } +// ... +// }; +// +// For more information, see Adding Type Support to `absl::Hash` below. +// +#ifndef ABSL_HASH_HASH_H_ +#define ABSL_HASH_HASH_H_ + +#include "absl/hash/internal/hash.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// ----------------------------------------------------------------------------- +// `absl::Hash` +// ----------------------------------------------------------------------------- +// +// `absl::Hash` is a convenient general-purpose hash functor for any type `T` +// satisfying any of the following conditions (in order): +// +// * T is an arithmetic or pointer type +// * T defines an overload for `AbslHashValue(H, const T&)` for an arbitrary +// hash state `H`. +// - T defines a specialization of `HASH_NAMESPACE::hash` +// - T defines a specialization of `std::hash` +// +// `absl::Hash` intrinsically supports the following types: +// +// * All integral types (including bool) +// * All enum types +// * All floating-point types (although hashing them is discouraged) +// * All pointer types, including nullptr_t +// * std::pair, if T1 and T2 are hashable +// * std::tuple, if all the Ts... are hashable +// * std::unique_ptr and std::shared_ptr +// * All string-like types including: +// * std::string +// * std::string_view (as well as any instance of std::basic_string that +// uses char and std::char_traits) +// * All the standard sequence containers (provided the elements are hashable) +// * All the standard ordered associative containers (provided the elements are +// hashable) +// * absl types such as the following: +// * absl::string_view +// * absl::InlinedVector +// * absl::FixedArray +// * absl::uint128 +// * absl::Time, absl::Duration, and absl::TimeZone +// +// Note: the list above is not meant to be exhaustive. Additional type support +// may be added, in which case the above list will be updated. +// +// ----------------------------------------------------------------------------- +// absl::Hash Invocation Evaluation +// ----------------------------------------------------------------------------- +// +// When invoked, `absl::Hash` searches for supplied hash functions in the +// following order: +// +// * Natively supported types out of the box (see above) +// * Types for which an `AbslHashValue()` overload is provided (such as +// user-defined types). See "Adding Type Support to `absl::Hash`" below. +// * Types which define a `HASH_NAMESPACE::hash` specialization (aka +// `__gnu_cxx::hash` for gcc/Clang or `stdext::hash` for MSVC) +// * Types which define a `std::hash` specialization +// +// The fallback to legacy hash functions exists mainly for backwards +// compatibility. If you have a choice, prefer defining an `AbslHashValue` +// overload instead of specializing any legacy hash functors. +// +// ----------------------------------------------------------------------------- +// The Hash State Concept, and using `HashState` for Type Erasure +// ----------------------------------------------------------------------------- +// +// The `absl::Hash` framework relies on the Concept of a "hash state." Such a +// hash state is used in several places: +// +// * Within existing implementations of `absl::Hash` to store the hashed +// state of an object. Note that it is up to the implementation how it stores +// such state. A hash table, for example, may mix the state to produce an +// integer value; a testing framework may simply hold a vector of that state. +// * Within implementations of `AbslHashValue()` used to extend user-defined +// types. (See "Adding Type Support to absl::Hash" below.) +// * Inside a `HashState`, providing type erasure for the concept of a hash +// state, which you can use to extend the `absl::Hash` framework for types +// that are otherwise difficult to extend using `AbslHashValue()`. (See the +// `HashState` class below.) +// +// The "hash state" concept contains two member functions for mixing hash state: +// +// * `H::combine(state, values...)` +// +// Combines an arbitrary number of values into a hash state, returning the +// updated state. Note that the existing hash state is move-only and must be +// passed by value. +// +// Each of the value types T must be hashable by H. +// +// NOTE: +// +// state = H::combine(std::move(state), value1, value2, value3); +// +// must be guaranteed to produce the same hash expansion as +// +// state = H::combine(std::move(state), value1); +// state = H::combine(std::move(state), value2); +// state = H::combine(std::move(state), value3); +// +// * `H::combine_contiguous(state, data, size)` +// +// Combines a contiguous array of `size` elements into a hash state, +// returning the updated state. Note that the existing hash state is +// move-only and must be passed by value. +// +// NOTE: +// +// state = H::combine_contiguous(std::move(state), data, size); +// +// need NOT be guaranteed to produce the same hash expansion as a loop +// (it may perform internal optimizations). If you need this guarantee, use a +// loop instead. +// +// ----------------------------------------------------------------------------- +// Adding Type Support to `absl::Hash` +// ----------------------------------------------------------------------------- +// +// To add support for your user-defined type, add a proper `AbslHashValue()` +// overload as a free (non-member) function. The overload will take an +// existing hash state and should combine that state with state from the type. +// +// Example: +// +// template +// H AbslHashValue(H state, const MyType& v) { +// return H::combine(std::move(state), v.field1, ..., v.fieldN); +// } +// +// where `(field1, ..., fieldN)` are the members you would use on your +// `operator==` to define equality. +// +// Notice that `AbslHashValue` is not a class member, but an ordinary function. +// An `AbslHashValue` overload for a type should only be declared in the same +// file and namespace as said type. The proper `AbslHashValue` implementation +// for a given type will be discovered via ADL. +// +// Note: unlike `std::hash', `absl::Hash` should never be specialized. It must +// only be extended by adding `AbslHashValue()` overloads. +// +template +using Hash = absl::hash_internal::Hash; + +// HashState +// +// A type erased version of the hash state concept, for use in user-defined +// `AbslHashValue` implementations that can't use templates (such as PImpl +// classes, virtual functions, etc.). The type erasure adds overhead so it +// should be avoided unless necessary. +// +// Note: This wrapper will only erase calls to: +// combine_contiguous(H, const unsigned char*, size_t) +// +// All other calls will be handled internally and will not invoke overloads +// provided by the wrapped class. +// +// Users of this class should still define a template `AbslHashValue` function, +// but can use `absl::HashState::Create(&state)` to erase the type of the hash +// state and dispatch to their private hashing logic. +// +// This state can be used like any other hash state. In particular, you can call +// `HashState::combine()` and `HashState::combine_contiguous()` on it. +// +// Example: +// +// class Interface { +// public: +// template +// friend H AbslHashValue(H state, const Interface& value) { +// state = H::combine(std::move(state), std::type_index(typeid(*this))); +// value.HashValue(absl::HashState::Create(&state)); +// return state; +// } +// private: +// virtual void HashValue(absl::HashState state) const = 0; +// }; +// +// class Impl : Interface { +// private: +// void HashValue(absl::HashState state) const override { +// absl::HashState::combine(std::move(state), v1_, v2_); +// } +// int v1_; +// std::string v2_; +// }; +class HashState : public hash_internal::HashStateBase { + public: + // HashState::Create() + // + // Create a new `HashState` instance that wraps `state`. All calls to + // `combine()` and `combine_contiguous()` on the new instance will be + // redirected to the original `state` object. The `state` object must outlive + // the `HashState` instance. + template + static HashState Create(T* state) { + HashState s; + s.Init(state); + return s; + } + + HashState(const HashState&) = delete; + HashState& operator=(const HashState&) = delete; + HashState(HashState&&) = default; + HashState& operator=(HashState&&) = default; + + // HashState::combine() + // + // Combines an arbitrary number of values into a hash state, returning the + // updated state. + using HashState::HashStateBase::combine; + + // HashState::combine_contiguous() + // + // Combines a contiguous array of `size` elements into a hash state, returning + // the updated state. + static HashState combine_contiguous(HashState hash_state, + const unsigned char* first, size_t size) { + hash_state.combine_contiguous_(hash_state.state_, first, size); + return hash_state; + } + using HashState::HashStateBase::combine_contiguous; + + private: + HashState() = default; + + template + static void CombineContiguousImpl(void* p, const unsigned char* first, + size_t size) { + T& state = *static_cast(p); + state = T::combine_contiguous(std::move(state), first, size); + } + + template + void Init(T* state) { + state_ = state; + combine_contiguous_ = &CombineContiguousImpl; + } + + // Do not erase an already erased state. + void Init(HashState* state) { + state_ = state->state_; + combine_contiguous_ = state->combine_contiguous_; + } + + void* state_; + void (*combine_contiguous_)(void*, const unsigned char*, size_t); +}; + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HASH_HASH_H_ diff --git a/SaraAttended/Pods/abseil/absl/hash/internal/city.cc b/SaraAttended/Pods/abseil/absl/hash/internal/city.cc new file mode 100644 index 0000000..e122c18 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/hash/internal/city.cc @@ -0,0 +1,346 @@ +// 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 file provides CityHash64() and related functions. +// +// It's probably possible to create even faster hash functions by +// writing a program that systematically explores some of the space of +// possible hash functions, by using SIMD instructions, or by +// compromising on hash quality. + +#include "absl/hash/internal/city.h" + +#include // for memcpy and memset +#include + +#include "absl/base/config.h" +#include "absl/base/internal/endian.h" +#include "absl/base/internal/unaligned_access.h" +#include "absl/base/optimization.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace hash_internal { + +#ifdef ABSL_IS_BIG_ENDIAN +#define uint32_in_expected_order(x) (absl::gbswap_32(x)) +#define uint64_in_expected_order(x) (absl::gbswap_64(x)) +#else +#define uint32_in_expected_order(x) (x) +#define uint64_in_expected_order(x) (x) +#endif + +static uint64_t Fetch64(const char *p) { + return uint64_in_expected_order(ABSL_INTERNAL_UNALIGNED_LOAD64(p)); +} + +static uint32_t Fetch32(const char *p) { + return uint32_in_expected_order(ABSL_INTERNAL_UNALIGNED_LOAD32(p)); +} + +// Some primes between 2^63 and 2^64 for various uses. +static const uint64_t k0 = 0xc3a5c85c97cb3127ULL; +static const uint64_t k1 = 0xb492b66fbe98f273ULL; +static const uint64_t k2 = 0x9ae16a3b2f90404fULL; + +// Magic numbers for 32-bit hashing. Copied from Murmur3. +static const uint32_t c1 = 0xcc9e2d51; +static const uint32_t c2 = 0x1b873593; + +// A 32-bit to 32-bit integer hash copied from Murmur3. +static uint32_t fmix(uint32_t h) { + h ^= h >> 16; + h *= 0x85ebca6b; + h ^= h >> 13; + h *= 0xc2b2ae35; + h ^= h >> 16; + return h; +} + +static uint32_t Rotate32(uint32_t val, int shift) { + // Avoid shifting by 32: doing so yields an undefined result. + return shift == 0 ? val : ((val >> shift) | (val << (32 - shift))); +} + +#undef PERMUTE3 +#define PERMUTE3(a, b, c) \ + do { \ + std::swap(a, b); \ + std::swap(a, c); \ + } while (0) + +static uint32_t Mur(uint32_t a, uint32_t h) { + // Helper from Murmur3 for combining two 32-bit values. + a *= c1; + a = Rotate32(a, 17); + a *= c2; + h ^= a; + h = Rotate32(h, 19); + return h * 5 + 0xe6546b64; +} + +static uint32_t Hash32Len13to24(const char *s, size_t len) { + uint32_t a = Fetch32(s - 4 + (len >> 1)); + uint32_t b = Fetch32(s + 4); + uint32_t c = Fetch32(s + len - 8); + uint32_t d = Fetch32(s + (len >> 1)); + uint32_t e = Fetch32(s); + uint32_t f = Fetch32(s + len - 4); + uint32_t h = len; + + return fmix(Mur(f, Mur(e, Mur(d, Mur(c, Mur(b, Mur(a, h))))))); +} + +static uint32_t Hash32Len0to4(const char *s, size_t len) { + uint32_t b = 0; + uint32_t c = 9; + for (size_t i = 0; i < len; i++) { + signed char v = s[i]; + b = b * c1 + v; + c ^= b; + } + return fmix(Mur(b, Mur(len, c))); +} + +static uint32_t Hash32Len5to12(const char *s, size_t len) { + uint32_t a = len, b = len * 5, c = 9, d = b; + a += Fetch32(s); + b += Fetch32(s + len - 4); + c += Fetch32(s + ((len >> 1) & 4)); + return fmix(Mur(c, Mur(b, Mur(a, d)))); +} + +uint32_t CityHash32(const char *s, size_t len) { + if (len <= 24) { + return len <= 12 + ? (len <= 4 ? Hash32Len0to4(s, len) : Hash32Len5to12(s, len)) + : Hash32Len13to24(s, len); + } + + // len > 24 + uint32_t h = len, g = c1 * len, f = g; + + uint32_t a0 = Rotate32(Fetch32(s + len - 4) * c1, 17) * c2; + uint32_t a1 = Rotate32(Fetch32(s + len - 8) * c1, 17) * c2; + uint32_t a2 = Rotate32(Fetch32(s + len - 16) * c1, 17) * c2; + uint32_t a3 = Rotate32(Fetch32(s + len - 12) * c1, 17) * c2; + uint32_t a4 = Rotate32(Fetch32(s + len - 20) * c1, 17) * c2; + h ^= a0; + h = Rotate32(h, 19); + h = h * 5 + 0xe6546b64; + h ^= a2; + h = Rotate32(h, 19); + h = h * 5 + 0xe6546b64; + g ^= a1; + g = Rotate32(g, 19); + g = g * 5 + 0xe6546b64; + g ^= a3; + g = Rotate32(g, 19); + g = g * 5 + 0xe6546b64; + f += a4; + f = Rotate32(f, 19); + f = f * 5 + 0xe6546b64; + size_t iters = (len - 1) / 20; + do { + uint32_t b0 = Rotate32(Fetch32(s) * c1, 17) * c2; + uint32_t b1 = Fetch32(s + 4); + uint32_t b2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2; + uint32_t b3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2; + uint32_t b4 = Fetch32(s + 16); + h ^= b0; + h = Rotate32(h, 18); + h = h * 5 + 0xe6546b64; + f += b1; + f = Rotate32(f, 19); + f = f * c1; + g += b2; + g = Rotate32(g, 18); + g = g * 5 + 0xe6546b64; + h ^= b3 + b1; + h = Rotate32(h, 19); + h = h * 5 + 0xe6546b64; + g ^= b4; + g = absl::gbswap_32(g) * 5; + h += b4 * 5; + h = absl::gbswap_32(h); + f += b0; + PERMUTE3(f, h, g); + s += 20; + } while (--iters != 0); + g = Rotate32(g, 11) * c1; + g = Rotate32(g, 17) * c1; + f = Rotate32(f, 11) * c1; + f = Rotate32(f, 17) * c1; + h = Rotate32(h + g, 19); + h = h * 5 + 0xe6546b64; + h = Rotate32(h, 17) * c1; + h = Rotate32(h + f, 19); + h = h * 5 + 0xe6546b64; + h = Rotate32(h, 17) * c1; + return h; +} + +// Bitwise right rotate. Normally this will compile to a single +// instruction, especially if the shift is a manifest constant. +static uint64_t Rotate(uint64_t val, int shift) { + // Avoid shifting by 64: doing so yields an undefined result. + return shift == 0 ? val : ((val >> shift) | (val << (64 - shift))); +} + +static uint64_t ShiftMix(uint64_t val) { return val ^ (val >> 47); } + +static uint64_t HashLen16(uint64_t u, uint64_t v) { + return Hash128to64(uint128(u, v)); +} + +static uint64_t HashLen16(uint64_t u, uint64_t v, uint64_t mul) { + // Murmur-inspired hashing. + uint64_t a = (u ^ v) * mul; + a ^= (a >> 47); + uint64_t b = (v ^ a) * mul; + b ^= (b >> 47); + b *= mul; + return b; +} + +static uint64_t HashLen0to16(const char *s, size_t len) { + if (len >= 8) { + uint64_t mul = k2 + len * 2; + uint64_t a = Fetch64(s) + k2; + uint64_t b = Fetch64(s + len - 8); + uint64_t c = Rotate(b, 37) * mul + a; + uint64_t d = (Rotate(a, 25) + b) * mul; + return HashLen16(c, d, mul); + } + if (len >= 4) { + uint64_t mul = k2 + len * 2; + uint64_t a = Fetch32(s); + return HashLen16(len + (a << 3), Fetch32(s + len - 4), mul); + } + if (len > 0) { + uint8_t a = s[0]; + uint8_t b = s[len >> 1]; + uint8_t c = s[len - 1]; + uint32_t y = static_cast(a) + (static_cast(b) << 8); + uint32_t z = len + (static_cast(c) << 2); + return ShiftMix(y * k2 ^ z * k0) * k2; + } + return k2; +} + +// This probably works well for 16-byte strings as well, but it may be overkill +// in that case. +static uint64_t HashLen17to32(const char *s, size_t len) { + uint64_t mul = k2 + len * 2; + uint64_t a = Fetch64(s) * k1; + uint64_t b = Fetch64(s + 8); + uint64_t c = Fetch64(s + len - 8) * mul; + uint64_t d = Fetch64(s + len - 16) * k2; + return HashLen16(Rotate(a + b, 43) + Rotate(c, 30) + d, + a + Rotate(b + k2, 18) + c, mul); +} + +// Return a 16-byte hash for 48 bytes. Quick and dirty. +// Callers do best to use "random-looking" values for a and b. +static std::pair WeakHashLen32WithSeeds(uint64_t w, uint64_t x, + uint64_t y, uint64_t z, + uint64_t a, uint64_t b) { + a += w; + b = Rotate(b + a + z, 21); + uint64_t c = a; + a += x; + a += y; + b += Rotate(a, 44); + return std::make_pair(a + z, b + c); +} + +// Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. +static std::pair WeakHashLen32WithSeeds(const char *s, uint64_t a, + uint64_t b) { + return WeakHashLen32WithSeeds(Fetch64(s), Fetch64(s + 8), Fetch64(s + 16), + Fetch64(s + 24), a, b); +} + +// Return an 8-byte hash for 33 to 64 bytes. +static uint64_t HashLen33to64(const char *s, size_t len) { + uint64_t mul = k2 + len * 2; + uint64_t a = Fetch64(s) * k2; + uint64_t b = Fetch64(s + 8); + uint64_t c = Fetch64(s + len - 24); + uint64_t d = Fetch64(s + len - 32); + uint64_t e = Fetch64(s + 16) * k2; + uint64_t f = Fetch64(s + 24) * 9; + uint64_t g = Fetch64(s + len - 8); + uint64_t h = Fetch64(s + len - 16) * mul; + uint64_t u = Rotate(a + g, 43) + (Rotate(b, 30) + c) * 9; + uint64_t v = ((a + g) ^ d) + f + 1; + uint64_t w = absl::gbswap_64((u + v) * mul) + h; + uint64_t x = Rotate(e + f, 42) + c; + uint64_t y = (absl::gbswap_64((v + w) * mul) + g) * mul; + uint64_t z = e + f + c; + a = absl::gbswap_64((x + z) * mul + y) + b; + b = ShiftMix((z + a) * mul + d + h) * mul; + return b + x; +} + +uint64_t CityHash64(const char *s, size_t len) { + if (len <= 32) { + if (len <= 16) { + return HashLen0to16(s, len); + } else { + return HashLen17to32(s, len); + } + } else if (len <= 64) { + return HashLen33to64(s, len); + } + + // For strings over 64 bytes we hash the end first, and then as we + // loop we keep 56 bytes of state: v, w, x, y, and z. + uint64_t x = Fetch64(s + len - 40); + uint64_t y = Fetch64(s + len - 16) + Fetch64(s + len - 56); + uint64_t z = HashLen16(Fetch64(s + len - 48) + len, Fetch64(s + len - 24)); + std::pair v = WeakHashLen32WithSeeds(s + len - 64, len, z); + std::pair w = WeakHashLen32WithSeeds(s + len - 32, y + k1, x); + x = x * k1 + Fetch64(s); + + // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. + len = (len - 1) & ~static_cast(63); + do { + x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1; + y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1; + x ^= w.second; + y += v.first + Fetch64(s + 40); + z = Rotate(z + w.first, 33) * k1; + v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first); + w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16)); + std::swap(z, x); + s += 64; + len -= 64; + } while (len != 0); + return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z, + HashLen16(v.second, w.second) + x); +} + +uint64_t CityHash64WithSeed(const char *s, size_t len, uint64_t seed) { + return CityHash64WithSeeds(s, len, k2, seed); +} + +uint64_t CityHash64WithSeeds(const char *s, size_t len, uint64_t seed0, + uint64_t seed1) { + return HashLen16(CityHash64(s, len) - seed0, seed1); +} + +} // namespace hash_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/hash/internal/city.h b/SaraAttended/Pods/abseil/absl/hash/internal/city.h new file mode 100644 index 0000000..161c774 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/hash/internal/city.h @@ -0,0 +1,96 @@ +// 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. +// +// https://code.google.com/p/cityhash/ +// +// This file provides a few functions for hashing strings. All of them are +// high-quality functions in the sense that they pass standard tests such +// as Austin Appleby's SMHasher. They are also fast. +// +// For 64-bit x86 code, on short strings, we don't know of anything faster than +// CityHash64 that is of comparable quality. We believe our nearest competitor +// is Murmur3. For 64-bit x86 code, CityHash64 is an excellent choice for hash +// tables and most other hashing (excluding cryptography). +// +// For 32-bit x86 code, we don't know of anything faster than CityHash32 that +// is of comparable quality. We believe our nearest competitor is Murmur3A. +// (On 64-bit CPUs, it is typically faster to use the other CityHash variants.) +// +// Functions in the CityHash family are not suitable for cryptography. +// +// Please see CityHash's README file for more details on our performance +// measurements and so on. +// +// WARNING: This code has been only lightly tested on big-endian platforms! +// It is known to work well on little-endian platforms that have a small penalty +// for unaligned reads, such as current Intel and AMD moderate-to-high-end CPUs. +// It should work on all 32-bit and 64-bit platforms that allow unaligned reads; +// bug reports are welcome. +// +// By the way, for some hash functions, given strings a and b, the hash +// of a+b is easily derived from the hashes of a and b. This property +// doesn't hold for any hash functions in this file. + +#ifndef ABSL_HASH_INTERNAL_CITY_H_ +#define ABSL_HASH_INTERNAL_CITY_H_ + +#include +#include // for size_t. + +#include + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace hash_internal { + +typedef std::pair uint128; + +inline uint64_t Uint128Low64(const uint128 &x) { return x.first; } +inline uint64_t Uint128High64(const uint128 &x) { return x.second; } + +// Hash function for a byte array. +uint64_t CityHash64(const char *s, size_t len); + +// Hash function for a byte array. For convenience, a 64-bit seed is also +// hashed into the result. +uint64_t CityHash64WithSeed(const char *s, size_t len, uint64_t seed); + +// Hash function for a byte array. For convenience, two seeds are also +// hashed into the result. +uint64_t CityHash64WithSeeds(const char *s, size_t len, uint64_t seed0, + uint64_t seed1); + +// Hash function for a byte array. Most useful in 32-bit binaries. +uint32_t CityHash32(const char *s, size_t len); + +// Hash 128 input bits down to 64 bits of output. +// This is intended to be a reasonably good hash function. +inline uint64_t Hash128to64(const uint128 &x) { + // Murmur-inspired hashing. + const uint64_t kMul = 0x9ddfea08eb382d69ULL; + uint64_t a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul; + a ^= (a >> 47); + uint64_t b = (Uint128High64(x) ^ a) * kMul; + b ^= (b >> 47); + b *= kMul; + return b; +} + +} // namespace hash_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HASH_INTERNAL_CITY_H_ diff --git a/SaraAttended/Pods/abseil/absl/hash/internal/hash.cc b/SaraAttended/Pods/abseil/absl/hash/internal/hash.cc new file mode 100644 index 0000000..b44ecb3 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/hash/internal/hash.cc @@ -0,0 +1,55 @@ +// 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/hash/internal/hash.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace hash_internal { + +uint64_t CityHashState::CombineLargeContiguousImpl32(uint64_t state, + const unsigned char* first, + size_t len) { + while (len >= PiecewiseChunkSize()) { + state = + Mix(state, absl::hash_internal::CityHash32(reinterpret_cast(first), + PiecewiseChunkSize())); + len -= PiecewiseChunkSize(); + first += PiecewiseChunkSize(); + } + // Handle the remainder. + return CombineContiguousImpl(state, first, len, + std::integral_constant{}); +} + +uint64_t CityHashState::CombineLargeContiguousImpl64(uint64_t state, + const unsigned char* first, + size_t len) { + while (len >= PiecewiseChunkSize()) { + state = + Mix(state, absl::hash_internal::CityHash64(reinterpret_cast(first), + PiecewiseChunkSize())); + len -= PiecewiseChunkSize(); + first += PiecewiseChunkSize(); + } + // Handle the remainder. + return CombineContiguousImpl(state, first, len, + std::integral_constant{}); +} + +ABSL_CONST_INIT const void* const CityHashState::kSeed = &kSeed; + +} // namespace hash_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/hash/internal/hash.h b/SaraAttended/Pods/abseil/absl/hash/internal/hash.h new file mode 100644 index 0000000..ae7a60c --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/hash/internal/hash.h @@ -0,0 +1,988 @@ +// 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: hash.h +// ----------------------------------------------------------------------------- +// +#ifndef ABSL_HASH_INTERNAL_HASH_H_ +#define ABSL_HASH_INTERNAL_HASH_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/base/internal/endian.h" +#include "absl/base/port.h" +#include "absl/container/fixed_array.h" +#include "absl/meta/type_traits.h" +#include "absl/numeric/int128.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "absl/types/variant.h" +#include "absl/utility/utility.h" +#include "absl/hash/internal/city.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace hash_internal { + +class PiecewiseCombiner; + +// Internal detail: Large buffers are hashed in smaller chunks. This function +// returns the size of these chunks. +constexpr size_t PiecewiseChunkSize() { return 1024; } + +// HashStateBase +// +// A hash state object represents an intermediate state in the computation +// of an unspecified hash algorithm. `HashStateBase` provides a CRTP style +// base class for hash state implementations. Developers adding type support +// for `absl::Hash` should not rely on any parts of the state object other than +// the following member functions: +// +// * HashStateBase::combine() +// * HashStateBase::combine_contiguous() +// +// A derived hash state class of type `H` must provide a static member function +// with a signature similar to the following: +// +// `static H combine_contiguous(H state, const unsigned char*, size_t)`. +// +// `HashStateBase` will provide a complete implementation for a hash state +// object in terms of this method. +// +// Example: +// +// // Use CRTP to define your derived class. +// struct MyHashState : HashStateBase { +// static H combine_contiguous(H state, const unsigned char*, size_t); +// using MyHashState::HashStateBase::combine; +// using MyHashState::HashStateBase::combine_contiguous; +// }; +template +class HashStateBase { + public: + // HashStateBase::combine() + // + // Combines an arbitrary number of values into a hash state, returning the + // updated state. + // + // Each of the value types `T` must be separately hashable by the Abseil + // hashing framework. + // + // NOTE: + // + // state = H::combine(std::move(state), value1, value2, value3); + // + // is guaranteed to produce the same hash expansion as: + // + // state = H::combine(std::move(state), value1); + // state = H::combine(std::move(state), value2); + // state = H::combine(std::move(state), value3); + template + static H combine(H state, const T& value, const Ts&... values); + static H combine(H state) { return state; } + + // HashStateBase::combine_contiguous() + // + // Combines a contiguous array of `size` elements into a hash state, returning + // the updated state. + // + // NOTE: + // + // state = H::combine_contiguous(std::move(state), data, size); + // + // is NOT guaranteed to produce the same hash expansion as a for-loop (it may + // perform internal optimizations). If you need this guarantee, use the + // for-loop instead. + template + static H combine_contiguous(H state, const T* data, size_t size); + + private: + friend class PiecewiseCombiner; +}; + +// is_uniquely_represented +// +// `is_uniquely_represented` is a trait class that indicates whether `T` +// is uniquely represented. +// +// A type is "uniquely represented" if two equal values of that type are +// guaranteed to have the same bytes in their underlying storage. In other +// words, if `a == b`, then `memcmp(&a, &b, sizeof(T))` is guaranteed to be +// zero. This property cannot be detected automatically, so this trait is false +// by default, but can be specialized by types that wish to assert that they are +// uniquely represented. This makes them eligible for certain optimizations. +// +// If you have any doubt whatsoever, do not specialize this template. +// The default is completely safe, and merely disables some optimizations +// that will not matter for most types. Specializing this template, +// on the other hand, can be very hazardous. +// +// To be uniquely represented, a type must not have multiple ways of +// representing the same value; for example, float and double are not +// uniquely represented, because they have distinct representations for +// +0 and -0. Furthermore, the type's byte representation must consist +// solely of user-controlled data, with no padding bits and no compiler- +// controlled data such as vptrs or sanitizer metadata. This is usually +// very difficult to guarantee, because in most cases the compiler can +// insert data and padding bits at its own discretion. +// +// If you specialize this template for a type `T`, you must do so in the file +// that defines that type (or in this file). If you define that specialization +// anywhere else, `is_uniquely_represented` could have different meanings +// in different places. +// +// The Enable parameter is meaningless; it is provided as a convenience, +// to support certain SFINAE techniques when defining specializations. +template +struct is_uniquely_represented : std::false_type {}; + +// is_uniquely_represented +// +// unsigned char is a synonym for "byte", so it is guaranteed to be +// uniquely represented. +template <> +struct is_uniquely_represented : std::true_type {}; + +// is_uniquely_represented for non-standard integral types +// +// Integral types other than bool should be uniquely represented on any +// platform that this will plausibly be ported to. +template +struct is_uniquely_represented< + Integral, typename std::enable_if::value>::type> + : std::true_type {}; + +// is_uniquely_represented +// +// +template <> +struct is_uniquely_represented : std::false_type {}; + +// hash_bytes() +// +// Convenience function that combines `hash_state` with the byte representation +// of `value`. +template +H hash_bytes(H hash_state, const T& value) { + const unsigned char* start = reinterpret_cast(&value); + return H::combine_contiguous(std::move(hash_state), start, sizeof(value)); +} + +// PiecewiseCombiner +// +// PiecewiseCombiner is an internal-only helper class for hashing a piecewise +// buffer of `char` or `unsigned char` as though it were contiguous. This class +// provides two methods: +// +// H add_buffer(state, data, size) +// H finalize(state) +// +// `add_buffer` can be called zero or more times, followed by a single call to +// `finalize`. This will produce the same hash expansion as concatenating each +// buffer piece into a single contiguous buffer, and passing this to +// `H::combine_contiguous`. +// +// Example usage: +// PiecewiseCombiner combiner; +// for (const auto& piece : pieces) { +// state = combiner.add_buffer(std::move(state), piece.data, piece.size); +// } +// return combiner.finalize(std::move(state)); +class PiecewiseCombiner { + public: + PiecewiseCombiner() : position_(0) {} + PiecewiseCombiner(const PiecewiseCombiner&) = delete; + PiecewiseCombiner& operator=(const PiecewiseCombiner&) = delete; + + // PiecewiseCombiner::add_buffer() + // + // Appends the given range of bytes to the sequence to be hashed, which may + // modify the provided hash state. + template + H add_buffer(H state, const unsigned char* data, size_t size); + template + H add_buffer(H state, const char* data, size_t size) { + return add_buffer(std::move(state), + reinterpret_cast(data), size); + } + + // PiecewiseCombiner::finalize() + // + // Finishes combining the hash sequence, which may may modify the provided + // hash state. + // + // Once finalize() is called, add_buffer() may no longer be called. The + // resulting hash state will be the same as if the pieces passed to + // add_buffer() were concatenated into a single flat buffer, and then provided + // to H::combine_contiguous(). + template + H finalize(H state); + + private: + unsigned char buf_[PiecewiseChunkSize()]; + size_t position_; +}; + +// ----------------------------------------------------------------------------- +// AbslHashValue for Basic Types +// ----------------------------------------------------------------------------- + +// Note: Default `AbslHashValue` implementations live in `hash_internal`. This +// allows us to block lexical scope lookup when doing an unqualified call to +// `AbslHashValue` below. User-defined implementations of `AbslHashValue` can +// only be found via ADL. + +// AbslHashValue() for hashing bool values +// +// We use SFINAE to ensure that this overload only accepts bool, not types that +// are convertible to bool. +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, B value) { + return H::combine(std::move(hash_state), + static_cast(value ? 1 : 0)); +} + +// AbslHashValue() for hashing enum values +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, Enum e) { + // In practice, we could almost certainly just invoke hash_bytes directly, + // but it's possible that a sanitizer might one day want to + // store data in the unused bits of an enum. To avoid that risk, we + // convert to the underlying type before hashing. Hopefully this will get + // optimized away; if not, we can reopen discussion with c-toolchain-team. + return H::combine(std::move(hash_state), + static_cast::type>(e)); +} +// AbslHashValue() for hashing floating-point values +template +typename std::enable_if::value || + std::is_same::value, + H>::type +AbslHashValue(H hash_state, Float value) { + return hash_internal::hash_bytes(std::move(hash_state), + value == 0 ? 0 : value); +} + +// Long double has the property that it might have extra unused bytes in it. +// For example, in x86 sizeof(long double)==16 but it only really uses 80-bits +// of it. This means we can't use hash_bytes on a long double and have to +// convert it to something else first. +template +typename std::enable_if::value, H>::type +AbslHashValue(H hash_state, LongDouble value) { + const int category = std::fpclassify(value); + switch (category) { + case FP_INFINITE: + // Add the sign bit to differentiate between +Inf and -Inf + hash_state = H::combine(std::move(hash_state), std::signbit(value)); + break; + + case FP_NAN: + case FP_ZERO: + default: + // Category is enough for these. + break; + + case FP_NORMAL: + case FP_SUBNORMAL: + // We can't convert `value` directly to double because this would have + // undefined behavior if the value is out of range. + // std::frexp gives us a value in the range (-1, -.5] or [.5, 1) that is + // guaranteed to be in range for `double`. The truncation is + // implementation defined, but that works as long as it is deterministic. + int exp; + auto mantissa = static_cast(std::frexp(value, &exp)); + hash_state = H::combine(std::move(hash_state), mantissa, exp); + } + + return H::combine(std::move(hash_state), category); +} + +// AbslHashValue() for hashing pointers +template +H AbslHashValue(H hash_state, T* ptr) { + auto v = reinterpret_cast(ptr); + // Due to alignment, pointers tend to have low bits as zero, and the next few + // bits follow a pattern since they are also multiples of some base value. + // Mixing the pointer twice helps prevent stuck low bits for certain alignment + // values. + return H::combine(std::move(hash_state), v, v); +} + +// AbslHashValue() for hashing nullptr_t +template +H AbslHashValue(H hash_state, std::nullptr_t) { + return H::combine(std::move(hash_state), static_cast(nullptr)); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Composite Types +// ----------------------------------------------------------------------------- + +// is_hashable() +// +// Trait class which returns true if T is hashable by the absl::Hash framework. +// Used for the AbslHashValue implementations for composite types below. +template +struct is_hashable; + +// AbslHashValue() for hashing pairs +template +typename std::enable_if::value && is_hashable::value, + H>::type +AbslHashValue(H hash_state, const std::pair& p) { + return H::combine(std::move(hash_state), p.first, p.second); +} + +// hash_tuple() +// +// Helper function for hashing a tuple. The third argument should +// be an index_sequence running from 0 to tuple_size - 1. +template +H hash_tuple(H hash_state, const Tuple& t, absl::index_sequence) { + return H::combine(std::move(hash_state), std::get(t)...); +} + +// AbslHashValue for hashing tuples +template +#if defined(_MSC_VER) +// This SFINAE gets MSVC confused under some conditions. Let's just disable it +// for now. +H +#else // _MSC_VER +typename std::enable_if...>::value, H>::type +#endif // _MSC_VER +AbslHashValue(H hash_state, const std::tuple& t) { + return hash_internal::hash_tuple(std::move(hash_state), t, + absl::make_index_sequence()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Pointers +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing unique_ptr +template +H AbslHashValue(H hash_state, const std::unique_ptr& ptr) { + return H::combine(std::move(hash_state), ptr.get()); +} + +// AbslHashValue for hashing shared_ptr +template +H AbslHashValue(H hash_state, const std::shared_ptr& ptr) { + return H::combine(std::move(hash_state), ptr.get()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for String-Like Types +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing strings +// +// All the string-like types supported here provide the same hash expansion for +// the same character sequence. These types are: +// +// - `std::string` (and std::basic_string, A> for +// any allocator A) +// - `absl::string_view` and `std::string_view` +// +// For simplicity, we currently support only `char` strings. This support may +// be broadened, if necessary, but with some caution - this overload would +// misbehave in cases where the traits' `eq()` member isn't equivalent to `==` +// on the underlying character type. +template +H AbslHashValue(H hash_state, absl::string_view str) { + return H::combine( + H::combine_contiguous(std::move(hash_state), str.data(), str.size()), + str.size()); +} + +// Support std::wstring, std::u16string and std::u32string. +template ::value || + std::is_same::value || + std::is_same::value>> +H AbslHashValue( + H hash_state, + const std::basic_string, Alloc>& str) { + return H::combine( + H::combine_contiguous(std::move(hash_state), str.data(), str.size()), + str.size()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Sequence Containers +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing std::array +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::array& array) { + return H::combine_contiguous(std::move(hash_state), array.data(), + array.size()); +} + +// AbslHashValue for hashing std::deque +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::deque& deque) { + // TODO(gromer): investigate a more efficient implementation taking + // advantage of the chunk structure. + for (const auto& t : deque) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), deque.size()); +} + +// AbslHashValue for hashing std::forward_list +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::forward_list& list) { + size_t size = 0; + for (const T& t : list) { + hash_state = H::combine(std::move(hash_state), t); + ++size; + } + return H::combine(std::move(hash_state), size); +} + +// AbslHashValue for hashing std::list +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::list& list) { + for (const auto& t : list) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), list.size()); +} + +// AbslHashValue for hashing std::vector +// +// Do not use this for vector. It does not have a .data(), and a fallback +// for std::hash<> is most likely faster. +template +typename std::enable_if::value && !std::is_same::value, + H>::type +AbslHashValue(H hash_state, const std::vector& vector) { + return H::combine(H::combine_contiguous(std::move(hash_state), vector.data(), + vector.size()), + vector.size()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Ordered Associative Containers +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing std::map +template +typename std::enable_if::value && is_hashable::value, + H>::type +AbslHashValue(H hash_state, const std::map& map) { + for (const auto& t : map) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), map.size()); +} + +// AbslHashValue for hashing std::multimap +template +typename std::enable_if::value && is_hashable::value, + H>::type +AbslHashValue(H hash_state, + const std::multimap& map) { + for (const auto& t : map) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), map.size()); +} + +// AbslHashValue for hashing std::set +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::set& set) { + for (const auto& t : set) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), set.size()); +} + +// AbslHashValue for hashing std::multiset +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const std::multiset& set) { + for (const auto& t : set) { + hash_state = H::combine(std::move(hash_state), t); + } + return H::combine(std::move(hash_state), set.size()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Wrapper Types +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing absl::optional +template +typename std::enable_if::value, H>::type AbslHashValue( + H hash_state, const absl::optional& opt) { + if (opt) hash_state = H::combine(std::move(hash_state), *opt); + return H::combine(std::move(hash_state), opt.has_value()); +} + +// VariantVisitor +template +struct VariantVisitor { + H&& hash_state; + template + H operator()(const T& t) const { + return H::combine(std::move(hash_state), t); + } +}; + +// AbslHashValue for hashing absl::variant +template +typename std::enable_if...>::value, H>::type +AbslHashValue(H hash_state, const absl::variant& v) { + if (!v.valueless_by_exception()) { + hash_state = absl::visit(VariantVisitor{std::move(hash_state)}, v); + } + return H::combine(std::move(hash_state), v.index()); +} + +// ----------------------------------------------------------------------------- +// AbslHashValue for Other Types +// ----------------------------------------------------------------------------- + +// AbslHashValue for hashing std::bitset is not defined, for the same reason as +// for vector (see std::vector above): It does not expose the raw bytes, +// and a fallback to std::hash<> is most likely faster. + +// ----------------------------------------------------------------------------- + +// hash_range_or_bytes() +// +// Mixes all values in the range [data, data+size) into the hash state. +// This overload accepts only uniquely-represented types, and hashes them by +// hashing the entire range of bytes. +template +typename std::enable_if::value, H>::type +hash_range_or_bytes(H hash_state, const T* data, size_t size) { + const auto* bytes = reinterpret_cast(data); + return H::combine_contiguous(std::move(hash_state), bytes, sizeof(T) * size); +} + +// hash_range_or_bytes() +template +typename std::enable_if::value, H>::type +hash_range_or_bytes(H hash_state, const T* data, size_t size) { + for (const auto end = data + size; data < end; ++data) { + hash_state = H::combine(std::move(hash_state), *data); + } + return hash_state; +} + +#if defined(ABSL_INTERNAL_LEGACY_HASH_NAMESPACE) && \ + ABSL_META_INTERNAL_STD_HASH_SFINAE_FRIENDLY_ +#define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 1 +#else +#define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 0 +#endif + +// HashSelect +// +// Type trait to select the appropriate hash implementation to use. +// HashSelect::type will give the proper hash implementation, to be invoked +// as: +// HashSelect::type::Invoke(state, value) +// Also, HashSelect::type::value is a boolean equal to `true` if there is a +// valid `Invoke` function. Types that are not hashable will have a ::value of +// `false`. +struct HashSelect { + private: + struct State : HashStateBase { + static State combine_contiguous(State hash_state, const unsigned char*, + size_t); + using State::HashStateBase::combine_contiguous; + }; + + struct UniquelyRepresentedProbe { + template + static auto Invoke(H state, const T& value) + -> absl::enable_if_t::value, H> { + return hash_internal::hash_bytes(std::move(state), value); + } + }; + + struct HashValueProbe { + template + static auto Invoke(H state, const T& value) -> absl::enable_if_t< + std::is_same::value, + H> { + return AbslHashValue(std::move(state), value); + } + }; + + struct LegacyHashProbe { +#if ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ + template + static auto Invoke(H state, const T& value) -> absl::enable_if_t< + std::is_convertible< + decltype(ABSL_INTERNAL_LEGACY_HASH_NAMESPACE::hash()(value)), + size_t>::value, + H> { + return hash_internal::hash_bytes( + std::move(state), + ABSL_INTERNAL_LEGACY_HASH_NAMESPACE::hash{}(value)); + } +#endif // ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ + }; + + struct StdHashProbe { + template + static auto Invoke(H state, const T& value) + -> absl::enable_if_t::value, H> { + return hash_internal::hash_bytes(std::move(state), std::hash{}(value)); + } + }; + + template + struct Probe : Hash { + private: + template (), std::declval()))> + static std::true_type Test(int); + template + static std::false_type Test(char); + + public: + static constexpr bool value = decltype(Test(0))::value; + }; + + public: + // Probe each implementation in order. + // disjunction provides short circuiting wrt instantiation. + template + using Apply = absl::disjunction< // + Probe, // + Probe, // + Probe, // + Probe, // + std::false_type>; +}; + +template +struct is_hashable + : std::integral_constant::value> {}; + +// CityHashState +class ABSL_DLL CityHashState + : public HashStateBase { + // absl::uint128 is not an alias or a thin wrapper around the intrinsic. + // We use the intrinsic when available to improve performance. +#ifdef ABSL_HAVE_INTRINSIC_INT128 + using uint128 = __uint128_t; +#else // ABSL_HAVE_INTRINSIC_INT128 + using uint128 = absl::uint128; +#endif // ABSL_HAVE_INTRINSIC_INT128 + + static constexpr uint64_t kMul = + sizeof(size_t) == 4 ? uint64_t{0xcc9e2d51} + : uint64_t{0x9ddfea08eb382d69}; + + template + using IntegralFastPath = + conjunction, is_uniquely_represented>; + + public: + // Move only + CityHashState(CityHashState&&) = default; + CityHashState& operator=(CityHashState&&) = default; + + // CityHashState::combine_contiguous() + // + // Fundamental base case for hash recursion: mixes the given range of bytes + // into the hash state. + static CityHashState combine_contiguous(CityHashState hash_state, + const unsigned char* first, + size_t size) { + return CityHashState( + CombineContiguousImpl(hash_state.state_, first, size, + std::integral_constant{})); + } + using CityHashState::HashStateBase::combine_contiguous; + + // CityHashState::hash() + // + // For performance reasons in non-opt mode, we specialize this for + // integral types. + // Otherwise we would be instantiating and calling dozens of functions for + // something that is just one multiplication and a couple xor's. + // The result should be the same as running the whole algorithm, but faster. + template ::value, int> = 0> + static size_t hash(T value) { + return static_cast(Mix(Seed(), static_cast(value))); + } + + // Overload of CityHashState::hash() + template ::value, int> = 0> + static size_t hash(const T& value) { + return static_cast(combine(CityHashState{}, value).state_); + } + + private: + // Invoked only once for a given argument; that plus the fact that this is + // move-only ensures that there is only one non-moved-from object. + CityHashState() : state_(Seed()) {} + + // Workaround for MSVC bug. + // We make the type copyable to fix the calling convention, even though we + // never actually copy it. Keep it private to not affect the public API of the + // type. + CityHashState(const CityHashState&) = default; + + explicit CityHashState(uint64_t state) : state_(state) {} + + // Implementation of the base case for combine_contiguous where we actually + // mix the bytes into the state. + // Dispatch to different implementations of the combine_contiguous depending + // on the value of `sizeof(size_t)`. + static uint64_t CombineContiguousImpl(uint64_t state, + const unsigned char* first, size_t len, + std::integral_constant + /* sizeof_size_t */); + static uint64_t CombineContiguousImpl(uint64_t state, + const unsigned char* first, size_t len, + std::integral_constant + /* sizeof_size_t*/); + + // Slow dispatch path for calls to CombineContiguousImpl with a size argument + // larger than PiecewiseChunkSize(). Has the same effect as calling + // CombineContiguousImpl() repeatedly with the chunk stride size. + static uint64_t CombineLargeContiguousImpl32(uint64_t state, + const unsigned char* first, + size_t len); + static uint64_t CombineLargeContiguousImpl64(uint64_t state, + const unsigned char* first, + size_t len); + + // Reads 9 to 16 bytes from p. + // The first 8 bytes are in .first, the rest (zero padded) bytes are in + // .second. + static std::pair Read9To16(const unsigned char* p, + size_t len) { + uint64_t high = little_endian::Load64(p + len - 8); + return {little_endian::Load64(p), high >> (128 - len * 8)}; + } + + // Reads 4 to 8 bytes from p. Zero pads to fill uint64_t. + static uint64_t Read4To8(const unsigned char* p, size_t len) { + return (static_cast(little_endian::Load32(p + len - 4)) + << (len - 4) * 8) | + little_endian::Load32(p); + } + + // Reads 1 to 3 bytes from p. Zero pads to fill uint32_t. + static uint32_t Read1To3(const unsigned char* p, size_t len) { + return static_cast((p[0]) | // + (p[len / 2] << (len / 2 * 8)) | // + (p[len - 1] << ((len - 1) * 8))); + } + + ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Mix(uint64_t state, uint64_t v) { + using MultType = + absl::conditional_t; + // We do the addition in 64-bit space to make sure the 128-bit + // multiplication is fast. If we were to do it as MultType the compiler has + // to assume that the high word is non-zero and needs to perform 2 + // multiplications instead of one. + MultType m = state + v; + m *= kMul; + return static_cast(m ^ (m >> (sizeof(m) * 8 / 2))); + } + + // Seed() + // + // A non-deterministic seed. + // + // The current purpose of this seed is to generate non-deterministic results + // and prevent having users depend on the particular hash values. + // It is not meant as a security feature right now, but it leaves the door + // open to upgrade it to a true per-process random seed. A true random seed + // costs more and we don't need to pay for that right now. + // + // On platforms with ASLR, we take advantage of it to make a per-process + // random value. + // See https://en.wikipedia.org/wiki/Address_space_layout_randomization + // + // On other platforms this is still going to be non-deterministic but most + // probably per-build and not per-process. + ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Seed() { + return static_cast(reinterpret_cast(kSeed)); + } + static const void* const kSeed; + + uint64_t state_; +}; + +// CityHashState::CombineContiguousImpl() +inline uint64_t CityHashState::CombineContiguousImpl( + uint64_t state, const unsigned char* first, size_t len, + std::integral_constant /* sizeof_size_t */) { + // For large values we use CityHash, for small ones we just use a + // multiplicative hash. + uint64_t v; + if (len > 8) { + if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) { + return CombineLargeContiguousImpl32(state, first, len); + } + v = absl::hash_internal::CityHash32(reinterpret_cast(first), len); + } else if (len >= 4) { + v = Read4To8(first, len); + } else if (len > 0) { + v = Read1To3(first, len); + } else { + // Empty ranges have no effect. + return state; + } + return Mix(state, v); +} + +// Overload of CityHashState::CombineContiguousImpl() +inline uint64_t CityHashState::CombineContiguousImpl( + uint64_t state, const unsigned char* first, size_t len, + std::integral_constant /* sizeof_size_t */) { + // For large values we use CityHash, for small ones we just use a + // multiplicative hash. + uint64_t v; + if (len > 16) { + if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) { + return CombineLargeContiguousImpl64(state, first, len); + } + v = absl::hash_internal::CityHash64(reinterpret_cast(first), len); + } else if (len > 8) { + auto p = Read9To16(first, len); + state = Mix(state, p.first); + v = p.second; + } else if (len >= 4) { + v = Read4To8(first, len); + } else if (len > 0) { + v = Read1To3(first, len); + } else { + // Empty ranges have no effect. + return state; + } + return Mix(state, v); +} + +struct AggregateBarrier {}; + +// HashImpl + +// Add a private base class to make sure this type is not an aggregate. +// Aggregates can be aggregate initialized even if the default constructor is +// deleted. +struct PoisonedHash : private AggregateBarrier { + PoisonedHash() = delete; + PoisonedHash(const PoisonedHash&) = delete; + PoisonedHash& operator=(const PoisonedHash&) = delete; +}; + +template +struct HashImpl { + size_t operator()(const T& value) const { return CityHashState::hash(value); } +}; + +template +struct Hash + : absl::conditional_t::value, HashImpl, PoisonedHash> {}; + +template +template +H HashStateBase::combine(H state, const T& value, const Ts&... values) { + return H::combine(hash_internal::HashSelect::template Apply::Invoke( + std::move(state), value), + values...); +} + +// HashStateBase::combine_contiguous() +template +template +H HashStateBase::combine_contiguous(H state, const T* data, size_t size) { + return hash_internal::hash_range_or_bytes(std::move(state), data, size); +} + +// HashStateBase::PiecewiseCombiner::add_buffer() +template +H PiecewiseCombiner::add_buffer(H state, const unsigned char* data, + size_t size) { + if (position_ + size < PiecewiseChunkSize()) { + // This partial chunk does not fill our existing buffer + memcpy(buf_ + position_, data, size); + position_ += size; + return state; + } + + // Complete the buffer and hash it + const size_t bytes_needed = PiecewiseChunkSize() - position_; + memcpy(buf_ + position_, data, bytes_needed); + state = H::combine_contiguous(std::move(state), buf_, PiecewiseChunkSize()); + data += bytes_needed; + size -= bytes_needed; + + // Hash whatever chunks we can without copying + while (size >= PiecewiseChunkSize()) { + state = H::combine_contiguous(std::move(state), data, PiecewiseChunkSize()); + data += PiecewiseChunkSize(); + size -= PiecewiseChunkSize(); + } + // Fill the buffer with the remainder + memcpy(buf_, data, size); + position_ = size; + return state; +} + +// HashStateBase::PiecewiseCombiner::finalize() +template +H PiecewiseCombiner::finalize(H state) { + // Hash the remainder left in the buffer, which may be empty + return H::combine_contiguous(std::move(state), buf_, position_); +} + +} // namespace hash_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HASH_INTERNAL_HASH_H_ diff --git a/SaraAttended/Pods/abseil/absl/memory/memory.h b/SaraAttended/Pods/abseil/absl/memory/memory.h new file mode 100644 index 0000000..513f710 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/memory/memory.h @@ -0,0 +1,695 @@ +// 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: memory.h +// ----------------------------------------------------------------------------- +// +// This header file contains utility functions for managing the creation and +// conversion of smart pointers. This file is an extension to the C++ +// standard library header file. + +#ifndef ABSL_MEMORY_MEMORY_H_ +#define ABSL_MEMORY_MEMORY_H_ + +#include +#include +#include +#include +#include +#include + +#include "absl/base/macros.h" +#include "absl/meta/type_traits.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN + +// ----------------------------------------------------------------------------- +// Function Template: WrapUnique() +// ----------------------------------------------------------------------------- +// +// Adopts ownership from a raw pointer and transfers it to the returned +// `std::unique_ptr`, whose type is deduced. Because of this deduction, *do not* +// specify the template type `T` when calling `WrapUnique`. +// +// Example: +// X* NewX(int, int); +// auto x = WrapUnique(NewX(1, 2)); // 'x' is std::unique_ptr. +// +// Do not call WrapUnique with an explicit type, as in +// `WrapUnique(NewX(1, 2))`. The purpose of WrapUnique is to automatically +// deduce the pointer type. If you wish to make the type explicit, just use +// `std::unique_ptr` directly. +// +// auto x = std::unique_ptr(NewX(1, 2)); +// - or - +// std::unique_ptr x(NewX(1, 2)); +// +// While `absl::WrapUnique` is useful for capturing the output of a raw +// pointer factory, prefer 'absl::make_unique(args...)' over +// 'absl::WrapUnique(new T(args...))'. +// +// auto x = WrapUnique(new X(1, 2)); // works, but nonideal. +// auto x = make_unique(1, 2); // safer, standard, avoids raw 'new'. +// +// Note that `absl::WrapUnique(p)` is valid only if `delete p` is a valid +// expression. In particular, `absl::WrapUnique()` cannot wrap pointers to +// arrays, functions or void, and it must not be used to capture pointers +// obtained from array-new expressions (even though that would compile!). +template +std::unique_ptr WrapUnique(T* ptr) { + static_assert(!std::is_array::value, "array types are unsupported"); + static_assert(std::is_object::value, "non-object types are unsupported"); + return std::unique_ptr(ptr); +} + +namespace memory_internal { + +// Traits to select proper overload and return type for `absl::make_unique<>`. +template +struct MakeUniqueResult { + using scalar = std::unique_ptr; +}; +template +struct MakeUniqueResult { + using array = std::unique_ptr; +}; +template +struct MakeUniqueResult { + using invalid = void; +}; + +} // namespace memory_internal + +// gcc 4.8 has __cplusplus at 201301 but the libstdc++ shipped with it doesn't +// define make_unique. Other supported compilers either just define __cplusplus +// as 201103 but have make_unique (msvc), or have make_unique whenever +// __cplusplus > 201103 (clang). +#if (__cplusplus > 201103L || defined(_MSC_VER)) && \ + !(defined(__GLIBCXX__) && !defined(__cpp_lib_make_unique)) +using std::make_unique; +#else +// ----------------------------------------------------------------------------- +// Function Template: make_unique() +// ----------------------------------------------------------------------------- +// +// Creates a `std::unique_ptr<>`, while avoiding issues creating temporaries +// during the construction process. `absl::make_unique<>` also avoids redundant +// type declarations, by avoiding the need to explicitly use the `new` operator. +// +// This implementation of `absl::make_unique<>` is designed for C++11 code and +// will be replaced in C++14 by the equivalent `std::make_unique<>` abstraction. +// `absl::make_unique<>` is designed to be 100% compatible with +// `std::make_unique<>` so that the eventual migration will involve a simple +// rename operation. +// +// For more background on why `std::unique_ptr(new T(a,b))` is problematic, +// see Herb Sutter's explanation on +// (Exception-Safe Function Calls)[https://herbsutter.com/gotw/_102/]. +// (In general, reviewers should treat `new T(a,b)` with scrutiny.) +// +// Example usage: +// +// auto p = make_unique(args...); // 'p' is a std::unique_ptr +// auto pa = make_unique(5); // 'pa' is a std::unique_ptr +// +// Three overloads of `absl::make_unique` are required: +// +// - For non-array T: +// +// Allocates a T with `new T(std::forward args...)`, +// forwarding all `args` to T's constructor. +// Returns a `std::unique_ptr` owning that object. +// +// - For an array of unknown bounds T[]: +// +// `absl::make_unique<>` will allocate an array T of type U[] with +// `new U[n]()` and return a `std::unique_ptr` owning that array. +// +// Note that 'U[n]()' is different from 'U[n]', and elements will be +// value-initialized. Note as well that `std::unique_ptr` will perform its +// own destruction of the array elements upon leaving scope, even though +// the array [] does not have a default destructor. +// +// NOTE: an array of unknown bounds T[] may still be (and often will be) +// initialized to have a size, and will still use this overload. E.g: +// +// auto my_array = absl::make_unique(10); +// +// - For an array of known bounds T[N]: +// +// `absl::make_unique<>` is deleted (like with `std::make_unique<>`) as +// this overload is not useful. +// +// NOTE: an array of known bounds T[N] is not considered a useful +// construction, and may cause undefined behavior in templates. E.g: +// +// auto my_array = absl::make_unique(); +// +// In those cases, of course, you can still use the overload above and +// simply initialize it to its desired size: +// +// auto my_array = absl::make_unique(10); + +// `absl::make_unique` overload for non-array types. +template +typename memory_internal::MakeUniqueResult::scalar make_unique( + Args&&... args) { + return std::unique_ptr(new T(std::forward(args)...)); +} + +// `absl::make_unique` overload for an array T[] of unknown bounds. +// The array allocation needs to use the `new T[size]` form and cannot take +// element constructor arguments. The `std::unique_ptr` will manage destructing +// these array elements. +template +typename memory_internal::MakeUniqueResult::array make_unique(size_t n) { + return std::unique_ptr(new typename absl::remove_extent_t[n]()); +} + +// `absl::make_unique` overload for an array T[N] of known bounds. +// This construction will be rejected. +template +typename memory_internal::MakeUniqueResult::invalid make_unique( + Args&&... /* args */) = delete; +#endif + +// ----------------------------------------------------------------------------- +// Function Template: RawPtr() +// ----------------------------------------------------------------------------- +// +// Extracts the raw pointer from a pointer-like value `ptr`. `absl::RawPtr` is +// useful within templates that need to handle a complement of raw pointers, +// `std::nullptr_t`, and smart pointers. +template +auto RawPtr(T&& ptr) -> decltype(std::addressof(*ptr)) { + // ptr is a forwarding reference to support Ts with non-const operators. + return (ptr != nullptr) ? std::addressof(*ptr) : nullptr; +} +inline std::nullptr_t RawPtr(std::nullptr_t) { return nullptr; } + +// ----------------------------------------------------------------------------- +// Function Template: ShareUniquePtr() +// ----------------------------------------------------------------------------- +// +// Adopts a `std::unique_ptr` rvalue and returns a `std::shared_ptr` of deduced +// type. Ownership (if any) of the held value is transferred to the returned +// shared pointer. +// +// Example: +// +// auto up = absl::make_unique(10); +// auto sp = absl::ShareUniquePtr(std::move(up)); // shared_ptr +// CHECK_EQ(*sp, 10); +// CHECK(up == nullptr); +// +// Note that this conversion is correct even when T is an array type, and more +// generally it works for *any* deleter of the `unique_ptr` (single-object +// deleter, array deleter, or any custom deleter), since the deleter is adopted +// by the shared pointer as well. The deleter is copied (unless it is a +// reference). +// +// Implements the resolution of [LWG 2415](http://wg21.link/lwg2415), by which a +// null shared pointer does not attempt to call the deleter. +template +std::shared_ptr ShareUniquePtr(std::unique_ptr&& ptr) { + return ptr ? std::shared_ptr(std::move(ptr)) : std::shared_ptr(); +} + +// ----------------------------------------------------------------------------- +// Function Template: WeakenPtr() +// ----------------------------------------------------------------------------- +// +// Creates a weak pointer associated with a given shared pointer. The returned +// value is a `std::weak_ptr` of deduced type. +// +// Example: +// +// auto sp = std::make_shared(10); +// auto wp = absl::WeakenPtr(sp); +// CHECK_EQ(sp.get(), wp.lock().get()); +// sp.reset(); +// CHECK(wp.lock() == nullptr); +// +template +std::weak_ptr WeakenPtr(const std::shared_ptr& ptr) { + return std::weak_ptr(ptr); +} + +namespace memory_internal { + +// ExtractOr::type evaluates to E if possible. Otherwise, D. +template

::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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_MEMORY_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hash_function_defaults.h b/SaraAttended/Pods/abseil/absl/container/internal/hash_function_defaults.h new file mode 100644 index 0000000..401ddf4 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hash_function_defaults.h @@ -0,0 +1,146 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_HASH_FUNCTION_DEFAULTS_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hash_policy_traits.h b/SaraAttended/Pods/abseil/absl/container/internal/hash_policy_traits.h new file mode 100644 index 0000000..3e1209c --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hash_policy_traits.h @@ -0,0 +1,191 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hashtable_debug_hooks.h b/SaraAttended/Pods/abseil/absl/container/internal/hashtable_debug_hooks.h new file mode 100644 index 0000000..3e9ea59 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hashtable_debug_hooks.h @@ -0,0 +1,85 @@ +// 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 + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +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 +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.cc b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.cc new file mode 100644 index 0000000..5644725 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.cc @@ -0,0 +1,269 @@ +// 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/base/internal/exponential_biased.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 { +ABSL_NAMESPACE_BEGIN +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}; + +#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) +ABSL_PER_THREAD_TLS_KEYWORD absl::base_internal::ExponentialBiased + g_exponential_biased_generator; +#endif + +} // namespace + +#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) +ABSL_PER_THREAD_TLS_KEYWORD int64_t global_next_sample = 0; +#endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) + +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); +} + +static bool ShouldForceSampling() { + enum ForceState { + kDontForce, + kForce, + kUninitialized + }; + ABSL_CONST_INIT static std::atomic global_state{ + kUninitialized}; + ForceState state = global_state.load(std::memory_order_relaxed); + if (ABSL_PREDICT_TRUE(state == kDontForce)) return false; + + if (state == kUninitialized) { + state = AbslContainerInternalSampleEverything() ? kForce : kDontForce; + global_state.store(state, std::memory_order_relaxed); + } + return state == kForce; +} + +HashtablezInfo* SampleSlow(int64_t* next_sample) { + if (ABSL_PREDICT_FALSE(ShouldForceSampling())) { + *next_sample = 1; + return HashtablezSampler::Global().Register(); + } + +#if !defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) + *next_sample = std::numeric_limits::max(); + return nullptr; +#else + bool first = *next_sample < 0; + *next_sample = g_exponential_biased_generator.GetStride( + g_hashtablez_sample_parameter.load(std::memory_order_relaxed)); + // Small values of interval are equivalent to just sampling next time. + ABSL_ASSERT(*next_sample >= 1); + + // 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(); +#endif +} + +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 +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.h b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.h new file mode 100644 index 0000000..34d5e57 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler.h @@ -0,0 +1,297 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +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() ABSL_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 ABSL_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 defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) +#error ABSL_INTERNAL_HASHTABLEZ_SAMPLE cannot be directly set +#endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) + +#if (ABSL_PER_THREAD_TLS == 1) && !defined(ABSL_BUILD_DLL) && \ + !defined(ABSL_CONSUME_DLL) +#define ABSL_INTERNAL_HASHTABLEZ_SAMPLE +#endif + +#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) +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 defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE) + if (ABSL_PREDICT_TRUE(--global_next_sample > 0)) { + return HashtablezInfoHandle(nullptr); + } + return HashtablezInfoHandle(SampleSlow(&global_next_sample)); +#else + return HashtablezInfoHandle(nullptr); +#endif // !ABSL_PER_THREAD_TLS +} + +// 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" bool AbslContainerInternalSampleEverything(); + +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler_force_weak_definition.cc b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler_force_weak_definition.cc new file mode 100644 index 0000000..78b9d36 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/hashtablez_sampler_force_weak_definition.cc @@ -0,0 +1,30 @@ +// 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 { +ABSL_NAMESPACE_BEGIN +namespace container_internal { + +// See hashtablez_sampler.h for details. +extern "C" ABSL_ATTRIBUTE_WEAK bool AbslContainerInternalSampleEverything() { + return false; +} + +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl diff --git a/SaraAttended/Pods/abseil/absl/container/internal/have_sse.h b/SaraAttended/Pods/abseil/absl/container/internal/have_sse.h new file mode 100644 index 0000000..4341441 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/have_sse.h @@ -0,0 +1,49 @@ +// 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/SaraAttended/Pods/abseil/absl/container/internal/inlined_vector.h b/SaraAttended/Pods/abseil/absl/container/internal/inlined_vector.h new file mode 100644 index 0000000..4d80b72 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/inlined_vector.h @@ -0,0 +1,892 @@ +// 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 +#include +#include + +#include "absl/base/macros.h" +#include "absl/container/internal/compressed_tuple.h" +#include "absl/memory/memory.h" +#include "absl/meta/type_traits.h" +#include "absl/types/span.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace inlined_vector_internal { + +template +using IsAtLeastForwardIterator = std::is_convertible< + typename std::iterator_traits::iterator_category, + std::forward_iterator_tag>; + +template ::value_type> +using IsMemcpyOk = + absl::conjunction>, + absl::is_trivially_copy_constructible, + absl::is_trivially_copy_assignable, + absl::is_trivially_destructible>; + +template +void DestroyElements(AllocatorType* alloc_ptr, Pointer destroy_first, + SizeType destroy_size) { + using AllocatorTraits = absl::allocator_traits; + + if (destroy_first != nullptr) { + for (auto i = destroy_size; i != 0;) { + --i; + AllocatorTraits::destroy(*alloc_ptr, destroy_first + i); + } + +#if !defined(NDEBUG) + { + using ValueType = typename AllocatorTraits::value_type; + + // 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. + void* memory_ptr = destroy_first; + auto memory_size = destroy_size * sizeof(ValueType); + std::memset(memory_ptr, 0xab, memory_size); + } +#endif // !defined(NDEBUG) + } +} + +template +void ConstructElements(AllocatorType* alloc_ptr, Pointer construct_first, + ValueAdapter* values_ptr, SizeType construct_size) { + for (SizeType i = 0; i < construct_size; ++i) { + ABSL_INTERNAL_TRY { + values_ptr->ConstructNext(alloc_ptr, construct_first + i); + } + ABSL_INTERNAL_CATCH_ANY { + inlined_vector_internal::DestroyElements(alloc_ptr, construct_first, i); + ABSL_INTERNAL_RETHROW; + } + } +} + +template +void AssignElements(Pointer assign_first, ValueAdapter* values_ptr, + SizeType assign_size) { + for (SizeType i = 0; i < assign_size; ++i) { + values_ptr->AssignNext(assign_first + i); + } +} + +template +struct StorageView { + using AllocatorTraits = absl::allocator_traits; + using Pointer = typename AllocatorTraits::pointer; + using SizeType = typename AllocatorTraits::size_type; + + Pointer data; + SizeType size; + SizeType capacity; +}; + +template +class IteratorValueAdapter { + using AllocatorTraits = absl::allocator_traits; + using Pointer = typename AllocatorTraits::pointer; + + public: + explicit IteratorValueAdapter(const Iterator& it) : it_(it) {} + + void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) { + AllocatorTraits::construct(*alloc_ptr, construct_at, *it_); + ++it_; + } + + void AssignNext(Pointer assign_at) { + *assign_at = *it_; + ++it_; + } + + private: + Iterator it_; +}; + +template +class CopyValueAdapter { + using AllocatorTraits = absl::allocator_traits; + using ValueType = typename AllocatorTraits::value_type; + using Pointer = typename AllocatorTraits::pointer; + using ConstPointer = typename AllocatorTraits::const_pointer; + + public: + explicit CopyValueAdapter(const ValueType& v) : ptr_(std::addressof(v)) {} + + void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) { + AllocatorTraits::construct(*alloc_ptr, construct_at, *ptr_); + } + + void AssignNext(Pointer assign_at) { *assign_at = *ptr_; } + + private: + ConstPointer ptr_; +}; + +template +class DefaultValueAdapter { + using AllocatorTraits = absl::allocator_traits; + using ValueType = typename AllocatorTraits::value_type; + using Pointer = typename AllocatorTraits::pointer; + + public: + explicit DefaultValueAdapter() {} + + void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) { + AllocatorTraits::construct(*alloc_ptr, construct_at); + } + + void AssignNext(Pointer assign_at) { *assign_at = ValueType(); } +}; + +template +class AllocationTransaction { + using AllocatorTraits = absl::allocator_traits; + using Pointer = typename AllocatorTraits::pointer; + using SizeType = typename AllocatorTraits::size_type; + + public: + explicit AllocationTransaction(AllocatorType* alloc_ptr) + : alloc_data_(*alloc_ptr, nullptr) {} + + ~AllocationTransaction() { + if (DidAllocate()) { + AllocatorTraits::deallocate(GetAllocator(), GetData(), GetCapacity()); + } + } + + AllocationTransaction(const AllocationTransaction&) = delete; + void operator=(const AllocationTransaction&) = delete; + + AllocatorType& GetAllocator() { return alloc_data_.template get<0>(); } + Pointer& GetData() { return alloc_data_.template get<1>(); } + SizeType& GetCapacity() { return capacity_; } + + bool DidAllocate() { return GetData() != nullptr; } + Pointer Allocate(SizeType capacity) { + GetData() = AllocatorTraits::allocate(GetAllocator(), capacity); + GetCapacity() = capacity; + return GetData(); + } + + void Reset() { + GetData() = nullptr; + GetCapacity() = 0; + } + + private: + container_internal::CompressedTuple alloc_data_; + SizeType capacity_ = 0; +}; + +template +class ConstructionTransaction { + using AllocatorTraits = absl::allocator_traits; + using Pointer = typename AllocatorTraits::pointer; + using SizeType = typename AllocatorTraits::size_type; + + public: + explicit ConstructionTransaction(AllocatorType* alloc_ptr) + : alloc_data_(*alloc_ptr, nullptr) {} + + ~ConstructionTransaction() { + if (DidConstruct()) { + inlined_vector_internal::DestroyElements(std::addressof(GetAllocator()), + GetData(), GetSize()); + } + } + + ConstructionTransaction(const ConstructionTransaction&) = delete; + void operator=(const ConstructionTransaction&) = delete; + + AllocatorType& GetAllocator() { return alloc_data_.template get<0>(); } + Pointer& GetData() { return alloc_data_.template get<1>(); } + SizeType& GetSize() { return size_; } + + bool DidConstruct() { return GetData() != nullptr; } + template + void Construct(Pointer data, ValueAdapter* values_ptr, SizeType size) { + inlined_vector_internal::ConstructElements(std::addressof(GetAllocator()), + data, values_ptr, size); + GetData() = data; + GetSize() = size; + } + void Commit() { + GetData() = nullptr; + GetSize() = 0; + } + + private: + container_internal::CompressedTuple alloc_data_; + SizeType size_ = 0; +}; + +template +class Storage { + public: + using AllocatorTraits = absl::allocator_traits; + using allocator_type = typename AllocatorTraits::allocator_type; + using value_type = typename AllocatorTraits::value_type; + using pointer = typename AllocatorTraits::pointer; + using const_pointer = typename AllocatorTraits::const_pointer; + using size_type = typename AllocatorTraits::size_type; + using difference_type = typename AllocatorTraits::difference_type; + + using reference = value_type&; + using const_reference = const value_type&; + using RValueReference = value_type&&; + using iterator = pointer; + using const_iterator = const_pointer; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + using MoveIterator = std::move_iterator; + using IsMemcpyOk = inlined_vector_internal::IsMemcpyOk; + + using StorageView = inlined_vector_internal::StorageView; + + template + using IteratorValueAdapter = + inlined_vector_internal::IteratorValueAdapter; + using CopyValueAdapter = + inlined_vector_internal::CopyValueAdapter; + using DefaultValueAdapter = + inlined_vector_internal::DefaultValueAdapter; + + using AllocationTransaction = + inlined_vector_internal::AllocationTransaction; + using ConstructionTransaction = + inlined_vector_internal::ConstructionTransaction; + + static size_type NextCapacity(size_type current_capacity) { + return current_capacity * 2; + } + + static size_type ComputeCapacity(size_type current_capacity, + size_type requested_capacity) { + return (std::max)(NextCapacity(current_capacity), requested_capacity); + } + + // --------------------------------------------------------------------------- + // Storage Constructors and Destructor + // --------------------------------------------------------------------------- + + Storage() : metadata_() {} + + explicit Storage(const allocator_type& alloc) : metadata_(alloc, {}) {} + + ~Storage() { + pointer data = GetIsAllocated() ? GetAllocatedData() : GetInlinedData(); + inlined_vector_internal::DestroyElements(GetAllocPtr(), data, GetSize()); + DeallocateIfAllocated(); + } + + // --------------------------------------------------------------------------- + // Storage Member Accessors + // --------------------------------------------------------------------------- + + size_type& GetSizeAndIsAllocated() { return metadata_.template get<1>(); } + + const size_type& GetSizeAndIsAllocated() const { + return metadata_.template get<1>(); + } + + size_type GetSize() const { return GetSizeAndIsAllocated() >> 1; } + + bool GetIsAllocated() const { return GetSizeAndIsAllocated() & 1; } + + pointer GetAllocatedData() { return data_.allocated.allocated_data; } + + const_pointer GetAllocatedData() const { + return data_.allocated.allocated_data; + } + + pointer GetInlinedData() { + return reinterpret_cast( + std::addressof(data_.inlined.inlined_data[0])); + } + + const_pointer GetInlinedData() const { + return reinterpret_cast( + std::addressof(data_.inlined.inlined_data[0])); + } + + size_type GetAllocatedCapacity() const { + return data_.allocated.allocated_capacity; + } + + size_type GetInlinedCapacity() const { return static_cast(N); } + + StorageView MakeStorageView() { + return GetIsAllocated() + ? StorageView{GetAllocatedData(), GetSize(), + GetAllocatedCapacity()} + : StorageView{GetInlinedData(), GetSize(), GetInlinedCapacity()}; + } + + allocator_type* GetAllocPtr() { + return std::addressof(metadata_.template get<0>()); + } + + const allocator_type* GetAllocPtr() const { + return std::addressof(metadata_.template get<0>()); + } + + // --------------------------------------------------------------------------- + // Storage Member Mutators + // --------------------------------------------------------------------------- + + template + void Initialize(ValueAdapter values, size_type new_size); + + template + void Assign(ValueAdapter values, size_type new_size); + + template + void Resize(ValueAdapter values, size_type new_size); + + template + iterator Insert(const_iterator pos, ValueAdapter values, + size_type insert_count); + + template + reference EmplaceBack(Args&&... args); + + iterator Erase(const_iterator from, const_iterator to); + + void Reserve(size_type requested_capacity); + + void ShrinkToFit(); + + void Swap(Storage* other_storage_ptr); + + void SetIsAllocated() { + GetSizeAndIsAllocated() |= static_cast(1); + } + + void UnsetIsAllocated() { + GetSizeAndIsAllocated() &= ((std::numeric_limits::max)() - 1); + } + + void SetSize(size_type size) { + GetSizeAndIsAllocated() = + (size << 1) | static_cast(GetIsAllocated()); + } + + void SetAllocatedSize(size_type size) { + GetSizeAndIsAllocated() = (size << 1) | static_cast(1); + } + + void SetInlinedSize(size_type size) { + GetSizeAndIsAllocated() = size << static_cast(1); + } + + void AddSize(size_type count) { + GetSizeAndIsAllocated() += count << static_cast(1); + } + + void SubtractSize(size_type count) { + assert(count <= GetSize()); + + GetSizeAndIsAllocated() -= count << static_cast(1); + } + + void SetAllocatedData(pointer data, size_type capacity) { + data_.allocated.allocated_data = data; + data_.allocated.allocated_capacity = capacity; + } + + void AcquireAllocatedData(AllocationTransaction* allocation_tx_ptr) { + SetAllocatedData(allocation_tx_ptr->GetData(), + allocation_tx_ptr->GetCapacity()); + + allocation_tx_ptr->Reset(); + } + + void MemcpyFrom(const Storage& other_storage) { + assert(IsMemcpyOk::value || other_storage.GetIsAllocated()); + + GetSizeAndIsAllocated() = other_storage.GetSizeAndIsAllocated(); + data_ = other_storage.data_; + } + + void DeallocateIfAllocated() { + if (GetIsAllocated()) { + AllocatorTraits::deallocate(*GetAllocPtr(), GetAllocatedData(), + GetAllocatedCapacity()); + } + } + + private: + using Metadata = + container_internal::CompressedTuple; + + struct Allocated { + pointer allocated_data; + size_type allocated_capacity; + }; + + struct Inlined { + alignas(value_type) char inlined_data[sizeof(value_type[N])]; + }; + + union Data { + Allocated allocated; + Inlined inlined; + }; + + Metadata metadata_; + Data data_; +}; + +template +template +auto Storage::Initialize(ValueAdapter values, size_type new_size) + -> void { + // Only callable from constructors! + assert(!GetIsAllocated()); + assert(GetSize() == 0); + + pointer construct_data; + if (new_size > GetInlinedCapacity()) { + // Because this is only called from the `InlinedVector` constructors, it's + // safe to take on the allocation with size `0`. If `ConstructElements(...)` + // throws, deallocation will be automatically handled by `~Storage()`. + size_type new_capacity = ComputeCapacity(GetInlinedCapacity(), new_size); + construct_data = AllocatorTraits::allocate(*GetAllocPtr(), new_capacity); + SetAllocatedData(construct_data, new_capacity); + SetIsAllocated(); + } else { + construct_data = GetInlinedData(); + } + + inlined_vector_internal::ConstructElements(GetAllocPtr(), construct_data, + &values, new_size); + + // Since the initial size was guaranteed to be `0` and the allocated bit is + // already correct for either case, *adding* `new_size` gives us the correct + // result faster than setting it directly. + AddSize(new_size); +} + +template +template +auto Storage::Assign(ValueAdapter values, size_type new_size) -> void { + StorageView storage_view = MakeStorageView(); + + AllocationTransaction allocation_tx(GetAllocPtr()); + + absl::Span assign_loop; + absl::Span construct_loop; + absl::Span destroy_loop; + + if (new_size > storage_view.capacity) { + size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size); + construct_loop = {allocation_tx.Allocate(new_capacity), new_size}; + destroy_loop = {storage_view.data, storage_view.size}; + } else if (new_size > storage_view.size) { + assign_loop = {storage_view.data, storage_view.size}; + construct_loop = {storage_view.data + storage_view.size, + new_size - storage_view.size}; + } else { + assign_loop = {storage_view.data, new_size}; + destroy_loop = {storage_view.data + new_size, storage_view.size - new_size}; + } + + inlined_vector_internal::AssignElements(assign_loop.data(), &values, + assign_loop.size()); + + inlined_vector_internal::ConstructElements( + GetAllocPtr(), construct_loop.data(), &values, construct_loop.size()); + + inlined_vector_internal::DestroyElements(GetAllocPtr(), destroy_loop.data(), + destroy_loop.size()); + + if (allocation_tx.DidAllocate()) { + DeallocateIfAllocated(); + AcquireAllocatedData(&allocation_tx); + SetIsAllocated(); + } + + SetSize(new_size); +} + +template +template +auto Storage::Resize(ValueAdapter values, size_type new_size) -> void { + StorageView storage_view = MakeStorageView(); + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data)); + + AllocationTransaction allocation_tx(GetAllocPtr()); + ConstructionTransaction construction_tx(GetAllocPtr()); + + absl::Span construct_loop; + absl::Span move_construct_loop; + absl::Span destroy_loop; + + if (new_size > storage_view.capacity) { + size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size); + pointer new_data = allocation_tx.Allocate(new_capacity); + construct_loop = {new_data + storage_view.size, + new_size - storage_view.size}; + move_construct_loop = {new_data, storage_view.size}; + destroy_loop = {storage_view.data, storage_view.size}; + } else if (new_size > storage_view.size) { + construct_loop = {storage_view.data + storage_view.size, + new_size - storage_view.size}; + } else { + destroy_loop = {storage_view.data + new_size, storage_view.size - new_size}; + } + + construction_tx.Construct(construct_loop.data(), &values, + construct_loop.size()); + + inlined_vector_internal::ConstructElements( + GetAllocPtr(), move_construct_loop.data(), &move_values, + move_construct_loop.size()); + + inlined_vector_internal::DestroyElements(GetAllocPtr(), destroy_loop.data(), + destroy_loop.size()); + + construction_tx.Commit(); + if (allocation_tx.DidAllocate()) { + DeallocateIfAllocated(); + AcquireAllocatedData(&allocation_tx); + SetIsAllocated(); + } + + SetSize(new_size); +} + +template +template +auto Storage::Insert(const_iterator pos, ValueAdapter values, + size_type insert_count) -> iterator { + StorageView storage_view = MakeStorageView(); + + size_type insert_index = + std::distance(const_iterator(storage_view.data), pos); + size_type insert_end_index = insert_index + insert_count; + size_type new_size = storage_view.size + insert_count; + + if (new_size > storage_view.capacity) { + AllocationTransaction allocation_tx(GetAllocPtr()); + ConstructionTransaction construction_tx(GetAllocPtr()); + ConstructionTransaction move_construciton_tx(GetAllocPtr()); + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data)); + + size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size); + pointer new_data = allocation_tx.Allocate(new_capacity); + + construction_tx.Construct(new_data + insert_index, &values, insert_count); + + move_construciton_tx.Construct(new_data, &move_values, insert_index); + + inlined_vector_internal::ConstructElements( + GetAllocPtr(), new_data + insert_end_index, &move_values, + storage_view.size - insert_index); + + inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data, + storage_view.size); + + construction_tx.Commit(); + move_construciton_tx.Commit(); + DeallocateIfAllocated(); + AcquireAllocatedData(&allocation_tx); + + SetAllocatedSize(new_size); + return iterator(new_data + insert_index); + } else { + size_type move_construction_destination_index = + (std::max)(insert_end_index, storage_view.size); + + ConstructionTransaction move_construction_tx(GetAllocPtr()); + + IteratorValueAdapter move_construction_values( + MoveIterator(storage_view.data + + (move_construction_destination_index - insert_count))); + absl::Span move_construction = { + storage_view.data + move_construction_destination_index, + new_size - move_construction_destination_index}; + + pointer move_assignment_values = storage_view.data + insert_index; + absl::Span move_assignment = { + storage_view.data + insert_end_index, + move_construction_destination_index - insert_end_index}; + + absl::Span insert_assignment = {move_assignment_values, + move_construction.size()}; + + absl::Span insert_construction = { + insert_assignment.data() + insert_assignment.size(), + insert_count - insert_assignment.size()}; + + move_construction_tx.Construct(move_construction.data(), + &move_construction_values, + move_construction.size()); + + for (pointer destination = move_assignment.data() + move_assignment.size(), + last_destination = move_assignment.data(), + source = move_assignment_values + move_assignment.size(); + ;) { + --destination; + --source; + if (destination < last_destination) break; + *destination = std::move(*source); + } + + inlined_vector_internal::AssignElements(insert_assignment.data(), &values, + insert_assignment.size()); + + inlined_vector_internal::ConstructElements( + GetAllocPtr(), insert_construction.data(), &values, + insert_construction.size()); + + move_construction_tx.Commit(); + + AddSize(insert_count); + return iterator(storage_view.data + insert_index); + } +} + +template +template +auto Storage::EmplaceBack(Args&&... args) -> reference { + StorageView storage_view = MakeStorageView(); + + AllocationTransaction allocation_tx(GetAllocPtr()); + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data)); + + pointer construct_data; + if (storage_view.size == storage_view.capacity) { + size_type new_capacity = NextCapacity(storage_view.capacity); + construct_data = allocation_tx.Allocate(new_capacity); + } else { + construct_data = storage_view.data; + } + + pointer last_ptr = construct_data + storage_view.size; + + AllocatorTraits::construct(*GetAllocPtr(), last_ptr, + std::forward(args)...); + + if (allocation_tx.DidAllocate()) { + ABSL_INTERNAL_TRY { + inlined_vector_internal::ConstructElements( + GetAllocPtr(), allocation_tx.GetData(), &move_values, + storage_view.size); + } + ABSL_INTERNAL_CATCH_ANY { + AllocatorTraits::destroy(*GetAllocPtr(), last_ptr); + ABSL_INTERNAL_RETHROW; + } + + inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data, + storage_view.size); + + DeallocateIfAllocated(); + AcquireAllocatedData(&allocation_tx); + SetIsAllocated(); + } + + AddSize(1); + return *last_ptr; +} + +template +auto Storage::Erase(const_iterator from, const_iterator to) + -> iterator { + StorageView storage_view = MakeStorageView(); + + size_type erase_size = std::distance(from, to); + size_type erase_index = + std::distance(const_iterator(storage_view.data), from); + size_type erase_end_index = erase_index + erase_size; + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data + erase_end_index)); + + inlined_vector_internal::AssignElements(storage_view.data + erase_index, + &move_values, + storage_view.size - erase_end_index); + + inlined_vector_internal::DestroyElements( + GetAllocPtr(), storage_view.data + (storage_view.size - erase_size), + erase_size); + + SubtractSize(erase_size); + return iterator(storage_view.data + erase_index); +} + +template +auto Storage::Reserve(size_type requested_capacity) -> void { + StorageView storage_view = MakeStorageView(); + + if (ABSL_PREDICT_FALSE(requested_capacity <= storage_view.capacity)) return; + + AllocationTransaction allocation_tx(GetAllocPtr()); + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data)); + + size_type new_capacity = + ComputeCapacity(storage_view.capacity, requested_capacity); + pointer new_data = allocation_tx.Allocate(new_capacity); + + inlined_vector_internal::ConstructElements(GetAllocPtr(), new_data, + &move_values, storage_view.size); + + inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data, + storage_view.size); + + DeallocateIfAllocated(); + AcquireAllocatedData(&allocation_tx); + SetIsAllocated(); +} + +template +auto Storage::ShrinkToFit() -> void { + // May only be called on allocated instances! + assert(GetIsAllocated()); + + StorageView storage_view{GetAllocatedData(), GetSize(), + GetAllocatedCapacity()}; + + if (ABSL_PREDICT_FALSE(storage_view.size == storage_view.capacity)) return; + + AllocationTransaction allocation_tx(GetAllocPtr()); + + IteratorValueAdapter move_values( + MoveIterator(storage_view.data)); + + pointer construct_data; + if (storage_view.size > GetInlinedCapacity()) { + size_type new_capacity = storage_view.size; + construct_data = allocation_tx.Allocate(new_capacity); + } else { + construct_data = GetInlinedData(); + } + + ABSL_INTERNAL_TRY { + inlined_vector_internal::ConstructElements(GetAllocPtr(), construct_data, + &move_values, storage_view.size); + } + ABSL_INTERNAL_CATCH_ANY { + SetAllocatedData(storage_view.data, storage_view.capacity); + ABSL_INTERNAL_RETHROW; + } + + inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data, + storage_view.size); + + AllocatorTraits::deallocate(*GetAllocPtr(), storage_view.data, + storage_view.capacity); + + if (allocation_tx.DidAllocate()) { + AcquireAllocatedData(&allocation_tx); + } else { + UnsetIsAllocated(); + } +} + +template +auto Storage::Swap(Storage* other_storage_ptr) -> void { + using std::swap; + assert(this != other_storage_ptr); + + if (GetIsAllocated() && other_storage_ptr->GetIsAllocated()) { + swap(data_.allocated, other_storage_ptr->data_.allocated); + } else if (!GetIsAllocated() && !other_storage_ptr->GetIsAllocated()) { + Storage* small_ptr = this; + Storage* large_ptr = other_storage_ptr; + if (small_ptr->GetSize() > large_ptr->GetSize()) swap(small_ptr, large_ptr); + + for (size_type i = 0; i < small_ptr->GetSize(); ++i) { + swap(small_ptr->GetInlinedData()[i], large_ptr->GetInlinedData()[i]); + } + + IteratorValueAdapter move_values( + MoveIterator(large_ptr->GetInlinedData() + small_ptr->GetSize())); + + inlined_vector_internal::ConstructElements( + large_ptr->GetAllocPtr(), + small_ptr->GetInlinedData() + small_ptr->GetSize(), &move_values, + large_ptr->GetSize() - small_ptr->GetSize()); + + inlined_vector_internal::DestroyElements( + large_ptr->GetAllocPtr(), + large_ptr->GetInlinedData() + small_ptr->GetSize(), + large_ptr->GetSize() - small_ptr->GetSize()); + } else { + Storage* allocated_ptr = this; + Storage* inlined_ptr = other_storage_ptr; + if (!allocated_ptr->GetIsAllocated()) swap(allocated_ptr, inlined_ptr); + + StorageView allocated_storage_view{allocated_ptr->GetAllocatedData(), + allocated_ptr->GetSize(), + allocated_ptr->GetAllocatedCapacity()}; + + IteratorValueAdapter move_values( + MoveIterator(inlined_ptr->GetInlinedData())); + + ABSL_INTERNAL_TRY { + inlined_vector_internal::ConstructElements( + inlined_ptr->GetAllocPtr(), allocated_ptr->GetInlinedData(), + &move_values, inlined_ptr->GetSize()); + } + ABSL_INTERNAL_CATCH_ANY { + allocated_ptr->SetAllocatedData(allocated_storage_view.data, + allocated_storage_view.capacity); + ABSL_INTERNAL_RETHROW; + } + + inlined_vector_internal::DestroyElements(inlined_ptr->GetAllocPtr(), + inlined_ptr->GetInlinedData(), + inlined_ptr->GetSize()); + + inlined_ptr->SetAllocatedData(allocated_storage_view.data, + allocated_storage_view.capacity); + } + + swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated()); + swap(*GetAllocPtr(), *other_storage_ptr->GetAllocPtr()); +} + +} // namespace inlined_vector_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_INLINED_VECTOR_INTERNAL_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/layout.h b/SaraAttended/Pods/abseil/absl/container/internal/layout.h new file mode 100644 index 0000000..69cc85d --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/layout.h @@ -0,0 +1,741 @@ +// 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. +// +// MOTIVATION AND TUTORIAL +// +// If you want to put in a single heap allocation N doubles followed by M ints, +// it's easy if N and M are known at compile time. +// +// struct S { +// double a[N]; +// int b[M]; +// }; +// +// S* p = new S; +// +// But what if N and M are known only in run time? Class template Layout to the +// rescue! It's a portable generalization of the technique known as struct hack. +// +// // This object will tell us everything we need to know about the memory +// // layout of double[N] followed by int[M]. It's structurally identical to +// // size_t[2] that stores N and M. It's very cheap to create. +// const Layout layout(N, M); +// +// // Allocate enough memory for both arrays. `AllocSize()` tells us how much +// // memory is needed. We are free to use any allocation function we want as +// // long as it returns aligned memory. +// std::unique_ptr p(new unsigned char[layout.AllocSize()]); +// +// // Obtain the pointer to the array of doubles. +// // Equivalent to `reinterpret_cast(p.get())`. +// // +// // We could have written layout.Pointer<0>(p) instead. If all the types are +// // unique you can use either form, but if some types are repeated you must +// // use the index form. +// double* a = layout.Pointer(p.get()); +// +// // Obtain the pointer to the array of ints. +// // Equivalent to `reinterpret_cast(p.get() + N * 8)`. +// int* b = layout.Pointer(p); +// +// If we are unable to specify sizes of all fields, we can pass as many sizes as +// we can to `Partial()`. In return, it'll allow us to access the fields whose +// locations and sizes can be computed from the provided information. +// `Partial()` comes in handy when the array sizes are embedded into the +// allocation. +// +// // size_t[1] containing N, size_t[1] containing M, double[N], int[M]. +// using L = Layout; +// +// unsigned char* Allocate(size_t n, size_t m) { +// const L layout(1, 1, n, m); +// unsigned char* p = new unsigned char[layout.AllocSize()]; +// *layout.Pointer<0>(p) = n; +// *layout.Pointer<1>(p) = m; +// return p; +// } +// +// void Use(unsigned char* p) { +// // First, extract N and M. +// // Specify that the first array has only one element. Using `prefix` we +// // can access the first two arrays but not more. +// constexpr auto prefix = L::Partial(1); +// size_t n = *prefix.Pointer<0>(p); +// size_t m = *prefix.Pointer<1>(p); +// +// // Now we can get pointers to the payload. +// const L layout(1, 1, n, m); +// double* a = layout.Pointer(p); +// int* b = layout.Pointer(p); +// } +// +// The layout we used above combines fixed-size with dynamically-sized fields. +// This is quite common. Layout is optimized for this use case and generates +// optimal code. All computations that can be performed at compile time are +// indeed performed at compile time. +// +// Efficiency tip: The order of fields matters. In `Layout` try to +// ensure that `alignof(T1) >= ... >= alignof(TN)`. This way you'll have no +// padding in between arrays. +// +// You can manually override the alignment of an array by wrapping the type in +// `Aligned`. `Layout<..., Aligned, ...>` has exactly the same API +// and behavior as `Layout<..., T, ...>` except that the first element of the +// array of `T` is aligned to `N` (the rest of the elements follow without +// padding). `N` cannot be less than `alignof(T)`. +// +// `AllocSize()` and `Pointer()` are the most basic methods for dealing with +// memory layouts. Check out the reference or code below to discover more. +// +// EXAMPLE +// +// // Immutable move-only string with sizeof equal to sizeof(void*). The +// // string size and the characters are kept in the same heap allocation. +// class CompactString { +// public: +// CompactString(const char* s = "") { +// const size_t size = strlen(s); +// // size_t[1] followed by char[size + 1]. +// const L layout(1, size + 1); +// p_.reset(new unsigned char[layout.AllocSize()]); +// // If running under ASAN, mark the padding bytes, if any, to catch +// // memory errors. +// layout.PoisonPadding(p_.get()); +// // Store the size in the allocation. +// *layout.Pointer(p_.get()) = size; +// // Store the characters in the allocation. +// memcpy(layout.Pointer(p_.get()), s, size + 1); +// } +// +// size_t size() const { +// // Equivalent to reinterpret_cast(*p). +// return *L::Partial().Pointer(p_.get()); +// } +// +// const char* c_str() const { +// // Equivalent to reinterpret_cast(p.get() + sizeof(size_t)). +// // The argument in Partial(1) specifies that we have size_t[1] in front +// // of the characters. +// return L::Partial(1).Pointer(p_.get()); +// } +// +// private: +// // Our heap allocation contains a size_t followed by an array of chars. +// using L = Layout; +// std::unique_ptr p_; +// }; +// +// int main() { +// CompactString s = "hello"; +// assert(s.size() == 5); +// assert(strcmp(s.c_str(), "hello") == 0); +// } +// +// DOCUMENTATION +// +// The interface exported by this file consists of: +// - class `Layout<>` and its public members. +// - The public members of class `internal_layout::LayoutImpl<>`. That class +// isn't intended to be used directly, and its name and template parameter +// list are internal implementation details, but the class itself provides +// most of the functionality in this file. See comments on its members for +// detailed documentation. +// +// `Layout::Partial(count1,..., countm)` (where `m` <= `n`) returns a +// `LayoutImpl<>` object. `Layout layout(count1,..., countn)` +// creates a `Layout` object, which exposes the same functionality by inheriting +// from `LayoutImpl<>`. + +#ifndef ABSL_CONTAINER_INTERNAL_LAYOUT_H_ +#define ABSL_CONTAINER_INTERNAL_LAYOUT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ADDRESS_SANITIZER +#include +#endif + +#include "absl/meta/type_traits.h" +#include "absl/strings/str_cat.h" +#include "absl/types/span.h" +#include "absl/utility/utility.h" + +#if defined(__GXX_RTTI) +#define ABSL_INTERNAL_HAS_CXA_DEMANGLE +#endif + +#ifdef ABSL_INTERNAL_HAS_CXA_DEMANGLE +#include +#endif + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace container_internal { + +// A type wrapper that instructs `Layout` to use the specific alignment for the +// array. `Layout<..., Aligned, ...>` has exactly the same API +// and behavior as `Layout<..., T, ...>` except that the first element of the +// array of `T` is aligned to `N` (the rest of the elements follow without +// padding). +// +// Requires: `N >= alignof(T)` and `N` is a power of 2. +template +struct Aligned; + +namespace internal_layout { + +template +struct NotAligned {}; + +template +struct NotAligned> { + static_assert(sizeof(T) == 0, "Aligned cannot be const-qualified"); +}; + +template +using IntToSize = size_t; + +template +using TypeToSize = size_t; + +template +struct Type : NotAligned { + using type = T; +}; + +template +struct Type> { + using type = T; +}; + +template +struct SizeOf : NotAligned, std::integral_constant {}; + +template +struct SizeOf> : std::integral_constant {}; + +// Note: workaround for https://gcc.gnu.org/PR88115 +template +struct AlignOf : NotAligned { + static constexpr size_t value = alignof(T); +}; + +template +struct AlignOf> { + static_assert(N % alignof(T) == 0, + "Custom alignment can't be lower than the type's alignment"); + static constexpr size_t value = N; +}; + +// Does `Ts...` contain `T`? +template +using Contains = absl::disjunction...>; + +template +using CopyConst = + typename std::conditional::value, const To, To>::type; + +// Note: We're not qualifying this with absl:: because it doesn't compile under +// MSVC. +template +using SliceType = Span; + +// This namespace contains no types. It prevents functions defined in it from +// being found by ADL. +namespace adl_barrier { + +template +constexpr size_t Find(Needle, Needle, Ts...) { + static_assert(!Contains(), "Duplicate element type"); + return 0; +} + +template +constexpr size_t Find(Needle, T, Ts...) { + return adl_barrier::Find(Needle(), Ts()...) + 1; +} + +constexpr bool IsPow2(size_t n) { return !(n & (n - 1)); } + +// Returns `q * m` for the smallest `q` such that `q * m >= n`. +// Requires: `m` is a power of two. It's enforced by IsLegalElementType below. +constexpr size_t Align(size_t n, size_t m) { return (n + m - 1) & ~(m - 1); } + +constexpr size_t Min(size_t a, size_t b) { return b < a ? b : a; } + +constexpr size_t Max(size_t a) { return a; } + +template +constexpr size_t Max(size_t a, size_t b, Ts... rest) { + return adl_barrier::Max(b < a ? a : b, rest...); +} + +template +std::string TypeName() { + std::string out; + int status = 0; + char* demangled = nullptr; +#ifdef ABSL_INTERNAL_HAS_CXA_DEMANGLE + demangled = abi::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status); +#endif + if (status == 0 && demangled != nullptr) { // Demangling succeeded. + absl::StrAppend(&out, "<", demangled, ">"); + free(demangled); + } else { +#if defined(__GXX_RTTI) || defined(_CPPRTTI) + absl::StrAppend(&out, "<", typeid(T).name(), ">"); +#endif + } + return out; +} + +} // namespace adl_barrier + +template +using EnableIf = typename std::enable_if::type; + +// Can `T` be a template argument of `Layout`? +template +using IsLegalElementType = std::integral_constant< + bool, !std::is_reference::value && !std::is_volatile::value && + !std::is_reference::type>::value && + !std::is_volatile::type>::value && + adl_barrier::IsPow2(AlignOf::value)>; + +template +class LayoutImpl; + +// Public base class of `Layout` and the result type of `Layout::Partial()`. +// +// `Elements...` contains all template arguments of `Layout` that created this +// instance. +// +// `SizeSeq...` is `[0, NumSizes)` where `NumSizes` is the number of arguments +// passed to `Layout::Partial()` or `Layout::Layout()`. +// +// `OffsetSeq...` is `[0, NumOffsets)` where `NumOffsets` is +// `Min(sizeof...(Elements), NumSizes + 1)` (the number of arrays for which we +// can compute offsets). +template +class LayoutImpl, absl::index_sequence, + absl::index_sequence> { + private: + static_assert(sizeof...(Elements) > 0, "At least one field is required"); + static_assert(absl::conjunction...>::value, + "Invalid element type (see IsLegalElementType)"); + + enum { + NumTypes = sizeof...(Elements), + NumSizes = sizeof...(SizeSeq), + NumOffsets = sizeof...(OffsetSeq), + }; + + // These are guaranteed by `Layout`. + static_assert(NumOffsets == adl_barrier::Min(NumTypes, NumSizes + 1), + "Internal error"); + static_assert(NumTypes > 0, "Internal error"); + + // Returns the index of `T` in `Elements...`. Results in a compilation error + // if `Elements...` doesn't contain exactly one instance of `T`. + template + static constexpr size_t ElementIndex() { + static_assert(Contains, Type::type>...>(), + "Type not found"); + return adl_barrier::Find(Type(), + Type::type>()...); + } + + template + using ElementAlignment = + AlignOf>::type>; + + public: + // Element types of all arrays packed in a tuple. + using ElementTypes = std::tuple::type...>; + + // Element type of the Nth array. + template + using ElementType = typename std::tuple_element::type; + + constexpr explicit LayoutImpl(IntToSize... sizes) + : size_{sizes...} {} + + // Alignment of the layout, equal to the strictest alignment of all elements. + // All pointers passed to the methods of layout must be aligned to this value. + static constexpr size_t Alignment() { + return adl_barrier::Max(AlignOf::value...); + } + + // Offset in bytes of the Nth array. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // assert(x.Offset<0>() == 0); // The ints starts from 0. + // assert(x.Offset<1>() == 16); // The doubles starts from 16. + // + // Requires: `N <= NumSizes && N < sizeof...(Ts)`. + template = 0> + constexpr size_t Offset() const { + return 0; + } + + template = 0> + constexpr size_t Offset() const { + static_assert(N < NumOffsets, "Index out of bounds"); + return adl_barrier::Align( + Offset() + SizeOf>() * size_[N - 1], + ElementAlignment::value); + } + + // Offset in bytes of the array with the specified element type. There must + // be exactly one such array and its zero-based index must be at most + // `NumSizes`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // assert(x.Offset() == 0); // The ints starts from 0. + // assert(x.Offset() == 16); // The doubles starts from 16. + template + constexpr size_t Offset() const { + return Offset()>(); + } + + // Offsets in bytes of all arrays for which the offsets are known. + constexpr std::array Offsets() const { + return {{Offset()...}}; + } + + // The number of elements in the Nth array. This is the Nth argument of + // `Layout::Partial()` or `Layout::Layout()` (zero-based). + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // assert(x.Size<0>() == 3); + // assert(x.Size<1>() == 4); + // + // Requires: `N < NumSizes`. + template + constexpr size_t Size() const { + static_assert(N < NumSizes, "Index out of bounds"); + return size_[N]; + } + + // The number of elements in the array with the specified element type. + // There must be exactly one such array and its zero-based index must be + // at most `NumSizes`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // assert(x.Size() == 3); + // assert(x.Size() == 4); + template + constexpr size_t Size() const { + return Size()>(); + } + + // The number of elements of all arrays for which they are known. + constexpr std::array Sizes() const { + return {{Size()...}}; + } + + // Pointer to the beginning of the Nth array. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // int* ints = x.Pointer<0>(p); + // double* doubles = x.Pointer<1>(p); + // + // Requires: `N <= NumSizes && N < sizeof...(Ts)`. + // Requires: `p` is aligned to `Alignment()`. + template + CopyConst>* Pointer(Char* p) const { + using C = typename std::remove_const::type; + static_assert( + std::is_same() || std::is_same() || + std::is_same(), + "The argument must be a pointer to [const] [signed|unsigned] char"); + constexpr size_t alignment = Alignment(); + (void)alignment; + assert(reinterpret_cast(p) % alignment == 0); + return reinterpret_cast>*>(p + Offset()); + } + + // Pointer to the beginning of the array with the specified element type. + // There must be exactly one such array and its zero-based index must be at + // most `NumSizes`. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // int* ints = x.Pointer(p); + // double* doubles = x.Pointer(p); + // + // Requires: `p` is aligned to `Alignment()`. + template + CopyConst* Pointer(Char* p) const { + return Pointer()>(p); + } + + // Pointers to all arrays for which pointers are known. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // + // int* ints; + // double* doubles; + // std::tie(ints, doubles) = x.Pointers(p); + // + // Requires: `p` is aligned to `Alignment()`. + // + // Note: We're not using ElementType alias here because it does not compile + // under MSVC. + template + std::tuple::type>*...> + Pointers(Char* p) const { + return std::tuple>*...>( + Pointer(p)...); + } + + // The Nth array. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // Span ints = x.Slice<0>(p); + // Span doubles = x.Slice<1>(p); + // + // Requires: `N < NumSizes`. + // Requires: `p` is aligned to `Alignment()`. + template + SliceType>> Slice(Char* p) const { + return SliceType>>(Pointer(p), Size()); + } + + // The array with the specified element type. There must be exactly one + // such array and its zero-based index must be less than `NumSizes`. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // Span ints = x.Slice(p); + // Span doubles = x.Slice(p); + // + // Requires: `p` is aligned to `Alignment()`. + template + SliceType> Slice(Char* p) const { + return Slice()>(p); + } + + // All arrays with known sizes. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; + // + // Span ints; + // Span doubles; + // std::tie(ints, doubles) = x.Slices(p); + // + // Requires: `p` is aligned to `Alignment()`. + // + // Note: We're not using ElementType alias here because it does not compile + // under MSVC. + template + std::tuple::type>>...> + Slices(Char* p) const { + // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63875 (fixed + // in 6.1). + (void)p; + return std::tuple>>...>( + Slice(p)...); + } + + // The size of the allocation that fits all arrays. + // + // // int[3], 4 bytes of padding, double[4]. + // Layout x(3, 4); + // unsigned char* p = new unsigned char[x.AllocSize()]; // 48 bytes + // + // Requires: `NumSizes == sizeof...(Ts)`. + constexpr size_t AllocSize() const { + static_assert(NumTypes == NumSizes, "You must specify sizes of all fields"); + return Offset() + + SizeOf>() * size_[NumTypes - 1]; + } + + // If built with --config=asan, poisons padding bytes (if any) in the + // allocation. The pointer must point to a memory block at least + // `AllocSize()` bytes in length. + // + // `Char` must be `[const] [signed|unsigned] char`. + // + // Requires: `p` is aligned to `Alignment()`. + template = 0> + void PoisonPadding(const Char* p) const { + Pointer<0>(p); // verify the requirements on `Char` and `p` + } + + template = 0> + void PoisonPadding(const Char* p) const { + static_assert(N < NumOffsets, "Index out of bounds"); + (void)p; +#ifdef ADDRESS_SANITIZER + PoisonPadding(p); + // The `if` is an optimization. It doesn't affect the observable behaviour. + if (ElementAlignment::value % ElementAlignment::value) { + size_t start = + Offset() + SizeOf>() * size_[N - 1]; + ASAN_POISON_MEMORY_REGION(p + start, Offset() - start); + } +#endif + } + + // Human-readable description of the memory layout. Useful for debugging. + // Slow. + // + // // char[5], 3 bytes of padding, int[3], 4 bytes of padding, followed + // // by an unknown number of doubles. + // auto x = Layout::Partial(5, 3); + // assert(x.DebugString() == + // "@0(1)[5]; @8(4)[3]; @24(8)"); + // + // Each field is in the following format: @offset(sizeof)[size] ( + // may be missing depending on the target platform). For example, + // @8(4)[3] means that at offset 8 we have an array of ints, where each + // int is 4 bytes, and we have 3 of those ints. The size of the last field may + // be missing (as in the example above). Only fields with known offsets are + // described. Type names may differ across platforms: one compiler might + // produce "unsigned*" where another produces "unsigned int *". + std::string DebugString() const { + const auto offsets = Offsets(); + const size_t sizes[] = {SizeOf>()...}; + const std::string types[] = { + adl_barrier::TypeName>()...}; + std::string res = absl::StrCat("@0", types[0], "(", sizes[0], ")"); + for (size_t i = 0; i != NumOffsets - 1; ++i) { + absl::StrAppend(&res, "[", size_[i], "]; @", offsets[i + 1], types[i + 1], + "(", sizes[i + 1], ")"); + } + // NumSizes is a constant that may be zero. Some compilers cannot see that + // inside the if statement "size_[NumSizes - 1]" must be valid. + int last = static_cast(NumSizes) - 1; + if (NumTypes == NumSizes && last >= 0) { + absl::StrAppend(&res, "[", size_[last], "]"); + } + return res; + } + + private: + // Arguments of `Layout::Partial()` or `Layout::Layout()`. + size_t size_[NumSizes > 0 ? NumSizes : 1]; +}; + +template +using LayoutType = LayoutImpl< + std::tuple, absl::make_index_sequence, + absl::make_index_sequence>; + +} // namespace internal_layout + +// Descriptor of arrays of various types and sizes laid out in memory one after +// another. See the top of the file for documentation. +// +// Check out the public API of internal_layout::LayoutImpl above. The type is +// internal to the library but its methods are public, and they are inherited +// by `Layout`. +template +class Layout : public internal_layout::LayoutType { + public: + static_assert(sizeof...(Ts) > 0, "At least one field is required"); + static_assert( + absl::conjunction...>::value, + "Invalid element type (see IsLegalElementType)"); + + // The result type of `Partial()` with `NumSizes` arguments. + template + using PartialType = internal_layout::LayoutType; + + // `Layout` knows the element types of the arrays we want to lay out in + // memory but not the number of elements in each array. + // `Partial(size1, ..., sizeN)` allows us to specify the latter. The + // resulting immutable object can be used to obtain pointers to the + // individual arrays. + // + // It's allowed to pass fewer array sizes than the number of arrays. E.g., + // if all you need is to the offset of the second array, you only need to + // pass one argument -- the number of elements in the first array. + // + // // int[3] followed by 4 bytes of padding and an unknown number of + // // doubles. + // auto x = Layout::Partial(3); + // // doubles start at byte 16. + // assert(x.Offset<1>() == 16); + // + // If you know the number of elements in all arrays, you can still call + // `Partial()` but it's more convenient to use the constructor of `Layout`. + // + // Layout x(3, 5); + // + // Note: The sizes of the arrays must be specified in number of elements, + // not in bytes. + // + // Requires: `sizeof...(Sizes) <= sizeof...(Ts)`. + // Requires: all arguments are convertible to `size_t`. + template + static constexpr PartialType Partial(Sizes&&... sizes) { + static_assert(sizeof...(Sizes) <= sizeof...(Ts), ""); + return PartialType(absl::forward(sizes)...); + } + + // Creates a layout with the sizes of all arrays specified. If you know + // only the sizes of the first N arrays (where N can be zero), you can use + // `Partial()` defined above. The constructor is essentially equivalent to + // calling `Partial()` and passing in all array sizes; the constructor is + // provided as a convenient abbreviation. + // + // Note: The sizes of the arrays must be specified in number of elements, + // not in bytes. + constexpr explicit Layout(internal_layout::TypeToSize... sizes) + : internal_layout::LayoutType(sizes...) {} +}; + +} // namespace container_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_CONTAINER_INTERNAL_LAYOUT_H_ diff --git a/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_map.h b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_map.h new file mode 100644 index 0000000..0a02757 --- /dev/null +++ b/SaraAttended/Pods/abseil/absl/container/internal/raw_hash_map.h @@ -0,0 +1,197 @@ +// 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_RAW_HASH_MAP_H_ +#define ABSL_CONTAINER_INTERNAL_RAW_HASH_MAP_H_ + +#include +#include +#include + +#include "absl/base/internal/throw_delegate.h" +#include "absl/container/internal/container_memory.h" +#include "absl/container/internal/raw_hash_set.h" // IWYU pragma: export + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace container_internal { + +template +class raw_hash_map : public raw_hash_set { + // P is Policy. It's passed as a template argument to support maps that have + // incomplete types as values, as in unordered_map. + // MappedReference<> may be a non-reference type. + template + using MappedReference = decltype(P::value( + std::addressof(std::declval()))); + + // MappedConstReference<> may be a non-reference type. + template + using MappedConstReference = decltype(P::value( + std::addressof(std::declval()))); + + using KeyArgImpl = + KeyArg::value && IsTransparent::value>; + + public: + using key_type = typename Policy::key_type; + using mapped_type = typename Policy::mapped_type; + template + using key_arg = typename KeyArgImpl::template type; + + static_assert(!std::is_reference::value, ""); + // TODO(alkis): remove this assertion and verify that reference mapped_type is + // supported. + static_assert(!std::is_reference::value, ""); + + using iterator = typename raw_hash_map::raw_hash_set::iterator; + using const_iterator = typename raw_hash_map::raw_hash_set::const_iterator; + + raw_hash_map() {} + using raw_hash_map::raw_hash_set::raw_hash_set; + + // The last two template parameters ensure that both arguments are rvalues + // (lvalue arguments are handled by the overloads below). This is necessary + // for supporting bitfield arguments. + // + // union { int n : 1; }; + // flat_hash_map m; + // m.insert_or_assign(n, n); + template + std::pair insert_or_assign(key_arg&& k, V&& v) { + return insert_or_assign_impl(std::forward(k), std::forward(v)); + } + + template + std::pair insert_or_assign(key_arg&& k, const V& v) { + return insert_or_assign_impl(std::forward(k), v); + } + + template + std::pair insert_or_assign(const key_arg& k, V&& v) { + return insert_or_assign_impl(k, std::forward(v)); + } + + template + std::pair insert_or_assign(const key_arg& k, const V& v) { + return insert_or_assign_impl(k, v); + } + + template + iterator insert_or_assign(const_iterator, key_arg&& k, V&& v) { + return insert_or_assign(std::forward(k), std::forward(v)).first; + } + + template + iterator insert_or_assign(const_iterator, key_arg&& k, const V& v) { + return insert_or_assign(std::forward(k), v).first; + } + + template + iterator insert_or_assign(const_iterator, const key_arg& k, V&& v) { + return insert_or_assign(k, std::forward(v)).first; + } + + template + iterator insert_or_assign(const_iterator, const key_arg& k, const V& v) { + return insert_or_assign(k, v).first; + } + + // All `try_emplace()` overloads make the same guarantees regarding rvalue + // arguments as `std::unordered_map::try_emplace()`, namely that these + // functions will not move from rvalue arguments if insertions do not happen. + template ::value, int>::type = 0, + K* = nullptr> + std::pair try_emplace(key_arg&& k, Args&&... args) { + return try_emplace_impl(std::forward(k), std::forward(args)...); + } + + template ::value, int>::type = 0> + std::pair try_emplace(const key_arg& k, Args&&... args) { + return try_emplace_impl(k, std::forward(args)...); + } + + template + iterator try_emplace(const_iterator, key_arg&& k, Args&&... args) { + return try_emplace(std::forward(k), std::forward(args)...).first; + } + + template + iterator try_emplace(const_iterator, const key_arg& k, Args&&... args) { + return try_emplace(k, std::forward(args)...).first; + } + + template + MappedReference